From nobody Mon May 6 04:42:45 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VXpgB0wLdz5JB2j; Mon, 06 May 2024 04:42: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 4VXpgB0L2rz4X7Z; Mon, 6 May 2024 04:42:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714970566; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qnt5pfxASXXbS2ZX3tpYoTL8kpsNgkEmzYCfjJ1GL/E=; b=mTQ5Un/K7daVQHDZTeUXiJuPFi8Tik5Js4WssDNiSGMXFNQz2l2S+yU7kd1Ppd7h1WYmIn onmEMQSOUIteeqSlA1L5062BUB1tVhIRdhqC+QmSrzMbBrvBFKB2daQ6jRG7JSFIrBywUw kM/MtawrJNgw/MztGIHJVtmW6ilozMS3f21qhlrqcEAuj2wWBB4RhmYUO6VSuBYNpACLeD Fho8JzHTgQL783Gzux/WvgckIc0pNeVn9ALm2BsyhZqGfriLU0xykq0OaM29APUWAJJOKo 2fYihQg90Aqmpof+zy+fs9f6m3DdY6vB57cIMlZON6zCzNb+cLZltUqJFCrGNQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714970566; a=rsa-sha256; cv=none; b=ljJDAd8Y/WiZe/1r+ixMxUjhVPCl+Wv5ut4V7z5AiSkiyK9g24Zz7+t2DeSI9cwSbk7FBA 58wkOamrRLx2DCNnxQRiaJBCsfAV01ToKyrdNiIkQ2EHUoF5KDERBhYb+42XSeXuZj4OeH 8Mq5q7mswLbeBcrH6vKdpcgugGusPDtZ/DpXKmfH5XDA14oBVi9gEQalwaBBINkG622xeW WV3D2b4L4qgjy9l1Gw2fOmZYquG5IAckPm2eFRw5+ca3x2yD8O7/Nj1Q/zFxN6mGGjIIp1 ndMLQAgBlyGBaIn7B/uTpJLl0Ozk1bQxyIJtwFwl563sWvToaYXL9DkfrZLtNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714970566; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qnt5pfxASXXbS2ZX3tpYoTL8kpsNgkEmzYCfjJ1GL/E=; b=iFGusZcEJOFCcBOHQZP7xonOWSGeevQYD4wdNSNAyfN/P6OhAdQXVcAaV17sn8PKdAa9co IavW1Okrm2xRIoSEbvYdLzOdDtUCfRAlnP6V+CyAPS9geBddymJGlsjwF3cgvfcORuBpSn 3temqNsHVIPTg6KLZrkGQyOmttjxYV7Eoxxxgrq9rFlmXbIdSaeIdLG2EWvhsamT6LDOjT OUEo4phVs4sthYGvd3IfEbSUl3hXqTN2gxyaFnK3tZKuD/UHwgL/MQ0Dhoz4DzoshS8ufZ 91Zovj8bboWqmq5erIN+pgWrzXQOnA9EzHo/fbe7aXH3FAZ7o8L6pXPC/hE03g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VXpg973vFzjKb; Mon, 6 May 2024 04:42:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4464gjnw049911; Mon, 6 May 2024 04:42:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4464gjVA049908; Mon, 6 May 2024 04:42:45 GMT (envelope-from git) Date: Mon, 6 May 2024 04:42:45 GMT Message-Id: <202405060442.4464gjVA049908@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: d63c680d39f5 - stable/14 - rtld: add direct-exec option -o List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d63c680d39f57ab36961a5b873f9962dc327d17e Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d63c680d39f57ab36961a5b873f9962dc327d17e commit d63c680d39f57ab36961a5b873f9962dc327d17e Author: Konstantin Belousov AuthorDate: 2024-04-28 03:19:39 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-06 04:42:19 +0000 rtld: add direct-exec option -o (cherry picked from commit d1cd0cc32b53c09e72e33116b94a5b0b9781a183) --- libexec/rtld-elf/rtld.1 | 20 +++++++++++++++++++- libexec/rtld-elf/rtld.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 index a152dd444bd7..0f1e8f68b10a 100644 --- a/libexec/rtld-elf/rtld.1 +++ b/libexec/rtld-elf/rtld.1 @@ -26,7 +26,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 29, 2023 +.Dd April 28, 2024 .Dt RTLD 1 .Os .Sh NAME @@ -352,6 +352,7 @@ The syntax of the direct invocation is .Op Fl b Ar exe .Op Fl d .Op Fl f Ar fd +.Op Fl o Ar OPT=NAME .Op Fl p .Op Fl u .Op Fl v @@ -387,6 +388,23 @@ If this option is specified, is only used to provide the .Va argv[0] value to the program. +.It Fl o Ar OPT=VALUE +Set the +.Ar OPT +configuration variable to the value +.Ar VALUE . +The possible variable names are listed above as +.Ev LD_ +prefixed environment variables, but here are referenced without the +.Ev LD_ +prefix. +A configuration variable set this way does not leak into +the activated image's environment. +.Pp +The option can be repeated as many times as needed to set +all configuration parameters. +The parameters set using this option have priority over +the same parameters assigned via environment. .It Fl p If the .Pa image_path diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index d5e702652058..0492b8f9d9f3 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -6155,6 +6155,35 @@ parse_args(char* argv[], int argc, bool *use_pathp, int *fdp, *fdp = fd; seen_f = true; break; + } else if (opt == 'o') { + struct ld_env_var_desc *l; + char *n, *v; + u_int ll; + + if (j != arglen - 1) { + _rtld_error("Invalid options: %s", arg); + rtld_die(); + } + i++; + n = argv[i]; + v = strchr(n, '='); + if (v == NULL) { + _rtld_error("No '=' in -o parameter"); + rtld_die(); + } + for (ll = 0; ll < nitems(ld_env_vars); ll++) { + l = &ld_env_vars[ll]; + if (v - n == (ptrdiff_t)strlen(l->n) && + strncmp(n, l->n, v - n) == 0) { + l->val = v + 1; + break; + } + } + if (ll == nitems(ld_env_vars)) { + _rtld_error("Unknown LD_ option %s", + n); + rtld_die(); + } } else if (opt == 'p') { *use_pathp = true; } else if (opt == 'u') { @@ -6238,6 +6267,7 @@ print_usage(const char *argv0) " -b Execute instead of , arg0 is \n" " -d Ignore lack of exec permissions for the binary\n" " -f Execute instead of searching for \n" + " -o = Set LD_ to , without polluting env\n" " -p Search in PATH for named binary\n" " -u Ignore LD_ environment variables\n" " -v Display identification information\n" From nobody Mon May 6 04:42:47 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VXpgC3DHlz5J9xl; Mon, 06 May 2024 04:42: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 4VXpgC1NVPz4Wtr; Mon, 6 May 2024 04:42:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714970567; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kOXDELYqtpaGbkEfF4bZq7Svj9YSQLWBPWeXTCC0G5g=; b=WZI/xkbyA1lw/D37HUCTaS7g6WK/PzSQtefD0emHNl5gyP8rodTUlLrnsStSYX0QEsloho J+o/GkrzQVp3JXJUci6eSceVSZJGPtfVzl/HD2twXh+kQdqesllD1PUEm7tz1SQhXHODnK tI2RtEN6kd9+23leCwnnhXWZnTuKsNszpn7gdj4VzPW9iSyeczzuIVH16OmlRZqgVqMdNB tePwbPebmKLakp5NkPgyl0ncq8k/lewqLwR6Fsp1NJ2AYBxanckD4gci9FbGT7dI00/Eiv KAoa15tsyfqOerXdb36+Pdh0/Y/cbWRXFd5y5jGQv7TmjrDtt3eQ2r7KrPQwFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714970567; a=rsa-sha256; cv=none; b=hXodQ3DYRMiu9B37ko5hTPvuS+RXSDtjRDvWi2NMfpAoqGXYYHHd1CqZg6SAnTiwAKuxLA TOt/CcME3LK0lXzl4RpwCn9vnNzFPjaoBkv/85J3Nlh7Hh7mfPsPTryNqnVSwx8nQfmZIR usX4OlyMbupbrl/T5tGLP1tjSs7NV4psnU1opmiYqyB26kj24YuqD/RXDPrgyIf35hexIE B3Jtha9MzVaStlMdw03H/qBHeeeCrBmYHzyu0Olzgte9SJLDKGFoAFjIaI/EtVhHQv/hP5 UKrL/3xiiolfdexua0iudmJAU2iE0MNPcZ+kzzoPWa4hyszd5x6a63rq8wmAkw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714970567; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kOXDELYqtpaGbkEfF4bZq7Svj9YSQLWBPWeXTCC0G5g=; b=wdYK1V9gyGdxV8relOkCWscQ1qKriEJZADeA3rE6qaYnU2r92c1v/mDLnhBtiDgYRlKKsr cVhcVSzRJspjTSZWWsgi9DHP35ad10diR/EG0kDBhJJOYJNON3ashgTsEGsyN8C47chAjl dKHYBiw6AgPwiia6VsDxbUusftKmQTVV33HBoynt0/4ubHH9tOlqoxviPmJQFHSGZg9Z5c mIXXJutrlLYwKNA3/5g0tza9rl+uHELNs9oIgZWOGS6DfybuP+Zu7Dwz4wPfdilD7io+lD uJeThVoCSfZF9WxV+Be0t14AUCqK/uPpva949QtDZ9T+J9aw4KsSo7kWOH1+FA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VXpgC0zmhzkDH; Mon, 6 May 2024 04:42:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4464glpt049966; Mon, 6 May 2024 04:42:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4464glBF049963; Mon, 6 May 2024 04:42:47 GMT (envelope-from git) Date: Mon, 6 May 2024 04:42:47 GMT Message-Id: <202405060442.4464glBF049963@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 6c85003139a4 - stable/14 - rtld direct exec: make -u behavior match the description List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6c85003139a4917bf617916e9aad8f024d847278 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6c85003139a4917bf617916e9aad8f024d847278 commit 6c85003139a4917bf617916e9aad8f024d847278 Author: Konstantin Belousov AuthorDate: 2024-04-28 20:57:54 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-06 04:42:19 +0000 rtld direct exec: make -u behavior match the description (cherry picked from commit ef2694f368cee5957ee44b0298da88ff8360d561) --- libexec/rtld-elf/rtld.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 0492b8f9d9f3..96042f7b5af3 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -6187,7 +6187,10 @@ parse_args(char* argv[], int argc, bool *use_pathp, int *fdp, } else if (opt == 'p') { *use_pathp = true; } else if (opt == 'u') { - trust = false; + u_int ll; + + for (ll = 0; ll < nitems(ld_env_vars); ll++) + ld_env_vars[ll].val = NULL; } else if (opt == 'v') { machine[0] = '\0'; mib[0] = CTL_HW; From nobody Mon May 6 04:42:48 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VXpgD4fGGz5J9vN; Mon, 06 May 2024 04:42: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 4VXpgD2Xghz4Wxq; Mon, 6 May 2024 04:42:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714970568; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aSy7A/iRjGv7PaS2JSdisav4bQRgXnO3tGcuvMIgHO0=; b=xWgxLvoAlPL1KEeuKEVCFh6eBD4YVOEz7HWFejSjDWPtluOilKAeNfJO2PkHzH4yzuH2s+ 4/IOTxSefDWoUfavAzMVVieapon1Y153jGg75+YdNgsxt+ckIA3XwMFLN9pvy7sp5RCxs2 dYM0Ab7K9mjpAQxDdhDJ6epiZKoGgIo3Z65EC3jXfyGDtu5zRjHafBKmTwvktMF46+j/3N Cb7GBR8iI55nNHygl+EeS69MV5HHDfROB6gO62ShBEfO24W3+efWgN+PtO6NaD+GLV+tBh ZYlBQWrpmRh9GP6iAtBqGesJn6mS0mGzUlhYnAUJz2zRpo0DbD88e+Kkx5yZRg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714970568; a=rsa-sha256; cv=none; b=S6EVHIW30sC26T7GJ59ihw1+kd+88tzNbHQLkhlk/nuib3DH4QpH9/jxI085eii1JiMR+S AP8EWDTA5cEs6gzf7x65gTYROoUWyBQsQVxpOlrTihcAzNC2IdP+3fv0Tb5xztdA02e79d eBT8n070SRa+yFGY6KiY+V9RNR1LxOkZToPvOnb8R3XzWqxfRDIxjEhSWyuOYQscgHEEn+ 8ZkVagbTF/xhjzjzBqChGWajND0PSvGATyAgPBL/oUpfx7E6I81KXU2HeR1WonN8pE0hRw dcqFXpadRSi0fVZWNQ2zKwCKmFoJP7xKMDMABzrDJUVxN8DCEVZI7oeL7uMJtA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714970568; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aSy7A/iRjGv7PaS2JSdisav4bQRgXnO3tGcuvMIgHO0=; b=tSJPr0M585UyIwF2ceeF842OwjQd+6PzSff4PUwKcqXNRq4xxm2636dMrJrVfyOInu6C/R hpERMtmYIfm59qK3RnmZA54HgxjJmXpvmEFfP2XVeAtwTzgAt5rgg2X5gRWKMS6XDKwmX+ q2baCeg5zvyGa9Jzz4GsDjbffI+3PzK6kkASXO6/muw8cwnS5y+lRWmc0jk9cO7NexNcpu DFJ19byg6+HXw8txt1QmQcL6Rn9x0CVyFRBatJ+Tcgf8/LH+fUDk8nBI2eCWIUgrMEuMLc k6JbRTlBhNURa5jEZ3XuUC6MpIuGkACVXLWgbwhBw0k7shXutkoRcCWnCG+Vrg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VXpgD20hSzjmR; Mon, 6 May 2024 04:42:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4464gmre050021; Mon, 6 May 2024 04:42:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4464gmGp050018; Mon, 6 May 2024 04:42:48 GMT (envelope-from git) Date: Mon, 6 May 2024 04:42:48 GMT Message-Id: <202405060442.4464gmGp050018@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 0d4750124623 - stable/14 - rtld.1: clarify interaction between -u and -o List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0d4750124623cb354cd4a072ed6b0e7db11a9e75 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0d4750124623cb354cd4a072ed6b0e7db11a9e75 commit 0d4750124623cb354cd4a072ed6b0e7db11a9e75 Author: Konstantin Belousov AuthorDate: 2024-04-28 21:45:12 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-06 04:42:19 +0000 rtld.1: clarify interaction between -u and -o (cherry picked from commit 6a7819e43f938992304472054c83f4a6602a9e19) --- libexec/rtld-elf/rtld.1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 index 0f1e8f68b10a..4cc5b639c89a 100644 --- a/libexec/rtld-elf/rtld.1 +++ b/libexec/rtld-elf/rtld.1 @@ -418,7 +418,9 @@ to find the binary to execute. .It Fl u Ignore all .Ev LD_ -environment variables that otherwise affect the dynamic +environment variables and previous command line +.Fl o +options that otherwise affect the dynamic linker behavior. .It Fl v Display information about this run-time linker binary, then exit. From nobody Mon May 6 06:04:08 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VXrT42bKkz5JLYq; Mon, 06 May 2024 06:04: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 4VXrT42806z4fMj; Mon, 6 May 2024 06:04:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714975448; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XLxmW9NGO6Z/gYlhh3NRBjKJJFoxKWcwqHt9iDeyAtE=; b=CHrx0Tgy22egkiuw78X34lV/0VyFXx8qLS/vpw27s0HxDt51SSclnMVAzsO4QsT4dKzq3A QOTGnlZrx2SvJSB4nbajp7XrS7ggQM9r/D1NHA0QmUToL5I696E5btOBuqBN3bT6cePa9U LfFfOZL5TxijQPdqRc8Arjw1XHNOleoN81M4TutQ8rf/nlj8ujAkx53MR4PWTrHUv+y+mm eR3ueyup3ctIUCbpNQPNISTwif+63zXdJEVoVVrk2/W5GqKQgz45yxGZBb+0YZcwflQ4B+ Kwab5JVbapsyjn+EciIw5VFduWQRCeFwASU33972joW568/jSGlWN4eypId8Dw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714975448; a=rsa-sha256; cv=none; b=Hmwvh0fCqINxMRa60+L0YsQRSt+s3KEZTYw1XYB1gQPOpNaLHPyjEkhgnLQvqc6WuWtYH5 5waoYv61mvkwXKPcfi/4WjaJYVq/w+lJfMwcyJAkQDFDgpTjrzcHkEuG7jK/LZT90SXRgA KvBGy7oWH9LQ3cX47es6r8a93ez0haNOHN2lzx8CU5KKs46s1F2Drc+bIXeYwzkTDLblY1 FbiAoLyFz0AMSTJyuyymfQXqGFstlcgKQiVNURVrhbBOWDsWqep0BcaIAep3xR86deEZ9s MmaiBz6qINo9wjRW/ebLFAXKo0yNE/eKPfgzCJmNK5MUuPzZCQlogNmuWBXO/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714975448; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XLxmW9NGO6Z/gYlhh3NRBjKJJFoxKWcwqHt9iDeyAtE=; b=HOKssFyMvOMxWnXIffAYULK7ViLtv7/1mstb7lroIGqKfwyuTAD1X6e3sWzw2N8SLkA5uK Q09d0n8b1zi/EPf4C2/+UGpqHA3HpEubp0DFx577MBoo2KqJ/p14DnGtBDBkN8W2Lep5pw lQ8aGEmOy0d8FwoVwczgHBzhxVRg59iMn98Hy2y0o1yeqKBqt8oNNXyBmTM2i1Hz14rPG6 8Ohlt4z61yvkXj0wWvZUquaaQKACSEJ4ga0/P05ZoVspLbzywJWZqBy0DwrfxsiYSWcays PC09b0tu9iUFWFUkC+pseE9+arHXTRbsjdcN3jr+rhE+UU0liHvcb7+ZNFillw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VXrT41ZcTzlZY; Mon, 6 May 2024 06:04:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4466487J086135; Mon, 6 May 2024 06:04:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 446648lR086132; Mon, 6 May 2024 06:04:08 GMT (envelope-from git) Date: Mon, 6 May 2024 06:04:08 GMT Message-Id: <202405060604.446648lR086132@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 45764d1d4856 - stable/14 - Tighten boundary check in split(1) to prevent a potential buffer overflow. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 45764d1d4856954fbfc48c11a715fad88821b135 Auto-Submitted: auto-generated The branch stable/14 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=45764d1d4856954fbfc48c11a715fad88821b135 commit 45764d1d4856954fbfc48c11a715fad88821b135 Author: Shawn Bayern AuthorDate: 2024-05-03 07:46:18 +0000 Commit: Xin LI CommitDate: 2024-05-06 05:59:08 +0000 Tighten boundary check in split(1) to prevent a potential buffer overflow. (cherry picked from commit 95032b58a1ad0fde57518f17805ca721bb4563ad) --- usr.bin/split/split.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr.bin/split/split.c b/usr.bin/split/split.c index e246a0d4adfc..52374c93efca 100644 --- a/usr.bin/split/split.c +++ b/usr.bin/split/split.c @@ -401,6 +401,10 @@ newfile(void) */ if (!dflag && autosfx && (fpnt[0] == 'y') && strspn(fpnt+1, "z") == strlen(fpnt+1)) { + /* Ensure the generated filenames will fit into the buffer. */ + if (strlen(fname) + 2 >= sizeof(fname)) + errx(EX_USAGE, "combined filenames would be too long"); + fpnt = fname + strlen(fname) - sufflen; fpnt[sufflen + 2] = '\0'; fpnt[0] = end; From nobody Mon May 6 06:05:04 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VXrV85rnZz5JLkZ; Mon, 06 May 2024 06:05:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VXrV858NKz4fRZ; Mon, 6 May 2024 06:05:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714975504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pg1g5NjCvdfHRbwHeEcbaCnXr8+yGFvHj0twezqgv7Y=; b=g1mCI+EDo55KjSllsocjo9mWxmHVdxyO94aag2pW7vhUxNY0JOQfHbx6BD0bp7mtqzmEqm 0sQo1T53m2RV62A63uTzxTuhfOLk3T6nz5xJINoTRBtW8lRvBR1ipifsEO9stz36ZLPYw/ i5rlxJ3tPETOG01ofIcrzIsjRMzq409wZR2zBWkp5+ZZOr9CgJpH+QuL0Qsp8V895wi3Lm Xpu3W2LsY0z3ZdcZ/nGFWRwCAOi9dvJw67wrNrvzgdnGO299p7ygQigbyH3FVhvqRCNZVS M/ryZaUzq3+fDhrBa2An0Zm8o0RoISx/lpiFdCR7UeJWGF9jowgfrvCqyTpBjw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714975504; a=rsa-sha256; cv=none; b=tis85CWFLSEXuBkrY51+cpqRzpOdK1nHJTaqNLXtQSEMM/m+H9ddAVQuXOnikHbp2IzFu0 yGW2yRegOSmxoetftyXYAW2uPq1xDzCL8TN9csHHN+p7INzQBaBgQ+efwSuKrwOVOZCxvF VQfdszDPBxlXWs/bEtvQGRFjq6SIiwpaDyD31502++pLudODzkUrDj7g6qNpAuewN2qo4l i4bLmEWHw8rF0QOV2rgQGdImGFWPJxU3WWnJzZniNsfHENKaga0pjgNivcHF3qWPNUO5Gj o5Q42veiHHDROmoW/twQazRAMgAQ0OUDNqcjGgt9ySME1YZrvoFV19jfjgCrTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714975504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pg1g5NjCvdfHRbwHeEcbaCnXr8+yGFvHj0twezqgv7Y=; b=AAA3+ahNTha72HJMRv8MxDyx90oehux0TVqukefPMO5cGjmwDf74zN8axtAR3HsIe+RfeS eWv78HCkQxmXiADk+aIH2sw/Tp6XYBA97LtVGv30bv3QzD/kg5aknu274b2HUgT8s84YAT 3j8NePSnMnpGmy6VRSalQ7ixXf/w9VObSZeVDdTplRW1kFbFPRZyw1IG2m+tVvZlUX+9Kn ENiCB1CVbWVCpqH2v6COUMEwcEQNJRJfsA3ZTzRcXyP4Wd3KVz7E7j2eevr/FjDTJId6Pl mJGZUvNfnwdEG9RdmXawzVtxAyLzTQK7OUETHAYZpOJ9IEEAEVDUq3XoUPtguQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VXrV84X7lzm12; Mon, 6 May 2024 06:05:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 446654Nj086433; Mon, 6 May 2024 06:05:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4466540j086430; Mon, 6 May 2024 06:05:04 GMT (envelope-from git) Date: Mon, 6 May 2024 06:05:04 GMT Message-Id: <202405060605.4466540j086430@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 6290fc5eeffc - stable/13 - Tighten boundary check in split(1) to prevent a potential buffer overflow. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6290fc5eeffc2cb145c1715d9b2a1ccf996660b6 Auto-Submitted: auto-generated The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=6290fc5eeffc2cb145c1715d9b2a1ccf996660b6 commit 6290fc5eeffc2cb145c1715d9b2a1ccf996660b6 Author: Shawn Bayern AuthorDate: 2024-05-03 07:46:18 +0000 Commit: Xin LI CommitDate: 2024-05-06 06:04:43 +0000 Tighten boundary check in split(1) to prevent a potential buffer overflow. (cherry picked from commit 95032b58a1ad0fde57518f17805ca721bb4563ad) --- usr.bin/split/split.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr.bin/split/split.c b/usr.bin/split/split.c index e246a0d4adfc..52374c93efca 100644 --- a/usr.bin/split/split.c +++ b/usr.bin/split/split.c @@ -401,6 +401,10 @@ newfile(void) */ if (!dflag && autosfx && (fpnt[0] == 'y') && strspn(fpnt+1, "z") == strlen(fpnt+1)) { + /* Ensure the generated filenames will fit into the buffer. */ + if (strlen(fname) + 2 >= sizeof(fname)) + errx(EX_USAGE, "combined filenames would be too long"); + fpnt = fname + strlen(fname) - sufflen; fpnt[sufflen + 2] = '\0'; fpnt[0] = end; From nobody Tue May 7 00:04:40 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VYJRr6X6bz5Jg9h; Tue, 07 May 2024 00:04: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 4VYJRr5x1Mz4bDQ; Tue, 7 May 2024 00:04:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715040280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bpQazWq5+AxGfLMTurAgqJf/8au02rsvi77xKiBGSzo=; b=XZmqjPzs/lIXe4Qxx7BD3q7PyQ1QG4Eto3kofRPtiO9oRJhknXVlOKPe+s20MEaDOx+YCf cXoz7R0jOBEX9aXhLr/Ns89FMjgEeE7uz4JwQEVSV2o816a1YUFz70ydt17ztRjQCBB8Id ncLQ0YMtKqgL4fnXCsRTs+RUu182QUJDODMW1yeJUjyNSl/CU/QkPNBnGF5w9Fz8/EfB+9 qpjoPGHgNofCuy9cSP/h3XlFKjrir4xkbilVFVI3bfg4ba5fvj3CPyLZvE784qSadUTWNC flvv0rqw/q52CA5c7/jZWH2f4uSDR6iwaRDwaJX0zjbGgXO9QafoHdzCevVekA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715040280; a=rsa-sha256; cv=none; b=RHRfnI5iPKktJKTK2nhVI4VUe71ekrG3bsDMaZlNhuKk2NHJnnCEG5ByS36toBu9SXFTei CqGB+D/RIKYjqieiUOp3mkkZ96mtNoXa1CFNnJmYqbs4N4siwsE2ICmYfaZSJvXybJ+aaG gmPEtjiTpwqet98zHpXmjc67/1IOcNCyNEPGaWHOKTryo3k3YdKPSpF2FWNQMb1iPIab3d ibLDaUUnzx5JdQ6wq3csenw/rUeWVxAmSU+nBkqu+sGqvjrf/BngM8Sdux054XkBqMMHzW yG9wQPGxVUzBlS+GUTjHkz+3z1MAnASUDKCWCu0B7troHgVK5zhA/05m7yLRZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715040280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bpQazWq5+AxGfLMTurAgqJf/8au02rsvi77xKiBGSzo=; b=WvQ1XkRCmQLI3rCu0IkN5yaAlzJF76foUR2QKpXIxumekHwIpka16cbg84bzdL7UyxSwzO D9uB1cbwKnllo2yXmcCtNKQEglN8dxr5vPh2oqFAbnSDpkI9ugcVqY/AjFz62jO4FpX5JO xl7sYhFgwhJVFRPB7iclRqmOBuL06Q75JRsCgYf2GpTIEtsA2aLFanpSd8e0E9apbt1qYd 8NaJ8MscrZabEEDHrtvtHfHZu9Qs7FF0KzzE9Nb6lNmozjYJ+Vsmi5WQolmPk5SvPYtV6e N/b4bjaPdw0o5PYLeWJN4W5HP04A2po0W0FT2AyGaPF33QD5CsvN7aWI1njVPQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VYJRr5SHlzJX2; Tue, 7 May 2024 00:04:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44704eu8021133; Tue, 7 May 2024 00:04:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44704eBi021130; Tue, 7 May 2024 00:04:40 GMT (envelope-from git) Date: Tue, 7 May 2024 00:04:40 GMT Message-Id: <202405070004.44704eBi021130@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 8d0ca017408e - stable/13 - Update capsicum-test to eab7a83b05becf64439b4b256b3d756b353fbbbb List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8d0ca017408ed87de0e3f8746421e88a834b9bb0 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=8d0ca017408ed87de0e3f8746421e88a834b9bb0 commit 8d0ca017408ed87de0e3f8746421e88a834b9bb0 Author: Ed Maste AuthorDate: 2022-09-13 17:39:02 +0000 Commit: Ed Maste CommitDate: 2024-05-07 00:03:52 +0000 Update capsicum-test to eab7a83b05becf64439b4b256b3d756b353fbbbb (cherry picked from commit 4ee9db7a1d428a0c067ad4c65591972872eb2ade) PR: 266112 --- contrib/capsicum-test/syscalls.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/contrib/capsicum-test/syscalls.h b/contrib/capsicum-test/syscalls.h index 592a1677e1f1..3ea8803c2f64 100644 --- a/contrib/capsicum-test/syscalls.h +++ b/contrib/capsicum-test/syscalls.h @@ -47,16 +47,29 @@ inline int bogus_mount_() { /* Mappings for extended attribute functions */ #include +#include +static const char *fbsd_extattr_skip_prefix(const char *p) { + if (*p++ == 'u' && *p++ == 's' && *p++ == 'e' && *p++ == 'r' && *p++ == '.') + return p; + errno = EINVAL; + return NULL; +} inline ssize_t flistxattr_(int fd, char *list, size_t size) { return extattr_list_fd(fd, EXTATTR_NAMESPACE_USER, list, size); } inline ssize_t fgetxattr_(int fd, const char *name, void *value, size_t size) { + if (!(name = fbsd_extattr_skip_prefix(name))) + return -1; return extattr_get_fd(fd, EXTATTR_NAMESPACE_USER, name, value, size); } inline int fsetxattr_(int fd, const char *name, const void *value, size_t size, int) { + if (!(name = fbsd_extattr_skip_prefix(name))) + return -1; return extattr_set_fd(fd, EXTATTR_NAMESPACE_USER, name, value, size); } inline int fremovexattr_(int fd, const char *name) { + if (!(name = fbsd_extattr_skip_prefix(name))) + return -1; return extattr_delete_fd(fd, EXTATTR_NAMESPACE_USER, name); } From nobody Tue May 7 08:59:32 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VYXK03MDcz5KPHW; Tue, 07 May 2024 08:59: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 4VYXK02gmNz4Ztb; Tue, 7 May 2024 08:59:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715072372; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WvBcAo3Bipb06nXhOpzJ5w3ccB5HZhCaOLAmyM+Ps+E=; b=MVgOUF2246ZB+MkNUs1VY15jT9OXf7exnH0HpjJr5mIZakuRBUCCZ55uXeiX96si0Sb/xb a28eupodCSNF+cDZuk/vmYiD+f0umywf64jvPreIaz4hC0jo+8qdh3ixiA+AfqH0kxlr/W htcqsm0f4ZRp3Ut7Liu2AuKdI1O7CTGy8aQuU2ImqZq8lPyqGluFttjsRZpQAr9bOZeh5d Lu0K4z208VMN4AH9Le1hc44gR4Cv+jut3nBXQKZ/MKCDk5xndGqzNgW+z2Mk58uTbFPZ9V HYlURtVfdIfKI8fSU00dW6JtJZp/9vnVd1qSna2W+CaLMloI8u/1W2q2s2tx6g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715072372; a=rsa-sha256; cv=none; b=KlyTH4XZaeAvZegqNzLl/4p+okRz9yARs/XbtFkog+JXVMgEXa3ZBljTfQpr0tn13zcTrw Vt2ozWZo1KBaCN9Y8tEvWe0RaohxqInzdR/wGvWqSw/nucMyqw3ovaG9VZMCiKy9brFcmQ B6/kqYtMYIqeF5o7EEmtR/BI/k1nWWjjQqnWQtIYE+x/DtLlBUsW5R/LjEXhoL1Y9YR6Cb KM4V+KQOflbtVBHgZotKYhvmPp9Clua0peyuZVsabX+ixSAav7h1XaaP63XGwYgrKbhVF6 piPT0EzGSwfhvG+YYclrfAIvEI+ugraq+wVqJ45Sr/rLinNu1S2P4glMHN9Qug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715072372; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WvBcAo3Bipb06nXhOpzJ5w3ccB5HZhCaOLAmyM+Ps+E=; b=ke2tMbCxG+vb+Tcu+gIyqw5cEsi5ru5qJFqapBwhwGsDJTk1y5N7hd34rOVio4ecoVr8P9 yG2dnuKfpC2esx7DoiVyhBcc3gVm0ahny2R/mK7jvfEyy8/5rj4/5tlEmKFtvTCSIkMcnz 3wngxk33pcXoZdqVJUUeelJqQ0AksUb+imlZBmo/8X/xeC35pcuD7GbEOMb2GrmAt/sDcV Z9+HC1ZU5XK2ZxbZXddWAf8QksJqFBfUrDvqhfiDAGN1P/EKX37989U5S34nalrVOGWRlc zxVn7aIENOvvDlgFCEZO78vyQLy5grNlCyAw42mBWsc4cxNqRorE1jCRB5heew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VYXK02HDszb8V; Tue, 7 May 2024 08:59:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4478xWSr021502; Tue, 7 May 2024 08:59:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4478xWcQ021499; Tue, 7 May 2024 08:59:32 GMT (envelope-from git) Date: Tue, 7 May 2024 08:59:32 GMT Message-Id: <202405070859.4478xWcQ021499@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 10484ee13a36 - stable/13 - rtld: add direct-exec option -o List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 10484ee13a36e3b0523e8de441c4d528148fd1a3 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=10484ee13a36e3b0523e8de441c4d528148fd1a3 commit 10484ee13a36e3b0523e8de441c4d528148fd1a3 Author: Konstantin Belousov AuthorDate: 2024-04-28 03:19:39 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-07 08:59:07 +0000 rtld: add direct-exec option -o (cherry picked from commit d1cd0cc32b53c09e72e33116b94a5b0b9781a183) --- libexec/rtld-elf/rtld.1 | 20 +++++++++++++++++++- libexec/rtld-elf/rtld.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 index a152dd444bd7..0f1e8f68b10a 100644 --- a/libexec/rtld-elf/rtld.1 +++ b/libexec/rtld-elf/rtld.1 @@ -26,7 +26,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 29, 2023 +.Dd April 28, 2024 .Dt RTLD 1 .Os .Sh NAME @@ -352,6 +352,7 @@ The syntax of the direct invocation is .Op Fl b Ar exe .Op Fl d .Op Fl f Ar fd +.Op Fl o Ar OPT=NAME .Op Fl p .Op Fl u .Op Fl v @@ -387,6 +388,23 @@ If this option is specified, is only used to provide the .Va argv[0] value to the program. +.It Fl o Ar OPT=VALUE +Set the +.Ar OPT +configuration variable to the value +.Ar VALUE . +The possible variable names are listed above as +.Ev LD_ +prefixed environment variables, but here are referenced without the +.Ev LD_ +prefix. +A configuration variable set this way does not leak into +the activated image's environment. +.Pp +The option can be repeated as many times as needed to set +all configuration parameters. +The parameters set using this option have priority over +the same parameters assigned via environment. .It Fl p If the .Pa image_path diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 1078ddd0551a..071a7cf8dde8 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -6201,6 +6201,35 @@ parse_args(char* argv[], int argc, bool *use_pathp, int *fdp, *fdp = fd; seen_f = true; break; + } else if (opt == 'o') { + struct ld_env_var_desc *l; + char *n, *v; + u_int ll; + + if (j != arglen - 1) { + _rtld_error("Invalid options: %s", arg); + rtld_die(); + } + i++; + n = argv[i]; + v = strchr(n, '='); + if (v == NULL) { + _rtld_error("No '=' in -o parameter"); + rtld_die(); + } + for (ll = 0; ll < nitems(ld_env_vars); ll++) { + l = &ld_env_vars[ll]; + if (v - n == (ptrdiff_t)strlen(l->n) && + strncmp(n, l->n, v - n) == 0) { + l->val = v + 1; + break; + } + } + if (ll == nitems(ld_env_vars)) { + _rtld_error("Unknown LD_ option %s", + n); + rtld_die(); + } } else if (opt == 'p') { *use_pathp = true; } else if (opt == 'u') { @@ -6284,6 +6313,7 @@ print_usage(const char *argv0) " -b Execute instead of , arg0 is \n" " -d Ignore lack of exec permissions for the binary\n" " -f Execute instead of searching for \n" + " -o = Set LD_ to , without polluting env\n" " -p Search in PATH for named binary\n" " -u Ignore LD_ environment variables\n" " -v Display identification information\n" From nobody Tue May 7 08:59:33 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VYXK15WLsz5KPHY; Tue, 07 May 2024 08:59: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 4VYXK13MS2z4Zkt; Tue, 7 May 2024 08:59:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715072373; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tPGE/B+UrBB2dRENwZtmE/QtSCinsmljeQTAT0MCIWQ=; b=h4Dv74qqUdxtdMdAQ1/aV7ZQBWS6gr2qLCA6lAx9isATNT3T0/gL9ImRYmpAnrw2gErb0p Df2iiKbNTaxFAb0+TVcekb7ub+wDdGDp48SKn4qGusBh9FlA7m3y6bnZw9XLedN3AXjWNM dhX0JdTNZ+npyKg2NeHI9YsUBx3ENO9ABRDLH9waW4AEYUgsP8/fZvK71i9eUOXRR5JfRM vkW4klHRYqC93i+B4DTREsgAMaYGsEBcKXIRo4iMPrd6B62wwzOo4XbCOG1ZvR7si3c5XV zZlEJODJzLhyDFY+K/ZzaF1rvBlHvXuhYK5qzwRVeu3+1SqXUo3/YRUkNS1MZg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715072373; a=rsa-sha256; cv=none; b=JVJVJ+znoRW7SaBUXpVcP6cH6cEa1htgueWGv5dc8W7ZP1K5B//vrE9m2ifkhJ77FkGisn Tt43qeBGuEj/Q69TwEwPosQiIupM+qWnL7EGokuvqqN0HRgSbpIpVhN6Xdf4NEtztwpzWJ rxxt0p/8U6F+o7xTUwztDrCdYpStwUh4vuV7WF2rsOBocyaw47Sp1bQRT4LduiPINWKy3g 385OvGS4JfsmGrX1PsmsKODIbhVv1s7ZCpTCVgKJB5nxkK9JPosI9JOsu0QqnCkMruu2YJ osrK+dsg/o8H+mEugYgInNQ3mP732CKnvvUu0xKGTsUFdXEJoy9rWiZwNdQDDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715072373; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tPGE/B+UrBB2dRENwZtmE/QtSCinsmljeQTAT0MCIWQ=; b=HkbRONXSByzc5lf9LuCKbnCnzwnGTnoaCKIYOHP4LRZbguerWlQq4sPSgV2NCQ1nmnRoeS nZ54vMUpL+xIRf7HrNInnYlrbafPmmX/87W7nD/6Tjgw8nRQ/FrB0r3iQZWy/DwYGbOYIr 1Xj3fvLH1FWMRsZwpQ/V1Vhe1SJqLhcOWPthVBcS6U4AFgFxW0A/8F36R9IDqAWy6/R5up 8tjljEfDPCuU1uw8FegvH+a1PHIupzhrwjgfxP2YI528/xqYQmevStvgT4yZoZTG4ESC02 YQB6NXd1iRHmMJnH0jnok1wxmombk74HomFLLpJvWk0cj4p5IXgw2jgZa36VIQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VYXK12zVpzbTJ; Tue, 7 May 2024 08:59:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4478xXZ0021556; Tue, 7 May 2024 08:59:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4478xXS3021553; Tue, 7 May 2024 08:59:33 GMT (envelope-from git) Date: Tue, 7 May 2024 08:59:33 GMT Message-Id: <202405070859.4478xXS3021553@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: e45b440633f9 - stable/13 - rtld direct exec: make -u behavior match the description List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e45b440633f9878baf019d3ef557bd2be103c3f9 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e45b440633f9878baf019d3ef557bd2be103c3f9 commit e45b440633f9878baf019d3ef557bd2be103c3f9 Author: Konstantin Belousov AuthorDate: 2024-04-28 20:57:54 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-07 08:59:07 +0000 rtld direct exec: make -u behavior match the description (cherry picked from commit ef2694f368cee5957ee44b0298da88ff8360d561) --- libexec/rtld-elf/rtld.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 071a7cf8dde8..7110ba6c4c1a 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -6233,7 +6233,10 @@ parse_args(char* argv[], int argc, bool *use_pathp, int *fdp, } else if (opt == 'p') { *use_pathp = true; } else if (opt == 'u') { - trust = false; + u_int ll; + + for (ll = 0; ll < nitems(ld_env_vars); ll++) + ld_env_vars[ll].val = NULL; } else if (opt == 'v') { machine[0] = '\0'; mib[0] = CTL_HW; From nobody Tue May 7 08:59:34 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VYXK30LD3z5KNsX; Tue, 07 May 2024 08:59: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 4VYXK24wjnz4Ztl; Tue, 7 May 2024 08:59:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715072374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=snhyQRuJ1r8UZcJf20+4anvzuPSVYgKUvpSxYO91mGM=; b=Ph/whtFpbvmCgsI5sPsRVIXA1QSh6Y2YyCmejUF1VvbdcLM+zJ+7lGHasEvBZGCyZle6B9 yFA77DgzEJxBYA1UMPRWf92oYIW5Asn9eQPGwIZIXTS3efTjITJ4Y6qGxmlJbWWRbU8ce7 fpX7+AeLgAjkP+H5DMfnWDWq0cYTFkRNq8VV0iNlD+GiFcbwdZNKuzxzsohByTZ7Gl5ZSc P5M06Tid2gG/f9ZiJJVolIxVG55Vv8lJEui29dobHizypYxAv7cMt3rBeExMeTk9hfV6ng 5YZPPEzQbi+cqJrZl+ZdCtuhfs1jXA+/3zPDlOW8Hq9uFZK+JyizxGPQj3VZ2Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715072374; a=rsa-sha256; cv=none; b=Ohwt2kHVL6gJdM7HBxGOAymhLqCrQNkaHfVQalSo5/ynf0Y+O0UPNPd65OeudxurS2CrE5 D/T0lldumDgYloD+DyuGgQvJD4qK0JoRqqZOL44gOFFIKUwuf6EP2lVoRDDs7F4piMnxlU 7+dbjg+smPZSfU2BCzxNGD+YgQH25gAbzJElwEkxNBu/n5Uac5lHLORZFU13T8nzvvwgbU VJXJU37YNlCnBkv8b8JDdNpgoIawKnFE1otVSYDaXt7KR74OTh2iFINEowBKMRAoLXMeGt jTLsg/IyfEddJ7Qm38kf9uxhEs5ZhOTLkJpaahDALeCpILYagGXXFkGtvpnseA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715072374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=snhyQRuJ1r8UZcJf20+4anvzuPSVYgKUvpSxYO91mGM=; b=WQkhe5m8NQ8mzVGApRGVbNCEydoD+29I4ZsQI234QeVphh+HS0MkfvdwgGZqxBdtxllFyt JEsrEe/wHt6Nr4E8GwRW1/JfNVOgzsMRsZT+3BBupAF1eskW+bliWdXepYz78LjJBAlpg6 kDTQRLCsREi10MORAaezz9q9B0tVxsel1f1ufgoGj/EiX+dxzwdFbOJG7LrIJH6GJGXtCQ Yr4JT9sfFkKy9SVbH29Z4wKRjHtWyio4cPy4dDxHwRxUxXixS0yHKbxTYUkzLbx2UDVP3f U+tsO01ch6i327cie9yB0TMf5OTdkd06nJryXqM8+/qUKaOn8VBxeb4WpqKmBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VYXK24JBXzbTK; Tue, 7 May 2024 08:59:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4478xYEx021604; Tue, 7 May 2024 08:59:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4478xYfD021601; Tue, 7 May 2024 08:59:34 GMT (envelope-from git) Date: Tue, 7 May 2024 08:59:34 GMT Message-Id: <202405070859.4478xYfD021601@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: f73055ab1e2f - stable/13 - rtld.1: clarify interaction between -u and -o List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f73055ab1e2f46620759da0aba19c8f4a11316bd Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f73055ab1e2f46620759da0aba19c8f4a11316bd commit f73055ab1e2f46620759da0aba19c8f4a11316bd Author: Konstantin Belousov AuthorDate: 2024-04-28 21:45:12 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-07 08:59:07 +0000 rtld.1: clarify interaction between -u and -o (cherry picked from commit 6a7819e43f938992304472054c83f4a6602a9e19) --- libexec/rtld-elf/rtld.1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 index 0f1e8f68b10a..4cc5b639c89a 100644 --- a/libexec/rtld-elf/rtld.1 +++ b/libexec/rtld-elf/rtld.1 @@ -418,7 +418,9 @@ to find the binary to execute. .It Fl u Ignore all .Ev LD_ -environment variables that otherwise affect the dynamic +environment variables and previous command line +.Fl o +options that otherwise affect the dynamic linker behavior. .It Fl v Display information about this run-time linker binary, then exit. From nobody Tue May 7 17:05:15 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VYl5S1zsBz5JFBk; Tue, 07 May 2024 17:05: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 4VYl5R302rz4Ywm; Tue, 7 May 2024 17:05:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715101515; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UQdO7Kil2dgOtbrxjtXOEJP50l8OomrlDfXYZ68hvMg=; b=RK+3kZulxbmrUUDN0qdLWs6j+fUaWch3w0+SCMlGbbtIebbKudsh+/ybxU/zH2vyuyzkSo 43IXYmd2t/yhHMv4erf0Ua5pfj1rnaOxfVnHBBTjcWIKAI+R51gRIdbqXh7jXknGVH97Zl qm6wZGXLJZASXH1nkd/gHf8U+xiWAu+lhJqD2pNFPhddiPyuX8tRULKKspcueIuGoxY5PN GcE5soJrAraybaU5uZYtx1/EiGAa7MMgM2d4beXgqd5Q/9qj1kCMfHcHapwhey3scAcHbC ecKjfrF276i94KgtjVUBrpANqH9h+ERrr2TCknvuTmYMnY4ihWybu3VKdemXWQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715101515; a=rsa-sha256; cv=none; b=ERcmrjO1kYt9SxrZVGxqm9Qb2cSqU12ae0fW2wu29QndHu24QAYHb6QV9UG3ALN1fNHm67 enSehjudUD9yly1QPJj48/8wpQ/X/kRYwnkntDWyCvMP7h1qoDCxAYWlQmujav2L6CykH0 T/6P6lpIvyUqVgUYYm9efn77qTipsxWA7pbErYN06kaoWatQF13xcMP7sVJVNZ6lVpI19q BpVmhQYfwOXHLC08eDXdOysVzDhs2x137NUKdJNPzpm07r/nFAM8KBT1m6qGmE+2yPVugO +R/koM88UXtwn0YPOozRHjXD+kBHH2WQRG92gs9+AkvKGffhM4voEyny2qP3eg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715101515; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UQdO7Kil2dgOtbrxjtXOEJP50l8OomrlDfXYZ68hvMg=; b=YbYRgQ41bsYzrztvY2zAXProi1cnr6ZQT8jW/KUBIapfGZQsSaXdpvLRWzGSrIObs0yS1z lCmQNnpa6kGbEeME3Hr9JLGWkIwmqaRaxEJbrFVLuH7XfDdVBN8cPSCqPSW49oDtStEBwd j/08qD1KxUJeU8mK8XFZkyXba0cSaZ0ok/wFNxw93/blRPvMYxczAxYVg/GG2oaAj1Rtl6 HPfcBNeeaVYEzeewaT93EWOT+YHzH7ItZVTIhAw/7H4taIUne7Fwp9TvmSzn6tuM+tbpgo fnXJ9CI9Cz3Sq2Yx4ag7oHk46x02LzakL2LTKmtIG9da2MJXC/3xKB1yZm8oOg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VYl5R2ZYMzpkF; Tue, 7 May 2024 17:05:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 447H5FAo051533; Tue, 7 May 2024 17:05:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 447H5FXF051530; Tue, 7 May 2024 17:05:15 GMT (envelope-from git) Date: Tue, 7 May 2024 17:05:15 GMT Message-Id: <202405071705.447H5FXF051530@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: fe72d8ecb98d - stable/14 - Merge llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fe72d8ecb98dd51a9faf62b1e14d4dde25d61e5b Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=fe72d8ecb98dd51a9faf62b1e14d4dde25d61e5b commit fe72d8ecb98dd51a9faf62b1e14d4dde25d61e5b Author: Dimitry Andric AuthorDate: 2024-05-04 10:19:32 +0000 Commit: Dimitry Andric CommitDate: 2024-05-07 17:03:16 +0000 Merge llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9 This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9. PR: 276104 MFC after: 3 days (cherry picked from commit 5678d1d98a348f315453555377ccb28821a2ffcd) --- .../llvm-project/clang/lib/CodeGen/CGBuiltin.cpp | 25 ++++++----- contrib/llvm-project/clang/lib/CodeGen/CGCall.cpp | 5 +++ .../llvm-project/clang/lib/CodeGen/CGObjCGNU.cpp | 34 ++++++++------- .../llvm-project/clang/lib/CodeGen/CodeGenModule.h | 3 ++ .../clang/lib/CodeGen/CoverageMappingGen.cpp | 11 +++-- .../clang/lib/CodeGen/MicrosoftCXXABI.cpp | 12 ++++-- .../clang/lib/Format/ContinuationIndenter.cpp | 8 +++- .../clang/lib/Format/TokenAnnotator.cpp | 10 ++--- .../clang/lib/Format/UnwrappedLineParser.cpp | 40 ++++++++++-------- .../clang/lib/StaticAnalyzer/Checkers/Taint.cpp | 14 +++---- .../Checkers/cert/InvalidPtrChecker.cpp | 6 ++- .../libcxx/modules/std.compat/cstdlib.inc | 2 +- .../include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h | 20 +++++++-- .../llvm/lib/CodeGen/CodeGenPrepare.cpp | 2 + .../llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | 4 +- .../lib/CodeGen/GlobalISel/LegalizerHelper.cpp | 4 ++ .../llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp | 48 +++++++++++++--------- .../llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 9 +++- .../llvm/lib/Target/AArch64/AArch64InstrInfo.td | 10 ----- .../llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp | 10 ++--- .../llvm/lib/Target/RISCV/RISCVISelLowering.cpp | 2 +- .../llvm/lib/Target/X86/X86ISelDAGToDAG.cpp | 7 ++-- .../llvm/lib/Target/X86/X86ISelLowering.cpp | 29 +++++++------ .../llvm/lib/Target/X86/X86Subtarget.h | 3 +- .../llvm-project/llvm/lib/TargetParser/Host.cpp | 5 ++- .../Transforms/InstCombine/InstCombineSelect.cpp | 2 +- .../Scalar/InductiveRangeCheckElimination.cpp | 3 ++ 27 files changed, 200 insertions(+), 128 deletions(-) diff --git a/contrib/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp b/contrib/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp index a4f26a6f0eb1..44ddd2428b10 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp @@ -823,29 +823,32 @@ const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberField( ASTContext &Ctx, const RecordDecl *RD, StringRef Name, uint64_t &Offset) { const LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel = getLangOpts().getStrictFlexArraysLevel(); - unsigned FieldNo = 0; - bool IsUnion = RD->isUnion(); + uint32_t FieldNo = 0; - for (const Decl *D : RD->decls()) { - if (const auto *Field = dyn_cast(D); - Field && (Name.empty() || Field->getNameAsString() == Name) && + if (RD->isImplicit()) + return nullptr; + + for (const FieldDecl *FD : RD->fields()) { + if ((Name.empty() || FD->getNameAsString() == Name) && Decl::isFlexibleArrayMemberLike( - Ctx, Field, Field->getType(), StrictFlexArraysLevel, + Ctx, FD, FD->getType(), StrictFlexArraysLevel, /*IgnoreTemplateOrMacroSubstitution=*/true)) { const ASTRecordLayout &Layout = Ctx.getASTRecordLayout(RD); Offset += Layout.getFieldOffset(FieldNo); - return Field; + return FD; } - if (const auto *Record = dyn_cast(D)) - if (const FieldDecl *Field = - FindFlexibleArrayMemberField(Ctx, Record, Name, Offset)) { + QualType Ty = FD->getType(); + if (Ty->isRecordType()) { + if (const FieldDecl *Field = FindFlexibleArrayMemberField( + Ctx, Ty->getAsRecordDecl(), Name, Offset)) { const ASTRecordLayout &Layout = Ctx.getASTRecordLayout(RD); Offset += Layout.getFieldOffset(FieldNo); return Field; } + } - if (!IsUnion && isa(D)) + if (!RD->isUnion()) ++FieldNo; } diff --git a/contrib/llvm-project/clang/lib/CodeGen/CGCall.cpp b/contrib/llvm-project/clang/lib/CodeGen/CGCall.cpp index 28c211aa631e..a6a2f3595fe7 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/CGCall.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/CGCall.cpp @@ -1581,6 +1581,11 @@ bool CodeGenModule::ReturnTypeUsesSRet(const CGFunctionInfo &FI) { return RI.isIndirect() || (RI.isInAlloca() && RI.getInAllocaSRet()); } +bool CodeGenModule::ReturnTypeHasInReg(const CGFunctionInfo &FI) { + const auto &RI = FI.getReturnInfo(); + return RI.getInReg(); +} + bool CodeGenModule::ReturnSlotInterferesWithArgs(const CGFunctionInfo &FI) { return ReturnTypeUsesSRet(FI) && getTargetCodeGenInfo().doesReturnSlotInterfereWithArgs(); diff --git a/contrib/llvm-project/clang/lib/CodeGen/CGObjCGNU.cpp b/contrib/llvm-project/clang/lib/CodeGen/CGObjCGNU.cpp index a36b0cdddaf0..05e3f8d4bfc2 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/CGObjCGNU.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/CGObjCGNU.cpp @@ -2903,23 +2903,29 @@ CGObjCGNU::GenerateMessageSend(CodeGenFunction &CGF, break; case CodeGenOptions::Mixed: case CodeGenOptions::NonLegacy: + StringRef name = "objc_msgSend"; if (CGM.ReturnTypeUsesFPRet(ResultType)) { - imp = - CGM.CreateRuntimeFunction(llvm::FunctionType::get(IdTy, IdTy, true), - "objc_msgSend_fpret") - .getCallee(); + name = "objc_msgSend_fpret"; } else if (CGM.ReturnTypeUsesSRet(MSI.CallInfo)) { - // The actual types here don't matter - we're going to bitcast the - // function anyway - imp = - CGM.CreateRuntimeFunction(llvm::FunctionType::get(IdTy, IdTy, true), - "objc_msgSend_stret") - .getCallee(); - } else { - imp = CGM.CreateRuntimeFunction( - llvm::FunctionType::get(IdTy, IdTy, true), "objc_msgSend") - .getCallee(); + name = "objc_msgSend_stret"; + + // The address of the memory block is be passed in x8 for POD type, + // or in x0 for non-POD type (marked as inreg). + bool shouldCheckForInReg = + CGM.getContext() + .getTargetInfo() + .getTriple() + .isWindowsMSVCEnvironment() && + CGM.getContext().getTargetInfo().getTriple().isAArch64(); + if (shouldCheckForInReg && CGM.ReturnTypeHasInReg(MSI.CallInfo)) { + name = "objc_msgSend_stret2"; + } } + // The actual types here don't matter - we're going to bitcast the + // function anyway + imp = CGM.CreateRuntimeFunction(llvm::FunctionType::get(IdTy, IdTy, true), + name) + .getCallee(); } // Reset the receiver in case the lookup modified it diff --git a/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.h b/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.h index ec34680fd3f7..d9ece4d98eec 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.h +++ b/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.h @@ -1239,6 +1239,9 @@ public: /// Return true iff the given type uses 'sret' when used as a return type. bool ReturnTypeUsesSRet(const CGFunctionInfo &FI); + /// Return true iff the given type has `inreg` set. + bool ReturnTypeHasInReg(const CGFunctionInfo &FI); + /// Return true iff the given type uses an argument slot when 'sret' is used /// as a return type. bool ReturnSlotInterferesWithArgs(const CGFunctionInfo &FI); diff --git a/contrib/llvm-project/clang/lib/CodeGen/CoverageMappingGen.cpp b/contrib/llvm-project/clang/lib/CodeGen/CoverageMappingGen.cpp index 0c43317642bc..ae4e6d4c88c0 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/CoverageMappingGen.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/CoverageMappingGen.cpp @@ -1207,6 +1207,12 @@ struct CounterCoverageMappingBuilder /// Find a valid gap range between \p AfterLoc and \p BeforeLoc. std::optional findGapAreaBetween(SourceLocation AfterLoc, SourceLocation BeforeLoc) { + // Some statements (like AttributedStmt and ImplicitValueInitExpr) don't + // have valid source locations. Do not emit a gap region if this is the case + // in either AfterLoc end or BeforeLoc end. + if (AfterLoc.isInvalid() || BeforeLoc.isInvalid()) + return std::nullopt; + // If AfterLoc is in function-like macro, use the right parenthesis // location. if (AfterLoc.isMacroID()) { @@ -1370,9 +1376,8 @@ struct CounterCoverageMappingBuilder for (const Stmt *Child : S->children()) if (Child) { // If last statement contains terminate statements, add a gap area - // between the two statements. Skipping attributed statements, because - // they don't have valid start location. - if (LastStmt && HasTerminateStmt && !isa(Child)) { + // between the two statements. + if (LastStmt && HasTerminateStmt) { auto Gap = findGapAreaBetween(getEnd(LastStmt), getStart(Child)); if (Gap) fillGapAreaWithCount(Gap->getBegin(), Gap->getEnd(), diff --git a/contrib/llvm-project/clang/lib/CodeGen/MicrosoftCXXABI.cpp b/contrib/llvm-project/clang/lib/CodeGen/MicrosoftCXXABI.cpp index 172c4c937b97..4d0f4c63f843 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/MicrosoftCXXABI.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/MicrosoftCXXABI.cpp @@ -1135,9 +1135,15 @@ static bool isTrivialForMSVC(const CXXRecordDecl *RD, QualType Ty, return false; if (RD->hasNonTrivialCopyAssignment()) return false; - for (const CXXConstructorDecl *Ctor : RD->ctors()) - if (Ctor->isUserProvided()) - return false; + for (const Decl *D : RD->decls()) { + if (auto *Ctor = dyn_cast(D)) { + if (Ctor->isUserProvided()) + return false; + } else if (auto *Template = dyn_cast(D)) { + if (isa(Template->getTemplatedDecl())) + return false; + } + } if (RD->hasNonTrivialDestructor()) return false; return true; diff --git a/contrib/llvm-project/clang/lib/Format/ContinuationIndenter.cpp b/contrib/llvm-project/clang/lib/Format/ContinuationIndenter.cpp index a3eb9138b218..53cd169b0590 100644 --- a/contrib/llvm-project/clang/lib/Format/ContinuationIndenter.cpp +++ b/contrib/llvm-project/clang/lib/Format/ContinuationIndenter.cpp @@ -674,7 +674,13 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun, // arguments to function calls. We do this by ensuring that either all // arguments (including any lambdas) go on the same line as the function // call, or we break before the first argument. - auto PrevNonComment = Current.getPreviousNonComment(); + const auto *Prev = Current.Previous; + if (!Prev) + return false; + // For example, `/*Newline=*/false`. + if (Prev->is(TT_BlockComment) && Current.SpacesRequiredBefore == 0) + return false; + const auto *PrevNonComment = Current.getPreviousNonComment(); if (!PrevNonComment || PrevNonComment->isNot(tok::l_paren)) return false; if (Current.isOneOf(tok::comment, tok::l_paren, TT_LambdaLSquare)) diff --git a/contrib/llvm-project/clang/lib/Format/TokenAnnotator.cpp b/contrib/llvm-project/clang/lib/Format/TokenAnnotator.cpp index 4d482e6543d6..c1f166248192 100644 --- a/contrib/llvm-project/clang/lib/Format/TokenAnnotator.cpp +++ b/contrib/llvm-project/clang/lib/Format/TokenAnnotator.cpp @@ -3532,6 +3532,8 @@ void TokenAnnotator::calculateFormattingInformation(AnnotatedLine &Line) const { } } else if (ClosingParen) { for (auto *Tok = ClosingParen->Next; Tok; Tok = Tok->Next) { + if (Tok->is(TT_CtorInitializerColon)) + break; if (Tok->is(tok::arrow)) { Tok->setType(TT_TrailingReturnArrow); break; @@ -5157,12 +5159,8 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine &Line, return true; if (Left.IsUnterminatedLiteral) return true; - // FIXME: Breaking after newlines seems useful in general. Turn this into an - // option and recognize more cases like endl etc, and break independent of - // what comes after operator lessless. - if (Right.is(tok::lessless) && Right.Next && - Right.Next->is(tok::string_literal) && Left.is(tok::string_literal) && - Left.TokenText.ends_with("\\n\"")) { + if (Right.is(tok::lessless) && Right.Next && Left.is(tok::string_literal) && + Right.Next->is(tok::string_literal)) { return true; } if (Right.is(TT_RequiresClause)) { diff --git a/contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.cpp b/contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.cpp index 573919798870..a6eb18bb2b32 100644 --- a/contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.cpp +++ b/contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.cpp @@ -489,18 +489,23 @@ void UnwrappedLineParser::calculateBraceTypes(bool ExpectClassBody) { }; SmallVector LBraceStack; assert(Tok->is(tok::l_brace)); + do { - // Get next non-comment, non-preprocessor token. FormatToken *NextTok; do { NextTok = Tokens->getNextToken(); } while (NextTok->is(tok::comment)); - while (NextTok->is(tok::hash) && !Line->InMacroBody) { - NextTok = Tokens->getNextToken(); - do { - NextTok = Tokens->getNextToken(); - } while (NextTok->is(tok::comment) || - (NextTok->NewlinesBefore == 0 && NextTok->isNot(tok::eof))); + + if (!Line->InMacroBody) { + // Skip PPDirective lines and comments. + while (NextTok->is(tok::hash)) { + do { + NextTok = Tokens->getNextToken(); + } while (NextTok->NewlinesBefore == 0 && NextTok->isNot(tok::eof)); + + while (NextTok->is(tok::comment)) + NextTok = Tokens->getNextToken(); + } } switch (Tok->Tok.getKind()) { @@ -534,16 +539,6 @@ void UnwrappedLineParser::calculateBraceTypes(bool ExpectClassBody) { if (Style.Language == FormatStyle::LK_Proto) { ProbablyBracedList = NextTok->isOneOf(tok::comma, tok::r_square); } else { - // Skip NextTok over preprocessor lines, otherwise we may not - // properly diagnose the block as a braced intializer - // if the comma separator appears after the pp directive. - while (NextTok->is(tok::hash)) { - ScopedMacroState MacroState(*Line, Tokens, NextTok); - do { - NextTok = Tokens->getNextToken(); - } while (NextTok->isNot(tok::eof)); - } - // Using OriginalColumn to distinguish between ObjC methods and // binary operators is a bit hacky. bool NextIsObjCMethod = NextTok->isOneOf(tok::plus, tok::minus) && @@ -602,6 +597,16 @@ void UnwrappedLineParser::calculateBraceTypes(bool ExpectClassBody) { NextTok = Tokens->getNextToken(); ProbablyBracedList = NextTok->isNot(tok::l_square); } + + // Cpp macro definition body that is a nonempty braced list or block: + if (Style.isCpp() && Line->InMacroBody && PrevTok != FormatTok && + !FormatTok->Previous && NextTok->is(tok::eof) && + // A statement can end with only `;` (simple statement), a block + // closing brace (compound statement), or `:` (label statement). + // If PrevTok is a block opening brace, Tok ends an empty block. + !PrevTok->isOneOf(tok::semi, BK_Block, tok::colon)) { + ProbablyBracedList = true; + } } if (ProbablyBracedList) { Tok->setBlockKind(BK_BracedInit); @@ -631,6 +636,7 @@ void UnwrappedLineParser::calculateBraceTypes(bool ExpectClassBody) { default: break; } + PrevTok = Tok; Tok = NextTok; } while (Tok->isNot(tok::eof) && !LBraceStack.empty()); diff --git a/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/Taint.cpp b/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/Taint.cpp index 4edb671753bf..6362c82b009d 100644 --- a/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/Taint.cpp +++ b/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/Taint.cpp @@ -216,21 +216,17 @@ std::vector taint::getTaintedSymbolsImpl(ProgramStateRef State, std::vector TaintedSymbols; if (!Reg) return TaintedSymbols; - // Element region (array element) is tainted if either the base or the offset - // are tainted. + + // Element region (array element) is tainted if the offset is tainted. if (const ElementRegion *ER = dyn_cast(Reg)) { std::vector TaintedIndex = getTaintedSymbolsImpl(State, ER->getIndex(), K, returnFirstOnly); llvm::append_range(TaintedSymbols, TaintedIndex); if (returnFirstOnly && !TaintedSymbols.empty()) return TaintedSymbols; // return early if needed - std::vector TaintedSuperRegion = - getTaintedSymbolsImpl(State, ER->getSuperRegion(), K, returnFirstOnly); - llvm::append_range(TaintedSymbols, TaintedSuperRegion); - if (returnFirstOnly && !TaintedSymbols.empty()) - return TaintedSymbols; // return early if needed } + // Symbolic region is tainted if the corresponding symbol is tainted. if (const SymbolicRegion *SR = dyn_cast(Reg)) { std::vector TaintedRegions = getTaintedSymbolsImpl(State, SR->getSymbol(), K, returnFirstOnly); @@ -239,6 +235,8 @@ std::vector taint::getTaintedSymbolsImpl(ProgramStateRef State, return TaintedSymbols; // return early if needed } + // Any subregion (including Element and Symbolic regions) is tainted if its + // super-region is tainted. if (const SubRegion *ER = dyn_cast(Reg)) { std::vector TaintedSubRegions = getTaintedSymbolsImpl(State, ER->getSuperRegion(), K, returnFirstOnly); @@ -318,4 +316,4 @@ std::vector taint::getTaintedSymbolsImpl(ProgramStateRef State, } } return TaintedSymbols; -} \ No newline at end of file +} diff --git a/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/cert/InvalidPtrChecker.cpp b/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/cert/InvalidPtrChecker.cpp index e5dd907c660d..b2947f590c4e 100644 --- a/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/cert/InvalidPtrChecker.cpp +++ b/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/cert/InvalidPtrChecker.cpp @@ -205,8 +205,12 @@ void InvalidPtrChecker::postPreviousReturnInvalidatingCall( CE, LCtx, CE->getType(), C.blockCount()); State = State->BindExpr(CE, LCtx, RetVal); + const auto *SymRegOfRetVal = + dyn_cast_or_null(RetVal.getAsRegion()); + if (!SymRegOfRetVal) + return; + // Remember to this region. - const auto *SymRegOfRetVal = cast(RetVal.getAsRegion()); const MemRegion *MR = SymRegOfRetVal->getBaseRegion(); State = State->set(FD, MR); diff --git a/contrib/llvm-project/libcxx/modules/std.compat/cstdlib.inc b/contrib/llvm-project/libcxx/modules/std.compat/cstdlib.inc index a45a0a1caf8b..4783cbf51623 100644 --- a/contrib/llvm-project/libcxx/modules/std.compat/cstdlib.inc +++ b/contrib/llvm-project/libcxx/modules/std.compat/cstdlib.inc @@ -25,7 +25,7 @@ export { using ::system; // [c.malloc], C library memory allocation - using ::aligned_alloc; + using ::aligned_alloc _LIBCPP_USING_IF_EXISTS; using ::calloc; using ::free; using ::malloc; diff --git a/contrib/llvm-project/llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h b/contrib/llvm-project/llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h index 0f20a33f3a75..7990997835d0 100644 --- a/contrib/llvm-project/llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h +++ b/contrib/llvm-project/llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h @@ -35,11 +35,23 @@ struct LegalityQuery; class MachineRegisterInfo; namespace GISelAddressing { /// Helper struct to store a base, index and offset that forms an address -struct BaseIndexOffset { +class BaseIndexOffset { +private: Register BaseReg; Register IndexReg; - int64_t Offset = 0; - bool IsIndexSignExt = false; + std::optional Offset; + +public: + BaseIndexOffset() = default; + Register getBase() { return BaseReg; } + Register getBase() const { return BaseReg; } + Register getIndex() { return IndexReg; } + Register getIndex() const { return IndexReg; } + void setBase(Register NewBase) { BaseReg = NewBase; } + void setIndex(Register NewIndex) { IndexReg = NewIndex; } + void setOffset(std::optional NewOff) { Offset = NewOff; } + bool hasValidOffset() const { return Offset.has_value(); } + int64_t getOffset() const { return *Offset; } }; /// Returns a BaseIndexOffset which describes the pointer in \p Ptr. @@ -89,7 +101,7 @@ private: // order stores are writing to incremeneting consecutive addresses. So when // we walk the block in reverse order, the next eligible store must write to // an offset one store width lower than CurrentLowestOffset. - uint64_t CurrentLowestOffset; + int64_t CurrentLowestOffset; SmallVector Stores; // A vector of MachineInstr/unsigned pairs to denote potential aliases that // need to be checked before the candidate is considered safe to merge. The diff --git a/contrib/llvm-project/llvm/lib/CodeGen/CodeGenPrepare.cpp b/contrib/llvm-project/llvm/lib/CodeGen/CodeGenPrepare.cpp index 8ee1f19e083e..1cca56fc19cf 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -8154,6 +8154,7 @@ static bool optimizeBranch(BranchInst *Branch, const TargetLowering &TLI, IRBuilder<> Builder(Branch); if (UI->getParent() != Branch->getParent()) UI->moveBefore(Branch); + UI->dropPoisonGeneratingFlags(); Value *NewCmp = Builder.CreateCmp(ICmpInst::ICMP_EQ, UI, ConstantInt::get(UI->getType(), 0)); LLVM_DEBUG(dbgs() << "Converting " << *Cmp << "\n"); @@ -8167,6 +8168,7 @@ static bool optimizeBranch(BranchInst *Branch, const TargetLowering &TLI, IRBuilder<> Builder(Branch); if (UI->getParent() != Branch->getParent()) UI->moveBefore(Branch); + UI->dropPoisonGeneratingFlags(); Value *NewCmp = Builder.CreateCmp(Cmp->getPredicate(), UI, ConstantInt::get(UI->getType(), 0)); LLVM_DEBUG(dbgs() << "Converting " << *Cmp << "\n"); diff --git a/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp b/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp index 772229215e79..61ddc858ba44 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp @@ -591,8 +591,8 @@ bool CombinerHelper::matchCombineExtendingLoads(MachineInstr &MI, UseMI.getOpcode() == TargetOpcode::G_ZEXT || (UseMI.getOpcode() == TargetOpcode::G_ANYEXT)) { const auto &MMO = LoadMI->getMMO(); - // For atomics, only form anyextending loads. - if (MMO.isAtomic() && UseMI.getOpcode() != TargetOpcode::G_ANYEXT) + // Don't do anything for atomics. + if (MMO.isAtomic()) continue; // Check for legality. if (!isPreLegalize()) { diff --git a/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp b/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp index c0c22e36004f..47d045ac4817 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp @@ -4180,6 +4180,10 @@ LegalizerHelper::fewerElementsVectorPhi(GenericMachineInstr &MI, } } + // Set the insert point after the existing PHIs + MachineBasicBlock &MBB = *MI.getParent(); + MIRBuilder.setInsertPt(MBB, MBB.getFirstNonPHI()); + // Merge small outputs into MI's def. if (NumLeftovers) { mergeMixedSubvectors(MI.getReg(0), OutputRegs); diff --git a/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp b/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp index 246aa88b09ac..ee499c41c558 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp @@ -84,21 +84,20 @@ BaseIndexOffset GISelAddressing::getPointerInfo(Register Ptr, MachineRegisterInfo &MRI) { BaseIndexOffset Info; Register PtrAddRHS; - if (!mi_match(Ptr, MRI, m_GPtrAdd(m_Reg(Info.BaseReg), m_Reg(PtrAddRHS)))) { - Info.BaseReg = Ptr; - Info.IndexReg = Register(); - Info.IsIndexSignExt = false; + Register BaseReg; + if (!mi_match(Ptr, MRI, m_GPtrAdd(m_Reg(BaseReg), m_Reg(PtrAddRHS)))) { + Info.setBase(Ptr); + Info.setOffset(0); return Info; } - + Info.setBase(BaseReg); auto RHSCst = getIConstantVRegValWithLookThrough(PtrAddRHS, MRI); if (RHSCst) - Info.Offset = RHSCst->Value.getSExtValue(); + Info.setOffset(RHSCst->Value.getSExtValue()); // Just recognize a simple case for now. In future we'll need to match // indexing patterns for base + index + constant. - Info.IndexReg = PtrAddRHS; - Info.IsIndexSignExt = false; + Info.setIndex(PtrAddRHS); return Info; } @@ -114,15 +113,16 @@ bool GISelAddressing::aliasIsKnownForLoadStore(const MachineInstr &MI1, BaseIndexOffset BasePtr0 = getPointerInfo(LdSt1->getPointerReg(), MRI); BaseIndexOffset BasePtr1 = getPointerInfo(LdSt2->getPointerReg(), MRI); - if (!BasePtr0.BaseReg.isValid() || !BasePtr1.BaseReg.isValid()) + if (!BasePtr0.getBase().isValid() || !BasePtr1.getBase().isValid()) return false; int64_t Size1 = LdSt1->getMemSize(); int64_t Size2 = LdSt2->getMemSize(); int64_t PtrDiff; - if (BasePtr0.BaseReg == BasePtr1.BaseReg) { - PtrDiff = BasePtr1.Offset - BasePtr0.Offset; + if (BasePtr0.getBase() == BasePtr1.getBase() && BasePtr0.hasValidOffset() && + BasePtr1.hasValidOffset()) { + PtrDiff = BasePtr1.getOffset() - BasePtr0.getOffset(); // If the size of memory access is unknown, do not use it to do analysis. // One example of unknown size memory access is to load/store scalable // vector objects on the stack. @@ -151,8 +151,8 @@ bool GISelAddressing::aliasIsKnownForLoadStore(const MachineInstr &MI1, // able to calculate their relative offset if at least one arises // from an alloca. However, these allocas cannot overlap and we // can infer there is no alias. - auto *Base0Def = getDefIgnoringCopies(BasePtr0.BaseReg, MRI); - auto *Base1Def = getDefIgnoringCopies(BasePtr1.BaseReg, MRI); + auto *Base0Def = getDefIgnoringCopies(BasePtr0.getBase(), MRI); + auto *Base1Def = getDefIgnoringCopies(BasePtr1.getBase(), MRI); if (!Base0Def || !Base1Def) return false; // Couldn't tell anything. @@ -520,16 +520,20 @@ bool LoadStoreOpt::addStoreToCandidate(GStore &StoreMI, Register StoreAddr = StoreMI.getPointerReg(); auto BIO = getPointerInfo(StoreAddr, *MRI); - Register StoreBase = BIO.BaseReg; - uint64_t StoreOffCst = BIO.Offset; + Register StoreBase = BIO.getBase(); if (C.Stores.empty()) { + C.BasePtr = StoreBase; + if (!BIO.hasValidOffset()) { + C.CurrentLowestOffset = 0; + } else { + C.CurrentLowestOffset = BIO.getOffset(); + } // This is the first store of the candidate. // If the offset can't possibly allow for a lower addressed store with the // same base, don't bother adding it. - if (StoreOffCst < ValueTy.getSizeInBytes()) + if (BIO.hasValidOffset() && + BIO.getOffset() < static_cast(ValueTy.getSizeInBytes())) return false; - C.BasePtr = StoreBase; - C.CurrentLowestOffset = StoreOffCst; C.Stores.emplace_back(&StoreMI); LLVM_DEBUG(dbgs() << "Starting a new merge candidate group with: " << StoreMI); @@ -549,8 +553,12 @@ bool LoadStoreOpt::addStoreToCandidate(GStore &StoreMI, // writes to the next lowest adjacent address. if (C.BasePtr != StoreBase) return false; - if ((C.CurrentLowestOffset - ValueTy.getSizeInBytes()) != - static_cast(StoreOffCst)) + // If we don't have a valid offset, we can't guarantee to be an adjacent + // offset. + if (!BIO.hasValidOffset()) + return false; + if ((C.CurrentLowestOffset - + static_cast(ValueTy.getSizeInBytes())) != BIO.getOffset()) return false; // This writes to an adjacent address. Allow it. diff --git a/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index e806e0f0731f..5038f8a1fc15 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -9636,8 +9636,15 @@ static SDValue combineShiftOfShiftedLogic(SDNode *Shift, SelectionDAG &DAG) { if (ShiftAmtVal->getBitWidth() != C1Val.getBitWidth()) return false; + // The fold is not valid if the sum of the shift values doesn't fit in the + // given shift amount type. + bool Overflow = false; + APInt NewShiftAmt = C1Val.uadd_ov(*ShiftAmtVal, Overflow); + if (Overflow) + return false; + // The fold is not valid if the sum of the shift values exceeds bitwidth. - if ((*ShiftAmtVal + C1Val).uge(V.getScalarValueSizeInBits())) + if (NewShiftAmt.uge(V.getScalarValueSizeInBits())) return false; return true; diff --git a/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64InstrInfo.td b/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64InstrInfo.td index 03baa7497615..ac61dd8745d4 100644 --- a/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64InstrInfo.td +++ b/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64InstrInfo.td @@ -4885,19 +4885,9 @@ defm UABDL : SIMDLongThreeVectorBHSabdl<1, 0b0111, "uabdl", def : Pat<(abs (v8i16 (sub (zext (v8i8 V64:$opA)), (zext (v8i8 V64:$opB))))), (UABDLv8i8_v8i16 V64:$opA, V64:$opB)>; -def : Pat<(xor (v8i16 (AArch64vashr v8i16:$src, (i32 15))), - (v8i16 (add (sub (zext (v8i8 V64:$opA)), - (zext (v8i8 V64:$opB))), - (AArch64vashr v8i16:$src, (i32 15))))), - (UABDLv8i8_v8i16 V64:$opA, V64:$opB)>; def : Pat<(abs (v8i16 (sub (zext (extract_high_v16i8 (v16i8 V128:$opA))), (zext (extract_high_v16i8 (v16i8 V128:$opB)))))), (UABDLv16i8_v8i16 V128:$opA, V128:$opB)>; -def : Pat<(xor (v8i16 (AArch64vashr v8i16:$src, (i32 15))), - (v8i16 (add (sub (zext (extract_high_v16i8 (v16i8 V128:$opA))), - (zext (extract_high_v16i8 (v16i8 V128:$opB)))), - (AArch64vashr v8i16:$src, (i32 15))))), - (UABDLv16i8_v8i16 V128:$opA, V128:$opB)>; def : Pat<(abs (v4i32 (sub (zext (v4i16 V64:$opA)), (zext (v4i16 V64:$opB))))), (UABDLv4i16_v4i32 V64:$opA, V64:$opB)>; diff --git a/contrib/llvm-project/llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp b/contrib/llvm-project/llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp index 84b9330ef963..50d8bfa87508 100644 --- a/contrib/llvm-project/llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp +++ b/contrib/llvm-project/llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp @@ -2358,6 +2358,11 @@ bool SIGfx12CacheControl::enableVolatileAndOrNonTemporal( bool Changed = false; + if (IsNonTemporal) { + // Set non-temporal hint for all cache levels. + Changed |= setTH(MI, AMDGPU::CPol::TH_NT); + } + if (IsVolatile) { Changed |= setScope(MI, AMDGPU::CPol::SCOPE_SYS); @@ -2370,11 +2375,6 @@ bool SIGfx12CacheControl::enableVolatileAndOrNonTemporal( Position::AFTER); } - if (IsNonTemporal) { - // Set non-temporal hint for all cache levels. - Changed |= setTH(MI, AMDGPU::CPol::TH_NT); - } - return Changed; } diff --git a/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVISelLowering.cpp index a0cec426002b..d46093b9e260 100644 --- a/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVISelLowering.cpp +++ b/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVISelLowering.cpp @@ -14559,7 +14559,7 @@ static SDValue tryFoldSelectIntoOp(SDNode *N, SelectionDAG &DAG, EVT VT = N->getValueType(0); SDLoc DL(N); SDValue OtherOp = TrueVal.getOperand(1 - OpToFold); - EVT OtherOpVT = OtherOp->getValueType(0); + EVT OtherOpVT = OtherOp.getValueType(); SDValue IdentityOperand = DAG.getNeutralElement(Opc, DL, OtherOpVT, N->getFlags()); if (!Commutative) diff --git a/contrib/llvm-project/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp b/contrib/llvm-project/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp index 833f058253d8..553d338b7790 100644 --- a/contrib/llvm-project/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp +++ b/contrib/llvm-project/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp @@ -2923,11 +2923,10 @@ bool X86DAGToDAGISel::selectAddr(SDNode *Parent, SDValue N, SDValue &Base, } bool X86DAGToDAGISel::selectMOV64Imm32(SDValue N, SDValue &Imm) { - // Cannot use 32 bit constants to reference objects in kernel code model. - // Cannot use 32 bit constants to reference objects in large PIC mode since - // GOTOFF is 64 bits. + // Cannot use 32 bit constants to reference objects in kernel/large code + // model. if (TM.getCodeModel() == CodeModel::Kernel || - (TM.getCodeModel() == CodeModel::Large && TM.isPositionIndependent())) + TM.getCodeModel() == CodeModel::Large) return false; // In static codegen with small code model, we can get the address of a label diff --git a/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp b/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp index 96bbd981ff24..201dd8382536 100644 --- a/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -47038,10 +47038,13 @@ static SDValue combineShiftRightArithmetic(SDNode *N, SelectionDAG &DAG, if (SDValue V = combineShiftToPMULH(N, DAG, Subtarget)) return V; - // fold (ashr (shl, a, [56,48,32,24,16]), SarConst) - // into (shl, (sext (a), [56,48,32,24,16] - SarConst)) or - // into (lshr, (sext (a), SarConst - [56,48,32,24,16])) - // depending on sign of (SarConst - [56,48,32,24,16]) + // fold (SRA (SHL X, ShlConst), SraConst) + // into (SHL (sext_in_reg X), ShlConst - SraConst) + // or (sext_in_reg X) + // or (SRA (sext_in_reg X), SraConst - ShlConst) + // depending on relation between SraConst and ShlConst. + // We only do this if (Size - ShlConst) is equal to 8, 16 or 32. That allows + // us to do the sext_in_reg from corresponding bit. // sexts in X86 are MOVs. The MOVs have the same code size // as above SHIFTs (only SHIFT on 1 has lower code size). @@ -47057,29 +47060,29 @@ static SDValue combineShiftRightArithmetic(SDNode *N, SelectionDAG &DAG, SDValue N00 = N0.getOperand(0); SDValue N01 = N0.getOperand(1); APInt ShlConst = N01->getAsAPIntVal(); - APInt SarConst = N1->getAsAPIntVal(); + APInt SraConst = N1->getAsAPIntVal(); EVT CVT = N1.getValueType(); - if (SarConst.isNegative()) + if (CVT != N01.getValueType()) + return SDValue(); + if (SraConst.isNegative()) return SDValue(); for (MVT SVT : { MVT::i8, MVT::i16, MVT::i32 }) { unsigned ShiftSize = SVT.getSizeInBits(); - // skipping types without corresponding sext/zext and - // ShlConst that is not one of [56,48,32,24,16] + // Only deal with (Size - ShlConst) being equal to 8, 16 or 32. if (ShiftSize >= Size || ShlConst != Size - ShiftSize) continue; SDLoc DL(N); SDValue NN = DAG.getNode(ISD::SIGN_EXTEND_INREG, DL, VT, N00, DAG.getValueType(SVT)); - SarConst = SarConst - (Size - ShiftSize); - if (SarConst == 0) + if (SraConst.eq(ShlConst)) return NN; - if (SarConst.isNegative()) + if (SraConst.ult(ShlConst)) return DAG.getNode(ISD::SHL, DL, VT, NN, - DAG.getConstant(-SarConst, DL, CVT)); + DAG.getConstant(ShlConst - SraConst, DL, CVT)); return DAG.getNode(ISD::SRA, DL, VT, NN, - DAG.getConstant(SarConst, DL, CVT)); + DAG.getConstant(SraConst - ShlConst, DL, CVT)); } return SDValue(); } diff --git a/contrib/llvm-project/llvm/lib/Target/X86/X86Subtarget.h b/contrib/llvm-project/llvm/lib/Target/X86/X86Subtarget.h index a458b5f9ec8f..4d55a084b730 100644 --- a/contrib/llvm-project/llvm/lib/Target/X86/X86Subtarget.h +++ b/contrib/llvm-project/llvm/lib/Target/X86/X86Subtarget.h @@ -244,7 +244,8 @@ public: // TODO: Currently we're always allowing widening on CPUs without VLX, // because for many cases we don't have a better option. bool canExtendTo512DQ() const { - return hasAVX512() && (!hasVLX() || getPreferVectorWidth() >= 512); + return hasAVX512() && hasEVEX512() && + (!hasVLX() || getPreferVectorWidth() >= 512); } bool canExtendTo512BW() const { return hasBWI() && canExtendTo512DQ(); diff --git a/contrib/llvm-project/llvm/lib/TargetParser/Host.cpp b/contrib/llvm-project/llvm/lib/TargetParser/Host.cpp index 4466d50458e1..1adef15771fa 100644 --- a/contrib/llvm-project/llvm/lib/TargetParser/Host.cpp +++ b/contrib/llvm-project/llvm/lib/TargetParser/Host.cpp @@ -1266,8 +1266,10 @@ static void getAvailableFeatures(unsigned ECX, unsigned EDX, unsigned MaxLeaf, setFeature(X86::FEATURE_AVX2); if (HasLeaf7 && ((EBX >> 8) & 1)) setFeature(X86::FEATURE_BMI2); - if (HasLeaf7 && ((EBX >> 16) & 1) && HasAVX512Save) + if (HasLeaf7 && ((EBX >> 16) & 1) && HasAVX512Save) { setFeature(X86::FEATURE_AVX512F); + setFeature(X86::FEATURE_EVEX512); + } if (HasLeaf7 && ((EBX >> 17) & 1) && HasAVX512Save) setFeature(X86::FEATURE_AVX512DQ); if (HasLeaf7 && ((EBX >> 19) & 1)) @@ -1772,6 +1774,7 @@ bool sys::getHostCPUFeatures(StringMap &Features) { Features["rtm"] = HasLeaf7 && ((EBX >> 11) & 1); // AVX512 is only supported if the OS supports the context save for it. Features["avx512f"] = HasLeaf7 && ((EBX >> 16) & 1) && HasAVX512Save; + Features["evex512"] = Features["avx512f"]; Features["avx512dq"] = HasLeaf7 && ((EBX >> 17) & 1) && HasAVX512Save; Features["rdseed"] = HasLeaf7 && ((EBX >> 18) & 1); Features["adx"] = HasLeaf7 && ((EBX >> 19) & 1); diff --git a/contrib/llvm-project/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp b/contrib/llvm-project/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp index 9f220ec003ec..8cc7901cbac7 100644 --- a/contrib/llvm-project/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp +++ b/contrib/llvm-project/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp @@ -2606,7 +2606,7 @@ static Instruction *foldSelectWithSRem(SelectInst &SI, InstCombinerImpl &IC, // %cnd = icmp slt i32 %rem, 0 // %add = add i32 %rem, %n // %sel = select i1 %cnd, i32 %add, i32 %rem - if (match(TrueVal, m_Add(m_Value(RemRes), m_Value(Remainder))) && + if (match(TrueVal, m_Add(m_Specific(RemRes), m_Value(Remainder))) && match(RemRes, m_SRem(m_Value(Op), m_Specific(Remainder))) && IC.isKnownToBeAPowerOfTwo(Remainder, /*OrZero*/ true) && FalseVal == RemRes) diff --git a/contrib/llvm-project/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp b/contrib/llvm-project/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp index 9df28747570c..104e8ceb7967 100644 --- a/contrib/llvm-project/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp +++ b/contrib/llvm-project/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp @@ -279,6 +279,9 @@ bool InductiveRangeCheck::parseRangeCheckICmp(Loop *L, ICmpInst *ICI, Value *LHS = ICI->getOperand(0); Value *RHS = ICI->getOperand(1); + if (!LHS->getType()->isIntegerTy()) + return false; + // Canonicalize to the `Index Pred Invariant` comparison if (IsLoopInvariant(LHS)) { std::swap(LHS, RHS); From nobody Tue May 7 17:05:16 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VYl5S60rzz5JF5X; Tue, 07 May 2024 17:05: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 4VYl5S4G5nz4Ywn; Tue, 7 May 2024 17:05:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715101516; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZXQlFtrxpm6fEs011GHweyMylA9NKMoZW2JMmvhZAwg=; b=Pr+e3fhybJ/QuEX9kyKhh4jV0hrcZ05KlVYYrXSjyy3pDH3Wu52Sw+qFRqjrU19F32jhxH AeH/vJnLtYUzIA935PsaZ4Gkn8R+mEuQDq5Q/lYrGI61OBnM7quy8rAgVnwP/UzlamRpgX O9m52/TYpelho9D+5QcSeo6AEcMcTi4Z4sd6Btj/fkWffHAbWH6W7G+qMgxZZ2RCtrzvXc Lf/4DQOzFQZfpB1E0UbTd01os5mf77TSz6zEtx5EeSiVbuU3AzktOHXS67E0S9D2Zhf4UL QBwv/rtR8WLtxJRHk/7EFZTwNTSuh/ba3PehqxdDOioghBwxgBFtkEa4biTSkw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715101516; a=rsa-sha256; cv=none; b=itlbamtZjh8sjaDA3C1Fk9ZcSZJbb3eKz5ggbQkZu3ZAvV1IcMP7E7wSX28JJIHIW0Br+W XDCly+QZCs8T7QrDZIE+CeYySzppB8aHJt48qf4C6+sZObcbwReja4UFc2r1+NUM3lhJh5 Rj0IhzjUMBDMw/ZE6Ns2UJgMj1GfmyDjtNkjuR0iL9xOy1A9YpyqNWq0lk5Y+4e7M1FqiV Wj4C9Vwo2HOalXnxArYqW4xn0Zjc2lM2yv7uVjcYObegdV44aVZHm7iPLL82yqIVvaN09A QzGxApNcwqk4W2Xcp99w8hUkiK2sOi4FQQI2+9SJP6aKKBkBPFMDLjpPQNUXRQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715101516; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZXQlFtrxpm6fEs011GHweyMylA9NKMoZW2JMmvhZAwg=; b=w0IZGkWUJwwyrQIuJT5zoQZKtTYuy9NtuLt8GLC/F3UhDjIIfThba4z1NqaKWoCoZiqoyF 4Hh5/QpPisa6Ijg05j8zqPZSWeYSfAvxQ5hq/4bs++Ngcf/ugeOuGw3MMNMW56GnNoKS6x ggpSXqEfrfK1sxcgSuPRrMfWcvhfcnhK6H8hQ+/rj666CBUeAzjOOY5PQ05JHe5unDayXY bBKU0bdolVHNLli+QGZGYmzxGCnUNi+KFQw5M3a7W2Q0TKwrTLQfmF1JSKL2HQW7aVd8o/ ZYdMfCKAamweXu/WJlh54wZhs+qDDGlxm5pudxUkWYFgfprMZccucL6fW09WKw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VYl5S3sZmzqT9; Tue, 7 May 2024 17:05:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 447H5G6m051575; Tue, 7 May 2024 17:05:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 447H5Gxa051572; Tue, 7 May 2024 17:05:16 GMT (envelope-from git) Date: Tue, 7 May 2024 17:05:16 GMT Message-Id: <202405071705.447H5Gxa051572@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: a17c251dd685 - stable/14 - Fixup: Merge llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a17c251dd68567d879bb80e62f9828abb3967c64 Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=a17c251dd68567d879bb80e62f9828abb3967c64 commit a17c251dd68567d879bb80e62f9828abb3967c64 Author: Dimitry Andric AuthorDate: 2024-05-04 10:19:32 +0000 Commit: Dimitry Andric CommitDate: 2024-05-07 17:04:01 +0000 Fixup: Merge llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9 Update version numbers, config headers, etc. Git tricked me into losing these before pushing. PR: 276104 Fixes: d67fc74b9249 MFC after: 3 days (cherry picked from commit 894cb08f0d3656fdb81f4d89085bedc4235f3cb6) --- lib/clang/include/VCSVersion.inc | 6 +++--- lib/clang/include/clang/Basic/Version.inc | 6 +++--- lib/clang/include/lld/Common/Version.inc | 2 +- lib/clang/include/lldb/Version/Version.inc | 6 +++--- lib/clang/include/llvm/Config/config.h | 4 ++-- lib/clang/include/llvm/Config/llvm-config.h | 4 ++-- lib/clang/include/llvm/Support/VCSRevision.h | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/clang/include/VCSVersion.inc b/lib/clang/include/VCSVersion.inc index 687fb1656937..c4bb0df4e3a5 100644 --- a/lib/clang/include/VCSVersion.inc +++ b/lib/clang/include/VCSVersion.inc @@ -1,8 +1,8 @@ -#define LLVM_REVISION "llvmorg-18.1.4-0-ge6c3289804a6" +#define LLVM_REVISION "llvmorg-18.1.5-0-g617a15a9eac9" #define LLVM_REPOSITORY "https://github.com/llvm/llvm-project.git" -#define CLANG_REVISION "llvmorg-18.1.4-0-ge6c3289804a6" +#define CLANG_REVISION "llvmorg-18.1.5-0-g617a15a9eac9" #define CLANG_REPOSITORY "https://github.com/llvm/llvm-project.git" -#define LLDB_REVISION "llvmorg-18.1.4-0-ge6c3289804a6" +#define LLDB_REVISION "llvmorg-18.1.5-0-g617a15a9eac9" #define LLDB_REPOSITORY "https://github.com/llvm/llvm-project.git" diff --git a/lib/clang/include/clang/Basic/Version.inc b/lib/clang/include/clang/Basic/Version.inc index 536f72efec52..c243016c5f73 100644 --- a/lib/clang/include/clang/Basic/Version.inc +++ b/lib/clang/include/clang/Basic/Version.inc @@ -1,8 +1,8 @@ -#define CLANG_VERSION 18.1.4 -#define CLANG_VERSION_STRING "18.1.4" +#define CLANG_VERSION 18.1.5 +#define CLANG_VERSION_STRING "18.1.5" #define CLANG_VERSION_MAJOR 18 #define CLANG_VERSION_MAJOR_STRING "18" #define CLANG_VERSION_MINOR 1 -#define CLANG_VERSION_PATCHLEVEL 4 +#define CLANG_VERSION_PATCHLEVEL 5 #define CLANG_VENDOR "FreeBSD " diff --git a/lib/clang/include/lld/Common/Version.inc b/lib/clang/include/lld/Common/Version.inc index 65838f76ba5d..4079a361ce8d 100644 --- a/lib/clang/include/lld/Common/Version.inc +++ b/lib/clang/include/lld/Common/Version.inc @@ -1,4 +1,4 @@ // Local identifier in __FreeBSD_version style #define LLD_FREEBSD_VERSION 1400006 -#define LLD_VERSION_STRING "18.1.4 (FreeBSD llvmorg-18.1.4-0-ge6c3289804a6-" __XSTRING(LLD_FREEBSD_VERSION) ")" +#define LLD_VERSION_STRING "18.1.5 (FreeBSD llvmorg-18.1.5-0-g617a15a9eac9-" __XSTRING(LLD_FREEBSD_VERSION) ")" diff --git a/lib/clang/include/lldb/Version/Version.inc b/lib/clang/include/lldb/Version/Version.inc index 1fc1a4d88b7b..0e86bd2e01ba 100644 --- a/lib/clang/include/lldb/Version/Version.inc +++ b/lib/clang/include/lldb/Version/Version.inc @@ -1,6 +1,6 @@ -#define LLDB_VERSION 18.1.4 -#define LLDB_VERSION_STRING "18.1.4" +#define LLDB_VERSION 18.1.5 +#define LLDB_VERSION_STRING "18.1.5" #define LLDB_VERSION_MAJOR 18 #define LLDB_VERSION_MINOR 1 -#define LLDB_VERSION_PATCH 4 +#define LLDB_VERSION_PATCH 5 /* #undef LLDB_FULL_VERSION_STRING */ diff --git a/lib/clang/include/llvm/Config/config.h b/lib/clang/include/llvm/Config/config.h index a017437dc568..0760c0b17a87 100644 --- a/lib/clang/include/llvm/Config/config.h +++ b/lib/clang/include/llvm/Config/config.h @@ -344,10 +344,10 @@ #define PACKAGE_NAME "LLVM" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "LLVM 18.1.4" +#define PACKAGE_STRING "LLVM 18.1.5" /* Define to the version of this package. */ -#define PACKAGE_VERSION "18.1.4" +#define PACKAGE_VERSION "18.1.5" /* Define to the vendor of this package. */ /* #undef PACKAGE_VENDOR */ diff --git a/lib/clang/include/llvm/Config/llvm-config.h b/lib/clang/include/llvm/Config/llvm-config.h index fb878ccdde4d..5ac5d07a3539 100644 --- a/lib/clang/include/llvm/Config/llvm-config.h +++ b/lib/clang/include/llvm/Config/llvm-config.h @@ -180,10 +180,10 @@ #define LLVM_VERSION_MINOR 1 /* Patch version of the LLVM API */ -#define LLVM_VERSION_PATCH 4 +#define LLVM_VERSION_PATCH 5 /* LLVM version string */ -#define LLVM_VERSION_STRING "18.1.4" +#define LLVM_VERSION_STRING "18.1.5" /* Whether LLVM records statistics for use with GetStatistics(), * PrintStatistics() or PrintStatisticsJSON() diff --git a/lib/clang/include/llvm/Support/VCSRevision.h b/lib/clang/include/llvm/Support/VCSRevision.h index e324de0f9fc6..433b2b53b8fe 100644 --- a/lib/clang/include/llvm/Support/VCSRevision.h +++ b/lib/clang/include/llvm/Support/VCSRevision.h @@ -1,2 +1,2 @@ -#define LLVM_REVISION "llvmorg-18.1.4-0-ge6c3289804a6" +#define LLVM_REVISION "llvmorg-18.1.5-0-g617a15a9eac9" #define LLVM_REPOSITORY "https://github.com/llvm/llvm-project.git" From nobody Tue May 7 17:05:17 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VYl5V096sz5JFDV; Tue, 07 May 2024 17:05: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 4VYl5T536cz4Ynl; Tue, 7 May 2024 17:05:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715101517; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NpdOESOeqw0WIUzWB9IvpxmcuIoZtdhRyaA0ZZyd4tQ=; b=KwFGXI4T4wBrIJrURrEXqrHsY7Av9yO2NHNfdishtQJCq2cU9hKgMgIw/7o2xiWJi3lfJX GAQ2qi6rDxoBoCEbBIF4EOHtH91gZKGqWhOLGwTwfNlCC5TAEkdAmCK3x0eSundtcGhxAU l0YTkvzXiCKH7H/J0EBcCuFvlo9ZHdjlxcuw2DrnFBq3de9U1MstCs0XCNznqHyHyQTx1P 9g1EGhiKji0ZQ8Ft4bOtFx4z2r0yD/p/lR52ffbc8agwEUhwDDW/1ksOpSzzQngZj7gass QQa5/7AYtVUb26Iunu6+sM6F09Tn2XunxWNOAXMTDora0w0exlm9gjsYNqjyWg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715101517; a=rsa-sha256; cv=none; b=aeh1tio12NLlrg3VgmsgqGreO5t8Ln5xP+3z+cMykEM1JQfNLxbSZVrfYspodtMyJx3xGF 0ZkD0NiQcuz/F9Ouvm7f63F6actrmQelsr7GCNPEFJTZP1Pd/wnvsdEhhQJOqUTKsUVjXa AXlXpL8Sygi86+UwyPiSda3jeUdm2JJwg5Oy8xDln/MsEPtl50RLODKkp4jsvAjsMJ5P5B ILFKiihgVaE1pj/4YkKU0bZVTnvJW4fBNEd81wxPA2WoDTiiwlTzT2W+0TAFvLLzmPL1ki MHrgpNLEQHTcdTNe8ChJYikwqwdZn7V3A7VjdMCw3Iw37X6CxM7fFNNHsujLkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715101517; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NpdOESOeqw0WIUzWB9IvpxmcuIoZtdhRyaA0ZZyd4tQ=; b=SXtTGODREXw2vxsXaqlRV6LeXzEIszyZEGNdTrZuryGG4+YJrVOmQUcOuTeGWI5mLxTjom GAHR6yD/84ujnNRF3LqZ2poCNM6bWzTEAXOCDX29y9yUswltGOn4kPHU5tnjDlPHlTm7sR EBZjlpTp0nWCVid/VcSxYnC+1RWy0VuK60zv7Zfr9QJNDCeFR9EzrxxhpCBzAnXGwSkfiG kCoapj/skr05dD8qgkJWRbt4+x0HdUQZi/L16ucFHQvQQ9NKPZWjRyIzkbZH27KkZ5HH7P vNTdH7ApSpTC9c1rzPZYPvRbVBV72V4vnurItJdxCSYZhH6hqCsr427JkqfzcQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VYl5T4gKCzqTB; Tue, 7 May 2024 17:05:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 447H5HN6051626; Tue, 7 May 2024 17:05:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 447H5HDH051623; Tue, 7 May 2024 17:05:17 GMT (envelope-from git) Date: Tue, 7 May 2024 17:05:17 GMT Message-Id: <202405071705.447H5HDH051623@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 0b8cdac883f5 - stable/14 - lib/clang: clean out old llvm/clang Sparc target remnants List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0b8cdac883f5028c8716aa7442c07c68ac1f780b Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=0b8cdac883f5028c8716aa7442c07c68ac1f780b commit 0b8cdac883f5028c8716aa7442c07c68ac1f780b Author: Dimitry Andric AuthorDate: 2024-05-04 17:34:10 +0000 Commit: Dimitry Andric CommitDate: 2024-05-07 17:04:07 +0000 lib/clang: clean out old llvm/clang Sparc target remnants The WITH_LLVM_TARGET_ENABLE_SPARC option was removed a long time ago, but some ifdefs were still laying around, so clean them up. PR: 276104 MFC after: 3 days (cherry picked from commit 6f444019009a55aac18d18054d154155fbf606c9) --- lib/clang/include/llvm/Config/AsmParsers.def | 3 --- lib/clang/include/llvm/Config/AsmPrinters.def | 3 --- lib/clang/include/llvm/Config/Disassemblers.def | 3 --- lib/clang/include/llvm/Config/Targets.def | 3 --- lib/clang/include/llvm/Config/llvm-config.h | 4 ---- 5 files changed, 16 deletions(-) diff --git a/lib/clang/include/llvm/Config/AsmParsers.def b/lib/clang/include/llvm/Config/AsmParsers.def index afd86d898673..3dccab75a285 100644 --- a/lib/clang/include/llvm/Config/AsmParsers.def +++ b/lib/clang/include/llvm/Config/AsmParsers.def @@ -42,9 +42,6 @@ LLVM_ASM_PARSER(PowerPC) #ifdef LLVM_TARGET_ENABLE_RISCV LLVM_ASM_PARSER(RISCV) #endif -#ifdef LLVM_TARGET_ENABLE_SPARC -LLVM_ASM_PARSER(Sparc) -#endif #ifdef LLVM_TARGET_ENABLE_X86 LLVM_ASM_PARSER(X86) #endif diff --git a/lib/clang/include/llvm/Config/AsmPrinters.def b/lib/clang/include/llvm/Config/AsmPrinters.def index ffcca0730101..649b8353c926 100644 --- a/lib/clang/include/llvm/Config/AsmPrinters.def +++ b/lib/clang/include/llvm/Config/AsmPrinters.def @@ -42,9 +42,6 @@ LLVM_ASM_PRINTER(PowerPC) #ifdef LLVM_TARGET_ENABLE_RISCV LLVM_ASM_PRINTER(RISCV) #endif -#ifdef LLVM_TARGET_ENABLE_SPARC -LLVM_ASM_PRINTER(Sparc) -#endif #ifdef LLVM_TARGET_ENABLE_X86 LLVM_ASM_PRINTER(X86) #endif diff --git a/lib/clang/include/llvm/Config/Disassemblers.def b/lib/clang/include/llvm/Config/Disassemblers.def index 18e29e3a09ff..c44fa4e303e2 100644 --- a/lib/clang/include/llvm/Config/Disassemblers.def +++ b/lib/clang/include/llvm/Config/Disassemblers.def @@ -42,9 +42,6 @@ LLVM_DISASSEMBLER(PowerPC) #ifdef LLVM_TARGET_ENABLE_RISCV LLVM_DISASSEMBLER(RISCV) #endif -#ifdef LLVM_TARGET_ENABLE_SPARC -LLVM_DISASSEMBLER(Sparc) -#endif #ifdef LLVM_TARGET_ENABLE_X86 LLVM_DISASSEMBLER(X86) #endif diff --git a/lib/clang/include/llvm/Config/Targets.def b/lib/clang/include/llvm/Config/Targets.def index 604fd9337048..d3332a51a2cc 100644 --- a/lib/clang/include/llvm/Config/Targets.def +++ b/lib/clang/include/llvm/Config/Targets.def @@ -41,9 +41,6 @@ LLVM_TARGET(PowerPC) #ifdef LLVM_TARGET_ENABLE_RISCV LLVM_TARGET(RISCV) #endif -#ifdef LLVM_TARGET_ENABLE_SPARC -LLVM_TARGET(Sparc) -#endif #ifdef LLVM_TARGET_ENABLE_X86 LLVM_TARGET(X86) #endif diff --git a/lib/clang/include/llvm/Config/llvm-config.h b/lib/clang/include/llvm/Config/llvm-config.h index 5ac5d07a3539..049529efdd7f 100644 --- a/lib/clang/include/llvm/Config/llvm-config.h +++ b/lib/clang/include/llvm/Config/llvm-config.h @@ -130,11 +130,7 @@ #endif /* Define if the Sparc target is built in */ -#ifdef LLVM_TARGET_ENABLE_SPARC -#define LLVM_HAS_SPARC_TARGET 1 -#else #define LLVM_HAS_SPARC_TARGET 0 -#endif /* Define if the SPIRV target is built in */ #define LLVM_HAS_SPIRV_TARGET 0 From nobody Tue May 7 17:06:38 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VYl7322r6z5JFYk; Tue, 07 May 2024 17:06: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 4VYl731Y8Lz4bQS; Tue, 7 May 2024 17:06:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715101599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M+dP4Aq4i3L5iiF/otS2vd/gzt+G0x5+47rqPzra+8c=; b=KIUHrFV3bY/KR+XUOReIl6+Yql9LbYN8Mqkjb1B05/QyF16WyiTjKmnyFK+BSFZciHLF85 j2scQzaxifTQGS0hy8j/XVSHQM8j+zJSbyLoVPE85cbMfq0pszmtK3fJbz0MaJ0TA0/CJg yCrbNu8xaeDhW83+2HZ7dQaEzBemgzRzHukx8Ha9zTr902Vx0IhoVQ2aj4LjGcF8zVvbDg c5dHBqKkJvhoBoWU3Zve/dnqQWrdVv5WuvxSy2dmeLuKR4q3XICHk2VkoCwIeldKGglc4R ypF7sNbP44OgJCStxYTj1r5lgWwWEo4VIpaY/7k92ARWzwzqMdhFKJkc7hakYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715101599; a=rsa-sha256; cv=none; b=nGh7+l3xmh9mN3pKIX9Ij0CPveJxNIDp09tNHuuovMNqez8UxRUrj7dDqCsxTV8mCWR60W ZUBqnssD1yDP+8jOQbwCAbpgCuzsXj/2zX/+5yaMAwMIDjmW1bb5/pYgu3ZZb2PL82TaUT e+7mt/Zo8sNSnbPVAxQ+sYJXYPhLK86nI1hlPNRnIX3/e7t/h6zJXRqdXTL12xUvQDuYgR ore58OsEno21B0R1ZRIXr2ywHUE4AoSPU4VYf6FDIvNjIoELTgBUI5tELD2KwTCscLn9Jj 57+X3950/aZBRkII93jHRw/wh4ssOMNQNTfidtFdtXRy7ceHeh/E/Vy7Khw37g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715101599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M+dP4Aq4i3L5iiF/otS2vd/gzt+G0x5+47rqPzra+8c=; b=nfo462RdeV90QOi1YM9d5tzskcNNb4JpCgcATfxdgLw9yHy3VtBQRhB+6ULA6JHWUqoArp VQ1FawtZoKWsvNh5eZV2EUJ6ic9rtZYtguug1ULHFpeEeBITlefZ6XzKxBevQ+TRKQgcHc ia8a8s5+Xa+rmj7W+qVm0brFipGRLWtFMg5jGa7XPON+iDm3SiOTfbibgBZ0tYUJVDUDCS 4MPy9EadnXFq0P90msBtXmrJp/oWMRt7AdpswrXUY8fyCnapyjHvMLBB0r3LHaygQZGYh0 PjtDIHceliZDmVhCy1EZz17QPBGXqbq+Ibpz72D9UQV0l9TvbMbWXvte6eXfYQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VYl7317NqzpkJ; Tue, 7 May 2024 17:06:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 447H6dS8051929; Tue, 7 May 2024 17:06:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 447H6c6Q051926; Tue, 7 May 2024 17:06:38 GMT (envelope-from git) Date: Tue, 7 May 2024 17:06:38 GMT Message-Id: <202405071706.447H6c6Q051926@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 67df63f10e68 - stable/13 - Merge llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 67df63f10e68c25c781a9047c9555bbd419bdd98 Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=67df63f10e68c25c781a9047c9555bbd419bdd98 commit 67df63f10e68c25c781a9047c9555bbd419bdd98 Author: Dimitry Andric AuthorDate: 2024-05-04 10:19:32 +0000 Commit: Dimitry Andric CommitDate: 2024-05-07 17:04:21 +0000 Merge llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9 This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9. PR: 276104 MFC after: 3 days (cherry picked from commit 5678d1d98a348f315453555377ccb28821a2ffcd) --- .../llvm-project/clang/lib/CodeGen/CGBuiltin.cpp | 25 ++++++----- contrib/llvm-project/clang/lib/CodeGen/CGCall.cpp | 5 +++ .../llvm-project/clang/lib/CodeGen/CGObjCGNU.cpp | 34 ++++++++------- .../llvm-project/clang/lib/CodeGen/CodeGenModule.h | 3 ++ .../clang/lib/CodeGen/CoverageMappingGen.cpp | 11 +++-- .../clang/lib/CodeGen/MicrosoftCXXABI.cpp | 12 ++++-- .../clang/lib/Format/ContinuationIndenter.cpp | 8 +++- .../clang/lib/Format/TokenAnnotator.cpp | 10 ++--- .../clang/lib/Format/UnwrappedLineParser.cpp | 40 ++++++++++-------- .../clang/lib/StaticAnalyzer/Checkers/Taint.cpp | 14 +++---- .../Checkers/cert/InvalidPtrChecker.cpp | 6 ++- .../libcxx/modules/std.compat/cstdlib.inc | 2 +- .../include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h | 20 +++++++-- .../llvm/lib/CodeGen/CodeGenPrepare.cpp | 2 + .../llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | 4 +- .../lib/CodeGen/GlobalISel/LegalizerHelper.cpp | 4 ++ .../llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp | 48 +++++++++++++--------- .../llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 9 +++- .../llvm/lib/Target/AArch64/AArch64InstrInfo.td | 10 ----- .../llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp | 10 ++--- .../llvm/lib/Target/RISCV/RISCVISelLowering.cpp | 2 +- .../llvm/lib/Target/X86/X86ISelDAGToDAG.cpp | 7 ++-- .../llvm/lib/Target/X86/X86ISelLowering.cpp | 29 +++++++------ .../llvm/lib/Target/X86/X86Subtarget.h | 3 +- .../llvm-project/llvm/lib/TargetParser/Host.cpp | 5 ++- .../Transforms/InstCombine/InstCombineSelect.cpp | 2 +- .../Scalar/InductiveRangeCheckElimination.cpp | 3 ++ 27 files changed, 200 insertions(+), 128 deletions(-) diff --git a/contrib/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp b/contrib/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp index a4f26a6f0eb1..44ddd2428b10 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp @@ -823,29 +823,32 @@ const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberField( ASTContext &Ctx, const RecordDecl *RD, StringRef Name, uint64_t &Offset) { const LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel = getLangOpts().getStrictFlexArraysLevel(); - unsigned FieldNo = 0; - bool IsUnion = RD->isUnion(); + uint32_t FieldNo = 0; - for (const Decl *D : RD->decls()) { - if (const auto *Field = dyn_cast(D); - Field && (Name.empty() || Field->getNameAsString() == Name) && + if (RD->isImplicit()) + return nullptr; + + for (const FieldDecl *FD : RD->fields()) { + if ((Name.empty() || FD->getNameAsString() == Name) && Decl::isFlexibleArrayMemberLike( - Ctx, Field, Field->getType(), StrictFlexArraysLevel, + Ctx, FD, FD->getType(), StrictFlexArraysLevel, /*IgnoreTemplateOrMacroSubstitution=*/true)) { const ASTRecordLayout &Layout = Ctx.getASTRecordLayout(RD); Offset += Layout.getFieldOffset(FieldNo); - return Field; + return FD; } - if (const auto *Record = dyn_cast(D)) - if (const FieldDecl *Field = - FindFlexibleArrayMemberField(Ctx, Record, Name, Offset)) { + QualType Ty = FD->getType(); + if (Ty->isRecordType()) { + if (const FieldDecl *Field = FindFlexibleArrayMemberField( + Ctx, Ty->getAsRecordDecl(), Name, Offset)) { const ASTRecordLayout &Layout = Ctx.getASTRecordLayout(RD); Offset += Layout.getFieldOffset(FieldNo); return Field; } + } - if (!IsUnion && isa(D)) + if (!RD->isUnion()) ++FieldNo; } diff --git a/contrib/llvm-project/clang/lib/CodeGen/CGCall.cpp b/contrib/llvm-project/clang/lib/CodeGen/CGCall.cpp index 28c211aa631e..a6a2f3595fe7 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/CGCall.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/CGCall.cpp @@ -1581,6 +1581,11 @@ bool CodeGenModule::ReturnTypeUsesSRet(const CGFunctionInfo &FI) { return RI.isIndirect() || (RI.isInAlloca() && RI.getInAllocaSRet()); } +bool CodeGenModule::ReturnTypeHasInReg(const CGFunctionInfo &FI) { + const auto &RI = FI.getReturnInfo(); + return RI.getInReg(); +} + bool CodeGenModule::ReturnSlotInterferesWithArgs(const CGFunctionInfo &FI) { return ReturnTypeUsesSRet(FI) && getTargetCodeGenInfo().doesReturnSlotInterfereWithArgs(); diff --git a/contrib/llvm-project/clang/lib/CodeGen/CGObjCGNU.cpp b/contrib/llvm-project/clang/lib/CodeGen/CGObjCGNU.cpp index a36b0cdddaf0..05e3f8d4bfc2 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/CGObjCGNU.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/CGObjCGNU.cpp @@ -2903,23 +2903,29 @@ CGObjCGNU::GenerateMessageSend(CodeGenFunction &CGF, break; case CodeGenOptions::Mixed: case CodeGenOptions::NonLegacy: + StringRef name = "objc_msgSend"; if (CGM.ReturnTypeUsesFPRet(ResultType)) { - imp = - CGM.CreateRuntimeFunction(llvm::FunctionType::get(IdTy, IdTy, true), - "objc_msgSend_fpret") - .getCallee(); + name = "objc_msgSend_fpret"; } else if (CGM.ReturnTypeUsesSRet(MSI.CallInfo)) { - // The actual types here don't matter - we're going to bitcast the - // function anyway - imp = - CGM.CreateRuntimeFunction(llvm::FunctionType::get(IdTy, IdTy, true), - "objc_msgSend_stret") - .getCallee(); - } else { - imp = CGM.CreateRuntimeFunction( - llvm::FunctionType::get(IdTy, IdTy, true), "objc_msgSend") - .getCallee(); + name = "objc_msgSend_stret"; + + // The address of the memory block is be passed in x8 for POD type, + // or in x0 for non-POD type (marked as inreg). + bool shouldCheckForInReg = + CGM.getContext() + .getTargetInfo() + .getTriple() + .isWindowsMSVCEnvironment() && + CGM.getContext().getTargetInfo().getTriple().isAArch64(); + if (shouldCheckForInReg && CGM.ReturnTypeHasInReg(MSI.CallInfo)) { + name = "objc_msgSend_stret2"; + } } + // The actual types here don't matter - we're going to bitcast the + // function anyway + imp = CGM.CreateRuntimeFunction(llvm::FunctionType::get(IdTy, IdTy, true), + name) + .getCallee(); } // Reset the receiver in case the lookup modified it diff --git a/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.h b/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.h index ec34680fd3f7..d9ece4d98eec 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.h +++ b/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.h @@ -1239,6 +1239,9 @@ public: /// Return true iff the given type uses 'sret' when used as a return type. bool ReturnTypeUsesSRet(const CGFunctionInfo &FI); + /// Return true iff the given type has `inreg` set. + bool ReturnTypeHasInReg(const CGFunctionInfo &FI); + /// Return true iff the given type uses an argument slot when 'sret' is used /// as a return type. bool ReturnSlotInterferesWithArgs(const CGFunctionInfo &FI); diff --git a/contrib/llvm-project/clang/lib/CodeGen/CoverageMappingGen.cpp b/contrib/llvm-project/clang/lib/CodeGen/CoverageMappingGen.cpp index 0c43317642bc..ae4e6d4c88c0 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/CoverageMappingGen.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/CoverageMappingGen.cpp @@ -1207,6 +1207,12 @@ struct CounterCoverageMappingBuilder /// Find a valid gap range between \p AfterLoc and \p BeforeLoc. std::optional findGapAreaBetween(SourceLocation AfterLoc, SourceLocation BeforeLoc) { + // Some statements (like AttributedStmt and ImplicitValueInitExpr) don't + // have valid source locations. Do not emit a gap region if this is the case + // in either AfterLoc end or BeforeLoc end. + if (AfterLoc.isInvalid() || BeforeLoc.isInvalid()) + return std::nullopt; + // If AfterLoc is in function-like macro, use the right parenthesis // location. if (AfterLoc.isMacroID()) { @@ -1370,9 +1376,8 @@ struct CounterCoverageMappingBuilder for (const Stmt *Child : S->children()) if (Child) { // If last statement contains terminate statements, add a gap area - // between the two statements. Skipping attributed statements, because - // they don't have valid start location. - if (LastStmt && HasTerminateStmt && !isa(Child)) { + // between the two statements. + if (LastStmt && HasTerminateStmt) { auto Gap = findGapAreaBetween(getEnd(LastStmt), getStart(Child)); if (Gap) fillGapAreaWithCount(Gap->getBegin(), Gap->getEnd(), diff --git a/contrib/llvm-project/clang/lib/CodeGen/MicrosoftCXXABI.cpp b/contrib/llvm-project/clang/lib/CodeGen/MicrosoftCXXABI.cpp index 172c4c937b97..4d0f4c63f843 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/MicrosoftCXXABI.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/MicrosoftCXXABI.cpp @@ -1135,9 +1135,15 @@ static bool isTrivialForMSVC(const CXXRecordDecl *RD, QualType Ty, return false; if (RD->hasNonTrivialCopyAssignment()) return false; - for (const CXXConstructorDecl *Ctor : RD->ctors()) - if (Ctor->isUserProvided()) - return false; + for (const Decl *D : RD->decls()) { + if (auto *Ctor = dyn_cast(D)) { + if (Ctor->isUserProvided()) + return false; + } else if (auto *Template = dyn_cast(D)) { + if (isa(Template->getTemplatedDecl())) + return false; + } + } if (RD->hasNonTrivialDestructor()) return false; return true; diff --git a/contrib/llvm-project/clang/lib/Format/ContinuationIndenter.cpp b/contrib/llvm-project/clang/lib/Format/ContinuationIndenter.cpp index a3eb9138b218..53cd169b0590 100644 --- a/contrib/llvm-project/clang/lib/Format/ContinuationIndenter.cpp +++ b/contrib/llvm-project/clang/lib/Format/ContinuationIndenter.cpp @@ -674,7 +674,13 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun, // arguments to function calls. We do this by ensuring that either all // arguments (including any lambdas) go on the same line as the function // call, or we break before the first argument. - auto PrevNonComment = Current.getPreviousNonComment(); + const auto *Prev = Current.Previous; + if (!Prev) + return false; + // For example, `/*Newline=*/false`. + if (Prev->is(TT_BlockComment) && Current.SpacesRequiredBefore == 0) + return false; + const auto *PrevNonComment = Current.getPreviousNonComment(); if (!PrevNonComment || PrevNonComment->isNot(tok::l_paren)) return false; if (Current.isOneOf(tok::comment, tok::l_paren, TT_LambdaLSquare)) diff --git a/contrib/llvm-project/clang/lib/Format/TokenAnnotator.cpp b/contrib/llvm-project/clang/lib/Format/TokenAnnotator.cpp index 4d482e6543d6..c1f166248192 100644 --- a/contrib/llvm-project/clang/lib/Format/TokenAnnotator.cpp +++ b/contrib/llvm-project/clang/lib/Format/TokenAnnotator.cpp @@ -3532,6 +3532,8 @@ void TokenAnnotator::calculateFormattingInformation(AnnotatedLine &Line) const { } } else if (ClosingParen) { for (auto *Tok = ClosingParen->Next; Tok; Tok = Tok->Next) { + if (Tok->is(TT_CtorInitializerColon)) + break; if (Tok->is(tok::arrow)) { Tok->setType(TT_TrailingReturnArrow); break; @@ -5157,12 +5159,8 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine &Line, return true; if (Left.IsUnterminatedLiteral) return true; - // FIXME: Breaking after newlines seems useful in general. Turn this into an - // option and recognize more cases like endl etc, and break independent of - // what comes after operator lessless. - if (Right.is(tok::lessless) && Right.Next && - Right.Next->is(tok::string_literal) && Left.is(tok::string_literal) && - Left.TokenText.ends_with("\\n\"")) { + if (Right.is(tok::lessless) && Right.Next && Left.is(tok::string_literal) && + Right.Next->is(tok::string_literal)) { return true; } if (Right.is(TT_RequiresClause)) { diff --git a/contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.cpp b/contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.cpp index 573919798870..a6eb18bb2b32 100644 --- a/contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.cpp +++ b/contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.cpp @@ -489,18 +489,23 @@ void UnwrappedLineParser::calculateBraceTypes(bool ExpectClassBody) { }; SmallVector LBraceStack; assert(Tok->is(tok::l_brace)); + do { - // Get next non-comment, non-preprocessor token. FormatToken *NextTok; do { NextTok = Tokens->getNextToken(); } while (NextTok->is(tok::comment)); - while (NextTok->is(tok::hash) && !Line->InMacroBody) { - NextTok = Tokens->getNextToken(); - do { - NextTok = Tokens->getNextToken(); - } while (NextTok->is(tok::comment) || - (NextTok->NewlinesBefore == 0 && NextTok->isNot(tok::eof))); + + if (!Line->InMacroBody) { + // Skip PPDirective lines and comments. + while (NextTok->is(tok::hash)) { + do { + NextTok = Tokens->getNextToken(); + } while (NextTok->NewlinesBefore == 0 && NextTok->isNot(tok::eof)); + + while (NextTok->is(tok::comment)) + NextTok = Tokens->getNextToken(); + } } switch (Tok->Tok.getKind()) { @@ -534,16 +539,6 @@ void UnwrappedLineParser::calculateBraceTypes(bool ExpectClassBody) { if (Style.Language == FormatStyle::LK_Proto) { ProbablyBracedList = NextTok->isOneOf(tok::comma, tok::r_square); } else { - // Skip NextTok over preprocessor lines, otherwise we may not - // properly diagnose the block as a braced intializer - // if the comma separator appears after the pp directive. - while (NextTok->is(tok::hash)) { - ScopedMacroState MacroState(*Line, Tokens, NextTok); - do { - NextTok = Tokens->getNextToken(); - } while (NextTok->isNot(tok::eof)); - } - // Using OriginalColumn to distinguish between ObjC methods and // binary operators is a bit hacky. bool NextIsObjCMethod = NextTok->isOneOf(tok::plus, tok::minus) && @@ -602,6 +597,16 @@ void UnwrappedLineParser::calculateBraceTypes(bool ExpectClassBody) { NextTok = Tokens->getNextToken(); ProbablyBracedList = NextTok->isNot(tok::l_square); } + + // Cpp macro definition body that is a nonempty braced list or block: + if (Style.isCpp() && Line->InMacroBody && PrevTok != FormatTok && + !FormatTok->Previous && NextTok->is(tok::eof) && + // A statement can end with only `;` (simple statement), a block + // closing brace (compound statement), or `:` (label statement). + // If PrevTok is a block opening brace, Tok ends an empty block. + !PrevTok->isOneOf(tok::semi, BK_Block, tok::colon)) { + ProbablyBracedList = true; + } } if (ProbablyBracedList) { Tok->setBlockKind(BK_BracedInit); @@ -631,6 +636,7 @@ void UnwrappedLineParser::calculateBraceTypes(bool ExpectClassBody) { default: break; } + PrevTok = Tok; Tok = NextTok; } while (Tok->isNot(tok::eof) && !LBraceStack.empty()); diff --git a/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/Taint.cpp b/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/Taint.cpp index 4edb671753bf..6362c82b009d 100644 --- a/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/Taint.cpp +++ b/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/Taint.cpp @@ -216,21 +216,17 @@ std::vector taint::getTaintedSymbolsImpl(ProgramStateRef State, std::vector TaintedSymbols; if (!Reg) return TaintedSymbols; - // Element region (array element) is tainted if either the base or the offset - // are tainted. + + // Element region (array element) is tainted if the offset is tainted. if (const ElementRegion *ER = dyn_cast(Reg)) { std::vector TaintedIndex = getTaintedSymbolsImpl(State, ER->getIndex(), K, returnFirstOnly); llvm::append_range(TaintedSymbols, TaintedIndex); if (returnFirstOnly && !TaintedSymbols.empty()) return TaintedSymbols; // return early if needed - std::vector TaintedSuperRegion = - getTaintedSymbolsImpl(State, ER->getSuperRegion(), K, returnFirstOnly); - llvm::append_range(TaintedSymbols, TaintedSuperRegion); - if (returnFirstOnly && !TaintedSymbols.empty()) - return TaintedSymbols; // return early if needed } + // Symbolic region is tainted if the corresponding symbol is tainted. if (const SymbolicRegion *SR = dyn_cast(Reg)) { std::vector TaintedRegions = getTaintedSymbolsImpl(State, SR->getSymbol(), K, returnFirstOnly); @@ -239,6 +235,8 @@ std::vector taint::getTaintedSymbolsImpl(ProgramStateRef State, return TaintedSymbols; // return early if needed } + // Any subregion (including Element and Symbolic regions) is tainted if its + // super-region is tainted. if (const SubRegion *ER = dyn_cast(Reg)) { std::vector TaintedSubRegions = getTaintedSymbolsImpl(State, ER->getSuperRegion(), K, returnFirstOnly); @@ -318,4 +316,4 @@ std::vector taint::getTaintedSymbolsImpl(ProgramStateRef State, } } return TaintedSymbols; -} \ No newline at end of file +} diff --git a/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/cert/InvalidPtrChecker.cpp b/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/cert/InvalidPtrChecker.cpp index e5dd907c660d..b2947f590c4e 100644 --- a/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/cert/InvalidPtrChecker.cpp +++ b/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/cert/InvalidPtrChecker.cpp @@ -205,8 +205,12 @@ void InvalidPtrChecker::postPreviousReturnInvalidatingCall( CE, LCtx, CE->getType(), C.blockCount()); State = State->BindExpr(CE, LCtx, RetVal); + const auto *SymRegOfRetVal = + dyn_cast_or_null(RetVal.getAsRegion()); + if (!SymRegOfRetVal) + return; + // Remember to this region. - const auto *SymRegOfRetVal = cast(RetVal.getAsRegion()); const MemRegion *MR = SymRegOfRetVal->getBaseRegion(); State = State->set(FD, MR); diff --git a/contrib/llvm-project/libcxx/modules/std.compat/cstdlib.inc b/contrib/llvm-project/libcxx/modules/std.compat/cstdlib.inc index a45a0a1caf8b..4783cbf51623 100644 --- a/contrib/llvm-project/libcxx/modules/std.compat/cstdlib.inc +++ b/contrib/llvm-project/libcxx/modules/std.compat/cstdlib.inc @@ -25,7 +25,7 @@ export { using ::system; // [c.malloc], C library memory allocation - using ::aligned_alloc; + using ::aligned_alloc _LIBCPP_USING_IF_EXISTS; using ::calloc; using ::free; using ::malloc; diff --git a/contrib/llvm-project/llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h b/contrib/llvm-project/llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h index 0f20a33f3a75..7990997835d0 100644 --- a/contrib/llvm-project/llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h +++ b/contrib/llvm-project/llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h @@ -35,11 +35,23 @@ struct LegalityQuery; class MachineRegisterInfo; namespace GISelAddressing { /// Helper struct to store a base, index and offset that forms an address -struct BaseIndexOffset { +class BaseIndexOffset { +private: Register BaseReg; Register IndexReg; - int64_t Offset = 0; - bool IsIndexSignExt = false; + std::optional Offset; + +public: + BaseIndexOffset() = default; + Register getBase() { return BaseReg; } + Register getBase() const { return BaseReg; } + Register getIndex() { return IndexReg; } + Register getIndex() const { return IndexReg; } + void setBase(Register NewBase) { BaseReg = NewBase; } + void setIndex(Register NewIndex) { IndexReg = NewIndex; } + void setOffset(std::optional NewOff) { Offset = NewOff; } + bool hasValidOffset() const { return Offset.has_value(); } + int64_t getOffset() const { return *Offset; } }; /// Returns a BaseIndexOffset which describes the pointer in \p Ptr. @@ -89,7 +101,7 @@ private: // order stores are writing to incremeneting consecutive addresses. So when // we walk the block in reverse order, the next eligible store must write to // an offset one store width lower than CurrentLowestOffset. - uint64_t CurrentLowestOffset; + int64_t CurrentLowestOffset; SmallVector Stores; // A vector of MachineInstr/unsigned pairs to denote potential aliases that // need to be checked before the candidate is considered safe to merge. The diff --git a/contrib/llvm-project/llvm/lib/CodeGen/CodeGenPrepare.cpp b/contrib/llvm-project/llvm/lib/CodeGen/CodeGenPrepare.cpp index 8ee1f19e083e..1cca56fc19cf 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -8154,6 +8154,7 @@ static bool optimizeBranch(BranchInst *Branch, const TargetLowering &TLI, IRBuilder<> Builder(Branch); if (UI->getParent() != Branch->getParent()) UI->moveBefore(Branch); + UI->dropPoisonGeneratingFlags(); Value *NewCmp = Builder.CreateCmp(ICmpInst::ICMP_EQ, UI, ConstantInt::get(UI->getType(), 0)); LLVM_DEBUG(dbgs() << "Converting " << *Cmp << "\n"); @@ -8167,6 +8168,7 @@ static bool optimizeBranch(BranchInst *Branch, const TargetLowering &TLI, IRBuilder<> Builder(Branch); if (UI->getParent() != Branch->getParent()) UI->moveBefore(Branch); + UI->dropPoisonGeneratingFlags(); Value *NewCmp = Builder.CreateCmp(Cmp->getPredicate(), UI, ConstantInt::get(UI->getType(), 0)); LLVM_DEBUG(dbgs() << "Converting " << *Cmp << "\n"); diff --git a/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp b/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp index 772229215e79..61ddc858ba44 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp @@ -591,8 +591,8 @@ bool CombinerHelper::matchCombineExtendingLoads(MachineInstr &MI, UseMI.getOpcode() == TargetOpcode::G_ZEXT || (UseMI.getOpcode() == TargetOpcode::G_ANYEXT)) { const auto &MMO = LoadMI->getMMO(); - // For atomics, only form anyextending loads. - if (MMO.isAtomic() && UseMI.getOpcode() != TargetOpcode::G_ANYEXT) + // Don't do anything for atomics. + if (MMO.isAtomic()) continue; // Check for legality. if (!isPreLegalize()) { diff --git a/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp b/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp index c0c22e36004f..47d045ac4817 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp @@ -4180,6 +4180,10 @@ LegalizerHelper::fewerElementsVectorPhi(GenericMachineInstr &MI, } } + // Set the insert point after the existing PHIs + MachineBasicBlock &MBB = *MI.getParent(); + MIRBuilder.setInsertPt(MBB, MBB.getFirstNonPHI()); + // Merge small outputs into MI's def. if (NumLeftovers) { mergeMixedSubvectors(MI.getReg(0), OutputRegs); diff --git a/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp b/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp index 246aa88b09ac..ee499c41c558 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp @@ -84,21 +84,20 @@ BaseIndexOffset GISelAddressing::getPointerInfo(Register Ptr, MachineRegisterInfo &MRI) { BaseIndexOffset Info; Register PtrAddRHS; - if (!mi_match(Ptr, MRI, m_GPtrAdd(m_Reg(Info.BaseReg), m_Reg(PtrAddRHS)))) { - Info.BaseReg = Ptr; - Info.IndexReg = Register(); - Info.IsIndexSignExt = false; + Register BaseReg; + if (!mi_match(Ptr, MRI, m_GPtrAdd(m_Reg(BaseReg), m_Reg(PtrAddRHS)))) { + Info.setBase(Ptr); + Info.setOffset(0); return Info; } - + Info.setBase(BaseReg); auto RHSCst = getIConstantVRegValWithLookThrough(PtrAddRHS, MRI); if (RHSCst) - Info.Offset = RHSCst->Value.getSExtValue(); + Info.setOffset(RHSCst->Value.getSExtValue()); // Just recognize a simple case for now. In future we'll need to match // indexing patterns for base + index + constant. - Info.IndexReg = PtrAddRHS; - Info.IsIndexSignExt = false; + Info.setIndex(PtrAddRHS); return Info; } @@ -114,15 +113,16 @@ bool GISelAddressing::aliasIsKnownForLoadStore(const MachineInstr &MI1, BaseIndexOffset BasePtr0 = getPointerInfo(LdSt1->getPointerReg(), MRI); BaseIndexOffset BasePtr1 = getPointerInfo(LdSt2->getPointerReg(), MRI); - if (!BasePtr0.BaseReg.isValid() || !BasePtr1.BaseReg.isValid()) + if (!BasePtr0.getBase().isValid() || !BasePtr1.getBase().isValid()) return false; int64_t Size1 = LdSt1->getMemSize(); int64_t Size2 = LdSt2->getMemSize(); int64_t PtrDiff; - if (BasePtr0.BaseReg == BasePtr1.BaseReg) { - PtrDiff = BasePtr1.Offset - BasePtr0.Offset; + if (BasePtr0.getBase() == BasePtr1.getBase() && BasePtr0.hasValidOffset() && + BasePtr1.hasValidOffset()) { + PtrDiff = BasePtr1.getOffset() - BasePtr0.getOffset(); // If the size of memory access is unknown, do not use it to do analysis. // One example of unknown size memory access is to load/store scalable // vector objects on the stack. @@ -151,8 +151,8 @@ bool GISelAddressing::aliasIsKnownForLoadStore(const MachineInstr &MI1, // able to calculate their relative offset if at least one arises // from an alloca. However, these allocas cannot overlap and we // can infer there is no alias. - auto *Base0Def = getDefIgnoringCopies(BasePtr0.BaseReg, MRI); - auto *Base1Def = getDefIgnoringCopies(BasePtr1.BaseReg, MRI); + auto *Base0Def = getDefIgnoringCopies(BasePtr0.getBase(), MRI); + auto *Base1Def = getDefIgnoringCopies(BasePtr1.getBase(), MRI); if (!Base0Def || !Base1Def) return false; // Couldn't tell anything. @@ -520,16 +520,20 @@ bool LoadStoreOpt::addStoreToCandidate(GStore &StoreMI, Register StoreAddr = StoreMI.getPointerReg(); auto BIO = getPointerInfo(StoreAddr, *MRI); - Register StoreBase = BIO.BaseReg; - uint64_t StoreOffCst = BIO.Offset; + Register StoreBase = BIO.getBase(); if (C.Stores.empty()) { + C.BasePtr = StoreBase; + if (!BIO.hasValidOffset()) { + C.CurrentLowestOffset = 0; + } else { + C.CurrentLowestOffset = BIO.getOffset(); + } // This is the first store of the candidate. // If the offset can't possibly allow for a lower addressed store with the // same base, don't bother adding it. - if (StoreOffCst < ValueTy.getSizeInBytes()) + if (BIO.hasValidOffset() && + BIO.getOffset() < static_cast(ValueTy.getSizeInBytes())) return false; - C.BasePtr = StoreBase; - C.CurrentLowestOffset = StoreOffCst; C.Stores.emplace_back(&StoreMI); LLVM_DEBUG(dbgs() << "Starting a new merge candidate group with: " << StoreMI); @@ -549,8 +553,12 @@ bool LoadStoreOpt::addStoreToCandidate(GStore &StoreMI, // writes to the next lowest adjacent address. if (C.BasePtr != StoreBase) return false; - if ((C.CurrentLowestOffset - ValueTy.getSizeInBytes()) != - static_cast(StoreOffCst)) + // If we don't have a valid offset, we can't guarantee to be an adjacent + // offset. + if (!BIO.hasValidOffset()) + return false; + if ((C.CurrentLowestOffset - + static_cast(ValueTy.getSizeInBytes())) != BIO.getOffset()) return false; // This writes to an adjacent address. Allow it. diff --git a/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index e806e0f0731f..5038f8a1fc15 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -9636,8 +9636,15 @@ static SDValue combineShiftOfShiftedLogic(SDNode *Shift, SelectionDAG &DAG) { if (ShiftAmtVal->getBitWidth() != C1Val.getBitWidth()) return false; + // The fold is not valid if the sum of the shift values doesn't fit in the + // given shift amount type. + bool Overflow = false; + APInt NewShiftAmt = C1Val.uadd_ov(*ShiftAmtVal, Overflow); + if (Overflow) + return false; + // The fold is not valid if the sum of the shift values exceeds bitwidth. - if ((*ShiftAmtVal + C1Val).uge(V.getScalarValueSizeInBits())) + if (NewShiftAmt.uge(V.getScalarValueSizeInBits())) return false; return true; diff --git a/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64InstrInfo.td b/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64InstrInfo.td index 03baa7497615..ac61dd8745d4 100644 --- a/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64InstrInfo.td +++ b/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64InstrInfo.td @@ -4885,19 +4885,9 @@ defm UABDL : SIMDLongThreeVectorBHSabdl<1, 0b0111, "uabdl", def : Pat<(abs (v8i16 (sub (zext (v8i8 V64:$opA)), (zext (v8i8 V64:$opB))))), (UABDLv8i8_v8i16 V64:$opA, V64:$opB)>; -def : Pat<(xor (v8i16 (AArch64vashr v8i16:$src, (i32 15))), - (v8i16 (add (sub (zext (v8i8 V64:$opA)), - (zext (v8i8 V64:$opB))), - (AArch64vashr v8i16:$src, (i32 15))))), - (UABDLv8i8_v8i16 V64:$opA, V64:$opB)>; def : Pat<(abs (v8i16 (sub (zext (extract_high_v16i8 (v16i8 V128:$opA))), (zext (extract_high_v16i8 (v16i8 V128:$opB)))))), (UABDLv16i8_v8i16 V128:$opA, V128:$opB)>; -def : Pat<(xor (v8i16 (AArch64vashr v8i16:$src, (i32 15))), - (v8i16 (add (sub (zext (extract_high_v16i8 (v16i8 V128:$opA))), - (zext (extract_high_v16i8 (v16i8 V128:$opB)))), - (AArch64vashr v8i16:$src, (i32 15))))), - (UABDLv16i8_v8i16 V128:$opA, V128:$opB)>; def : Pat<(abs (v4i32 (sub (zext (v4i16 V64:$opA)), (zext (v4i16 V64:$opB))))), (UABDLv4i16_v4i32 V64:$opA, V64:$opB)>; diff --git a/contrib/llvm-project/llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp b/contrib/llvm-project/llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp index 84b9330ef963..50d8bfa87508 100644 --- a/contrib/llvm-project/llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp +++ b/contrib/llvm-project/llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp @@ -2358,6 +2358,11 @@ bool SIGfx12CacheControl::enableVolatileAndOrNonTemporal( bool Changed = false; + if (IsNonTemporal) { + // Set non-temporal hint for all cache levels. + Changed |= setTH(MI, AMDGPU::CPol::TH_NT); + } + if (IsVolatile) { Changed |= setScope(MI, AMDGPU::CPol::SCOPE_SYS); @@ -2370,11 +2375,6 @@ bool SIGfx12CacheControl::enableVolatileAndOrNonTemporal( Position::AFTER); } - if (IsNonTemporal) { - // Set non-temporal hint for all cache levels. - Changed |= setTH(MI, AMDGPU::CPol::TH_NT); - } - return Changed; } diff --git a/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVISelLowering.cpp index a0cec426002b..d46093b9e260 100644 --- a/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVISelLowering.cpp +++ b/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVISelLowering.cpp @@ -14559,7 +14559,7 @@ static SDValue tryFoldSelectIntoOp(SDNode *N, SelectionDAG &DAG, EVT VT = N->getValueType(0); SDLoc DL(N); SDValue OtherOp = TrueVal.getOperand(1 - OpToFold); - EVT OtherOpVT = OtherOp->getValueType(0); + EVT OtherOpVT = OtherOp.getValueType(); SDValue IdentityOperand = DAG.getNeutralElement(Opc, DL, OtherOpVT, N->getFlags()); if (!Commutative) diff --git a/contrib/llvm-project/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp b/contrib/llvm-project/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp index 833f058253d8..553d338b7790 100644 --- a/contrib/llvm-project/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp +++ b/contrib/llvm-project/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp @@ -2923,11 +2923,10 @@ bool X86DAGToDAGISel::selectAddr(SDNode *Parent, SDValue N, SDValue &Base, } bool X86DAGToDAGISel::selectMOV64Imm32(SDValue N, SDValue &Imm) { - // Cannot use 32 bit constants to reference objects in kernel code model. - // Cannot use 32 bit constants to reference objects in large PIC mode since - // GOTOFF is 64 bits. + // Cannot use 32 bit constants to reference objects in kernel/large code + // model. if (TM.getCodeModel() == CodeModel::Kernel || - (TM.getCodeModel() == CodeModel::Large && TM.isPositionIndependent())) + TM.getCodeModel() == CodeModel::Large) return false; // In static codegen with small code model, we can get the address of a label diff --git a/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp b/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp index 96bbd981ff24..201dd8382536 100644 --- a/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -47038,10 +47038,13 @@ static SDValue combineShiftRightArithmetic(SDNode *N, SelectionDAG &DAG, if (SDValue V = combineShiftToPMULH(N, DAG, Subtarget)) return V; - // fold (ashr (shl, a, [56,48,32,24,16]), SarConst) - // into (shl, (sext (a), [56,48,32,24,16] - SarConst)) or - // into (lshr, (sext (a), SarConst - [56,48,32,24,16])) - // depending on sign of (SarConst - [56,48,32,24,16]) + // fold (SRA (SHL X, ShlConst), SraConst) + // into (SHL (sext_in_reg X), ShlConst - SraConst) + // or (sext_in_reg X) + // or (SRA (sext_in_reg X), SraConst - ShlConst) + // depending on relation between SraConst and ShlConst. + // We only do this if (Size - ShlConst) is equal to 8, 16 or 32. That allows + // us to do the sext_in_reg from corresponding bit. // sexts in X86 are MOVs. The MOVs have the same code size // as above SHIFTs (only SHIFT on 1 has lower code size). @@ -47057,29 +47060,29 @@ static SDValue combineShiftRightArithmetic(SDNode *N, SelectionDAG &DAG, SDValue N00 = N0.getOperand(0); SDValue N01 = N0.getOperand(1); APInt ShlConst = N01->getAsAPIntVal(); - APInt SarConst = N1->getAsAPIntVal(); + APInt SraConst = N1->getAsAPIntVal(); EVT CVT = N1.getValueType(); - if (SarConst.isNegative()) + if (CVT != N01.getValueType()) + return SDValue(); + if (SraConst.isNegative()) return SDValue(); for (MVT SVT : { MVT::i8, MVT::i16, MVT::i32 }) { unsigned ShiftSize = SVT.getSizeInBits(); - // skipping types without corresponding sext/zext and - // ShlConst that is not one of [56,48,32,24,16] + // Only deal with (Size - ShlConst) being equal to 8, 16 or 32. if (ShiftSize >= Size || ShlConst != Size - ShiftSize) continue; SDLoc DL(N); SDValue NN = DAG.getNode(ISD::SIGN_EXTEND_INREG, DL, VT, N00, DAG.getValueType(SVT)); - SarConst = SarConst - (Size - ShiftSize); - if (SarConst == 0) + if (SraConst.eq(ShlConst)) return NN; - if (SarConst.isNegative()) + if (SraConst.ult(ShlConst)) return DAG.getNode(ISD::SHL, DL, VT, NN, - DAG.getConstant(-SarConst, DL, CVT)); + DAG.getConstant(ShlConst - SraConst, DL, CVT)); return DAG.getNode(ISD::SRA, DL, VT, NN, - DAG.getConstant(SarConst, DL, CVT)); + DAG.getConstant(SraConst - ShlConst, DL, CVT)); } return SDValue(); } diff --git a/contrib/llvm-project/llvm/lib/Target/X86/X86Subtarget.h b/contrib/llvm-project/llvm/lib/Target/X86/X86Subtarget.h index a458b5f9ec8f..4d55a084b730 100644 --- a/contrib/llvm-project/llvm/lib/Target/X86/X86Subtarget.h +++ b/contrib/llvm-project/llvm/lib/Target/X86/X86Subtarget.h @@ -244,7 +244,8 @@ public: // TODO: Currently we're always allowing widening on CPUs without VLX, // because for many cases we don't have a better option. bool canExtendTo512DQ() const { - return hasAVX512() && (!hasVLX() || getPreferVectorWidth() >= 512); + return hasAVX512() && hasEVEX512() && + (!hasVLX() || getPreferVectorWidth() >= 512); } bool canExtendTo512BW() const { return hasBWI() && canExtendTo512DQ(); diff --git a/contrib/llvm-project/llvm/lib/TargetParser/Host.cpp b/contrib/llvm-project/llvm/lib/TargetParser/Host.cpp index 4466d50458e1..1adef15771fa 100644 --- a/contrib/llvm-project/llvm/lib/TargetParser/Host.cpp +++ b/contrib/llvm-project/llvm/lib/TargetParser/Host.cpp @@ -1266,8 +1266,10 @@ static void getAvailableFeatures(unsigned ECX, unsigned EDX, unsigned MaxLeaf, setFeature(X86::FEATURE_AVX2); if (HasLeaf7 && ((EBX >> 8) & 1)) setFeature(X86::FEATURE_BMI2); - if (HasLeaf7 && ((EBX >> 16) & 1) && HasAVX512Save) + if (HasLeaf7 && ((EBX >> 16) & 1) && HasAVX512Save) { setFeature(X86::FEATURE_AVX512F); + setFeature(X86::FEATURE_EVEX512); + } if (HasLeaf7 && ((EBX >> 17) & 1) && HasAVX512Save) setFeature(X86::FEATURE_AVX512DQ); if (HasLeaf7 && ((EBX >> 19) & 1)) @@ -1772,6 +1774,7 @@ bool sys::getHostCPUFeatures(StringMap &Features) { Features["rtm"] = HasLeaf7 && ((EBX >> 11) & 1); // AVX512 is only supported if the OS supports the context save for it. Features["avx512f"] = HasLeaf7 && ((EBX >> 16) & 1) && HasAVX512Save; + Features["evex512"] = Features["avx512f"]; Features["avx512dq"] = HasLeaf7 && ((EBX >> 17) & 1) && HasAVX512Save; Features["rdseed"] = HasLeaf7 && ((EBX >> 18) & 1); Features["adx"] = HasLeaf7 && ((EBX >> 19) & 1); diff --git a/contrib/llvm-project/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp b/contrib/llvm-project/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp index 9f220ec003ec..8cc7901cbac7 100644 --- a/contrib/llvm-project/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp +++ b/contrib/llvm-project/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp @@ -2606,7 +2606,7 @@ static Instruction *foldSelectWithSRem(SelectInst &SI, InstCombinerImpl &IC, // %cnd = icmp slt i32 %rem, 0 // %add = add i32 %rem, %n // %sel = select i1 %cnd, i32 %add, i32 %rem - if (match(TrueVal, m_Add(m_Value(RemRes), m_Value(Remainder))) && + if (match(TrueVal, m_Add(m_Specific(RemRes), m_Value(Remainder))) && match(RemRes, m_SRem(m_Value(Op), m_Specific(Remainder))) && IC.isKnownToBeAPowerOfTwo(Remainder, /*OrZero*/ true) && FalseVal == RemRes) diff --git a/contrib/llvm-project/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp b/contrib/llvm-project/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp index 9df28747570c..104e8ceb7967 100644 --- a/contrib/llvm-project/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp +++ b/contrib/llvm-project/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp @@ -279,6 +279,9 @@ bool InductiveRangeCheck::parseRangeCheckICmp(Loop *L, ICmpInst *ICI, Value *LHS = ICI->getOperand(0); Value *RHS = ICI->getOperand(1); + if (!LHS->getType()->isIntegerTy()) + return false; + // Canonicalize to the `Index Pred Invariant` comparison if (IsLoopInvariant(LHS)) { std::swap(LHS, RHS); From nobody Tue May 7 17:06:40 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VYl743VX8z5JFRw; Tue, 07 May 2024 17:06:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VYl742VXhz4bc0; Tue, 7 May 2024 17:06:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715101600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0g3JW8nTMo424QJIT0bRKwejeaiShx5mzw0eArKbgM0=; b=VPwiDJq9tAPaLuM2PoQ2VWXowLmb09ZlR9Ou/7UZqf0KFYDKL6lUMpFwRLS0bVltDJl1cb 4yots7Q+LxIZXSeMEGme1VfDPAePr33r/aNZ4yIPS7WHBndDX4TSpYGO85Dxw/JwlIB/6o h4qGS88x4zV/mNmo8Wq8f6QzXAuwzhcD4BH0BDSeV7m1ZNkOj59RKPT4f0F3AFpY7DC47C WK9WKSrdbpYD7oQ5y7/zR5oVJVcfZ6nVazLJr6Mdqgb/dpJ1hkP+GBgmOdC3At0gCUcOGc 0pTXBlmgpr2J6DDW1wWlFelgijIoB+ertTDYUh2qU0n6N6hYa6euE/vY2xZY8Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715101600; a=rsa-sha256; cv=none; b=aU9MqUqq+Aa2BKfCAzLVCDF5FuAoST+3kn4A7TEzo8KZXj3IWACannXPTV73BRv+wSrZaf IlTh0W/a/2iC9+qeufkSAyWpGc0eJg2uxLWGeRgq4Y0o7eIIE9KurQA5GDUL1gvpcNAHG5 nfWyEUzJ2ryyREYwsKa/CMJb4/+F8iQwHHwr/j8U3d2qciihVQMjkOLfWqSuEfCHBI7No7 advrC/pY+j6IvUgllMuIcJyzer8JRbLWMYyysoFjgr3zdniQiHAWaOuxg9Fd4nwJfI+Kll wyNa21IekwHbEs4Ux/3kIlcABDQlObNbPLt2zUTETonNVP+x2vSG7Ylex1JW8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715101600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0g3JW8nTMo424QJIT0bRKwejeaiShx5mzw0eArKbgM0=; b=FXR50x20SNuwaCs9AgVTwXXlPvqTZ68djQr3+azH7sT3aIs/+esSX1Id3KPFY+4rnEXp2c SN0BUKitobcd83Id5yEbCp3yGBHGqmQuZ7ewmD4qY4PtxyFpXAP9QWgReLDoYR1/RBH1Yb 5+VrzNZT4k0fWapswoKvkl4dqGTDHQfnPZ0sC30Rcus4dM5D8XGhKzAXvmdG4u91s3vqoq 7l/JGOrFeiaXHVlurmXdY+pquYAl++lpN13KN/ose3En9YIhY4No/fQqbtcWqa3bwd4ubk 8yNZ4UnDR1CUajCJyqjms89zDBsnWwQwmSPdywwNntR9RLlDrOGOx/664fDKTw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VYl7425LyzqTJ; Tue, 7 May 2024 17:06:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 447H6e7a051971; Tue, 7 May 2024 17:06:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 447H6eVl051968; Tue, 7 May 2024 17:06:40 GMT (envelope-from git) Date: Tue, 7 May 2024 17:06:40 GMT Message-Id: <202405071706.447H6eVl051968@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 3c6fe83671c9 - stable/13 - Fixup: Merge llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3c6fe83671c9054fb241f3d42c14977e0ae8b225 Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=3c6fe83671c9054fb241f3d42c14977e0ae8b225 commit 3c6fe83671c9054fb241f3d42c14977e0ae8b225 Author: Dimitry Andric AuthorDate: 2024-05-04 10:19:32 +0000 Commit: Dimitry Andric CommitDate: 2024-05-07 17:04:27 +0000 Fixup: Merge llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9 Update version numbers, config headers, etc. Git tricked me into losing these before pushing. PR: 276104 Fixes: d67fc74b9249 MFC after: 3 days (cherry picked from commit 894cb08f0d3656fdb81f4d89085bedc4235f3cb6) --- lib/clang/include/VCSVersion.inc | 6 +++--- lib/clang/include/clang/Basic/Version.inc | 6 +++--- lib/clang/include/lld/Common/Version.inc | 2 +- lib/clang/include/lldb/Version/Version.inc | 6 +++--- lib/clang/include/llvm/Config/config.h | 4 ++-- lib/clang/include/llvm/Config/llvm-config.h | 4 ++-- lib/clang/include/llvm/Support/VCSRevision.h | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/clang/include/VCSVersion.inc b/lib/clang/include/VCSVersion.inc index 687fb1656937..c4bb0df4e3a5 100644 --- a/lib/clang/include/VCSVersion.inc +++ b/lib/clang/include/VCSVersion.inc @@ -1,8 +1,8 @@ -#define LLVM_REVISION "llvmorg-18.1.4-0-ge6c3289804a6" +#define LLVM_REVISION "llvmorg-18.1.5-0-g617a15a9eac9" #define LLVM_REPOSITORY "https://github.com/llvm/llvm-project.git" -#define CLANG_REVISION "llvmorg-18.1.4-0-ge6c3289804a6" +#define CLANG_REVISION "llvmorg-18.1.5-0-g617a15a9eac9" #define CLANG_REPOSITORY "https://github.com/llvm/llvm-project.git" -#define LLDB_REVISION "llvmorg-18.1.4-0-ge6c3289804a6" +#define LLDB_REVISION "llvmorg-18.1.5-0-g617a15a9eac9" #define LLDB_REPOSITORY "https://github.com/llvm/llvm-project.git" diff --git a/lib/clang/include/clang/Basic/Version.inc b/lib/clang/include/clang/Basic/Version.inc index 536f72efec52..c243016c5f73 100644 --- a/lib/clang/include/clang/Basic/Version.inc +++ b/lib/clang/include/clang/Basic/Version.inc @@ -1,8 +1,8 @@ -#define CLANG_VERSION 18.1.4 -#define CLANG_VERSION_STRING "18.1.4" +#define CLANG_VERSION 18.1.5 +#define CLANG_VERSION_STRING "18.1.5" #define CLANG_VERSION_MAJOR 18 #define CLANG_VERSION_MAJOR_STRING "18" #define CLANG_VERSION_MINOR 1 -#define CLANG_VERSION_PATCHLEVEL 4 +#define CLANG_VERSION_PATCHLEVEL 5 #define CLANG_VENDOR "FreeBSD " diff --git a/lib/clang/include/lld/Common/Version.inc b/lib/clang/include/lld/Common/Version.inc index 65838f76ba5d..4079a361ce8d 100644 --- a/lib/clang/include/lld/Common/Version.inc +++ b/lib/clang/include/lld/Common/Version.inc @@ -1,4 +1,4 @@ // Local identifier in __FreeBSD_version style #define LLD_FREEBSD_VERSION 1400006 -#define LLD_VERSION_STRING "18.1.4 (FreeBSD llvmorg-18.1.4-0-ge6c3289804a6-" __XSTRING(LLD_FREEBSD_VERSION) ")" +#define LLD_VERSION_STRING "18.1.5 (FreeBSD llvmorg-18.1.5-0-g617a15a9eac9-" __XSTRING(LLD_FREEBSD_VERSION) ")" diff --git a/lib/clang/include/lldb/Version/Version.inc b/lib/clang/include/lldb/Version/Version.inc index 1fc1a4d88b7b..0e86bd2e01ba 100644 --- a/lib/clang/include/lldb/Version/Version.inc +++ b/lib/clang/include/lldb/Version/Version.inc @@ -1,6 +1,6 @@ -#define LLDB_VERSION 18.1.4 -#define LLDB_VERSION_STRING "18.1.4" +#define LLDB_VERSION 18.1.5 +#define LLDB_VERSION_STRING "18.1.5" #define LLDB_VERSION_MAJOR 18 #define LLDB_VERSION_MINOR 1 -#define LLDB_VERSION_PATCH 4 +#define LLDB_VERSION_PATCH 5 /* #undef LLDB_FULL_VERSION_STRING */ diff --git a/lib/clang/include/llvm/Config/config.h b/lib/clang/include/llvm/Config/config.h index a017437dc568..0760c0b17a87 100644 --- a/lib/clang/include/llvm/Config/config.h +++ b/lib/clang/include/llvm/Config/config.h @@ -344,10 +344,10 @@ #define PACKAGE_NAME "LLVM" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "LLVM 18.1.4" +#define PACKAGE_STRING "LLVM 18.1.5" /* Define to the version of this package. */ -#define PACKAGE_VERSION "18.1.4" +#define PACKAGE_VERSION "18.1.5" /* Define to the vendor of this package. */ /* #undef PACKAGE_VENDOR */ diff --git a/lib/clang/include/llvm/Config/llvm-config.h b/lib/clang/include/llvm/Config/llvm-config.h index fb878ccdde4d..5ac5d07a3539 100644 --- a/lib/clang/include/llvm/Config/llvm-config.h +++ b/lib/clang/include/llvm/Config/llvm-config.h @@ -180,10 +180,10 @@ #define LLVM_VERSION_MINOR 1 /* Patch version of the LLVM API */ -#define LLVM_VERSION_PATCH 4 +#define LLVM_VERSION_PATCH 5 /* LLVM version string */ -#define LLVM_VERSION_STRING "18.1.4" +#define LLVM_VERSION_STRING "18.1.5" /* Whether LLVM records statistics for use with GetStatistics(), * PrintStatistics() or PrintStatisticsJSON() diff --git a/lib/clang/include/llvm/Support/VCSRevision.h b/lib/clang/include/llvm/Support/VCSRevision.h index e324de0f9fc6..433b2b53b8fe 100644 --- a/lib/clang/include/llvm/Support/VCSRevision.h +++ b/lib/clang/include/llvm/Support/VCSRevision.h @@ -1,2 +1,2 @@ -#define LLVM_REVISION "llvmorg-18.1.4-0-ge6c3289804a6" +#define LLVM_REVISION "llvmorg-18.1.5-0-g617a15a9eac9" #define LLVM_REPOSITORY "https://github.com/llvm/llvm-project.git" From nobody Tue May 7 17:06:41 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VYl754SqYz5JFRy; Tue, 07 May 2024 17:06:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VYl752x25z4bQV; Tue, 7 May 2024 17:06:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715101601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nS0yBgXrI/+1N7OvpirHxan0g+51Dk03ytJb2LfLWWo=; b=oaudVFyS7gx0npPvhx2SkEd5iksIrtFC8ZiLjOJDY9FexDMs1Uft4ycfzKpFM1BPBe7/bg zcEcM5q2mPPC7VheJmGS0CzoQMAfy3qirZyy7wTs5jLfjn4JOEVePIQFePsszZQTCNZGyX 27n9u31Syc6Sv+G9dMAfFBx0qf+J+17FjCEFew/5yNgBfemdn0xGYm+Hvlbi3miMFXRvQA 5Rp40Zk+/ho0SbcPFs61RKiBhN+HkLjr9GQ4HYGj2TgSRfdYG0VTLhB0pGsRGZKQ8YN3wx bkD4g7FE8DaWjTVNc66ywg58bn5RTNGeTCOFNJAPNBlTPo8q55QvpDte2tp6ug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715101601; a=rsa-sha256; cv=none; b=C/MYOVY9N4rajXt+wSix9/RftJQXz6ZRL0qEls8Rjs8MZPsL1j6XAt8YYurCWdwKAg9/X2 /Oq1zr7ymjp/TVSNk42dmYR4VnWSlmjrUEyTE8ccLnZV3VoOlDqDihBbClB/uW6/mOgqHx f8QBcTtgMm7gyKK6sccufjB60JSfmtdEHg1b0Z+fYvQ8M48sNj34yPvldLSMMNH98Mghlf /02rSuWdwy/mEy2usSyhXtrgmPIPg3VagJkiDXCpzOdm9jeQsmDY0JQl4rc/ErTe3bfR8l AwkJSSiaSlkja+mPFWwMyCg7TxiRH1Czfc1iUHlSgLMyEAizU2joIZI/7vwsWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715101601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nS0yBgXrI/+1N7OvpirHxan0g+51Dk03ytJb2LfLWWo=; b=ikCWNS7ARXn8hBs6TbMT52dP2RF77AHB2MyZhuJhcxD8DxUb8CSSaVdInq3epZzNd4VEAp NQeZiRgJuniW0MoNOtVeq84qLnbFdhr0REUuosEMnW/W0Dqg05h/5by1s/XK32xz1O5BES YBYuRkfwrPSzwG4dxieDNUUx04EJuAX+ccqxYtJOQZ+76CbasCx07qam6TKSJjUhPBg+GT /Q9hhaYF0w9o7JsmYNRjkeQycYhCC4MQq3xQUXljDPTGcGerVY3XcdWLXBgGmXUF3yu5Yw dFtOxhvLhPmEl2zDLsOmrsHhxqesC3wfyBn0UFnPONw67a3mLO//9s1u2MroQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VYl752W1mzptM; Tue, 7 May 2024 17:06:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 447H6fGF052025; Tue, 7 May 2024 17:06:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 447H6faH052022; Tue, 7 May 2024 17:06:41 GMT (envelope-from git) Date: Tue, 7 May 2024 17:06:41 GMT Message-Id: <202405071706.447H6faH052022@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: e5e6242f62a3 - stable/13 - lib/clang: clean out old llvm/clang Sparc target remnants List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e5e6242f62a37e9e20e9cbf0dc61eef0b9cc8602 Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=e5e6242f62a37e9e20e9cbf0dc61eef0b9cc8602 commit e5e6242f62a37e9e20e9cbf0dc61eef0b9cc8602 Author: Dimitry Andric AuthorDate: 2024-05-04 17:34:10 +0000 Commit: Dimitry Andric CommitDate: 2024-05-07 17:04:30 +0000 lib/clang: clean out old llvm/clang Sparc target remnants The WITH_LLVM_TARGET_ENABLE_SPARC option was removed a long time ago, but some ifdefs were still laying around, so clean them up. PR: 276104 MFC after: 3 days (cherry picked from commit 6f444019009a55aac18d18054d154155fbf606c9) --- lib/clang/include/llvm/Config/AsmParsers.def | 3 --- lib/clang/include/llvm/Config/AsmPrinters.def | 3 --- lib/clang/include/llvm/Config/Disassemblers.def | 3 --- lib/clang/include/llvm/Config/Targets.def | 3 --- lib/clang/include/llvm/Config/llvm-config.h | 4 ---- 5 files changed, 16 deletions(-) diff --git a/lib/clang/include/llvm/Config/AsmParsers.def b/lib/clang/include/llvm/Config/AsmParsers.def index afd86d898673..3dccab75a285 100644 --- a/lib/clang/include/llvm/Config/AsmParsers.def +++ b/lib/clang/include/llvm/Config/AsmParsers.def @@ -42,9 +42,6 @@ LLVM_ASM_PARSER(PowerPC) #ifdef LLVM_TARGET_ENABLE_RISCV LLVM_ASM_PARSER(RISCV) #endif -#ifdef LLVM_TARGET_ENABLE_SPARC -LLVM_ASM_PARSER(Sparc) -#endif #ifdef LLVM_TARGET_ENABLE_X86 LLVM_ASM_PARSER(X86) #endif diff --git a/lib/clang/include/llvm/Config/AsmPrinters.def b/lib/clang/include/llvm/Config/AsmPrinters.def index ffcca0730101..649b8353c926 100644 --- a/lib/clang/include/llvm/Config/AsmPrinters.def +++ b/lib/clang/include/llvm/Config/AsmPrinters.def @@ -42,9 +42,6 @@ LLVM_ASM_PRINTER(PowerPC) #ifdef LLVM_TARGET_ENABLE_RISCV LLVM_ASM_PRINTER(RISCV) #endif -#ifdef LLVM_TARGET_ENABLE_SPARC -LLVM_ASM_PRINTER(Sparc) -#endif #ifdef LLVM_TARGET_ENABLE_X86 LLVM_ASM_PRINTER(X86) #endif diff --git a/lib/clang/include/llvm/Config/Disassemblers.def b/lib/clang/include/llvm/Config/Disassemblers.def index 18e29e3a09ff..c44fa4e303e2 100644 --- a/lib/clang/include/llvm/Config/Disassemblers.def +++ b/lib/clang/include/llvm/Config/Disassemblers.def @@ -42,9 +42,6 @@ LLVM_DISASSEMBLER(PowerPC) #ifdef LLVM_TARGET_ENABLE_RISCV LLVM_DISASSEMBLER(RISCV) #endif -#ifdef LLVM_TARGET_ENABLE_SPARC -LLVM_DISASSEMBLER(Sparc) -#endif #ifdef LLVM_TARGET_ENABLE_X86 LLVM_DISASSEMBLER(X86) #endif diff --git a/lib/clang/include/llvm/Config/Targets.def b/lib/clang/include/llvm/Config/Targets.def index 604fd9337048..d3332a51a2cc 100644 --- a/lib/clang/include/llvm/Config/Targets.def +++ b/lib/clang/include/llvm/Config/Targets.def @@ -41,9 +41,6 @@ LLVM_TARGET(PowerPC) #ifdef LLVM_TARGET_ENABLE_RISCV LLVM_TARGET(RISCV) #endif -#ifdef LLVM_TARGET_ENABLE_SPARC -LLVM_TARGET(Sparc) -#endif #ifdef LLVM_TARGET_ENABLE_X86 LLVM_TARGET(X86) #endif diff --git a/lib/clang/include/llvm/Config/llvm-config.h b/lib/clang/include/llvm/Config/llvm-config.h index 5ac5d07a3539..049529efdd7f 100644 --- a/lib/clang/include/llvm/Config/llvm-config.h +++ b/lib/clang/include/llvm/Config/llvm-config.h @@ -130,11 +130,7 @@ #endif /* Define if the Sparc target is built in */ -#ifdef LLVM_TARGET_ENABLE_SPARC -#define LLVM_HAS_SPARC_TARGET 1 -#else #define LLVM_HAS_SPARC_TARGET 0 -#endif /* Define if the SPIRV target is built in */ #define LLVM_HAS_SPIRV_TARGET 0 From nobody Tue May 7 17:30:58 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VYlg63kXXz5JHp3; Tue, 07 May 2024 17:30:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VYlg63S2cz4gN3; Tue, 7 May 2024 17:30:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715103058; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AY1F7vJVbzuCHz5+slXgJzbwRppwQDJ7geXDXzkgLjk=; b=hBQ9/Z9US0Zc8MjWVHA8rSKfa37DsN5m6fQ0xYcCMoo46YTMHkzpVizMT2jTbqh2C1FU2u FWVxvK7sPTt3Dsw0PHtfFhC8k0vyXOeW+jU5b9CHpalx1xubmZ93iwykWwYh0nCs17pPxZ Bz//ORG7FfIvQHrXB52OTKD+r6amcDXmGo5WuAoDHQ0ULl0FnNOTTcLGrNZpTREsNMGLoY yV9YfZIg11Xd9VAlj0EsomfiXHh9xjibTguwlROelwQ1Gu33h/ug7zFdF5tz5JTpVXxeOA BYv7ZzIV3vRgk7t9OH+kkabQv1BzNzT3w7vMb8MXkJZPWaBJ7E4CQkMWXYJHhA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715103058; a=rsa-sha256; cv=none; b=q4boNPGzJZmqoxeRgpinkwnLUFlcu99+gH0xk1PQ2Sxy0isZoYtf/ubogmfgQjt8munMpF HBJ7kzGGk3eWPwLL9KEH7tln+aPM3uzBiKl4FmUbP0ueYIkO8LPC/r4nROAN+zbp1NcYSd wj1SehbhFO50WuEK8jFElM3j/kL+lrhwTwITUsFJkddAXUoaRzqgEZjmnikGC2kz597Tj7 fgZhEFpiUrgKgk2p+1dWEQGILW1Chxz6D0ueOz68dfsoSfrXZx+vFiSoXJqPklYo304wak DZKciBQ9NIk8lgfO6oMvgb0CHcRq+//5cFuSvu30KaKiiGmgSJNhyUL9G3rQ9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715103058; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AY1F7vJVbzuCHz5+slXgJzbwRppwQDJ7geXDXzkgLjk=; b=A+vwHb81mGPGDPyWKLbAvbO7Wa+w4GUkN1Ut7L/M1L0zgrT6zpSxaZjJWB/hpl81i9W1/X W1Fs21Qq9Jszf6bMt7H9YXNy1Aau1GZ4Dd9Fq/T5halhg68SiJhLQMnYjcONEMaf4H9ABz /NG6ZIbfSJl73he1uh36ofiKcxDfX7dH1ofw3P/fqTnUgMJO1BliVMh/i9ytSxZrHfBSNW U9KVNM561WuW7+vZoOoPJWwc7nSaGWmCJLp8oQ+l+0ZIOmgTGxJr1PLYY66xOsWTGsThG7 +ywQR02/hP3EPhxenxCcGnJHakAB1MkRLw8DoSephVzIppe48hz10ADLaUm1zA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VYlg632ybzqfF; Tue, 7 May 2024 17:30:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 447HUwNT095388; Tue, 7 May 2024 17:30:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 447HUwQu095385; Tue, 7 May 2024 17:30:58 GMT (envelope-from git) Date: Tue, 7 May 2024 17:30:58 GMT Message-Id: <202405071730.447HUwQu095385@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 90a5e985e5f4 - releng/14.1 - Merge llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 90a5e985e5f467ba145493160458186edd3540b2 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=90a5e985e5f467ba145493160458186edd3540b2 commit 90a5e985e5f467ba145493160458186edd3540b2 Author: Dimitry Andric AuthorDate: 2024-05-04 10:19:32 +0000 Commit: Dimitry Andric CommitDate: 2024-05-07 17:28:36 +0000 Merge llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9 This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9. PR: 276104 Approved by: re (cperciva) MFC after: 3 days (cherry picked from commit 5678d1d98a348f315453555377ccb28821a2ffcd) (cherry picked from commit fe72d8ecb98dd51a9faf62b1e14d4dde25d61e5b) --- .../llvm-project/clang/lib/CodeGen/CGBuiltin.cpp | 25 ++++++----- contrib/llvm-project/clang/lib/CodeGen/CGCall.cpp | 5 +++ .../llvm-project/clang/lib/CodeGen/CGObjCGNU.cpp | 34 ++++++++------- .../llvm-project/clang/lib/CodeGen/CodeGenModule.h | 3 ++ .../clang/lib/CodeGen/CoverageMappingGen.cpp | 11 +++-- .../clang/lib/CodeGen/MicrosoftCXXABI.cpp | 12 ++++-- .../clang/lib/Format/ContinuationIndenter.cpp | 8 +++- .../clang/lib/Format/TokenAnnotator.cpp | 10 ++--- .../clang/lib/Format/UnwrappedLineParser.cpp | 40 ++++++++++-------- .../clang/lib/StaticAnalyzer/Checkers/Taint.cpp | 14 +++---- .../Checkers/cert/InvalidPtrChecker.cpp | 6 ++- .../libcxx/modules/std.compat/cstdlib.inc | 2 +- .../include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h | 20 +++++++-- .../llvm/lib/CodeGen/CodeGenPrepare.cpp | 2 + .../llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | 4 +- .../lib/CodeGen/GlobalISel/LegalizerHelper.cpp | 4 ++ .../llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp | 48 +++++++++++++--------- .../llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 9 +++- .../llvm/lib/Target/AArch64/AArch64InstrInfo.td | 10 ----- .../llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp | 10 ++--- .../llvm/lib/Target/RISCV/RISCVISelLowering.cpp | 2 +- .../llvm/lib/Target/X86/X86ISelDAGToDAG.cpp | 7 ++-- .../llvm/lib/Target/X86/X86ISelLowering.cpp | 29 +++++++------ .../llvm/lib/Target/X86/X86Subtarget.h | 3 +- .../llvm-project/llvm/lib/TargetParser/Host.cpp | 5 ++- .../Transforms/InstCombine/InstCombineSelect.cpp | 2 +- .../Scalar/InductiveRangeCheckElimination.cpp | 3 ++ 27 files changed, 200 insertions(+), 128 deletions(-) diff --git a/contrib/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp b/contrib/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp index a4f26a6f0eb1..44ddd2428b10 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp @@ -823,29 +823,32 @@ const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberField( ASTContext &Ctx, const RecordDecl *RD, StringRef Name, uint64_t &Offset) { const LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel = getLangOpts().getStrictFlexArraysLevel(); - unsigned FieldNo = 0; - bool IsUnion = RD->isUnion(); + uint32_t FieldNo = 0; - for (const Decl *D : RD->decls()) { - if (const auto *Field = dyn_cast(D); - Field && (Name.empty() || Field->getNameAsString() == Name) && + if (RD->isImplicit()) + return nullptr; + + for (const FieldDecl *FD : RD->fields()) { + if ((Name.empty() || FD->getNameAsString() == Name) && Decl::isFlexibleArrayMemberLike( - Ctx, Field, Field->getType(), StrictFlexArraysLevel, + Ctx, FD, FD->getType(), StrictFlexArraysLevel, /*IgnoreTemplateOrMacroSubstitution=*/true)) { const ASTRecordLayout &Layout = Ctx.getASTRecordLayout(RD); Offset += Layout.getFieldOffset(FieldNo); - return Field; + return FD; } - if (const auto *Record = dyn_cast(D)) - if (const FieldDecl *Field = - FindFlexibleArrayMemberField(Ctx, Record, Name, Offset)) { + QualType Ty = FD->getType(); + if (Ty->isRecordType()) { + if (const FieldDecl *Field = FindFlexibleArrayMemberField( + Ctx, Ty->getAsRecordDecl(), Name, Offset)) { const ASTRecordLayout &Layout = Ctx.getASTRecordLayout(RD); Offset += Layout.getFieldOffset(FieldNo); return Field; } + } - if (!IsUnion && isa(D)) + if (!RD->isUnion()) ++FieldNo; } diff --git a/contrib/llvm-project/clang/lib/CodeGen/CGCall.cpp b/contrib/llvm-project/clang/lib/CodeGen/CGCall.cpp index 28c211aa631e..a6a2f3595fe7 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/CGCall.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/CGCall.cpp @@ -1581,6 +1581,11 @@ bool CodeGenModule::ReturnTypeUsesSRet(const CGFunctionInfo &FI) { return RI.isIndirect() || (RI.isInAlloca() && RI.getInAllocaSRet()); } +bool CodeGenModule::ReturnTypeHasInReg(const CGFunctionInfo &FI) { + const auto &RI = FI.getReturnInfo(); + return RI.getInReg(); +} + bool CodeGenModule::ReturnSlotInterferesWithArgs(const CGFunctionInfo &FI) { return ReturnTypeUsesSRet(FI) && getTargetCodeGenInfo().doesReturnSlotInterfereWithArgs(); diff --git a/contrib/llvm-project/clang/lib/CodeGen/CGObjCGNU.cpp b/contrib/llvm-project/clang/lib/CodeGen/CGObjCGNU.cpp index a36b0cdddaf0..05e3f8d4bfc2 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/CGObjCGNU.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/CGObjCGNU.cpp @@ -2903,23 +2903,29 @@ CGObjCGNU::GenerateMessageSend(CodeGenFunction &CGF, break; case CodeGenOptions::Mixed: case CodeGenOptions::NonLegacy: + StringRef name = "objc_msgSend"; if (CGM.ReturnTypeUsesFPRet(ResultType)) { - imp = - CGM.CreateRuntimeFunction(llvm::FunctionType::get(IdTy, IdTy, true), - "objc_msgSend_fpret") - .getCallee(); + name = "objc_msgSend_fpret"; } else if (CGM.ReturnTypeUsesSRet(MSI.CallInfo)) { - // The actual types here don't matter - we're going to bitcast the - // function anyway - imp = - CGM.CreateRuntimeFunction(llvm::FunctionType::get(IdTy, IdTy, true), - "objc_msgSend_stret") - .getCallee(); - } else { - imp = CGM.CreateRuntimeFunction( - llvm::FunctionType::get(IdTy, IdTy, true), "objc_msgSend") - .getCallee(); + name = "objc_msgSend_stret"; + + // The address of the memory block is be passed in x8 for POD type, + // or in x0 for non-POD type (marked as inreg). + bool shouldCheckForInReg = + CGM.getContext() + .getTargetInfo() + .getTriple() + .isWindowsMSVCEnvironment() && + CGM.getContext().getTargetInfo().getTriple().isAArch64(); + if (shouldCheckForInReg && CGM.ReturnTypeHasInReg(MSI.CallInfo)) { + name = "objc_msgSend_stret2"; + } } + // The actual types here don't matter - we're going to bitcast the + // function anyway + imp = CGM.CreateRuntimeFunction(llvm::FunctionType::get(IdTy, IdTy, true), + name) + .getCallee(); } // Reset the receiver in case the lookup modified it diff --git a/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.h b/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.h index ec34680fd3f7..d9ece4d98eec 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.h +++ b/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.h @@ -1239,6 +1239,9 @@ public: /// Return true iff the given type uses 'sret' when used as a return type. bool ReturnTypeUsesSRet(const CGFunctionInfo &FI); + /// Return true iff the given type has `inreg` set. + bool ReturnTypeHasInReg(const CGFunctionInfo &FI); + /// Return true iff the given type uses an argument slot when 'sret' is used /// as a return type. bool ReturnSlotInterferesWithArgs(const CGFunctionInfo &FI); diff --git a/contrib/llvm-project/clang/lib/CodeGen/CoverageMappingGen.cpp b/contrib/llvm-project/clang/lib/CodeGen/CoverageMappingGen.cpp index 0c43317642bc..ae4e6d4c88c0 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/CoverageMappingGen.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/CoverageMappingGen.cpp @@ -1207,6 +1207,12 @@ struct CounterCoverageMappingBuilder /// Find a valid gap range between \p AfterLoc and \p BeforeLoc. std::optional findGapAreaBetween(SourceLocation AfterLoc, SourceLocation BeforeLoc) { + // Some statements (like AttributedStmt and ImplicitValueInitExpr) don't + // have valid source locations. Do not emit a gap region if this is the case + // in either AfterLoc end or BeforeLoc end. + if (AfterLoc.isInvalid() || BeforeLoc.isInvalid()) + return std::nullopt; + // If AfterLoc is in function-like macro, use the right parenthesis // location. if (AfterLoc.isMacroID()) { @@ -1370,9 +1376,8 @@ struct CounterCoverageMappingBuilder for (const Stmt *Child : S->children()) if (Child) { // If last statement contains terminate statements, add a gap area - // between the two statements. Skipping attributed statements, because - // they don't have valid start location. - if (LastStmt && HasTerminateStmt && !isa(Child)) { + // between the two statements. + if (LastStmt && HasTerminateStmt) { auto Gap = findGapAreaBetween(getEnd(LastStmt), getStart(Child)); if (Gap) fillGapAreaWithCount(Gap->getBegin(), Gap->getEnd(), diff --git a/contrib/llvm-project/clang/lib/CodeGen/MicrosoftCXXABI.cpp b/contrib/llvm-project/clang/lib/CodeGen/MicrosoftCXXABI.cpp index 172c4c937b97..4d0f4c63f843 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/MicrosoftCXXABI.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/MicrosoftCXXABI.cpp @@ -1135,9 +1135,15 @@ static bool isTrivialForMSVC(const CXXRecordDecl *RD, QualType Ty, return false; if (RD->hasNonTrivialCopyAssignment()) return false; - for (const CXXConstructorDecl *Ctor : RD->ctors()) - if (Ctor->isUserProvided()) - return false; + for (const Decl *D : RD->decls()) { + if (auto *Ctor = dyn_cast(D)) { + if (Ctor->isUserProvided()) + return false; + } else if (auto *Template = dyn_cast(D)) { + if (isa(Template->getTemplatedDecl())) + return false; + } + } if (RD->hasNonTrivialDestructor()) return false; return true; diff --git a/contrib/llvm-project/clang/lib/Format/ContinuationIndenter.cpp b/contrib/llvm-project/clang/lib/Format/ContinuationIndenter.cpp index a3eb9138b218..53cd169b0590 100644 --- a/contrib/llvm-project/clang/lib/Format/ContinuationIndenter.cpp +++ b/contrib/llvm-project/clang/lib/Format/ContinuationIndenter.cpp @@ -674,7 +674,13 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun, // arguments to function calls. We do this by ensuring that either all // arguments (including any lambdas) go on the same line as the function // call, or we break before the first argument. - auto PrevNonComment = Current.getPreviousNonComment(); + const auto *Prev = Current.Previous; + if (!Prev) + return false; + // For example, `/*Newline=*/false`. + if (Prev->is(TT_BlockComment) && Current.SpacesRequiredBefore == 0) + return false; + const auto *PrevNonComment = Current.getPreviousNonComment(); if (!PrevNonComment || PrevNonComment->isNot(tok::l_paren)) return false; if (Current.isOneOf(tok::comment, tok::l_paren, TT_LambdaLSquare)) diff --git a/contrib/llvm-project/clang/lib/Format/TokenAnnotator.cpp b/contrib/llvm-project/clang/lib/Format/TokenAnnotator.cpp index 4d482e6543d6..c1f166248192 100644 --- a/contrib/llvm-project/clang/lib/Format/TokenAnnotator.cpp +++ b/contrib/llvm-project/clang/lib/Format/TokenAnnotator.cpp @@ -3532,6 +3532,8 @@ void TokenAnnotator::calculateFormattingInformation(AnnotatedLine &Line) const { } } else if (ClosingParen) { for (auto *Tok = ClosingParen->Next; Tok; Tok = Tok->Next) { + if (Tok->is(TT_CtorInitializerColon)) + break; if (Tok->is(tok::arrow)) { Tok->setType(TT_TrailingReturnArrow); break; @@ -5157,12 +5159,8 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine &Line, return true; if (Left.IsUnterminatedLiteral) return true; - // FIXME: Breaking after newlines seems useful in general. Turn this into an - // option and recognize more cases like endl etc, and break independent of - // what comes after operator lessless. - if (Right.is(tok::lessless) && Right.Next && - Right.Next->is(tok::string_literal) && Left.is(tok::string_literal) && - Left.TokenText.ends_with("\\n\"")) { + if (Right.is(tok::lessless) && Right.Next && Left.is(tok::string_literal) && + Right.Next->is(tok::string_literal)) { return true; } if (Right.is(TT_RequiresClause)) { diff --git a/contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.cpp b/contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.cpp index 573919798870..a6eb18bb2b32 100644 --- a/contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.cpp +++ b/contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.cpp @@ -489,18 +489,23 @@ void UnwrappedLineParser::calculateBraceTypes(bool ExpectClassBody) { }; SmallVector LBraceStack; assert(Tok->is(tok::l_brace)); + do { - // Get next non-comment, non-preprocessor token. FormatToken *NextTok; do { NextTok = Tokens->getNextToken(); } while (NextTok->is(tok::comment)); - while (NextTok->is(tok::hash) && !Line->InMacroBody) { - NextTok = Tokens->getNextToken(); - do { - NextTok = Tokens->getNextToken(); - } while (NextTok->is(tok::comment) || - (NextTok->NewlinesBefore == 0 && NextTok->isNot(tok::eof))); + + if (!Line->InMacroBody) { + // Skip PPDirective lines and comments. + while (NextTok->is(tok::hash)) { + do { + NextTok = Tokens->getNextToken(); + } while (NextTok->NewlinesBefore == 0 && NextTok->isNot(tok::eof)); + + while (NextTok->is(tok::comment)) + NextTok = Tokens->getNextToken(); + } } switch (Tok->Tok.getKind()) { @@ -534,16 +539,6 @@ void UnwrappedLineParser::calculateBraceTypes(bool ExpectClassBody) { if (Style.Language == FormatStyle::LK_Proto) { ProbablyBracedList = NextTok->isOneOf(tok::comma, tok::r_square); } else { - // Skip NextTok over preprocessor lines, otherwise we may not - // properly diagnose the block as a braced intializer - // if the comma separator appears after the pp directive. - while (NextTok->is(tok::hash)) { - ScopedMacroState MacroState(*Line, Tokens, NextTok); - do { - NextTok = Tokens->getNextToken(); - } while (NextTok->isNot(tok::eof)); - } - // Using OriginalColumn to distinguish between ObjC methods and // binary operators is a bit hacky. bool NextIsObjCMethod = NextTok->isOneOf(tok::plus, tok::minus) && @@ -602,6 +597,16 @@ void UnwrappedLineParser::calculateBraceTypes(bool ExpectClassBody) { NextTok = Tokens->getNextToken(); ProbablyBracedList = NextTok->isNot(tok::l_square); } + + // Cpp macro definition body that is a nonempty braced list or block: + if (Style.isCpp() && Line->InMacroBody && PrevTok != FormatTok && + !FormatTok->Previous && NextTok->is(tok::eof) && + // A statement can end with only `;` (simple statement), a block + // closing brace (compound statement), or `:` (label statement). + // If PrevTok is a block opening brace, Tok ends an empty block. + !PrevTok->isOneOf(tok::semi, BK_Block, tok::colon)) { + ProbablyBracedList = true; + } } if (ProbablyBracedList) { Tok->setBlockKind(BK_BracedInit); @@ -631,6 +636,7 @@ void UnwrappedLineParser::calculateBraceTypes(bool ExpectClassBody) { default: break; } + PrevTok = Tok; Tok = NextTok; } while (Tok->isNot(tok::eof) && !LBraceStack.empty()); diff --git a/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/Taint.cpp b/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/Taint.cpp index 4edb671753bf..6362c82b009d 100644 --- a/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/Taint.cpp +++ b/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/Taint.cpp @@ -216,21 +216,17 @@ std::vector taint::getTaintedSymbolsImpl(ProgramStateRef State, std::vector TaintedSymbols; if (!Reg) return TaintedSymbols; - // Element region (array element) is tainted if either the base or the offset - // are tainted. + + // Element region (array element) is tainted if the offset is tainted. if (const ElementRegion *ER = dyn_cast(Reg)) { std::vector TaintedIndex = getTaintedSymbolsImpl(State, ER->getIndex(), K, returnFirstOnly); llvm::append_range(TaintedSymbols, TaintedIndex); if (returnFirstOnly && !TaintedSymbols.empty()) return TaintedSymbols; // return early if needed - std::vector TaintedSuperRegion = - getTaintedSymbolsImpl(State, ER->getSuperRegion(), K, returnFirstOnly); - llvm::append_range(TaintedSymbols, TaintedSuperRegion); - if (returnFirstOnly && !TaintedSymbols.empty()) - return TaintedSymbols; // return early if needed } + // Symbolic region is tainted if the corresponding symbol is tainted. if (const SymbolicRegion *SR = dyn_cast(Reg)) { std::vector TaintedRegions = getTaintedSymbolsImpl(State, SR->getSymbol(), K, returnFirstOnly); @@ -239,6 +235,8 @@ std::vector taint::getTaintedSymbolsImpl(ProgramStateRef State, return TaintedSymbols; // return early if needed } + // Any subregion (including Element and Symbolic regions) is tainted if its + // super-region is tainted. if (const SubRegion *ER = dyn_cast(Reg)) { std::vector TaintedSubRegions = getTaintedSymbolsImpl(State, ER->getSuperRegion(), K, returnFirstOnly); @@ -318,4 +316,4 @@ std::vector taint::getTaintedSymbolsImpl(ProgramStateRef State, } } return TaintedSymbols; -} \ No newline at end of file +} diff --git a/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/cert/InvalidPtrChecker.cpp b/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/cert/InvalidPtrChecker.cpp index e5dd907c660d..b2947f590c4e 100644 --- a/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/cert/InvalidPtrChecker.cpp +++ b/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/cert/InvalidPtrChecker.cpp @@ -205,8 +205,12 @@ void InvalidPtrChecker::postPreviousReturnInvalidatingCall( CE, LCtx, CE->getType(), C.blockCount()); State = State->BindExpr(CE, LCtx, RetVal); + const auto *SymRegOfRetVal = + dyn_cast_or_null(RetVal.getAsRegion()); + if (!SymRegOfRetVal) + return; + // Remember to this region. - const auto *SymRegOfRetVal = cast(RetVal.getAsRegion()); const MemRegion *MR = SymRegOfRetVal->getBaseRegion(); State = State->set(FD, MR); diff --git a/contrib/llvm-project/libcxx/modules/std.compat/cstdlib.inc b/contrib/llvm-project/libcxx/modules/std.compat/cstdlib.inc index a45a0a1caf8b..4783cbf51623 100644 --- a/contrib/llvm-project/libcxx/modules/std.compat/cstdlib.inc +++ b/contrib/llvm-project/libcxx/modules/std.compat/cstdlib.inc @@ -25,7 +25,7 @@ export { using ::system; // [c.malloc], C library memory allocation - using ::aligned_alloc; + using ::aligned_alloc _LIBCPP_USING_IF_EXISTS; using ::calloc; using ::free; using ::malloc; diff --git a/contrib/llvm-project/llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h b/contrib/llvm-project/llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h index 0f20a33f3a75..7990997835d0 100644 --- a/contrib/llvm-project/llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h +++ b/contrib/llvm-project/llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h @@ -35,11 +35,23 @@ struct LegalityQuery; class MachineRegisterInfo; namespace GISelAddressing { /// Helper struct to store a base, index and offset that forms an address -struct BaseIndexOffset { +class BaseIndexOffset { +private: Register BaseReg; Register IndexReg; - int64_t Offset = 0; - bool IsIndexSignExt = false; + std::optional Offset; + +public: + BaseIndexOffset() = default; + Register getBase() { return BaseReg; } + Register getBase() const { return BaseReg; } + Register getIndex() { return IndexReg; } + Register getIndex() const { return IndexReg; } + void setBase(Register NewBase) { BaseReg = NewBase; } + void setIndex(Register NewIndex) { IndexReg = NewIndex; } + void setOffset(std::optional NewOff) { Offset = NewOff; } + bool hasValidOffset() const { return Offset.has_value(); } + int64_t getOffset() const { return *Offset; } }; /// Returns a BaseIndexOffset which describes the pointer in \p Ptr. @@ -89,7 +101,7 @@ private: // order stores are writing to incremeneting consecutive addresses. So when // we walk the block in reverse order, the next eligible store must write to // an offset one store width lower than CurrentLowestOffset. - uint64_t CurrentLowestOffset; + int64_t CurrentLowestOffset; SmallVector Stores; // A vector of MachineInstr/unsigned pairs to denote potential aliases that // need to be checked before the candidate is considered safe to merge. The diff --git a/contrib/llvm-project/llvm/lib/CodeGen/CodeGenPrepare.cpp b/contrib/llvm-project/llvm/lib/CodeGen/CodeGenPrepare.cpp index 8ee1f19e083e..1cca56fc19cf 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -8154,6 +8154,7 @@ static bool optimizeBranch(BranchInst *Branch, const TargetLowering &TLI, IRBuilder<> Builder(Branch); if (UI->getParent() != Branch->getParent()) UI->moveBefore(Branch); + UI->dropPoisonGeneratingFlags(); Value *NewCmp = Builder.CreateCmp(ICmpInst::ICMP_EQ, UI, ConstantInt::get(UI->getType(), 0)); LLVM_DEBUG(dbgs() << "Converting " << *Cmp << "\n"); @@ -8167,6 +8168,7 @@ static bool optimizeBranch(BranchInst *Branch, const TargetLowering &TLI, IRBuilder<> Builder(Branch); if (UI->getParent() != Branch->getParent()) UI->moveBefore(Branch); + UI->dropPoisonGeneratingFlags(); Value *NewCmp = Builder.CreateCmp(Cmp->getPredicate(), UI, ConstantInt::get(UI->getType(), 0)); LLVM_DEBUG(dbgs() << "Converting " << *Cmp << "\n"); diff --git a/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp b/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp index 772229215e79..61ddc858ba44 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp @@ -591,8 +591,8 @@ bool CombinerHelper::matchCombineExtendingLoads(MachineInstr &MI, UseMI.getOpcode() == TargetOpcode::G_ZEXT || (UseMI.getOpcode() == TargetOpcode::G_ANYEXT)) { const auto &MMO = LoadMI->getMMO(); - // For atomics, only form anyextending loads. - if (MMO.isAtomic() && UseMI.getOpcode() != TargetOpcode::G_ANYEXT) + // Don't do anything for atomics. + if (MMO.isAtomic()) continue; // Check for legality. if (!isPreLegalize()) { diff --git a/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp b/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp index c0c22e36004f..47d045ac4817 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp @@ -4180,6 +4180,10 @@ LegalizerHelper::fewerElementsVectorPhi(GenericMachineInstr &MI, } } + // Set the insert point after the existing PHIs + MachineBasicBlock &MBB = *MI.getParent(); + MIRBuilder.setInsertPt(MBB, MBB.getFirstNonPHI()); + // Merge small outputs into MI's def. if (NumLeftovers) { mergeMixedSubvectors(MI.getReg(0), OutputRegs); diff --git a/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp b/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp index 246aa88b09ac..ee499c41c558 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp @@ -84,21 +84,20 @@ BaseIndexOffset GISelAddressing::getPointerInfo(Register Ptr, MachineRegisterInfo &MRI) { BaseIndexOffset Info; Register PtrAddRHS; - if (!mi_match(Ptr, MRI, m_GPtrAdd(m_Reg(Info.BaseReg), m_Reg(PtrAddRHS)))) { - Info.BaseReg = Ptr; - Info.IndexReg = Register(); - Info.IsIndexSignExt = false; + Register BaseReg; + if (!mi_match(Ptr, MRI, m_GPtrAdd(m_Reg(BaseReg), m_Reg(PtrAddRHS)))) { + Info.setBase(Ptr); + Info.setOffset(0); return Info; } - + Info.setBase(BaseReg); auto RHSCst = getIConstantVRegValWithLookThrough(PtrAddRHS, MRI); if (RHSCst) - Info.Offset = RHSCst->Value.getSExtValue(); + Info.setOffset(RHSCst->Value.getSExtValue()); // Just recognize a simple case for now. In future we'll need to match // indexing patterns for base + index + constant. - Info.IndexReg = PtrAddRHS; - Info.IsIndexSignExt = false; + Info.setIndex(PtrAddRHS); return Info; } @@ -114,15 +113,16 @@ bool GISelAddressing::aliasIsKnownForLoadStore(const MachineInstr &MI1, BaseIndexOffset BasePtr0 = getPointerInfo(LdSt1->getPointerReg(), MRI); BaseIndexOffset BasePtr1 = getPointerInfo(LdSt2->getPointerReg(), MRI); - if (!BasePtr0.BaseReg.isValid() || !BasePtr1.BaseReg.isValid()) + if (!BasePtr0.getBase().isValid() || !BasePtr1.getBase().isValid()) return false; int64_t Size1 = LdSt1->getMemSize(); int64_t Size2 = LdSt2->getMemSize(); int64_t PtrDiff; - if (BasePtr0.BaseReg == BasePtr1.BaseReg) { - PtrDiff = BasePtr1.Offset - BasePtr0.Offset; + if (BasePtr0.getBase() == BasePtr1.getBase() && BasePtr0.hasValidOffset() && + BasePtr1.hasValidOffset()) { + PtrDiff = BasePtr1.getOffset() - BasePtr0.getOffset(); // If the size of memory access is unknown, do not use it to do analysis. // One example of unknown size memory access is to load/store scalable // vector objects on the stack. @@ -151,8 +151,8 @@ bool GISelAddressing::aliasIsKnownForLoadStore(const MachineInstr &MI1, // able to calculate their relative offset if at least one arises // from an alloca. However, these allocas cannot overlap and we // can infer there is no alias. - auto *Base0Def = getDefIgnoringCopies(BasePtr0.BaseReg, MRI); - auto *Base1Def = getDefIgnoringCopies(BasePtr1.BaseReg, MRI); + auto *Base0Def = getDefIgnoringCopies(BasePtr0.getBase(), MRI); + auto *Base1Def = getDefIgnoringCopies(BasePtr1.getBase(), MRI); if (!Base0Def || !Base1Def) return false; // Couldn't tell anything. @@ -520,16 +520,20 @@ bool LoadStoreOpt::addStoreToCandidate(GStore &StoreMI, Register StoreAddr = StoreMI.getPointerReg(); auto BIO = getPointerInfo(StoreAddr, *MRI); - Register StoreBase = BIO.BaseReg; - uint64_t StoreOffCst = BIO.Offset; + Register StoreBase = BIO.getBase(); if (C.Stores.empty()) { + C.BasePtr = StoreBase; + if (!BIO.hasValidOffset()) { + C.CurrentLowestOffset = 0; + } else { + C.CurrentLowestOffset = BIO.getOffset(); + } // This is the first store of the candidate. // If the offset can't possibly allow for a lower addressed store with the // same base, don't bother adding it. - if (StoreOffCst < ValueTy.getSizeInBytes()) + if (BIO.hasValidOffset() && + BIO.getOffset() < static_cast(ValueTy.getSizeInBytes())) return false; - C.BasePtr = StoreBase; - C.CurrentLowestOffset = StoreOffCst; C.Stores.emplace_back(&StoreMI); LLVM_DEBUG(dbgs() << "Starting a new merge candidate group with: " << StoreMI); @@ -549,8 +553,12 @@ bool LoadStoreOpt::addStoreToCandidate(GStore &StoreMI, // writes to the next lowest adjacent address. if (C.BasePtr != StoreBase) return false; - if ((C.CurrentLowestOffset - ValueTy.getSizeInBytes()) != - static_cast(StoreOffCst)) + // If we don't have a valid offset, we can't guarantee to be an adjacent + // offset. + if (!BIO.hasValidOffset()) + return false; + if ((C.CurrentLowestOffset - + static_cast(ValueTy.getSizeInBytes())) != BIO.getOffset()) return false; // This writes to an adjacent address. Allow it. diff --git a/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index e806e0f0731f..5038f8a1fc15 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -9636,8 +9636,15 @@ static SDValue combineShiftOfShiftedLogic(SDNode *Shift, SelectionDAG &DAG) { if (ShiftAmtVal->getBitWidth() != C1Val.getBitWidth()) return false; + // The fold is not valid if the sum of the shift values doesn't fit in the + // given shift amount type. + bool Overflow = false; + APInt NewShiftAmt = C1Val.uadd_ov(*ShiftAmtVal, Overflow); + if (Overflow) + return false; + // The fold is not valid if the sum of the shift values exceeds bitwidth. - if ((*ShiftAmtVal + C1Val).uge(V.getScalarValueSizeInBits())) + if (NewShiftAmt.uge(V.getScalarValueSizeInBits())) return false; return true; diff --git a/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64InstrInfo.td b/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64InstrInfo.td index 03baa7497615..ac61dd8745d4 100644 --- a/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64InstrInfo.td +++ b/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64InstrInfo.td @@ -4885,19 +4885,9 @@ defm UABDL : SIMDLongThreeVectorBHSabdl<1, 0b0111, "uabdl", def : Pat<(abs (v8i16 (sub (zext (v8i8 V64:$opA)), (zext (v8i8 V64:$opB))))), (UABDLv8i8_v8i16 V64:$opA, V64:$opB)>; -def : Pat<(xor (v8i16 (AArch64vashr v8i16:$src, (i32 15))), - (v8i16 (add (sub (zext (v8i8 V64:$opA)), - (zext (v8i8 V64:$opB))), - (AArch64vashr v8i16:$src, (i32 15))))), - (UABDLv8i8_v8i16 V64:$opA, V64:$opB)>; def : Pat<(abs (v8i16 (sub (zext (extract_high_v16i8 (v16i8 V128:$opA))), (zext (extract_high_v16i8 (v16i8 V128:$opB)))))), (UABDLv16i8_v8i16 V128:$opA, V128:$opB)>; -def : Pat<(xor (v8i16 (AArch64vashr v8i16:$src, (i32 15))), - (v8i16 (add (sub (zext (extract_high_v16i8 (v16i8 V128:$opA))), - (zext (extract_high_v16i8 (v16i8 V128:$opB)))), - (AArch64vashr v8i16:$src, (i32 15))))), - (UABDLv16i8_v8i16 V128:$opA, V128:$opB)>; def : Pat<(abs (v4i32 (sub (zext (v4i16 V64:$opA)), (zext (v4i16 V64:$opB))))), (UABDLv4i16_v4i32 V64:$opA, V64:$opB)>; diff --git a/contrib/llvm-project/llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp b/contrib/llvm-project/llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp index 84b9330ef963..50d8bfa87508 100644 --- a/contrib/llvm-project/llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp +++ b/contrib/llvm-project/llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp @@ -2358,6 +2358,11 @@ bool SIGfx12CacheControl::enableVolatileAndOrNonTemporal( bool Changed = false; + if (IsNonTemporal) { + // Set non-temporal hint for all cache levels. + Changed |= setTH(MI, AMDGPU::CPol::TH_NT); + } + if (IsVolatile) { Changed |= setScope(MI, AMDGPU::CPol::SCOPE_SYS); @@ -2370,11 +2375,6 @@ bool SIGfx12CacheControl::enableVolatileAndOrNonTemporal( Position::AFTER); } - if (IsNonTemporal) { - // Set non-temporal hint for all cache levels. - Changed |= setTH(MI, AMDGPU::CPol::TH_NT); - } - return Changed; } diff --git a/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVISelLowering.cpp index a0cec426002b..d46093b9e260 100644 --- a/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVISelLowering.cpp +++ b/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVISelLowering.cpp @@ -14559,7 +14559,7 @@ static SDValue tryFoldSelectIntoOp(SDNode *N, SelectionDAG &DAG, EVT VT = N->getValueType(0); SDLoc DL(N); SDValue OtherOp = TrueVal.getOperand(1 - OpToFold); - EVT OtherOpVT = OtherOp->getValueType(0); + EVT OtherOpVT = OtherOp.getValueType(); SDValue IdentityOperand = DAG.getNeutralElement(Opc, DL, OtherOpVT, N->getFlags()); if (!Commutative) diff --git a/contrib/llvm-project/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp b/contrib/llvm-project/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp index 833f058253d8..553d338b7790 100644 --- a/contrib/llvm-project/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp +++ b/contrib/llvm-project/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp @@ -2923,11 +2923,10 @@ bool X86DAGToDAGISel::selectAddr(SDNode *Parent, SDValue N, SDValue &Base, } bool X86DAGToDAGISel::selectMOV64Imm32(SDValue N, SDValue &Imm) { - // Cannot use 32 bit constants to reference objects in kernel code model. - // Cannot use 32 bit constants to reference objects in large PIC mode since - // GOTOFF is 64 bits. + // Cannot use 32 bit constants to reference objects in kernel/large code + // model. if (TM.getCodeModel() == CodeModel::Kernel || - (TM.getCodeModel() == CodeModel::Large && TM.isPositionIndependent())) + TM.getCodeModel() == CodeModel::Large) return false; // In static codegen with small code model, we can get the address of a label diff --git a/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp b/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp index 96bbd981ff24..201dd8382536 100644 --- a/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -47038,10 +47038,13 @@ static SDValue combineShiftRightArithmetic(SDNode *N, SelectionDAG &DAG, if (SDValue V = combineShiftToPMULH(N, DAG, Subtarget)) return V; - // fold (ashr (shl, a, [56,48,32,24,16]), SarConst) - // into (shl, (sext (a), [56,48,32,24,16] - SarConst)) or - // into (lshr, (sext (a), SarConst - [56,48,32,24,16])) - // depending on sign of (SarConst - [56,48,32,24,16]) + // fold (SRA (SHL X, ShlConst), SraConst) + // into (SHL (sext_in_reg X), ShlConst - SraConst) + // or (sext_in_reg X) + // or (SRA (sext_in_reg X), SraConst - ShlConst) + // depending on relation between SraConst and ShlConst. + // We only do this if (Size - ShlConst) is equal to 8, 16 or 32. That allows + // us to do the sext_in_reg from corresponding bit. // sexts in X86 are MOVs. The MOVs have the same code size // as above SHIFTs (only SHIFT on 1 has lower code size). @@ -47057,29 +47060,29 @@ static SDValue combineShiftRightArithmetic(SDNode *N, SelectionDAG &DAG, SDValue N00 = N0.getOperand(0); SDValue N01 = N0.getOperand(1); APInt ShlConst = N01->getAsAPIntVal(); - APInt SarConst = N1->getAsAPIntVal(); + APInt SraConst = N1->getAsAPIntVal(); EVT CVT = N1.getValueType(); - if (SarConst.isNegative()) + if (CVT != N01.getValueType()) + return SDValue(); + if (SraConst.isNegative()) return SDValue(); for (MVT SVT : { MVT::i8, MVT::i16, MVT::i32 }) { unsigned ShiftSize = SVT.getSizeInBits(); - // skipping types without corresponding sext/zext and - // ShlConst that is not one of [56,48,32,24,16] + // Only deal with (Size - ShlConst) being equal to 8, 16 or 32. if (ShiftSize >= Size || ShlConst != Size - ShiftSize) continue; SDLoc DL(N); SDValue NN = DAG.getNode(ISD::SIGN_EXTEND_INREG, DL, VT, N00, DAG.getValueType(SVT)); - SarConst = SarConst - (Size - ShiftSize); - if (SarConst == 0) + if (SraConst.eq(ShlConst)) return NN; - if (SarConst.isNegative()) + if (SraConst.ult(ShlConst)) return DAG.getNode(ISD::SHL, DL, VT, NN, - DAG.getConstant(-SarConst, DL, CVT)); + DAG.getConstant(ShlConst - SraConst, DL, CVT)); return DAG.getNode(ISD::SRA, DL, VT, NN, - DAG.getConstant(SarConst, DL, CVT)); + DAG.getConstant(SraConst - ShlConst, DL, CVT)); } return SDValue(); } diff --git a/contrib/llvm-project/llvm/lib/Target/X86/X86Subtarget.h b/contrib/llvm-project/llvm/lib/Target/X86/X86Subtarget.h index a458b5f9ec8f..4d55a084b730 100644 --- a/contrib/llvm-project/llvm/lib/Target/X86/X86Subtarget.h +++ b/contrib/llvm-project/llvm/lib/Target/X86/X86Subtarget.h @@ -244,7 +244,8 @@ public: // TODO: Currently we're always allowing widening on CPUs without VLX, // because for many cases we don't have a better option. bool canExtendTo512DQ() const { - return hasAVX512() && (!hasVLX() || getPreferVectorWidth() >= 512); + return hasAVX512() && hasEVEX512() && + (!hasVLX() || getPreferVectorWidth() >= 512); } bool canExtendTo512BW() const { return hasBWI() && canExtendTo512DQ(); diff --git a/contrib/llvm-project/llvm/lib/TargetParser/Host.cpp b/contrib/llvm-project/llvm/lib/TargetParser/Host.cpp index 4466d50458e1..1adef15771fa 100644 --- a/contrib/llvm-project/llvm/lib/TargetParser/Host.cpp +++ b/contrib/llvm-project/llvm/lib/TargetParser/Host.cpp @@ -1266,8 +1266,10 @@ static void getAvailableFeatures(unsigned ECX, unsigned EDX, unsigned MaxLeaf, setFeature(X86::FEATURE_AVX2); if (HasLeaf7 && ((EBX >> 8) & 1)) setFeature(X86::FEATURE_BMI2); - if (HasLeaf7 && ((EBX >> 16) & 1) && HasAVX512Save) + if (HasLeaf7 && ((EBX >> 16) & 1) && HasAVX512Save) { setFeature(X86::FEATURE_AVX512F); + setFeature(X86::FEATURE_EVEX512); + } if (HasLeaf7 && ((EBX >> 17) & 1) && HasAVX512Save) setFeature(X86::FEATURE_AVX512DQ); if (HasLeaf7 && ((EBX >> 19) & 1)) @@ -1772,6 +1774,7 @@ bool sys::getHostCPUFeatures(StringMap &Features) { Features["rtm"] = HasLeaf7 && ((EBX >> 11) & 1); // AVX512 is only supported if the OS supports the context save for it. Features["avx512f"] = HasLeaf7 && ((EBX >> 16) & 1) && HasAVX512Save; + Features["evex512"] = Features["avx512f"]; Features["avx512dq"] = HasLeaf7 && ((EBX >> 17) & 1) && HasAVX512Save; Features["rdseed"] = HasLeaf7 && ((EBX >> 18) & 1); Features["adx"] = HasLeaf7 && ((EBX >> 19) & 1); diff --git a/contrib/llvm-project/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp b/contrib/llvm-project/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp index 9f220ec003ec..8cc7901cbac7 100644 --- a/contrib/llvm-project/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp +++ b/contrib/llvm-project/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp @@ -2606,7 +2606,7 @@ static Instruction *foldSelectWithSRem(SelectInst &SI, InstCombinerImpl &IC, // %cnd = icmp slt i32 %rem, 0 // %add = add i32 %rem, %n // %sel = select i1 %cnd, i32 %add, i32 %rem - if (match(TrueVal, m_Add(m_Value(RemRes), m_Value(Remainder))) && + if (match(TrueVal, m_Add(m_Specific(RemRes), m_Value(Remainder))) && match(RemRes, m_SRem(m_Value(Op), m_Specific(Remainder))) && IC.isKnownToBeAPowerOfTwo(Remainder, /*OrZero*/ true) && FalseVal == RemRes) diff --git a/contrib/llvm-project/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp b/contrib/llvm-project/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp index 9df28747570c..104e8ceb7967 100644 --- a/contrib/llvm-project/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp +++ b/contrib/llvm-project/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp @@ -279,6 +279,9 @@ bool InductiveRangeCheck::parseRangeCheckICmp(Loop *L, ICmpInst *ICI, Value *LHS = ICI->getOperand(0); Value *RHS = ICI->getOperand(1); + if (!LHS->getType()->isIntegerTy()) + return false; + // Canonicalize to the `Index Pred Invariant` comparison if (IsLoopInvariant(LHS)) { std::swap(LHS, RHS); From nobody Tue May 7 17:30:59 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VYlg76LfHz5JJ0K; Tue, 07 May 2024 17:30: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 4VYlg743qzz4gQb; Tue, 7 May 2024 17:30:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715103059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7r36QmR+CV55MWwaoefr3x2rNddouqQsPrAg0VIsKtA=; b=oNAG5inr+DnSyNwynVV+5oQzN7Npe7TmVGwYPjTmTpqDrSYvu8gh4APcvueK17dZnHo42E 8dc0CYIQHLiJXy24apG/mLyoJm4qFm/1yUtVnRtLRJz4YRl1Oq3AezW03025okEk2aYniY /fDoMCQZXqq6x4UkmRvT9YMrR1d8ssQoLpCU4YmWvii9PKlQNSWWeQV/LUClht91n7CZNp CLENL8jVOs6fbEcun7TFMvKfsiN+clQx21Xe1CJoDfi7g59/UQsCRIAL60kWCy/fcXUeor +KoV8VBJCC4YqxLuFzf2IaQqNqCm75QmDyphjhuVsMVNEItgjoScyghku5NFdQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715103059; a=rsa-sha256; cv=none; b=GzOv1EWLopowbl70lUThgCLLv0H90Q15s7sFWDiwkBGM74m/y4iXhKlHS2RCrlZKoG5baL DJNGU+XCjAV5DeSzakqYmzVbqSNTrgfNBC+l6EskzqfCv2JBs5Gtxgxhsv4cX+Q2P77Kh9 yLa/BhuDjzqInSA0/XVqhJvhp5c8TcAmViIO3ydkw05lzL/xZZRzpG7vaRxyX++ryKVzdM I0AKH8/t5wMKt9iQ4caXqzWkic82VYvIssACfMVRLW2Y9f9MdGOyFHiJLH4u+ouTxXwgue nw7ieKL/YMC0ilF1FEoag2UD8+pFPQfCD+Ch5rWlHPU286osfGeB2wpf9GKXpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715103059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7r36QmR+CV55MWwaoefr3x2rNddouqQsPrAg0VIsKtA=; b=Z9ZvuY8l7vLpNyppCGd7+F655F+/8/wfbgmyG6ar9kEZzyevFJDKXmYeMafbSFJKAqNpOD q8Kf6LNGjyaF9P3S7Pp/l8pAbi9RFwEdycH0ehh+qYSjLASBq1xRFpn0GcnXRyyTdzaVit KqOYgZjRE0g/7H/DJDNMneo+ZIX2wFGpn8tgIGzmmToXLeGkmKzT2PhPuZiiaZT4Z0F4o2 7iP9OKY43uCAsZvTX4Bw/xIzV6AcacC/wy4jzD12k+55zsewx+q2bqwKAr2AQXTd44hOT0 PVmBbg/kzsposuP3oOeOPq+SAd+/TTs7MXHmhsjByAWD1LRwwMNGl29gEd/jQQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VYlg73gR4zr2r; Tue, 7 May 2024 17:30:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 447HUxNl095437; Tue, 7 May 2024 17:30:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 447HUxsL095434; Tue, 7 May 2024 17:30:59 GMT (envelope-from git) Date: Tue, 7 May 2024 17:30:59 GMT Message-Id: <202405071730.447HUxsL095434@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 8210cd3c39e8 - releng/14.1 - Fixup: Merge llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 8210cd3c39e8b28d9d99f54277507547f48cfe27 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=8210cd3c39e8b28d9d99f54277507547f48cfe27 commit 8210cd3c39e8b28d9d99f54277507547f48cfe27 Author: Dimitry Andric AuthorDate: 2024-05-04 10:19:32 +0000 Commit: Dimitry Andric CommitDate: 2024-05-07 17:29:58 +0000 Fixup: Merge llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9 Update version numbers, config headers, etc. Git tricked me into losing these before pushing. PR: 276104 Approved by: re (cperciva) Fixes: d67fc74b9249 MFC after: 3 days (cherry picked from commit 894cb08f0d3656fdb81f4d89085bedc4235f3cb6) (cherry picked from commit a17c251dd68567d879bb80e62f9828abb3967c64) --- lib/clang/include/VCSVersion.inc | 6 +++--- lib/clang/include/clang/Basic/Version.inc | 6 +++--- lib/clang/include/lld/Common/Version.inc | 2 +- lib/clang/include/lldb/Version/Version.inc | 6 +++--- lib/clang/include/llvm/Config/config.h | 4 ++-- lib/clang/include/llvm/Config/llvm-config.h | 4 ++-- lib/clang/include/llvm/Support/VCSRevision.h | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/clang/include/VCSVersion.inc b/lib/clang/include/VCSVersion.inc index 687fb1656937..c4bb0df4e3a5 100644 --- a/lib/clang/include/VCSVersion.inc +++ b/lib/clang/include/VCSVersion.inc @@ -1,8 +1,8 @@ -#define LLVM_REVISION "llvmorg-18.1.4-0-ge6c3289804a6" +#define LLVM_REVISION "llvmorg-18.1.5-0-g617a15a9eac9" #define LLVM_REPOSITORY "https://github.com/llvm/llvm-project.git" -#define CLANG_REVISION "llvmorg-18.1.4-0-ge6c3289804a6" +#define CLANG_REVISION "llvmorg-18.1.5-0-g617a15a9eac9" #define CLANG_REPOSITORY "https://github.com/llvm/llvm-project.git" -#define LLDB_REVISION "llvmorg-18.1.4-0-ge6c3289804a6" +#define LLDB_REVISION "llvmorg-18.1.5-0-g617a15a9eac9" #define LLDB_REPOSITORY "https://github.com/llvm/llvm-project.git" diff --git a/lib/clang/include/clang/Basic/Version.inc b/lib/clang/include/clang/Basic/Version.inc index 536f72efec52..c243016c5f73 100644 --- a/lib/clang/include/clang/Basic/Version.inc +++ b/lib/clang/include/clang/Basic/Version.inc @@ -1,8 +1,8 @@ -#define CLANG_VERSION 18.1.4 -#define CLANG_VERSION_STRING "18.1.4" +#define CLANG_VERSION 18.1.5 +#define CLANG_VERSION_STRING "18.1.5" #define CLANG_VERSION_MAJOR 18 #define CLANG_VERSION_MAJOR_STRING "18" #define CLANG_VERSION_MINOR 1 -#define CLANG_VERSION_PATCHLEVEL 4 +#define CLANG_VERSION_PATCHLEVEL 5 #define CLANG_VENDOR "FreeBSD " diff --git a/lib/clang/include/lld/Common/Version.inc b/lib/clang/include/lld/Common/Version.inc index 65838f76ba5d..4079a361ce8d 100644 --- a/lib/clang/include/lld/Common/Version.inc +++ b/lib/clang/include/lld/Common/Version.inc @@ -1,4 +1,4 @@ // Local identifier in __FreeBSD_version style #define LLD_FREEBSD_VERSION 1400006 -#define LLD_VERSION_STRING "18.1.4 (FreeBSD llvmorg-18.1.4-0-ge6c3289804a6-" __XSTRING(LLD_FREEBSD_VERSION) ")" +#define LLD_VERSION_STRING "18.1.5 (FreeBSD llvmorg-18.1.5-0-g617a15a9eac9-" __XSTRING(LLD_FREEBSD_VERSION) ")" diff --git a/lib/clang/include/lldb/Version/Version.inc b/lib/clang/include/lldb/Version/Version.inc index 1fc1a4d88b7b..0e86bd2e01ba 100644 --- a/lib/clang/include/lldb/Version/Version.inc +++ b/lib/clang/include/lldb/Version/Version.inc @@ -1,6 +1,6 @@ -#define LLDB_VERSION 18.1.4 -#define LLDB_VERSION_STRING "18.1.4" +#define LLDB_VERSION 18.1.5 +#define LLDB_VERSION_STRING "18.1.5" #define LLDB_VERSION_MAJOR 18 #define LLDB_VERSION_MINOR 1 -#define LLDB_VERSION_PATCH 4 +#define LLDB_VERSION_PATCH 5 /* #undef LLDB_FULL_VERSION_STRING */ diff --git a/lib/clang/include/llvm/Config/config.h b/lib/clang/include/llvm/Config/config.h index a017437dc568..0760c0b17a87 100644 --- a/lib/clang/include/llvm/Config/config.h +++ b/lib/clang/include/llvm/Config/config.h @@ -344,10 +344,10 @@ #define PACKAGE_NAME "LLVM" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "LLVM 18.1.4" +#define PACKAGE_STRING "LLVM 18.1.5" /* Define to the version of this package. */ -#define PACKAGE_VERSION "18.1.4" +#define PACKAGE_VERSION "18.1.5" /* Define to the vendor of this package. */ /* #undef PACKAGE_VENDOR */ diff --git a/lib/clang/include/llvm/Config/llvm-config.h b/lib/clang/include/llvm/Config/llvm-config.h index fb878ccdde4d..5ac5d07a3539 100644 --- a/lib/clang/include/llvm/Config/llvm-config.h +++ b/lib/clang/include/llvm/Config/llvm-config.h @@ -180,10 +180,10 @@ #define LLVM_VERSION_MINOR 1 /* Patch version of the LLVM API */ -#define LLVM_VERSION_PATCH 4 +#define LLVM_VERSION_PATCH 5 /* LLVM version string */ -#define LLVM_VERSION_STRING "18.1.4" +#define LLVM_VERSION_STRING "18.1.5" /* Whether LLVM records statistics for use with GetStatistics(), * PrintStatistics() or PrintStatisticsJSON() diff --git a/lib/clang/include/llvm/Support/VCSRevision.h b/lib/clang/include/llvm/Support/VCSRevision.h index e324de0f9fc6..433b2b53b8fe 100644 --- a/lib/clang/include/llvm/Support/VCSRevision.h +++ b/lib/clang/include/llvm/Support/VCSRevision.h @@ -1,2 +1,2 @@ -#define LLVM_REVISION "llvmorg-18.1.4-0-ge6c3289804a6" +#define LLVM_REVISION "llvmorg-18.1.5-0-g617a15a9eac9" #define LLVM_REPOSITORY "https://github.com/llvm/llvm-project.git" From nobody Tue May 7 17:31:00 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VYlg90W46z5JJ0N; Tue, 07 May 2024 17:31: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 4VYlg85YlJz4gSP; Tue, 7 May 2024 17:31:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715103060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=By4JmpvVfD888wA2qep0Px5F+mT8rnWJQKqJ7c1/fcU=; b=txFqrrua5NFVrvMF+BaG/biiLDRRfL4M5EACk2ZFYw27b9YdHna9LP73p5euXamg4oL4Ur 2bI5th87jvHhbPpKwMvyAbZO7kwG77j99ETrr/pZomU6bT57C4bvXYQqBGv5AOjmHmSqmR n/b0laetlRBFPvXnDdiRy7s/5vXt9DE+RU0Wy6xrQ0j+tRNYF0moZidtMIkYvmx/fwrmdJ a1Yx7VioweBO6FRllY+c1WFeW6wHZZrEGnGYnefR8rcJKqKRMSj1Zf83t9GDiWKdTt+w9I QUQx7+ZidaWYysi4x+nZoMv6xDNKsbzKr+kuhE3Q7UiCrZUsQsKNgZUtHBV8kQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715103060; a=rsa-sha256; cv=none; b=SwX10yrJUYxlfNrNsaXhWt/KVs5/tpzQ0bGUEi1kGaMzax/rnhqLHjC3swL5GcvJ1oJdfH itQJ5n6cc5IoghMs+akBd56E6oJ4j9+lFvlA7q474Qblazps3s27V+zPweYtS1393AiQEb BM84+MQiZAb76+hf4X2YDIdrpGgeUVGbFjQPl8kzMHIDQQl22YieQS2rmwI7hU8B8uaBwx WD9oovfA6EaTXwK8XyRBfBNhGua3F7TlIsyX+Rr+qiZJgHboY43bDc8QL/WV2kCVUOurzY m/WHCQyRkJqWeRTaavGEcOgkzpurmYIVx3UMr+i4b6U8FaR4qeKq2C23HgC76g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715103060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=By4JmpvVfD888wA2qep0Px5F+mT8rnWJQKqJ7c1/fcU=; b=l0f3YG7csyW+XfRPCk8NLGQZTmQLjYrQspjawy1x13Q0OKOExJuF1bGvbzz9TobbmqS0oN CLnV7DcMdsV4N0m9QRqn4d0rgeNIH0uHr1x5g4YhzTl+b9unDSH4WFKz+BXXBcAu2AquZM 9wBVNDmBOfdKYQ7GpBexxVuoW/htqF1WmWyWtqgADxeUd2A4iwe588lvJ8xxY6pYVXiqJB t1MYn7bL+OFIQMj2keFxKi7hw3KpovmdRc5sBaKHBjMrIrIGf+LYIk10mYkrJOVhdCqCE1 Qa88iCqj2he+sKc0Vvkc35UF1yCK8lRB+5Ci5Jkf1qB3TDMhtAXtYhzFRIgzow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VYlg84lCRzqcC; Tue, 7 May 2024 17:31:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 447HV0Eg095502; Tue, 7 May 2024 17:31:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 447HV0XD095499; Tue, 7 May 2024 17:31:00 GMT (envelope-from git) Date: Tue, 7 May 2024 17:31:00 GMT Message-Id: <202405071731.447HV0XD095499@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 6102863fd848 - releng/14.1 - lib/clang: clean out old llvm/clang Sparc target remnants List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 6102863fd848289020690c8c3a1cf7714419ac99 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=6102863fd848289020690c8c3a1cf7714419ac99 commit 6102863fd848289020690c8c3a1cf7714419ac99 Author: Dimitry Andric AuthorDate: 2024-05-04 17:34:10 +0000 Commit: Dimitry Andric CommitDate: 2024-05-07 17:30:21 +0000 lib/clang: clean out old llvm/clang Sparc target remnants The WITH_LLVM_TARGET_ENABLE_SPARC option was removed a long time ago, but some ifdefs were still laying around, so clean them up. PR: 276104 Approved by: re (cperciva) MFC after: 3 days (cherry picked from commit 6f444019009a55aac18d18054d154155fbf606c9) (cherry picked from commit 0b8cdac883f5028c8716aa7442c07c68ac1f780b) --- lib/clang/include/llvm/Config/AsmParsers.def | 3 --- lib/clang/include/llvm/Config/AsmPrinters.def | 3 --- lib/clang/include/llvm/Config/Disassemblers.def | 3 --- lib/clang/include/llvm/Config/Targets.def | 3 --- lib/clang/include/llvm/Config/llvm-config.h | 4 ---- 5 files changed, 16 deletions(-) diff --git a/lib/clang/include/llvm/Config/AsmParsers.def b/lib/clang/include/llvm/Config/AsmParsers.def index afd86d898673..3dccab75a285 100644 --- a/lib/clang/include/llvm/Config/AsmParsers.def +++ b/lib/clang/include/llvm/Config/AsmParsers.def @@ -42,9 +42,6 @@ LLVM_ASM_PARSER(PowerPC) #ifdef LLVM_TARGET_ENABLE_RISCV LLVM_ASM_PARSER(RISCV) #endif -#ifdef LLVM_TARGET_ENABLE_SPARC -LLVM_ASM_PARSER(Sparc) -#endif #ifdef LLVM_TARGET_ENABLE_X86 LLVM_ASM_PARSER(X86) #endif diff --git a/lib/clang/include/llvm/Config/AsmPrinters.def b/lib/clang/include/llvm/Config/AsmPrinters.def index ffcca0730101..649b8353c926 100644 --- a/lib/clang/include/llvm/Config/AsmPrinters.def +++ b/lib/clang/include/llvm/Config/AsmPrinters.def @@ -42,9 +42,6 @@ LLVM_ASM_PRINTER(PowerPC) #ifdef LLVM_TARGET_ENABLE_RISCV LLVM_ASM_PRINTER(RISCV) #endif -#ifdef LLVM_TARGET_ENABLE_SPARC -LLVM_ASM_PRINTER(Sparc) -#endif #ifdef LLVM_TARGET_ENABLE_X86 LLVM_ASM_PRINTER(X86) #endif diff --git a/lib/clang/include/llvm/Config/Disassemblers.def b/lib/clang/include/llvm/Config/Disassemblers.def index 18e29e3a09ff..c44fa4e303e2 100644 --- a/lib/clang/include/llvm/Config/Disassemblers.def +++ b/lib/clang/include/llvm/Config/Disassemblers.def @@ -42,9 +42,6 @@ LLVM_DISASSEMBLER(PowerPC) #ifdef LLVM_TARGET_ENABLE_RISCV LLVM_DISASSEMBLER(RISCV) #endif -#ifdef LLVM_TARGET_ENABLE_SPARC -LLVM_DISASSEMBLER(Sparc) -#endif #ifdef LLVM_TARGET_ENABLE_X86 LLVM_DISASSEMBLER(X86) #endif diff --git a/lib/clang/include/llvm/Config/Targets.def b/lib/clang/include/llvm/Config/Targets.def index 604fd9337048..d3332a51a2cc 100644 --- a/lib/clang/include/llvm/Config/Targets.def +++ b/lib/clang/include/llvm/Config/Targets.def @@ -41,9 +41,6 @@ LLVM_TARGET(PowerPC) #ifdef LLVM_TARGET_ENABLE_RISCV LLVM_TARGET(RISCV) #endif -#ifdef LLVM_TARGET_ENABLE_SPARC -LLVM_TARGET(Sparc) -#endif #ifdef LLVM_TARGET_ENABLE_X86 LLVM_TARGET(X86) #endif diff --git a/lib/clang/include/llvm/Config/llvm-config.h b/lib/clang/include/llvm/Config/llvm-config.h index 5ac5d07a3539..049529efdd7f 100644 --- a/lib/clang/include/llvm/Config/llvm-config.h +++ b/lib/clang/include/llvm/Config/llvm-config.h @@ -130,11 +130,7 @@ #endif /* Define if the Sparc target is built in */ -#ifdef LLVM_TARGET_ENABLE_SPARC -#define LLVM_HAS_SPARC_TARGET 1 -#else #define LLVM_HAS_SPARC_TARGET 0 -#endif /* Define if the SPIRV target is built in */ #define LLVM_HAS_SPIRV_TARGET 0 From nobody Wed May 8 06:59:25 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZ5bx2Nnkz5KTJd; Wed, 08 May 2024 06:59: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 4VZ5bx1vbWz4k81; Wed, 8 May 2024 06:59:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715151565; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IGH3yRsqo8VRT0Kk8/mHUgHVbISDSOnFuhMGiumwd48=; b=RBz52Z3JJsWrcOunEfH9vi90skSaILlihST7L+/YXKHJgTzyBD79UI4VN1TorSWVHqKczi chLZ+Enz6SaGjMiNyFxkoE+HvD/xUiUZmyRhO7rMPZSjdiQhoVVuxfoN3WcOxp57Isvbef WyylEwGRBmgtZzgWjA/KxpHYpleb9VoE5QWMxSGN6LyCchl8SgLqLohcEb9MQO5oJW39ek FNW+EkKuA8oBPUdY+zPrDjW6KeDaNbHAMXZfGR8yEoE/Ogp5uWB11a36zbOgRaIjd3U9L4 DsaXQI7BPEJoqPRHXnuHPs8RwC9WN3VnyQMvzbfVkU3moKWwhPy6lIZjECaknQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715151565; a=rsa-sha256; cv=none; b=Ch6v98te7kxt6YK8sb3PL+y0ViRcdmvoB5o8mK3PLJP1LB7Tm+K7UkwkFWlWEqgN74PaRn e6a2M01XojJFFWvjOgOhTIzlkrwHqAx8fosCqJxxPR0c59qL4HZRLPhF2aj2prKfGmwT/4 GwX2Ksq9YwCg3a9A/l0a+tHW7/X17F/ixHhocsViw/UGE2kvAa4d0lA3AaIuftMpbv6ylQ /pllmmk/E98EgZMwe/2C6hMXaDBWKMVVBbCyPKNuowpRSVoF08HKjAzNx6F4UzIep6kQrw 1EfzvPjQp9wCuhbmEykCSd53VLNislFtI5y9d9YYhxvDYd/oxOM52x3UZfZbdQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715151565; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IGH3yRsqo8VRT0Kk8/mHUgHVbISDSOnFuhMGiumwd48=; b=ifqMIZkdNZq9Z+KisLg4cqq8BB1VsK/lRsnv7GLD2LoCmHTsgRuObh/oBrOr7ZEFJTRd3n 1xoi6Y8RHg6lynaJVBTCshcUXTA6yzp3VcE4jSUQTMpSyzgereUYPhgY3sxsHrVNNLs7gD em7/Flgumc0Cv4ThBisiLsXFeowclE0Jf3OzyXwkt0liBX/2GG0ZCh2VhlEes64wjwtDn0 YM3gfTRAldDESfoTcUxgUGpadPyjjIQMNAnRLFW0CZs9smX5uxtjjMtikzJ8kTumWfvFIE q/2ce6V6L6JonoVO62j0/BEdJqJpQC+ncR3sW29D9w/aVbPvzsF/Fqa5mHWlMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZ5bx1WcgzFRQ; Wed, 8 May 2024 06:59:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4486xPqI053064; Wed, 8 May 2024 06:59:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4486xPcB053062; Wed, 8 May 2024 06:59:25 GMT (envelope-from git) Date: Wed, 8 May 2024 06:59:25 GMT Message-Id: <202405080659.4486xPcB053062@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 3c1f3cfdbbfb - stable/14 - release: Stage non-UFS images in vm-images-stage List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3c1f3cfdbbfb309d80645f413be6474f6c82eda6 Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=3c1f3cfdbbfb309d80645f413be6474f6c82eda6 commit 3c1f3cfdbbfb309d80645f413be6474f6c82eda6 Author: Colin Percival AuthorDate: 2024-05-01 17:56:51 +0000 Commit: Colin Percival CommitDate: 2024-05-08 06:59:05 +0000 release: Stage non-UFS images in vm-images-stage When the VM image building code was updated to support building non-UFS images, the vm-images-stage target was not updated to install those newly built images to the FTP site. As a result, we have been sending weekly snapshot announcements since August claiming that ZFS VM images are available when they are not in fact present anywhere publicly accessible. Fixes: 32ae9a6b3937 "release: Build UFS and ZFS VM images" Reported by: Michael Dexter MFC after: 5 days (cherry picked from commit f4b08097d8e274e1a8526d864c31462ea42d9e9f) --- release/Makefile.mirrors | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/release/Makefile.mirrors b/release/Makefile.mirrors index cbc5cd768e28..591fd85b29ea 100644 --- a/release/Makefile.mirrors +++ b/release/Makefile.mirrors @@ -193,6 +193,16 @@ vm-images-stage: cd ${VM_DIR}/Latest && \ ln -s ../${BUILDDATE}/${OSRELEASE}-${SNAP_SUFFIX}.${VMFORMAT}.xz \ ${OSRELEASE}.${VMFORMAT}.xz +. for FS in ${VMFSLIST} + cd ${RELEASEDIR}/vmimages && \ + mv ${OSRELEASE}-${FS}.${VMFORMAT}.xz \ + ${OSRELEASE}-${FS}-${SNAP_SUFFIX}.${VMFORMAT}.xz + cp -p ${RELEASEDIR}/vmimages/${OSRELEASE}-${FS}-${SNAP_SUFFIX}.${VMFORMAT}.xz \ + ${VM_DIR}/${BUILDDATE}/${OSRELEASE}-${FS}-${SNAP_SUFFIX}.${VMFORMAT}.xz + cd ${VM_DIR}/Latest && \ + ln -s ../${BUILDDATE}/${OSRELEASE}-${FS}-${SNAP_SUFFIX}.${VMFORMAT}.xz \ + ${OSRELEASE}-${FS}.${VMFORMAT}.xz +. endfor . endfor cd ${RELEASEDIR}/vmimages && rm -f CHECKSUM.* . for CHECKSUM in ${CHECKSUM_FILES} @@ -212,6 +222,10 @@ vm-images-stage: . for VMFORMAT in ${VMFORMATS} cp -p ${RELEASEDIR}/vmimages/${OSRELEASE}.${VMFORMAT}.xz \ ${VM_DIR}/Latest/${OSRELEASE}.${VMFORMAT}.xz +. for FS in ${VMFSLIST} + cp -p ${RELEASEDIR}/vmimages/${OSRELEASE}-${FS}.${VMFORMAT}.xz \ + ${VM_DIR}/Latest/${OSRELEASE}-${FS}.${VMFORMAT}.xz +. endfor . endfor . for CHECKSUM in ${CHECKSUM_FILES} cp -p ${RELEASEDIR}/vmimages/CHECKSUM.${CHECKSUM} \ From nobody Wed May 8 13:07:42 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZFmt5VQGz5J63y; Wed, 08 May 2024 13:07: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 4VZFmt4fknz4R2s; Wed, 8 May 2024 13:07:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715173662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aXMv/G273iLwRRxH2Loih7Lh+kikNyA6lE2Xl4JPAUs=; b=BOPkYSVUUI5JVg8tqaXabWEQYatmI307tV3RPn7lJzUK0hmUxxCvEHAUiQggMTsmx3bvqR k/NNqf+fukpJyimpd9C8CZNEnpGuWJzl7pfJ1IRQLehKk773mbw36/jdBwb9gTmfVqs/de p38ClbmuFQWMT0e1Fkk93Bp2VfJ55uCDHAeEh75NpV7vFvLyb3y/PeTLQum5qFTiMIg4AR peJLJlHp5dtrAdAYph15DJYwZPAI6ItxaMaM+X+zcEfdAcpICVfsPWNUGbNUkn4anVIRgn 7uUC8YOtVO/c/gu7W9apDPVI0icD2s7+nnkZ+XDaM/v/W1P15PRWKm4+6u0u8A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715173662; a=rsa-sha256; cv=none; b=qrfnadNRIrYJDQalpBMS0jD8BxkhlozVgrIaiM/5hke0kFFccu2uMwmlR1Szjza1nVsMZW +pvuHcb03q8xdYEdY7yl8/5hnL8CKycvyJgxDu2mdqwcOORzwjkBoLdrJiz7v4lBvRT/bS iy7vmxIUvWbT3jj5fpKDTKN5qrxNs78A6wLB4QnHV2K8WaQZmiuyBEtj2qwU+UXc8HhwVZ vTzTgiLon0GYFyG9g+9ha5CHMnF89oSLYa2LR4P2ZePVlx2shJOZb73VcOnlM+eHWsL2SC 5qcPYpyMiFZgjBl33R/g0QFaRvaDToFLf+DadhVuUHwhYJCP2mtGHi/eWGKHcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715173662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aXMv/G273iLwRRxH2Loih7Lh+kikNyA6lE2Xl4JPAUs=; b=rTZ0ktfaY0hi1g/6iYzM+POMmIdUhm7akZ9XuQjmc1HdIUn2CnjP/9TyMkK6luDYcVfCGj mKr4RUNtjuLgoBCp811FpU8Wf1jFzI2ugXH1mzs9OpapqZfVT0hHp4q3UXHp+fm4qFnfHJ G2P54SnLLdlI9HNGPOHZrUDcs+BV3UA/Es/ZloAEehPlk4ZHIVVJ2AV+P5p5rmwfeiW+mC JRrpiaoLoBkADw8yoZLrF7ElzlS+2cCHY+4Gk4oBlPVtilrwOQtW0goH1cUKmXFK1g+QwK Iw2plk9sBYzxsB4N/zPjQfEq/zcr9Rw+/AnjSc7gIMHcSHuS1CbN8aHNbZR9UQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZFmt48nFzQMm; Wed, 8 May 2024 13:07:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 448D7gm0080197; Wed, 8 May 2024 13:07:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 448D7gZL080194; Wed, 8 May 2024 13:07:42 GMT (envelope-from git) Date: Wed, 8 May 2024 13:07:42 GMT Message-Id: <202405081307.448D7gZL080194@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: ebc5b3b08560 - stable/14 - ctags: Use C99 bool instead of defining our own List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ebc5b3b08560d900f5013038d0fd1bb484a4f187 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ebc5b3b08560d900f5013038d0fd1bb484a4f187 commit ebc5b3b08560d900f5013038d0fd1bb484a4f187 Author: Collin Funk AuthorDate: 2024-02-07 00:34:50 +0000 Commit: Mark Johnston CommitDate: 2024-05-08 13:06:15 +0000 ctags: Use C99 bool instead of defining our own Use stdbool.h definitions instead of defining non-standard ones. Signed-off-by: Collin Funk Reviewed by: markj MFC after: 2 weeks Pull Request: https://github.com/freebsd/freebsd-src/pull/1107 (cherry picked from commit 87b0195ace1a71a1a07244890be3aaef72e1ffcd) --- usr.bin/ctags/C.c | 76 ++++++++++++++++++++++++------------------------- usr.bin/ctags/ctags.c | 22 +++++++------- usr.bin/ctags/ctags.h | 11 ++++--- usr.bin/ctags/fortran.c | 12 ++++---- usr.bin/ctags/lisp.c | 8 +++--- usr.bin/ctags/tree.c | 2 +- usr.bin/ctags/yacc.c | 10 +++---- 7 files changed, 70 insertions(+), 71 deletions(-) diff --git a/usr.bin/ctags/C.c b/usr.bin/ctags/C.c index 25c5db5d405b..725336d33e01 100644 --- a/usr.bin/ctags/C.c +++ b/usr.bin/ctags/C.c @@ -43,10 +43,10 @@ static char sccsid[] = "@(#)C.c 8.4 (Berkeley) 4/2/94"; #include "ctags.h" -static int func_entry(void); +static bool func_entry(void); static void hash_entry(void); static void skip_string(int); -static int str_entry(int); +static bool str_entry(int); /* * c_entries -- @@ -58,13 +58,13 @@ c_entries(void) int c; /* current character */ int level; /* brace level */ int token; /* if reading a token */ - int t_def; /* if reading a typedef */ + bool t_def; /* if reading a typedef */ int t_level; /* typedef's brace level */ char *sp; /* buffer pointer */ char tok[MAXTOKEN]; /* token buffer */ lineftell = ftell(inf); - sp = tok; token = t_def = NO; t_level = -1; level = 0; lineno = 1; + sp = tok; token = t_def = false; t_level = -1; level = 0; lineno = 1; while (GETC(!=, EOF)) { switch (c) { /* @@ -98,11 +98,11 @@ c_entries(void) */ endtok: if (sp > tok) { *sp = EOS; - token = YES; + token = true; sp = tok; } else - token = NO; + token = false; continue; /* @@ -180,7 +180,7 @@ c_entries(void) */ case ';': if (t_def && level == t_level) { - t_def = NO; + t_def = false; get_line(); if (sp != tok) *sp = EOS; @@ -213,7 +213,7 @@ c_entries(void) /* no typedefs inside typedefs */ if (!t_def && !memcmp(tok, "typedef",8)) { - t_def = YES; + t_def = true; t_level = level; break; } @@ -239,15 +239,15 @@ c_entries(void) if (sp == tok + sizeof tok - 1) /* Too long -- truncate it */ *sp = EOS; - else + else *sp++ = c; - token = YES; + token = true; } continue; } sp = tok; - token = NO; + token = false; } } @@ -255,7 +255,7 @@ c_entries(void) * func_entry -- * handle a function reference */ -static int +static bool func_entry(void) { int c; /* current character */ @@ -293,7 +293,7 @@ func_entry(void) SETLINE; } } - return (NO); + return (false); fnd: /* * we assume that the character after a function's right paren @@ -305,7 +305,7 @@ fnd: if (c == '\n') SETLINE; if (c == EOF) - return NO; + return false; /* * Recognize the gnu __attribute__ extension, which would * otherwise make the heuristic test DTWT @@ -317,7 +317,7 @@ fnd: } } else { if (intoken(c)) { - if (anext - maybe_attribute + if (anext - maybe_attribute < (ptrdiff_t)(sizeof attribute - 1)) *anext++ = c; else break; @@ -326,7 +326,7 @@ fnd: *anext++ = '\0'; if (strcmp(maybe_attribute, attribute) == 0) { (void)ungetc(c, inf); - return NO; + return false; } break; } @@ -337,12 +337,12 @@ fnd: skip_comment(c); else { /* don't ever "read" '/' */ (void)ungetc(c, inf); - return (NO); + return (false); } } if (c != '{') (void)skip_key('{'); - return (YES); + return (true); } /* @@ -371,7 +371,7 @@ hash_entry(void) if (sp == tok + sizeof tok - 1) /* Too long -- truncate it */ *sp = EOS; - else + else *sp++ = c; } *sp = EOS; @@ -387,7 +387,7 @@ hash_entry(void) if (sp == tok + sizeof tok - 1) /* Too long -- truncate it */ *sp = EOS; - else + else *sp++ = c; if (GETC(==, EOF)) return; @@ -415,7 +415,7 @@ skip: if (c == '\n') { /* get rid of rest of define */ * str_entry -- * handle a struct, union or enum entry */ -static int +static bool str_entry(int c) /* c is current character */ { int curline; /* line started on */ @@ -425,17 +425,17 @@ str_entry(int c) /* c is current character */ curline = lineno; while (iswhite(c)) if (GETC(==, EOF)) - return (NO); + return (false); if (c == '{') /* it was "struct {" */ - return (YES); + return (true); for (sp = tok;;) { /* get next token */ if (sp == tok + sizeof tok - 1) /* Too long -- truncate it */ *sp = EOS; - else + else *sp++ = c; if (GETC(==, EOF)) - return (NO); + return (false); if (!intoken(c)) break; } @@ -452,12 +452,12 @@ str_entry(int c) /* c is current character */ break; if (c != '{') { (void)ungetc(c, inf); - return (NO); + return (false); } } *sp = EOS; pfnote(tok, curline); - return (YES); + return (true); } /* @@ -474,7 +474,7 @@ skip_comment(int t) /* t is comment character */ switch(c) { /* comments don't nest, nor can they be escaped. */ case '*': - star = YES; + star = true; break; case '/': if (star && t == '*') @@ -486,7 +486,7 @@ skip_comment(int t) /* t is comment character */ return; /*FALLTHROUGH*/ default: - star = NO; + star = false; break; } } @@ -501,7 +501,7 @@ skip_string(int key) int c, skip; - for (skip = NO; GETC(!=, EOF); ) + for (skip = false; GETC(!=, EOF); ) switch (c) { case '\\': /* a backslash escapes anything */ skip = !skip; /* we toggle in case it's "\\" */ @@ -512,7 +512,7 @@ skip_string(int key) default: if (c == key && !skip) return; - skip = NO; + skip = false; } } @@ -520,21 +520,21 @@ skip_string(int key) * skip_key -- * skip to next char "key" */ -int +bool skip_key(int key) { - int c, - skip, - retval; + int c; + bool skip; + bool retval; - for (skip = retval = NO; GETC(!=, EOF);) + for (skip = retval = false; GETC(!=, EOF);) switch(c) { case '\\': /* a backslash escapes anything */ skip = !skip; /* we toggle in case it's "\\" */ break; case ';': /* special case for yacc; if one */ case '|': /* of these chars occurs, we may */ - retval = YES; /* have moved out of the rule */ + retval = true; /* have moved out of the rule */ break; /* not used by C */ case '\'': case '"': @@ -557,7 +557,7 @@ skip_key(int key) norm: if (c == key && !skip) return (retval); - skip = NO; + skip = false; } return (retval); } diff --git a/usr.bin/ctags/ctags.c b/usr.bin/ctags/ctags.c index 6053a52f32da..686acd0f9cdf 100644 --- a/usr.bin/ctags/ctags.c +++ b/usr.bin/ctags/ctags.c @@ -99,8 +99,8 @@ main(int argc, char **argv) setlocale(LC_ALL, ""); - aflag = uflag = NO; - tflag = YES; + aflag = uflag = false; + tflag = true; while ((ch = getopt(argc, argv, "BFTadf:tuwvx")) != -1) switch(ch) { case 'B': @@ -110,7 +110,7 @@ main(int argc, char **argv) searchar = '/'; break; case 'T': - tflag = NO; + tflag = false; break; case 'a': aflag++; @@ -122,7 +122,7 @@ main(int argc, char **argv) outfile = optarg; break; case 't': - tflag = YES; + tflag = true; break; case 'u': uflag++; @@ -264,24 +264,24 @@ init(void) const unsigned char *sp; for (i = 0; i < 256; i++) { - _wht[i] = _etk[i] = _itk[i] = _btk[i] = NO; - _gd[i] = YES; + _wht[i] = _etk[i] = _itk[i] = _btk[i] = false; + _gd[i] = true; } #define CWHITE " \f\t\n" for (sp = CWHITE; *sp; sp++) /* white space chars */ - _wht[*sp] = YES; + _wht[*sp] = true; #define CTOKEN " \t\n\"'#()[]{}=-+%*/&|^~!<>;,.:?" for (sp = CTOKEN; *sp; sp++) /* token ending chars */ - _etk[*sp] = YES; + _etk[*sp] = true; #define CINTOK "ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz0123456789" for (sp = CINTOK; *sp; sp++) /* valid in-token chars */ - _itk[*sp] = YES; + _itk[*sp] = true; #define CBEGIN "ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz" for (sp = CBEGIN; *sp; sp++) /* token starting chars */ - _btk[*sp] = YES; + _btk[*sp] = true; #define CNOTGD ",;" for (sp = CNOTGD; *sp; sp++) /* invalid after-function chars */ - _gd[*sp] = NO; + _gd[*sp] = false; } /* diff --git a/usr.bin/ctags/ctags.h b/usr.bin/ctags/ctags.h index 8892733d650f..5079353a8136 100644 --- a/usr.bin/ctags/ctags.h +++ b/usr.bin/ctags/ctags.h @@ -32,10 +32,9 @@ * */ -#define bool char +/* This header requires bool for some externed symbols. */ +#include -#define YES 1 -#define NO 0 #define EOS '\0' #define ENDLINE 50 /* max length of pattern */ @@ -83,14 +82,14 @@ extern char lbuf[LINE_MAX]; extern char *lbp; extern char searchar; /* ex search character */ -extern int cicmp(const char *); +extern bool cicmp(const char *); extern void get_line(void); extern void pfnote(const char *, int); -extern int skip_key(int); +extern bool skip_key(int); extern void put_entries(NODE *); extern void toss_yysec(void); extern void l_entries(void); extern void y_entries(void); -extern int PF_funcs(void); +extern bool PF_funcs(void); extern void c_entries(void); extern void skip_comment(int); diff --git a/usr.bin/ctags/fortran.c b/usr.bin/ctags/fortran.c index 7fa6ec3823d9..56ae3b66458b 100644 --- a/usr.bin/ctags/fortran.c +++ b/usr.bin/ctags/fortran.c @@ -47,14 +47,14 @@ static void takeprec(void); char *lbp; /* line buffer pointer */ -int +bool PF_funcs(void) { bool pfcnt; /* pascal/fortran functions found */ char *cp; char tok[MAXTOKEN]; - for (pfcnt = NO;;) { + for (pfcnt = false;;) { lineftell = ftell(inf); if (!fgets(lbuf, sizeof(lbuf), inf)) return (pfcnt); @@ -126,7 +126,7 @@ PF_funcs(void) (void)strlcpy(tok, lbp, sizeof(tok)); /* possible trunc */ get_line(); /* process line for ex(1) */ pfnote(tok, lineno); - pfcnt = YES; + pfcnt = true; } /*NOTREACHED*/ } @@ -135,7 +135,7 @@ PF_funcs(void) * cicmp -- * do case-independent strcmp */ -int +bool cicmp(const char *cp) { int len; @@ -146,9 +146,9 @@ cicmp(const char *cp) continue; if (!*cp) { lbp += len; - return (YES); + return (true); } - return (NO); + return (false); } static void diff --git a/usr.bin/ctags/lisp.c b/usr.bin/ctags/lisp.c index d167c82e7c69..bd6100709299 100644 --- a/usr.bin/ctags/lisp.c +++ b/usr.bin/ctags/lisp.c @@ -50,7 +50,7 @@ static char sccsid[] = "@(#)lisp.c 8.3 (Berkeley) 4/2/94"; void l_entries(void) { - int special; + bool special; char *cp; char savedc; char tok[MAXTOKEN]; @@ -63,15 +63,15 @@ l_entries(void) lbp = lbuf; if (!cicmp("(def")) continue; - special = NO; + special = false; switch(*lbp | ' ') { case 'm': if (cicmp("method")) - special = YES; + special = true; break; case 'w': if (cicmp("wrapper") || cicmp("whopper")) - special = YES; + special = true; } for (; !isspace(*lbp); ++lbp) continue; diff --git a/usr.bin/ctags/tree.c b/usr.bin/ctags/tree.c index 15291f4a5e80..c3cfabc6e25f 100644 --- a/usr.bin/ctags/tree.c +++ b/usr.bin/ctags/tree.c @@ -106,7 +106,7 @@ add_node(NODE *node, NODE *cur_node) if (!cur_node->been_warned) if (!wflag) fprintf(stderr, "Duplicate entry in files %s and %s: %s (Warning only)\n", node->file, cur_node->file, node->entry); - cur_node->been_warned = YES; + cur_node->been_warned = true; } else if (dif < 0) if (cur_node->left) diff --git a/usr.bin/ctags/yacc.c b/usr.bin/ctags/yacc.c index 0fd8537fb74f..e30ea0eacad0 100644 --- a/usr.bin/ctags/yacc.c +++ b/usr.bin/ctags/yacc.c @@ -54,7 +54,7 @@ y_entries(void) bool in_rule; char tok[MAXTOKEN]; - in_rule = NO; + in_rule = false; while (GETC(!=, EOF)) switch (c) { @@ -68,12 +68,12 @@ y_entries(void) break; case '{': if (skip_key('}')) - in_rule = NO; + in_rule = false; break; case '\'': case '"': if (skip_key(c)) - in_rule = NO; + in_rule = false; break; case '%': if (GETC(==, '%')) @@ -88,7 +88,7 @@ y_entries(void) break; case '|': case ';': - in_rule = NO; + in_rule = false; break; default: if (in_rule || (!isalpha(c) && c != '.' && c != '_')) @@ -107,7 +107,7 @@ y_entries(void) } if (c == ':') { pfnote(tok, lineno); - in_rule = YES; + in_rule = true; } else (void)ungetc(c, inf); From nobody Wed May 8 13:07:43 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZFmv68J8z5J5sk; Wed, 08 May 2024 13:07: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 4VZFmv5f5Rz4RLp; Wed, 8 May 2024 13:07:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715173663; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xk25vM6gLKYqClpwtHUsXhnK9q6YqR5vs5gYSdGCtqg=; b=eeWkR+3Cdox9BmAPPR84HQejy8p8/C45Z4qwfxIcr52B8BleneXuGxl04IeSdcQyOrk2Yb Faca/KzJp6JpHChcNiw40EXkUIDtTQmyqoIBqyZqZbERxAl7ua0cCW9LIt010XEgitAXV2 rQMRSoVkkTjWzNmMi16Bx5ilbBnjoRhngaEC5eAm4CrWV1K31HLORioNKXTnVnPeYsPgzB ghluviPT329aQJFckeIRo4pogR5iBo2JnsjOvZ+jS/Til8kQV5HXg7bx0OslHNVgY9kiPV Rg+C5zBcoo/GSCq4StxY4NCd9/uQtq81GjGO0bYh4yAnEB4dNjP0dg8Nu+xVvw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715173663; a=rsa-sha256; cv=none; b=lYBTXdh0muLtQkf/QvnzssbmTArnkXXWe3176JFng21LCfMMV0Af96o6WUW02kCqf1rQd7 UsB3E3jNR/WsCo1/wUTxA704czVNLXYIhCJpJBsJ2HhbdaHdluWTK5EggR1dAXY67se2mG zCar2ZeVhaVtuSGZDrmVIL35K4YEEYovSAkGqG7ntHjti0ZHnNx8Kr5NCHe8gCOQWkyEJX bTI2fVAtf/H7YbFYLA5abHnu7x3AMC3lBSAtDpOEYaMztHcPNng2lpIPTVffVsSXP7jYr/ 5KDbh/ozSTtnTWHhuXbZstCXp6wcNoZzMzbiwBJxQFH0OU3HiouJZsRkgQsKNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715173663; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xk25vM6gLKYqClpwtHUsXhnK9q6YqR5vs5gYSdGCtqg=; b=ftujQhsuDC3mLKK/Ukq8pRza429TBeYa53kRBZ8VdOtEWjJ5l8gyk6546pzr7dYyk9xFrV XHB1FYlwaq3aWeDzeGeRu3eRmsoLG/HQE/ILaH3jmcGXzSbVRxFHj9+GLlbnYj9IV8ihAF AxWkoAH4jZ8Z/7XdIzAEOaxJsBZmAB66/lqZAFtLhaZUm8nYLjdiv2obWL3g8ZwcCIY1Ut dffJI/L3cyrBOX8MetqGRUBk/i+B+U+w5maoDDBa/K50RFj9y/TW/4vm/AqC+QKpALzvJS 1CT2uI7wxT5c7e5X91CN9UGl4IBDxNDk4g8u92KLy+JLVF4KX89DwHOckB7YCg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZFmv5C8KzQMn; Wed, 8 May 2024 13:07:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 448D7hCY080245; Wed, 8 May 2024 13:07:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 448D7hO2080242; Wed, 8 May 2024 13:07:43 GMT (envelope-from git) Date: Wed, 8 May 2024 13:07:43 GMT Message-Id: <202405081307.448D7hO2080242@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 3f6515c20f38 - stable/14 - bpf: Make BPF interop consistent with if_loop List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3f6515c20f381d6e136c8c322eadc69fd0e6c4aa Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3f6515c20f381d6e136c8c322eadc69fd0e6c4aa commit 3f6515c20f381d6e136c8c322eadc69fd0e6c4aa Author: Seth Hoffert AuthorDate: 2023-10-22 14:12:45 +0000 Commit: Mark Johnston CommitDate: 2024-05-08 13:06:15 +0000 bpf: Make BPF interop consistent with if_loop The pseudo_AF_HDRCMPLT check is already being done in if_loop and just needed to be ported over to if_ic, if_wg, if_disc, if_gif, if_gre, if_me, if_tuntap and ng_iface. This is needed in order to allow these interfaces to work properly with e.g., tcpreplay. PR: 256587 Reviewed by: markj MFC after: 2 weeks Pull Request: https://github.com/freebsd/freebsd-src/pull/876 (cherry picked from commit 2cb0fce24d64039090dc9243cdf0715ee80c91b1) --- sys/dev/iicbus/if_ic.c | 4 ++-- sys/dev/wg/if_wg.c | 3 ++- sys/net/if_disc.c | 2 +- sys/net/if_gif.c | 3 ++- sys/net/if_gre.c | 3 ++- sys/net/if_me.c | 3 ++- sys/net/if_tuntap.c | 2 +- sys/netgraph/ng_iface.c | 2 +- 8 files changed, 13 insertions(+), 9 deletions(-) diff --git a/sys/dev/iicbus/if_ic.c b/sys/dev/iicbus/if_ic.c index 4ca8f3960298..52ab5afb9c4e 100644 --- a/sys/dev/iicbus/if_ic.c +++ b/sys/dev/iicbus/if_ic.c @@ -363,8 +363,8 @@ icoutput(if_t ifp, struct mbuf *m, const struct sockaddr *dst, u_char *cp; u_int32_t hdr; - /* BPF writes need to be handled specially. */ - if (dst->sa_family == AF_UNSPEC) + /* BPF writes need to be handled specially. */ + if (dst->sa_family == AF_UNSPEC || dst->sa_family == pseudo_AF_HDRCMPLT) bcopy(dst->sa_data, &hdr, sizeof(hdr)); else hdr = RO_GET_FAMILY(ro, dst); diff --git a/sys/dev/wg/if_wg.c b/sys/dev/wg/if_wg.c index 2c867956912a..30429c3725cd 100644 --- a/sys/dev/wg/if_wg.c +++ b/sys/dev/wg/if_wg.c @@ -2194,7 +2194,8 @@ wg_output(if_t ifp, struct mbuf *m, const struct sockaddr *dst, struct route *ro int ret; struct mbuf *defragged; - if (dst->sa_family == AF_UNSPEC) + /* BPF writes need to be handled specially. */ + if (dst->sa_family == AF_UNSPEC || dst->sa_family == pseudo_AF_HDRCMPLT) memcpy(&af, dst->sa_data, sizeof(af)); else af = dst->sa_family; diff --git a/sys/net/if_disc.c b/sys/net/if_disc.c index 02f3bbbfdaf1..193bb31d138f 100644 --- a/sys/net/if_disc.c +++ b/sys/net/if_disc.c @@ -182,7 +182,7 @@ discoutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, M_ASSERTPKTHDR(m); /* BPF writes need to be handled specially. */ - if (dst->sa_family == AF_UNSPEC) + if (dst->sa_family == AF_UNSPEC || dst->sa_family == pseudo_AF_HDRCMPLT) bcopy(dst->sa_data, &af, sizeof(af)); else af = RO_GET_FAMILY(ro, dst); diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c index e5065889d732..ef64c15074ed 100644 --- a/sys/net/if_gif.c +++ b/sys/net/if_gif.c @@ -408,7 +408,8 @@ gif_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, KASSERT(ifp->if_bridge == NULL, ("%s: unexpectedly called with bridge attached", __func__)); - if (dst->sa_family == AF_UNSPEC) + /* BPF writes need to be handled specially. */ + if (dst->sa_family == AF_UNSPEC || dst->sa_family == pseudo_AF_HDRCMPLT) memcpy(&af, dst->sa_data, sizeof(af)); else af = RO_GET_FAMILY(ro, dst); diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c index 55163416f807..ca9c4835daf6 100644 --- a/sys/net/if_gre.c +++ b/sys/net/if_gre.c @@ -609,7 +609,8 @@ gre_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, { uint32_t af; - if (dst->sa_family == AF_UNSPEC) + /* BPF writes need to be handled specially. */ + if (dst->sa_family == AF_UNSPEC || dst->sa_family == pseudo_AF_HDRCMPLT) bcopy(dst->sa_data, &af, sizeof(af)); else af = RO_GET_FAMILY(ro, dst); diff --git a/sys/net/if_me.c b/sys/net/if_me.c index e9bcd345b5c5..80c2816b808a 100644 --- a/sys/net/if_me.c +++ b/sys/net/if_me.c @@ -539,7 +539,8 @@ me_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, { uint32_t af; - if (dst->sa_family == AF_UNSPEC) + /* BPF writes need to be handled specially. */ + if (dst->sa_family == AF_UNSPEC || dst->sa_family == pseudo_AF_HDRCMPLT) bcopy(dst->sa_data, &af, sizeof(af)); else af = RO_GET_FAMILY(ro, dst); diff --git a/sys/net/if_tuntap.c b/sys/net/if_tuntap.c index 4cb219dc92b6..5d37879e87b9 100644 --- a/sys/net/if_tuntap.c +++ b/sys/net/if_tuntap.c @@ -1442,7 +1442,7 @@ tunoutput(struct ifnet *ifp, struct mbuf *m0, const struct sockaddr *dst, } /* BPF writes need to be handled specially. */ - if (dst->sa_family == AF_UNSPEC) + if (dst->sa_family == AF_UNSPEC || dst->sa_family == pseudo_AF_HDRCMPLT) bcopy(dst->sa_data, &af, sizeof(af)); else af = RO_GET_FAMILY(ro, dst); diff --git a/sys/netgraph/ng_iface.c b/sys/netgraph/ng_iface.c index 8ae4707b7abd..e9f97ff0fdec 100644 --- a/sys/netgraph/ng_iface.c +++ b/sys/netgraph/ng_iface.c @@ -367,7 +367,7 @@ ng_iface_output(struct ifnet *ifp, struct mbuf *m, } /* BPF writes need to be handled specially. */ - if (dst->sa_family == AF_UNSPEC) + if (dst->sa_family == AF_UNSPEC || dst->sa_family == pseudo_AF_HDRCMPLT) bcopy(dst->sa_data, &af, sizeof(af)); else af = RO_GET_FAMILY(ro, dst); From nobody Wed May 8 13:07:44 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZFmx280Pz5J5qT; Wed, 08 May 2024 13:07: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 4VZFmx0SNlz4RTy; Wed, 8 May 2024 13:07:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715173665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ofYs2CnL+1sVBy+Lxice9JX7eMxgWMhaa4q94qUTfZI=; b=thukUiSvUrkHx68H4hx/U69lZlQAFlVxcgjNDRQVV4o71dxtQylnkNDPZXx+QxVN1CMjST xh92PySkQH+j9dVlILu5b2EamQnvxvp/ZX42QdRE+zEJ6IoTdQSayqjfiqRmNTcNCN0Jjr IwW0luWwZofnRjL4o2Yu3cyUVwO7wBP7rZJc0cjicqPns7ZWV8Cw9dnEMC8ktvxxgU23vG qeKq1/TZRlYN2TY1NHhSAcOtA7yICfjwPtWkfD006c5teZiVrsXWeRLMeXFz1YNjkGJDd+ oY59lJEor3/Uk+5uOvpdXE5G3VWwS6/1ew4xPCiEhnG5lR3FCNK3lYkWvgZnVw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715173665; a=rsa-sha256; cv=none; b=DgK369qKTuM+L7W3lyUDyTwn8Os+tHZefFCaFWfDOYW9A3bVYvBUihPdakzXuNiIDttX6R Zs05lJP9izw1kMtcYH0SBK0IPLjOEFpO5OHaz8xQomq7kmF82MpX017i/WV+sz7COkqR0R HqDIeAx7TXMH7E8C+NcmAUamXPviRZ1Yu0gozwvvb/tR62FW+UmRzl+otOJJQ2HQm9Hxsu t7ky3vV6aitErCtbEXEJTJUUdfcqOgSDkQT94hUX97wWa7qDDYTnRd9iimUYI/KdCriMu5 496xmYcHsLtcpL5oQjrIf5aRq+gIWiYaCL5xtQzblwxYNQ9pjnJ5hGHfpczFOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715173665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ofYs2CnL+1sVBy+Lxice9JX7eMxgWMhaa4q94qUTfZI=; b=DnOgnv5NKFIVwLHCBY3XwEMzyMg9gNpQWqCzFRfISFVWQK7F+9wNse8WfwJH/EC/SDbWNz Kxm+RkWS788Zx4IYAkLu4XE1kQO/Q8W0S/IsxhYS8BsKTuFbhcFN1ap3OrKBRXh38oDIMi SMREOuWfYuQz9DRw/drHe5rvL3sBAP3FnkViUeBxql5f9AgsM7F7zH+c6DKm7yaeLdxGvb Exansu5ZadcVttRxSZMC6tw2AnjKuJ2zskuvUy36arRu4iYvobQ553FQlYaYfRZK2GK/Ap iQQmsuEDV7fmB4gnPMoawhMYCwuNmGaltPrhKoQXrfC/1mtQ4n3T6/a0wMAJug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZFmw6DvZzQYM; Wed, 8 May 2024 13:07:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 448D7i2b080290; Wed, 8 May 2024 13:07:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 448D7iJV080287; Wed, 8 May 2024 13:07:44 GMT (envelope-from git) Date: Wed, 8 May 2024 13:07:44 GMT Message-Id: <202405081307.448D7iJV080287@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: e3b27cc3546f - stable/14 - copy_file_range: Call vn_rdwr() at least once List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e3b27cc3546fb39ec579d023b3520d15a1628021 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e3b27cc3546fb39ec579d023b3520d15a1628021 commit e3b27cc3546fb39ec579d023b3520d15a1628021 Author: Mark Johnston AuthorDate: 2024-04-04 15:18:03 +0000 Commit: Mark Johnston CommitDate: 2024-05-08 13:06:16 +0000 copy_file_range: Call vn_rdwr() at least once This ensures that we invoke VOP_READ on the input file even if it's empty, which in turn helps ensure that filesystems update the atime of the file. PR: 274615 Reviewed by: olce, rmacklem, kib MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D43524 (cherry picked from commit 08f3d5b60cdfff434e391d96cdffc5a90c550b07) --- sys/kern/vfs_vnops.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 51386d0e9581..1171b72a3a96 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -3341,7 +3341,7 @@ vn_generic_copy_file_range(struct vnode *invp, off_t *inoffp, off_t startoff, endoff, xfer, xfer2; u_long blksize; int error, interrupted; - bool cantseek, readzeros, eof, lastblock, holetoeof, sparse; + bool cantseek, readzeros, eof, first, lastblock, holetoeof, sparse; ssize_t aresid, r = 0; size_t copylen, len, savlen; off_t outsize; @@ -3482,6 +3482,7 @@ vn_generic_copy_file_range(struct vnode *invp, off_t *inoffp, endts.tv_sec++; } else timespecclear(&endts); + first = true; holetoeof = eof = false; while (len > 0 && error == 0 && !eof && interrupted == 0) { endoff = 0; /* To shut up compilers. */ @@ -3583,10 +3584,17 @@ vn_generic_copy_file_range(struct vnode *invp, off_t *inoffp, */ xfer -= (*inoffp % blksize); } - /* Loop copying the data block. */ - while (copylen > 0 && error == 0 && !eof && interrupted == 0) { + + /* + * Loop copying the data block. If this was our first attempt + * to copy anything, allow a zero-length block so that the VOPs + * get a chance to update metadata, specifically the atime. + */ + while (error == 0 && ((copylen > 0 && !eof) || first) && + interrupted == 0) { if (copylen < xfer) xfer = copylen; + first = false; error = vn_lock(invp, LK_SHARED); if (error != 0) goto out; @@ -3596,7 +3604,7 @@ vn_generic_copy_file_range(struct vnode *invp, off_t *inoffp, curthread); VOP_UNLOCK(invp); lastblock = false; - if (error == 0 && aresid > 0) { + if (error == 0 && (xfer == 0 || aresid > 0)) { /* Stop the copy at EOF on the input file. */ xfer -= aresid; eof = true; From nobody Wed May 8 13:07:45 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZFmy2pk6z5J65n; Wed, 08 May 2024 13:07: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 4VZFmy0WLyz4RKB; Wed, 8 May 2024 13:07:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715173666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pg4QLfm6zF6A2I1D64bW5YWNd7m3UPxkOLoxkBi20gM=; b=rLqd1ckHwZq/JiuyFTnVrnm2ckOEEHQud5FyVEhPdwKeKD2f4OxGsmR9eDJyGsjoCgU14r aQ/1URp95kjSrIWff7ZXAcRGNre9mVb0UlDdNQoleRyUrYwPaILBPSP/wErMM78HXzryFj v/cCGfzXfcb81aLwn1h7KIVbZslycU60PmXO2VdYDchH2k2VsvJvcot4wc1YoKp2erdQub SRfRWoVw5gV5i9XTc79tVAA5GpyO63Rd3/LmsQoWdXWO8SLiTyFI866o61C9H0ZUKioJH/ D1ptwmsn9bDYPxl63OqEVCZADMG9NenhCkvNuWxauZQZN2eu+bytmDA5eFR//Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715173666; a=rsa-sha256; cv=none; b=dfMKm0RbgulUiMzJXXdBOPg1x/aauYAWIRNJPpgI9YWK+VSp7XhjvQrKyr/9bZpuoiCrRg uWzZ3Dsid4ywOr40rvQqSM7yOe1DPRw6rJ9pEmTCM271UmGs5ipoNuuNiuTIuV0Gw6oUcA mmQavL1tJrZEKNJ/AH0caKI340WNAuD/YGiFrr0QfSyHR3W9baCPtgfN2Vw4Gg59eq0NFD H/Xv4hNIBDyqI7XDzGGhSv2frqapmXDwqnh7NyLDu3D6sMQOY/02GEB8PXwO8BuzcEIizU KNDt+ZC5c8pzlMK9cJNAcESo5J7d1DsJ9NF+hYaNMhrAWJnkZKHTbr3Q62/5SA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715173666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pg4QLfm6zF6A2I1D64bW5YWNd7m3UPxkOLoxkBi20gM=; b=Q4/SGKmZB4Wb9T3/v0QK6I/ehyRiBmvU/w1Z1t1dxv0p0Rus/cFq0+j8fNAiDgqDXvGj44 iQGi+paONGNCU5k6PbTyrk3a00kW82l+oFtXRq8S5MAl6V+dOO/08PVLnQMGxhSdQtUf0M 3rUpoUNvHs4vLBtDoiNQIs87Wz4ES6Sql7EE3LhpabeYf172/1QYLXgxIIlL4Tvz2WK7qh pEk29+9B/Hw7ZNQY+O4j8y4lsLaZOQagJ4OeDo2YNUluHNWYRwdLw/TTn9hEZydHz4A5FZ ZpR85eKNLM8WSeg32ylKjQ94RbeDk8BRY7TkngLf1caLmywaRp5M1Fa2egfFRg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZFmy07pTzQps; Wed, 8 May 2024 13:07:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 448D7jIr080337; Wed, 8 May 2024 13:07:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 448D7jOn080334; Wed, 8 May 2024 13:07:45 GMT (envelope-from git) Date: Wed, 8 May 2024 13:07:45 GMT Message-Id: <202405081307.448D7jOn080334@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: f55be6d9993a - stable/14 - tmpfs tests: Remove an xfail annotation List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f55be6d9993a552b48f26d75f2229569b6eef8b0 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f55be6d9993a552b48f26d75f2229569b6eef8b0 commit f55be6d9993a552b48f26d75f2229569b6eef8b0 Author: Mark Johnston AuthorDate: 2024-04-04 21:04:30 +0000 Commit: Mark Johnston CommitDate: 2024-05-08 13:06:16 +0000 tmpfs tests: Remove an xfail annotation This test passes after commit 08f3d5b60cdf ("copy_file_range: Call vn_rdwr() at least once"). PR: 274615 MFC after: 1 month (cherry picked from commit 8eb21b4ff0082a707517f805cf14616f91d9218e) --- contrib/netbsd-tests/fs/tmpfs/t_times.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/contrib/netbsd-tests/fs/tmpfs/t_times.sh b/contrib/netbsd-tests/fs/tmpfs/t_times.sh index 2d8eb6f67aa0..7b3be8d98d03 100755 --- a/contrib/netbsd-tests/fs/tmpfs/t_times.sh +++ b/contrib/netbsd-tests/fs/tmpfs/t_times.sh @@ -70,8 +70,6 @@ holey_head() { atf_set "require.user" "root" } holey_body() { - atf_expect_fail "https://bugs.freebsd.org/274615" - test_mount atf_check -s eq:0 -o empty -e empty truncate -s 8k a From nobody Wed May 8 13:07:47 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZFmz3p3Yz5J5wH; Wed, 08 May 2024 13:07: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 4VZFmz1B2Kz4RKV; Wed, 8 May 2024 13:07:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715173667; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3bbXswtIV06Ztoo3qgTmQSwDk5s+XZ/3agEvimRMLSw=; b=rMokJxxvs2chwtr+eVwQW/ibxDC0xvLYaitUgRJacw6mW8pjYlRFHYf+A9hdF7AXhi1/dp p6FZpbUbv7NsTD1fPP7MaTpPv3P4wt6FGy/iXpfgDl0l56A3SB1TZ2S0fKBFnBziK+0QhX mhRrfvHNr+/yjbac8IcggW9qr5kh43MHAqA+fUqfc6KU0faPJMmnvn7DPcv9RCPlaVrlgg zL3KjqS+09uXw1ETiRDWfnbK0OKi9IkfzdOrbt6TFkGHF34v8DaIwtJU/a4DMxvHgEBdcR Twhzoqk74P5Equxww92Fgpgz4uUzm1N4928r/H2amPbqnaDsIt3nWNHOJ1clFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715173667; a=rsa-sha256; cv=none; b=PDkA4N2NdZBibv4p/CAsOeClkEb4Vz1jnOCqIbGoq3LKqGaLCztnU6r5GJ1u4L/+WdE2qd qeyXsp5FfecqqpZfsNWR+kIoauzn/NPtjHqyT+WhKQhir19OXLVbKNPBOvvdokD+ArBwLb qjQl41AcELj0E4ruc7fw7g2wyymg85BFSPbqGyRG2lLb2PtUTNsysdAQxnSm4KXnj+9qCb inXq4FNnK4l+TrRdNyeyqv/qa4bYs1FAZPKunVm0v3PFiA35cjWvhan5yGY750Z9z2+sdw ewD2T/GnKH+hhRsYkZ+Qiplf3tGjIiC5rL/BsPAwTSX+sVW4aj28WLgd0OFqaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715173667; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3bbXswtIV06Ztoo3qgTmQSwDk5s+XZ/3agEvimRMLSw=; b=e2qSJiS2SvTA8qVPZDOKikhjQafuf66tRm/SVfSDuveDgSYJKOy1AaJm8n8trmAxRctY2I FKf5Mct54IatOVCCjgaJdQkCKaznQrPaPIn3RFcBqcmQ9k8+XM6rgg17xYo0q2XkBnVuQo +iGn+KefXMKWl7ncjlsTRkKLoLs5SAtxt8wQPeqDyXqnEzAWOPWgjCp/LEGQVpLg93R42M OKmDMjE3jjENbuD7gROgO7jWE+FeQsWLVfj1N3uiUBv0jtysbAiGw6+hM4bq0qwSt6mArI cIHCj0Gvze2PsXeBfcgvLwRUhvxupydIrtp0QqBqzo9CByzWwIu5PhMBkmFfbQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZFmz0nKZzQYN; Wed, 8 May 2024 13:07:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 448D7li7080389; Wed, 8 May 2024 13:07:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 448D7lV8080386; Wed, 8 May 2024 13:07:47 GMT (envelope-from git) Date: Wed, 8 May 2024 13:07:47 GMT Message-Id: <202405081307.448D7lV8080386@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 95cb70275609 - stable/14 - arm: Remove duplicate definitions in armreg.h List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 95cb7027560939cc2f78dcf9230abba42707d3a7 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=95cb7027560939cc2f78dcf9230abba42707d3a7 commit 95cb7027560939cc2f78dcf9230abba42707d3a7 Author: Mark Johnston AuthorDate: 2024-04-30 20:31:11 +0000 Commit: Mark Johnston CommitDate: 2024-05-08 13:06:16 +0000 arm: Remove duplicate definitions in armreg.h No functional change intended. MFC after: 1 week (cherry picked from commit 4a5e2ddbd8943baf7add831ab835594ac60f94d1) --- sys/arm/include/armreg.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/arm/include/armreg.h b/sys/arm/include/armreg.h index 8beef9b31022..819355111909 100644 --- a/sys/arm/include/armreg.h +++ b/sys/arm/include/armreg.h @@ -41,8 +41,6 @@ #ifndef MACHINE_ARMREG_H #define MACHINE_ARMREG_H -#define INSN_SIZE 4 -#define INSN_COND_MASK 0xf0000000 /* Condition mask */ #define PSR_MODE 0x0000001f /* mode mask */ #define PSR_USR32_MODE 0x00000010 #define PSR_FIQ32_MODE 0x00000011 From nobody Wed May 8 13:07:48 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZFn065tXz5J5yf; Wed, 08 May 2024 13:07: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 4VZFn01y7Hz4RHf; Wed, 8 May 2024 13:07:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715173668; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MScV+4zteSe96cfncBUFEr9G6wwjVIN1H958S2J9nEo=; b=NL6cHi5p5G6/CtspVvvIUBh9MGvrhhytEkjQYaXa+naOBgwZaPZ+t4Nq7l9EXQqSFBZMhf 6GAgs45qt2nyiJMxLkLyIfk3jT5utvfeRciJZrBIznoUKM+bLe5Qw5ZR6Xx4n7/pOG+Smj jx7stcZ3TiNmelfSw1b+lZ6boLDRy1fDzNhunqIgBLyWr0wXr4FBQWuWZqdVWl9vnRDJsu sSEe+Q3iRS1hy+ZVpe6Yy6SLLq/5pglSCd1O4fp/PAXTxhrBuSaud5Wf4qGNPmOeacf7Yi FVmqu5CWAgzZj/EUW79pvYSsDw3/PX9UT7RjeLdkxGW0AUsTpGnYKlPauLBsrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715173668; a=rsa-sha256; cv=none; b=oa1NoM+nOB8mr5rAqP+Le9P4ES4kM0ljo8HtkwQcJxZCo1zT7olYqoc2MPtsUaawAGGUUy aN2iKK/vuJKAAYeJ7CbQE0GkDF7yx5JrOgdGRyl+jWnj0ntpHgL+OE0YWplVm4fjcLOxlp q2NTTXncXCcOUYCeX5Bhm/RI0uSHLdmKCKR7SSlgUzyMp8bSMy2Pc0sifh6EdxFbqvZPhk set2fpcH6XrvUXIhvuTgxtWeZhYtmBrhNcWoyE2ldcOUAPARMss31P3wANBM1zGlaoENCN PB8xLP3YMhC8tl1xpG6r9ScIugFrDbN5k6jc4RkBwRkr5rnbWi1Tac5omL0qDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715173668; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MScV+4zteSe96cfncBUFEr9G6wwjVIN1H958S2J9nEo=; b=jJzzglXs5VQSD6wA5eE3vpX0OUuiuIv89eWsJmTaNbA2pN5kQSo7ck3MPWELIVPVh4+GSF rjsmzoEBJNrM2V9CbDKdVLcRUK6h5CiCfc6DwE8+/YGTyKPRTMK3ooFlM0ASUNkw4PyMAI vMZMAa2mpYruCTp8OQk2Y/VTIInpKfc/pXJ7Gqs1lnJvdGevj0KkTqodOYvbw6uNzxO1L+ a6R1rNHDP08QJVuw+Hitpi6QUf+iIuov6wvTLidUst9r+pOG/IBmJXNOuqfwRp/2pxcsj4 mym7Jn6po8Cr57t6HbQ4r2m9//hKe88psbZFk7p1cXXLM+NrpwMLUPU/APSHBg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZFn01FqPzR1D; Wed, 8 May 2024 13:07:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 448D7mfq080425; Wed, 8 May 2024 13:07:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 448D7mG6080422; Wed, 8 May 2024 13:07:48 GMT (envelope-from git) Date: Wed, 8 May 2024 13:07:48 GMT Message-Id: <202405081307.448D7mG6080422@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: a709ac6f422b - stable/14 - ng_pipe: Fix whitespace List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a709ac6f422be26eb5230f3b508e4d6112bbf353 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a709ac6f422be26eb5230f3b508e4d6112bbf353 commit a709ac6f422be26eb5230f3b508e4d6112bbf353 Author: Martin Vahlensieck AuthorDate: 2024-04-17 18:50:39 +0000 Commit: Mark Johnston CommitDate: 2024-05-08 13:06:16 +0000 ng_pipe: Fix whitespace Signed-off-by: Martin Vahlensieck Reviewed by: markj MFC after: 2 weeks Pull Request: https://github.com/freebsd/freebsd-src/pull/1181 (cherry picked from commit 8512311fb5004444f43701eb122b6d77c76d7564) --- sys/netgraph/ng_pipe.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/netgraph/ng_pipe.c b/sys/netgraph/ng_pipe.c index a2966c9a0349..c2424e3db48a 100644 --- a/sys/netgraph/ng_pipe.c +++ b/sys/netgraph/ng_pipe.c @@ -34,7 +34,7 @@ * This node permits simple traffic shaping by emulating bandwidth * and delay, as well as random packet losses. * The node has two hooks, upper and lower. Traffic flowing from upper to - * lower hook is referenced as downstream, and vice versa. Parameters for + * lower hook is referenced as downstream, and vice versa. Parameters for * both directions can be set separately, except for delay. */ @@ -195,8 +195,8 @@ static const struct ng_cmdlist ngp_cmds[] = { { .cookie = NGM_PIPE_COOKIE, .cmd = NGM_PIPE_GET_STATS, - .name = "getstats", - .respType = &ng_pipe_stats_type + .name = "getstats", + .respType = &ng_pipe_stats_type }, { .cookie = NGM_PIPE_COOKIE, @@ -494,7 +494,7 @@ parse_cfg(struct ng_pipe_hookcfg *current, struct ng_pipe_hookcfg *new, if (new->qin_size_limit == -1) current->qin_size_limit = 0; - else if (new->qin_size_limit >= 5) + else if (new->qin_size_limit >= 5) current->qin_size_limit = new->qin_size_limit; if (new->qout_size_limit == -1) @@ -547,7 +547,7 @@ parse_cfg(struct ng_pipe_hookcfg *current, struct ng_pipe_hookcfg *new, } else if (new->bandwidth >= 100 && new->bandwidth <= 1000000000) current->bandwidth = new->bandwidth; - if (current->bandwidth | priv->delay | + if (current->bandwidth | priv->delay | current->duplicate | current->ber) hinfo->noqueue = 0; else @@ -686,9 +686,9 @@ ngp_rcvdata(hook_p hook, item_p item) } /* Drop a frame from the queue head/tail, depending on cfg */ - if (hinfo->cfg.drophead) + if (hinfo->cfg.drophead) ngp_h = TAILQ_FIRST(&ngp_f->packet_head); - else + else ngp_h = TAILQ_LAST(&ngp_f->packet_head, p_head); TAILQ_REMOVE(&ngp_f->packet_head, ngp_h, ngp_link); m1 = ngp_h->m; @@ -783,7 +783,7 @@ pipe_dequeue(struct hookinfo *hinfo, struct timeval *now) { hinfo->run.qin_octets -= m->m_pkthdr.len; ngp_f->packets--; } - + /* Calculate the serialization delay */ if (hinfo->cfg.bandwidth) { hinfo->qin_utime.tv_usec += From nobody Wed May 8 13:07:49 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZFn14bxyz5J67s; Wed, 08 May 2024 13:07:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VZFn12l8Wz4RL3; Wed, 8 May 2024 13:07:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715173669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LgGe4Wmk/CN54WFfMHdZ9zyl1bT4KUb3V7AyxhRLo9Y=; b=EpmbQaXNqGRLkubrpMOrjCQU77zADasP4yGfxCU+YFyRTXA57YsgO1PZLYu3C0ERg1VmYe tG/Z/5LQ4C9m5n5xlLylTMGcZ/I7yosMvJqszEb9kim2VRcA4Ds8fXMhpLjkPXZ9ze4rhB 863fLt4PTlLDPGQMMFicSLVRKtUg9nPNXc3KYrIXEtuJ3tYHWWNH2k9/mR+VM3GpV5fJdc B7/ZrHDNQnBGMPCajT4cjz/8Ma0Au2QJ40T5c8sb8F7FbBzKBTBgfIzu13uY0+dEOr8oEI lSwj6+TXHln/jGZ6Neeq3xcvSnROYN1Mf/5ssXL8si1vo6rFk3fVwtWuUnaZCQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715173669; a=rsa-sha256; cv=none; b=E3l2/ssukWnJZfFI2nBOTxppSlqORrlrHhTQPAV8QHpo8hkxoWy+Ugt89JKRXq+oDk6llV TTgPADxZfEdOzN1bcRufvByekrhJZTsWEE4pLyvIoCudTICe6NQYPuB+yeomPZoVuSVXW6 cTMTFKubZ8hNZSknrJ6eSBHxp4WoWJlmGU64QleaiHY50nOBqDlzv4HWdGySIgfQNL+YRS KjlBXzIoQfuLXwO8QzBewUdWW4S7ND/unfghdo+1WHWHXPP/FtdV5koGvSl4gNcFl4O0o7 H30A4jKT0xYwgj3e+rkfkcU+iHBLGK0ZUzQcMIuvKAKCUTySJie+t1BhBK7N7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715173669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LgGe4Wmk/CN54WFfMHdZ9zyl1bT4KUb3V7AyxhRLo9Y=; b=XCZvsBCTXjRaoqCfocbF7DnB9xu9AVPjTRakGHr+q0rlx6CuS57jPWEMndZg/vpcaCPcaj +QpE4J2jILZsz+rzO+G6gw1H8vQwhkiORnEvWjfGt4tpNlfg5Ceh9AZRMJ+5WBV9l2LwaK GJV/pTNXMLdUTdmljaWeSQqCYTGBi3N719a3v2iIU46uH7h/sJbeIiGjoFNNI2HAWhtDqZ E6cldcMoQbPt9YynbPTqABQUkU+6nZjwQ3nSQCMO0yBNSsPPaHoytBkJkqVmb8PRUksJVp PVr1uGphF4zTmkz58yOejJv5ika5q42/hixT9Xj7vznPFT4w2xMaXKKco0EtOg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZFn12JvBzR1F; Wed, 8 May 2024 13:07:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 448D7nDq080480; Wed, 8 May 2024 13:07:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 448D7nQI080477; Wed, 8 May 2024 13:07:49 GMT (envelope-from git) Date: Wed, 8 May 2024 13:07:49 GMT Message-Id: <202405081307.448D7nQI080477@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: a3ca254e6986 - stable/14 - ng_pipe: Remove node when all hooks are disconnected List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a3ca254e698698cfa130770f3c5c12f7fd9b5685 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a3ca254e698698cfa130770f3c5c12f7fd9b5685 commit a3ca254e698698cfa130770f3c5c12f7fd9b5685 Author: Martin Vahlensieck AuthorDate: 2024-04-17 18:51:40 +0000 Commit: Mark Johnston CommitDate: 2024-05-08 13:06:16 +0000 ng_pipe: Remove node when all hooks are disconnected This is the behavior described in the man page. Signed-off-by: Martin Vahlensieck Discussed with: glebius Reviewed by: markj MFC after: 2 weeks Pull Request: https://github.com/freebsd/freebsd-src/pull/1181 (cherry picked from commit bb2ab7a374b9d81f8368acc506c9700af20a22d6) --- sys/netgraph/ng_pipe.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/netgraph/ng_pipe.c b/sys/netgraph/ng_pipe.c index c2424e3db48a..7afaf24f5914 100644 --- a/sys/netgraph/ng_pipe.c +++ b/sys/netgraph/ng_pipe.c @@ -936,6 +936,7 @@ ngp_disconnect(hook_p hook) struct hookinfo *const hinfo = NG_HOOK_PRIVATE(hook); struct ngp_fifo *ngp_f; struct ngp_hdr *ngp_h; + priv_p priv; KASSERT(hinfo != NULL, ("%s: null info", __FUNCTION__)); hinfo->hook = NULL; @@ -962,6 +963,12 @@ ngp_disconnect(hook_p hook) if (hinfo->ber_p) free(hinfo->ber_p, M_NG_PIPE); + /* Destroy the node if all hooks are disconnected */ + priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); + + if (priv->upper.hook == NULL && priv->lower.hook == NULL) + ng_rmnode_self(NG_HOOK_NODE(hook)); + return (0); } From nobody Wed May 8 13:07:50 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZFn25SyMz5J5t2; Wed, 08 May 2024 13:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VZFn241Sqz4Rbn; Wed, 8 May 2024 13:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715173670; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iSvlP3FD8U7fe1qGCTM7ISszpDVCqyEFkDSeZEKcO2A=; b=GirbNzcnXRVt4Uux65kVvS54IA2ngmXtSfC4g1eMBh1t8RzZDT4Kavzlk3NKlVgQesIvJQ XxSeqCXEnLjEeF014m1R+mkND6y6DM6qql60wG+4dtJD61grJZf46jfXYJdJ0nK53SOFMQ vES5/z/1eR2nWSdgdRb4tMl3aAHK4NEYg+S/oNexf1Z9cDAlngZZ5VHCcE8gXRQ8fZe8Eu JyZTfxqbCiFh40spImtWzoH4g3+qLICkLhZCyPlkletZUFGBe0Jk/4U1mRSUiZoRzK0kal YXDAIwvmTgZFkvZl/LMbvIotej2oPmBzu9UYPXZzQ5nwp1kHRqxoFN9c2JtYpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715173670; a=rsa-sha256; cv=none; b=KHYpy8VuNnvp3XVNt/Ip9nX7q/IJAAEYonsWmOyp9I46k2C529UQCl3oR+WjdTAcB8YCHC AyHEwJjLkHT851dUiRCrY6el2njPB0eCnwVkcox3P999n2TuuYXhGBBBnFKgpbhKBJhz1R kLMX68x/7JaWkUMJMxAQXnXYFFJMKXEegYqv8ZWECvlJccHGHsCg4idS6SzP6YPFwnxK6X xTYQbXVZKIboekpT2ekueZZswgZ3twusIPI17YpP68n+K8Rq74R3oC5GhGBlGtmZyWTpgk tYG4FLKQG0JsLWN8GHpWoJAeEDdGmfrgfgHZ+YjG/DAE90D+8c7l9gtfXe54pA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715173670; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iSvlP3FD8U7fe1qGCTM7ISszpDVCqyEFkDSeZEKcO2A=; b=QR6QYJkeWW1LfFBlZy4TDTikvfOiXZ5GHri79n8ILJDskOC26FlhnHragua8EdvXsbO4jl SNraTVK4EvGhb7R4Ucno7VfcdfRfNDO84ljssxa6SSsJyE4EjfZKZ9GdhY1yqFIwWRp/kP mV5Bzmlxfs6aj0Cv1cj0Fo+HG9FRpWOZQeeZH2HyEpnJc7rhJ1SSSUh58u85Spqp/jZJ7/ QiKTJZiGFBBk17cNkVQ5Yev25kQDrudbQEyUFp9bplq4pElCMMZp3K3+qPIil3bGz24OFJ pWRvJnSkEZD4lCuRWrsoeDEBg/ODh0TleXC+bUwcWJ5DkdErVyGBg5EqBLkwRw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZFn23dXbzQpt; Wed, 8 May 2024 13:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 448D7oUO080527; Wed, 8 May 2024 13:07:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 448D7oXX080524; Wed, 8 May 2024 13:07:50 GMT (envelope-from git) Date: Wed, 8 May 2024 13:07:50 GMT Message-Id: <202405081307.448D7oXX080524@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: f4ab464d3492 - stable/14 - ng_pipe: Replace deprecated random() with prng32_bounded() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f4ab464d3492c8ad6d3d0a4851e382e40d438a19 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f4ab464d3492c8ad6d3d0a4851e382e40d438a19 commit f4ab464d3492c8ad6d3d0a4851e382e40d438a19 Author: Martin Vahlensieck AuthorDate: 2024-04-17 18:59:22 +0000 Commit: Mark Johnston CommitDate: 2024-05-08 13:06:16 +0000 ng_pipe: Replace deprecated random() with prng32_bounded() Signed-off-by: Martin Vahlensieck MFC after: 2 weeks Reviewed by: markj Pull Request: https://github.com/freebsd/freebsd-src/pull/1181 (cherry picked from commit a3ecf8c7863683e53c77a17f96ab7012352265b9) --- sys/netgraph/ng_pipe.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/netgraph/ng_pipe.c b/sys/netgraph/ng_pipe.c index 7afaf24f5914..d368c142b1ab 100644 --- a/sys/netgraph/ng_pipe.c +++ b/sys/netgraph/ng_pipe.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -771,7 +772,7 @@ pipe_dequeue(struct hookinfo *hinfo, struct timeval *now) { * the original packet... */ if (hinfo->cfg.duplicate && - random() % 100 <= hinfo->cfg.duplicate) { + prng32_bounded(100) <= hinfo->cfg.duplicate) { ngp_h = uma_zalloc(ngp_zone, M_NOWAIT); KASSERT(ngp_h != NULL, ("ngp_h zalloc failed (3)")); m = m_dup(m, M_NOWAIT); @@ -814,7 +815,7 @@ pipe_dequeue(struct hookinfo *hinfo, struct timeval *now) { /* Randomly discard the frame, according to BER setting */ if (hinfo->cfg.ber) { oldrand = rand; - rand = random(); + rand = prng32_bounded(1U << 31); if (((oldrand ^ rand) << 17) >= hinfo->ber_p[priv->overhead + m->m_pkthdr.len]) { hinfo->stats.out_disc_frames++; From nobody Wed May 8 13:07:51 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZFn41R3Fz5J5yp; Wed, 08 May 2024 13:07: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 4VZFn35fGNz4Rdr; Wed, 8 May 2024 13:07:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715173671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uV//S0DtZYWbKV8VmCTV/nrujb8RREMvt+x8tDwKnS8=; b=eUCTzU4Mzyi/qgo00sAWOpxTwtK4bRUHbKQ/1MoVz1qTXP47KjPP183yN9SUdldRk42+GU ImQApJL6hfY9BulwGB5ga440HBBL6snQ5R0pqRbBIEuufEyMPVDzdlpRJEzsxyPFL0kEtu qHExCOSbgEl7msaZhIyI+ZEsb+f15kugg5AHlPIHcNkc42HJo1mIMRQ7B2keMMfiirqgbZ h00e3w3ECI5s5Y4XroETbQca3G0mPQ/xTSigsGFxvFEAATokeJoxDUtlKUuOm2XJLoG3Te qSgnW+Ei1OjTD36sqj2vxI+W2hnnQaH0/xj66w8lsF/IXjQSJACcfS0nkYcnyw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715173671; a=rsa-sha256; cv=none; b=pklQ2KHaofBMrrDtA/8Uwm2TBNnjdFEn220JQaFLInODo+twfDwYBNtZBqjLmJEMJGCrUj K6GSZfznMNw36TZNU7D57pM7sY2RYgBEfaWpAcV84r+/6v2w5xEliaI1xwtAc8OARxm2rQ tcVQLYg9UCNZWSP/W1wW/7gs4BiX2Tbtc5PzgZPd2opV614kPQSTEm6jWlMoqSWWjJAKFF /ct0bMFrLVe1mWQrnFZEpKn71Bz+SYU3HXDnevDQtIx7fu+p19K5lzt5ZMtxg3loRxFC0r /J27gzlI0vUbDzzh/LKE+ziA9CZjIipbD5tyRAIzb8diCGQQbrrEafgbgukepQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715173671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uV//S0DtZYWbKV8VmCTV/nrujb8RREMvt+x8tDwKnS8=; b=cMNYLtbykymVxo88f0YLBsK/O5of7A+IIMo59CvktBVbzAVnnOaEJBXr+N3vvS6YEthhxQ Vqi2+hGgEYH9TrnHfhF7AYwccxgVptlBtpaObcR+BXxGmReHLftXZdYcOcZb0jY6lxcAho GbD7X4WdtKLMBiFZ+l2/tLtCJPv2uIcjE7GtDhODpsWbMi9akIA9LUmJUglyZpeyfGY5UF /g4te5vVAOI+F9h/wsf5SaOMOP6/NdoztWUByycGsiAfJUWIHt8B22z10c0p6H+xsYM6WK kiz5q/YnL2Hg6qO/7VqBk+ncyB7e8invUeePcf36s4/4c3rjD1E37vom5Cc3kQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZFn34fjFzQk7; Wed, 8 May 2024 13:07:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 448D7psi080578; Wed, 8 May 2024 13:07:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 448D7pxe080575; Wed, 8 May 2024 13:07:51 GMT (envelope-from git) Date: Wed, 8 May 2024 13:07:51 GMT Message-Id: <202405081307.448D7pxe080575@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 50af25e87422 - stable/14 - ng_pipe: Do not panic when memory allocations fail List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 50af25e87422f2efa42104ed7ad5142f7b4948be Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=50af25e87422f2efa42104ed7ad5142f7b4948be commit 50af25e87422f2efa42104ed7ad5142f7b4948be Author: Martin Vahlensieck AuthorDate: 2024-04-17 19:01:34 +0000 Commit: Mark Johnston CommitDate: 2024-05-08 13:06:16 +0000 ng_pipe: Do not panic when memory allocations fail Signed-off-by: Martin Vahlensieck Reviewed by: markj MFC after: 2 weeks Pull Request: https://github.com/freebsd/freebsd-src/pull/1181 (cherry picked from commit d44c78074d8738db67a2fa6bf07b630c61eee6ab) --- sys/netgraph/ng_pipe.c | 45 ++++++++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/sys/netgraph/ng_pipe.c b/sys/netgraph/ng_pipe.c index d368c142b1ab..42a5991e8dc7 100644 --- a/sys/netgraph/ng_pipe.c +++ b/sys/netgraph/ng_pipe.c @@ -641,12 +641,14 @@ ngp_rcvdata(hook_p hook, item_p item) } /* Populate the packet header */ - ngp_h = uma_zalloc(ngp_zone, M_NOWAIT); - KASSERT((ngp_h != NULL), ("ngp_h zalloc failed (1)")); NGI_GET_M(item, m); - KASSERT(m != NULL, ("NGI_GET_M failed")); - ngp_h->m = m; NG_FREE_ITEM(item); + ngp_h = uma_zalloc(ngp_zone, M_NOWAIT); + if (ngp_h == NULL) { + NG_FREE_M(m); + return (ENOMEM); + } + ngp_h->m = m; if (hinfo->cfg.fifo) hash = 0; /* all packets go into a single FIFO queue */ @@ -659,7 +661,11 @@ ngp_rcvdata(hook_p hook, item_p item) break; if (ngp_f == NULL) { ngp_f = uma_zalloc(ngp_zone, M_NOWAIT); - KASSERT(ngp_h != NULL, ("ngp_h zalloc failed (2)")); + if (ngp_f == NULL) { + NG_FREE_M(ngp_h->m); + uma_zfree(ngp_zone, ngp_h); + return (ENOMEM); + } TAILQ_INIT(&ngp_f->packet_head); ngp_f->hash = hash; ngp_f->packets = 1; @@ -733,7 +739,7 @@ pipe_dequeue(struct hookinfo *hinfo, struct timeval *now) { const priv_p priv = NG_NODE_PRIVATE(node); struct hookinfo *dest; struct ngp_fifo *ngp_f, *ngp_f1; - struct ngp_hdr *ngp_h; + struct ngp_hdr *ngp_h, *ngp_dup; struct timeval *when; struct mbuf *m; int plen, error = 0; @@ -768,16 +774,27 @@ pipe_dequeue(struct hookinfo *hinfo, struct timeval *now) { } /* - * Either create a duplicate and pass it on, or dequeue - * the original packet... + * Either create a duplicate and pass it on, or + * dequeue the original packet. When any of the + * memory allocations for the duplicate package fail, + * simply do not duplicate it at all. */ + ngp_dup = NULL; if (hinfo->cfg.duplicate && prng32_bounded(100) <= hinfo->cfg.duplicate) { - ngp_h = uma_zalloc(ngp_zone, M_NOWAIT); - KASSERT(ngp_h != NULL, ("ngp_h zalloc failed (3)")); - m = m_dup(m, M_NOWAIT); - KASSERT(m != NULL, ("m_dup failed")); - ngp_h->m = m; + ngp_dup = uma_zalloc(ngp_zone, M_NOWAIT); + if (ngp_dup != NULL) { + ngp_dup->m = m_dup(m, M_NOWAIT); + if (ngp_dup->m == NULL) { + uma_zfree(ngp_zone, ngp_dup); + ngp_dup = NULL; + } + } + } + + if (ngp_dup != NULL) { + ngp_h = ngp_dup; + m = ngp_h->m; } else { TAILQ_REMOVE(&ngp_f->packet_head, ngp_h, ngp_link); hinfo->run.qin_frames--; @@ -983,8 +1000,6 @@ ngp_modevent(module_t mod, int type, void *unused) ngp_zone = uma_zcreate("ng_pipe", max(sizeof(struct ngp_hdr), sizeof (struct ngp_fifo)), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - if (ngp_zone == NULL) - panic("ng_pipe: couldn't allocate descriptor zone"); break; case MOD_UNLOAD: uma_zdestroy(ngp_zone); From nobody Wed May 8 13:07:52 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZFn50sNhz5J64G; Wed, 08 May 2024 13:07: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 4VZFn46029z4RQm; Wed, 8 May 2024 13:07:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715173672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UQ5lcEoMJDWv7M/obx5L3hpbmXvpDWZaltTALlYVFB0=; b=gz+fG/QYRB+iVf/WiIZ5X7q9qcwVmvvKDkz4srecMznUrD9+cs+xLpfzWumNoTtQdRQu9N HnNEIR8Tx0mK3kXdxodGLKBySukv/j70tqQbwFxetzlQl2MkoRskESl6VycAaqfUnZRfqu E4IL8KWo51GTDb3mzRKQIzkX4owsv5N6Nk6u4DdH6D4XYUmp4/tccLoc/KGgyY5HBusoPM 6WadczXoRv6YK9YX+AO2Mt0shl4aC/p2L+THgKVkYKJdW8Xf7LZxDsk2mziXQlauLw+APk 65IEVw2WVPgPqBJNP5UcKz9uu5xF/Csgpb753pnvIBXJ8DOWSc6OAfPYVUg6Aw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715173672; a=rsa-sha256; cv=none; b=gqeNg7oeAhHkbxO4FywJzK4CSw8IcRTtQpjwvT8huT+UlcHHO+gHIeLUGoOv++doaJrEvU fuRNEoS5e0gcF41QyiF5xAqCnPbnKPKj/J3T9x2GX4jfsGHtspjtd57O7SREDi9zRMta0v TYrI/nTxHiIhJHBoo7wt2v5YdCTGLrcdXAGPqmSXCsafDj3Trzjszcx/g7QEcPg+Jmcc7P /huCYxQD+PFl2ik+W5Kms+F/vHk9F8bdUTNeK3J38AcD/W5TAsNdBSSPN4SorZt24J5d+a Hhjh5GvdhRtS6+Vy7QqCWTPtj0rBNttIB5Vz2d2Iqrw+K3NXx46bCPTrXrfQQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715173672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UQ5lcEoMJDWv7M/obx5L3hpbmXvpDWZaltTALlYVFB0=; b=IZXjfRgbzYGc0peBFCEipj1QurJl0kAFJ1b4LqBnrFOQk+kvDXsmlpOpcoI2++FQfFHe84 d2A2KKtrIILzQEldIxv3MJLlOBXJHI3biYWMezzAnQaUpQ1yTPnb8NSr+hTgsgn4N7EYVz +z+kaLOd9FGvZYijv8L0cAu2BKQrmDXHeYb6+4ukCQ2Zq+c4ra8cOrl93biJtultTohk73 XdYsha/zJDkJPRDnUL719BiWUcYHW/jwEpNCHebmMhxHwBiHwS6OsaJZy0yGOEIp5kj++B BmPNHxtcgMiaGBvgq8qUevey47WUL7I9CBGlQhQ91j8Kwoy40Xy7qdgF0A2Evw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZFn45RWXzQYP; Wed, 8 May 2024 13:07:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 448D7qZb080644; Wed, 8 May 2024 13:07:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 448D7qBQ080641; Wed, 8 May 2024 13:07:52 GMT (envelope-from git) Date: Wed, 8 May 2024 13:07:52 GMT Message-Id: <202405081307.448D7qBQ080641@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 7b65987885da - stable/14 - sdt: Add macros which expand to probe and provider structure names List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7b65987885dad97b92628698562a6f3f139d2580 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7b65987885dad97b92628698562a6f3f139d2580 commit 7b65987885dad97b92628698562a6f3f139d2580 Author: Mark Johnston AuthorDate: 2024-05-01 11:17:29 +0000 Commit: Mark Johnston CommitDate: 2024-05-08 13:06:16 +0000 sdt: Add macros which expand to probe and provider structure names No functional change intended. MFC after: 1 week (cherry picked from commit 4afce4473db4f51acd034333b8506294b4fb61e6) --- sys/sys/sdt.h | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/sys/sys/sdt.h b/sys/sys/sdt.h index ba3dcfa15762..20be685ad081 100644 --- a/sys/sys/sdt.h +++ b/sys/sys/sdt.h @@ -147,36 +147,41 @@ SET_DECLARE(sdt_providers_set, struct sdt_provider); SET_DECLARE(sdt_probes_set, struct sdt_probe); SET_DECLARE(sdt_argtypes_set, struct sdt_argtype); +#define _SDT_PROBE_NAME(prov, mod, func, name) \ + sdt_##prov##_##mod##_##func##_##name +#define _SDT_PROVIDER_NAME(prov) \ + sdt_provider_##prov + #define SDT_PROVIDER_DEFINE(_prov) \ - struct sdt_provider sdt_provider_##_prov[1] = { \ + struct sdt_provider _SDT_PROVIDER_NAME(_prov)[1] = { \ [0] = { .name = #_prov }, \ }; \ - DATA_SET(sdt_providers_set, sdt_provider_##_prov); + DATA_SET(sdt_providers_set, _SDT_PROVIDER_NAME(_prov)) -#define SDT_PROVIDER_DECLARE(prov) \ - extern struct sdt_provider sdt_provider_##prov[1] +#define SDT_PROVIDER_DECLARE(prov) \ + extern struct sdt_provider _SDT_PROVIDER_NAME(prov)[1] #define SDT_PROBE_DEFINE(_prov, _mod, _func, _name) \ - struct sdt_probe sdt_##_prov##_##_mod##_##_func##_##_name[1] = {\ + struct sdt_probe _SDT_PROBE_NAME(_prov, _mod, _func, _name)[1] = { \ [0] = { \ .version = sizeof(struct sdt_probe), \ - .prov = sdt_provider_##_prov, \ + .prov = _SDT_PROVIDER_NAME(_prov), \ .mod = #_mod, \ .func = #_func, \ .name = #_name, \ }, \ }; \ - DATA_SET(sdt_probes_set, sdt_##_prov##_##_mod##_##_func##_##_name) + DATA_SET(sdt_probes_set, _SDT_PROBE_NAME(_prov, _mod, _func, _name)) -#define SDT_PROBE_DECLARE(prov, mod, func, name) \ - extern struct sdt_probe sdt_##prov##_##mod##_##func##_##name[1] +#define SDT_PROBE_DECLARE(prov, mod, func, name) \ + extern struct sdt_probe _SDT_PROBE_NAME(prov, mod, func, name)[1] #define SDT_PROBES_ENABLED() __predict_false(sdt_probes_enabled) #define SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) do { \ if (SDT_PROBES_ENABLED()) { \ - if (__predict_false(sdt_##prov##_##mod##_##func##_##name->id)) \ - (*sdt_probe_func)(sdt_##prov##_##mod##_##func##_##name->id, \ + if (__predict_false(_SDT_PROBE_NAME(prov, mod, func, name)->id)) \ + (*sdt_probe_func)(_SDT_PROBE_NAME(prov, mod, func, name)->id, \ (uintptr_t) arg0, (uintptr_t) arg1, (uintptr_t) arg2, \ (uintptr_t) arg3, (uintptr_t) arg4); \ } \ @@ -189,7 +194,7 @@ SET_DECLARE(sdt_argtypes_set, struct sdt_argtype); .ndx = _num, \ .type = _type, \ .xtype = _xtype, \ - .probe = sdt_##_prov##_##_mod##_##_func##_##_name, \ + .probe = _SDT_PROBE_NAME(_prov, _mod, _func, _name), \ }, \ }; \ DATA_SET(sdt_argtypes_set, \ @@ -322,21 +327,21 @@ SET_DECLARE(sdt_argtypes_set, struct sdt_argtype); SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) #define SDT_PROBE6(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, arg5) \ do { \ - if (sdt_##prov##_##mod##_##func##_##name->id) \ + if (_SDT_PROBE_NAME(prov, mod, func, name)->id) \ (*(void (*)(uint32_t, uintptr_t, uintptr_t, uintptr_t, \ uintptr_t, uintptr_t, uintptr_t))sdt_probe_func)( \ - sdt_##prov##_##mod##_##func##_##name->id, \ + _SDT_PROBE_NAME(prov, mod, func, name)->id, \ (uintptr_t)arg0, (uintptr_t)arg1, (uintptr_t)arg2, \ (uintptr_t)arg3, (uintptr_t)arg4, (uintptr_t)arg5);\ } while (0) #define SDT_PROBE7(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, arg5, \ arg6) \ do { \ - if (sdt_##prov##_##mod##_##func##_##name->id) \ + if (_SDT_PROBE_NAME(prov, mod, func, name)->id) \ (*(void (*)(uint32_t, uintptr_t, uintptr_t, uintptr_t, \ uintptr_t, uintptr_t, uintptr_t, uintptr_t)) \ sdt_probe_func)( \ - sdt_##prov##_##mod##_##func##_##name->id, \ + _SDT_PROBE_NAME(prov, mod, func, name)->id, \ (uintptr_t)arg0, (uintptr_t)arg1, (uintptr_t)arg2, \ (uintptr_t)arg3, (uintptr_t)arg4, (uintptr_t)arg5, \ (uintptr_t)arg6); \ From nobody Wed May 8 15:25:52 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZJrK1ZvTz5JLq2; Wed, 08 May 2024 15:25: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 4VZJrK1LpCz4jLJ; Wed, 8 May 2024 15:25:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715181953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N/8Vck1V/qYrugzHU1COeEZRlrFxiLEBbG2fUB/DrNk=; b=i2lImALP/d30jTeGJ43DHBiMByqcxAHAaMKQfVOc9Ynvjb5vFj1+LjVkio5Lo43XvAAnJQ 6Uf7RphQf+OtqyPBa+mLE9LL46EaFMPsC5tdoI5NuPU0Um0ol4AIqSTOgxZSBFMCFnsnca FRZZGmTnvHyUJNRa7WEK3ymdRfeM4zHrF6vOhv/4ACog8jxK2nKXcG7fyWRKNtDJD40jSw vtyTfq7+HALVwcEoxfS1n9oV0pABf7boG+Bqc/zFFtnhU0cjyUVdys+Yoxuika3EJCoD7w mnBQYa3NHoGzXteulvX60gtqmlq+XCMLb9goJ2WOitXo81/s6dRX2CTpZQ/zBA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715181953; a=rsa-sha256; cv=none; b=FG7xnSaAKifoOi/j7rMqqUQ3MZaoFwTql2Qo/3QUQlbnDGYwdqC+xziBjfj3aiLkufN29d 7st1Kp1F/aJeAycBTuqc9XeBKWD9HMmGSGhohg0RVyTCfMmKKBS2Cb6tEfxOVSVVQNRd0B JeNuoBWT944o+WzBWH8XMC2ahxm2uAaTrdz5/GFMQVkllmHS8vegLpQtVwo6u82qZGAmox KTS5fIxjFIYtXQeHL9nxQv29/OfAtSqNtXxeBG84DLzlsOBX6tkqhMFCIL7a9CItRTmm8H CBZYrEnBCVsGQ7vsvFOHLfvMwQDykVVxOa2vWoojfVRsK9iMVm4pXSXMLmRNxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715181953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N/8Vck1V/qYrugzHU1COeEZRlrFxiLEBbG2fUB/DrNk=; b=modKRVqZeQkSfSZ94t0T+nwhvpKihohRRC9/lZnGa50xSY/+j5ZGXKyrUAfMkvIHoLuosg /O4rsn3oSM2qqKIS/F+xmEMCD2CkiSNBdoP8/azVrIprt28i/kg04Gmd/WoxThOT9wKRVS CMUjgCs/zcwJ+B3DrYtQ9hqJKbHYNEtMz/r5/vVbg0mRn/kWRRCsrU7dXPsemfysOxYoUo B2vOKlbaq5nPlcOQq8OjhcP2iqYlKc4uS0dbmPQAT17qED1ZNgDHxRhL7LPjMP3AKeuFM6 XZY5OONg/ATCw/3I6TLJ6Rsfb9eKNI1D6v182yKxDnXjcNiDdOC1NZUFlFB6fw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZJrK0m6ZzVyD; Wed, 8 May 2024 15:25:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 448FPrbj016665; Wed, 8 May 2024 15:25:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 448FPqaW016662; Wed, 8 May 2024 15:25:52 GMT (envelope-from git) Date: Wed, 8 May 2024 15:25:52 GMT Message-Id: <202405081525.448FPqaW016662@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 78c9d8f1ce65 - releng/14.1 - zfs: merge openzfs/zfs@256659204 (zfs-2.2-release) into stable/14 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 78c9d8f1ce655f10368c06272f5e320b8a263612 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=78c9d8f1ce655f10368c06272f5e320b8a263612 commit 78c9d8f1ce655f10368c06272f5e320b8a263612 Author: Martin Matuska AuthorDate: 2024-05-03 21:51:01 +0000 Commit: Martin Matuska CommitDate: 2024-05-08 15:24:29 +0000 zfs: merge openzfs/zfs@256659204 (zfs-2.2-release) into stable/14 OpenZFS release 2.2.4 Notable upstream pull request merges: #15076 fdd97e009 Refactor dmu_prefetch() #15225 5972bb856 Use ASSERT0P() to check that a pointer is NULL #15381 7ea833100 ZIL: Detect single-threaded workloads #15515 8b1a132de ZIO: Optimize zio_flush() #15225 d6da6cbd7 Clean up existing VERIFY*() macros #15225 5dda8c091 Add VERIFY0P() and ASSERT0P() macros #15436 61f3638a3 Add prefetch property #15509 6f323353d Add ashift validation when adding devices to a pool #15539 ea3f7c12a Extend import_progress kstat with a notes field #15635 25ea8ce94 ZIL: Improve next log block size prediction #15784 16c223eec Do no use .cfi_negate_ra_state within the assembly on Arm64 #15839 706307445 vdev probe to slow disk can stall mmp write checker #15879 86b39b41a zpool: Fix locale-specific time #15927 fa5de0c5c Update resume token at object receive #15941 fdd8c0aea BRT: Skip duplicate BRT prefetches #15942 889152ce4 Give better message from 'zpool get' with invalid pool name #15950 3e91a9c52 BRT: Skip getting length in brt_entry_lookup() #15951 19bf54b76 ZAP: Massively switch to _by_dnode() interfaces #15954 f7c1db636 BRT: Change brt_pending_tree sorting order #15955 457e62d7c BRT: Relax brt_pending_apply() locking #15967 c94f73007 BRT: Make BRT block sizes configurable #15976 dced953b6 ZAP: Some cleanups/micro-optimizations #15983 531572b59 Fix panics when truncating/deleting files #15992 5fc134ff2 zvol: use multiple taskq #16007 2ea370a4e BRT: Fix holes cloning #16008 67995229a zpool: Fix option string, adding -e and fixing order #16015 8a5604713 Add support for zfs mount -R #16022 026fe7964 Speculative prefetch for reordered requests #16040 575872cc3 L2ARC: Relax locking during write #16042 d5fb6abd3 Improve dbuf_read() error reporting #16051 5d859a2e2 xdr: header cleanup #16052 602b5dca7 Fix read errors race after block cloning #16057 97d7228f4 Remove db_state DB_NOFILL checks from syncing context #16072 f4ce02ae4 Small fix to prefetch ranges aggregation #16074 97889c037 return NULL at end of send_progress_thread #16086 7aaf6ce9d Add the BTI elf note to the AArch64 SHA2 assembly #16094 4d17e200d Add zfetch stats in arcstats #16128 3d4d61988 Fix updating the zvol_htable when renaming a zvol #16141 b3b37b84e Fix arcstats for FreeBSD after zfetch support Obtained from: OpenZFS OpenZFS commit: 2566592045780e7be7afc899c2496b1ae3af4f4d OpenZFS tag: zfs-2.2.4 Approved by: re (cperciva) (cherry picked from commit 9a5f0cb5b639f8e0435103d44b17eb8a352af990) --- cddl/lib/libnvpair/Makefile | 2 - sys/contrib/openzfs/.mailmap | 18 + sys/contrib/openzfs/AUTHORS | 35 + sys/contrib/openzfs/META | 4 +- sys/contrib/openzfs/cmd/arc_summary | 11 +- sys/contrib/openzfs/cmd/arcstat.in | 57 +- sys/contrib/openzfs/cmd/zed/agents/fmd_api.c | 57 +- sys/contrib/openzfs/cmd/zed/agents/fmd_api.h | 3 +- sys/contrib/openzfs/cmd/zed/agents/fmd_serd.c | 3 +- sys/contrib/openzfs/cmd/zed/agents/fmd_serd.h | 2 +- sys/contrib/openzfs/cmd/zed/agents/zfs_diagnosis.c | 143 +++- sys/contrib/openzfs/cmd/zed/agents/zfs_retire.c | 3 + sys/contrib/openzfs/cmd/zfs/zfs_main.c | 75 +- sys/contrib/openzfs/cmd/zinject/zinject.c | 16 + .../openzfs/cmd/zpool/os/linux/zpool_vdev_os.c | 4 +- sys/contrib/openzfs/cmd/zpool/zpool_main.c | 146 ++-- sys/contrib/openzfs/cmd/ztest.c | 8 +- sys/contrib/openzfs/config/Substfiles.am | 3 +- sys/contrib/openzfs/config/always-pyzfs.m4 | 9 +- sys/contrib/openzfs/config/ax_python_devel.m4 | 341 +++++--- sys/contrib/openzfs/config/kernel-blk-queue.m4 | 15 + sys/contrib/openzfs/config/kernel-blkdev.m4 | 159 +++- sys/contrib/openzfs/config/kernel-filemap.m4 | 1 + .../openzfs/config/kernel-make-request-fn.m4 | 33 + sys/contrib/openzfs/config/kernel-mm-page-size.m4 | 17 + .../openzfs/config/kernel-vfs-file_range.m4 | 27 + sys/contrib/openzfs/config/kernel.m4 | 4 + sys/contrib/openzfs/config/zfs-build.m4 | 8 +- sys/contrib/openzfs/contrib/debian/control | 2 +- sys/contrib/openzfs/etc/init.d/README.md | 6 +- sys/contrib/openzfs/etc/init.d/zfs-import.in | 2 +- sys/contrib/openzfs/etc/init.d/zfs-load-key.in | 2 +- sys/contrib/openzfs/etc/init.d/zfs-mount.in | 2 +- sys/contrib/openzfs/etc/init.d/zfs-share.in | 3 +- sys/contrib/openzfs/etc/init.d/zfs-zed.in | 3 +- sys/contrib/openzfs/include/libzfs.h | 6 +- sys/contrib/openzfs/include/os/freebsd/Makefile.am | 4 +- .../openzfs/include/os/freebsd/spl/rpc/xdr.h | 71 -- .../openzfs/include/os/freebsd/spl/sys/debug.h | 40 +- sys/contrib/openzfs/include/os/linux/Makefile.am | 2 + .../include/os/linux/kernel/linux/blkdev_compat.h | 6 +- .../include/os/linux/kernel/linux/mm_compat.h | 36 + .../include/os/linux/kernel/linux/mod_compat.h | 1 + .../openzfs/include/os/linux/spl/rpc/types.h | 30 + sys/contrib/openzfs/include/os/linux/spl/rpc/xdr.h | 2 - .../openzfs/include/os/linux/spl/sys/debug.h | 38 +- .../openzfs/include/os/linux/spl/sys/taskq.h | 2 +- .../openzfs/include/os/linux/zfs/sys/trace_zil.h | 14 +- sys/contrib/openzfs/include/sys/abd.h | 9 + sys/contrib/openzfs/include/sys/abd_impl.h | 26 +- sys/contrib/openzfs/include/sys/dmu.h | 5 +- sys/contrib/openzfs/include/sys/dmu_objset.h | 1 + sys/contrib/openzfs/include/sys/dmu_zfetch.h | 16 +- sys/contrib/openzfs/include/sys/fm/fs/zfs.h | 2 + sys/contrib/openzfs/include/sys/fs/zfs.h | 14 +- sys/contrib/openzfs/include/sys/multilist.h | 5 +- sys/contrib/openzfs/include/sys/spa.h | 12 +- sys/contrib/openzfs/include/sys/uberblock_impl.h | 16 +- sys/contrib/openzfs/include/sys/vdev_impl.h | 7 +- sys/contrib/openzfs/include/sys/zap.h | 8 + sys/contrib/openzfs/include/sys/zap_impl.h | 1 + sys/contrib/openzfs/include/sys/zap_leaf.h | 10 +- sys/contrib/openzfs/include/sys/zil_impl.h | 10 +- sys/contrib/openzfs/lib/libspl/include/assert.h | 15 +- sys/contrib/openzfs/lib/libuutil/uu_list.c | 14 +- sys/contrib/openzfs/lib/libzfs/libzfs.abi | 84 +- sys/contrib/openzfs/lib/libzfs/libzfs_pool.c | 13 +- sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c | 1 + sys/contrib/openzfs/lib/libzfs/libzfs_util.c | 12 +- .../openzfs/lib/libzfs/os/linux/libzfs_pool_os.c | 10 + sys/contrib/openzfs/man/Makefile.am | 4 +- sys/contrib/openzfs/man/man4/spl.4 | 18 +- sys/contrib/openzfs/man/man4/zfs.4 | 83 +- sys/contrib/openzfs/man/man7/vdevprops.7 | 12 +- sys/contrib/openzfs/man/man7/zfsprops.7 | 17 + sys/contrib/openzfs/man/man7/zpoolconcepts.7 | 4 +- sys/contrib/openzfs/man/man8/zfs-mount.8 | 6 +- sys/contrib/openzfs/man/man8/zinject.8 | 1 + sys/contrib/openzfs/man/man8/zpool-add.8 | 18 +- sys/contrib/openzfs/man/man8/zpool-clear.8 | 7 +- sys/contrib/openzfs/man/man8/zpool-status.8 | 18 +- .../icp/asm-aarch64/blake3/b3_aarch64_sse2.S | 14 +- .../icp/asm-aarch64/blake3/b3_aarch64_sse41.S | 12 +- .../module/icp/asm-aarch64/sha2/sha256-armv8.S | 10 + .../module/icp/asm-aarch64/sha2/sha512-armv8.S | 10 + sys/contrib/openzfs/module/nvpair/nvpair.c | 1 + sys/contrib/openzfs/module/os/freebsd/zfs/abd_os.c | 4 +- .../openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 4 +- .../openzfs/module/os/freebsd/zfs/zvol_os.c | 2 +- .../openzfs/module/os/linux/spl/spl-taskq.c | 85 +- sys/contrib/openzfs/module/os/linux/spl/spl-xdr.c | 1 + sys/contrib/openzfs/module/os/linux/zfs/abd_os.c | 123 ++- .../openzfs/module/os/linux/zfs/vdev_disk.c | 913 ++++++++++++++++----- .../openzfs/module/os/linux/zfs/zfs_vnops_os.c | 12 +- sys/contrib/openzfs/module/os/linux/zfs/zpl_file.c | 8 +- .../openzfs/module/os/linux/zfs/zpl_file_range.c | 16 +- sys/contrib/openzfs/module/os/linux/zfs/zvol_os.c | 140 +++- sys/contrib/openzfs/module/zcommon/zfs_prop.c | 11 + sys/contrib/openzfs/module/zcommon/zpool_prop.c | 6 + sys/contrib/openzfs/module/zfs/abd.c | 42 + sys/contrib/openzfs/module/zfs/arc.c | 179 ++-- sys/contrib/openzfs/module/zfs/brt.c | 147 +--- sys/contrib/openzfs/module/zfs/dbuf.c | 160 ++-- sys/contrib/openzfs/module/zfs/dmu.c | 149 ++-- sys/contrib/openzfs/module/zfs/dmu_objset.c | 29 +- sys/contrib/openzfs/module/zfs/dmu_recv.c | 17 +- sys/contrib/openzfs/module/zfs/dmu_zfetch.c | 296 +++++-- sys/contrib/openzfs/module/zfs/dsl_deadlist.c | 8 +- sys/contrib/openzfs/module/zfs/metaslab.c | 8 +- sys/contrib/openzfs/module/zfs/mmp.c | 5 +- sys/contrib/openzfs/module/zfs/multilist.c | 26 +- sys/contrib/openzfs/module/zfs/spa.c | 149 +++- sys/contrib/openzfs/module/zfs/spa_log_spacemap.c | 16 +- sys/contrib/openzfs/module/zfs/spa_misc.c | 74 +- sys/contrib/openzfs/module/zfs/txg.c | 9 + sys/contrib/openzfs/module/zfs/vdev.c | 52 +- sys/contrib/openzfs/module/zfs/vdev_label.c | 4 +- sys/contrib/openzfs/module/zfs/vdev_raidz.c | 5 +- sys/contrib/openzfs/module/zfs/zap.c | 43 +- sys/contrib/openzfs/module/zfs/zap_leaf.c | 77 +- sys/contrib/openzfs/module/zfs/zap_micro.c | 206 +++-- sys/contrib/openzfs/module/zfs/zfs_fm.c | 26 + sys/contrib/openzfs/module/zfs/zfs_ioctl.c | 13 +- sys/contrib/openzfs/module/zfs/zfs_vnops.c | 6 +- sys/contrib/openzfs/module/zfs/zil.c | 352 +++++--- sys/contrib/openzfs/module/zfs/zio.c | 42 +- sys/contrib/openzfs/module/zfs/zio_inject.c | 6 + sys/contrib/openzfs/module/zfs/zvol.c | 2 +- sys/contrib/openzfs/rpm/redhat/zfs-kmod.spec.in | 2 +- sys/contrib/openzfs/tests/runfiles/common.run | 8 +- sys/contrib/openzfs/tests/runfiles/linux.run | 5 +- sys/contrib/openzfs/tests/runfiles/sanity.run | 3 +- .../openzfs/tests/zfs-tests/tests/Makefile.am | 5 + .../tests/functional/bclone/bclone_common.kshlib | 47 +- .../functional/bclone/bclone_corner_cases.kshlib | 20 +- .../functional/cli_root/zfs_mount/zfs_mount.cfg | 1 + .../cli_root/zfs_mount/zfs_mount_recursive.ksh | 146 ++++ .../functional/cli_root/zpool_add/add-o_ashift.ksh | 17 +- .../cli_root/zpool_add/add_prop_ashift.ksh | 16 +- .../zpool_add/zpool_add--allow-ashift-mismatch.ksh | 0 .../cli_root/zpool_add/zpool_add_002_pos.ksh | 11 + .../cli_root/zpool_add/zpool_add_004_pos.ksh | 2 +- .../cli_root/zpool_add/zpool_add_005_pos.ksh | 2 + .../cli_root/zpool_add/zpool_add_009_neg.ksh | 2 + .../cli_root/zpool_add/zpool_add_010_pos.ksh | 2 +- .../functional/cli_root/zpool_get/vdev_get.cfg | 2 + .../cli_root/zpool_import/zpool_import_status.ksh | 132 +++ .../tests/functional/cp_files/cp_files_002_pos.ksh | 6 +- .../zfs-tests/tests/functional/events/cleanup.ksh | 4 +- .../tests/functional/events/zed_slow_io.ksh | 205 +++++ .../functional/events/zed_slow_io_many_vdevs.ksh | 177 ++++ .../zfs-tests/tests/functional/fault/cleanup.ksh | 1 + .../zfs-tests/tests/functional/fault/setup.ksh | 1 + .../tests/functional/mmp/mmp_write_slow_disk.ksh | 97 +++ .../user_namespace/user_namespace_004.ksh | 4 +- sys/contrib/openzfs/udev/zvol_id.c | 9 +- sys/modules/zfs/zfs_config.h | 50 +- sys/modules/zfs/zfs_gitrev.h | 2 +- 158 files changed, 4808 insertions(+), 1646 deletions(-) diff --git a/cddl/lib/libnvpair/Makefile b/cddl/lib/libnvpair/Makefile index fb80d7c22ea5..a93ffcbd00de 100644 --- a/cddl/lib/libnvpair/Makefile +++ b/cddl/lib/libnvpair/Makefile @@ -27,6 +27,4 @@ CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h CFLAGS+= -DHAVE_ISSETUGID -DHAVE_CONFIG_H -DHAVE_XDR_BYTESREC - -CFLAGS.nvpair.c+= -UHAVE_RPC_TYPES .include diff --git a/sys/contrib/openzfs/.mailmap b/sys/contrib/openzfs/.mailmap index 46ef016b93f8..32bdb5209613 100644 --- a/sys/contrib/openzfs/.mailmap +++ b/sys/contrib/openzfs/.mailmap @@ -30,6 +30,7 @@ Andreas Dilger Andrew Walker Benedikt Neuffer Chengfei Zhu +ChenHao Lu <18302010006@fudan.edu.cn> Chris Lindee Colm Buckley Crag Wang @@ -43,6 +44,7 @@ Glenn Washburn Gordan Bobic Gregory Bartholomew hedong zhang +Ilkka Sovanto InsanePrawn Jason Cohen Jason Harmening @@ -57,6 +59,7 @@ KernelOfTruth Liu Hua Liu Qing loli10K +Mart Frauenlob Matthias Blankertz Michael Gmelin Olivier Mazouffre @@ -73,6 +76,9 @@ WHR Yanping Gao Youzhong Yang +# Signed-off-by: overriding Author: +Yuxin Wang + # Commits from strange places, long ago Brian Behlendorf Brian Behlendorf @@ -102,12 +108,15 @@ Brandon Thetford buzzingwires <131118055+buzzingwires@users.noreply.github.com> Cedric Maunoury <38213715+cedricmaunoury@users.noreply.github.com> Charles Suh +Chris Peredun <126915832+chrisperedun@users.noreply.github.com> Dacian Reece-Stremtan <35844628+dacianstremtan@users.noreply.github.com> Damian Szuberski <30863496+szubersk@users.noreply.github.com> Daniel Hiepler <32984777+heeplr@users.noreply.github.com> Daniel Kobras Daniel Reichelt David Quigley +Dennis R. Friedrichsen <31087738+dennisfriedrichsen@users.noreply.github.com> +Dex Wood DHE Dmitri John Ledkov <19779+xnox@users.noreply.github.com> Dries Michiels <32487486+driesmp@users.noreply.github.com> @@ -128,6 +137,7 @@ Harry Mallon <1816667+hjmallon@users.noreply.github.com> Hiếu Lê Jake Howard James Cowgill +Jaron Kent-Dobias Jason King Jeff Dike <52420226+jdike@users.noreply.github.com> Jitendra Patidar <53164267+jsai20@users.noreply.github.com> @@ -137,7 +147,9 @@ John L. Hammond <35266395+jhammond-intel@users.noreply. John-Mark Gurney John Ramsden Jonathon Fernyhough <559369+jonathonf@users.noreply.github.com> +Jose Luis Duran Justin Hibbits +Kevin Greene <104801862+kxgreene@users.noreply.github.com> Kevin Jin <33590050+jxdking@users.noreply.github.com> Kevin P. Fleming Krzysztof Piecuch <3964215+pikrzysztof@users.noreply.github.com> @@ -148,9 +160,11 @@ Lorenz Hüdepohl Luís Henriques <73643340+lumigch@users.noreply.github.com> Marcin Skarbek Matt Fiddaman <81489167+matt-fidd@users.noreply.github.com> +Maxim Filimonov Max Zettlmeißl <6818198+maxz@users.noreply.github.com> Michael Niewöhner Michael Zhivich <33133421+mzhivich@users.noreply.github.com> +MigeljanImeri <78048439+MigeljanImeri@users.noreply.github.com> Mo Zhou <5723047+cdluminate@users.noreply.github.com> Nick Mattis omni <79493359+omnivagant@users.noreply.github.com> @@ -164,6 +178,7 @@ Ping Huang <101400146+hpingfs@users.noreply.github.com> Piotr P. Stefaniak Richard Allen <33836503+belperite@users.noreply.github.com> Rich Ercolani <214141+rincebrain@users.noreply.github.com> +Rick Macklem <64620010+rmacklem@users.noreply.github.com> Rob Wing <98866084+rob-wing@users.noreply.github.com> Roman Strashkin Ryan Hirasaki <4690732+RyanHir@users.noreply.github.com> @@ -174,6 +189,8 @@ Scott Colby Sean Eric Fagan Spencer Kinny <30333052+Spencer-Kinny@users.noreply.github.com> Srikanth N S <75025422+nssrikanth@users.noreply.github.com> +Stefan Lendl <1321542+stfl@users.noreply.github.com> +Thomas Bertschinger <101425190+bertschinger@users.noreply.github.com> Thomas Geppert Tim Crawford Tom Matthews @@ -181,6 +198,7 @@ Tony Perkins <62951051+tony-zfs@users.noreply.github.com> Torsten Wörtwein Tulsi Jain Václav Skála <33496485+vaclavskala@users.noreply.github.com> +Vaibhav Bhanawat <88050553+vaibhav-delphix@users.noreply.github.com> Violet Purcell <66446404+vimproved@users.noreply.github.com> Vipin Kumar Verma <75025470+vermavipinkumar@users.noreply.github.com> Wolfgang Bumiller diff --git a/sys/contrib/openzfs/AUTHORS b/sys/contrib/openzfs/AUTHORS index be1efb87b34c..d7d55f42d2e7 100644 --- a/sys/contrib/openzfs/AUTHORS +++ b/sys/contrib/openzfs/AUTHORS @@ -88,9 +88,11 @@ CONTRIBUTORS: Bassu Ben Allen Ben Cordero + Benda Xu Benedikt Neuffer Benjamin Albrecht Benjamin Gentil + Benjamin Sherman Ben McGough Ben Rubson Ben Wolsieffer @@ -111,6 +113,7 @@ CONTRIBUTORS: bzzz77 cable2999 Caleb James DeLisle + Cameron Harr Cao Xuewen Carlo Landmeter Carlos Alberto Lopez Perez @@ -120,12 +123,15 @@ CONTRIBUTORS: Chen Can Chengfei Zhu Chen Haiquan + ChenHao Lu <18302010006@fudan.edu.cn> Chip Parker Chris Burroughs + Chris Davidson Chris Dunlap Chris Dunlop Chris Lindee Chris McDonough + Chris Peredun Chris Siden Chris Siebenmann Christer Ekholm @@ -144,6 +150,7 @@ CONTRIBUTORS: Clint Armstrong Coleman Kane Colin Ian King + Colin Percival Colm Buckley Crag Wang Craig Loomis @@ -156,6 +163,7 @@ CONTRIBUTORS: Damiano Albani Damian Szuberski Damian Wojsław + Daniel Berlin Daniel Hiepler Daniel Hoffman Daniel Kobras @@ -176,8 +184,10 @@ CONTRIBUTORS: David Quigley Debabrata Banerjee D. Ebdrup + Dennis R. Friedrichsen Denys Rtveliashvili Derek Dai + Dex Wood DHE Didier Roche Dimitri John Ledkov @@ -235,9 +245,11 @@ CONTRIBUTORS: Gionatan Danti Giuseppe Di Natale Glenn Washburn + gofaster Gordan Bobic Gordon Bergling Gordon Ross + Gordon Tetlow Graham Christensen Graham Perrin Gregor Kopka @@ -265,6 +277,7 @@ CONTRIBUTORS: Igor Kozhukhov Igor Lvovsky ilbsmart + Ilkka Sovanto illiliti ilovezfs InsanePrawn @@ -280,9 +293,11 @@ CONTRIBUTORS: Jan Engelhardt Jan Kryl Jan Sanislo + Jaron Kent-Dobias Jason Cohen Jason Harmening Jason King + Jason Lee Jason Zaman Javen Wu Jean-Baptiste Lallement @@ -313,6 +328,7 @@ CONTRIBUTORS: Jonathon Fernyhough Jorgen Lundman Josef 'Jeff' Sipek + Jose Luis Duran Josh Soref Joshua M. Clulow José Luis Salvador Rufo @@ -336,8 +352,10 @@ CONTRIBUTORS: Kash Pande Kay Pedersen Keith M Wesolowski + Kent Ross KernelOfTruth Kevin Bowling + Kevin Greene Kevin Jin Kevin P. Fleming Kevin Tanguy @@ -389,6 +407,7 @@ CONTRIBUTORS: Mark Shellenbaum marku89 Mark Wright + Mart Frauenlob Martin Matuska Martin Rüegg Massimo Maggi @@ -405,6 +424,7 @@ CONTRIBUTORS: Matus Kral Mauricio Faria de Oliveira Max Grossman + Maxim Filimonov Maximilian Mehnert Max Zettlmeißl Md Islam @@ -417,6 +437,7 @@ CONTRIBUTORS: Michael Niewöhner Michael Zhivich Michal Vasilek + MigeljanImeri Mike Gerdts Mike Harsch Mike Leddy @@ -448,6 +469,7 @@ CONTRIBUTORS: Olaf Faaland Oleg Drokin Oleg Stepura + Olivier Certner Olivier Mazouffre omni Orivej Desh @@ -479,6 +501,7 @@ CONTRIBUTORS: Prasad Joshi privb0x23 P.SCH + Quartz Quentin Zdanis Rafael Kitover RageLtMan @@ -491,11 +514,15 @@ CONTRIBUTORS: Riccardo Schirone Richard Allen Richard Elling + Richard Kojedzinszky Richard Laager Richard Lowe Richard Sharpe Richard Yao Rich Ercolani + Rick Macklem + rilysh + Robert Evans Robert Novak Roberto Ricci Rob Norris @@ -509,7 +536,9 @@ CONTRIBUTORS: Ryan Lahfa Ryan Libby Ryan Moeller + Sam Atkinson Sam Hathaway + Sam James Sam Lunt Samuel VERSCHELDE Samuel Wycliffe @@ -530,6 +559,8 @@ CONTRIBUTORS: Shaan Nobee Shampavman Shaun Tancheff + Shawn Bayern + Shengqi Chen Shen Yan Simon Guest Simon Klinkert @@ -537,6 +568,7 @@ CONTRIBUTORS: Spencer Kinny Srikanth N S Stanislav Seletskiy + Stefan Lendl Steffen Müthing Stephen Blinick sterlingjensen @@ -557,6 +589,7 @@ CONTRIBUTORS: Teodor Spæren TerraTech Thijs Cramer + Thomas Bertschinger Thomas Geppert Thomas Lamprecht Till Maas @@ -586,6 +619,7 @@ CONTRIBUTORS: Turbo Fredriksson Tyler J. Stachecki Umer Saleem + Vaibhav Bhanawat Valmiky Arquissandas Val Packett Vince van Oosten @@ -614,6 +648,7 @@ CONTRIBUTORS: yuina822 YunQiang Su Yuri Pankov + Yuxin Wang Yuxuan Shui Zachary Bedell Zach Dykstra diff --git a/sys/contrib/openzfs/META b/sys/contrib/openzfs/META index d64414e32225..383fa37fd42a 100644 --- a/sys/contrib/openzfs/META +++ b/sys/contrib/openzfs/META @@ -1,10 +1,10 @@ Meta: 1 Name: zfs Branch: 1.0 -Version: 2.2.3 +Version: 2.2.4 Release: 1 Release-Tags: relext License: CDDL Author: OpenZFS -Linux-Maximum: 6.7 +Linux-Maximum: 6.8 Linux-Minimum: 3.10 diff --git a/sys/contrib/openzfs/cmd/arc_summary b/sys/contrib/openzfs/cmd/arc_summary index 9c69ec4f8ccc..100fb1987a8b 100755 --- a/sys/contrib/openzfs/cmd/arc_summary +++ b/sys/contrib/openzfs/cmd/arc_summary @@ -793,18 +793,27 @@ def section_dmu(kstats_dict): zfetch_stats = isolate_section('zfetchstats', kstats_dict) - zfetch_access_total = int(zfetch_stats['hits'])+int(zfetch_stats['misses']) + zfetch_access_total = int(zfetch_stats['hits']) +\ + int(zfetch_stats['future']) + int(zfetch_stats['stride']) +\ + int(zfetch_stats['past']) + int(zfetch_stats['misses']) prt_1('DMU predictive prefetcher calls:', f_hits(zfetch_access_total)) prt_i2('Stream hits:', f_perc(zfetch_stats['hits'], zfetch_access_total), f_hits(zfetch_stats['hits'])) + future = int(zfetch_stats['future']) + int(zfetch_stats['stride']) + prt_i2('Hits ahead of stream:', f_perc(future, zfetch_access_total), + f_hits(future)) + prt_i2('Hits behind stream:', + f_perc(zfetch_stats['past'], zfetch_access_total), + f_hits(zfetch_stats['past'])) prt_i2('Stream misses:', f_perc(zfetch_stats['misses'], zfetch_access_total), f_hits(zfetch_stats['misses'])) prt_i2('Streams limit reached:', f_perc(zfetch_stats['max_streams'], zfetch_stats['misses']), f_hits(zfetch_stats['max_streams'])) + prt_i1('Stream strides:', f_hits(zfetch_stats['stride'])) prt_i1('Prefetches issued', f_hits(zfetch_stats['io_issued'])) print() diff --git a/sys/contrib/openzfs/cmd/arcstat.in b/sys/contrib/openzfs/cmd/arcstat.in index 8df1c62f7e86..c4f10a1d6d3b 100755 --- a/sys/contrib/openzfs/cmd/arcstat.in +++ b/sys/contrib/openzfs/cmd/arcstat.in @@ -157,6 +157,16 @@ cols = { "free": [5, 1024, "ARC free memory"], "avail": [5, 1024, "ARC available memory"], "waste": [5, 1024, "Wasted memory due to round up to pagesize"], + "ztotal": [6, 1000, "zfetch total prefetcher calls per second"], + "zhits": [5, 1000, "zfetch stream hits per second"], + "zahead": [6, 1000, "zfetch hits ahead of streams per second"], + "zpast": [5, 1000, "zfetch hits behind streams per second"], + "zmisses": [7, 1000, "zfetch stream misses per second"], + "zmax": [4, 1000, "zfetch limit reached per second"], + "zfuture": [7, 1000, "zfetch stream future per second"], + "zstride": [7, 1000, "zfetch stream strides per second"], + "zissued": [7, 1000, "zfetch prefetches issued per second"], + "zactive": [7, 1000, "zfetch prefetches active per second"], } v = {} @@ -164,6 +174,8 @@ hdr = ["time", "read", "ddread", "ddh%", "dmread", "dmh%", "pread", "ph%", "size", "c", "avail"] xhdr = ["time", "mfu", "mru", "mfug", "mrug", "unc", "eskip", "mtxmis", "dread", "pread", "read"] +zhdr = ["time", "ztotal", "zhits", "zahead", "zpast", "zmisses", "zmax", + "zfuture", "zstride", "zissued", "zactive"] sint = 1 # Default interval is 1 second count = 1 # Default count is 1 hdr_intr = 20 # Print header every 20 lines of output @@ -188,6 +200,8 @@ if sys.platform.startswith('freebsd'): k = [ctl for ctl in sysctl.filter('kstat.zfs.misc.arcstats') if ctl.type != sysctl.CTLTYPE_NODE] + k += [ctl for ctl in sysctl.filter('kstat.zfs.misc.zfetchstats') + if ctl.type != sysctl.CTLTYPE_NODE] if not k: sys.exit(1) @@ -199,19 +213,28 @@ if sys.platform.startswith('freebsd'): continue name, value = s.name, s.value - # Trims 'kstat.zfs.misc.arcstats' from the name - kstat[name[24:]] = int(value) + + if "arcstats" in name: + # Trims 'kstat.zfs.misc.arcstats' from the name + kstat[name[24:]] = int(value) + else: + kstat["zfetch_" + name[27:]] = int(value) elif sys.platform.startswith('linux'): def kstat_update(): global kstat - k = [line.strip() for line in open('/proc/spl/kstat/zfs/arcstats')] + k1 = [line.strip() for line in open('/proc/spl/kstat/zfs/arcstats')] - if not k: + k2 = ["zfetch_" + line.strip() for line in + open('/proc/spl/kstat/zfs/zfetchstats')] + + if k1 is None or k2 is None: sys.exit(1) - del k[0:2] + del k1[0:2] + del k2[0:2] + k = k1 + k2 kstat = {} for s in k: @@ -239,6 +262,7 @@ def usage(): sys.stderr.write("\t -v : List all possible field headers and definitions" "\n") sys.stderr.write("\t -x : Print extended stats\n") + sys.stderr.write("\t -z : Print zfetch stats\n") sys.stderr.write("\t -f : Specify specific fields to print (see -v)\n") sys.stderr.write("\t -o : Redirect output to the specified file\n") sys.stderr.write("\t -s : Override default field separator with custom " @@ -357,6 +381,7 @@ def init(): global count global hdr global xhdr + global zhdr global opfile global sep global out @@ -368,15 +393,17 @@ def init(): xflag = False hflag = False vflag = False + zflag = False i = 1 try: opts, args = getopt.getopt( sys.argv[1:], - "axo:hvs:f:p", + "axzo:hvs:f:p", [ "all", "extended", + "zfetch", "outfile", "help", "verbose", @@ -410,13 +437,15 @@ def init(): i += 1 if opt in ('-p', '--parsable'): pretty_print = False + if opt in ('-z', '--zfetch'): + zflag = True i += 1 argv = sys.argv[i:] sint = int(argv[0]) if argv else sint count = int(argv[1]) if len(argv) > 1 else (0 if len(argv) > 0 else 1) - if hflag or (xflag and desired_cols): + if hflag or (xflag and zflag) or ((zflag or xflag) and desired_cols): usage() if vflag: @@ -425,6 +454,9 @@ def init(): if xflag: hdr = xhdr + if zflag: + hdr = zhdr + update_hdr_intr() # check if L2ARC exists @@ -569,6 +601,17 @@ def calculate(): v["el2mru"] = d["evict_l2_eligible_mru"] // sint v["el2inel"] = d["evict_l2_ineligible"] // sint v["mtxmis"] = d["mutex_miss"] // sint + v["ztotal"] = (d["zfetch_hits"] + d["zfetch_future"] + d["zfetch_stride"] + + d["zfetch_past"] + d["zfetch_misses"]) // sint + v["zhits"] = d["zfetch_hits"] // sint + v["zahead"] = (d["zfetch_future"] + d["zfetch_stride"]) // sint + v["zpast"] = d["zfetch_past"] // sint + v["zmisses"] = d["zfetch_misses"] // sint + v["zmax"] = d["zfetch_max_streams"] // sint + v["zfuture"] = d["zfetch_future"] // sint + v["zstride"] = d["zfetch_stride"] // sint + v["zissued"] = d["zfetch_io_issued"] // sint + v["zactive"] = d["zfetch_io_active"] // sint if l2exist: v["l2hits"] = d["l2_hits"] // sint diff --git a/sys/contrib/openzfs/cmd/zed/agents/fmd_api.c b/sys/contrib/openzfs/cmd/zed/agents/fmd_api.c index 4a6cfbf8c05c..fe43e2ab971e 100644 --- a/sys/contrib/openzfs/cmd/zed/agents/fmd_api.c +++ b/sys/contrib/openzfs/cmd/zed/agents/fmd_api.c @@ -22,6 +22,7 @@ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * * Copyright (c) 2016, Intel Corporation. + * Copyright (c) 2023, Klara Inc. */ /* @@ -231,28 +232,6 @@ fmd_prop_get_int32(fmd_hdl_t *hdl, const char *name) if (strcmp(name, "spare_on_remove") == 0) return (1); - if (strcmp(name, "io_N") == 0 || strcmp(name, "checksum_N") == 0) - return (10); /* N = 10 events */ - - return (0); -} - -int64_t -fmd_prop_get_int64(fmd_hdl_t *hdl, const char *name) -{ - (void) hdl; - - /* - * These can be looked up in mp->modinfo->fmdi_props - * For now we just hard code for phase 2. In the - * future, there can be a ZED based override. - */ - if (strcmp(name, "remove_timeout") == 0) - return (15ULL * 1000ULL * 1000ULL * 1000ULL); /* 15 sec */ - - if (strcmp(name, "io_T") == 0 || strcmp(name, "checksum_T") == 0) - return (1000ULL * 1000ULL * 1000ULL * 600ULL); /* 10 min */ - return (0); } @@ -535,20 +514,31 @@ fmd_serd_exists(fmd_hdl_t *hdl, const char *name) return (fmd_serd_eng_lookup(&mp->mod_serds, name) != NULL); } -void -fmd_serd_reset(fmd_hdl_t *hdl, const char *name) +int +fmd_serd_active(fmd_hdl_t *hdl, const char *name) { fmd_module_t *mp = (fmd_module_t *)hdl; fmd_serd_eng_t *sgp; if ((sgp = fmd_serd_eng_lookup(&mp->mod_serds, name)) == NULL) { zed_log_msg(LOG_ERR, "serd engine '%s' does not exist", name); - return; + return (0); } + return (fmd_serd_eng_fired(sgp) || !fmd_serd_eng_empty(sgp)); +} - fmd_serd_eng_reset(sgp); +void +fmd_serd_reset(fmd_hdl_t *hdl, const char *name) +{ + fmd_module_t *mp = (fmd_module_t *)hdl; + fmd_serd_eng_t *sgp; - fmd_hdl_debug(hdl, "serd_reset %s", name); + if ((sgp = fmd_serd_eng_lookup(&mp->mod_serds, name)) == NULL) { + zed_log_msg(LOG_ERR, "serd engine '%s' does not exist", name); + } else { + fmd_serd_eng_reset(sgp); + fmd_hdl_debug(hdl, "serd_reset %s", name); + } } int @@ -556,16 +546,21 @@ fmd_serd_record(fmd_hdl_t *hdl, const char *name, fmd_event_t *ep) { fmd_module_t *mp = (fmd_module_t *)hdl; fmd_serd_eng_t *sgp; - int err; if ((sgp = fmd_serd_eng_lookup(&mp->mod_serds, name)) == NULL) { zed_log_msg(LOG_ERR, "failed to add record to SERD engine '%s'", name); return (0); } - err = fmd_serd_eng_record(sgp, ep->ev_hrt); + return (fmd_serd_eng_record(sgp, ep->ev_hrt)); +} + +void +fmd_serd_gc(fmd_hdl_t *hdl) +{ + fmd_module_t *mp = (fmd_module_t *)hdl; - return (err); + fmd_serd_hash_apply(&mp->mod_serds, fmd_serd_eng_gc, NULL); } /* FMD Timers */ @@ -579,7 +574,7 @@ _timer_notify(union sigval sv) const fmd_hdl_ops_t *ops = mp->mod_info->fmdi_ops; struct itimerspec its; - fmd_hdl_debug(hdl, "timer fired (%p)", ftp->ft_tid); + fmd_hdl_debug(hdl, "%s timer fired (%p)", mp->mod_name, ftp->ft_tid); /* disarm the timer */ memset(&its, 0, sizeof (struct itimerspec)); diff --git a/sys/contrib/openzfs/cmd/zed/agents/fmd_api.h b/sys/contrib/openzfs/cmd/zed/agents/fmd_api.h index b940d0d395ec..8471feecf33f 100644 --- a/sys/contrib/openzfs/cmd/zed/agents/fmd_api.h +++ b/sys/contrib/openzfs/cmd/zed/agents/fmd_api.h @@ -151,7 +151,6 @@ extern void fmd_hdl_vdebug(fmd_hdl_t *, const char *, va_list); extern void fmd_hdl_debug(fmd_hdl_t *, const char *, ...); extern int32_t fmd_prop_get_int32(fmd_hdl_t *, const char *); -extern int64_t fmd_prop_get_int64(fmd_hdl_t *, const char *); #define FMD_STAT_NOALLOC 0x0 /* fmd should use caller's memory */ #define FMD_STAT_ALLOC 0x1 /* fmd should allocate stats memory */ @@ -195,10 +194,12 @@ extern size_t fmd_buf_size(fmd_hdl_t *, fmd_case_t *, const char *); extern void fmd_serd_create(fmd_hdl_t *, const char *, uint_t, hrtime_t); extern void fmd_serd_destroy(fmd_hdl_t *, const char *); extern int fmd_serd_exists(fmd_hdl_t *, const char *); +extern int fmd_serd_active(fmd_hdl_t *, const char *); extern void fmd_serd_reset(fmd_hdl_t *, const char *); extern int fmd_serd_record(fmd_hdl_t *, const char *, fmd_event_t *); extern int fmd_serd_fired(fmd_hdl_t *, const char *); extern int fmd_serd_empty(fmd_hdl_t *, const char *); +extern void fmd_serd_gc(fmd_hdl_t *); extern id_t fmd_timer_install(fmd_hdl_t *, void *, fmd_event_t *, hrtime_t); extern void fmd_timer_remove(fmd_hdl_t *, id_t); diff --git a/sys/contrib/openzfs/cmd/zed/agents/fmd_serd.c b/sys/contrib/openzfs/cmd/zed/agents/fmd_serd.c index 0bb2c535f094..f942e62b3f48 100644 --- a/sys/contrib/openzfs/cmd/zed/agents/fmd_serd.c +++ b/sys/contrib/openzfs/cmd/zed/agents/fmd_serd.c @@ -310,8 +310,9 @@ fmd_serd_eng_reset(fmd_serd_eng_t *sgp) } void -fmd_serd_eng_gc(fmd_serd_eng_t *sgp) +fmd_serd_eng_gc(fmd_serd_eng_t *sgp, void *arg) { + (void) arg; fmd_serd_elem_t *sep, *nep; hrtime_t hrt; diff --git a/sys/contrib/openzfs/cmd/zed/agents/fmd_serd.h b/sys/contrib/openzfs/cmd/zed/agents/fmd_serd.h index 25b6888e61f2..80ff9a3b25b8 100644 --- a/sys/contrib/openzfs/cmd/zed/agents/fmd_serd.h +++ b/sys/contrib/openzfs/cmd/zed/agents/fmd_serd.h @@ -77,7 +77,7 @@ extern int fmd_serd_eng_fired(fmd_serd_eng_t *); extern int fmd_serd_eng_empty(fmd_serd_eng_t *); extern void fmd_serd_eng_reset(fmd_serd_eng_t *); -extern void fmd_serd_eng_gc(fmd_serd_eng_t *); +extern void fmd_serd_eng_gc(fmd_serd_eng_t *, void *); #ifdef __cplusplus } diff --git a/sys/contrib/openzfs/cmd/zed/agents/zfs_diagnosis.c b/sys/contrib/openzfs/cmd/zed/agents/zfs_diagnosis.c index f6ba334a3ba3..e0ad00800add 100644 --- a/sys/contrib/openzfs/cmd/zed/agents/zfs_diagnosis.c +++ b/sys/contrib/openzfs/cmd/zed/agents/zfs_diagnosis.c @@ -23,6 +23,7 @@ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2015 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2016, Intel Corporation. + * Copyright (c) 2023, Klara Inc. */ #include @@ -47,11 +48,16 @@ #define DEFAULT_CHECKSUM_T 600 /* seconds */ #define DEFAULT_IO_N 10 /* events */ #define DEFAULT_IO_T 600 /* seconds */ +#define DEFAULT_SLOW_IO_N 10 /* events */ +#define DEFAULT_SLOW_IO_T 30 /* seconds */ + +#define CASE_GC_TIMEOUT_SECS 43200 /* 12 hours */ /* - * Our serd engines are named 'zfs___{checksum,io}'. This - * #define reserves enough space for two 64-bit hex values plus the length of - * the longest string. + * Our serd engines are named in the following format: + * 'zfs___{checksum,io,slow_io}' + * This #define reserves enough space for two 64-bit hex values plus the + * length of the longest string. */ #define MAX_SERDLEN (16 * 2 + sizeof ("zfs___checksum")) @@ -68,6 +74,7 @@ typedef struct zfs_case_data { int zc_pool_state; char zc_serd_checksum[MAX_SERDLEN]; char zc_serd_io[MAX_SERDLEN]; + char zc_serd_slow_io[MAX_SERDLEN]; int zc_has_remove_timer; } zfs_case_data_t; @@ -114,7 +121,8 @@ zfs_de_stats_t zfs_stats = { { "resource_drops", FMD_TYPE_UINT64, "resource related ereports" } }; -static hrtime_t zfs_remove_timeout; +/* wait 15 seconds after a removal */ +static hrtime_t zfs_remove_timeout = SEC2NSEC(15); uu_list_pool_t *zfs_case_pool; *** 11838 LINES SKIPPED *** From nobody Wed May 8 15:25:54 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZJrL2fkkz5JLy0; Wed, 08 May 2024 15:25: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 4VZJrL27Dhz4jPP; Wed, 8 May 2024 15:25:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715181954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lgPAgSmrQ5LmQqAL/wl5wyFy0Lhgr+fxEdElPx4m1uk=; b=JWe7+RX02WJI4ICsHjGKzPsXSbGVinoHMc37GhxHilxxN0aF57RjBHG75AOTQcmsl3VWNx VjbdXZrQJ4VKHVEsW+1wPw00EjtDbO6afynBbAh2shachTPyLeIgpNM4Rod06QWV/heydD ZCoZ/fqTvZ3+WA2c8BGx2C/+EaVygh9zZpZXnEU8waIOdNfMte1ed1sv4zdz0vytV0sx8p JpHFr2QLj1SCnYDPFn7BaA7bUxkvFLjEMGGvThQjt04zsKBoTGCLbwlH+DcHlXKLijjx/H m4GKiUEcyBVgMxBnieyHF4Fl2Jk0epKUmAtWz7g+IyzkKl8R1ckUsb6G335KcA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715181954; a=rsa-sha256; cv=none; b=PY4ip3n+H3ulh8u2BF69G3+0Lrka5zey5MBx+PeYxt47hbRfmmBAONHrlP2Ra5+s6fEGo+ sDrOa4Lketly5C4RaMGaW6fHm+LAdaQ1Flk2uuOjE3SSDLVuwaazYECL+6FX3QEuKkCuaH gchkJ2zsB0g0QshVFRZz4it6O1F4Tks0WGUW6U0CcWzkYILzCTCQ7DGxzwykWjiI0YJPKy +1IkkM4X5TnnlORPQ5RCNS8cBhKPYPr889pZY2QHdB5QS/iTD6PSuvQbTCs0mVke4tgVFL xOMrJtMEyu8SCdxnYb29QKKGHgiCKcjg4LFNe33oe5jw6vxAvhDE90umplGyIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715181954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lgPAgSmrQ5LmQqAL/wl5wyFy0Lhgr+fxEdElPx4m1uk=; b=kocroqhkEgVmnr1VwtLYR894IA0ta33vRl7AT+/QKKBNXp/Txi3JEhKWOp5+YujD/oay/s iIz4ZQ3iw9SgKb1OLA2XYenWpgpS1Alr/6KajrQZoQqCcOFuYaEbX1ZfnvXJtqcNgpH+TU p79Zu+XnHLjxhYwRZrk0yvI2Oa8QAQA6F10po92Ftai+JgUshKESkCEWt7o36K2biXG+JB UVCDYc0fgCe7QwSkdYYnGA0HeJUOe8EZLpmFrWj9ecB8ITEHuERRJky4IXHiG/ZW8aqX1O fgEpCGxgHRym3kB9c+oRIgwOJT/kFEj8S1VEsxJQq+ROl5f6xEHZTQ8xLHNwmQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZJrL1lKjzWLX; Wed, 8 May 2024 15:25:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 448FPssW016713; Wed, 8 May 2024 15:25:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 448FPs4J016710; Wed, 8 May 2024 15:25:54 GMT (envelope-from git) Date: Wed, 8 May 2024 15:25:54 GMT Message-Id: <202405081525.448FPs4J016710@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 74b67dbc90c1 - releng/14.1 - zfs: unbreak aarch64 build with non-gcc compilers List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 74b67dbc90c10d54f71aedbb7e1a39b14c8af628 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=74b67dbc90c10d54f71aedbb7e1a39b14c8af628 commit 74b67dbc90c10d54f71aedbb7e1a39b14c8af628 Author: Martin Matuska AuthorDate: 2024-04-16 23:34:25 +0000 Commit: Martin Matuska CommitDate: 2024-05-08 15:25:09 +0000 zfs: unbreak aarch64 build with non-gcc compilers Vendor did not backport this fix into zfs-2.2-release yet. OpenZFS PR: #16103 35bf25848 Fix: FreeBSD Arm64 does not build currently Approved by: re (cperciva) (cherry picked from commit b9dee1dca2d74e12e867fd29d2d584fc385078eb) (cherry picked from commit 7e10c2d27a538aa3f5afcafe48801a9316e30027) --- sys/contrib/openzfs/module/icp/asm-aarch64/blake3/b3_aarch64_sse2.S | 4 ++-- sys/contrib/openzfs/module/icp/asm-aarch64/blake3/b3_aarch64_sse41.S | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/contrib/openzfs/module/icp/asm-aarch64/blake3/b3_aarch64_sse2.S b/sys/contrib/openzfs/module/icp/asm-aarch64/blake3/b3_aarch64_sse2.S index e66bb4bc7f26..b0af629066ea 100644 --- a/sys/contrib/openzfs/module/icp/asm-aarch64/blake3/b3_aarch64_sse2.S +++ b/sys/contrib/openzfs/module/icp/asm-aarch64/blake3/b3_aarch64_sse2.S @@ -34,7 +34,7 @@ #if defined(__aarch64__) /* make gcc <= 9 happy */ -#if LD_VERSION >= 233010000 +#if !defined(LD_VERSION) || LD_VERSION >= 233010000 #define CFI_NEGATE_RA_STATE .cfi_negate_ra_state #else #define CFI_NEGATE_RA_STATE @@ -2066,4 +2066,4 @@ zfs_blake3_hash_many_sse2: .size zfs_blake3_hash_many_sse2, .Lfunc_end3-zfs_blake3_hash_many_sse2 .cfi_endproc .section ".note.GNU-stack","",@progbits -#endif \ No newline at end of file +#endif diff --git a/sys/contrib/openzfs/module/icp/asm-aarch64/blake3/b3_aarch64_sse41.S b/sys/contrib/openzfs/module/icp/asm-aarch64/blake3/b3_aarch64_sse41.S index b9fb28dfcf03..0b719761dd4c 100644 --- a/sys/contrib/openzfs/module/icp/asm-aarch64/blake3/b3_aarch64_sse41.S +++ b/sys/contrib/openzfs/module/icp/asm-aarch64/blake3/b3_aarch64_sse41.S @@ -34,7 +34,7 @@ #if defined(__aarch64__) /* make gcc <= 9 happy */ -#if LD_VERSION >= 233010000 +#if !defined(LD_VERSION) || LD_VERSION >= 233010000 #define CFI_NEGATE_RA_STATE .cfi_negate_ra_state #else #define CFI_NEGATE_RA_STATE @@ -2403,4 +2403,4 @@ zfs_blake3_hash_many_sse41: .size zfs_blake3_hash_many_sse41, .Lfunc_end3-zfs_blake3_hash_many_sse41 .cfi_endproc .section ".note.GNU-stack","",@progbits -#endif \ No newline at end of file +#endif From nobody Thu May 9 06:53:55 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZjR74HW9z5KjD0; Thu, 09 May 2024 06:53:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VZjR73sVWz4PN5; Thu, 9 May 2024 06:53:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715237635; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vYb9ecHmm2AQmvYc8A8+2gYSXheRozyEOr9yYFq2h3M=; b=ixxXf122jogMf4pjKOHqKArDSL1FEYiWACgGMebPGHY0M37wLMTjWzMOXcCbvGAyCdSuTL hnUzNZVlST/DRMKJHp/2jRFWtUD4HvMnbOzbAJvi1f4oSLFiMs1Ifs7cOBxCVY/RM+iPZN L5qvY4TeX/0gFcX17gvV8BI/DS/yYqrvgvX5UnhiLSS9bIOVDzgwBhvRwnThczx/yMqj7R u2p8J8sWZ9o32+r49s91qmyPSFVmPpYLBIIyK4T27BMbiHglvoe9QWYyRfED3bsbGY3ydh PCwOQGZfc7b0Il9Qu18oQM8Uy2SCWscTC335Z3B/QDx5PMWUHnS2kQ/COFgxCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715237635; a=rsa-sha256; cv=none; b=JDVnFCp1kkDKAoVMm7GplXA/I/L8CdneJ5aSyMYIDqURwanTrbo1qT3pNJGESTFzTdf3qg oP0S/zv4kEPUF066eHVOOBP07zZvwhziqc7SL/rlR3CS8DAS1y27BFm+AZsAyTiwZEf/Pw 34SumiWX8C/P1DAyMMItMtyVRfICrLHQX3mQIqLk8C8CjeLE4SZrbH8YtYHRInHGLaaonG OCKmUvHbtgB/qnMYx1DVlYDGyDZyTA2oIWWO/Ns6NoLFyPpAb5LXis5wjS2AZbcMwexbVM fYy6XY9Kthl0969DM0MwFxx5sVcFeWOGl4qmm71dGX0wEX9F+GSned7qQLclkA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715237635; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vYb9ecHmm2AQmvYc8A8+2gYSXheRozyEOr9yYFq2h3M=; b=J9q/RCZje5vda7Za4iA0VhZzrecEpRunvyhy3qIOssXsaeiogbMMNoKHfIV2i1gSQ8FnIF OqBSrHMJiY1qLdy4p18KLOGiCfACt7cHMLD1u2nLAGuwsqSMvasSM4GL0SfRy0poPyFrrA sFXTmf4OT3o7TphUOScRd5v7UQKK8KZXrKiUfMcvO4O65bGfvxJMkv7e11p4+lusdSNduy rWhYeC3Sv1QH4Ix8rbQ+l12jdj3DvHkwsjSenSaEnTK9TV34bb0KyqDD5fkrO5DXUV7fPf /vFici4pUCQ7uEeOWaw/SFR/Mm88CDsX06ntEsSSierzdnWVHvg3lrjRKQ4YfA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZjR73T9czyGs; Thu, 9 May 2024 06:53:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4496rt67089377; Thu, 9 May 2024 06:53:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4496rtPl089374; Thu, 9 May 2024 06:53:55 GMT (envelope-from git) Date: Thu, 9 May 2024 06:53:55 GMT Message-Id: <202405090653.4496rtPl089374@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 9f06e6c9907a - stable/14 - Remove remnants of portsnap(8) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9f06e6c9907ae13dd1153958e0bc923097590d10 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=9f06e6c9907ae13dd1153958e0bc923097590d10 commit 9f06e6c9907ae13dd1153958e0bc923097590d10 Author: Olivier Certner AuthorDate: 2024-04-22 13:02:46 +0000 Commit: Olivier Certner CommitDate: 2024-05-09 06:52:53 +0000 Remove remnants of portsnap(8) This was prompted by noticing that '/var/db/portsnap' still exists on newly-installed machines. With this change, all mentions of portsnap(8) in the tree are gone, except for the historical note in the AUTHORS section of manpage phttpget(8). locate(1) will thus start indexing again '/var/db/portsnap' on machines where this directory still exists, which may be a good way to push administrators to delete it. Reviewed by: cperciva Approved by: emaste (mentor) MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45023 (cherry picked from commit 9b30b96c1fa4ee0dfc540878fbb3247bf92d19eb) ObsoleteFiles.inc: Remove /var/db/portsnap This is a followup to commit "Remove remnants of portsnap(8)" (9b30b96c1fa4). I wasn't aware of OLD_DIRS. Approved by: markj (mentor) MFC after: 1 day MFC with: 9b30b96c1fa4 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45023 (cherry picked from commit 54bbcc09a72b5d7a581f51416c9e635a33c2f884) Approved by: markj (mentor) --- ObsoleteFiles.inc | 3 +++ etc/mtree/BSD.var.dist | 2 -- libexec/phttpget/phttpget.8 | 11 ++++------- tools/regression/iscsi/initiator-instructions.txt | 6 +++--- usr.bin/locate/locate/locate.rc | 2 +- usr.bin/locate/locate/updatedb.sh | 2 +- usr.sbin/freebsd-update/freebsd-update.sh | 8 ++++---- 7 files changed, 16 insertions(+), 18 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index b5253c28d42c..b99bd4f890e5 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20240509: Remove remnants of portsnap(8) +OLD_DIRS+=var/db/portsnap + # 20240419: new clang import which bumps version from 17 to 18 OLD_FILES+=usr/lib/clang/17/include/__clang_cuda_builtin_vars.h OLD_FILES+=usr/lib/clang/17/include/__clang_cuda_cmath.h diff --git a/etc/mtree/BSD.var.dist b/etc/mtree/BSD.var.dist index 6f2327b59f0c..0845d8a59f65 100644 --- a/etc/mtree/BSD.var.dist +++ b/etc/mtree/BSD.var.dist @@ -53,8 +53,6 @@ .. ports .. - portsnap - .. zfsd tags=package=zfs cases .. diff --git a/libexec/phttpget/phttpget.8 b/libexec/phttpget/phttpget.8 index b82c788c53c6..16e0be65cd4c 100644 --- a/libexec/phttpget/phttpget.8 +++ b/libexec/phttpget/phttpget.8 @@ -49,9 +49,7 @@ small files need to be downloaded. .Pp The .Xr freebsd-update 8 -and -.Xr portsnap 8 -tools use +tool uses .Nm to download binary patch files. .Sh ENVIRONMENT @@ -69,17 +67,16 @@ Timeout for HTTP request in seconds. .El .Sh SEE ALSO .Xr fetch 1 , -.Xr freebsd-update 8 , -.Xr portsnap 8 +.Xr freebsd-update 8 .Sh AUTHORS .An -nosplit The .Nm utility was written by .An Colin Percival Aq Mt cperciva@FreeBSD.org -for use with +initially for use with .Xr portsnap 8 -and later with +(now removed) and has been used by .Xr freebsd-update 8 . This manual page was written by .An Xin LI Aq Mt delphij@FreeBSD.org . diff --git a/tools/regression/iscsi/initiator-instructions.txt b/tools/regression/iscsi/initiator-instructions.txt index 11c3311cddb2..e99ff87fe379 100644 --- a/tools/regression/iscsi/initiator-instructions.txt +++ b/tools/regression/iscsi/initiator-instructions.txt @@ -3,9 +3,9 @@ How to prepare initiator virtual machines for iSCSI target testing 1. Install operating systems. - - FreeBSD: Use default settings for everything. Don't install - ports from the system installer, use "portsnap fetch extract" - after installation instead. + - FreeBSD: Use default settings for everything. Don't install ports + from the system installer, fetch a new ports tree after + installation instead. - Fedora: Change the environment to "Minimal install". diff --git a/usr.bin/locate/locate/locate.rc b/usr.bin/locate/locate/locate.rc index 404af4cc4a64..f004dea19508 100644 --- a/usr.bin/locate/locate/locate.rc +++ b/usr.bin/locate/locate/locate.rc @@ -15,7 +15,7 @@ #SEARCHPATHS="/" # paths unwanted in output -#PRUNEPATHS="/tmp /usr/tmp /var/tmp /var/db/portsnap /var/db/freebsd-update" +#PRUNEPATHS="/tmp /usr/tmp /var/tmp /var/db/freebsd-update" # directories unwanted in output #PRUNEDIRS=".zfs" diff --git a/usr.bin/locate/locate/updatedb.sh b/usr.bin/locate/locate/updatedb.sh index e874700afdb8..ff7ec7f6c18e 100644 --- a/usr.bin/locate/locate/updatedb.sh +++ b/usr.bin/locate/locate/updatedb.sh @@ -52,7 +52,7 @@ PATH=$LIBEXECDIR:/bin:/usr/bin:$PATH; export PATH : ${mklocatedb:=locate.mklocatedb} # make locate database program : ${FCODES:=/var/db/locate.database} # the database : ${SEARCHPATHS="/"} # directories to be put in the database -: ${PRUNEPATHS="/tmp /usr/tmp /var/tmp /var/db/portsnap /var/db/freebsd-update"} # unwanted directories +: ${PRUNEPATHS="/tmp /usr/tmp /var/tmp /var/db/freebsd-update"} # unwanted directories : ${PRUNEDIRS=".zfs"} # unwanted directories, in any parent : ${FILESYSTEMS="$(lsvfs | tail -n +3 | \ egrep -vw "loopback|network|synthetic|read-only|0" | \ diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh index 4a6a8d78330b..77b12a3756c2 100644 --- a/usr.sbin/freebsd-update/freebsd-update.sh +++ b/usr.sbin/freebsd-update/freebsd-update.sh @@ -1052,10 +1052,10 @@ IDS_check_params () { # a useful answer, use the server name specified by the user. # Put another way... look up _http._tcp.${SERVERNAME} and pick a server # from that; or if no servers are returned, use ${SERVERNAME}. -# This allows a user to specify "portsnap.freebsd.org" (in which case -# portsnap will select one of the mirrors) or "portsnap5.tld.freebsd.org" -# (in which case portsnap will use that particular server, since there -# won't be an SRV entry for that name). +# This allows a user to specify "update.FreeBSD.org" (in which case +# freebsd-update will select one of the mirrors) or "update1.freebsd.org" +# (in which case freebsd-update will use that particular server, since +# there won't be an SRV entry for that name). # # We ignore the Port field, since we are always going to use port 80. From nobody Thu May 9 08:20:17 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZlLp1qsvz5KrCk; Thu, 09 May 2024 08:20: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 4VZlLp14dfz4bGp; Thu, 9 May 2024 08:20:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715242818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nLmUZPMlDuvqpEaWRox5AEZPCbhSliCyR6RCJXId0Rs=; b=fjUNDRnyYhfOLPNlKwNCWhKE7yGpm+nCvOubeEWtV5RiPA0xIsQzCvQveNLodrU/uPKZ9i HcIdIUxG4k0nao2y1dtxYAO0dAG9SKfZFJbkq92+Exe65sjC644DGzhc4G+3AyHOzIqSI0 9ZyzzaPfeq8+MbLMuds/Yj26MaLPr13JT+mmy+58XWPz1A2rzoVpbbmaCO3foE6m642I1T clcMzVmapDVocflYUon9qRTyEpGJYhj0LQJBA51kb3uTP3pYLEzHaQ375uE+jd+K2PEX2G tdLUg1yV3bbPar2dOgdlDuQ90gougR8r5N/khQAsDDowLfVE0q/VyXC6m22dJQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715242818; a=rsa-sha256; cv=none; b=F9LrHxx6wpMz7Smj2JphhkwR0M8+pwdRgdfQMcEhO9P4lZN5w9jPPtGpYh0lRW18N/mSv7 7y/eqjObpE44UZOlWZ2yi6nivo0UGekWu4fEzReW7HbXOBH5dmD7R77ZJ1eFegapLaHYqw U2+F2D9YIh6Lf8ML5CTMMCPMFG3YcvAaDN+9SvuhLmjsn5JG9DCJOsgSBl2si7Nwm/Lysv YUtIk6H4zb0i7Dfe4u2a1tjgSwGBiEsuGpOdZ97u9dCXnDZZPUs9PGEN0w9NiuVzCrMFf7 E8j3Km1hFq/IMSf9DtDLsq6OqFUx1J/WY5JNdxQFKLBanbjRJre7/buFsYN/sQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715242818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nLmUZPMlDuvqpEaWRox5AEZPCbhSliCyR6RCJXId0Rs=; b=CWqm+cfE1FLIhjqQzGH2dIOZ0P/uyg64hYOkTSoWGCcnabVYj0Dm1SnXNeuH/MNyg5xNLv aBADt2l2ndG04nph7sV/y8ZrskTKdamhgjrwzye/KYAhcj7u2+E/zs0mHtWrwwYMnZIp4e vCaLB7H9BQjYD1Lft1bhasI4jLZHc+QZhPkz57VIb3oIQKG0kjMuGwfz0/7IzcUnvafBqJ M6xCJ2Lf6bFkUbXdA5bQ3QVkJZewSPvODIiRgvX+XxVeaIPN0XzUlb2AIrMdeKuey1+zV+ 9Ew8abbH/mdxl+FJCuG3gukovspR/wK2TE/gF7GXbd8EgwRvgnYlyokqt4NIHA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZlLp0h3pz10x1; Thu, 9 May 2024 08:20:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4498KHMK034299; Thu, 9 May 2024 08:20:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4498KHMp034283; Thu, 9 May 2024 08:20:17 GMT (envelope-from git) Date: Thu, 9 May 2024 08:20:17 GMT Message-Id: <202405090820.4498KHMp034283@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 2beba7b456e6 - releng/14.1 - Remove remnants of portsnap(8) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 2beba7b456e61cb13d450d2f106fc25201ad54ce Auto-Submitted: auto-generated The branch releng/14.1 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=2beba7b456e61cb13d450d2f106fc25201ad54ce commit 2beba7b456e61cb13d450d2f106fc25201ad54ce Author: Olivier Certner AuthorDate: 2024-04-22 13:02:46 +0000 Commit: Olivier Certner CommitDate: 2024-05-09 08:18:53 +0000 Remove remnants of portsnap(8) This was prompted by noticing that '/var/db/portsnap' still exists on newly-installed machines. With this change, all mentions of portsnap(8) in the tree are gone, except for the historical note in the AUTHORS section of manpage phttpget(8). locate(1) will thus start indexing again '/var/db/portsnap' on machines where this directory still exists, which may be a good way to push administrators to delete it. Reviewed by: cperciva Approved by: emaste (mentor) MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45023 (cherry picked from commit 9b30b96c1fa4ee0dfc540878fbb3247bf92d19eb) ObsoleteFiles.inc: Remove /var/db/portsnap This is a followup to commit "Remove remnants of portsnap(8)" (9b30b96c1fa4). I wasn't aware of OLD_DIRS. Approved by: markj (mentor) MFC after: 1 day MFC with: 9b30b96c1fa4 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45023 (cherry picked from commit 54bbcc09a72b5d7a581f51416c9e635a33c2f884) Approved by: markj (mentor) (cherry picked from commit 9f06e6c9907ae13dd1153958e0bc923097590d10) Approved by: markj (mentor) Approved by: re (cperciva) --- ObsoleteFiles.inc | 3 +++ etc/mtree/BSD.var.dist | 2 -- libexec/phttpget/phttpget.8 | 11 ++++------- tools/regression/iscsi/initiator-instructions.txt | 6 +++--- usr.bin/locate/locate/locate.rc | 2 +- usr.bin/locate/locate/updatedb.sh | 2 +- usr.sbin/freebsd-update/freebsd-update.sh | 8 ++++---- 7 files changed, 16 insertions(+), 18 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index b5253c28d42c..b99bd4f890e5 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20240509: Remove remnants of portsnap(8) +OLD_DIRS+=var/db/portsnap + # 20240419: new clang import which bumps version from 17 to 18 OLD_FILES+=usr/lib/clang/17/include/__clang_cuda_builtin_vars.h OLD_FILES+=usr/lib/clang/17/include/__clang_cuda_cmath.h diff --git a/etc/mtree/BSD.var.dist b/etc/mtree/BSD.var.dist index 6f2327b59f0c..0845d8a59f65 100644 --- a/etc/mtree/BSD.var.dist +++ b/etc/mtree/BSD.var.dist @@ -53,8 +53,6 @@ .. ports .. - portsnap - .. zfsd tags=package=zfs cases .. diff --git a/libexec/phttpget/phttpget.8 b/libexec/phttpget/phttpget.8 index b82c788c53c6..16e0be65cd4c 100644 --- a/libexec/phttpget/phttpget.8 +++ b/libexec/phttpget/phttpget.8 @@ -49,9 +49,7 @@ small files need to be downloaded. .Pp The .Xr freebsd-update 8 -and -.Xr portsnap 8 -tools use +tool uses .Nm to download binary patch files. .Sh ENVIRONMENT @@ -69,17 +67,16 @@ Timeout for HTTP request in seconds. .El .Sh SEE ALSO .Xr fetch 1 , -.Xr freebsd-update 8 , -.Xr portsnap 8 +.Xr freebsd-update 8 .Sh AUTHORS .An -nosplit The .Nm utility was written by .An Colin Percival Aq Mt cperciva@FreeBSD.org -for use with +initially for use with .Xr portsnap 8 -and later with +(now removed) and has been used by .Xr freebsd-update 8 . This manual page was written by .An Xin LI Aq Mt delphij@FreeBSD.org . diff --git a/tools/regression/iscsi/initiator-instructions.txt b/tools/regression/iscsi/initiator-instructions.txt index 11c3311cddb2..e99ff87fe379 100644 --- a/tools/regression/iscsi/initiator-instructions.txt +++ b/tools/regression/iscsi/initiator-instructions.txt @@ -3,9 +3,9 @@ How to prepare initiator virtual machines for iSCSI target testing 1. Install operating systems. - - FreeBSD: Use default settings for everything. Don't install - ports from the system installer, use "portsnap fetch extract" - after installation instead. + - FreeBSD: Use default settings for everything. Don't install ports + from the system installer, fetch a new ports tree after + installation instead. - Fedora: Change the environment to "Minimal install". diff --git a/usr.bin/locate/locate/locate.rc b/usr.bin/locate/locate/locate.rc index 404af4cc4a64..f004dea19508 100644 --- a/usr.bin/locate/locate/locate.rc +++ b/usr.bin/locate/locate/locate.rc @@ -15,7 +15,7 @@ #SEARCHPATHS="/" # paths unwanted in output -#PRUNEPATHS="/tmp /usr/tmp /var/tmp /var/db/portsnap /var/db/freebsd-update" +#PRUNEPATHS="/tmp /usr/tmp /var/tmp /var/db/freebsd-update" # directories unwanted in output #PRUNEDIRS=".zfs" diff --git a/usr.bin/locate/locate/updatedb.sh b/usr.bin/locate/locate/updatedb.sh index e874700afdb8..ff7ec7f6c18e 100644 --- a/usr.bin/locate/locate/updatedb.sh +++ b/usr.bin/locate/locate/updatedb.sh @@ -52,7 +52,7 @@ PATH=$LIBEXECDIR:/bin:/usr/bin:$PATH; export PATH : ${mklocatedb:=locate.mklocatedb} # make locate database program : ${FCODES:=/var/db/locate.database} # the database : ${SEARCHPATHS="/"} # directories to be put in the database -: ${PRUNEPATHS="/tmp /usr/tmp /var/tmp /var/db/portsnap /var/db/freebsd-update"} # unwanted directories +: ${PRUNEPATHS="/tmp /usr/tmp /var/tmp /var/db/freebsd-update"} # unwanted directories : ${PRUNEDIRS=".zfs"} # unwanted directories, in any parent : ${FILESYSTEMS="$(lsvfs | tail -n +3 | \ egrep -vw "loopback|network|synthetic|read-only|0" | \ diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh index 4a6a8d78330b..77b12a3756c2 100644 --- a/usr.sbin/freebsd-update/freebsd-update.sh +++ b/usr.sbin/freebsd-update/freebsd-update.sh @@ -1052,10 +1052,10 @@ IDS_check_params () { # a useful answer, use the server name specified by the user. # Put another way... look up _http._tcp.${SERVERNAME} and pick a server # from that; or if no servers are returned, use ${SERVERNAME}. -# This allows a user to specify "portsnap.freebsd.org" (in which case -# portsnap will select one of the mirrors) or "portsnap5.tld.freebsd.org" -# (in which case portsnap will use that particular server, since there -# won't be an SRV entry for that name). +# This allows a user to specify "update.FreeBSD.org" (in which case +# freebsd-update will select one of the mirrors) or "update1.freebsd.org" +# (in which case freebsd-update will use that particular server, since +# there won't be an SRV entry for that name). # # We ignore the Port field, since we are always going to use port 80. From nobody Thu May 9 13:16:25 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZswT4pcVz5JfYp; Thu, 09 May 2024 13:16: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 4VZswT4KCHz57fQ; Thu, 9 May 2024 13:16:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715260585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2sozntcgV3+66hPsAE0UNkz/lKrODmFLY5WlHRolKyU=; b=VFVvqkiBpcNwvFMz0tObwAACJGm9an/JTJMIUwi7jluSlnC8jMTCDzM+QtD3y9q1FmNoQf BFUZSz2Gu/Z0AJ7xZ0kKSl8GM3Ca2cJynY1uEI0/3kLiCyIjXlLxpQn0Z6oARLDUi2drOK NmxB6lNB9JYGrFUioWlfggySCVamqh1kB+dh+eapd4hjvOKpksjaOGBwZq88rbKxScJKoP JBq3bAcMS26DDdWT2CjKJqVnDg4L6Ko4GzDoHBHA+BGYYO+qd8HnyyvdR+1ITbrcHILDwR h/f/wLUhM355Hm4Rx41S4d96YZ3tHji9WRaIzGzniC2qY4Epu57efGO/J9htlw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715260585; a=rsa-sha256; cv=none; b=VWzp1B/SzwIsujgXh6bvO+pFlpWwpPfN0dMrCBzGcaNL95fkyAUBEoRyR9h2/Gdp/05Gkn UJ7vvK2ZybvlryKC3kUHNDEXAewOmKErLLX9iK8I205VXZRnSaZfo+L52ICuVdVIn/kYbF Qb+Mtgd+yDjPyH3Z4JQD21CwsrUAQ1HYeQWcmb64+I0rQzn2FKrSk0j2hAiNyD6FwKWgtp VRdGGmI19jGFF+4TIGSK43hzE2XpjPCkthi7TWc+figvksTSOx1zg+xVGq6WBJTqKdHRRP ZOpP4RsPH29bfY2KJSMENHKqHk93QUZhTODfs61ZmKDGrT3XYPngqoNJ/P5INg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715260585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2sozntcgV3+66hPsAE0UNkz/lKrODmFLY5WlHRolKyU=; b=VOVOGb+889OQ5Ym8X/OENp4uv3MZ9Dec+s53SppirKyLRRLZM5olKnVU5ZGhD+F6iAYsed YTcBYK7xbHi5QwvE3lpAl0AGG+UKlmTwYG5DIYISvV1T9K7Zt/n6lhsaCjZ8Srjx9K+mdO wEE/6oDyVmQAw45vmalqVvD8bTTD9iAEokl8yteoIGJ1WkWd5YmOl48Hu5rsrUOpAALKJB L6VB3lrlxLyWaqRlRh1RxxzwQ3e1qAuqg9Mgy/JKNgYLQE0sgIL2aXPXG+TiC4xgN2eyzO E+mok5HRwqdmD/bRLM8Wj6PfJv4WUgKqGnZ9aZNgtjNCzKrXHPxgJewHwqS6WQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZswT3sR0z19B2; Thu, 9 May 2024 13:16:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 449DGPig031889; Thu, 9 May 2024 13:16:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 449DGPdX031886; Thu, 9 May 2024 13:16:25 GMT (envelope-from git) Date: Thu, 9 May 2024 13:16:25 GMT Message-Id: <202405091316.449DGPdX031886@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 2f59ee828754 - stable/14 - pw: Rename some enums. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2f59ee8287548225e7c71db987574fe043ed1be4 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=2f59ee8287548225e7c71db987574fe043ed1be4 commit 2f59ee8287548225e7c71db987574fe043ed1be4 Author: Dag-Erling Smørgrav AuthorDate: 2024-05-06 16:18:39 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-09 10:59:02 +0000 pw: Rename some enums. Rename `M_PRINT` and `M_UPDATE` to `M_SHOW` and `M_MODIFY` to match the names of the commands they represent. No functional change intended. MFC after: 3 days Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D45096 (cherry picked from commit a9ea647c29cf510a164947251de0d34f53f2bca0) pw: Don't silently ignore unparsed command line arguments. MFC after: 3 days Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D45097 (cherry picked from commit c86119328e6b2cfeb4f9319f6b154524d88caaf4) pw: Test home directory ownership and mode. MFC after: 3 days Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D45099 (cherry picked from commit e12b7446bddcb91b869abef6048910cc15185a33) --- usr.sbin/pw/pw.c | 13 ++++++++-- usr.sbin/pw/pw.h | 22 +++++++++-------- usr.sbin/pw/pw_group.c | 35 ++++++++++++++++++++------ usr.sbin/pw/pw_user.c | 48 ++++++++++++++++++++++++++++-------- usr.sbin/pw/tests/pw_useradd_test.sh | 17 +++++++++++++ 5 files changed, 106 insertions(+), 29 deletions(-) diff --git a/usr.sbin/pw/pw.c b/usr.sbin/pw/pw.c index 063553dd084f..fc17f6dba022 100644 --- a/usr.sbin/pw/pw.c +++ b/usr.sbin/pw/pw.c @@ -101,13 +101,16 @@ static int (*cmdfunc[W_NUM][M_NUM])(int argc, char **argv, char *_name) = { struct pwconf conf; +static int mode = -1; +static int which = -1; + static int getindex(const char *words[], const char *word); static void cmdhelp(int mode, int which); int main(int argc, char *argv[]) { - int mode = -1, which = -1, tmp; + int tmp; struct stat st; char arg, *arg1; bool relocated, nis; @@ -375,5 +378,11 @@ cmdhelp(int mode, int which) fprintf(stderr, "%s", help[which][mode]); } - exit(EXIT_FAILURE); + exit(EX_USAGE); +} + +void +usage(void) +{ + cmdhelp(mode, which); } diff --git a/usr.sbin/pw/pw.h b/usr.sbin/pw/pw.h index 5de333ce5e71..c3725693f91d 100644 --- a/usr.sbin/pw/pw.h +++ b/usr.sbin/pw/pw.h @@ -36,14 +36,14 @@ enum _mode { - M_ADD, - M_DELETE, - M_UPDATE, - M_PRINT, + M_ADD, + M_DELETE, + M_MODIFY, + M_SHOW, M_NEXT, M_LOCK, M_UNLOCK, - M_NUM + M_NUM }; enum _passmode @@ -56,13 +56,13 @@ enum _passmode enum _which { - W_USER, - W_GROUP, - W_NUM + W_USER, + W_GROUP, + W_NUM }; -#define _DEF_DIRMODE (S_IRWXU | S_IRWXG | S_IRWXO) -#define _PW_CONF "pw.conf" +#define _DEF_DIRMODE (S_IRWXU | S_IRWXG | S_IRWXO) +#define _PW_CONF "pw.conf" #define _UC_MAXLINE 1024 #define _UC_MAXSHELLS 32 @@ -114,3 +114,5 @@ uintmax_t strtounum(const char * __restrict, uintmax_t, uintmax_t, const char ** __restrict); bool grp_has_member(struct group *grp, const char *name); + +void usage(void); diff --git a/usr.sbin/pw/pw_group.c b/usr.sbin/pw/pw_group.c index 32dec769fb1a..1941c03aa2c5 100644 --- a/usr.sbin/pw/pw_group.c +++ b/usr.sbin/pw/pw_group.c @@ -273,9 +273,13 @@ pw_group_next(int argc, char **argv, char *arg1 __unused) quiet = true; break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); if (quiet) freopen(_PATH_DEVNULL, "w", stderr); @@ -332,9 +336,13 @@ pw_group_show(int argc, char **argv, char *arg1) all = true; break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); if (quiet) freopen(_PATH_DEVNULL, "w", stderr); @@ -391,9 +399,13 @@ pw_group_del(int argc, char **argv, char *arg1) nis = true; break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); if (quiet) freopen(_PATH_DEVNULL, "w", stderr); @@ -551,9 +563,13 @@ pw_group_add(int argc, char **argv, char *arg1) nis = true; break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); if (quiet) freopen(_PATH_DEVNULL, "w", stderr); @@ -645,9 +661,14 @@ pw_group_mod(int argc, char **argv, char *arg1) nis = true; break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); + if (quiet) freopen(_PATH_DEVNULL, "w", stderr); cnf = get_userconfig(cfg); @@ -697,11 +718,11 @@ pw_group_mod(int argc, char **argv, char *arg1) if ((grp = GETGRNAM(name)) == NULL) errx(EX_SOFTWARE, "group disappeared during update"); - pw_log(cnf, M_UPDATE, W_GROUP, "%s(%ju)", grp->gr_name, + pw_log(cnf, M_MODIFY, W_GROUP, "%s(%ju)", grp->gr_name, (uintmax_t)grp->gr_gid); if (nis && nis_update() == 0) - pw_log(cnf, M_UPDATE, W_GROUP, "NIS maps updated"); + pw_log(cnf, M_MODIFY, W_GROUP, "NIS maps updated"); return (EXIT_SUCCESS); } diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c index 6875d931a1d2..89354b249935 100644 --- a/usr.sbin/pw/pw_user.c +++ b/usr.sbin/pw/pw_user.c @@ -146,7 +146,7 @@ create_and_populate_homedir(struct userconf *cnf, struct passwd *pwd, copymkdir(conf.rootfd, pwd->pw_dir, skelfd, homemode, pwd->pw_uid, pwd->pw_gid, 0); - pw_log(cnf, update ? M_UPDATE : M_ADD, W_USER, "%s(%ju) home %s made", + pw_log(cnf, update ? M_MODIFY : M_ADD, W_USER, "%s(%ju) home %s made", pwd->pw_name, (uintmax_t)pwd->pw_uid, pwd->pw_dir); } @@ -708,9 +708,13 @@ pw_user_next(int argc, char **argv, char *name __unused) quiet = true; break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); if (quiet) freopen(_PATH_DEVNULL, "w", stderr); @@ -772,9 +776,13 @@ pw_user_show(int argc, char **argv, char *arg1) v7 = true; break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); if (quiet) freopen(_PATH_DEVNULL, "w", stderr); @@ -855,9 +863,13 @@ pw_user_del(int argc, char **argv, char *arg1) nis = true; break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); if (quiet) freopen(_PATH_DEVNULL, "w", stderr); @@ -1003,9 +1015,13 @@ pw_user_lock(int argc, char **argv, char *arg1) /* compatibility */ break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); return (pw_userlock(arg1, M_LOCK)); } @@ -1022,9 +1038,13 @@ pw_user_unlock(int argc, char **argv, char *arg1) /* compatibility */ break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); return (pw_userlock(arg1, M_UNLOCK)); } @@ -1291,9 +1311,13 @@ pw_user_add(int argc, char **argv, char *arg1) nis = true; break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); if (geteuid() != 0 && ! dryrun) errx(EX_NOPERM, "you must be root"); @@ -1604,9 +1628,13 @@ pw_user_mod(int argc, char **argv, char *arg1) nis = true; break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); if (geteuid() != 0 && ! dryrun) errx(EX_NOPERM, "you must be root"); @@ -1787,7 +1815,7 @@ pw_user_mod(int argc, char **argv, char *arg1) if (pwd == NULL) errx(EX_NOUSER, "user '%s' disappeared during update", name); grp = GETGRGID(pwd->pw_gid); - pw_log(cnf, M_UPDATE, W_USER, "%s(%ju):%s(%ju):%s:%s:%s", + pw_log(cnf, M_MODIFY, W_USER, "%s(%ju):%s(%ju):%s:%s:%s", pwd->pw_name, (uintmax_t)pwd->pw_uid, grp ? grp->gr_name : "unknown", (uintmax_t)(grp ? grp->gr_gid : (uid_t)-1), @@ -1808,7 +1836,7 @@ pw_user_mod(int argc, char **argv, char *arg1) } if (nis && nis_update() == 0) - pw_log(cnf, M_UPDATE, W_USER, "NIS maps updated"); + pw_log(cnf, M_MODIFY, W_USER, "NIS maps updated"); return (EXIT_SUCCESS); } diff --git a/usr.sbin/pw/tests/pw_useradd_test.sh b/usr.sbin/pw/tests/pw_useradd_test.sh index 3b495482eb05..b4efa42bada7 100755 --- a/usr.sbin/pw/tests/pw_useradd_test.sh +++ b/usr.sbin/pw/tests/pw_useradd_test.sh @@ -313,6 +313,22 @@ user_add_R_intermed_body() { test -d ${HOME}/a/b/c/foo || atf_fail "user directory not created" } +atf_test_case user_add_dir +user_add_dir_body() { + populate_root_etc_skel + + atf_check -s exit:0 ${RPW} useradd foo -M 0705 -m + atf_check grep -q '^foo:' $HOME/etc/master.passwd + atf_check test -d ${HOME}/home/foo + atf_check -o save:ugid \ + awk -F: '$1 == "foo" { print $3, $4 }' \ + $HOME/etc/master.passwd + atf_check -o file:ugid \ + stat -f '%u %g' ${HOME}/home/foo + atf_check -o inline:"40705\n" \ + stat -f '%p' ${HOME}/home/foo +} + atf_test_case user_add_skel user_add_skel_body() { populate_root_etc_skel @@ -511,6 +527,7 @@ atf_init_test_cases() { atf_add_test_case user_add_R atf_add_test_case user_add_R_no_symlink atf_add_test_case user_add_R_intermed + atf_add_test_case user_add_dir atf_add_test_case user_add_skel atf_add_test_case user_add_uid0 atf_add_test_case user_add_uid_too_large From nobody Thu May 9 13:16:26 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZswV63Clz5Jffg; Thu, 09 May 2024 13:16: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 4VZswV5X44z57ky; Thu, 9 May 2024 13:16:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715260586; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+cWG2/l1D1XEJN0fFWo9d0FE6a0UD2uWRoI2HAw9rD4=; b=cxEHRNACbgsuxIQbQZ99nK5vBdyMQYgBEewL770Tm9Hq8s3PDh64JSGXJIvD8WOpj/jLxT WTdEdR/o5zWA554wSA+8M4YLVg516U0KdOxKuXxiUkFJ68HfSBZ7h3kKK+7IaYSNvmp4Be UpqlHGBOxBk3B4eQfrZ9Ow9I4eYJHef/82q+GXsH8iGo3+L7Qhh23x9XX0g5siAXUu7Hxk LfpLh2FZvQgxzBTc4pZE0y8UEJiQbIclMFP8sUzg6fP63LE2iq9YtfVYU6y2cfK22q/Lnl GtpYFt647UhXhhQHsZ8LeUFiHU61xShLnxKGUIymW/XjrWPkX6abAnAnOnrOxg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715260586; a=rsa-sha256; cv=none; b=ls5MnUiZpwNlhOSDOqYwOva0k//pNrgN1bXiJ2rE907TfZk8v/6sQtblJeSaZLqEOuNvMV D8mA7NS1ydLN9J4YToSw/ZvsGTAMqFIIw3PovhUw5Inj9CWrWcHKkrlYnVFqPY5xpisgty ehY0iTGj43HA45eguWgcgDbHfD3N+EpZ41m22Q7OeTRMqFaunydrdtZVHwpGZqd6R+eIdD SbFeEKB7wvpEFlYxltwDmq7xi9NNwgNS6ISenGjDAeqHMOctOCNX34HzJc0QV6en5y80hS z5tHoDhqHr6eLoBV44p1GmBCdFQizO7OtBAwqYADpNOF2Iz9hLbkB8t/UcKz4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715260586; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+cWG2/l1D1XEJN0fFWo9d0FE6a0UD2uWRoI2HAw9rD4=; b=EzmdKH0AgC+DGPkHeQrmMM/2sXJ6Ah7Xen7ioQ2iJUhnqSzdvuWzNGpbE0JqrYuFvYLv/j AKhLcizkQEurY0apOWAScvWDvQKrZ51+a/VjwXb3gJHfTlVh199jXks5LT+wNUQKDtDjgH WjDVsl1AGB0eSuq75sTPClpGVOAe1Gd65o1lWpgLf18LhWNMDxy3uTHBGM+2vUcsiv7XJ6 XOXXSa0U2lZHtUiDGR1MyglqnAhiwKxIQ9IZgpYvZFWlT0cBuq/mOrTv5+VFUmnkKGuv5A m9L5mWebtAxOToLgeWPzptcIYujz1rYqW/nqS6uf9bWzZrMObsRrvlar/ShZdg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZswV4rJfz1953; Thu, 9 May 2024 13:16:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 449DGQ6j031942; Thu, 9 May 2024 13:16:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 449DGQSv031939; Thu, 9 May 2024 13:16:26 GMT (envelope-from git) Date: Thu, 9 May 2024 13:16:26 GMT Message-Id: <202405091316.449DGQSv031939@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: e121845426c8 - stable/14 - adduser: Fix confusion between `uclass` and `_class`. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e121845426c8d587491370432de0657099a22843 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=e121845426c8d587491370432de0657099a22843 commit e121845426c8d587491370432de0657099a22843 Author: Dag-Erling Smørgrav AuthorDate: 2024-05-06 16:18:47 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-09 10:59:03 +0000 adduser: Fix confusion between `uclass` and `_class`. This caused adduser to produce an invalid `pw(8)` command line. Due to bugs in `pw(8)`, the command line was silently accepted and led to the user being created, but locked out and with no home directory. Also fix the default value for the “Another user?” prompt. Fixes: 170d0882903e MFC after: 3 days Reviewed by: karels, allanjude Differential Revision: https://reviews.freebsd.org/D45098 (cherry picked from commit 46c4e86ebf1819fc09084c8aa79423d96fcaad4a) --- usr.sbin/adduser/adduser.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/adduser/adduser.sh b/usr.sbin/adduser/adduser.sh index e9027b6b7876..61a4b3b5058f 100644 --- a/usr.sbin/adduser/adduser.sh +++ b/usr.sbin/adduser/adduser.sh @@ -194,7 +194,7 @@ save_config() { # add_user() { local _uid _name _comment _gecos _home _group _grouplist _shell _class - local _dotdir _expire _pwexpire _passwd _upasswd _passwdmethod + local _dotdir _expire _pwexpire _passwd _upasswd _passwdmethod _pwcmd # Is this a configuration run? If so, don't modify user database. # @@ -519,7 +519,7 @@ get_uid() { # Reads login class of account. Can be used in interactive or batch mode. # get_class() { - local _input _uclass + local _input _class uclass="$defaultclass" _class=${uclass:-"default"} @@ -740,7 +740,6 @@ input_interactive() { local _logingroup_ok="no" local _groups_ok="no" local _all_ok="yes" - local _another_user="no" case $passwdtype in none) _emptypass="yes" @@ -1129,6 +1128,7 @@ if [ -n "$fflag" ]; then else input_interactive while : ; do + _another_user="no" if [ -z "$configflag" ]; then echo -n "Add another user? (yes/no) [$_another_user]: " else From nobody Thu May 9 13:16:52 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZsx12TN1z5JfnL; Thu, 09 May 2024 13:16: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 4VZsx106LYz584G; Thu, 9 May 2024 13:16:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715260613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8hcTek0FEOa2Y4ZiTHCsC6ssmvkZW8TYUJHCwI2SQxQ=; b=vexMNe0T0HF+81MalcPINt7vZF9+cdl434Uy/bThsjWpESvm2pVaJltJNyPNWeXBhWrU+j RKuvTc6K6H4EqE1UR8k4kY4EZbJRbcu81fB/JNDpU2TuhBwVqKMszQFeHpwrHrt3sjqpxr pLTGHupzdSTHV4wnsnAlD3qp1iUvWQZu+yqb6lBOCk+wxJgzgS1OygGjTCjd2g5DxB0rfb K3bVqxl0NwbtvTcpxCyhKagamGRTscO/4pDB69/lU5sq0DVRuI+vFvUFylq9pSgTE1btWb r3hE0bbawdnZ4iOQf1v3ysDjavVxPBwFh+GBeE8VBF5fH3SkEhL7r4NL+wVuTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715260613; a=rsa-sha256; cv=none; b=aK53HdPT/1P8Y4yPjP9xRBVKDuy5i42GpPL7Avvt+N4WRaZ8SJ2nrm8Sn/uWF/YPxtTGSK +Kg5Pp2Ynlo8Mdz2n6x2Wvla814tl0jm66bYCKXtHq8+juKbBst1CC5IW/rQOokw016E42 w8QP1t5moV3RlDYYVQCdt0W95Z9n/TbwJB8SEMEL6TgIqNfc1zt99lG0rrGDi5Mv47Nfzg YFYGDxx7FWRrvjruurSo0772F8qBUZ0ZQGKPEVOfMjx/OmLaIfWTJnk3ysJHmbmVBhAKxT xk+/eWJzFIfnlxgWMjfCWihbo1EY5bRQSdLluR4GgDRKF9hR8lXIgAzAOtAneQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715260613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8hcTek0FEOa2Y4ZiTHCsC6ssmvkZW8TYUJHCwI2SQxQ=; b=ZEtQcd1EXaUw6K2mE8yuAR7zOMAOPuqW8ec/9u6wxmdfNMzHC/OHHkk0fy08zI2HKeyZvy 1qwXhcTbC5ABXw+gv5wwZhvoy8nQ1Fdj0iXjQmtFmYH+U3A7fVN4rPI4NYJLbFrmkU/nzN pbDLLz3zRC1BY4H0xvYDN39I1u3qg96UaWAvaAXdT1rY/CBr7taar7YGSQcPLMRGEfiFta 05Cj7mwL2uBi+eSlkKDo5GJc2GT57IYyu5f2bL1csBnKX6NJjEyX3XzQLnKMuC3eGQIj1Q yyMl/gt9nnWn0C2Hh9AcPVrMEMfyCdWboSu1kGLA0Pj/Ktxa6w9bUYgAEAHuRw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZsx06qdGz18rl; Thu, 9 May 2024 13:16:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 449DGq76032184; Thu, 9 May 2024 13:16:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 449DGq8G032181; Thu, 9 May 2024 13:16:52 GMT (envelope-from git) Date: Thu, 9 May 2024 13:16:52 GMT Message-Id: <202405091316.449DGq8G032181@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 3532d9c66ece - stable/13 - pw: Ensure group membership is not duplicated List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3532d9c66ecefd356ec670f014e4647537b59ef1 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=3532d9c66ecefd356ec670f014e4647537b59ef1 commit 3532d9c66ecefd356ec670f014e4647537b59ef1 Author: Naman Sood AuthorDate: 2023-07-19 12:44:21 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-09 11:04:30 +0000 pw: Ensure group membership is not duplicated Fix the following problem: 1. A nonexistent user, someuser, is added to somegroup in /etc/group. 2. someuser is then created with membership in somegroup. The entry for somegroup in /etc/group will then contain somegroup:*:12345:someuser,someuser With this fix, the entry will be somegroup:*:12345:someuser PR: 238995 Reviewed by: bapt, jrm Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41076 (cherry picked from commit 17839f45d86e79065a65ad3e2522dd69b29a652c) --- usr.sbin/pw/pw.h | 2 ++ usr.sbin/pw/pw_group.c | 2 +- usr.sbin/pw/pw_user.c | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/usr.sbin/pw/pw.h b/usr.sbin/pw/pw.h index 54a49f3d691a..5de333ce5e71 100644 --- a/usr.sbin/pw/pw.h +++ b/usr.sbin/pw/pw.h @@ -112,3 +112,5 @@ extern const char *Which[]; uintmax_t strtounum(const char * __restrict, uintmax_t, uintmax_t, const char ** __restrict); + +bool grp_has_member(struct group *grp, const char *name); diff --git a/usr.sbin/pw/pw_group.c b/usr.sbin/pw/pw_group.c index 91300afe3c23..32dec769fb1a 100644 --- a/usr.sbin/pw/pw_group.c +++ b/usr.sbin/pw/pw_group.c @@ -413,7 +413,7 @@ pw_group_del(int argc, char **argv, char *arg1) return (EXIT_SUCCESS); } -static bool +bool grp_has_member(struct group *grp, const char *name) { int j; diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c index 78cdfc98c447..ac04dc2fa89b 100644 --- a/usr.sbin/pw/pw_user.c +++ b/usr.sbin/pw/pw_user.c @@ -1454,6 +1454,9 @@ pw_user_add(int argc, char **argv, char *arg1) if (cmdcnf->groups != NULL) { for (i = 0; i < cmdcnf->groups->sl_cur; i++) { grp = GETGRNAM(cmdcnf->groups->sl_str[i]); + /* gr_add doesn't check if new member is already in group */ + if (grp_has_member(grp, pwd->pw_name)) + continue; grp = gr_add(grp, pwd->pw_name); /* * grp can only be NULL in 2 cases: From nobody Thu May 9 13:16:53 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZsx230pKz5Jfts; Thu, 09 May 2024 13:16: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 4VZsx21LvDz586W; Thu, 9 May 2024 13:16:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715260614; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=le0eLlIBsnhzCIkkTitdrdw99Dh5A+MixipMFrlnYlU=; b=oDEuZ/basrpfwj91qIahoAsPXaL2CIsLd48KmoddK4ilSRx3D1Qpbflg3BzcDEWYffyn3d BT16KwV7AZdRmYFVxqWPhTwqLGR5I+Cgu2CF4NuikuNc1SERUOCIVNfbo8vA3yRmVNbDBB eIhg/zdp6CvcLQij2R9I3eN/HCfXBmQdVxbJ7/r9YeFEctp4v3Ka8VAsX+ifWEvy5fkd+k 5gqPQ3OH+nzLXiO8qfqEJyGYiL8cpHpDYTgdKRLLG60fh45mdo/34C5hPyxGdJDKXFy4LG m44kMf1Vvi5Bl/vcNcciqwYgNsAxY4i4d7TxUkv+8nD/m25xcqMs5XYDsqVuzA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715260614; a=rsa-sha256; cv=none; b=B65wHextgqcqhTVUq1XD0vwvT6J9LM41kDrA6jrSElUHK9IVtJfpOqz0X7mvCFNX3tScxr bbHrAN9jqstEA1FfnaBHYYBeOQoWMWrOj7+VTdl0cnqPCqJpSAm1CR3fJbvNi5C8edfUX9 EN5Cf/ALyJLXrklq58Z4rrvNLbA48JmSBRhx7cwVWiXIfE+xanbAVBWL+HD9MB9vIvD11m Ot/KeGD45VbcwKGXMZbIucqlHVHcBt0HnHuhsjcMc0+LWqARaxwLcA/F30LIWdvaYaCbBG rDPGVZ9MffSlfJVEyYqk8agY5jWC54ViPmpBmqkHOdj/8jhpV+DP3HP9q7d3Fw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715260614; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=le0eLlIBsnhzCIkkTitdrdw99Dh5A+MixipMFrlnYlU=; b=mJmeFL19EBAX/ARxblkKeE3KcKzCk9FIFLJuQJHmt9+Uozxh5wa4oTim4fVODTCbht4sNo e5KbLcOg+K4/HnNYBjg44qB3Q6UVNL7HuxhLJO8+1xX0RP64gRRaV2V/Okj3lSi19WhfWe 6QYLU+9UF535wx6woukVbEViq7+3xCEeuFt7puAb1SEiz8zD8kiUn11rGo8quIWAQN/+pI u049p8bhqZCxiQhZCpCWjGOOc8llPhowOzWjZhaqOObJN04jaOXntx1V/1nRD7iGFDFRLk 04JOZfqU9rRlrUuv6caQTy7rgr+U8oMT0vrNkZarnDxWdXcVGKZaklUU2asgXA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZsx20hVTz18fy; Thu, 9 May 2024 13:16:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 449DGrmi032226; Thu, 9 May 2024 13:16:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 449DGr23032223; Thu, 9 May 2024 13:16:53 GMT (envelope-from git) Date: Thu, 9 May 2024 13:16:53 GMT Message-Id: <202405091316.449DGr23032223@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: e3bd4b9288cc - stable/13 - pw: Rename some enums. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e3bd4b9288cc05ac4b9e6bf7574d4d2f10ae02a2 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=e3bd4b9288cc05ac4b9e6bf7574d4d2f10ae02a2 commit e3bd4b9288cc05ac4b9e6bf7574d4d2f10ae02a2 Author: Dag-Erling Smørgrav AuthorDate: 2024-05-06 16:18:39 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-09 11:05:35 +0000 pw: Rename some enums. Rename `M_PRINT` and `M_UPDATE` to `M_SHOW` and `M_MODIFY` to match the names of the commands they represent. No functional change intended. MFC after: 3 days Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D45096 (cherry picked from commit a9ea647c29cf510a164947251de0d34f53f2bca0) pw: Don't silently ignore unparsed command line arguments. MFC after: 3 days Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D45097 (cherry picked from commit c86119328e6b2cfeb4f9319f6b154524d88caaf4) pw: Test home directory ownership and mode. MFC after: 3 days Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D45099 (cherry picked from commit e12b7446bddcb91b869abef6048910cc15185a33) --- usr.sbin/pw/pw.c | 13 ++++++++-- usr.sbin/pw/pw.h | 22 +++++++++-------- usr.sbin/pw/pw_group.c | 35 ++++++++++++++++++++------ usr.sbin/pw/pw_user.c | 48 ++++++++++++++++++++++++++++-------- usr.sbin/pw/tests/pw_useradd_test.sh | 17 +++++++++++++ 5 files changed, 106 insertions(+), 29 deletions(-) diff --git a/usr.sbin/pw/pw.c b/usr.sbin/pw/pw.c index 063553dd084f..fc17f6dba022 100644 --- a/usr.sbin/pw/pw.c +++ b/usr.sbin/pw/pw.c @@ -101,13 +101,16 @@ static int (*cmdfunc[W_NUM][M_NUM])(int argc, char **argv, char *_name) = { struct pwconf conf; +static int mode = -1; +static int which = -1; + static int getindex(const char *words[], const char *word); static void cmdhelp(int mode, int which); int main(int argc, char *argv[]) { - int mode = -1, which = -1, tmp; + int tmp; struct stat st; char arg, *arg1; bool relocated, nis; @@ -375,5 +378,11 @@ cmdhelp(int mode, int which) fprintf(stderr, "%s", help[which][mode]); } - exit(EXIT_FAILURE); + exit(EX_USAGE); +} + +void +usage(void) +{ + cmdhelp(mode, which); } diff --git a/usr.sbin/pw/pw.h b/usr.sbin/pw/pw.h index 5de333ce5e71..c3725693f91d 100644 --- a/usr.sbin/pw/pw.h +++ b/usr.sbin/pw/pw.h @@ -36,14 +36,14 @@ enum _mode { - M_ADD, - M_DELETE, - M_UPDATE, - M_PRINT, + M_ADD, + M_DELETE, + M_MODIFY, + M_SHOW, M_NEXT, M_LOCK, M_UNLOCK, - M_NUM + M_NUM }; enum _passmode @@ -56,13 +56,13 @@ enum _passmode enum _which { - W_USER, - W_GROUP, - W_NUM + W_USER, + W_GROUP, + W_NUM }; -#define _DEF_DIRMODE (S_IRWXU | S_IRWXG | S_IRWXO) -#define _PW_CONF "pw.conf" +#define _DEF_DIRMODE (S_IRWXU | S_IRWXG | S_IRWXO) +#define _PW_CONF "pw.conf" #define _UC_MAXLINE 1024 #define _UC_MAXSHELLS 32 @@ -114,3 +114,5 @@ uintmax_t strtounum(const char * __restrict, uintmax_t, uintmax_t, const char ** __restrict); bool grp_has_member(struct group *grp, const char *name); + +void usage(void); diff --git a/usr.sbin/pw/pw_group.c b/usr.sbin/pw/pw_group.c index 32dec769fb1a..1941c03aa2c5 100644 --- a/usr.sbin/pw/pw_group.c +++ b/usr.sbin/pw/pw_group.c @@ -273,9 +273,13 @@ pw_group_next(int argc, char **argv, char *arg1 __unused) quiet = true; break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); if (quiet) freopen(_PATH_DEVNULL, "w", stderr); @@ -332,9 +336,13 @@ pw_group_show(int argc, char **argv, char *arg1) all = true; break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); if (quiet) freopen(_PATH_DEVNULL, "w", stderr); @@ -391,9 +399,13 @@ pw_group_del(int argc, char **argv, char *arg1) nis = true; break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); if (quiet) freopen(_PATH_DEVNULL, "w", stderr); @@ -551,9 +563,13 @@ pw_group_add(int argc, char **argv, char *arg1) nis = true; break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); if (quiet) freopen(_PATH_DEVNULL, "w", stderr); @@ -645,9 +661,14 @@ pw_group_mod(int argc, char **argv, char *arg1) nis = true; break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); + if (quiet) freopen(_PATH_DEVNULL, "w", stderr); cnf = get_userconfig(cfg); @@ -697,11 +718,11 @@ pw_group_mod(int argc, char **argv, char *arg1) if ((grp = GETGRNAM(name)) == NULL) errx(EX_SOFTWARE, "group disappeared during update"); - pw_log(cnf, M_UPDATE, W_GROUP, "%s(%ju)", grp->gr_name, + pw_log(cnf, M_MODIFY, W_GROUP, "%s(%ju)", grp->gr_name, (uintmax_t)grp->gr_gid); if (nis && nis_update() == 0) - pw_log(cnf, M_UPDATE, W_GROUP, "NIS maps updated"); + pw_log(cnf, M_MODIFY, W_GROUP, "NIS maps updated"); return (EXIT_SUCCESS); } diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c index ac04dc2fa89b..ebe80977fa0e 100644 --- a/usr.sbin/pw/pw_user.c +++ b/usr.sbin/pw/pw_user.c @@ -163,7 +163,7 @@ create_and_populate_homedir(struct userconf *cnf, struct passwd *pwd, copymkdir(conf.rootfd, pwd->pw_dir, skelfd, homemode, pwd->pw_uid, pwd->pw_gid, 0); - pw_log(cnf, update ? M_UPDATE : M_ADD, W_USER, "%s(%ju) home %s made", + pw_log(cnf, update ? M_MODIFY : M_ADD, W_USER, "%s(%ju) home %s made", pwd->pw_name, (uintmax_t)pwd->pw_uid, pwd->pw_dir); } @@ -756,9 +756,13 @@ pw_user_next(int argc, char **argv, char *name __unused) quiet = true; break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); if (quiet) freopen(_PATH_DEVNULL, "w", stderr); @@ -820,9 +824,13 @@ pw_user_show(int argc, char **argv, char *arg1) v7 = true; break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); if (quiet) freopen(_PATH_DEVNULL, "w", stderr); @@ -903,9 +911,13 @@ pw_user_del(int argc, char **argv, char *arg1) nis = true; break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); if (quiet) freopen(_PATH_DEVNULL, "w", stderr); @@ -1055,9 +1067,13 @@ pw_user_lock(int argc, char **argv, char *arg1) /* compatibility */ break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); return (pw_userlock(arg1, M_LOCK)); } @@ -1074,9 +1090,13 @@ pw_user_unlock(int argc, char **argv, char *arg1) /* compatibility */ break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); return (pw_userlock(arg1, M_UNLOCK)); } @@ -1343,9 +1363,13 @@ pw_user_add(int argc, char **argv, char *arg1) nis = true; break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); if (geteuid() != 0 && ! dryrun) errx(EX_NOPERM, "you must be root"); @@ -1656,9 +1680,13 @@ pw_user_mod(int argc, char **argv, char *arg1) nis = true; break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); if (geteuid() != 0 && ! dryrun) errx(EX_NOPERM, "you must be root"); @@ -1839,7 +1867,7 @@ pw_user_mod(int argc, char **argv, char *arg1) if (pwd == NULL) errx(EX_NOUSER, "user '%s' disappeared during update", name); grp = GETGRGID(pwd->pw_gid); - pw_log(cnf, M_UPDATE, W_USER, "%s(%ju):%s(%ju):%s:%s:%s", + pw_log(cnf, M_MODIFY, W_USER, "%s(%ju):%s(%ju):%s:%s:%s", pwd->pw_name, (uintmax_t)pwd->pw_uid, grp ? grp->gr_name : "unknown", (uintmax_t)(grp ? grp->gr_gid : (uid_t)-1), @@ -1860,7 +1888,7 @@ pw_user_mod(int argc, char **argv, char *arg1) } if (nis && nis_update() == 0) - pw_log(cnf, M_UPDATE, W_USER, "NIS maps updated"); + pw_log(cnf, M_MODIFY, W_USER, "NIS maps updated"); return (EXIT_SUCCESS); } diff --git a/usr.sbin/pw/tests/pw_useradd_test.sh b/usr.sbin/pw/tests/pw_useradd_test.sh index b191d51104f7..93a192c59409 100755 --- a/usr.sbin/pw/tests/pw_useradd_test.sh +++ b/usr.sbin/pw/tests/pw_useradd_test.sh @@ -305,6 +305,22 @@ user_add_R_symlink_body() { atf_check -s exit:0 -o inline:"usr/home\n" readlink ${HOME}/home } +atf_test_case user_add_dir +user_add_dir_body() { + populate_root_etc_skel + + atf_check -s exit:0 ${RPW} useradd foo -M 0705 -m + atf_check grep -q '^foo:' $HOME/etc/master.passwd + atf_check test -d ${HOME}/home/foo + atf_check -o save:ugid \ + awk -F: '$1 == "foo" { print $3, $4 }' \ + $HOME/etc/master.passwd + atf_check -o file:ugid \ + stat -f '%u %g' ${HOME}/home/foo + atf_check -o inline:"40705\n" \ + stat -f '%p' ${HOME}/home/foo +} + atf_test_case user_add_skel user_add_skel_body() { populate_root_etc_skel @@ -479,6 +495,7 @@ atf_init_test_cases() { atf_add_test_case user_add_password_from_h atf_add_test_case user_add_R atf_add_test_case user_add_R_symlink + atf_add_test_case user_add_dir atf_add_test_case user_add_skel atf_add_test_case user_add_uid0 atf_add_test_case user_add_uid_too_large From nobody Thu May 9 13:16:55 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZsx34cH0z5Jfqy; Thu, 09 May 2024 13: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 4VZsx325Zxz58C6; Thu, 9 May 2024 13:16:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715260615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HzgqFkkP9/Lo9zr9nCTh3jIsHzwPbY5w+ZtpjGU5yGY=; b=BZ70V046znUG5EVjiPohcwlpgGymNwBglGPxXg2woCjKSipL/qKn9thzLBv9iBwa2Jf9c4 I4ksqSniWvaiEu+1JTTLZBp6dt9bzUaBJP+vGww6K/Mck2FuwIQrNVftY5z8Ti+eiVFeXL Lyp0lr6l47pbopPITY69U/0yQTTUPOQ2Etu6/qWldowgBj1YxgBvF6wUn6esvupwQMOp/7 ZcFs1cML4tkt9OizYYvRg31ehhWd4CaLzhvsNMTSRn2yuyw9bY8aAO4DbPzf3GIga+DxW0 xd0MRXOW5+K0NBZh16wnnbBE1EgVP9wpsHyfGJpQTLGgBTJlggx+5AAQcfsvvg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715260615; a=rsa-sha256; cv=none; b=dBibhS+FAnakbddwW2tVAdUQkj6lh5rRA+uO901x5TDNgzK046zStAtjBLbkXK+Psf62xA pr9kqtIsqH/aImPbWgAQENQy0AYjUZ0cFzjOEgj4X08TB3UGNbWJQVck7Ju9HC9oHX12BN MeiSuPWlya5htHtq8YE7vgxZ23ge9yYL8tXeMcY7rUVdJL3pLdr4AG1MnaZxYw8lWtb3y/ qIBb6ywXWzOYTkOH7rlJMzUayj83flpJHjLT46qiSLz2BN+M90vf73iXScX6ZDWtCv1XmA 4YEI896QMfm3WSEhOYy+Fv+Va0NErxN8cbkV2tad5goyTK7K2WmMmKWmAKhv6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715260615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HzgqFkkP9/Lo9zr9nCTh3jIsHzwPbY5w+ZtpjGU5yGY=; b=nDxG5Os31mauDpFpOFsfoTSXmhamzZXg+Kz+/VUGBrvNCrkNR0pgvFeg6RNhbRYZrYtn5u 32yqIsZrZkyparDYv1ypcUGjDsR1T2FfzkeI591krk7nGTPkwIwkdGff+k6sbGWImqIIUM 3HxwEiuKxrY2MkVwYRPQzstEdbeE4q6mNdnKrIn2meNUPH3gW9BzGUqZoszAOXCO0eVh59 Xqgwdl7iagD3QOQ5gSkUrYsfKfLA/+5dchhtavp6dPeukssyhyPYGxitg+kROPfYQQ4CWs YKCnCfKcn4f4A1PhWCYvrxA6CieJx8ouhYA5E/z38lV+MfGBfr7k5kq4ZoJGKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZsx31k4Sz18g0; Thu, 9 May 2024 13:16:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 449DGtqx032277; Thu, 9 May 2024 13:16:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 449DGtIN032274; Thu, 9 May 2024 13:16:55 GMT (envelope-from git) Date: Thu, 9 May 2024 13:16:55 GMT Message-Id: <202405091316.449DGtIN032274@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 9f21d0ef9196 - stable/13 - adduser: Fix confusion between `uclass` and `_class`. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9f21d0ef91960e183913a068a8e52e23db71d65b Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=9f21d0ef91960e183913a068a8e52e23db71d65b commit 9f21d0ef91960e183913a068a8e52e23db71d65b Author: Dag-Erling Smørgrav AuthorDate: 2024-05-06 16:18:47 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-09 11:05:36 +0000 adduser: Fix confusion between `uclass` and `_class`. This caused adduser to produce an invalid `pw(8)` command line. Due to bugs in `pw(8)`, the command line was silently accepted and led to the user being created, but locked out and with no home directory. Also fix the default value for the “Another user?” prompt. Fixes: 170d0882903e MFC after: 3 days Reviewed by: karels, allanjude Differential Revision: https://reviews.freebsd.org/D45098 (cherry picked from commit 46c4e86ebf1819fc09084c8aa79423d96fcaad4a) --- usr.sbin/adduser/adduser.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/adduser/adduser.sh b/usr.sbin/adduser/adduser.sh index e9027b6b7876..61a4b3b5058f 100644 --- a/usr.sbin/adduser/adduser.sh +++ b/usr.sbin/adduser/adduser.sh @@ -194,7 +194,7 @@ save_config() { # add_user() { local _uid _name _comment _gecos _home _group _grouplist _shell _class - local _dotdir _expire _pwexpire _passwd _upasswd _passwdmethod + local _dotdir _expire _pwexpire _passwd _upasswd _passwdmethod _pwcmd # Is this a configuration run? If so, don't modify user database. # @@ -519,7 +519,7 @@ get_uid() { # Reads login class of account. Can be used in interactive or batch mode. # get_class() { - local _input _uclass + local _input _class uclass="$defaultclass" _class=${uclass:-"default"} @@ -740,7 +740,6 @@ input_interactive() { local _logingroup_ok="no" local _groups_ok="no" local _all_ok="yes" - local _another_user="no" case $passwdtype in none) _emptypass="yes" @@ -1129,6 +1128,7 @@ if [ -n "$fflag" ]; then else input_interactive while : ; do + _another_user="no" if [ -z "$configflag" ]; then echo -n "Add another user? (yes/no) [$_another_user]: " else From nobody Thu May 9 13:26:57 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZt8d4FQcz5Jgpy; Thu, 09 May 2024 13:26:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VZt8d3cZsz3wqN; Thu, 9 May 2024 13:26:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715261217; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eCCSMI9nqtPVnhsNG4e4gZwYIIQDdp7QlMWCfAB1iOE=; b=Drx4lbRwlOWiekZpL/+8G8E1dHyqibYpAcNV3kPlzi+wf/Q2MhVYQ8ZEkTRB76pz8Mi2Nb GoMm3xatFUWuJWldgIC6AB7FGjGcvniQvr11aqqe3i7scJD+koMv8XwhJqr+a7CKqqO09N dO9UowHRfqpxyxBgrTRuGhtj8vx3qm9MTRp62RodoX12BWIiMnHVZZeCtHZVvKVfXm+/ZA tZQ25nd0kt5YnxqnajlKtQ2aMNp83U+FWIR9QpR4JrgTZeCNQbJlqtVavE6B6k9WGHnCix Hr75AuEt5zr4aF8VWyvzCy+ZibliAoCN0mObknzrquNqd7QOelKW0JVCe8rkKQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715261217; a=rsa-sha256; cv=none; b=CTGrCwgApJNb+cUBfVqrOZVn7DQ17CCitdT/pVcMBXS+hQzCsiu3If+QsOdT3O3PG8XT3N kB2oEK2S5qZ8hGdZUiERrrWg6wWUPI3tnKxcnpmXkcocBlLX2oTztglj8IRkvZJje6H77J QZqDGQ4d5BbK9UTCmTijctJl0Lc3b7QnxGTJaAuPFMa+3mwnxkRnx6Isqq3497Fmz8LL9n k5O3djQtnLlYS0421E0HBsxJdgnK/XPoOHtkisUSsnWicHCnb2R9yi04h0pGswTUyBR7E2 9wqLoGnwAKowKSqsOo8vIJLg2ByKiX/ggJv2ZuKVSbestDjIZErddDEP0bUm3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715261217; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eCCSMI9nqtPVnhsNG4e4gZwYIIQDdp7QlMWCfAB1iOE=; b=OWfyBfDXT4mXaellMN9lywxGPHVIdUZ86MbAAxNELPbYAo9gGI5S+GFvWWo6E7aVgZ5zvE gZvHqyVt3uhoSXyUR1PLH6qdVSr/kscXZ+Rj4b4ryzmkDcJ396wwHTORV48Q6WbgzDcat+ 7npQ73kecS47taHF1/UOrwLyI3+qqhrG+T3uFa+UCpcISbgbrKa5qqaOzlC/fH3WZEruqb vmRM2MhPRuPUeeQK1kOerj56PFugzOAOyR9T0Lb7m8URt6DlHCWvv1xWpkd2UrT4H5URIz HbSfwUBPn4u5Q3g/kfLXIzIh9TdGPxX2RSBYEQkelo/XU+UgGLBoT9SWP2wqCQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZt8d30NFz19Xc; Thu, 9 May 2024 13:26:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 449DQvEu049539; Thu, 9 May 2024 13:26:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 449DQvF0049536; Thu, 9 May 2024 13:26:57 GMT (envelope-from git) Date: Thu, 9 May 2024 13:26:57 GMT Message-Id: <202405091326.449DQvF0049536@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: eded8fea5c3a - stable/14 - PP mutexes: unlock: Reset inherited prio regardless of privileges List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: eded8fea5c3a7ef7aafb5755c523a40dd7fce20e Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=eded8fea5c3a7ef7aafb5755c523a40dd7fce20e commit eded8fea5c3a7ef7aafb5755c523a40dd7fce20e Author: Olivier Certner AuthorDate: 2024-02-20 13:52:40 +0000 Commit: Olivier Certner CommitDate: 2024-05-09 13:26:16 +0000 PP mutexes: unlock: Reset inherited prio regardless of privileges 'uq_inherited_pri' contains the current priority inherited from Priority Protection mutexes. If -1 is passed through 'm_ceilings[1]', meaning that there are no such mutexes held anymore, this must be reflected into it by setting it to PRI_MAX, regardless of whether the thread has privilege to set realtime priorities (PRI_MAX is also obviously not a realtime priority level). By contrast, it shall not be updated and the computed 'new_inherited_pri' shall stay unused if the thread doesn't have the ability to set a realtime priority, possibly keeping an older such priority acquired previously. Reviewed by: kib Approved by: emaste (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D43984 (cherry picked from commit 1df8700aa6cff7c759e90f7e507de4b8714435a4) Approved by: emaste (mentor) --- sys/kern/kern_umtx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 57ff74f5421e..9c7225863bb1 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -2684,7 +2684,8 @@ do_unlock_pp(struct thread *td, struct umutex *m, uint32_t flags, bool rb) struct umtx_q *uq, *uq2; struct umtx_pi *pi; uint32_t id, owner, rceiling; - int error, pri, new_inherited_pri, su; + int error, pri, new_inherited_pri; + bool su; id = td->td_tid; uq = td->td_umtxq; @@ -2739,7 +2740,7 @@ do_unlock_pp(struct thread *td, struct umutex *m, uint32_t flags, bool rb) error = EFAULT; else { mtx_lock(&umtx_lock); - if (su != 0) + if (su || new_inherited_pri == PRI_MAX) uq->uq_inherited_pri = new_inherited_pri; pri = PRI_MAX; TAILQ_FOREACH(pi, &uq->uq_pi_contested, pi_link) { From nobody Thu May 9 13:26:58 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZt8f4YwXz5Jgkl; Thu, 09 May 2024 13:26:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VZt8f3pdPz3x8n; Thu, 9 May 2024 13:26:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715261218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PqPVXEOiriALWYp8S7mkkqGBUySIBByY8LcKGOoMEk4=; b=qbYWxCTz/XDeEpi6+1mWigSG2FvvRJbPLIKfbEO2nO10KGQmGhXFOUdSSSG0jvI7e7p3wq KI8kwBjUrQgDY/ELsstZK2GIdi6PHtqiYZansR3SF0uhr5mnwjMUfhLRe8oqcJtJoeqvAl LSj0MD/qBnhpYWo7yQCCLYwMuh1HZtq9ZsviShI0EwUnQaY7cLU/UkJZkczJCnl7FcEUpN Ruqs6xBCkYvtaVIVO4HNScGmpnumG5a//0xAUoKQ+3UqlRaJ5f46thqbQqsFHNdTwS7UKy jF7mst830G3rWinF7ss+/QqKe9dNgKw7oUKU7mYe55xPV0jntGcde/MbzqPvFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715261218; a=rsa-sha256; cv=none; b=Q8aSgEiE5lDGf5dQZ0d04oKeWdRs9+Qk6HVaBhO+PRsFCWgIahnbpeoZq4oXaX6Pbi4+Sw /qNMiv7b1Kim5eQikj9dLVD/rSWL9DbVclQ0uoP5MQ0qNCdmt8H8ZMvTodstUuV07wuoX/ wRmyTip7RJjC7Znjm8fsG1qi4LfkB0HakXsSQ3QrjcHFchWVHYREvBR2kQXeqkz/sRC7bS LLa5wbi71KvsCmPnmkzCvlAMd7/FkQRBsSOozgmaGX3RCjbFCufLp3HgWQBB3to43xmGrY a/M9T69k2yYdsl3slJHC6jlF9ZqMy/RjU/wVxzdHs3EcK4GPJVPSJ/dZhGpH6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715261218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PqPVXEOiriALWYp8S7mkkqGBUySIBByY8LcKGOoMEk4=; b=buJ1S/KFLEYVwPY5G5mju5pHEm4J14VEo6SJHmW1kHR/+M9u/mRbXwduwiN4Uv9RS5bIY4 y2fJ0SmClmqeBB48Ms++oO55jnl7kTSMC0XnN9C0wISKWxSTqVP9xlzfVDmyPs4TzdFoHJ lLo3Yr8upB8q28MMnq9Jv8kgyY3OOEqixLqPGzWw+jp0RoxZCmgM61J4kQS9pQOcRmfAqE HDXwNX5zu27A5kakPomrFZhDJEPYiRMh+/jfWJVFXJfAVN55XlkI3J3JfK0AnxVjy6WJxi 27WQvzU8Ld5r5XHq8JLgogX1pbLj9bH2yJ2QL/vWf9LeCmQ3vAFlt+LaPmp4pg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZt8f3QGgz19LZ; Thu, 9 May 2024 13:26:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 449DQwZT049606; Thu, 9 May 2024 13:26:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 449DQwgG049603; Thu, 9 May 2024 13:26:58 GMT (envelope-from git) Date: Thu, 9 May 2024 13:26:58 GMT Message-Id: <202405091326.449DQwgG049603@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: f9e9c02241dc - stable/14 - PP mutexes: lock: Check if priority is too high against base one List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f9e9c02241dc887244cf62136dfcea04718290a0 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=f9e9c02241dc887244cf62136dfcea04718290a0 commit f9e9c02241dc887244cf62136dfcea04718290a0 Author: Olivier Certner AuthorDate: 2024-02-22 08:53:51 +0000 Commit: Olivier Certner CommitDate: 2024-05-09 13:26:21 +0000 PP mutexes: lock: Check if priority is too high against base one Doing this instead of using the current (user) priority, which includes current lendings, prevents gratuitous failures for threads involved in multiple locking groups, where each group is defined as the threads that can lock a particular PP or PI mutex. No deadlock can occur in this case. Indeed, if a thread holds such a lock A giving it a higher priority than the ceiling of some other lock B that is PP, and B is acquired by another thread, effectively the latter may not be able to run but this situation can only last until the first thread releases A, which it will do eventually. Reviewed by: kib Approved by: emaste (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D44044 (cherry picked from commit 9ac3ac9ece6269365ac314fa5fdb484e96d4a32e) Approved by: emaste (mentor) --- sys/kern/kern_umtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 9c7225863bb1..5abc1e71d763 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -2551,7 +2551,7 @@ do_lock_pp(struct thread *td, struct umutex *m, uint32_t flags, } mtx_lock(&umtx_lock); - if (UPRI(td) < PRI_MIN_REALTIME + ceiling) { + if (td->td_base_user_pri < PRI_MIN_REALTIME + ceiling) { mtx_unlock(&umtx_lock); error = EINVAL; goto out; From nobody Thu May 9 13:26:59 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZt8h1Qz4z5Jgml; Thu, 09 May 2024 13:27: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 4VZt8g5n3sz3wn2; Thu, 9 May 2024 13:26:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715261219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AHSIjpdVY88MabMZmi/u4W6oC/4RPC324BxZFntEWeI=; b=v5sPJlyLGnS0e2QV9NfEto0W0rTjs3ARJ2ziqdj6/SaASPal/IGlH7VLtBhiPePhOUcLC4 7zoMutUTg5ffCIsE6/X+Np1tFtv1m1P1DHTz6trFlkoazLosY2nhYvgWm9pS6Tleh3ws2p vPPrf5TdNy2AIooTL+hELsc0g4iXe899av6PK1rB3uRMsYg0ZI1I5sjb5VsgRYxE6pEox+ ZrFGd4KBzvJ90wVax0bbb9XiGEi7GXBR16s1zY6H6QEncMTCBZeMO9ldGeaxTTmjBvzP5T jjW4bgnfU7UKsV/+xqsge69W81NW1bsjBFZxeSVMmLtODUBobDKSHiKAgKaKZw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715261219; a=rsa-sha256; cv=none; b=L6AR1H0h8CLCJHH7iinQhZn7nZRlLg1vJ37op3KrB/7QO4Fx3nzfYjgiDs9ttXEO7X/cVh vGktbVl1GTDhPYKWs/Yt1jz1LhI87JfoArYDP6CxRDefWh0FiBi7qlt7GxjpBJskwsbAnZ SBhmEfDYjekPxC3UeG85uk6Xa13n/8nuR9jLV2sz3zH/u/3lowEvL7HpB0zcb4BOLubl84 e9vH/CDCPn4BO6ljQBSZOFJfz1XhaP9x87gaudLvaod8ozWT1j2aVqSqjfX/khEcabAds8 bafC2+KmFbW9wHvhogLUuXq77Br8jUtbnWzIm1gnTN6dNmaLM2oRnZtIKYZssw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715261219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AHSIjpdVY88MabMZmi/u4W6oC/4RPC324BxZFntEWeI=; b=rLXizF326ptIb2Sdw6lShmR4vnT9RbHIOotf0a8dytpnV3Ua8tksiQZUBEg5+T4tl5dhPB VV0/68Jz6t+RfhDZ6JaRjCMABvJCKUkYWq91i5YsHXTjuBHcDx7ilnmdbnWRGi/rdTSOwh noMhIIED3DjgCriq2SNR4v9sUGbGJkMXqsWAWRBEqYjnIAALXL1MZcE8flOP8aU48rq/hL CxZMkiI/v+6O/RUQaXOvFY4FY8aH0VAUCf8ZGFXCW70Z9x58ANsCfx4t+s++7JstrKWxSb OVW3ercUl6RWMQ5EeAxaKDQhyZTe1K0tsN90+2dt6kqh27H29wm+q/5+Jsro1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZt8g4Slgz19Lb; Thu, 9 May 2024 13:26:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 449DQxU6049673; Thu, 9 May 2024 13:26:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 449DQxdB049670; Thu, 9 May 2024 13:26:59 GMT (envelope-from git) Date: Thu, 9 May 2024 13:26:59 GMT Message-Id: <202405091326.449DQxdB049670@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: ce7dc52f07d0 - stable/14 - PP mutexes: lock: Reduce 'umtx_lock' holding before taking the user lock List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ce7dc52f07d05d00054d48faf00fcac4036d56df Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=ce7dc52f07d05d00054d48faf00fcac4036d56df commit ce7dc52f07d05d00054d48faf00fcac4036d56df Author: Olivier Certner AuthorDate: 2024-02-22 09:13:38 +0000 Commit: Olivier Certner CommitDate: 2024-05-09 13:26:21 +0000 PP mutexes: lock: Reduce 'umtx_lock' holding before taking the user lock There is no need to have it for the priority check (that the thread doesn't have a higher priority than the mutex's ceiling), and there's also no need to take it if the thread doesn't have privileges to set its priority to the mutex's ceiling. While here, turn 'su' into a 'bool' and compute the internal priority corresponding to the mutex's ceiling once and for all, putting it in new 'new_pri'. Reviewed by: kib Approved by: emaste (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D44045 (cherry picked from commit 39e4665c9694b9f9b07d1cfa85befc288cabe906) Approved by: emaste (mentor) --- sys/kern/kern_umtx.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 5abc1e71d763..092fcade9d19 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -2520,7 +2520,8 @@ do_lock_pp(struct thread *td, struct umutex *m, uint32_t flags, struct umtx_pi *pi; uint32_t ceiling; uint32_t owner, id; - int error, pri, old_inherited_pri, su, rv; + int error, pri, old_inherited_pri, new_pri, rv; + bool su; id = td->td_tid; uq = td->td_umtxq; @@ -2549,21 +2550,23 @@ do_lock_pp(struct thread *td, struct umutex *m, uint32_t flags, error = EINVAL; goto out; } + new_pri = PRI_MIN_REALTIME + ceiling; - mtx_lock(&umtx_lock); - if (td->td_base_user_pri < PRI_MIN_REALTIME + ceiling) { - mtx_unlock(&umtx_lock); + if (td->td_base_user_pri < new_pri) { error = EINVAL; goto out; } - if (su && PRI_MIN_REALTIME + ceiling < uq->uq_inherited_pri) { - uq->uq_inherited_pri = PRI_MIN_REALTIME + ceiling; - thread_lock(td); - if (uq->uq_inherited_pri < UPRI(td)) - sched_lend_user_prio(td, uq->uq_inherited_pri); - thread_unlock(td); + if (su) { + mtx_lock(&umtx_lock); + if (new_pri < uq->uq_inherited_pri) { + uq->uq_inherited_pri = new_pri; + thread_lock(td); + if (new_pri < UPRI(td)) + sched_lend_user_prio(td, new_pri); + thread_unlock(td); + } + mtx_unlock(&umtx_lock); } - mtx_unlock(&umtx_lock); rv = casueword32(&m->m_owner, UMUTEX_CONTESTED, &owner, id | UMUTEX_CONTESTED); From nobody Thu May 9 13:27:00 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZt8j0WTFz5JgsQ; Thu, 09 May 2024 13:27: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 4VZt8h5rzTz3x9C; Thu, 9 May 2024 13:27:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715261220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qawd7jYkIH2UHaE0LUC3/pgg5wvNvhiqKD6bm/4W88s=; b=U2hMQIr8VqFyeB8jurFZbql2uFEBz2EZ+VqSGPsqAXwDxYtY/XOV9qWBoKfTXZUNZe0vQf hXrGkjU/yXj7aga9Qavp6i6usfQ9io4z7HyFFC7pJpnCHI1pw0hTePKRzHzRd4en76CEYh x1GhjClRofJaFbWXAi9aEEN9BvFiVeSF5UUcXILZEPuSM25E9cen2e+KOTtONPZd6I7Uxf 2EHmS4SQaVnJXJyp0Nuatsv457d8fqZegO3WGjtSDrqNPs/WLqUNYXudkAuFFWbdmWMqaX sFVnhVGF2lMEPCyK1VqQ2QHBk97SJRK7BjtN9S0LsCXMWIufKIKPCAsUEfix/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715261220; a=rsa-sha256; cv=none; b=mcaHISQw2fb/LrYJAtQeI2b/gvI9nrOsNgeq0pVizQZaQtvZfAmjPE7O0xC9UlnAzUd0Dl fvj9nbcYqC59jxFl2ID8erRNhAvpmb0GK/pUQkxhPvSJcAzPT5LT1dlWAO+n4TP6SmXUWw Opzjv1gW7sO0x5G0XsGwDXpRMgm+sPqwBSVf5NCGJGwmRgise3zt1kIkZIe04t4akmOsyQ johCQDyZknes/cGra4IoMqrlfAzHHJWARbyTdGqY40zI86dhqGVyyEx7Cc1Ge4AA2MmTJZ /0HmZ/AiSbsOf7MaCu0bSoPKuyy28fcyIDRjKeGwYtD5Vuk5QQYTX0eJJ5rv0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715261220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qawd7jYkIH2UHaE0LUC3/pgg5wvNvhiqKD6bm/4W88s=; b=MJn1xcSKdMfxKi5ZJCHNbLDgO2dWbtP+jKIMR9j6uxdRBUXC2CoZ63BeZmPD9FsCjPIdDi RcnKwywCI+PntEDKJmQHIm1Rn6pMRkwIkEBcBx6VVbHIbfe0n2/mCfSM3nPiloQP+tjpQr Y/6qB+pqwd9IIn5F073wemnQ/Xt74nB5MhOpdPywBRgEH6LdFjajgKxw5gFvJyueCKGtTX Tl4ce5IqE8lxXTxkJLVY5HtPywuZvV0x/6Fhx30/1YYOnPVdRz1D/y7N04jWD6dIdcFWbv 94GQ4XgOqlzvYfrZ8pi62av4Y+I1IOQA9k9TzknGqkU21x28HETjIVDCJscGuA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZt8h5QpQz19BS; Thu, 9 May 2024 13:27:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 449DR0Zh049717; Thu, 9 May 2024 13:27:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 449DR0Fh049714; Thu, 9 May 2024 13:27:00 GMT (envelope-from git) Date: Thu, 9 May 2024 13:27:00 GMT Message-Id: <202405091327.449DR0Fh049714@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: b8b729e23cb9 - stable/14 - sched: Simplify sched_lend_user_prio_cond() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b8b729e23cb91a77f3ca51df5100e2c85dfa7447 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=b8b729e23cb91a77f3ca51df5100e2c85dfa7447 commit b8b729e23cb91a77f3ca51df5100e2c85dfa7447 Author: Olivier Certner AuthorDate: 2024-02-09 18:03:22 +0000 Commit: Olivier Certner CommitDate: 2024-05-09 13:26:21 +0000 sched: Simplify sched_lend_user_prio_cond() If 'td_lend_user_pri' has the expected value, there is no need to check the fields that sched_lend_user_prio() modifies, they either are already good or soon will be ('td->td_lend_user_pri' has just been changed by a concurrent update). Reviewed by: kib Approved by: emaste (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D44050 (cherry picked from commit aeff15b392e68f5f193fff3bb01728b965cacc3a) Approved by: emaste (mentor) --- sys/kern/sched_4bsd.c | 12 +++--------- sys/kern/sched_ule.c | 10 ++-------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c index f0fffeb08e2d..ff1e57746404 100644 --- a/sys/kern/sched_4bsd.c +++ b/sys/kern/sched_4bsd.c @@ -981,15 +981,9 @@ void sched_lend_user_prio_cond(struct thread *td, u_char prio) { - if (td->td_lend_user_pri != prio) - goto lend; - if (td->td_user_pri != min(prio, td->td_base_user_pri)) - goto lend; - if (td->td_priority != td->td_user_pri) - goto lend; - return; - -lend: + if (td->td_lend_user_pri == prio) + return; + thread_lock(td); sched_lend_user_prio(td, prio); thread_unlock(td); diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index ee1e0ab0b955..4b99f1c486bf 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -2007,15 +2007,9 @@ void sched_lend_user_prio_cond(struct thread *td, u_char prio) { - if (td->td_lend_user_pri != prio) - goto lend; - if (td->td_user_pri != min(prio, td->td_base_user_pri)) - goto lend; - if (td->td_priority != td->td_user_pri) - goto lend; - return; + if (td->td_lend_user_pri == prio) + return; -lend: thread_lock(td); sched_lend_user_prio(td, prio); thread_unlock(td); From nobody Thu May 9 13:30:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZtDW1RSHz5JgqZ; Thu, 09 May 2024 13:30: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 4VZtDV3zfxz3xyJ; Thu, 9 May 2024 13:30:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715261418; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q7XA620N6YS+hc27enlZXk1LeBqgA3hiMPqeBuzoW1o=; b=GvO1F9tBq7Nu/hwZh7FXWAulr449LodDZB4ontNs5Ed687Kj1mlmxiirW9PEfp1CuWZBak tbBg6W9bbTMuRzbF1UgQ6irtdj5V/wO+34+Wvhg9hukIL69fKZGum9toO3595uAGWXzw5I GpRyzRJj8NLGW+ougg4RqFXNpN52Xt4FrU54n2cLR5luHA20FpiiaDB4aEE7/1JcncEP2r pZfW5KK3CC5IxwsA25JcYnc3K0G/tawrg3QGf1YxyVk6Og/4/CgyRbmYIOvferyN9qiNsi wKI6J9ydp/JT/CmHcf9wyJaWRZyyew1yt3UjPUN+y9boFydrU9GMer0d51rzuw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715261418; a=rsa-sha256; cv=none; b=bTbjthr87FFCja+pyd1XYu1ocwXBC4XR029LJl3QKz9q29IpUlk5+VULFf4khL9CXadCp2 fOrAIoh48pqUeXuCey5ItrD3gIPDrMGIHyyNIpmZlbvP5PFnUySIrLizm7kxGJZtYP9YTH AAlbQn8TP6bihQifRpb7Wf2/hgsatUT8k6NZ4dGkgCvVpFhab818S1lxg0qtHLneAvYwwM ix+M5Nz0eicPYc4HRRcZSl8HR3kN1ZENtcAxWjBX1Rr2om4XuR7WlTpTCnfIrpcMlg+U8J h4481VLRSfjgSAhZiMQAbFiATd3xsNH1mDVaSkrTFi418pAu1gS+36XY4iiQxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715261418; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q7XA620N6YS+hc27enlZXk1LeBqgA3hiMPqeBuzoW1o=; b=NFa2pRLU5l9pq0K6DzYsLfXIWYnKjEZurnBIQwXkxh5bbkxc24GFk4nDqJach7753+nDa0 R72I8EfR7YrgF6CNcCNmwDnOUtdG+BInhPNBwxjA6hiRw0ss1zIkNksjbFuxnfXABeNA4b UwVt6KNDjLu7Br3I3WZD/n7inoCzGPMSGXac448CtVR6pSZSOaAaLBG0n+CotOeCDGya2s xdWZ4elZ50cYr5aH4dDtV11PLr8owREhqGP8ORNohRohw7cyh67vUzizA8w7u6I2o4to6Y T4IIVZQHApJFnMCWoOJ6zA0kTPmTDXS2bloId7xOqFHX0z/uSDGC5HYjNT/7sg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZtDV3TfWz19NN; Thu, 9 May 2024 13:30:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 449DUIW0058837; Thu, 9 May 2024 13:30:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 449DUINd058834; Thu, 9 May 2024 13:30:18 GMT (envelope-from git) Date: Thu, 9 May 2024 13:30:18 GMT Message-Id: <202405091330.449DUINd058834@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: b94acafdbcc7 - stable/13 - PP mutexes: unlock: Reset inherited prio regardless of privileges List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b94acafdbcc7b34a57671b76910ec6e397a4e7db Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=b94acafdbcc7b34a57671b76910ec6e397a4e7db commit b94acafdbcc7b34a57671b76910ec6e397a4e7db Author: Olivier Certner AuthorDate: 2024-02-20 13:52:40 +0000 Commit: Olivier Certner CommitDate: 2024-05-09 13:29:11 +0000 PP mutexes: unlock: Reset inherited prio regardless of privileges 'uq_inherited_pri' contains the current priority inherited from Priority Protection mutexes. If -1 is passed through 'm_ceilings[1]', meaning that there are no such mutexes held anymore, this must be reflected into it by setting it to PRI_MAX, regardless of whether the thread has privilege to set realtime priorities (PRI_MAX is also obviously not a realtime priority level). By contrast, it shall not be updated and the computed 'new_inherited_pri' shall stay unused if the thread doesn't have the ability to set a realtime priority, possibly keeping an older such priority acquired previously. Reviewed by: kib Approved by: emaste (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D43984 (cherry picked from commit 1df8700aa6cff7c759e90f7e507de4b8714435a4) Approved by: emaste (mentor) --- sys/kern/kern_umtx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 94050beee7dd..5767a137b536 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -2685,7 +2685,8 @@ do_unlock_pp(struct thread *td, struct umutex *m, uint32_t flags, bool rb) struct umtx_q *uq, *uq2; struct umtx_pi *pi; uint32_t id, owner, rceiling; - int error, pri, new_inherited_pri, su; + int error, pri, new_inherited_pri; + bool su; id = td->td_tid; uq = td->td_umtxq; @@ -2740,7 +2741,7 @@ do_unlock_pp(struct thread *td, struct umutex *m, uint32_t flags, bool rb) error = EFAULT; else { mtx_lock(&umtx_lock); - if (su != 0) + if (su || new_inherited_pri == PRI_MAX) uq->uq_inherited_pri = new_inherited_pri; pri = PRI_MAX; TAILQ_FOREACH(pi, &uq->uq_pi_contested, pi_link) { From nobody Thu May 9 13:30:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZtDX2xZ2z5JgtB; Thu, 09 May 2024 13:30: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 4VZtDW6WpFz3xyK; Thu, 9 May 2024 13:30:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715261419; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FmpBZLIwT3282glhNJ9+NXDjAq+dSYpE83lpEN8DQ6U=; b=l/xxhEqWaLZmXnp1HtiXwnVSMwsVM6kP85b0lsJvNTHD9FyVdEOCdLzw9J0A5qJKNrV/cY 2++2lEK0TtrAqhLruTvwwERBODpS5xOLsMe4fyIqBwCmNLDsx69f5lMn3tNKZRioG6DNJE k1pJHpkbYIAPnTVFYOF8b3dPaGPquKZm6UasOAYacBbOFgRY8NnzBKEivEbrU7B4deyS/i kbBkAm+JTCXbeIJXKH5ZZHQnVgzwW7kxwHm2Q1VCPeJHef0nQJYmG2z8E+Z61AnRxGYqqC u3vaFkmaGTGX+vl4Fv6YbRlSyvBLymDXkQjD3gHCIGUPe+2QpcZLFHdEXUGKIw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715261419; a=rsa-sha256; cv=none; b=wWSFkUSjmTSv7ekrE16Vjcr6DBDkt8ekCbSVvTXY4cKwDeR1jml8ZXroCi/1HRglc0YQ3k gXACZOLMaoBsjVOIZ4QndB13uXo5de6K7u8ASMhtr+UDWMLjyN2LtXARBc5f6EEKk5razB I7dyKH4EXqHwueZlFHHN2NRh625+sV+K2VizAGS2ZCi+Bp5JZuSX8A6TRugzxkyYBCU/yK J6yY/bauv0Hw/8hg/p9kRZxMgSKLAAevkBfc9NCfZ/lMYOEq/s/pd4UBt4+EiJo2EctMZE F9Ipde5mqYsPLQQQBqTWE5754UuUwWrhqSlxRrYpshLa6bw+O0hw6uuwpaMySA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715261419; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FmpBZLIwT3282glhNJ9+NXDjAq+dSYpE83lpEN8DQ6U=; b=EeZt6CcoRPWfKNWxegZul+UNomHqKav/0FPRgkb6y3V0L+f9pqbjGEg+jdVrQsjpL497y1 9tJcEHfga2v9qYhGY7l8ggqVuImI2j58IfAr8Z8raV7PExxgIrg5jqo5TrNDR4GqkstGXA 83k9eFNsScziO4fU4ICTKMJGjoygpyroz/l9OPtDORdmqOHIFS/pUHOSJ2Xqre8HBKgdpC x4+4V0n8krV8rYxxJ2abtRFCazW7T/Q+De9kHMoIgxoJK6dwBupDxwRTUlB5GrUdGUiLax 3FlgAnZfYAX9jN3ib3+dtB7ToPKRhoqw/8A/PXpdTaObWhaG5ARCcTQrvS8zuw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZtDW4DsCz19Ld; Thu, 9 May 2024 13:30:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 449DUJk6058900; Thu, 9 May 2024 13:30:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 449DUJfJ058897; Thu, 9 May 2024 13:30:19 GMT (envelope-from git) Date: Thu, 9 May 2024 13:30:19 GMT Message-Id: <202405091330.449DUJfJ058897@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: f5a145cb0a5f - stable/13 - PP mutexes: lock: Check if priority is too high against base one List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f5a145cb0a5f5ca0eef54d35d60f765639c8f30a Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=f5a145cb0a5f5ca0eef54d35d60f765639c8f30a commit f5a145cb0a5f5ca0eef54d35d60f765639c8f30a Author: Olivier Certner AuthorDate: 2024-02-22 08:53:51 +0000 Commit: Olivier Certner CommitDate: 2024-05-09 13:29:18 +0000 PP mutexes: lock: Check if priority is too high against base one Doing this instead of using the current (user) priority, which includes current lendings, prevents gratuitous failures for threads involved in multiple locking groups, where each group is defined as the threads that can lock a particular PP or PI mutex. No deadlock can occur in this case. Indeed, if a thread holds such a lock A giving it a higher priority than the ceiling of some other lock B that is PP, and B is acquired by another thread, effectively the latter may not be able to run but this situation can only last until the first thread releases A, which it will do eventually. Reviewed by: kib Approved by: emaste (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D44044 (cherry picked from commit 9ac3ac9ece6269365ac314fa5fdb484e96d4a32e) Approved by: emaste (mentor) --- sys/kern/kern_umtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 5767a137b536..05a47f405d30 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -2552,7 +2552,7 @@ do_lock_pp(struct thread *td, struct umutex *m, uint32_t flags, } mtx_lock(&umtx_lock); - if (UPRI(td) < PRI_MIN_REALTIME + ceiling) { + if (td->td_base_user_pri < PRI_MIN_REALTIME + ceiling) { mtx_unlock(&umtx_lock); error = EINVAL; goto out; From nobody Thu May 9 13:30:20 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZtDY2vsSz5JgnV; Thu, 09 May 2024 13:30: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 4VZtDX5hl3z3yDn; Thu, 9 May 2024 13:30:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715261420; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LffP3NkO/L5P5Wrwq8HfyOL7Mc+vhU6N8mQkht6kgrY=; b=rx7RgyHvWmrY82Yo2G/5DFTU5rvVttkzOTmgCpibSyvaQV0bxLDBgw9zTTLcj2BTZJC11w 9f60zxORyaeHFraPEpUbRXjiovxKxIh8Mx0sEOViuYW2IalP1/D7I10WJ/SwU3eoOWXQlA AcinOawfvAgGzccDP1QSLFCbWM70+XZIUC+vuV8VXNmB48iK6lPnW+5scGzdMNKbIDnMKR JgxnXWPr8Mz7iTdhiGvAM71RPVNXUAgGrMjugSmPzv8zrvecycXo/RqgKAiCRpRKWduwwb ymWpOcFrCa0OWOvvSszZLc2DxIbtgoh+r845PQLAElqDk2HlzMQ0Vv/ru830aA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715261420; a=rsa-sha256; cv=none; b=PkVU7Y6gqqpkWFpyGWKf2WtEnkrP+ECUtJdXur7sHZ/MTcIxpChDw/549RGzeoGBcU2Hsc WQqMt9QsTcP3YGSZrOo7SCdZ1LowqB0dKfp+LbdxVUuU5Lu2Ek21ApK0UtvMQ0++gE2/I8 zalluUUny9s+DbK4xXmFxjjiUC8TDHOmZ3Glju/jYfXEbCkDQr+t86bPj+7IYot2wS84fW l4jgPNpQkrfr+NmN8l+37oZfiOahjHHvkV3EscHBCJZSIeZ7XXjIIMNEYsDQbw/WaDe/n3 fXEjJmD3I9OdRhD6nIi/sTGGoMoJz64IcFQw1YC2oB/zYm4eorkrFYJ7myYv8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715261420; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LffP3NkO/L5P5Wrwq8HfyOL7Mc+vhU6N8mQkht6kgrY=; b=TV6hU/4LBrEZgF6Hz/5H5/jxsyAzigAiwastLU7MIDdv+NJ72MvKWfOfNbHcBxJ4UWDOs/ KnvdXfDAFc65FGUjT2XzCtyx4Y2BJWfYJ0NqtuDLSbBgNOTae4j272orc3+uOQuvQc68sG BcPBJ7KgqqLgFTGsfsX7URN7i9lyfpYD0BeUmTp6sGaV3rRwCQqUDI3ZWYhECJY6IPEGvu HeFLWbtE7hUbmAb0WxTetT3XKjIiFcWicLwbb8DgAWjm4XoGznKVbW182RuV2+CbnqZ7pl EoSDcMHASKi/gMDrSUgUvFrDErKy7c57obuvrl1K7/ucAU5a4oW9zZowxJ85Iw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZtDX5JLPz19Sr; Thu, 9 May 2024 13:30:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 449DUKRC058960; Thu, 9 May 2024 13:30:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 449DUKnW058957; Thu, 9 May 2024 13:30:20 GMT (envelope-from git) Date: Thu, 9 May 2024 13:30:20 GMT Message-Id: <202405091330.449DUKnW058957@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: ba2c48a7f21e - stable/13 - PP mutexes: lock: Reduce 'umtx_lock' holding before taking the user lock List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ba2c48a7f21e426ec84856b70db6f9b4c47f8abb Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=ba2c48a7f21e426ec84856b70db6f9b4c47f8abb commit ba2c48a7f21e426ec84856b70db6f9b4c47f8abb Author: Olivier Certner AuthorDate: 2024-02-22 09:13:38 +0000 Commit: Olivier Certner CommitDate: 2024-05-09 13:29:25 +0000 PP mutexes: lock: Reduce 'umtx_lock' holding before taking the user lock There is no need to have it for the priority check (that the thread doesn't have a higher priority than the mutex's ceiling), and there's also no need to take it if the thread doesn't have privileges to set its priority to the mutex's ceiling. While here, turn 'su' into a 'bool' and compute the internal priority corresponding to the mutex's ceiling once and for all, putting it in new 'new_pri'. Reviewed by: kib Approved by: emaste (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D44045 (cherry picked from commit 39e4665c9694b9f9b07d1cfa85befc288cabe906) Approved by: emaste (mentor) --- sys/kern/kern_umtx.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 05a47f405d30..d8587c51e6fd 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -2521,7 +2521,8 @@ do_lock_pp(struct thread *td, struct umutex *m, uint32_t flags, struct umtx_pi *pi; uint32_t ceiling; uint32_t owner, id; - int error, pri, old_inherited_pri, su, rv; + int error, pri, old_inherited_pri, new_pri, rv; + bool su; id = td->td_tid; uq = td->td_umtxq; @@ -2550,21 +2551,23 @@ do_lock_pp(struct thread *td, struct umutex *m, uint32_t flags, error = EINVAL; goto out; } + new_pri = PRI_MIN_REALTIME + ceiling; - mtx_lock(&umtx_lock); - if (td->td_base_user_pri < PRI_MIN_REALTIME + ceiling) { - mtx_unlock(&umtx_lock); + if (td->td_base_user_pri < new_pri) { error = EINVAL; goto out; } - if (su && PRI_MIN_REALTIME + ceiling < uq->uq_inherited_pri) { - uq->uq_inherited_pri = PRI_MIN_REALTIME + ceiling; - thread_lock(td); - if (uq->uq_inherited_pri < UPRI(td)) - sched_lend_user_prio(td, uq->uq_inherited_pri); - thread_unlock(td); + if (su) { + mtx_lock(&umtx_lock); + if (new_pri < uq->uq_inherited_pri) { + uq->uq_inherited_pri = new_pri; + thread_lock(td); + if (new_pri < UPRI(td)) + sched_lend_user_prio(td, new_pri); + thread_unlock(td); + } + mtx_unlock(&umtx_lock); } - mtx_unlock(&umtx_lock); rv = casueword32(&m->m_owner, UMUTEX_CONTESTED, &owner, id | UMUTEX_CONTESTED); From nobody Thu May 9 13:30:21 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZtDZ1b87z5Jgvg; Thu, 09 May 2024 13:30: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 4VZtDY6yXMz3y1R; Thu, 9 May 2024 13:30:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715261422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+P3z+L/3PyBC9IIODoOw6cNlJgC1GSqEIFAgg2RB7iE=; b=f+dzLm6y/i4s2wTtNw4ixRv1rwRsJ2k3rzYDihuv6V+KTQemHcv3wqZ7sYWH5dFJrIheWK GDEm3IA3juadtcY9I2Rv0fT2k+qah5FWVZqkJ+f8ExuMzxsRA6VUCVaWZflzcyncvI4Z1J wBNpmJXlj8xRrXawsP5hamKRksH+95KgD2ddfkwWI36cFv+BV7GiUzOv3XuGYhgQjVx8ZQ ZzZdkcyKttzB/y6xAjRJbFWzCXeBs0pB2lalVuS/Q2kG5eCjKkYQmmyWoPRQIJgUFDovsk jTQz760pqPa21x+eS2HHDc/hLbZAerZA0QEFrOn1FCmwsDeW6P/AhzVRRCesgw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715261422; a=rsa-sha256; cv=none; b=iPjBbvbhNBB36s8niPYGub0332SJ4Uevu8TxtkCDJsXYro5Qu7MRXppCJWl3mVs552rQGx tMy0y44XEElwkJMAtzoMjNBdEZgAn61B8+UuH19Aflp6uJ2+TtPxHpflBM7H9bk/KHopsi 9Vz53jjXC8E5uumh2hz6kl6CAEEezqnSPkFOGtB/w+SQYTWA+jyI87lq8bCQ3y96ickXL8 m1nlYDy7Fg5FuDa0chb4AxD0yi8aZuhgYGeALvZdLsUBQmZBnGKiaCeOJbpmv2TWKjUM6L QN1bQeu6V1gyjzdqJKAXkhStBnBbFaFq2CkUgMmBnp4uBlAP5VNLPyFivDgIFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715261422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+P3z+L/3PyBC9IIODoOw6cNlJgC1GSqEIFAgg2RB7iE=; b=GtMPtP9umFV50nRn8XCzLeoVd4IdINtYdBdTeDJ8GLUnoNh0YZ7p4qpV0UipcB3et361N5 nNy5xetQ+AcUPySSSPYgiBU4S+VWGk4wesinbkt5B9C3h8F1iUjeODur7ZoOLdcKp7KimJ y7egqoBGk6M1ThAUtHL6NopH1e9SwGCkok54WRYYwwSP2Uxb9uEMQXOe6y2qb56GIOq9C+ uMHzUz/mqG4peasMuEcuF8XIufI9AgCO6UG1hV5rFIpsR1Z0udeY6J0o15sk4YimjomI9P YCcUUwiF8BXZ9B/QGOM6BF3Vop2uOPqORlm9LtkFSEYG1Mh73xizvUJtWdEeWg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZtDY6J4pz19dR; Thu, 9 May 2024 13:30:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 449DULTN058996; Thu, 9 May 2024 13:30:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 449DULdK058993; Thu, 9 May 2024 13:30:21 GMT (envelope-from git) Date: Thu, 9 May 2024 13:30:21 GMT Message-Id: <202405091330.449DULdK058993@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 8c308a22e759 - stable/13 - sched: Simplify sched_lend_user_prio_cond() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8c308a22e759a666704f2b6d730568a83fb271b1 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=8c308a22e759a666704f2b6d730568a83fb271b1 commit 8c308a22e759a666704f2b6d730568a83fb271b1 Author: Olivier Certner AuthorDate: 2024-02-09 18:03:22 +0000 Commit: Olivier Certner CommitDate: 2024-05-09 13:29:32 +0000 sched: Simplify sched_lend_user_prio_cond() If 'td_lend_user_pri' has the expected value, there is no need to check the fields that sched_lend_user_prio() modifies, they either are already good or soon will be ('td->td_lend_user_pri' has just been changed by a concurrent update). Reviewed by: kib Approved by: emaste (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D44050 (cherry picked from commit aeff15b392e68f5f193fff3bb01728b965cacc3a) Approved by: emaste (mentor) --- sys/kern/sched_4bsd.c | 12 +++--------- sys/kern/sched_ule.c | 10 ++-------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c index 700f0dca93aa..ca615098c1df 100644 --- a/sys/kern/sched_4bsd.c +++ b/sys/kern/sched_4bsd.c @@ -953,15 +953,9 @@ void sched_lend_user_prio_cond(struct thread *td, u_char prio) { - if (td->td_lend_user_pri != prio) - goto lend; - if (td->td_user_pri != min(prio, td->td_base_user_pri)) - goto lend; - if (td->td_priority != td->td_user_pri) - goto lend; - return; - -lend: + if (td->td_lend_user_pri == prio) + return; + thread_lock(td); sched_lend_user_prio(td, prio); thread_unlock(td); diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 9220b4700af7..b53c2f57c908 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -1996,15 +1996,9 @@ void sched_lend_user_prio_cond(struct thread *td, u_char prio) { - if (td->td_lend_user_pri != prio) - goto lend; - if (td->td_user_pri != min(prio, td->td_base_user_pri)) - goto lend; - if (td->td_priority != td->td_user_pri) - goto lend; - return; + if (td->td_lend_user_pri == prio) + return; -lend: thread_lock(td); sched_lend_user_prio(td, prio); thread_unlock(td); From nobody Thu May 9 14:31:51 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZvbW4SGHz5Jphf; Thu, 09 May 2024 14:31: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 4VZvbW3xQPz45Ph; Thu, 9 May 2024 14:31:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715265111; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=91riTY+z+NAJ/AfOnepSd6OGVp+vtcnG39Dt0fDHO3Q=; b=UTvhbz6DISCpLwsGaQ1NXUrQQwfjWJU19NLJmbSxkLAVIWb2UwUpBF8wwvrcE8J6T0oO3N rs4+K1joQeLUb71bF5c8gp6s3k4nehCHaAVN7nDjHPWR6yWQ9yeK6G2sVKpzwLL5FkRXm1 R27yM7Gwg0ghKS/mBXxoT467wPhLiw0spbd6K8zWwZdtBEcNvAbZn48f+UgTM3NH7wevTO ifTlPOtCK7e7IXonUR+c+jJw0+eMq6n55cEoaSAmoXilMsZfg2HZZCgPtk5StCpBJZI0wZ O5jmxJAaMD9XU6E/RGLtwQovUoyq8yBxrBu84nPj55wmVCILBM8DJyt6KXFoGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715265111; a=rsa-sha256; cv=none; b=X/pyTyH4qvBzB5heTaZUg8fetAqRYIG9hjivs5YCP8km8Y146S2ZEQ7Z0LmdY/289w3oxL lEqgeYbBspoAo2xgVfMy/ACnsFqez5i2K4KWD4Eh0/QJx8iMsILDJ+dR4213fdgEu5yvMg 5keBaOSxLftJDpCzE8f4C+gH13NN8ez3mvIp6TnX8K0wXRHspsI+NYEkgqsaHPFSXJcfE4 RCYrb8Pu4v9u/8MdNF9gOcFuoc1b6I5n0eE16soNbGyeuQSuhJrcCdwlnvoZknFjfr+Qt2 MkJIB2dbk2lEl+TgMQpivh81hbxhJ+JjuGO0xUszHUGqHzHva3eYXfaWNZ1nhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715265111; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=91riTY+z+NAJ/AfOnepSd6OGVp+vtcnG39Dt0fDHO3Q=; b=VjIK2/GWTErOGQ90TQVDGTMLcNQXNeJvJJJQUkuu+fdxuk2dZA/cSC4tMUHwA3rVb7C1rA 91tiUc3yXI+4Nsz69BooaVAHLGav/0HTthi4AcVIiz28sJQmgrpobBnryHmbPYaLEFd/zD /kkb8KOpa7ghfx93WaFOuIcPYJEUKCutCoMZiGSjB52vx7Cxx3wTQKDOW/PhuqxfkeTA28 mgVR2XH9rZqSzkkWvWQ0GeyWa+lUh2H0W8wT87QTidbGer9FGWAycDnx1b8pW+v5YaxMAl Ch8CNVxq4xSPSR5wZxqSMdrHXVDklApfE/gwX/+fbIp7jQqgWlW818t4g/S0HQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZvbW3XVWz1Bqh; Thu, 9 May 2024 14:31:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 449EVpP2065727; Thu, 9 May 2024 14:31:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 449EVplX065725; Thu, 9 May 2024 14:31:51 GMT (envelope-from git) Date: Thu, 9 May 2024 14:31:51 GMT Message-Id: <202405091431.449EVplX065725@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 1691bcc8b02c - releng/14.1 - pw: Rename some enums. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 1691bcc8b02c0d32dfde359f8a614a55bc98d6da Auto-Submitted: auto-generated The branch releng/14.1 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=1691bcc8b02c0d32dfde359f8a614a55bc98d6da commit 1691bcc8b02c0d32dfde359f8a614a55bc98d6da Author: Dag-Erling Smørgrav AuthorDate: 2024-05-06 16:18:39 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-09 14:31:12 +0000 pw: Rename some enums. Rename `M_PRINT` and `M_UPDATE` to `M_SHOW` and `M_MODIFY` to match the names of the commands they represent. No functional change intended. MFC after: 3 days Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D45096 (cherry picked from commit a9ea647c29cf510a164947251de0d34f53f2bca0) pw: Don't silently ignore unparsed command line arguments. MFC after: 3 days Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D45097 (cherry picked from commit c86119328e6b2cfeb4f9319f6b154524d88caaf4) pw: Test home directory ownership and mode. MFC after: 3 days Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D45099 (cherry picked from commit e12b7446bddcb91b869abef6048910cc15185a33) (cherry picked from commit 2f59ee8287548225e7c71db987574fe043ed1be4) Approved by: re (cperciva) --- usr.sbin/pw/pw.c | 13 ++++++++-- usr.sbin/pw/pw.h | 22 +++++++++-------- usr.sbin/pw/pw_group.c | 35 ++++++++++++++++++++------ usr.sbin/pw/pw_user.c | 48 ++++++++++++++++++++++++++++-------- usr.sbin/pw/tests/pw_useradd_test.sh | 17 +++++++++++++ 5 files changed, 106 insertions(+), 29 deletions(-) diff --git a/usr.sbin/pw/pw.c b/usr.sbin/pw/pw.c index 063553dd084f..fc17f6dba022 100644 --- a/usr.sbin/pw/pw.c +++ b/usr.sbin/pw/pw.c @@ -101,13 +101,16 @@ static int (*cmdfunc[W_NUM][M_NUM])(int argc, char **argv, char *_name) = { struct pwconf conf; +static int mode = -1; +static int which = -1; + static int getindex(const char *words[], const char *word); static void cmdhelp(int mode, int which); int main(int argc, char *argv[]) { - int mode = -1, which = -1, tmp; + int tmp; struct stat st; char arg, *arg1; bool relocated, nis; @@ -375,5 +378,11 @@ cmdhelp(int mode, int which) fprintf(stderr, "%s", help[which][mode]); } - exit(EXIT_FAILURE); + exit(EX_USAGE); +} + +void +usage(void) +{ + cmdhelp(mode, which); } diff --git a/usr.sbin/pw/pw.h b/usr.sbin/pw/pw.h index 5de333ce5e71..c3725693f91d 100644 --- a/usr.sbin/pw/pw.h +++ b/usr.sbin/pw/pw.h @@ -36,14 +36,14 @@ enum _mode { - M_ADD, - M_DELETE, - M_UPDATE, - M_PRINT, + M_ADD, + M_DELETE, + M_MODIFY, + M_SHOW, M_NEXT, M_LOCK, M_UNLOCK, - M_NUM + M_NUM }; enum _passmode @@ -56,13 +56,13 @@ enum _passmode enum _which { - W_USER, - W_GROUP, - W_NUM + W_USER, + W_GROUP, + W_NUM }; -#define _DEF_DIRMODE (S_IRWXU | S_IRWXG | S_IRWXO) -#define _PW_CONF "pw.conf" +#define _DEF_DIRMODE (S_IRWXU | S_IRWXG | S_IRWXO) +#define _PW_CONF "pw.conf" #define _UC_MAXLINE 1024 #define _UC_MAXSHELLS 32 @@ -114,3 +114,5 @@ uintmax_t strtounum(const char * __restrict, uintmax_t, uintmax_t, const char ** __restrict); bool grp_has_member(struct group *grp, const char *name); + +void usage(void); diff --git a/usr.sbin/pw/pw_group.c b/usr.sbin/pw/pw_group.c index 32dec769fb1a..1941c03aa2c5 100644 --- a/usr.sbin/pw/pw_group.c +++ b/usr.sbin/pw/pw_group.c @@ -273,9 +273,13 @@ pw_group_next(int argc, char **argv, char *arg1 __unused) quiet = true; break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); if (quiet) freopen(_PATH_DEVNULL, "w", stderr); @@ -332,9 +336,13 @@ pw_group_show(int argc, char **argv, char *arg1) all = true; break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); if (quiet) freopen(_PATH_DEVNULL, "w", stderr); @@ -391,9 +399,13 @@ pw_group_del(int argc, char **argv, char *arg1) nis = true; break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); if (quiet) freopen(_PATH_DEVNULL, "w", stderr); @@ -551,9 +563,13 @@ pw_group_add(int argc, char **argv, char *arg1) nis = true; break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); if (quiet) freopen(_PATH_DEVNULL, "w", stderr); @@ -645,9 +661,14 @@ pw_group_mod(int argc, char **argv, char *arg1) nis = true; break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); + if (quiet) freopen(_PATH_DEVNULL, "w", stderr); cnf = get_userconfig(cfg); @@ -697,11 +718,11 @@ pw_group_mod(int argc, char **argv, char *arg1) if ((grp = GETGRNAM(name)) == NULL) errx(EX_SOFTWARE, "group disappeared during update"); - pw_log(cnf, M_UPDATE, W_GROUP, "%s(%ju)", grp->gr_name, + pw_log(cnf, M_MODIFY, W_GROUP, "%s(%ju)", grp->gr_name, (uintmax_t)grp->gr_gid); if (nis && nis_update() == 0) - pw_log(cnf, M_UPDATE, W_GROUP, "NIS maps updated"); + pw_log(cnf, M_MODIFY, W_GROUP, "NIS maps updated"); return (EXIT_SUCCESS); } diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c index 6875d931a1d2..89354b249935 100644 --- a/usr.sbin/pw/pw_user.c +++ b/usr.sbin/pw/pw_user.c @@ -146,7 +146,7 @@ create_and_populate_homedir(struct userconf *cnf, struct passwd *pwd, copymkdir(conf.rootfd, pwd->pw_dir, skelfd, homemode, pwd->pw_uid, pwd->pw_gid, 0); - pw_log(cnf, update ? M_UPDATE : M_ADD, W_USER, "%s(%ju) home %s made", + pw_log(cnf, update ? M_MODIFY : M_ADD, W_USER, "%s(%ju) home %s made", pwd->pw_name, (uintmax_t)pwd->pw_uid, pwd->pw_dir); } @@ -708,9 +708,13 @@ pw_user_next(int argc, char **argv, char *name __unused) quiet = true; break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); if (quiet) freopen(_PATH_DEVNULL, "w", stderr); @@ -772,9 +776,13 @@ pw_user_show(int argc, char **argv, char *arg1) v7 = true; break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); if (quiet) freopen(_PATH_DEVNULL, "w", stderr); @@ -855,9 +863,13 @@ pw_user_del(int argc, char **argv, char *arg1) nis = true; break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); if (quiet) freopen(_PATH_DEVNULL, "w", stderr); @@ -1003,9 +1015,13 @@ pw_user_lock(int argc, char **argv, char *arg1) /* compatibility */ break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); return (pw_userlock(arg1, M_LOCK)); } @@ -1022,9 +1038,13 @@ pw_user_unlock(int argc, char **argv, char *arg1) /* compatibility */ break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); return (pw_userlock(arg1, M_UNLOCK)); } @@ -1291,9 +1311,13 @@ pw_user_add(int argc, char **argv, char *arg1) nis = true; break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); if (geteuid() != 0 && ! dryrun) errx(EX_NOPERM, "you must be root"); @@ -1604,9 +1628,13 @@ pw_user_mod(int argc, char **argv, char *arg1) nis = true; break; default: - exit(EX_USAGE); + usage(); } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); if (geteuid() != 0 && ! dryrun) errx(EX_NOPERM, "you must be root"); @@ -1787,7 +1815,7 @@ pw_user_mod(int argc, char **argv, char *arg1) if (pwd == NULL) errx(EX_NOUSER, "user '%s' disappeared during update", name); grp = GETGRGID(pwd->pw_gid); - pw_log(cnf, M_UPDATE, W_USER, "%s(%ju):%s(%ju):%s:%s:%s", + pw_log(cnf, M_MODIFY, W_USER, "%s(%ju):%s(%ju):%s:%s:%s", pwd->pw_name, (uintmax_t)pwd->pw_uid, grp ? grp->gr_name : "unknown", (uintmax_t)(grp ? grp->gr_gid : (uid_t)-1), @@ -1808,7 +1836,7 @@ pw_user_mod(int argc, char **argv, char *arg1) } if (nis && nis_update() == 0) - pw_log(cnf, M_UPDATE, W_USER, "NIS maps updated"); + pw_log(cnf, M_MODIFY, W_USER, "NIS maps updated"); return (EXIT_SUCCESS); } diff --git a/usr.sbin/pw/tests/pw_useradd_test.sh b/usr.sbin/pw/tests/pw_useradd_test.sh index 3b495482eb05..b4efa42bada7 100755 --- a/usr.sbin/pw/tests/pw_useradd_test.sh +++ b/usr.sbin/pw/tests/pw_useradd_test.sh @@ -313,6 +313,22 @@ user_add_R_intermed_body() { test -d ${HOME}/a/b/c/foo || atf_fail "user directory not created" } +atf_test_case user_add_dir +user_add_dir_body() { + populate_root_etc_skel + + atf_check -s exit:0 ${RPW} useradd foo -M 0705 -m + atf_check grep -q '^foo:' $HOME/etc/master.passwd + atf_check test -d ${HOME}/home/foo + atf_check -o save:ugid \ + awk -F: '$1 == "foo" { print $3, $4 }' \ + $HOME/etc/master.passwd + atf_check -o file:ugid \ + stat -f '%u %g' ${HOME}/home/foo + atf_check -o inline:"40705\n" \ + stat -f '%p' ${HOME}/home/foo +} + atf_test_case user_add_skel user_add_skel_body() { populate_root_etc_skel @@ -511,6 +527,7 @@ atf_init_test_cases() { atf_add_test_case user_add_R atf_add_test_case user_add_R_no_symlink atf_add_test_case user_add_R_intermed + atf_add_test_case user_add_dir atf_add_test_case user_add_skel atf_add_test_case user_add_uid0 atf_add_test_case user_add_uid_too_large From nobody Thu May 9 14:31:52 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZvbX5hslz5Jpg1; Thu, 09 May 2024 14:31: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 4VZvbX4wgZz45DS; Thu, 9 May 2024 14:31:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715265112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=82jfXB8rjieiyfVjigC3u0plI1yNZTVLho6KEsdZaDo=; b=KNP5dA8OvPiLi5VjtxRtp1pm2oSB/2Os+Ujf/3AmMeYFUcKwzTrdu4/cUZKyMSho4C+hcX xyBn5N0PYXGg/7N0ndZnTu6cF6IpQgQe703Q1ntArNUq7/WDM6WkdpO0vpttb9CMfMN9wK mcJbT/HOPHarC/xgbYdvyWhtoXrmlNo8jHiCREWf1fxLKQCdYQgCLL08CxHanESc5ZtdNs 85HPrBlCX6/RgcnCz4lFDFcX+ePREShKdkNjpsKYnKjfGLY+oaeIRdEl/CkNnR/Q2pjF+3 if/f5xPI5JYzEtqEg0ipksXtwyseI1QtLBD6MVkFkHWJ8qBCECvxaNkH3S++Aw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715265112; a=rsa-sha256; cv=none; b=g1DjIrupXJp2ZyiV8lJqh93Mgb3or6aYFMzofsy0GwGO4mzGt6PbM4bHxx1WAdgDedD6XA 8WzuLBHtoC3n+Ain7Fc1S7k+xG8uxyvLxvG+y/m9wue0ExKs4JX4lWVbtdDu3v0uZdHzEt hwZHIWw8j76PgwJoRlfXg5yUJ5Az4mkcbG4yt1FUgdVBFV9dI1cSP45CtuTJZuh9lhVy/+ SgtVSsLmRXgyMhIMMhHo7T9CUXngEsmrR7oPVyJhzSfN+JIMAbnNBNPgKJvRS78N4eosXp w1SmYrlfxQdsjpidNgqnwkoPFuYm+ORP7nvWwufdNx6gsLftghAkP4C9QOkhPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715265112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=82jfXB8rjieiyfVjigC3u0plI1yNZTVLho6KEsdZaDo=; b=jPMODHB4MH+1yAayelyqpqhC2pwM+VrZ4JVijidU9Dnu6o3s9DkUIJEwBh72A97RYyJrHj Qa7lRAfDZn29T5KTVPh1e/FX3xyzEQPizu0IPuFxt4ZMGQzFlN7BaIujbCbWuiNbdr/+Le AT0QiAUO3AqEikuDOeSMlYAd3fGt/BzQaxx4kLcsacoACs3wiI7uWdUQgSf6fHrStf4mEu 4jWy5K5zlx0i/KjMLg3pZzeRR1KkDg1IP0+8lOXpxOfVNETsAxoOmTQeo7imgj9AmHzTFC 7DOsB/XXRgRv30JbMiopcAvyyQOi/bQpR+RhECGtZk7vEg9TfA4PbbAkTpYFKQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZvbX4Xgnz1BNY; Thu, 9 May 2024 14:31:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 449EVq56065788; Thu, 9 May 2024 14:31:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 449EVqWm065785; Thu, 9 May 2024 14:31:52 GMT (envelope-from git) Date: Thu, 9 May 2024 14:31:52 GMT Message-Id: <202405091431.449EVqWm065785@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 01872b366578 - releng/14.1 - adduser: Fix confusion between `uclass` and `_class`. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 01872b366578d071e9fb981a2fda216379915ce3 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=01872b366578d071e9fb981a2fda216379915ce3 commit 01872b366578d071e9fb981a2fda216379915ce3 Author: Dag-Erling Smørgrav AuthorDate: 2024-05-06 16:18:47 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-09 14:31:21 +0000 adduser: Fix confusion between `uclass` and `_class`. This caused adduser to produce an invalid `pw(8)` command line. Due to bugs in `pw(8)`, the command line was silently accepted and led to the user being created, but locked out and with no home directory. Also fix the default value for the “Another user?” prompt. Fixes: 170d0882903e MFC after: 3 days Reviewed by: karels, allanjude Differential Revision: https://reviews.freebsd.org/D45098 (cherry picked from commit 46c4e86ebf1819fc09084c8aa79423d96fcaad4a) (cherry picked from commit e121845426c8d587491370432de0657099a22843) Approved by: re (cperciva) --- usr.sbin/adduser/adduser.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/adduser/adduser.sh b/usr.sbin/adduser/adduser.sh index e9027b6b7876..61a4b3b5058f 100644 --- a/usr.sbin/adduser/adduser.sh +++ b/usr.sbin/adduser/adduser.sh @@ -194,7 +194,7 @@ save_config() { # add_user() { local _uid _name _comment _gecos _home _group _grouplist _shell _class - local _dotdir _expire _pwexpire _passwd _upasswd _passwdmethod + local _dotdir _expire _pwexpire _passwd _upasswd _passwdmethod _pwcmd # Is this a configuration run? If so, don't modify user database. # @@ -519,7 +519,7 @@ get_uid() { # Reads login class of account. Can be used in interactive or batch mode. # get_class() { - local _input _uclass + local _input _class uclass="$defaultclass" _class=${uclass:-"default"} @@ -740,7 +740,6 @@ input_interactive() { local _logingroup_ok="no" local _groups_ok="no" local _all_ok="yes" - local _another_user="no" case $passwdtype in none) _emptypass="yes" @@ -1129,6 +1128,7 @@ if [ -n "$fflag" ]; then else input_interactive while : ; do + _another_user="no" if [ -z "$configflag" ]; then echo -n "Add another user? (yes/no) [$_another_user]: " else From nobody Thu May 9 20:19:57 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vb3KB0PFfz5KR37; Thu, 09 May 2024 20:19:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vb3K96wBLz4ngG; Thu, 9 May 2024 20:19:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715285998; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Hcrx09Y6pNt3AeB8k3fp2Pa+3kYEGWp6cE49j1gCns=; b=nNt1yV8Eeihd6BpmuBvMwssNWiJjZ/ZBWG/9tmn/tdS/oelwR7X2ZzxGxSOFZjVGVW5OJX 7GK0dEb6OVv2YXJwhbrNR0iETofSLGordxMMwEbaFVRIiWOuJEC/yFVxPTMNDqgegXz/WY VZwqWuFAImc/RhXijMUM97InMgSSIyfXpT7Mp4d664nkUDyyTdxIKK3hdoq1ZEN7y/ubTl iMrf/pRa7pIdQh3iq71KlJOGY7qf0cFLXdaBN1RXT9XpPi5BloZWr0YTgKX9s+ovFSWydy Kik9HqQvZG82o/KtvEaKWS4YQrnwXHzsi0uODmu9Q22J2NP1wQr3iStbZ64mYQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715285998; a=rsa-sha256; cv=none; b=F+oX+8I4K/PT/UxIyHOaqbge6mVDd2GdadVQQGrbiQYCTJuJSOFyh5BcvCJ8zenkNHWMtl EGy0Qb2bz/okU+Zr7huP0dayc7fVwzCvyZ0GOTnfJ3jH/fo7DUX2ihqTZnruUi8yAQmg8O 9jQCDeLPoSQqE/36d7w1EQqUcw+YUMClVeVo7WFrf/6Uus9S8zDGyKgqKs9hQf2GPG6exO 51D6cx4XobP+rpFb19RNE9LrZcC+Dn6GqAX4dZMkGoHHN9E5yqUp+PBlsncRjWppLYHPKw +BHdhJZ3boioG/KHB58yeMd2F4ALHFkbGqftOcnHBZLzWhNUrrD4wfosaWtq0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715285998; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Hcrx09Y6pNt3AeB8k3fp2Pa+3kYEGWp6cE49j1gCns=; b=vqe40VFc1GXUfOkknddF4FyC6949CuuEq1ZBF91RMZ53N2HRiMw7KASCejXdYAztS5Q8eE F0gBu/npcH4hYGqJrlZJonJZyLZsG9dS0Bz2Avx7N5poZ21/o/gL+z6/MuKjwL6aWJHgg9 qf1nXmrBFEeDyGcy9hX3eD+y7K4rsUSLY2gmJXjTkU0w2vDyioVM7Oya6Ziem9okOHCyT4 494Fp/JpEyXoBnvqs0oJMNeyLP/Zp+ivYNAA4i4xbQEczaAGSnhiy1mLdWgNkQYVYJC2tE 1qMykzgw+ZrkocFWoRh3xzYui1PDal8Ft54mT+USPdz0V2BmL9AzkLHB9tTqQw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vb3K96Wfzz1MYQ; Thu, 9 May 2024 20:19:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 449KJv7k044489; Thu, 9 May 2024 20:19:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 449KJv4s044486; Thu, 9 May 2024 20:19:57 GMT (envelope-from git) Date: Thu, 9 May 2024 20:19:57 GMT Message-Id: <202405092019.449KJv4s044486@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 792ad4676ba9 - stable/14 - zfsd: Use vdev prop values for fault/degrade thresholds List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 792ad4676ba9ff95ea30e2a74590a65b723cac1d Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=792ad4676ba9ff95ea30e2a74590a65b723cac1d commit 792ad4676ba9ff95ea30e2a74590a65b723cac1d Author: Alan Somers AuthorDate: 2024-03-05 17:55:55 +0000 Commit: Alan Somers CommitDate: 2024-05-09 17:47:00 +0000 zfsd: Use vdev prop values for fault/degrade thresholds ZED uses vdev props for setting disk fault/degrade thresholds, this patch enables zfsd to use the same vdev props for these same tasks. OpenZFS on Linux is using vdev props for ZED disk fault/degrade thresholds. Originally the thresholds supported were for io and checksum events and recently this was updated to process slow io events as well, see https://github.com/openzfs/zfs/commit/cbe882298e4ddc3917dfaf239eca475fe06d62d4 This patch enables us to use the same vdev props in zfsd as ZED uses. After this patch is merged both OSs will use the same vdev props to set retirement thresholds. It's probably important to note that the threshold defaults are different between OS. I've kept the existing defaults inside zfsd and DID NOT match them to what ZED does. Differential Revision: https://reviews.freebsd.org/D44043 Relnotes: yes Reviewed by: asomers, allanjude Sponsored by: Axcient Submitted by: Alek Pinchuk (cherry picked from commit 89f4f91dbfdcabe65bc7476bc5f13dfb837870fe) zfsd: fix unit tests after 89f4f91dbfdcabe65bc7476bc5f13dfb837870fe Reported by: markj Sponsored by: Axcient Reviewed by: Alek Pinchuk Differential Revision: https://reviews.freebsd.org/D44744 (cherry picked from commit 25038e8de6b4e5f2ffca821565b50a633eea499a) --- cddl/usr.sbin/zfsd/case_file.cc | 98 ++++++++++++++++++++++++------- cddl/usr.sbin/zfsd/case_file.h | 22 ++++--- cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc | 3 + cddl/usr.sbin/zfsd/vdev.h | 2 +- cddl/usr.sbin/zfsd/zfsd.8 | 58 ++++++++++++++---- 5 files changed, 139 insertions(+), 44 deletions(-) diff --git a/cddl/usr.sbin/zfsd/case_file.cc b/cddl/usr.sbin/zfsd/case_file.cc index 39f89fbbf7c8..f9fd84da7277 100644 --- a/cddl/usr.sbin/zfsd/case_file.cc +++ b/cddl/usr.sbin/zfsd/case_file.cc @@ -53,6 +53,7 @@ #include #include +#include #include #include @@ -91,7 +92,6 @@ using DevdCtl::ParseException; CaseFileList CaseFile::s_activeCases; const string CaseFile::s_caseFilePath = "/var/db/zfsd/cases"; -const timeval CaseFile::s_removeGracePeriod = { 60 /*sec*/, 0 /*usec*/}; //- CaseFile Static Public Methods --------------------------------------------- CaseFile * @@ -255,6 +255,7 @@ CaseFile::RefreshVdevState() m_vdevState = vd.State(); m_vdevPhysPath = vd.PhysicalPath(); + m_vdevName = vd.Name(casePool, false); return (true); } @@ -610,15 +611,55 @@ CaseFile::ActivateSpare() { return (Replace(vdev_type, devPath, /*isspare*/true)); } +/* Does the argument event refer to a checksum error? */ +static bool +IsChecksumEvent(const Event* const event) +{ + return ("ereport.fs.zfs.checksum" == event->Value("type")); +} + +/* Does the argument event refer to an IO error? */ +static bool +IsIOEvent(const Event* const event) +{ + return ("ereport.fs.zfs.io" == event->Value("type")); +} + +/* Does the argument event refer to an IO delay? */ +static bool +IsDelayEvent(const Event* const event) +{ + return ("ereport.fs.zfs.delay" == event->Value("type")); +} + void CaseFile::RegisterCallout(const Event &event) { timeval now, countdown, elapsed, timestamp, zero, remaining; + /** + * The time ZFSD waits before promoting a tentative event + * into a permanent event. + */ + int sec = -1; + if (IsChecksumEvent(&event)) + sec = CaseFile::GetVdevProp(VDEV_PROP_CHECKSUM_T); + else if (IsIOEvent(&event)) + sec = CaseFile::GetVdevProp(VDEV_PROP_IO_T); + else if (IsDelayEvent(&event)) + sec = CaseFile::GetVdevProp(VDEV_PROP_SLOW_IO_T); + + if (sec == -1) + sec = 60; /* default */ + + timeval removeGracePeriod = { + sec, /*sec*/ + 0 /*usec*/ + }; gettimeofday(&now, 0); timestamp = event.GetTimestamp(); timersub(&now, ×tamp, &elapsed); - timersub(&s_removeGracePeriod, &elapsed, &countdown); + timersub(&removeGracePeriod, &elapsed, &countdown); /* * If countdown is <= zero, Reset the timer to the * smallest positive time value instead @@ -827,6 +868,10 @@ CaseFile::CaseFile(const Vdev &vdev) guidString << m_poolGUID; m_poolGUIDString = guidString.str(); + ZpoolList zpl(ZpoolList::ZpoolByGUID, &m_poolGUID); + zpool_handle_t *zhp(zpl.empty() ? NULL : zpl.front()); + m_vdevName = vdev.Name(zhp, false); + s_activeCases.push_back(this); syslog(LOG_INFO, "Creating new CaseFile:\n"); @@ -1158,43 +1203,54 @@ CaseFile::Replace(const char* vdev_type, const char* path, bool isspare) { return (retval); } -/* Does the argument event refer to a checksum error? */ -static bool -IsChecksumEvent(const Event* const event) +/* Lookup the vdev prop. Used for checksum, IO, or slow IO props */ +int +CaseFile::GetVdevProp(vdev_prop_t vdev_prop) const { - return ("ereport.fs.zfs.checksum" == event->Value("type")); -} + char val[ZFS_MAXPROPLEN]; + zprop_source_t srctype; + DevdCtl::Guid poolGUID = PoolGUID(); + ZpoolList zpl(ZpoolList::ZpoolByGUID, &poolGUID); + zpool_handle_t *zhp(zpl.empty() ? NULL : zpl.front()); -/* Does the argument event refer to an IO error? */ -static bool -IsIOEvent(const Event* const event) -{ - return ("ereport.fs.zfs.io" == event->Value("type")); -} + char *prop_str = (char *) vdev_prop_to_name(vdev_prop); + if (zhp == NULL || zpool_get_vdev_prop(zhp, m_vdevName.c_str(), + vdev_prop, prop_str, val, sizeof (val), &srctype, B_FALSE) != 0) + return (-1); -/* Does the argument event refer to an IO delay? */ -static bool -IsDelayEvent(const Event* const event) -{ - return ("ereport.fs.zfs.delay" == event->Value("type")); + /* we'll get "-" from libzfs for a prop that is not set */ + if (zfs_isnumber(val) == B_FALSE) + return (-1); + + return (atoi(val)); } bool CaseFile::ShouldDegrade() const { + int checksum_n = GetVdevProp(VDEV_PROP_CHECKSUM_N); + if (checksum_n == -1) + checksum_n = DEFAULT_ZFS_DEGRADE_IO_COUNT; return (std::count_if(m_events.begin(), m_events.end(), - IsChecksumEvent) > ZFS_DEGRADE_IO_COUNT); + IsChecksumEvent) > checksum_n); } bool CaseFile::ShouldFault() const { bool should_fault_for_io, should_fault_for_delay; + int io_n = GetVdevProp(VDEV_PROP_IO_N); + int slow_io_n = GetVdevProp(VDEV_PROP_SLOW_IO_N); + + if (io_n == -1) + io_n = DEFAULT_ZFS_DEGRADE_IO_COUNT; + if (slow_io_n == -1) + slow_io_n = DEFAULT_ZFS_FAULT_SLOW_IO_COUNT; should_fault_for_io = std::count_if(m_events.begin(), m_events.end(), - IsIOEvent) > ZFS_DEGRADE_IO_COUNT; + IsIOEvent) > io_n; should_fault_for_delay = std::count_if(m_events.begin(), m_events.end(), - IsDelayEvent) > ZFS_FAULT_DELAY_COUNT; + IsDelayEvent) > slow_io_n; return (should_fault_for_io || should_fault_for_delay); } diff --git a/cddl/usr.sbin/zfsd/case_file.h b/cddl/usr.sbin/zfsd/case_file.h index 9566b1586ef5..199918c4fead 100644 --- a/cddl/usr.sbin/zfsd/case_file.h +++ b/cddl/usr.sbin/zfsd/case_file.h @@ -235,18 +235,27 @@ public: */ int IsSpare(); + /** + * \brief Get case vdev's specified property + */ + int GetVdevProp(vdev_prop_t) const; + protected: enum { + /* + * Use these defaults if we can't get the corresponding vdev + * prop or if the prop is not set + */ /** * The number of soft errors on a vdev required * to transition a vdev from healthy to degraded - * status. + * status */ - ZFS_DEGRADE_IO_COUNT = 50, + DEFAULT_ZFS_DEGRADE_IO_COUNT = 50, /** * The number of delay errors on a vdev required to fault it */ - ZFS_FAULT_DELAY_COUNT = 8, + DEFAULT_ZFS_FAULT_SLOW_IO_COUNT = 8, }; static CalloutFunc_t OnGracePeriodEnded; @@ -379,12 +388,6 @@ protected: */ static const string s_caseFilePath; - /** - * \brief The time ZFSD waits before promoting a tentative event - * into a permanent event. - */ - static const timeval s_removeGracePeriod; - /** * \brief A list of soft error events counted against the health of * a vdev. @@ -404,6 +407,7 @@ protected: string m_poolGUIDString; string m_vdevGUIDString; string m_vdevPhysPath; + string m_vdevName; int m_is_spare; /** diff --git a/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc b/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc index d76abb54c9ed..f1e925b0b4ef 100644 --- a/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc +++ b/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc @@ -134,6 +134,7 @@ public: MOCK_CONST_METHOD0(PoolGUID, Guid()); MOCK_CONST_METHOD0(State, vdev_state()); MOCK_CONST_METHOD0(PhysicalPath, string()); + MOCK_CONST_METHOD2(Name, string(zpool_handle_t * zhp, bool verbose)); }; MockVdev::MockVdev(nvlist_t *vdevConfig) @@ -431,6 +432,8 @@ protected: m_vdev = new MockVdev(m_vdevConfig); ON_CALL(*m_vdev, GUID()) .WillByDefault(::testing::Return(Guid(123))); + ON_CALL(*m_vdev, Name(::testing::_, ::testing::_)) + .WillByDefault(::testing::Return(string("/dev/da999"))); ON_CALL(*m_vdev, PoolGUID()) .WillByDefault(::testing::Return(Guid(456))); ON_CALL(*m_vdev, State()) diff --git a/cddl/usr.sbin/zfsd/vdev.h b/cddl/usr.sbin/zfsd/vdev.h index ace5d5a009fa..42278a3d7229 100644 --- a/cddl/usr.sbin/zfsd/vdev.h +++ b/cddl/usr.sbin/zfsd/vdev.h @@ -130,7 +130,7 @@ public: nvlist_t *Config() const; Vdev Parent(); Vdev RootVdev(); - std::string Name(zpool_handle_t *, bool verbose) const; + virtual std::string Name(zpool_handle_t *, bool verbose) const; bool IsSpare(); bool IsAvailableSpare() const; bool IsActiveSpare() const; diff --git a/cddl/usr.sbin/zfsd/zfsd.8 b/cddl/usr.sbin/zfsd/zfsd.8 index 75a3333e6f9e..d6b0e1d4bd22 100644 --- a/cddl/usr.sbin/zfsd/zfsd.8 +++ b/cddl/usr.sbin/zfsd/zfsd.8 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 18, 2020 +.Dd February 20, 2024 .Dt ZFSD 8 .Os .Sh NAME @@ -55,7 +55,7 @@ directly. Instead, they control its behavior indirectly through zpool configuration. There are two ways to influence .Nm : -assigning hotspares and setting pool properties. +assigning hot spares and setting pool properties. Currently, only the .Em autoreplace property has any effect. @@ -69,7 +69,7 @@ will attempt to resolve the following types of fault: .It device removal When a leaf vdev disappears, .Nm -will activate any available hotspare. +will activate any available hot spare. .It device arrival When a new GEOM device appears, .Nm @@ -77,40 +77,71 @@ will attempt to read its ZFS label, if any. If it matches a previously removed vdev on an active pool, .Nm will online it. -Once resilvering completes, any active hotspare will detach automatically. +Once resilvering completes, any active hot spare will detach automatically. .Pp If the new device has no ZFS label but its physical path matches the physical path of a previously removed vdev on an active pool, and that pool has the autoreplace property set, then .Nm will replace the missing vdev with the newly arrived device. -Once resilvering completes, any active hotspare will detach automatically. +Once resilvering completes, any active hot spare will detach automatically. .It vdev degrade or fault events If a vdev becomes degraded or faulted, .Nm -will activate any available hotspare. +will activate any available hot spare. .It I/O errors -If a leaf vdev generates more than 50 I/O errors in a 60 second period, then +By default, if a leaf vdev generates more than 50 I/O errors in a 60 second +period, then +.Nm +will mark that vdev as +.Em FAULTED . +ZFS will no longer issue any I/Os to it. +.Nm +will activate a hot spare if one is available. The defaults can be changed by +setting the +.Em io_n +and/or +.Em io_t +vdev properties. See +.Xr vdevprops 7 +for details. +.It I/O delays +By default, if a leaf vdev generates more than delayed 8 I/O events in a 60 +second period, then .Nm will mark that vdev as .Em FAULTED . ZFS will no longer issue any I/Os to it. .Nm -will activate a hotspare if one is available. +will activate a hot spare if one is available. The defaults can be changed by +setting the +.Em slow_io_n +and/or +.Em slow_io_t +vdev properties. See +.Xr vdevprops 7 +for details. .It Checksum errors -If a leaf vdev generates more than 50 checksum errors in a 60 second -period, then +By default, if a leaf vdev generates more than 50 checksum errors in a 60 +second period, then .Nm will mark that vdev as .Em DEGRADED . -ZFS will still use it, but zfsd will activate a spare anyway. +ZFS will still use it, but zfsd will also activate a hot spare if one is +available. The defaults can be changed by setting the +.Em checksum_n +and/or +.Em checksum_t +vdev properties. See +.Xr vdevprops 7 +for details. .It Spare addition -If the system administrator adds a hotspare to a pool that is already degraded, +If the system administrator adds a hot spare to a pool that is already degraded, .Nm will activate the spare. .It Resilver complete .Nm -will detach any hotspare once a permanent replacement finishes resilvering. +will detach any hot spare once a permanent replacement finishes resilvering. .It Physical path change If the physical path of an existing disk changes, .Nm @@ -134,6 +165,7 @@ then reads them back in when next it starts up. .El .Sh SEE ALSO .Xr devctl 4 , +.Xr vdevprops 7 , .Xr zpool 8 .Sh HISTORY .Nm From nobody Thu May 9 20:22:08 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vb3Mh6VZPz5KR9Q; Thu, 09 May 2024 20: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 4Vb3Mh4LmGz4pfW; Thu, 9 May 2024 20:22:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715286128; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mPeBiaC0dqKV8z8YRdKqpaSbsaQVBEcgpIgI2PXt1sI=; b=kblJuGUQQZWC8ogfKpbW+TrlI1wjL0k9w/Wl5FZ5TCnxS9buFVyKg5HEZB1imLFq1oRHV3 QgT4b5RWW6URfCoESGpkMJzhi889D/UcyPf/NDIpWPpoJEDC9eB/w7lV/+V6oL2WzJ3v0C rjNxrQtJMGfxOCzq3Y5pIMChEEqYi4xHridlrscZJ+MtVoKIZZtnlE3UGp9t7Qd3YKe2Ra sjmh3csgh7lUOScBMpf4Qy/kfxfr51Od2L6c+BGqvEgFvf5by1IVK+YDz3ZQekRwDFgnGq A/m/4xPY4OUHpmPj+/wqNy9E2N+bDiqa3D+TX7d4pqYsPHWFqYsytpkxUyqq1Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715286128; a=rsa-sha256; cv=none; b=kvAKP0iWmLq+ERxSHT/j0ssjW8V2nDYRmW+WGn9Nkeo0bKb82NSokn1WBqMoX1VTCpFFyS zZetXp6w5tTou1yD8GO09xyNXrs2Ep1mWnm2avG/U1Coxe5wx0h47DVYNitQeLcCPCCbDI VrpzzRloodF5Vt0LvUs7hqMBu5PMUDDsf8lTpyP2jvovVB8n+psEsrjU1YGu7xg2fX3yzR RMFOBMbLzFb3aHezCQHW9+Bmhw7nw+n4nBilL+XBVOrPuaYUpAPPAHU3kUaPJu7MpYyVdJ Lt2l8zANW1Om5Jk38PX+3+Mo9OjElifqy+w7x7NfamXE/09eO+VR2cLodEnD4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715286128; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mPeBiaC0dqKV8z8YRdKqpaSbsaQVBEcgpIgI2PXt1sI=; b=gJgBta50QywlcZXttnWtElLfhAGD0YDrKs2NyHWYljt0kqEyo4WgtlZuzz4QH1aOm1FbZx WPaNA///voKCQ2Tc79JAvvnWhtonQJTVatjK2txlIQUhH4bAkPC6Pvp7a+hgoRZQbDI+xD k3mYOwAOxptKIj7/Scw/qPXOPBGKQkC77xcgF8fK3iB0Zyr183TRfEhMKWq60ynTzZ4JVD ior3xzQwnaSjx+xMJydCXlo78+UqBDTNRuWhmxNf8wlhXYCUApU5Rn5mqpiB4hp5a1iqdj wk2z9+BEjTnNT/1PBbMt5ZIPnFbDYEfj5Nrf3+xPoJUr1jFa7eDy1T8XtWLdjg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vb3Mh3zHQz1MxS; Thu, 9 May 2024 20:22:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 449KM8OG059155; Thu, 9 May 2024 20:22:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 449KM8AW059152; Thu, 9 May 2024 20:22:08 GMT (envelope-from git) Date: Thu, 9 May 2024 20:22:08 GMT Message-Id: <202405092022.449KM8AW059152@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 0704823d1e31 - stable/14 - geli: add a read-only kern.geom.eli.use_uma_bytes sysctl List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0704823d1e319a6476ef05467abeceb0556a5ca7 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=0704823d1e319a6476ef05467abeceb0556a5ca7 commit 0704823d1e319a6476ef05467abeceb0556a5ca7 Author: Alan Somers AuthorDate: 2024-04-22 18:03:40 +0000 Commit: Alan Somers CommitDate: 2024-05-09 20:20:16 +0000 geli: add a read-only kern.geom.eli.use_uma_bytes sysctl It reports the value of the g_eli_alloc_sz variable. Allocations of this size or less will use UMA. Larger allocations will use malloc. Since malloc is slower, it is useful for users to know this variable so they can avoid such allocations. For example, ZFS users can set vfs.zfs.vdev.aggregation_limit to this value. Sponsored by: Axcient Reviewed by: markj, imp Differential Revision: https://reviews.freebsd.org/D44904 (cherry picked from commit 3acf3feaa8c5b15e820e86c1526c9a97fc5ad247) --- sys/geom/eli/g_eli.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c index 16b38e628e35..400734c10596 100644 --- a/sys/geom/eli/g_eli.c +++ b/sys/geom/eli/g_eli.c @@ -101,11 +101,13 @@ SYSCTL_BOOL(_kern_geom_eli, OID_AUTO, blocking_malloc, CTLFLAG_RWTUN, static bool g_eli_unmapped_io = true; SYSCTL_BOOL(_kern_geom_eli, OID_AUTO, unmapped_io, CTLFLAG_RDTUN, &g_eli_unmapped_io, 0, "Enable support for unmapped I/O"); +static int g_eli_alloc_sz; +SYSCTL_UINT(_kern_geom_eli, OID_AUTO, use_uma_bytes, CTLFLAG_RD, + &g_eli_alloc_sz, 0, "Use uma(9) for allocations of this size or smaller."); static struct sx g_eli_umalock; /* Controls changes to UMA zone. */ SX_SYSINIT(g_eli_umalock, &g_eli_umalock, "GELI UMA"); static uma_zone_t g_eli_uma = NULL; -static int g_eli_alloc_sz; static volatile int g_eli_umaoutstanding; static volatile int g_eli_devs; From nobody Thu May 9 20:24:48 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vb3Qm33cJz5KRfN; Thu, 09 May 2024 20:24: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 4Vb3Qm2c5pz4py9; Thu, 9 May 2024 20:24:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715286288; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VTNeNsxhRWeRyYKK1VUmQGOdX+2zqhewUkPbGMdqL3Y=; b=o6NN/TyoD03k96NkWqOX7Z4pSE2R/qeTzHr6GdFmtUr/u7Dnn+5ekLBy8iNgFz+SQnpdV2 2MYBFMUN2XJncknk7pEpylzRbOEWVItfb2+4cfWB7XOE3VQvAk0MmuOzOMeH19gDYI9iED 8dMyOtW/y/bs4DJ3WqIEfV9GMv91NRIiSwsalVZ8XSUi9xFpZZ+1a+pUueZfAa/bntGFZ7 rNkJWfKpISYCz7DcqjYo6H+UHyxU4dhWMYVxl19jeq9vYzVcI1VKj1anlhDmTha7dvoPBm S3qyguyMlSJmAQx1Ru/hcSwpWaxkngDBSYgMBoabe44e92egQNu/BaF0y9zQbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715286288; a=rsa-sha256; cv=none; b=o1zucEiKTgDy4XWcGclAh+Wz/AEvI3KHkX6qGWhgfhQwbbAvRHI+8oEJ3mbUQPYehzyJJT 0jIy5WVhy8GccsZW0OoKZrqA+ZF/8JudOWy3uoqYK33O9Pl1A1yIOtkr88XTGzCvdHhHtX N5VFJkRTsV50F3gYGx8UbWtGrbwPCGh3jAVmO7T5xlgXPnLX6BphSX0yfmAh6NSnAlAtZa Crx5Z3sLOacrP6hnrgovQiaxXQ3xgTvkmi0AriFWPFRpqsnGgZ7bKVtNx09HoJARKQcXuD DkBGGRsvGr5YUNUH49DAK8FMhMCxpnW+3qN75SwLZvWmwPNMi9N5cFWFkGqXNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715286288; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VTNeNsxhRWeRyYKK1VUmQGOdX+2zqhewUkPbGMdqL3Y=; b=NN5wTllh9zt+DYIOQ2fc0Uumj1pA37qxiLRSNm6JDafwRKkBLze/1ZQbdT/1bd6ZheD3X0 f6osIy+q0uLkFzfGNAv2dcPSQdYCIK7wzVAMqo7AvnplK+hxtiDC/PeNmZ9E+XUqOp6B9T 36IF259P1Se1W5VoE8pYjDW7OkO7WIDvOCJGVaV6C32f9ISIGWH6M3Sd1DiTuvD/Pe9pdK JJdQ3N/ZOI3DHK7LiHCDB7z65B3zZWJtH7y6Tze2Kn6t6IFXLywz+Mj9kzrhJK4Nq9VUzA UpiYkCPG1lzNK/mccT3qpMW5obqTNGUgmWdqEC+rP2logmrC9883YLjwVnagsA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vb3Qm2DJSz1Mxg; Thu, 9 May 2024 20:24:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 449KOmsd060526; Thu, 9 May 2024 20:24:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 449KOmov060523; Thu, 9 May 2024 20:24:48 GMT (envelope-from git) Date: Thu, 9 May 2024 20:24:48 GMT Message-Id: <202405092024.449KOmov060523@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 1c5b58a71718 - stable/14 - geli.8: minor proofreading List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1c5b58a71718b31f48fa9240ab941264355155cf Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=1c5b58a71718b31f48fa9240ab941264355155cf commit 1c5b58a71718b31f48fa9240ab941264355155cf Author: Alan Somers AuthorDate: 2024-04-22 21:11:09 +0000 Commit: Alan Somers CommitDate: 2024-05-09 20:24:06 +0000 geli.8: minor proofreading Sponsored by: Axcient Reviewed by: imp, pauamma (manpages) Differential Revision: https://reviews.freebsd.org/D44907 (cherry picked from commit c0f02dcd4c9c17181c59fa3c43259cce793a0b21) geli.8: add some notes regarding performance tuning Sponsored by: Axcient Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D44908 (cherry picked from commit 4b7949144cfbf25b0e0bf593b135a88417304d71) --- lib/geom/eli/geli.8 | 46 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/lib/geom/eli/geli.8 b/lib/geom/eli/geli.8 index c378c591290c..098ba4d0485e 100644 --- a/lib/geom/eli/geli.8 +++ b/lib/geom/eli/geli.8 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 18, 2022 +.Dd April 24, 2024 .Dt GELI 8 .Os .Sh NAME @@ -851,6 +851,15 @@ This variable should be set in Specifies how many times the Master Key is overwritten with random values when it is destroyed. After this operation it is filled with zeros. +.It Va kern.geom.eli.use_uma_bytes +.Nm +must allocate a buffer for every write operation, used when performing +encryption. +This sysctl reports the maximum size in bytes for which geli will perform the +allocation using +.Xr UMA 9 , +as opposed to +.Xr malloc 9 . .It Va kern.geom.eli.visible_passphrase : No 0 If set to 1, the passphrase entered on boot will be visible. This alternative should be used with caution as the entered @@ -863,11 +872,14 @@ Specifies how many kernel threads should be used for doing software cryptography. Its purpose is to increase performance on SMP systems. If set to 0, a CPU-pinned thread will be started for every active CPU. +Note that this variable must be set prior to attaching +.Nm +to a disk. .It Va kern.geom.eli.batch : No 0 When set to 1, can speed-up crypto operations by using batching. Batching reduces the number of interrupts by responding to a group of crypto requests with one interrupt. -The crypto card and the driver has to support this feature. +The crypto card and the driver have to support this feature. .It Va kern.geom.eli.key_cache_limit : No 8192 Specifies how many Data Keys to cache. The default limit @@ -884,13 +896,41 @@ Reports how many times we were looking up a Data Key and it was not in cache. This sysctl is not updated for providers that need fewer Data Keys than the limit specified in .Va kern.geom.eli.key_cache_limit . -.Va kern.geom.eli.unmapped_io +.It Va kern.geom.eli.unmapped_io Enable support for unmapped I/O buffers, currently implemented only on 64-bit platforms. This is an optimization which reduces the overhead of I/O processing. This variable is intended for debugging purposes and must be set in .Pa /boot/loader.conf . .El +.Sh PERFORMANCE CONSIDERATIONS +The default value of +.Va kern.geom.eli.threads +is usually good for a system with one SSD. +However, it may need to be lowered on systems with many disks, +so as to avoid creating too much thread-switching overhead. +On systems with more disks than CPUs, it's best to set this variable +to 1. +.Pp +.Nm +internally uses +.Xr malloc 9 +to allocate memory for operations larger than +.Va kern.geom.eli.use_uma_bytes , +but malloc is slow for allocations larger than +.Va vm.kmem_zmax . +So it's best to avoid writing more than +.Ms MAX(kern.geom.eli.use_uma_bytes, vm.kmem_zmax) +in a single write operation. +On systems that format +.Xr zfs 4 +on top of +.Nm , +the maximum write size can be controlled by +.Va vfs.zfs.vdev.aggregation_limit +and +.Va vfs.zfs.vdev.aggregation_limit_non_rotating +for HDDs and SSDs, respectively. .Sh EXIT STATUS Exit status is 0 on success, and 1 if the command fails. .Sh EXAMPLES From nobody Fri May 10 00:27:34 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vb8pv0KBHz5KNt3; Fri, 10 May 2024 00:27:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vb8pt6v84z4GWC; Fri, 10 May 2024 00:27:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715300855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Cjv9t50ypM9l+ImLTzop6bCE1HFtTBlZMpddijGlrcw=; b=PvVYQJ5CZZ+OMRIddRDBSo3+yaxWKAZppaK3r3FpwNmkpqBYhraYVfwj8e49NutJw7yN1V rZQdeZL3o6I0CqhF9dn7hIgPKEzuLjPAShwwgnXDaVHMece59OxTu6DjYQAayZ/7A4BmI8 uHl/cX1klrarK9PLo6Xx4WMiyyMDNRGms3kRAoqx5DW8MomZpuY9WT8/cGy8qhV97zlByH jRIkAwC+mOAMsEI1cnqthe3ctyxBwvs2tTvopLFZyGWRk8k6cGnhQoC26aQNCWH3NT0LUm J1caYnFSncCT9Ueisn78zLfMnV2GMLsS7j5waSuvQUQ/g7+7J0BoFjXIjTzQOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715300855; a=rsa-sha256; cv=none; b=geIUfUcCeLs7SHKJdNgbDBbfRVayueybGYMeB3GTHggidRuHCJSMOoe6d0601WvKWbHHd7 +wJd/DB96tJ7Q/6AsftOG/jsAcKdg+LlW+v4ZFDRM1Oek7fkY7FVqeb0xX1lUhiAk9/XsN Ev6zfbItAbKb7Wg0gRwwbIkeyXz/+8H0xdVXAiTmGIrP5fZNX9LLVTnU2mPfaw4PhilsZH nrGPqN6rLA4h/UpxklOXk1pZGjh5Mhsq8WJdX2857PJoJscLCQ8dSPoWro78/Q7N5cvshR FDSyuHKhFG9ErgpeEGfcRh/W9OFem3M2roB7YgugRDrEL5jvyK3zom/ZtCUKGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715300855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Cjv9t50ypM9l+ImLTzop6bCE1HFtTBlZMpddijGlrcw=; b=XpLZ0eatuABEbDP82kJPCmFXFrCwluu+qrIqEI5iDwS+nqCuxZTYLmy0tciVSj0JSgV2XX ZZtXt9C6mWRhA0oFh1Ya4IBzhMIsauupbVxPK8WEWIOMo4OTqwGPsAWVTF/yFN+I4ytUQY /Ess/+XvtdptA3OphqGdpx1hXWVs1YCSMudfN0+NmxrfnSnoUkpFf+pweNtRSr7SEJWXNi rA4WmtPkLhmCZHRDDSi9IrzU6eyPWP7BQR/JIwPRqr8Dsp0PHUcKe47Z1sxLN4IhkxWsDV rqc2ZtkE5s+PStrJBtzWUWmN5MrXOLK5iSdltzsBimAe/wY3DMzaldr44DRWyA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vb8pt6VjXzFhS; Fri, 10 May 2024 00:27:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44A0RY4B065844; Fri, 10 May 2024 00:27:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44A0RYHS065841; Fri, 10 May 2024 00:27:34 GMT (envelope-from git) Date: Fri, 10 May 2024 00:27:34 GMT Message-Id: <202405100027.44A0RYHS065841@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: e3e57ae30ca3 - releng/14.1 - 14.1: update to BETA2 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: e3e57ae30ca3043d84175ab3b2671702cde005a9 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=e3e57ae30ca3043d84175ab3b2671702cde005a9 commit e3e57ae30ca3043d84175ab3b2671702cde005a9 Author: Colin Percival AuthorDate: 2024-05-10 00:27:15 +0000 Commit: Colin Percival CommitDate: 2024-05-10 00:27:15 +0000 14.1: update to BETA2 Approved by: re (implicit) Sponsored by: https://www.patreon.com/cperciva --- sys/conf/newvers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index ff68b4d3f474..8816eb174865 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="14.1" -BRANCH="BETA1" +BRANCH="BETA2" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Fri May 10 07:49:29 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VbLcn2Qcwz5L5G4; Fri, 10 May 2024 07:49: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 4VbLcn1yF4z429J; Fri, 10 May 2024 07:49:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715327369; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JyVGfj+zd+aiUMe1XJNktaS0v/ES4EqipaKPZjLVqj4=; b=hyZxhq4Hv6tsX/tSlMJEh30Vc5OAl8CRFw9Oxui+tB+Ce+kiCrZbILDRdLbp/VKdsDt4/l jIjE/SS2YrKqt0OgJbOHfedhrFrnzyqFvsaebgRhQAlvJV+4/hjSRISzoA7QKouC7+5nyL AuEhJVtuIVib7/ftq9ZSXekDX8FkG8tZ31Iz/9fVe+XlzwN10mUttNenpYq6s2cinUUzMN F/C7KUoaKSjHg+KXUN1+akk3wlCgG/4eown7OCsbnI/2B2q1LjnOo+kRD6gXMOVKUUDTos MRVs5bFZHyrd2AtfUGKZ+ff2tbo87Shs64a+nWewZHMGUbqyTmcYGyfupRr7sA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715327369; a=rsa-sha256; cv=none; b=ngLaPzBh6UgYutSRSUKcLRYDBSTFISZaRy0caXs5shzEUwgMKIdmjmo6JMH1HUMQFbC7fn y+KmtqN3C+NgGIy3Rd46o2ftcj8Y5or6TI86HGYv5MJ9TUO6vX18CWlz2969fcQutVtV3E qF2QLgwzLAz56/GRvyQHszGpBXzr8n15JjlGTYNNLfkp3eEPNzt0UtA+JmTwa0qdybWyJn QBTyA8h+m0RnGgRMZoMFi+j4jDbgc8WG1c+5RZQcUz5itS/r6/2yqp8sn01wVUmpleq/NH E7MFxxMgLeS9J+iZPeZ4u8OSm4HMi30Amqtf5yFdMHjVOY3ZBT/RHvI/Ca6udQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715327369; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JyVGfj+zd+aiUMe1XJNktaS0v/ES4EqipaKPZjLVqj4=; b=Ubul+F0MOnVaXK+9A0UyRT38TwE/+ukTNsOqpR9GAhNb8yhDre6iaRpViU6A9O8fvitstr rLGyLSRPsOaivfBsB+4GVxzeju0/Y3oZaOW9u83B4crhtq4rhuQ9DZi0TWvIl5Cx4NPc2+ 3s8mT7TRiAoMqAs7ewB2dwY8w1UIrpOdjNDNIfiBxwEIJ3ugOM6zdKjzC3oGBr0AwIyoYL 7k7ZD+F1JhKfSJd4owqNhLiRATE8gxNEonhM9gyfwMP3Kx35uYnWjZPTVgvKkZtfAWgLww 0R0eMpSugT1BM0xzYeElhGQ0UDNgaRTgytd+6rqbI0xYCq8Vfex5R7hyPRaTcw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VbLcn1Y5bzSRL; Fri, 10 May 2024 07:49:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44A7nTVs011329; Fri, 10 May 2024 07:49:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44A7nTbe011326; Fri, 10 May 2024 07:49:29 GMT (envelope-from git) Date: Fri, 10 May 2024 07:49:29 GMT Message-Id: <202405100749.44A7nTbe011326@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 6a8ca2ff5338 - stable/14 - __cxa_thread_call_dtors(3): fix dtor pointer validity check List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6a8ca2ff53389c36233e5e0b1576696d34b74407 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6a8ca2ff53389c36233e5e0b1576696d34b74407 commit 6a8ca2ff53389c36233e5e0b1576696d34b74407 Author: Konstantin Belousov AuthorDate: 2024-05-03 09:32:01 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-10 07:49:10 +0000 __cxa_thread_call_dtors(3): fix dtor pointer validity check PR: 278701 (cherry picked from commit b27eb9ce96b838622e125fd969e8dc4914aabe18) --- lib/libc/stdlib/cxa_thread_atexit_impl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/stdlib/cxa_thread_atexit_impl.c b/lib/libc/stdlib/cxa_thread_atexit_impl.c index f95384b30347..3123bd12dca8 100644 --- a/lib/libc/stdlib/cxa_thread_atexit_impl.c +++ b/lib/libc/stdlib/cxa_thread_atexit_impl.c @@ -102,7 +102,7 @@ walk_cb_call(struct cxa_thread_dtor *dtor) { struct dl_phdr_info phdr_info; - if (_rtld_addr_phdr(dtor->dso, &phdr_info) && + if (_rtld_addr_phdr(dtor->func, &phdr_info) && __elf_phdr_match_addr(&phdr_info, dtor->func)) dtor->func(dtor->obj); else From nobody Fri May 10 07:49:54 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VbLdG46cNz5L5YT; Fri, 10 May 2024 07:49: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 4VbLdG3PYrz42wL; Fri, 10 May 2024 07:49:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715327394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2alVYmTPO2/e602tHHutN3o8ml2MlJA57vaU4NMx/Wc=; b=MYV7glt2RyIAvsDwALdnrHKjBTH8pMLRigRAq2+PS9t7G1SAOwkNaWIaFm87M25rEx3npc 00zNosVi3Y2Yt7VuLN2NVtNXLk+KpqrSQPpkkrikY4NwHex5G+B2iVIcB0dWzRBOBqUYR2 edaxSewKwKuxsU3k5ZCzWZEWxbkRH08vV+IDsfJ7zwyH4mSf+RrStK+AM1eWlxCnsB501T uejFJsN3ZDfmhvw27do708B7k1i+bx0rm44+A5+30muhT+PI1hDHW6tld0wUcdfp5hqBbH U5fC1TMpU818FbjEu22SfmsNm8qeh42jEm0+faFFp7FpquSV8a9JRmmXyrc7BA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715327394; a=rsa-sha256; cv=none; b=jt8SiTeEtOpDUOxR8KJrHx+25sOv6RcNWYC76TXi8eMBI7wVR93DPbvEo9XYnsrqk1tK07 Ks8r+1kyn4553yNTK0yPIf12ERMVxO2bRjc6bxa6r68bLBjBx67D/4aKYqN2bELc/MdKmT tY31XEqK+l/dQ4s82eMOtu4IrOB+qkSk+Fy+C1KzVL1yA8G4i6s/cI7xPC89ZHwKmsF3qW bVgDtVOrE/0Lc1G1K32y8OM44xOJMZ1S8TVxN0TL9xV/Yt307raSHOE6d9+hHfYz/7bxX4 Zr1npnUSdaZiv2I8Bw5nE2NIUWX6IFopH5y6pVld6D0B73MSHLBYdzbMifgF3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715327394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2alVYmTPO2/e602tHHutN3o8ml2MlJA57vaU4NMx/Wc=; b=u6PU/S+YvrbF2VXHWeOaUWOIjgYze4Xcm2r8nQ6aQKM9B1mohHRy15my5LVsfWaJ12CKlN 2H7fN1lvdZLaWQVmCCrKq6th3qGm4CALbbFFASrg+yjEm4BrPOjIZKbnv/4m3XLKV5aA5L rNJxposJtJIQu5XSzayXSdFLL5PiOgGpOXvCRQTk7vC2FXXhyWKQaDeAnMJkJ2vXl3A49C s2Gt5dXt5SuFf3loiUQSm266QzTr6sdznMpBih/8n7ZUUbLyS8jqhIy736edCS3WEWpuPM dLMZzuCpBPIKru03zQ4Q9ZI8T1gC0d0/N+XIRUjEKO8V1Sw044fOMt/Mk/GwCw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VbLdG30cgzSp0; Fri, 10 May 2024 07:49:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44A7nsL0011524; Fri, 10 May 2024 07:49:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44A7nsNH011522; Fri, 10 May 2024 07:49:54 GMT (envelope-from git) Date: Fri, 10 May 2024 07:49:54 GMT Message-Id: <202405100749.44A7nsNH011522@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 5cf78a550034 - stable/13 - __cxa_thread_call_dtors(3): fix dtor pointer validity check List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5cf78a5500345340771f7eb840724c2422b2ff96 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5cf78a5500345340771f7eb840724c2422b2ff96 commit 5cf78a5500345340771f7eb840724c2422b2ff96 Author: Konstantin Belousov AuthorDate: 2024-05-03 09:32:01 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-10 07:49:36 +0000 __cxa_thread_call_dtors(3): fix dtor pointer validity check PR: 278701 (cherry picked from commit b27eb9ce96b838622e125fd969e8dc4914aabe18) --- lib/libc/stdlib/cxa_thread_atexit_impl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/stdlib/cxa_thread_atexit_impl.c b/lib/libc/stdlib/cxa_thread_atexit_impl.c index 2ebf20ef7fd9..ef9f3567d483 100644 --- a/lib/libc/stdlib/cxa_thread_atexit_impl.c +++ b/lib/libc/stdlib/cxa_thread_atexit_impl.c @@ -103,7 +103,7 @@ walk_cb_call(struct cxa_thread_dtor *dtor) { struct dl_phdr_info phdr_info; - if (_rtld_addr_phdr(dtor->dso, &phdr_info) && + if (_rtld_addr_phdr(dtor->func, &phdr_info) && __elf_phdr_match_addr(&phdr_info, dtor->func)) dtor->func(dtor->obj); else From nobody Fri May 10 08:55:58 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VbN5W1c1Qz5HyMq; Fri, 10 May 2024 08:55:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VbN5V6VSRz49Lg; Fri, 10 May 2024 08:55:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715331358; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ICIMIRw4s24lW0zOH6IbVruYpg2Lwk9MSiexkFLywNk=; b=cwItuECNZvpjhPeIj4AE14q2GrSNM6OvvmD6uM+xIO5benvxHDeTF7jg88dFu39g+/aMIB RcQCY7YxDnjx/j/2z9x8rk81/BbdnM9cjdm7F5xaJeFrPV0DhYZ5wXDaisrt0D9sF413iL +HMVOU/Y+3wTn6UTC7XUbQGAyh/7iwUlakusATpy6/H/UlsguWyl0EA+Hy+cuD5bUezCo/ fDqkV2tMemT/qrxqNUv2mYw1vfJukvv+sEff79YWDgrqB2eZAVU7WT5u2Xnrhd5sl3dFEQ 85D5UsfA9W2JB4Tsch9QmwC2hpPLG9b0LYw44sJg6464qrVvVbO1WH00LoKvVg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715331358; a=rsa-sha256; cv=none; b=Hd3yBs7BaeviLXBGSSCMX8YEiARngDTt4kkIuB17UXlmD6poPBguzlF9GcEYD/Dp8BiqCC 9DAMO+69p0XnVrWNNUzLVaMv3sr+ejBPGIcHtEnCm7eMkBKJb5GwHCU3pfcMJukmT6i4N/ xnJIv3lcTjLAM5QDA89Ea15OCVA7Gldd598YZgAXSXqXR/Pa0FuZSoRkM3ljlO7FR1VUeF Hn657xo/2elcxUDq9brbFzrqRZ6T379Qxp6fscY91yvf9X02o/kW/jVSxWTz0bmBqXyi5T pFCXuwBfzLoz66w8bEBZlZc4BNLtUjvM4uxu42ILu1scgr2LrrkklUgadZLrvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715331358; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ICIMIRw4s24lW0zOH6IbVruYpg2Lwk9MSiexkFLywNk=; b=OnjBjotVgcyi5LdDBRNcA2C+TdNQ33+HVh6Bi4wsHCu8DvsIgP+PhvPoEbzpKza8mIr/u5 7zDnQtzYmJI1yp6z0PYvbtcwIIaAwR56PQ92Pe/jqzwFzpm4tXu3L81iGZdwdTPAfXlHjR TA53r1Go20J7tC7cZMfYOqwU5WomkMpfnD9hdmjtW5Wz/w/jNS2Ccwa4FG76bO1vVvbO/Z +HsEtpxaAapzt974oT/0t9G/n6Q+rYfkp98DXpaxQ54pvwtu4N6FReWMpRwYcXn9N7kvLk 96jSXhMU862W4xVf2RiqNR8fXuzqZQFvw6+WErb+zMswlGxqZ8WSoGAS1hP/cQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VbN5V5DkDzX2r; Fri, 10 May 2024 08:55:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44A8twmp029096; Fri, 10 May 2024 08:55:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44A8twiu029093; Fri, 10 May 2024 08:55:58 GMT (envelope-from git) Date: Fri, 10 May 2024 08:55:58 GMT Message-Id: <202405100855.44A8twiu029093@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: e1ae31fc1155 - stable/13 - calendar: cleanup obsolete directories List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e1ae31fc1155ac2d4a346a7f7f07365a37d3285f Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=e1ae31fc1155ac2d4a346a7f7f07365a37d3285f commit e1ae31fc1155ac2d4a346a7f7f07365a37d3285f Author: Yuri Pankov AuthorDate: 2023-05-08 22:43:12 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-10 08:55:46 +0000 calendar: cleanup obsolete directories Follow 5282ada06bb and don't reinstall obsolete directories. (cherry picked from commit 7adea6dbed35061e6175b7da69a47073916b3c25) --- etc/mtree/BSD.usr.dist | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist index 0630708b9024..6e6b733c141d 100644 --- a/etc/mtree/BSD.usr.dist +++ b/etc/mtree/BSD.usr.dist @@ -196,26 +196,6 @@ .. .. calendar - de_AT.ISO_8859-15 - .. - de_DE.ISO8859-1 - .. - fr_FR.ISO8859-1 - .. - hr_HR.ISO8859-2 - .. - hu_HU.ISO8859-2 - .. - pt_BR.ISO8859-1 - .. - pt_BR.UTF-8 - .. - ru_RU.KOI8-R - .. - ru_RU.UTF-8 - .. - uk_UA.KOI8-U - .. .. certs blacklisted tags=package=caroot From nobody Fri May 10 13:02:07 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VbTYX29VYz5JPbg; Fri, 10 May 2024 13:02: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 4VbTYX0mD6z4bgQ; Fri, 10 May 2024 13:02:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715346128; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=focPFdKJmQ24Be306wKi5zjmdsvXRAkvZgRh/1hsSGQ=; b=TpWotYrGu69z0dVZ6S2n+fCCorhbcB2LsVU+fb5yk0CEMevtw6VB0IJO+AXyhQ/ZJLnYhv QtiOQoFHEGLG7EuBq47nURLBe6d5ji9D9RFrVoHq85EoR6gAnPDT/5MUzkn/3f/OTg9pbx X/bbBIp6586mKEq2XIKk0RBeod8g1PbI5bJpq1caVW9B5/hWHSKBEi6a0223+UMOOjrDKd 5ooH3FASxGcTTm7/LxY+W3KVe1R4Nz4vtR3QuMWPZC1leQ+c6i1OnugqUf+Y4b3QHy2xLo F0AELU2HMNIlWCz48U6UXMwaqrYXde8EybpVvLvpejmWSfD69cRE4sVy4CglmA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715346128; a=rsa-sha256; cv=none; b=Ad5aqrETirgKDbaA2Qzna3qVR9laB0poSqP5257PD19NGKeRedoPSQEpX1o0hrhwOEg2C6 pSLPmHZZeifAR6lN7RE4sqlzUIyHwtvA3XYDieC2qaRBFfe1yBWOOnJfmO4wn4LLV85PFE Y9LMYlcOyphv8nwPdLRUDrbTMHWWTxjhWRqRkvk4EuR4sdozDsBfR8x1cLYwBmWmNN6FAK 17lx/94iwkKmuUXzP1qnPUIJ46wjg9WJDbSITqrvN+yl4bDv1eqKC7I4DPOYipE7T0aM4k DEub7PtS2uYSzOJz6782EmpMdGs9P2HLjx5Zy3lWL5bDul3SO1+uALCbgW0SGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715346128; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=focPFdKJmQ24Be306wKi5zjmdsvXRAkvZgRh/1hsSGQ=; b=KYkqddrGzw8HAd9N/EIrteAFhJhoeQ+DAZX0YE5o+WWr+tD88XrkyfyOgPLHrFvYfdUVvs hP8aAbHGTD8fNuLs6EgvxQUJTcxWkea633VfPb77HQWWMDpVx23ghJDFQnCewo1LnwMkq9 C9mX29/FvApa76a4Iu5L+YVsxGDw1FquChnmAaqNOlQDZnwOiaujmt4vK5Gf7C778i62NC kPC2jdi087TtG7agv83QNgmaJFPRkACFf1qAF4snyIF6ce3ywUeTB4xYBDQ3TjJk6390hx vSwMXQTOxTwfoDnTqJeEVv6qIP3aI5aHgapwPPb60Gb8JtRoNdlqIM+lW3NyDw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VbTYX0NMgzdmj; Fri, 10 May 2024 13:02:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44AD27rE051133; Fri, 10 May 2024 13:02:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44AD27lA051129; Fri, 10 May 2024 13:02:07 GMT (envelope-from git) Date: Fri, 10 May 2024 13:02:07 GMT Message-Id: <202405101302.44AD27lA051129@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 0e0220d11add - stable/14 - clock_gettime.2: fix markup List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0e0220d11addc60fe7ed6fca79aefac2a3a9af27 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0e0220d11addc60fe7ed6fca79aefac2a3a9af27 commit 0e0220d11addc60fe7ed6fca79aefac2a3a9af27 Author: Ed Maste AuthorDate: 2024-05-06 19:59:42 +0000 Commit: Ed Maste CommitDate: 2024-05-10 13:01:52 +0000 clock_gettime.2: fix markup The CLOCK_* constants are "defined variable or preprocessor constants" and so use .Dv. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45106 (cherry picked from commit 2d29d2ecebf8ea19221995b3ea2e3a7ac700bf81) --- lib/libc/sys/clock_gettime.2 | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/lib/libc/sys/clock_gettime.2 b/lib/libc/sys/clock_gettime.2 index ed469153a40e..c8bef4c5424f 100644 --- a/lib/libc/sys/clock_gettime.2 +++ b/lib/libc/sys/clock_gettime.2 @@ -94,29 +94,29 @@ Returns the execution time of the calling thread. .El .Pp The clock IDs -.Fa CLOCK_REALTIME , -.Fa CLOCK_MONOTONIC , +.Dv CLOCK_REALTIME , +.Dv CLOCK_MONOTONIC , and -.Fa CLOCK_UPTIME +.Dv CLOCK_UPTIME perform a full time counter query. The clock IDs with the _FAST suffix, i.e., -.Fa CLOCK_REALTIME_FAST , -.Fa CLOCK_MONOTONIC_FAST , +.Dv CLOCK_REALTIME_FAST , +.Dv CLOCK_MONOTONIC_FAST , and -.Fa CLOCK_UPTIME_FAST , +.Dv CLOCK_UPTIME_FAST , do not perform a full time counter query, so their accuracy is one timer tick. Similarly, -.Fa CLOCK_REALTIME_PRECISE , -.Fa CLOCK_MONOTONIC_PRECISE , +.Dv CLOCK_REALTIME_PRECISE , +.Dv CLOCK_MONOTONIC_PRECISE , and -.Fa CLOCK_UPTIME_PRECISE +.Dv CLOCK_UPTIME_PRECISE are used to get the most exact value as possible, at the expense of execution time. The clock IDs -.Fa CLOCK_REALTIME_COARSE +.Dv CLOCK_REALTIME_COARSE and -.Fa CLOCK_MONOTONIC_COARSE +.Dv CLOCK_MONOTONIC_COARSE are aliases of corresponding IDs with _FAST suffix for compatibility with other systems. Finally, @@ -138,7 +138,7 @@ struct timespec { .Ed .Pp Only the super-user may set the time of day, using only -.Fa CLOCK_REALTIME . +.Dv CLOCK_REALTIME . If the system .Xr securelevel 7 is greater than 1 (see @@ -186,14 +186,14 @@ and system calls conform to .St -p1003.1b-93 . The clock IDs -.Fa CLOCK_REALTIME_FAST , -.Fa CLOCK_REALTIME_PRECISE , -.Fa CLOCK_MONOTONIC_FAST , -.Fa CLOCK_MONOTONIC_PRECISE , -.Fa CLOCK_UPTIME , -.Fa CLOCK_UPTIME_FAST , -.Fa CLOCK_UPTIME_PRECISE , -.Fa CLOCK_SECOND +.Dv CLOCK_REALTIME_FAST , +.Dv CLOCK_REALTIME_PRECISE , +.Dv CLOCK_MONOTONIC_FAST , +.Dv CLOCK_MONOTONIC_PRECISE , +.Dv CLOCK_UPTIME , +.Dv CLOCK_UPTIME_FAST , +.Dv CLOCK_UPTIME_PRECISE , +.Dv CLOCK_SECOND are .Fx extensions to the POSIX interface. From nobody Fri May 10 13:02:09 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VbTYY3Bctz5JPl4; Fri, 10 May 2024 13:02: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 4VbTYY1mYjz4bN3; Fri, 10 May 2024 13:02:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715346129; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h0rfkFFe5DO1ICa2D6nY+O/QrnPHgVt6wj56LgQcEmA=; b=gAdT5HXS4MlFXncCCG4wznB3uel+dOTqXhuLiDBMTpNeJA4UmzPZFSttdtoge/lQ/O2trz PTAojwik5BaoJhaKjPGJaeQ4eexR61l/HOikvBU6xedzB5c4Iqe5E+A0GJbqIIX3V8M22a ZQKkPHyLzmxtF3hKRvb/2cWQ1vJ0xTKvpceGlRe2Y86zKtoADFVAo+tcMqXzQCv8tAZhTb My7KuwoHECkV5h8OrQUvapvEtLyzzXtuDpPECgZlkHCvgaBtjaEajdt12dSU4tN7vevnrz +o5yjAD/8ZA1+W22ESE2NccZbcEFVO4U+Ov9CTY21pvA6N61KOrdXrIMPZjDLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715346129; a=rsa-sha256; cv=none; b=gLZyEv1StmQ3Ap1MB3/49SgjrnV27x8FqENzzLpkFC3Kzz9i6NuHz/CJ5aCAWY5TTWgDyU R5SOc292N+U/fAmPyCgUBeFHzMVURaodCGsjcN5nWXj7ESP40TYOZemVneQHXXtsMzSNz7 heJYe9RPpoKJow3M6XT6E4XL0o3D3Fhn5v75VO4RQ0TpTsRkP7AmxYY8vayF9wNU7J0tOH BYdvu24czfWx/QMl1k5U94SmnpPiKlsgqfKa22dS7xEecjyg1V1D7qTJIVPoLg5aNMaZFv y346TR2lIn7z9svRqcv4J6TJHru+jmfbSx9cMkrNGYRJyZ9gi1aP/cbNrXQ9ag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715346129; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h0rfkFFe5DO1ICa2D6nY+O/QrnPHgVt6wj56LgQcEmA=; b=dKDZdIDQkOd2Xn0rrMo0ciVNUYZDlKgCwW0g8DMFM6qv9UWHAU+PsTKm0CdjqUxYzw4z0w HP0NpW/ajxdqpGMfGeeDtRCtMcikkbfBuU0mB4bwKfqks88n+UL1YkwDOuWkagYEGM5Qja RGdgnYaP/G24ndDqyek1A8EkVfhbR4p3Jz+8k5OyfXxgPKkJHeNccNgptYJps+6Rh6Kanq gRVbIB2LgFKVY8yAaEaP8on890IdwCVsuZeGYXcj0RJWBrqKGHx0TKcUFnlHF0IkLNMIO9 CVtRy5+7t57OV1MBUVYL0iduF8cN+wwafI9bwXaQ6LbUDanW4FUAwLTcBWhmGA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VbTYY1NWRzdmk; Fri, 10 May 2024 13:02:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44AD29BB051177; Fri, 10 May 2024 13:02:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44AD29eo051174; Fri, 10 May 2024 13:02:09 GMT (envelope-from git) Date: Fri, 10 May 2024 13:02:09 GMT Message-Id: <202405101302.44AD29eo051174@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 5e7de5daa95d - stable/14 - smsc(4): update to mention Microchip List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5e7de5daa95dd901fc4f051120461805aaff29e3 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=5e7de5daa95dd901fc4f051120461805aaff29e3 commit 5e7de5daa95dd901fc4f051120461805aaff29e3 Author: Ed Maste AuthorDate: 2024-05-07 15:33:45 +0000 Commit: Ed Maste CommitDate: 2024-05-10 13:01:52 +0000 smsc(4): update to mention Microchip Microchip Technology acquired SMSC in 2012, and all current products and datasheets refer to the devices supported by this driver as Microchip parts. Mention SMSC in a parenthetical comment to explain the driver's name. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45115 (cherry picked from commit 7ef6ce51742d44a7375ccbaeda4cc64e034c4816) --- share/man/man4/smsc.4 | 12 ++++++------ sys/dev/usb/net/if_smsc.c | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/share/man/man4/smsc.4 b/share/man/man4/smsc.4 index 56c1556e5f83..61b12c7d230c 100644 --- a/share/man/man4/smsc.4 +++ b/share/man/man4/smsc.4 @@ -25,12 +25,12 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd November 24, 2015 +.Dd May 7, 2024 .Dt SMSC 4 .Os .Sh NAME .Nm smsc -.Nd "USB SMSC LAN9xxx Fast Ethernet driver" +.Nd "USB Microchip LAN9xxx Fast Ethernet driver" .Sh SYNOPSIS To load the driver as a module at boot time, place the following line in @@ -53,7 +53,7 @@ following lines in your kernel configuration file: The .Nm device driver provides support for USB Fast Ethernet adapters based -on the SMSC LAN9xxx chipsets. +on the Microchip (formerly SMSC) LAN9xxx chipsets. .Pp For more information on configuring this device, see .Xr ifconfig 8 . @@ -64,11 +64,11 @@ driver: .Pp .Bl -bullet -compact .It -SMSC LAN9500, LAN9500A, LAN9505 and LAN9505A based Ethernet adapters +LAN9500, LAN9500A, LAN9505 and LAN9505A based Ethernet adapters .It -SMSC LAN89530, LAN9530 and LAN9730 based Ethernet adapters +LAN89530, LAN9530 and LAN9730 based Ethernet adapters .It -SMSC LAN951x Ethernet adapters with integrated USB hub +LAN951x Ethernet adapters with integrated USB hub .El .Sh SEE ALSO .Xr arp 4 , diff --git a/sys/dev/usb/net/if_smsc.c b/sys/dev/usb/net/if_smsc.c index a59501b6bbff..58809de4ad3a 100644 --- a/sys/dev/usb/net/if_smsc.c +++ b/sys/dev/usb/net/if_smsc.c @@ -28,7 +28,7 @@ #include /* - * SMSC LAN9xxx devices (http://www.smsc.com/) + * Microchip LAN9xxx devices (https://www.microchip.com/en-us/product/lan9500a) * * The LAN9500 & LAN9500A devices are stand-alone USB to Ethernet chips that * support USB 2.0 and 10/100 Mbps Ethernet. @@ -38,7 +38,7 @@ * supports the hub part. * * This driver is closely modelled on the Linux driver written and copyrighted - * by SMSC. + * by SMSC (later acquired by Microchip). * * * From nobody Fri May 10 14:07:51 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VbW1M5HSDz5JWWc; Fri, 10 May 2024 14:07: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 4VbW1M4X56z4gZF; Fri, 10 May 2024 14:07:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715350071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K4j3Y4WIHpYoyIscjeOXjmu2a62PBOe0A2rCNCIXxT4=; b=l34rXuhArlSws0WHGoow24CHrbhBDeLAPnW/ajNYUvSuCFNU4uB26PglqCB6m8p/l6e6h3 XdhDqJ5pFWdEgUA6vdQMkSZBJ+BwPsU7Rsth1NOxTf1NKxCwcYJ0GEPgjDTjTQJTbZQFV9 4PXhLaWKvRYVGJTOqwhjFEvIf/Y1WmzOYBe6tjORuGM30IJp3oOMgdKxLMvOfKjxvfL/1r fslvEiZvEfoHAy82Xa75sOPUbt9/DQw+cqi5vT8SRHf8Rjy+gTwKr660LfMd7OHPA3AJ2L cuZJXJX7YNFBHVva32JQadWGqklf4hNfvWWAuGvJFjR+kIkW6LwB/oqlu1ZkoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715350071; a=rsa-sha256; cv=none; b=Nz8t6Wj9lylFbU6/NtVY5HeIEa8lSg4dN3C0XPjxKKf261Ot5G8wg37DftItakW85ebWQA HJthrMy6lPnZ+2DBx2K4XGrmI2OASGVr1HE5WTeQKPfc50eBUogMlBFjtrtcdv8qTs05vv nwrqFrPxeWNf+zJ1ZYsETY+SivR2HmT+dLiGM6trHtK+fhmjxVIErI7BjilCx9m0g7VucV nyjLAaqsOmOMLLR4yPCWN7sLZaYYTSlZX1StDIc9KsQpW1Si7gKYAGCoi7zg78TkPVUUCA g7eCtlor2oUKqSoCUKCR2IW5mu4XT1MF8XeZOdGy9PMrenjz7XHzGnm40JNmlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715350071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K4j3Y4WIHpYoyIscjeOXjmu2a62PBOe0A2rCNCIXxT4=; b=FcAcCwZoLx5WCemu3bmiT3uWsrqnuVkAKQVO7a9BBQY5Qa8BSso+6fGq/mBHpLE4R436/a SW968TcugBfD5GV7YgCblLMjo18jUhllSNVRJbseEGfF+SFZMBspym2vQPdXBUuhizca3m X5ql5NdxiSp5GXV/roATGets+Ytd6u1zNSsgdjS9CPb51oskaAjWPiT5C3ULLjVrDYBLzW 1G6bV6NOSaJGOU4wOAGiXQslCCBE1HAnRYmYHt5Z2Enkmn18ZG9xiEV1XZLYXChyXJQYCf REzI3hne8NBbShiANZFO6ocsq31FfRXfZ9aJGrljFQFHcinncqzZI9Wm6+pfGw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VbW1M472fzg8b; Fri, 10 May 2024 14:07:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44AE7paF053446; Fri, 10 May 2024 14:07:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44AE7pFi053443; Fri, 10 May 2024 14:07:51 GMT (envelope-from git) Date: Fri, 10 May 2024 14:07:51 GMT Message-Id: <202405101407.44AE7pFi053443@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: d45f1f519342 - stable/14 - sys/net/if_bridge: support non-INET kernels List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d45f1f5193420fac7f9a64c0455991a80e7cb89a Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=d45f1f5193420fac7f9a64c0455991a80e7cb89a commit d45f1f5193420fac7f9a64c0455991a80e7cb89a Author: Lexi Winter AuthorDate: 2024-04-23 21:12:57 +0000 Commit: Zhenlei Huang CommitDate: 2024-05-10 14:03:10 +0000 sys/net/if_bridge: support non-INET kernels Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1159 (cherry picked from commit 65767e6126a7e92bc76561b4ffd005cf85ba525e) if_bridge: Minor style fixes And more comments on the #ifdef INET blocks to improve readability. While here, revert the order of two prototypes to produce minimal diff compared to stable branches. (cherry picked from commit 73585176ffd84c13d68cad67c2ca81643f09075c) --- sys/net/if_bridge.c | 48 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 1b4ac92b62a3..1e6f9b578ee3 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -403,12 +403,14 @@ static int bridge_ioctl_sproto(struct bridge_softc *, void *); static int bridge_ioctl_stxhc(struct bridge_softc *, void *); static int bridge_pfil(struct mbuf **, struct ifnet *, struct ifnet *, int); +#ifdef INET static int bridge_ip_checkbasic(struct mbuf **mp); +static int bridge_fragment(struct ifnet *, struct mbuf **mp, + struct ether_header *, int, struct llc *); +#endif /* INET */ #ifdef INET6 static int bridge_ip6_checkbasic(struct mbuf **mp); #endif /* INET6 */ -static int bridge_fragment(struct ifnet *, struct mbuf **mp, - struct ether_header *, int, struct llc *); static void bridge_linkstate(struct ifnet *ifp); static void bridge_linkcheck(struct bridge_softc *sc); @@ -3390,12 +3392,15 @@ bridge_state_change(struct ifnet *ifp, int state) static int bridge_pfil(struct mbuf **mp, struct ifnet *bifp, struct ifnet *ifp, int dir) { - int snap, error, i, hlen; + int snap, error, i; struct ether_header *eh1, eh2; - struct ip *ip; struct llc llc1; u_int16_t ether_type; pfil_return_t rv; +#ifdef INET + struct ip *ip = NULL; + int hlen = 0; +#endif snap = 0; error = -1; /* Default error if not error == 0 */ @@ -3436,31 +3441,36 @@ bridge_pfil(struct mbuf **mp, struct ifnet *bifp, struct ifnet *ifp, int dir) } /* - * If we're trying to filter bridge traffic, don't look at anything - * other than IP and ARP traffic. If the filter doesn't understand - * IPv6, don't allow IPv6 through the bridge either. This is lame - * since if we really wanted, say, an AppleTalk filter, we are hosed, - * but of course we don't have an AppleTalk filter to begin with. - * (Note that since pfil doesn't understand ARP it will pass *ALL* - * ARP traffic.) + * If we're trying to filter bridge traffic, only look at traffic for + * protocols available in the kernel (IPv4 and/or IPv6) to avoid + * passing traffic for an unsupported protocol to the filter. This is + * lame since if we really wanted, say, an AppleTalk filter, we are + * hosed, but of course we don't have an AppleTalk filter to begin + * with. (Note that since pfil doesn't understand ARP it will pass + * *ALL* ARP traffic.) */ switch (ether_type) { +#ifdef INET case ETHERTYPE_ARP: case ETHERTYPE_REVARP: if (V_pfil_ipfw_arp == 0) return (0); /* Automatically pass */ - break; + /* FALLTHROUGH */ case ETHERTYPE_IP: +#endif #ifdef INET6 case ETHERTYPE_IPV6: #endif /* INET6 */ break; + default: /* - * Check to see if the user wants to pass non-ip - * packets, these will not be checked by pfil(9) and - * passed unconditionally so the default is to drop. + * We get here if the packet isn't from a supported + * protocol. Check to see if the user wants to pass + * non-IP packets, these will not be checked by pfil(9) + * and passed unconditionally so the default is to + * drop. */ if (V_pfil_onlyip) goto bad; @@ -3492,9 +3502,11 @@ bridge_pfil(struct mbuf **mp, struct ifnet *bifp, struct ifnet *ifp, int dir) */ if (dir == PFIL_IN) { switch (ether_type) { +#ifdef INET case ETHERTYPE_IP: error = bridge_ip_checkbasic(mp); break; +#endif #ifdef INET6 case ETHERTYPE_IPV6: error = bridge_ip6_checkbasic(mp); @@ -3514,6 +3526,7 @@ bridge_pfil(struct mbuf **mp, struct ifnet *bifp, struct ifnet *ifp, int dir) */ rv = PFIL_PASS; switch (ether_type) { +#ifdef INET case ETHERTYPE_IP: /* * Run pfil on the member interface and the bridge, both can @@ -3571,6 +3584,7 @@ bridge_pfil(struct mbuf **mp, struct ifnet *bifp, struct ifnet *ifp, int dir) ip->ip_sum = in_cksum(*mp, hlen); break; +#endif /* INET */ #ifdef INET6 case ETHERTYPE_IPV6: if (V_pfil_bridge && dir == PFIL_OUT && bifp != NULL && (rv = @@ -3628,6 +3642,7 @@ bad: return (error); } +#ifdef INET /* * Perform basic checks on header size since * pfil assumes ip_input has already processed @@ -3728,6 +3743,7 @@ bad: *mp = m; return (-1); } +#endif /* INET */ #ifdef INET6 /* @@ -3783,6 +3799,7 @@ bad: } #endif /* INET6 */ +#ifdef INET /* * bridge_fragment: * @@ -3859,6 +3876,7 @@ dropit: } return (error); } +#endif /* INET */ static void bridge_linkstate(struct ifnet *ifp) From nobody Fri May 10 14:13:00 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VbW7J6kKSz5JXF7; Fri, 10 May 2024 14:13: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 4VbW7J6CnJz4hX3; Fri, 10 May 2024 14:13:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715350380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+d7ftOZ40t56UoFViGMS9lR3ysaCikTpGG3zDcgStUA=; b=HPiAGhGTheGc8qe5GKClWhqL0qfab/2aGXpEAPOQnFD+2SdPbPecrGrlzfVUvfcnPnDjE6 uBlC2Ntq4hzJ43tjkyzffmRpSjfiPETDeFkZt7M8GXx6nyKbQrIUMoRT7pQ5G6NFUK7gW6 sSWrYfqT9wyF4itUxdgcMhdw1t88gylRh8tLkzoOirNwV1p+BGG86pxwdoCfz+OgsNT01x zIIQ3elOijLmjzzLjn0LcyadRziaRZ5GWDMO+J3DpmzZodfFNi8BBZ7jAxLv0/cv6vFcx5 VvXQ03UZAA60T7EdDjBEHQsy1jP9P9aYSEaJu0IiQuhPjIcP0VZZJyhHzB4h1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715350380; a=rsa-sha256; cv=none; b=ibKhlshPxbYI1XP6WNbMuF4RRLyJEDxO3CvCXbdsGXA5jDG8iNhhtpIjFM07UenSOjNdEi 4Z+bawbdF0Ebo92aUHatYsuvS4Uc6cVjhL1Nt3trlJ9aZ6htDPcmilhc9fsft8GP9KXDM5 YYAuvF2pjta6cJRz0OYaB6A66bS78sgF2L0UM9m3X2ablB3CiEnMPilxSMUkssifHQivZk 02Npyx4B052zo8pbTuT3LqN00hvdFQxWC7u6L9p+N++I7jWhALrQOik9E25TbsUjlIzAZu KOavjWmOXrdAHjgg4VwE0N4CjVqVJM1+buuMFZv+FhOUDwSfuulpJEZh8fpRFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715350380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+d7ftOZ40t56UoFViGMS9lR3ysaCikTpGG3zDcgStUA=; b=QS3fcrkjwRQfDYXPVWjdmq9apcueGjuZ/x7h19/QslTAHNfk/JSXuEAncNr2BYO98lpQwH O3gkpHEwk6raGxcdu2myZwfwwffqxEjLZ6xvEl0rMsOErxoZsVcWI2XxXXV4n5aR0DYvPC x79cWcG9vvfar7qXsX2qNchIVQKVSEFQESZwHHU6rPHLJ3fPtJWmYoJSwJe0v2Hu6YROb4 inNqYHZaZ2jkd9XChzIprsqPQjmP1lu5VbFJmr1ZKArl35Er6up/0U8E3CsZFXuS6VUBfE izBRpU0yYZ3cIHk2mY7D9rWHjK0sfaiuenSIMVsbaeDv0aytfcBmS2mDpLjWbQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VbW7J5W7Bzgxs; Fri, 10 May 2024 14:13:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44AED077069250; Fri, 10 May 2024 14:13:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44AED02b069247; Fri, 10 May 2024 14:13:00 GMT (envelope-from git) Date: Fri, 10 May 2024 14:13:00 GMT Message-Id: <202405101413.44AED02b069247@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 07e4121aa14b - stable/13 - if_bridge: clean up INET/INET6 handling List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 07e4121aa14b4fb2f3def60272eee5d3c6d288a6 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=07e4121aa14b4fb2f3def60272eee5d3c6d288a6 commit 07e4121aa14b4fb2f3def60272eee5d3c6d288a6 Author: Lexi Winter AuthorDate: 2024-04-21 18:56:23 +0000 Commit: Zhenlei Huang CommitDate: 2024-05-10 14:09:20 +0000 if_bridge: clean up INET/INET6 handling The if_bridge contains several instances of: if (AF_INET code ... #ifdef INET6 AF_INET6 code ... #endif ) { ... Clean this up by adding a couple of macros at the top of the file that are conditionally defined based on whether INET and/or INET6 are enabled, which makes the code more readable and easier to maintain. No functional change intended. Reviewed by: zlei, markj MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/1191 (cherry picked from commit ef84dd8f4926304306d5989ca9afdbf760c6d813) (cherry picked from commit 2f95e4a01e194428d65572ff3a3c97563120b38a) --- sys/net/if_bridge.c | 65 +++++++++++++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 34 deletions(-) diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index e0fe45e3d326..82526d848f5e 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -141,6 +141,31 @@ extern void nd6_setmtu(struct ifnet *); #endif +/* + * At various points in the code we need to know if we're hooked into the INET + * and/or INET6 pfil. Define some macros to do that based on which IP versions + * are enabled in the kernel. This avoids littering the rest of the code with + * #ifnet INET6 to avoid referencing V_inet6_pfil_head. + */ +#ifdef INET6 +#define PFIL_HOOKED_IN_INET6 PFIL_HOOKED_IN(V_inet6_pfil_head) +#define PFIL_HOOKED_OUT_INET6 PFIL_HOOKED_OUT(V_inet6_pfil_head) +#else +#define PFIL_HOOKED_IN_INET6 false +#define PFIL_HOOKED_OUT_INET6 false +#endif + +#ifdef INET +#define PFIL_HOOKED_IN_INET PFIL_HOOKED_IN(V_inet_pfil_head) +#define PFIL_HOOKED_OUT_INET PFIL_HOOKED_OUT(V_inet_pfil_head) +#else +#define PFIL_HOOKED_IN_INET false +#define PFIL_HOOKED_OUT_INET false +#endif + +#define PFIL_HOOKED_IN_46 (PFIL_HOOKED_IN_INET6 || PFIL_HOOKED_IN_INET) +#define PFIL_HOOKED_OUT_46 (PFIL_HOOKED_OUT_INET6 || PFIL_HOOKED_OUT_INET) + /* * Size of the route hash table. Must be a power of two. */ @@ -2097,11 +2122,7 @@ bridge_dummynet(struct mbuf *m, struct ifnet *ifp) return; } - if (PFIL_HOOKED_OUT(V_inet_pfil_head) -#ifdef INET6 - || PFIL_HOOKED_OUT(V_inet6_pfil_head) -#endif - ) { + if (PFIL_HOOKED_OUT_46) { if (bridge_pfil(&m, sc->sc_ifp, ifp, PFIL_OUT) != 0) return; if (m == NULL) @@ -2385,11 +2406,7 @@ bridge_forward(struct bridge_softc *sc, struct bridge_iflist *sbif, ETHER_BPF_MTAP(ifp, m); /* run the packet filter */ - if (PFIL_HOOKED_IN(V_inet_pfil_head) -#ifdef INET6 - || PFIL_HOOKED_IN(V_inet6_pfil_head) -#endif - ) { + if (PFIL_HOOKED_IN_46) { if (bridge_pfil(&m, ifp, src_if, PFIL_IN) != 0) return; if (m == NULL) @@ -2421,11 +2438,7 @@ bridge_forward(struct bridge_softc *sc, struct bridge_iflist *sbif, dbif->bif_stp.bp_state == BSTP_IFSTATE_DISCARDING) goto drop; - if (PFIL_HOOKED_OUT(V_inet_pfil_head) -#ifdef INET6 - || PFIL_HOOKED_OUT(V_inet6_pfil_head) -#endif - ) { + if (PFIL_HOOKED_OUT_46) { if (bridge_pfil(&m, ifp, dst_if, PFIL_OUT) != 0) return; if (m == NULL) @@ -2551,12 +2564,6 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) #define CARP_CHECK_WE_ARE_SRC(iface) false #endif -#ifdef INET6 -#define PFIL_HOOKED_INET6 PFIL_HOOKED_IN(V_inet6_pfil_head) -#else -#define PFIL_HOOKED_INET6 false -#endif - #define GRAB_OUR_PACKETS(iface) \ if ((iface)->if_type == IFT_GIF) \ continue; \ @@ -2581,8 +2588,7 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) if_inc_counter(bifp, IFCOUNTER_IPACKETS, 1); \ if_inc_counter(bifp, IFCOUNTER_IBYTES, m->m_pkthdr.len); \ /* Filter on the physical interface. */ \ - if (V_pfil_local_phys && (PFIL_HOOKED_IN(V_inet_pfil_head) || \ - PFIL_HOOKED_INET6)) { \ + if (V_pfil_local_phys && PFIL_HOOKED_IN_46) { \ if (bridge_pfil(&m, NULL, ifp, \ PFIL_IN) != 0 || m == NULL) { \ return (NULL); \ @@ -2621,7 +2627,6 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) #undef CARP_CHECK_WE_ARE_DST #undef CARP_CHECK_WE_ARE_SRC -#undef PFIL_HOOKED_INET6 #undef GRAB_OUR_PACKETS /* Perform the bridge forwarding function. */ @@ -2653,11 +2658,7 @@ bridge_broadcast(struct bridge_softc *sc, struct ifnet *src_if, sbif = bridge_lookup_member_if(sc, src_if); /* Filter on the bridge interface before broadcasting */ - if (runfilt && (PFIL_HOOKED_OUT(V_inet_pfil_head) -#ifdef INET6 - || PFIL_HOOKED_OUT(V_inet6_pfil_head) -#endif - )) { + if (runfilt && PFIL_HOOKED_OUT_46) { if (bridge_pfil(&m, sc->sc_ifp, NULL, PFIL_OUT) != 0) return; if (m == NULL) @@ -2700,11 +2701,7 @@ bridge_broadcast(struct bridge_softc *sc, struct ifnet *src_if, * pointer so we do not redundantly filter on the bridge for * each interface we broadcast on. */ - if (runfilt && (PFIL_HOOKED_OUT(V_inet_pfil_head) -#ifdef INET6 - || PFIL_HOOKED_OUT(V_inet6_pfil_head) -#endif - )) { + if (runfilt && PFIL_HOOKED_OUT_46) { if (used == 0) { /* Keep the layer3 header aligned */ i = min(mc->m_pkthdr.len, max_protohdr); From nobody Fri May 10 14:13:01 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VbW7L0GDlz5JWx6; Fri, 10 May 2024 14:13: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 4VbW7K6k76z4h93; Fri, 10 May 2024 14:13:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715350382; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gZOL8BwpNMijHH3atQr3pfAh6yWo3DGJYOZXk/nhzt0=; b=Eyde6KvA8k10pKTY6NjTAo0t11rxYLQYDWRDv5OjJampJRPa7cV2y9fJBOBB7BOVmoHpFi ws0tK6IRDzaiEZ7yhoDTIkZtm6R30IiQscYZgYk4gNpNmhD5h+b0E5eGLiSN40jZ79axqi n25ahXA565l6kuMaLgi2WOyw7kXT8OSTJ1k7+bq//J6cv+Gn+1GMymZX5M63BH+/wmzBXd cU49VrvdbCtFxG+uxuvcWaydajKDje54wa7vwztW5GuRqP7ZRXW9EMRLXbLezdlQepVRiv EtbUp7jDFAoRxBJkQGkIMitX50ewZuKE4hMq4xCuXrgyume5NuVzmy6J/qFHiA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715350381; a=rsa-sha256; cv=none; b=XwnS/ISKLTUhlXzjRpmVZVxD7rq4bplRP2ZoIw/KpojFP0hVByXb6ZL5dy8w8LFrmSUBI+ 2fC7r83JS+/f3G1G2k4jWaUG5O0139Nd4taSrlP3KKsnXitmL3VVBxGq/xo9suwjqLKyLD x9bN8ZBYalOYX8/SiqpDMxmOL2e8M5itkVZ39n0objCYrh/lJLkeghBzarqoGh6t/5LeqX YT7Ktatvamd1w7HqjK9MhUbt/8h3HilD3ej5nEqV3G/kf6oXCtvgISz39PR2vDbqasjAsm DxM277cqBn1Z917Zkl5NZzJAZZbbQRMu0Z09LlptN8mLHOdFDydAZshD8uJoeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715350381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gZOL8BwpNMijHH3atQr3pfAh6yWo3DGJYOZXk/nhzt0=; b=yt77P/6vb0LgHgBd1/H7bKxLqD9gmx99/j2pXrsbGRSpFdP6sjRchM5n5xeG7EzZmdJhM2 aLy6F6pNBPveXn8nUa+/XdMXxvNxLqEDeeQxY+kow7lcECpn+zLX4KglaKpXZFVrcBQDlb mcXiQTWbG2E6T2yUnNgKpUC3gJMFG352KcasV3GuuRa8zXPX1vChvxh69a9GE3gJ3McF3d fTNQmiEskELQRwlfRqPyvvpGjg8QQdbdR1JpQ1VPQroq4bGZBisekwqvFzNTlwe+KEx1/1 69PolzGkRwaF0eNqB+GlM21Adfk1IxSzeoeGk8CA5HNibdBV/CHV8hDUTpvH3g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VbW7K6LF0zgZV; Fri, 10 May 2024 14:13:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44AED1LP069289; Fri, 10 May 2024 14:13:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44AED16F069286; Fri, 10 May 2024 14:13:01 GMT (envelope-from git) Date: Fri, 10 May 2024 14:13:01 GMT Message-Id: <202405101413.44AED16F069286@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: e57876309dbe - stable/13 - sys/net/if_bridge: support non-INET kernels List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e57876309dbe0e1ba9fdacc01b8be444bf997996 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=e57876309dbe0e1ba9fdacc01b8be444bf997996 commit e57876309dbe0e1ba9fdacc01b8be444bf997996 Author: Lexi Winter AuthorDate: 2024-04-23 21:12:57 +0000 Commit: Zhenlei Huang CommitDate: 2024-05-10 14:10:29 +0000 sys/net/if_bridge: support non-INET kernels Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1159 (cherry picked from commit 65767e6126a7e92bc76561b4ffd005cf85ba525e) if_bridge: Minor style fixes And more comments on the #ifdef INET blocks to improve readability. While here, revert the order of two prototypes to produce minimal diff compared to stable branches. (cherry picked from commit 73585176ffd84c13d68cad67c2ca81643f09075c) (cherry picked from commit d45f1f5193420fac7f9a64c0455991a80e7cb89a) --- sys/net/if_bridge.c | 48 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 82526d848f5e..6dea0f046bfb 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -407,12 +407,14 @@ static int bridge_ioctl_sproto(struct bridge_softc *, void *); static int bridge_ioctl_stxhc(struct bridge_softc *, void *); static int bridge_pfil(struct mbuf **, struct ifnet *, struct ifnet *, int); +#ifdef INET static int bridge_ip_checkbasic(struct mbuf **mp); +static int bridge_fragment(struct ifnet *, struct mbuf **mp, + struct ether_header *, int, struct llc *); +#endif /* INET */ #ifdef INET6 static int bridge_ip6_checkbasic(struct mbuf **mp); #endif /* INET6 */ -static int bridge_fragment(struct ifnet *, struct mbuf **mp, - struct ether_header *, int, struct llc *); static void bridge_linkstate(struct ifnet *ifp); static void bridge_linkcheck(struct bridge_softc *sc); @@ -3282,12 +3284,15 @@ bridge_state_change(struct ifnet *ifp, int state) static int bridge_pfil(struct mbuf **mp, struct ifnet *bifp, struct ifnet *ifp, int dir) { - int snap, error, i, hlen; + int snap, error, i; struct ether_header *eh1, eh2; - struct ip *ip; struct llc llc1; u_int16_t ether_type; pfil_return_t rv; +#ifdef INET + struct ip *ip = NULL; + int hlen = 0; +#endif snap = 0; error = -1; /* Default error if not error == 0 */ @@ -3328,31 +3333,36 @@ bridge_pfil(struct mbuf **mp, struct ifnet *bifp, struct ifnet *ifp, int dir) } /* - * If we're trying to filter bridge traffic, don't look at anything - * other than IP and ARP traffic. If the filter doesn't understand - * IPv6, don't allow IPv6 through the bridge either. This is lame - * since if we really wanted, say, an AppleTalk filter, we are hosed, - * but of course we don't have an AppleTalk filter to begin with. - * (Note that since pfil doesn't understand ARP it will pass *ALL* - * ARP traffic.) + * If we're trying to filter bridge traffic, only look at traffic for + * protocols available in the kernel (IPv4 and/or IPv6) to avoid + * passing traffic for an unsupported protocol to the filter. This is + * lame since if we really wanted, say, an AppleTalk filter, we are + * hosed, but of course we don't have an AppleTalk filter to begin + * with. (Note that since pfil doesn't understand ARP it will pass + * *ALL* ARP traffic.) */ switch (ether_type) { +#ifdef INET case ETHERTYPE_ARP: case ETHERTYPE_REVARP: if (V_pfil_ipfw_arp == 0) return (0); /* Automatically pass */ - break; + /* FALLTHROUGH */ case ETHERTYPE_IP: +#endif #ifdef INET6 case ETHERTYPE_IPV6: #endif /* INET6 */ break; + default: /* - * Check to see if the user wants to pass non-ip - * packets, these will not be checked by pfil(9) and - * passed unconditionally so the default is to drop. + * We get here if the packet isn't from a supported + * protocol. Check to see if the user wants to pass + * non-IP packets, these will not be checked by pfil(9) + * and passed unconditionally so the default is to + * drop. */ if (V_pfil_onlyip) goto bad; @@ -3384,9 +3394,11 @@ bridge_pfil(struct mbuf **mp, struct ifnet *bifp, struct ifnet *ifp, int dir) */ if (dir == PFIL_IN) { switch (ether_type) { +#ifdef INET case ETHERTYPE_IP: error = bridge_ip_checkbasic(mp); break; +#endif #ifdef INET6 case ETHERTYPE_IPV6: error = bridge_ip6_checkbasic(mp); @@ -3406,6 +3418,7 @@ bridge_pfil(struct mbuf **mp, struct ifnet *bifp, struct ifnet *ifp, int dir) */ rv = PFIL_PASS; switch (ether_type) { +#ifdef INET case ETHERTYPE_IP: /* * Run pfil on the member interface and the bridge, both can @@ -3460,6 +3473,7 @@ bridge_pfil(struct mbuf **mp, struct ifnet *bifp, struct ifnet *ifp, int dir) ip->ip_sum = in_cksum(*mp, hlen); break; +#endif /* INET */ #ifdef INET6 case ETHERTYPE_IPV6: if (V_pfil_bridge && dir == PFIL_OUT && bifp != NULL && (rv = @@ -3514,6 +3528,7 @@ bad: return (error); } +#ifdef INET /* * Perform basic checks on header size since * pfil assumes ip_input has already processed @@ -3614,6 +3629,7 @@ bad: *mp = m; return (-1); } +#endif /* INET */ #ifdef INET6 /* @@ -3669,6 +3685,7 @@ bad: } #endif /* INET6 */ +#ifdef INET /* * bridge_fragment: * @@ -3745,6 +3762,7 @@ dropit: } return (error); } +#endif /* INET */ static void bridge_linkstate(struct ifnet *ifp) From nobody Fri May 10 14:37:55 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VbWh348xCz5JZXW; Fri, 10 May 2024 14:37: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 4VbWh33hz6z4lM8; Fri, 10 May 2024 14:37:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715351875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R17DQcVusFWuzPWxsCKXVbwJWKNj2AvdwO75fBPyAzE=; b=HcIxoLxmi2ZFG8YH51atwKYTO4BoDr87A6/O8AF+Rfc1jL1wwG7vqRBuJUi+mD6Rv2dbdi PYXRK4J7Krx6ymHslfKUS/VwL7AtKvDs5fSES/zqr9JDI1L0e5bikOBYP+RuLgCWB2Eza/ RW0ZTOhhHVWK4nyEGZz9r+HQ2MulnYgPbQk+2QsvB3c+Jvrhe9RUNDpiOcf/Yis3JE3gLb oe2aJxdlIqfjv0vfVuFPerWbLu7X4aitrQ3nk518S2ZW7nC7273R878iI5Q4xt0zj1Pgh+ yOOawWIx5rs6NGzE4lBaivue60vodpsnHA89jE5OQwSjMeq1s58V1u82Tlqw1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715351875; a=rsa-sha256; cv=none; b=bdo24YAC6kTmC6WI3kxoq9/4ge8n8jvB+N0H1QIYWwbdnVzSgTkZWHNRkcavT+4cCKkQ+m 9P5XUZKJIV3yQIN8P5HOILFYRkz2MG+FGnt7XAqLKilxNRHAFyDVC4w4s2wABIZnkxLbBT oRXjGDRjdZS0bhfUwbcIVG4msMrfCt2ACamSj1wCZVdG1rS+Zho0VgfTwbu4V0g3mFcYyd F/CRcrTOgU/8dZH9IoqjZP5dNujVEiwvOUwBuB0VWI69IlZJlOTbbPoTwwwaiUvy2BVwY+ 6MiXLHeoN3us1muFFY53H/nUojRCdl/dnYguQ1komVaneACcCcw5yQgvNA+JNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715351875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R17DQcVusFWuzPWxsCKXVbwJWKNj2AvdwO75fBPyAzE=; b=vcyMR7NSCppVlqRNAardb9Jeekqpa9SkvxSyXaCdJ5f2IToWsvlGRew7PXdmFYBhqZ5b3G BIqcbuORuip9tgmohBI0ZD8sdByWnKeFMWXO04P1EFLr+U8vKiupXmF3W9Z3dyycd+IU/8 ro06PL+okVeIinyGD9X9k+X/Wpgp6W6uqyw1t7137GZEhkA4Vcf4T3vU7yY7iMwclkiWJM 6A6jkilfBdb7xuByeys5TBdrjmZ5b0fujU9U3GpccU+EHyYRNHHPjuEVoC2K1vpiCnX5bj nsQVH/fMk2I93nljXEDFQKwYEU/AYAuOJX+Nz6ML8KZu9Jq1JKKNi6KhZ70qHg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VbWh33Dz6zhG9; Fri, 10 May 2024 14:37:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44AEbthg004170; Fri, 10 May 2024 14:37:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44AEbtbZ004167; Fri, 10 May 2024 14:37:55 GMT (envelope-from git) Date: Fri, 10 May 2024 14:37:55 GMT Message-Id: <202405101437.44AEbtbZ004167@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mike Karels Subject: git: a5a2e963f9a0 - stable/14 - in6.h: expose s6_addr* definitions to user level List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a5a2e963f9a0a4bc65aa1c70a361243328e23961 Auto-Submitted: auto-generated The branch stable/14 has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=a5a2e963f9a0a4bc65aa1c70a361243328e23961 commit a5a2e963f9a0a4bc65aa1c70a361243328e23961 Author: Mike Karels AuthorDate: 2024-05-02 15:24:37 +0000 Commit: Mike Karels CommitDate: 2024-05-10 14:37:43 +0000 in6.h: expose s6_addr* definitions to user level The only element of of in6_addr that is specified in RFC 3493 or in POSIX.1-2017 is s6_addr, implemented via a #define to a union member. However, FreeBSD and other BSD systems have additional definitions for the other union members, s6_addr{8,16,32} which are defined for the kernel and loader. Some Linux applications also use them, and they seem to be allowed by the RFC and POSIX. Remove the current ifdefs, exposing the additional fields to user level, and replace with #if __BSD_VISIBLE. Add an explanatory comment expanding on the previous "nonstandard" comment. Reviewed by: bz Differential Revision: https://reviews.freebsd.org/D44979 (cherry picked from commit eb3dbf2dbe22ed6d4df54aebbf23f5b555a21cf1) --- sys/netinet6/in6.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/netinet6/in6.h b/sys/netinet6/in6.h index 78c9cd56ed60..ce3bbea6b8e6 100644 --- a/sys/netinet6/in6.h +++ b/sys/netinet6/in6.h @@ -102,7 +102,13 @@ struct in6_addr { }; #define s6_addr __u6_addr.__u6_addr8 -#if defined(_KERNEL) || defined(_STANDALONE) /* XXX nonstandard */ +#if __BSD_VISIBLE +/* + * s6_addr is the only in6_addr element specified in RFCs 2553 and 3493, + * also in POSIX 1003.1-2017. The following three definitions were not + * exposed to user programs in FreeBSD before 14.1, or in other BSDs, + * and are thus less portable than s6_addr. + */ #define s6_addr8 __u6_addr.__u6_addr8 #define s6_addr16 __u6_addr.__u6_addr16 #define s6_addr32 __u6_addr.__u6_addr32 From nobody Fri May 10 16:30:56 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VbZBT01jJz5K1tt; Fri, 10 May 2024 16:30:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VbZBS4sBhz43jv; Fri, 10 May 2024 16:30:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715358656; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bKaIrFnxqEE9SFOrWf0YRMq6JHTALeK0Fms3z2DgBgc=; b=XIHH8tmAiAoGtFt+54WH5lLexfCWrEqzjkdXlyha9dvCuwBemFJxRgssobYXo45vRJJO+R +CdFN1KlVknrM7co1e2XWrQ4YMZMSnvSAhMTBokzcwyEabBog9B6IfM0s/K8L30pobQHAY L8N81clue4WhjAPqKt4WayKc+0lUZS5PlHaJzUNXOfbpwqxR/fygDX4VZbiy4JdutPVCC8 KREX6050myx0YXtEcEt5UiUenS4RDoWhM7/0NzTGgYTIYQe6b6IhTizyVyqqSEiUBFjUYt gYwib14V9e5zwjzFnxf+yndN8jHfoxgrkd00QqDIQ2HcTHwScXvXbMiCLajbxA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715358656; a=rsa-sha256; cv=none; b=lS9KklzVa/GH6b/SGoMEgQyGzhaaY1EK4cGHVMQsyDNYhEmqU3ypv+0z04EmWGEuYxyiX/ guls0orXaKbKHdwjC6lH8eM+p1gm36bcVR48p0oyFlNe3pilA3pzamRbOnZ/tkVwNzyu7e raw93Bfmmkkaw+hay0hQQI3MRnYJacq0F1TJC+ObyKttpA/2e9N85jcxcMtEeHaCQwRNxw P4xd1idmUwoJjSAxQA4B0UuXaPWGCxpGrCzhyzbE8AMLkNJhO7mTA52V8lwxoq/lNZsXpA m0xysW0/O6EWlAdZtrg24Xu0QC/ft/tlGy6CPSsGs9Mh5Ci6a8CQHNXrC8rgqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715358656; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bKaIrFnxqEE9SFOrWf0YRMq6JHTALeK0Fms3z2DgBgc=; b=hjQjxG5v3VUFeN7iZK4pu3/LNNm2w6UCgQqQvxQDiwru+jLHotH/p5+LfQ3r+zR+OrFNem 0neDCowuLeRUMlRk7rR2T1twaDPAtxuBInbzRc1JRGvdlJ/YYQPcL3YEeOIl3N6CO2nUnp xWP8ZJdhgJ3k4FqFAz4SY8JCZ8gmpRPDINcs+Jm6pl2YLNuIxjaWkHcdqYhygu/YP/Kog6 lVArOy/Rska9i9BsWlhxgVAPdQW8FnPCvux9FZKV3ZSup7KBqeuVb7bPdnBUm7EdPUEAGE nsnCzo5hPsI2xtktQodQzQw3xdCKpeIMrx6MxekzEmiMElIf0sZtQU6aR98epA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VbZBS4T11zkym; Fri, 10 May 2024 16:30:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44AGUuOu001850; Fri, 10 May 2024 16:30:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44AGUuO6001846; Fri, 10 May 2024 16:30:56 GMT (envelope-from git) Date: Fri, 10 May 2024 16:30:56 GMT Message-Id: <202405101630.44AGUuO6001846@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: ff99bfe3ef73 - stable/13 - inet6: protect address manipulation with a lock List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ff99bfe3ef739a026e0cf554295774c8bf02d326 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=ff99bfe3ef739a026e0cf554295774c8bf02d326 commit ff99bfe3ef739a026e0cf554295774c8bf02d326 Author: Mateusz Guzik AuthorDate: 2023-03-29 12:46:41 +0000 Commit: Zhenlei Huang CommitDate: 2024-05-10 16:27:07 +0000 inet6: protect address manipulation with a lock This is a total hack/bare minimum which follows inet4. Otherwise 2 threads removing the same address can easily crash. Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D39317 (cherry picked from commit f5a365e51feea75d1e5ebc86c53808d8cae7b6d7) --- sys/netinet6/in6.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index 946a49030920..acf04e1e56bb 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -163,6 +163,9 @@ static int in6_broadcast_ifa(struct ifnet *, struct in6_aliasreq *, #define ifa2ia6(ifa) ((struct in6_ifaddr *)(ifa)) #define ia62ifa(ia6) (&((ia6)->ia_ifa)) +static struct sx in6_control_sx; +SX_SYSINIT(in6_control_sx, &in6_control_sx, "in6_control"); + void in6_newaddrmsg(struct in6_ifaddr *ia, int cmd) { @@ -251,6 +254,7 @@ in6_control(struct socket *so, u_long cmd, caddr_t data, int carp_attached = 0; int error; u_long ocmd = cmd; + bool control_locked = false; /* * Compat to make pre-10.x ifconfig(8) operable. @@ -406,6 +410,8 @@ in6_control(struct socket *so, u_long cmd, caddr_t data, if (td != NULL && (error = prison_check_ip6(td->td_ucred, &sa6->sin6_addr)) != 0) return (error); + sx_xlock(&in6_control_sx); + control_locked = true; ia = in6ifa_ifpwithaddr(ifp, &sa6->sin6_addr); } else ia = NULL; @@ -710,6 +716,9 @@ aifaddr_out: error = 0; out: + if (control_locked) + sx_xunlock(&in6_control_sx); + if (ia != NULL) ifa_free(&ia->ia_ifa); return (error); From nobody Sat May 11 01:06:07 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vbncv6B9Cz5KmbT; Sat, 11 May 2024 01:06: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 4Vbncv4B2bz51xS; Sat, 11 May 2024 01:06:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715389567; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=03FniIfbVFhDmVqIT9QRd1z+tyGMVbURcy143P3RDl4=; b=oAP1CcZ3M8dErU9L4o0t+6F26sK2vPzGJ/qZFjiQKiMQr0snhxXHIkW8SkduAQv8wItD3Y YpiZu11QMxQGY9hwf9fYZmSvC9vBSkHe4MKmWXxJgTdn3lClVY6/XLRMNfC/gCbK9QmWaT DUpgpKqtlYcthMYI2rs62sKPfOfxByFrDow2eCSFaqaD67Opt/9+tRmettk38bKEbIpOEv ScmKPTF7ClesAJMRPF0V/Q5rGeGVauKXpiCdyJz0w9Aai2BuZ0FO+lJwvr7T/web0Dy1yM ODP7EL45VNut4JRT4sWrvQPBhctxYj15Xl9a2PuQaGaay52yOyRGJ8AsGpnTgg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715389567; a=rsa-sha256; cv=none; b=Ke3EX7OxmP0VKFkGxMuF1Yy4QCrOJfjlO3StZfTp4zc/SIQH6lc8C+L7frjf7yOMYWPefn SbYrFj1wOoMudOKz0XvS9hfqF6Ytt77eicIiTuDRQWUlDxuJSGkRZjcn/QXwOPOLuJ8th+ nNP1pBXTWWSfLLURH8YDu4BqqiAo9w/K6tFUP06VUaPWBWvYTOiD9jhmhy4JL+Yo1NlsDl QkkJ9C/IYeDe2ndZWsdG9DApNE5R/I0hQlohppITVspzT/00peptO5P4aTDrlhNCiDLEol MHNCTJak8+kENm33Ko9QFN+YXKqrxWGuSndqRNHfX4y0dRGidx/bYWGeymMD8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715389567; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=03FniIfbVFhDmVqIT9QRd1z+tyGMVbURcy143P3RDl4=; b=DdBk7DTseBGPlCqpq1TeTjHBbKbR7jVeCsX7dcD028DSBMDQ46eBJYAyyJ27iVWEvx+y0x cxpnoOVJKq4crNT8GTWtR5MVgTkSYrGDEYThWwTk6atyGelUcGCW87CVwMYBp67Y47uv85 QXEdxuzahSmWQeLKLu5WaJSEPG0x9h1Gk6coPeW2jfZAI1WST2vImT1FSec0/59WHZv41R hVa/GAyAddcjDK6Oc1MEq8KUaEM2FXuMX8GN2m4OGpbqMZN8irZVnLoEPCd/qLRiJYKn33 32kBZvi6XcxUDpZ/oYc5wTEZhmiD4qk4TgPbhSjDBqBvTA+NPzg8Q+v3VmZw5w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vbncv3gcNz10VQ; Sat, 11 May 2024 01:06:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44B1670i070919; Sat, 11 May 2024 01:06:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44B167Ak070916; Sat, 11 May 2024 01:06:07 GMT (envelope-from git) Date: Sat, 11 May 2024 01:06:07 GMT Message-Id: <202405110106.44B167Ak070916@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 3c414a8c2fb3 - stable/14 - nfsd: Fix Link conformance with RFC8881 for delegations List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3c414a8c2fb37ca37de454aaa145e7bcaefcaa05 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=3c414a8c2fb37ca37de454aaa145e7bcaefcaa05 commit 3c414a8c2fb37ca37de454aaa145e7bcaefcaa05 Author: Rick Macklem AuthorDate: 2024-05-04 21:30:07 +0000 Commit: Rick Macklem CommitDate: 2024-05-11 01:04:40 +0000 nfsd: Fix Link conformance with RFC8881 for delegations RFC8881 specifies that, when a Link operation occurs on an NFSv4, that file delegations issued to other clients must be recalled. Discovered during a recent discussion on nfsv4@ietf.org. Although I have not observed a problem caused by not doing the required delegation recall, it is definitely required by the RFC, so this patch makes the server do the recall. Tested during a recent NFSv4 IETF Bakeathon event. (cherry picked from commit 3f65000b6b1460a7a23cd83014bb41a68d1a8a19) --- sys/fs/nfs/nfs_var.h | 2 +- sys/fs/nfsserver/nfs_nfsdport.c | 12 +++++++----- sys/fs/nfsserver/nfs_nfsdserv.c | 11 +++++++++-- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 578fb3ce1340..950e0c097457 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -713,7 +713,7 @@ int nfsvno_rmdirsub(struct nameidata *, int, struct ucred *, NFSPROC_T *, struct nfsexstuff *); int nfsvno_rename(struct nameidata *, struct nameidata *, u_int32_t, u_int32_t, struct ucred *, NFSPROC_T *); -int nfsvno_link(struct nameidata *, vnode_t, struct ucred *, +int nfsvno_link(struct nameidata *, vnode_t, nfsquad_t, struct ucred *, NFSPROC_T *, struct nfsexstuff *); int nfsvno_fsync(vnode_t, u_int64_t, int, struct ucred *, NFSPROC_T *); int nfsvno_statfs(vnode_t, struct statfs *); diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index f8c2ddfd2a59..f4679309657b 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -1656,8 +1656,8 @@ out1: * Link vnode op. */ int -nfsvno_link(struct nameidata *ndp, struct vnode *vp, struct ucred *cred, - struct thread *p, struct nfsexstuff *exp) +nfsvno_link(struct nameidata *ndp, struct vnode *vp, nfsquad_t clientid, + struct ucred *cred, struct thread *p, struct nfsexstuff *exp) { struct vnode *xp; int error = 0; @@ -1672,9 +1672,11 @@ nfsvno_link(struct nameidata *ndp, struct vnode *vp, struct ucred *cred, } if (!error) { NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); - if (!VN_IS_DOOMED(vp)) - error = VOP_LINK(ndp->ni_dvp, vp, &ndp->ni_cnd); - else + if (!VN_IS_DOOMED(vp)) { + error = nfsrv_checkremove(vp, 0, NULL, clientid, p); + if (error == 0) + error = VOP_LINK(ndp->ni_dvp, vp, &ndp->ni_cnd); + } else error = EPERM; if (ndp->ni_dvp == vp) { vrele(ndp->ni_dvp); diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index 8141ee6cbdb6..0c8bda6dc6a6 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -1797,6 +1797,7 @@ nfsrvd_link(struct nfsrv_descript *nd, int isdgram, char *bufp; u_long *hashp; struct thread *p = curthread; + nfsquad_t clientid; if (nd->nd_repstat) { nfsrv_postopattr(nd, getret, &at); @@ -1858,8 +1859,14 @@ nfsrvd_link(struct nfsrv_descript *nd, int isdgram, NULL); } } - if (!nd->nd_repstat) - nd->nd_repstat = nfsvno_link(&named, vp, nd->nd_cred, p, exp); + if (!nd->nd_repstat) { + clientid.qval = 0; + if ((nd->nd_flag & (ND_IMPLIEDCLID | ND_NFSV41)) == + (ND_IMPLIEDCLID | ND_NFSV41)) + clientid.qval = nd->nd_clientid.qval; + nd->nd_repstat = nfsvno_link(&named, vp, clientid, nd->nd_cred, + p, exp); + } if (nd->nd_flag & ND_NFSV3) getret = nfsvno_getattr(vp, &at, nd, p, 0, NULL); if (dirp) { From nobody Sat May 11 01:10:39 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vbnk7632gz5Kmrf; Sat, 11 May 2024 01:10: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 4Vbnk74jsbz52Td; Sat, 11 May 2024 01:10:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715389839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5t55/PRXAr/8zihj5HFdpyEMU+SomQOgyW1+Xq7Ihgk=; b=VteHO5lgH0U35yQPcbL2keFDZyQyGii+H6PcJtU7bqmQU5LX98QqX0wTVY9Oi2G5gzDNFv lujTmDyURDlo2/YlTn8toyXrramoH06XwHSmFa2Dfz0de16B9f+vGvp+1Hrqh6dRwW3/MD xNb13r8axwie3evoyLfCrwaIs8Tp6MYzOw7p1raJt59bkEf1GyQdztI8xzByY/Y3HDRpFy 5243iDy0yZ9JGAskuaXmZOVlznquyWYAszNkrQL0kxG42oWXKu4F24OqWza5/4/mgwZy+a S5deeKyMVTUv8VwB27ju2eY6Y4apcS1ZoMwTiEdomdIGwK9KoYhE87HFir5YMQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715389839; a=rsa-sha256; cv=none; b=hvZskQ24t0rAuwyOH9UkHrt4GCvhHOd7WuZP9yhBzEoEGuo1IHI48rndUtjtZzCm8240pp 3uzGWGT7dS1DSxG7saJ+1o040RPtT3tQQObxf0uXnoS8Sp5L+vtehWBeNqhLlazmdhHUwY JXyiDvHm1FXTOPOzouVOsJ/f3sDytuooCD2+o3WkjJ+nUoVKJa4qyhw/Yjgd683dhd+Otq i+jzxA5RMVV1WIjXrKQzF4qSj24jLoabhvgpJ+qJ4WaRQmoy4LUKG/wRad1rT9az0Z5VxS vYN9qSOkZH2f/imkiMtqNvoh9ThcfxZnyFRmIAoWhg/rMS3YkRW9GrG0la5oTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715389839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5t55/PRXAr/8zihj5HFdpyEMU+SomQOgyW1+Xq7Ihgk=; b=XyuFa2dAHsEe6kxxhLi4jr4sSwF0IvpwyMf/W6OFoH5sm8pXhcc3LB9E31xzPDYF309CWt Tw7e4jysHmhD8SQ+TA10lo4650uGMvr25E0Eq9IyAI+lg1v5U4CSr5Z1oyl87AmqcbFAGK PzkIDlYuvX1ycF2WtCJXMWi8l/N/PKr6Xq4xUPuoY8mL2GtAhODyUfRGSZbuFcZcIGiFEM 8vJowLFCujC/mwmMDmiNA1/sPuNKQzskXDUaOngLBIpEN4nTcB6gE4VLnzrpw1LXlvDF+S HUUgWAaza33eQZrChZtaFGvynsdIqBRRSCJLxYlrQNh2Hegc9qSX5ZTXCrH8Eg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vbnk74KF0z10w8; Sat, 11 May 2024 01:10:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44B1Ad76080066; Sat, 11 May 2024 01:10:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44B1AdEr080063; Sat, 11 May 2024 01:10:39 GMT (envelope-from git) Date: Sat, 11 May 2024 01:10:39 GMT Message-Id: <202405110110.44B1AdEr080063@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 85e63d952d5d - stable/13 - nfsd: Fix Link conformance with RFC8881 for delegations List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 85e63d952d5daf929c24874a3b309e1b2e04bebf Auto-Submitted: auto-generated The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=85e63d952d5daf929c24874a3b309e1b2e04bebf commit 85e63d952d5daf929c24874a3b309e1b2e04bebf Author: Rick Macklem AuthorDate: 2024-05-04 21:30:07 +0000 Commit: Rick Macklem CommitDate: 2024-05-11 01:09:21 +0000 nfsd: Fix Link conformance with RFC8881 for delegations RFC8881 specifies that, when a Link operation occurs on an NFSv4, that file delegations issued to other clients must be recalled. Discovered during a recent discussion on nfsv4@ietf.org. Although I have not observed a problem caused by not doing the required delegation recall, it is definitely required by the RFC, so this patch makes the server do the recall. Tested during a recent NFSv4 IETF Bakeathon event. (cherry picked from commit 3f65000b6b1460a7a23cd83014bb41a68d1a8a19) --- sys/fs/nfs/nfs_var.h | 2 +- sys/fs/nfsserver/nfs_nfsdport.c | 12 +++++++----- sys/fs/nfsserver/nfs_nfsdserv.c | 11 +++++++++-- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 8cdc08fba433..083a974516b0 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -707,7 +707,7 @@ int nfsvno_rmdirsub(struct nameidata *, int, struct ucred *, NFSPROC_T *, struct nfsexstuff *); int nfsvno_rename(struct nameidata *, struct nameidata *, u_int32_t, u_int32_t, struct ucred *, NFSPROC_T *); -int nfsvno_link(struct nameidata *, vnode_t, struct ucred *, +int nfsvno_link(struct nameidata *, vnode_t, nfsquad_t, struct ucred *, NFSPROC_T *, struct nfsexstuff *); int nfsvno_fsync(vnode_t, u_int64_t, int, struct ucred *, NFSPROC_T *); int nfsvno_statfs(vnode_t, struct statfs *); diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index ebc560836205..46be3e051056 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -1675,8 +1675,8 @@ out1: * Link vnode op. */ int -nfsvno_link(struct nameidata *ndp, struct vnode *vp, struct ucred *cred, - struct thread *p, struct nfsexstuff *exp) +nfsvno_link(struct nameidata *ndp, struct vnode *vp, nfsquad_t clientid, + struct ucred *cred, struct thread *p, struct nfsexstuff *exp) { struct vnode *xp; int error = 0; @@ -1691,9 +1691,11 @@ nfsvno_link(struct nameidata *ndp, struct vnode *vp, struct ucred *cred, } if (!error) { NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); - if (!VN_IS_DOOMED(vp)) - error = VOP_LINK(ndp->ni_dvp, vp, &ndp->ni_cnd); - else + if (!VN_IS_DOOMED(vp)) { + error = nfsrv_checkremove(vp, 0, NULL, clientid, p); + if (error == 0) + error = VOP_LINK(ndp->ni_dvp, vp, &ndp->ni_cnd); + } else error = EPERM; if (ndp->ni_dvp == vp) { vrele(ndp->ni_dvp); diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index 437f4b1c685d..ccaeb4153253 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -1799,6 +1799,7 @@ nfsrvd_link(struct nfsrv_descript *nd, int isdgram, char *bufp; u_long *hashp; struct thread *p = curthread; + nfsquad_t clientid; if (nd->nd_repstat) { nfsrv_postopattr(nd, getret, &at); @@ -1861,8 +1862,14 @@ nfsrvd_link(struct nfsrv_descript *nd, int isdgram, NULL); } } - if (!nd->nd_repstat) - nd->nd_repstat = nfsvno_link(&named, vp, nd->nd_cred, p, exp); + if (!nd->nd_repstat) { + clientid.qval = 0; + if ((nd->nd_flag & (ND_IMPLIEDCLID | ND_NFSV41)) == + (ND_IMPLIEDCLID | ND_NFSV41)) + clientid.qval = nd->nd_clientid.qval; + nd->nd_repstat = nfsvno_link(&named, vp, clientid, nd->nd_cred, + p, exp); + } if (nd->nd_flag & ND_NFSV3) getret = nfsvno_getattr(vp, &at, nd, p, 0, NULL); if (dirp) { From nobody Sat May 11 08:56:49 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vc0415ZXHz5JRtS; Sat, 11 May 2024 08:56:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vc0414vyYz4NGQ; Sat, 11 May 2024 08:56:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715417809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LmkHb8InUIBFplwoqTGrgbbg1TN3u3DmKEY+ThVc7gg=; b=QNax3MnsViAimthwP0lnWn1EDUUl7i6TqQ+pys7unNv+yhlovaEC+IErIu7L8pdbo142aW IyabSUsSQ6hTQ81R4MaxdsydNWPZRUBbsAyRHBXdA/w9DDmjJku+gbpUjUoYG0ZnYs9MiE Fn0uzA15JT3gUqie35LnieZngtR0q91UMWGCUSd6KBnCdxbhHVPBBEYe0ZlH/FqskjvsPv yWwIFD1hBBDwctK/bnKtK1oEoBS+7hQziOUy2+40bhDBohiwnLa6oY0jkiqMK5ZiywiOR2 uZBgHuIk0ntPA6yh9SzIwP8ZGVmIREWzI+olmaNDkOfcptPpg4UKic1CauuqUg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715417809; a=rsa-sha256; cv=none; b=egI6U6ljrv7qncBsKwPJtGKlsrT6/eip/UwKrEOBQXY5NlCQ9ytNAfRQ4iwkvnfzjG9DAc 1MMvqCIcsCrVPrMYEhhsc2PHJa/Srs4EGLINonafipKQlLS06K+v6zFu98OaDEf0ufl5Vz B9ggPjkOd0tLlYgtlewEfbt4liZI0p1IjKvR2T9UaoTRXLJLG6vJE8uGu6P062PYAYlObl r9TXmNAluWQEbTaR1jOQ50dFXATejNMXBsGF0MPy9qOvAR/PScERrxKEjEgPWpsFLNg2Jb 1w3ze4jTIcSTrM2KLCkyQ+6VR0w8sNmgo1Ix5+b0KReKhkIGzA6C9CLS40yaSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715417809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LmkHb8InUIBFplwoqTGrgbbg1TN3u3DmKEY+ThVc7gg=; b=BKEYaCUU6eWnAOiu5aw1hfeXSDfBD9C9PlZtYwkFtK+g+8JBLYHk/A7VHJ6U0SPD0vxv8B rzv+DuX0gDR4cg/T8jDb8LfijM1QAv5OBVYVH5dNw+B24ReJx7K7fCbV4NY2Pq6Wr84npE DvgtJGY67AGt9KWtVrI6DT2LXFhSZVtfYpEdFK8Kak6rFIxv+tQASsgKb5KmQhNwO+Umlv TbSaZ2x6KMnKZQbZ1Y4Ufl2284qX7oHECKjP2uUldfE3KJgY3q/m5mQd5+n2HqMoW7wU61 RYxV81Z1JF6Z6N9QTibWp8RDeddvWzaPTFGl026xyjMJC4Ne9gFws7ctlo5SgQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vc0414CTDzDsM; Sat, 11 May 2024 08:56:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44B8unAh063658; Sat, 11 May 2024 08:56:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44B8unj0063655; Sat, 11 May 2024 08:56:49 GMT (envelope-from git) Date: Sat, 11 May 2024 08:56:49 GMT Message-Id: <202405110856.44B8unj0063655@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 426e07d79164 - stable/14 - Merge commit 5300a6731e98 from llvm-project (by Jonathan Peyton): List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 426e07d791641e80e90af89d52008635a35e4794 Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=426e07d791641e80e90af89d52008635a35e4794 commit 426e07d791641e80e90af89d52008635a35e4794 Author: Dimitry Andric AuthorDate: 2024-05-08 16:55:08 +0000 Commit: Dimitry Andric CommitDate: 2024-05-11 08:56:22 +0000 Merge commit 5300a6731e98 from llvm-project (by Jonathan Peyton): [OpenMP] Fix re-locking hang found in issue 86684 (#88539) This was initially reported here (including stacktraces): https://stackoverflow.com/questions/78183545/does-compiling-imagick-with-openmp-enabled-in-freebsd-13-2-cause-sched-yield If `__kmp_register_library_startup()` detects that another instance of the library is present, `__kmp_is_address_mapped()` is eventually called. which uses `kmpc_alloc()` to allocate memory. This function calls `__kmp_entry_thread()` to access the thread-local memory pool, which is a bad idea during initialization. This macro internally calls `__kmp_get_global_thread_id_reg()` which sets the bootstrap lock at the beginning (before calling `__kmp_register_library_startup()`). The fix is to use `KMP_INTERNAL_MALLOC()`/`KMP_INTERNAL_FREE()` instead of `kmpc_malloc()`/`kmpc_free()`. `KMP_INTERNAL_MALLOC` and `KMP_INTERNAL_FREE` do not use any bootstrap locks. They just translate to `malloc()`/`free()` and are meant to be used during library initialization before other library-specific allocators have been initialized. Fixes: #86684 This should fix OpenMP processes sometimes getting locked with 100% CPU usage, endlessly calling sched_yield(2). PR: 278845 Reported by: Cassidy B. Larson MFC after: 3 days (cherry picked from commit da15ed2e982180198f77a0fa26628e6d414cb10e) --- contrib/llvm-project/openmp/runtime/src/z_Linux_util.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/llvm-project/openmp/runtime/src/z_Linux_util.cpp b/contrib/llvm-project/openmp/runtime/src/z_Linux_util.cpp index b9ff96873702..97ddb8a608b7 100644 --- a/contrib/llvm-project/openmp/runtime/src/z_Linux_util.cpp +++ b/contrib/llvm-project/openmp/runtime/src/z_Linux_util.cpp @@ -2129,10 +2129,10 @@ int __kmp_is_address_mapped(void *addr) { // We pass from number of vm entry's semantic // to size of whole entry map list. lstsz = lstsz * 4 / 3; - buf = reinterpret_cast(kmpc_malloc(lstsz)); + buf = reinterpret_cast(KMP_INTERNAL_MALLOC(lstsz)); rc = sysctl(mib, 4, buf, &lstsz, NULL, 0); if (rc < 0) { - kmpc_free(buf); + KMP_INTERNAL_FREE(buf); return 0; } @@ -2156,7 +2156,7 @@ int __kmp_is_address_mapped(void *addr) { } lw += cursz; } - kmpc_free(buf); + KMP_INTERNAL_FREE(buf); #elif KMP_OS_DARWIN From nobody Sat May 11 08:57:03 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vc04H5PFsz5JSBP; Sat, 11 May 2024 08:57: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 4Vc04H4y7sz4NvX; Sat, 11 May 2024 08:57:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715417823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rEJ7vmSc7aceRCbL9cfv0gk4Uv+Wk4Zuxw8bRs+3seI=; b=v0EzloGsadGBiXUFDrlnerLjOnkxLr3QzEECF4B8CKTLwGsD9PRiZ+d3NsperCYxLhjm2G kqcryuoiafDCVkhW2eyKZ2sponmZOcJvanBe+g/uDcn+b4fkHTNB8huvdODqTqavtZb+0q vDCccKwKMbC6mjd1BAI87Um+JoxAg1VrD2s95MIPbstQ/0a+b508UfzyiEZTxh1ULtJZAb cimbq+LHD8YLYCU0kANKH/x/XrcgwZUmJRAmQgL3C2Rj6yD3SYYTbV01FY3Dx86LSUB6gH y3/hD5V+939wPQ/8Nopy+pT6wpAqxXqC4lXgTbMutS1kFxmcj0iq2InjoNuxqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715417823; a=rsa-sha256; cv=none; b=mgitK5nK4G8mw38YBioo+y0jAtra+4EldVJOeX+xvkUo52B/4gtQkFgx+Euk1WsZqYCcBN uoa9sTUxuvsg5Wz7XglfwSUUqbq75as/BnJVmfm5EbelwHjBymJiMwzLO0HIY5U9ibvkmu 5eqV8pbaEPCpLiflBaOF1gaBbPQ19qbLr+4rkcWvI12qRp3rVo6diPDZwb9EqtJsaeQu04 D7B6T1fG+6buRQ1FUL7Yk7FNdhSlcFuNDEXJZ0xJ0clC2/n0YgQqu9S460PTHcF/k/dpvI 5snTvmrogkIKL0OtDq4WqoVHg+dTYS148Z6Humw3VLkdkmb7/jkOHurxPsyOyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715417823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rEJ7vmSc7aceRCbL9cfv0gk4Uv+Wk4Zuxw8bRs+3seI=; b=eOk53McrXeHWB4YLH80wskPjQd1CF2pRhSi045XVl1aLYCxko6nA/zhcRW/7YeQRBkkvBx h1D6kWmg50+U/5NZtQhrP6QXdavxprNsy7pcwjt88XUi+hamdXSKla2+CPUWacPO8yOO2D JW1gowPOO5OPZJRD5b9ZUViALPYqa5WRfF91Le7y9tOhFn4eoho35cV+2lSjfkmF7VbRyH fBmzfn3Sw19m7rYC9RH270+VtYcYSRU6AMdZhODihs+GyOE44/R42B4bTRNZTUhx+2IIpX n2VvplRwbFj8LxW1jp4ojWIAh/lDe75WPawXd3r1Jcpb9kw1HTMAf7fpjwKRKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vc04H4TLNzFT7; Sat, 11 May 2024 08:57:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44B8v3Me063911; Sat, 11 May 2024 08:57:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44B8v3Jt063908; Sat, 11 May 2024 08:57:03 GMT (envelope-from git) Date: Sat, 11 May 2024 08:57:03 GMT Message-Id: <202405110857.44B8v3Jt063908@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 7b966dcc3ac5 - stable/13 - Merge commit 5300a6731e98 from llvm-project (by Jonathan Peyton): List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7b966dcc3ac5e413c668da4a6d567f9478321806 Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=7b966dcc3ac5e413c668da4a6d567f9478321806 commit 7b966dcc3ac5e413c668da4a6d567f9478321806 Author: Dimitry Andric AuthorDate: 2024-05-08 16:55:08 +0000 Commit: Dimitry Andric CommitDate: 2024-05-11 08:56:33 +0000 Merge commit 5300a6731e98 from llvm-project (by Jonathan Peyton): [OpenMP] Fix re-locking hang found in issue 86684 (#88539) This was initially reported here (including stacktraces): https://stackoverflow.com/questions/78183545/does-compiling-imagick-with-openmp-enabled-in-freebsd-13-2-cause-sched-yield If `__kmp_register_library_startup()` detects that another instance of the library is present, `__kmp_is_address_mapped()` is eventually called. which uses `kmpc_alloc()` to allocate memory. This function calls `__kmp_entry_thread()` to access the thread-local memory pool, which is a bad idea during initialization. This macro internally calls `__kmp_get_global_thread_id_reg()` which sets the bootstrap lock at the beginning (before calling `__kmp_register_library_startup()`). The fix is to use `KMP_INTERNAL_MALLOC()`/`KMP_INTERNAL_FREE()` instead of `kmpc_malloc()`/`kmpc_free()`. `KMP_INTERNAL_MALLOC` and `KMP_INTERNAL_FREE` do not use any bootstrap locks. They just translate to `malloc()`/`free()` and are meant to be used during library initialization before other library-specific allocators have been initialized. Fixes: #86684 This should fix OpenMP processes sometimes getting locked with 100% CPU usage, endlessly calling sched_yield(2). PR: 278845 Reported by: Cassidy B. Larson MFC after: 3 days (cherry picked from commit da15ed2e982180198f77a0fa26628e6d414cb10e) --- contrib/llvm-project/openmp/runtime/src/z_Linux_util.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/llvm-project/openmp/runtime/src/z_Linux_util.cpp b/contrib/llvm-project/openmp/runtime/src/z_Linux_util.cpp index b9ff96873702..97ddb8a608b7 100644 --- a/contrib/llvm-project/openmp/runtime/src/z_Linux_util.cpp +++ b/contrib/llvm-project/openmp/runtime/src/z_Linux_util.cpp @@ -2129,10 +2129,10 @@ int __kmp_is_address_mapped(void *addr) { // We pass from number of vm entry's semantic // to size of whole entry map list. lstsz = lstsz * 4 / 3; - buf = reinterpret_cast(kmpc_malloc(lstsz)); + buf = reinterpret_cast(KMP_INTERNAL_MALLOC(lstsz)); rc = sysctl(mib, 4, buf, &lstsz, NULL, 0); if (rc < 0) { - kmpc_free(buf); + KMP_INTERNAL_FREE(buf); return 0; } @@ -2156,7 +2156,7 @@ int __kmp_is_address_mapped(void *addr) { } lw += cursz; } - kmpc_free(buf); + KMP_INTERNAL_FREE(buf); #elif KMP_OS_DARWIN From nobody Sat May 11 08:57:04 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vc04K0PCXz5JSPf; Sat, 11 May 2024 08:57: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 4Vc04J5yftz4Npx; Sat, 11 May 2024 08:57:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715417824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UKo96w/TbdVENlak1foYQ7MASbM2VDEVjWtlsSmRt4k=; b=hFh40BYVCCqW6MsyunZyxbPuBi6KVC9O/np/WoEKHRL+k+aUOrLM3QE61Ra5VmWpIJxD2O x3CBQ5xP4bAvURXF9Zyq4NlfxeiDQ6TUlT9GV/6F7hiugvq3QZvB60bS9EXjaOw4oFEkaE E/MwMZ36Ex5++ZUY5TY2EAaUDF3EzGi3Sy9YzWejZ2J6Py7Kd5lWVSGV78DHppqZnUP3CK kEgeT5bbOLXJkUhonk5BKcmuATifFscipfN1+ehsvW4A2MiJ5DW9hmFdaownho4f3IMcGu QYHOa5OSXyDOSRLmoreL5bJlFthMFlvJ/n1lonEVsNiA60TEfiWmGnxp0WyTkg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715417824; a=rsa-sha256; cv=none; b=FAzYlWlJKMfPiq78vSFnyYNHNziwg85r7Yy8JNfFfbFUoDqvji0Ena0Nqn7zxfgnh2xw0n L/Ml4LVzjuchriin2bVKx14fQoA3uc5C9kYkP7o7ZscdvX2GEL7FBqFcFtk3ShIbZsmipW rk+IU/y9zu/KfvvBmRaPCKEE2eLOGiWkl8mGlDs/mtYg/RWaIfMdYrvP3IWmw2EDIhQXnX rKKRp1ntOKaAhN7XEp5CwSZFnH/oTFlObeMM45qdPv2ALhQtYqkxxe5oqrC/NbMKMMvdG2 OizSYUsMhBFG+ecC0XBBmqzEod6j8UiXM1iwbjMqXKODZAG39abxjSxNsJR3Ww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715417824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UKo96w/TbdVENlak1foYQ7MASbM2VDEVjWtlsSmRt4k=; b=Mn+mCHyB+xxOpWCyhU1muQpn/Il8KSM/Ghpkre8wjIw9jdfiaoudi8mFxZnvRBKgSxisoK l9apI5d5/7XN4pgCvFFd633a8x9naIgjUuFtMMR3RUvSrSeawaUHsJ93OVMVIh0YPMkMJq 5ExrRagsenfpnqR0vMjjvve2WgLZNaJLu6s9VLOURKraxHOUmrSJ9+vw+Y5lAKg2WVizSe QmUV2QhZ6LNgBKCSaEbSYLVno9TtbN+NFoHOUpipinapLcty9lmBaAYyugUiwCWDaSOZTn vA7yvEqcbkUd6aJIiUaD+12/syh8rGyYU2tP8SSPuqoI9srmqFq2yDOUJghHLg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vc04J5W3MzFT8; Sat, 11 May 2024 08:57:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44B8v4wF063962; Sat, 11 May 2024 08:57:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44B8v4vw063959; Sat, 11 May 2024 08:57:04 GMT (envelope-from git) Date: Sat, 11 May 2024 08:57:04 GMT Message-Id: <202405110857.44B8v4vw063959@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: e2de08bf70f4 - stable/13 - Merge commit 73bb8d9d92f6 from llvm-project (by Jonathan Peyton): List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e2de08bf70f4343ebcb455dedf1b77ac0d67f5ca Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=e2de08bf70f4343ebcb455dedf1b77ac0d67f5ca commit e2de08bf70f4343ebcb455dedf1b77ac0d67f5ca Author: Dimitry Andric AuthorDate: 2024-05-08 18:44:28 +0000 Commit: Dimitry Andric CommitDate: 2024-05-11 08:56:35 +0000 Merge commit 73bb8d9d92f6 from llvm-project (by Jonathan Peyton): [OpenMP] Fix child processes to use affinity_none (#91391) When a child process is forked with OpenMP already initialized, the child process resets its affinity mask and sets proc-bind-var to false so that the entire original affinity mask is used. This patch corrects an issue with the affinity initialization code setting affinity to compact instead of none for this special case of forked children. The test trying to catch this only testing explicit setting of KMP_AFFINITY=none. Add test run for no KMP_AFFINITY setting. Fixes: #91098 This should fix OpenMP processes sometimes getting stuck on a single CPU core. PR: 278845 Reported by: Cassidy B. Larson MFC after: 3 days (cherry picked from commit 22b3e7898ecdf90887a9536fab5b9a6f7a291723) --- contrib/llvm-project/openmp/runtime/src/kmp_settings.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/llvm-project/openmp/runtime/src/kmp_settings.cpp b/contrib/llvm-project/openmp/runtime/src/kmp_settings.cpp index ec86ee07472c..58f19ea5b8ab 100644 --- a/contrib/llvm-project/openmp/runtime/src/kmp_settings.cpp +++ b/contrib/llvm-project/openmp/runtime/src/kmp_settings.cpp @@ -6426,6 +6426,8 @@ void __kmp_env_initialize(char const *string) { } if ((__kmp_nested_proc_bind.bind_types[0] != proc_bind_intel) && (__kmp_nested_proc_bind.bind_types[0] != proc_bind_default)) { + if (__kmp_nested_proc_bind.bind_types[0] == proc_bind_false) + __kmp_affinity.type = affinity_none; if (__kmp_affinity.type == affinity_default) { __kmp_affinity.type = affinity_compact; __kmp_affinity.flags.dups = FALSE; From nobody Sat May 11 14:16:28 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vc78r6PGVz5KCVx; Sat, 11 May 2024 14:16: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 4Vc78r5swhz4t79; Sat, 11 May 2024 14:16:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715436988; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IBCWj8vUZWBO+CE3T93yUzuuKPxbsOyyINk6aV0IlUo=; b=DnYrJz2P4PDCvZWJinnuLojEknmrUiTApWpjOlaTgUPckJzlDx33ItTxjyL5ePHApFdVaM K48jqR9va4F1ECRm3Ppr8NRSbUrfmiOOtW+HTjYmew52sWRH5F9XQH9U+zQMkeu3rS2MIs T8DZzfbkPHj+GNBkVC6EAHl0V+GVEllyJbM0ZgPuskKwQ0z8UJKLIi2HbznBy/UteI62YP +3gPQOaRbFJrF1Z/Ybpo1mIfN3k0Mxrs+KWTOVDgOrhWsaudTpLZXrI4RpVbi2/GGgmmiJ lMkfDPlcvOGVzfMveWWqEahamKh1taitR4EA6CrCTelG6llXrxVe/JYezq8shg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715436988; a=rsa-sha256; cv=none; b=qwMzudNWAk7WPoJbo7t19SItne7Ty5Mseyfu+pH9eRDz0tgaF4YL6g0THtP3mvtaxd0RYX PDjXNarK2MK1z/+brDDi7UsWxL7UFWq5De252lmeboOO7Gb6avo3qwo5OpTPCKVgYcQQzW LX1pcE8FvvQUCQH6euFwjFDsZxtuRj1O/J6wpLXTopBoPblBj0raC8viI/I+VY5v7qGcwl DoG/nlgqhLU8BNx86+9nsxkvEb7+nKvYeNvrfu3onhukeGR+gE8otYNwQHLPkp7WSu8+KD rqWKGnf0wl6w2Pk1G5dCQgMiKbWKw+ZpWG+jZ87aS8kwLXtqLS+/NfdLgLOu5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715436988; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IBCWj8vUZWBO+CE3T93yUzuuKPxbsOyyINk6aV0IlUo=; b=ZZYtxM1wrCpYtrnjBJYRTnGIjlWWnl7cgnJ3Wf9xhgKabJ4Mt++FHZbqWCHBjEfDlukkSk PuV+ukgNgim+8hiZUkgq6b2oxCKdr+3uvFIR0HcPdeGFukI6sIfoaKorKolZ3aXqSMt+rF uz0HiAZnd2GR4Bs1qhmYVY7UjyWaPTxd537xuADnbQ4/tazKdXiYg4gHl+aii/fv6uppvP MtLmcQAgwv3rm5B3FsgXyS04kgJlOukaLSBBPcUIhFhBH6VGr4qJGXlipICGI+8sVQf3ly Nj4ujyNHGkTgI98e/bXZRQ3tLK70vqcYvsS5VANo+dLzRFf8bKAa32KGka5Nww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vc78r503BzNV5; Sat, 11 May 2024 14:16:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44BEGSKt004304; Sat, 11 May 2024 14:16:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44BEGSvQ004301; Sat, 11 May 2024 14:16:28 GMT (envelope-from git) Date: Sat, 11 May 2024 14:16:28 GMT Message-Id: <202405111416.44BEGSvQ004301@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 24268f262b41 - stable/14 - sysctl: Make sysctl_ctx_free() a bit safer List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 24268f262b41cd82ed492b4b0776214e549a56e7 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=24268f262b41cd82ed492b4b0776214e549a56e7 commit 24268f262b41cd82ed492b4b0776214e549a56e7 Author: Mark Johnston AuthorDate: 2024-05-01 11:57:56 +0000 Commit: Mark Johnston CommitDate: 2024-05-11 14:15:21 +0000 sysctl: Make sysctl_ctx_free() a bit safer Clear the list before returning so that sysctl_ctx_free() can be called more than once on the same list without side effects. This simplifies error handling in drivers; previously, drivers would have to be careful to call sysctl_ctx_free() at most once to avoid a use-after-free. While here, use TAILQ_FOREACH_SAFE in the loop which unregisters OIDs. Reviewed by: thj, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45041 (cherry picked from commit d5eae57088f5eec5df49fea8e8623521f596db68) --- sys/kern/kern_sysctl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 814579a80f5a..53b61c08713f 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -634,17 +634,15 @@ sysctl_ctx_free(struct sysctl_ctx_list *clist) return(EBUSY); } /* Now really delete the entries */ - e = TAILQ_FIRST(clist); - while (e != NULL) { - e1 = TAILQ_NEXT(e, link); + TAILQ_FOREACH_SAFE(e, clist, link, e1) { error = sysctl_remove_oid_locked(e->entry, 1, 0); if (error) panic("sysctl_remove_oid: corrupt tree, entry: %s", e->entry->oid_name); free(e, M_SYSCTLOID); - e = e1; } SYSCTL_WUNLOCK(); + TAILQ_INIT(clist); return (error); } From nobody Sat May 11 14:16:29 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vc78t1hqpz5KC8J; Sat, 11 May 2024 14:16:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vc78s6rnMz4t7B; Sat, 11 May 2024 14:16:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715436990; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N5WYSe98bBVihayXDWQnfN5hBmtatJF4JmaAHQh6tw8=; b=wZtnnITKI9xS7EBv7Q6CLARTzvoYDSvvIyIXsm8W13/r520F2AJYa6oICxlkwZBxC/KKDV mp++IwZnfZVFiHalzgvdT1FUHrIqHC6I4x4BbFV63E4SVaNpu7e8Jn+MMFkQj+cHHv0Z1s EmWCrbiawwb2fdtz4wsbX1OBggQ4hGqmtC+eS3b5jo/D0RuMk+Ud2LEHWgC9cISK4Q+auq 2fJ1P44kaZ6SAorWq5b0gRq9OsLbi3mwCl1O+bc++lLjEo+MMn6g4KzmJXOlqdaePYwdJ1 uhzOY6tMG52a6vCw9A31N9aobsyQvYb/WWeLZ7yOhfBZgZZr8Xf9JkyascDzFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715436990; a=rsa-sha256; cv=none; b=ri8ZYMR7wNF5fDOOHXvup4Y0L0Eyq3OUnlPUDdvblehKlEnTAimLgI3S+4Nytkt8PFhhhz 19GR7g2+5QpVeI14kR21r0JyGuxTn6pp/2428sXWX29HAt4B1NwDsNjg2HfXbrmBjdE1xo 3OfxSTwC8S2oGlwS7zh6MC6VjrihJYPOExxtuDTjqb5JmjILEue0Dee9skBu4SJO3OCl6B 7ms9rptBMMTiVcn1xHaDg0kxtlMJpTS9k/8sPc0qLTi0uM8tq3WqkSJM0YFdY1tKfslRA2 5rkksMKK3B15Iyrm5duXKBmRQX2IYrowGZ6WDW1eO9VREpqPZRqBFk0qh8oH6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715436990; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N5WYSe98bBVihayXDWQnfN5hBmtatJF4JmaAHQh6tw8=; b=HLvx5H60etGLycuzlr1HGOkGe6oFejQfjAjE3OSq2OMtvHd9jnKH7NMTFVjpxqJAA6B5NN jeTvLFXPs6hHXNcJet357lBcDxkSKPYWA3J0iDCfR86A8ZhEa574S8e0xgypCicj9M41sC DXteHXfOQPFNjn6y8MkZQ2r0nA046J0EDr2f7isWzYcKONE3Hy/C079W5N9TC0ioTD4Yur 9pGLsqekGbL6IR2iqHR6BkCOsSNEueITnnHBqkD1D2NZLmkDpfFdG3OYYPTqzQns26f+pR tWjNFUxLR+KUBcmXEN6bJpEq0Svrn3EeQHlYWR2HMz2fJ09UP2nnM7rXkgJkEg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vc78s5fJmzPRL; Sat, 11 May 2024 14:16:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44BEGTi5004346; Sat, 11 May 2024 14:16:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44BEGT1N004343; Sat, 11 May 2024 14:16:29 GMT (envelope-from git) Date: Sat, 11 May 2024 14:16:29 GMT Message-Id: <202405111416.44BEGT1N004343@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: d8ccaa995f45 - stable/14 - bhyve: Do not define GDB_LOG List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d8ccaa995f4539081f79e9b31ff0ac75173e1004 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d8ccaa995f4539081f79e9b31ff0ac75173e1004 commit d8ccaa995f4539081f79e9b31ff0ac75173e1004 Author: Mark Johnston AuthorDate: 2024-05-08 16:06:22 +0000 Commit: Mark Johnston CommitDate: 2024-05-11 14:15:23 +0000 bhyve: Do not define GDB_LOG This had been added for debugging and shouldn't have been committed. Fixes: f81cdf24ba54 ("bhyve: Add support for XML register definitions") MFC after: 3 days (cherry picked from commit 5d62025d82a0be928f98778d54b25ad89edbb835) --- usr.sbin/bhyve/gdb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/usr.sbin/bhyve/gdb.c b/usr.sbin/bhyve/gdb.c index 2a075cd10ca6..0319aaf0a9cd 100644 --- a/usr.sbin/bhyve/gdb.c +++ b/usr.sbin/bhyve/gdb.c @@ -193,7 +193,6 @@ static const struct gdb_reg { { .id = VM_REG_GUEST_EFER, .size = 8 }, }; -#define GDB_LOG #ifdef GDB_LOG #include #include From nobody Sat May 11 15:38:32 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vc8zX74QXz5KKdj; Sat, 11 May 2024 15:38: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 4Vc8zX6c8Pz450K; Sat, 11 May 2024 15:38:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715441912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LwR4oA9jdDzz8hb4HE9ueNgjAzlVAE+OzlkNfKKM3z4=; b=DrqrnueDXO95aL+HjCFOOev4y9icdA284hI8wRa1d9uHoPLbcjZGvtm3GcZIFpGdCNirbm iKdIxQ4aZnhnl21SAEpEB63A+ZJAdqWg4IwtIc+5QewvdJ4EISPMFbTVLRZ/aeiwmupnFX Az6QJumJECORoFYnb7QJAABBtX9TmfOH9GEKf5nUoaFqQ7fLqJz7JviMal+ckcNGZ1q6/r SCylpflArQ7F0JaOu1t4+huuMmYbHTIfD6SA3V09JItFkONSpqByUworyA2Bxl7q7QfkAu Yud1ZwE/ueo1RyV2+sQMtLEFFce/sFe6uhq+QNvfZBazErGnhF2hx3HVRHtr8A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715441912; a=rsa-sha256; cv=none; b=ugPgI76jw4+jvPRIIuCqGH4WQrgd/Bh2kE0daSyhzLiJnQmYLwL3aJ+UXDQ4S+WxKFX5xo x95EcYmCfMyK2+s7aebFBp8In4ymnhfqzRcySHdFnYCFsKwnHgiZXCC7nn2/Nk0Kx6ANEV TPayEsT+yPoEq5OmQOxffJeiqC522MZQLijINCgxcOHDxyIKb0aZDrb07PgFTALFk9PHvL 9p5yYJTSEYTLTAh2ACCt5Slk7ZvY7o30vWvsu35MaxhBsHcYX2K3TQZTu9aMmD2Ptr9t3q at+dyG8k+tf0IeqPc5moyakMMbeDnHRr3pKHAs60W0sWodEqVPfQu3tOJRNuww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715441912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LwR4oA9jdDzz8hb4HE9ueNgjAzlVAE+OzlkNfKKM3z4=; b=LP2VIqs2SdiYzoYr5x7ka2S7tFcO6cHIibg6X8uK8eMJpWUuCFfUvGLI+hcpYToGfGnqmC MocibPk9HWiRwc65CMvYIQfaP0wKELkp00K3WJcJ64cujajXT1g8cXMC7idMmqlmiV6sBI rEVYuBFUAg8mcdvAikWzIk/kzCCt4Zt/D9zFIu7uP7ElZM4YnSiao6iFHu7dV88QsNPY0F 62ETYGJ+GbLg0BhMotbLBsQKV6otaYKSkxMr2FEvJWyOnfs/jppfsJEgycaPYqzjwRlXhp HG2viMYmI7tON/HQrYDi7rl7LaEMpdJ7iAME45j2xrXdyJSvIioIyz46PgbTjw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vc8zX6CLszQwy; Sat, 11 May 2024 15:38:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44BFcWLa039546; Sat, 11 May 2024 15:38:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44BFcWHs039543; Sat, 11 May 2024 15:38:32 GMT (envelope-from git) Date: Sat, 11 May 2024 15:38:32 GMT Message-Id: <202405111538.44BFcWHs039543@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Tijl Coosemans Subject: git: 147ea7d4092f - stable/14 - linuxkpi: Fix set_memory_* List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tijl X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 147ea7d4092f4b08411724bd501283a281ffa34e Auto-Submitted: auto-generated The branch stable/14 has been updated by tijl: URL: https://cgit.FreeBSD.org/src/commit/?id=147ea7d4092f4b08411724bd501283a281ffa34e commit 147ea7d4092f4b08411724bd501283a281ffa34e Author: Tijl Coosemans AuthorDate: 2024-05-03 13:27:29 +0000 Commit: Tijl Coosemans CommitDate: 2024-05-11 15:32:35 +0000 linuxkpi: Fix set_memory_* set_memory_* is currently implemented using PHYS_TO_DMAP but not all architectures have a DMAP. Looking at how this function is used the given address isn't physical but virtual so the PHYS_TO_DMAP call can simply be removed. Also cast numpages before shifting it to avoid overflow. Reviewed by: kib, markj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D45057 (cherry picked from commit 7206f7c619912bdd4d54dd539824733eae50c3a9) --- sys/compat/linuxkpi/common/include/asm/set_memory.h | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/asm/set_memory.h b/sys/compat/linuxkpi/common/include/asm/set_memory.h index 69f659001c60..1019aaf264a0 100644 --- a/sys/compat/linuxkpi/common/include/asm/set_memory.h +++ b/sys/compat/linuxkpi/common/include/asm/set_memory.h @@ -34,26 +34,20 @@ static inline int set_memory_uc(unsigned long addr, int numpages) { - vm_offset_t va; vm_size_t len; - va = PHYS_TO_DMAP(addr); - len = numpages << PAGE_SHIFT; - - return (-pmap_change_attr(va, len, VM_MEMATTR_UNCACHEABLE)); + len = (vm_size_t)numpages << PAGE_SHIFT; + return (-pmap_change_attr(addr, len, VM_MEMATTR_UNCACHEABLE)); } static inline int set_memory_wc(unsigned long addr, int numpages) { #ifdef VM_MEMATTR_WRITE_COMBINING - vm_offset_t va; vm_size_t len; - va = PHYS_TO_DMAP(addr); - len = numpages << PAGE_SHIFT; - - return (-pmap_change_attr(va, len, VM_MEMATTR_WRITE_COMBINING)); + len = (vm_size_t)numpages << PAGE_SHIFT; + return (-pmap_change_attr(addr, len, VM_MEMATTR_WRITE_COMBINING)); #else return (set_memory_uc(addr, numpages)); #endif @@ -62,13 +56,10 @@ set_memory_wc(unsigned long addr, int numpages) static inline int set_memory_wb(unsigned long addr, int numpages) { - vm_offset_t va; vm_size_t len; - va = PHYS_TO_DMAP(addr); - len = numpages << PAGE_SHIFT; - - return (-pmap_change_attr(va, len, VM_MEMATTR_WRITE_BACK)); + len = (vm_size_t)numpages << PAGE_SHIFT; + return (-pmap_change_attr(addr, len, VM_MEMATTR_WRITE_BACK)); } static inline int From nobody Sat May 11 15:38:33 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vc8zZ10R2z5KKhK; Sat, 11 May 2024 15:38: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 4Vc8zZ0Rp2z44cp; Sat, 11 May 2024 15:38:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715441914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ywAliOX9aFinJrvJo3pTb9r0eTtQs1gyyjXncxXiUEs=; b=cPTJS7pI4wh92leBEvuX+o8dElesIpvZh4zkGIV/L4pv8dfQZV7RiLhrj70FHbhjaYKRiA fFAEmthHEi0PuWv0bnO86CF+8hdo6grPj/bEEUzUGB8qnM1brKrAC5dC6J7jHeXxxevsYY Esh9Wp29DMalYtAQq60xJ2Eas9icGVhnnlcFvhRduQT+DoeGw2xwhkHbu0oNGoJcxm0X+F +VgRFvsfhGu2ar0BnwxcCxhShHISvM+aVkfbV+W70jiyC7wjgCDAuLQZqj8GWtvb8XzDAz IIKekzCFT48EkUXXOZOHyirvhDWWI7hCVbToGDNVl/NGhY9bmYblGdugeC/lEg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715441914; a=rsa-sha256; cv=none; b=T9GCc0L22POxAQ/SXAfyw84cja0mzSyOdiG58v0u5IrUvWIsrkPqH31JAgqCQkn+GHtIoC 6FJx1FTSXsx0p+USPT+RUX88EW8G2og1UqSWdnfKocQIuQx6heHJhW6pPxMPbpKhE1RuoH FK7QMJBVp5RxDU9SyjUBqv6rfc977QoDVHBM52x8lEAVDE/HBJ2cY6K6qiuBxc2y7NOuJh LwIqK//mGafblMXZwHtgmyumhLJ9PpT077Uha0pVhhBlIqiIAGT2ho1SO7dv934hQpsw1q Jd2ajuE4ADb0Y4hgbktzod+t7zjoW4kuD/7yxKeCYGaB4DbUECTekHAxjc1H4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715441914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ywAliOX9aFinJrvJo3pTb9r0eTtQs1gyyjXncxXiUEs=; b=O57P2E/LGbiOMzc/QyHHrTjRq2iu7roRFxqHiTWOBZ5hS4KVOI+DVCB71h5mr5KrOU0Ogn RjJIdsPUPOpreedwsYLD6J40Pxs3lqk/K48BeMEeVJSjWdMmujGHgfXSGtKkX6xzzEEKiP 2BieEcixKHekMpkXOETv2n2XqnyJY9fJBiSnPcwirUDM7gvz3UDnlYspRV88+chDgopEXT 7t2wmZKoR7dGmEXhtDgerWjjffupcBkY456cDJYzHvsXu34flivB/c/fSC8k/OY8hPmRDV FJ64xed4EXoaT88Xm0OvmaDQceANZWrgVYFN/s//l8AeGG7H80ocmeXHmPazzA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vc8zZ031DzRDc; Sat, 11 May 2024 15:38:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44BFcXWI039587; Sat, 11 May 2024 15:38:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44BFcXA1039584; Sat, 11 May 2024 15:38:33 GMT (envelope-from git) Date: Sat, 11 May 2024 15:38:33 GMT Message-Id: <202405111538.44BFcXA1039584@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Tijl Coosemans Subject: git: 2d97bd0639cd - stable/14 - linuxkpi: Make arch_io_*_memtype_wc amd64-only List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tijl X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2d97bd0639cd0af43b7beb6f45ef15bcf110db57 Auto-Submitted: auto-generated The branch stable/14 has been updated by tijl: URL: https://cgit.FreeBSD.org/src/commit/?id=2d97bd0639cd0af43b7beb6f45ef15bcf110db57 commit 2d97bd0639cd0af43b7beb6f45ef15bcf110db57 Author: Tijl Coosemans AuthorDate: 2024-05-08 18:49:56 +0000 Commit: Tijl Coosemans CommitDate: 2024-05-11 15:32:51 +0000 linuxkpi: Make arch_io_*_memtype_wc amd64-only Linux only implements these functions on x86. They return 0 on other architectures. The FreeBSD implementation calls PHYS_TO_DMAP but this panics on i386 because it does not have a direct map so return 0 on i386 as well for now. These functions are only used by graphics/drm-*-kmod to mark the VRAM aperture write-combining but this is also accomplished by a call to vm_phys_fictitious_reg_range so this change is sufficient to fix drm-*-kmod on i386 for FreeBSD 14.1. Reviewed by: kib MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D45125 (cherry picked from commit 2ae0f5a4d0931067c672be9a791909f0e32d5a0e) --- sys/compat/linuxkpi/common/include/linux/io.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/io.h b/sys/compat/linuxkpi/common/include/linux/io.h index bce70ed0cb8d..164347dbc4e7 100644 --- a/sys/compat/linuxkpi/common/include/linux/io.h +++ b/sys/compat/linuxkpi/common/include/linux/io.h @@ -541,30 +541,29 @@ void lkpi_arch_phys_wc_del(int); #define arch_phys_wc_index(x) \ (((x) < __MTRR_ID_BASE) ? -1 : ((x) - __MTRR_ID_BASE)) -#if defined(__amd64__) || defined(__i386__) || defined(__aarch64__) || defined(__powerpc__) || defined(__riscv) static inline int arch_io_reserve_memtype_wc(resource_size_t start, resource_size_t size) { +#if defined(__amd64__) vm_offset_t va; va = PHYS_TO_DMAP(start); - -#ifdef VM_MEMATTR_WRITE_COMBINING return (-pmap_change_attr(va, size, VM_MEMATTR_WRITE_COMBINING)); #else - return (-pmap_change_attr(va, size, VM_MEMATTR_UNCACHEABLE)); + return (0); #endif } static inline void arch_io_free_memtype_wc(resource_size_t start, resource_size_t size) { +#if defined(__amd64__) vm_offset_t va; va = PHYS_TO_DMAP(start); pmap_change_attr(va, size, VM_MEMATTR_WRITE_BACK); -} #endif +} #endif /* _LINUXKPI_LINUX_IO_H_ */ From nobody Sun May 12 00:08:25 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VcNHt2Bcsz5Jb7L; Sun, 12 May 2024 00:08: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 4VcNHt1Mh5z4t51; Sun, 12 May 2024 00:08:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715472506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W2BzjuoID/fVfXnqx5qrwV6KTlh6lXaWMncg282yuKA=; b=xFco8NUjawtRH2TDVHi2/LPFpRb/7DO3z6XO589KWeFxuTaSONYuZ7nnjHn1OYW7WOvJhw ipBp0+zUj/V0SxmcKEKn7HkaCS9U3liO2HzHBNY41vZsoELM3HvXAqKdm6QVeyX9IY2zGV MGb+/raBBnisiefxT+wTP45U8+1P96+9ERoRBUe2VNK+oQrJwWhRfzth/GWZMeSrHp0fIB gBlM4T0VH8IEXzeaFr2jgYnvWO7/aKf6CjuZvIsA/SDeqLLCX70stRu1H3AcQD2GA75QWS SKHr3PnS9hKWRZe+DOSKY2FaBV8149ElZVd8Bnp8PC8F6vsYjIPHvRy3rBSkbA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715472506; a=rsa-sha256; cv=none; b=o+m1QCLLPBb8iq+7Ku8zKV8TUFrqoaeLdebR7CAP6HirhmxFN72PnqQLvqOS41b03NrXZ8 GQfwgkO4EqzZ8tNgpT42dG1cXOfMgw6/JuF1ywA7Dj4DHP/aTbeugdjMtXxFEPiLKAN3ZB At3ns1PPzjZ9SxNWYmeZ3gajYcQ9vEy56YSAvhRzfyhmszx1qrkNUqx4LDdgpD1eHXSAv0 WvD0NRCiaJN7rOxg1VzLqXYfwqZ9X92AVAAFP+LntH7VTjqXRp0WHvBEaPh9k7EToYUaJQ vt+v/HhjZ+q0PHMuCCKx6Bp4/XEJI0ilgzqICGnjQxVykXIUdgORTzrfv7+k7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715472506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W2BzjuoID/fVfXnqx5qrwV6KTlh6lXaWMncg282yuKA=; b=aE8omz8ZtRG1+1DrDzCtS3zlLF6c8eLOKuTBzcnZMAaagnt/e9MwY5EMzkPSOsAYC/a2Ci ryZQgVjJH0vybfU4TspWQ1kuywLUjP+7kE9TF7R6BYmPET+jK1+WOMqw026LiEY370XPxn I+p8rPFtFaQX7cUYQQoaBr8ceDYBFpoTREcrhbsUjhEMbbnAeNp27RVHz0Kpct5VXAKgMH y5id+WJ/Nd/TCp+HK3N65ftqB2UMP6c7G+Z07LAqa+cgW9Vno276gtJrbx0EbnRNmTKYbC AcwI1hI8ROEDzO9yY7NoLfvsdS7zDpHVVkXaW8Xi/M4b8R/zwS8RPjKFa7EKAg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VcNHt0hTjzhF2; Sun, 12 May 2024 00:08:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44C08PqK001728; Sun, 12 May 2024 00:08:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44C08PWY001725; Sun, 12 May 2024 00:08:25 GMT (envelope-from git) Date: Sun, 12 May 2024 00:08:25 GMT Message-Id: <202405120008.44C08PWY001725@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jake Freeland Subject: git: 9da71e6353a2 - stable/14 - ktrace: Record detailed ECAPMODE violations List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jfree X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9da71e6353a24aed8bffb04e45931215806b16fd Auto-Submitted: auto-generated The branch stable/14 has been updated by jfree: URL: https://cgit.FreeBSD.org/src/commit/?id=9da71e6353a24aed8bffb04e45931215806b16fd commit 9da71e6353a24aed8bffb04e45931215806b16fd Author: Jake Freeland AuthorDate: 2024-04-06 18:29:45 +0000 Commit: Jake Freeland CommitDate: 2024-05-11 23:57:44 +0000 ktrace: Record detailed ECAPMODE violations When a Capsicum violation occurs in the kernel, ktrace will now record detailed information pertaining to the violation. For example: - When a namei lookup violation occurs, ktrace will record the path. - When a signal violation occurs, ktrace will record the signal number. - When a sendto(2) violation occurs, ktrace will record the recipient sockaddr. For all violations, the syscall and ABI is recorded. kdump is also modified to display this new information to the user. Reviewed by: oshogbo, markj Approved by: markj (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D40676 (cherry picked from commit 9bec84131215ed554f435e208399f36e982246f1) --- sys/kern/kern_ktrace.c | 43 +++++++++++++++++++++++-------- sys/kern/sys_capability.c | 16 +++++------- sys/sys/capsicum.h | 7 +++++ sys/sys/ktrace.h | 32 +++++++++++++++++------ usr.bin/kdump/kdump.c | 65 +++++++++++++++++++++++++++++++++++++---------- 5 files changed, 122 insertions(+), 41 deletions(-) diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 4c1936edc301..555762185411 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -925,14 +925,17 @@ ktrstructarray(const char *name, enum uio_seg seg, const void *data, } void -ktrcapfail(enum ktr_cap_fail_type type, const cap_rights_t *needed, - const cap_rights_t *held) +ktrcapfail(enum ktr_cap_violation type, const void *data) { struct thread *td = curthread; struct ktr_request *req; struct ktr_cap_fail *kcf; + union ktr_cap_data *kcd; - if (__predict_false(curthread->td_pflags & TDP_INKTRACE)) + if (__predict_false(td->td_pflags & TDP_INKTRACE)) + return; + if (type != CAPFAIL_SYSCALL && + (td->td_sa.callp->sy_flags & SYF_CAPENABLED) == 0) return; req = ktr_getrequest(KTR_CAPFAIL); @@ -940,14 +943,32 @@ ktrcapfail(enum ktr_cap_fail_type type, const cap_rights_t *needed, return; kcf = &req->ktr_data.ktr_cap_fail; kcf->cap_type = type; - if (needed != NULL) - kcf->cap_needed = *needed; - else - cap_rights_init(&kcf->cap_needed); - if (held != NULL) - kcf->cap_held = *held; - else - cap_rights_init(&kcf->cap_held); + kcf->cap_code = td->td_sa.code; + kcf->cap_svflags = td->td_proc->p_sysent->sv_flags; + if (data != NULL) { + kcd = &kcf->cap_data; + switch (type) { + case CAPFAIL_NOTCAPABLE: + case CAPFAIL_INCREASE: + kcd->cap_needed = *(const cap_rights_t *)data; + kcd->cap_held = *((const cap_rights_t *)data + 1); + break; + case CAPFAIL_SYSCALL: + case CAPFAIL_SIGNAL: + case CAPFAIL_PROTO: + kcd->cap_int = *(const int *)data; + break; + case CAPFAIL_SOCKADDR: + kcd->cap_sockaddr = *(const struct sockaddr *)data; + break; + case CAPFAIL_NAMEI: + strlcpy(kcd->cap_path, data, MAXPATHLEN); + break; + case CAPFAIL_CPUSET: + default: + break; + } + } ktr_enqueuerequest(td, req); ktrace_exit(td); } diff --git a/sys/kern/sys_capability.c b/sys/kern/sys_capability.c index fac264a78531..d59ad37f35ec 100644 --- a/sys/kern/sys_capability.c +++ b/sys/kern/sys_capability.c @@ -154,14 +154,13 @@ MALLOC_DECLARE(M_FILECAPS); static inline int _cap_check(const cap_rights_t *havep, const cap_rights_t *needp, - enum ktr_cap_fail_type type) + enum ktr_cap_violation type) { + const cap_rights_t rights[] = { *needp, *havep }; if (!cap_rights_contains(havep, needp)) { -#ifdef KTRACE - if (KTRPOINT(curthread, KTR_CAPFAIL)) - ktrcapfail(type, needp, havep); -#endif + if (CAP_TRACING(curthread)) + ktrcapfail(type, rights); return (ENOTCAPABLE); } return (0); @@ -180,11 +179,10 @@ cap_check(const cap_rights_t *havep, const cap_rights_t *needp) int cap_check_failed_notcapable(const cap_rights_t *havep, const cap_rights_t *needp) { + const cap_rights_t rights[] = { *needp, *havep }; -#ifdef KTRACE - if (KTRPOINT(curthread, KTR_CAPFAIL)) - ktrcapfail(CAPFAIL_NOTCAPABLE, needp, havep); -#endif + if (CAP_TRACING(curthread)) + ktrcapfail(CAPFAIL_NOTCAPABLE, rights); return (ENOTCAPABLE); } diff --git a/sys/sys/capsicum.h b/sys/sys/capsicum.h index 93c5f0c9c390..05712abf37d1 100644 --- a/sys/sys/capsicum.h +++ b/sys/sys/capsicum.h @@ -45,6 +45,7 @@ #include #include #include +#include #ifndef _KERNEL #include @@ -418,6 +419,12 @@ __END_DECLS #include +#ifdef KTRACE +#define CAP_TRACING(td) KTRPOINT((td), KTR_CAPFAIL) +#else +#define CAP_TRACING(td) 0 +#endif + #define IN_CAPABILITY_MODE(td) (((td)->td_ucred->cr_flags & CRED_FLAG_CAPMODE) != 0) struct filedesc; diff --git a/sys/sys/ktrace.h b/sys/sys/ktrace.h index 594f912b02ef..6d8280c415a6 100644 --- a/sys/sys/ktrace.h +++ b/sys/sys/ktrace.h @@ -34,8 +34,10 @@ #ifndef _SYS_KTRACE_H_ #define _SYS_KTRACE_H_ +#include #include #include +#include #include /* @@ -207,16 +209,31 @@ struct ktr_proc_ctor { * KTR_CAPFAIL - trace capability check failures */ #define KTR_CAPFAIL 12 -enum ktr_cap_fail_type { +enum ktr_cap_violation { CAPFAIL_NOTCAPABLE, /* insufficient capabilities in cap_check() */ - CAPFAIL_INCREASE, /* attempt to increase capabilities */ + CAPFAIL_INCREASE, /* attempt to increase rights on a capability */ CAPFAIL_SYSCALL, /* disallowed system call */ - CAPFAIL_LOOKUP, /* disallowed VFS lookup */ + CAPFAIL_SIGNAL, /* sent signal to process other than self */ + CAPFAIL_PROTO, /* disallowed protocol */ + CAPFAIL_SOCKADDR, /* restricted address lookup */ + CAPFAIL_NAMEI, /* restricted namei lookup */ + CAPFAIL_CPUSET, /* restricted CPU set modification */ }; + +union ktr_cap_data { + cap_rights_t cap_rights[2]; +#define cap_needed cap_rights[0] +#define cap_held cap_rights[1] + int cap_int; + struct sockaddr cap_sockaddr; + char cap_path[MAXPATHLEN]; +}; + struct ktr_cap_fail { - enum ktr_cap_fail_type cap_type; - cap_rights_t cap_needed; - cap_rights_t cap_held; + enum ktr_cap_violation cap_type; + short cap_code; + u_int cap_svflags; + union ktr_cap_data cap_data; }; /* @@ -319,8 +336,7 @@ void ktruserret(struct thread *); void ktrstruct(const char *, const void *, size_t); void ktrstruct_error(const char *, const void *, size_t, int); void ktrstructarray(const char *, enum uio_seg, const void *, int, size_t); -void ktrcapfail(enum ktr_cap_fail_type, const cap_rights_t *, - const cap_rights_t *); +void ktrcapfail(enum ktr_cap_violation, const void *); #define ktrcaprights(s) \ ktrstruct("caprights", (s), sizeof(cap_rights_t)) #define ktritimerval(s) \ diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c index d69c019bd6be..abbe57b0b75e 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -2137,35 +2137,74 @@ invalid: void ktrcapfail(struct ktr_cap_fail *ktr) { + union ktr_cap_data *kcd = &ktr->cap_data; + switch (ktr->cap_type) { case CAPFAIL_NOTCAPABLE: /* operation on fd with insufficient capabilities */ printf("operation requires "); - sysdecode_cap_rights(stdout, &ktr->cap_needed); + sysdecode_cap_rights(stdout, &kcd->cap_needed); printf(", descriptor holds "); - sysdecode_cap_rights(stdout, &ktr->cap_held); + sysdecode_cap_rights(stdout, &kcd->cap_held); break; case CAPFAIL_INCREASE: /* requested more capabilities than fd already has */ printf("attempt to increase capabilities from "); - sysdecode_cap_rights(stdout, &ktr->cap_held); + sysdecode_cap_rights(stdout, &kcd->cap_held); printf(" to "); - sysdecode_cap_rights(stdout, &ktr->cap_needed); + sysdecode_cap_rights(stdout, &kcd->cap_needed); break; case CAPFAIL_SYSCALL: /* called restricted syscall */ - printf("disallowed system call"); + printf("system call not allowed: "); + syscallname(ktr->cap_code, ktr->cap_svflags); + if (syscallabi(ktr->cap_svflags) == SYSDECODE_ABI_FREEBSD) { + switch (ktr->cap_code) { + case SYS_sysarch: + printf(", op: "); + print_integer_arg(sysdecode_sysarch_number, + kcd->cap_int); + break; + case SYS_fcntl: + printf(", cmd: "); + print_integer_arg(sysdecode_fcntl_cmd, + kcd->cap_int); + break; + } + } break; - case CAPFAIL_LOOKUP: - /* absolute or AT_FDCWD path, ".." path, etc. */ - printf("restricted VFS lookup"); + case CAPFAIL_SIGNAL: + /* sent signal to proc other than self */ + syscallname(ktr->cap_code, ktr->cap_svflags); + printf(": signal delivery not allowed: "); + print_integer_arg(sysdecode_signal, kcd->cap_int); break; - default: - printf("unknown capability failure: "); - sysdecode_cap_rights(stdout, &ktr->cap_needed); - printf(" "); - sysdecode_cap_rights(stdout, &ktr->cap_held); + case CAPFAIL_PROTO: + /* created socket with restricted protocol */ + syscallname(ktr->cap_code, ktr->cap_svflags); + printf(": protocol not allowed: "); + print_integer_arg(sysdecode_ipproto, kcd->cap_int); break; + case CAPFAIL_SOCKADDR: + /* unable to look up address */ + syscallname(ktr->cap_code, ktr->cap_svflags); + printf(": restricted address lookup: "); + ktrsockaddr(&kcd->cap_sockaddr); + return; + case CAPFAIL_NAMEI: + /* absolute or AT_FDCWD path, ".." path, etc. */ + syscallname(ktr->cap_code, ktr->cap_svflags); + printf(": restricted VFS lookup: %s\n", kcd->cap_path); + return; + case CAPFAIL_CPUSET: + /* modification of an external cpuset */ + syscallname(ktr->cap_code, ktr->cap_svflags); + printf(": restricted cpuset operation\n"); + return; + default: + syscallname(ktr->cap_code, ktr->cap_svflags); + printf(": unknown capability failure\n"); + return; } printf("\n"); } From nobody Sun May 12 00:08:27 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VcNHv4RBfz5JbZg; Sun, 12 May 2024 00:08:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VcNHv3ffsz4svT; Sun, 12 May 2024 00:08:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715472507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UXB8THGzkCnWn5TQxvSi6Qbu0eDitE+MICo5Atv2gHM=; b=tiqVguLv6cBaAah2qBiy5w5FGw83PZ5ptbBI47WqB8X5XzvJrvmo9su0ii0Vq3Gx4nZGVQ xcPjYcu+5Pig70v/RLcVRQnUjGP7Ol9fVJHm9yO90jAigMbSWKiu/Uj4syj7gEXyK/9DOE hD/QLe+KguO1LbDl9ZvUir3tTUcNVY1egr1IN8X0XtQwbL1JtZurCeT+JSNHN+JNqYdOdF duJiNdWEi6Knravbl6bLn9TseA3Z7eNYCOFlcsIHjNEaVLEeilbCdI87q30vZesiG0kkc4 QsdBvEelDQYLZR9TrNrXFLdjyHKFuk2g5HKWNDB6foKiwwmlcSJlxn2lWKutAw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715472507; a=rsa-sha256; cv=none; b=bipgkECxlA6hO2gzcdL5vl0F313loIZ/dK/dz60rakLVodAxDLF/NN7rJyECM2f0uT2f3l a/aflxunjqse9cm4iULyvM3mLTa40+THhoyiolunLbMcd4yFTUnT8bK2iuDmpwOY/qAtdx l6ch4sqrZANwzFPilboqP7D/CMkuvTW33wSsUFlvxMLQrW1lLFIGZ/agysFNKqKM2p1gMQ EcXg76u+CfJo/gfmNAhXFNyNq/EBCID3UNRV4UXEi8joYkqKzG/j31vk0+k+gGCvHgqzUD ekesNwpxilDmTtnJs+oTSnfpkLpwVXHWfxYQ4sDcFEiJm1LPgNH7Fmc04ThL4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715472507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UXB8THGzkCnWn5TQxvSi6Qbu0eDitE+MICo5Atv2gHM=; b=EPchNLvyUwvPK/ZqkLIk57iUoGCq1UHV5OqJrn3NPClcBmqLLD34jwjvi68fyQyNeNTEoe r2FXTzKUToFoSxq/QWWa3aKT4lCBZpycaKbZHL9z7IaIFndtiJclzuK1938wJ+iSaGDa5T ycAPDPZm6mXbbYt5pKy9rqEbeMh459E/+FDaFVmFgoLM4knVteyO0Goy8FRJp/FlB4Dwhn O5MpZMWgY0b8c/09tQXPRI4FqemBrWPaXh1tOZITpwrR9ASNLK7CI/X4g6XRYTAIcRwp6J 82l2BpvSZDM0jzOX+PCCCp6la6MNmD0M97CegAan+Hg1ukeymHRVhGecuF+nTQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VcNHv1fv3zhTt; Sun, 12 May 2024 00:08:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44C08RRi001773; Sun, 12 May 2024 00:08:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44C08Rmr001770; Sun, 12 May 2024 00:08:27 GMT (envelope-from git) Date: Sun, 12 May 2024 00:08:27 GMT Message-Id: <202405120008.44C08Rmr001770@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jake Freeland Subject: git: 85a4df5f2a6b - stable/14 - ktrace: Record cpuset violations with KTR_CAPFAIL List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jfree X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 85a4df5f2a6bae3e2ecdf311150f17f6063600d2 Auto-Submitted: auto-generated The branch stable/14 has been updated by jfree: URL: https://cgit.FreeBSD.org/src/commit/?id=85a4df5f2a6bae3e2ecdf311150f17f6063600d2 commit 85a4df5f2a6bae3e2ecdf311150f17f6063600d2 Author: Jake Freeland AuthorDate: 2024-04-06 18:31:14 +0000 Commit: Jake Freeland CommitDate: 2024-05-11 23:57:44 +0000 ktrace: Record cpuset violations with KTR_CAPFAIL Report Capsicum violations in the cpuset namespace with CAPFAIL_CPUSET. Reviewed by: markj Approved by: markj (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D40677 (cherry picked from commit 96c8b3e509882e5a51a5ae58d366b812be4d2773) --- sys/kern/kern_cpuset.c | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/sys/kern/kern_cpuset.c b/sys/kern/kern_cpuset.c index 17176afa6ad3..5d9e2f2f326b 100644 --- a/sys/kern/kern_cpuset.c +++ b/sys/kern/kern_cpuset.c @@ -1762,22 +1762,38 @@ cpuset_setproc_update_set(struct proc *p, struct cpuset *set) * In Capability mode, the only accesses that are permitted are to the current * thread and process' CPU and domain sets. */ +static bool +cpuset_capmode_allowed(struct thread *td, cpulevel_t level, cpuwhich_t which, + id_t id) +{ + if (level != CPU_LEVEL_WHICH) + return (false); + if (which != CPU_WHICH_TID && which != CPU_WHICH_PID && + which != CPU_WHICH_TIDPID) + return (false); + if (id != -1 && which == CPU_WHICH_TIDPID && + id != td->td_tid && id != td->td_proc->p_pid) + return (false); + if (id != -1 && + !(which == CPU_WHICH_TID && id == td->td_tid) && + !(which == CPU_WHICH_PID && id == td->td_proc->p_pid)) + return (false); + return (true); +} + +/* + * Check for capability violations and record them if ktrace(2) is active. + */ static int cpuset_check_capabilities(struct thread *td, cpulevel_t level, cpuwhich_t which, id_t id) { - if (IN_CAPABILITY_MODE(td)) { - if (level != CPU_LEVEL_WHICH) - return (ECAPMODE); - if (which != CPU_WHICH_TID && which != CPU_WHICH_PID && - which != CPU_WHICH_TIDPID) - return (ECAPMODE); - if (id != -1 && which == CPU_WHICH_TIDPID && - id != td->td_tid && id != td->td_proc->p_pid) - return (ECAPMODE); - if (id != -1 && - !(which == CPU_WHICH_TID && id == td->td_tid) && - !(which == CPU_WHICH_PID && id == td->td_proc->p_pid)) + if (IN_CAPABILITY_MODE(td) || CAP_TRACING(td)) { + if (cpuset_capmode_allowed(td, level, which, id)) + return (0); + if (CAP_TRACING(td)) + ktrcapfail(CAPFAIL_CPUSET, NULL); + if (IN_CAPABILITY_MODE(td)) return (ECAPMODE); } return (0); From nobody Sun May 12 00:08:28 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VcNHw5jRSz5JbSH; Sun, 12 May 2024 00:08:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VcNHw315Xz4sxt; Sun, 12 May 2024 00:08:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715472508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TtJcJG4UJhrfUd6qb38zPMLuV+B9xq27sPhlgVEmYvs=; b=IsaW5/gpeE5bXMWqkTYVlCop/7EO9YH9Tv8DK2jOeSEI9uxl9XVzSaI3xKbyPeyhksRsg2 B2bLEL8x3E0Rb24o/mSteHCkv4/ijSpIexk0mkLf0Ke7p6p7vbIsQaWhUnmx6fGp+CYn0n UjTqcDI9Yj6tGZvR1L4mgt+mTgG1lcYYNZO5MR/xKM9RqIyPRAbyUm8xRfbs8H64da1vrU 7yrhxsVMVI2CDoEYVH/pTkBzYmUIu7IKj07ipgadz+s62DswGHzTDLhStecFLJzbquXdnW vL3a5NffhBwKLauwqVKNCQhdYI8S/3Iy17KX2PR1bGTe+fNVIuH8GVYyd6KRQA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715472508; a=rsa-sha256; cv=none; b=fwsLeiVzEeH9xr7T491IYBN/VJdxazF3Y9HHeGAF6edWcbo0Jzf9vjVS0gBRCjOVevQfFS /dSKw1leM5oAddQPYi4i4QGh/PSBodVGg8fbyHfnnbUiFny+2pfCX4pe9jzZjbcOYS6k5L Sxjmn9d7D5Swpsk8YWhki5ORmTFo9olutJcdhtKCwh3G9tVKJFbh8x+mqSj7DAKMnOUikU wpjHBxcYuxvcCq3jKM5WckTi3RIJNAT/DziXkwQbNm8QDzXk1D8eTj1oXzlvg3WZN6oS2i oXtFXbXXZFEZ/7PXZJYhUoLr2RU4iQ3U0hbt1e2Gp0SG6wue2Y+RIWYlxENJEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715472508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TtJcJG4UJhrfUd6qb38zPMLuV+B9xq27sPhlgVEmYvs=; b=j/jNZagLfbCds7pyqDv7NM0RGdI9Z1579PXIAO7JpZ7NLGf7TWj1iTV7RyRx3Eoi245DgC jrMvLStUMGJzKGOv1bGxJFJC3Q/DEqtyFN/iRmOo11qunUrCbkZH47tGvkVsbigaeXKbH/ nbDHi5HasocgYlcniw0vd2EJBxsv1Oblco4rxc440+D2AFo4jBLM3AwvrTYuHAGSgN6bOg r6KdG0r+WLi6ruydhQhyVD4owOBAyPgJv8MnuW+KFlp6FwimoHa3gPHxwMKlR5MNwLXqzM XyKWBceivPRCt+PtXoFVuRo3oBnW7RFYDyWQOYM4HqT4/Afxg486iDsrmrKR/g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VcNHw2VyszhTv; Sun, 12 May 2024 00:08:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44C08SwM001825; Sun, 12 May 2024 00:08:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44C08SEg001822; Sun, 12 May 2024 00:08:28 GMT (envelope-from git) Date: Sun, 12 May 2024 00:08:28 GMT Message-Id: <202405120008.44C08SEg001822@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jake Freeland Subject: git: fa92eaede40b - stable/14 - ktrace: Record syscall violations with KTR_CAPFAIL List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jfree X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fa92eaede40bce557c44e4f1b599cd6e443607b5 Auto-Submitted: auto-generated The branch stable/14 has been updated by jfree: URL: https://cgit.FreeBSD.org/src/commit/?id=fa92eaede40bce557c44e4f1b599cd6e443607b5 commit fa92eaede40bce557c44e4f1b599cd6e443607b5 Author: Jake Freeland AuthorDate: 2024-04-06 18:31:18 +0000 Commit: Jake Freeland CommitDate: 2024-05-11 23:57:44 +0000 ktrace: Record syscall violations with KTR_CAPFAIL Report syscalls that are not allowed in capability mode with CAPFAIL_SYSCALL. Reviewed by: markj Approved by: markj (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D40678 (cherry picked from commit 05296a0ff615566d25c77c5e6619b08724d2eecb) --- sys/amd64/amd64/sys_machdep.c | 52 +++++++++++++++++++++---------------------- sys/arm/arm/sys_machdep.c | 27 ++++++++++------------ sys/i386/i386/sys_machdep.c | 34 +++++++++++++--------------- sys/kern/kern_descrip.c | 2 ++ sys/kern/kern_sig.c | 12 +++++++--- sys/kern/subr_syscall.c | 11 +++++---- 6 files changed, 71 insertions(+), 67 deletions(-) diff --git a/sys/amd64/amd64/sys_machdep.c b/sys/amd64/amd64/sys_machdep.c index 6f8d6feaf60b..6c8b038bdb09 100644 --- a/sys/amd64/amd64/sys_machdep.c +++ b/sys/amd64/amd64/sys_machdep.c @@ -189,35 +189,33 @@ sysarch(struct thread *td, struct sysarch_args *uap) * explicitly indicate whether or not the operation is safe to * perform in capability mode. */ - if (IN_CAPABILITY_MODE(td)) { - switch (uap->op) { - case I386_GET_LDT: - case I386_SET_LDT: - case I386_GET_IOPERM: - case I386_GET_FSBASE: - case I386_SET_FSBASE: - case I386_GET_GSBASE: - case I386_SET_GSBASE: - case I386_GET_XFPUSTATE: - case I386_SET_PKRU: - case I386_CLEAR_PKRU: - case AMD64_GET_FSBASE: - case AMD64_SET_FSBASE: - case AMD64_GET_GSBASE: - case AMD64_SET_GSBASE: - case AMD64_GET_XFPUSTATE: - case AMD64_SET_PKRU: - case AMD64_CLEAR_PKRU: - break; + switch (uap->op) { + case I386_GET_LDT: + case I386_SET_LDT: + case I386_GET_IOPERM: + case I386_GET_FSBASE: + case I386_SET_FSBASE: + case I386_GET_GSBASE: + case I386_SET_GSBASE: + case I386_GET_XFPUSTATE: + case I386_SET_PKRU: + case I386_CLEAR_PKRU: + case AMD64_GET_FSBASE: + case AMD64_SET_FSBASE: + case AMD64_GET_GSBASE: + case AMD64_SET_GSBASE: + case AMD64_GET_XFPUSTATE: + case AMD64_SET_PKRU: + case AMD64_CLEAR_PKRU: + break; - case I386_SET_IOPERM: - default: -#ifdef KTRACE - if (KTRPOINT(td, KTR_CAPFAIL)) - ktrcapfail(CAPFAIL_SYSCALL, NULL, NULL); -#endif + case I386_SET_IOPERM: + default: + if (CAP_TRACING(td)) + ktrcapfail(CAPFAIL_SYSCALL, &uap->op); + if (IN_CAPABILITY_MODE(td)) return (ECAPMODE); - } + break; } #endif diff --git a/sys/arm/arm/sys_machdep.c b/sys/arm/arm/sys_machdep.c index 208026db85ba..d167c757952b 100644 --- a/sys/arm/arm/sys_machdep.c +++ b/sys/arm/arm/sys_machdep.c @@ -177,22 +177,19 @@ sysarch(struct thread *td, struct sysarch_args *uap) * explicitly indicate whether or not the operation is safe to * perform in capability mode. */ - if (IN_CAPABILITY_MODE(td)) { - switch (uap->op) { - case ARM_SYNC_ICACHE: - case ARM_DRAIN_WRITEBUF: - case ARM_SET_TP: - case ARM_GET_TP: - case ARM_GET_VFPSTATE: - break; - - default: -#ifdef KTRACE - if (KTRPOINT(td, KTR_CAPFAIL)) - ktrcapfail(CAPFAIL_SYSCALL, NULL, NULL); -#endif + switch (uap->op) { + case ARM_SYNC_ICACHE: + case ARM_DRAIN_WRITEBUF: + case ARM_SET_TP: + case ARM_GET_TP: + case ARM_GET_VFPSTATE: + break; + + default: + if (CAP_TRACING(td)) + ktrcapfail(CAPFAIL_SYSCALL, &uap->op); + if (IN_CAPABILITY_MODE(td)) return (ECAPMODE); - } } #endif diff --git a/sys/i386/i386/sys_machdep.c b/sys/i386/i386/sys_machdep.c index 1634041daf2a..3a7b7c2f6c71 100644 --- a/sys/i386/i386/sys_machdep.c +++ b/sys/i386/i386/sys_machdep.c @@ -154,26 +154,24 @@ sysarch(struct thread *td, struct sysarch_args *uap) * explicitly indicate whether or not the operation is safe to * perform in capability mode. */ - if (IN_CAPABILITY_MODE(td)) { - switch (uap->op) { - case I386_GET_LDT: - case I386_SET_LDT: - case I386_GET_IOPERM: - case I386_GET_FSBASE: - case I386_SET_FSBASE: - case I386_GET_GSBASE: - case I386_SET_GSBASE: - case I386_GET_XFPUSTATE: - break; + switch (uap->op) { + case I386_GET_LDT: + case I386_SET_LDT: + case I386_GET_IOPERM: + case I386_GET_FSBASE: + case I386_SET_FSBASE: + case I386_GET_GSBASE: + case I386_SET_GSBASE: + case I386_GET_XFPUSTATE: + break; - case I386_SET_IOPERM: - default: -#ifdef KTRACE - if (KTRPOINT(td, KTR_CAPFAIL)) - ktrcapfail(CAPFAIL_SYSCALL, NULL, NULL); -#endif + case I386_SET_IOPERM: + default: + if (CAP_TRACING(td)) + ktrcapfail(CAPFAIL_SYSCALL, &uap->op); + if (IN_CAPABILITY_MODE(td)) return (ECAPMODE); - } + break; } #endif diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 30d82f74d725..b72ae27e2a0b 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -877,6 +877,8 @@ revert_f_setfl: case F_KINFO: #ifdef CAPABILITY_MODE + if (CAP_TRACING(td)) + ktrcapfail(CAPFAIL_SYSCALL, &cmd); if (IN_CAPABILITY_MODE(td)) { error = ECAPMODE; break; diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 2f2ec7edfb12..b1860bf23cf2 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -2690,10 +2690,16 @@ ptrace_syscallreq(struct thread *td, struct proc *p, &td->td_proc->p_cowgen))) thread_cow_update(td); + td->td_sa = tsr->ts_sa; + #ifdef CAPABILITY_MODE - if (IN_CAPABILITY_MODE(td) && (se->sy_flags & SYF_CAPENABLED) == 0) { - tsr->ts_ret.sr_error = ECAPMODE; - return; + if ((se->sy_flags & SYF_CAPENABLED) == 0) { + if (CAP_TRACING(td)) + ktrcapfail(CAPFAIL_SYSCALL, NULL); + if (IN_CAPABILITY_MODE(td)) { + tsr->ts_ret.sr_error = ECAPMODE; + return; + } } #endif diff --git a/sys/kern/subr_syscall.c b/sys/kern/subr_syscall.c index ff13672501b2..725467e1215f 100644 --- a/sys/kern/subr_syscall.c +++ b/sys/kern/subr_syscall.c @@ -120,10 +120,13 @@ syscallenter(struct thread *td) * In capability mode, we only allow access to system calls * flagged with SYF_CAPENABLED. */ - if (__predict_false(IN_CAPABILITY_MODE(td) && - (se->sy_flags & SYF_CAPENABLED) == 0)) { - td->td_errno = error = ECAPMODE; - goto retval; + if ((se->sy_flags & SYF_CAPENABLED) == 0) { + if (CAP_TRACING(td)) + ktrcapfail(CAPFAIL_SYSCALL, NULL); + if (IN_CAPABILITY_MODE(td)) { + td->td_errno = error = ECAPMODE; + goto retval; + } } #endif From nobody Sun May 12 00:08:29 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VcNHx5hb0z5JbZh; Sun, 12 May 2024 00:08: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 4VcNHx46THz4sjk; Sun, 12 May 2024 00:08:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715472509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+tCjWBMDLeYRJyOSrR0s74hKQJuwtjmA3kZbxRsG30I=; b=NwFFclDm2qLUqUu+Hh2Zai9R9zynGeJtTGOm7u7ALAu6m12LuKyqSLjJ0qA+d9pJxYjjoz mtECjEoiyrPhbx7aIf+9A0Cfi5Kp/ljJXexGnZFckAEqACOZP3HiVhdSOEQ6fv5lOzQrRI n5X472BlcWbCt/nZVYR1CSDQ79SuvMzB0D4pPQXrxkXL6hwPlE0VWzr4W6w5E7ZAasTeZM CUpfe8FVve9/VIKVqfQ/kkRmVtg+aapoV3z5gCG8sraSIzKCMrUcOQi/HGp8YgBAR8Fw/0 CTdgfQXOVVGmL1MgHWJJqEEVuygagZVtHncgIJFTus4PilOGGEr6T783xak5mw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715472509; a=rsa-sha256; cv=none; b=p40/2ZjN/0mCuI4Kz0YQM1iOTLAhz0dOuub+LY2Q4vgyqJ1dlE0Sb0e0JVwuFC/P2l0rpq 4WmrWhCbghqOkMw1RWA70D2pdGx96ASrjq7BquJ8r95JkMu7Qd+hFV/PuHZJtknrchDc6X p59cSR8GFa/0vmAxfNsjeWt/OiSPY79kXUW8hrzlwdSpwar3Cc7+U0nfM3UAVFXqYXFLV3 pVa9abaIbgdjN4rUo+yO0bEFn+3ewYPRUDa8dmekBXCYgFvRL82YnOjFWUHYC2RKqbDI01 VU77q+ePJRi8GO169ut6w/WDbm8RFOh0gjbxbHtzxv5vWPiovw4O7kGeXf24MA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715472509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+tCjWBMDLeYRJyOSrR0s74hKQJuwtjmA3kZbxRsG30I=; b=HhYuYk1FEdTc0sbC6uIXAiGyKPFhWwXFRDPUUPwmhemxsbeGN/iig6/yJdmcl84TF51FLu ArFpEO6IIDdWESar0Jxzzy4NPWPO+UWdLKLb9rW0/crESUudHYKiiJV0fSQPZACXlNlzzY BvRsIk3RpaHPNUI5t44VKkNENwXG4Fa4vmGj1xp5hkvOzn8Rj3g47AOsmueTCciz2zukWp l3r/Qk3fPCfsetKs/IMGSmA6ufO3ETaZ6kCrrtymBqv5dO16XCwv+bydak2Sljlc9aGjKH vESoq3xDWjoT0qaFdzWn75Yd4xXZyOOroUqrGT44toyvlJpLNabs2qR0Ec6h8g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VcNHx3XWzzhWH; Sun, 12 May 2024 00:08:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44C08TbJ001880; Sun, 12 May 2024 00:08:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44C08ToO001877; Sun, 12 May 2024 00:08:29 GMT (envelope-from git) Date: Sun, 12 May 2024 00:08:29 GMT Message-Id: <202405120008.44C08ToO001877@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jake Freeland Subject: git: 109b7712c3cb - stable/14 - ktrace: Record signal violations with KTR_CAPFAIL List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jfree X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 109b7712c3cbf2746b75f334abc75c39c32bc0b0 Auto-Submitted: auto-generated The branch stable/14 has been updated by jfree: URL: https://cgit.FreeBSD.org/src/commit/?id=109b7712c3cbf2746b75f334abc75c39c32bc0b0 commit 109b7712c3cbf2746b75f334abc75c39c32bc0b0 Author: Jake Freeland AuthorDate: 2024-04-06 18:31:21 +0000 Commit: Jake Freeland CommitDate: 2024-05-11 23:57:44 +0000 ktrace: Record signal violations with KTR_CAPFAIL Report the delivery of signals to processes other than self while Capsicum violation tracing with CAPFAIL_SIGNAL. Reviewed by: markj Approved by: markj (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D40679 (cherry picked from commit 6a4616a529c1e387d87376e48ceb670eef8141e7) --- sys/kern/kern_procctl.c | 4 ++++ sys/kern/kern_sig.c | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c index 9e860e7c80a5..23b3403fec4f 100644 --- a/sys/kern/kern_procctl.c +++ b/sys/kern/kern_procctl.c @@ -28,6 +28,8 @@ */ #include +#include "opt_ktrace.h" + #include #include #include @@ -543,6 +545,8 @@ reap_kill(struct thread *td, struct proc *p, void *data) rk = data; sx_assert(&proctree_lock, SX_LOCKED); + if (CAP_TRACING(td)) + ktrcapfail(CAPFAIL_SIGNAL, &rk->rk_sig); if (IN_CAPABILITY_MODE(td)) return (ECAPMODE); if (rk->rk_sig <= 0 || rk->rk_sig > _SIG_MAXSIG || diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index b1860bf23cf2..802231767762 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1907,8 +1907,12 @@ kern_kill(struct thread *td, pid_t pid, int signum) * The main rationale behind this is that abort(3) is implemented as * kill(getpid(), SIGABRT). */ - if (IN_CAPABILITY_MODE(td) && pid != td->td_proc->p_pid) - return (ECAPMODE); + if (pid != td->td_proc->p_pid) { + if (CAP_TRACING(td)) + ktrcapfail(CAPFAIL_SIGNAL, &signum); + if (IN_CAPABILITY_MODE(td)) + return (ECAPMODE); + } AUDIT_ARG_SIGNUM(signum); AUDIT_ARG_PID(pid); From nobody Sun May 12 00:08:30 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VcNHy6Xmxz5JbSM; Sun, 12 May 2024 00:08:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VcNHy5Ctvz4t3d; Sun, 12 May 2024 00:08:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715472510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/kNctikN54pIrIkzLSgQy56ZAjYrLbeafftMdYd0+I0=; b=vm+xOszD5ZGXvR46TGiaSiUDsV0bD7EEmkTPcj6NE4izYz2n7FvZ3t55opd/i2Nnp36l7/ 7EWWC3uMBVUzYq0RIGjgU511Ib7WKiLdt3QF6yRIuRpURpToGjVdWt+CEVkK0BIrKpq7GB 8ShDLtPDIlrrwEltz3oAfRt5pCSEspy4FDRK4DebNITRJ5EO9ER04l5qCMaDa7FOb5IlRU fWzk6KwWXFMHAx6bSksPbk8PFxshjvlpjkDTDFaYGwp0bpZj/e4GNz3VtVcQiOU1ejwYUu ITrbYl1oB+xFZNcsoWIOmUtjMwclsUOkSBbx5CaChyiOGImdnNCgdjiT0TBMUA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715472510; a=rsa-sha256; cv=none; b=leoc6PTHanCooYlVdtaQKTDPgi+QaiCJL2tPA4lzQ5GgmM9hRno8yykaLc1ev0Y53XxLMK dVOp24OIMWkT4obJno3JqOuFeVkVExqzGyXiEkWSQtUqBV9TaTbZPhTxco5OJH3Q1kogPE kN3oihmZK+3+oi68jyopszyMiAXPDdwi1i2yOimHqW8xH3gbZg1zbYo7u3Z/P6dUTypMTF h77JSDdgzth+vACoGv3o49yEoRpVWi3XiXCCqerSBmT03Rmdm1Hewo08/elI/5eWAmKSCq 3psZaW9ldjlFILga32dPFKHLcA3pWN7G8xv3XVJQkPtcDfkSWNG6IIIEVQxRgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715472510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/kNctikN54pIrIkzLSgQy56ZAjYrLbeafftMdYd0+I0=; b=U7vaOVsKwn8sdRgHUG1X1S5dLVezelM5/vbFGiLKHfHfFrZlrEQBS+dANgeoPU4GQFZb3g PpZqLqX8lMDBcDFjpNpoYHHMWie8XUcGDyKK9gOGIEhnRnHpr5N21IqH0LZKzIhcnngSK3 MSOZ7bN3SiXlY37pCXENNzYhHHX/mx52d327Nl0i4AMDJgbuAWA69pkMo6NaBiWu1cNYqW bEZQ2zwVe2iV3yMZIKvO7CELSl1wDfc9Ri04e9yInthUUM8pDspz05c8PHr4KjaagHVvHe kOZlHr5vyMxWNR+5ybdAN7imV65p1nwaVZ4ShXhHvVQVHqoAfMDO0HKaj2ee0Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VcNHy4XjTzhTw; Sun, 12 May 2024 00:08:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44C08UCI001940; Sun, 12 May 2024 00:08:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44C08UUp001937; Sun, 12 May 2024 00:08:30 GMT (envelope-from git) Date: Sun, 12 May 2024 00:08:30 GMT Message-Id: <202405120008.44C08UUp001937@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jake Freeland Subject: git: 6d2a673f7ec5 - stable/14 - ktrace: Record namei violations with KTR_CAPFAIL List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jfree X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6d2a673f7ec5d337c5af253f54a614ac6176f89f Auto-Submitted: auto-generated The branch stable/14 has been updated by jfree: URL: https://cgit.FreeBSD.org/src/commit/?id=6d2a673f7ec5d337c5af253f54a614ac6176f89f commit 6d2a673f7ec5d337c5af253f54a614ac6176f89f Author: Jake Freeland AuthorDate: 2024-04-06 18:31:25 +0000 Commit: Jake Freeland CommitDate: 2024-05-11 23:57:44 +0000 ktrace: Record namei violations with KTR_CAPFAIL Report namei path lookups while Capsicum violation tracing with CAPFAIL_NAMEI. vfs caching is also ignored when tracing to mimic capability mode behavior. Reviewed by: markj Approved by: markj (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D40680 (cherry picked from commit 0cd9cde767c32780df9abee7ba9d2a8a51536728) --- sys/kern/kern_descrip.c | 4 +-- sys/kern/kern_exec.c | 2 ++ sys/kern/uipc_shm.c | 8 +++-- sys/kern/uipc_syscalls.c | 16 ++++++--- sys/kern/vfs_cache.c | 2 +- sys/kern/vfs_lookup.c | 90 ++++++++++++++++++++++++++---------------------- sys/sys/namei.h | 11 +++++- 7 files changed, 81 insertions(+), 52 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index b72ae27e2a0b..35e9afea4625 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -3056,7 +3056,7 @@ fgetvp_lookup_smr(struct nameidata *ndp, struct vnode **vpp, bool *fsearch) ndp->ni_filecaps.fc_fcntls != CAP_FCNTL_ALL || ndp->ni_filecaps.fc_nioctls != -1) { #ifdef notyet - ndp->ni_lcf |= NI_LCF_STRICTRELATIVE; + ndp->ni_lcf |= NI_LCF_STRICTREL; #else return (EAGAIN); #endif @@ -3148,7 +3148,7 @@ fgetvp_lookup(struct nameidata *ndp, struct vnode **vpp) if (!cap_rights_contains(&ndp->ni_filecaps.fc_rights, &rights) || ndp->ni_filecaps.fc_fcntls != CAP_FCNTL_ALL || ndp->ni_filecaps.fc_nioctls != -1) { - ndp->ni_lcf |= NI_LCF_STRICTRELATIVE; + ndp->ni_lcf |= NI_LCF_STRICTREL; ndp->ni_resflags |= NIRES_STRICTREL; } #endif diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index ae2b624c2659..6727872b5b10 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -454,6 +454,8 @@ do_execve(struct thread *td, struct image_args *args, struct mac *mac_p, interpret: if (args->fname != NULL) { #ifdef CAPABILITY_MODE + if (CAP_TRACING(td)) + ktrcapfail(CAPFAIL_NAMEI, args->fname); /* * While capability mode can't reach this point via direct * path arguments to execve(), we also don't allow diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c index 1b9434aa438c..613656ca0a5a 100644 --- a/sys/kern/uipc_shm.c +++ b/sys/kern/uipc_shm.c @@ -1176,8 +1176,12 @@ kern_shm_open2(struct thread *td, const char *userpath, int flags, mode_t mode, /* * shm_open(2) is only allowed for anonymous objects. */ - if (IN_CAPABILITY_MODE(td) && (userpath != SHM_ANON)) - return (ECAPMODE); + if (userpath != SHM_ANON) { + if (CAP_TRACING(td)) + ktrcapfail(CAPFAIL_NAMEI, userpath); + if (IN_CAPABILITY_MODE(td)) + return (ECAPMODE); + } #endif AUDIT_ARG_FFLAGS(flags); diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 85b2214eaeb9..70a7ebbee4ed 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -201,8 +201,12 @@ kern_bindat(struct thread *td, int dirfd, int fd, struct sockaddr *sa) int error; #ifdef CAPABILITY_MODE - if (IN_CAPABILITY_MODE(td) && (dirfd == AT_FDCWD)) - return (ECAPMODE); + if (dirfd == AT_FDCWD) { + if (CAP_TRACING(td)) + ktrcapfail(CAPFAIL_NAMEI, "AT_FDCWD"); + if (IN_CAPABILITY_MODE(td)) + return (ECAPMODE); + } #endif AUDIT_ARG_FD(fd); @@ -487,8 +491,12 @@ kern_connectat(struct thread *td, int dirfd, int fd, struct sockaddr *sa) int error; #ifdef CAPABILITY_MODE - if (IN_CAPABILITY_MODE(td) && (dirfd == AT_FDCWD)) - return (ECAPMODE); + if (dirfd == AT_FDCWD) { + if (CAP_TRACING(td)) + ktrcapfail(CAPFAIL_NAMEI, "AT_FDCWD"); + if (IN_CAPABILITY_MODE(td)) + return (ECAPMODE); + } #endif AUDIT_ARG_FD(fd); diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index e3ab80f94482..70c4dbc01c98 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -4396,7 +4396,7 @@ cache_can_fplookup(struct cache_fpl *fpl) cache_fpl_aborted_early(fpl); return (false); } - if (IN_CAPABILITY_MODE(td)) { + if (IN_CAPABILITY_MODE(td) || CAP_TRACING(td)) { cache_fpl_aborted_early(fpl); return (false); } diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 6c83746eaf8b..600af6d486eb 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -238,14 +238,17 @@ nameicap_check_dotdot(struct nameidata *ndp, struct vnode *dp) struct mount *mp; if (dp == NULL || dp->v_type != VDIR || (ndp->ni_lcf & - NI_LCF_STRICTRELATIVE) == 0) + NI_LCF_STRICTREL) == 0) return (0); + if (__predict_false((ndp->ni_lcf & (NI_LCF_STRICTREL_KTR | + NI_LCF_CAP_DOTDOT_KTR)) == NI_LCF_STRICTREL_KTR)) + NI_CAP_VIOLATION(ndp, ndp->ni_cnd.cn_pnbuf); if ((ndp->ni_lcf & NI_LCF_CAP_DOTDOT) == 0) return (ENOTCAPABLE); mp = dp->v_mount; if (lookup_cap_dotdot_nonlocal == 0 && mp != NULL && (mp->mnt_flag & MNT_LOCAL) == 0) - return (ENOTCAPABLE); + goto capfail; TAILQ_FOREACH_REVERSE(nt, &ndp->ni_cap_tracker, nameicap_tracker_head, nm_link) { if (dp == nt->dp) { @@ -255,6 +258,10 @@ nameicap_check_dotdot(struct nameidata *ndp, struct vnode *dp) return (0); } } + +capfail: + if (__predict_false((ndp->ni_lcf & NI_LCF_STRICTREL_KTR) != 0)) + NI_CAP_VIOLATION(ndp, ndp->ni_cnd.cn_pnbuf); return (ENOTCAPABLE); } @@ -273,12 +280,12 @@ namei_handle_root(struct nameidata *ndp, struct vnode **dpp) struct componentname *cnp; cnp = &ndp->ni_cnd; - if ((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) != 0) { -#ifdef KTRACE - if (KTRPOINT(curthread, KTR_CAPFAIL)) - ktrcapfail(CAPFAIL_LOOKUP, NULL, NULL); -#endif - return (ENOTCAPABLE); + if (__predict_false((ndp->ni_lcf & (NI_LCF_STRICTREL | + NI_LCF_STRICTREL_KTR)) != 0)) { + if ((ndp->ni_lcf & NI_LCF_STRICTREL_KTR) != 0) + NI_CAP_VIOLATION(ndp, cnp->cn_pnbuf); + if ((ndp->ni_lcf & NI_LCF_STRICTREL) != 0) + return (ENOTCAPABLE); } while (*(cnp->cn_nameptr) == '/') { cnp->cn_nameptr++; @@ -319,15 +326,17 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp, struct pwd **pwdp) * previously walked by us, which prevents an escape from * the relative root. */ - if (IN_CAPABILITY_MODE(td) && (cnp->cn_flags & NOCAPCHECK) == 0) { - ndp->ni_lcf |= NI_LCF_STRICTRELATIVE; - ndp->ni_resflags |= NIRES_STRICTREL; - if (ndp->ni_dirfd == AT_FDCWD) { -#ifdef KTRACE - if (KTRPOINT(td, KTR_CAPFAIL)) - ktrcapfail(CAPFAIL_LOOKUP, NULL, NULL); -#endif - return (ECAPMODE); + if ((cnp->cn_flags & NOCAPCHECK) == 0) { + if (CAP_TRACING(td)) { + ndp->ni_lcf |= NI_LCF_STRICTREL_KTR; + if (ndp->ni_dirfd == AT_FDCWD) + NI_CAP_VIOLATION(ndp, "AT_FDCWD"); + } + if (IN_CAPABILITY_MODE(td)) { + ndp->ni_lcf |= NI_LCF_STRICTREL; + ndp->ni_resflags |= NIRES_STRICTREL; + if (ndp->ni_dirfd == AT_FDCWD) + return (ECAPMODE); } } #endif @@ -370,8 +379,8 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp, struct pwd **pwdp) if (error == 0 && (cnp->cn_flags & RBENEATH) != 0) { if (cnp->cn_pnbuf[0] == '/') { error = ENOTCAPABLE; - } else if ((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) == 0) { - ndp->ni_lcf |= NI_LCF_STRICTRELATIVE | + } else if ((ndp->ni_lcf & NI_LCF_STRICTREL) == 0) { + ndp->ni_lcf |= NI_LCF_STRICTREL | NI_LCF_CAP_DOTDOT; } } @@ -393,9 +402,12 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp, struct pwd **pwdp) pwd_drop(pwd); return (error); } - if ((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) != 0 && - lookup_cap_dotdot != 0) - ndp->ni_lcf |= NI_LCF_CAP_DOTDOT; + if (lookup_cap_dotdot != 0) { + if ((ndp->ni_lcf & NI_LCF_STRICTREL_KTR) != 0) + ndp->ni_lcf |= NI_LCF_CAP_DOTDOT_KTR; + if ((ndp->ni_lcf & NI_LCF_STRICTREL) != 0) + ndp->ni_lcf |= NI_LCF_CAP_DOTDOT; + } SDT_PROBE4(vfs, namei, lookup, entry, *dpp, cnp->cn_pnbuf, cnp->cn_flags, false); *pwdp = pwd; @@ -1170,12 +1182,11 @@ dirloop: * result of dotdot lookup. */ if (cnp->cn_flags & ISDOTDOT) { - if ((ndp->ni_lcf & (NI_LCF_STRICTRELATIVE | NI_LCF_CAP_DOTDOT)) - == NI_LCF_STRICTRELATIVE) { -#ifdef KTRACE - if (KTRPOINT(curthread, KTR_CAPFAIL)) - ktrcapfail(CAPFAIL_LOOKUP, NULL, NULL); -#endif + if (__predict_false((ndp->ni_lcf & (NI_LCF_STRICTREL_KTR | + NI_LCF_CAP_DOTDOT_KTR)) == NI_LCF_STRICTREL_KTR)) + NI_CAP_VIOLATION(ndp, cnp->cn_pnbuf); + if (__predict_false((ndp->ni_lcf & (NI_LCF_STRICTREL | + NI_LCF_CAP_DOTDOT)) == NI_LCF_STRICTREL)) { error = ENOTCAPABLE; goto bad; } @@ -1192,10 +1203,14 @@ dirloop: bool isroot = dp == ndp->ni_rootdir || dp == ndp->ni_topdir || dp == rootvnode || pr != NULL; - if (isroot && (ndp->ni_lcf & - NI_LCF_STRICTRELATIVE) != 0) { - error = ENOTCAPABLE; - goto capdotdot; + if (__predict_false(isroot && (ndp->ni_lcf & + (NI_LCF_STRICTREL | NI_LCF_STRICTREL_KTR)) != 0)) { + if ((ndp->ni_lcf & NI_LCF_STRICTREL_KTR) != 0) + NI_CAP_VIOLATION(ndp, cnp->cn_pnbuf); + if ((ndp->ni_lcf & NI_LCF_STRICTREL) != 0) { + error = ENOTCAPABLE; + goto capdotdot; + } } if (isroot || ((dp->v_vflag & VV_ROOT) != 0 && (cnp->cn_flags & NOCROSSMOUNT) != 0)) { @@ -1220,10 +1235,6 @@ dirloop: error = nameicap_check_dotdot(ndp, dp); if (error != 0) { capdotdot: -#ifdef KTRACE - if (KTRPOINT(curthread, KTR_CAPFAIL)) - ktrcapfail(CAPFAIL_LOOKUP, NULL, NULL); -#endif goto bad; } } @@ -1376,13 +1387,8 @@ nextname: } if (cnp->cn_flags & ISDOTDOT) { error = nameicap_check_dotdot(ndp, ndp->ni_vp); - if (error != 0) { -#ifdef KTRACE - if (KTRPOINT(curthread, KTR_CAPFAIL)) - ktrcapfail(CAPFAIL_LOOKUP, NULL, NULL); -#endif + if (error != 0) goto bad2; - } } if (*ndp->ni_next == '/') { cnp->cn_nameptr = ndp->ni_next; diff --git a/sys/sys/namei.h b/sys/sys/namei.h index 8ffa87aa3d7e..d464423c025c 100644 --- a/sys/sys/namei.h +++ b/sys/sys/namei.h @@ -198,8 +198,17 @@ int cache_fplookup(struct nameidata *ndp, enum cache_fpl_status *status, /* * Flags in ni_lcf, valid for the duration of the namei call. */ -#define NI_LCF_STRICTRELATIVE 0x0001 /* relative lookup only */ +#define NI_LCF_STRICTREL 0x0001 /* relative lookup only */ #define NI_LCF_CAP_DOTDOT 0x0002 /* ".." in strictrelative case */ +/* Track capability restrictions seperately for violation ktracing. */ +#define NI_LCF_STRICTREL_KTR 0x0004 /* trace relative lookups */ +#define NI_LCF_CAP_DOTDOT_KTR 0x0008 /* ".." in strictrelative case */ +#define NI_LCF_KTR_FLAGS (NI_LCF_STRICTREL_KTR | NI_LCF_CAP_DOTDOT_KTR) + +#define NI_CAP_VIOLATION(ndp, path) do { \ + ktrcapfail(CAPFAIL_NAMEI, (path)); \ + (ndp)->ni_lcf &= ~NI_LCF_KTR_FLAGS; \ +} while (0) /* * Initialization of a nameidata structure. From nobody Sun May 12 00:08:32 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VcNJ11Lxpz5JbZx; Sun, 12 May 2024 00:08: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 4VcNJ074FXz4syf; Sun, 12 May 2024 00:08:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715472513; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BrjX8yH+alxBUdZqxbO4QeX8RO7Q1gMzUw5R5FGlYbY=; b=nu3AUwr5ocvAIqnMLf3vJ0CBwqcIpu/8+iKErmmc+g6ez9iGclIjjHV7Ts6EZLQLc4Q6Uf sV6apArx2erSKHouf3ye8yaLgrKr5EGI3EgR/3kAI7E3cmmdt3aDR87JMPDUJ3QmNAE2H3 IJ5px/Eu6DUzeFSmH9UkRVVMHO3IXnUKRXP+OHdcEEz8f4+T+L866y7dTXrd66Jjw1jxjs 612WY2bAh2DgNiSFudIUYocMZgboQ1Q79yUys2HIg1dX+TsLfPFptDyZOMV///tjSbZBBC Tac2F4mtpBdiqtAKJZcHWM9LHB2g75MM6uU42f0kbp/JfE+y+QZSmZ7Tyq/gEg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715472513; a=rsa-sha256; cv=none; b=pnD2VkYFWK+CPtLo26D0KXQ4z0Se6RlCgabp7/5kd9FoOTSQol367fwBH+tkOI4Y/kzi/C sun9hghxsUm6+xZLFyu1V7sbWkfmUWpDd91YJA30MUe+KEk9BAicHv6YJSMY//XO9ukJDO cPN0xYgTHOCoa4/dfH/gK7OEVp0Skyxj8lgVnyuD+zh9fiQxt6HOsHR1omGkycwteYYu5O WhQV8q0aEQhIjZkFfMrWt34keqodE5cgylkIni9Xi76rlumKO4yFD8M1hhPWU9KWjPBYUf NkJEYrO1/qeLedCLPgLoROAH0l6JWSeNJxHn78kJQaE+ps0b6GYhKWlJZo/Irw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715472513; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BrjX8yH+alxBUdZqxbO4QeX8RO7Q1gMzUw5R5FGlYbY=; b=OKF4rqX6RbKrHBjDcRUv7kZUV7YLv8VF8HZsrwzF57LdHrI15D9CwIcAGk7G+n0zQUyrfC HqUy69g+Q3O+c8CIVGbwkWNuzDcuM8RkqOFzd2QjtbLDL2Ltar7s6kCBxPccQaDSFChZdJ 4mFzCRNLhyMZ780pt2/UQ1mpfz/MtBSC107HN3Kc1GZvm079DX2DucaQ7exxqRA5K5USzx 0GzfK9vbvaNyKpb5kDB83m1GAmfP35HDBcuyK7zrWt+GGEQEdpB0CDHqHsizOX+o08/uup 40HUIn0Y3SuH7QcaSoPmJE6bKuvHQovPK7uNZMuYx7yBqZv2xHhjAhLN/Ekmdw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VcNJ062JQzhsG; Sun, 12 May 2024 00:08:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44C08Wwk002036; Sun, 12 May 2024 00:08:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44C08WV2002033; Sun, 12 May 2024 00:08:32 GMT (envelope-from git) Date: Sun, 12 May 2024 00:08:32 GMT Message-Id: <202405120008.44C08WV2002033@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jake Freeland Subject: git: 44952722a00b - stable/14 - tests: Add ktrace capability violation test cases List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jfree X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 44952722a00b92ae42752428f0d6a673b1af8f82 Auto-Submitted: auto-generated The branch stable/14 has been updated by jfree: URL: https://cgit.FreeBSD.org/src/commit/?id=44952722a00b92ae42752428f0d6a673b1af8f82 commit 44952722a00b92ae42752428f0d6a673b1af8f82 Author: Jake Freeland AuthorDate: 2024-04-06 18:31:30 +0000 Commit: Jake Freeland CommitDate: 2024-05-11 23:57:44 +0000 tests: Add ktrace capability violation test cases Introduce regression tests for ktrace(2) that target capability violations. These test cases ensure that ktrace(2) records these violations: - CAPFAIL_NOTCAPABLE - CAPFAIL_INCREASE - CAPFAIL_SYSCALL - CAPFAIL_SIGNAL - CAPFAIL_PROTO - CAPFAIL_SOCKADDR - CAPFAIL_NAMEI - CAPFAIL_CPUSET A portion of these test cases create processes that do NOT enter capability mode, but raise violations. This is intended behavior. Users may run `ktrace -t p` on non-Capsicumized programs to detect violations that would occur if the process were in capability mode. Reviewed by: markj Approved by: markj (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D40682 (cherry picked from commit 2f39a986641ecebaa9080ca28118903bd9707a1f) --- tests/sys/kern/Makefile | 2 + tests/sys/kern/ktrace_test.c | 488 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 490 insertions(+) diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile index b95be12d9665..d78c761feaac 100644 --- a/tests/sys/kern/Makefile +++ b/tests/sys/kern/Makefile @@ -21,6 +21,7 @@ ATF_TESTS_C+= kill_zombie .if ${MK_OPENSSL} != "no" ATF_TESTS_C+= ktls_test .endif +ATF_TESTS_C+= ktrace_test ATF_TESTS_C+= module_test ATF_TESTS_C+= ptrace_test TEST_METADATA.ptrace_test+= timeout="15" @@ -79,6 +80,7 @@ LIBADD.socket_msg_waitall+= pthread LIBADD.sendfile_helper+= pthread LIBADD.fdgrowtable_test+= util pthread kvm procstat LIBADD.sigwait+= rt +LIBADD.ktrace_test+= sysdecode NETBSD_ATF_TESTS_C+= lockf_test NETBSD_ATF_TESTS_C+= mqueue_test diff --git a/tests/sys/kern/ktrace_test.c b/tests/sys/kern/ktrace_test.c new file mode 100644 index 000000000000..49e2ed05fed9 --- /dev/null +++ b/tests/sys/kern/ktrace_test.c @@ -0,0 +1,488 @@ +/*- + * Copyright (c) 2015 John Baldwin + * Copyright (c) 2023 The FreeBSD Foundation + * + * This software was developed by Jake Freeland + * 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. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +/* + * A variant of ATF_REQUIRE that is suitable for use in child + * processes. This only works if the parent process is tripped up by + * the early exit and fails some requirement itself. + */ +#define CHILD_REQUIRE(exp) do { \ + if (!(exp)) \ + child_fail_require(__FILE__, __LINE__, \ + #exp " not met\n"); \ +} while (0) +#define CHILD_REQUIRE_EQ(actual, expected) do { \ + __typeof__(expected) _e = expected; \ + __typeof__(actual) _a = actual; \ + if (_e != _a) \ + child_fail_require(__FILE__, __LINE__, #actual \ + " (%jd) == " #expected " (%jd) not met\n", \ + (intmax_t)_a, (intmax_t)_e); \ +} while (0) + +static __dead2 void +child_fail_require(const char *file, int line, const char *fmt, ...) +{ + va_list ap; + char buf[1024]; + + /* Use write() not fprintf() to avoid possible duplicate output. */ + snprintf(buf, sizeof(buf), "%s:%d: ", file, line); + write(STDERR_FILENO, buf, strlen(buf)); + va_start(ap, fmt); + vsnprintf(buf, sizeof(buf), fmt, ap); + write(STDERR_FILENO, buf, strlen(buf)); + va_end(ap); + + _exit(32); +} + +/* + * Determine sysdecode ABI based on proc's ABI in sv_flags. + */ +static enum sysdecode_abi +syscallabi(u_int sv_flags) +{ + switch (sv_flags & SV_ABI_MASK) { + case SV_ABI_FREEBSD: + return (SYSDECODE_ABI_FREEBSD); + case SV_ABI_LINUX: +#ifdef __LP64__ + if ((sv_flags & SV_ILP32) != 0) + return (SYSDECODE_ABI_LINUX32); +#endif + return (SYSDECODE_ABI_LINUX); + } + return (SYSDECODE_ABI_UNKNOWN); +} + +/* + * Start tracing capability violations and notify child that it can execute. + * Return @numv capability violations from child in @v. + */ +static void +cap_trace_child(int cpid, struct ktr_cap_fail *v, int numv) +{ + struct ktr_header header; + int error, fd, i; + + ATF_REQUIRE((fd = open("ktrace.out", + O_RDONLY | O_CREAT | O_TRUNC)) != -1); + ATF_REQUIRE(ktrace("ktrace.out", KTROP_SET, + KTRFAC_CAPFAIL, cpid) != -1); + /* Notify child that we've starting tracing. */ + ATF_REQUIRE(kill(cpid, SIGUSR1) != -1); + /* Wait for child to raise violation and exit. */ + ATF_REQUIRE(waitpid(cpid, &error, 0) != -1); + ATF_REQUIRE(WIFEXITED(error)); + ATF_REQUIRE_EQ(WEXITSTATUS(error), 0); + /* Read ktrace header and ensure violation occurred. */ + for (i = 0; i < numv; ++i) { + ATF_REQUIRE((error = read(fd, &header, sizeof(header))) != -1); + ATF_REQUIRE_EQ(error, sizeof(header)); + ATF_REQUIRE_EQ(header.ktr_len, sizeof(*v)); + ATF_REQUIRE_EQ(header.ktr_pid, cpid); + /* Read the capability violation. */ + ATF_REQUIRE((error = read(fd, v + i, + sizeof(*v))) != -1); + ATF_REQUIRE_EQ(error, sizeof(*v)); + } + ATF_REQUIRE(close(fd) != -1); +} + +/* + * Test if ktrace will record an operation that is done with + * insufficient rights. + */ +ATF_TC_WITHOUT_HEAD(ktrace__cap_not_capable); +ATF_TC_BODY(ktrace__cap_not_capable, tc) +{ + struct ktr_cap_fail violation; + cap_rights_t rights; + sigset_t set = { }; + pid_t pid; + int error; + + /* Block SIGUSR1 so child does not terminate. */ + ATF_REQUIRE(sigaddset(&set, SIGUSR1) != -1); + ATF_REQUIRE(sigprocmask(SIG_BLOCK, &set, NULL) != -1); + + ATF_REQUIRE((pid = fork()) != -1); + if (pid == 0) { + /* Limit fd rights to CAP_READ. */ + cap_rights_init(&rights, CAP_READ); + CHILD_REQUIRE(caph_rights_limit(STDIN_FILENO, &rights) != -1); + CHILD_REQUIRE(caph_enter() != -1); + /* Wait until ktrace has started. */ + CHILD_REQUIRE(sigwait(&set, &error) != -1); + CHILD_REQUIRE_EQ(error, SIGUSR1); + /* Write without CAP_WRITE. */ + CHILD_REQUIRE(write(STDIN_FILENO, &pid, sizeof(pid)) == -1); + CHILD_REQUIRE_EQ(errno, ENOTCAPABLE); + exit(0); + } + + cap_trace_child(pid, &violation, 1); + ATF_REQUIRE_EQ(violation.cap_type, CAPFAIL_NOTCAPABLE); + ATF_REQUIRE(cap_rights_is_set(&violation.cap_data.cap_needed, + CAP_WRITE)); +} + +/* + * Test if ktrace will record an attempt to increase rights. + */ +ATF_TC_WITHOUT_HEAD(ktrace__cap_increase_rights); +ATF_TC_BODY(ktrace__cap_increase_rights, tc) +{ + struct ktr_cap_fail violation; + cap_rights_t rights; + sigset_t set = { }; + pid_t pid; + int error; + + /* Block SIGUSR1 so child does not terminate. */ + ATF_REQUIRE(sigaddset(&set, SIGUSR1) != -1); + ATF_REQUIRE(sigprocmask(SIG_BLOCK, &set, NULL) != -1); + + ATF_REQUIRE((pid = fork()) != -1); + if (pid == 0) { + /* Limit fd rights to CAP_READ. */ + cap_rights_init(&rights, CAP_READ); + CHILD_REQUIRE(caph_rights_limit(STDIN_FILENO, &rights) != -1); + CHILD_REQUIRE(caph_enter() != -1); + /* Wait until ktrace has started. */ + CHILD_REQUIRE(sigwait(&set, &error) != -1); + CHILD_REQUIRE_EQ(error, SIGUSR1); + /* Increase fd rights to include CAP_WRITE. */ + cap_rights_set(&rights, CAP_WRITE); + CHILD_REQUIRE(caph_rights_limit(STDIN_FILENO, &rights) == -1); + CHILD_REQUIRE_EQ(errno, ENOTCAPABLE); + exit(0); + } + + cap_trace_child(pid, &violation, 1); + ATF_REQUIRE_EQ(violation.cap_type, CAPFAIL_INCREASE); + ATF_REQUIRE(cap_rights_is_set(&violation.cap_data.cap_needed, + CAP_WRITE)); +} + +/* + * Test if disallowed syscalls are reported as capability violations. + */ +ATF_TC_WITHOUT_HEAD(ktrace__cap_syscall); +ATF_TC_BODY(ktrace__cap_syscall, tc) +{ + struct kinfo_file kinf; + struct ktr_cap_fail violation[2]; + sigset_t set = { }; + pid_t pid; + int error; + + /* Block SIGUSR1 so child does not terminate. */ + ATF_REQUIRE(sigaddset(&set, SIGUSR1) != -1); + ATF_REQUIRE(sigprocmask(SIG_BLOCK, &set, NULL) != -1); + + ATF_REQUIRE((pid = fork()) != -1); + if (pid == 0) { + /* Wait until ktrace has started. */ + CHILD_REQUIRE(sigwait(&set, &error) != -1); + CHILD_REQUIRE_EQ(error, SIGUSR1); + /* chdir() is not permitted in capability mode. */ + CHILD_REQUIRE(chdir(".") != -1); + kinf.kf_structsize = sizeof(struct kinfo_file); + /* + * fcntl() is permitted in capability mode, + * but the F_KINFO cmd is not. + */ + CHILD_REQUIRE(fcntl(STDIN_FILENO, F_KINFO, &kinf) != -1); + exit(0); + } + + cap_trace_child(pid, violation, 2); + ATF_REQUIRE_EQ(violation[0].cap_type, CAPFAIL_SYSCALL); + error = syscallabi(violation[0].cap_svflags); + ATF_REQUIRE_STREQ(sysdecode_syscallname(error, violation[0].cap_code), + "chdir"); + + ATF_REQUIRE_EQ(violation[1].cap_type, CAPFAIL_SYSCALL); + error = syscallabi(violation[1].cap_svflags); + ATF_REQUIRE_STREQ(sysdecode_syscallname(error, violation[1].cap_code), + "fcntl"); + ATF_REQUIRE_EQ(violation[1].cap_data.cap_int, F_KINFO); +} + +/* + * Test if sending a signal to another process is reported as + * a signal violation. + */ +ATF_TC_WITHOUT_HEAD(ktrace__cap_signal); +ATF_TC_BODY(ktrace__cap_signal, tc) +{ + struct ktr_cap_fail violation; + sigset_t set = { }; + pid_t pid; + int error; + + /* Block SIGUSR1 so child does not terminate. */ + ATF_REQUIRE(sigaddset(&set, SIGUSR1) != -1); + ATF_REQUIRE(sigprocmask(SIG_BLOCK, &set, NULL) != -1); + + ATF_REQUIRE((pid = fork()) != -1); + if (pid == 0) { + /* Wait until ktrace has started. */ + CHILD_REQUIRE(sigwait(&set, &error) != -1); + CHILD_REQUIRE_EQ(error, SIGUSR1); + /* + * Signals may only be sent to ourself. Sending signals + * to other processes is not allowed in capability mode. + */ + CHILD_REQUIRE(kill(getppid(), SIGCONT) != -1); + exit(0); + } + + cap_trace_child(pid, &violation, 1); + ATF_REQUIRE_EQ(violation.cap_type, CAPFAIL_SIGNAL); + error = syscallabi(violation.cap_svflags); + ATF_REQUIRE_STREQ(sysdecode_syscallname(error, violation.cap_code), + "kill"); + ATF_REQUIRE_EQ(violation.cap_data.cap_int, SIGCONT); +} + +/* + * Test if opening a socket with a restricted protocol is reported + * as a protocol violation. + */ +ATF_TC_WITHOUT_HEAD(ktrace__cap_proto); +ATF_TC_BODY(ktrace__cap_proto, tc) +{ + struct ktr_cap_fail violation; + sigset_t set = { }; + pid_t pid; + int error; + + /* Block SIGUSR1 so child does not terminate. */ + ATF_REQUIRE(sigaddset(&set, SIGUSR1) != -1); + ATF_REQUIRE(sigprocmask(SIG_BLOCK, &set, NULL) != -1); + + ATF_REQUIRE((pid = fork()) != -1); + if (pid == 0) { + /* Wait until ktrace has started. */ + CHILD_REQUIRE(sigwait(&set, &error) != -1); + CHILD_REQUIRE_EQ(error, SIGUSR1); + /* + * Certain protocols may not be used in capability mode. + * ICMP's raw-protocol interface is not allowed. + */ + CHILD_REQUIRE(close(socket(AF_INET, SOCK_RAW, + IPPROTO_ICMP)) != -1); + exit(0); + } + + cap_trace_child(pid, &violation, 1); + ATF_REQUIRE_EQ(violation.cap_type, CAPFAIL_PROTO); + error = syscallabi(violation.cap_svflags); + ATF_REQUIRE_STREQ(sysdecode_syscallname(error, violation.cap_code), + "socket"); + ATF_REQUIRE_EQ(violation.cap_data.cap_int, IPPROTO_ICMP); +} + +/* + * Test if sending data to an address using a socket is + * reported as a sockaddr violation. + */ +ATF_TC_WITHOUT_HEAD(ktrace__cap_sockaddr); +ATF_TC_BODY(ktrace__cap_sockaddr, tc) +{ + struct sockaddr_in addr = { }, *saddr; + struct ktr_cap_fail violation; + sigset_t set = { }; + pid_t pid; + int error, sfd; + + /* Block SIGUSR1 so child does not terminate. */ + ATF_REQUIRE(sigaddset(&set, SIGUSR1) != -1); + ATF_REQUIRE(sigprocmask(SIG_BLOCK, &set, NULL) != -1); + + CHILD_REQUIRE((sfd = socket(AF_INET, SOCK_DGRAM, + IPPROTO_UDP)) != -1); + addr.sin_family = AF_INET; + addr.sin_port = htons(5000); + addr.sin_addr.s_addr = INADDR_ANY; + CHILD_REQUIRE(bind(sfd, (const struct sockaddr *)&addr, + sizeof(addr)) != -1); + + ATF_REQUIRE((pid = fork()) != -1); + if (pid == 0) { + /* Wait until ktrace has started. */ + CHILD_REQUIRE(sigwait(&set, &error) != -1); + CHILD_REQUIRE_EQ(error, SIGUSR1); + /* + * Sending data to an address is not permitted. + * In this case, sending data to @addr causes a + * violation. + */ + CHILD_REQUIRE(sendto(sfd, NULL, 0, 0, + (const struct sockaddr *)&addr, sizeof(addr)) != -1); + exit(0); + } + + cap_trace_child(pid, &violation, 1); + ATF_REQUIRE_EQ(violation.cap_type, CAPFAIL_SOCKADDR); + error = syscallabi(violation.cap_svflags); + ATF_REQUIRE_STREQ(sysdecode_syscallname(error, violation.cap_code), + "sendto"); + saddr = (struct sockaddr_in *)&violation.cap_data.cap_sockaddr; + ATF_REQUIRE_EQ(saddr->sin_family, AF_INET); + ATF_REQUIRE_EQ(saddr->sin_port, htons(5000)); + ATF_REQUIRE_EQ(saddr->sin_addr.s_addr, INADDR_ANY); + close(sfd); +} + +/* + * Test if openat() with AT_FDCWD and absolute path are reported + * as namei violations. + */ +ATF_TC_WITHOUT_HEAD(ktrace__cap_namei); +ATF_TC_BODY(ktrace__cap_namei, tc) +{ + struct ktr_cap_fail violation[2]; + sigset_t set = { }; + pid_t pid; + int error; + + /* Block SIGUSR1 so child does not terminate. */ + ATF_REQUIRE(sigaddset(&set, SIGUSR1) != -1); + ATF_REQUIRE(sigprocmask(SIG_BLOCK, &set, NULL) != -1); + + ATF_REQUIRE((pid = fork()) != -1); + if (pid == 0) { + /* Wait until ktrace has started. */ + CHILD_REQUIRE(sigwait(&set, &error) != -1); + CHILD_REQUIRE_EQ(error, SIGUSR1); + /* + * The AT_FDCWD file descriptor has not been opened + * and will be inaccessible in capability mode. + */ + CHILD_REQUIRE(close(openat(AT_FDCWD, "ktrace.out", + O_RDONLY | O_CREAT)) != -1); + /* + * Absolute paths are inaccessible in capability mode. + */ + CHILD_REQUIRE(close(openat(-1, "/", O_RDONLY)) != -1); + exit(0); + } + + cap_trace_child(pid, violation, 2); + ATF_REQUIRE_EQ(violation[0].cap_type, CAPFAIL_NAMEI); + error = syscallabi(violation[0].cap_svflags); + ATF_REQUIRE_STREQ(sysdecode_syscallname(error, violation[0].cap_code), + "openat"); + ATF_REQUIRE_STREQ(violation[0].cap_data.cap_path, "AT_FDCWD"); + + ATF_REQUIRE_EQ(violation[1].cap_type, CAPFAIL_NAMEI); + error = syscallabi(violation[1].cap_svflags); + ATF_REQUIRE_STREQ(sysdecode_syscallname(error, violation[1].cap_code), + "openat"); + ATF_REQUIRE_STREQ(violation[1].cap_data.cap_path, "/"); +} + +/* + * Test if changing another process's cpu set is recorded as + * a cpuset violation. + */ +ATF_TC_WITHOUT_HEAD(ktrace__cap_cpuset); +ATF_TC_BODY(ktrace__cap_cpuset, tc) +{ + struct ktr_cap_fail violation; + cpuset_t cpuset_mask = { }; + sigset_t set = { }; + pid_t pid; + int error; + + /* Block SIGUSR1 so child does not terminate. */ + ATF_REQUIRE(sigaddset(&set, SIGUSR1) != -1); + ATF_REQUIRE(sigprocmask(SIG_BLOCK, &set, NULL) != -1); + + ATF_REQUIRE((pid = fork()) != -1); + if (pid == 0) { + /* Wait until ktrace has started. */ + CHILD_REQUIRE(sigwait(&set, &error) != -1); + CHILD_REQUIRE_EQ(error, SIGUSR1); + /* + * Set cpu 0 affinity for parent process. + * Other process's cpu sets are restricted in capability + * mode, so this will raise a violation. + */ + CPU_SET(0, &cpuset_mask); + CHILD_REQUIRE(cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, + getppid(), sizeof(cpuset_mask), &cpuset_mask) != -1); + exit(0); + } + + cap_trace_child(pid, &violation, 1); + ATF_REQUIRE_EQ(violation.cap_type, CAPFAIL_CPUSET); + error = syscallabi(violation.cap_svflags); + ATF_REQUIRE_STREQ(sysdecode_syscallname(error, violation.cap_code), + "cpuset_setaffinity"); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, ktrace__cap_not_capable); + ATF_TP_ADD_TC(tp, ktrace__cap_increase_rights); + ATF_TP_ADD_TC(tp, ktrace__cap_syscall); + ATF_TP_ADD_TC(tp, ktrace__cap_signal); + ATF_TP_ADD_TC(tp, ktrace__cap_proto); + ATF_TP_ADD_TC(tp, ktrace__cap_sockaddr); + ATF_TP_ADD_TC(tp, ktrace__cap_namei); + ATF_TP_ADD_TC(tp, ktrace__cap_cpuset); + return (atf_no_error()); +} From nobody Sun May 12 00:08:31 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VcNJ02Y3kz5Jb9c; Sun, 12 May 2024 00:08: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 4VcNHz6mmQz4syT; Sun, 12 May 2024 00:08:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715472511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bzdgC4Lk2o0zgI9wkhVmjtW/Awwx6q+9hBDuwZx56lI=; b=H+eGCpO1iNFQj7ecSp6gwp/I30Cp8owoO6R2AysSjXTKfEz7qq4HYc7Ep1OJoHArzL7E1E a7mxO1a1TitXOBn3RhTGHqV+HK3llhetlruOEO8cUHrGcIxrzV/fReTrLrKg0EsRs14T90 jSP6Vk3CA8nepPSmAkxjTGgTfQg96aIuGazWNOAS7uqFYhBkH1wWypXBQ39Ic1fhzeyxzm C3N9bzk4nYYHfHXNzJ2ojhosLGLRjci4pP33eOyzWecrHpGZtluICMp2CTnHLnM8koZUZE q0A/t082NmmyoGAjYFko5peYnE2/6wyD9+G/zy8XLoGVMyQ5MT4FlalcN0MNDg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715472512; a=rsa-sha256; cv=none; b=B2TWFm3/zBTDr4u2nB32KkEnZAgqtO2XMx3IKOTxcqt1lcqcMm6VBqD2SPF0etDNzUhojH pb2mz3SSUI/vRCwFb9QnHyOuYiyWM4JOj4a0Uqo0pPFbCiS89BRNAdBk3ZMz7zILJnccQj tjuOZ2177DTKn7OEXrpvxvrPoEYc963CRGO+D96nxNU/bqxmn/+P5S6Le1AIVYLchcI1yj 7VAEYNq4OQAc9YMQEB2+j3KW8ANxwM+sCJcykIYe8xwZ7/pxMUbDIDpAnHeFUvVCWrIpFd LPT5Qd4jLYsczPSz8hDO5fJ4G0JEKuGxNJCZEAwsFXv+9vyJY99YGq0m5Gw+PA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715472511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bzdgC4Lk2o0zgI9wkhVmjtW/Awwx6q+9hBDuwZx56lI=; b=KEPlGtKqs413rTPwX7KluNLp3HFO/sCBohrB497iwX0KT3MhrCT+TH47P7Q7/T9sbQDaHJ x4KiRXjA09LYzJkvD9GUEPfLTtbuEPvjdOkz9QWQjaMWnBF75TrDsd+ArT3OtmfNVahbVg CJtCmHypMD7xrbK8HcTFvg9cgkbdO9P/NB/sZrrZxQg1jYnMJ7a+XaP7BrtPIKp5rqc0Kw d34c3Ojq0ACCx7A5mRLLzS4s7D8v1AR07XXYxNmfZb7yf80Cw5NR0Y/jhC0YvCqFnK+r1S U1bg9F1P0fUSJljpa7He/+AOBOgmFeZAhJYj81PV6nLIeiKZnQgzXKoM5h6lPg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VcNHz5XryzhF3; Sun, 12 May 2024 00:08:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44C08V6q001986; Sun, 12 May 2024 00:08:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44C08VFE001983; Sun, 12 May 2024 00:08:31 GMT (envelope-from git) Date: Sun, 12 May 2024 00:08:31 GMT Message-Id: <202405120008.44C08VFE001983@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jake Freeland Subject: git: c3ee50b705b8 - stable/14 - ktrace: Record socket violations with KTR_CAPFAIL List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jfree X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c3ee50b705b8809a38516de5de3fd564f5ee32e0 Auto-Submitted: auto-generated The branch stable/14 has been updated by jfree: URL: https://cgit.FreeBSD.org/src/commit/?id=c3ee50b705b8809a38516de5de3fd564f5ee32e0 commit c3ee50b705b8809a38516de5de3fd564f5ee32e0 Author: Jake Freeland AuthorDate: 2024-04-06 18:31:28 +0000 Commit: Jake Freeland CommitDate: 2024-05-11 23:57:44 +0000 ktrace: Record socket violations with KTR_CAPFAIL Report restricted access to socket addresses and protocols while Capsicum violation tracing with CAPFAIL_ADDR and CAPFAIL_PROTO. Reviewed by: markj Approved by: markj (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D40681 (cherry picked from commit aa32d7cbc92c818622462635641d240ae4342eb2) --- sys/kern/uipc_socket.c | 9 +++++++-- sys/kern/uipc_syscalls.c | 13 ++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 5faf018dca11..32a6ff14bb43 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -106,6 +106,7 @@ #include "opt_inet.h" #include "opt_inet6.h" #include "opt_kern_tls.h" +#include "opt_ktrace.h" #include "opt_sctp.h" #include @@ -524,8 +525,12 @@ socreate(int dom, struct socket **aso, int type, int proto, MPASS(prp->pr_attach); - if (IN_CAPABILITY_MODE(td) && (prp->pr_flags & PR_CAPATTACH) == 0) - return (ECAPMODE); + if ((prp->pr_flags & PR_CAPATTACH) == 0) { + if (CAP_TRACING(td)) + ktrcapfail(CAPFAIL_PROTO, &proto); + if (IN_CAPABILITY_MODE(td)) + return (ECAPMODE); + } if (prison_check_af(cred, prp->pr_domain->dom_family) != 0) return (EPROTONOSUPPORT); diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 70a7ebbee4ed..6c13740d8094 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -673,11 +673,6 @@ sendit(struct thread *td, int s, struct msghdr *mp, int flags) struct sockaddr *to; int error; -#ifdef CAPABILITY_MODE - if (IN_CAPABILITY_MODE(td) && (mp->msg_name != NULL)) - return (ECAPMODE); -#endif - if (mp->msg_name != NULL) { error = getsockaddr(&to, mp->msg_name, mp->msg_namelen); if (error != 0) { @@ -685,6 +680,14 @@ sendit(struct thread *td, int s, struct msghdr *mp, int flags) goto bad; } mp->msg_name = to; +#ifdef CAPABILITY_MODE + if (CAP_TRACING(td)) + ktrcapfail(CAPFAIL_SOCKADDR, mp->msg_name); + if (IN_CAPABILITY_MODE(td)) { + error = ECAPMODE; + goto bad; + } +#endif } else { to = NULL; } From nobody Sun May 12 00:08:33 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VcNJ237tTz5JbXL; Sun, 12 May 2024 00:08: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 4VcNJ20Jtmz4tBc; Sun, 12 May 2024 00:08:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715472514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WeDtAV4hKDQofRAc4Ffg6vNSewD3PQNvGg6hcsSK7HE=; b=IFvsw3HcRo3KkfIbk7OJh99DxKQBfQFiHd/3E1dhLj2yY7yN1Od3d4iAPpdAqMDvVF3nMs 2g8rnbAphiMtJRSLfjG3R/MYbvpienfd2j7IxmzNoUJo2T6q3jz4erAeBda5cflZFvxkE5 ohPLQ6Mf5KYPZjmiuU/2VWOlt/k6U0dUdIIRNzESr2cFrJsa7ojUEoW1hOeJ3pZfXwPLbJ Wcsci9y6k80/BPMVb95zmq8g1LcDXJ3NAj4/8RCxGTEOSCl4immRTJZwjI9XwJM9fX6l9l mJ14tGp1B/JqYJKKKj68korK959NVrF7ZMI2t7ER6P2Sn1cEgxogGRCEnL8buw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715472514; a=rsa-sha256; cv=none; b=taq948WEsKaCUt69NuGrI2A/SL+i5gH9xQ27qNlKUuIIz0aU2cfUpTzVJR4N+FpQBp0vPp RkBiR6Yds/HwezRYoG6ksj7cnurnLhgvCGPPAuQxHN9FhgFK6a7earUQd44z9NQ0mhdty+ biAdzaSbEaE3UgLSOX31R23fq0U0ZOjrOiG5H9o8XOUawJeANHRSaV6tAJYAonBS28wWMJ mS2f4/2NjJ4zbljvmgDw3YEF7kd3kWJA5HIrpQq0GLuDYNiOJrMvitg7FJozPmNDSFmMVr 2PH4joX+iQRbBLSY/VtuQtlt7fciz/SgsoRMF/EGjYGZJcAmLyX/zmWQFuv2iw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715472514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WeDtAV4hKDQofRAc4Ffg6vNSewD3PQNvGg6hcsSK7HE=; b=ni8vtCMbC4KqUfo4wpX0mbyOAtXE4hKZML3dVT/YkxSg3Lqh597MgRD9BpoSEFpXFanp98 Ua7FGopbVbsW9MNC+2CPRcr3bIUdCoo1rvSA4WAeOp4xXtl/wzS7W8D1O/+UD6HgQOBvOQ DvUOr/vRfhNOEtUvv/TsWt8Kqx3CiHJw+UMG2h6KSpuOuOk/DFWxrV0PF642SBFfQJbeSq 4ry58ilr2mqRMk3Z3jhRPOCamrxqPH4PpvldEKjeRUiIDJy20n1omnEu8C+rxe6ydGX6/m NIns2UH/Y1FdSP3xUwrKMZ/CCA8J+JETySVTxzSvW1t1RzgEWoHCqIphmpT0/w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VcNJ1710Hzhh6; Sun, 12 May 2024 00:08:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44C08X2C002084; Sun, 12 May 2024 00:08:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44C08XWl002081; Sun, 12 May 2024 00:08:33 GMT (envelope-from git) Date: Sun, 12 May 2024 00:08:33 GMT Message-Id: <202405120008.44C08XWl002081@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jake Freeland Subject: git: 39664f1b7b56 - stable/14 - capsicum.h: Include ktrace.h only in kernel List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jfree X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 39664f1b7b56332a6a68ac072aaca68f4fd4697b Auto-Submitted: auto-generated The branch stable/14 has been updated by jfree: URL: https://cgit.FreeBSD.org/src/commit/?id=39664f1b7b56332a6a68ac072aaca68f4fd4697b commit 39664f1b7b56332a6a68ac072aaca68f4fd4697b Author: Jake Freeland AuthorDate: 2024-04-08 13:27:17 +0000 Commit: Jake Freeland CommitDate: 2024-05-11 23:57:44 +0000 capsicum.h: Include ktrace.h only in kernel Fix cross build failure by including ktrace.h only when _KERNEL is defined. Fixes: 9bec84131215 Approved by: markj (mentor) MFC after: 1 month Sponsored by: The FreeBSD Foundation (cherry picked from commit 34791f4ac79ee41f6986178a3a89d13f37ac156c) --- sys/sys/capsicum.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/capsicum.h b/sys/sys/capsicum.h index 05712abf37d1..e2f305462f0d 100644 --- a/sys/sys/capsicum.h +++ b/sys/sys/capsicum.h @@ -45,7 +45,6 @@ #include #include #include -#include #ifndef _KERNEL #include @@ -418,6 +417,7 @@ __END_DECLS #ifdef _KERNEL #include +#include #ifdef KTRACE #define CAP_TRACING(td) KTRPOINT((td), KTR_CAPFAIL) From nobody Sun May 12 00:08:36 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VcNJ44F4sz5JbXQ; Sun, 12 May 2024 00:08: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 4VcNJ42WhZz4tN9; Sun, 12 May 2024 00:08:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715472516; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dlU7tc0U5YpsnvMi0hXGYZBzqn142GELSm3KvfB70Xw=; b=dfibRN4yMzpHSciLjDMnFGtJ2HtBZmF2H+WQFj/DsqdwU4DqQ1RpTzCcOQWFouZGZjVdJv DxFduw9ik0ScGPg6tkKfYB2JwB3zANIz9j4g5gWAKai4L4jKg8Nhag5M8coki/vxO7ADoW B6Z2OGyMrsgUKk9DZfhDzRPl22apQlaBwceZG6HannwmiccIKVrPtSYsC8QJiZx3FpwxD0 sIwHSXrAmGm9JoL1LNJKVWUEQ6mbhGvG+eas5Gcw93IwwGtRvzUCmjUX9TxUI6Um+PoEOT xe127wEG8MU0V/i5MTbI9x4ooWa4IJHicS4QfnEQAl4d3rQdQPJ36l2UOUCrsw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715472516; a=rsa-sha256; cv=none; b=UR5yJ1g+jQt9ovgJibRtCiCz84m5+LZ1iCu1iyJgvs9tjvWZ1H1quDVxwHMT6lR40+/Dl1 2FdfaNmYKp95CdTKne1B8TUwjFWlqTuiKl7DVbsGRKWGENVW0e8b9JA9KwFT2HGqnshwTG jO/ZERWMgx7R5LDxnceNKdUiEqcF/l3/Zt6tjIM6f595XwmsR3aTQoDsf7QuLSitkfaaXe xpTHq0FCpGGyEQTTi3LsvMn+Iv2OWriwImaNhHFNeF+mAD8i+D11B/rVGhY1EuAOr0omOu bRcwGlnncCIooV1FI3yUKHCngai1chVlqByyAH9JZar+ELaIQqkM7HMRxOG8aw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715472516; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dlU7tc0U5YpsnvMi0hXGYZBzqn142GELSm3KvfB70Xw=; b=k9K6Xv4gdEnr3gTpVghPED+xvCdSEmADpLxG81p0O9BAhS1fGFkiJlUIhPBwYVk6kANUJZ nEUW5Mao93Bph2IEgANxYfyqkZC35qMPvZzvNIkCAhmglxXXg2YStoNsYzj+uWk+LJNNg4 6s2JfgNW6k1k9Z7JlMsT4tGpk4WaFx4RexuwR8iSDBb/ldCLVMeNM09mcqyL2ANX8f2vMV Uxq7O1yFDDfvyQUk6O0SozWvxzkG1mrRpdFwGeX9Paehw//Jt4g3Ucq7oys1+wqy355CRW XScygWRQiLSCp+nwMs9upS+Gqa7ZSjgNJNPnnxz65vDEUF4s6O1joyZgMegkhQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VcNJ41tSvzh64; Sun, 12 May 2024 00:08:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44C08aw8002183; Sun, 12 May 2024 00:08:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44C08a3S002180; Sun, 12 May 2024 00:08:36 GMT (envelope-from git) Date: Sun, 12 May 2024 00:08:36 GMT Message-Id: <202405120008.44C08a3S002180@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jake Freeland Subject: git: dee055d1b1e6 - stable/14 - uipc_shm: Fix a free() of an uninitialized variable List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jfree X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: dee055d1b1e602da77016fd14cb003896586f864 Auto-Submitted: auto-generated The branch stable/14 has been updated by jfree: URL: https://cgit.FreeBSD.org/src/commit/?id=dee055d1b1e602da77016fd14cb003896586f864 commit dee055d1b1e602da77016fd14cb003896586f864 Author: Mark Johnston AuthorDate: 2024-04-19 00:15:51 +0000 Commit: Jake Freeland CommitDate: 2024-05-11 23:57:44 +0000 uipc_shm: Fix a free() of an uninitialized variable Reported by: Coverity CID: 1544043 Fixes: b112232e4fb9 ("uipc_shm: Copyin userpath for ktrace(2)") (cherry picked from commit e411b2273603267dbc51c7839879e765b573c1c5) --- sys/kern/uipc_shm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c index 31c80913be84..0bfbc636e405 100644 --- a/sys/kern/uipc_shm.c +++ b/sys/kern/uipc_shm.c @@ -1214,6 +1214,8 @@ kern_shm_open2(struct thread *td, const char *userpath, int flags, mode_t mode, #endif AUDIT_ARG_UPATH1_CANON(path); + } else { + path = NULL; } pdp = td->td_proc->p_pd; From nobody Sun May 12 00:08:34 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VcNJ33fVbz5Jb7X; Sun, 12 May 2024 00:08: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 4VcNJ31T69z4t5x; Sun, 12 May 2024 00:08:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715472515; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VElqOUfu3JSg6S4nqkCDhc3etzZDAfmV4EPw1PHR3zc=; b=ry0ITDh1vmPI7wDNrvB6UoJu3GWJMPQE5fLuvC7rAiAGiG5RnSP4mDLUjEX59LkR+39Z7o EUpl6uDXpkxCcPen+AamDZch+GqU2cJHZTZ9Fag/QKGav9t91Da0CZPHMDe5SBuhOM5ake zE8bs7I8xg+QV8/iQjIQLYUhjS4vASAEc3QsIadPCPGwn8Q/h9NW5f47xbkLx8ICWui8Ff WkXxeDMI3KI/TJDrfxJx5N368cL96VNrKAsOt68aT5Nb8wy7N4YoHFqjl+47CHKr/xWWeN CtJ0UDRoXwRBKWvNorZWVjNRGyUhrkKoEkw+MP43kTZZZoHw72gFRLbIjTEEvg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715472515; a=rsa-sha256; cv=none; b=af5REt6Gfz4YyH1HLa6K/yGvCPpDesyk39dUKFBIljfd+I3Geh1yBOBOlMM/C0i6W2wgLS xvMmAHaQE1CtaUUirPt1bjAPC0IJCSpAWg0iyF8MwMBfcn04Y+AYZUFSDe+0BYQsMSU9Er PH6K3Ma7IooNttWm19WfZzlOsKXoffr6mt5BSWSU2hJ8nU3YExh1yia5A8GVX8rgQvBbjf rLAc2/39YvYVM/c7FNl60enNUwVA7xGhdCWszAkeuqLOXlhMWnnBNc27EVKfIMBLA7TQly 6RrXWtUZfFizu3+S5QEJRu3qDq1oHECOsUWqmKVFYY/2mR5lIQLjqLtMMCYYZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715472515; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VElqOUfu3JSg6S4nqkCDhc3etzZDAfmV4EPw1PHR3zc=; b=SopucH1L3NdBB0kAMFndli8QNm2nmzX/sx9AiuLHYuH9wkjn84E6Tr0EH0iRwYMnTGjmll tqGwKZuVp94/NpJ4NhKrvlwghORrmf5+Frl7Khgr7hKbq3EvA0tVIavVPNM/HRabN+QWwy plpkFtQvaPiQAfahooV0/g68IRR9N/rQdf8bHAE3lW4B3yBw2x4ijpf16B9HMh6mmkxd3X M1iFRPzInmDyA0yLFjNOthnfQ8gmC3IjObjqQMaOCiH3gDThqflQnkK/SHCC7Fz1yDYAaC PiTbon1rmNAtZK8D6HA6410ieJnCdG0Snhd5MrOo5O4/V2e8uLJAcDN/tzUSAg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VcNJ30XcDzhh7; Sun, 12 May 2024 00:08:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44C08YxD002129; Sun, 12 May 2024 00:08:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44C08YbG002126; Sun, 12 May 2024 00:08:34 GMT (envelope-from git) Date: Sun, 12 May 2024 00:08:34 GMT Message-Id: <202405120008.44C08YbG002126@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jake Freeland Subject: git: d0ca50b414be - stable/14 - uipc_shm: Copyin userpath for ktrace(2) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jfree X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d0ca50b414beebe5e61154541c9a2fb085df37f0 Auto-Submitted: auto-generated The branch stable/14 has been updated by jfree: URL: https://cgit.FreeBSD.org/src/commit/?id=d0ca50b414beebe5e61154541c9a2fb085df37f0 commit d0ca50b414beebe5e61154541c9a2fb085df37f0 Author: Jake Freeland AuthorDate: 2024-04-10 02:17:11 +0000 Commit: Jake Freeland CommitDate: 2024-05-11 23:57:44 +0000 uipc_shm: Copyin userpath for ktrace(2) If userpath is not SHM_ANON, then copy it in early so ktrace(2) can record it. Without this change, ktrace(2) will attempt to strcpy a userspace string and trigger a page fault. Reported by: syzbot+490b9c2a89f53b1b9779@syzkaller.appspotmail.com Fixes: 0cd9cde767c3 Approved by: markj (mentor) Reviewed by: markj MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D44702 (cherry picked from commit b112232e4fb931ebafae9d79fbc970e3df020b57) --- sys/kern/uipc_shm.c | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c index 613656ca0a5a..31c80913be84 100644 --- a/sys/kern/uipc_shm.c +++ b/sys/kern/uipc_shm.c @@ -1172,18 +1172,6 @@ kern_shm_open2(struct thread *td, const char *userpath, int flags, mode_t mode, if ((shmflags & SHM_ALLOW_SEALING) != 0) initial_seals &= ~F_SEAL_SEAL; -#ifdef CAPABILITY_MODE - /* - * shm_open(2) is only allowed for anonymous objects. - */ - if (userpath != SHM_ANON) { - if (CAP_TRACING(td)) - ktrcapfail(CAPFAIL_NAMEI, userpath); - if (IN_CAPABILITY_MODE(td)) - return (ECAPMODE); - } -#endif - AUDIT_ARG_FFLAGS(flags); AUDIT_ARG_MODE(mode); @@ -1208,6 +1196,26 @@ kern_shm_open2(struct thread *td, const char *userpath, int flags, mode_t mode, if ((initial_seals & ~F_SEAL_SEAL) != 0) return (EINVAL); + if (userpath != SHM_ANON) { + error = shm_copyin_path(td, userpath, &path); + if (error != 0) + return (error); + +#ifdef CAPABILITY_MODE + /* + * shm_open(2) is only allowed for anonymous objects. + */ + if (CAP_TRACING(td)) + ktrcapfail(CAPFAIL_NAMEI, path); + if (IN_CAPABILITY_MODE(td)) { + free(path, M_SHMFD); + return (ECAPMODE); + } +#endif + + AUDIT_ARG_UPATH1_CANON(path); + } + pdp = td->td_proc->p_pd; cmode = (mode & ~pdp->pd_cmask) & ACCESSPERMS; @@ -1219,8 +1227,10 @@ kern_shm_open2(struct thread *td, const char *userpath, int flags, mode_t mode, * in sys_shm_open() to keep this implementation compliant. */ error = falloc_caps(td, &fp, &fd, flags & O_CLOEXEC, fcaps); - if (error) + if (error) { + free(path, M_SHMFD); return (error); + } /* A SHM_ANON path pointer creates an anonymous object. */ if (userpath == SHM_ANON) { @@ -1234,14 +1244,6 @@ kern_shm_open2(struct thread *td, const char *userpath, int flags, mode_t mode, shmfd->shm_seals = initial_seals; shmfd->shm_flags = shmflags; } else { - error = shm_copyin_path(td, userpath, &path); - if (error != 0) { - fdclose(td, fp, fd); - fdrop(fp, td); - return (error); - } - - AUDIT_ARG_UPATH1_CANON(path); fnv = fnv_32_str(path, FNV1_32_INIT); sx_xlock(&shm_dict_lock); shmfd = shm_lookup(path, fnv); From nobody Sun May 12 00:08:37 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VcNJ55S7Zz5JbSS; Sun, 12 May 2024 00:08: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 4VcNJ540hbz4t99; Sun, 12 May 2024 00:08:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715472517; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mcjvWdaMpPki2BHF2AscVF2jqhUqFpIPqzh1oQayV70=; b=iUBc4eRaQ/iyZ9yvR5RyzxLoJWNguYkdjA2bZ/q/Sd0NE7Oaf4bZX4M6c11OK1G/V14sH4 a+yPobXREqrwlpdgfIrLr2AgOmYPVHzy5oIjSo3/1rA1P2m4YIE3yLEy1B6JuydHjEfYAN FT1Bkrmz7rmnZoo6qlPUizxmUi+8TFIN9gmZ422hXcNHGYkzzXahvqDMexU2fTSHLeY0D1 wEIRCPz8cgBqzBzqn1d78OeeKjQQFwnV/MtDscmvE09+F3MH0rRGLbZd6MoNjQ6YLjIhFA Qz1dsI+HTym/QmFTsWCSBf2x8b+MHFEiI8p/25MzFfnNjdC3spzNKyuFNHiw6g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715472517; a=rsa-sha256; cv=none; b=Rq9cOJYrJ7bku+rA5pZnOIbJiHZR4BUubYuMIbfimdFQtkZjS9qhIHZo4Gqv5VVkzGxHte H1nHVa5+v+MpmDo6CHJb2OFtRUsoi3NwBlelfYen0VLrKYqrYmHRutrKvqeX70EL/Xvewe StlkDf5dtb2gyhoBG2fJc/RlpSl5/h9HHvLEzo6qVx951cxbf3TZe7V1CD+PbNsiMRR8Mo 4ilGQCHtr3o7MXghyQmSMRRu5RYyNTsxjtXVf+J8pwCa5hP1Lgv2VQstJem2ebMGyGuWVY v1Rg7uBJ+UbMhp1j3GACUnj0z0ky+mj9yOe+Vhy9iW1q5hCuxq+rUUhm8jTmtA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715472517; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mcjvWdaMpPki2BHF2AscVF2jqhUqFpIPqzh1oQayV70=; b=lVnbJD9bxFY+72YzV5ClJzHbK95moF401o5kk+DeNI+VwrAkXEIhyHdBnUHOQQQ3F+B6Vv Z3omAunIs22xAgN7YXRxFBxKb90DrnxLoNiBLuv+oA3pwPCQ7jRWkOY8G/VCZmVNb4BBe1 5xx8Lz3UgjBciGX37UdxuCEB1KegH9HBvJ2uNLPqEdR8yH2oRn3lg1HaAeMzS57gg4qEM3 Tbwec8Ca1dUXc5og/9iBzJseWGC8bwZUEeUfOALe1wwWFU2C4+h+niMkcKllg3EExbYzr7 /ZiHC/5ixPVLiN8XunoeY0ivvQ4OK9fQSSXXeOJMzaGsMiwfEaHwkyJ/wIq8+g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VcNJ52m6yzhh8; Sun, 12 May 2024 00:08:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44C08bnm002231; Sun, 12 May 2024 00:08:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44C08b93002228; Sun, 12 May 2024 00:08:37 GMT (envelope-from git) Date: Sun, 12 May 2024 00:08:37 GMT Message-Id: <202405120008.44C08b93002228@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jake Freeland Subject: git: a94eacb13977 - stable/14 - tests: Add ktrace regression test for shm_open List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jfree X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a94eacb139772114a68030ca8987d6bd8e67a4ab Auto-Submitted: auto-generated The branch stable/14 has been updated by jfree: URL: https://cgit.FreeBSD.org/src/commit/?id=a94eacb139772114a68030ca8987d6bd8e67a4ab commit a94eacb139772114a68030ca8987d6bd8e67a4ab Author: Jake Freeland AuthorDate: 2024-04-10 02:18:11 +0000 Commit: Jake Freeland CommitDate: 2024-05-11 23:57:44 +0000 tests: Add ktrace regression test for shm_open Verify that a capability violation is recorded when shm_open(2) is called with a non-anonymous path. Approved by: markj (mentor) Reviewed by: markj MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D44733 (cherry picked from commit 054a4720591f0c98579bccef2751fd458ee4f71f) --- tests/sys/kern/ktrace_test.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tests/sys/kern/ktrace_test.c b/tests/sys/kern/ktrace_test.c index 49e2ed05fed9..21868441c687 100644 --- a/tests/sys/kern/ktrace_test.c +++ b/tests/sys/kern/ktrace_test.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -474,6 +475,38 @@ ATF_TC_BODY(ktrace__cap_cpuset, tc) "cpuset_setaffinity"); } +ATF_TC_WITHOUT_HEAD(ktrace__cap_shm_open); +ATF_TC_BODY(ktrace__cap_shm_open, tc) +{ + struct ktr_cap_fail violation; + sigset_t set = { }; + pid_t pid; + int error; + + /* Block SIGUSR1 so child does not terminate. */ + ATF_REQUIRE(sigaddset(&set, SIGUSR1) != -1); + ATF_REQUIRE(sigprocmask(SIG_BLOCK, &set, NULL) != -1); + + ATF_REQUIRE((pid = fork()) != -1); + if (pid == 0) { + /* Wait until ktrace has started. */ + CHILD_REQUIRE(sigwait(&set, &error) != -1); + CHILD_REQUIRE_EQ(error, SIGUSR1); + + CHILD_REQUIRE(shm_open("/ktrace_shm", O_RDWR | O_CREAT, + 0600) != -1); + CHILD_REQUIRE(shm_unlink("/ktrace_shm") != -1); + exit(0); + } + + cap_trace_child(pid, &violation, 1); + ATF_REQUIRE_EQ(violation.cap_type, CAPFAIL_NAMEI); + error = syscallabi(violation.cap_svflags); + ATF_REQUIRE_STREQ(sysdecode_syscallname(error, violation.cap_code), + "shm_open2"); + ATF_REQUIRE_STREQ(violation.cap_data.cap_path, "/ktrace_shm"); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, ktrace__cap_not_capable); @@ -484,5 +517,6 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, ktrace__cap_sockaddr); ATF_TP_ADD_TC(tp, ktrace__cap_namei); ATF_TP_ADD_TC(tp, ktrace__cap_cpuset); + ATF_TP_ADD_TC(tp, ktrace__cap_shm_open); return (atf_no_error()); } From nobody Sun May 12 00:08:38 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VcNJ701rNz5JbbD; Sun, 12 May 2024 00:08: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 4VcNJ6512Vz4t6c; Sun, 12 May 2024 00:08:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715472518; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RXTxxMn87noely35aOL0urx/kdYky+jnu2EBI0pE4og=; b=Pt0eCCVf3JH5qMd5GLj+9dZQrcJ6ObohVAOtlRD3lX/kO2P/RlJ/2Thk4KMwoZqRZpqHxr f8xoqmpI9O0WlnNccc434gQpnzAj9FxUK46jjki+9cSyZ0B7d/u9IUutMjjDQmxqL75FsB clYpbcRVseOsi4sjTEvfOyTGtDP9j6GWAwoGyQgE9I70w34IYB+8JrybIX/FniW0hfnfZg mHbSGQowKaJlYK3DA0kK9JsBH9F2+0aZNWGHn+5hJ/9v4gywYuzkqG9hAS3HBnp8Am31P5 thCzhrk0heEiSWqTiCTuI8PX3zXSUHFGNkYoeJ4mmURVywcz5D/4mwpllBAr9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715472518; a=rsa-sha256; cv=none; b=g38adZlhOTs3ZKvwkdMo6EswFSXebdDhp62BNEUwGpA1GLsK9UsKrKerQ2A9YcQ24yZ15u FTG1r5meye32lutA08N1KjLw0SFOhscEYonzITI5VfO3dgaS37M8nWEdmQc31Tk42oo3Rb j8qE/nUSt6oPR3NP5XhAkRQFrNef58JLC4mT743An9Va6GNNC5yGlY8NB26oy9rwu8UIoQ J8RpiThYsnnMmteKGNhze/Z+VqFZ5BgepWod4QPN0L/koLO5TWTWeovyTBdTjwRAUD1Jwt uWeqjwnDilMi7HknGbn26Ug56BRqAhQziyBiJMU8PsTqEbkX2Zf0PCxGaSmEaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715472518; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RXTxxMn87noely35aOL0urx/kdYky+jnu2EBI0pE4og=; b=MMw/5NZbkvWX5cZN3MuSA0i+pyL8Jr1yAvaaIxVzXwQ8n/jMMwDNSTO7WzblZkQsKXUHrb fk0b64G3opGNMLnJV3RJ/UOFvr0WXC/zCsy6BrziTDOElepihkhUyLEXeMnLFF4hWJZ2kF Cz3h9G3AKP6O4z99Uxl9oYg5MT2VScffIsY8CBb5fwH/mn639OS9RrSjeBqzkuqbs+nIIj MOEV8bqKczke3fljmbEI0zVM9yAqgMWaD1RIVTAo2Gy7C95ESYjQ5v/szRr4pnHRigr2+V h90n0RzHW+Dz191KjAQYxXaWkjfeYNtJ0jXInjTCGDffp0ZfeJR2mJEIAdQt7A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VcNJ63p4tzhF4; Sun, 12 May 2024 00:08:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44C08cxb002282; Sun, 12 May 2024 00:08:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44C08cGd002279; Sun, 12 May 2024 00:08:38 GMT (envelope-from git) Date: Sun, 12 May 2024 00:08:38 GMT Message-Id: <202405120008.44C08cGd002279@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jake Freeland Subject: git: 5757a523dc34 - stable/14 - ktrace: Describe CAPFAIL trace point in man page List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jfree X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5757a523dc349ba85ad909a2f340f34845405fb9 Auto-Submitted: auto-generated The branch stable/14 has been updated by jfree: URL: https://cgit.FreeBSD.org/src/commit/?id=5757a523dc349ba85ad909a2f340f34845405fb9 commit 5757a523dc349ba85ad909a2f340f34845405fb9 Author: Jake Freeland AuthorDate: 2024-04-24 00:25:16 +0000 Commit: Jake Freeland CommitDate: 2024-05-11 23:57:44 +0000 ktrace: Describe CAPFAIL trace point in man page Update the ktrace(1) man page to describe the recently improved capability failure tracing. Approved by: markj (mentor) Reviewed by: markj MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D44886 (cherry picked from commit 4f2ada0d88219746fdfbc0907c28b0950ad18725) --- usr.bin/ktrace/ktrace.1 | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/usr.bin/ktrace/ktrace.1 b/usr.bin/ktrace/ktrace.1 index a6a07bb93caf..764896b91f66 100644 --- a/usr.bin/ktrace/ktrace.1 +++ b/usr.bin/ktrace/ktrace.1 @@ -27,7 +27,7 @@ .\" .\" @(#)ktrace.1 8.1 (Berkeley) 6/6/93 .\" -.Dd August 26, 2019 +.Dd April 20, 2024 .Dt KTRACE 1 .Os .Sh NAME @@ -153,6 +153,21 @@ The and .Ar command options are mutually exclusive. +.Sh CAPABILITY VIOLATION TRACING +When the +.Cm p +trace point is specified, +.Nm +will record +.Xr capsicum 4 +capability mode violations made by the traced process. +Violations will be logged regardless of whether the process has actually +entered capability mode. +.Pp +For developers that are interested in Capsicumizing their programs, the +.Cm c , n , p +trace points can help quickly identify any system calls and path lookups that +are triggering violations. .Sh EXAMPLES Run "make", then trace it and any child processes: .Dl $ ktrace -i make @@ -185,7 +200,8 @@ Disable tracing of all user-owned processes: .Xr kdump 1 , .Xr truss 1 , .Xr ktrace 2 , -.Xr utrace 2 +.Xr utrace 2 , +.Xr capsicum 4 .Sh HISTORY The .Nm From nobody Sun May 12 00:08:39 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VcNJ81CTJz5Jb9p; Sun, 12 May 2024 00:08: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 4VcNJ802q3z4tLQ; Sun, 12 May 2024 00:08:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715472520; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pMUh1y9pIVoFrRQjnMj++H1+8NbEljMTrFD1qxwlFvw=; b=L+OOlHsZXyU62YnZYyq4YCnUZtmfPp/w21xsx3TPE6yCa+duQNofohz+uTqDCqjK7OOaV9 f5CjuXRjWSZ/QJSZvax4FKlB5PvG0DwxwcSnrJdabzVGwdhEAg1fbrrPlM0e1uyBp0OM8t gbJrMOxt0cxE/ahU3IQEfOmnWbDTzk7PstBOivK0EtH28p5cPY46L2WlyohqvOZqw0ESGg mosusZuoE0mao0v52mS2PpD0prc1oR/9QmNJf3L46IcFBZpgZS3aJsXFLEbd5ydI0rlWv1 PGQ9pExypot8sMbPNWceTmPW9DIsn/Mkzq3UPVF6OaevyLzV5wfXNZ/UAmxPhA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715472520; a=rsa-sha256; cv=none; b=ftJeQRtfMvpTEvOeAc4quCfMrABvl2yYSJh2c64wSSj9FeiZ5aw6KYlYPwNO21LFFgv43n y/4aK7myg7M3Z0iomA3JYaxNWl+UWl66G+uOkogBvOVj1Qx8Eicc3Il3B0hjpo0rmZZH97 NTxVOWdege/Wq6nvP3PMbSZWUv5JIMEX4PhCOwW3+KIm8g4O6LbnjriIZ/z+wn7i7FLQWT lzK6W/ZL7h3EDVeeTQW4ySXRMlT2+BZNdujfFWOnSQIWjyfXcIZHcvB2jjKsHomW6CbIGC rS+OI6eSuZZFiKoQvPSYE5rXighKHxPIuPfLqINVfryNCFCGWlMyiogndm0+xg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715472520; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pMUh1y9pIVoFrRQjnMj++H1+8NbEljMTrFD1qxwlFvw=; b=NSUuElH9vEvcDeU37SAqNhY7gZyNVY8zQbiyqcH+NFPVFCjZmbgwKhhCcprSdF8lp6OrZo Cb7/dXOWBZEBbqyOxq11M7jM4efb0tPi3+vuudUgahSWtC5BuRN3alPVHPvmX3gthlaZY8 98mPR28HOBGrUWxliZZJblMO77rT8wCYcPI6cboW/2lPOi3T2xJZynnvYQQ5bIS8xLT3wf n1WxEiD98QTmJ0BR6bEY+phDG51+TWC+gMvFVawz+vN6vpeg5qLC7hjC4wqpOtcL7LE4rV YD6lbahGmNtUM2RnVfANf+Osf+jecL6Y0rnyaPNwCR4tde+wgeU6Zwoz5Yrosw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VcNJ74rNbzhsH; Sun, 12 May 2024 00:08:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44C08dKb002336; Sun, 12 May 2024 00:08:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44C08dnr002333; Sun, 12 May 2024 00:08:39 GMT (envelope-from git) Date: Sun, 12 May 2024 00:08:39 GMT Message-Id: <202405120008.44C08dnr002333@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jake Freeland Subject: git: ba501a551776 - stable/14 - ktrace: Remove CAPFAIL from default trace points List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jfree X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ba501a551776bd101cd38ac2892bc900cf29da0a Auto-Submitted: auto-generated The branch stable/14 has been updated by jfree: URL: https://cgit.FreeBSD.org/src/commit/?id=ba501a551776bd101cd38ac2892bc900cf29da0a commit ba501a551776bd101cd38ac2892bc900cf29da0a Author: Jake Freeland AuthorDate: 2024-04-24 00:26:14 +0000 Commit: Jake Freeland CommitDate: 2024-05-11 23:57:44 +0000 ktrace: Remove CAPFAIL from default trace points The CAPFAIL tracepoint was recently extended to report ECAPMODE capability violations for processes that do not enter capability mode. This allows developers that are interested in Capsicumizing their programs to determine where violations are being raised. Previously, CAPFAIL only produced output for processes using Capsicum(4) capabilties. Thus, most ktrace users never received log output from the trace point. With the recent changes, this is no longer the case. Having this trace point enabled by default will produce output for all processes that use syscalls that are not permitted in capability mode. This may lead to confusion for users that are not familiar with the feature. Remove KTRFAC_CAPFAIL from ktrace's default points to avoid this. Approved by: markj (mentor) Reviewed by: markj MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D44887 (cherry picked from commit f239db4800ee9e7ff8485f96b7a68e6c38178c3b) --- usr.bin/ktrace/ktrace.1 | 2 +- usr.bin/ktrace/ktrace.h | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/usr.bin/ktrace/ktrace.1 b/usr.bin/ktrace/ktrace.1 index 764896b91f66..1b287af7a611 100644 --- a/usr.bin/ktrace/ktrace.1 +++ b/usr.bin/ktrace/ktrace.1 @@ -139,7 +139,7 @@ trace requests .It Cm + trace the default set of trace points - -.Cm c , i , n , p , s , t , u , y +.Cm c , i , n , s , t , u , y .El .It Ar command Execute diff --git a/usr.bin/ktrace/ktrace.h b/usr.bin/ktrace/ktrace.h index cecd0adc7321..1d96c6faa2b7 100644 --- a/usr.bin/ktrace/ktrace.h +++ b/usr.bin/ktrace/ktrace.h @@ -33,13 +33,12 @@ #define DEF_POINTS (KTRFAC_SYSCALL | KTRFAC_SYSRET | KTRFAC_NAMEI | \ KTRFAC_GENIO | KTRFAC_PSIG | KTRFAC_USER | \ - KTRFAC_STRUCT | KTRFAC_SYSCTL | KTRFAC_CAPFAIL | \ - KTRFAC_STRUCT_ARRAY) + KTRFAC_STRUCT | KTRFAC_SYSCTL | KTRFAC_STRUCT_ARRAY) #define PROC_ABI_POINTS (KTRFAC_PROCCTOR | KTRFAC_PROCDTOR) -#define ALL_POINTS (DEF_POINTS | KTRFAC_CSW | PROC_ABI_POINTS | \ - KTRFAC_FAULT | KTRFAC_FAULTEND) +#define ALL_POINTS (DEF_POINTS | KTRFAC_CAPFAIL | KTRFAC_CSW | \ + PROC_ABI_POINTS | KTRFAC_FAULT | KTRFAC_FAULTEND) #define DEF_TRACEFILE "ktrace.out" From nobody Sun May 12 00:08:40 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VcNJ94297z5JbhF; Sun, 12 May 2024 00:08: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 4VcNJ86ccvz4tLc; Sun, 12 May 2024 00:08:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715472520; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+upHF0fYjIh6J8BvBZHgK6k41jg9IHLwFWssI3fJArA=; b=dJDgnnJlleoSjREsLhhHBexbYrL/anE9Tbp6MuXgZ7KjgMAbK/z+m/yCwOEJ3UGqoDGz93 cxBQ6p9u0vt3lbbugjw7uQqLjkkQxPA9Y4PQZqXeHWFqiTJHgQGhlCUwSN/UEaofXlFKSM nLeVgLrEFrb7nCBZ+Rta8u8apbB9fAnkDIkZ55VuI5Y76jEqStZgVvG5xlK854VPPchYGM fmjBqPutH9chvTmbYnHe2ivnvFLlDOnCuntODheQvChBcPpb2a4aR+3k7iBhFR6+xQUsjR OLZEajePVgVf4PjDe+TEU5/U1eHLaxYJ0RNW3OuefuPU6doUhFbrRNwxogkdEg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715472520; a=rsa-sha256; cv=none; b=vObtR/CfRH4Wounzo3pWFLTy3dcKia00/v32nKO/kzOBhy6GJkeuLjfx+ykybgM2mEGf+d iWJ5ThPRrJE70EHhgNTgS0h/t9QR3Rg8yIFyIL2ZlhpvnaZvyxJSHHrWIClhyk0+8TYuO4 7SRfGc3+c5L++SE26/KHqaqjWtc3PTb7Njdo/KPPxpVyVGaJNOSrGzTeD2ajndWK0NCG1C fk25zZHzv5rCjUbxDbtFa3RJ0BftfjQrvBjwZCdrFEGaIv+yxZ2wxOQb1iUBpRJqsEoFRN kBH8Pu6nXTm4RPVR1LKWEqyOtgv9H5SYyXkmz1ec737NnZE7VezpBvjWNaGUcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715472520; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+upHF0fYjIh6J8BvBZHgK6k41jg9IHLwFWssI3fJArA=; b=K0ghePpDQIA3Cpm6o99HUsCLaany3Xg8R1eJEYi91IeYAatjueSDIaNt4XrMBfRVET5vkD 8ggL4Xxac0r5ZTVNlRmJxfYrhONhwY7/oGzT5Tgsowv0iZnAH7SydcNIf31R6yAmNfROQS F8t0NouPe73gHulikPRITBQJ3lUQZhduBUDGD2RH+r8HpfIBDoPecc89+FqlqNtGGesbz+ 95A5N2OCVJ5hGhY8oa4y9mphpQ/1xMLUPk2a1wpQ1UDiUr4mjusN/YCU5HOjkW70r1iHCq +S0nFs+nNN6Et8xjREHr2X2CLiCeXsQ44J1WFsWBgeLVTYtwBE2KGhRhTyuV7Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VcNJ85swZzhTy; Sun, 12 May 2024 00:08:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44C08eMo002397; Sun, 12 May 2024 00:08:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44C08eww002393; Sun, 12 May 2024 00:08:40 GMT (envelope-from git) Date: Sun, 12 May 2024 00:08:40 GMT Message-Id: <202405120008.44C08eww002393@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jake Freeland Subject: git: eabd8043e0a3 - stable/14 - bitset: Add ORNOT macros List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jfree X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: eabd8043e0a316153f0f91371f1c8049e4a25b77 Auto-Submitted: auto-generated The branch stable/14 has been updated by jfree: URL: https://cgit.FreeBSD.org/src/commit/?id=eabd8043e0a316153f0f91371f1c8049e4a25b77 commit eabd8043e0a316153f0f91371f1c8049e4a25b77 Author: Jake Freeland AuthorDate: 2024-04-28 00:20:34 +0000 Commit: Jake Freeland CommitDate: 2024-05-11 23:57:44 +0000 bitset: Add ORNOT macros Macros to ANDNOT a bitset currently exist, but there are no ORNOT equivalents. Introduce ORNOT macros for bitset(9), cpuset(9), and domainset(9). Approved by: markj (mentor) Reviewed by: markj MFC after: 1 week Sponsored by: NIKSUN, Inc. Differential Revision: https://reviews.freebsd.org/D44976 (cherry picked from commit cd4bd9750c1b194ba22fbbc333d6166556a26577) --- share/man/man9/Makefile | 3 +++ share/man/man9/bitset.9 | 39 +++++++++++++++++++++++++++++++++++++++ share/man/man9/cpuset.9 | 15 +++++++++++++++ sys/sys/bitset.h | 14 ++++++++++++++ sys/sys/cpuset.h | 1 + sys/sys/domainset.h | 1 + 6 files changed, 73 insertions(+) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 8effacbc0cee..55427c5b0eca 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -633,6 +633,8 @@ MLINKS+=bitset.9 BITSET_DEFINE.9 \ bitset.9 BIT_CMP.9 \ bitset.9 BIT_OR.9 \ bitset.9 BIT_OR2.9 \ + bitset.9 BIT_ORNOT.9 \ + bitset.9 BIT_ORNOT2.9 \ bitset.9 BIT_AND.9 \ bitset.9 BIT_AND2.9 \ bitset.9 BIT_ANDNOT.9 \ @@ -922,6 +924,7 @@ MLINKS+=cpuset.9 CPUSET_T_INITIALIZER.9 \ cpuset.9 CPU_OVERLAP.9 \ cpuset.9 CPU_CMP.9 \ cpuset.9 CPU_OR.9 \ + cpuset.9 CPU_ORNOT.9 \ cpuset.9 CPU_AND.9 \ cpuset.9 CPU_ANDNOT.9 \ cpuset.9 CPU_CLR_ATOMIC.9 \ diff --git a/share/man/man9/bitset.9 b/share/man/man9/bitset.9 index 1bdfdeb7484c..a4e360a678d7 100644 --- a/share/man/man9/bitset.9 +++ b/share/man/man9/bitset.9 @@ -51,6 +51,8 @@ .Nm BIT_CMP , .Nm BIT_OR , .Nm BIT_OR2 , +.Nm BIT_ORNOT , +.Nm BIT_ORNOT2 , .Nm BIT_AND , .Nm BIT_AND2 , .Nm BIT_ANDNOT , @@ -123,6 +125,13 @@ .Fa "struct STRUCTNAME *src1" .Fa "struct STRUCTNAME *src2" .Fc +.Fn BIT_ORNOT "const SETSIZE" "struct STRUCTNAME *dst" "struct STRUCTNAME *src" +.Fo BIT_ORNOT2 +.Fa "const SETSIZE" +.Fa "struct STRUCTNAME *dst" +.Fa "struct STRUCTNAME *src1" +.Fa "struct STRUCTNAME *src2" +.Fc .Fn BIT_AND "const SETSIZE" "struct STRUCTNAME *dst" "struct STRUCTNAME *src" .Fo BIT_AND2 .Fa "const SETSIZE" @@ -459,6 +468,36 @@ equivalent of the scalar: .Fa src2 . ) .Pp The +.Fn BIT_ORNOT +macro sets bits not in +.Fa src +in +.Fa dst . +(It is the +.Nm +equivalent of the scalar: +.Fa dst +|= +.Fa ~ src . ) +.Pp +The +.Fn BIT_ORNOT2 +macro computes +.Fa src1 +bitwise or not +.Fa src2 +and assigns the result to +.Fa dst . +(It is the +.Nm +equivalent of the scalar: +.Fa dst += +.Fa src1 +| ~ +.Fa src2 . ) +.Pp +The .Fn BIT_AND macro clears bits absent from .Fa src diff --git a/share/man/man9/cpuset.9 b/share/man/man9/cpuset.9 index 974dc55b2c65..20485059a4c8 100644 --- a/share/man/man9/cpuset.9 +++ b/share/man/man9/cpuset.9 @@ -45,6 +45,7 @@ .Nm CPU_OVERLAP , .Nm CPU_CMP , .Nm CPU_OR , +.Nm CPU_ORNOT , .Nm CPU_AND , .Nm CPU_ANDNOT , .Nm CPU_XOR , @@ -86,6 +87,7 @@ .Ft bool .Fn CPU_CMP "cpuset_t *cpuset1" "cpuset_t *cpuset2" .Fn CPU_OR "cpuset_t *dst" "cpuset_t *src1" "cpuset_t *src2" +.Fn CPU_ORNOT "cpuset_t *dst" "cpuset_t *src1" "cpuset_t *src2" .Fn CPU_AND "cpuset_t *dst" "cpuset_t *src1" "cpuset_t *src2" .Fn CPU_ANDNOT "cpuset_t *dst" "cpuset_t *src1" "cpuset_t *src2" .Fn CPU_XOR "cpuset_t *dst" "cpuset_t *src1" "cpuset_t *src2" @@ -296,6 +298,19 @@ is composed of multiple machine words, performs multiple individually atomic operations.) .Pp The +.Fn CPU_ORNOT +macro add CPUs not in +.Fa src +to +.Fa dst . +(It is the +.Nm +equivalent of the scalar: +.Fa dst +|= +.Fa ~ src . ) +.Pp +The .Fn CPU_AND macro removes CPUs absent from .Fa src diff --git a/sys/sys/bitset.h b/sys/sys/bitset.h index 5ff2bb76a4ab..4afac9b172e8 100644 --- a/sys/sys/bitset.h +++ b/sys/sys/bitset.h @@ -135,6 +135,18 @@ (d)->__bits[__i] = (s1)->__bits[__i] | (s2)->__bits[__i];\ } while (0) +#define __BIT_ORNOT(_s, d, s) do { \ + __size_t __i; \ + for (__i = 0; __i < __bitset_words((_s)); __i++) \ + (d)->__bits[__i] |= ~(s)->__bits[__i]; \ +} while (0) + +#define __BIT_ORNOT2(_s, d, s1, s2) do { \ + __size_t __i; \ + for (__i = 0; __i < __bitset_words((_s)); __i++) \ + (d)->__bits[__i] = (s1)->__bits[__i] | ~(s2)->__bits[__i];\ +} while (0) + #define __BIT_AND(_s, d, s) do { \ __size_t __i; \ for (__i = 0; __i < __bitset_words((_s)); __i++) \ @@ -330,6 +342,8 @@ #define BIT_ISSET(_s, n, p) __BIT_ISSET(_s, n, p) #define BIT_OR(_s, d, s) __BIT_OR(_s, d, s) #define BIT_OR2(_s, d, s1, s2) __BIT_OR2(_s, d, s1, s2) +#define BIT_ORNOT(_s, d, s) __BIT_ORNOT(_s, d, s) +#define BIT_ORNOT2(_s, d, s1, s2) __BIT_ORNOT2(_s, d, s1, s2) #define BIT_OR_ATOMIC(_s, d, s) __BIT_OR_ATOMIC(_s, d, s) #define BIT_OVERLAP(_s, p, c) __BIT_OVERLAP(_s, p, c) #define BIT_SET(_s, n, p) __BIT_SET(_s, n, p) diff --git a/sys/sys/cpuset.h b/sys/sys/cpuset.h index 219e190f0b37..b036b45da283 100644 --- a/sys/sys/cpuset.h +++ b/sys/sys/cpuset.h @@ -56,6 +56,7 @@ #define CPU_OVERLAP(p, c) __BIT_OVERLAP(CPU_SETSIZE, p, c) #define CPU_CMP(p, c) __BIT_CMP(CPU_SETSIZE, p, c) #define CPU_OR(d, s1, s2) __BIT_OR2(CPU_SETSIZE, d, s1, s2) +#define CPU_ORNOT(d, s1, s2) __BIT_ORNOT2(CPU_SETSIZE, d, s1, s2) #define CPU_AND(d, s1, s2) __BIT_AND2(CPU_SETSIZE, d, s1, s2) #define CPU_ANDNOT(d, s1, s2) __BIT_ANDNOT2(CPU_SETSIZE, d, s1, s2) #define CPU_XOR(d, s1, s2) __BIT_XOR2(CPU_SETSIZE, d, s1, s2) diff --git a/sys/sys/domainset.h b/sys/sys/domainset.h index 42891263b81b..f98b175e9bc8 100644 --- a/sys/sys/domainset.h +++ b/sys/sys/domainset.h @@ -54,6 +54,7 @@ #define DOMAINSET_OVERLAP(p, c) __BIT_OVERLAP(DOMAINSET_SETSIZE, p, c) #define DOMAINSET_CMP(p, c) __BIT_CMP(DOMAINSET_SETSIZE, p, c) #define DOMAINSET_OR(d, s) __BIT_OR(DOMAINSET_SETSIZE, d, s) +#define DOMAINSET_ORNOT(d, s) __BIT_ORNOT(DOMAINSET_SETSIZE, d, s) #define DOMAINSET_AND(d, s) __BIT_AND(DOMAINSET_SETSIZE, d, s) #define DOMAINSET_ANDNOT(d, s) __BIT_ANDNOT(DOMAINSET_SETSIZE, d, s) #define DOMAINSET_CLR_ATOMIC(n, p) __BIT_CLR_ATOMIC(DOMAINSET_SETSIZE, n, p) From nobody Sun May 12 15:58:01 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VcnMY2yb1z5KGCq; Sun, 12 May 2024 15:58:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VcnMY2S6Wz4P48; Sun, 12 May 2024 15:58:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715529481; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xKPgjYIF3IeWPqFix3O6lG4cLcbb0+dhyAG9X7G3MYE=; b=MrglLDHMI2cKzAHFLbTMstHN9qfskxfOV7yBYP2AkYe0ezqm1stqFbaoSXGccbr8XRL6sF IaaqSJ45sjdOS/4KK+dEuj068cIGKhCrP1mKapoJpkvSMv/phpkSqzklznK3gxqsb1HXfd OfufRucQXUgapyyB/DSAz+eRUdlBjFK+LNyc/PHQL9CX30dA+neYKaAbHtYo139Spnareo Afl7U7OTjYhBJmGpk3oXYBxgcYmzQoih9vreSvrLEmi5yccSrn4Ay+JiPjyRNrKG2MfniO F7XKC+Firc5TLP2dtkyHlVHgtG72aEdxzZjNPRez9dABcVeaS7prgu4/ZSJrgw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715529481; a=rsa-sha256; cv=none; b=HaZfKPP0nfXiThXwvJE6ZCNvEEER66K2ZDZIeS4tWqqcMy6t+gmzXloQsRBhRMRN0xJWZV VaP50qE1A3LUcOESs7yQDaRviJMoGXCNDQVYssqiuXC3/IgIuaHQgx1loeNizp8e+r0m3P DR3OCYAUbkjZ+Sq6KT6qRF+xfQYIQPIS8KjPSOuw4ZMaMVkNfrQGxPJALcpXS1LEuBuMBw GFo6hddnCgz0BIeq/fNTMFeKOWL/BEPVgRrI0Oiitn59lAyADeTc+DOHxkqmLIdy6QKz97 ZbMw86HtIyUAcJk9C/fU98/WsFvL+ktlywoKPRytQIjpiIRsW1Pz5G5tpFV9pQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715529481; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xKPgjYIF3IeWPqFix3O6lG4cLcbb0+dhyAG9X7G3MYE=; b=aL5sKYc46crSaY2u0+DQp5FKX2n2R/aas0S2u38oq5Dj754DMH/H6s/kuu1ql3oBN8CkgT qVB0Xtn7u7rrxynYbBUG20ss9j2MKTxzeCqtDZ59aE6SP+A7wTOyL582ZdlbsPpQYwxU78 fNDYhJoicGdgtvrlKwqenVfVzaDe8bu7eCDBVZDc4EdnwAZO43eJbNj+HfeI2RMPvQYv2f O+HgN9kD85u+iyvfwekl76ZKuETTucAOOiCeaQ50R9jmMlgX7CQqxzIRK+mA+Ox29Os6Tx OPGTOLC7BoRIsyLRnNgKr+BIGAMmDvYQ+OYKrRxdITv7L3YH8STYXwr8C2AQ0g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VcnMY22ywz19CZ; Sun, 12 May 2024 15:58:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44CFw1vc007855; Sun, 12 May 2024 15:58:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44CFw1Vs007852; Sun, 12 May 2024 15:58:01 GMT (envelope-from git) Date: Sun, 12 May 2024 15:58:01 GMT Message-Id: <202405121558.44CFw1Vs007852@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Tijl Coosemans Subject: git: e6cdeb9d9187 - releng/14.1 - linuxkpi: Fix set_memory_* List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tijl X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: e6cdeb9d91875773a64ef61b5a9dcfb0ded90799 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by tijl: URL: https://cgit.FreeBSD.org/src/commit/?id=e6cdeb9d91875773a64ef61b5a9dcfb0ded90799 commit e6cdeb9d91875773a64ef61b5a9dcfb0ded90799 Author: Tijl Coosemans AuthorDate: 2024-05-03 13:27:29 +0000 Commit: Tijl Coosemans CommitDate: 2024-05-12 15:55:14 +0000 linuxkpi: Fix set_memory_* set_memory_* is currently implemented using PHYS_TO_DMAP but not all architectures have a DMAP. Looking at how this function is used the given address isn't physical but virtual so the PHYS_TO_DMAP call can simply be removed. Also cast numpages before shifting it to avoid overflow. Reviewed by: kib, markj Approved by: re (cperciva) Differential Revision: https://reviews.freebsd.org/D45057 (cherry picked from commit 7206f7c619912bdd4d54dd539824733eae50c3a9) (cherry picked from commit 147ea7d4092f4b08411724bd501283a281ffa34e) --- sys/compat/linuxkpi/common/include/asm/set_memory.h | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/asm/set_memory.h b/sys/compat/linuxkpi/common/include/asm/set_memory.h index 69f659001c60..1019aaf264a0 100644 --- a/sys/compat/linuxkpi/common/include/asm/set_memory.h +++ b/sys/compat/linuxkpi/common/include/asm/set_memory.h @@ -34,26 +34,20 @@ static inline int set_memory_uc(unsigned long addr, int numpages) { - vm_offset_t va; vm_size_t len; - va = PHYS_TO_DMAP(addr); - len = numpages << PAGE_SHIFT; - - return (-pmap_change_attr(va, len, VM_MEMATTR_UNCACHEABLE)); + len = (vm_size_t)numpages << PAGE_SHIFT; + return (-pmap_change_attr(addr, len, VM_MEMATTR_UNCACHEABLE)); } static inline int set_memory_wc(unsigned long addr, int numpages) { #ifdef VM_MEMATTR_WRITE_COMBINING - vm_offset_t va; vm_size_t len; - va = PHYS_TO_DMAP(addr); - len = numpages << PAGE_SHIFT; - - return (-pmap_change_attr(va, len, VM_MEMATTR_WRITE_COMBINING)); + len = (vm_size_t)numpages << PAGE_SHIFT; + return (-pmap_change_attr(addr, len, VM_MEMATTR_WRITE_COMBINING)); #else return (set_memory_uc(addr, numpages)); #endif @@ -62,13 +56,10 @@ set_memory_wc(unsigned long addr, int numpages) static inline int set_memory_wb(unsigned long addr, int numpages) { - vm_offset_t va; vm_size_t len; - va = PHYS_TO_DMAP(addr); - len = numpages << PAGE_SHIFT; - - return (-pmap_change_attr(va, len, VM_MEMATTR_WRITE_BACK)); + len = (vm_size_t)numpages << PAGE_SHIFT; + return (-pmap_change_attr(addr, len, VM_MEMATTR_WRITE_BACK)); } static inline int From nobody Sun May 12 15:58:02 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VcnMZ5jHnz5KGM9; Sun, 12 May 2024 15:58: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 4VcnMZ3hbZz4PDV; Sun, 12 May 2024 15:58:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715529482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9Ydb9HOsWPhGtcGKh7WY+1wGBL5LpUUhU4ODBEmi1Og=; b=CuGmxE4bVMsn/ngdXu0NLgF6nBWdiOTANnccH15Ra3l9E8pgTKWsR8amOIll01Rh0x6ShG FW/MKk18gfiil6ZR2R+IQcfGJQAgovKF/nHMkoh6naTWGOqJmkfBrbsfCie/7aBK+hOZYE TEk+4ktmIQ/yqV6gMfZ6gX3s9B2vBivYjgQca7oXywSvIbQikJyP60Eos1WSRNDH3MoGVP E2l8eDclwPmIHrSLimo9TxvM7Ui4d1kOpXNqQlhwl/avVsE8YNVgE3EVBf8kmCkSJSchV3 ZmnK0VEQbyI3jw58mfVWBnTwsMwmz6v854hFwbJ6oGXlWiFMvP8Yolxjc6ElLQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715529482; a=rsa-sha256; cv=none; b=v/zx0mRzXADZYLaDzt/nKheUdLMW9VMkSZYa/Mx7P5jbG/A1yySlox7I83ASbioXvulOUY 9W/Npm/wqKjtfQT+vdqIuIH2wwQ7GG57GtmqN77EzEWx337qZ24xz0nmdO7o7Vm8i8FQOX kkRSItyg+JTNJoNZRj+Bpn0wTXUDxsxSNrCk9XxVszkwPtKjBuPnRQqv2V7fl0EEYCUKeR 0vfOOHZb09o6R7a5rt52biT07Hvnt7jic2Mi63LkC1y7CrGYqdh+lTLKHGnAmr5eqoahMC eu+m73P22WNB/WFEhZshsyQ9mFRKVf10GwdIHPSZjQCpCyeRAA9Ei/+vBmGMOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715529482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9Ydb9HOsWPhGtcGKh7WY+1wGBL5LpUUhU4ODBEmi1Og=; b=rsAWMHsS1IzGGzclneYXVi0NufS3W+XVrDFdaM9LqMoRF+YKtccU2ciaW7Lx5ldMBJ2T4q h3Fajyx+JMHUKfHLYfldHvYwxEksTL6GmDU/IzhDXMFqGo6Xb1D8Z53R1JDc4+a4quC4sY KCg0gIUz1t1Yu4hYSrW0KujVpx6NweBUp5seLCX6+Vb0i7g4YMzz42g/1ByEmrsqA8yKvX LKJFKst6U6E3tsKGJykMjOyHXwBeRjfJ6VuTLB1Uv8PvCruuv0o+ym132q52s5wRIj4sL9 jmtyN8isAK8GJC0al7BBhP+X4sd751N6/Ht7tW12Z4ublPCwaF1dV2XMX6rkxg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VcnMZ30w5z18g8; Sun, 12 May 2024 15:58:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44CFw2g1007894; Sun, 12 May 2024 15:58:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44CFw2PE007891; Sun, 12 May 2024 15:58:02 GMT (envelope-from git) Date: Sun, 12 May 2024 15:58:02 GMT Message-Id: <202405121558.44CFw2PE007891@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Tijl Coosemans Subject: git: fe13793bb442 - releng/14.1 - linuxkpi: Make arch_io_*_memtype_wc amd64-only List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tijl X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: fe13793bb44212607c231a9c793de05aea74dc7b Auto-Submitted: auto-generated The branch releng/14.1 has been updated by tijl: URL: https://cgit.FreeBSD.org/src/commit/?id=fe13793bb44212607c231a9c793de05aea74dc7b commit fe13793bb44212607c231a9c793de05aea74dc7b Author: Tijl Coosemans AuthorDate: 2024-05-08 18:49:56 +0000 Commit: Tijl Coosemans CommitDate: 2024-05-12 15:56:55 +0000 linuxkpi: Make arch_io_*_memtype_wc amd64-only Linux only implements these functions on x86. They return 0 on other architectures. The FreeBSD implementation calls PHYS_TO_DMAP but this panics on i386 because it does not have a direct map so return 0 on i386 as well for now. These functions are only used by graphics/drm-*-kmod to mark the VRAM aperture write-combining but this is also accomplished by a call to vm_phys_fictitious_reg_range so this change is sufficient to fix drm-*-kmod on i386 for FreeBSD 14.1. Reviewed by: kib Approved by: re (cperciva) Differential Revision: https://reviews.freebsd.org/D45125 (cherry picked from commit 2ae0f5a4d0931067c672be9a791909f0e32d5a0e) (cherry picked from commit 2d97bd0639cd0af43b7beb6f45ef15bcf110db57) --- sys/compat/linuxkpi/common/include/linux/io.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/io.h b/sys/compat/linuxkpi/common/include/linux/io.h index bce70ed0cb8d..164347dbc4e7 100644 --- a/sys/compat/linuxkpi/common/include/linux/io.h +++ b/sys/compat/linuxkpi/common/include/linux/io.h @@ -541,30 +541,29 @@ void lkpi_arch_phys_wc_del(int); #define arch_phys_wc_index(x) \ (((x) < __MTRR_ID_BASE) ? -1 : ((x) - __MTRR_ID_BASE)) -#if defined(__amd64__) || defined(__i386__) || defined(__aarch64__) || defined(__powerpc__) || defined(__riscv) static inline int arch_io_reserve_memtype_wc(resource_size_t start, resource_size_t size) { +#if defined(__amd64__) vm_offset_t va; va = PHYS_TO_DMAP(start); - -#ifdef VM_MEMATTR_WRITE_COMBINING return (-pmap_change_attr(va, size, VM_MEMATTR_WRITE_COMBINING)); #else - return (-pmap_change_attr(va, size, VM_MEMATTR_UNCACHEABLE)); + return (0); #endif } static inline void arch_io_free_memtype_wc(resource_size_t start, resource_size_t size) { +#if defined(__amd64__) vm_offset_t va; va = PHYS_TO_DMAP(start); pmap_change_attr(va, size, VM_MEMATTR_WRITE_BACK); -} #endif +} #endif /* _LINUXKPI_LINUX_IO_H_ */ From nobody Sun May 12 16:12:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vcnh35LJKz5KH80; Sun, 12 May 2024 16:12: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 4Vcnh34nFvz4RPl; Sun, 12 May 2024 16:12:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715530339; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kz+diMJvpSY6h5UeCJgr5MOx63jKKCz7EZ4QJUS06H0=; b=F29x0fuCYAspI/Pd47i9dlQfEVV9taoLlL/XHGJxBil3TcrxgiZ4RloAnct1Nh0sIULGQf fco6MwHS3ZT95Uxfvo2sPrSrMBsi0GLMdpUN6lKCexDu/q709vXkB8ysfY8CCPIkGyWWoB 4lcrCn6YekY6ieow6SOQWp0dJ7AJ1Kp1EhzWpw4XBo8D24V2qvm4DfTLSIti2KOCa1JgQm BIng4n8OlpOFcsVvuRO4cRA0KwjsnuVdKhYprDwKVgPk9x64WenVOu6i9UHa00kMozQfb7 wNz08dST+TO+AKJUtMnPWvCPH1osr6n8FldZ2BBg+PjGmvsoHqzV1B6sBz1T+Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715530339; a=rsa-sha256; cv=none; b=rpHXnCjMNVuY4sG6J6Iv1yIwpCOyeDwJr/AHckAWrNqkxhkciCP8fZxVVs+D18Dh++xWIv 3aidfewpR+wl8mkou4qtX2lESi/q8GUXfO5JZzaFmsSCi3nXqj1S6CaV4rqnD2vnlQynS0 lujcRaBaGKgXHrL/+ewZnAiuHyNW6KhtGTa6wIrCFb4Jv9Q/ezP9/oysvbJThwuB/Dsw+n J6o8xAOk56CgDlu0rsFbgTsaS73NwZaavOZopBcimIOAmttnaYfjpNfvcvHDWRYVeN3n7G Vk1B1QsyhwNQkW06TWxIRtkkzcEMXKo0lL23T1M5P8W3TgaVBdPPn95O/C6BJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715530339; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kz+diMJvpSY6h5UeCJgr5MOx63jKKCz7EZ4QJUS06H0=; b=qnCWkk8pWvI7RiaW+yTbakXDx6NHgkMfKeQq4yPLMRA+7XPpkWPBAD2G50a941J1oLwXLr u5pscKJ+Q8O1fJoepjUFnL7ZYIBM50s1DabukEoRLBcZ044SisgJQJnQzGHYDVL4RmpGar SB/NsSjqwyMi6lWNU6qGPIPaMMskr2QhKkYIy06q4Cg+CF/euKTx6OeEESYi4Ws/i2KVM9 WNwdJie6M8Lv6Lx51wYfIaRxIGhM2rR2HFcpGM4kKYsIMjkvhw8NQTJj3gZ0whzgOvbVqe 8EPNsJ8jj0XAt2WBzoVCSrkwNOHLQ/VW3DoQFb9s0oyqwTrHw5/H9M9UUseP8A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vcnh34Nlyz1B1H; Sun, 12 May 2024 16:12:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44CGCJ9B041686; Sun, 12 May 2024 16:12:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44CGCJ2L041683; Sun, 12 May 2024 16:12:19 GMT (envelope-from git) Date: Sun, 12 May 2024 16:12:19 GMT Message-Id: <202405121612.44CGCJ2L041683@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 9a8a26aefb36 - stable/14 - if: guard against if_ioctl being NULL List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9a8a26aefb366ef6f497d48547a1562a1de566c1 Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9a8a26aefb366ef6f497d48547a1562a1de566c1 commit 9a8a26aefb366ef6f497d48547a1562a1de566c1 Author: Kristof Provost AuthorDate: 2024-05-06 09:39:08 +0000 Commit: Kristof Provost CommitDate: 2024-05-12 16:12:04 +0000 if: guard against if_ioctl being NULL There are situations where an struct ifnet has a NULL if_ioctl pointer. For example, e6000sw creates such struct ifnets for each of its ports so it can call into the MII code. If there is then a link state event this calls do_link_state_change() -> rtnl_handle_ifevent() -> dump_iface() -> get_operstate() -> get_operstate_ether(). That wants to know if the link is up or down, so it tries to ioctl(SIOCGIFMEDIA), which doesn't go well if if_ioctl is NULL. Guard against this, and return EOPNOTSUPP. PR: 275920 MFC ater: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 43387b4e574043b78a58c8bcb7575161b055fce1) --- sys/net/if.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/net/if.c b/sys/net/if.c index 0128fb8039ee..1ca0893eb724 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -4873,6 +4873,9 @@ if_resolvemulti(if_t ifp, struct sockaddr **srcs, struct sockaddr *dst) int if_ioctl(if_t ifp, u_long cmd, void *data) { + if (ifp->if_ioctl == NULL) + return (EOPNOTSUPP); + return (ifp->if_ioctl(ifp, cmd, data)); } From nobody Sun May 12 17:01:37 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vcpmx1zwzz5KM7w; Sun, 12 May 2024 17:01:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vcpmx1XDkz4Xd3; Sun, 12 May 2024 17:01:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715533297; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PFhgPahoSecelBiuCkO1IkvWV5i7i8cwSSVNtUIhpAQ=; b=cy/2iuLHl5DoqceiwGv9XOh7amm9HD1Q8/+o1KowE3hXiW+A/pvFdsSkH0VNZepjjtTayb RCrRQK8SVR4Lw91eCyZpmC6bZUMvpWZ7srMDUTlr7Ms6GalXR0tltuP6tSW2meE4QhrfDi ldnBpDjiys3Q9s/4lcBNd9UWPOWoAh9kI4Ea/IfCr7qLmMwgYATpj+W7cfn7t2dajTft0k 0eyDx6U3hWY8NajM8CTmgDp637uaJ4258bImGqAbzySS2uWDnFR0NGSsAELlo7AvKAvA1J 84DExbyMhUgQJq+nfYC3W+zkQscDRNDOSupT6GlDkIEYj4yHrEzAsq5sqG3MbA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715533297; a=rsa-sha256; cv=none; b=QmPVhHcp6MfROod8iODYn3HWYXxyRv6JtLMJA8fs8ad/qAjtUljX13jx6FqcHNBG3RMA/R 0D5Phrgqb4TGVIVJrBMAiEy++fElizn1VaQmNm9nVAot3Ec/Mu6WWuilLodaFfjpJBD+Ny WuHbKc0fC+8tz5ygZUtTGnlwka9oxvDSU8vh9lk6lKdwJ8xABLDij4nbioztwaSwcjQG4E n7bNPtPS+QprXp3v1U1BmB7/j5/sVe2tMSe1V8J6kGxIyeZhSojxKXkaj6M/7szTZqFeab 5Gr25frCRF4ahTulpIbg+SHjlZ4+ByjRTC1rm1A5Wc4JaO4qQ92LSSSBPwinVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715533297; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PFhgPahoSecelBiuCkO1IkvWV5i7i8cwSSVNtUIhpAQ=; b=m8Dv9ibNDAYcN4+Q3FLZRPT8Y53KrYhfZ4ySkmR1dwYMYpRBXdVJMHq3CL1aOuEkc3tzLJ qHLWB0XjjJU3DhaA96O6lahH/I9oYDUNVi5qZ1qQ0/KsLvwDtvVRJ1XIlz8xdUjyjDbC14 EZzeGokGK43GHkpdYPM6QsE8NCjdGVHGweKFC04kcDLTzvGtXjkp1Wrn4SLhYNwKgzGHk0 ZYRz6TPNmkCRlJE5RrYKhuqVnoYJ1NEPxwe34u3llWxJZM2J4WmaMuNcd8Yx/4ocfd11Uy hsl0uUTAHM5i5ynMqueIldXboeRe0hyAIZEYayHA6vkaratYZGcoAw+5dmKjSg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vcpmx1849z1C6T; Sun, 12 May 2024 17:01:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44CH1b6W021360; Sun, 12 May 2024 17:01:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44CH1bnP021357; Sun, 12 May 2024 17:01:37 GMT (envelope-from git) Date: Sun, 12 May 2024 17:01:37 GMT Message-Id: <202405121701.44CH1bnP021357@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 502a1018002e - releng/14.1 - bhyve: Do not define GDB_LOG List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 502a1018002e418df05c801edd03572129feb36c Auto-Submitted: auto-generated The branch releng/14.1 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=502a1018002e418df05c801edd03572129feb36c commit 502a1018002e418df05c801edd03572129feb36c Author: Mark Johnston AuthorDate: 2024-05-08 16:06:22 +0000 Commit: Mark Johnston CommitDate: 2024-05-12 16:36:26 +0000 bhyve: Do not define GDB_LOG This had been added for debugging and shouldn't have been committed. Approved by: re (cperciva) Fixes: f81cdf24ba54 ("bhyve: Add support for XML register definitions") MFC after: 3 days (cherry picked from commit 5d62025d82a0be928f98778d54b25ad89edbb835) (cherry picked from commit d8ccaa995f4539081f79e9b31ff0ac75173e1004) --- usr.sbin/bhyve/gdb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/usr.sbin/bhyve/gdb.c b/usr.sbin/bhyve/gdb.c index 2a075cd10ca6..0319aaf0a9cd 100644 --- a/usr.sbin/bhyve/gdb.c +++ b/usr.sbin/bhyve/gdb.c @@ -193,7 +193,6 @@ static const struct gdb_reg { { .id = VM_REG_GUEST_EFER, .size = 8 }, }; -#define GDB_LOG #ifdef GDB_LOG #include #include From nobody Sun May 12 18:09:10 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VcrGt3jHmz5KRyh; Sun, 12 May 2024 18:09: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 4VcrGt2HJ8z4d7y; Sun, 12 May 2024 18:09:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715537350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oALKsNVjYqrJPSNpGDq+WCjLD9+vkIf0FUsBPohWQ9s=; b=gzBGrWZcgjI+iF0oDVGlttlruqlxtrOTQw4lHMJGx9dKmCSlJWO+MFiqonFm3P0fxcAODt jV244Qw9mlXUEgfNfI89KY1l6aqB5O3OHK/IUUQFUAuL2zmFrrPORFCHFO9zZ3nYyRH2QJ 10SlTsuflCRS+UosT8FTgUg9wXFOnNTCJTl45siH0jJeHvZ03X5ygNZPlPIf5cScxEgfXC DmH8/Dd/TgbUEjjPFYUR5FVVAZg9pSKjCVW1N2iHWjG7WPIQFxwu2CemCJu+NUJQ4i3FB+ y3axJv711de/zoi9SybY3keWpOe0x/1AoLFinHWZ+Ht82/Qi55c1w88TNYVgtQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715537350; a=rsa-sha256; cv=none; b=nH7BVqoOshxEatH0nCCJsJKBR0Lzwaz7lzOORxx6oUGe+k7ffGxoAB9uf2r2Q63yY076m7 kN0YfQY2lVphLDtxWzisnGL4Fv0x3GIQeMFvs2avlX5Yep2NLKOW4cqvcFZF81MFZEbZaW qCnW+RchLiAKZ1DaBUvyfaY2JGiLBoTq9GesriKBOvUNDOmM85KhnYqnbiRd6l76r1lWWm LO30z8kW0tae6soiE87jd3Z4BvRoHpYISZq0W9JOM4hH1y8lto2oArCCPc9xeKLC3oCJUE 6XfR6hE5wFq0B7snR0CnCCOUBorKRcu8PXE13FYrO6o1hF7rq4VpP8HzymcIfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715537350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oALKsNVjYqrJPSNpGDq+WCjLD9+vkIf0FUsBPohWQ9s=; b=Uuv56jNOriGaTweKJGhtnXksAa0ZNNIeckN3n/cFvHFbYzsIVoH3rq2JQmqaoA2FAIUxKh uaw63Z9bNyWm7UzGsQ/qUi7snYMxB2FWdOEXOiJtCMvkhpGq8IZLaa0NFyKFVNiA/dc/OW xJz0N4EWapd75tr0m8eEZ4Nw4TAmF0XssGhOkP192dJA9UzfmcKTe1Hfk41WWbZWcu7LzQ b4nxfvXF1dBfpehBeU4mWE3iOvqsDEn44zkDNQbchj6RafzhFfJEWUjHeVq13urPfQ96Rr gMWnGI9ZXa8RnreHQbK4BebPyzFynlfevGmyJYYrkE9iGh4rJQ5qSNHJSoyDnQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VcrGt1txqz1Crb; Sun, 12 May 2024 18:09:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44CI9Aht028722; Sun, 12 May 2024 18:09:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44CI9A8m028719; Sun, 12 May 2024 18:09:10 GMT (envelope-from git) Date: Sun, 12 May 2024 18:09:10 GMT Message-Id: <202405121809.44CI9A8m028719@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: aec52a27f987 - releng/14.1 - Merge commit 5300a6731e98 from llvm-project (by Jonathan Peyton): List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: aec52a27f987eef4f21c07f83cdc783fbdede2db Auto-Submitted: auto-generated The branch releng/14.1 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=aec52a27f987eef4f21c07f83cdc783fbdede2db commit aec52a27f987eef4f21c07f83cdc783fbdede2db Author: Dimitry Andric AuthorDate: 2024-05-08 16:55:08 +0000 Commit: Dimitry Andric CommitDate: 2024-05-12 18:08:18 +0000 Merge commit 5300a6731e98 from llvm-project (by Jonathan Peyton): [OpenMP] Fix re-locking hang found in issue 86684 (#88539) This was initially reported here (including stacktraces): https://stackoverflow.com/questions/78183545/does-compiling-imagick-with-openmp-enabled-in-freebsd-13-2-cause-sched-yield If `__kmp_register_library_startup()` detects that another instance of the library is present, `__kmp_is_address_mapped()` is eventually called. which uses `kmpc_alloc()` to allocate memory. This function calls `__kmp_entry_thread()` to access the thread-local memory pool, which is a bad idea during initialization. This macro internally calls `__kmp_get_global_thread_id_reg()` which sets the bootstrap lock at the beginning (before calling `__kmp_register_library_startup()`). The fix is to use `KMP_INTERNAL_MALLOC()`/`KMP_INTERNAL_FREE()` instead of `kmpc_malloc()`/`kmpc_free()`. `KMP_INTERNAL_MALLOC` and `KMP_INTERNAL_FREE` do not use any bootstrap locks. They just translate to `malloc()`/`free()` and are meant to be used during library initialization before other library-specific allocators have been initialized. Fixes: #86684 This should fix OpenMP processes sometimes getting locked with 100% CPU usage, endlessly calling sched_yield(2). PR: 278845 Reported by: Cassidy B. Larson Approved by: re (cperciva) MFC after: 3 days (cherry picked from commit da15ed2e982180198f77a0fa26628e6d414cb10e) (cherry picked from commit 426e07d791641e80e90af89d52008635a35e4794) --- contrib/llvm-project/openmp/runtime/src/z_Linux_util.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/llvm-project/openmp/runtime/src/z_Linux_util.cpp b/contrib/llvm-project/openmp/runtime/src/z_Linux_util.cpp index b9ff96873702..97ddb8a608b7 100644 --- a/contrib/llvm-project/openmp/runtime/src/z_Linux_util.cpp +++ b/contrib/llvm-project/openmp/runtime/src/z_Linux_util.cpp @@ -2129,10 +2129,10 @@ int __kmp_is_address_mapped(void *addr) { // We pass from number of vm entry's semantic // to size of whole entry map list. lstsz = lstsz * 4 / 3; - buf = reinterpret_cast(kmpc_malloc(lstsz)); + buf = reinterpret_cast(KMP_INTERNAL_MALLOC(lstsz)); rc = sysctl(mib, 4, buf, &lstsz, NULL, 0); if (rc < 0) { - kmpc_free(buf); + KMP_INTERNAL_FREE(buf); return 0; } @@ -2156,7 +2156,7 @@ int __kmp_is_address_mapped(void *addr) { } lw += cursz; } - kmpc_free(buf); + KMP_INTERNAL_FREE(buf); #elif KMP_OS_DARWIN From nobody Sun May 12 18:09:11 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VcrGv5YWWz5KS4Q; Sun, 12 May 2024 18:09: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 4VcrGv3KNNz4d6d; Sun, 12 May 2024 18:09:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715537351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C/qAVBWa4nuj1uAqm5Kcfs+XefH4ccb8XslZ2UvYwWs=; b=stAhZLYUBqUlRlIFdOtTJfTDFGSx1MBFgtvivdAAuaX1BWIJ+2BvnF5onZj5828M5/BlMq HKNw1YHO27XzxFzojQzVtK2Jh4pOaDFAiDmULbDOcLmFMBI7JhOyEbQKJvewjwUsY+35Xl x1fMghUKxAVBluq7pB5yC3kn8msW6MHqAvBA6nwtmeXCE6GmtdQAJpCGoITp9zTyDMOLyA +9w+Fen8E3mEqG527FOuHgD4jLiwfhFgeGavE5XeUY54MBt9k/dq4oT36ccpTuZwodvZJc DGHiEUYHsT0PsEpv1GKfF5uhtyfJ34w8LPaoJvsAz7EOgOFjY4QtySDF3BV0AQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715537351; a=rsa-sha256; cv=none; b=k9qA+fUIZWSYl0hAecByKc6wB/JycalEEmoAHAnTb03YOC+AW5VvL7pnRXicOcx0Vz2DaD 5c6U/FEQoe9V8FEkTMecNNk/6Dr38nZOFWQW/fBd7FjUiiaqvgvWswMm4WLHaHXgMiw5XC M2lGdJKxQLW0hbVBi2t6HpBaKnV1GDhVsEacbhkooJX0oNbTejcZY7MxPbis64ta9Qp4AZ yF7quh/BQhPzBk0wCd8aRlTeZ94xAd9iPJUKLIy4mbe1Y5A458LCMA/GYYXaFFkCskHGna uuWVrX3LuquP1hEW/7j3K92KjOeQzuMksyB574QnrNMeKvjp/q35Yecow8H8Cw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715537351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C/qAVBWa4nuj1uAqm5Kcfs+XefH4ccb8XslZ2UvYwWs=; b=WWINpfmx/rpIb4q0ehpWrJM61KJTu0zHS6cG48kOU6YufNykHM6tIU8KHJPcWT9hLyMFB1 4OUmiNgoH+taS+otE86oGlOKLfR5RXr87oWdpheM5orXAzE+8MGKQMRUdFQquBYQYngTmp etaCMSfGkBbuYhAhHemuACwXTVcLcyPuepu6CtctGvazVweyxeQe4WV90XjJHsCXfJ1vn7 CFeKw34UTz1Jb4nHgrrh17tLap9W2URhgxgqAfpJ2w6HVVwDs9+fgiA5yoiN79xzaLfjjM AEMPg0V34++N0xu/7XLZX5Hfx1ZENorr/gQ/k0x9MYRGsGNeP5/wrvPQmN8BsQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VcrGv2wxBz1Cpq; Sun, 12 May 2024 18:09:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44CI9BTM028773; Sun, 12 May 2024 18:09:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44CI9Bot028770; Sun, 12 May 2024 18:09:11 GMT (envelope-from git) Date: Sun, 12 May 2024 18:09:11 GMT Message-Id: <202405121809.44CI9Bot028770@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: ba0bd7cea412 - releng/14.1 - Merge commit 73bb8d9d92f6 from llvm-project (by Jonathan Peyton): List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: ba0bd7cea412c6dc51ebfebd4000a543e49013bd Auto-Submitted: auto-generated The branch releng/14.1 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=ba0bd7cea412c6dc51ebfebd4000a543e49013bd commit ba0bd7cea412c6dc51ebfebd4000a543e49013bd Author: Dimitry Andric AuthorDate: 2024-05-08 18:44:28 +0000 Commit: Dimitry Andric CommitDate: 2024-05-12 18:08:46 +0000 Merge commit 73bb8d9d92f6 from llvm-project (by Jonathan Peyton): [OpenMP] Fix child processes to use affinity_none (#91391) When a child process is forked with OpenMP already initialized, the child process resets its affinity mask and sets proc-bind-var to false so that the entire original affinity mask is used. This patch corrects an issue with the affinity initialization code setting affinity to compact instead of none for this special case of forked children. The test trying to catch this only testing explicit setting of KMP_AFFINITY=none. Add test run for no KMP_AFFINITY setting. Fixes: #91098 This should fix OpenMP processes sometimes getting stuck on a single CPU core. PR: 278845 Reported by: Cassidy B. Larson Approved by: re (cperciva) MFC after: 3 days (cherry picked from commit 22b3e7898ecdf90887a9536fab5b9a6f7a291723) (cherry picked from commit 91df7d335dd44fa3cf506b35987d791502613ed4) --- contrib/llvm-project/openmp/runtime/src/kmp_settings.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/llvm-project/openmp/runtime/src/kmp_settings.cpp b/contrib/llvm-project/openmp/runtime/src/kmp_settings.cpp index ec86ee07472c..58f19ea5b8ab 100644 --- a/contrib/llvm-project/openmp/runtime/src/kmp_settings.cpp +++ b/contrib/llvm-project/openmp/runtime/src/kmp_settings.cpp @@ -6426,6 +6426,8 @@ void __kmp_env_initialize(char const *string) { } if ((__kmp_nested_proc_bind.bind_types[0] != proc_bind_intel) && (__kmp_nested_proc_bind.bind_types[0] != proc_bind_default)) { + if (__kmp_nested_proc_bind.bind_types[0] == proc_bind_false) + __kmp_affinity.type = affinity_none; if (__kmp_affinity.type == affinity_default) { __kmp_affinity.type = affinity_compact; __kmp_affinity.flags.dups = FALSE;