From nobody Mon May 13 04:50:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vd6WQ0j1Xz5KChN; Mon, 13 May 2024 04:50: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 4Vd6WP5B18z4H4m; Mon, 13 May 2024 04:50:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715575857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5C9a7fkDK/jdd6PR2vGUGPW+vo8n4zEJiMt0B2JUuUo=; b=OiqEMgSnnU4+SmRTQvzHLcOMnaI86tLq+2Cn3niuBAZQpP1xtM5PSznYxkPit0v405fkQO j7nQ1nCXngF3zeg8OdWjjt1cQiJJi1AZDwxax8fi9b9Fb14lYbSrwrN90rv7oEbtGYiSkx rd9bjuxdnOQrYfsSthdIt1p8rbmdjXWYF/oV3fPc/K0d4mo3HmgzHFAuBWnZ9pN93MtBmj torguJNLRNxhPUR1J96YdG6J16gcjJc3gFX01rJEsxma37Cbw6BUZTFBG5T9GoGRkAgL+N TE2K/BgE7zO2RUcRLUiihUP5kg/yUFYRqjE5N3Y582IVBbgswLatlg29VV1cHg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715575857; a=rsa-sha256; cv=none; b=Gt9XCo+7fDUXwZnCkGBafwpuw9L0iPQZzSvCbHroVEpK3fTZf8Mp5zG25eIXSSX+CTO63V qOON3z5f0NlSIQqeoUU3FDiKYwYjM/nncmb3tjn0eEitOkXy0DWmVauAWeFjddqO41mL1t dPAqHYlbCD+VW4TL4ABpH1YRe7/EYUq7C34QL4HvjsFO9eaTn8oHhkGMRez2AtvTFYxiPf vesMw3pyHRvcMtfsco3d4RFNN7aeihw8ADN/vHaLBYyJTLY7pSrkjMSfdiSNnIC2tK1JUz 29Vc3UCijfleOHddpK3X314g3h3rEc1zFwWj2TjiOqqnGYWZ5koui1EoMz9WIA== 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=1715575857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5C9a7fkDK/jdd6PR2vGUGPW+vo8n4zEJiMt0B2JUuUo=; b=r8Am1NozyA5FMXkVRM+7BCHnT0EgghWM+NCVtJErsMc6+YoLIMtuMXXlVqZ1Us4qiy6yoq Qk1LwTplEO19aVJ/fcAnA/MhjApIfQ4kVFWFczD6BvZNI7Vc/myH+8ZvGEL2e3LBSR8YeK hkW3BJz4o5qGaXqU73FKHU7n5dvL+QEmmclcd4XlIWi6Se3fSsWEoa9Uh2wHtRjGXBVBjc 2KtZxaGvcItMkmQe4CaodsLCLEqQPnDnPbXHeQR4/CkOJZNj7RyrppO2gF5mQEsWd7Qrme YYyq4yePe7b4oWkHrnRHQPFLnXQFDYYFbrhwueUYn4xcOpP7HKPezE6NoU7mGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vd6WP4pCWzZTR; Mon, 13 May 2024 04:50: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 44D4ovlI026274; Mon, 13 May 2024 04:50:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44D4ov5g026271; Mon, 13 May 2024 04:50:57 GMT (envelope-from git) Date: Mon, 13 May 2024 04:50:57 GMT Message-Id: <202405130450.44D4ov5g026271@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: 2c65656b29fb - releng/14.1 - nfsd: Fix Link conformance with RFC8881 for delegations List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 2c65656b29fb803edeeda931c6771c7c22c9efac Auto-Submitted: auto-generated The branch releng/14.1 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=2c65656b29fb803edeeda931c6771c7c22c9efac commit 2c65656b29fb803edeeda931c6771c7c22c9efac Author: Rick Macklem AuthorDate: 2024-05-04 21:30:07 +0000 Commit: Rick Macklem CommitDate: 2024-05-13 04:49:04 +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. Approved by: re (cperciva) (cherry picked from commit 3f65000b6b1460a7a23cd83014bb41a68d1a8a19) (cherry picked from commit 3c414a8c2fb37ca37de454aaa145e7bcaefcaa05) --- 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 Mon May 13 05:24:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vd7Fj25yDz5KFwd; Mon, 13 May 2024 05:24: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 4Vd7Fj1jlbz4L55; Mon, 13 May 2024 05:24:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715577849; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YT21CHNhoi0pCvy9vskQQtrMAwwGDBGS02Z8zmA+Zm8=; b=r7CmFJmMg3+DSgGlzxzlfwFernqqpPFYCTSDOeTm96EcAocfRBbq8Gd8dQKeHfyjY2Qb9l O/cWaoKDfl9TDhsLPAT3Ftm9u5OZerJkVtnVUm1JKeQi1S7JHj7qBQssj1n+frItkhy+Oo Z6ujxxWIKq2Dx82vz4XPIAQwPpstxR7z11hVtJ9n18fKS7kfmDbP5N3n1tID7GEhYbbgGJ rZgCE9vc2kpxfh0InBCH1nvdxZIk3O2lbJOTWHAmlJx9rgEUK7DTbQ4q7/G/nU1EiawE3r t7Qn9AsTXd5hBopu2aRKuJKLF5iXTwhwbRYezgNSPYaYbUAng+RbacP6RycHCw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715577849; a=rsa-sha256; cv=none; b=WVEyZqJjMRV7GCZCBbNrrPZcis3OVhqNzl5KbZ6e4toV0pPFqd6xSr6WNpS1yHrjnHLGnD NrrS/AndA3cRgC66qvRE6kKrdvhXdQcqIn6PttbqiCWHjyVojQ/rJuKtGDRecE3+kQhXIF F3utMjl+ItKlV5kNbtiZzNV5PFZPcYustDcoVnaMsRZS5L1wu2y+ZVIBS9d8Rg5Lr+37v7 4TkwfB5ywcUp12ibvVLf4NebWKErVeYW+b1JFKv4OMT147WtLyf4VdJDD4zXxUbCBHI4lL ncnvnxWJEoZPsMvSoFEwQH/mvdI83bm8CbFoz5snTN3F1mHJ/cEnsRdaEhkFDQ== 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=1715577849; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YT21CHNhoi0pCvy9vskQQtrMAwwGDBGS02Z8zmA+Zm8=; b=Pwz7vYSXO5W5STS0qStdS+iygQFFvgsujT0JciLFVag+rGDC0LlWE9K3974c0J5icAlMOA UL8E+NzZVCKp3pY6BGFyuf0oGHmE/H/pqTVxImDWKZJKIumBArYGshvT9W2qWvoouArKsV EWkfABZjQSNUvoPgMsvjJGD9cFhIH/LwlATSOgwGPUTD5d+0lfMxwyekmow6BR/hIo0Rlz iMpt0bQh3C09rjDNL3pzNvydQXVJsuB4L0GM1u4sIRscS7Y3sS4TNMif2ThoGTgier9cXm nIE/IXbSPagnpgAgSFl1j7XtC8SFzzEmzAR5X4xAosl20NNfK3nKzR7MAFtGKQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vd7Fj1JmXzZsV; Mon, 13 May 2024 05:24: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 44D5O9V1084280; Mon, 13 May 2024 05:24:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44D5O9mN084277; Mon, 13 May 2024 05:24:09 GMT (envelope-from git) Date: Mon, 13 May 2024 05:24:09 GMT Message-Id: <202405130524.44D5O9mN084277@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: be04fec42638 - main - Import _FORTIFY_SOURCE implementation from NetBSD List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: be04fec42638f30f50b5b55fd8e3634c0fb89928 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=be04fec42638f30f50b5b55fd8e3634c0fb89928 commit be04fec42638f30f50b5b55fd8e3634c0fb89928 Author: Kyle Evans AuthorDate: 2024-05-13 05:23:49 +0000 Commit: Kyle Evans CommitDate: 2024-05-13 05:23:49 +0000 Import _FORTIFY_SOURCE implementation from NetBSD This is a mostly-unmodified copy of the various *_chk implementations and headers from NetBSD, without yet modifying system headers to start actually including them. A future commit will also apply the needed bits to fix ssp/unistd.h. Reviewed by: imp, pauamma_gundo.com (both previous versions), kib Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D32306 --- etc/mtree/BSD.include.dist | 2 + include/Makefile | 2 +- include/ssp/Makefile | 6 ++ include/ssp/ssp.h | 91 ++++++++++++++++++++++++++ include/ssp/stdio.h | 93 ++++++++++++++++++++++++++ include/ssp/string.h | 129 ++++++++++++++++++++++++++++++++++++ include/ssp/strings.h | 67 +++++++++++++++++++ include/ssp/unistd.h | 54 +++++++++++++++ lib/libc/secure/Makefile.inc | 11 ++++ lib/libc/secure/Symbol.map | 18 +++++ lib/libc/secure/fgets_chk.c | 54 +++++++++++++++ lib/libc/secure/gets_chk.c | 74 +++++++++++++++++++++ lib/libc/secure/memcpy_chk.c | 53 +++++++++++++++ lib/libc/secure/memmove_chk.c | 47 +++++++++++++ lib/libc/secure/memset_chk.c | 46 +++++++++++++ lib/libc/secure/snprintf_chk.c | 56 ++++++++++++++++ lib/libc/secure/sprintf_chk.c | 61 +++++++++++++++++ lib/libc/secure/ssp_internal.h | 37 +++++++++++ lib/libc/secure/stpcpy_chk.c | 55 ++++++++++++++++ lib/libc/secure/stpncpy_chk.c | 53 +++++++++++++++ lib/libc/secure/strcat_chk.c | 60 +++++++++++++++++ lib/libc/secure/strcpy_chk.c | 54 +++++++++++++++ lib/libc/secure/strncat_chk.c | 70 ++++++++++++++++++++ lib/libc/secure/strncpy_chk.c | 53 +++++++++++++++ lib/libc/secure/vsnprintf_chk.c | 49 ++++++++++++++ lib/libc/secure/vsprintf_chk.c | 58 ++++++++++++++++ lib/libssp/Makefile | 20 +++++- lib/libssp/Symbol.map | 12 ++-- lib/libssp/Versions.def | 5 ++ lib/libssp/__builtin_object_size.3 | 110 +++++++++++++++++++++++++++++++ lib/libssp/fortify_stubs.c | 131 ------------------------------------- lib/libssp/ssp.3 | 130 ++++++++++++++++++++++++++++++++++++ 32 files changed, 1621 insertions(+), 140 deletions(-) diff --git a/etc/mtree/BSD.include.dist b/etc/mtree/BSD.include.dist index a6bd5880bf61..f8c83d6dde7a 100644 --- a/etc/mtree/BSD.include.dist +++ b/etc/mtree/BSD.include.dist @@ -372,6 +372,8 @@ mac_veriexec .. .. + ssp + .. sys disk .. diff --git a/include/Makefile b/include/Makefile index 19e6beb95203..32774419f162 100644 --- a/include/Makefile +++ b/include/Makefile @@ -4,7 +4,7 @@ PACKAGE=clibs CLEANFILES= osreldate.h version -SUBDIR= arpa protocols rpcsvc rpc xlocale +SUBDIR= arpa protocols rpcsvc rpc ssp xlocale .if ${MACHINE_CPUARCH} == "amd64" SUBDIR+= i386 INCLUDE_SUBDIRS+= i386 diff --git a/include/ssp/Makefile b/include/ssp/Makefile new file mode 100644 index 000000000000..dff19f43c920 --- /dev/null +++ b/include/ssp/Makefile @@ -0,0 +1,6 @@ +# $FreeBSD$ + +INCS= ssp.h stdio.h string.h strings.h unistd.h +INCSDIR= ${INCLUDEDIR}/ssp + +.include diff --git a/include/ssp/ssp.h b/include/ssp/ssp.h new file mode 100644 index 000000000000..35a9aeee02df --- /dev/null +++ b/include/ssp/ssp.h @@ -0,0 +1,91 @@ +/* $NetBSD: ssp.h,v 1.13 2015/09/03 20:43:47 plunky Exp $ */ + +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006, 2011 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _SSP_SSP_H_ +#define _SSP_SSP_H_ + +#include + +#if !defined(__cplusplus) +# if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && \ + (__OPTIMIZE__ > 0 || defined(__clang__)) +# if _FORTIFY_SOURCE > 1 +# define __SSP_FORTIFY_LEVEL 2 +# else +# define __SSP_FORTIFY_LEVEL 1 +# endif +# else +# define __SSP_FORTIFY_LEVEL 0 +# endif +#else +# define __SSP_FORTIFY_LEVEL 0 +#endif + +#define __ssp_var(type) __CONCAT(__ssp_ ## type, __COUNTER__) + +/* __ssp_real is used by the implementation in libc */ +#if __SSP_FORTIFY_LEVEL == 0 +#define __ssp_real_(fun) fun +#else +#define __ssp_real_(fun) __ssp_real_ ## fun +#endif +#define __ssp_real(fun) __ssp_real_(fun) + +#define __ssp_inline static __inline __attribute__((__always_inline__)) + +#define __ssp_bos(ptr) __builtin_object_size(ptr, __SSP_FORTIFY_LEVEL > 1) +#define __ssp_bos0(ptr) __builtin_object_size(ptr, 0) + +#define __ssp_check(buf, len, bos) \ + if (bos(buf) != (size_t)-1 && len > bos(buf)) \ + __chk_fail() +#define __ssp_redirect_raw(rtype, fun, symbol, args, call, cond, bos) \ +rtype __ssp_real_(fun) args __RENAME(symbol); \ +__ssp_inline rtype fun args __RENAME(__ssp_protected_ ## fun); \ +__ssp_inline rtype fun args { \ + if (cond) \ + __ssp_check(__buf, __len, bos); \ + return __ssp_real_(fun) call; \ +} + +#define __ssp_redirect(rtype, fun, args, call) \ + __ssp_redirect_raw(rtype, fun, fun, args, call, 1, __ssp_bos) +#define __ssp_redirect0(rtype, fun, args, call) \ + __ssp_redirect_raw(rtype, fun, fun, args, call, 1, __ssp_bos0) + +__BEGIN_DECLS +void __stack_chk_fail(void) __dead2; +void __chk_fail(void) __dead2; +__END_DECLS + +#endif /* _SSP_SSP_H_ */ diff --git a/include/ssp/stdio.h b/include/ssp/stdio.h new file mode 100644 index 000000000000..72e3236eac80 --- /dev/null +++ b/include/ssp/stdio.h @@ -0,0 +1,93 @@ +/* $NetBSD: stdio.h,v 1.5 2011/07/17 20:54:34 joerg Exp $ */ + +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _SSP_STDIO_H_ +#define _SSP_STDIO_H_ + +#include + +__BEGIN_DECLS +int __sprintf_chk(char *__restrict, int, size_t, const char *__restrict, ...) + __printflike(4, 5); +int __vsprintf_chk(char *__restrict, int, size_t, const char *__restrict, + __va_list) + __printflike(4, 0); +int __snprintf_chk(char *__restrict, size_t, int, size_t, + const char *__restrict, ...) + __printflike(5, 6); +int __vsnprintf_chk(char *__restrict, size_t, int, size_t, + const char *__restrict, __va_list) + __printflike(5, 0); +char *__gets_chk(char *, size_t); +char *__fgets_chk(char *, int, size_t, FILE *); +__END_DECLS + +#if __SSP_FORTIFY_LEVEL > 0 + +#define sprintf(str, ...) ({ \ + char *_ssp_str = (str); \ + __builtin___sprintf_chk(_ssp_str, 0, __ssp_bos(_ssp_str), \ + __VA_ARGS__); \ +}) + +#define vsprintf(str, fmt, ap) ({ \ + char *_ssp_str = (str); \ + __builtin___vsprintf_chk(_ssp_str, 0, __ssp_bos(_ssp_str), fmt, \ + ap); \ +}) + +#define snprintf(str, len, ...) ({ \ + char *_ssp_str = (str); \ + __builtin___snprintf_chk(_ssp_str, len, 0, __ssp_bos(_ssp_str), \ + __VA_ARGS__); \ +}) + +#define vsnprintf(str, len, fmt, ap) ({ \ + char *_ssp_str = (str); \ + __builtin___vsnprintf_chk(_ssp_str, len, 0, __ssp_bos(_ssp_str), \ + fmt, ap); \ +}) + +#define gets(str) ({ \ + char *_ssp_str = (str); \ + __gets_chk(_ssp_str, __ssp_bos(_ssp_str)); \ +}) + +#define fgets(str, len, fp) ({ \ + char *_ssp_str = (str); \ + __fgets_chk(_ssp_str, len, __ssp_bos(_ssp_str), fp); \ +}) + +#endif /* __SSP_FORTIFY_LEVEL > 0 */ + +#endif /* _SSP_STDIO_H_ */ diff --git a/include/ssp/string.h b/include/ssp/string.h new file mode 100644 index 000000000000..996020fda778 --- /dev/null +++ b/include/ssp/string.h @@ -0,0 +1,129 @@ +/* $NetBSD: string.h,v 1.14 2020/09/05 13:37:59 mrg Exp $ */ + +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _SSP_STRING_H_ +#define _SSP_STRING_H_ + +#include + +__BEGIN_DECLS +void *__memcpy_chk(void *, const void *, size_t, size_t); +void *__memmove_chk(void *, const void *, size_t, size_t); +void *__memset_chk(void *, int, size_t, size_t); +char *__stpcpy_chk(char *, const char *, size_t); +char *__stpncpy_chk(char *, const char *, size_t, size_t); +char *__strcat_chk(char *, const char *, size_t); +char *__strcpy_chk(char *, const char *, size_t); +char *__strncat_chk(char *, const char *, size_t, size_t); +char *__strncpy_chk(char *, const char *, size_t, size_t); +__END_DECLS + +#if __SSP_FORTIFY_LEVEL > 0 + +#define __ssp_bos_check3_typed_var(fun, dsttype, dsrvar, dst, srctype, srcvar, \ + src, lenvar, len) ({ \ + srctype srcvar = (src); \ + dsttype dstvar = (dst); \ + size_t lenvar = (len); \ + ((__ssp_bos0(dstvar) != (size_t)-1) ? \ + __builtin___ ## fun ## _chk(dstvar, srcvar, lenvar, \ + __ssp_bos0(dstvar)) : \ + __ ## fun ## _ichk(dstvar, srcvar, lenvar)); \ +}) + +#define __ssp_bos_check3_typed(fun, dsttype, dst, srctype, src, len) \ + __ssp_bos_check3_typed_var(fun, dsttype, __ssp_var(dstv), dst, \ + srctype, __ssp_var(srcv), src, __ssp_var(lenv), len) + +#define __ssp_bos_check3(fun, dst, src, len) \ + __ssp_bos_check3_typed_var(fun, void *, __ssp_var(dstv), dst, \ + const void *, __ssp_var(srcv), src, __ssp_var(lenv), len) + +#define __ssp_bos_check2_var(fun, dstvar, dst, srcvar, src) ({ \ + const void *srcvar = (src); \ + void *dstvar = (dst); \ + ((__ssp_bos0(dstvar) != (size_t)-1) ? \ + __builtin___ ## fun ## _chk(dstvar, srcvar, \ + __ssp_bos0(dstvar)) : \ + __ ## fun ## _ichk(dstvar, srcvar)); \ +}) + +#define __ssp_bos_check2(fun, dst, src) \ + __ssp_bos_check2_var(fun, __ssp_var(dstv), dst, __ssp_var(srcv), src) + +#define __ssp_bos_icheck3_restrict(fun, type1, type2) \ +static __inline type1 __ ## fun ## _ichk(type1 __restrict, type2 __restrict, size_t); \ +static __inline __attribute__((__always_inline__)) type1 \ +__ ## fun ## _ichk(type1 __restrict dst, type2 __restrict src, size_t len) { \ + return __builtin___ ## fun ## _chk(dst, src, len, __ssp_bos0(dst)); \ +} + +#define __ssp_bos_icheck3(fun, type1, type2) \ +static __inline type1 __ ## fun ## _ichk(type1, type2, size_t); \ +static __inline __attribute__((__always_inline__)) type1 \ +__ ## fun ## _ichk(type1 dst, type2 src, size_t len) { \ + return __builtin___ ## fun ## _chk(dst, src, len, __ssp_bos0(dst)); \ +} + +#define __ssp_bos_icheck2_restrict(fun, type1, type2) \ +static __inline type1 __ ## fun ## _ichk(type1, type2); \ +static __inline __attribute__((__always_inline__)) type1 \ +__ ## fun ## _ichk(type1 __restrict dst, type2 __restrict src) { \ + return __builtin___ ## fun ## _chk(dst, src, __ssp_bos0(dst)); \ +} + +__BEGIN_DECLS +__ssp_bos_icheck3_restrict(memcpy, void *, const void *) +__ssp_bos_icheck3(memmove, void *, const void *) +__ssp_bos_icheck3(memset, void *, int) +__ssp_bos_icheck2_restrict(stpcpy, char *, const char *) +__ssp_bos_icheck3_restrict(stpncpy, char *, const char *) +__ssp_bos_icheck2_restrict(strcpy, char *, const char *) +__ssp_bos_icheck2_restrict(strcat, char *, const char *) +__ssp_bos_icheck3_restrict(strncpy, char *, const char *) +__ssp_bos_icheck3_restrict(strncat, char *, const char *) +__END_DECLS + +#define memcpy(dst, src, len) __ssp_bos_check3(memcpy, dst, src, len) +#define memmove(dst, src, len) __ssp_bos_check3(memmove, dst, src, len) +#define memset(dst, val, len) \ + __ssp_bos_check3_typed(memset, void *, dst, int, val, len) +#define stpcpy(dst, src) __ssp_bos_check2(stpcpy, dst, src) +#define stpncpy(dst, src, len) __ssp_bos_check3(stpncpy, dst, src, len) +#define strcpy(dst, src) __ssp_bos_check2(strcpy, dst, src) +#define strcat(dst, src) __ssp_bos_check2(strcat, dst, src) +#define strncpy(dst, src, len) __ssp_bos_check3(strncpy, dst, src, len) +#define strncat(dst, src, len) __ssp_bos_check3(strncat, dst, src, len) + +#endif /* __SSP_FORTIFY_LEVEL > 0 */ +#endif /* _SSP_STRING_H_ */ diff --git a/include/ssp/strings.h b/include/ssp/strings.h new file mode 100644 index 000000000000..06c9c7cc0a09 --- /dev/null +++ b/include/ssp/strings.h @@ -0,0 +1,67 @@ +/* $NetBSD: strings.h,v 1.3 2008/04/28 20:22:54 martin Exp $ */ + +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2007 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _SSP_STRINGS_H_ +#define _SSP_STRINGS_H_ + +#include +#include + +#if __SSP_FORTIFY_LEVEL > 0 + +#define _ssp_bcopy(srcvar, src, dstvar, dst, lenvar, len) ({ \ + const void *srcvar = (src); \ + void *dstvar = (dst); \ + size_t lenvar = (len); \ + ((__ssp_bos0(dstvar) != (size_t)-1) ? \ + __builtin___memmove_chk(dstvar, srcvar, lenvar, \ + __ssp_bos0(dstvar)) : \ + __memmove_ichk(dstvar, srcvar, lenvar)); \ +}) + +#define bcopy(src, dst, len) \ + _ssp_bcopy(__ssp_var(srcv), src, __ssp_var(dstv), dst, __ssp_var(lenv), len) + +#define _ssp_bzero(dstvar, dst, lenvar, len) ({ \ + void *dstvar = (dst); \ + size_t lenvar = (len); \ + ((__ssp_bos0(dstvar) != (size_t)-1) ? \ + __builtin___memset_chk(dstvar, 0, lenvar, \ + __ssp_bos0(dstvar)) : \ + __memset_ichk(dstvar, 0, lenvar)); \ +}) + +#define bzero(dst, len) _ssp_bzero(__ssp_var(dstv), dst, __ssp_var(lenv), len) + +#endif /* __SSP_FORTIFY_LEVEL > 0 */ +#endif /* _SSP_STRINGS_H_ */ diff --git a/include/ssp/unistd.h b/include/ssp/unistd.h new file mode 100644 index 000000000000..2414e2baa96b --- /dev/null +++ b/include/ssp/unistd.h @@ -0,0 +1,54 @@ +/* $NetBSD: unistd.h,v 1.7 2015/06/25 18:41:03 joerg Exp $ */ + +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _SSP_UNISTD_H_ +#define _SSP_UNISTD_H_ + +#include + +#if __SSP_FORTIFY_LEVEL > 0 +__BEGIN_DECLS + +__ssp_redirect0(ssize_t, read, (int __fd, void *__buf, size_t __len), \ + (__fd, __buf, __len)); + +__ssp_redirect(ssize_t, readlink, (const char *__restrict __path, \ + char *__restrict __buf, size_t __len), (__path, __buf, __len)); + +__ssp_redirect_raw(char *, getcwd, getcwd, (char *__buf, size_t __len), + (__buf, __len), __buf != 0, __ssp_bos); + +__END_DECLS + +#endif /* __SSP_FORTIFY_LEVEL > 0 */ +#endif /* _SSP_UNISTD_H_ */ diff --git a/lib/libc/secure/Makefile.inc b/lib/libc/secure/Makefile.inc index 8574c5a05dc5..3b1ad879c715 100644 --- a/lib/libc/secure/Makefile.inc +++ b/lib/libc/secure/Makefile.inc @@ -3,6 +3,17 @@ .PATH: ${LIBC_SRCTOP}/secure +# _FORTIFY_SOURCE +SRCS+= gets_chk.c fgets_chk.c memcpy_chk.c memmove_chk.c memset_chk.c \ + snprintf_chk.c sprintf_chk.c stpcpy_chk.c stpncpy_chk.c \ + strcat_chk.c strcpy_chk.c strncat_chk.c strncpy_chk.c \ + vsnprintf_chk.c vsprintf_chk.c + +CFLAGS.snprintf_chk.c+= -Wno-unused-parameter +CFLAGS.sprintf_chk.c+= -Wno-unused-parameter +CFLAGS.vsnprintf_chk.c+= -Wno-unused-parameter +CFLAGS.vsprintf_chk.c+= -Wno-unused-parameter + # Sources common to both syscall interfaces: SRCS+= stack_protector.c \ stack_protector_compat.c diff --git a/lib/libc/secure/Symbol.map b/lib/libc/secure/Symbol.map index 641f451b5421..7859fcee3821 100644 --- a/lib/libc/secure/Symbol.map +++ b/lib/libc/secure/Symbol.map @@ -3,3 +3,21 @@ FBSD_1.0 { __stack_chk_fail; __stack_chk_guard; }; + +FBSD_1.8 { + __gets_chk; + __fgets_chk; + __memcpy_chk; + __memmove_chk; + __memset_chk; + __snprintf_chk; + __sprintf_chk; + __stpcpy_chk; + __stpncpy_chk; + __strcat_chk; + __strcpy_chk; + __strncat_chk; + __strncpy_chk; + __vsnprintf_chk; + __vsprintf_chk; +}; diff --git a/lib/libc/secure/fgets_chk.c b/lib/libc/secure/fgets_chk.c new file mode 100644 index 000000000000..72aa1d816ce1 --- /dev/null +++ b/lib/libc/secure/fgets_chk.c @@ -0,0 +1,54 @@ +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 +__RCSID("$NetBSD: fgets_chk.c,v 1.6 2009/02/05 05:41:51 lukem Exp $"); + +#include +#include +#include +#include + +#include +#include +#undef fgets + +char * +__fgets_chk(char * __restrict buf, int len, size_t slen, FILE *fp) +{ + if (slen >= (size_t)INT_MAX) + return (fgets(buf, len, fp)); + + if (len >= 0 && (size_t)len > slen) + __chk_fail(); + + return (fgets(buf, len, fp)); +} diff --git a/lib/libc/secure/gets_chk.c b/lib/libc/secure/gets_chk.c new file mode 100644 index 000000000000..18c1e2d18f43 --- /dev/null +++ b/lib/libc/secure/gets_chk.c @@ -0,0 +1,74 @@ +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 +__RCSID("$NetBSD: gets_chk.c,v 1.7 2013/10/04 20:49:16 christos Exp $"); + +#include +#include +#include +#include + +#include +#include + +char *__gets_unsafe(char *); + +char * +__gets_chk(char * __restrict buf, size_t slen) +{ + char *abuf; + size_t len; + + if (slen >= (size_t)INT_MAX) + return (__gets_unsafe(buf)); + + if ((abuf = malloc(slen + 1)) == NULL) + return (__gets_unsafe(buf)); + + if (fgets(abuf, (int)(slen + 1), stdin) == NULL) { + free(abuf); + return (NULL); + } + + len = strlen(abuf); + if (len > 0 && abuf[len - 1] == '\n') + --len; + + if (len >= slen) + __chk_fail(); + + (void)memcpy(buf, abuf, len); + + buf[len] = '\0'; + free(abuf); + return (buf); +} diff --git a/lib/libc/secure/memcpy_chk.c b/lib/libc/secure/memcpy_chk.c new file mode 100644 index 000000000000..99cf2d5f13ff --- /dev/null +++ b/lib/libc/secure/memcpy_chk.c @@ -0,0 +1,53 @@ +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 +__RCSID("$NetBSD: memcpy_chk.c,v 1.7 2015/05/13 19:57:16 joerg Exp $"); + +#include + +#include +#undef memcpy + +#include "ssp_internal.h" + +void * +__memcpy_chk(void * __restrict dst, const void * __restrict src, size_t len, + size_t slen) +{ + if (len > slen) + __chk_fail(); + + if (__ssp_overlap((const char *)src, (const char *)dst, len)) + __chk_fail(); + + return (memcpy(dst, src, len)); +} diff --git a/lib/libc/secure/memmove_chk.c b/lib/libc/secure/memmove_chk.c new file mode 100644 index 000000000000..07f965d608fc --- /dev/null +++ b/lib/libc/secure/memmove_chk.c @@ -0,0 +1,47 @@ +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 +__RCSID("$NetBSD: memmove_chk.c,v 1.6 2020/09/05 13:37:59 mrg Exp $"); + +#include + +#include +#undef memmove + +void * +__memmove_chk(void *dst, const void *src, size_t len, + size_t slen) +{ + if (len > slen) + __chk_fail(); + return (memmove(dst, src, len)); +} diff --git a/lib/libc/secure/memset_chk.c b/lib/libc/secure/memset_chk.c new file mode 100644 index 000000000000..f337be98b46d --- /dev/null +++ b/lib/libc/secure/memset_chk.c @@ -0,0 +1,46 @@ +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 +__RCSID("$NetBSD: memset_chk.c,v 1.5 2014/09/17 00:39:28 joerg Exp $"); + +#include + +#include +#undef memset + +void * +__memset_chk(void * __restrict dst, int val, size_t len, size_t slen) +{ + if (len > slen) + __chk_fail(); + return (memset(dst, val, len)); +} diff --git a/lib/libc/secure/snprintf_chk.c b/lib/libc/secure/snprintf_chk.c new file mode 100644 index 000000000000..52ef874ede5b --- /dev/null +++ b/lib/libc/secure/snprintf_chk.c @@ -0,0 +1,56 @@ +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 +__RCSID("$NetBSD: snprintf_chk.c,v 1.5 2008/04/28 20:23:00 martin Exp $"); + +#include +#include + +#include +#undef vsnprintf + +int +__snprintf_chk(char * __restrict buf, size_t len, int flags, size_t slen, + const char * __restrict fmt, ...) +{ + va_list ap; + int rv; + + if (len > slen) + __chk_fail(); + + va_start(ap, fmt); + rv = vsnprintf(buf, len, fmt, ap); + va_end(ap); + + return (rv); +} diff --git a/lib/libc/secure/sprintf_chk.c b/lib/libc/secure/sprintf_chk.c new file mode 100644 index 000000000000..d4c42ccba3ce --- /dev/null +++ b/lib/libc/secure/sprintf_chk.c @@ -0,0 +1,61 @@ +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation *** 1063 LINES SKIPPED *** From nobody Mon May 13 05:24:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vd7Fk4gK7z5KG03; Mon, 13 May 2024 05:24: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 4Vd7Fk2k29z4Knn; Mon, 13 May 2024 05:24:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715577850; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=99eITd7zgaXVMoNIBBJPjLOcRmRzQVHFugvJ9Nnaj3g=; b=fDivBmBZRzMk1z5DqbzdoOVCtlL72CcThY3XOK6rIPZr1NliPYG6fif0s3fF6gJWUBdtoy v/Izoce4vfgc/lt/FBioOz8J4dHn3yTaGmnUO5kHmC+Cq43GvHkCDWpOuCEL7XV1/ZJeJQ 9NQ9OqmP2dDG1Y/41ZGincSHwfqJf95hAvDxnOjNS7ZLKGbb4flc565pmheHJXl1AOYXCX JT41hTXF+wlntwPtz2uwU0gdchJiYEj98WGLQ8/aP/BK4LhtOajJKD9ej9M5q+u6A78qbL VftSvDp46QRSmFnSSKr5q7vmTNPi2miljxHHrHF+R+XrljHjqq7O4HGbYxcYxw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715577850; a=rsa-sha256; cv=none; b=W23c5iYgJRm2TRXnFmG2Sedym6X7mLUkMV5Jciz14w+zQJnyHhAQVRSKX4NWopLIToNISl JTTfgj310HUcQRixDc1RcR3+qdkrgNBHJz2f7p/X3VYV+rbsgPKBd8n6kYVAvy4vYVwR+I bjrQ9moUq7VhBa+O4YQAD3sqr2tDYp3UCvbk51pnvW2JVDo2VMKYg0JMSmKu+YKXRnE9LL C0PicV+Vo6IUH0RWg7OFJTEChHOIDO33XNZ9RB+g2ISzUaQE9hmNXCwBesmS+zj1TRLqCZ /2Lc7OiM8RnW/ftRiwQOMojRr87+AqBEzd9fnnx5bWlac5So/dV74rvJjpypdg== 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=1715577850; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=99eITd7zgaXVMoNIBBJPjLOcRmRzQVHFugvJ9Nnaj3g=; b=KjYf4tytSc5MC8hBzPz0rES9akbGhUj510oyz4x9g/BQrs22j4O8HW8DXPUtq/pPscK4Ck IY6HuCySJ3DOmOyKW0DVXdksaDGyiJdExfBtyKO+xAJlkssasvqQnTdsVSYncTQcp6kAcn /mxI3vAwXhvvSl4QYm6GthO3ty6O5RqqYH0dpW7bKAvkFBuBSZGawTVy9fbFcB9E3w+NmU 5x7pYKcIE8RRtM2QtqreW236LN3cPlqVnnpz4FJaNGLUKdRNaRZVxW3rtiqBcIYNJqisye qdT5u1ooduT4QZ5RI/nvnI78Zh0lslFW4x4GyuahdbZjTGoGSBng/C9YUD67DQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vd7Fk2KtYzbPM; Mon, 13 May 2024 05:24: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 44D5OAer084325; Mon, 13 May 2024 05:24:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44D5OAMJ084322; Mon, 13 May 2024 05:24:10 GMT (envelope-from git) Date: Mon, 13 May 2024 05:24:10 GMT Message-Id: <202405130524.44D5OAMJ084322@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: e55512504d01 - main - Prepare the system for _FORTIFY_SOURCE List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e55512504d0178983978d64d67eed1cc85826523 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=e55512504d0178983978d64d67eed1cc85826523 commit e55512504d0178983978d64d67eed1cc85826523 Author: Kyle Evans AuthorDate: 2024-05-13 05:23:50 +0000 Commit: Kyle Evans CommitDate: 2024-05-13 05:23:50 +0000 Prepare the system for _FORTIFY_SOURCE Notably: - libc needs to #undef some of the macros from ssp/* for underlying implementations - ssp/* wants a __RENAME() macro (snatched more or less from NetBSD) There's some extra hinkiness included for read(), since libc spells it as "_read" while the rest of the world spells it "read." Reviewed by: imp, ngie Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D32307 --- contrib/netbsd-tests/lib/libc/ssp/h_gets.c | 3 +++ include/ssp/unistd.h | 8 ++++++-- lib/libc/Makefile | 2 ++ lib/libc/amd64/string/bcopy.c | 2 ++ lib/libc/amd64/string/bzero.c | 2 ++ lib/libc/amd64/string/strncat.c | 2 ++ lib/libc/amd64/string/strncpy.c | 2 ++ lib/libc/gen/getcwd.c | 3 ++- lib/libc/stdio/fgets.c | 2 ++ lib/libc/stdio/snprintf.c | 2 ++ lib/libc/stdio/sprintf.c | 2 ++ lib/libc/stdio/vsnprintf.c | 2 ++ lib/libc/stdio/vsprintf.c | 2 ++ lib/libc/string/bcopy.c | 5 +++++ lib/libc/string/memset.c | 4 ++++ lib/libc/string/stpcpy.c | 2 ++ lib/libc/string/stpncpy.c | 2 ++ lib/libc/string/strcat.c | 2 ++ lib/libc/string/strncat.c | 2 ++ sys/sys/cdefs.h | 10 ++++++++++ 20 files changed, 58 insertions(+), 3 deletions(-) diff --git a/contrib/netbsd-tests/lib/libc/ssp/h_gets.c b/contrib/netbsd-tests/lib/libc/ssp/h_gets.c index f73d29a08bf3..9da01cab8eb4 100644 --- a/contrib/netbsd-tests/lib/libc/ssp/h_gets.c +++ b/contrib/netbsd-tests/lib/libc/ssp/h_gets.c @@ -34,6 +34,9 @@ __RCSID("$NetBSD: h_gets.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $"); #include #ifdef __FreeBSD__ +/* _FORTIFY_SOURCE, at the very least, may #define a gets() macro. */ +#undef gets + /* * We want to test the gets() implementation, but cannot simply link against * the gets symbol because it is not in the default version. (We've made it diff --git a/include/ssp/unistd.h b/include/ssp/unistd.h index 2414e2baa96b..bcd3664116cc 100644 --- a/include/ssp/unistd.h +++ b/include/ssp/unistd.h @@ -39,8 +39,12 @@ #if __SSP_FORTIFY_LEVEL > 0 __BEGIN_DECLS -__ssp_redirect0(ssize_t, read, (int __fd, void *__buf, size_t __len), \ - (__fd, __buf, __len)); +#ifndef _FORTIFY_SOURCE_read +#define _FORTIFY_SOURCE_read read +#endif + +__ssp_redirect0(ssize_t, _FORTIFY_SOURCE_read, (int __fd, void *__buf, + size_t __len), (__fd, __buf, __len)); __ssp_redirect(ssize_t, readlink, (const char *__restrict __path, \ char *__restrict __buf, size_t __len), (__path, __buf, __len)); diff --git a/lib/libc/Makefile b/lib/libc/Makefile index 674986a7e065..c70e57498771 100644 --- a/lib/libc/Makefile +++ b/lib/libc/Makefile @@ -19,6 +19,8 @@ LIBC_ARCH=${M} LIBC_ARCH=${MACHINE_CPUARCH} .endif +CFLAGS+=-D_FORTIFY_SOURCE_read=_read + # All library objects contain FreeBSD revision strings by default; they may be # excluded as a space-saving measure. To produce a library that does # not contain these strings, add -DSTRIP_FBSDID (see ) to CFLAGS diff --git a/lib/libc/amd64/string/bcopy.c b/lib/libc/amd64/string/bcopy.c index 868567711e8b..0dee529fb9df 100644 --- a/lib/libc/amd64/string/bcopy.c +++ b/lib/libc/amd64/string/bcopy.c @@ -4,6 +4,8 @@ #include +#undef bcopy /* _FORTIFY_SOURCE */ + void bcopy(const void *src, void *dst, size_t len) { diff --git a/lib/libc/amd64/string/bzero.c b/lib/libc/amd64/string/bzero.c index 92adb2bb4f0e..d82f3061865b 100644 --- a/lib/libc/amd64/string/bzero.c +++ b/lib/libc/amd64/string/bzero.c @@ -4,6 +4,8 @@ #include +#undef bzero /* _FORTIFY_SOURCE */ + void bzero(void *b, size_t len) { diff --git a/lib/libc/amd64/string/strncat.c b/lib/libc/amd64/string/strncat.c index 33b278ac5e04..2c63ab50b3c3 100644 --- a/lib/libc/amd64/string/strncat.c +++ b/lib/libc/amd64/string/strncat.c @@ -8,6 +8,8 @@ #include +#undef strncat /* _FORTIFY_SOURCE */ + void *__memccpy(void *restrict, const void *restrict, int, size_t); char * diff --git a/lib/libc/amd64/string/strncpy.c b/lib/libc/amd64/string/strncpy.c index b3d868787fbe..0e7a58222aa8 100644 --- a/lib/libc/amd64/string/strncpy.c +++ b/lib/libc/amd64/string/strncpy.c @@ -29,6 +29,8 @@ #include #include +#undef strncpy /* _FORTIFY_SOURCE */ + char *__stpncpy(char *restrict, const char *restrict, size_t); char * diff --git a/lib/libc/gen/getcwd.c b/lib/libc/gen/getcwd.c index 191fa50a599b..18d8ce668274 100644 --- a/lib/libc/gen/getcwd.c +++ b/lib/libc/gen/getcwd.c @@ -40,6 +40,7 @@ #include #include #include +#include #include "un-namespace.h" #include "gen-private.h" @@ -51,7 +52,7 @@ extern int __getcwd(char *, size_t); char * -getcwd(char *pt, size_t size) +__ssp_real(getcwd)(char *pt, size_t size) { struct dirent *dp; DIR *dir = NULL; diff --git a/lib/libc/stdio/fgets.c b/lib/libc/stdio/fgets.c index 19f68304efc1..504338c012a2 100644 --- a/lib/libc/stdio/fgets.c +++ b/lib/libc/stdio/fgets.c @@ -40,6 +40,8 @@ #include "local.h" #include "libc_private.h" +#undef fgets /* _FORTIFY_SOURCE */ + /* * Read at most n-1 characters from the given file. * Stop when a newline has been read, or the count runs out. diff --git a/lib/libc/stdio/snprintf.c b/lib/libc/stdio/snprintf.c index 398f1596d2c5..607bb3770ccd 100644 --- a/lib/libc/stdio/snprintf.c +++ b/lib/libc/stdio/snprintf.c @@ -45,6 +45,8 @@ #include "local.h" +#undef snprintf /* _FORTIFY_SOURCE */ + int snprintf(char * __restrict str, size_t n, char const * __restrict fmt, ...) { diff --git a/lib/libc/stdio/sprintf.c b/lib/libc/stdio/sprintf.c index 3b0e4c061b43..1cac21e98a46 100644 --- a/lib/libc/stdio/sprintf.c +++ b/lib/libc/stdio/sprintf.c @@ -43,6 +43,8 @@ #include "local.h" #include "xlocale_private.h" +#undef sprintf /* _FORTIFY_SOURCE */ + int sprintf(char * __restrict str, char const * __restrict fmt, ...) { diff --git a/lib/libc/stdio/vsnprintf.c b/lib/libc/stdio/vsnprintf.c index 2213b20e3f1e..1e25e6757459 100644 --- a/lib/libc/stdio/vsnprintf.c +++ b/lib/libc/stdio/vsnprintf.c @@ -43,6 +43,8 @@ #include "local.h" #include "xlocale_private.h" +#undef vsnprintf /* _FORTIFY_SOURCE */ + int vsnprintf_l(char * __restrict str, size_t n, locale_t locale, const char * __restrict fmt, __va_list ap) diff --git a/lib/libc/stdio/vsprintf.c b/lib/libc/stdio/vsprintf.c index a478759a2471..298f969a1318 100644 --- a/lib/libc/stdio/vsprintf.c +++ b/lib/libc/stdio/vsprintf.c @@ -42,6 +42,8 @@ #include "local.h" #include "xlocale_private.h" +#undef vsprintf /* _FORTIFY_SOURCE */ + int vsprintf_l(char * __restrict str, locale_t locale, const char * __restrict fmt, __va_list ap) diff --git a/lib/libc/string/bcopy.c b/lib/libc/string/bcopy.c index fdc05f20253c..20f7bc60b76a 100644 --- a/lib/libc/string/bcopy.c +++ b/lib/libc/string/bcopy.c @@ -47,6 +47,9 @@ typedef intptr_t word; /* "word" used for optimal copy speed */ #if defined(MEMCOPY) || defined(MEMMOVE) #include +#undef memcpy /* _FORTIFY_SOURCE */ +#undef memmove /* _FORTIFY_SOURCE */ + void * #ifdef MEMCOPY memcpy @@ -57,6 +60,8 @@ memmove #else #include +#undef bcopy /* _FORTIFY_SOURCE */ + void bcopy(const void *src0, void *dst0, size_t length) #endif diff --git a/lib/libc/string/memset.c b/lib/libc/string/memset.c index a49ce7cea756..811def0fc9b4 100644 --- a/lib/libc/string/memset.c +++ b/lib/libc/string/memset.c @@ -42,6 +42,8 @@ #ifdef BZERO #include +#undef bzero /* _FORTIFY_SOURCE */ + #define RETURN return #define VAL 0 #define WIDEVAL 0 @@ -51,6 +53,8 @@ bzero(void *dst0, size_t length) #else #include +#undef memset /* _FORTIFY_SOURCE */ + #define RETURN return (dst0) #define VAL c0 #define WIDEVAL c diff --git a/lib/libc/string/stpcpy.c b/lib/libc/string/stpcpy.c index c096e81da075..4521e0877e07 100644 --- a/lib/libc/string/stpcpy.c +++ b/lib/libc/string/stpcpy.c @@ -33,6 +33,8 @@ #include +#undef stpcpy /* _FORTIFY_SOURCE */ + char * stpcpy(char * __restrict to, const char * __restrict from) { diff --git a/lib/libc/string/stpncpy.c b/lib/libc/string/stpncpy.c index 8c7f14ecf8dd..d3a1dddb4a65 100644 --- a/lib/libc/string/stpncpy.c +++ b/lib/libc/string/stpncpy.c @@ -28,6 +28,8 @@ #include +#undef stpncpy /* _FORTIFY_SOURCE */ + char * stpncpy(char * __restrict dst, const char * __restrict src, size_t n) { diff --git a/lib/libc/string/strcat.c b/lib/libc/string/strcat.c index 593a1afd7048..1c13c519b563 100644 --- a/lib/libc/string/strcat.c +++ b/lib/libc/string/strcat.c @@ -31,6 +31,8 @@ #include +#undef strcat /* _FORTIFY_SOURCE */ + char * strcat(char * __restrict s, const char * __restrict append) { diff --git a/lib/libc/string/strncat.c b/lib/libc/string/strncat.c index ee951cdc956a..086bdef32b68 100644 --- a/lib/libc/string/strncat.c +++ b/lib/libc/string/strncat.c @@ -34,6 +34,8 @@ #include +#undef strncat /* _FORTIFY_SOURCE */ + /* * Concatenate src on the end of dst. At most strlen(dst)+n+1 bytes * are written at dst (at most n+1 bytes being appended). Return dst. diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index e47a7072e1f1..a6545a29a302 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -609,6 +609,16 @@ #define __DEQUALIFY(type, var) ((type)(__uintptr_t)(const volatile void *)(var)) #endif +#if !defined(_STANDALONE) && !defined(_KERNEL) +#if defined(__GNUC__) || defined(__PCC__) +#define __RENAME(x) __asm(__STRING(x)) +#else +#define __RENAME(x) no renaming support for compiler in use +#endif /* __GNUC__ */ +#else /* _STANDALONE || _KERNEL */ +#define __RENAME(x) no renaming in kernel/standalone environment +#endif + /*- * The following definitions are an extension of the behavior originally * implemented in , but with a different level of granularity. From nobody Mon May 13 05:24:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vd7Fl64WJz5KGLY; Mon, 13 May 2024 05:24: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 4Vd7Fl3lG9z4Kfs; Mon, 13 May 2024 05:24:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715577851; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SA2Ma7uuzmT+7Rk9o2IGghFtZMiH7Twv1nzZ9AO3SGI=; b=qaz1B4JeJelQHQuVMy+ZEqIXrxXD/0cvER3Sh6csBlJs6muyf/AhwBw+/j7XgZyKkdPKxc UZSFpddinWnIDQeg2zT7jiTEiAjL/uTrQjkY5quAtdnp9WneRxps7arH8gxNUG51XhXEr6 KqeFSela2umfFqgd7SdpZCFweG0u/FQHPaZimleI0tmyRzUbG7BAEDWZE9wTWRZEMQl/1Y bZICXv2oIw7iVaL9/9V7lrpJdYEVj5VmV1badwT1z/TwdlQJJsEaqRcxonDEICDQ3v6xoP 9Nc6Q9Y0po0aEgre5dmTBtC01dKTcPnzGII66snD/antrRD7cK0zmgJ2BqdmfQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715577851; a=rsa-sha256; cv=none; b=XR15Yq9aQrFM28ki1wfCZOo16ZAu1IO2UIuIDleQSxDMUb2ZUGep4mQv4R/07S4Ptjqjgf r6PNeiYQvZ8oEcFpfgkyIApM87TgoQRKahpZeQNoTzuaxP8qyMhgMFC1uk0y4AM6SxohlF neCUf3b09vHR3leJcVJcKcGRGlgywbfJx/wwpfPwK+X/Kq3fdhuyGCTCblKchi1xb/+AOD +N6jdvuXAx5wwbWz5+Y5PwRy/aQ0pQmojDLJEPozxf9AamxHQtKeFpELqMIc0qYszALzcg +Hi/2GNWOxKmg5sbbufgv84tS9zDAf4Cmu+cGzT1a5Wq4UhJus7QJW+5kofH+w== 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=1715577851; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SA2Ma7uuzmT+7Rk9o2IGghFtZMiH7Twv1nzZ9AO3SGI=; b=xNEr0w6i3kUoDbKf1p54s6maZQSdu80+Ke/cFcmv90rT140xHJnzT+rrzdmU4Fcod1zMoe xrlfyX8xu+tKqpOonmkhnkN4vCqjTz08hOLCSnmJVCGwCsFjirPBxL2HgvostD+bJU52PR I7P6fydyMF99vxQqnjP/ExcZEFLdOLX67Q3hryEi7zhRgWoJbZmEdsnUeo7aoizzNlnC9Y b47u3+DiIj9bZ1ILuoHxvbuw6K5Kr2n9+3toIvkZRixk6+MDDOnlacCb7JKU+6s68BENBY Xw2lqeF5FImNGwuALwhrKA1O2XlLEDSPZQkdo40FOYv4zg/nwxQO7SY8kgMpMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vd7Fl3M1kzbTR; Mon, 13 May 2024 05:24: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 44D5OBQl084370; Mon, 13 May 2024 05:24:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44D5OBT1084367; Mon, 13 May 2024 05:24:11 GMT (envelope-from git) Date: Mon, 13 May 2024 05:24:11 GMT Message-Id: <202405130524.44D5OBT1084367@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 9bfd3b4076a7 - main - Add a build knob for _FORTIFY_SOURCE List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9bfd3b4076a7b0dfd27ab22318e5113dc84fea28 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=9bfd3b4076a7b0dfd27ab22318e5113dc84fea28 commit 9bfd3b4076a7b0dfd27ab22318e5113dc84fea28 Author: Kyle Evans AuthorDate: 2024-05-13 05:23:50 +0000 Commit: Kyle Evans CommitDate: 2024-05-13 05:23:50 +0000 Add a build knob for _FORTIFY_SOURCE In the future, we will Default to _FORTIFY_SOURCE=2 if SSP is enabled, otherwise default to _FORTIFY_SOURCE=0. For now we default it to 0 unconditionally to ease bisect across older versions without the new symbols, and we'll put out a call for testing. include/*.h include their ssp/*.h equivalents as needed based on the knob. Programs and users are allowed to override FORTIFY_SOURCE in their Makefiles or src.conf/make.conf to force it off. Reviewed by: des, markj Relnotes: yes Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D32308 --- include/stdio.h | 3 ++ include/string.h | 3 ++ include/strings.h | 3 ++ include/unistd.h | 4 +++ lib/libthr/Makefile | 3 ++ libexec/rtld-elf/Makefile | 4 +++ share/man/man7/security.7 | 75 +++++++++++++++++++++++++++++++++++++++++ share/mk/bsd.sys.mk | 7 ++++ tools/build/options/WITHOUT_SSP | 3 ++ tools/build/options/WITH_SSP | 3 ++ 10 files changed, 108 insertions(+) diff --git a/include/stdio.h b/include/stdio.h index fe7a6f7d6f82..30bc638082d8 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -530,4 +530,7 @@ extern int __isthreaded; __END_DECLS __NULLABILITY_PRAGMA_POP +#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 +#include +#endif #endif /* !_STDIO_H_ */ diff --git a/include/string.h b/include/string.h index 597308020cdb..a595f6e3e260 100644 --- a/include/string.h +++ b/include/string.h @@ -168,4 +168,7 @@ errno_t memset_s(void *, rsize_t, int, rsize_t); #endif /* __EXT1_VISIBLE */ __END_DECLS +#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 +#include +#endif #endif /* _STRING_H_ */ diff --git a/include/strings.h b/include/strings.h index fde007186e04..6fe6a09e7dd3 100644 --- a/include/strings.h +++ b/include/strings.h @@ -68,4 +68,7 @@ int strncasecmp(const char *, const char *, size_t) __pure; #endif __END_DECLS +#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 +#include +#endif #endif /* _STRINGS_H_ */ diff --git a/include/unistd.h b/include/unistd.h index e4e5c62fbb67..59738cbf6e68 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -37,6 +37,10 @@ #include #include +#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 +#include +#endif + #ifndef _GID_T_DECLARED typedef __gid_t gid_t; #define _GID_T_DECLARED diff --git a/lib/libthr/Makefile b/lib/libthr/Makefile index a5bf5da44170..85c028f521a1 100644 --- a/lib/libthr/Makefile +++ b/lib/libthr/Makefile @@ -11,6 +11,9 @@ LDFLAGS+= -Wl,--rpath=/usr/lib${COMPAT_libcompat} .include MK_SSP= no +# SSP forced off already implies FORTIFY_SOURCE=0, but we must make sure that +# one cannot turn it back on. +FORTIFY_SOURCE= 0 LIB=thr SHLIB_MAJOR= 3 diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile index 37c3840538d5..864448ad782a 100644 --- a/libexec/rtld-elf/Makefile +++ b/libexec/rtld-elf/Makefile @@ -15,6 +15,10 @@ MK_UBSAN= no .include +# SSP forced off already implies FORTIFY_SOURCE=0, but we must make sure that +# one cannot turn it back on. +FORTIFY_SOURCE= 0 + .if !defined(NEED_COMPAT) CONFS= libmap.conf .endif diff --git a/share/man/man7/security.7 b/share/man/man7/security.7 index ccbeeb4575ce..2e690e35d534 100644 --- a/share/man/man7/security.7 +++ b/share/man/man7/security.7 @@ -939,6 +939,81 @@ option that SSH allows in its .Pa authorized_keys file to make the key only usable to entities logging in from specific machines. +.Sh STACK OVERFLOW PROTECTION +.Fx +supports stack overflow protection using the Stack Smashing Protector +.Pq SSP +compiler feature. +In userland, SSP adds a per-process randomized canary at the end of every stack +frame which is checked for corruption upon return from the function. +In the kernel, a single randomized canary is used globally except on aarch64, +which has a +.Dv PERTHREAD_SSP +.Xr config 8 +option to enable per-thread randomized canaries. +If stack corruption is detected, then the process aborts to avoid potentially +malicious execution as a result of the corruption. +SSP may be enabled or disabled when building +.Fx +base with the +.Xr src.conf 5 +SSP knob. +.Pp +When +.Va WITH_SSP +is enabled, which is the default, world is built with the +.Fl fstack-protector-strong +compiler option. +The kernel is built with the +.Fl fstack-protector +option. +.Pp +In addition to SSP, a +.Dq FORTIFY_SOURCE +implementation is supported up to level 2 by defining +.Va _FORTIFY_SOURCE +to +.Dv 1 +or +.Dv 2 +before including any +.Fx +headers. +.Fx +world builds can set +.Va FORTIFY_SOURCE +to provide a default value for +.Va _FORTIFY_SOURCE . +When enabled, +.Dq FORTIFY_SOURCE +enables extra bounds checking in various functions that accept buffers to be +written into. +These functions currently have extra bounds checking support: +.Bl -column -offset indent "snprintf" "memmove" "strncpy" "vsnprintf" "readlink" +.It bcopy Ta bzero Ta fgets Ta getcwd Ta gets +.It memcpy Ta memmove Ta memset Ta read Ta readlink +.It snprintf Ta sprintf Ta stpcpy Ta stpncpy Ta strcat +.It strcpy Ta strncat Ta strncpy Ta vsnprintf Ta vsprintf +.El +.Pp +.Dq FORTIFY_SOURCE +requires compiler support from +.Xr clang 1 +or +.Xr gcc 1 , +which provide the +.Xr __builtin_object_size 3 +function that is used to determine the bounds of an object. +This feature works best at optimization levels +.Fl O1 +and above, as some object sizes may be less obvious without some data that the +compiler would collect in an optimization pass. +.Pp +Similar to SSP, violating the bounds of an object will cause the program to +abort in an effort to avoid malicious execution. +This effectively provides finer-grained protection than SSP for some class of +function and system calls, along with some protection for buffers allocated as +part of the program data. .Sh KNOBS AND TWEAKS .Fx provides several knobs and tweak handles that make some introspection diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index de91e00d8cc7..52c3d07746c7 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -294,11 +294,18 @@ CFLAGS.clang+= -Qunused-arguments # but not yet. CXXFLAGS.clang+= -Wno-c++11-extensions +# XXX This should be defaulted to 2 when WITH_SSP is in use after further +# testing and soak time. +FORTIFY_SOURCE?= 0 .if ${MK_SSP} != "no" # Don't use -Wstack-protector as it breaks world with -Werror. SSP_CFLAGS?= -fstack-protector-strong CFLAGS+= ${SSP_CFLAGS} .endif # SSP +.if ${FORTIFY_SOURCE} > 0 +CFLAGS+= -D_FORTIFY_SOURCE=${FORTIFY_SOURCE} +CXXFLAGS+= -D_FORTIFY_SOURCE=${FORTIFY_SOURCE} +.endif # Additional flags passed in CFLAGS and CXXFLAGS when MK_DEBUG_FILES is # enabled. diff --git a/tools/build/options/WITHOUT_SSP b/tools/build/options/WITHOUT_SSP index 88162cecf14a..7a773fe1e5aa 100644 --- a/tools/build/options/WITHOUT_SSP +++ b/tools/build/options/WITHOUT_SSP @@ -1 +1,4 @@ Do not build world with stack smashing protection. +See +.Xr security 7 +for more information. diff --git a/tools/build/options/WITH_SSP b/tools/build/options/WITH_SSP index 0088dd133782..4f06a73d4173 100644 --- a/tools/build/options/WITH_SSP +++ b/tools/build/options/WITH_SSP @@ -1 +1,4 @@ Build world with stack smashing protection. +See +.Xr security 7 +for more information. From nobody Mon May 13 08:40:33 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdCcL0VJ3z5KXXG; Mon, 13 May 2024 08:40: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 4VdCcL00tZz4Zf9; Mon, 13 May 2024 08:40:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715589634; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pphJZ3QhwR1ZGfOdXRm2cVcOOGCgdvdpYa0F+2BcSXM=; b=bsCmJ2/hGEFWueVxdbNRp+67ql5j7H2i7q3ceLQmnS3Isgoi43StCLusExzVsv73cUGtcO MMHhD2VPPU2EaI2OZhyWaLQrtfVPIlmeGVH3NWnn7JgQgBs8fk5ek20JhSmyADyrC8xt8u f/nkDUlKG41/BtF+5tKbGH2+dTau7THhKzp/v6S5ZZApFIozbYJNUxllOyH18Sux8BeZge vFjjo8cCEmR5db3P6A/5AJkT5EdmIr3m4MBCOZhdCElxu6qxxWuyUTck2+XhGX84BM5Nt1 MobV3K935PIGwKTG8Zi/S5Wh0oBitnSIRbWuYK5hitjUHyI0Xrls4Pd4afuwfQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715589634; a=rsa-sha256; cv=none; b=Y/kI+rFhWkQzJUrCAyB26TjkpNcQgIbJMo5Olz08li1+qattVvbua0jlKtACnEtRdfEqrp +3qf3S2czLlfVum1Q25OebxdKkSJ4QO1D6GG91XyIDMPoktUI5wDfmsHDbwHuvh1WNHZVS VMpVMI93lJPRVHBNnyRo+26FnMHer/3MyRCJN67HrlXyS+Sl2k6L79boem8TtSjkURcO+Z 0hy4jW3lYZCOWOeVxRPDjdczEWSGcWX+9FebT4mKp6z3AJFWR8Ayv2lEaEY4Ho16oy4+L8 2CKo59BsPuraqnP+NZkBQ7MeyyoNLbQVc2dMTXayFaMvKVynQqj7jO1tuor62g== 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=1715589634; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pphJZ3QhwR1ZGfOdXRm2cVcOOGCgdvdpYa0F+2BcSXM=; b=m6/gYQsNsev4XRiyTMPSUxVTs+YnjWuDM9I0RPWv7vM9HdKOCyevVWRgcZCZ7+kfMFiOjp 7H8Tnr10ij7uMgZ4GzXAstsw4b+PVBEKdReOeI5CuVMrYTCEWT4GUjuP6J5dCZQ/CmCZuD n9IfkErGyI40DIhHuM395/fI5K46hfi3YlFOt3rRv08pWNMVBMEbkDUBuedMVIA4Vq8K/B 31cFGvVEtyZOY8dBqmS9+1xU60DPjZHMcVOYKXclIOhsT4/nV/GZxNWByzkxnb5hHrpK04 VDhnzFLLLRAKWpSWXAwfod8QNAQjlYaxhUsLgkbrjOYHJg4WHlQrKVPg33T9ow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdCcK6jYBzgsX; Mon, 13 May 2024 08:40: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 44D8eX3g014141; Mon, 13 May 2024 08:40:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44D8eXdL014138; Mon, 13 May 2024 08:40:33 GMT (envelope-from git) Date: Mon, 13 May 2024 08:40:33 GMT Message-Id: <202405130840.44D8eXdL014138@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: 421025a274fb - main - access.2: Mention that lstat(2) should be used for symbolic links List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 421025a274fb5759b3ecc8bdb30b24db830b45ae Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=421025a274fb5759b3ecc8bdb30b24db830b45ae commit 421025a274fb5759b3ecc8bdb30b24db830b45ae Author: Gordon Bergling AuthorDate: 2024-05-13 08:40:12 +0000 Commit: Gordon Bergling CommitDate: 2024-05-13 08:40:12 +0000 access.2: Mention that lstat(2) should be used for symbolic links access(), eaccess() and faccessat() will always dereference symbolic links. So add a note in the manual page, that lstat(2) should be used in the case of symbolic links. PR: 262895 Reviewed by: gbe, pauamma_gundo.com MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D44890 --- lib/libsys/access.2 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/libsys/access.2 b/lib/libsys/access.2 index 1dab63afccde..91fe50a08cc4 100644 --- a/lib/libsys/access.2 +++ b/lib/libsys/access.2 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 30, 2021 +.Dd May 13, 2024 .Dt ACCESS 2 .Os .Sh NAME @@ -147,6 +147,15 @@ Likewise for .Dv R_OK and .Dv W_OK . +.Pp +.Fn access , +.Fn eaccess +and +.Fn faccessat +will always dereference symbolic links. +If the symbolic link itself needs to be referenced, +.Xr lstat 2 +should be used instead. .Sh RETURN VALUES .Rv -std .Sh ERRORS From nobody Mon May 13 09:51:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdFB36q5Mz5KdV4; Mon, 13 May 2024 09:51:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VdFB36MvNz4gBJ; Mon, 13 May 2024 09:51:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715593883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Ilo4ELZYwIIKNbU3YcObwBl0hh5rtu/zuuY4qBkmZ8=; b=eKaAR7xnNNmZ9FG3KtaTIED8F2lATmPApsamO7cEVbwGHGiYnsPp6CfAHDmlVq2vT4uvpS q9HBoEJGP/rWRNH3GGKONMjxKPpUhxPVWWhB+DJzcvqPyGk+WF4hfYUsJTGieOajlbfIPf 8uhMcnliNl2jV/J+1G0K/AVZfrMhql6qjF8Av6KHXKNshHL1HO/kQyOCRSfFw3pfu4oAtZ nWfRxA/VFL4BdieYRiV9gvCx9NnyAxss3JQaLzDMdfXu5Q2nvR62n4kBYFh9FbSSDUSGiP xnmSOC6HCUJ/itkdA9wEJGO9dmxVYWt9uWZ1r0HS4PZxL07ubQlW28yfBhng1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715593883; a=rsa-sha256; cv=none; b=GosUA41VJxKsflyva2jfJDUpleenvs/5K3iUie3c+pisrcUrtyT+GXXixkvVhWMcYn9/Pc jVWwoYg8RVZDvdVrcj2nHnuqekzUna3hy7PpFPApDKnj/hmUjq1ZzHuzLJo8tNhHLmc7R7 i7B0Dkyt4OCFaXk+sBL9waE+0WMOVR5hoEGtNXRJvju7xcsokMwU/bCn8CKYL4GRH1u0xC OmoUMNCWKg+Ib42Gc5LhINdwhTcxEfWwupYc4V4wLaBoQzdb59IBpePWbJNYsj+B5yBAqw U3UWXQpR6vfx08vxthUlWmitXxhE6wIAgmlRbue5CgHrVZYsn1CyIuepLdEMxw== 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=1715593883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Ilo4ELZYwIIKNbU3YcObwBl0hh5rtu/zuuY4qBkmZ8=; b=hQr80hpuK6rRgBPkTYS+sn5jaHjaznSNMDScQUupSjeyivGVeuqkNxVvVAOvMc8vonHlK9 fuDWaNw2QgpxUhcsqeHbjb9KZicmmiH6gSIs03fsYA30skYNk4T2dOST8E7QFzaSNIIMPZ PBZBiYMYb3pxjQb1piew07Tjen/dVZ41NSYwCa48na6vqeKdwA0K885PXQcvMScBAFKSxk go8B9Wq7caIQXFO3ZnamLNGPXR6C2hF/OD39mM+ItlZIxak4qRLsXIXowZqQBjMOL0BRKS +uFpF8ydTDCLi3Xs0wqflQu35x9I/7mwGxMbadEgKa2m4ZLyNdn6qhbXJRRXSg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdFB35ztjzjp7; Mon, 13 May 2024 09:51:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44D9pNUP036624; Mon, 13 May 2024 09:51:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44D9pND3036622; Mon, 13 May 2024 09:51:23 GMT (envelope-from git) Date: Mon, 13 May 2024 09:51:23 GMT Message-Id: <202405130951.44D9pND3036622@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: 9877b9bea5b0 - stable/13 - mlx5en: add diagnostic in one more case of failed eeprom read preparation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9877b9bea5b0857bfdf0b7eeadbd53d227b651bf Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9877b9bea5b0857bfdf0b7eeadbd53d227b651bf commit 9877b9bea5b0857bfdf0b7eeadbd53d227b651bf Author: Konstantin Belousov AuthorDate: 2024-05-05 07:09:07 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-12 01:18:13 +0000 mlx5en: add diagnostic in one more case of failed eeprom read preparation (cherry picked from commit c097967b9af946cf46246cce5adde53f7e955ecc) --- sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c index 75786d313fc9..fb1c8ede424f 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -3642,6 +3642,9 @@ out: /* Check if module is present before doing an access */ module_status = mlx5_query_module_status(priv->mdev, module_num); if (module_status != MLX5_MODULE_STATUS_PLUGGED_ENABLED) { + mlx5_en_err(ifp, + "Query module %d status: not plugged (%d), eeprom reading is not supported\n", + module_num, module_status); error = EINVAL; goto err_i2c; } From nobody Mon May 13 09:51:47 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdFBW5rH4z5KdK8; Mon, 13 May 2024 09:51: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 4VdFBW5KXwz4gc5; Mon, 13 May 2024 09:51:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715593907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OMr2f8GgMP56izcSCsJAQSbkhGE1rap10COo4LsqN1g=; b=j5MqHfrDds5A2VcVLk8LBT7lR9hug6wLLLABlOKDXWfYI06dthKy0/BgNK5WIq627D/i1A KKj5QzS5HcHf0HX52zJK78y8J9x3CCmr7rcRTQNjKr0d+nlOOLsnEZpwKbIzuriqnb+8Q1 BEaIRF3pbRtPDzQDTgKpIsorqEWsjbpyDWDzFG+Zxgz3jrAikea6s/rWEKF0Abdiudnxvi WkoZRn0x0H0JjWiqMjOAx4BGbUUxtnf9RM1ilg7BYmXMhmy6efVgHeoKf1G1TaC4gPYpPP ge4Q7BXAxWRNFdv0XFxXzyGUJvoEvN7rdGKi+TwhikRaJiR311PS7EVMewgQkQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715593907; a=rsa-sha256; cv=none; b=MsL7jDLCmFaJitxhjIMio+m6ohLEuvOJLAvPZqIhEfjPKwhnYykhEWiNII7TrMHOGE+ylY qJO/KHpD85hzpIhf0H426Y5chGYw7orF5HWb5tgpdQfTt4OKTbCQEm4FSq/JmUr6Qv7Knk 5K+qr+3Sm8a4xBvV4kmcnTziptDP+vKx7nOnpvQ+mLu/m+DKZ/odFd5rCqtycM4yV+CX1q uKJQ7kWsjbcmQS3oID6ZmQl+2JAaEcvV8xgoP2hqBSEUaX9cDfrt4nI4E0163xvt3+tjbC fQZSX0VCidxw6bJX3jFeSHZlgsAzxGyGxbXgbgt+fhiwczHp6//ihh7nV7np8w== 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=1715593907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OMr2f8GgMP56izcSCsJAQSbkhGE1rap10COo4LsqN1g=; b=nSzOXK0hFMIy3825Uz5Eoz8VLm1zlfcVwXsqMWgRfgO00uTzOKE5Ak+vBEqiApsHkNQB59 HOZdlouOgezjY12oW/HWA8naYjTPvHJCsuOIU5p9/Cinv8hCnl8gNsER4XhuAfu0mMmvM8 4c811ymxxu/Zi9K9iJEinTo9kjmNBvvovVRCOd1PUNBmRCwkOJ5bwbsspRwTD030/MvaeW 4GwtGQj5iI7qeAXzafeBo0fW2GdSRkzzn65OPxzxCSxaqssAhqXvLrVXTGp54mfEUr+uzA WacR3jsfHUzUxPYVnQjN5d4YZcE8oKPhMdEEaDXIS7M+/Jpmg7X1fNtdz2tDfg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdFBW4tsFzjy7; Mon, 13 May 2024 09:51: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 44D9plXf036814; Mon, 13 May 2024 09:51:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44D9plKq036811; Mon, 13 May 2024 09:51:47 GMT (envelope-from git) Date: Mon, 13 May 2024 09:51:47 GMT Message-Id: <202405130951.44D9plKq036811@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: ddabe1d3c515 - stable/14 - mlx5en: add diagnostic in one more case of failed eeprom read preparation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ddabe1d3c51556c84f830b0203204c55b495e57b Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ddabe1d3c51556c84f830b0203204c55b495e57b commit ddabe1d3c51556c84f830b0203204c55b495e57b Author: Konstantin Belousov AuthorDate: 2024-05-05 07:09:07 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-13 09:51:29 +0000 mlx5en: add diagnostic in one more case of failed eeprom read preparation (cherry picked from commit c097967b9af946cf46246cce5adde53f7e955ecc) --- sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c index e1dbd02fcf3a..962705e6d258 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -3674,6 +3674,9 @@ out: /* Check if module is present before doing an access */ module_status = mlx5_query_module_status(priv->mdev, module_num); if (module_status != MLX5_MODULE_STATUS_PLUGGED_ENABLED) { + mlx5_en_err(ifp, + "Query module %d status: not plugged (%d), eeprom reading is not supported\n", + module_num, module_status); error = EINVAL; goto err_i2c; } From nobody Mon May 13 10:11:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdFdK1qrFz5Kfl6; Mon, 13 May 2024 10:11: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 4VdFdK1JlGz4hQL; Mon, 13 May 2024 10:11:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715595093; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d1rLutOeGuxEY4SFsvWXYVk/CKw/D5o2XEsEOIpTPDY=; b=UXoy8Fyu6MAlXgguSXhhnDNlJuT8LQGvpT96zKHSz//55pyKR+8mW0KZ9dfrAFRxIgcR4E nsM8xkMY4xVWzSp754ieQ8CFgLCp2GOhYt94Hy71x1efnBRl+L9bApUaB19HONRx6vuAs7 jr8nBJQtNaZsclLn/GXR8HPkdHQr45QbWvrveE1FYe5whLh5O6nIicC6nCko/44VokavBC 2wDOdQA4UGeFSRxiLVtyyEUj6aXGVKospMXEfv+O771h+mSRvu39E7sXQlVhhcafN0hnTP 6zIPkliLFC0AHJbXd3ARK2mYO3PCePNj9ynhUTEpCreGbCRjhDa4K7WAPb3CYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715595093; a=rsa-sha256; cv=none; b=U3QgeJYWOU8h1/4LLHPlJGrpZb4dO80x2grdCjxT41zuPXQIcl6MbgEWzdH6+x+5zgF55g pEuF8AImo1gPmneoLmkG5SrXcz+8SGxEfBMFedUy4ddGwdrWIOAe8vXKuBiuKtQNhu5B8T J5+JvdKA6pUvF33D+BrfyZ2zPoonD4+eWTo954FSNDkdbatTyGebNx117xMZQN0xLkcWqM 6CYWvJHECngccOTyXoX84IPxr+Wkk5PLY37DWYDkEYWTHghoXULGPJriYcfid7rpVxCnkD 6gVR/MJ8Z6uPXiawUC5QxBOiwGislkElvfAQLyWYexCEwCNW6L5LbSZd1RAGMg== 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=1715595093; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d1rLutOeGuxEY4SFsvWXYVk/CKw/D5o2XEsEOIpTPDY=; b=NO7fEN9NcPFMhWIKWYZOKQBtzTavW42XQ5OTDJ6FQNA73svdzW9JdiG1/UWj1mM2YoYs0T FNsaCdHQJqb6GJneAGf9GrfJtWt4jk6bkeX6uVtsOZZdQC/sJUikQELFgEqAdHANxzz7XV ysfO9kqGUfpMrqC8wUZiZy95CBPzIEpnfAd8jrEbShxjXHMFeyDO1WTOK/0fo0XsycjzLM kAoAoFJTCV2FGK0q9ucgrLwectS8ES81OsiNFy9Wx53HKffwUlTfmuDfM+pOW1oNdYdSxn QshyBQt9GxZ/q/RA+JJ5p50h3JwRcLzbByVSkhgCJg+cQH77skoWO4WHPGzk8g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdFdK0c9Jzk1Z; Mon, 13 May 2024 10:11: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 44DABWwe068046; Mon, 13 May 2024 10:11:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DABWSI068043; Mon, 13 May 2024 10:11:32 GMT (envelope-from git) Date: Mon, 13 May 2024 10:11:32 GMT Message-Id: <202405131011.44DABWSI068043@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 59a6666ec91d - main - if_ovpn: cope with loops List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 59a6666ec91d71f97aaae5195bbfafd9d422db2e Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=59a6666ec91d71f97aaae5195bbfafd9d422db2e commit 59a6666ec91d71f97aaae5195bbfafd9d422db2e Author: Kristof Provost AuthorDate: 2024-05-13 10:06:47 +0000 Commit: Kristof Provost CommitDate: 2024-05-13 10:11:06 +0000 if_ovpn: cope with loops User misconfiguration may lead to routing loops where we try to send the tunnel packet into the tunnel. This eventually leads to stack overflows and panics. Avoid this using if_tunnel_check_nesting(), which will drop the packet if we're looping or we hit three layers of nested tunnels. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/if_ovpn.c | 9 +++++++++ tests/sys/net/if_ovpn/if_ovpn.sh | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/sys/net/if_ovpn.c b/sys/net/if_ovpn.c index fb9596069101..f6f640a65f61 100644 --- a/sys/net/if_ovpn.c +++ b/sys/net/if_ovpn.c @@ -255,6 +255,7 @@ static const char ovpnname[] = "ovpn"; static const char ovpngroupname[] = "openvpn"; static MALLOC_DEFINE(M_OVPN, ovpnname, "OpenVPN DCO Interface"); +#define MTAG_OVPN_LOOP 0x6f76706e /* ovpn */ SYSCTL_DECL(_net_link); static SYSCTL_NODE(_net_link, IFT_OTHER, openvpn, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, @@ -1854,6 +1855,14 @@ ovpn_transmit_to_peer(struct ifnet *ifp, struct mbuf *m, if (af != 0) BPF_MTAP2(ifp, &af, sizeof(af), m); + if (__predict_false(if_tunnel_check_nesting(ifp, m, MTAG_OVPN_LOOP, 3))) { + if (_ovpn_lock_trackerp != NULL) + OVPN_RUNLOCK(sc); + OVPN_COUNTER_ADD(sc, lost_data_pkts_out, 1); + m_freem(m); + return (ELOOP); + } + len = m->m_pkthdr.len; MPASS(len <= ifp->if_mtu); diff --git a/tests/sys/net/if_ovpn/if_ovpn.sh b/tests/sys/net/if_ovpn/if_ovpn.sh index 0ec2563cf355..22da82312dbc 100644 --- a/tests/sys/net/if_ovpn/if_ovpn.sh +++ b/tests/sys/net/if_ovpn/if_ovpn.sh @@ -95,6 +95,10 @@ atf_test_case "4in4" "cleanup" echo 'foo' | jexec b nc -u -w 2 192.0.2.1 1194 atf_check -s exit:0 -o ignore jexec b ping -c 3 198.51.100.1 + + # Test routing loop protection + jexec b route add 192.0.2.1 198.51.100.1 + atf_check -s exit:2 -o ignore jexec b ping -t 1 -c 1 198.51.100.1 } 4in4_cleanup() @@ -404,6 +408,10 @@ atf_test_case "6in6" "cleanup" atf_check -s exit:0 -o ignore jexec b ping6 -c 3 2001:db8:1::1 atf_check -s exit:0 -o ignore jexec b ping6 -c 3 -z 16 2001:db8:1::1 + + # Test routing loop protection + jexec b route add -6 2001:db8::1 2001:db8:1::1 + atf_check -s exit:2 -o ignore jexec b ping6 -t 1 -c 3 2001:db8:1::1 } 6in6_cleanup() From nobody Mon May 13 10:41:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdGJ86PPsz5Jy7C; Mon, 13 May 2024 10:41:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VdGJ85x73z4lFs; Mon, 13 May 2024 10:41:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715596904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zch/iwZJNidO8AWSOwgKfmx3gT2Jqiv1bZ05cI6Lb7o=; b=NUc6aJFoR9UGRd+P8nf0dIGQkGxlz4faptAaTwSQsrlQByEhW3O7w2bQvYK9NdLCRhTIH9 a3u/1BWwCL07j0wZ1SeIxcydf2BgO+LItpk9pRHaEpyBL9MOK8BAeMKxB0eatXyudo+pjv PheAa6iKcTshhpYTmVRhQh2WaSni2Rw51OA1oSbUzs3lZ1sPwZAVwI8GsuiIV57sX+dqE+ EqAnhE2++4oZAVtOTO0Pq90KtrajNQjM2P3EceVY0hXEuK51lmsChqyPdYz3y9jarHS5le MiVK4WdpJO4bgyw+MEI7UE+3bqdJ3IdzdVq1Iab7bKOMCdBunCbn8syFUhONXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715596904; a=rsa-sha256; cv=none; b=PveYq1FoupUbnghAaGhtI1U715Dnoco9yivXwhCdPYfpcILmxZM990A2CwIr9DCbbqC1ou spU8sBrVexeo/Fb0UhPey8piCwcn6Zm4fG3VVN6lxX9c0J6PYukpPSfyYKzzfDNmZmIhcP zA6L7J8BMqmlcggzFG/hcivvLW6qU376YwDNyp9xtgL+j+uSiowEGJ183rR9WCiex2cXZw aCBKsd7ywtksCCzYepIpbq6OvZPLgS69eU9h0ZyCVP0y7/DLzMgeK6BAvkkS8paX+Z1rO8 WSdeeWkH9IgShZeop4R+fPmt9gSqplGVuq6Vu9VIKh3YAGQ4mrVzqGkJlf1n1g== 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=1715596904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zch/iwZJNidO8AWSOwgKfmx3gT2Jqiv1bZ05cI6Lb7o=; b=XpxPN1n00AoBLStQ9h7YHzyDAwojdeA40cif/vxHM2ipPETk34HYFCQfJb6Idt38zpLwqa jO7tI0QvMAkp38VEoT7/tg38F4hAL0ENRZUCBz0QOc/5muqXQgk/tfDJ/sxOuaXk10zVbv E1fGnh76NnBcNfhbEi381Wel2Lg8txxU8kt9mRc11JIHOK3jv3Jf5qQZ6xxGA1cwDk7FKP wdWYRsJ3LvSgd5lSsFOsnYNr68gAhu7RZ/btDkOhgIxHOEh0eEVWBLImFN3HDYgEUvVYLo 49Y43C7/EjVv5VbyNWozT1FZlhleatdAo6deoe4gSfLw380gMMlraoDhDfhPNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdGJ85Xm4zl51; Mon, 13 May 2024 10:41: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 44DAficD024692; Mon, 13 May 2024 10:41:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DAfiqE024689; Mon, 13 May 2024 10:41:44 GMT (envelope-from git) Date: Mon, 13 May 2024 10:41:44 GMT Message-Id: <202405131041.44DAfiqE024689@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: f3eeeb959c9b - main - expand: Fix markup for the `-t` option. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f3eeeb959c9b00c89a2e1ff009c78162eb398656 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=f3eeeb959c9b00c89a2e1ff009c78162eb398656 commit f3eeeb959c9b00c89a2e1ff009c78162eb398656 Author: Dag-Erling Smørgrav AuthorDate: 2024-05-13 10:41:27 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-13 10:41:38 +0000 expand: Fix markup for the `-t` option. PR: 274897 Fixes: 8993d785a261 MFC after: 3 days Reviewed by: gbe Differential Revision: https://reviews.freebsd.org/D45167 --- usr.bin/expand/expand.1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/usr.bin/expand/expand.1 b/usr.bin/expand/expand.1 index e63d9d7c1e03..68a7a57eb77e 100644 --- a/usr.bin/expand/expand.1 +++ b/usr.bin/expand/expand.1 @@ -78,9 +78,15 @@ If the .Fl a option is given, then tabs are inserted whenever they would compress the resultant file by replacing two or more characters. -.It Fl t Ar tab1 , tab2 , ... , tabn +.It Fl t Xo +.Sm off +.Ar tab1 , tab2 , ... , tabn +.Sm on +.Xc Set tab stops at column positions +.Sm off .Ar tab1 , tab2 , ... , tabn . +.Sm on If only a single number is given, tab stops are set that number of column positions apart instead of the default number of 8. .El From nobody Mon May 13 14:14:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdM1p3Qj7z5KKJh; Mon, 13 May 2024 14:14:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VdM1p2w38z4F5p; Mon, 13 May 2024 14:14:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715609678; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b6EgDi9hRzn8Y2Tm6aSG8k8OoxvPN1g4QZiqt1V2sBY=; b=EuZ24xmUQy1bXWP9oLMeVbIEZBE0MzEOWuQONp2JJ3sypL5Sicfkh6iV5Uz7s50441SCl7 /YLTey3K734+tLZ1ObYI7qdeSXEni/4tx2/R1nOcJ8OUJ1ZFdRdKpFWKq5GS6qzf4WYXOj tpoi5R76KpvynEIqqcbwi0T+lE4XI9PxMvxWPTsgzKAXwV4ZgG21f5rC/E7DgQ802zHsIz N41WdFBFl2Atzm6y8Uaz48cduvaeeEr/3tnzDTnKR7OuYoPSObKd1ame6DXExh+CmQ8hqd Yuuj3TLAeruEHY0jYgSqbiCRZGZV7JjIc6j0S05arVU7YXefqQGgw3201WuFBA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715609678; a=rsa-sha256; cv=none; b=laC49V7q+WI6YS6cO+HrgoW7/Z8b/SeG0jWZjHT9n2lzHUdZetqo8BV3n92wv0B2VF7aSx E8y5tNuO9eWrVtxu8n2lVgmS1CcUkuLW+/XfPZvwygtKGzzETxsVa1aDdprxyKhQQAepJS RSmMu7dfmJL00dUDZtBc6WWzF2ZG0CUhj4F8H03aJ+jDuvV50TQemybXFRL7XTDxKYXqxV MkW2SjYwYtKtKoj1k97qscjLVzob/lguRoswBxSqgDenh5xcEekIUU3YoHuHhLeO7Ef1MA npY4/2BWwOQOlijnk2eoEF6C+CTyGsd4rfSVJ0YWOS/dql69VPkr9jlSUxRBeg== 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=1715609678; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b6EgDi9hRzn8Y2Tm6aSG8k8OoxvPN1g4QZiqt1V2sBY=; b=X6Qp51aAj2kcwbPz6Rccp7cQWl5O98CI8cOK7Jb3FuWYGi01/fgJy6MMGFsAoCqxoYtiXj KJbPF8Ojt5A9K4goTtPGtXscBpS4OlPcaJplgAzqoInHBkjv/Xt/euVsh9sHHG1QRdXga6 tiWj465jFdhjDBSXkBY4LfEKVOVNaMzwGpn6jM4KwRRFhRoMkDhJQ/Al87o5SXVVU1NKUq kLm/RwqkjMlHxTKggZSJDtB5p2HX2v5biAFfZ6sKAkZczZTUfGVWNCg6LggayVn+SsPmj0 vUqLzmLyR3cfKckxZgK9P/HHrQM5ZH4VjVUe1sa8Y3w4a03gZChrl3p21RVajQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdM1p2WJ0zrZ9; Mon, 13 May 2024 14:14: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 44DEEcjs081659; Mon, 13 May 2024 14:14:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DEEcFO081656; Mon, 13 May 2024 14:14:38 GMT (envelope-from git) Date: Mon, 13 May 2024 14:14:38 GMT Message-Id: <202405131414.44DEEcFO081656@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mariusz Zaborski Subject: git: 050555e12978 - main - syscalls.master: allow vfork(2) in capsicum(4) capability mode List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 050555e129789fa2e20eba565f1320936b3d66e4 Auto-Submitted: auto-generated The branch main has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=050555e129789fa2e20eba565f1320936b3d66e4 commit 050555e129789fa2e20eba565f1320936b3d66e4 Author: Edward Tomasz Napierala AuthorDate: 2024-05-13 14:10:01 +0000 Commit: Mariusz Zaborski CommitDate: 2024-05-13 14:12:29 +0000 syscalls.master: allow vfork(2) in capsicum(4) capability mode There is no reason not do do this, we already allow fork(2), and I need vfork(2) for CHERI process colocation. Reviewed by: brooks, emaste, oshogbo MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D39829 --- sys/kern/syscalls.master | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master index 274167ac11d8..094c538b22e0 100644 --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -497,7 +497,7 @@ int flags ); } -66 AUE_VFORK STD { +66 AUE_VFORK STD|CAPENABLED { int vfork(void); } 67 AUE_NULL OBSOL vread From nobody Mon May 13 14:24:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdMFC3T2Fz5KMgw; Mon, 13 May 2024 14:24:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VdMFB0Jq9z4X23; Mon, 13 May 2024 14:24:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715610270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mUwESccMgeG1XXIHYPVUioP3vmeowWTDbZkcvHovosU=; b=virnLnnPL07qxMY5vvdQsZ6uEBbjJlFyxtGaEBO47pQplkPPwMc+kEJkQ+sN2l6Uw1e4Mw ZdoFTUbg/RxeHBvznNtI5NwfkCqaoP/VzE6Q+Cp7Riba1yBr0H1s1sAwfZcjxGCS8vDaFQ JLtPMwsBe43o97Alu50aYs2gniVSwY2NCr2i7EFGkRPbVoZ5W/Oio0vUuWd51dJibkTL8e cXBXf2EbzVBjRizU25VjM2bqprTt4tiQqd2uyWDlFR0YRfs15MXyX7i+aqb1awXNsjoL5o U2Az7VizsiQkfoLLSJKxNIocmjbBCrGV6UDCANP5ySz2nJ5vQlaN3H7Pmpul0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715610270; a=rsa-sha256; cv=none; b=yvenMmoTHGot0d+qCmbWyNcM2JlXu6J/aWocCu9pyh81m2Yf1sz6TgS4Cfp03OwXEtc/e7 a0sEW+6yXfQWgHJnubbLv+fTF/QdQ3pObGSYhvYVyGNeKHuZkKjljTh0aUy+Rn3Z1o2p2F 5U1rEwz5LopAT/DiLnrXBcy55LeMVf9xxj8Vfm9OLny+woZN8eYAgds+q0iNZ0FRWHR4gD f77z6C4vC88dqnGilTI6SpMZtel/GJc1dksHXsBT+DDJY7At9THHcYXu+v7C9l4Zb+FWN0 FmxhRXhA9IfLy9h6M3pyk1D+19BWba4Yrtla082uDjwiEjhKlJqU+Fvk97Dnqg== 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=1715610270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mUwESccMgeG1XXIHYPVUioP3vmeowWTDbZkcvHovosU=; b=x4lLxwNpVSth9ABQ0p9k+S+6OG4BkG1BtiXLUNxRl4EKT/+U7rUg0ZbbplF9URcgLxRYDz KCGc6c+BZfvG7+d+Tbo4juqmdmkNehvAWyQKicmYwT96zDazd9z/+Wc9TOzYkjj9rb1lhd K2LEtpTNDcdFouIytzykyVDKwkaOxX3XUImhiZBrE3R0HWnFwMRtet9nqKBWX4ac3ZUL+G M9uMbYoNCdbH6dEWq9DPcZdjxFaareGvdZO1CSYVcTE3eCzkZVA5Fxmk1m8oYOWDjXPl65 tD1Cx/56A0z86IPVTCDpNk+sm8wj5zx4DOHMfGsbkp8bXk4rAWaqQUEm8y1o8Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdMF96NbGzrsg; Mon, 13 May 2024 14:24:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44DEOTkQ016626; Mon, 13 May 2024 14:24:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DEOTGf016623; Mon, 13 May 2024 14:24:29 GMT (envelope-from git) Date: Mon, 13 May 2024 14:24:29 GMT Message-Id: <202405131424.44DEOTGf016623@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: f2109683ce37 - stable/14 - dlopen(3): mention fdlopen for capsicum(4) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f2109683ce37927d02965fc97e5757761caf89ed Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f2109683ce37927d02965fc97e5757761caf89ed commit f2109683ce37927d02965fc97e5757761caf89ed Author: Ed Maste AuthorDate: 2024-05-07 01:45:50 +0000 Commit: Ed Maste CommitDate: 2024-05-13 14:22:34 +0000 dlopen(3): mention fdlopen for capsicum(4) Capsicum-sandboxed applications generally cannot use dlopen, as absolute and cwd-relative paths cannot be accessed. Mention that fdlopen is useful for sandboxed applications. PR: 277169 Reviewed by: markj, oshogbo Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45108 (cherry picked from commit d84fd89ecd404ffbf629381d2dde14fd79b39402) --- lib/libc/gen/dlopen.3 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/libc/gen/dlopen.3 b/lib/libc/gen/dlopen.3 index 09f37ff2fa93..340545114114 100644 --- a/lib/libc/gen/dlopen.3 +++ b/lib/libc/gen/dlopen.3 @@ -29,9 +29,7 @@ .\" .\" Copyright (c) 1991 Sun Microsystems, Inc. .\" -.\" @(#) dlopen.3 1.6 90/01/31 SMI -.\" -.Dd May 14, 2020 +.Dd May 7, 2024 .Dt DLOPEN 3 .Os .Sh NAME @@ -201,6 +199,10 @@ The function can be used by the code that needs to perform additional checks on the loaded objects, to prevent races with symlinking or renames. +Applications sandboxed using +.Xr capsicum 4 +can also make beneficial use of +.Fn fdlopen . .Pp The .Fn dlsym From nobody Mon May 13 14:25:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdMGT2mN2z5KN0F; Mon, 13 May 2024 14:25: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 4VdMGS6f5qz4YBV; Mon, 13 May 2024 14:25:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715610336; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gBifF/8JVYxbIi3b0CHrELUVMk+9CvB00Ms284jTzn8=; b=dVxr/KYWZzhKwW2fonEOcImI/fMWAqJvo0fTfrPXfllvMpbBaSmYRFbkzEZr7vtaSLfJ3x hta8eS8RkADewb5UpGm2k1XapZU+k1hS8WbRt93vwZyvSYewykfQpGNCNA2F6TUbBY+0K+ lgbbVCiLes5yWP36stJuFxXlKf+Umt5DxB9hBwZxko8lyfsqEqymqRdecZO1bDpUovgDur dkf58rfmW2m1+5rjl/PZLnb3MJBjBkbwOHihp/d1zTFCk9589S6r6rUbSOo4QRjoiLyZhT TFUOMor3/GcjwxdL6LDW1Rv3TCFf0x1Xa1zwu2ah4GcaevEuPNbBL43T9mltHQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715610336; a=rsa-sha256; cv=none; b=HyTwepOUHQXcy1cLnTTFpY79uvxF7y5X3rK/BGF18+0GyySKbd1g0joKxS52xdC6a4kxFb p/qzkUrFwZXTP8hqIWFwJ6iFjgX6zxNcbTITuNo3HihSdkdmWOO76o9HyxC/zH4NB1Qc81 oZC7GucEn+DWYbi4tHlqpWFw67+RzMe+ep7+4ogzOlabWaLdy4c+FCDZp3F7W6/8d/GuQF km3ml28g+Jb69ibD2ZR7pAfhOz54zm0tRHA/HtptfaCgCpNmFj2W3gljUMqWn0jYO8Wma9 ETPChgyRtLhIMylY8AJWYgFc0GWT8uyk9Nj7YK6n4SOI8Qsr008hqfIjFi2uSA== 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=1715610336; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gBifF/8JVYxbIi3b0CHrELUVMk+9CvB00Ms284jTzn8=; b=Q9unID85UwIAGemWKmBaZMg/0d3K2QRIitdIWmTcfrGG0MxAw+kIP2xGbkOx4RdMf0rA4l X7eRn6Rg98eMyP2jrW3XSvdAZppZfEvu77XlGkn4iUyLZhFjTXTUETm6HqTib/Q/uS3Mnv e8SR/btwrLzeti6FfSNgoFu9Or4SAkWJR+tpkVrswufgoi4YTAWsjs2GWKD72Bas9dduHC FYljPmuXt1jsqM2nmaSh11WgpGXEa8HuNC95mSayhNf+HZLc5BYsAmG1eYRwTDb6PFpI9s 2H7qEHh+n4AaNRYtFlokTTpBCBE/GZgbLkva0zuKutCGuiPvgyc6B9LR1apJVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdMGS643mzs46; Mon, 13 May 2024 14:25: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 44DEPacg019193; Mon, 13 May 2024 14:25:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DEPax8019190; Mon, 13 May 2024 14:25:36 GMT (envelope-from git) Date: Mon, 13 May 2024 14:25:36 GMT Message-Id: <202405131425.44DEPax8019190@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: 3c05a91910d7 - stable/13 - dlopen(3): mention fdlopen for capsicum(4) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3c05a91910d7ee809f884ca6ed46944bfda260e4 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=3c05a91910d7ee809f884ca6ed46944bfda260e4 commit 3c05a91910d7ee809f884ca6ed46944bfda260e4 Author: Ed Maste AuthorDate: 2024-05-07 01:45:50 +0000 Commit: Ed Maste CommitDate: 2024-05-13 14:24:57 +0000 dlopen(3): mention fdlopen for capsicum(4) Capsicum-sandboxed applications generally cannot use dlopen, as absolute and cwd-relative paths cannot be accessed. Mention that fdlopen is useful for sandboxed applications. PR: 277169 Reviewed by: markj, oshogbo Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45108 (cherry picked from commit d84fd89ecd404ffbf629381d2dde14fd79b39402) (cherry picked from commit f2109683ce37927d02965fc97e5757761caf89ed) --- lib/libc/gen/dlopen.3 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/libc/gen/dlopen.3 b/lib/libc/gen/dlopen.3 index 94dd1864c126..4719d2733fe5 100644 --- a/lib/libc/gen/dlopen.3 +++ b/lib/libc/gen/dlopen.3 @@ -29,9 +29,7 @@ .\" .\" Copyright (c) 1991 Sun Microsystems, Inc. .\" -.\" @(#) dlopen.3 1.6 90/01/31 SMI -.\" -.Dd May 14, 2020 +.Dd May 7, 2024 .Dt DLOPEN 3 .Os .Sh NAME @@ -201,6 +199,10 @@ The function can be used by the code that needs to perform additional checks on the loaded objects, to prevent races with symlinking or renames. +Applications sandboxed using +.Xr capsicum 4 +can also make beneficial use of +.Fn fdlopen . .Pp The .Fn dlsym From nobody Mon May 13 14:26:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdMHN2H6cz5KNKb; Mon, 13 May 2024 14:26:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VdMHM3zCmz4ZDN; Mon, 13 May 2024 14:26:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715610383; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=liymykgxb/luAvyYvnPNjX2G//QXUnBFOZNEvG+uBjE=; b=Qg6HPmtNjDkM1ApDk99rXzC1MrifwPsy3VB3k41r3d3mNaHZVl7ECTShVBN4Svs+S7w+o2 qMrnFLKJMnWZZ8yFy+yBfxwIstCk+6AoyyW62hpnnUeFlyutB6xuzyywDHVxc+wZIvTbmO CzyOC/Rb2GhYov9HNNk/z1Q/vyIXHhDAmjRpaIpO0A7f6BCEy9RIcIWrFdLIbWY/HaWB8E kqZp0J8B1Gw1bwd8VIidbq25AEhS2iUni32AtmcL+x7Q71H7BDFNGqg6+cVQpAUC8AuvAf mbRCCTKD80ntNb98S3DTDzY1+15NRk5r3Sv1CE+TPrQ9pYsXphacbjmwRJsyLA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715610383; a=rsa-sha256; cv=none; b=hX2wUFKOz+LWl0rRvWH1daPCDwcEZYYcZSdWtlNwijBpB//TLiR5PalH1LNeHO57jeCnRk j35hCOQ9AeEgxFUn0CNTyHQob/NCCzPmwesFy2jBzLrMjWGtWu3CqwPvTusfRUEHLV/aWz J/El3iTSD2+qtV0iLVfiR2goXe00xEgcNIWFFlijeoD158i6/MzP6S2lmDlCum6ztXchpl e4yCOnT81RLQMqWPDdG+QiZ9pxQlDDAOB4v16jDoKSde93vfwxuSGoUfjdXis/fwGp0C0M EK2ymKBd1YNeaej3SluZIpKIp+Y0QDaOg77dAUs1U1hTDvza6GyMYeo9Kl4Hlw== 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=1715610383; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=liymykgxb/luAvyYvnPNjX2G//QXUnBFOZNEvG+uBjE=; b=Kc6u9HkhvzWRNYW90ncT8ZNhgSuLy3psdtQkezj+WPwE9ZYfLSiCVOx+M7oSNBsh0SFxS0 ushGPiXf/L92OGgrYkh1cdu8NvB2Ffs+dWBr0zGTUyTQjSSXHZF3TPTRq+DTeO69bjmSP5 svOM3iVO4VT5G1TkDju8rO6LdIbXIc1lInIP40RUq6xrcrQr82CqTz5I3CpE+bAVNKa9WK Uz592O1Q7kluJJnM/qpXBv2AmcyEBIClppznd3GkApJX2WXJOGpEyzGXnfBUBFs3QqdIi/ dIfOvDup22B8FaKtJzLGaBIvSZsTjJYgAirkePKQjb8qYW81cZq/fSgzcv1oaw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdMHM3Y63zrjJ; Mon, 13 May 2024 14:26:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44DEQN2W021770; Mon, 13 May 2024 14:26:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DEQNuS021767; Mon, 13 May 2024 14:26:23 GMT (envelope-from git) Date: Mon, 13 May 2024 14:26:23 GMT Message-Id: <202405131426.44DEQNuS021767@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: c595a834ebbd - stable/13 - clock_gettime.2: Clarify CLOCK_* List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c595a834ebbd4b6fa49b40c8f9cb4e3dda082c4b Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=c595a834ebbd4b6fa49b40c8f9cb4e3dda082c4b commit c595a834ebbd4b6fa49b40c8f9cb4e3dda082c4b Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2022-07-08 19:54:10 +0000 Commit: Ed Maste CommitDate: 2024-05-13 14:26:10 +0000 clock_gettime.2: Clarify CLOCK_* Clarify that CLOCK_* (e.g., CLOCK_REALTIME) do not necessarily default to CLOCK_*_FAST. PR: 259642 (cherry picked from commit 16e4487e5f82e1ff501fe5af6afbfbd0435a1cbf) --- lib/libc/sys/clock_gettime.2 | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/libc/sys/clock_gettime.2 b/lib/libc/sys/clock_gettime.2 index 7b325a2bb394..ed469153a40e 100644 --- a/lib/libc/sys/clock_gettime.2 +++ b/lib/libc/sys/clock_gettime.2 @@ -94,19 +94,28 @@ Returns the execution time of the calling thread. .El .Pp The clock IDs +.Fa CLOCK_REALTIME , +.Fa CLOCK_MONOTONIC , +and +.Fa 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 , -.Fa CLOCK_UPTIME_FAST -are analogs of corresponding IDs without _FAST suffix but do not perform +and +.Fa 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 , +and .Fa 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 , +.Fa CLOCK_REALTIME_COARSE +and .Fa CLOCK_MONOTONIC_COARSE are aliases of corresponding IDs with _FAST suffix for compatibility with other systems. From nobody Mon May 13 14:27:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdMK60LhHz5KN4Y; Mon, 13 May 2024 14:27: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 4VdMK55Phhz4dwn; Mon, 13 May 2024 14:27:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715610473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NR6CTOhQoOvicVWi7WaLCgpHhgzWb41p2CujCRO9WxI=; b=qUIPA0GZDiRO99G9aGiG9BIBBiSMeRqjU5Rn+hyMzCdEXNTWuz9WGxr2P6Y2zSVbMGrwya JOUOz7nXjn8UEIYZEI8Xmhg+zTKe0dUOVKrfKipbRTzmNA9uHQvz4hlQ6rXdtocJo7+K+b AofaVFIyr1UN936qyfy/wUDdu8Jhmbq7euIG8dVypXCx2GQ4EMuQZ6w3FqzTNE9lODDFkD PqD7S/8oSdmep48FIdfseN2rLq6VoMIfzSrN13yiyH5TFL0EC8OdNOun+MLaeSwrzauBWT qLFuJ0FdY9Q5WTsx3nNRukQ9Ml15eEL4bh1JvwT6rlylDbzpVc0gow7mk4b+wg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715610473; a=rsa-sha256; cv=none; b=TOcW0RCj8GOvGueMXwyiNml6NdK+nG9fliXhUGNmwOnxllQVZ9FJTj/gza+RZdq7CtSnvL w4t5GoB9pWgGedzEyuztxvzdhtxLca/5P8n4VH6fUmHVOGEAqWJytKIWHGbY4QM9YvG/3o VldCyYIpRQtduJWnMq/SJWaqCVOi/0vInlsvsbqaoWiIeiiugl4w3RN3o4/XIgTzY0PEH8 T8FGgNCf0wAGjRFnerI8Bf+ya5NQLcWzitelcbOi6+BdXpGUrWcVDQQKDwiKvv1x5P9PLg +Sa7oZDHtII2D2ZsaSmr5xokzgl8EzqrVgAdcqvQHYTlFP+17qNIllLs6ZPaZA== 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=1715610473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NR6CTOhQoOvicVWi7WaLCgpHhgzWb41p2CujCRO9WxI=; b=kBXb8CzOI1lFeJoNchJ4qeMS0K+QC0NX725j9MCKW9uUKOPgcXZkTAI2PrHIMUGCJuGOil 4IKfvajUBUy/T9+yxWKnuCmHKSiRTdVgGhWhEV90EzemDQ/DpHtSUltCWHTK18G4F6XQPX a0QPUcmleXyJtmHiwNjNf6MUiFHTuwV0BfZmH325fPenM28CjJDgiAztljyJDODZB+q9SM EoX3dczpub3f1+gstJ90C+cWq4Q1ZaHqWaj9y/YK4+nC9FFfGdetHc1xNkl5xx1A+gkDVq PIcRGojArIvyeV2audf6pFqfGcBoT7arhExoLCMYn5xwFfSDxSrPCQFjdeEU8Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdMK54RPPzs49; Mon, 13 May 2024 14:27: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 44DERr46022092; Mon, 13 May 2024 14:27:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DERrHc022089; Mon, 13 May 2024 14:27:53 GMT (envelope-from git) Date: Mon, 13 May 2024 14:27:53 GMT Message-Id: <202405131427.44DERrHc022089@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: eca3db908c60 - stable/13 - clock_gettime.2: fix markup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: eca3db908c602405b18196aa53832602c93933a6 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=eca3db908c602405b18196aa53832602c93933a6 commit eca3db908c602405b18196aa53832602c93933a6 Author: Ed Maste AuthorDate: 2024-05-06 19:59:42 +0000 Commit: Ed Maste CommitDate: 2024-05-13 14:27:19 +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) (cherry picked from commit 0e0220d11addc60fe7ed6fca79aefac2a3a9af27) --- 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 Mon May 13 15:29:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdNgg1z39z5KT1S; Mon, 13 May 2024 15:29:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VdNgf6fVbz45w2; Mon, 13 May 2024 15:29:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715614142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sXAAjOfnUdQdT3WoEwG8iaJWI8fTlaisyGytjZ9FDwg=; b=n04hgAGg6WHsGbUPYOjYN5Dp5/P8bWNoh67iFErPd0FVqIeUPDN27M2aRmqpScIxr+JjCX wyJnvWQTXy5VNYdOrosdWVuyjHXYYrQx64oDQF1xbgeodsIq/t2OXr3sqeVsOMWWb/Mx0+ Sd6jiQtvvt3xr4SNhlfCkwS17dPJ3zUaKVQ8oZ9scIlxOAZvt5E/ZOaMqmDYzXorD38EAT xmXrQWUalySSNArdFuusoRJJjRvR/eO0+d0vSb9HfKoxBTvB2lTO+j4+uO6swK3LpkcsNw HdkTjntWqlxaucBmV+YQIgnIMIK5giy9bkYBK09IS7vzl/3F6kuyMvXqh0OBYw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715614142; a=rsa-sha256; cv=none; b=gh263hYBz3v5bzeLBxWjVWRoUPO0oc9CO0D06cKBG0dq890EamzsFCY2BNzD1cd7/ENobB +js20Zsq0wuj1ccGLLDtUW0Zhz0g/nknfM0ljjGNvyBSX4peRHuPj7fdDJtpIEocfOHSjf dMSS4XdDOymgOdk7bU/jqgvQ8p4gP+NERFVbh3Mgy3Ag0pngturl114FryX2OVCTZAjt2U dcxe3hOcxpOk2zvRAq9Tgxr9mbbs+GBL4BQOaTI12xmGdQWk9212+mIQh6Y9quwQvboSUV e+zE5vhoPwactTYj8R8SDvZEIIknEXOlyv6LqrVbkuPIGvl/R2w3t7nTAjt88A== 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=1715614142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sXAAjOfnUdQdT3WoEwG8iaJWI8fTlaisyGytjZ9FDwg=; b=tYAralmR9I7kq25hSnyrB1fIRQXI4ky1+FyOjXYs1d50t2Hl1U5K7e9jF/lqU3hl2khy45 BfFo/WwHtF17a083637AtJAkWVYD2ZLwi+4EsiF7foICmTGUSRMzgQ0ss3ik6WRegyp4Hj TKxa0oPzn2uliXtiN3D2wdPDNeQPc5RqNYuedS5+Eagu8xLVehigpFfnY6wpCrtHIBY/ez J0NTjL0g4ydAQzNQ46cZ0t2OHmhFgrStlESGAQNOWJRnteVWSB8ExwpMe57WjQfMjUPVGS Jt4I/QO5ugipMFvVJAvwf5JBbCgcqVBh9nGN6B/0pZPOQYI4auNk4I/q3ScsWQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdNgf6Gd3zt1S; Mon, 13 May 2024 15:29: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 44DFT2rb023465; Mon, 13 May 2024 15:29:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DFT25a023462; Mon, 13 May 2024 15:29:02 GMT (envelope-from git) Date: Mon, 13 May 2024 15:29:02 GMT Message-Id: <202405131529.44DFT25a023462@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: b667c40f9ff6 - main - src.conf.5: regen after addition of _FORTIFY_SOURCE build knob List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b667c40f9ff6db3ad5978368b3771e675759b474 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b667c40f9ff6db3ad5978368b3771e675759b474 commit b667c40f9ff6db3ad5978368b3771e675759b474 Author: Ed Maste AuthorDate: 2024-05-13 15:27:05 +0000 Commit: Ed Maste CommitDate: 2024-05-13 15:28:52 +0000 src.conf.5: regen after addition of _FORTIFY_SOURCE build knob Regen to pick up WITHOUT_SSP addition from commit 9bfd3b4076a7. Sponsored by: The FreeBSD Foundation --- share/man/man5/src.conf.5 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 5301fc488021..f3e45ca8a661 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,5 +1,5 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. -.Dd April 23, 2024 +.Dd May 13, 2024 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1552,6 +1552,9 @@ When set, it enforces these options: .El .It Va WITHOUT_SSP Do not build world with stack smashing protection. +See +.Xr security 7 +for more information. .It Va WITH_STAGING Enable staging of files to a stage tree. This can be best thought of as auto-install to From nobody Mon May 13 15:43:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdP0N2Tfdz5KV98; Mon, 13 May 2024 15:43: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 4VdP0N1dDmz46r5; Mon, 13 May 2024 15:43:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715615012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PrMry7XcyxH+NRcceOX3ckDdPcEQF7ET9fbJO7+ow/A=; b=R3nrRJ+FEOTb5cAF1lg7b5WVAT4BvtLHWyVqy4skz9x0fBCy8ouBhMUiQf+LRDbY/WlYCP DTNg3ZmqyyLln29agbwe7Yb8KVNs9lN+ggbdCs76ArqOH3gc3bEGHG4P6CWLlViPsrhmGk f6Lo/NVy1P/Og8ToEng04OlQBiAiV4nTxWejHUEMjNDnE75fRIOjrdhdubCe25YdEP03Ae FxNY9icYxmzhfoE4VENUhfeZ7OtKWPlAw+xHgHpYrkL/FON4nMjc/Y+7rPojaKWytEQ6LZ rt6ExYpKXuJmgq0Wk2eDSPGZebSnqHihuQ9S4rmGspbWkQxtPDtT1Iiz7ooffA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715615012; a=rsa-sha256; cv=none; b=Vt4rccuXoSjAdkGZQaBXhhrUAZn5ZiBS+C8HHOtEbCwK7P32sC55rzJyQbinju2Fis8O2I h1t5x8fy6EjNWhsHIFxVPUVnYGvY7hXrpf7CFYZXEHRfNkG2wp6SX60GBOmVCqdUvsg2Xc ngGHZOe55yviaDPY2jcxSS1bWGW8Br2hyRPa6qtnJklkYswMd5nopsV9mIAQXSxEITdouq Rm+l8kmks+7Eb6YDlKAueUZrylHBC38+/6z7MXkf+sqTyNykQhsLCWGyOITTryU5J10PMA g76In8ohO0Rmjw2+3EQ8sCaUS11hn5Clxrd2r2RhqgUOrNskQbaQpEnNwgUxkA== 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=1715615012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PrMry7XcyxH+NRcceOX3ckDdPcEQF7ET9fbJO7+ow/A=; b=mZrRxlkeojD/YdGpAm6sGXXQKV7wUU9yHGSeJ/E5ONuI3MjmC6muqqy5jdSV1vIu6GjxS7 3DSmraAYl2Sv3pz1fjtLT1DC8JeAwtskTKPsmzKRZwXVvObFw3xt6bHxLRp1kdl95/c6cT l8K0PAaB19Lu5rYG3LbbRK6Wpc0rFfhAbxwwY8HP4Zy0P9VSGNilimFcSMfkUjy54FYzGu C7T7fK+//hBN6rI+ElO9oPXMckv371mh2YKtsZECPHN79fIFJQXhkuHQ9olxqOripLcVM0 oyrxDNy1xTFWAYu9PQ6QDv/ZEMns1LvoBbA25KBou6sAMqGB7SBo7sqNGsr0qQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdP0N0nXfztyw; Mon, 13 May 2024 15:43: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 44DFhWiJ057140; Mon, 13 May 2024 15:43:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DFhWY0057137; Mon, 13 May 2024 15:43:32 GMT (envelope-from git) Date: Mon, 13 May 2024 15:43:32 GMT Message-Id: <202405131543.44DFhWY0057137@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: 75a94658d372 - stable/13 - libpfctl: fix incorrect pcounters array size List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 75a94658d3724e61f25ec3692d2665fce9ead195 Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=75a94658d3724e61f25ec3692d2665fce9ead195 commit 75a94658d3724e61f25ec3692d2665fce9ead195 Author: Kristof Provost AuthorDate: 2024-04-26 14:07:38 +0000 Commit: Kristof Provost CommitDate: 2024-05-13 15:41:05 +0000 libpfctl: fix incorrect pcounters array size The array is 2 x 2 x 2, not 2 x 2 x 3. Sponsored by: Rubicon Communications, LLC ("Netgate") MFC after: 2 weeks (cherry picked from commit a3f7176523e8611b259cefd7431c01e24f446db7) --- lib/libpfctl/libpfctl.c | 2 +- lib/libpfctl/libpfctl.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index be45746368de..f5ddbba79bfd 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -249,7 +249,7 @@ pfctl_get_status(int dev) _pfctl_get_status_counters(nvlist_get_nvlist(nvl, "scounters"), &status->scounters); - pf_nvuint_64_array(nvl, "pcounters", 2 * 2 * 3, + pf_nvuint_64_array(nvl, "pcounters", 2 * 2 * 2, (uint64_t *)status->pcounters, NULL); pf_nvuint_64_array(nvl, "bcounters", 2 * 2, (uint64_t *)status->bcounters, NULL); diff --git a/lib/libpfctl/libpfctl.h b/lib/libpfctl/libpfctl.h index 78d981c2d769..308be03fbd1a 100644 --- a/lib/libpfctl/libpfctl.h +++ b/lib/libpfctl/libpfctl.h @@ -60,7 +60,7 @@ struct pfctl_status { struct pfctl_status_counters lcounters; struct pfctl_status_counters fcounters; struct pfctl_status_counters scounters; - uint64_t pcounters[2][2][3]; + uint64_t pcounters[2][2][2]; uint64_t bcounters[2][2]; }; From nobody Mon May 13 15:43:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdP0N5tBZz5KVCJ; Mon, 13 May 2024 15:43: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 4VdP0N31fkz47Cy; Mon, 13 May 2024 15:43:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715615012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZbvRz9GWmYd6+jmkj9R8C0JQosnCbOOsuM5UdOBlJew=; b=NOrzyGgJfH3u+oVmGRTfBcMAUKztnAa++LP6B0c3OUFJZS8HrTN+v1fI6rh1bu/QZxtQgC b70zMOAsD3fMDKhRn/02kzwNUVXhhtYAs3ty4Mg9vMvWGf54d0CyjCVyrsLV3mx1aHD1Me qExLyf4LgoWaEZHC/vv8c6oJaIatXeIiq2DlQse+yeXBiUu91SHLki+mbEMDHidEilqgba xeF35ym+rf8mmi1796NGQ/6qi3E2KGjUFZ1YieDR04o0iwsK7MswLC7V1Pzn7NW25X2kMM gqChNMqw1rep/7eajKUku2IZyKB8wRWg7s6bceyRQQ6AkPK1/WG7CwwUx4Skng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715615012; a=rsa-sha256; cv=none; b=waFuU8+AILsDhDKnlh2q79zBBshm4ZYuhfWS2IcS1gyVIbrCR8NKzl6f/9+YrJeee9pXGa OsqXGifZHFOPBs/zS5AZXi+H3NQy5njcsOdGTajs6XDt1edg1GCZBEyIo58c+wXrEDV/ay 12lGOCmH7O2prEEapP2osVUYLV/4NTbDe1XEkX7yK621gSmupJVTd4xdm6/FgO0F5zG5PZ R975KEFR6ng0UgbX9CwDz+tHl7e4OPM+EV1gQDPmAz+sMmQl1CqEfOJsZng4sRelynrMVU P4L0eICGBvhLU1e0ozVzc/ZSxfHHnL4m2dklXl8y5DEiamZxQC7wYLoPiahfHA== 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=1715615012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZbvRz9GWmYd6+jmkj9R8C0JQosnCbOOsuM5UdOBlJew=; b=cOfaQpx6zP7TolY7ygzJoxxZbkWimoNEL/qJCw5GJLJxsxS3Kpgnnww4ImM7n3k3+4sWTh tM/muX5KMZiWEMIOB1SV1RKlkNfXQrbtN7ggSJ0p7bhyVQdkf4TDNsX36fLxjLOVTH++eb ZdUOuV1eEdv6jj07znGQ5LhiEgXxjzlEHxTnhFEgXZD1fI54BIDwgAeIWMwJIB4zLPrire SKDLnQutIF3zV74VvCKtk5+sSE2xCxJ2fEVRbaDhPfhZMyIg9SYiE5Jawudu12ujO0NuqE u2b7pgM52oCJm69vDrvETI3Tu0Dg33RfjHa5bpwDmN1FL7k2GEbW4/+tjVRtOA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdP0N2Q6czt2X; Mon, 13 May 2024 15:43: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 44DFhW6m057225; Mon, 13 May 2024 15:43:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DFhWKc057222; Mon, 13 May 2024 15:43:32 GMT (envelope-from git) Date: Mon, 13 May 2024 15:43:32 GMT Message-Id: <202405131543.44DFhWKc057222@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: 14c2c7913c90 - stable/14 - libpfctl: fix incorrect pcounters array size List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 14c2c7913c908e4c446cb809e1d7a620cedc16b6 Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=14c2c7913c908e4c446cb809e1d7a620cedc16b6 commit 14c2c7913c908e4c446cb809e1d7a620cedc16b6 Author: Kristof Provost AuthorDate: 2024-04-26 14:07:38 +0000 Commit: Kristof Provost CommitDate: 2024-05-13 15:28:02 +0000 libpfctl: fix incorrect pcounters array size The array is 2 x 2 x 2, not 2 x 2 x 3. Sponsored by: Rubicon Communications, LLC ("Netgate") MFC after: 2 weeks (cherry picked from commit a3f7176523e8611b259cefd7431c01e24f446db7) --- lib/libpfctl/libpfctl.c | 2 +- lib/libpfctl/libpfctl.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index f43fb78d9a0f..7dc375717acc 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -250,7 +250,7 @@ pfctl_get_status(int dev) _pfctl_get_status_counters(nvlist_get_nvlist(nvl, "scounters"), &status->scounters); - pf_nvuint_64_array(nvl, "pcounters", 2 * 2 * 3, + pf_nvuint_64_array(nvl, "pcounters", 2 * 2 * 2, (uint64_t *)status->pcounters, NULL); pf_nvuint_64_array(nvl, "bcounters", 2 * 2, (uint64_t *)status->bcounters, NULL); diff --git a/lib/libpfctl/libpfctl.h b/lib/libpfctl/libpfctl.h index edaffdd12118..a2991cc05b04 100644 --- a/lib/libpfctl/libpfctl.h +++ b/lib/libpfctl/libpfctl.h @@ -62,7 +62,7 @@ struct pfctl_status { struct pfctl_status_counters lcounters; struct pfctl_status_counters fcounters; struct pfctl_status_counters scounters; - uint64_t pcounters[2][2][3]; + uint64_t pcounters[2][2][2]; uint64_t bcounters[2][2]; }; From nobody Mon May 13 16:21:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdPrT5GG2z5KYv8; Mon, 13 May 2024 16:21: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 4VdPrT4lzrz4F33; Mon, 13 May 2024 16:21:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715617305; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CY7qu8ap5lTnvodJLzxQEQFVwaLtb1C02EIfBd7Q0Ec=; b=Acp5N0KZamO6tstGJAHmvZceBHw7DnB/tFyyPcaTq2i9Jyl5zegjQx0ZEUQkaF/G48Nbj9 rPtmvDdzAkmNURsjDyA/rq1HcqHkIEyOAPe5TEbd6z4lkAIRHSd1A3xmb2IrEpa3zhqJlH U9NFJ6UVO0So3ixaPCaBRAI3zo/aaAbv/IdobU0wtCX4ZJSie5Zjq9ZltEotvKKzY1rRcW 6+u6DqHskammXH59560B884O7TOT1gWNrfiiHlDfIpzwwxt6HXRTjG2137RR4p4LAGN+o7 FqLRMwPaVawEbaDxDaOyU8ptPWkvJS6weW2Uvx2CoaHf2ZbZZpSSEqfbnCv9aQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715617305; a=rsa-sha256; cv=none; b=w2Jvu7XvxiglGVFGSavGuj2kYl6aeWl7S3PflI7EdB+GAnxFtD02jEvV1DmXPPaCho27wi 7qVja4mVcDT8+8d8w+KdlqTtBjW1WLku8U5CL3FKI0CuLBXh8CNepQ326rtBYuagW82mKj 6aO0tTBmQz6amhWacqcMFNnigCqyxE08eX3PRLGHPHU034uZrHrXeHhFW7qWMzJIRFPlVp +Hc2j7RxI3MkmOpiRL2RsCvC3O55g3bGskg3rdWrO9Qlc56LN25+LkwtdHzhiXk2iPAUCY z/nLho9y7zPZUvtuwkB8iJID9J8gtTJ31kUuk6ZNadJKV0BR3B8r5IwPOIiDHA== 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=1715617305; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CY7qu8ap5lTnvodJLzxQEQFVwaLtb1C02EIfBd7Q0Ec=; b=J6OB9gS7E9TgfBarpv4L1OMr02ZAbTN0FJMqVhENKg6DJq6k/Qmx5/T2a2nrrIMd8nfhgT 09nVmaGdi/3DG35mZBcKq2x2OsKw6qZwnsXwAii+O2M701iTtWOrFUrnEf0eNynAGNCBve rbKVNQzTD0oEMtAlELtzWTzJGeR1485vfYrBm/LpSKPpQ9gHRnXwCUwuWZWdhlV/mIUnQ5 TGnwEteCelDHHHCiT7FkhR4QbRzi9AWGcm/f9ZyrEsOI9pWNoB9lcquujelZB1Afb/7fdK u+KMUTUj1l6MakndVcJfCzzOrd59/BeI/3DPFL869nCuPIyfMGVoyHuG5LsjvA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdPrT4MCNzvXF; Mon, 13 May 2024 16:21: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 44DGLjha025717; Mon, 13 May 2024 16:21:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DGLjvG025714; Mon, 13 May 2024 16:21:45 GMT (envelope-from git) Date: Mon, 13 May 2024 16:21:45 GMT Message-Id: <202405131621.44DGLjvG025714@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 8b0682644e2d - main - Fix the GCC build after _FORTIFY_SOURCE import List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8b0682644e2da9c595d9249c9a0c8eb499421b5e Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=8b0682644e2da9c595d9249c9a0c8eb499421b5e commit 8b0682644e2da9c595d9249c9a0c8eb499421b5e Author: Kyle Evans AuthorDate: 2024-05-13 16:13:51 +0000 Commit: Kyle Evans CommitDate: 2024-05-13 16:21:38 +0000 Fix the GCC build after _FORTIFY_SOURCE import We haven't exposed gets(3) in a long time, rip out __gets_chk before it's too late and something builds a gets(3) user with it enabled. --- include/ssp/stdio.h | 6 ---- lib/libc/secure/Makefile.inc | 2 +- lib/libc/secure/Symbol.map | 1 - lib/libc/secure/gets_chk.c | 74 -------------------------------------------- lib/libssp/Makefile | 2 +- lib/libssp/Symbol.map | 1 - lib/libssp/ssp.3 | 2 -- 7 files changed, 2 insertions(+), 86 deletions(-) diff --git a/include/ssp/stdio.h b/include/ssp/stdio.h index 72e3236eac80..ed7303497a45 100644 --- a/include/ssp/stdio.h +++ b/include/ssp/stdio.h @@ -48,7 +48,6 @@ int __snprintf_chk(char *__restrict, size_t, int, size_t, int __vsnprintf_chk(char *__restrict, size_t, int, size_t, const char *__restrict, __va_list) __printflike(5, 0); -char *__gets_chk(char *, size_t); char *__fgets_chk(char *, int, size_t, FILE *); __END_DECLS @@ -78,11 +77,6 @@ __END_DECLS fmt, ap); \ }) -#define gets(str) ({ \ - char *_ssp_str = (str); \ - __gets_chk(_ssp_str, __ssp_bos(_ssp_str)); \ -}) - #define fgets(str, len, fp) ({ \ char *_ssp_str = (str); \ __fgets_chk(_ssp_str, len, __ssp_bos(_ssp_str), fp); \ diff --git a/lib/libc/secure/Makefile.inc b/lib/libc/secure/Makefile.inc index 3b1ad879c715..28289127c7a6 100644 --- a/lib/libc/secure/Makefile.inc +++ b/lib/libc/secure/Makefile.inc @@ -4,7 +4,7 @@ .PATH: ${LIBC_SRCTOP}/secure # _FORTIFY_SOURCE -SRCS+= gets_chk.c fgets_chk.c memcpy_chk.c memmove_chk.c memset_chk.c \ +SRCS+= fgets_chk.c memcpy_chk.c memmove_chk.c memset_chk.c \ snprintf_chk.c sprintf_chk.c stpcpy_chk.c stpncpy_chk.c \ strcat_chk.c strcpy_chk.c strncat_chk.c strncpy_chk.c \ vsnprintf_chk.c vsprintf_chk.c diff --git a/lib/libc/secure/Symbol.map b/lib/libc/secure/Symbol.map index 7859fcee3821..0d854039955f 100644 --- a/lib/libc/secure/Symbol.map +++ b/lib/libc/secure/Symbol.map @@ -5,7 +5,6 @@ FBSD_1.0 { }; FBSD_1.8 { - __gets_chk; __fgets_chk; __memcpy_chk; __memmove_chk; diff --git a/lib/libc/secure/gets_chk.c b/lib/libc/secure/gets_chk.c deleted file mode 100644 index 18c1e2d18f43..000000000000 --- a/lib/libc/secure/gets_chk.c +++ /dev/null @@ -1,74 +0,0 @@ -/*- - * - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2006 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Christos Zoulas. - * - * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 -__RCSID("$NetBSD: gets_chk.c,v 1.7 2013/10/04 20:49:16 christos Exp $"); - -#include -#include -#include -#include - -#include -#include - -char *__gets_unsafe(char *); - -char * -__gets_chk(char * __restrict buf, size_t slen) -{ - char *abuf; - size_t len; - - if (slen >= (size_t)INT_MAX) - return (__gets_unsafe(buf)); - - if ((abuf = malloc(slen + 1)) == NULL) - return (__gets_unsafe(buf)); - - if (fgets(abuf, (int)(slen + 1), stdin) == NULL) { - free(abuf); - return (NULL); - } - - len = strlen(abuf); - if (len > 0 && abuf[len - 1] == '\n') - --len; - - if (len >= slen) - __chk_fail(); - - (void)memcpy(buf, abuf, len); - - buf[len] = '\0'; - free(abuf); - return (buf); -} diff --git a/lib/libssp/Makefile b/lib/libssp/Makefile index cc6b88342f9c..1a95c4b49844 100644 --- a/lib/libssp/Makefile +++ b/lib/libssp/Makefile @@ -4,7 +4,7 @@ SHLIBDIR?= /lib SHLIB= ssp SHLIB_MAJOR= 0 -SSP_SRCS= gets_chk.c fgets_chk.c memcpy_chk.c memmove_chk.c memset_chk.c \ +SSP_SRCS= fgets_chk.c memcpy_chk.c memmove_chk.c memset_chk.c \ snprintf_chk.c sprintf_chk.c stpcpy_chk.c stpncpy_chk.c \ strcat_chk.c strcpy_chk.c strncat_chk.c strncpy_chk.c \ vsnprintf_chk.c vsprintf_chk.c diff --git a/lib/libssp/Symbol.map b/lib/libssp/Symbol.map index 367922d58085..e401bf9293e2 100644 --- a/lib/libssp/Symbol.map +++ b/lib/libssp/Symbol.map @@ -20,7 +20,6 @@ LIBSSP_1.0 { }; LIBSSP_1.1 { - __gets_chk; __fgets_chk; __memmove_chk; __stpncpy_chk; diff --git a/lib/libssp/ssp.3 b/lib/libssp/ssp.3 index f89dcc549ba7..5b00fe53f9fc 100644 --- a/lib/libssp/ssp.3 +++ b/lib/libssp/ssp.3 @@ -49,8 +49,6 @@ .Ft int .Fn vsnprintf "char *str" "size_t len" "const char *fmt" "va_list ap" .Ft char * -.Fn gets "char *str" -.Ft char * .Fn fgets "char *str" "int len" "FILE *fp" .In ssp/string.h .Ft void * From nobody Mon May 13 16:43:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdQKC6D1lz5KbJr; Mon, 13 May 2024 16:43:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VdQKC5PCLz4GnB; Mon, 13 May 2024 16:43:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715618591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=scc74fQkOq7ELkXxuDpbEawl5yLhh2cBAvp1EXMQVjU=; b=OdEBNQcJmfU8+UEY9HyZ8C0CSTfdz71cQ2m+EB2PNDPfj0DbLf8nlxxcExvRx4EKa1+gar khgSeAw05QEf7WdqPBJ3iDGhhcuemotyQTwqMmv2DEbjfXDS4E9gIP09IJKnvbuc6RJIgZ ossNBBC7MtWgK6DXcPk0c+2u31Xjg/PuW9ZlrJ7VyGfFfEU6pEjv7IciWe2imngQe99ljH 414MeIp+RHNwoagtZnYFumPKqUbwL5umbi2JFWmgWQdlTpBrqce2cE1QioziUlkQDOX1j+ 4mxsNTIre7t5ty78l0c6K/MKrYoK94mjeKtfZw4f4mhaNi98+wqaROcyndt95A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715618591; a=rsa-sha256; cv=none; b=mMRL1Wk4+AXc64Q+IhNF1rHPV9zx1ZySjjG7s9gbBnkjdno0aJfRr9rapQLVRanbo751RF MtagQmh0oUNzYEEj7HlzSdHBNwT/VN2xkZWgv47rc2WjYwAU9mWw83k/JRfKOTLzQM/bNr x9ruI6EAEYOBor2X5LXo1oRjNi/kSH+ArgSSJu6c8sckrlDOmlImpeEhjPiLLyXNn5tQ8i 1OIs738wlHgzwZJiXy6zziKxEg+n39Qf7gAH+HguM4g4JdFVJEv1b/BC6QmKHjHt37y2/i 28cScXUI3p4NWxhVy4MdR4OiQmUdSVr1tpif2sZAPW+/R+uaNtOricl4O6XIZA== 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=1715618591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=scc74fQkOq7ELkXxuDpbEawl5yLhh2cBAvp1EXMQVjU=; b=IMgGgcdnCNIDM0VaQfjhqan3T7CAhX6fnvapWTfWUnk/EKeiNHy1Of1kVtBCwh2DHKXTwJ 90eHWrF8RDpXgrzArwSAmKoHaRUXUCVp7JbV6PMAiX0ijRCiFTxYHfLVeqhiXkeAu1yRwY BfcU/HUHy+a19K5hOwuRFd7j88c8059mBMg0Tq2qDjf9VUCj+Vcb//oy7XCx3xOrMWBNNF n7smVVrjHZ3PrHaLJbvZbvEzMFgyN/dF5z7VZuP8cUgvamDVwRV7huGEpZzO8J3T4xgNgv 2tvnuD2BVqueWIbmnlAhXPQ4CDC29buX6tJNnMw73C5KSdSpHDX3isIMH4KXRg== Received: from [10.9.4.95] (unknown [209.182.120.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: kevans/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4VdQKC2s1PzJVs; Mon, 13 May 2024 16:43:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: Date: Mon, 13 May 2024 11:43:09 -0500 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 8b0682644e2d - main - Fix the GCC build after _FORTIFY_SOURCE import Content-Language: en-US From: Kyle Evans To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202405131621.44DGLjvG025714@gitrepo.freebsd.org> In-Reply-To: <202405131621.44DGLjvG025714@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 5/13/24 11:21, Kyle Evans wrote: > The branch main has been updated by kevans: > > URL: https://cgit.FreeBSD.org/src/commit/?id=8b0682644e2da9c595d9249c9a0c8eb499421b5e > > commit 8b0682644e2da9c595d9249c9a0c8eb499421b5e > Author: Kyle Evans > AuthorDate: 2024-05-13 16:13:51 +0000 > Commit: Kyle Evans > CommitDate: 2024-05-13 16:21:38 +0000 > > Fix the GCC build after _FORTIFY_SOURCE import > > We haven't exposed gets(3) in a long time, rip out __gets_chk before > it's too late and something builds a gets(3) user with it enabled. > --- *sigh* Fixes: be04fec42638f ("Import _FORTIFY_SOURCE implementation [...]") Sponsored by: Stormshield Sponsored by: Klara, Inc. From nobody Mon May 13 17:28:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdRKy3C7bz5KfgB; Mon, 13 May 2024 17:28: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 4VdRKy2Nh2z4LvW; Mon, 13 May 2024 17:28:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715621334; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g4KcfDSRHyiOnkvLMjKXOR+bkDxCrSJRk2VROX7D7m0=; b=eCeCD+elDgivrzoPc9KuEd3EGpxRRbzjTx5E299yXSbJ2nBexw3dfQHGBwOY12Z/S353jk 8lnTfB+vNL6/0aVr/c8wUgBHloNlZ7sFV6o+Pn9tUKC9+fBnvk8npSl8QwW5yPAuWKreVv zWGpBnn4YJyPgY33yuzxTx8QOI1hVodXuD2wgfFWfR0NgmHnjNuvgpSltYUQQaYtOgg4LT GYLuNt/OEhc8nK9tTTkVKgPDsw/810PyPS3FrmmdDeLsqLvmgsLxOUCGqdeu8uLYS0hGte p/CoDyAKw7CfEuIegWjlybKK2RddCMrgzgakb2xh/IJVdbP/oMzRZaVORJ+8QA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715621334; a=rsa-sha256; cv=none; b=JxarRhufiBXKdcQ1zwL/5vYDJpmSO8aavSyY+muGZFBWNkup2W280AD4TZCQPNss3ujf13 PWJKKUgDo/veh4hcvC+Y9BQGsALh/GUkFj9IVrXgAbl2AoMRYWfME2UP2LzprUGZkibVbC eET5zGb26ivLce2hnSKfWp8nJ0tXSrXLM03QUZl58Q4VlhqlLLbbM5O0dMTHnlrbyoKzjs Zkc1mvaS9wV8aWacrdaK/GTCi6+PGDyZjDCPKUT0UpAV0N5ueUSILumzydjSGGqhpBYS+Q Tm0vcd55EgwpS4NMZBq7UmJZzR6W96nb8JsJENTFB/vwkpvXrD/MEDKiZyXwZg== 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=1715621334; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g4KcfDSRHyiOnkvLMjKXOR+bkDxCrSJRk2VROX7D7m0=; b=pg5+oqvBT8iiQzRNFMuXRTPr2UvxaMlTw5JXooLnsKhp0oRwU5gBI1u8DgCqsMWwUCfS5m EoEeBhWV7W9XCP8aiVeHayvxrVJ5oowjJPKeqGEmNYVyz49XxX1iqmEL57hoyXCKsQWiZ7 HdcsUKi11Yy0cq1BXU4r+tohjV+6KVqoF+7ioUattLzKzQwD84z1nw7K1DVY5APvO3uo8R W/Yt1ik2BpuNglcsRF+rzjcohV3868TKfUEXfcGsIE8N3qsK0XV7Icv6t6jEoUYlp9n2w4 jEg0qRJ8cyusXUBVxvghC2F3MSHzmH0heSVjNB/i/udobY+s4rXchsa3UTDilQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdRKy1ygxzxPb; Mon, 13 May 2024 17:28: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 44DHSsKx027450; Mon, 13 May 2024 17:28:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DHSs4C027447; Mon, 13 May 2024 17:28:54 GMT (envelope-from git) Date: Mon, 13 May 2024 17:28:54 GMT Message-Id: <202405131728.44DHSs4C027447@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mariusz Zaborski Subject: git: 663838451ec6 - main - syscalls: regen List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 663838451ec64ddea872b0916e56d599839093fb Auto-Submitted: auto-generated The branch main has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=663838451ec64ddea872b0916e56d599839093fb commit 663838451ec64ddea872b0916e56d599839093fb Author: Mariusz Zaborski AuthorDate: 2024-05-13 17:28:54 +0000 Commit: Mariusz Zaborski CommitDate: 2024-05-13 17:29:57 +0000 syscalls: regen Pointed out by: trasz --- sys/kern/init_sysent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/init_sysent.c b/sys/kern/init_sysent.c index 467ea391ef23..46459f4c4e37 100644 --- a/sys/kern/init_sysent.c +++ b/sys/kern/init_sysent.c @@ -126,7 +126,7 @@ struct sysent sysent[] = { { compat(AS(ogetkerninfo_args),getkerninfo), .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 63 = old getkerninfo */ { compat(0,getpagesize), .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 64 = old getpagesize */ { .sy_narg = AS(msync_args), .sy_call = (sy_call_t *)sys_msync, .sy_auevent = AUE_MSYNC, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 65 = msync */ - { .sy_narg = 0, .sy_call = (sy_call_t *)sys_vfork, .sy_auevent = AUE_VFORK, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 66 = vfork */ + { .sy_narg = 0, .sy_call = (sy_call_t *)sys_vfork, .sy_auevent = AUE_VFORK, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 66 = vfork */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 67 = obsolete vread */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 68 = obsolete vwrite */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 69 = obsolete sbrk */ From nobody Mon May 13 18:28:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdSfX0csPz5KkxV; Mon, 13 May 2024 18:28:20 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VdSfX06yhz4VhG; Mon, 13 May 2024 18:28:20 +0000 (UTC) (envelope-from brooks@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715624900; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=jNx0SwK0gVmcVpEGRSD7AcsrlUsoGv9IemuuVGNNOBE=; b=dFquI1Anv0YDEF6SbKUHKDm3KrxdvlNSZQtfRog9I4KmR79PE7PJDRB0rHkxIOqE+Cwwco GR6BxEZqyv17CX/BRJCkawH74acqiNc/8HHjPq38ai+QL75FYGXFf2obo8BDjwWObtLY6o ZP5EJNP8YrlZAAp9tIP3UFhUh9qrh4/YhY5PUjlg7GAQUd+zFCBVF7VkaUDHsGOK9DYBc4 GOMOcpkyt9FlBZLMs89H4fdLgCQq7mKp/exs4bFQ2WVEv++QgjReUWRZIGbsjUip3TZhOZ JloTIM1lHv+Tr87t60sdffqkdwQxI1Ix7K4bMg2io/cxAYdi4oetpy+LMxYapg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715624900; a=rsa-sha256; cv=none; b=Mhvi0HsfNw+l/awaV4u899eZIDSEvatEEtX+Pt1Slz4YfVGRed6Ghec0ngmf/Ctt6XPoJ/ 88GBEYNcyIHFTarb7LOUTYVtGa/EPQYziYvAg5H1lmdAyN0hRdIRd7zxllU9e6G+6hbxkP gTWxl/8uwaKCCwse2Vs9J3I1RimsQxOOexHrq4ODMgDIqS0OnVi/PQOjD+1rkpsFrj0I81 g1WRs9yPkTZ5yaPQ3vwfW0CSGe52pp/FgmG3aO2SIqky1/JUCWvrj7YJJJB15u5emBz5AO S0jJ8kDdHzt1svKxD48w23yJJ/86rWkrT5LcsaObdxAyY+tPW02HrmRPJhaSXQ== 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=1715624900; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=jNx0SwK0gVmcVpEGRSD7AcsrlUsoGv9IemuuVGNNOBE=; b=YPgmlSZliknmd+0DykYq+tlgXRXSWFpExLiRHOd1kysYLyd9/j+8Zim7q4jQWjmhzrMO+X 2KNMjawZQh7bu4qwqe/ph3DoORwi938C/TuLusPujRvDW7L99PQVPExFE+dDvEbOKFHyC3 c0Xc2zkJ+zujnFvSrdZmU6bZwvIUXxz5TxchHls0I4It//DhQZusx3Zwd89bFbHuqCoTRX FP3+utjkz8o6LDd1HLWSnbpY+aIwRKo4UdEcYo7gL5sABwlWQpRExZUOh9+xbSyD6lVguH nw6n4+HfcDgcgb7uFEHQSyrKJjMGR+ECO3Khk5jZTyuuRO99nG2g20xqE4QdkA== Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: brooks/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4VdSfW6Wm7zLLd; Mon, 13 May 2024 18:28:19 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 9757E3C019B; Mon, 13 May 2024 18:28:19 +0000 (UTC) Date: Mon, 13 May 2024 18:28:19 +0000 From: Brooks Davis To: Mariusz Zaborski Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 663838451ec6 - main - syscalls: regen Message-ID: References: <202405131728.44DHSs4C027447@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202405131728.44DHSs4C027447@gitrepo.freebsd.org> On Mon, May 13, 2024 at 05:28:54PM +0000, Mariusz Zaborski wrote: > The branch main has been updated by oshogbo: > > URL: https://cgit.FreeBSD.org/src/commit/?id=663838451ec64ddea872b0916e56d599839093fb > > commit 663838451ec64ddea872b0916e56d599839093fb > Author: Mariusz Zaborski > AuthorDate: 2024-05-13 17:28:54 +0000 > Commit: Mariusz Zaborski > CommitDate: 2024-05-13 17:29:57 +0000 > > syscalls: regen > > Pointed out by: trasz > --- > sys/kern/init_sysent.c | 2 +- This is missing: sys/compat/freebsd32/freebsd32_sysent.c You must run `make sysent` at the top level to ensure all files are updated. If you use cirrus-CI via github it will flag these issues. -- Brooks From nobody Mon May 13 18:34:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdSnX3T9Wz5KlWw; Mon, 13 May 2024 18:34:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VdSnX1r59z4Wt7; Mon, 13 May 2024 18:34:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715625264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gegQdMFKJWJa4n7tr4WqbGC3GWKBvVApTR0B0L8bbY8=; b=yY1aqIA7nTKIuoO3ZuKP8LL4WUc/fKSsfmW4pRhfnZqXRAmDO6+rz6zXXf5Cc8vy0lhjLL pfo6l5f0IGSWpt77KyvwQzS225BYUP7Xz6MgrGoxY+dciVaQMvtk8ollwXq4DiQ2Blwlnf Ekk/AWR8fm2pub0lk0T6rLPNYeOt9lFH4n68a+F+g/VVP3UrIrYjgCsS8b9CIwtrixwyCp tZ/1ciWuAvXpm0Uy61HJUmd8xym0ih1IDe5irgODLlSo/78+mGCuB+N3a4Hmv4fGEbGDvy bX4PlIv/KT8tvXK6iGjvqDaDTAzgoKxFflO7njJceTb7JtcHyLvE8g5tAbBeFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715625264; a=rsa-sha256; cv=none; b=GxlcCVVLfIMXCzkXBGemMXgAbnbDX2qQ9z3TrZSXU3nPqH4Q5XR6JVXDVGBxETClCGHkQ/ CEDDOOk8J6gTP2w1BQ4MQaJoR7Ye65Ndcwvj1595DVpo6H27KaAQUNazSR08DyW1i7uxHD jBkL74xna/ydazclhcJ5thVJXvu3iNEF6gj1il8+qez/VIoN6NN/OZy68OqNHuh4wwJrnm lCadYOmCEIOfQRC5ugmJjVMtR2cL3RUbRvJfNByNyqjnyJ5HHRYcBvyVBz7k1kRtFK8jJk Obs3Ds2yfbRXKUZZMd1/nBZ0XEW8UvCJAQYl103yMksKoLKDGmFM6MweOtadIg== 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=1715625264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gegQdMFKJWJa4n7tr4WqbGC3GWKBvVApTR0B0L8bbY8=; b=v6BS0mqWp0VYyEAVHFQ+F5C4GBKTyT5hA4JKVsKUcRqd0x4G/fhFixUv33xjW4PDiEgjwR YMnLQ7c0gAu9ckQGHPRMffzJ8kXfduSDqcFFoAewCmJrC+s3SufQEq1eU2lWXNjq4okXIW JQ2heP2L0I4VmShaypRwG31MBt5YA1ZXU1NI44iz9QC4JOcu1iRJesEOyYfgtgKovFFWZR JtMMkskK2hmhkuuiYOAYXDlTyPUlndeyear00/O23LtrQgTOPtghqxTVUqT7uwcGB0z1X6 jjQ/t30ZkwNi+j6D5bcu3uzYXY0B9Saa+a18dOj0LDV7yHbonrh9V2SjaLntOg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdSnX1Pb5z10Jn; Mon, 13 May 2024 18:34:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44DIYOrS049979; Mon, 13 May 2024 18:34:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DIYOlj049976; Mon, 13 May 2024 18:34:24 GMT (envelope-from git) Date: Mon, 13 May 2024 18:34:24 GMT Message-Id: <202405131834.44DIYOlj049976@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 58d7ac11e77d - main - tmpfs: recalculate OBJ_TMPFS_VREF on reinstantiating node' vnode List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 58d7ac11e77db28640b8e47f9f9c1fe81d15baf5 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=58d7ac11e77db28640b8e47f9f9c1fe81d15baf5 commit 58d7ac11e77db28640b8e47f9f9c1fe81d15baf5 Author: Konstantin Belousov AuthorDate: 2024-05-06 18:31:31 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-13 18:33:29 +0000 tmpfs: recalculate OBJ_TMPFS_VREF on reinstantiating node' vnode Reported and tested by: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D45119 --- sys/fs/tmpfs/tmpfs_subr.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index 9bdcc4575511..84ce323441c1 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -1094,15 +1094,19 @@ loop: KASSERT((object->flags & OBJ_TMPFS_VREF) == 0, ("%s: object %p with OBJ_TMPFS_VREF but without vnode", __func__, object)); - KASSERT(object->un_pager.swp.writemappings == 0, - ("%s: object %p has writemappings", - __func__, object)); VI_LOCK(vp); KASSERT(vp->v_object == NULL, ("Not NULL v_object in tmpfs")); vp->v_object = object; vn_irflag_set_locked(vp, (tm->tm_pgread ? VIRF_PGREAD : 0) | VIRF_TEXT_REF); VI_UNLOCK(vp); + VNASSERT((object->flags & OBJ_TMPFS_VREF) == 0, vp, + ("leaked OBJ_TMPFS_VREF")); + if (object->un_pager.swp.writemappings > 0) { + vrefact(vp); + vlazy(vp); + vm_object_set_flag(object, OBJ_TMPFS_VREF); + } VM_OBJECT_WUNLOCK(object); break; case VDIR: From nobody Mon May 13 18:34:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdSnY32rtz5KlX0; Mon, 13 May 2024 18:34: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 4VdSnY2c0Yz4WcB; Mon, 13 May 2024 18:34:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715625265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5wDMORjmeOyFsY3ur88J4icj1iSgBsyE/u7AD6K1nKE=; b=R7JCxhZhvUTP2f1XM5gNeOR5pRTr8uR+Y7z9/05ta+QuHI8ireUEqB/mk2ZSJdRN6Bd0iY VT3fxjfj+b8oDbKrIIs2ld9iemMoKjqB/dB/gIZnqZ/FoM4PcRy7bv8VeQ0BVvXbW76Go/ krfteUjE1SgbwkAVEqrh9taqZuSgM45I1VyKZtSujK3Vuzg0nsrfDETGrexfPt6MxgT6s6 ijoMwp2882WXD2317MZKKNBGLg9+Z9U0JjCyz9VKMzUEbMeUQ/K9j9ItPVJZcuIvU4uV1q +I++ygNCCATOCL7OYg8xYlOMn+ib69E0uwl96WrnTmNR/SdepefIA0YhEBmq/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715625265; a=rsa-sha256; cv=none; b=EkMA+pnpl8B34Iy/Py4h09VwjNyNPqg20YxejOE5klW2am8CCmOfekocmafWShs4C8/vXi phshy6YSaiK2HEtVPuw44pZJaXkvdSIizyWQkyVkz9dHESObJfaYUrabhnUO6w7vmFh1nH GHw7fHA/s0ZuvaeGr7AVxheleTt3VbYqHrEQ8XPXrenMZJyAX1+lfEvE6KrAgsh+PZWllz +ie3NcHSfJsp+CtD9Ia4bXnGRtjTounHlAuIrBUNWtER1OPxyhhxL8BCm3JxWUkTV6pVd5 uVp6ACKbTGvom/Le0J1lgr0qU0h9c/wQKFm2M+DX/BjiF8tmBmBVMgs83muIEw== 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=1715625265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5wDMORjmeOyFsY3ur88J4icj1iSgBsyE/u7AD6K1nKE=; b=UxH0ItXxK11ckdUWg7Atd9lTKgJRnQJ4I6PyIPtA9hqLjDN0jZb/jewGDd0JmTGdx7amf1 epyj8xdGvuOMvzzGxR5ptAoybAY0K4ZbzHKcv+TpWBC0VA2aPOyBB4zYMgdVdiFHj01RXI 4BH9K2E9fFYfzRu3XktXeN2H6Fno1/0zpFJVPkzFQdx80jsxERGpDoyOHmm/jdy9eHNYHm E5bpRBMwtM38uot+aqypY2dXJgQeZmhNxZeQrjpGh5ZYXtBcyq084+y6OJ/4gWCxWKzSbL Ca2Ax21scndBm13KeNUnmGGYQ6PigtfxVUYWNCJ3pmvA70MjzGKRhtNJec/lgw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdSnY2Cc8z10Cw; Mon, 13 May 2024 18:34: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 44DIYPwW050038; Mon, 13 May 2024 18:34:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DIYPCZ050035; Mon, 13 May 2024 18:34:25 GMT (envelope-from git) Date: Mon, 13 May 2024 18:34:25 GMT Message-Id: <202405131834.44DIYPCZ050035@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 6ada4e8a0ae9 - main - swap-like pagers: assert that writemapping decrease does not pass zero List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6ada4e8a0ae901f0012015c8d277d80aad7d8f37 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6ada4e8a0ae901f0012015c8d277d80aad7d8f37 commit 6ada4e8a0ae901f0012015c8d277d80aad7d8f37 Author: Konstantin Belousov AuthorDate: 2024-05-08 13:58:52 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-13 18:33:29 +0000 swap-like pagers: assert that writemapping decrease does not pass zero Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D45119 --- sys/fs/tmpfs/tmpfs_subr.c | 3 +++ sys/vm/swap_pager.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index 84ce323441c1..4ddf2b4ba5ff 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -183,6 +183,9 @@ tmpfs_pager_release_writecount(vm_object_t object, vm_offset_t start, KASSERT((object->flags & OBJ_ANON) == 0, ("%s: object %p with OBJ_ANON", __func__, object)); old = object->un_pager.swp.writemappings; + KASSERT(old >= (vm_ooffset_t)end - start, + ("tmpfs obj %p writecount %jx dec %jx", object, (uintmax_t)old, + (uintmax_t)((vm_ooffset_t)end - start))); object->un_pager.swp.writemappings -= (vm_ooffset_t)end - start; new = object->un_pager.swp.writemappings; tmpfs_pager_writecount_recalc(object, old, new); diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index ee236c7f3988..a07a38481490 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -3158,6 +3158,10 @@ swap_pager_release_writecount(vm_object_t object, vm_offset_t start, VM_OBJECT_WLOCK(object); KASSERT((object->flags & OBJ_ANON) == 0, ("Splittable object with writecount")); + KASSERT(object->un_pager.swp.writemappings >= (vm_ooffset_t)end - start, + ("swap obj %p writecount %jx dec %jx", object, + (uintmax_t)object->un_pager.swp.writemappings, + (uintmax_t)((vm_ooffset_t)end - start))); object->un_pager.swp.writemappings -= (vm_ooffset_t)end - start; VM_OBJECT_WUNLOCK(object); } From nobody Mon May 13 18:34:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdSnZ4ykhz5KlGf; Mon, 13 May 2024 18:34: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 4VdSnZ3cx2z4X00; Mon, 13 May 2024 18:34:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715625266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JMj+U5m9flTttEka21VGVbznynIkrrrOpzQsFzK6bFo=; b=U0K9u6yXKUxvHJR78X6ZPf5kQUrEeolyjWXzut+VNJsvq5qD34HXhTevx9UQZ82RTIklFH lzQKCEzxic1PGXKHSollA2d4YtNWv8F3c2Uq5NoHomiucyMlQ1njJTycPcr0soBn/dzkVa qT4pXKmXGHo13ydvGlq9p4Cu1KQmE2K+5a5clr08tqwRs47KfytIsxCS4IzR3GO+FsyVeV pZiFET12Sb3NOA7fc5+Ga/o78pS/9kyCJJbFER60yQyI89RR52vWflSHM0gNav0Xo1e7SU tySgWje6rTxAOTOh1WMwABsaJqYsfvYlnHyC0LqG1pbtvFPClVnK1q8GN3MMfw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715625266; a=rsa-sha256; cv=none; b=kDiWjYGvnO7H74WEJCYFMxuGXnKJ2DOMtGTrwFVAfLfSRcCqtr3F5SHBmYALxyGMwkF9BL xq7gp0F2nlMmzWYVHgNLfa9xsPAN2zZme66WrD9ONIRVPQ7tAEwr4lTGAP2IBTeDRNGKNF G9mwxj7H1IIYHmepsUNmpElrS7RkdGgFmyggN21xKLiGRrlEYxrB6wegIn0Xbv9S8LP75c HzDfl0kpmaVurk4NUUQbg5rNv+CuNaTnrLfhx3qVkTtodMGCP4u6JCNiguGWxeRDo8S7Ks GxxCLVAyVE9m7bAmofnDLtQH9W2KJK97oHlPY9o1rj/KNUcQyNV9stjTefqV1w== 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=1715625266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JMj+U5m9flTttEka21VGVbznynIkrrrOpzQsFzK6bFo=; b=ki3xm3B8CZSl5kXTg3N7sTHCVoEactLxvJvonXKPGpIyFbVsPEJicZdLm+tfVhUn2tlIPL 7dAGSDkMUtI5kAx2PXVEBxsXR/tfsbeRb0576FM+cf9P6raF47MJqu3gnTsXbxabnIcwTR W7Csz2Fux5No0cGmqg/P6o/1RFEOHhZ4nRrQQP0x+yboyke8/QbxiB7l8Su2Ciwsdhwhn9 BTF4x/QzwKfEQq3JtrpYmMe4YcSbsIira+8NlI8rtNQTAELizlx7dSPk2IVlDqdwiDwJia /CUGRDA024zUXZTFaAxi/pkB0lNCP7dbGaOCNGoh+HueXRIIOh0Y1+TIPH8h+A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdSnZ3Ck1z10Cx; Mon, 13 May 2024 18:34: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 44DIYQLm050088; Mon, 13 May 2024 18:34:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DIYQf8050085; Mon, 13 May 2024 18:34:26 GMT (envelope-from git) Date: Mon, 13 May 2024 18:34:26 GMT Message-Id: <202405131834.44DIYQf8050085@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 46811949797b - main - tmpfs_destroy_vobject(): clear v_object under the object lock List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 46811949797b7e44521cd56cfa61b6c8378c4600 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=46811949797b7e44521cd56cfa61b6c8378c4600 commit 46811949797b7e44521cd56cfa61b6c8378c4600 Author: Konstantin Belousov AuthorDate: 2024-05-12 01:26:32 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-13 18:33:59 +0000 tmpfs_destroy_vobject(): clear v_object under the object lock Which allows tmpfs_pager_writecount_recalc() to reliably detect reclaimed vnode and make its accesses to object->un_pager.swp.private (== vp) safe against reclaim. Note that vnode instantiation already assigns v_object under the object lock. Reviewed by: markj Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D45119 --- sys/fs/tmpfs/tmpfs_subr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index 4ddf2b4ba5ff..53781202b066 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -120,7 +120,7 @@ tmpfs_pager_writecount_recalc(vm_object_t object, vm_offset_t old, /* * Forced unmount? */ - if (vp == NULL) { + if (vp == NULL || vp->v_object == NULL) { KASSERT((object->flags & OBJ_TMPFS_VREF) == 0, ("object %p with OBJ_TMPFS_VREF but without vnode", object)); @@ -957,6 +957,8 @@ tmpfs_destroy_vobject(struct vnode *vp, vm_object_t obj) VM_OBJECT_WLOCK(obj); VI_LOCK(vp); + vp->v_object = NULL; + /* * May be going through forced unmount. */ From nobody Mon May 13 18:36:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdSqV4jS1z5KldC; Mon, 13 May 2024 18:36:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VdSqV3sGrz4XxR; Mon, 13 May 2024 18:36:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715625366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=griui2LmOoIoFNyxqTZ0ZcuxOeDkqf5UHRRBP5YFekg=; b=C0/8hDEyb4+YW7nbD8Zmgx2UaaH8rnQ9ahTKQdy5isUXixL6nPYEPiTxEJ1Znwse9vSlxX 5WB2Y+pzi6LU7HmDavASIwOPPjbHlYpjEYrALIz0cdIEr7yR/J59LGOK7JxC8YbfyNSsWP 60dzfOWjPrVBbBuuAcwwFFYgYzpubfu6VzUMLEdD5CDOH/DpfR59s1qTIw24lk3A+Q+nFA OMlNEgWXWOUQ0oQ1CjP2wtNo4Ihn2prMfcMqyiSzBBZI6zNNP9oQ51BgaCKSrY6y0LOzZr +XMZ+lQmqda7C/51DZRdcp8iwL3vQ+gP8GkkKASvSMHhsnn4C0eFZIQtadAv2A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715625366; a=rsa-sha256; cv=none; b=rqF39/MAghK65t4DQk8dARskBk2ez80DWCR4+IW5V/Jr7Y04lPJu85pWbT8ZtpWtA/bJne zqSgAnr0NQ3AxhZ7NsQhSWOgY2u8iJb03jaaQ7HozhozLOahCxldfRFwtVhZf8hpSM/ysA ZTqwFHRQrbBNFZk3QpmjzU3gjPODifpV/Lmo0x/O8LnwOuwUc7imzu9igNJNX0FRjOiFeF s+hJ22TSRYMeZauvf+2LrDxe9Mre/nA/C1muzIpQxF2MammoVtkPuWgDr2xnfCWSe+8BfA GGu6dYtvu1ws4153zCelkbJtuhiPV472e1GfZYvgEHq1XhI5XUFSvE2fipzoNQ== 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=1715625366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=griui2LmOoIoFNyxqTZ0ZcuxOeDkqf5UHRRBP5YFekg=; b=K351/VfayZEQP9sQ/o2l5rM6YG0XOo26vjoIpUd66dX6OaSZJUYnq4372zMXApRPN1UwRw j/PJf28Cbsq3sjFFlWkScc4M+EAkUXvcjmuRDbFYwBgehCwq5UmjOpQpIoKmHeGZp1pNla nz4wdt8Vnn2wi7FN1nqbADNz0rYfjw4y9pIqwQ/UwmvZOy5ijagnZU0HxLROmlDtn+ql4T YUPAHE3db2gjA6h2NftQkCIDJcKa0ijJ0iLnbsa8HEOTcLtwobY9Zvto5CV919kOUxIq1W 4iUHucrrFFk3P32OID9PzOQnTbCiVRCW9pYIJJV2wbqXbuBTU6EEOEZcFafDfA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdSqV3TBWz10Cy; Mon, 13 May 2024 18:36:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44DIa6X5050851; Mon, 13 May 2024 18:36:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DIa6rd050848; Mon, 13 May 2024 18:36:06 GMT (envelope-from git) Date: Mon, 13 May 2024 18:36:06 GMT Message-Id: <202405131836.44DIa6rd050848@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mariusz Zaborski Subject: git: e90259af59a1 - main - regen List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e90259af59a1363126062442d80ba48678926369 Auto-Submitted: auto-generated The branch main has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=e90259af59a1363126062442d80ba48678926369 commit e90259af59a1363126062442d80ba48678926369 Author: Mariusz Zaborski AuthorDate: 2024-05-13 18:36:15 +0000 Commit: Mariusz Zaborski CommitDate: 2024-05-13 18:37:20 +0000 regen Pointed out by: brooks --- sys/compat/freebsd32/freebsd32_sysent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/freebsd32/freebsd32_sysent.c b/sys/compat/freebsd32/freebsd32_sysent.c index 13d80c695169..dd3b1464caba 100644 --- a/sys/compat/freebsd32/freebsd32_sysent.c +++ b/sys/compat/freebsd32/freebsd32_sysent.c @@ -127,7 +127,7 @@ struct sysent freebsd32_sysent[] = { { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 63 = obsolete ogetkerninfo */ { compat(0,getpagesize), .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 64 = old getpagesize */ { .sy_narg = AS(msync_args), .sy_call = (sy_call_t *)sys_msync, .sy_auevent = AUE_MSYNC, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 65 = msync */ - { .sy_narg = 0, .sy_call = (sy_call_t *)sys_vfork, .sy_auevent = AUE_VFORK, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 66 = vfork */ + { .sy_narg = 0, .sy_call = (sy_call_t *)sys_vfork, .sy_auevent = AUE_VFORK, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 66 = vfork */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 67 = obsolete vread */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 68 = obsolete vwrite */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 69 = obsolete sbrk */ From nobody Mon May 13 19:04:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdTS41Lqxz5KnWj; Mon, 13 May 2024 19:04: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 4VdTS40m9Mz4cvP; Mon, 13 May 2024 19:04:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715627060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PaeMe9BnTs7AU3sS8yk/mgdLQ4RF4F9CFgKq1tFIYH0=; b=lYd4a5b74tvQev+BGr3ej+MLVbxoT5vF7rg4gRoI9vyAvpCZUaVICl2QzoLkCzk/3Zf2CV likywTODTWe1EtnzEOOvSnPLHQLbJi68HHnbN2fyW3G88Q+Oe2uD5Hp8ub7P6/g41yOogW eNk3Ah1Z/MkybOGqctPojQRB64crZLVwQVFz1gmECaqY+A3sKCE3AnGu0hiNcF1ZdX6dGA 3Y7E/mhyoj5I8A8Xq3OCI5YRTmBzGPk9wWxvHlUkR0UOE1IKHAzhCjlI+vbJrb5q2zwHSd H9hWZ1kv+BvZWZFWO4wN/r0h2E0qdo1C/D6nEjy+/v6AeYJta0A5gEx5a3dZXA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715627060; a=rsa-sha256; cv=none; b=eAWsPi3YcCkRMoG5zr4zCnYzRJxjZDe/mBZShEVL6v6UIfheKCjH5y8YUVQDdBWHTixru1 nyaB0fnUUfo/QWZxtErUQyj8OPKbmA4MNmdXjvHqhDCC3FeWMILUq68Gqc34ilZRYSeNsM GQxzlpuCJDAg7JXEb+Ixx2G3LWuYS16QGGwe9LfJPSu1SjOq45mQjpo/W1Af4agPFprSf6 IyLxk5JluERyQcehzM5lDlco8H+ec4UkTRpbZAqZ338OQ+/jhpOzJ63BmQwqS+Q13Y1b8L x9LJL/NSXqU4k//ovW4ifSVNhki4gFqYO847YE5TP9ihQZsShj0Uvxkb99VsXA== 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=1715627060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PaeMe9BnTs7AU3sS8yk/mgdLQ4RF4F9CFgKq1tFIYH0=; b=JPYETBbwN1OIt7MoiUk4FG5f1A+0LTxeXHSnD28NCtFYCPrZygvQowJqFHBU0EbUieHkfa Q9daZMH3w3Ofu7NcUfqcd19RrcBc8VbjDIWrnhdDPGnHdqWHHijbCLox/SpaWXpZ0rBc0D l+aQM1nghnekLZ4m93T8e0DvAJX+i9un6eXBlcbJ5Z06N+HFxx4r8bxdyj+Fw5VmQpZ//+ BfczUCUB7wMg73lCnVr5djKdDA2QO2OT+VxMuOLu8SlEV3ap48096F+b/p6k6s9HpYJmZ/ xIJXZIXoSNfW62BQaOpjWpQ0EfJcu5i5eh8KC+tT92r2AE0KdKqX8SdkoF2rNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdTS40DyYz10pF; Mon, 13 May 2024 19:04: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 44DJ4JAe001261; Mon, 13 May 2024 19:04:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DJ4Jre001258; Mon, 13 May 2024 19:04:19 GMT (envelope-from git) Date: Mon, 13 May 2024 19:04:19 GMT Message-Id: <202405131904.44DJ4Jre001258@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 01fc488381e9 - main - nvme: Use strlcpy instead of strncpy to ensure termination List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 01fc488381e97c0bf589a297caa0c4b8e6b3e1c4 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=01fc488381e97c0bf589a297caa0c4b8e6b3e1c4 commit 01fc488381e97c0bf589a297caa0c4b8e6b3e1c4 Author: John Baldwin AuthorDate: 2024-05-13 19:03:49 +0000 Commit: John Baldwin CommitDate: 2024-05-13 19:03:49 +0000 nvme: Use strlcpy instead of strncpy to ensure termination Reviewed by: dab, imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D45152 --- sys/dev/nvme/nvme_sim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/nvme/nvme_sim.c b/sys/dev/nvme/nvme_sim.c index f561756f99b7..2ba3df9ea6e8 100644 --- a/sys/dev/nvme/nvme_sim.c +++ b/sys/dev/nvme/nvme_sim.c @@ -203,7 +203,7 @@ nvme_sim_action(struct cam_sim *sim, union ccb *ccb) cpi->xport_specific.nvme.slot = pci_get_slot(dev); cpi->xport_specific.nvme.function = pci_get_function(dev); cpi->xport_specific.nvme.extra = 0; - strncpy(cpi->xport_specific.nvme.dev_name, device_get_nameunit(dev), + strlcpy(cpi->xport_specific.nvme.dev_name, device_get_nameunit(dev), sizeof(cpi->xport_specific.nvme.dev_name)); cpi->hba_vendor = pci_get_vendor(dev); cpi->hba_device = pci_get_device(dev); From nobody Mon May 13 19:04:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdTS538Rzz5Kn8N; Mon, 13 May 2024 19:04: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 4VdTS518LSz4cmk; Mon, 13 May 2024 19:04:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715627061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1IJn2po9PVz3XqSMJdsPvC/oq0ZvHRCSSRmmMXFd5SE=; b=AYvRvEhRq1WSG/jZOWn3p2TDwjD/45fPc45PhexINNnIOaLXA8DI0pxEnyjORWfGSX+81n p22ZyD4sNk6YP4dNQvb6mb2LVPynpnUmDJtXh6t/B3TmWus33tufnSqpfF4LQxdet6yW8+ SdiiXrbkUw4gMbEoaDtURTYZohb2PHaqJcaSCUGAkYZxw8OH61uf370OpPxFdyre6G5l3D MTG744IZ2QJ4AcSMZXoP0t5isyPw5Ly8W2X9hLxBHHpx1UjN+UvgWaZGpKe081L182stbj wmXw5zRcuf5o/KfyZYtqksIaNKPffLw1ziU53++0wMEM+0FapzonFKyo79YeBg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715627061; a=rsa-sha256; cv=none; b=W6aPP/97YJZcL/Rhuc2YeVSlfMlL6KXWDzRrbYcjAVqWVYbbSdEhAhsKUP103UKAaQRjV/ 9vm8Gp4cHIKKHdS/axMbKrh/0lxVIuoVVxXLFWKWh/If2egFeA7nQViNEYYuFdRn0Cu1KY rDDjf1+IePEK/pOEdqFvQmbli5Y8ZijLfVKYWqSkPgzTRBPC+rl220IbyTr5p9alTI7ps8 F5cePRevuruWJTE2uhA5ZGyQjCxFvLtKDfLFEgcMm6UDHm6whg71VE9YvdCB/qav3YxYoF ZQREhxcS+4GzQD0tGRRz4w/8Is6HTIahnnO6p9Yr8F0BdeSr4kVfJOwhCnJJAg== 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=1715627061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1IJn2po9PVz3XqSMJdsPvC/oq0ZvHRCSSRmmMXFd5SE=; b=gyL6crXudt1rpyKQRVjVL+esOvh6/9KHaGEUcX0ygEYJlVLunV+bvIiBF1kbBqnq6B9KGm sIWdEifHO6+XfCl4vWZ836OjHWBrDMDSF8lXCkkk0BlbJ/i4h9stkUOhga+foGt3iXf7iz 35xBcCw7uRG7sGsIwDVmFXekLeaFZbqi6aTYPlzsMYVuBZnEDWbXDVTKiaJ6a0siwqn9dm a6syxZ0DrIN7t4DQqkUuKfBrc13odw11YIDrkOBf/LenATGP4mXNnsSk4hSNcqezzYQM4Z xT6xncCFWCjpFxhBATNQ/Epwtk+T1tjMJbVIhioU0SNSno6d7TYhrSqnlz0cvQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdTS50mfsz10Hm; Mon, 13 May 2024 19:04: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 44DJ4LR3001318; Mon, 13 May 2024 19:04:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DJ4Le0001315; Mon, 13 May 2024 19:04:21 GMT (envelope-from git) Date: Mon, 13 May 2024 19:04:21 GMT Message-Id: <202405131904.44DJ4Le0001315@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: da4230af3fda - main - nvme/f: Use strlcpy instead of strncpy + manual string termination List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: da4230af3fda2d4d1898124689f2e07b1450876d Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=da4230af3fda2d4d1898124689f2e07b1450876d commit da4230af3fda2d4d1898124689f2e07b1450876d Author: John Baldwin AuthorDate: 2024-05-13 19:04:03 +0000 Commit: John Baldwin CommitDate: 2024-05-13 19:04:03 +0000 nvme/f: Use strlcpy instead of strncpy + manual string termination Reviewed by: dab, imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D45153 --- sys/dev/nvme/nvme_ctrlr.c | 3 +-- sys/dev/nvme/nvme_ns.c | 3 +-- sys/dev/nvmf/host/nvmf.c | 3 +-- sys/dev/nvmf/host/nvmf_ns.c | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index b7b03082c54e..00e619bfdc46 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -1334,9 +1334,8 @@ nvme_ctrlr_ioctl(struct cdev *cdev, u_long cmd, caddr_t arg, int flag, case NVME_GET_NSID: { struct nvme_get_nsid *gnsid = (struct nvme_get_nsid *)arg; - strncpy(gnsid->cdev, device_get_nameunit(ctrlr->dev), + strlcpy(gnsid->cdev, device_get_nameunit(ctrlr->dev), sizeof(gnsid->cdev)); - gnsid->cdev[sizeof(gnsid->cdev) - 1] = '\0'; gnsid->nsid = 0; break; } diff --git a/sys/dev/nvme/nvme_ns.c b/sys/dev/nvme/nvme_ns.c index 360b9f982c20..e494b8cd857a 100644 --- a/sys/dev/nvme/nvme_ns.c +++ b/sys/dev/nvme/nvme_ns.c @@ -82,9 +82,8 @@ nvme_ns_ioctl(struct cdev *cdev, u_long cmd, caddr_t arg, int flag, case NVME_GET_NSID: { struct nvme_get_nsid *gnsid = (struct nvme_get_nsid *)arg; - strncpy(gnsid->cdev, device_get_nameunit(ctrlr->dev), + strlcpy(gnsid->cdev, device_get_nameunit(ctrlr->dev), sizeof(gnsid->cdev)); - gnsid->cdev[sizeof(gnsid->cdev) - 1] = '\0'; gnsid->nsid = ns->id; break; } diff --git a/sys/dev/nvmf/host/nvmf.c b/sys/dev/nvmf/host/nvmf.c index 0902bc78a7b5..e43d438aaa8c 100644 --- a/sys/dev/nvmf/host/nvmf.c +++ b/sys/dev/nvmf/host/nvmf.c @@ -872,9 +872,8 @@ nvmf_ioctl(struct cdev *cdev, u_long cmd, caddr_t arg, int flag, return (nvmf_passthrough_cmd(sc, pt, true)); case NVME_GET_NSID: gnsid = (struct nvme_get_nsid *)arg; - strncpy(gnsid->cdev, device_get_nameunit(sc->dev), + strlcpy(gnsid->cdev, device_get_nameunit(sc->dev), sizeof(gnsid->cdev)); - gnsid->cdev[sizeof(gnsid->cdev) - 1] = '\0'; gnsid->nsid = 0; return (0); case NVME_GET_MAX_XFER_SIZE: diff --git a/sys/dev/nvmf/host/nvmf_ns.c b/sys/dev/nvmf/host/nvmf_ns.c index 3ce434bf7c50..3428cbadc974 100644 --- a/sys/dev/nvmf/host/nvmf_ns.c +++ b/sys/dev/nvmf/host/nvmf_ns.c @@ -258,9 +258,8 @@ nvmf_ns_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, return (nvmf_passthrough_cmd(ns->sc, pt, false)); case NVME_GET_NSID: gnsid = (struct nvme_get_nsid *)arg; - strncpy(gnsid->cdev, device_get_nameunit(ns->sc->dev), + strlcpy(gnsid->cdev, device_get_nameunit(ns->sc->dev), sizeof(gnsid->cdev)); - gnsid->cdev[sizeof(gnsid->cdev) - 1] = '\0'; gnsid->nsid = ns->id; return (0); case DIOCGMEDIASIZE: From nobody Mon May 13 20:17:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdW4N6zXcz5KtMM; Mon, 13 May 2024 20:17:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VdW4N5nNwz4kYy; Mon, 13 May 2024 20:17:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715631444; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+y+SIjAU8JaD+63UFRJ82MNuaZL1VYZCjb/YDKTAwTQ=; b=o5QDp1CEoaBZ5g4FvMmMtqNktSwTm8YBBQQz7bNWanh+IaRgsI7HDSYrYWzPiPnsB6KSKC dBfRlAwmYPfjFWoS5lhgKwRkMhhSNgXAq/cvzgtkpj++RSdVMHuISqt9pbzXif1gvXYXHS xzJU3TVNliEE+vpseVA3J1LR8BqnKWnmFBpTqo0GBZ0bHZAlomfqlGeDc6dclJaFQm/4XI Nw0NvbD8lnUIWDEcEteFoqimd60fapX9AxM4W0w+Q6s1doxXRi4XJwQrmaHEvlTkDBSOOX WSMxc8P3jRpxqyHScEka2YQpsN1kTbydkv8nSFcqPb1uuvGONo4KdvmCBmYKoA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715631444; a=rsa-sha256; cv=none; b=cx5LzF725XnIgjpxqo0wrDg6N3uZ2rbSc1kmVcVII+PvaJq/ydSN8smec36NNQhUwwuJpj wqMOj1c4rNT149ukeFn1UegIu751hd/rUfIbIeZ0+xHFUtDlKerc7ooBvcK+4TJrPvHkHM xSuwAmQ7X5zuVcudsKxwn96etlVdTdhmwGa1NIr8OVGRgk6v9aCDua0x3SSYRM/pIYxqDF 2YZ2enm97xqNNRg4tLOB+4409N9Hh526QokAeZgYZH5BvdRYeoYQ31hIIrLAadLeIa+hvQ m/drB4wMMDNd4rC/HYcS+9+EPa+Oe2rWt+icIc0DR5Gicv5LQFqrSL3kIdeAtQ== 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=1715631444; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+y+SIjAU8JaD+63UFRJ82MNuaZL1VYZCjb/YDKTAwTQ=; b=JjBN9szuCgbc2uxN7qj/qncU7OA/CEpn2r4ksqZRMr2UQIFscqyTyIM3ucwPey6oFHn8Iw k4t8hpmzA2ZlmMakLjJAAxLsCDUJyZdavxMNr2qp7tmjp/RBmqSsYURjRPk+OtljfJRBiI TaR82FbKXhZZ5xni6TfS2inY7jplDpGBAd6r8bjpMl83aKYERgL7YSc7KNMbfuNsQIpYmt nS9Hr2c1MTSYXOYD2ha9vBy7VX2JqRoM9VS7hMAjVG6gK1ZDE2vMmP/sD6GdV/8ooTY2hF IURdqv23HiMaLmFb4vn4T/8qF6sGyYJhE00/0VZhWkjUuKBdU/K8CitjnEwGaA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdW4N5GZrz12bG; Mon, 13 May 2024 20:17:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44DKHOJj019804; Mon, 13 May 2024 20:17:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DKHOk8019801; Mon, 13 May 2024 20:17:24 GMT (envelope-from git) Date: Mon, 13 May 2024 20:17:24 GMT Message-Id: <202405132017.44DKHOk8019801@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: 8f0bd08e9869 - stable/14 - lld: work around elftoolchain bug which causes bloated RISCV binaries List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 8f0bd08e9869ac1e6ad1f0f9c3964a76457cbce1 Auto-Submitted: auto-generated The branch stable/14 has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=8f0bd08e9869ac1e6ad1f0f9c3964a76457cbce1 commit 8f0bd08e9869ac1e6ad1f0f9c3964a76457cbce1 Author: Dimitry Andric AuthorDate: 2024-02-14 19:41:09 +0000 Commit: Mike Karels CommitDate: 2024-05-13 20:09:29 +0000 lld: work around elftoolchain bug which causes bloated RISCV binaries The elftoolchain strip(1) command appears to have trouble with the new .riscv.attributes sections being added by lld 17 to RISCV binaries. This causes huge 'holes' in the files, making them larger than necessary. Since nothing in the base system uses the new section yet, patch lld to leave it out for now. Direct commit to stable/13, since this intended to go into the 13.3 release, while the elftoolchain bug is being investigated. Cherry-pick to stable/14 from stable/13 for the 14.1 release; the bug has not been fixed yet. Hopefully it will be fixed (or the code replaced) in time for 14.2. When that happens, this can be reverted. Reported by: karels Submitted by: jrtc27 (cherry picked from commit 42ceb92e6a544fa0956eb660b3c16e38189acf20) --- contrib/llvm-project/lld/ELF/Writer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/llvm-project/lld/ELF/Writer.cpp b/contrib/llvm-project/lld/ELF/Writer.cpp index 8a08b0fcc90d..0c1bd27bb1fe 100644 --- a/contrib/llvm-project/lld/ELF/Writer.cpp +++ b/contrib/llvm-project/lld/ELF/Writer.cpp @@ -2148,9 +2148,13 @@ template void Writer::finalizeSections() { addPhdrForSection(part, SHT_MIPS_OPTIONS, PT_MIPS_OPTIONS, PF_R); addPhdrForSection(part, SHT_MIPS_ABIFLAGS, PT_MIPS_ABIFLAGS, PF_R); } +#if 0 + // XXX: This stops elftoolchain strip adjusting .riscv.attributes, + // leaving large holes in binaries. if (config->emachine == EM_RISCV) addPhdrForSection(part, SHT_RISCV_ATTRIBUTES, PT_RISCV_ATTRIBUTES, PF_R); +#endif } Out::programHeaders->size = sizeof(Elf_Phdr) * mainPart->phdrs.size(); From nobody Mon May 13 20:58:31 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdWzq2PtJz5KxT5; Mon, 13 May 2024 20:58:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VdWzq1sxYz4nRP; Mon, 13 May 2024 20:58:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715633911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=liPmscFLYDM2pVj8//UwM4+OYuKVVEqWinHj6/FPfFc=; b=SAWuf34qPT++A1CUEV7S+WLm6V74VnAToCL9R5CdMEzoYairNMHt+2tYRHgd6hCZh/FuUU emzm+06bnHEJ6I4aK13HrryogGleS7IsAcWc6CoTmmMTEivPTAJcK2zhQTRrFSsQX8OXig qQnhkg+nAmEZXxs4MrIlIsX1ysQQh53Gyv+QwNx4u//7vd10BpXH/0K1sv/GzPQC/gf+78 dTcWEbnz758XNG0DqfcE9ZQDXH25t7bh+VDcRFdZXK7AQNpe5bmna3L3uSG38/iziYRfC3 Ls8S+swlOy2yDOOBZPH+Pz+UGN7NqBZn4ztezsLbhUSSWvw5PPNLzOEX1Oo5ww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715633911; a=rsa-sha256; cv=none; b=QPqT0BAs4P9R3+KmZp+NMvR8CcmcBn7D72gTu7wv0hYmvlxUYFv0Qrw8iLXTnh1VQywjGG TlVIHaMpTXYw9ofF0sptkdQjgu3UJkhQKk442QqlK2lSFW2f2ut//mXCzIjYPHngQku771 KB08J6CSjB49CmXqGNa67e/4LJDVkp+5CAxFRR5QCCmVyA0Yp61QMQcm7yEIUOzH33qgaB sLYyy7VYh23wQujNJ6glSol2VOpVSrQp6gYeff4b+zqYkxILgTQz7Ts8dwmrXmJNnxoi2G LGr1W5Zp7Mb0jNK0QRECL1ONaeT3U+ivW0LRrltl+rd/7UxY6ftgtJgDoKTt4w== 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=1715633911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=liPmscFLYDM2pVj8//UwM4+OYuKVVEqWinHj6/FPfFc=; b=I0kGMD0dBDcLzWZsrK3RyeDf0z3adVQvxpoATymBJGPGj6E9LU/T6oCYEnUW0Mskz3nHWz 7kNSSFD5fy5VWskA/fmzXnlmq+l0CdX0xHkcBzRolkLpUQ+nXzeZuwipTQlvAAsjtPlS7p INOCV64okLl7RnNODwIII22wuSrNu4HG5oI2MdPPhJxwT4wySDgPcWf7Cr/5CjbkIgMlfo Ga7/SetBjuZmpVhqNrzAS8X7XvM1oOlMCYQkPfB+MV51JCpR9gBuJiqI9TrMHRad+BFbKl 95+NDObl8tSNCfLJaysdVenDaS8HzPTbEJyWQBoCO3sNVv11A9huW4C9JACGdg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdWzq1BPKz13NL; Mon, 13 May 2024 20:58: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 44DKwVoO087109; Mon, 13 May 2024 20:58:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DKwVZg087106; Mon, 13 May 2024 20:58:31 GMT (envelope-from git) Date: Mon, 13 May 2024 20:58:31 GMT Message-Id: <202405132058.44DKwVZg087106@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: 975e833ff730 - releng/14.1 - lld: work around elftoolchain bug which causes bloated RISCV binaries List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 975e833ff73005bd3b786de57e037b3bbd15fbab Auto-Submitted: auto-generated The branch releng/14.1 has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=975e833ff73005bd3b786de57e037b3bbd15fbab commit 975e833ff73005bd3b786de57e037b3bbd15fbab Author: Dimitry Andric AuthorDate: 2024-02-14 19:41:09 +0000 Commit: Mike Karels CommitDate: 2024-05-13 20:58:20 +0000 lld: work around elftoolchain bug which causes bloated RISCV binaries The elftoolchain strip(1) command appears to have trouble with the new .riscv.attributes sections being added by lld 17 to RISCV binaries. This causes huge 'holes' in the files, making them larger than necessary. Since nothing in the base system uses the new section yet, patch lld to leave it out for now. Direct commit to stable/13, since this intended to go into the 13.3 release, while the elftoolchain bug is being investigated. Cherry-pick to stable/14 from stable/13 for the 14.1 release; the bug has not been fixed yet. Hopefully it will be fixed (or the code replaced) in time for 14.2. When that happens, this can be reverted. Reported by: karels Submitted by: jrtc27 Approved by: re (cperciva) (cherry picked from commit 42ceb92e6a544fa0956eb660b3c16e38189acf20) (cherry picked from commit 8f0bd08e9869ac1e6ad1f0f9c3964a76457cbce1) --- contrib/llvm-project/lld/ELF/Writer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/llvm-project/lld/ELF/Writer.cpp b/contrib/llvm-project/lld/ELF/Writer.cpp index 8a08b0fcc90d..0c1bd27bb1fe 100644 --- a/contrib/llvm-project/lld/ELF/Writer.cpp +++ b/contrib/llvm-project/lld/ELF/Writer.cpp @@ -2148,9 +2148,13 @@ template void Writer::finalizeSections() { addPhdrForSection(part, SHT_MIPS_OPTIONS, PT_MIPS_OPTIONS, PF_R); addPhdrForSection(part, SHT_MIPS_ABIFLAGS, PT_MIPS_ABIFLAGS, PF_R); } +#if 0 + // XXX: This stops elftoolchain strip adjusting .riscv.attributes, + // leaving large holes in binaries. if (config->emachine == EM_RISCV) addPhdrForSection(part, SHT_RISCV_ATTRIBUTES, PT_RISCV_ATTRIBUTES, PF_R); +#endif } Out::programHeaders->size = sizeof(Elf_Phdr) * mainPart->phdrs.size(); From nobody Mon May 13 22:24:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdYvL12m6z5L41Q; Mon, 13 May 2024 22:24: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 4VdYvK75kMz3yHN; Mon, 13 May 2024 22:24:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715639086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AkGWpBp9Oj4bLqstnEdLf12hJ2wXO1eUanMkfQIMWG0=; b=i1VVDDICHwgF/8UQYb9EvBhX4GJ2T2TcsqgmHkISyEG9uylYD5ZNuMQf0/KYZiH+/wxgyY Awby7+BxHL7rk8Hi7gOQx/CbXSj1We5Hu3/8NZ09kO+m+ju/U7W5VeLNV9n4EV7bIAZPl/ Mc8g6cALDnuqAeJNh04BVn3a2Mevy2aUAfMI+29HNy/umtO+dIT+hPcSLttrPpHN3Qjeyq hfIJ0GQsVgu1/JLmmBrfDfTWG2jJ/0BFbuee8AunPuVSugz35WynLvbl02aOCbSX7yp+Lz IZH97HT3Rgv3MWbq2z9dDbRK/oem3GT43lHzYO2PUpp9JsOxJyn7m6fWg5BV9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715639086; a=rsa-sha256; cv=none; b=ektqXHXbfHkB52hrSvOYG7jhAz3Tae7wSklpNcwJT88MLJ2EA99fLPnaIoDarttsR16Dxu jcVf3ogplC15/ttHsnIPO/eY691TSeGNP6ldxIh09FrylW7jsMx+IXjQvcb9hIo3Ack1mh hT4sm0rA6K09fG/+amAFXkVBQzXV12fqQdhde/QbzyMRxrrBaCfqSEBEqd2OddlC38dqdR MTdKLmKe4j5HnlfXg52p0lYZLVIBRqjAB/64FQpqk74GKfsOlBzgbkTqtacPAIT3JxLoZa WU1jXE1S7P6BsWlGgwQC0zar0+MoZZbjjbQK+7IF300/whhx4L5ONXMldDGr9g== 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=1715639086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AkGWpBp9Oj4bLqstnEdLf12hJ2wXO1eUanMkfQIMWG0=; b=Bfd5x1RSCixDn2KCrtFZ3DqKL/1GZg32gAro8TggikR8uiZE4RfvTov3p/h3ngGyahk5nN dGWHX73OdXZs8CLJX7mMlLDgW5ysu025ItQOovWvSWJZv0TP8mrcEG3hAgUC1w36ObjQ3N tuKTTfr6sWAdRwLc8JTPjGT8uoLvCV0ugx2mSky/706y+uq0NouVw0Nz4rdswfurQJaub8 /v4mq6ldhZkJOkPDkZoS0vsBXY369F7b2r7nYx/+gNe14ycibWEUxYlZobO8TvGx4OiNXZ WHH49u8H9SyExnn2VlIfqbR5XLsFpaMlRGASwKZrw0Hx0/EtBK16d3/hjCfrKQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdYvK6ZgVz15bQ; Mon, 13 May 2024 22:24: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 44DMOj3Y041090; Mon, 13 May 2024 22:24:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DMOjo1041087; Mon, 13 May 2024 22:24:45 GMT (envelope-from git) Date: Mon, 13 May 2024 22:24:45 GMT Message-Id: <202405132224.44DMOjo1041087@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: 166432191c5a - stable/14 - release: Use qemu when cross-building vm images List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 166432191c5a46f60155a6cb14ce4c918c82be4d Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=166432191c5a46f60155a6cb14ce4c918c82be4d commit 166432191c5a46f60155a6cb14ce4c918c82be4d Author: Colin Percival AuthorDate: 2024-05-05 05:31:19 +0000 Commit: Colin Percival CommitDate: 2024-05-13 22:24:28 +0000 release: Use qemu when cross-building vm images For a bit over 5 years, we have used qemu when cross-building cloudware images; in particular, it's necessary when installing packages which might include post-install scripts. Use qemu in the vm-images target too; while "generic" vm images don't install packages, they still run newaliases and /etc/rc.d/ldconfig, both of which fail without appropriate emulation. MFC after: 1 week (cherry picked from commit 9287d1853c00267a0118401530debf9c0554ff28) --- release/Makefile.vm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/release/Makefile.vm b/release/Makefile.vm index 0eb549ec7bc2..6fd165528854 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -157,12 +157,13 @@ CLEANFILES+= ${VMBASE}.${FS}.${FORMAT} vm-base: vm-image -vm-image: +vm-image: ${QEMUTGT} .if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) . for FORMAT in ${VMFORMATS} . for FS in ${VMFSLIST} mkdir -p ${.OBJDIR}/${.TARGET}-${FORMAT}-${FS} env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} SWAPSIZE=${SWAPSIZE} \ + QEMUSTATIC=${QEMUSTATIC} \ ${.CURDIR}/scripts/mk-vmimage.sh \ -C ${.CURDIR}/tools/vmimage.subr \ -d ${.OBJDIR}/${.TARGET}-${FORMAT}-${FS} -F ${FS} \ From nobody Mon May 13 22:24:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdYvM2VsQz5L431; Mon, 13 May 2024 22:24: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 4VdYvM0gG4z3y5g; Mon, 13 May 2024 22:24:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715639087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JA1JAzbZhSDfQueLBkzazw3DxoDEZ3sb7QiOmavSguU=; b=INPIVjC4ijabYJoob9Vl45IAfRJZy7bK/Wj6XNk5eqsexkCczT5xrdhjkYHeKiuLHlk/2z DWYz4i6GepbB+d4XqvSAOZ3vJJhKavRbWrRraGdSiM4ZxTDlzb/zSiZw50Wwug26GQqP6g hAe8FPFrO+5ORz8qMvIAHofY/CbBbb97CxelX87PPTv/kLOXeukeg5KtvlPdEokZLNAN3C MMzDqlT8mkyHAD2PTOo8fXPuN28EOU62KFgiJ1n4//5JELFgyjA4ulf4NzHjhMughDPyAz GwdGLuMaaPIXZ/XUxorcmFUPKxoIHoaq5OU8WdV123kIGsLHyMoCJCoHWk6nZw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715639087; a=rsa-sha256; cv=none; b=h2z9erOJVu9M/XqtOEC6LXT+t4Tj7mWdUi7OietIYqx7zfHrd7Dyuwtn+c839efdjr3UHU DLq+axx9UcOH9Bf1Z556Y8Aj4IiOlaRcpR/7JIsopOEiJPNN37sasYOyAhpzD7lsreiXbT GU+rJi7YISepO20FXArt3CYcfA1OQrmqS9dB9YoRgnhuF68GjxIh3IkmJr4GTXHn5tvao/ /JokFULGQ6d0B6zGiLG/LxA3MEHFkHtOuAJ9W2ivNqd5V0P8fU3Sos677PPVQHMmoblHk+ ZvsMZsjwePa7zKA0F8DzFq5mPRwVp8K+wMW9wRVM40J62yPNQzGrd4mMnF9xrQ== 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=1715639087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JA1JAzbZhSDfQueLBkzazw3DxoDEZ3sb7QiOmavSguU=; b=pWZtPanPdxMd3IZknFdsubjM8IwSJhM6YE0MG/v6LOxw1+LEWu8fRE5RQx0K6JP2jD96Dd v29D2yZHz8ZB3iCjgrtqH2oLUKdRnQKMa+BQb4LHoibPnmHgSsKU3wQWhwabsyKKe3HamX MchOXzXrVIW/JJ9NkI4OJcz0sHQ5tnGdSFlJ0Ix3R8Uy8AKbB1AcMgai3NbEpvCh/IrbAO wIRa+w5A5rke5qNcFJ+b/Ss0HV2q6LpRBujP/uMQbuc6qPaTq+GQHoUgDCfEHmaxSEAfW/ t+aF2pQIraNBB68OO2e1SE5csY9J9YxgZH6gvrTScb9g3B31epxZ2GNb8Aoi4w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdYvM0Fh8z15hK; Mon, 13 May 2024 22:24: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 44DMOkY8041132; Mon, 13 May 2024 22:24:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DMOkhE041129; Mon, 13 May 2024 22:24:46 GMT (envelope-from git) Date: Mon, 13 May 2024 22:24:46 GMT Message-Id: <202405132224.44DMOkhE041129@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: c5342be39c1a - stable/14 - release: Rework vm_extra_pre_umount List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c5342be39c1ab37ca41e74aabdd7f507a6c6e036 Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=c5342be39c1ab37ca41e74aabdd7f507a6c6e036 commit c5342be39c1ab37ca41e74aabdd7f507a6c6e036 Author: Colin Percival AuthorDate: 2024-05-06 20:26:52 +0000 Commit: Colin Percival CommitDate: 2024-05-13 22:24:28 +0000 release: Rework vm_extra_pre_umount The vm_extra_pre_umount function in vmimage.subr served two purposes: It removed /etc/resolv.conf and /qemu (if cross-building), and it provided a function for cloudware to override in order to make cloud specific changes to the filesystem before constructing a disk image. This resulted in a number of bugs: 1. When cross-building, the emulator binary was left as /qemu in the Azure, GCE, Openstack and Vagrant images. 2. The build host's resolv.conf was left as /etc/resolv.conf in the basic-ci and basic-cloudinit images. 3. When building GCE images, a Google-specific resolv.conf file was constructed, and then deleted before the disk image was created. Move the bits needed for running code inside a VM staging directory from vm_install_base into a new vm_emulation_setup routine, and move the corresponding cleanup bits from vm_extra_pre_umount to a new vm_emulation_cleanup routine. Remove the /qemu and /etc/resolv.conf cleanups from the cloudware configuration files (where they exist) since we will now be running vm_emulation_cleanup to remove those even when vm_extra_pre_umount has been overridden. Override vm_emulation_cleanup in gce.conf since in that one case (and *only* that one case) we don't want to clean up resolv.conf (since it was constructed for the VM image rather than copied from the host). releng/14.1 candidate. MFC after: 1 week Sponsored by: https://www.patreon.com/cperciva (cherry picked from commit 0b1c5628c74a37e2aa2aa3769c606d3e826302f8) --- release/scripts/mk-vmimage.sh | 3 ++- release/tools/azure.conf | 2 -- release/tools/ec2.conf | 5 ----- release/tools/gce.conf | 10 +++++++++- release/tools/oci.conf | 5 ----- release/tools/openstack.conf | 2 -- release/tools/vagrant-virtualbox.conf | 1 - release/tools/vagrant-vmware.conf | 1 - release/tools/vmimage.subr | 23 +++++++++++------------ 9 files changed, 22 insertions(+), 30 deletions(-) diff --git a/release/scripts/mk-vmimage.sh b/release/scripts/mk-vmimage.sh index ca6a359affbd..dfd91f43140d 100755 --- a/release/scripts/mk-vmimage.sh +++ b/release/scripts/mk-vmimage.sh @@ -97,13 +97,14 @@ main() { vm_create_base vm_install_base + vm_emulation_setup vm_extra_install_base vm_extra_install_packages vm_extra_install_ports vm_extra_enable_services vm_extra_pre_umount vm_extra_pkg_rmcache - cleanup + vm_emulation_cleanup vm_copy_base vm_create_disk || return 0 vm_extra_create_disk diff --git a/release/tools/azure.conf b/release/tools/azure.conf index b6526f21e474..9da2b19de694 100644 --- a/release/tools/azure.conf +++ b/release/tools/azure.conf @@ -53,7 +53,5 @@ EOF touch ${DESTDIR}/firstboot - rm -f ${DESTDIR}/etc/resolv.conf - return 0 } diff --git a/release/tools/ec2.conf b/release/tools/ec2.conf index a233bf5981c1..ce09ab0d2367 100644 --- a/release/tools/ec2.conf +++ b/release/tools/ec2.conf @@ -102,10 +102,5 @@ EOF # The first time the AMI boots, run "first boot" scripts. touch ${DESTDIR}/firstboot - if ! [ -z "${QEMUSTATIC}" ]; then - rm -f ${DESTDIR}/${EMULATOR} - fi - rm -f ${DESTDIR}/etc/resolv.conf - return 0 } diff --git a/release/tools/gce.conf b/release/tools/gce.conf index aad4a74d2e39..5ad83bcded53 100644 --- a/release/tools/gce.conf +++ b/release/tools/gce.conf @@ -118,7 +118,15 @@ EOF touch ${DESTDIR}/firstboot - rm -f ${DESTDIR}/etc/resolv.conf + return 0 +} +# Do everything except deleting resolv.conf since we construct our own +# Googlized resolv.conf file in vm_extra_install_base. +vm_emulation_cleanup() { + if ! [ -z "${QEMUSTATIC}" ]; then + rm -f ${DESTDIR}/${EMULATOR} + fi + umount_loop ${DESTDIR}/dev return 0 } diff --git a/release/tools/oci.conf b/release/tools/oci.conf index c57a7683a500..a4fe54ad3031 100644 --- a/release/tools/oci.conf +++ b/release/tools/oci.conf @@ -90,10 +90,5 @@ EOF touch ${DESTDIR}/firstboot - if ! [ -z "${QEMUSTATIC}" ]; then - rm -f ${DESTDIR}/${EMULATOR} - fi - rm -f ${DESTDIR}/etc/resolv.conf - return 0 } diff --git a/release/tools/openstack.conf b/release/tools/openstack.conf index 4c905fbae4ba..05d2d13bbb39 100644 --- a/release/tools/openstack.conf +++ b/release/tools/openstack.conf @@ -35,8 +35,6 @@ vm_extra_pre_umount() { echo 'ALL ALL=(ALL) NOPASSWD:ALL' >> \ ${DESTDIR}/usr/local/etc/sudoers.d/cloud-init - rm -f ${DESTDIR}/etc/resolv.conf - # The console is not interactive, so we might as well boot quickly. echo 'autoboot_delay="-1"' >> ${DESTDIR}/boot/loader.conf echo 'beastie_disable="YES"' >> ${DESTDIR}/boot/loader.conf diff --git a/release/tools/vagrant-virtualbox.conf b/release/tools/vagrant-virtualbox.conf index 4dd7ca8953ad..9e0e430bbc88 100644 --- a/release/tools/vagrant-virtualbox.conf +++ b/release/tools/vagrant-virtualbox.conf @@ -14,5 +14,4 @@ vm_extra_pre_umount () { # Setup the Vagrant common items vagrant_common - rm -f ${DESTDIR}/etc/resolv.conf } diff --git a/release/tools/vagrant-vmware.conf b/release/tools/vagrant-vmware.conf index 52ff7f1aac1a..fff929829222 100644 --- a/release/tools/vagrant-vmware.conf +++ b/release/tools/vagrant-vmware.conf @@ -18,5 +18,4 @@ vm_extra_pre_umount () { # Setup the Vagrant common items vagrant_common - rm -f ${DESTDIR}/etc/resolv.conf } diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index eda22e061c6d..72540dad14a8 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -83,8 +83,14 @@ vm_install_base() { echo "zfs_enable=\"YES\"" >> ${DESTDIR}/etc/rc.conf echo "zpool_reguid=\"zroot\"" >> ${DESTDIR}/etc/rc.conf echo "zpool_upgrade=\"zroot\"" >> ${DESTDIR}/etc/rc.conf + echo "kern.geom.label.disk_ident.enable=0" >> ${DESTDIR}/boot/loader.conf + echo "zfs_load=YES" >> ${DESTDIR}/boot/loader.conf fi + return 0 +} + +vm_emulation_setup() { if ! [ -z "${QEMUSTATIC}" ]; then export EMULATOR=/qemu cp ${QEMUSTATIC} ${DESTDIR}/${EMULATOR} @@ -94,15 +100,8 @@ vm_install_base() { mount -t devfs devfs ${DESTDIR}/dev chroot ${DESTDIR} ${EMULATOR} /usr/bin/newaliases chroot ${DESTDIR} ${EMULATOR} /bin/sh /etc/rc.d/ldconfig forcestart - umount_loop ${DESTDIR}/dev - cp /etc/resolv.conf ${DESTDIR}/etc/resolv.conf - if [ "${VMFS}" = zfs ]; then - echo "kern.geom.label.disk_ident.enable=0" >> ${DESTDIR}/boot/loader.conf - echo "zfs_load=YES" >> ${DESTDIR}/boot/loader.conf - fi - return 0 } @@ -136,15 +135,12 @@ vm_extra_install_packages() { if [ -z "${VM_EXTRA_PACKAGES}" ]; then return 0 fi - mkdir -p ${DESTDIR}/dev - mount -t devfs devfs ${DESTDIR}/dev chroot ${DESTDIR} ${EMULATOR} env ASSUME_ALWAYS_YES=yes \ /usr/sbin/pkg bootstrap -y for p in ${VM_EXTRA_PACKAGES}; do chroot ${DESTDIR} ${EMULATOR} env ASSUME_ALWAYS_YES=yes \ /usr/sbin/pkg install -y ${p} done - umount_loop ${DESTDIR}/dev return 0 } @@ -159,13 +155,16 @@ vm_extra_install_ports() { vm_extra_pre_umount() { # Prototype. When overridden, performs additional tasks within the # virtual machine environment prior to unmounting the filesystem. - # Note: When overriding this function, removing resolv.conf in the - # disk image must be included. + return 0 +} + +vm_emulation_cleanup() { if ! [ -z "${QEMUSTATIC}" ]; then rm -f ${DESTDIR}/${EMULATOR} fi rm -f ${DESTDIR}/etc/resolv.conf + umount_loop ${DESTDIR}/dev return 0 } From nobody Mon May 13 22:24:48 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdYvN2Ycyz5L4HC; Mon, 13 May 2024 22: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 4VdYvN1FYPz3xy5; Mon, 13 May 2024 22: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=1715639088; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MafzNct8wA/w+NxqjHAn5Sf1FP9S7R+f6LPjGmPUqf8=; b=qO7pdI+BJBSZ59sBY75mcj8KstjgYA+1bY9m8v9/XTXwR3UH+7qG9ZD6UPj3WrbcF7s93F FcrRT1lSKS4RmekAXYRDrJghfo1r5o8qqnE5PpFsBvyEX1Y1wbhFWY4neg0jzuA0ru40jj VSB0LIZhvHRchoiKUeey4r9n+1e2fo/lEgNGPtEaNSsEZ7AQnahK2BUY/AOXxb3bCKJfsI YubujsPp4iUIkK651uTiFOIOODFckCot94HaUJNdOYF7IxSR4l4GrYiZrvSoOgNScf06Ev IDgcd+7FIQbk/eFq/Q9RRR7ONoUL5g8es+u15Be5Fg2x4GL+Om4fnnmdxpFx0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715639088; a=rsa-sha256; cv=none; b=HvXekaggTK47C6fVSPqKyPt8mZVBX8BVeEq2h8pujlvZImVzUaHbM+FRJR/gF1fLGLAgqt XL4CGJ9iLCeJ0jXI8XW4FIrOUlEANRYNMjVNfd2jB6+Gy6rEs6syibzX0u+0Cc4XxsQbIz mQAvhfjyNNrM8JxrpF4w7MODxWNdjrTS6L8Z/QTwMJsTJpBscZUiMNVbnKXnL8G+Rsh5vX oAlLTDxlTT0Dz/rzootC4/CIa32Yg8qAd03y+Xoo2G0MHAhpvaOP/TUSp++yZZ2zCXrIAS ct7tC5vKM1FBo4835c4rVkvzWs34VTCPATR8TSFjet650cvAh2rIRcRYYNiauw== 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=1715639088; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MafzNct8wA/w+NxqjHAn5Sf1FP9S7R+f6LPjGmPUqf8=; b=JTLiFEJWe+I9G5zNaOfXE5PlSCE4MOcyjnPqEH2dcXaHf28yvit75QVFaO8ClDuDhZ1jw3 5ch+93zmxNwax8BKwjd3R5JhoEOuAw7VEprtnbcWj7bmpX44NYjsdFZwqoj3IKxOUppKYY 6cpDx42CKSHfaG674rNENqxxDdZ6IN+KBQtN/LH/YqycEaRL5NcKPjFhnu/z1VLa/ffUiD I6RLXrU9NXNLV/YPeSHhE45wD4DRZ7Ra7VDxyqCXkgENFzILS/fl1sajnSpJlErrQ8CLaS zaqJv1uYgdrtPZA7LrX4uX80Mwkr3zTEKQBWVtkQUkxl7JUuIUYorHgB3jbuHg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdYvN0pJlz15sg; Mon, 13 May 2024 22: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 44DMOmL8041178; Mon, 13 May 2024 22: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 44DMOmp8041175; Mon, 13 May 2024 22:24:48 GMT (envelope-from git) Date: Mon, 13 May 2024 22:24:48 GMT Message-Id: <202405132224.44DMOmp8041175@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: e306ad1c194d - stable/14 - release: make dependencies, not recursive make List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e306ad1c194d464708b4b12277d577d931e6eae9 Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=e306ad1c194d464708b4b12277d577d931e6eae9 commit e306ad1c194d464708b4b12277d577d931e6eae9 Author: Colin Percival AuthorDate: 2024-05-09 07:52:25 +0000 Commit: Colin Percival CommitDate: 2024-05-13 22:24:28 +0000 release: make dependencies, not recursive make For historical reasons, the vm-release and cloudware-release targets were written as recursive makes of ${VMTARGETS} and ${CLOUDTARGETS}; this worked fine until we started running `make release -jN` and had both VM and cloud targets depending on ${QEMUTGT}, at which point things exploded when we tried to build the port twice at the same time. Switch vm-release and cloudware-release to have make dependencies on their individual components; this way a single make process runs and is aware of the duplicate dependency (and only runs it once). MFC after: 5 days (cherry picked from commit ce7756fdca1f0a89a74bc406cd3d3ac1d1be1ffb) --- release/Makefile.vm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/release/Makefile.vm b/release/Makefile.vm index 6fd165528854..95d48490c353 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -223,14 +223,16 @@ vm-install: ${DESTDIR}/vmimages/CHECKSUM.SHA256 .endif -vm-release: .if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) - ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${VMTARGETS} +vm-release: ${VMTARGETS} +.else +vm-release: .endif -cloudware-release: .if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE) - ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${CLOUDTARGETS} +cloudware-release: ${CLOUDTARGETS} +.else +cloudware-release: .endif .include "${.CURDIR}/Makefile.azure" From nobody Mon May 13 22:24:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdYvP54h7z5L4Kv; Mon, 13 May 2024 22:24: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 4VdYvP2kRfz3yfd; Mon, 13 May 2024 22:24:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715639089; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FoUPuQQ0OdhqLJpjSIHnUwZmz78TUmrw/0+nHHqTkMg=; b=ps4svP84NW4zgRVmCaX3qZIt9TC7+qZH1OPbzMWG92V2EdvT+81wZJkKR+ZK7NB7iYmEIN 3TcJt6qQAfjJqLu0K4IptbgOwhd14nd3qXzgKc0SWGmwc6r+V737RoP59RgKq0BB6iRtVX VdODuBASQNtiHfjbn5Dha17tb3EFN3u8Zv0IbTntMtKv+zC85+NXjD5qzK4OonszNlN4yu +RukAaWPyNf++XRNzjnw1AkpbkXpV+RR1p82bFtBM45ahiMKXNxF99URzl8B4QI6hZ2dto twJCHnWn3AbdUT4Juh2L7U4ZSH4kgWws3tT5dq86ezvFKhiw3MwOjWwCBsFAyg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715639089; a=rsa-sha256; cv=none; b=HUujLSVRAX73AVAW/13YEharXaxWxAMAW5doop+9k+15bEqCyfg+UJgpE4YpZdKMGRSEVi xK0aF8NPP4dJ7zyB7b47b89aIFvrXS8WO6EN5AfKxYcLJAQvxRs3tkNjDv70kpec8m6Zf5 4IqNBEnpWUOR74nbjR57nKxfOyxmeZKJnHgNBz7y76EYM9JGmzj/Hj2OodHiAodH2fG9Zw H5urayhXfbVHRhn1bwOIubbkadZ0GWpKvcYnQUfKrFaoe1TWnyTHaHwzNvWqWvny64WOG3 2KmpQK0XsCGi2X8KCn4Z0gLlWBxoBU0GZlbS2ibC8cGTf/+DyW1nQpiPED+zzA== 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=1715639089; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FoUPuQQ0OdhqLJpjSIHnUwZmz78TUmrw/0+nHHqTkMg=; b=uXhjLh3cAIBEdfLV3dHbzOzSazmjgBOMPhcorzCNqdJ11I0BuNwWL6udRl6MPsqn4gUgFt ODPWZxhme+iEagaN/s7v8F2rpZ0BKNPkkCz8iBDUiKacyMdp0z+I8Mbzolgr2ViuoRL1Ab D4lVioKpuLo7LcIXhkWunXaAMnG6Ocm9DhmWFacAtYRFllBNDR+eSnriAPF1AoLniLiM70 AMHlxTZNLubxec+rFDEJxtvJX7vHsLzPhttn8pU9uDl2OLPOsA4bWg/4f9n68MQ+orgiqS oRqv24YWTWhwz95Zyb+hH7DsGgR4W0IYt70Bcx/JPw5ek1sQlvpdKZuRmHeyHA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdYvP287mz15bR; Mon, 13 May 2024 22:24: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 44DMOnbR041229; Mon, 13 May 2024 22:24:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DMOnVt041226; Mon, 13 May 2024 22:24:49 GMT (envelope-from git) Date: Mon, 13 May 2024 22:24:49 GMT Message-Id: <202405132224.44DMOnVt041226@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: c58d78f4fa99 - stable/14 - New sysctl to disable NOMATCH until devmatch runs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c58d78f4fa9919d63a2d7dfd29772152727bfa43 Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=c58d78f4fa9919d63a2d7dfd29772152727bfa43 commit c58d78f4fa9919d63a2d7dfd29772152727bfa43 Author: Isaac Cilia Attard AuthorDate: 2024-04-29 20:44:27 +0000 Commit: Colin Percival CommitDate: 2024-05-13 22:24:29 +0000 New sysctl to disable NOMATCH until devmatch runs Introduce hw.bus.devctl_nomatch_enabled and use it to suppress NOMATCH until devmatch runs There's a lot of NOMATCH events generated at boot. We also run devmatch once during early boot to load unmatched devices. To avoid redundant work, don't start generating NOMATCH events until after devmatch runs. Set hw.bus.devctl_nomatch_enabled=1 just before we run devmatch. The kernel will suppress NOMATCH events until this is set to true. This saves about 170ms from the boot on aarch64 running atop Apple M-series processors and the VMWare Fusion hypervisor. Reviewed by: imp, cperciva MFC after: 3 days Sponsored by: Google Summer of Code Pull Request: https://github.com/freebsd/freebsd-src/pull/1213 (cherry picked from commit 6437872c1d665c2605f54e8ff040b0ba41edad07) --- libexec/rc/rc.d/devmatch | 1 + sys/kern/kern_devctl.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libexec/rc/rc.d/devmatch b/libexec/rc/rc.d/devmatch index 78050cfa4541..67bb14761614 100755 --- a/libexec/rc/rc.d/devmatch +++ b/libexec/rc/rc.d/devmatch @@ -46,6 +46,7 @@ devmatch_start() if [ -n "$one_nomatch" ]; then list=$(devmatch -p "${one_nomatch}" | sort -u) else + sysctl hw.bus.devctl_nomatch_enabled=1 list=$(devmatch | sort -u) fi diff --git a/sys/kern/kern_devctl.c b/sys/kern/kern_devctl.c index 12d4f9ebfc4d..0dd05a49c9ad 100644 --- a/sys/kern/kern_devctl.c +++ b/sys/kern/kern_devctl.c @@ -89,6 +89,9 @@ static int sysctl_devctl_queue(SYSCTL_HANDLER_ARGS); static int devctl_queue_length = DEVCTL_DEFAULT_QUEUE_LEN; SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_queue, CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, NULL, 0, sysctl_devctl_queue, "I", "devctl queue length"); +static bool nomatch_enabled = false; +SYSCTL_BOOL(_hw_bus, OID_AUTO, devctl_nomatch_enabled, CTLFLAG_RWTUN, + &nomatch_enabled, 0, "enable nomatch events"); static void devctl_attach_handler(void *arg __unused, device_t dev); static void devctl_detach_handler(void *arg __unused, device_t dev, @@ -208,7 +211,8 @@ devctl_detach_handler(void *arg __unused, device_t dev, enum evhdev_detach state static void devctl_nomatch_handler(void *arg __unused, device_t dev) { - devaddq("?", "", dev); + if (nomatch_enabled) + devaddq("?", "", dev); } static int From nobody Mon May 13 22:38:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdZC83yxJz5L57D; Mon, 13 May 2024 22:38: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 4VdZC83SZWz41Wn; Mon, 13 May 2024 22:38:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715639908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LTqKrajkm2ZSe1SIJUAjmfjKHx9XoKEuA7P0t9AYji4=; b=OvE1Hi1XwGsCbJB2XleuAUV84AT7mFXVIBOUBy3hgSVy9jtpsAwwW85EPaDhkXmB37UrkI rRPEMuYlQWVpI3KgGbpTn5JAkwB8l1oir4O585lw0klr866CNC18r2GGsUzESvnckAR9EO Cpw05GmGEft2GwKEV60fmItdR+xxqCCJ0zLDjQWqGYRIv4eXgrJDmDSH/2RCvJDn3vuZbZ ce36X5gGFNMnpnEhKcHAgQFHe4DG1grjTpi4/3hXFmjQyxlwNgbev/weYGNEyR/E0I0QIV wZnFZQowJoKkug+0iBoYcKJSm1fcV3ELaquzcqoTlwTSbUei6qa+qNu368Xh+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715639908; a=rsa-sha256; cv=none; b=ykUX2rV8yJh9nHmkcbHkPEhDI5UrlL4MlzLxsYx0Ent3noj9Vthh2kpGWNbSez+nILydf6 pPTLdk8h00RwKbz2s/9IsxkfgeqZTxXI2I7ag5ZeeQS9AjyWosgIHMPaHaZF/pfnZw7gfZ mx9kPavuI+o3boDoGrZ/NYCOASdvh8BDBMKJUhbzk0x2IrmIm50jfIFA7D8mst7Ags0zsP z2KetgwmWyN3DWNJfZxrjc4KuM3KOll8h3oZXudkBDcytX1gZm3lxX488HmR/w/SsVOd6f eZkNz5UMNO3j9gn72exNx1NWJ365LnpOIFnUgrIMSh2ylNwR3In95cuge6WTVQ== 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=1715639908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LTqKrajkm2ZSe1SIJUAjmfjKHx9XoKEuA7P0t9AYji4=; b=U5Bm3ozH9ktrPfStOCYiXItNy9Pn1k/7J4Gp5y/VAUFjwcDFa7ynWYgScdqiin0/CKuu2N zOgC4/YHibdwcocwJMfqJA4sJAw5XB0SzgizCX6d/LwciczL3HqfnYZp9Y7Fp072XIEeAq sdhmtfHTJmcTLkVdhxd4jUJ9p3eXT69YQhJX9dBCt9gAp/sGtbDoBNggGvq+zaRUMbJVGt vMqsa3zVV+TsLVwMiyaKerQ/rvwmszC6R31abb/S+U2x/YLg1ZvgxXojCKxqV9QChhASVd /OO2/eX2SlqNg8Z6HL85X2PPvG54O3d2ykuLxYpwB+LPvr6rhaWvqavaW2BetA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdZC833z0z160V; Mon, 13 May 2024 22:38: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 44DMcSk2058185; Mon, 13 May 2024 22:38:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DMcS5X058182; Mon, 13 May 2024 22:38:28 GMT (envelope-from git) Date: Mon, 13 May 2024 22:38:28 GMT Message-Id: <202405132238.44DMcS5X058182@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 5a178b831a9f - main - nvme: Add locking asserts List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5a178b831a9fe8c51e406355f0164d01627cf1f4 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5a178b831a9fe8c51e406355f0164d01627cf1f4 commit 5a178b831a9fe8c51e406355f0164d01627cf1f4 Author: Warner Losh AuthorDate: 2024-05-13 20:53:48 +0000 Commit: Warner Losh CommitDate: 2024-05-13 22:14:03 +0000 nvme: Add locking asserts nvme_qpair_complete_tracker and nvme_qpair_manual_complete_tracker have to be called without the qpair lock, so assert its unowned. Sponsored by: Netflix --- sys/dev/nvme/nvme_qpair.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index 62d27e439180..b11bdc44dc40 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -414,10 +414,12 @@ static void nvme_qpair_complete_tracker(struct nvme_tracker *tr, struct nvme_completion *cpl, error_print_t print_on_error) { - struct nvme_qpair * qpair = tr->qpair; + struct nvme_qpair *qpair = tr->qpair; struct nvme_request *req; bool retry, error, retriable; + mtx_assert(&qpair->lock, MA_NOTOWNED); + req = tr->req; error = nvme_completion_is_error(cpl); retriable = nvme_completion_is_retry(cpl); @@ -486,10 +488,11 @@ nvme_qpair_manual_complete_tracker( error_print_t print_on_error) { struct nvme_completion cpl; + struct nvme_qpair * qpair = tr->qpair; - memset(&cpl, 0, sizeof(cpl)); + mtx_assert(&qpair->lock, MA_NOTOWNED); - struct nvme_qpair * qpair = tr->qpair; + memset(&cpl, 0, sizeof(cpl)); cpl.sqid = qpair->id; cpl.cid = tr->cid; From nobody Mon May 13 22:38:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdZC950rkz5L4jX; Mon, 13 May 2024 22:38:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VdZC94PyGz41Wp; Mon, 13 May 2024 22:38:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715639909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N1dly3nTn/0Msg+UjLwUocs+LrqqR996EgRNftPQqQA=; b=qpr8TX4mu9zHnaLCKswjxgmgxELXDjtXxiJCzZOHXOE/3/aEhLpE1SK4Rw8vTmCjUXlWjw VuZJ5oLKzi201J9sfXpRwlRygCXzmlUinWqv1F7j01YlXbXEmMGzHHo3B/a3LxSDEDNn9e b+jHGpr7qc3YRKcaxISzrhqbHEIE/9P2VPV6MjuJ5JlfLrTh76J6ZKBPmUuhUgHsxFkKUp KpxeDMiOKOZaGfQPyVRjrK9zIZfgQFqk7QXPLts7s4iRaAQYYonlSoHcBpRU6pTE2zyFcI IhswkvvoMrxK86hvyts1vIChJz4dA6vxEA7KgZtF75Zr4knc9NWrZq13vqVu3g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715639909; a=rsa-sha256; cv=none; b=OvMbK1uSTPzNxtqvyABqTXCt9e4rizAGCjdTghCD00ghq6DEoDzuzWZH9SChebKrn6vHdq zpauRnEopiLG3S6J842RIMx4fKWM0W+aZ4XkHZslWY6cBvWiIUqyMYNmf03Y5x6g6ceJIc kDbvqJQ5haq3TDue1+4jRxm8HN//Ab1uvOXBbpF1ZyZb97nnbivgkGIF2sAYWZh8HnnXWg 3ULrgCmwoHdYdpP/tQT+USX8etG8OOWnaL27Uig7cMYEy+FHDzgyQcB6v3pskB/omuxd03 jB4OD9MqB/SvpLql7Y2Bdehpr9ciccr0uadIrHDx7xhMWKVvZEmnKZcjchwHhQ== 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=1715639909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N1dly3nTn/0Msg+UjLwUocs+LrqqR996EgRNftPQqQA=; b=Gw9PaZr7p2kxQUseWPrXHtWVIj0WV4zyPnVZQp3LoxN+gHzM7Uw74vkWGGENfdlYR3SZtm ntFdFoaEkgv4kH7+yVwGOGUxN62oQ3HmzgeHBl+u00eoGe20Ru+u0eZGPyCzJz7qmbsZmi 2R9ZNFptJ8wJVKdFjPCZnhB4iW3/MwyJ8FAwK9hb5bX9i+6Dh32HhSlt/JfL73FfxHcPnL l7zdw/wrhQYp7J8ZWj6vlIf5qHuu/2w0bDzN3EO/+mSj4p6/rmOlnqPRAVX9rtEohstDNK 7HaIvuZVWAExIXZ57XC5LKyjqG5DiMI5t1Anuh0imGqF5bZ0TiRunkn9L9ZRUg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdZC941Czz16Cw; Mon, 13 May 2024 22:38:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44DMcTUF058246; Mon, 13 May 2024 22:38:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DMcTMU058243; Mon, 13 May 2024 22:38:29 GMT (envelope-from git) Date: Mon, 13 May 2024 22:38:29 GMT Message-Id: <202405132238.44DMcTMU058243@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 9db8ca92b985 - main - nvme: Slight reworking this loop to match FreeBSD style List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9db8ca92b98588e705f4d021e934edd60c51fb98 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9db8ca92b98588e705f4d021e934edd60c51fb98 commit 9db8ca92b98588e705f4d021e934edd60c51fb98 Author: Warner Losh AuthorDate: 2024-05-13 20:55:42 +0000 Commit: Warner Losh CommitDate: 2024-05-13 22:14:04 +0000 nvme: Slight reworking this loop to match FreeBSD style Update the comment for the code, and slightly rework the code in the 'fast exit' paradigm that FreeBSD generally tries to do. Sponsored by: Netflix --- sys/dev/nvme/nvme_qpair.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index b11bdc44dc40..dd26906a933b 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -953,27 +953,26 @@ nvme_admin_qpair_abort_aers(struct nvme_qpair *qpair) /* * nvme_complete_tracker must be called without the qpair lock held. It * takes the lock to adjust outstanding_tr list, so make sure we don't - * have it yet (since this is a general purpose routine). We take the - * lock to make the list traverse safe, but have to drop the lock to - * complete any AER. We restart the list scan when we do this to make - * this safe. There's interlock with the ISR so we know this tracker - * won't be completed twice. + * have it yet. We need the lock to make the list traverse safe, but + * have to drop the lock to complete any AER. We restart the list scan + * when we do this to make this safe. There's interlock with the ISR so + * we know this tracker won't be completed twice. */ mtx_assert(&qpair->lock, MA_NOTOWNED); mtx_lock(&qpair->lock); tr = TAILQ_FIRST(&qpair->outstanding_tr); while (tr != NULL) { - if (tr->req->cmd.opc == NVME_OPC_ASYNC_EVENT_REQUEST) { - mtx_unlock(&qpair->lock); - nvme_qpair_manual_complete_tracker(tr, - NVME_SCT_GENERIC, NVME_SC_ABORTED_SQ_DELETION, 0, - ERROR_PRINT_NONE); - mtx_lock(&qpair->lock); - tr = TAILQ_FIRST(&qpair->outstanding_tr); - } else { + if (tr->req->cmd.opc != NVME_OPC_ASYNC_EVENT_REQUEST) { tr = TAILQ_NEXT(tr, tailq); + continue; } + mtx_unlock(&qpair->lock); + nvme_qpair_manual_complete_tracker(tr, + NVME_SCT_GENERIC, NVME_SC_ABORTED_SQ_DELETION, 0, + ERROR_PRINT_NONE); + mtx_lock(&qpair->lock); + tr = TAILQ_FIRST(&qpair->outstanding_tr); } mtx_unlock(&qpair->lock); } From nobody Mon May 13 22:38:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdZCB6vm0z5L4jZ; Mon, 13 May 2024 22:38: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 4VdZCB54vXz41Wy; Mon, 13 May 2024 22:38:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715639910; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BHnbTvlcfPyK/Ki/Tp6MB4UusNBuq1Brx8KD2zla4f4=; b=H7PFk4syQNunKeZT2iS9lQTOzAh9dPH3q8MWMDfA4mMekCw59EOIE972Q2/MMSXNKKsXz2 ztUyaJiEW51Ugmclw4XY5svbsF625Uy2nX/oq0Kbahx/9S1l7ooI8QmTgoSX4X9JbRh9BV UvIB9W1UOL8kCHMCvu9ah1uwz3HaVgP8eeREqsGhBFPuZ3lFrQ1LV2SCIBuIYk4TjHz0aX GcEJZ2+JF0Ccl1mU2rdy3TExK+2c7fATIjNXsTqahUb6mI0nOmXZ30gSZ22+rkLMTOjBV7 /iNc4Z/9z+1xk8RUWWDFmHvCvkiNN+QWgVsLTxiso5nkX41mOD/esRW/Kyhtrw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715639910; a=rsa-sha256; cv=none; b=Zr6MvfK23rmkRuWkdf0lqSckNJkt280qsBtDKT/qIq37pSPXHN0mIMnm/ChCxRBEa9SSzJ eFNA1HkkPT7/2v4VYFVooF5cSryfZa/S5/zZXyHz+Fek7Ql+EzezSiTOOfk8/7hB9Ot4JT ln4/rrJrxOPO8Q2ue8//HMU8sVCJfr4xBwSOL7AcUnKUl4eTaMaHKt5eX0peT4ij568Rnb HkjMlwv56sGhbrm+meBam0J1yRxxLkgEltf0x1HrDVWHaqHfxdN/xFuhs5XN5g5kBMrdJt Xmti3ADPCupfr5Fx5H1x6ZIE3bLqN0uiaZO0PvtzXll+KEgIlzPsTGVCzMvmAg== 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=1715639910; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BHnbTvlcfPyK/Ki/Tp6MB4UusNBuq1Brx8KD2zla4f4=; b=qLBfpdVrT8mnuNmU0ObKWP5DcRSkpU5oOC5mdh7QmILP3IQ5b2cebPsRBlaXOGzh0BqRZN I5Biv2DL7C0KyXQBWlKHrsVyHBt9OgHtfm/fVEvpkL+hpdOZK/rW1Bv5ojNzVer9M4eZmS vT/W/y3fABVZqRGd/OwHAOhCgbjXVQCLc0KkLr4kHBzXDJHOD8srT6k+s85YMXolHPU8lf lcQlptBbtYKSLTpReuAp71iv0WMqPOwokJ4mecAt1gI9hfzvsjAhb7olhqeADW4mI0QdS6 oU3So03EiQYV3QMrYB7js2TI/PV2lRDKc89vlpALLxHXpL+1zmj5I2Wff7eC3A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdZCB4h72z15hr; Mon, 13 May 2024 22:38: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 44DMcUfr058285; Mon, 13 May 2024 22:38:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DMcUtq058282; Mon, 13 May 2024 22:38:30 GMT (envelope-from git) Date: Mon, 13 May 2024 22:38:30 GMT Message-Id: <202405132238.44DMcUtq058282@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: c931cf6af08b - main - nvme: Slight simplification List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c931cf6af08b7d0abb29c90917dfe79a18235897 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=c931cf6af08b7d0abb29c90917dfe79a18235897 commit c931cf6af08b7d0abb29c90917dfe79a18235897 Author: Warner Losh AuthorDate: 2024-05-13 21:03:52 +0000 Commit: Warner Losh CommitDate: 2024-05-13 22:14:04 +0000 nvme: Slight simplification We don't need to dereference qpair to get the ctrlr pointer each time, so use the cached value. It's not going to change. No change intended. Sponsored by: Netflix --- sys/dev/nvme/nvme_qpair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index dd26906a933b..4c5d5f3c1ea7 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -1203,7 +1203,7 @@ nvme_qpair_submit_tracker(struct nvme_qpair *qpair, struct nvme_tracker *tr) bus_dmamap_sync(qpair->dma_tag, qpair->queuemem_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); - bus_space_write_4(qpair->ctrlr->bus_tag, qpair->ctrlr->bus_handle, + bus_space_write_4(ctrlr->bus_tag, ctrlr->bus_handle, qpair->sq_tdbl_off, qpair->sq_tail); qpair->num_cmds++; } From nobody Mon May 13 22:38:31 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdZCD2583z5L4wt; Mon, 13 May 2024 22: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 4VdZCC6PHtz41k1; Mon, 13 May 2024 22:38:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715639911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hswMvZFoQ4s7u2rIB9+CfPYv3BZGuettlMk5uC/mRhA=; b=WpZv7jEgqtViOUwFPh21Vh6UEIWbsKzVVrfC4hb5QdwzKdIlTs4rLV/g5bzyv3i87Y0LQP mFjmHGc1b/K4c04YzyxpDxEEubkdlujhay2Ry44fYP5bsHBoHtnGs4Q0yJoKkLH3XAA/uv SaW74d48GRCViQxZTZvWV+XIli7rSb7XL84xWh8xhAaF9i2B+RK5gzIkID//v7/4ZUVB89 OzXMoBBTMnFv+MGkDhXSV7u8VgzoChZoNFTgd+0fu/GrBLlLXKaYbY0M+mTuzU4I4EvXYf 0x+mcrtIyfzIYttwG5vBX3fHrEYZHgL0Oz8KuNXtiRwcsk1qnh66PWV5SeQ8yQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715639911; a=rsa-sha256; cv=none; b=ZmoJgxolZVz38h2qkhcVedotJEW8YyiRGkBrRT3i5lF2NuHW/kQ6eSwvQ/Zw/W/NthA6cG zPjBCKh91eXhDACgepiEbZskPBLw2t2jMkGI8VVgjt9KQpiOaHOXV9JO+1MAXiT7dd9n8q oGBNHWYZtTFVMGLNF3S3jftsoyeQxkO1hqKTiMs/1R58EmFnxdGIwmsEOp10tkF4p1Y4bV zkx+YGnoMwh7AwL91muR8ZVtW1Vv/l5K/yQ/8vb8GQzuDM1bC1ewC5ThbHoLCEH8DcaPJD edAPaTNpeGdkG+5lE5kNDoq14Qa2xROzeYLxJsRnDCt0UYHhtXoSs5CJ/KRy7Q== 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=1715639911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hswMvZFoQ4s7u2rIB9+CfPYv3BZGuettlMk5uC/mRhA=; b=e2VzJqEoqc5FFd8m3CgYAI+rUz/FWC+Gbql3ZZo4DhtAPnHyklFwAfBV1xk8M21/O1BUgQ WKrBGXfNinGECGENcxHecoII/0psjSKcwHMNXgdrz4Ii0V1Sx/J06YClehSSejr1fXXrpi J44gr7LxtrOoHEOLXEY0HM05azoxYDjLvTK2jbJVBRkyYsRKD+8qsJRLahxx9DZ5a0onFU VucVmh0E2lCf+Y7sLbONZ+ngzlD5V4CGqOoFbqRmU3PpGtN/Yml6sSlx8D93VBmKlm+Qab jqduR5dCdkea5ifrOxNbLMQy4b7bSRgq3TiziBwyY9vd4RDqboQdvzx70oYjhQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdZCC61cKz15fN; Mon, 13 May 2024 22:38: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 44DMcVq3058336; Mon, 13 May 2024 22:38:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DMcVoN058333; Mon, 13 May 2024 22:38:31 GMT (envelope-from git) Date: Mon, 13 May 2024 22:38:31 GMT Message-Id: <202405132238.44DMcVoN058333@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 0dd84c3b117a - main - nvme: Add comment about where tr->deadline is set List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0dd84c3b117a01fdcac9a2f665fb156a2e358dfa Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=0dd84c3b117a01fdcac9a2f665fb156a2e358dfa commit 0dd84c3b117a01fdcac9a2f665fb156a2e358dfa Author: Warner Losh AuthorDate: 2024-05-13 21:58:59 +0000 Commit: Warner Losh CommitDate: 2024-05-13 22:14:04 +0000 nvme: Add comment about where tr->deadline is set It's easy to overlook the chain of events that lead to tr->deadline being updated. Add a comment here to explain what otherwise looks like an oversight w/o careful study. Sponsored by: Netflix --- sys/dev/nvme/nvme_qpair.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index 4c5d5f3c1ea7..5be6c151bbea 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -1315,6 +1315,11 @@ _nvme_qpair_submit_request(struct nvme_qpair *qpair, struct nvme_request *req) return; } + /* + * tr->deadline updating when nvme_payload_map calls + * nvme_qpair_submit_tracker (we call it above directly + * when there's no map to load). + */ err = bus_dmamap_load_mem(tr->qpair->dma_tag_payload, tr->payload_dma_map, &req->payload, nvme_payload_map, tr, 0); if (err != 0) { From nobody Mon May 13 22:46:16 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdZN83rLJz5L5Zj; Mon, 13 May 2024 22:46: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 4VdZN83FgTz433r; Mon, 13 May 2024 22:46:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715640376; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=73YKYEaT/ChjZ6QeV453+NdrHBDGE6jaA6NW0kZYHx8=; b=OHAvdmjlK7Bp7jG8uZvsN5sG9ab7vnsUVEVjzXR5WpazwdHmoCAvU+jMzz7u8Y9DnECN+h OrSZZmS2xUrQl2OsyDlDxIZGzEmqSN7bDKDkeZxdiDrVmNxHSJ0fc6g5Ol92PMoLJ4WShG NSBWV61PIqfeDVK8uE3cRXZzaFxKThgi4AWhiNjIjEyvYIHt6LHxLcKEK1/mgM1tskWua+ F9LzYEeE8vmYY26QbDFqLbiDRk9r0N3e01LZ4ZcWdq2TolWAehsrfqMoZuupYAnXD10sm/ DywGPY7zPDVmwYTQd/fWkhJEaGbZvyfcsX+SbpDsBfNUxnDnd6gGVxIk4dGGCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715640376; a=rsa-sha256; cv=none; b=IpKkXli3YeitVoruvVRFilzXR95yBDrDYk5YUeLjw3gGeUQdzh0nMTbDnP4WZMsLagAzvv rK/J/ZV97gafCx/USAtB8U3CU+W/nhcJncmmOHCxJDpjRZW6W9yka1fkzTAsHpU4+smXoj MpykkvgHVU5yhNTJB3FsMncJKT65Zk6Ve/gzLDQEt+zNT8C+IO0ade1ThgOEALHDRchxMf gvJJAHtJ2fspfOlNtk2hApryVvit/SOiV3kQYcwO8xO68VgoHDeiUjSWdFvdtaZm+pKXo0 wT3mu68Ux0j9Pt+GDj0uLb+Eao/6dlU9ytrWGMAu96LYZxDcS0gHV0AvDydpww== 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=1715640376; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=73YKYEaT/ChjZ6QeV453+NdrHBDGE6jaA6NW0kZYHx8=; b=wcU2Bpo9d+2krCXf4GVRLjWU5R/IueFmuNqF94vg49ItTLwXGpdU2Sa4b/+un5+MU6TEvj UPKr4OfSlCL+LxSIKs1CIGxuA1vRfpokQ2JZvmcUcSF+BwGCoK3URUYrcJDBnr3J7r8Nzd I6RMRmcCyM7Y1Ss/+1wLpFEJfNHISJKPyylOwYaFyhLOBfez7bJT8ZDxeOXzmBY1EEuqfL l77zUUCS/u9v7q2ScEJ1kcMl9mSq8pDVyM43F86gY3aN0YUO/KHA97uNzICHMtdTBomqoi 6xX5Mz2ywziEza/0BhR501WEmMpZWUO4rZeDbpv2eHQJvP5oAqhO67tuX06Ccg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdZN82kzhz16Gp; Mon, 13 May 2024 22:46: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 44DMkGDo075277; Mon, 13 May 2024 22:46:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DMkGNH075274; Mon, 13 May 2024 22:46:16 GMT (envelope-from git) Date: Mon, 13 May 2024 22:46:16 GMT Message-Id: <202405132246.44DMkGNH075274@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 0ed58ac88a86 - main - include: ssp: kill off leftover $FreeBSD$ tag List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0ed58ac88a865610e982416af505a5948d1c88c9 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=0ed58ac88a865610e982416af505a5948d1c88c9 commit 0ed58ac88a865610e982416af505a5948d1c88c9 Author: Kyle Evans AuthorDate: 2024-05-13 22:38:11 +0000 Commit: Kyle Evans CommitDate: 2024-05-13 22:45:55 +0000 include: ssp: kill off leftover $FreeBSD$ tag Most of these were fixed when rebasing the patch forward, but this one seems to have been missed. Reported by: marck Fixes: be04fec426 ("Import _FORTIFY_SOURCE implementation [...]") --- include/ssp/Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/ssp/Makefile b/include/ssp/Makefile index dff19f43c920..69e7df68bb47 100644 --- a/include/ssp/Makefile +++ b/include/ssp/Makefile @@ -1,5 +1,3 @@ -# $FreeBSD$ - INCS= ssp.h stdio.h string.h strings.h unistd.h INCSDIR= ${INCLUDEDIR}/ssp From nobody Mon May 13 22:46:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdZN95q8mz5L5P5; Mon, 13 May 2024 22:46:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VdZN93sVXz43Vs; Mon, 13 May 2024 22:46:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715640377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2P9tI5k02MtKR8nOND9NabJQ6vegDsu2hCvqu27+AZI=; b=kXFlMkymBfRi3sMtWaAvkiU+q48+V93SiHT2cjUuaH/PK+yGGLa1+bZh1CJcc7/EgE7xwx FPF6KxUhR+y2FRKaEiMuPq/5d8T/MAsBHBv2exfirFURvy4+jYS5dqgntSAkmnX+gLRm7h 43KDZtRd3R9a9ubY2zLpG+Ek9qxRYrSlpbLhxyfqHbGUM5xsj/vVH+6nkSjfiCwUh/clfD L+WMPZfU3nG85V9lPoBAC7E/l0z7PtYlUtHLXLx03uo7QiWyDaUAipQi5JZafBqX3WmS2h qxtX4sckklvpyP/03aGK4OkS5nk0W5ZganRNbbynCqAbPAcdqXXa+KrMfxPZGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715640377; a=rsa-sha256; cv=none; b=OByPSH4FG06VbnoTdRBrmKknbTKEkLe7xrfos1T3xPG1RFm0IYrINcJEFlZrYsYuZN8fMM QnvlHe9P94O3TnYSjAjEo47cMzlQm8Uo3EcxtltI7enI95h5wTs5Ff1Lbii5gtYu/LKpZo wPBnvby+cqhsx8M53WoqqkyIkTC8tSAx4zw3AKwAB/9H1XvV0ODtRQAcN0cbaW0sllBwxg OulHMXLGLvr+D4H09NErUm4jSe0z0suyAu0+rcl4/UhRRQ3xf068MSMjB14tcgAyO/5p2G kaOOfgoLooPPe9ZViEvF1ce+WRJr8fJCpeddd1iaiTRG38ILsJxu4ajLaBJGTw== 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=1715640377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2P9tI5k02MtKR8nOND9NabJQ6vegDsu2hCvqu27+AZI=; b=gfVbQBZ5JjBLBy4pL8ltlCk8Ssoe0Yn2w+Jtnz6Te8hzG8ZK6QmHqmYnieDZf1s7rg6iTn /tT2isWvBmPD/YZ45PJS533zYBNyFJTWG7rTWLT1mAqpAeWHJFQrZ4sFBDefM18Fu3aMb1 lPRN/Qm3m3xiY+M5BY3DQX7A9qp3BENYrWxC4gnAmNwG156Uvx0Udt8zzKFwv49hnuA4JO bAPKoYt2NdT1g4fQbCvFe577w23srqt66XdC7Fm2Ve0tofo4PpcomCB/lqvvArrhu4JwvE 8+sZtHU/Xa4pUHYRFHsNiH38aOiqjOKAhBRQtPfVAmXqF7oL1F4Dt/ekmMZysA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdZN93T4Sz15jP; Mon, 13 May 2024 22:46: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 44DMkHgO075316; Mon, 13 May 2024 22:46:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DMkHab075313; Mon, 13 May 2024 22:46:17 GMT (envelope-from git) Date: Mon, 13 May 2024 22:46:17 GMT Message-Id: <202405132246.44DMkHab075313@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: dec211c6cf60 - main - Stop removing ssp headers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dec211c6cf60dcaefcd1bd93eb50825179d3060f Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=dec211c6cf60dcaefcd1bd93eb50825179d3060f commit dec211c6cf60dcaefcd1bd93eb50825179d3060f Author: Kyle Evans AuthorDate: 2024-05-13 22:43:44 +0000 Commit: Kyle Evans CommitDate: 2024-05-13 22:45:55 +0000 Stop removing ssp headers These were previously installed by the GCC implementation of libssp, but now they're installed once again with our implementation of FORTIFY_SOURCE. Reported by: jkim Fixes: be04fec42638 ("Import _FORTIFY_SOURCE implementation [...]") --- ObsoleteFiles.inc | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index b84b8d917bf4..8a2c87b20645 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -9491,11 +9491,6 @@ OLD_FILES+=usr/share/man/man4/imm.4.gz OLD_FILES+=usr/share/man/man4/vpo.4.gz # 20200104: gcc libssp removed -OLD_FILES+=usr/include/ssp/ssp.h -OLD_FILES+=usr/include/ssp/stdio.h -OLD_FILES+=usr/include/ssp/string.h -OLD_FILES+=usr/include/ssp/unistd.h -OLD_DIRS+=usr/include/ssp OLD_FILES+=usr/lib/libssp.a # 20191229: GEOM_SCHED class and gsched tool removed From nobody Mon May 13 23:02:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdZkl2wTdz5L6Pv; Mon, 13 May 2024 23:02:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VdZkl2Hfzz44ZT; Mon, 13 May 2024 23:02:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715641343; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fpTneWr/4YnP28gq4Zzvt89EPOXGjKz7p9bSOjhZtYw=; b=ZKbjI4m/a7JS27TWEfBdsytsd1TnMnzNQfqZg1+oq3ci/dz3rertDWT+ObmsX6raSblykj L5VNo72Fy8tScPkiCogmtmBLyFq8N/qxCwy1qCIlgT7/rcJ/RIOY/owqHNQ0nlk9+xLrBp hE/+CaeTAl2BlHvMO272JCgJYR2nc34aLWR31rsK5XJCbCjDXhM3HRHm0LSpYWMsquxcse sCqGJCtNPoiQEd0t+RsbVXpBOYjSePfDdVUH4560FLlrLvGZrMfi2iSK8Oz/bjvHW4NL97 tXbL6tZXiWPmmrfPDvmCzYwm+JOQXuzMGkCoIf/TT7pgnYT2YcYXsKKrBnutTg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715641343; a=rsa-sha256; cv=none; b=DhptmfYGjbNl1IydHO7UgS/yCZgtF+QyLcwRDEBAxqbQertVcpQGqk35Iv0NnvDgwwMq8M x4LvjRgAS3Mn+IzCQRJqNLm5vQqYikyIbUjeM6W1lNkYgjM5yAs4H1HLXwioazKJx+Sab8 POcq/f2c2tCIGvTnBRX1Tg0id4RVYKnpaBUvB1nphYRjsjyaAh34scFMD1v3P3uslok9D/ 1i2I6o8lpGTNpRIq68pv8zdP3bPVlkdcaNaSB9ajcmGSjpPSrE5/8y4hF2MqyDwDCXWg2T lQbux9K5qyza4r9PtDpWoOlWGnZVKMUuiF8L/U0QT34i/R32tvzPEZOW6VpWjw== 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=1715641343; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fpTneWr/4YnP28gq4Zzvt89EPOXGjKz7p9bSOjhZtYw=; b=ky9sl01jz28f9ByhgSuKyuG1RVPd2AqWMCPOd/m0UYfxygdb4ByabheNfB+jf/A8ASFJ6K YUGED5xcxED2XqVEu7B6BjEHQImWrkMzaHn1/4lgHGp/RZGs+5qHDtv45k/KlK9xgMdbw8 FgH/jrJdoYRxZ7a1AEuj8yLkw0CHtyIFFq3M+DImIglsqy4gmj3NHQ90G8X4tzfEDYPVuF /JO+7281mXfH8nk+tJbO6SXBnkmP4qrNid1HTUA/5w9MZPDFjGa8foGU7TzD+TyhePat9G IX66dDMO0gyqanvOFvv66c2hcN5k0bdCmFEl8UPX1KRaKtYzSY5Q+0k1rx02DQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdZkl1tvhz16xj; Mon, 13 May 2024 23:02:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44DN2Nan009091; Mon, 13 May 2024 23:02:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DN2NX6009088; Mon, 13 May 2024 23:02:23 GMT (envelope-from git) Date: Mon, 13 May 2024 23:02:23 GMT Message-Id: <202405132302.44DN2NX6009088@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Joseph Mingrone Subject: git: 27358245644c - main - freebsd-tips: Add fortune to find font providing Unicode character List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 27358245644c2a8bf2b57182e2fcd8cdf18d6b8d Auto-Submitted: auto-generated The branch main has been updated by jrm: URL: https://cgit.FreeBSD.org/src/commit/?id=27358245644c2a8bf2b57182e2fcd8cdf18d6b8d commit 27358245644c2a8bf2b57182e2fcd8cdf18d6b8d Author: Joseph Mingrone AuthorDate: 2024-05-13 18:38:13 +0000 Commit: Joseph Mingrone CommitDate: 2024-05-13 23:02:17 +0000 freebsd-tips: Add fortune to find font providing Unicode character Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45183 --- usr.bin/fortune/datfiles/freebsd-tips | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/usr.bin/fortune/datfiles/freebsd-tips b/usr.bin/fortune/datfiles/freebsd-tips index 028a9e9b1430..e24d3640b8c6 100644 --- a/usr.bin/fortune/datfiles/freebsd-tips +++ b/usr.bin/fortune/datfiles/freebsd-tips @@ -845,3 +845,17 @@ kern.tty_info_kstacks to 0 (off), 1 (on), or 2 (verbose), e.g.: -- Michael Gmelin % + +Under X Windows, you can determine which fonts provide a particular Unicode +character using fc-list from the fontconfig package. For example, if your +friend complains that the emoji you sent won't display, run fc-list with the hex +value of the character to determine which font your friend should install. + +$ fc-list ':charset=0x1F4A1' +/usr/local/share/fonts/noto/NotoColorEmoji.ttf: Noto Color Emoji:style=Regular + +$ pkg which /usr/local/share/fonts/noto/NotoColorEmoji.ttf +/usr/local/share/fonts/noto/NotoColorEmoji.ttf was installed by package noto-emoji-2.042_1 + + -- Joe Mingrone +% From nobody Tue May 14 00:18:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdcQL4Scgz5JyQF; Tue, 14 May 2024 00:18: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 4VdcQL3V10z4CWC; Tue, 14 May 2024 00:18:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715645898; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TsZKZJ1duY3WHpKvYK3dRA0L1FETbVo15lkZ/Pab0n4=; b=mZ5a0BnzZLRn+eq6ThPEkJNOaogGkm9sFe1Ma6X8NrwaCh0jsMYxS6gYbmvqrlp3ROhpGX oJbZJN6EDj9iAI2/b5tNZtRx7Sxjlcvq7ke1OVh2Mp8efUTINp6XbRmSk8mYHddbsaxUTu X+zqYo12tPgqU+d8l+8akdgXJvUVOl6t0jCgDdB4Z90CDGki4o2qgrnqUfnH+FJfVCeEo8 jHgPlZ8WJkMVPwr08JpEevavCm0dCIfiCoxmDGogS3DvHnYzxCGlvW8yXHg4dkUOpFmWIl Twym2TXn4w56PFsx6TDoSkrKqrEqlmVnK9ZIAiJRMdELkSA5UISz7FR7g+gZyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715645898; a=rsa-sha256; cv=none; b=LCV2EXoOFB3DkJ5yL1VtklJ08rAOvgaMk2UYN3jwCCFMTvu32MOhXTF0Ba6olVEAJiP42r dp+pXgHanNXO0VCZO8YNXCOqeOKC+/VNk+IZGBOlH5tQViJAHKHK6RKS/WwMqk7KQRaGc/ 5qXosrV6HibxYxoXbfwYbC8f7XQERRWJzB/eNgRmy7trDKm8zpLaDAu+Wy04EP+JFN7QEz TEYVrKbAXGvrRurGKSvB/yFYbuuUw3U6kPvDrKfo/tV+jXY6JWiMIeVoh+lZNoa9fh9j23 oeBwcRox1cYEcqkdAqByPyS+xdeBsCYd+iTIxTe5+MxSife63WGG6iecmGKFjA== 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=1715645898; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TsZKZJ1duY3WHpKvYK3dRA0L1FETbVo15lkZ/Pab0n4=; b=AyBAe0rj0gI2i20CxwQxmudtnGucBEgQZs5iooA6MmhMsuVuAJcG/3oTRvr9QX0lU+rim/ /d5RMXXb2t7S/af4Q0b6Mx0gS6BToOd1TWJQ9gGBPgDjph52HtVqxAth5We3PczO/hMCNf tEant1PglEqtVr35hhtQWAIoNunxBzUEw2LTSa67kVOpSAJpJ8Gq4wAX/pJHRB1TneJi8n OSGAPhsw0hODAcYavTpnd5qFZEnSdnArpd2NUXtTrLIY0jwrb6IHLUz/QEXCusvRFOvhak VSUuQP6553fslaX3CmRsQXcvISzQFp0SdDGKIcPxm5h2OckbhudsdZD88qB0TQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdcQL32Qhz187d; Tue, 14 May 2024 00:18: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 44E0IIMI027439; Tue, 14 May 2024 00:18:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44E0IItc027436; Tue, 14 May 2024 00:18:18 GMT (envelope-from git) Date: Tue, 14 May 2024 00:18:18 GMT Message-Id: <202405140018.44E0IItc027436@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 338d53965d9f - main - x86: Add Intel TD/HFI related MSR/CPUID defines to specialregs.h List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 338d53965d9f4bfb1a83c1bcff3ff78944ce3a9f Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=338d53965d9f4bfb1a83c1bcff3ff78944ce3a9f commit 338d53965d9f4bfb1a83c1bcff3ff78944ce3a9f Author: Koine Yuusuke AuthorDate: 2024-05-06 02:17:29 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-14 00:10:52 +0000 x86: Add Intel TD/HFI related MSR/CPUID defines to specialregs.h for the coredirector driver. MFC after: 1 week Differential revision: https://reviews.freebsd.org/D44453 --- sys/x86/include/specialreg.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/sys/x86/include/specialreg.h b/sys/x86/include/specialreg.h index 3ea8c988aa07..b4b95670e367 100644 --- a/sys/x86/include/specialreg.h +++ b/sys/x86/include/specialreg.h @@ -345,6 +345,13 @@ /* Ecx. */ #define CPUID_PERF_STAT 0x00000001 #define CPUID_PERF_BIAS 0x00000008 +#define CPUID_PERF_TD_CLASSES 0x0000ff00 + +/* Edx. */ +#define CPUID_HF_PERFORMANCE 0x00000001 +#define CPUID_HF_EFFICIENCY 0x00000002 +#define CPUID_TD_CAPABLITIES 0x0000000f +#define CPUID_TD_TBLPAGES 0x00000f00 /* * CPUID instruction 0xb ebx info. @@ -583,6 +590,8 @@ #define MSR_TURBO_RATIO_LIMIT 0x1ad #define MSR_TURBO_RATIO_LIMIT1 0x1ae #define MSR_IA32_ENERGY_PERF_BIAS 0x1b0 +#define MSR_IA32_PKG_THERM_STATUS 0x1b1 +#define MSR_IA32_PKG_THERM_INTERRUPT 0x1b2 #define MSR_DEBUGCTLMSR 0x1d9 #define MSR_LASTBRANCHFROMIP 0x1db #define MSR_LASTBRANCHTOIP 0x1dc @@ -766,6 +775,14 @@ #define TOPA_INT (1 << 2) #define TOPA_END (1 << 0) +/* + * Intel Hardware Feedback Interface / Thread Director MSRs + */ +#define MSR_IA32_HW_FEEDBACK_PTR 0x17d0 +#define MSR_IA32_HW_FEEDBACK_CONFIG 0x17d1 +#define MSR_IA32_THREAD_FEEDBACK_CHAR 0x17d2 +#define MSR_IA32_HW_FEEDBACK_THREAD_CONFIG 0x17d4 + /* * Constants related to MSR's. */ @@ -836,6 +853,19 @@ /* MSR IA32_ENERGY_PERF_BIAS */ #define IA32_ENERGY_PERF_BIAS_POLICY_HINT_MASK (0xfULL << 0) +/* MSR IA32_HW_FEEDBACK_PTR */ +#define IA32_HW_FEEDBACK_PTR_ENABLE (0x1ULL << 0) + +/* MSR IA32_HW_FEEDBACK_CONFIG */ +#define IA32_HW_FEEDBACK_CONFIG_EN_HFI (0x1ULL << 0) +#define IA32_HW_FEEDBACK_CONFIG_EN_THDIR (0x1ULL << 1) + +/* MSR IA32_PKG_THERM_STATUS */ +#define IA32_PKG_THERM_STATUS_HFI_UPDATED (0x1ULL << 26) + +/* MSR IA32_PKG_THERM_INTERRUPT */ +#define IA32_PKG_THERM_INTERRUPT_HFI_ENABLE (0x1ULL << 25) + /* * PAT modes. */ From nobody Tue May 14 00:19:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vddlc06sXz5K4GJ for ; Tue, 14 May 2024 01:18:20 +0000 (UTC) (envelope-from bmosier80@gmail.com) Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vddlb2X7sz4KQn for ; Tue, 14 May 2024 01:18:19 +0000 (UTC) (envelope-from bmosier80@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=ADg8iSVC; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of bmosier80@gmail.com designates 2a00:1450:4864:20::229 as permitted sender) smtp.mailfrom=bmosier80@gmail.com Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2e43c481b53so61644781fa.2 for ; Mon, 13 May 2024 18:18:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715649498; x=1716254298; darn=freebsd.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=4UE0KY4yThDpE5VbYwaOsXiCAZZFAzuZsSY2Hmy7Ykk=; b=ADg8iSVCNhN2zk2PvQy/bZhXaajiuNtxwWZ1I9zfK4Gcn6SHEzcxvnc6/9r1GG6Qy6 z1gaw8cIX3eiuc0o73wyM8gDPyWlSIaeHwIUGVpnKJjpQCJQSs5dttSDjhV5SoTxIdu5 M3fBVMTkuJvWn849zxL4Tdk9ga5EP1il21xTIyhWYE5+/jL6nZhdbASNXzPVMTn7QKOR 5g1Wg9UYsUyqg70mNdHUrzE9M3jBmDh/ciNYJopFomjQzrgol3OqZpa3aolmFEuLuHMT ZFxPgqaSjygg9hsDwoar9IRvmHYjEicE+HoNCucXD/hCyyPE2+dvFTtxgyrkzLJ2/JtV c3dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715649498; x=1716254298; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=4UE0KY4yThDpE5VbYwaOsXiCAZZFAzuZsSY2Hmy7Ykk=; b=IHkbmcsSL3ae1m4iQQFh/J7IAdwJpvfrTcYIrmEQ0shHQm+ueRO2WjF1TNvCEamVpU +Qr3yXMGBXmZRf4RdQQ+LG+d6Q56bXaQLW32uMf2GrZHP74R9ZcAOtmW0ewWRKKr+rKj 8Mzfq94RGhxQGvOlecCRs1GVBsxqRXFOpzjNG+CzT+RvPDY0U1wmvm2aeCFOP4e0HBh+ 4OYeaJ1xVGGGiQkkeKfgYLVdm37WPIU93iGT+ryfg9nAbKQNITYDc1Kw0d+LoxWvnoaZ C4U6WJXdP9TD+UicG2tdPaPyVnDgCqMFoNICd355bvFG9k6eF1+kKcYcKELMrLv2GmGT pbhg== X-Gm-Message-State: AOJu0YzlCWX6mFqvcdCP02IBlb6G3fzOflfGdRwqowrS2sSL+AcwydPK /qvbEH8qRZ+0dYmHZHlRr8DoCgp+iNlu9kgFusSoQT+tB6HBPBI1BEeJ322U6ThnFPQNnhJ3ITn f9MzaR02Pbt1BMsx5ZLnmsYXOQCoWs6qGeso= X-Google-Smtp-Source: AGHT+IFELrNCuGR8S0OLZ22b8EZRHyzVBJBBj/t06MFXZSABmM/IzGKgAzmPPr1dAFzkhdhGlesfqMPN/pkSHNjDOvs= X-Received: by 2002:a2e:6e0d:0:b0:2e6:b36e:1d0e with SMTP id 38308e7fff4ca-2e6b36e2ad6mr22314401fa.43.1715649497402; Mon, 13 May 2024 18:18:17 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 From: B M Date: Mon, 13 May 2024 20:19:59 -0400 Message-ID: Subject: To: dev-commits-src-all@freebsd.org Content-Type: multipart/alternative; boundary="000000000000da13f506185fc6dc" X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.90 / 15.00]; EMPTY_SUBJECT(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.997]; NEURAL_HAM_SHORT(-0.95)[-0.954]; NEURAL_HAM_LONG(-0.95)[-0.948]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FREEMAIL_FROM(0.00)[gmail.com]; DKIM_TRACE(0.00)[gmail.com:+]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-all@freebsd.org]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MISSING_XM_UA(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org]; RCVD_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::229:from] X-Rspamd-Queue-Id: 4Vddlb2X7sz4KQn --000000000000da13f506185fc6dc Content-Type: text/plain; charset="UTF-8" --000000000000da13f506185fc6dc Content-Type: text/html; charset="UTF-8"
--000000000000da13f506185fc6dc-- From nobody Tue May 14 04:04:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdjRn0fV5z5KJPp; Tue, 14 May 2024 04:04: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 4VdjRm5SSjz4Y1x; Tue, 14 May 2024 04:04:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715659492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MEp8+EeRXrW3q1/dEvNZ4tUrWwGuVH1TEZxN9yN1px0=; b=PVvC1cen+wwkVYlUMaMTifxA2xW1MgyKQMcoFFY44ytlQ8WfK34gAR+s3q+ZFYoagvFg9M tVZqn1r9WKgHB2Il1i67vlgrXSSN0viCH7MJjiAwo6WFuXWtHqPXYhs9VVp0Or9HEh97FT 9PwAROrnD6d2cOATQDwwi7KrC8QO1KBNUznV6qwVOhIXZLqS3pXfFMvw/DLzbbZadQ4DjZ Kjhd48BteXzn01cTt84wzNJsBLs5AZSc+JAvma3D1ti3JecN5Lg7AD3Iq0+tsCP3cyNgH3 3TBmivP1KO7dNUBVFjhd5VuKSyNa19kTfSvlBBMnNxE0pR+LJg5xNztGbo/6zg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715659492; a=rsa-sha256; cv=none; b=ZVrmLpTCfirfvj6epVgSf2qYbdyyAQlwKQ4Y1HHFwWAgb5W0Gl9B9NSRRf09oaOt6wPUEz b6v2Bpyt1CDaIDn75JRYLklNsnfcCzvxQpQw2llj0TMdAHo0KkFYD6sPrHzHc94Z9XfkEi GlEW2f03pMj4/C7m088vIy0sML1/zLfmcT71EAQnrJyt+bzQDfigKyhwVXjjeepn/Ztm4f LXOVWCWaCJdO8dXKkIMw4h5Rf7pYoSsXI583DNqvYaWKdDoUoVPTs/6vyVXf43XM0AcEZ2 wfTU3tbwIyFfIM173wvEROHcXLcccnoVVkb2uaMt4O759KG19E1uCeU4atgXKA== 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=1715659492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MEp8+EeRXrW3q1/dEvNZ4tUrWwGuVH1TEZxN9yN1px0=; b=O7Hm29jRSel7w7UiyYC7+WEj07nAaXo2ZcCBbOw5b5Z36WJiFssfJeHR7VJBb8wwL+ZHIr MpYmHmYyEUyEeatHlLP68AmyIq64aQIc6qgDvqk3ZWZ0GHLK6+CGfDh4/7AjoG0jdNMvXW yW4uglnI/QpEW9H/NHE6PzXtlpG3vMS/vTwQjYJs//Qp5jsKwRvTmhA6w37tzezbxnIfmW 6dxeCCfIFC8FW6ijsdYA1oMbLkcuZEPUxy2GIY663j2ro4LhWu1tcsY+tQ86D1WlJdGIWv iFI0ICBtQSGxzvCsdSeVLjbEqncnDzu115Ov90F/yua8SFbRjIXUYtt698atLw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdjRm4v40zGFm; Tue, 14 May 2024 04:04: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 44E44qDY018248; Tue, 14 May 2024 04:04:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44E44qhx018245; Tue, 14 May 2024 04:04:52 GMT (envelope-from git) Date: Tue, 14 May 2024 04:04:52 GMT Message-Id: <202405140404.44E44qhx018245@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: d9f1f0a90183 - main - boottrace: Use NULL for SYSINIT's last arg, which is a pointer type List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d9f1f0a901831ff960380fe82a2abe99a3721f87 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=d9f1f0a901831ff960380fe82a2abe99a3721f87 commit d9f1f0a901831ff960380fe82a2abe99a3721f87 Author: Zhenlei Huang AuthorDate: 2024-05-14 04:03:50 +0000 Commit: Zhenlei Huang CommitDate: 2024-05-14 04:03:50 +0000 boottrace: Use NULL for SYSINIT's last arg, which is a pointer type MFC after: 3 days --- sys/kern/kern_boottrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_boottrace.c b/sys/kern/kern_boottrace.c index 86fee4f47fbe..1b097e7378ad 100644 --- a/sys/kern/kern_boottrace.c +++ b/sys/kern/kern_boottrace.c @@ -613,4 +613,4 @@ boottrace_init(void) st.table = malloc(st.size * sizeof(struct bt_event), M_BOOTTRACE, M_WAITOK | M_ZERO); } -SYSINIT(boottrace, SI_SUB_CPU, SI_ORDER_ANY, boottrace_init, 0); +SYSINIT(boottrace, SI_SUB_CPU, SI_ORDER_ANY, boottrace_init, NULL); From nobody Tue May 14 04:17:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vdjk65wP2z5KKZc for ; Tue, 14 May 2024 04:17: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 4Vdjk63QTyz4Yk6; Tue, 14 May 2024 04:17:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715660238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H7I8DPEznHptHZar0j98sNA0bRyTw0AQK3S/qzmPW4o=; b=xUCaD11w/DJTXnv3TV82ruqnZHfd98B8KtWy4nrZBw1deAfxWlxrZPFpmKQGST5c8ED0Ax 2lx8M4gnJVNOZ8Rdn6I29UJez6tl5WbgS2QwCkYPbav9OrZoBSD0+ERDjKrQO5og8SAjTM skM5ThJ5/X6IN2De8PvDw6DpQZ4bts1XjUNlKdo+Hl2PmpXd6gUmt508aH9JGyJyVJmaPN i2x6n1uBOoxD4zzdFWxk0opGhDi8JJEt5vN8se+nIvksWG719NTHMkPuDkn1AfeKRvcuWG utC0y76ouLIKZAB0B4JXJXx6bimOpP99MoTODu1BorwFBCHLu5DX/rZ+nIUsCA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715660238; a=rsa-sha256; cv=none; b=qTvF2VAOU5pMNMzs8hWU4ET/whrJN21Bu0Tzj01j7D1KcbTLRppNT29x41q5ipyEr4ycv9 uwbBA1FhKoYHvHovHdsd4+0ardwqmb64iGUgz2lOj13cCwCUaUuOvwv1mzkYA2uHubPla4 lUrcyOPE8GkW2QLpl6QfBzUv7vSEUvn6HRt4rmciS3ZukhfO7fulmIhh+/r9MrekyVHglc 4NeEh6f6SIYcS/j1w0qB+DvEQk3xtriW+m8N888skycTnuaxoK3H78Ca5870hUcvnr/XzV kiwLjeZHEgFoUtm0vo76jAOF5nGSp9DLfEdADlqJGYjZ5NOk98b+bIWz441aaA== 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=1715660238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H7I8DPEznHptHZar0j98sNA0bRyTw0AQK3S/qzmPW4o=; b=haUOId8tp3abap5MFZguxyEy/OD3gyIesumwh1bwqoDFc+8KZQedoJOIvvQv9L+MzGqCu6 DbP49MXKODAoX6pN2NU5QmUXjSF2tZ0lUFmViwk2muG6hzSFnmKGfFlqociryvi4XLEb6k 0KqqXcISC5IafPQrncgYPD6KUXNH1twkb2dVyF/NGLtfoi3eV3v5Xvj4rqntojAgY3mcdt vG2z2jW6k9ephU8CKqYDIMdjTxlshwgrEggQby5U4A+y+vH04CNj9gWRT5zLKt14qKyB9g FPW9MClcCWZ2clxeyAt+JUbNXZM1qovckdJuYofO8ew5QN5/I/+R0Gg8cUAuww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vdjk62tdgzGZM; Tue, 14 May 2024 04:17: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 44E4HIK8034795; Tue, 14 May 2024 04:17:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44E4HIU5034794; Tue, 14 May 2024 04:17:18 GMT (envelope-from git) Date: Tue, 14 May 2024 04:17:18 GMT Message-Id: <202405140417.44E4HIU5034794@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: "Simon J. Gerraty" Subject: git: 28fffc9ccf78 - Create tag vendor/NetBSD/bmake/20240508 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/tags/vendor/NetBSD/bmake/20240508 X-Git-Reftype: annotated tag X-Git-Commit: 28fffc9ccf785708496d443fffab4e49cdd3c5c2 Auto-Submitted: auto-generated The annotated tag vendor/NetBSD/bmake/20240508 has been created by sjg: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/NetBSD/bmake/20240508 tag vendor/NetBSD/bmake/20240508 Tagger: Simon J. Gerraty TaggerDate: 2024-05-14 04:16:16 +0000 Tag bmake/20240508 commit 3c2ab5fddc576e58f3ffa70dc5fa95144646a513 Author: Simon J. Gerraty AuthorDate: 2024-05-14 04:13:22 +0000 Commit: Simon J. Gerraty CommitDate: 2024-05-14 04:13:22 +0000 Import bmake-20240508 Intersting/relevant changes since bmake-20240430 ChangeLog since bmake-20240430 2024-05-07 Simon J Gerraty * VERSION (_MAKE_VERSION): 20240508 Merge with NetBSD make, pick up o make: ensure variables set on command line get added to .MAKEOVERRIDES (even if they start with '.') so they are passed to sub-makes. mk/ChangeLog since bmake-20240430 2024-05-04 Simon J Gerraty * install-mk (MK_VERSION): 20240504 * dirdeps.mk: allow BUILD_DIRDEPS_OVERRIDES to pass overrides to sub-make building DIRDEPS_CACHE. From nobody Tue May 14 04:17:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vdjk66S4lz5KKYK for ; Tue, 14 May 2024 04:17: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 4Vdjk63KfNz4Yp5; Tue, 14 May 2024 04:17:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715660238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yCg8uiU6UW3J2DRUDtN0g2IMODggKx3RG6ytqVSVKi0=; b=LZRqABNGbpe/ht4oYD3rpzVvODcuBvOiLk6tqCrilo//kG6CeF4Ry5bcUfRwf5AUYH5IXk 9KiqIsRq+YZnnd4ZZv21B9OOh7UnLREjqG4qwFYyI5CWfTPX/aOL2D8tVfyogGrtdTGYY/ lvTNOu1yUS6Mospcfg9VnTZeSuHDpn9koC+S3n5UVnydQjrJCoXohwEuO8/Gmv+qTeEWti v+Bd6KbpE41wvPutsEvgHx7cZCdI1Je8pPMs6Lzotl6W9kN4tNJfX4l+qO/X1PyuwMG8B9 1aigIB5B5x32JUXah2sU04BuWEYF55tj+tuihjxV4WaanK6YeGR0izPITH+BcA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715660238; a=rsa-sha256; cv=none; b=BITZ4mXQZaFwtS8FeRq9RQ551xqhJtWkL1ZbwCQjosDcRObYB9SpTAOzDwQcKiGTiemIWa jzsbsKhDsKEJBlvPrxO3BwE17Ce8reJRspF1KXaHASfeCp8GnY7vgPK4wJxCrSd7eoVs7g otftT0F6sydPnWBZXdAGnI9OQJEgg2QrijGUu8Zf2okFnUyEhw5uDs7qk0gRIoA4IwcEyv XcoN9Zt61zxsWp1hXvbOK8e02oFBpeOviKJ6TrddLG04CunKsN6e84qnnV7siI2VjJpSjZ OP8K1rji0nCW54lnKjRkmTGxb+3mUnh7d/MEWd6Z5qnGZgGlL8nyr0/0edZH4g== 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=1715660238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yCg8uiU6UW3J2DRUDtN0g2IMODggKx3RG6ytqVSVKi0=; b=AUy5S4CHA0pBcoGwZQusyxPAs5mQJZeM/ezQfWcvcBeIHHc0tyymTuIEOtQvbetrwMR7d6 48aFH/D82OPVVgMgBzpPQQ4h4xpt3/PgCiNUoeAyW85OLaAf1ZTn4LTFqsmyog8Z+C8LNV hFOvu5yg+6S5ebtYBnlZpIOMaDzrgGgOfvkD7Z8G6hz/uE8Vm7xP+m8I8CBIhKSJPLyfQv EdTXWJGcMKrFVuD4N9P+xpRQHIhaU7mM05euck2qj7mr7EdH5qPmfuu9wvwTAU42g40K2K 1JvOmS+99dKORb4e3nHXtx52LZkylxmbCLC2lVcpP9dak8hmOLGCPGpiYRjIKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vdjk62WygzH60; Tue, 14 May 2024 04:17: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 44E4HIXO034776; Tue, 14 May 2024 04:17:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44E4HIO4034775; Tue, 14 May 2024 04:17:18 GMT (envelope-from git) Date: Tue, 14 May 2024 04:17:18 GMT Message-Id: <202405140417.44E4HIO4034775@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: "Simon J. Gerraty" Subject: git: 507951f55039..3c2ab5fddc57 - vendor/NetBSD/bmake - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/vendor/NetBSD/bmake X-Git-Reftype: branch X-Git-Commit: 3c2ab5fddc576e58f3ffa70dc5fa95144646a513 X-Git-Oldrev: 507951f55039f9d1ceae507d510f8cb68225fbc5 X-Git-Newrev: 3c2ab5fddc576e58f3ffa70dc5fa95144646a513 Auto-Submitted: auto-generated The branch vendor/NetBSD/bmake has been updated by sjg: URL: https://cgit.FreeBSD.org/src/log/?id=507951f55039..3c2ab5fddc57 3c2ab5fddc57 Import bmake-20240508 From nobody Tue May 14 04:24:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdjtB3f0zz5KLHk; Tue, 14 May 2024 04:24: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 4VdjtB1847z4bK1; Tue, 14 May 2024 04:24:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715660658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ae5ZSaP6FkD4Urv+y9cOcbRGVBeIt4z/b94bibNSrFg=; b=dqZwgl5SLWB2Bey252JMOXqd8cTo1lxSuPnh3BacVwg6HxW0P5ZmBStAPjMg/ZWtBXwXzv OTbfllwCo6yyAO3zQwHEAMYVC89yCTLueZ60S8ROJojw5Cf3d1QjKK8V0OfsdzxprYvUo0 yrpugoYK4bwFxc9zMbO7+/sHB60z/IIq+jacG/4cmvO0lVvd5kHiS+MaFs0jPxN7ynftAu fBULpb21rVvr5JQHgTag8HupttjMo/7Ijfm1UayD8qJniEiYjEmL/TZpT/c9PlpakllP8h FxEsagLUMTUmmrhKZGhCHkhY6ibmjiHYqMfdq7F1/vjT7E/imdUZ8FDu0OHNOw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715660658; a=rsa-sha256; cv=none; b=ClODODoZN0HlekCFCeROXyocZzgFRDVK6+K6Efit1ltnxa2jylHGmTyxWZ5Pp/x/iv9AYM eOrTb8gTFBzpXItpdxbPCRE0y7UzivmkBYdnEDkcR8iwO16T5kVndpze7aQqjwb1iv1lyR TNra5TotxcVQSpg2fv9uGVtEcJeAb5uPP2QOdNpxaTAQVqMcdtQyK1wGpuILhmYvVQlgM4 udaEckBkZcwLzWt2VA6YWy2PlpJlG7vjhIuMkCWH/Mkc33jo8dotxpVYZMrDVNI1TG+oZ2 AIGY9Do1BERQcUoxuzxXNYm+S2c/JxodFur+BSctbdZephDV0aIi/ctlBNKYPA== 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=1715660658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ae5ZSaP6FkD4Urv+y9cOcbRGVBeIt4z/b94bibNSrFg=; b=OmTxM9mFaZ6npv4gvsZBwLUwAnby7UAgKI7RzdkfOza3bZtYtij+0ibPMhQ74DtKx7y2W7 qPLEAg47wn5UL4n8sKq7VVIokpHC21WvmAc2hLtgRnYQ27wzkrgHNl1ORx7JxO2b6RcpRt 8hAloxeZ8mV9TiYje8nj1kN2Zz4HWYIXArOyz0xQV4Fxa1vx+JR5xDqMJQ8Ur/xfOlscBD fzv3IeH+H74RQv1spIEtjlQwjH3csYqH8IfmXDvDW4Se79Uf25mZkErK12imZGzzwv2f+V iNiLt16YKm0B+DsRojbANaTWD2lLC0cEv43AVPV1hSOomyJhAQF8ybOXk0mQDg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdjtB0ly3zGtG; Tue, 14 May 2024 04:24: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 44E4OI5F051111; Tue, 14 May 2024 04:24:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44E4OHm8051108; Tue, 14 May 2024 04:24:17 GMT (envelope-from git) Date: Tue, 14 May 2024 04:24:17 GMT Message-Id: <202405140424.44E4OHm8051108@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: b5a1f0406b9d - main - arm64_pmap: narrow scope of bti_same test List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b5a1f0406b9d6bba28e57377dcfc8b83bce987ad Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=b5a1f0406b9d6bba28e57377dcfc8b83bce987ad commit b5a1f0406b9d6bba28e57377dcfc8b83bce987ad Author: Doug Moore AuthorDate: 2024-05-14 04:22:52 +0000 Commit: Doug Moore CommitDate: 2024-05-14 04:22:52 +0000 arm64_pmap: narrow scope of bti_same test The pmap_bti_same test in pmap_enter_l3c only happens in the !ADDR_IS_KERNEL case; in the other case, a KASSERT fails. So move the test into that case to save a bit of time when ADDR_IS_KERNEL. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D45160 --- sys/arm64/arm64/pmap.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 7780c6ec8767..a6056a5edfc2 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -5662,6 +5662,19 @@ retry: } } l3p = (pt_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(*ml3p)); + +have_l3p: + /* + * If bti is not the same for the whole L3C range, return + * failure and let vm_fault() cope. Check after L3 allocation, + * since it could sleep. + */ + if (!pmap_bti_same(pmap, va, va + L3C_SIZE)) { + (*ml3p)->ref_count -= L3C_ENTRIES - 1; + pmap_abort_ptp(pmap, va, *ml3p); + *ml3p = NULL; + return (KERN_PROTECTION_FAILURE); + } } else { *ml3p = NULL; @@ -5684,22 +5697,8 @@ retry: pmap_load(pde))); } } -have_l3p: l3p = &l3p[pmap_l3_index(va)]; - /* - * If bti is not the same for the whole L3C range, return failure - * and let vm_fault() cope. Check after L3 allocation, since - * it could sleep. - */ - if (!pmap_bti_same(pmap, va, va + L3C_SIZE)) { - KASSERT(*ml3p != NULL, ("pmap_enter_l3c: missing L3 PTP")); - (*ml3p)->ref_count -= L3C_ENTRIES - 1; - pmap_abort_ptp(pmap, va, *ml3p); - *ml3p = NULL; - return (KERN_PROTECTION_FAILURE); - } - /* * If there are existing mappings, either abort or remove them. */ From nobody Tue May 14 05:22:41 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vdl9g4KPgz5KQbG; Tue, 14 May 2024 05:22: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 4Vdl9g3Ts8z4g3J; Tue, 14 May 2024 05:22:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715664167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LoQvnNCZ0BIvlFrW6U8Kc/gfiwEEL8N8l/qriV/qzF0=; b=jD5KUXfj5DpsVwfBk4PEMGavXaTx4u6A9fC3FjuJBRNwvUnXN3EFLq8BM+3huHfnQDDX8K RGK0HNyvV/3w0DShGAUI82fDFpB8B7mpvKzGNepWQY08OvZx0/AMcdY7D87Rfplnc0UAuC hxKDF3SiviGauv3UPcHzbMkFo7qKKPy1Thb8/uHfCx6UNFVY37alfC+Jrvswq/JC8Ooptn nzg1E+RB419WU5tlecIoR/wTNpBKHL+Wo9RBWtymyYM/oNvix9uWch2F0AVsPm8i2YbMvN fIRt0M5uRyfvyKQXpVsdhHdopkxbVAThjRRxZwOf4kuRNRQCiqt3dPFsWEE8sA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715664167; a=rsa-sha256; cv=none; b=ggxiq+METaIWKzEeZpcGINZgJguYzMbs1UZmqT8Bob5h8rWdEt/whmBHygnyJ05E8CP6yG ijMyOPc4eYf62Djc13djpOQ5t670BPEvhrbEZDESy7Cp8tnwhiXciBzF+4/skO5YHJGVUM HQWkjcE6ksDTrjgez89YGzMGSgdyowsDhTptCAjpQoTMCoqAw4tO0D1cVjK4aRcZSdg1Ez tzW8FAbmUTUu9G3Dh6U4cTGvicManWJ54hPj2wmsFr49DLy2ahBjB1ZmlPabsYRcLNdMsJ mVeaORDub6k9nAIUX1NxcWrk1rjOMfIwmo1E/ZOsWzStjYx7e71ATkbjVji6NQ== 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=1715664167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LoQvnNCZ0BIvlFrW6U8Kc/gfiwEEL8N8l/qriV/qzF0=; b=U4W/GbM36bPy9p+KGU4HmOgFmcF4TtHomJEFhSCZ/UZRHbygBb6S51xcqFTIjUL+fGK9cX uPMmOOZ20IFn0nGH6jj///uDxOIhtiO9kLx7od2uH8ugEi3waajmjig4ZhdnS/dXbBTKQr YBEFnIjpebetvnjYsPIwcgd/RCJZIKl4MzkgDZ8hV0xyHjLIYxrs5/9+xgOe+FstpJxTiG UUOC/cjbGvs5TV1N3/PZ8QHt9p1O+nMBPV8Sxdz7zofVxFTjNEPqpLyXUTOIh4TlSoNF/9 7V+MYiJ17k4mCvitkghdAHSthaiphAyi7XSbIlfwsORDSdm8FZu1G74uyaaaZQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vdl9g35v1zJCt; Tue, 14 May 2024 05:22: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 44E5Mlf3052727; Tue, 14 May 2024 05:22:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44E5MfWe052718; Tue, 14 May 2024 05:22:41 GMT (envelope-from git) Date: Tue, 14 May 2024 05:22:41 GMT Message-Id: <202405140522.44E5MfWe052718@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Simon J. Gerraty" Subject: git: c9f4001f81c4 - main - Merge bmake-20240508 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c9f4001f81c4d5778f70f77dc9892d1c4ecfdcdb Auto-Submitted: auto-generated The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=c9f4001f81c4d5778f70f77dc9892d1c4ecfdcdb commit c9f4001f81c4d5778f70f77dc9892d1c4ecfdcdb Merge: b5a1f0406b9d 3c2ab5fddc57 Author: Simon J. Gerraty AuthorDate: 2024-05-14 05:17:23 +0000 Commit: Simon J. Gerraty CommitDate: 2024-05-14 05:19:20 +0000 Merge bmake-20240508 Merge commit '3c2ab5fddc576e58f3ffa70dc5fa95144646a513' contrib/bmake/ChangeLog | 8 ++++++++ contrib/bmake/VERSION | 2 +- contrib/bmake/job.c | 7 ++++--- contrib/bmake/main.c | 6 +++--- contrib/bmake/make.h | 5 +++-- contrib/bmake/mk/ChangeLog | 7 +++++++ contrib/bmake/mk/dirdeps.mk | 7 +++++-- contrib/bmake/mk/install-mk | 4 ++-- contrib/bmake/unit-tests/opt-debug-graph1.exp | 2 +- contrib/bmake/unit-tests/opt-debug-graph2.exp | 2 +- contrib/bmake/unit-tests/opt-debug-graph3.exp | 2 +- contrib/bmake/unit-tests/suff-main-several.exp | 2 +- contrib/bmake/unit-tests/suff-transform-debug.exp | 2 +- contrib/bmake/unit-tests/varname-dot-makeoverrides.exp | 6 +++--- contrib/bmake/unit-tests/varname-dot-makeoverrides.mk | 4 ++-- contrib/bmake/var.c | 17 +++++++---------- usr.bin/bmake/Makefile.config | 2 +- 17 files changed, 51 insertions(+), 34 deletions(-) diff --cc contrib/bmake/mk/install-mk index 97874ac49016,c2962ffee6dc..c2962ffee6dc mode 100755,100644..100644 --- a/contrib/bmake/mk/install-mk +++ b/contrib/bmake/mk/install-mk diff --cc usr.bin/bmake/Makefile.config index ee717d952846,000000000000..55bc4a4370ca mode 100644,000000..100644 --- a/usr.bin/bmake/Makefile.config +++ b/usr.bin/bmake/Makefile.config @@@ -1,28 -1,0 +1,28 @@@ +# This is a generated file, do NOT edit! +# See contrib/bmake/bsd.after-import.mk +# + +SRCTOP?= ${.CURDIR:H:H} + +# things set by configure + - _MAKE_VERSION?=20240430 ++_MAKE_VERSION?=20240508 + +prefix?= /usr +srcdir= ${SRCTOP}/contrib/bmake +CC?= cc +MAKE_OS?= +DEFAULT_SYS_PATH?= .../share/mk:/usr/share/mk + +EGREP = egrep +CPPFLAGS+= +CFLAGS+= ${CPPFLAGS} -DHAVE_CONFIG_H +LDFLAGS+= +LIBOBJS+= ${LIBOBJDIR}stresep$U.o +LDADD+= +USE_META?= yes +USE_FILEMON?= dev +FILEMON_H?= /usr/include/dev/filemon/filemon.h +BMAKE_PATH_MAX?= 1024 +# used if MAXPATHLEN not defined +CPPFLAGS+= -DBMAKE_PATH_MAX=${BMAKE_PATH_MAX} From nobody Tue May 14 06:43:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vdmyp1Dm9z5KXc2; Tue, 14 May 2024 06:43:30 +0000 (UTC) (envelope-from des@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vdmyn6tSdz4mmk; Tue, 14 May 2024 06:43:29 +0000 (UTC) (envelope-from des@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715669010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Bl41G+fu2AQgGr5bhPmTJbVyr41CrCkuN7HrUiRK0go=; b=gzzEdWAl67GseRwPOA+vHg+VRzqiqExBgiYSKTHT5nhf6mABymEoUpJNTL9Gz2On31cAF8 3V3mjfyH/w/d/iOxoEI7PxtyinYkWgMU+WXy1QY0pe7eyYNevujGkJ8hr04q0ytHuM3mrw LbTBB/pzc27WB5Nr0GlH1K5H6XK9DnQv4IM8ATXxcBIr9ZOVB1y8JX0BGG5+qIibsxw3IP zQYn0dH9qNs7524WQZLNK1Xgk3tpKj43S5g6xMsLLUoHf5XSw7TlBspNX9YURrCc+IEOK/ /Lj4sjlJRGm2qzKwyQiw1NiSqfVP6SmKP7BXpMZC0GFhQZY5yzigxe8xMtIuGQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715669010; a=rsa-sha256; cv=none; b=lgYGxOEhC2U1n+eJ+43P67wERV3MnzJ3ZHTSm01mFtE3MndpMFI40PRm355oM0zIzgwNJj yQ+jCEP3gS3fkqR8hiEqlFURdF0K3tTAE/8IhBCW2LVeCKlzee96t6sOg6Hu1k5ZKz4qgp BqV9KD42pM6DhU+BRXsy4LKAI3rYHnjRtSdAvMv/p1tqxsyjNNBOYVDD6yko0rOaRTrA// efGP5Y5kqzw4fJpBGDK/HADmEiFbmWMAduFvgzV6w3j2XI2+x9cvfmiY6RueFsb2ZXa3lz B0W2CFXiPsZTZ//aVdB+VSKIMFEXZXgp/axGtl5hLDjJ0Yhxvm4vaPSkhvIxcQ== 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=1715669010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Bl41G+fu2AQgGr5bhPmTJbVyr41CrCkuN7HrUiRK0go=; b=pjHjXPSL/KMir7B/p8t+O4u0plVG8gy6IPmwKJdi4QWQH6QSMyZRzElDkNxjm82V5AFiI+ 3kcnhZygcTWiKbv6izWlIzcYfS2J6gAxUQeOEEDOyz5cyctFlT78NIb2J6/L35bqvP632+ DlfyHGMIOmW+Wc+AE+4xR6XjqcsskgfGyJM9VeSBGpVGc3ZY9niuUztvcnxTBDE2vd9L3W 04Z/AelqtISe+x0aruKZdiy53+d4mteaXJqMf7D7SetTEs44vj8jL2nubMbqoyIxtIzGeh Hdt3Leubxc1BsC79jR5SUDCKZ4WoSwAS6frrp8/GM/UL0/eO+kGNXvrhTSLGvA== Received: from ltc.des.dev (2a02-8428-0993-f001-922e-16ff-fef1-acef.rev.sfr.net [IPv6:2a02:8428:993:f001:922e:16ff:fef1:acef]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: des) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Vdmyn5nBFzZ2M; Tue, 14 May 2024 06:43:29 +0000 (UTC) (envelope-from des@freebsd.org) Received: by ltc.des.dev (Postfix, from userid 1001) id 111F11529F; Tue, 14 May 2024 08:43:27 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Gordon Bergling Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 421025a274fb - main - access.2: Mention that lstat(2) should be used for symbolic links In-Reply-To: <202405130840.44D8eXdL014138@gitrepo.freebsd.org> (Gordon Bergling's message of "Mon, 13 May 2024 08:40:33 GMT") References: <202405130840.44D8eXdL014138@gitrepo.freebsd.org> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Tue, 14 May 2024 08:43:27 +0200 Message-ID: <86le4czyeo.fsf@ltc.des.dev> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Gordon Bergling writes: > commit 421025a274fb5759b3ecc8bdb30b24db830b45ae > Author: Gordon Bergling > AuthorDate: 2024-05-13 08:40:12 +0000 > Commit: Gordon Bergling > CommitDate: 2024-05-13 08:40:12 +0000 > > access.2: Mention that lstat(2) should be used for symbolic links >=20=20=20=20=20 > access(), eaccess() and faccessat() will always dereference > symbolic links. >=20=20=20=20=20 > So add a note in the manual page, that lstat(2) should be > used in the case of symbolic links. Please revert. This is pointless. The purpose of `access()` is to (try to) tell you what would happen if you tried to `open()` a given path, and there is no way to `open()` a symlink without dereferencing it, so this addition answers a question that nobody is asking. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@FreeBSD.org From nobody Tue May 14 06:52:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vdn9108plz5KYBs; Tue, 14 May 2024 06:52: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 4Vdn904qhCz4nRL; Tue, 14 May 2024 06:52:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715669540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ulg/yX1ptCor4pJIsMAXU/6b/sER5hiEJWdqFM8Ym8E=; b=Sg/SMsBwGxJSW0iCe6NJYb+42lM4h/cScTUEBFkBbZGPPZf6GK9l4BrZVnbBibawyXQCnq fLigcnBDRwClDu62jONvbWPie3bMs969yUo1ZbCDotdcpf4zXcKwnZDAILJNuXy/C0OzMu pVglFjkVhrWlDDpKtS38g4NI1pvNoXq4WbLTECsX5Z0z2EC8ETHDewj0W+v4qyoPM2Mh27 vApF7hzeVn3ROh3MIJ7N3R+OYP0eishV4S6z1g3Avf5C/tF9TuK4x8krn/5KwgUebO44RF 835a5K1UfvxrZf4S4soVBnxGW35lpg1Ibwr49pdH/+ur89cK931Q27Nc+uw0/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715669540; a=rsa-sha256; cv=none; b=jJ3ZGH5gAy8124Oo6IYl4sbMh3irno5NKhio3Dwsyjo+4AjoZRvcOpj8/xWs/WFkv9YZby F8JXsarr2DJDrD5XFRfjfF9Kbl0mj0yKnMHLsra8PzMB1sHQj7AC230X8yYQM/BrFnzvfB TBhTYr+VUtmY1gTnjrt+0Cj87U24DD0XbwcLUSllvQihftj/86y5KcVjRgW3n6t6zqM5s0 tyiIxLcfNcobMBTT8jtV94Pmb+U9G/k1i/LmtXCaw3w8pPLIvN3tFFKfk1qfV5wYIVcFIa M0qf21dH/Ybp+gCM8UpJB3XEdl/y7V9Nl7UHK6xhynaRRwj0a/cRQp9p4vHVEg== 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=1715669540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ulg/yX1ptCor4pJIsMAXU/6b/sER5hiEJWdqFM8Ym8E=; b=qjluY5RqdS9OvMfEB2kfcCOkEAcjmaaghYwGuNiFb/2A4di8pDrtLfx4mNxYOZjeo9xoOo jbON2DV6x/5YqZChMKNb7gTR1qObQzBOi5cGZK6Ke8a6+XUEs16KVCn/nW9YBkerSpAjMX LpcQDR/WwSVj5/Gc+bWt6TnOm0X7QQ4xrrimI7zi5+zxP0pl0ZWr+Jivp5kg7AElDwZ05G 7Mdc077D5MjG0M626Mqg3lyZMQl4B7RkClbpLMeEJtJCGk9UnEbxcAItpaQVTaYLR1XBNx bhPW99XqMM8NMl8bNk6k5wWNnW0KXjDOfmk0a1Q3FKeKBm3nxg0+ZLSBfx5m+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 4Vdn904PrLzMGs; Tue, 14 May 2024 06:52: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 44E6qKXG002573; Tue, 14 May 2024 06:52:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44E6qK5I002569; Tue, 14 May 2024 06:52:20 GMT (envelope-from git) Date: Tue, 14 May 2024 06:52:20 GMT Message-Id: <202405140652.44E6qK5I002569@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 847ef59d4b5e - main - ifconfig: Add format shortcuts. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 847ef59d4b5eab234bd1f8eb947ad74bdab5614e Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=847ef59d4b5eab234bd1f8eb947ad74bdab5614e commit 847ef59d4b5eab234bd1f8eb947ad74bdab5614e Author: Dag-Erling Smørgrav AuthorDate: 2024-05-14 06:51:42 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-14 06:51:50 +0000 ifconfig: Add format shortcuts. MFC after: 1 week Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D45166 --- sbin/ifconfig/ifconfig.8 | 14 ++++++++++++-- sbin/ifconfig/ifconfig.c | 42 +++++++++++++++++++++++++----------------- 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 index 99a4cf8c9751..72f4883a9e26 100644 --- a/sbin/ifconfig/ifconfig.8 +++ b/sbin/ifconfig/ifconfig.8 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 1, 2024 +.Dd May 12, 2024 .Dt IFCONFIG 8 .Os .Sh NAME @@ -135,7 +135,7 @@ and their associated .Ar format strings are: .Pp -.Bl -tag -width ether +.Bl -tag -width default .It Cm addr Adjust the display of inet and inet6 addresses: .Pp @@ -200,6 +200,16 @@ Integer format, for example: .Ql prefixlen 64 .El .El +.Pp +In addition, the following shortcuts are accepted: +.Bl -tag -width default +.It Cm default +Resets all formats to their default values. +.It Cm cidr +Shortcut notation for +.Cm inet:cidr,inet6:cidr . +.El +.Pp .It Fl G Ar groupname Exclude members of the specified .Ar groupname diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 2cbe7a881bd0..a8bd5a0c89db 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -313,14 +313,10 @@ cmpifaddrs(struct ifaddrs *a, struct ifaddrs *b, struct ifa_queue *q) static void freeformat(void) { - if (f_inet != NULL) - free(f_inet); - if (f_inet6 != NULL) - free(f_inet6); - if (f_ether != NULL) - free(f_ether); - if (f_addr != NULL) - free(f_addr); + free(f_inet); + free(f_inet6); + free(f_ether); + free(f_addr); } static void setformat(char *input) @@ -330,9 +326,18 @@ static void setformat(char *input) formatstr = strdup(input); while ((category = strsep(&formatstr, ",")) != NULL) { modifier = strchr(category, ':'); - if (modifier == NULL || modifier[1] == '\0') { - warnx("Skipping invalid format specification: %s\n", - category); + if (modifier == NULL) { + if (strcmp(category, "default") == 0) { + freeformat(); + } else if (strcmp(category, "cidr") == 0) { + free(f_inet); + f_inet = strdup(category); + free(f_inet6); + f_inet6 = strdup(category); + } else { + warnx("Skipping invalid format: %s\n", + category); + } continue; } @@ -340,14 +345,19 @@ static void setformat(char *input) modifier[0] = '\0'; modifier++; - if (strcmp(category, "addr") == 0) + if (strcmp(category, "addr") == 0) { + free(f_addr); f_addr = strdup(modifier); - else if (strcmp(category, "ether") == 0) + } else if (strcmp(category, "ether") == 0) { + free(f_ether); f_ether = strdup(modifier); - else if (strcmp(category, "inet") == 0) + } else if (strcmp(category, "inet") == 0) { + free(f_inet); f_inet = strdup(modifier); - else if (strcmp(category, "inet6") == 0) + } else if (strcmp(category, "inet6") == 0) { + free(f_inet6); f_inet6 = strdup(modifier); + } } free(formatstr); } @@ -612,8 +622,6 @@ main(int ac, char *av[]) .io_s = -1, }; - f_inet = f_inet6 = f_ether = f_addr = NULL; - lifh = ifconfig_open(); if (lifh == NULL) err(EXIT_FAILURE, "ifconfig_open"); From nobody Tue May 14 06:55:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdnDX0N8lz5KY0g; Tue, 14 May 2024 06:55:24 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VdnDW60NYz4pHh; Tue, 14 May 2024 06:55:23 +0000 (UTC) (envelope-from bapt@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715669723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JeLu9XAc2tZMxfUuKHZFcnVPTaFz0z7nfJbB596FCjI=; b=hqFZu7sV3l5mjEWN+jdytBmxsGxIMJLe0mTnJpDAguc3hmIOrv3J4B57/8n7t8MNntKaYZ aLsn3GJA5K+3d5fCX1LK/nhdHrKRHUTzchqqf6Q7+RLgXAne8AgdBygAY1Hzkuhp7ycclu tHl4gkpocnkzXWxQ9m+zEOZVvPmHZ5BGaMiismmqdMS8hHkY8s4OPpPx7tRXLBWNhbZD7y XQwlD04JePtZ7lbBd8rmq5giYpfyf48VmqPCgRHMkiktz6ZEKEji88/rOrazL7fx7Vg6lm JijWHOX926BSzFt5d6Jy3cICxyUteRoG7zzlTnDV8yQ78RXlt3Hjj8KcSMsHFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715669723; a=rsa-sha256; cv=none; b=f3Av32KXX2KOYmGjdu+SwvqYOJwCNHaoY2Hrd4m0xiwFYtqG12i+JaCCci+dtzYGOMwcF6 yfnLEkA5aq3FnJW8aJR2DaIisg1bVOjKlpfiMb5rxn5cupqmW9QWhrsBO2TZ5LEIS6X+DI dh2ruXjdJah3n6kPgft1wLd0JwSZQGznvlPtmZZ4Wqrc48azXvG6xAJMSX4/RE7K+JwnM1 ysuVc7f04fWXbdeH57wU2tRzv3pIpN10sTZU5z2d1yTeAPv/kTDqzwi6pRgm461SopdlUl xOzaGEE7oZd9Bs+8kpOAYSt/APcRXv88x2JYWiIeeZ8rFua0MxIRLAG0cI1HRg== 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=1715669723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JeLu9XAc2tZMxfUuKHZFcnVPTaFz0z7nfJbB596FCjI=; b=Mefl+CcU9WmZV0xiLYA9VUbphFsCL5ND05RiYp/XCt9HceNIQwHnwrK5Lg0AAi69qLzJWs e5JSx1CQ3hOPyL2lXlFcx8Qm0zhVRvT8FRy9yhjvCrcIg9NyygQv9UpNXh+anVvGBZhZmc oySq0o1vabGFVBs0VPbXOgA4ZXrLoW4WJfX5RNLYIh9UdiCAlAzusxhhoNCaXxhKAGqRxz odbV6UYw54Yb73if9OtRy+a0PVPUALwoePKBot+f2LkB/mXsTELqcrNvZLzgCh2HYaiabE MQpC/56ZMI4JajCoAFPGMH2KhwPxiqp7NAuVjetVyumXkgJn0aSxi3SOUixa8w== Received: from aniel.nours.eu (nours.eu [IPv6:2001:41d0:8:3a4d::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 4VdnDW4w8MzbgL; Tue, 14 May 2024 06:55:23 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: by aniel.nours.eu (Postfix, from userid 1001) id 6237D6FBB7; Tue, 14 May 2024 08:55:21 +0200 (CEST) Date: Tue, 14 May 2024 08:55:21 +0200 From: Baptiste Daroussin To: Joseph Mingrone Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 27358245644c - main - freebsd-tips: Add fortune to find font providing Unicode character Message-ID: <4bocuyegvknxvo3rjxnwdkdsx3qwx7nsra3hgyrznk53b4ah5c@rvhtufyftkqi> References: <202405132302.44DN2NX6009088@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202405132302.44DN2NX6009088@gitrepo.freebsd.org> On Mon 13 May 23:02, Joseph Mingrone wrote: > The branch main has been updated by jrm: > > URL: https://cgit.FreeBSD.org/src/commit/?id=27358245644c2a8bf2b57182e2fcd8cdf18d6b8d > > commit 27358245644c2a8bf2b57182e2fcd8cdf18d6b8d > Author: Joseph Mingrone > AuthorDate: 2024-05-13 18:38:13 +0000 > Commit: Joseph Mingrone > CommitDate: 2024-05-13 23:02:17 +0000 > > freebsd-tips: Add fortune to find font providing Unicode character > > Reviewed by: emaste > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D45183 > --- > usr.bin/fortune/datfiles/freebsd-tips | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/usr.bin/fortune/datfiles/freebsd-tips b/usr.bin/fortune/datfiles/freebsd-tips > index 028a9e9b1430..e24d3640b8c6 100644 > --- a/usr.bin/fortune/datfiles/freebsd-tips > +++ b/usr.bin/fortune/datfiles/freebsd-tips > @@ -845,3 +845,17 @@ kern.tty_info_kstacks to 0 (off), 1 (on), or 2 (verbose), e.g.: > > -- Michael Gmelin > % > + > +Under X Windows, you can determine which fonts provide a particular Unicode > +character using fc-list from the fontconfig package. For example, if your > +friend complains that the emoji you sent won't display, run fc-list with the hex > +value of the character to determine which font your friend should install. This has nothing to do with X window, it is valid for anything that can use fontconfig, which does not include xorg, but the toolkits or the libraries which needs to deal with fonts, for instance many non "X windows" applications, depends on fontconfig and this tips is valide for them, for example for libraries producing podofo or poppler can use fontconfig to decide which font to embeded in the pdf document. In my opinion the "Under X Windows" should be removed from this tips. Best regards, Bapt From nobody Tue May 14 06:59:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdnJp4jr1z5KYhX; Tue, 14 May 2024 06:59:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VdnJp1fh7z4pnK; Tue, 14 May 2024 06:59:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715669946; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XX0+mycv8u/HubkMz+obiKh5v6rxUhBD04OCzzvkaGo=; b=CUv7t/9McSfpbxqcEcxugiTf9a72oz2OK2zYQlPLQNc11DpLbQlDiTPavGy2jo28f5Xyd3 RKRyfxrKBeYP2sAocqnwchnLeIa1kvz/M76M/oWAai44T/i7S0u/fmeQ+QygoQX3FEFavn xkPFOHfFNEjkkgDuAoDGeNUWxe2FQ+BP6ldyf5zBiRPBJFrK4bkktTESsgbt+0I5nqpNnm vCIcPX6NU3Wr3C1TcpYrMOe13SNrCTkLVswMRoYUxOOw7qLdjdqtQ13CG6kWj3Efcq4YPX M3VQeZq0wkfJ4T/PTRAaVGSXOJvLQ7DyaTQU46/oiuK8+l1uQ1Qpb7oOoBeNyg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715669946; a=rsa-sha256; cv=none; b=BIwLlr6rCk+/LUavAeUcPBVjmCWezhsIWCuazS+PKzmokGkGYduNTVPOj+ZaMf7E/dgvz5 GcfNcRhfFu+syrvj9olIElbyu986dTkn8srwKHKH9sXsqk11pip3ocbbv3NQdQpam5BWeT 4oSU00gHPjUeJ4SphfOv8WwU++jicOGhjqVSsRi9qSNb2KZZN7PqiX27qyHkIApVseVeu3 h0PALav1j6J27dbcIlQKAoUVzOaif687iLZ6uLtnOfL8JxsLuJl/YnhZv73oWFL0rjax9R Mgxk0sWmDHgq58UsXYuyqvxaDFh1OclAQrk/2U8ZfJEz/SVr6/j+d4skntEXIA== 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=1715669946; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XX0+mycv8u/HubkMz+obiKh5v6rxUhBD04OCzzvkaGo=; b=SD/AnHPHoafBXPXr/dJWORNnAaUsQ+ocapK7CfeEFPRtC5upDHvTW1MGImaaoyLoB7+o0a Aznz5gN42iTSYuOoDQ8JfUUrDaZrTuyiUeosGIIYJl01Rubp9FZVwlMWlXQuuNyxZj11zX CpNAElFKL8atMOBtseCwP8p0cc9IhVyritL7bMCQkJkYMn9YhLxlqQ4CQJftXc/qwmTU/M yVUMIpnshVjX8e0OERghxmCeVwRUkVIECgitYRQW64mx/Ng2GGJwicsdSmpsGdULcT9Q8W osoHuRs0B8CUGQRHQbQdXwZ4WRl9AMt6YcicxHfhg+cgcMn/kHO6EDt/E8KwHQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdnJp17HCzM0Y; Tue, 14 May 2024 06:59:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44E6x635004696; Tue, 14 May 2024 06:59:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44E6x6oZ004693; Tue, 14 May 2024 06:59:06 GMT (envelope-from git) Date: Tue, 14 May 2024 06:59:06 GMT Message-Id: <202405140659.44E6x6oZ004693@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: cd7dc8deefbc - stable/14 - Add man page for nfslockd. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cd7dc8deefbce5dc3b5aaab611bbee7af6eccf62 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=cd7dc8deefbce5dc3b5aaab611bbee7af6eccf62 commit cd7dc8deefbce5dc3b5aaab611bbee7af6eccf62 Author: Dag-Erling Smørgrav AuthorDate: 2024-05-10 09:23:13 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-14 06:58:40 +0000 Add man page for nfslockd. PR: 130238 MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D45139 (cherry picked from commit 44e72c6e2e6bcfa2cba89afb92fa05f6ac4d5660) --- share/man/man4/Makefile | 1 + share/man/man4/nfslockd.4 | 45 ++++++++++++++++++++++++++++++++++++++++++ usr.sbin/rpc.lockd/lockd.c | 3 ++- usr.sbin/rpc.lockd/rpc.lockd.8 | 5 +++-- 4 files changed, 51 insertions(+), 3 deletions(-) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index a2d544034005..222422526180 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -342,6 +342,7 @@ MAN= aac.4 \ netlink.4 \ netmap.4 \ ${_nfe.4} \ + nfslockd.4 \ ${_nfsmb.4} \ ng_async.4 \ ng_bpf.4 \ diff --git a/share/man/man4/nfslockd.4 b/share/man/man4/nfslockd.4 new file mode 100644 index 000000000000..770d9b8736b0 --- /dev/null +++ b/share/man/man4/nfslockd.4 @@ -0,0 +1,45 @@ +.\"- +.\" Copyright (c) 2024 Dag-Erling Smørgrav +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.Dd May 8, 2024 +.Dt NFSLOCKD 4 +.Os +.Sh NAME +.Nm nfslockd +.Nd NFS advisory locking +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines in +your kernel configuration file: +.Bd -ragged -offset indent +.Cd "options NFSLOCKD" +.Ed +.Pp +Alternatively, to load the driver as a module at boot time, place the +following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +nfslockd_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides kernel support for NFSv3 advisory locking. +It works in tandem with +.Xr rpc.lockd 8 , +which will normally load it on startup if it is not already loaded or +compiled-in. +.Sh SEE ALSO +.Xr rpc.lockd 8 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 6.4 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Doug Rabson Aq Mt dfr@FreeBSD.org . diff --git a/usr.sbin/rpc.lockd/lockd.c b/usr.sbin/rpc.lockd/lockd.c index 7e0652d26533..0ac7ddfeea5c 100644 --- a/usr.sbin/rpc.lockd/lockd.c +++ b/usr.sbin/rpc.lockd/lockd.c @@ -188,7 +188,8 @@ main(int argc, char **argv) kernel_lockd_client = FALSE; if (modfind("nfslockd") < 0) { if (kldload("nfslockd") < 0) { - fprintf(stderr, "Can't find or load kernel support for rpc.lockd - using non-kernel implementation\n"); + fprintf(stderr, "Unable to load nfslockd(4), " + "using userland implementation\n"); } else { kernel_lockd = TRUE; } diff --git a/usr.sbin/rpc.lockd/rpc.lockd.8 b/usr.sbin/rpc.lockd/rpc.lockd.8 index 89f55087901d..89592a1cceaf 100644 --- a/usr.sbin/rpc.lockd/rpc.lockd.8 +++ b/usr.sbin/rpc.lockd/rpc.lockd.8 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 21, 2019 +.Dd May 8, 2024 .Dt RPC.LOCKD 8 .Os .Sh NAME @@ -44,7 +44,7 @@ The .Nm utility provides monitored and unmonitored file and record locking services -in an NFS environment. +in an NFSv3 environment. To monitor the status of hosts requesting locks, the locking daemon typically operates in conjunction with @@ -137,6 +137,7 @@ RPC protocol specification for the network lock manager protocol. .El .Sh SEE ALSO .Xr syslog 3 , +.Xr nfslockd 4 , .Xr rc.conf 5 , .Xr rpc.statd 8 .Sh STANDARDS From nobody Tue May 14 06:59:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdnJq48RLz5KYWJ; Tue, 14 May 2024 06:59: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 4VdnJq2bkpz4pf4; Tue, 14 May 2024 06:59:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715669947; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oW5/RTarpmd10q3VAfcMoRK8mW1UCO9PQjeM2hYss3s=; b=K1cANQ07LBtwuZgPDtvGF3Sj100y4T6MtkAw9UylOtn+xS+H3i5nUutMYkcJ0rQZ+2EnNI rHaEoZvbBZTY3GbXdgFHHeWHi5DI8a50AQmLZ/pQ9cZWavUTs+ObCBaXy2vvcZhiLXv0J9 UoiX0MdDwPu1ee2btNr+x+ueEfIQckQEA0l4Js4+VjB2hrha+N4JW5Dy993Na1+Vo6i1nX RqRipHwLRumMKWGFvaNcqRq3K3l4l7VWYb6PFZzxGwB9ppsqk7nElPNJ4riHkmZAzV6BRP VZ8AMQLkLpxu+WVT3QE+9GKoDPSikwJAVab+45Sp1Nv8MPwGyzZvxWjsvo1DQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715669947; a=rsa-sha256; cv=none; b=TGmjj5B7hrj4R4FfxLOJecwtKyclHRfsDKBJ9gz4HYz8Di4pCxgTbKMUGtSIN37h5HgU1M bVmqf415gdCbww+C9UyXlhoCHdEukB76R+GXvcJyJBfYdi7+kcD+AJKR4osVYg8XffQwli KXwa1CFCMoSwMxgO4dbRINuqbIh7o137A6DTv12CkzG7ATV3DhDqf78y7CQlNH71a5fEUI yhgRv36Lz7Eaq5aOfBw1oE8opiZXNh8Wc+r0bf2rPprjDXKk/NrarAcl3pKGfTwa84YSp7 BOlW5NDGpanhx6zEUozftg/7mPWu1fWNhLJRBEp4fMzZQZWSJvm9DfzNV6aiJQ== 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=1715669947; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oW5/RTarpmd10q3VAfcMoRK8mW1UCO9PQjeM2hYss3s=; b=SwCWWnCpe1f6j+3WxXV2Zc1CoEIDLNB49AsILjJvem3EsDK4BuNfvdM3LDFTmOYMH6bh5K tYHO0AwlGXAPcmrfv5GU8IUb8meT96DxsVIBLD8RpZWokuSar6fScanPuFn1ZvAbN26JP+ lwzdwquQL1817Cz3QFZNsnbUlWpq1TGhXgrwPiOSp3prnarSODvTZj2LlZRq0VX9QCHlb4 MX6WQS/Sl/qLe1Z4kfsKCWmeuNJfx1DFloywaYOo+Ff2zalxpCdNc8niBnGK8A5xOynXx7 sn4cS5aFw+ij+BT+cLzW6bLhUZihoABZoa9HwEcyzGS0DnSTEWPl2tBhMXTpDQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdnJq1vTnzM5J; Tue, 14 May 2024 06:59: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 44E6x7OO004759; Tue, 14 May 2024 06:59:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44E6x7a9004757; Tue, 14 May 2024 06:59:07 GMT (envelope-from git) Date: Tue, 14 May 2024 06:59:07 GMT Message-Id: <202405140659.44E6x7a9004757@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: afd1256257f5 - stable/14 - cat: Check for lack of success rather than a specific failure. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: afd1256257f524f764627eaabb4d887ddecc6557 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=afd1256257f524f764627eaabb4d887ddecc6557 commit afd1256257f524f764627eaabb4d887ddecc6557 Author: Dag-Erling Smørgrav AuthorDate: 2024-05-10 10:59:18 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-14 06:58:40 +0000 cat: Check for lack of success rather than a specific failure. MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: oshogbo Differential Revision: https://reviews.freebsd.org/D45149 (cherry picked from commit c6f9df7064106a3b016c13ea3b9a930362b53089) cat: Missed a couple. MFC after: 3 days Sponsored by: Klara, Inc. (cherry picked from commit ad4f3bdf733c1a670021f4db378338f5aaedbfd8) --- bin/cat/cat.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bin/cat/cat.c b/bin/cat/cat.c index 81ec5feec240..9d40a3f0fa35 100644 --- a/bin/cat/cat.c +++ b/bin/cat/cat.c @@ -139,7 +139,7 @@ init_casper_net(cap_channel_t *casper) familylimit = AF_LOCAL; cap_net_limit_name2addr_family(limit, &familylimit, 1); - if (cap_net_limit(limit) < 0) + if (cap_net_limit(limit) != 0) err(EXIT_FAILURE, "unable to apply limits"); } #endif @@ -212,7 +212,7 @@ main(int argc, char *argv[]) stdout_lock.l_start = 0; stdout_lock.l_type = F_WRLCK; stdout_lock.l_whence = SEEK_SET; - if (fcntl(STDOUT_FILENO, F_SETLKW, &stdout_lock) == -1) + if (fcntl(STDOUT_FILENO, F_SETLKW, &stdout_lock) != 0) err(EXIT_FAILURE, "stdout"); } @@ -220,7 +220,7 @@ main(int argc, char *argv[]) caph_cache_catpages(); - if (caph_enter_casper() < 0) + if (caph_enter_casper() != 0) err(EXIT_FAILURE, "capsicum"); if (bflag || eflag || nflag || sflag || tflag || vflag) @@ -280,7 +280,7 @@ scanfiles(char *argv[], int cooked __unused) #endif } else { #ifndef BOOTSTRAP_CAT - if (in_kernel_copy(fd) == -1) { + if (in_kernel_copy(fd) != 0) { if (errno == EINVAL || errno == EBADF || errno == EISDIR) raw_cat(fd); @@ -485,7 +485,7 @@ udom_open(const char *path, int flags) errno = serrno; return (-1); } - if (caph_rights_limit(fd, &rights) < 0) { + if (caph_rights_limit(fd, &rights) != 0) { serrno = errno; close(fd); freeaddrinfo(res0); @@ -514,12 +514,12 @@ udom_open(const char *path, int flags) switch (flags & O_ACCMODE) { case O_RDONLY: cap_rights_clear(&rights, CAP_WRITE); - if (shutdown(fd, SHUT_WR) == -1) + if (shutdown(fd, SHUT_WR) != 0) warn(NULL); break; case O_WRONLY: cap_rights_clear(&rights, CAP_READ); - if (shutdown(fd, SHUT_RD) == -1) + if (shutdown(fd, SHUT_RD) != 0) warn(NULL); break; default: @@ -527,7 +527,7 @@ udom_open(const char *path, int flags) } cap_rights_clear(&rights, CAP_CONNECT, CAP_SHUTDOWN); - if (caph_rights_limit(fd, &rights) < 0) { + if (caph_rights_limit(fd, &rights) != 0) { serrno = errno; close(fd); errno = serrno; From nobody Tue May 14 06:59:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdnJr4WFdz5KYfL; Tue, 14 May 2024 06:59: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 4VdnJr3K87z4pkd; Tue, 14 May 2024 06:59:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715669948; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=414uAsts6YODio8nexsL31XnNHX3vM6iIeL3EfvaOkE=; b=U+7+5JSc4HexT1IR1Douj7JMjsXT8KNJd6UvRt5iExcO0SkqZcpKElHr9qb+EmRaEDGZGX sDy83RT6WJ5nJ1MsUplJhiowtGbGFfcfW2HB2sRxWsbHIM19ia8dNoYGu5+1zA93nlOnNI gsltX7vetdDO6yG5MxJQNfebAhxB+JgrMD5a95hgyGj2J6sUYV1oItFC+GEcxWZ9/Yhxz/ vJviHzeaspLYsTAkViw3lboTkxRj3AXBkwyntTcTvHlZ+qLb1NxAXgtpPjtUob2WtTQEGy iNbRdBLq6lv31ND0/zKxmhdMfWv0pCJlqkkxShv93jH+PPl9vmA5kT44KRSX6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715669948; a=rsa-sha256; cv=none; b=IFgEKor82SYJfTkP0e+TwcIQFm6xGNrgW/85o5N+6i5LUQDEWvfmXcXiclqlPyNXanTK6Q 7ylJS4OozfO/oxssODs/SbTcfo3Noa73iAeAxSL9zfWL/LhC5JhWMOTzlDy+68GP1pSfex i8BDkjrKihHfdrr2MOlLrl8zTcMImf5UF6QCLRsFG+oivAxjk31d17VnU4uY1eLE/FAVb3 kVWjdZYJ6uCu1RWOU775c6fNlYZfYaKl1ylFMFvMrZ1MYOYYWrfq/3uTk66wP1PW3aHFEW dFC4aJGu7jf5lhjN0OzI9SPjREryoC0qQ1Zz1b4y2zMMjLL5PGwU6sPwr9GFWA== 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=1715669948; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=414uAsts6YODio8nexsL31XnNHX3vM6iIeL3EfvaOkE=; b=S8/vq1kXQ+8zFr5NXoJBYEQ09j49wp1aMYcdqBiR/TIMQ2JW4MLLb8gdO7j8WrCDVxxabR qgqUUxqncc/vZt6+jMKbnroFcE4alhrfSSvCbTYXxOIFIGQIuZUbmAZQVKnKdC9CfElsZq OREmbLhIOwUnydBz7ORpzhEt//O5ARVjYW4SRa/dTVLuBjt+eJ4ii4dicYgoq6Nwm9l46c Fmt8RwJf9Vrk+0xYkPghtxCe5tpQ8g/IQKJEQvI4+wrsuRQ9qNOew2uPgwiOfVSqtqihGs vQ30MWnustFDYXDFZ/X3cszjyYDYcPF/kzNzEOH5EY3gRSSnob3a1LLD5Uctkw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdnJr2xNhzMGx; Tue, 14 May 2024 06:59: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 44E6x8lu004816; Tue, 14 May 2024 06:59:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44E6x8P5004812; Tue, 14 May 2024 06:59:08 GMT (envelope-from git) Date: Tue, 14 May 2024 06:59:08 GMT Message-Id: <202405140659.44E6x8P5004812@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: 626ee3cac845 - stable/14 - tftpd: Add missing `-S` option to synopsis. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 626ee3cac8458b355d4330c2099240d3ca881589 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=626ee3cac8458b355d4330c2099240d3ca881589 commit 626ee3cac8458b355d4330c2099240d3ca881589 Author: Dag-Erling Smørgrav AuthorDate: 2024-05-10 21:15:37 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-14 06:58:40 +0000 tftpd: Add missing `-S` option to synopsis. MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D45129 (cherry picked from commit 816c4d3dcf99adcd40a03d93431237ddbd23bbdf) tftpd: Drop unneeded includes. MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D45130 (cherry picked from commit 1111da6b7c612c571453a23a8dd02fd5e7e40b18) tftpd: Add missing include. This went unnoticed due to namespace pollution in our headers. MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D45131 (cherry picked from commit ae285a8cbf1212bdc1b3f81219635bc1395fadee) tftpd: Satisfy clang-analyzer. * Replace `random()` with `arc4random()`. * Change some variable types. * Drop some unused assignments. MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D45132 (cherry picked from commit 4d09eb87c5d5bec2e2832f50537e2ce6f75f4117) tftpd: silence gcc overflow warnings GCC 13 complains that we might be writing too much to an on-stack buffer when createing a filename. In practice there is a check that filename isn't too long given the time format and other static characters so GCC is incorrect, but GCC isn't wrong that we're potentially trying to put a MAXPATHLEN length string + some other characters into a MAXPATHLEN buffer (if you ignore the check GCC can't realistically evaluate at compile time). Switch to snprintf to populate filename to ensure that future logic errors don't result in a stack overflow. Shorten the questionably named yyyymmdd buffer enough to slience the warning (checking the snprintf return value isn't sufficent) while preserving maximum flexibility for admins who use the -F option. MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D45086 (cherry picked from commit 25945af47e7a1d06c44c8c160045a866e90569ab) --- libexec/tftpd/tests/functional.c | 1 + libexec/tftpd/tftp-file.h | 1 - libexec/tftpd/tftp-io.c | 11 +++----- libexec/tftpd/tftp-io.h | 1 - libexec/tftpd/tftp-options.h | 1 - libexec/tftpd/tftp-transfer.h | 1 - libexec/tftpd/tftp-utils.c | 2 +- libexec/tftpd/tftp-utils.h | 3 +-- libexec/tftpd/tftpd.8 | 6 ++--- libexec/tftpd/tftpd.c | 56 +++++++++++++++++++++++++--------------- 10 files changed, 45 insertions(+), 38 deletions(-) diff --git a/libexec/tftpd/tests/functional.c b/libexec/tftpd/tests/functional.c index f31d2a893da1..32e5f85cf421 100644 --- a/libexec/tftpd/tests/functional.c +++ b/libexec/tftpd/tests/functional.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include diff --git a/libexec/tftpd/tftp-file.h b/libexec/tftpd/tftp-file.h index 0fb7f6c1decc..c424e5cbc75b 100644 --- a/libexec/tftpd/tftp-file.h +++ b/libexec/tftpd/tftp-file.h @@ -25,7 +25,6 @@ * SUCH DAMAGE. */ -#include int write_init(int fd, FILE *f, const char *mode); size_t write_file(char *buffer, int count); int write_close(void); diff --git a/libexec/tftpd/tftp-io.c b/libexec/tftpd/tftp-io.c index b5f39423fd60..aaacc9dd7f45 100644 --- a/libexec/tftpd/tftp-io.c +++ b/libexec/tftpd/tftp-io.c @@ -72,13 +72,13 @@ static struct errmsg { #define DROPPACKET(s) \ if (packetdroppercentage != 0 && \ - random()%100 < packetdroppercentage) { \ + arc4random()%100 < packetdroppercentage) { \ tftp_log(LOG_DEBUG, "Artificial packet drop in %s", s); \ return; \ } #define DROPPACKETn(s,n) \ if (packetdroppercentage != 0 && \ - random()%100 < packetdroppercentage) { \ + arc4random()%100 < packetdroppercentage) { \ tftp_log(LOG_DEBUG, "Artificial packet drop in %s", s); \ return (n); \ } @@ -157,10 +157,8 @@ send_error(int peer, int error) pe->e_msg = strerror(error - 100); tp->th_code = EUNDEF; /* set 'undef' errorcode */ } - strcpy(tp->th_msg, pe->e_msg); - length = strlen(pe->e_msg); - tp->th_msg[length] = '\0'; - length += 5; + snprintf(tp->th_msg, MAXPKTSIZE - 4, "%s%n", pe->e_msg, &length); + length += 5; /* header and terminator */ if (debug & DEBUG_PACKETS) tftp_log(LOG_DEBUG, "Sending ERROR %d: %s", error, tp->th_msg); @@ -331,7 +329,6 @@ send_ack(int fp, uint16_t block) DROPPACKETn("send_ack", 0); tp = (struct tftphdr *)buf; - size = sizeof(buf) - 2; tp->th_opcode = htons((u_short)ACK); tp->th_block = htons((u_short)block); size = 4; diff --git a/libexec/tftpd/tftp-io.h b/libexec/tftpd/tftp-io.h index 85934e824a1a..1d6bc2bd8b5e 100644 --- a/libexec/tftpd/tftp-io.h +++ b/libexec/tftpd/tftp-io.h @@ -25,7 +25,6 @@ * SUCH DAMAGE. */ -#include #define RP_NONE 0 #define RP_RECVFROM -1 #define RP_TOOSMALL -2 diff --git a/libexec/tftpd/tftp-options.h b/libexec/tftpd/tftp-options.h index c68db53de4e2..f1b0a5cfaf32 100644 --- a/libexec/tftpd/tftp-options.h +++ b/libexec/tftpd/tftp-options.h @@ -25,7 +25,6 @@ * SUCH DAMAGE. */ -#include /* * Options */ diff --git a/libexec/tftpd/tftp-transfer.h b/libexec/tftpd/tftp-transfer.h index 48431ebbc863..449f29c246e0 100644 --- a/libexec/tftpd/tftp-transfer.h +++ b/libexec/tftpd/tftp-transfer.h @@ -25,7 +25,6 @@ * SUCH DAMAGE. */ -#include int tftp_send(int peer, uint16_t *block, struct tftp_stats *tp); int tftp_receive(int peer, uint16_t *block, struct tftp_stats *tp, struct tftphdr *firstblock, size_t fb_size); diff --git a/libexec/tftpd/tftp-utils.c b/libexec/tftpd/tftp-utils.c index b309a94f7653..8ce7c09c9992 100644 --- a/libexec/tftpd/tftp-utils.c +++ b/libexec/tftpd/tftp-utils.c @@ -204,7 +204,7 @@ struct debugs debugs[] = { { DEBUG_ACCESS, "access", "TCPd access debugging" }, { DEBUG_NONE, NULL, "No debugging" }, }; -int packetdroppercentage = 0; +unsigned int packetdroppercentage = 0; int debug_find(char *s) diff --git a/libexec/tftpd/tftp-utils.h b/libexec/tftpd/tftp-utils.h index 763b3b493c7e..276dedcf74cd 100644 --- a/libexec/tftpd/tftp-utils.h +++ b/libexec/tftpd/tftp-utils.h @@ -25,7 +25,6 @@ * SUCH DAMAGE. */ -#include /* */ #define TIMEOUT 5 @@ -100,7 +99,7 @@ struct debugs { }; extern int debug; extern struct debugs debugs[]; -extern int packetdroppercentage; +extern unsigned int packetdroppercentage; int debug_find(char *s); int debug_finds(char *s); const char *debug_show(int d); diff --git a/libexec/tftpd/tftpd.8 b/libexec/tftpd/tftpd.8 index 3de042197618..24a743a92e14 100644 --- a/libexec/tftpd/tftpd.8 +++ b/libexec/tftpd/tftpd.8 @@ -27,7 +27,7 @@ .\" .\" @(#)tftpd.8 8.1 (Berkeley) 6/4/93 .\" -.Dd July 20, 2023 +.Dd May 8, 2024 .Dt TFTPD 8 .Os .Sh NAME @@ -35,11 +35,11 @@ .Nd Internet Trivial File Transfer Protocol server .Sh SYNOPSIS .Nm tftpd -.Op Fl cdClnow +.Op Fl CcdlnoSw .Op Fl F Ar strftime-format .Op Fl s Ar directory -.Op Fl u Ar user .Op Fl U Ar umask +.Op Fl u Ar user .Op Ar directory ... .Sh DESCRIPTION The diff --git a/libexec/tftpd/tftpd.c b/libexec/tftpd/tftpd.c index 78348a8c6aaf..00c1257ce548 100644 --- a/libexec/tftpd/tftpd.c +++ b/libexec/tftpd/tftpd.c @@ -172,7 +172,7 @@ main(int argc, char *argv[]) options_extra_enabled = 0; break; case 'p': - packetdroppercentage = atoi(optarg); + packetdroppercentage = (unsigned int)atoi(optarg); tftp_log(LOG_INFO, "Randomly dropping %d out of 100 packets", packetdroppercentage); @@ -463,9 +463,9 @@ static char * parse_header(int peer, char *recvbuffer, size_t size, char **filename, char **mode) { - char *cp; - int i; struct formats *pf; + char *cp; + size_t i; *mode = NULL; cp = recvbuffer; @@ -482,12 +482,11 @@ parse_header(int peer, char *recvbuffer, size_t size, i = get_field(peer, cp, size); *mode = cp; - cp += i; /* Find the file transfer mode */ - for (cp = *mode; *cp; cp++) - if (isupper(*cp)) - *cp = tolower(*cp); + for (; *cp; cp++) + if (isupper((unsigned char)*cp)) + *cp = tolower((unsigned char)*cp); for (pf = formats; pf->f_mode; pf++) if (strcmp(pf->f_mode, *mode) == 0) break; @@ -624,12 +623,20 @@ tftp_rrq(int peer, char *recvbuffer, size_t size) static int find_next_name(char *filename, int *fd) { - int i; + /* + * GCC "knows" that we might write all of yyyymmdd plus the static + * elemenents in the format into into newname and thus complains + * unless we reduce the size. This array is still too big, but since + * the format is user supplied, it's not clear what a better limit + * value would be and this is sufficent to silence the warnings. + */ + static const int suffix_len = strlen("..00"); + char yyyymmdd[MAXPATHLEN - suffix_len]; + char newname[MAXPATHLEN]; + int i, ret; time_t tval; - size_t len; + size_t len, namelen; struct tm lt; - char yyyymmdd[MAXPATHLEN]; - char newname[MAXPATHLEN]; /* Create the YYYYMMDD part of the filename */ time(&tval); @@ -637,26 +644,33 @@ find_next_name(char *filename, int *fd) len = strftime(yyyymmdd, sizeof(yyyymmdd), newfile_format, <); if (len == 0) { syslog(LOG_WARNING, - "Filename suffix too long (%d characters maximum)", - MAXPATHLEN); + "Filename suffix too long (%zu characters maximum)", + sizeof(yyyymmdd) - 1); return (EACCESS); } /* Make sure the new filename is not too long */ - if (strlen(filename) > MAXPATHLEN - len - 5) { + namelen = strlen(filename); + if (namelen >= sizeof(newname) - len - suffix_len) { syslog(LOG_WARNING, - "Filename too long (%zd characters, %zd maximum)", - strlen(filename), MAXPATHLEN - len - 5); + "Filename too long (%zu characters, %zu maximum)", + namelen, + sizeof(newname) - len - suffix_len - 1); return (EACCESS); } /* Find the first file which doesn't exist */ for (i = 0; i < 100; i++) { - sprintf(newname, "%s.%s.%02d", filename, yyyymmdd, i); - *fd = open(newname, - O_WRONLY | O_CREAT | O_EXCL, - S_IRUSR | S_IWUSR | S_IRGRP | - S_IWGRP | S_IROTH | S_IWOTH); + ret = snprintf(newname, sizeof(newname), "%s.%s.%02d", + filename, yyyymmdd, i); + /* + * Size checked above so this can't happen, we'd use a + * (void) cast, but gcc intentionally ignores that if + * snprintf has __attribute__((warn_unused_result)). + */ + if (ret < 0 || (size_t)ret >= sizeof(newname)) + __unreachable(); + *fd = open(newname, O_WRONLY | O_CREAT | O_EXCL, 0666); if (*fd > 0) return 0; } From nobody Tue May 14 06:59:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdnK8535Dz5KYWP; Tue, 14 May 2024 06:59:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VdnK84927z4pnQ; Tue, 14 May 2024 06:59:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715669964; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IlT8csYNzra8WFOGztHMw0PoIMVZU2g7TdRJSuQmtnc=; b=jN1XdM7OkxxxDk96Snj9MNRWBMcXkEyVjfdCLKhp1qVvd/FedA9qBUaZ4zTNzNVjVwaqjf LuRnQTXGZMojpTIDrX/KqLbGscSYhFBYo3TwAbRfwtARrJoyMKewQlw0uJAHoONByfZd/i DlcqweNBXQ2R49OtY744caPip3uNb3Uzk+ofOOJ7eS9WJBAVOozKMZ78+2YrUrOfNSk0EA SOL/tBzfuQDXaZOhUw61a0JHa8ZaJPmsBPwTq3SoPr8UGSmEpFM79LhMU0sTG4VpXS4kAc be3omKKodhFmpnY4/jR+8nDOOB4oz1aDzjc+4ngSax07aGxWXzxmojBAmUAnEg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715669964; a=rsa-sha256; cv=none; b=gE0J85fKUL7OJJ40wy7pTorUJjjKli/P5GlK18aGL/L9xiguIMGmSwy8whQ5EJruoU0Olb sXYTqe+zer2FSuo6aZXT+bmqbEHFowWGpnoTqWy2RPDl+WafsWapIblr5VpZb21Lm0bwFm uKlYsoXhwfIe7v6XsObLHxGsVluY8pL2yNGmSku/mCzGPJyjxYYzXcfAWIuJpgkDaKoLIP +5gWx9rGgmmaqWwEhd2XlP+w38sZVE6PK6GGI+wLynLmc0nSBNB5Kyp/wrT8fkdj6ooWT2 CiT98EmjH6yyvU1ADQc0QuifmnfIzpOvwhEnxHc/4ezCX2gaE6npDSLoppWoKw== 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=1715669964; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IlT8csYNzra8WFOGztHMw0PoIMVZU2g7TdRJSuQmtnc=; b=FMJGuJNzmDaLn3zFBXPF5ME8zxIPNxbCnIfg02d8ljgXFTa/e1HGGfJn411PI+MJRFNdQq GDqCUJM5bEw6p4KStB7MUdiotoRApsdb0T+FHqja81Q0u6RrmlFNcuU7Ddoiw6ksQ8Ddaf cLO8UeAfxVKy0VkqttqL7hXI1ZrNTmEqFWxD0K1PlpWzehsf8uN24c1USUTZXRGd9Q20us Q3nPECQJqh+Gh0UD/AZ63+2RzuU/Vm9YHo9jZAZm/bXES+6siKq/tNUhev2wDQOdPgwgu7 +m/Es1FJAfyXWIc3jcZtnFOa7HPe7ItP2kyMVtvFBr6w4sUGZMLzuBw/jcHSKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdnK83lpMzM5K; Tue, 14 May 2024 06:59:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44E6xOvk005033; Tue, 14 May 2024 06:59:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44E6xOx2005030; Tue, 14 May 2024 06:59:24 GMT (envelope-from git) Date: Tue, 14 May 2024 06:59:24 GMT Message-Id: <202405140659.44E6xOx2005030@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: 7f97e3f47149 - stable/13 - Add man page for nfslockd. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7f97e3f47149ee44b06e3877f1bab1834c6a9307 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=7f97e3f47149ee44b06e3877f1bab1834c6a9307 commit 7f97e3f47149ee44b06e3877f1bab1834c6a9307 Author: Dag-Erling Smørgrav AuthorDate: 2024-05-10 09:23:13 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-14 06:59:12 +0000 Add man page for nfslockd. PR: 130238 MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D45139 (cherry picked from commit 44e72c6e2e6bcfa2cba89afb92fa05f6ac4d5660) --- share/man/man4/Makefile | 1 + share/man/man4/nfslockd.4 | 45 ++++++++++++++++++++++++++++++++++++++++++ usr.sbin/rpc.lockd/lockd.c | 3 ++- usr.sbin/rpc.lockd/rpc.lockd.8 | 5 +++-- 4 files changed, 51 insertions(+), 3 deletions(-) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 83bec8e9f66a..1ea3431c859a 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -343,6 +343,7 @@ MAN= aac.4 \ netlink.4 \ netmap.4 \ ${_nfe.4} \ + nfslockd.4 \ ${_nfsmb.4} \ ng_async.4 \ ngatmbase.4 \ diff --git a/share/man/man4/nfslockd.4 b/share/man/man4/nfslockd.4 new file mode 100644 index 000000000000..770d9b8736b0 --- /dev/null +++ b/share/man/man4/nfslockd.4 @@ -0,0 +1,45 @@ +.\"- +.\" Copyright (c) 2024 Dag-Erling Smørgrav +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.Dd May 8, 2024 +.Dt NFSLOCKD 4 +.Os +.Sh NAME +.Nm nfslockd +.Nd NFS advisory locking +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines in +your kernel configuration file: +.Bd -ragged -offset indent +.Cd "options NFSLOCKD" +.Ed +.Pp +Alternatively, to load the driver as a module at boot time, place the +following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +nfslockd_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides kernel support for NFSv3 advisory locking. +It works in tandem with +.Xr rpc.lockd 8 , +which will normally load it on startup if it is not already loaded or +compiled-in. +.Sh SEE ALSO +.Xr rpc.lockd 8 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 6.4 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Doug Rabson Aq Mt dfr@FreeBSD.org . diff --git a/usr.sbin/rpc.lockd/lockd.c b/usr.sbin/rpc.lockd/lockd.c index 35953f32692e..15448b651749 100644 --- a/usr.sbin/rpc.lockd/lockd.c +++ b/usr.sbin/rpc.lockd/lockd.c @@ -188,7 +188,8 @@ main(int argc, char **argv) kernel_lockd_client = FALSE; if (modfind("nfslockd") < 0) { if (kldload("nfslockd") < 0) { - fprintf(stderr, "Can't find or load kernel support for rpc.lockd - using non-kernel implementation\n"); + fprintf(stderr, "Unable to load nfslockd(4), " + "using userland implementation\n"); } else { kernel_lockd = TRUE; } diff --git a/usr.sbin/rpc.lockd/rpc.lockd.8 b/usr.sbin/rpc.lockd/rpc.lockd.8 index 89f55087901d..89592a1cceaf 100644 --- a/usr.sbin/rpc.lockd/rpc.lockd.8 +++ b/usr.sbin/rpc.lockd/rpc.lockd.8 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 21, 2019 +.Dd May 8, 2024 .Dt RPC.LOCKD 8 .Os .Sh NAME @@ -44,7 +44,7 @@ The .Nm utility provides monitored and unmonitored file and record locking services -in an NFS environment. +in an NFSv3 environment. To monitor the status of hosts requesting locks, the locking daemon typically operates in conjunction with @@ -137,6 +137,7 @@ RPC protocol specification for the network lock manager protocol. .El .Sh SEE ALSO .Xr syslog 3 , +.Xr nfslockd 4 , .Xr rc.conf 5 , .Xr rpc.statd 8 .Sh STANDARDS From nobody Tue May 14 06:59:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdnKC0d4Yz5KYnK; Tue, 14 May 2024 06:59: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 4VdnKB6SZmz4pst; Tue, 14 May 2024 06:59:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715669967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eXP8oGLVOZWbA/ZfV8MpCI8q2DCCagX0XOER6J8iciA=; b=NrWu0D5k7GgBPoDm3U5I0eqzUcnjHsKgwGDgcYGmL9ijMry2S8QNqJBp23tAQMpUKM7g34 duxAz4Sm8u/3JCPcrhm9+rQ9ClOqmd4vQQhzS5ux+75eDh8KTJWVYop15ZSk3abhfhjbhy rRoJz5gEqqz5We+eDmP1Iewo6f5Mc4aiIjo7ZCe/JZJH1HT1zoDQtUhYrPfpsY+BFhrIdT hRmI8B+4gwTxetyLZT/sJfWOjh+3oMZf8HtGHdLXevRAdP8FIpRXILD1eRg40xxP/hPaiT CSbQgf0BY1W3L0huDMWihrdUl/1ZTKu6ZIF9jb5B718/QbsPl2cu/kg7szElLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715669967; a=rsa-sha256; cv=none; b=UuPTyye3WZbuw0f09FEJSyt7KYRENGoWGgI5F4paeYgonVxzHaRQv9k9CyfhVZxVhiQRil 5SubHdQzghDffasj18lcpkJIxKVkfRGOWH+qdqVGui1JMy9cOE9UzEhGr02XoCxkAKIgsK IWHPLQAsw+8qDHtbL02r3x3ZdjEzFRC1v5gnIMLlhzPkF6C5zvz7NqslPZGsTT5Nt6PeF9 U2MMojh/3zKYssugSteAsKRQxyTG7gEu404q7UfUsmY9aVxKKxWDzRI+0apjoXACuSP4Xd b5tKBP3Uot4sypdZs5Y/AaQQSd5E0tfUh705JFXtSO+k5MnzOYcaltv9a10l9Q== 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=1715669967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eXP8oGLVOZWbA/ZfV8MpCI8q2DCCagX0XOER6J8iciA=; b=O2TcjLoABkd5SpgEOScRmiogD8ICLajVAt2sbl63kOfyf8pAWTw8DnUldLfPv+2akVSBoh OQJn82A44o091qBo72+DJFZKCzlkkIw6oxxJwzT/epIQeGY7s2yZZw4gV1BcH+04rC2Gdj EWEyNRSPtz1ea+8gwlfvnxAZ1vOwd8QAwRkq3vLOcl2JXy86uhHqz5p02WR5hhVcIPRAff cu4shUz3Ikb2c/z5AbbI4XYZZggoh6S/m5jd63kCicQJ6knDFtikUrCTXsEdtGatUoct04 iKhqI3KRZp0o0bZPhzEHGeI/mNSbBXK3dlcidUHXMNFF9c6gOiTD72zcfH+3Aw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdnKB5ngHzLxZ; Tue, 14 May 2024 06:59: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 44E6xQiU005167; Tue, 14 May 2024 06:59:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44E6xQcS005164; Tue, 14 May 2024 06:59:26 GMT (envelope-from git) Date: Tue, 14 May 2024 06:59:26 GMT Message-Id: <202405140659.44E6xQcS005164@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: b52cbae3b7f4 - stable/13 - tftpd: Add missing `-S` option to synopsis. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b52cbae3b7f4e00e4bf0600f0189009b8edd9fe4 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=b52cbae3b7f4e00e4bf0600f0189009b8edd9fe4 commit b52cbae3b7f4e00e4bf0600f0189009b8edd9fe4 Author: Dag-Erling Smørgrav AuthorDate: 2024-05-10 21:15:37 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-14 06:59:12 +0000 tftpd: Add missing `-S` option to synopsis. MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D45129 (cherry picked from commit 816c4d3dcf99adcd40a03d93431237ddbd23bbdf) --- libexec/tftpd/tftpd.8 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libexec/tftpd/tftpd.8 b/libexec/tftpd/tftpd.8 index 3de042197618..24a743a92e14 100644 --- a/libexec/tftpd/tftpd.8 +++ b/libexec/tftpd/tftpd.8 @@ -27,7 +27,7 @@ .\" .\" @(#)tftpd.8 8.1 (Berkeley) 6/4/93 .\" -.Dd July 20, 2023 +.Dd May 8, 2024 .Dt TFTPD 8 .Os .Sh NAME @@ -35,11 +35,11 @@ .Nd Internet Trivial File Transfer Protocol server .Sh SYNOPSIS .Nm tftpd -.Op Fl cdClnow +.Op Fl CcdlnoSw .Op Fl F Ar strftime-format .Op Fl s Ar directory -.Op Fl u Ar user .Op Fl U Ar umask +.Op Fl u Ar user .Op Ar directory ... .Sh DESCRIPTION The From nobody Tue May 14 06:59:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdnK96wTQz5KYWS; Tue, 14 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 4VdnK95DH6z4pWx; Tue, 14 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=1715669965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VZ/BF6uqE6yBDw4yC0kYmOdN9zxgsJ1uNRSW/rWYvoc=; b=m6Xga9Si6AbnGWGOacf3eipKfZG+2LF2PJVyd/8pShtNCua+7RA/w6vwB9U7Z5cEbYO226 cWkUyZpiqOymGApC0R1NKmLm8B7wi087MgH+Q+uEgFenZjHKG9y+BObkCCpwMQnN2tVrcK JI9+K31qKbPmBtRMB2XxE56dld7j+jZ+Jpzlj9S73QBjZEYkh6MHVUuCKMtPniaFqLF17y z+61Mj3qk35tjk/vK4t7q2YHylUo22JbWhKdNO9b0Y+VHtj2/PKUj8Dbs5fm8/wbVT1C43 LjU1kwmP8ndBr497C94lETOFt/knt9pE5TYWPw1ClQOsrbvd4dtdcwit22vuZg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715669965; a=rsa-sha256; cv=none; b=Sl56M9S0Zq9Jva3CHOo9+FOWKD7IyWMtbbQJ/nCIZCLscECoxb/UKPdCq+Q4RNA169eXXg DJdj/T2TKFs2PSJ8mvEwQZ4PmQ+dUhNwWfIBUSe6A5BmaowAxZcB5uGXyXF2UXSSpSaPcV RdiRWGZwOnDILr4cYfc5FoQFg/JY3D/tUXy003qtqeIHINcgzKreCc+5u9+meFqJqRpoEY FyvA/w3mba7hOnnnLW8HCmTfXOdys8isJtxgiwUw16G7tqnXhpf4imfHSsdLyaA09PCNJn juXh3p1FPK0bdr33A0HI7mEoHiib2GkhVibTYHkUy4v46X/rSMKy7GsDBei/GQ== 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=1715669965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VZ/BF6uqE6yBDw4yC0kYmOdN9zxgsJ1uNRSW/rWYvoc=; b=qJO0+B1lxNw+DXqrlBAwc766ByzF9o802JP0/ars8kBt6zhqoNcI9h23NBawODRzFL1ELB trLKDCXSr2kcMV/lf36mmvxX9LZVhYG6Ql6r/Xz8L60HZQvOgB2R1KmAMIMzDIyYN9DvcW /O0Pv1lTh9KNr6cgAwRfz6wh5V0MNC1Km8fnO0IoiY5W1A5N6aMsNc7nCrx4OwdvvtrYvv 5cguZuXUIzaSbcGRBNYb7leFQ/Q+KkQHdFHR61SKAAooTLnUyZ5+wyAuykkMWOH+/4t/qq 0x1fLZXdP4clE6T3Ymjt/pQMZFNmeemQLlTkIyoeGt9iHbuXkS+XFAibEQSwWQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdnK94nXGzLxY; Tue, 14 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 44E6xPIZ005112; Tue, 14 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 44E6xPN5005108; Tue, 14 May 2024 06:59:25 GMT (envelope-from git) Date: Tue, 14 May 2024 06:59:25 GMT Message-Id: <202405140659.44E6xPN5005108@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: b6fb1131e64f - stable/13 - cat: Check for lack of success rather than a specific failure. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b6fb1131e64f47854c08ab8ee733aed1f6f81180 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=b6fb1131e64f47854c08ab8ee733aed1f6f81180 commit b6fb1131e64f47854c08ab8ee733aed1f6f81180 Author: Dag-Erling Smørgrav AuthorDate: 2024-05-10 10:59:18 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-14 06:59:12 +0000 cat: Check for lack of success rather than a specific failure. MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: oshogbo Differential Revision: https://reviews.freebsd.org/D45149 (cherry picked from commit c6f9df7064106a3b016c13ea3b9a930362b53089) cat: Missed a couple. MFC after: 3 days Sponsored by: Klara, Inc. (cherry picked from commit ad4f3bdf733c1a670021f4db378338f5aaedbfd8) --- bin/cat/cat.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/cat/cat.c b/bin/cat/cat.c index dc6e6417dc49..48294be5c5b5 100644 --- a/bin/cat/cat.c +++ b/bin/cat/cat.c @@ -138,7 +138,7 @@ init_casper_net(cap_channel_t *casper) familylimit = AF_LOCAL; cap_net_limit_name2addr_family(limit, &familylimit, 1); - if (cap_net_limit(limit) < 0) + if (cap_net_limit(limit) != 0) err(EXIT_FAILURE, "unable to apply limits"); } #endif @@ -211,7 +211,7 @@ main(int argc, char *argv[]) stdout_lock.l_start = 0; stdout_lock.l_type = F_WRLCK; stdout_lock.l_whence = SEEK_SET; - if (fcntl(STDOUT_FILENO, F_SETLKW, &stdout_lock) == -1) + if (fcntl(STDOUT_FILENO, F_SETLKW, &stdout_lock) != 0) err(EXIT_FAILURE, "stdout"); } @@ -219,7 +219,7 @@ main(int argc, char *argv[]) caph_cache_catpages(); - if (caph_enter_casper() < 0) + if (caph_enter_casper() != 0) err(EXIT_FAILURE, "capsicum"); if (bflag || eflag || nflag || sflag || tflag || vflag) @@ -456,7 +456,7 @@ udom_open(const char *path, int flags) errno = serrno; return (-1); } - if (caph_rights_limit(fd, &rights) < 0) { + if (caph_rights_limit(fd, &rights) != 0) { serrno = errno; close(fd); freeaddrinfo(res0); @@ -494,7 +494,7 @@ udom_open(const char *path, int flags) } cap_rights_clear(&rights, CAP_CONNECT, CAP_SHUTDOWN); - if (caph_rights_limit(fd, &rights) < 0) { + if (caph_rights_limit(fd, &rights) != 0) { serrno = errno; close(fd); errno = serrno; From nobody Tue May 14 12:17:05 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdwMk09Ftz5K0qb; Tue, 14 May 2024 12:17:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VdwMj6gsXz4Cdw; Tue, 14 May 2024 12:17:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715689025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TMRGBo8j2eIWKGyPjfTwSKlUKFWAjW719CVDX3JZh+k=; b=uZCPT7q4m/Ot4dTYZhNjiFVyvNAAQU79ncyfdHXNU2pxlRY/H4S0mY+GgGu5QEX23BK1PO 11V9rGAO7jFIcHaWc0DRciLW6UL4flBZZCZAvnrFIOsG1FnDGRkiP81NGw796rM2WkCRwc MGPi8id0syeYQyW7VK/LcfuqFM5jhmyCNL/iQs/w354e0rQYHvmvJ7X/wbuUGCHwXoV82T j733KkEixSkwTXbfsY9h/qmRqoUMfF6nWThXP7cyerAvSNPhSHJL5+cCWL+0St4TMZT+6C SygUwmA0zN3XQMCloTk3i226NJQ1k+5QvvTXieSYUZGX3w8Dy18sg2JrRR/rhg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715689025; a=rsa-sha256; cv=none; b=XciP9ziFHDUzWm9MXO1cFhIiKFQiEcKXLtddHu0IrNXnzcE58NCpOCLmvJw5Iybvp7BWjL qCpyC8juaiykZvNx3TSYPxDPBId4GHk51F9kzkqZIZMNW0NjBnLdN9bEEpDQ/tnnfIHWVU QZiOGS8616PBCZKl6ygJAVbEjibIgUWBND9C7bsXhvkbIcBV4gh6jmvVucqV8uzipB20x4 nkun2hCDcRwN23swbHWCo+qDfKYrE0a6+Uzp/HV4I/FMVKIGJ5hYcqvxvD2iVaea8DH1ki 607nzCW1wmaiSH8I7kNisrWo8qt41mVtx9yLGn5XJcvHtdwu5ovib8L0HwiHPQ== 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=1715689025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TMRGBo8j2eIWKGyPjfTwSKlUKFWAjW719CVDX3JZh+k=; b=P8jDWJNQ+V1T3X1m+/+imdkUrYzGJ+wg/mgx3KOfXFU1NtDtftf5Kyegm0Ehx2XaYCgy8M jo0O7+Q+HWZzqu1P8msz5AIpugILqIq9m1GdzcmZ70rby5awCJsL3aMB9vmdjeOet5pntF q5ibd2p3l6DTe1oJn+jnGlJGkFnstUvaAMh/8xxPlo3F3xuBbgzjCqtYogCdYunGg/ielL i4e5j9XgI1UoDPtczuyuhLplOhLmItO5UKl/FzbQbdGNBTfsWB9ZaZ5PYy2P93Z1BuOVHH FvfTFmVcvdtfNSumVyxQpdB3lQfdQOPK5nqDn55BfEm8Qa8rM8K+rAI0cVrGCQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdwMj6F14zWwV; Tue, 14 May 2024 12:17:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44ECH55P045073; Tue, 14 May 2024 12:17:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44ECH5lO045070; Tue, 14 May 2024 12:17:05 GMT (envelope-from git) Date: Tue, 14 May 2024 12:17:05 GMT Message-Id: <202405141217.44ECH5lO045070@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 5681636ead67 - main - nuageinit: by default to not enable nuageinit List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5681636ead6790d5ad2c24a4712f010fcdfc926c Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=5681636ead6790d5ad2c24a4712f010fcdfc926c commit 5681636ead6790d5ad2c24a4712f010fcdfc926c Author: Baptiste Daroussin AuthorDate: 2024-05-14 12:15:43 +0000 Commit: Baptiste Daroussin CommitDate: 2024-05-14 12:16:45 +0000 nuageinit: by default to not enable nuageinit MFC After: 1 day Reported by: karels@ --- libexec/rc/rc.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index 2bd8af67c602..1ee1573bbdba 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -721,6 +721,7 @@ newsyslog_enable="YES" # Run newsyslog at startup. newsyslog_flags="-CN" # Newsyslog flags to create marked files mixer_enable="YES" # Run the sound mixer. opensm_enable="NO" # Opensm(8) for infiniband devices defaults to off +nuageinit_enable="NO" # Run nuageinit at startup # rctl(8) requires kernel options RACCT and RCTL rctl_enable="YES" # Load rctl(8) rules on boot From nobody Tue May 14 12:19:05 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdwQ12W2Bz5K0yj; Tue, 14 May 2024 12:19: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 4VdwQ11zr3z4Cwp; Tue, 14 May 2024 12:19:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715689145; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+lOvNU0fqEYVzwvrjOobTVzHyJRpeC9d3za5f8rQoN0=; b=Q0mVdmGBEH8ojob26xLvjAmdS0ISTwXTS5Cb+wFVb/cVpoZxprSwWoYBSevzFwtV80plBp hPNbea9ALaXX+d1Gg35BdOSivejvkQNAqERgKnlMol3scSA7O8ISM1hebFA8D0JnlugLNb R8kP6o6i8jMz1td2AnpfzlwSoZYKcC6mUj9YbFvJo1c/6P11GIIJfavQrHCuZteCbJ4bDy VEGBNXJygrgS6ss/cUFOT+SXXHCKEDd+AcEmUYrIfX2XbqVZDQ9GXziL/xImAu6I2Yro57 DvOfheYRxdKPbFYyFHIkV9O4rzkk5x4YG/JvSZ2nM3cADowJ9dSkLR77uIWGAg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715689145; a=rsa-sha256; cv=none; b=bOIpYIGyhpcYN+B3b03ucgtJq1i/o7VMku5n6vLLG2WxhyGDeVoUB7RzRWvnUxo1KdqFJZ Xto8dLVL0qHFFF/psOmLno7QAwGFuE6on4F85kAXJvysRRcy0ZJgIdgH5TuaxpNaABfDar 8PEoit1/gdfAzU7sElr4cbnDLo6i7tfWyGd+poHmauFBFHmfk/R7eCk4vfJxwvJgGKT0qc Lr8pIqKSDoZosnQU3MgyR2hEXRUcXw+WdbQv22LFP1/5OyYQYuOt38HBCiFhsL2wGPE9IG +EF0fQUV8CRM3Aje1zX/uzojQB7hqw16zHhvVJuEaQzrhp/UewUzINSmQu7s2Q== 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=1715689145; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+lOvNU0fqEYVzwvrjOobTVzHyJRpeC9d3za5f8rQoN0=; b=nUOfQAvJ4xInu5nZene4c9Sw5o5d7NiAKtCxsGJ+eCFmlnRilNZnpJguxKg/BnUt7tf7+Q N+N9ZG8Ky7gtK5fPcYexz3Vysfx6+pO49uyQAh2jL/obT4yz8of8dEgU1xBIL6wbNJWtAE NIYv2yu6cXc23MJHbQe6B1ASKqsDRHjxFqPApFL5UxUwtTxqPqqfMTaEni6me2kZckJxM+ CRbTxlEQUwGwwU3ppfzFEsBi/j/SrROvMKV31cXK7hdn6/ScLNE+sMdQaEMjUox/gs0lmH W2ftrUJZnofnpHKWaWEDl3BU51e1EJ2cfxxLWbRhRo7ZTbLcRGlLtx6aS5JXPQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdwQ11ZTSzWwN; Tue, 14 May 2024 12:19:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44ECJ5HG045433; Tue, 14 May 2024 12:19:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44ECJ5tm045430; Tue, 14 May 2024 12:19:05 GMT (envelope-from git) Date: Tue, 14 May 2024 12:19:05 GMT Message-Id: <202405141219.44ECJ5tm045430@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: b0b9435ef1ec - main - pci_vendors: update to 2024.05.14 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b0b9435ef1ec64c21f7243dbd02ad10e7f612149 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=b0b9435ef1ec64c21f7243dbd02ad10e7f612149 commit b0b9435ef1ec64c21f7243dbd02ad10e7f612149 Author: Baptiste Daroussin AuthorDate: 2024-05-14 12:18:20 +0000 Commit: Baptiste Daroussin CommitDate: 2024-05-14 12:18:20 +0000 pci_vendors: update to 2024.05.14 --- share/misc/pci_vendors | 501 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 449 insertions(+), 52 deletions(-) diff --git a/share/misc/pci_vendors b/share/misc/pci_vendors index ca3e5af4c97c..df152a4e97e0 100644 --- a/share/misc/pci_vendors +++ b/share/misc/pci_vendors @@ -1,8 +1,8 @@ # # List of PCI ID's # -# Version: 2024.02.02 -# Date: 2024-02-02 14:41:33 +# Version: 2024.05.14 +# Date: 2024-05-14 03:15:02 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at https://pci-ids.ucw.cz/. @@ -454,6 +454,7 @@ 1028 1f07 SAS 5/iR Integrated RAID Controller 1028 1f08 SAS 5/iR Integrated RAID Controller 1028 1f09 SAS 5/iR Adapter RAID Controller + 103c 3228 SAS3080X-HP 8-port PCI-X 133MHz Host Bus Adapter with 2xSFF-8484 15ad 1976 SAS Controller 0055 SAS1068 PCI-X Fusion-MPT SAS 1033 8336 SAS1068 @@ -764,7 +765,7 @@ 1bd4 0026 12G SAS3008IT RACK 1bd4 0027 12G SAS3008IMR RACK 1bd4 0028 12G SAS3008IR RACK - 00a5 Fusion-MPT 24GSAS/PCIe SAS40xx + 00a5 Fusion-MPT 24GSAS/PCIe SAS40xx/41xx 1000 4600 MegaRAID 9670W-16i Tri-Mode Storage Adapter 1000 4610 MegaRAID 9670-24i Tri-Mode Storage Adapter 1000 4620 MegaRAID 9660-16i Tri-Mode Storage Adapter @@ -3779,6 +3780,7 @@ 699f Lexa PRO [Radeon 540/540X/550/550X / RX 540X/550/550X] 1028 1720 Radeon RX 550X 148c 2380 Lexa XL [Radeon RX 550] + 17aa 5069 Thinkpad E480/E580 1da2 e367 Lexa PRO [Radeon RX 550] 69a0 Vega 12 69a1 Vega 12 @@ -3960,6 +3962,8 @@ 73a3 Navi 21 GL-XL [Radeon PRO W6800] 73a4 Navi 21 USB 73a5 Navi 21 [Radeon RX 6950 XT] +# Reference + 1002 0e3a Radeon RX 6950 XT 1849 5230 Navi 21 [ASRock OC Forumla Radeon RX 6950XT] 1da2 441d Navi 21 [Sapphire Nitro+ Radeon RX 6950 XT] 1eae 6950 Navi 21 [XFX Speedster MERC319 Radeon RX 6950 XT] @@ -3990,6 +3994,7 @@ 1da2 465e Radeon RX 6750 XT PULSE OC 1da2 e445 Sapphire Radeon RX 6700 1eae 6601 Speedster QICK 319 RX 6700 XT + 1eae 661a Radeon RX 6700 [SPEEDSTER SWFT 309] 73e0 Navi 23 73e1 Navi 23 WKS-XM [Radeon PRO W6600M] 73e3 Navi 23 WKS-XL [Radeon PRO W6600] @@ -5642,6 +5647,8 @@ 9609 RS780/RS880 PCI to PCI bridge (PCIE port 5) 960a RS780 PCI to PCI bridge (NB-SB link) 960b RS780 PCI to PCI bridge (ext gfx port 1) +# Takes over NVMe PCI ID when RAID is enabled + b000 RAID Bottom Device 1023 Trident Microsystems 0194 82C194 2000 4DWave DX @@ -9193,6 +9200,7 @@ 87d0 PEX PCI Express Switch DMA interface 9016 PLX 9016 8-port serial controller 9030 PCI9030 32-bit 33MHz PCI <-> IOBus Bridge + 10b5 1205 Becker & Hickl MSA-1000 10b5 2695 Hilscher CIF50-PB/DPS Profibus 10b5 2862 Alpermann+Velte PCL PCI LV (3V/5V): Timecode Reader Board 10b5 2906 Alpermann+Velte PCI TS (3V/5V): Time Synchronisation Board @@ -9228,7 +9236,13 @@ 10b5 1067 IXXAT CAN i165 10b5 114e Wasco WITIO PCI168extended 10b5 1169 Wasco OPTOIO32standard 32 digital in, 32 digital out + 10b5 1171 Becker & Hickl PMS-400 10b5 1172 IK220 (Heidenhain) + 10b5 1201 Becker & Hickl SPC-6x0 + 10b5 1202 Becker & Hickl SPC-7x0 + 10b5 1203 Becker & Hickl MSA-300 + 10b5 1206 Becker & Hickl DCC-100 + 10b5 120a Becker & Hickl STP-340 10b5 2036 SatPak GPS 10b5 2221 Alpermann+Velte PCL PCI LV: Timecode Reader Board 10b5 2273 SH ARC-PCI SOHARD ARCNET card @@ -9276,6 +9290,11 @@ d84d 4078 EX-4078 2S(16C552) RS-232+1P 9052 PCI9052 PCI <-> IOBus Bridge 9054 PCI9054 32-bit 33MHz PCI <-> IOBus Bridge + 10b5 1171 Becker & Hickl PMS-400A + 10b5 1208 Becker & Hickl SPC-830 + 10b5 120e Becker & Hickl SPC-930 + 10b5 120f Becker & Hickl SPC-150 + 10b5 1210 Becker & Hickl DPC-230 10b5 2455 Wessex Techology PHIL-PCI 10b5 2696 Innes Corp AM Radcap card 10b5 2717 Innes Corp Auricon card @@ -11734,6 +11753,9 @@ 0f02 GF108 [GeForce GT 730] 0f03 GF108 [GeForce GT 610] 0f06 GF108 [GeForce GT 730] + 0fa0 GK11x [GK11x_FPGA] + 0fa5 GK11x + 0fa7 GK11x [Tegra on x86 (PEATRANS)] 0fb0 GM200 High Definition Audio 0fb8 GP108 High Definition Audio Controller 0fb9 GP107GL High Definition Audio Controller @@ -11743,13 +11765,18 @@ 0fc0 GK107 [GeForce GT 640 OEM] 0fc1 GK107 [GeForce GT 640] 0fc2 GK107 [GeForce GT 630 OEM] + 0fc4 GK107 [D14P1-15] 0fc5 GK107 [GeForce GT 1030] 0fc6 GK107 [GeForce GTX 650] 1043 8428 GTX650-DC-1GD5 0fc8 GK107 [GeForce GT 740] 0fc9 GK107 [GeForce GT 730] + 0fcb GK107 [EXK107] + 0fcc GK107 [GeForce GT 720] 0fcd GK107M [GeForce GT 755M] 0fce GK107M [GeForce GT 640M LE] + 0fcf GK107 [GEN3 ESI] + 0fd0 GK107 [NB1G] 0fd1 GK107M [GeForce GT 650M] 1043 1597 GeForce GT 650M 1043 15a7 GeForce GT 650M @@ -11764,10 +11791,15 @@ 0fd3 GK107M [GeForce GT 640M LE] 0fd4 GK107M [GeForce GTX 660M] 0fd5 GK107M [GeForce GT 650M Mac Edition] - 0fd6 GK107M + 0fd6 GK107M [N13P-GS-W] + 0fd7 GK107 [GK107-GTX] 0fd8 GK107M [GeForce GT 640M Mac Edition] 0fd9 GK107M [GeForce GT 645M] - 0fdb GK107M + 0fda GK107 [GK107-ES-A1] + 0fdb GK107 [GK107-ESP-A1] + 0fdc GK107 [GK107-INT22-A1] + 0fdd GK107 [GK107-INT11-A1] + 0fde GK107 [GK107-ES-KA-E1] 0fdf GK107M [GeForce GT 740M] 0fe0 GK107M [GeForce GTX 660M Mac Edition] 0fe1 GK107M [GeForce GT 730M] @@ -11788,6 +11820,7 @@ 0fed GK107M [GeForce 820M] 0fee GK107M [GeForce 810M] 0fef GK107GL [GRID K340] + 0ff0 GK107 [NB1Q] 0ff1 GK107 [NVS 1000] 0ff2 GK107GL [GRID K1] 0ff3 GK107GL [Quadro K420] @@ -12307,9 +12340,13 @@ 11a2 GK104M [GeForce GTX 675MX Mac Edition] 11a3 GK104M [GeForce GTX 680MX] 106b 010d iMac 13,2 + 11a4 GK104 [GK104-ESA] + 11a5 GK104 [GK104-ESA] 11a7 GK104M [GeForce GTX 675MX] 11a8 GK104GLM [Quadro K5100M] 11a9 GK104M [GeForce GTX 870M] + 11aa GK104 [GK104-INT] + 11ac GK104 [GK104-CS] 11af GK104GLM [GRID IceCube] 11b0 GK104GL [GRID K240Q / K260Q vGPU] 10de 101a GRID K240Q @@ -12327,6 +12364,7 @@ 11be GK104GLM [Quadro K3000M] 11bf GK104GL [GRID K2] 11c0 GK106 [GeForce GTX 660] + 11c1 GK106 [D14P2-30] 11c2 GK106 [GeForce GTX 650 Ti Boost] 1043 845b GeForce GTX 650 Ti Boost DirectCU II OC 1462 2874 GeForce GTX 650 Ti Boost TwinFrozr II OC @@ -12342,6 +12380,10 @@ 11c7 GK106 [GeForce GTX 750 Ti] 11c8 GK106 [GeForce GTX 650 OEM] 11cb GK106 [GeForce GT 740] + 11d0 GK106 [GK106-INT353] + 11d1 GK106 [GK106-INT343] + 11d2 GK106 [GK106-INT232] + 11d3 GK106 [GK106-ES] 11e0 GK106M [GeForce GTX 770M] 11e1 GK106M [GeForce GTX 765M] 11e2 GK106M [GeForce GTX 765M] @@ -12350,6 +12392,7 @@ 11e7 GK106M 11fa GK106GL [Quadro K4000] 11fc GK106GLM [Quadro K2100M] + 11ff GK106 [NB1Q] 1200 GF114 [GeForce GTX 560 Ti] 1201 GF114 [GeForce GTX 560] 1202 GF114 [GeForce GTX 560 Ti OEM] @@ -12397,7 +12440,9 @@ 1280 GK208 [GeForce GT 635] 1281 GK208 [GeForce GT 710] 1282 GK208 [GeForce GT 640 Rev. 2] + 1283 GK208 [D15M2-10] 1284 GK208 [GeForce GT 630 Rev. 2] + 1285 GK208 [GK208-100] 1286 GK208 [GeForce GT 720] 1287 GK208B [GeForce GT 730] 1288 GK208B [GeForce GT 720] @@ -12437,8 +12482,14 @@ 17aa 36af GeForce 920M 129a GK208BM [GeForce 910M] 12a0 GK208 + 12ad GK208 [GK208-ES] + 12ae GK208 [GK208-CS1-C] + 12af GK208 [GK208-INT] + 12b0 GK208 [GK208-CS-Q] + 12b1 GK208 [GK208 INT] 12b9 GK208GLM [Quadro K610M] 12ba GK208GLM [Quadro K510M] + 130b GK110 [Q12U-1] 1340 GM108M [GeForce 830M] 103c 2b2b GeForce 830A 1341 GM108M [GeForce 840M] @@ -12483,6 +12534,8 @@ 103c 2b4c GeForce GTX 960A 139c GM107M [GeForce 940M] 139d GM107M [GeForce GTX 750 Ti] + 13ad GM204 [GM107 INT52] + 13ae GM204 [GM107 CS1] 13b0 GM107GLM [Quadro M2000M] 13b1 GM107GLM [Quadro M1000M] 13b2 GM107GLM [Quadro M600M] @@ -12497,15 +12550,19 @@ 10de 110a GRID M40 10de 1160 Tesla M10 10de 11d2 GRID M10-8Q + 13be GM204 [GM107 CS1] + 13bf GM204 [GM107 INT52] 13c0 GM204 [GeForce GTX 980] 1043 8504 GTX980-4GD5 13c1 GM204 13c2 GM204 [GeForce GTX 970] 13c3 GM204 + 13c4 GM204 [D17U-20] 13d7 GM204M [GeForce GTX 980M] 13d8 GM204M [GeForce GTX 960 OEM / 970M] 13d9 GM204M [GeForce GTX 965M] 13da GM204M [GeForce GTX 980 Mobile] + 13e4 GM204 [Graphics Device ES-A] 13e7 GM204GL [GeForce GTX 980 Engineering Sample] 13f0 GM204GL [Quadro M5000] 13f1 GM204GL [Quadro M4000] @@ -12531,6 +12588,7 @@ 1430 GM206GL [Quadro M2000] 1431 GM206GL [Tesla M4] 1436 GM206GLM [Quadro M2200 Mobile] + 15c2 GP100 [CMP 100-100] 15f0 GP100GL [Quadro GP100] 15f1 GP100GL 15f7 GP100GL [Tesla P100 PCIe 12GB] @@ -12538,6 +12596,7 @@ 15f9 GP100GL [Tesla P100 SXM2 16GB] 15fa GP100GL [DGX Station / PH402 SKU 200] 15fb GP100GL [GP100 SKU 200] + 15fc GP100GL [Tesla P100-DGXS-16GB] 15ff GP100GL [GP100 SKU 15ff] 1617 GM204M [GeForce GTX 980M] 1618 GM204M [GeForce GTX 970M] @@ -12697,6 +12756,7 @@ 1d81 GV100 [TITAN V] 1d83 GV100 [CMP 100-200] 1d84 GV100 [CMP 100-210] + 1db0 GV100GL [Tesla GV100 SXM2-16GB SKU 890] 1db1 GV100GL [Tesla V100 SXM2 16GB] 1db2 GV100GL [Tesla V100 DGXS 16GB] 1db3 GV100GL [Tesla V100 FHHL 16GB] @@ -12713,6 +12773,7 @@ 1dc1 GV100 [CMP 100-200] 1df0 GV100GL [Tesla PG500-216] 1df2 GV100GL [Tesla PG503-216] + 1df4 GV100 [CMP 100-210] 1df5 GV100GL [Tesla V100 SXM2 16GB] 1df6 GV100GL [Tesla V100S PCIe 32GB] 1e02 TU102 [TITAN RTX] @@ -12726,6 +12787,7 @@ 1e30 TU102GL [Quadro RTX 6000/8000] 10de 129e Quadro RTX 8000 10de 12ba Quadro RTX 6000 + 1e35 TU102GL [Tesla T10] 1e36 TU102GL [Quadro RTX 6000] 1e37 TU102GL [Tesla T10 16GB / GRID RTX T10-2/T10-4/T10-8] 10de 1304 Tesla T10 16GB @@ -12823,7 +12885,7 @@ 1fd9 TU117BM [GeForce GTX 1650 Mobile Refresh] 1fdd TU117BM [GeForce GTX 1650 Mobile Refresh] 1ff0 TU117GL [T1000 8GB] - 1ff2 TU117GL [T400 4GB] + 1ff2 TU117GL [T400 4GB / T400E] 1ff9 TU117GLM [Quadro T1000 Mobile] 2080 GA100 2081 GA100 @@ -12902,8 +12964,10 @@ 2321 GH100 [H100L 94GB] 2322 GH100 [H800 PCIe] 2324 GH100 [H800] + 2329 GH100 [H20] 2330 GH100 [H100 SXM5 80GB] 2331 GH100 [H100 PCIe] + 2335 GH100 [H200 SXM 141GB] 2336 GH100 [H100] 2337 GH100 [H100 SXM5 64GB] 2338 GH100 [H100 SXM5 96GB] @@ -12932,6 +12996,9 @@ 2488 GA104 [GeForce RTX 3070 Lite Hash Rate] 2489 GA104 [GeForce RTX 3060 Ti Lite Hash Rate] 248a GA104 [CMP 70HX] + 248c GA104 [GeForce RTX 3070 Ti] + 248d GA104 [GeForce RTX 3070] + 248e GA104 [GeForce RTX 3060 Ti] 249c GA104M [GeForce RTX 3080 Mobile / Max-Q 8GB/16GB] 249d GA104M [GeForce RTX 3070 Mobile / Max-Q] 249f GA104M @@ -12991,6 +13058,8 @@ 25ac GN20-P0-R-K2 [GeForce RTX 3050 6GB Laptop GPU] 25ad GA107 [GeForce RTX 2050] 25af GA107 [GeForce RTX 3050 Engineering Sample] + 25b0 GA107GL [RTX A1000] + 25b2 GA107GL [RTX A400] 25b5 GA107GLM [RTX A4 Mobile] # A16 - 25B6 10DE 14A9 / A2 - 25B6 10DE 157E 25b6 GA107GL [A2 / A16] @@ -13024,6 +13093,7 @@ 2703 AD103 [GeForce RTX 4080 SUPER] 2704 AD103 [GeForce RTX 4080] 2705 AD103 [GeForce RTX 4070 Ti SUPER] + 2709 AD103 [GeForce RTX 4070] 2717 GN21-X11 [GeForce RTX 4090 Laptop GPU] 2730 AD103GLM [RTX 5000 Ada Generation Laptop GPU] 2757 GN21-X11 @@ -13032,6 +13102,7 @@ 2783 AD104 [GeForce RTX 4070 SUPER] 2785 AD104 [AC AD104 20GB] 2786 AD104 [GeForce RTX 4070] + 2788 AD104 [GeForce RTX 4060 Ti] 27a0 AD104M [GeForce RTX 4080 Max-Q / Mobile] 27b0 AD104GL [RTX 4000 SFF Ada Generation] 27b1 AD104GL [RTX 4500 Ada Generation] @@ -13046,6 +13117,7 @@ 27fb AD104GLM [RTX 3500 Ada Generation Embedded GPU] 2803 AD106 [GeForce RTX 4060 Ti] 2805 AD106 [GeForce RTX 4060 Ti 16GB] + 2808 AD106 [GeForce RTX 4060] 2820 AD106M [GeForce RTX 4070 Max-Q / Mobile] 2838 AD106GLM [RTX 3000 Ada Generation Laptop GPU] 2860 AD106M [GeForce RTX 4070 Max-Q / Mobile] @@ -13053,7 +13125,11 @@ 2882 AD107 [GeForce RTX 4060] 28a0 AD107M [GeForce RTX 4060 Max-Q / Mobile] 28a1 AD107M [GeForce RTX 4050 Max-Q / Mobile] + 28b0 AD107GL [RTX 2000 / 2000E Ada Generation] 28b8 AD107GLM [RTX 2000 Ada Generation Laptop GPU] + 28b9 AD107GLM [RTX 1000 Ada Generation Laptop GPU] + 28ba AD107GLM [RTX 500 Ada Generation Laptop GPU] + 28bb AD107GLM [RTX 500 Ada Generation Laptop GPU] 28e0 AD107M [GeForce RTX 4060 Max-Q / Mobile] 28e1 AD107M [GeForce RTX 4050 Max-Q / Mobile] 28f8 AD107GLM [RTX 2000 Ada Generation Embedded GPU] @@ -13308,6 +13384,7 @@ 5762 RTS5762 NVMe SSD Controller 5763 RTS5763DL NVMe SSD Controller (DRAM-less) 5765 RTS5765DL NVMe SSD Controller (DRAM-less) + 5770 RTS5770DL NVMe SSD Controller (DRAM-less) 5772 RTS5772DL NVMe SSD Controller (DRAM-less) 8029 RTL-8029(AS) 10b8 2011 EZ-Card (SMC1208) @@ -13317,6 +13394,7 @@ 1259 2400 AT-2400 1af4 1100 QEMU Virtual Machine 8125 RTL8125 2.5GbE Controller + 4c52 2022 LRES2022PT Single-port 2.5Gb Ethernet Network Adapter 8129 RTL-8129 10ec 8129 RT8129 Fast Ethernet Adapter 11ec 8129 RTL8111/8168 PCIe Gigabit Ethernet (misconfigured) @@ -13416,7 +13494,7 @@ 1043 8505 P8 series motherboard 1043 8554 H81M-C Motherboard 1043 859e AM1I-A Motherboard - 1043 8677 PRIME B450M-A Motherboard + 1043 8677 Onboard RTL8111H Ethernet 105b 0d7c D270S/D250S Motherboard 10ec 8168 RTL8111/8168 PCI Express Gigabit Ethernet controller 144d c652 RTL8168 on a NP300E5C series laptop @@ -13432,6 +13510,7 @@ 17aa 3098 ThinkCentre E73 17aa 3814 Z50-75 17aa 3823 Lenovo V130-15IGM Laptop - Type 81HL + 17aa 5068 Thinkpad E480/E580 17aa 5124 ThinkPad E595 1849 8168 Motherboard (one of many) 7470 3468 TG-3468 Gigabit PCI Express Network Adapter @@ -16401,6 +16480,38 @@ 11e2 Samsung Information Systems America 11e3 Quicklogic Corporation 0001 COM-ON-AIR Dosch&Amand DECT + 0010 QL5032 (PQFP208) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 0011 QL5032 (PBGA256) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 0012 QL5232 (PQFP208) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 11e3 1204 Becker & Hickl SPC-130 + 11e3 1207 Becker & Hickl DDG-200 + 11e3 1209 Becker & Hickl SHM-180 + 11e3 120c Becker & Hickl PMM-428 + 0013 QL5232 (PBGA456) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 0014 QL5030 (TQFP144) [QuickPCI] 33 MHz/32-bit PCI Target with Embedded Programmable Logic and Dual Port SRAM + 0015 QL5130 (TQFP144) [QuickPCI] 33 MHz/32-bit PCI Target with Embedded Programmable Logic and Dual Port SRAM + 0016 QL5130 (PQFP208) [QuickPCI] 33 MHz/32-bit PCI Target with Embedded Programmable Logic and Dual Port SRAM + 11e3 120b Becker & Hickl DEL-350 + 0017 QL5130 (PBGA256) [QuickPCI] 33 MHz/32-bit PCI Target with Embedded Programmable Logic and Dual Port SRAM + 0019 QL5332 (PQFP208) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 001a QL5332 (PBGA256) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 001b QL5432 (PQFP208) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 11e3 120d Becker & Hickl SPC-140 + 11e3 1211 Becker & Hickl GVD-120 + 11e3 1212 Becker & Hickl DDG-210 + 001c QL5432 (PBGA456) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 001d QL5632 (PQFP208) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 001e QL5632 (PBGA280) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 001f QL5632 (PBGA484) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 0020 QL5632 (PBGA516) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 0021 QL5732 (PQFP208) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 0022 QL5732 (PBGA280) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 0023 QL5732 (PBGA484) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 0024 QL5732 (PBGA516) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 002d QL5022 (TQFP144) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 002e QL5022 (PQFP208) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 002f QL5020 (TQFP144) [QuickPCI] 33 MHz/32-bit PCI Target with Embedded Programmable Logic and Dual Port SRAM + 0030 QL5020 (PQFP208) [QuickPCI] 33 MHz/32-bit PCI Target with Embedded Programmable Logic and Dual Port SRAM 0560 QL5064 Companion Design Demo Board 5030 PC Watchdog 8417 QL5064 [QuickPCI] PCI v2.2 bridge for SMT417 Dual TMS320C6416T PMC Module @@ -16649,6 +16760,7 @@ 8331 O2 Flash Memory Card 8520 SD/MMC Card Reader Controller 8621 SD/MMC Card Reader Controller + 17aa 5068 Thinkpad E480/E580 8760 FORESEE E2M2 NVMe SSD 1218 Hybricon Corp. 1219 First Virtual Corporation @@ -17009,6 +17121,7 @@ 0820 SM820 Lynx3D 0910 SM910 2260 SM2260 NVMe SSD Controller + 2261 SM2261XT x2 NVMe SSD Controller (DRAM-less) 2262 SM2262/SM2262EN SSD Controller 2263 SM2263EN/SM2263XT (DRAM-less) NVMe SSD Controllers 2269 SM2269XT (DRAM-less) NVMe SSD Controller @@ -17498,6 +17611,7 @@ 8152 PI7C8152A/PI7C8152B/PI7C8152BI PCI-to-PCI Bridge 8154 PI7C8154A/PI7C8154B/PI7C8154BI PCI-to-PCI Bridge 8619 PI7C9X2G1616PR PCIe2 16-Port/16-Lane Packet Switch + b404 PI7C9X2G404 EV/SV PCIe2 4-Port/4-Lane Packet Switch e110 PI7C9X110 PCIe- to-PCI bridge 1775 11cc CC11/CL11 CompactPCI Bridge e111 PI7C9X111SL PCIe-to-PCI Reversible Bridge @@ -17848,8 +17962,25 @@ 1344 5000 6.4 TB U.2 1344 6000 12.8TB U.2 51b7 7500 PRO NVMe SSD + 1028 22e7 DC NVMe 7500 U.2 SED RI 15.36TB + 1028 22e8 DC NVMe 7500 U.2 SED RI 7.68TB + 1028 22e9 DC NVMe 7500 U.2 SED RI 3.84TB + 1028 22ea DC NVMe 7500 U.2 SED RI 1.92TB + 1028 22eb DC NVMe 7500 U.2 SED RI 960GB + 1028 22ec DC NVMe 7500 U.2 ISE RI 15.36TB + 1028 22ed DC NVMe 7500 U.2 ISE RI 7.68TB + 1028 22ee DC NVMe 7500 U.2 ISE RI 3.84TB + 1028 22ef DC NVMe 7500 U.2 ISE RI 1.92TB + 1028 22f0 DC NVMe 7500 U.2 ISE RI 960GB 51b8 7500 MAX NVMe SSD + 1028 22f1 DC NVMe 7500 U.2 ISE MU 12.8TB + 1028 22f2 DC NVMe 7500 U.2 ISE MU 6.4TB + 1028 22f3 DC NVMe 7500 U.2 ISE MU 3.2TB + 1028 22f4 DC NVMe 7500 U.2 ISE MU 1.6TB + 1028 22f5 DC NVMe 7500 U.2 ISE MU 800GB 51b9 6500 ION NVMe SSD + 1028 22e6 Ent NVMe 6500 RI 30.72TB + 1028 22f6 Ent NVMe 6500 RI FIPS 30.72TB 51c0 7400 PRO NVMe SSD 1028 2162 EC NVMe OPAL 7400 RI M.2 480GB 1028 2163 EC NVMe OPAL 7400 RI M.2 960GB @@ -17887,7 +18018,38 @@ 1344 4000 U.3 3200GB 1344 5000 U.3 6400GB 51c3 7450 PRO NVMe SSD + 1028 226b EC NVMe FIPS 7450 RI M.2 110 960GB + 1028 226c EC NVMe ISE 7450 RI M.2 80 480GB + 1028 226d EC NVMe ISE 7450 RI M.2 80 960GB + 1028 226e EC NVMe SED 7450 RI M.2 80 480GB + 1028 226f EC NVMe SED 7450 RI M.2 80 960GB + 1028 2270 EC NVMe FIPS 7450 RI M.2 80 480GB + 1028 2271 EC NVMe FIPS 7450 RI M.2 80 960GB + 1028 2273 EC NVMe ISE 7450 RI M.2 110 960GB + 1028 2274 EC NVMe ISE 7450 RI M.2 110 1920GB + 1028 2275 EC NVMe ISE 7450 RI M.2 110 3840GB + 1028 2278 DC NVMe ISE 7450 RI U.2 960GB + 1028 2279 DC NVMe ISE 7450 RI U.2 1.92TB + 1028 227a DC NVMe ISE 7450 RI U.2 3.84TB + 1028 227b DC NVMe ISE 7450 RI U.2 7.68TB + 1028 227c DC NVMe ISE 7450 RI U.2 15.36TB + 1028 227d DC NVMe SED 7450 RI U.2 960GB + 1028 227e DC NVMe SED 7450 RI U.2 1.92TB + 1028 227f DC NVMe SED 7450 RI U.2 3.84TB + 1028 2280 DC NVMe SED 7450 RI U.2 7.68TB + 1028 2281 DC NVMe SED 7450 RI U.2 15.36TB 51c4 7450 MAX NVMe SSD + 1028 2272 EC NVMe ISE 7450 MU M.2 80 800GB + 1028 228b DC NVMe SED 7450 MU U.2 800GB + 1028 228c DC NVMe ISE 7450 MU U.2 800GB + 1028 228d DC NVMe SED 7450 MU U.2 1.6TB + 1028 228e DC NVMe ISE 7450 MU U.2 1.6TB + 1028 228f DC NVMe SED 7450 MU U.2 3.2TB + 1028 2290 DC NVMe ISE 7450 MU U.2 3.2TB + 1028 2291 DC NVMe SED 7450 MU U.2 6.4TB + 1028 2292 DC NVMe ISE 7450 MU U.2 6.4TB + 1028 2293 DC NVMe SED 7450 MU U.2 12.8TB + 1028 2294 DC NVMe ISE 7450 MU U.2 12.8TB 1344 3000 U.3 1600GB [MTFDKCB1T6TFS/MTFDKCC1T6TFS] 5404 2210 NVMe SSD [Cobain] 5405 2300 NVMe SSD [Santana] @@ -19493,14 +19655,14 @@ 6002 T6225-SO-CR Unified Wire Ethernet Controller 6003 T6425-CR Unified Wire Ethernet Controller 6004 T6425-SO-CR Unified Wire Ethernet Controller - 6005 T6225-OCP-SO Unified Wire Ethernet Controller - 6006 T62100-OCP-SO Unified Wire Ethernet Controller + 6005 T6225-SO-OCP3 Unified Wire Ethernet Controller + 6006 T6225-OCP3 Unified Wire Ethernet Controller 6007 T62100-LP-CR Unified Wire Ethernet Controller 6008 T62100-SO-CR Unified Wire Ethernet Controller 6009 T6210-BT Unified Wire Ethernet Controller 600d T62100-CR Unified Wire Ethernet Controller 6011 T6225-LL-CR Unified Wire Ethernet Controller - 6014 T61100-OCP-SO Unified Wire Ethernet Controller + 6014 T62100-SO-OCP3 Unified Wire Ethernet Controller 6015 T6201-BT Unified Wire Ethernet Controller 6080 T6225-6080 Unified Wire Ethernet Controller 6081 T62100-6081 Unified Wire Ethernet Controller @@ -19519,14 +19681,14 @@ 6402 T6225-SO-CR Unified Wire Ethernet Controller 6403 T6425-CR Unified Wire Ethernet Controller 6404 T6425-SO-CR Unified Wire Ethernet Controller - 6405 T6225-OCP-SO Unified Wire Ethernet Controller - 6406 T62100-OCP-SO Unified Wire Ethernet Controller + 6405 T6225-SO-OCP3 Unified Wire Ethernet Controller + 6406 T6225-OCP3 Unified Wire Ethernet Controller 6407 T62100-LP-CR Unified Wire Ethernet Controller 6408 T62100-SO-CR Unified Wire Ethernet Controller 6409 T6210-BT Unified Wire Ethernet Controller 640d T62100-CR Unified Wire Ethernet Controller 6411 T6225-LL-CR Unified Wire Ethernet Controller - 6414 T61100-OCP-SO Unified Wire Ethernet Controller + 6414 T62100-SO-OCP3 Unified Wire Ethernet Controller 6415 T6201-BT Unified Wire Ethernet Controller 6480 T6225-6080 Unified Wire Ethernet Controller 6481 T62100-6081 Unified Wire Ethernet Controller @@ -19545,14 +19707,14 @@ 6502 T6225-SO-CR Unified Wire Storage Controller 6503 T6425-CR Unified Wire Storage Controller 6504 T6425-SO-CR Unified Wire Storage Controller - 6505 T6225-OCP-SO Unified Wire Storage Controller - 6506 T62100-OCP-SO Unified Wire Storage Controller + 6505 T6225-SO-OCP3 Unified Wire Storage Controller + 6506 T6225-OCP3 Unified Wire Storage Controller 6507 T62100-LP-CR Unified Wire Storage Controller 6508 T62100-SO-CR Unified Wire Storage Controller 6509 T6210-BT Unified Wire Storage Controller 650d T62100-CR Unified Wire Storage Controller 6511 T6225-LL-CR Unified Wire Storage Controller - 6514 T61100-OCP-SO Unified Wire Storage Controller + 6514 T62100-SO-OCP3 Unified Wire Storage Controller 6515 T6201-BT Unified Wire Storage Controller 6580 T6225-6080 Unified Wire Storage Controller 6581 T62100-6081 Unified Wire Storage Controller @@ -19570,14 +19732,14 @@ 6602 T6225-SO-CR Unified Wire Storage Controller 6603 T6425-CR Unified Wire Storage Controller 6604 T6425-SO-CR Unified Wire Storage Controller - 6605 T6225-OCP-SO Unified Wire Storage Controller - 6606 T62100-OCP-SO Unified Wire Storage Controller + 6605 T6225-SO-OCP3 Unified Wire Storage Controller + 6606 T6225-OCP3 Unified Wire Storage Controller 6607 T62100-LP-CR Unified Wire Storage Controller 6608 T62100-SO-CR Unified Wire Storage Controller 6609 T6210-BT Unified Wire Storage Controller 660d T62100-CR Unified Wire Storage Controller 6611 T6225-LL-CR Unified Wire Storage Controller - 6614 T61100-OCP-SO Unified Wire Storage Controller + 6614 T62100-SO-OCP3 Unified Wire Storage Controller 6615 T6201-BT Unified Wire Storage Controller 6680 T6225-6080 Unified Wire Storage Controller 6681 T62100-6081 Unified Wire Storage Controller @@ -19595,14 +19757,14 @@ 6802 T6225-SO-CR Unified Wire Ethernet Controller [VF] 6803 T6425-CR Unified Wire Ethernet Controller [VF] 6804 T6425-SO-CR Unified Wire Ethernet Controller [VF] - 6805 T6225-OCP-SO Unified Wire Ethernet Controller [VF] - 6806 T62100-OCP-SO Unified Wire Ethernet Controller [VF] + 6805 T6225-SO-OCP3 Unified Wire Ethernet Controller [VF] + 6806 T6225-OCP3 Unified Wire Ethernet Controller [VF] 6807 T62100-LP-CR Unified Wire Ethernet Controller [VF] 6808 T62100-SO-CR Unified Wire Ethernet Controller [VF] 6809 T6210-BT Unified Wire Ethernet Controller [VF] 680d T62100-CR Unified Wire Ethernet Controller [VF] 6811 T6225-LL-CR Unified Wire Ethernet Controller [VF] - 6814 T61100-OCP-SO Unified Wire Ethernet Controller [VF] + 6814 T62100-SO-OCP3 Unified Wire Ethernet Controller [VF] 6815 T6201-BT Unified Wire Ethernet Controller [VF] 6880 T6225-6080 Unified Wire Ethernet Controller [VF] 6881 T62100-6081 Unified Wire Ethernet Controller [VF] @@ -19847,6 +20009,7 @@ 1028 225d NVMe PM1745 MU U.2 6.4TB 1028 225e NVMe FIPS PM1745 MU U.2 12.8TB 1028 225f NVMe PM1745 MU U.2 12.8TB + a900 NVMe SSD Controller PM9DXa ecec Exynos 8895 PCIe Root Complex 144e OLITEC 144f Askey Computer Corp. @@ -20434,6 +20597,7 @@ 193d 1003 530F-B 193d 1006 530F-L 193d 100f NIC-ETH522i-Mb-2x10G + 4c52 9812 LREC9812AF Dual-port 10Gb Ethernet Server Adapter 1690 NetXtreme BCM57760 Gigabit Ethernet PCIe 1691 NetLink BCM57788 Gigabit Ethernet PCIe 1028 04aa XPS 8300 @@ -20461,6 +20625,7 @@ 16a1 BCM57840 NetXtreme II 10 Gigabit Ethernet 1043 866e PEB-10G/57840-2T 10GBase-T Network Adapter 193d 100b NIC-ETH521i-Mb-4x10G + 4c52 9814 LREC9814AF Quad-port 10Gb Ethernet Server Adapter 16a2 BCM57840 NetXtreme II 10/20-Gigabit Ethernet 103c 1916 FlexFabric 20Gb 2-port 630FLB Adapter 103c 1917 FlexFabric 20Gb 2-port 630M Adapter @@ -20680,7 +20845,7 @@ 14e4 5425 NetXtreme-E Quad-port 25G SFP28 Ethernet OCP 3.0 Adapter (BCM957504-N425G) 14e4 d142 NetXtreme-E P425D BCM57504 4x25G SFP28 PCIE 1752 BCM57502 NetXtreme-E 10Gb/25Gb/40Gb/50Gb Ethernet - 1760 BCM57608 NetXtreme-E 10Gb/25Gb/50Gb/100Gb/200Gb/400Gb Ethernet + 1760 BCM57608 10Gb/25Gb/50Gb/100Gb/200Gb/400Gb Ethernet 14e4 d125 BCM57608 2x200G PCIe Ethernet NIC 1800 BCM57502 NetXtreme-E Ethernet Partition 1801 BCM57504 NetXtreme-E Ethernet Partition @@ -21508,6 +21673,7 @@ 9290 FPGA Card 9300 Universal Exhaust Gas Oxygen Sensor Simulator 9310 Digital Programmable Resistor + 9320 Arria 10 FPGA Card 9350 Analog Input Card 1543 SILICON Laboratories 3052 Intel 537 [Winmodem] @@ -21719,6 +21885,10 @@ 021f CX8 Family [ConnectX-8 Secure Flash Recovery] 0220 BF4 Family Flash Recovery [BlueField-4 SoC Flash Recovery] 0221 BF4 Family Secure Flash Recovery [BlueField-4 Secure Flash Recovery] + 0222 CX8 PCIe Switch Family [ConnectX-8 PCIe Switch Flash Recovery] + 0223 CX8 PCIe Switch Family [ConnectX-8 PCIe Switch Secure Flash Recovery-RMA] + 0224 CX9 Family [ConnectX-9 Flash Recovery] + 0225 CX9 Family [ConnectX-9 Secure Flash Recovery-RMA] 024e MT53100 [Spectrum-2, Flash recovery mode] 024f MT53100 [Spectrum-2, Secure Flash recovery mode] 0250 Spectrum-3, Flash recovery mode @@ -21750,6 +21920,9 @@ 0285 Sagitta RMA 0286 LibraE Flash Recovery 0287 LibraE RMA +# Flash recovery + 0288 Arcus2 + 0289 Arcus2 RMA 1002 MT25400 Family [ConnectX-2 Virtual Function] 1003 MT27500 Family [ConnectX-3] 1014 04b5 PCIe3 40GbE RoCE Converged Host Bus Adapter for Power @@ -21850,6 +22023,8 @@ 1020 MT28860 1021 MT2910 Family [ConnectX-7] 1023 CX8 Family [ConnectX-8] + 1024 CX8 PCIe Switch Family [ConnectX-8 PCIe Switch] + 1025 CX9 Family [ConnectX-9] 1974 MT28800 Family [ConnectX-5 PCIe Bridge] 1975 MT416842 Family [BlueField SoC PCIe Bridge] 1976 MT28908 Family [ConnectX-6 PCIe Bridge] @@ -21859,11 +22034,14 @@ 197a MT43162 Family [BlueField-3 Lx SoC PCIe Bridge] 197b MT43244 Family [BlueField-3 SoC PCIe Bridge] 197c ConnectX/BlueField Family mlx5Gen PCIe Bridge [PCIe Bridge] + 197d CX8 Family [ConnectX-8 PCIe Bridge] + 197e CX9 Family [ConnectX-9 PCIe Bridge] 2020 MT2892 Family [ConnectX-6 Dx Emulated PCIe Bridge] 2021 MT42822 Family [BlueField-2 SoC Emulated PCIe Bridge] 2023 MT2910 Family [ConnectX-7 Emulated PCIe Bridge] 2024 MT43244 Family [BlueField-3 SoC Emulated PCIe Bridge] 2025 ConnectX/BlueField Family mlx5Gen Emulated PCIe Bridge [Emulated PCIe Bridge] + 2100 CX8 Family [CX8 Data Direct Interface] 4117 MT27712A0-FDCF-AE 1bd4 0039 SN10XMP2P25 1bd4 003a 25G SFP28 SP EO251FM9 Adapter @@ -21929,6 +22107,7 @@ a2df BF4 Family integrated network controller [BlueField-4 integrated network controller] b200 ArcusE b201 LibraE + b202 Arcus2 c2d1 BlueField DPU Family Auxiliary Communication Channel [BlueField Family] c2d2 MT416842 BlueField SoC management interfac c2d3 MT42822 BlueField-2 SoC Management Interface @@ -21995,12 +22174,14 @@ 5019 WD Green SN350 240GB (DRAM-less) / SN560E NVMe SSD 501a SanDisk Ultra 3D / WD Blue SN570 NVMe SSD (DRAM-less) 501d WD Blue SN550 NVMe SSD 2TB (DRAM-less) - 501e PC SN735 NVMe SSD (DRAM-less) + 501e PC SN735 / WD_BLACK SN750 SE NVMe SSD (DRAM-less) 501f WD PC SN735 NVMe SSD 512GB (DRAM-less) 5025 WD Blue SN570 NVMe SSD 2TB 5026 WD PC SN735 NVMe SSD 1TB (DRAM-less) 5028 WD CH SN560 NVMe SSD 5030 WD Black SN850X NVMe SSD + 5034 WD PC SN5000S M.2 2230 NVMe SSD (DRAM-less) + 5036 WD PC SN5000S M.2 2280 NVMe SSD (DRAM-less) 5041 WD Blue SN580 NVMe SSD (DRAM-less) 5042 WD Black SN770M NVMe SSD (DRAM-less) 15b8 ADDI-DATA GmbH @@ -23753,7 +23934,7 @@ 0100 A104d QUAD T1/E1 AFT card 0300 A101 single-port T1/E1 0400 A104u Quad T1/E1 AFT -1924 Solarflare Communications +1924 AMD Solarflare 0703 SFC4000 rev A net [Solarstorm] 10b8 0102 SMC10GPCIe-10BT (A2) [TigerCard] 10b8 0103 SMC10GPCIe-10BT (A3) [TigerCard] @@ -24070,8 +24251,11 @@ 196d Club-3D BV 196e PNY 1971 AGEIA Technologies, Inc. - 1011 Physics Processing Unit [PhysX] + 0000 Physics Processing Unit [PhysX] 100 Series PCI Express Card +# The PCI and PCIe versions have a different PID + 1011 Physics Processing Unit [PhysX] 100 Series PCI Card 1043 0001 PhysX P1 + 1021 Physics Processing Unit [PhysX] 200 Series PCI Express Card # nee Eberspaecher Electronics 1974 Star Electronics GmbH & Co. KG 0009 FlexCard PMC-II @@ -24727,6 +24911,7 @@ 1b96 4000 WD_BLACK AN1500 NVMe SSD 1d49 0306 ThinkSystem M.2 NVMe 2-Bay RAID Enablement Kit 1d49 0307 ThinkSystem 7mm NVMe 2-Bay Rear RAID Enablement Kit + 2b42 88W8997 2.4/5 GHz Dual-Band 2x2 Wi-Fi® 5 (802.11ac) + Bluetooth® 5.3 Solution 2b43 NXP 88W9098 Wi-Fi 6 (ax) MAC #1 2b44 NXP 88W9098 Wi-Fi 6 (ax) MAC #2 2b45 NXP 88W9098 Bluetooth 5.3 @@ -24775,6 +24960,7 @@ # 2xHDMI and 2xHD-SDI inputs e5f4 MPEG2 and H264 Encoder-Transcoder f1c4 Dual ASI-RX/TX-CI card +1b61 Byd Precision Manufacture Co.,Ltd 1b66 DELTACAST 0007 DELTA-3G-elp-d 1b6f Etron Technology, Inc. @@ -25005,6 +25191,21 @@ 1bee IXXAT Automation GmbH 0002 CAN-IB100/PCIe 0003 CAN-IB200/PCIe + 0004 CAN-IB120/PCIe Mini + 0005 CAN-IB130/PCIe 104 + 0006 CAN-IB230/PCIe 104 + 000e CAN-IB500/PCIe + 000f CAN-IB600/PCIe + 0010 CAN-IB300/PCI + 0011 CAN-IB400/PCI + 0012 CAN-IB520/PCIe Mini + 0016 CAN-IB410/PMC + 001c CAN-IB810/PMC + 001e INpact PCIe + 001f INpact PCIe Mini + 0029 INpact M.2 + 002d CAN-IB630/PCIe 104 + 002e CAN-IB640/PCIe 1bef Lantiq 0011 MIPS SoC PCI Express Port 1bf4 VTI Instruments Corporation @@ -25133,6 +25334,7 @@ 2429 PE6011 NVMe Solid State Drive 243b PE6110 NVMe Solid State Drive 1c5c 0100 PE6110 NVMe Solid State Drive + 2527 PE4010 NVMe Solid State Drive 2839 PE8000 Series NVMe Solid State Drive 1028 2143 DC NVMe SED PE8010 RI U.2 960GB 1028 2144 DC NVMe PE8010 RI U.2 960GB @@ -25259,6 +25461,14 @@ 1c5f 5445 NVMe SSD PBlaze7 7946 6400G E1.S 1c5f 5450 NVMe SSD PBlaze7 7946 12800G AIC 1c5f 5451 NVMe SSD PBlaze7 7946 12800G 2.5" U.2 + 1ea0 2100 TP2510 Series U.2 NVMe Datacenter SSD(3.84TB) + 1ea0 2101 TP2511 Series U.2 NVMe Datacenter SSD(3.84TB) + 1ea0 2110 TP2510 Series E3.S NVMe Datacenter SSD(3.84TB) + 1ea0 2111 TP2511 Series E3.S NVMe Datacenter SSD(3.84TB) + 1ea0 2200 TP2510 Series U.2 NVMe Datacenter SSD(7.68TB) + 1ea0 2201 TP2511 Series U.2 NVMe Datacenter SSD(7.68TB) + 1ea0 2210 TP2510 Series E3.S NVMe Datacenter SSD(7.68TB) + 1ea0 2211 TP2511 Series E3.S NVMe Datacenter SSD(7.68TB) 0540 PBlaze4 NVMe SSD 0550 PBlaze5 700/900 0555 PBlaze5 510/516 @@ -25373,6 +25583,10 @@ 1cc4 2213 NVMe SSD UH832a E3.S 3.2TB 1cc4 2214 NVMe SSD UH832a E3.S 6.4TB 1cc4 2215 NVMe SSD UH832a E3.S 12.8TB + 1cc4 3122 NVMe SSD UH712a U.2 1.92TB + 1cc4 3123 NVMe SSD UH712a U.2 3.84TB + 1cc4 3124 NVMe SSD UH712a U.2 7.68TB + 1cc4 3125 NVMe SSD UH712a U.2 15.36TB 1cc5 Embedded Intelligence, Inc. 0100 PCIe-CAN-02 Dual CAN bus (9-pin male). PCI Express x1. 0101 PCIe-CAN-01 Single CAN bus (9-pin male). PCI Express x1. @@ -25571,14 +25785,18 @@ 2440 CL2440 1d6a Aquantia Corp. 0001 AQC107 NBase-T/IEEE 802.3bz Ethernet Controller [AQtion] + 4c52 6880 LREC6880BT Single-port 10Gb Ethernet Network Adapter 00b1 AQtion AQC100 NBase-T/IEEE 802.3an Ethernet Controller [Atlantic 10G] 00c0 Antigua NBase-T/IEEE 802.3an Ethernet Controller - Engineering Sample 04c0 AQtion AQC113 NBase-T/IEEE 802.3an Ethernet Controller [Antigua 10G] + 4c52 1053 LRES1053PT Quad-port 10Gb Ethernet Network Adapter + 4c52 2051 LRES2051PT Single-port 10Gb Ethernet Network Adapter 07b1 AQtion AQC107 NBase-T/IEEE 802.3an Ethernet Controller [Atlantic 10G] # Older revision of QNAP QM2 M.2 2280 PCIe SSD & 10GbE Expansion Card 1baa 07b1 QM2-2P10G1TA [QXG 10GbE Network Adapter] # Newer revision of QNAP QM2 M.2 2280 PCIe SSD & 10GbE Expansion Card 1baa 07b2 QM2-2P10G1TA [QM2 Expansion Adapter] + 4c52 6880 LREC6880BT Single-port 10Gb Ethernet Network Adapter 08b1 AQC108 NBase-T/IEEE 802.3bz Ethernet Controller [AQtion] 11b1 AQC111 NBase-T/IEEE 802.3bz Ethernet Controller [AQtion] 12b1 AQC112 NBase-T/IEEE 802.3bz Ethernet Controller [AQtion] @@ -25701,7 +25919,7 @@ 2262 NVMe PCIe SSD 220S/MTE662T2 2263 NVMe PCIe SSD 110S/112S/120S/MTE300S/MTE400S/MTE652T2 (DRAM-less) 2264 NVMe PCIe SSD 250H - 2267 NVMe PCIe SSD 240S/MTE710T + 2267 NVMe PCIe SSD 220S/240S/MTE710T 5766 NVMe PCIe SSD 110Q (DRAM-less) 1d7c Aerotech, Inc. # Fiber-optic HyperWire motion control bus from Aerotech. @@ -26178,6 +26396,7 @@ 1df3 0001 ENA2100RN 1df5 Shenzhen TIGO Semiconductor 1202 kimtigo NVMe SSD (DRAM-less) + 2263 kimtigo MG931K NVMe SSD (DRAM-less) 1df7 opencpi.org 0001 ml605 0002 alst4 @@ -26286,6 +26505,7 @@ 1028 223c Ent NVMe CM7 U.2 MU 6.4TB 1028 223d Ent NVMe CM7 U.2 MU 3.2TB 1028 223e Ent NVMe CM7 U.2 MU 1.6TB + 002a Exceria Plus G3 NVMe SSD (DRAM-less) 002c NVMe SSD Controller CD8P EDSFF 1028 22bf DC NVMe CD8P E3.S 15.36TB 1028 22c0 DC NVMe CD8P E3.S 7.68TB @@ -26329,7 +26549,9 @@ # FHFL PCIe card, dual slot, 3rd generation from Enflame, 48GB device memory c032 S90 [Enflame] # FHFL PCIe card, dual slot, 3rd generation from Enflame, 48GB device memory - c033 S60 [Enflame] + c033 S60G [Enflame] +# FHFL PCIe card, dual slot, 3rd generation from Enflame, 48GB device memory + c035 S60 [Enflame] # nee Thinci, Inc 1e38 Blaize, Inc 0102 Xplorer X1600 @@ -26338,7 +26560,7 @@ 2263 270PM6, 270PM7 series NVMe SSD 1e3b DapuStor Corporation 0600 NVMe SSD Controller DP600 - 1e3b 0006 Enterprise NVMe SSD U.2 QDP 7.68TB (J5000) + 1e3b 0006 Enterprise NVMe SSD U.2 ODP 7.68TB (J5001) 1e3b 0010 Enterprise NVMe SSD U.2 3.84TB (R5102) 1e3b 0013 Enterprise NVMe SSD U.2 3.20TB (R5302) 1e3b 0030 Enterprise NVMe SSD U.2 3.84TB (J5100) @@ -26377,23 +26599,39 @@ 1e3b 00be Enterprise NVMe SSD U.2 QDP 30.72TB (R5100) 1e3b 00c1 Enterprise NVMe SSD U.2 QDP 25.60TB (R5300D) 1e3b 00c4 Enterprise NVMe SSD U.2 QDP 30.72TB (R5100D) - 1e3b 00c9 Enterprise NVMe SSD U.2 15.36TB (J5000) - 1e3b 00ca Enterprise NVMe SSD U.2 3.84TB (J5102) - 1e3b 00cb Enterprise NVMe SSD U.2 7.68TB (J5102) - 1e3b 00cc Enterprise NVMe SSD U.2 3.84TB (J5101) - 1e3b 00cd Enterprise NVMe SSD U.2 7.68TB (J5101) - 1e3b 00ce Enterprise NVMe SSD U.2 3.84TB (J5101D) - 1e3b 00cf Enterprise NVMe SSD U.2 7.68TB (J5101D) - 1e3b 00e8 Enterprise NVMe SSD U.2 3.20TB (J5301) - 1e3b 00e9 Enterprise NVMe SSD U.2 6.40TB (J5301) - 1e3b 00ea Enterprise NVMe SSD U.2 3.20TB (J5301D) - 1e3b 00eb Enterprise NVMe SSD U.2 6.40TB (J5301D) + 1e3b 00c9 Enterprise NVMe SSD U.2 ODP 15.36TB (J5001) + 1e3b 00ca Enterprise NVMe SSD U.2 ODP 3.84TB (J5102) + 1e3b 00cb Enterprise NVMe SSD U.2 ODP 7.68TB (J5102) + 1e3b 00cc Enterprise NVMe SSD U.2 QDP 3.84TB (J5101) + 1e3b 00cd Enterprise NVMe SSD U.2 ODP 7.68TB (J5101) + 1e3b 00ce Enterprise NVMe SSD U.2 QDP 3.84TB (J5101D) + 1e3b 00cf Enterprise NVMe SSD U.2 ODP 7.68TB (J5101D) + 1e3b 00dc Enterprise NVMe SSD U.2 ODP 30.72TB with SAMSUNG 32GB DRAM (J5001) + 1e3b 00dd Enterprise NVMe SSD U.2 ODP 30.72TB with MT 32GB DRAM(J5001) + 1e3b 00de Enterprise NVMe SSD U.2 ODP 15.36TB with SK 16GB DRAM(J5001D) + 1e3b 00df Enterprise NVMe SSD U.2 ODP 30.72TB with SAMSUNG 32GB DRAM(J5001D) + 1e3b 00e7 Enterprise NVMe SSD U.2 ODP 30.72TB with MT 32GB DRAM(J5001D) + 1e3b 00e8 Enterprise NVMe SSD U.2 QDP 3.20TB (J5301) + 1e3b 00e9 Enterprise NVMe SSD U.2 ODP 6.40TB (J5301) + 1e3b 00ea Enterprise NVMe SSD U.2 QDP 3.20TB (J5301D) + 1e3b 00eb Enterprise NVMe SSD U.2 ODP 6.40TB (J5301D) 1e3b 00f0 Enterprise NVMe SSD U.2 0.40TB (X2900) 1e3b 00f1 Enterprise NVMe SSD U.2 0.80TB (X2900) 1e3b 00f2 Enterprise NVMe SSD U.2 1.60TB (X2900) 1e3b 00f3 Enterprise NVMe SSD U.2 3.20TB (X2900) 1e3b 00f5 Enterprise NVMe SSD U.2 0.40TB (X2900P) 1e3b 00f6 Enterprise NVMe SSD U.2 0.80TB (X2900P) + 0800 DP800 + 1e3b 0001 Enterprise NVMe SSD U.2 QDP 3.84TB(R6100) + 1e3b 0007 Enterprise NVMe SSD U.2 ODP 15.36TB (R6100) + 1e3b 000a Enterprise NVMe SSD U.2 3.20TB (R6300) + 1e3b 000d Enterprise NVMe SSD U.2 6.40TB (R6300) + 1e3b 0010 Enterprise NVMe SSD U.2 12.80TB (R6300) + 1e3b 0018 Enterprise NVMe SSD U.2 QDP 3.84TB (R6100C) + 1e3b 0019 Enterprise NVMe SSD U.2 ODP 7.68TB (R6100C) + 1e3b 001a Enterprise NVMe SSD U.2 3.20TB (R6300C) + 1e3b 001b Enterprise NVMe SSD U.2 6.40TB (R6300C) + 1e3b 001c Enterprise NVMe SSD U.2 ODP 7.68TB (R6100) 1098 Haishen3 NVMe SSD 1e3b 0001 Enterprise NVMe SSD U.2 0.8TB (H2100) 1e3b 0002 Enterprise NVMe SSD U.2 0.96TB (H2200) @@ -26446,6 +26684,8 @@ 1011 PC210 NVMe SSD 1013 PC210 NVMe SSD 1031 PC300 NVMe SSD (DRAM-less) + 1033 PC300 NVMe SSD (DRAM-less) + 1071 PC411 NVMe SSD (DRAM-less) 1e4b MAXIO Technology (Hangzhou) Ltd. 1001 NVMe SSD Controller MAP1001 1002 NVMe SSD Controller MAP1002 (DRAM-less) @@ -26461,8 +26701,13 @@ 1e50 IP3 Tech (HK) Limited 1e52 Tenstorrent Inc 401e Wormhole + 1e52 0014 n300 + 1e52 0018 n150 b140 Blackhole faca Grayskull + 1e52 0003 e150 + 1e52 0007 e75 + 1e52 000a e300 1e57 Beijing Panyi Technology Co., Ltd 0100 The device has already been deleted. 0000 0100 PY8800 64GB Accelerator @@ -26526,6 +26771,7 @@ 2a16 Cloud Intelligent Inference Controller 2a18 Video Transcode Controller 2a20 Cloud Intelligent Inference and Training Controller + 2a22 Cloud Intelligent Inference Controller 1ea7 Intelliprop, Inc 223a Typhon+ PCIe to Gen-Z Bridge 224a IPA-PE224A CXL to Gen-Z Bridge [Sphinx] @@ -26585,6 +26831,10 @@ 1ed0 Hosin Global Electronics 1ed2 FuriosaAI, Inc. 0000 Warboy + 1111 RNGD + 0000 1111 RNGD-S *** 736 LINES SKIPPED *** From nobody Tue May 14 12:19:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdwQ23k8Wz5K14F; Tue, 14 May 2024 12:19:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VdwQ236Cyz4D26; Tue, 14 May 2024 12:19:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715689146; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dgE/v5Wo2teJ9ZuOJMzPBU+WLIDvILM2chR9p9325Vw=; b=ZEEvIy0dW6xe0YBQrw9SysmjiFav0atZ8SlC9wBTT24KMfK3AoRqfOBWjl8ckvfeHoiIRk r89mWqHeIYKXL3UyqxNX989qaBQwr9M984Gd8EJ2kDOPSXYYFa/YeXpyBdaQw/OU3YPTT/ nUQpH45x0RYbKzjwV3hyqzCKSH5/RaztZcYAVXgJ1Imjt6KVj95XZoX3mKckIht1rAyVmN Kqie9djUfGAA4wJX0mLhIE77O6WYso2TvScBMEac1+h4OICZq0vuLnYToaLsqzoGzy2Ogl AY5mMFtn3piN5kwchTDBPBn68fRK2KiqPyAVbHNwZtLBp+FioL2l3fC2BmjxLw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715689146; a=rsa-sha256; cv=none; b=hDlFE74xV9r5O3oXyyfFGgecKV5ATI7XX+ownSb8P00+KdhyrJGVvdjSPx13uvTqemvgTJ 9C9Ve78X/QxnGLdrlxZN8adpDCqJlAYKJ95ne6jE+6TGVbT/SLONXUoHS5JjCZQluat/qO Ww3E3Cn2tjdUMeOfamZipkr0CL7xctHLQSi56De7QOdPvhkAbmlGmK6xVjkMlHULJdd7BP oAbzoukp1AgziX0w9+KKZPmMFst2ja4nersIbi1Pscftjotmk6hqec/uH31qMW6j/lHjiM ZNTn/3U9q89SL9yySwy5gC4T81F7N+o9OnQ5TjbG1C04dQ84NBBeLvsPgoxhoQ== 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=1715689146; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dgE/v5Wo2teJ9ZuOJMzPBU+WLIDvILM2chR9p9325Vw=; b=fxk7A/mPcwyT4t/5vSF2kW3R+caCpnsHbZO68A9mBdHc+QShTdHBAn0hvfVmVy8xCiUbTq CO1Q1sBRbM/rVjg+KGHvg+NX5orZ2ljfrse/AvHc6BS2PTz3kpLbmyLmMiqIcxt8ydcqPH +YN88rTNZU0V0yzxQZJvjVvp7A3/9JwFbRZ01LdENPh01GsODEU20mlJiJIsHTbL8NmxpT QpjWcQwmoE3QtJlOUYJsf1DY8jUcF6HHdXUdK40JeWx1mnmY4BibGqGiQvCnjb50YGNnrN XtXx0yVffFsKDLUFmZwOEcd/kEoO7JrL1WZakZC4AqHl3xsBKEe8oEKvON4lfQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdwQ22jYQzXKs; Tue, 14 May 2024 12:19:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44ECJ6nJ045473; Tue, 14 May 2024 12:19:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44ECJ6hB045470; Tue, 14 May 2024 12:19:06 GMT (envelope-from git) Date: Tue, 14 May 2024 12:19:06 GMT Message-Id: <202405141219.44ECJ6hB045470@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 79bffdf3f42e - main - usb_vendors: update to 2024.03.18 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 79bffdf3f42e2e8e62223fcffd537d5d254ddbb7 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=79bffdf3f42e2e8e62223fcffd537d5d254ddbb7 commit 79bffdf3f42e2e8e62223fcffd537d5d254ddbb7 Author: Baptiste Daroussin AuthorDate: 2024-05-14 12:18:52 +0000 Commit: Baptiste Daroussin CommitDate: 2024-05-14 12:18:52 +0000 usb_vendors: update to 2024.03.18 --- share/misc/usb_vendors | 52 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 47 insertions(+), 5 deletions(-) diff --git a/share/misc/usb_vendors b/share/misc/usb_vendors index 74a0cef04aa3..a1e3ea4acd1d 100644 --- a/share/misc/usb_vendors +++ b/share/misc/usb_vendors @@ -9,8 +9,8 @@ # The latest version can be obtained from # http://www.linux-usb.org/usb.ids # -# Version: 2024.01.30 -# Date: 2024-01-30 20:34:02 +# Version: 2024.03.18 +# Date: 2024-03-18 20:34:02 # # Vendors, devices and interfaces. Please keep sorted. @@ -209,6 +209,7 @@ 0012 DeskJet 1125C Printer Port 0024 KU-0316 Keyboard 002a LaserJet P1102 + 0036 CCID Smartcard Keyboard KUS0133 0053 DeskJet 2620 All-in-One Printer 0101 ScanJet 4100c 0102 PhotoSmart S20 @@ -2401,6 +2402,7 @@ 02ea Xbox One Controller 02fd Xbox One S Controller [Bluetooth] 02fe Xbox Wireless Adapter for Windows + 0306 Surface Pro 7 SD Card Reader 0400 Windows Powered Pocket PC 2002 0401 Windows Powered Pocket PC 2002 0402 Windows Powered Pocket PC 2002 @@ -5049,6 +5051,7 @@ 072d Revio KD410Z 04ca Lite-On Technology Corp. 0020 USB Keyboard + 003a Multimedia Keyboard 004b Keyboard 004f SK-9020 keyboard 008a Acer Wired Mouse Model SM-9023 @@ -8243,6 +8246,7 @@ 1093 Rugged 1094 Rugged THB 1095 Rugged + 1105 Mobile Drive (RLSD: 2022) a601 HardDrive a602 CD R/W 05a0 Vetronix Corp. @@ -9283,6 +9287,8 @@ # typo? 4004 Minolta Dimage Scan Elite II AF-2920 (2888) 0639 Chrontel, Inc. + 7213 CH7213 + 7231 CH7213 063a Techwin Corp. 063b Taugagreining HF 063c Yamaichi Electronics Co., Ltd (Sakura) @@ -11443,6 +11449,7 @@ 0826 Data Transit 0827 BroadLogic, Inc. 0828 Sato Corp. + a003 WS408 Label Printer 0829 DirecTV Broadband, Inc. (Telocity) 082d Handspring 0100 Visor @@ -12081,6 +12088,12 @@ 04b2 NC interface 04b3 keyboard front panel Cockpit 04b4 SCR_CCID + 04b5 Camera + 04b6 Cockpit Touchkeypad + 04b7 Cockpit Touchkeypad Bootloader + 04b8 MediSET USB4-W + 04b9 MediSET USB4-R + 04ba MediSET USB4-G 2701 ShenZhen SANZHAI Technology Co.,Ltd Spy Pen VGA 0909 Audio-Technica Corp. 001b ATR2100-USB @@ -12188,6 +12201,7 @@ 4cda Fenix 6 Sapphire 4cdb Fenix 6 0920 Echelon Co. + 5550 U60 FT Network Interface 7500 Network Interface 0921 GoHubs, Inc. 1001 GoCOM232 Serial @@ -12406,6 +12420,7 @@ 010f nanoKONTROL studio controller 0117 nanoKONTROL2 MIDI Controller 012f SQ-1 + 0203 KRONOS 0f03 K-Series K61P MIDI studio controller 0945 Pasco Scientific 0948 Kronauer music in digital @@ -12477,7 +12492,8 @@ 7140 T124 [Tegra K1/Logan 32-bit] 7210 SHIELD Controller 7321 Switch [Tegra Erista] recovery mode - 7423 T234 [Orin NX] recovery mode + 7323 T234 [Orin NX 16GB] recovery mode + 7423 T234 [Orin NX 8GB] recovery mode 7721 T210 [TX1 Tegra Erista] recovery mode 7820 T20 [Tegra 2] recovery mode 7c18 T186 [TX2 Tegra Parker] recovery mode @@ -12678,6 +12694,8 @@ 09d8 ELATEC GmbH 0320 TWN3 Multi125 0406 TWN4 MIFARE NFC + 0410 TWN4 HID + 0420 TWN4 CDC 09d9 KRF Tech, Ltd 09da A4Tech Co., Ltd. 0006 Optical Mouse WOP-35 / Trust 450L Optical Mouse @@ -12686,6 +12704,7 @@ 0018 Trust Human Interface Device 001a Wireless Mouse & RXM-15 Receiver 002a Wireless Optical Mouse NB-30 + 0103 Oscar X-710BK Gaming Mouse 022b Wireless Mouse (Battery Free) 024f RF Receiver and G6-20D Wireless Optical Mouse 0260 KV-300H Isolation Keyboard @@ -12693,12 +12712,16 @@ 09da Bloody V8 Mouse 1068 Bloody A90 Mouse 112c Bloody V5 Mouse + 2268 Keyboard (FK11) + 2690 PK-635G 3a60 Bloody V8M Core 2 Mouse 8090 X-718BK Oscar Optical Gaming Mouse 9033 X-718BK Optical Mouse 9066 F3 V-Track Gaming Mouse - 9090 XL-730K / XL-750BK / XL-755BK Mice + 9090 XL-730K / XL-747H / XL-750BK / XL-755BK Mice f613 Bloody V7M Mouse + f6cc B314 Light Strike Gaming Keyboard + fa44 B930 Light Strike RGB Mechanical Gaming Keyboard 09db Measurement Computing Corp. 0075 MiniLab 1008 0076 PMD-1024 @@ -12715,11 +12738,13 @@ 09e6 Silutia, Inc. 09e7 Real 3D, Inc. 09e8 AKAI Professional M.I. Corp. + 0029 APC40 mkII 0045 MPK Mini Mk II MIDI Controller 0062 MPD16 MIDI Pad Controller Unit 006d EWI electronic wind instrument 0071 MPK25 MIDI Keyboard 0076 LPK25 MIDI Keyboard + 007c MPK Mini MIDI Controller 09e9 Chen-Source, Inc. 09eb IM Networks, Inc. 4331 iRhythm Tuner Remote @@ -12783,6 +12808,9 @@ 1010 Bluetooth Device 1011 Bluetooth Device 1012 Bluetooth Device + 1243 CSRA64210 [TaoTronics Headset BH-22 in charging mode] + 4007 Mpow HC5 Headset in charging mode - HID / Mass Storage + 4010 Mpow HC5 Headset in charging mode - USB Hub ffff USB Bluetooth Device in DFU State 0a13 Telebyte, Inc. 0a14 Spacelabs Medical, Inc. @@ -12826,6 +12854,7 @@ 0a35 Radikal Technologies 002a SAC - Software Assigned Controller 008a SAC Hub +0a38 IRIS sa 0a39 Gilat Satellite Networks, Ltd 0a3a PentaMedia Co., Ltd 0163 KN-W510U 1.0 Wireless LAN Adapter @@ -12950,6 +12979,7 @@ 217f BCM2045B (BDC-2.1) 2198 Bluetooth 3.0 Device 219b Bluetooth 2.1 Device + 219c BCM2070 Bluetooth 21b1 HP Bluetooth Module 21b4 BCM2070 Bluetooth 2.1 + EDR 21b9 BCM2070 Bluetooth 2.1 + EDR @@ -12973,6 +13003,7 @@ 5802 BCM5880 Secure Applications Processor with fingerprint touch sensor 5803 BCM5880 Secure Applications Processor with secure keyboard 5804 BCM5880 Secure Applications Processor with fingerprint swipe sensor + 5832 BCM5880 Secure Applications Processor Smartcard reader 6300 Pirelli Remote NDIS Device 6410 BCM20703A1 Bluetooth 4.1 + LE bd11 BCM4320 802.11bg Wireless Adapter @@ -21442,6 +21473,8 @@ 20a0 Clay Logic 0006 flirc 4107 GPF Crypto Stick V1.2 + 4108 Nitrokey Pro + 4109 Nitrokey Storage 4123 IKALOGIC SCANALOGIC 2 414a MDE SPI Interface 415a OpenPilot @@ -21450,7 +21483,16 @@ 41e5 BlinkStick 4211 Nitrokey Start 4223 ATSAMD21 [castAR] + 4230 Nitrokey HSM + 4287 Nitrokey FIDO U2F 428d Electrosense wideband converter + 42b1 Nitrokey FIDO2 + 42b2 Nitrokey 3A Mini/3A NFC/3C NFC + 42b4 Nitrokey Pro Bootloader + 42da MuteMe + 42dd Nitrokey 3A NFC Bootloader/3C NFC Bootloader + 42e8 Nitrokey 3A Mini Bootloader + 42ec RP2040 [PicoWifi] 20b1 XMOS Ltd 10ad XUSB Loader f7d1 XTAG2 - JTAG Adapter @@ -22171,7 +22213,7 @@ 2581 Plug-up 1807 Generic HID Smartcard 1808 WinUSB Smartcard - f1d0 FIDO U2F Security Key + f1d0 Nitrokey U2F 258d Sequans Communications 259a TriQuint Semiconductor 25a7 Areson Technology Corp From nobody Tue May 14 13:39:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdyBg5m75z5K7BD; Tue, 14 May 2024 13:39:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VdyBg593tz4PGl; Tue, 14 May 2024 13:39:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715693963; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gavHeeCl9lR1Fgn5S6CHp1biaAdm1ZhuYfI5HogsSIE=; b=SIDbzCjTbq70xemDYEsi2RnsOGAQSrBzNkGfcwbFhONpUpL5truE7+bm697aoKl1vLO0eE cywuj8zVv8MM1kxHxaU099h1qHlT8Ium+ZsEhIZND9pig8ACssmyx0sTtLqhdeu65NRCMw yCQufZBu89vwgkLjSWV94EVAEmOJW5pSDab+0+FfImhE1QvmOzoaXeTr2p8RymGceuSL+I p7/5B9MJX0nFFcQ9kFF3lmPHYOjndk5xtpPRacmBzlnFNOGRA6wjO58smAWCpC/4QVZuoZ 9ahsaqopEcvdsai0QphiA33kwu/XSUcdlrbIy4D+GXom6Sn0NPkuwb2y05TwBQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715693963; a=rsa-sha256; cv=none; b=JOYmbkHEmOEfiFgUA56nq7RrePu/v4sHCot0XtIsETDy8qBWKpBSN0mpwBtxQa0MBmLH1E pzoOqujkGfzswyeRLWJ9vxiID0M1xrXen7jzXof4MqH35uSGCb1hm3D3m1JJoLHGogCPTv hBHBkaQs3Ihq5lMAuWiUWBCmfVd66PbLIBDGmXafUY7VraZBTGbwPKdg08DjxTkBh/R0MX Gz0yOBd1W4E4m1xEZSr8EDWwt/4RLwNolcYI6o2ErL/pfeTBS8CQuY3Q8I6Mhx0/haumjo ud5S09Y33pb2KQ8GSt5kY17ikhy9pzvmRefruPeQZgtGihIeOI5qdB0NPEAUjw== 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=1715693963; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gavHeeCl9lR1Fgn5S6CHp1biaAdm1ZhuYfI5HogsSIE=; b=F6y9EOEibbnz3R8UyLcAXC9vCutkIeGxh5+JmlY57xkha0RJvT+nOumOpOhjYvdn8KJm5q kMdgx56geXke5aVsJGPLSisC1hOkDcKkbCQbUvVaeOA+QWUttEVLHNz84VRoSRVEWgbc6/ olh9TV/cETk5VVyPrUk0W4kQev3rznhjCrw+FoOYx9K/q2hkFHeVMFnyvkBwHiwmIOfV8h 4rej3lwSU/esUHdBPyxM9YfYOIsI91LOiqgd3acExPFNVIhZYs+//N9WZwHk7CYS0ASnJn l8RLHunkOj3B7dqyq19ksRVdj5k/A/kpVz901tyYWZa+dEbIc5K5U5BUpLcOCQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdyBg4jYyzZ99; Tue, 14 May 2024 13:39:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44EDdN3P080386; Tue, 14 May 2024 13:39:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EDdN9P080383; Tue, 14 May 2024 13:39:23 GMT (envelope-from git) Date: Tue, 14 May 2024 13:39:23 GMT Message-Id: <202405141339.44EDdN9P080383@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: 21284ecd1e65 - releng/14.1 - PP mutexes: unlock: Reset inherited prio regardless of privileges List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 21284ecd1e65fcc6c2e418b45d68f2e23e1e67f5 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=21284ecd1e65fcc6c2e418b45d68f2e23e1e67f5 commit 21284ecd1e65fcc6c2e418b45d68f2e23e1e67f5 Author: Olivier Certner AuthorDate: 2024-02-20 13:52:40 +0000 Commit: Olivier Certner CommitDate: 2024-05-14 13:36:38 +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) (cherry picked from commit eded8fea5c3a7ef7aafb5755c523a40dd7fce20e) Approved by: emaste (mentor) Approved by: re (cperciva) --- 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 Tue May 14 13:39:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdyBh6h9jz5K780; Tue, 14 May 2024 13:39:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VdyBh64fqz4Pbs; Tue, 14 May 2024 13:39:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715693964; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nHJ6TvibdUoBsFQZ7x3la0iCF8NToTz/W/b8/vezRcE=; b=qBtkp1J2CFcfLcaJ8ytJnVO2ON6RLsy9fCtCaeE78NePMCNhLIlWFeF+gce1LaTuqqAiol Fq3+itEC5czFjznFa1D52MCaefIPHM/FsQeh05SqTJ2+ofhcbPre44KemNxn68I4tCt8yh URQcnLNXGOjaIjr9QHvEWqTbQP2ILg45SLUhYMYMLxHxvWNnuKpujyaBL5G/8SiL2GroHJ AqmVZ34laeQNE30kOgHsNWypiZLXfO72WQs4+GE/5P0VQxsZH1gMJ5t3EwEo8CjIfcEBLF sNqThevH2DpxzpcRTvO4tone75ncuAt3Jtoihq1kSAPFT5yXv0oBpPdPbqvr0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715693964; a=rsa-sha256; cv=none; b=VdN+K2Az8dGkkkKuZJekcnM6Wjp8UTT7rF5vcLMYe+iYtYTluCEgBPTA1p/Kd4OI4/BITw mb1KDEwbovVmIU0ThUCwoWxSxyl4wcdsQifANmRBshmDmxrrTRblguIIQllqgd405cHT0P Sb+K8vjfnVMXdOr22YOPx7z4r4ZjCLL5gFxXwO1RDlIxZQgs2hMC2NFB0ttx3tIgKjVlTH nfDynQDsanVpdptILKKYSu3yalDt1OWhZc5TQ19poydQdDy+SzARYxg7dpOBTV0R7293Qg RhT0q1Mh6z9LyZycZtcSp8Z35RJutF0ZEe5ROZJ0AnQ7Ad7lBD4UpJJAG5f9JA== 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=1715693964; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nHJ6TvibdUoBsFQZ7x3la0iCF8NToTz/W/b8/vezRcE=; b=QeCjL2yhX2JJ6V3w9OE/AILp7sapjYQSY+wJl5QtjBlSIJ7dq8Vmg7IH+YSJhAShd/k8S/ 9h6eHBhe12h1v0Thd2W+cLkRtITjSMByJliTgRXIgqI2lXNAm1G7m+QXAQxnVmBf4/Qz5V mPF4ixc7AWMBknzEbr1d22cxsNVoIyf2ygROcdEuQ4HxNM4pmExBWJcgrdKJtVp33dUn6m NJ0Kg1fFOxzFyuIcuS6oK/IapOVENY3I4x+zuDeDlevl++lLbLnQm8T7f8d4LItB/4U1u7 dF0ZCXr8FzpyLn1GHcdcXHQWywB/BjwTX3taCEdrRbHTt8ofmwfLpvwzzQFUSQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdyBh5hzkzZ9B; Tue, 14 May 2024 13:39:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44EDdOtl080449; Tue, 14 May 2024 13:39:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EDdO7c080446; Tue, 14 May 2024 13:39:24 GMT (envelope-from git) Date: Tue, 14 May 2024 13:39:24 GMT Message-Id: <202405141339.44EDdO7c080446@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: 8bd89740cb2b - releng/14.1 - PP mutexes: lock: Check if priority is too high against base one List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 8bd89740cb2bb52ebe4155ed380c623e703c392f Auto-Submitted: auto-generated The branch releng/14.1 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=8bd89740cb2bb52ebe4155ed380c623e703c392f commit 8bd89740cb2bb52ebe4155ed380c623e703c392f Author: Olivier Certner AuthorDate: 2024-02-22 08:53:51 +0000 Commit: Olivier Certner CommitDate: 2024-05-14 13:37:26 +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) (cherry picked from commit f9e9c02241dc887244cf62136dfcea04718290a0) Approved by: emaste (mentor) Approved by: re (cperciva) --- 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 Tue May 14 13:39:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdyBk2RkHz5K7Dm; Tue, 14 May 2024 13:39: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 4VdyBk0LdCz4Pm7; Tue, 14 May 2024 13:39:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715693966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cjJZWiiH6ONfubtGZHHFmICOTWKGrGgtZt4inC/sScs=; b=tKKxCyzPCVzMkYEJWy0FiAVRJV3AZS6hcaF3BxaAQWQDmQk/Tn5mz9eAbQPaPtDPuuWg3U hKjqPT0cCxCBUhXzwfoLofwUEYWb7/lzI/Yd7tpAyXalJ0dbGrVwNGpMUhqQnekaZ70/3W kk4b2lyxhOOgKjnV9revkKo/5oEAKqUBAZtLSqPY2qR+BHI5+LcVOStEMccW45ZzHe+4ct GGaP4t4bpY35hboVb8mkx3y3VNTUcZyw23bN0CUBYTs4Wjayte8Xx+sL8MBZlRaQQUPNF0 QtbK6n13ouA0nh0tTcpHYn823BSgO3fR2qws0Qr5qMDDF8Wfy+kwY7VsOZiWyw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715693966; a=rsa-sha256; cv=none; b=wLEfMjFHTGjFDbMc7qCq05enBiBEptYZfyvRcdlDlSU06WoEErZdfXZHUBW2oVEDCLOwPa nedFyrK/SvgQ9WBbfYAdK1eKrAOxOSAzgUuX99lmuqhXSiMoIc3wgMz9GXh0pW3XzwGmJn y8xyMEWRSUiivH3cfn73RNq/YnIFEBsMPj11zQfKVvJyYiPS/rmRgpVXbezKtFC2WBv7ih bDHXNHoKE4RfRO2uTDJ4JZfT1SRVibWcXyJDJKI1ozDyE9wRKIuXd4m2gh4HmLpWIGjJpM QF+sdyF04n763IYgXvfcosfQm840QXFgt4qZP9suFvII78fzFkSjzVYyIrA9wQ== 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=1715693966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cjJZWiiH6ONfubtGZHHFmICOTWKGrGgtZt4inC/sScs=; b=sBmQ07hjSalrf+AVZQE/ILSfz5PL0yl332H3LsyV14NX3OU7NmasUiMNjgmhGso+Hujn6B qozWn/kIQ2nOOc6A1jKtIVoDqD0TDGJkeLKt6cqRpgJEREyGofebpypxoLTgebVYT/XXgr P9DhE2LfbR6JnMBc4n34V7nU4Ja9X2P672hPKYlvdhlRk9UZ/BzOtdtpNBOlscgjsFeUKS 3S/vIVJ0q2uP4jZ6wCDQ+5DEARyYt1R2aajeuBojgPlbEYhUrYejTLcYrye+FZWzNHyEl7 Ll0Y87/bk5mzYKND2pE47j/tKonRq7Amn50j6opk9eJde2vF+KXnOYzpFdM3jA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdyBj6kRlzZ6g; Tue, 14 May 2024 13:39: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 44EDdPNb080509; Tue, 14 May 2024 13:39:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EDdPH6080506; Tue, 14 May 2024 13:39:25 GMT (envelope-from git) Date: Tue, 14 May 2024 13:39:25 GMT Message-Id: <202405141339.44EDdPH6080506@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: 9dad96bc6344 - releng/14.1 - PP mutexes: lock: Reduce 'umtx_lock' holding before taking the user lock List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 9dad96bc634429711f3a1f74a8f988d963e99d96 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=9dad96bc634429711f3a1f74a8f988d963e99d96 commit 9dad96bc634429711f3a1f74a8f988d963e99d96 Author: Olivier Certner AuthorDate: 2024-02-22 09:13:38 +0000 Commit: Olivier Certner CommitDate: 2024-05-14 13:37:35 +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) (cherry picked from commit ce7dc52f07d05d00054d48faf00fcac4036d56df) Approved by: emaste (mentor) Approved by: re (cperciva) --- 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 Tue May 14 13:39:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdyBl1ntFz5K7BG; Tue, 14 May 2024 13:39: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 4VdyBl1BW2z4PQ5; Tue, 14 May 2024 13:39:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715693967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O8Zzv4BE5RnR3jXUIo7DwZic/SIt8T4SUQcCPrfqx8I=; b=IA1qZPqVuItbJ+RodWKj3rMkiIKf+tzCOoPQ+ClNS3yEHJvpActPPOnepAwlWHHdKrmCyY ZQFEnfSTTp2+EDCnL6m53EjXE8mlpXv8+6IxQXANRorg6VI0eLXuqK6T3mu4fmQoFoZdq5 9vFoKN3vvIqBMH8Ooy70Un5cH9V1KXw/6qf6D6Vg4ojTUIcLB1M4Vrn5WRCb02EllrD1lK PrGY7JBfguI0g04ixdQx89G2ZRhe19tDIw3d0dsqGdC71/VE9IwHAKNSIpUEcoSYypMpIR tkypp4MG+qTRwCSWEdkgxO3deAB8t9sMs22GencHnzZP6J01MnRlcVLRBQgfmA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715693967; a=rsa-sha256; cv=none; b=oh3nfB6cVaPwW5NHLxcD1O7ZspN78Mr9XREVp+JZe92iCRyJ/Rl2Dx5piAobaZh9qKd85B 1+GrzwGU8Psogmh+/b3NSr86fHHDWnJEnV80rNCZlSiJsptCTDbY+9ZAEVpAMhLpmhwUVJ iuhHFK5+D9tXfa6iNK2PCTE3cG8JwbcMKMHcleDmoQc0/HkFYCQB1vX+GnJ3Y/8VpcYr42 aVY3rM75sixpVPBUnHVrbDVGjxAMzZ3JQxqWgUp4XOQ1NxuvoQBkhdkXpFAgqltuKqN5Tk XzOkwUqdPDMabzqcz+BVBVQs8hRxwdmEuUZploK59/5jAbTOu4x2A2HciY2eEA== 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=1715693967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O8Zzv4BE5RnR3jXUIo7DwZic/SIt8T4SUQcCPrfqx8I=; b=XY6OEF4F1Ct65PJsRd1DLiDOecZyaHFbUcZ4pHw3TDUdos6d5TtYrWmYkfiPaI7voZnrFe FtPVD5OiZqzAGK0FpkqiV6XaTy1cCn1OQV3DplIWAgPw/0ls52UC6H5TMEy+rh8oqPRAaX B9GQBgY8mZkOyN1yb49EJUHiQA9cAeeZgTB35YK4NbJbGHhTNlW730Ljmq4Sku1AnbUXs5 n7p57V6/vhEKHGQ4U2b7vDEuzSS/6hbEqSyajkES95akUAz+ovGRX6pfaI3wV7GgNukyBr wCNWq3VItp310g+RzCOPzOTktD6aZdQXeOFkxG0lNCzOpVMn1yrCBWEyzi+STg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdyBl0X3YzYZt; Tue, 14 May 2024 13:39: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 44EDdQLf080545; Tue, 14 May 2024 13:39:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EDdQKj080542; Tue, 14 May 2024 13:39:26 GMT (envelope-from git) Date: Tue, 14 May 2024 13:39:26 GMT Message-Id: <202405141339.44EDdQKj080542@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: 81ddf56306ca - releng/14.1 - sched: Simplify sched_lend_user_prio_cond() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 81ddf56306ca46894baa376c4f58c4a52ce5809d Auto-Submitted: auto-generated The branch releng/14.1 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=81ddf56306ca46894baa376c4f58c4a52ce5809d commit 81ddf56306ca46894baa376c4f58c4a52ce5809d Author: Olivier Certner AuthorDate: 2024-02-09 18:03:22 +0000 Commit: Olivier Certner CommitDate: 2024-05-14 13:37:42 +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) (cherry picked from commit b8b729e23cb91a77f3ca51df5100e2c85dfa7447) Approved by: emaste (mentor) Approved by: re (cperciva) --- 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 Tue May 14 13:42:35 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdyGM4d65z5K7dk; Tue, 14 May 2024 13:42: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 4VdyGM44VKz4Qpg; Tue, 14 May 2024 13:42:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715694155; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0ZIdb8PJHk50hl6gXFPl75KgOINBF+wgzUdz67LBB1k=; b=d5SBuV5oIfuyeZZ70aTWVnc0932Swq/nqLwZw8tTJxIY1tW2YyIvg4oE2pPAbHDWD5ypBq QIf4GCODGoLcO93XKb4KIatD0NWWny64mVpZmyh6Xekusx217R+lOzFVnlS/zxpNGDh7go Sijfq+1HM6xyu6pqef9WqAkiZLJw8icd0NwFx1pquQoLRw4O1CGG80o2b8LqAUx/TN+Kgp Gkqb/5+ZTLM71rXOaRWrQgLSTgdNIRbIF0h3IDn6jdIH8+Rma1VNXRLPWwuZ+GTTbYyPn+ BDXxc9gpMsEIdJY//9zlSs/viszxaSLNKV7B8x7TFFFL2FsVQOkLR3l70bvKzw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715694155; a=rsa-sha256; cv=none; b=NwW8HyjMKxHOpWGNEGVK5fvKEUMQjX7CfOyi0fjhFZnCL87auBmLq7TqL/ac9lWQ0iN0hW aEwxvMeK5a5O9Rc5qOtu6oJOfLQi7SoX+h4YC9bQbo7IEEJFmVEKANkcdfLbC76J1wVNQR RnYz9Wtv6kFJQj15JYzbV8zDLBW7mmI1LgYRdGsT+feNVR8/IyJRU85Ij/Duop6JzJdEKr 6HAOW99ihV04Y3SNPB7bEjbntSku5FD8q7AvBaqaUsMhyg8Ci+ydRHOTQiIOZ51m4K5net 3UIkHvgf0nio84OvsaC/w+g/eEx/0j95vcSyOvmA4/HM2Cvu/SOIAmtsUXGoSg== 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=1715694155; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0ZIdb8PJHk50hl6gXFPl75KgOINBF+wgzUdz67LBB1k=; b=JwEtz25WJMI7UnBHwFZ845kHGvUKJ924V8mMM6fN77vsbXgh7DAcY25xtIcV6B/EM7+Lcq iUPVnM+gseXERpMCEJYZVz3Ib/aS9JAqnlXtVvOdSMULxwf8/1wDwa+thPENwZkPZYjDrM SsUOcDyh2+c8P6/EM6PaBIeu4+kUYF3Faflt5JKyZBAPkpVTqJwsbpxAkcD8BQptXJBh22 SdCJ26PpRo3nCz1m0LW3rc1c/S48Kveeybt4feLpWJScLTg+emFeIJj2OWDkCIghj8Jl43 XWf+b0JmwKImrjTtIUaChYxxCST+EfCffoJPM8RtGf0S5FSCwOZ7Wq/sptgS/Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdyGM3gpVzZSg; Tue, 14 May 2024 13:42: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 44EDgZXQ096265; Tue, 14 May 2024 13:42:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EDgZAb096262; Tue, 14 May 2024 13:42:35 GMT (envelope-from git) Date: Tue, 14 May 2024 13:42:35 GMT Message-Id: <202405141342.44EDgZAb096262@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 54cc353f505d - main - snd_hda: Add patch for Lenovo Ideapad 3 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 54cc353f505dbc5f19168b6b1417b6736433d9ae Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=54cc353f505dbc5f19168b6b1417b6736433d9ae commit 54cc353f505dbc5f19168b6b1417b6736433d9ae Author: Christos Margiolis AuthorDate: 2024-05-14 13:42:04 +0000 Commit: Christos Margiolis CommitDate: 2024-05-14 13:42:04 +0000 snd_hda: Add patch for Lenovo Ideapad 3 Reported by: bsd-lists@bsdforge.com Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D45100 --- sys/dev/sound/pci/hda/hdaa_patches.c | 3 ++- sys/dev/sound/pci/hda/hdac.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/sound/pci/hda/hdaa_patches.c b/sys/dev/sound/pci/hda/hdaa_patches.c index 3a7dfc63637a..76f677d69614 100644 --- a/sys/dev/sound/pci/hda/hdaa_patches.c +++ b/sys/dev/sound/pci/hda/hdaa_patches.c @@ -318,7 +318,8 @@ hdac_pin_patch(struct hdaa_widget *w) } } else if (id == HDA_CODEC_ALC257 && (subid == LENOVO_L5AMD_SUBVENDOR || - subid == LENOVO_L5INTEL_SUBVENDOR)) { + subid == LENOVO_L5INTEL_SUBVENDOR || + subid == LENOVO_I3_SUBVENDOR)) { switch (nid) { case 20: patch_str = "as=1 seq=0"; diff --git a/sys/dev/sound/pci/hda/hdac.h b/sys/dev/sound/pci/hda/hdac.h index 4dd589ed2a09..12552286bd8c 100644 --- a/sys/dev/sound/pci/hda/hdac.h +++ b/sys/dev/sound/pci/hda/hdac.h @@ -383,6 +383,7 @@ #define LENOVO_L5INTEL_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x380f) #define LENOVO_3000_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x384e) #define LENOVO_I330_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x3808) +#define LENOVO_I3_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x3881) #define LENOVO_ALL_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0xffff) /* Samsung */ From nobody Tue May 14 13:42:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdyGN6wKxz5K7dl; Tue, 14 May 2024 13:42: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 4VdyGN53Nqz4RFW; Tue, 14 May 2024 13:42:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715694156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E+YfwhNocsolG7whOVUoX6vf9bo1CzvJ4fb6MllTGwo=; b=keTpVc05L8Ip1l2BGa135Fzhu+Ufihhysjf6Fju9ajX9PzHqd9z6sPfgICc70omGVsqie1 uyvrDsVMd1XM36ZHdw8hJ3S8wDEZTav+YBQaMf7xvYgZrQgB015OSFh2nYupiVXPJU8U40 sxRcIJrN5liYRjS7PatRsm6Tu1w0NjR5CT3PdDmuVBWN62QwYOjSySCxnL01cIJI7bdQeO 5xc44eB3uDrh75yrz5ey/Xuf1Y5mMJMLABxj2Kh6PpeRkL6Lrt/R08p9B6wgC/ekxOeZEI yasYknqSkfIjDzFuSjkyn2JqfVrr9G39RFvLeiDeFanIeyw1LS4FPLkZvC/p9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715694156; a=rsa-sha256; cv=none; b=dYAP7WZM6CAJkWnmcNXspn1ZVXb9+lq9i+1iHeAFMMogx1QVXdCrcb9/j+kQN1dsM2jqNg Z7s3Dea84oklKucf5cyHmfMMOVS5spRVQOT4WN96CtI9XkGqa0SCH0NHAtZb/wfDYpbm/y SBPfeV3TBxRlA1K19tPq4IgnRY+w3x5wjbjZd3wxq1xovY8dGwlklbB+zQtEaL3poLlndz tSu2/rPzsdgUAY7FokFBBtuVLRUdC1O3ExvMwijVGMjEKXbwHKdjAkXwMcrs61lZYtBIdm rpq3cKcXMfDrKBCY4O7BpGr0fmU5PoJ6O2t4l5VpY0CSBbgYzluYHlI66EWXKw== 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=1715694156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E+YfwhNocsolG7whOVUoX6vf9bo1CzvJ4fb6MllTGwo=; b=MtwWTFJzLmmqjoRck00fM7nLYauv8I66T37Yx2DNuW3ciZwQkUUdOqARV9uP/Pa1H/jOOX AATZkW6tAiFwegTeGwwyfIZFAiOjxFmwRtaieo+K3FLfZ1EbU7unQILnGiGjLqBhm8/1en JsgwMyrRRvKiXM4CdmlrrfgbkOiEB2NWbJfzCw8rBphbIlmN2kgF8ELlWBWtKZOl7NH3zi g7NVgSkzC13fiA10J1kExaK3p9l5+L3LsgXSSu66/F24gxpGEUyfUPBBBEGe5Qw17XWoyx b0Mpcxy2ZP9wPv7cF/LCkj02PNvY1+zUYcFuew5K5kW1k55LVhWvNoFixgdiQw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdyGN4fsvzZXl; Tue, 14 May 2024 13:42: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 44EDgalq096310; Tue, 14 May 2024 13:42:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EDgaRi096307; Tue, 14 May 2024 13:42:36 GMT (envelope-from git) Date: Tue, 14 May 2024 13:42:36 GMT Message-Id: <202405141342.44EDgaRi096307@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 278953360e0e - main - snd_hda: Rename LENOVO_I* to LENOVO_IDEAPAD* List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 278953360e0e6187c3f7c688cb49254df1567f0b Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=278953360e0e6187c3f7c688cb49254df1567f0b commit 278953360e0e6187c3f7c688cb49254df1567f0b Author: Christos Margiolis AuthorDate: 2024-05-14 13:42:15 +0000 Commit: Christos Margiolis CommitDate: 2024-05-14 13:42:15 +0000 snd_hda: Rename LENOVO_I* to LENOVO_IDEAPAD* Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D45105 --- sys/dev/sound/pci/hda/hdaa_patches.c | 4 ++-- sys/dev/sound/pci/hda/hdac.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/sound/pci/hda/hdaa_patches.c b/sys/dev/sound/pci/hda/hdaa_patches.c index 76f677d69614..9f3532562252 100644 --- a/sys/dev/sound/pci/hda/hdaa_patches.c +++ b/sys/dev/sound/pci/hda/hdaa_patches.c @@ -319,7 +319,7 @@ hdac_pin_patch(struct hdaa_widget *w) } else if (id == HDA_CODEC_ALC257 && (subid == LENOVO_L5AMD_SUBVENDOR || subid == LENOVO_L5INTEL_SUBVENDOR || - subid == LENOVO_I3_SUBVENDOR)) { + subid == LENOVO_IDEAPAD3_SUBVENDOR)) { switch (nid) { case 20: patch_str = "as=1 seq=0"; @@ -340,7 +340,7 @@ hdac_pin_patch(struct hdaa_widget *w) break; } } else if (id == HDA_CODEC_ALC230 && - subid == LENOVO_I330_SUBVENDOR) { + subid == LENOVO_IDEAPAD330_SUBVENDOR) { switch (nid) { case 20: patch_str = "as=1 seq=0 device=Speaker"; diff --git a/sys/dev/sound/pci/hda/hdac.h b/sys/dev/sound/pci/hda/hdac.h index 12552286bd8c..6a3314280a22 100644 --- a/sys/dev/sound/pci/hda/hdac.h +++ b/sys/dev/sound/pci/hda/hdac.h @@ -382,8 +382,8 @@ #define LENOVO_L5AMD_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x381b) #define LENOVO_L5INTEL_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x380f) #define LENOVO_3000_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x384e) -#define LENOVO_I330_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x3808) -#define LENOVO_I3_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x3881) +#define LENOVO_IDEAPAD330_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x3808) +#define LENOVO_IDEAPAD3_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x3881) #define LENOVO_ALL_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0xffff) /* Samsung */ From nobody Tue May 14 13:42:37 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdyGQ1qxXz5K7tK; Tue, 14 May 2024 13:42:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VdyGP6Xsxz4Qs6; Tue, 14 May 2024 13:42:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715694157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PH8UeUA0H/Kp+ook20BwNrn9lERLXUSfyHuLURjmVSA=; b=JkPZy4t9AJVnrwT9wK1kP02lqDYcHZ4smezQYZNAmzOIt7yvu5Tdsx7UsQSrMn2fgy28oU juR53ZsJyeKkgArKxjSbb2I1THyFPeZP4Sk5Q/urvNQe2KGTLV0fbHzeqAyGb9L3lh2DKX TBScistjm4GjuDCnMYl0slebHVRs2qlSWufKZLqFA1HMI+AsJXAjFLC1hVucpPfmN3nB6M y+yLQ+z3iTGTOnh1ALK/y/jS8QICiDdnRdBI7+licfeBNajB0OYfdyHNO9+UNpxohodGHA BTI/MsBixMMOgmRzFFOs9Lrpvhk/xUI6emw7pTueQdTi+KHnBvgHoTZYoB+dlQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715694157; a=rsa-sha256; cv=none; b=qZshTeLwKW+kJH9y+IPCHXvBYK+PRtECVo4cC22bjClV0DqPAsVlxyR+e+QfeOhPLYRL0t wyI/9TLQeQeFRlw/nleUtnswc0dHAZztF7O+rz+icXGb74F6QXP6MDLNKGKs9Bqs0RYC7y 1idZPc34X7+f+ww6zH9QFQimzb3rExiwtNKPfYE0r7wkUjNw81JdYCdVgG+64erm9u+iaV nCMvoZhghSb0m4tG4C3mIcSISyKeVHUo+oPTi/woEjkL4bI2tOGBSauwB556NdyMnwM0+F nnHG47HTM7UzOe+YRUFhv6D/scGFfcN/DBfDvbFoqB2qEVnTAG5Z+rdf3WPDSw== 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=1715694157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PH8UeUA0H/Kp+ook20BwNrn9lERLXUSfyHuLURjmVSA=; b=mjsovfzAMX/RApBHdbvPLawjitJalrJyMJDEoVCxe9xjQwu0SmhFcJbPTTL3lWjATQD8Rq k7mYsteHh/qwAs9OWuWayI6E24ycme/ilRprK3kP0/JUwUyoBCabeF4KT0ltp8+eKQ6kgQ w+QGPQghrwfqM+om9fDztxmjWLkjg3AMf85gPHsyESNnjRqKE6HmGCTtUK7x32Wm24HNQX b31h2mKYFbtvdTofqqk7Z376xx6NQrONs2OarkgOyIFnUqHkg5mBNIIcRvPgjPul5b9QC1 CZudlxM9c12H2C8DX+zx9NnL2tKLdrn3nwLnMsPyzx5Nh1Up1voqIWTs1kcLxg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdyGP5hFlzZb9; Tue, 14 May 2024 13:42: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 44EDgbS3096355; Tue, 14 May 2024 13:42:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EDgbpk096352; Tue, 14 May 2024 13:42:37 GMT (envelope-from git) Date: Tue, 14 May 2024 13:42:37 GMT Message-Id: <202405141342.44EDgbpk096352@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 305db91d4b92 - main - sound: Remove ncards variable from sound_oss_card_info() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 305db91d4b92a5d53826dcb6df39fc8a1f3b427e Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=305db91d4b92a5d53826dcb6df39fc8a1f3b427e commit 305db91d4b92a5d53826dcb6df39fc8a1f3b427e Author: Christos Margiolis AuthorDate: 2024-05-14 13:42:20 +0000 Commit: Christos Margiolis CommitDate: 2024-05-14 13:42:20 +0000 sound: Remove ncards variable from sound_oss_card_info() The loop counter is also the card's index, so ncards is redundant. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45144 --- sys/dev/sound/pcm/sound.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 3e95fd0e0ea4..e66462af2a71 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -792,9 +792,7 @@ int sound_oss_card_info(oss_card_info *si) { struct snddev_info *d; - int i, ncards; - - ncards = 0; + int i; for (i = 0; pcm_devclass != NULL && i < devclass_get_maxunit(pcm_devclass); i++) { @@ -802,7 +800,7 @@ sound_oss_card_info(oss_card_info *si) if (!PCM_REGISTERED(d)) continue; - if (ncards++ != si->card) + if (i != si->card) continue; PCM_UNLOCKASSERT(d); From nobody Tue May 14 14:47:34 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdzjL5sRmz5KTDl; Tue, 14 May 2024 14:47: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 4VdzjL4gFMz4d7s; Tue, 14 May 2024 14:47:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715698054; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cUiC91cBhw/ZHD7WhniAtchbQpCIhldtzbX0w717nwk=; b=qTgd3Rv/MvLsNKg7lIoEQ/9ui90Z16Vjz50N1fLxoDtWgpQPUr0BPQND3zZG69lKBxOgG/ +NlK539Ng2QD9Yd63s7m8HfoGp1ya6LIjrtSxCVf+4KeVwKStMuV4hXzFbOL9pYO6Jkwsb X9sQfmnK1Roj9l64W22vk7Pq+zOaYrAFf1LMtpuYmPI/n86rjx3qC8eB1hPjYVI0uU5imG JSdmwhM6lUBhgot3D6ApHvQBq2N5yUEFVlqW5OXBnmiEjjUPb6JAf9E0fiWq3bVVQg8JNc oOfd8cFHxXXXF85MR7Nirz2L1wKcn0FTPuXuQraMWumb9T/QmaZIREfpeOk9uw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715698054; a=rsa-sha256; cv=none; b=WuENk6Xd8ItJXm1bVN+64JKufb1pwgcBENixwzyNVI7bLwJjR86rzOIVcyd3gEPAFH2VVf zHNADiJr9I2H+6zyJTx9tD9YGcUsD4T1QDAqtaxND8jjBq9Oa8WWmrrlW0MxQOu0nAVtpa 0MVy/CJo0PtSGFVMNzMnqVYMndAcwlgT8MUamZeILDrJv/0Q1ymAH1+EDP2p+c1OMELNa5 UC9kh/9ZK6M5FP95+Vi98vQsati40IoD1cA+SOa2saw2AnCze0TtBaHfYBYmuxjzsm5gJw iECLonOkt5BwGIEnyDk8T1x0k3TxnDzVa5xOB/VugN6tDfL2Nc7t2ty5Aoz/3w== 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=1715698054; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cUiC91cBhw/ZHD7WhniAtchbQpCIhldtzbX0w717nwk=; b=BLW2hHqulpEnbGb3sPeqIJJTrJKUVUYfLJIYc8gjlbIQ/TZxgK2P6ONPQNZ25HlIqQtYME ENV93jKRENHtjibxv+ySwvO5Owtu194Fa+mW9QaeLF/mZPXpaj52B6K4aMpv/oVRnZCizH WYe/3CnuXEu/tPaxPB1KM7VUXxOKVfNQbWv6QV7+L8svJizh/ZML1UtPJ9COaigc6YG/G5 YlHkpWhclDqZYcXxCtP77qz1BPlyXjJGbjyfh+b7Woyu6bmRUtMbZfSbFfHBWu82PV5Wf4 wwVTZrKTpFJ4xWl18HGtPbxgAKKgazFsjbz9pf/I54IYt9iB+gVydjfgPeVbhw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdzjL2VvVzbqf; Tue, 14 May 2024 14:47: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 44EElYNV098340; Tue, 14 May 2024 14:47:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EElYSE098337; Tue, 14 May 2024 14:47:34 GMT (envelope-from git) Date: Tue, 14 May 2024 14:47:34 GMT Message-Id: <202405141447.44EElYSE098337@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: e9a7be7def4c - stable/14 - ip17x: fix non-debug build List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e9a7be7def4c55fb5476c5d9540137f0ae6f9206 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e9a7be7def4c55fb5476c5d9540137f0ae6f9206 commit e9a7be7def4c55fb5476c5d9540137f0ae6f9206 Author: Ed Maste AuthorDate: 2024-05-08 13:20:44 +0000 Commit: Ed Maste CommitDate: 2024-05-14 14:47:00 +0000 ip17x: fix non-debug build PR: 278847 Reviewed by: jhibbits Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45133 (cherry picked from commit 82f43db382cc4aea2a3f34f08da9a97ab023d5fb) --- sys/dev/etherswitch/ip17x/ip17x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/etherswitch/ip17x/ip17x.c b/sys/dev/etherswitch/ip17x/ip17x.c index 218c0c293662..65e548ba293b 100644 --- a/sys/dev/etherswitch/ip17x/ip17x.c +++ b/sys/dev/etherswitch/ip17x/ip17x.c @@ -556,7 +556,7 @@ ip17x_ifmedia_sts(if_t ifp, struct ifmediareq *ifmr) static int ip17x_readreg(device_t dev, int addr) { - struct ip17x_softc *sc; + struct ip17x_softc *sc __diagused; sc = device_get_softc(dev); IP17X_LOCK_ASSERT(sc, MA_OWNED); @@ -568,7 +568,7 @@ ip17x_readreg(device_t dev, int addr) static int ip17x_writereg(device_t dev, int addr, int value) { - struct ip17x_softc *sc; + struct ip17x_softc *sc __diagused; sc = device_get_softc(dev); IP17X_LOCK_ASSERT(sc, MA_OWNED); From nobody Tue May 14 14:47:35 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdzjM6wL5z5KTPx; Tue, 14 May 2024 14:47: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 4VdzjM43trz4dDw; Tue, 14 May 2024 14:47:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715698055; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fYrCOoEtZFtST6sDW8cCieaBQUs8g5nhW1S5Zufzi/M=; b=BkMQYlsi3VAx/v4LzxZopKMgdSLedm4lwxfEgNsuRTSTO4VkrcMCkI/mjVl/0wR+P/hw5p 8XLvyuVHclr5B35+vxQI4S4ypgj8BusDEL3KIH2EYFzEm6Ho8pfh1c5dbr+vzhqcDYbL5Z f+ICo6i07u9toaeHcM4KNUghDaeBuWaGT/PMtKCEwt4VmrE8eh0cWVp6Lw7ZhZqlF8QHN/ ddRBKwhE3p6UmRnMj5q+Y1Oh/mouisuL6Fx0DgTTP83XClb0RDUUTLp+frdtV4gGyEc0Cb lLI8SDSXW7VobcMhdTasUM1X4Ij5nxUIPPB7ZcB9HGaZoDRTcbDDP17zHoo1sQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715698055; a=rsa-sha256; cv=none; b=pBhgpJBU1j3o6Qv+ngARp6Z/YxpZ0apkP7Gi+9eiU477SVm3VIW+caJbwNEcjnWJPMwy0d KG9h4/MSE+PuLRIjJITNi6wCW8+eufuPbN5jAc9zP3JI4bJNStXCdLwVbxRM/c527MCh6V DueKmkz+SQ1sgXDs52cmu2AwyMX5lveRbV51pkSo3k/8be+tnmK7e9L8ExazN6niQTER+/ A2P8/wwaE11FTi5yKUpoCr2A+vWNWSf6aksIFD7DUaWrA319E4wE+0RAZYwvjX3WUYl7ln BqdP35uInE+zAzwRfDh0uXJWd/KKRWHhuvfaBLd6DIoBZMeKxJhNIawP4IZZoA== 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=1715698055; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fYrCOoEtZFtST6sDW8cCieaBQUs8g5nhW1S5Zufzi/M=; b=YUfQ3/+Er4knpen4CsD/t01kOKIx9AbVvnCBFnDB+g1ctJ1OM92VXrHuFxYMziQNb7Y5y4 ZiunCs2B3BrKPNEfocLi32+cBXz3JcQz+zVa/KVmWH7siHXyyEMLA5D/lF0H6WC9nrbFsc bC2GGcrrvKUlulPPzw8n8TE/ctELKqyCtf8BrfggPB1dq7k9IKJ4OBuNeP6l7bohzIbMp4 P1JwuGjxYDrQI6eLDqRX6x4Zk1G7wZsueE3ucN9X44sWJ2sT2nT8sEGz7VKvEPPDxHTnsO uAYOJ+jp+Ga7c7/9stfBXYs/hriHvHnQrn/tJg/FpizWRxLUgvNqUm3jFffSyA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdzjM3dKWzbf1; Tue, 14 May 2024 14:47: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 44EElZKl098381; Tue, 14 May 2024 14:47:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EElZVo098378; Tue, 14 May 2024 14:47:35 GMT (envelope-from git) Date: Tue, 14 May 2024 14:47:35 GMT Message-Id: <202405141447.44EElZVo098378@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: 7309d72e140b - stable/14 - ukswitch: fix non-debug build List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7309d72e140b8d13698c0e88168228f8877aaaad Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7309d72e140b8d13698c0e88168228f8877aaaad commit 7309d72e140b8d13698c0e88168228f8877aaaad Author: Ed Maste AuthorDate: 2024-05-10 12:52:06 +0000 Commit: Ed Maste CommitDate: 2024-05-14 14:47:00 +0000 ukswitch: fix non-debug build PR: 278847 Sponsored by: The FreeBSD Foundation (cherry picked from commit 2e0c027e69de66afc1157c76bd42ecd3737d54e1) --- sys/dev/etherswitch/ukswitch/ukswitch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/etherswitch/ukswitch/ukswitch.c b/sys/dev/etherswitch/ukswitch/ukswitch.c index 6eff37bb118e..88726422bd01 100644 --- a/sys/dev/etherswitch/ukswitch/ukswitch.c +++ b/sys/dev/etherswitch/ukswitch/ukswitch.c @@ -514,7 +514,7 @@ ukswitch_writephy(device_t dev, int phy, int reg, int data) static int ukswitch_readreg(device_t dev, int addr) { - struct ukswitch_softc *sc; + struct ukswitch_softc *sc __diagused; sc = device_get_softc(dev); UKSWITCH_LOCK_ASSERT(sc, MA_OWNED); @@ -526,7 +526,7 @@ ukswitch_readreg(device_t dev, int addr) static int ukswitch_writereg(device_t dev, int addr, int value) { - struct ukswitch_softc *sc; + struct ukswitch_softc *sc __diagused; sc = device_get_softc(dev); UKSWITCH_LOCK_ASSERT(sc, MA_OWNED); From nobody Tue May 14 14:48:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vdzk31Dygz5KT8R; Tue, 14 May 2024 14:48: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 4Vdzk30Ft0z4dp8; Tue, 14 May 2024 14:48:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715698091; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mh2p0uZaqudVe7uiQj3SlJ/Miwx9w/i6Znb46oyjuuA=; b=C3U8huudNPO9r20FhKkR8spiHAT5EbybhCqFaf3uAiuRga6KKkbt3xG1noCoqzjL07fJft Oepea7EDMbd4PBlNOhTD8iznEvJjQe65ilLgkEIpVwPRz+QgM5K05DJczy1oHi4t6Ic8Nj 1UH3sFYenh8UfzukXbfqM9j2b8keVe2NSwQM4w115YQNoae9f65JJrN9DJ+y7pxpcKzHfS x5nYfX+/2iXMmfOPzb7BJi2fR2V73TBChr2hvrrjVxS6vsbEIrSDTz4tWSP9XHgHYmSSio ZBMfAmewWHyaUoHFmEeEzG5dDZipYW8ZD4Vpt4ZrfJp/PQrhytxHhaD0HZt/Hw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715698091; a=rsa-sha256; cv=none; b=p0zlvIOnW/JoH8We+k3dkO4ePUJtSz6rzIaP7IPMEI8KBq5z9ZPgXxTrx4k3Q2uJEOCjpb IPYYQyEhuXeNSi/3P8usOUqax2EauIBJ5pQ/2NEp8Jm334o2rhNVZLLo7E8OpwQZxLEVY/ cKdO5+TH2xyhwBuyBMEPnw6olYrD/GuvGn8tM9qtBuK4F0rS8nS1wpQbRuKAu0MN77geuz I0DBxsCfQh89zCeOj+joB/bfNC8tkkty4KfboeTtulY+INFBPO8yLX3dYW/6XlIWlOwp0w X6u6NZv2sKIcW0+Hh0L7JpihpmUFxz8N3R++OKhrseDo6VBiMUUFZrtO3//3ig== 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=1715698091; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mh2p0uZaqudVe7uiQj3SlJ/Miwx9w/i6Znb46oyjuuA=; b=DgCBuMjm1ynkM0zFNtFQKVV1boFZoseqgTjxJM3XvfSN7dWc2VLdRE76pDWSnXiEON6Cpm kpXBGRVQCDy5zm+xUXGf81iEx/XASsDsRiITA1jPEZrJ2QDteCvi1RGz/9yMW8QwYP3ahb laMl8KDxiLvDS48q5YS69f0eBWlhNFFzxEgIXIe2GcwnNkcnUQGACqMCL7VCB+4A/KZp61 0EI9sxyoH9H7JeB4+5L0ZlUKAaRbaBXw4PEFxNvA3wonNLaNs2qvEIWUaOgrVy1Q+TVfko xvktlWdbT8WVoGlqjo5m17fgTwRtNvQo5i5Eyqes1RoVbU9h+uDjIED7bGltLA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vdzk26w4Hzb2b; Tue, 14 May 2024 14:48: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 44EEmAtf098606; Tue, 14 May 2024 14:48:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EEmAGx098603; Tue, 14 May 2024 14:48:10 GMT (envelope-from git) Date: Tue, 14 May 2024 14:48:10 GMT Message-Id: <202405141448.44EEmAGx098603@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: 412b433cc75b - stable/13 - smsc(4): update to mention Microchip List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 412b433cc75b99b581d2a1aab46890f15ae72914 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=412b433cc75b99b581d2a1aab46890f15ae72914 commit 412b433cc75b99b581d2a1aab46890f15ae72914 Author: Ed Maste AuthorDate: 2024-05-07 15:33:45 +0000 Commit: Ed Maste CommitDate: 2024-05-14 14:47:45 +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) (cherry picked from commit 5e7de5daa95dd901fc4f051120461805aaff29e3) --- 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 e6f811754555..e57e5e044a18 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 Tue May 14 16:54:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vf2WR57glz5KfpW; Tue, 14 May 2024 16:54: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 4Vf2WR4YPfz4t3J; Tue, 14 May 2024 16:54:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715705651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mIM24nKVwJ5R1m+YP1p1E7lf0D/ofWMQva8NfogMaZA=; b=wyJTLc8eHgNvp3xEmVEx+ktYPR3ALTlVYwT1uJlRDz2UmmosGIx/WuF/va63suTxS6Hjc4 1cCuJ2ZOPBBUptFWVy+ueFQvw+flgLCGBsS94mntlvRzpnuRbrz7J3fkOVxkTKZxizyKtE 3HpE+m65SIF34l1hVWNhcBu6HTo71mbS5i4oDnJkLQIVw75Kft9EpSEaLxqUqcFYpNEAI3 Jt11LSSo/FKzT4N0g3B5z6lSPw2oUi1J4LQQdb8g3IOxUx0KhGZlEsPdNkWxwkSIJgjQVC b91ksWxl/dIU4L3cN0z019leIPqXKb9pnOgui4jOtlIC0qzexONCKwKNQSDx5w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715705651; a=rsa-sha256; cv=none; b=yBTSz/RY40z0VbJvCCUaJS0EXPDfqK+FUdryS5jM6IPFBmZLIbVXREmwVd7dLxwtO3k6h6 916hXLL8Nw4xKRYBVT4/5aePf7ML/vBlq660tW4hAdn7g0KV5pWVYKLE8E4hItm5cXYAlZ kmVFejF4+ZbRU14DaxJFbLdZa/zJ8SZngcc1iLWGNjv7QRNZSjTno/5/80fKI5euAdzUUw 93EI+lTF3nj+WGQfki3itc1N1ZbUxzSSCAHFC713xIBvuRyGXKOkNepeDGVyr4ZGHLdqGK p2tQWr8oObAkKgcWj4PLsK+3T6Bw7/0171M8yB6im5ByiUQooqUaxxTcUDHRxw== 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=1715705651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mIM24nKVwJ5R1m+YP1p1E7lf0D/ofWMQva8NfogMaZA=; b=K/eLZ8vDPvGqRw0/89wQVDzyO6UcC5wUv5tn/0rHShM7K+TZVkfFTS+344YJN7viWiGjra iWlHBnec7wQve5Wx7Q0iDmshtJ8XgMVCZeaVdPAQH+d02LMRFN0CTq0EOKXr/K1Ka7kwst anczUncmlHdhVR2IfQ+tu4JukhIn3xTSqP768S5MQTXMxCuGCaNhUeZP/JSML45qKmTwzU X/VTweJW7ygI7Z2XmheeW19fLwLHetu1vCA9hD1V1mJj5CF0DV+bFfXRiFll436gZFzOYK 3CrX3PzeqjLtHmSGiS9HaO7K3FN/7WOdOO0XBReo/cq5BItHON7v9Rvpfaai0g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vf2WR46FJzflt; Tue, 14 May 2024 16:54: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 44EGsBVw018038; Tue, 14 May 2024 16:54:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EGsBAF018035; Tue, 14 May 2024 16:54:11 GMT (envelope-from git) Date: Tue, 14 May 2024 16:54:11 GMT Message-Id: <202405141654.44EGsBAF018035@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: f4b6272a26da - stable/14 - .github: Update the path used for the homebrew LLVM install on macOS List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f4b6272a26da7b1cf577d13c74c9f146412bad56 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f4b6272a26da7b1cf577d13c74c9f146412bad56 commit f4b6272a26da7b1cf577d13c74c9f146412bad56 Author: John Baldwin AuthorDate: 2024-05-02 21:11:48 +0000 Commit: Ed Maste CommitDate: 2024-05-14 16:53:59 +0000 .github: Update the path used for the homebrew LLVM install on macOS Pull Request: https://github.com/freebsd/freebsd-src/pull/1212 (cherry picked from commit 1091f525df9d74f07d707d8a79a91fe26a6c50e3) --- .github/workflows/cross-bootstrap-tools.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cross-bootstrap-tools.yml b/.github/workflows/cross-bootstrap-tools.yml index 0aa1d9a35c1e..8a714788cce7 100644 --- a/.github/workflows/cross-bootstrap-tools.yml +++ b/.github/workflows/cross-bootstrap-tools.yml @@ -30,7 +30,7 @@ jobs: pkgs: bmake libarchive-dev clang-14 lld-14 - os: macos-latest compiler: clang-13 - cross-bindir: /usr/local/opt/llvm@13/bin + cross-bindir: /opt/homebrew/opt/llvm@13/bin pkgs: bmake libarchive llvm@13 - target_arch: amd64 target: amd64 From nobody Tue May 14 16:56:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vf2ZX3Mzhz5Kfrn; Tue, 14 May 2024 16:56: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 4Vf2ZX1Tcgz4tM6; Tue, 14 May 2024 16:56:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715705812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vrsfH/8nx2d+Cac1ELlPM4boj2lEJCVKbFvPRO+CXks=; b=nui8p+6le7aVSgQ75p+paWYtZPbDxa44WE+XL2Q9461D1ly+hxa/3pBH0sS9UIqoInBOq6 J7+hAkKiTYchfiHg6kS4/gQ0XifXzDt1KReKcKp3UbhRwF/MmzurPPTwkKUuVlRvtjp1+l 1NV0uiC/TooWKp4NxXB9TSm+qoHqqrnoKyU8+vLntTidvAdTEmpsstoF0CGclUnB+X9Wn2 /8CikI2zDn10tpXOWhHKwuy7MPt81SCNOTNVl0De84FSs9fANqciHgXwWseGPYgW2n4r4G HbgPECo9JmZHeGs0690HvBpn4oAY00frnXiAO+ZcM+yq9XBX7OJMGNFTEPKicg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715705812; a=rsa-sha256; cv=none; b=LKkc73rQkfwnh7SCAKpUyWXSISovLP43/HSOieIXzvVj5qpVCY64mZL5h/4o9mNBH++5u2 8TSWia46C/fkqWf9kE3iYmVWms98KNT+/dmlfmVAe2KVJVnilMhdRwoa56PoDOOMevu+dd n61sLp6zaJMeKYmglaVhXeh5lJC0EPjIzblaT0yzYNWiOZRjyla89mGRIVEuvwGi8CHdgc DBpQ8Z8tRELXLQfem4p1geFoLewBCthwXpY968EzGReLxhNQDTg5BC7XZasYjsvgpa9W+t bLcRJH+H+EW4N22pfZibW+luqpJo95aOuD8JK28hKiEsBgwmYx4eq8R2/e6Jhw== 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=1715705812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vrsfH/8nx2d+Cac1ELlPM4boj2lEJCVKbFvPRO+CXks=; b=Tt2CV7a/qTLhIa5Y5AdKxDHIHpoq7DzSYlDQYBXD3eFcW6dYIRMs/CVA2XZdtTgLxJAUpC CCVoup2AMkyQK+RzCPEMWPw4jNg/zDQa8z4oQG8DP0hMhW6xoRlRgEBrgyn0R9aJhIS746 zbHXxIpawG0TQuvewTxevWv1zYNmmzMOb5GKG9YRcwG9s8t5vvaexSU3SO5ZBpr43oLQ7L QS8MeWnX+LN3v95X1LKdY+KQwnBstpbl6DA6JbAF7Qd9ycC6jNKQLjGYhsMjiF87BP9SJI 1ahg4oulj/6MwGG1QvIQI0JyRbx1hZ4rOqe8vOuVSiGWl/TPIrGXnRHenuCJ9w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vf2ZX14zszgH5; Tue, 14 May 2024 16:56: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 44EGuqie018544; Tue, 14 May 2024 16:56:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EGuqa5018541; Tue, 14 May 2024 16:56:52 GMT (envelope-from git) Date: Tue, 14 May 2024 16:56:52 GMT Message-Id: <202405141656.44EGuqa5018541@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: dfac340633bc - stable/13 - ip17x: fix non-debug build List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: dfac340633bcc64ce005009483ec353c6201b210 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=dfac340633bcc64ce005009483ec353c6201b210 commit dfac340633bcc64ce005009483ec353c6201b210 Author: Ed Maste AuthorDate: 2024-05-08 13:20:44 +0000 Commit: Ed Maste CommitDate: 2024-05-14 16:56:33 +0000 ip17x: fix non-debug build PR: 278847 Reviewed by: jhibbits Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45133 (cherry picked from commit 82f43db382cc4aea2a3f34f08da9a97ab023d5fb) (cherry picked from commit e9a7be7def4c55fb5476c5d9540137f0ae6f9206) --- sys/dev/etherswitch/ip17x/ip17x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/etherswitch/ip17x/ip17x.c b/sys/dev/etherswitch/ip17x/ip17x.c index 66e74b098e7b..cf118b0bc2cf 100644 --- a/sys/dev/etherswitch/ip17x/ip17x.c +++ b/sys/dev/etherswitch/ip17x/ip17x.c @@ -556,7 +556,7 @@ ip17x_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) static int ip17x_readreg(device_t dev, int addr) { - struct ip17x_softc *sc; + struct ip17x_softc *sc __diagused; sc = device_get_softc(dev); IP17X_LOCK_ASSERT(sc, MA_OWNED); @@ -568,7 +568,7 @@ ip17x_readreg(device_t dev, int addr) static int ip17x_writereg(device_t dev, int addr, int value) { - struct ip17x_softc *sc; + struct ip17x_softc *sc __diagused; sc = device_get_softc(dev); IP17X_LOCK_ASSERT(sc, MA_OWNED); From nobody Tue May 14 16:56:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vf2ZY3dFGz5Kfh7; Tue, 14 May 2024 16:56: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 4Vf2ZY2FQ1z4tZ9; Tue, 14 May 2024 16:56:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715705813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=neyuCObRSILJzFV4wZYJWfLH2e7N+VXOuSXwqe7+Foc=; b=DwErs9kA8qaFSAcQaQJ7368/4NBgZoz84GOyvwnXjSDkVu3z53uZQLkC1oTvf5Z323j9nH 8p8CFHPtDh5LEZveZOzft37Bn+SxzSnDAn4uVVEbt86/eUZ+7WSq0xMfKvfK5Cb2htpIwy zV63lLSEq5h+UtgLXKJozRxyHC2MOy2LubbkySIXtfcv4JDiZf8w8UDwbTksKrRGO2fMAL QK1l7zdYve8p0cLW3JH0xqSOXDzQZ3b6+zp/eixe5fe+T2Y27g8/24uF+L+NtLR9Zwssd1 B+G7s4CrIEKObYxgoNqz6jtmuTMjMkNnZQiZgTtJicBhtRNKRelU2OE1zuV+sQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715705813; a=rsa-sha256; cv=none; b=sqpJkGhKWRqM4/gAB0BqOOAnM3tNeHGwrUl9ZoPne4vtoHKjFpqv/9CD6ccamQh2mAVFtW gfk+WUmhLuTG1Z/Dj+Lkn8nUrXYgtlm+eusdY74W35eK23dy3cZ0knJuV9ZQYk542pG/GE 266wT9/JJX4l2+vjo07rgOf1ZpPPfyXQq7bVV/zDZpV1i5uxSb2DW9BMJc/H2Au6E5aVof BwL6VKqG0ukbC5eXdBMCYJA8HbmEiI8GVqfvez2x2Z5sEjycDmlIwHeoYNuVaNW9lCweyF MHeYE8NjCVpMX97RuOTH+zX8PwmsImaywKxvGWKc+/ig4DooUVxIq7z25QuzFA== 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=1715705813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=neyuCObRSILJzFV4wZYJWfLH2e7N+VXOuSXwqe7+Foc=; b=XOzYcN6EBPr02II/xBv3k/T0NFlgKBPqrZ9whzbMoqK9CcMtYATFiMt9lmuhlPRNlI6lX8 kEB8CtnQuF75EFTaghcMBcX0kIELenHtwy6RqfzLLrzp1z7vv4bI7p5XChOItYR/TZ2IXL 2gm+De/siw7jk23rYxmucmtdqWsrDmJPDYIEH7sMc61UHrDZymEt9cdy3tLuOURHLGBo/g sIJKXdBCWZDA339uHLYsTl3vYL6n5WQhTX5NqRJrl9GXl1DnihjJW8XnutjTWekkd93vKI VuwHpR2aL7YHK5syj+G8w0A8a/o8Op2b1eA5vFRheGAaB4lvgk028Q3/QAH0jA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vf2ZY1rYdzfxD; Tue, 14 May 2024 16:56: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 44EGurFf018589; Tue, 14 May 2024 16:56:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EGurLD018586; Tue, 14 May 2024 16:56:53 GMT (envelope-from git) Date: Tue, 14 May 2024 16:56:53 GMT Message-Id: <202405141656.44EGurLD018586@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: 1346b9ca7167 - stable/13 - ukswitch: fix non-debug build List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1346b9ca7167789061edec6547f1f8c5b839c71a Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=1346b9ca7167789061edec6547f1f8c5b839c71a commit 1346b9ca7167789061edec6547f1f8c5b839c71a Author: Ed Maste AuthorDate: 2024-05-10 12:52:06 +0000 Commit: Ed Maste CommitDate: 2024-05-14 16:56:33 +0000 ukswitch: fix non-debug build PR: 278847 Sponsored by: The FreeBSD Foundation (cherry picked from commit 2e0c027e69de66afc1157c76bd42ecd3737d54e1) (cherry picked from commit 7309d72e140b8d13698c0e88168228f8877aaaad) --- sys/dev/etherswitch/ukswitch/ukswitch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/etherswitch/ukswitch/ukswitch.c b/sys/dev/etherswitch/ukswitch/ukswitch.c index a5d2de94a13e..ab22ac5f97e9 100644 --- a/sys/dev/etherswitch/ukswitch/ukswitch.c +++ b/sys/dev/etherswitch/ukswitch/ukswitch.c @@ -514,7 +514,7 @@ ukswitch_writephy(device_t dev, int phy, int reg, int data) static int ukswitch_readreg(device_t dev, int addr) { - struct ukswitch_softc *sc; + struct ukswitch_softc *sc __diagused; sc = device_get_softc(dev); UKSWITCH_LOCK_ASSERT(sc, MA_OWNED); @@ -526,7 +526,7 @@ ukswitch_readreg(device_t dev, int addr) static int ukswitch_writereg(device_t dev, int addr, int value) { - struct ukswitch_softc *sc; + struct ukswitch_softc *sc __diagused; sc = device_get_softc(dev); UKSWITCH_LOCK_ASSERT(sc, MA_OWNED); From nobody Tue May 14 17:08:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vf2rD4vJXz5Kgjk; Tue, 14 May 2024 17:08:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vf2rD4Mxbz4vwL; Tue, 14 May 2024 17:08:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715706524; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zdZ5XSU062lhuuRULGXske3tRC0qQExTmBK6albsN40=; b=Mw173HrEcaaY7lTxyI151HY7D2huQycsoKQ1ERKRQJQfGiiXvQTaopGvsEMHnhArsTXZhD qUACwuAfQynmiu5MeQkDfSSwDXZURzYKY1kyCQSLUrIIR3lDjmnWVv8GTxKHrfX3RK+iOl KJFXpdndjdfqFGJLGF2DkZ9qsKDd391WIMKO9Du2FIuNxsuHN3/TcFn4NfazNUyuCv1gaF KXZ1wC7t1lnFdPlMU0HzSBgGlAp/4QLP5CiYxsXsBTR56rLQF/EfKVPxl5pRNrUUQEMTQb KvorzrmRWe0ZvwnJSF/3gDxNj6pLK6pNL2IeRqAGFMkQ/7b5yN51wlvqXteKrQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715706524; a=rsa-sha256; cv=none; b=c/wKCbC227666zEs0qfYsmt0jq3xL+Pckxez/YISZFFk2K6x7hoShAgPmSBdss08q6q432 hMZZPVnnGnsO0SfKZnFopxAebdraRP11oOnDXKo+E0eXo1f3av+r5mVpAppUdt9RpstOA3 /qJoxCLUjYVPh812iXVlELAUrnzoNHjrrDhqHYl9at1AyraFLs90gm0g4+DSVpKW4UnVLw JFB4sMPSAzfIIBQnruWTmGgWetJt62cQ5vYXeWiOx7RL9QE5qBnqqS6ROdsk//Y6i8VNAa OsVK0H4HWrdA/K7FF9n73r6pDwaJIO9rst2TgagEBjTGm9z16+My+p2ijr64Kw== 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=1715706524; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zdZ5XSU062lhuuRULGXske3tRC0qQExTmBK6albsN40=; b=QN/xejsLfVCwXRbVFrKovBCb6aorMXU3PqgQY9faeA0MevMP6kVFIPiYHDJWimxLGpEBw5 CiAmlaelPs682Je2/cMIj0lf1bxyS7am+nYvU72Op8gn8utemzws5Aut7mQGWQxQUTOgox dgQYa/XrGszbp+x9f6yZme5wgAVVPrarfaIr2tPAA+oNICDVzcWXYfNQxyOQal7ZjJ7sMP XGa6vbyosVy+SQvjScp6nRISvQ65DJalsudlWj7g+7Xq+e7aWlg+TnqyG/Q+dxT6DVUd2b jZjW7Itj0640vAf3kd2OxL9aH4fRr+VFvetOz/odD4BdQBQU6o6VKJSMgl5NAg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vf2rD3zQ6zfy8; Tue, 14 May 2024 17:08: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 44EH8iH5037184; Tue, 14 May 2024 17:08:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EH8iWS037181; Tue, 14 May 2024 17:08:44 GMT (envelope-from git) Date: Tue, 14 May 2024 17:08:44 GMT Message-Id: <202405141708.44EH8iWS037181@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: ea6caf8bc223 - stable/13 - .github: Update the path used for the homebrew LLVM install on macOS List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ea6caf8bc223783f6c6b898285ef96c1ffa7cdcb Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ea6caf8bc223783f6c6b898285ef96c1ffa7cdcb commit ea6caf8bc223783f6c6b898285ef96c1ffa7cdcb Author: John Baldwin AuthorDate: 2024-05-02 21:11:48 +0000 Commit: Ed Maste CommitDate: 2024-05-14 16:56:33 +0000 .github: Update the path used for the homebrew LLVM install on macOS Pull Request: https://github.com/freebsd/freebsd-src/pull/1212 (cherry picked from commit 1091f525df9d74f07d707d8a79a91fe26a6c50e3) (cherry picked from commit f4b6272a26da7b1cf577d13c74c9f146412bad56) --- .github/workflows/cross-bootstrap-tools.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cross-bootstrap-tools.yml b/.github/workflows/cross-bootstrap-tools.yml index 47349a517a1f..78ba1560e5de 100644 --- a/.github/workflows/cross-bootstrap-tools.yml +++ b/.github/workflows/cross-bootstrap-tools.yml @@ -30,7 +30,7 @@ jobs: pkgs: bmake libarchive-dev clang-14 lld-14 - os: macos-latest compiler: clang-13 - cross-bindir: /usr/local/opt/llvm@13/bin + cross-bindir: /opt/homebrew/opt/llvm@13/bin pkgs: bmake libarchive llvm@13 - target_arch: amd64 target: amd64 From nobody Tue May 14 18:14:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vf4Jd3vYqz5KmPy for ; Tue, 14 May 2024 18:14: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 4Vf4Jd3Q0mz430P; Tue, 14 May 2024 18:14:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715710497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EE5N2DCK1xKcEd3WNE8say2Tb5lj1K3y0ZyQ8M8lmKo=; b=qyJZOJ2uUuvjyXmBcyYHQhlSN4R0V1a+K0oOuEQcDn5mMA0/FPY17IiqvLwS3acAkvK/bE XVUSjykpMbsasg7GXDhiX3ZyO7VEMtpIqnuSc9I+rT2XHEMM0euSeDdlohf5SYMrKYq4aI G1y+2eYZ6UUEbhd2Luc+9c3pDJ8rb7n/ypryhv0OX60Sx3/ZUc4hut1eEBd7B7M3NoAoRW Hbtugq11uthZXFqu7PbH7LRGCU/i731wLuG6O1tviRnWxK3oNaG1ZMFRYX6YDCSyGEyoC1 1ewVYMXOOSR1OEGZL6eCI4igt5JpbGx5NE55ziL37hKTkgzWvy7It9DykzYqoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715710497; a=rsa-sha256; cv=none; b=Lsn9aWGKuieyRVYCtVFLwy3PBssGxLvbzkTBaU/JYeWE0sivIGeSE88eiXJE1vfFsJJJ3m yk6yGmOOj7eZbb8O9DyYUiF6ycr56KeA5bleIX0bOuNub7SChTkmz/daIUathk20jwRL+z G1SMqMikaQu4yMcGoXAwsFvtPLhhpRIUrWZ2D1EYMdfRbCBFCanxu2pS5Ltnz39PS9l+07 lfCnSxvmmLZIfjpA2xMpTvxT22pX1BwtIRfamKeY9JulSD3vKTIACfYnXcWCKbL/coDL3T rTfOKqpxyjvH7qcnR8QXVKWHz274V7S2+1BeF71djy0gScJF3kb53yDOQsoDxg== 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=1715710497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EE5N2DCK1xKcEd3WNE8say2Tb5lj1K3y0ZyQ8M8lmKo=; b=l5D6uCSCCVhGGxqDUNDEAgOJfCBrpd9j2NMmNtXEA0TXAcnJQ1S+BOS852I/eIacHz0UAd mASuPHIlJBcI630iByif77QdvQWmNRvNwsLS8O6Mg863OaDn7DnalLdtuemSQ3tKr3IzO9 vZXNXdzB3kRo8cVOC0hrViNCu64U/Oftyy19G1sBj0cCe4NmvofkxXAXcGJPWXAXtxt0Lb PP8866j5UGktdEXuL2roT3jPzhz5v91DLR9uPdP4fptbVpE5T+hsk4nDD/QM3OV7V7hpGw wYGvwJ58EZOO9o80in/yzbhxn6nDr2z6d9XIOrf/L9LtJIigRAMrYWThz0n/+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 4Vf4Jd2jDLzj9Y; Tue, 14 May 2024 18:14: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 44EIEvs3055939; Tue, 14 May 2024 18:14:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EIEvwY055938; Tue, 14 May 2024 18:14:57 GMT (envelope-from git) Date: Tue, 14 May 2024 18:14:57 GMT Message-Id: <202405141814.44EIEvwY055938@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Warner Losh Subject: git: 1c25f3fdf3e6..887b27736b04 - vendor/one-true-awk - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/vendor/one-true-awk X-Git-Reftype: branch X-Git-Commit: 887b27736b04cef8c4ce6f123c5f4bdc12a8bae4 X-Git-Oldrev: 1c25f3fdf3e6b8b2708d5751a9c8f07a117910c6 X-Git-Newrev: 887b27736b04cef8c4ce6f123c5f4bdc12a8bae4 Auto-Submitted: auto-generated The branch vendor/one-true-awk has been updated by imp: URL: https://cgit.FreeBSD.org/src/log/?id=1c25f3fdf3e6..887b27736b04 887b27736b04 ota: Import bsd-feature branch from 20240422 (31bb33a32f71) From nobody Tue May 14 18:14:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vf4Jd42QSz5Kmrw for ; Tue, 14 May 2024 18:14: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 4Vf4Jd3YMFz432l; Tue, 14 May 2024 18:14:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715710497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EvAMsMBcifpKY4h2fAIObJZSUt7sXEXe/yMkabT3bw4=; b=Y9bKMuPR8dv34nIFN83iiSaqUuRMJpQL03RUonOGXJOuxl3jiRCzlL5I3OY9j2f8fx07TM CAjNbp9yhR0MT0c6GRqlNtUAGC0h2toceMZsBnvunfDZ0bMEyCBv5WouItvx+rp6smaTX2 JIOGupPN7SuDdp+qeVGQaidERW9/VhvnFrZsPGqDeCJFPiQqX5kW3cD20jJEEBS+FgiBQY 3NgdOA9nmMYgXhNA9l8s0v8FCxkDJnPB+Pyf6p/SgIBQQ7WXRR7pzc94h2vLFJ9+S2A9mZ lxs/hyc5ZmJERyPk9mn04J1ysmrWngNSXrJXjHhKDO9cPYOcdtZtQVkzXy8uWQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715710497; a=rsa-sha256; cv=none; b=SDg5F09d6x1unzwhOm8sOz8aWnTUGgaS6mCoZqg2nRPWm2bfjjirY0VCTHVT/Lr4da6kdk J5LER75RDUIOd4sN4RKlHgQE/R4OOhV9BLJEjkRHZBdbiheZJhwwObixB5L6S46BHEf+NJ VaN44hmlYNg96lESHRwE1v8qH8K5/8Pu8yCwN3WtAC+vIVGP9kcGVk96O+xeAyfti3jVJF N5lAnV/XUm4fCbxAqOttuTosSyr4b7P+QM1o6t7Cqp3FijhiIsEwGDulX51KBrsuLeRvDd eRGTlD5cB7UpAf2xAJn+nzaWBOHRPcJv2YQnbaoloFJVrkfTPYNYCTFyAGEysQ== 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=1715710497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EvAMsMBcifpKY4h2fAIObJZSUt7sXEXe/yMkabT3bw4=; b=nc8ZTIgeKR9FlTIl+Qox/moCLY64obAQQky4tXrvV2d4bfy8y56ILtajM+A2rBZSp+v1LW SjZBqGE3izG86R4m9xPzlB2KRcL7txUVvH33q7Q1AkC66MCmj7oRG9Ffv9JsR/fukPtCOW BQvA4tJDX/sI/Jb8MkSCdHY/05Ii1Np+M/TQx4GbKD2bQWs0cZhrfp9NI2eeHf6ZIN8na9 qNIcF83s4uNkXkG3/qsqh176Qhi5dnjRTf6k3j+UAYP7UzOBDnkQxvqL/2K2PIwXPsoGD7 YZ5H/Dh7WHxIYaVKCuReqTyBdmy0zPhiLP8cgUPdHyhekUYBc4jVAjI4CfZqsg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vf4Jd38cYzjBW; Tue, 14 May 2024 18:14: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 44EIEvoe055958; Tue, 14 May 2024 18:14:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EIEvLd055957; Tue, 14 May 2024 18:14:57 GMT (envelope-from git) Date: Tue, 14 May 2024 18:14:57 GMT Message-Id: <202405141814.44EIEvLd055957@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Warner Losh Subject: git: b744dcd7eaa3 - Create tag vendor/one-true-awk/31bb33a32f71 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/tags/vendor/one-true-awk/31bb33a32f71 X-Git-Reftype: annotated tag X-Git-Commit: b744dcd7eaa398db3af944bdda17c17796e0fa2c Auto-Submitted: auto-generated The annotated tag vendor/one-true-awk/31bb33a32f71 has been created by imp: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/one-true-awk/31bb33a32f71 tag vendor/one-true-awk/31bb33a32f71 Tagger: Warner Losh TaggerDate: 2024-05-14 18:10:32 +0000 Bring in the proper branch (bsd-feature) instead of the main branch. This adds back the bsd-features that went missing in the prior import. commit 887b27736b04cef8c4ce6f123c5f4bdc12a8bae4 Author: Warner Losh AuthorDate: 2024-05-14 18:08:31 +0000 Commit: Warner Losh CommitDate: 2024-05-14 18:08:31 +0000 ota: Import bsd-feature branch from 20240422 (31bb33a32f71) The prior import(s) of 2nd edition awk imported the 'main' branch of OTA, not the bsd-feature branch, resulting in a regression for the bsd-specific features. This re-imports those from the correct branch. From nobody Tue May 14 18:17:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vf4NB3FClz5KmwL; Tue, 14 May 2024 18:18: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 4Vf4NB2QtFz43gj; Tue, 14 May 2024 18:18:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715710682; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6tIF54lzwLuUxt/DQMuxcKl857RW6h6+omoF+7qTTR8=; b=LYFnlZWvVmtY0Jg+kfSRX5GcxUp48LP4StIMni8A99HBr7WfDFDZvSMnSdSt5RuD1WEGaY 5n1fQUnIfFxrlRuUcwt+del/WRPHRlgIOd7nAWVXQVmg1XUytNS4mrJ2IbdHw9F91ycF0H s4A5a3uE4EQ88HLWOqRj2tNwFNJmT2p7saqp+OMxh3U8cIt5r+ZofGMwrRdgExvyjVk6Cd uttmQm1gz08kb28XEE8FWjZUj1NGGix5mtozf7d/SBBvvkaEqxE789yCyy3qgSJH6X1jnw 2v+j5q2KM2s5nV3x9OIv0Vl+00QiBRsggMYl/+rSB4vHSXeUUlq8WnDagJUVLA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715710682; a=rsa-sha256; cv=none; b=JH8UzObvDmoL0Hey8LsXBeJlTCrTFBdy1/Nr1UDOI+zeeGQiOwT9+H7kUiF9mjmcuQTBsz WyDBuNQRl6xVbv3yPDvATj+AjlxaHM0gmgfUwz0UKum2dG9b7sFutpIz4DjB8+0KTtZJeM DMUaiBRdGUOW945KCd2lYAS/rBZywfhGuafW8mKvytwwgqYZJlOcKSNp4Lig33fQvIxGyt F6dRJdpKyyTLHkFDkQ55crijxhnuwEUFpEdX2Kto0Atx8SpoQP3Ws/O7krZAroPa+j/+Wl 0hpavraJ1FiI47DDZqmuFaxnYm/lbzq486625TYcodUGVJNUZecHqYRNC9li8w== 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=1715710682; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6tIF54lzwLuUxt/DQMuxcKl857RW6h6+omoF+7qTTR8=; b=mkKfFZEuipJoiWTteuZpq1/zIgyG+3l2OrsP9Xqn8Ud69cau+HcrSb3TjyE6ECG1cs9xgG XnN5m786HZG7yeDI0zg7nvqN3TpTjr6bIWOo58PAYxhDxeg6qLkvsTU766uV0t3Y+hdhbX 7VuPU5ndUWsLz+JxOg+kG1Z+3lP3D28kZsEGEtp+fCcXWBHFo60Zz9hmjRC5FG0S0xoxdh xJrrnCpiXY0VS0UCfeG6H0qaqsQ2psKVanPUjsDG7fAuIAOZi97i5pwH7vBldwJTH8FFY4 A8S/jredBkyu7nmMsZlm7T4TGu56JmvWrJRuqFTXKDv6i2m+HoQrRmhT3HyC3A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vf4NB224Mzj1N; Tue, 14 May 2024 18:18: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 44EII286056538; Tue, 14 May 2024 18:18:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EIHxm8056512; Tue, 14 May 2024 18:17:59 GMT (envelope-from git) Date: Tue, 14 May 2024 18:17:59 GMT Message-Id: <202405141817.44EIHxm8056512@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: eb690a0576e8 - main - awk: Merge in bsd-feature branch of OTA from 20240422 (31bb33a32f71) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eb690a0576e8cf5412124477eace3bb765068c3d Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=eb690a0576e8cf5412124477eace3bb765068c3d commit eb690a0576e8cf5412124477eace3bb765068c3d Merge: 305db91d4b92 887b27736b04 Author: Warner Losh AuthorDate: 2024-05-14 18:15:43 +0000 Commit: Warner Losh CommitDate: 2024-05-14 18:17:55 +0000 awk: Merge in bsd-feature branch of OTA from 20240422 (31bb33a32f71) In the last 2nd edition import, I mistakenly grabbed from the 'main' branch of upstream rather than the bsd-feature branch. This means that we have a regression in awk from that point forward: all the BSD-specific bit functions (and a few others) were dropped. This restores it at the same level. MFC After: 1 day Sponsored by: Netflix contrib/one-true-awk/ChangeLog | 24 +++++ contrib/one-true-awk/awk.1 | 52 +++++++++ contrib/one-true-awk/awk.h | 8 ++ contrib/one-true-awk/awkgram.y | 20 +++- contrib/one-true-awk/lex.c | 9 ++ contrib/one-true-awk/maketab.c | 1 + contrib/one-true-awk/parse.c | 23 ++++ contrib/one-true-awk/proto.h | 3 + contrib/one-true-awk/run.c | 240 ++++++++++++++++++++++++++++++++++++++++- 9 files changed, 377 insertions(+), 3 deletions(-) From nobody Tue May 14 20:01:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vf6h805Ybz5KwJw; Tue, 14 May 2024 20:02: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 4Vf6h71dX0z4FNC; Tue, 14 May 2024 20:01:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715716919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1Fq9uKOTJeJC4/XeP/gbW4vhprG2TAcD+59cT8QgV3A=; b=fVDYshLaxyeVKyx3HoLBR4Gzdxq2RcEc/SLPe3WMdhKFG02jSO23fvrpB9wOZjWSOBBOrk ePWfeLxAhd0lqJgi5NihPd8TnKiwU5yTh0GjrV/Oeawb9qnp9XGYxIoodyJbHUt28UdPrB fqcGDSUgmyMn5slkqDR7FZZZNTuA0Vm8Ryokc5ZDHcQMkzt/iAtl4s6XZySfyX8jYlCkZg 9XkgdOgan9lKlvmZ/3JYsiK6XdfoQ3UcFF88uDPVaHKVDIEx+6pkCp2D9b3tkpdzxWjhvd eWFrIuE3C2bjWzLDp/H3T60on1S/lJdwuOW661CNhh1Df+M4KsBMYbqpKK0M3g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715716919; a=rsa-sha256; cv=none; b=gp0uhaQ7/rtqWw0Tmor6wMqBxlZgJgcAYTm5q07813JvvGQTsyCiTc/6kv1kNMpbuvbHGl vzmIC1DGzwvRimDAqD0yphf0cHnjl0HgNPUTf0LF7ZMNsE5FHknw3fQv+FQRedWAZf+/R8 Xds1qLFb81a0s68StGuiz/WBHDmu1kF/yLba0UTPKHNggU7PjjzBe44Y3/hun0wi3EE7b/ ghnYD3F/uodrjhKEcMfvaKtif9b1XW51jE9czNMyuF5GTYQxVr5LB6wuSQiCYyGubnbz0A 4+DrAlYVqnXe2/IhpQaU0fcs0G7B9WNDzeZGSAWLEY37ZbaYmtnldRJ1D9p5LA== 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=1715716919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1Fq9uKOTJeJC4/XeP/gbW4vhprG2TAcD+59cT8QgV3A=; b=Z3juYPLuVpjr9SFU6WWtSOREzrwiJvbSz0ciqlNltANwH+6Y1d53JxIJFarYpwfVdtcneb aimRJif6uDeT0Aqfsz4YZyJ3SQ3rHihPg5kq67hH/UlDdJGKkKoT3842Ihlq23+HDQZHas 9TVX40DxETCHpH0ui/FFP6qkHQjF4x4TgcLfq2h98515dV7Kpt+qohs9YsyQQYVXUyglRT WBoizzwvqvMu0iI331MLGbnSGUHeQDAoXR5ZajcAFuZU7+tSV4nRt3vQS49A7YBQ3ltRzf IYTzlv003P30AnHC3cCz6srpWQ7yUWrrXNG9tE9lqTNOHf28OeCeW55e+miwiw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vf6h71Dxczlhv; Tue, 14 May 2024 20:01: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 44EK1xO4038765; Tue, 14 May 2024 20:01:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EK1xPh038762; Tue, 14 May 2024 20:01:59 GMT (envelope-from git) Date: Tue, 14 May 2024 20:01:59 GMT Message-Id: <202405142001.44EK1xPh038762@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: 096a438138b5 - releng/14.1 - in6.h: expose s6_addr* definitions to user level List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 096a438138b54d6e0bd657c626921b7c4eeea668 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=096a438138b54d6e0bd657c626921b7c4eeea668 commit 096a438138b54d6e0bd657c626921b7c4eeea668 Author: Mike Karels AuthorDate: 2024-05-02 15:24:37 +0000 Commit: Mike Karels CommitDate: 2024-05-14 20:01: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 Approved by: re (cperciva) (cherry picked from commit eb3dbf2dbe22ed6d4df54aebbf23f5b555a21cf1) (cherry picked from commit a5a2e963f9a0a4bc65aa1c70a361243328e23961) --- 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 Tue May 14 20:38:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vf7Vg5CGcz5L03G; Tue, 14 May 2024 20:38: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 4Vf7Vg48t3z4JYf; Tue, 14 May 2024 20:38:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715719131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L1tl89Zho1ir7ViggzV5HyZTIAjGxho7JQmMy6AK9ug=; b=K1i0Y6wkuY4EmPIbNzfuDr/9vlkh5N0RdYBdgfmfyaagov92iWKabpBWUrh/G0xAAAXnmp pLGCwWnSn91SXIMFzYmSXfKuBlfpgtK9S5j46buVkU9A0joqiUjOGCEsKOQllQ7nADedXv r48b33tEjhE35JIr2Fhyjto27p20AtCyEcCss82KkL7Iykwgic5wbvxWKtENXo1RC6S9H5 0FoI5GY2JQBKADb/oaYcMrfL6lqXqP0IAxkoDEVUuYo7CsLgnZBl714J/YIdIksx6UQVv0 a4XltwLQ6gofkefg6f+KEOnWCpu4x/hefvlo33ZA2xcC1CtFFFAGGryGCGjZSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715719131; a=rsa-sha256; cv=none; b=cDTIIKoV9ZOERA2Hdm0XJ1Er8fXBM/Zycl8wa1UPUnQy2UxeS8BWUb4YZP+W226hs8LtSj LZupqjvb0SlofEZNumccrakzPwrEfvQx9tn4pKXJzJg1kMBbS2v023oi9VOs+k5GC7+JfK sg9nZO0w7CaT6fF9fHRMGP1aUeRXZ6sz/dWjwYCsSYwV99uQwW8KCZeeG+FhdtXpoZT+vd Fkw4ZovTPchha3G5TeFxLbqSQx0tKHE7u2xwdnk//tu502cVcBcrau59zNZ2eAZszdYCHe V01J2lmiP3lcZClzTkHsVrDwU0zoP1wvDTt4LI7w2OD08mF7vhLiXHjE8ansTw== 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=1715719131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L1tl89Zho1ir7ViggzV5HyZTIAjGxho7JQmMy6AK9ug=; b=JkpqN0RgptZ5JSBu2z9nhGfR1i9W9dazv+d/TlIiuRqC/MJImPoPotDq1APZRZ+U05raCH D0ew2N4Hr/5nBlnMgGQZFViO12dh0ehfOYlaNR56VaLKtZjjNRPo43UpE6ojnVdLtxArh9 DeZp58xW35KYMBq0nKiX2nVRWx7H/2XBroNb3P10fDBST/Q7d8T0S+TAo4JpTn4xwccKsP z5IaqiwuFiCLKn8MoIVG6tHt5y1sTBD1vh0hgBrDBqq4J6fvQYHXiOVfzreamHBBGjnSKD dBdrQdzTcfxJAGETEcf+cCkCfrOG+e1cYyiWCmAJP9bEe522RP6dXzpnxLZgXQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vf7Vg3JNczmZQ; Tue, 14 May 2024 20:38: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 44EKcpLA092213; Tue, 14 May 2024 20:38:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EKcph7092210; Tue, 14 May 2024 20:38:51 GMT (envelope-from git) Date: Tue, 14 May 2024 20:38:51 GMT Message-Id: <202405142038.44EKcph7092210@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: e9927f4e6129 - stable/14 - fib_dxr: log malloc() failures. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e9927f4e6129271843985d994aab9edf7299aaa0 Auto-Submitted: auto-generated The branch stable/14 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=e9927f4e6129271843985d994aab9edf7299aaa0 commit e9927f4e6129271843985d994aab9edf7299aaa0 Author: Marko Zec AuthorDate: 2024-05-06 18:21:55 +0000 Commit: Marko Zec CommitDate: 2024-05-14 20:31:10 +0000 fib_dxr: log malloc() failures. MFC after: 1 week --- sys/netinet/in_fib_dxr.c | 45 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index e7eede53ea51..db4f4a537e22 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -1118,8 +1118,10 @@ dxr_init(uint32_t fibnum, struct fib_data *fd, void *old_data, void **data) struct dxr *dxr; dxr = malloc(sizeof(*dxr), M_DXRAUX, M_NOWAIT); - if (dxr == NULL) + if (dxr == NULL) { + FIB_PRINTF(LOG_NOTICE, fd, "Unable to allocate DXR struct"); return (FLM_REBUILD); + } /* Check whether we may reuse the old auxiliary structures */ if (old_dxr != NULL && old_dxr->aux != NULL) { @@ -1213,16 +1215,41 @@ dxr_dump_end(void *data, struct fib_dp *dp) dxr_build(dxr); da = dxr->aux; - if (da == NULL) + if (da == NULL) { + /* malloc(, M_DXRAUX, M_NOWAIT) failed, retry later */ + FIB_PRINTF(LOG_NOTICE, dxr->fd, + "Unable to allocate DXR aux struct"); return (FLM_REBUILD); + } - /* Structural limit exceeded, hard error */ - if (da->rtbl_top >= BASE_MAX) + if (da->range_tbl == NULL) { + /* malloc(, M_DXRAUX, M_NOWAIT) failed, retry later */ + FIB_PRINTF(LOG_NOTICE, dxr->fd, + "Unable to allocate DXR range table"); + return (FLM_REBUILD); + } + +#ifdef DXR2 + if (da->x_tbl == NULL) { + /* malloc(, M_DXRAUX, M_NOWAIT) failed, retry later */ + FIB_PRINTF(LOG_NOTICE, dxr->fd, + "Unable to allocate DXR extension table"); + return (FLM_REBUILD); + } +#endif + + if (da->rtbl_top >= BASE_MAX) { + /* Structural limit exceeded, hard error */ + FIB_PRINTF(LOG_ERR, dxr->fd, "DXR structural limit exceeded"); return (FLM_ERROR); + } - /* A malloc(,, M_NOWAIT) failed somewhere, retry later */ - if (dxr->d == NULL) + if (dxr->d == NULL) { + /* malloc(, M_DXRLPM, M_NOWAIT) failed, retry later */ + FIB_PRINTF(LOG_NOTICE, dxr->fd, + "Unable to allocate DXR lookup table"); return (FLM_REBUILD); + } dp->f = choose_lookup_fn(da); dp->arg = dxr; @@ -1311,13 +1338,17 @@ dxr_change_rib_batch(struct rib_head *rnh, struct fib_change_queue *q, /* Structural limit exceeded, hard error */ if (da->rtbl_top >= BASE_MAX) { + /* Structural limit exceeded, hard error */ dxr_destroy(new_dxr); + FIB_PRINTF(LOG_ERR, dxr->fd, "DXR structural limit exceeded"); return (FLM_ERROR); } - /* A malloc(,, M_NOWAIT) failed somewhere, retry later */ if (new_dxr->d == NULL) { + /* malloc(, M_DXRLPM, M_NOWAIT) failed, retry later */ dxr_destroy(new_dxr); + FIB_PRINTF(LOG_NOTICE, dxr->fd, + "Unable to allocate DXR lookup table"); return (FLM_REBUILD); } From nobody Tue May 14 20:38:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vf7Vh5m0Gz5Kyvv; Tue, 14 May 2024 20:38: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 4Vf7Vh4ltnz4JfN; Tue, 14 May 2024 20:38:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715719132; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N9O/+LWKwITGIKwC8fFLekHX72JFxA87Cgxuy+C99qM=; b=E7IR+eWmF2G1uKzIneVX3R5eN34gSXCPua/oAfQYF/LY5/CIE0bkv4noVaXafgqnIsTAlh JV+0LSszRY/elgrd3O8ttXyBLOLDEbbzchflkMWOz1wKwZNX4hwJfofsfjtT3ntU2GJDMX xxz9sM9wRtqvjgZamBtRKHWEoOA+eTTpq5sD5jiDkmeyuBkhT3uFqMzQW/FIEzpjJVSU6/ /m6cJzPTmslcaRQ80SiUT6IEM+9ZTjQXAVd9UTTV8Z9V3OQRrRww9GUp9HzUduqc17OvYA DzbfKGNBf3YSvBFVzuRd7i5mUlKS5hcIJV4PZOpOXmeW+5l3R+ZjiFC9ugymLA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715719132; a=rsa-sha256; cv=none; b=jLIP7SU8ohaqHNcm5TWP56NYLWpvepoqpArSs1v4EXZeGIRSsVJNHV5l2h40D9uCJEsLJw TwEQyy3/6Rqn7MdWjG2Pph4HNHj2NAU8V8OKdn8MMqcJM6/Pa8Jqrynh/YmdkuymQ5mhD+ tHqu1UAVrrZRs9MmOspsNDRtL0ZbC4Llep4WaaCgzaxO7+U4h+wdiwiceZoCOCCxg6BzMi af0UL/gKNCxUdo7yOHg9fUbuV+q4XlDDeDqZCNqhw9o6EpQtlWhfpkMO1IVQye+HapsNsZ eEtZ+FRBAPYedT9N2Q7LuclFuwPWIDy2zWfX+injLISJWp1Cwue6YDktV7ycbw== 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=1715719132; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N9O/+LWKwITGIKwC8fFLekHX72JFxA87Cgxuy+C99qM=; b=qoitDhH9XglA6jY7d0ls/NKmbMT+Q8gFhxAejijn0u9uTwtRXFNdWacBfem6X7znbkDwt8 8F/8QL2/Gc6gV53VP8OCOpLIkI8fht+XYm9tnUPr2CwiyNx7C6/ZD/SmypzF7I/7umyhZI XgeoCJAUmuVcEjdYwW2RLUjsO/RMsT1Snsgf/L9/cYPSloz6jygegimdZGT/AzNDAYlB8i tvyD6Bb+cafshWWjz83xtKbcgyuXm9fodYoY79vARCDVuT2i5/mX4pD68a74AsrrXZBvwx enK5fIrUTabIJiIK5mVZ6hl1ZSmEL1Aafifceq8u41Z/dO4mjSQ8fdOFcmr8MQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vf7Vh4MLZzmCl; Tue, 14 May 2024 20:38: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 44EKcqxV092279; Tue, 14 May 2024 20:38:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EKcqrL092276; Tue, 14 May 2024 20:38:52 GMT (envelope-from git) Date: Tue, 14 May 2024 20:38:52 GMT Message-Id: <202405142038.44EKcqrL092276@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: 64136682ba16 - stable/14 - fib_dxr: free() does nothing if arg is NULL, so remove a redundant check. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 64136682ba1681e56093f77b4cec8bdfa6375a72 Auto-Submitted: auto-generated The branch stable/14 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=64136682ba1681e56093f77b4cec8bdfa6375a72 commit 64136682ba1681e56093f77b4cec8bdfa6375a72 Author: Marko Zec AuthorDate: 2024-05-06 18:34:11 +0000 Commit: Marko Zec CommitDate: 2024-05-14 20:31:24 +0000 fib_dxr: free() does nothing if arg is NULL, so remove a redundant check. MFC after: 1 week --- sys/netinet/in_fib_dxr.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index db4f4a537e22..55f79994f552 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -1142,14 +1142,11 @@ static void dxr_destroy(void *data) { struct dxr *dxr = data; - struct dxr_aux *da; + struct dxr_aux *da = dxr->aux; struct chunk_desc *cdp; struct trie_desc *tp; - if (dxr->d != NULL) - free(dxr->d, M_DXRLPM); - - da = dxr->aux; + free(dxr->d, M_DXRLPM); free(dxr, M_DXRAUX); if (da == NULL || atomic_fetchadd_int(&da->refcnt, -1) > 1) From nobody Tue May 14 20:38:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vf7Vk0Hw0z5Kyxl; Tue, 14 May 2024 20:38: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 4Vf7Vj5m4Lz4Jbv; Tue, 14 May 2024 20:38:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715719133; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IyHvfaF31XYQ9VJJjqz+jjLrC9IhcmTEsblJGKK4TH8=; b=F3FOhxxOPPDZeWKY2Nz7VHVUEu8Jkkml2NRswqLvJQE05DPJPmY1wI3VwIxEiUffIw3Nen eV1qm1wzrv6X69RNybRSjs24AFQEsEAT7vTbjPGlyAONn9LYPNs19uz18e7f5CSCkbNw2G pAUAhpGPJMzvc07gyWfV3F/+fXZe2M2mtoNksGJE8ZtcWtSHX+CS7qRd/Z3buuPeqv3t4c 3tyivRHcG6Y5LqorA2IROJidnHGu+7o66madg6+21DqeNxKRU7QEfgvllBuoJbeDrZTEAp siElzac3cnU0QaipFVdykDxLnl3SAeHVUYXZe67YqVPsC2L9q3BAOp00UmIAyw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715719133; a=rsa-sha256; cv=none; b=L9SAgLkJHw+ZXrh2SLK2+BIjZpnw6Asm8owODMqX1jsqjOTksjFLcHSruLTC5ZdeWupfIL 6IkH7oFdsabQOH6M7ztgNQAc6LFR4kZFwXB5RzPoOKZnKlvBcl9CC83AuehFIMMbieSIZS 8qxwaIfQnjFQowz/wM8B26Oa52ODQoN9TdsOhwbOtPsHr84Gadev2luB5LCOlIEqXLxR2a zfZFOpcszdlwGNBo+YS8ZtT80RJM2Vo7UYJcZHfE+Xx9D6WO6hAin6jmGkE4zuSO2np8Ai GTzSauiedA8zKAYfOWexq6FtaUvlHbNdheh/0FnEO25n1StcuERRfSx7eARchQ== 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=1715719133; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IyHvfaF31XYQ9VJJjqz+jjLrC9IhcmTEsblJGKK4TH8=; b=kuV+0V+YOaDEJHsLb6yJrvvNvPIkOIL0+fF5rlEE/yPRozJU7t3Uiys/f9WaGWCfYK3C9c 0IQJPWQ3zRnPPBgFUCj+8yA3npj6BQxvJv0Pa2t20A7SitD1W1AzMrMWX5yLuUdIYKqJjJ WAm6Eh4cVKCWHgSlSnBAOz3FSZKI4Udq9ZsWDsJB3T3noTmLbOdRGFE0i8O67ILV/fWAwf 90ioBaE03n+wpzgKyr5htdJdnjYE33sWNesk2ywdcKHAs+pe0HsjsUAyBSKjTZvU+G1wbn UI3EBCIYvIM4WA/93VVyOjLHerXkne0GTq4Cfvr+y4hqWtgBmzlS9p23RBS1og== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vf7Vj5LnRzmZx; Tue, 14 May 2024 20:38: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 44EKcrrn092318; Tue, 14 May 2024 20:38:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EKcrGf092315; Tue, 14 May 2024 20:38:53 GMT (envelope-from git) Date: Tue, 14 May 2024 20:38:53 GMT Message-Id: <202405142038.44EKcrGf092315@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: df376a714af6 - stable/14 - fib_dxr: update comment. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: df376a714af6b9aaec5a0366e27ef42985b4220b Auto-Submitted: auto-generated The branch stable/14 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=df376a714af6b9aaec5a0366e27ef42985b4220b commit df376a714af6b9aaec5a0366e27ef42985b4220b Author: Marko Zec AuthorDate: 2024-05-06 18:42:31 +0000 Commit: Marko Zec CommitDate: 2024-05-14 20:31:43 +0000 fib_dxr: update comment. MFC after: 1 week --- sys/netinet/in_fib_dxr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index 55f79994f552..3015564953c6 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -1098,7 +1098,7 @@ dxr2_try_squeeze: } /* - * Glue functions for attaching to FreeBSD 13 fib_algo infrastructure. + * Glue functions for attaching to the FIB_ALGO infrastructure. */ static struct nhop_object * From nobody Tue May 14 20:38:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vf7Vl2c4rz5Kysh; Tue, 14 May 2024 20:38: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 4Vf7Vk6vMjz4Jfg; Tue, 14 May 2024 20:38:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715719135; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e0wzStyXwbjBq28h9tn1XiaahEBnGHOoLGGfmoRgII0=; b=ltGT06TKmmR6nj3vhyP2oJDVV3Nxu80aZwibHDWxpsSDPNcpj1EtuqwGKTunpbh9A9kSbE bqpuNmZLfz2iMznhT8/7U7uBpaKD+5rw5wtRjEvXEmr8cHRTqfvGDL3NuvQKogqEJCwEC0 AsASXInGjRgO71CGFXj9+vLmAxH8nkgszOkCk5GRWbqvlJcLN3Ou0bPAvfvrYXu4rPinwf fSo6FXcRFboKeBF32T2B7wZvH0inePvvkh3KXHeBgJPVO/OX4dihqP7BgxSulPqBt4NqNy Go4GFeJewTKF/7Sje2ai+jwyCgwFRN/n0NJvuOJHZlx1AsXM75y9ll2UqGK9XA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715719135; a=rsa-sha256; cv=none; b=sOZIazLF2ssyznsK5JwknKZ+oUiNCYdPUS9Gz7lSo4wn0rHihcG3inCCXXX8vfiSUodsk7 J7SZKyw9oH1003MQNhdBq7qCw482PUycuJ25OtjIf2+0L0sxo1691k5xOBVTu+9ImQFme+ 3/ACCg0LQIHWUkdZV6m8ADvxfhsw4ww+BJ/EhE8ZH5NA1cpV1XbtkvGAXnO3R9NH7htK+c sNEaKBeUZAnL2rusaIsvxw9cO5SXoB4YymHb2el3Sywcpra9Ag3XTDRKsMzZOmkvGK8xOU 4d/NODVGe3ZeJ3aTxxDZZXBF8aG/HVleJwn4b9nZIxKO/xuNlg2OL3218KQXeA== 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=1715719135; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e0wzStyXwbjBq28h9tn1XiaahEBnGHOoLGGfmoRgII0=; b=r0DIyyodZ+gUnXDezTdED6UoPN/5Y5/p6FD8ZkR8TPCZWYgdnnt4J0BGAjmYSYsx1i4YWL vsZyCHKMBTSg1K0cfZEK+p5wHOkWUPJu28id+gqkBSrrcDVEC9gBlyv8rcSV/j2jVInWcm PRlORLgwIzc8QTgc0KM2tLwa20foNxz1MoYzu6Pg9waTV2dHnLj6yJ3e9JXJT4Z6mKpZzA 11lBLNVUm5np9/CdmY1RUjAUzIpLxJWT+zoE6nKwbg1xpfccLNZPgFcV2E2hX09ujYZOoN Gc+m5nwiX7oLuOwhnwWlMk7nE2wsgYNlrIn2uOtrNCPIn+SREboTA7V5hHxbtQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vf7Vk66G5zmCm; Tue, 14 May 2024 20:38: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 44EKcs7C092382; Tue, 14 May 2024 20:38:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EKcsYS092379; Tue, 14 May 2024 20:38:54 GMT (envelope-from git) Date: Tue, 14 May 2024 20:38:54 GMT Message-Id: <202405142038.44EKcsYS092379@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: e474704b9c49 - stable/14 - fib_dxr: move the bulko of malloc() failure logging into dxr_build() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e474704b9c49dda12e2afff2ae05f972207e21d7 Auto-Submitted: auto-generated The branch stable/14 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=e474704b9c49dda12e2afff2ae05f972207e21d7 commit e474704b9c49dda12e2afff2ae05f972207e21d7 Author: Marko Zec AuthorDate: 2024-05-07 15:11:30 +0000 Commit: Marko Zec CommitDate: 2024-05-14 20:32:05 +0000 fib_dxr: move the bulko of malloc() failure logging into dxr_build() --- sys/netinet/in_fib_dxr.c | 77 +++++++++++++++++++----------------------------- 1 file changed, 30 insertions(+), 47 deletions(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index 3015564953c6..3b2dc837d50b 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -497,8 +497,11 @@ chunk_ref(struct dxr_aux *da, uint32_t chunk) da->range_tbl = realloc(da->range_tbl, sizeof(*da->range_tbl) * da->rtbl_size + FRAGS_PREF_SHORT, M_DXRAUX, M_NOWAIT); - if (da->range_tbl == NULL) + if (da->range_tbl == NULL) { + FIB_PRINTF(LOG_NOTICE, da->fd, + "Unable to allocate DXR range table"); return (1); + } } return (0); @@ -632,8 +635,11 @@ trie_ref(struct dxr_aux *da, uint32_t index) da->xtbl_size += XTBL_SIZE_INCR; da->x_tbl = realloc(da->x_tbl, sizeof(*da->x_tbl) * da->xtbl_size, M_DXRAUX, M_NOWAIT); - if (da->x_tbl == NULL) + if (da->x_tbl == NULL) { + FIB_PRINTF(LOG_NOTICE, da->fd, + "Unable to allocate DXR extension table"); return (-1); + } } return(tp->td_index); } @@ -873,8 +879,11 @@ dxr_build(struct dxr *dxr) if (da == NULL) { da = malloc(sizeof(*dxr->aux), M_DXRAUX, M_NOWAIT); - if (da == NULL) + if (da == NULL) { + FIB_PRINTF(LOG_NOTICE, dxr->fd, + "Unable to allocate DXR aux struct"); return; + } dxr->aux = da; da->fibnum = dxr->fibnum; da->refcnt = 1; @@ -894,16 +903,22 @@ dxr_build(struct dxr *dxr) if (da->range_tbl == NULL) { da->range_tbl = malloc(sizeof(*da->range_tbl) * da->rtbl_size + FRAGS_PREF_SHORT, M_DXRAUX, M_NOWAIT); - if (da->range_tbl == NULL) + if (da->range_tbl == NULL) { + FIB_PRINTF(LOG_NOTICE, da->fd, + "Unable to allocate DXR range table"); return; + } range_rebuild = 1; } #ifdef DXR2 if (da->x_tbl == NULL) { da->x_tbl = malloc(sizeof(*da->x_tbl) * da->xtbl_size, M_DXRAUX, M_NOWAIT); - if (da->x_tbl == NULL) + if (da->x_tbl == NULL) { + FIB_PRINTF(LOG_NOTICE, da->fd, + "Unable to allocate DXR extension table"); return; + } trie_rebuild = 1; } #endif @@ -1039,8 +1054,11 @@ dxr2_try_squeeze: #endif dxr->d = malloc(dxr_tot_size, M_DXRLPM, M_NOWAIT); - if (dxr->d == NULL) + if (dxr->d == NULL) { + FIB_PRINTF(LOG_NOTICE, da->fd, + "Unable to allocate DXR lookup table"); return; + } #ifdef DXR2 memcpy(dxr->d, da->d_tbl, d_size); dxr->x = ((char *) dxr->d) + d_size; @@ -1119,7 +1137,8 @@ dxr_init(uint32_t fibnum, struct fib_data *fd, void *old_data, void **data) dxr = malloc(sizeof(*dxr), M_DXRAUX, M_NOWAIT); if (dxr == NULL) { - FIB_PRINTF(LOG_NOTICE, fd, "Unable to allocate DXR struct"); + FIB_PRINTF(LOG_NOTICE, fd, + "Unable to allocate DXR container struct"); return (FLM_REBUILD); } @@ -1212,41 +1231,11 @@ dxr_dump_end(void *data, struct fib_dp *dp) dxr_build(dxr); da = dxr->aux; - if (da == NULL) { - /* malloc(, M_DXRAUX, M_NOWAIT) failed, retry later */ - FIB_PRINTF(LOG_NOTICE, dxr->fd, - "Unable to allocate DXR aux struct"); + if (da == NULL || dxr->d == NULL) return (FLM_REBUILD); - } - if (da->range_tbl == NULL) { - /* malloc(, M_DXRAUX, M_NOWAIT) failed, retry later */ - FIB_PRINTF(LOG_NOTICE, dxr->fd, - "Unable to allocate DXR range table"); - return (FLM_REBUILD); - } - -#ifdef DXR2 - if (da->x_tbl == NULL) { - /* malloc(, M_DXRAUX, M_NOWAIT) failed, retry later */ - FIB_PRINTF(LOG_NOTICE, dxr->fd, - "Unable to allocate DXR extension table"); - return (FLM_REBUILD); - } -#endif - - if (da->rtbl_top >= BASE_MAX) { - /* Structural limit exceeded, hard error */ - FIB_PRINTF(LOG_ERR, dxr->fd, "DXR structural limit exceeded"); + if (da->rtbl_top >= BASE_MAX) return (FLM_ERROR); - } - - if (dxr->d == NULL) { - /* malloc(, M_DXRLPM, M_NOWAIT) failed, retry later */ - FIB_PRINTF(LOG_NOTICE, dxr->fd, - "Unable to allocate DXR lookup table"); - return (FLM_REBUILD); - } dp->f = choose_lookup_fn(da); dp->arg = dxr; @@ -1334,18 +1323,11 @@ dxr_change_rib_batch(struct rib_head *rnh, struct fib_change_queue *q, dxr_build(new_dxr); /* Structural limit exceeded, hard error */ - if (da->rtbl_top >= BASE_MAX) { - /* Structural limit exceeded, hard error */ - dxr_destroy(new_dxr); - FIB_PRINTF(LOG_ERR, dxr->fd, "DXR structural limit exceeded"); + if (da->rtbl_top >= BASE_MAX) return (FLM_ERROR); - } if (new_dxr->d == NULL) { - /* malloc(, M_DXRLPM, M_NOWAIT) failed, retry later */ dxr_destroy(new_dxr); - FIB_PRINTF(LOG_NOTICE, dxr->fd, - "Unable to allocate DXR lookup table"); return (FLM_REBUILD); } @@ -1357,6 +1339,7 @@ dxr_change_rib_batch(struct rib_head *rnh, struct fib_change_queue *q, return (FLM_SUCCESS); } + FIB_PRINTF(LOG_NOTICE, dxr->fd, "fib_set_datapath_ptr() failed"); dxr_destroy(new_dxr); return (FLM_REBUILD); } From nobody Tue May 14 20:38:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vf7Vn3rpJz5L03f; Tue, 14 May 2024 20:38: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 4Vf7Vn1PsLz4JVJ; Tue, 14 May 2024 20:38:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715719137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HQxBWmDRRGSG92ND5PHR5e96k/nXorgQkO8AvcclAkw=; b=ikzG+VYOLh5FTE48B4SipYGlHR9BhConUURsRl2YN7X/6NTcViyUKfHeL4X2vGF4Hrqouw +mGvFD0Mk3ZPaoJR/dJqgsjh3UFvtn1iiTxBS2QFN5qG1G13pQyvKIYQi4qB04ixsl4VDs MQ81aYYsvmuQDwccgYD5JTwV5ZoWHaVhmcNwp3W9PUz2mOCA+aLPTr5RM/sSFiyCW6PZoF jm1BqK3OGNkfyxdehW9gEArJCg/oGPULjBiP0MwtCaqwaRehE6Lcq+JTaTKmjVtihsqgmt aCfh8dx/i7g2KobwP36iDJpOB/x7NJ/BsZSgWUkYFt2LUlzocLGpkGdX4zbkiA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715719137; a=rsa-sha256; cv=none; b=esWDUcVqFh6t9+Ba3ZJ+tNbvkskQuGEgWlDfNl3OWH3Dta/8aakmih8an8HTcx65GuF6Zu nZMIniDR3kVos6Smx92HenTgyJ1AkeThVjKeuSBvqpGzqNBbwTx1sDjE/NeZochrt+OAFr z3j50I5MOhQKayYLvwWk0+zJduNp0PHXMX+bdV7dlAL5qD2kXTvjQFzebATzYowC3kUBZj WJQaNASgIWIgRAD+f2UYMcX92c6dzXQUgNyuJ9d5R2fsblKo0DphNIpXUgNvtEgqu3mr1v iSjY0phnhVa+076kd3Ff5NzwwNLa0zR+dirfaGbuCq/GnNOgrZAEKkFtXJqtEQ== 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=1715719137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HQxBWmDRRGSG92ND5PHR5e96k/nXorgQkO8AvcclAkw=; b=A3beIFIbn8f5SYA/7Wbd7BospTcCHpky5rwHhsHVZ1k9se30nU1Bbay/+YZzp5uNPMXfFo ZVwZFnluW2xQ8FOehp+DDmNfpfGiqFryYmokMuQUyoDzOJFVXXRg1TEc0LQIzuV5Ly+Uo4 Tp6B2xDaHYfCsrk0lhT2Ls91upwMo6YbOc3gBDnf9m9c7THDj1GySAaOEJm0b3JDcvQMlK PYe4ua5SgNUIiRWqgQo1LcWMWgKVIUOTe0NjHUezMMqKlkIN95YqTA1vXSArfAY0ysp7fG y+db/05HyhaUIXjbzkMFVNVFMHnKSUOWx72v7jqkPQ/4hMYcXPig89QoYzzWug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vf7Vn10rpzmQ6; Tue, 14 May 2024 20:38: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 44EKcvPl092472; Tue, 14 May 2024 20:38:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EKcvQG092469; Tue, 14 May 2024 20:38:57 GMT (envelope-from git) Date: Tue, 14 May 2024 20:38:57 GMT Message-Id: <202405142038.44EKcvQG092469@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: 1261fc325c3c - stable/14 - fib_dxr: s/KASSERT/MPASS/ List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1261fc325c3cb96eeaddf3ed5a6b1c7c6a08d064 Auto-Submitted: auto-generated The branch stable/14 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=1261fc325c3cb96eeaddf3ed5a6b1c7c6a08d064 commit 1261fc325c3cb96eeaddf3ed5a6b1c7c6a08d064 Author: Marko Zec AuthorDate: 2024-05-07 15:33:23 +0000 Commit: Marko Zec CommitDate: 2024-05-14 20:32:29 +0000 fib_dxr: s/KASSERT/MPASS/ MFC after: 1 week --- sys/netinet/in_fib_dxr.c | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index 5c5311068169..91f3bafdb47d 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -474,8 +474,7 @@ chunk_ref(struct dxr_aux *da, uint32_t chunk) cdp->cd_max_size = size; cdp->cd_base = fdesc->base; LIST_INSERT_HEAD(&da->all_chunks, cdp, cd_all_le); - KASSERT(cdp->cd_base + cdp->cd_max_size == da->rtbl_top, - ("dxr: %s %d", __FUNCTION__, __LINE__)); + MPASS(cdp->cd_base + cdp->cd_max_size == da->rtbl_top); } cdp->cd_hash = hash; @@ -525,7 +524,7 @@ chunk_unref(struct dxr_aux *da, uint32_t chunk) sizeof(struct range_entry_long) * size) == 0) break; - KASSERT(cdp != NULL, ("dxr: dangling chunk")); + MPASS(cdp != NULL); if (--cdp->cd_refcnt > 0) return; @@ -536,8 +535,7 @@ chunk_unref(struct dxr_aux *da, uint32_t chunk) /* Attempt to merge with the preceding chunk, if empty */ cdp2 = LIST_NEXT(cdp, cd_all_le); if (cdp2 != NULL && cdp2->cd_cur_size == 0) { - KASSERT(cdp2->cd_base + cdp2->cd_max_size == cdp->cd_base, - ("dxr: %s %d", __FUNCTION__, __LINE__)); + MPASS(cdp2->cd_base + cdp2->cd_max_size == cdp->cd_base); LIST_REMOVE(cdp, cd_all_le); LIST_REMOVE(cdp2, cd_hash_le); cdp2->cd_max_size += cdp->cd_max_size; @@ -548,8 +546,7 @@ chunk_unref(struct dxr_aux *da, uint32_t chunk) /* Attempt to merge with the subsequent chunk, if empty */ cdp2 = LIST_PREV(cdp, &da->all_chunks, chunk_desc, cd_all_le); if (cdp2 != NULL && cdp2->cd_cur_size == 0) { - KASSERT(cdp->cd_base + cdp->cd_max_size == cdp2->cd_base, - ("dxr: %s %d", __FUNCTION__, __LINE__)); + MPASS(cdp->cd_base + cdp->cd_max_size == cdp2->cd_base); LIST_REMOVE(cdp, cd_all_le); LIST_REMOVE(cdp2, cd_hash_le); cdp2->cd_max_size += cdp->cd_max_size; @@ -560,8 +557,7 @@ chunk_unref(struct dxr_aux *da, uint32_t chunk) if (cdp->cd_base + cdp->cd_max_size == da->rtbl_top) { /* Free the chunk on the top of the range heap, trim the heap */ - KASSERT(cdp == LIST_FIRST(&da->all_chunks), - ("dxr: %s %d", __FUNCTION__, __LINE__)); + MPASS(cdp == LIST_FIRST(&da->all_chunks)); da->rtbl_top -= cdp->cd_max_size; da->unused_chunks_size -= cdp->cd_max_size; LIST_REMOVE(cdp, cd_all_le); @@ -875,7 +871,7 @@ dxr_build(struct dxr *dxr) uint32_t trie_frag; #endif - KASSERT(dxr->d == NULL, ("dxr: d not free")); + MPASS(dxr->d == NULL); if (da == NULL) { da = malloc(sizeof(*dxr->aux), M_DXRAUX, M_NOWAIT); @@ -1273,16 +1269,14 @@ dxr_change_rib_batch(struct rib_head *rnh, struct fib_change_queue *q, int update_delta = 0; #endif - KASSERT(data != NULL, ("%s: NULL data", __FUNCTION__)); - KASSERT(q != NULL, ("%s: NULL q", __FUNCTION__)); - KASSERT(q->count < q->size, ("%s: q->count %d q->size %d", - __FUNCTION__, q->count, q->size)); + MPASS(data != NULL); + MPASS(q != NULL); + MPASS(q->count < q->size); da = dxr->aux; - KASSERT(da != NULL, ("%s: NULL dxr->aux", __FUNCTION__)); - KASSERT(da->fd != NULL, ("%s: da->fd %p", __FUNCTION__, da->fd)); - KASSERT(da->refcnt > 0, ("%s: da->refcnt %d", __FUNCTION__, - da->refcnt)); + MPASS(da != NULL); + MPASS(da->fd != NULL); + MPASS(da->refcnt > 0); FIB_PRINTF(LOG_INFO, da->fd, "processing %d update(s)", q->count); for (ui = 0; ui < q->count; ui++) { @@ -1315,8 +1309,7 @@ dxr_change_rib_batch(struct rib_head *rnh, struct fib_change_queue *q, #ifdef INVARIANTS fib_get_rtable_info(fib_get_rh(da->fd), &rinfo); - KASSERT(da->prefixes + update_delta == rinfo.num_prefixes, - ("%s: update count mismatch", __FUNCTION__)); + MPASS(da->prefixes + update_delta == rinfo.num_prefixes); #endif res = dxr_init(0, dxr->fd, data, (void **) &new_dxr); From nobody Tue May 14 20:38:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vf7Vn03Cfz5L03Y; Tue, 14 May 2024 20:38: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 4Vf7Vm0SDmz4Jnn; Tue, 14 May 2024 20:38:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715719136; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Qg0Z9lheMK9xmmSZBIc6rdQUDMkjL+qErjGzuaW1s8=; b=iterge3XLQrxyuceJa3vC4lbrU8yR3rG+pVyosCah45n7YhATsCQdLMfZIezFgzbzetnkG WWmMhH32IY3uTQjK43QjinDjHLWteUH7XkXRfHxg2htZ136yJ0qTvSfNR7mDWO7vRjhstU IzcsI1Ahv3XtEJD6k3PI8Lsf2SEkdnO5nQowzxSbyUhd9Jaopdyoikrf5uZ9iWIRj8dSjN GSGfX94M0KLGaZQRCo04Cy2I1AR9i1XUWVcrK1F7VossCuJqVqmHVwUTS6vuC7q1+RAk0w mCKckrqRX/lmdCWZ7Fgt+VSDSkoBW2jooez3dlksPluQnYxNXg0SJpHIXQKv1w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715719136; a=rsa-sha256; cv=none; b=ZSkig2t8WBekNOBiSgU8lC52Tu4mqGgLBczXVFYBVqpZbysEymBIZcODD5v2zTiQ3tBZNO pwG5wiGdXftF0s43zQnHLyJ5dDbKPXs85tPck4FctfITkAYnNY7gj8RDEVdcXRfDLXSwnu 2sQXeBiBEs8sFdwlpU1m5zg+vuhQkHU6Yd6jcd0+u/3CtDjW3ALB6wmPMOwpriIRr+FtME 4zEaItJr8mFthDWIgymL3M4Kl+nFVLX8AfRvKN3uJ7eVwhgUFstPATf66iScCL6PypLYSC gIAukA1MRKOjLID8EiY2GLmPBlBRq6NLWQWnS7BmK/DJDuCATg3yGjQsnJkX7A== 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=1715719136; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Qg0Z9lheMK9xmmSZBIc6rdQUDMkjL+qErjGzuaW1s8=; b=YJcQ29wO4cRfh8tP9WrROLpArsD/xV+E+x/NNveNwaNZN9fs5ihglO7sRbdNNnlIlY2F/H TsBQDo/P0a0dWtn3Ccbgr5I6Jtr+xcqsa9SrfT8GoC53PpkE4LiJcnt3misOL/tfiyZ2Zn DmVKB3NZCmK53fX0Hag/6MAk4nTPYbatGFXDi+fi7s3fYx5BBDmc170GEjYmZ4d0ROPSjI FcxnGei5m6uVbSz+0uQ77dSEahpoRIP+sO20ecN6P0XghH/X1rnTFdMdRuyuzCRwLf8huL x/rxduLgK9eAugGHr4GFr6M5FsgnbeLnqu4oZy8NXg3HFI+gDRbAxRpyF4YPeg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vf7Vm01qZzmZy; Tue, 14 May 2024 20:38: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 44EKctdM092439; Tue, 14 May 2024 20:38:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EKctua092436; Tue, 14 May 2024 20:38:55 GMT (envelope-from git) Date: Tue, 14 May 2024 20:38:55 GMT Message-Id: <202405142038.44EKctua092436@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: 52075e4cfabc - stable/14 - fib_dxr: KASSERTs for chasing NULL ptr and runaway refcount suspects List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 52075e4cfabc30d08605ec296b2b374d61e2e2bb Auto-Submitted: auto-generated The branch stable/14 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=52075e4cfabc30d08605ec296b2b374d61e2e2bb commit 52075e4cfabc30d08605ec296b2b374d61e2e2bb Author: Marko Zec AuthorDate: 2024-05-07 15:22:00 +0000 Commit: Marko Zec CommitDate: 2024-05-14 20:32:17 +0000 fib_dxr: KASSERTs for chasing NULL ptr and runaway refcount suspects MFC after: 1 week --- sys/netinet/in_fib_dxr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index 3b2dc837d50b..5c5311068169 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -1280,6 +1280,9 @@ dxr_change_rib_batch(struct rib_head *rnh, struct fib_change_queue *q, da = dxr->aux; KASSERT(da != NULL, ("%s: NULL dxr->aux", __FUNCTION__)); + KASSERT(da->fd != NULL, ("%s: da->fd %p", __FUNCTION__, da->fd)); + KASSERT(da->refcnt > 0, ("%s: da->refcnt %d", __FUNCTION__, + da->refcnt)); FIB_PRINTF(LOG_INFO, da->fd, "processing %d update(s)", q->count); for (ui = 0; ui < q->count; ui++) { From nobody Tue May 14 20:38:58 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vf7Vp5GCDz5Kyw3; Tue, 14 May 2024 20:38: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 4Vf7Vp2V2Fz4JrR; Tue, 14 May 2024 20:38:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715719138; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=srNxVVUtikiiVBJrneDOPu/cgIMrFk0AZnFaKds+qcc=; b=tPkSI0sLedwSRV6FmCe5dcQctRZ2i3MPoX/Eh3liNLoLLhOREscGI1VWGeNs/zH7uSyayL Hj3OLL8aED3mD2vq/PW4tM8ePOOIX7lsv8YIFeT+E54ZgnrE9xeA9CCaM6b6mtV8ATPKLK hWY+BUneHUYfh7jCL8a44XVfptNqUW82lZdLJbAs4teVSx4rR+0qnoNpNX3qL3nVj4BSV+ LxT5zVw5zY3QEPsYpel365tVlPk8yKdnnZW2BqSc877v8XXJ7qNGG7eJZWHRg1lXJ0J3Eh NPUJ6WYhOsG3+krcAFqB4v3tgdCCWgP7joR3d1z1/vETJPX5p1jY/E8xE+Gepg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715719138; a=rsa-sha256; cv=none; b=qiyxNUS8fuVsiYdKjSMJWq5x6xD1YAMwk6iZGDD8qRTksGdEg7UNvzN7WYMFmVNvIbpyhT OyXHltWza4JwVVj5XJ8PzfAoxQzFSM621G8pjTTkAzO93irtUGucm4w5ZyqtAUBkW8Dd0n tD1sinjgOuq5vxOLMy8nPrlmjtNIpsKTYe+HcYIIf/G4FudqrELdOHnvgEoCG7pvZFF169 FzJdhNmJbivrJpkilxRXSwo/CTbhPq9xuiizBA+KSDd9PFCpP+1WRYtFp5uW3vmxX6DHvU /mpca7TRza9GoM+Z1Sg9IsRznobHGIJqMGtStX5WbwHHEfoMsEdRMEnmm7WKvQ== 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=1715719138; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=srNxVVUtikiiVBJrneDOPu/cgIMrFk0AZnFaKds+qcc=; b=tmLLdHkueuihNj+4LAuGdbH7FPJYggplIV9Nd6VfSLDUYlpq0I9dRAT8uGhaisYZfq0Tc3 knKvQ1qbqwgd0Ya4hMEwVIy4tmWrlNz8ykhlg9HXRdFtE/zWtMDsp8nwUOjR9EoTjM1QuQ GVaMvACEAlxzZXLH54lXKKft2uFzmELoTkTOdFDqtySQutL+ortps5f1s4KNbg70ZmRElc WT+aPenRoPJHkOrroVcofnGuyhBdiZ4RwxzqeZ6QlrJ55H/ZKCtbR0gBbQ+ET4SSJZoYVs QcQ6nNPJpvmOX4WBD0ivadyr+0VSuT+GRBdR+5Iviz+WAgClQvVDx4KQZGwDUw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vf7Vp26G7zmZS; Tue, 14 May 2024 20:38: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 44EKcwb6092526; Tue, 14 May 2024 20:38:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EKcwkQ092523; Tue, 14 May 2024 20:38:58 GMT (envelope-from git) Date: Tue, 14 May 2024 20:38:58 GMT Message-Id: <202405142038.44EKcwkQ092523@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: 0418d7a09037 - stable/14 - fib_dxr: set fib_data field in struct dxr_aux early enough List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0418d7a0903725ade71ae77c4ff900010a93a185 Auto-Submitted: auto-generated The branch stable/14 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=0418d7a0903725ade71ae77c4ff900010a93a185 commit 0418d7a0903725ade71ae77c4ff900010a93a185 Author: Marko Zec AuthorDate: 2024-05-07 15:44:09 +0000 Commit: Marko Zec CommitDate: 2024-05-14 20:32:41 +0000 fib_dxr: set fib_data field in struct dxr_aux early enough Previously it was possible for dxr_build() to return with da->fd unset in case of range_tbl or x_tbl malloc() failures. This may have led to NULL ptr dereferencing in dxr_change_rib_batch(). MFC after: 1 week PR: 278422 --- sys/netinet/in_fib_dxr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index 91f3bafdb47d..82245ecf6e66 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -882,6 +882,7 @@ dxr_build(struct dxr *dxr) } dxr->aux = da; da->fibnum = dxr->fibnum; + da->fd = dxr->fd; da->refcnt = 1; LIST_INIT(&da->all_chunks); LIST_INIT(&da->all_trie); @@ -918,7 +919,6 @@ dxr_build(struct dxr *dxr) trie_rebuild = 1; } #endif - da->fd = dxr->fd; microuptime(&t0); From nobody Tue May 14 20:39:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vf7WM1rfSz5L05K; Tue, 14 May 2024 20:39: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 4Vf7WL6rBSz4Ksm; Tue, 14 May 2024 20:39:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715719167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q4xc841hT3BVjKGDra33JVVm287NwbnaQPWxFEXPE6w=; b=nggHT5Rhn5UIbnAmOdkkwZD7L9pFlvSxsgHS4jS2FfiLduWWKHInr7Y7oQvpkjf3w8n9sM H1w/vaNgrQmqaVJaxfYoNbR1AkS5P51cA/mCUbGaFbRMU7AcgRxZZxQHEYfMhoukKiSBtI tf5EhPNGiOG/jVC8OWBv993g9M8jO2cFwr8J6Aazo9IbXmefh9YNq5wUc9NYdZ43Ilodog 7i4l4nIWAtVFhf/6SjiyGixxfx49+hWfOAjuRSxtNInzCZHA+9TKkRI07F/GVVnjTLVxlY F7kyGJMsY5VbpE7wtQ46Qai+AHOynIBref794Rf9IAZlVWbXQ9X9+k84rP79PQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715719167; a=rsa-sha256; cv=none; b=vhTQcqLmEmjizdsDPBoH8ksRR1/WKuivkSPPDMh0enWrT0yUPEhwXA4GqLbuv52nPDq5fR GA5PEt3mCAjpQInImRsTD+4x2DOVxkHKJ1TKppjGfKsadgqwXEPOLfYJuBFgfINNDKvmF2 3dx6ctSN2zLgZR2zpTCT90gAzgYeENZ4DEyUl9XXWJb2K9vQOJwtLMT7TviALPa6YMYyca pdmMqnzaLkr3rqEH9L2ML/uM+RDKSaG713pY7byxTlTkeoxCQk0LhIzfw77syIWnt3GnNX PvFjIXYCNkzaryL+Uf5++meJYio4X6PrvK+wK2ksnA/cfiTCSboPJ5JlRn6+hQ== 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=1715719167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q4xc841hT3BVjKGDra33JVVm287NwbnaQPWxFEXPE6w=; b=UeYB1JBRXgvYAuVMYqorj9zDnz6iwDnPFes/Ota5EaWiLbkMiP1XsVeRR9Fz6F3GAeiT2X W8HZxvNtN4BDaDYpe2Bwp+AOTOmZPdYXwCbph9nGPlEZ4ep3zYboHcQYdSg7v80Vy6XXfU qmIrpw/4VDDDRe/YreR8K+gBaiAFkTIuTqEWoYDQ7XuAaTCSP7oBhQ/OuopccxQLwmRVAr XSUU6go/r+BQH6Zgp8QGXi/BRmgmjYkzzjuqAI9JehAeXihOQTEATnD0n0idcL6u3x4lFg AtNcXSZ51FLKzwAnVkWi1achDxFg2YZj6lDjNQZv7HQxdW+jK1GqYVAZ5TYP/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 4Vf7WL6QkrzmCp; Tue, 14 May 2024 20:39: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 44EKdQoT092785; Tue, 14 May 2024 20:39:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EKdQgX092782; Tue, 14 May 2024 20:39:26 GMT (envelope-from git) Date: Tue, 14 May 2024 20:39:26 GMT Message-Id: <202405142039.44EKdQgX092782@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: 416679ecabd6 - stable/13 - fib_dxr: log malloc() failures. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 416679ecabd6c73ee5cd700367347133ae15f37c Auto-Submitted: auto-generated The branch stable/13 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=416679ecabd6c73ee5cd700367347133ae15f37c commit 416679ecabd6c73ee5cd700367347133ae15f37c Author: Marko Zec AuthorDate: 2024-05-06 18:21:55 +0000 Commit: Marko Zec CommitDate: 2024-05-14 20:35:09 +0000 fib_dxr: log malloc() failures. MFC after: 1 week --- sys/netinet/in_fib_dxr.c | 45 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index e7eede53ea51..db4f4a537e22 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -1118,8 +1118,10 @@ dxr_init(uint32_t fibnum, struct fib_data *fd, void *old_data, void **data) struct dxr *dxr; dxr = malloc(sizeof(*dxr), M_DXRAUX, M_NOWAIT); - if (dxr == NULL) + if (dxr == NULL) { + FIB_PRINTF(LOG_NOTICE, fd, "Unable to allocate DXR struct"); return (FLM_REBUILD); + } /* Check whether we may reuse the old auxiliary structures */ if (old_dxr != NULL && old_dxr->aux != NULL) { @@ -1213,16 +1215,41 @@ dxr_dump_end(void *data, struct fib_dp *dp) dxr_build(dxr); da = dxr->aux; - if (da == NULL) + if (da == NULL) { + /* malloc(, M_DXRAUX, M_NOWAIT) failed, retry later */ + FIB_PRINTF(LOG_NOTICE, dxr->fd, + "Unable to allocate DXR aux struct"); return (FLM_REBUILD); + } - /* Structural limit exceeded, hard error */ - if (da->rtbl_top >= BASE_MAX) + if (da->range_tbl == NULL) { + /* malloc(, M_DXRAUX, M_NOWAIT) failed, retry later */ + FIB_PRINTF(LOG_NOTICE, dxr->fd, + "Unable to allocate DXR range table"); + return (FLM_REBUILD); + } + +#ifdef DXR2 + if (da->x_tbl == NULL) { + /* malloc(, M_DXRAUX, M_NOWAIT) failed, retry later */ + FIB_PRINTF(LOG_NOTICE, dxr->fd, + "Unable to allocate DXR extension table"); + return (FLM_REBUILD); + } +#endif + + if (da->rtbl_top >= BASE_MAX) { + /* Structural limit exceeded, hard error */ + FIB_PRINTF(LOG_ERR, dxr->fd, "DXR structural limit exceeded"); return (FLM_ERROR); + } - /* A malloc(,, M_NOWAIT) failed somewhere, retry later */ - if (dxr->d == NULL) + if (dxr->d == NULL) { + /* malloc(, M_DXRLPM, M_NOWAIT) failed, retry later */ + FIB_PRINTF(LOG_NOTICE, dxr->fd, + "Unable to allocate DXR lookup table"); return (FLM_REBUILD); + } dp->f = choose_lookup_fn(da); dp->arg = dxr; @@ -1311,13 +1338,17 @@ dxr_change_rib_batch(struct rib_head *rnh, struct fib_change_queue *q, /* Structural limit exceeded, hard error */ if (da->rtbl_top >= BASE_MAX) { + /* Structural limit exceeded, hard error */ dxr_destroy(new_dxr); + FIB_PRINTF(LOG_ERR, dxr->fd, "DXR structural limit exceeded"); return (FLM_ERROR); } - /* A malloc(,, M_NOWAIT) failed somewhere, retry later */ if (new_dxr->d == NULL) { + /* malloc(, M_DXRLPM, M_NOWAIT) failed, retry later */ dxr_destroy(new_dxr); + FIB_PRINTF(LOG_NOTICE, dxr->fd, + "Unable to allocate DXR lookup table"); return (FLM_REBUILD); } From nobody Tue May 14 20:39:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vf7WN2BlPz5L092; Tue, 14 May 2024 20:39: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 4Vf7WN0Hn7z4KwN; Tue, 14 May 2024 20:39:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715719168; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Uhv+rgRjY6QkAfqeLnd/6hixpswIU0z6W9DaEfKOZ0E=; b=bjLNMfk3ecs4CH+Oh2h+xQJZQ7YNA/I9LuAmO5X6tlx9Oisb7+IwhH2km1NTwo5ckooUWb vLHEqjS5xNh1zECQfPkYEpvklTXv+oV51gj+Zjww1m7yEFHtKJQaZ0dvKGP30b3PZCwRD0 aEjl07A3yRRq0ba/BzJJ6m4IN07CjSzHcm0DV1VJsptjgR2khtD1pjBLw9LkuwnAbesszA 2QQWsvoOgh13nIHb9ypbXDmESUPBNAUA24p8ZeB7xJ7/iS17/+ifQ7x6YJNIIW/n56R04c kotYujDy2RatISyxC0DlF6z9wp4X21TjdRQyDuYNZ5CMWhJOe8opN9EtbXQg4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715719168; a=rsa-sha256; cv=none; b=e5tTMV0TsxkPrtFKrM/fuWUuymH2TPQry9wWUeLtU9EbW7kp7Hv0S4rRAQ23dxD8LGzRb3 r5WrpIy1mheCze2Juod47QURf30gjPU4LzFIxs6wTIi7a0sK0LkrCXazgfasYLo3wgQjCr TcULIK0phr4MaSI4WCK+tYYSkVjVMFshx1Kk5uXQ5iLNmnRLbg07uZkOgguIi8up9M1Ly5 dtZp/0dY77Cqzt7xMGi+79cfw8D5KnzhkN6x6zDr21G3xba/+hkAAvPf/+AmXCbKKjU70g 5KFbKLk+DX9PUhq65OVfyWELaz9nch/J50DMNxLBHpGsestJ0VrrmfCVpcs9GQ== 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=1715719168; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Uhv+rgRjY6QkAfqeLnd/6hixpswIU0z6W9DaEfKOZ0E=; b=SZwAeXtkgLa7yLV9g1wlIavHi9k7fJRaMIA2KF3Dw1cd/v+ykl1IldWcA0KbyHyxTieXza wlWfGsohJgYHf5U64Ho17jDn9+50TE/nnNmgexnn5YRuXIqCHviBe2MS5rnS+rnnasvGd2 cm/CpVEWCNvglnxCjoD3wd9U7esUB2MNVx9BeOUaf1S7hmEcNKaFKaMFoNxGg6Ffso8603 UvqKq9FPT8oTkRgVjfcbUB6tXQnrXFQgh7yEHZ5nJdLcKCwmfRzDielo2SgflYIXaV46LG z0ovaklOVkigOfDdqaSCJm2EeFzXkiHEflSLVjXmkcauqU5SE53PRFa//1kXhw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vf7WM6zHCzmZT; Tue, 14 May 2024 20:39: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 44EKdRV9092851; Tue, 14 May 2024 20:39:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EKdRSn092848; Tue, 14 May 2024 20:39:27 GMT (envelope-from git) Date: Tue, 14 May 2024 20:39:27 GMT Message-Id: <202405142039.44EKdRSn092848@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: f68ecf5d4fbd - stable/13 - fib_dxr: free() does nothing if arg is NULL, so remove a redundant check. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f68ecf5d4fbd69dae868e474ff1f37d38e37c461 Auto-Submitted: auto-generated The branch stable/13 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=f68ecf5d4fbd69dae868e474ff1f37d38e37c461 commit f68ecf5d4fbd69dae868e474ff1f37d38e37c461 Author: Marko Zec AuthorDate: 2024-05-06 18:34:11 +0000 Commit: Marko Zec CommitDate: 2024-05-14 20:35:28 +0000 fib_dxr: free() does nothing if arg is NULL, so remove a redundant check. MFC after: 1 week --- sys/netinet/in_fib_dxr.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index db4f4a537e22..55f79994f552 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -1142,14 +1142,11 @@ static void dxr_destroy(void *data) { struct dxr *dxr = data; - struct dxr_aux *da; + struct dxr_aux *da = dxr->aux; struct chunk_desc *cdp; struct trie_desc *tp; - if (dxr->d != NULL) - free(dxr->d, M_DXRLPM); - - da = dxr->aux; + free(dxr->d, M_DXRLPM); free(dxr, M_DXRAUX); if (da == NULL || atomic_fetchadd_int(&da->refcnt, -1) > 1) From nobody Tue May 14 20:39:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vf7WP3Hjgz5L093; Tue, 14 May 2024 20:39: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 4Vf7WP1HXDz4Knm; Tue, 14 May 2024 20:39:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715719169; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fGm9gmeut9DEvBVQWZKpbtbQK1HeZx7pdAPoLN7Lfug=; b=nUGPGJVDgQGxZ1WejcjdzrKKYqCieUobaSyWsGEFt/2Inacd1aYIxRY7cnQE8QoidQqHWn im3PUVpCRv8ueTkpuedQsEmx04oAXQvX1gvLpVjgcj1BQzCGVq4iIZByc3ONjcmvfQwdVW X9qpal0zDt1KjNhnAU3C9POOfgYOXcjTmbrf9PkngHSjs/++5L+BWt8reJ0gQ40U1TGPK+ k2IW+QtYD6IPE+oNPhulUfkzIxaHh/g1DmUnAB1wgbYSFBr2plu4Fiust4AkRKHUgglWFm G5EI7fvTL0hhewkWQUk62vG35uOy0XQkvthJ10xD1t98x5dI/FFgsh9eysuYjw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715719169; a=rsa-sha256; cv=none; b=sCvumjeOv8NlDt/oe4hrNY8IZvKLykfGGZiOmvhu7CkDoPSA7ZLCQiTR+FxlWfiiJe7gYI cfMKxIW61D9hQntCWbxxVTBzDrU8U+PaTaYiI/Z1I3obeMaF5gV9bsCbK/gFUFgOwc/OlF ysuia86DF2FpIkiM8SpCU62OfTK5E0Ef2kF0sZEKTPtfFS7YDlzrwKCLRfSeMpA86Cndf+ GIxThJ7dYS+3lf65uIEwapuMNLVQTyVRfpsU/FxJJVtP5fOYUh5X/SHDuhjnVDGEqZevnE ZMMIYhKSZtaKsWSy7vo7EcYu+iMGUla/UveF59wQY4495dJUFNsOlaL4VPZtfQ== 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=1715719169; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fGm9gmeut9DEvBVQWZKpbtbQK1HeZx7pdAPoLN7Lfug=; b=NayxFg6jqOiFyFcQxBTQ9q6u2j1wz7eQ9TSvx483EszrdMQSrSF0ukfC2zpcOOQyEqmBRm 40gTULjIOZKRQMJ0voj69U5QeGJ3b9tTqf9r7lPidDCvVQhO8UZ4K8newjl/W5d6YhMm4e oDTd4O12d6zkTzDlx/XPEUc00epfgJEHgumxaLOITY6kHGQ1sKMhBDe2m121BGjUJdrQYR aQ9exSAGS6qj8IxpyQvq4Io75jSTJR500+ETpF7tu4DVCerpihGdspN53oFscCQFASm5cp bgD8z5OKEbljTNaLhdGdfdbY2tSryYdGA8q6NHhOMEvlEhKXUrnjirtbKoC4DA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vf7WP0sqFzmZV; Tue, 14 May 2024 20:39: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 44EKdTVP092894; Tue, 14 May 2024 20:39:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EKdTsU092891; Tue, 14 May 2024 20:39:29 GMT (envelope-from git) Date: Tue, 14 May 2024 20:39:29 GMT Message-Id: <202405142039.44EKdTsU092891@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: 2b9843e268fa - stable/13 - fib_dxr: update comment. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2b9843e268fa2dfcd5a02ff96e504a6a254a5b60 Auto-Submitted: auto-generated The branch stable/13 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=2b9843e268fa2dfcd5a02ff96e504a6a254a5b60 commit 2b9843e268fa2dfcd5a02ff96e504a6a254a5b60 Author: Marko Zec AuthorDate: 2024-05-06 18:42:31 +0000 Commit: Marko Zec CommitDate: 2024-05-14 20:35:38 +0000 fib_dxr: update comment. MFC after: 1 week --- sys/netinet/in_fib_dxr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index 55f79994f552..3015564953c6 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -1098,7 +1098,7 @@ dxr2_try_squeeze: } /* - * Glue functions for attaching to FreeBSD 13 fib_algo infrastructure. + * Glue functions for attaching to the FIB_ALGO infrastructure. */ static struct nhop_object * From nobody Tue May 14 20:39:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vf7WQ5bS3z5L00G; Tue, 14 May 2024 20:39: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 4Vf7WQ2977z4Kp5; Tue, 14 May 2024 20:39:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715719170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jVKVarsgLXx8U65ygv5RTp/+3+lm2q/G4gYAgSG/Ppw=; b=wo3HZehToOzhqtb39YRLdnE4arHlngaBPUmMdh6fN6m9qVpKoRn20LgapDRq3uskh3UD7n +hGaNeU50BLh+5bGfLUUX0NJHaVplir/BJwpI6nbtWKyQUoC5+WaA0CiINMqM72LlY6Rs9 6AW3vxp4AOa/Dc6l3LKXkH4xvBZAaWC3CZ6wqaHO1DCjULkueRcRDy2f0Y8IFwR3L3CCZc La2CUa61+i8mpFD8k8M1pmhwyx+cWyYvTo1OXY3r3WzFczgWRYGBna27Zbm0buqGidO1k/ YxwyYMNY4DzopKeCNmg71wm4HcYOged4zIN15cfN/aYlkuXpHjd3je5CBaBVPg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715719170; a=rsa-sha256; cv=none; b=yhvkDSdEMYLAbpwFgEnJcMrG8PGPxR8Li+GdH0d4MCHBjWteoG5oUunQ4ypNdsdUJO8Z1q O4jcLOzYe/bK2gFdAIR47/wjdwDtLmwdkI31HXIHw4vIWybAOGZr3HhDcoi5CdLPuertKl RSNKaTN6wC/8vwsofhyn5bem4bUwmuCi6Y17nF68j6qzIc4BnvpTVBpzkHlQKfJD7PYCWc OO+34VPEO3WYqQPg4SDoIHd2o356hmk2GaLKtmB6aMiLMqQUOaoQS4JWWYghKu8mHEZb5I nJB1lxIALw/IJ16vvvhdBZppcwi8HRrmBwyUQR+i6qmFuM3xM9GGPymi7hvQmg== 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=1715719170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jVKVarsgLXx8U65ygv5RTp/+3+lm2q/G4gYAgSG/Ppw=; b=bZVRrLBzCNlbVw8Qi/dW+wkINlQU1r98Gl0nGeGYrTrKmeQTts+smETq41H1HWScR8DtwB 9y1ojBukMzhWzFyzSCv7TQbRC8/NelmNIYVwLqHMecPhsk5nKOp3dHPcOg2USYmQ39cqgV vMM1ACX9RVJf8Hyj1ilKWmwo4gJpV5lIKtUrIrKksHF+4qdQGOXhX/qgeVUsSkv3Ax1FpR v1iqVAP4w+qdtAo0oFMsor9nfcHratstWQdN3TuRfmgK0kPKj3axu+pSOC3e8FHMTwWbO1 fHCM2VZ9Bq7syGPJ/7ibGmL6AlKBWyFm9Bb7V8jG69hsX7QxkM6cu1Zl56nbjg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vf7WQ1mwJzmb1; Tue, 14 May 2024 20:39: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 44EKdUwa092955; Tue, 14 May 2024 20:39:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EKdULQ092952; Tue, 14 May 2024 20:39:30 GMT (envelope-from git) Date: Tue, 14 May 2024 20:39:30 GMT Message-Id: <202405142039.44EKdULQ092952@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: 40a1183ac774 - stable/13 - fib_dxr: move the bulko of malloc() failure logging into dxr_build() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 40a1183ac774b3f36a7c5b663dfa5fb835a66fd4 Auto-Submitted: auto-generated The branch stable/13 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=40a1183ac774b3f36a7c5b663dfa5fb835a66fd4 commit 40a1183ac774b3f36a7c5b663dfa5fb835a66fd4 Author: Marko Zec AuthorDate: 2024-05-07 15:11:30 +0000 Commit: Marko Zec CommitDate: 2024-05-14 20:35:48 +0000 fib_dxr: move the bulko of malloc() failure logging into dxr_build() --- sys/netinet/in_fib_dxr.c | 77 +++++++++++++++++++----------------------------- 1 file changed, 30 insertions(+), 47 deletions(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index 3015564953c6..3b2dc837d50b 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -497,8 +497,11 @@ chunk_ref(struct dxr_aux *da, uint32_t chunk) da->range_tbl = realloc(da->range_tbl, sizeof(*da->range_tbl) * da->rtbl_size + FRAGS_PREF_SHORT, M_DXRAUX, M_NOWAIT); - if (da->range_tbl == NULL) + if (da->range_tbl == NULL) { + FIB_PRINTF(LOG_NOTICE, da->fd, + "Unable to allocate DXR range table"); return (1); + } } return (0); @@ -632,8 +635,11 @@ trie_ref(struct dxr_aux *da, uint32_t index) da->xtbl_size += XTBL_SIZE_INCR; da->x_tbl = realloc(da->x_tbl, sizeof(*da->x_tbl) * da->xtbl_size, M_DXRAUX, M_NOWAIT); - if (da->x_tbl == NULL) + if (da->x_tbl == NULL) { + FIB_PRINTF(LOG_NOTICE, da->fd, + "Unable to allocate DXR extension table"); return (-1); + } } return(tp->td_index); } @@ -873,8 +879,11 @@ dxr_build(struct dxr *dxr) if (da == NULL) { da = malloc(sizeof(*dxr->aux), M_DXRAUX, M_NOWAIT); - if (da == NULL) + if (da == NULL) { + FIB_PRINTF(LOG_NOTICE, dxr->fd, + "Unable to allocate DXR aux struct"); return; + } dxr->aux = da; da->fibnum = dxr->fibnum; da->refcnt = 1; @@ -894,16 +903,22 @@ dxr_build(struct dxr *dxr) if (da->range_tbl == NULL) { da->range_tbl = malloc(sizeof(*da->range_tbl) * da->rtbl_size + FRAGS_PREF_SHORT, M_DXRAUX, M_NOWAIT); - if (da->range_tbl == NULL) + if (da->range_tbl == NULL) { + FIB_PRINTF(LOG_NOTICE, da->fd, + "Unable to allocate DXR range table"); return; + } range_rebuild = 1; } #ifdef DXR2 if (da->x_tbl == NULL) { da->x_tbl = malloc(sizeof(*da->x_tbl) * da->xtbl_size, M_DXRAUX, M_NOWAIT); - if (da->x_tbl == NULL) + if (da->x_tbl == NULL) { + FIB_PRINTF(LOG_NOTICE, da->fd, + "Unable to allocate DXR extension table"); return; + } trie_rebuild = 1; } #endif @@ -1039,8 +1054,11 @@ dxr2_try_squeeze: #endif dxr->d = malloc(dxr_tot_size, M_DXRLPM, M_NOWAIT); - if (dxr->d == NULL) + if (dxr->d == NULL) { + FIB_PRINTF(LOG_NOTICE, da->fd, + "Unable to allocate DXR lookup table"); return; + } #ifdef DXR2 memcpy(dxr->d, da->d_tbl, d_size); dxr->x = ((char *) dxr->d) + d_size; @@ -1119,7 +1137,8 @@ dxr_init(uint32_t fibnum, struct fib_data *fd, void *old_data, void **data) dxr = malloc(sizeof(*dxr), M_DXRAUX, M_NOWAIT); if (dxr == NULL) { - FIB_PRINTF(LOG_NOTICE, fd, "Unable to allocate DXR struct"); + FIB_PRINTF(LOG_NOTICE, fd, + "Unable to allocate DXR container struct"); return (FLM_REBUILD); } @@ -1212,41 +1231,11 @@ dxr_dump_end(void *data, struct fib_dp *dp) dxr_build(dxr); da = dxr->aux; - if (da == NULL) { - /* malloc(, M_DXRAUX, M_NOWAIT) failed, retry later */ - FIB_PRINTF(LOG_NOTICE, dxr->fd, - "Unable to allocate DXR aux struct"); + if (da == NULL || dxr->d == NULL) return (FLM_REBUILD); - } - if (da->range_tbl == NULL) { - /* malloc(, M_DXRAUX, M_NOWAIT) failed, retry later */ - FIB_PRINTF(LOG_NOTICE, dxr->fd, - "Unable to allocate DXR range table"); - return (FLM_REBUILD); - } - -#ifdef DXR2 - if (da->x_tbl == NULL) { - /* malloc(, M_DXRAUX, M_NOWAIT) failed, retry later */ - FIB_PRINTF(LOG_NOTICE, dxr->fd, - "Unable to allocate DXR extension table"); - return (FLM_REBUILD); - } -#endif - - if (da->rtbl_top >= BASE_MAX) { - /* Structural limit exceeded, hard error */ - FIB_PRINTF(LOG_ERR, dxr->fd, "DXR structural limit exceeded"); + if (da->rtbl_top >= BASE_MAX) return (FLM_ERROR); - } - - if (dxr->d == NULL) { - /* malloc(, M_DXRLPM, M_NOWAIT) failed, retry later */ - FIB_PRINTF(LOG_NOTICE, dxr->fd, - "Unable to allocate DXR lookup table"); - return (FLM_REBUILD); - } dp->f = choose_lookup_fn(da); dp->arg = dxr; @@ -1334,18 +1323,11 @@ dxr_change_rib_batch(struct rib_head *rnh, struct fib_change_queue *q, dxr_build(new_dxr); /* Structural limit exceeded, hard error */ - if (da->rtbl_top >= BASE_MAX) { - /* Structural limit exceeded, hard error */ - dxr_destroy(new_dxr); - FIB_PRINTF(LOG_ERR, dxr->fd, "DXR structural limit exceeded"); + if (da->rtbl_top >= BASE_MAX) return (FLM_ERROR); - } if (new_dxr->d == NULL) { - /* malloc(, M_DXRLPM, M_NOWAIT) failed, retry later */ dxr_destroy(new_dxr); - FIB_PRINTF(LOG_NOTICE, dxr->fd, - "Unable to allocate DXR lookup table"); return (FLM_REBUILD); } @@ -1357,6 +1339,7 @@ dxr_change_rib_batch(struct rib_head *rnh, struct fib_change_queue *q, return (FLM_SUCCESS); } + FIB_PRINTF(LOG_NOTICE, dxr->fd, "fib_set_datapath_ptr() failed"); dxr_destroy(new_dxr); return (FLM_REBUILD); } From nobody Tue May 14 20:39:31 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vf7WR5CVHz5L05Q; Tue, 14 May 2024 20:39:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vf7WR3LLxz4KpN; Tue, 14 May 2024 20:39:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715719171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3wjFgFmanDIJyTQA64rajcmEOfd1XU1lwE7HYUX377g=; b=SYOVvTa5fXJ1ELwgRdjgw2f67gupoz00QLlS/BtWat8XR2gVXZa773wyq9Z7NeTIJZzH4T HLAJ6i/Q/FWSEpc9Uw4LXMDt8PkYZKwgqDGCKM9ixVJHRRKVeXKwTc+RDsvDTRfqr/hW/i FI9esuromT4YuNvcXgtdrqf/4ZvL62dVjCVkVNEh0r2uYwRV83udclV5GQje/wl2sLxMdr mfDyp5alPMuNfoXqvbWB9T4cOQQbW0atZ8oON1TcVdb8fxipaFnhNSpIdhbc+Ti4ivsHm+ wapP6TQwu2ZFIqHGZJLjUlkUM+ihLoesWeV62eJtsxZlyuMgLewbU8uOADxM3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715719171; a=rsa-sha256; cv=none; b=YyKCOINjannWmlLbg2l5gatmLK0O5I+k7ivpbzLABxp5srHxF8sextQHGk4CaKNfG72jg4 8efIuSJgszuQLD1K1mLLYYiZELBAtZ8Lktm9xla18t/qSlvfeRZ6dNOW/ZLFhyeKL10LiI tKtlkWyX+rtNFsDg9jJSAhnIYvC7FeAzJVkHIQSgPmzctYiV2GMJeU5t6GfSMLdqzZWjGv keAhSjrLQKeuOjMX4FSKKIlyDkUnpFqnFiFlGkgO4Vg52Jjp+wfVWZAriGpDQ6YdnhuReN VjfmJJ1QZBsgb6bMamVaZ6lc4+EjRJuOLaQpEja1KVEPqxFIrPgPSoMCsVqSLA== 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=1715719171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3wjFgFmanDIJyTQA64rajcmEOfd1XU1lwE7HYUX377g=; b=vh6ZhawJc7sCZvv9/yZVkUbS9SrBGcIDhUHknaEj+WR9vmdK/Eo5jq4RHEEphEEbCZoH7/ aYtryhRu4IrgrD3mA7za8iahi+Kp6hg8aWDD7QT0ZQfBDLgCpzxjW763Z9Dyw7pZ0nh5W0 yeS4JgheKvm/sbewOSKcMBuBcZzEGyr6lDpgqqle9j6lOSh3yJOF/N929ZEfcCx3oyXucZ h/cZizm7YKuxeiwlCRKStzNIGt6VdGBGlfHa1178Du70PcTCod/MkTkUBhNLEjf1XpGnTX m89ns9XDq6x4vWgZWBaA6Cqe75cSBdiGMPOifJkZZ1ZluWrfICku9/U+Qcrdkg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vf7WR2rptzm7b; Tue, 14 May 2024 20:39: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 44EKdVcc093012; Tue, 14 May 2024 20:39:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EKdVUt093009; Tue, 14 May 2024 20:39:31 GMT (envelope-from git) Date: Tue, 14 May 2024 20:39:31 GMT Message-Id: <202405142039.44EKdVUt093009@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: 354fa04f5ea1 - stable/13 - fib_dxr: KASSERTs for chasing NULL ptr and runaway refcount suspects List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 354fa04f5ea1dcea904637dd8fb40d7cb8b04525 Auto-Submitted: auto-generated The branch stable/13 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=354fa04f5ea1dcea904637dd8fb40d7cb8b04525 commit 354fa04f5ea1dcea904637dd8fb40d7cb8b04525 Author: Marko Zec AuthorDate: 2024-05-07 15:22:00 +0000 Commit: Marko Zec CommitDate: 2024-05-14 20:35:58 +0000 fib_dxr: KASSERTs for chasing NULL ptr and runaway refcount suspects MFC after: 1 week --- sys/netinet/in_fib_dxr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index 3b2dc837d50b..5c5311068169 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -1280,6 +1280,9 @@ dxr_change_rib_batch(struct rib_head *rnh, struct fib_change_queue *q, da = dxr->aux; KASSERT(da != NULL, ("%s: NULL dxr->aux", __FUNCTION__)); + KASSERT(da->fd != NULL, ("%s: da->fd %p", __FUNCTION__, da->fd)); + KASSERT(da->refcnt > 0, ("%s: da->refcnt %d", __FUNCTION__, + da->refcnt)); FIB_PRINTF(LOG_INFO, da->fd, "processing %d update(s)", q->count); for (ui = 0; ui < q->count; ui++) { From nobody Tue May 14 20:39:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vf7WT0DWgz5L0G8; Tue, 14 May 2024 20:39: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 4Vf7WS41Ygz4Kty; Tue, 14 May 2024 20:39:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715719172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x2oIJHusS14Gt4pZcRUYPPcZvY5oNqQaa5SKqgsK3Tg=; b=MNQDu9Bhvt/Y0HhcJ1vN/yLM2yXIV1V2xtagmB7Am68QnmJCzYUMv7Xiw2vMFzys0dTs6L kC1DJHmqcuswou9l8MhAdhPwjfWu3Hm14aL5GfHC9PNQTo9ln1qdx/zAndKCUlebzGb6/3 WBijQiNMTu2Tbpxj2kwXonYvQ9nXdLyKAYfT8xrLqT5jFoIIzx/K3FydV+Pj8cAFy/cxEh 3o6Ne1H9lNaVBAKx9x6eVp6EGeweY6czdIDk7pm0f6xBCVgdEFMoPHKNMyMsJu+iWUytgg indri3EZU9BCJysxVRwu+oTJkKFIjRPf5NQhNXiRizWhrOspkag0hPEyqu3v/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715719172; a=rsa-sha256; cv=none; b=XTn1c/HmpL01A5+22V5p7DujvRVAszuCdaogzJUXkBgwnezBXpo9BT3vAR0GqM2q7kavFU ScPrxqz93Wibz8x/dkVsThv5n6ud0tkfRaALO0r8HotSMKafT/EOPefGKmUmb4ZGab4QOK OiZvGQXzurbJ9J7ekInBLLsRoUqcbOH93Y6D8dWkcTibFH7HUXEkr/jDH0MGjKxUvFjP8c rZuYNWU15Bagdp/leQLYCdfo34ku8KAsjs5CQE3DuQYj0Xy7GU/Z43B1/0DYYBD6qNLHSR gUt/hQJB2S07Dgr0XNXvVUfO+B7xfFbewqwdWJtiPS6pep00KyH5jYyVNMGOAA== 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=1715719172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x2oIJHusS14Gt4pZcRUYPPcZvY5oNqQaa5SKqgsK3Tg=; b=ls93XJID2HKHCZO2Et0I1bU72322XHzLcA44cw/WtMy3MiIojcd7DwF2yfIv0XVZq70Gsy 0qXvM0mo63OOVnlU+VcuCHYiGGSF0owMDxEMkdjLIPvX02CLVwASQKrbD/EvUHmgxsRqgq wvJah9rP44SKjKHE1hFuSH0yVXdzR2/632Nb+znKDvIUZTs6//kaz2qoz+iJFEIjGiXrOP 4RP2FB5hYPagGnp3X0cvjl46+oi97fEruqxcioqFx0lREwRtdvgblDPav7Ox8Jp4iYHvtB 1MnWSkThj8OEF6YWUIpYb9AglSbqM6VluVMXx7vHtl05pir3cZa0K0uIZKmFZQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vf7WS3WNTzmd5; Tue, 14 May 2024 20:39: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 44EKdWct093045; Tue, 14 May 2024 20:39:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EKdWXE093042; Tue, 14 May 2024 20:39:32 GMT (envelope-from git) Date: Tue, 14 May 2024 20:39:32 GMT Message-Id: <202405142039.44EKdWXE093042@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: 43571fe7c8dc - stable/13 - fib_dxr: s/KASSERT/MPASS/ List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 43571fe7c8dc433266aedb31001659d461d93bbe Auto-Submitted: auto-generated The branch stable/13 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=43571fe7c8dc433266aedb31001659d461d93bbe commit 43571fe7c8dc433266aedb31001659d461d93bbe Author: Marko Zec AuthorDate: 2024-05-07 15:33:23 +0000 Commit: Marko Zec CommitDate: 2024-05-14 20:36:09 +0000 fib_dxr: s/KASSERT/MPASS/ MFC after: 1 week --- sys/netinet/in_fib_dxr.c | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index 5c5311068169..91f3bafdb47d 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -474,8 +474,7 @@ chunk_ref(struct dxr_aux *da, uint32_t chunk) cdp->cd_max_size = size; cdp->cd_base = fdesc->base; LIST_INSERT_HEAD(&da->all_chunks, cdp, cd_all_le); - KASSERT(cdp->cd_base + cdp->cd_max_size == da->rtbl_top, - ("dxr: %s %d", __FUNCTION__, __LINE__)); + MPASS(cdp->cd_base + cdp->cd_max_size == da->rtbl_top); } cdp->cd_hash = hash; @@ -525,7 +524,7 @@ chunk_unref(struct dxr_aux *da, uint32_t chunk) sizeof(struct range_entry_long) * size) == 0) break; - KASSERT(cdp != NULL, ("dxr: dangling chunk")); + MPASS(cdp != NULL); if (--cdp->cd_refcnt > 0) return; @@ -536,8 +535,7 @@ chunk_unref(struct dxr_aux *da, uint32_t chunk) /* Attempt to merge with the preceding chunk, if empty */ cdp2 = LIST_NEXT(cdp, cd_all_le); if (cdp2 != NULL && cdp2->cd_cur_size == 0) { - KASSERT(cdp2->cd_base + cdp2->cd_max_size == cdp->cd_base, - ("dxr: %s %d", __FUNCTION__, __LINE__)); + MPASS(cdp2->cd_base + cdp2->cd_max_size == cdp->cd_base); LIST_REMOVE(cdp, cd_all_le); LIST_REMOVE(cdp2, cd_hash_le); cdp2->cd_max_size += cdp->cd_max_size; @@ -548,8 +546,7 @@ chunk_unref(struct dxr_aux *da, uint32_t chunk) /* Attempt to merge with the subsequent chunk, if empty */ cdp2 = LIST_PREV(cdp, &da->all_chunks, chunk_desc, cd_all_le); if (cdp2 != NULL && cdp2->cd_cur_size == 0) { - KASSERT(cdp->cd_base + cdp->cd_max_size == cdp2->cd_base, - ("dxr: %s %d", __FUNCTION__, __LINE__)); + MPASS(cdp->cd_base + cdp->cd_max_size == cdp2->cd_base); LIST_REMOVE(cdp, cd_all_le); LIST_REMOVE(cdp2, cd_hash_le); cdp2->cd_max_size += cdp->cd_max_size; @@ -560,8 +557,7 @@ chunk_unref(struct dxr_aux *da, uint32_t chunk) if (cdp->cd_base + cdp->cd_max_size == da->rtbl_top) { /* Free the chunk on the top of the range heap, trim the heap */ - KASSERT(cdp == LIST_FIRST(&da->all_chunks), - ("dxr: %s %d", __FUNCTION__, __LINE__)); + MPASS(cdp == LIST_FIRST(&da->all_chunks)); da->rtbl_top -= cdp->cd_max_size; da->unused_chunks_size -= cdp->cd_max_size; LIST_REMOVE(cdp, cd_all_le); @@ -875,7 +871,7 @@ dxr_build(struct dxr *dxr) uint32_t trie_frag; #endif - KASSERT(dxr->d == NULL, ("dxr: d not free")); + MPASS(dxr->d == NULL); if (da == NULL) { da = malloc(sizeof(*dxr->aux), M_DXRAUX, M_NOWAIT); @@ -1273,16 +1269,14 @@ dxr_change_rib_batch(struct rib_head *rnh, struct fib_change_queue *q, int update_delta = 0; #endif - KASSERT(data != NULL, ("%s: NULL data", __FUNCTION__)); - KASSERT(q != NULL, ("%s: NULL q", __FUNCTION__)); - KASSERT(q->count < q->size, ("%s: q->count %d q->size %d", - __FUNCTION__, q->count, q->size)); + MPASS(data != NULL); + MPASS(q != NULL); + MPASS(q->count < q->size); da = dxr->aux; - KASSERT(da != NULL, ("%s: NULL dxr->aux", __FUNCTION__)); - KASSERT(da->fd != NULL, ("%s: da->fd %p", __FUNCTION__, da->fd)); - KASSERT(da->refcnt > 0, ("%s: da->refcnt %d", __FUNCTION__, - da->refcnt)); + MPASS(da != NULL); + MPASS(da->fd != NULL); + MPASS(da->refcnt > 0); FIB_PRINTF(LOG_INFO, da->fd, "processing %d update(s)", q->count); for (ui = 0; ui < q->count; ui++) { @@ -1315,8 +1309,7 @@ dxr_change_rib_batch(struct rib_head *rnh, struct fib_change_queue *q, #ifdef INVARIANTS fib_get_rtable_info(fib_get_rh(da->fd), &rinfo); - KASSERT(da->prefixes + update_delta == rinfo.num_prefixes, - ("%s: update count mismatch", __FUNCTION__)); + MPASS(da->prefixes + update_delta == rinfo.num_prefixes); #endif res = dxr_init(0, dxr->fd, data, (void **) &new_dxr); From nobody Tue May 14 20:39:33 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vf7WT6VhCz5L0J9; Tue, 14 May 2024 20:39: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 4Vf7WT55YDz4Kxb; Tue, 14 May 2024 20:39:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715719173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YI7V/Gwb/zJ8RbkWkMNyKavJk4Y/gQjeYbiIGit/MiQ=; b=sfNCio1AnCjkWH39i8l+eifE2ZE3Qh7UxD6l1tKzfquBzhITx38+LFJh+9XVP2VCn3+QgO hym9b662Ou/BgGq/jAJ5QCHEusBRpTchaftN9HWui2HrXN2zKpghsIm4578Z3sNxCLyt/F 8FMRhULlh67sjX6UOEC3pjx4NK6ip7NFO9dXRJZhm6zE3KY8xNwYA+c0A9u9nYKntcuGia 7burHV6st+HI9ntMnvuCW7R2LobBbQEk8V7W544yJ7TFAFR/OW2RcY8l/HDsnBEry2ZfGv /PSeFqQuW6zK+pQl7MgyaQLyfMyLXe03KkRhBb9vAjcrW1NKuXx13BlqBoH8+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715719173; a=rsa-sha256; cv=none; b=glrJ0PL4sZ9QoRj4tLE766hwBFPjSfjsrXbqFWFqCQqHE6YShh89UMm5WVxrO0bm4jtEiM kw2I9YwpD+XM44QXLpAN3RiKsg0VSIyGBeMaXKpsJVhAiyFQImyZxN7d4zV290X1+NmN0a YegrvnEleoTFkg6thSmXvn1KiukjqbtLf9kGoNAN9IlqDziciNdXvgI6nuUXn4vwmFXux+ BsGhcitZ62lkAN6cHsrAQMtkzfy1XOpbTSezGeDZvpXYLMNQ+kMDXZwCwgF60VT/WipVFp IUkJm5XzHMCSzGFO3B+dM36PnmirhBtI7XwzPtCVU8j7tGdf1u4vcFKalR1PqA== 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=1715719173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YI7V/Gwb/zJ8RbkWkMNyKavJk4Y/gQjeYbiIGit/MiQ=; b=hSm6UTC+TQPerQqTlEzcsrV4k9l6/NNLsnUC6iQYcotif+Q2Elf2DcCE1uk5fO2HwNSJcD N0muSWbnXLeP5zaQmtIXjYEOZIAr6QKfL3F8HO+OORPnYza7d/Nk/9idcF/V934z+fAn1k Q49tuD/zbVCsy2Wqbazbf1r7IknI6/TCaxuRn1zlS1iid4LhRbQl9jMK/4aoncYKK2PAwM wchBMugJh41D/oa9QKM9HOUyufvPXA1tbjbgbKSZwxSe+qBhtp1H3DC2jy9sBSWEI4E4iy lLT7U8lpcx/xvWsXtDWPoBQidQ3t1jRE0EIstz+LJ0gq4AEDIibk6zs3j08udQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vf7WT4fRmzmQ7; Tue, 14 May 2024 20:39: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 44EKdXjS093099; Tue, 14 May 2024 20:39:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EKdXsY093096; Tue, 14 May 2024 20:39:33 GMT (envelope-from git) Date: Tue, 14 May 2024 20:39:33 GMT Message-Id: <202405142039.44EKdXsY093096@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: 9ae078121d3f - stable/13 - fib_dxr: set fib_data field in struct dxr_aux early enough List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9ae078121d3f70d8cd8c537fa16daf302ff5ee21 Auto-Submitted: auto-generated The branch stable/13 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=9ae078121d3f70d8cd8c537fa16daf302ff5ee21 commit 9ae078121d3f70d8cd8c537fa16daf302ff5ee21 Author: Marko Zec AuthorDate: 2024-05-07 15:44:09 +0000 Commit: Marko Zec CommitDate: 2024-05-14 20:36:20 +0000 fib_dxr: set fib_data field in struct dxr_aux early enough Previously it was possible for dxr_build() to return with da->fd unset in case of range_tbl or x_tbl malloc() failures. This may have led to NULL ptr dereferencing in dxr_change_rib_batch(). MFC after: 1 week PR: 278422 --- sys/netinet/in_fib_dxr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index 91f3bafdb47d..82245ecf6e66 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -882,6 +882,7 @@ dxr_build(struct dxr *dxr) } dxr->aux = da; da->fibnum = dxr->fibnum; + da->fd = dxr->fd; da->refcnt = 1; LIST_INIT(&da->all_chunks); LIST_INIT(&da->all_trie); @@ -918,7 +919,6 @@ dxr_build(struct dxr *dxr) trie_rebuild = 1; } #endif - da->fd = dxr->fd; microuptime(&t0); From nobody Tue May 14 21:38:34 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vf8qZ3cGZz5L3x9; Tue, 14 May 2024 21: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 4Vf8qZ2Vdzz4RnW; Tue, 14 May 2024 21: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=1715722714; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BFZ7AN90RCvb1tK0gW9f7LpNWfGz013VAPI7IAXFhYc=; b=iKb8zyh2Pk8hgRYwswI1D0p/iwd2jTuuzfygQFYt5l5YCsEmXp7pc278QUWzRjs8TPkiSp KSrwlutlFwJPupMdn5EE79gOZ6XFod4lxmmLGhjeyJB3hGta1rGkYVieOGj+/FhhY1K2KR Fu14tCcAXvva6Q5yTgA7K6EB5aED6wLFMIVfRWt+T1EPnuzM3+Dj63MiF3qh+K3igNbakK LFiYChl0b89H+r1SAu3KOEg2ZqOkd5C8HbodbIPzd4IR35gI3n81ZkXzsImOmkDOpDQ9kK NCrodoxHXcYdMEyL3wPVQDg/llUFzJVtZgnfCdew8a1l72naCySzANE0rP38ng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715722714; a=rsa-sha256; cv=none; b=yVHI+Uf0XgXj9DKbVT78LzVg21stD2/muz9gjYypkDP+wRbomxbVpsRn4i6qLeBKFYrPRe VUJw+SMnU7Ls8+HQaQYeex/IquOiim0vsT+Xtdf/iwd+ydacQF/6m5tTCLD/ZX+8MKw/Q4 ZScDsTjlXg3r1GXF8tQ6d+3yOe5RSCzQJdVk9s8U19x2V5kHiAbHCfEMC1tmIXxkbu/qOb qElXqq9sEIrEU6WD+h3cH6DDZMw+U04Ap/C9d95dU6pqJWuRyzfzCOqFw9BKF/XJv2tUnI 7zDkw3tyGP08iixpg7JTEFR2SR3c8qsqrlu/KzglHN4imO4bXjKHQzpsysbhrQ== 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=1715722714; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BFZ7AN90RCvb1tK0gW9f7LpNWfGz013VAPI7IAXFhYc=; b=VYfYuF4bkh+WFqEEZcPciL0ZXlHGssaBrQdMZXTfLkjnhI9ohztFXO3C2DYTgHV8Tcbn9h F8BiS1PwO61v553qdsSEKEgeKmXFa/uMnlWAqOE5tjcVDQ5wzjHHIZEQ2KxECZPhaGB4GG hugvtTsCY6scTkQBHjJzhaeMHg3vLCJLso7IOBvZwAJp/A2VcgAPuCrXQBuNt9jmxKsV0x Ye5fJgnqp0Oga9ZlGx+oDqoJIsX9NdIkXXqACJW0l/NpMI9Cy6TmmPcqT5DYl+umKe2PI+ DxIhqc6FvKCjcqficQs4oqFK234k1rc2RlXW1m51tewXaEn0nC1LupspBrUxzQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vf8qZ206zzp6T; Tue, 14 May 2024 21: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 44ELcYLF093895; Tue, 14 May 2024 21:38:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44ELcYrg093892; Tue, 14 May 2024 21:38:34 GMT (envelope-from git) Date: Tue, 14 May 2024 21:38:34 GMT Message-Id: <202405142138.44ELcYrg093892@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: 1653215de8f4 - releng/14.1 - release: Use qemu when cross-building vm images List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 1653215de8f4e70372b77f08150e4faef8230504 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=1653215de8f4e70372b77f08150e4faef8230504 commit 1653215de8f4e70372b77f08150e4faef8230504 Author: Colin Percival AuthorDate: 2024-05-05 05:31:19 +0000 Commit: Colin Percival CommitDate: 2024-05-14 21:37:47 +0000 release: Use qemu when cross-building vm images For a bit over 5 years, we have used qemu when cross-building cloudware images; in particular, it's necessary when installing packages which might include post-install scripts. Use qemu in the vm-images target too; while "generic" vm images don't install packages, they still run newaliases and /etc/rc.d/ldconfig, both of which fail without appropriate emulation. MFC after: 1 week Approved by: re (delphij) (cherry picked from commit 9287d1853c00267a0118401530debf9c0554ff28) (cherry picked from commit 166432191c5a46f60155a6cb14ce4c918c82be4d) --- release/Makefile.vm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/release/Makefile.vm b/release/Makefile.vm index 0eb549ec7bc2..6fd165528854 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -157,12 +157,13 @@ CLEANFILES+= ${VMBASE}.${FS}.${FORMAT} vm-base: vm-image -vm-image: +vm-image: ${QEMUTGT} .if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) . for FORMAT in ${VMFORMATS} . for FS in ${VMFSLIST} mkdir -p ${.OBJDIR}/${.TARGET}-${FORMAT}-${FS} env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} SWAPSIZE=${SWAPSIZE} \ + QEMUSTATIC=${QEMUSTATIC} \ ${.CURDIR}/scripts/mk-vmimage.sh \ -C ${.CURDIR}/tools/vmimage.subr \ -d ${.OBJDIR}/${.TARGET}-${FORMAT}-${FS} -F ${FS} \ From nobody Tue May 14 21:38:35 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vf8qb3ZpYz5L3xB; Tue, 14 May 2024 21:38: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 4Vf8qb35GZz4RYB; Tue, 14 May 2024 21:38:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715722715; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pG8m1NooDZTn3H9G2LoKlgXyxWk1XthEX2B6/x/H7mI=; b=EmBM7OoHREXlzmDF/J74aol9/8k1BfM2qd2qyQ4cIg9yEQYO+FVEHsyvSRxaQmc6rPRrlf ZH202NAdnRATNx7pMdpgln8A0um23TFXf8vt5dIEZNjcykfo0aG4uphs8kYzImWhNBd13Q kwJn9AIzHKj95Mf282TpyuMizROxoHHPbjM0oldVkhjoYBQgbf/63//pYZZUhJibwy9YD7 ks3sr57u1/w1Zv/7HRFrh9G0gpu0bhd9gRs2xeg2WDRQzLAGH47ViZm4XYQsGdEVkEKwsw 0DnMD57UM7ClqxGkGAhCwGt6hQeeDbcCr3F3RQoQ0E8kiE0PGXpKQ2PE8l5UFw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715722715; a=rsa-sha256; cv=none; b=FepBiHpjISFo0fyUiIap8jt2TVX6MhjOWmu4qxA2yGVROBiZ2DaX/mUZIp9C3GALOhvJkp tsVNq7UcfUbuhNBouulswVQv+Dfuz8etYpTzrZwt95M1/NemGHDrncRPBx026LgrVk2u3I +1iOlI1b4vLczqjCQlqrmYRwWMHwy3KstzXC1m3U0JwXYDV3VDEmWHuvikObREa5aBkcP8 OL7OOaJUyJEWual8l+kEyXihKaKddbiLYE/4d1aFnTHEtizznu3u0Nzc+jqKvFyI6tXal4 l0DRDcz7t7Hsr7Fkf/DfwpEMni5MBHRFJV76Wrqnz/9pKvv2VV7vbI7IR5xNIw== 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=1715722715; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pG8m1NooDZTn3H9G2LoKlgXyxWk1XthEX2B6/x/H7mI=; b=fkY+IupblwWWcr2O+GWMMnE6VU+9b4aBio47FZa2dUtw8LYLEjP87cc/vgSxTezPIoA5hG 84jx4RGtma501lEPlCwdSLcOEz3SGA+dLuPuN+mZJmvTF0VjNPO3Dd4B77bxw3LPF1j1YG KGGxX0KzpGU45xTqJFrWQECw7XtJNc2K2nXn7bXU6hzvu7lXM13V4X92l9z0Jk3M22KYhU dEbp1eeC7GqHz0V4or/0ZtMSeTvxGxpTpiEJmAGLlwo1BxsPfs9tvSTNRURssixnc6wAW0 7wEz8Fb49FYJPk+heqBjhU6hvyoxcqmEobVjuiJomdNHMN2myoPK8GM9scpxMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vf8qb2gfqzp6V; Tue, 14 May 2024 21:38: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 44ELcZsm093932; Tue, 14 May 2024 21:38:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44ELcZ8S093929; Tue, 14 May 2024 21:38:35 GMT (envelope-from git) Date: Tue, 14 May 2024 21:38:35 GMT Message-Id: <202405142138.44ELcZ8S093929@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: 0db0821fb8d7 - releng/14.1 - release: Rework vm_extra_pre_umount List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 0db0821fb8d7d0eb3f2ae7d219ceca1545f85bd0 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=0db0821fb8d7d0eb3f2ae7d219ceca1545f85bd0 commit 0db0821fb8d7d0eb3f2ae7d219ceca1545f85bd0 Author: Colin Percival AuthorDate: 2024-05-06 20:26:52 +0000 Commit: Colin Percival CommitDate: 2024-05-14 21:38:09 +0000 release: Rework vm_extra_pre_umount The vm_extra_pre_umount function in vmimage.subr served two purposes: It removed /etc/resolv.conf and /qemu (if cross-building), and it provided a function for cloudware to override in order to make cloud specific changes to the filesystem before constructing a disk image. This resulted in a number of bugs: 1. When cross-building, the emulator binary was left as /qemu in the Azure, GCE, Openstack and Vagrant images. 2. The build host's resolv.conf was left as /etc/resolv.conf in the basic-ci and basic-cloudinit images. 3. When building GCE images, a Google-specific resolv.conf file was constructed, and then deleted before the disk image was created. Move the bits needed for running code inside a VM staging directory from vm_install_base into a new vm_emulation_setup routine, and move the corresponding cleanup bits from vm_extra_pre_umount to a new vm_emulation_cleanup routine. Remove the /qemu and /etc/resolv.conf cleanups from the cloudware configuration files (where they exist) since we will now be running vm_emulation_cleanup to remove those even when vm_extra_pre_umount has been overridden. Override vm_emulation_cleanup in gce.conf since in that one case (and *only* that one case) we don't want to clean up resolv.conf (since it was constructed for the VM image rather than copied from the host). releng/14.1 candidate. MFC after: 1 week Approved by: re (delphij) Sponsored by: https://www.patreon.com/cperciva (cherry picked from commit 0b1c5628c74a37e2aa2aa3769c606d3e826302f8) (cherry picked from commit c5342be39c1ab37ca41e74aabdd7f507a6c6e036) --- release/scripts/mk-vmimage.sh | 3 ++- release/tools/azure.conf | 2 -- release/tools/ec2.conf | 5 ----- release/tools/gce.conf | 10 +++++++++- release/tools/oci.conf | 5 ----- release/tools/openstack.conf | 2 -- release/tools/vagrant-virtualbox.conf | 1 - release/tools/vagrant-vmware.conf | 1 - release/tools/vmimage.subr | 23 +++++++++++------------ 9 files changed, 22 insertions(+), 30 deletions(-) diff --git a/release/scripts/mk-vmimage.sh b/release/scripts/mk-vmimage.sh index ca6a359affbd..dfd91f43140d 100755 --- a/release/scripts/mk-vmimage.sh +++ b/release/scripts/mk-vmimage.sh @@ -97,13 +97,14 @@ main() { vm_create_base vm_install_base + vm_emulation_setup vm_extra_install_base vm_extra_install_packages vm_extra_install_ports vm_extra_enable_services vm_extra_pre_umount vm_extra_pkg_rmcache - cleanup + vm_emulation_cleanup vm_copy_base vm_create_disk || return 0 vm_extra_create_disk diff --git a/release/tools/azure.conf b/release/tools/azure.conf index b6526f21e474..9da2b19de694 100644 --- a/release/tools/azure.conf +++ b/release/tools/azure.conf @@ -53,7 +53,5 @@ EOF touch ${DESTDIR}/firstboot - rm -f ${DESTDIR}/etc/resolv.conf - return 0 } diff --git a/release/tools/ec2.conf b/release/tools/ec2.conf index a233bf5981c1..ce09ab0d2367 100644 --- a/release/tools/ec2.conf +++ b/release/tools/ec2.conf @@ -102,10 +102,5 @@ EOF # The first time the AMI boots, run "first boot" scripts. touch ${DESTDIR}/firstboot - if ! [ -z "${QEMUSTATIC}" ]; then - rm -f ${DESTDIR}/${EMULATOR} - fi - rm -f ${DESTDIR}/etc/resolv.conf - return 0 } diff --git a/release/tools/gce.conf b/release/tools/gce.conf index aad4a74d2e39..5ad83bcded53 100644 --- a/release/tools/gce.conf +++ b/release/tools/gce.conf @@ -118,7 +118,15 @@ EOF touch ${DESTDIR}/firstboot - rm -f ${DESTDIR}/etc/resolv.conf + return 0 +} +# Do everything except deleting resolv.conf since we construct our own +# Googlized resolv.conf file in vm_extra_install_base. +vm_emulation_cleanup() { + if ! [ -z "${QEMUSTATIC}" ]; then + rm -f ${DESTDIR}/${EMULATOR} + fi + umount_loop ${DESTDIR}/dev return 0 } diff --git a/release/tools/oci.conf b/release/tools/oci.conf index c57a7683a500..a4fe54ad3031 100644 --- a/release/tools/oci.conf +++ b/release/tools/oci.conf @@ -90,10 +90,5 @@ EOF touch ${DESTDIR}/firstboot - if ! [ -z "${QEMUSTATIC}" ]; then - rm -f ${DESTDIR}/${EMULATOR} - fi - rm -f ${DESTDIR}/etc/resolv.conf - return 0 } diff --git a/release/tools/openstack.conf b/release/tools/openstack.conf index 4c905fbae4ba..05d2d13bbb39 100644 --- a/release/tools/openstack.conf +++ b/release/tools/openstack.conf @@ -35,8 +35,6 @@ vm_extra_pre_umount() { echo 'ALL ALL=(ALL) NOPASSWD:ALL' >> \ ${DESTDIR}/usr/local/etc/sudoers.d/cloud-init - rm -f ${DESTDIR}/etc/resolv.conf - # The console is not interactive, so we might as well boot quickly. echo 'autoboot_delay="-1"' >> ${DESTDIR}/boot/loader.conf echo 'beastie_disable="YES"' >> ${DESTDIR}/boot/loader.conf diff --git a/release/tools/vagrant-virtualbox.conf b/release/tools/vagrant-virtualbox.conf index 4dd7ca8953ad..9e0e430bbc88 100644 --- a/release/tools/vagrant-virtualbox.conf +++ b/release/tools/vagrant-virtualbox.conf @@ -14,5 +14,4 @@ vm_extra_pre_umount () { # Setup the Vagrant common items vagrant_common - rm -f ${DESTDIR}/etc/resolv.conf } diff --git a/release/tools/vagrant-vmware.conf b/release/tools/vagrant-vmware.conf index 52ff7f1aac1a..fff929829222 100644 --- a/release/tools/vagrant-vmware.conf +++ b/release/tools/vagrant-vmware.conf @@ -18,5 +18,4 @@ vm_extra_pre_umount () { # Setup the Vagrant common items vagrant_common - rm -f ${DESTDIR}/etc/resolv.conf } diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index eda22e061c6d..72540dad14a8 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -83,8 +83,14 @@ vm_install_base() { echo "zfs_enable=\"YES\"" >> ${DESTDIR}/etc/rc.conf echo "zpool_reguid=\"zroot\"" >> ${DESTDIR}/etc/rc.conf echo "zpool_upgrade=\"zroot\"" >> ${DESTDIR}/etc/rc.conf + echo "kern.geom.label.disk_ident.enable=0" >> ${DESTDIR}/boot/loader.conf + echo "zfs_load=YES" >> ${DESTDIR}/boot/loader.conf fi + return 0 +} + +vm_emulation_setup() { if ! [ -z "${QEMUSTATIC}" ]; then export EMULATOR=/qemu cp ${QEMUSTATIC} ${DESTDIR}/${EMULATOR} @@ -94,15 +100,8 @@ vm_install_base() { mount -t devfs devfs ${DESTDIR}/dev chroot ${DESTDIR} ${EMULATOR} /usr/bin/newaliases chroot ${DESTDIR} ${EMULATOR} /bin/sh /etc/rc.d/ldconfig forcestart - umount_loop ${DESTDIR}/dev - cp /etc/resolv.conf ${DESTDIR}/etc/resolv.conf - if [ "${VMFS}" = zfs ]; then - echo "kern.geom.label.disk_ident.enable=0" >> ${DESTDIR}/boot/loader.conf - echo "zfs_load=YES" >> ${DESTDIR}/boot/loader.conf - fi - return 0 } @@ -136,15 +135,12 @@ vm_extra_install_packages() { if [ -z "${VM_EXTRA_PACKAGES}" ]; then return 0 fi - mkdir -p ${DESTDIR}/dev - mount -t devfs devfs ${DESTDIR}/dev chroot ${DESTDIR} ${EMULATOR} env ASSUME_ALWAYS_YES=yes \ /usr/sbin/pkg bootstrap -y for p in ${VM_EXTRA_PACKAGES}; do chroot ${DESTDIR} ${EMULATOR} env ASSUME_ALWAYS_YES=yes \ /usr/sbin/pkg install -y ${p} done - umount_loop ${DESTDIR}/dev return 0 } @@ -159,13 +155,16 @@ vm_extra_install_ports() { vm_extra_pre_umount() { # Prototype. When overridden, performs additional tasks within the # virtual machine environment prior to unmounting the filesystem. - # Note: When overriding this function, removing resolv.conf in the - # disk image must be included. + return 0 +} + +vm_emulation_cleanup() { if ! [ -z "${QEMUSTATIC}" ]; then rm -f ${DESTDIR}/${EMULATOR} fi rm -f ${DESTDIR}/etc/resolv.conf + umount_loop ${DESTDIR}/dev return 0 } From nobody Tue May 14 21:38:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vf8qc6D2pz5L409; Tue, 14 May 2024 21:38: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 4Vf8qc3lQKz4Rt7; Tue, 14 May 2024 21:38:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715722716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+eJpAl4tbZsVK67zGm9g2BgOy1MlSvF2/5a3k2sOcFU=; b=YXAj8YsdVLLgx6ap3+SUmNzZuSbPnliB8WBXI8m1TRZqKRZQS4VWLwlawIDk7/KI/pb1f+ q4TxEl+fjZru7caIVj+dTMmXMQg/4dV1U8KCKrw+m9ybW4IxmfhFslgnnUnQRDzIk9rBYL hDmA9+7MsAO0preFW51bA5aFxxNsf0PefDXmSTqgHaRYUrJ1Evx3uu9mzwR5CpS0KwN3Wl ++48yOp+ab6n2wfvMQWASvbPE9hyIjHlNwN/8h1LjnBfvznt1ATCzSIIeUCNjIAG9JfSQZ usDzzQeZXGmvLC8DNhQWX0Fkh9IO+rYaJVzXdvdA+MFRzoneO1QYdmta5LtyCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715722716; a=rsa-sha256; cv=none; b=ogd9J1BJ6xcuFO1/JlpkdtZaiSrA3uRxUvLjC7aab7AFJv7xVh/P5KYBSr7h5AFmjgI1JZ sLOQ95HZRe2MlRz4WkX8u6v7teivGA6dAScsTCOFr8lLJWOCs+cKpKQiZiQSjPZdKVc5HP EZ11+MW2wXvDI/kfBiw63qaqjB4jIg8jqRP8jsd++Ql2u7cnOMpMtsX7TZbtk6RVZF/UvZ MHo3BsQt3L8sPraWUIpgIZUpwg5f2ax3BrgI2UdOL48Zy94Ozs8iJd8IDTQmI5SyPv/0CQ Gr6hf/RNb5/Tv5GzhdXUdx50RAEG4XtRtDeUm3fjebCKTYzRSGvktXTdy/KQgw== 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=1715722716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+eJpAl4tbZsVK67zGm9g2BgOy1MlSvF2/5a3k2sOcFU=; b=QrpN50ui4c264J8pTLS5j2ooTth74Pmq0mMNymfCmatc8vJWgmEB8nbcs8JOsMa9ABtm0/ P1ZsUnkJMK3oaxNAug4smwyK9HozGeUvlaGN/uleEzbou5Nug3nS2vV911yxlGrB1dcZBL GP65ddIUarCkCLseA1/w3I+MCBpy1tCfKBQRnhE60VegnXZqUzSwRKIcGOREryxMpdBWkh QUrPkbhtaxohcWEG7K0lO26bBqb9f+HGfI4LvixIXZdpif513ltSiC4dRqejxuNBsslAgI Dl3+CXeLTf9REXUrzIdrS3RiGnTzuI01iB4HN1vMcXwLvp08BA3DrMFAXVSWkA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vf8qc3Jg9zp6W; Tue, 14 May 2024 21:38: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 44ELcaVW093980; Tue, 14 May 2024 21:38:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44ELcaDh093977; Tue, 14 May 2024 21:38:36 GMT (envelope-from git) Date: Tue, 14 May 2024 21:38:36 GMT Message-Id: <202405142138.44ELcaDh093977@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: 67f4116a102f - releng/14.1 - release: make dependencies, not recursive make List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 67f4116a102f6a6917f4b329412b0dfa30016e1a Auto-Submitted: auto-generated The branch releng/14.1 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=67f4116a102f6a6917f4b329412b0dfa30016e1a commit 67f4116a102f6a6917f4b329412b0dfa30016e1a Author: Colin Percival AuthorDate: 2024-05-09 07:52:25 +0000 Commit: Colin Percival CommitDate: 2024-05-14 21:38:17 +0000 release: make dependencies, not recursive make For historical reasons, the vm-release and cloudware-release targets were written as recursive makes of ${VMTARGETS} and ${CLOUDTARGETS}; this worked fine until we started running `make release -jN` and had both VM and cloud targets depending on ${QEMUTGT}, at which point things exploded when we tried to build the port twice at the same time. Switch vm-release and cloudware-release to have make dependencies on their individual components; this way a single make process runs and is aware of the duplicate dependency (and only runs it once). MFC after: 5 days Approved by: re (delphij) (cherry picked from commit ce7756fdca1f0a89a74bc406cd3d3ac1d1be1ffb) (cherry picked from commit e306ad1c194d464708b4b12277d577d931e6eae9) --- release/Makefile.vm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/release/Makefile.vm b/release/Makefile.vm index 6fd165528854..95d48490c353 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -223,14 +223,16 @@ vm-install: ${DESTDIR}/vmimages/CHECKSUM.SHA256 .endif -vm-release: .if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) - ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${VMTARGETS} +vm-release: ${VMTARGETS} +.else +vm-release: .endif -cloudware-release: .if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE) - ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${CLOUDTARGETS} +cloudware-release: ${CLOUDTARGETS} +.else +cloudware-release: .endif .include "${.CURDIR}/Makefile.azure" From nobody Tue May 14 21:39:47 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vf8rz6MZBz5L3yR; Tue, 14 May 2024 21:39: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 4Vf8rz4q4qz4SgX; Tue, 14 May 2024 21:39:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715722787; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Iynvmonh+ETdDrtJPCs+kP0r7Dmq0LpY8H6ano30XSM=; b=Kir6+2FTYSv/mTh9OuUjMnnsr0HClhgOoWTzjVUndoyi2l6HhXbRZNJ7MGSPNNRTiRYM16 aYnlCkb+AQZ0CMmLoj9NwBWjwpmISdvhdJuo295KLqGwsBvW3k1/jY5/HvAGYWSxuYlu5u /PwVVRppXfH5eFm153kusRPqFytDa9EqQA8zqu5IqG6CutiLJqK1VyoeVFKGBhZvcWE37k B2O30nK1VQsa3YyxYeNHl9KO8zcnRFJLL5wL7CVRQ4goqcVOrmdDi/YcPVC1p8a2jo3D2i c99uA9M6KEk2pLzsgZsHcNVRKgPmIDRYAqhDSrMzJGyMmNPyUB1grPJqRnXuLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715722787; a=rsa-sha256; cv=none; b=udNvhvKrGNWpTjVxIY5ZavKJfHH8XQMZ9PKj1U+4O8e1eEQidUE95BdrhkkQfMDAqwZjM5 c0XRXls4TeU+a3+JafYF2JG4++hlXnUyJH7S4DSPll2q07TRVpcxSFqge9usApIwu6DjQE g6stDXOxOVfVYKBFpPeEI6HPG9zKED5Jfr2jcc7LZb4427EqwQTgh+Lk17/nn3DrMKc3nE TNFn6Cz1VjgUWOPe7avi6RWT8pgRZubrfrhvasEbQfVj2O6VFwJnonz6EIP8Rz19HeUwL7 /HMLhBaJupFz/92nNO9QR1Pg24u5yWPx/QJXgat21DX3mDHRYnOSGbEkUY/Wxg== 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=1715722787; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Iynvmonh+ETdDrtJPCs+kP0r7Dmq0LpY8H6ano30XSM=; b=Ap8smtBtaWsjxRnNdKvn7oPDVSsFutdr3WiEN8lM6tJut1wYiV9t24FOiGHj7MsDraR/Om AEyuVWTFfSRy8SNBN8+sWr8wTqOP/DkSJfCpPXm7YzdZbI6A+CsocB51jSQGthGSCAmGdc UD5lUs9mJ6fdWywFHAlciHqKKoQV3rlo2fzw8fJa+EUzPHi26ldF9/aKm0LjuwednYkHd0 mq3xfXAlaY8iwsWgO1fXsekihBk/wOlSGX0aba+CIMu855RurMhAldAQupgh5t1OEMRPRI N/o9UlQqK73I6Uj9NwVy04W1k84K3bzFLceukV+BM3ZgYSu/P2DoBnRGyawM/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 4Vf8rz46byznvh; Tue, 14 May 2024 21:39: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 44ELdlKl094286; Tue, 14 May 2024 21:39:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44ELdlcI094283; Tue, 14 May 2024 21:39:47 GMT (envelope-from git) Date: Tue, 14 May 2024 21:39:47 GMT Message-Id: <202405142139.44ELdlcI094283@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 05540e62e75f - main - net80211: add the 802.11-2016 cipher list to the crypto array set. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 05540e62e75f8b2de7e337738eacfb0b159515a6 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=05540e62e75f8b2de7e337738eacfb0b159515a6 commit 05540e62e75f8b2de7e337738eacfb0b159515a6 Author: Adrian Chadd AuthorDate: 2024-04-22 03:25:33 +0000 Commit: Adrian Chadd CommitDate: 2024-05-14 21:39:00 +0000 net80211: add the 802.11-2016 cipher list to the crypto array set. These are the bitmap / cipher module number fields used for net80211 ciphers. This requires a kernel recompile, but nothing (currently) in userland is using these. Differential Revision: https://reviews.freebsd.org/D44899 Reviewed by: bz, cc --- sys/net80211/ieee80211_crypto.h | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/sys/net80211/ieee80211_crypto.h b/sys/net80211/ieee80211_crypto.h index 9637278701ff..e09b822289d7 100644 --- a/sys/net80211/ieee80211_crypto.h +++ b/sys/net80211/ieee80211_crypto.h @@ -137,8 +137,17 @@ struct ieee80211_key { #define IEEE80211_CIPHER_TKIPMIC 4 /* TKIP MIC capability */ #define IEEE80211_CIPHER_CKIP 5 #define IEEE80211_CIPHER_NONE 6 /* pseudo value */ +#define IEEE80211_CIPHER_AES_CCM_256 7 +#define IEEE80211_CIPHER_BIP_CMAC_128 8 +#define IEEE80211_CIPHER_BIP_CMAC_256 9 +#define IEEE80211_CIPHER_BIP_GMAC_128 10 +#define IEEE80211_CIPHER_BIP_GMAC_256 11 +#define IEEE80211_CIPHER_AES_GCM_128 12 +#define IEEE80211_CIPHER_AES_GCM_256 13 -#define IEEE80211_CIPHER_MAX (IEEE80211_CIPHER_NONE+1) +#define IEEE80211_CIPHER_LAST 13 + +#define IEEE80211_CIPHER_MAX (IEEE80211_CIPHER_LAST+1) /* capability bits in ic_cryptocaps/iv_cryptocaps */ #define IEEE80211_CRYPTO_WEP (1< To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 98e8df90b5cc - main - net80211: add placeholder module names for the new ciphers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 98e8df90b5cc5180c09e71998e5f3e05c76a4fe1 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=98e8df90b5cc5180c09e71998e5f3e05c76a4fe1 commit 98e8df90b5cc5180c09e71998e5f3e05c76a4fe1 Author: Adrian Chadd AuthorDate: 2024-04-22 03:29:08 +0000 Commit: Adrian Chadd CommitDate: 2024-05-14 21:39:11 +0000 net80211: add placeholder module names for the new ciphers This is effectively a no-op as we currently don't advertise these ciphers as available anywhere. Note though the intent to support 128 and 256 bit ciphers in the same crypto module. Differential Revision: https://reviews.freebsd.org/D44900 Reviewed by: cc, cy Approved by: cc, cy --- sys/net80211/ieee80211_crypto.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/net80211/ieee80211_crypto.c b/sys/net80211/ieee80211_crypto.c index e849fe06db65..3659d3f7c79a 100644 --- a/sys/net80211/ieee80211_crypto.c +++ b/sys/net80211/ieee80211_crypto.c @@ -274,6 +274,13 @@ static const char *cipher_modnames[IEEE80211_CIPHER_MAX] = { [IEEE80211_CIPHER_TKIPMIC] = "#4", /* NB: reserved */ [IEEE80211_CIPHER_CKIP] = "wlan_ckip", [IEEE80211_CIPHER_NONE] = "wlan_none", + [IEEE80211_CIPHER_AES_CCM_256] = "wlan_ccmp", + [IEEE80211_CIPHER_BIP_CMAC_128] = "wlan_bip_cmac", + [IEEE80211_CIPHER_BIP_CMAC_256] = "wlan_bip_cmac", + [IEEE80211_CIPHER_BIP_GMAC_128] = "wlan_bip_gmac", + [IEEE80211_CIPHER_BIP_GMAC_256] = "wlan_bip_gmac", + [IEEE80211_CIPHER_AES_GCM_128] = "wlan_gcmp", + [IEEE80211_CIPHER_AES_GCM_256] = "wlan_gcmp", }; /* NB: there must be no overlap between user-supplied and device-owned flags */ From nobody Tue May 14 21:39:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vf8s21BtRz5L45P; Tue, 14 May 2024 21:39: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 4Vf8s16FlPz4Sd6; Tue, 14 May 2024 21:39:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715722789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YeK+QgaMi3wuRffNc0grFL/NGOKl2YjyAIv/F/Gu+ig=; b=R8GZNeFbDISwFvV8tttcSu7h2UOxocFTMR+JLsD96yo7vjetA9U9ittTK937qbxerBDzP7 DfvcLrSBphVtzLxUgD2rNZvJY0pfo86ocXNfiG3boz8eF6trbzR6AcOGGSozZ6VJValCkv M6Vszf6OP/JKxMtP1AJSKT6oA3df/eKheQ9EuCFNvExyhduIudbijdYO/gFJT92sfair8V X36w0xAlb4zyTDGfwHW9Un2BNzpi9TTLj3e4iHX/MqGGGvwcDRUdPMabh1EsDBA16315+p YJ/3nAAib0Q0J/NunHRWivfywmm68yelapnaiIFr/afOjF+PYRfMiB6b6l83iw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715722789; a=rsa-sha256; cv=none; b=AIxvwHnlSj6hYLQDwcY8INXpDB4bf2rQ2PfRykjE2O8YotJeuQdihdaY1+LFPdmUpfakwO CH5ZTBGgIzmfv2GuqM+hTOo1acp8tGNgiBMN2ciC4kLjfMw/2tSTWfFSUclBhJblJp/HHP grhnjxVRzUr2SD6I6UYMi/9JCbzqTfUSxu1SmkJUYR2HuWsDQXkLPA5K6bfbbEyP7eXTu7 2NBJn4LDyGr7wbusPCigbPloZ+AJBdr/jMGHA25ROb8zFAzC4nCNOdRha8eLYDN57luOmV 1OGgEuf+nCRS6pwBtQ5V1eWdryhtlRCIgw3NhrUK33pBNJ80FcEoHcWmcL8QQg== 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=1715722789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YeK+QgaMi3wuRffNc0grFL/NGOKl2YjyAIv/F/Gu+ig=; b=mD4EkZZWfHEsoJCNrX/RSnZkRC+OcDgSz6NshryOr0+mhD9OZCWfLnnG26bAwsM5+5noUv gCoEAgnba5zBBiLusiAbZqv//Y9PUAu95iJL6I1isCurxcU5eJSHBGTk83C5OBL8zvqz1A tTmp1Rg8VV+GSvemjCg2hwGymJEhlo01NKsgAqwhbW08QtTm3WofAuWO6tI92YOn6x3fzd GxJyXIqTCmYBIIKqBS6JCA9rSBcIA6hlTIQzs9PkB92j8dlHUwhQvVFjJTshbODfWzuJ/R mnQzYYRImFSTz/E/drBbrsq0UAyb4XYFqaGxFilOBPKS0LRYuYi6bZV4evzHKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vf8s15t1wzp6X; Tue, 14 May 2024 21:39: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 44ELdnOa094410; Tue, 14 May 2024 21:39:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44ELdnZE094408; Tue, 14 May 2024 21:39:49 GMT (envelope-from git) Date: Tue, 14 May 2024 21:39:49 GMT Message-Id: <202405142139.44ELdnZE094408@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: dcf6ab2f2e38 - main - net80211: allow a single wlan crypto module to register for >1 cipher List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dcf6ab2f2e38238f11b8f3b20f05ab43f73618c3 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=dcf6ab2f2e38238f11b8f3b20f05ab43f73618c3 commit dcf6ab2f2e38238f11b8f3b20f05ab43f73618c3 Author: Adrian Chadd AuthorDate: 2024-04-22 03:36:05 +0000 Commit: Adrian Chadd CommitDate: 2024-05-14 21:39:24 +0000 net80211: allow a single wlan crypto module to register for >1 cipher This allows a single wlan crypto module to register for more than one cipher. Without it, duplicate linkerset structs are initialised for the actual module loading machinery itself. I've tested this in my private tree with wlan_ccmp providing both 128 and 256 bit cipher support. Differential Revision: https://reviews.freebsd.org/D44901 Reviewed by: bz, cc, cy Approved by: bz, cc, cy --- sys/net80211/ieee80211_freebsd.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/net80211/ieee80211_freebsd.h b/sys/net80211/ieee80211_freebsd.h index ec017bb21ec4..b58c55cc7652 100644 --- a/sys/net80211/ieee80211_freebsd.h +++ b/sys/net80211/ieee80211_freebsd.h @@ -417,8 +417,7 @@ MODULE_DEPEND(wlan_##name, wlan, 1, 1, 1) /* * Crypto modules implement cipher support. */ -#define IEEE80211_CRYPTO_MODULE(name, version) \ -_IEEE80211_POLICY_MODULE(crypto, name, version); \ +#define IEEE80211_CRYPTO_MODULE_ADD(name) \ static void \ name##_modevent(int type) \ { \ @@ -429,6 +428,10 @@ name##_modevent(int type) \ } \ TEXT_SET(crypto##_set, name##_modevent) +#define IEEE80211_CRYPTO_MODULE(name, version) \ + _IEEE80211_POLICY_MODULE(crypto, name, version); \ + IEEE80211_CRYPTO_MODULE_ADD(name) + /* * Scanner modules provide scanning policy. */ From nobody Tue May 14 21:39:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vf8s31k3dz5L3yW; Tue, 14 May 2024 21:39: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 4Vf8s26pzLz4SSB; Tue, 14 May 2024 21:39:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715722791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d+uF6v6Lt1euVMt4nwW7xhbTcu2P7qBrN5bAKzkbb+E=; b=ms82i+f57PmN2mveL+b49BbNQXFDzi7mZNITbS+nnG3kgen5EEEKpgyF7Xe+6NhpS1VKn4 DSf/TVqh1nPSlhbKtmxRSPias4HtCoRI1XTtaovOSm+H0Yi9FbbNrP8wD8orBoaEX203R6 VIxRyN9D5S0HXaEosxMon/gVMXNluE4AjNCZ4qiydSoUanSR362bL21jin14OtWrHZhL/O 59QevCsLyrYGmSKJb/AJlAzsNcFi5C3alb9z+wiv7vPQm9Jb5c1YJ/ySBAREDLoVbWvcwb TPEv37+GW4yIM0JQ9JkuwT/cXraqsGKkVBnzc5CW4CQENR8o+K4FkTHWCdi8fg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715722791; a=rsa-sha256; cv=none; b=rBgF9J005mWyj4EktAm3kcwjp/Bqhb5+6h3QI6QUzLsCDr8xYtc7lNagM/wcAp7jMN2WT2 B+trAf3rmP6RMc3byAbdfx+72vyqL96qlpP6mMUPWBcakkWoGbtRHxEy3aLbBrkr9YAAzt gAGkoFwABuJFE8pyhKTh0GE3oq37QU0rcaH2hLhWQ7PpUYrTSEx6/MeH0n5QzGG9ayCgqL Q4nzV8oXwTw1190OpqMrszEIaDQ/crhrui7UKlTskEGjwH4bR1lQZXsRZDgONe3n64KPeo ZBUYm5YazIOYoFLUKmOn0Y4nMKY4rBBRAhgUFR5JY8YoYNEkNMJryyfKoPhgcw== 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=1715722791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d+uF6v6Lt1euVMt4nwW7xhbTcu2P7qBrN5bAKzkbb+E=; b=KYKIsNZN+izySPXC4ZMyqj0/zG61q7EVKiibyhexaw3UBzycVELSkbE6zYv5DQsFWUHjGC YyoOBoJT7Glfh/PlnaYrqjhUr9JkLgXLn/xIWFLUFQTjVZth+MCtHqfn7ZQVmgyFalomIU 3cF79adXsLRt+pJje02HOUaOfefnZjFEdcL7Nf46y/HjMNUuAE8bydGQaDtTbuK+39EhPf X6C4nntlNhwziJ/jTGeZevMp+IfTfBzgsZIxkrRbYg7IdHgWtTfN9a94eU48LCJOeKT4dw 4j9SQ6IuapBtEvc/WOVjYhqoKEmFcZDH+NQZoAk2hTtj+yhBlh+SLwoo6oMarQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vf8s26QTtznj4; Tue, 14 May 2024 21:39: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 44ELdo09094473; Tue, 14 May 2024 21:39:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44ELdoev094470; Tue, 14 May 2024 21:39:50 GMT (envelope-from git) Date: Tue, 14 May 2024 21:39:50 GMT Message-Id: <202405142139.44ELdoev094470@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: c7f5f140bfdd - main - net80211: add initial key management suites from 802.11-2016, APIs to register them List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c7f5f140bfdde730dcd4380ac364a084488c962f Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=c7f5f140bfdde730dcd4380ac364a084488c962f commit c7f5f140bfdde730dcd4380ac364a084488c962f Author: Adrian Chadd AuthorDate: 2024-04-23 21:59:43 +0000 Commit: Adrian Chadd CommitDate: 2024-05-14 21:39:33 +0000 net80211: add initial key management suites from 802.11-2016, APIs to register them The WPA1/WPA2 driver capabilities aren't really enough in today's world. There are a /lot/ more key management suites to support! So, add initial support for net80211 and drivers to announce what key management suites are supported. These are the list from 802.11-2016 section 9.4.2.25.3 (AKM suites.) The flags are for software supported key management. Drivers may support more key management suites and are welcome to announce more; net80211 will only announce ones that we know net80211 knows "enough" about to support correctly. There /are/ other suites that may be interesting to some people in the future that are not part of this set - eg if anyone ever wants to support the Chinese WAPI standard - so this bitmap is not specifically just the AKM suites in the RSN OUI. This should eventually be communicated up to the wpa_supplicant and hostapd via a replacement driver/vap capabilities call so they know what to enable rather than just IEEE80211_C_WPA1 / IEEE80211_C_WPA2. Differential Revision: https://reviews.freebsd.org/D44919 Reviewed by: bz --- sys/net80211/_ieee80211.h | 21 +++++++++++++++++++++ sys/net80211/ieee80211.c | 12 ++++++++++++ sys/net80211/ieee80211_crypto.c | 35 +++++++++++++++++++++++++++++++++++ sys/net80211/ieee80211_crypto.h | 2 ++ sys/net80211/ieee80211_var.h | 4 ++++ 5 files changed, 74 insertions(+) diff --git a/sys/net80211/_ieee80211.h b/sys/net80211/_ieee80211.h index 1ac9328714f7..5c7e6110026d 100644 --- a/sys/net80211/_ieee80211.h +++ b/sys/net80211/_ieee80211.h @@ -536,6 +536,27 @@ struct ieee80211_mimo_info { "\21AMPDU\22AMSDU\23HT\24SMPS\25RIFS\32TXLDPC\33RXAMSDUAMPDU" \ "\34TXAMSDUAMPDU" +/* + * AKM (key management) suite capability list. + * + * These represent what's in 802.11-2016 - Table 9-133 - AKM Suite Selectors. + * Note that they do not match what the table values are, in case other key + * management suites want to be added with different OUIs. + */ +#define IEEE80211_KEYMGMT_RSN_UNSPEC_802_1X 0x00000001 /* RSN suite 1 */ +#define IEEE80211_KEYMGMT_RSN_PSK_OVER_802_1X 0x00000002 /* RSN suite 2 */ +#define IEEE80211_KEYMGMT_RSN_FT_OVER_802_1X 0x00000004 /* RSN suite 3 */ +#define IEEE80211_KEYMGMT_RSN_FT_PSK 0x00000008 /* RSN suite 4 */ +#define IEEE80211_KEYMGMT_RSN_802_1X_SHA256 0x00000010 /* RSN suite 5 */ +#define IEEE80211_KEYMGMT_RSN_PSK_SHA256 0x00000020 /* RSN suite 6 */ +#define IEEE80211_KEYMGMT_RSN_TPK_HANDSHAKE 0x00000040 /* RSN suite 7 */ +#define IEEE80211_KEYMGMT_RSN_SAE 0x00000080 /* RSN suite 8 */ +#define IEEE80211_KEYMGMT_RSN_FT_SAE 0x00000100 /* RSN suite 9 */ +#define IEEE80211_KEYMGMT_RSN_APPEERKEY_SHA256 0x00000200 /* RSN suite 10 */ +#define IEEE80211_KEYMGMT_RSN_802_1X_SUITE_B 0x00000400 /* RSN suite 11 */ +#define IEEE80211_KEYMGMT_RSN_802_1X_SUITE_B_192 0x00000800 /* RSN suite 12 */ +#define IEEE80211_KEYMGMT_RSN_FT_802_1X_SHA384 0x00001000 /* RSN suite 13 */ + /* * RX status notification - which fields are valid. */ diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c index 1c82493274bb..ecb46e08713c 100644 --- a/sys/net80211/ieee80211.c +++ b/sys/net80211/ieee80211.c @@ -456,6 +456,18 @@ ieee80211_set_hardware_ciphers(struct ieee80211com *ic, ieee80211_crypto_set_supported_hardware_ciphers(ic, cipher_suite); } +/* + * Called by drivers during attach to set the supported + * key management suites by the driver/hardware. + */ +void +ieee80211_set_driver_keymgmt_suites(struct ieee80211com *ic, + uint32_t keymgmt_set) +{ + ieee80211_crypto_set_supported_driver_keymgmt(ic, + keymgmt_set); +} + struct ieee80211com * ieee80211_find_com(const char *name) { diff --git a/sys/net80211/ieee80211_crypto.c b/sys/net80211/ieee80211_crypto.c index 3659d3f7c79a..829653ff1335 100644 --- a/sys/net80211/ieee80211_crypto.c +++ b/sys/net80211/ieee80211_crypto.c @@ -154,6 +154,25 @@ ieee80211_crypto_attach(struct ieee80211com *ic) */ ic->ic_sw_cryptocaps = IEEE80211_CRYPTO_WEP | IEEE80211_CRYPTO_TKIP | IEEE80211_CRYPTO_AES_CCM; + + /* + * Default set of key management types supported by net80211. + * + * These are supported by software net80211 and announced/ + * driven by hostapd + wpa_supplicant. + * + * Drivers doing full supplicant offload must not set + * anything here. + * + * Note that IEEE80211_C_WPA1 and IEEE80211_C_WPA2 are the + * "old" style way of drivers announcing key management + * capabilities. There are many, many more key management + * suites in 802.11-2016 (see 9.4.2.25.3 - AKM suites.) + * For now they still need to be set - these flags are checked + * when assembling a beacon to reserve space for the WPA + * vendor IE (WPA 1) and RSN IE (WPA 2). + */ + ic->ic_sw_keymgmtcaps = 0; } /* @@ -184,6 +203,22 @@ ieee80211_crypto_set_supported_hardware_ciphers(struct ieee80211com *ic, ic->ic_cryptocaps = cipher_set; } +/* + * Set the supported software key management by the driver. + * + * These are the key management suites that are supported via + * the driver via hostapd/wpa_supplicant. + * + * Key management which is completely offloaded (ie, the supplicant + * runs in hardware/firmware) must not be set here. + */ +void +ieee80211_crypto_set_supported_driver_keymgmt(struct ieee80211com *ic, + uint32_t keymgmt_set) +{ + + ic->ic_sw_keymgmtcaps = keymgmt_set; +} /* * Setup crypto support for a vap. diff --git a/sys/net80211/ieee80211_crypto.h b/sys/net80211/ieee80211_crypto.h index e09b822289d7..b69df0cff3bd 100644 --- a/sys/net80211/ieee80211_crypto.h +++ b/sys/net80211/ieee80211_crypto.h @@ -184,6 +184,8 @@ void ieee80211_crypto_set_supported_software_ciphers(struct ieee80211com *, uint32_t cipher_set); void ieee80211_crypto_set_supported_hardware_ciphers(struct ieee80211com *, uint32_t cipher_set); +void ieee80211_crypto_set_supported_driver_keymgmt(struct ieee80211com *, + uint32_t keymgmt_set); void ieee80211_crypto_vattach(struct ieee80211vap *); void ieee80211_crypto_vdetach(struct ieee80211vap *); int ieee80211_crypto_newkey(struct ieee80211vap *, diff --git a/sys/net80211/ieee80211_var.h b/sys/net80211/ieee80211_var.h index 21fdff0b88a3..9273b43a5823 100644 --- a/sys/net80211/ieee80211_var.h +++ b/sys/net80211/ieee80211_var.h @@ -167,6 +167,8 @@ struct ieee80211com { uint32_t ic_sw_cryptocaps; uint32_t ic_cryptocaps; /* hardware crypto caps */ /* set of mode capabilities */ + /* driver/net80211 sw KEYMGMT capabilities */ + uint32_t ic_sw_keymgmtcaps; uint8_t ic_modecaps[IEEE80211_MODE_BYTES]; uint8_t ic_promisc; /* vap's needing promisc mode */ uint8_t ic_allmulti; /* vap's needing all multicast*/ @@ -755,6 +757,8 @@ void ieee80211_set_software_ciphers(struct ieee80211com *, uint32_t cipher_suite); void ieee80211_set_hardware_ciphers(struct ieee80211com *, uint32_t cipher_suite); +void ieee80211_set_driver_keymgmt_suites(struct ieee80211com *ic, + uint32_t keymgmt_set); int ieee80211_vap_setup(struct ieee80211com *, struct ieee80211vap *, const char name[IFNAMSIZ], int unit, enum ieee80211_opmode opmode, int flags, From nobody Tue May 14 22:00:39 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vf9K85S28z5L5G5; Tue, 14 May 2024 22:00:44 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vf9K84wdGz4Vk5; Tue, 14 May 2024 22:00:44 +0000 (UTC) (envelope-from bz@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715724044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7sqy2K42pNZek+lEkfNpy0AARPd3H8a794oyiCWOEUw=; b=ihvYUDEMmyIFk6LffO6ufYLIVZ7HFiRPOJH79nbCkdm2lxok2PrPGUUUs0/wCPf+WI904a ynLTAPCWdcPYpKcqBRYvKjds2C9XBljH/Z0embXCA2Zl/hBca4A5Ur8U0ff1FwTfdb8Ui1 oR036XGtWVlxJ8D3ru++RNxzTWHj+dEsRHDAeVdQCHDMhyLlTZWUnXfgYYHAp3RA4poLth WbH1Cw9icmgyJy1I9xTqdD2tGQRYLQAc2UAIz+PU0hxoHA5jKDRqwUVwknlRcqAyORWUwB VwWmVfb+GtddMdjh7efqLj53VVULBzbg3EszOg7S+iGej5cQjMlmsdPCkpvFZw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715724044; a=rsa-sha256; cv=none; b=iEf9lvCcTap+gZANeJNatdhfoeaQ6Cy/xAox+IikVp1rsliulMNLTzKCGABALVDvrc20zP BAJn+NWthPSYARkfYD1mpjjWYTs62HVsUVcNsz7nFks/Zm8LwGPtse7eL+JuzMRnW3Qf/j tLzlepcXEtN1KIQQkZI1jujzrudC2P6N7rIBm0/0pODpApV29R90cMWMEdMuhkzLW6prbY dEndksB8+Tfb+yFNuqwPvLPoZuwaHFHelRySRuVK5f858pATCyDWjwL5ivpKC3MFX2uh+O tCvF10Al8Qk5X/6blIWWvO9ZYmteTDmJsCchhEe2Ri6vJ9RJa8hi0YPi6y47Dw== 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=1715724044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7sqy2K42pNZek+lEkfNpy0AARPd3H8a794oyiCWOEUw=; b=tuBox7f5w4/yPtPS/ZtCgCgK3AjGdQY1qteSQOei1iZm8s+5ZQIxKPWCJnjOMUTPj90b27 XMr3GNlVOS8xrJxyQk2daIBhl+1VroyJ4e1o0xnJ4e4JpFlUpzOGaEMdvsu5cByYkGvFeN zp5jcJVZjC3Pfkq6R92crBAd8ImqfExikMF8huumJ7K517tgn6UGVsBHo91pKswH2ilCXu XiJ/f7awcD4u4FBbZZnNdmKxqtRVB54+p9XvrAD8tIpGD4fC1vYJ4L8N9qqRqKo98v4mJW myNypWJSw6tLaw1/6Czdzi84jtEqn3850QGUaWKW3v275cQNlVjbZoaP5PKTMw== Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:13b:39f::9f:25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE Root Certificate Authority" (not verified)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Vf9K8384wz1873; Tue, 14 May 2024 22:00:44 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id D3F838D4A126; Tue, 14 May 2024 22:00:42 +0000 (UTC) Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id AFB1A2D029D8; Tue, 14 May 2024 22:00:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id wdKoiHiyvUpQ; Tue, 14 May 2024 22:00:40 +0000 (UTC) Received: from strong-iwl0.sbone.de (strong-iwl0.sbone.de [IPv6:fde9:577b:c1a9:4902:b66b:fcff:fef3:e3d2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id E55E52D029D2; Tue, 14 May 2024 22:00:39 +0000 (UTC) Date: Tue, 14 May 2024 22:00:39 +0000 (UTC) From: "Bjoern A. Zeeb" To: Adrian Chadd cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: c7f5f140bfdd - main - net80211: add initial key management suites from 802.11-2016, APIs to register them In-Reply-To: <202405142139.44ELdoev094470@gitrepo.freebsd.org> Message-ID: References: <202405142139.44ELdoev094470@gitrepo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed On Tue, 14 May 2024, Adrian Chadd wrote: > The branch main has been updated by adrian: > > URL: https://cgit.FreeBSD.org/src/commit/?id=c7f5f140bfdde730dcd4380ac364a084488c962f > > commit c7f5f140bfdde730dcd4380ac364a084488c962f > Author: Adrian Chadd > AuthorDate: 2024-04-23 21:59:43 +0000 > Commit: Adrian Chadd > CommitDate: 2024-05-14 21:39:33 +0000 > > net80211: add initial key management suites from 802.11-2016, APIs to register them > > The WPA1/WPA2 driver capabilities aren't really enough in today's world. > There are a /lot/ more key management suites to support! > > So, add initial support for net80211 and drivers to announce what > key management suites are supported. These are the list from 802.11-2016 > section 9.4.2.25.3 (AKM suites.) > > The flags are for software supported key management. > > Drivers may support more key management suites and are welcome to > announce more; net80211 will only announce ones that we know > net80211 knows "enough" about to support correctly. > > There /are/ other suites that may be interesting to some people in > the future that are not part of this set - eg if anyone ever > wants to support the Chinese WAPI standard - so this bitmap is not > specifically just the AKM suites in the RSN OUI. > > This should eventually be communicated up to the wpa_supplicant and > hostapd via a replacement driver/vap capabilities call so they know > what to enable rather than just IEEE80211_C_WPA1 / IEEE80211_C_WPA2. > > Differential Revision: https://reviews.freebsd.org/D44919 > Reviewed by: bz No. Leaving a comment doesn't mean Reviewed. Especially if it gets changed again after. > --- > sys/net80211/_ieee80211.h | 21 +++++++++++++++++++++ > sys/net80211/ieee80211.c | 12 ++++++++++++ > sys/net80211/ieee80211_crypto.c | 35 +++++++++++++++++++++++++++++++++++ > sys/net80211/ieee80211_crypto.h | 2 ++ > sys/net80211/ieee80211_var.h | 4 ++++ > 5 files changed, 74 insertions(+) > > diff --git a/sys/net80211/_ieee80211.h b/sys/net80211/_ieee80211.h > index 1ac9328714f7..5c7e6110026d 100644 > --- a/sys/net80211/_ieee80211.h > +++ b/sys/net80211/_ieee80211.h > @@ -536,6 +536,27 @@ struct ieee80211_mimo_info { > "\21AMPDU\22AMSDU\23HT\24SMPS\25RIFS\32TXLDPC\33RXAMSDUAMPDU" \ > "\34TXAMSDUAMPDU" > > +/* > + * AKM (key management) suite capability list. > + * > + * These represent what's in 802.11-2016 - Table 9-133 - AKM Suite Selectors. > + * Note that they do not match what the table values are, in case other key > + * management suites want to be added with different OUIs. > + */ > +#define IEEE80211_KEYMGMT_RSN_UNSPEC_802_1X 0x00000001 /* RSN suite 1 */ > +#define IEEE80211_KEYMGMT_RSN_PSK_OVER_802_1X 0x00000002 /* RSN suite 2 */ > +#define IEEE80211_KEYMGMT_RSN_FT_OVER_802_1X 0x00000004 /* RSN suite 3 */ > +#define IEEE80211_KEYMGMT_RSN_FT_PSK 0x00000008 /* RSN suite 4 */ > +#define IEEE80211_KEYMGMT_RSN_802_1X_SHA256 0x00000010 /* RSN suite 5 */ > +#define IEEE80211_KEYMGMT_RSN_PSK_SHA256 0x00000020 /* RSN suite 6 */ > +#define IEEE80211_KEYMGMT_RSN_TPK_HANDSHAKE 0x00000040 /* RSN suite 7 */ > +#define IEEE80211_KEYMGMT_RSN_SAE 0x00000080 /* RSN suite 8 */ > +#define IEEE80211_KEYMGMT_RSN_FT_SAE 0x00000100 /* RSN suite 9 */ > +#define IEEE80211_KEYMGMT_RSN_APPEERKEY_SHA256 0x00000200 /* RSN suite 10 */ > +#define IEEE80211_KEYMGMT_RSN_802_1X_SUITE_B 0x00000400 /* RSN suite 11 */ > +#define IEEE80211_KEYMGMT_RSN_802_1X_SUITE_B_192 0x00000800 /* RSN suite 12 */ > +#define IEEE80211_KEYMGMT_RSN_FT_802_1X_SHA384 0x00001000 /* RSN suite 13 */ > + > /* > * RX status notification - which fields are valid. > */ > diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c > index 1c82493274bb..ecb46e08713c 100644 > --- a/sys/net80211/ieee80211.c > +++ b/sys/net80211/ieee80211.c > @@ -456,6 +456,18 @@ ieee80211_set_hardware_ciphers(struct ieee80211com *ic, > ieee80211_crypto_set_supported_hardware_ciphers(ic, cipher_suite); > } > > +/* > + * Called by drivers during attach to set the supported > + * key management suites by the driver/hardware. > + */ > +void > +ieee80211_set_driver_keymgmt_suites(struct ieee80211com *ic, > + uint32_t keymgmt_set) > +{ > + ieee80211_crypto_set_supported_driver_keymgmt(ic, > + keymgmt_set); > +} > + > struct ieee80211com * > ieee80211_find_com(const char *name) > { > diff --git a/sys/net80211/ieee80211_crypto.c b/sys/net80211/ieee80211_crypto.c > index 3659d3f7c79a..829653ff1335 100644 > --- a/sys/net80211/ieee80211_crypto.c > +++ b/sys/net80211/ieee80211_crypto.c > @@ -154,6 +154,25 @@ ieee80211_crypto_attach(struct ieee80211com *ic) > */ > ic->ic_sw_cryptocaps = IEEE80211_CRYPTO_WEP | > IEEE80211_CRYPTO_TKIP | IEEE80211_CRYPTO_AES_CCM; > + > + /* > + * Default set of key management types supported by net80211. > + * > + * These are supported by software net80211 and announced/ > + * driven by hostapd + wpa_supplicant. > + * > + * Drivers doing full supplicant offload must not set > + * anything here. > + * > + * Note that IEEE80211_C_WPA1 and IEEE80211_C_WPA2 are the > + * "old" style way of drivers announcing key management > + * capabilities. There are many, many more key management > + * suites in 802.11-2016 (see 9.4.2.25.3 - AKM suites.) > + * For now they still need to be set - these flags are checked > + * when assembling a beacon to reserve space for the WPA > + * vendor IE (WPA 1) and RSN IE (WPA 2). > + */ > + ic->ic_sw_keymgmtcaps = 0; > } > > /* > @@ -184,6 +203,22 @@ ieee80211_crypto_set_supported_hardware_ciphers(struct ieee80211com *ic, > ic->ic_cryptocaps = cipher_set; > } > > +/* > + * Set the supported software key management by the driver. > + * > + * These are the key management suites that are supported via > + * the driver via hostapd/wpa_supplicant. > + * > + * Key management which is completely offloaded (ie, the supplicant > + * runs in hardware/firmware) must not be set here. > + */ > +void > +ieee80211_crypto_set_supported_driver_keymgmt(struct ieee80211com *ic, > + uint32_t keymgmt_set) > +{ > + > + ic->ic_sw_keymgmtcaps = keymgmt_set; > +} > > /* > * Setup crypto support for a vap. > diff --git a/sys/net80211/ieee80211_crypto.h b/sys/net80211/ieee80211_crypto.h > index e09b822289d7..b69df0cff3bd 100644 > --- a/sys/net80211/ieee80211_crypto.h > +++ b/sys/net80211/ieee80211_crypto.h > @@ -184,6 +184,8 @@ void ieee80211_crypto_set_supported_software_ciphers(struct ieee80211com *, > uint32_t cipher_set); > void ieee80211_crypto_set_supported_hardware_ciphers(struct ieee80211com *, > uint32_t cipher_set); > +void ieee80211_crypto_set_supported_driver_keymgmt(struct ieee80211com *, > + uint32_t keymgmt_set); > void ieee80211_crypto_vattach(struct ieee80211vap *); > void ieee80211_crypto_vdetach(struct ieee80211vap *); > int ieee80211_crypto_newkey(struct ieee80211vap *, > diff --git a/sys/net80211/ieee80211_var.h b/sys/net80211/ieee80211_var.h > index 21fdff0b88a3..9273b43a5823 100644 > --- a/sys/net80211/ieee80211_var.h > +++ b/sys/net80211/ieee80211_var.h > @@ -167,6 +167,8 @@ struct ieee80211com { > uint32_t ic_sw_cryptocaps; > uint32_t ic_cryptocaps; /* hardware crypto caps */ > /* set of mode capabilities */ > + /* driver/net80211 sw KEYMGMT capabilities */ > + uint32_t ic_sw_keymgmtcaps; > uint8_t ic_modecaps[IEEE80211_MODE_BYTES]; > uint8_t ic_promisc; /* vap's needing promisc mode */ > uint8_t ic_allmulti; /* vap's needing all multicast*/ > @@ -755,6 +757,8 @@ void ieee80211_set_software_ciphers(struct ieee80211com *, > uint32_t cipher_suite); > void ieee80211_set_hardware_ciphers(struct ieee80211com *, > uint32_t cipher_suite); > +void ieee80211_set_driver_keymgmt_suites(struct ieee80211com *ic, > + uint32_t keymgmt_set); > int ieee80211_vap_setup(struct ieee80211com *, struct ieee80211vap *, > const char name[IFNAMSIZ], int unit, > enum ieee80211_opmode opmode, int flags, > -- Bjoern A. Zeeb r15:7 From nobody Tue May 14 23:06:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VfBnQ2h63z5L9V1; Tue, 14 May 2024 23:06: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 4VfBnQ25fHz4dD5; Tue, 14 May 2024 23:06:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715728010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p258t6AK99dka3dN5y460Rn8Ju38OlFeVamykz1z30M=; b=DbvoG++E1445O6HRastrs/EyxvP33MQpOyiHZsJufIqg5VWfR4Qn0HmR+mk/lrIVGtkGSF 3E32CAxKpcIbyKqNs79PyL5e7nrIPv6viJPFGK0ZQlGVlrqD9tVrEhutLhc8n2yNEc5LwE toiLhZFarC0k4ETUPg/d+Jwey3PlE5p4wEGLNpGuZbFDoOz/SmE2boZ6eGSYeS1p4w4ZT6 s00ZxhvfLv879OY53OgUsa4KIZxHVIH/yV1JxUm5KvkBdUgWO+mwOIZVkS7TI21GGr/18t A17nRd6zGSYP6+qcPqKccfhXnrF7oBjfIMCQMTQt6bOHZCZTVgqicEEqj17rFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715728010; a=rsa-sha256; cv=none; b=Q0LsaRPRxhiLczoDuJmXYidvvh7R8E5hm0cf7FWRrMvfCT/CvD5xzia/ligtpMDWr6DZRN UG7hgpWLjuJJV+fnmUc7TFFrocVGGHjQ6GI21tOmhxPfB+pEMkSAspjjKIWKjofxnf6q5i ZtvRPLBKIU4ZvGkXpAps6WfdUBbD7MmZZqIVRQ5tmMEoSqY02CAUJV4FvEAmsyCfuD3sba 5UsAJpJIkkYh4F4/iDsl4gojIzuudBgX2iXK5BQohEfDRDrgVSLIbuMxhqi+fAa5sy2xU7 zJicUDvPnV+y7aPiMdc3dfZs6NsQWZfF6zBCFrjcZKqZQNtiIcIFlDVtITT30A== 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=1715728010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p258t6AK99dka3dN5y460Rn8Ju38OlFeVamykz1z30M=; b=ofa1sYvDZhil6jRdQibULfDdILYdRDDzMhK//ZcMTzCoQ/jK6a98YKGD0/vDXR8Ce8ZK2M V+TsiV+fKH3jnqkT7FcnbOmfppRvHt4sU44Pp3GzpPWsj7RE8b0y1Fs5jqjfv6M+pVPcp2 SztiTvv3msH6jvMryx0dXdNDVM0bDNdSWCvDY+ydECj9RckqYay67tslhxWhaJlkT+lnUT BVEG6CN4bqwPJLoP+xE6TSlAwSJsVSfOAACvJIdjIMJFwtCP7FkaRIPLj3poU9YueM+NbT w4jx/E/svodXMCRxezOjsf4GdEIFSKAeH1zNTkFa2Wtrd8L6hZi+4tNpdR2E/A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VfBnQ1jKhzrMx; Tue, 14 May 2024 23:06: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 44EN6oJM047494; Tue, 14 May 2024 23:06:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EN6oAS047492; Tue, 14 May 2024 23:06:50 GMT (envelope-from git) Date: Tue, 14 May 2024 23:06:50 GMT Message-Id: <202405142306.44EN6oAS047492@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: c6113ac5a2c2 - main - AMD CPUs: update bits and data from CPUID 0x8000_0008 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c6113ac5a2c2bfee875979ebd40a007ef4d60069 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c6113ac5a2c2bfee875979ebd40a007ef4d60069 commit c6113ac5a2c2bfee875979ebd40a007ef4d60069 Author: Konstantin Belousov AuthorDate: 2024-05-13 23:02:16 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-14 23:06:23 +0000 AMD CPUs: update bits and data from CPUID 0x8000_0008 from AMD APM vol3 doc no 24594 Rev. 3.36 March 2024 Reviewed and tested by: emaste Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D45188 --- sys/x86/include/specialreg.h | 17 +++++++++++++++++ sys/x86/include/x86_var.h | 1 + sys/x86/x86/identcpu.c | 12 ++++++++++++ 3 files changed, 30 insertions(+) diff --git a/sys/x86/include/specialreg.h b/sys/x86/include/specialreg.h index b4b95670e367..3115056ce14c 100644 --- a/sys/x86/include/specialreg.h +++ b/sys/x86/include/specialreg.h @@ -397,21 +397,31 @@ #define AMDFEID_CLZERO 0x00000001 #define AMDFEID_IRPERF 0x00000002 #define AMDFEID_XSAVEERPTR 0x00000004 +#define AMDFEID_INVLPGB 0x00000008 #define AMDFEID_RDPRU 0x00000010 +#define AMDFEID_BE 0x00000040 #define AMDFEID_MCOMMIT 0x00000100 #define AMDFEID_WBNOINVD 0x00000200 #define AMDFEID_IBPB 0x00001000 +#define AMDFEID_INT_WBINVD 0x00002000 #define AMDFEID_IBRS 0x00004000 #define AMDFEID_STIBP 0x00008000 /* The below are only defined if the corresponding base feature above exists. */ #define AMDFEID_IBRS_ALWAYSON 0x00010000 #define AMDFEID_STIBP_ALWAYSON 0x00020000 #define AMDFEID_PREFER_IBRS 0x00040000 +#define AMDFEID_SAMEMODE_IBRS 0x00080000 +#define AMDFEID_NO_LMSLE 0x00100000 +#define AMDFEID_INVLPGB_NEST 0x00200000 #define AMDFEID_PPIN 0x00800000 #define AMDFEID_SSBD 0x01000000 /* SSBD via MSRC001_011F instead of MSR 0x48: */ #define AMDFEID_VIRT_SSBD 0x02000000 #define AMDFEID_SSB_NO 0x04000000 +#define AMDFEID_CPPC 0x08000000 +#define AMDFEID_PSFD 0x10000000 +#define AMDFEID_BTC_NO 0x20000000 +#define AMDFEID_IBPB_RET 0x40000000 /* * AMD extended function 8000_0008h ecx info @@ -420,6 +430,13 @@ #define AMDID_COREID_SIZE 0x0000f000 #define AMDID_COREID_SIZE_SHIFT 12 +/* + * AMD extended function 8000_0008h edx info + */ +#define AMDID_INVLPGB_MAXCNT 0x0000ffff +#define AMDID_RDPRU_SHIFT 16 +#define AMDID_RDPRU_ID 0xffff0000 + /* * CPUID instruction 7 Structured Extended Features, leaf 0 ebx info */ diff --git a/sys/x86/include/x86_var.h b/sys/x86/include/x86_var.h index f3677d84570b..f19c557e270b 100644 --- a/sys/x86/include/x86_var.h +++ b/sys/x86/include/x86_var.h @@ -57,6 +57,7 @@ extern u_int cpu_max_ext_state_size; extern u_int cpu_mxcsr_mask; extern u_int cpu_procinfo; extern u_int cpu_procinfo2; +extern u_int cpu_procinfo3; extern char cpu_vendor[]; extern char cpu_model[]; extern u_int cpu_vendor_id; diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c index 953736d6b25c..4da250c535a0 100644 --- a/sys/x86/x86/identcpu.c +++ b/sys/x86/x86/identcpu.c @@ -106,6 +106,7 @@ u_int cpu_exthigh; /* Highest arg to extended CPUID */ u_int cpu_id; /* Stepping ID */ u_int cpu_procinfo; /* HyperThreading Info / Brand Index / CLFUSH */ u_int cpu_procinfo2; /* Multicore info */ +u_int cpu_procinfo3; char cpu_vendor[20]; /* CPU Origin code */ u_int cpu_vendor_id; /* CPU vendor ID */ u_int cpu_mxcsr_mask; /* Valid bits in mxcsr */ @@ -1089,19 +1090,29 @@ printcpuinfo(void) "\001CLZERO" "\002IRPerf" "\003XSaveErPtr" + "\004INVLPGB" "\005RDPRU" + "\007BE" "\011MCOMMIT" "\012WBNOINVD" "\015IBPB" + "\016INT_WBINVD" "\017IBRS" "\020STIBP" "\021IBRS_ALWAYSON" "\022STIBP_ALWAYSON" "\023PREFER_IBRS" + "\024SAMEMODE_IBRS" + "\025NOLMSLE" + "\026INVLPGBNEST" "\030PPIN" "\031SSBD" "\032VIRT_SSBD" "\033SSB_NO" + "\034CPPC" + "\035PSFD" + "\036BTC_NO" + "\037IBPB_RET" ); } @@ -1664,6 +1675,7 @@ finishidentcpu(void) cpu_maxphyaddr = regs[0] & 0xff; amd_extended_feature_extensions = regs[1]; cpu_procinfo2 = regs[2]; + cpu_procinfo3 = regs[3]; } else { cpu_maxphyaddr = (cpu_feature & CPUID_PAE) != 0 ? 36 : 32; } From nobody Tue May 14 23:22:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VfC7l2G8mz5LBQh; Tue, 14 May 2024 23:22: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 4VfC7l1KpNz4gXy; Tue, 14 May 2024 23:22:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715728963; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iYJ6LLcvClaWzcHeD5CqBEvnutFQQ89x34YvN0Nn3eQ=; b=WukNJwZZwGccMjiBIXs1OIlKyMzG+KMMTsrZcZKASwrmZz1xnpvzgrrGN7YD2zMPIe18Xu 5vAqzEqb3gwkZ5ie46dvjEXfg83E0ZAhTWPKzk6Ko64JlsL8jtmpAaNNMJM265y8MsVzf0 E6hoP+56V3HRHFNqgBzIPT77ryvoelaU7EsE9vXxf/R6Lr8reEmrxU03ZfajQ6Et0JBh/E z2dRHOBrBdJx8dMjT5XcxtBRzHCbpnH0g/5XW8HpDp3MzE7BlINADBoXohfyKBXsB2DVOZ C8vGUPCCEyef+id4toYm7U5RKz7nCy7akwC5VGz/w6aUUhWSlvyZEru4zAiz0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715728963; a=rsa-sha256; cv=none; b=xvXaQfIRXVpbnWdtkC6XR6shhG5FkdVXJ7NJcCch/d8lMnEIHtJTfPK06lg1iTS+0vxI8B XDvEk+tkWvtwdshh87Bddr2Xu33sUZ11F9o/gxNoGKXBx8ZULMPx/9pm5IlRkcHLloJUKu sAYfP3/z/kPBusA2CXG8r1GNEUNGG5AQzWO1H1j7riCnXpe9wocnwt+cnuM5Ne6NVG3Ofe UQsad3VfGEwGb5d0idVL6k7n0BZN+SwNbNs2jydM6Q4Kv4WjGrDqVzNoDvxVUzyH5wvWUe 5W8eeayQcfv3LCrR3xDD5b/YtTu6JyG+3dh50XOvznZzmf3ChqTUMBUoDAv2sg== 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=1715728963; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iYJ6LLcvClaWzcHeD5CqBEvnutFQQ89x34YvN0Nn3eQ=; b=jRoaXQynUaNW6dUHYq5ieL+JEBY23UT4Gls9Oa6ominatt/fx65wrzvTNuk6ZIkd22iL3n EEU5jPuMShLmVIXQGP/vf7rOiJQ9inI8+pcP+z5xyuV3rw14MeOXDWrrWDAcVvQ3VRyqBM DjG+nBhohO9Z1ln8ZKA89MqL44WPnYxknsYY6vr5RLuj9vi/8dRbQkacxP8XA4roHDFtSY bXAiflMSAeu9EyFOlLj6xIkH1v+XZOO71ZFftqA1WFNMfUwSpD4z9n4SCHu/o7jhgR7ow4 3WUbUPIp0SYyNkvU60rXk0ydegCXgzPnt1NY6IL85KqRejLNX/4XzciQzn7BDQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VfC7l0dRlzrt7; Tue, 14 May 2024 23:22: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 44ENMg3C080089; Tue, 14 May 2024 23:22:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44ENMgqM080086; Tue, 14 May 2024 23:22:42 GMT (envelope-from git) Date: Tue, 14 May 2024 23:22:42 GMT Message-Id: <202405142322.44ENMgqM080086@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 5af6fbd72790 - main - ssp: appease -Wgnu-statement-expression-from-macro-expansion List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5af6fbd72790173e128222943effc5aa95272ce9 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=5af6fbd72790173e128222943effc5aa95272ce9 commit 5af6fbd72790173e128222943effc5aa95272ce9 Author: Kyle Evans AuthorDate: 2024-05-14 23:16:58 +0000 Commit: Kyle Evans CommitDate: 2024-05-14 23:22:18 +0000 ssp: appease -Wgnu-statement-expression-from-macro-expansion It's a stupid warning, but some ports enable it by default and were already defining _FORTIFY_SOURCE, thus exposing the new macros immediately. This at least fixes the libfido2 build, perhaps others as well. While we're here, fix a fresh build of stand w/ FORTIFY_SOURCE enabled by not pulling in the ssp headers if _STANDALONE is defined. We do not have runtime support in libsa as of the time of writing. Reported by: netchild Sponsored by: Stormshield Sponsored by: Klara, Inc. --- include/ssp/stdio.h | 10 +++++----- include/ssp/string.h | 4 ++-- include/ssp/strings.h | 4 ++-- include/stdio.h | 2 +- include/string.h | 2 +- include/strings.h | 2 +- include/unistd.h | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/ssp/stdio.h b/include/ssp/stdio.h index ed7303497a45..4bca1de7d4f9 100644 --- a/include/ssp/stdio.h +++ b/include/ssp/stdio.h @@ -53,31 +53,31 @@ __END_DECLS #if __SSP_FORTIFY_LEVEL > 0 -#define sprintf(str, ...) ({ \ +#define sprintf(str, ...) __extension__ ({ \ char *_ssp_str = (str); \ __builtin___sprintf_chk(_ssp_str, 0, __ssp_bos(_ssp_str), \ __VA_ARGS__); \ }) -#define vsprintf(str, fmt, ap) ({ \ +#define vsprintf(str, fmt, ap) __extension__ ({ \ char *_ssp_str = (str); \ __builtin___vsprintf_chk(_ssp_str, 0, __ssp_bos(_ssp_str), fmt, \ ap); \ }) -#define snprintf(str, len, ...) ({ \ +#define snprintf(str, len, ...) __extension__ ({ \ char *_ssp_str = (str); \ __builtin___snprintf_chk(_ssp_str, len, 0, __ssp_bos(_ssp_str), \ __VA_ARGS__); \ }) -#define vsnprintf(str, len, fmt, ap) ({ \ +#define vsnprintf(str, len, fmt, ap) __extension__ ({ \ char *_ssp_str = (str); \ __builtin___vsnprintf_chk(_ssp_str, len, 0, __ssp_bos(_ssp_str), \ fmt, ap); \ }) -#define fgets(str, len, fp) ({ \ +#define fgets(str, len, fp) __extension__ ({ \ char *_ssp_str = (str); \ __fgets_chk(_ssp_str, len, __ssp_bos(_ssp_str), fp); \ }) diff --git a/include/ssp/string.h b/include/ssp/string.h index 996020fda778..ceb4ba2a2174 100644 --- a/include/ssp/string.h +++ b/include/ssp/string.h @@ -51,7 +51,7 @@ __END_DECLS #if __SSP_FORTIFY_LEVEL > 0 #define __ssp_bos_check3_typed_var(fun, dsttype, dsrvar, dst, srctype, srcvar, \ - src, lenvar, len) ({ \ + src, lenvar, len) __extension__ ({ \ srctype srcvar = (src); \ dsttype dstvar = (dst); \ size_t lenvar = (len); \ @@ -69,7 +69,7 @@ __END_DECLS __ssp_bos_check3_typed_var(fun, void *, __ssp_var(dstv), dst, \ const void *, __ssp_var(srcv), src, __ssp_var(lenv), len) -#define __ssp_bos_check2_var(fun, dstvar, dst, srcvar, src) ({ \ +#define __ssp_bos_check2_var(fun, dstvar, dst, srcvar, src) __extension__ ({ \ const void *srcvar = (src); \ void *dstvar = (dst); \ ((__ssp_bos0(dstvar) != (size_t)-1) ? \ diff --git a/include/ssp/strings.h b/include/ssp/strings.h index 06c9c7cc0a09..51b11a14ee87 100644 --- a/include/ssp/strings.h +++ b/include/ssp/strings.h @@ -39,7 +39,7 @@ #if __SSP_FORTIFY_LEVEL > 0 -#define _ssp_bcopy(srcvar, src, dstvar, dst, lenvar, len) ({ \ +#define _ssp_bcopy(srcvar, src, dstvar, dst, lenvar, len) __extension__ ({ \ const void *srcvar = (src); \ void *dstvar = (dst); \ size_t lenvar = (len); \ @@ -52,7 +52,7 @@ #define bcopy(src, dst, len) \ _ssp_bcopy(__ssp_var(srcv), src, __ssp_var(dstv), dst, __ssp_var(lenv), len) -#define _ssp_bzero(dstvar, dst, lenvar, len) ({ \ +#define _ssp_bzero(dstvar, dst, lenvar, len) __extension__ ({ \ void *dstvar = (dst); \ size_t lenvar = (len); \ ((__ssp_bos0(dstvar) != (size_t)-1) ? \ diff --git a/include/stdio.h b/include/stdio.h index 30bc638082d8..ea53816cf1d4 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -530,7 +530,7 @@ extern int __isthreaded; __END_DECLS __NULLABILITY_PRAGMA_POP -#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 +#if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 #include #endif #endif /* !_STDIO_H_ */ diff --git a/include/string.h b/include/string.h index a595f6e3e260..ce605117daa6 100644 --- a/include/string.h +++ b/include/string.h @@ -168,7 +168,7 @@ errno_t memset_s(void *, rsize_t, int, rsize_t); #endif /* __EXT1_VISIBLE */ __END_DECLS -#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 +#if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 #include #endif #endif /* _STRING_H_ */ diff --git a/include/strings.h b/include/strings.h index 6fe6a09e7dd3..511f7c03cb3c 100644 --- a/include/strings.h +++ b/include/strings.h @@ -68,7 +68,7 @@ int strncasecmp(const char *, const char *, size_t) __pure; #endif __END_DECLS -#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 +#if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 #include #endif #endif /* _STRINGS_H_ */ diff --git a/include/unistd.h b/include/unistd.h index 59738cbf6e68..48155bb2971b 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -37,7 +37,7 @@ #include #include -#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 +#if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 #include #endif From nobody Wed May 15 00:33:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VfDjD3sg5z5LGv0; Wed, 15 May 2024 00:33:20 +0000 (UTC) (envelope-from jrm@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VfDjD1kj1z4q7d; Wed, 15 May 2024 00:33:20 +0000 (UTC) (envelope-from jrm@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715733200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3CxPJKNBYV6N47kuhv9u5lv5qb7H9iDE62bjM2DOEO0=; b=kV0j784l8LjaJSxNs5gPtwsjTgqou/zR97UhqyDy+YdQN9x8nZvCby8jVm1P7rW7x2b9Mp PdyGs3fUwMQWsGXEOL9KziBtOHxGvcVZUeld8BYbtaXfYsTHsJ4c7u2rr0tzZyJOruOXp7 Tckrb4hu/PIWQBGMT4eTFfd0Hn3zsNHSkttoj/t8A0ebbMqYdvSCvNpVsqtiJt/t0CEu8T rTMQKyQMO+4gjUdsqeuht8JzMZ9UQDsTzVbsruxSegFy59AEA/6QnPfsODPez/tMJv8Nbf QlJLtYaiKJfVyKTAtyKwPBpUtbCBzi0vCPDIOMYOk/EtPO2vvCYlJybY4Wy9wA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715733200; a=rsa-sha256; cv=none; b=UZLDtB5WpEGys6YXXaGI4kovvWCn8JHey/+bmpVQPnz0QVUP7Hw41TThbRsloHV43me17p FTFVr+/tnw4J/FZ1pyq75/iIuqVVmJE0kGx0DlQx1lOM6wYYc/PJ7vuQfFV9MLCqHyvzQy dMw+3tgDYcWX7BqWeVBxuf2QgwuoNv4yJI+bIMcak7vAfgR+ZiPHs4prP4FWEjDwhvFzxJ VoFkjg53h/tGjQV1yuSoMUxSWgADu62WOlEDjnT8GsAUB9EJu3y4iXCYw8XHOvwAMSAgEM GSkYfooJj1iKje619QyuJvRZkbQGAQ5XzggSQ/UV2lQ0sJvz3T/gKcQiy2HaUA== 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=1715733200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3CxPJKNBYV6N47kuhv9u5lv5qb7H9iDE62bjM2DOEO0=; b=ozq5zHvId52/35EGO3Hea7n+BM5AgMiw/w5hvm+S0JG3QKGIrCsmjEKeqZfbojXHMR9dUL nnmlCR/8SR8/Vy3/4+OjqKwaM+Ieb2axkIGXsnfwz5566BftVFFLowWZ3XrpseJoCZZbBq BPMdcLI9UxPh+Rae2vT/iTu4Hd2l+T/X11d1fgRNTLle463UiqF9sg17VhW3X+hbW9LkKR wU6GbX1yju/u9dxxO8JWLzk3UNr0GcyNJgXMwjdDgv7VqJyjga/tHH+259k1Yzw2Iywr35 UjuARN0NQRxTZb7wx77MOlhgfjncZjsp++A6P1gdVcn+tZ8ORqPgoiYx8VHmHA== Received: from phe.ftfl.ca.ftfl.ca (drmons0544w-156-34-250-113.dhcp-dynamic.fibreop.ns.bellaliant.net [156.34.250.113]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: jrm/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4VfDjC6LPyz1CB2; Wed, 15 May 2024 00:33:19 +0000 (UTC) (envelope-from jrm@freebsd.org) From: Joseph Mingrone To: Baptiste Daroussin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 27358245644c - main - freebsd-tips: Add fortune to find font providing Unicode character In-Reply-To: <4bocuyegvknxvo3rjxnwdkdsx3qwx7nsra3hgyrznk53b4ah5c@rvhtufyftkqi> (Baptiste Daroussin's message of "Tue, 14 May 2024 08:55:21 +0200") References: <202405132302.44DN2NX6009088@gitrepo.freebsd.org> <4bocuyegvknxvo3rjxnwdkdsx3qwx7nsra3hgyrznk53b4ah5c@rvhtufyftkqi> Date: Tue, 14 May 2024 21:33:18 -0300 Message-ID: <86jzjvvrqp.fsf@phe.ftfl.ca> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue, 2024-05-14 at 08:55, Baptiste Daroussin wrote: > On Mon 13 May 23:02, Joseph Mingrone wrote: >> The branch main has been updated by jrm: >> URL: https://cgit.FreeBSD.org/src/commit/?id=3D27358245644c2a8bf2b57182e= 2fcd8cdf18d6b8d >> commit 27358245644c2a8bf2b57182e2fcd8cdf18d6b8d >> Author: Joseph Mingrone >> AuthorDate: 2024-05-13 18:38:13 +0000 >> Commit: Joseph Mingrone >> CommitDate: 2024-05-13 23:02:17 +0000 >> freebsd-tips: Add fortune to find font providing Unicode character >> Reviewed by: emaste >> Sponsored by: The FreeBSD Foundation >> Differential Revision: https://reviews.freebsd.org/D45183 >> --- >> usr.bin/fortune/datfiles/freebsd-tips | 14 ++++++++++++++ >> 1 file changed, 14 insertions(+) >> diff --git a/usr.bin/fortune/datfiles/freebsd-tips b/usr.bin/fortune/dat= files/freebsd-tips >> index 028a9e9b1430..e24d3640b8c6 100644 >> --- a/usr.bin/fortune/datfiles/freebsd-tips >> +++ b/usr.bin/fortune/datfiles/freebsd-tips >> @@ -845,3 +845,17 @@ kern.tty_info_kstacks to 0 (off), 1 (on), or 2 (ver= bose), e.g.: >> -- Michael Gmelin >> % >> + >> +Under X Windows, you can determine which fonts provide a particular Uni= code >> +character using fc-list from the fontconfig package. For example, if y= our >> +friend complains that the emoji you sent won't display, run fc-list wit= h the hex >> +value of the character to determine which font your friend should insta= ll. > This has nothing to do with X window, it is valid for anything that can u= se > fontconfig, which does not include xorg, but the toolkits or the librarie= s which > needs to deal with fonts, for instance many non "X windows" applications, > depends on fontconfig and this tips is valide for them, for example for > libraries producing podofo or poppler can use fontconfig to decide which = font to > embeded in the pdf document. > In my opinion the "Under X Windows" should be removed from this tips. The objective was to strike a balance between utmost precision and succinctness, so the tip is helpful. Indeed, fontconfig is not directly tied to X windows, but for practical purposes, I presumed the vast majority of user-facing applications using fontconfig run under X Windows (now that Wayland is a thing, I should have used a more generic phrase like "Under a graphical environment..."). Removing the qualifier seems to imply fc-list will always be useful, which isn't the case. Does the tweaked text that includes 'may be helpful' work for you? Joe ### To determine which fonts provide a particular Unicode character, fc-list from the fontconfig package may be helpful. For example, if your friend complains that the emoji you sent won't display, run fc-list with the hex value of the character to determine which font your friend should install. $ fc-list ':charset=3D0x1F4A1' /usr/local/share/fonts/noto/NotoColorEmoji.ttf: Noto Color Emoji:style=3DRe= gular $ pkg which /usr/local/share/fonts/noto/NotoColorEmoji.ttf /usr/local/share/fonts/noto/NotoColorEmoji.ttf was installed by package not= o-emoji-2.042 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKkBAEBCgCOFiEEVbCTpybDiFVxIrrVNqQMg7DW754FAmZEAs5fFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDU1 QjA5M0E3MjZDMzg4NTU3MTIyQkFENTM2QTQwQzgzQjBENkVGOUUQHGpybUBmcmVl YnNkLm9yZwAKCRA2pAyDsNbvnrwgEACkQQfDAXKGoB36clHRpxQmhlW6NcPMMnHP ZW0Y3kSFEOtocV1LxR1PrynpYTlwHGfBX6/PUmI4SWHr9sb1Cbk9chn3flSX4T6T SQ18pjhPAD7VJZQ1lr9PHMUgqqI9XjvMxHfk558JhjhXKKPA4F4JLODFmbLMV50h +iUPpMXvum0k54PkYguUp9RJChPq0GmxJRrffON4R4uYCMBRtFEfuzLl9UvT+Akr iCtQzKJAbJZ6MQBSuvFcviSelPkTtASiS1x0DIlT1ZfEDtvGoCJJ2IKSg7jp2xqH IiT2EcH4eRtx0918dPb+JEGz6wXsxDrFhTWH3Mx+kEDOP8FBKs524WF7bLrX3rPw Hj4xhGnEpJT6cvoki6ktdlvgCAA5xsiexGALwrZMgOeaKjPlInWuR58N8cEERbLY rmoytD0+v9q66DjobnjPBG0cANjHydQ46wagnU/35gzGveltoL6FEw9muQvHA+sB VhknFEiON6LzAIeJ//9xn349YXPG76K3kPY9jOL+yaHv7WZabqp9yoZ+JT0Ywnce fixWn66FbqoA1GNuU1LoeWfP2OC5Tt0ie+ulW8FiFMslB0XJHJ0X5iwmHJx6ZQLD ZKKvjgw5ouV8iXzaX7ZXiyoil60owJKsbmRgFneMwxmxbDhUPpdAecS104iqtyth Ekz3Fwnnhw== =X23v -----END PGP SIGNATURE----- --=-=-=-- From nobody Wed May 15 00:58:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VfFG41LZHz5LJkG; Wed, 15 May 2024 00:58:20 +0000 (UTC) (envelope-from lexi@le-fay.org) Received: from fuchsia.eden.le-Fay.ORG (fuchsia.eden.le-fay.org [IPv6:2001:8b0:aab5:107::11]) by mx1.freebsd.org (Postfix) with ESMTP id 4VfFG34N0zz4r8V; Wed, 15 May 2024 00:58:19 +0000 (UTC) (envelope-from lexi@le-fay.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=le-fay.org header.s=fuchsia header.b=tRrhli+F; dmarc=none; spf=pass (mx1.freebsd.org: domain of lexi@le-fay.org designates 2001:8b0:aab5:107::11 as permitted sender) smtp.mailfrom=lexi@le-fay.org Received: from iris.eden.le-Fay.ORG (iris.eden.le-fay.org [IPv6:2001:8b0:aab5:106:3::6]) by fuchsia.eden.le-Fay.ORG (Postfix) with ESMTP id 05B63FC60; Wed, 15 May 2024 00:58:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=le-fay.org; s=fuchsia; t=1715734699; bh=QOzWNgSFeW+4CCzgDeM/NV0LAswo99LDqRRMvLNWnLc=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=tRrhli+FUYCgnctSYd6JRioK83W2WbYL7D9ig8ncu2XaW79IkcLMU++ban37vRvZn rv8XQhRVY+0fAbs/NJRNScmTwErmKhJctyujHxdsP2Uu7udBWBxS1eruEtf3qXKSXK tolbmEqLSsWBxg2Hb3bBXAjNUTg+OFuOi1x59sHA= Received: from ilythia.eden.le-fay.org (ilythia.eden.le-fay.org [IPv6:2001:8b0:aab5:106:3::10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by iris.eden.le-Fay.ORG (Postfix) with ESMTPSA id 075C82C04D7; Wed, 15 May 2024 01:58:19 +0100 (BST) Date: Wed, 15 May 2024 01:58:18 +0100 From: Lexi Winter To: Joseph Mingrone Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 27358245644c - main - freebsd-tips: Add fortune to find font providing Unicode character Message-ID: References: <202405132302.44DN2NX6009088@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="DpegIw69DeiVqGvh" Content-Disposition: inline In-Reply-To: <202405132302.44DN2NX6009088@gitrepo.freebsd.org> X-Spamd-Bar: ----- X-Spamd-Result: default: False [-5.48 / 15.00]; SIGNED_PGP(-2.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.98)[-0.977]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; R_SPF_ALLOW(-0.20)[+ip6:2001:8b0:aab5:107::11:c]; R_DKIM_ALLOW(-0.20)[le-fay.org:s=fuchsia]; RCVD_NO_TLS_LAST(0.10)[]; ASN(0.00)[asn:20712, ipnet:2001:8b0::/32, country:GB]; DWL_DNSWL_NONE(0.00)[le-fay.org:dkim]; MISSING_XM_UA(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; DMARC_NA(0.00)[le-fay.org]; DKIM_TRACE(0.00)[le-fay.org:+] X-Rspamd-Queue-Id: 4VfFG34N0zz4r8V --DpegIw69DeiVqGvh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Joseph Mingrone: > The branch main has been updated by jrm: [...] > +Under X Windows, you can determine which fonts provide a particular Unicode separately to bapt's comment, there is no such thing as "X Windows". the correct terminology is "the X Window System" or simply "X" or "X11". --DpegIw69DeiVqGvh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCAAdFiEEuwt6MaPcv/+Mo+ftDHqbqZ41x5kFAmZECKcACgkQDHqbqZ41 x5lfZgwAjNei0dvHrrHwBB31JbDzWxYtPxcGjfu+fwm9OWMDoz7osSv3gkV7ie/j UlT2du38sSpsa4FVxnkjvdOgQH2ktT82BM/5FOoUBrgeA2uVtid3EQaBkCQVI93L bQcsA1BaVUIi0HrF9EVUEWQrrfJI9Omf4ttKSSPUVLIZGLj6lxdFaLso3LJ1GAl1 vbsDQ7YQ/cDsGY52e3RL0EyJsgFMEIhtrUXUEdHMbtopEljyTS7NT0g2rvqUEJ30 8UWAslWU0RzD92hdSK9djTJdamYJXfWCuUqsjyJJnPExQ1VYLT5Mqi8sR7f7EcLG vTMlK0CPGqKHfC0yjgpeuxWM5svls3k/c9xTNBu5m/xLlyo5p8z2jUfhtXnztNUL q6bQpNUUQHXMucSEcfYFdQapZWWSDxBFgZduhhPQdKPSNOWfXdyzrn4YYlUBz9cr VSs78stU28qwrqxYo2wPrA3PzF+gurvVzMBDV0aHHenM3oG2ScqeUg6GS5W2eJws FYac1C20 =0+Mq -----END PGP SIGNATURE----- --DpegIw69DeiVqGvh-- From nobody Wed May 15 04:35:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VfL5509gTz5K7Vk; Wed, 15 May 2024 04:35:53 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VfL546dp1z4CmW; Wed, 15 May 2024 04:35:52 +0000 (UTC) (envelope-from bapt@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715747752; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PxejGD6uoLf7tUHU+prvUvtZiwQ6OmUom7rgVOkKNeE=; b=cut+B4wK0h/REfxUNu+Le9trgGg0QXzfEt12jnSQZR6OGVCOXRZTVJnrvUMcl75A2/gqBf 0cbMSk7qBoI5mHgc2nFV3gUtQosSK/luAcJ+ibEWDFnk/awUnJfW7ybAkNDU+t6/Jgt0VN D2dRQm0UOQ1yCsFpY3gpjTS3bo4ecefkG45imCpG2li52ZMrNrX6HoDg3CDlmzS+/Wzbkc cw0CPR16MTuW7nNvJ63/cy40OChtTKljzg07WXJLB45ci9rWIjNYOO4V6hT8tqujPmolI7 CK7cargwePgSdfN5dv8qQfG7AbWJ0hKqxhofGpp2mO9LO+vZfK9h9NJwoWwr0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715747752; a=rsa-sha256; cv=none; b=wz+k0mfF97JKxSqCRITsdNWbljWMSPbftNU1C3mC5cXTxAglQ+tGh90qB8YsFZHRRoQzit 644r0e2szynqQic4K/T1gBAYLiT0seZ8b9GhESXQqHac+rm1etRDIu4cenrFeX0CtzqFeC d6zEFzUaPR3XyG0tQjXg0dszLKoIhUSocvQckOTWLegv9UWCYvQ+AIPaGrTniqT6Sm9lhT jRhGZbA4kp3yNC6te3GKik+Ucot1GdUxnvJRNsgAZpqgm1maGp3J/+w3U2VxTopX+m/uiG N4dV2aDa5lM1tRnPMXUL9FZZ5c1JEAZ6/zronToUVf717Zz/rUb6Aux/GJjg2g== 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=1715747752; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PxejGD6uoLf7tUHU+prvUvtZiwQ6OmUom7rgVOkKNeE=; b=ExoFcezMm/TI+5P+gW93vbAncZWavkTGHwANhwk1+4SClNEBv7gZ5qhtUtyoEcsO94QxSl tcB5SGLed52rZNk30KWFVXidkRYmQRRejrChyBfByh8+4p0+UrzqOwt249W2cE3ViWsWnv 8BQ11V2Qs8e8TCvRQehnLwNpW8iQdHo2u9eqTMzrl0YCiRxDgAP4cfQ8ehGS4a+fRkWGJu j8SrKZ7sfR4II+bsi7+sHYcelEAkb6/zucWYqHb+Ek1PQDCVZZnHXyqxCe+vzM3x/CciYW GimZEb83hseJSNNWnIjL9pXEEuF0/AHQsSxBIC6ArN3CHja2waYNpby+QtjdRw== Received: from aniel.nours.eu (nours.eu [176.31.115.77]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 4VfL545YwZz1HWd; Wed, 15 May 2024 04:35:52 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from [IPv6:::1] (2a02-8428-078f-2200-1e01-327f-4130-aa07.rev.sfr.net [IPv6:2a02:8428:78f:2200:1e01:327f:4130:aa07]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aniel.nours.eu (Postfix) with ESMTPSA id 894DE76172; Wed, 15 May 2024 06:35:50 +0200 (CEST) Date: Wed, 15 May 2024 06:35:52 +0200 From: Baptiste Daroussin To: Joseph Mingrone CC: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: =?US-ASCII?Q?Re=3A_git=3A_27358245644c_-_main_-_freebsd-tips=3A_Add?= =?US-ASCII?Q?_fortune_to_find_font_providing_Unicode_character?= User-Agent: K-9 Mail for Android In-Reply-To: <86jzjvvrqp.fsf@phe.ftfl.ca> References: <202405132302.44DN2NX6009088@gitrepo.freebsd.org> <4bocuyegvknxvo3rjxnwdkdsx3qwx7nsra3hgyrznk53b4ah5c@rvhtufyftkqi> <86jzjvvrqp.fsf@phe.ftfl.ca> Message-ID: <294DDE88-70C4-4180-87B0-DD43892C5738@FreeBSD.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Le 15 mai 2024 02:33:18 GMT+02:00, Joseph Mingrone a = =C3=A9crit=C2=A0: >On Tue, 2024-05-14 at 08:55, Baptiste Daroussin wrot= e: > >> On Mon 13 May 23:02, Joseph Mingrone wrote: >>> The branch main has been updated by jrm: > >>> URL: https://cgit=2EFreeBSD=2Eorg/src/commit/?id=3D27358245644c2a8bf2b= 57182e2fcd8cdf18d6b8d > >>> commit 27358245644c2a8bf2b57182e2fcd8cdf18d6b8d >>> Author: Joseph Mingrone >>> AuthorDate: 2024-05-13 18:38:13 +0000 >>> Commit: Joseph Mingrone >>> CommitDate: 2024-05-13 23:02:17 +0000 > >>> freebsd-tips: Add fortune to find font providing Unicode character > >>> Reviewed by: emaste >>> Sponsored by: The FreeBSD Foundation >>> Differential Revision: https://reviews=2Efreebsd=2Eorg/D45183 >>> --- >>> usr=2Ebin/fortune/datfiles/freebsd-tips | 14 ++++++++++++++ >>> 1 file changed, 14 insertions(+) > >>> diff --git a/usr=2Ebin/fortune/datfiles/freebsd-tips b/usr=2Ebin/fortu= ne/datfiles/freebsd-tips >>> index 028a9e9b1430=2E=2Ee24d3640b8c6 100644 >>> --- a/usr=2Ebin/fortune/datfiles/freebsd-tips >>> +++ b/usr=2Ebin/fortune/datfiles/freebsd-tips >>> @@ -845,3 +845,17 @@ kern=2Etty_info_kstacks to 0 (off), 1 (on), or 2 = (verbose), e=2Eg=2E: > >>> -- Michael Gmelin >>> % >>> + >>> +Under X Windows, you can determine which fonts provide a particular U= nicode >>> +character using fc-list from the fontconfig package=2E For example, = if your >>> +friend complains that the emoji you sent won't display, run fc-list w= ith the hex >>> +value of the character to determine which font your friend should ins= tall=2E > >> This has nothing to do with X window, it is valid for anything that can= use >> fontconfig, which does not include xorg, but the toolkits or the librar= ies which >> needs to deal with fonts, for instance many non "X windows" application= s, >> depends on fontconfig and this tips is valide for them, for example for >> libraries producing podofo or poppler can use fontconfig to decide whic= h font to >> embeded in the pdf document=2E > >> In my opinion the "Under X Windows" should be removed from this tips=2E > >The objective was to strike a balance between utmost precision and >succinctness, so the tip is helpful=2E Indeed, fontconfig is not directl= y >tied to X windows, but for practical purposes, I presumed the vast >majority of user-facing applications using fontconfig run under X >Windows (now that Wayland is a thing, I should have used a more generic >phrase like "Under a graphical environment=2E=2E=2E")=2E Removing the qu= alifier >seems to imply fc-list will always be useful, which isn't the case=2E >Does the tweaked text that includes 'may be helpful' work for you? > >Joe > >### > >To determine which fonts provide a particular Unicode character, fc-list >from the fontconfig package may be helpful=2E For example, if your frien= d >complains that the emoji you sent won't display, run fc-list with the >hex value of the character to determine which font your friend should >install=2E > >$ fc-list ':charset=3D0x1F4A1' >/usr/local/share/fonts/noto/NotoColorEmoji=2Ettf: Noto Color Emoji:style= =3DRegular > >$ pkg which /usr/local/share/fonts/noto/NotoColorEmoji=2Ettf >/usr/local/share/fonts/noto/NotoColorEmoji=2Ettf was installed by package= noto-emoji-2=2E042 Looks good to me Bapt From nobody Wed May 15 05:40:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VfMWL70Pjz5KDJT; Wed, 15 May 2024 05:40:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VfMWL6SB0z4HPY; Wed, 15 May 2024 05:40:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715751614; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nQ87ZNDm9hEV6nPgnY4aqhTvUArURUzdeb5MXuWZQkA=; b=m+i0VauzhEAmLPlWMSz3NwrWqoGiexoZSjDRh4NY/oXeoDFj2HSBjy6FNLH55HPqSoDdz7 lWKFNU7jkbXtatHTS7W/Xgoe/4+EpoteIHUZCCuItk7f1zYAZgL92GR2wVhA41Rvs3aNWp 2w8bdyXIywTgdbkWB9h6wVx2u5vRllcUwYshiRC88g0E8cCJ/hw5M76wy5pbo51P04xdiY V7LTh1W05tzvlyWzFjOdlfe6SgLKpzo8MbijPtWEPUhH3xcwEvcHRSdEg2LaNBWmmid6fF emRKYqopMMnMn1f1HxvHBESi67eNKOLCnZxGQIhjBfQ9tW586nmyiEUwJsKchw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715751614; a=rsa-sha256; cv=none; b=fxp+UbTajLpc/+KVsn8yupkCxJGK+PTxb90qCp+sQtQzC509Hdeh4pIdFdoaDsy6Q2b8PD QcgMxSCrW8IolOwEf8LZnesvRFN2C1pt5gFlkhn1hPituPACS8vQC58B56ygQLMAIJOFno WCoqdb2GGHX6xww11D0fMTkk8RMFGYhMQcsw5v/jUCguJuh097D0EdmScaXn9VKDmQK2xl Kwnwxej0e9mdSOQQ3SZepE2c5gcqmVbZJx4SKeoyK9qbfXbBIxDAYEW1P1XbU5b6qVMrWE jjtOWrDFno2iw3I9vlmcCcffw3kkLKfJuTz31CpGzoBlSV9RJj4l/hlXrt79Bg== 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=1715751614; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nQ87ZNDm9hEV6nPgnY4aqhTvUArURUzdeb5MXuWZQkA=; b=IpSX5FJRPdZRAxfjTpZNq5YgjkrCvbTq5GaNC2XEgOLOBkpu2gRXetpSNb2xSrwrlz1TLs mH8oihjVJcg1BhTVUTY1O5uQtPiUhM1kr4P8tv42ZcEm6HIub5KffNmYaTrPDFMVyfrXiX kOe9dIJoDitJ4w5EiBEX5hx9zu8/sQ4llWYtNRi/w8kE8oLFdxO9qbXEbfA+TMOGH7X42f u7iFU3OgZv+T4W6TwERLW8CHHdCRrvUuzjRpzicQ/syL5FThWmGN4g13JzkSTbv0ESkurM W3XqLRSTFFfjZtUSGir7BFdA46U42UMAv0d0eRPblKZW3xDXCB0F9o1i37yhyg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VfMWL5xrsz1351; Wed, 15 May 2024 05:40:14 +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 44F5eEf3013451; Wed, 15 May 2024 05:40:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44F5eEtA013445; Wed, 15 May 2024 05:40:14 GMT (envelope-from git) Date: Wed, 15 May 2024 05:40:14 GMT Message-Id: <202405150540.44F5eEtA013445@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: 61dece6d27fb - main - Enable soft updates by default for UFS2 filesystems. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 61dece6d27fb2436928ca93d65667b358e05aa7b Auto-Submitted: auto-generated The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=61dece6d27fb2436928ca93d65667b358e05aa7b commit 61dece6d27fb2436928ca93d65667b358e05aa7b Author: Kirk McKusick AuthorDate: 2024-05-15 05:38:35 +0000 Commit: Kirk McKusick CommitDate: 2024-05-15 05:40:01 +0000 Enable soft updates by default for UFS2 filesystems. Soft updates dramatically improve the performance of UFS filesystems. The newfs(8) utility currently does not enable them by default. The FreeBSD installer enables soft updates by default. However custom built installations that do not specify the -U option to newfs(8) and the prebuilt UFS system images get filesystems without soft updates enabled. There are several testing sites that run benchmarks comparing the performance of Linux distributions versus BSD distributions. When they run filesystem comparison benchmarks they use newfs(8) to create the UFS filesystem. Because it does not have soft updates enabled it runs poorly versus the Linux ext4 filesystem. When I have suggested to them that they should enable soft updates on the UFS filesystem in their testing their response is that they expect the utility that creates the filesystem to use optimal defaults and that they cannot be expected to fiddle with various option settings. The purpose of this change is to give a filesystem created with newfs(8) reasonably optimal settings. For UFS2 this means enabling soft updates. For UFS1 which tends to be used on small systems with minimal memory and CPU speed, the lower memory footprint of running without soft updates is a more sensible default. This change adds a note in the section of the newfs(8) manual page that describes the -U option for enabling soft updates that they are enabled by default for UFS2 filesystems and that they can be disabled by using tunefs(8). Reviewed-by: Warner Losh, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45201 --- sbin/newfs/newfs.8 | 6 +++++- sbin/newfs/newfs.c | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/sbin/newfs/newfs.8 b/sbin/newfs/newfs.8 index 05d2413a44e4..a7f792635aa9 100644 --- a/sbin/newfs/newfs.8 +++ b/sbin/newfs/newfs.8 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 21, 2022 +.Dd May 18, 2024 .Dt NEWFS 8 .Os .Sh NAME @@ -98,6 +98,10 @@ The default format is UFS2. For backward compatibility. .It Fl U Enable soft updates on the new file system. +Soft updates are enabled by default for UFS2 format file systems. +Use +.Xr tunefs 8 +to disable soft updates if they are not wanted. .It Fl a Ar maxcontig Specify the maximum number of contiguous blocks that will be laid out before forcing a rotational delay. diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c index 38781368e8ca..49bd8b7dc4b6 100644 --- a/sbin/newfs/newfs.c +++ b/sbin/newfs/newfs.c @@ -383,6 +383,9 @@ main(int argc, char *argv[]) fprintf(stderr, "because minfree is less than %d%%\n", MINFREE); opt = FS_OPTSPACE; } + /* Use soft updates by default for UFS2 and above */ + if (Oflag > 1) + Uflag = 1; realsectorsize = sectorsize; if (sectorsize != DEV_BSIZE) { /* XXX */ int secperblk = sectorsize / DEV_BSIZE; From nobody Wed May 15 06:20:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VfNQH4GxWz5KHTq for ; Wed, 15 May 2024 06:20:55 +0000 (UTC) (envelope-from 0100018f7ae933f5-ce8e9519-75e0-41e0-a18c-60d1ee3aaa73-000000@amazonses.com) Received: from a8-176.smtp-out.amazonses.com (a8-176.smtp-out.amazonses.com [54.240.8.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4VfNQH2Tk9z4MNk for ; Wed, 15 May 2024 06:20:55 +0000 (UTC) (envelope-from 0100018f7ae933f5-ce8e9519-75e0-41e0-a18c-60d1ee3aaa73-000000@amazonses.com) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=dqtolf56kk3wpt62c3jnwboqvr7iedax; d=tarsnap.com; t=1715754054; h=Message-ID:Date:MIME-Version:Subject:To:References:From:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=ief7O9dIxxZeGs/2Y0IsLslipnSlqs3jl94xsJs7SCk=; b=Uu38gDql0mULlcnUXgAmudvhmE9ggTaCrEqYt+SIxoO4bZ6+7IFZDmhuZGJ4Nibq qszA/SCrxmIqdRhWAavo8C3cB6NhQj11jOMOL8jawTAKDa3Lx/NnYc3xE8ZIVoxJVG7 eTk+uJqyn15CNaH3WxaazorlgDEW6p/RmKfKjWFY= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1715754054; h=Message-ID:Date:MIME-Version:Subject:To:References:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=ief7O9dIxxZeGs/2Y0IsLslipnSlqs3jl94xsJs7SCk=; b=bUeRRl6G5wRDQKrVxsRqGKmlaZH6jQ5PTfLlDozlj1X0pGSZqaM2MK4Ly08VGb7G 8OAIjXp2HC6K2MXcAb/ttYjWLTwLUWILRRada+fMD+bbr1kzU4GinWTN021WLQCquEP R9OgydO3j5Hg3PPgNTzxwSE9kLR92PIFbLP/XTSk= Message-ID: <0100018f7ae933f5-ce8e9519-75e0-41e0-a18c-60d1ee3aaa73-000000@email.amazonses.com> Date: Wed, 15 May 2024 06:20:54 +0000 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 61dece6d27fb - main - Enable soft updates by default for UFS2 filesystems. To: Kirk McKusick , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202405150540.44F5eEtA013445@gitrepo.freebsd.org> Content-Language: en-US From: Colin Percival Autocrypt: addr=cperciva@tarsnap.com; keydata= xsFNBGWMSrYBEACdWRqDn3B3SKO7IG0/fGHYtfs26f3Q5QeAcasy1fQLniwGQWn5rlILhbCD K/jdNoDm5Zxq20eqyffoDNObCjnHgg4tGANdi+RmDy+7CDpE789H8dss9y7Pt5DlGGAXQQnt hxush3EYS/Ctprd9UUL/lzOOLOU1aNtzB84tNrJBtcJmL7OYHfyTSNFxvedqJrrasejIQOLI t/DQ89BPzz+vsKHz7FJPXh3fsVkzLA00DJYcfkgxyABfJNA7U6yMwd4DVSdx/SsvfIDMVXnu UXCXswo106WPZbYGlZPpq0wW6iibtTerJix+8AeuwXvl9O1p8yESK4ErkIxCnmghTSz+pdzj z/6xBRkdDM9VdZ0r+CzsaNXMpDOzFuKyjaiYBdgCLljbDnXIHFcqXenrZ7Xwkm09g/M4uVSh pIUG2RYa6tsHSQoGCp3f2RZv1znfViKQFbbL83QjtPA20AhseZSYbHp1FPhXyy9J0wkGL16L e99g6gdGeIRE82BZjBjKGDkoyDPq+oDRSFl8NtzmIKy+cfz00nViqcTF4bREXEawFGhlpO0X O9q8mijI9iFB6zaPBiSdJGBL5ML5qLTNCl8Zlf4m1TBvmRTqF/lzMHVXHidDoUhpSh/y3AFZ 1KrYc27ztJQywDJPJPWPbtY8YhFLFs377gfP8WldsZjzp8nvoQARAQABzSVDb2xpbiBQZXJj aXZhbCA8Y3BlcmNpdmFAdGFyc25hcC5jb20+wsGRBBMBCAA7FiEEglY7hNBiDtwN+4ZBOJfy 4i5lrT8FAmWMSyYCGwMICwkNCAwHCwMFFQoJCAsFFgMCAQACHgUCF4AACgkQOJfy4i5lrT+i Yg/+PYyJNoFuygtV5t/skcjYmvEC93mnazEvh+x99vGYZnGKeJ8NDOF4QCUzeHquOWxDi8Zl reXyswKcrIquPxxX6+YyGe97VbvLnez3ksfzOYRj1F4qV0Rq8ZNK51+bvIrbcS3SfDaRioAk D7WWwFor8y/hSwxYkfsKbtP5PRcem20JUxuC085zqWLaKv5t5n2CBzAGMjwJaQ3tM3AXVwWJ uJaHA6ot/6fntJlmkfcyCYyyr0D6b0guRj3STbZ2hNn5o2AI+f6LJJ31s2sPFjl6rs7fORf3 hFSNOHDd2HxfVBXFdQy24ROkC4orBBz2xh9GScjxxT/hbXkfufkubFubw7n0HkvHzA3UF+Qq A8JiI3n+d7ocsP0/5BQ2sZdeqPGJgHx6RkAMuW1tJ29wSvCN1qMgFwhYkpQdfvHlociQrimU fvlRfSrBEe8o7tvIuEdpvwvCZSTJqQbVoMw8UHFE7nzyCXUSab5h6PbjakCqim13ekVO2KFF TTPcz5o5jEeUY75tzbIwcDfFbT5KqNjWy06TVdM9VEJDHSfOfxHR3kSEwZ+tT2aTvL3grsUn gFwSNcj4Cl4CRFfUw8zVZY+7O7RiMlhBqykikvUurrdGKc1Scwa0yuppdA6eVvylyTWSQGrQ +uLWtV1LUKN7ZqKJWBkLPt9nS4XZWGyBvxOHYqjOwU0EZYxKtgEQANYfgbtUMVnhjxDHhWLp g5kLHK3YW0TfJKzpXqDB7NiqxHofn4OcbZnVC3MKggcbs9o1/UtsjnlsG8550PfiYkDXvPiO RJwgbGs6MGIDK797C6cnBLQ8xwBa9SL4cl5iQFnhWmt6vwnJ+an/cm5JpYves3wL7jV09qU9 57hkHXEUcl38r4FssZzVcLKPUVTa3Un+QGRTGDGe/f4ctjMaqv0ZCM+l2ixPhf/vqESrfSLv V/+T3dmtUfXjazO3SABvsHwxgGuTTYOlKoPCaebr+BRdqm0xeIShoIlhvTI8y4clchqx/Uxg UG5X2kvU13k3DS3Q8uLE4Et9x1CcZT6WGgBZSR6R0WfD0SDnzufNnRWJ0dEPA2MtJHE7+85R Vi9j/IgZV+y5Ur+bnPkjDG1s2SVciX5v9HQ0oilcBhvx0j5lGE9hhurD9F+fCvkr4KdbCknE 6Y8ce8pCNBUoB/DqibJivOzTk9K9MGB5x0De5TerIrFiaw3/mQC9nGeO9dtE7wvDJetWeoTq 4BEaCzpufNqbkpOaTQILr4V6Gp7M6v97g83TVAwZntz/q8ptwuKQPZ2JaSFLZn7oWUpYXA5s +SIODFHLn6iMoYpBQskHQjnj4lEPJadl4qj+ZKA89iDAKsniyoFXsbJe2CPbMS1yzBxKZq6K D/jpt7BOnuHr/JrXABEBAAHCwXYEGAEIACAWIQSCVjuE0GIO3A37hkE4l/LiLmWtPwUCZYxK tgIbDAAKCRA4l/LiLmWtP3jmEACQrh9gWe8F1Tkw3m6VoHKwLc5he4tX3WpQa//soPO6iGG3 S3WPruQ46NrAaAojoOcKI9UONDO5rxG0ZTX53S+lu2EO47jbcLwOCjaEpjKpDRt9ZXBQE8Xl mtBE9Bp3W9gpjB1nE3KNM1mJYgsK0QdRpwwfh4pVgGpOj8j23I6MCK+v99zEBnpgCn2GX8W/ kctRXHqWwndHysOJtRP/zrl7dDaABF1f9efUl0LL3TD3GJ9VDz+DNOin/uK2a1hiJo8QzTRk PpfUQ2ebzDsrd1i/pOWkMSkdH+rEu4AGrXWtaBwrMyrGkL6Icb6yO+P9/z0W2wlgBf3P1YRt JPgQt/Dj3yvA/UnaV/QmuVQPjl13o24UnJGsZM8XGnNdfWBKkC1Q6VXC4QT+dyBHYH9MuE9d 6oGl8pFM1+cTfEfbM62/rRoPkF1yHMsI/903VxEvuUIKfhEZAVLFyHldooNxuchntHQP9y8J 8Ou9bWYQP7MnEn+kwSwrZkjurfPkan+xQvp6dDYnj3V0GwA5pprBMaB928VIDVOv+1PNQI3t Cvk5VPv/skq+TJRMHW7bFSt8PRa91cUf1FOLIz9APDiJOzXkwxUEHGV3zPSaUhs1JYjyBeGT wDAvtLUdjOnRhEUOwlnIrztmvyciutjJoVzKEEjj5WXnHk9L9kQ1bpAjkjTONw== In-Reply-To: <202405150540.44F5eEtA013445@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-SES-Outgoing: 2024.05.15-54.240.8.176 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:14618, ipnet:54.240.8.0/21, country:US] X-Rspamd-Queue-Id: 4VfNQH2Tk9z4MNk On 5/14/24 22:40, Kirk McKusick wrote: > commit 61dece6d27fb2436928ca93d65667b358e05aa7b > Author: Kirk McKusick > AuthorDate: 2024-05-15 05:38:35 +0000 > Commit: Kirk McKusick > CommitDate: 2024-05-15 05:40:01 +0000 > > Enable soft updates by default for UFS2 filesystems. > [...] > > MFC after: 1 week If we're not worried about this being too astonishing a change for a stable branch (and I'm not -- I can't imagine too many people being upset that they get better performance than they used to), is there any reason to not include this in 14.1? -- Colin Percival FreeBSD Release Engineering Lead & EC2 platform maintainer Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From nobody Wed May 15 09:47:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VfT0D4nMmz5KZv9 for ; Wed, 15 May 2024 09:47: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 4VfT0D40Hlz4gQp; Wed, 15 May 2024 09:47:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715766428; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pg9n4KrwrPOYmfX567OJCdoXkxxiON52d1IqpGaGFZo=; b=ZqDtRMBMSlgYhqD2HFC6miaiHokzHsjJPTQjJiexmbrxGoXRLcQAEJhsWFpRPcraSmwVMl sTFhF7pcaPSfCZAJiZTb++Y3v0Ot/ZAsmNnvQHGFAHahjq5ZHua72Q+m8if5lOgoTrSzM9 VSwSpjCVnvfB7ORuhbEjphHRo0UWJQo1mCyndHasHcvzIPgg9f9pTSOyYe/GBsMDnzE6Q9 zu/FsskQIJHuaDDFLQrU4EkeoWjfrghanlGzAkwz0afN0MPx0cV4S6PjBI9wzr2dprrd/o AqY9yqZBaOm1gSh5dDRPrHQ0qPQbMs3wzIvAN1JfSYCqrAqASlgYXkhFGyH1kg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715766428; a=rsa-sha256; cv=none; b=uEnHduMnHv9+nGCnDs2ctgP8UeknqBXskRqp9mPQVuERa/D20lAaQh+y88I0Vzg5xC8MyY 2JAYPhgmXrJiXBnR9RiZED74TMNpMKV5J8LxLtaatOQS+XoYNZz12yY7BZ4aLbP12O4eFi df7d/BpVpIUtRoPogddDHf0XBymMfhwM10EDSg5Sq3si4uKv77yMJE0lHQO7bZYh13Ujqt mY2H70hoBQ/vfg6WCVUDwn8Bjx/GNSdo/fHVa5lvUpRYU4VhAmsHknmRstXPbe5yA2UPLm A23gWZarmeeSTT/0+GHktCzzKj0MG6u5AjiMHE/lL6rxAk4//iJ93QHAKDb7JQ== 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=1715766428; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pg9n4KrwrPOYmfX567OJCdoXkxxiON52d1IqpGaGFZo=; b=r5mzFpK/EBN7SPrYOtdEGDlubWNFFA9HnTBYKC/+OZeTd3Xpvv4VI3Kt8pXCwXs7MjUCAf hZYTuANzFEIYxaiJZX++nNg4KulJovDTUsVVEjgLdISYYSd9ZreKkpHSlbZjOiJX12nGg0 jy6vuRK92aFr1MeQCDvHewWMoFZmzkxEln/bcL6R9aLFfkgdMTlE2sI42sHkd6puRJN4Du nRr7mlzzTMXPyDkSb3oqCYS2UngTdrz66ozhVxl7jhwNtQkt7V25PRylIr+QYbNdH9uH6u 010NH4sCI1Ps7MBcILzi6H++eHpBjNS33x23PKBRtm6jGJah7I5h4s3zzMKxpw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VfT0D39FCz19QB; Wed, 15 May 2024 09:47: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 44F9l8u8027333; Wed, 15 May 2024 09:47:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44F9l8EY027332; Wed, 15 May 2024 09:47:08 GMT (envelope-from git) Date: Wed, 15 May 2024 09:47:08 GMT Message-Id: <202405150947.44F9l8EY027332@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: cf3e3d5bd0a1..0c57cb21e0c6 - vendor/ldns - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/vendor/ldns X-Git-Reftype: branch X-Git-Commit: 0c57cb21e0c6a8a86fa074baeaeb6a002e2b7734 X-Git-Oldrev: cf3e3d5bd0a1fae39c74c7db5a4e8b10732d0766 X-Git-Newrev: 0c57cb21e0c6a8a86fa074baeaeb6a002e2b7734 Auto-Submitted: auto-generated The branch vendor/ldns has been updated by des: URL: https://cgit.FreeBSD.org/src/log/?id=cf3e3d5bd0a1..0c57cb21e0c6 0c57cb21e0c6 Issue #237 : Resolver uses nameserver commented out in /etc/resolv.conf From nobody Wed May 15 09:53:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VfT853QqHz5KbYn; Wed, 15 May 2024 09:53: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 4VfT852SjGz4h56; Wed, 15 May 2024 09:53:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715766837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XYrqM7W05mjXWHfpN5js368HJ5PgnwL8Qc95BU9a+40=; b=LBMF6SvzSAZaa8svDH8d7duzQiia+QMSMqjRHTGMffYmrFbsmSpwWbBH6MQ1s2jYuWhZg/ lv2W/X9TxzQj1RQO//ddzCyDJZR5Mk8vvZ9fhTmRjoo7SnReaINLvBz14s7A1oYVQVCc9o gjFA3/yYMY6+Kc/KQVfKmUOi8WqEpwanBIlSRLI2f7y/35xkFGIHFzjSIkrq8YUhKmh9Bn Coc4nqeNdrTvlkhyEF/T8uZSfpfvVBNJ2rkKMcU/jN1E+X4sE9B7uKQKBp/ISZkTQyYEKS fdgZdqCOVrcltM9FgF6taws4v1auJ/FxosyEfGcZahUipHtugfOEeL2I5K2woQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715766837; a=rsa-sha256; cv=none; b=hj5/vV/qMHdcOu3N967rbsQ1DB7zrhBqcC4yzQY7geqAF6bjm9Bfjdcs47ZgRrUYFDBBO6 o83TKFHnq0cHR32MkEOc/SeExFNDgLUs+S+13O7LFrT9IzCMtoKJziXTIRfbvIYmGKAW9p +/W+52eCNZMcVi/xvy/zVg7OEqOjpS6ARWaFCFbHMrI4rCUVESwrwe1+JE/ARerAyxTCpD 0tPF4dyoCdLPBIRUmtRe3oJpwLoZrrxiwtxnJJtUwETZydYm6ndiVe/C2G14LBZhdlnTx6 QGfsgqYRMwQr0Oh+PcpBBJx8DqGOQRq3LZbjjhzaN+tJuhyyzhjq/ijZD4rQvQ== 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=1715766837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XYrqM7W05mjXWHfpN5js368HJ5PgnwL8Qc95BU9a+40=; b=D0KpdPw8r9Uo7zyD6Gst+WsBrrN3pjwgt9oea9XzQW5GJyfSZPk4tb+3am6wu08GVvWD3p 0dNoqLYLzZEkBH6PutYhV4xf+OrjX9oRO3S3A4duYiCct0QRgoKkh0RCy305xJzY5F+9Xn QIWBx+/uXHceBADmodewMBRqbCSL/2kqwpTacf3s3pXA4QM0ZDc0zVpenvaTxWX7C90h2k f/RGAByb30Ejyy2NGi7J+P/x3xQzZj46egxJQh2BVgOUHYR1nRQnuPOXsQWtrshH40DjVk gNWB1Stln4p/EFVQVrgRnlM6eTiM/tI2GLdhomPyKHq2UjHGx4hHxO9eHQIXMw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VfT8523wwz19cl; Wed, 15 May 2024 09:53: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 44F9rvKd043710; Wed, 15 May 2024 09:53:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44F9rvSw043707; Wed, 15 May 2024 09:53:57 GMT (envelope-from git) Date: Wed, 15 May 2024 09:53:57 GMT Message-Id: <202405150953.44F9rvSw043707@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: b5fb1f44ed43 - main - Issue #237 : Resolver uses nameserver commented out in /etc/resolv.conf List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b5fb1f44ed435fa25fe3de87c9b9ee6c0aad5125 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=b5fb1f44ed435fa25fe3de87c9b9ee6c0aad5125 commit b5fb1f44ed435fa25fe3de87c9b9ee6c0aad5125 Author: Willem Toorop AuthorDate: 2024-05-07 12:43:16 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-15 09:52:49 +0000 Issue #237 : Resolver uses nameserver commented out in /etc/resolv.conf This /etc/resolv.conf: # x # nameserver 8.8.8.8 Still configured 8.8.8.8 as nameserver, because the comment detection in `ldns_resolver_new_frm_fp_l()` didn't anticipate empty lines before the comment. This fix removed all comment handling from `ldns_resolver_new_frm_fp_l()`. Instead a new function is introduced `ldns_fget_token_l_resolv_conf()` that skips comments that start with '#' and ';'. The old `ldns_fget_token_l()` (that is used for zonefiles too) still accepts only ';' for comments. --- contrib/ldns/parse.c | 35 +++++++++++++++++++++++++++---- contrib/ldns/resolver.c | 55 ++++++++++--------------------------------------- 2 files changed, 42 insertions(+), 48 deletions(-) diff --git a/contrib/ldns/parse.c b/contrib/ldns/parse.c index 9698ba71e881..af8b2c1321b2 100644 --- a/contrib/ldns/parse.c +++ b/contrib/ldns/parse.c @@ -27,9 +27,14 @@ ldns_fget_token(FILE *f, char *token, const char *delim, size_t limit) return ldns_fget_token_l(f, token, delim, limit, NULL); } -ldns_status -ldns_fget_token_l_st(FILE *f, char **token, size_t *limit, bool fixed - , const char *delim, int *line_nr) +enum file_type2parse { + zone_file_type, resolv_conf_file_type +}; + +static ldns_status +ldns_fget_token_l_st_file_type(FILE *f, char **token, size_t *limit, + bool fixed, const char *delim, int *line_nr, + enum file_type2parse file_type) { int c, prev_c; int p; /* 0 -> no parentheses seen, >0 nr of ( seen */ @@ -98,7 +103,9 @@ ldns_fget_token_l_st(FILE *f, char **token, size_t *limit, bool fixed } /* do something with comments ; */ - if (c == ';' && quoted == 0) { + if ((c == ';' + || (c == '#' && file_type == resolv_conf_file_type)) + && quoted == 0) { if (prev_c != '\\') { com = 1; } @@ -215,6 +222,26 @@ tokenread: return i == 0 ? LDNS_STATUS_SYNTAX_EMPTY : LDNS_STATUS_OK; } +ldns_status +ldns_fget_token_l_st(FILE *f, char **token, size_t *limit, bool fixed + , const char *delim, int *line_nr) +{ + return ldns_fget_token_l_st_file_type( + f, token, limit, fixed, delim, line_nr, zone_file_type); +} + +ssize_t +ldns_fget_token_l_resolv_conf(FILE *f, char *token, const char *delim, + size_t limit, int *line_nr) +{ + if (limit == 0) + limit = LDNS_MAX_LINELEN; + if (ldns_fget_token_l_st_file_type(f, &token, &limit, true, delim, + line_nr, resolv_conf_file_type)) + return -1; + else + return (ssize_t)strlen(token); +} ssize_t ldns_fget_token_l(FILE *f, char *token, const char *delim, size_t limit, int *line_nr) diff --git a/contrib/ldns/resolver.c b/contrib/ldns/resolver.c index f9ec65a55966..4b398abb4418 100644 --- a/contrib/ldns/resolver.c +++ b/contrib/ldns/resolver.c @@ -761,6 +761,8 @@ ldns_resolver_new_frm_fp(ldns_resolver **res, FILE *fp) return ldns_resolver_new_frm_fp_l(res, fp, NULL); } +ssize_t ldns_fget_token_l_resolv_conf(FILE *f, char *token, const char *delim, + size_t limit, int *line_nr); ldns_status ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) { @@ -775,7 +777,7 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) #endif ssize_t gtr, bgtr; ldns_buffer *b; - int lnr = 0, oldline; + int lnr = 0; FILE* myfp = fp; if(!line_nr) line_nr = &lnr; @@ -809,36 +811,18 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) gtr = 1; word[0] = 0; - oldline = *line_nr; expect = LDNS_RESOLV_KEYWORD; while (gtr > 0) { - /* check comments */ - if (word[0] == '#') { - word[0]='x'; - if(oldline == *line_nr) { - /* skip until end of line */ - int c; - do { - c = fgetc(myfp); - } while(c != EOF && c != '\n'); - if(c=='\n') (*line_nr)++; - } - /* and read next to prepare for further parsing */ - oldline = *line_nr; - continue; - } - oldline = *line_nr; switch(expect) { case LDNS_RESOLV_KEYWORD: /* keyword */ - gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); + gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); if (gtr != 0) { - if(word[0] == '#') continue; for(i = 0; i < LDNS_RESOLV_KEYWORDS; i++) { if (strcasecmp(keyword[i], word) == 0) { /* chosen the keyword and * expect values carefully - */ + */ expect = i; break; } @@ -856,16 +840,12 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) break; case LDNS_RESOLV_DEFDOMAIN: /* default domain dname */ - gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); + gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); if (gtr == 0) { if(!fp) fclose(myfp); ldns_resolver_deep_free(r); return LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR; } - if(word[0] == '#') { - expect = LDNS_RESOLV_KEYWORD; - continue; - } tmp = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_DNAME, word); if (!tmp) { if(!fp) fclose(myfp); @@ -879,16 +859,12 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) break; case LDNS_RESOLV_NAMESERVER: /* NS aaaa or a record */ - gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); + gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); if (gtr == 0) { if(!fp) fclose(myfp); ldns_resolver_deep_free(r); return LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR; } - if(word[0] == '#') { - expect = LDNS_RESOLV_KEYWORD; - continue; - } if(strchr(word, '%')) { /* snip off interface labels, * fe80::222:19ff:fe31:4222%eth0 */ @@ -911,7 +887,7 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) break; case LDNS_RESOLV_SEARCH: /* search list domain dname */ - gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr); + gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr); b = LDNS_MALLOC(ldns_buffer); if(!b) { ldns_resolver_deep_free(r); @@ -929,10 +905,6 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) bgtr = ldns_bget_token(b, word, LDNS_PARSE_NORMAL, (size_t) gtr + 1); while (bgtr > 0) { gtr -= bgtr; - if(word[0] == '#') { - expect = LDNS_RESOLV_KEYWORD; - break; - } tmp = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_DNAME, word); if (!tmp) { ldns_resolver_deep_free(r); @@ -954,28 +926,23 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) } break; case LDNS_RESOLV_SORTLIST: - gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr); + gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr); /* sortlist not implemented atm */ expect = LDNS_RESOLV_KEYWORD; break; case LDNS_RESOLV_OPTIONS: - gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr); + gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr); /* options not implemented atm */ expect = LDNS_RESOLV_KEYWORD; break; case LDNS_RESOLV_ANCHOR: /* a file containing a DNSSEC trust anchor */ - gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); + gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); if (gtr == 0) { ldns_resolver_deep_free(r); if(!fp) fclose(myfp); return LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR; } - if(word[0] == '#') { - expect = LDNS_RESOLV_KEYWORD; - continue; - } - #ifdef HAVE_SSL tmp_rr = ldns_read_anchor_file(word); (void) ldns_resolver_push_dnssec_anchor(r, tmp_rr); From nobody Wed May 15 10:04:16 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VfTN16mlZz5KcJv; Wed, 15 May 2024 10:04:17 +0000 (UTC) (envelope-from des@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VfTN14VDfz4j1C; Wed, 15 May 2024 10:04:17 +0000 (UTC) (envelope-from des@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715767457; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EcQ1IZU2ervTKBcJKVueFUurrerm8tCwkRx/FCkRWMw=; b=B+IfKCsO9APlzZ+pGrNv4h8iMPUk1uHL+v3U6ONV8wzX40ZVnRH99dirLZ4GRhy8KeiQ6n vCF3lL8rw0dWe34uQFjG8dlvCrYpeFs6YaACLlH1lW65EZmgIoDHRRr3+XJOnww7mM2MhK D4ynLSb8N4mPbSW0sLyBum7rJW9u3FoJDm4jM47BlkF0zxSRzTAaJJvYB+0jOJ4i6ajskr Vfu6S89ABK+6V5lLn7LD8EISEL9u3p1k8X+tGCnJiZjC3IZo0+di6Sky6gCaDF2ZMHnUDT 2h/oOccMYF259bybjrbJ6zbKZXVFYnqopfRxwqLqVIduUkuRFazNzuSOosOUtQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715767457; a=rsa-sha256; cv=none; b=Q8YhOwmXWfAw7R5oL6cObJ/3gugE9+myfVjeakGJy3+kT/ky+CtM6n3B9yYby95hlVBic2 FzBDJYXvcBn0f9YCTHEG9jh/K7eoKyMUkH+hFqsF07qd8Hn8xmYC2Wgk2QGOO1+YcIxUfZ PUyx0f2dUzHAjxkqt42OyHNzgEnEf7hphtZK8YqS7uwS2YVr6kmadZxh8bCkj2bHP6n3DU gX8K3uojewsGCFPgkRvx9piU9tGJ9AHNvthKbRR1n3arp/HspMZSAQG8+zeV88nKxyNUAH /j+EmWuuGDn7fD18jrDMqlWaqgmFWb6mqq1/gjxtf8zFye4g2nCZROEe3FZMYA== 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=1715767457; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EcQ1IZU2ervTKBcJKVueFUurrerm8tCwkRx/FCkRWMw=; b=QpnplALFY9P+trBWRcd+dSrWGJ6h4MyoRYuHtANU2r+3RWxGNs6HwKk4sPHEo5fw66DUqy sonjzQLUaiJWXTv91GUSIX4qwdK279YMJEpz6nAigpI36+cLdQW7QgeDYe2MNDQ8ZTlhK1 6U1HJVAqX30/uArWHSTzbCnTVLq+5ydPXM0Ptxbt1B8ba7grUFRjykuLFPZs1x5U85rQ5u Rzr4Y4OtsLU0o4C66cjko+WpbDAYDRiMndPE74B5wsbqLeyRFXJfeR/e/gdew6NUT/csLv T08jt/6Xxu1KZ9AXS/bm9H1wyTSON7VAxBhkZou4sUI19lrAyvXucS7lYgvvsw== Received: from ltc.des.dev (163.23.65.37.rev.sfr.net [37.65.23.163]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: des) by smtp.freebsd.org (Postfix) with ESMTPSA id 4VfTN13P3kz1PJ2; Wed, 15 May 2024 10:04:17 +0000 (UTC) (envelope-from des@freebsd.org) Received: by ltc.des.dev (Postfix, from userid 1001) id 6DBF015254; Wed, 15 May 2024 12:04:16 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: src-committers@FreeBSD.org Cc: dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: b5fb1f44ed43 - main - Issue #237 : Resolver uses nameserver commented out in /etc/resolv.conf In-Reply-To: <202405150953.44F9rvSw043707@gitrepo.freebsd.org> ("Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav=22's?= message of "Wed, 15 May 2024 09:53:57 GMT") References: <202405150953.44F9rvSw043707@gitrepo.freebsd.org> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Wed, 15 May 2024 12:04:16 +0200 Message-ID: <865xvfz90f.fsf@ltc.des.dev> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Dag-Erling Sm=C3=B8rgrav writes: > The branch main has been updated by des: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Db5fb1f44ed435fa25fe3de87c9= b9ee6c0aad5125 > > commit b5fb1f44ed435fa25fe3de87c9b9ee6c0aad5125 > Author: Willem Toorop > AuthorDate: 2024-05-07 12:43:16 +0000 > Commit: Dag-Erling Sm=C3=B8rgrav > CommitDate: 2024-05-15 09:52:49 +0000 > > Issue #237 : Resolver uses nameserver commented out in /etc/resolv.co= nf >=20=20=20=20=20 > This /etc/resolv.conf: > # x >=20=20=20=20=20 > # nameserver 8.8.8.8 >=20=20=20=20=20 > Still configured 8.8.8.8 as nameserver, because the comment detection= in `ldns_resolver_new_frm_fp_l()` didn't anticipate empty lines before the= comment. > This fix removed all comment handling from `ldns_resolver_new_frm_fp_= l()`. Instead a new function is introduced `ldns_fget_token_l_resolv_conf()= ` that skips comments that start with '#' and ';'. The old `ldns_fget_token= _l()` (that is used for zonefiles too) still accepts only ';' for comments. > --- > contrib/ldns/parse.c | 35 +++++++++++++++++++++++++++---- > contrib/ldns/resolver.c | 55 ++++++++++---------------------------------= ------ > 2 files changed, 42 insertions(+), 48 deletions(-) I actually did this as a subtree merge: % git subtree merge --prefix=3Dcontrib/ldns vendor/ldns Merge made by the 'ort' strategy. contrib/ldns/parse.c | 35 +++++++++++++++++++++++++++---- contrib/ldns/resolver.c | 55 ++++++++++-----------------------------------= ---- 2 files changed, 42 insertions(+), 48 deletions(-) % git show % git commit --amend [main 2dbd65dc861c] ldns: Ignore commented-out lines in resolv.conf. Date: Wed May 15 11:50:11 2024 +0200 % git commit --amend=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20 [main bee1ed74ab26] ldns: Ignore commented-out lines in resolv.conf. Date: Wed May 15 11:50:11 2024 +0200 However, I had to rebase before pushing and that appears to have dropped the merge commit, and I didn't notice until after I'd pushed. % git reflog b5fb1f44ed43 (HEAD -> main, freebsd/main, freebsd/HEAD) HEAD@{0}: pull --re= base (finish): returning to refs/heads/main b5fb1f44ed43 (HEAD -> main, freebsd/main, freebsd/HEAD) HEAD@{1}: pull --re= base (pick): Issue #237 : Resolver uses nameserver commented out in /etc/re= solv.conf 61dece6d27fb (github/main) HEAD@{2}: pull --rebase (start): checkout 61dece= 6d27fb2436928ca93d65667b358e05aa7b bee1ed74ab26 HEAD@{3}: commit (amend): ldns: Ignore commented-out lines in = resolv.conf. 2dbd65dc861c HEAD@{4}: commit (amend): ldns: Ignore commented-out lines in = resolv.conf. 74ce793d921d HEAD@{5}: merge 0c57cb21e0c6a8a86fa074baeaeb6a002e2b7734: Merg= e made by the 'ort' strategy. 61dece6d27fb (github/main) HEAD@{6}: pull --rebase: Fast-forward DES --=20 Dag-Erling Sm=C3=B8rgrav - des@FreeBSD.org From nobody Wed May 15 10:08:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VfTTQ0jcfz5KcLN; Wed, 15 May 2024 10:08: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 4VfTTQ0D7Yz4jjt; Wed, 15 May 2024 10:08:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715767738; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V96TYmQyLEvuwT5t734prn4chO7hhWG84fBuYTN9vDc=; b=S0UI/LM0c3RtsBQhQsB9x+SV/ucGiVCsXitH44eDFahKDcV8lUZN/lziZRFj7YesW1Yc06 QENXG7LPmlYp3OLE4/SwQaFwUMwD9jYK5IgDg70OsONMpv24I1J+p591/YzFwZdUIB09xG cM7BUebQrHzqHwep9A0VW3eqSdsPPYWlEHLkzrJHv7sV7tynkUDgQdPYC09btnZL2fwrO4 cihGkiEqxjcyZZuilkMhYnOb+kvTbG8yKsF8RVATUrl3Y76zrKk1Q/1MTxAw0kLK0esLas G/QXJDY7eb5jC4KOrazB5lcXVBu6ZVneFfJa++7nJZjhR+a8za7NtpZr0lLMMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715767738; a=rsa-sha256; cv=none; b=S/UJWTEaOMztHPNbw2B0LiyNiUcJnGLtM6CC4NnCO+ixMYqsD+CAjlHAo1y0dvWTnjOJdO OcbpM4nastgsjZhBm/8lmO2fKQAJWEITrN/UqaXxISdQnhh9aqFBXCD+8zwZC8SIeZ3Oaj 4puv0f/6ksKOuQjBdVT8h62DNN+AWnu0XTwygkm1BZaOA2uaF9k+kkdmfzTiMnq/Jf7xSp MzfzWZy/GuKnXzkeJ7NX44GADSIg7/zjgVDhaMx9DygjpidlWJtCPeWhnN/YToybf7bD+w iHJscPFdR2LFf/AC3Aw8rlxO22KiBLWQUocQjSu3Sl0huqt58Tp9oU2fvdZssQ== 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=1715767738; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V96TYmQyLEvuwT5t734prn4chO7hhWG84fBuYTN9vDc=; b=H8YlbdC9pz9I90NvmuQIedvJmW3iMMzakCepnqrojvBPanyFkMljLD/lR7F9ZCtp3IrNVq B2+sfPmax8CbS3NeFuKR4KLl/ZNMowOzKuI1aY/JWLzzGctXRLynKKWriBQ5MUwcbTAwS6 eB4dxgHRNQn5fBPaHp5cemr7isskUqMxvZsmS8T5KkkTPqgnhfsZH+ngGYa2rRGSVIz816 MAc2HchQgY8Eu/XrpAeTsI9QioypK8HgU8IEDJ/VVQ8X/N2gBcUWXmuHEKXlcmRbI/JZPK m5TTeIoDj1UeDcsE2Kyy8rEKh1BqOuoFd43//O1MMK8laAcLWr7BhG1EyeZbBA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VfTTP6wx9z19sD; Wed, 15 May 2024 10:08: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 44FA8v3L061952; Wed, 15 May 2024 10:08:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44FA8vCS061949; Wed, 15 May 2024 10:08:57 GMT (envelope-from git) Date: Wed, 15 May 2024 10:08:57 GMT Message-Id: <202405151008.44FA8vCS061949@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: a7beca6fb113 - main - atf: Guard against multiple evaluation. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a7beca6fb113986839de73b7cf73d933464898c6 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=a7beca6fb113986839de73b7cf73d933464898c6 commit a7beca6fb113986839de73b7cf73d933464898c6 Author: Dag-Erling Smørgrav AuthorDate: 2024-05-15 10:08:44 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-15 10:08:44 +0000 atf: Guard against multiple evaluation. Note that the ATF-C++ macros have the same issue, but they are not as easily fixed. MFC after: 3 days Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D45148 --- contrib/atf/atf-c/macros.h | 151 ++++++++++++++++++++++++++++----------------- 1 file changed, 95 insertions(+), 56 deletions(-) diff --git a/contrib/atf/atf-c/macros.h b/contrib/atf/atf-c/macros.h index 1784fc47435d..abcb9f697907 100644 --- a/contrib/atf/atf-c/macros.h +++ b/contrib/atf/atf-c/macros.h @@ -167,65 +167,104 @@ ATF_CHECK_MSG((expected) == (actual), "%s != %s: " fmt, \ #expected, #actual, ##__VA_ARGS__) -#define ATF_REQUIRE_STREQ(expected, actual) \ - ATF_REQUIRE_MSG(strcmp(expected, actual) == 0, "%s != %s (%s != %s)", \ - #expected, #actual, expected, actual) - -#define ATF_CHECK_STREQ(expected, actual) \ - ATF_CHECK_MSG(strcmp(expected, actual) == 0, "%s != %s (%s != %s)", \ - #expected, #actual, expected, actual) - -#define ATF_REQUIRE_STREQ_MSG(expected, actual, fmt, ...) \ - ATF_REQUIRE_MSG(strcmp(expected, actual) == 0, \ - "%s != %s (%s != %s): " fmt, \ - #expected, #actual, expected, actual, ##__VA_ARGS__) - -#define ATF_CHECK_STREQ_MSG(expected, actual, fmt, ...) \ - ATF_CHECK_MSG(strcmp(expected, actual) == 0, \ - "%s != %s (%s != %s): " fmt, \ - #expected, #actual, expected, actual, ##__VA_ARGS__) - -#define ATF_REQUIRE_INTEQ(expected, actual) \ - ATF_REQUIRE_MSG((expected) == (actual), "%s != %s (%jd != %jd)", \ - #expected, #actual, (intmax_t)(expected), \ - (intmax_t)(actual)) - -#define ATF_CHECK_INTEQ(expected, actual) \ - ATF_CHECK_MSG((expected) == (actual), "%s != %s (%jd != %jd)", #expected, \ - #actual, (intmax_t)(expected), (intmax_t)(actual)) - -#define ATF_REQUIRE_INTEQ_MSG(expected, actual, fmt, ...) \ - ATF_REQUIRE_MSG((expected) == (actual), "%s != %s (%jd != %jd): " fmt, \ - #expected, #actual, (intmax_t)(expected), \ - (intmax_t)(actual), ##__VA_ARGS__) - -#define ATF_CHECK_INTEQ_MSG(expected, actual, fmt, ...) \ - ATF_CHECK_MSG((expected) == (actual), "%s != %s (%jd != %jd): " fmt, \ - #expected, #actual, (intmax_t)(expected), \ - (intmax_t)(actual), ##__VA_ARGS__) - -#define ATF_REQUIRE_MATCH(regexp, string) \ - ATF_REQUIRE_MSG(atf_utils_grep_string("%s", string, regexp), \ - "'%s' not matched in '%s'", regexp, string); - -#define ATF_CHECK_MATCH(regexp, string) \ - ATF_CHECK_MSG(atf_utils_grep_string("%s", string, regexp), \ - "'%s' not matched in '%s'", regexp, string); - -#define ATF_REQUIRE_MATCH_MSG(regexp, string, fmt, ...) \ - ATF_REQUIRE_MSG(atf_utils_grep_string("%s", string, regexp), \ - "'%s' not matched in '%s': " fmt, regexp, string, \ - ##__VA_ARGS__); - -#define ATF_CHECK_MATCH_MSG(regexp, string, fmt, ...) \ - ATF_CHECK_MSG(atf_utils_grep_string("%s", string, regexp), \ - "'%s' not matched in '%s': " fmt, regexp, string, \ - ##__VA_ARGS__); +#define ATF_REQUIRE_STREQ(expected, actual) do { \ + const char *_atf_expected = (expected); \ + const char *_atf_actual = (actual); \ + ATF_REQUIRE_MSG(strcmp(_atf_expected, _atf_actual) == 0, \ + "%s != %s (%s != %s)", #expected, #actual, \ + _atf_expected, _atf_actual); \ + } while (0) + +#define ATF_CHECK_STREQ(expected, actual) do { \ + const char *_atf_expected = (expected); \ + const char *_atf_actual = (actual); \ + ATF_CHECK_MSG(strcmp(_atf_expected, _atf_actual) == 0, \ + "%s != %s (%s != %s)", #expected, #actual, \ + _atf_expected, _atf_actual); \ + } while (0) + +#define ATF_REQUIRE_STREQ_MSG(expected, actual, fmt, ...) do { \ + const char *_atf_expected = (expected); \ + const char *_atf_actual = (actual); \ + ATF_REQUIRE_MSG(strcmp(_atf_expected, _atf_actual) == 0, \ + "%s != %s (%s != %s): " fmt, #expected, #actual, \ + _atf_expected, _atf_actual, ##__VA_ARGS__); \ + } while (0) + +#define ATF_CHECK_STREQ_MSG(expected, actual, fmt, ...) do { \ + const char *_atf_expected = (expected); \ + const char *_atf_actual = (actual); \ + ATF_CHECK_MSG(strcmp(_atf_expected, _atf_actual) == 0, \ + "%s != %s (%s != %s): " fmt, #expected, #actual, \ + _atf_expected, _atf_actual, ##__VA_ARGS__); \ + } while (0) + +#define ATF_REQUIRE_INTEQ(expected, actual) do { \ + intmax_t _atf_expected = (expected); \ + intmax_t _atf_actual = (actual); \ + ATF_REQUIRE_MSG(_atf_expected == _atf_actual, \ + "%s != %s (%jd != %jd)", #expected, #actual, \ + _atf_expected, _atf_actual); \ + } while (0) + +#define ATF_CHECK_INTEQ(expected, actual) do { \ + intmax_t _atf_expected = (expected); \ + intmax_t _atf_actual = (actual); \ + ATF_CHECK_MSG(_atf_expected == _atf_actual, \ + "%s != %s (%jd != %jd)", #expected, #actual, \ + _atf_expected, _atf_actual); \ + } while (0) + +#define ATF_REQUIRE_INTEQ_MSG(expected, actual, fmt, ...) do { \ + intmax_t _atf_expected = (expected); \ + intmax_t _atf_actual = (actual); \ + ATF_REQUIRE_MSG(_atf_expected == _atf_actual, \ + "%s != %s (%jd != %jd): " fmt, #expected, #actual, \ + _atf_expected, _atf_actual, ##__VA_ARGS__); \ + } while (0) + +#define ATF_CHECK_INTEQ_MSG(expected, actual, fmt, ...) do { \ + intmax_t _atf_expected = (expected); \ + intmax_t _atf_actual = (actual); \ + ATF_CHECK_MSG(_atf_expected == _atf_actual, \ + "%s != %s (%jd != %jd): " fmt, #expected, #actual, \ + _atf_expected, _atf_actual, ##__VA_ARGS__); \ + } while (0) + +#define ATF_REQUIRE_MATCH(regexp, string) do { \ + const char *_atf_regexp = (regexp); \ + const char *_atf_string = (string); \ + ATF_REQUIRE_MSG(atf_utils_grep_string("%s", _atf_string, _atf_regexp), \ + "'%s' not matched in '%s'", _atf_regexp, _atf_string); \ + } while (0) + +#define ATF_CHECK_MATCH(regexp, string) do { \ + const char *_atf_regexp = (regexp); \ + const char *_atf_string = (string); \ + ATF_CHECK_MSG(atf_utils_grep_string("%s", _atf_string, _atf_regexp), \ + "'%s' not matched in '%s'", _atf_regexp, _atf_string); \ + } while (0) + +#define ATF_REQUIRE_MATCH_MSG(regexp, string, fmt, ...) do { \ + const char *_atf_regexp = (regexp); \ + const char *_atf_string = (string); \ + ATF_REQUIRE_MSG(atf_utils_grep_string("%s", _atf_string, _atf_regexp), \ + "'%s' not matched in '%s': " fmt, _atf_regexp, _atf_string, \ + ##__VA_ARGS__); \ + } while (0) + +#define ATF_CHECK_MATCH_MSG(regexp, string, fmt, ...) do { \ + const char *_atf_regexp = (regexp); \ + const char *_atf_string = (string); \ + ATF_CHECK_MSG(atf_utils_grep_string("%s", _atf_string, _atf_regexp), \ + "'%s' not matched in '%s': " fmt, _atf_regexp, _atf_string, \ + ##__VA_ARGS__); \ + } while (0) #define ATF_CHECK_ERRNO(exp_errno, bool_expr) \ - atf_tc_check_errno(__FILE__, __LINE__, exp_errno, #bool_expr, bool_expr) + atf_tc_check_errno(__FILE__, __LINE__, (exp_errno), #bool_expr, (bool_expr)) #define ATF_REQUIRE_ERRNO(exp_errno, bool_expr) \ - atf_tc_require_errno(__FILE__, __LINE__, exp_errno, #bool_expr, bool_expr) + atf_tc_require_errno(__FILE__, __LINE__, (exp_errno), #bool_expr, (bool_expr)) #endif /* !defined(ATF_C_MACROS_H) */ From nobody Wed May 15 10:10:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VfTW61rXhz5KcNW; Wed, 15 May 2024 10:10:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VfTW61CSWz4k6P; Wed, 15 May 2024 10:10:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715767826; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d0zu9zaT2iZcR+DHHhZ7kIaum8Px8GBMw0Z+YSxKHB8=; b=EdcZOVpRKm6iTOu6w3Vr2zz7eG8UgwLCqV/IqyTlVDZRON8CNDSy2lzM+Nl4qog6xQSb+y IpJ53JlAq3SQ3wfkz3yHlss8gLYidr3UpuK+jevRBDUB0wHhVUXJ3/BRHRwrT9lt1MjLU4 mzLkcdAaHbV6O07ua+WJdqtFeckQ0YV7/sF18hxqjUZvyGMZPnWAyUZxiimphr0gY5adjx HKxGao9YFclFMfaWVBBYKj2A5avYjBgjvTPJp7DijVCrpzbbgvQF09TCnbpEtgY02CRevi LbmysXJqK23VYk3H8rdLg39vNCyKlYHnyZ1nY8++syyAj07VnvloDEPX16czyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715767826; a=rsa-sha256; cv=none; b=FL24iARERxsiWbHp3u4+wbzhkkJZezDy4UC9xTB9HLLeQcbcbGE4rl87B5hhJgfbq31coG 1RysAVSqNYMoKavoG84nhxcynFsOG173PfRYjk+qAzaPsTEVthtiiCIIFmMoKYYkJBhTZ2 cuz2zh37XUUGFz5yUrzip7z+GqQln0q7V13iBVUzNrvYRS+k8EMu8k/NcfHDMbZ7VZUJJp apuL+31OILBCr8pfw/0Syt99vcTazEZgABLbiE550eBqFI8EaWOwdLn1uGxSRD1voWXnVi qWpGrDt6l7CCR0n+CZLhhObQJIDXjNiegaBHE9UVFG9t2zuNw+bfJVEVOopiKw== 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=1715767826; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d0zu9zaT2iZcR+DHHhZ7kIaum8Px8GBMw0Z+YSxKHB8=; b=Dcl62eK6UnsYM1y/Gsi6S0jviiM5um/Z3QhxhtocLw84IBkPSRl3BMy/grKHBy+pgVL6Co kWBHZ7xK4qxloi0ukCEsZQNSFh3h7FC0YbHFWfYKsM5zWM78mrK5wF7klD/ACfflGp013o J0INyrP2TNXoU4qC9Q1L990G06QEbCMUua24fAONe8U3IJXxKdVWyGPVV6zraUDKmhOlv+ CamWr/iX7agWmD88Dpgu3Z5vX7lyMd+OiPFmd2BD1cmah22Wg9uXh6WhK5BSGiSBGguWWn IzLR7p5cFZWIlY8l/udcAfp/+7kzZh06rpmlfjWxgSYi4HGcKQ5yJlxWXCMMXA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VfTW60qPnz19dS; Wed, 15 May 2024 10:10: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 44FAAQiM070841; Wed, 15 May 2024 10:10:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44FAAQ5c070838; Wed, 15 May 2024 10:10:26 GMT (envelope-from git) Date: Wed, 15 May 2024 10:10:26 GMT Message-Id: <202405151010.44FAAQ5c070838@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 154ad8e0f88f - main - Revert "Issue #237 : Resolver uses nameserver commented out in /etc/resolv.conf" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 154ad8e0f88ffc07b6d06686f53bfc22927d3ad8 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=154ad8e0f88ffc07b6d06686f53bfc22927d3ad8 commit 154ad8e0f88ffc07b6d06686f53bfc22927d3ad8 Author: Dag-Erling Smørgrav AuthorDate: 2024-05-15 10:10:20 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-15 10:10:20 +0000 Revert "Issue #237 : Resolver uses nameserver commented out in /etc/resolv.conf" This reverts commit b5fb1f44ed435fa25fe3de87c9b9ee6c0aad5125. --- contrib/ldns/parse.c | 35 ++++--------------------------- contrib/ldns/resolver.c | 55 +++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 48 insertions(+), 42 deletions(-) diff --git a/contrib/ldns/parse.c b/contrib/ldns/parse.c index af8b2c1321b2..9698ba71e881 100644 --- a/contrib/ldns/parse.c +++ b/contrib/ldns/parse.c @@ -27,14 +27,9 @@ ldns_fget_token(FILE *f, char *token, const char *delim, size_t limit) return ldns_fget_token_l(f, token, delim, limit, NULL); } -enum file_type2parse { - zone_file_type, resolv_conf_file_type -}; - -static ldns_status -ldns_fget_token_l_st_file_type(FILE *f, char **token, size_t *limit, - bool fixed, const char *delim, int *line_nr, - enum file_type2parse file_type) +ldns_status +ldns_fget_token_l_st(FILE *f, char **token, size_t *limit, bool fixed + , const char *delim, int *line_nr) { int c, prev_c; int p; /* 0 -> no parentheses seen, >0 nr of ( seen */ @@ -103,9 +98,7 @@ ldns_fget_token_l_st_file_type(FILE *f, char **token, size_t *limit, } /* do something with comments ; */ - if ((c == ';' - || (c == '#' && file_type == resolv_conf_file_type)) - && quoted == 0) { + if (c == ';' && quoted == 0) { if (prev_c != '\\') { com = 1; } @@ -222,26 +215,6 @@ tokenread: return i == 0 ? LDNS_STATUS_SYNTAX_EMPTY : LDNS_STATUS_OK; } -ldns_status -ldns_fget_token_l_st(FILE *f, char **token, size_t *limit, bool fixed - , const char *delim, int *line_nr) -{ - return ldns_fget_token_l_st_file_type( - f, token, limit, fixed, delim, line_nr, zone_file_type); -} - -ssize_t -ldns_fget_token_l_resolv_conf(FILE *f, char *token, const char *delim, - size_t limit, int *line_nr) -{ - if (limit == 0) - limit = LDNS_MAX_LINELEN; - if (ldns_fget_token_l_st_file_type(f, &token, &limit, true, delim, - line_nr, resolv_conf_file_type)) - return -1; - else - return (ssize_t)strlen(token); -} ssize_t ldns_fget_token_l(FILE *f, char *token, const char *delim, size_t limit, int *line_nr) diff --git a/contrib/ldns/resolver.c b/contrib/ldns/resolver.c index 4b398abb4418..f9ec65a55966 100644 --- a/contrib/ldns/resolver.c +++ b/contrib/ldns/resolver.c @@ -761,8 +761,6 @@ ldns_resolver_new_frm_fp(ldns_resolver **res, FILE *fp) return ldns_resolver_new_frm_fp_l(res, fp, NULL); } -ssize_t ldns_fget_token_l_resolv_conf(FILE *f, char *token, const char *delim, - size_t limit, int *line_nr); ldns_status ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) { @@ -777,7 +775,7 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) #endif ssize_t gtr, bgtr; ldns_buffer *b; - int lnr = 0; + int lnr = 0, oldline; FILE* myfp = fp; if(!line_nr) line_nr = &lnr; @@ -811,18 +809,36 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) gtr = 1; word[0] = 0; + oldline = *line_nr; expect = LDNS_RESOLV_KEYWORD; while (gtr > 0) { + /* check comments */ + if (word[0] == '#') { + word[0]='x'; + if(oldline == *line_nr) { + /* skip until end of line */ + int c; + do { + c = fgetc(myfp); + } while(c != EOF && c != '\n'); + if(c=='\n') (*line_nr)++; + } + /* and read next to prepare for further parsing */ + oldline = *line_nr; + continue; + } + oldline = *line_nr; switch(expect) { case LDNS_RESOLV_KEYWORD: /* keyword */ - gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); + gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); if (gtr != 0) { + if(word[0] == '#') continue; for(i = 0; i < LDNS_RESOLV_KEYWORDS; i++) { if (strcasecmp(keyword[i], word) == 0) { /* chosen the keyword and * expect values carefully - */ + */ expect = i; break; } @@ -840,12 +856,16 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) break; case LDNS_RESOLV_DEFDOMAIN: /* default domain dname */ - gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); + gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); if (gtr == 0) { if(!fp) fclose(myfp); ldns_resolver_deep_free(r); return LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR; } + if(word[0] == '#') { + expect = LDNS_RESOLV_KEYWORD; + continue; + } tmp = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_DNAME, word); if (!tmp) { if(!fp) fclose(myfp); @@ -859,12 +879,16 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) break; case LDNS_RESOLV_NAMESERVER: /* NS aaaa or a record */ - gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); + gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); if (gtr == 0) { if(!fp) fclose(myfp); ldns_resolver_deep_free(r); return LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR; } + if(word[0] == '#') { + expect = LDNS_RESOLV_KEYWORD; + continue; + } if(strchr(word, '%')) { /* snip off interface labels, * fe80::222:19ff:fe31:4222%eth0 */ @@ -887,7 +911,7 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) break; case LDNS_RESOLV_SEARCH: /* search list domain dname */ - gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr); + gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr); b = LDNS_MALLOC(ldns_buffer); if(!b) { ldns_resolver_deep_free(r); @@ -905,6 +929,10 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) bgtr = ldns_bget_token(b, word, LDNS_PARSE_NORMAL, (size_t) gtr + 1); while (bgtr > 0) { gtr -= bgtr; + if(word[0] == '#') { + expect = LDNS_RESOLV_KEYWORD; + break; + } tmp = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_DNAME, word); if (!tmp) { ldns_resolver_deep_free(r); @@ -926,23 +954,28 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) } break; case LDNS_RESOLV_SORTLIST: - gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr); + gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr); /* sortlist not implemented atm */ expect = LDNS_RESOLV_KEYWORD; break; case LDNS_RESOLV_OPTIONS: - gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr); + gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr); /* options not implemented atm */ expect = LDNS_RESOLV_KEYWORD; break; case LDNS_RESOLV_ANCHOR: /* a file containing a DNSSEC trust anchor */ - gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); + gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); if (gtr == 0) { ldns_resolver_deep_free(r); if(!fp) fclose(myfp); return LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR; } + if(word[0] == '#') { + expect = LDNS_RESOLV_KEYWORD; + continue; + } + #ifdef HAVE_SSL tmp_rr = ldns_read_anchor_file(word); (void) ldns_resolver_push_dnssec_anchor(r, tmp_rr); From nobody Wed May 15 10:16:04 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VfTdd1F7Jz5Kccn for ; Wed, 15 May 2024 10:16: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 4VfTdd0d9wz4krB; Wed, 15 May 2024 10:16:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715768165; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dWGxdlGwXa6UYKdBvL/7jbGTzlD3qVNBwclVeAnHwwE=; b=cMNn0HC+6JeBa5AOAYUacAvutKjOW4OoNhiNX5cnbK85BHXy1sXbvoIrWnLBw8PJEPm76O /n0I8ox311C1gZyxZf+6nU6eGDvDcsiE2rKJ8/KkBF6s+FBHuY3EIGOpcPPcMHSnRS5Sn1 ujWDAdim5DPg4B8ZFcKkKQnY1LUhonwLV9g6+TcsZZmxZ8085KMf1rd1jvwvTorS6/MOSu uo7hl8whSTmTi7xuqg9ipXpWcLofRM/X0XmwdCkpidYhCYr5XHIw04t+niylaS+v900C/0 YyqlSTPKvC9f16/Sry6OQZ/3j3J0f5jti4ozyEPT3TvedQEC3Nb2vZ8tFyg8jw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715768165; a=rsa-sha256; cv=none; b=oud+Ik5ngsRZSRGr7+VPEWHaC3ZhKxeY32j6Sv6SrsZwxTouKWIq2CxzeIHm9ZcADB9Bes IoqJuGMObkoRSiGzZlRjG6OSq2cn/C6YnjIag8bDdtypvMPRcWLxUl7t7xkv0/bV7gx3fA ZC/9jcFq4lqIkq0s+7iL23+KO8nP4vHPS5jaGMf9wt8C7ExHz9Kzf0gYH66yphwUBTKI1C KtajsRnCNFz1r0twd+nDNKwpqEwIGointNI72HcsUdLTEpDd3aEAuD6BhW1/KYZ7FBULSo bKPYD4+f8jH3jjw5RCcr5jCYCxCOhCAvHXojwbT3CVN6PgyufCEG/erdeAF8DA== 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=1715768165; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dWGxdlGwXa6UYKdBvL/7jbGTzlD3qVNBwclVeAnHwwE=; b=CDjwLqkldcZ176gBdQJ0b3tTxX7wXk++ZZE1Dcu5ya8OK4BFZaCQwFPf1lU/nocLyXHUuY lcpmdCCoX6LpKmEt4vFA9ap90H+bojclAz5GjjVDhT/exE5RENreinV44AAH2uocLV5Amf xGiqvY4iudhKIYqL9Uu+LBQuI0ZCgu0BrjjVRh+l37QpzgUM7CksI73Khs7FdhghHDtoL7 vl1dt+OvsbS7bWt9/r2hTqUtCaHWvkKhRLGPYFMUdtWA1pLvkwqSxHCmWHPXPpwtv+2MO8 HSqB+wgO8Z/82BwaxmTo39SFFz3EhlEcjl6FNnQ4Yx9Ha3FQP75fqfpv30g6yA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VfTdc72dgz19kT; Wed, 15 May 2024 10:16: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 44FAG4Ib078204; Wed, 15 May 2024 10:16:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44FAG434078203; Wed, 15 May 2024 10:16:04 GMT (envelope-from git) Date: Wed, 15 May 2024 10:16:04 GMT Message-Id: <202405151016.44FAG434078203@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 0c57cb21e0c6..4891157c57cc - vendor/ldns - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/vendor/ldns X-Git-Reftype: branch X-Git-Commit: 4891157c57ccd537cf8fc88feb002be10e94c288 X-Git-Oldrev: 0c57cb21e0c6a8a86fa074baeaeb6a002e2b7734 X-Git-Newrev: 4891157c57ccd537cf8fc88feb002be10e94c288 Auto-Submitted: auto-generated The branch vendor/ldns has been updated by des: URL: https://cgit.FreeBSD.org/src/log/?id=0c57cb21e0c6..4891157c57cc 4891157c57cc Fix bug in upstream PR 238. From nobody Wed May 15 11:57:16 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VfWtP0s1Zz5Klpq; Wed, 15 May 2024 11:57:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VfWtP0LPVz4rdK; Wed, 15 May 2024 11:57:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715774237; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yx6CJcTrSKSJ6yCW4UEeiSSgegzjZtMYyMIJwYUj5pc=; b=VxMW18oRb7cC3bggJwEyTawG5LPcYBmmpZg2+bga+0vu5pu7vklgrVGKJAF6jY8funawpp hwYhuYB+ERwxr4jJJsMwMX6lc2PWd/1l5qLmV1CWu86eEKO3FJ9anGJJrdtulpWqbc4zjj JXc59LamI4K+naS4uUVxFcIgv99YVfacU74aE8p6/MARiKUT0UsA8Lv5oSePBtG/XlOIxP uUyYKiUL/JUyeYC5dhEjEgFoAjm/6STtBQpV4+6REpWE/WoH18ml5sUWTp5Bur5gBJMiaQ bWjxE/Aw75q6oJTh8HnwF2AqAUIUUY9rwh/J1gp6BrbHnwOuLHnNKgCDvVmgGg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715774237; a=rsa-sha256; cv=none; b=JIvCgW/6lW7p2wueEqXSjFzFMUhh7Sv/J9ogHsTE/6dQHV0+VWEDWhsgrXstPJY6Oie+fA uHDu6VksiMfRmYzArufT0ayukp8e2WJnxOvELP0iNCqa7ctcM2j/GF7FhESC3fShuKgxC2 klvwOY+S1+Fgl6PO2ukXbvTxZSEAa67EVtLHqmtpyFHWq9MQDm9euQlKNhJOy8D9nVAV5a Bxctfiizot93dLCPRSEZaYL+9LW3QMLIl0yXYQhB7MXWk35rCO8xXLoxBFS8KGvyrpZPGM usmB+WnUlTb3TNdsZ3vKp/HxUiEm6RZ3ZW4FIUktJf8fRR7QvC2PwFkd9phs9w== 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=1715774237; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yx6CJcTrSKSJ6yCW4UEeiSSgegzjZtMYyMIJwYUj5pc=; b=syJLEf6MxStLiHmjlXNZh2Sw7+8NfDKBsjNxvR+EDYrFN+eQYAMRjPResZcxpi3Lw3elqy 4VPIhLdcSedhA7aHNwuPw0MrhNvtawjsRAc9gmPnyNtdThN+N9nd7cVbvi5/f4tRp6TwAu OsxCYjxybkacNy/tmSLyAPCx8yqTFdhAj4pbbmDMKwA/8R4ZbjlWB+fDwhjq+0SapT1tJT Ru4+Ectf5CHOQ/xN2Orf1pESRa5osuwIfUtAkMHhrL/Jhz0R9JtNjrE0Qu0DkpPvsIIicg wXI9GxKsALZpsVV12Hr5RfpcHj/lJ/+sWk/gAifrsBNPmG4AxQsO8NQiBpYWgg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VfWtN736PzDwk; Wed, 15 May 2024 11:57: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 44FBvGlw046239; Wed, 15 May 2024 11:57:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44FBvGuX046236; Wed, 15 May 2024 11:57:16 GMT (envelope-from git) Date: Wed, 15 May 2024 11:57:16 GMT Message-Id: <202405151157.44FBvGuX046236@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 3b092e4936c4 - main - ldns: Ignore commented-out lines in resolv.conf. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3b092e4936c433889cc668ea9563c8fd437d1a3e Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=3b092e4936c433889cc668ea9563c8fd437d1a3e commit 3b092e4936c433889cc668ea9563c8fd437d1a3e Merge: 154ad8e0f88f 4891157c57cc Author: Dag-Erling Smørgrav AuthorDate: 2024-05-15 10:16:24 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-15 10:20:15 +0000 ldns: Ignore commented-out lines in resolv.conf. This merges upstream PR 238 + an additional bug fix. PR: 278721 MFC after: 1 week contrib/ldns/ldns/parse.h | 2 ++ contrib/ldns/parse.c | 35 +++++++++++++++++++++++++++---- contrib/ldns/resolver.c | 53 ++++++++--------------------------------------- 3 files changed, 42 insertions(+), 48 deletions(-) From nobody Wed May 15 12:14:05 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VfXFp09zXz5KnVb; Wed, 15 May 2024 12:14:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VfXFn6rL6z4ss4; Wed, 15 May 2024 12:14:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715775246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6kf1s58xfzfC0rWa80IOFC90OVUPQqM2eu7Jjci9eQg=; b=C8NwLO3OHqS8DSj7lRTC6bbnry6lgwzPYQatvJcqhYSWMPlhuX3c5CbggLypXdPtEKOrZF rio96sW+YK2wLVduX6e9QrKono7kh/EBzGOobesu8bJnIo4ufiI1P45+Bhhn5sPjfE0/f1 zffor/ZaUeYiG/gy3Je8m12bK/Y2NPRNezMbOsL56q3eoscraKhcLKnlHUR5KYzBcDHltQ qnVy6A0PU+w+Swbdc/hYujzPZJ/zLQq/EtvtlHYdFd+FbF0i2pcKbj+toFpg6SI7uRYbuB CEOB0DIXrxqkLm8dlK8KgJ2S+dbEiRLHblCf8yd04TzxVPbudotrgFZp5Pj9/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715775246; a=rsa-sha256; cv=none; b=Fm2cmgh1lFePivJQbCcxmkIldlmF7FWDPSELwiRYF5jtzMcaIwhdLL89AkopFEPb/1gV5r ce88tTlxs6szpwKrLhJCgbjTQt1Mu3VY4wik5fNjKpQowOmigd6dyCEg8slzLhFW+LlPIk reg63Ljeaw5nhWVRXU6RqrB/6u2mEaxAYpdRWKHd3qEfMFAfdTLk0aczN6aVCOBL5/d2GN CBk1VT54FBuu9/71q6hrMMOLiyZ4EnHSekxcKWBd7Vnawj49nrFGNmoGRXABHlKs/HG7tJ bEc7iYMj/0S8IS3fugLKArgTjQVGI04vZjA9QTM+ZNAT9haQ41oy4VFNkpvYQw== 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=1715775246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6kf1s58xfzfC0rWa80IOFC90OVUPQqM2eu7Jjci9eQg=; b=tyLW/rUirJnjLCTnQn0ZXS07c1xaD5N+7zdJ9zOUZwOMIdfbvT9XTBShWwQwdg255lokJq g7Irt2oVF+RRCw31ILITEi+vrpC7yiQdrvuO1WDFXmKL/O71fSZhebwWgeNOCj9l3pIx3x Bf33KyZICCOFGY/LeU1nFG3HkVM/MpsdH6Cncy2AIKOF1DZEWON/LrZKG7V30xrlH1Mw9h voNM319k1Ie9nQ0cnN8svnrf3LEIz15lWc8AOoDmUM152QvRjFYqR9shPoOmGqvbDMnhDL 6jxyxLvMDnB/4WOqKiI6o7SBczTxhBnyOZhbDwWygmXomPDEFFPAuo1CnS+9tQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VfXFn6Rw0zDw3; Wed, 15 May 2024 12:14:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44FCE5Eb080936; Wed, 15 May 2024 12:14:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44FCE5XH080933; Wed, 15 May 2024 12:14:05 GMT (envelope-from git) Date: Wed, 15 May 2024 12:14:05 GMT Message-Id: <202405151214.44FCE5XH080933@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 46a619c6d4cf - main - adduser: Additional variable fixes. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 46a619c6d4cfc662069950baca16ec2a3b18b8a5 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=46a619c6d4cfc662069950baca16ec2a3b18b8a5 commit 46a619c6d4cfc662069950baca16ec2a3b18b8a5 Author: Dag-Erling Smørgrav AuthorDate: 2024-05-15 12:13:49 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-15 12:13:49 +0000 adduser: Additional variable fixes. One function used `_input` without making it local, causing its value to leak into other functions. This broke the `-f` case. Fix that instance and initialize all local variables that weren't already initialized. Fixes: 170d0882903e MFC after: 3 days Reviewed by: karels Differential Revision: https://reviews.freebsd.org/D45204 --- usr.sbin/adduser/adduser.sh | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/usr.sbin/adduser/adduser.sh b/usr.sbin/adduser/adduser.sh index 61a4b3b5058f..7c3fdb418179 100644 --- a/usr.sbin/adduser/adduser.sh +++ b/usr.sbin/adduser/adduser.sh @@ -53,7 +53,7 @@ info() { # by pw(8). # get_nextuid () { - local _uid=$1 _nextuid + local _uid=$1 _nextuid= if [ -z "$_uid" ]; then _nextuid="$(${PWCMD} usernext | cut -f1 -d:)" @@ -101,7 +101,7 @@ show_usage() { # basename of the shell is output. # valid_shells() { - local _prefix + local _prefix= ${GREPCMD} '^[^#]' ${ETCSHELLS} | while read _path _junk ; do @@ -119,7 +119,7 @@ valid_shells() { # full path to the shell from the /etc/shells file. # fullpath_from_shell() { - local _shell=$1 _fullpath + local _shell=$1 _fullpath= if [ -z "$_shell" ]; then return @@ -154,7 +154,7 @@ fullpath_from_shell() { # will emit an informational message saying so. # shell_exists() { - local _sh="$1" + local _sh=$1 if [ -z "$(fullpath_from_shell "$_sh")" ] ; then err "Invalid shell ($_sh) for user $username." @@ -193,8 +193,9 @@ save_config() { # message or lock the account, do so. # add_user() { - local _uid _name _comment _gecos _home _group _grouplist _shell _class - local _dotdir _expire _pwexpire _passwd _upasswd _passwdmethod _pwcmd + local _uid= _name= _comment= _gecos= _home= _group= _grouplist= + local _shell= _class= _dotdir= _expire= _pwexpire= _passwd= _upasswd= + local _passwdmethod= _pwcmd= # Is this a configuration run? If so, don't modify user database. # @@ -299,7 +300,7 @@ add_user() { fi fi - local _line _owner _perms _file _dir + local _line= _owner= _perms= _file= _dir= if [ -n "$msgflag" ]; then if [ -r "$msgfile" ]; then # We're evaluating the contents of an external file. @@ -331,7 +332,7 @@ add_user() { # a file it will output an error message and return to the caller. # get_user() { - local _input + local _input= # No need to take down user names if this is a configuration saving run. [ -n "$configflag" ] && return @@ -366,7 +367,7 @@ get_user() { # and batch (from file) mode. # get_gecos() { - local _input + local _input= # No need to take down additional user information for a configuration run. [ -n "$configflag" ] && return @@ -386,7 +387,7 @@ get_gecos() { # If an invalid shell is entered it will simply use the default shell. # get_shell() { - local _input _fullpath + local _input= _fullpath= ushell="$defaultshell" # Make sure the current value of the shell is a valid one @@ -424,7 +425,7 @@ get_shell() { # and batch input. # get_homedir() { - _input= + local _input= if [ -z "$fflag" ]; then echo -n "Home directory [${homeprefix}/${username}]: " read _input @@ -450,7 +451,7 @@ get_homedir() { # Reads the account's home directory permissions. # get_homeperm() { - local _input _prompt + local _input= _prompt= uhomeperm=$defaultHomePerm if [ -n "$uhomeperm" ]; then @@ -473,7 +474,7 @@ get_homeperm() { # so, enable ZFS home dataset creation. # get_zfs_home() { - local _prefix + local _prefix= # check if zfs kernel module is loaded before attempting to run zfs to # prevent loading the kernel module on systems that don't use ZFS @@ -494,7 +495,7 @@ get_zfs_home() { # allocates one if it is not specified. # get_uid() { - local _input _prompt + local _input= _prompt= uuid=${uidstart} if [ -n "$uuid" ]; then @@ -519,7 +520,7 @@ get_uid() { # Reads login class of account. Can be used in interactive or batch mode. # get_class() { - local _input _class + local _input= _class= uclass="$defaultclass" _class=${uclass:-"default"} @@ -541,7 +542,7 @@ get_class() { # will then provide a login group with the same name as the username. # get_logingroup() { - local _input + local _input= ulogingroup="$defaultLgroup" if [ -z "$fflag" ]; then @@ -560,7 +561,7 @@ get_logingroup() { # and batch modes. # get_groups() { - local _input _group + local _input= _group= ugroups="$defaultgroups" _group=${ulogingroup:-"${username}"} @@ -626,7 +627,7 @@ get_password() { # Ask user if they want to enable encryption on their ZFS home dataset. # get_zfs_encryption() { - local _input _prompt + local _input= _prompt= _prompt="Enable ZFS encryption? (yes/no) [${Zencrypt}]: " while : ; do echo -n "$_prompt" @@ -702,7 +703,7 @@ set_zfs_perms() { # adds it to the user database. # input_from_file() { - local _field + local _field= while read -r fileline ; do case "$fileline" in @@ -733,7 +734,7 @@ input_from_file() { # the user database. # input_interactive() { - local _disable _pass _passconfirm _input + local _disable= _pass= _passconfirm= _input= local _random="no" local _emptypass="no" local _usepass="yes" From nobody Wed May 15 13:22:00 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VfYm83pV3z5Kskd; Wed, 15 May 2024 13:22: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 4VfYm82tD4z428y; Wed, 15 May 2024 13:22:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715779320; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D52X0j7R6SiSd/qbHqd6+k8rVt1WUhS7eVVGQRE7zcM=; b=jZXHxVDbvLk8Rb7I+8qHH12Uost/foNTdkAtdTzeGkt5Nl34AHh9CIUzz56obFHhabh0Ad YxTy5QNoN1hnnFPwqi0FcCP/0vROyGzppTg9giVYdKVEtAM+IEaOec9O/Dk/xnkFTpzjfN 5Hua4PkefTVfUDOaEDUi5HZGAmEw6BF6RwTtYj3gD6UVUbHgRHLTbAl00B/OopFgDRtl6E fDeHfm9p+9ifL3N+anOLG4JWG9kZVFgwrb6EHJbCeQz9LZxql1YATvwdXPhdXcYHAFS4cW 0lZCrSmRXIvkHUwr8lxmgqK7VbUVF0FquvneMN/7QemhjsS99SZnONjqQ0ihpA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715779320; a=rsa-sha256; cv=none; b=iMprMIRR5HrhRr5xf+UICHbJmzyTKRiLAEuexGIiznC+qkkBcujmJBsvUhMsok66c/6qpw /Cb/0BvD9HKiWFiPlQk5+kl1BbUDCxYyCRvoxe1cmVdJhqhqrLrVi175D9KLENYPYFLhl9 hwr3tXgPO3fTZooQ1QRuD8R1cHJA5cPey4HrbwaDVrV3pum//WLbPmEgRpgZF98am1hFbv 6GcZ3ns6KyZ5zkI2mip5DXs7nfBuq3kyyIcYIiPFoaSJSHNMJPSnC6XMQ3rrqPwyYYD40Y GERog/ibwaqbiKOCl0lDJMKnTKhVGaggCnp2VOSIS+WTo26ONR8jyRO+JoQjZA== 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=1715779320; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D52X0j7R6SiSd/qbHqd6+k8rVt1WUhS7eVVGQRE7zcM=; b=Q1Vm6O/BWKir7YlznqpOZyZeAmmUV/XP0FGLlL11CMMmBauoaiZ2A2CKsMGuhoWZfLtNSz 3zzFpTVJyCfcc0wTJdQhqhKqy4HOTBEmbJ8VGXLvPzy6s/jvusXDeywFiB7a/8jGfh7Btr ZhmAO0/VWcks/Gayo05hH1sWDwhCDWBuZKPIbpIB0ScKvzth9KIgAl5dtMaztrS07Zq3eE j7O4/SWVtXN1eMqxjDGGZBWBkrHucZCEe/TpCd5ZgLiZBgHNNf7TimedKDw72mlDavaVry YySSocnkiy19KHESe54eSTqQ3EL984dMe03ynQfAD3gfTnjoFwZqKWzgEQR1Ug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VfYm82TgvzGdC; Wed, 15 May 2024 13:22: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 44FDM0Rv093799; Wed, 15 May 2024 13:22:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44FDM0hf093797; Wed, 15 May 2024 13:22:00 GMT (envelope-from git) Date: Wed, 15 May 2024 13:22:00 GMT Message-Id: <202405151322.44FDM0hf093797@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: 6adfee18effb - stable/14 - sys/namei.h: move NI_CAP_VIOLATION() macro from namei.h to vfs_lookup.c List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6adfee18effba91ff56341549a4e28473738316a Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6adfee18effba91ff56341549a4e28473738316a commit 6adfee18effba91ff56341549a4e28473738316a Author: Konstantin Belousov AuthorDate: 2024-04-24 18:55:37 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-15 13:21:34 +0000 sys/namei.h: move NI_CAP_VIOLATION() macro from namei.h to vfs_lookup.c (cherry picked from commit 66df81021e5437e86ff5e0886c35170feb1cd3a0) --- sys/kern/vfs_lookup.c | 5 +++++ sys/sys/namei.h | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 600af6d486eb..f7fb986d4472 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -88,6 +88,11 @@ static void NDVALIDATE_impl(struct nameidata *, int); ndp->ni_cnd.cn_flags |= ISRESTARTED; \ } while (0) +#define NI_CAP_VIOLATION(ndp, path) do { \ + ktrcapfail(CAPFAIL_NAMEI, (path)); \ + (ndp)->ni_lcf &= ~NI_LCF_KTR_FLAGS; \ +} while (0) + SDT_PROVIDER_DEFINE(vfs); SDT_PROBE_DEFINE4(vfs, namei, lookup, entry, "struct vnode *", "char *", "unsigned long", "bool"); diff --git a/sys/sys/namei.h b/sys/sys/namei.h index d464423c025c..f6279700e735 100644 --- a/sys/sys/namei.h +++ b/sys/sys/namei.h @@ -205,11 +205,6 @@ int cache_fplookup(struct nameidata *ndp, enum cache_fpl_status *status, #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 Wed May 15 13:22:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VfYm94wkvz5KsdV; Wed, 15 May 2024 13:22: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 4VfYm93v0Bz42TH; Wed, 15 May 2024 13:22:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715779321; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H1cMg/LToz2I5vn+UbnkDm31t8L9coau5wofO8ovLU4=; b=OSs+Y2SDeVJvUYHSiLlIEGChl1efnY6zDgP3vohb9pHgdXczZu0MekXvWnuWdv/XCBGTNw peqK7Hywp+6+MoM078yZ3ppSM8+G1NCNDAbIJc3HUyMliCgUJq/gyWaJgBIAquI682TV+3 1BtKOiB+mnmUI3RtHQ9aHkloJhhLbD88FEQ9AQs2xl0Vc93tKSZzi9vI9RcA1jdw0nb/4W 0o5FHTklVL9lsYl1KiR22cOH+jgUgyn1pm5bPcpinwOkmsRo4lJ1mYKkG9V8GZT9zBqBHw Xd7CK9bdLR9GeMm7/cDwfb2X/fe/fnfJUICpSFUMDRCEbJk/ucLjQvfaLlenLQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715779321; a=rsa-sha256; cv=none; b=VQyR8PmWDte9w4noGxqeYtJM4wZWxPAnsZOSn+blct9I6WekE8Ies3xge971Hb5QjSkyJg FvtXHRkVOlAZeGeShFAO1WowSLPOOh7kcnsjmGofUmvDUozrt/FptVR4T6gtOkSA6cg2jY ExvYrHgXA5wqFhgKwG7w5SwAbQlwrHB0KhmSldncle9L2L8opPqAzz3q1lTt20hiCKexLM v0UrTgRVREzdyH0siy9bxfJM6k6mxNnSWdyMCTVzwop96SdXfUydj5/W9eFdM97UluY0TH IRns7hLSdA/9JHHrTnB2TmwfbquPiJ84VSinEMjy2/sIjntbfMvWSpHNyZnKlw== 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=1715779321; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H1cMg/LToz2I5vn+UbnkDm31t8L9coau5wofO8ovLU4=; b=qNnr+Z8nJbj4FWVTHXdFwbCSeXylNxUym8FJfRmkLgaaUu55TlDL5mBWcB8tmNT3rNBv8U 0MhIOyuBv+EtDPxTQfz1+Ni8uaXaKeFXz7PacHQKGH11NECF13W1+mZSbGmk5++6+dXy1u fauU5uttlRQQdzdH+f+HiI1FO5+SgAekVjI0ZjV7zdoO6EbogUTA/UF5rMIv3mgyyJRtla bdVz7HW2VE7iWh83nAkzN+CYkelSjIqlqJasxQinU3fMsBh3zDcgM/UNRbYANdfpT+nxtN TuHTzTNVnm0dKlRedMtdjYuDuOHcMGEpiT68EUX5TYOaLb6S9YlLyWX0hqNYew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VfYm93VK7zH4s; Wed, 15 May 2024 13:22: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 44FDM1Gt093856; Wed, 15 May 2024 13:22:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44FDM1xg093853; Wed, 15 May 2024 13:22:01 GMT (envelope-from git) Date: Wed, 15 May 2024 13:22:01 GMT Message-Id: <202405151322.44FDM1xg093853@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: 00cf2f3092e4 - stable/14 - vfs_lookup.c: only call ktrcapfail() if KTRACE is enabled List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 00cf2f3092e462b8840b8cb9c3d86c471da065e5 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=00cf2f3092e462b8840b8cb9c3d86c471da065e5 commit 00cf2f3092e462b8840b8cb9c3d86c471da065e5 Author: Konstantin Belousov AuthorDate: 2024-04-24 19:06:14 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-15 13:21:35 +0000 vfs_lookup.c: only call ktrcapfail() if KTRACE is enabled (cherry picked from commit 6b0cf2a2379b86b67269ed4549057cd6d69490e5) --- sys/kern/vfs_lookup.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index f7fb986d4472..b7f751a364ce 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -88,8 +88,14 @@ static void NDVALIDATE_impl(struct nameidata *, int); ndp->ni_cnd.cn_flags |= ISRESTARTED; \ } while (0) +#ifdef KTRACE +#define NIKTRCAPFAIL(path) ktrcapfail(CAPFAIL_NAMEI, (path)) +#else +#define NIKTRCAPFAIL(path) +#endif + #define NI_CAP_VIOLATION(ndp, path) do { \ - ktrcapfail(CAPFAIL_NAMEI, (path)); \ + NIKTRCAPFAIL(path); \ (ndp)->ni_lcf &= ~NI_LCF_KTR_FLAGS; \ } while (0) From nobody Wed May 15 13:39:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VfZ8L6TfXz5Ktkl; Wed, 15 May 2024 13:39: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 4VfZ8L5yLyz43CS; Wed, 15 May 2024 13:39:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715780370; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SfRn2yV996lC3iZgWzOl6FPCktJVJqdtA8vJkPKu3kA=; b=apPemxA6NRWMMDRxNDB0OP9GlQd55XShbRk4w7n9gzItKWY9TNaANR+vBBssbNpfKUAO6L 7OViqonT+5y/sWvh9ActDh1TPAVQ7iah7qOLvue8ab8amK9ov/e5AAmHOKR24Q+ijip941 kb/mYMC4PSx/QKoEyxwmajJaaILnb9yMJEez2dEZqDnWoPLNPuhE72AuSckGwmCrorwnlI j9hR0hIu1K1fb8wiDErz7dekRMHo3hTinWlXC3FPjTa1IQcCsteMNp8uazLX2EA67JqSc+ ygsiNHVT6/9Q/e8vwCsD0IKyfE8eOeuLxSS2buwIRvHB51uxBzjDtlFN9ErYbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715780370; a=rsa-sha256; cv=none; b=PtmzmPSQK863umL365Stzb3/OxwOBG4fpUsRKjw2T3qrn+fskChKFtHdi3lsbwHVhjh5M5 2qdNfcmdPIGBzbkduqY7AgNd2313RaKnvLtFcAfWCpTzw3240F8nXDP07UkQ0nO2ilCy4x F2h+qObvLrmyi3ot4FcA48MNk4gNM92lPYkF/A0J8JFHMyTbLZ3raJQj1/fuHt3fmH389J CndQj+jahnf71JRqMpmJPgTeaSLNq41ehwLK+zA/TANwcFy6jHp+PmGSqTrIP14dOpNfqv wB4wj2k/7ePC1X0P1JReTWhgqx1BERTQ6B627ybqsA8MK/3yvGGoaeJPf1kBZA== 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=1715780370; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SfRn2yV996lC3iZgWzOl6FPCktJVJqdtA8vJkPKu3kA=; b=ZPTWedcS88d3ZBonXw/oq5dUWXqQRfTveXWeGLsa1U26G/lYBW4sOBk1Izz+Ozt7fVEdOz 46b3Rj70Ux7ESEg0kNizW7gd1VY/I5OZquCpxSDIDbMl/b6qGq7FIuXKyb2hv1wL1gmPXp bPLLqj4Fd0sc5BBwlwvPRgPyJNFaKTXmv0JeqPVXaSDd7z7HfvMxJzK/aFLyZNkXg5zh7E ZArGxLHUMzkc5eo16nsWdqtXt+zeZv/PsR2ygMDtQa5hsZuvBihKEibWEMc/NJ6U1RiI+4 ozqkdualubl5otDVYP8WOth/NEvjxX37zRDyaD1UuUfo0ORyXhTof2psC0Gydw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VfZ8L5FvszH9V; Wed, 15 May 2024 13:39: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 44FDdUZW015970; Wed, 15 May 2024 13:39:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44FDdUQW015967; Wed, 15 May 2024 13:39:30 GMT (envelope-from git) Date: Wed, 15 May 2024 13:39:30 GMT Message-Id: <202405151339.44FDdUQW015967@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 42b28f815214 - main - ifconfig: Markup nits. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 42b28f815214aa582fe4ca707687d3af47850230 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=42b28f815214aa582fe4ca707687d3af47850230 commit 42b28f815214aa582fe4ca707687d3af47850230 Author: Dag-Erling Smørgrav AuthorDate: 2024-05-15 13:38:11 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-15 13:38:53 +0000 ifconfig: Markup nits. MFC after: 3 days Reviewed by: imp, allanjude Differential Revision: https://reviews.freebsd.org/D45209 --- sbin/ifconfig/ifconfig.8 | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 index 72f4883a9e26..e91dff6e59fd 100644 --- a/sbin/ifconfig/ifconfig.8 +++ b/sbin/ifconfig/ifconfig.8 @@ -472,13 +472,17 @@ sending out requests and listening for replies. .It Cm stickyarp Enable the so-called sticky ARP mode for the interface. If this option is enabled on the given interface, any resolved address is -marked as a static one and never expires. This may be used to increase +marked as a static one and never expires. +This may be used to increase security of the network by preventing ARP spoofing or to reduce latency for high-performance Ethernet networks where the time needed for ARP resolution is -too high. Please note that a similar feature is also provided for bridges. See +too high. +Please note that a similar feature is also provided for bridges. +See the sticky option in the .Sx Bridge Interface Parameters -section. Enabling this +section. +Enabling this option may impact techniques which rely on ARP expiration/overwriting feature such as load-balancers or high-availabity solutions such as .Xr carp 4 . @@ -1236,8 +1240,8 @@ Set the interval at which beacon frames are sent when operating in ad-hoc or ap mode. The .Ar interval -parameter is specified in TU's (1024 usecs). -By default beacon frames are transmitted every 100 TU's. +parameter is specified in TUs (1024 usecs). +By default beacon frames are transmitted every 100 TUs. .It Cm bmissthreshold Ar count Set the number of consecutive missed beacons at which the station will attempt to roam (i.e., search for a new access point). @@ -1894,8 +1898,8 @@ Use .Fl powersave to disable powersave operation when operating as a client. .It Cm powersavesleep Ar sleep -Set the desired max powersave sleep time in TU's (1024 usecs). -By default the max powersave sleep time is 100 TU's. +Set the desired max powersave sleep time in TUs (1024 usecs). +By default the max powersave sleep time is 100 TUs. .It Cm protmode Ar technique For interfaces operating in 802.11g, use the specified .Ar technique From nobody Wed May 15 14:36:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VfbPk4BMCz5KyZY; Wed, 15 May 2024 14:36: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 4VfbPk3dckz49l7; Wed, 15 May 2024 14:36:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715783770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zA2ALXsa9hukEESHKRgZS9MDq+p3YfLKIgN/VJs5vMs=; b=RzzPmkYQtX0x0eDPGQlgQ7RkYwgYhCie99kOZAUxah5BuMJ4rjbughEkb0WyMGiCY5Nd/3 KK4Hm9N7wQgrlZljAUwcJfWnqV2AxevD/HOo0FiEyeNXSYmB/P+EeLOHPZZsoiW7ZTJrOa IslrgtF/DmXMWhstxeI/aoDWfM3KWQoE8eZeXCHa0XzVfZ20GbPafjma0HGbqXUd9ZsTje LwWSzyi2IZ7Qxar4vl2I1v7+6PbnEoVvwMW5wgt3mVhXyeG9rWtj2xlKj4Kq8v9VGEC44I wIM++kubYMZ3Q7bzJ61K3zr4LASNz9FUoiCuiLl6zOFlxi1I00gk8FB6eKKLWg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715783770; a=rsa-sha256; cv=none; b=PDyLtIbiYHzcsanPERLSM9Fk8C7XKmzQqGYyYbwBYS/aTQ1cY7j4ebbxMS5KwDzn8aDyI9 IGXf7+kltkaWnc0zmJK5qVcLGNPuzY2LgHmmYX1Ev6W9cESJcBlnaJqjqZos0CjIEdYqJd TY49zTpJNSdZ2ZGTMRWcmW7d8W1hXLXoX1YLaLRNyB38iVeoOl630CrBe5HBaGwFL7mT2B pOY7tA+ltpVyH5d7ik9mkQXtsiy5qChFFgSFHAzJ9+cAsONpTERuTRtpOF0+gHgL4s+FJa oRbvJjOvXo0wqj1N3b+fQjo7Bcph7qJllOzjmHHG8CST5Cuj81vGcTsX7qMTMQ== 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=1715783770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zA2ALXsa9hukEESHKRgZS9MDq+p3YfLKIgN/VJs5vMs=; b=N25s9+7AHKC3WvdgZtSo5dgS/OC4T/JygYCRxVoCLZOJWLW8ABTt6kLwF8SctNYM+EQKpr VxGfmpSPgVtOmks45q6uY33m2h6BiW/KnH/gMqvuNnNhZMGJxjFT1y3OV8UZntWTZY7D34 cljyMcsVgr/2V5vawPcjIV7rOYaBXw8ZQeYJjXBEmfyozziZ8+3s7QJbmTsPib0diiobC7 UeSeNnMbrOwl4GJMIta7TPVFro5a72skJnbpMyF5zs0qu75/B3vcygD+rIqf6CWTq1Ebjx nOIAhs4GVtNn8TBJlfO+L0CIYmRffdsXvesuath1rabSxz1t2aM5D016u9apCA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VfbPk3DjHzJPM; Wed, 15 May 2024 14:36: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 44FEaA0Q017104; Wed, 15 May 2024 14:36:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44FEaAfT017101; Wed, 15 May 2024 14:36:10 GMT (envelope-from git) Date: Wed, 15 May 2024 14:36:10 GMT Message-Id: <202405151436.44FEaAfT017101@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Joseph Mingrone Subject: git: ea3751fb53b2 - main - freebsd-tips: Tweak fortune to find font providing Unicode character List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ea3751fb53b21a1e8daaf157cb90a69996e4fe2d Auto-Submitted: auto-generated The branch main has been updated by jrm: URL: https://cgit.FreeBSD.org/src/commit/?id=ea3751fb53b21a1e8daaf157cb90a69996e4fe2d commit ea3751fb53b21a1e8daaf157cb90a69996e4fe2d Author: Joseph Mingrone AuthorDate: 2024-05-15 14:26:25 +0000 Commit: Joseph Mingrone CommitDate: 2024-05-15 14:34:39 +0000 freebsd-tips: Tweak fortune to find font providing Unicode character While here, remove my name and email address. Reported by: bapt Sponsored by: The FreeBSD Foundation --- usr.bin/fortune/datfiles/freebsd-tips | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/usr.bin/fortune/datfiles/freebsd-tips b/usr.bin/fortune/datfiles/freebsd-tips index e24d3640b8c6..c0807405005e 100644 --- a/usr.bin/fortune/datfiles/freebsd-tips +++ b/usr.bin/fortune/datfiles/freebsd-tips @@ -845,17 +845,14 @@ kern.tty_info_kstacks to 0 (off), 1 (on), or 2 (verbose), e.g.: -- Michael Gmelin % - -Under X Windows, you can determine which fonts provide a particular Unicode -character using fc-list from the fontconfig package. For example, if your -friend complains that the emoji you sent won't display, run fc-list with the hex -value of the character to determine which font your friend should install. +To determine which fonts provide a particular Unicode character, fc-list from +the fontconfig package may be helpful. For example, if your friend complains +that the emoji you sent won't display, run fc-list with the hex value of the +character to determine which font your friend should install. $ fc-list ':charset=0x1F4A1' /usr/local/share/fonts/noto/NotoColorEmoji.ttf: Noto Color Emoji:style=Regular $ pkg which /usr/local/share/fonts/noto/NotoColorEmoji.ttf -/usr/local/share/fonts/noto/NotoColorEmoji.ttf was installed by package noto-emoji-2.042_1 - - -- Joe Mingrone +/usr/local/share/fonts/noto/NotoColorEmoji.ttf was installed by package noto-emoji-2.042 % From nobody Wed May 15 15:01:39 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VfbzR6YCgz5L1gD for ; Wed, 15 May 2024 15:01:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VfbzR4nwQz4Lb8 for ; Wed, 15 May 2024 15:01:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-51ff65b1e14so7731553e87.2 for ; Wed, 15 May 2024 08:01:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1715785311; x=1716390111; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=KoN8vB4x1dyinzCuMvFy2dANeNO9HP0snCSOYTXo4PQ=; b=OjVoJGZSDAOZ1Hdny/eniZqPwKrc4WuhuZznxY8Nds4a6euQpkZ8B3sEzB8oKmhxGu 6JT1wfpnnIZSZg2gkhGHBFP0ydl1ag2TJAgt19UBjrgLfF4mrwpHqvFlLfWkuTDyhruQ A7UQr4RJx1S+TjLH+As1m9Ns1JFCqAzb31VXQYR0rN7Px2f08cH+suVBwTlFJ9dK0nbG 7ds/GxXvQVxWmd4foDMOawSnLklYsGUqLISGF5EkAJZucDJOTKrT/19cIygx0TYegrPD v2ZZ9wc/JTaJOSrUkW2yWPbiLG5GumiCdlCyYJWCaF02PQA4KfCv0/GAzkbT0m1QHCkH 90vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715785311; x=1716390111; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=KoN8vB4x1dyinzCuMvFy2dANeNO9HP0snCSOYTXo4PQ=; b=JBD5DyDcU/2Ig2a+Eyq/bnIkLNanBVTGyxSZH0KKBOcg9RxWM+vSfFtWyar8CBPfRs lOCqPC9Ns2KXsORrwseD7El7fZcMiNh8TF3f/MUJ/js7F2dZliu//frG22hHS4qPl0Cy 9gfZx1w3PSYBUCt35KPXVq/sSmc9LHxSKvIfxPAwS76UJeAkIWUJN4AP2zIGuyN+nLFF AZcuYxK0wV/EjmSd2nJziYJtLir+p/l6GeVn7fYTowktIHhiUa5PTXryRwArg5iXUR2g Ao+20NXjkUSDsHl8+KFMM4siZJXvIwVdl8fZM8Dn3TOz9xGZ6wOCRJc3vgInJ21Cp0Ah W4iA== X-Forwarded-Encrypted: i=1; AJvYcCUtj4urvY/35+W+gvgl0+8AUCavDkrGrYtHnGhMUPiQ3F+uC6KC/yBaOEYW1Hgmi1rHkj+LO0Mqzzlztr53EEOT4UVhWa9FjSiyaENaGD2k X-Gm-Message-State: AOJu0Yxuh8/yGgZf0cYg5tXII+pvZqUJRKkUKziF3qOtYk0GWkIBWyRW SNFOKxn3tugartTSp2oCb3EVuRpikqCbdVq9LdCJPeiClyrEElopAqQyQBKIqA8/N1yZL5EfIh7 jzPNlhA6SM8Z1cN7Pyk+BbIQ9rzSx/yeUfpA8pA== X-Google-Smtp-Source: AGHT+IEiUsKzWPYtZH9N74StRZLSflnpXKtjNDj/dhgS7sasZC8YaVjyaEt1zPcoukl37ZcmdLZDi9QPOPXxq1dV37g= X-Received: by 2002:a19:5e13:0:b0:51c:cd6d:ad21 with SMTP id 2adb3069b0e04-5221007026fmr9679464e87.47.1715785310840; Wed, 15 May 2024 08:01:50 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202405150953.44F9rvSw043707@gitrepo.freebsd.org> <865xvfz90f.fsf@ltc.des.dev> In-Reply-To: <865xvfz90f.fsf@ltc.des.dev> From: Warner Losh Date: Wed, 15 May 2024 09:01:39 -0600 Message-ID: Subject: Re: git: b5fb1f44ed43 - main - Issue #237 : Resolver uses nameserver commented out in /etc/resolv.conf To: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000f6d34206187f65b9" X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Queue-Id: 4VfbzR4nwQz4Lb8 --000000000000f6d34206187f65b9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, May 15, 2024 at 4:04=E2=80=AFAM Dag-Erling Sm=C3=B8rgrav wrote: > Dag-Erling Sm=C3=B8rgrav writes: > > The branch main has been updated by des: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3Db5fb1f44ed435fa25fe3de87c9b9ee6= c0aad5125 > > > > commit b5fb1f44ed435fa25fe3de87c9b9ee6c0aad5125 > > Author: Willem Toorop > > AuthorDate: 2024-05-07 12:43:16 +0000 > > Commit: Dag-Erling Sm=C3=B8rgrav > > CommitDate: 2024-05-15 09:52:49 +0000 > > > > Issue #237 : Resolver uses nameserver commented out in > /etc/resolv.conf > > > > This /etc/resolv.conf: > > # x > > > > # nameserver 8.8.8.8 > > > > Still configured 8.8.8.8 as nameserver, because the comment > detection in `ldns_resolver_new_frm_fp_l()` didn't anticipate empty lines > before the comment. > > This fix removed all comment handling from > `ldns_resolver_new_frm_fp_l()`. Instead a new function is introduced > `ldns_fget_token_l_resolv_conf()` that skips comments that start with '#' > and ';'. The old `ldns_fget_token_l()` (that is used for zonefiles too) > still accepts only ';' for comments. > > --- > > contrib/ldns/parse.c | 35 +++++++++++++++++++++++++++---- > > contrib/ldns/resolver.c | 55 > ++++++++++--------------------------------------- > > 2 files changed, 42 insertions(+), 48 deletions(-) > > I actually did this as a subtree merge: > > % git subtree merge --prefix=3Dcontrib/ldns vendor/ldns > Merge made by the 'ort' strategy. > contrib/ldns/parse.c | 35 +++++++++++++++++++++++++++---- > contrib/ldns/resolver.c | 55 > ++++++++++--------------------------------------- > 2 files changed, 42 insertions(+), 48 deletions(-) > % git show > % git commit --amend > [main 2dbd65dc861c] ldns: Ignore commented-out lines in resolv.conf. > Date: Wed May 15 11:50:11 2024 +0200 > % git commit --amend > [main bee1ed74ab26] ldns: Ignore commented-out lines in resolv.conf. > Date: Wed May 15 11:50:11 2024 +0200 > > However, I had to rebase before pushing and that appears to have dropped > the merge commit, and I didn't notice until after I'd pushed. > > % git reflog > b5fb1f44ed43 (HEAD -> main, freebsd/main, freebsd/HEAD) HEAD@{0}: pull > --rebase (finish): returning to refs/heads/main > b5fb1f44ed43 (HEAD -> main, freebsd/main, freebsd/HEAD) HEAD@{1}: pull > --rebase (pick): Issue #237 : Resolver uses nameserver commented out in > /etc/resolv.conf > 61dece6d27fb (github/main) HEAD@{2}: pull --rebase (start): checkout > 61dece6d27fb2436928ca93d65667b358e05aa7b > bee1ed74ab26 HEAD@{3}: commit (amend): ldns: Ignore commented-out lines > in resolv.conf. > 2dbd65dc861c HEAD@{4}: commit (amend): ldns: Ignore commented-out lines > in resolv.conf. > 74ce793d921d HEAD@{5}: merge 0c57cb21e0c6a8a86fa074baeaeb6a002e2b7734: > Merge made by the 'ort' strategy. > 61dece6d27fb (github/main) HEAD@{6}: pull --rebase: Fast-forward > The next merge should be fine. git will eliminate the already applied deltas. It can usually do this even if you just always cherry-pick, but as the span gets larger and larger, the algorithms inside of git break down. We've had this issue with ACPICA, but as far as I know, nothing else (I've fixed it, or have a tree with it fixed somewhere). So missing a merge commit occasionally generates only a little confusion, but usually isn't a huge deal for the maintainer's next merge. There's no way to fix it after the fact (well, you can do a revert commit and then redo the subtree merge, but that's a lot of churn for almost no benefit). The vendor branch handbook section has information on what to do when you lose the "push race" since rebase with merge commits is 'fragile'. There's ways one can do it, but they only sometimes work. Or they are dropped entirely (like you experienced). Ed Maste also has a recipe that I find to be riskier, but would be more efficient for scripting. The tl;dr is: update vendor branch, etc then git checkout main git subtree merge create branch JUNK to save your work git checkout -B main freebsd/main (abandoning the merge commit on main) git checkout JUNK git merge main (yes, this is a merge commit, but it creates a 'loop' so you can't push it, it's a bookmark to save your work) git checkout main git subtree merge (same as above) git checkout JUNK . (the . is important, since that overwrites the current tree with the contents of JUNK, rather than moving to the branch) git push (hope you don't lose the race again, otherwise go back to ) git branch -D JUNK (you don't need it anymore, it was just to save the merged result). Though often if there's no conflicts that need to be fixed in the subtree merge, the above is overkill. Just do the subtree merge from a clean main. It's faster and simpler. But honestly, this should be one of the things we have a script for since the above is tedious and error-prone.... I often forget something if I'm doing this under the gun. Warner --000000000000f6d34206187f65b9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Wed, May 15, 2024 at 4:04=E2=80=AF= AM Dag-Erling Sm=C3=B8rgrav <des@free= bsd.org> wrote:
Dag-Erling Sm=C3=B8rgrav <des@FreeBSD.org> writes:
> The branch main has been updated by des:
>
> URL: https://= cgit.FreeBSD.org/src/commit/?id=3Db5fb1f44ed435fa25fe3de87c9b9ee6c0aad5125<= /a>
>
> commit b5fb1f44ed435fa25fe3de87c9b9ee6c0aad5125
> Author:=C2=A0 =C2=A0 =C2=A0Willem Toorop <
willem@nlnetlabs.nl>
> AuthorDate: 2024-05-07 12:43:16 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Dag-Erling Sm=C3=B8rgrav <des@FreeBSD.or= g>
> CommitDate: 2024-05-15 09:52:49 +0000
>
>=C2=A0 =C2=A0 =C2=A0Issue #237 : Resolver uses nameserver commented out= in /etc/resolv.conf
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0This /etc/resolv.conf:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# x
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# nameserver 8.8.8.8
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0Still configured 8.8.8.8 as nameserver, because the= comment detection in `ldns_resolver_new_frm_fp_l()` didn't anticipate = empty lines before the comment.
>=C2=A0 =C2=A0 =C2=A0This fix removed all comment handling from `ldns_re= solver_new_frm_fp_l()`. Instead a new function is introduced `ldns_fget_tok= en_l_resolv_conf()` that skips comments that start with '#' and = 9;;'. The old `ldns_fget_token_l()` (that is used for zonefiles too) st= ill accepts only ';' for comments.
> ---
>=C2=A0 contrib/ldns/parse.c=C2=A0 =C2=A0 | 35 +++++++++++++++++++++++++= ++----
>=C2=A0 contrib/ldns/resolver.c | 55 ++++++++++-------------------------= --------------
>=C2=A0 2 files changed, 42 insertions(+), 48 deletions(-)

I actually did this as a subtree merge:

% git subtree merge --prefix=3Dcontrib/ldns vendor/ldns
Merge made by the 'ort' strategy.
=C2=A0contrib/ldns/parse.c=C2=A0 =C2=A0 | 35 +++++++++++++++++++++++++++---= -
=C2=A0contrib/ldns/resolver.c | 55 ++++++++++------------------------------= ---------
=C2=A02 files changed, 42 insertions(+), 48 deletions(-)
% git show
% git commit --amend
[main 2dbd65dc861c] ldns: Ignore commented-out lines in resolv.conf.
=C2=A0Date: Wed May 15 11:50:11 2024 +0200
% git commit --amend=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
[main bee1ed74ab26] ldns: Ignore commented-out lines in resolv.conf.
=C2=A0Date: Wed May 15 11:50:11 2024 +0200

However, I had to rebase before pushing and that appears to have dropped the merge commit, and I didn't notice until after I'd pushed.

% git reflog
b5fb1f44ed43 (HEAD -> main, freebsd/main, freebsd/HEAD) HEAD@{0}: pull -= -rebase (finish): returning to refs/heads/main
b5fb1f44ed43 (HEAD -> main, freebsd/main, freebsd/HEAD) HEAD@{1}: pull -= -rebase (pick): Issue #237 : Resolver uses nameserver commented out in /etc= /resolv.conf
61dece6d27fb (github/main) HEAD@{2}: pull --rebase (start): checkout 61dece= 6d27fb2436928ca93d65667b358e05aa7b
bee1ed74ab26 HEAD@{3}: commit (amend): ldns: Ignore commented-out lines in = resolv.conf.
2dbd65dc861c HEAD@{4}: commit (amend): ldns: Ignore commented-out lines in = resolv.conf.
74ce793d921d HEAD@{5}: merge 0c57cb21e0c6a8a86fa074baeaeb6a002e2b7734: Merg= e made by the 'ort' strategy.
61dece6d27fb (github/main) HEAD@{6}: pull --rebase: Fast-forward

The next merge should be fine. git will eliminate= the already applied deltas. It can usually do this even if you just always= cherry-pick, but as the span gets larger and larger, the algorithms inside= of git break down. We've had this issue with ACPICA, but as far as I k= now, nothing else (I've fixed it, or have a tree with it fixed somewher= e). So missing a merge commit occasionally=C2=A0 generates only a little co= nfusion, but usually isn't a huge deal for the maintainer's next me= rge. There's no way to fix it after the fact (well, you can do a revert= commit and then redo the subtree merge, but that's a lot of churn for = almost no benefit).

The vendor branch handbook sec= tion has information on what to do when you lose the "push race" = since rebase with merge commits is 'fragile'. There's ways one = can do it, but they only sometimes work. Or they are dropped entirely (like= you experienced). Ed Maste also has a recipe=C2=A0that I find to be riskie= r, but would be more efficient for scripting. The tl;dr is:

<= /div>
update vendor branch, etc then git checkout main
gi= t subtree merge
<lose the race>
create branch JUN= K to save your work
git checkout -B main freebsd/main (abandoning= the merge commit on main)
git checkout JUNK
git merge = main (yes, this is a merge commit, but it creates a 'loop' so you c= an't push it, it's a bookmark to save your work)
git chec= kout main
git subtree merge (same as above)
git checkou= t JUNK . (the . is important, since that overwrites the current tree with t= he contents of JUNK, rather than moving to the branch)
git push (= hope you don't lose the race again, otherwise go back to <lose the r= ace>)
git branch -D JUNK (you don't need it anymore, it wa= s just to save the merged result).

Though often if= there's no conflicts that need to be fixed in the subtree merge, the a= bove is overkill. Just do the subtree merge from a clean main. It's fas= ter and simpler.

But honestly, this should be one = of the things we have a script for since the above is tedious and error-pro= ne.... I often forget something if I'm doing this under the gun.
<= div>
Warner
--000000000000f6d34206187f65b9-- From nobody Wed May 15 15:34:37 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vfcj93m0Kz5L3rc; Wed, 15 May 2024 15:34:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vfcj91RxQz4Q4Q; Wed, 15 May 2024 15:34:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715787277; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VPhGT4F3HxFOUQSPJ5+LAmXzSQbxythbD3aSlUJo2aE=; b=eQK6g5pZl6kIy2IxCMzrcSLpZKjraa/wxojjox9cxDizxtZqCmlpmkwcSmcXmBftG7b1c2 LaIOn3RaULPGZ99pzjuWhEag8BFYn3H67ILSGJ9dnP+ZX2DzxI+oQ6nqbApiiVkG3bbMud QZhpLHV9odZtlhJnz0wqckiHtivLePPYpru/4ZriV9FROGCxioq6i3zF8ygRANF8ehAGVQ rqbbFzjhL9YxsSt65/wcKB7NZmuC/d9U2yEECWzl6FB7z42mJ0+HaZkYbUpaQ3sS2Xu2iR ZbvgHyF11p4dTwb8g4vy3ExcMr5TbUrfsYm4YDlbc132CTJ+qfieSU6vsZuWAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715787277; a=rsa-sha256; cv=none; b=Gp9Nz01IpZ9lftK7UqtNU0A+U9RND8UrSYajF8plj4ZeAXXTw8dmBRk7YCpLP8OXULmY6u 4TuqUSXfeouqmTed19Q+QZOpJC8ukxAtFW2Gli6WVAUt5q8CE4tyuoSwRpyFE9j5v9+boY 4+GP9AQmju3r79XeBgc1LZ1XMVuhLRrS8zU/XPe6lS92X1an4Udxiemtd9FlEe3y3Z51Vl gFNajum4yLQwCJT41ygx5iCEwC3Tz0u7tj03vlQVN1DZDCoTMNd0p1AS0qcXYtc70zye6T zvv0jDiHs9W2iS95JugTQ+/tYfORYJMA7XlBINNFqQt3+CWQe/FV898fN69sgQ== 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=1715787277; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VPhGT4F3HxFOUQSPJ5+LAmXzSQbxythbD3aSlUJo2aE=; b=mOQCfY/mRipSvLoBSzD47+GQJR+NCBefpMSqXXSbG5rQeq6vtLoEiLN+TzgSWHRUGXw4HA tJG/FiswxHMOwuNNPeBeu2BL9bE7FS4LXSxCIhva/EsYN+LtavPNP71Ktyr5fLH1WOXdvG O61w4GUJdgv9WqWfOv4L4TP9ob9rgFp70nxbI7W+3JCi6jThQQp6s3+LwBYpZhN1EU16Of 5vxWkbmsCuP1BWka2NT9RiX8P2ZDc8r43SI+f/EpJGKbXbJ2e5IRB4ocKFQ/7LTUrY0ZVM F/0ua80aZBEKEmbfOlpAa7YYg9pV9zwvc1ZgaDjfBSx/e+WOt1nIFK0UXRiADQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vfcj912cBzLLk; Wed, 15 May 2024 15:34: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 44FFYb1s018816; Wed, 15 May 2024 15:34:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44FFYbFb018813; Wed, 15 May 2024 15:34:37 GMT (envelope-from git) Date: Wed, 15 May 2024 15:34:37 GMT Message-Id: <202405151534.44FFYbFb018813@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: 3e627553bbd7 - stable/14 - Revert "intrng: switch from MAXCPU to mp_ncpus" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 3e627553bbd791a4f73eaeea2c2d795fd4e0ee70 Auto-Submitted: auto-generated The branch stable/14 has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=3e627553bbd791a4f73eaeea2c2d795fd4e0ee70 commit 3e627553bbd791a4f73eaeea2c2d795fd4e0ee70 Author: Mike Karels AuthorDate: 2024-05-14 22:44:58 +0000 Commit: Mike Karels CommitDate: 2024-05-15 15:34:26 +0000 Revert "intrng: switch from MAXCPU to mp_ncpus" This reverts commit b4d11915c73f199501672b278be86e1f63790036. This is a direct commit to stable/14. The change breaks booting on older Raspberry Pi 4's, although that works on main. The cause is unknown. The original commit should be redone on stable/14 if/when it catches up with main. --- sys/kern/subr_intr.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c index 49fe20cdc890..6535c42f2404 100644 --- a/sys/kern/subr_intr.c +++ b/sys/kern/subr_intr.c @@ -175,11 +175,11 @@ intr_irq_init(void *dummy __unused) /* * - 2 counters for each I/O interrupt. - * - mp_maxid + 1 counters for each IPI counters for SMP. + * - MAXCPU counters for each IPI counters for SMP. */ nintrcnt = intr_nirq * 2; #ifdef SMP - nintrcnt += INTR_IPI_COUNT * (mp_maxid + 1); + nintrcnt += INTR_IPI_COUNT * MAXCPU; #endif intrcnt = mallocarray(nintrcnt, sizeof(u_long), M_INTRNG, @@ -312,18 +312,18 @@ intr_ipi_setup_counters(const char *name) mtx_lock(&isrc_table_lock); /* - * We should never have a problem finding mp_maxid + 1 contiguous - * counters, in practice. Interrupts will be allocated sequentially - * during boot, so the array should fill from low to high index. Once - * reserved, the IPI counters will never be released. Similarly, we - * will not need to allocate more IPIs once the system is running. + * We should never have a problem finding MAXCPU contiguous counters, + * in practice. Interrupts will be allocated sequentially during boot, + * so the array should fill from low to high index. Once reserved, the + * IPI counters will never be released. Similarly, we will not need to + * allocate more IPIs once the system is running. */ - bit_ffc_area(intrcnt_bitmap, nintrcnt, mp_maxid + 1, &index); + bit_ffc_area(intrcnt_bitmap, nintrcnt, MAXCPU, &index); if (index == -1) panic("Failed to allocate %d counters. Array exhausted?", - mp_maxid + 1); - bit_nset(intrcnt_bitmap, index, index + mp_maxid); - for (i = 0; i < mp_maxid + 1; i++) { + MAXCPU); + bit_nset(intrcnt_bitmap, index, index + MAXCPU - 1); + for (i = 0; i < MAXCPU; i++) { snprintf(str, INTRNAME_LEN, "cpu%d:%s", i, name); intrcnt_setname(str, index + i); } From nobody Wed May 15 15:53:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vfd7P285qz5L4fR; Wed, 15 May 2024 15:53: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 4Vfd7P1k0Tz4RnM; Wed, 15 May 2024 15:53:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715788433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=upZsLV4g1BGjyi5p1tAKk0KfxDFo6ED91kOxImoJXJc=; b=PoRzFO/l0VLc+nL6kk5DvC8I0+8eAZyvA6nWJVD6YFfs4YJvfVgGxblSjsPn1clEWtJcfR +tAhbnfi9fqYOBitWgkIBAIW8jw5L3F8jp/n9cMlkvhq43+iceNlGzkaWBrV7aCKpoSmD6 xvKNCQtCk16DTT56rP19hG+oXlQrkUPXRZNokLay3XXdB3fUaaSIAEkcRQiA56vEe4AoTr Hpyw6cXbJ9/g1zfQSKO9e7Dw6L4WnjX8nCTMJmeLsCsvEYFrpRmCxEmNG0UDgwJuVabotE Yrm27X+vCkG+EhSvjz6hQeMSiJt5iHC2UaaNSz+uv3Np+e7yWYBiBhaLmZboHA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715788433; a=rsa-sha256; cv=none; b=IKKgWUfABix9rGlmeO1VEbOA9Ww/3NM/b+dPdnn0pTCUZiDPMYFEHh4c4J5nW3t5quU5pZ ucDrnzuR9cQOIW3goQZzZeoHbm17CHFHSWK+WWEPcT7FtYvs6gbkSlA5BQL5lJ/BwWulE7 5xxvXvwnVHMB3msO3yf/0BiUo/SjDGsR0TQULhMos+a4Op5iz3lX+bOzpnbE7m0HZNWpcw 84ff00nlwELXI98WUETkZNY+kz/UHcsOaqPngJshXzhV42H8tL+Y/rLl7tG9t1ucPknDRY MmCr3+XZm6ZdKp63cIyO8iTf3KW62WgKUuONgyuR+ZKq4EfLUbbxERxdF0DJqg== 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=1715788433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=upZsLV4g1BGjyi5p1tAKk0KfxDFo6ED91kOxImoJXJc=; b=d3CSIA3GAMmzURhA+uAxC9C2oPeNyWpggqBNz4EWVnfPPVQ1nezoAQrYg5j6OkmPtTKAmV kiEjKAJf/3S4gcXPxAkhNEeEltF0Iacx7R0vxIaN+xMJppM7BezFqeFE8eVFimxLZgZd8b 66/TyGyWJeoN3Iy18y27iZfa7U3gHYlBFQlqDIB0Uhq9AYDKY2a77jXH30IoLo5yfshilw g+5flLCHEmBRZo8HxGNiEXe41o6Y9mFkkVmEZo7RU3tlOh7LhGpnmod2khr/A9Y32F6GPl HU3DSc0IoQBxgS3a8q/U8WGzFaK/HO+AsNW8Vd+kaPZM4eu9u6OBKutkyF1KQg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vfd7P1KfZzLjJ; Wed, 15 May 2024 15:53: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 44FFrrqA051926; Wed, 15 May 2024 15:53:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44FFrrDc051923; Wed, 15 May 2024 15:53:53 GMT (envelope-from git) Date: Wed, 15 May 2024 15:53:53 GMT Message-Id: <202405151553.44FFrrDc051923@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: fc59fc3c1f63 - main - uart: Honour clock-frequency in FDT for UART_FDT_CLASS if present List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fc59fc3c1f632e011347614ee9704fe00e51002e Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=fc59fc3c1f632e011347614ee9704fe00e51002e commit fc59fc3c1f632e011347614ee9704fe00e51002e Author: Jessica Clarke AuthorDate: 2024-05-15 15:53:33 +0000 Commit: Jessica Clarke CommitDate: 2024-05-15 15:53:33 +0000 uart: Honour clock-frequency in FDT for UART_FDT_CLASS if present The StarFive VisionFive 2 has a Synopsys DesignWare ABP UART, whose driver uses UART_FDT_CLASS rather than UART_FDT_CLASS_AND_DEVICE as it has its own separate newbus driver. This UART is driven by a 24MHz clock as specified in the FDT, but we don't currently look at the property here, instead passing down 0 and letting the default value be used in the 8250 driver (~1.8MHz). As a result the divisor is misconfigured for the current baud rate for the entire kernel boot process. Once the newbus driver attaches the correct frequency is saved in the softc, but that does not take effect until the next time ns8250_param is called and the divisor is recalculated, namely when userspace runs and /dev/console is opened (note that ns8250_init does not get called when the newbus device corresponding to the current console attaches). Fix this issue by attemmpting to get the current clock frequency as for the UART_FDT_CLASS_AND_DEVICE_CASE, but falling back to 0 rather than failing on error. Reviewed by: imp, mhorne Differential Revision: https://reviews.freebsd.org/D45159 --- sys/dev/uart/uart_bus_fdt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/uart/uart_bus_fdt.c b/sys/dev/uart/uart_bus_fdt.c index 7725d09e212b..431f2962adb2 100644 --- a/sys/dev/uart/uart_bus_fdt.c +++ b/sys/dev/uart/uart_bus_fdt.c @@ -234,7 +234,8 @@ uart_cpu_fdt_probe(struct uart_class **classp, bus_space_tag_t *bst, (struct uart_class *)uart_fdt_find_by_node(node, 1); if (class == NULL) return (ENXIO); - clk = 0; + if (uart_fdt_get_clock(node, &clk) != 0) + clk = 0; } /* From nobody Wed May 15 16:00:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VfdGV4PsSz5L5J5; Wed, 15 May 2024 16:00: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 4VfdGV3vJCz4SLf; Wed, 15 May 2024 16:00:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715788802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KCfmNUTSpTDJzu+AaYYmcGBSJpttGL4PKMM05lkCZAE=; b=j6lZFJWXMSuwdQOzEwspUPOmoxxXwrHLhQJ+hXc3cD9hDTkBXpkdkpduM959DgFMazWj+u HKXkmTYN4sCsF6WiTXe8Ve7StN4tuNb6NPhz6JcyNRHQQke7OEgwMykpmfkess8ixe/wVs 4uiDHXHBwGflhYe0rEhhxGKngYssMmiyRJEsTkngEXyt71l9z+P4Hex5GLJiokLgN6Y8r7 VX9u8nJtLzBIHCW1U3+oBTkzlkzeJNP/VurFhCezXJb9aX3NdZq1t1+m30vI7kgff5tGgc 3QMzYCBsBRuvGpsk8iAe8yppXziuPr1jdyyfgqZzWnL1YyMkXFuYBfSzJkk5dA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715788802; a=rsa-sha256; cv=none; b=abusjL59tF/pTNJvfZvUnEB6ChJrXd4tGrP6BGEcbO4r2EKMJD7AIeCp0aHWFCI7oaOzHz /GYsJePhPPj4AoYTAzevTwM8KkESdnu+C8uvUoegQsOGY/p0fundK03Fq6evVNxTB8ppGT 0ZQ/ZQm5m+t0MTW8ujMLJrX9bhMnkB8b+U3HrIwr2unF6iD6bUdfn5uZrMOMbOzk/gvUpP 8QWAUDtC70cFX17C1yOk5NVarj7E6EZkS0oVCSNDZZkUkDjd0x10rfUTiPJazfSt3plkbO 3Fyp5mzg0l2HaH7oFVckrf6ROi3f9mbdW6qJEkchVCNPvHovYkwHsJjx99NE6g== 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=1715788802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KCfmNUTSpTDJzu+AaYYmcGBSJpttGL4PKMM05lkCZAE=; b=iBdRHRKQlXyqYJdhprB0lihLlHnyqgA6wsMBJw1hPTV/5YqK/xnSC263Tf3JUFIhVM8c+/ yKfT0GyWFpq/x85qBJR4kkyGcags6mKV5rpTlpv/sBJDYK//+OeSma8MVw8TUBlRoO3hwI khSx5jFwQCwPjkvzC4e2EA2Tp00j5a5a5Qn4m1Q4nP8ObS+bWOTM+R1kd9ZHuQzXf2cQXa DUguWnmDe2dQarfvqLudhzGTk5tzH15wluxDezMZdWeHTnySGbNQHLKK7sZCWixHxO6i0x UhU+xZ+MAWWmd4U/94HO6O6RBTldd96ExXWRlLI+yke3PrAoM5+U8/ofFg054Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VfdGV3VN2zLtV; Wed, 15 May 2024 16:00: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 44FG02RB055753; Wed, 15 May 2024 16:00:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44FG02Ll055746; Wed, 15 May 2024 16:00:02 GMT (envelope-from git) Date: Wed, 15 May 2024 16:00:02 GMT Message-Id: <202405151600.44FG02Ll055746@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: 0d230c89f5b3 - stable/14 - expand: Fix markup for the `-t` option. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0d230c89f5b39b06730bb43aa6e0cd0482dbd64a Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=0d230c89f5b39b06730bb43aa6e0cd0482dbd64a commit 0d230c89f5b39b06730bb43aa6e0cd0482dbd64a Author: Dag-Erling Smørgrav AuthorDate: 2024-05-13 10:41:27 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-15 15:59:30 +0000 expand: Fix markup for the `-t` option. PR: 274897 Fixes: 8993d785a261 MFC after: 3 days Reviewed by: gbe Differential Revision: https://reviews.freebsd.org/D45167 (cherry picked from commit f3eeeb959c9b00c89a2e1ff009c78162eb398656) --- usr.bin/expand/expand.1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/usr.bin/expand/expand.1 b/usr.bin/expand/expand.1 index 9a49deb1a948..c1e19891b1ab 100644 --- a/usr.bin/expand/expand.1 +++ b/usr.bin/expand/expand.1 @@ -80,9 +80,15 @@ If the .Fl a option is given, then tabs are inserted whenever they would compress the resultant file by replacing two or more characters. -.It Fl t \&Sm Ar tab1 , tab2 , ... , tabn \&Sm +.It Fl t Xo +.Sm off +.Ar tab1 , tab2 , ... , tabn +.Sm on +.Xc Set tab stops at column positions +.Sm off .Ar tab1 , tab2 , ... , tabn . +.Sm on If only a single number is given, tab stops are set that number of column positions apart instead of the default number of 8. .El From nobody Wed May 15 16:00:04 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VfdGX4X4rz5L5Mt; Wed, 15 May 2024 16:00:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VfdGX2dqRz4STN; Wed, 15 May 2024 16:00:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715788804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BcWXwB1QSSuGyH7InDlBhKiAdGshDlhGhQDrzLFTSTA=; b=YMFCjfwgxaCHlg/XRxDujBo6FDDvAamwZtNosYQtPas0WWI069KbImn3g30+4SKhy/20qi /LnxO9F22Sri0HzJCE5amq7L214Si0DA3G8TKROCLcwIeejWN5iLY9nXsxlKXTCY/+76x5 aeIJqIsBmCn6vlO96WeWB5CFueqz352nGWGcleRIR8ySK/uqNnAAiD65RfaEVLRtNjZ2/t Pw5QLDxRTVh+jO8arYStCZ5UAfdD73ANxic3lCFax7+7pTs7Wnji4xUYBjBja+wLJU8HLV uefp3XbQva1uZmLB75xQz7gV+d6UeTB3p39LzPr37HjsGpXKBGKe090bSrFbcw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715788804; a=rsa-sha256; cv=none; b=cUsIb+lBBxpZ6s+RsV5YxGCTmkx7rIcMzzesaeDdHOvkmTAaIYy/0F3LQS4Qg/v9u3x7vr n0LpzrZTsAaW6BsnKw4CHmVQeJi8r3Es+emAfbwGAsMSlKV277CkX4gkEH7bMHWXiHFlEQ jBZR+XaMCLqjNarA7woEPTvZ5qbYO7bUZ0Z82sWD3XDnH8aZnelLXKrQBF3zuG8/95j7+j e4/bDR90/QNgyBynZBUhTIGijtO7eqrXS4BSzZ6ZGRmYooEgYKiopFfD74nztFsLV9g0Xn DpIpqZ7MwJlfLRRQN3Tp20rG+CO7E5FiXMaGhEbFyNeDG+45jBnStePqcyMoIQ== 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=1715788804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BcWXwB1QSSuGyH7InDlBhKiAdGshDlhGhQDrzLFTSTA=; b=D3LYw7LTT02eia68NjSJ3+hdP+WzCo1n4BnFjFiS+CRwQ+HpByjTL0uIocTXU7ic4jVP2q Yx0YmQh1uqCeNA11BXachsm4QkydSM5KRnH1feSduOkwqlTQjW0SC3n96JiTOwkLco/3um EBpXASZanEBOzlRob8FlYiztwzVEkil9LzYktUI0pvvh2UsDydA4yseAfIn6tgB5xU5H30 QLm+XIs3tRcz3DhEoMk+H/SBdlmEOSQ17uhdLPUGFpfwMmVZjJ7S6cGuc9SEC86FEdX3HX 9968KWgrGTlNyEXnECEGa7/22ZEBCKjvYyTLUuVs3LugFgWsIgKMLbrFsaj4kw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VfdGX2FW4zLZd; Wed, 15 May 2024 16:00: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 44FG04oR056658; Wed, 15 May 2024 16:00:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44FG0434056653; Wed, 15 May 2024 16:00:04 GMT (envelope-from git) Date: Wed, 15 May 2024 16:00:04 GMT Message-Id: <202405151600.44FG0434056653@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: a4d054aa5cab - stable/13 - expand: Fix markup for the `-t` option. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a4d054aa5cabcf3ad7991d186dc0c98e0152d2b4 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=a4d054aa5cabcf3ad7991d186dc0c98e0152d2b4 commit a4d054aa5cabcf3ad7991d186dc0c98e0152d2b4 Author: Dag-Erling Smørgrav AuthorDate: 2024-05-13 10:41:27 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-15 13:51:10 +0000 expand: Fix markup for the `-t` option. PR: 274897 Fixes: 8993d785a261 MFC after: 3 days Reviewed by: gbe Differential Revision: https://reviews.freebsd.org/D45167 (cherry picked from commit f3eeeb959c9b00c89a2e1ff009c78162eb398656) --- usr.bin/expand/expand.1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/usr.bin/expand/expand.1 b/usr.bin/expand/expand.1 index 9a49deb1a948..c1e19891b1ab 100644 --- a/usr.bin/expand/expand.1 +++ b/usr.bin/expand/expand.1 @@ -80,9 +80,15 @@ If the .Fl a option is given, then tabs are inserted whenever they would compress the resultant file by replacing two or more characters. -.It Fl t \&Sm Ar tab1 , tab2 , ... , tabn \&Sm +.It Fl t Xo +.Sm off +.Ar tab1 , tab2 , ... , tabn +.Sm on +.Xc Set tab stops at column positions +.Sm off .Ar tab1 , tab2 , ... , tabn . +.Sm on If only a single number is given, tab stops are set that number of column positions apart instead of the default number of 8. .El From nobody Wed May 15 16:00:05 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VfdGZ0BZlz5L5J8; Wed, 15 May 2024 16:00:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VfdGY3Cz6z4SJt; Wed, 15 May 2024 16:00:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715788805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rCJpGrlDo+Ot8COpXPEmlo/6OhebOtxjm6a/Yh3Z4ew=; b=h+28WVtFcekga87wKNNz3RCMySlfaeAFwB8aocMFQ+oeEIrFOscF1mfdkNEZo34M2vWZDn Ow6Tr5G5KbIBkEmYusWKBFD9kKrgkJ1GXvQMm4G8RuVlvl6iHekL794JiviuFdqTdkIDt6 XoZTJpsWePFkk3/qchRK3bhuct422w6uWPhO8z3RuilafVs1z0XdJS5K/Tb2qkAJdDEAj7 E2YSYG5/qGNuh/bMUDsc6WdbarfvnJpJolhu0qDCKSUUd7Euu8V9jRCj3+t3IVJa8X0JhA yGaMgexZhyER9CYlCPnRX37n4g+3d0brZr4m8BAO+6yBaz2mSOEtP2eXduISEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715788805; a=rsa-sha256; cv=none; b=FkJSvacSiUWuc02Y6FxjLN+GEOnSHqLFWndSjKWzwTywXgdrbOKJg4qQTg43Jpp3Nz1BfR B5bi3JbAAhDTGiKxLJk8frDbZvz7DuINt93DbEzjmH1q6AV042PLPbkK54i71iBB80YBFU ffE50t79IlafrZn4xYlrXFdtWYBB8t8rqz+/jkPRy6HN/juQv0x3v+YhL0mgA9GjslcTBr AHTchjzNaDFHIWpEaiDQwAxet2ed6C15v4DxuwNO2hknPzfSG+ZNSH4bxfoyRg6WPq6zWn OWawACBA6uM4U6g6ILDETogRWFlBDQd+FQ6R6JtEpbTAkzX03xKnKNXpT1hg8Q== 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=1715788805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rCJpGrlDo+Ot8COpXPEmlo/6OhebOtxjm6a/Yh3Z4ew=; b=Ea5moOH2rSOyxDjLLyxpwlsRBl64dlvYbLRg54a1m8Xt16lq9N5B0FVvkeQ6HGlOUgz1ey qFtV32XZO410NkbvyGmLS3eE2x4J7jtLEaJY8rbAiH1cc0HB2zsIL+3wPLTKkHiVfQzJZS FAf5MmCBrHYOI9FWNXoGpZi+OGnvFaPnCJsBsU1LiRATg1ppio7x5PhYwjge38cQnNtrPD G1tsNuH1s4qTqKPfos/DZzcmonJaqUlggt+yZd7FbI0KMkBRIuRxdGzPapFj96UxBTN4ZI aRuXfNYzRygc4fGh6PN3qEd5Y0c6m9pHgkpdZwmwALQX0cBznjL6eoIjTWoNfQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VfdGY2qC4zM7b; Wed, 15 May 2024 16:00:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44FG05To056967; Wed, 15 May 2024 16:00:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44FG05e9056962; Wed, 15 May 2024 16:00:05 GMT (envelope-from git) Date: Wed, 15 May 2024 16:00:05 GMT Message-Id: <202405151600.44FG05e9056962@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: 14a33d7a0016 - stable/13 - adduser: Additional variable fixes. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 14a33d7a00166caa79f5d1b89eaf5ed1a0bebbbf Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=14a33d7a00166caa79f5d1b89eaf5ed1a0bebbbf commit 14a33d7a00166caa79f5d1b89eaf5ed1a0bebbbf Author: Dag-Erling Smørgrav AuthorDate: 2024-05-15 12:13:49 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-15 15:59:16 +0000 adduser: Additional variable fixes. One function used `_input` without making it local, causing its value to leak into other functions. This broke the `-f` case. Fix that instance and initialize all local variables that weren't already initialized. Fixes: 170d0882903e MFC after: 3 days Reviewed by: karels Differential Revision: https://reviews.freebsd.org/D45204 (cherry picked from commit 46a619c6d4cfc662069950baca16ec2a3b18b8a5) --- usr.sbin/adduser/adduser.sh | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/usr.sbin/adduser/adduser.sh b/usr.sbin/adduser/adduser.sh index 61a4b3b5058f..7c3fdb418179 100644 --- a/usr.sbin/adduser/adduser.sh +++ b/usr.sbin/adduser/adduser.sh @@ -53,7 +53,7 @@ info() { # by pw(8). # get_nextuid () { - local _uid=$1 _nextuid + local _uid=$1 _nextuid= if [ -z "$_uid" ]; then _nextuid="$(${PWCMD} usernext | cut -f1 -d:)" @@ -101,7 +101,7 @@ show_usage() { # basename of the shell is output. # valid_shells() { - local _prefix + local _prefix= ${GREPCMD} '^[^#]' ${ETCSHELLS} | while read _path _junk ; do @@ -119,7 +119,7 @@ valid_shells() { # full path to the shell from the /etc/shells file. # fullpath_from_shell() { - local _shell=$1 _fullpath + local _shell=$1 _fullpath= if [ -z "$_shell" ]; then return @@ -154,7 +154,7 @@ fullpath_from_shell() { # will emit an informational message saying so. # shell_exists() { - local _sh="$1" + local _sh=$1 if [ -z "$(fullpath_from_shell "$_sh")" ] ; then err "Invalid shell ($_sh) for user $username." @@ -193,8 +193,9 @@ save_config() { # message or lock the account, do so. # add_user() { - local _uid _name _comment _gecos _home _group _grouplist _shell _class - local _dotdir _expire _pwexpire _passwd _upasswd _passwdmethod _pwcmd + local _uid= _name= _comment= _gecos= _home= _group= _grouplist= + local _shell= _class= _dotdir= _expire= _pwexpire= _passwd= _upasswd= + local _passwdmethod= _pwcmd= # Is this a configuration run? If so, don't modify user database. # @@ -299,7 +300,7 @@ add_user() { fi fi - local _line _owner _perms _file _dir + local _line= _owner= _perms= _file= _dir= if [ -n "$msgflag" ]; then if [ -r "$msgfile" ]; then # We're evaluating the contents of an external file. @@ -331,7 +332,7 @@ add_user() { # a file it will output an error message and return to the caller. # get_user() { - local _input + local _input= # No need to take down user names if this is a configuration saving run. [ -n "$configflag" ] && return @@ -366,7 +367,7 @@ get_user() { # and batch (from file) mode. # get_gecos() { - local _input + local _input= # No need to take down additional user information for a configuration run. [ -n "$configflag" ] && return @@ -386,7 +387,7 @@ get_gecos() { # If an invalid shell is entered it will simply use the default shell. # get_shell() { - local _input _fullpath + local _input= _fullpath= ushell="$defaultshell" # Make sure the current value of the shell is a valid one @@ -424,7 +425,7 @@ get_shell() { # and batch input. # get_homedir() { - _input= + local _input= if [ -z "$fflag" ]; then echo -n "Home directory [${homeprefix}/${username}]: " read _input @@ -450,7 +451,7 @@ get_homedir() { # Reads the account's home directory permissions. # get_homeperm() { - local _input _prompt + local _input= _prompt= uhomeperm=$defaultHomePerm if [ -n "$uhomeperm" ]; then @@ -473,7 +474,7 @@ get_homeperm() { # so, enable ZFS home dataset creation. # get_zfs_home() { - local _prefix + local _prefix= # check if zfs kernel module is loaded before attempting to run zfs to # prevent loading the kernel module on systems that don't use ZFS @@ -494,7 +495,7 @@ get_zfs_home() { # allocates one if it is not specified. # get_uid() { - local _input _prompt + local _input= _prompt= uuid=${uidstart} if [ -n "$uuid" ]; then @@ -519,7 +520,7 @@ get_uid() { # Reads login class of account. Can be used in interactive or batch mode. # get_class() { - local _input _class + local _input= _class= uclass="$defaultclass" _class=${uclass:-"default"} @@ -541,7 +542,7 @@ get_class() { # will then provide a login group with the same name as the username. # get_logingroup() { - local _input + local _input= ulogingroup="$defaultLgroup" if [ -z "$fflag" ]; then @@ -560,7 +561,7 @@ get_logingroup() { # and batch modes. # get_groups() { - local _input _group + local _input= _group= ugroups="$defaultgroups" _group=${ulogingroup:-"${username}"} @@ -626,7 +627,7 @@ get_password() { # Ask user if they want to enable encryption on their ZFS home dataset. # get_zfs_encryption() { - local _input _prompt + local _input= _prompt= _prompt="Enable ZFS encryption? (yes/no) [${Zencrypt}]: " while : ; do echo -n "$_prompt" @@ -702,7 +703,7 @@ set_zfs_perms() { # adds it to the user database. # input_from_file() { - local _field + local _field= while read -r fileline ; do case "$fileline" in @@ -733,7 +734,7 @@ input_from_file() { # the user database. # input_interactive() { - local _disable _pass _passconfirm _input + local _disable= _pass= _passconfirm= _input= local _random="no" local _emptypass="no" local _usepass="yes" From nobody Wed May 15 16:00:03 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VfdGW6Z84z5L5W1; Wed, 15 May 2024 16:00: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 4VfdGW4P10z4SQv; Wed, 15 May 2024 16:00:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715788803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=62Zhn8bZHdo1TU9K0Cjmn7wEI9eyFP5EmkW1sa1VnAs=; b=M28BpiuNPym0o7CFBqQ3IVDCZtnGW6/HUS/OVkhWihevOeyx8Q0GFRfRNIgGNLPr7D84tw MqFjTFNwha9fLMigtere6korOUJhLirt1/U0b8W/YGgRPlwCFFfXlYc8tN0hW6NRr1iVdI uU/fhZhgTWb+5n8KrbkGG1Z8kaR1WHFChpXSIkoHsrYDH6cT7u8bar1IkImduNmVIlUtSM BAYcz4q5jAtf6hEYnpp9WzF4NOIdbsRXn5FCFGvv4rLDGkrAH2ADYKoaQd7v1NztV2YD6u titDNX3PL2RAbHJGSkiSKoHWV/ehEcSqdJIJCXDkfqibgpAK6almLagDity7wg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715788803; a=rsa-sha256; cv=none; b=nYZW7OnhBqHDIlE1dWkM6k9yfWGXtzNpi4lBI0+qWMSIC+RBX5Vd7NlD7ABK/lQtZFApIU FkQhXfq866E2da8Wxv3zXevVLWX/iaUfPUf18CMRy4rHwWo8Z9NIPna5Wye2qE7wYHRAni gcTLjbDlY62+voikdhuyIE1vf3b+WklF7Cmw9gehqjDRPKlF5A4hPyIcugs6lQe6j6OKM7 Yd3aUOwyhWYuem39usKID1e6QLFLsMUwcZ0m2xIkUaRL4tZ9hzjpVJvWdgavShlMsVRmGU C8MF73SrVpcCUrwpnsbrRx1e0KDBdX6m7Wo82U+YgrwScd0OHd4OCicmWuOLCQ== 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=1715788803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=62Zhn8bZHdo1TU9K0Cjmn7wEI9eyFP5EmkW1sa1VnAs=; b=rSri6cZL/fJQIhBjo2GzHFanrD0GpH1tkt/DdisXzobU1o0VhUC/7rA0XHUK81nagEUb+m l2g4vxB46bAbblYAkMb8V6mYDpf/0YYGsEtsJaLx9gHTMQ3WxCm1tihAuvPXcNe4fwYL54 cQal1Nxt0zCJku7UNvWlA3lesPRVnz9sRqXnFq5dgTRuhP7iWRlcRN7pyX8AU2SMgspX60 HBcSUaVMx8o6d6vA1MvqGCC7JoyXd2m+bhz9nR1RxvXLndAsy/zeIG8XIYTv6bopPS//fS P3V5OPYOBvGuh4BGoiAUFTB7NQZ9NAGJOnxW/xXhi+83Xr9mtxgFTrcpfX2h0g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VfdGW419kzLZc; Wed, 15 May 2024 16:00: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 44FG03hV056337; Wed, 15 May 2024 16:00:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44FG03AF056330; Wed, 15 May 2024 16:00:03 GMT (envelope-from git) Date: Wed, 15 May 2024 16:00:03 GMT Message-Id: <202405151600.44FG03AF056330@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: db5aefb1cae1 - stable/14 - adduser: Additional variable fixes. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: db5aefb1cae14e31263ddb146f5952ca64bf6865 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=db5aefb1cae14e31263ddb146f5952ca64bf6865 commit db5aefb1cae14e31263ddb146f5952ca64bf6865 Author: Dag-Erling Smørgrav AuthorDate: 2024-05-15 12:13:49 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-15 15:59:30 +0000 adduser: Additional variable fixes. One function used `_input` without making it local, causing its value to leak into other functions. This broke the `-f` case. Fix that instance and initialize all local variables that weren't already initialized. Fixes: 170d0882903e MFC after: 3 days Reviewed by: karels Differential Revision: https://reviews.freebsd.org/D45204 (cherry picked from commit 46a619c6d4cfc662069950baca16ec2a3b18b8a5) --- usr.sbin/adduser/adduser.sh | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/usr.sbin/adduser/adduser.sh b/usr.sbin/adduser/adduser.sh index 61a4b3b5058f..7c3fdb418179 100644 --- a/usr.sbin/adduser/adduser.sh +++ b/usr.sbin/adduser/adduser.sh @@ -53,7 +53,7 @@ info() { # by pw(8). # get_nextuid () { - local _uid=$1 _nextuid + local _uid=$1 _nextuid= if [ -z "$_uid" ]; then _nextuid="$(${PWCMD} usernext | cut -f1 -d:)" @@ -101,7 +101,7 @@ show_usage() { # basename of the shell is output. # valid_shells() { - local _prefix + local _prefix= ${GREPCMD} '^[^#]' ${ETCSHELLS} | while read _path _junk ; do @@ -119,7 +119,7 @@ valid_shells() { # full path to the shell from the /etc/shells file. # fullpath_from_shell() { - local _shell=$1 _fullpath + local _shell=$1 _fullpath= if [ -z "$_shell" ]; then return @@ -154,7 +154,7 @@ fullpath_from_shell() { # will emit an informational message saying so. # shell_exists() { - local _sh="$1" + local _sh=$1 if [ -z "$(fullpath_from_shell "$_sh")" ] ; then err "Invalid shell ($_sh) for user $username." @@ -193,8 +193,9 @@ save_config() { # message or lock the account, do so. # add_user() { - local _uid _name _comment _gecos _home _group _grouplist _shell _class - local _dotdir _expire _pwexpire _passwd _upasswd _passwdmethod _pwcmd + local _uid= _name= _comment= _gecos= _home= _group= _grouplist= + local _shell= _class= _dotdir= _expire= _pwexpire= _passwd= _upasswd= + local _passwdmethod= _pwcmd= # Is this a configuration run? If so, don't modify user database. # @@ -299,7 +300,7 @@ add_user() { fi fi - local _line _owner _perms _file _dir + local _line= _owner= _perms= _file= _dir= if [ -n "$msgflag" ]; then if [ -r "$msgfile" ]; then # We're evaluating the contents of an external file. @@ -331,7 +332,7 @@ add_user() { # a file it will output an error message and return to the caller. # get_user() { - local _input + local _input= # No need to take down user names if this is a configuration saving run. [ -n "$configflag" ] && return @@ -366,7 +367,7 @@ get_user() { # and batch (from file) mode. # get_gecos() { - local _input + local _input= # No need to take down additional user information for a configuration run. [ -n "$configflag" ] && return @@ -386,7 +387,7 @@ get_gecos() { # If an invalid shell is entered it will simply use the default shell. # get_shell() { - local _input _fullpath + local _input= _fullpath= ushell="$defaultshell" # Make sure the current value of the shell is a valid one @@ -424,7 +425,7 @@ get_shell() { # and batch input. # get_homedir() { - _input= + local _input= if [ -z "$fflag" ]; then echo -n "Home directory [${homeprefix}/${username}]: " read _input @@ -450,7 +451,7 @@ get_homedir() { # Reads the account's home directory permissions. # get_homeperm() { - local _input _prompt + local _input= _prompt= uhomeperm=$defaultHomePerm if [ -n "$uhomeperm" ]; then @@ -473,7 +474,7 @@ get_homeperm() { # so, enable ZFS home dataset creation. # get_zfs_home() { - local _prefix + local _prefix= # check if zfs kernel module is loaded before attempting to run zfs to # prevent loading the kernel module on systems that don't use ZFS @@ -494,7 +495,7 @@ get_zfs_home() { # allocates one if it is not specified. # get_uid() { - local _input _prompt + local _input= _prompt= uuid=${uidstart} if [ -n "$uuid" ]; then @@ -519,7 +520,7 @@ get_uid() { # Reads login class of account. Can be used in interactive or batch mode. # get_class() { - local _input _class + local _input= _class= uclass="$defaultclass" _class=${uclass:-"default"} @@ -541,7 +542,7 @@ get_class() { # will then provide a login group with the same name as the username. # get_logingroup() { - local _input + local _input= ulogingroup="$defaultLgroup" if [ -z "$fflag" ]; then @@ -560,7 +561,7 @@ get_logingroup() { # and batch modes. # get_groups() { - local _input _group + local _input= _group= ugroups="$defaultgroups" _group=${ulogingroup:-"${username}"} @@ -626,7 +627,7 @@ get_password() { # Ask user if they want to enable encryption on their ZFS home dataset. # get_zfs_encryption() { - local _input _prompt + local _input= _prompt= _prompt="Enable ZFS encryption? (yes/no) [${Zencrypt}]: " while : ; do echo -n "$_prompt" @@ -702,7 +703,7 @@ set_zfs_perms() { # adds it to the user database. # input_from_file() { - local _field + local _field= while read -r fileline ; do case "$fileline" in @@ -733,7 +734,7 @@ input_from_file() { # the user database. # input_interactive() { - local _disable _pass _passconfirm _input + local _disable= _pass= _passconfirm= _input= local _random="no" local _emptypass="no" local _usepass="yes" From nobody Wed May 15 16:35:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vff3z3p8Mz5L7sD; Wed, 15 May 2024 16:35: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 4Vff3z3HMtz4YWN; Wed, 15 May 2024 16:35:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715790959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rcUenXNWJ9YH82stG4AKZ89KbRI9fLhbb7TufBf+f3w=; b=ekHwHRKV6CA+FNDLpX7VZZH6cV63+vNN1c4YttO04ygvymR0Y4fzchdeVVQAJp5f8asu/0 OUimTEFQgjPy3moood+9jWtHS90cecD17APJkraRsYRVBmgrcZfzOmUTKR8s7wAGJnPO/s rno6wvl67USBAk3BEHFD8PAUY9p2nd+zdf/EIL83Ne44joKmJ9BydzXVWwjZIfPw+uDH7C rjq4hPepR60WFboIV5C/UqPSVdWjt/rxVrMVXZBXV4B7G14C1392pk/Fq7O/G2q5O0Wv5X 2yCduMqFGQKb4QolMrdsv8UhvxLAI8P3b0IAu/0hhDoGwzR0ea3aN9BCV2yWaw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715790959; a=rsa-sha256; cv=none; b=ZYR7vXtywNgn1GkpmZGQRCm2t7c3WxGO0QRv4njo9wIPx/P3hCtCEcnWZXK7jWQGRm6mVj 3pnhsvziwf8l6YRLgMvmbxibIr1DinUGrixsAKvuR7mhU5BuMis0ohFkRN92tcXlM8m5X7 MY8BHtU27GkYmnnDMeGo9ZPbyIQQvyGZIYUHw8m53N8L9rf39ke8nmRsaoVSuIFGdrHxve N544DCNpzGPTyPlFXTqB/a5ODMkRUxyZIcYBmXqst12FJRJmzYbw/fu2WfDEKSTOC0hKl5 fM2rUJf/tWQYRKaZAB6CE9Y87M8tv0uwM4MH0D7ZxV6bxj2YvY1Z3Bq1ydhBcw== 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=1715790959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rcUenXNWJ9YH82stG4AKZ89KbRI9fLhbb7TufBf+f3w=; b=CI2BCdxyZRvFgG4xOROA8Jw24ZJ8vHhSj3o0rgdUbnWHJKKMisWphoS+CVtWNMDfypIheL o1VWMAr9TQVMU7VdOro20/oSQSvjkSrLi5eXLhEcrXcN054N02nAYnXixflc0GMRQM9bKK m/yeG8WnmylSrBsy8EFbcP+a7i++p82uUDeccXtW2kBkhJJF742MLROT0j1Z34Xmh9ye7o pObcXh6H0sXodEAoJo+ZV0d0ReeE2h1hanpz0zbT/+Qi4jyg23p7VfyR18LmRUj2DCyWH+ lCgct/Ns6kQS1nO0BL/bd39XiW7y6UsQfr/obLnqI78IYu/himRsLmbO17IjeA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vff3z2p5PzMyQ; Wed, 15 May 2024 16:35: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 44FGZxak021249; Wed, 15 May 2024 16:35:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44FGZxAS021246; Wed, 15 May 2024 16:35:59 GMT (envelope-from git) Date: Wed, 15 May 2024 16:35:59 GMT Message-Id: <202405151635.44FGZxAS021246@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: b827afb9e3a7 - releng/14.1 - Revert "intrng: switch from MAXCPU to mp_ncpus" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/releng/14.1 X-Git-Reftype: branch X-Git-Commit: b827afb9e3a7aaaa2da7d101c46881c646d4df2f Auto-Submitted: auto-generated The branch releng/14.1 has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=b827afb9e3a7aaaa2da7d101c46881c646d4df2f commit b827afb9e3a7aaaa2da7d101c46881c646d4df2f Author: Mike Karels AuthorDate: 2024-05-14 22:44:58 +0000 Commit: Mike Karels CommitDate: 2024-05-15 16:35:38 +0000 Revert "intrng: switch from MAXCPU to mp_ncpus" This reverts commit b4d11915c73f199501672b278be86e1f63790036. This is a direct commit to stable/14. The change breaks booting on older Raspberry Pi 4's, although that works on main. The cause is unknown. The original commit should be redone on stable/14 if/when it catches up with main. (cherry picked from commit 3e627553bbd791a4f73eaeea2c2d795fd4e0ee70) Approved-by: re (cperciva) --- sys/kern/subr_intr.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c index 49fe20cdc890..6535c42f2404 100644 --- a/sys/kern/subr_intr.c +++ b/sys/kern/subr_intr.c @@ -175,11 +175,11 @@ intr_irq_init(void *dummy __unused) /* * - 2 counters for each I/O interrupt. - * - mp_maxid + 1 counters for each IPI counters for SMP. + * - MAXCPU counters for each IPI counters for SMP. */ nintrcnt = intr_nirq * 2; #ifdef SMP - nintrcnt += INTR_IPI_COUNT * (mp_maxid + 1); + nintrcnt += INTR_IPI_COUNT * MAXCPU; #endif intrcnt = mallocarray(nintrcnt, sizeof(u_long), M_INTRNG, @@ -312,18 +312,18 @@ intr_ipi_setup_counters(const char *name) mtx_lock(&isrc_table_lock); /* - * We should never have a problem finding mp_maxid + 1 contiguous - * counters, in practice. Interrupts will be allocated sequentially - * during boot, so the array should fill from low to high index. Once - * reserved, the IPI counters will never be released. Similarly, we - * will not need to allocate more IPIs once the system is running. + * We should never have a problem finding MAXCPU contiguous counters, + * in practice. Interrupts will be allocated sequentially during boot, + * so the array should fill from low to high index. Once reserved, the + * IPI counters will never be released. Similarly, we will not need to + * allocate more IPIs once the system is running. */ - bit_ffc_area(intrcnt_bitmap, nintrcnt, mp_maxid + 1, &index); + bit_ffc_area(intrcnt_bitmap, nintrcnt, MAXCPU, &index); if (index == -1) panic("Failed to allocate %d counters. Array exhausted?", - mp_maxid + 1); - bit_nset(intrcnt_bitmap, index, index + mp_maxid); - for (i = 0; i < mp_maxid + 1; i++) { + MAXCPU); + bit_nset(intrcnt_bitmap, index, index + MAXCPU - 1); + for (i = 0; i < MAXCPU; i++) { snprintf(str, INTRNAME_LEN, "cpu%d:%s", i, name); intrcnt_setname(str, index + i); } From nobody Wed May 15 17:09:40 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vffpr66Wtz5LBNS; Wed, 15 May 2024 17:09: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 4Vffpr5gBVz4dFS; Wed, 15 May 2024 17:09:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715792980; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KIcNkpf0+jgE912EE4Iu79tGd9hxuyrVDRmnP1iJtts=; b=xEBCUHeA8K4hVBXGny3ItCdyTaNRflsCPNZASj1V7prLft+UFSt0F9pHkH1bvRuvQO6esd /aq4gExQ7kSiB5xQocjxhuxzM6oPyxt4qOA7OOAQCtJtP92WnhtE1zLfQO83p7X1BQQe/U 2pNbeUCSRDGdcEieApKZ5ubr4ehELn2NVY5m1Q98CV/bC///D5X5U5ojOTTy3Wvgcw1Jm0 sjbKcDKk+j6oOYe9g3Vg3yYQ5G+Ntl5cUVEbcM8kpp9wlDgqK816G08QGVQ+YvaROdN0nm niLm1zuDodUeAcek8PAgpqjZb1cw08nA/GXqCeb+e/sPDEJ2IL5wChAaQi257Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715792980; a=rsa-sha256; cv=none; b=tZdxsEw6IAl1etMfoyjEPj3RimQDExeGEOjjBRLSwpqQnfckeDhtxKt2zG4LuuJhVDzKgO DAstqoYo1SUlq/rIMap4Fg/jNBvklCTGYEKJNy/sOovu/zej0pHujmf1IjZpotFyKole2F 7I7wyoq+FCtVB/9Kiw0OsCDovfUyOJVNFrsrvPCfp7zuRxsRR6pT3yPcHAlDdjv82j5YsU elUfeZOIxH6HEJ48uNh98wTWQD/S0hXrWRcM1dvOt9Ont51u7VKC0LpzuJYnZ5p4LjpLTT dg5OjYVLMgtDuU7PYxOrNgsh/5aAPjocKkQP9FbAM7tKr65ZE4SfHcuDlHW1Fw== 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=1715792980; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KIcNkpf0+jgE912EE4Iu79tGd9hxuyrVDRmnP1iJtts=; b=ejalOqIraScpq3MTvvTSAaJ5DIeCQOv99Pjiml6D+Wcrmv7SqdN80WBRU7vtEPUlu+t3AN q2g42uBv05cbQjbNWN3ZLdsIw+J++eY3mcsfqqCyixf9S394qFOaHjDzdwRh6QcXAFkOGo k0zZPKUnKAigpg0joM0SB3K8Nw6yK/L/MB6PVK7wwCmWoZiRved5uCE373NYkp+AJhp7zj PtIZqESurkl9jS0MxiFzzvwqk4IXJWT6vp0b/M2UR5vGWjrKAfXTWObtWCb/Wa6pg8kw+w 5fXNBH30PVtqc0K2VusFt1o4Kog/Wnptxvt4Nmn1shLdLZIbFYi/DZgYQ1mcoQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vffpr5GqlzNcr; Wed, 15 May 2024 17:09: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 44FH9eiF073026; Wed, 15 May 2024 17:09:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44FH9eOb073023; Wed, 15 May 2024 17:09:40 GMT (envelope-from git) Date: Wed, 15 May 2024 17:09:40 GMT Message-Id: <202405151709.44FH9eOb073023@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: d7adf3b47a05 - main - riscv: fix L0 PTE setup (Sv48) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d7adf3b47a058552270fb2603cc888f40eba3e17 Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=d7adf3b47a058552270fb2603cc888f40eba3e17 commit d7adf3b47a058552270fb2603cc888f40eba3e17 Author: Mitchell Horne AuthorDate: 2024-05-15 17:07:33 +0000 Commit: Mitchell Horne CommitDate: 2024-05-15 17:07:33 +0000 riscv: fix L0 PTE setup (Sv48) Per the Privilege Spec, the Accessed (A) or Dirty (D) bits must only be set for a leaf PTE. It seems newer versions of QEMU have started to enforce this requirement, and without this change, pmap_bootstrap() hangs when switching to Sv48 mode. Reviewed by: jrtc27, markj MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45210 --- sys/riscv/riscv/pmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index b92cb816f44a..b571806bb2da 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -714,7 +714,7 @@ pmap_bootstrap(vm_offset_t l1pt, vm_paddr_t kernstart, vm_size_t kernlen) alloc_pages(l0pv, 1); l0p = (void *)l0pv; l1pa = pmap_early_vtophys(l1pt, l1pt); - l0p[pmap_l0_index(KERNBASE)] = PTE_V | PTE_A | PTE_D | + l0p[pmap_l0_index(KERNBASE)] = PTE_V | ((l1pa >> PAGE_SHIFT) << PTE_PPN0_S); l0pa = pmap_early_vtophys(l1pt, l0pv); From nobody Wed May 15 17:21:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vfg4Q6PdCz49wMN; Wed, 15 May 2024 17:21: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 4Vfg4Q5ymgz4fWy; Wed, 15 May 2024 17:21:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715793686; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8bBnbuh+RJm5PdjgcJgwxFV+CMYjI8/k14j78aXLLOQ=; b=ULSCwjZCkuIRwL9nk+aVBlUqGjHBfxylhXX8HOQwH3G1g3/7m1b1Onnp2Q4Y/aoexAXJ5r ViBFs6o0Wb/ZGcHMsYq+vQRkDuG8LCpPM3fWqVfqZKPkFHVdBxL50vMGu24BY92jEE7/Lt pAwllhZsn68B8iLS1ni73kKcq47PZxXdLagTxvgAlnJgXkq0igt5A2AtmDWK9OEBS1itW9 qUIbrvHJjRV4K4K2mn3ludk5xekIOwUl9wPNnsYeU/4lOPGl5jAe3ojCbRPfxASM6nGDDu TrQKgtBNlFgIbN8GeOR92aKpHT6ti5//2UXKs+QIbS7wuki+qe9oiXny1KQShA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715793686; a=rsa-sha256; cv=none; b=iNA+YcjPRnLjI5O6tqOKUh7NJ6J10Z2S4gcay/BXA17LYJB6wF7WUP83w6IRIK7T1+oW9a P6iewzrfui70SMOihc7mb8Ls/0AlqKvG0JHfEB7T3E3ZwMT7xFBKed+/Wq9/uw7aPKaERx o8ne1xW7F77P/f9g6sWoh1V5cD40fWg+XIaZ5Z9Jx8aLrAQ8HVEVLJmJjkNPc+8CL6bgzw Zr2WLuV6OqPJfCwB1TJR7bDTiYr3nPgclfcjKTbBg19kqCc+87Ty5aNMJJercU11laCGvC zv8ElHRjZzJaynFyDeqtX1rWN3Xn/ycu+SDImFR4OiZX/xq4mekdMbpJeVzNTg== 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=1715793686; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8bBnbuh+RJm5PdjgcJgwxFV+CMYjI8/k14j78aXLLOQ=; b=wM42kwmHuUGiypSgIqciP6l9iUNGvAkPuk5hezO2nmIE+P/XLiiQv1VeNh3hCKDNDZD5XA VNwAnm005n7SrO9x1KrW5O3FeslLnTCH9WJgQ4EkWfPcrCliqs37uLVq/ELlcUjLdPxsYz DSxhnMdfgKspUVxtXhidVq/GblLyQtaMPE1iKfM3BkX/IK1KqNeimyCF+F9AmBGp5PPRO/ 4SKo6rzSVooPbmjKGolP22s03hlZuJVFA3Rm7ksU1bs3hzI3kuV8/NXBaYBlve9HUPPiAL EmBCth9BalgCREQs5Yalb3imxXUzUAXoGxctgPpunRvQaocxUdwHV6IdpQoXjQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vfg4Q5ZJ8zP1N; Wed, 15 May 2024 17:21: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 44FHLQMm003815; Wed, 15 May 2024 17:21:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44FHLQcc003812; Wed, 15 May 2024 17:21:26 GMT (envelope-from git) Date: Wed, 15 May 2024 17:21:26 GMT Message-Id: <202405151721.44FHLQcc003812@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: 18119e711f1c - stable/14 - Increase IOAPIC_MAX_ID to 255 (from 254) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 18119e711f1c844bd6eacf5afc8d4cdec3ac8085 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=18119e711f1c844bd6eacf5afc8d4cdec3ac8085 commit 18119e711f1c844bd6eacf5afc8d4cdec3ac8085 Author: Ed Maste AuthorDate: 2024-05-10 17:40:59 +0000 Commit: Ed Maste CommitDate: 2024-05-15 17:21:14 +0000 Increase IOAPIC_MAX_ID to 255 (from 254) A test system provided by AMD panicked with "madt_parse_apics: I/O APIC ID 255 too high". I/O APIC ID 255 is acceptable, so increase the limit. Reviewed by: jhb, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45157 (cherry picked from commit 4e3286818327453efd8e4c133928ba26a169567a) --- sys/x86/include/apicvar.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/x86/include/apicvar.h b/sys/x86/include/apicvar.h index 10016e291b9b..ac6a82659e34 100644 --- a/sys/x86/include/apicvar.h +++ b/sys/x86/include/apicvar.h @@ -78,7 +78,12 @@ #define MAX_APIC_ID 0x800 #define APIC_ID_ALL 0xffffffff -#define IOAPIC_MAX_ID xAPIC_MAX_APIC_ID +/* + * The 0xff ID is used for broadcast IPIs for local APICs when not using + * x2APIC. IPIs are not sent to I/O APICs so it's acceptable for an I/O APIC + * to use that ID. + */ +#define IOAPIC_MAX_ID 0xff /* I/O Interrupts are used for external devices such as ISA, PCI, etc. */ #define APIC_IO_INTS (IDT_IO_INTS + 16) From nobody Wed May 15 17:43:00 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VfgYZ4QN0z49xpF; Wed, 15 May 2024 17:43:14 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: from sdaoden.eu (sdaoden.eu [217.144.132.164]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4VfgYZ2Qgpz4hZL; Wed, 15 May 2024 17:43:14 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sdaoden.eu; s=citron; t=1715794984; x=1716461650; h=date:author:from:to:cc:subject: message-id:in-reply-to:references:mail-followup-to:openpgp:blahblahblah: author:from:subject:date:to:cc:resent-date:resent-from:resent-to: resent-cc:in-reply-to:references:mime-version:content-type: content-transfer-encoding:message-id:mail-followup-to:openpgp: blahblahblah; bh=YuvcB+L9ZBnq1nnj2/uLq/mMfx7rPn7c/1EYch9Uuts=; b=WAJVKssSkNXXd9pzRdFSUMocRBR2cLExPji+TwAnOJZ4MgDDW6vpgMTxKh62gh+F6QIm1iQb ksDZYayHUbbh0rFtWjd8XmKsG5zSxYYg4wYwkh/fxy+R16nhcgUqJWpGBT3WAk/g+YRdz+9A72 VtTqxJAnXRRmU6mWXrfs0E1v+7B2jpcE4m8eQvM89KmLgXXnZg2hMYeccmGEsxq9TTZWiwHZJg WmTNCpJd9TSq+1HGqmA7jalOON6VY61m5BUhtQ7t01ZMlTGEVY4kRnXCFY8aay2phPCK68Bjb7 rKNvYYMm18Gdprm3oewJgF2FtQaC7aTUjvJSO1NmUdHHWeJA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=sdaoden.eu; s=orange; t=1715794984; x=1716461650; h=date:author:from:to:cc:subject: message-id:in-reply-to:references:mail-followup-to:openpgp:blahblahblah: author:from:subject:date:to:cc:resent-date:resent-from:resent-to: resent-cc:in-reply-to:references:mime-version:content-type: content-transfer-encoding:message-id:mail-followup-to:openpgp: blahblahblah; bh=YuvcB+L9ZBnq1nnj2/uLq/mMfx7rPn7c/1EYch9Uuts=; b=QdY8OveX7dHVoPUYFYXMzKhNOBm4IhZh10zbM/16p8xZUfELZ306OIf8AYxwrOQBMlaI9EjZ VEQDeEwZ6b49Dw== Date: Wed, 15 May 2024 19:43:00 +0200 Author: Steffen Nurpmeso From: Steffen Nurpmeso To: Lexi Winter Cc: Joseph Mingrone , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 27358245644c - main - freebsd-tips: Add fortune to find font providing Unicode character Message-ID: <20240515174300.qO14jRzA@steffen%sdaoden.eu> In-Reply-To: References: <202405132302.44DN2NX6009088@gitrepo.freebsd.org> Mail-Followup-To: Lexi Winter , Joseph Mingrone , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org User-Agent: s-nail v14.9.24-621-g0d1e55f367 OpenPGP: id=EE19E1C1F2F7054F8D3954D8308964B51883A0DD; url=https://ftp.sdaoden.eu/steffen.asc; preference=signencrypt BlahBlahBlah: Any stupid boy can crush a beetle. But all the professors in the world can make no bugs. X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15987, ipnet:217.144.128.0/20, country:DE] X-Rspamd-Queue-Id: 4VfgYZ2Qgpz4hZL List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Lexi Winter wrote in : |Joseph Mingrone: |> The branch main has been updated by jrm: |[...] |> +Under X Windows, you can determine which fonts provide a particular \ |> Unicode | |separately to bapt's comment, there is no such thing as "X Windows". |the correct terminology is "the X Window System" or simply "X" or "X11". And i would not know how to get the actual Unicode codepoint value except by copy+paste'ing it into vim. --End of --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt) From nobody Wed May 15 18:47:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vfj070HJKz4B3WP; Wed, 15 May 2024 18:47: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 4Vfj066y2Vz4sBg; Wed, 15 May 2024 18:47:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715798871; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4261E4b4TXVBtkMQDsRUnf/cwKMaCFlF9s0ifuJUeBU=; b=Hro9jjv9v/kHqwBrULO8sfXJiOHCKMbBgPdXLWWDh9jU6BFqhW1CGyLm10Cx1uyl9+3wte n2c+taCu/zbx0gkqI1iUM19qzTzc99vsbLy0rtenvG7kM4EKK7Rfsh95klLejJOj7hGbXr iA/a7ZliVi9Z28yBx6ObvlM1FsDl9QHnHoa+/YXRQAtWVLzLHhfECdHgVNJ1bWyBHWWQQl 3gv0Rs2sOytjjL6zSkbn8VW59CNYVw953L6Te7ZkJBsSGPdVugEK9X+9hmrvwFVW8aWwts UmF9/tZrkqgwjPeaFQDdvGnET7+pZYDXadHmogOTbxXmoxG7cCKp05+PIVb/wg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715798871; a=rsa-sha256; cv=none; b=f6GCuW+PjBzaec56h2jFxLiduTrPve7u3EyZngpV2VsApuXhbXkalozmPoGTUDwa0TUdYz lcVEEwrFn78IFUt8Mt4vtDOJBmuCrmFo6cnlkOH/WOdp0eyaRA06hF9z/hNBh7MT4V1hsn IZiLYit2XKOboy9yRjdYX9iUoYGCzaQtSVE0VtA4oi3YlA3bdyOu1S2Wt1+FAxqozj4jjl 95gkSdfFpOrMQpk8RRbjl5++4WnuvM85/9brpaamN07L/zQB8DTxz6QaoNggtAm0DWedPN 7zWkOWn7B84THMwcpRzeJYG7L5YbqyHSqhqv/ItjYuc3mYDH/Sm1CxYvqc3yJg== 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=1715798871; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4261E4b4TXVBtkMQDsRUnf/cwKMaCFlF9s0ifuJUeBU=; b=xKgTBcsRnj7JSQJh508RwARSulk/iTTqfsvZkQC2BJ+s1JFfJx4SVuWHM6Go9o8mQz7yRv iwf9ShZNuVgk69snC2NmVEB1an8wgpfyBEmEAinvOdID9aMiOmXHeAgNdmGIskg3JWwDrA 00vIljW6EroDmceyDPUhyt2jPEMhH69SdDkNqYKUDW2r/YVnzJPX8W7O2l/rWmUNaDgpoq /AwhAuiNYf/PuqAUgwYivX6zPaX5uRMbx31mtEQn3JaMIZ5MBwsHVPqyZw4Bo7Qo0E0CS3 SqBpa/YyuyraRXXZr7XDdtqItfYBOms0Avfah2ZGfr3Hy8KeTzkoC1ICJSMtuQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vfj066YXzzQvP; Wed, 15 May 2024 18:47: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 44FIloSZ043399; Wed, 15 May 2024 18:47:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44FIlom2043397; Wed, 15 May 2024 18:47:50 GMT (envelope-from git) Date: Wed, 15 May 2024 18:47:50 GMT Message-Id: <202405151847.44FIlom2043397@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: 0a09b741a794 - releng/14.1 - adduser: Additional variable fixes. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 0a09b741a7946c347310980d3f980044feda792b Auto-Submitted: auto-generated The branch releng/14.1 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=0a09b741a7946c347310980d3f980044feda792b commit 0a09b741a7946c347310980d3f980044feda792b Author: Dag-Erling Smørgrav AuthorDate: 2024-05-15 12:13:49 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-15 18:47:24 +0000 adduser: Additional variable fixes. One function used `_input` without making it local, causing its value to leak into other functions. This broke the `-f` case. Fix that instance and initialize all local variables that weren't already initialized. Fixes: 170d0882903e MFC after: 3 days Reviewed by: karels Differential Revision: https://reviews.freebsd.org/D45204 (cherry picked from commit 46a619c6d4cfc662069950baca16ec2a3b18b8a5) (cherry picked from commit db5aefb1cae14e31263ddb146f5952ca64bf6865) Approved by: re (cperciva) --- usr.sbin/adduser/adduser.sh | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/usr.sbin/adduser/adduser.sh b/usr.sbin/adduser/adduser.sh index 61a4b3b5058f..7c3fdb418179 100644 --- a/usr.sbin/adduser/adduser.sh +++ b/usr.sbin/adduser/adduser.sh @@ -53,7 +53,7 @@ info() { # by pw(8). # get_nextuid () { - local _uid=$1 _nextuid + local _uid=$1 _nextuid= if [ -z "$_uid" ]; then _nextuid="$(${PWCMD} usernext | cut -f1 -d:)" @@ -101,7 +101,7 @@ show_usage() { # basename of the shell is output. # valid_shells() { - local _prefix + local _prefix= ${GREPCMD} '^[^#]' ${ETCSHELLS} | while read _path _junk ; do @@ -119,7 +119,7 @@ valid_shells() { # full path to the shell from the /etc/shells file. # fullpath_from_shell() { - local _shell=$1 _fullpath + local _shell=$1 _fullpath= if [ -z "$_shell" ]; then return @@ -154,7 +154,7 @@ fullpath_from_shell() { # will emit an informational message saying so. # shell_exists() { - local _sh="$1" + local _sh=$1 if [ -z "$(fullpath_from_shell "$_sh")" ] ; then err "Invalid shell ($_sh) for user $username." @@ -193,8 +193,9 @@ save_config() { # message or lock the account, do so. # add_user() { - local _uid _name _comment _gecos _home _group _grouplist _shell _class - local _dotdir _expire _pwexpire _passwd _upasswd _passwdmethod _pwcmd + local _uid= _name= _comment= _gecos= _home= _group= _grouplist= + local _shell= _class= _dotdir= _expire= _pwexpire= _passwd= _upasswd= + local _passwdmethod= _pwcmd= # Is this a configuration run? If so, don't modify user database. # @@ -299,7 +300,7 @@ add_user() { fi fi - local _line _owner _perms _file _dir + local _line= _owner= _perms= _file= _dir= if [ -n "$msgflag" ]; then if [ -r "$msgfile" ]; then # We're evaluating the contents of an external file. @@ -331,7 +332,7 @@ add_user() { # a file it will output an error message and return to the caller. # get_user() { - local _input + local _input= # No need to take down user names if this is a configuration saving run. [ -n "$configflag" ] && return @@ -366,7 +367,7 @@ get_user() { # and batch (from file) mode. # get_gecos() { - local _input + local _input= # No need to take down additional user information for a configuration run. [ -n "$configflag" ] && return @@ -386,7 +387,7 @@ get_gecos() { # If an invalid shell is entered it will simply use the default shell. # get_shell() { - local _input _fullpath + local _input= _fullpath= ushell="$defaultshell" # Make sure the current value of the shell is a valid one @@ -424,7 +425,7 @@ get_shell() { # and batch input. # get_homedir() { - _input= + local _input= if [ -z "$fflag" ]; then echo -n "Home directory [${homeprefix}/${username}]: " read _input @@ -450,7 +451,7 @@ get_homedir() { # Reads the account's home directory permissions. # get_homeperm() { - local _input _prompt + local _input= _prompt= uhomeperm=$defaultHomePerm if [ -n "$uhomeperm" ]; then @@ -473,7 +474,7 @@ get_homeperm() { # so, enable ZFS home dataset creation. # get_zfs_home() { - local _prefix + local _prefix= # check if zfs kernel module is loaded before attempting to run zfs to # prevent loading the kernel module on systems that don't use ZFS @@ -494,7 +495,7 @@ get_zfs_home() { # allocates one if it is not specified. # get_uid() { - local _input _prompt + local _input= _prompt= uuid=${uidstart} if [ -n "$uuid" ]; then @@ -519,7 +520,7 @@ get_uid() { # Reads login class of account. Can be used in interactive or batch mode. # get_class() { - local _input _class + local _input= _class= uclass="$defaultclass" _class=${uclass:-"default"} @@ -541,7 +542,7 @@ get_class() { # will then provide a login group with the same name as the username. # get_logingroup() { - local _input + local _input= ulogingroup="$defaultLgroup" if [ -z "$fflag" ]; then @@ -560,7 +561,7 @@ get_logingroup() { # and batch modes. # get_groups() { - local _input _group + local _input= _group= ugroups="$defaultgroups" _group=${ulogingroup:-"${username}"} @@ -626,7 +627,7 @@ get_password() { # Ask user if they want to enable encryption on their ZFS home dataset. # get_zfs_encryption() { - local _input _prompt + local _input= _prompt= _prompt="Enable ZFS encryption? (yes/no) [${Zencrypt}]: " while : ; do echo -n "$_prompt" @@ -702,7 +703,7 @@ set_zfs_perms() { # adds it to the user database. # input_from_file() { - local _field + local _field= while read -r fileline ; do case "$fileline" in @@ -733,7 +734,7 @@ input_from_file() { # the user database. # input_interactive() { - local _disable _pass _passconfirm _input + local _disable= _pass= _passconfirm= _input= local _random="no" local _emptypass="no" local _usepass="yes" From nobody Thu May 16 00:58:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VfsDS0kdLz5KB5F; Thu, 16 May 2024 00:59:04 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VfsDR5rTJz4SgB; Thu, 16 May 2024 00:59:03 +0000 (UTC) (envelope-from zlei@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715821143; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TVD0Bu1cwnlj/Jc3E62kT9jP9QDJQYZoihJkLvI1Gck=; b=DVjIL0zuT6oXK0ktRGt4d8Bzk0rdhfYJ+2avXR5wHfQXhgkkXEd8AsjndfXbAACtA3/0/d xGjfzES0rxMo31E7g3XyO5wxzSUHU7KuCbVEtDG6+60civIhL6OkRVNvOKZSFefnYoXVrE yS0k58NykBibn3HYBQhpBxARDmy2ly8CQN5Hc3tqgwWdtcKvgiLzU/x5oCQdvFNlyABZ8X LW7sCAfbRS8eiN0lfCWkebKQb8K+eqPKdwoGfa1nrRVXHqW0iVmH6UsZ6KdoyV7h15q+gr lgs8T7HRUa3WUl5PqNKRy8ShVqb0quJClNQvST6dnxcsQrnbWcSNtl8+XVu+XQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715821143; a=rsa-sha256; cv=none; b=Mli9u8wbXzFlLxBmHElll5wFAxV1B9ju0UIYx/SBWX5bgwAHnuI6Ry0vCwJKeJFrLLPCWQ /ezrGAM4ROgCNhOE5NZZkH0ENSpP+hhznURlLCc4n2AcYcvC/8aCczb7aZT2CPfpuswCsO Z6M7PFy22RGs6IFBbs0fqjyDlqy0SrnHspTt6eIk7ALGgVvQ6ZzSJfh28kBGKBaUD1zjsl /WCGOCYXgjdIriMg25TkxMHGm9EASSCWtLRG5jYuSkppNp6JTQfnGPs1PweTVQybhTtI/p SuH7h1gu1O0TTYc6UduqzjWqNtG1MiC3dLAGrwPT9I1RjnFnWyOPBt6yzILpGg== 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=1715821143; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TVD0Bu1cwnlj/Jc3E62kT9jP9QDJQYZoihJkLvI1Gck=; b=nV3TnQ9sbn+KXUy9QxewD8+B3JBOQxt5pbhmp70HXcx1v7w1Urd5EFVx6iEPDVAEX7VoA3 DLfskE7W59OnM/Pl9ITT8bYZdEPBQxm13QbV/lW6Gb6gDN8U8Ci9j4chIPswzWlaSsk4ae T0Ri4xv+5nWEeC9b4M+ylI17v89X5pNiJMoquTwXiNjyuNVj9L80HVDejSCeqDsu9ShHRF fGtU6uTeqRlYEUmgWVJky9zFeb8GMxnfqzz96JvZK82TD8Bb289QfsjVo4Lg6CjwDPQ85+ Qb8cQi+FplHCPD2pYP37+cwARJ+fAVFeo/NtUQhutmFYBapQry1bvaE+4gH+QQ== Received: from smtpclient.apple (unknown [IPv6:2001:19f0:6001:9db:98f0:9fe0:3545:10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: zlei/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4VfsDQ3X3MzT4h; Thu, 16 May 2024 00:59:02 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.8\)) Subject: Re: git: b827afb9e3a7 - releng/14.1 - Revert "intrng: switch from MAXCPU to mp_ncpus" From: Zhenlei Huang In-Reply-To: <202405151635.44FGZxAS021246@gitrepo.freebsd.org> Date: Thu, 16 May 2024 08:58:54 +0800 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-branches@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <88AD738C-4E2C-430D-8AE1-D1C7A633B977@FreeBSD.org> References: <202405151635.44FGZxAS021246@gitrepo.freebsd.org> To: Mike Karels X-Mailer: Apple Mail (2.3696.120.41.1.8) > On May 16, 2024, at 12:35 AM, Mike Karels wrote: >=20 > The branch releng/14.1 has been updated by karels: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Db827afb9e3a7aaaa2da7d101c46881c6= 46d4df2f >=20 > commit b827afb9e3a7aaaa2da7d101c46881c646d4df2f > Author: Mike Karels > AuthorDate: 2024-05-14 22:44:58 +0000 > Commit: Mike Karels > CommitDate: 2024-05-15 16:35:38 +0000 >=20 > Revert "intrng: switch from MAXCPU to mp_ncpus" >=20 > This reverts commit b4d11915c73f199501672b278be86e1f63790036. > This is a direct commit to stable/14. The change breaks booting > on older Raspberry Pi 4's, although that works on main. The cause Emm, I think this revert affects other arch also. Does this have large = impact ? If yes, and only older Paspberry Pi 4 is to be fixed, why not add conditional compile #if = directive for Paspberry Pi 4 instead ? For amd64 the MAXCPU has been bumped from 256 to 1024 [1]. That is large = IMO. 1. 9051987e40c5 amd64: Bump MAXCPU to 1024 (from 256) > is unknown. The original commit should be redone on stable/14 > if/when it catches up with main. >=20 > (cherry picked from commit = 3e627553bbd791a4f73eaeea2c2d795fd4e0ee70) >=20 > Approved-by: re (cperciva) > --- > sys/kern/subr_intr.c | 22 +++++++++++----------- > 1 file changed, 11 insertions(+), 11 deletions(-) >=20 > diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c > index 49fe20cdc890..6535c42f2404 100644 > --- a/sys/kern/subr_intr.c > +++ b/sys/kern/subr_intr.c > @@ -175,11 +175,11 @@ intr_irq_init(void *dummy __unused) >=20 > /* > * - 2 counters for each I/O interrupt. > - * - mp_maxid + 1 counters for each IPI counters for SMP. > + * - MAXCPU counters for each IPI counters for SMP. > */ > nintrcnt =3D intr_nirq * 2; > #ifdef SMP > - nintrcnt +=3D INTR_IPI_COUNT * (mp_maxid + 1); > + nintrcnt +=3D INTR_IPI_COUNT * MAXCPU; > #endif >=20 > intrcnt =3D mallocarray(nintrcnt, sizeof(u_long), M_INTRNG, > @@ -312,18 +312,18 @@ intr_ipi_setup_counters(const char *name) > mtx_lock(&isrc_table_lock); >=20 > /* > - * We should never have a problem finding mp_maxid + 1 = contiguous > - * counters, in practice. Interrupts will be allocated = sequentially > - * during boot, so the array should fill from low to high index. = Once > - * reserved, the IPI counters will never be released. Similarly, = we > - * will not need to allocate more IPIs once the system is = running. > + * We should never have a problem finding MAXCPU contiguous = counters, > + * in practice. Interrupts will be allocated sequentially during = boot, > + * so the array should fill from low to high index. Once = reserved, the > + * IPI counters will never be released. Similarly, we will not = need to > + * allocate more IPIs once the system is running. > */ > - bit_ffc_area(intrcnt_bitmap, nintrcnt, mp_maxid + 1, &index); > + bit_ffc_area(intrcnt_bitmap, nintrcnt, MAXCPU, &index); > if (index =3D=3D -1) > panic("Failed to allocate %d counters. Array = exhausted?", > - mp_maxid + 1); > - bit_nset(intrcnt_bitmap, index, index + mp_maxid); > - for (i =3D 0; i < mp_maxid + 1; i++) { > + MAXCPU); > + bit_nset(intrcnt_bitmap, index, index + MAXCPU - 1); > + for (i =3D 0; i < MAXCPU; i++) { > snprintf(str, INTRNAME_LEN, "cpu%d:%s", i, name); > intrcnt_setname(str, index + i); > } Best regards, Zhenlei From nobody Thu May 16 01:01:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VfsHh3t29z5KBML; Thu, 16 May 2024 01:01: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 4VfsHh34WJz4Sfx; Thu, 16 May 2024 01:01:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715821312; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=70jA9v3dlTJb+liTDJhGwIaaA+KfDOLYprPRvV6KdcM=; b=dJw60iLHzCNdoMdulKW/tFzotnaqxW/9ms4KN1ToiXEJ5ZSpAwRy21oRAK+ZpjPr0D5w11 TuvavxUIm3tJFo9mBitYAXR6AUuZB7PdAlSznP9m1ULo/hIxK+6exw1nsLltA9Vi9YGim8 TJ8nYVenMcVK+ct0YFec8yiE5DU9b0zi358gfzWEy9b7ezGci7SXzpil9G0HokPeIcr2kn EsSzQ3NnqmQ2WENBHdzJ8HRPWO7GCYq4BnlgygLfd/1yvuB7+URWRrxQWH202PE4ZOKwbL ukLpGj8iu8jnEOfQNQ+yGVfPTbsAdjto8sIozyf23QrD0NUpGzpRPqLzgmNpog== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715821312; a=rsa-sha256; cv=none; b=gaRBTf+yyoysNrlNPXUjGEjSvb5K8de06tdDDXT6pOhOhv0RXEiUWhIVexRH+9UAVwIJxG 42c82gdqbm1fkCYsKaK6DYkaNPdnWE0B18fWq/WRPZkeFu4guqrkfiNEQBg4K3z+I92h6A TXiukgZOebwzSlIQoUR2SpYd07NT24oH8PeHsKfmlT3pniKfENNTAQ7I8VFvpofiJGH3lc fNsnSb0uUFSUYqdrQwL5D8iRAb17LsqY8qsYqKU7Tx4GlhyzhRm9l6JZMAQOfbpNlCN6lo w/iLtbQqgL1JoAslWLKIA8TnGFbfP4FTgVGwih2qoz9MOTfcIqYH8FIE1KdyMg== 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=1715821312; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=70jA9v3dlTJb+liTDJhGwIaaA+KfDOLYprPRvV6KdcM=; b=aGcmp1VCE4J/sGnG33K82CklzBJyBxQcqS+78qtRIkjaQrU7vezdptAUeKqdlAOZ/uN3J6 NJ1bSxB4WtdIR9ll1H4yli3yskFgtohly6Qx3YCLyrJDAgaRE3eMFWVm6ImdUIMtYqpL7u Dp7W0HlHWlcWynpelLensgFcQeVU/ZO3XQKQuQo/vnNOl036m/aADvuR6Cpp+FmjbMwk2Q JUPsPELWLXbyBC8puN1O9F6+Dxw8hHIw9WJYDf2jQ9AEzjtRacRenBrL/c7zAN4Co5qecd eDl7M6w89c/4zyvRJbKfQp+rGBgF1i8sgW/8ejZLStJg7EP7ZOp3wxNslJJnHA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VfsHh2glFzdWQ; Thu, 16 May 2024 01:01: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 44G11q8M087230; Thu, 16 May 2024 01:01:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44G11qMc087227; Thu, 16 May 2024 01:01:52 GMT (envelope-from git) Date: Thu, 16 May 2024 01:01:52 GMT Message-Id: <202405160101.44G11qMc087227@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 5a061a38cdfa - main - vfs_domount_update(): style, use space instead of tab List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5a061a38cdfa151315051a1ca1400bb32e39cde2 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5a061a38cdfa151315051a1ca1400bb32e39cde2 commit 5a061a38cdfa151315051a1ca1400bb32e39cde2 Author: Konstantin Belousov AuthorDate: 2024-05-16 00:59:21 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-16 01:00:26 +0000 vfs_domount_update(): style, use space instead of tab Noted by: mckusick Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/kern/vfs_mount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 2b235d398332..4961eb332473 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -1517,7 +1517,7 @@ vfs_domount_update( MNT_ILOCK(mp); if (error == 0) { - mp->mnt_flag &= ~(MNT_UPDATE | MNT_RELOAD | MNT_FORCE | + mp->mnt_flag &= ~(MNT_UPDATE | MNT_RELOAD | MNT_FORCE | MNT_SNAPSHOT); } else { /* From nobody Thu May 16 01:01:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VfsHj4kCFz5KBDy; Thu, 16 May 2024 01:01: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 4VfsHj3nmTz4Sfy; Thu, 16 May 2024 01:01:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715821313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+OX0FIt9r6nqrhtDq8wMHwhAlzC/W8eYrXyRvL6jqwA=; b=KuakyJ0NT9mHJqZ5tSjfkQmFpjTo35wr65+MKCiddtK/eVrWlpJOuAblgue/BiLzP7/pdW ExubmnpOH1PSHWfSYmG/VQq9YMmRuxMDO1rKlz5wYacT+QgB9WuEtBUf/CwzT7RK7hdnLZ Ygu60NhrTs2h2/dAEz+sAErQZ/BNTX6P5sBnnvRq1Xau8Hb7bEHNQq4bUkwsD5x6TExRtw xcVqrriwC19XEdjB8YkEK9nUByT4uS39Yia06OPVVhsrzrJv7S/G1efFuCVi7Le0yizD+l T9MOnr8wfREkX/HZcZrRCIhxNQnZwQDe9UV77UI6B05Jku6Cji7qEiq0kWuwIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715821313; a=rsa-sha256; cv=none; b=pKxY5BwACsO6iVWK1YVHffeTF491butp9JShJGSGAdHmgYGx9m35dmbusg9VkoMyinCH2D JuihtCD1U3uRx2kNGb/2k9VbRDf3UN68/+Q9aeU9WP8OXUbYYrHPWxnUSjJjdMF/nPuYgO djwSMxxUFOWa5TDzwuyBiyC/XMla5W6K2aa3VU3CqZhTJNI2vrfzk6ISOKtMF1nEjJck+B bPr0S6DeUfL+DdHMWtxNzT/SEXppeB16VXb2VrJwfZ/F0AZveFUTRieblwchwRD93vgwPI B4gW4i4US8YkiI67fCqVoEYiR48ediTUp6hEoOTKfsz5RrhwTludz2U6tc41xg== 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=1715821313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+OX0FIt9r6nqrhtDq8wMHwhAlzC/W8eYrXyRvL6jqwA=; b=MRR8xgZgzmPZ9OevX/q1Tf3GcyWuzUzcxb7NhNjuaKphHDhHsJ6Lxq3i3bHZ526Brv3EtS n/fNxUYtPAx4oBAmuuPawmjl912beeDumS06dohAngrh+e65lZWfg2oEroOeroEEvqgCji x+tY+az4LwOdlv2mUdHY8S7n62lEoTrwK6keWtbRoCfxaLLAroNUoM+e3CG23KC5dRLHxr IJp4Q8fh+d4oS2/vVe187O0d0ffIrBJ+hmAV6YbNV+nKaZwng2Hv6q5jh09GChaTl0vs0n ZiV2JieDyxvlJ2xEBhvYfOxNOOYyfPFdxL7c4CPDxIMT4P7ebU7kowz/T80Hqg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VfsHj3PtFzds3; Thu, 16 May 2024 01:01: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 44G11rU1087282; Thu, 16 May 2024 01:01:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44G11rk3087279; Thu, 16 May 2024 01:01:53 GMT (envelope-from git) Date: Thu, 16 May 2024 01:01:53 GMT Message-Id: <202405160101.44G11rk3087279@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 21ccdb4119af - main - vfs_domount_update(): postpone setting MNT_UNION until VFS_MOUNT() is done List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 21ccdb4119afdfdfeaa80e9c8514171c65b35862 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=21ccdb4119afdfdfeaa80e9c8514171c65b35862 commit 21ccdb4119afdfdfeaa80e9c8514171c65b35862 Author: Konstantin Belousov AuthorDate: 2024-05-15 09:54:49 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-16 01:00:26 +0000 vfs_domount_update(): postpone setting MNT_UNION until VFS_MOUNT() is done The file system that handles updating the mount point might do lookups during the update, in which case it could find the flag MNT_UNION set on the mp while mount point is still not updated. In particular, the rootvp->v_mount->mnt_vnodecovered is not yet set. Delay setting MNT_UNION until the mount is performed. PR: 265311 Reported by: Robert Morris Reviewed by: mckusick, olce Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D45208 --- sys/kern/vfs_mount.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 4961eb332473..f5ff8d54fadd 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -1313,7 +1313,7 @@ vfs_domount_update( void *bufp; struct mount *mp; int error, export_error, i, len, fsid_up_len; - uint64_t flag; + uint64_t flag, mnt_union; gid_t *grps; fsid_t *fsid_up; bool vfs_suser_failed; @@ -1395,6 +1395,7 @@ vfs_domount_update( vfs_deleteopt(*optlist, "fsid"); } + mnt_union = 0; MNT_ILOCK(mp); if ((mp->mnt_kern_flag & MNTK_UNMOUNT) != 0) { MNT_IUNLOCK(mp); @@ -1416,6 +1417,11 @@ vfs_domount_update( mp->mnt_flag |= MNT_UPDATE; } else { mp->mnt_flag &= ~MNT_UPDATEMASK; + if ((mp->mnt_flag & MNT_UNION) == 0 && + (fsflags & MNT_UNION) != 0) { + fsflags &= ~MNT_UNION; + mnt_union = MNT_UNION; + } mp->mnt_flag |= fsflags & (MNT_RELOAD | MNT_FORCE | MNT_UPDATE | MNT_SNAPSHOT | MNT_ROOTFS | MNT_UPDATEMASK | MNT_RDONLY); if ((mp->mnt_flag & MNT_ASYNC) == 0) @@ -1519,6 +1525,7 @@ vfs_domount_update( if (error == 0) { mp->mnt_flag &= ~(MNT_UPDATE | MNT_RELOAD | MNT_FORCE | MNT_SNAPSHOT); + mp->mnt_flag |= mnt_union; } else { /* * If we fail, restore old mount flags. MNT_QUOTA is special, From nobody Thu May 16 01:23:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VfsmH1R7tz5KDLd; Thu, 16 May 2024 01:23:11 +0000 (UTC) (envelope-from karels@freebsd.org) Received: from mail2.karels.net (mail2.karels.net [3.19.118.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "freebsd", Issuer "freebsd" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VfsmG3Lwlz4WVM; Thu, 16 May 2024 01:23:10 +0000 (UTC) (envelope-from karels@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from mail2.karels.net (localhost [IPv6:0:0:0:0:0:0:0:1]) by mail2.karels.net (8.18.1/8.18.1) with ESMTP id 44G1N8aG008209; Wed, 15 May 2024 20:23:08 -0500 (CDT) (envelope-from karels@freebsd.org) Received: from [10.0.2.130] ([73.62.165.147]) by mail2.karels.net with ESMTPSA id 37eUNvxfRWYPIAAAs/W3XQ (envelope-from ); Wed, 15 May 2024 20:23:08 -0500 From: Mike Karels To: Zhenlei Huang Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: Re: git: b827afb9e3a7 - releng/14.1 - Revert "intrng: switch from MAXCPU to mp_ncpus" Date: Wed, 15 May 2024 20:23:08 -0500 X-Mailer: MailMate (1.14r6028) Message-ID: <68191B25-A5CB-48CE-BD17-F5E7F95CF052@freebsd.org> In-Reply-To: <88AD738C-4E2C-430D-8AE1-D1C7A633B977@FreeBSD.org> References: <202405151635.44FGZxAS021246@gitrepo.freebsd.org> <88AD738C-4E2C-430D-8AE1-D1C7A633B977@FreeBSD.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.16.0.0/14, country:US] X-Rspamd-Queue-Id: 4VfsmG3Lwlz4WVM On 15 May 2024, at 19:58, Zhenlei Huang wrote: >> On May 16, 2024, at 12:35 AM, Mike Karels wrote: >> >> The branch releng/14.1 has been updated by karels: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=3Db827afb9e3a7aaaa2da7d10= 1c46881c646d4df2f >> >> commit b827afb9e3a7aaaa2da7d101c46881c646d4df2f >> Author: Mike Karels >> AuthorDate: 2024-05-14 22:44:58 +0000 >> Commit: Mike Karels >> CommitDate: 2024-05-15 16:35:38 +0000 >> >> Revert "intrng: switch from MAXCPU to mp_ncpus" >> >> This reverts commit b4d11915c73f199501672b278be86e1f63790036. >> This is a direct commit to stable/14. The change breaks booting >> on older Raspberry Pi 4's, although that works on main. The cause > > Emm, I think this revert affects other arch also. Does this have large = impact ? If yes, and only > older Paspberry Pi 4 is to be fixed, why not add conditional compile #i= f directive for Paspberry Pi 4 > instead ? That won't help with installations. We use one GENERIC config for arm64.= On the other hand, arm64 has 32K counters for interrupts and only 1K for IPI= s (with this reverted and MAXCPU at 1024), so this isn't that big an increm= ent. arm has MAXCPU of 4; riscv has 16. This reversion makes the outcome the = same as on 14.0. > For amd64 the MAXCPU has been bumped from 256 to 1024 [1]. That is larg= e IMO. This change does not affect amd64 or i386, just systems with INTRNG (arm,= arm64, and riscv). So the change is only significant on arm64. Mike > 1. 9051987e40c5 amd64: Bump MAXCPU to 1024 (from 256) > >> is unknown. The original commit should be redone on stable/14 >> if/when it catches up with main. >> >> (cherry picked from commit 3e627553bbd791a4f73eaeea2c2d795fd4e0ee70= ) >> >> Approved-by: re (cperciva) >> --- >> sys/kern/subr_intr.c | 22 +++++++++++----------- >> 1 file changed, 11 insertions(+), 11 deletions(-) >> >> diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c >> index 49fe20cdc890..6535c42f2404 100644 >> --- a/sys/kern/subr_intr.c >> +++ b/sys/kern/subr_intr.c >> @@ -175,11 +175,11 @@ intr_irq_init(void *dummy __unused) >> >> /* >> * - 2 counters for each I/O interrupt. >> - * - mp_maxid + 1 counters for each IPI counters for SMP. >> + * - MAXCPU counters for each IPI counters for SMP. >> */ >> nintrcnt =3D intr_nirq * 2; >> #ifdef SMP >> - nintrcnt +=3D INTR_IPI_COUNT * (mp_maxid + 1); >> + nintrcnt +=3D INTR_IPI_COUNT * MAXCPU; >> #endif >> >> intrcnt =3D mallocarray(nintrcnt, sizeof(u_long), M_INTRNG, >> @@ -312,18 +312,18 @@ intr_ipi_setup_counters(const char *name) >> mtx_lock(&isrc_table_lock); >> >> /* >> - * We should never have a problem finding mp_maxid + 1 contiguous >> - * counters, in practice. Interrupts will be allocated sequentially >> - * during boot, so the array should fill from low to high index. Onc= e >> - * reserved, the IPI counters will never be released. Similarly, we >> - * will not need to allocate more IPIs once the system is running. >> + * We should never have a problem finding MAXCPU contiguous counters= , >> + * in practice. Interrupts will be allocated sequentially during boo= t, >> + * so the array should fill from low to high index. Once reserved, t= he >> + * IPI counters will never be released. Similarly, we will not need = to >> + * allocate more IPIs once the system is running. >> */ >> - bit_ffc_area(intrcnt_bitmap, nintrcnt, mp_maxid + 1, &index); >> + bit_ffc_area(intrcnt_bitmap, nintrcnt, MAXCPU, &index); >> if (index =3D=3D -1) >> panic("Failed to allocate %d counters. Array exhausted?", >> - mp_maxid + 1); >> - bit_nset(intrcnt_bitmap, index, index + mp_maxid); >> - for (i =3D 0; i < mp_maxid + 1; i++) { >> + MAXCPU); >> + bit_nset(intrcnt_bitmap, index, index + MAXCPU - 1); >> + for (i =3D 0; i < MAXCPU; i++) { >> snprintf(str, INTRNAME_LEN, "cpu%d:%s", i, name); >> intrcnt_setname(str, index + i); >> } > > Best regards, > Zhenlei From nobody Thu May 16 01:56:41 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VftW45sFtz5KGMp; Thu, 16 May 2024 01:56:48 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VftW45JgLz4ZXk; Thu, 16 May 2024 01:56:48 +0000 (UTC) (envelope-from zlei@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715824608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=dXmqhrT2DFKIOMAA3s9jmoVdE3tlFlfZhLw/OOF/FNc=; b=UdAo5xcyA2ZU73vRLtyfI+Lu7lB4tEPz1IlX9/zbM43tfd6mgZHRyWa6Vru2T8C7cmEnuh oJcaCKkpRXqBJlVxASwkoMmR9rvp8x4SoZshdizD7eteU5Nv5YQB9oh4hH8rCiLJhnWRPQ nMmF4HqXXuxEqWEwzPjrfnfCkSH2C4dQaygBj1HZIJe00DkfBGcbpBtk/ETletJ5eCA8Qy Me0t6c3GVo0cRNl3076efxTpyolNVZEoVnZIOcHVhpdDK2/B/+naVwu4nUP6V2dxqPZABe mNEgkxzIuoLlnyqj7cxF/YncdXTESPxod3xcHhkOxKJcsrmN1/KJ/OcOvP7dcQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715824608; a=rsa-sha256; cv=none; b=DrZSfIzxFOFj/4TSjr2WVFLTTMaImrXhRaXZ4cAS1AIdhnO40FlWluQm+kHqz9PwxK1UEY AHCCfWDCGmMPXPCmdXk2s1YEnFlCMsNu7DAtkfDQxmcTlZWl4QLUTfMQ2KQPSR54oGYJO1 OQAOvv1a8OfbykbuK6PmcaATu+y8LU0dIgOdEcRemagKY8vWFIV8jOkkrjpMsxBHGLk9J+ viAW81rNSYwCFxq73blKC4wjgXqoEiavik/tuhJzimsfYYKvRAeb9uIC/03qHYSGZsbzfj Pf0bIMfXfAakTHMO1L+c8hDorM/d47dEbtdMogm6DlBc6tBhqYhtQK8WHe2+CA== 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=1715824608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=dXmqhrT2DFKIOMAA3s9jmoVdE3tlFlfZhLw/OOF/FNc=; b=EcmZK5vE+LWv3zjtn871r3oEG+Y/LLNilNl1NMYyLEF+xvgemT6aVNIgLiss+rGbHtQDdX AGmvre324mJIbK8dj1yhompVD99DN6H+GkfGaTF+T9vpBdKF6KakVwsmX4VHEdG8jTF8UL +A+jJyO5D0hnwnUotAqNa2bgT+aEiXUmHEoKor6R9+/FlI2jvaHoBpPDcC3x6tYQv/8Ip0 8QhOQ6HsLvuPY4tfc230WlwBlANZ8islvEs3PA3RloyaAFsezFEiyI69Umpc2d51+ikV4p ADOTOWn9SxF65eRv3P8lbh64wP957+5+0gBUBeujVxWRThJQVEJ5XrmyECPbyg== Received: from smtpclient.apple (ns1.oxydns.net [45.32.91.63]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: zlei/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4VftW3103nzV8k; Thu, 16 May 2024 01:56:46 +0000 (UTC) (envelope-from zlei@FreeBSD.org) From: Zhenlei Huang Message-Id: <93753D00-CA46-4777-AB98-6C2A30906DB7@FreeBSD.org> Content-Type: multipart/alternative; boundary="Apple-Mail=_50E54440-1DA0-4055-88E2-92A7499DE7EE" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.8\)) Subject: Re: git: b827afb9e3a7 - releng/14.1 - Revert "intrng: switch from MAXCPU to mp_ncpus" Date: Thu, 16 May 2024 09:56:41 +0800 In-Reply-To: <68191B25-A5CB-48CE-BD17-F5E7F95CF052@freebsd.org> Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-branches@freebsd.org" To: Mike Karels References: <202405151635.44FGZxAS021246@gitrepo.freebsd.org> <88AD738C-4E2C-430D-8AE1-D1C7A633B977@FreeBSD.org> <68191B25-A5CB-48CE-BD17-F5E7F95CF052@freebsd.org> X-Mailer: Apple Mail (2.3696.120.41.1.8) --Apple-Mail=_50E54440-1DA0-4055-88E2-92A7499DE7EE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On May 16, 2024, at 9:23 AM, Mike Karels wrote: >=20 > On 15 May 2024, at 19:58, Zhenlei Huang wrote: >=20 >>> On May 16, 2024, at 12:35 AM, Mike Karels = wrote: >>>=20 >>> The branch releng/14.1 has been updated by karels: >>>=20 >>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3Db827afb9e3a7aaaa2da7d101c46881c6= 46d4df2f >>>=20 >>> commit b827afb9e3a7aaaa2da7d101c46881c646d4df2f >>> Author: Mike Karels >>> AuthorDate: 2024-05-14 22:44:58 +0000 >>> Commit: Mike Karels >>> CommitDate: 2024-05-15 16:35:38 +0000 >>>=20 >>> Revert "intrng: switch from MAXCPU to mp_ncpus" >>>=20 >>> This reverts commit b4d11915c73f199501672b278be86e1f63790036. >>> This is a direct commit to stable/14. The change breaks booting >>> on older Raspberry Pi 4's, although that works on main. The cause >>=20 >> Emm, I think this revert affects other arch also. Does this have = large impact ? If yes, and only >> older Paspberry Pi 4 is to be fixed, why not add conditional compile = #if directive for Paspberry Pi 4 >> instead ? >=20 > That won't help with installations. We use one GENERIC config for = arm64. On > the other hand, arm64 has 32K counters for interrupts and only 1K for = IPIs > (with this reverted and MAXCPU at 1024), so this isn't that big an = increment. > arm has MAXCPU of 4; riscv has 16. This reversion makes the outcome = the same > as on 14.0. Thanks for the explanation. >=20 >> For amd64 the MAXCPU has been bumped from 256 to 1024 [1]. That is = large IMO. >=20 > This change does not affect amd64 or i386, just systems with INTRNG = (arm, > arm64, and riscv). So the change is only significant on arm64. Sorry I was not aware that INTRNG is arm, arm64 and riscv only. >=20 > Mike >=20 >> 1. 9051987e40c5 amd64: Bump MAXCPU to 1024 (from 256) >>=20 >>> is unknown. The original commit should be redone on stable/14 >>> if/when it catches up with main. >>>=20 >>> (cherry picked from commit = 3e627553bbd791a4f73eaeea2c2d795fd4e0ee70) >>>=20 >>> Approved-by: re (cperciva) >>> --- >>> sys/kern/subr_intr.c | 22 +++++++++++----------- >>> 1 file changed, 11 insertions(+), 11 deletions(-) >>>=20 >>> diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c >>> index 49fe20cdc890..6535c42f2404 100644 >>> --- a/sys/kern/subr_intr.c >>> +++ b/sys/kern/subr_intr.c >>> @@ -175,11 +175,11 @@ intr_irq_init(void *dummy __unused) >>>=20 >>> /* >>> * - 2 counters for each I/O interrupt. >>> - * - mp_maxid + 1 counters for each IPI counters for SMP. >>> + * - MAXCPU counters for each IPI counters for SMP. >>> */ >>> nintrcnt =3D intr_nirq * 2; >>> #ifdef SMP >>> - nintrcnt +=3D INTR_IPI_COUNT * (mp_maxid + 1); >>> + nintrcnt +=3D INTR_IPI_COUNT * MAXCPU; >>> #endif >>>=20 >>> intrcnt =3D mallocarray(nintrcnt, sizeof(u_long), M_INTRNG, >>> @@ -312,18 +312,18 @@ intr_ipi_setup_counters(const char *name) >>> mtx_lock(&isrc_table_lock); >>>=20 >>> /* >>> - * We should never have a problem finding mp_maxid + 1 = contiguous >>> - * counters, in practice. Interrupts will be allocated = sequentially >>> - * during boot, so the array should fill from low to high index. = Once >>> - * reserved, the IPI counters will never be released. Similarly, = we >>> - * will not need to allocate more IPIs once the system is = running. >>> + * We should never have a problem finding MAXCPU contiguous = counters, >>> + * in practice. Interrupts will be allocated sequentially during = boot, >>> + * so the array should fill from low to high index. Once = reserved, the >>> + * IPI counters will never be released. Similarly, we will not = need to >>> + * allocate more IPIs once the system is running. >>> */ >>> - bit_ffc_area(intrcnt_bitmap, nintrcnt, mp_maxid + 1, &index); >>> + bit_ffc_area(intrcnt_bitmap, nintrcnt, MAXCPU, &index); >>> if (index =3D=3D -1) >>> panic("Failed to allocate %d counters. Array = exhausted?", >>> - mp_maxid + 1); >>> - bit_nset(intrcnt_bitmap, index, index + mp_maxid); >>> - for (i =3D 0; i < mp_maxid + 1; i++) { >>> + MAXCPU); >>> + bit_nset(intrcnt_bitmap, index, index + MAXCPU - 1); >>> + for (i =3D 0; i < MAXCPU; i++) { >>> snprintf(str, INTRNAME_LEN, "cpu%d:%s", i, name); >>> intrcnt_setname(str, index + i); >>> } >>=20 >> Best regards, >> Zhenlei --Apple-Mail=_50E54440-1DA0-4055-88E2-92A7499DE7EE Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii

On May 16, 2024, at 9:23 AM, Mike Karels <karels@freebsd.org> = wrote:

On 15 May 2024, at 19:58, Zhenlei Huang wrote:

On May 16, 2024, at = 12:35 AM, Mike Karels <karels@FreeBSD.org> wrote:

The branch releng/14.1 has been updated by karels:

URL: https://cgit.FreeBSD.org/src/commit/?id=3Db827afb9e3a7aaaa2da7d= 101c46881c646d4df2f

commit = b827afb9e3a7aaaa2da7d101c46881c646d4df2f
Author: =     Mike Karels <karels@FreeBSD.org>
AuthorDate: = 2024-05-14 22:44:58 +0000
Commit: =     Mike Karels <karels@FreeBSD.org>
CommitDate: = 2024-05-15 16:35:38 +0000

  Revert = "intrng: switch from MAXCPU to mp_ncpus"

  This reverts commit = b4d11915c73f199501672b278be86e1f63790036.
  This = is a direct commit to stable/14.  The change breaks booting
  on older Raspberry Pi 4's, although that works on = main.  The cause

Emm, I = think this revert affects other arch also. Does this have large impact ? = If yes, and only
older Paspberry Pi 4 is to be fixed, why = not add conditional compile #if directive for Paspberry Pi 4
instead ?

That won't help with installations.  We use one GENERIC = config for arm64.  On
the other hand, arm64 has 32K counters for interrupts and = only 1K for IPIs
(with this reverted and MAXCPU at 1024), so this isn't that = big an increment.
arm has MAXCPU of 4; riscv has 16.  This reversion makes = the outcome the same
as on 14.0.

Thanks for the explanation.


For = amd64 the MAXCPU has been bumped from 256 to 1024 [1]. That is large = IMO.

This change does not affect amd64 or i386, just systems with = INTRNG (arm,
arm64, and = riscv).  So the change is only significant on arm64.

Sorry = I was not aware that INTRNG is arm, arm64 and riscv only.


= Mike

1. = 9051987e40c5 amd64: Bump MAXCPU to 1024 (from 256)

  is unknown. =  The original commit should be redone on stable/14
  if/when it catches up with main.

  (cherry picked from commit = 3e627553bbd791a4f73eaeea2c2d795fd4e0ee70)

  Approved-by:    re (cperciva)
---
sys/kern/subr_intr.c | 22 = +++++++++++-----------
1 file changed, 11 insertions(+), = 11 deletions(-)

diff --git = a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c
index = 49fe20cdc890..6535c42f2404 100644
--- = a/sys/kern/subr_intr.c
+++ b/sys/kern/subr_intr.c
@@ -175,11 +175,11 @@ intr_irq_init(void *dummy __unused)

/*
 * - 2 counters for each I/O = interrupt.
-  * - mp_maxid + 1 counters = for each IPI counters for SMP.
+  * - MAXCPU counters for = each IPI counters for SMP.
 */
nintrcnt = =3D intr_nirq * 2;
#ifdef SMP
- nintrcnt = +=3D INTR_IPI_COUNT * (mp_maxid + 1);
+ nintrcnt = +=3D INTR_IPI_COUNT * MAXCPU;
#endif

= intrcnt =3D mallocarray(nintrcnt, sizeof(u_long), M_INTRNG,
@@ -312,18 +312,18 @@ intr_ipi_setup_counters(const char = *name)
mtx_lock(&isrc_table_lock);

= /*
-  * We should never have a = problem finding mp_maxid + 1 contiguous
-  * counters, in practice. = Interrupts will be allocated sequentially
-  * during boot, so the array = should fill from low to high index. Once
-  * reserved, the IPI = counters will never be released. Similarly, we
-  * will not need to allocate = more IPIs once the system is running.
+  * We should never have a = problem finding MAXCPU contiguous counters,
+  * in practice. Interrupts = will be allocated sequentially during boot,
+  * so the array should fill = from low to high index. Once reserved, the
+  * IPI counters will never = be released. Similarly, we will not need to
+  * allocate more IPIs once = the system is running.
 */
- = bit_ffc_area(intrcnt_bitmap, nintrcnt, mp_maxid + 1, = &index);
+ bit_ffc_area(intrcnt_bitmap, = nintrcnt, MAXCPU, &index);
if (index = =3D=3D -1)
panic("Failed to allocate %d = counters. Array exhausted?",
-     mp_maxid = + 1);
- bit_nset(intrcnt_bitmap, index, index + mp_maxid);
- = for (i =3D 0; i < mp_maxid + 1; i++) {
+     MAXCPU);+ = bit_nset(intrcnt_bitmap, index, index + MAXCPU - 1);
+ = for (i =3D 0; i < MAXCPU; i++) {
= snprintf(str, INTRNAME_LEN, "cpu%d:%s", i, name);
= = intrcnt_setname(str, index + i);
}

Best regards,
Zhenlei


= --Apple-Mail=_50E54440-1DA0-4055-88E2-92A7499DE7EE-- From nobody Thu May 16 05:59:22 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vfzty3TLRz5Kcjf; Thu, 16 May 2024 05:59: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 4Vfzty2zq8z3xs2; Thu, 16 May 2024 05:59:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715839162; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3U+ffBgdhtzS0Z/tenrQdxU/bTgr7tGyyyfOrUndZMc=; b=ucPP+M7aJrxCnkDFjeFaVBRpg2F+SMR6T6ai0Sxc9RF8NZUuETQl0NZ7C+nhCj1M10ki13 mZ/7hL9sOIpyCAbZD9+HhQfyVhLtZNpWFPiYVZT4HmCLa/t2AXnS0wvHJy+f3U+/VohWmL yuh99DhxnOO5mQDvX5M0prcApkzjbLCVstSXp9jlM98jh0tIkPqSBByXfa+q1gXRTj8KCF 3um+85gv7xP7BG9CZPgfhmB5Hd2Ev34kQKDhXejuwnWH/M1clq3vvntiFU2xmt4PAjiiNe q27EecxMUHkhXAKZcPlUjsWQZmHNRAKUGMoovd0UpCJxANzrRmJrqcD5TP5cZg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715839162; a=rsa-sha256; cv=none; b=RaX5oavBW6+BQWb+P5KA73z1vbC2X46z11+5IxGX5pu7mDO2mmGjBLGT5mmHtpbldD11Zq 5EAhmaEZ3R7cfTcHm8XjXT0X+aDqyqPQMPglxLXjbBC1GWlcyZWI0uacmNSM/uUQYV2wR/ OtkUimlhXqTqYet1tnGudijKiU72Fqt3rCBaRWJfr6dfLjZEwM7a/RSbXggcll5G7Wn3IM JWo4s4FW3ZiiEXM+/mv/BUjvTPu1NJ6M/jaPjHcjeEf7PfeD0Vu4VmsCguT/p/c98+RMCT zSHRkB326tEcfCocaD+M5s17BZu8ERvWhfke8vbfaSUsF8ky/sBXKULD7SC7Sg== 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=1715839162; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3U+ffBgdhtzS0Z/tenrQdxU/bTgr7tGyyyfOrUndZMc=; b=L4jsOO7Ywr6wfKhX0WGhMEK1FCdml5hfmr2roTkAzKOUkm/i83j3k1oHp0YCSwhmsxS6kz 4gzK9yV9Lf0rVVLsbDQLlmtG6n1l40Io48njNq45z67AytmYJg45VuZhfSnBc13KTw8pGQ VEzlLFTl+O/E4FlbGBhD46x5PD0jG/M5av5aqLX4jeD5TUKCbtJX5U1T5uIpsBN9METthm bDTSgglbssuzyCWI7K9TbOpkw+Oc36qCBG2dCchE2/EARyGt4Kt+Mf8F4lht3f3eSSAV3S Vvv8bjnqUaABmrZ1rbRu/S87xvmsQqXlsymyxrY3G2uZyF1A3DOUOdpjWVuizQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vfzty2b1Pzmjw; Thu, 16 May 2024 05:59:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44G5xMT9078799; Thu, 16 May 2024 05:59:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44G5xMpc078796; Thu, 16 May 2024 05:59:22 GMT (envelope-from git) Date: Thu, 16 May 2024 05:59:22 GMT Message-Id: <202405160559.44G5xMpc078796@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 3e5219458fed - stable/14 - ipfw: Fix a typo in a source code comment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3e5219458fed7c559ba157cca65a99e41e14aadc Auto-Submitted: auto-generated The branch stable/14 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=3e5219458fed7c559ba157cca65a99e41e14aadc commit 3e5219458fed7c559ba157cca65a99e41e14aadc Author: Gordon Bergling AuthorDate: 2024-05-12 08:53:40 +0000 Commit: Gordon Bergling CommitDate: 2024-05-16 05:59:09 +0000 ipfw: Fix a typo in a source code comment - s/defaul/default/ (cherry picked from commit 78e4dbc34559f7b18ea85cafd6663db4e6d54af9) --- sys/netinet/ip_fw.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/ip_fw.h b/sys/netinet/ip_fw.h index 2b59e46b5bcc..937dc8fbbbc2 100644 --- a/sys/netinet/ip_fw.h +++ b/sys/netinet/ip_fw.h @@ -979,7 +979,7 @@ typedef struct _ipfw_range_tlv { #define IPFW_RCFLAG_USER (IPFW_RCFLAG_RANGE | IPFW_RCFLAG_ALL | \ IPFW_RCFLAG_SET | IPFW_RCFLAG_DYNAMIC) /* Internally used flags */ -#define IPFW_RCFLAG_DEFAULT 0x0100 /* Do not skip defaul rule */ +#define IPFW_RCFLAG_DEFAULT 0x0100 /* Do not skip default rule */ typedef struct _ipfw_ta_tinfo { uint32_t flags; /* Format flags */ From nobody Thu May 16 05:59:39 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VfzvH5Ytrz5Kcjl; Thu, 16 May 2024 05:59: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 4VfzvH4z68z3yjS; Thu, 16 May 2024 05:59:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715839179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yWTkPxT/E0/92TAjsx0IbMM5LI4Q/BFq8V8BnCorF1g=; b=CfryqdHT43p+0C/oFWqzJMJo1+Ls08kTpClyYuzZinfNokb/mL4BEP1tmsfq2HkK+Vh4fp B/MNx8ROvvBS0gBSnsh9zuEk3X72hMI9tUD1KFmNXtVIOM5gG3hXBEAGmAyfKk7Sx2w6mw CWmnET5hozKg1/pqlHxG3kcELeQkudjCJDtYBEaOsj3zZ8U+bEYDhBzzAWyAz9c4F1GJ6p tOqXAHQ+BxFsyr6wwDv5Ys9vbdDC6iD2dNVbgjdOr4fG954LzFIrE9JbzU2t6wevQHGEU6 htwdjLlXfD/YYE3JPeDU+01dxSqcrKU5SFKycy84vq4xozJfwgVZgkQkbt+M+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715839179; a=rsa-sha256; cv=none; b=UQiSLsiOJrP/jcYWpk/Z/gZhyVGkhDbOzS9mBTZxRnuZtTS/TLLRzMAS2RtGnWT1uYUqTG Q65u+J+1QjYLecfbN3cTd9faidjW4CCwS3wJyGe1q5xu6V+Ec5sklUk4QKBrPX6M0bDkez X2RR8SvqljmgCGIsCDXvmMn5JSAXqqbJr4fxNQ8nyhrMrDMF1ewCIORW4Mp193czKyS54+ QhvgcPsGeAduS0kvXx37KrDo4zzayGB7nprJeycJCycz4cZIlyoMdCnsC/Yj65AshOIupD Powlh4u3n+JBF2UakmljsuJJFgzE21Zi8hr6osN4Ue92NWu42X6PzODyO7GaLA== 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=1715839179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yWTkPxT/E0/92TAjsx0IbMM5LI4Q/BFq8V8BnCorF1g=; b=LOxDfz89ikYxRIO0x+guRmHIII8I9vyq8og8eFU1lLj9qvEX2T/Z5bzu41Uq1RElcOUsne I8xQNRcS8dQF5Il1nsNkuQBtZQQX48hnGXfz8ryuC/XDbH5DbbBn/ml03o/RL1L10PXX6U 9mbRPQv+SwftIytTuALVdI43YD24A0+p7wrBWjXUXbcCav6v+9NDyUrwV6BMDvldjA5XQ4 t4yXx0fzcy9Kh/mA1nTpHQ42Fdz43MWUFeDmragdSszks6HrVho4SLvBkrbKzlHzGx4KfS bLu4t80GR7JhGnGtxadZHWalYarwN7WeBiKskuIXfz+1X418tXmu1FApX43vcA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VfzvH4ZVvzmgQ; Thu, 16 May 2024 05:59: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 44G5xdkc078971; Thu, 16 May 2024 05:59:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44G5xdSK078968; Thu, 16 May 2024 05:59:39 GMT (envelope-from git) Date: Thu, 16 May 2024 05:59:39 GMT Message-Id: <202405160559.44G5xdSK078968@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 0e2681e4d79f - stable/13 - ipfw: Fix a typo in a source code comment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0e2681e4d79fcdb93f899de82a5610f562fe9a09 Auto-Submitted: auto-generated The branch stable/13 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=0e2681e4d79fcdb93f899de82a5610f562fe9a09 commit 0e2681e4d79fcdb93f899de82a5610f562fe9a09 Author: Gordon Bergling AuthorDate: 2024-05-12 08:53:40 +0000 Commit: Gordon Bergling CommitDate: 2024-05-16 05:59:28 +0000 ipfw: Fix a typo in a source code comment - s/defaul/default/ (cherry picked from commit 78e4dbc34559f7b18ea85cafd6663db4e6d54af9) --- sys/netinet/ip_fw.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/ip_fw.h b/sys/netinet/ip_fw.h index 332d6e2db0b8..ba2bb06b2416 100644 --- a/sys/netinet/ip_fw.h +++ b/sys/netinet/ip_fw.h @@ -972,7 +972,7 @@ typedef struct _ipfw_range_tlv { #define IPFW_RCFLAG_USER (IPFW_RCFLAG_RANGE | IPFW_RCFLAG_ALL | \ IPFW_RCFLAG_SET | IPFW_RCFLAG_DYNAMIC) /* Internally used flags */ -#define IPFW_RCFLAG_DEFAULT 0x0100 /* Do not skip defaul rule */ +#define IPFW_RCFLAG_DEFAULT 0x0100 /* Do not skip default rule */ typedef struct _ipfw_ta_tinfo { uint32_t flags; /* Format flags */ From nobody Thu May 16 05:59:58 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vfzvf4NJ8z5KcrC; Thu, 16 May 2024 05:59: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 4Vfzvf3sG3z40DN; Thu, 16 May 2024 05:59:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715839198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nbkMBbOwntnhKU48bHJvDYXvhNfAPkw0ie6K3oq2OZE=; b=TozvbYOJa0rKROLkslQE0iCN/dsY3Mfh/MIXzQ1BDeiHRq5TYAVIoU5oYSBkEghFBT7qEk jguftPzrbXqY3cWyuWAQMZGrYoMvkBoS2wTXJFFvAnDfh76Zl/+bisdzluegDXMvc/qH76 /kW8bqBF1iwEX8ijRPuMoBK1KlRBE+o6qsAET0qQvHvsnyCHvaBHZhgsuiEVunLgHJi9M4 f9iLQZQt1n3OQfV/7jRxtuabng8Asl0x2LDoHJB5MaG56+y+hTZSatCgi3dTGkMq95+mSO lnA9WNPLhKfyVi26NsvXC4TcXpls+1ML4Yi6SlLaCtKAD7NpDL6AfJPgECDx/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715839198; a=rsa-sha256; cv=none; b=XfB0cA8m6o64Rr4Mz9ILkFWWxBJXvWNe0eyTyoFHwop9nWscDbhbd5oBKvpe0ZcPTmiI67 7IcqefMXnEcb6KIatbX3iu5dvp9mXPvfE3hmvDEJoagBq4qAjKaAHX9Q2Ckx017tCA3Zos jzlCTVsITsEwZDzzccNwySJhMDibOZEbaL3otnw5yBFmxg4Q4pCZrZ14znGg1f2ptqp8U1 XybAP823IqvXHObKo7THKj3KU11O0PfP3sUlNq0k0prdHCH2IN70ROh2ZeSGF+WXWuSF2V HuV8luGsZlvQHATv/hutamt3bGiFvEnRjE/+NY7CPF0XYQ0cKXsnd+aehpZGRg== 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=1715839198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nbkMBbOwntnhKU48bHJvDYXvhNfAPkw0ie6K3oq2OZE=; b=wast22Ze3t+RuVaMMZ6wiaFnm4gKww3rTCYWY4Xpy0t01jmc+NimVR7G3hOjWYXsvfCcYs H6l+Qk1APpvE/kk0QhOR2Fg1qH0XVtx7oXo0Q7vFLpF1BwX1SNzCAv85hd7JxuEacsaqJH rCKf2vzNrCe2efOkN/b+hSQxSvbpCEp6rTEJwUPbK7QYHp3/Dis5mhoaTQbL5wCfEf6RLc +BaVA8gumRAX39ENEBKYg1mMmXL8fP8NsrE7WrQZRKX343W+jNHpOm7emwx5GIcrogllLD RjIIBg+snOIe9yQzJdwSP+4vlSU6qaMDgz7WCfa8Rh6Fnh2SZ8G6dlPp4DcQBA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vfzvf3SkKzn7K; Thu, 16 May 2024 05:59: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 44G5xwQs079162; Thu, 16 May 2024 05:59:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44G5xwJA079159; Thu, 16 May 2024 05:59:58 GMT (envelope-from git) Date: Thu, 16 May 2024 05:59:58 GMT Message-Id: <202405160559.44G5xwJA079159@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 4b62662bcd67 - stable/12 - ipfw: Fix a typo in a source code comment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 4b62662bcd672b97676da5812c1b6436805fcb69 Auto-Submitted: auto-generated The branch stable/12 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=4b62662bcd672b97676da5812c1b6436805fcb69 commit 4b62662bcd672b97676da5812c1b6436805fcb69 Author: Gordon Bergling AuthorDate: 2024-05-12 08:53:40 +0000 Commit: Gordon Bergling CommitDate: 2024-05-16 05:59:48 +0000 ipfw: Fix a typo in a source code comment - s/defaul/default/ (cherry picked from commit 78e4dbc34559f7b18ea85cafd6663db4e6d54af9) --- sys/netinet/ip_fw.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/ip_fw.h b/sys/netinet/ip_fw.h index 8b6055e64a6d..151251032e3b 100644 --- a/sys/netinet/ip_fw.h +++ b/sys/netinet/ip_fw.h @@ -954,7 +954,7 @@ typedef struct _ipfw_range_tlv { #define IPFW_RCFLAG_USER (IPFW_RCFLAG_RANGE | IPFW_RCFLAG_ALL | \ IPFW_RCFLAG_SET | IPFW_RCFLAG_DYNAMIC) /* Internally used flags */ -#define IPFW_RCFLAG_DEFAULT 0x0100 /* Do not skip defaul rule */ +#define IPFW_RCFLAG_DEFAULT 0x0100 /* Do not skip default rule */ typedef struct _ipfw_ta_tinfo { uint32_t flags; /* Format flags */ From nobody Thu May 16 06:56:00 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vg18K1nsYz5KjVQ; Thu, 16 May 2024 06:56: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 4Vg18K103tz4HS5; Thu, 16 May 2024 06:56:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715842561; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fv2aU/BbmI+K3K9cOwOjSo1DPibzdHZt+fMQgQ7RGA4=; b=rh708xk6MADXbsUkoZDw07yyOG0VFUNNK2et5ZXFVbSQs5HLCYjXr8dHtDRC0IUL8A5mRH UxQACeiPJq1sVxuKARdEgpxcOYEvEXd4zKYilo/0NkeFUTx435SMl1f2VMBb9gzXMNmQ15 HBjpPxcggcY4uckCdMf6y9gw7eB1T8jv6AeWb9fmOeonS+PQdwB7QqA7knUqXzAyXm/QU7 pqDlLP6lZoIwebgxHKpto3NNCEuoCRGcIqO26dNOu7/nM1chJBteYg06Zpu0bMKAT6Izsi OpgaO60XZY66E1UJ0RH/u3DMyhkMjGMHJy03NzuDfXViRFmFbYaXeOoaFHpn7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715842561; a=rsa-sha256; cv=none; b=yXCbxyGdr6XRthfdNhPUOyjWTSIf9wrhxwwsyND5TcCOx89YmFbhYkWrVllYNg7JWnVhkZ XoPlEgwvlKoIHOVnClvAPiPn6FamB5+1X75mFPsxYMu2TwTtJEcIWG7Z4AJ1RZGrDaCIfQ aDqv0DszWFMjMoxRi/TQYdtPmTw6/u7q5zVbfqmRb2sTk0uAgRGSpuyjymAIx8FouVkCco FBNC4p5Jd6wwIWwtDpzOGzY94dYYCvEQvK7AC7tp5kobNAROPtAZtBIg3BBLxbVAl9qCbl GdzvJ/XW8JUrCOJepeOIELCLzpoMseFAy6K9Uh5GYzLLDNqxuDmsmiUwuL0AkA== 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=1715842561; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fv2aU/BbmI+K3K9cOwOjSo1DPibzdHZt+fMQgQ7RGA4=; b=VGR1s1UXcaFLUOt0W5QKZqBT2ZRn70XQ/v4jGc4FRBYScB/q4aymHOozzu00RgqhCGUqIH BP6NW/54vMWqGdvAzFq7eE6QZgoD9bUHxCtEL76iBZxP3dTOISNFiacB/q5XVoOdFp859l u1AeN6ann3UI9mQx+z9nHQLdEa2msGw8KXOktUEOV466nhS3NvFdgDM2k1hclVtDAzBx8j SApAKIdLC8AIgHqRqIWj75LwOsXuozbZ5/HRSGm5WS7kRSTRQ/PWHyhh0agYEvQbhDQ5zE e9YUMY4ysiDOWVkNNoTz88pRVkawT+gQ4YO0kVFCx19Zcl6k8X2cF6CRu/MJ2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vg18K0SpXzpSY; Thu, 16 May 2024 06:56: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 44G6u04k087135; Thu, 16 May 2024 06:56:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44G6u03n087132; Thu, 16 May 2024 06:56:00 GMT (envelope-from git) Date: Thu, 16 May 2024 06:56:00 GMT Message-Id: <202405160656.44G6u03n087132@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 7465f9fc0646 - stable/14 - Enable soft updates by default for UFS2 filesystems. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7465f9fc06467e57d3bbf2430031fe51d8182c30 Auto-Submitted: auto-generated The branch stable/14 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=7465f9fc06467e57d3bbf2430031fe51d8182c30 commit 7465f9fc06467e57d3bbf2430031fe51d8182c30 Author: Kirk McKusick AuthorDate: 2024-05-15 05:38:35 +0000 Commit: Kirk McKusick CommitDate: 2024-05-16 06:55:44 +0000 Enable soft updates by default for UFS2 filesystems. Differential Revision: https://reviews.freebsd.org/D45201 (cherry picked from commit 61dece6d27fb2436928ca93d65667b358e05aa7b) --- sbin/newfs/newfs.8 | 6 +++++- sbin/newfs/newfs.c | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/sbin/newfs/newfs.8 b/sbin/newfs/newfs.8 index e1496af814ca..0dc93cb8b78d 100644 --- a/sbin/newfs/newfs.8 +++ b/sbin/newfs/newfs.8 @@ -27,7 +27,7 @@ .\" .\" @(#)newfs.8 8.6 (Berkeley) 5/3/95 .\" -.Dd October 21, 2022 +.Dd May 18, 2024 .Dt NEWFS 8 .Os .Sh NAME @@ -100,6 +100,10 @@ The default format is UFS2. For backward compatibility. .It Fl U Enable soft updates on the new file system. +Soft updates are enabled by default for UFS2 format file systems. +Use +.Xr tunefs 8 +to disable soft updates if they are not wanted. .It Fl a Ar maxcontig Specify the maximum number of contiguous blocks that will be laid out before forcing a rotational delay. diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c index afb71f9f25b4..c96e414b85dd 100644 --- a/sbin/newfs/newfs.c +++ b/sbin/newfs/newfs.c @@ -395,6 +395,9 @@ main(int argc, char *argv[]) fprintf(stderr, "because minfree is less than %d%%\n", MINFREE); opt = FS_OPTSPACE; } + /* Use soft updates by default for UFS2 and above */ + if (Oflag > 1) + Uflag = 1; realsectorsize = sectorsize; if (sectorsize != DEV_BSIZE) { /* XXX */ int secperblk = sectorsize / DEV_BSIZE; From nobody Thu May 16 07:41:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vg28h6BHgz5Kmy0; Thu, 16 May 2024 07:41:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vg28h5l8dz4LwC; Thu, 16 May 2024 07:41:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715845284; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wv5nxC3PH2pGLMU38SRF4ypIwiBrBQzBMQ2wFskuuuc=; b=Jg963ThGviwus9ENrD2i/QDmXyvzmJ7cZyrZrMYfoOIdMtCJh4PM910Zqg5TzDD/3d18w/ QKIXNy9ZDLBtD4mPIrOBl1Rki9zSTtpd4EXvkA34Wq0H7OgKpBTWBBL2LEOR09dBRh6sMO FCTWBsPbScsA5Vh7QXB6r9RJpTrb8E0VowQ/mv636b8sLGHjkrDxJnTRr/gk2/OTdh4cwj JXUnShi0fR18+vtNZz8FvScev71pj7s92uyNTa0Vr/rd3fSQG1egbuhIEH/IlOVPZU0KKn 4QaR6VNiUrXC22Mhd7CFxpmbIiraU/s8IJkW/48Uu14T/zujqzslUD6CzzMkFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715845284; a=rsa-sha256; cv=none; b=iT0Ilul0frL4bDCExdxOXJpAA0zKZGjDJFnIx/6byuhhgjvuZpaxAnav1op4um4a61wkDx JvAbnsT89rD/RM8mLmCSzzrLeg6qWzPW0Aj6JqcKCafsPsoBTSuX0zcmmlGa09vS5ijA2N IqVktVvpwrt4WGV56PaDMWtJfRWongydLwiMat/wrtqQWtRvJqOgzn8vBuerUTdhuXYnSg CSFPkFzhmwUF2jACU0Q09zBpL+XLapDjCSBG1XtwMTZAzIYcF4A45osv8KL93HV5aL8RL+ mH9/T1hqw0vSc5CXxJ0UrRBn+jYO1kc0/LqihhUgGf1DTI5fjDfkvJrPmnWnYg== 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=1715845284; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wv5nxC3PH2pGLMU38SRF4ypIwiBrBQzBMQ2wFskuuuc=; b=SkspH0SvBVIvDEKlqFvLAacHAwCkueHQ8ZyxmPve32DrC2J80OYTQpNUUGzKQhvP5dK8dq JUr9Rail+zes+YKclcusQqaxcpf5K7yfLqhNHj7rmSKQu6zESTHUUMe/8AA0wF+GlBzQHH zePewowfxpyn2fW2/kgKRoOPWt12O36L8McmzeTZqBLQQGFiH9PHiQ2DnToyYRkLnCYQaS 8cbZ5TrbETPxDrwuVXeEznsHQFvVYokKKLzeQESwaPiPcz6H06Z2CgdK39L+hYJLmCNTtC Di95NRShKzvvVdggVqt3yXC4/JA9ZLZjbS91FGXKkyHARG/bLQjISf8cyVhqLg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vg28h5LsMzqG9; Thu, 16 May 2024 07:41:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44G7fO9v068027; Thu, 16 May 2024 07:41:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44G7fOPE068024; Thu, 16 May 2024 07:41:24 GMT (envelope-from git) Date: Thu, 16 May 2024 07:41:24 GMT Message-Id: <202405160741.44G7fOPE068024@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: ae38a1a1bfdf - main - linuxkpi: spinlock: Simplify code List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ae38a1a1bfdf320089c254e4dbffdf4769d89110 Auto-Submitted: auto-generated The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=ae38a1a1bfdf320089c254e4dbffdf4769d89110 commit ae38a1a1bfdf320089c254e4dbffdf4769d89110 Author: Emmanuel Vadot AuthorDate: 2024-05-15 09:00:04 +0000 Commit: Emmanuel Vadot CommitDate: 2024-05-16 07:39:36 +0000 linuxkpi: spinlock: Simplify code Just use a typedef for spinlock_t, no need to create a useless structure. Reviewed by: bz, emaste Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D45205 --- .../linuxkpi/common/include/linux/spinlock.h | 34 +++++++--------------- sys/compat/linuxkpi/common/include/linux/wait.h | 2 +- sys/compat/linuxkpi/common/src/linux_compat.c | 8 ++--- sys/compat/linuxkpi/common/src/linux_idr.c | 2 +- sys/dev/mlx4/mlx4_en/mlx4_en_tx.c | 8 ++--- 5 files changed, 20 insertions(+), 34 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/spinlock.h b/sys/compat/linuxkpi/common/include/linux/spinlock.h index 4bc1e2a2d431..3f6eb4bb70f6 100644 --- a/sys/compat/linuxkpi/common/include/linux/spinlock.h +++ b/sys/compat/linuxkpi/common/include/linux/spinlock.h @@ -41,9 +41,7 @@ #include #include -typedef struct { - struct mtx m; -} spinlock_t; +typedef struct mtx spinlock_t; /* * By defining CONFIG_SPIN_SKIP LinuxKPI spinlocks and asserts will be @@ -59,7 +57,7 @@ typedef struct { #define spin_lock(_l) do { \ if (SPIN_SKIP()) \ break; \ - mtx_lock(&(_l)->m); \ + mtx_lock(_l); \ local_bh_disable(); \ } while (0) @@ -76,7 +74,7 @@ typedef struct { if (SPIN_SKIP()) \ break; \ local_bh_enable(); \ - mtx_unlock(&(_l)->m); \ + mtx_unlock(_l); \ } while (0) #define spin_unlock_bh(_l) do { \ @@ -93,7 +91,7 @@ typedef struct { if (SPIN_SKIP()) { \ __ret = 1; \ } else { \ - __ret = mtx_trylock(&(_l)->m); \ + __ret = mtx_trylock(_l); \ if (likely(__ret != 0)) \ local_bh_disable(); \ } \ @@ -111,7 +109,7 @@ typedef struct { #define spin_lock_nested(_l, _n) do { \ if (SPIN_SKIP()) \ break; \ - mtx_lock_flags(&(_l)->m, MTX_DUPOK); \ + mtx_lock_flags(_l, MTX_DUPOK); \ local_bh_disable(); \ } while (0) @@ -141,31 +139,19 @@ typedef struct { #define _spin_lock_name(...) __spin_lock_name(__VA_ARGS__) #define spin_lock_name(name) _spin_lock_name(name, __FILE__, __LINE__) -#define spin_lock_init(lock) linux_spin_lock_init(lock, spin_lock_name("lnxspin")) +#define spin_lock_init(lock) mtx_init(lock, spin_lock_name("lnxspin"), \ + NULL, MTX_DEF | MTX_NOWITNESS) -static inline void -linux_spin_lock_init(spinlock_t *lock, const char *name) -{ - - memset(lock, 0, sizeof(*lock)); - mtx_init(&lock->m, name, NULL, MTX_DEF | MTX_NOWITNESS); -} - -static inline void -spin_lock_destroy(spinlock_t *lock) -{ - - mtx_destroy(&lock->m); -} +#define spin_lock_destroy(_l) mtx_destroy(_l) #define DEFINE_SPINLOCK(lock) \ spinlock_t lock; \ - MTX_SYSINIT(lock, &(lock).m, spin_lock_name("lnxspin"), MTX_DEF) + MTX_SYSINIT(lock, &lock, spin_lock_name("lnxspin"), MTX_DEF) #define assert_spin_locked(_l) do { \ if (SPIN_SKIP()) \ break; \ - mtx_assert(&(_l)->m, MA_OWNED); \ + mtx_assert(_l, MA_OWNED); \ } while (0) #define atomic_dec_and_lock_irqsave(cnt, lock, flags) \ diff --git a/sys/compat/linuxkpi/common/include/linux/wait.h b/sys/compat/linuxkpi/common/include/linux/wait.h index d50003d44955..b815050b6faa 100644 --- a/sys/compat/linuxkpi/common/include/linux/wait.h +++ b/sys/compat/linuxkpi/common/include/linux/wait.h @@ -113,7 +113,7 @@ extern wait_queue_func_t default_wake_function; MTX_SYSINIT(name, &(name).lock.m, spin_lock_name("wqhead"), MTX_DEF) #define init_waitqueue_head(wqh) do { \ - mtx_init(&(wqh)->lock.m, spin_lock_name("wqhead"), \ + mtx_init(&(wqh)->lock, spin_lock_name("wqhead"), \ NULL, MTX_DEF | MTX_NEW | MTX_NOWITNESS); \ INIT_LIST_HEAD(&(wqh)->task_list); \ } while (0) diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index a6eb7bb17e16..4c639c1f8459 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -382,9 +382,9 @@ linux_kq_assert_lock(void *arg, int what) spinlock_t *s = arg; if (what == LA_LOCKED) - mtx_assert(&s->m, MA_OWNED); + mtx_assert(s, MA_OWNED); else - mtx_assert(&s->m, MA_NOTOWNED); + mtx_assert(s, MA_NOTOWNED); #endif } @@ -1094,7 +1094,7 @@ linux_file_kqfilter_read_event(struct knote *kn, long hint) { struct linux_file *filp = kn->kn_hook; - mtx_assert(&filp->f_kqlock.m, MA_OWNED); + mtx_assert(&filp->f_kqlock, MA_OWNED); return ((filp->f_kqflags & LINUX_KQ_FLAG_NEED_READ) ? 1 : 0); } @@ -1104,7 +1104,7 @@ linux_file_kqfilter_write_event(struct knote *kn, long hint) { struct linux_file *filp = kn->kn_hook; - mtx_assert(&filp->f_kqlock.m, MA_OWNED); + mtx_assert(&filp->f_kqlock, MA_OWNED); return ((filp->f_kqflags & LINUX_KQ_FLAG_NEED_WRITE) ? 1 : 0); } diff --git a/sys/compat/linuxkpi/common/src/linux_idr.c b/sys/compat/linuxkpi/common/src/linux_idr.c index dc64da0d7cf5..583e2c237198 100644 --- a/sys/compat/linuxkpi/common/src/linux_idr.c +++ b/sys/compat/linuxkpi/common/src/linux_idr.c @@ -69,7 +69,7 @@ idr_preload_dequeue_locked(struct linux_idr_cache *lic) struct idr_layer *retval; /* check if wrong thread is trying to dequeue */ - if (mtx_owned(&lic->lock.m) == 0) + if (mtx_owned(&lic->lock) == 0) return (NULL); retval = lic->head; diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c b/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c index ee8ed0da240d..9a73c7571fd7 100644 --- a/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c +++ b/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c @@ -91,8 +91,8 @@ int mlx4_en_create_tx_ring(struct mlx4_en_priv *priv, ring->size_mask = size - 1; ring->stride = stride; ring->inline_thold = MAX(MIN_PKT_LEN, MIN(priv->prof->inline_thold, MAX_INLINE)); - mtx_init(&ring->tx_lock.m, "mlx4 tx", NULL, MTX_DEF); - mtx_init(&ring->comp_lock.m, "mlx4 comp", NULL, MTX_DEF); + mtx_init(&ring->tx_lock, "mlx4 tx", NULL, MTX_DEF); + mtx_init(&ring->comp_lock, "mlx4 comp", NULL, MTX_DEF); tmp = size * sizeof(struct mlx4_en_tx_info); ring->tx_info = kzalloc_node(tmp, GFP_KERNEL, node); @@ -205,8 +205,8 @@ void mlx4_en_destroy_tx_ring(struct mlx4_en_priv *priv, for (x = 0; x != ring->size; x++) bus_dmamap_destroy(ring->dma_tag, ring->tx_info[x].dma_map); vfree(ring->tx_info); - mtx_destroy(&ring->tx_lock.m); - mtx_destroy(&ring->comp_lock.m); + mtx_destroy(&ring->tx_lock); + mtx_destroy(&ring->comp_lock); bus_dma_tag_destroy(ring->dma_tag); kfree(ring); *pring = NULL; From nobody Thu May 16 07:41:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vg28k0lr6z5KmwC; Thu, 16 May 2024 07:41: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 4Vg28j6JH2z4LwG; Thu, 16 May 2024 07:41:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715845285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=71fDqDx/InEZ/FcI3+7baLb0rBXHFHQaYi1lCYQoMlo=; b=WqHkLF3+doGLwGEDPVHcCsGD98wnKMPwTVy/G2A3Kn1VOm5FeJfR5hKl3JyQEQDtNuMnYH AsOVeFXOyub/Tbk50HiQ+SBcAOIXkJ6RvkckYfNsO3atyF5niig04NbXqpjK9ITg7wjSLc 1PhPwoCKZ/O2c8W7Lx6XU2YlrzcMAzak8fNREH8JwQEd+NFXQsq2xdvF9Xo9fiNuH9ouf5 rWaXerpPBn2qLPo5JAhEhYwJiTlOoAMuPwXU6LePHW/z4O6BqihxwJ8p9VHF42/Z65U9nR MooxW+TEoUSiL5rU2zCskpdg8LayPgIdj8gEEo8vcfJxDl13jI9vxRtFR5Trpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715845285; a=rsa-sha256; cv=none; b=B2tDYiTP1pq/za2rFMfb6Szd7deHfMqU3jcJZmkEKVqFeGNjw0oXKSPxIUzhqN6+EYlERk dBHF9aisJT3gMOXI+wV4kNm4VTGr2sOQsBnkK3Jmvl77YOU/TBhFEodBya2xeNY5BMynjg aEivZqEepRPWegIKXM6a1Q3YfjXxFTyH+qOMPHgMo713p9NtVqARlEHXClPMT32qaoWNC5 XvD5z00ypeDPUz2fcxNQ2P+fyvLT7lQ8hqTCHRNF+5GZNwFG0ZidRgQTEJiqxj51L3duu0 87q44jOcO3VteBDMcHWvAmsXlpQ8aGtlYIX+F8Fn2IzBInpN7o3/fLPC2CrZPA== 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=1715845285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=71fDqDx/InEZ/FcI3+7baLb0rBXHFHQaYi1lCYQoMlo=; b=S/H7u2WSc+IlHSWI1mryjguLk+WwgdU7ojKALUDhpnyygV8crRyO2YEmYgo5eYcNWCN9T0 RDElQOlvQRMK7lBIfn9iVL5C3Lc67F+VkOAB+CtVIsQuJH2F3wQvo8ZkKNHSw/1daF4yY8 WipyEkZOqsOU7xHEO+YdtPS88ZlTrBS1AilSEsfMiREvlAQ/6jF1i1xs0x/ExfRBUeRycd 9mYfDYvCl3RvqF3J5OsVHR8oLaxEn4hpNyBQ8heYwAu8L3HU5P4O7erw3tUAwZMAvNcnp3 lfTyE7IcSMiuRQxl2mzJU8lU6CoO8vBXIJOya8JdZqapswpQaZ7azr7zU2DViQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vg28j5vfGzqY0; Thu, 16 May 2024 07:41: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 44G7fPx9068071; Thu, 16 May 2024 07:41:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44G7fPF0068067; Thu, 16 May 2024 07:41:25 GMT (envelope-from git) Date: Thu, 16 May 2024 07:41:25 GMT Message-Id: <202405160741.44G7fPF0068067@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 5c0a1923486e - main - linuxkpi: rwlock: Simplify code List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5c0a1923486e65cd47398e52c03cb289d6120a78 Auto-Submitted: auto-generated The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=5c0a1923486e65cd47398e52c03cb289d6120a78 commit 5c0a1923486e65cd47398e52c03cb289d6120a78 Author: Emmanuel Vadot AuthorDate: 2024-05-15 09:05:29 +0000 Commit: Emmanuel Vadot CommitDate: 2024-05-16 07:40:03 +0000 linuxkpi: rwlock: Simplify code Just use a typedef for rwlock_t, no need to create a useless structure. Reviewed by: bz Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D45206 --- sys/compat/linuxkpi/common/include/linux/rwlock.h | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/rwlock.h b/sys/compat/linuxkpi/common/include/linux/rwlock.h index 8c1ee36ac4de..126b70c875c0 100644 --- a/sys/compat/linuxkpi/common/include/linux/rwlock.h +++ b/sys/compat/linuxkpi/common/include/linux/rwlock.h @@ -34,14 +34,12 @@ #include #include -typedef struct { - struct rwlock rw; -} rwlock_t; +typedef struct rwlock rwlock_t; -#define read_lock(_l) rw_rlock(&(_l)->rw) -#define write_lock(_l) rw_wlock(&(_l)->rw) -#define read_unlock(_l) rw_runlock(&(_l)->rw) -#define write_unlock(_l) rw_wunlock(&(_l)->rw) +#define read_lock(_l) rw_rlock(_l) +#define write_lock(_l) rw_wlock(_l) +#define read_unlock(_l) rw_runlock(_l) +#define write_unlock(_l) rw_wunlock(_l) #define read_lock_irq(lock) read_lock((lock)) #define read_unlock_irq(lock) read_unlock((lock)) #define write_lock_irq(lock) write_lock((lock)) @@ -54,13 +52,6 @@ typedef struct { do { read_unlock(lock); } while (0) #define write_unlock_irqrestore(lock, flags) \ do { write_unlock(lock); } while (0) - -static inline void -rwlock_init(rwlock_t *lock) -{ - - memset(&lock->rw, 0, sizeof(lock->rw)); - rw_init_flags(&lock->rw, "lnxrw", RW_NOWITNESS); -} +#define rwlock_init(_l) rw_init_flags(_l, "lnxrw", RW_NOWITNESS) #endif /* _LINUXKPI_LINUX_RWLOCK_H_ */ From nobody Thu May 16 07:41:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vg28l2Cvcz5Kmsm; Thu, 16 May 2024 07:41: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 4Vg28k6lRtz4M78; Thu, 16 May 2024 07:41:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715845286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HBiWpqTFlfEFpEL3kDvEPtDq+Y7n9BHiHsDJAlx3Qus=; b=fYyJlLl9rbxkc1EANr9lycd2CpLyngmV898vKDgt4EF1qOH6jCexUdkzbXhQnmo+rgwXFU yjlBx3at8mc/kzSqSUBgr/CAJ6rQsK+Vr+qyNTyrX3Ul+BNnF2NOT4s6TBmmJETQ18kEe1 y7CswbjIIuERyQMtyeRexb0xRGbmYA0i9S3PLHesohLodEPvokh8vYEbuzndcVm4wScSSY hFSfqh+70HcfPTPJ8vIsVjwRdyscwclrUJKsgSWjP/hzBYyke/qDV3qbeMsbZiUp85P57B 6CNpv1TIkbldrk0RVU9VOITIW55oPZAynq1s5LRfInt0YUCFTpY4w5amw3alJQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715845286; a=rsa-sha256; cv=none; b=enHZZOOwmyWSjWx1/FYECcDDBly7PrfbIJeTWAUOUkQBoU0QXJfHos6OoKLqUA7uhI0g16 vcywKnM/dj6oSb8aKs6hwIilojyC0TazGYhO02bSF2Sh2l182XWLY8SYxoLZzYWaie+u3S AyWd7BfMC0RkfCvJyTuyNDPM2kq96lnOaeproSL9diF0igDqsryjpzD0P1GoI2yYBLWf47 h8BElxDTYsSHXki08bfQrMbVBrd6sQJXzzfH63eYIZOOwGVOkQO5o7a7OTiktMtPPPbP5I VNB9aEykcrenFbNf/DWbwjVWZUFS+6yUugVFis2aBvizmdaMGTGDs5gSdqQkyw== 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=1715845286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HBiWpqTFlfEFpEL3kDvEPtDq+Y7n9BHiHsDJAlx3Qus=; b=B0o0HoH2FgdpKv6oc+LQdZPcSGYg5GlIqoPcb34AmoMY7ucVZoXA3U8c/Sdkpv8d6sdcuJ VuWqdZiRYdUlcsKOC9vrg2ohLW2L0S5vu0qxuBIQSx2hhoZp4HqnzHcBrOOejJ3IHiekll XihjQrG5ALXkLb5X1GjEDXwNHGlX49i+zagsfkacSEK3kpqyPXqe9iBpeRa6p+BZvxM9ok YBeUEza9WQRQReWyxsPTFpOqC7zJWPag06Nna1Ziuh5dllru9DNHBpjv/8dp1K0IugJvJ/ PqP6Oth5cOL2dirqXK9wZC2tUbuWqGwmEnQS4Zch09ErDmDWdIBIQR2yfbRqoQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vg28k6MY1zqY1; Thu, 16 May 2024 07:41: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 44G7fQ4R068115; Thu, 16 May 2024 07:41:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44G7fQMI068112; Thu, 16 May 2024 07:41:26 GMT (envelope-from git) Date: Thu, 16 May 2024 07:41:26 GMT Message-Id: <202405160741.44G7fQMI068112@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: abb1a1340e3f - main - linuxkpi: refcount: Use atomic_t directly List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: abb1a1340e3f0dcdbb81b5c42ad304f02c812e20 Auto-Submitted: auto-generated The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=abb1a1340e3f0dcdbb81b5c42ad304f02c812e20 commit abb1a1340e3f0dcdbb81b5c42ad304f02c812e20 Author: Emmanuel Vadot AuthorDate: 2024-05-15 09:50:51 +0000 Commit: Emmanuel Vadot CommitDate: 2024-05-16 07:40:46 +0000 linuxkpi: refcount: Use atomic_t directly Simply use a typedef for refcount_t on atomic_t, this allow us to use a nativ type and also changing struct kref to directly use a refcount_t like Linux. Reviewed by: bz Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D45207 --- sys/compat/linuxkpi/common/include/linux/kref.h | 3 +-- .../linuxkpi/common/include/linux/refcount.h | 23 ++++++++-------------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/kref.h b/sys/compat/linuxkpi/common/include/linux/kref.h index 47d61c9ee316..b2fba468f7df 100644 --- a/sys/compat/linuxkpi/common/include/linux/kref.h +++ b/sys/compat/linuxkpi/common/include/linux/kref.h @@ -41,8 +41,7 @@ #include struct kref { - /* XXX In Linux this is a refcount_t */ - atomic_t refcount; + refcount_t refcount; }; static inline void diff --git a/sys/compat/linuxkpi/common/include/linux/refcount.h b/sys/compat/linuxkpi/common/include/linux/refcount.h index 61947485945d..02a7eda3f4a9 100644 --- a/sys/compat/linuxkpi/common/include/linux/refcount.h +++ b/sys/compat/linuxkpi/common/include/linux/refcount.h @@ -31,58 +31,51 @@ #include -struct refcount_linux { - atomic_t value; -}; -typedef struct refcount_linux refcount_t; +typedef atomic_t refcount_t; static inline void refcount_set(refcount_t *ref, unsigned int i) { - atomic_set(&ref->value, i); + atomic_set(ref, i); } static inline void refcount_inc(refcount_t *ref) { - atomic_inc(&ref->value); + atomic_inc(ref); } static inline bool refcount_inc_not_zero(refcount_t *ref) { - return (atomic_inc_not_zero(&ref->value)); + return (atomic_inc_not_zero(ref)); } static inline void refcount_dec(refcount_t *ref) { - atomic_dec(&ref->value); + atomic_dec(ref); } static inline unsigned int refcount_read(refcount_t *ref) { - return atomic_read(&ref->value); + return atomic_read(ref); } static inline bool refcount_dec_and_lock_irqsave(refcount_t *ref, spinlock_t *lock, unsigned long *flags) { - if (atomic_dec_and_test(&ref->value) == true) { + if (atomic_dec_and_test(ref) == true) { spin_lock_irqsave(lock, flags); return (true); } return (false); } -/* - * struct kref uses atomic_t and not refcount_t so - * we differ from Linux here. - */ static inline bool -refcount_dec_and_test(atomic_t *r) +refcount_dec_and_test(refcount_t *r) { return (atomic_dec_and_test(r)); From nobody Thu May 16 10:05:00 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vg5LP1HbNz5L04F; Thu, 16 May 2024 10:05: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 4Vg5LP0X6dz4ZVt; Thu, 16 May 2024 10:05:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715853901; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iKJPzTuKgLLkN/mwwbGj5M3MsmagG2jAVEfBHm5saeI=; b=JowxY4RaHlqo0qQh01/5lJej5KTGJ08LxBGhZgHRp7HgrUCLrVkdnZItcsl6ZCYPF12aOc uBfQBdHY0nkfrwKiEOqrpL6KJ5L7hZjacl+ppQe3uvbDkyH6LViRYN0Nfx4taOHzHsxnh9 KKnTPTqAIzwPQZMIpP/lLEo9npulNJUC293zH5QpDeLfO0UmSMJHtNsLbNH0GrkE+3MNYP LVEBcygOcGvVywLSHMAtgntS8E0AKqLXT8xce5cge/5YHEmsv7aR9/i1HanKPlOxFY2fEe iZeUF2CK+m5kyeIOgZigbIrjbawe0pFZNxhpd+u5HD/vrWbOmqoUNXSXZN/ifQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715853901; a=rsa-sha256; cv=none; b=UQ58h18ySYg6XzKnq7noYcgz8w3mt4EmdYecooaaPuylHj3/QOKSlMpvC1AUF34v9QlgCp 7cwpB3M/2LMUVOGQlmX8spGFwGDXynzKHy7j++VYzvC71cYLEcMZ6oEaKTHZPdrQ4vh2Ik WWH/MqxgBU0xUenF2tnysY3Hnu8RY2u9GBEUGyguYt3hJhGDAsRTnY5muwxws1yY5teTCm j8PCQfAtpjI2prZJhcrptYLe66196oATI0Yeumw6ZlQTKBRHrtztwMp/Xr62g1ooft4T4a DjNEmr16Ew8L1AkuRgmsMXgZIAceogTjI5ECwwrWLlRfys3w+o+266wVcj6Wsw== 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=1715853901; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iKJPzTuKgLLkN/mwwbGj5M3MsmagG2jAVEfBHm5saeI=; b=i2Sh7ACzroseoNhtmvRAQ1GKYTjpt86Wh6gXYaLa1jvON1FzgXWw4LKtKalb/XBDsBGN6S 9vC8j4ttySzYlqPAl8nN4ZQEFMyDRYugJAtvh6AM69YfsM2OWB3ba3N/so9MI/NmNdLrHr icwzWqEdJUe2gniMCIxGz8PAv0mdyE8ogF7QW6tqLpM5b27FhMulMMDlZcVkRes5w7h/VF aZKLFK4TqQOCDvmDwjbZMopmIFmOtlTjbJuEHmS4J3xqznmGLoisc1IYILMH9bB+GxnXbd dY9zcdiq7Y9fi9hiuvECZ4FPClUM/rdQpEi+H+QyRHSMxpnQv2X7Ybn4OrViUg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vg5LP07MCztjB; Thu, 16 May 2024 10:05: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 44GA50Zx009433; Thu, 16 May 2024 10:05:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44GA50vE009430; Thu, 16 May 2024 10:05:00 GMT (envelope-from git) Date: Thu, 16 May 2024 10:05:00 GMT Message-Id: <202405161005.44GA50vE009430@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: b45d038b5f7c - releng/14.1 - expand: Fix markup for the `-t` option. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: b45d038b5f7c3d4c972d656e08fea91e9059687b Auto-Submitted: auto-generated The branch releng/14.1 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=b45d038b5f7c3d4c972d656e08fea91e9059687b commit b45d038b5f7c3d4c972d656e08fea91e9059687b Author: Dag-Erling Smørgrav AuthorDate: 2024-05-13 10:41:27 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-16 10:04:05 +0000 expand: Fix markup for the `-t` option. PR: 274897 Fixes: 8993d785a261 MFC after: 3 days Reviewed by: gbe Differential Revision: https://reviews.freebsd.org/D45167 (cherry picked from commit f3eeeb959c9b00c89a2e1ff009c78162eb398656) (cherry picked from commit 0d230c89f5b39b06730bb43aa6e0cd0482dbd64a) Approved by: re (cperciva) --- usr.bin/expand/expand.1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/usr.bin/expand/expand.1 b/usr.bin/expand/expand.1 index 9a49deb1a948..c1e19891b1ab 100644 --- a/usr.bin/expand/expand.1 +++ b/usr.bin/expand/expand.1 @@ -80,9 +80,15 @@ If the .Fl a option is given, then tabs are inserted whenever they would compress the resultant file by replacing two or more characters. -.It Fl t \&Sm Ar tab1 , tab2 , ... , tabn \&Sm +.It Fl t Xo +.Sm off +.Ar tab1 , tab2 , ... , tabn +.Sm on +.Xc Set tab stops at column positions +.Sm off .Ar tab1 , tab2 , ... , tabn . +.Sm on If only a single number is given, tab stops are set that number of column positions apart instead of the default number of 8. .El From nobody Thu May 16 12:02:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vg7xP41N4z5L83s; Thu, 16 May 2024 12:02: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 4Vg7xP3WYDz4jwf; Thu, 16 May 2024 12:02:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715860921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QwKLXk4Qh7j/K1Ipg5YZSy2FEiqvt6c58x8yWLbJFfY=; b=p7ldlJukMaLR1NGfEj4bB6fF1NTPsHmoAto89NxXk6UWQ/NzVF0NTEArKuFiLMCJC4l+61 AhO5pf006L2leK2/DPmQFFJLmFOpwJQPXGZh9r1B6cqP6ngaPDIXwwGCTnafgSIBvzlACk 8p4sGo3OxMXC1q6DTfpnnMzF2396929NFqtrYo1m5zBHpzzeW+Lv4dD7AZeVL7uP5Xs9X9 DDhxo7XkIRPSV1IZogpkMxnchNfkRm/H6T2Bcw5scCuR7SB35qTEObx2kVqHFFoiMKKi/M LiQu4jZI0cocfTzbNxzxg3B75tWb4G9IDL1FTq+7/NYkvXiyDsHySASIYcxQUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715860921; a=rsa-sha256; cv=none; b=dYl04LO++E/ARLTAKOkb1z1v01+k2UJt2Q6G3wlcD3lZkZa+IRzH3gspXNvAok1LQ2OxaY SAVh6CKEZ6fjODWQJkkRbs4RqFjQHS6XBuWvPJS9YGj4X6GxRRebLUXaPVFF/kukSkISXP K4iYXUSQhZnjhuZj91x1XFLCOa36pMLeklBUTJ7p+ZyOUwXdw45+2eizRUJTe/y+HnA57k i7GBmuzTI4h5xN2dzDHpohbq5MJCSWNtu8Wf1AD9CTAPE6KrCXfhxi+heHHYBYH940AW68 dTDJFHzDyePKtNOhS2OdGUgoykp3oc/8CfNg9e2Rpi19OjmvEpfeEUUd9FQRzQ== 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=1715860921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QwKLXk4Qh7j/K1Ipg5YZSy2FEiqvt6c58x8yWLbJFfY=; b=m7NaCy/mB+O4ZxOuYpF59YaWITYnlohRNX2ISgeUiQpjqocgkNhRtkfUytVfTVBTFnBJW5 f4OrE+5te1z9PFAurcNyq9nTwuZ46xbsn3fA7beipVbEbrl2Q5U5D3yOL/iWHMLcZPLaXQ bYq5KKd7DTeDHomaPxksQLRFH3WpVlGiSll2yeZmmp/B5oyG/XuCJjzigEQkTBUhSo+6M0 GwynlqCiDquDDjYXci6T55XBMQEdT+Rpn7tjmXrOxQ+qp8QIDRZddLL0RdPy9fnHVaRPIx sUwUlnFjoHiw/F3dzuDlaFWLEye1bhWup/MPa7NWZQfS5oWC8XJ48p6jAxVJDw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vg7xP36m3zxfp; Thu, 16 May 2024 12:02: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 44GC21Bp008553; Thu, 16 May 2024 12:02:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44GC21Mn008550; Thu, 16 May 2024 12:02:01 GMT (envelope-from git) Date: Thu, 16 May 2024 12:02:01 GMT Message-Id: <202405161202.44GC21Mn008550@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: e73147fc7ca6 - stable/14 - pf: always mark states as unlinked before detaching them List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e73147fc7ca6632c7b2499c52f134c93fe664cc6 Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e73147fc7ca6632c7b2499c52f134c93fe664cc6 commit e73147fc7ca6632c7b2499c52f134c93fe664cc6 Author: Kristof Provost AuthorDate: 2024-05-06 07:43:49 +0000 Commit: Kristof Provost CommitDate: 2024-05-16 07:41:02 +0000 pf: always mark states as unlinked before detaching them Users have reported crashes in pf_test_state_udp() where at least one state key is NULL. That suggests that pf_detach_state() ran concurrently with pf_test_state_udp(). pf_test_state_udp() holds the state lock (aka the id lock), but pf_detach_state() does not. The intent is that detached states are not returned by STATE_LOOKUP/ pf_find_state(), as the state's timeout is set to PFTM_UNLINKED and thus pf_find_state() does not find the state. There are other paths to pf_detach_state() (outside of pf_unlink_state()) though, where we did not set the timeout to PFTM_UNLINKED. Fix those, and assert that the timeout is set correctly when we enter pf_detach_state(). MFC after: 1 week See also: https://redmine.pfsense.org/issues/15413 Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D45101 (cherry picked from commit 301ec2cebb6a3e472af39eb7b98c3b7ff88e04b0) --- sys/netpfil/pf/pf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 5fc234c5aca9..6874dd59c1f7 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -1325,6 +1325,7 @@ keyattach: sk : NULL); printf("\n"); } + s->timeout = PFTM_UNLINKED; PF_HASHROW_UNLOCK(ih); KEYS_UNLOCK(); uma_zfree(V_pf_state_key_z, sk); @@ -1392,6 +1393,8 @@ pf_detach_state(struct pf_kstate *s) struct pf_state_key *sks = s->key[PF_SK_STACK]; struct pf_keyhash *kh; + MPASS(s->timeout >= PFTM_MAX); + pf_sctp_multihome_detach_addr(s); if (sks != NULL) { @@ -1517,6 +1520,7 @@ pf_state_insert(struct pfi_kkif *kif, struct pfi_kkif *orig_kif, break; if (cur != NULL) { + s->timeout = PFTM_UNLINKED; PF_HASHROW_UNLOCK(ih); if (V_pf_status.debug >= PF_DEBUG_MISC) { printf("pf: state ID collision: " From nobody Thu May 16 12:02:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vg7yB2XLVz5L8Jb; Thu, 16 May 2024 12:02: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 4Vg7yB1ltTz4kQm; Thu, 16 May 2024 12:02:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715860962; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=keywcwpjL4kZjUsDQFYE9SACiPcEne8PvGlM4skA6w4=; b=E5cJQfwvrTBV2MmRwZzT3SeBPy6imMxVGHpOZI6JIAspCpiClVMBZb/yVCFkBHzh7AhU+p lb4QVwLXwV6EGaTnO5/mvtaLEsjy5Ifpn/yEXCAj3sZys5NCXsCfyt3jeqYa33gx5pZsOH ha0e4ijmUNEKTY58V+98IKyqOwRHmzGMk17b+H5uKoAEkn5URW7HtBOzO60nmA0ATF1Xhd Qfj3Ljb7sgAwmMLo4diD/T90At7rFRcNtC9S26gm/RgnGSD3FaC1Rk155gjR66Zu6AMz87 cQsBCtQsWSlNgpRlTkmpFPOSoOxyptB3IBGSGaR7XuBFvSM1uzdJggUPjXF2vw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715860962; a=rsa-sha256; cv=none; b=K2JBzB+NFH64umi800Ku2eVJ1vSAEbtAoeliop0seBiAk0TLiEnoQ3x5u+YVODoSWepgeB A7eXXUeMoaqTIxJiskU0P1AVcOra789BBiG6R31ioBDucQdmMyLbqtu/hKKckIdm+0BLKA Kuc8CJusDDop51W6ve2DvDRcBeWrr0uA/n5ZwaNCXTM8sbIjshL9uDrZl9Hyvrnab2/sOg 31odiRGLLcron5GRoFQ2o/mnXOHiR/o2cm0LGsLNc1cBL2uh52D9DFvHKqBuVz6jETQjpe BtkzBAgmTDwGl2JSQIer8Py+O7c0tSa/qNdwaiMClMHCz59FwGzd9VV+jhvjZA== 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=1715860962; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=keywcwpjL4kZjUsDQFYE9SACiPcEne8PvGlM4skA6w4=; b=fvTC25FkwsrK/W8O0VffrLTPslqlEE4Pi896oy5BCyq2L7L0W9x5uwswB4iyXuR/o9s7DW jWcg5Uh13vD+CMScWrR3x/I9zm5eg+q+Uw7p0KhULNEILRS5Gd8IcCfny+GREkLjgP4QP0 2oiQXermnxiDt9sUus5AX0hAy0seNj5YZwYajZuUeOnhi9n1CFqvtBGFSeeNdHMFZcUqWz PWW+W3vr49+GgIeTCcqKOkWJU+jxmbFBzYsBdsYE18qFElA9tnxoQd+jsZAiIvlhQyZOLj lVGemw2dVbLKf8Tc/DUHSNBoykg9fqQTgZE/dwXu2puMtsbjPK1lvd2yZybxEQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vg7yB1LM0zyKN; Thu, 16 May 2024 12:02: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 44GC2gQ8011971; Thu, 16 May 2024 12:02:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44GC2gxw011968; Thu, 16 May 2024 12:02:42 GMT (envelope-from git) Date: Thu, 16 May 2024 12:02:42 GMT Message-Id: <202405161202.44GC2gxw011968@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: b9f6b6685558 - stable/13 - pf: always mark states as unlinked before detaching them List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b9f6b668555849a8d6d322b803264404d65615cd Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b9f6b668555849a8d6d322b803264404d65615cd commit b9f6b668555849a8d6d322b803264404d65615cd Author: Kristof Provost AuthorDate: 2024-05-06 07:43:49 +0000 Commit: Kristof Provost CommitDate: 2024-05-16 07:40:35 +0000 pf: always mark states as unlinked before detaching them Users have reported crashes in pf_test_state_udp() where at least one state key is NULL. That suggests that pf_detach_state() ran concurrently with pf_test_state_udp(). pf_test_state_udp() holds the state lock (aka the id lock), but pf_detach_state() does not. The intent is that detached states are not returned by STATE_LOOKUP/ pf_find_state(), as the state's timeout is set to PFTM_UNLINKED and thus pf_find_state() does not find the state. There are other paths to pf_detach_state() (outside of pf_unlink_state()) though, where we did not set the timeout to PFTM_UNLINKED. Fix those, and assert that the timeout is set correctly when we enter pf_detach_state(). MFC after: 1 week See also: https://redmine.pfsense.org/issues/15413 Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D45101 (cherry picked from commit 301ec2cebb6a3e472af39eb7b98c3b7ff88e04b0) --- sys/netpfil/pf/pf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 1fd5803117bd..2c171514e946 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -1283,6 +1283,7 @@ keyattach: sk : NULL); printf("\n"); } + s->timeout = PFTM_UNLINKED; PF_HASHROW_UNLOCK(ih); KEYS_UNLOCK(); uma_zfree(V_pf_state_key_z, sk); @@ -1350,6 +1351,8 @@ pf_detach_state(struct pf_kstate *s) struct pf_state_key *sks = s->key[PF_SK_STACK]; struct pf_keyhash *kh; + MPASS(s->timeout >= PFTM_MAX); + pf_sctp_multihome_detach_addr(s); if (sks != NULL) { @@ -1478,6 +1481,7 @@ pf_state_insert(struct pfi_kkif *kif, struct pfi_kkif *orig_kif, break; if (cur != NULL) { + s->timeout = PFTM_UNLINKED; PF_HASHROW_UNLOCK(ih); if (V_pf_status.debug >= PF_DEBUG_MISC) { printf("pf: state ID collision: " From nobody Thu May 16 12:23:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vg8Q16Hy5z5LBDr; Thu, 16 May 2024 12:23:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vg8Q13cVXz4nhs; Thu, 16 May 2024 12:23:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715862201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ra2rEUx5MJaSjehOu/i3MoenriLvqBP2EmLnZ0oI230=; b=SMkZxzjFUyw8999RxEtGsu2IaR2J/Ng323sV3i8a97Y3N3IkHZP7xYBdfVmmcvp1wQbMFP F+To2oqw713Tzcwh0Zto1Crh7jPwn9CCltOaovphOTKxeWIfscBoKaI2NR8i6LGmwxWqTo VYI5O/DW74WmMyS3UgFNP4ERcrqqCdMxFwFILeR3dOn+wD0EHP1+Pg0X9t2pR3ThDdb835 wyupBfBRd0AtfWwxSqGkNd7bihaDhVVqfLv7EEW+6+9vmYI/Hzjtk9Kkozsu06UMLjYcCe KxnZ/zSknvyVQU626IhlqE5+oBE5ZeCs5RbbapBmIdREYwaugSP0zfx7UGEZOA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715862201; a=rsa-sha256; cv=none; b=G4HUJkbdtD7mvVYAm/X2apTrbcQ/u6T0tdMMasUIlPxK86f9BAkuRASuLbyTPVDPuZ/a/8 ZshbV0yGelGG+dRoY58BJDddHddq1fpuq5NEd+jsCyzD1tjLguRIFQ8Ux41hAmovEeQWe/ LxPNvWWee+G9s/Opkv4xTCfvloQLnqmYE1mwIW8013AMHL+Mvn88P0PM2TYsZ91Zp6waK1 HR8ARp0peFZFCJeHOwluMVbetgRruTIru/NSkv9BK6hWwWXzXmlwpzLnl4u8NNa7t/ESdw 288LciCUwUTPh8iM04xOQ8OnJv3yLZ/3X54OSEXRXgLec2yhsT+Ds5iStsc9ZQ== 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=1715862201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ra2rEUx5MJaSjehOu/i3MoenriLvqBP2EmLnZ0oI230=; b=yjxGlvE0WKf2sVtsOpBMye6KprM6tqkOlI6icca+zV68Nk28PKeSHyTz7bF9dBPYZ1QVyS O3crVWYLEb14uGwLXoh7CuZhtKDflc1qQzI+qB1EbGJSC3DDL48f2rWW8J9ldDWJ3N671g dtgUTEX8qFujHkYdYiFFYjjbZzofpdLfjqwB8OWGU+6yJmjvxDmWz4ZG+5LPHRwabfHR08 oiA09ugHKjD9herXtslr2e7RML2x9GkKmH+KqugxR2l7wJttMmmmYHYjBVZunrK+CwNVVI bQLPtmUEYmb2Y/Zm0/P93fFGB4W/baLuHbseuhPA9swmQOJoHySIfRUhaA2l2A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vg8Q13CgVzyMD; Thu, 16 May 2024 12:23: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 44GCNLNs045159; Thu, 16 May 2024 12:23:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44GCNL05045156; Thu, 16 May 2024 12:23:21 GMT (envelope-from git) Date: Thu, 16 May 2024 12:23:21 GMT Message-Id: <202405161223.44GCNL05045156@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: 147c7e4dde23 - releng/14.1 - Increase IOAPIC_MAX_ID to 255 (from 254) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 147c7e4dde23b3b787b4fb8b754f043f64ab7adb Auto-Submitted: auto-generated The branch releng/14.1 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=147c7e4dde23b3b787b4fb8b754f043f64ab7adb commit 147c7e4dde23b3b787b4fb8b754f043f64ab7adb Author: Ed Maste AuthorDate: 2024-05-10 17:40:59 +0000 Commit: Ed Maste CommitDate: 2024-05-16 12:23:05 +0000 Increase IOAPIC_MAX_ID to 255 (from 254) A test system provided by AMD panicked with "madt_parse_apics: I/O APIC ID 255 too high". I/O APIC ID 255 is acceptable, so increase the limit. Reviewed by: jhb, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45157 (cherry picked from commit 4e3286818327453efd8e4c133928ba26a169567a) (cherry picked from commit 18119e711f1c844bd6eacf5afc8d4cdec3ac8085) Approved by: re (cperciva) --- sys/x86/include/apicvar.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/x86/include/apicvar.h b/sys/x86/include/apicvar.h index 10016e291b9b..ac6a82659e34 100644 --- a/sys/x86/include/apicvar.h +++ b/sys/x86/include/apicvar.h @@ -78,7 +78,12 @@ #define MAX_APIC_ID 0x800 #define APIC_ID_ALL 0xffffffff -#define IOAPIC_MAX_ID xAPIC_MAX_APIC_ID +/* + * The 0xff ID is used for broadcast IPIs for local APICs when not using + * x2APIC. IPIs are not sent to I/O APICs so it's acceptable for an I/O APIC + * to use that ID. + */ +#define IOAPIC_MAX_ID 0xff /* I/O Interrupts are used for external devices such as ISA, PCI, etc. */ #define APIC_IO_INTS (IDT_IO_INTS + 16) From nobody Thu May 16 13:26:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vg9q80s37z5LFvW for ; Thu, 16 May 2024 13:26:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vg9q803fQz4vQS; Thu, 16 May 2024 13:26:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715866004; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X+ic+lHrssxTA31QZuv5OkaA0CCHqzYL3wppxp+rTEo=; b=ZD9FH6ib9SD6gOnjb5T55AskHdIJU+OdM1Uo5dfAbImxKbsD6DcQ94jsSkqmL5KpzuGkWw UFhucF4hzMfUYfwsCM/0WQYFu1u1mLKJMc9992a2d0OUY0sj73mnBekMMJOlZrtqQItrpM 8EIRm9b+mHWkzZ5kQWiCabVP3EmOXpjcwxLygrKHwx3a3VkshjCXBxs+bFzC3NC3JzrRwZ 09s+tF0NVFB8tTwyZvb35Sy329oyrbcmgOIUsUBTcMbQmAtmemRdKfelxtQu3HwbiOI9Ie LcVDLpGAQyMMii4JTYYiHuT3xBwLltPaCmYRBeq6SY2TtaEU90AuMF5LDGwMXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715866004; a=rsa-sha256; cv=none; b=FJYmVJbi7DGmewUYRT2iuIZXXH9ZPvsAb386YpUcG4O1+swhniZNZckpSw3yQRgEWJXF/J wwobiKu3f0/fTz2b4FQTcgjsLlju0xd1Ly4chfREzsCROgjCS43T7QyXUTTbqVs7BSa1HH aGgMYr+n8GeXTQhYpw6yd9mRLZHBAzguxjUNRx2ZKQ1sEPZPfMnP7QeTzX/BK66Js4az05 q0tqkYdS2QquW0gi5nrxUmRLrNxvQOOecKRPGBeABuWuQV4CRepPh447j5X2gmBOuxHsSD o8vb+uf2SU111CFj5JICd4Pay7eQ/4BEQrR1aylbQ2a2tcQF5uIArXp+ND6DQw== 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=1715866004; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X+ic+lHrssxTA31QZuv5OkaA0CCHqzYL3wppxp+rTEo=; b=fgis1T6xT26yi05qHMR1u+EJ1DX/PZTNU6sopweoo3+XUE1GH+GSCqN0mJy9STRQQhzGiG z9hcZFHTIXsk/WSQid5tmbZ9aJOQEePU3apCBFE6+jGUU3eq3Uh0DTUYt/EzXTdHkhgRgm h+3FTympOgyREe2hHFd+MwyhBk0Uw7guhivo+vo1ypSwAwlUJGn+J5Sc4/ZzMvKDPAaR+9 cQGpC/5Tw/uTmJ+bXUGkuVkrb6roaOoDAbVS0J32mujzyEPYBVeN+yQnx+xKIirNhIfQ92 MJq0XMuaoGsGqmCkxnWjNvo2mE9bjUsBn5nJ8WoXx06eQhWpqOOISg49oIA4mQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vg9q76SmJz10tb; Thu, 16 May 2024 13:26: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 44GDQh7e046711; Thu, 16 May 2024 13:26:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44GDQhmI046710; Thu, 16 May 2024 13:26:43 GMT (envelope-from git) Date: Thu, 16 May 2024 13:26:43 GMT Message-Id: <202405161326.44GDQhmI046710@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: "Alfonso S. Siciliano" Subject: git: e56a937c3e11..be8846bd9e06 - vendor/bsddialog - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asiciliano X-Git-Repository: src X-Git-Refname: refs/heads/vendor/bsddialog X-Git-Reftype: branch X-Git-Commit: be8846bd9e069f4a6bea3d769005bea96cf43990 X-Git-Oldrev: e56a937c3e111672afff33346941fb618792308b X-Git-Newrev: be8846bd9e069f4a6bea3d769005bea96cf43990 Auto-Submitted: auto-generated The branch vendor/bsddialog has been updated by asiciliano: URL: https://cgit.FreeBSD.org/src/log/?id=e56a937c3e11..be8846bd9e06 be8846bd9e06 contrib/bsddialog: Import version 1.0.2 From nobody Thu May 16 13:26:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vg9q80vPqz5LFy7 for ; Thu, 16 May 2024 13:26:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vg9q80BP2z4vfS; Thu, 16 May 2024 13:26:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715866004; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=51W+Rpc//9IQqvY6UoeL9GonKiWKrtR92zJhCeXdA2A=; b=pV5wxnCeZcJ4vof5Zto2/gD42j+S/sb+0Fa35KwYFpP0gtrm2T8dpfz/bFpHxHO9xIlpGC IWZd0rTMjYd9jn5OdmgYGUrJCZSYACSTcwLJ7mIGbPENZ9l78Gb3KYmdvKV6YMlivuzZRA bIlsjGi950xTe4wv9wmYXHPxcY6RS0DZpM4ElI52kxL01R3E2aDtX9fAxJ6yZia4wLT7TV yKxzYzeeSYIxxgpT6kWgsxoBplEfRz0HFJHYtwHaTrh7v2ygijBY0xmSMA4SZlTlLH+dFe x6xzcRwCWqgSOX7zeUL0Z8i0JNkZa9EW+SjVO/j7FtJo81Z5I4sTuh3d7z5wfw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715866004; a=rsa-sha256; cv=none; b=eh032cHF9VIq7f1AI8CXdbf1JtgtOVENGjmZ197MPc4XSgxjF9gfYZhRjAxn5H1Cza7n23 tb0YuJney+eINUYmAdXoi5HetvrFct3CI6h8RbLwc2W1LF067eM23SPU9BIgLC9FB72lDa HHM/+zyjnPe+CXylJkKfmoWlj576J4JjQZcQ3+r2G187CmF9wDML4hVzG4MQpedluCrNNx Qq+gkgkqR7IdTcVV2qR+O/m5RZqM1XVQOQSdFHjZnF0DbdbNYmx70yA5RcVvBSb8u/ZqiY ExFludAXkpizrQGBEfMF11OMHSfVgGOaBPu+ErdpoU2RQpbPnmBIsDBPthEoqQ== 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=1715866004; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=51W+Rpc//9IQqvY6UoeL9GonKiWKrtR92zJhCeXdA2A=; b=sxAF7gVSsWlexJo5RF/EbslrzzdT79h8GqMIlFWKa0zSOpmMIFH7qeYUykrFunKzVQqrd8 1Z5nLJjZoian5J7/oN0/yuveUeVHpXpFXvgK98p7h5rNVvjXJOwRYOi47inxBlg8cWexFZ XYpMxccYV+/JH70+4Vwkl+EGzsWwnebjVaeUpZpmfzbBfrK/VGOXH0F3qkD2V0mhLh7nWp yhDSmnr73pOXQZYty/qi3UBo7yximvwZrOWkdr27Pt80vuZx2Lgyf3nc+m0rOCnT8vCDPw H5M226lx3FSAdOCKPdHH60XyIO5YR651+mfay6iFgto0agInhsmMSZoxIidbEg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vg9q76wZnz1195; Thu, 16 May 2024 13:26: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 44GDQhfh046730; Thu, 16 May 2024 13:26:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44GDQhq6046729; Thu, 16 May 2024 13:26:43 GMT (envelope-from git) Date: Thu, 16 May 2024 13:26:43 GMT Message-Id: <202405161326.44GDQhq6046729@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: "Alfonso S. Siciliano" Subject: git: e7d2cb4acc7b - Create tag vendor/bsddialog/1.0.2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asiciliano X-Git-Repository: src X-Git-Refname: refs/tags/vendor/bsddialog/1.0.2 X-Git-Reftype: annotated tag X-Git-Commit: e7d2cb4acc7bd5bca9ef229986c141b4c1ca8ecd Auto-Submitted: auto-generated The annotated tag vendor/bsddialog/1.0.2 has been created by asiciliano: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/bsddialog/1.0.2 tag vendor/bsddialog/1.0.2 Tagger: Alfonso S. Siciliano TaggerDate: 2024-05-16 13:25:47 +0000 contrib/bsddialog: Import version 1.0.2 Implicitly import also 1.0.1, both versions are for fixing and feature requests. Fixing: Change --mixedform behavior to fix a bsdinstall fault avoiding to change the command line in wlanconfig. Feature requests: * Add keys to navigate menus. * Add key to redraw dialogs. * Avoid to handle env NCURSES_NO_UTF8_ACS in PuTTY. See '2024-04-11 Version 1.0.2' and '2023-11-16 Version 1.0.1' in /usr/src/contrib/bsddialog/CHANGELOG for more detailed information. PR: 274472 Differential Revision: D42380 -----BEGIN PGP SIGNATURE----- iQGTBAABCgB9FiEE3rLDBf8Ek2yJx9ZuP57vrP03HjcFAmZGCXVfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldERF QjJDMzA1RkYwNDkzNkM4OUM3RDY2RTNGOUVFRkFDRkQzNzFFMzcACgkQP57vrP03 HjfPQAgAtQl5Zi2ANayQMJgMooJOJif36QvThbtpVddDo0TgDrkR8bA9nwf9skZA ay8Cq7+nW8vqSwAfwGZyuNQ9RWtgH7CEKl3Wh99Gw1+cc2k8nuVMNbKwQ1woz4xw BhMYr+92L8SZ+JDww3Rt+fm49QmNSbVcxDJYmx/zU41+gm/KjnXRq0KXb5k6etZu FH4ILat4rsol/K56fUFkDpuEtUzOnDBIjC/U6k8tnTydZfhpMlDmGrZcBwsYZYWu D6oY59VFSLL87lCVkRxu9GydJjGOQVujun+UgNf+yBaDQWPrajIaDe+P/GoxDuZl UaWXImz9nB2qDpzoX28iIIMv8PiOIQ== =xB0S -----END PGP SIGNATURE----- commit be8846bd9e069f4a6bea3d769005bea96cf43990 Author: Alfonso S. Siciliano AuthorDate: 2024-05-16 13:24:49 +0000 Commit: Alfonso S. Siciliano CommitDate: 2024-05-16 13:24:49 +0000 contrib/bsddialog: Import version 1.0.2 Implicitly import also 1.0.1, both versions are for fixing and feature requests. Fixing: Change --mixedform behavior to fix a bsdinstall fault avoiding to change the command line in wlanconfig. Feature requests: * Add keys to navigate menus. * Add key to redraw dialogs. * Avoid to handle env NCURSES_NO_UTF8_ACS in PuTTY. See '2024-04-11 Version 1.0.2' and '2023-11-16 Version 1.0.1' in /usr/src/contrib/bsddialog/CHANGELOG for more detailed information. PR: 274472 Differential Revision: D42380 From nobody Thu May 16 13:35:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgB184XjVz5LH44; Thu, 16 May 2024 13:35:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgB1843t8z3xFK; Thu, 16 May 2024 13:35:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715866524; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aHhQPGRf/ZDCjy/JvkR7xH2g0RTbivq31BfTQK6FdSY=; b=JUHGG31JkH+dgtLmty4aEaY6K9Cmvdo9VoXeJ/Wl1EaKj0UMldLIytrX2iPIBCCKigx9iB CWRfDZtQl2LCH06dma/BVFeI8Cq/yBLVf3Eg6idWNQ3TvUf7gEApnnoZAaymIq/N5ccr8+ 6s0WBo+lPT7IVAdVP1qo8BIrvIbfLpn6TUO1Q9pBNUstRv4DsxR8CdsjBNEp1M6K+E8dsA lFVSq31yaTyRXcHYqGASr7iPqrQGwCzuXHhu87BGLrHRnxbvHQwzcCSqBZyYxEYmORa0qX B1i7h7yX1u4EEVp9bQidzvi9sW7D+t+ITvQteWw0RIhGZTKjo6QbJYsxZDbcCQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715866524; a=rsa-sha256; cv=none; b=lwa5BSFa341uhTfhnKkJoVGZPN6GcPTVGcbGAA1MpNo1pEu1nykcCNmc9xfeBTdhbS4duo KG86GCbtjrXrUlfK8WNZeqL1yA7FZEHfmkqNaVApd/9PMatTFPg7eAsAzd5/Zqz/VqGqg+ Ax9B3n3KsVFIwiGRebDz1LZBpoubOj/CQZlkkIDcXLCnTwb4brulzx27QB3tQjYZQKxUyY owxoQR0asFk74TffuZlzJehw0QLx/1/saIyUZM5GQrPRIJGc8chOJkqtFMxQiFkag4Twih LVkE0kWR7TSSkvbtQMn7BYcdxM1MP5zl3o4oDtDaJOGqn6TzrNzhCE/AZn7uxw== 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=1715866524; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aHhQPGRf/ZDCjy/JvkR7xH2g0RTbivq31BfTQK6FdSY=; b=x17ap7CdIvOUSCXknRqjU2TfHTWaukYXOPTsSREpNY3tWWUohWTgN6BCxNFdlRQoKZt0B1 RR8vFiXEIUatSX/vruRCYMDD6m7iAoepHeAG7BoXPbp63b/WO0UQp9RoGERYBTj1hEAfpt zfehPtxzpZvi18VQ0CLcvZxbU2GbHVkJmjYw3Vs5I6/3+bi2UQahSWLGrW1FYGGjVLVc6/ MULHWkwWkbq14Z1OuqOUBXD5rPbP2Ik5DRmjMfjvkbgeQNuuesJQFPGyioUxwA7foy9+43 kesxthFaXo6riw+71Bpnon40k2aPXR7J3e4ogoashGsHBj7vDLqhlbsgYk2BXw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgB183gD1z11Rd; Thu, 16 May 2024 13:35:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44GDZOon063475; Thu, 16 May 2024 13:35:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44GDZOqh063472; Thu, 16 May 2024 13:35:24 GMT (envelope-from git) Date: Thu, 16 May 2024 13:35:24 GMT Message-Id: <202405161335.44GDZOqh063472@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alfonso S. Siciliano" Subject: git: a6d8be451f62 - main - contrib/bsddialog: Import version 1.0.2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asiciliano X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a6d8be451f62d425b71a4874f7d4e133b9fb393c Auto-Submitted: auto-generated The branch main has been updated by asiciliano: URL: https://cgit.FreeBSD.org/src/commit/?id=a6d8be451f62d425b71a4874f7d4e133b9fb393c commit a6d8be451f62d425b71a4874f7d4e133b9fb393c Merge: abb1a1340e3f be8846bd9e06 Author: Alfonso S. Siciliano AuthorDate: 2024-05-16 13:32:56 +0000 Commit: Alfonso S. Siciliano CommitDate: 2024-05-16 13:32:56 +0000 contrib/bsddialog: Import version 1.0.2 Implicitly import also 1.0.1, both versions are for fixing and feature requests. Fixing: Change --mixedform behavior to fix a bsdinstall fault avoiding to change the command line in wlanconfig. Feature requests: * Add keys to navigate menus. * Add key to redraw dialogs. * Avoid to handle env NCURSES_NO_UTF8_ACS in PuTTY. See '2024-04-11 Version 1.0.2' and '2023-11-16 Version 1.0.1' in /usr/src/contrib/bsddialog/CHANGELOG for more detailed information. PR: 274472 Differential Revision: D42380 Merge commit 'be8846bd9e069f4a6bea3d769005bea96cf43990' contrib/bsddialog/CHANGELOG | 32 +++++++ contrib/bsddialog/LICENSE | 2 +- contrib/bsddialog/Makefile | 12 +-- contrib/bsddialog/README.md | 27 ++++-- contrib/bsddialog/examples_library/gauge.c | 2 +- contrib/bsddialog/examples_library/mixedgauge.c | 2 +- contrib/bsddialog/lib/barbox.c | 86 ++++++++++++++---- contrib/bsddialog/lib/bsddialog.3 | 37 +++++--- contrib/bsddialog/lib/bsddialog.h | 4 +- contrib/bsddialog/lib/datebox.c | 53 ++++++++--- contrib/bsddialog/lib/formbox.c | 43 ++++----- contrib/bsddialog/lib/lib_util.c | 111 +++++++++++++----------- contrib/bsddialog/lib/lib_util.h | 9 +- contrib/bsddialog/lib/libbsddialog.c | 9 +- contrib/bsddialog/lib/menubox.c | 25 +++--- contrib/bsddialog/lib/messagebox.c | 15 ++-- contrib/bsddialog/lib/textbox.c | 34 ++++---- contrib/bsddialog/lib/timebox.c | 17 +++- contrib/bsddialog/utility/bsddialog.1 | 83 ++++++++++++------ contrib/bsddialog/utility/bsddialog.c | 6 +- contrib/bsddialog/utility/util_builders.c | 72 +++++++++++---- contrib/bsddialog/utility/util_theme.c | 12 +-- 22 files changed, 469 insertions(+), 224 deletions(-) diff --cc contrib/bsddialog/Makefile index 884cfa1b3e60,000000000000..e6ec9988c59d mode 100644,000000..100644 --- a/contrib/bsddialog/Makefile +++ b/contrib/bsddialog/Makefile @@@ -1,38 -1,0 +1,38 @@@ +# PUBLIC DOMAIN - NO WARRANTY, see: +# +# +# Written in 2023 by Alfonso Sabato Siciliano + - OUTPUT = bsddialog - export VERSION=1.0 ++OUTPUT = bsddialog ++export VERSION=1.0.2 +.CURDIR ?= ${CURDIR} +LIBPATH = ${.CURDIR}/lib +LIBBSDDIALOG = ${LIBPATH}/libbsddialog.so +UTILITYPATH = ${.CURDIR}/utility + +RM= rm -f +LN = ln -s -f + - ### cli options ### - # port/pkg Makefile: 'MAKE_ARGS = -DNORPATH' ++### command-line options ### ++# FreeBSD port Makefile: 'MAKE_ARGS = -DNORPATH' +NORPATH ?= +export DISABLERPATH=${NORPATH} - # `make -DDEBUG` - # `gmake DEBUG=1` ++# Debug: `make -DDEBUG` or `gmake DEBUG=1` +DEBUG ?= +export ENABLEDEBUG=${DEBUG} ++################### + +all : ${OUTPUT} + +${OUTPUT}: ${LIBBSDDIALOG} + ${MAKE} -C ${UTILITYPATH} LIBPATH=${LIBPATH} + ${LN} ${UTILITYPATH}/${OUTPUT} ${.CURDIR}/${OUTPUT} + +${LIBBSDDIALOG}: + ${MAKE} -C ${LIBPATH} + +clean: + ${MAKE} -C ${LIBPATH} clean + ${MAKE} -C ${UTILITYPATH} clean + ${RM} ${OUTPUT} *.core + diff --cc contrib/bsddialog/README.md index f4846ec07745,000000000000..a902f7fada7a mode 100644,000000..100644 --- a/contrib/bsddialog/README.md +++ b/contrib/bsddialog/README.md @@@ -1,131 -1,0 +1,140 @@@ - # BSDDialog 1.0 ++# BSDDialog 1.0.2 + +This project provides **bsddialog** and **libbsddialog**, an utility +and a library to build scripts and tools with TUI dialogs and widgets. + + +## Demo + +[Screenshots](https://www.flickr.com/photos/alfonsosiciliano/albums/72157720215006074). + + +## Getting Started + +FreeBSD and Linux: + +``` +% git clone https://gitlab.com/alfix/bsddialog.git +% cd bsddialog +% make +% ./bsddialog --msgbox "Hello World!" 8 20 +``` + +Output: + +![screenshot](screenshot.png) + + +## Utility + +**Dialogs:** + +--calendar, --checklist, --datebox, --form, --gauge, --infobox, --inputbox, +--menu, --mixedform, --mixedgauge, --msgbox, --passwordbox, --passwordform, +--pause, --radiolist, --rangebox, --textbox, --timebox, --treeview, --yesno. + +**Manual** + + - [bsddialog(1)](https://alfonsosiciliano.gitlab.io/posts/2022-01-26-manual-bsddialog.html) + + +**Examples**: + +``` +% ./bsddialog --backtitle "TITLE" --title msgbox --msgbox "Hello World!" 5 30 +% ./bsddialog --theme blackwhite --title msgbox --msgbox "Hello World!" 5 30 +% ./bsddialog --begin-y 2 --default-no --title yesno --yesno "Hello World!" 5 30 +% ./bsddialog --ascii-lines --pause "Hello World!" 8 50 10 +% ./bsddialog --checklist "Space to select" 0 0 0 Name1 Desc1 off Name2 Desc2 on +% ./bsddialog --title yesno --hline "bsddialog" --yesno "Hello World!" 5 25 +% ./bsddialog --extra-button --help-button --yesno "Hello World!" 0 0 +``` + +and [Examples](https://gitlab.com/alfix/bsddialog/-/tree/main/examples_utility) +in the _Public Domain_ to build new projects: +``` +% sh ./examples_utility/calendar.sh +% sh ./examples_utility/checklist.sh +% sh ./examples_utility/datebox.sh +% sh ./examples_utility/form.sh +% sh ./examples_utility/gauge.sh +% sh ./examples_utility/infobox.sh +% sh ./examples_utility/inputbox.sh +% sh ./examples_utility/menu.sh +% sh ./examples_utility/mixedform.sh +% sh ./examples_utility/mixedgauge.sh +% sh ./examples_utility/msgbox.sh +% sh ./examples_utility/passwordbox.sh +% sh ./examples_utility/passwordform.sh +% sh ./examples_utility/pause.sh +% sh ./examples_utility/radiolist.sh +% sh ./examples_utility/rangebox.sh +% sh ./examples_utility/timebox.sh +% sh ./examples_utility/yesno.sh +``` + +## Library + +**API** + + - [bsddialog.h](https://gitlab.com/alfix/bsddialog/-/blob/main/lib/bsddialog.h) + - [bsddialog\_theme.h](https://gitlab.com/alfix/bsddialog/-/blob/main/lib/bsddialog_theme.h) + + +**Manual** + + - [bsddialog(3)](https://alfonsosiciliano.gitlab.io/posts/2022-01-15-manual-libbsddialog.html) + + +**Examples**: + +[Examples](https://gitlab.com/alfix/bsddialog/-/tree/main/examples_library) +in the _Public Domain_ to build new projects: +``` +% cd examples_library +% sh compile +% ./calendar +% ./checklist +% ./datebox +% ./form +% ./gauge +% ./infobox +% ./menu +% ./mixedgauge +% ./mixedlist +% ./msgbox +% ./pause +% ./radiolist +% ./rangebox +% ./theme +% ./timebox +% ./yesno +``` + + +## TODO and Ideas + - - menubar feature - - key callback - - Right-To-Left text ++ - menubar feature. ++ - key callback. ++ - Right-To-Left text. + - some terminal does not hide the cursor, move it bottom-right before to getch. - - refactor backtitle: multiline, conf.backtitle, WINDOW \*dialog.backtitle. - - refactor bottomdesc: WINDOW \*dialog.bottomdesc -> fix expandig screen. - - accessibility https://wiki.freebsd.org/Accessibility/Wishlist/Base ++ - refactor backtitle: add WINDOW \*dialog.backtitle for multiline and fix expanding screen. ++ - refactor bottomdesc: add WINDOW \*dialog.bottomdesc to fix expandig screen. ++ - accessibility https://wiki.freebsd.org/Accessibility/Wishlist/Base. + - add bool conf.menu.depthlines. + - implement custom getopt\_long(). + - refactor/redesign gauge(). + - improve grey lines expanding terminal (maybe redrawwin() in hide\_dialog()). + - more restrictive strtol() and strtoul(). + - implement global buttons handler. - - add/move external tutorial. - - implement menutype.min_on. ++ - doc: external tutorial, theming guide. ++ - implement menutype.min\_on. ++ - improve refresh at startup, avoid dialog refresh before drawing text. ++ - add debug API: bsddialog\_debug(y,x,refresh,"fmt",...). ++ - add mouse support. ++ - use alarm(2) for bsddialog\_pause. ++ - delete form fieldlen constraint, hide or truncate long field in little screens. ++ - improve --inputbox autosizing, consider also input length. ++ - fix --form "" 0 0 0 Label 1 0 Init 1 12 0 0 (with 0 editable field). ++ - fix --mixedform "" 0 0 0 Label 1 0 Init 1 12 0 0 2 (with 0 editable field). ++ - add *text* customization to --hmsg *help-message* From nobody Thu May 16 16:44:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgGCz31WSz5LWdQ; Thu, 16 May 2024 16:45:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgGCz1Byzz4KXH; Thu, 16 May 2024 16:45:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715877903; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+zNy3csY58mvqP9MaSxk92y90MAKcyT94t7RgOSRrqE=; b=eDSvpL487SL+PX5iVb2UXl0mMONmyc0p7xxwcryBQDsJjDFBcXbJ3/VCANQoWMhU3OPD7Y FaJCR7qjsEwWbb/RvJYQqLroI/DVb0CyVyuyB4llWdWrTzS0MFtNjohfzt+ZcqvzNI5/SU RkZUOw55vOn/XHVOjtqwoyzhRtxTCVR0eiNLFH/4LbR9/RUL8TxOrbmaTW3V/Ry4Fx45TG xpJD0TYltpKndIgcnvM5tU6+rpQa11sphjhyffNV2jdlj3zh3hwpIfoP5uUg3AcIaIe25i VrKfblmvvVkUSKbybrswmbe4rEuLxMlddT3JBgHMJTEGPYcDpSj5nSt3PX8+Pg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715877903; a=rsa-sha256; cv=none; b=LJGkYk0XmGqA85q2pRyBpXJrzeZfyoYbzACbRnWyH3B11Cf/H3iUVZtxkYuVRNKxUS8lzH CjQCvc8EsLFD6V7mlvj9OIVX/j6KsoYXicMDC6D7s8imURqqSKfU4q5U+ywvR+ycznlLN2 DnQyzaNIz5jr6+Mbsq/Wtm5e8/JLxdPIAQ34UCU5Wbg/c7ETfcPJa7cB3W+P+V4gmThxhT LTPn/4M7yDc6iNDRTl7aLCEMAIP2j3ym4fYPZyWdDmpQZVCg/OTjdWB5QHmCP6YTktgdbB +bqswlo6cixPorRKtJLlMPgd5qHb5Z+bZ8/hwNx58MYPCi+0gYkCjSfGNi0Ohg== 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=1715877903; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+zNy3csY58mvqP9MaSxk92y90MAKcyT94t7RgOSRrqE=; b=h6hCmgfAoqmelAC71UghJBaTg3Iap9A2Rl60eWvxJ/z3TO+GrnGFHT5pK48QovIFIKuyas A32Shy33ancUmBCU7E5GL8pMQxzXwd1hJnWwU/9ZhVgk0IWwsFCHXZXD+8GUvfkGzsDkTV DmBPzNapfwBbrmNntrwrMrmfc0sZNXtkPTvw28ah3ZXBZslVyWWJtP+Qr9dEmWASBWErY2 YoApSDhuqFg++1dgd4c0vFcWxhQwAJWC+UR3md2QJoNObTRdiOLsDmoDEsOP8iVTrchNCd foduMEzyqintvdZW3fItJ2+vw2yRjWL3icm4svuNf0ptZzIaAOfbV0/SNnKs3Q== Received: from [IPV6:2601:644:937f:4c50:c0c0:cf11:cc26:3c0e] (unknown [IPv6:2601:644:937f:4c50:c0c0:cf11:cc26:3c0e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4VgGCt0qXjz12dM; Thu, 16 May 2024 16:44:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <6bc02a7a-e711-426c-835f-0b89d9479569@FreeBSD.org> Date: Thu, 16 May 2024 09:44:56 -0700 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 61dece6d27fb - main - Enable soft updates by default for UFS2 filesystems. Content-Language: en-US To: Colin Percival , Kirk McKusick , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202405150540.44F5eEtA013445@gitrepo.freebsd.org> <0100018f7ae933d3-815c24d4-8d83-42b1-b354-3c0901b6d6e0-000000@email.amazonses.com> From: John Baldwin In-Reply-To: <0100018f7ae933d3-815c24d4-8d83-42b1-b354-3c0901b6d6e0-000000@email.amazonses.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 5/14/24 11:20 PM, Colin Percival wrote: > On 5/14/24 22:40, Kirk McKusick wrote: >> commit 61dece6d27fb2436928ca93d65667b358e05aa7b >> Author: Kirk McKusick >> AuthorDate: 2024-05-15 05:38:35 +0000 >> Commit: Kirk McKusick >> CommitDate: 2024-05-15 05:40:01 +0000 >> >> Enable soft updates by default for UFS2 filesystems. >> [...] >> >> MFC after: 1 week > If we're not worried about this being too astonishing a change for a stable > branch (and I'm not -- I can't imagine too many people being upset that > they get better performance than they used to), is there any reason to not > include this in 14.1? +1 for merging to 14.1 -- John Baldwin From nobody Thu May 16 16:52:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgGNr08tGz5LX9l; Thu, 16 May 2024 16:52:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgGNq66dvz4L3L; Thu, 16 May 2024 16:52:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715878363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qugp+W09uLyZjpMveR7xhf/HSGnhktyupY2XQiDd1NE=; b=c4jICg/PEuCcayLvsPzXpzZo7ZTiRKBIRK5ZyktbF1JI8ajgcFsMLgi03XuvEwCN/I5uIQ uK4CNdd9lpnBCYDC+IOjixZSfrKol7r1O6ThUh/LhBcZYktHYTIQajGFbD6REYkwtJsfc6 +d7CgYFt+gjh1pHdU2oU0dmzDIK0EqthybJWpOPpUOGjMAatmOoPYLe2SOUB/xmwCuZVg5 iB2OrmaInGcxhNCRjabfBHgWqotP4CqPE+xngBbCibjMufKGgMo2z/3FEhfpEadC1tDDjp R3ACVOH/r1MjPTnpvP6MzRXMW33WgVw3vHp8cwb1WaQwWxWKJms5wHajFyTpGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715878363; a=rsa-sha256; cv=none; b=JHsXk25u3MvX2tJ+X7B0zkDR5mpE8Y40cSNoCXwDBk7bxeUX2t9ZBwuzFBDuJr866jTK5z 1ZyswjKr0UTjgj96jTyQMIvHGGzkkwOkNjQTkbn9/45CBRjDsuEKaUWmKFl7EjmBWA8fBM jXLkPqJKghUZu+oral2Jt3wI4D967gZQtrtpcKvCM7ZrRkqd36iuDGGAHWsy0IRmlgs0ey YRO2078zktGrj4fYOHZBig9TNVQ2sO+FPIrV2Dpv6jGbmoVaZytx9eJ69Y7h0vSuXmcDa8 uBFR8WJKYNHb+psgsUJl2PUVIt+UMfK0ZtpTNqMJJto4z0jzkvqczAeWMWFlFA== 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=1715878363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qugp+W09uLyZjpMveR7xhf/HSGnhktyupY2XQiDd1NE=; b=vh3J+P/hRVg6eJgojUN4GPhoxG+KCI3TdEwc8LfHVs/8CSGx0dVnWehzlDFoMzpZuj/1My pm1MvuOcwf8j/o86NjDNwpC13LEWBJljWhGuT9QDTLzN2EzFDBxJfkeL6xlVnuExqZtSNN bGfy7Pziq/X+xWtsGahcEpdNOJJcIo9VZCY/8blNqdlJthQwfNjVHZMvNrRwppeW+d7G4c ZcfITFspAKtT4l8wD8neXpjEdgDPNM+56gdTOWC4R0VUbQ/75bf+iwVNu9oKllq6z6Ae4x lZCQA7RV1mF82nx8jk+U3uP37Bphnajy+nbtMyihhkIPI7EluQGxWWI41kvdYg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgGNq5jpHz16NM; Thu, 16 May 2024 16:52: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 44GGqhR5001316; Thu, 16 May 2024 16:52:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44GGqh5p001313; Thu, 16 May 2024 16:52:43 GMT (envelope-from git) Date: Thu, 16 May 2024 16:52:43 GMT Message-Id: <202405161652.44GGqh5p001313@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 1687d77197c0 - main - man filesystems: move driver pages to section four List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1687d77197c01c6ffd5bb233c7a15c6ebb9319af Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1687d77197c01c6ffd5bb233c7a15c6ebb9319af commit 1687d77197c01c6ffd5bb233c7a15c6ebb9319af Author: Alexander Ziaee AuthorDate: 2024-04-21 19:05:45 +0000 Commit: Warner Losh CommitDate: 2024-05-16 16:24:40 +0000 man filesystems: move driver pages to section four Filesystem manual pages describe drivers, not formats; except for fs, which describes the structures of ffs/ufs, not how to use it in the system. Reported by: emaste Reviewed by: des, imp, meena (previous version) Pull Request: https://github.com/freebsd/freebsd-src/pull/1077 --- share/man/man4/Makefile | 23 ++++++++++++++++++++++ share/man/{man5/autofs.5 => man4/autofs.4} | 2 +- share/man/{man5/cd9660.5 => man4/cd9660.4} | 2 +- share/man/{man5/devfs.5 => man4/devfs.4} | 2 +- share/man/{man5/ext2fs.5 => man4/ext2fs.4} | 2 +- share/man/{man5/fdescfs.5 => man4/fdescfs.4} | 2 +- share/man/{man7/ffs.7 => man4/ffs.4} | 2 +- share/man/{man5/fusefs.5 => man4/fusefs.4} | 2 +- share/man/{man5/lindebugfs.5 => man4/lindebugfs.4} | 2 +- share/man/{man5/linprocfs.5 => man4/linprocfs.4} | 2 +- share/man/{man5/linsysfs.5 => man4/linsysfs.4} | 2 +- share/man/{man5/mqueuefs.5 => man4/mqueuefs.4} | 2 +- share/man/{man5/msdosfs.5 => man4/msdosfs.4} | 2 +- share/man/{man5/nullfs.5 => man4/nullfs.4} | 2 +- share/man/{man5/procfs.5 => man4/procfs.4} | 2 +- share/man/{man5/smbfs.5 => man4/smbfs.4} | 2 +- share/man/{man5/tarfs.5 => man4/tarfs.4} | 0 share/man/{man5/tmpfs.5 => man4/tmpfs.4} | 2 +- share/man/{man5/unionfs.5 => man4/unionfs.4} | 2 +- share/man/man5/Makefile | 22 --------------------- share/man/man7/Makefile | 1 - share/man/man7/intro.7 | 3 --- 22 files changed, 40 insertions(+), 43 deletions(-) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 5deb4ddea874..a6a63eab7326 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -100,6 +100,7 @@ MAN= aac.4 \ cc_vegas.4 \ ${_ccd.4} \ ccr.4 \ + cd9660.4 \ cd.4 \ cdce.4 \ cdceem.4 \ @@ -127,6 +128,7 @@ MAN= aac.4 \ dcons_crom.4 \ ddb.4 \ devctl.4 \ + devfs.4 \ disc.4 \ disk.4 \ divert.4 \ @@ -147,18 +149,22 @@ MAN= aac.4 \ etherswitch.4 \ eventtimers.4 \ exca.4 \ + ext2fs.4 \ e6060sw.4 \ fd.4 \ fdc.4 \ + fdescfs.4 \ fdt.4 \ fdt_pinctrl.4 \ fdtbus.4 \ ffclock.4 \ + ffs.4 \ filemon.4 \ firewire.4 \ ${_ftgpio.4} \ ${_ftwd.4} \ full.4 \ + fusefs.4 \ fwe.4 \ fwip.4 \ fwohci.4 \ @@ -275,6 +281,9 @@ MAN= aac.4 \ le.4 \ led.4 \ lge.4 \ + lindebugfs.4 \ + linprocfs.4 \ + linsysfs.4 \ ${_linux.4} \ liquidio.4 \ lm75.4 \ @@ -321,7 +330,9 @@ MAN= aac.4 \ mpr.4 \ mps.4 \ mpt.4 \ + mqueuefs.4 \ mrsas.4 \ + msdosfs.4 \ msk.4 \ mtio.4 \ multicast.4 \ @@ -404,6 +415,7 @@ MAN= aac.4 \ ${_nda.4} \ ${_if_ntb.4} \ null.4 \ + nullfs.4 \ numa.4 \ nvd.4 \ ${_nvdimm.4} \ @@ -446,6 +458,7 @@ MAN= aac.4 \ ppc.4 \ ppi.4 \ procdesc.4 \ + procfs.4 \ proto.4 \ ps4dshock.4 \ psm.4 \ @@ -504,6 +517,7 @@ MAN= aac.4 \ sk.4 \ ${_smartpqi.4} \ smb.4 \ + smbfs.4 \ smbios.4 \ smbus.4 \ smp.4 \ @@ -548,6 +562,7 @@ MAN= aac.4 \ syscons.4 \ sysmouse.4 \ tap.4 \ + tarfs.4 \ targ.4 \ tcp.4 \ tcp_bbr.4 \ @@ -557,6 +572,7 @@ MAN= aac.4 \ textdump.4 \ ti.4 \ timecounters.4 \ + tmpfs.4 \ ${_tpm.4} \ tslog.4 \ tty.4 \ @@ -565,6 +581,7 @@ MAN= aac.4 \ tws.4 \ udp.4 \ udplite.4 \ + unionfs.4 \ ure.4 \ vale.4 \ vga.4 \ @@ -670,6 +687,7 @@ MLINKS+=em.4 if_em.4 \ MLINKS+=enc.4 if_enc.4 MLINKS+=epair.4 if_epair.4 MLINKS+=et.4 if_et.4 +MLINKS+=ext2fs.4 ext4fs.4 \ MLINKS+=fd.4 stderr.4 \ fd.4 stdin.4 \ fd.4 stdout.4 @@ -719,6 +737,7 @@ MLINKS+=mfi.4 mfi_linux.4 \ mfi.4 mfip.4 MLINKS+=mlx5en.4 mce.4 MLINKS+=mos.4 if_mos.4 +MLINKS+=msdosfs.4 msdos.4 MLINKS+=msk.4 if_msk.4 MLINKS+=mwl.4 if_mwl.4 MLINKS+=mxge.4 if_mxge.4 @@ -914,6 +933,10 @@ SUBDIR+= man4.${__arch} .endif .endfor +.if ${MK_AUTOFS} != "no" +MAN+= autofs.4 +.endif + .if ${MK_BLUETOOTH} != "no" MAN+= ng_bluetooth.4 .endif diff --git a/share/man/man5/autofs.5 b/share/man/man4/autofs.4 similarity index 99% rename from share/man/man5/autofs.5 rename to share/man/man4/autofs.4 index e82df1929877..a721a6e27a53 100644 --- a/share/man/man5/autofs.5 +++ b/share/man/man4/autofs.4 @@ -25,7 +25,7 @@ .\" SUCH DAMAGE. .\" .Dd December 2, 2017 -.Dt AUTOFS 5 +.Dt AUTOFS 4 .Os .Sh NAME .Nm autofs diff --git a/share/man/man5/cd9660.5 b/share/man/man4/cd9660.4 similarity index 99% rename from share/man/man5/cd9660.5 rename to share/man/man4/cd9660.4 index 224816e16c57..0e4fd33637cb 100644 --- a/share/man/man5/cd9660.5 +++ b/share/man/man4/cd9660.4 @@ -24,7 +24,7 @@ .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .Dd April 25, 2023 -.Dt CD9660 5 +.Dt CD9660 4 .Os .Sh NAME .Nm cd9660 diff --git a/share/man/man5/devfs.5 b/share/man/man4/devfs.4 similarity index 99% rename from share/man/man5/devfs.5 rename to share/man/man4/devfs.4 index 0f914f671bf8..c90835570127 100644 --- a/share/man/man5/devfs.5 +++ b/share/man/man4/devfs.4 @@ -33,7 +33,7 @@ .\" SUCH DAMAGE. .\" .Dd June 30, 2022 -.Dt DEVFS 5 +.Dt DEVFS 4 .Os .Sh NAME .Nm devfs diff --git a/share/man/man5/ext2fs.5 b/share/man/man4/ext2fs.4 similarity index 99% rename from share/man/man5/ext2fs.5 rename to share/man/man4/ext2fs.4 index 7504a144496f..816ea942d29f 100644 --- a/share/man/man5/ext2fs.5 +++ b/share/man/man4/ext2fs.4 @@ -25,7 +25,7 @@ .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .Dd December 30, 2018 -.Dt EXT2FS 5 +.Dt EXT2FS 4 .Os .Sh NAME .Nm ext2fs diff --git a/share/man/man5/fdescfs.5 b/share/man/man4/fdescfs.4 similarity index 99% rename from share/man/man5/fdescfs.5 rename to share/man/man4/fdescfs.4 index fa260cbc12f3..4b51c2bad369 100644 --- a/share/man/man5/fdescfs.5 +++ b/share/man/man4/fdescfs.4 @@ -39,7 +39,7 @@ .\" SUCH DAMAGE. .\" .Dd Jul 11, 2023 -.Dt FDESCFS 5 +.Dt FDESCFS 4 .Os .Sh NAME .Nm fdescfs diff --git a/share/man/man7/ffs.7 b/share/man/man4/ffs.4 similarity index 99% rename from share/man/man7/ffs.7 rename to share/man/man4/ffs.4 index 7d003443f32a..fa0cf9be1510 100644 --- a/share/man/man7/ffs.7 +++ b/share/man/man4/ffs.4 @@ -29,7 +29,7 @@ .\" SUCH DAMAGE. .\" .Dd May 3, 2020 -.Dt FFS 7 +.Dt FFS 4 .Os .Sh NAME .Nm ffs diff --git a/share/man/man5/fusefs.5 b/share/man/man4/fusefs.4 similarity index 99% rename from share/man/man5/fusefs.5 rename to share/man/man4/fusefs.4 index 987e7f898eca..33c31f355e09 100644 --- a/share/man/man5/fusefs.5 +++ b/share/man/man4/fusefs.4 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .Dd July 31, 2019 -.Dt FUSEFS 5 +.Dt FUSEFS 4 .Os .Sh NAME .Nm fusefs diff --git a/share/man/man5/lindebugfs.5 b/share/man/man4/lindebugfs.4 similarity index 99% rename from share/man/man5/lindebugfs.5 rename to share/man/man4/lindebugfs.4 index 8e385be7d743..d78a12c44714 100644 --- a/share/man/man5/lindebugfs.5 +++ b/share/man/man4/lindebugfs.4 @@ -24,7 +24,7 @@ .\" SUCH DAMAGE. .Dd August 10, 2022 -.Dt LINDEBUGFS 5 +.Dt LINDEBUGFS 4 .Os .Sh NAME .Nm lindebugfs diff --git a/share/man/man5/linprocfs.5 b/share/man/man4/linprocfs.4 similarity index 99% rename from share/man/man5/linprocfs.5 rename to share/man/man4/linprocfs.4 index 6b30d944b14b..f5ab7d9a10ad 100644 --- a/share/man/man5/linprocfs.5 +++ b/share/man/man4/linprocfs.4 @@ -2,7 +2,7 @@ .\" This file is in the public domain. .\" .Dd November 13, 2019 -.Dt LINPROCFS 5 +.Dt LINPROCFS 4 .Os .Sh NAME .Nm linprocfs diff --git a/share/man/man5/linsysfs.5 b/share/man/man4/linsysfs.4 similarity index 99% rename from share/man/man5/linsysfs.5 rename to share/man/man4/linsysfs.4 index f87f791c5f94..64270fe753d4 100644 --- a/share/man/man5/linsysfs.5 +++ b/share/man/man4/linsysfs.4 @@ -2,7 +2,7 @@ .\" This file is in the public domain. .\" .Dd November 13, 2019 -.Dt LINSYSFS 5 +.Dt LINSYSFS 4 .Os .Sh NAME .Nm linsysfs diff --git a/share/man/man5/mqueuefs.5 b/share/man/man4/mqueuefs.4 similarity index 99% rename from share/man/man5/mqueuefs.5 rename to share/man/man4/mqueuefs.4 index 7be49a816968..384a3e3e6546 100644 --- a/share/man/man5/mqueuefs.5 +++ b/share/man/man4/mqueuefs.4 @@ -26,7 +26,7 @@ .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .Dd November 30, 2005 -.Dt MQUEUEFS 5 +.Dt MQUEUEFS 4 .Os .Sh NAME .Nm mqueuefs diff --git a/share/man/man5/msdosfs.5 b/share/man/man4/msdosfs.4 similarity index 99% rename from share/man/man5/msdosfs.5 rename to share/man/man4/msdosfs.4 index 2856b4b5cc82..df937311060b 100644 --- a/share/man/man5/msdosfs.5 +++ b/share/man/man4/msdosfs.4 @@ -2,7 +2,7 @@ .\" This file is in the public domain. .\" .Dd September 27, 2018 -.Dt MSDOSFS 5 +.Dt MSDOSFS 4 .Os .Sh NAME .Nm msdosfs diff --git a/share/man/man5/nullfs.5 b/share/man/man4/nullfs.4 similarity index 99% rename from share/man/man5/nullfs.5 rename to share/man/man4/nullfs.4 index 6e2c199aa3b0..5aca03071594 100644 --- a/share/man/man5/nullfs.5 +++ b/share/man/man4/nullfs.4 @@ -23,7 +23,7 @@ .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .Dd March 15, 2022 -.Dt NULLFS 5 +.Dt NULLFS 4 .Os .Sh NAME .Nm nullfs diff --git a/share/man/man5/procfs.5 b/share/man/man4/procfs.4 similarity index 99% rename from share/man/man5/procfs.5 rename to share/man/man4/procfs.4 index 5977a8bced81..64dd3100e6bc 100644 --- a/share/man/man5/procfs.5 +++ b/share/man/man4/procfs.4 @@ -2,7 +2,7 @@ .\" This file is in the public domain. .\" .Dd April 10, 2023 -.Dt PROCFS 5 +.Dt PROCFS 4 .Os .Sh NAME .Nm procfs diff --git a/share/man/man5/smbfs.5 b/share/man/man4/smbfs.4 similarity index 99% rename from share/man/man5/smbfs.5 rename to share/man/man4/smbfs.4 index 7be90c3ba882..c0650b8e17d6 100644 --- a/share/man/man5/smbfs.5 +++ b/share/man/man4/smbfs.4 @@ -22,7 +22,7 @@ .\" SUCH DAMAGE. .\" .Dd April 6, 2022 -.Dt SMBFS 5 +.Dt SMBFS 4 .Os .Sh NAME .Nm smbfs diff --git a/share/man/man5/tarfs.5 b/share/man/man4/tarfs.4 similarity index 100% rename from share/man/man5/tarfs.5 rename to share/man/man4/tarfs.4 diff --git a/share/man/man5/tmpfs.5 b/share/man/man4/tmpfs.4 similarity index 99% rename from share/man/man5/tmpfs.5 rename to share/man/man4/tmpfs.4 index f3d6a2f6c2b5..ce6b23e3ae7b 100644 --- a/share/man/man5/tmpfs.5 +++ b/share/man/man4/tmpfs.4 @@ -52,7 +52,7 @@ .\" POSSIBILITY OF SUCH DAMAGE. .\" .Dd September 18, 2023 -.Dt TMPFS 5 +.Dt TMPFS 4 .Os .Sh NAME .Nm tmpfs diff --git a/share/man/man5/unionfs.5 b/share/man/man4/unionfs.4 similarity index 99% rename from share/man/man5/unionfs.5 rename to share/man/man4/unionfs.4 index a20889d54839..205958def903 100644 --- a/share/man/man5/unionfs.5 +++ b/share/man/man4/unionfs.4 @@ -22,7 +22,7 @@ .\" SUCH DAMAGE. .\" .Dd April 27, 2020 -.Dt UNIONFS 5 +.Dt UNIONFS 4 .Os .Sh NAME .Nm unionfs diff --git a/share/man/man5/Makefile b/share/man/man5/Makefile index d9129307bea2..bc345b42717c 100644 --- a/share/man/man5/Makefile +++ b/share/man/man5/Makefile @@ -6,9 +6,7 @@ MAN= acct.5 \ ar.5 \ a.out.5 \ ${_boot.config.5} \ - cd9660.5 \ core.5 \ - devfs.5 \ devfs.conf.5 \ devfs.rules.5 \ device.hints.5 \ @@ -17,41 +15,31 @@ MAN= acct.5 \ elf.5 \ ethers.5 \ eui64.5 \ - ext2fs.5 \ fbtab.5 \ - fdescfs.5 \ forward.5 \ fs.5 \ fstab.5 \ - fusefs.5 \ group.5 \ hosts.5 \ hosts.equiv.5 \ hosts.lpd.5 \ intro.5 \ libmap.conf.5 \ - lindebugfs.5 \ link.5 \ - linprocfs.5 \ - linsysfs.5 \ mailer.conf.5 \ make.conf.5 \ moduli.5 \ motd.5 \ mount.conf.5 \ - mqueuefs.5 \ - msdosfs.5 \ networks.5 \ nsmb.conf.5 \ nsswitch.conf.5 \ - nullfs.5 \ os-release.5 \ passwd.5 \ pbm.5 \ periodic.conf.5 \ phones.5 \ portindex.5 \ - procfs.5 \ protocols.5 \ quota.user.5 \ rc.conf.5 \ @@ -61,21 +49,15 @@ MAN= acct.5 \ resolver.5 \ services.5 \ shells.5 \ - smbfs.5 \ src.conf.5 \ stab.5 \ style.Makefile.5 \ style.mdoc.5 \ sysctl.conf.5 \ - tarfs.5 \ - tmpfs.5 \ - unionfs.5 MLINKS= dir.5 dirent.5 -MLINKS+=ext2fs.5 ext4fs.5 MLINKS+=fs.5 inode.5 MLINKS+=hosts.equiv.5 rhosts.5 -MLINKS+=msdosfs.5 msdos.5 MLINKS+=passwd.5 master.passwd.5 MLINKS+=passwd.5 pwd.db.5 MLINKS+=passwd.5 spwd.db.5 @@ -85,10 +67,6 @@ MLINKS+=rc.conf.5 rc.conf.local.5 MLINKS+=resolver.5 resolv.conf.5 MLINKS+=src.conf.5 src-env.conf.5 -.if ${MK_AUTOFS} != "no" -MAN+= autofs.5 -.endif - .if ${MK_BLUETOOTH} != "no" MAN+= bluetooth.device.conf.5 \ bluetooth.hosts.5 \ diff --git a/share/man/man7/Makefile b/share/man/man7/Makefile index f163d4e0a0d8..b83399b2917d 100644 --- a/share/man/man7/Makefile +++ b/share/man/man7/Makefile @@ -11,7 +11,6 @@ MAN= arch.7 \ crypto.7 \ development.7 \ environ.7 \ - ffs.7 \ firewall.7 \ growfs.7 \ hier.7 \ diff --git a/share/man/man7/intro.7 b/share/man/man7/intro.7 index a155839bde64..be6f68556895 100644 --- a/share/man/man7/intro.7 +++ b/share/man/man7/intro.7 @@ -54,9 +54,6 @@ development introduction to .Fx .It Xr environ 7 user environment -.It Xr ffs 7 -commonly used filesystem in -.Fx .It Xr firewall 7 simple firewalls under .Fx From nobody Thu May 16 16:52:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgGNs1h38z5LX5K; Thu, 16 May 2024 16:52: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 4VgGNr71pgz4LHW; Thu, 16 May 2024 16:52:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715878365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MN4GCAicyu+PJBdTr1deuQgkYpN+U/vx20KaCDAHFeo=; b=WIC3Br6wRxG8wVd0f9r4Rz0U7NEHGyyQ+9gZN6o7RFtvSOlHXYNjH0UsfoExMxqJfZRjYR E3iWE7cf57yr77hYHzHyecAYKWh7QP2NpN1euvGqMO8WC5v5QNOhn9hgitTyrhUs6TEPAE MNDjSSynHQuf0aD49tYjARFKekP/rt9owMEIdcqqXg/NtI8OG0i/fxrpmEGO5oRaTzkB4F mXvIeTaMIz8ov7dac7gzRywGeOmtUYoev18DjTom5bLBB1cpz77cecvqY+Sw+LfeqiGJaa caEO15wV0MVOfM4td0YhC6j3NRZBqV3cjkTxTpzWqzvpj00Ip69saYoGQxB9RQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715878365; a=rsa-sha256; cv=none; b=kMjXJEsZ5mrZM5vK5TkzhToFZtM9GWgyu2JEjsir0cFg1gLJAbY5H6imSa67a881evyMWj RepcEEwKHt6JKnXp62cSo9X2wbixIZAuTn3JDISxBPlEiX+zj0CHS9zRfssrW5gT0u6OPc sQsv9JlgdPywHo6RAagadRnrAcm7Y8T6KEuE8CipajvfNhzeD7t9cjaTugtbBRP5LJ3lLB sJsAHPowMuf2xKkSHzjNaHoiiTOunNrgoqSVrhmrAj639dhKP6qZPA+92EyA5r6X04HYl1 5FI8ilXerZNO3Ns0v2Kj8C0oH1TfJMljrlGlrjwQdOrJQwOGdQtonAhhDv9fKw== 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=1715878365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MN4GCAicyu+PJBdTr1deuQgkYpN+U/vx20KaCDAHFeo=; b=LsCUJ45Heax6ulDcp/l+z1WNQM7X6KBNfAHarm5cDNgLI5D9Vx14Xw5GNncQSscAGti+0x UH2k5P1aXo40xWhBqArjYWPWRyXXbe8wEK1qF9MOVslSQFaz0fpmAlLzeuQl0vZdYCt/Rl eF7NgFMwEBWJwReKkqKOE9cPKvvN3zvhsiK3SlkexaHAL2DgAezRkEZGgOGgiTiDqbAUHo 6qCm+lx9M405A8y/qx1kVbBexNZM+MoQuC55ZTte9wPxAmOTvjunYIRUC3yejtL+l3P2Qg DP+Rc5I8kYGarJKAZatQoUUB4Yqkz7uoXr+wIgn4wGcqlhnCj6X+LnRShMqM+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 4VgGNr6cwmz16Yv; Thu, 16 May 2024 16:52: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 44GGqir7001369; Thu, 16 May 2024 16:52:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44GGqi3v001366; Thu, 16 May 2024 16:52:44 GMT (envelope-from git) Date: Thu, 16 May 2024 16:52:44 GMT Message-Id: <202405161652.44GGqi3v001366@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: a03e8a40d404 - main - man filesystems: ObsoleteFiles after move to sec 4 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a03e8a40d40486945296b4ed27ca6f31a93a366b Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a03e8a40d40486945296b4ed27ca6f31a93a366b commit a03e8a40d40486945296b4ed27ca6f31a93a366b Author: Alexander Ziaee AuthorDate: 2024-05-12 02:32:15 +0000 Commit: Warner Losh CommitDate: 2024-05-16 16:25:13 +0000 man filesystems: ObsoleteFiles after move to sec 4 Reported by: imp Reviewed by: des, imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1077 --- ObsoleteFiles.inc | 22 ++++++++++++++++++++++ tools/build/mk/OptionalObsoleteFiles.inc | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 8a2c87b20645..70e6dcec50b1 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,28 @@ # xargs -n1 | sort | uniq -d; # done +# 20240511: move file system driver manuals to section four +OLD_FILES+=usr/share/man/man5/autofs.5.gz +OLD_FILES+=usr/share/man/man5/cd9660.5.gz +OLD_FILES+=usr/share/man/man5/devfs.5.gz +OLD_FILES+=usr/share/man/man5/ext2fs.5.gz +OLD_FILES+=usr/share/man/man5/ext4fs.5.gz +OLD_FILES+=usr/share/man/man5/fdescfs.5.gz +OLD_FILES+=usr/share/man/man5/fusefs.5.gz +OLD_FILES+=usr/share/man/man5/lindebugfs.5.gz +OLD_FILES+=usr/share/man/man5/linprocfs.5.gz +OLD_FILES+=usr/share/man/man5/linsysfs.5.gz +OLD_FILES+=usr/share/man/man5/mqueuefs.5.gz +OLD_FILES+=usr/share/man/man5/msdosfs.5.gz +OLD_FILES+=usr/share/man/man5/msdos.5.gz +OLD_FILES+=usr/share/man/man5/nullfs.5.gz +OLD_FILES+=usr/share/man/man5/procfs.5.gz +OLD_FILES+=usr/share/man/man5/smbfs.5.gz +OLD_FILES+=usr/share/man/man5/tarfs.5.gz +OLD_FILES+=usr/share/man/man5/tmpfs.5.gz +OLD_FILES+=usr/share/man/man5/unionfs.5.gz +OLD_FILES+=usr/share/man/man7/ffs.7.gz + # 20240508: Remove remnants of portsnap(8) OLD_DIRS+=var/db/portsnap diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 8898a405ea49..82227eef5d50 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -134,7 +134,7 @@ OLD_FILES+=etc/rc.d/autounmountd OLD_FILES+=usr/sbin/automount OLD_FILES+=usr/sbin/automountd OLD_FILES+=usr/sbin/autounmountd -OLD_FILES+=usr/share/man/man5/autofs.5.gz +OLD_FILES+=usr/share/man/man5/autofs.4.gz OLD_FILES+=usr/share/man/man5/auto_master.5.gz OLD_FILES+=usr/share/man/man8/automount.8.gz OLD_FILES+=usr/share/man/man8/automountd.8.gz From nobody Thu May 16 16:52:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgGNt33Spz5LXJC; Thu, 16 May 2024 16:52: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 4VgGNt0nNXz4L24; Thu, 16 May 2024 16:52:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715878366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=88BcxvwkEaS4FCnXwxQ/ah406cRtfjdo/x+gTRyDeA0=; b=p9PYsOeVID5BEvaSMXJZrb/pHfoROV0/vcAEpi9tzba1o1cJ+04cub67nIJkjWx+K7U7Aj iIJPLT/qBhOKE/FtuFDknUSlK5wPkMQsYEQuQqtexAfmXzS6g4WAiXq1ZcpDEQwnqN6O/O r95MymJ6QE01wPjR8MBhLUy2/5vXL14wZwoaDhbghlTJbader4usepEINQKosL/DlzIguG p10yR1ig0vdSXRrRHCxAZbpvAvTx9xRhkO1sYEW7k3PIDsGO0oVFHUoAJenG3nnKOhoAHx IdtkHeI7AIyCGgabomj23+joDcs05j60R3eupmBkpBlCJSbvKuYjDXXz5q6JIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715878366; a=rsa-sha256; cv=none; b=P34mON9FG/XOtPr9CFhFDjhF8saQDT700tAn9T8CoPse0YheIGh1AxyNMhRWlEyN+My1pb HvQKmuXfyHyntNDGv7W7pRr6TmIvzCZSpPd6imbEnYMdjR9RGLjGanbDdC7Rge4jTAKQV4 ibWB01smDgnu4MWQ29Y4NxKtsM90Cb0uTKgbfT4BB9zRFHUEYgdFOLX0GIpIlMDED8ZmbT xs+Hr5k4bAgzS3SxChD50hScicxeLx2LI6wtLpbhdT7lhFktrWopg2UV4ggsJBGn2a73Np xPjm8k8q2ImYSSdqrjE2EqtlZx25GUycDxqkcOk18Mk4lD+ZN+u1lJfNMFkfBg== 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=1715878366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=88BcxvwkEaS4FCnXwxQ/ah406cRtfjdo/x+gTRyDeA0=; b=FloBwrZRDmNhi9AK51c8W9IPUP38gYrK41I15mLjE2Jl2Ip3wcmx66ZEHbDgbJD3AxTOmH 9bCl74Wcaqx+fU7N1HqUVpqL7owle+i93qK49T7HaSv+iHqPcZSQD7X2/Z8jotU73iUuSv p0e4iVVhrwXkasolwjqGo121ZcwEy2D82nbCVbC6rd5z8r89wNKc2R4pAuYqSa5MZgwiG5 sGeFjqhXT8AgYAypLMS572WBqaAU9xINN6sec3J9z1CsIZFE1zs183jGBJypv3zRqObvit 9ZFc5XcjT8KGQi2aE6DgPV7r80rg8JOKEGjiAmYFhPj56AZDrA5lkVCkPFmJbw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgGNt0PPgz16LK; Thu, 16 May 2024 16:52: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 44GGqjIx001423; Thu, 16 May 2024 16:52:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44GGqjNK001420; Thu, 16 May 2024 16:52:45 GMT (envelope-from git) Date: Thu, 16 May 2024 16:52:45 GMT Message-Id: <202405161652.44GGqjNK001420@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 1a720cbec513 - main - man filesystems: fix xrefs after move to section 4 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1a720cbec513210fa2e85c3882741ef2f6dc5f35 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1a720cbec513210fa2e85c3882741ef2f6dc5f35 commit 1a720cbec513210fa2e85c3882741ef2f6dc5f35 Author: Alexander Ziaee AuthorDate: 2024-05-15 18:59:50 +0000 Commit: Warner Losh CommitDate: 2024-05-16 16:25:29 +0000 man filesystems: fix xrefs after move to section 4 Reviewed by: des, imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1077 --- bin/ps/ps.1 | 2 +- contrib/pf/authpf/authpf.8 | 4 ++-- lib/geom/label/glabel.8 | 2 +- lib/libc/posix1e/posix1e.3 | 4 ++-- lib/libsys/execve.2 | 4 ++-- lib/libsys/i386/i386_set_watch.3 | 2 +- lib/libsys/mq_open.2 | 4 ++-- lib/libsys/mq_unlink.2 | 2 +- lib/libsys/open.2 | 2 +- lib/libsys/sendfile.2 | 4 ++-- lib/libsys/statfs.2 | 2 +- lib/libufs/libufs.3 | 2 +- sbin/devfs/devfs.8 | 8 ++++---- sbin/fsck_ffs/fsck_ffs.8 | 2 +- sbin/mdconfig/mdconfig.8 | 4 ++-- sbin/mdmfs/mdmfs.8 | 14 +++++++------- sbin/mknod/mknod.8 | 6 +++--- sbin/mount/mount.8 | 12 ++++++------ sbin/mount_cd9660/mount_cd9660.8 | 2 +- sbin/mount_msdosfs/mount_msdosfs.8 | 2 +- sbin/mount_nfs/mount_nfs.8 | 2 +- sbin/mount_nullfs/mount_nullfs.8 | 4 ++-- sbin/reboot/reboot.8 | 2 +- sbin/tunefs/tunefs.8 | 2 +- share/man/man3/makedev.3 | 2 +- share/man/man4/cd.4 | 2 +- share/man/man4/devfs.4 | 8 ++++---- share/man/man4/fd.4 | 10 +++++----- share/man/man4/fdescfs.4 | 2 +- share/man/man4/intro.4 | 8 ++++---- share/man/man4/kld.4 | 4 ++-- share/man/man4/lindebugfs.4 | 4 ++-- share/man/man4/linsysfs.4 | 4 ++-- share/man/man4/linux.4 | 20 ++++++++++---------- share/man/man4/mlx5io.4 | 2 +- share/man/man4/pcm.4 | 4 ++-- share/man/man5/devfs.conf.5 | 6 +++--- share/man/man5/devfs.rules.5 | 2 +- share/man/man5/fstab.5 | 2 +- share/man/man5/mount.conf.5 | 6 +++--- share/man/man7/hier.7 | 4 ++-- share/man/man7/tuning.7 | 2 +- share/man/man8/uefi.8 | 4 ++-- share/man/man9/DEVICE_ATTACH.9 | 4 ++-- share/man/man9/dev_clone.9 | 4 ++-- share/man/man9/dev_refthread.9 | 4 ++-- share/man/man9/devfs_set_cdevpriv.9 | 4 ++-- share/man/man9/disk.9 | 6 +++--- share/man/man9/g_provider.9 | 2 +- share/man/man9/make_dev.9 | 6 +++--- share/man/man9/pseudofs.9 | 10 +++++----- tools/build/options/WITHOUT_AUTOFS | 2 +- usr.bin/lsvfs/lsvfs.1 | 2 +- usr.bin/posixmqcontrol/posixmqcontrol.1 | 2 +- usr.sbin/autofs/auto_master.5 | 2 +- usr.sbin/autofs/automount.8 | 8 ++++---- usr.sbin/autofs/automountd.8 | 4 ++-- usr.sbin/extattrctl/extattrctl.8 | 2 +- usr.sbin/fstyp/fstyp.8 | 2 +- usr.sbin/jail/jail.8 | 16 ++++++++-------- usr.sbin/mlx5tool/mlx5tool.8 | 2 +- usr.sbin/snapinfo/snapinfo.8 | 2 +- 62 files changed, 137 insertions(+), 137 deletions(-) diff --git a/bin/ps/ps.1 b/bin/ps/ps.1 index 21def154ec00..bac86ad8a882 100644 --- a/bin/ps/ps.1 +++ b/bin/ps/ps.1 @@ -780,7 +780,7 @@ Display information on all system processes: .Xr strftime 3 , .Xr xo_parse_args 3 , .Xr mac 4 , -.Xr procfs 5 , +.Xr procfs 4 , .Xr pstat 8 , .Xr sysctl 8 , .Xr mutex 9 diff --git a/contrib/pf/authpf/authpf.8 b/contrib/pf/authpf/authpf.8 index ada4c6a5a11a..70b59ce212c8 100644 --- a/contrib/pf/authpf/authpf.8 +++ b/contrib/pf/authpf/authpf.8 @@ -44,7 +44,7 @@ It is meant to be used with users who can connect via only, and requires the .Xr pf 4 subsystem and an -.Xr fdescfs 5 +.Xr fdescfs 4 file system mounted at .Pa /dev/fd to be enabled. @@ -561,8 +561,8 @@ pass out on $internal_if from (self) to $workstation_ip port 3389 \e .It Pa /etc/authpf/authpf.problem .El .Sh SEE ALSO +.Xr fdescfs 4 , .Xr pf 4 , -.Xr fdescfs 5 , .Xr pf.conf 5 , .Xr securelevel 7 , .Xr ftp-proxy 8 diff --git a/lib/geom/label/glabel.8 b/lib/geom/label/glabel.8 index 6b089172348f..d6f253342905 100644 --- a/lib/geom/label/glabel.8 +++ b/lib/geom/label/glabel.8 @@ -255,7 +255,7 @@ providers implement a flag and a tunable variable named in the above format. This flag controls if the label provider will be active, tasting devices and creating label nodes in the -.Xr devfs 5 +.Xr devfs 4 tree. It is sometimes desirable to disable certain label types if they conflict with other classes in complex GEOM topologies. .El diff --git a/lib/libc/posix1e/posix1e.3 b/lib/libc/posix1e/posix1e.3 index 8eef3bb21724..1dbe12427da1 100644 --- a/lib/libc/posix1e/posix1e.3 +++ b/lib/libc/posix1e/posix1e.3 @@ -46,7 +46,7 @@ its interfaces are widely used. implements POSIX.1e interface for access control lists, described in .Xr acl 3 , and supports ACLs on the -.Xr ffs 7 +.Xr ffs 4 file system; ACLs must be administratively enabled using .Xr tunefs 8 . .Pp @@ -95,7 +95,7 @@ for mandatory access control labels. .Xr libcasper 3 , .Xr mac 3 , .Xr capsicum 4 , -.Xr ffs 7 , +.Xr ffs 4 , .Xr getfmac 8 , .Xr setfmac 8 , .Xr tunefs 8 , diff --git a/lib/libsys/execve.2 b/lib/libsys/execve.2 index 8fc1f2529197..5a35980e9555 100644 --- a/lib/libsys/execve.2 +++ b/lib/libsys/execve.2 @@ -325,9 +325,9 @@ argument is not a valid file descriptor open for executing. .Xr execl 3 , .Xr exit 3 , .Xr sysctl 3 , +.Xr fdescfs 4 , .Xr a.out 5 , .Xr elf 5 , -.Xr fdescfs 5 , .Xr environ 7 , .Xr mount 8 .Sh STANDARDS @@ -374,6 +374,6 @@ is the file descriptor passed in the argument to .Fn fexecve . For this construction to work correctly, the -.Xr fdescfs 5 +.Xr fdescfs 4 filesystem shall be mounted on .Pa /dev/fd . diff --git a/lib/libsys/i386/i386_set_watch.3 b/lib/libsys/i386/i386_set_watch.3 index 68c46e0ec081..265c21119c53 100644 --- a/lib/libsys/i386/i386_set_watch.3 +++ b/lib/libsys/i386/i386_set_watch.3 @@ -110,7 +110,7 @@ or is invalid. .Sh SEE ALSO .Xr ptrace 2 , -.Xr procfs 5 +.Xr procfs 4 .Sh AUTHORS This man page was written by .An Brian S. Dean . diff --git a/lib/libsys/mq_open.2 b/lib/libsys/mq_open.2 index 17e290e541ca..484fe95432da 100644 --- a/lib/libsys/mq_open.2 +++ b/lib/libsys/mq_open.2 @@ -223,7 +223,7 @@ and system calls are supported for message queue descriptor. .Pp Please see the -.Xr mqueuefs 5 +.Xr mqueuefs 4 man page for instructions on loading the module or compiling the service into the kernel. .Pp @@ -310,7 +310,7 @@ There is insufficient space for the creation of the new message queue. .Xr mq_unlink 2 , .Xr mq_timedreceive 3 , .Xr mq_timedsend 3 , -.Xr mqueuefs 5 +.Xr mqueuefs 4 .Sh STANDARDS The .Fn mq_open diff --git a/lib/libsys/mq_unlink.2 b/lib/libsys/mq_unlink.2 index 07f0364abe00..1bc74b85524f 100644 --- a/lib/libsys/mq_unlink.2 +++ b/lib/libsys/mq_unlink.2 @@ -90,7 +90,7 @@ a pathname component is longer than .It Bq Er ENOENT The message queue does not exist. .It Bq Er ENOSYS -.Xr mqueuefs 5 +.Xr mqueuefs 4 module is neither loaded nor included in the kernel. .El .Sh SEE ALSO diff --git a/lib/libsys/open.2 b/lib/libsys/open.2 index aac3ef1318f8..be164aae1834 100644 --- a/lib/libsys/open.2 +++ b/lib/libsys/open.2 @@ -384,7 +384,7 @@ The file pointer used to mark the current position within the file is set to the beginning of the file. .Pp If a sleeping open of a device node from -.Xr devfs 5 +.Xr devfs 4 is interrupted by a signal, the call always fails with .Er EINTR , even if the diff --git a/lib/libsys/sendfile.2 b/lib/libsys/sendfile.2 index 3ffbd733494d..07a563d5ef82 100644 --- a/lib/libsys/sendfile.2 +++ b/lib/libsys/sendfile.2 @@ -126,7 +126,7 @@ Starting with .Fx 11 .Nm sending files off the -.Xr ffs 7 +.Xr ffs 4 filesystem does not block on I/O (see .Sx IMPLEMENTATION NOTES @@ -209,7 +209,7 @@ The implementation of .Fn sendfile does not block on disk I/O when it sends a file off the -.Xr ffs 7 +.Xr ffs 4 filesystem. The syscall returns success before the actual I/O completes, and data is put into the socket later unattended. diff --git a/lib/libsys/statfs.2 b/lib/libsys/statfs.2 index 561774f686d8..50809869a022 100644 --- a/lib/libsys/statfs.2 +++ b/lib/libsys/statfs.2 @@ -107,7 +107,7 @@ All I/O to the file system is done synchronously. No file system I/O is done synchronously. .It Dv MNT_SOFTDEP Soft updates being done (see -.Xr ffs 7 ) . +.Xr ffs 4 ) . .It Dv MNT_GJOURNAL Journaling with gjournal is enabled (see .Xr gjournal 8 ) . diff --git a/lib/libufs/libufs.3 b/lib/libufs/libufs.3 index 9547396249de..aa3386ad9771 100644 --- a/lib/libufs/libufs.3 +++ b/lib/libufs/libufs.3 @@ -70,7 +70,7 @@ to a string describing the error. .Xr ufs_disk_fillout 3 , .Xr ufs_disk_fillout_blank 3 , .Xr ufs_disk_write 3 , -.Xr ffs 7 +.Xr ffs 4 .Sh HISTORY The .Xr libufs 3 diff --git a/sbin/devfs/devfs.8 b/sbin/devfs/devfs.8 index 598f2303a605..bbe4825b8bb2 100644 --- a/sbin/devfs/devfs.8 +++ b/sbin/devfs/devfs.8 @@ -38,7 +38,7 @@ The .Nm utility provides an interface to manipulate properties of -.Xr devfs 5 +.Xr devfs 4 mounts. .Pp The rules, by default as configured by @@ -64,7 +64,7 @@ The following flags are common to all keywords: Operate on .Ar mount-point , which is expected to be a -.Xr devfs 5 +.Xr devfs 4 mount. If this option is not specified, .Nm @@ -73,7 +73,7 @@ operates on .El .Ss Rule Subsystem The -.Xr devfs 5 +.Xr devfs 4 rule subsystem provides a way for the administrator of a system to control the attributes of DEVFS nodes. .\" XXX devfs node? entry? what? @@ -372,7 +372,7 @@ this feature can be used to copy rulesets: .Xr chmod 1 , .Xr jail 2 , .Xr glob 3 , -.Xr devfs 5 , +.Xr devfs 4 , .Xr devfs.conf 5 , .Xr devfs.rules 5 , .Xr chown 8 , diff --git a/sbin/fsck_ffs/fsck_ffs.8 b/sbin/fsck_ffs/fsck_ffs.8 index 1eb9ebeb3b9b..8df5e684b963 100644 --- a/sbin/fsck_ffs/fsck_ffs.8 +++ b/sbin/fsck_ffs/fsck_ffs.8 @@ -421,9 +421,9 @@ are fully enumerated and explained in Appendix A of .%T "Fsck \- The UNIX File System Check Program" .Re .Sh SEE ALSO +.Xr ffs 4 , .Xr fs 5 , .Xr fstab 5 , -.Xr ffs 7 , .Xr fsck 8 , .Xr fsdb 8 , .Xr newfs 8 , diff --git a/sbin/mdconfig/mdconfig.8 b/sbin/mdconfig/mdconfig.8 index 938d6ddf12b0..73d4b30aac35 100644 --- a/sbin/mdconfig/mdconfig.8 +++ b/sbin/mdconfig/mdconfig.8 @@ -333,7 +333,7 @@ mdconfig -rs 2g -u md3 .Ed .Pp Create a 1 gigabyte swap backed disk, initialize an -.Xr ffs 7 +.Xr ffs 4 file system on it, and mount it on .Pa /tmp : .Bd -literal -offset indent @@ -366,8 +366,8 @@ mount /dev/md1.nop /mnt .Xr fpathconf 2 , .Xr fspacectl 2 , .Xr open 2 , +.Xr ffs 4 , .Xr md 4 , -.Xr ffs 7 , .Xr gpart 8 , .Xr mdmfs 8 , .Xr malloc 9 , diff --git a/sbin/mdmfs/mdmfs.8 b/sbin/mdmfs/mdmfs.8 index 50819bfee0c6..ff5b78068299 100644 --- a/sbin/mdmfs/mdmfs.8 +++ b/sbin/mdmfs/mdmfs.8 @@ -32,7 +32,7 @@ .Nd configure and mount an in-memory file system using the .Xr md 4 driver or the -.Xr tmpfs 5 +.Xr tmpfs 4 filesystem .Sh SYNOPSIS .Nm @@ -69,7 +69,7 @@ Based on the .Nm utility either creates a -.Xr tmpfs 5 +.Xr tmpfs 4 filesystem, or it configures an .Xr md 4 disk using @@ -91,7 +91,7 @@ When is `auto', .Nm uses -.Xr tmpfs 5 +.Xr tmpfs 4 if it is present in the kernel or can be loaded as a module, otherwise it falls back to using .Xr md 4 @@ -102,14 +102,14 @@ When is `tmpfs', .Nm mounts a -.Xr tmpfs 5 +.Xr tmpfs 4 filesystem, translating the .Fl s size option, if present, into a `-o size=' mount option. Any .Fl o options on the command line are passed through to the -.Xr tmpfs 5 +.Xr tmpfs 4 mount. Options specific to .Xr mdconfig 8 @@ -120,7 +120,7 @@ are ignored. When .Ar md-device does not result in -.Xr tmpfs 5 +.Xr tmpfs 4 being used, then an .Xr md 4 device is configured instead. @@ -435,8 +435,8 @@ was given on the command line. .El .Sh SEE ALSO .Xr md 4 , +.Xr tmpfs 4 , .Xr fstab 5 , -.Xr tmpfs 5 , .Xr mdconfig 8 , .Xr mount 8 , .Xr newfs 8 diff --git a/sbin/mknod/mknod.8 b/sbin/mknod/mknod.8 index 99337bd34767..fc562e76f0db 100644 --- a/sbin/mknod/mknod.8 +++ b/sbin/mknod/mknod.8 @@ -107,7 +107,7 @@ will cause the number to be interpreted as octal. The .Nm utility can be used to recreate deleted device nodes under a -.Xr devfs 5 +.Xr devfs 4 mount point by invoking it with only a filename as an argument. Example: .Pp @@ -129,7 +129,7 @@ devices. As of .Fx 5.0 , device nodes are managed by the device file system -.Xr devfs 5 , +.Xr devfs 4 , making the .Nm utility superfluous. @@ -140,7 +140,7 @@ nodes cannot be used to access devices. .Sh SEE ALSO .Xr mkfifo 1 , .Xr mknod 2 , -.Xr devfs 5 , +.Xr devfs 4 , .Xr chown 8 .Sh HISTORY A diff --git a/sbin/mount/mount.8 b/sbin/mount/mount.8 index e8e604ba4088..ac04ba409ec6 100644 --- a/sbin/mount/mount.8 +++ b/sbin/mount/mount.8 @@ -565,14 +565,14 @@ support for a particular file system might be provided either on a static .Xr getmntinfo 3 , .Xr libxo 3 , .Xr xo_parse_args 3 , +.Xr cd9660 4 , +.Xr devfs 4 , +.Xr ext2fs 4 , .Xr mac 4 , -.Xr cd9660 5 , -.Xr devfs 5 , -.Xr ext2fs 5 , +.Xr procfs 4 , +.Xr tarfs 4 , +.Xr tmpfs 4 , .Xr fstab 5 , -.Xr procfs 5 , -.Xr tarfs 5 , -.Xr tmpfs 5 , .Xr automount 8 , .Xr fstyp 8 , .Xr kldload 8 , diff --git a/sbin/mount_cd9660/mount_cd9660.8 b/sbin/mount_cd9660/mount_cd9660.8 index d2cdd2f3ef20..017ad7ee9a11 100644 --- a/sbin/mount_cd9660/mount_cd9660.8 +++ b/sbin/mount_cd9660/mount_cd9660.8 @@ -170,7 +170,7 @@ The following command can be used to mount a Kodak Photo-CD: .Xr cdcontrol 1 , .Xr mount 2 , .Xr unmount 2 , -.Xr cd9660 5 , +.Xr cd9660 4 , .Xr fstab 5 , .Xr mdconfig 8 , .Xr mount 8 diff --git a/sbin/mount_msdosfs/mount_msdosfs.8 b/sbin/mount_msdosfs/mount_msdosfs.8 index 94532cafb543..3a97089e220c 100644 --- a/sbin/mount_msdosfs/mount_msdosfs.8 +++ b/sbin/mount_msdosfs/mount_msdosfs.8 @@ -179,8 +179,8 @@ To mount a Japanese MS-DOS file system located in .Sh SEE ALSO .Xr mount 2 , .Xr unmount 2 , +.Xr msdosfs 4 , .Xr fstab 5 , -.Xr msdosfs 5 , .Xr mount 8 .Pp List of Localized MS Operating Systems: diff --git a/sbin/mount_nfs/mount_nfs.8 b/sbin/mount_nfs/mount_nfs.8 index 3ef622a96dc0..13f0608ccad9 100644 --- a/sbin/mount_nfs/mount_nfs.8 +++ b/sbin/mount_nfs/mount_nfs.8 @@ -648,7 +648,7 @@ named options are equivalent to other .Fl o named options and are supported for compatibility with other operating systems (e.g., Linux, Solaris, and OSX) to ease usage of -.Xr autofs 5 +.Xr autofs 4 support. .Bl -tag -width indent .It Fl o Cm vers Ns = Ns 2 diff --git a/sbin/mount_nullfs/mount_nullfs.8 b/sbin/mount_nullfs/mount_nullfs.8 index 8638c25c0610..17b1f45f5e42 100644 --- a/sbin/mount_nullfs/mount_nullfs.8 +++ b/sbin/mount_nullfs/mount_nullfs.8 @@ -45,7 +45,7 @@ The .Nm utility creates a -.Xr nullfs 5 +.Xr nullfs 4 layer, duplicating a sub-tree of the file system name space under another part of the global file system namespace. This allows existing files and directories to be accessed @@ -257,7 +257,7 @@ is that vnode arguments must be manually mapped. .\" .\" .Sh SEE ALSO -.Xr nullfs 5 , +.Xr nullfs 4 , .Xr mount 8 .Pp UCLA Technical Report CSD-910056, diff --git a/sbin/reboot/reboot.8 b/sbin/reboot/reboot.8 index ed055327b36a..59cbd9de7519 100644 --- a/sbin/reboot/reboot.8 +++ b/sbin/reboot/reboot.8 @@ -175,7 +175,7 @@ After changing vfs.root.mountfrom with .Nm Fl r can be used to change the root filesystem while preserving kernel state. This requires the -.Xr tmpfs 5 +.Xr tmpfs 4 kernel module to be loaded because .Xr init 8 needs a place to store itself after the old root is unmounted, but diff --git a/sbin/tunefs/tunefs.8 b/sbin/tunefs/tunefs.8 index 97de1abf33c0..0fb11041d97d 100644 --- a/sbin/tunefs/tunefs.8 +++ b/sbin/tunefs/tunefs.8 @@ -215,8 +215,8 @@ read this to determine the device file for a specified mount point. .El .Sh SEE ALSO +.Xr ffs 4 , .Xr fs 5 , -.Xr ffs 7 , .Xr tuning 7 , .Xr dumpfs 8 , .Xr gjournal 8 , diff --git a/share/man/man3/makedev.3 b/share/man/man3/makedev.3 index 4cf851f87508..3c0e176a0621 100644 --- a/share/man/man3/makedev.3 +++ b/share/man/man3/makedev.3 @@ -97,4 +97,4 @@ macros return numbers whose value can span the complete range of an .Sh SEE ALSO .Xr mknod 2 , .Xr devname 3 , -.Xr devfs 5 +.Xr devfs 4 diff --git a/share/man/man4/cd.4 b/share/man/man4/cd.4 index 7c3fa6ed9850..b05e486af6b6 100644 --- a/share/man/man4/cd.4 +++ b/share/man/man4/cd.4 @@ -335,9 +335,9 @@ devices .Sh DIAGNOSTICS None. .Sh SEE ALSO +.Xr cd9660 4 , .Xr cam 4 , .Xr da 4 , -.Xr cd9660 5 , .Xr disklabel 8 , .Xr cd 9 .Sh HISTORY diff --git a/share/man/man4/devfs.4 b/share/man/man4/devfs.4 index c90835570127..3022a23dfe9a 100644 --- a/share/man/man4/devfs.4 +++ b/share/man/man4/devfs.4 @@ -65,13 +65,13 @@ tool can be used to recover deleted device entries under .Nm . .Pp The -.Xr fdescfs 5 +.Xr fdescfs 4 filesystem is an alternate means for populating .Pa /dev/fd . The character devices that both .Nm and -.Xr fdescfs 5 +.Xr fdescfs 4 present in .Pa /dev/fd correspond to the open file descriptors of the process @@ -82,7 +82,7 @@ only creates files for the standard file descriptors .Pa 1 and .Pa 2 . -.Xr fdescfs 5 +.Xr fdescfs 4 creates files for all open descriptors. .Pp The options are as follows: @@ -123,7 +123,7 @@ volume located on .Pp .Dl "mount -t devfs devfs /mychroot/dev" .Sh SEE ALSO -.Xr fdescfs 5 , +.Xr fdescfs 4 , .Xr devfs 8 , .Xr mount 8 , .Xr make_dev 9 diff --git a/share/man/man4/fd.4 b/share/man/man4/fd.4 index f91c0e0501fb..06cc12d25696 100644 --- a/share/man/man4/fd.4 +++ b/share/man/man4/fd.4 @@ -78,11 +78,11 @@ are ignored. By default, .Pa /dev/fd is provided by -.Xr devfs 5 , +.Xr devfs 4 , which provides nodes for the first three file descriptors. Some sites may require nodes for additional file descriptors; these can be made available by mounting -.Xr fdescfs 5 +.Xr fdescfs 4 on .Pa /dev/fd . .Sh FILES @@ -93,6 +93,6 @@ on .It Pa /dev/stderr .El .Sh SEE ALSO -.Xr tty 4 , -.Xr devfs 5 , -.Xr fdescfs 5 +.Xr devfs 4 , +.Xr fdescfs 4 , +.Xr tty 4 diff --git a/share/man/man4/fdescfs.4 b/share/man/man4/fdescfs.4 index 4b51c2bad369..b050f024ac40 100644 --- a/share/man/man4/fdescfs.4 +++ b/share/man/man4/fdescfs.4 @@ -196,7 +196,7 @@ flag use: .Pp .Dl "mount -t fdescfs -o nodup none /dev/fdpath" .Sh SEE ALSO -.Xr devfs 5 , +.Xr devfs 4 , .Xr mount 8 .Sh HISTORY The diff --git a/share/man/man4/intro.4 b/share/man/man4/intro.4 index 9b22e89ff6c3..e4caf6690efb 100644 --- a/share/man/man4/intro.4 +++ b/share/man/man4/intro.4 @@ -77,7 +77,7 @@ are accessed through sometimes also called .Em special files . They are located within instances of the -.Xr devfs 5 +.Xr devfs 4 filesystem, which is conventionally mounted on the directory .Pa /dev in the file system hierarchy @@ -85,7 +85,7 @@ in the file system hierarchy .Xr hier 7 ) . .Pp The -.Xr devfs 5 +.Xr devfs 4 filesystem creates or removes device nodes automatically according to the physical hardware recognized as present at any given time. For pseudo-devices, device nodes may be created and removed dynamically @@ -104,7 +104,7 @@ or set using the command. In the latter case, different rules may be used to make different sets of devices visible within different instances of the -.Xr devfs 5 +.Xr devfs 4 filesystem, which may be used, for example, to prevent jailed subsystems from accessing unsafe devices. Manual changes to device @@ -200,7 +200,7 @@ device. .Xr select 2 , .Xr socket 2 , .Xr write 2 , -.Xr devfs 5 , +.Xr devfs 4 , .Xr hier 7 , .Xr config 8 .Sh HISTORY diff --git a/share/man/man4/kld.4 b/share/man/man4/kld.4 index bba32f02e677..e0186dec9ccc 100644 --- a/share/man/man4/kld.4 +++ b/share/man/man4/kld.4 @@ -96,7 +96,7 @@ drivers may be loaded into the system with .Nm . Device nodes for the loaded drivers are automatically created when a module is loaded and destroyed when it is unloaded by -.Xr devfs 5 . +.Xr devfs 4 . You can specify userland programs that will run when new devices become available as a result of loading modules, or existing devices go away when modules are unloaded, by configuring @@ -121,7 +121,7 @@ example source code implementing a sample kld module .Xr kldnext 2 , .Xr kldstat 2 , .Xr kldunload 2 , -.Xr devfs 5 , +.Xr devfs 4 , .Xr devd 8 , .Xr kldload 8 , .Xr kldstat 8 , diff --git a/share/man/man4/lindebugfs.4 b/share/man/man4/lindebugfs.4 index d78a12c44714..25a398a93f22 100644 --- a/share/man/man4/lindebugfs.4 +++ b/share/man/man4/lindebugfs.4 @@ -77,8 +77,8 @@ file system on .Pp .Dl "mount -t lindebugfs lindebugfs /sys/kernel/debug" .Sh SEE ALSO -.Xr linprocfs 5 , -.Xr linsysfs 5 , +.Xr linprocfs 4 , +.Xr linsysfs 4 , .Xr pseudofs 9 , .Xr linux 4 , .Xr mount 1 diff --git a/share/man/man4/linsysfs.4 b/share/man/man4/linsysfs.4 index 64270fe753d4..12729a814085 100644 --- a/share/man/man4/linsysfs.4 +++ b/share/man/man4/linsysfs.4 @@ -74,8 +74,8 @@ is a mount point. .Sh SEE ALSO .Xr nmount 2 , .Xr unmount 2 , +.Xr linprocfs 4 , .Xr linux 4 , -.Xr linprocfs 5 , .Xr pseudofs 9 .Sh HISTORY The @@ -93,6 +93,6 @@ by This manual page was edited by .An Doug Ambrisko , based on the -.Xr linprocfs 5 +.Xr linprocfs 4 manual page by .An Garrett Wollman . diff --git a/share/man/man4/linux.4 b/share/man/man4/linux.4 index 0efc469985f9..a50e1513ba43 100644 --- a/share/man/man4/linux.4 +++ b/share/man/man4/linux.4 @@ -156,30 +156,30 @@ Defaults to 0. Linux run-time environment .It Pa /compat/linux/dev device file system, see -.Xr devfs 5 +.Xr devfs 4 .It Pa /compat/linux/dev/fd file descriptor file system mounted with the .Cm linrdlnk option, see -.Xr fdescfs 5 +.Xr fdescfs 4 .It Pa /compat/linux/dev/shm in-memory file system, see -.Xr tmpfs 5 +.Xr tmpfs 4 .It Pa /compat/linux/proc Linux process file system, see -.Xr linprocfs 5 +.Xr linprocfs 4 .It Pa /compat/linux/sys Linux kernel objects file system, see -.Xr linsysfs 5 +.Xr linsysfs 4 .El .Sh SEE ALSO .Xr brandelf 1 , +.Xr fdescfs 4 , +.Xr linprocfs 4 , +.Xr linsysfs 4 , .Xr pty 4 , -.Xr elf 5 , -.Xr fdescfs 5 , -.Xr linprocfs 5 , -.Xr linsysfs 5 , -.Xr tmpfs 5 +.Xr tmpfs 4 , +.Xr elf 5 .Sh HISTORY Linux ABI support first appeared for i386 in .Fx 2.1 . diff --git a/share/man/man4/mlx5io.4 b/share/man/man4/mlx5io.4 index 66a767d97d31..ebfbb41a0823 100644 --- a/share/man/man4/mlx5io.4 +++ b/share/man/man4/mlx5io.4 @@ -172,7 +172,7 @@ field reports the third page validity. .Sh FILES The .Pa /dev/mlx5ctl -.Xr devfs 5 +.Xr devfs 4 node is used to pass commands to the driver. .Sh RETURN VALUES If successful, the IOCTL returns zero. diff --git a/share/man/man4/pcm.4 b/share/man/man4/pcm.4 index 5fcaca7220b9..769f562fe91e 100644 --- a/share/man/man4/pcm.4 +++ b/share/man/man4/pcm.4 @@ -285,7 +285,7 @@ Use the most recently attached device. .It Va hw.snd.default_unit Default sound card for systems with multiple sound cards. When using -.Xr devfs 5 , +.Xr devfs 4 , the default device for .Pa /dev/dsp . Equivalent to a symlink from @@ -597,6 +597,7 @@ or outgoing (record) data. A device node is not created properly. .El .Sh SEE ALSO +.Xr devfs 4 , .Xr snd_ai2s 4 , .Xr snd_als4000 4 , .Xr snd_atiixp 4 , @@ -623,7 +624,6 @@ A device node is not created properly. .Xr snd_via8233 4 , .Xr snd_via82c686 4 , .Xr snd_vibes 4 , -.Xr devfs 5 , .Xr device.hints 5 , .Xr loader.conf 5 , .Xr dmesg 8 , diff --git a/share/man/man5/devfs.conf.5 b/share/man/man5/devfs.conf.5 index e95c7b578bf5..f7141b76c3f6 100644 --- a/share/man/man5/devfs.conf.5 +++ b/share/man/man5/devfs.conf.5 @@ -54,7 +54,7 @@ The action to take for the device. The action names are only significant to the first unique character. .It Ar devname The name of the device created by -.Xr devfs 5 . +.Xr devfs 4 . .It Ar arg The argument of the .Ar action . @@ -68,7 +68,7 @@ This action creates a symbolic link named that points to .Ar devname , the name of the device created by -.Xr devfs 5 . +.Xr devfs 4 . .It Ic own This action changes the ownership of .Ar devname . @@ -118,8 +118,8 @@ perm cd0 0660 .Ed .Sh SEE ALSO .Xr chmod 1 , +.Xr devfs 4 , .Xr devd.conf 5 , -.Xr devfs 5 , .Xr devfs.rules 5 , .Xr chown 8 .Sh AUTHORS diff --git a/share/man/man5/devfs.rules.5 b/share/man/man5/devfs.rules.5 index 368a7696b5cd..e878c2a97738 100644 --- a/share/man/man5/devfs.rules.5 +++ b/share/man/man5/devfs.rules.5 @@ -124,7 +124,7 @@ group, a similar rule may be used: .Dl "add path 'usb/*' mode 0660 group usb" .Sh SEE ALSO .Xr glob 3 , -.Xr devfs 5 , +.Xr devfs 4 , .Xr devfs.conf 5 , .Xr devfs 8 , .Xr service 8 diff --git a/share/man/man5/fstab.5 b/share/man/man5/fstab.5 index 9cdcf818cf32..787fe3933aca 100644 --- a/share/man/man5/fstab.5 +++ b/share/man/man5/fstab.5 @@ -113,7 +113,7 @@ flag. Other options need both the file system specific flag and its argument, separated by an equal sign. For example, mounting an -.Xr msdosfs 5 +.Xr msdosfs 4 filesystem, the options .Bd -literal -offset indent -o sync -o noatime -m 644 -M 755 -u foo -g bar diff --git a/share/man/man5/mount.conf.5 b/share/man/man5/mount.conf.5 index 633a642e37be..4b5c272ef601 100644 --- a/share/man/man5/mount.conf.5 +++ b/share/man/man5/mount.conf.5 @@ -50,7 +50,7 @@ The logic for this is in .Fn vfs_mountroot_conf0 . .It The kernel will first mount -.Xr devfs 5 +.Xr devfs 4 as the root file system. .It Next, the kernel will parse the in-memory config file created in step 1 @@ -60,7 +60,7 @@ See for the format of the config file. .It When the actual root file system is mounted, -.Xr devfs 5 +.Xr devfs 4 will be re-mounted on the .Pa /dev directory. @@ -221,7 +221,7 @@ For each root file system which is mounted, a directory .Em must exist so that the root mount logic can properly re-mount -.Xr devfs 5 . +.Xr devfs 4 . If this directory does not exist, the system may hang during the bootup process. .Sh SEE ALSO diff --git a/share/man/man7/hier.7 b/share/man/man7/hier.7 index 7d164b5683d6..e0a6ff3dfefc 100644 --- a/share/man/man7/hier.7 +++ b/share/man/man7/hier.7 @@ -128,7 +128,7 @@ compatibility run-time device nodes and special files; see .Xr intro 4 and -.Xr devfs 5 +.Xr devfs 4 .Pp .Bl -tag -width "loader.conf.d" -compact .It Pa ada0 @@ -365,7 +365,7 @@ that need no home directory; see also .Pa /var/empty/ .It Pa /proc/ process file system; see -.Xr procfs 5 +.Xr procfs 4 .It Pa /rescue/ statically linked programs for emergency recovery; see .Xr rescue 8 diff --git a/share/man/man7/tuning.7 b/share/man/man7/tuning.7 index f04500d0f0dc..caa1efb7d450 100644 --- a/share/man/man7/tuning.7 +++ b/share/man/man7/tuning.7 @@ -695,10 +695,10 @@ over services you export from your box (web services, email). .Xr ata 4 , .Xr dummynet 4 , .Xr eventtimers 4 , +.Xr ffs 4 , .Xr login.conf 5 , .Xr rc.conf 5 , .Xr sysctl.conf 5 , -.Xr ffs 7 , *** 416 LINES SKIPPED *** From nobody Thu May 16 17:11:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgGpL1fdtz5LYY3; Thu, 16 May 2024 17:11: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 4VgGpL0tFgz4N1J; Thu, 16 May 2024 17:11:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715879482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Nyy4qZjxJ8e/1Nmhdq9W7LLHt1fCAaU6S0IFau56C5g=; b=jKVppLBIana2fEo1Ovh1MFU4ixvT8R04+L4Zg/bKLuZOzPuiP9TEFOYe+KMdGiQw347tsP l1wyDaP1E2GcjG3j5PmtLX4SnnhKgREGn6IGTVmRUYR0KI4s2m5OGHSD9hT+H6e2ETGiwF a3xTmvr8KvWfc7QMOl+pzq1CS1FkWJGmn8uyywMDP8FJ5f7OR+GpCJtjhGFbCy176qyYWy PKkDr33wn6BJE0O3ICLO5+gdGiYNGhqS8f2jpP9n0A4/IQHPHA8RX4hdXiMnCNbX6tYwNE 82fSl2VnGa+HAUvsmAU/1Qpkat3a7WDMxcTv0e5oAYwAWl/aGZXyMp6Bf4wfdw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715879482; a=rsa-sha256; cv=none; b=asdpyEwIFsjtze6rTzUlnbXHMQhuYFI8gzqQdVr1kyruCJ5xVagTZLrCl8sd/FOltTTTXk YcXM7MZuLQDjKB9QD08kCCSdWXIRSA1UGmv1Nu323qnIuNTiFzqoXWLcDwoclOSJsTBiYl as/GN11PTkcdLeLO5eAvrNWYE7uJlrXr6Brlve1ROjp7heMzr+dyUvlHAIAxJGSc3+A3Vd 0329vL+XCDdhwSmAYNovGi74ffubi0Ita7eGna40d/L4rbqQPFt91B76zg35jaV92S5V8A VbCZrEK70wZdqY7ccxsuyM8+DjmHgqHBlRv+wf6z7FQGz9Zt/GspayLpMS7big== 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=1715879482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Nyy4qZjxJ8e/1Nmhdq9W7LLHt1fCAaU6S0IFau56C5g=; b=tKzeWKvX5ldfjCx6UyEyBvrfclwlXPrfO9PvPTjYxbxB7JhYBJLpa5rakvmVLAY9NpdI1n CcjatIalINd+SWIOhZXx8+sKIRBHDxe4wKCN1kHFoyPXMfWVdCucxD++t+0+m3zxLZ6MVa NRcsemJaYQYXeEkSveiKFm+M+ewOOXz8QCpNUyIS43zckkcLDntrPeqea+lZ8+AEHxUp71 fHolYc6NHU/qY+d7yiWWAp876EvK6DIJz9KAzmoT8vP/p3RvP6+cNqOq2gE9qex4+ukueZ 2blHk5xFMFi4RAUAdAj1JpExgirOPQjgjpM74fXK7lIz18Wr0M+KJ5GIJa4aQQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgGpL0Tmhz16pY; Thu, 16 May 2024 17:11:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44GHBL6Q034169; Thu, 16 May 2024 17:11:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44GHBL2O034166; Thu, 16 May 2024 17:11:21 GMT (envelope-from git) Date: Thu, 16 May 2024 17:11:21 GMT Message-Id: <202405161711.44GHBL2O034166@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: d33b87e8cf91 - main - netstat(1): increase width of Netif column List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d33b87e8cf91a6bcb5eac0ecc0371c1041c61050 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d33b87e8cf91a6bcb5eac0ecc0371c1041c61050 commit d33b87e8cf91a6bcb5eac0ecc0371c1041c61050 Author: Lexi Winter AuthorDate: 2024-05-08 09:44:29 +0000 Commit: Warner Losh CommitDate: 2024-05-16 17:07:34 +0000 netstat(1): increase width of Netif column The previous width of Netif (10 or 8) was too short for modern interface names; make it 12, which is long enough to display "epair0a.1000". This came up in practice with genet(4) interfaces, since the base interface name is long enough that with the previous limit, VLAN identifiers would be truncated at 1 character in the IPv6 output: "genet0.100" becomes "genet0.1". The width is now fixed, and doesn't depend on the address family, because there's no reason that length of the interface name would vary based on the AF. Reviewed by: imp,zlei,Mina Galić Pull Request: https://github.com/freebsd/freebsd-src/pull/1223 --- usr.bin/netstat/nhops.c | 5 ++--- usr.bin/netstat/route.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/usr.bin/netstat/nhops.c b/usr.bin/netstat/nhops.c index f4c76f54a420..1db3c2d37167 100644 --- a/usr.bin/netstat/nhops.c +++ b/usr.bin/netstat/nhops.c @@ -64,16 +64,15 @@ #include "common.h" /* column widths; each followed by one space */ +#define WID_IF_DEFAULT 12 /* width of netif column */ #ifndef INET6 #define WID_DST_DEFAULT(af) 18 /* width of destination column */ #define WID_GW_DEFAULT(af) 18 /* width of gateway column */ -#define WID_IF_DEFAULT(af) (Wflag ? 10 : 8) /* width of netif column */ #else #define WID_DST_DEFAULT(af) \ ((af) == AF_INET6 ? (numeric_addr ? 33: 18) : 18) #define WID_GW_DEFAULT(af) \ ((af) == AF_INET6 ? (numeric_addr ? 29 : 18) : 18) -#define WID_IF_DEFAULT(af) ((af) == AF_INET6 ? 8 : (Wflag ? 10 : 8)) #endif /*INET6*/ static int wid_dst; static int wid_gw; @@ -415,7 +414,7 @@ print_nhops_sysctl(int fibnum, int af) wid_flags = 6; wid_pksent = 8; wid_mtu = 6; - wid_if = WID_IF_DEFAULT(fam); + wid_if = WID_IF_DEFAULT; xo_open_instance("rt-family"); pr_family(fam); xo_open_list("nh-entry"); diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c index 6152cbdc859f..93e882052de2 100644 --- a/usr.bin/netstat/route.c +++ b/usr.bin/netstat/route.c @@ -184,16 +184,15 @@ pr_family(int af1) } /* column widths; each followed by one space */ +#define WID_IF_DEFAULT 12 /* width of netif column */ #ifndef INET6 #define WID_DST_DEFAULT(af) 18 /* width of destination column */ #define WID_GW_DEFAULT(af) 18 /* width of gateway column */ -#define WID_IF_DEFAULT(af) (Wflag ? 10 : 8) /* width of netif column */ #else #define WID_DST_DEFAULT(af) \ ((af) == AF_INET6 ? (numeric_addr ? 33: 18) : 18) #define WID_GW_DEFAULT(af) \ ((af) == AF_INET6 ? (numeric_addr ? 29 : 18) : 18) -#define WID_IF_DEFAULT(af) ((af) == AF_INET6 ? 8 : (Wflag ? 10 : 8)) #endif /*INET6*/ struct _wid wid; @@ -234,7 +233,7 @@ set_wid(int fam) wid.flags = 6; wid.pksent = 8; wid.mtu = 6; - wid.iface = WID_IF_DEFAULT(fam); + wid.iface = WID_IF_DEFAULT; wid.expire = 6; } From nobody Thu May 16 17:11:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgGpM2B4Sz5LYQY; Thu, 16 May 2024 17:11:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgGpM1MPSz4NHc; Thu, 16 May 2024 17:11:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715879483; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VDj42nhnlH0PhXGcpaBhZ6AHosQMRSymKbQSopn1kpU=; b=uh+GSXMF/PTW/4ZpMGcLQZY2FJKtKtZ5QGgAernxzI3zQ0SUNVdiuolEIiua+llsDqa8qJ HQ+GFyvV5ozLsklOleH68buxAGV8jA9/R7nHh0cz8lEqYtq+xZuK5/87G3ZSiCWibyYfRf Q6/mx7qlq/i0ibTCNKLtOVSOch+QdgNgB0nxSoungpL6P0KlBcUO/3hfcHXFCTrllQpBpq cCSQ9xj1t2i0hpG7xAaIPGeXRVSRT50vl4TgEfk4ApGjE74IbmuMwwEOVPkFzqxG30ezt5 myQ7ldUQPTxW0IL10ghHplyauydGozoZnCJbvbvWTS24TbkM78yJvz591C8ckw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715879483; a=rsa-sha256; cv=none; b=DyEpqbOQvqshMAmDJ5UJ9lGQY8p/RknAL/l0Up960SiGmK+pVtLjtJ645ikUVp8F2CJh7l pI8OSlmHY66QvqC5GZAEp8VLQTMnqMaMr85WxuRtxDAE+/KO6jNe6HqDtmHLBEO5ugn54r XSAXHwdHuuXXBiX6S1e1zJIpst0n44GndsetbBa8h3H5MS8PD7GZ/mYEzccr4U9QNGbL6u vCErvStSHrr7arr6aIoo0bVV+EbWBXCrgMqX4DEtqex2k12sfO4KvSTjtlkCJyzxMOIwz+ gIP1oPUqVztqobTwIE4Y0RSVpdHnL8XlRJpUzRJMP1HEYqMRtMbIXJbH79aVWw== 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=1715879483; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VDj42nhnlH0PhXGcpaBhZ6AHosQMRSymKbQSopn1kpU=; b=w+nkU8kOp6I7XcrNoyiIyOBRaNSIvLv9y8Uqrr91OyMWNWBUoN/e04AaI9y8p2m3igtweb ZI978aV7EwJ8Jps+q8TkA/j8MxJkiYFXZrItdlyn8N/HKe4zCeJFpkvxwQ4VQlnV54720F X9knctm39nxb1eAOJb+R2GsIjd0DfXeI4LMMHrN9hCJzV1bkMgIsgJoESgYSLm2xhH2Yum Km6vt6pLAlHKRaSPXinIZUJH09A/sbp6rcRlgiY7Lf2hQBCDG+QMi0h1bjoR8jYFZtxUXk ETONrNrEVLXYDr4V+hg7yktUJrKiN8qBuY6YDHjhdybvlRPNJcgjYE4JB1ifDg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgGpM0z1hz16mn; Thu, 16 May 2024 17:11:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44GHBN8x034211; Thu, 16 May 2024 17:11:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44GHBNxH034208; Thu, 16 May 2024 17:11:23 GMT (envelope-from git) Date: Thu, 16 May 2024 17:11:23 GMT Message-Id: <202405161711.44GHBNxH034208@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: ae9c0ba8ef2f - main - netstat(8): for -W, use IFNAMSIZ List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ae9c0ba8ef2f540f9030909cf07e3c59f876fd23 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ae9c0ba8ef2f540f9030909cf07e3c59f876fd23 commit ae9c0ba8ef2f540f9030909cf07e3c59f876fd23 Author: Lexi Winter AuthorDate: 2024-05-14 23:40:32 +0000 Commit: Warner Losh CommitDate: 2024-05-16 17:07:34 +0000 netstat(8): for -W, use IFNAMSIZ If -W is specified, use IFNAMSIZ as the width of the Netif column, instead of the default 12. Reviewed by: imp,zlei,Mina Galić Pull Request: https://github.com/freebsd/freebsd-src/pull/1223 --- usr.bin/netstat/nhops.c | 2 +- usr.bin/netstat/route.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/netstat/nhops.c b/usr.bin/netstat/nhops.c index 1db3c2d37167..1a5d8eee74b1 100644 --- a/usr.bin/netstat/nhops.c +++ b/usr.bin/netstat/nhops.c @@ -64,7 +64,7 @@ #include "common.h" /* column widths; each followed by one space */ -#define WID_IF_DEFAULT 12 /* width of netif column */ +#define WID_IF_DEFAULT (Wflag ? IFNAMSIZ : 12) /* width of netif column */ #ifndef INET6 #define WID_DST_DEFAULT(af) 18 /* width of destination column */ #define WID_GW_DEFAULT(af) 18 /* width of gateway column */ diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c index 93e882052de2..482fb07ff950 100644 --- a/usr.bin/netstat/route.c +++ b/usr.bin/netstat/route.c @@ -184,7 +184,7 @@ pr_family(int af1) } /* column widths; each followed by one space */ -#define WID_IF_DEFAULT 12 /* width of netif column */ +#define WID_IF_DEFAULT (Wflag ? IFNAMSIZ : 12) /* width of netif column */ #ifndef INET6 #define WID_DST_DEFAULT(af) 18 /* width of destination column */ #define WID_GW_DEFAULT(af) 18 /* width of gateway column */ From nobody Thu May 16 17:17:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgGx02VT8z5LZ7f; Thu, 16 May 2024 17:17: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 4VgGx01yz1z4NsN; Thu, 16 May 2024 17:17:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715879828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=74cA9wUTa1B7ck+24Hdsa4aE4+nTanzuS8MLcNsmt1Y=; b=oBGJf9ZVzvPhishB6HJ1K5yo5fTBSnBi4I0OMuP1otGW3N/Qf9WZu05ZSnrCcD8UeUzZq5 aprPUxmm4njNm1H+O2dfOohi5tFX8L6Vmzq2UiFrKXt8jOwODbDorfM0ksTETNM0iajHg6 bICQLIOPX+cgED2yW+F/pNTxDU9ih5iAWAyyPsbFzTXbGT23VqHBS4mkOUnNS7PXG8YW0Q 29HjnCJHN/zk5C60toxRGICI1nOsPAjjt9qVzSu0WvEwjeNuYixq7L7y/YD8S/x3QmtvOz yYInkRTz6dJ7OWKcP05j39RN88QmY4QPBjtcLXRMLL7LOunWMszdtyqcT0+NYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715879828; a=rsa-sha256; cv=none; b=NJnzp069vngHJT28C3OCHi+hBkbZNBd1U8/Zwr4jeff0FOb0KmjFBz69DC0cAnYGER3Dnc tG/XHhTOnRV4fcwOQmIKSiPZBU8lLEpyB9ZcPTSZowMGswGdTz07oA2kaurlJ0453XV1WF +kNl/uMc4QFo/Q/IKSwkVm0RWCcTDEnnveDzhWzE7qp404rp54uxyMwiSDQKIaZ+vj0CYn gJa+aGXH1cDw5YM5sZFxd0vZC+tQVg/foApeQh4cvxioP2ZHprS73LU+DNDmwuQEhpKWLM S4PZqXTU+1AIidy67uCHPpRnR4vOSHpyK+9FGHIJYDc3hzfzaSabGYp+weRXSg== 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=1715879828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=74cA9wUTa1B7ck+24Hdsa4aE4+nTanzuS8MLcNsmt1Y=; b=XDiKHE5La7Jm6cHtyfwWtueYUMZM4FHSUJ1SwvMH4+786+OtxkeH0BhQgadp1QQsArf4E0 srXK22fr0udHUa9cF/k24zePrgTivedijhWq8VNG2UnBoVSut8Fvudx0jyIE0UqqK7qggX V8oS+m8wlR2iOAzIdk0IoaOU4jMAULDFLoW7IQv8VyHo9uWY2ZUNU1KGehIbIhZyORqJGi 0pfTOG6kufw5vAtXfVcdkkiNXSNfmJ1L7Nqv7h/VYpUJJhLZxtT1GwJ7YrogVsPzdHcyJw eMzyRt4I7vrtjOY34adxUiabs59WRnS8oYGuRULzMZc8o6xTt0ARM4OD8aUoRg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgGx01Ysxz1740; Thu, 16 May 2024 17:17: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 44GHH8xr035943; Thu, 16 May 2024 17:17:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44GHH83H035939; Thu, 16 May 2024 17:17:08 GMT (envelope-from git) Date: Thu, 16 May 2024 17:17:08 GMT Message-Id: <202405161717.44GHH83H035939@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 304a03275a65 - main - sys/modules/dpdk_lpm4: do not build without INET List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 304a03275a65cf811fb6c06fa1c37783d07c99a4 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=304a03275a65cf811fb6c06fa1c37783d07c99a4 commit 304a03275a65cf811fb6c06fa1c37783d07c99a4 Author: Lexi Winter AuthorDate: 2024-05-15 00:16:10 +0000 Commit: Warner Losh CommitDate: 2024-05-16 17:16:29 +0000 sys/modules/dpdk_lpm4: do not build without INET Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1236 --- sys/modules/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 35e5d77b9f07..2bd8914ab0d5 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -505,7 +505,7 @@ _ipfw_nptv6= ipfw_nptv6 _ipfilter= ipfilter .endif -.if ${MK_INET_SUPPORT} != "no" && ${KERN_OPTS:MFIB_ALGO} +.if ${MK_INET_SUPPORT} != "no" && ${KERN_OPTS:MFIB_ALGO} && ${KERN_OPTS:MINET} _dpdk_lpm4= dpdk_lpm4 _fib_dxr= fib_dxr .endif From nobody Thu May 16 17:20:16 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgH0c4RfLz5LZNG; Thu, 16 May 2024 17:20: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 4VgH0c2jZsz4PTY; Thu, 16 May 2024 17:20:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715880016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h8hj7v3WbrdX84ksqFMSkOefYE19dympPb0J5WpEx/g=; b=Hf534QSI6KJaYTBMDWNqrGHhGqtsF3ljbUe5TK/EvWr/tTnagroFssU9FxR3rvmdZZ+p1P WUhELPsS7VG5DdaLYFlASPNUGiX/+d/+IY6y9CWhTF5ImPczg7OsnVmwgc0gN1flzoMTH6 Ht9pWuo5ZbkzCy62YBXiAWsVkXoGU/VSxiRlA87j5ViAyxxTGtLH8RI+JdmjBU+c/vgYh5 gvYaW8bxMyoZ9H79SFkWF1+p02Zm1txyFXPpfDSTSKqY5PCGMsk3hTswaQFrifS8gIK4uj 0SUPkrfS+iamD5HJ7W0ymQINVfl1HpRkLmWHW75HytKDw6H+jKPVAp7+DzmKtA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715880016; a=rsa-sha256; cv=none; b=ZboIFa2+358v6C9ArNWFvFLg/RNfguuM0UtP+TZC3b2c37jcw3I3HC2PJ+DzekmOes7ATc IxQcDQ744lHtbqy0x/wmG+C4uidKoyKvtTvp1sJuM29Dk3Xm/bzVbpHqnICv2XiZZsQlWS LhsC28cURTsV8Z9YghVFwUGBoa1BtH+MNJumQHRyAWltc9+J7vQHKdrZlhvk5DBxkqqIVN vsInf0LGcBA/kGvP7oqgZbncgEcfmrdKWhLN7TU24TvH96nTBfNBbtNRq7MU3bZRojS6k5 DtUeDCWkZl6A9x1Vhlwfs3rNDtm70SCIiBkVT5o8nP6x0APT4OqvYSi9EH3+OQ== 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=1715880016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h8hj7v3WbrdX84ksqFMSkOefYE19dympPb0J5WpEx/g=; b=LEp4ZOs410+0VOoRKRTIgxAYU4/K/GMdavGrj3GTMRFOxc6TKAvDJOC/MJ/4n2r0byMuL0 Tgo6pG4xR/XzXjlCcxCMUKN3b2BiaGmSh8YMWXypVujO6TgdbYmVFxLmLgXxLx/3julYf8 yurjJUmCt8WUnaY1WEylfG2aFCnnh8A3xc5fzGo0cFxMqeJGQJFJOAk3h7psP4L26csuxP 6xnHM3urPBlFxhPGkv7nFR4PCyKZutWtjK7X9NUP5GGlY2otiYsacQSPTnmzehdJN6CUg/ Bcoz1k8To0jZ7I+l+BU8i9YW7FOqFTrbfSF6iWVJeIF5SVTcobfojrmuM1BzCA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgH0c2Bmxz16sC; Thu, 16 May 2024 17:20: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 44GHKGae043933; Thu, 16 May 2024 17:20:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44GHKGiO043924; Thu, 16 May 2024 17:20:16 GMT (envelope-from git) Date: Thu, 16 May 2024 17:20:16 GMT Message-Id: <202405161720.44GHKGiO043924@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 1787871a6627 - main - bhyve: avoid resource leak List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1787871a6627cc1a49ce7ceea8133b394ea7f486 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1787871a6627cc1a49ce7ceea8133b394ea7f486 commit 1787871a6627cc1a49ce7ceea8133b394ea7f486 Author: Pierre Pronchery AuthorDate: 2024-05-13 17:26:11 +0000 Commit: Warner Losh CommitDate: 2024-05-16 17:19:33 +0000 bhyve: avoid resource leak In bhyve_parse_config_option(), a string is allocated and passed to nvlist_add_string() but not free'd afterwards. Reported by: Coverity CID: 1544049 Sponsored by: The FreeBSD Foundation Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1234 --- usr.sbin/bhyve/bhyverun.c | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index d199c32cc54b..aca770a92642 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -593,6 +593,7 @@ bhyve_parse_config_option(const char *option) if (path == NULL) err(4, "Failed to allocate memory"); set_config_value(path, value + 1); + free(path); return (true); } From nobody Thu May 16 17:22:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgH3T3pGhz5LZQT; Thu, 16 May 2024 17:22: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 4VgH3T1Cmcz4PfT; Thu, 16 May 2024 17:22:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715880165; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/E5EqKMexsqipsAuOoJuYwHnVaRvMMcr8YtL2ai7AFQ=; b=WliUkYW6+peQeSfWTJAC1ATzicQFMeITFKpZznDCQ3QbieWuRshGV9ybTKnULZbR68sEHW Udtn2c9XjQtmTeyiUG3ZSjW85Ms5X5n2SO2FpqviSplcPRYPiN/HWkBJ3/uaRKboZs8zkq PVXlmdpMGB/gh3I6O1s2XMBxdDUZqbiBqEP14a+7X9CowOixlWiwh4mMUrpdZa9R5AIDNz 9DM8SXafypAcZCaOfH6SuqeNUE8s/0p8aC//t0ohno7zbPo2RJyF6WhKlBgRqmfbaCsc8U WSD5aMtOGzPHjPupsyyru4W/R6BQv3RG7Du9Ixr3v8lSn1N60b/nwQPgKwfsFg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715880165; a=rsa-sha256; cv=none; b=G98l9GlojLsfkZhrlfJAd9Wmozl0soRohhIRq1WnkK0vXe42n+zbASNy2clyIjSUqb6zRj gBYF9dfn6QW5jAwlQiLXcEXygF5WKP/HgIJHNXASAofUEeVP6KNbMXI3yxFgQuAnOHYBjM 9KDLeKcmtSN2Xfc62R/aBO4nW1D8I3WBwAemOXnqerAnK1Ji3wupklvYARGPG3niKUUr1x jdUoqB1Ju2F9SzSvxQ3MokiSINMqB5u7rnCtEuD+V6VX2BcpWdlqCa0HcrSVVLl1jde/No +dMBgUln8z+JKMr2F+sL5O0JSqrigaAI1VAjMf4EzvaNmgaVilJ0FTQbGsn5mQ== 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=1715880165; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/E5EqKMexsqipsAuOoJuYwHnVaRvMMcr8YtL2ai7AFQ=; b=QqikvhQJ7nmEuD9EpqCFsRVKLoO8V/wkzJ5/jgjr+fg/N7ou7AWQkn+912DuEMTm7lihI4 2L0kFpO1kqTy8kWPKB/+m/E/vYAh+mqqOJcb6GaZMdaoCQNzXWX+XNDJyb6+USmOeCTvmi h7Ra1FXfIM58P+3AwCvUA6Afm6jSCzzntK6ITQACBrLbWwYHpCDgvhaIrccsfJpnMJisNz SRuw18M8BIox2o8dtWpCFffWUqxdydh87bLgrGkEHaHKFhuFZzsnZM6jvLPU//q4ZpMFFI RDqTs/hOvjh6+8C880t/vRESTcTnE0cEsE+JCyLzwPaC+veP2W2fdFVD3CA76w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgH3T0pgZz177K; Thu, 16 May 2024 17:22: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 44GHMieW052892; Thu, 16 May 2024 17:22:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44GHMi5w052889; Thu, 16 May 2024 17:22:44 GMT (envelope-from git) Date: Thu, 16 May 2024 17:22:44 GMT Message-Id: <202405161722.44GHMi5w052889@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: f38117359af1 - main - ctladm: fix resource leak List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f38117359af1f6b6cb373018084cad99b22dc178 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f38117359af1f6b6cb373018084cad99b22dc178 commit f38117359af1f6b6cb373018084cad99b22dc178 Author: Pierre Pronchery AuthorDate: 2024-05-15 18:13:52 +0000 Commit: Warner Losh CommitDate: 2024-05-16 17:22:48 +0000 ctladm: fix resource leak The str variable in cctl_nvlist_end_element() does not get free()'d when converted to an integer value. (name is "trtype") Reported by: Coverity Scan Coverity ID: 1545039 Sponsored by: The FreeBSD Foundation Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1237 --- usr.sbin/ctladm/ctladm.c | 1 - 1 file changed, 1 deletion(-) diff --git a/usr.sbin/ctladm/ctladm.c b/usr.sbin/ctladm/ctladm.c index 0b034b21b2b1..688281238fb0 100644 --- a/usr.sbin/ctladm/ctladm.c +++ b/usr.sbin/ctladm/ctladm.c @@ -3920,7 +3920,6 @@ cctl_nvlist_end_element(void *user_data, const char *name) str = NULL; } else if (strcmp(name, "trtype") == 0) { cur_conn->trtype = atoi(str); - str = NULL; } else if (strcmp(name, "connection") == 0) { nvlist->cur_conn = NULL; } else if (strcmp(name, "ctlnvmflist") == 0) { From nobody Thu May 16 17:25:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgH6S0ns9z5LZts; Thu, 16 May 2024 17:25: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 4VgH6S0D64z4QFf; Thu, 16 May 2024 17:25:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715880320; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lWbV0UcM6mBBrMqJs4uEviuQoOkC0WvurOvoDz+gpK8=; b=R7h4OM16Yjg5T6EpBWwf4NTSV4QIPGmafkS6jRbIlrwZYYIaFS+N3o6A0qE6gDXOOYlUSQ TYe7sKMT3E0m1xzkOpE0kvqjeUveLxvIE9My4bArdjpJ3USOsEFHUi3DfYcl3DFZGBUP6Z kTpEN2WyWJ3nYOrKxIB0xJXV7AdhgHlw3HicPZLYWYIqI6bkP+A7+JHf0WelOo5qw7VJbF +gnmJcSXBpl7350c8Afid7B/72BS3h5L9xINDf4GY+Sj17J16/LopHpjVSsIurKXuiKvj8 AEhGCq/d0JxMHCdBzzYxph6OnVAcC8OXgfAeBjnP9VduAGoE6xpDUWCuj2Ix3w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715880320; a=rsa-sha256; cv=none; b=Oie03dEcgNpn2XkLMBM5oYisKUrzGLMShrKSoAaMx0zie48KvciFZQ3Fb/dCFBH+Qxbnb9 tumdpyjw9FDEavhJ0AJHCaUJtWn0nfx/bIMHbS188MCqxURUdaRg//pLelAiPkhLEXQxvu KGO/0kw0N+63WS7xIh6qy7Cc2XDqw69CcU1lw1hvzHo4rr48q+7n7zpxAUJ/ujDakG331X Dlw3RnJM8vZGtVzv5KAYtJ3qZdaxjw/vH26iNd6IuxD3wF+S17BRETYgDAQWNXVHhLL9lr 7yN2W2nEJEanSk/9Y79882RLkqa/L4ApN+3V9Vh6/33Jm+5k1XqEohxBZYCmYQ== 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=1715880320; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lWbV0UcM6mBBrMqJs4uEviuQoOkC0WvurOvoDz+gpK8=; b=Mp8NAOm0WGSSmh0rDCeAcC0ZWEDkcqicV3sgR9bXj83yFkB7mMSMil2EeUib0/dBJ7lyeE uKymwh1M2OjNDuMJKQw4I9/rrnm8gagSfWjcVgCYzwAwMrcOCy5QIKTJUjNwWeuGVPRp1E /pLqeK1D67Bv3CTRaeVY+iDmpymQ5MOVwKf43XywIUL3HvLN2YK19pvNYB/5G/Ee9HG5rw /jMl8is5fwolcbSPR0i+fKbACuL/hN0trngJrTuUr7ksYewaQPHYn0enT0BL6MHV3gNTz4 u7kU+EQ/Ermlj5lrrCb4cgsWb/Vrjo3TAnoPB2e1EClI34kreROyEleSBlQdUw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgH6R6xGVz17Jt; Thu, 16 May 2024 17:25: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 44GHPJIs053329; Thu, 16 May 2024 17:25:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44GHPJQP053326; Thu, 16 May 2024 17:25:19 GMT (envelope-from git) Date: Thu, 16 May 2024 17:25:19 GMT Message-Id: <202405161725.44GHPJQP053326@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 8930e7d8ea4d - releng/14.1 - save-entropy: Add manual page List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 8930e7d8ea4dc0ec34c6d2f7db5a7c7746997b8f Auto-Submitted: auto-generated The branch releng/14.1 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=8930e7d8ea4dc0ec34c6d2f7db5a7c7746997b8f commit 8930e7d8ea4dc0ec34c6d2f7db5a7c7746997b8f Author: Fernando Apesteguía AuthorDate: 2023-09-07 08:28:43 +0000 Commit: Mitchell Horne CommitDate: 2024-05-16 17:24:30 +0000 save-entropy: Add manual page Succinct manual page for save-entropy(8). PR: 223998 Reported by: AJ Jordan Reviewed by: carlavilla@, delphij@, lwhsu@, pauamma_gundo.com Approved by: delphi, lwhsu (src) Differential Revision: https://reviews.freebsd.org/D41768 (cherry picked from commit 8dc9b10e388da19d63b3dd718a8243e8e969091d) (cherry picked from commit 227f81c8bd0f60176519276839b24b468afce0bc) Approved by: re (cperciva) --- libexec/save-entropy/Makefile | 1 + libexec/save-entropy/save-entropy.8 | 97 +++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) diff --git a/libexec/save-entropy/Makefile b/libexec/save-entropy/Makefile index 1c7eabf36c7f..0c541606411f 100644 --- a/libexec/save-entropy/Makefile +++ b/libexec/save-entropy/Makefile @@ -1,4 +1,5 @@ SCRIPTS= save-entropy.sh +MAN= save-entropy.8 .include diff --git a/libexec/save-entropy/save-entropy.8 b/libexec/save-entropy/save-entropy.8 new file mode 100644 index 000000000000..f7a93c8866fc --- /dev/null +++ b/libexec/save-entropy/save-entropy.8 @@ -0,0 +1,97 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2023 Fernando Apesteguia +.\" +.\" 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. +.\" +.Dd September 18, 2023 +.Dt SAVE-ENTROPY 8 +.Os +.Sh NAME +.Nm save-entropy +.Nd Save bits of entropy to feed /dev/random at startup +.Sh SYNOPSIS +.Nm save-entropy +.Sh DESCRIPTION +The +.Nm +command is used to save entropy data from +.Pa /dev/random +to files in a specified output location. +The files saved are used at startup to provide additional entropy for +.Pa /dev/random . +The output file will be different in every invocation until the maximum number +of different files is reached. +(See +.Em entropy_save_num +for details). +By default this script is invoked via +.Xr cron 8 +every eleven minutes approximately. +.Pp +This command does nothing if executed inside a +.Xr jail 8 . +.Pp +Three variables in +.Pa /etc/rc.conf +regulate the behavior of the script: +.Bl -tag -width Ds +.It Va entropy_dir +Specify the directory for saved entropy files. +Defaults to +.Pa /var/db/entropy . +If set to "NO" it disables caching entropy via +.Xr cron 8 . +This setting is shared with +.Pa /etc/rc.d/random . +.It Va entropy_save_sz +Size of the entropy cache files. +Defaults to 4096. +.It Va entropy_save_num +Number of entropy cache files to save. +Defaults to 8. +.El +.Sh FILES +.Bl -tag -width Ds +.It Pa /etc/rc.conf +.El +.Sh EXIT STATUS +.Ex -std +Errors will be recorded in the system log. +.Sh SEE ALSO +.Xr syslog 3 , +.Xr random 4 , +.Xr rc.conf 5 , +.Xr cron 8 +.Sh HISTORY +The +.Nm +command first appeared in +.Fx 5.0 . +.Sh AUTHORS +The +.Nm +command was originally written by +.An Doug Barton . +This manual page was written by +.An Fernando Apesteguia . From nobody Thu May 16 17:31:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgHF90lwmz5Lb8m; Thu, 16 May 2024 17:31: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 4VgHF90FHbz4S3y; Thu, 16 May 2024 17:31:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715880669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fG5Lp4fCTaOOqtHjwhR1Y153dGX589v4sDQkL5dDjAo=; b=AMwYj8wBLti9IIDOgTn266cSJNenUbZ8KfMd98jOZOB5zmJol2Ozy3PZapeyxhJl9BTJ0a PeA8IPRPH7PPKNXSmK8cngIeyF0cVQsuyWbRaAYih0pB0H2WPNhOqrrxWYgDRDa1DRnA37 HMsIBhyYXHtuhIdlR0SV9iMQA+nPOlQjrjjKk9oZxbeVK7plxTSK0hSF21SbALw+XgmyJR ZeZRvoyhLq9MUldIGrXs8OMMenWTal//pFMtzXZDqTyebGWOh7Ywoue+BNNM/R1Gb780+k 0eh7sWBkxcEXL7Khg0CtipvnKrCEibR+siUdTLnJz1DFHgPDQ/HLtbpSPVr/WQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715880669; a=rsa-sha256; cv=none; b=tSAweVrJo7o6Crb54uZ8Uxe9/E6648dWtXRkbyg5EPf1RMXL/44vDGOMpfTVeyzItfsf9M D6Kpf1cnzPKg9vYsC1A0Ok9nrp6TYohTCXP+YsHbay+YJYhXOylJlFjEGF999ZuBLWNK3X D/bWBXl5GEN0WN3qJdm+QyFHmEoLfM/cdahEKod9fBtEqx7mKGey/WbzTA+UfeGL35pQiL cSFJVJgs4taza6bolEOvt6PY0fGLMBHKoe+miOBvD1QcrFXacG+dY0Smu/+ThuwtZk4wI8 thyyIrLWPHhee7LtknJr3juT2bB5uYJgIX87tSjA9sirfT3D9K21M5R5Px3tng== 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=1715880669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fG5Lp4fCTaOOqtHjwhR1Y153dGX589v4sDQkL5dDjAo=; b=i3vWhuq8IkPwD8DUCycrwzBMvcnVpxmJCP+ZCfEro7afG7ffvXffBF9Ek8uQ05vmIDuybv +4xMTljMri/SMbsG+KD8uk3aQtd+qdt3iYdfS2DcJIsm8kNwCBThikJiaHmACvQK2yts9L SRLN3ONCyyn/uemCOQxhZrXBb5bzI/2SLJDiBPUS3DcB7ILJoUZiqRBvHuIxwiIi/gdnjK ddr/I5Q5+tdJZdqYUwyO4w1v+3TaFtv4mRQwN5Ilg5HkYeMizpX/0grkk+GCFNK15iU1aQ w5AHMiu2VU9NadiWxBDjJ0dafE2iHULHae0TQJ96Np/wDwIXP3YVPfQaDhnMHg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgHF86z3kz177X; Thu, 16 May 2024 17:31: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 44GHV8MI063945; Thu, 16 May 2024 17:31:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44GHV8Y6063942; Thu, 16 May 2024 17:31:08 GMT (envelope-from git) Date: Thu, 16 May 2024 17:31:08 GMT Message-Id: <202405161731.44GHV8Y6063942@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 65fd76b5f566 - main - makeman: extend duplicate option warning to OPT_ options List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 65fd76b5f566a21d4e017711e8d0678aab6fe59e Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=65fd76b5f566a21d4e017711e8d0678aab6fe59e commit 65fd76b5f566a21d4e017711e8d0678aab6fe59e Author: Ed Maste AuthorDate: 2024-05-13 19:05:39 +0000 Commit: Ed Maste CommitDate: 2024-05-16 17:30:37 +0000 makeman: extend duplicate option warning to OPT_ options In a local tree I accidentally had OPT_INIT_ALL defaulting to zero in userland and none in kernel. This resulted in the INIT_ALL text appearing twice in src.conf.5. Reviewed by: brooks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45184 --- tools/build/options/makeman | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/build/options/makeman b/tools/build/options/makeman index 30416b03b983..e0980d3be607 100755 --- a/tools/build/options/makeman +++ b/tools/build/options/makeman @@ -379,12 +379,18 @@ EOF The following options accept a single value from a list of valid values. .Bl -tag -width indent EOF + prev_opt= show_group_options | while read opt ; do if [ ! -f ${opt} ] ; then echo "no description found for ${opt}, skipping" >&2 continue fi + if [ $opt = "$prev_opt" ]; then + echo "ignoring duplicate option $opt" >&2 + continue + fi + prev_opt=$opt echo ".It Va ${opt}" cat ${opt} From nobody Thu May 16 17:37:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgHNN3vy8z5LbVm; Thu, 16 May 2024 17:37:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgHNN3QRlz4Ssg; Thu, 16 May 2024 17:37:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715881044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wI9830nsIb41jRKPLfztvTmyA78W4x+HOzJg8qolPiw=; b=hm6FgpSVHkGoRkEwFM1iwcd9VJGc3KOQ6zZfMLBUQlup6zHxkekmDc85of/wMdWZjrKNWz 7aaRV3WC+eepb1SX0gfum0otYDHFDUDdiyEOOF0xGNMLc7M8o47HTzL78+D8CHaguatd9l T1sF3QDEPQT+HExssd6UUl2Sh30AjsI1rlYpYNPZq7QrfYZ71G3rHOLzgnzjy5OcuWciOC jcozMEnLkX8mjHa9Ml/45LuyXXaOJJthip4/RXbhC6pMJb/57T4FbpdmN15DDfnkcvHBJi 9lDeguuiK/rqp0scr1ZKzdcIXZM9LwI4izd93s4PumoBq/DzqmTgF64dYgFU8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715881044; a=rsa-sha256; cv=none; b=VlYruSx4jIBUn3umh7DmoulyowxuKTdXfxlXqMnQUBsgIUBbWjzZf7It9Qb9YGO/8T2rzq ENzxxO6CrJbMxy/bO7mTV/Wnqd8c69E3FUqg3LVhIhUPV+N895EZV5BWd213FbGPdW9RiC sejFFNlCkES8h1rP+08G6Bdtm8gqDU2QlfsObF9l7Sh+Rqn9tuBy9W7Dg6Kh77HTR18kN8 WnWeGCK3eHe1q9jpv02aBiOaN9B8AvxZS6qb/rqNIP5Nl3qux23KVSJW0CXrpVdA8wd8zi ggwg9ZKKE9MSm53Mt+0FEEJMsfK8D2JLpy+UxnyPfie4Uz7SuJrs36Ct7a4fKA== 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=1715881044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wI9830nsIb41jRKPLfztvTmyA78W4x+HOzJg8qolPiw=; b=ozC45s4gYTS54if9nEpcXkV51iPzIMh0j+j1TNdAVR40C9DgFJJMsEj261rmw+NXidxk3V /tibwRZuYnErs3fYoy7sFrpfasdGalJuFNokKcgb2pLntMtJMdco4vdmL+8pg2v/Z7E3W7 p6Gte6sYAfiWI5/jYnqfWAo1A+E5Z+L+as6bhWsC7qd4fpAF8oQVCey8N8bnYOVroTI3nV KyenMvKvBWRqjCQQ9rhIq30QssZlmFH9rVJQ44lSEnBUkIcxw4fbmCUGfjYsLRWYEVAo2y QCIXGQn/sXdRBseLv79GGMXNVjbbnmKo4RbghWSQDMfcZw0vnsZd69dqVQCh4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgHNN316pz177w; Thu, 16 May 2024 17:37:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44GHbO11070793; Thu, 16 May 2024 17:37:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44GHbOEa070790; Thu, 16 May 2024 17:37:24 GMT (envelope-from git) Date: Thu, 16 May 2024 17:37:24 GMT Message-Id: <202405161737.44GHbOEa070790@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 28a59100b54f - main - linuxkpi: Provide a non-NULL value for THIS_MODULE List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 28a59100b54ff245a45fbd328266266f1c14eb8c Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=28a59100b54ff245a45fbd328266266f1c14eb8c commit 28a59100b54ff245a45fbd328266266f1c14eb8c Author: Austin Shafer AuthorDate: 2024-03-06 17:48:07 +0000 Commit: John Baldwin CommitDate: 2024-05-16 17:36:36 +0000 linuxkpi: Provide a non-NULL value for THIS_MODULE THIS_MODULE is used to differentiate modules on Linux. We currently completely stub out any Linux struct module usage, but THIS_MODULE is still used to populate the "owner" fields of various drivers. Even though we don't actually dereference these "owner" fields they are still used by drivers to check if devices/dmabufs/etc come from different modules. For example, during DRM GEM import some drivers check if the dmabuf's owner matches the dev's owner. If they match because they are both NULL drivers may incorrectly think two resources come from the same module. This adds a general purpose __this_linker_file which will point to the linker file of the module that uses it. We can then use that pointer to have a valid value for THIS_MODULE. Reviewed by: bz, jhb Differential Revision: https://reviews.freebsd.org/D44306 --- sys/compat/linuxkpi/common/include/linux/module.h | 21 +++++++++++++++++++++ sys/kern/kern_linker.c | 14 ++++++++++++++ sys/sys/linker.h | 6 ++++++ 3 files changed, 41 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/module.h b/sys/compat/linuxkpi/common/include/linux/module.h index 9d98ef7cf3db..079dacf8df6c 100644 --- a/sys/compat/linuxkpi/common/include/linux/module.h +++ b/sys/compat/linuxkpi/common/include/linux/module.h @@ -32,6 +32,8 @@ #include #include #include +#include +#include #include #include @@ -51,7 +53,26 @@ #define MODULE_SUPPORTED_DEVICE(name) #define MODULE_IMPORT_NS(_name) +/* + * THIS_MODULE is used to differentiate modules on Linux. We currently + * completely stub out any Linux struct module usage, but THIS_MODULE is still + * used to populate the "owner" fields of various drivers. Even though we + * don't actually dereference these "owner" fields they are still used by + * drivers to check if devices/dmabufs/etc come from different modules. For + * example, during DRM GEM import some drivers check if the dmabuf's owner + * matches the dev's owner. If they match because they are both NULL drivers + * may incorrectly think two resources come from the same module. + * + * To handle this we specify an undefined symbol __this_linker_file, which + * will get special treatment from the linker when resolving. This will + * populate the usages of __this_linker_file with the linker_file_t of the + * module. + */ +#ifdef KLD_MODULE +#define THIS_MODULE ((struct module *)&__this_linker_file) +#else #define THIS_MODULE ((struct module *)0) +#endif #define __MODULE_STRING(x) __stringify(x) diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index 08b85867d781..3f34bb12aeaa 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -906,6 +906,20 @@ linker_file_lookup_symbol_internal(linker_file_t file, const char *name, KLD_DPF(SYM, ("linker_file_lookup_symbol: file=%p, name=%s, deps=%d\n", file, name, deps)); + /* + * Treat the __this_linker_file as a special symbol. This is a + * global that linuxkpi uses to populate the THIS_MODULE + * value. In this case we can simply return the linker_file_t. + * + * Modules compiled statically into the kernel are assigned NULL. + */ + if (strcmp(name, "__this_linker_file") == 0) { + address = (file == linker_kernel_file) ? NULL : (caddr_t)file; + KLD_DPF(SYM, ("linker_file_lookup_symbol: resolving special " + "symbol __this_linker_file to %p\n", address)); + return (address); + } + if (LINKER_LOOKUP_SYMBOL(file, name, &sym) == 0) { LINKER_SYMBOL_VALUES(file, sym, &symval); if (symval.value == 0) diff --git a/sys/sys/linker.h b/sys/sys/linker.h index 52fbeb5584ff..06e950f7affe 100644 --- a/sys/sys/linker.h +++ b/sys/sys/linker.h @@ -130,6 +130,12 @@ typedef int linker_predicate_t(linker_file_t, void *); */ extern linker_file_t linker_kernel_file; +/* + * Special symbol which will be replaced by a reference to the linker_file_t + * of the module it is used in. + */ +extern linker_file_t __this_linker_file; + /* * Obtain a reference to a module, loading it if required. */ From nobody Thu May 16 17:53:48 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgHlJ6Y8Rz5LcLs; Thu, 16 May 2024 17:53: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 4VgHlJ61Fwz4TfB; Thu, 16 May 2024 17:53:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715882028; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XS6/waLsJdYK/cLgPZ2S1QytsV5yUWbVPYIVpC5CW/0=; b=yAeNyS4blfwF8QmFzXHbgQkyqvQtKrjOf7IhCB9eNN0SwWCaPSpgLsoOEZSQw12YX6NrNZ qd9z/JIWr/X8MyLZIn/C5WVf6ABw9bEP01vSBEgBfqm52ViZ4jvOqq77Mf8mg2DNTJEvab ZyM/5olwqrP0uqRXIygm0g6S2J4jMfNXvlbW6DkxI5G4XEkISqLlZnsljpt0YdQobGkyqR XmxAYi3vRQ+E3vG0RfN/sv6h8dxJk1fzDVLGoFNUaFODneIorYxBUC+UgUGM1KcB9oaMU+ Bn9G5yd4TuXDKnaKSRERb1n4R+wkrDKgtADj3bEXOmPR1oPAQ7nG2axwtc8yKQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715882028; a=rsa-sha256; cv=none; b=x47pCmy7E1hsq0gZJd05Qf2PBl7MZA2cbKmYJc6mHKH2Wsw2GcniQxUXMBEquxr5oA7FcL 5CmIBV5491UbbZr5rzqhWPIDM4NRhWu1NjQf1E+inWGJLl1Pj3uv0G9RJrcM+E61XhotLp z88gzTbQtZGED5QWi6BS3VYZe0kwZx4pvZyNkFu5mEMRuEDMXYx7hyxz7Axr+h7fJ71eLf Ope4JVizeEqycOgRLRSut/En1zYIOH2MQdWWgCnr5ibUt769w3MDigCeGrgm0cbiJ/rp5a 2R/9Gxkrvmm+TkBXE/xBXdkZCOoUusc37KE4Wwvu7BhWovQypxXRx4ivG4d4rQ== 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=1715882028; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XS6/waLsJdYK/cLgPZ2S1QytsV5yUWbVPYIVpC5CW/0=; b=DMNaQISzpIRuUShXH0Mdjh1LaTZ41uWp4HuPD+VG0Db/FOZ+2t+CY8CsAMVy58qO4f+Zon e0AW0NAkbE6MLNFPiD8agL3aAYS61kaYVStv8MrSzJ8s0JKVPa075ymN+zAPWMhJxxmxNA fgToyX1VEKRxCx4eMzraZsqGrRobEX91GfNGmNMkT855DJoxoI8y9vcDdYwbVFhZf34Qv2 Wd2sXgHuQob2jqdpAdqWmDZSKaPC272kgyFqHs8pytGUgzYYtoHlYKGSc8jIJ30Uaz+J2M oXsMDedZiDRpzaRiEYPOk5Hfz4VXAmZMzv9cOmUavt6ta38KI3x3pWk12LdSVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgHlJ5cjPz17QZ; Thu, 16 May 2024 17:53: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 44GHrmgl003123; Thu, 16 May 2024 17:53:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44GHrmWg003120; Thu, 16 May 2024 17:53:48 GMT (envelope-from git) Date: Thu, 16 May 2024 17:53:48 GMT Message-Id: <202405161753.44GHrmWg003120@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 53725168e1b6 - main - SysV SHM: move SHMSEG constants to sys/shm.h List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 53725168e1b631be0e60f888ba5e63e140b57766 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=53725168e1b631be0e60f888ba5e63e140b57766 commit 53725168e1b631be0e60f888ba5e63e140b57766 Author: Konstantin Belousov AuthorDate: 2024-05-16 15:24:00 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-16 17:53:31 +0000 SysV SHM: move SHMSEG constants to sys/shm.h There are planned consumers in linprocfs. Tested by: Ricardo Branco Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D45175 --- sys/kern/sysv_shm.c | 4 ---- sys/sys/shm.h | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index 2529a9eeb1a7..8f67cb63f33c 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -109,10 +109,6 @@ FEATURE(sysv_shm, "System V shared memory segments support"); static MALLOC_DEFINE(M_SHM, "shm", "SVID compatible shared memory segments"); -#define SHMSEG_FREE 0x0200 -#define SHMSEG_REMOVED 0x0400 -#define SHMSEG_ALLOCATED 0x0800 - static int shm_last_free, shm_nused, shmalloced; vm_size_t shm_committed; static struct shmid_kernel *shmsegs; diff --git a/sys/sys/shm.h b/sys/sys/shm.h index 0b5cba0120e5..9c6dad5d43cc 100644 --- a/sys/sys/shm.h +++ b/sys/sys/shm.h @@ -152,6 +152,10 @@ struct vmspace; extern struct shminfo shminfo; +#define SHMSEG_FREE 0x0200 +#define SHMSEG_REMOVED 0x0400 +#define SHMSEG_ALLOCATED 0x0800 + void shmexit(struct vmspace *); void shmfork(struct proc *, struct proc *); From nobody Thu May 16 17:53:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgHlL1KFfz5LcLt; Thu, 16 May 2024 17:53: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 4VgHlK6p14z4V8L; Thu, 16 May 2024 17:53:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715882030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ob8FVukx3ZRRCJhcrssQGeG5i3EdFv0cLvQcc6aYIOU=; b=Ufu1CKNRn7TtpoYNQzI0ihVFId+6LFA3oeZBsHXxFo/U7h9iCQaF9s5yOVbWdqr8RQMUzY e7i/Xu802zNf10rs/xvljgFky+go5tRtd/5CTQhfEi0Ci1Kp0jogfi9Z02hJvaZSpXtmdq af8ZKoWWW4k/LUnOTa3re0DvKXq+kWW2KQ8BMJpf1f/5xobCoxmtPQ8V8KjFki32QHJmV+ 57WaN3UsvTGclc2owEdQ6B9cfx3+UfoQOAmGnX0adaG/nn4sk6mJt2RgTxqHHWFOFM7S/R pHbPPFkA66CpUSOB/HD8j3R0D2+5TjKkzlUrHSU04RNV4CHXm/ZshRr9kQCGrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715882030; a=rsa-sha256; cv=none; b=X7KgbPHnOuBcj3UsoyJh5Ux84c0tUEkNlXwgf7F7E8bm204H9dn0UYUG16cw61kg/x2kea ZJ6PSTCQXN39dKc+TUHcdDJTZ2rw6PLAlcH4/gAEh5zeKBBqukb+wSkKcJiNg5XeJ9e0IX Tzgm39+9jekY8YuaCJ/zXTgX19j6U1ua28sG4yA2Dds37KOd4RA5d6Va4v5mxzRB+y2Ur2 /Ym6+Sw1umtfDBd1LdI2wP9XsWf4IB7V9AsMIK36v40iFrYjBNkR/OJNxf1Z65XlFDcuwG a+VZlvvYy0XAY/Q2hhv8tuRpZH4lkCQxFF9GmRh68rMSxl8YOTUDfIIqMTVy9w== 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=1715882030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ob8FVukx3ZRRCJhcrssQGeG5i3EdFv0cLvQcc6aYIOU=; b=OLRKdmOgbrnna/tZsbEr090/v2+LnwXLuM/Ri9+FjDGLyxOolPecD785WudOE1Grnxj20X mBELBjgyiEnRP8IgGZ9Mx6DNNHD1BaR8j+Nma5lkgvkOF0HdaLSW83eYmzglp6dkxituD4 AXR4bOoqHmF9Yc7el+NGZ3rj0Bw+/SMAo6SWe4Ii0FG0Tbay9xKno+AaRTsDhlzVeWsw7p k3SlyjOiL2QNQGqxMfQv0sdQWc9mjE9IdkFyIWr8waCQOgac1K4Qk+eBfMichtcQZjYqnK agEItQeZKaEeM9x4/dq/nly4DyUffb9BGY3M7DD+bFLH02n6U3XoG9W6zm2jGw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgHlK6P7Vz188N; Thu, 16 May 2024 17:53: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 44GHrnta003182; Thu, 16 May 2024 17:53:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44GHrn39003179; Thu, 16 May 2024 17:53:49 GMT (envelope-from git) Date: Thu, 16 May 2024 17:53:49 GMT Message-Id: <202405161753.44GHrn39003179@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 87a156527563 - main - SysV IPC: provide in-kernel helpers to obtain ipcs(8)-like information List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 87a156527563d0728bff355093e26943da3d7fad Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=87a156527563d0728bff355093e26943da3d7fad commit 87a156527563d0728bff355093e26943da3d7fad Author: Konstantin Belousov AuthorDate: 2024-05-13 17:17:47 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-16 17:53:31 +0000 SysV IPC: provide in-kernel helpers to obtain ipcs(8)-like information PR: 278949 Reviewed by: markj Tested by: Ricardo Branco Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D45175 --- sys/kern/sysv_msg.c | 34 ++++++++++++++++++++++++++++++++++ sys/kern/sysv_sem.c | 33 +++++++++++++++++++++++++++++++++ sys/kern/sysv_shm.c | 36 ++++++++++++++++++++++++++++++++++++ sys/sys/msg.h | 3 +++ sys/sys/sem.h | 3 +++ sys/sys/shm.h | 2 ++ 6 files changed, 111 insertions(+) diff --git a/sys/kern/sysv_msg.c b/sys/kern/sysv_msg.c index 078151627dfc..0620fbd175af 100644 --- a/sys/kern/sysv_msg.c +++ b/sys/kern/sysv_msg.c @@ -1477,6 +1477,40 @@ sysctl_msqids(SYSCTL_HANDLER_ARGS) return (error); } +int +kern_get_msqids(struct thread *td, struct msqid_kernel **res, size_t *sz) +{ + struct msqid_kernel *pmsqk; + struct prison *pr, *rpr; + int i, mi; + + *sz = mi = msginfo.msgmni; + if (res == NULL) + return (0); + + pr = td->td_ucred->cr_prison; + rpr = msg_find_prison(td->td_ucred); + *res = malloc(sizeof(struct msqid_kernel) * mi, M_TEMP, M_WAITOK); + for (i = 0; i < mi; i++) { + pmsqk = &(*res)[i]; + mtx_lock(&msq_mtx); + if (msqids[i].u.msg_qbytes == 0 || rpr == NULL || + msq_prison_cansee(rpr, &msqids[i]) != 0) + bzero(pmsqk, sizeof(*pmsqk)); + else { + *pmsqk = msqids[i]; + if (pmsqk->cred->cr_prison != pr) + pmsqk->u.msg_perm.key = IPC_PRIVATE; + } + mtx_unlock(&msq_mtx); + pmsqk->u.__msg_first = NULL; + pmsqk->u.__msg_last = NULL; + pmsqk->label = NULL; + pmsqk->cred = NULL; + } + return (0); +} + SYSCTL_INT(_kern_ipc, OID_AUTO, msgmax, CTLFLAG_RD, &msginfo.msgmax, 0, "Maximum message size"); SYSCTL_INT(_kern_ipc, OID_AUTO, msgmni, CTLFLAG_RDTUN, &msginfo.msgmni, 0, diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c index 6a668906ebd0..d8c10f837105 100644 --- a/sys/kern/sysv_sem.c +++ b/sys/kern/sysv_sem.c @@ -1574,6 +1574,39 @@ sysctl_sema(SYSCTL_HANDLER_ARGS) return (error); } +int +kern_get_sema(struct thread *td, struct semid_kernel **res, size_t *sz) +{ + struct prison *pr, *rpr; + struct semid_kernel *psemak; + int i, mi; + + *sz = mi = seminfo.semmni; + if (res == NULL) + return (0); + + pr = td->td_ucred->cr_prison; + rpr = sem_find_prison(td->td_ucred); + *res = malloc(sizeof(struct semid_kernel) * mi, M_TEMP, M_WAITOK); + for (i = 0; i < mi; i++) { + psemak = &(*res)[i]; + mtx_lock(&sema_mtx[i]); + if ((sema[i].u.sem_perm.mode & SEM_ALLOC) == 0 || + rpr == NULL || sem_prison_cansee(rpr, &sema[i]) != 0) + bzero(psemak, sizeof(*psemak)); + else { + *psemak = sema[i]; + if (psemak->cred->cr_prison != pr) + psemak->u.sem_perm.key = IPC_PRIVATE; + } + mtx_unlock(&sema_mtx[i]); + psemak->u.__sem_base = NULL; + psemak->label = NULL; + psemak->cred = NULL; + } + return (0); +} + static int sem_prison_check(void *obj, void *data) { diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index 8f67cb63f33c..835b44ab332a 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -1089,6 +1089,42 @@ sysctl_shmsegs(SYSCTL_HANDLER_ARGS) return (error); } +int +kern_get_shmsegs(struct thread *td, struct shmid_kernel **res, size_t *sz) +{ + struct shmid_kernel *pshmseg; + struct prison *pr, *rpr; + int i; + + SYSVSHM_LOCK(); + *sz = shmalloced; + if (res == NULL) + goto out; + + pr = td->td_ucred->cr_prison; + rpr = shm_find_prison(td->td_ucred); + *res = malloc(sizeof(struct shmid_kernel) * shmalloced, M_TEMP, + M_WAITOK); + for (i = 0; i < shmalloced; i++) { + pshmseg = &(*res)[i]; + if ((shmsegs[i].u.shm_perm.mode & SHMSEG_ALLOCATED) == 0 || + rpr == NULL || shm_prison_cansee(rpr, &shmsegs[i]) != 0) { + bzero(pshmseg, sizeof(*pshmseg)); + pshmseg->u.shm_perm.mode = SHMSEG_FREE; + } else { + *pshmseg = shmsegs[i]; + if (pshmseg->cred->cr_prison != pr) + pshmseg->u.shm_perm.key = IPC_PRIVATE; + } + pshmseg->object = NULL; + pshmseg->label = NULL; + pshmseg->cred = NULL; + } +out: + SYSVSHM_UNLOCK(); + return (0); +} + static int shm_prison_check(void *obj, void *data) { diff --git a/sys/sys/msg.h b/sys/sys/msg.h index 29fb8c2106b5..d8c950e66c47 100644 --- a/sys/sys/msg.h +++ b/sys/sys/msg.h @@ -152,6 +152,9 @@ struct msqid_kernel { #ifdef _KERNEL extern struct msginfo msginfo; +int kern_get_msqids(struct thread *td, struct msqid_kernel **res, + size_t *sz); + #else /* _KERNEL */ __BEGIN_DECLS diff --git a/sys/sys/sem.h b/sys/sys/sem.h index 05b69f64cd05..5634f4b0cfcc 100644 --- a/sys/sys/sem.h +++ b/sys/sys/sem.h @@ -142,6 +142,9 @@ extern struct seminfo seminfo; */ void semexit(struct proc *p); +int kern_get_sema(struct thread *td, struct semid_kernel **res, + size_t *sz); + #else /* !_KERNEL */ __BEGIN_DECLS diff --git a/sys/sys/shm.h b/sys/sys/shm.h index 9c6dad5d43cc..a1aa6ca54c60 100644 --- a/sys/sys/shm.h +++ b/sys/sys/shm.h @@ -158,6 +158,8 @@ extern struct shminfo shminfo; void shmexit(struct vmspace *); void shmfork(struct proc *, struct proc *); +int kern_get_shmsegs(struct thread *td, struct shmid_kernel **res, + size_t *sz); #else /* !_KERNEL */ From nobody Thu May 16 18:28:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgJVw4ZZVz5LfXP; Thu, 16 May 2024 18:28: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 4VgJVw47m9z4Yvg; Thu, 16 May 2024 18:28:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715884088; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XSLqunL8XnXwfCAkUOX8dMPVAHjbEThtiRvc6JBSj3I=; b=szxXUeic0+/YP/DHDp7607sA4HN619UD+zOfn6VzJNxJIFFf6xpBusIapzR2YVE5O4ELQZ ZWNibw7qSvUSWy1hSNCQlZu/kIgIY/d+i6fmavGe906cotZexITkkYPH8T7AYWoWMK3poI 2Hhqn4+wQD5Jy9VM2/Y3DRlVlIvFT2T1IFpDXmfYXnQvBEq2cAbu4kuIKk9YJgKu5Tzu3E TCKa/VveiLtJ61pnyXURTa+t2q8s7cLIsDfXT84VCppVNX8/cM2OOu07H3ok+cULtRhVcV ulttMap4GDsksAef/+io+wQWYObkJkLnJdrn1HMGUejW88uBnu5UBYvuadyyNQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715884088; a=rsa-sha256; cv=none; b=UehItdijwin/+6RDdwjjMdKJbiXvcwhdP9ube+Lrefd3nmdQFJKofWmxtpS5xCSO6yPcHQ r8WraucWoOKauZTfu1iCpHFBGUZASMH1gvlf87SqPB678y6HuJjhiUMmB+UXfWJLYRuAwe GJVQL4PGJ0C0GYLR/wzrgtJ7roAErxkBGkMOBbGCm5f23yyDNNDvHbDzvR7VZgOvv1xWBH 4DnmHYg9W8rjWZjLZ7rU8WvZ7r10xVqg2ko8zfaDEDK1j6uOD1pad8eGpcwps1BLF9srPq 2Vvqn0f9OAfxjsjGZm+XwmhyLqAPZyTIdHdWaQ8ICHTvK+f2oMAlfwLNXU23Iw== 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=1715884088; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XSLqunL8XnXwfCAkUOX8dMPVAHjbEThtiRvc6JBSj3I=; b=IY2TeNwl431jdRD1DadWCRlmaay6eT3jGYlW9tJ2oLeb37w7msGlczT7IeJm2Sd74+0EuF KJbgU8CUfO0HxyZ5IlXcQfpz2rQG0a2g43a3ORVnEiFp+MyznipfyTb7tPX+RacFz32nii qk7kyUV8E031EzXgVmwJ+sscx+VwY+UweBcHqyHaorN7fC48If9doUMTAt/YMb+FBVLmls P8KmCMH65ER7VNAoUq3YpDNODIHPKK59PaGqVOGOUziqMqd8jYc2tUTL/by7WAvIsM5PWM Rzp7O/h8+01P7VvJPz+Ncc3VS76O4D9GErQnjey0HlT1365QNGWRbfCAD7p3JA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgJVw3lvgz18bR; Thu, 16 May 2024 18:28: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 44GIS8rB055466; Thu, 16 May 2024 18:28:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44GIS8jW055463; Thu, 16 May 2024 18:28:08 GMT (envelope-from git) Date: Thu, 16 May 2024 18:28:08 GMT Message-Id: <202405161828.44GIS8jW055463@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mariusz Zaborski Subject: git: 3cb6c6c9eeb3 - main - libcapsicum: document return values List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3cb6c6c9eeb36e0a29986fd518f5ccc567e9eb85 Auto-Submitted: auto-generated The branch main has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=3cb6c6c9eeb36e0a29986fd518f5ccc567e9eb85 commit 3cb6c6c9eeb36e0a29986fd518f5ccc567e9eb85 Author: Mariusz Zaborski AuthorDate: 2024-05-16 18:27:25 +0000 Commit: Mariusz Zaborski CommitDate: 2024-05-16 18:29:18 +0000 libcapsicum: document return values Reviewed by: emaste Requested by: des Differential Revision: https://reviews.freebsd.org/D45222 --- lib/libcapsicum/capsicum_helpers.3 | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/lib/libcapsicum/capsicum_helpers.3 b/lib/libcapsicum/capsicum_helpers.3 index 9c4c0bfa0229..38dd329ef2f3 100644 --- a/lib/libcapsicum/capsicum_helpers.3 +++ b/lib/libcapsicum/capsicum_helpers.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 2, 2020 +.Dd May 16, 2024 .Dt CAPSICUM_HELPERS 3 .Os .Sh NAME @@ -150,6 +150,31 @@ NLS data is used for localized error printing by and .Xr err 3 , among others. +.Sh RETURN VALUES +Upon successful completion, +.Fn caph_enter , +.Fn caph_enter_casper , +.Fn caph_rights_limit , +.Fn caph_ioctls_limit , +.Fn caph_fcntls_limit , +.Fn caph_limit_stream , +.Fn caph_limit_stdin , +.Fn caph_limit_stderr , +.Fn caph_limit_stdout , +and +.Fn caph_limit_stdio +return a value +of 0. +Otherwise, a value of -1 is returned and the global variable +.Va errno +is set to indicate the error. +.Pp +Functions +.Fn caph_stream_rights , +.Fn caph_cache_tzdata , +and +.Fn caph_cache_catpages +can not fail. .Ed .Sh SEE ALSO .Xr cap_enter 2 , From nobody Thu May 16 18:42:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgJpy44jQz5Lghd; Thu, 16 May 2024 18:42: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 4VgJpy3f28z4cMp; Thu, 16 May 2024 18:42:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715884922; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9qc2V4Wvl3ooQY3lXgyetCoO9B57cvYOvxMaWmlRiYM=; b=tFrzdA+KsCCk2d6SWIA5QJWKzOaSZlNc9ClURROq4u4WDdXsolcyXtGGtbf1OgykYFm6gd AEizEvNCDt9uOD7N4UAGSAOcMhTrvbaMa97yaFEbzife7YbzjHLMptTJf1ZRZCLo/xNtW1 EQb2Aud3wW0S78dKiarvx58NBJ42DCMCIfJI6wsnEh/dj3hNnIXY+U4IgbivTkOEOdLj60 h5si1PCMiO7mDABgS/LHu64eKu9gk6ViF3+DYmNNRJR3CM8UGcXq9pUd1syVckjI7woXQ0 lbheJBrzgHIoWOuevjK4FQx7Z/pypN89z4HFGmLak7sbpzhExY6S5eaVmLP+Wg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715884922; a=rsa-sha256; cv=none; b=O5rx82sgcZ9nBsIVkKFQwGzXL7C+oZ4di+UziotDf27uksNzX9RFPB0BcPKMg2opxtYpnU Ck4Sn/SGGIlWrlN1wmAkLNhwFk9R62l1JK2B2jN0au++qpIV8A3bBjGQAjFp8MYGb3VG6y 9uCmAkK7aMA3wLfi93AtPAZfkonbnaYejE13S2NhU1oURef5FY/hiH+TKaK6ia2F9GKiFQ tH2B23LaxD9VxI9Y+LS+lJfr1yMPO7QR3xqj9SmhmPv6a+pB5H/4sLFmn0p6TbCgNWH6ra O4eCzZIAD5NOv3oue1s16acv/igYkYTOr+0UOBHX/SAtlMg1To1X1mqBW1p25w== 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=1715884922; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9qc2V4Wvl3ooQY3lXgyetCoO9B57cvYOvxMaWmlRiYM=; b=fmpFSJQ8gwJLQ5JSyga6tZxNRipvIML7A31Cynczsp9oboK2Ck36Pd2yee9xTXH4KIo3x3 rtAmexpjMhSyhikyxjvtRFzOVHC8l6lnrXModrLMhYh148H8G/+3mX/TbDGnq0JpIz5To1 qlHDbEBVePzqpo7aKWE9siZH3Q3d9tWyLcPlB7kiCW3jVKS5MZQ99giMW3v49I8BElRyMq tLiNOxe04URmNwaqvO5FFAklBXmOV+xRvUD0OuiwWy77dsIw7NjXrhmoLhyVRSJWUyO8Za dQ0CeszHBF2xQ51yfBJVZCJW0K3UR7IvBqznEdejJfJBlwhc3DGphxcCqP2Qzg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgJpy3FSdz18g6; Thu, 16 May 2024 18:42: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 44GIg2kI088437; Thu, 16 May 2024 18:42:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44GIg235088434; Thu, 16 May 2024 18:42:02 GMT (envelope-from git) Date: Thu, 16 May 2024 18:42:02 GMT Message-Id: <202405161842.44GIg235088434@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: fcfb2d639371 - main - Merge commit 87f3407856e6 from llvm-project (by Phoebe Wang): List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/main X-Git-Reftype: branch X-Git-Commit: fcfb2d6393712dee3f1f8f0c3840d14817dea416 Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=fcfb2d6393712dee3f1f8f0c3840d14817dea416 commit fcfb2d6393712dee3f1f8f0c3840d14817dea416 Author: Dimitry Andric AuthorDate: 2024-05-16 18:21:45 +0000 Commit: Dimitry Andric CommitDate: 2024-05-16 18:41:45 +0000 Merge commit 87f3407856e6 from llvm-project (by Phoebe Wang): [X86][Driver] Do not add `-evex512` for `-march=native` when the target doesn't support AVX512 (#91694) This prevents problems with ports that fail to build with CPUTYPE=native, if the native CPU supports AVX512F, resulting in errors like: /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:197:21: error: always_inline function '_mm512_set1_epi8' requires target feature 'evex512', but would be inlined into function 'adler32_x86_avx512_vl512_vnni' that is compiled without support for 'evex512' 197 | const vec_t ones = VSET1_8(1); | ^ /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:116:23: note: expanded from macro 'VSET1_8' 116 | # define VSET1_8(a) _mm512_set1_epi8(a) | ^ /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:197:21: error: AVX vector return of type '__m512i' (vector of 8 'long long' values) without 'evex512' enabled changes the ABI /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:116:23: note: expanded from macro 'VSET1_8' 116 | # define VSET1_8(a) _mm512_set1_epi8(a) | ^ Ports known to be affected are: archivers/libdeflate, devel/highway, www/node20, and lang/rust. (For rust itself there is also a similar issue reported at https://github.com/rust-lang/rust/pull/121088). PR: 276104 Reported by: netchild MFC after: 3 days --- contrib/llvm-project/llvm/lib/TargetParser/Host.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/llvm-project/llvm/lib/TargetParser/Host.cpp b/contrib/llvm-project/llvm/lib/TargetParser/Host.cpp index 1adef15771fa..848b531dd8dd 100644 --- a/contrib/llvm-project/llvm/lib/TargetParser/Host.cpp +++ b/contrib/llvm-project/llvm/lib/TargetParser/Host.cpp @@ -1774,7 +1774,8 @@ 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"]; + if (Features["avx512f"]) + Features["evex512"] = true; Features["avx512dq"] = HasLeaf7 && ((EBX >> 17) & 1) && HasAVX512Save; Features["rdseed"] = HasLeaf7 && ((EBX >> 18) & 1); Features["adx"] = HasLeaf7 && ((EBX >> 19) & 1); From nobody Thu May 16 19:30:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgKvB3vM8z5K2xk; Thu, 16 May 2024 19:30: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 4VgKvB3LRFz4lbV; Thu, 16 May 2024 19:30:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715887846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8M9QuSqaOE73RebYVK8K86VRQjIqfk2PFqsbWWSkuNE=; b=AUK7n85nPzf0pjbTEDqdmBaQnSdlL9usy6RddU9dnH2GoBUbKn+v2zfAcAs3485xzt+/Yn HBP93oIAALGTdZ411LgVYyFhl1ZsISzc+t9JpMG4PZg8E5DtzxuGZ/HtOxmldEnF74d/xQ pnlu6c/SgRkgefCyEskm1SQ9vOT5TpCzyT8fKTMOMrXyQC+6xKgZy3VTSIeofl6xcUyKP0 kkg1qruF/ZuZTDYisLcm/lq5p/lyO8Gt5dldeAhhhUrp5n/SnulCHBcb1D9tpwv1WOSMJI bDsnNrvpny0K1kkhtwKchRn61K1J7cOG1o8ysPBMba8gOdPpAgWBDJ6iBGSLsg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715887846; a=rsa-sha256; cv=none; b=YVYUAxhEa+LvisWSl7kKy1Apq1iwH1XwvuQyzpQv2Y/m5BeSTB5C580PkQ7lEDTa3JomsW t6kgKUCCyW74sYIZhDBkSNg0fRmhTdDMvRr1kbMGi5ujRObPkVvK6D7deqfkYNuE6UvguP P/xxA+qzmb+RODTPCs0psfayN06tn9O72wflrLRPxr+pt1NEWcmmmwFe0w1zx/9sz7RhbV r3Qrn39FLGTHp9VrFjZitjFJyc3PNpQPAaPP6m1h7u4dcGHrKoCXSnCeOrsQizSJFRMl5s bf2ca/uNbU6rAcYJlfOEGaQ0AciaxCfSzHYtRBhJcCaRYLDXbAgZxYwnYn/lEQ== 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=1715887846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8M9QuSqaOE73RebYVK8K86VRQjIqfk2PFqsbWWSkuNE=; b=TKDLbYemBWwHGJCM0xHIhOtUfv37muNFzRCXuGokjfpfnGNtyQDBNltAdluD6OhEQqlmtZ Ke2+u4UJ+uS2gSj1Zlau82Xv2GG6Qz2KBHPoTmTaDOA1MvTlz5tUj/z9UcKCLWBBKjmKFV L2V1gr+wZaNKgzjHCy4EYmIT4pgikWJhOTO+L8VYlVjayIvG9FQIr4+Vj9iVSvnlZ6h8+T KL9k2s5/Z8xCr0qczqStEEHUHOPp5R7EGpQ3onR3yZ/vA/+rby94oVLNHe204sNONP8L5G zHG2LRiRQMMErKRojUZdjWNYPDwt6Hiyh7XKISIxZvOKUiE8Tfta2H/7E/oA3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgKvB2y62z19tL; Thu, 16 May 2024 19:30: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 44GJUkMV066629; Thu, 16 May 2024 19:30:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44GJUkoM066626; Thu, 16 May 2024 19:30:46 GMT (envelope-from git) Date: Thu, 16 May 2024 19:30:46 GMT Message-Id: <202405161930.44GJUkoM066626@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 75529910f77a - main - Trim a spurious trailing backslash List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 75529910f77a1623b83599de0518d39c5fb789df Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=75529910f77a1623b83599de0518d39c5fb789df commit 75529910f77a1623b83599de0518d39c5fb789df Author: John Baldwin AuthorDate: 2024-05-16 19:28:09 +0000 Commit: John Baldwin CommitDate: 2024-05-16 19:29:40 +0000 Trim a spurious trailing backslash Reported by: dim Fixes: 1687d77197c0 man filesystems: move driver pages to section four --- share/man/man4/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index a6a63eab7326..4d3a5273d726 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -687,7 +687,7 @@ MLINKS+=em.4 if_em.4 \ MLINKS+=enc.4 if_enc.4 MLINKS+=epair.4 if_epair.4 MLINKS+=et.4 if_et.4 -MLINKS+=ext2fs.4 ext4fs.4 \ +MLINKS+=ext2fs.4 ext4fs.4 MLINKS+=fd.4 stderr.4 \ fd.4 stdin.4 \ fd.4 stdout.4 From nobody Thu May 16 23:44:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgRX669Ttz5KRp6; Thu, 16 May 2024 23:44:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgRX65ch7z4CMb; Thu, 16 May 2024 23:44:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715903078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K5cd+hjWwOM4lIsRCJn9ZqDB9rvFM/37tQp8+b4fK34=; b=hkeGAH/XiDMkJRgsFH2+Dz9GhDO4cU/cW4l4I0dmcHfC4CROyWOagXVAcD6P8xkIZ99Kmd mQzT/O4P1RSGa9PzgA27D3sPlCuVnrBEScuqXlmspJ1rzr8m2Q9uFzgLp4bDNdQ5xP8rKZ 7I3T13rIZC9YhJLXLkPdtMcN6DvlwXF9iYiaG5Z2FL8oxOIPy8Rk44JfNqzxnW0FtRSz7V /JS3vDBON1SONVezoOe4yRwXAVkxLYRU2wbrVrmA5mhUT0EgEEs3oBK3b7RmagkOinyxQq NJk1ZGEUvxRPT3NOcIM5esmtWGpK+8/k3IS/aW0pthyHfE/Y+vdbWjZBgs7wbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715903078; a=rsa-sha256; cv=none; b=Rs3ETyUT1b+LOrlgXTzVAh9/2hDcFgD8wY4PuIdOFbHSn0+zNtQIW3qeaB4WT+IutX9Gzr 8QHQlMyGkWMMQDCJrMgDButsvKM+NxBnANQ9ZKjYNdoMWNwOlvEbIfjQrX+k//C/2RW/qQ kO2fy+Mc/gs5q8G0YDQdL4Nm9k7hL3MACHZszhvGWS8sqj8HP0o5/u74iMwtCByGQgoye9 44gHfpiELWSXBS6vrx5APzLv0tbVSe3JfwJnQg5hGsKajwRLPuOc/DQAnqenpT6C8o1PNa Bq01UWA7f6Ek90oI3ijJZzYZGuWoCKkInrf5X1s1e9s1QJE7l8Tw12JPpT99XA== 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=1715903078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K5cd+hjWwOM4lIsRCJn9ZqDB9rvFM/37tQp8+b4fK34=; b=xm9G8wl+idi2hnabGlH5mdOBj2BCbWyqk+aWYXjaOhMCnRZ82D2dDwfGJ17iuuxemP/j/K 3+NpaIbFdjH3Fghm6L6N+wjrfGlwgGaK5+N4WG1bObtugtNj3/u30QPY3ENm0CS0dxe2v3 MlaYH4r+JM12ZH6JS3/tPhc371TRCdb/aiK32Sgk16QEOxC5ksFQijmd6tyQtjqIkhtvEe 3bm1R/AKUsl7nYEI0jmI1MrybgHNzV/FROG493rEwIEElKAPmC+izNOd8Ufejy7ZsOwp+s /JiLctCrIUuI0UphDHYYHD07xBqBEhElEesDxIdcff0OisFTi4GTHhx6w/I+/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 4VgRX65CQSzJrF; Thu, 16 May 2024 23:44: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 44GNicq0094379; Thu, 16 May 2024 23:44:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44GNic9B094376; Thu, 16 May 2024 23:44:38 GMT (envelope-from git) Date: Thu, 16 May 2024 23:44:38 GMT Message-Id: <202405162344.44GNic9B094376@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 6b2af2d88ffd - releng/14.1 - Enable soft updates by default for UFS2 filesystems. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 6b2af2d88ffdcae1f50c6e821ce83eb5f5f97fef Auto-Submitted: auto-generated The branch releng/14.1 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=6b2af2d88ffdcae1f50c6e821ce83eb5f5f97fef commit 6b2af2d88ffdcae1f50c6e821ce83eb5f5f97fef Author: Kirk McKusick AuthorDate: 2024-05-15 05:38:35 +0000 Commit: Kirk McKusick CommitDate: 2024-05-16 23:43:01 +0000 Enable soft updates by default for UFS2 filesystems. Differential Revision: https://reviews.freebsd.org/D45201 (cherry picked from commit 61dece6d27fb2436928ca93d65667b358e05aa7b) (cherry picked from commit 7465f9fc06467e57d3bbf2430031fe51d8182c30) Approved by: re (Colin Percival) --- sbin/newfs/newfs.8 | 6 +++++- sbin/newfs/newfs.c | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/sbin/newfs/newfs.8 b/sbin/newfs/newfs.8 index e1496af814ca..0dc93cb8b78d 100644 --- a/sbin/newfs/newfs.8 +++ b/sbin/newfs/newfs.8 @@ -27,7 +27,7 @@ .\" .\" @(#)newfs.8 8.6 (Berkeley) 5/3/95 .\" -.Dd October 21, 2022 +.Dd May 18, 2024 .Dt NEWFS 8 .Os .Sh NAME @@ -100,6 +100,10 @@ The default format is UFS2. For backward compatibility. .It Fl U Enable soft updates on the new file system. +Soft updates are enabled by default for UFS2 format file systems. +Use +.Xr tunefs 8 +to disable soft updates if they are not wanted. .It Fl a Ar maxcontig Specify the maximum number of contiguous blocks that will be laid out before forcing a rotational delay. diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c index afb71f9f25b4..c96e414b85dd 100644 --- a/sbin/newfs/newfs.c +++ b/sbin/newfs/newfs.c @@ -395,6 +395,9 @@ main(int argc, char *argv[]) fprintf(stderr, "because minfree is less than %d%%\n", MINFREE); opt = FS_OPTSPACE; } + /* Use soft updates by default for UFS2 and above */ + if (Oflag > 1) + Uflag = 1; realsectorsize = sectorsize; if (sectorsize != DEV_BSIZE) { /* XXX */ int secperblk = sectorsize / DEV_BSIZE; From nobody Fri May 17 04:07:35 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgYMW4Hwcz5KqYc; Fri, 17 May 2024 04:07: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 4VgYMW3kNJz4WCh; Fri, 17 May 2024 04:07:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715918855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NNLBu2/rmK2cUP3PVhXM/3U+3lnDIvE7G3oJ9eNi2qU=; b=E+unBzIi1MyKUtnx5MbT//kFQqQQ2ldOVjKL9IknLJ6M+rEq4i3CLV/HDn+KbIWwiAmyHW OdPV3DATbU+h6rHMOnYxo3FrOSWeBgBFSdrrwWjYyHK467y4nwsyvo+m0gw3gWaCdAgTXu vLl6xfS/WreG7Meb7F/hA9RfidEtWa2TPvY+rRDWUlOSi9UOl4pRRB5uCyDaYmUWw/KkbT KtajoybqZX56bs06sZ2sfAE3oPK0vNQkR994HTmWn3O9qtCpiqGWt1Dm+80ft/8KgKPQbi Govnx59CixM0a0b9Xf5lBv/00FtMsZJQOFUQkWj2dndzWhd5CzNCDK5xZFgbTg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715918855; a=rsa-sha256; cv=none; b=PjgbDjmVSD9lf5UeIe/VqvIbJXVV/H22mSAReoahHvjs6CT///kGYJpDlgiXOzZKJkfj3z 4jLfgyFKIX09jRz42msr1RuphDfv4NYtqwyFO7ldoexJlVv5L2xNVFO/v04reE1BqWR2eZ ukik9vDPPNM1BL1Q5yOZ/RKGLpG53RJ4Yn5HcXrGUbsPFJHSbC7UR++Hh7A1OK65g+hJCV 7c537xxOa3K/nBZ0a6MP5hS66xyROMTdLII5NFzGFDdMjmMW4f1nNr3SvszmlBsi+QIG0R Z0L2u/3a6XkQtRI7UiiUb8ShgnjD8To/kYryGz+on5Qp8hUrIxOoOwXGi8h5VA== 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=1715918855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NNLBu2/rmK2cUP3PVhXM/3U+3lnDIvE7G3oJ9eNi2qU=; b=hi002t8+SpAuZgpj7G3lTtt9Qfza2MAZmDb8RZ5q5sScxwVhddQg5whtJo/mqUKwO6bmZ9 rheVSW49M1ysDtyoiZt8+TzaaaZIRgulZJ0+bbJhE3fAAGgVuqPLOIUogC9NResMY82Nmj ZXH2eBeg9E66yiKp/jAMLUPGR9/lKIZaV81wP798KMqdS9Opm5pjIgn4chvT0aK1vD+ehd xAcQbGMETMdA4eLPfiK/Z0pH/cthuoRdC7d3AqoNMIcNk/8HjxIBtxMMl/KL8zBzwUEfoi lMiNib/W1Ltc+9zy7aSyQorPkJeZqrN/iVKGplUw7jDR4mvS8V9Ph5x9xsm/EQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgYMW3DkKzRNx; Fri, 17 May 2024 04:07: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 44H47ZBg035011; Fri, 17 May 2024 04:07:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44H47Z6m035008; Fri, 17 May 2024 04:07:35 GMT (envelope-from git) Date: Fri, 17 May 2024 04:07:35 GMT Message-Id: <202405170407.44H47Z6m035008@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: 1652c9e29f5b - stable/14 - boottrace: Use NULL for SYSINIT's last arg, which is a pointer type List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1652c9e29f5b12688c49f02b6ecef550e5650bfe Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=1652c9e29f5b12688c49f02b6ecef550e5650bfe commit 1652c9e29f5b12688c49f02b6ecef550e5650bfe Author: Zhenlei Huang AuthorDate: 2024-05-14 04:03:50 +0000 Commit: Zhenlei Huang CommitDate: 2024-05-17 04:06:50 +0000 boottrace: Use NULL for SYSINIT's last arg, which is a pointer type MFC after: 3 days (cherry picked from commit d9f1f0a901831ff960380fe82a2abe99a3721f87) --- sys/kern/kern_boottrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_boottrace.c b/sys/kern/kern_boottrace.c index 86fee4f47fbe..1b097e7378ad 100644 --- a/sys/kern/kern_boottrace.c +++ b/sys/kern/kern_boottrace.c @@ -613,4 +613,4 @@ boottrace_init(void) st.table = malloc(st.size * sizeof(struct bt_event), M_BOOTTRACE, M_WAITOK | M_ZERO); } -SYSINIT(boottrace, SI_SUB_CPU, SI_ORDER_ANY, boottrace_init, 0); +SYSINIT(boottrace, SI_SUB_CPU, SI_ORDER_ANY, boottrace_init, NULL); From nobody Fri May 17 05:59:13 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgbrK4fcFz5KVjB; Fri, 17 May 2024 05:59:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgbrK43bBz4gSC; Fri, 17 May 2024 05:59:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715925553; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6m7OCEFaZLdmesjtk8wGW1llj76uwSLz4VmAvI1jjLs=; b=UtoR9qBLvPushSOQCuFDw4vsuU8ey0olc6zfBZ6L0UPly7oLt7JgE04CrzOjANs+Shlli3 A5OQX+PDyspr3zRHYD2fk/ohaO+hk/EyJpX7YMMVwWmlHaKVkFFlZSsmSYwOvXmyr4q8eG PvQtFrkKWDdyDw3sEK3RGHFrhqTMxO2Npxc5zqg9Z/gB2XyI5hByIxd/VuutC1ANCwRlH2 EIdaaufcmRanUdLDkS67ziu2vr1UqZvbdkrR4x4fNF1IxYoER8jjv9M3jhYA83M6c/HuFu LY3pg7c8c8WOGD+BfiaKCXSCd/gAJ+2tkk3sR4xdr4wFfgzcOsXv2oOKXwB4EA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715925553; a=rsa-sha256; cv=none; b=WY4JcUSVLOSGEz/KLocdP8i2WUztnKaH2rYbfvDgk/ViIC9/NcV0e/Xg3vEpCFaYCDRTcn V60eHv9aViOjMbfsfqXRveGBheC8DCn5CDuw/Eely6GmZqpg/3Ha8yQV1mWKI+v5frQBvR j4B2l3zFVZxbrfY3bwDw1reXsTW+5XCyvThrJYXdndyR6hV+xcuxOtr0uRFJe1HrZDplUW vr6GpZzEa1wfQLmiO12kwRHO/z1j6KdTHziQipkOcdMXvIXK9wqRmoCTIRpi0nG/w1wnZ0 uA0hOLC77dluJyWMRzNnfPMTa0poTHC7ZNThWUiYF01z5qsdq2m9Mod+zRyBPQ== 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=1715925553; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6m7OCEFaZLdmesjtk8wGW1llj76uwSLz4VmAvI1jjLs=; b=yVYCmLuqcL1leHgd3L57384lUBy6wHKGCM2HfiXOAm6EbUULi1D5aZldJYdiJSk1rt5lAi H/K+LqpbgB3h5wz0Ri1mG7MTNZVzWMJHtqnhSezCitg+q+cujyTvi0iccuiatJ+ubioiBG 0MJ9tN+iTHK0muLWEeH3lDuXMpVn6P9zh/kXjPlzOi2+LocTPQEaNAtlM5ka6O6lal1CH4 aXxVvVIhNyK5vfTu6xJG1otAeOX3yBmUWnZ25Dd5O2Sw4/FOkR71ez7DikFRN0rbBwz8XZ ew2PUkPkrXxrJQB+1Eol79u4MgfS/hTMb4Q/IbFNLyMj6YidD3inrDRn1DGqlA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgbrK3X8szW4x; Fri, 17 May 2024 05:59:13 +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 44H5xDsp019864; Fri, 17 May 2024 05:59:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44H5xD7d019861; Fri, 17 May 2024 05:59:13 GMT (envelope-from git) Date: Fri, 17 May 2024 05:59:13 GMT Message-Id: <202405170559.44H5xD7d019861@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: cff79fd02636 - main - linuxkpi: Fix spin_lock_init List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cff79fd02636f34010d8b835cc9e55401fa76e74 Auto-Submitted: auto-generated The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=cff79fd02636f34010d8b835cc9e55401fa76e74 commit cff79fd02636f34010d8b835cc9e55401fa76e74 Author: Emmanuel Vadot AuthorDate: 2024-05-17 04:52:53 +0000 Commit: Emmanuel Vadot CommitDate: 2024-05-17 05:58:59 +0000 linuxkpi: Fix spin_lock_init Some linux code re-init some spinlock so add MTX_NEW to mtx_init. Reported by: David Wolfskill Fixes: ae38a1a1bfdf ("linuxkpi: spinlock: Simplify code") --- sys/compat/linuxkpi/common/include/linux/spinlock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/spinlock.h b/sys/compat/linuxkpi/common/include/linux/spinlock.h index 3f6eb4bb70f6..2992e41c9c02 100644 --- a/sys/compat/linuxkpi/common/include/linux/spinlock.h +++ b/sys/compat/linuxkpi/common/include/linux/spinlock.h @@ -140,7 +140,7 @@ typedef struct mtx spinlock_t; #define spin_lock_name(name) _spin_lock_name(name, __FILE__, __LINE__) #define spin_lock_init(lock) mtx_init(lock, spin_lock_name("lnxspin"), \ - NULL, MTX_DEF | MTX_NOWITNESS) + NULL, MTX_DEF | MTX_NOWITNESS | MTX_NEW) #define spin_lock_destroy(_l) mtx_destroy(_l) From nobody Fri May 17 05:59:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgbrL5Zbnz5KVK2; Fri, 17 May 2024 05:59:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgbrL4lj0z4gMj; Fri, 17 May 2024 05:59:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715925554; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IPAZUtkBVjYQKPrI784opn/DoOM+4NgzeWTlD9wWDTo=; b=vlAa41LhkSUPK5WEFg/NNtKgESd+OLdmM4VCqJ4MY2oSCc04XLrV+x/UEmx5u4gB/rFC8U Rou7KB7WpW3ObZcf7KQVYMB2Sj/CrKVzlqaVQz82R8+oBdh4GRo2Rkc/M1ZV6pNBaCJJ9L 5irGy12N1PpcJw9SDjNlr/QvNFwguqvNuQS+5Mpo6MhE+HSTY8BR74rkXAU8trjWVR2zeu DOfreU1XzL7yj5CiABYuhtxuIjcEXpec/j4hibCI4cgmLjoCJA/Vp6kZ3cNAR43iX+vCbV TZgfjDDMMHvBBtWgI80XYAu6ZngBZwZa9W5HnjjyeniA+GlKG5Nm7BD5I7zSaw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715925554; a=rsa-sha256; cv=none; b=iTte+WxPYZR0a3+yDorCFTRNZrFHItASCZ8kGYbkOLw6OoJTfeBozQKR3TrwPtU/6wQ+PI 6IopvIrqskHx7TQacLI+bIsf0i7jbbquOfTBfoNBKdEphQIAUCfUYhAjI7Dmez34RMsigd PjbhPbh47gqToDX3w5PSUvREGu+YiIfHKpoxdrhVvI1fVC+agRxpYpFmGP/NlUuDosPRbD NAKU79nFS5QCCMYoBM7dmDfnm0QS1MkDTfH4xt8zkwuhHqxpVvgOnWYKK21ykP847y54Fd fp8TxpRTYJe9mPDdsdK+++DIWxH4+EA37iPc3DF/uvtPvpPTMf1TMw4Fx5ah4g== 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=1715925554; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IPAZUtkBVjYQKPrI784opn/DoOM+4NgzeWTlD9wWDTo=; b=P1s15qwMmnZso9a9vJoMN3VsU5ymVqjGIYBPWH6YW+cCn9ZqrQam7saxrNxX3wpUR593Qd DhNlkIqpF7qdal3V96qZAzFD4xDDJxiT1ig8lRmTgpxHwraYgyxqj3FBPWWKjhAhwh+G5Z RYEAeSNqwE2ym9hEyzXPn03CV2vlZpija/5g2snTAC9JTmRLYphOTridjXf/eBnRNVwyba F45N2ENtL6GzI+04vq6cn43aeAkhv0rZWgwEMilvUwArEBRWfHgDh+qU6x/XGacP8wAxan Dkd43F4NNiUAmWWPQl74yz0nvM+Gs3HFqqx4zQIQ4KTtJc83lQb23pnuazVReQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgbrL4JGdzV9B; Fri, 17 May 2024 05:59:14 +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 44H5xEPa019903; Fri, 17 May 2024 05:59:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44H5xEm1019900; Fri, 17 May 2024 05:59:14 GMT (envelope-from git) Date: Fri, 17 May 2024 05:59:14 GMT Message-Id: <202405170559.44H5xEm1019900@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: a7b222db122e - main - linuxkpi: rwlock: Fix rwlock_init List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a7b222db122e99f587d87eeec303c8abc9aea04e Auto-Submitted: auto-generated The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=a7b222db122e99f587d87eeec303c8abc9aea04e commit a7b222db122e99f587d87eeec303c8abc9aea04e Author: Emmanuel Vadot AuthorDate: 2024-05-17 05:54:36 +0000 Commit: Emmanuel Vadot CommitDate: 2024-05-17 05:59:02 +0000 linuxkpi: rwlock: Fix rwlock_init Some linux code re-init some spinlock so add MTX_NEW to mtx_init. Reported by: rlibby Fixes: 5c0a1923486e ("linuxkpi: rwlock: Simplify code") --- sys/compat/linuxkpi/common/include/linux/rwlock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/rwlock.h b/sys/compat/linuxkpi/common/include/linux/rwlock.h index 126b70c875c0..3030ec89ff1e 100644 --- a/sys/compat/linuxkpi/common/include/linux/rwlock.h +++ b/sys/compat/linuxkpi/common/include/linux/rwlock.h @@ -52,6 +52,6 @@ typedef struct rwlock rwlock_t; do { read_unlock(lock); } while (0) #define write_unlock_irqrestore(lock, flags) \ do { write_unlock(lock); } while (0) -#define rwlock_init(_l) rw_init_flags(_l, "lnxrw", RW_NOWITNESS) +#define rwlock_init(_l) rw_init_flags(_l, "lnxrw", RW_NOWITNESS | RW_NEW) #endif /* _LINUXKPI_LINUX_RWLOCK_H_ */ From nobody Fri May 17 10:21:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgjgK4kLCz5Kw13; Fri, 17 May 2024 10:21:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgjgK4GXDz53Lx; Fri, 17 May 2024 10:21:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715941309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QrVx4xxm7hRDrgcuayeRKqTuRJAI4EJFst+nmeJIn5g=; b=BjfFJkTakMve/us5X4O0B/cQOVnwkrTB2m/a+3grqeEUIYHsmIaUqJ5Qamiopl/wX7Ek9/ NAPoY9Vk1D7J2FoPcetUG1cCXKg8XHhwHirYMFdWJ9NkxfI96Lhkn5b9eGfbx6QHHxlqCg vTCXrHB5jPHMFCsQ6Ne+s25+aCxCqHkCDzlaE4W7aTXQRAooi39cvyyyAfAwZ/5UpsvLMe J5BZ0kyJYkUD4n+xrgNPn8Dckthli/Db39zhxWZ+GITnfevU7EBipLH+y0BBI57YyZNceO XiMY35+ocGTaeeevN/z/cXHnBdIs50gDWGPbvCROH4K22NYMNjSrnJmrcfx3mQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715941309; a=rsa-sha256; cv=none; b=CBlfP3aqoOoxwWDFy52h8BrcKRgBZa2i0V6GqfA/4n4i6voxAu0gK9nlfmDPiXpZ7cjKFS PzTltgqiPZznCv8NVl7ouBYVeM0rXBpW81JsXbWLHlhuVjrfnFhTpJCFDUD74PxtvttjVq D1r5q2c29REAvmriai00+UwwaaP0YqdOsvMqjw1bRb6fE4oyP2o1XLk9Hv8AlP9FW8MFEt WKiQmnIAVHFbUQtXGvZBOpZ4yRzlnEFsz5BTnZvj9dbbpojpSSM6XVHVK6xnCZja/BHiar vnPpg1F7Vm7HkIWyQ1MTNgxUJX6YGJaV6/Xc3Dm0RVk+0lRyLB2o/Mp/LqMcPA== 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=1715941309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QrVx4xxm7hRDrgcuayeRKqTuRJAI4EJFst+nmeJIn5g=; b=as45wSoW0eZ+gUsv8jtHUZmq9/7ZwWJQOgyVb6zBjLtbXrwljfrluGQpDYrj4+INnS6/16 TbmuvIWgkqTQubDHoiJwRlyPdhaLkvuU0B7G4jcdwcl2hP7KmXXhN3qynU6LVC8U4AJHvo aYfz+dNPPZV30nui4AtBcHWwPMYDvIgeRHIP3SCJk3BYDd0g1yUTKiRppV2n12eqrHCb1Z mdyg7TxoTIkQtTmZ/y5wC75Bw8MQoQc0TmPJFcJtCYt/K4qk1E2NsXFLGePNUwXEy918fk D/NPlddu7k4hR0sfN5hVIvP9r5QfDUOELVvqUZcwVDC3d58l4zPCDyfUipIvnA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgjgK3sbfzfTd; Fri, 17 May 2024 10:21:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44HALnAA069611; Fri, 17 May 2024 10:21:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HALnMx069608; Fri, 17 May 2024 10:21:49 GMT (envelope-from git) Date: Fri, 17 May 2024 10:21:49 GMT Message-Id: <202405171021.44HALnMx069608@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 06db20ffeca9 - main - rtld: Add MD_OBJ_ENTRY to extend Struct_Obj_Entry List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 06db20ffeca9898e5802d63f3b06caaa37c3a4ed Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=06db20ffeca9898e5802d63f3b06caaa37c3a4ed commit 06db20ffeca9898e5802d63f3b06caaa37c3a4ed Author: Andrew Turner AuthorDate: 2024-05-07 15:49:53 +0000 Commit: Andrew Turner CommitDate: 2024-05-17 09:36:08 +0000 rtld: Add MD_OBJ_ENTRY to extend Struct_Obj_Entry Add a macro the architectures can use to add per-arch fields to Struct_Obj_Entry. Reviewed by: kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45116 --- libexec/rtld-elf/aarch64/rtld_machdep.h | 2 ++ libexec/rtld-elf/amd64/rtld_machdep.h | 2 ++ libexec/rtld-elf/arm/rtld_machdep.h | 2 ++ libexec/rtld-elf/i386/rtld_machdep.h | 2 ++ libexec/rtld-elf/powerpc/rtld_machdep.h | 2 ++ libexec/rtld-elf/powerpc64/rtld_machdep.h | 2 ++ libexec/rtld-elf/riscv/rtld_machdep.h | 2 ++ libexec/rtld-elf/rtld.h | 2 ++ 8 files changed, 16 insertions(+) diff --git a/libexec/rtld-elf/aarch64/rtld_machdep.h b/libexec/rtld-elf/aarch64/rtld_machdep.h index 36e3ec3e1a4e..a3031fe7e539 100644 --- a/libexec/rtld-elf/aarch64/rtld_machdep.h +++ b/libexec/rtld-elf/aarch64/rtld_machdep.h @@ -37,6 +37,8 @@ struct Struct_Obj_Entry; +#define MD_OBJ_ENTRY + /* Return the address of the .dynamic section in the dynamic linker. */ #define rtld_dynamic(obj) \ ({ \ diff --git a/libexec/rtld-elf/amd64/rtld_machdep.h b/libexec/rtld-elf/amd64/rtld_machdep.h index ab23567cb6e6..558c0a73123f 100644 --- a/libexec/rtld-elf/amd64/rtld_machdep.h +++ b/libexec/rtld-elf/amd64/rtld_machdep.h @@ -35,6 +35,8 @@ struct Struct_Obj_Entry; +#define MD_OBJ_ENTRY + /* Return the address of the .dynamic section in the dynamic linker. */ Elf_Dyn *rtld_dynamic_addr(void); #define rtld_dynamic(obj) rtld_dynamic_addr() diff --git a/libexec/rtld-elf/arm/rtld_machdep.h b/libexec/rtld-elf/arm/rtld_machdep.h index 26f62547ae8e..a492ac0eab77 100644 --- a/libexec/rtld-elf/arm/rtld_machdep.h +++ b/libexec/rtld-elf/arm/rtld_machdep.h @@ -36,6 +36,8 @@ struct Struct_Obj_Entry; +#define MD_OBJ_ENTRY + /* Return the address of the .dynamic section in the dynamic linker. */ #define rtld_dynamic(obj) (&_DYNAMIC) diff --git a/libexec/rtld-elf/i386/rtld_machdep.h b/libexec/rtld-elf/i386/rtld_machdep.h index 69078d56df4c..f39300d16ddb 100644 --- a/libexec/rtld-elf/i386/rtld_machdep.h +++ b/libexec/rtld-elf/i386/rtld_machdep.h @@ -35,6 +35,8 @@ struct Struct_Obj_Entry; +#define MD_OBJ_ENTRY + /* Return the address of the .dynamic section in the dynamic linker. */ #define rtld_dynamic(obj) \ ((const Elf_Dyn *)((obj)->relocbase + (Elf_Addr)&_DYNAMIC)) diff --git a/libexec/rtld-elf/powerpc/rtld_machdep.h b/libexec/rtld-elf/powerpc/rtld_machdep.h index 2450d58490e1..03ef11f4034b 100644 --- a/libexec/rtld-elf/powerpc/rtld_machdep.h +++ b/libexec/rtld-elf/powerpc/rtld_machdep.h @@ -35,6 +35,8 @@ struct Struct_Obj_Entry; +#define MD_OBJ_ENTRY + /* Return the address of the .dynamic section in the dynamic linker. */ #define rtld_dynamic(obj) (&_DYNAMIC) diff --git a/libexec/rtld-elf/powerpc64/rtld_machdep.h b/libexec/rtld-elf/powerpc64/rtld_machdep.h index 63939110356b..f36be944e80a 100644 --- a/libexec/rtld-elf/powerpc64/rtld_machdep.h +++ b/libexec/rtld-elf/powerpc64/rtld_machdep.h @@ -35,6 +35,8 @@ struct Struct_Obj_Entry; +#define MD_OBJ_ENTRY + /* Return the address of the .dynamic section in the dynamic linker. */ #define rtld_dynamic(obj) (&_DYNAMIC) diff --git a/libexec/rtld-elf/riscv/rtld_machdep.h b/libexec/rtld-elf/riscv/rtld_machdep.h index 814840790902..2244a424f8c1 100644 --- a/libexec/rtld-elf/riscv/rtld_machdep.h +++ b/libexec/rtld-elf/riscv/rtld_machdep.h @@ -42,6 +42,8 @@ struct Struct_Obj_Entry; +#define MD_OBJ_ENTRY + uint64_t set_gp(struct Struct_Obj_Entry *obj); /* Return the address of the .dynamic section in the dynamic linker. */ diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h index 6311b3e6cc7f..a4f2c35cc03f 100644 --- a/libexec/rtld-elf/rtld.h +++ b/libexec/rtld-elf/rtld.h @@ -277,6 +277,8 @@ typedef struct Struct_Obj_Entry { bool unholdfree : 1; /* unmap upon last unhold */ bool doomed : 1; /* Object cannot be referenced */ + MD_OBJ_ENTRY; + struct link_map linkmap; /* For GDB and dlinfo() */ Objlist dldags; /* Object belongs to these dlopened DAGs (%) */ Objlist dagmembers; /* DAG has these members (%) */ From nobody Fri May 17 10:21:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgjgL5ykzz5Kw3b; Fri, 17 May 2024 10:21:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgjgL5CkYz53Xq; Fri, 17 May 2024 10:21:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715941310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M0jb7vEoMIUGsMkuwKLRL7XvTm1PTBPFGJQ1yn3Kfi8=; b=gS7eeGUC9ju1bj4GJYa2aNMSPgRMDgDquXBDfrhZBRRcrAED7/Aww7tnfeiq8pZVDSErcG /G1KexfXHD/VUGRQEp4yHwZ03JIPxoAJ2dj03Thyn52raOuYNM3ULmyhZfOFuSCFNJmLuA 6lx1Ht9jh2IKbwk0yYFZdSuZXrwUlZEfwRf1HSZ/442R7uD4bwyuJhuNjeVvdgG+YP9WaU t4P/QyIhjpGLWNJK9HmyJbE7fI0tAbD3hraSSfBBJ+N9ZspzX3lPWygIuRvio9ZqduhQVC o3shsjkA2h9RvEWVPbGLkqHELROC2bV+SN/6582KGQmopbFpZc3lUUMt2YLbaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715941310; a=rsa-sha256; cv=none; b=A6yWFBw5EPne/S1KUhj+Rl6fyYMZO/fpYjgnqUTogrQa1NhMxPLoMgR9OBDvKcvnaX+XEN +F43vwDAuYF8qxIU32EV5JzaO2T4dvsDwNJs27MtxKpQjKSaCv+Oy3EeTZOp7K+9XKrHeA spZWcSkokGi0tFMMPNtmJ5vrcgHl/53U3y7NDk/tb/Eq/EO1YmEUDxilAgeN/fAIfn/QE0 vv1oUxVBupt8D8jCRvN7bbAsLqa2ygxq+kTaEV0HngYWpZte/4cMtetkIjH+V2cEIn8H0B c6RkGq0n5hNgjt0FWEbDKsEuPRuT2wxk84tVyB7FaD2C2di2kO23QWw42xpJeQ== 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=1715941310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M0jb7vEoMIUGsMkuwKLRL7XvTm1PTBPFGJQ1yn3Kfi8=; b=x44mCV+yKmOmir6ZjiEhyP6rzI6r1SIwNuHh7lDdLW3DW6HvKxPu8ROoSJ8YYgc0V4vx1I HYPjYvOkYJsJ0SeTfk1uQQMZN7VSV9b5KNuJvcJSZRjd79fMo2nbzl62kZj3SS8rKD0Z0t FGzVsop15cUleIKk00l/+4A97iKbgfRJXDRmO6VwL6EoKVJ6sFblklusYZKHnMFpf14A8y hEEvd0YvTeL+kNeo1DT1/3GtvSwcF7wVMlIrReLq2FbQ5FK+eBjeWFSyO+nqDtkFkb+zfr c1vZbEh3l29dBtnIH3bRNc/Vf8KywnHTWRThFp9RUixkkLANhbzZe36ok/bncA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgjgL4pxhzfLC; Fri, 17 May 2024 10:21:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44HALoFc069647; Fri, 17 May 2024 10:21:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HALobq069644; Fri, 17 May 2024 10:21:50 GMT (envelope-from git) Date: Fri, 17 May 2024 10:21:50 GMT Message-Id: <202405171021.44HALobq069644@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: dd4155bec744 - main - rtld: Add arch_digest_dynamic List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dd4155bec744acf2ebfd037f7719c4aed9283a73 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=dd4155bec744acf2ebfd037f7719c4aed9283a73 commit dd4155bec744acf2ebfd037f7719c4aed9283a73 Author: Andrew Turner AuthorDate: 2024-05-07 16:14:47 +0000 Commit: Andrew Turner CommitDate: 2024-05-17 09:37:12 +0000 rtld: Add arch_digest_dynamic This will be used to handle the DT_AARCH64_VARIANT_PCS tag. Reviewed by: kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45117 --- libexec/rtld-elf/aarch64/rtld_machdep.h | 3 +++ libexec/rtld-elf/amd64/rtld_machdep.h | 3 +++ libexec/rtld-elf/arm/rtld_machdep.h | 3 +++ libexec/rtld-elf/i386/rtld_machdep.h | 3 +++ libexec/rtld-elf/powerpc/rtld_machdep.h | 3 +++ libexec/rtld-elf/powerpc64/rtld_machdep.h | 3 +++ libexec/rtld-elf/riscv/rtld_machdep.h | 3 +++ libexec/rtld-elf/rtld.c | 3 +++ 8 files changed, 24 insertions(+) diff --git a/libexec/rtld-elf/aarch64/rtld_machdep.h b/libexec/rtld-elf/aarch64/rtld_machdep.h index a3031fe7e539..347ef5f381fe 100644 --- a/libexec/rtld-elf/aarch64/rtld_machdep.h +++ b/libexec/rtld-elf/aarch64/rtld_machdep.h @@ -47,6 +47,9 @@ struct Struct_Obj_Entry; (const Elf_Dyn *)_dynamic_addr; \ }) +/* No arch-specific dynamic tags */ +#define arch_digest_dynamic(obj, dynp) false + bool arch_digest_note(struct Struct_Obj_Entry *obj, const Elf_Note *note); Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, diff --git a/libexec/rtld-elf/amd64/rtld_machdep.h b/libexec/rtld-elf/amd64/rtld_machdep.h index 558c0a73123f..1797d13c847d 100644 --- a/libexec/rtld-elf/amd64/rtld_machdep.h +++ b/libexec/rtld-elf/amd64/rtld_machdep.h @@ -41,6 +41,9 @@ struct Struct_Obj_Entry; Elf_Dyn *rtld_dynamic_addr(void); #define rtld_dynamic(obj) rtld_dynamic_addr() +/* No arch-specific dynamic tags */ +#define arch_digest_dynamic(obj, dynp) false + /* No architecture specific notes */ #define arch_digest_note(obj, note) false diff --git a/libexec/rtld-elf/arm/rtld_machdep.h b/libexec/rtld-elf/arm/rtld_machdep.h index a492ac0eab77..f59b30028a3b 100644 --- a/libexec/rtld-elf/arm/rtld_machdep.h +++ b/libexec/rtld-elf/arm/rtld_machdep.h @@ -41,6 +41,9 @@ struct Struct_Obj_Entry; /* Return the address of the .dynamic section in the dynamic linker. */ #define rtld_dynamic(obj) (&_DYNAMIC) +/* No arch-specific dynamic tags */ +#define arch_digest_dynamic(obj, dynp) false + /* No architecture specific notes */ #define arch_digest_note(obj, note) false diff --git a/libexec/rtld-elf/i386/rtld_machdep.h b/libexec/rtld-elf/i386/rtld_machdep.h index f39300d16ddb..581f1dfb002d 100644 --- a/libexec/rtld-elf/i386/rtld_machdep.h +++ b/libexec/rtld-elf/i386/rtld_machdep.h @@ -41,6 +41,9 @@ struct Struct_Obj_Entry; #define rtld_dynamic(obj) \ ((const Elf_Dyn *)((obj)->relocbase + (Elf_Addr)&_DYNAMIC)) +/* No arch-specific dynamic tags */ +#define arch_digest_dynamic(obj, dynp) false + /* No architecture specific notes */ #define arch_digest_note(obj, note) false diff --git a/libexec/rtld-elf/powerpc/rtld_machdep.h b/libexec/rtld-elf/powerpc/rtld_machdep.h index 03ef11f4034b..69fc52369201 100644 --- a/libexec/rtld-elf/powerpc/rtld_machdep.h +++ b/libexec/rtld-elf/powerpc/rtld_machdep.h @@ -40,6 +40,9 @@ struct Struct_Obj_Entry; /* Return the address of the .dynamic section in the dynamic linker. */ #define rtld_dynamic(obj) (&_DYNAMIC) +/* No arch-specific dynamic tags */ +#define arch_digest_dynamic(obj, dynp) false + /* No architecture specific notes */ #define arch_digest_note(obj, note) false diff --git a/libexec/rtld-elf/powerpc64/rtld_machdep.h b/libexec/rtld-elf/powerpc64/rtld_machdep.h index f36be944e80a..d1dab63d3779 100644 --- a/libexec/rtld-elf/powerpc64/rtld_machdep.h +++ b/libexec/rtld-elf/powerpc64/rtld_machdep.h @@ -40,6 +40,9 @@ struct Struct_Obj_Entry; /* Return the address of the .dynamic section in the dynamic linker. */ #define rtld_dynamic(obj) (&_DYNAMIC) +/* No arch-specific dynamic tags */ +#define arch_digest_dynamic(obj, dynp) false + /* No architecture specific notes */ #define arch_digest_note(obj, note) false diff --git a/libexec/rtld-elf/riscv/rtld_machdep.h b/libexec/rtld-elf/riscv/rtld_machdep.h index 2244a424f8c1..fb5f5643efc6 100644 --- a/libexec/rtld-elf/riscv/rtld_machdep.h +++ b/libexec/rtld-elf/riscv/rtld_machdep.h @@ -54,6 +54,9 @@ uint64_t set_gp(struct Struct_Obj_Entry *obj); (const Elf_Dyn *)_dynamic_addr; \ }) +/* No arch-specific dynamic tags */ +#define arch_digest_dynamic(obj, dynp) false + /* No architecture specific notes */ #define arch_digest_note(obj, note) false diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 5743bbdd6f61..20c340ed15a3 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -1554,6 +1554,9 @@ digest_dynamic1(Obj_Entry *obj, int early, const Elf_Dyn **dyn_rpath, break; default: + if (arch_digest_dynamic(obj, dynp)) + break; + if (!early) { dbg("Ignoring d_tag %ld = %#lx", (long)dynp->d_tag, (long)dynp->d_tag); From nobody Fri May 17 10:21:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgjgN0csRz5KvsS; Fri, 17 May 2024 10:21: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 4VgjgM611cz53Y4; Fri, 17 May 2024 10:21:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715941311; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uURwzyIzmsOM7GAqS8P27VrK2W8EVPpL7glr5dP34zw=; b=HsDR5FUs+j1XG9kfdmwNcuz8U9LdIclyvnncueUuF3M9ckGy4V1pFkCEtt0h5zHPsqn5qg cRPLv6gwdloGL+pv495skXCxuavsIWhuSC03LsAPlbdT/2j1DKVY7hYihXmcYunpAoHVqO l10tunW7m+J7QWrlVHtH1D1C6L6Q9fCksCBN0eS8R2AG8k8jqGMM0xZKz9+D0+/yIk14zb ih4E57Kwy/6umLUX3yTL+wQQudVWUhI0/3o9/GL//E5UYAyNT5+9TfViCEM3cphVP1tVIj UUrBJpBeRJeTigj0/Pm4nsuJ5TNjsV0wkp9jTcSd7SOJacqzyQA9V5KwEFk41A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715941311; a=rsa-sha256; cv=none; b=eD+0HS3OFJxdTU70fOmpLbX75X3AYloZ8dM+Oj3r3+ex+fMs2X6ezGTegfmbcFYu9ek134 atUkqJz6xQX8fXKY04LEUUxUQDpICJiPJFHB98q2fgeh8cj+4GJ+RdBbnpc1kS480Dqh98 zM3w/9kgA8MlIr2jnmv4sW5tjzCdgteW4QLvrL3v8rW5dvvkJzDlxgRfSxRXBldFd8EeYa McpSOjG4ZpD4PTEfCk2flAKecLcHfXvZ35Ty9Boj7FDwqMvxvMSH5OYoNF8cIk5gZ1Ijb4 QamotLFxVb4RlIKh3nqT9GCrlmWfBtppOPz8OPq4uWt00f9/m1Wuv9TpMqPIbA== 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=1715941311; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uURwzyIzmsOM7GAqS8P27VrK2W8EVPpL7glr5dP34zw=; b=HKwL+H/wWQqitkcuoARzGTyki0n4eYkX4KbV4SiRTyvgTMcS505CzLQSNjyOT2FtAC6FgC e3aJzocCchE6EQD7Ur+1MU+lJEcbeDfFi97mGmFL1q8ZbmDzzlNmULrQpgR5gdOE/SX7sJ XRdP7m7BrmbQfjy2ECjp680bHrVdQCeIXQWKuZLqd3gjKF5I7jixOQevX9oOWnzV0GxGps OwMacHP+uOrS+Y9P98IGchVFkqCvhu05GDpL/tEUrPSPQWlhzblvv94jchwIMjlfCMhgZa ehUm4LOewxQ6KGKfh+/GuXn0acS7sF+F1IGom595SGBIEhWlXwK81lP9x+wN4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgjgM5QrGzfTf; Fri, 17 May 2024 10:21: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 44HALpid069702; Fri, 17 May 2024 10:21:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HALp5H069699; Fri, 17 May 2024 10:21:51 GMT (envelope-from git) Date: Fri, 17 May 2024 10:21:51 GMT Message-Id: <202405171021.44HALp5H069699@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: d51fa0a9b11d - main - rtld: Add support for arm64 variant pcs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d51fa0a9b11db524a8e872c0019e54846a03d8a9 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=d51fa0a9b11db524a8e872c0019e54846a03d8a9 commit d51fa0a9b11db524a8e872c0019e54846a03d8a9 Author: Andrew Turner AuthorDate: 2024-04-17 15:29:29 +0000 Commit: Andrew Turner CommitDate: 2024-05-17 09:37:23 +0000 rtld: Add support for arm64 variant pcs The aarch64 ELF spec has support for a variant of the normal procedure call standard that doesn't follow the normal register convention, e.g. using more registers as arguments, or different register state is preserved. Add support to rtld to handle this. As we don't know which registers need to be preserved disable lazy binding for these functions. Reviewed by: kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D44869 --- libexec/rtld-elf/aarch64/reloc.c | 50 +++++++++++++++++++++++++++++++-- libexec/rtld-elf/aarch64/rtld_machdep.h | 6 ++-- 2 files changed, 51 insertions(+), 5 deletions(-) diff --git a/libexec/rtld-elf/aarch64/reloc.c b/libexec/rtld-elf/aarch64/reloc.c index d73982e26b76..78e2e2b1aaae 100644 --- a/libexec/rtld-elf/aarch64/reloc.c +++ b/libexec/rtld-elf/aarch64/reloc.c @@ -54,6 +54,17 @@ void *_rtld_tlsdesc_dynamic(void *); void _exit(int); +bool +arch_digest_dynamic(struct Struct_Obj_Entry *obj, const Elf_Dyn *dynp) +{ + if (dynp->d_tag == DT_AARCH64_VARIANT_PCS) { + obj->variant_pcs = true; + return (true); + } + + return (false); +} + bool arch_digest_note(struct Struct_Obj_Entry *obj __unused, const Elf_Note *note) { @@ -228,19 +239,54 @@ reloc_tlsdesc(const Obj_Entry *obj, const Elf_Rela *rela, Elf_Addr *where, int reloc_plt(Obj_Entry *obj, int flags, RtldLockState *lockstate) { + const Obj_Entry *defobj; const Elf_Rela *relalim; const Elf_Rela *rela; + const Elf_Sym *def, *sym; + bool lazy; relalim = (const Elf_Rela *)((const char *)obj->pltrela + obj->pltrelasize); for (rela = obj->pltrela; rela < relalim; rela++) { - Elf_Addr *where; + Elf_Addr *where, target; where = (Elf_Addr *)(obj->relocbase + rela->r_offset); switch(ELF_R_TYPE(rela->r_info)) { case R_AARCH64_JUMP_SLOT: - *where += (Elf_Addr)obj->relocbase; + lazy = true; + if (obj->variant_pcs) { + sym = &obj->symtab[ELF_R_SYM(rela->r_info)]; + /* + * Variant PCS functions don't follow the + * standard register convention. Because of + * this we can't use lazy relocation and + * need to set the target address. + */ + if ((sym->st_other & STO_AARCH64_VARIANT_PCS) != + 0) + lazy = false; + } + if (lazy) { + *where += (Elf_Addr)obj->relocbase; + } else { + def = find_symdef(ELF_R_SYM(rela->r_info), obj, + &defobj, SYMLOOK_IN_PLT | flags, NULL, + lockstate); + if (def == NULL) + return (-1); + if (ELF_ST_TYPE(def->st_info) == STT_GNU_IFUNC){ + obj->gnu_ifunc = true; + continue; + } + target = (Elf_Addr)(defobj->relocbase + + def->st_value); + /* + * Ignore ld_bind_not as it requires lazy + * binding + */ + *where = target; + } break; case R_AARCH64_TLSDESC: reloc_tlsdesc(obj, rela, where, SYMLOOK_IN_PLT | flags, diff --git a/libexec/rtld-elf/aarch64/rtld_machdep.h b/libexec/rtld-elf/aarch64/rtld_machdep.h index 347ef5f381fe..3cc1339fcad4 100644 --- a/libexec/rtld-elf/aarch64/rtld_machdep.h +++ b/libexec/rtld-elf/aarch64/rtld_machdep.h @@ -37,7 +37,8 @@ struct Struct_Obj_Entry; -#define MD_OBJ_ENTRY +#define MD_OBJ_ENTRY \ + bool variant_pcs : 1; /* Object has a variant pcs function */ /* Return the address of the .dynamic section in the dynamic linker. */ #define rtld_dynamic(obj) \ @@ -47,8 +48,7 @@ struct Struct_Obj_Entry; (const Elf_Dyn *)_dynamic_addr; \ }) -/* No arch-specific dynamic tags */ -#define arch_digest_dynamic(obj, dynp) false +bool arch_digest_dynamic(struct Struct_Obj_Entry *obj, const Elf_Dyn *dynp); bool arch_digest_note(struct Struct_Obj_Entry *obj, const Elf_Note *note); From nobody Fri May 17 10:21:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgjgP1Y6Rz5KvvC; Fri, 17 May 2024 10:21: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 4VgjgN6RG4z53bf; Fri, 17 May 2024 10:21:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715941312; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8pE16jvBoTSHPGhdRnYTTITPxKkjEms2T6IJDzHPEnc=; b=pXf0vTFcJYU/K2Tnn76PWnfxJd5sH+Av68/NnI9GHLbI8MR3iHchGqEY9VE6W20NxyUS0z rQgGpn6CxBUaHQDfvvOgdXUnZduuYmZLcCi9AX6ZGytT294QUQGX4b7sI58Fd7houm4Hmp 3iaRqWaTox3hyUe7KyDK2+MwYMYwAv3viDNsBXFYgEb7VENSZJoe+4pHfAulcT6sdI83+n rnh3HJ1zJRUzCRuIIeKKt8tSyuVg3GjhM/optjo+qynxG3lJe+qKaxNMD4/PYs+wSfqqyK rhvP+GBLTrdCuKcS6P1x2aMRjv/hzywMzZkpxvGi2qX5sKnMHjvDzCG0BoUBCA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715941312; a=rsa-sha256; cv=none; b=anh0HC7Sn9mSp+6pkapNkK8hPonBuGR++AEC4rsREQEx1a9EED8PWAG+rsCIQhudko21qU NrR/uumU4afMu3KLi0NiVR/Zat7oyJgViO7W30fwV1GH4Oebg/VeWbFmszbBJCGi0lEcg9 uSkY+eRDe4vR46Qj/5yJn4j6MNTg58ZoYG6c40FMRRO8bdnF0uZKOSG9Sus9AQVjk33VC3 Gexk0qSU8DCqkE1i8CGoSm12V49rZWuX5o5mCnRdDLojF0lUHvbQRZIp5w4J/NpdC0RDle +m+81u6qTvNwOFq7EobZrYvy3uzSznj38KW/rT8EJhEmhBHCDYJ5ybCkxLv6rw== 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=1715941312; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8pE16jvBoTSHPGhdRnYTTITPxKkjEms2T6IJDzHPEnc=; b=l+wtxQS6HGWMJ2JWzz4Ca6+xIbRV0G39d9v2tQve7PM2ZIIllcNPZNgZdPsPw09ihBTZYM 5ntCMo39Wsn8EBqVLtGlSj3FL+l+rMBEWzCTA4GIgN/dj9bvvrJE4C+GIZ91+4qfgp7CrC ZR4d1RWJE6/4Lx1tLq0Wh+It5plh2CI0es/G68MRSZHhGbCeYsUPxcNamKbIAGmawPrh/i Ikv4Ntd5UoNxClKZZEPBh4tdhcF1hD6ZeMVvu7mnwjfjJVyeP9UpFQZJP4ozutWFaHHPaN jDSJdxhpTX5T/1cS7BPjJTcHZP5seuV25ogoKdwYT9OfGwCdDKxZpcFSk6P7/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 4VgjgN5yYvzdsT; Fri, 17 May 2024 10:21: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 44HALqvC070068; Fri, 17 May 2024 10:21:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HALqo8070055; Fri, 17 May 2024 10:21:52 GMT (envelope-from git) Date: Fri, 17 May 2024 10:21:52 GMT Message-Id: <202405171021.44HALqo8070055@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 9e48c30e25a7 - main - rtld: Add arm64 variant pcs tests List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9e48c30e25a743a268d17a6215b9c2d859543547 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=9e48c30e25a743a268d17a6215b9c2d859543547 commit 9e48c30e25a743a268d17a6215b9c2d859543547 Author: Andrew Turner AuthorDate: 2024-04-19 10:07:53 +0000 Commit: Andrew Turner CommitDate: 2024-05-17 09:37:23 +0000 rtld: Add arm64 variant pcs tests When marking a function as variant pcs we can use registers not normally used in procedure calls. Add a test that uses this and stores all general purpose registers to a buffer and compare this buffer with the expected value later. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D44870 --- libexec/rtld-elf/tests/Makefile | 3 + libexec/rtld-elf/tests/aarch64/Makefile | 16 ++++ libexec/rtld-elf/tests/aarch64/Makefile.common | 3 + libexec/rtld-elf/tests/aarch64/Makefile.inc | 3 + libexec/rtld-elf/tests/aarch64/variant_pcs.c | 64 +++++++++++++++ libexec/rtld-elf/tests/aarch64/variant_pcs_dso.S | 54 +++++++++++++ .../tests/aarch64/variant_pcs_dso/Makefile | 13 ++++ .../rtld-elf/tests/aarch64/variant_pcs_helper.S | 91 ++++++++++++++++++++++ 8 files changed, 247 insertions(+) diff --git a/libexec/rtld-elf/tests/Makefile b/libexec/rtld-elf/tests/Makefile index e380e9850fc1..b8f1e9c49174 100644 --- a/libexec/rtld-elf/tests/Makefile +++ b/libexec/rtld-elf/tests/Makefile @@ -1,6 +1,9 @@ SUBDIR+= libpythagoras libdeep libval libval2 target TESTS_SUBDIRS+= rtld_deepbind +.if exists(${MACHINE_CPUARCH}) +TESTS_SUBDIRS+= ${MACHINE_CPUARCH} +.endif SUBDIR_DEPEND_libdeep= libval2 SUBDIR_DEPEND_rtld_deepbind= libval diff --git a/libexec/rtld-elf/tests/aarch64/Makefile b/libexec/rtld-elf/tests/aarch64/Makefile new file mode 100644 index 000000000000..a6f04ae49f26 --- /dev/null +++ b/libexec/rtld-elf/tests/aarch64/Makefile @@ -0,0 +1,16 @@ + +.include "Makefile.common" + +SUBDIR= variant_pcs_dso + +ATF_TESTS_C= variant_pcs + +SRCS.variant_pcs= variant_pcs.c variant_pcs_helper.S +DPADD.variant_pcs+= ${.OBJDIR}/dso/libh_variant_pcs.so +LDFLAGS.variant_pcs+= -Wl,-rpath,${TESTSDIR} -L${.OBJDIR}/variant_pcs_dso +LDADD.variant_pcs+= -lh_variant_pcs + +# Ensure the dso is built first +variant_pcs: variant_pcs_dso + +.include diff --git a/libexec/rtld-elf/tests/aarch64/Makefile.common b/libexec/rtld-elf/tests/aarch64/Makefile.common new file mode 100644 index 000000000000..3181b82aef44 --- /dev/null +++ b/libexec/rtld-elf/tests/aarch64/Makefile.common @@ -0,0 +1,3 @@ + +TESTSDIR?= ${TESTSBASE}/libexec/rtld-elf/aarch64 +LIBDIR= ${TESTSDIR} diff --git a/libexec/rtld-elf/tests/aarch64/Makefile.inc b/libexec/rtld-elf/tests/aarch64/Makefile.inc new file mode 100644 index 000000000000..3712e208f1fc --- /dev/null +++ b/libexec/rtld-elf/tests/aarch64/Makefile.inc @@ -0,0 +1,3 @@ + +.include "Makefile.common" +.include "../Makefile.inc" diff --git a/libexec/rtld-elf/tests/aarch64/variant_pcs.c b/libexec/rtld-elf/tests/aarch64/variant_pcs.c new file mode 100644 index 000000000000..5792dfd29723 --- /dev/null +++ b/libexec/rtld-elf/tests/aarch64/variant_pcs.c @@ -0,0 +1,64 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Arm Ltd + * + * 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 + +extern uint32_t variant_pcs_test_ret[]; +void variant_pcs_helper(void *); + +ATF_TC_WITHOUT_HEAD(variant_gpr); +ATF_TC_BODY(variant_gpr, tc) +{ + uint64_t regs[31]; + + memset(regs, 99, sizeof(regs)); + variant_pcs_helper(regs); + + ATF_REQUIRE(regs[0] == (uintptr_t)®s[0]); + ATF_REQUIRE(regs[30] == (uintptr_t)&variant_pcs_test_ret); + + for (uint64_t i = 1; i < 30; i++) { + /* + * x16 and x17 are ilp0 and ilp1 respectively. They are used + * in the PLT code so are trashed, even with variant PCS. + */ + if (i == 16 || i == 17) + continue; + + ATF_REQUIRE(regs[i] == i); + } +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, variant_gpr); + + return atf_no_error(); +} diff --git a/libexec/rtld-elf/tests/aarch64/variant_pcs_dso.S b/libexec/rtld-elf/tests/aarch64/variant_pcs_dso.S new file mode 100644 index 000000000000..0e6f05d84e15 --- /dev/null +++ b/libexec/rtld-elf/tests/aarch64/variant_pcs_dso.S @@ -0,0 +1,54 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Arm Ltd + * + * 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 + +/* + * Mark variant_pcs_test as a variant pcs function so we can check the + * saved register values later. The buffer to store the registers is + * passed in x0. + */ +.variant_pcs variant_pcs_test +ENTRY(variant_pcs_test) + stp x0, x1, [x0, #(0 * 8)] + stp x2, x3, [x0, #(2 * 8)] + stp x4, x5, [x0, #(4 * 8)] + stp x6, x7, [x0, #(6 * 8)] + stp x8, x9, [x0, #(8 * 8)] + stp x10, x11, [x0, #(10 * 8)] + stp x12, x13, [x0, #(12 * 8)] + stp x14, x15, [x0, #(14 * 8)] + stp x16, x17, [x0, #(16 * 8)] + stp x18, x19, [x0, #(18 * 8)] + stp x20, x21, [x0, #(20 * 8)] + stp x22, x23, [x0, #(22 * 8)] + stp x24, x25, [x0, #(24 * 8)] + stp x26, x27, [x0, #(26 * 8)] + stp x28, x29, [x0, #(28 * 8)] + str x30, [x0, #(30 * 8)] + ret +END(variant_pcs_test) diff --git a/libexec/rtld-elf/tests/aarch64/variant_pcs_dso/Makefile b/libexec/rtld-elf/tests/aarch64/variant_pcs_dso/Makefile new file mode 100644 index 000000000000..08f1eec00b06 --- /dev/null +++ b/libexec/rtld-elf/tests/aarch64/variant_pcs_dso/Makefile @@ -0,0 +1,13 @@ + +.PATH: ${.CURDIR:H} +SHLIB= h_variant_pcs +SHLIB_NAME= libh_variant_pcs.so +SHLIB_MAJOR= 1 + +WITHOUT_STATIC= +WITHOUT_PROFILE= +WITHOUT_PIC= + +SRCS= variant_pcs_dso.S + +.include diff --git a/libexec/rtld-elf/tests/aarch64/variant_pcs_helper.S b/libexec/rtld-elf/tests/aarch64/variant_pcs_helper.S new file mode 100644 index 000000000000..9480ba629c2e --- /dev/null +++ b/libexec/rtld-elf/tests/aarch64/variant_pcs_helper.S @@ -0,0 +1,91 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Arm Ltd + * + * 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 + +.global variant_pcs_test_ret + +/* + * void variant_pcs_helper(void *buffer); + * + * This follows the aapcs64 convention so needs to save and restore + * the callee-saved registers. It puts a known value in each register + * other than x0 and x30 as x0 contains the buffer used to store the + * register data, and x30 is the link register so will be trashed by + * the branch and link to variant_pcs_test. + */ +ENTRY(variant_pcs_helper) + sub sp, sp, #(14 * 8) + stp x29, x30, [sp, #(12 * 8)] + stp x27, x28, [sp, #(10 * 8)] + stp x25, x26, [sp, #( 8 * 8)] + stp x23, x24, [sp, #( 6 * 8)] + stp x22, x23, [sp, #( 4 * 8)] + stp x21, x22, [sp, #( 2 * 8)] + stp x19, x20, [sp, #( 0 * 8)] + add x29, sp, #(12 * 8) + mov x1, #1 + mov x2, #2 + mov x3, #3 + mov x4, #4 + mov x5, #5 + mov x6, #6 + mov x7, #7 + mov x8, #8 + mov x9, #9 + mov x10, #10 + mov x11, #11 + mov x12, #12 + mov x13, #13 + mov x14, #14 + mov x15, #15 + mov x16, #16 + mov x17, #17 + mov x18, #18 + mov x19, #19 + mov x20, #20 + mov x21, #21 + mov x22, #22 + mov x23, #23 + mov x24, #24 + mov x25, #25 + mov x26, #26 + mov x27, #27 + mov x28, #28 + mov x29, #29 + bl variant_pcs_test +variant_pcs_test_ret: + ldp x19, x20, [sp, #( 0 * 8)] + ldp x21, x22, [sp, #( 2 * 8)] + ldp x22, x23, [sp, #( 4 * 8)] + ldp x23, x24, [sp, #( 6 * 8)] + ldp x25, x26, [sp, #( 8 * 8)] + ldp x27, x28, [sp, #(10 * 8)] + ldp x29, x30, [sp, #(12 * 8)] + add sp, sp, #(14 * 8) + ret +END(variant_pcs_helper) From nobody Fri May 17 10:21:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgjgQ26Zpz5KwJf; Fri, 17 May 2024 10:21: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 4VgjgP74Lqz53Hg; Fri, 17 May 2024 10:21:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715941314; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jUlaljsqZBHkwks/YcC8I3x9oqP04mJJtOLI7JNGvyo=; b=xzbvBd2aHrpAHF5B+Ikpp53Zt/drXmFCae/B/LjAg4eYaR8BgZepHHGVr+GBRiopG1DgN+ rA0Bgk8C5n7AkHBZv22SDTxxaKPI2nzwjN9Ox7tSztgAPD/Xg1DxV/AnNpsBkEdxKu0F63 mWtzjhJ1ogDQX3odvX2cwoO5zuCr5c9Oyd3qM+CCgB0FzJJSPiWJ3PIfSTFZCSMJ/K7nsb QvK0DP6qVRIPv0JD7pW3FTxLe9KBMP2qloi4NSjuCMA1b+OwNc86oG7VBZ8hRLZ2SAEv2u P/3qTw8xFCnVniEBcIj2ckMbRCcKa1reD2nIb0tZPVJCNG3xkBiyqtM+Pssg9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715941314; a=rsa-sha256; cv=none; b=as9GivtLDaQeZAUAY0hDqtngB7BrOTQmEjgGIacVVrbP1r75fCv4/X5awkBr0OZVuCmk3s Y0guJc1k93m94owPO153P/eysAEUxUwn5cLqdC4ivoWu+yRbhPwccJ1jJuOuorn6opqeIA 40ppH4XzRX0JzRq+stKhtlwr0m3NMNo7o7P39/mmP1OhTBdv4ZibH+0QwzHDFMF2trOxXI gFpk4Jpgv247d3a3Vl6dqUWrFm1LnVSU9ow/yZV1PR2K8UctojxkDdSsTvYKicvIfkIbFR JbVUX/moPdKlyyAiB3Yy/jIpixkmECCzbMwH37ujOrfMrKTCX9iTwUODuriufg== 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=1715941314; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jUlaljsqZBHkwks/YcC8I3x9oqP04mJJtOLI7JNGvyo=; b=X6ThcwAufpGZfFGILFXv26KHL4yBHJRtifZC+30j8xiTiqlOEa646IfqsTsX3nwoCn2kf9 CweelWf4se29ixWkxl5v+WodAA/K7YSzQmLqZt+Wdf+fE6ezKSVUPlNXKCk7jMcOHSUrC6 y7jqYql5bpASwXmksZLpXxmRFuuCrjBDoALKLZrwVIrubnLAU4hHatJqFPmU3J0UyrswlY 4Bbnamp9QVANSMS4mlNmMSI8hCPp/4sQX91BGXK2dUSxIRM6jKVerxReA3o0AAFfu/gD6x RRF+ALP2rKzGi9W5mX0JUQD8C1wJJa8sP/fT9KC8TDTN9SSxEhR3PgeRnp/1hQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgjgP6gN7zfDR; Fri, 17 May 2024 10:21: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 44HALrDH071607; Fri, 17 May 2024 10:21:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HALrxd071584; Fri, 17 May 2024 10:21:53 GMT (envelope-from git) Date: Fri, 17 May 2024 10:21:53 GMT Message-Id: <202405171021.44HALrxd071584@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 1cd90a2c16dd - main - rtld: Move powerpc specific code to powerpc files List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1cd90a2c16dd2e22dd6f6c8e1ebd3eff0fe4993a Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=1cd90a2c16dd2e22dd6f6c8e1ebd3eff0fe4993a commit 1cd90a2c16dd2e22dd6f6c8e1ebd3eff0fe4993a Author: Andrew Turner AuthorDate: 2024-05-13 18:13:07 +0000 Commit: Andrew Turner CommitDate: 2024-05-17 09:37:23 +0000 rtld: Move powerpc specific code to powerpc files There are two variables set by dynamic tags in the powerpc runtime linker. Now we have a way to split out architecture-specific dynamic tags use it to handle these. Reviewed by: kib, jhibbits Obtained from: jhibbits (earlier version) Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45182 --- libexec/rtld-elf/powerpc/reloc.c | 11 +++++++++++ libexec/rtld-elf/powerpc/rtld_machdep.h | 6 +++--- libexec/rtld-elf/powerpc64/reloc.c | 11 +++++++++++ libexec/rtld-elf/powerpc64/rtld_machdep.h | 6 +++--- libexec/rtld-elf/rtld.c | 12 ------------ libexec/rtld-elf/rtld.h | 7 ------- 6 files changed, 28 insertions(+), 25 deletions(-) diff --git a/libexec/rtld-elf/powerpc/reloc.c b/libexec/rtld-elf/powerpc/reloc.c index 73a1c89991e2..5618efb7f716 100644 --- a/libexec/rtld-elf/powerpc/reloc.c +++ b/libexec/rtld-elf/powerpc/reloc.c @@ -57,6 +57,17 @@ void _rtld_bind_secureplt_start(void); +bool +arch_digest_dynamic(struct Struct_Obj_Entry *obj, const Elf_Dyn *dynp) +{ + if (dynp->d_tag == DT_PPC_GOT) { + obj->gotptr = (Elf_Addr *)(obj->relocbase + dynp->d_un.d_ptr); + return (true); + } + + return (false); +} + /* * Process the R_PPC_COPY relocations */ diff --git a/libexec/rtld-elf/powerpc/rtld_machdep.h b/libexec/rtld-elf/powerpc/rtld_machdep.h index 69fc52369201..ec470f238991 100644 --- a/libexec/rtld-elf/powerpc/rtld_machdep.h +++ b/libexec/rtld-elf/powerpc/rtld_machdep.h @@ -35,13 +35,13 @@ struct Struct_Obj_Entry; -#define MD_OBJ_ENTRY +#define MD_OBJ_ENTRY \ + Elf_Addr *gotptr; /* GOT pointer (secure-plt only) */ /* Return the address of the .dynamic section in the dynamic linker. */ #define rtld_dynamic(obj) (&_DYNAMIC) -/* No arch-specific dynamic tags */ -#define arch_digest_dynamic(obj, dynp) false +bool arch_digest_dynamic(struct Struct_Obj_Entry *, const Elf_Dyn *); /* No architecture specific notes */ #define arch_digest_note(obj, note) false diff --git a/libexec/rtld-elf/powerpc64/reloc.c b/libexec/rtld-elf/powerpc64/reloc.c index 70928829aeda..2d06d5821d1b 100644 --- a/libexec/rtld-elf/powerpc64/reloc.c +++ b/libexec/rtld-elf/powerpc64/reloc.c @@ -52,6 +52,17 @@ struct funcdesc { }; #endif +bool +arch_digest_dynamic(struct Struct_Obj_Entry *obj, const Elf_Dyn *dynp) +{ + if (dynp->d_tag == DT_PPC64_GLINK) { + obj->glink = (Elf_Addr)(obj->relocbase + dynp->d_un.d_ptr); + return (true); + } + + return (false); +} + /* * Process the R_PPC_COPY relocations */ diff --git a/libexec/rtld-elf/powerpc64/rtld_machdep.h b/libexec/rtld-elf/powerpc64/rtld_machdep.h index d1dab63d3779..d628e776bae9 100644 --- a/libexec/rtld-elf/powerpc64/rtld_machdep.h +++ b/libexec/rtld-elf/powerpc64/rtld_machdep.h @@ -35,13 +35,13 @@ struct Struct_Obj_Entry; -#define MD_OBJ_ENTRY +#define MD_OBJ_ENTRY \ + Elf_Addr glink; /* GLINK PLT call stub section */ /* Return the address of the .dynamic section in the dynamic linker. */ #define rtld_dynamic(obj) (&_DYNAMIC) -/* No arch-specific dynamic tags */ -#define arch_digest_dynamic(obj, dynp) false +bool arch_digest_dynamic(struct Struct_Obj_Entry *, const Elf_Dyn *); /* No architecture specific notes */ #define arch_digest_note(obj, note) false diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 20c340ed15a3..ef34a9d36bc3 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -1520,18 +1520,6 @@ digest_dynamic1(Obj_Entry *obj, int early, const Elf_Dyn **dyn_rpath, obj->static_tls = true; break; -#ifdef __powerpc__ -#ifdef __powerpc64__ - case DT_PPC64_GLINK: - obj->glink = (Elf_Addr)(obj->relocbase + dynp->d_un.d_ptr); - break; -#else - case DT_PPC_GOT: - obj->gotptr = (Elf_Addr *)(obj->relocbase + dynp->d_un.d_ptr); - break; -#endif -#endif - case DT_FLAGS_1: if (dynp->d_un.d_val & DF_1_NOOPEN) obj->z_noopen = true; diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h index a4f2c35cc03f..9df5b4ec8f59 100644 --- a/libexec/rtld-elf/rtld.h +++ b/libexec/rtld-elf/rtld.h @@ -183,13 +183,6 @@ typedef struct Struct_Obj_Entry { const Elf_Sym *symtab; /* Symbol table */ const char *strtab; /* String table */ unsigned long strsize; /* Size in bytes of string table */ -#ifdef __powerpc__ -#ifdef __powerpc64__ - Elf_Addr glink; /* GLINK PLT call stub section */ -#else - Elf_Addr *gotptr; /* GOT pointer (secure-plt only) */ -#endif -#endif const Elf_Verneed *verneed; /* Required versions. */ Elf_Word verneednum; /* Number of entries in verneed table */ From nobody Fri May 17 10:21:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgjgR2cbZz5Kvy9; Fri, 17 May 2024 10:21: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 4VgjgR10VBz53Mv; Fri, 17 May 2024 10:21:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715941315; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Th2h64tyOFDz9O3wzvaVVrrXkoEAgPIcZStyF6uAugI=; b=sOSRMc2UCpPBHQWicFXP8ViF8bV14Ap08y1iRJuEooX+w27RdTFHjOw8I8jgef6w1yqkBQ 3NMLAdXr5x2AxvI4mHVqn5YOs/YCVRCG0HVKZ5ES4g2bjsXu6PgKadFXmfuz7A/UmDEU9P lzUfg+1W3Q6Q+CHd5eNLnub0cLG6ZtRTMPjC+LqC68E86/FZEitMuvSDBCxJ/wdu2Nc7Ja M9A1Ht+MV6J79Vvw1Xt+ycp4Ud8Pwb1kBMwW3xJU+civy8Fl/5hcIQV3NUSOgrsxjw5rz6 yADtY/1aoc6V8eAsx9u2pCr1KuTWzkETbw7B5NiuxBpAxen2a1CrKGpEw/AgAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715941315; a=rsa-sha256; cv=none; b=Gtvaf78GFMF3pPhV0Dy06J0FGZzTRpusTRC5p1yY366omKy3cGA1IRlEJ+eS6xRJJetGxE l2wViJDw4wP3E0OIpyqeWfIul2lDLc/TPzm3AqfZfQnHuLXZ4ffksFN9Y2xTSX9XfN86RT fiUYbCgOr0J7C/otd7GbNTGq/UxVB8cVTRoqTrOpz8jnJbOGTDZDNjFY5AkRh6Fwn1u2wO 1CtbvH11qXfO1NYxoQky2SBCgKfOfESBRbd0Z6LJVkk++eL6mkIgayZOifRIjbg+sJcHXu jWNFvppwGiF8YnOSNh7PEhatcQc2thBCON18h/wFEdQQSXNcn8Rmydpb7HlYEg== 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=1715941315; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Th2h64tyOFDz9O3wzvaVVrrXkoEAgPIcZStyF6uAugI=; b=EZeJqaBTPJzNrqeDTodfSeLhp+tIobH2mxJ+qKW6cFBAwP+rHLqcTrKg5DgCT+dRPYjqbJ rx9BOVIRIZLmdKDUoaTxDyeTbSbADJSWBy7H+zrH/VCJXvQsHO5whSRCoNWX9DnVg6N0A0 rq4i4zkr7cQ1cYK7pi1rwVlbBhnVXEXYNihjzPjL6KKL6GzGlpQX9Fy+RIorxEQDkeens6 4nB2Vo+LTCawONERPozjwomWqEod8zesm82RyrNIcN5ftBCJyUxPrDaATY7WbhHQUKfa+K 9zyo00EbTTWeoix6PWCwQkOTaw16KQWZQGbM6o4fzaYy/nYCwwW/TKSwNc24hw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgjgR0YbrzdsV; Fri, 17 May 2024 10:21: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 44HALsrD072415; Fri, 17 May 2024 10:21:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HALsP5072412; Fri, 17 May 2024 10:21:54 GMT (envelope-from git) Date: Fri, 17 May 2024 10:21:54 GMT Message-Id: <202405171021.44HALsP5072412@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: d6d860c7ff5c - main - arm64: Add MRS_REG_ALT_NAME ID register macros List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d6d860c7ff5c4cbe9475d98000407d6f0ea84b47 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=d6d860c7ff5c4cbe9475d98000407d6f0ea84b47 commit d6d860c7ff5c4cbe9475d98000407d6f0ea84b47 Author: Andrew Turner AuthorDate: 2024-05-13 13:58:45 +0000 Commit: Andrew Turner CommitDate: 2024-05-17 09:38:17 +0000 arm64: Add MRS_REG_ALT_NAME ID register macros These can be used even when the compiler is too old for the register to be included. Reviewed by: Zachary Leaf Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45176 --- sys/arm64/include/armreg.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index 9391b1e2c1b7..5d193af5fd71 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -491,6 +491,7 @@ /* ID_AA64AFR0_EL1 */ #define ID_AA64AFR0_EL1 MRS_REG(ID_AA64AFR0_EL1) +#define ID_AA64AFR0_EL1_REG MRS_REG_ALT_NAME(ID_AA64AFR0_EL1) #define ID_AA64AFR0_EL1_op0 3 #define ID_AA64AFR0_EL1_op1 0 #define ID_AA64AFR0_EL1_CRn 0 @@ -499,6 +500,7 @@ /* ID_AA64AFR1_EL1 */ #define ID_AA64AFR1_EL1 MRS_REG(ID_AA64AFR1_EL1) +#define ID_AA64AFR1_EL1_REG MRS_REG_ALT_NAME(ID_AA64AFR1_EL1) #define ID_AA64AFR1_EL1_op0 3 #define ID_AA64AFR1_EL1_op1 0 #define ID_AA64AFR1_EL1_CRn 0 @@ -507,6 +509,7 @@ /* ID_AA64DFR0_EL1 */ #define ID_AA64DFR0_EL1 MRS_REG(ID_AA64DFR0_EL1) +#define ID_AA64DFR0_EL1_REG MRS_REG_ALT_NAME(ID_AA64DFR0_EL1) #define ID_AA64DFR0_EL1_op0 3 #define ID_AA64DFR0_EL1_op1 0 #define ID_AA64DFR0_EL1_CRn 0 @@ -596,6 +599,7 @@ /* ID_AA64DFR1_EL1 */ #define ID_AA64DFR1_EL1 MRS_REG(ID_AA64DFR1_EL1) +#define ID_AA64DFR1_EL1_REG MRS_REG_ALT_NAME(ID_AA64DFR1_EL1) #define ID_AA64DFR1_EL1_op0 3 #define ID_AA64DFR1_EL1_op1 0 #define ID_AA64DFR1_EL1_CRn 0 @@ -604,6 +608,7 @@ /* ID_AA64ISAR0_EL1 */ #define ID_AA64ISAR0_EL1 MRS_REG(ID_AA64ISAR0_EL1) +#define ID_AA64ISAR0_EL1_REG MRS_REG_ALT_NAME(ID_AA64ISAR0_EL1) #define ID_AA64ISAR0_EL1_op0 3 #define ID_AA64ISAR0_EL1_op1 0 #define ID_AA64ISAR0_EL1_CRn 0 @@ -690,6 +695,7 @@ /* ID_AA64ISAR1_EL1 */ #define ID_AA64ISAR1_EL1 MRS_REG(ID_AA64ISAR1_EL1) +#define ID_AA64ISAR1_EL1_REG MRS_REG_ALT_NAME(ID_AA64ISAR1_EL1) #define ID_AA64ISAR1_EL1_op0 3 #define ID_AA64ISAR1_EL1_op1 0 #define ID_AA64ISAR1_EL1_CRn 0 @@ -791,6 +797,7 @@ /* ID_AA64ISAR2_EL1 */ #define ID_AA64ISAR2_EL1 MRS_REG(ID_AA64ISAR2_EL1) +#define ID_AA64ISAR2_EL1_REG MRS_REG_ALT_NAME(ID_AA64ISAR2_EL1) #define ID_AA64ISAR2_EL1_op0 3 #define ID_AA64ISAR2_EL1_op1 0 #define ID_AA64ISAR2_EL1_CRn 0 @@ -838,6 +845,7 @@ /* ID_AA64MMFR0_EL1 */ #define ID_AA64MMFR0_EL1 MRS_REG(ID_AA64MMFR0_EL1) +#define ID_AA64MMFR0_EL1_REG MRS_REG_ALT_NAME(ID_AA64MMFR0_EL1) #define ID_AA64MMFR0_EL1_op0 3 #define ID_AA64MMFR0_EL1_op1 0 #define ID_AA64MMFR0_EL1_CRn 0 @@ -929,6 +937,7 @@ /* ID_AA64MMFR1_EL1 */ #define ID_AA64MMFR1_EL1 MRS_REG(ID_AA64MMFR1_EL1) +#define ID_AA64MMFR1_EL1_REG MRS_REG_ALT_NAME(ID_AA64MMFR1_EL1) #define ID_AA64MMFR1_EL1_op0 3 #define ID_AA64MMFR1_EL1_op1 0 #define ID_AA64MMFR1_EL1_CRn 0 @@ -1016,6 +1025,7 @@ /* ID_AA64MMFR2_EL1 */ #define ID_AA64MMFR2_EL1 MRS_REG(ID_AA64MMFR2_EL1) +#define ID_AA64MMFR2_EL1_REG MRS_REG_ALT_NAME(ID_AA64MMFR2_EL1) #define ID_AA64MMFR2_EL1_op0 3 #define ID_AA64MMFR2_EL1_op1 0 #define ID_AA64MMFR2_EL1_CRn 0 @@ -1102,6 +1112,7 @@ /* ID_AA64MMFR3_EL1 */ #define ID_AA64MMFR3_EL1 MRS_REG(ID_AA64MMFR3_EL1) +#define ID_AA64MMFR3_EL1_REG MRS_REG_ALT_NAME(ID_AA64MMFR3_EL1) #define ID_AA64MMFR3_EL1_op0 3 #define ID_AA64MMFR3_EL1_op1 0 #define ID_AA64MMFR3_EL1_CRn 0 @@ -1130,6 +1141,7 @@ /* ID_AA64MMFR4_EL1 */ #define ID_AA64MMFR4_EL1 MRS_REG(ID_AA64MMFR4_EL1) +#define ID_AA64MMFR4_EL1_REG MRS_REG_ALT_NAME(ID_AA64MMFR4_EL1) #define ID_AA64MMFR4_EL1_op0 3 #define ID_AA64MMFR4_EL1_op1 0 #define ID_AA64MMFR4_EL1_CRn 0 @@ -1138,6 +1150,7 @@ /* ID_AA64PFR0_EL1 */ #define ID_AA64PFR0_EL1 MRS_REG(ID_AA64PFR0_EL1) +#define ID_AA64PFR0_EL1_REG MRS_REG_ALT_NAME(ID_AA64PFR0_EL1) #define ID_AA64PFR0_EL1_op0 3 #define ID_AA64PFR0_EL1_op1 0 #define ID_AA64PFR0_EL1_CRn 0 @@ -1236,6 +1249,7 @@ /* ID_AA64PFR1_EL1 */ #define ID_AA64PFR1_EL1 MRS_REG(ID_AA64PFR1_EL1) +#define ID_AA64PFR1_EL1_REG MRS_REG_ALT_NAME(ID_AA64PFR1_EL1) #define ID_AA64PFR1_EL1_op0 3 #define ID_AA64PFR1_EL1_op1 0 #define ID_AA64PFR1_EL1_CRn 0 @@ -1294,6 +1308,7 @@ /* ID_AA64PFR2_EL1 */ #define ID_AA64PFR2_EL1 MRS_REG(ID_AA64PFR2_EL1) +#define ID_AA64PFR2_EL1_REG MRS_REG_ALT_NAME(ID_AA64PFR2_EL1) #define ID_AA64PFR2_EL1_op0 3 #define ID_AA64PFR2_EL1_op1 0 #define ID_AA64PFR2_EL1_CRn 0 From nobody Fri May 17 10:21:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgjgS3HK5z5KvyD; Fri, 17 May 2024 10:21:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgjgS1hjFz53N8; Fri, 17 May 2024 10:21:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715941316; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vdvuWWz9bWlHu58To5GKArMeJdsxuXBqoQRWpXMlZJY=; b=jn8e1ezx5+X0iat1Zh8jNfcl2+hbhTn551SBEwkMwC6EztHOaj04hVYdsZPWLBIoj8BldA fDK79uqmcF0urgQq1AWMKoaGPZx1zCe4sv4bUcdd/4Kl39VatUKZQN4ShSYSB/iEiDG1Gl Kk9R7XJHQxerJx8hMhVWmpPVWIhzmSOq2bFjHp/vZpOersE3+kGyfxBBqFWNVF9Arsy99z 3P7eLeSRVtFfaXvDFYudylS2F3NN6Mx44CoemPctJucnkgByxkP068F/80WNKMvNAef7sz OATHuSq2cjBJGezBFjO9qQq62lpne/6z3nO2UCsOeroAnaobwOa0cN0FQIsSKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715941316; a=rsa-sha256; cv=none; b=E7MAU4M6NQLrwWvtNoNjSlpUFXEUkx2clbA3jnuMV5w1Na+N1prOQmlHe9R17+UpGbyVYR kRUH4H3+RfEGUMQ2FHmOVSenyWboG+dinwjPh/9BFbl9+2mPZYpjRnh74TgqHKtUe2geWl Y7wuLBrmdKtxLLpXDLvNzp96KVtOM9BhZkk+GG66sfBHhDlqA61xOQfQ7ULVmjt131l2mC WLckSH6k8pclfiVKVH02lj9xrxJrMhA54SJVGCCi2WZpAcWFLrel6N/9g4LM3s9cPDPzLN NKnW+/n60jn58PBUNbnsyXfumgq6lsdTegsv+0h/pwZ/QY64+zZMTuzR7XzseA== 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=1715941316; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vdvuWWz9bWlHu58To5GKArMeJdsxuXBqoQRWpXMlZJY=; b=uxKMdosaqQRHwckwEnMlz0kSGEXq5s2LOZLDitc8NHlpE1wJ8unB5BCpC3lB186DSsv+j7 NB/UR83v2R6CyUdFZkoHygb2svHSl2ik5W6qqBEIDCwzrFoukvcsZ1t30lxSrUY1wDXUPX MPZ5LlydM2SLu4+7wYkRGxRBn+yu6wL+u3XufQQfyFpWF3UqosMTLaTllnuahz1kMMQtkn 7YdFCEZajeqM6H7Xe9mgl60JusqD9y7MXGyHlR0vcXCDHxzwtunhNx3PMDqSaqbRCNnzeM TPcY92eAUIwNW2tl4mAQZI+ttQ0Tqf6fSmXeISmWEeK8y0QfUfXSwnxVNbQtmQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgjgS19RDzfDS; Fri, 17 May 2024 10:21: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 44HALuaX072469; Fri, 17 May 2024 10:21:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HALugB072466; Fri, 17 May 2024 10:21:56 GMT (envelope-from git) Date: Fri, 17 May 2024 10:21:56 GMT Message-Id: <202405171021.44HALugB072466@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: cd3681011001 - main - arm64: Use the _REG macros to read ID registers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cd36810110017ad5882784a7842cfdf9c92ef098 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=cd36810110017ad5882784a7842cfdf9c92ef098 commit cd36810110017ad5882784a7842cfdf9c92ef098 Author: Andrew Turner AuthorDate: 2024-05-13 14:48:25 +0000 Commit: Andrew Turner CommitDate: 2024-05-17 09:38:38 +0000 arm64: Use the _REG macros to read ID registers To build with old toolchains use the *_REG macros to access the ID registers. These become a name in the form S?_?_C?_C?_? where the '?' values encode the op and CR values needed to access the register. For consistency use these macros for all ID registers, even if most toolchains understand them. Reviewed by: Zachary Leaf Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45177 --- sys/arm64/arm64/identcpu.c | 46 +++++++++++++--------------------------------- 1 file changed, 13 insertions(+), 33 deletions(-) diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index 01b434fd4f47..5fec7cba385f 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -138,15 +138,11 @@ struct cpu_desc { uint64_t id_aa64mmfr0; uint64_t id_aa64mmfr1; uint64_t id_aa64mmfr2; -#ifdef NOTYET uint64_t id_aa64mmfr3; uint64_t id_aa64mmfr4; -#endif uint64_t id_aa64pfr0; uint64_t id_aa64pfr1; -#ifdef NOTYET uint64_t id_aa64pfr2; -#endif uint64_t id_aa64zfr0; uint64_t ctr; #ifdef COMPAT_FREEBSD32 @@ -1297,7 +1293,6 @@ static const struct mrs_field id_aa64mmfr2_fields[] = { }; -#ifdef NOTYET /* ID_AA64MMFR2_EL1 */ static const struct mrs_field_value id_aa64mmfr3_spec_fpacc[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_AA64MMFR3, Spec_FPACC, NONE, IMPL), @@ -1333,7 +1328,6 @@ static const struct mrs_field id_aa64mmfr3_fields[] = { static const struct mrs_field id_aa64mmfr4_fields[] = { MRS_FIELD_END, }; -#endif /* ID_AA64PFR0_EL1 */ @@ -1572,12 +1566,10 @@ static const struct mrs_field id_aa64pfr1_fields[] = { }; -#ifdef NOTYET /* ID_AA64PFR2_EL1 */ static const struct mrs_field id_aa64pfr2_fields[] = { MRS_FIELD_END, }; -#endif /* ID_AA64ZFR0_EL1 */ @@ -1880,16 +1872,12 @@ static const struct mrs_user_reg user_regs[] = { USER_REG(ID_AA64MMFR0_EL1, id_aa64mmfr0, true), USER_REG(ID_AA64MMFR1_EL1, id_aa64mmfr1, true), USER_REG(ID_AA64MMFR2_EL1, id_aa64mmfr2, true), -#ifdef NOTYET USER_REG(ID_AA64MMFR3_EL1, id_aa64mmfr3, true), USER_REG(ID_AA64MMFR4_EL1, id_aa64mmfr4, true), -#endif USER_REG(ID_AA64PFR0_EL1, id_aa64pfr0, true), USER_REG(ID_AA64PFR1_EL1, id_aa64pfr1, true), -#ifdef NOTYET USER_REG(ID_AA64PFR2_EL1, id_aa64pfr2, true), -#endif USER_REG(ID_AA64ZFR0_EL1, id_aa64zfr0, true), @@ -2669,12 +2657,10 @@ print_cpu_features(u_int cpu, struct cpu_desc *desc, print_id_register(sb, "Processor Features 1", desc->id_aa64pfr1, id_aa64pfr1_fields); -#ifdef NOTYET /* AArch64 Processor Feature Register 2 */ if (SHOULD_PRINT_REG(id_aa64pfr2)) print_id_register(sb, "Processor Features 2", desc->id_aa64pfr2, id_aa64pfr2_fields); -#endif /* AArch64 Memory Model Feature Register 0 */ if (SHOULD_PRINT_REG(id_aa64mmfr0)) @@ -2691,7 +2677,6 @@ print_cpu_features(u_int cpu, struct cpu_desc *desc, print_id_register(sb, "Memory Model Features 2", desc->id_aa64mmfr2, id_aa64mmfr2_fields); -#ifdef NOTYET /* AArch64 Memory Model Feature Register 3 */ if (SHOULD_PRINT_REG(id_aa64mmfr3)) print_id_register(sb, "Memory Model Features 3", @@ -2701,7 +2686,6 @@ print_cpu_features(u_int cpu, struct cpu_desc *desc, if (SHOULD_PRINT_REG(id_aa64mmfr4)) print_id_register(sb, "Memory Model Features 4", desc->id_aa64mmfr4, id_aa64mmfr4_fields); -#endif /* AArch64 Debug Feature Register 0 */ if (SHOULD_PRINT_REG(id_aa64dfr0)) @@ -2809,23 +2793,19 @@ identify_cpu(u_int cpu) CPU_AFFINITY(cpu) = desc->mpidr & CPU_AFF_MASK; desc->ctr = READ_SPECIALREG(ctr_el0); - desc->id_aa64dfr0 = READ_SPECIALREG(id_aa64dfr0_el1); - desc->id_aa64dfr1 = READ_SPECIALREG(id_aa64dfr1_el1); - desc->id_aa64isar0 = READ_SPECIALREG(id_aa64isar0_el1); - desc->id_aa64isar1 = READ_SPECIALREG(id_aa64isar1_el1); - desc->id_aa64isar2 = READ_SPECIALREG(id_aa64isar2_el1); - desc->id_aa64mmfr0 = READ_SPECIALREG(id_aa64mmfr0_el1); - desc->id_aa64mmfr1 = READ_SPECIALREG(id_aa64mmfr1_el1); - desc->id_aa64mmfr2 = READ_SPECIALREG(id_aa64mmfr2_el1); -#ifdef NOTYET - desc->id_aa64mmfr3 = READ_SPECIALREG(id_aa64mmfr3_el1); - desc->id_aa64mmfr4 = READ_SPECIALREG(id_aa64mmfr4_el1); -#endif - desc->id_aa64pfr0 = READ_SPECIALREG(id_aa64pfr0_el1); - desc->id_aa64pfr1 = READ_SPECIALREG(id_aa64pfr1_el1); -#ifdef NOTYET - desc->id_aa64pfr2 = READ_SPECIALREG(id_aa64pfr2_el1); -#endif + desc->id_aa64dfr0 = READ_SPECIALREG(ID_AA64DFR0_EL1_REG); + desc->id_aa64dfr1 = READ_SPECIALREG(ID_AA64DFR1_EL1_REG); + desc->id_aa64isar0 = READ_SPECIALREG(ID_AA64ISAR0_EL1_REG); + desc->id_aa64isar1 = READ_SPECIALREG(ID_AA64ISAR1_EL1_REG); + desc->id_aa64isar2 = READ_SPECIALREG(ID_AA64ISAR2_EL1_REG); + desc->id_aa64mmfr0 = READ_SPECIALREG(ID_AA64MMFR0_EL1_REG); + desc->id_aa64mmfr1 = READ_SPECIALREG(ID_AA64MMFR1_EL1_REG); + desc->id_aa64mmfr2 = READ_SPECIALREG(ID_AA64MMFR2_EL1_REG); + desc->id_aa64mmfr3 = READ_SPECIALREG(ID_AA64MMFR3_EL1_REG); + desc->id_aa64mmfr4 = READ_SPECIALREG(ID_AA64MMFR4_EL1_REG); + desc->id_aa64pfr0 = READ_SPECIALREG(ID_AA64PFR0_EL1_REG); + desc->id_aa64pfr1 = READ_SPECIALREG(ID_AA64PFR1_EL1_REG); + desc->id_aa64pfr2 = READ_SPECIALREG(ID_AA64PFR2_EL1_REG); /* * ID_AA64ZFR0_EL1 is only valid when at least one of: From nobody Fri May 17 11:20:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgkyr0GCqz5L0jB; Fri, 17 May 2024 11:20: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 4Vgkyq6YbHz58Vk; Fri, 17 May 2024 11:20:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715944819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VnI8U2lL+8cjNc0bkLdqhxDSwH2vhPPkavdC+S4aA8I=; b=btOQ7ChwzPyLeV8SsJUu/rDPHZO2hiF6pb+7FLoYn6vRweetNXDjq/xTjDhy2S+hZXU8zr CaVqJDcNBwt7HjkoBwKAu7NCJUbhvu+29HN5gTYGQDAzs1s4VlvC92+0YBelnu/vmrsEPl um3pyWKaK+x2A+tbsIXYLUGLjwa9P9nFnbDvjyhw1XywzETQgk3OjoE43Bz5r4HFZEFytu LrK50/s0+y6arQoXopH8f54s9OoAVdUNKXFGJamoR7j8qbnyqIyXgECoPJogD+CbzaIveS GXm/hMfUbdolpqm25o3FXYSXdZBJI0kcgCHUxtOUFhtTEaBKmxlpPSksbWB6xA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715944819; a=rsa-sha256; cv=none; b=PAFnsE87D2PD5lnPcAnB667KBBPldsjUdXcRAHonctLKY1SS9ZY0Jt421wK/rexH8V684l CE/edYVKJGyIGe4X7CjThZDHnXTfbyMZCRdcvob2Bm63yPdkPfmPAAEs+zZSpi0bheqWSW uQKRP4v2eA1Besoy9mNBc6XjkPne23MPCVSsYuY4dnAHlCISlIXhAe9irWCNhf3rflh3+2 XdqaJaQljBqsRs/Ew0C8Ol3zbftepwuFyUhPEOMuonFW6ooJf+Db7a6jP0FSR2ap/ip/W2 SD9u5NkBOEPF2/II+AgEqO+pYgei6MeEfPBvToPnrIfq4lD12J4rhRZq5g8KzA== 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=1715944819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VnI8U2lL+8cjNc0bkLdqhxDSwH2vhPPkavdC+S4aA8I=; b=sQOA/H/5k0waA2u7ceix5B6rN05HDA+EKPRJJAaMqhjTC1MEiIitfwifAWt2uY4NL2Gv/x AJBXkxxsxQ2GJq4QPkOBBkeA2w5DeneMxm7j8PKuvFd3hCXSDb2ox5McZwj3kr0sz7s3sK VXKfkkzciJDOhzpxMpgkMwoLblWls9+lKpAGwkFGo45FhfnVVTUoPYEewsGHWNZT/I9zen /tSIHx6F3UNVhz/e2Wo8TdvYTx/515zX3Mc9iR0+ADtJtZoJ9RZXO6koJhgWIBj5mho2wh sMkEfzbEk6btjwZV5gscA8kEogX4i7boJLOFGB1mnsqWo9OOT2qfFNSbfHow9g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vgkyq62nhzgTS; Fri, 17 May 2024 11:20: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 44HBKJxY069762; Fri, 17 May 2024 11:20:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HBKJNj069759; Fri, 17 May 2024 11:20:19 GMT (envelope-from git) Date: Fri, 17 May 2024 11:20:19 GMT Message-Id: <202405171120.44HBKJNj069759@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 2228d7c5998b - main - Revert "rtld: Add arm64 variant pcs tests" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2228d7c5998bc09c5aaf181312dc870d15ad4b18 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=2228d7c5998bc09c5aaf181312dc870d15ad4b18 commit 2228d7c5998bc09c5aaf181312dc870d15ad4b18 Author: Andrew Turner AuthorDate: 2024-05-17 11:19:24 +0000 Commit: Andrew Turner CommitDate: 2024-05-17 11:19:24 +0000 Revert "rtld: Add arm64 variant pcs tests" It's missing an mtree update This reverts commit 9e48c30e25a743a268d17a6215b9c2d859543547. --- libexec/rtld-elf/tests/Makefile | 3 - libexec/rtld-elf/tests/aarch64/Makefile | 16 ---- libexec/rtld-elf/tests/aarch64/Makefile.common | 3 - libexec/rtld-elf/tests/aarch64/Makefile.inc | 3 - libexec/rtld-elf/tests/aarch64/variant_pcs.c | 64 --------------- libexec/rtld-elf/tests/aarch64/variant_pcs_dso.S | 54 ------------- .../tests/aarch64/variant_pcs_dso/Makefile | 13 ---- .../rtld-elf/tests/aarch64/variant_pcs_helper.S | 91 ---------------------- 8 files changed, 247 deletions(-) diff --git a/libexec/rtld-elf/tests/Makefile b/libexec/rtld-elf/tests/Makefile index b8f1e9c49174..e380e9850fc1 100644 --- a/libexec/rtld-elf/tests/Makefile +++ b/libexec/rtld-elf/tests/Makefile @@ -1,9 +1,6 @@ SUBDIR+= libpythagoras libdeep libval libval2 target TESTS_SUBDIRS+= rtld_deepbind -.if exists(${MACHINE_CPUARCH}) -TESTS_SUBDIRS+= ${MACHINE_CPUARCH} -.endif SUBDIR_DEPEND_libdeep= libval2 SUBDIR_DEPEND_rtld_deepbind= libval diff --git a/libexec/rtld-elf/tests/aarch64/Makefile b/libexec/rtld-elf/tests/aarch64/Makefile deleted file mode 100644 index a6f04ae49f26..000000000000 --- a/libexec/rtld-elf/tests/aarch64/Makefile +++ /dev/null @@ -1,16 +0,0 @@ - -.include "Makefile.common" - -SUBDIR= variant_pcs_dso - -ATF_TESTS_C= variant_pcs - -SRCS.variant_pcs= variant_pcs.c variant_pcs_helper.S -DPADD.variant_pcs+= ${.OBJDIR}/dso/libh_variant_pcs.so -LDFLAGS.variant_pcs+= -Wl,-rpath,${TESTSDIR} -L${.OBJDIR}/variant_pcs_dso -LDADD.variant_pcs+= -lh_variant_pcs - -# Ensure the dso is built first -variant_pcs: variant_pcs_dso - -.include diff --git a/libexec/rtld-elf/tests/aarch64/Makefile.common b/libexec/rtld-elf/tests/aarch64/Makefile.common deleted file mode 100644 index 3181b82aef44..000000000000 --- a/libexec/rtld-elf/tests/aarch64/Makefile.common +++ /dev/null @@ -1,3 +0,0 @@ - -TESTSDIR?= ${TESTSBASE}/libexec/rtld-elf/aarch64 -LIBDIR= ${TESTSDIR} diff --git a/libexec/rtld-elf/tests/aarch64/Makefile.inc b/libexec/rtld-elf/tests/aarch64/Makefile.inc deleted file mode 100644 index 3712e208f1fc..000000000000 --- a/libexec/rtld-elf/tests/aarch64/Makefile.inc +++ /dev/null @@ -1,3 +0,0 @@ - -.include "Makefile.common" -.include "../Makefile.inc" diff --git a/libexec/rtld-elf/tests/aarch64/variant_pcs.c b/libexec/rtld-elf/tests/aarch64/variant_pcs.c deleted file mode 100644 index 5792dfd29723..000000000000 --- a/libexec/rtld-elf/tests/aarch64/variant_pcs.c +++ /dev/null @@ -1,64 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2024 Arm Ltd - * - * 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 - -extern uint32_t variant_pcs_test_ret[]; -void variant_pcs_helper(void *); - -ATF_TC_WITHOUT_HEAD(variant_gpr); -ATF_TC_BODY(variant_gpr, tc) -{ - uint64_t regs[31]; - - memset(regs, 99, sizeof(regs)); - variant_pcs_helper(regs); - - ATF_REQUIRE(regs[0] == (uintptr_t)®s[0]); - ATF_REQUIRE(regs[30] == (uintptr_t)&variant_pcs_test_ret); - - for (uint64_t i = 1; i < 30; i++) { - /* - * x16 and x17 are ilp0 and ilp1 respectively. They are used - * in the PLT code so are trashed, even with variant PCS. - */ - if (i == 16 || i == 17) - continue; - - ATF_REQUIRE(regs[i] == i); - } -} - -ATF_TP_ADD_TCS(tp) -{ - ATF_TP_ADD_TC(tp, variant_gpr); - - return atf_no_error(); -} diff --git a/libexec/rtld-elf/tests/aarch64/variant_pcs_dso.S b/libexec/rtld-elf/tests/aarch64/variant_pcs_dso.S deleted file mode 100644 index 0e6f05d84e15..000000000000 --- a/libexec/rtld-elf/tests/aarch64/variant_pcs_dso.S +++ /dev/null @@ -1,54 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2024 Arm Ltd - * - * 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 - -/* - * Mark variant_pcs_test as a variant pcs function so we can check the - * saved register values later. The buffer to store the registers is - * passed in x0. - */ -.variant_pcs variant_pcs_test -ENTRY(variant_pcs_test) - stp x0, x1, [x0, #(0 * 8)] - stp x2, x3, [x0, #(2 * 8)] - stp x4, x5, [x0, #(4 * 8)] - stp x6, x7, [x0, #(6 * 8)] - stp x8, x9, [x0, #(8 * 8)] - stp x10, x11, [x0, #(10 * 8)] - stp x12, x13, [x0, #(12 * 8)] - stp x14, x15, [x0, #(14 * 8)] - stp x16, x17, [x0, #(16 * 8)] - stp x18, x19, [x0, #(18 * 8)] - stp x20, x21, [x0, #(20 * 8)] - stp x22, x23, [x0, #(22 * 8)] - stp x24, x25, [x0, #(24 * 8)] - stp x26, x27, [x0, #(26 * 8)] - stp x28, x29, [x0, #(28 * 8)] - str x30, [x0, #(30 * 8)] - ret -END(variant_pcs_test) diff --git a/libexec/rtld-elf/tests/aarch64/variant_pcs_dso/Makefile b/libexec/rtld-elf/tests/aarch64/variant_pcs_dso/Makefile deleted file mode 100644 index 08f1eec00b06..000000000000 --- a/libexec/rtld-elf/tests/aarch64/variant_pcs_dso/Makefile +++ /dev/null @@ -1,13 +0,0 @@ - -.PATH: ${.CURDIR:H} -SHLIB= h_variant_pcs -SHLIB_NAME= libh_variant_pcs.so -SHLIB_MAJOR= 1 - -WITHOUT_STATIC= -WITHOUT_PROFILE= -WITHOUT_PIC= - -SRCS= variant_pcs_dso.S - -.include diff --git a/libexec/rtld-elf/tests/aarch64/variant_pcs_helper.S b/libexec/rtld-elf/tests/aarch64/variant_pcs_helper.S deleted file mode 100644 index 9480ba629c2e..000000000000 --- a/libexec/rtld-elf/tests/aarch64/variant_pcs_helper.S +++ /dev/null @@ -1,91 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2024 Arm Ltd - * - * 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 - -.global variant_pcs_test_ret - -/* - * void variant_pcs_helper(void *buffer); - * - * This follows the aapcs64 convention so needs to save and restore - * the callee-saved registers. It puts a known value in each register - * other than x0 and x30 as x0 contains the buffer used to store the - * register data, and x30 is the link register so will be trashed by - * the branch and link to variant_pcs_test. - */ -ENTRY(variant_pcs_helper) - sub sp, sp, #(14 * 8) - stp x29, x30, [sp, #(12 * 8)] - stp x27, x28, [sp, #(10 * 8)] - stp x25, x26, [sp, #( 8 * 8)] - stp x23, x24, [sp, #( 6 * 8)] - stp x22, x23, [sp, #( 4 * 8)] - stp x21, x22, [sp, #( 2 * 8)] - stp x19, x20, [sp, #( 0 * 8)] - add x29, sp, #(12 * 8) - mov x1, #1 - mov x2, #2 - mov x3, #3 - mov x4, #4 - mov x5, #5 - mov x6, #6 - mov x7, #7 - mov x8, #8 - mov x9, #9 - mov x10, #10 - mov x11, #11 - mov x12, #12 - mov x13, #13 - mov x14, #14 - mov x15, #15 - mov x16, #16 - mov x17, #17 - mov x18, #18 - mov x19, #19 - mov x20, #20 - mov x21, #21 - mov x22, #22 - mov x23, #23 - mov x24, #24 - mov x25, #25 - mov x26, #26 - mov x27, #27 - mov x28, #28 - mov x29, #29 - bl variant_pcs_test -variant_pcs_test_ret: - ldp x19, x20, [sp, #( 0 * 8)] - ldp x21, x22, [sp, #( 2 * 8)] - ldp x22, x23, [sp, #( 4 * 8)] - ldp x23, x24, [sp, #( 6 * 8)] - ldp x25, x26, [sp, #( 8 * 8)] - ldp x27, x28, [sp, #(10 * 8)] - ldp x29, x30, [sp, #(12 * 8)] - add sp, sp, #(14 * 8) - ret -END(variant_pcs_helper) From nobody Fri May 17 12:57:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgn6r6pBzz5L7jD; Fri, 17 May 2024 12:57:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vgn6r6JGRz44f9; Fri, 17 May 2024 12:57:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715950644; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gNTkfc4Oy6e0n9e8aFQQcFHVtrbiqGkZybYVaUcPoy0=; b=cBVThiD0yKga6O9ISZQCxbWGxDSTPRY4yJwBE9DrFRXxnSPv+ANzBmRk+WhjVfkPJFWNfR XzOMN2h3Moz+bR9W/4GKZhkGx5VJyWK8bzCoccnGpePJebvhhA/E2cUQrBQn8quekblhkN aOVCYDBrZv0G+4gDBFN9O2zRb9i6eAIgL3fE64yUu4F/FyutiaUr64V0ZEG60Bij48hODp IGKBVrkIArsjJFHuXld5DlNVvbMxE/sTdZ+rpo3ZmrzTjXtI96LBBWnBz0n64ryBYqhNeg zKrmC2xd0gucl2DYEe/f7oW18PBaYo0vqoagOem+07Z9PJ7n5pOZ89E8SLqTgw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715950644; a=rsa-sha256; cv=none; b=s+KjLPY97ZjUgGb3An3NwNn0vZy/0PZr/lMaEtMFhhVNaurybHwZjVXTSKl9Y9E+AX35ge nQQWX6JDl4zpTHfdWwrbzYXO+ptAASofTp8NamLtTTxqWX8o84hlHAp/K9UspCtSwRAUmF kGUlc6pXYLBX71amzZj3m8aV0kOu/SwuX/FNda5SNqh/H8DNen/My/+nFo7xin8j4eKWor VpVzKLeQQ8ToiPkYgixI9bArfHkQuIIwwdduBhiCq1wuscZZiuQWMoRFe4byFfXv9jmtfG um/23iXv7sS3Xrme2hp9/wUO3KWrZo+6+EBjQfmbar0gIQ13HEda55M7OllkMA== 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=1715950644; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gNTkfc4Oy6e0n9e8aFQQcFHVtrbiqGkZybYVaUcPoy0=; b=Ik13eFL9Zu+pkl9XPcvQnQ2MBX/C2w4EsABNO8QYbgME1pTgRiM76B+N0aj0FsbhsrYKuh tNvA8S3kJ0JthJIsJu4fIC2m8yIOJZAHr5jJCGccCvXm1bYbVGImKYN4spWxvxIXsqWosr DhxmK176YYygreaQZ7qLOg66VZfEPZPB19qsIEn42ZIYNIqRnLnkEUxw53wgTLacNeBGW4 inxgEVyarFfGMIg8EkM8FTAlp6dxXSJeUThi5ip6uzrxlhZ10a4hPU9tnFiEuPvdvPiTnP xHfpAgVWgMcvL5ndWNg0S4hL7T26vMBTsLsMV06BvDlTDMj5KG/kzudpUtf6QA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vgn6r5wdRzkCZ; Fri, 17 May 2024 12:57:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44HCvOq2028227; Fri, 17 May 2024 12:57:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HCvOle028224; Fri, 17 May 2024 12:57:24 GMT (envelope-from git) Date: Fri, 17 May 2024 12:57:24 GMT Message-Id: <202405171257.44HCvOle028224@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 62adeb92dfe9 - main - tpm: Add new tpm_bus.c to module Makefile List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 62adeb92dfe946524bdaf7139b161d3d5a09ba2e Auto-Submitted: auto-generated The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=62adeb92dfe946524bdaf7139b161d3d5a09ba2e commit 62adeb92dfe946524bdaf7139b161d3d5a09ba2e Author: Justin Hibbits AuthorDate: 2024-05-17 16:54:44 +0000 Commit: Justin Hibbits CommitDate: 2024-05-17 16:57:38 +0000 tpm: Add new tpm_bus.c to module Makefile Reported by: eduardo@ Fixes: c2e9c5bbf0 ("tpm: Refactor TIS and add a SPI attachment") --- sys/modules/tpm/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/modules/tpm/Makefile b/sys/modules/tpm/Makefile index 81f571b164ef..c859e010b2d9 100644 --- a/sys/modules/tpm/Makefile +++ b/sys/modules/tpm/Makefile @@ -22,6 +22,7 @@ SRCS+= tpm_spibus.c tpm_tis_spibus.c spibus_if.h SRCS+= acpi_if.h SRCS+= tpm_tis_acpi.c SRCS+= tpm_crb.c +SRCS+= tpm_bus.c .endif .include From nobody Fri May 17 13:21:33 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgnfk0L4hz5L9Xn; Fri, 17 May 2024 13:21: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 4Vgnfj6scJz4736; Fri, 17 May 2024 13:21:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715952094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/jWVvpWH3RqZA8XqCc2zsOL4vrxIwGs1dn2VknV+dyk=; b=vS9+MsEgntjgdTt6yhIne9kwQj6ygQgj1NMO3Vj0+r/bNvVLWVPlbwg6AJ9xllBfumcba5 onYaa56/lAfMzum/7lN1RLVbmoUvI6ZAENsjnrCF4h2cjO7oTIYzpq0yBrhJdlKQTTJmn3 1OVMHwMw4YdAFUxTYHpoFltH5wXqPGZ5nJ3teJbOek7EaL6Yib5t52np6CG4u6V8ovP38r rgpRDvXgW64bIfAzFKliumMlYaroV9x87PjTEhtXonrZ4RMhZlD2GN8iiv/n3i1dSLMCUF mZOni0CowowgKMVZS9FaBGlmTh7rYGDrl0Y1/gA8MYBs6nqrsJGJUawr/LVEkg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715952094; a=rsa-sha256; cv=none; b=VtFTHOa0mPhjK8421eqYpVz5wMTWNev9f1zT/C10aMmlAsGS1hAfS01uSkN2OnSaaijnQE K+5mX1PGP6dG7pPgXw/NkT2YWi7eVVxVwsk4gIxgIrBDVkwGOqyc7KmoL3BDGXXvzaQ80P njOeQYKn1rPq5oiz5Q3LH7QSb1qzMA0v//l4OAEwsKR3eUwCzVbvh7MZTVSeSjp1qL/1Nn TSDNrC8zMW2CsBr2t844Z9B+slLGFeufHScoH/wqTF76tgJamj+BZ76raAGXqYjZtZ0atv GXc1cO50NZXK+CfiWTWR2AFyv7Ggvvf259m5DTAsqp3KPJwqm0yXk3TZC946aQ== 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=1715952094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/jWVvpWH3RqZA8XqCc2zsOL4vrxIwGs1dn2VknV+dyk=; b=gfE94KMnlUJvLTEVP2W8kGgZ9tnnj5Eo+yzYqu4ThtZfpDp49uMTy4uY0wF0JTy0TJk1qk uJZP6zlP1v0PmHK3xCg1q0E3+ty1iUw/BXcw3hZuNMkf+5OSP3zfBu+SEnOmrxI3Os7frK XBjsImetT+lHsJIInLH4riBejVQoNlLS3c8PhhM/9nIu3ww5HfyHwKjGug4jNf8L2gRKu8 SlC5HyET8aksAdpttYWlaBs7d5EIWOyDjUmvv/n9CMDEl2DJAXpWDxipwL9z84vRmSF72w AGHQhl5nbvWA4pQdz3dASTvUJFYZksOaiyEvFb6vU63jpaFc0ZgvJnY8+63WOw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vgnfj6Swfzk6V; Fri, 17 May 2024 13:21: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 44HDLXxe077763; Fri, 17 May 2024 13:21:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HDLXnm077760; Fri, 17 May 2024 13:21:33 GMT (envelope-from git) Date: Fri, 17 May 2024 13:21:33 GMT Message-Id: <202405171321.44HDLXnm077760@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 4660d9658710 - main - arm64/vmm: Fix the build with GCC List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4660d9658710f69649018ca7b6b0be4b6d3bdd33 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=4660d9658710f69649018ca7b6b0be4b6d3bdd33 commit 4660d9658710f69649018ca7b6b0be4b6d3bdd33 Author: Andrew Turner AuthorDate: 2024-05-16 14:35:00 +0000 Commit: Andrew Turner CommitDate: 2024-05-17 13:19:45 +0000 arm64/vmm: Fix the build with GCC - Fix the spelling of handle_el2_el1_irq64 - Add .section before .rodata as the GCC build needs it Sponsored by: Arm Ltd --- sys/arm64/vmm/vmm_hyp_el2.S | 2 +- sys/arm64/vmm/vmm_hyp_exception.S | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/arm64/vmm/vmm_hyp_el2.S b/sys/arm64/vmm/vmm_hyp_el2.S index 7b49d3144dff..7012e238c9c8 100644 --- a/sys/arm64/vmm/vmm_hyp_el2.S +++ b/sys/arm64/vmm/vmm_hyp_el2.S @@ -30,7 +30,7 @@ #include - .rodata + .section .rodata .align PAGE_SHIFT .globl vmm_hyp_code vmm_hyp_code: diff --git a/sys/arm64/vmm/vmm_hyp_exception.S b/sys/arm64/vmm/vmm_hyp_exception.S index 0e8b31ae8b12..9a9dc6901f40 100644 --- a/sys/arm64/vmm/vmm_hyp_exception.S +++ b/sys/arm64/vmm/vmm_hyp_exception.S @@ -332,7 +332,7 @@ LENTRY(handle_el2_el1_irq64) 2: ldr x9, [sp], #16 ret -LEND(handle_el2_el1_irq) +LEND(handle_el2_el1_irq64) LENTRY(handle_el2_el1_fiq64) do_world_switch_to_host From nobody Fri May 17 13:21:34 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgnfl2Wvtz5L9L2; Fri, 17 May 2024 13:21: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 4Vgnfl0lBjz475Z; Fri, 17 May 2024 13:21:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715952095; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4r4EXhP6DmfPEC5z1eP0V0fPATp2yuvU6JIau0VN0YI=; b=rilpc4YpOFeJV30LelGafFS5bfQCGI/EMCY/Qa3kdxRCkOqa/HZ4dMbqiCziDutajpF/sF p4TypJFig5YnUeLjtHfkH5wWoFmmGbej4ssyxwayzWHcLhaLWfOZvM5OOjtCWUhR/eAwv8 4CzR2dWDFSk5ouF3Yu44+WkOUV71ZwHHkWFEUzR8kEYuQefSHHDtma38PguPN8A+cW/VVj I94rHuV7DVYF4Xrp0xr/3glGXBDhEPorSiSmhbg02GoDiAEHhbizkheml1wBaVlfaVjmT7 QTdL6whydl0Wp6sPCq1EyZyXcKyL0Fsm0L4ODV565fvjQwvhy+Pp+rwoKzGWxg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715952095; a=rsa-sha256; cv=none; b=id6USVU7CGv3GUux2MLaPJAwQvqpliP9ciCEFsEQfAMw3Xt3f1eMtEXL7Kxp3Ymu/ef/WF gKEn5/ymv3FSbhUkGBBtCHhecOQDhGrcO7l7c940+mR6yuG5jJTl+td2RqxuUPDSlBKBYK iZQ+vK4uc3WS2/TxzS76MkO+jvTHxVhAihfuivcEFyNRxj1MSQig617hJGLKEMNmJaHVAG BKFLYDvDWWcaupV0OvVvxFGWja1omwfngjTgWQson/RwIpOg6T6fuda5UAVOUdz1+8rN0u UHPZ4tiGqTkPMqmy3U+qGmJDqFlZVC4bAX0Z0XAfyutUb51+asvJlcYhZJAbkQ== 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=1715952095; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4r4EXhP6DmfPEC5z1eP0V0fPATp2yuvU6JIau0VN0YI=; b=pSNWz/m1nHTDyc3xZTYh+rKKFwFS7Q5+kpYHR2Eooe9FcbKcFRGNzwv5VlWBJf+5gYk7Z3 mQ0jTY/QzNXRGrgpS8Ceo1poKcz9noBil7/vw5RgSyws3LDB73AskqWUxWVFJOrlLZl25G TDzO+pcNFhpgPtmCkDZLsswk4dRemqUwnQlrJNiGyCyFfAq79TunzURWMU2AbN9ePmNu1A dkNz6XPSXxT9IuUo5eFT0IhLIX3Ek7EQRIVNdUc5I2gBz03aD5yWAmRSfP5jjUoEdyWqV3 Cj4kHukupEG3YkfxrjHIQwNfXzKJj7pRS0HY5+qzb50G8F+k+BJpk442Mg0/vQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vgnfl0Lx8zkjl; Fri, 17 May 2024 13:21: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 44HDLYP3077805; Fri, 17 May 2024 13:21:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HDLYSv077802; Fri, 17 May 2024 13:21:34 GMT (envelope-from git) Date: Fri, 17 May 2024 13:21:34 GMT Message-Id: <202405171321.44HDLYSv077802@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 2790ff21452f - main - dev/psci: Fix a function name List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2790ff21452f007b7c6004497773e7e80df90371 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=2790ff21452f007b7c6004497773e7e80df90371 commit 2790ff21452f007b7c6004497773e7e80df90371 Author: Andrew Turner AuthorDate: 2024-05-16 14:38:15 +0000 Commit: Andrew Turner CommitDate: 2024-05-17 13:19:59 +0000 dev/psci: Fix a function name dd a missing underscore to arm_smccc_1_2_* to fix the GCC build. Sponsored by: Arm Ltd --- sys/dev/psci/smccc_arm64.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/psci/smccc_arm64.S b/sys/dev/psci/smccc_arm64.S index 3d3c9fc837b1..25a64669fab3 100644 --- a/sys/dev/psci/smccc_arm64.S +++ b/sys/dev/psci/smccc_arm64.S @@ -77,7 +77,7 @@ ENTRY(arm_smccc_1_2_\insn) stp x16, x17, [x19, #16 * 8] 1: ldp xzr, x19, [sp], #16 ret -END(arm_smccc_1_2\insn) +END(arm_smccc_1_2_\insn) .endm /* int arm_smccc_1_2_*(const struct arm_smccc_1_2_regs *args, * struct arm_smccc_1_2_regs *res) From nobody Fri May 17 15:12:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgr6C0CTBz5LJk2; Fri, 17 May 2024 15:12: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 4Vgr6B52kSz4HN7; Fri, 17 May 2024 15:12:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715958722; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kHjsg4n6wXb66x7fEmcYX6zSqw6G1DV2kNpTJ7o24Hk=; b=sK9+uulPUpp/a1/qf+bZOASL2UVBpe9xvMC++TCtbzbGhfV6YTmLW5K7jhYmiTu1VspSkn GZsHgCC/LelTkDdtkD+ZwM8961bOZnh60MA84N3u8aSsOzNqkR7mO4lmTYcuiY2WumOP9u EV/LI+MOInZYY9aflwsa6fj7LwBf4ylQihuEYLmjlZRa58ytEtARnmSFmLw3cBMluzw7uO NJJxXQiJ0zy0myolq7OfH8P5cZjWPm3ZNfoPq5EEwsMP3+WrpCPeJZImpJv4gknK5PNW49 LB2Hqv/RymORsx/6R7HfDSUKlDZOEhnlEuE8qyiSfn44ktgQTN6nfqwzXMUieQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715958722; a=rsa-sha256; cv=none; b=wGHBkdvuV5Gm4MLtEI1ryqnNgJUWAKm+m9Z+S8xsGjvnjv0c3NtIJyO0EqmwebCMDcGTB/ 5EQ8uZ40BlWjR+bBC2eoFmZjpkWQVo4o0bVY/edMaz0wBZl4/0EqvRpZnoVBwbpYFXC5ha wP4ARdbgOoWx0gZ9BOtU1cqTIaPq3nNrpfwFcdCGyrAN3bVPUH8PjnrVwbcHx22dka01zO kH0Csbop/Tp9cvwOkmtYo7TLCyOh1ugP4XJmhjsnQQjuHoJ440SGSaWeORdG7GRH82ENos R2w6rM3UDVoZMn1acleK+ftBjeefPAJKRKmjIIQege5x6jcQx2vAVUAH6qamUQ== 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=1715958722; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kHjsg4n6wXb66x7fEmcYX6zSqw6G1DV2kNpTJ7o24Hk=; b=ogvr4VnooJZ4wphDispP6hMUx9PKEhJGkGJw4GQV036gcnrjEI7SCPD9ceUR4ulkXfNsLe cWjO1kGG8QhixQmxDkST25vfC71zd3TQ5I+xzm3xVOVzv2Rq7Fj3fQCOaTvOBrPeufSF+9 3nco2QB82C2OIy/Ie8mdPUdoAtKnp79TjNoRlKLrRLQOsJPo/uPlMvX6A9oI9wisDfgR9w /8IjKBO0wU8ZHnPuLRcTa+x/A325TnWQuNPM22wz45/AUVkYakRVgWSzsu91G5cE6bCEPL cC/0V84KXMmmNQkCRK3ek16/V3CzaRolXvJilbIdO3j9dfb7wfNAt2wHYBRUUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vgr6B4fNNzmyN; Fri, 17 May 2024 15:12: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 44HFC2G4060382; Fri, 17 May 2024 15:12:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HFC2AB060379; Fri, 17 May 2024 15:12:02 GMT (envelope-from git) Date: Fri, 17 May 2024 15:12:02 GMT Message-Id: <202405171512.44HFC2AB060379@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: f7bdaa103eb8 - main - arm64: make SPE regs use ALT_NAME macro List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f7bdaa103eb8906fc999c7fd5e8d6af440e26e6c Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=f7bdaa103eb8906fc999c7fd5e8d6af440e26e6c commit f7bdaa103eb8906fc999c7fd5e8d6af440e26e6c Author: Zachary Leaf AuthorDate: 2024-05-10 15:59:00 +0000 Commit: Andrew Turner CommitDate: 2024-05-17 14:45:44 +0000 arm64: make SPE regs use ALT_NAME macro When the register is not defined in Armv8.0 i.e. added in a later extension, like SPE added in v8.2, the alternative name format of: S__C_C_ should be used; otherwise, calls to {READ,WRITE}_SPECIALREG() will fail. Use the MRS_REG_ALT_NAME() macro for SPE changing hex to decimal as required by the macro. Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45171 --- sys/arm64/include/armreg.h | 132 ++++++++++++++++++++++++--------------------- 1 file changed, 72 insertions(+), 60 deletions(-) diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index 5d193af5fd71..144e357d14b2 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -1636,11 +1636,12 @@ /* PMBIDR_EL1 */ #define PMBIDR_EL1 MRS_REG(PMBIDR_EL1) -#define PMBIDR_EL1_op0 0x3 -#define PMBIDR_EL1_op1 0x0 -#define PMBIDR_EL1_CRn 0x9 -#define PMBIDR_EL1_CRm 0xa -#define PMBIDR_EL1_op2 0x7 +#define PMBIDR_EL1_REG MRS_REG_ALT_NAME(PMBIDR_EL1) +#define PMBIDR_EL1_op0 3 +#define PMBIDR_EL1_op1 0 +#define PMBIDR_EL1_CRn 9 +#define PMBIDR_EL1_CRm 10 +#define PMBIDR_EL1_op2 7 #define PMBIDR_Align_SHIFT 0 #define PMBIDR_Align_MASK (UL(0xf) << PMBIDR_Align_SHIFT) #define PMBIDR_P_SHIFT 4 @@ -1650,11 +1651,12 @@ /* PMBLIMITR_EL1 */ #define PMBLIMITR_EL1 MRS_REG(PMBLIMITR_EL1) -#define PMBLIMITR_EL1_op0 0x3 -#define PMBLIMITR_EL1_op1 0x0 -#define PMBLIMITR_EL1_CRn 0x9 -#define PMBLIMITR_EL1_CRm 0xa -#define PMBLIMITR_EL1_op2 0x0 +#define PMBLIMITR_EL1_REG MRS_REG_ALT_NAME(PMBLIMITR_EL1) +#define PMBLIMITR_EL1_op0 3 +#define PMBLIMITR_EL1_op1 0 +#define PMBLIMITR_EL1_CRn 9 +#define PMBLIMITR_EL1_CRm 10 +#define PMBLIMITR_EL1_op2 0 #define PMBLIMITR_E_SHIFT 0 #define PMBLIMITR_E (UL(0x1) << PMBLIMITR_E_SHIFT) #define PMBLIMITR_FM_SHIFT 1 @@ -1667,22 +1669,24 @@ /* PMBPTR_EL1 */ #define PMBPTR_EL1 MRS_REG(PMBPTR_EL1) -#define PMBPTR_EL1_op0 0x3 -#define PMBPTR_EL1_op1 0x0 -#define PMBPTR_EL1_CRn 0x9 -#define PMBPTR_EL1_CRm 0xa -#define PMBPTR_EL1_op2 0x1 +#define PMBPTR_EL1_REG MRS_REG_ALT_NAME(PMBPTR_EL1) +#define PMBPTR_EL1_op0 3 +#define PMBPTR_EL1_op1 0 +#define PMBPTR_EL1_CRn 9 +#define PMBPTR_EL1_CRm 10 +#define PMBPTR_EL1_op2 1 #define PMBPTR_PTR_SHIFT 0 #define PMBPTR_PTR_MASK \ (UL(0xffffffffffffffff) << PMBPTR_PTR_SHIFT) /* PMBSR_EL1 */ #define PMBSR_EL1 MRS_REG(PMBSR_EL1) -#define PMBSR_EL1_op0 0x3 -#define PMBSR_EL1_op1 0x0 -#define PMBSR_EL1_CRn 0x9 -#define PMBSR_EL1_CRm 0xa -#define PMBSR_EL1_op2 0x3 +#define PMBSR_EL1_REG MRS_REG_ALT_NAME(PMBSR_EL1) +#define PMBSR_EL1_op0 3 +#define PMBSR_EL1_op1 0 +#define PMBSR_EL1_CRn 9 +#define PMBSR_EL1_CRm 10 +#define PMBSR_EL1_op2 3 #define PMBSR_MSS_SHIFT 0 #define PMBSR_MSS_MASK (UL(0xffff) << PMBSR_MSS_SHIFT) #define PMBSR_COLL_SHIFT 16 @@ -1848,11 +1852,12 @@ /* PMSCR_EL1 */ #define PMSCR_EL1 MRS_REG(PMSCR_EL1) -#define PMSCR_EL1_op0 0x3 -#define PMSCR_EL1_op1 0x0 -#define PMSCR_EL1_CRn 0x9 -#define PMSCR_EL1_CRm 0x9 -#define PMSCR_EL1_op2 0x0 +#define PMSCR_EL1_REG MRS_REG_ALT_NAME(PMSCR_EL1) +#define PMSCR_EL1_op0 3 +#define PMSCR_EL1_op1 0 +#define PMSCR_EL1_CRn 9 +#define PMSCR_EL1_CRm 9 +#define PMSCR_EL1_op2 0 #define PMSCR_E0SPE_SHIFT 0 #define PMSCR_E0SPE (UL(0x1) << PMSCR_E0SPE_SHIFT) #define PMSCR_E1SPE_SHIFT 1 @@ -1877,19 +1882,21 @@ /* PMSEVFR_EL1 */ #define PMSEVFR_EL1 MRS_REG(PMSEVFR_EL1) -#define PMSEVFR_EL1_op0 0x3 -#define PMSEVFR_EL1_op1 0x0 -#define PMSEVFR_EL1_CRn 0x9 -#define PMSEVFR_EL1_CRm 0x9 -#define PMSEVFR_EL1_op2 0x5 +#define PMSEVFR_EL1_REG MRS_REG_ALT_NAME(PMSEVFR_EL1) +#define PMSEVFR_EL1_op0 3 +#define PMSEVFR_EL1_op1 0 +#define PMSEVFR_EL1_CRn 9 +#define PMSEVFR_EL1_CRm 9 +#define PMSEVFR_EL1_op2 5 /* PMSFCR_EL1 */ #define PMSFCR_EL1 MRS_REG(PMSFCR_EL1) -#define PMSFCR_EL1_op0 0x3 -#define PMSFCR_EL1_op1 0x0 -#define PMSFCR_EL1_CRn 0x9 -#define PMSFCR_EL1_CRm 0x9 -#define PMSFCR_EL1_op2 0x4 +#define PMSFCR_EL1_REG MRS_REG_ALT_NAME(PMSFCR_EL1) +#define PMSFCR_EL1_op0 3 +#define PMSFCR_EL1_op1 0 +#define PMSFCR_EL1_CRn 9 +#define PMSFCR_EL1_CRm 9 +#define PMSFCR_EL1_op2 4 #define PMSFCR_FE_SHIFT 0 #define PMSFCR_FE (UL(0x1) << PMSFCR_FE_SHIFT) #define PMSFCR_FT_SHIFT 1 @@ -1907,11 +1914,12 @@ /* PMSICR_EL1 */ #define PMSICR_EL1 MRS_REG(PMSICR_EL1) -#define PMSICR_EL1_op0 0x3 -#define PMSICR_EL1_op1 0x0 -#define PMSICR_EL1_CRn 0x9 -#define PMSICR_EL1_CRm 0x9 -#define PMSICR_EL1_op2 0x2 +#define PMSICR_EL1_REG MRS_REG_ALT_NAME(PMSICR_EL1) +#define PMSICR_EL1_op0 3 +#define PMSICR_EL1_op1 0 +#define PMSICR_EL1_CRn 9 +#define PMSICR_EL1_CRm 9 +#define PMSICR_EL1_op2 2 #define PMSICR_COUNT_SHIFT 0 #define PMSICR_COUNT_MASK (UL(0xffffffff) << PMSICR_COUNT_SHIFT) #define PMSICR_ECOUNT_SHIFT 56 @@ -1919,11 +1927,12 @@ /* PMSIDR_EL1 */ #define PMSIDR_EL1 MRS_REG(PMSIDR_EL1) -#define PMSIDR_EL1_op0 0x3 -#define PMSIDR_EL1_op1 0x0 -#define PMSIDR_EL1_CRn 0x9 -#define PMSIDR_EL1_CRm 0x9 -#define PMSIDR_EL1_op2 0x7 +#define PMSIDR_EL1_REG MRS_REG_ALT_NAME(PMSIDR_EL1) +#define PMSIDR_EL1_op0 3 +#define PMSIDR_EL1_op1 0 +#define PMSIDR_EL1_CRn 9 +#define PMSIDR_EL1_CRm 9 +#define PMSIDR_EL1_op2 7 #define PMSIDR_FE_SHIFT 0 #define PMSIDR_FE (UL(0x1) << PMSIDR_FE_SHIFT) #define PMSIDR_FT_SHIFT 1 @@ -1951,11 +1960,12 @@ /* PMSIRR_EL1 */ #define PMSIRR_EL1 MRS_REG(PMSIRR_EL1) -#define PMSIRR_EL1_op0 0x3 -#define PMSIRR_EL1_op1 0x0 -#define PMSIRR_EL1_CRn 0x9 -#define PMSIRR_EL1_CRm 0x9 -#define PMSIRR_EL1_op2 0x3 +#define PMSIRR_EL1_REG MRS_REG_ALT_NAME(PMSIRR_EL1) +#define PMSIRR_EL1_op0 3 +#define PMSIRR_EL1_op1 0 +#define PMSIRR_EL1_CRn 9 +#define PMSIRR_EL1_CRm 9 +#define PMSIRR_EL1_op2 3 #define PMSIRR_RND_SHIFT 0 #define PMSIRR_RND (UL(0x1) << PMSIRR_RND_SHIFT) #define PMSIRR_INTERVAL_SHIFT 8 @@ -1963,21 +1973,23 @@ /* PMSLATFR_EL1 */ #define PMSLATFR_EL1 MRS_REG(PMSLATFR_EL1) -#define PMSLATFR_EL1_op0 0x3 -#define PMSLATFR_EL1_op1 0x0 -#define PMSLATFR_EL1_CRn 0x9 -#define PMSLATFR_EL1_CRm 0x9 -#define PMSLATFR_EL1_op2 0x6 +#define PMSLATFR_EL1_REG MRS_REG_ALT_NAME(PMSLATFR_EL1) +#define PMSLATFR_EL1_op0 3 +#define PMSLATFR_EL1_op1 0 +#define PMSLATFR_EL1_CRn 9 +#define PMSLATFR_EL1_CRm 9 +#define PMSLATFR_EL1_op2 6 #define PMSLATFR_MINLAT_SHIFT 0 #define PMSLATFR_MINLAT_MASK (UL(0xfff) << PMSLATFR_MINLAT_SHIFT) /* PMSNEVFR_EL1 */ #define PMSNEVFR_EL1 MRS_REG(PMSNEVFR_EL1) -#define PMSNEVFR_EL1_op0 0x3 -#define PMSNEVFR_EL1_op1 0x0 -#define PMSNEVFR_EL1_CRn 0x9 -#define PMSNEVFR_EL1_CRm 0x9 -#define PMSNEVFR_EL1_op2 0x1 +#define PMSNEVFR_EL1_REG MRS_REG_ALT_NAME(PMSNEVFR_EL1) +#define PMSNEVFR_EL1_op0 3 +#define PMSNEVFR_EL1_op1 0 +#define PMSNEVFR_EL1_CRn 9 +#define PMSNEVFR_EL1_CRm 9 +#define PMSNEVFR_EL1_op2 1 /* PMSWINC_EL0 */ #define PMSWINC_EL0 MRS_REG(PMSWINC_EL0) From nobody Fri May 17 15:12:03 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgr6D0Bmyz5LK9k; Fri, 17 May 2024 15:12:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vgr6C603wz4H4S; Fri, 17 May 2024 15:12:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715958723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mXTf/+nqHxqDSbD7fe6P5EYPNY4FqO6Q46QGrEIbT7U=; b=KcJ+klkcCzi5/rqIvVIpqJXQ/If2KNttXYWyk2AEmaQ4YdxXMP6gkVKBDn+qMR2Mgqm6Nx comciFzTo00FuDw3EhuF0+ip0vpZTiO9Ca38eoPIvZ+wW2DRpqKV6rad4qsx2KBN3l3T6D xGhI5RcgOD6BiHwNMbyhSP9sKheI9G/nCYe+gC9wpOAruHF1EFWm6UG51bf0Q997bgwVzF yrb5Log+KnN/FaFNS+7i94IyCbSqrul1V9OpS7Ds2JfqaDIpNZe9aE8d3fEg0N0wTAoceH oGVxuHpOSm3apMlG6mIwWo8IlyZR/sPrkAFmoAmsXapJolIxQxFt+G9yXSUDGQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715958723; a=rsa-sha256; cv=none; b=ZA6d70vOWvvnZ1LOCBy4s802ZGoA64fccFsT3ZXLuFJpRnvhdvtCjH5w37Qn+dMVr7kRvo esOcPeA5OTi/mkevUe6a6gSxwojVkffVm0Tph5gjDYWBn1c3GV7EXvgCJKWFUq4TTj1ahP XmwXM7eOU2at6QHezsHCP0uW51Fvgg1eR28dO3k61JfCl/jB0AtMksexG2S1GYr+HbFJ+i j2MExe8C6n7luN1TbzZTcJpJlItI1LvuQKkQ/XmCWn9XC/VP3kWhv3/ZVpsbzmdzW4RQ6l NJx4eJVzfmG2ELZlt8pXc29zxE9gERngHmLz2kza0fKc4hucepkBzGF5NY7EPg== 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=1715958723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mXTf/+nqHxqDSbD7fe6P5EYPNY4FqO6Q46QGrEIbT7U=; b=JoD0VPSMDDeTD0QpnGpyl0rj9tvzNI8iY1HYXRACLdiwA0rzCwOmZHCAvEf+JrWChaAypu DntPD8ssYpaCVeRf5jGAHGFay1aPI9XLQRP3JnReOrUmIfScxp9VYl56JB2amVGQ+FYZJG I/mT+Zm3buoy2u62/e2f/s0Z+Jdcuax9PqwFbFZ8/234xIo2vKp2/4mQeMvlIy0TsUuYKG hfZnlYMmr8xUsgn+33duoNPUwqVcDjMA5islYeYxgoWkhDMGgXqud2tAxMi6qV75FfbFRr wQa+YAJbHlSQHtfMC+PoZQlnzq3zHA/ef2g0mluW8ik1C0kzSpIWHGjyyL2Sng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vgr6C5bdZzn3t; Fri, 17 May 2024 15:12: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 44HFC3C6060427; Fri, 17 May 2024 15:12:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HFC3YF060424; Fri, 17 May 2024 15:12:03 GMT (envelope-from git) Date: Fri, 17 May 2024 15:12:03 GMT Message-Id: <202405171512.44HFC3YF060424@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 10b3eac88db6 - main - arm64: add PMBSR_MSS_{BSC,FSC} status code field List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 10b3eac88db689d657c4d0d0716bcbdf240ff614 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=10b3eac88db689d657c4d0d0716bcbdf240ff614 commit 10b3eac88db689d657c4d0d0716bcbdf240ff614 Author: Zachary Leaf AuthorDate: 2023-09-20 09:51:22 +0000 Commit: Andrew Turner CommitDate: 2024-05-17 14:46:00 +0000 arm64: add PMBSR_MSS_{BSC,FSC} status code field Bits [5:0] of PMBSR_MSS encodes either Buffer Status Code (BSC) or Fault Status Code (FSC) depending on PMBSR_EC value. Add PMBSR_MSS_{BSC,FSC} to cover this field. Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45172 --- sys/arm64/include/armreg.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index 144e357d14b2..ccd9f4a5c78a 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -1689,6 +1689,8 @@ #define PMBSR_EL1_op2 3 #define PMBSR_MSS_SHIFT 0 #define PMBSR_MSS_MASK (UL(0xffff) << PMBSR_MSS_SHIFT) +#define PMBSR_MSS_BSC_MASK (UL(0x3f) << PMBSR_MSS_SHIFT) +#define PMBSR_MSS_FSC_MASK (UL(0x3f) << PMBSR_MSS_SHIFT) #define PMBSR_COLL_SHIFT 16 #define PMBSR_COLL (UL(0x1) << PMBSR_COLL_SHIFT) #define PMBSR_S_SHIFT 17 From nobody Fri May 17 15:12:04 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgr6F1ZG9z5LK9m; Fri, 17 May 2024 15:12: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 4Vgr6D6q0Yz4HG0; Fri, 17 May 2024 15:12:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715958725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l3nhQC7cv1LU5wf64wYdUeOwdu9xvAZULU+X9Wxp7tQ=; b=jfxaeZ7HW2M5YpFEhPhkxleiREk2dBPmLAPrmHuHjsAy0aK413GkqFD1yiTYzWSLbrGGvS LF1eU2AaQtImEyQgmZ2ehVKZSIbSBTmWtTedjCJRdDDX18Mgr5v8UDkj3+sQ390PYzac4r zGBMQOZOxfqmUhhJQcLo+XQF15Q09glC0jyOv+WYBAQLtpqds/Sts6X9FHZ2pcZFoPr1IL VVmqaOdl02eag55ObehKX0hs+JLeqc+hkndIJNAzGJmRbKTtstRasmu0lszy7nIEqisI8Q dch+qkOtawFjoOi7s83YVR1ueSAZygPLMjV1TKQTLxwACtMtR8WIOyeApbLe5Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715958725; a=rsa-sha256; cv=none; b=BbhSA9RlpvlaPwe1+D44pTNjIIFpZZwk0vapwio+yVjgFl7yVWf5omzxqf2k5X6wqvZsan D+LLUMyo9IOTbMBG2xr1Gk34PDe2aaaBsQOHc7FQUNcd13l/FQWFEekhYghRvkbvQutpZz eZWU5tJzBF4CXjuMgXirz13U9uovBwb1lLi2ofysikfmdGr0dnylUw4d8e2XXpf5mnTiyp f8O3tSrTZaEj76VZ/mP4/V/YxrqF5I7HotKn00RXHx/6oQCUznMbyvqir2fKmwljCMkINK WLosv3b5YEcKDcrKtJ+BEZE0En+eatr7XO/nmuICu2mUjSKKRrpypVxJnWuoSA== 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=1715958725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l3nhQC7cv1LU5wf64wYdUeOwdu9xvAZULU+X9Wxp7tQ=; b=gOn3sFEe/EFp5BA6jebhA+aU2oUbFc5Ig4A8SNH6lM46HMyAqQYIpvA/JmnAdFYItGEPxm 0j0ejYRuFs9o2RjpydqQ623QdCvv5TAAyEOeJEMVWZFkiq0cIVu0zJOi+oyuh1vvhP07Nl b6WiPMwAgTKTjT+y0wRbq4aY0+AmLFObIAjY6GOv+wkkjKDJI18BNL2B1CT9G+eXs/hyTo Ehd3qcXQGL7/VLiL/luguPh/Pyb+mMmPBcL394ZbisIzSC+q/rq5pfo3pAPq+HnDKItaDT JdpXJdIyL58xyRrSrLDbBbXeEYXVqok+PKwQkVzhtZjLABqM5oEGCpESW8C2ZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vgr6D6GF1znDt; Fri, 17 May 2024 15:12: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 44HFC4xr060473; Fri, 17 May 2024 15:12:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HFC4WE060470; Fri, 17 May 2024 15:12:04 GMT (envelope-from git) Date: Fri, 17 May 2024 15:12:04 GMT Message-Id: <202405171512.44HFC4WE060470@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 4f8ba1c9dd00 - main - arm64: add CONTEXTIDR_EL1 reg List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4f8ba1c9dd00e0ae20fa161e166715746b6d1c04 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=4f8ba1c9dd00e0ae20fa161e166715746b6d1c04 commit 4f8ba1c9dd00e0ae20fa161e166715746b6d1c04 Author: Zachary Leaf AuthorDate: 2024-05-10 12:47:37 +0000 Commit: Andrew Turner CommitDate: 2024-05-17 14:46:27 +0000 arm64: add CONTEXTIDR_EL1 reg CONTEXTIDR_EL1 is used in debug and trace features to identify the current process or context. Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45173 --- sys/arm64/include/armreg.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index ccd9f4a5c78a..d1480cd61184 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -138,6 +138,15 @@ #define CNTPCT_EL0_CRm 0 #define CNTPCT_EL0_op2 1 +/* CONTEXTIDR_EL1 - Context ID register */ +#define CONTEXTIDR_EL1 MRS_REG(CONTEXTIDR_EL1) +#define CONTEXTIDR_EL1_REG MRS_REG_ALT_NAME(CONTEXTIDR_EL1) +#define CONTEXTIDR_EL1_op0 3 +#define CONTEXTIDR_EL1_op1 0 +#define CONTEXTIDR_EL1_CRn 13 +#define CONTEXTIDR_EL1_CRm 0 +#define CONTEXTIDR_EL1_op2 1 + /* CPACR_EL1 */ #define CPACR_ZEN_MASK (0x3 << 16) #define CPACR_ZEN_TRAP_ALL1 (0x0 << 16) /* Traps from EL0 and EL1 */ From nobody Fri May 17 16:01:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgsCC2CK5z5LN9P; Fri, 17 May 2024 16:01:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgsCC1lRbz4LW9; Fri, 17 May 2024 16:01:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715961687; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UFroMfW8AmhESOFpMCfRa/0p+zTb61nR6CWFvPcvyBs=; b=WKYfPI5fpAx1RQ2Ts0HCC/m8MV3olbHkZJCRNEQNSwB4kkTRFKb81OL0KG5/tPK2T8fHOS uhqNTV4GorwyZ67dPdQraXR62gJw0Qj+2hhP98sfbunG8MARrqun/XAWmeelC/k+i2bGrs DraZPMFRJ4BYqcAhSRHbtm6joP6K8Nbi/NZcSRBH9rfrcchEG/VB0tV4dXunWGWMqhSy4q LBpJm5JSznXDwIRnGUDqFZvqovC4f1whjsS13qg93l1RCCyDaELJ1aRjrycAWiRvl6Z7Rq he4HKEhHw8kIViDoPOGMBAGkUjut65kY4PqLEOwGqdrb89PrZn0bCNKQ3aTlbw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715961687; a=rsa-sha256; cv=none; b=GrpFht9Pka85P2xVMl4Z+4ayVrUJWkeY7bNvznHvTLHQeKQVjcdi6s8ttf/aRFcRowslIz D/aUOpFTELcodBmyHc75rD/3FIe43PFaWMCJVg71Y6ZHcuJw0gQE7uOOHwpBDFLV97WO2s +/pSkAzGoqI16/TWBknd6PoWZ1XTvNdKWy9kl1l+dXr+EYQ3b4WTW4eOBL6RDBWoxZWPeN udJq3+HRRB1HoeyoK+ZjODFOeoAcxGcPQR9SFl+MIqKDaa3HjGSK+L2D7LRoBgftNH7ENB ABAupTc1g9kV8acz/bZ9KwdLw7xKFnH9toRTOUQSJ+8gA7xax+5gYKm9p4BXLg== 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=1715961687; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UFroMfW8AmhESOFpMCfRa/0p+zTb61nR6CWFvPcvyBs=; b=vVJDhQoTF5pIzDSapKvUg51Eh8POAGL33CE9FlunCtnW9VTL0GDfI7hJObN0FNWhtxR/OI 26ciAsieoNNHPG0xi4FXr90jAaMKsCLXJu0O6DtaJKMLayQ7hid9yP+IZMMqH9IVPiJXSz lEEIEI9zqxtkkftJGztdRRC0qZE/lzP83gF3vzfZXz9ohbEb2PBR6hphYLy283UF/gQODh TtZLd+RGUoWzf5QkGahaS80XkD53sBknXTWkY8STVkvPs7A3PnVNZ9zkINtKUKjMTE7Njq ehzExkf4nAXIvPNdBBAN5RARBjsnqqiP2JpVlfBoyqGv8VNw5JA+nZ+pXsqNhA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgsCC1Lpmzpfq; Fri, 17 May 2024 16:01: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 44HG1R6I047218; Fri, 17 May 2024 16:01:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HG1RH4047215; Fri, 17 May 2024 16:01:27 GMT (envelope-from git) Date: Fri, 17 May 2024 16:01:27 GMT Message-Id: <202405171601.44HG1RH4047215@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 16d8dfde0c0f - main - aarch64: disable LIB32 with gcc List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 16d8dfde0c0fb2eb95f2dd8c350ae652fa2c68fa Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=16d8dfde0c0fb2eb95f2dd8c350ae652fa2c68fa commit 16d8dfde0c0fb2eb95f2dd8c350ae652fa2c68fa Author: Brooks Davis AuthorDate: 2024-05-17 15:47:06 +0000 Commit: Brooks Davis CommitDate: 2024-05-17 16:01:18 +0000 aarch64: disable LIB32 with gcc gcc doesn't have -m32 support on aarch64 so mark LIB32 broken there. We have to check both COMPILER_TYPE and X_COMPILER_TYPE becuase X_COMPILER_TYPE is only conditionally set and COMPILER_TYPE is the host compiler in Makefile.inc1. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D45089 --- share/mk/src.opts.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 00405e3f934f..501df88cd776 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -303,7 +303,7 @@ __DEFAULT_YES_OPTIONS+=LLDB __DEFAULT_NO_OPTIONS+=LLDB .endif # LIB32 is not supported on all 64-bit architectures. -.if (${__T} == "amd64" || ${__T:Maarch64*} != "" || ${__T} == "powerpc64") +.if (${__T:Maarch64*} != "" && ((defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} != "gcc") || (!defined(X_COMPILER_TYPE) && ${COMPILER_TYPE} != "gcc"))) || ${__T} == "amd64" || ${__T} == "powerpc64" __DEFAULT_YES_OPTIONS+=LIB32 .else BROKEN_OPTIONS+=LIB32 From nobody Fri May 17 16:01:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgsCF07s0z5LNJh; Fri, 17 May 2024 16:01:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgsCD30rTz4Lmw; Fri, 17 May 2024 16:01:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715961688; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yJMcQ/SGoQpcuEhy3jTpU/sNAlXq0IcaBShpiCa4DtY=; b=GF9cEUHVeDxmJPnvG04dU7ZcQf70dBvPbU7BfTV2N2nvdDK3g+3PB6jL9C3Cixs7aYX6Lz lLbZjjHjPKJgXPhV11eVhSE7/QVxCSaDypsOdSDYNih0WiwDfOeBLNYD8IFNY4uccDOEiN USPkeyzEOYoppJt2F8S+7xHq39HlZk+IsOjrzy9MKrW7ZMOKNT/Drg0iOR4sV1qFMW57pG vCHZHD3G6gzlycT60UwBQN1LCnvl8zewHJoxlezz/pWyotl58+dfN2cv7OedXp7mahCGZV YDaz7fF8H7RtQ7a6CPUmMW1ukXH49lZ/ooClEA2evNEMgAIU6WvZI/iDKEogpw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715961688; a=rsa-sha256; cv=none; b=Xo3nVTfZCpN8jSqeD72Om/tm8RZQrdCSb6APCoog9YiQmSVEayEVSJJvgpazE3g9ezub8l ArNaeD+0vUO0yXgWzOWZPY2/UDD6ywF0+bfny5xbd6SPn228IBZZHXqOjZo6SAXt2601M8 U5z0Dn/vOCTnQ5PAwuuHnBcLs+1yt2NAWpyN4tv5r6grpfonjQNCfYvJrGR+7LdDOt8hPe RaCSB7HMTxDNc4jPeoJW8cs+y3NCDijOkOdU/KMmAWwBg4d6B8o6rrIAJGcZv6CtOkV36h XnCyP1MnvXE5sI5VZj/NG3XZ9TYcP0AbF0SgpxjpXqz8L069CbqaoND8AmJn5A== 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=1715961688; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yJMcQ/SGoQpcuEhy3jTpU/sNAlXq0IcaBShpiCa4DtY=; b=LFNcNQajeUfhk0/xUIwHfBXWaejkmu7ws7XSPCNNJ+8EEaDsAfQYRYQXEi5AAMSJDCff6w B3q2Vg/XjdrGYd3TweDzBpkqor3VJKHfOA8LHKllZOH+eqk9fhpjJm3z/g+/BowKLVhpNI 2Q/DR9QhTZB4HAQhPUY7RxxyxZpyB+a7dbGi0a0fqMkImvA7soQOJmGgDWLhtstHoTP+ZB DCAJLu1oPTmCAJ9/+0LqOL9KXWiy4AKobIkWPk3xR0e5YFBT/rryMMflKroykQTvaNjGod J6v1a14SM3KEaS6YJWvAeNuJLY5Ob0fpmdaiio24Q9gMfSGNYmdcRlY/LBQ7lw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgsCD2YQRzpNY; Fri, 17 May 2024 16:01: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 44HG1SW8047264; Fri, 17 May 2024 16:01:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HG1Sef047261; Fri, 17 May 2024 16:01:28 GMT (envelope-from git) Date: Fri, 17 May 2024 16:01:28 GMT Message-Id: <202405171601.44HG1Sef047261@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 4c0dfd5959bd - main - arm: fail early on gcc builds List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4c0dfd5959bd499754e3fc9a7ce37c1d5ece31f7 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=4c0dfd5959bd499754e3fc9a7ce37c1d5ece31f7 commit 4c0dfd5959bd499754e3fc9a7ce37c1d5ece31f7 Author: Brooks Davis AuthorDate: 2024-05-17 15:47:22 +0000 Commit: Brooks Davis CommitDate: 2024-05-17 16:01:19 +0000 arm: fail early on gcc builds Since at least 2022 (see https://reviews.freebsd.org/D36754), it has not been possible to build armv6/armv7 with gcc due to atomics macros gcc doesn't like. Prevent developers doing due diligance from wasting time and CPU cycles on this combination as it just fails to build in libc. Reviewed by: imp, andrew Differential Revision: https://reviews.freebsd.org/D45193 --- Makefile.inc1 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile.inc1 b/Makefile.inc1 index 0728df1221a0..1bf4212b1d5e 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -172,6 +172,13 @@ LIBCOMPAT_INCLUDE_DIRS+= i386 LIBCOMPAT_INCLUDE_DIRS+= arm .endif +.if ((defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == "gcc") || \ + (!defined(X_COMPILER_TYPE) && ${COMPILER_TYPE} == "gcc")) +.if ${TARGET} == "arm" +.error "armv6/armv7 build are broken with gcc. See https://reviews.freebsd.org/D36754" +.endif +.endif + .if ${.MAKE.OS} != "FreeBSD" CROSSBUILD_HOST=${.MAKE.OS} .if ${.MAKE.OS} != "Linux" && ${.MAKE.OS} != "Darwin" From nobody Fri May 17 16:01:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgsCG2MZdz5LNCL; Fri, 17 May 2024 16:01:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgsCF3q51z4LWF; Fri, 17 May 2024 16:01:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715961689; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GV/7aMyuYOSAX+OzKXlFwtE4erOdF/8RTybWhYuCD8U=; b=RwjMWgNU8KePm3jx21avPsVIJovpy+z7SopRTZ4FZEHJdfLpEFRNSthFjHyly2sGTGPNGc Da7oAIu1dXcPh2+S8mRm7RobZqfdLE+RaPGoJKZHURaU8VaDMja2TPoHd2ja1Gk+tKb0kn DtDQRB8eTp/B+vdKmQv0Ecq84ieqT1XRRknPK+2Ud2mbrXoAFPP0jUavpW2D7TjmbZ9HrO 1FdQC6T6a1srhbDoNhF1e3kEUM2Mf0hhzVZFJ/NVHKLlxRiF3cKBMka3QRPHxzmvdRMRc1 pB8FPlgFxVGv2DKC73BvvLH7/QG4xTa+NNB+zv7uDTJAJQgyxWlCrs04hFJu9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715961689; a=rsa-sha256; cv=none; b=X88/+js/r4+LfvJt4gKChA5JHLCwys0yqXwB0SdXp684xY5ymWKguJ8mrVchv1KJhwi//3 Lx+hyXl+PK1qkSvtZSIikb5+swK2AfoXefgeZCf3rtLBHAmqNCKwkCaJI3oiYGPPfkaFKR uXYh70ACJhTWCkGnMrJaEtxJiW8ip+wLXxYfINrMiURArBlETlVnYpSZ6m7vLkjr9MRXHO LmaybJes0vWZ4cLWoiLDCl9phMzQ4SAllP2TUJIo2pqm1EglUoxR3WryKZZeZpvyC1EMun APr5zDScfW/uYfvhYnC/cITDuS+GcN0bnUIPo3Jq8htTJIhcNc+MG1DGlBOv4w== 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=1715961689; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GV/7aMyuYOSAX+OzKXlFwtE4erOdF/8RTybWhYuCD8U=; b=X5nVh2aNdSj+lMtryvBbvzOV3jtIBjnp7MILaW/aigoROfD/5ldg8IYTpmIXEyfXc6//N6 faNC3C/QLwJzrmKuzRrf3kPyAVj6dySEqzXfCQ0zhjsbw8BY2WUqUeQ1L+4XZiwshe87hR iM+s5ojhXRD6BQfB9odx0dFNIwn7spE01cvKUR5YG88ozx2M8Fh8QI0yoIkAv37nVrQ6lm SAskVcREpTTVuhwcly4I7rrdosMEBIbH37hIV2CEUh5ja1DQgyDgmAeY9Bt41q6wQgs7qx M12AJsggLRnjnvhyiod48p8lQbijydvDuZ9NM1OkkiX8yQ6Wq95Z+Ro/a4Svdg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgsCF3Pq5zphh; Fri, 17 May 2024 16:01: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 44HG1TH8047315; Fri, 17 May 2024 16:01:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HG1TTZ047312; Fri, 17 May 2024 16:01:29 GMT (envelope-from git) Date: Fri, 17 May 2024 16:01:29 GMT Message-Id: <202405171601.44HG1TTZ047312@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: d316de24faa7 - main - zfs: Avoid a gcc -Wint-to-pointer-cast warning List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d316de24faa7453118a90fb0e9839e8026e36a4e Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=d316de24faa7453118a90fb0e9839e8026e36a4e commit d316de24faa7453118a90fb0e9839e8026e36a4e Author: Brooks Davis AuthorDate: 2024-05-17 15:59:06 +0000 Commit: Brooks Davis CommitDate: 2024-05-17 16:01:19 +0000 zfs: Avoid a gcc -Wint-to-pointer-cast warning On 32-bit platforms long long is generally 64-bits. Sufficiently modern versions of gcc (13 in my testing) complains when casting a pointer to an integer of a different width so cast to uintptr_t first to avoid the warning. Fix i386 gcc builds while we wait for this to be merged to OpenZFS. Sponsored by: DARPA, AFRL Pull Request: https://github.com/openzfs/zfs/pull/16203 --- sys/contrib/openzfs/module/zfs/spa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/contrib/openzfs/module/zfs/spa.c b/sys/contrib/openzfs/module/zfs/spa.c index ec2b674fb7ee..c3800e018c73 100644 --- a/sys/contrib/openzfs/module/zfs/spa.c +++ b/sys/contrib/openzfs/module/zfs/spa.c @@ -6832,7 +6832,7 @@ spa_tryimport(nvlist_t *tryconfig) */ char *name = kmem_alloc(MAXPATHLEN, KM_SLEEP); (void) snprintf(name, MAXPATHLEN, "%s-%llx-%s", - TRYIMPORT_NAME, (u_longlong_t)curthread, poolname); + TRYIMPORT_NAME, (u_longlong_t)(uintptr_t)curthread, poolname); mutex_enter(&spa_namespace_lock); spa = spa_add(name, tryconfig, NULL); From nobody Fri May 17 16:07:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgsLg2hz4z5LNwB; Fri, 17 May 2024 16:07:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgsLg28SSz4P3g; Fri, 17 May 2024 16:07:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715962075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9IhICfMM4WFbS8AF/oRNLo6t4/5KFLhZOg1WnLnABeU=; b=jvfC9X+V48pb843m3ofb5t3lmz3+XNH2jY00qR4BLmEiSSBfZn6gg3mi7R1RUWC5kAVK/8 bC50+mxkF10Krr/su7gIkj1N8Fyu5S4J4OdDjpJd40Ax9lMVVoiuMbAnvuaD4JrFQuFIoY vLgoQsn0Nv7Z/H16NY1hw01//R1VII4uIpyFOOeRn1ST3wZ+Lr/0m6j8/OfwnnU5lZhHOe rEpQfY4XpInCxOqDrZjw4t3Gn0D7h0k2Ms9K4fAmHHUigNmHtXfg6YeTgoNMMAhqNRSiTo Y78i4Hx3gLNLVHhgyxb5i6Xk+ob2XRC/4UI1fFadLOyqiHfSbfleQ5TsT2v7yg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715962075; a=rsa-sha256; cv=none; b=h9V48vJerdyjUsoh3gIelAJKoSFt71y2KgOoiJa7Dyk3/VTi4PhjnDZhQTLmBjxCON/jhe 10av5jds8+9iFHv09LGPXEmHLDCBiRdY26ySF1tUFkcxaxO6J3nco1PCSlLDCjXzRMN3E/ BrdWR+stPL1yLKBkdN1xL6EFdlNSUEGJJYjo5P3PVXNI2nh6WIeJIHSuenwD3ejBCYascZ 5v8/O0S3wiyXZ0FGjgqirfvUgn+Si4in0jZ0LyEJVal6hTyK6b9vGx6F97N6YiwlAfbIIR ge1TsK+iOlw+AlR3V3zcQwqyraGMBAmj9FDuDpXtdodkNDSkqbY+HCWEuWz5ZA== 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=1715962075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9IhICfMM4WFbS8AF/oRNLo6t4/5KFLhZOg1WnLnABeU=; b=Svy+8mDUs4HY1VV8RN8ZCURLYqLVxG6wg73zeZlGCvePpX8BTe2ojobRghPbHeiGriyMmw fhinGAVs4PAVIIaF6OPyfix2TqO7aU8KkL5XQCXjlvJirfNImwjcrYsXmsqfBfXRkEpEmf cbOA5s2tmK/Osonc2xC4CSbcGC1jh7xx5vi2BQtvz7sO+8UuD3ATmw79yWL+puC+Ntlfdr deGcj0w5WSuyEbJ8R3sC225paHrvvOUO3A1lnqvomo9/R5Qxw7zBeiMBqqKERzXUuznrOj o6kv/mze63rLw9WRW4eC8O7vvjIGbp0wwPw4iArNvqIIDByQvXdgWMY44CShgg== Received: from [IPV6:2601:644:937f:4c50:c0c0:cf11:cc26:3c0e] (unknown [IPv6:2601:644:937f:4c50:c0c0:cf11:cc26:3c0e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4VgsLf5kHfzGKb; Fri, 17 May 2024 16:07:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <2cd3e698-1b42-4e7f-93a0-aacccb55c8d6@FreeBSD.org> Date: Fri, 17 May 2024 09:07:53 -0700 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: cff79fd02636 - main - linuxkpi: Fix spin_lock_init Content-Language: en-US To: Emmanuel Vadot , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202405170559.44H5xD7d019861@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <202405170559.44H5xD7d019861@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 5/16/24 10:59 PM, Emmanuel Vadot wrote: > The branch main has been updated by manu: > > URL: https://cgit.FreeBSD.org/src/commit/?id=cff79fd02636f34010d8b835cc9e55401fa76e74 > > commit cff79fd02636f34010d8b835cc9e55401fa76e74 > Author: Emmanuel Vadot > AuthorDate: 2024-05-17 04:52:53 +0000 > Commit: Emmanuel Vadot > CommitDate: 2024-05-17 05:58:59 +0000 > > linuxkpi: Fix spin_lock_init > > Some linux code re-init some spinlock so add MTX_NEW to mtx_init. > > Reported by: David Wolfskill > Fixes: ae38a1a1bfdf ("linuxkpi: spinlock: Simplify code") > --- > sys/compat/linuxkpi/common/include/linux/spinlock.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sys/compat/linuxkpi/common/include/linux/spinlock.h b/sys/compat/linuxkpi/common/include/linux/spinlock.h > index 3f6eb4bb70f6..2992e41c9c02 100644 > --- a/sys/compat/linuxkpi/common/include/linux/spinlock.h > +++ b/sys/compat/linuxkpi/common/include/linux/spinlock.h > @@ -140,7 +140,7 @@ typedef struct mtx spinlock_t; > #define spin_lock_name(name) _spin_lock_name(name, __FILE__, __LINE__) > > #define spin_lock_init(lock) mtx_init(lock, spin_lock_name("lnxspin"), \ > - NULL, MTX_DEF | MTX_NOWITNESS) > + NULL, MTX_DEF | MTX_NOWITNESS | MTX_NEW) > > #define spin_lock_destroy(_l) mtx_destroy(_l) This is only ok because of MTX_NOWITNESS. Reiniting locks without destroying them corrupts the internal linked lists in WITNESS for locks using witness. That may warrant a comment here explaining why we disable witness. It might be nice to add an extension to the various lock inits for code that wants to opt-int to using WITNESS where a name can be passed. Using those would be relatively small diffs in the client code and let select locks opt into using WITNESS. You could make it work by adding an optional second argument to spin_lock_init, etc. that takes the name. -- John Baldwin From nobody Fri May 17 16:12:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgsRl54Pgz5LPBH; Fri, 17 May 2024 16:12:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgsRl4Pnjz4PdQ; Fri, 17 May 2024 16:12:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715962339; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=91hwtCL1WGOq3wN3/o14a5zigfpuV3ZxN6PCsFPt9Bs=; b=fiYFzOyUCl9MUrq6F/LfLzKTfTnuCeLJ2XmbBVIoy3Ym6CH0FkKjKr8S0CEVjC3T4MuFcl 2/OsBG0duaBzdUyWIIhoo2zPSV+G52hFlVi4g9DTEjK2hIeOOo46ccwhd0vEpevTU9ZERc LRNaM0jTXxGnyPyIxd8WtsGes0jPf5r9OydMMD3n5R/V16RPRuf2b/kZRrYpIE/lIQ2tNW urMtaDpwvvnKrS4yEUVvU27+w99z8LO2IwokzjhKld7co107RhVi7H12UAeQ5xzZvr2d2w tkdn0v0SsCGfpDGVIGqzOgqlX35aFSv1RebNXOspVMObt5HjSK25zBccoikF0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715962339; a=rsa-sha256; cv=none; b=pDk5t4/5Fyc9YFJ90hWQYW1lp+3OBuxpeAAHAsIsLS1orak3lxPEyqlH4J9DjxX1+W/uXq qAYkSpPLwCm1ri8FIWlyDLNBf5IpThCzr3EmCtsqAb8FMhjuX7OcvlhaVWdW1W0x1UpOF+ xrIyv3SrdEliQSrTmPRmv95MU+fE+g/HnncA+9CAbcRLUDn0bs9rD6vaceHRiwm8iUTfJP AOHV2NiNayU5zyrMCcXPFn7zBDswOdGIR4VNT5iv14zxvyIOCyTcqxg3/2jdxSBjD7dEPd tpQaphUx5WG7J5qY9g1pHpsRuGvcq2E/fHaMbJpTsPsnACACb5AsSvThZMap4w== 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=1715962339; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=91hwtCL1WGOq3wN3/o14a5zigfpuV3ZxN6PCsFPt9Bs=; b=nXvetovcdAEi//smCkyiTzgvin2axPc2W8vgOLXK43jsIUlobkDBrM4Oogt0/3z/Gu+hwB Hg4M21TqtKTwXEGpOj7H8RawUl3X4FcrbRcc32z3Y5L/PcZc36W+9vVcAtFI7NAAQm0ioX UD6T3NONmX0nMai57rp6b2OI9Vf5twu2l/if3bIg5TxyiraFZv5CXJ4SalVcGqzRDEcv35 kBJ75e6Pq5TsehDd3L5Q9DmnyFWDqfqvuBuoaGTcEdhPsjxrGs8chMxKaQbNQ0EB+VcUGI a8Z7DR1csGNtBZjrg4qu1g9y7syfG9rlrmauASk1zT5ECFojFGDxCRxbOi/F7A== Received: from [IPV6:2601:644:937f:4c50:b5f7:9ebf:56fb:a04d] (unknown [IPv6:2601:644:937f:4c50:b5f7:9ebf:56fb:a04d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4VgsRl13JtzHVv; Fri, 17 May 2024 16:12:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <55ef7d2e-e01b-42a2-acc9-b7351b1aa1f2@FreeBSD.org> Date: Fri, 17 May 2024 09:12:17 -0700 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 16d8dfde0c0f - main - aarch64: disable LIB32 with gcc Content-Language: en-US To: Brooks Davis , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202405171601.44HG1RH4047215@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <202405171601.44HG1RH4047215@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 5/17/24 9:01 AM, Brooks Davis wrote: > The branch main has been updated by brooks: > > URL: https://cgit.FreeBSD.org/src/commit/?id=16d8dfde0c0fb2eb95f2dd8c350ae652fa2c68fa > > commit 16d8dfde0c0fb2eb95f2dd8c350ae652fa2c68fa > Author: Brooks Davis > AuthorDate: 2024-05-17 15:47:06 +0000 > Commit: Brooks Davis > CommitDate: 2024-05-17 16:01:18 +0000 > > aarch64: disable LIB32 with gcc > > gcc doesn't have -m32 support on aarch64 so mark LIB32 broken there. > > We have to check both COMPILER_TYPE and X_COMPILER_TYPE becuase > X_COMPILER_TYPE is only conditionally set and COMPILER_TYPE is the host > compiler in Makefile.inc1. > > Reviewed by: emaste > Differential Revision: https://reviews.freebsd.org/D45089 > --- > share/mk/src.opts.mk | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk > index 00405e3f934f..501df88cd776 100644 > --- a/share/mk/src.opts.mk > +++ b/share/mk/src.opts.mk > @@ -303,7 +303,7 @@ __DEFAULT_YES_OPTIONS+=LLDB > __DEFAULT_NO_OPTIONS+=LLDB > .endif > # LIB32 is not supported on all 64-bit architectures. > -.if (${__T} == "amd64" || ${__T:Maarch64*} != "" || ${__T} == "powerpc64") > +.if (${__T:Maarch64*} != "" && ((defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} != "gcc") || (!defined(X_COMPILER_TYPE) && ${COMPILER_TYPE} != "gcc"))) || ${__T} == "amd64" || ${__T} == "powerpc64" > __DEFAULT_YES_OPTIONS+=LIB32 > .else > BROKEN_OPTIONS+=LIB32 I'd rather fix the compiler port? aarch64 still doesn't build world at all (though might build some more after Andrew's commits today). -- John Baldwin From nobody Fri May 17 16:12:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgsSK4Vj8z5LPVW; Fri, 17 May 2024 16:12: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 4VgsSK3rBwz4QGD; Fri, 17 May 2024 16:12:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715962369; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0cPWXgiVod6XhUE+y2NL4gj3Wo12+JjU4IOxb0FGiZ8=; b=y2qChA+zKa9OEzj+FMg0sHz2YrqzbVLBgoi0+bBbGY3fKLfHrZkNR0DByi23GwwgQjlMZn UBtNZ+JWC4FTpbCe3J8F+QQHpxNEzBVkUusxv3/ks4q8S9PXIXt3/JxeAsdvCX3mcu0tkR Cq0OlIhgY4oBK89qTgAkjdY26n9r48/ksWiSRhCWtQmpz08fY43I40IpB491kWV9Ehgl4g l/6/Vd/zXHjOYrMmXWw2h6ndjvyb/xo0MLqXevXDjAT07kjASU+L8j/SDhOvaLwJWOdWVL zxho/vK+RErr4xljKe2a4MZFpLNM2FbQJy11J1zuYI5NjRKJKR1rzQ/lylZ7mw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715962369; a=rsa-sha256; cv=none; b=FyZGzHs2gyk0/fEJBeHXlZhb/vouGBACDi9WzJ68lv4pSell0eXnl3jOhikhYn+47DpJr0 DTHw62bxCJn5V32ewBhoLq2IgJenSORSlt1bZw3Kv835DO0rd/nGKkMajakXD2Cf/yDWO4 uymWu/OHAw7jejHwFkNDR2FxcG20c6YcOVkwpXVra48EVPIkrcJIxfl8thzuDfhJqiSIjX 161OAxFT5bgkap198p7hmp+XHZPmfQJrYohfJwQHmh83lp6MKw1PBFni9VCqZUsDztSq61 V/wLv6jh22sTiIz0xy3Y2pYsAzNm4PVZXJaJeg7WfzIUyEk0LIWWM3ZK86gN+g== 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=1715962369; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0cPWXgiVod6XhUE+y2NL4gj3Wo12+JjU4IOxb0FGiZ8=; b=qKLHY/7oTLeu3kCs6DUkEvgxqxN7h9+LjbEMXIf+cXh6fnOA2YizI8S6uJ+Gh7wJNOr5Ch T9nOkdFKM5eJc7aDXcfNSQfdiHaP4JMVt/VQVK+/Nsnny+pFSl3Snp86E1Kc1QP0eJTxXg 6ql2NThr+WKMCFuy5MY7zXJEFuEfwqjDnhrfyzUaGQmx764Rfutnf9mIERLK5s8CwVv/oD ERKVOYAi6h2/eV98QvGSARD7kdfVv0w5ryj+bQcA6LVaG4l2yTfvlWTlLrzc/IN3u9E6FK 6fKtqCN/gSjYwooEti2uPAdOGnQxfqKfl+ueISWZpfltcHdAUGDPU2J0oueYxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgsSK3KGlzpxs; Fri, 17 May 2024 16:12: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 44HGCnH0065064; Fri, 17 May 2024 16:12:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HGCneJ065061; Fri, 17 May 2024 16:12:49 GMT (envelope-from git) Date: Fri, 17 May 2024 16:12:49 GMT Message-Id: <202405171612.44HGCneJ065061@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 097bd33dd7a6 - main - uart: DBG2 support to find the debug uart List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 097bd33dd7a687cd3ad7fd4bc7ededa3b9e00e28 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=097bd33dd7a687cd3ad7fd4bc7ededa3b9e00e28 commit 097bd33dd7a687cd3ad7fd4bc7ededa3b9e00e28 Author: Andrew Turner AuthorDate: 2024-03-12 18:15:29 +0000 Commit: Andrew Turner CommitDate: 2024-05-17 16:07:15 +0000 uart: DBG2 support to find the debug uart The Debug Port Table 2 (DBG2) contains information on which devices can be used for debugging purposes. Add support to the uart driver to use the DBG2 table when enabled from loader. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D44359 --- sys/dev/uart/uart_cpu_acpi.c | 83 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/sys/dev/uart/uart_cpu_acpi.c b/sys/dev/uart/uart_cpu_acpi.c index 9c9ffc1e3194..53fe459e64a1 100644 --- a/sys/dev/uart/uart_cpu_acpi.c +++ b/sys/dev/uart/uart_cpu_acpi.c @@ -210,12 +210,95 @@ out: return (error); } +static int +uart_cpu_acpi_dbg2(struct uart_devinfo *di) +{ + vm_paddr_t dbg2_physaddr; + ACPI_TABLE_DBG2 *dbg2; + ACPI_DBG2_DEVICE *dbg2_dev; + ACPI_GENERIC_ADDRESS *base_address; + struct acpi_uart_compat_data *cd; + struct uart_class *class; + int error; + bool found; + + /* Look for the SPCR table. */ + dbg2_physaddr = acpi_find_table(ACPI_SIG_DBG2); + if (dbg2_physaddr == 0) + return (ENXIO); + + dbg2 = acpi_map_table(dbg2_physaddr, ACPI_SIG_DBG2); + if (dbg2 == NULL) { + printf("Unable to map the DBG2 table!\n"); + return (ENXIO); + } + + error = ENXIO; + + dbg2_dev = (ACPI_DBG2_DEVICE *)((vm_offset_t)dbg2 + dbg2->InfoOffset); + found = false; + while ((vm_offset_t)dbg2_dev + dbg2_dev->Length <= + (vm_offset_t)dbg2 + dbg2->Header.Length) { + if (dbg2_dev->PortType != ACPI_DBG2_SERIAL_PORT) + goto next; + + /* XXX: Too restrictive? */ + if (dbg2_dev->RegisterCount != 1) + goto next; + + cd = uart_cpu_acpi_scan(dbg2_dev->PortSubtype); + if (cd == NULL) + goto next; + + class = cd->cd_class; + base_address = (ACPI_GENERIC_ADDRESS *) + ((vm_offset_t)dbg2_dev + dbg2_dev->BaseAddressOffset); + + error = uart_cpu_acpi_init_devinfo(di, class, base_address); + if (error == 0) { + found = true; + break; + } + +next: + dbg2_dev = (ACPI_DBG2_DEVICE *) + ((vm_offset_t)dbg2_dev + dbg2_dev->Length); + } + if (!found) + goto out; + + /* XXX: Find the correct value */ + di->baudrate = 115200; + + /* Apply device tweaks. */ + if ((cd->cd_quirks & UART_F_IGNORE_SPCR_REGSHFT) == + UART_F_IGNORE_SPCR_REGSHFT) { + di->bas.regshft = cd->cd_regshft; + } + + /* Create a bus space handle. */ + error = bus_space_map(di->bas.bst, base_address->Address, + uart_getrange(class), 0, &di->bas.bsh); + +out: + acpi_unmap_table(dbg2); + return (error); +} + int uart_cpu_acpi_setup(int devtype, struct uart_devinfo *di) { + char *cp; + switch(devtype) { case UART_DEV_CONSOLE: return (uart_cpu_acpi_spcr(devtype, di)); + case UART_DEV_DBGPORT: + /* Use the Debug Port Table 2 (DBG2) to find a debug uart */ + cp = kern_getenv("hw.acpi.enable_dbg2"); + if (cp != NULL && strcasecmp(cp, "yes") == 0) + return (uart_cpu_acpi_dbg2(di)); + break; } return (ENXIO); } From nobody Fri May 17 16:12:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgsSL5Fntz5LP8l; Fri, 17 May 2024 16:12: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 4VgsSL4cqmz4Q9f; Fri, 17 May 2024 16:12:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715962370; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uYZqXqmsZJYneHy9RvUhZ0H4fpAIYnH4WwDnbTxOH54=; b=LVDyfN+JAcixUKlmFu2tZ3xbh6wOkO6LkDuwL+pjvP8acxifZm3xt49A/tLTTpZsf/0l70 WksJD+kBJMPCf5IgVckWtJyQTLNuG0eiq0rMngkWG6L+9XMQccAF369JYI4bhXNysstSeK x5RiZGY+Vj4/M0Y9Fcpm7BIQG1ov9i3ZXSlQxwluccJHqgAkK1hizD48OObyuyO+UnJyqs v9ZdtqJkul+clPR7hYP5Fptka1MgX+we2xj+7UrHV7a10QKnYGug66eyPIswBxAQaVDqG2 2ZrLTsqqoQkBJUZEGpjDqm0DLU3YBcYjYzwMTzD4fNHAm39tBUKdtLB5jpc5Yw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715962370; a=rsa-sha256; cv=none; b=Oidzwhf9fsmE9HWnZ+r5BUynXFhU/i3pzKwWkyAQpAXg7SUXF5u74K92LI9rvDXu/f60kJ 0oaP5jRaaGjJMZ1flKmi7E8XgFf6+RzhZkv2TBARyZlnnTPquI4eHb1mAU9e9C+8zTZtz8 CrLGj8ft4mmF5OWffijeOUBjtEZ+BlB90tlL60NrfhAVct4Jhhe7eHBvMKRh7UZjXrFKJ/ Pj3EkCTJtjmRS+PHz3b3mHDGZhpfgP4kZH0Ls3NXmOdlCFSWSLAqlBEiKlfPmOk5590iRm R9ZwcjWefWEVrHh3iF7ALhHhcqZAv2BsW1P1BmoOlpfphmpig3bLgCzkMzV2IA== 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=1715962370; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uYZqXqmsZJYneHy9RvUhZ0H4fpAIYnH4WwDnbTxOH54=; b=AlNuc9eFJqFbuIDIhYFu1I1t67XiFbvp09QS4kGkPMQ5VZmtONGUrf8t8u3ASXVEqhzaMD qqJMB7c3tfHnqIEq6isjPa6j8iZmqqOjIcplavMG6OTxq6sRAJ7xvRBkZXmZ40l5+DIGNN m/gZJLfjhSx2CpCw5JUT3S9T3HZW2/U8LoG3qcftl+SxTBHD+LvnXM+7/y3ALYB2ZT6QWo u2gdNzWF04HDqHUyJFa33CAixey3mj3kxrZxeHoBzk2Q8ZTBvzgq7ANgSWneuGkKM8hVRA wDYGjHoi1KKihMh2eEtDuJOE27p6kmCAw0Lb3Ehj7GezPaA5dJF2q5Ay+CSmAA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgsSL4CVSzpQw; Fri, 17 May 2024 16:12: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 44HGCot3065118; Fri, 17 May 2024 16:12:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HGCoiQ065115; Fri, 17 May 2024 16:12:50 GMT (envelope-from git) Date: Fri, 17 May 2024 16:12:50 GMT Message-Id: <202405171612.44HGCoiQ065115@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: f715e95461c9 - main - arm: Add a missing interrupt to the generic timer List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f715e95461c9264913a65e2dc93c291b7e318d2e Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=f715e95461c9264913a65e2dc93c291b7e318d2e commit f715e95461c9264913a65e2dc93c291b7e318d2e Author: Andrew Turner AuthorDate: 2024-01-11 17:07:59 +0000 Commit: Andrew Turner CommitDate: 2024-05-17 16:07:15 +0000 arm: Add a missing interrupt to the generic timer The ACPI generic timer attachment added 3 interrupts, but missed the hypervisor physical interrupt. As the field is present in all versions of the GTDT ACPI table and isn't an optional interrupts we can add it to the interrupts provided to the driver. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D43974 --- sys/arm/arm/generic_timer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/arm/arm/generic_timer.c b/sys/arm/arm/generic_timer.c index d98c2a022d71..bad0939b6ab9 100644 --- a/sys/arm/arm/generic_timer.c +++ b/sys/arm/arm/generic_timer.c @@ -564,6 +564,8 @@ arm_tmr_acpi_identify(driver_t *driver, device_t parent) gtdt->NonSecureEl1Interrupt); arm_tmr_acpi_add_irq(parent, dev, GT_VIRT, gtdt->VirtualTimerInterrupt); + arm_tmr_acpi_add_irq(parent, dev, GT_HYP_PHYS, + gtdt->NonSecureEl2Interrupt); out: acpi_unmap_table(gtdt); From nobody Fri May 17 16:12:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgsSN1Pbmz5LPF8; Fri, 17 May 2024 16:12: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 4VgsSM6DFmz4Q7N; Fri, 17 May 2024 16:12:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715962371; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NxZtLB4xfo1VgLaQvMKkqYU2oBrdgeeeay+0xxEp97w=; b=gb7Q+TcgPvfbQgzD/XmITwcnfL97tQ1o16FhtdmTKBkzQ8Efs4YUBj2L0hOobgPz3D6HpU Unj894qSz0G+fy7x8XlsuftVrdlvZJw/y2wIK296aF/o35I9glUqijMB0/JfsDOLknQPQg VUxC3YCW4uH0BBIJAaUt0uaLY4rPvP6J3lutwIbr4jG2ch8klqih3RVsfas6vmIfVzzt7U ee4VRCwNLHpTWxc4GIQKQsUvsnWmbOW23ak4vKkysLVDCeIxhYAhYu4hQrT6jU1LzwSbBW J7jlsxAPJzSfvlMJhOYGlf8R3uUvjKvvOz9+085H8X6LANHb2/fd+Jzr3WjdTQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715962371; a=rsa-sha256; cv=none; b=ROfM6L3GvTPQvpokuYq/VZLItr+jdcnHwqD69m0sSWkL0OofGmqxtMWQXKkGJYNDCeLqLW SGDLOhWMZrxhnAeC2hLIctZocFRZKPBxpa52V9/BmR3WsAPBNeRk019zZO0KyRf5mcP74X 31v5NexuPY/MNuB84YNTuZfOY1QwFiOpoinywVUcEbc9jbVtX//tQs257iHnP2RK+22yjf iY70IkAng1mKSZ3FpgGZnnUu+70tAByxV2p9FAOMlCfQgaAD+syUP+BMnUpJ+G17j6jzxG iIS8DumCBMEqLsJgCQMEIMKGFoarQerpr7/bMII3RtySlYIypgBNX1LfKGYG1Q== 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=1715962371; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NxZtLB4xfo1VgLaQvMKkqYU2oBrdgeeeay+0xxEp97w=; b=YEX76/MHT55lgLn31LEWc9i21KHgVFFXNxHN6hLJHYpO51iwnJTCZpZimcjVk7RRNHN0I4 x8TIxJgc+VCq9n3CqjGfkEvlTXsn2ZCwP8Dh8xpCXkP+lU/Z4KdIeX29ATJnLlWHFdOHi3 fNcNv5Tom5KqegMpxHcsMrpK0h0C7U7pNUe+G+sg7S1qguJAEtSzzpCrhtsBR7Q5Yf9IdD dXd6VBFz3pAeVfx3+rTmVOEY9SRsNxPuKkih6qDXw6VO76Wz9ZmMz9hdX4kcprEr/qH1mg FRhp2lV1D1Ap05TNqaotliZEYTbTnZFrHrK6ixPkQQPcJ+FKy0xpcjDC4ymshA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgsSM4krdzpxv; Fri, 17 May 2024 16:12: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 44HGCp32065172; Fri, 17 May 2024 16:12:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HGCpn1065169; Fri, 17 May 2024 16:12:51 GMT (envelope-from git) Date: Fri, 17 May 2024 16:12:51 GMT Message-Id: <202405171612.44HGCpn1065169@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: e72c41772352 - main - arm: Use the correct irq when in the hypervisor List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e72c41772352e1165711900c4f8df6b15b842ba8 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=e72c41772352e1165711900c4f8df6b15b842ba8 commit e72c41772352e1165711900c4f8df6b15b842ba8 Author: Andrew Turner AuthorDate: 2024-01-11 17:13:12 +0000 Commit: Andrew Turner CommitDate: 2024-05-17 16:07:16 +0000 arm: Use the correct irq when in the hypervisor When booting in the hypervisor state we need to use the hypervisor interrupt in the generic timer. In this case the registers we access in the kernel are remapped to the EL2 versions, however this causes an unexpected interrupt to trigger. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D43975 --- sys/arm/arm/generic_timer.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/sys/arm/arm/generic_timer.c b/sys/arm/arm/generic_timer.c index bad0939b6ab9..d3e264527a7f 100644 --- a/sys/arm/arm/generic_timer.c +++ b/sys/arm/arm/generic_timer.c @@ -171,12 +171,14 @@ static struct timecounter arm_tmr_timecount = { #define set_el0(x, val) cp15_## x ##_set(val) #define set_el1(x, val) cp15_## x ##_set(val) #define HAS_PHYS true +#define IN_VHE false #else /* __aarch64__ */ #define get_el0(x) READ_SPECIALREG(x ##_el0) #define get_el1(x) READ_SPECIALREG(x ##_el1) #define set_el0(x, val) WRITE_SPECIALREG(x ##_el0, val) #define set_el1(x, val) WRITE_SPECIALREG(x ##_el1, val) #define HAS_PHYS has_hyp() +#define IN_VHE in_vhe() #endif static int @@ -678,13 +680,22 @@ arm_tmr_attach(device_t dev) #endif #ifdef __aarch64__ - /* - * Use the virtual timer when we can't use the hypervisor. - * A hypervisor guest may change the virtual timer registers while - * executing so any use of the virtual timer interrupt needs to be - * coordinated with the virtual machine manager. - */ - if (!HAS_PHYS) { + if (IN_VHE) { + /* + * The kernel is running at EL2. The EL0 timer registers are + * re-mapped to the EL2 version. Because of this we need to + * use the EL2 interrupt. + */ + sc->physical_sys = true; + first_timer = GT_HYP_PHYS; + last_timer = GT_HYP_PHYS; + } else if (!HAS_PHYS) { + /* + * Use the virtual timer when we can't use the hypervisor. + * A hypervisor guest may change the virtual timer registers + * while executing so any use of the virtual timer interrupt + * needs to be coordinated with the virtual machine manager. + */ sc->physical_sys = false; first_timer = GT_VIRT; last_timer = GT_VIRT; From nobody Fri May 17 16:12:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgsSP1CvJz5LPGs; Fri, 17 May 2024 16:12: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 4VgsSN5tC6z4Q2j; Fri, 17 May 2024 16:12:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715962372; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KhZxDd7z4I12n2UGIktn27DH5vJ2E1e6WiqoFlFwtM4=; b=rqwMYRisKSsey14kalJUgipmdk/yY144cpTH9maB/mmKSFRTM3AB8ZSGqIngYJsOu/25Tm o5+AhlnaugX0Bku6s+Puo4gtFBSyXp3LWBGghz71fpYR7c3pDwh8KNvF9xE02IY0akNkpo nat3kPgc6BEPkJGPSqd6NhmbQ8QEzyG7AFpNW/3chnoxtHGvjdPBOx6aQWBv5C0x4N/PmK XSqCNcqYrY4w3u9RDuw+/SyVOF8xZIENbCfIIWSxxHDtSvNSg+cb7zesmlR54uurj4HmGZ LG7qcdfeFnMqkWy/kU3E3uHkXU+P/4FiJwsd/YHcK0EZa1WKzWdvd6nMboktxg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715962372; a=rsa-sha256; cv=none; b=cKJjzfgPgtZ99nEaDqAQi/Ra2MDknY9dZwTM1lTY12F/xuIjsq4lBCN70aPvlpcNxoZpRG dn/j9H8qAZAiwjA1urb4C96HZZWqePlAdDysIULuCl2y1A3S0fyPXlrCKEZUO0Gh5kpPxy c7WNNvtbkEDZArdfeI1fTm43noHhwAlZOtkMEQj6Y++3+h/EyrmGIbOMJyQb+gnA+EdsV0 rsXLwlKuS/n5gZRX1Jad494/wkJm1QHjM1GKwqxTSf+qlzZcj5Wip+NuTpzmU65AOxmLo8 sFlp0wJ7ZrPexN2pSHV3MLXKb3hzf8KHLB3KjkJ8ZWQjhj/KAW2/SVVeE9tJ0w== 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=1715962372; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KhZxDd7z4I12n2UGIktn27DH5vJ2E1e6WiqoFlFwtM4=; b=RMmkfo2A3qJ2reCC0SR00bVSIDzeBB21VTq6MQcFs5E9QaSFCFzpvObEK4xGmKrDBVGQAu 1R/O96ChYjFqcyyx4lC3L8BW62wv29v7T3/kg5rhGwDe3nzQUL24/QCh6TzZ0iSa2wUwC8 hZu/DjmPw30yXHNZDMZ3wA7akm676v2QViwbHHUgTt/w3uzfQvNFcakPl2zG7hKjG3phN4 iY7TiQQuRguIlPyKCHpeb+rGBgd8nriv9dSpWpPPs8FYK0YNCdbaPiIU6wYqSvK/Rj3AxX ZxJbe+e2OfU3g/ZBo0VNM42BM81eoEVdS5++1c+4E0NLygJBuuzmXu4ldqOV5A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgsSN5PM9zpBx; Fri, 17 May 2024 16:12: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 44HGCq3N065228; Fri, 17 May 2024 16:12:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HGCqND065225; Fri, 17 May 2024 16:12:52 GMT (envelope-from git) Date: Fri, 17 May 2024 16:12:52 GMT Message-Id: <202405171612.44HGCqND065225@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 457fa0f69ce0 - main - arm64: Support break and watch points in VHE List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 457fa0f69ce07f24070261376f1ea724324ec621 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=457fa0f69ce07f24070261376f1ea724324ec621 commit 457fa0f69ce07f24070261376f1ea724324ec621 Author: Andrew Turner AuthorDate: 2024-03-14 18:01:24 +0000 Commit: Andrew Turner CommitDate: 2024-05-17 16:07:16 +0000 arm64: Support break and watch points in VHE When booting the kernel with VHE it will be running at EL2. The current config register values only enable the reaces at EL1 when tracing the kernel. Set the HMC flag to also trap from EL2. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45121 --- sys/arm64/arm64/debug_monitor.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/arm64/arm64/debug_monitor.c b/sys/arm64/arm64/debug_monitor.c index 2e1a956ad75c..d92d3fb37ce4 100644 --- a/sys/arm64/arm64/debug_monitor.c +++ b/sys/arm64/arm64/debug_monitor.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -86,6 +87,7 @@ void dbg_monitor_exit(struct thread *, struct trapframe *); #define DBG_WATCH_CTRL_ACCESS_MASK(x) ((x) & (0x3 << 3)) /* Common for breakpoint and watchpoint */ +#define DBG_WB_CTRL_HMC (0x1 << 13) #define DBG_WB_CTRL_EL1 (0x1 << 1) #define DBG_WB_CTRL_EL0 (0x2 << 1) #define DBG_WB_CTRL_ELX_MASK(x) ((x) & (0x3 << 1)) @@ -457,6 +459,8 @@ dbg_setup_breakpoint(struct debug_monitor_state *monitor, vm_offset_t addr) if ((monitor->dbg_flags & DBGMON_KERNEL) == 0) bcr_priv = DBG_WB_CTRL_EL0; + else if (in_vhe()) + bcr_priv = DBG_WB_CTRL_EL1 | DBG_WB_CTRL_HMC; else bcr_priv = DBG_WB_CTRL_EL1; @@ -530,6 +534,8 @@ dbg_setup_watchpoint(struct debug_monitor_state *monitor, vm_offset_t addr, if ((monitor->dbg_flags & DBGMON_KERNEL) == 0) wcr_priv = DBG_WB_CTRL_EL0; + else if (in_vhe()) + wcr_priv = DBG_WB_CTRL_EL1 | DBG_WB_CTRL_HMC; else wcr_priv = DBG_WB_CTRL_EL1; From nobody Fri May 17 16:14:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgsVc0PFRz5LPgM; Fri, 17 May 2024 16:14:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgsVb6vdjz4RQG; Fri, 17 May 2024 16:14:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715962488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H8H7+of1KMkBG359D6AZt0OJ4YuIwMDR8u32qzO1K4I=; b=vJAM1qZNO/q2S3HW1XkulnwDPAzi+rU2HG4VjcAkMqqj/h/zURC2s4epw8UikZ/7ccUkjD 2yE6M1Z0tXkhD1pSNtSfkNyEU4iVU117/4LQrqECNlEa22RtyRVNj+y0pV6sQ4uhku+r0U tCZGqGyiY3SUQ7cUSZwFuMFHJN4IqW5rBz8K28Hun6cl33a3hZYrDMnlLYKNs+WvVgjmvW ad/HrOURn+p7G2a2mLaIHDIAhjBodH4aAP+QqHrv5EVgd0vroRDfNPa6ctkRAS3Uc+JnUY xnHYgJW0gECrcG1K4RToSwT8zzvM6mFkP6azQz0Mg81zxw99v/hJVNK7EYSPOA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715962488; a=rsa-sha256; cv=none; b=V+J9nFePZZi2XzTuZQJ+JJ0JTjenbBFU4JBYMxK1Dap43kUHiXirskhyxnNjBAzbAJNgcv Bz00oGjCPtjvKS2Rt6vPEQ98VovOwfxrtLxGc0+0r6/kcvqDXxOVZ8hzUXhm9lYu515W5s r5BqdZKu/DAk0H56dR9OrrBzxP24JyBJuy23uaY4sgFELBe+r0jlDS/upoatjTNCZztJVJ lTSu9fZ/AUjhYGJgEtq2s3TnbXozEuLfotWIQSThliCZdw60ydrtGnSvBUNqrtdNDwWFBB /eNNdlL6ncB/wUehRY9xy5zNI0/+reMb6StgXTndCCzlz2tnSk8WJ51VzqRvFg== 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=1715962488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H8H7+of1KMkBG359D6AZt0OJ4YuIwMDR8u32qzO1K4I=; b=GA7mCwH7uzyaM7tT2+An35PNf5iNUbJfaa8NtpIY3j74Ng7BWxLfQeqRerlNCdpMKZB/J6 zRFQRq117T3e0jK2VOci/GWQh/9WXNYSP9dO0zdvZGwQiJSzXoqKWngVemlS7crzCQl1d3 KisewagMV+jxYLP+UAVAvrnjQ3NKXUSZGa048QQwvo6VOGFXwtIlvlUEQ5sSm5tYIRnUek ngK9NGqz077aO8V75AxzkziDnjw8gIYkFMojPJ4D1F6A1cKtXbIku3d32PZ4JEZeeIVPaU TjCLpOMqBQMYy0plhVRZlEeTRbkVN/2qR7jGKVH9ZG1RlC5/GnF2+JzQzyeEHg== Received: from [IPV6:2601:644:937f:4c50:b5f7:9ebf:56fb:a04d] (unknown [IPv6:2601:644:937f:4c50:b5f7:9ebf:56fb:a04d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4VgsVb3FqRzHdt; Fri, 17 May 2024 16:14:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <456e4eef-e194-4e32-b3a7-c93bb941b82b@FreeBSD.org> Date: Fri, 17 May 2024 09:14:46 -0700 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 4c0dfd5959bd - main - arm: fail early on gcc builds Content-Language: en-US To: Brooks Davis , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202405171601.44HG1Sef047261@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <202405171601.44HG1Sef047261@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 5/17/24 9:01 AM, Brooks Davis wrote: > The branch main has been updated by brooks: > > URL: https://cgit.FreeBSD.org/src/commit/?id=4c0dfd5959bd499754e3fc9a7ce37c1d5ece31f7 > > commit 4c0dfd5959bd499754e3fc9a7ce37c1d5ece31f7 > Author: Brooks Davis > AuthorDate: 2024-05-17 15:47:22 +0000 > Commit: Brooks Davis > CommitDate: 2024-05-17 16:01:19 +0000 > > arm: fail early on gcc builds > > Since at least 2022 (see https://reviews.freebsd.org/D36754), it has > not been possible to build armv6/armv7 with gcc due to atomics macros > gcc doesn't like. Prevent developers doing due diligance from wasting > time and CPU cycles on this combination as it just fails to build in > libc. > > Reviewed by: imp, andrew > Differential Revision: https://reviews.freebsd.org/D45193 As I said in the review, this is a weird change. Only amd64 and i386 build with GCC. You should blacklist all the others if you are going to blacklist any, not just 32-bit arm. I hadn't blacklisted any to make it possible for other developers to work on it. Also, the review in question is probably not the right fix, it's probably that we need to pass different CFLAGS to GCC for 32-bit arm. -- John Baldwin From nobody Fri May 17 16:16:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgsY15QRRz5LPdH; Fri, 17 May 2024 16:16:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgsY14tbxz4Rqf; Fri, 17 May 2024 16:16:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715962613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HKfO1VTao9ABCMlo0uLfqWhaQJmSeqbsDzIulgQ43W8=; b=spaxghVt2oLx7lpowDiluuXYis0yU/yTkxMhryhB0mlLr9Q/00LwRsrGBdhTY/xQYHoa/I R2ML25gWUPqcV7hQr0twmxbgtaLnhepFaZDo60+QJRicgXrNFfwz4cfY9SZDg48peoXjqC VGORN3yrlhynf0lhddKAWuyWO30NqUtxRirfUP21ctL1dZcvJwVQNFPU2D46cfX9aZzD6q gUoCbE7zRwxfUAOsr27qjZvjwX6XiAE5qd7i7J/4wfUQTAkaVllW1W0a+WmkXnCofbrQOl AVLo3xbavdcaij7g4ZdCtO7BJykSDZTU0DfO1LNkg4sLoa5+qzCpKvUdMxULlw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715962613; a=rsa-sha256; cv=none; b=gA3KQk5phHueIjhMXSVFlXXVgNMivmcMOIVU43KoOy/hUQIoys6HNHSevo4fKpvxFVSE7V p0jgO5v28qX4VFnbIgLwyOJUya1VDuP/QYkqE/Xnm7tbSbMUO2QZ1llNA+PLsEqclUfVin 4LOmxj13MajP0MSFsN+0c2y33R3HFpwvZYgrfa+OQZQIDnElwEvZmaP7035nC1r5xbgFNz 5/nBlCxuA1oGtag8lQQLgjtbR0a+RzEvDxTxSnGrZlO4nI9wUNqdzuvRWQpIB3nFeJFafC E1SoeTQGpuxvMmHTW6FpSDt3C7n2GWPHWGatqjcd1+c/UY6GptQ/qZuP/Gn5Yw== 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=1715962613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HKfO1VTao9ABCMlo0uLfqWhaQJmSeqbsDzIulgQ43W8=; b=R6SLFh/ruWWOj9J1FJuZfKHa4EM8/zpraFEfP0r3Bc3F8QtW9lMjNrtVRNWENbmM1hYPtQ 9rw0Ti5pwK/v9vhXB/mbJgXPKWlLOT9f6A9cdRlicxOSl1tQhs8e9oGsqVYzb9f3pR2RXk b/23mWhYidvLtVEKRVrBFHci+Rd02NSQQ6R1qOo/f3FsG+BV+eDe1AnqKzDnbjmPkLSB8N mjp+J5NCJx0PkfsjDaUBuU0zNBiPJ00AfCqgrtTSj6TSkyQMeuWbUnNLUqQq6H40avGSj1 E+jcZ6QZss2isXWjiLJ7qC3Bjy69i19aPg/cakpvEm3Uafrav3HH1ImyywQB5Q== Received: from [IPV6:2601:644:937f:4c50:c0c0:cf11:cc26:3c0e] (unknown [IPv6:2601:644:937f:4c50:c0c0:cf11:cc26:3c0e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4VgsY11DwwzGKn; Fri, 17 May 2024 16:16:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <1fd6acc5-290c-447c-b35c-89b002d71526@FreeBSD.org> Date: Fri, 17 May 2024 09:16:52 -0700 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: d316de24faa7 - main - zfs: Avoid a gcc -Wint-to-pointer-cast warning Content-Language: en-US To: Brooks Davis , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202405171601.44HG1TTZ047312@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <202405171601.44HG1TTZ047312@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 5/17/24 9:01 AM, Brooks Davis wrote: > The branch main has been updated by brooks: > > URL: https://cgit.FreeBSD.org/src/commit/?id=d316de24faa7453118a90fb0e9839e8026e36a4e > > commit d316de24faa7453118a90fb0e9839e8026e36a4e > Author: Brooks Davis > AuthorDate: 2024-05-17 15:59:06 +0000 > Commit: Brooks Davis > CommitDate: 2024-05-17 16:01:19 +0000 > > zfs: Avoid a gcc -Wint-to-pointer-cast warning > > On 32-bit platforms long long is generally 64-bits. Sufficiently modern > versions of gcc (13 in my testing) complains when casting a pointer to > an integer of a different width so cast to uintptr_t first to avoid the > warning. > > Fix i386 gcc builds while we wait for this to be merged to OpenZFS. > > Sponsored by: DARPA, AFRL > Pull Request: https://github.com/openzfs/zfs/pull/16203 > --- > sys/contrib/openzfs/module/zfs/spa.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sys/contrib/openzfs/module/zfs/spa.c b/sys/contrib/openzfs/module/zfs/spa.c > index ec2b674fb7ee..c3800e018c73 100644 > --- a/sys/contrib/openzfs/module/zfs/spa.c > +++ b/sys/contrib/openzfs/module/zfs/spa.c > @@ -6832,7 +6832,7 @@ spa_tryimport(nvlist_t *tryconfig) > */ > char *name = kmem_alloc(MAXPATHLEN, KM_SLEEP); > (void) snprintf(name, MAXPATHLEN, "%s-%llx-%s", > - TRYIMPORT_NAME, (u_longlong_t)curthread, poolname); > + TRYIMPORT_NAME, (u_longlong_t)(uintptr_t)curthread, poolname); > > mutex_enter(&spa_namespace_lock); > spa = spa_add(name, tryconfig, NULL); Huh, this shouldn't be broken anymore. The kernel module has an unconditional CFLAGS to disable -Wint-to-pointer-cast, and I just added it to the userspace build back in 766c4ad385ccf96f8cf10129363a6bfa58b3e92f. OTOH, it might be nice to re-enable the warning if it is clean for both kernel and userland. -- John Baldwin From nobody Fri May 17 16:18:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgsZl1Wnlz5LPXM for ; Fri, 17 May 2024 16:18:23 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgsZk6NXyz4S3F for ; Fri, 17 May 2024 16:18:22 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-420180b58c5so2412295e9.3 for ; Fri, 17 May 2024 09:18:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715962701; x=1716567501; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PYJ+H0VPNzmFVKkm7Hz1w5TqiXFv73T02ZcTGj8D/yI=; b=n9J1Mr7tzyrO3gxB8yH0VkDt/3mWhF2TaCwNvAuL6bMGCeKglf+/VHWk063789Tm71 ZmgBHwW1z6EuYOrC7ghqXUrf5dy/dcaUfeaEQ0ma8Rm4vg4+vy4QmhemwE2+Xg1CrNA5 mrDsjkJP0nX7xVWCuM9wjLKhbgMqvT5dDaSlH2uNE7N3Xb77h3oazkm0J3tky6USlk8M +HC/NEOTKT3VC3fRxtC9mCxItTeqkOSQm+35hrcn6GorbrmPVc/iKWtH2GraEPF5EleX +mVtAOxW9SmYXT3tRGQ6zcWF/pfjmGj9mt0aTOHmW5J3ZacyoV1fNCU0GigepqgEsKX8 86WQ== X-Forwarded-Encrypted: i=1; AJvYcCUGecxmHN0jK2GvOabUgkg2Pjk0IaaJ2WRNLmYwyZWMiYM690CmpmEqvxxNLOwcWzrbjipHGb62eK8mMXq76XLFklJgcVElccErAOqbIO0m X-Gm-Message-State: AOJu0YwrCCceKA5E0NFNOg7BhAWcp33rrLM8c023chWAEzwiikoP5iKO +2jgVUUpGofTedvDJ8yH35rQ2f8Y/nYRFC79ETWPqCV68m2VIUYon/Z2vsPDBEs= X-Google-Smtp-Source: AGHT+IEeCoMqQ4MJPxQMftelaExo9hCQd9ycamhuMKudv3OITdiC+FLamJpadli5jwmtVlz1jg7H8w== X-Received: by 2002:a05:600c:4f92:b0:420:177f:c2a6 with SMTP id 5b1f17b1804b1-420177fc636mr116454325e9.10.1715962700614; Fri, 17 May 2024 09:18:20 -0700 (PDT) Received: from smtpclient.apple ([131.111.5.246]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-420113d808bsm223867615e9.12.2024.05.17.09.18.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 May 2024 09:18:20 -0700 (PDT) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.171.1.1\)) Subject: Re: git: 097bd33dd7a6 - main - uart: DBG2 support to find the debug uart From: Jessica Clarke In-Reply-To: <202405171612.44HGCneJ065061@gitrepo.freebsd.org> Date: Fri, 17 May 2024 17:18:09 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <6E417087-31C3-4B5F-938A-88753F4F9043@freebsd.org> References: <202405171612.44HGCneJ065061@gitrepo.freebsd.org> To: Andrew Turner X-Mailer: Apple Mail (2.3774.500.171.1.1) X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Queue-Id: 4VgsZk6NXyz4S3F On 17 May 2024, at 17:12, Andrew Turner wrote: >=20 > The branch main has been updated by andrew: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D097bd33dd7a687cd3ad7fd4bc7ededa3= b9e00e28 >=20 > commit 097bd33dd7a687cd3ad7fd4bc7ededa3b9e00e28 > Author: Andrew Turner > AuthorDate: 2024-03-12 18:15:29 +0000 > Commit: Andrew Turner > CommitDate: 2024-05-17 16:07:15 +0000 >=20 > uart: DBG2 support to find the debug uart >=20 > The Debug Port Table 2 (DBG2) contains information on which devices > can be used for debugging purposes. >=20 > Add support to the uart driver to use the DBG2 table when enabled = from > loader. >=20 > Sponsored by: Arm Ltd > Differential Revision: https://reviews.freebsd.org/D44359 > --- > sys/dev/uart/uart_cpu_acpi.c | 83 = ++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 83 insertions(+) >=20 > diff --git a/sys/dev/uart/uart_cpu_acpi.c = b/sys/dev/uart/uart_cpu_acpi.c > index 9c9ffc1e3194..53fe459e64a1 100644 > --- a/sys/dev/uart/uart_cpu_acpi.c > +++ b/sys/dev/uart/uart_cpu_acpi.c > @@ -210,12 +210,95 @@ out: > return (error); > } >=20 > +static int > +uart_cpu_acpi_dbg2(struct uart_devinfo *di) > +{ > + vm_paddr_t dbg2_physaddr; > + ACPI_TABLE_DBG2 *dbg2; > + ACPI_DBG2_DEVICE *dbg2_dev; > + ACPI_GENERIC_ADDRESS *base_address; > + struct acpi_uart_compat_data *cd; > + struct uart_class *class; > + int error; > + bool found; > + > + /* Look for the SPCR table. */ > + dbg2_physaddr =3D acpi_find_table(ACPI_SIG_DBG2); > + if (dbg2_physaddr =3D=3D 0) > + return (ENXIO); > + > + dbg2 =3D acpi_map_table(dbg2_physaddr, ACPI_SIG_DBG2); > + if (dbg2 =3D=3D NULL) { > + printf("Unable to map the DBG2 table!\n"); > + return (ENXIO); > + } > + > + error =3D ENXIO; > + > + dbg2_dev =3D (ACPI_DBG2_DEVICE *)((vm_offset_t)dbg2 + = dbg2->InfoOffset); > + found =3D false; > + while ((vm_offset_t)dbg2_dev + dbg2_dev->Length <=3D Can this please use uintptr_t or char * for pointer arithmetic rather than the not-a-pointer vm_offset_t throughout? Jess > + (vm_offset_t)dbg2 + dbg2->Header.Length) { > + if (dbg2_dev->PortType !=3D ACPI_DBG2_SERIAL_PORT) > + goto next; > + > + /* XXX: Too restrictive? */ > + if (dbg2_dev->RegisterCount !=3D 1) > + goto next; > + > + cd =3D uart_cpu_acpi_scan(dbg2_dev->PortSubtype); > + if (cd =3D=3D NULL) > + goto next; > + > + class =3D cd->cd_class; > + base_address =3D (ACPI_GENERIC_ADDRESS *) > + ((vm_offset_t)dbg2_dev + dbg2_dev->BaseAddressOffset); > + > + error =3D uart_cpu_acpi_init_devinfo(di, class, base_address); > + if (error =3D=3D 0) { > + found =3D true; > + break; > + } > + > +next: > + dbg2_dev =3D (ACPI_DBG2_DEVICE *) > + ((vm_offset_t)dbg2_dev + dbg2_dev->Length); > + } > + if (!found) > + goto out; > + > + /* XXX: Find the correct value */ > + di->baudrate =3D 115200; > + > + /* Apply device tweaks. */ > + if ((cd->cd_quirks & UART_F_IGNORE_SPCR_REGSHFT) =3D=3D > + UART_F_IGNORE_SPCR_REGSHFT) { > + di->bas.regshft =3D cd->cd_regshft; > + } > + > + /* Create a bus space handle. */ > + error =3D bus_space_map(di->bas.bst, base_address->Address, > + uart_getrange(class), 0, &di->bas.bsh); > + > +out: > + acpi_unmap_table(dbg2); > + return (error); > +} > + > int > uart_cpu_acpi_setup(int devtype, struct uart_devinfo *di) > { > + char *cp; > + > switch(devtype) { > case UART_DEV_CONSOLE: > return (uart_cpu_acpi_spcr(devtype, di)); > + case UART_DEV_DBGPORT: > + /* Use the Debug Port Table 2 (DBG2) to find a debug uart */ > + cp =3D kern_getenv("hw.acpi.enable_dbg2"); > + if (cp !=3D NULL && strcasecmp(cp, "yes") =3D=3D 0) > + return (uart_cpu_acpi_dbg2(di)); > + break; > } > return (ENXIO); > } From nobody Fri May 17 16:22:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgsg34ndkz5LPsb; Fri, 17 May 2024 16:22: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 4Vgsg34Cbtz4SqD; Fri, 17 May 2024 16:22:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715962927; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k3f1CT138rK9Oc2DleBBp6fcKATrW2Cbe8P3Pw8Xek8=; b=T6hQqW8mxmHMLWE6n0fM2HhMagg2wEwPmhv19lu03toMk3p9EP7KO63dx75FNAZZYMIkpL EBPZAL1KcFCFGxfW97pyuWl6DzsAD666ke6C1GEnicC4BKYG5qMZZ6TigodeU13756m9aY +KP1iUm6LZ54Z2q9q/jSGn3azyc4TMOP+mf7KF8Q4nNzqmiqFype8mKQwZVBQupbNRvVG+ s3O/tNtH3zsmE7mxuYsBk9imHnwdXC2AHLXI31KoNpNPUa+/FfoWirGeoi3sNpCQK7c78+ axIMmz+94YnLizVortjlf40nBs2l4Nv9Y5eE1/gj0cp80RtHzO2kDm6QjofKTg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715962927; a=rsa-sha256; cv=none; b=wQMYQzqBrv3SXVHQmjdmyP2ytnVVEWxOeaeb7+B81BUDWvgtmJQ66W6tAXtQOXWIwUQvuj A+kmSvcGxRKobGJ214UH0zZZ2N1+TOI3SWfEweRUZpGe5pjniMdwhT79UxznxEpylVjhZX pEyfxSDndv+lknFSXkXEWrjLxB4AGLDPjZO6/WrupIu1hiBX+5ZY2h1zGpS5+hVo9V9f2y /rqP7ITLHuYActJl22gGK7OuDnFjK6e3rOuVo+yZKnPTaK83nZpxi+7FCrSxV0TfAjTixb hXgNwxkTcTPOnXIz+ZeNVwjlUQWS20zKCAHy0lf6j/9vmb//cZPdwA/HEZTMLw== 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=1715962927; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k3f1CT138rK9Oc2DleBBp6fcKATrW2Cbe8P3Pw8Xek8=; b=oXAvTvwK5qjCdwwAMkPNv/XmQEVClf3eibAUoAPfYqi/kADWUWOkOVOHjA3WYK/PNChSj/ jc3EKA/GgvvVbaeFLhIf6GnKewSLuQOk8q9oJkIZ908YIk5D83KAA2WrsJlQyJe7ohp/kG by7JAgytGbjQSuSkqMEGX6rxraFVShYGja+ykb5/AZyZNM0rfngzWr0OqdZNt+2eyTOeWm eXAiKpbWy0P308t4Vtre318GF7HZx7Pxkpbs0sXpEuzUcSZIUlITcoevFk6msQdfoer+Ko ZATeVeIU3GIojXsK7v6FEQ3jsQxFSZv+XoRDMT022Qy2HIOtAkM6BiaKb5k1IA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vgsg33mXxzpyW; Fri, 17 May 2024 16:22: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 44HGM73S079632; Fri, 17 May 2024 16:22:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HGM7TV079629; Fri, 17 May 2024 16:22:07 GMT (envelope-from git) Date: Fri, 17 May 2024 16:22:07 GMT Message-Id: <202405171622.44HGM7TV079629@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marko Zec Subject: git: 4ab122e8ef12 - main - fib_dxr: check if cached fib_data matches the new request in dxr_init() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4ab122e8ef127d36d95f874e85600c36c87c8c22 Auto-Submitted: auto-generated The branch main has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=4ab122e8ef127d36d95f874e85600c36c87c8c22 commit 4ab122e8ef127d36d95f874e85600c36c87c8c22 Author: Marko Zec AuthorDate: 2024-05-17 15:55:43 +0000 Commit: Marko Zec CommitDate: 2024-05-17 16:21:54 +0000 fib_dxr: check if cached fib_data matches the new request in dxr_init() When calling dxr_init(), the FIB_ALGO infrastructure may provide a pointer to a previous dxr instance, which permits reuse of auxiliary dxr structures, i.e. incremental lookup structure updates. For dxr this is a crucial feature provided by FIB_ALGO, since dxr incremental updates are typically several orders of magnitude faster than full lookup table rebuilds. However, the auxiliary dxr structure caches a pointer to struct fib_data and relies upon it for performing incremental updates. Apparently, incremental rebuild requests from FIB_ALGO, i.e. a calls to dxr_init() with a pointer old_data set, may (under not yet fully understood circumstances) be invoked within a different fib_data context than the one cached in the previous version of dxr auxiliary structures. In such (rare) events, we ignore the offered old dxr context, and proceed with a full lookup structure rebuild instead of attempting an incremental one using a fib_data context which may or may not no longer be valid, and thus lead to a system crash. PR: 278422 MFC after: 1 week --- sys/netinet/in_fib_dxr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index 82245ecf6e66..539d7fe6c96f 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -1139,7 +1139,8 @@ dxr_init(uint32_t fibnum, struct fib_data *fd, void *old_data, void **data) } /* Check whether we may reuse the old auxiliary structures */ - if (old_dxr != NULL && old_dxr->aux != NULL) { + if (old_dxr != NULL && old_dxr->aux != NULL && + old_dxr->aux->fd == fd) { da = old_dxr->aux; atomic_add_int(&da->refcnt, 1); } @@ -1275,7 +1276,7 @@ dxr_change_rib_batch(struct rib_head *rnh, struct fib_change_queue *q, da = dxr->aux; MPASS(da != NULL); - MPASS(da->fd != NULL); + MPASS(da->fd == dxr->fd); MPASS(da->refcnt > 0); FIB_PRINTF(LOG_INFO, da->fd, "processing %d update(s)", q->count); From nobody Fri May 17 16:26:58 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgsmg1RwRz5LQVJ; Fri, 17 May 2024 16:26: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 4Vgsmg106bz4T9l; Fri, 17 May 2024 16: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=1715963219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tzw/XtfgeqC+r8WRtEXb4UdF7CFcG7+q9C+NABlrQ+A=; b=vQHNS6lW7KzVbY1/HiQjved0PWlWT0a8NYNkdWbQcLxWlcWZf4vMjqCE8eufJJ86GdEt7x Rl9u29ZLTXDkIeCiE1OVn7YncdMgsudcazD6UCvfCmbj6I1xkTeRj2B4ZZZeWmSyke6hkq pDEtdD5TokjIxVicfFfEeNWHqycreFtCc+jPI3RRv2vT7xe1QMYb9tNJqb7fa6cV3U6D0n tNqOFdS8b39EnEsQvfKrO+o70idgpN13ol5shx6Mip8ZOsE6qh5kpTU/lYNErfTfe58fWy U86rjB/fVXLCUgZpHTqJ+AoZudLQaJfVE2+zfGiADuRLo7vSCd5L5fPX9Bph4w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715963219; a=rsa-sha256; cv=none; b=x8HGzXsKh4+d8HBPRh65KqT9psPlJUf/bZ+8JBYE6SalH9UHYxXmUfqGfCBoOk7ET7qXUt pjH2YNWDc2RMijENTiEKyRXHyVtiuCbOA0LOQyKqvrRbWfKVH4eCV/dgn4vlE2jfwyxS0e 5qxuqszjsFSqDaKKkj8FFfinUMI+xH3SlWIAuyC5uIeLRltE520dAtoZZeaSAdGcpoUIXu r/Nm3knEHu7RVcXeZkitO7x9gYAJJx3azFOMg3jwQKcxxlkmdRJs5J9uzAdEgBj/iqBhlD UXk8HXYS4KvGlhpG6NtIYrhRyKnUuIAdK4rZUOhbWnSRq/nf6P3edpZti68y1Q== 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=1715963219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tzw/XtfgeqC+r8WRtEXb4UdF7CFcG7+q9C+NABlrQ+A=; b=UZEYPlh1+6alsa3+Wb0+qzEyMtIOZK2QEndIjjV/Ry1sgiw9/wX22YZRQv5eaWPNZS3pM1 1mKe76vpEnFaZ9iwIoYrD8FbbIuqYyPB2gtIBdmUIqfaIvjyMgdH0BA2lgDu9lfE4hYG1e dk2zV3neqbwaqWdu6oEo6IPIwrYub8P7HNDnYD8zmpuGs+46WieILfHboIkw6bSUyAMAs1 xaSltD4zBLmuhu9K5Ivy0xtqRoYiFX2JrBHv2lCGwG1LIX3u8/XuPrR75ZsEERR5JZJZEX DINf8s32zE3iN5ydBaRIn76CFWSmbhyy1iD0nWnZyU9L49sb2Z2yaZvl3Ng6Ng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vgsmg0b9kzqJD; Fri, 17 May 2024 16: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 44HGQwEO082978; Fri, 17 May 2024 16:26:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HGQwrd082975; Fri, 17 May 2024 16:26:58 GMT (envelope-from git) Date: Fri, 17 May 2024 16:26:58 GMT Message-Id: <202405171626.44HGQwrd082975@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: e9806d21282d - main - bhyve: avoid resource leak in error path List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e9806d21282d3d5486b99b5c7062b490b00d8323 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e9806d21282d3d5486b99b5c7062b490b00d8323 commit e9806d21282d3d5486b99b5c7062b490b00d8323 Author: Pierre Pronchery AuthorDate: 2024-05-16 16:55:54 +0000 Commit: Ed Maste CommitDate: 2024-05-17 16:26:27 +0000 bhyve: avoid resource leak in error path In e820_finalize(), the e820_fwcfg_item variable, containing the etc/e820 file (for the e820 table from the BIOS) is not free()'d when it could not be added to the QEMU firmware configuration device (fw_cfg). Reported by: Coverity Scan CID: 1522761 Reviewed by: corvink, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45223 --- usr.sbin/bhyve/amd64/e820.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.sbin/bhyve/amd64/e820.c b/usr.sbin/bhyve/amd64/e820.c index 456ce0330b50..9d95ec8ce688 100644 --- a/usr.sbin/bhyve/amd64/e820.c +++ b/usr.sbin/bhyve/amd64/e820.c @@ -483,6 +483,8 @@ e820_finalize(void) e820_fwcfg_item->size, e820_fwcfg_item->data); if (error != 0) { warnx("could not add qemu fwcfg etc/e820"); + free(e820_fwcfg_item->data); + free(e820_fwcfg_item); return (error); } free(e820_fwcfg_item); From nobody Fri May 17 16:27:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgsn0185gz5LQGv; Fri, 17 May 2024 16:27:16 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vgsn00fz0z4TQB; Fri, 17 May 2024 16:27:16 +0000 (UTC) (envelope-from brooks@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715963236; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=lX0FwhoS+iLp620VS+3uFjH8463ERETW3Sw51pZRL3Y=; b=MYDBXFW1wZD+AjKueEwXOZbi7b6DtvY68pAbrejDN3x+Sjb87uQom6iX566AdHJTnplAhy BWXOTxBWLgye5BGjt2KVZmp//mUJ+lfVQPXjk70xWV58qa/swkHWxrlhe0bb0WAr7Y5eQS p5yb0rG1KcgB1g6NluAn3b4LEszq2TgL8BW4o0nCZbw6DMA0DkGyks4bFe0aRIiVGf6yRM YlxSnR5ld6Uf5w+eYSA6Ja8JPTrqjSSfBLFdiI1FyEBjEDICrDOB4v82a5gdlCRbKN2QP+ 90bNuQZg1rZz3y+B0tvePSbhcpfMzrPQ2B0ijqabMcTtYsJT5YIUt39s9n+tqw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715963236; a=rsa-sha256; cv=none; b=dTgi0D+2M+5E7Ur0UbNOkjv38ruIyNwr1HcS+vB4Cy08RR5S3QM9MG/g4i6BRCMbkY/lF6 WXY7Hs5hsmdnppVJw3kK3MVF3B46/P3+etKHnp5M6sj7Pz5q6RGliJdoN1xinWNFl/Ivk+ EWA0nom45di5YMthYOFindg8dqOg851PewuiMjeouA4B3XxYmLSrEBodi5ORNZRCMt6VPQ Ijo7lufv1qbknKOIt4Ev0UIDC3X8YFR8aoSaTvAmyJDygGbKfXnEuPmgEBgm7eBtTZrvM3 SNMDchKdVl3hPYXTjxS7BuJU1ZFttYdRI4+lW+ikm7GzoV5rYpwjcCUFU/Tm4A== 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=1715963236; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=lX0FwhoS+iLp620VS+3uFjH8463ERETW3Sw51pZRL3Y=; b=mUPChGFDbu4zqSfSVY1+vRrGUyXgzSZ1GYPhQSoVeHnIBuGl1ltmQTq/meJcVDr7AqVdFk fHMX742Gh09LVDpYCITo+Rf8S7Inl2WyOmcHh9473UC/hVAKcOIq7nuEdoqBGHrGJCKdsh FjXUFuRRu5xaJmBNvBfJsgrTAlNzM5ZHIF8wx4rQxGT2mifyrl8kDJ+XFrQxRs0KzkY5Pc 9AMaKvT4wxJzadEWMdJkK+RGzqlGi89x37yZADTGhuh3SUYSAV1qyVbFkZGeIoM1aD9/2Q V1omewfZ8Xg68gDpI36UbxcLbLDzUSrOeLqiQ/VGK2tBh0bSry+hr9aKhXngCw== Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: brooks/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Vgsmz6yP5zGyD; Fri, 17 May 2024 16:27:15 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 913D33C019B; Fri, 17 May 2024 16:27:14 +0000 (UTC) Date: Fri, 17 May 2024 16:27:14 +0000 From: Brooks Davis To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 4c0dfd5959bd - main - arm: fail early on gcc builds Message-ID: References: <202405171601.44HG1Sef047261@gitrepo.freebsd.org> <456e4eef-e194-4e32-b3a7-c93bb941b82b@FreeBSD.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <456e4eef-e194-4e32-b3a7-c93bb941b82b@FreeBSD.org> On Fri, May 17, 2024 at 09:14:46AM -0700, John Baldwin wrote: > On 5/17/24 9:01 AM, Brooks Davis wrote: > > The branch main has been updated by brooks: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=4c0dfd5959bd499754e3fc9a7ce37c1d5ece31f7 > > > > commit 4c0dfd5959bd499754e3fc9a7ce37c1d5ece31f7 > > Author: Brooks Davis > > AuthorDate: 2024-05-17 15:47:22 +0000 > > Commit: Brooks Davis > > CommitDate: 2024-05-17 16:01:19 +0000 > > > > arm: fail early on gcc builds > > Since at least 2022 (see https://reviews.freebsd.org/D36754), it has > > not been possible to build armv6/armv7 with gcc due to atomics macros > > gcc doesn't like. Prevent developers doing due diligance from wasting > > time and CPU cycles on this combination as it just fails to build in > > libc. > > Reviewed by: imp, andrew > > Differential Revision: https://reviews.freebsd.org/D45193 > > As I said in the review, this is a weird change. Only amd64 and i386 build > with GCC. You should blacklist all the others if you are going to blacklist > any, not just 32-bit arm. I hadn't blacklisted any to make it possible for > other developers to work on it. Also, the review in question is probably not > the right fix, it's probably that we need to pass different CFLAGS to GCC for > 32-bit arm. I think I misunderstood your point in the review. I've wasted days trying to do the right thing to let me reapply 4510f2ca9170 (Make WITHOUT_UNDEFINED_VERSION the default) only to find that it's secret knowledge that gcc builds are broken except on x86. IMO there's less than zero value in universe targets that don't work unless they are clearly fenced. I propose disabling all the others and adding a flag to ignore this guard. -- Brooks P.S. I've got aarch64 building except for GOOGLETEST and BOOT which both fail to link due to relocation complaints. From nobody Fri May 17 16:33:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgswg1Yhmz5LQhX; Fri, 17 May 2024 16:33:55 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vgswf2zSFz4TwC; Fri, 17 May 2024 16:33:54 +0000 (UTC) (envelope-from manu@bidouilliste.com) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1715963631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FLo7VuCwGQoehKsM3Gmr75CNnvIxE1qN5ayzyIPV7LQ=; b=P6QqP9OLxCBuA7U5MfY29Fx6Vc0PtWatbpq+x5xZcP/yyLMwEzCn6OF/eiQWcE1WCIUzbB jzsAFPK3m/3prWuClMc5bQQqZ9bwRhAAiwihMy9WLjzKBAL/TvLbvLwP0rfQN81oBIGA7B 4yN/RH6DJpyZrMKjf29SNVzUFRmsnpI= Received: from skull.home.blih.net (lfbn-lyo-1-2174-135.w90-66.abo.wanadoo.fr [90.66.97.135]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 745ecdcb (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 17 May 2024 16:33:51 +0000 (UTC) Date: Fri, 17 May 2024 18:33:50 +0200 From: Emmanuel Vadot To: John Baldwin Cc: Emmanuel Vadot , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: cff79fd02636 - main - linuxkpi: Fix spin_lock_init Message-Id: <20240517183350.e45f54df07f670980d5a51c3@bidouilliste.com> In-Reply-To: <2cd3e698-1b42-4e7f-93a0-aacccb55c8d6@FreeBSD.org> References: <202405170559.44H5xD7d019861@gitrepo.freebsd.org> <2cd3e698-1b42-4e7f-93a0-aacccb55c8d6@FreeBSD.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd15.0) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR] X-Rspamd-Queue-Id: 4Vgswf2zSFz4TwC On Fri, 17 May 2024 09:07:53 -0700 John Baldwin wrote: > On 5/16/24 10:59 PM, Emmanuel Vadot wrote: > > The branch main has been updated by manu: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=cff79fd02636f34010d8b835cc9e55401fa76e74 > > > > commit cff79fd02636f34010d8b835cc9e55401fa76e74 > > Author: Emmanuel Vadot > > AuthorDate: 2024-05-17 04:52:53 +0000 > > Commit: Emmanuel Vadot > > CommitDate: 2024-05-17 05:58:59 +0000 > > > > linuxkpi: Fix spin_lock_init > > > > Some linux code re-init some spinlock so add MTX_NEW to mtx_init. > > > > Reported by: David Wolfskill > > Fixes: ae38a1a1bfdf ("linuxkpi: spinlock: Simplify code") > > --- > > sys/compat/linuxkpi/common/include/linux/spinlock.h | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/sys/compat/linuxkpi/common/include/linux/spinlock.h b/sys/compat/linuxkpi/common/include/linux/spinlock.h > > index 3f6eb4bb70f6..2992e41c9c02 100644 > > --- a/sys/compat/linuxkpi/common/include/linux/spinlock.h > > +++ b/sys/compat/linuxkpi/common/include/linux/spinlock.h > > @@ -140,7 +140,7 @@ typedef struct mtx spinlock_t; > > #define spin_lock_name(name) _spin_lock_name(name, __FILE__, __LINE__) > > > > #define spin_lock_init(lock) mtx_init(lock, spin_lock_name("lnxspin"), \ > > - NULL, MTX_DEF | MTX_NOWITNESS) > > + NULL, MTX_DEF | MTX_NOWITNESS | MTX_NEW) > > > > #define spin_lock_destroy(_l) mtx_destroy(_l) > > This is only ok because of MTX_NOWITNESS. Reiniting locks without destroying > them corrupts the internal linked lists in WITNESS for locks using witness. > That may warrant a comment here explaining why we disable witness. I'll try to look at what linux expect for spinlocks, it could also be that we need to do this because some drivers via linuxkpi does weird things ... > It might be nice to add an extension to the various lock inits for code that > wants to opt-int to using WITNESS where a name can be passed. Using those would > be relatively small diffs in the client code and let select locks opt into > using WITNESS. You could make it work by adding an optional second argument > to spin_lock_init, etc. that takes the name. We can't change spin_lock_init, we need to follow linux api here. > -- > John Baldwin > -- Emmanuel Vadot From nobody Fri May 17 16:36:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgszj1dYbz5LQmF; Fri, 17 May 2024 16:36:33 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vgszh6Jnrz4VfF; Fri, 17 May 2024 16:36:32 +0000 (UTC) (envelope-from brooks@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715963792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=c9FiHzRE71lWJv+LaG1EPCBHMzW2UW/xBNnCZjVpfRw=; b=PekSOc1MdDc9lQ4tl0b9w51bo3J9GFT3Cehz+oTG32iw6ZLiCzVGfJvkmyhPtm6TyoJk87 gJYspVMZ2s067lIdKaztpFUL+RqHzt0yq/FBYiaYH4hYDRMnhd3IGFacnSr4agtcjRb4K3 RCsxJmQt5qQBfGhO1+iTF5cWU+0LBefcsPYFw8u5OzVniq7FObefetnw3Afzq5jilOAeUz YZ0duUiFA7oyuTt0D7/0Rcr386CoZA1vj5G5wZABwZJtE2p+3qTeRNV3g2U3zOg0h1C557 hQU+XCPm/4gL2Z/bLIfS9z25LHg0VNfFayXFea/YPeZXJCKBku5MTZj95WWA9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715963792; a=rsa-sha256; cv=none; b=SV1HN/MDzYfOC+hIZW9BLSow9y/Owc+f3mlGfcFOiT8N9+0gbO0L/0S74DP6m14zBvqqIl Zjvpf8p4TFgF0WZqfuLv1FlvP2toJItpNEcOAP1nrS8Oudqw/QROzuXXRNW5acFYU1d+oL hAMDsMs59dNsqa6/2NT19JEC9Sz3qzOirQtWVAdI8eMVdhhKqHa1JrtDTdszRtqpDy6MID IzLLouBuTIpmlUmgGMXUMCr6BhA9cgChQ8dJQ7GKGtNp4z7J7qIWN3lQlVuQxzcoUsjImn kYYu2MLtRu+SRKaTAy/6I5+LxQ2uEQi0GdhSlWcYKvM0slyFq4xZSmiLa3/GhA== 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=1715963792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=c9FiHzRE71lWJv+LaG1EPCBHMzW2UW/xBNnCZjVpfRw=; b=x1EfQQiW0MWL5mI8Qnpyzh0Wb2LrZ5t2T+ms+F2ciEVey7Gmkw6cwb3geioxZwxTFPKW1A c9o2Pl+Z41EVaPhw2w6B14hrS89XcUiJ1Gd19xVtkTNZhOqgKzt8SdrKD4mRA/tzDsyRcj igqGe+n4MA/Lv/90LsUPtqb1dn0cadwSstzE0Hchz0SvKyU8bq8WDOixh9ksYqW5nC5AHX P8UYsOnuuyPB7xCug2zT10Cb2lrZiML4LP71NO7H6M4nyBwQyMSiCQdHadMPcjRuwowRCi k8ZgwPgWbfA3q+FqANTkOmN/ThzjjavhaJWu3oqYJlSUMp6yuwvLL3GMhPDOCg== Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: brooks/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Vgszh5d1szGyL; Fri, 17 May 2024 16:36:32 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 85C853C019B; Fri, 17 May 2024 16:36:32 +0000 (UTC) Date: Fri, 17 May 2024 16:36:32 +0000 From: Brooks Davis To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 16d8dfde0c0f - main - aarch64: disable LIB32 with gcc Message-ID: References: <202405171601.44HG1RH4047215@gitrepo.freebsd.org> <55ef7d2e-e01b-42a2-acc9-b7351b1aa1f2@FreeBSD.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55ef7d2e-e01b-42a2-acc9-b7351b1aa1f2@FreeBSD.org> On Fri, May 17, 2024 at 09:12:17AM -0700, John Baldwin wrote: > On 5/17/24 9:01 AM, Brooks Davis wrote: > > The branch main has been updated by brooks: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=16d8dfde0c0fb2eb95f2dd8c350ae652fa2c68fa > > > > commit 16d8dfde0c0fb2eb95f2dd8c350ae652fa2c68fa > > Author: Brooks Davis > > AuthorDate: 2024-05-17 15:47:06 +0000 > > Commit: Brooks Davis > > CommitDate: 2024-05-17 16:01:18 +0000 > > > > aarch64: disable LIB32 with gcc > > gcc doesn't have -m32 support on aarch64 so mark LIB32 broken there. > > We have to check both COMPILER_TYPE and X_COMPILER_TYPE becuase > > X_COMPILER_TYPE is only conditionally set and COMPILER_TYPE is the host > > compiler in Makefile.inc1. > > Reviewed by: emaste > > Differential Revision: https://reviews.freebsd.org/D45089 > > --- > > share/mk/src.opts.mk | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk > > index 00405e3f934f..501df88cd776 100644 > > --- a/share/mk/src.opts.mk > > +++ b/share/mk/src.opts.mk > > @@ -303,7 +303,7 @@ __DEFAULT_YES_OPTIONS+=LLDB > > __DEFAULT_NO_OPTIONS+=LLDB > > .endif > > # LIB32 is not supported on all 64-bit architectures. > > -.if (${__T} == "amd64" || ${__T:Maarch64*} != "" || ${__T} == "powerpc64") > > +.if (${__T:Maarch64*} != "" && ((defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} != "gcc") || (!defined(X_COMPILER_TYPE) && ${COMPILER_TYPE} != "gcc"))) || ${__T} == "amd64" || ${__T} == "powerpc64" > > __DEFAULT_YES_OPTIONS+=LIB32 > > .else > > BROKEN_OPTIONS+=LIB32 > > I'd rather fix the compiler port? aarch64 still doesn't build world at all > (though might build some more after Andrew's commits today). I'd meant to include a reference to the bug I filed on the issue which discusses possible solutions. I personally don't care enough about 32-bit arm to spend more time on this though. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278879 -- Brooks From nobody Fri May 17 16:39:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgt3N2yz7z5LRHQ for ; Fri, 17 May 2024 16:39:44 +0000 (UTC) (envelope-from bounce.3jsmfihn0rriy44=musehebwepof=hfod0ryydpf10i@em790814.fubar.geek.nz) Received: from e3i74.smtp2go.com (e3i74.smtp2go.com [158.120.84.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vgt3M6s2Sz4WJn for ; Fri, 17 May 2024 16:39:43 +0000 (UTC) (envelope-from bounce.3jsmfihn0rriy44=musehebwepof=hfod0ryydpf10i@em790814.fubar.geek.nz) Authentication-Results: mx1.freebsd.org; none Received: from [10.99.243.232] (helo=morbo.fubar.geek.nz) by smtpcorp.com with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97-S2G) (envelope-from ) id 1s80cM-4o5NDgrvSaC-rvgq; Fri, 17 May 2024 16:39:38 +0000 Received: from smtpclient.apple (92.40.185.136.threembb.co.uk [92.40.185.136]) by morbo.fubar.geek.nz (Postfix) with ESMTPSA id C986475FA; Fri, 17 May 2024 16:39:37 +0000 (UTC) From: Andrew Turner Message-Id: <1AA02875-8758-4283-8DEB-8EFF6F747660@fubar.geek.nz> Content-Type: multipart/alternative; boundary="Apple-Mail=_274B75DD-7262-43CC-901B-71B4AD38B1A3" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.100.2.1.4\)) Subject: Re: git: 4c0dfd5959bd - main - arm: fail early on gcc builds Date: Fri, 17 May 2024 17:39:26 +0100 In-Reply-To: Cc: John Baldwin , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org To: Brooks Davis References: <202405171601.44HG1Sef047261@gitrepo.freebsd.org> <456e4eef-e194-4e32-b3a7-c93bb941b82b@FreeBSD.org> X-Mailer: Apple Mail (2.3774.100.2.1.4) X-smtpcorp-track: SmT2uiMxNLxa.jJE-vrZSQZi6.z4A6mwvw74I DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smtpservice.net; i=@smtpservice.net; q=dns/txt; s=a1-4; t=1715963980; h=feedback-id : x-smtpcorp-track : date : message-id : to : subject : from : reply-to : sender : list-unsubscribe; bh=cbfpT6aaQJ+/qvaqqTDydXWtnF2pebCzoQfy+9yl2YE=; b=HeO0ZVN1gVEoN7gw2SKA1sGltbYN2licv+Ct6lzEuNYzcNtYdV3TbMLHJsi1O4wcIqQ1L OuOEsJ5bjuxuyJ6auTH2kGfg+rk0Admga3P4MLjh2XZ1crNfF6v3pIATd2orxjrQVEYji47 dx5LgWXjV2+rbYLHMQDbTQcsb4Sz0cMB2IRze/wfYv4RUcU70tksfGxvmRdZJSmrWYSD7po I7TZ51kFz+Sg4zpGRS+5savC9d9guZvLck2v09wWbuDDo5Xq2hlO+WBsoLU9OWHqrXy5PaR Jkcl3JlwlkA5b53rX8aEIHpoimpAeDlG/QaadydM+JTcTbuCyQg0ySLKkXyw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fubar.geek.nz; i=@fubar.geek.nz; q=dns/txt; s=s790814; t=1715963980; h=from : subject : to : message-id : date; bh=cbfpT6aaQJ+/qvaqqTDydXWtnF2pebCzoQfy+9yl2YE=; b=cj3HNuDH5ZaNBAeU1//0zWfRv/3ahOpOzR2hgRgIsJVg2QozRwZffBqTLkTreycpX4VqU JJRm/Tx3+wqZ2U3VDeLHczTiwD+q31BXij1/t2m/P7z/nIg6T8JScPOp/PaoZlW7M/q4X6n H7+hjz+TLRpzIU/iQaK7Sm26mFQmx+xZOGhyxk9q7kPVCnyWW5vaphYCCTQMatna5NyW2H3 dI82DRBJ6k/2mGTniLAYEWYpiXbaLe3CA33k7kzOqyyFkD0w6osk45F4nt6vuuSldSlQ19l CeC3ubxHg5k8YCRSYrlWY2mMKOrQFmcRGLIKCXrZVXGPivra0fy8hgcAC74g== X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:23352, ipnet:158.120.84.0/22, country:US] X-Rspamd-Queue-Id: 4Vgt3M6s2Sz4WJn --Apple-Mail=_274B75DD-7262-43CC-901B-71B4AD38B1A3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 17 May 2024, at 17:27, Brooks Davis wrote: >=20 > On Fri, May 17, 2024 at 09:14:46AM -0700, John Baldwin wrote: >> On 5/17/24 9:01 AM, Brooks Davis wrote: >>> The branch main has been updated by brooks: >>>=20 >>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D4c0dfd5959bd499754e3fc9a7ce37c1d= 5ece31f7 >>>=20 >>> commit 4c0dfd5959bd499754e3fc9a7ce37c1d5ece31f7 >>> Author: Brooks Davis >>> AuthorDate: 2024-05-17 15:47:22 +0000 >>> Commit: Brooks Davis >>> CommitDate: 2024-05-17 16:01:19 +0000 >>>=20 >>> arm: fail early on gcc builds >>> Since at least 2022 (see https://reviews.freebsd.org/D36754), it = has >>> not been possible to build armv6/armv7 with gcc due to atomics = macros >>> gcc doesn't like. Prevent developers doing due diligance from = wasting >>> time and CPU cycles on this combination as it just fails to = build in >>> libc. >>> Reviewed by: imp, andrew >>> Differential Revision: https://reviews.freebsd.org/D45193 >>=20 >> As I said in the review, this is a weird change. Only amd64 and i386 = build >> with GCC. You should blacklist all the others if you are going to = blacklist >> any, not just 32-bit arm. I hadn't blacklisted any to make it = possible for >> other developers to work on it. Also, the review in question is = probably not >> the right fix, it's probably that we need to pass different CFLAGS to = GCC for >> 32-bit arm. I found too many issues with gcc 13 to get a world or kernel built. I = have fixes for some of them, but it looked like the effort to fix the = remaining issues wasn=E2=80=99t worth it. >=20 > I think I misunderstood your point in the review. I've wasted days > trying to do the right thing to let me reapply 4510f2ca9170 (Make > WITHOUT_UNDEFINED_VERSION the default) only to find that it's secret > knowledge that gcc builds are broken except on x86. >=20 > IMO there's less than zero value in universe targets that don't work > unless they are clearly fenced. >=20 > I propose disabling all the others and adding a flag to ignore this > guard. >=20 > -- Brooks >=20 > P.S. I've got aarch64 building except for GOOGLETEST and BOOT which = both > fail to link due to relocation complaints. I have fixes in [1] to build world and kernel for arm64 with GCC. I=E2=80=99= ve pushed some of the simple fixes & can put the remaining in review = next week. Andrew [1] https://github.com/zxombie/freebsd/tree/gcc-arm64 --Apple-Mail=_274B75DD-7262-43CC-901B-71B4AD38B1A3 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On 17 May 2024, at 17:27, Brooks Davis = <brooks@freebsd.org> wrote:

On Fri, May 17, 2024 at 09:14:46AM -0700, = John Baldwin wrote:
On 5/17/24 9:01 AM, Brooks Davis = wrote:
The branch main has been updated by = brooks:

URL: = https://cgit.FreeBSD.org/src/commit/?id=3D4c0dfd5959bd499754e3fc9a7ce37c1d= 5ece31f7

commit = 4c0dfd5959bd499754e3fc9a7ce37c1d5ece31f7
Author: =     Brooks Davis = <brooks@FreeBSD.org>
AuthorDate: 2024-05-17 15:47:22 = +0000
Commit:     Brooks Davis = <brooks@FreeBSD.org>
CommitDate: 2024-05-17 16:01:19 = +0000

    arm: fail early on gcc = builds
    Since at least 2022 (see = https://reviews.freebsd.org/D36754), it = has
    not been possible to build armv6/armv7 = with gcc due to atomics macros
    gcc doesn't = like.  Prevent developers doing due diligance from = wasting
    time and CPU cycles on this = combination as it just fails to build = in
    libc.
    Reviewed = by:    imp, = andrew
    Differential Revision: =  https://reviews.freebsd.org/D45193

As I said = in the review, this is a weird change.  Only amd64 and i386 = build
with GCC.  You should blacklist all the others if you are = going to blacklist
any, not just 32-bit arm.  I hadn't = blacklisted any to make it possible for
other developers to work on = it.  Also, the review in question is probably not
the right fix, = it's probably that we need to pass different CFLAGS to GCC for
32-bit = arm.

I found too = many issues with gcc 13 to get a world or kernel built. I have fixes for = some of them, but it looked like the effort to fix the remaining issues = wasn=E2=80=99t worth it.


I think I misunderstood your point in the = review.  I've wasted days
trying = to do the right thing to let me reapply 4510f2ca9170 (Make
WITHOUT_UNDEFINED_VERSION the default) only = to find that it's secret
knowledge that gcc builds are broken except on = x86.

IMO there's less than = zero value in universe targets that don't work
unless they are clearly fenced.

I propose disabling all the others and = adding a flag to ignore this
guard.

-- = Brooks

P.S. I've got aarch64 = building except for GOOGLETEST and BOOT which both
fail to link due to relocation = complaints.

I have fixes in [1] = to build world and kernel for arm64 with GCC. I=E2=80=99ve pushed some = of the simple fixes & can put the remaining in review next = week.

Andrew

[1] = https://github.com/zxombie/freebsd/tree/gcc-arm64

= --Apple-Mail=_274B75DD-7262-43CC-901B-71B4AD38B1A3-- From nobody Fri May 17 16:46:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgtCl5MWqz5LRl6; Fri, 17 May 2024 16:46:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgtCl4QcRz4X91; Fri, 17 May 2024 16:46:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715964419; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4oRCtMAbvAVrOWQDv2uMZofx8iadoJfA86BColKX2BU=; b=MVstPg3SL0+/AGlTsDuFSGt/Ck9rE8v6cSlTxTQjTr59NN7tmovEOR4n/Xr8NKO3ws8Ywl dPDdOXJfN6Rj0hOflPAwfcT+6GtRea16vx3MAVTMSIbpYbhJoawcyyhqaAoOTGyovhq93d 2mPHllh8KNkMo3afkSnvlgGhVBazdNAOWYqSc/5YeVo0V2i4r0TGJF96LdLh7D0WLa6PmM bIpq7z0veMAQKfiJWtVV1/npXaBT03oXX/wxz0D2A547D7LUBgCTCt/cHaFQk462vAg4CS 9jSYNfNFmFXQ7GFr5KQp8iWf/xywO80XdALTWnsRKN0dHqV9UK/ZHhPnPJ0zMg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715964419; a=rsa-sha256; cv=none; b=GbFCfR0OvvsCPN1wjkAwEbC7p4FIv6B34GkoUJagyhPXSJYRMHoVP8Qbz7NPdKkJUlJCFI HcRVTw7dF9gTUiaRG5bWqaBDPH34rKW9BIwHZSG6rP0kZ0WxEpyQcDRlQCg4q6sM1RSgBc lyLiCTpMsveAyC7uUlZJuwapHcprsLe92yHs4BjK70tFkTn/37ynHRKvg1eEhbGtOAUosI aHXp2RlLA9oyz3JA934gw9bdnwEvL24exo+y9b9Me9GzXuUscn7oXTSFOVbnq0T1X6B8M8 7Y7uhane9vT9CV8LSzKLG0XPiqa3tOXH1FDRwt9sO0AIBQh296rAvKhdUQ35DA== 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=1715964419; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4oRCtMAbvAVrOWQDv2uMZofx8iadoJfA86BColKX2BU=; b=mS16pW5SBDzBRxDSZt6Wijs4jVwGJiu3BHSpPd6J/WJCHsZDtXosxyQYpTLuizyZ8APSZ+ kF1KvCHIkiGWVZVnFRCaK3B7TLNgB5X6Tnkt+ICXZ/rfqZ8HkOIbjr5Axk3S4BdVJZ94Qi X+I4+z5LBYgDnyIFrHkesCNwxN3wsDR393B+5OvnpsEb9DtUEk2/tzvMSTHjry4VtqcC1b N50mKAWAbj/+aABQ1HvfjvxTdpxbaz513nOg3a/WockZaGqVWMUjL+FcIGcOc4hokvH9TM ffxBVD6k+qoY+kDvPcG/5IP5hGBV5RQfS2vV5Vl5vSvXjMV3h/mcT/BHxKwMUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgtCl3x75zq7t; Fri, 17 May 2024 16:46: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 44HGkx0i016375; Fri, 17 May 2024 16:46:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HGkxS4016372; Fri, 17 May 2024 16:46:59 GMT (envelope-from git) Date: Fri, 17 May 2024 16:46:59 GMT Message-Id: <202405171646.44HGkxS4016372@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marko Zec Subject: git: 19bd24caa4c8 - main - fib_dxr: do not leak memory if FIB constellation hits structural limit List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 19bd24caa4c8c76ddf138b3a1598a21c8c5c3291 Auto-Submitted: auto-generated The branch main has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=19bd24caa4c8c76ddf138b3a1598a21c8c5c3291 commit 19bd24caa4c8c76ddf138b3a1598a21c8c5c3291 Author: Marko Zec AuthorDate: 2024-05-17 16:36:21 +0000 Commit: Marko Zec CommitDate: 2024-05-17 16:46:41 +0000 fib_dxr: do not leak memory if FIB constellation hits structural limit DXR lookup table encoding has an inherent structural limit on the amount of binary search ranges it can accomodate. With the current IPv4 BGP views (circa 1 M prefixes) and default DXR encoding we are only at around 5% of that limit, so far, far away from hitting it. Just in case it ever gets hit, make sure we free the allocated structures, instead of leaking it. MFC after: 1 week --- sys/netinet/in_fib_dxr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index 539d7fe6c96f..326710cc4c45 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -1320,8 +1320,10 @@ dxr_change_rib_batch(struct rib_head *rnh, struct fib_change_queue *q, dxr_build(new_dxr); /* Structural limit exceeded, hard error */ - if (da->rtbl_top >= BASE_MAX) + if (da->rtbl_top >= BASE_MAX) { + dxr_destroy(new_dxr); return (FLM_ERROR); + } if (new_dxr->d == NULL) { dxr_destroy(new_dxr); From nobody Fri May 17 17:05:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgtd53LNpz5LSyx; Fri, 17 May 2024 17:05: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 4Vgtd52MRfz4Yjk; Fri, 17 May 2024 17:05:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715965529; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kyqSVFhRQnngnw0o8R08p672uozkGjyQ0erBJmpPZKU=; b=nJxB6xxlUoiwVJ06Dnwwb77iTrsbp/WhpH6wMUJeJlBWNvt4FTuw+N1wPQ2dGKOtw1Sj02 pC7zsYqtKN4MNYasElAiiHA/NOGNdjtTJW0FTFqE/5YaAZ+HNL1sqKkTBqMCwP2h0BITtl U0NOhzVyNHkE45in/TS6KhRYvjVxQtUAiuIWOOzeO3uzDcrESmYBIQD4j+aIS6AULOSjLB 55aIRC2JVqoghEiwpPrBokVpJSybXxhXAkN7k7DwL0jdDoBsKsx/rJQMU53iCPxENWDbNC ET77YDsEI3aTWGheCclBV1/z3wBx8PXKBDFARaoaDgdBT3MFEZCBdTcLoZXGCA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715965529; a=rsa-sha256; cv=none; b=hsdN2WyJUJbUDm0Ap5ArGc60PsokiTabEe4yQc4KYk3dt+lSsJkX1O8jnWhSR0yYjU/yN0 9TwdP7migjfXsEvJo0ivyfxiXtcgSzRK+noVIPMKacEdubSgHKo61PX3hsJojMMyJO3GyU WZQyzCSIGTdbLK+KAiYIOKJ8WObSmTUkKROeAOvhuwnr/YckF+ewMpVz5PRpQywM4VuiZP tGY5IDObKqA3+V+iwNXAxBkwgn2T/BRqqL7le+GgOV1bNWccLqoXdv1VLUTPcjhCSItbVo mpqp2rVUjDozenpCW9qQYvMa5RvONZ7LOjd7O4qV2s734gHUB1hZlNoxgsNISQ== 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=1715965529; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kyqSVFhRQnngnw0o8R08p672uozkGjyQ0erBJmpPZKU=; b=eXHMCLewdQc73T5+7YuHCpzLa3/BoJS2kmI7wYs3hSO8yQl8DlIUPJNiYOOg6ZVZISGwFd LFPd4peXHvPeZLL0EX6ylCvSU6zCpDcrPwaEZLU0lF811i1co8DYgdblWoG3lNwwHeP+Dh Bb0s0lEuPioQYaKyh/gjaeefPWr3clUXSzi1aH1CJF7pR0K2vmn3W078+nY6BEANMDCDFa H+GMNuXemOT668Vc66NTK+58VVw6QtFVeLm0HtMqQjEF+xDEFLyXGF7fv/F3gbOnxGG6J3 1iHoxOYE9znjemWjr8y26v0TwgeRrvhXxdYvSg3NtvoqMJJswDDNNp1ShgA+Sg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vgtd51yKmzqx5; Fri, 17 May 2024 17:05: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 44HH5TYk050719; Fri, 17 May 2024 17:05:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HH5To1050716; Fri, 17 May 2024 17:05:29 GMT (envelope-from git) Date: Fri, 17 May 2024 17:05:29 GMT Message-Id: <202405171705.44HH5To1050716@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marko Zec Subject: git: 42b3c16e3051 - main - fib_dxr: code hygiene, prune old code, no functional changes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 42b3c16e3051fdc04acc6276dd5d97dbe80ae7eb Auto-Submitted: auto-generated The branch main has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=42b3c16e3051fdc04acc6276dd5d97dbe80ae7eb commit 42b3c16e3051fdc04acc6276dd5d97dbe80ae7eb Author: Marko Zec AuthorDate: 2024-05-17 16:57:25 +0000 Commit: Marko Zec CommitDate: 2024-05-17 16:57:25 +0000 fib_dxr: code hygiene, prune old code, no functional changes The !DXR2 code corresponds to the original DXR encoding proposal from 2012 with a single direct-lookup stage, which is inferior to the more recent (DXR2) variant with two-stage trie both in terms of memory footprint of the lookup structures, and in terms of overall lookup througput. I'm axing the old code chunks to (hopefully) somewhat improve readability, as well as to simplify future maintenance and updates. MFC after: 1 week --- sys/netinet/in_fib_dxr.c | 43 +------------------------------------------ 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index 326710cc4c45..b889131b544b 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2012-2022 Marko Zec + * Copyright (c) 2012-2024 Marko Zec * Copyright (c) 2005, 2018 University of Zagreb * Copyright (c) 2005 International Computer Science Institute * @@ -68,9 +68,6 @@ CTASSERT(DXR_TRIE_BITS >= 16 && DXR_TRIE_BITS <= 24); -/* DXR2: two-stage primary trie, instead of a single direct lookup table */ -#define DXR2 - #if DXR_TRIE_BITS > 16 #define DXR_D 16 #else @@ -317,7 +314,6 @@ range_lookup(struct range_entry_long *rt, struct direct_entry de, uint32_t dst) ntohl(key.addr4.s_addr))]); \ } -#ifdef DXR2 #if DXR_TRIE_BITS > 16 DXR_LOOKUP_DEFINE(16) #endif @@ -328,23 +324,16 @@ DXR_LOOKUP_DEFINE(12) DXR_LOOKUP_DEFINE(11) DXR_LOOKUP_DEFINE(10) DXR_LOOKUP_DEFINE(9) -#endif /* DXR2 */ static int inline dxr_lookup(struct dxr *dxr, uint32_t dst) { struct direct_entry de; -#ifdef DXR2 uint16_t *dt = dxr->d; struct direct_entry *xt = dxr->x; de = xt[(dt[dst >> dxr->d_shift] << dxr->x_shift) + ((dst >> DXR_RANGE_SHIFT) & dxr->x_mask)]; -#else /* !DXR2 */ - struct direct_entry *dt = dxr->d; - - de = dt[dst >> DXR_RANGE_SHIFT]; -#endif /* !DXR2 */ if (__predict_true(de.fragments == FRAGS_MARK_HIT)) return (de.base); return (range_lookup(dxr->r, de, dst)); @@ -571,7 +560,6 @@ chunk_unref(struct dxr_aux *da, uint32_t chunk) LIST_INSERT_HEAD(&da->unused_chunks[i], cdp, cd_hash_le); } -#ifdef DXR2 static uint32_t trie_hash(struct dxr_aux *da, uint32_t dxr_x, uint32_t index) { @@ -670,7 +658,6 @@ trie_unref(struct dxr_aux *da, uint32_t index) } } while (tp != NULL); } -#endif static void heap_inject(struct dxr_aux *da, uint32_t start, uint32_t end, uint32_t preflen, @@ -864,12 +851,10 @@ dxr_build(struct dxr *dxr) uint32_t r_size, dxr_tot_size; uint32_t i, m, range_rebuild = 0; uint32_t range_frag; -#ifdef DXR2 struct trie_desc *tp; uint32_t d_tbl_size, dxr_x, d_size, x_size; uint32_t ti, trie_rebuild = 0, prev_size = 0; uint32_t trie_frag; -#endif MPASS(dxr->d == NULL); @@ -907,7 +892,6 @@ dxr_build(struct dxr *dxr) } range_rebuild = 1; } -#ifdef DXR2 if (da->x_tbl == NULL) { da->x_tbl = malloc(sizeof(*da->x_tbl) * da->xtbl_size, M_DXRAUX, M_NOWAIT); @@ -918,7 +902,6 @@ dxr_build(struct dxr *dxr) } trie_rebuild = 1; } -#endif microuptime(&t0); @@ -970,7 +953,6 @@ range_build: r_size = sizeof(*da->range_tbl) * da->rtbl_top; microuptime(&t1); -#ifdef DXR2 if (range_rebuild || abs(fls(da->prefixes) - fls(da->trie_rebuilt_prefixes)) > 1) trie_rebuild = 1; @@ -1044,10 +1026,6 @@ dxr2_try_squeeze: goto dxr2_try_squeeze; } microuptime(&t2); -#else /* !DXR2 */ - dxr_tot_size = sizeof(da->direct_tbl) + r_size; - t2 = t1; -#endif dxr->d = malloc(dxr_tot_size, M_DXRLPM, M_NOWAIT); if (dxr->d == NULL) { @@ -1055,7 +1033,6 @@ dxr2_try_squeeze: "Unable to allocate DXR lookup table"); return; } -#ifdef DXR2 memcpy(dxr->d, da->d_tbl, d_size); dxr->x = ((char *) dxr->d) + d_size; memcpy(dxr->x, da->x_tbl, x_size); @@ -1063,10 +1040,6 @@ dxr2_try_squeeze: dxr->d_shift = 32 - da->d_bits; dxr->x_shift = dxr_x; dxr->x_mask = 0xffffffffU >> (32 - dxr_x); -#else /* !DXR2 */ - memcpy(dxr->d, da->direct_tbl, sizeof(da->direct_tbl)); - dxr->r = ((char *) dxr->d) + sizeof(da->direct_tbl); -#endif memcpy(dxr->r, da->range_tbl, r_size); if (da->updates_low <= da->updates_high) @@ -1076,36 +1049,24 @@ dxr2_try_squeeze: da->updates_high = 0; microuptime(&t3); -#ifdef DXR2 FIB_PRINTF(LOG_INFO, da->fd, "D%dX%dR, %d prefixes, %d nhops (max)", da->d_bits, dxr_x, rinfo.num_prefixes, rinfo.num_nhops); -#else - FIB_PRINTF(LOG_INFO, da->fd, "D%dR, %d prefixes, %d nhops (max)", - DXR_D, rinfo.num_prefixes, rinfo.num_nhops); -#endif i = dxr_tot_size * 100; if (rinfo.num_prefixes) i /= rinfo.num_prefixes; FIB_PRINTF(LOG_INFO, da->fd, "%d.%02d KBytes, %d.%02d Bytes/prefix", dxr_tot_size / 1024, dxr_tot_size * 100 / 1024 % 100, i / 100, i % 100); -#ifdef DXR2 FIB_PRINTF(LOG_INFO, da->fd, "%d.%02d%% trie, %d.%02d%% range fragmentation", trie_frag / 100, trie_frag % 100, range_frag / 100, range_frag % 100); -#else - FIB_PRINTF(LOG_INFO, da->fd, "%d.%01d%% range fragmentation", - range_frag / 100, range_frag % 100); -#endif i = (t1.tv_sec - t0.tv_sec) * 1000000 + t1.tv_usec - t0.tv_usec; FIB_PRINTF(LOG_INFO, da->fd, "range table %s in %u.%03u ms", range_rebuild ? "rebuilt" : "updated", i / 1000, i % 1000); -#ifdef DXR2 i = (t2.tv_sec - t1.tv_sec) * 1000000 + t2.tv_usec - t1.tv_usec; FIB_PRINTF(LOG_INFO, da->fd, "trie %s in %u.%03u ms", trie_rebuild ? "rebuilt" : "updated", i / 1000, i % 1000); -#endif i = (t3.tv_sec - t2.tv_sec) * 1000000 + t3.tv_usec - t2.tv_usec; FIB_PRINTF(LOG_INFO, da->fd, "snapshot forked in %u.%03u ms", i / 1000, i % 1000); @@ -1194,7 +1155,6 @@ static void * choose_lookup_fn(struct dxr_aux *da) { -#ifdef DXR2 switch (da->d_bits) { #if DXR_TRIE_BITS > 16 case 16: @@ -1215,7 +1175,6 @@ choose_lookup_fn(struct dxr_aux *da) case 9: return (dxr_fib_lookup_9); } -#endif /* DXR2 */ return (dxr_fib_lookup); } From nobody Fri May 17 17:42:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgvSK1Jg8z5LWVG; Fri, 17 May 2024 17:42:57 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgvSK0hnHz4djh; Fri, 17 May 2024 17:42:57 +0000 (UTC) (envelope-from brooks@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715967777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=92X9idhCKFiYLOZ1RW7YC5iTmMEY5/SGTFODtzz31Cs=; b=rQWl25CnNzzcuqxV/iLwevoxanHtoqsPaAmZlsTJZYk7FU1FORkB7lDOAj73z/+LLzDqMk bk/AGmQmkiXkGBJriJaRU1M6Ncsndkvi7zceYQbOoNHJ+pZz/+jm8S4eBjc2EMzo1Y8n7j 94hKk+0glXP327FoOqFagNO58+mt6ju5LGeQ/HbzmcOfGgwX43CabIalmMsfBtV1I+7Vw6 bAP7CauZOxZBtaoU3Cgfz4yzipkUZn8zjPaIp9gs9o3O3NTdVTOMsDlyAzO5Cf16XJrpDy gheck+Je7pl+v+kLP4rMy+aK/DLB3PoKWA2+kMsmWX4fMxM2E+Y/b0STqM38mA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715967777; a=rsa-sha256; cv=none; b=g1RAKnzaiZUAZXiVMA2Mm1NtzDXNgnLFtNZiCt39aQGTEkVc8Hgd1nO4zxQq8GOr+upxdg PL+alp2CNLYMJsL2pagWXuGO2j/hrIPh6heZDyfngnbPw4U2VZW7v0gmkMbjczZ4zdI3kD 4KPY7uIYFOrUMMvJ31XK2Y1GpCEf3vIhFN/4GQ7TiDib/hl02aa9UYDxC7XYOuLP4cuHYf Uu6D/RO/kx92c0Q6DLOqZkaDFC6trm/jLyyWpbD//PTcGXuVgucJA3J2uSLyb/aMlSzXYr XDEIdmuFvkoqOPsYgRhCFRavMwi+JcapVU7MGwNjDtLBQP1F71ZBMmaxdtCF5A== 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=1715967777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=92X9idhCKFiYLOZ1RW7YC5iTmMEY5/SGTFODtzz31Cs=; b=ugs4IMm62uRccQWrBj0EZo5b4Cq0Ylhg45Dj3ZHkYcDXeH1e/fISwhmTZrjxSOUMZrvVua AuXCTD2iUHalhAMAcIYO7za7VxUJdrH4X7seK6EzO80anT8jESt3d92uM3bCqCARFhzcM6 QRjiDqLY4StR7P3UyVb7ppfY7XczrzbcLXPFdBsJv1Y3piqhjyDerrrV+j23Mx8yNSWTol gy47X4LyB7hNjYOdvMPLPP9JxwraFOPq/eVkvlsC1TSys6s+OUTo38Sti7HJnLJizgFWwk l40m0f08GHqIV3WSWG3GI4T4l5vcfau98jEgZ9WSk/f/eKQpuy3GqgY4rafjCg== Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: brooks/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4VgvSK06V4zJs6; Fri, 17 May 2024 17:42:56 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id A54493C019B; Fri, 17 May 2024 17:42:56 +0000 (UTC) Date: Fri, 17 May 2024 17:42:56 +0000 From: Brooks Davis To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 4c0dfd5959bd - main - arm: fail early on gcc builds Message-ID: References: <202405171601.44HG1Sef047261@gitrepo.freebsd.org> <456e4eef-e194-4e32-b3a7-c93bb941b82b@FreeBSD.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, May 17, 2024 at 04:27:14PM +0000, Brooks Davis wrote: > On Fri, May 17, 2024 at 09:14:46AM -0700, John Baldwin wrote: > > On 5/17/24 9:01 AM, Brooks Davis wrote: > > > The branch main has been updated by brooks: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=4c0dfd5959bd499754e3fc9a7ce37c1d5ece31f7 > > > > > > commit 4c0dfd5959bd499754e3fc9a7ce37c1d5ece31f7 > > > Author: Brooks Davis > > > AuthorDate: 2024-05-17 15:47:22 +0000 > > > Commit: Brooks Davis > > > CommitDate: 2024-05-17 16:01:19 +0000 > > > > > > arm: fail early on gcc builds > > > Since at least 2022 (see https://reviews.freebsd.org/D36754), it has > > > not been possible to build armv6/armv7 with gcc due to atomics macros > > > gcc doesn't like. Prevent developers doing due diligance from wasting > > > time and CPU cycles on this combination as it just fails to build in > > > libc. > > > Reviewed by: imp, andrew > > > Differential Revision: https://reviews.freebsd.org/D45193 > > > > As I said in the review, this is a weird change. Only amd64 and i386 build > > with GCC. You should blacklist all the others if you are going to blacklist > > any, not just 32-bit arm. I hadn't blacklisted any to make it possible for > > other developers to work on it. Also, the review in question is probably not > > the right fix, it's probably that we need to pass different CFLAGS to GCC for > > 32-bit arm. > > I think I misunderstood your point in the review. I've wasted days > trying to do the right thing to let me reapply 4510f2ca9170 (Make > WITHOUT_UNDEFINED_VERSION the default) only to find that it's secret > knowledge that gcc builds are broken except on x86. > > IMO there's less than zero value in universe targets that don't work > unless they are clearly fenced. > > I propose disabling all the others and adding a flag to ignore this > guard. I've implemented this in https://reviews.freebsd.org/D45230 -- Brooks From nobody Fri May 17 18:46:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgwsw205Jz5LcJK; Fri, 17 May 2024 18:46:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vgwsw16s8z4p97; Fri, 17 May 2024 18:46:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715971604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qF32+mnx1lb28jOnAiwcE18b7uoRoqskwytWsMMUTEo=; b=Sbi614RY5II3ak3y65/sq2/0wqQ4e5dc+NAjAg1yyDb6Uog0WoQqV0kmAoneE/UZLR2PIY zzC5yh055s/ERgc9+KrJ8Moa5ZsHegVfSyEnrImWrig9WBQjwEgeIUyFc2T71e2a8T8Olw R2dW66OBayZyPne/rR4T8v8f+zbxk4B8U+YvBvm9Xti3pwIeZZan5xi4Ef8AvxrO2F6S0h qhnGC/Hu+pynKZnOHFSbRa8Oc5TdC9Su1wRWDVZpm5VwEXp7P3rK+vEiVo93euxx2g2aZi IR5w6YfjWZSA0l4a5abSEsE7ZE8fmyD6nv1wcfMDyHspYB+gBM67lKZi+x8R+Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715971604; a=rsa-sha256; cv=none; b=mph3W+i0VZUYhqv2WoCs7cHEQgzHHGJ8K/gx0EsCLiBlRC9HIEGaBFHry7mhTA0HnEtuIS 801hxoA9ghLK85Gv2LqeW7ruwOTSYZru/cKmo0Y+10v5Ky/p6oDDqJ0MWsAm6HMeozWaiK aOGrXUb5Vp8HfHzxBRkyNLftzRWR+eo4f1fwbtge3n470CT7aVQCvlA4qenZuSz84KnL7E /54yG/dXMiECDQZ7YWfJy6huVM0sbCs5cKbMGpuvHeiGjyuzvqg3lRoZxz2O12HoMXkt0B LFYClKkbvtOdgVjyQLJLpEOIuCNnhVv31RBgoiX4BeodaM80qz/2uSdJ92EbvA== 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=1715971604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qF32+mnx1lb28jOnAiwcE18b7uoRoqskwytWsMMUTEo=; b=b3TDPD1D0XB0egpU7a6bMvwxpTANMxvcDcEISilPts3cit0Kvk5TozwoGgKQNLY1IPJ3Jx BJZkfrFvNjL6UsrfJkRprWqXWbyoEPv8uv0q6guQKxd43fAI8ssLsyU3GFYbtCR1XhiYS0 zCflkIiavX4fNlGJ2YqclujcVDN7ZRshd+nIeIOohSHI5a4g7FzPlt/TNPGidHqngSmFbC L/ehKZLc97hqy/S/KLHtk1W7gR5YrkYhlRshPcnCz4ENT8dljmV3kIZGreuVxCuUryaa8+ cQtdQ/vJHQZ2RUHB9hrCI4j+AnHJv1Gsm/aWwz3GBA+ECa8F8ZefsTNp6Q/Acw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vgwsw0k0Fztbw; Fri, 17 May 2024 18:46: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 44HIkhII019023; Fri, 17 May 2024 18:46:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HIkhwE019021; Fri, 17 May 2024 18:46:43 GMT (envelope-from git) Date: Fri, 17 May 2024 18:46:43 GMT Message-Id: <202405171846.44HIkhwE019021@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: 1f2c98c92c65 - releng/14.1 - Revert "Reapply "release.sh: Add -jN to `make release`"" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 1f2c98c92c655c28d2343e049ce33f6b8ca28aec Auto-Submitted: auto-generated The branch releng/14.1 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=1f2c98c92c655c28d2343e049ce33f6b8ca28aec commit 1f2c98c92c655c28d2343e049ce33f6b8ca28aec Author: Colin Percival AuthorDate: 2024-05-17 15:22:30 +0000 Commit: Colin Percival CommitDate: 2024-05-17 16:15:33 +0000 Revert "Reapply "release.sh: Add -jN to `make release`"" Release builds on 14.x have been failing for unclear reasons; the most likely culprit is the recently-enabled parallel release building. Turn it off on the 14.1 release branch to make sure we don't run into any problems with building the release. This is a direct commit to releng/14.1 -- I'm leaving parallel release building turned on in stable/14 so I can try to track down the problems there (and it's also enabled in HEAD, where I haven't seen any failures). This reverts commit db34bbcedbf5b9fe7c015856cd04136923e1ce06. Discussed with: karels Approved by: re (cperciva) --- release/release.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/release/release.sh b/release/release.sh index 3c68f89c2cc3..c9d0203debd4 100755 --- a/release/release.sh +++ b/release/release.sh @@ -89,11 +89,9 @@ env_setup() { SRC_CONF="/dev/null" # The number of make(1) jobs, defaults to the number of CPUs available - # for buildworld, and half of number of CPUs available for buildkernel - # and 'make release'. + # for buildworld, and half of number of CPUs available for buildkernel. WORLD_FLAGS="-j$(sysctl -n hw.ncpu)" KERNEL_FLAGS="-j$(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2))" - RELEASE_FLAGS="-j$(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2))" MAKE_FLAGS="-s" @@ -192,7 +190,7 @@ env_check() { ${CONF_FILES}" RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} \ KERNCONF=\"${KERNEL}\" ${ARCH_FLAGS} ${CONF_FILES}" - RELEASE_RMAKEFLAGS="${ARCH_FLAGS} ${RELEASE_FLAGS} \ + RELEASE_RMAKEFLAGS="${ARCH_FLAGS} \ KERNCONF=\"${KERNEL}\" ${CONF_FILES} ${SRCPORTS} \ WITH_DVD=${WITH_DVD} WITH_VMIMAGES=${WITH_VMIMAGES} \ WITH_CLOUDWARE=${WITH_CLOUDWARE} XZ_THREADS=${XZ_THREADS}" From nobody Fri May 17 18:46:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgwsx2K1yz5LcCY; Fri, 17 May 2024 18:46: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 4Vgwsx1t0Jz4pJW; Fri, 17 May 2024 18:46:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715971605; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Sx1e97tRaHmRpn7hq8s2P/W9j9YWaJd2gYUwrjOOX2k=; b=BP1y4AeVAO+4TgnZy9j2vKXya0pfZFcR0VFSPFmrNuT/jAf9rz5Iq4JUYT7+RrzHJBofxD ao+ElU+vgPruZ6oQ8G0kor4FXlCy9k9VwUkvUI4bUmTk1uo0sXCtsUKAzJnj4Ft078qeEm MMqcIM14Y9k9x5VCbo7UOPY8Kfs0bI25NAK130W6V+5qA33CZ47MsYdE22TwnsZbw0opsl FdowIU9Nk3zi0qbw5Ql0cEDmofAi7eKM4WGy2kLjpL24/4Zjs1B/CrgmqNCH97bR3OjSAy 0IC5AU9f5NnDj6fFQiICZ5mwHqIomCadH7XVWqo7M+R5XjhVg68FAgK4sj1Gkg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715971605; a=rsa-sha256; cv=none; b=wGG2rgmLasMy/SV6YOdq+wL1+krtGjfUYGW6qe9Wm4iaROCdYmujibHBLsWIP7NYE5gLVR 7kT60V46IQQiQIWyLR/rnVI6Ze416YJd9W2UZtCCiihp1DuMJiO+Oa0hivGPX7l5PHLRzg A51HXYMFTlKNXFX/amLJXvAUd8VidwJllylpWsYMGlXSZGUMY8NSKI1ujUuX16+wAJD0ce 7vLH+srLWCiatFlmpiJWv9t7AI0uHJsKZ6dJzyHwXAiqhyfQCrUm57pN2i2EhuPuUHyvbo Aa1eZdtlPgXr8fHwyicB6aVmU3RtB/jLhCTcXX36u5OTxL3+getOwf9tF7Enww== 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=1715971605; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Sx1e97tRaHmRpn7hq8s2P/W9j9YWaJd2gYUwrjOOX2k=; b=Xf5r+CuzhftioNnMLl+Xu9rJNDqU/fudlU3PTgJ/D1QcVMr2GI1IbXJOd2ucHNWsNS9z4Q Feaeu1evK44d4ePACelW0j2dCkkkZX1HXxI2cTCBisUcS3icR/ygzY1+dA93xO3Z7RFZtd Du5Hi5V62I8tufvVjQEXzEmcko18bs0vyv774t4wpQW1Of5QDbA9RksMFx0HzuK6cbsygv 2dNTiQxXx7LCaEFzgL40dLU3ni2KujaH+6CY4EixCE70fKb4gVBYf0zx6Kkt7Qp6XvMhTf VP6+FGCM674QGVzXUCPe4iQor7rbydLh4d+wH68ilKgOjxkqxsVClrcH1hwM7Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vgwsx1VDxztYm; Fri, 17 May 2024 18:46: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 44HIkjIl019068; Fri, 17 May 2024 18:46:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HIkjHB019065; Fri, 17 May 2024 18:46:45 GMT (envelope-from git) Date: Fri, 17 May 2024 18:46:45 GMT Message-Id: <202405171846.44HIkjHB019065@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: 2a964a7fc34e - releng/14.1 - 14.1: update to BETA3 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 2a964a7fc34e43fe29265a5f53c618fb1f4ac4c7 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=2a964a7fc34e43fe29265a5f53c618fb1f4ac4c7 commit 2a964a7fc34e43fe29265a5f53c618fb1f4ac4c7 Author: Colin Percival AuthorDate: 2024-05-17 15:27:12 +0000 Commit: Colin Percival CommitDate: 2024-05-17 16:15:43 +0000 14.1: update to BETA3 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 8816eb174865..76028e28d286 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="14.1" -BRANCH="BETA2" +BRANCH="BETA3" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Fri May 17 19:06:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgxJQ3YtRz5LdXR; Fri, 17 May 2024 19:06:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgxJQ1RdCz4rpR; Fri, 17 May 2024 19:06:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715972774; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UA4ehr+lJtV0nUbb/HSioXxw7mkw4BCknMDKZGEpJ9I=; b=vCp0Fr1avrh2TmE9JrecFQ5Gj0WOZ4qE66vmaVPC6VXVL3myCakGFCvaLcfBJZs0Nf1m8F 4ZPuhATk7+M2HVopvLbKrBBGNqpUNY7lib1okdnYuhWMcwGlLB/OzS96AwXnOJxQchXSmd zCPubFweHQu0uXciJBqxNrR5Eeh3ZmvzXhzawXsTeNW2goJNhFO15dS+y/Tz2CpIXnGSrJ barcdVGFrsl1P4AFlZNTZQN2p/MrND8WYOw1dgQbaZ+tV1/Hdf3k039kfGsLiDF/JmmLDZ DTWBYt7nTfobIKelMYkqipJqXuBFVYGxIOTevR00dKGdCSINoOPj1DkuGlI0Qw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715972774; a=rsa-sha256; cv=none; b=sMtP7zkpNhhN9IfV0MXUNZUTRX1tJL+E1aTaTU6kYKPS1JbY6iLRxDjm+hx8LJJ7KtZGUQ 3RBO4h8zouX/5Uea+tYi62UqhNuq76vPM7sLZzAR1PN7tN+8lJOpAS/UKjYoglhysJEhOM 0sgkTk657cOrvnfdqIthHWkJuQT/zMEJZ9XBN2bKTvqiY54lsEmt2/fkAXt0KY582uWvMB da6VFZ9aKc6rBlhALx/0pATLJAktGXq8Ni4a7p09B6FThUEYYEOFYT9e3wUrLi3UP9HYRo mIKgeYg+OsehOAdyC3wt1iUL+Zdw5xBZJYx7Tm4MxLji0Xi581ZAd2qIyIxVMg== 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=1715972774; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UA4ehr+lJtV0nUbb/HSioXxw7mkw4BCknMDKZGEpJ9I=; b=wcAgGPk8ljMMWMlGOV3sz522ukXY047zyV2GlL/FesWCCkxfCKyKVLpxcvoYtJGoULHnCx UCMa6osNBl2ZBJb50LWxFsGwOB/+L1b6f09L2K1YHN+YiWqyqAFE7K2C0LxfO831Ozhn0Y BNLWBadz+Ngr/sLjPZov23MmhSY4AR6AEMbaNEGwtURl249GnTfVC7RIEPujjXJ+mlVd5R pkzdlpatP8k9gPvVF/tcyk5bhQsNx2G03FhsMoo2/y4ZdToJDbKo0lHQnGOZ9viUrZhzoP ImN7VnIuzQbFrgE3FyJxrEdohZXCx84Rh3qoTbAJI3nu4K6n+yhduqbhYCfAHQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgxJQ10SDztvZ; Fri, 17 May 2024 19:06:14 +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 44HJ6EiK054530; Fri, 17 May 2024 19:06:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HJ6EtE054527; Fri, 17 May 2024 19:06:14 GMT (envelope-from git) Date: Fri, 17 May 2024 19:06:14 GMT Message-Id: <202405171906.44HJ6EtE054527@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 25db7bd2fac1 - main - libgcc_s: fix nonsense defines List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 25db7bd2fac18bc6083939a5300d1ae5f0d50b74 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=25db7bd2fac18bc6083939a5300d1ae5f0d50b74 commit 25db7bd2fac18bc6083939a5300d1ae5f0d50b74 Author: Brooks Davis AuthorDate: 2024-05-17 18:49:24 +0000 Commit: Brooks Davis CommitDate: 2024-05-17 19:05:36 +0000 libgcc_s: fix nonsense defines These symbols are present on amd64 or i386. Reported by: kaktus, jhibbits Fixes: 98c8caafffb65 libgcc_s: 80-bit long double function are x86-only --- lib/libgcc_s/Symbol.map | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/libgcc_s/Symbol.map b/lib/libgcc_s/Symbol.map index 00b0ed789cf1..e8f7e824adaf 100644 --- a/lib/libgcc_s/Symbol.map +++ b/lib/libgcc_s/Symbol.map @@ -154,17 +154,17 @@ GCC_3.4.4 { GCC_4.0.0 { __divdc3; __divsc3; -#if defined(__amd64__) && define(__i386__) +#if defined(__amd64__) || defined(__i386__) __divxc3; #endif __muldc3; __mulsc3; -#if defined(__amd64__) && define(__i386__) +#if defined(__amd64__) || defined(__i386__) __mulxc3; #endif __powidf2; __powisf2; -#if defined(__amd64__) && define(__i386__) +#if defined(__amd64__) || defined(__i386__) __powixf2; #endif }; @@ -172,7 +172,7 @@ GCC_4.0.0 { GCC_4.2.0 { __floatundidf; __floatundisf; -#if defined(__amd64__) && define(__i386__) +#if defined(__amd64__) || defined(__i386__) __floatundixf; #endif _Unwind_GetIPInfo; From nobody Fri May 17 19:30:48 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgxrm5bstz5LgBP; Fri, 17 May 2024 19:30: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 4Vgxrm58KQz4tVd; Fri, 17 May 2024 19:30:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715974248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+NzdisA4dtTGSR0GgWfRMaADF2kBcgPicxvuxPZcxKM=; b=CvXqpgxTsGA6w2WaD5zSnnbmsRyBXl64eUF9s4nTrEw1+s4LaO3vMI2axuPZ4syiHCVqYn UP1e5MiWQ6U6cDhHl+T/qpaeTB3WNAFlhcISQ+bbkKppPT5n6tagsCe0tgezlv80k0yBXu ZdxlAsNLzw0SjmCluVuPCDovlZ8O7H1NM75abmlJsABb7BNmFOouVu6DxU4yMVvIf7HtWP Rt+cx3/H0768oR45V6VNr4v33kzc+/guS1g+6COjl3DJCWLRHhm6X2hqMR4cn/LLHJq0Bs R1KrPRvJdBvevRC2rm6laKjphgrALD6+lezasUp3MavCZ58NT49+A6b2OdG7kw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974248; a=rsa-sha256; cv=none; b=dG1HlbsQHdxDBH+N1Q+oTWaBNdSRLcCd59A4Jg3DlPLtOMFOR7P6/nMGjVCujF2PZ3k0WO 1F8OWxz1NN/T8b2VeIvJ0SZbUOmgVLkw9GdGNId51MEB9fqEt/RnSwn3vIlNwTZ1RnlIDk 8QGIveVqTwYcNmOUoSfkvAJXQiotuO2UL5FZgbsFJEzGErCzFfCBl6jhkFZPhbHa/90zHZ 6Kkjcy/EjHLAoR/giwzETwDUycCZH9wyAN1AZ7iB28NIqaAmQRBm24bDwkvtTl7jwfiwxX VpG6RrVnZaFjjkpfHt28S5UIGXq9MmbcVWUVh9s0poVTWTE2S+6JA+o8vR63tA== 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=1715974248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+NzdisA4dtTGSR0GgWfRMaADF2kBcgPicxvuxPZcxKM=; b=cDBpLEHt5kD0Bv9Wb/bXW8dL1OcpUGU8tvNFMCSc3TJ4vOz4oPZglvkXQqeymYzRcTJ1AT BQP6uCPDyCDoQlbot69RwzGcfdhlKErhnwaq0G/l1arK2hmx36kyBDEjBEexEob9YaKz95 9U2OR/0FdwbS709Zu7FSMGDcOwzfId3LSFhf67k0iYsAvS7Q7lXDwnU20XVEM1vGrTDz+q yFIPUukdXglfhOPIZ6NZcjcvgXx+6Q+hCcpikaPffNnDOBcclNHri0j57vYddBpep8gH8S kylONEQFgm1XIR3jEzcHwrQxNdITsO3tVPMLZEmEm0PW4YVeI77rE5ZAzsEz6g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vgxrm4lbBzvqx; Fri, 17 May 2024 19:30: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 44HJUmnI099114; Fri, 17 May 2024 19:30:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HJUm28099111; Fri, 17 May 2024 19:30:48 GMT (envelope-from git) Date: Fri, 17 May 2024 19:30:48 GMT Message-Id: <202405171930.44HJUm28099111@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 8771127d75a1 - stable/14 - sound: Be more verbose with virtual channel descriptions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8771127d75a1295dd32abd0022ff3750bc564706 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=8771127d75a1295dd32abd0022ff3750bc564706 commit 8771127d75a1295dd32abd0022ff3750bc564706 Author: Christos Margiolis AuthorDate: 2024-04-18 20:34:45 +0000 Commit: Christos Margiolis CommitDate: 2024-05-17 19:30:01 +0000 sound: Be more verbose with virtual channel descriptions Non-virtual channel description denote "play" or "record", so do the same for virtual ones as well. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D44839 (cherry picked from commit d0032e6a9e6596302bf129d7f68a627a02c6cd0a) --- sys/dev/sound/pcm/sound.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 2057c7572ad6..83248efd3f37 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -461,7 +461,7 @@ pcm_chn_create(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t c max = SND_MAXHWCHAN; break; case PCMDIR_PLAY_VIRTUAL: - dirs = "virtual"; + dirs = "virtual_play"; direction = PCMDIR_PLAY; pnum = &d->pvchancount; device = SND_DEV_DSPHW_VPLAY; @@ -475,7 +475,7 @@ pcm_chn_create(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t c max = SND_MAXHWCHAN; break; case PCMDIR_REC_VIRTUAL: - dirs = "virtual"; + dirs = "virtual_record"; direction = PCMDIR_REC; pnum = &d->rvchancount; device = SND_DEV_DSPHW_VREC; From nobody Fri May 17 19:30:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgxrn6tYgz5Lg8P; Fri, 17 May 2024 19:30: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 4Vgxrn6Hj2z4v1d; Fri, 17 May 2024 19:30:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715974249; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IPVu2ipqLE1sI4FMGH2cULNSKgAT76ljSn2TErzyFMA=; b=QVbjmrQpFxa0cetkDN1P9lp/NGCOedRmrlGggEq9kArjP14MGww/ZiwICRI8DZg3pp13iw bfI7V+QAe5bxzz5kzSO61UZGmU7l037oawmGsOFObFe4QkTyEGg1Ysw+I7JSr/1jDaIHhV kS+4PQBbmVX5u5sI2lJyGpsH8BAAmzzssd3AdEVB+s6jXDQV3XxI1VjXTmhNUO3/2PKGZG u+YSFkAVRUjKEyosiwUQ9WiaRN4aPZHqvweHkMK//FnTALaZeXcZQGTb5pCBTMNYPTDLHY +zhB88MGtvgTWEwC6CmLo2Hu5JAdOLERoN3UD4kMUM31ye3HLRUXhgC9lX7dSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974249; a=rsa-sha256; cv=none; b=t2hl4qfVijRwfr8TxLV/iDGwWIZrvNrt6yL0vW2C7NKgCUry1Zq8VT0hYbDPW+nHHenJzD tzSbQluDeRasMs6y9hfcTdh5smBdX0JroAOaB/MJn3cCtnas0buYguRWf3cDIDo0qKion1 vjYg6tYWdvVmu2ehYEVhasNHZWzWwZ9b5acRaHtCo5d1ol99fRAEi88lfN2X9D7zIukY2y zU3v7vir7FQP4U1y2GroO5/qBgYAUTyqTFt7pbVRemDrDhZN64Et3iS6sopIRUJyohIL/2 Xnyg8rJoaJMpijgGuz+MalmFMRO1niu2ZjItIgJhx0apWGNqGnGjg0fSMlSCXQ== 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=1715974249; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IPVu2ipqLE1sI4FMGH2cULNSKgAT76ljSn2TErzyFMA=; b=OQ9n15hxRmuz2Mxg9XUdpId2XvVYzFlpfhk4Q1slOMC+iUwH1xjdz4bLDkgjdoFh/tDorr w4l6UoytyrKlxioL1rcBIpoFcBgFFwpT8fVhRfwG7v1ei00PedTXwLodTv+7eZ4Sp9HbDC nwKtlENqjqqcLoz3MAR5mJNmFOekCPJ66S7MWOK2HqQT8gkUBcK07hrWuoIOpd/d1lU1qs DbfqdCfPHb7SXztmLJMtGKTmRMPTT3leVoPRZNuEQCoxdAXoNmx+I+OeWFY3I34pgTQwTx HSSJQKNr7waR1jjN2lZ8x2my3E+jSfHzXCnF+uOJUBDg9bvEv6+EWNI9RwMeeA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vgxrn5tz7zvqy; Fri, 17 May 2024 19:30: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 44HJUnZs099170; Fri, 17 May 2024 19:30:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HJUn0U099167; Fri, 17 May 2024 19:30:49 GMT (envelope-from git) Date: Fri, 17 May 2024 19:30:49 GMT Message-Id: <202405171930.44HJUn0U099167@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 69707d9f5091 - stable/14 - sound: Call device_get_name() and device_get_unit() only once in mixer_init() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 69707d9f509175e4b79ef046798226f79c3787f4 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=69707d9f509175e4b79ef046798226f79c3787f4 commit 69707d9f509175e4b79ef046798226f79c3787f4 Author: Christos Margiolis AuthorDate: 2024-04-18 20:35:01 +0000 Commit: Christos Margiolis CommitDate: 2024-05-17 19:30:01 +0000 sound: Call device_get_name() and device_get_unit() only once in mixer_init() No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D44840 (cherry picked from commit 41ab202ff74ea6af7e9125c9dfb430c729380f41) --- sys/dev/sound/pcm/mixer.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c index 0645089ac503..24fc5678af71 100644 --- a/sys/dev/sound/pcm/mixer.c +++ b/sys/dev/sound/pcm/mixer.c @@ -726,14 +726,17 @@ mixer_init(device_t dev, kobj_class_t cls, void *devinfo) struct snd_mixer *m; u_int16_t v; struct cdev *pdev; + const char *name; int i, unit, devunit, val; snddev = device_get_softc(dev); if (snddev == NULL) return (-1); - if (resource_int_value(device_get_name(dev), - device_get_unit(dev), "eq", &val) == 0 && val != 0) { + name = device_get_name(dev); + unit = device_get_unit(dev); + if (resource_int_value(name, unit, "eq", &val) == 0 && + val != 0) { snddev->flags |= SD_F_EQ; if ((val & SD_F_EQ_MASK) == val) snddev->flags |= val; @@ -749,8 +752,8 @@ mixer_init(device_t dev, kobj_class_t cls, void *devinfo) for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) { v = snd_mixerdefaults[i]; - if (resource_int_value(device_get_name(dev), - device_get_unit(dev), snd_mixernames[i], &val) == 0) { + if (resource_int_value(name, unit, snd_mixernames[i], + &val) == 0) { if (val >= 0 && val <= 100) { v = (u_int16_t) val; } @@ -761,7 +764,6 @@ mixer_init(device_t dev, kobj_class_t cls, void *devinfo) mixer_setrecsrc(m, 0); /* Set default input. */ - unit = device_get_unit(dev); devunit = snd_mkunit(unit, SND_DEV_CTL, 0); pdev = make_dev(&mixer_cdevsw, PCMMINOR(devunit), UID_ROOT, GID_WHEEL, 0666, "mixer%d", unit); From nobody Fri May 17 19:30:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgxrq1D5vz5LgBS; Fri, 17 May 2024 19:30: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 4Vgxrq089Bz4tnC; Fri, 17 May 2024 19:30:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715974251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uCLZ8sJ7kYlg9Y20+L3DOuIqDsxnaNeaX9SkzJFDLEo=; b=HBO+J1/A+ZPg6tMIoaPBR7iMIqhY3QZ0PJFkOQAbxY6vBLXd/0Nyy6d7KHkcPL8KVSSXuz DGEKbU9xPJdJyyJ8mhR3WYE5q46dCoBfovhHvRJLU8CYJuJAYgiQpIcGynl+fNy7dA5PiS yWlfgXPoUb6KTsePqvMBidKiDFt2va84zUZJ10gYrX+v18EPpF+qtF0BVAn/TriyNr3yUo nPXTG5r0IBK8pc5zQ/VL9GJtq54s6gTi9igELd425J1s4UwqNqMspRO3sOMnORBCoUWUgD BEQJSdMWL2dATD1ckjqW4hQIK9NRNlUii9YJ/cq56SCtgpaSZ7sx3A6+b3YWWw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974251; a=rsa-sha256; cv=none; b=yyBwkzLvT7EIsC0w/uQs4psLytkhxuNienKhG4S81zMAc9buYvSPTp9brbwHQWtmdlEAft GrwYYv22hvwHxu46TGnxq4n4Cqp35Td766qku1idEtKYfOIRb3GX9vuOFfuHlBKV/xu5bG ZvwER3bILe6o4PGkR4lL8UBsR8941zBxicUEKs+MSbes+2B92oSzttznGvtV1upeVX3xIk +grlKBmIezTXJ4XQbj8Oq3dtahslX38upHYzGBQUvcDRNQBHS4otB3Cn3gPNP3rrUHtTij GOwRoBNyeWrNbDEXLJGjIWyy6OdHdlzX8Izsdj2Dx3R29wjmLSpBg1TfTMgV0g== 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=1715974251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uCLZ8sJ7kYlg9Y20+L3DOuIqDsxnaNeaX9SkzJFDLEo=; b=YUu1TDnJlZ+25PTl/6XXRmS7J84A29a6Okcq47xY3pHxpzKufqse26P1P4ZvUQeNqqnrZf gYFOyyzeiNhxyCZlKn7w1xR1iXNsp/Si9i3nyOIPwVZ8jmQITUw0IGA5xftDQbD3nZeT/6 c5M9yhR9NcEfIROgWO0sMvjuIt3F9yb7oV7m8jljZ+PLLTNhFLLZZEHH1Q5wRp5cr6lpsB FbgZM4Pa0MDvt9jyQSJqgqA1RQdb10qaV5Qupd37us2xZnX9zX8HWP+h4bAoep3y7r6rs1 qUY2ewf4Na3drjxc4Zs2ebMzlkUpvcKeo8nvBq6VBc4XY/eHUaGQ8d3kfO9Z0w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vgxrp6tFWzvgb; Fri, 17 May 2024 19:30: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 44HJUoNB099212; Fri, 17 May 2024 19:30:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HJUoEs099209; Fri, 17 May 2024 19:30:50 GMT (envelope-from git) Date: Fri, 17 May 2024 19:30:50 GMT Message-Id: <202405171930.44HJUoEs099209@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: d27972ec911d - stable/14 - sound: Get rid of snddev_info->devcount List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d27972ec911d09379bfbd400a7e7e7ebd4a595ec Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=d27972ec911d09379bfbd400a7e7e7ebd4a595ec commit d27972ec911d09379bfbd400a7e7e7ebd4a595ec Author: Christos Margiolis AuthorDate: 2024-04-18 20:35:06 +0000 Commit: Christos Margiolis CommitDate: 2024-05-17 19:30:01 +0000 sound: Get rid of snddev_info->devcount snddev_info->devcount keeps track of the total number of channels for a given device. However, it is redundant to have it, since it is only used in sound_oss_sysinfo() to populate the "numaudios" field, and we also keep track of the channel counts in the playcount, pvchancount, reccount and rvchancount fields anyway. We can simply sum those fields together instead of updating a separate variable upon every channel addition/deletion. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D44852 (cherry picked from commit 4d2be7be3837d66ba242a0a7fd51632c3f89285d) --- sys/dev/sound/pcm/sound.c | 7 +------ sys/dev/sound/pcm/sound.h | 5 ++++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 83248efd3f37..92ff041d0fb9 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -602,8 +602,6 @@ pcm_chn_add(struct snddev_info *d, struct pcm_channel *ch) break; } - d->devcount++; - return (0); } @@ -644,8 +642,6 @@ pcm_chn_remove(struct snddev_info *d, struct pcm_channel *ch) break; } - d->devcount--; - return (0); } @@ -974,7 +970,6 @@ pcm_register(device_t dev, void *devinfo, int numplay, int numrec) d->flags |= SD_F_BITPERFECT; d->devinfo = devinfo; - d->devcount = 0; d->reccount = 0; d->playcount = 0; d->pvchancount = 0; @@ -1137,7 +1132,7 @@ sound_oss_sysinfo(oss_sysinfo *si) PCM_UNLOCKASSERT(d); PCM_LOCK(d); - si->numaudios += d->devcount; + si->numaudios += PCM_CHANCOUNT(d); ++ncards; CHN_FOREACH(c, d, channels.pcm) { diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index b48aed7c2d6e..3b725603ee2b 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -175,6 +175,9 @@ struct snd_mixer; #define PCM_DETACHING(x) ((x)->flags & SD_F_DETACHING) +#define PCM_CHANCOUNT(d) \ + (d->playcount + d->pvchancount + d->reccount + d->rvchancount) + /* many variables should be reduced to a range. Here define a macro */ #define RANGE(var, low, high) (var) = \ (((var)<(low))? (low) : ((var)>(high))? (high) : (var)) @@ -367,7 +370,7 @@ struct snddev_info { } opened; } pcm; } channels; - unsigned devcount, playcount, reccount, pvchancount, rvchancount ; + unsigned playcount, reccount, pvchancount, rvchancount; unsigned flags; unsigned int bufsz; void *devinfo; From nobody Fri May 17 19:30:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgxrr4B6Wz5LfyT; Fri, 17 May 2024 19:30: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 4Vgxrr15rJz4tyc; Fri, 17 May 2024 19:30:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715974252; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+MRPVHO4RddqituVD2jQrGtTnql5yEgKOtckRSAjPyc=; b=ak2RTNlkhQ09qpTP5UVV3bUEd0ZiEmxicFdu5ixO0orO8KmELMWO5O9FhCFAlOTerqL83p 6h1V2E/o7kXpSu4tCm1w2kl+oO2nWwJsHCNxsgWY9+UYmNF6IlYWqz5mmfF2nfa0N3jGOB N4PNSzT6KhoZSvjliy9OdFFSZuM3VdMUdnqKhHzVGoMObYel6U2bmC797bo+b6XUX8RGDH kWBKNmMyfgLmSgevO+0kNTbPyOahzRADQxhugxgKjcPpxU0qOo1Ss3uqgbNKLOuunOZCXO LblMZgVT+jahQ/GfKUngNZszKa8vVf3xQEWlekCv8MvYAN2JCZDDm6K/NZfXEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974252; a=rsa-sha256; cv=none; b=TNcX4iC/5d2PnuChbdOAnhzmuO7sI6uVJQd4QqxociMz4ztgKaNGog3NkJb53b2+FDi3ki AjiEj5w2wDd0ECKPiPdfn3aBvn9CAhPw29WyZipfCDrCxiT1Sbb6swI0hapgDyJ6wgrEFE UO/ydyrypVtbr9pLtXY/olvMaZQEyDkuzvMsUq3WW4Hcte959u5PDCAI6R4cqJVjjhmypK qG2J70tqmxLzu+IJMgphzz1TXZ5v0NwDMNhtqGd3aUiXuAeheRb0Km1maHV4VIiptIVmpq dnIrS1RYfW8j4ARyNSjMXFqXiCYNEaPecENz43wX0sbzlSeAaCv5VePMh46oJQ== 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=1715974252; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+MRPVHO4RddqituVD2jQrGtTnql5yEgKOtckRSAjPyc=; b=k4bTbUjJcxwOxB8z8hon8+rIx8vxNmRMYUd9Hn0rsMY0DN8BmxQmTPUcXlAlJgaCo8R2W9 G5ORUD0uwtTR4AFTqmzXIHmY36FncRxSmf1aWE+OxhnHV02TPB569e/JnfcmlVC7248bA/ AQvt57ny0nmUN67OSATlPffAzlQO+N/Y8iFXc0uuVt75dBV9rvBHI52X7zjCc/JGN2+j4P /4Nuh9NR/JVvEBEcHWpFHzvgdiSQv8CnmTvOMTaqq4zDnZxyJe30O/uUjhJWr8MYXsRpxT wgVuYAqzERnbwPqxvv7uXJLdgvRkRLy4eW+3FcQGQeA9J1EUDQBcP4yOmyVB+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 4Vgxrr0XckzvsK; Fri, 17 May 2024 19:30: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 44HJUpqW099248; Fri, 17 May 2024 19:30:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HJUp0S099245; Fri, 17 May 2024 19:30:51 GMT (envelope-from git) Date: Fri, 17 May 2024 19:30:51 GMT Message-Id: <202405171930.44HJUp0S099245@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: decc224ab899 - stable/14 - sound: Remove PCMMINOR() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: decc224ab8993797473a5d37d60588a021965d2f Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=decc224ab8993797473a5d37d60588a021965d2f commit decc224ab8993797473a5d37d60588a021965d2f Author: Christos Margiolis AuthorDate: 2024-04-18 20:35:15 +0000 Commit: Christos Margiolis CommitDate: 2024-05-17 19:30:01 +0000 sound: Remove PCMMINOR() It's a NO-OP. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D44854 (cherry picked from commit 8b97dce6973ca1b6c3407c34c76d459f43ca1061) --- sys/dev/sound/pci/emu10kx.c | 2 +- sys/dev/sound/pcm/mixer.c | 4 ++-- sys/dev/sound/pcm/sound.h | 3 --- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/sys/dev/sound/pci/emu10kx.c b/sys/dev/sound/pci/emu10kx.c index 6bbbfcc1df0e..d17f5fb16d34 100644 --- a/sys/dev/sound/pci/emu10kx.c +++ b/sys/dev/sound/pci/emu10kx.c @@ -2313,7 +2313,7 @@ emu10kx_dev_init(struct emu_sc_info *sc) mtx_init(&sc->emu10kx_lock, device_get_nameunit(sc->dev), "kxdevlock", 0); unit = device_get_unit(sc->dev); - sc->cdev = make_dev(&emu10kx_cdevsw, PCMMINOR(unit), UID_ROOT, GID_WHEEL, 0640, "emu10kx%d", unit); + sc->cdev = make_dev(&emu10kx_cdevsw, unit, UID_ROOT, GID_WHEEL, 0640, "emu10kx%d", unit); if (sc->cdev != NULL) { sc->cdev->si_drv1 = sc; return (0); diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c index 24fc5678af71..2f4a6f4d6395 100644 --- a/sys/dev/sound/pcm/mixer.c +++ b/sys/dev/sound/pcm/mixer.c @@ -765,8 +765,8 @@ mixer_init(device_t dev, kobj_class_t cls, void *devinfo) mixer_setrecsrc(m, 0); /* Set default input. */ devunit = snd_mkunit(unit, SND_DEV_CTL, 0); - pdev = make_dev(&mixer_cdevsw, PCMMINOR(devunit), - UID_ROOT, GID_WHEEL, 0666, "mixer%d", unit); + pdev = make_dev(&mixer_cdevsw, devunit, UID_ROOT, GID_WHEEL, 0666, + "mixer%d", unit); pdev->si_drv1 = m; snddev->mixer_dev = pdev; diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index 3b725603ee2b..b72348ccf486 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -115,9 +115,6 @@ struct snd_mixer; #define PCMDEV(x) (snd_unit2d(dev2unit(x))) #define PCMCHAN(x) (snd_unit2c(dev2unit(x))) -/* XXX unit2minor compat */ -#define PCMMINOR(x) (x) - /* * By design, limit possible channels for each direction. */ From nobody Fri May 17 19:30:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgxrt4mZHz5LgBX; Fri, 17 May 2024 19:30: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 4Vgxrt2nbgz4tp3; Fri, 17 May 2024 19:30:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715974254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2ofk2AUjxbH8V7vKLjEUqvwpmlug8AJDvv7idfcTQdU=; b=iddt9AgTnlodxRwCN2wgkYuWat8+SHybGdhphcKSMtk24RQChl7yKl8IqAXjIQTpztxKWz TUJ2OLZnyVoT0vL2XHGYsWc1HtZsuGqXXY9EGhwgZ1aPGjewKt+U3gOz9l+xN1KpS6Ci2v Zxksu1O5L+F3Tx3kAWiT4uobbvx+OCzoOweduzknz2Pz0CVVpKElTxTAHhgpyapzqsEjjM EL5fF1aXZmeCaEIwlCqX3iN31Wxgy7rn2orgmSgrXXkRLGSHE7QuzkOn2cXv0nmG/LM0lb O8bNCgpo7Jb5jTDExB2x5u7BIwvPNGuzW8AFN2ltyn3w4+WiGtvu8PKZbzFTcA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974254; a=rsa-sha256; cv=none; b=NL8oGS0Zk6k8/DlGmQ01x84BL1Huw3mwm/u9/3McbqzTfdeXk4EIrobKRwp2KwXoFjS2GH yIqxZUTel24m0P+zI3FBzyAcJ9TMVofCNVE4h0LF7BxHzD82yGEOc+n501TOXXlv78RQUP QGkd4mBriE4FBDSh3ivV81os59EcYcwD3wBP64BnjZxPIGmqRRoO1s6epaSNfm//pssuCx OUndvdA8R+FkFNSrFqnTXgkxQUOx09c+X70P5HPj7r4HROARk3EroZUxjUDuU4nbgPgKC1 wK575+4ZxRP7S9dKjM2j1qOK3FjLLghCq2bJA1JF2tqBEPWdUYypkoFejiWa0A== 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=1715974254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2ofk2AUjxbH8V7vKLjEUqvwpmlug8AJDvv7idfcTQdU=; b=bBhVrdIk5gpqRzF/0/m+BNP5oMV/Cfh9KRReYEMqTLgeTqyQoJI5yBUzqWSJCY69AFvz1R QRfv3caz6jAjcPBOcWnBeMJyfi0/6YNq8shdXcPwwjJK8gfCTw1beGj8WELZAzyHhF/M/u paudGGuTdxBkBV7tqE5dY1GtkQLY0O9w79oSHYAcLIjtA9EZLUO1MIbLlBuOWjnDwfCrEj NZmb4NirVfGGXeDuePwhpYt1WOQI3Ui2ETeybZwYpW6H7E44TDNorP87foX86irPA+jIma YlcGLn1efyKThX0L8w26GjmBhf0o/b/bvr4qLbcQLh8v4V3SqOhExtKj2PBthw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vgxrt26XYzvgc; Fri, 17 May 2024 19:30: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 44HJUsNr099342; Fri, 17 May 2024 19:30:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HJUsfj099339; Fri, 17 May 2024 19:30:54 GMT (envelope-from git) Date: Fri, 17 May 2024 19:30:54 GMT Message-Id: <202405171930.44HJUsfj099339@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 41dee6355556 - stable/14 - sound: Remove obsolete DV_F_* flags List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 41dee63555560f06175dfd80ef25c8ef7cc5199c Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=41dee63555560f06175dfd80ef25c8ef7cc5199c commit 41dee63555560f06175dfd80ef25c8ef7cc5199c Author: Christos Margiolis AuthorDate: 2024-04-18 20:35:26 +0000 Commit: Christos Margiolis CommitDate: 2024-05-17 19:30:01 +0000 sound: Remove obsolete DV_F_* flags The ISA sound drivers that used them are retired. Last reference of DV_F_DRQ_MASK and DV_F_DUAL_DMA: 716924cb4832ea0a440daf09913a06f3166f243e ("Retire snd_sbc ISA sound card driver") Last reference of DV_F_DEV_MASK and DV_F_DEV_SHIFT: 5126e5eeeb5e07ceef3c809452a8c9f508b2d4d1 ("Retire snd_mss ISA sound card driver") Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D44858 (cherry picked from commit 1b82d425ec0ac155765bcdf706040534309e9c94) --- sys/dev/sound/pcm/sound.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index b72348ccf486..fe310a3be3d6 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -341,14 +341,6 @@ void snd_mtxassert(void *m); int sndstat_register(device_t dev, char *str); int sndstat_unregister(device_t dev); -/* usage of flags in device config entry (config file) */ -#define DV_F_DRQ_MASK 0x00000007 /* mask for secondary drq */ -#define DV_F_DUAL_DMA 0x00000010 /* set to use secondary dma channel */ - -/* ought to be made obsolete but still used by mss */ -#define DV_F_DEV_MASK 0x0000ff00 /* force device type/class */ -#define DV_F_DEV_SHIFT 8 /* force device type/class */ - /* * this is rather kludgey- we need to duplicate these struct def'ns from sound.c * so that the macro versions of pcm_{,un}lock can dereference them. From nobody Fri May 17 19:30:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgxrt2g9sz5LgBT; Fri, 17 May 2024 19:30: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 4Vgxrt0FWBz4v45; Fri, 17 May 2024 19:30:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715974254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tanRaRI0FkXJd5M+tFqRJryC9SRGAiLHjtkZsGlVYeU=; b=SooYoFCjiu9uh2UEstjQGrF4UnZ91z1K9e7e+FHOIHiK5vd34p1paV8+yoB7c+aRn4p5dY DtxuEXq5sATGV8PW2JCkkwEcHKvzs83lH+5stwbtafS/YUEopzWjQ2nHFFYYAxPBm+ZgwG vFaTBGRgZ9nEwH2Ssz3LxWYVfjVl6NDgWPvNAOXld3PSs6Yc6kt1Qc6l7fIEpRJOwlaWWy WEjMNR2Rus/lYCcpcH+A080Bk3KodybVP+l38DNRApoAPOk13LI4a9c59GOGcOt4IQpoP7 Bp/OK5jLqfNcNBlhT5Tg1dQOuzlGVs+fHJFJ81irs9QWHkIs5Y2paawrjx6aJA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974254; a=rsa-sha256; cv=none; b=R18QlYcl6KrxSUAnXn5Qv5/QLAGT1A3rT4Mv5rGD5JtB1SK1lcPR9vos7eEwksE7AbHZ19 Oim/RmNFwSNtMNKkX0bb8nOTJ3XsvLWVpeJRjNWZfSKHXORdE3pbuNEqPXcCw4X4GK5HvH Y12gew+q5/snvbLIfUwobnGvuPUCu600JO1j5b9apa1D3ooDMThQNslzub+tehtFPnkoc7 nAK3yg62Hsr8dbslY9qC6qhqhpwfmxliS00/hnrALFvNfjDPK0StMZmrRENJmtkjaKNVye hQmn4t1cZEcpOgNXl3eP1Kh5z7Hb4KnmQhObw6hVdv1k48xd/JnQhhqZVwek3Q== 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=1715974254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tanRaRI0FkXJd5M+tFqRJryC9SRGAiLHjtkZsGlVYeU=; b=wMlSN3AHFk1yp6GnXsvL1JSxY0Xr4M+dq6zvE5smKWf/vwj6dGnPWoeY9rGVtjsg01v5k6 eMaOJhlQx2NdRes177kp2elq/4iKdO0C9qZLqBLhZLNeDlZmrPY9mfpL0DQJlVvtoeOQl4 W0rSjdSDADLoawnZpzPtOQVKMX8g4BDFr4jKX8RM2josOPan8/w4GvtSGipdpbUDApOioO 4Yl3QJy63ZvV56MqMNDP7/NahxDYMxMtIYmw3wyrGbdHx4xmQapx3bXFhPQCni2K9pTVSE d00tVPcJOOZBJIYN4inZD4g6cAJM3uLJJb9s/oQSFGM+QWTjOCkWElPzWGHcPQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vgxrs1Xqszvy8; Fri, 17 May 2024 19:30: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 44HJUrNx099300; Fri, 17 May 2024 19:30:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HJUrgb099297; Fri, 17 May 2024 19:30:53 GMT (envelope-from git) Date: Fri, 17 May 2024 19:30:53 GMT Message-Id: <202405171930.44HJUrgb099297@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 98157281725b - stable/14 - sound: Simplify unit fetching in dsp_oss_audioinfo() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 98157281725b3eed5612753d8150b3edfd01c1b5 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=98157281725b3eed5612753d8150b3edfd01c1b5 commit 98157281725b3eed5612753d8150b3edfd01c1b5 Author: Christos Margiolis AuthorDate: 2024-04-18 20:35:20 +0000 Commit: Christos Margiolis CommitDate: 2024-05-17 19:30:01 +0000 sound: Simplify unit fetching in dsp_oss_audioinfo() "i" keeps the value of the current unit, so we do not have to call PCMUNIT() and device_get_unit() to fetch it. In the mixer case, I think it is more correct to do it like this, since mixer and DSP device units have a 1-1 relationship (i.e the mixer unit is always the same as the corresponding DSP device one) and that way we can make it more clear. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D44855 (cherry picked from commit a44c45c7f597d67d37e09396b0778a2847a30981) --- sys/dev/sound/pcm/dsp.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index aa6c21f36601..df1482d6a97a 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -2185,7 +2185,7 @@ dsp_oss_audioinfo(struct cdev *i_dev, oss_audioinfo *ai) struct pcm_channel *ch; struct snddev_info *d; uint32_t fmts; - int i, nchan, *rates, minch, maxch; + int i, nchan, *rates, minch, maxch, unit; char *devname, buf[CHN_NAMELEN]; /* @@ -2205,9 +2205,9 @@ dsp_oss_audioinfo(struct cdev *i_dev, oss_audioinfo *ai) * Search for the requested audio device (channel). Start by * iterating over pcm devices. */ - for (i = 0; pcm_devclass != NULL && - i < devclass_get_maxunit(pcm_devclass); i++) { - d = devclass_get_softc(pcm_devclass, i); + for (unit = 0; pcm_devclass != NULL && + unit < devclass_get_maxunit(pcm_devclass); unit++) { + d = devclass_get_softc(pcm_devclass, unit); if (!PCM_REGISTERED(d)) continue; @@ -2332,14 +2332,13 @@ dsp_oss_audioinfo(struct cdev *i_dev, oss_audioinfo *ai) * @todo @c port_number - routing information? */ ai->port_number = -1; - ai->mixer_dev = (d->mixer_dev != NULL) ? PCMUNIT(d->mixer_dev) : -1; + ai->mixer_dev = (d->mixer_dev != NULL) ? unit : -1; /** * @note * @c real_device - OSSv4 docs: "Obsolete." */ ai->real_device = -1; - snprintf(ai->devnode, sizeof(ai->devnode), - "/dev/dsp%d", device_get_unit(d->dev)); + snprintf(ai->devnode, sizeof(ai->devnode), "/dev/dsp%d", unit); ai->enabled = device_is_attached(d->dev) ? 1 : 0; /** * @note From nobody Fri May 17 19:30:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgxrw01Zvz5LgBy; Fri, 17 May 2024 19:30:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vgxrv3dqGz4tt9; Fri, 17 May 2024 19:30:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715974255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uKrPHBfQF/MujOobbr/JGdfe4TMuyY92QS4BoWDS3Xs=; b=tB+TQgaS+n2xOe/oW2+OGyXCp6THpkrKXo/hO4XuEFarR+08CS78wgR4Kp+IcBQ6gh8hPk HiPVzYWdYp3G7PDZV7+NOtvUH2rmXOaT0uBN45G1rm8C/U15wSwZbukAKTEiktzDBmMu+J weu18vNRa5Ff003E+igK9beyVD2piTtGqaaxTjJ4zmSZ/ntCt+Un3jVB6riDWWs2DQj3jl 9g5RUHPvuKcFJYKo7+sz7sX3j5A2XXv2MRwUBv51HziFc8sNlWGOFY8euvcpvc8vkxeZym 5QR9FwTJkrvwJKK4khDsSSMuxVcROaBFYmZB/fyB+UGesL0HcWB1NzReHBKvAg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974255; a=rsa-sha256; cv=none; b=TFwZucZrEe79e5+x7QqIj9fJ8Ym7vCtxpo+5KfIWSj0W37NIX3zHS9g346WQHMjVRxjYlz ZEnBTWgb2s1ubuUckBSIVBY4Gq9z/Vzvp8cMYU/eqkCE4QGW47EV8Ds0S7ygpm6FcyowRW AFNbK91DW2hU3AF8AKSLIu9QQwL3UQyMwwzjr6zIFPby5sPdejxKlOlynjgIbWWjQAi0wZ S950Q4/EeSwIkpuGFqw8u59YdeT4IGVnYhSpUoLlCg5VO+PrqlUfG5+W6bZ8+4hr9PbvIe Vo3OYTISgXk0SXX8ZHqNvO68g+sMMVsU55mRGlx2GWZZX18Mpp6NPSJ9U8VLcQ== 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=1715974255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uKrPHBfQF/MujOobbr/JGdfe4TMuyY92QS4BoWDS3Xs=; b=d4wl1V1xSdvsg+DXjtoOYnI2UzUJVy1xvkJfK8/hRAzNzS7oLa34hzSAyOalfHIWMPtKqh JZBhyAss4WmL/8Uv+dmkunXxI1OuCR11ccHDbTkV+f/t2PhYZigNKmb2YK3I6ITt0kUfav F8z1pgkA8Gtfe8YFdWhLHUmj/AAiB6CqPfZwZq2E8/SVQugI01ewcJK0nON6qGDrFGY73S Uvopt69FAMD7rvcrfzqC5YzFVLlBadHbCNQChITf2OsTXnMBRebsnaz1sPWVxpRNCMtjfC TI1bzZNtq/nwpHx+z6TMi/9YEvatK59riumicVkOELvQJu0CLCpFk8uDvrg4/A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vgxrv2qJ9zvgf; Fri, 17 May 2024 19:30: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 44HJUtUX099378; Fri, 17 May 2024 19:30:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HJUtCo099375; Fri, 17 May 2024 19:30:55 GMT (envelope-from git) Date: Fri, 17 May 2024 19:30:55 GMT Message-Id: <202405171930.44HJUtCo099375@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: ad677fb457bb - stable/14 - sound: Retire unit.* List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ad677fb457bbd8556c3efe1f7f682e61e2d54431 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=ad677fb457bbd8556c3efe1f7f682e61e2d54431 commit ad677fb457bbd8556c3efe1f7f682e61e2d54431 Author: Christos Margiolis AuthorDate: 2024-04-28 19:44:35 +0000 Commit: Christos Margiolis CommitDate: 2024-05-17 19:30:25 +0000 sound: Retire unit.* The unit.* code is largely obsolete and imposes limits that are no longer needed nowadays. - Capping the maximum allowed soundcards in a given machine. By default, the limit is 512 (snd_max_u() in unit.c), and the maximum possible is 2048 (SND_UNIT_UMAX in unit.h). It can also be tuned through the hw.snd.maxunit loader(8) tunable. Even though these limits are large enough that they should never cause problems, there is no need for this limit to exist in the first place. - Capping the available device/channel types. By default, this is 32 (snd_max_d() in unit.c). However, these types are pre-defined in pcm/sound.h (see SND_DEV_*), so the cap is unnecessary when we know that their number is constant. - Capping the number of channels per-device. By default, the limit 1024 (snd_max_c() in unit.c). This is probably the most problematic of the limits mentioned, because this limit can never be reached, as the maximum is hard-capped at either hw.snd.maxautovchans (16 by default), or SND_MAXHWCHAN and SND_MAXVCHANS. These limtits are encoded in masks (see SND_U_MASK, SND_D_MASK, SND_C_MASK in unit.h) and are used to construct a bitfield of the form [dsp_unit, type, channel_unit] in snd_mkunit() which is assigned to pcm_channel->unit. This patch gets rid of everything unit.*-related and makes a slightly different use of the "unit" field to only contain the channel unit number. The channel type is stored in a new pcm_channel->type field, and the DSP unit number need not be stored at all, since we can fetch it from device_get_unit(pcm_channel->dev). This change has the effect that we no longer need to impose caps on the number of soundcards, device/channel types and per-device channels. As a result the code is noticeably simplified and more readable. Apart from the fact that the hw.snd.maxunit loader(8) tunable is also retired as a side-effect of this patch, sound(4)'s behavior remains the same. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D44912 (cherry picked from commit 25723d66369fe6786e9e4f5f77381b944755f267) --- sys/conf/files | 1 - sys/dev/sound/pcm/channel.h | 9 +- sys/dev/sound/pcm/dsp.c | 98 +++----------------- sys/dev/sound/pcm/dsp.h | 2 +- sys/dev/sound/pcm/feeder.c | 4 +- sys/dev/sound/pcm/mixer.c | 5 +- sys/dev/sound/pcm/sound.c | 144 ++++++++++-------------------- sys/dev/sound/pcm/sound.h | 18 +--- sys/dev/sound/pcm/vchan.c | 2 +- sys/dev/sound/unit.c | 188 --------------------------------------- sys/dev/sound/unit.h | 52 ----------- sys/modules/sound/sound/Makefile | 2 +- 12 files changed, 71 insertions(+), 454 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index c4e9f0698c4f..7d3c44893e09 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -3060,7 +3060,6 @@ dev/smc/if_smc.c optional smc dev/smc/if_smc_acpi.c optional smc acpi dev/smc/if_smc_fdt.c optional smc fdt dev/snp/snp.c optional snp -dev/sound/unit.c optional sound dev/sound/pci/als4000.c optional snd_als4000 pci dev/sound/pci/atiixp.c optional snd_atiixp pci dev/sound/pci/cmi.c optional snd_cmi pci diff --git a/sys/dev/sound/pcm/channel.h b/sys/dev/sound/pcm/channel.h index c8d33c583188..d4f73275ed39 100644 --- a/sys/dev/sound/pcm/channel.h +++ b/sys/dev/sound/pcm/channel.h @@ -104,6 +104,7 @@ struct pcm_channel { void *devinfo; device_t dev; int unit; + int type; char name[CHN_NAMELEN]; char comm[MAXCOMLEN + 1]; struct mtx *lock; @@ -224,7 +225,7 @@ struct pcm_channel { #define CHN_INSERT_SORT(w, x, y, z) do { \ struct pcm_channel *t, *a = NULL; \ CHN_FOREACH(t, x, z) { \ - if ((y)->unit w t->unit) \ + if ((y)->type w t->type) \ a = t; \ else \ break; \ @@ -235,13 +236,9 @@ struct pcm_channel { CHN_INSERT_HEAD(x, y, z); \ } while (0) -#define CHN_INSERT_SORT_ASCEND(x, y, z) CHN_INSERT_SORT(>, x, y, z) +#define CHN_INSERT_SORT_ASCEND(x, y, z) CHN_INSERT_SORT(>=, x, y, z) #define CHN_INSERT_SORT_DESCEND(x, y, z) CHN_INSERT_SORT(<, x, y, z) -#define CHN_UNIT(x) (snd_unit2u((x)->unit)) -#define CHN_DEV(x) (snd_unit2d((x)->unit)) -#define CHN_CHAN(x) (snd_unit2c((x)->unit)) - #define CHN_BUF_PARENT(x, y) \ (((x) != NULL && (x)->parentchannel != NULL && \ (x)->parentchannel->bufhard != NULL) ? \ diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index df1482d6a97a..448ecb183298 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -444,7 +444,7 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) if (DSP_F_READ(flags)) { /* open for read */ rderror = pcm_chnalloc(d, &rdch, PCMDIR_REC, - td->td_proc->p_pid, td->td_proc->p_comm, -1); + td->td_proc->p_pid, td->td_proc->p_comm); if (rderror == 0 && chn_reset(rdch, fmt, spd) != 0) rderror = ENXIO; @@ -472,7 +472,7 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) if (DSP_F_WRITE(flags)) { /* open for write */ wrerror = pcm_chnalloc(d, &wrch, PCMDIR_PLAY, - td->td_proc->p_pid, td->td_proc->p_comm, -1); + td->td_proc->p_pid, td->td_proc->p_comm); if (wrerror == 0 && chn_reset(wrch, fmt, spd) != 0) wrerror = ENXIO; @@ -629,69 +629,13 @@ dsp_write(struct cdev *i_dev, struct uio *buf, int flag) return (dsp_io_ops(priv, buf)); } -static int -dsp_get_volume_channel(struct dsp_cdevpriv *priv, struct pcm_channel **volch) -{ - struct snddev_info *d; - struct pcm_channel *c; - int unit; - - KASSERT(volch != NULL, - ("%s(): NULL query priv=%p volch=%p", __func__, priv, volch)); - - d = priv->sc; - if (!PCM_REGISTERED(d)) { - *volch = NULL; - return (EINVAL); - } - - PCM_UNLOCKASSERT(d); - - *volch = NULL; - - c = priv->volch; - if (c != NULL) { - if (!(c->feederflags & (1 << FEEDER_VOLUME))) - return (-1); - *volch = c; - return (0); - } - - PCM_LOCK(d); - PCM_WAIT(d); - PCM_ACQUIRE(d); - - unit = dev2unit(d->dsp_dev); - - CHN_FOREACH(c, d, channels.pcm) { - CHN_LOCK(c); - if (c->unit != unit) { - CHN_UNLOCK(c); - continue; - } - *volch = c; - pcm_chnref(c, 1); - priv->volch = c; - CHN_UNLOCK(c); - PCM_RELEASE(d); - PCM_UNLOCK(d); - return ((c->feederflags & (1 << FEEDER_VOLUME)) ? 0 : -1); - } - - PCM_RELEASE(d); - PCM_UNLOCK(d); - - return (EINVAL); -} - static int dsp_ioctl_channel(struct dsp_cdevpriv *priv, struct pcm_channel *volch, u_long cmd, caddr_t arg) { struct snddev_info *d; struct pcm_channel *rdch, *wrch; - int j, devtype, ret; - int left, right, center, mute; + int j, left, right, center, mute; d = priv->sc; if (!PCM_REGISTERED(d) || !(pcm_getflags(d->dev) & SD_F_VPC)) @@ -716,19 +660,6 @@ dsp_ioctl_channel(struct dsp_cdevpriv *priv, struct pcm_channel *volch, volch = wrch; } - devtype = PCMDEV(d->dsp_dev); - - /* Look super harder */ - if (volch == NULL && - (devtype == SND_DEV_DSPHW_PLAY || devtype == SND_DEV_DSPHW_VPLAY || - devtype == SND_DEV_DSPHW_REC || devtype == SND_DEV_DSPHW_VREC)) { - ret = dsp_get_volume_channel(priv, &volch); - if (ret != 0) - return (ret); - if (volch == NULL) - return (EINVAL); - } - /* Final validation */ if (volch == NULL) return (EINVAL); @@ -2105,8 +2036,6 @@ dsp_sysinit(void *p) { if (dsp_ehtag != NULL) return; - /* initialize unit numbering */ - snd_unit_init(); dsp_ehtag = EVENTHANDLER_REGISTER(dev_clone, dsp_clone, 0, 1000); } @@ -2123,20 +2052,19 @@ SYSINIT(dsp_sysinit, SI_SUB_DRIVERS, SI_ORDER_MIDDLE, dsp_sysinit, NULL); SYSUNINIT(dsp_sysuninit, SI_SUB_DRIVERS, SI_ORDER_MIDDLE, dsp_sysuninit, NULL); char * -dsp_unit2name(char *buf, size_t len, int unit) +dsp_unit2name(char *buf, size_t len, struct pcm_channel *ch) { - int i, dtype; + int i; KASSERT(buf != NULL && len != 0, ("bogus buf=%p len=%ju", buf, (uintmax_t)len)); - dtype = snd_unit2d(unit); - for (i = 0; i < nitems(dsp_cdevs); i++) { - if (dtype != dsp_cdevs[i].type || dsp_cdevs[i].alias != NULL) + if (ch->type != dsp_cdevs[i].type || dsp_cdevs[i].alias != NULL) continue; - snprintf(buf, len, "%s%d%s%d", dsp_cdevs[i].name, - snd_unit2u(unit), dsp_cdevs[i].sep, snd_unit2c(unit)); + snprintf(buf, len, "%s%d%s%d", + dsp_cdevs[i].name, device_get_unit(ch->dev), + dsp_cdevs[i].sep, ch->unit); return (buf); } @@ -2224,12 +2152,10 @@ dsp_oss_audioinfo(struct cdev *i_dev, oss_audioinfo *ai) if (devfs_foreach_cdevpriv(i_dev, dsp_oss_audioinfo_cb, ch) != 0) { devname = dsp_unit2name(buf, - sizeof(buf), ch->unit); + sizeof(buf), ch); } - } else if (ai->dev == nchan) { - devname = dsp_unit2name(buf, sizeof(buf), - ch->unit); - } + } else if (ai->dev == nchan) + devname = dsp_unit2name(buf, sizeof(buf), ch); if (devname != NULL) break; CHN_UNLOCK(ch); diff --git a/sys/dev/sound/pcm/dsp.h b/sys/dev/sound/pcm/dsp.h index 6098c0641eb5..b81e60dc19b5 100644 --- a/sys/dev/sound/pcm/dsp.h +++ b/sys/dev/sound/pcm/dsp.h @@ -35,7 +35,7 @@ extern struct cdevsw dsp_cdevsw; int dsp_make_dev(device_t); void dsp_destroy_dev(device_t); -char *dsp_unit2name(char *, size_t, int); +char *dsp_unit2name(char *, size_t, struct pcm_channel *); int dsp_oss_audioinfo(struct cdev *, oss_audioinfo *); #endif /* !_PCMDSP_H_ */ diff --git a/sys/dev/sound/pcm/feeder.c b/sys/dev/sound/pcm/feeder.c index 8278a85948a8..78443ad76140 100644 --- a/sys/dev/sound/pcm/feeder.c +++ b/sys/dev/sound/pcm/feeder.c @@ -82,9 +82,7 @@ feeder_register(void *p) if (snd_verbose < 0 || snd_verbose > 4) snd_verbose = 1; - /* initialize unit numbering */ - snd_unit_init(); - if (snd_unit < 0 || snd_unit > PCMMAXUNIT) + if (snd_unit < 0) snd_unit = -1; if (snd_maxautovchans < 0 || diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c index 2f4a6f4d6395..3e197b120c9d 100644 --- a/sys/dev/sound/pcm/mixer.c +++ b/sys/dev/sound/pcm/mixer.c @@ -727,7 +727,7 @@ mixer_init(device_t dev, kobj_class_t cls, void *devinfo) u_int16_t v; struct cdev *pdev; const char *name; - int i, unit, devunit, val; + int i, unit, val; snddev = device_get_softc(dev); if (snddev == NULL) @@ -764,8 +764,7 @@ mixer_init(device_t dev, kobj_class_t cls, void *devinfo) mixer_setrecsrc(m, 0); /* Set default input. */ - devunit = snd_mkunit(unit, SND_DEV_CTL, 0); - pdev = make_dev(&mixer_cdevsw, devunit, UID_ROOT, GID_WHEEL, 0666, + pdev = make_dev(&mixer_cdevsw, SND_DEV_CTL, UID_ROOT, GID_WHEEL, 0666, "mixer%d", unit); pdev->si_drv1 = m; snddev->mixer_dev = pdev; diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 92ff041d0fb9..652f59494697 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -244,98 +244,63 @@ pcm_setvchans(struct snddev_info *d, int direction, int newcnt, int num) /* return error status and a locked channel */ int pcm_chnalloc(struct snddev_info *d, struct pcm_channel **ch, int direction, - pid_t pid, char *comm, int devunit) + pid_t pid, char *comm) { struct pcm_channel *c; int err, vchancount, vchan_num; + bool retry; - KASSERT(d != NULL && ch != NULL && (devunit == -1 || - !(devunit & ~(SND_U_MASK | SND_D_MASK | SND_C_MASK))) && + KASSERT(d != NULL && ch != NULL && (direction == PCMDIR_PLAY || direction == PCMDIR_REC), - ("%s(): invalid d=%p ch=%p direction=%d pid=%d devunit=%d", - __func__, d, ch, direction, pid, devunit)); + ("%s(): invalid d=%p ch=%p direction=%d pid=%d", + __func__, d, ch, direction, pid)); PCM_BUSYASSERT(d); - /* Double check again. */ - if (devunit != -1) { - switch (snd_unit2d(devunit)) { - case SND_DEV_DSPHW_PLAY: - case SND_DEV_DSPHW_VPLAY: - if (direction != PCMDIR_PLAY) - return (ENOTSUP); - break; - case SND_DEV_DSPHW_REC: - case SND_DEV_DSPHW_VREC: - if (direction != PCMDIR_REC) - return (ENOTSUP); - break; - default: - if (!(direction == PCMDIR_PLAY || - direction == PCMDIR_REC)) - return (ENOTSUP); - break; - } - } - *ch = NULL; vchan_num = 0; vchancount = (direction == PCMDIR_PLAY) ? d->pvchancount : d->rvchancount; + retry = false; retry_chnalloc: err = ENOTSUP; /* scan for a free channel */ CHN_FOREACH(c, d, channels.pcm) { CHN_LOCK(c); - if (devunit == -1 && c->direction == direction && - (c->flags & CHN_F_VIRTUAL)) { + if (c->direction == direction && (c->flags & CHN_F_VIRTUAL)) { if (vchancount < snd_maxautovchans && - vchan_num < CHN_CHAN(c)) { + vchan_num < c->unit) { CHN_UNLOCK(c); goto vchan_alloc; } vchan_num++; } - if (c->direction == direction && !(c->flags & CHN_F_BUSY) && - (devunit == -1 || devunit == -2 || c->unit == devunit)) { + if (c->direction == direction && !(c->flags & CHN_F_BUSY)) { c->flags |= CHN_F_BUSY; c->pid = pid; strlcpy(c->comm, (comm != NULL) ? comm : CHN_COMM_UNKNOWN, sizeof(c->comm)); *ch = c; return (0); - } else if (c->unit == devunit) { - if (c->direction != direction) - err = ENOTSUP; - else if (c->flags & CHN_F_BUSY) - err = EBUSY; - else - err = EINVAL; - CHN_UNLOCK(c); - return (err); - } else if ((devunit == -1 || devunit == -2) && - c->direction == direction && (c->flags & CHN_F_BUSY)) + } else if (c->direction == direction && (c->flags & CHN_F_BUSY)) err = EBUSY; CHN_UNLOCK(c); } - if (devunit == -2) + /* + * We came from retry_chnalloc and still didn't find a free channel. + */ + if (retry) return (err); vchan_alloc: /* no channel available */ - if (devunit == -1 || snd_unit2d(devunit) == SND_DEV_DSPHW_VPLAY || - snd_unit2d(devunit) == SND_DEV_DSPHW_VREC) { - if (!(vchancount > 0 && vchancount < snd_maxautovchans) && - (devunit == -1 || snd_unit2c(devunit) < snd_maxautovchans)) - return (err); - err = pcm_setvchans(d, direction, vchancount + 1, - (devunit == -1) ? -1 : snd_unit2c(devunit)); - if (err == 0) { - if (devunit == -1) - devunit = -2; - goto retry_chnalloc; - } + if (!(vchancount > 0 && vchancount < snd_maxautovchans)) + return (err); + err = pcm_setvchans(d, direction, vchancount + 1, -1); + if (err == 0) { + retry = true; + goto retry_chnalloc; } return (err); @@ -445,7 +410,7 @@ pcm_chn_create(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t c { struct pcm_channel *ch; int direction, err, rpnum, *pnum, max; - int udc, device, chan; + int type, unit; char *dirs, *devname, buf[CHN_NAMELEN]; PCM_BUSYASSERT(d); @@ -457,56 +422,54 @@ pcm_chn_create(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t c dirs = "play"; direction = PCMDIR_PLAY; pnum = &d->playcount; - device = SND_DEV_DSPHW_PLAY; + type = SND_DEV_DSPHW_PLAY; max = SND_MAXHWCHAN; break; case PCMDIR_PLAY_VIRTUAL: dirs = "virtual_play"; direction = PCMDIR_PLAY; pnum = &d->pvchancount; - device = SND_DEV_DSPHW_VPLAY; + type = SND_DEV_DSPHW_VPLAY; max = SND_MAXVCHANS; break; case PCMDIR_REC: dirs = "record"; direction = PCMDIR_REC; pnum = &d->reccount; - device = SND_DEV_DSPHW_REC; + type = SND_DEV_DSPHW_REC; max = SND_MAXHWCHAN; break; case PCMDIR_REC_VIRTUAL: dirs = "virtual_record"; direction = PCMDIR_REC; pnum = &d->rvchancount; - device = SND_DEV_DSPHW_VREC; + type = SND_DEV_DSPHW_VREC; max = SND_MAXVCHANS; break; default: return (NULL); } - chan = (num == -1) ? 0 : num; + unit = (num == -1) ? 0 : num; - if (*pnum >= max || chan >= max) + if (*pnum >= max || unit >= max) return (NULL); rpnum = 0; CHN_FOREACH(ch, d, channels.pcm) { - if (CHN_DEV(ch) != device) + if (ch->type != type) continue; - if (chan == CHN_CHAN(ch)) { - if (num != -1) { - device_printf(d->dev, - "channel num=%d allocated!\n", chan); - return (NULL); - } - chan++; - if (chan >= max) { - device_printf(d->dev, - "chan=%d > %d\n", chan, max); - return (NULL); - } + if (unit == ch->unit && num != -1) { + device_printf(d->dev, + "channel num=%d allocated!\n", unit); + return (NULL); + } + unit++; + if (unit >= max) { + device_printf(d->dev, + "chan=%d > %d\n", unit, max); + return (NULL); } rpnum++; } @@ -518,25 +481,24 @@ pcm_chn_create(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t c return (NULL); } - udc = snd_mkunit(device_get_unit(d->dev), device, chan); - devname = dsp_unit2name(buf, sizeof(buf), udc); - - if (devname == NULL) { - device_printf(d->dev, - "Failed to query device name udc=0x%08x\n", udc); - return (NULL); - } - PCM_UNLOCK(d); ch = malloc(sizeof(*ch), M_DEVBUF, M_WAITOK | M_ZERO); ch->methods = kobj_create(cls, M_DEVBUF, M_WAITOK | M_ZERO); - ch->unit = udc; + ch->type = type; + ch->unit = unit; ch->pid = -1; strlcpy(ch->comm, CHN_COMM_UNUSED, sizeof(ch->comm)); ch->parentsnddev = d; ch->parentchannel = parent; ch->dev = d->dev; ch->trigger = PCMTRIG_STOP; + devname = dsp_unit2name(buf, sizeof(buf), ch); + if (devname == NULL) { + device_printf(d->dev, "Failed to query device name"); + kobj_delete(ch->methods, M_DEVBUF); + free(ch, M_DEVBUF); + return (NULL); + } snprintf(ch->name, sizeof(ch->name), "%s:%s:%s", device_get_nameunit(ch->dev), dirs, devname); @@ -585,7 +547,7 @@ pcm_chn_add(struct snddev_info *d, struct pcm_channel *ch) CHN_INSERT_SORT_ASCEND(d, ch, channels.pcm); - switch (CHN_DEV(ch)) { + switch (ch->type) { case SND_DEV_DSPHW_PLAY: d->playcount++; break; @@ -625,7 +587,7 @@ pcm_chn_remove(struct snddev_info *d, struct pcm_channel *ch) CHN_REMOVE(d, ch, channels.pcm); - switch (CHN_DEV(ch)) { + switch (ch->type) { case SND_DEV_DSPHW_PLAY: d->playcount--; break; @@ -939,14 +901,6 @@ pcm_register(device_t dev, void *devinfo, int numplay, int numrec) return EINVAL; } - if (device_get_unit(dev) > PCMMAXUNIT) { - device_printf(dev, "PCMMAXUNIT reached : unit=%d > %d\n", - device_get_unit(dev), PCMMAXUNIT); - device_printf(dev, - "Use 'hw.snd.maxunit' tunable to raise the limit.\n"); - return ENODEV; - } - d = device_get_softc(dev); d->dev = dev; d->lock = snd_mtxcreate(device_get_nameunit(dev), "sound cdev"); diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index fe310a3be3d6..1f2dda880742 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -88,7 +88,6 @@ struct snd_mixer; #include #include #include -#include #define PCM_SOFTC_SIZE (sizeof(struct snddev_info)) @@ -100,21 +99,6 @@ struct snd_mixer; #define SOUND_PREFVER SOUND_MODVER #define SOUND_MAXVER SOUND_MODVER -/* - * We're abusing the fact that MAXMINOR still have enough room - * for our bit twiddling and nobody ever need 512 unique soundcards, - * 32 unique device types and 1024 unique cloneable devices for the - * next 100 years... - */ - -#define PCMMAXUNIT (snd_max_u()) -#define PCMMAXDEV (snd_max_d()) -#define PCMMAXCHAN (snd_max_c()) - -#define PCMUNIT(x) (snd_unit2u(dev2unit(x))) -#define PCMDEV(x) (snd_unit2d(dev2unit(x))) -#define PCMCHAN(x) (snd_unit2c(dev2unit(x))) - /* * By design, limit possible channels for each direction. */ @@ -311,7 +295,7 @@ SYSCTL_DECL(_hw_snd); int pcm_setvchans(struct snddev_info *d, int direction, int newcnt, int num); int pcm_chnalloc(struct snddev_info *d, struct pcm_channel **ch, int direction, - pid_t pid, char *comm, int devunit); + pid_t pid, char *comm); int pcm_chnrelease(struct pcm_channel *c); int pcm_chnref(struct pcm_channel *c, int ref); diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c index d10c3ff4aabb..ac5a0535ddce 100644 --- a/sys/dev/sound/pcm/vchan.c +++ b/sys/dev/sound/pcm/vchan.c @@ -923,7 +923,7 @@ vchan_sync(struct pcm_channel *c) if (snd_passthrough_verbose != 0) { char *devname, buf[CHN_NAMELEN]; - devname = dsp_unit2name(buf, sizeof(buf), c->unit); + devname = dsp_unit2name(buf, sizeof(buf), c); device_printf(c->dev, "%s(%s/%s) %s() -> re-sync err=%d\n", __func__, (devname != NULL) ? devname : "dspX", c->comm, diff --git a/sys/dev/sound/unit.c b/sys/dev/sound/unit.c deleted file mode 100644 index 28ffbde1f7ec..000000000000 --- a/sys/dev/sound/unit.c +++ /dev/null @@ -1,188 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2007 Ariff Abdullah - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -#include - -#ifdef HAVE_KERNEL_OPTION_HEADERS -#include "opt_snd.h" -#endif - -#include - -/* - * Unit magic allocator for sound driver. - * - * 'u' = Unit of attached soundcards - * 'd' = Device type - * 'c' = Channel number - * - * eg: dsp0.p1 - u=0, d=p, c=1 - * dsp1.vp0 - u=1, d=vp, c=0 - * - * Maximum unit of soundcards can be tuned through "hw.snd.maxunit", which is - * between SND_UNIT_UMIN (16) and SND_UNIT_UMAX (2048). By design, the maximum - * allowable allocated channel is 256. - */ - -/* Default width */ -static int snd_u_shift = 9; /* 0 - 0x1ff : 512 distinct soundcards */ -static int snd_d_shift = 5; /* 0 - 0x1f : 32 distinct device types */ -static int snd_c_shift = 10; /* 0 - 0x3ff : 1024 distinct channels - (256 limit "by design") */ - -static int snd_unit_initialized = 0; - -#ifdef SND_DIAGNOSTIC -#define SND_UNIT_ASSERT() do { \ - if (snd_unit_initialized == 0) \ - panic("%s(): Uninitialized sound unit!", __func__); \ -} while (0) -#else -#define SND_UNIT_ASSERT() KASSERT(snd_unit_initialized != 0, \ - ("%s(): Uninitialized sound unit!", \ - __func__)) -#endif - -#define MKMASK(x) ((1 << snd_##x##_shift) - 1) - -int -snd_max_u(void) -{ - SND_UNIT_ASSERT(); - - return (MKMASK(u)); -} - -int -snd_max_d(void) -{ - SND_UNIT_ASSERT(); - - return (MKMASK(d)); -} - -int -snd_max_c(void) -{ - SND_UNIT_ASSERT(); - - return (MKMASK(c)); -} - -int -snd_unit2u(int unit) -{ - SND_UNIT_ASSERT(); - - return ((unit >> (snd_c_shift + snd_d_shift)) & MKMASK(u)); -} - -int -snd_unit2d(int unit) -{ - SND_UNIT_ASSERT(); - - return ((unit >> snd_c_shift) & MKMASK(d)); -} - -int -snd_unit2c(int unit) -{ - SND_UNIT_ASSERT(); - - return (unit & MKMASK(c)); -} - -int -snd_u2unit(int u) -{ - SND_UNIT_ASSERT(); - - return ((u & MKMASK(u)) << (snd_c_shift + snd_d_shift)); -} - -int -snd_d2unit(int d) -{ - SND_UNIT_ASSERT(); - - return ((d & MKMASK(d)) << snd_c_shift); -} - -int -snd_c2unit(int c) -{ - SND_UNIT_ASSERT(); - - return (c & MKMASK(c)); -} - -int -snd_mkunit(int u, int d, int c) -{ - SND_UNIT_ASSERT(); - - return ((c & MKMASK(c)) | ((d & MKMASK(d)) << snd_c_shift) | - ((u & MKMASK(u)) << (snd_c_shift + snd_d_shift))); -} - -/* - * This *must* be called first before any of the functions above!!! - */ -void -snd_unit_init(void) -{ - int i; - - if (snd_unit_initialized != 0) - return; - - snd_unit_initialized = 1; - - if (getenv_int("hw.snd.maxunit", &i) != 0) { - if (i < SND_UNIT_UMIN) - i = SND_UNIT_UMIN; - else if (i > SND_UNIT_UMAX) - i = SND_UNIT_UMAX; - else - i = roundup2(i, 2); - - for (snd_u_shift = 0; (i >> (snd_u_shift + 1)) != 0; - snd_u_shift++) - ; - - /* Make room for channels to fit within 24bit MAXMINOR limit. */ - snd_c_shift = 24 - snd_u_shift - snd_d_shift; - } - - if (bootverbose != 0) - printf("%s() u=0x%08x [%d] d=0x%08x [%d] c=0x%08x [%d]\n", - __func__, SND_U_MASK, snd_max_u() + 1, - SND_D_MASK, snd_max_d() + 1, SND_C_MASK, snd_max_c() + 1); -} diff --git a/sys/dev/sound/unit.h b/sys/dev/sound/unit.h deleted file mode 100644 index 9ddd68a2fe04..000000000000 --- a/sys/dev/sound/unit.h +++ /dev/null @@ -1,52 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2007 Ariff Abdullah - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef _SND_UNIT_H_ -#define _SND_UNIT_H_ - -#define SND_UNIT_UMIN 16 -#define SND_UNIT_UMAX 2048 - -int snd_max_u(void); -int snd_max_d(void); -int snd_max_c(void); -int snd_unit2u(int); -int snd_unit2d(int); -int snd_unit2c(int); -int snd_u2unit(int); -int snd_d2unit(int); -int snd_c2unit(int); -int snd_mkunit(int, int, int); - -void snd_unit_init(void); - -#define SND_U_MASK (snd_u2unit(snd_max_u())) -#define SND_D_MASK (snd_d2unit(snd_max_d())) -#define SND_C_MASK (snd_c2unit(snd_max_c())) - -#endif /* !_SND_UNIT_H_ */ diff --git a/sys/modules/sound/sound/Makefile b/sys/modules/sound/sound/Makefile index 833330ef9b26..1c3685715503 100644 --- a/sys/modules/sound/sound/Makefile +++ b/sys/modules/sound/sound/Makefile @@ -17,7 +17,7 @@ SRCS+= feeder_eq_gen.h feeder_rate_gen.h snd_fxdiv_gen.h SRCS+= mpu_if.h mpufoi_if.h synth_if.h SRCS+= mpu_if.c mpufoi_if.c synth_if.c SRCS+= ac97.c ac97_patch.c buffer.c channel.c dsp.c -SRCS+= mixer.c sndstat.c sound.c unit.c vchan.c +SRCS+= mixer.c sndstat.c sound.c vchan.c SRCS+= midi.c mpu401.c sequencer.c feeder_eq_gen.h: ${SYSDIR}/tools/sound/feeder_eq_mkfilter.awk From nobody Fri May 17 19:30:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgxrx29HPz5Lfn7; Fri, 17 May 2024 19: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 4Vgxrw4w7cz4trT; Fri, 17 May 2024 19: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=1715974256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JLdRCd7pLN6JWK2PeDqKhnHxQdO6ReLpeQ24Xf/Xn9w=; b=MqFdIjB6dMK4CRHy1Hsj6isL56pSpHH/ghVheS53Dr5puTrAG1bmkvxD4hzNnfeM4YzSmk 0gRBUt3QZ1L/7ZBgHlWyV1VAR9qk8+cyiRwLemZVb+cB/2uuCyVUCNi7iuF0qGUSs+ltEM 2XHIw45hITKcWaZoZY6qRlNFCqAcAE/263PhRxb2hIOC9LlGA5uPJQNlV24zKR4I3Q5qh9 YrOFw/nbH41MIK74RUlLWXsMAE2YLhkQn5S8qAcYXq7SyuEBqmTlgW1kRsnzIO9E6dtea1 cATEkFnHtwkjquhpfeLdZAiFbOsh2U9tARtE1BzondS0l5Vh9+smlvXOQLwKjg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974256; a=rsa-sha256; cv=none; b=BluCo6KpB49v9AsJZFNefq1pfRmNIQi8ouDFiFFTuPoNHGH4pBniMnV2GKMkY2EWUifDFg 3NqudcKYBv4WUTjhv+/GoPQcen5Vd6t6yT+G3oVv5JOS1O5HuL8//tsIpw9IX+tZSlcU3/ d/Xak6EEwpWXpnt97GvB3QYRrj1ZENFf5p9dIpZGfMpWUMEB9FNsk+Ntpe/XjudQ4WQe6e FDFN/lhEcIJMvLPsOHvD/sPeB5TdQj4m/dFGG7dY+P8eGX+0hW+7ll5cF3YJZb6HUgf3N0 kYspd4yxeErkVqSezhM9lJF+QLHrMw7yqH/W8gdJfY2lSSz1fshdHsLSAg2N9A== 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=1715974256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JLdRCd7pLN6JWK2PeDqKhnHxQdO6ReLpeQ24Xf/Xn9w=; b=fWleP90tJGJLUoZmOtbX1fO2/eiFr1o+F1mKALaUZhAPeig13UZX5bEehXWPWuvmLYE3QF Ondw1hYFJlegxuaxZba74zBVZJ7dM0xncicXVVKF49qP18FqozJRpM+0viDAD9Par49SPW QsbvqkocVM4VJcPwdgbfieYh7MgJZLlelxLfuGka3H8KUkjPM+fwFZK7fg2b7+mTdpjesg dBHyFG16k6czcVDT67ou/3I9qLgAOJBdkId5bmnLLL3on8snedBS+QO0cWMLs4susBho9u sTDB/rV0DUU0Bg1Bwce43iG8DFK0CxQFdycVweIuDnSWtTjBAIi0KrbmGKgzMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vgxrw4FB7zvr1; Fri, 17 May 2024 19: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 44HJUuFS099420; Fri, 17 May 2024 19: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 44HJUusi099417; Fri, 17 May 2024 19:30:56 GMT (envelope-from git) Date: Fri, 17 May 2024 19:30:56 GMT Message-Id: <202405171930.44HJUusi099417@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 532b1efd2d2e - stable/14 - sound: Merge pcm_chn_destroy() and chn_kill() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 532b1efd2d2e659a488bf147ca817ceabb5d8997 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=532b1efd2d2e659a488bf147ca817ceabb5d8997 commit 532b1efd2d2e659a488bf147ca817ceabb5d8997 Author: Christos Margiolis AuthorDate: 2024-04-28 19:46:08 +0000 Commit: Christos Margiolis CommitDate: 2024-05-17 19:30:34 +0000 sound: Merge pcm_chn_destroy() and chn_kill() pcm_chn_destroy() acts like a wrapper around chn_kill(), and additionally calls a few more functions that should in fact be part of chn_kill()'s logic. Merge pcm_chn_destroy()'s functionality in chn_kill() to improve readability, as well as code layering. While here, convert chn_kill() to void as it currently always returns 0. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D44984 (cherry picked from commit b3ea087c05d8c75978a302cbb3fa92ce1afa3e49) --- sys/dev/sound/pcm/channel.c | 12 +++++++----- sys/dev/sound/pcm/channel.h | 2 +- sys/dev/sound/pcm/sound.c | 26 ++------------------------ sys/dev/sound/pcm/sound.h | 1 - sys/dev/sound/pcm/vchan.c | 6 +++--- 5 files changed, 13 insertions(+), 34 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 1527d5ea3d2c..21a91ff13186 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -1279,11 +1279,13 @@ out: return 0; } -int +void chn_kill(struct pcm_channel *c) { - struct snd_dbuf *b = c->bufhard; - struct snd_dbuf *bs = c->bufsoft; + struct snd_dbuf *b = c->bufhard; + struct snd_dbuf *bs = c->bufsoft; + + PCM_BUSYASSERT(c->parentsnddev); if (CHN_STARTED(c)) { CHN_LOCK(c); @@ -1299,8 +1301,8 @@ chn_kill(struct pcm_channel *c) CHN_LOCK(c); c->flags |= CHN_F_DEAD; chn_lockdestroy(c); - - return (0); + kobj_delete(c->methods, M_DEVBUF); + free(c, M_DEVBUF); } void diff --git a/sys/dev/sound/pcm/channel.h b/sys/dev/sound/pcm/channel.h index d4f73275ed39..45381b907fa2 100644 --- a/sys/dev/sound/pcm/channel.h +++ b/sys/dev/sound/pcm/channel.h @@ -260,7 +260,7 @@ int chn_flush(struct pcm_channel *c); int chn_poll(struct pcm_channel *c, int ev, struct thread *td); int chn_init(struct pcm_channel *c, void *devinfo, int dir, int direction); -int chn_kill(struct pcm_channel *c); +void chn_kill(struct pcm_channel *c); void chn_shutdown(struct pcm_channel *c); int chn_reset(struct pcm_channel *c, u_int32_t fmt, u_int32_t spd); int chn_setvolume_multi(struct pcm_channel *c, int vc, int left, int right, diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 652f59494697..b3ae93b77a5d 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -515,28 +515,6 @@ pcm_chn_create(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t c return (ch); } -int -pcm_chn_destroy(struct pcm_channel *ch) -{ - struct snddev_info *d __diagused; - int err; - - d = ch->parentsnddev; - PCM_BUSYASSERT(d); - - err = chn_kill(ch); - if (err) { - device_printf(ch->dev, "chn_kill(%s) failed, err = %d\n", - ch->name, err); - return (err); - } - - kobj_delete(ch->methods, M_DEVBUF); - free(ch, M_DEVBUF); - - return (0); -} - int pcm_chn_add(struct snddev_info *d, struct pcm_channel *ch) { @@ -630,7 +608,7 @@ pcm_addchan(device_t dev, int dir, kobj_class_t cls, void *devinfo) if (err) { device_printf(d->dev, "pcm_chn_add(%s) failed, err=%d\n", ch->name, err); - pcm_chn_destroy(ch); + chn_kill(ch); } return (err); @@ -678,7 +656,7 @@ pcm_killchans(struct snddev_info *d) error = pcm_chn_remove(d, ch); PCM_UNLOCK(d); if (error == 0) - pcm_chn_destroy(ch); + chn_kill(ch); } while (!CHN_EMPTY(d, channels.pcm)); } diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index 1f2dda880742..70addf32bddd 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -300,7 +300,6 @@ int pcm_chnrelease(struct pcm_channel *c); int pcm_chnref(struct pcm_channel *c, int ref); struct pcm_channel *pcm_chn_create(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, int dir, int num, void *devinfo); -int pcm_chn_destroy(struct pcm_channel *ch); int pcm_chn_add(struct snddev_info *d, struct pcm_channel *ch); int pcm_chn_remove(struct snddev_info *d, struct pcm_channel *ch); diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c index ac5a0535ddce..c3bc36d924bd 100644 --- a/sys/dev/sound/pcm/vchan.c +++ b/sys/dev/sound/pcm/vchan.c @@ -709,7 +709,7 @@ vchan_create(struct pcm_channel *parent, int num) ret = pcm_chn_add(d, ch); PCM_UNLOCK(d); if (ret != 0) { - pcm_chn_destroy(ch); + chn_kill(ch); CHN_LOCK(parent); return (ret); } @@ -837,7 +837,7 @@ vchan_create(struct pcm_channel *parent, int num) PCM_LOCK(d); if (pcm_chn_remove(d, ch) == 0) { PCM_UNLOCK(d); - pcm_chn_destroy(ch); + chn_kill(ch); } else PCM_UNLOCK(d); CHN_LOCK(parent); @@ -890,7 +890,7 @@ vchan_destroy(struct pcm_channel *c) /* destroy ourselves */ if (ret == 0) - ret = pcm_chn_destroy(c); + chn_kill(c); CHN_LOCK(parent); From nobody Fri May 17 19:30:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgxrx6s5Dz5LgNG; Fri, 17 May 2024 19: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 4Vgxrx5VMDz4txD; Fri, 17 May 2024 19:30:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715974257; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DHkaQ+ApWiFrY2/JYHvdKuAChprh/uKlub2QEjupx2A=; b=qp/yIDpeX/X3ZWy2J1GQmL/rakLXa3i4GII4553yYxzmjO/BTrro1Exvk52+QebyEv3ATf Yv4AOblmiQv9xXACyad451odU6YxFmw6dDPbZZhF32ViMxvqXIN/KuxeTbacGs29ubZtG5 KezGsmGMkKqsXoldvm/CKmQ/QrNZk62dXEXAXXDqxo5N2/jRr6jOLvsvoC4bwzTa/o3WGl XuwSSJMqIYHKinxHrNuhiwnv8dQO2uDFLWkdW5YysvvOtAVxwqeu60f75Bn0ph6U+Q9NK/ gHukvBq2kVBmhyNjUASQkTns8R1SXS7XaVPRMsyz+VsPNbld/ZQlSQEwid05wA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974257; a=rsa-sha256; cv=none; b=EFLUltkbQ7cQR0MNOmkfyRCIR9RRKKIxto4pCeDXyra2EEwC7aYzzw058zUCljHW3He2PG ePc5DlZJLpnKRN/lu0WSviz5at5j65byjm2ESaOOQ07fePKkDazIlcBdHnYLLi2tZmIvHo Dht2EWZH5c9okTr9KVvJXlCVR1tBa5DfK7ZlWfABYvkYemBLLrDiWPC/uwVR2Hk6Ak+wud dWnNrX285pMvcaxSG+bh0z8RAm3ZUaPIWPbwFu9DHkEkWP1BxnJjXQa1+YG/tmBelIBIHd uvdL3q04tVtyA29rosPfYLV4VIFfWwJVpOunCRPpWwTFOpgO4y3O2L1fYveBHA== 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=1715974257; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DHkaQ+ApWiFrY2/JYHvdKuAChprh/uKlub2QEjupx2A=; b=a6/OdOhc9g96ODWRXCMOOoRdOyHWAfbXJlMTGOiswxgmqh+8ODPRoY/4Urhh1O2jIbBAy9 JIKjapJss5pEa0TaTaTefrkFE+gRrgbid+LSxucSJ7zUp+60T0TGMFq3PVDIN5ilzm6l7x Td9kUdmCUgPP2Ybe2+2mBe9VpMcXKl+m1nQ6bx1ZcxrSCZP4rp4VMuKIdcqnF/ao6Z3Q7I 1JCwOzvZsV4xC9cektyGouD6pdSwDqEJnXHMuGu0Fk6ID5bi1MmYX1X4sCSaCeOvG8IjzL v1ATmULWMVfKfkTs/0CYgEpiatvKzjHBfYMGFZzWavZoiw9UiZSbpTE3YYO58A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vgxrx54mxzvsN; Fri, 17 May 2024 19:30: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 44HJUvS3099469; Fri, 17 May 2024 19:30:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HJUvvY099466; Fri, 17 May 2024 19:30:57 GMT (envelope-from git) Date: Fri, 17 May 2024 19:30:57 GMT Message-Id: <202405171930.44HJUvvY099466@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 930b5a3c07f2 - stable/14 - sound: Move pcm_chnref() and pcm_chnrelease() to pcm/channel.c List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 930b5a3c07f23c8eafbd9ad73d45cc216841e7d3 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=930b5a3c07f23c8eafbd9ad73d45cc216841e7d3 commit 930b5a3c07f23c8eafbd9ad73d45cc216841e7d3 Author: Christos Margiolis AuthorDate: 2024-04-28 19:46:55 +0000 Commit: Christos Margiolis CommitDate: 2024-05-17 19:30:34 +0000 sound: Move pcm_chnref() and pcm_chnrelease() to pcm/channel.c Improve code layering. These are channel functions, and so they do not belong in pcm/sound.c. While here, assert in chn_ref() that new refcount won't be negative. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D44985 (cherry picked from commit a24050e2b784e13561da3ab731a1db92f2e3366c) --- sys/dev/sound/pcm/channel.c | 28 ++++++++++++++++++++++++++++ sys/dev/sound/pcm/channel.h | 2 ++ sys/dev/sound/pcm/dsp.c | 26 +++++++++++++------------- sys/dev/sound/pcm/sound.c | 26 -------------------------- sys/dev/sound/pcm/sound.h | 2 -- 5 files changed, 43 insertions(+), 41 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 21a91ff13186..0fea169e3eb7 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -1314,6 +1314,34 @@ chn_shutdown(struct pcm_channel *c) c->flags |= CHN_F_DEAD; } +/* release a locked channel and unlock it */ +int +chn_release(struct pcm_channel *c) +{ + PCM_BUSYASSERT(c->parentsnddev); + CHN_LOCKASSERT(c); + + c->flags &= ~CHN_F_BUSY; + c->pid = -1; + strlcpy(c->comm, CHN_COMM_UNUSED, sizeof(c->comm)); + CHN_UNLOCK(c); + + return (0); +} + +int +chn_ref(struct pcm_channel *c, int ref) +{ + PCM_BUSYASSERT(c->parentsnddev); + CHN_LOCKASSERT(c); + KASSERT((c->refcount + ref) >= 0, + ("%s(): new refcount will be negative", __func__)); + + c->refcount += ref; + + return (c->refcount); +} + int chn_setvolume_multi(struct pcm_channel *c, int vc, int left, int right, int center) diff --git a/sys/dev/sound/pcm/channel.h b/sys/dev/sound/pcm/channel.h index 45381b907fa2..698a1186924f 100644 --- a/sys/dev/sound/pcm/channel.h +++ b/sys/dev/sound/pcm/channel.h @@ -262,6 +262,8 @@ int chn_poll(struct pcm_channel *c, int ev, struct thread *td); int chn_init(struct pcm_channel *c, void *devinfo, int dir, int direction); void chn_kill(struct pcm_channel *c); void chn_shutdown(struct pcm_channel *c); +int chn_release(struct pcm_channel *c); +int chn_ref(struct pcm_channel *c, int ref); int chn_reset(struct pcm_channel *c, u_int32_t fmt, u_int32_t spd); int chn_setvolume_multi(struct pcm_channel *c, int vc, int left, int right, int center); diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 448ecb183298..9c31fff7e8cd 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -181,8 +181,8 @@ getchns(struct dsp_cdevpriv *priv, uint32_t prio) pcm_setflags(d->dev, flags); if (ch != NULL) { CHN_LOCK(ch); - pcm_chnref(ch, -1); - pcm_chnrelease(ch); + chn_ref(ch, -1); + chn_release(ch); } PCM_RELEASE(d); PCM_UNLOCK(d); @@ -301,7 +301,7 @@ dsp_close(void *data) wdref--; else { CHN_LOCK(volch); - pcm_chnref(volch, -1); + chn_ref(volch, -1); CHN_UNLOCK(volch); } } @@ -332,12 +332,12 @@ dsp_close(void *data) free_unr(pcmsg_unrhdr, sg_ids); CHN_LOCK(rdch); - pcm_chnref(rdch, rdref); + chn_ref(rdch, rdref); chn_abort(rdch); /* won't sleep */ rdch->flags &= ~(CHN_F_RUNNING | CHN_F_MMAP | CHN_F_DEAD | CHN_F_EXCLUSIVE); chn_reset(rdch, 0, 0); - pcm_chnrelease(rdch); + chn_release(rdch); } if (wrch != NULL) { /* @@ -350,12 +350,12 @@ dsp_close(void *data) free_unr(pcmsg_unrhdr, sg_ids); CHN_LOCK(wrch); - pcm_chnref(wrch, wdref); + chn_ref(wrch, wdref); chn_flush(wrch); /* may sleep */ wrch->flags &= ~(CHN_F_RUNNING | CHN_F_MMAP | CHN_F_DEAD | CHN_F_EXCLUSIVE); chn_reset(wrch, 0, 0); - pcm_chnrelease(wrch); + chn_release(wrch); } PCM_LOCK(d); } @@ -451,7 +451,7 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) if (rderror != 0) { if (rdch != NULL) - pcm_chnrelease(rdch); + chn_release(rdch); if (!DSP_F_DUPLEX(flags)) { PCM_RELEASE_QUICK(d); PCM_GIANT_EXIT(d); @@ -463,7 +463,7 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) rdch->flags |= CHN_F_NBIO; if (flags & O_EXCL) rdch->flags |= CHN_F_EXCLUSIVE; - pcm_chnref(rdch, 1); + chn_ref(rdch, 1); chn_vpc_reset(rdch, SND_VOL_C_PCM, 0); CHN_UNLOCK(rdch); } @@ -479,7 +479,7 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) if (wrerror != 0) { if (wrch != NULL) - pcm_chnrelease(wrch); + chn_release(wrch); if (!DSP_F_DUPLEX(flags)) { if (rdch != NULL) { /* @@ -487,8 +487,8 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) * created record channel */ CHN_LOCK(rdch); - pcm_chnref(rdch, -1); - pcm_chnrelease(rdch); + chn_ref(rdch, -1); + chn_release(rdch); } PCM_RELEASE_QUICK(d); PCM_GIANT_EXIT(d); @@ -500,7 +500,7 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) wrch->flags |= CHN_F_NBIO; if (flags & O_EXCL) wrch->flags |= CHN_F_EXCLUSIVE; - pcm_chnref(wrch, 1); + chn_ref(wrch, 1); chn_vpc_reset(wrch, SND_VOL_C_PCM, 0); CHN_UNLOCK(wrch); } diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index b3ae93b77a5d..9d5eaf3f5ad7 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -306,32 +306,6 @@ vchan_alloc: return (err); } -/* release a locked channel and unlock it */ -int -pcm_chnrelease(struct pcm_channel *c) -{ - PCM_BUSYASSERT(c->parentsnddev); - CHN_LOCKASSERT(c); - - c->flags &= ~CHN_F_BUSY; - c->pid = -1; - strlcpy(c->comm, CHN_COMM_UNUSED, sizeof(c->comm)); - CHN_UNLOCK(c); - - return (0); -} - -int -pcm_chnref(struct pcm_channel *c, int ref) -{ - PCM_BUSYASSERT(c->parentsnddev); - CHN_LOCKASSERT(c); - - c->refcount += ref; - - return (c->refcount); -} - static void pcm_setmaxautovchans(struct snddev_info *d, int num) { diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index 70addf32bddd..08aa56cc96f7 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -296,8 +296,6 @@ SYSCTL_DECL(_hw_snd); int pcm_setvchans(struct snddev_info *d, int direction, int newcnt, int num); int pcm_chnalloc(struct snddev_info *d, struct pcm_channel **ch, int direction, pid_t pid, char *comm); -int pcm_chnrelease(struct pcm_channel *c); -int pcm_chnref(struct pcm_channel *c, int ref); struct pcm_channel *pcm_chn_create(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, int dir, int num, void *devinfo); int pcm_chn_add(struct snddev_info *d, struct pcm_channel *ch); From nobody Fri May 17 19:30:58 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgxrz28gwz5Lg98; Fri, 17 May 2024 19: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 4Vgxrz03z8z4v7w; Fri, 17 May 2024 19: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=1715974259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kyqR2JL1GU14PrauoL6zpsL+vCAstm0P19krs86vkeA=; b=TCSfQRNf64sAuiCJLGRm94BYkhLTWBJLRKCXddbspXoRQPq/VuiotNYdQj9i+hqsNdzWgQ 8GGkFk5oH0Cfp51rjupLUdZElFeH+f8jWpkxKy6qs5Dd8hEt2IUEEnBfDOMj7197L3JArp LCemkDN0FJE3t+0saUgRc/QAxIzR7Gg2GstJ60tqg8E3Wvg6APEArDRBl93ZsMizreXDwe 0qJofpk6OImBAT0h31EKttvO6XVvmc+3nL+lDzMz2BKqezwCZGP/bhrDd2FBMDs3Q+x8H4 xCOGc2vbhq+Tn8/JSMEZ5WKD/MUBrOuF+XpB79zFtLP1qihlqxl5UmNj83sROg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974259; a=rsa-sha256; cv=none; b=G1r3TeqA90KKet1ybcxYZhFx8LlJXGcs6gnn0JxwJXUgPxHmYxkVwreDd8lS/zPqu2AKWJ bx4NKjOjqPaIkAcqJHtuFlSIMjycrXkkeitZXEJ8/FVy+zVUtmKDlZnHwVUQyOjtDCcBUN OfIyzMKFqNzCNAExFfTDjIGRK5TaDVcnUhvVfH2B6H2ul0BDlpXDxV5iMfnqd0hZZISRRz a3AC4VzYqDoC6+EM7Ekyh3W2FmYQ1n0aa6yTQNeeHgCtZP0ecxTuchJBnTjALZ/ojESoCw S0dkE9eKYaHAzt4w/dFvOkeXyBccrYGoVBmWxWPFoYj+QQ4UzmLUjjYC4vbaIg== 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=1715974259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kyqR2JL1GU14PrauoL6zpsL+vCAstm0P19krs86vkeA=; b=IJxN5twP/dL6YPSkguThEen3LaKIDuVn64N86lx40NaM4QlO5ZjaFaLxlVME4oIyLxISI7 lsRX812isDf9CZV5uqFw763ido5QwcTuOlYbSFDI8U+jO5KZgjKMJBmorriHVlIq/eiCzA JTXUcZMCrqY0O6LHW/xF7BpPssCeQNJ3R4EAhp9o8udI981k1TXRGu5W2Ev11QudGrOglD 3gp2AKExPTMgLReNA0hrcWGl1kfJ69JztSPKaD4UPZjSz0m2QDARjz3stMCMXxF6BWLVrD Bcu7cNQZg3e81m0LC/+OtQ5c4cpj2Skbm8cabgGxBjE+j9QO+tVmzQ8vXhxhNw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vgxry6YPtzvsP; Fri, 17 May 2024 19: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 44HJUwnL099520; Fri, 17 May 2024 19: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 44HJUwRa099517; Fri, 17 May 2024 19:30:58 GMT (envelope-from git) Date: Fri, 17 May 2024 19:30:58 GMT Message-Id: <202405171930.44HJUwRa099517@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 0baaaf8543d5 - stable/14 - sound: Remove chn_timeout check from chn_init() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0baaaf8543d5d88bbfe1a537e6fb7d0773fa9261 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=0baaaf8543d5d88bbfe1a537e6fb7d0773fa9261 commit 0baaaf8543d5d88bbfe1a537e6fb7d0773fa9261 Author: Christos Margiolis AuthorDate: 2024-04-28 19:47:33 +0000 Commit: Christos Margiolis CommitDate: 2024-05-17 19:30:34 +0000 sound: Remove chn_timeout check from chn_init() This check is not related to channel initializion, but is also unnecessary, since sysctl_hw_snd_timeout() takes care of checking if chn_timeout is within bounds. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D44992 (cherry picked from commit 7cc1afc5589000ac6ad7a908b07fad3401367bd1) --- sys/dev/sound/pcm/channel.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 0fea169e3eb7..859476f212ae 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -1164,9 +1164,6 @@ chn_init(struct pcm_channel *c, void *devinfo, int dir, int direction) struct snd_dbuf *b, *bs; int i, ret; - if (chn_timeout < CHN_TIMEOUT_MIN || chn_timeout > CHN_TIMEOUT_MAX) - chn_timeout = CHN_TIMEOUT; - chn_lockinit(c, dir); b = NULL; From nobody Fri May 17 19:30:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgxs04c9bz5LgC8; Fri, 17 May 2024 19:31: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 4Vgxs014sGz4v9p; Fri, 17 May 2024 19: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=1715974260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=abn1n7vv0UheWtj/vZp6BXpx4YiQij9Yhf9MR59Krm0=; b=j1Kp2lTFmClLtsyJNnFmvKwSuskaKmp32E2elpeDiTvdwTqH1KVuqlQMnyxRnRGTzXIZpH i/qUV5HR6/BopuJTxlRfXGZ279hhSGE4GKdE9DeUEQPiMOQS6eD674rvJGj9/Bd8qH3xJt c5xgo0He7GdvpbLgF1zpuY0b3YEwPn3E/1n/VYq3sF3sISHJ/PApu15lZQmy0ve4TGaDSw epN07TEY696HAaXkP6ONSFHG1yUutZNdFKtOM2C/s25gxQ2SYMEDJQ5nsSmaXXy+EiR5Ns 2YZfQwYlOkrkIqVWtkcco5h3o8MhZJKbinjpn2sUxFPQUjKVE3I1OgUPiSSsFw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974260; a=rsa-sha256; cv=none; b=DSn1TCu8Gt+VP8K782qo0wgk8sHZM4N0jGKlVfSvtkBiaE9ch1/eberSGGBUEX+Zc1BGnd VcPMSoG8yvCYUYd8QrDSwwInuNpbShTQYP5sHTLCKXT+kr8FaWlLfoXZRsZK15YOkLBk9N sCKpQAy/B62MacK1ZGohUdV0CsTrs3s4Ttuki0f2fML+zHCK3aLYua/Zt/y90rJ3zn9ZNS AlwFvm1ovdHeo800UKPLCD74ecENbpulrRyVi2MI7puUeEVLvaHznjwILWxs3/8eD3Oq6e wFJpT3WBqAMXDWSZVjOfzFnrtJe15XINvjWT0/9XZ3KIScVRdFOsMShH0yqeyg== 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=1715974260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=abn1n7vv0UheWtj/vZp6BXpx4YiQij9Yhf9MR59Krm0=; b=wY3ZhjXwGdSeGh67aZArcyGqDJ8BMEnVyJPUUGa+QMvx6M3yJwH7Ou792MzzLEJliJb1CW nTYy3GLEf2wn/Bb/8YuNDVy+9fjgohJJNLpJbTt2E1ZN+lJnJlxQ5F0qgDgSQ56jQTFEYU 5ohMocRDVebcifHAbhyXCuu7fT+qjPm2mAi/G5EOB2TcjVBQ3rEM1vUYYZnWcwAR/rIOUZ PLOZhDFyH+sDfvqs4xQbHMGJ8xtr6rFaXhf/fdZJ/ocIA1fO+RSeXqk45UxjkZyyaLUOPH pcnZa07ef/PpqrKbzaLBg4RDR5m8SFEjp7cbhkytHkYQ4et2BVtMxpLhU1ibtw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vgxs00hMPzvfB; Fri, 17 May 2024 19: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 44HJUxtp099565; Fri, 17 May 2024 19: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 44HJUxh7099562; Fri, 17 May 2024 19:30:59 GMT (envelope-from git) Date: Fri, 17 May 2024 19:30:59 GMT Message-Id: <202405171930.44HJUxh7099562@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 13ee4d7f332e - stable/14 - sound: Merge pcm_chn_create() and chn_init() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 13ee4d7f332ee1948f2886aeec70e97a4cf5457e Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=13ee4d7f332ee1948f2886aeec70e97a4cf5457e commit 13ee4d7f332ee1948f2886aeec70e97a4cf5457e Author: Christos Margiolis AuthorDate: 2024-05-06 18:26:37 +0000 Commit: Christos Margiolis CommitDate: 2024-05-17 19:30:34 +0000 sound: Merge pcm_chn_create() and chn_init() Follow-up of b3ea087c05d8c75978a302cbb3fa92ce1afa3e49 ("sound: Merge pcm_chn_destroy() and chn_kill()") While here, add device_printf()'s to all failure points. Also fix an existing bug where we'd unlock an already unlocked channel, in case we went to "out" (now "out2") before locking the channel. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D44993 (cherry picked from commit 2e9962ef57044b191431fe9228841e1415574d82) --- sys/dev/sound/pcm/channel.c | 167 ++++++++++++++++++++++++++++++++++++++------ sys/dev/sound/pcm/channel.h | 3 +- sys/dev/sound/pcm/sound.c | 114 +----------------------------- sys/dev/sound/pcm/sound.h | 1 - sys/dev/sound/pcm/vchan.c | 2 +- 5 files changed, 151 insertions(+), 136 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 859476f212ae..996cb0cb04f7 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -1157,14 +1157,112 @@ chn_reset(struct pcm_channel *c, uint32_t fmt, uint32_t spd) return r; } -int -chn_init(struct pcm_channel *c, void *devinfo, int dir, int direction) +struct pcm_channel * +chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, + int dir, int num, void *devinfo) { + struct pcm_channel *c; struct feeder_class *fc; struct snd_dbuf *b, *bs; - int i, ret; + char *dirs, *devname, buf[CHN_NAMELEN]; + int i, ret, direction, rpnum, *pnum, max, type, unit; + PCM_BUSYASSERT(d); + PCM_LOCKASSERT(d); + KASSERT(num >= -1, ("invalid num=%d", num)); + + switch (dir) { + case PCMDIR_PLAY: + dirs = "play"; + direction = PCMDIR_PLAY; + pnum = &d->playcount; + type = SND_DEV_DSPHW_PLAY; + max = SND_MAXHWCHAN; + break; + case PCMDIR_PLAY_VIRTUAL: + dirs = "virtual_play"; + direction = PCMDIR_PLAY; + pnum = &d->pvchancount; + type = SND_DEV_DSPHW_VPLAY; + max = SND_MAXVCHANS; + break; + case PCMDIR_REC: + dirs = "record"; + direction = PCMDIR_REC; + pnum = &d->reccount; + type = SND_DEV_DSPHW_REC; + max = SND_MAXHWCHAN; + break; + case PCMDIR_REC_VIRTUAL: + dirs = "virtual_record"; + direction = PCMDIR_REC; + pnum = &d->rvchancount; + type = SND_DEV_DSPHW_VREC; + max = SND_MAXVCHANS; + break; + default: + device_printf(d->dev, + "%s(): invalid channel direction: %d\n", + __func__, dir); + goto out1; + } + + unit = (num == -1) ? 0 : num; + + if (*pnum >= max || unit >= max) { + device_printf(d->dev, "%s(): unit=%d or pnum=%d >= than " + "max=%d\n", __func__, unit, *pnum, max); + goto out1; + } + + rpnum = 0; + + CHN_FOREACH(c, d, channels.pcm) { + if (c->type != type) + continue; + if (unit == c->unit && num != -1) { + device_printf(d->dev, + "%s(): channel num=%d already allocated\n", + __func__, unit); + goto out1; + } + unit++; + if (unit >= max) { + device_printf(d->dev, + "%s(): chan=%d >= max=%d\n", __func__, unit, max); + goto out1; + } + rpnum++; + } + + if (*pnum != rpnum) { + device_printf(d->dev, + "%s(): pnum screwed: dirs=%s pnum=%d rpnum=%d\n", + __func__, dirs, *pnum, rpnum); + goto out1; + } + + PCM_UNLOCK(d); + c = malloc(sizeof(*c), M_DEVBUF, M_WAITOK | M_ZERO); + c->methods = kobj_create(cls, M_DEVBUF, M_WAITOK | M_ZERO); + c->type = type; + c->unit = unit; + c->pid = -1; + strlcpy(c->comm, CHN_COMM_UNUSED, sizeof(c->comm)); + c->parentsnddev = d; + c->parentchannel = parent; + c->dev = d->dev; + c->trigger = PCMTRIG_STOP; chn_lockinit(c, dir); + devname = dsp_unit2name(buf, sizeof(buf), c); + if (devname == NULL) { + ret = EINVAL; + device_printf(d->dev, "%s(): failed to create channel name", + __func__); + goto out2; + } + snprintf(c->name, sizeof(c->name), "%s:%s:%s", + device_get_nameunit(c->dev), dirs, devname); b = NULL; bs = NULL; @@ -1177,20 +1275,31 @@ chn_init(struct pcm_channel *c, void *devinfo, int dir, int direction) ret = ENOMEM; b = sndbuf_create(c->dev, c->name, "primary", c); - if (b == NULL) - goto out; + if (b == NULL) { + device_printf(d->dev, "%s(): failed to create hardware buffer\n", + __func__); + goto out2; + } bs = sndbuf_create(c->dev, c->name, "secondary", c); - if (bs == NULL) - goto out; + if (bs == NULL) { + device_printf(d->dev, "%s(): failed to create software buffer\n", + __func__); + goto out2; + } CHN_LOCK(c); ret = EINVAL; fc = feeder_getclass(NULL); - if (fc == NULL) - goto out; - if (chn_addfeeder(c, fc, NULL)) - goto out; + if (fc == NULL) { + device_printf(d->dev, "%s(): failed to get feeder class\n", + __func__); + goto out2; + } + if (chn_addfeeder(c, fc, NULL)) { + device_printf(d->dev, "%s(): failed to add feeder\n", __func__); + goto out2; + } /* * XXX - sndbuf_setup() & sndbuf_resize() expect to be called @@ -1226,12 +1335,17 @@ chn_init(struct pcm_channel *c, void *devinfo, int dir, int direction) CHN_UNLOCK(c); /* XXX - Unlock for CHANNEL_INIT() malloc() call */ c->devinfo = CHANNEL_INIT(c->methods, devinfo, b, c, direction); CHN_LOCK(c); - if (c->devinfo == NULL) - goto out; + if (c->devinfo == NULL) { + device_printf(d->dev, "%s(): NULL devinfo\n", __func__); + goto out2; + } ret = ENOMEM; - if ((sndbuf_getsize(b) == 0) && ((c->flags & CHN_F_VIRTUAL) == 0)) - goto out; + if ((sndbuf_getsize(b) == 0) && ((c->flags & CHN_F_VIRTUAL) == 0)) { + device_printf(d->dev, "%s(): hardware buffer's size is 0\n", + __func__); + goto out2; + } ret = 0; c->direction = direction; @@ -1251,12 +1365,14 @@ chn_init(struct pcm_channel *c, void *devinfo, int dir, int direction) bs->shadbuf = malloc(bs->sl, M_DEVBUF, M_NOWAIT); if (bs->shadbuf == NULL) { ret = ENOMEM; - goto out; + device_printf(d->dev, "%s(): failed to create shadow " + "buffer\n", __func__); + goto out2; } } - -out: - CHN_UNLOCK(c); +out2: + if (CHN_LOCKOWNED(c)) + CHN_UNLOCK(c); if (ret) { if (c->devinfo) { if (CHANNEL_FREE(c->methods, c->devinfo)) @@ -1270,10 +1386,19 @@ out: c->flags |= CHN_F_DEAD; chn_lockdestroy(c); - return ret; + PCM_LOCK(d); + + kobj_delete(c->methods, M_DEVBUF); + free(c, M_DEVBUF); + + return (NULL); } - return 0; + PCM_LOCK(d); + + return (c); +out1: + return (NULL); } void diff --git a/sys/dev/sound/pcm/channel.h b/sys/dev/sound/pcm/channel.h index 698a1186924f..6aca089a7c4d 100644 --- a/sys/dev/sound/pcm/channel.h +++ b/sys/dev/sound/pcm/channel.h @@ -259,7 +259,8 @@ int chn_sync(struct pcm_channel *c, int threshold); int chn_flush(struct pcm_channel *c); int chn_poll(struct pcm_channel *c, int ev, struct thread *td); -int chn_init(struct pcm_channel *c, void *devinfo, int dir, int direction); +struct pcm_channel *chn_init(struct snddev_info *d, struct pcm_channel *parent, + kobj_class_t cls, int dir, int num, void *devinfo); void chn_kill(struct pcm_channel *c); void chn_shutdown(struct pcm_channel *c); int chn_release(struct pcm_channel *c); diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 9d5eaf3f5ad7..cc19d119ac36 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -379,116 +379,6 @@ SYSCTL_PROC(_hw_snd, OID_AUTO, maxautovchans, sysctl_hw_snd_maxautovchans, "I", "maximum virtual channel"); -struct pcm_channel * -pcm_chn_create(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, int dir, int num, void *devinfo) -{ - struct pcm_channel *ch; - int direction, err, rpnum, *pnum, max; - int type, unit; - char *dirs, *devname, buf[CHN_NAMELEN]; - - PCM_BUSYASSERT(d); - PCM_LOCKASSERT(d); - KASSERT(num >= -1, ("invalid num=%d", num)); - - switch (dir) { - case PCMDIR_PLAY: - dirs = "play"; - direction = PCMDIR_PLAY; - pnum = &d->playcount; - type = SND_DEV_DSPHW_PLAY; - max = SND_MAXHWCHAN; - break; - case PCMDIR_PLAY_VIRTUAL: - dirs = "virtual_play"; - direction = PCMDIR_PLAY; - pnum = &d->pvchancount; - type = SND_DEV_DSPHW_VPLAY; - max = SND_MAXVCHANS; - break; - case PCMDIR_REC: - dirs = "record"; - direction = PCMDIR_REC; - pnum = &d->reccount; - type = SND_DEV_DSPHW_REC; - max = SND_MAXHWCHAN; - break; - case PCMDIR_REC_VIRTUAL: - dirs = "virtual_record"; - direction = PCMDIR_REC; - pnum = &d->rvchancount; - type = SND_DEV_DSPHW_VREC; - max = SND_MAXVCHANS; - break; - default: - return (NULL); - } - - unit = (num == -1) ? 0 : num; - - if (*pnum >= max || unit >= max) - return (NULL); - - rpnum = 0; - - CHN_FOREACH(ch, d, channels.pcm) { - if (ch->type != type) - continue; - if (unit == ch->unit && num != -1) { - device_printf(d->dev, - "channel num=%d allocated!\n", unit); - return (NULL); - } - unit++; - if (unit >= max) { - device_printf(d->dev, - "chan=%d > %d\n", unit, max); - return (NULL); - } - rpnum++; - } - - if (*pnum != rpnum) { - device_printf(d->dev, - "%s(): WARNING: pnum screwed : dirs=%s pnum=%d rpnum=%d\n", - __func__, dirs, *pnum, rpnum); - return (NULL); - } - - PCM_UNLOCK(d); - ch = malloc(sizeof(*ch), M_DEVBUF, M_WAITOK | M_ZERO); - ch->methods = kobj_create(cls, M_DEVBUF, M_WAITOK | M_ZERO); - ch->type = type; - ch->unit = unit; - ch->pid = -1; - strlcpy(ch->comm, CHN_COMM_UNUSED, sizeof(ch->comm)); - ch->parentsnddev = d; - ch->parentchannel = parent; - ch->dev = d->dev; - ch->trigger = PCMTRIG_STOP; - devname = dsp_unit2name(buf, sizeof(buf), ch); - if (devname == NULL) { - device_printf(d->dev, "Failed to query device name"); - kobj_delete(ch->methods, M_DEVBUF); - free(ch, M_DEVBUF); - return (NULL); - } - snprintf(ch->name, sizeof(ch->name), "%s:%s:%s", - device_get_nameunit(ch->dev), dirs, devname); - - err = chn_init(ch, devinfo, dir, direction); - PCM_LOCK(d); - if (err) { - device_printf(d->dev, "chn_init(%s) failed: err = %d\n", - ch->name, err); - kobj_delete(ch->methods, M_DEVBUF); - free(ch, M_DEVBUF); - return (NULL); - } - - return (ch); -} - int pcm_chn_add(struct snddev_info *d, struct pcm_channel *ch) { @@ -569,9 +459,9 @@ pcm_addchan(device_t dev, int dir, kobj_class_t cls, void *devinfo) PCM_BUSYASSERT(d); PCM_LOCK(d); - ch = pcm_chn_create(d, NULL, cls, dir, -1, devinfo); + ch = chn_init(d, NULL, cls, dir, -1, devinfo); if (!ch) { - device_printf(d->dev, "pcm_chn_create(%s, %d, %p) failed\n", + device_printf(d->dev, "chn_init(%s, %d, %p) failed\n", cls->name, dir, devinfo); PCM_UNLOCK(d); return (ENODEV); diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index 08aa56cc96f7..09e739ea5c20 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -297,7 +297,6 @@ int pcm_setvchans(struct snddev_info *d, int direction, int newcnt, int num); int pcm_chnalloc(struct snddev_info *d, struct pcm_channel **ch, int direction, pid_t pid, char *comm); -struct pcm_channel *pcm_chn_create(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, int dir, int num, void *devinfo); int pcm_chn_add(struct snddev_info *d, struct pcm_channel *ch); int pcm_chn_remove(struct snddev_info *d, struct pcm_channel *ch); diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c index c3bc36d924bd..ccac08891220 100644 --- a/sys/dev/sound/pcm/vchan.c +++ b/sys/dev/sound/pcm/vchan.c @@ -698,7 +698,7 @@ vchan_create(struct pcm_channel *parent, int num) } /* create a new playback channel */ - ch = pcm_chn_create(d, parent, &vchan_class, direction, num, parent); + ch = chn_init(d, parent, &vchan_class, direction, num, parent); if (ch == NULL) { PCM_UNLOCK(d); CHN_LOCK(parent); From nobody Fri May 17 19:31:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgxs205d2z5LgCC; Fri, 17 May 2024 19:31: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 4Vgxs11nhcz4vGG; Fri, 17 May 2024 19:31:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715974261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ozvb+JrrJ1QE6b3CxDLJ7T3y+3qabLSS/qvr9yyGmS4=; b=LivMF4o+T48nUhj6KFmmAgVTMfQk6Si9yohCIylFN53o4MMXMl+xTpOpmBC8Uhw2tOz0Ri HuYt8dIYTQNYl3RLGHyx+mqZU+XVAK1PWkr8vuO2BY9YEqYVjwe1tUJfqFBBxqvKLSjXvf OjcLWj6ySdpkH1cOurPtBGJjPyDubIrSNHPCNaVPZ30aaGG7xdKUKCpb1e1O/g1qWN0tWD Quj8Kj84FWn9XkkZkchJJTofQ4VWYgeG52RYza/jhIT2qU6FfBxk7QEQBapSceEf9Z0Z3A oQpVsCwFOFhu+5T0nS7lxLLw222g3OXh9SHUfT4KixYLKlf3yLoghd9bGxanPw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974261; a=rsa-sha256; cv=none; b=sVmP9aUfvwYH7CMevx9vRsKbfMmL+2kwQ5gBk1v6dAZ9yZzu7IJqhaFkbHX8co4TsJgENg ky7MLLo06jD0I7rOYIjcRqlle6W5mKwUpJcmJNyxyMmkGqM4jwbmLVPb8zIgAEVsET/lcq fapQkmlmV2cx8U/yOTNr3qw7qMhTCTHPlBBBZanL1nw/bjR2Ld+iJew5sZIn8fJbGxaVKo GvOCnD4hlSxrIaqjkV8x0Ii0iww8jjEWAwEavrhS1Q3x1aDfxxuhJvA28H9rLkxfw88I0N 9kpo6XsWpnzkkW5hGU7aTEQFQYUj+T8DCEZaXH8e4/PoPnoFZBwXgglTogr5rA== 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=1715974261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ozvb+JrrJ1QE6b3CxDLJ7T3y+3qabLSS/qvr9yyGmS4=; b=i3pWO78r6q0EaWzNVszgiOHIcRYrkbSvILzv/B6Po3p/2hp3nCMwhLBcDlKZeipaQfHdgC P7FyYyjQuKrGwsvJISe4IRFDi3gqPrASRS5SqzrthxGHrf7F42yTlD/ViIlPHGVcNzKb4/ mY0ZSIuB6HbqKm1mSuFvmdLs3AvzerYQa8EMe1g9HoTnVOi+CqFswxcmpWvV4OGKxa6YDT txMy1YCelNT/qq74daiMEvVMKR12AqK3WybC5kQyypYkrm10qOBT1uwbrEfbS7jW8iGArf cU9Ml2lrrLLMGCRdKHeaYkSqH/438hPALyy2aaYLscJXzoQcRix1fPlvqywvAg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vgxs11Q2VzvyC; Fri, 17 May 2024 19:31: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 44HJV1kb099631; Fri, 17 May 2024 19:31:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HJV1jj099628; Fri, 17 May 2024 19:31:01 GMT (envelope-from git) Date: Fri, 17 May 2024 19:31:01 GMT Message-Id: <202405171931.44HJV1jj099628@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: e6e7bf7087fb - stable/14 - sound: Add __assert_unreachable() to default cases in pcm_chn_add() and pcm_chn_remove() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e6e7bf7087fb50a404f684092bd522ece2533d34 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=e6e7bf7087fb50a404f684092bd522ece2533d34 commit e6e7bf7087fb50a404f684092bd522ece2533d34 Author: Christos Margiolis AuthorDate: 2024-05-06 18:26:56 +0000 Commit: Christos Margiolis CommitDate: 2024-05-17 19:30:34 +0000 sound: Add __assert_unreachable() to default cases in pcm_chn_add() and pcm_chn_remove() We should normally never enter these cases. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D44994 (cherry picked from commit 76f95bae092b7353ff82b7a0056ca5801bb98f76) --- sys/dev/sound/pcm/sound.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index cc19d119ac36..2787c0ee126d 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -403,7 +403,7 @@ pcm_chn_add(struct snddev_info *d, struct pcm_channel *ch) d->rvchancount++; break; default: - break; + __assert_unreachable(); } return (0); @@ -443,7 +443,7 @@ pcm_chn_remove(struct snddev_info *d, struct pcm_channel *ch) d->rvchancount--; break; default: - break; + __assert_unreachable(); } return (0); From nobody Fri May 17 19:31:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgxs243fbz5LgLB; Fri, 17 May 2024 19:31: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 4Vgxs237Jdz4vBV; Fri, 17 May 2024 19:31:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715974262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uel1HSjoHWmciXPqGzkygcrt/gPgeV4OGWQ/FOsKCpw=; b=w6L54Zw4kUvSQoG29ovUjAY3SXGAUURw5Ru5+aYselOresrT86M9AlFY+QBHiqN3gprv6O OxruY3tL9mfsroamz9rgNwyjKov4W8XIAw2V1G2qh3aOuADxKH/irh/SE4K6WGUpygPdzc Xqx1Q0wiRiHW6x1SIzM7Rs4yF9O39VK+t3pxW5Q7wE56ZmAOMOv/k+Rti/1YHe425zwwNS y9xbsgp3g1+9dkhIFx0jUiAP7tKznYWoUir0W8IPuvdSeVgfEu516Xrnh4gbLuGjZ7/PxS BdemEETq3gmCrECQDFOWTGpFwFDwZ1a3bxxldH2+EEMUHb21cXx/AbbAPTYjFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974262; a=rsa-sha256; cv=none; b=ljwqFhgEq7q+9z6OemZInKcjCyWSS8zy/j656WDEuvFk7xDHlGBzIBG/Q2GYSY+4XgzddQ Uks80H/JGMDlXvpzyvSse48RLDdnuletrM1YmeYCT0dlR8Sqx3qSc71+EtvRHxYoMfM7NV E3HyG3iTHiWk5+GGGamRTiE8pd9SMbKk5YbGvvjc//BYZpBJqQzZFdM9yYFh88Xhurh12G PtPe2a7pfmDc7uPZX+7+koI5aO791hffgATd+gOy9dMp32osZVFe6877FfhaVSkxx4pYJz AmTZI2GkrhFXdqd+4bcryDgPknFcNJ6MhvtziLfJtEOvhgnBzZU6hrsIuZ0KhA== 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=1715974262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uel1HSjoHWmciXPqGzkygcrt/gPgeV4OGWQ/FOsKCpw=; b=q/aluX8af365YxvWmZ7dPdhT/XATWhMo1etfbVQfpyGL+kdMtB9SKwTtx0xXdG5jigl2+B v0FK2ytrHH/IbPgrtNPHB2xHQj1DSzpyaWPKe5hnDBbh+kJ9KaAogC9589wk8/lx3FKcjS JzrMp8GgMGG7Jpq/JTttavFv/UB24Q88gMClo7ZNjOCUIc8tfAIpgh9IiS+skUobffnqaU FWhrMKr4iQBOIirvYaeN5hJCI7O5VB42+kZOnByPxJkTZyl9nXX4Y/hxvfsgB+iWRXWPJJ qLRNXWfgsLMFLe07H+ryL1anbkdn80qAPaHeXwAjYC2A6eXk1sHAw+mRwjFSZw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vgxs22l6vzvr4; Fri, 17 May 2024 19:31: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 44HJV29C099673; Fri, 17 May 2024 19:31:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HJV2Ri099670; Fri, 17 May 2024 19:31:02 GMT (envelope-from git) Date: Fri, 17 May 2024 19:31:02 GMT Message-Id: <202405171931.44HJV2Ri099670@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 2c53a4bbcb17 - stable/14 - sound: Convert pcm_chn_add() to void List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2c53a4bbcb17bbe3beddb2b56cd18d1fd3045df0 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=2c53a4bbcb17bbe3beddb2b56cd18d1fd3045df0 commit 2c53a4bbcb17bbe3beddb2b56cd18d1fd3045df0 Author: Christos Margiolis AuthorDate: 2024-05-06 18:27:18 +0000 Commit: Christos Margiolis CommitDate: 2024-05-17 19:30:34 +0000 sound: Convert pcm_chn_add() to void It always returns 0. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D44998 (cherry picked from commit 139bcec852cf2786ca839ca0bddbb2b78a23d6fa) --- sys/dev/sound/pcm/sound.c | 14 +++----------- sys/dev/sound/pcm/sound.h | 2 +- sys/dev/sound/pcm/vchan.c | 8 ++------ 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 2787c0ee126d..9b4de948eac4 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -379,7 +379,7 @@ SYSCTL_PROC(_hw_snd, OID_AUTO, maxautovchans, sysctl_hw_snd_maxautovchans, "I", "maximum virtual channel"); -int +void pcm_chn_add(struct snddev_info *d, struct pcm_channel *ch) { PCM_BUSYASSERT(d); @@ -405,8 +405,6 @@ pcm_chn_add(struct snddev_info *d, struct pcm_channel *ch) default: __assert_unreachable(); } - - return (0); } int @@ -454,7 +452,6 @@ pcm_addchan(device_t dev, int dir, kobj_class_t cls, void *devinfo) { struct snddev_info *d = device_get_softc(dev); struct pcm_channel *ch; - int err; PCM_BUSYASSERT(d); @@ -467,15 +464,10 @@ pcm_addchan(device_t dev, int dir, kobj_class_t cls, void *devinfo) return (ENODEV); } - err = pcm_chn_add(d, ch); + pcm_chn_add(d, ch); PCM_UNLOCK(d); - if (err) { - device_printf(d->dev, "pcm_chn_add(%s) failed, err=%d\n", - ch->name, err); - chn_kill(ch); - } - return (err); + return (0); } static void diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index 09e739ea5c20..6c9f4c8f18b2 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -297,7 +297,7 @@ int pcm_setvchans(struct snddev_info *d, int direction, int newcnt, int num); int pcm_chnalloc(struct snddev_info *d, struct pcm_channel **ch, int direction, pid_t pid, char *comm); -int pcm_chn_add(struct snddev_info *d, struct pcm_channel *ch); +void pcm_chn_add(struct snddev_info *d, struct pcm_channel *ch); int pcm_chn_remove(struct snddev_info *d, struct pcm_channel *ch); int pcm_addchan(device_t dev, int dir, kobj_class_t cls, void *devinfo); diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c index ccac08891220..1a21b7049b77 100644 --- a/sys/dev/sound/pcm/vchan.c +++ b/sys/dev/sound/pcm/vchan.c @@ -706,13 +706,8 @@ vchan_create(struct pcm_channel *parent, int num) } /* add us to our grandparent's channel list */ - ret = pcm_chn_add(d, ch); + pcm_chn_add(d, ch); PCM_UNLOCK(d); - if (ret != 0) { - chn_kill(ch); - CHN_LOCK(parent); - return (ret); - } CHN_LOCK(parent); /* @@ -727,6 +722,7 @@ vchan_create(struct pcm_channel *parent, int num) parent->flags |= CHN_F_HAS_VCHAN; + ret = 0; parent_caps = chn_getcaps(parent); if (parent_caps == NULL) ret = EINVAL; From nobody Fri May 17 19:31:03 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgxs35bxBz5Lg9d; Fri, 17 May 2024 19:31: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 4Vgxs345SCz4vKG; Fri, 17 May 2024 19:31:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715974263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nQ7B6F4Wjrq8PipnfFyoeMp4VihySAKhlaFbEsbNCXg=; b=bbmb/kpfXhs1TRpKJH6YonVgYPbfpoL6vVE8XwFB1lcqNnP+85tu91iye4jkvBTp75vnPs FMU6PXUDPIh9cEW75SRPcmHPMMLO/CwbNyHQafCcubJ6HaYBeUwxdK3gLtiqmRe+XaIGQ7 tahMQIufr6uM2Y8alW7b0Qq7IW6Fnjp47gH1ctZXjnw3iuHipLMO5PU134E2A5Xi0npHZE JqhuZY2taDFu0A++u/nGmi7AST+oLBEIbLNSR4WhN07DXRPDfI4fxbGwxwBIzvr0p4YOxH tSgmKLPwNbT4nJzPjCSFPVXmjE/xwKwGC9jqmLuGEvSwf+/RfX//ZRngJzYB2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974263; a=rsa-sha256; cv=none; b=bc9CQQ7XCaqemIVffE+tdS1AfLRP0SXE8C6wzmJ2QYRF9Idg7DEWp/3olVoLEauEHqg9MD nRPrBP82AHhp6FZI1NRikprpVj/3CZTMMBiMBthx1eRrTr0U3VMc7NcQ3ucgvbMl7nWEw9 pP47fgmQ6uI13WCGID03lReO3dlJUuB9+wdM4ENTlWVOYCJU6Mz2xt0dHnQF+feyRY5hpT bKa2V0qze4LHSfW+GX8HJzrBy+JZF5vHg0E77QSwRIVyKTjHCpe2W6dqBYsMH1QVrc+amc Ef9pmephGUYKEfwbTB4nd22TVt8plExemRH3wCjBcjzUzLzN3XI6+yWaTl6jww== 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=1715974263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nQ7B6F4Wjrq8PipnfFyoeMp4VihySAKhlaFbEsbNCXg=; b=gl1Um4YSX1pmMSX3DhegTUf9Y+rAi1u17hsmjMDSdkkc00z34xJk/hJ+VwLsrh1ieSIswO T/jqDBbK/SdJylRodware+Ta6YYA6etzXrWr2v+vNlo0e7gVzFZnQBfyq09q0geZEpY/Jq X3alML0iKV/6DgOu94eSEMBYgCgKE3zZI3Xz8BdZ9sLzlOU2ZDsshYkzGh1CcqijMLalOe /riWNYJNffglSp4+TOoOxIB1+IqtcB/jco3l26luB8lkNq8zW9anLwZaK3pPD6VPPNvx1y ScoHHkhRqtMTfdmXGcPPTcHeBR6O4uQl4pF+JJ3wlhT6SEyMNtYl/pyVk4dOMQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vgxs33PkgzvfC; Fri, 17 May 2024 19:31: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 44HJV31N099715; Fri, 17 May 2024 19:31:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HJV3PP099712; Fri, 17 May 2024 19:31:03 GMT (envelope-from git) Date: Fri, 17 May 2024 19:31:03 GMT Message-Id: <202405171931.44HJV3PP099712@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: d1eaefde3bca - stable/14 - sound: Remove hw.snd.version and SND_DRV_VERSION List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d1eaefde3bca383abd419fd30796bffde242d385 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=d1eaefde3bca383abd419fd30796bffde242d385 commit d1eaefde3bca383abd419fd30796bffde242d385 Author: Christos Margiolis AuthorDate: 2024-05-06 18:30:58 +0000 Commit: Christos Margiolis CommitDate: 2024-05-17 19:30:35 +0000 sound: Remove hw.snd.version and SND_DRV_VERSION hw.snd.version and SND_DRV_VERSION define the sound driver version and are meant to be used in bug reports, but because these values are constant, there is not much useful information we can extract from them. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: dev_submerge.ch, emaste Differential Revision: https://reviews.freebsd.org/D44996 (cherry picked from commit 7398d1ece5cfa2e6ce4997234a95115b49c9e818) --- sys/dev/sound/pcm/sndstat.c | 8 ++------ sys/dev/sound/pcm/sound.c | 10 ---------- sys/dev/sound/version.h | 42 ------------------------------------------ 3 files changed, 2 insertions(+), 58 deletions(-) diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index ef006a580d40..edb33e92ade9 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -51,7 +51,6 @@ #include #include -#include #include "feeder_if.h" @@ -1271,11 +1270,8 @@ sndstat_prepare(struct sndstat_file *pf_self) /* make sure buffer is reset */ sbuf_clear(s); - if (snd_verbose > 0) { - sbuf_printf(s, "FreeBSD Audio Driver (%ubit %d/%s)\n", - (u_int)sizeof(intpcm32_t) << 3, SND_DRV_VERSION, - MACHINE_ARCH); - } + if (snd_verbose > 0) + sbuf_printf(s, "FreeBSD Audio Driver\n"); /* generate list of installed devices */ k = 0; diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 9b4de948eac4..d2acfc403e8c 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -41,7 +41,6 @@ #include #include #include -#include #include #include @@ -64,15 +63,6 @@ SYSCTL_NODE(_hw, OID_AUTO, snd, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, static void pcm_sysinit(device_t); -/* - * XXX I've had enough with people not telling proper version/arch - * while reporting problems, not after 387397913213th questions/requests. - */ -static char snd_driver_version[] = - __XSTRING(SND_DRV_VERSION)"/"MACHINE_ARCH; -SYSCTL_STRING(_hw_snd, OID_AUTO, version, CTLFLAG_RD, &snd_driver_version, - 0, "driver version/arch"); - /** * @brief Unit number allocator for syncgroup IDs */ diff --git a/sys/dev/sound/version.h b/sys/dev/sound/version.h deleted file mode 100644 index b816bbf964e8..000000000000 --- a/sys/dev/sound/version.h +++ /dev/null @@ -1,42 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2007 Ariff Abdullah - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef _SND_VERSION_H_ -#define _SND_VERSION_H_ - -/* - * FreeBSD sound driver internal versioning, nothing to do - * with OSS whatsoever. Dear future maintainer, please revisit - * this _before_ Jan 1 2148 - * - * Last 2 decimal places reserved for daily versioning, starting - * with 0. - */ -#define SND_DRV_VERSION 2009061500 - -#endif /* !_SND_VERSION_H_ */ From nobody Fri May 17 19:31:05 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgxs56zZfz5Lfyv; Fri, 17 May 2024 19:31: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 4Vgxs55TSHz4vQD; Fri, 17 May 2024 19:31:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715974265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uiJcYE5KtTuZp21pe7mxSqhRHxVkXitSrE+7Mfv94xQ=; b=CgYycF2tA+S1evyJSHj6JOyV+5BrC8NBsqDfGt0KWSdqKEpgi93btacw8j1gVge/eaOKCy dG3o6Bv5nveAtfonpk1W6zYfXOHRWpuy7JNSqmhfQwTa2iGl9zddZA4HzsHZjJNrzoWPxe itMYn6dDNytoAU8OZ1cVzQ0RdeDJ1FQMoHjPEsi2Z5CiyD5coN9w7edAfJEZeiwfCvA4ml jM5CNROZwxj43uuwBQXneIZFwhTbBOSJVHdNIAp5ebRaJOfiGwR10dJtF/k19DeoHvDRHy CJ2LbRIa0ZCzjC0m1Ud+1ePxyVQkgZ2CvCg3CgfuXYUf01t5Wsu9Qo3jLMnMbw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974265; a=rsa-sha256; cv=none; b=ZXllqlv7HReeEP/nfARQ0NuNXbOaUQHVMskhxfvGDKe08vcd4vvPVvq4++1vVidcyB9Ty+ aN67bo9SniVSr7UKCbux9pMetmDM3x0cKZRewA4DFKGbKzyNWDhohIit9FV75h6GcOyshz Q8mECbJ83tIZ+clghcqpKYYX3nfinlXiuy0NiEHfeAn9Je1n2ymdyl64/mgFPT3UccaI6G nvk5nBxahCfXDGDxuO7VwuK3kIehhNGI/MMJPMGgZVQBHqlJZsjGr2Iv9xKbqJiJfFOXcn LPhIQe22IlsvIxje1jVQCldfUp8+rcPFuNCRSs80/UplB9qPbD4+qKfuq0sUjw== 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=1715974265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uiJcYE5KtTuZp21pe7mxSqhRHxVkXitSrE+7Mfv94xQ=; b=UmNe8taB9soozfddAhEshGvfY71Jwcm6nhTXHzl9DxbxO2rb+5c+f5/Y21y+Tuf5r2OMT6 908B8lLsoP4kmli6qBQufB17HyLX2rS8rNc9SHCVxg9Wt2b7kNzJOMHliaj3Ux2lPIcvBr vkdYL6tAu6mkwtUG8VquU9KYExqhb/U2T/oWxiegp4UEeXQDRR1dEmYtwgcTesMzxEQf7R THxXNAQxKoCi75L7Im0KtbA4HC3n1FmkUo9a7rGj5iqcztI6evd/UuAvR9Fk/UNz+20EcA 3x4eS6z8BgKjfa7rDKZWMRGPyKglYO8ndftpTWUbVGp1dGNysrc+wT8C7OTanQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vgxs554LMzvfD; Fri, 17 May 2024 19:31:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44HJV5rX099814; Fri, 17 May 2024 19:31:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HJV5CK099811; Fri, 17 May 2024 19:31:05 GMT (envelope-from git) Date: Fri, 17 May 2024 19:31:05 GMT Message-Id: <202405171931.44HJV5CK099811@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 6f6cc9324131 - stable/14 - sound: Remove unused dsp_cdevs[] fields and devices List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6f6cc9324131a1db629336d93d0ccf6e68609b48 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=6f6cc9324131a1db629336d93d0ccf6e68609b48 commit 6f6cc9324131a1db629336d93d0ccf6e68609b48 Author: Christos Margiolis AuthorDate: 2024-05-06 18:32:25 +0000 Commit: Christos Margiolis CommitDate: 2024-05-17 19:30:35 +0000 sound: Remove unused dsp_cdevs[] fields and devices These fields and devices are unused as of e8c0d15a64fa ("sound: Get rid of snd_clone and use DEVFS_CDEVPRIV(9)"). While here, remove unused SND_DEV_* defines from pcm/sound.h and convert the list to an enum. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D45013 (cherry picked from commit 72cbd381075a2eb22a070505334d1ce92ec2d7ad) --- sys/dev/sound/pcm/dsp.c | 57 +++++++++-------------------------------------- sys/dev/sound/pcm/sound.h | 50 +++++++++-------------------------------- 2 files changed, 21 insertions(+), 86 deletions(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 9c31fff7e8cd..6c3d76e27b6b 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -203,13 +203,6 @@ relchns(struct dsp_cdevpriv *priv, uint32_t prio) CHN_UNLOCK(priv->wrch); } -/* duplex / simplex cdev type */ -enum { - DSP_CDEV_TYPE_RDONLY, /* simplex read-only (record) */ - DSP_CDEV_TYPE_WRONLY, /* simplex write-only (play) */ - DSP_CDEV_TYPE_RDWR /* duplex read, write, or both */ -}; - #define DSP_F_VALID(x) ((x) & (FREAD | FWRITE)) #define DSP_F_DUPLEX(x) (((x) & (FREAD | FWRITE)) == (FREAD | FWRITE)) #define DSP_F_SIMPLEX(x) (!DSP_F_DUPLEX(x)) @@ -221,48 +214,18 @@ static const struct { char *name; char *sep; char *alias; - int use_sep; - int hw; - int max; - int volctl; - uint32_t fmt, spd; - int query; } dsp_cdevs[] = { - { SND_DEV_DSP, "dsp", ".", NULL, 0, 0, 0, 0, - SND_FORMAT(AFMT_U8, 1, 0), DSP_DEFAULT_SPEED, - DSP_CDEV_TYPE_RDWR }, - { SND_DEV_AUDIO, "audio", ".", NULL, 0, 0, 0, 0, - SND_FORMAT(AFMT_MU_LAW, 1, 0), DSP_DEFAULT_SPEED, - DSP_CDEV_TYPE_RDWR }, - { SND_DEV_DSP16, "dspW", ".", NULL, 0, 0, 0, 0, - SND_FORMAT(AFMT_S16_LE, 1, 0), DSP_DEFAULT_SPEED, - DSP_CDEV_TYPE_RDWR }, - { SND_DEV_DSPHW_PLAY, "dsp", ".p", NULL, 1, 1, SND_MAXHWCHAN, 1, - SND_FORMAT(AFMT_S16_LE, 2, 0), 48000, DSP_CDEV_TYPE_WRONLY }, - { SND_DEV_DSPHW_VPLAY, "dsp", ".vp", NULL, 1, 1, SND_MAXVCHANS, 1, - SND_FORMAT(AFMT_S16_LE, 2, 0), 48000, DSP_CDEV_TYPE_WRONLY }, - { SND_DEV_DSPHW_REC, "dsp", ".r", NULL, 1, 1, SND_MAXHWCHAN, 1, - SND_FORMAT(AFMT_S16_LE, 2, 0), 48000, DSP_CDEV_TYPE_RDONLY }, - { SND_DEV_DSPHW_VREC, "dsp", ".vr", NULL, 1, 1, SND_MAXVCHANS, 1, - SND_FORMAT(AFMT_S16_LE, 2, 0), 48000, DSP_CDEV_TYPE_RDONLY }, - { SND_DEV_DSPHW_CD, "dspcd", ".", NULL, 0, 0, 0, 0, - SND_FORMAT(AFMT_S16_LE, 2, 0), 44100, DSP_CDEV_TYPE_RDWR }, + { SND_DEV_DSP, "dsp", ".", NULL }, + { SND_DEV_DSPHW_PLAY, "dsp", ".p", NULL }, + { SND_DEV_DSPHW_VPLAY, "dsp", ".vp", NULL }, + { SND_DEV_DSPHW_REC, "dsp", ".r", NULL }, + { SND_DEV_DSPHW_VREC, "dsp", ".vr", NULL }, /* Low priority, OSSv4 aliases. */ - { SND_DEV_DSP, "dsp_ac3", ".", "dsp", 0, 0, 0, 0, - SND_FORMAT(AFMT_U8, 1, 0), DSP_DEFAULT_SPEED, - DSP_CDEV_TYPE_RDWR }, - { SND_DEV_DSP, "dsp_mmap", ".", "dsp", 0, 0, 0, 0, - SND_FORMAT(AFMT_U8, 1, 0), DSP_DEFAULT_SPEED, - DSP_CDEV_TYPE_RDWR }, - { SND_DEV_DSP, "dsp_multich", ".", "dsp", 0, 0, 0, 0, - SND_FORMAT(AFMT_U8, 1, 0), DSP_DEFAULT_SPEED, - DSP_CDEV_TYPE_RDWR }, - { SND_DEV_DSP, "dsp_spdifout", ".", "dsp", 0, 0, 0, 0, - SND_FORMAT(AFMT_U8, 1, 0), DSP_DEFAULT_SPEED, - DSP_CDEV_TYPE_RDWR }, - { SND_DEV_DSP, "dsp_spdifin", ".", "dsp", 0, 0, 0, 0, - SND_FORMAT(AFMT_U8, 1, 0), DSP_DEFAULT_SPEED, - DSP_CDEV_TYPE_RDWR }, + { SND_DEV_DSP, "dsp_ac3", ".", "dsp" }, + { SND_DEV_DSP, "dsp_mmap", ".", "dsp" }, + { SND_DEV_DSP, "dsp_multich", ".", "dsp" }, + { SND_DEV_DSP, "dsp_spdifout", ".", "dsp" }, + { SND_DEV_DSP, "dsp_spdifin", ".", "dsp" }, }; static void diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index d2ec480b45b0..5a750440cbea 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -228,45 +228,17 @@ struct snd_mixer; #define AFMT_NE (AFMT_SIGNED_NE | AFMT_U8_NE | AFMT_U16_NE | \ AFMT_U24_NE | AFMT_U32_NE) -/* - * Minor numbers for the sound driver. - * - * Unfortunately Creative called the codec chip of SB as a DSP. For this - * reason the /dev/dsp is reserved for digitized audio use. There is a - * device for true DSP processors but it will be called something else. - * In v3.0 it's /dev/sndproc but this could be a temporary solution. - */ - -#define SND_DEV_CTL 0 /* Control port /dev/mixer */ -#define SND_DEV_SEQ 1 /* Sequencer /dev/sequencer */ -#define SND_DEV_MIDIN 2 /* Raw midi access */ -#define SND_DEV_DSP 3 /* Digitized voice /dev/dsp */ -#define SND_DEV_AUDIO 4 /* Sparc compatible /dev/audio */ -#define SND_DEV_DSP16 5 /* Like /dev/dsp but 16 bits/sample */ -#define SND_DEV_STATUS 6 /* /dev/sndstat */ - /* #7 not in use now. */ -#define SND_DEV_SEQ2 8 /* /dev/sequencer, level 2 interface */ -#define SND_DEV_SNDPROC 9 /* /dev/sndproc for programmable devices */ -#define SND_DEV_PSS SND_DEV_SNDPROC /* ? */ -#define SND_DEV_NORESET 10 - -#define SND_DEV_DSPHW_PLAY 11 /* specific playback channel */ -#define SND_DEV_DSPHW_VPLAY 12 /* specific virtual playback channel */ -#define SND_DEV_DSPHW_REC 13 /* specific record channel */ -#define SND_DEV_DSPHW_VREC 14 /* specific virtual record channel */ - -#define SND_DEV_DSPHW_CD 15 /* s16le/stereo 44100Hz CD */ - -/* - * OSSv4 compatible device. For now, it serve no purpose and - * the cloning itself will forward the request to ordinary /dev/dsp - * instead. - */ -#define SND_DEV_DSP_MMAP 16 /* /dev/dsp_mmap */ -#define SND_DEV_DSP_AC3 17 /* /dev/dsp_ac3 */ -#define SND_DEV_DSP_MULTICH 18 /* /dev/dsp_multich */ -#define SND_DEV_DSP_SPDIFOUT 19 /* /dev/dsp_spdifout */ -#define SND_DEV_DSP_SPDIFIN 20 /* /dev/dsp_spdifin */ +enum { + SND_DEV_CTL = 0, /* Control port /dev/mixer */ + SND_DEV_SEQ, /* Sequencer /dev/sequencer */ + SND_DEV_MIDIN, /* Raw midi access */ + SND_DEV_DSP, /* Digitized voice /dev/dsp */ + SND_DEV_STATUS, /* /dev/sndstat */ + SND_DEV_DSPHW_PLAY, /* specific playback channel */ + SND_DEV_DSPHW_VPLAY, /* specific virtual playback channel */ + SND_DEV_DSPHW_REC, /* specific record channel */ + SND_DEV_DSPHW_VREC, /* specific virtual record channel */ +}; #define DSP_DEFAULT_SPEED 8000 From nobody Fri May 17 19:31:04 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgxs51lSZz5Lfyt; Fri, 17 May 2024 19:31: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 4Vgxs44nSTz4vSB; Fri, 17 May 2024 19:31:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715974264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q2+5eoMIi82sH3rV8MyIAppvznkvF8+8pyDDGHjU3cY=; b=gGB+MtvVSHs1AJmzuWKWG8Y0MY52FqDdi44Yx5MUW3Of+2mC2AmBalT3Tbw+cyUyRl8ROs HPU88SvcsfulGOc+m/IJi0Y5qEduMNIHxYz0iEDjna7MJeDO32/Tc+7PHBoJOeO6VrAjtq RuCpUQ2jFEGw8x2OQXMi1ZD7qX/b0aAq8ilkXlp8oWvyxzKMa79B/u68+4dima72+c2bF2 eJlUZbtzFzTgwrcblt0T1PvSBCZD5Xdc+TP2Iy+eQi5bJqLdNYVJG6ZMYdZDdo7GOmMkl/ muwXYvGyt9PYhDK6ZbloRyvYJCKPk3FQBmWPNnMOx2Lpzb0SnmymsPoEyqAYTw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974264; a=rsa-sha256; cv=none; b=crNBf25LTMtMtmRtrof+vPbssMHaw7n/21eibaKMEEnokFwZlY32VZgNX1DLgo7dhfoyVo +YGNf7rQX0UTZmv+f/Y8g3pqV1k3B2oaBbk0UqztTbCmPjRLwkEdXFzpgjCZrkJd/JeGph vIZNr0kA8O13Y9ZAkhX9Vjtw8bGIdaHfJjQnHNKVJgBjmC8feq1xHjBTz9f0buK6SOSDAR pX1aV3zhzdrnTWj9G8NkyINvMA1YsY/qSp5Rxrl+x9/YHJoiycHIcV9BWKsT9amVyTfYw/ d45vwRKjqX0jBnvdx0vpNVBVpiMnkHhJZgLjKGrzEU5nv8fWBjdS1g+FgfI1tA== 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=1715974264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q2+5eoMIi82sH3rV8MyIAppvznkvF8+8pyDDGHjU3cY=; b=Ql+o+cqlc2HZQcAuBPLNbGfp7WjkiJlXYN0D5QX5aHf7/IQu0WjFC047OEsiswbadAY41E 6vwK9d3msERkyjtp6XWlUexHrJG848gQkY6s+Fl6lQLag2imFDrlQu18vL/6/nkbhCPzxR x2NLcvI5ZoBRTLkHnXnCY7fWDOeFxnps0x+jogIn1hsN2qwNIesbpg/qU0eZjoDldxoOGJ PTDluiNRNmbepAvtaOka0yMTYoMLmGxwak7ipxv86zCa4fbmWO6TWuswIHLvZ2CJfGf5PK 8LTDdVSFD2FhVdlwczTvvwFeVt9ncm15ImbhWaYswgxkoqIsP4Sl2BLSOcigdQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vgxs44MlWztyV; Fri, 17 May 2024 19:31: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 44HJV45t099766; Fri, 17 May 2024 19:31:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HJV47F099763; Fri, 17 May 2024 19:31:04 GMT (envelope-from git) Date: Fri, 17 May 2024 19:31:04 GMT Message-Id: <202405171931.44HJV47F099763@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: e14f7d11cb2f - stable/14 - sound: Move chip.h contents to pcm/sound.h List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e14f7d11cb2f30324b8af06ffdbd7af03c27f473 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=e14f7d11cb2f30324b8af06ffdbd7af03c27f473 commit e14f7d11cb2f30324b8af06ffdbd7af03c27f473 Author: Christos Margiolis AuthorDate: 2024-05-06 18:32:12 +0000 Commit: Christos Margiolis CommitDate: 2024-05-17 19:30:35 +0000 sound: Move chip.h contents to pcm/sound.h Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D44997 (cherry picked from commit 923e0040a59af8ac2271d3e673fef1c641d0cce7) --- sys/dev/sound/chip.h | 47 ---------------------------------------- sys/dev/sound/pci/csa.c | 1 - sys/dev/sound/pci/csamidi.c | 1 - sys/dev/sound/pci/csapcm.c | 1 - sys/dev/sound/pci/emu10kx-midi.c | 1 - sys/dev/sound/pci/emu10kx-pcm.c | 1 - sys/dev/sound/pci/emu10kx.c | 1 - sys/dev/sound/pci/hdspe-pcm.c | 1 - sys/dev/sound/pci/hdspe.c | 1 - sys/dev/sound/pci/solo.c | 1 - sys/dev/sound/pcm/sound.h | 16 ++++++++++++++ sys/dev/sound/usb/uaudio.c | 1 - sys/dev/sound/usb/uaudio_pcm.c | 1 - 13 files changed, 16 insertions(+), 58 deletions(-) diff --git a/sys/dev/sound/chip.h b/sys/dev/sound/chip.h deleted file mode 100644 index bb40d2809a00..000000000000 --- a/sys/dev/sound/chip.h +++ /dev/null @@ -1,47 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 1999 Seigo Tanimura - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -/* - * These are the function codes assigned to the children of - * sound cards. - */ -enum { - SCF_PCM, - SCF_MIDI, - SCF_SYNTH, -}; - -/* - * This is the device information struct, used by - * a bridge device to pass the device function code - * to the children. - */ -struct sndcard_func { - int func; /* The function code. */ - void *varinfo; /* Bridge-specific information. */ -}; diff --git a/sys/dev/sound/pci/csa.c b/sys/dev/sound/pci/csa.c index 7bb7967b74e7..662f0de80188 100644 --- a/sys/dev/sound/pci/csa.c +++ b/sys/dev/sound/pci/csa.c @@ -45,7 +45,6 @@ #endif #include -#include #include #include diff --git a/sys/dev/sound/pci/csamidi.c b/sys/dev/sound/pci/csamidi.c index df1699092990..29d5548b0954 100644 --- a/sys/dev/sound/pci/csamidi.c +++ b/sys/dev/sound/pci/csamidi.c @@ -43,7 +43,6 @@ #include #include -#include #include #include diff --git a/sys/dev/sound/pci/csapcm.c b/sys/dev/sound/pci/csapcm.c index 71b9a0253cdb..c8424dd3e433 100644 --- a/sys/dev/sound/pci/csapcm.c +++ b/sys/dev/sound/pci/csapcm.c @@ -36,7 +36,6 @@ #include #include -#include #include #include diff --git a/sys/dev/sound/pci/emu10kx-midi.c b/sys/dev/sound/pci/emu10kx-midi.c index 4ed8e6c1dd9c..2a98562f8f39 100644 --- a/sys/dev/sound/pci/emu10kx-midi.c +++ b/sys/dev/sound/pci/emu10kx-midi.c @@ -43,7 +43,6 @@ #include "opt_snd.h" #endif -#include #include #include diff --git a/sys/dev/sound/pci/emu10kx-pcm.c b/sys/dev/sound/pci/emu10kx-pcm.c index 825a39fc4e63..bef6b596646e 100644 --- a/sys/dev/sound/pci/emu10kx-pcm.c +++ b/sys/dev/sound/pci/emu10kx-pcm.c @@ -43,7 +43,6 @@ #include "opt_snd.h" #endif -#include #include #include diff --git a/sys/dev/sound/pci/emu10kx.c b/sys/dev/sound/pci/emu10kx.c index d17f5fb16d34..0f938597e06c 100644 --- a/sys/dev/sound/pci/emu10kx.c +++ b/sys/dev/sound/pci/emu10kx.c @@ -49,7 +49,6 @@ #include "opt_snd.h" #endif -#include #include #include diff --git a/sys/dev/sound/pci/hdspe-pcm.c b/sys/dev/sound/pci/hdspe-pcm.c index db39b867879f..4bea6c65e087 100644 --- a/sys/dev/sound/pci/hdspe-pcm.c +++ b/sys/dev/sound/pci/hdspe-pcm.c @@ -34,7 +34,6 @@ #include #include -#include #include #include diff --git a/sys/dev/sound/pci/hdspe.c b/sys/dev/sound/pci/hdspe.c index e0197d1e981a..91d1f3ee1bf6 100644 --- a/sys/dev/sound/pci/hdspe.c +++ b/sys/dev/sound/pci/hdspe.c @@ -37,7 +37,6 @@ #include #include -#include #include #include diff --git a/sys/dev/sound/pci/solo.c b/sys/dev/sound/pci/solo.c index bee79e723696..82eabf3a4884 100644 --- a/sys/dev/sound/pci/solo.c +++ b/sys/dev/sound/pci/solo.c @@ -35,7 +35,6 @@ #include #include -#include #include "mixer_if.h" diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index 6c9f4c8f18b2..d2ec480b45b0 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -321,6 +321,22 @@ void snd_mtxassert(void *m); int sndstat_register(device_t dev, char *str); int sndstat_unregister(device_t dev); +/* These are the function codes assigned to the children of sound cards. */ +enum { + SCF_PCM, + SCF_MIDI, + SCF_SYNTH, +}; + +/* + * This is the device information struct, used by a bridge device to pass the + * device function code to the children. + */ +struct sndcard_func { + int func; /* The function code. */ + void *varinfo; /* Bridge-specific information. */ +}; + /* * this is rather kludgey- we need to duplicate these struct def'ns from sound.c * so that the macro versions of pcm_{,un}lock can dereference them. diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index 2351c2522021..d47eb86ed271 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -90,7 +90,6 @@ #include #include #include -#include #include "feeder_if.h" static int uaudio_default_rate = 0; /* use rate list */ diff --git a/sys/dev/sound/usb/uaudio_pcm.c b/sys/dev/sound/usb/uaudio_pcm.c index 9b17cb232907..0b3da9b20440 100644 --- a/sys/dev/sound/usb/uaudio_pcm.c +++ b/sys/dev/sound/usb/uaudio_pcm.c @@ -32,7 +32,6 @@ #endif #include -#include #include #include "mixer_if.h" From nobody Fri May 17 19:31:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgxs72rT6z5Lg00; Fri, 17 May 2024 19:31: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 4Vgxs66pYGz4vNT; Fri, 17 May 2024 19:31:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715974267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S+87ht6JG6/m5HegufX0Xx/dte2Eq0sqTzPMS8CyjT8=; b=biiEd2McebxQ+NXEhWr0vecZdGSLp93q+jXZRLwaPfr1dwtUSupiC8brwF6t8pmF2InlXX mGd1XwONGplETtI2TCirqrQNHh6XRfxq/SBeyp3tJr0+H+8mbHzzemmctK7wZ/UZLSh39Z RfRVUa21WE/zbhYyQG4ce8l4ajr+JG76UE1mu0wTqtoooRgmzwXltId7AtR8vFQUxDdei+ h9sh9thXGWBmjOi26h4/wbD46s0mtrfbWtay8rV37bqlHN8aObLCMXclx5ulhbgXU+JR+h sW++irRcNegbmuIff+qjRc43j4ETFeLehbHFCf6nQh+QiRIREq7cy8tLWJQIeg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974267; a=rsa-sha256; cv=none; b=MKChAtmNrO97VWDIKzP3ErWHbczsjI2lJk6Sj2Ca/OU++HB1RqaelC9VK6316eBZ1/XEm6 XNkxOIkr+BwoILlrBsJbY9cL7n46NlAu8PYVmG7ORdMrUNtEB6AURCJZ6vojlhho+oBNP2 wcYSQbCMpuv2pC2wOnHwbTzFi9VFDRGrwgDJ8tVvpa6nJapxEtmpdPyPvMpfBa1m+Y9Ok6 afe7b/qopWjTcHJH4kL6YXA+biOsre57ed7u3oPygRS91z8/cy8gg95SRSGNna/hnyZsPU 7L/Pu5e5Vt2DHXjROglzdKlCTknn3wW36diggzabtlMpnBeNLtXxFu99KtEm0A== 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=1715974267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S+87ht6JG6/m5HegufX0Xx/dte2Eq0sqTzPMS8CyjT8=; b=cBCY1Agk9Q+BFO6/sY0jaSMz+7pIKmFSLVtTFaDT7BfSi631jyjTWOcaXHr+Yb5y2cu5R9 lFZTe7na2AnWF0UiFyggrFrig849QfwgGLT2JqkP0JQR6t0A60CPY9xTHelPzr143DlrGv GX9qQsh2vsSESuB51eOUNQWPEwcY+GeEZyF3i4neQMyOucHwd7fD1KJR7hSt3ZP+PcuwVT qGk33lRoXQORnQzyJAik4ntA9bmJK+BcFdUYqTV2c0aePJxWQj3jvaI/7HMJ4S3+wCnzGY UlKTahHgVq/TlQP1r1AwCTPknuRdA9SPL1TAYa1OSZoOJ3T3Mpg8IHUpr1xLxQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vgxs66QwrzvfF; Fri, 17 May 2024 19:31:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44HJV6IN099856; Fri, 17 May 2024 19:31:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HJV6rT099853; Fri, 17 May 2024 19:31:06 GMT (envelope-from git) Date: Fri, 17 May 2024 19:31:06 GMT Message-Id: <202405171931.44HJV6rT099853@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 00b0cbf98bb7 - stable/14 - sound: Use nitems() where possible List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 00b0cbf98bb79298446f469d81b4d2eefe06be46 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=00b0cbf98bb79298446f469d81b4d2eefe06be46 commit 00b0cbf98bb79298446f469d81b4d2eefe06be46 Author: Christos Margiolis AuthorDate: 2024-05-06 18:32:35 +0000 Commit: Christos Margiolis CommitDate: 2024-05-17 19:30:35 +0000 sound: Use nitems() where possible No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D45014 (cherry picked from commit c597c557923288eff527594619a692a44ade909a) --- sys/dev/sound/pci/atiixp.c | 4 ++-- sys/dev/sound/pci/hda/hdaa.c | 11 +++++++---- sys/dev/sound/pci/ich.c | 4 ++-- sys/dev/sound/pci/maestro3.c | 4 ++-- sys/dev/sound/pcm/dsp.c | 4 ++-- sys/dev/sound/pcm/feeder_format.c | 15 ++++++--------- sys/dev/sound/pcm/feeder_matrix.c | 4 ++-- sys/dev/sound/pcm/feeder_volume.c | 2 +- sys/dev/sound/pcm/mixer.c | 4 ++-- sys/dev/sound/pcm/sound.c | 5 +++-- 10 files changed, 29 insertions(+), 28 deletions(-) diff --git a/sys/dev/sound/pci/atiixp.c b/sys/dev/sound/pci/atiixp.c index dcbf041f9605..eeb28bb08276 100644 --- a/sys/dev/sound/pci/atiixp.c +++ b/sys/dev/sound/pci/atiixp.c @@ -1168,12 +1168,12 @@ atiixp_release_resource(struct atiixp_info *sc) static int atiixp_pci_probe(device_t dev) { - int i; + size_t i; uint16_t devid, vendor; vendor = pci_get_vendor(dev); devid = pci_get_device(dev); - for (i = 0; i < sizeof(atiixp_hw) / sizeof(atiixp_hw[0]); i++) { + for (i = 0; i < nitems(atiixp_hw); i++) { if (vendor == atiixp_hw[i].vendor && devid == atiixp_hw[i].devid) { device_set_desc(dev, atiixp_hw[i].desc); diff --git a/sys/dev/sound/pci/hda/hdaa.c b/sys/dev/sound/pci/hda/hdaa.c index dcd10cb36510..e8d9ee12fffc 100644 --- a/sys/dev/sound/pci/hda/hdaa.c +++ b/sys/dev/sound/pci/hda/hdaa.c @@ -267,7 +267,8 @@ hdaa_channels_handler(struct hdaa_audio_as *as) struct hdaa_chan *ch = &devinfo->chans[as->chans[0]]; struct hdaa_widget *w; uint8_t *eld; - int i, total, sub, assume, channels; + int total, sub, assume, channels; + size_t i; uint16_t cpins, upins, tpins; cpins = upins = 0; @@ -347,7 +348,7 @@ hdaa_channels_handler(struct hdaa_audio_as *as) printf("\n"); ); /* Look for maximal fitting matrix. */ - for (i = 0; i < sizeof(matrixes) / sizeof(struct matrix); i++) { + for (i = 0; i < nitems(matrixes); i++) { if (as->pinset != 0 && matrixes[i].analog == 0) continue; if ((matrixes[i].m.mask & ~channels) == 0) { @@ -1252,7 +1253,8 @@ hdaa_sysctl_config(SYSCTL_HANDLER_ARGS) static void hdaa_config_fetch(const char *str, uint32_t *on, uint32_t *off) { - int i = 0, j, k, len, inv; + size_t k; + int i = 0, j, len, inv; for (;;) { while (str[i] != '\0' && @@ -1292,7 +1294,8 @@ static int hdaa_sysctl_quirks(SYSCTL_HANDLER_ARGS) { char buf[256]; - int error, n = 0, i; + int error, n = 0; + size_t i; uint32_t quirks, quirks_off; quirks = *(uint32_t *)oidp->oid_arg1; diff --git a/sys/dev/sound/pci/ich.c b/sys/dev/sound/pci/ich.c index fbde0accfd28..910a371c6653 100644 --- a/sys/dev/sound/pci/ich.c +++ b/sys/dev/sound/pci/ich.c @@ -860,12 +860,12 @@ ich_init(struct sc_info *sc) static int ich_pci_probe(device_t dev) { - int i; + size_t i; uint16_t devid, vendor; vendor = pci_get_vendor(dev); devid = pci_get_device(dev); - for (i = 0; i < sizeof(ich_devs)/sizeof(ich_devs[0]); i++) { + for (i = 0; i < nitems(ich_devs); i++) { if (vendor == ich_devs[i].vendor && devid == ich_devs[i].devid) { device_set_desc(dev, ich_devs[i].name); diff --git a/sys/dev/sound/pci/maestro3.c b/sys/dev/sound/pci/maestro3.c index 6dd54a66f683..4d6dca310eea 100644 --- a/sys/dev/sound/pci/maestro3.c +++ b/sys/dev/sound/pci/maestro3.c @@ -488,7 +488,7 @@ m3_pchan_init(kobj_t kobj, void *devinfo, struct snd_dbuf *b, struct pcm_channel DMAC_BLOCKF_SELECTOR); /* set an armload of static initializers */ - for(i = 0 ; i < (sizeof(pv) / sizeof(pv[0])) ; i++) { + for(i = 0 ; i < nitems(pv); i++) { m3_wr_assp_data(sc, ch->dac_data + pv[i].addr, pv[i].val); } @@ -862,7 +862,7 @@ m3_rchan_init(kobj_t kobj, void *devinfo, struct snd_dbuf *b, struct pcm_channel DMAC_PAGE3_SELECTOR + DMAC_BLOCKF_SELECTOR); /* set an armload of static initializers */ - for(i = 0 ; i < (sizeof(rv) / sizeof(rv[0])) ; i++) { + for(i = 0 ; i < nitems(rv); i++) { m3_wr_assp_data(sc, ch->adc_data + rv[i].addr, rv[i].val); } diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 6c3d76e27b6b..fe816db54697 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -1966,7 +1966,7 @@ dsp_clone(void *arg, struct ucred *cred, char *name, int namelen, struct cdev **dev) { struct snddev_info *d; - int i; + size_t i; if (*dev != NULL) return; @@ -2017,7 +2017,7 @@ SYSUNINIT(dsp_sysuninit, SI_SUB_DRIVERS, SI_ORDER_MIDDLE, dsp_sysuninit, NULL); char * dsp_unit2name(char *buf, size_t len, struct pcm_channel *ch) { - int i; + size_t i; KASSERT(buf != NULL && len != 0, ("bogus buf=%p len=%ju", buf, (uintmax_t)len)); diff --git a/sys/dev/sound/pcm/feeder_format.c b/sys/dev/sound/pcm/feeder_format.c index 1e18e3e07450..3bdd808df0ee 100644 --- a/sys/dev/sound/pcm/feeder_format.c +++ b/sys/dev/sound/pcm/feeder_format.c @@ -115,16 +115,13 @@ static const struct { } }; -#define FEEDFORMAT_TAB_SIZE \ - ((int32_t)(sizeof(feed_format_ops) / sizeof(feed_format_ops[0]))) - static int feed_format_init(struct pcm_feeder *f) { struct feed_format_info *info; intpcm_read_t *rd_op; intpcm_write_t *wr_op; - int i; + size_t i; if (f->desc->in == f->desc->out || AFMT_CHANNEL(f->desc->in) != AFMT_CHANNEL(f->desc->out)) @@ -133,7 +130,7 @@ feed_format_init(struct pcm_feeder *f) rd_op = NULL; wr_op = NULL; - for (i = 0; i < FEEDFORMAT_TAB_SIZE && + for (i = 0; i < nitems(feed_format_ops) && (rd_op == NULL || wr_op == NULL); i++) { if (rd_op == NULL && AFMT_ENCODING(f->desc->in) == feed_format_ops[i].format) @@ -276,9 +273,9 @@ FEEDER_DECLARE(feeder_format, NULL); intpcm_read_t * feeder_format_read_op(uint32_t format) { - int i; + size_t i; - for (i = 0; i < FEEDFORMAT_TAB_SIZE; i++) { + for (i = 0; i < nitems(feed_format_ops); i++) { if (AFMT_ENCODING(format) == feed_format_ops[i].format) return (feed_format_ops[i].read); } @@ -289,9 +286,9 @@ feeder_format_read_op(uint32_t format) intpcm_write_t * feeder_format_write_op(uint32_t format) { - int i; + size_t i; - for (i = 0; i < FEEDFORMAT_TAB_SIZE; i++) { + for (i = 0; i < nitems(feed_format_ops); i++) { if (AFMT_ENCODING(format) == feed_format_ops[i].format) return (feed_format_ops[i].write); } diff --git a/sys/dev/sound/pcm/feeder_matrix.c b/sys/dev/sound/pcm/feeder_matrix.c index f5f02e2bf4f5..97cf86585636 100644 --- a/sys/dev/sound/pcm/feeder_matrix.c +++ b/sys/dev/sound/pcm/feeder_matrix.c @@ -230,7 +230,7 @@ feed_matrix_reset(struct feed_matrix_info *info) { uint32_t i, j; - for (i = 0; i < (sizeof(info->matrix) / sizeof(info->matrix[0])); i++) { + for (i = 0; i < nitems(info->matrix); i++) { for (j = 0; j < (sizeof(info->matrix[i].chn) / sizeof(info->matrix[i].chn[0])); j++) { @@ -679,7 +679,7 @@ feeder_matrix_compare(struct pcmchan_matrix *m_in, struct pcmchan_matrix *m_out) m_in->mask != m_out->mask) return (1); - for (i = 0; i < (sizeof(m_in->map) / sizeof(m_in->map[0])); i++) { + for (i = 0; i < nitems(m_in->map); i++) { if (m_in->map[i].type != m_out->map[i].type) return (1); if (m_in->map[i].type == SND_CHN_T_MAX) diff --git a/sys/dev/sound/pcm/feeder_volume.c b/sys/dev/sound/pcm/feeder_volume.c index 452d8788a5a5..7e600c131afe 100644 --- a/sys/dev/sound/pcm/feeder_volume.c +++ b/sys/dev/sound/pcm/feeder_volume.c @@ -337,7 +337,7 @@ feeder_volume_apply_matrix(struct pcm_feeder *f, struct pcmchan_matrix *m) info = f->data; - for (i = 0; i < (sizeof(info->matrix) / sizeof(info->matrix[0])); i++) { + for (i = 0; i < nitems(info->matrix); i++) { if (i < m->channels) info->matrix[i] = m->map[i].type; else diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c index 3e197b120c9d..4e67a0227506 100644 --- a/sys/dev/sound/pcm/mixer.c +++ b/sys/dev/sound/pcm/mixer.c @@ -650,7 +650,7 @@ mixer_obj_create(device_t dev, kobj_class_t cls, void *devinfo, int type, const char *desc) { struct snd_mixer *m; - int i; + size_t i; KASSERT(dev != NULL && cls != NULL && devinfo != NULL, ("%s(): NULL data dev=%p cls=%p devinfo=%p", @@ -671,7 +671,7 @@ mixer_obj_create(device_t dev, kobj_class_t cls, void *devinfo, m->devinfo = devinfo; m->busy = 0; m->dev = dev; - for (i = 0; i < (sizeof(m->parent) / sizeof(m->parent[0])); i++) { + for (i = 0; i < nitems(m->parent); i++) { m->parent[i] = SOUND_MIXER_NONE; m->child[i] = 0; m->realdev[i] = i; diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index d2acfc403e8c..afa19f9f0624 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -880,7 +880,8 @@ sound_oss_sysinfo(oss_sysinfo *si) struct snddev_info *d; struct pcm_channel *c; - int i, j, ncards; + int j, ncards; + size_t i; ncards = 0; @@ -958,7 +959,7 @@ sound_oss_sysinfo(oss_sysinfo *si) * Si->filler is a reserved array, but according to docs each * element should be set to -1. */ - for (i = 0; i < sizeof(si->filler)/sizeof(si->filler[0]); i++) + for (i = 0; i < nitems(si->filler); i++) si->filler[i] = -1; } From nobody Fri May 17 19:31:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgxs81ZNJz5LgCX; Fri, 17 May 2024 19:31: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 4Vgxs80Xqtz4vL6; Fri, 17 May 2024 19:31:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715974268; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ur0pnZnstyFqpgOmu+FMwGHpoxVKWD1dI9MtsKaj6JU=; b=kaviHFYBGDJs3wxvaCySldaG7FIMJhqsid0jnK6/J4CfH+cOOPiejU7OFNI1SUz3rRJHp6 lWmbV3HMOt9OXCJWWu5MzoybTr22kAi4sSNBirHLdL2Z4Dj94pk5UpEPfH70TfJtucPw8a R7GGNrY9HJ6S9kzR9T0CtInbWE9gWlMDEi3R5+W1o9Vn9tQhPfjNz+n7zvmIJo/uAz2228 ZVmXyhfRVSyVOvQeZAvimOfRKOEj+6mRuKL9BNhs7cP8lR2L0uaiQW9p/+f6CI98o0r7Rd u4EDFr7bm6JTd8zLo57PRefArH9FZk/LnRrDXbxr3mJ8y5kOrs6l36rg2OXouQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974268; a=rsa-sha256; cv=none; b=uIGeidbsmbH8Wv7NLmOK8jeECrC7NGZ1vLUmqrXXBiPh9CcfEGQcpJGgMsgiwDOATO0a4/ ogND9thLP/5IVsY8y+8mOSkSREGmeaVm2S2QzEsUlouR/sWJgFtgAJ3UQr0fhB6PEsetLi igJDtMynCvIAqNGngbYCb1oKF7MT+qB4R1ezEbbDKWiiasYP7CkaqWBLAUdHNMcwWDgBQf C661XiYj5HpeyZtABDjspS6quczRkZV4Jkaiwm7PJqge/48j50mjjZGzfMjMgNjS5hzqja t28ehegwAPsvHR8RTVABDod9DIq8yQ9RiDBwvnQZYxHd4z2zyrH82UhflLVUhA== 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=1715974268; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ur0pnZnstyFqpgOmu+FMwGHpoxVKWD1dI9MtsKaj6JU=; b=cPkb1marPdxgTxE5TjRV74HDPRpDy4ART4rvx1U7xcChw21i6ozF7tGafhskVd83LJjgK9 L+USxxwg+PY04myKEwxgHNRz1WSiZqD8yE5ZoRfsZmZqf84CjnUfMVZ7R0AJJDjdboO+k+ cq4EHhOVvHutqt12PndUyfKutA3K5eUPgrHdyynxYLVk5cxIgYaxPFLgS351WjoiCW/Ezv UbEpn9snvS7XbOP44Qyci2wEU+ozz0vbmQJXQCZCKCHTVU4497Z5flfpfgiB3+C+7bkoAU Y7eb/31J2U8iSolC0T7SIlhfXHqfpsgFITBXcnCqhbP9KvZ5wNK0ec31CxVp+A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vgxs808m5zvvq; Fri, 17 May 2024 19:31: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 44HJV7jp099901; Fri, 17 May 2024 19:31:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HJV7lj099898; Fri, 17 May 2024 19:31:07 GMT (envelope-from git) Date: Fri, 17 May 2024 19:31:07 GMT Message-Id: <202405171931.44HJV7lj099898@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: ab7c01f9e82c - stable/14 - sound: Move vchan-related code to pcm/vchan.* List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ab7c01f9e82cbf63d3b51d392ebfa1112bea14ef Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=ab7c01f9e82cbf63d3b51d392ebfa1112bea14ef commit ab7c01f9e82cbf63d3b51d392ebfa1112bea14ef Author: Christos Margiolis AuthorDate: 2024-05-06 18:32:46 +0000 Commit: Christos Margiolis CommitDate: 2024-05-17 19:30:35 +0000 sound: Move vchan-related code to pcm/vchan.* pcm/sound.* contains code that should be part of pcm/vchan.*. Changes: - pcm_setvchans() -> vchan_setnew() - pcm_setmaxautovchans() -> vchan_setmaxauto() - hw.snd.maxautovchans moved to pcm/vchan.c - snd_maxautovchans declaration moved to pcm/vchan.h and definition to pcm/vchan.c Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D45015 (cherry picked from commit 7ad5f383fcb507482d5606c8eb7a324b3621a9db) --- sys/dev/sound/pcm/feeder.c | 1 + sys/dev/sound/pcm/sound.c | 176 +-------------------------------------------- sys/dev/sound/pcm/sound.h | 2 - sys/dev/sound/pcm/vchan.c | 173 +++++++++++++++++++++++++++++++++++++++++++- sys/dev/sound/pcm/vchan.h | 5 ++ 5 files changed, 180 insertions(+), 177 deletions(-) diff --git a/sys/dev/sound/pcm/feeder.c b/sys/dev/sound/pcm/feeder.c index 78443ad76140..0113299bd0d4 100644 --- a/sys/dev/sound/pcm/feeder.c +++ b/sys/dev/sound/pcm/feeder.c @@ -32,6 +32,7 @@ #endif #include +#include #include "feeder_if.h" diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index afa19f9f0624..971054261030 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -56,8 +56,6 @@ static int snd_unit_auto = -1; SYSCTL_INT(_hw_snd, OID_AUTO, default_auto, CTLFLAG_RWTUN, &snd_unit_auto, 0, "assign default unit to a newly attached device"); -int snd_maxautovchans = 16; - SYSCTL_NODE(_hw, OID_AUTO, snd, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Sound driver"); @@ -111,126 +109,6 @@ snd_setup_intr(device_t dev, struct resource *res, int flags, driver_intr_t hand return bus_setup_intr(dev, res, flags, NULL, hand, param, cookiep); } -int -pcm_setvchans(struct snddev_info *d, int direction, int newcnt, int num) -{ - struct pcm_channel *c, *ch, *nch; - struct pcmchan_caps *caps; - int i, err, vcnt; - - PCM_BUSYASSERT(d); - - if ((direction == PCMDIR_PLAY && d->playcount < 1) || - (direction == PCMDIR_REC && d->reccount < 1)) - return (ENODEV); - - if (!(d->flags & SD_F_AUTOVCHAN)) - return (EINVAL); - - if (newcnt < 0 || newcnt > SND_MAXVCHANS) - return (E2BIG); - - if (direction == PCMDIR_PLAY) - vcnt = d->pvchancount; - else if (direction == PCMDIR_REC) - vcnt = d->rvchancount; - else - return (EINVAL); - - if (newcnt > vcnt) { - KASSERT(num == -1 || - (num >= 0 && num < SND_MAXVCHANS && (newcnt - 1) == vcnt), - ("bogus vchan_create() request num=%d newcnt=%d vcnt=%d", - num, newcnt, vcnt)); - /* add new vchans - find a parent channel first */ - ch = NULL; - CHN_FOREACH(c, d, channels.pcm) { - CHN_LOCK(c); - if (c->direction == direction && - ((c->flags & CHN_F_HAS_VCHAN) || (vcnt == 0 && - c->refcount < 1 && - !(c->flags & (CHN_F_BUSY | CHN_F_VIRTUAL))))) { - /* - * Reuse hw channel with vchans already - * created. - */ - if (c->flags & CHN_F_HAS_VCHAN) { - ch = c; - break; - } - /* - * No vchans ever created, look for - * channels with supported formats. - */ - caps = chn_getcaps(c); - if (caps == NULL) { - CHN_UNLOCK(c); - continue; - } - for (i = 0; caps->fmtlist[i] != 0; i++) { - if (caps->fmtlist[i] & AFMT_CONVERTIBLE) - break; - } - if (caps->fmtlist[i] != 0) { - ch = c; - break; - } - } - CHN_UNLOCK(c); - } - if (ch == NULL) - return (EBUSY); - ch->flags |= CHN_F_BUSY; - err = 0; - while (err == 0 && newcnt > vcnt) { - err = vchan_create(ch, num); - if (err == 0) - vcnt++; - else if (err == E2BIG && newcnt > vcnt) - device_printf(d->dev, - "%s: err=%d Maximum channel reached.\n", - __func__, err); - } - if (vcnt == 0) - ch->flags &= ~CHN_F_BUSY; - CHN_UNLOCK(ch); - if (err != 0) - return (err); - } else if (newcnt < vcnt) { - KASSERT(num == -1, - ("bogus vchan_destroy() request num=%d", num)); - CHN_FOREACH(c, d, channels.pcm) { - CHN_LOCK(c); - if (c->direction != direction || - CHN_EMPTY(c, children) || - !(c->flags & CHN_F_HAS_VCHAN)) { - CHN_UNLOCK(c); - continue; - } - CHN_FOREACH_SAFE(ch, c, nch, children) { - CHN_LOCK(ch); - if (vcnt == 1 && c->refcount > 0) { - CHN_UNLOCK(ch); - break; - } - if (!(ch->flags & CHN_F_BUSY) && - ch->refcount < 1) { - err = vchan_destroy(ch); - if (err == 0) - vcnt--; - } else - CHN_UNLOCK(ch); - if (vcnt == newcnt) - break; - } - CHN_UNLOCK(c); - break; - } - } - - return (0); -} - /* return error status and a locked channel */ int pcm_chnalloc(struct snddev_info *d, struct pcm_channel **ch, int direction, @@ -287,7 +165,7 @@ vchan_alloc: /* no channel available */ if (!(vchancount > 0 && vchancount < snd_maxautovchans)) return (err); - err = pcm_setvchans(d, direction, vchancount + 1, -1); + err = vchan_setnew(d, direction, vchancount + 1, -1); if (err == 0) { retry = true; goto retry_chnalloc; @@ -296,25 +174,6 @@ vchan_alloc: return (err); } -static void -pcm_setmaxautovchans(struct snddev_info *d, int num) -{ - PCM_BUSYASSERT(d); - - if (num < 0) - return; - - if (num >= 0 && d->pvchancount > num) - (void)pcm_setvchans(d, PCMDIR_PLAY, num, -1); - else if (num > 0 && d->pvchancount == 0) - (void)pcm_setvchans(d, PCMDIR_PLAY, 1, -1); - - if (num >= 0 && d->rvchancount > num) - (void)pcm_setvchans(d, PCMDIR_REC, num, -1); - else if (num > 0 && d->rvchancount == 0) - (void)pcm_setvchans(d, PCMDIR_REC, 1, -1); -} - static int sysctl_hw_snd_default_unit(SYSCTL_HANDLER_ARGS) { @@ -338,37 +197,6 @@ SYSCTL_PROC(_hw_snd, OID_AUTO, default_unit, sizeof(int), sysctl_hw_snd_default_unit, "I", "default sound device"); -static int -sysctl_hw_snd_maxautovchans(SYSCTL_HANDLER_ARGS) -{ - struct snddev_info *d; - int i, v, error; - - v = snd_maxautovchans; - error = sysctl_handle_int(oidp, &v, 0, req); - if (error == 0 && req->newptr != NULL) { - if (v < 0) - v = 0; - if (v > SND_MAXVCHANS) - v = SND_MAXVCHANS; - snd_maxautovchans = v; - for (i = 0; pcm_devclass != NULL && - i < devclass_get_maxunit(pcm_devclass); i++) { - d = devclass_get_softc(pcm_devclass, i); - if (!PCM_REGISTERED(d)) - continue; - PCM_ACQUIRE_QUICK(d); - pcm_setmaxautovchans(d, v); - PCM_RELEASE_QUICK(d); - } - } - return (error); -} -SYSCTL_PROC(_hw_snd, OID_AUTO, maxautovchans, - CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, 0, sizeof(int), - sysctl_hw_snd_maxautovchans, "I", - "maximum virtual channel"); - void pcm_chn_add(struct snddev_info *d, struct pcm_channel *ch) { @@ -549,7 +377,7 @@ pcm_setstatus(device_t dev, char *str) if (d->playcount > 0 || d->reccount > 0) d->flags |= SD_F_AUTOVCHAN; - pcm_setmaxautovchans(d, snd_maxautovchans); + vchan_setmaxauto(d, snd_maxautovchans); strlcpy(d->status, str, SND_STATUSLEN); diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index 5a750440cbea..e4a3ba41ee7f 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -247,7 +247,6 @@ enum { extern int pcm_veto_load; extern int snd_unit; -extern int snd_maxautovchans; extern int snd_verbose; extern devclass_t pcm_devclass; extern struct unrhdr *pcmsg_unrhdr; @@ -265,7 +264,6 @@ extern struct unrhdr *pcmsg_unrhdr; SYSCTL_DECL(_hw_snd); -int pcm_setvchans(struct snddev_info *d, int direction, int newcnt, int num); int pcm_chnalloc(struct snddev_info *d, struct pcm_channel **ch, int direction, pid_t pid, char *comm); diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c index 1a21b7049b77..9df23298b742 100644 --- a/sys/dev/sound/pcm/vchan.c +++ b/sys/dev/sound/pcm/vchan.c @@ -57,6 +57,8 @@ struct vchan_info { int trigger; }; +int snd_maxautovchans = 16; + static void * vchan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir) @@ -337,7 +339,7 @@ sysctl_dev_pcm_vchans(SYSCTL_HANDLER_ARGS) cnt = 0; if (cnt > SND_MAXVCHANS) cnt = SND_MAXVCHANS; - err = pcm_setvchans(d, direction, cnt, -1); + err = vchan_setnew(d, direction, cnt, -1); } PCM_RELEASE_QUICK(d); @@ -930,6 +932,175 @@ vchan_sync(struct pcm_channel *c) return (ret); } +int +vchan_setnew(struct snddev_info *d, int direction, int newcnt, int num) +{ + struct pcm_channel *c, *ch, *nch; + struct pcmchan_caps *caps; + int i, err, vcnt; + + PCM_BUSYASSERT(d); + + if ((direction == PCMDIR_PLAY && d->playcount < 1) || + (direction == PCMDIR_REC && d->reccount < 1)) + return (ENODEV); + + if (!(d->flags & SD_F_AUTOVCHAN)) + return (EINVAL); + + if (newcnt < 0 || newcnt > SND_MAXVCHANS) + return (E2BIG); + + if (direction == PCMDIR_PLAY) + vcnt = d->pvchancount; + else if (direction == PCMDIR_REC) + vcnt = d->rvchancount; + else + return (EINVAL); + + if (newcnt > vcnt) { + KASSERT(num == -1 || + (num >= 0 && num < SND_MAXVCHANS && (newcnt - 1) == vcnt), + ("bogus vchan_create() request num=%d newcnt=%d vcnt=%d", + num, newcnt, vcnt)); + /* add new vchans - find a parent channel first */ + ch = NULL; + CHN_FOREACH(c, d, channels.pcm) { + CHN_LOCK(c); + if (c->direction == direction && + ((c->flags & CHN_F_HAS_VCHAN) || (vcnt == 0 && + c->refcount < 1 && + !(c->flags & (CHN_F_BUSY | CHN_F_VIRTUAL))))) { + /* + * Reuse hw channel with vchans already + * created. + */ + if (c->flags & CHN_F_HAS_VCHAN) { + ch = c; + break; + } + /* + * No vchans ever created, look for + * channels with supported formats. + */ + caps = chn_getcaps(c); + if (caps == NULL) { + CHN_UNLOCK(c); + continue; + } + for (i = 0; caps->fmtlist[i] != 0; i++) { + if (caps->fmtlist[i] & AFMT_CONVERTIBLE) + break; + } + if (caps->fmtlist[i] != 0) { + ch = c; + break; + } + } + CHN_UNLOCK(c); + } + if (ch == NULL) + return (EBUSY); + ch->flags |= CHN_F_BUSY; + err = 0; + while (err == 0 && newcnt > vcnt) { + err = vchan_create(ch, num); + if (err == 0) + vcnt++; + else if (err == E2BIG && newcnt > vcnt) + device_printf(d->dev, + "%s: err=%d Maximum channel reached.\n", + __func__, err); + } + if (vcnt == 0) + ch->flags &= ~CHN_F_BUSY; + CHN_UNLOCK(ch); + if (err != 0) + return (err); + } else if (newcnt < vcnt) { + KASSERT(num == -1, + ("bogus vchan_destroy() request num=%d", num)); + CHN_FOREACH(c, d, channels.pcm) { + CHN_LOCK(c); + if (c->direction != direction || + CHN_EMPTY(c, children) || + !(c->flags & CHN_F_HAS_VCHAN)) { + CHN_UNLOCK(c); + continue; + } + CHN_FOREACH_SAFE(ch, c, nch, children) { + CHN_LOCK(ch); + if (vcnt == 1 && c->refcount > 0) { + CHN_UNLOCK(ch); + break; + } + if (!(ch->flags & CHN_F_BUSY) && + ch->refcount < 1) { + err = vchan_destroy(ch); + if (err == 0) + vcnt--; + } else + CHN_UNLOCK(ch); + if (vcnt == newcnt) + break; + } + CHN_UNLOCK(c); + break; + } + } + + return (0); +} + +void +vchan_setmaxauto(struct snddev_info *d, int num) +{ + PCM_BUSYASSERT(d); + + if (num < 0) + return; + + if (num >= 0 && d->pvchancount > num) + (void)vchan_setnew(d, PCMDIR_PLAY, num, -1); + else if (num > 0 && d->pvchancount == 0) + (void)vchan_setnew(d, PCMDIR_PLAY, 1, -1); + + if (num >= 0 && d->rvchancount > num) + (void)vchan_setnew(d, PCMDIR_REC, num, -1); + else if (num > 0 && d->rvchancount == 0) + (void)vchan_setnew(d, PCMDIR_REC, 1, -1); +} + +static int +sysctl_hw_snd_maxautovchans(SYSCTL_HANDLER_ARGS) +{ + struct snddev_info *d; + int i, v, error; + + v = snd_maxautovchans; + error = sysctl_handle_int(oidp, &v, 0, req); + if (error == 0 && req->newptr != NULL) { + if (v < 0) + v = 0; + if (v > SND_MAXVCHANS) + v = SND_MAXVCHANS; + snd_maxautovchans = v; + for (i = 0; pcm_devclass != NULL && + i < devclass_get_maxunit(pcm_devclass); i++) { + d = devclass_get_softc(pcm_devclass, i); + if (!PCM_REGISTERED(d)) + continue; + PCM_ACQUIRE_QUICK(d); + vchan_setmaxauto(d, v); + PCM_RELEASE_QUICK(d); + } + } + return (error); +} +SYSCTL_PROC(_hw_snd, OID_AUTO, maxautovchans, + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, 0, sizeof(int), + sysctl_hw_snd_maxautovchans, "I", "maximum virtual channel"); + void vchan_initsys(device_t dev) { diff --git a/sys/dev/sound/pcm/vchan.h b/sys/dev/sound/pcm/vchan.h index e2dcc9761261..dcc1d6e9ff32 100644 --- a/sys/dev/sound/pcm/vchan.h +++ b/sys/dev/sound/pcm/vchan.h @@ -30,6 +30,8 @@ #ifndef _SND_VCHAN_H_ #define _SND_VCHAN_H_ +extern int snd_maxautovchans; + int vchan_create(struct pcm_channel *, int); int vchan_destroy(struct pcm_channel *); @@ -45,6 +47,9 @@ int vchan_sync(struct pcm_channel *); sndbuf_getfmt((c)->bufhard) != (c)->parentchannel->format || \ sndbuf_getspd((c)->bufhard) != (c)->parentchannel->speed)) +int vchan_setnew(struct snddev_info *, int, int, int); +void vchan_setmaxauto(struct snddev_info *, int); + void vchan_initsys(device_t); /* From nobody Fri May 17 19:31:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgxsB3tyfz5LgR7; Fri, 17 May 2024 19:31:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgxsB2rTnz4vZ5; Fri, 17 May 2024 19:31:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715974270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0EshoxT94u4VppSdJj7+4lzIL+TEI/Vf4QU89UHkflU=; b=l615tQ6ee0eXstynnkvMbhDE74SIB51P7r4Iy6HW1NhK8FaFUuTC+fT0B0FHEWrYf9+wv+ N3XEVZBodIkVEnKOD/wWq6iBafl0Z0/nms+BTzbpU/LqBGMlDKbjgWQP3u7FNFS4Hjveb8 84J/Lf38qA3Wpvvupf+7wwfzamhA6EPVwCM4g4Yi2syp6tYj0uVabEHf18BSBdTyN8EgW1 A03xSPqa8u21FKfEM1Y7GAwm3eDLAeNGTjxvAH4iGHsU6dwu8fA1IQzThO+NgjkmnXvpy2 +Su1zJyt4x9Vr+W1m+d7UIstFLfGVve2UWCX3DEg8jKF4t/o7s+j/rfu+sZyzA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974270; a=rsa-sha256; cv=none; b=O+fdHKxCOrGYFNg7UDcWCABXUu+79KxoouuxS31U3HhbuGAgvnjotzQg2vDU3r2uwVwDNG +xbMWSYW/bV/67YbZdV/N2Ca/YyijwY0rK3OEgOgkW6U06sxe2vwhtV+epUd8rHyQkxNJ/ 3/vYuGqCyVE72/EXTHDY8VgXDRdVoWQesUbtxIvgIJZ09hng2EMVWKFETzqIhy5gh9U1vQ BJk7df3fUXlsYJ3J2vkScuQa3SSkm2d/M7nnIhSU6Lb+PlTdtZaUB7Uc1338XSnKjCUtGS oBvW9FcVd6NUpJo3j5u+Dcdjm+42hZDWv0/WsSmAX8GAj3WL+myi93NABpsN8A== 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=1715974270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0EshoxT94u4VppSdJj7+4lzIL+TEI/Vf4QU89UHkflU=; b=dVHvXNkH7e5UOJlFoaBpuvuSyk9bMrdhtVMMRMRdbBMF3Vb4xDnfQ0ySRUW8yN/m5rwUKf lfRlZ89bnJ49F1kqcx68U7YUkORazRGWCbgYLrroZD46YrqKB70Mx9HN17yrAPNyL2v6xc FK1HwrRV49gFiEIv7J57+HoXcv7LxI2CPoiqkCfKqhCE3/FR7STi6+I6PychldKGQUIkNr QZ8t9/lylenA2AtQ3iByw235esMN0+WmZ1fAUUgLCfCHnvRebmyCSVHx64GvDrTtFZH4CO fpQea5SodFSxoUJcnE81EOn0zgezQYLc2hrw4BYZSOGWriSpvlFraqD1DvO9nA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgxsB2SRJzvTq; Fri, 17 May 2024 19:31: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 44HJVAp0000035; Fri, 17 May 2024 19:31:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HJVAaP000032; Fri, 17 May 2024 19:31:10 GMT (envelope-from git) Date: Fri, 17 May 2024 19:31:10 GMT Message-Id: <202405171931.44HJVAaP000032@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 17a50abe0e19 - stable/14 - sound: Remove unused "num" argument from chn_init() and related callers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 17a50abe0e195671bd5079537fcc22c0231572f0 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=17a50abe0e195671bd5079537fcc22c0231572f0 commit 17a50abe0e195671bd5079537fcc22c0231572f0 Author: Christos Margiolis AuthorDate: 2024-05-06 18:33:11 +0000 Commit: Christos Margiolis CommitDate: 2024-05-17 19:30:35 +0000 sound: Remove unused "num" argument from chn_init() and related callers It is always -1 (i.e unused). Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45095 (cherry picked from commit 3af2beb8b24ba21fb7e7fbd165a79b8eeff37712) --- sys/dev/sound/pcm/channel.c | 11 ++--------- sys/dev/sound/pcm/channel.h | 2 +- sys/dev/sound/pcm/sound.c | 4 ++-- sys/dev/sound/pcm/vchan.c | 27 ++++++++++++--------------- sys/dev/sound/pcm/vchan.h | 4 ++-- 5 files changed, 19 insertions(+), 29 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 996cb0cb04f7..846885b9d729 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -1159,7 +1159,7 @@ chn_reset(struct pcm_channel *c, uint32_t fmt, uint32_t spd) struct pcm_channel * chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, - int dir, int num, void *devinfo) + int dir, void *devinfo) { struct pcm_channel *c; struct feeder_class *fc; @@ -1169,7 +1169,6 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, PCM_BUSYASSERT(d); PCM_LOCKASSERT(d); - KASSERT(num >= -1, ("invalid num=%d", num)); switch (dir) { case PCMDIR_PLAY: @@ -1207,7 +1206,7 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, goto out1; } - unit = (num == -1) ? 0 : num; + unit = 0; if (*pnum >= max || unit >= max) { device_printf(d->dev, "%s(): unit=%d or pnum=%d >= than " @@ -1220,12 +1219,6 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, CHN_FOREACH(c, d, channels.pcm) { if (c->type != type) continue; - if (unit == c->unit && num != -1) { - device_printf(d->dev, - "%s(): channel num=%d already allocated\n", - __func__, unit); - goto out1; - } unit++; if (unit >= max) { device_printf(d->dev, diff --git a/sys/dev/sound/pcm/channel.h b/sys/dev/sound/pcm/channel.h index 6aca089a7c4d..445882a62f0a 100644 --- a/sys/dev/sound/pcm/channel.h +++ b/sys/dev/sound/pcm/channel.h @@ -260,7 +260,7 @@ int chn_flush(struct pcm_channel *c); int chn_poll(struct pcm_channel *c, int ev, struct thread *td); struct pcm_channel *chn_init(struct snddev_info *d, struct pcm_channel *parent, - kobj_class_t cls, int dir, int num, void *devinfo); + kobj_class_t cls, int dir, void *devinfo); void chn_kill(struct pcm_channel *c); void chn_shutdown(struct pcm_channel *c); int chn_release(struct pcm_channel *c); diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 971054261030..17a7138519ac 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -165,7 +165,7 @@ vchan_alloc: /* no channel available */ if (!(vchancount > 0 && vchancount < snd_maxautovchans)) return (err); - err = vchan_setnew(d, direction, vchancount + 1, -1); + err = vchan_setnew(d, direction, vchancount + 1); if (err == 0) { retry = true; goto retry_chnalloc; @@ -274,7 +274,7 @@ pcm_addchan(device_t dev, int dir, kobj_class_t cls, void *devinfo) PCM_BUSYASSERT(d); PCM_LOCK(d); - ch = chn_init(d, NULL, cls, dir, -1, devinfo); + ch = chn_init(d, NULL, cls, dir, devinfo); if (!ch) { device_printf(d->dev, "chn_init(%s, %d, %p) failed\n", cls->name, dir, devinfo); diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c index 904ce6661675..8ba8138e55f1 100644 --- a/sys/dev/sound/pcm/vchan.c +++ b/sys/dev/sound/pcm/vchan.c @@ -339,7 +339,7 @@ sysctl_dev_pcm_vchans(SYSCTL_HANDLER_ARGS) cnt = 0; if (cnt > SND_MAXVCHANS) cnt = SND_MAXVCHANS; - err = vchan_setnew(d, direction, cnt, -1); + err = vchan_setnew(d, direction, cnt); } PCM_RELEASE_QUICK(d); @@ -664,7 +664,7 @@ sysctl_dev_pcm_vchanformat(SYSCTL_HANDLER_ARGS) "play.vchanrate" : "rec.vchanrate" int -vchan_create(struct pcm_channel *parent, int num) +vchan_create(struct pcm_channel *parent) { struct snddev_info *d; struct pcm_channel *ch; @@ -700,7 +700,7 @@ vchan_create(struct pcm_channel *parent, int num) } /* create a new playback channel */ - ch = chn_init(d, parent, &vchan_class, direction, num, parent); + ch = chn_init(d, parent, &vchan_class, direction, parent); if (ch == NULL) { PCM_UNLOCK(d); CHN_LOCK(parent); @@ -933,7 +933,7 @@ vchan_sync(struct pcm_channel *c) } int -vchan_setnew(struct snddev_info *d, int direction, int newcnt, int num) +vchan_setnew(struct snddev_info *d, int direction, int newcnt) { struct pcm_channel *c, *ch, *nch; struct pcmchan_caps *caps; @@ -959,10 +959,9 @@ vchan_setnew(struct snddev_info *d, int direction, int newcnt, int num) return (EINVAL); if (newcnt > vcnt) { - KASSERT(num == -1 || - (num >= 0 && num < SND_MAXVCHANS && (newcnt - 1) == vcnt), - ("bogus vchan_create() request num=%d newcnt=%d vcnt=%d", - num, newcnt, vcnt)); + KASSERT((newcnt - 1) == vcnt, + ("bogus vchan_create() request newcnt=%d vcnt=%d", + newcnt, vcnt)); /* add new vchans - find a parent channel first */ ch = NULL; CHN_FOREACH(c, d, channels.pcm) { @@ -1004,7 +1003,7 @@ vchan_setnew(struct snddev_info *d, int direction, int newcnt, int num) ch->flags |= CHN_F_BUSY; err = 0; while (err == 0 && newcnt > vcnt) { - err = vchan_create(ch, num); + err = vchan_create(ch); if (err == 0) vcnt++; else if (err == E2BIG && newcnt > vcnt) @@ -1018,8 +1017,6 @@ vchan_setnew(struct snddev_info *d, int direction, int newcnt, int num) if (err != 0) return (err); } else if (newcnt < vcnt) { - KASSERT(num == -1, - ("bogus vchan_destroy() request num=%d", num)); CHN_FOREACH(c, d, channels.pcm) { CHN_LOCK(c); if (c->direction != direction || @@ -1061,14 +1058,14 @@ vchan_setmaxauto(struct snddev_info *d, int num) return; if (num >= 0 && d->pvchancount > num) - (void)vchan_setnew(d, PCMDIR_PLAY, num, -1); + (void)vchan_setnew(d, PCMDIR_PLAY, num); else if (num > 0 && d->pvchancount == 0) - (void)vchan_setnew(d, PCMDIR_PLAY, 1, -1); + (void)vchan_setnew(d, PCMDIR_PLAY, 1); if (num >= 0 && d->rvchancount > num) - (void)vchan_setnew(d, PCMDIR_REC, num, -1); + (void)vchan_setnew(d, PCMDIR_REC, num); else if (num > 0 && d->rvchancount == 0) - (void)vchan_setnew(d, PCMDIR_REC, 1, -1); + (void)vchan_setnew(d, PCMDIR_REC, 1); } static int diff --git a/sys/dev/sound/pcm/vchan.h b/sys/dev/sound/pcm/vchan.h index dcc1d6e9ff32..1f0fa058cf71 100644 --- a/sys/dev/sound/pcm/vchan.h +++ b/sys/dev/sound/pcm/vchan.h @@ -32,7 +32,7 @@ extern int snd_maxautovchans; -int vchan_create(struct pcm_channel *, int); +int vchan_create(struct pcm_channel *); int vchan_destroy(struct pcm_channel *); #ifdef SND_DEBUG @@ -47,7 +47,7 @@ int vchan_sync(struct pcm_channel *); sndbuf_getfmt((c)->bufhard) != (c)->parentchannel->format || \ sndbuf_getspd((c)->bufhard) != (c)->parentchannel->speed)) -int vchan_setnew(struct snddev_info *, int, int, int); +int vchan_setnew(struct snddev_info *, int, int); void vchan_setmaxauto(struct snddev_info *, int); void vchan_initsys(device_t); From nobody Fri May 17 19:31:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vgxs94Nbhz5LgNd; Fri, 17 May 2024 19:31: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 4Vgxs91y2Dz4vgl; Fri, 17 May 2024 19:31:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715974269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EjNQWQ0VDddtgeJ94qv34NqQSWKIE7YgoxRjqoSmNj0=; b=wm9amEbh7VFgPUK7IhZpaiNq2J0fkxPDLjvOYzfVqtgjVXwOLslzz1v31ToiVHThwx/e+n J7JbJKxWAIT4SI4XdPYx/FWnoRA2jjoCFy2W+kxtDoNGa2K6lUxPOG2uAx6iBiwNqT8jZe cIvSzoSuNw0cvvHUw6Ivq/kt7lqWRc0Cn0iEtHMGfk2WsqqRvtEeH0GJmrtmPftUkGgCyt D+5bGhJhPtiT3AksMaDnQtqqhrzxUKHvEgqrZTJ5mPcIwuaSkrLn0qG9NM37AmswmMeKtK ouS0xO1YZCsIw56ZGG/cK8eS3Mcd804k7sxOwAvEPJ3LFG90MjGCYWDWmXUFAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974269; a=rsa-sha256; cv=none; b=QTEVNi+dfvh6uA3cPrU2gLaMOBS4whcWFn9IvKUZGgU4PfdRzYk94g07TEsZb69wbkin86 RQlL9QSkM4YaZEYlr8BJr/HvZYnagkE2pxDqMZ/O8PuD9D4DFD+xRHlWghp4beXPtO5fEt 3Pvqe/qWKloiYh4IYWXIDk2FdzAoSsUWydyX2VL9eHTcH1smLxnDNmmwfhHpE+/Pk17BIg iWP5ZJ33aLvUTrc0IuhDyglQL6ewJV5cCouXrWo+JsAp8hB8INyXVJRg7qTYwqPhG46J2N WgD//yEvdcC0RmpM7FlqsDwiCmCWi04KG3F3Cnxq+wmgMScTv3zIP5uxoFUKFQ== 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=1715974269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EjNQWQ0VDddtgeJ94qv34NqQSWKIE7YgoxRjqoSmNj0=; b=GgqoEtDiNFwmK/njLqKSEujhjGwJgZGrvXLHc6DkK6gbmDbW9HQtcKFgHKDFKM3CS3gsUg G+rdFXFQ9dpPb6lywfVKscqdGqpn6oNTAyI3ME/XO+yaP34y7yLkAcKy1KnF+bhXw1spnC ighPPsVC7WJ/H7LZjYM+AAmEnckmkjsrhLwI66XHyf+H6tK3gbzu2sOLtapNlC3ruhz8d6 1Yj1WpBaXSTU/QxsGHf1Nny2ZTNeIuWYEuCa5J0ADxD8rZeusD2DUmI+BIfiYhtQQVEoVO 8HbDUuljrFZQhQze7YzqAQdDEYv2B7hvjvR5IML9PYTq6+FCB13reALCu4y9zw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vgxs91YWVzvvr; Fri, 17 May 2024 19:31: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 44HJV9Rq099946; Fri, 17 May 2024 19:31:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HJV9Kh099943; Fri, 17 May 2024 19:31:09 GMT (envelope-from git) Date: Fri, 17 May 2024 19:31:09 GMT Message-Id: <202405171931.44HJV9Kh099943@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 99e372420df4 - stable/14 - sound: Rename pcm_getparentchannel() to vchan_getparentchannel() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 99e372420df4a8f1905b43c0f905de4a56795037 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=99e372420df4a8f1905b43c0f905de4a56795037 commit 99e372420df4a8f1905b43c0f905de4a56795037 Author: Christos Margiolis AuthorDate: 2024-05-06 18:32:57 +0000 Commit: Christos Margiolis CommitDate: 2024-05-17 19:30:35 +0000 sound: Rename pcm_getparentchannel() to vchan_getparentchannel() Follow the rest of the vchan.c naming convention. No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D45016 (cherry picked from commit 77ab4263bc42a5dcc102bbea39ce4f7f46b8d4f8) --- sys/dev/sound/pcm/vchan.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c index 9df23298b742..904ce6661675 100644 --- a/sys/dev/sound/pcm/vchan.c +++ b/sys/dev/sound/pcm/vchan.c @@ -251,7 +251,7 @@ static kobj_method_t vchan_methods[] = { CHANNEL_DECLARE(vchan); static void -pcm_getparentchannel(struct snddev_info *d, +vchan_getparentchannel(struct snddev_info *d, struct pcm_channel **wrch, struct pcm_channel **rdch) { struct pcm_channel **ch, *wch, *rch, *c; @@ -380,9 +380,9 @@ sysctl_dev_pcm_vchanmode(SYSCTL_HANDLER_ARGS) PCM_UNLOCK(d); if (direction == PCMDIR_PLAY) - pcm_getparentchannel(d, &c, NULL); + vchan_getparentchannel(d, &c, NULL); else - pcm_getparentchannel(d, NULL, &c); + vchan_getparentchannel(d, NULL, &c); if (c == NULL) { PCM_RELEASE_QUICK(d); @@ -482,9 +482,9 @@ sysctl_dev_pcm_vchanrate(SYSCTL_HANDLER_ARGS) PCM_UNLOCK(d); if (direction == PCMDIR_PLAY) - pcm_getparentchannel(d, &c, NULL); + vchan_getparentchannel(d, &c, NULL); else - pcm_getparentchannel(d, NULL, &c); + vchan_getparentchannel(d, NULL, &c); if (c == NULL) { PCM_RELEASE_QUICK(d); @@ -591,9 +591,9 @@ sysctl_dev_pcm_vchanformat(SYSCTL_HANDLER_ARGS) PCM_UNLOCK(d); if (direction == PCMDIR_PLAY) - pcm_getparentchannel(d, &c, NULL); + vchan_getparentchannel(d, &c, NULL); else - pcm_getparentchannel(d, NULL, &c); + vchan_getparentchannel(d, NULL, &c); if (c == NULL) { PCM_RELEASE_QUICK(d); From nobody Fri May 17 19:31:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgxsC70wLz5Lg49; Fri, 17 May 2024 19:31:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgxsC4J1vz4vZQ; Fri, 17 May 2024 19:31:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715974271; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pjule/1pAKYgsU+ss3LcqrK91taudkXLCYCXmW6mHEo=; b=ZRbOjfJ9Iz+vxEs/lM/+Z6oxsY1zLUt/P5DdFRI6VsIFHs2eJxIIzQ75i/YPPMkRXPfOqS 4DB4H0IMjaOaTNCoKtuZ2ozAZ2VcisDt2ifjAs5RyljSW2RRthkySqhMxWAcf9/nBpls+i ZnVUAvxn08naZtpDk3ctgAOnYM2VTxbjzfbK0rndLNn8qZtANKM46EdvoopHgcKjl8QEDc EYHUoa2rwpZXGqa81w/WfTu5aD1ruvgOvcIR7byJlfC11pu/fU7/XB5BAeE8CzG0BW7qdi 12v7G6KY+or3wE/ZWemFqLI8tuIblaA6uhAaeTakm79VwwW5j4J06ELwSa2eug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974271; a=rsa-sha256; cv=none; b=vyoIHzDedX+yzENMkdhVCpdRd1eX0CCvjM9XOWXLrhyCahsHo6WCbr9CnuWrZukpqYeQbK apI6JIV00SyaVk7nUH4Q3G6aEGqejmxGAzsS6WzZsRcGm+R8ZmTsJw75FO84ATdlCdFI4D EYTmgoSzIL7Pz69Mkfoc95XGfqJAqt6wAswH1hJEgfpRxri07ba0ymBCxlpPgb3RBr+tp4 TKMMzOKYS7JRlD4HFKgpnCUyqEdJkOEYC/JW67eM1DC3dwHWbT8nB1uM5Px90bVqwOWKet byL1RDT80F9BRf6SqwSCU7gnZ/jjaQf1WN/kye5kVB61kXzL7fZ32tMDadc0vA== 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=1715974271; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pjule/1pAKYgsU+ss3LcqrK91taudkXLCYCXmW6mHEo=; b=tYJqY67R54E3wpl09wbqMvALBebuPEqiAGkTjRmGbMoObMqwY2DH4kjZ/6g1Q21n3tnhNa txbMBySWyUJVNzgmdHUSRdH/SfRxcCA8jJ1/atwwPcuzwBZ0Bx7uFq9BvCkWeb+H6N5EcA hQHSmzwtfYu/GMRNA0rb0YHjgOMMKscfx1hTlV9nKx7T+VBU93qyJ9DLkwCqrlIml4u0sF QphLDLgkZOdxGc9rGQgvHWI9DvqBFw5uZJoF2yaA/qoS4ku5MOFyC0Qez+wG2D9ghYtE06 +5OKZrjVlH3nezAxZNhKpOx65Jy7YvfNeLey1/PrGH/zTjGfFwvfbnXaWJM0pg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgxsC3vKJztyZ; Fri, 17 May 2024 19:31:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44HJVBmJ000077; Fri, 17 May 2024 19:31:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HJVBXE000074; Fri, 17 May 2024 19:31:11 GMT (envelope-from git) Date: Fri, 17 May 2024 19:31:11 GMT Message-Id: <202405171931.44HJVBXE000074@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 00f9d84ee207 - stable/14 - sound: Update pcm/vchan.c LICENSE header List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 00f9d84ee2077b53325ed52bdaa11f21eab7abf9 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=00f9d84ee2077b53325ed52bdaa11f21eab7abf9 commit 00f9d84ee2077b53325ed52bdaa11f21eab7abf9 Author: Christos Margiolis AuthorDate: 2024-05-06 18:47:33 +0000 Commit: Christos Margiolis CommitDate: 2024-05-17 19:30:35 +0000 sound: Update pcm/vchan.c LICENSE header Sponsored by: The FreeBSD Foundation MFC after: 1 week (cherry picked from commit 2b14465faa8dd9d228b764359672b38b4c8ca8c1) --- sys/dev/sound/pcm/vchan.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c index 8ba8138e55f1..528c6fa62621 100644 --- a/sys/dev/sound/pcm/vchan.c +++ b/sys/dev/sound/pcm/vchan.c @@ -4,6 +4,10 @@ * Copyright (c) 2006-2009 Ariff Abdullah * Copyright (c) 2001 Cameron Grant * All rights reserved. + * Copyright (c) 2024 The FreeBSD Foundation + * + * Portions of this software were developed by Christos Margiolis + * 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 From nobody Fri May 17 19:31:12 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgxsF1Rrxz5Lg4C; Fri, 17 May 2024 19:31:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgxsD5WNnz4vJS; Fri, 17 May 2024 19:31:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715974272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tIBfSVQCG/27v1kHX4qqTouqUg4H+zmSyIrJq8Izds4=; b=M1fyl8B8bgkzy5uWu/B0DuxKdMO45+O3G5n6LHVhFHTpEzKPwr+EprCXBXhfbvdq+t7UEu OFcsrtkaiGGjjifQ5yttaH91X7yKSEHMyAu8o89AsIx2hEvWwnA3ftqR0h7SR6UgYXIM+L l6YBY7NyviJrgqK27utmfLE1yP4EN79u9oG/YCiXLV4HV05DwgGuHkUFtbaihM9sgygCMf ier6N3XEwqhbt489sdYBRd5XBuN4f//TlOKzcZ+gS9j7F1iH8iGkWylllPga/FrGzC+i/K OZ3E4eVoFEBRbx+3doMbQStUa4XlOSenzN9op0LlvRqE/B1grc5+DBvBdCskXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974272; a=rsa-sha256; cv=none; b=ALRNuHT/lN7TFh5K9PrWNf4SvwbmX577G8VoLndUc+6uLmgVsSl50JxucGDge9dtpTUmPm oWiv25xS4MiBQXZ1TApJQVJqSFuNPiPv2yxfLJfC3sN4iBCA+7q67Q3cPB4vNLBGuXStG0 m3QHnDsnMJWKRSYwP4jkTlEh3kghuVBmELpjAyGZre217ROPmRTpNllchQEbISnPcD8UA+ AcbkBGblpA4wPs/6Ef9p3Oz82CVLWVi6HCfMoYiBxrOLQyfQc+/Ty4DfxVYPNrcNT91QGi FJ/DVtwujFlmmtM53f4kRB5KLgqoESVg1h/ReyD6ha+9SIMsIrGs98UfOxGtqQ== 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=1715974272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tIBfSVQCG/27v1kHX4qqTouqUg4H+zmSyIrJq8Izds4=; b=rpEtObJTLzkbT5P4MlwOTzL1opWkS7FbaQGPNG6RSktDj3CailwNPjIKpH3jB9cQvL+UDe ypxMtP15D1pQSSAAUueRE6jh1wUwlQy14J/aWOe+w9gTqF86wkZ4z6jrMiQdHhrEnGADpY 1/Ffy7o1Wlx1gkO0N1CUQPgCQ8iOSQ7vOYBjJqqz6ssL8BE9vNlgiKpC1tFrAIgD1EhXTE OclkamVxsVZii4tq65+Z4/N1WZ9qo+V4wSGtM32U0aabfQAA15vGYJ1b6QbP8IR2AXlyTU WNDEZ13ZO44AJRNRnsk71SminOC/aqoc94/JJdTkNeK8HP/BN9d1SRWOtjcErQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgxsD54SJzvfJ; Fri, 17 May 2024 19:31:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44HJVCC1000122; Fri, 17 May 2024 19:31:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HJVC5F000119; Fri, 17 May 2024 19:31:12 GMT (envelope-from git) Date: Fri, 17 May 2024 19:31:12 GMT Message-Id: <202405171931.44HJVC5F000119@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 71b9b8d34bb7 - stable/14 - arm: Remove stray references to dev/sound/chip.h List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 71b9b8d34bb7c50179035be0297725210862e43c Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=71b9b8d34bb7c50179035be0297725210862e43c commit 71b9b8d34bb7c50179035be0297725210862e43c Author: Christos Margiolis AuthorDate: 2024-05-06 19:35:30 +0000 Commit: Christos Margiolis CommitDate: 2024-05-17 19:30:36 +0000 arm: Remove stray references to dev/sound/chip.h Fixes: 923e0040a59a ("sound: Move chip.h contents to pcm/sound.h") Reported by: Jenkins CI Sponsored by: The FreeBSD Foundation MFC after: 1 week (cherry picked from commit a3513995f549e2e649b89a1fecbfb351d9825bac) --- sys/arm/allwinner/a10_codec.c | 1 - sys/arm/broadcom/bcm2835/bcm2835_audio.c | 1 - sys/arm/freescale/imx/imx6_ssi.c | 1 - sys/arm/freescale/vybrid/vf_sai.c | 1 - 4 files changed, 4 deletions(-) diff --git a/sys/arm/allwinner/a10_codec.c b/sys/arm/allwinner/a10_codec.c index 05fb25d9b02d..036de684b788 100644 --- a/sys/arm/allwinner/a10_codec.c +++ b/sys/arm/allwinner/a10_codec.c @@ -41,7 +41,6 @@ #include #include -#include #include #include diff --git a/sys/arm/broadcom/bcm2835/bcm2835_audio.c b/sys/arm/broadcom/bcm2835/bcm2835_audio.c index e0f525fa9520..75a0c81f29a1 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_audio.c +++ b/sys/arm/broadcom/bcm2835/bcm2835_audio.c @@ -28,7 +28,6 @@ #endif #include -#include #include "mixer_if.h" diff --git a/sys/arm/freescale/imx/imx6_ssi.c b/sys/arm/freescale/imx/imx6_ssi.c index 931a2b677eae..6b23334a4e97 100644 --- a/sys/arm/freescale/imx/imx6_ssi.c +++ b/sys/arm/freescale/imx/imx6_ssi.c @@ -43,7 +43,6 @@ #include #include -#include #include #include diff --git a/sys/arm/freescale/vybrid/vf_sai.c b/sys/arm/freescale/vybrid/vf_sai.c index 5336dfc6dd57..3b3a120df4e1 100644 --- a/sys/arm/freescale/vybrid/vf_sai.c +++ b/sys/arm/freescale/vybrid/vf_sai.c @@ -44,7 +44,6 @@ #include #include -#include #include #include From nobody Fri May 17 19:31:13 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgxsG13Qhz5Lg07; Fri, 17 May 2024 19:31:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgxsF6Z3yz4vjn; Fri, 17 May 2024 19:31:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715974273; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0EfUPUNeH6AM500P13bCCayMMOjPVBj90YvTD0EmGgE=; b=BGPMUq0ZvjiLB4ftgMXDAh8myhfitCNg9RdNgO0u5K6Ce27yT/3zcNK8ZOjRf1uXEBZZgX 8eyX6FwzUOK+DwlXh00znrrPXFowRlwzMBwxQYCJdJQIcUKN0b6GD8H3TgIVyz2dxzHkhw YhtQQRXVQ0NqFysZczpSwMWpz/T/inM6ReGy6GjdADleWatzXtocFU7BqcLTfR24cP9pxn 6qHU+NWHXwE3ko//NXopzgJF6czt/68aO97shCIZDVq23Q2nFR5UTajL6rdouvRI4Hk4p2 rZGscXohibfGZc8K17eWZR9oOU/vH/0VRLPn14G/gxHYeeJF7AMAnyLNzuwPwg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974273; a=rsa-sha256; cv=none; b=kPqmtEm7D08QIQ7uBr4IWXbGqqsnObz0iiDLVyfstjEwtZCaipm1lAxH8qGEWAKH3Wx9e6 zo9J00tc/aM2Vg0lB62/3/qPwQFOiSl5XnT7astyn875rcQ3rAP/1RPQBbos/usZCRCQlA STY3fjJ4Q4+YUPH8AEkrHNjbnOFNrX5xK4BGjuwrO4oWWmyJqrpHAlLFnX/u2d/foVoT3F oOvp4aMJpyM3ONJc64QSXjeV+QUBqJsq5nDRxHo1j0fFuGR8PRRldLY7DGH4Ybz6YLXWO4 PzK5NpuRetiXitv1gZr+nPncFe09CuQczVho8b5DZiWvoy+3cxgktbOM9WwThA== 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=1715974273; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0EfUPUNeH6AM500P13bCCayMMOjPVBj90YvTD0EmGgE=; b=olKGf/lW5l0Fw7CwB6wngYoFQQm71qVaOVrGuiXUh389y20FuS4QSNLR/UC1mted+X0+J9 7Ree6Om+5vfm+i+aaSHAGecmdRLfOIZ4hAnpg0w+854G1FrgAPgtHm6dZda62w4FIoh6Yw mffmpOtExfyrFd7cNvWPp4A4q9RKts+4Gbk9fCA9Gs2PXPnQ+bjHsw2PUfl1Q+EnGunp9L KHAomHZ+PFkwcttlAvy1PyGB3ztbwKTfnNJ0hUP5sMQR9zTFrbqMwdB9rrwPw1Bqmzw4he IqvYpgC7309sFUwHQoeaszJyIf6BGbnHGVvj8LTaeRkuG/wfvf1KbrH7zzNnRw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgxsF6BQ5zvTr; Fri, 17 May 2024 19:31:13 +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 44HJVDfA000167; Fri, 17 May 2024 19:31:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HJVD4V000164; Fri, 17 May 2024 19:31:13 GMT (envelope-from git) Date: Fri, 17 May 2024 19:31:13 GMT Message-Id: <202405171931.44HJVD4V000164@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 8b4e2ba31d1b - stable/14 - sound: Remove nmix variable from mixer_oss_mixerinfo() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8b4e2ba31d1b171f688cb630f1827ec397ecaacb Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=8b4e2ba31d1b171f688cb630f1827ec397ecaacb commit 8b4e2ba31d1b171f688cb630f1827ec397ecaacb Author: Christos Margiolis AuthorDate: 2024-05-09 19:07:48 +0000 Commit: Christos Margiolis CommitDate: 2024-05-17 19:30:36 +0000 sound: Remove nmix variable from mixer_oss_mixerinfo() nmix is used to compare against oss_mixerinfo->dev, which is a user-supplied value to select the mixer device (if not -1, in which case we'll select the default one) we want to fetch the information of. It is also used to set oss_mixerinfo->dev in case it is -1. However, nmix is at best redundant, since we have the loop counter already (i), and confusing at worst. For example, suppose a system with 3 mixer devices. We call SNDCTL_MIXERINFO with oss_mixerinfo->dev=1, meaning we want to get information for /dev/mixer1. Suppose /dev/mixer0 detaches while inside the loop, so we'll hit the loop's "continue" case, and nmix won't get incremented (i.e will stay 0 for now). At this point nmix counts 1 device less, so when it reaches 1, we'll be fetching /dev/mixer2's information instead of /dev/mixer1's. This is also true in case the mixer device disappears prior to the call to mixer_oss_mixerinfo(). Simply remove nmix and use the loop counter to both set oss_mixerinfo->dev and check against it in case a non -1 value is supplied. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45135 (cherry picked from commit 2f31a5eb75f1e47b5c49f574e8ce48d2c863e9d3) --- sys/dev/sound/pcm/mixer.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c index 4e67a0227506..a37b94dce43a 100644 --- a/sys/dev/sound/pcm/mixer.c +++ b/sys/dev/sound/pcm/mixer.c @@ -1431,7 +1431,7 @@ mixer_oss_mixerinfo(struct cdev *i_dev, oss_mixerinfo *mi) { struct snddev_info *d; struct snd_mixer *m; - int nmix, i; + int i; /* * If probing the device handling the ioctl, make sure it's a mixer @@ -1442,7 +1442,6 @@ mixer_oss_mixerinfo(struct cdev *i_dev, oss_mixerinfo *mi) d = NULL; m = NULL; - nmix = 0; /* * There's a 1:1 relationship between mixers and PCM devices, so @@ -1462,7 +1461,7 @@ mixer_oss_mixerinfo(struct cdev *i_dev, oss_mixerinfo *mi) if (d->mixer_dev != NULL && d->mixer_dev->si_drv1 != NULL && ((mi->dev == -1 && d->mixer_dev == i_dev) || - mi->dev == nmix)) { + mi->dev == i)) { m = d->mixer_dev->si_drv1; mtx_lock(m->lock); @@ -1474,7 +1473,7 @@ mixer_oss_mixerinfo(struct cdev *i_dev, oss_mixerinfo *mi) * sure to unlock when existing. */ bzero((void *)mi, sizeof(*mi)); - mi->dev = nmix; + mi->dev = i; snprintf(mi->id, sizeof(mi->id), "mixer%d", i); strlcpy(mi->name, m->name, sizeof(mi->name)); mi->modify_counter = m->modify_counter; @@ -1538,8 +1537,7 @@ mixer_oss_mixerinfo(struct cdev *i_dev, oss_mixerinfo *mi) mi->legacy_device = i; */ mtx_unlock(m->lock); - } else - ++nmix; + } PCM_UNLOCK(d); From nobody Fri May 17 19:31:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgxsH3gpYz5LgB4; Fri, 17 May 2024 19:31:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgxsH0HVRz4vjx; Fri, 17 May 2024 19:31:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715974275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JLtgzeo2z7hCJVeUzcSE6D/3qC65vOwl/hgJ6XieufA=; b=hfxTVKXdyt7CDJQjcw9aD7t8+8mu0v02pTcN71ILsAlKxUd0ylvOqCD0m73fw/GJ/J01ud zEC3RHYJ2lb0cObWaXBYW3tY5evkG6kc01hgn6Lm3GnxUwrp/8IFeQ3//U/7pem4FIClJP D63Id5XeZa+Cjg6m3G2695SXC36m01BzPkAtm72C8PPieKzasQsgZf9DsBT3azvf0dKyIu XKzLZYatEY3pm/fjLwng4outRywnnagfXPA50TL2M0bhj24as908fH4SXkjSwbYQdShKcG QMqSx8pRmlwBpzZj78Sx+RpLdNVieuZrcNsfoso9wGWwxf7DvlbMMqnebWOlng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974275; a=rsa-sha256; cv=none; b=P9IyDqygj1AiZWLmt5p3pZ+BEpmFzknpz02xfxe1MIC/370N8s7E1mEy8dILw4QT9hgJJo 5RGJg4txS35Ja+GV1vbdGdui+lE/ASPFJXm+quXLfxSLC+okx+9S1ufXGjY0tcL0KhUybq fRPXD8Ng/e+j18iceaDcy/GiGnkNMXOmnqQN31PtDu1C0N//vwdz7gabYnGZm9kRnrw3to Iy42LSGz2TYkJg45cRCi0dWSImCcRLgDFbHv9m7pQozBulEA4YrPFV5fdPCsKRYkfkoe4J kocJMRjcypZpssVpBOY0D+HykWBgdFUUDQ4vlBx6NocHdL2aZ7kxhIVcORwVng== 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=1715974275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JLtgzeo2z7hCJVeUzcSE6D/3qC65vOwl/hgJ6XieufA=; b=Yk5dDbUxctdpzg0q9aqwJMPxd+9YYzOoLl/8kv2zYQPqBeeiYsQJeL29rd0aV2X0OBfnE5 C+IPA88Knk7VlsYecVcuSG8BgnanPxnVLKBLZG98OPQ9RClIfBvqEtKAQnaThBFY6rt2zS WoFQgb9mB+5rkr18zAlF3l9MxbT5nPDfaUboAzsEshjTP3OrfCA2DVv+7yTRVIjWvDfz7y 00z1iZHG8dmSrVtawvXJQcMb6yjNOg/fhS62adKRKz686hdGSTEznjfoIhX097XJ41aw9X vW6pIB10AsBeGmp6tGittozEgl29N6Xubkh+sccNATUJ+jG2EqEg7HYpHEUhow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgxsG71jPzvvs; Fri, 17 May 2024 19:31:14 +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 44HJVEv9000203; Fri, 17 May 2024 19:31:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HJVEB8000200; Fri, 17 May 2024 19:31:14 GMT (envelope-from git) Date: Fri, 17 May 2024 19:31:14 GMT Message-Id: <202405171931.44HJVEB8000200@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 2b3698288771 - stable/14 - sound: Fix oss_sysinfo->numcards List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2b3698288771f6d236212f80b1a259aa86e09fa8 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=2b3698288771f6d236212f80b1a259aa86e09fa8 commit 2b3698288771f6d236212f80b1a259aa86e09fa8 Author: Christos Margiolis AuthorDate: 2024-05-09 19:08:01 +0000 Commit: Christos Margiolis CommitDate: 2024-05-17 19:30:36 +0000 sound: Fix oss_sysinfo->numcards According to the OSS manual, oss_sysinfo->numcards holds the number of detected audio devices in the system, while the current ncards variable, whose value is assigned to oss_sysinfo->numcards, holds the number of currently registered devices only. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: dev_submerge.ch, emaste Differential Revision: https://reviews.freebsd.org/D45136 (cherry picked from commit 59d98edae3e1a6fffd292e4393c49862d624f25f) --- sys/dev/sound/pcm/sound.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 17a7138519ac..3e95fd0e0ea4 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -708,11 +708,9 @@ sound_oss_sysinfo(oss_sysinfo *si) struct snddev_info *d; struct pcm_channel *c; - int j, ncards; + int j; size_t i; - ncards = 0; - strlcpy(si->product, si_product, sizeof(si->product)); strlcpy(si->version, si_version, sizeof(si->version)); si->versionnum = SOUND_VERSION; @@ -720,7 +718,7 @@ sound_oss_sysinfo(oss_sysinfo *si) /* * Iterate over PCM devices and their channels, gathering up data - * for the numaudios, ncards, and openedaudio fields. + * for the numaudios and openedaudio fields. */ si->numaudios = 0; bzero((void *)&si->openedaudio, sizeof(si->openedaudio)); @@ -740,7 +738,6 @@ sound_oss_sysinfo(oss_sysinfo *si) PCM_LOCK(d); si->numaudios += PCM_CHANCOUNT(d); - ++ncards; CHN_FOREACH(c, d, channels.pcm) { CHN_UNLOCKASSERT(c); @@ -771,7 +768,7 @@ sound_oss_sysinfo(oss_sysinfo *si) si->nummidis = 0; si->numtimers = 0; si->nummixers = mixer_count; - si->numcards = ncards; + si->numcards = devclass_get_maxunit(pcm_devclass); /* OSSv4 docs: Intended only for test apps; API doesn't really have much of a concept of cards. Shouldn't be used by applications. */ From nobody Fri May 17 19:31:16 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgxsJ3JKfz5LgB6; Fri, 17 May 2024 19:31: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 4VgxsJ1mXZz4vsH; Fri, 17 May 2024 19:31:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715974276; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QQTNP5lHXqg+Fk6ui45lbveM7+CebE4TmCi/6jJh7/o=; b=uXuWSUC0UQJ/z352OeBgK2kz5OdoLnIMsihplHsW1cw0X8OskBBb7JKIh7D1wZIaP9vFja i1KkjMZC15wqa+RqNiekkprCBBdR4RRmF2N/WKHu3HrYVb7VYrgVu06p2nqQ43If1CKZ60 MJyP/yG/3SohyGByK8XKVb1PcsYouMcTiJq7ujChqbg8I2zkGBU/VqtsJWwOCtMdjUjrzp UphqXMN84eKoHk6tF2xgw0Ls1EGDeGMRzQuD0OYNXHCfWCGQIca1D2qXnY/JmKugP2I9Kh pi5yJLESMeDVL7TrjF+6ZM+wIcifJfVTgN6Jyhx/10yBeo44vBKvYJTHRHDnsg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974276; a=rsa-sha256; cv=none; b=BD1xAEZyVfRz8ByhnxHHnu+aWLc8/AlKFPXGJEd+T1L0praDQHx5vlNG/u5M+97iKHLiCg IZxZQ+InNtGjAVVMiiTgwrC2mfx/BoxQWKwEFFbF5rifR2mHtaIRDCTjYnSQ5IqzoDawKs 0VDurlltmF74kHmI2zW21oA43AlmKYZaB6fTudKlNHqof5Sfvfeojbt1qzNSBIDoLQNIvO hPD/fIBrqOp1xGn1T1Lg8/2Xnt9p8dZtkHwTRjUn823zBxAx2DqRjoiCER+YS6JDtlSFZN gSGg0K3K+rgj4r2lmX5WH0r843FEW6Ie2LMZTpleGFlW+9jGXYRXj0TEU9/ANA== 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=1715974276; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QQTNP5lHXqg+Fk6ui45lbveM7+CebE4TmCi/6jJh7/o=; b=GGpAi7d15NV54Bnz5M19V004g+xSHdjYvlxZi1uSj9vNAtGqXe9G2meN1kAdjYQpOPIhVd WdC1rtbkpV26wezi6uOmATPUzsdg5zpOS/a353KGGEO9Aqpsq8UZdD2plMIBA0/fRTdeMQ lYoR2fdnG9gqEmacIrECgxbqJLENtsfHpMekGnmofTPnnpPcLbEV2rzUTkdrFDoJryQurX d1yHrn25I9Ly1lD2qtOo+dhq+GhyPC79GkX7KI977zLpQpjyB0G0TURiNZRFFDY8sz0HWZ Es2LUJVOiApP9T4iY+grwxVvB7cRSOg77aw661APV2zNhCoYX0nqTrajW6j+Kw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgxsJ1NYYzvgl; Fri, 17 May 2024 19:31: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 44HJVGbZ000260; Fri, 17 May 2024 19:31:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HJVGhF000257; Fri, 17 May 2024 19:31:16 GMT (envelope-from git) Date: Fri, 17 May 2024 19:31:16 GMT Message-Id: <202405171931.44HJVGhF000257@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 8bd14f511efa - stable/14 - sound: Add missing oss_mixerinfo devnode and legacy_device fields List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8bd14f511efa8c2d40c538cff915bb3a822d724f Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=8bd14f511efa8c2d40c538cff915bb3a822d724f commit 8bd14f511efa8c2d40c538cff915bb3a822d724f Author: Christos Margiolis AuthorDate: 2024-05-09 19:08:11 +0000 Commit: Christos Margiolis CommitDate: 2024-05-17 19:30:36 +0000 sound: Add missing oss_mixerinfo devnode and legacy_device fields They are missing from soundcard.h and are in fact used by some applications, such as OSS' ossinfo(1): http://manuals.opensound.com/developer/ossinfo.c.html The new size for filler is chosen according to the most recent official version of soundcard.h, which includes those 2 fields. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45137 (cherry picked from commit e6df8c379b0cf2f6d715d4903fcb1f279e38173e) --- sys/dev/sound/pcm/mixer.c | 11 +++++------ sys/sys/soundcard.h | 4 +++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c index a37b94dce43a..9811496853c8 100644 --- a/sys/dev/sound/pcm/mixer.c +++ b/sys/dev/sound/pcm/mixer.c @@ -1516,6 +1516,7 @@ mixer_oss_mixerinfo(struct cdev *i_dev, oss_mixerinfo *mi) * Mixer extensions currently aren't supported, so * leave @sa oss_mixerinfo::nrext blank for now. */ + /** * @todo Fill in @sa oss_mixerinfo::priority (requires * touching drivers?) @@ -1529,13 +1530,11 @@ mixer_oss_mixerinfo(struct cdev *i_dev, oss_mixerinfo *mi) * default mixer. Other devices use values 1 to 9 * depending on the estimated probability of being the * default device. - * - * XXX Described by Hannu@4Front, but not found in - * soundcard.h. - strlcpy(mi->devnode, devtoname(d->mixer_dev), - sizeof(mi->devnode)); - mi->legacy_device = i; */ + + snprintf(mi->devnode, sizeof(mi->devnode), "/dev/mixer%d", i); + mi->legacy_device = i; + mtx_unlock(m->lock); } diff --git a/sys/sys/soundcard.h b/sys/sys/soundcard.h index ddd8a51d29a5..64f57742a52b 100644 --- a/sys/sys/soundcard.h +++ b/sys/sys/soundcard.h @@ -1925,7 +1925,9 @@ typedef struct oss_mixerinfo * as the default mixer. */ int priority; - int filler[254]; /* Reserved */ + oss_devnode_t devnode; + int legacy_device; + int filler[245]; /* Reserved */ } oss_mixerinfo; typedef struct oss_midi_info From nobody Fri May 17 19:31:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgxsK6ZRvz5LgBB; Fri, 17 May 2024 19:31:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgxsK2n5Nz4vkY; Fri, 17 May 2024 19:31:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715974277; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=21eAqP3uXgAFS2gDYd3n2KbSoFt03huGvDM6dQqfFJQ=; b=xdrq5SFAD20CMZ/t6DLwyPvHPDxWKXVPVvgT5SfNrJ6jWUDz1nLYwRibphWbTv70A+Y8Az sMIFTbsqbn9cfhtvQIJ5wLt0hYfG3mkpbNAONhimppQqCUfX2itu2cmiAsTjRRIvLVp97I yFE+7aLLAsA+risEDADxKoDg055JYlYiT1MZM1MjZkL43Th5eGVHoxakrL9YfyWW3VX+AA j6uUWw4WeqwkoPMLecicK/WkU4eBkV77l80krkiOeWpZ9MPPfyWLxS7Un67A9QqI2atC0i HPqyNaAnPDyv+zcrIBbsaT4mNhLdKICEscATkrQlomuUouMWK4U9OqEc+IZGsg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974277; a=rsa-sha256; cv=none; b=ts56gdpe0XMBMzf1ZYbGO45UmvZnfl/w7CZp8zc6W/FCVgtqqBsUVAcj/L3H2xYSbqHo+H lva9DWTR+oz6SHaC4zkN7pF28FmZIM6T8lH6dXjZwz63t5IuyZIrw4b9UPdscZLHRj2Dyu xpTLlhO8UX8KLwNIvpDRK3cEWo0TRd2l18eoNkFr8trbLx9BVNNk+b/xiCk4MDUU06Qr7k vDKBiGC3LVzgjqIOcYR8iGedIUd0ovuIUM+X1TcHptjq5VNlUlKOpHa7+YHq1pxKoS4neD Z+1LHh+cfF+ALtEtJPg2kt89BvHZdFwua4sPiG1pISe8Y2Nxa0i5xbMXMBwcAA== 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=1715974277; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=21eAqP3uXgAFS2gDYd3n2KbSoFt03huGvDM6dQqfFJQ=; b=f7Ei0avWOo1adIKvznjJJ5joQlWQj7e6er6ODoT3m4ksXx0GOpAvXzTwSlMboNj2Qe2pJ3 wvRrcQVzPRTZ3x8sDw0LUL9JiEcMwqBYBr2Uho63AEAmKOINdelG+albpbT3xuDEOp5/vZ Gs8ASDEKsxr+KDCKmy4gKHDAmDgKWqLbnJFoS7fW5fo1VXucVySTd+B52koTEzzFvW7nqa hQac1HW+DKT7/vxsQXsfqX2Qek+1Lc6t2IcP86OaRmXU7cQtfVPKiaaHW1LNtOtxBRbMRz BvCI+n1I0AyewxnNHyefKFxdUzTB0VKYArCrCi8VPvfmnLk4B5mo0olqLgxXsg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgxsK2NkkzvfN; Fri, 17 May 2024 19:31: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 44HJVHhZ000306; Fri, 17 May 2024 19:31:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HJVHvP000303; Fri, 17 May 2024 19:31:17 GMT (envelope-from git) Date: Fri, 17 May 2024 19:31:17 GMT Message-Id: <202405171931.44HJVHvP000303@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 15aa8688d036 - stable/14 - sound: Rename oss_audioinfo->real_device to oss_audioinfo->legacy_device List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 15aa8688d036a3ad769cd818ea5c93455c76fafa Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=15aa8688d036a3ad769cd818ea5c93455c76fafa commit 15aa8688d036a3ad769cd818ea5c93455c76fafa Author: Christos Margiolis AuthorDate: 2024-05-09 19:08:17 +0000 Commit: Christos Margiolis CommitDate: 2024-05-17 19:30:36 +0000 sound: Rename oss_audioinfo->real_device to oss_audioinfo->legacy_device The OSS manual now documents this field as "legacy_device". Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45138 (cherry picked from commit 24d5cc14dd60b49553ff3ee7830305621f782ff1) --- sys/dev/sound/pcm/dsp.c | 4 ++-- sys/sys/soundcard.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index fe816db54697..6e5fad048d40 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -2224,9 +2224,9 @@ dsp_oss_audioinfo(struct cdev *i_dev, oss_audioinfo *ai) ai->mixer_dev = (d->mixer_dev != NULL) ? unit : -1; /** * @note - * @c real_device - OSSv4 docs: "Obsolete." + * @c legacy_device - OSSv4 docs: "Obsolete." */ - ai->real_device = -1; + ai->legacy_device = -1; snprintf(ai->devnode, sizeof(ai->devnode), "/dev/dsp%d", unit); ai->enabled = device_is_attached(d->dev) ? 1 : 0; /** diff --git a/sys/sys/soundcard.h b/sys/sys/soundcard.h index 64f57742a52b..b5434b930215 100644 --- a/sys/sys/soundcard.h +++ b/sys/sys/soundcard.h @@ -1878,7 +1878,7 @@ typedef struct oss_audioinfo int card_number; int port_number; int mixer_dev; - int real_device; /* Obsolete field. Replaced by devnode */ + int legacy_device; /* Obsolete field. Replaced by devnode */ int enabled; /* 1=enabled, 0=device not ready at this moment */ int flags; /* For internal use only - no practical From nobody Fri May 17 19:31:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgxsL5N89z5Lg4L; Fri, 17 May 2024 19:31: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 4VgxsL3z2pz3wfT; Fri, 17 May 2024 19:31:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715974278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GhspkcxETU1gJBQaeDOo1xvIJ1Q1jsF/r5yyo+a16Os=; b=TSqz77NuB8u2yOkh5Hk072R8p5ME8RMjNlcJk36xkQnQe/r1xRs9ZhgqLH3LHrI97rIIC4 p5L0F2RBxIgD8WjnB/5QS9GgXrftYm+ryUHy+SOWhPmMzWbXmkodjDXLd6aA8tzeljYu5U eN7NX20kewSkA62EhWaAZvCHpIbG0nRv6bA6TTTR3kv4lMUlV15hVO258mTD5Vg2OMgEHv R74DT1Uvxg9vq1LBuWDjNDYcC9GRQW4JvUd4Mf/Wt6zNxoLiqrmOn79P6OWOE5OqGSbDLD OdO3u2g4bzdKg7FD/dnxdkwOO4qAtJiIrVcOfvkBLcuGj4rKS2pgH5OV4qKOuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974278; a=rsa-sha256; cv=none; b=F9Sr8BV8Dq8kqjHWNzTNGVK6wiyIFlijkFudZpSSGb4QQpQvwW1+VcqbMK60V69hjldkXk arIBTKk2quHDfDAxUZ7RGZMPjNEWsE4tShyUQ8QR5zsDXlutwmkJmKYScAd6UvnPyzkXUg uf3fPQYRvto/bsP14PkEHFfEFURn3d2FHndlsUJUo9960BDxzSF9JKMGz7ahScqAppihK7 US2aDLZSyb8JJEx+yhTPyAzahHwA2T1sAD5ya/2MAarjiGa7W6ROuOYBDbWQMtfo8XWyUA TxuV/Y45nWlwt5GKIq62MDdMMPsF5dOK4sFv2092G2+kSrmU43TT518BtoSQOg== 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=1715974278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GhspkcxETU1gJBQaeDOo1xvIJ1Q1jsF/r5yyo+a16Os=; b=aom+0FnPCQpnysgVsodjO606YipX2YbXzusAOaw73HQxZjP6uN0lmboFNGCgc9fkZB7DvM Y+FihUDwF9YnLF7V+f5SyTNbHGAHrxdzQ/CJUJYCIRmFsFMl+YbFJicOCo++gNRGYBuAaL abZf+I8EbLl4IuY9R72u5VvIfgPx2PboK4iIACBCRweqRIyGfhpX7BTDTfQKzbxGVj87zS bsE0qERCnRItTNvcugT0KZQ5nvGmVn254cToY+59PTRWx5DU6IAtZ0l6OfR4qqBYpX4GIg OGULYG/UOCutJtjsheZOfDqO8BRbEndUiN/DJeNRBcMfAT1amSexWU8VebZHDA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgxsL3YW0zvvt; Fri, 17 May 2024 19:31: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 44HJVI6U000356; Fri, 17 May 2024 19:31:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HJVIZ7000353; Fri, 17 May 2024 19:31:18 GMT (envelope-from git) Date: Fri, 17 May 2024 19:31:18 GMT Message-Id: <202405171931.44HJVIZ7000353@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 9a620018afb2 - stable/14 - snd_hda: Add patch for Lenovo Ideapad 3 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9a620018afb2da062fce11e866a2154765886983 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=9a620018afb2da062fce11e866a2154765886983 commit 9a620018afb2da062fce11e866a2154765886983 Author: Christos Margiolis AuthorDate: 2024-05-14 13:42:04 +0000 Commit: Christos Margiolis CommitDate: 2024-05-17 19:30:36 +0000 snd_hda: Add patch for Lenovo Ideapad 3 Reported by: bsd-lists@bsdforge.com Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D45100 (cherry picked from commit 54cc353f505dbc5f19168b6b1417b6736433d9ae) --- sys/dev/sound/pci/hda/hdaa_patches.c | 3 ++- sys/dev/sound/pci/hda/hdac.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/sound/pci/hda/hdaa_patches.c b/sys/dev/sound/pci/hda/hdaa_patches.c index 3a7dfc63637a..76f677d69614 100644 --- a/sys/dev/sound/pci/hda/hdaa_patches.c +++ b/sys/dev/sound/pci/hda/hdaa_patches.c @@ -318,7 +318,8 @@ hdac_pin_patch(struct hdaa_widget *w) } } else if (id == HDA_CODEC_ALC257 && (subid == LENOVO_L5AMD_SUBVENDOR || - subid == LENOVO_L5INTEL_SUBVENDOR)) { + subid == LENOVO_L5INTEL_SUBVENDOR || + subid == LENOVO_I3_SUBVENDOR)) { switch (nid) { case 20: patch_str = "as=1 seq=0"; diff --git a/sys/dev/sound/pci/hda/hdac.h b/sys/dev/sound/pci/hda/hdac.h index 4dd589ed2a09..12552286bd8c 100644 --- a/sys/dev/sound/pci/hda/hdac.h +++ b/sys/dev/sound/pci/hda/hdac.h @@ -383,6 +383,7 @@ #define LENOVO_L5INTEL_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x380f) #define LENOVO_3000_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x384e) #define LENOVO_I330_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x3808) +#define LENOVO_I3_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x3881) #define LENOVO_ALL_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0xffff) /* Samsung */ From nobody Fri May 17 19:31:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgxsP1Ybcz5LgTt; Fri, 17 May 2024 19:31: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 4VgxsN5xD5z3wlR; Fri, 17 May 2024 19:31:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715974280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NEO64mDGBB4UtUz6E0bTfK+ss/nj8rcVHI6x0AtUt7c=; b=Mf1ZsSiol9HuSanmmitB2RuGbVJSWsXmTilOPqiITURSbN8Dta8VapxFlRClAl/j7S7JZ4 tmLiG/OyH79ZjjHPhPIPzcSbgXVZgVmfznv1RmPqXUsqY1nxnFMbKpHbO5VGvnnTGREVLG uJHBVVufu0dFl3DXyOSjD7ZNqQR5H5Ld/A+Tn6D5Nrs4LwIGxCdS8FGShO6cNdNqWrpBrc D/rzoBVy6N68r9sUQVWtzVgIkSMc6RZ4F/AzSxn6doXSm86KJVBCHyyV66BDw/vjhWmPti YdQTlp5PREl7Ad2xAtHm8HR/caOrNGtj6504Dh5gA425N1/wiPKdyWwOv9iNTg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974280; a=rsa-sha256; cv=none; b=d+OFxXTu86Lhjf/Y8ili4cG7fa4x+6s8K1x+IialxAjoAPGh8paxn7w2Bm8be9fdLahj9L jgM/l+ttxciqUDHySi1FPCkjKchkXx6yxUrRQuxDflAHOXq9tg25v41CfXStgbboNSp7Gs JSpTy6cmf8rMQb2MpONwVZc8NMrBmwXssBJRAM5Fz06Y1B48KV/OY7RL3Hv0acT1XpUHL2 3lvZnyOIpyjcBGgqg8+3ky+vb1DZjzXa4SkT+KWugLfc37q9d886LXPtRNcGjzdJsjpfZg gROwBM8IOAExcZgltXg5rJa1SeYUke05u4rkFzNtKTkKuP3d0pyU/y/sRCA9ZQ== 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=1715974280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NEO64mDGBB4UtUz6E0bTfK+ss/nj8rcVHI6x0AtUt7c=; b=y309nNH+pyP5TeoD4Cd2mbczjaftBVTw8XTJL/d3NqZ5Npj4rzX0XnSjS5ThJQG4w3/LgE 3KWHEn+cp3ILDYBhDOsavUO+4Xxoc7EiEhVIom60m7oXNaQLCPofIG5KBRH8bjhhO+I+Sr zGLUUjVMCdMpyH/VgsCQdIYiWkNZqQLVofRDtI3rq6kmfuom6QfUDuLBUWO1QmMj0tVs6r sYiTpbs8QIHxdtJKmCS5n+mouUvL2l9fOwvk4Vr/Hv9pfyXhGUDdLckqXyg5LpyRgOsxww +t0DOruRWo1FoS64aK6/nltMaM4QHiA61PxQV5CkBQjXUiwh0dQ3H46mG5yg1w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgxsN5Y9BzvfP; Fri, 17 May 2024 19:31: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 44HJVK6H000449; Fri, 17 May 2024 19:31:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HJVKhL000445; Fri, 17 May 2024 19:31:20 GMT (envelope-from git) Date: Fri, 17 May 2024 19:31:20 GMT Message-Id: <202405171931.44HJVKhL000445@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: a19d42b08a40 - stable/14 - sound: Remove ncards variable from sound_oss_card_info() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a19d42b08a40cda6af119f14236e166e178bd2cd Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=a19d42b08a40cda6af119f14236e166e178bd2cd commit a19d42b08a40cda6af119f14236e166e178bd2cd Author: Christos Margiolis AuthorDate: 2024-05-14 13:42:20 +0000 Commit: Christos Margiolis CommitDate: 2024-05-17 19:30:36 +0000 sound: Remove ncards variable from sound_oss_card_info() The loop counter is also the card's index, so ncards is redundant. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45144 (cherry picked from commit 305db91d4b92a5d53826dcb6df39fc8a1f3b427e) --- sys/dev/sound/pcm/sound.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 3e95fd0e0ea4..e66462af2a71 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -792,9 +792,7 @@ int sound_oss_card_info(oss_card_info *si) { struct snddev_info *d; - int i, ncards; - - ncards = 0; + int i; for (i = 0; pcm_devclass != NULL && i < devclass_get_maxunit(pcm_devclass); i++) { @@ -802,7 +800,7 @@ sound_oss_card_info(oss_card_info *si) if (!PCM_REGISTERED(d)) continue; - if (ncards++ != si->card) + if (i != si->card) continue; PCM_UNLOCKASSERT(d); From nobody Fri May 17 19:31:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgxsN0Dqjz5Lg4P; Fri, 17 May 2024 19:31: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 4VgxsM53tgz3wlJ; Fri, 17 May 2024 19:31:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715974279; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JqRgEauBd7pA/pe3m5KnHESVIyKY1KG85HQRzPPaEIE=; b=adO7aQhN9KT29NP109z+Tp8LEBIoewDwbrFiMn5R+PDB9Q6QNEbyExWX5wqaGa+H0XxTRq qKEYwLBJhicVW3ggCd167AYtt0iRZS0ZuKg68f+2GD77N8F3rHZj26gdFA/o05HU6Ml3uo umwUX7OeskSIfDc8aOguM3pRWdKostTi4Nh9jtfIQfa27pTXjJXnHY/42W0n8YE4NExR+c AB+DEgGElM3kdPrW++40Fbg2pqfDR2nig/QTLywFRQ2KiXyYUM6hyRbDBS3TchPTtaT1Qy Z2sGV8HLta3dzWKQ6g10uUyvxvz+1l9J33B5EFCFtC+u/9tW0RtOpnMcjztc/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974279; a=rsa-sha256; cv=none; b=mdIH808ib6lredt4LKD4TgQ2BZnbgzKNZneHCJ9BxyT5IwuNP19xI0L6gSqJyYKA9kMk2v 2wFjVL/lVDhlSqPxBDw0PZZG0hCs4tAzS7Ajxjyza4oHdTm0vjsWP9B3tL7M50gnxbd0j8 5MMa79vNihB6fQpsDC0nrTW8yPWld+KXMFmM5ocYBnunuhSuwtH4EhPtRPh45NyUakFxll UGHKFMN/qIOUztxRRNfrSDUZinHqHKM0HrkpIXRyNYiniMQHAf/Ab+ql7og34kqF6dnZlQ C7nq0SHRySDOlnPELDkyv+iw3aByUlGFfvEIfuqZvORl3UPZWO44oQ7cTxaSWg== 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=1715974279; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JqRgEauBd7pA/pe3m5KnHESVIyKY1KG85HQRzPPaEIE=; b=VHpJaqxpqSIzQhit+6tjl+/ucuZSdUl5GNQat8GyGScKFKXtvI9av6bZwEaTl+pElXN3kN g2dqQSprvneZuYhX7VtiAQKtoaK2oTYc3tjls7ApRupp2QwhWTdiOFgXJByQW/KjXK/tuz 1mg+zmZwmjtuJnbbX50XLJv0NvS80VLqUUeqA5mPelspNkgIo0J98R+1XvlDKEt+ffl2oo 5fzwFRnKYUbfqb4LHtBpqjNn7uCdUVYfTNoitnXRDZ52oBDCy/tf1MEjjwj9S8e+rOhdl4 gzfHCFSdWs2P4R4qY59d+/lHEGYQItTZGKZF2cLBfGXaOecf/r7tRWM8qc6Uwg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgxsM4dDlzvr9; Fri, 17 May 2024 19:31: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 44HJVJcM000398; Fri, 17 May 2024 19:31:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HJVJmO000395; Fri, 17 May 2024 19:31:19 GMT (envelope-from git) Date: Fri, 17 May 2024 19:31:19 GMT Message-Id: <202405171931.44HJVJmO000395@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 7814ed2bd321 - stable/14 - snd_hda: Rename LENOVO_I* to LENOVO_IDEAPAD* List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7814ed2bd321dff2bbec8408c5b64cb7f4f2dfc5 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=7814ed2bd321dff2bbec8408c5b64cb7f4f2dfc5 commit 7814ed2bd321dff2bbec8408c5b64cb7f4f2dfc5 Author: Christos Margiolis AuthorDate: 2024-05-14 13:42:15 +0000 Commit: Christos Margiolis CommitDate: 2024-05-17 19:30:36 +0000 snd_hda: Rename LENOVO_I* to LENOVO_IDEAPAD* Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D45105 (cherry picked from commit 278953360e0e6187c3f7c688cb49254df1567f0b) --- sys/dev/sound/pci/hda/hdaa_patches.c | 4 ++-- sys/dev/sound/pci/hda/hdac.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/sound/pci/hda/hdaa_patches.c b/sys/dev/sound/pci/hda/hdaa_patches.c index 76f677d69614..9f3532562252 100644 --- a/sys/dev/sound/pci/hda/hdaa_patches.c +++ b/sys/dev/sound/pci/hda/hdaa_patches.c @@ -319,7 +319,7 @@ hdac_pin_patch(struct hdaa_widget *w) } else if (id == HDA_CODEC_ALC257 && (subid == LENOVO_L5AMD_SUBVENDOR || subid == LENOVO_L5INTEL_SUBVENDOR || - subid == LENOVO_I3_SUBVENDOR)) { + subid == LENOVO_IDEAPAD3_SUBVENDOR)) { switch (nid) { case 20: patch_str = "as=1 seq=0"; @@ -340,7 +340,7 @@ hdac_pin_patch(struct hdaa_widget *w) break; } } else if (id == HDA_CODEC_ALC230 && - subid == LENOVO_I330_SUBVENDOR) { + subid == LENOVO_IDEAPAD330_SUBVENDOR) { switch (nid) { case 20: patch_str = "as=1 seq=0 device=Speaker"; diff --git a/sys/dev/sound/pci/hda/hdac.h b/sys/dev/sound/pci/hda/hdac.h index 12552286bd8c..6a3314280a22 100644 --- a/sys/dev/sound/pci/hda/hdac.h +++ b/sys/dev/sound/pci/hda/hdac.h @@ -382,8 +382,8 @@ #define LENOVO_L5AMD_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x381b) #define LENOVO_L5INTEL_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x380f) #define LENOVO_3000_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x384e) -#define LENOVO_I330_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x3808) -#define LENOVO_I3_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x3881) +#define LENOVO_IDEAPAD330_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x3808) +#define LENOVO_IDEAPAD3_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x3881) #define LENOVO_ALL_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0xffff) /* Samsung */ From nobody Fri May 17 19:32:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgxvB4V5dz5Lgdc; Fri, 17 May 2024 19:32:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vgxv96mWPz41ws; Fri, 17 May 2024 19:32:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715974373; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2BjnZDwQDLhH2GSL18fvxbszFQfOPxZ+D3PU3SYgOio=; b=pDEtcz4kcHhgoVp6DbHZhW7+VGJm83qV2FHIiBSU5wHw9+LI3GcQzeUmk58Ws8VRfcx6yS xh7n8yl7ShRFitT8Ss2d9gZlAqhNm7qhcpNr52bJtXIfUKlxRQ6PTP+eODvQAijeMWM5/p ob2hBIXRNzLL8W8Cv2xrG1Twvd5l61yUC6i01gQLlPzZ9uEQQyMm0JJQJfRffTgsBDKeHp UUzgpS1OEpURoXnktFUz6KBo5t6dTyqwIrPEN5Q+27GP93PqoB/RxWuMJ5acw4L2c+Ux2W OTVzFvuFqEyuuUMLnG8A1cKQkxsFexPFZqpgWIV/ow2q8qxA1bThlOu4mOz0bA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974373; a=rsa-sha256; cv=none; b=WTFgDODoj31qEYoS4YDFgCFE+CuxcSsAyZ3PPNrHKTtpMIoIDNyibGsnbqx/23s/oJvNN9 0lIBI4j8Gv0R73FiGtkprvF+EDeuJyI0fZsiAQYgi9wFOfXxt+aUirkAn5k1Y0DNZkqLzf 9HD6FBRIr3zdsgzkwGO6kzP5x4xcVN34IC7yE4CENWfyPvRKbO6OnMaMn1ecJ+37bxNDCo 1zifgfre7NZyeO/oC9pwVqj/Di0fcmOkCZobdlDNVA+HgYuPOnTXtopIK65agqQ0mkPj08 xf0wxXit1DvFTiL+/0IeZxilFuidKVNUSMxaxlpfYdhsQnAGx3oYlJtqu+e6Wg== 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=1715974373; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2BjnZDwQDLhH2GSL18fvxbszFQfOPxZ+D3PU3SYgOio=; b=FoAjq4BzDZijDbCHSWKe+WuvVEmyFAm4IlekLeVzOObDTplXR8oZTtXf7q/SGzUl41CA7a utgMTEsVBZjg4UJMrR0mUZBKlmunTxEug7mZ4A7DJjLR0O6LAiKwut32rbfw9RhVOTF2gi NCb7cRsZY2VFxHm1ejSbiL3SRDOY3ZyKIEqeUlPc0zZ1xeoECU+yDovT5CEf3ZJjAEI+9A xFTA4I+T3dpWaoyO6nBTuipOA6X0MbcawoWSiQVu9K+qcs2KeKX6cXNu71pR3PohQ28sfO 6Y/LOrIVsR6n49ESpuvmoHiIEpgyWiLxFSGy1PmhSdfFqMEigKdyJ/j1eXJjVg== Received: from [IPV6:2601:644:937f:4c50:c0c0:cf11:cc26:3c0e] (unknown [IPv6:2601:644:937f:4c50:c0c0:cf11:cc26:3c0e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Vgxv92WgPzL9C; Fri, 17 May 2024 19:32:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <0f2c4189-e259-4bd8-ad31-212a8df0e1b5@FreeBSD.org> Date: Fri, 17 May 2024 12:32:51 -0700 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: cff79fd02636 - main - linuxkpi: Fix spin_lock_init Content-Language: en-US To: Emmanuel Vadot Cc: Emmanuel Vadot , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202405170559.44H5xD7d019861@gitrepo.freebsd.org> <2cd3e698-1b42-4e7f-93a0-aacccb55c8d6@FreeBSD.org> <20240517183350.e45f54df07f670980d5a51c3@bidouilliste.com> From: John Baldwin In-Reply-To: <20240517183350.e45f54df07f670980d5a51c3@bidouilliste.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 5/17/24 9:33 AM, Emmanuel Vadot wrote: > On Fri, 17 May 2024 09:07:53 -0700 > John Baldwin wrote: > >> On 5/16/24 10:59 PM, Emmanuel Vadot wrote: >>> The branch main has been updated by manu: >>> >>> URL: https://cgit.FreeBSD.org/src/commit/?id=cff79fd02636f34010d8b835cc9e55401fa76e74 >>> >>> commit cff79fd02636f34010d8b835cc9e55401fa76e74 >>> Author: Emmanuel Vadot >>> AuthorDate: 2024-05-17 04:52:53 +0000 >>> Commit: Emmanuel Vadot >>> CommitDate: 2024-05-17 05:58:59 +0000 >>> >>> linuxkpi: Fix spin_lock_init >>> >>> Some linux code re-init some spinlock so add MTX_NEW to mtx_init. >>> >>> Reported by: David Wolfskill >>> Fixes: ae38a1a1bfdf ("linuxkpi: spinlock: Simplify code") >>> --- >>> sys/compat/linuxkpi/common/include/linux/spinlock.h | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/sys/compat/linuxkpi/common/include/linux/spinlock.h b/sys/compat/linuxkpi/common/include/linux/spinlock.h >>> index 3f6eb4bb70f6..2992e41c9c02 100644 >>> --- a/sys/compat/linuxkpi/common/include/linux/spinlock.h >>> +++ b/sys/compat/linuxkpi/common/include/linux/spinlock.h >>> @@ -140,7 +140,7 @@ typedef struct mtx spinlock_t; >>> #define spin_lock_name(name) _spin_lock_name(name, __FILE__, __LINE__) >>> >>> #define spin_lock_init(lock) mtx_init(lock, spin_lock_name("lnxspin"), \ >>> - NULL, MTX_DEF | MTX_NOWITNESS) >>> + NULL, MTX_DEF | MTX_NOWITNESS | MTX_NEW) >>> >>> #define spin_lock_destroy(_l) mtx_destroy(_l) >> >> This is only ok because of MTX_NOWITNESS. Reiniting locks without destroying >> them corrupts the internal linked lists in WITNESS for locks using witness. >> That may warrant a comment here explaining why we disable witness. > > I'll try to look at what linux expect for spinlocks, it could also be > that we need to do this because some drivers via linuxkpi does weird > things ... > >> It might be nice to add an extension to the various lock inits for code that >> wants to opt-int to using WITNESS where a name can be passed. Using those would >> be relatively small diffs in the client code and let select locks opt into >> using WITNESS. You could make it work by adding an optional second argument >> to spin_lock_init, etc. that takes the name. > > We can't change spin_lock_init, we need to follow linux api here. You can use macro magic to add support for an optional second argument. #define _spin_lock_init2(lock, name) mtx_init(lock, name, NULL, MTX_DEF) #define _spin_lock_init1(lock) mtx_init(lock, spin_lock_name("lnxspin"), ...) #define _spin_lock_init_macro(lock, name, NAME, ...) NAME #define spin_lock_init(...) \ _spin_lock_init_macro(__VA_ARGS__, _spin_lock_init2, _spin_lock_init1)(__VA_ARGS__) Then you can choose to specifically annotate certain locks with a name instead in which case they will use WITNESS. -- John Baldwin From nobody Fri May 17 20:00:33 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgyW6055Cz5K0Lh; Fri, 17 May 2024 20:00: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 4VgyW56lqBz47xp; Fri, 17 May 2024 20:00:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715976033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4ML2zoRLsBtZ9y3uzyPJFtC9lS9XtoL+ur6je6j7c68=; b=mI5q6SzFmnTwajsBy0idQuvUz96I8STuOf5AekhUUEtX8s+7bnjJs+Ra37vlbmW5+SEA7G b1ayXk71pbk8vmwM1oqU6abmOUk8XjG5LMjuOwN3P37hBKjrRwvkhtHzVSa98Pzg/OuBkV g8Z0twCe+E0B13pX8xJq1GnTXR8+EqVfKUjGmqX7PdJi4rQxCukDsE8baCS+2BkDVC2QUm NlQs3iA5snzesKFpuncXQqURr0Y12+XPwTY1Wzdpw+1I31tI8S2YH7Pd0GZSFZGZwnW66+ tCd6cDycSRCmi6is/DPjK+a/FMPjv/RBiYMnqklEAnrh3llMJ4p1q2SiRECfUA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715976033; a=rsa-sha256; cv=none; b=fzFhQ60sREdpU5nx2aIFptFPyoXtmB8aFdCdzkCPsKSu9o1vC5VfmcgJNmTj9Y1sNb2s/F afIq7eUDqQNTEbAaxICfaD0ZkwfgKa/ojnITvBoSERr9NdEBRpBfKMx3uS2jXA1m9clOc3 Xn+wvtV1CON2oYP+CEhLcxeGKnQsVPbhuiCov6Of6GkVFY67MqaOFnPxZZD1/XwGcKWmjQ O/Va2ywUy0RfxbfBVnVSWaf2g7bY+8B07dsWsb9F30QGn3+W9fvMOxCoYtZZJstGVelvR2 Q1xo9QKEwH8V5KiF75Ip8ukadeZlmVAnKhMUN2zLqF0vIB4I/SYeCvG6B7Lu4A== 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=1715976033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4ML2zoRLsBtZ9y3uzyPJFtC9lS9XtoL+ur6je6j7c68=; b=K5/cHJymEGBRjaatutZVUEy9/2EpKg7qu8t5kakxEbt0U0oVBb0pLcviYiWeu3bGM9kxl5 I/5eVOA0Wtfv4Q6E8MHnPqrRlmDN0i1lsS6laMfsz3Flz05W5W2uuPW0wIL7a/oalJxvWn QYNuaBXuDwjbftEia7Z6uorXAxoff4JFulyFyS9W2ZQ2vR/SlG9IkjgI78oAdBN2DOTtBt t6yocn1yMZP6Zfpxvmts5Hmreyz+csbZwi2Lov5x7xZ4hMds4Tp7Rm1LnnurFWEt7t0Giv 3cqJoXkFAotVCy9tVWOdHJm6coZZmYmLPLZ8XoKWf9JHjIk/7FMEQLpyqZykwg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgyW56MKwzwBl; Fri, 17 May 2024 20:00: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 44HK0Xop049844; Fri, 17 May 2024 20:00:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HK0Xw3049841; Fri, 17 May 2024 20:00:33 GMT (envelope-from git) Date: Fri, 17 May 2024 20:00:33 GMT Message-Id: <202405172000.44HK0Xw3049841@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: f7d45c5443ed - main - bhyve: avoid side effect in assertion List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f7d45c5443edc99857fdda19c68301b5ec4a8971 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f7d45c5443edc99857fdda19c68301b5ec4a8971 commit f7d45c5443edc99857fdda19c68301b5ec4a8971 Author: Pierre Pronchery AuthorDate: 2024-05-17 07:31:32 +0000 Commit: Ed Maste CommitDate: 2024-05-17 19:45:18 +0000 bhyve: avoid side effect in assertion An assert() was setting the error variable instead of checking it. Reported by: Coverity Scan CID: 1521431 Reviewed by: jhb Sponsored by: The FreeBSD Foundation Pull Request: https://github.com/freebsd/freebsd-src/pull/1244 --- usr.sbin/bhyve/tpm_ppi_qemu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/tpm_ppi_qemu.c b/usr.sbin/bhyve/tpm_ppi_qemu.c index ad66ecb09683..239d39184589 100644 --- a/usr.sbin/bhyve/tpm_ppi_qemu.c +++ b/usr.sbin/bhyve/tpm_ppi_qemu.c @@ -161,7 +161,7 @@ tpm_ppi_deinit(void *sc) ppi = sc; error = unregister_mem(&ppi_mmio); - assert(error = 0); + assert(error == 0); free(ppi); } From nobody Fri May 17 20:51:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgzdV5mLrz5K4t4; Fri, 17 May 2024 20:51: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 4VgzdV5HJ1z4J9x; Fri, 17 May 2024 20:51:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715979070; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IiVSU2cVa9Ei/AeEuIZoMuXFt9Rb+FWuNS/lJL2e5BE=; b=mc5algdLIW1/t6tzSxacdr8MWYdCuEBTaG/nb59xp5LVWOMYE7crFmnmJ97HDKmaBMW3f/ 0Nahe6sghb2fl/TkQXCN3sJqPReOCWAgfYg58LOEBjdpTLGPy89gWMnKebBMbe/KZPeRHW XBbpd9kmb4nhb3zit8Mpdm7ujmjNxDSIFwKu98WRwMXJT9AC7AOV3yDHUZaT1kwSx3QVBK dQznmpVhTe4l/Pw6iODlZvpW4Yd337Gt/8/QIAnI38l/L2O/J4A5P1yIC9wAiv+JrIARlX EEvsbc9UkSlEKpEpaTNvyl3Ztd6dM5dfOXwljX0bcTZWB0xJSmFX3Yx9fAWl0g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715979070; a=rsa-sha256; cv=none; b=QaUgjMgrAXn+ZPldumuar7YdG97YLGbLQmf7xw+iLnyhVJUlwV5moQBqjYCHrTCvCArLBA X2M8hrY/OOCySIkKq65QIImJAvcyMcaOt1lh0BWbE9p/7CydYgUBoe3Ig6nL213/dvCqdd AN3p3OCARQTdF6HmkEG6MXvOPKORUNihrIJevy7ZOw5qOidrjfi5PrtdQhoJUHx9v7FVUS CDRnbVp0TAD22fs3pJNLnOk9EDWLoDY4xYTx2LFUCRCaXtDaHmze3UNkEC3wHQJvXYOvM1 Ww+HDMTN9x2HgEQHWbqexcZ9C/1JF645g1YExWG7lifInopTnpYBY9nsI3MdIQ== 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=1715979070; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IiVSU2cVa9Ei/AeEuIZoMuXFt9Rb+FWuNS/lJL2e5BE=; b=qsNUrrb9H3dvbkOi2CXLiIaV/Yi8OJ9sikj9g6Tk3e0ROKnXSnJsuIUis2qQFHnuJlrPKT xnNF0Z61fdZzVGUnTYJB+9OPQnqzP2lHkt8tdoDWkCM1sIvoEe9ALS6X7aC6DuziVFkEy3 Va1CCqXH4PFils/CJ0q46QIuE86Db3e56xFrftvWPVSUqxgwPg8gXk7zG0pCumuF/AynEq xSKxNQUkhkjzmW5hpIvjwhDjwnSzwiUvcDKjc3EdI6w8Ux0Zy65UviBcFqM5sBWYYRrg7e 2TiZTUA/yAEfS5DEe+6Z/yzzPyYU3dIZjuWUizL7niybEOKxn3PCTiOOCPArCw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgzdV4tjnzy3B; Fri, 17 May 2024 20:51: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 44HKpAFG037640; Fri, 17 May 2024 20:51:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HKpA1G037637; Fri, 17 May 2024 20:51:10 GMT (envelope-from git) Date: Fri, 17 May 2024 20:51:10 GMT Message-Id: <202405172051.44HKpA1G037637@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 1062db307002 - main - libcxxrt: allow build with gcc13 and --no-undefined-version List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1062db30700230a26fdc90088a4e2bdb6b6e4d6d Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=1062db30700230a26fdc90088a4e2bdb6b6e4d6d commit 1062db30700230a26fdc90088a4e2bdb6b6e4d6d Author: Brooks Davis AuthorDate: 2024-05-17 20:22:22 +0000 Commit: Brooks Davis CommitDate: 2024-05-17 20:50:57 +0000 libcxxrt: allow build with gcc13 and --no-undefined-version GCC 13 supports _Float16 and __int128 on fewer architectures than clang and thus libcxxrt compiled with gcc13 is sometimes missing related symbols. Hack around this by explicitly appending --undefined-version to LDFLAGS in problematic cases. Reviewed by: theraven, dim Differential Revision: https://reviews.freebsd.org/D45233 --- lib/libcxxrt/Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/libcxxrt/Makefile b/lib/libcxxrt/Makefile index 6ad89e9da107..7a683ba779f6 100644 --- a/lib/libcxxrt/Makefile +++ b/lib/libcxxrt/Makefile @@ -42,3 +42,13 @@ Version-64.map: Version.map .endif .include + +# gcc13 doesn't support _Float16 on riscv, powerpc64, and x86 or __int128 +# on i386. Disable checks for missing symbols to allow this to link. +# +# XXX: This is a hack that hides an ABI divergence between clang and gcc. +.if ${COMPILER_TYPE} == "gcc" && \ + (${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || \ + ${MACHINE_ARCH:Mpowerpc64*} || ${MACHINE_ARCH} == "riscv64") +LDFLAGS+= -Wl,--undefined-version +.endif From nobody Fri May 17 20:51:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgzdX10HNz5K4gS; Fri, 17 May 2024 20:51:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgzdW6FB2z4HrX; Fri, 17 May 2024 20:51:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715979071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OlLjqVE2sBIuICQ0iRKXoVs/mr0NYhOlTXHVQSSMWFI=; b=LhrbbLfZEu71ocmsf3OpMo3oJprXztSN8Pswq2FTycPpoEqwh0m8Zzqo99YvzJaOitetkm DNF1Tt47lIUBou2Ftkwf6+wbqfrdDP92zcUfeudZbMLfuhIawcxPbSTS8UFZuKJjHodyy6 n2zoXyy3q7O6aZ+miES+j2WtPDJSWPk9J+yA8Wx85gi0tuPNyxKzertbu+TvMCY0Ym/ARH kPFDJh/ZhRzJqk5pNuWgV+8iE2cMnA5Kfobe6rJtpRBIhkfy1w9++AspuR+1hfz14DslNV b22xy3kd5F188YaRLGlfpszXYVffmf6gCzhRa63esnnJW1hYRWEyIIRFFf6NlA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715979071; a=rsa-sha256; cv=none; b=w8BFKcqAbV9rgs4hbyMxwxOxc6xskPRRvq9gmm263LDBv1EXnH+zwoMaBe9/Zc96NJ4PuT cBA8qbQjV3x4i8y6E0921rO43p80wqMOvHkFN+Gn4hBG9Fp/kAL+rbW27VNrXSqaxjt8Jh R/glAof6ER0xJA65O5OaT6vY/AMW4bHyaCBRXY3odSHQV0iH5/0qP2lacNaiDo8xsKa/qJ k0I66COijpkg4Ejhs1OdNdAeZRKqZtljeN2dQ3YvsjxCNIwsqxTtcSDfa8dIVQ4id2Jad/ qi7BmTO2iGMEIBJpIjsfDNSkSZvqAkMrP0EHw386QXlsDUCLKPFkTlRHFhUf6w== 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=1715979071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OlLjqVE2sBIuICQ0iRKXoVs/mr0NYhOlTXHVQSSMWFI=; b=jaUvEccYlU6sxwhEiXZ0jOrS0w8zIj92eCMJ+QRIbPo/aFUD9DZ6nj+VLC3HSGyIRjGYNK pX6R/eow8zAvIGtQysuD33QO7aSHD9ddDAeCCU7yoCoFfddlhm/N7/7Rpcb5SL6ZSkdM9y Nu1bW7f9wC6ZhZTjV/ZqYpsjS8ZQ9h6wjY+DAm3oP+1+I4oPzc8zxcAVoPvEvM4Svkzaxk SFWNhJPCw1yXyHmlNr1qnwHCagMD6qkW9Sj5Kx3NsL46x/m3UQ1AL+igyE16t8N6ZatPOZ Q46j6HOUctkJ0E3HdSXPdD5UhU3jZUVMNP9sYO4GALN52le55yb/qhD0ywZOzA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgzdW5s4Lzy3C; Fri, 17 May 2024 20:51: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 44HKpBmx037677; Fri, 17 May 2024 20:51:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HKpBKe037674; Fri, 17 May 2024 20:51:11 GMT (envelope-from git) Date: Fri, 17 May 2024 20:51:11 GMT Message-Id: <202405172051.44HKpBKe037674@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 61ad1ddc5a81 - main - Improve broken-on-gcc checks List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 61ad1ddc5a81b8f709509d34962e7f26ac163372 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=61ad1ddc5a81b8f709509d34962e7f26ac163372 commit 61ad1ddc5a81b8f709509d34962e7f26ac163372 Author: Brooks Davis AuthorDate: 2024-05-17 20:34:37 +0000 Commit: Brooks Davis CommitDate: 2024-05-17 20:50:57 +0000 Improve broken-on-gcc checks Mark powerpc* and riscv broken. Refactor and add a TRY_GCC_BROKEN option to build anyway. This simplifies things for people trying to get gcc builds working while letting other developers know that they aren't expected to work. Reviewed by: jhb, emaste Improves: 4c0dfd5959bd4 arm: fail early on gcc builds Differential Revision: https://reviews.freebsd.org/D45230 --- Makefile.inc1 | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 1bf4212b1d5e..90439adcbc09 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -175,7 +175,24 @@ LIBCOMPAT_INCLUDE_DIRS+= arm .if ((defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == "gcc") || \ (!defined(X_COMPILER_TYPE) && ${COMPILER_TYPE} == "gcc")) .if ${TARGET} == "arm" -.error "armv6/armv7 build are broken with gcc. See https://reviews.freebsd.org/D36754" +_GCC_BROKEN="https://reviews.freebsd.org/D36754" +.endif +.if ${TARGET_ARCH} == "powerpc" +_GCC_BROKEN=Missing atomic builtins in libc++. +.endif +.if ${TARGET_ARCH:Mpowerpc64*} +_GCC_BROKEN=libsys.so.7.full has a LOAD segment with RWX permissions. +.endif +.if ${TARGET} == "riscv" +_GCC_BROKEN=boot code linker script issues. +.endif +.if defined(_GCC_BROKEN) +.warning Target ${TARGET} is broken with GCC: ${_GCC_BROKEN} +.if defined(TRY_GCC_BROKEN) +.warning Trying build anyway. +.else +.error Avoiding broken build. Define TRY_GCC_BROKEN to try anyway. +.endif .endif .endif From nobody Fri May 17 21:36:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vh0dN239kz5K81Y; Fri, 17 May 2024 21:36:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vh0dN1Rspz4Nbm; Fri, 17 May 2024 21:36:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715981768; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3fUFqEwQWBgcm8lsWcn8CqpAMzZ3eAHUeDz2RNJ9hyQ=; b=BEBzhp3l0lLp6n7LtpClCQUO1oFQ83gEEZIzQJtXLu/4pY9x6/t2PVi8GhW4tKIIKZmw6o QtH+YwmJwJXPkn9oKBjcNjU0+13erDYJ6fYHaK6CEjIrWX9WEtnZ6Lz6leXWHZ6J+7NozG woSwVRbrKQLBGKYV5jq4SjpT+NikfcX3JfJDyp989rohGAX+VXqWiLAFD4SUM3vCwf2Elx 2Y3q9q7z4gCJXiUPu1jQMGZUaKq3cuJUxidoLy6SDNiDyti38Ksdyaz3aA9PoEQYTlLSdX ZSymHUax4pTaeXcw60ackXJMhc7sB2B+lB4UtsHeemVxR1ktzm3AeuWX8gBQOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715981768; a=rsa-sha256; cv=none; b=E1avnb9Fu/9febIZzh3V5ykm5RmD7Dx0R7FMTr/ICLaUmUknfs281PZ3vQM2LP141o+gP4 3LvCvU30fEa4AoXcI55ZTO+HjBgDDRxFLfUEoLeW1/s33oYtEOFKv/UF+qSXyMfeCA3Qhz vBTkrUSxkgytLP8NgAyn8lBJaZQtISkszcvYdycyygO9obw0zBEFuDp+Zae9bESQ2WkFc8 NrVQDvx8Xvi8rcEOySKIA2ikO8omaJ4TjY+yFJ8/PFlXwQr3/HFQLbb/wVePnrj4GRBiuK VSIi1ckp6tMzljWKlqpZujG5R+AroiKkdN+m4/RAJqnM7EXSrOl7mCbWAg99SQ== 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=1715981768; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3fUFqEwQWBgcm8lsWcn8CqpAMzZ3eAHUeDz2RNJ9hyQ=; b=QUUelQ4Uy1f96BoQqJR4v9J71ajtVpojI3MUk1Ywy/qQHliRbXLy0XtLswdWVFbzqmDt5N dWCEmi0Dv2DLEtqzCvA1xm11wyDob9AVaLkOyhwWs3/hi7h1kZvBbGHCx5Ja7wwBfu0rSW X9J5oSD/PspbzJc2YBq8J5J7oiInQFv4Hs+FKxPQerarRIRyvooMCn3cyvdfZOTzIkhXKq juPTAo1wsuaom3czcDQO2bnabuFY4QTJwvJycClZyw0/BIfcH3xR3XLhg6x+N/1M7fsenN TaCIbBUUuNjhiE+HlcQ+gopC3vvePdbxaattotUrMKSIMCeNNOl/P/6fCxhYig== Received: from mx1.sbone.de (cross.sbone.de [195.201.62.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE Root Certificate Authority" (not verified)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Vh0dN0JB1zNlb; Fri, 17 May 2024 21:36:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 96C078D4A126; Fri, 17 May 2024 21:36:05 +0000 (UTC) Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id A688B2D029D8; Fri, 17 May 2024 21:36:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id w8yYAazTkx2N; Fri, 17 May 2024 21:36:03 +0000 (UTC) Received: from strong-iwl0.sbone.de (strong-iwl0.sbone.de [IPv6:fde9:577b:c1a9:4902:b66b:fcff:fef3:e3d2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 30F222D029D2; Fri, 17 May 2024 21:36:02 +0000 (UTC) Date: Fri, 17 May 2024 21:36:02 +0000 (UTC) From: "Bjoern A. Zeeb" To: John Baldwin cc: Emmanuel Vadot , Emmanuel Vadot , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: cff79fd02636 - main - linuxkpi: Fix spin_lock_init In-Reply-To: <0f2c4189-e259-4bd8-ad31-212a8df0e1b5@FreeBSD.org> Message-ID: <188o7q6o-n0rn-235r-76n4-779o555094r9@SerrOFQ.bet> References: <202405170559.44H5xD7d019861@gitrepo.freebsd.org> <2cd3e698-1b42-4e7f-93a0-aacccb55c8d6@FreeBSD.org> <20240517183350.e45f54df07f670980d5a51c3@bidouilliste.com> <0f2c4189-e259-4bd8-ad31-212a8df0e1b5@FreeBSD.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII On Fri, 17 May 2024, John Baldwin wrote: > On 5/17/24 9:33 AM, Emmanuel Vadot wrote: >> On Fri, 17 May 2024 09:07:53 -0700 >> John Baldwin wrote: >> >>> On 5/16/24 10:59 PM, Emmanuel Vadot wrote: >>>> The branch main has been updated by manu: >>>> >>>> URL: >>>> https://cgit.FreeBSD.org/src/commit/?id=cff79fd02636f34010d8b835cc9e55401fa76e74 >>>> >>>> commit cff79fd02636f34010d8b835cc9e55401fa76e74 >>>> Author: Emmanuel Vadot >>>> AuthorDate: 2024-05-17 04:52:53 +0000 >>>> Commit: Emmanuel Vadot >>>> CommitDate: 2024-05-17 05:58:59 +0000 >>>> >>>> linuxkpi: Fix spin_lock_init >>>> Some linux code re-init some spinlock so add MTX_NEW to >>>> mtx_init. >>>> Reported by: David Wolfskill >>>> Fixes: ae38a1a1bfdf ("linuxkpi: spinlock: Simplify code") >>>> --- >>>> sys/compat/linuxkpi/common/include/linux/spinlock.h | 2 +- >>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>> >>>> diff --git a/sys/compat/linuxkpi/common/include/linux/spinlock.h >>>> b/sys/compat/linuxkpi/common/include/linux/spinlock.h >>>> index 3f6eb4bb70f6..2992e41c9c02 100644 >>>> --- a/sys/compat/linuxkpi/common/include/linux/spinlock.h >>>> +++ b/sys/compat/linuxkpi/common/include/linux/spinlock.h >>>> @@ -140,7 +140,7 @@ typedef struct mtx spinlock_t; >>>> #define spin_lock_name(name) _spin_lock_name(name, >>>> __FILE__, __LINE__) >>>> #define spin_lock_init(lock) mtx_init(lock, >>>> spin_lock_name("lnxspin"), \ >>>> - NULL, MTX_DEF | MTX_NOWITNESS) >>>> + NULL, MTX_DEF | MTX_NOWITNESS | MTX_NEW) >>>> #define spin_lock_destroy(_l) mtx_destroy(_l) >>> >>> This is only ok because of MTX_NOWITNESS. Reiniting locks without >>> destroying >>> them corrupts the internal linked lists in WITNESS for locks using >>> witness. >>> That may warrant a comment here explaining why we disable witness. >> >> I'll try to look at what linux expect for spinlocks, it could also be >> that we need to do this because some drivers via linuxkpi does weird >> things ... >> >>> It might be nice to add an extension to the various lock inits for code >>> that >>> wants to opt-int to using WITNESS where a name can be passed. Using those >>> would >>> be relatively small diffs in the client code and let select locks opt into >>> using WITNESS. You could make it work by adding an optional second >>> argument >>> to spin_lock_init, etc. that takes the name. >> >> We can't change spin_lock_init, we need to follow linux api here. > > You can use macro magic to add support for an optional second argument. > > #define _spin_lock_init2(lock, name) mtx_init(lock, name, NULL, MTX_DEF) > > #define _spin_lock_init1(lock) mtx_init(lock, spin_lock_name("lnxspin"), ...) > > #define _spin_lock_init_macro(lock, name, NAME, ...) > NAME > > #define spin_lock_init(...) \ > _spin_lock_init_macro(__VA_ARGS__, _spin_lock_init2, > _spin_lock_init1)(__VA_ARGS__) > > Then you can choose to specifically annotate certain locks with a name > instead in which case they will use WITNESS. I think the real confusing here comes from the fact that FreeBSD has spin_lock_destroy in LinuxKPI which I believe is a local addition (though not documented as such) for semi-native drivers using parts of LinuxKPI and in order to use spinlocks according to "FreeBSD expectations". I believe (and still hope someone would correct me) that Linux has not functions to destroy locks like we do? I believe for rwlocks I had left that remark on the review: https://reviews.freebsd.org/D45206#1031316 So if you use WITNESS anywhere you could only really do so for "internal" parts but nowhere in Linux driver code as that will likely simply break assumptions? -- Bjoern A. Zeeb r15:7 From nobody Fri May 17 21:41:39 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vh0lq1WbVz5K8f0; Fri, 17 May 2024 21:41:43 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vh0lq15WTz4Q2G; Fri, 17 May 2024 21:41:43 +0000 (UTC) (envelope-from bz@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715982103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XNG5+I3Dd3kfNjLnrhvPkwv13SQUdpDEe7hC+pIRmKU=; b=AnxKtMYS/fem2xzORNBbJHRFwinZ/eJ7+HBbzS9k/LDN58YAmT3keehTyjwfhV6b1xn1uH HpKj20A4nbiLKG+bIQsxRA6sY9RcHFEqMyniwwZqPlLZ17pHzMg+6KR+aEW4A33cc6oljE Glpp8AMpukkzSt2jw3vh+H6IzZjsjevSDOr2swBVkqQT+jUdjKAuLGs6kX6mte5Q1E+f1u qyod7lkmBVvH5+2NH2Z9XF4SNz/6w+k5+KTS8UnIkEJJ/IT1X96fV9RgCtwDz7ybYezp2N HrvciR+Bj7/YfN31S2L7QR1rAjr4AXSFGiRNbzDog4sIaB/j7tFdd8pbOCZorg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715982103; a=rsa-sha256; cv=none; b=FaKAkelp8NbxckvcOVsVN7R01s+nQ8O1NFoP+rp/M6Ke2KhfDhVd9Bxed+BxnoYryN72sh EyYBReMzoU2FANgKngoLPMkvLK7sV0EoqQXar/brNfOH2K6DtmqWcB/eqR4EshPZ5LptpJ uMcs6f2tl8HgJUUeOU4ZTQ8f9hCmhlHBsXIoH9pBU3YJZOytNcdU8JfKzwEJz7hOlzh29A bdXEB4/q4a7kNIHR1cDyJOq7JKZqzWSYrOdbHVHvtXCPab5+W/mSon9grjznciJzovhtzf +2WlKxu4WcJcLH79osVlR0D4qU1+TytFdDLTemkZCSGUry9coLoXILufLnuXGQ== 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=1715982103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XNG5+I3Dd3kfNjLnrhvPkwv13SQUdpDEe7hC+pIRmKU=; b=HGKoXjBeWmnyApyL6B4vJ90wO/qdNLwN24mOJk7Hh8+pgDzLE+GfIINB/sqAxjfPBge4rw 1IkBHPlOtMdBQreNGJqUHqrzQ3t82JonWgM6MntxR0cMkqnfhB0TKZVR00q/i1gWRcVete K1rkvLiU2RcdlKSoEdlUlkMCBYR9HhLy38dyPxaU40hOkPWEifiBcAHCRLgvWP1IvJTizX mK2iBddG/tBPdR/awvuvoymxYULOyBh+9pPWqYcBzeeLPRaWZ35bm/zcycKx5cOsEaC7Vv /OYlGHkwf8ACwrTXR0BWK1n3p8VQblCpOzkI0P26loO8k+KdPHO6GED6OpMlFQ== Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:13b:39f::9f:25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE Root Certificate Authority" (not verified)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Vh0lq01HdzNlk; Fri, 17 May 2024 21:41:42 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 977AB8D4A127; Fri, 17 May 2024 21:41:41 +0000 (UTC) Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id D50AC2D029D9; Fri, 17 May 2024 21:41:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id 33rDm7sIxwep; Fri, 17 May 2024 21:41:39 +0000 (UTC) Received: from strong-iwl0.sbone.de (strong-iwl0.sbone.de [IPv6:fde9:577b:c1a9:4902:b66b:fcff:fef3:e3d2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id E69212D029D2; Fri, 17 May 2024 21:41:39 +0000 (UTC) Date: Fri, 17 May 2024 21:41:39 +0000 (UTC) From: "Bjoern A. Zeeb" To: Emmanuel Vadot cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: cff79fd02636 - main - linuxkpi: Fix spin_lock_init In-Reply-To: <202405170559.44H5xD7d019861@gitrepo.freebsd.org> Message-ID: <720nrnro-51n7-5669-o85o-p0rsr44o5951@SerrOFQ.bet> References: <202405170559.44H5xD7d019861@gitrepo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed On Fri, 17 May 2024, Emmanuel Vadot wrote: > The branch main has been updated by manu: > > URL: https://cgit.FreeBSD.org/src/commit/?id=cff79fd02636f34010d8b835cc9e55401fa76e74 > > commit cff79fd02636f34010d8b835cc9e55401fa76e74 > Author: Emmanuel Vadot > AuthorDate: 2024-05-17 04:52:53 +0000 > Commit: Emmanuel Vadot > CommitDate: 2024-05-17 05:58:59 +0000 > > linuxkpi: Fix spin_lock_init > > Some linux code re-init some spinlock so add MTX_NEW to mtx_init. Sorry, I should have realized during the review; we no longer run the memset(0) on them when (re-)initializing. > Reported by: David Wolfskill > Fixes: ae38a1a1bfdf ("linuxkpi: spinlock: Simplify code") > --- > sys/compat/linuxkpi/common/include/linux/spinlock.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sys/compat/linuxkpi/common/include/linux/spinlock.h b/sys/compat/linuxkpi/common/include/linux/spinlock.h > index 3f6eb4bb70f6..2992e41c9c02 100644 > --- a/sys/compat/linuxkpi/common/include/linux/spinlock.h > +++ b/sys/compat/linuxkpi/common/include/linux/spinlock.h > @@ -140,7 +140,7 @@ typedef struct mtx spinlock_t; > #define spin_lock_name(name) _spin_lock_name(name, __FILE__, __LINE__) > > #define spin_lock_init(lock) mtx_init(lock, spin_lock_name("lnxspin"), \ > - NULL, MTX_DEF | MTX_NOWITNESS) > + NULL, MTX_DEF | MTX_NOWITNESS | MTX_NEW) > > #define spin_lock_destroy(_l) mtx_destroy(_l) As mentioned elsewhere; it is funny this exists^^^ -- Bjoern A. Zeeb r15:7 From nobody Fri May 17 22:46:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vh2BC0Kltz5KVrt; Fri, 17 May 2024 22:46: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 4Vh2BB6tmWz4Xt7; Fri, 17 May 2024 22:46:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715985971; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G9Q6nUdLOJV/ZyTyCvqZbjbSpp2SsuVd3pmwgi8v4ys=; b=VKIq9PpegCG1wsTVmVYZOKSYv5j315VGpiHqm25kAr3+wt170KWmk3neo020YHuxDh12lZ ErcN+zfYWNUEW++bD3TRh/D3vz4LkHz/cm9OJ4GQ0366SkXv+tYP3N5Ipm8s0QK/RSVe+3 MWuXdxWvZ7TD3iming4lcHjGz5aF3hn7xg4atQ4ySYIpDvpRRisu6jDDXdYx0tAh87Zqqi 0GFh/6PjesXlZ9ibIXB05+7fXBLfV5PkmSIjvnURyb1CzhG/3f8h4O+RPra/Dar9mXNDDo dJaD1omUvIhfc4+Ed/qx+0p5jeZHohkHz3WGwS8tgOAvisHnGvAlOt+56gFreQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715985971; a=rsa-sha256; cv=none; b=BKYLJ0NGofDAEht/1CJw9c9BMU+MGAqykeaO3zOPHtZz5ZekCfnB6KyKP6Ro604/ufbKCp j+wR5IMZEVekkpsHZh2GQQIBS9cG6/BwXgAMTFqk72EKUf21LYFBqkanjs90HHXmCna1nM /6oOxODURVzsz8zu2wHNyGhrjmWgX4/SZOqdPRExv0wwNkMAgJFi/uKGmIIs/Ccvex079Q OZeYUuCV02QlGguAlHxFZJb5baKv1EWGB+Mj11VfKdr4HAE4MxEaFYslMyMmRpIxD4b39k MmqjcSQnvRH/CkWDM62xPH6sEvv5Bu9colYGbOJScMRHdFuhfoQiisSa70PI0Q== 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=1715985971; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G9Q6nUdLOJV/ZyTyCvqZbjbSpp2SsuVd3pmwgi8v4ys=; b=GAAX8dNnVRmGQoNIeGIsfhQClXY479haElXHrxUn/pVaJG9YeTQf6iriSJ5ja7ijaKLxWj hvRClZpnlklUfTnmKNE5Qy6TK3LlRJlFqINEPzJbG4WvmyIhpUMvTZztmS5A6qhRZFweD+ gFb2eb1fH2K2JdmjvAhz32i0wfEXLQkRd2zGFKHOufJVruPJhIPN9+PWAmeuyNxAn9LJdx cciFfKoBd2sgFHjURO/e35UZsq+EZma6aCf/fJgUBWVTqSWaNWCmeTV4STOSW8l11r2Vgu Ut2lFbqGpA18YSGXQZdDVvS/jXrP+qJ5yt5EUqC3w210cqZJANZMj0jnlsyLPA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vh2BB6V5fz11YL; Fri, 17 May 2024 22:46: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 44HMkAPO026943; Fri, 17 May 2024 22:46:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HMkAZE026940; Fri, 17 May 2024 22:46:10 GMT (envelope-from git) Date: Fri, 17 May 2024 22:46:10 GMT Message-Id: <202405172246.44HMkAZE026940@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: cca3506dc154 - main - cxgbe(4): sc->port is indexed by port_id and not tx_chan. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cca3506dc15464baf9b09b143879ed13fb5684c7 Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=cca3506dc15464baf9b09b143879ed13fb5684c7 commit cca3506dc15464baf9b09b143879ed13fb5684c7 Author: Navdeep Parhar AuthorDate: 2024-05-02 23:47:18 +0000 Commit: Navdeep Parhar CommitDate: 2024-05-17 22:42:23 +0000 cxgbe(4): sc->port is indexed by port_id and not tx_chan. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/t4_sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/cxgbe/t4_sched.c b/sys/dev/cxgbe/t4_sched.c index 46638a086a0d..2186c8aa2ac0 100644 --- a/sys/dev/cxgbe/t4_sched.c +++ b/sys/dev/cxgbe/t4_sched.c @@ -334,7 +334,7 @@ bind_txq_to_traffic_class(struct adapter *sc, struct sge_txq *txq, int idx) goto done; } - tc0 = &sc->port[txq->eq.tx_chan]->sched_params->cl_rl[0]; + tc0 = &sc->port[txq->eq.port_id]->sched_params->cl_rl[0]; if (idx != -1) { /* * Bind to a different class at index idx. From nobody Fri May 17 22:58:12 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vh2S51qcqz5KWml; Fri, 17 May 2024 22:58:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vh2S51byZz4Yc9; Fri, 17 May 2024 22:58:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715986693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SrybMwknYydn+98DKlt0Qc+Cuz9hzKbLBgOGBlQTY+c=; b=ax7qtp3ihTys1B5h6xJZgeM9XbTnL/bCG9LTjFxRc6Oa8aCpxhDkKkX/ii6lBtEWlUMaV2 QSHWZiCewvrMoJnMDt5ESLsyXEvKa9pb+SD5+lviECYt+9PDhJdwKA0FKNvIzOMGSGAqWV 6ifmIUfLHFJymmP31Hdx14WJMxl9v0BZKVwTds3B/tfLLTJ033hhJmzLP5i51JUEh7CzYn Q6a0wiTuXWPjbcPArrXbZx3+D7y9lnv/CmHOTPOzHKJ7tFvB5B6pvCFZ6UO7ixOqVCWZul 6tJv45t3d2vHLLmbT7Dmo9zQbG1FlQxXPoWIeROVEEOp6wh3TKq5ZpbNUe5CKA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715986693; a=rsa-sha256; cv=none; b=CBCdc0UkB5Bd/7rnL/7w6DSyMfa41mBLdAtCa5SAnZTRaQfm3aw8QT+4L+y8rYvvgIbOHm av7J5/zIiJeLw+8nBQ/u1q0eciMT4xydBmInfhB+dTzX98wZweKRRkFv1zzOhEuxVPupM3 cpzGr3kxO1BNCIJHDy8Ry7z88wWnb86L3GeGm0YfkdhHtnPdfBneld+fd+1Pto66N1Qu7l X3XE9U8bu5DMTk06dMBLvfVLS6bOtsHxlamrQvudhYZ7L8UZVmgFCRiXa2G0uH/jHQWrTM Yoru+aCpHJ5R5myzkVF35oq5MYdXCgom6O708NT6+jDzBXsETOknyUcIwqmCog== 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=1715986693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SrybMwknYydn+98DKlt0Qc+Cuz9hzKbLBgOGBlQTY+c=; b=y1+qmJ7X77isHafyMYaMtrt2ZMggHY9jndcOZ/AZ5a5uFnY8Vtyr5xE+H6cSpwciV3w0Il O0Gq2F7tfJnhQjdfwyw1SZN6wKrjX7sdNzGW2EkKJG4J8auRs4e8sBy2n1D8WapqSzqG+L IZa1fCdO+WmLkT7MhwXMbyeNquZv6enxL2njvzwdKoNrmpL/OOrVj/Gx8WVukJBtwjaId8 9AqIDjkrFETjOSEbZcygDHaF19SQpjWoLivWMBhnMdQJviC7YTuukyErtKEvgg6Fwn9RXo SYYvb1xkOTUg33vDHFetQJm/wVfZXT1QMk3DmawibjgMSeFvHjomOKG7htkXbg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vh2S50whmz1208; Fri, 17 May 2024 22:58:13 +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 44HMwD9V043686; Fri, 17 May 2024 22:58:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HMwCdc043683; Fri, 17 May 2024 22:58:12 GMT (envelope-from git) Date: Fri, 17 May 2024 22:58:12 GMT Message-Id: <202405172258.44HMwCdc043683@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 64a00f877fc2 - main - cxgbe(4): Consolidate all mk_set_tcb_field_ulp in one place. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 64a00f877fc23d904d5f4ca00471e09954eb9381 Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=64a00f877fc23d904d5f4ca00471e09954eb9381 commit 64a00f877fc23d904d5f4ca00471e09954eb9381 Author: Navdeep Parhar AuthorDate: 2023-04-01 00:23:38 +0000 Commit: Navdeep Parhar CommitDate: 2024-05-17 22:52:33 +0000 cxgbe(4): Consolidate all mk_set_tcb_field_ulp in one place. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/common/common.h | 42 ++++++++++++++++++++++++++++++++++ sys/dev/cxgbe/t4_filter.c | 43 +++++------------------------------ sys/dev/cxgbe/tom/t4_ddp.c | 52 +++++++++---------------------------------- sys/dev/cxgbe/tom/t4_tls.c | 50 ++++++----------------------------------- sys/dev/cxgbe/tom/t4_tom.c | 42 ++++------------------------------ 5 files changed, 68 insertions(+), 161 deletions(-) diff --git a/sys/dev/cxgbe/common/common.h b/sys/dev/cxgbe/common/common.h index 894e0444b710..a49c21576994 100644 --- a/sys/dev/cxgbe/common/common.h +++ b/sys/dev/cxgbe/common/common.h @@ -963,4 +963,46 @@ port_top_speed(const struct port_info *pi) return (fwcap_to_speed(pi->link_cfg.pcaps) / 1000); } +/* SET_TCB_FIELD sent as a ULP command looks like this */ +#define LEN__SET_TCB_FIELD_ULP (sizeof(struct ulp_txpkt) + \ + sizeof(struct ulptx_idata) + sizeof(struct cpl_set_tcb_field_core)) + +static inline void * +mk_set_tcb_field_ulp(struct adapter *sc, void *cur, int tid, uint16_t word, + uint64_t mask, uint64_t val) +{ + struct ulp_txpkt *ulpmc; + struct ulptx_idata *ulpsc; + struct cpl_set_tcb_field_core *req; + + MPASS(((uintptr_t)cur & 7) == 0); + + ulpmc = cur; + ulpmc->cmd_dest = htobe32(V_ULPTX_CMD(ULP_TX_PKT) | + V_ULP_TXPKT_DEST(ULP_TXPKT_DEST_TP)); + ulpmc->len = htobe32(howmany(LEN__SET_TCB_FIELD_ULP, 16)); + + ulpsc = (struct ulptx_idata *)(ulpmc + 1); + ulpsc->cmd_more = htobe32(V_ULPTX_CMD(ULP_TX_SC_IMM)); + ulpsc->len = htobe32(sizeof(*req)); + + req = (struct cpl_set_tcb_field_core *)(ulpsc + 1); + OPCODE_TID(req) = htobe32(MK_OPCODE_TID(CPL_SET_TCB_FIELD, tid)); + req->reply_ctrl = htobe16(F_NO_REPLY); + req->word_cookie = htobe16(V_WORD(word) | V_COOKIE(0)); + req->mask = htobe64(mask); + req->val = htobe64(val); + + /* + * ULP_TX is an 8B processor but the firmware transfers WRs in 16B + * chunks. The master command for set_tcb_field does not end at a 16B + * boundary so it needs to be padded with a no-op. + */ + MPASS((LEN__SET_TCB_FIELD_ULP & 0xf) != 0); + ulpsc = (struct ulptx_idata *)(req + 1); + ulpsc->cmd_more = htobe32(V_ULPTX_CMD(ULP_TX_SC_NOOP)); + ulpsc->len = htobe32(0); + + return (ulpsc + 1); +} #endif /* __CHELSIO_COMMON_H */ diff --git a/sys/dev/cxgbe/t4_filter.c b/sys/dev/cxgbe/t4_filter.c index 18fa1093800f..359aae6df24e 100644 --- a/sys/dev/cxgbe/t4_filter.c +++ b/sys/dev/cxgbe/t4_filter.c @@ -1698,40 +1698,6 @@ done: return (rc); } -/* SET_TCB_FIELD sent as a ULP command looks like this */ -#define LEN__SET_TCB_FIELD_ULP (sizeof(struct ulp_txpkt) + \ - sizeof(struct ulptx_idata) + sizeof(struct cpl_set_tcb_field_core)) - -static void * -mk_set_tcb_field_ulp(struct ulp_txpkt *ulpmc, uint64_t word, uint64_t mask, - uint64_t val, uint32_t tid, uint32_t qid) -{ - struct ulptx_idata *ulpsc; - struct cpl_set_tcb_field_core *req; - - ulpmc->cmd_dest = htonl(V_ULPTX_CMD(ULP_TX_PKT) | V_ULP_TXPKT_DEST(0)); - ulpmc->len = htobe32(howmany(LEN__SET_TCB_FIELD_ULP, 16)); - - ulpsc = (struct ulptx_idata *)(ulpmc + 1); - ulpsc->cmd_more = htobe32(V_ULPTX_CMD(ULP_TX_SC_IMM)); - ulpsc->len = htobe32(sizeof(*req)); - - req = (struct cpl_set_tcb_field_core *)(ulpsc + 1); - OPCODE_TID(req) = htobe32(MK_OPCODE_TID(CPL_SET_TCB_FIELD, tid)); - req->reply_ctrl = htobe16(V_NO_REPLY(1) | V_QUEUENO(qid)); - req->word_cookie = htobe16(V_WORD(word) | V_COOKIE(0)); - req->mask = htobe64(mask); - req->val = htobe64(val); - - ulpsc = (struct ulptx_idata *)(req + 1); - if (LEN__SET_TCB_FIELD_ULP % 16) { - ulpsc->cmd_more = htobe32(V_ULPTX_CMD(ULP_TX_SC_NOOP)); - ulpsc->len = htobe32(0); - return (ulpsc + 1); - } - return (ulpsc); -} - /* ABORT_REQ sent as a ULP command looks like this */ #define LEN__ABORT_REQ_ULP (sizeof(struct ulp_txpkt) + \ sizeof(struct ulptx_idata) + sizeof(struct cpl_abort_req_core)) @@ -1807,14 +1773,15 @@ del_hashfilter_wrlen(void) } static void -mk_del_hashfilter_wr(int tid, struct work_request_hdr *wrh, int wrlen, int qid) +mk_del_hashfilter_wr(struct adapter *sc, int tid, struct work_request_hdr *wrh, + int wrlen, int qid) { struct ulp_txpkt *ulpmc; INIT_ULPTX_WRH(wrh, wrlen, 0, 0); ulpmc = (struct ulp_txpkt *)(wrh + 1); - ulpmc = mk_set_tcb_field_ulp(ulpmc, W_TCB_RSS_INFO, - V_TCB_RSS_INFO(M_TCB_RSS_INFO), V_TCB_RSS_INFO(qid), tid, 0); + ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, tid, W_TCB_RSS_INFO, + V_TCB_RSS_INFO(M_TCB_RSS_INFO), V_TCB_RSS_INFO(qid)); ulpmc = mk_abort_req_ulp(ulpmc, tid); ulpmc = mk_abort_rpl_ulp(ulpmc, tid); } @@ -1857,7 +1824,7 @@ del_hashfilter(struct adapter *sc, struct t4_filter *t) goto done; } - mk_del_hashfilter_wr(t->idx, wr, wrlen, sc->sge.fwq.abs_id); + mk_del_hashfilter_wr(sc, t->idx, wr, wrlen, sc->sge.fwq.abs_id); f->locked = 1; f->pending = 1; commit_wrq_wr(&sc->sge.ctrlq[0], wr, &cookie); diff --git a/sys/dev/cxgbe/tom/t4_ddp.c b/sys/dev/cxgbe/tom/t4_ddp.c index c1d4af45fd70..a08ddea00d05 100644 --- a/sys/dev/cxgbe/tom/t4_ddp.c +++ b/sys/dev/cxgbe/tom/t4_ddp.c @@ -545,37 +545,6 @@ insert_ddp_data(struct toepcb *toep, uint32_t n) #define LEN__RX_DATA_ACK_ULP (sizeof(struct ulp_txpkt) + \ sizeof(struct ulptx_idata) + sizeof(struct cpl_rx_data_ack_core)) -static inline void * -mk_set_tcb_field_ulp(struct ulp_txpkt *ulpmc, struct toepcb *toep, - uint64_t word, uint64_t mask, uint64_t val) -{ - struct ulptx_idata *ulpsc; - struct cpl_set_tcb_field_core *req; - - ulpmc->cmd_dest = htonl(V_ULPTX_CMD(ULP_TX_PKT) | V_ULP_TXPKT_DEST(0)); - ulpmc->len = htobe32(howmany(LEN__SET_TCB_FIELD_ULP, 16)); - - ulpsc = (struct ulptx_idata *)(ulpmc + 1); - ulpsc->cmd_more = htobe32(V_ULPTX_CMD(ULP_TX_SC_IMM)); - ulpsc->len = htobe32(sizeof(*req)); - - req = (struct cpl_set_tcb_field_core *)(ulpsc + 1); - OPCODE_TID(req) = htobe32(MK_OPCODE_TID(CPL_SET_TCB_FIELD, toep->tid)); - req->reply_ctrl = htobe16(V_NO_REPLY(1) | - V_QUEUENO(toep->ofld_rxq->iq.abs_id)); - req->word_cookie = htobe16(V_WORD(word) | V_COOKIE(0)); - req->mask = htobe64(mask); - req->val = htobe64(val); - - ulpsc = (struct ulptx_idata *)(req + 1); - if (LEN__SET_TCB_FIELD_ULP % 16) { - ulpsc->cmd_more = htobe32(V_ULPTX_CMD(ULP_TX_SC_NOOP)); - ulpsc->len = htobe32(0); - return (ulpsc + 1); - } - return (ulpsc); -} - static inline void * mk_rx_data_ack_ulp(struct ulp_txpkt *ulpmc, struct toepcb *toep) { @@ -634,21 +603,21 @@ mk_update_tcb_for_ddp(struct adapter *sc, struct toepcb *toep, int db_idx, ulpmc = (struct ulp_txpkt *)(wrh + 1); /* Write the buffer's tag */ - ulpmc = mk_set_tcb_field_ulp(ulpmc, toep, + ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, toep->tid, W_TCB_RX_DDP_BUF0_TAG + db_idx, V_TCB_RX_DDP_BUF0_TAG(M_TCB_RX_DDP_BUF0_TAG), V_TCB_RX_DDP_BUF0_TAG(prsv->prsv_tag)); /* Update the current offset in the DDP buffer and its total length */ if (db_idx == 0) - ulpmc = mk_set_tcb_field_ulp(ulpmc, toep, + ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, toep->tid, W_TCB_RX_DDP_BUF0_OFFSET, V_TCB_RX_DDP_BUF0_OFFSET(M_TCB_RX_DDP_BUF0_OFFSET) | V_TCB_RX_DDP_BUF0_LEN(M_TCB_RX_DDP_BUF0_LEN), V_TCB_RX_DDP_BUF0_OFFSET(offset) | V_TCB_RX_DDP_BUF0_LEN(len)); else - ulpmc = mk_set_tcb_field_ulp(ulpmc, toep, + ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, toep->tid, W_TCB_RX_DDP_BUF1_OFFSET, V_TCB_RX_DDP_BUF1_OFFSET(M_TCB_RX_DDP_BUF1_OFFSET) | V_TCB_RX_DDP_BUF1_LEN((u64)M_TCB_RX_DDP_BUF1_LEN << 32), @@ -656,7 +625,7 @@ mk_update_tcb_for_ddp(struct adapter *sc, struct toepcb *toep, int db_idx, V_TCB_RX_DDP_BUF1_LEN((u64)len << 32)); /* Update DDP flags */ - ulpmc = mk_set_tcb_field_ulp(ulpmc, toep, W_TCB_RX_DDP_FLAGS, + ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, toep->tid, W_TCB_RX_DDP_FLAGS, ddp_flags_mask, ddp_flags); /* Gratuitous RX_DATA_ACK with RX_MODULATE set to speed up delivery. */ @@ -1295,26 +1264,25 @@ set_ddp_ulp_mode(struct toepcb *toep) * Words 26/27 are zero except for the DDP_OFF flag in * W_TCB_RX_DDP_FLAGS (27). */ - ulpmc = mk_set_tcb_field_ulp(ulpmc, toep, 26, + ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, toep->tid, 26, 0xffffffffffffffff, (uint64_t)V_TF_DDP_OFF(1) << 32); /* Words 28/29 are zero. */ - ulpmc = mk_set_tcb_field_ulp(ulpmc, toep, 28, + ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, toep->tid, 28, 0xffffffffffffffff, 0); /* Words 30/31 are zero. */ - ulpmc = mk_set_tcb_field_ulp(ulpmc, toep, 30, + ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, toep->tid, 30, 0xffffffffffffffff, 0); /* Set the ULP mode to ULP_MODE_TCPDDP. */ toep->params.ulp_mode = ULP_MODE_TCPDDP; - ulpmc = mk_set_tcb_field_ulp(ulpmc, toep, W_TCB_ULP_TYPE, - V_TCB_ULP_TYPE(M_TCB_ULP_TYPE), - V_TCB_ULP_TYPE(ULP_MODE_TCPDDP)); + ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, toep->tid, W_TCB_ULP_TYPE, + V_TCB_ULP_TYPE(M_TCB_ULP_TYPE), V_TCB_ULP_TYPE(ULP_MODE_TCPDDP)); #ifdef USE_DDP_RX_FLOW_CONTROL /* Set TF_RX_FLOW_CONTROL_DDP. */ - ulpmc = mk_set_tcb_field_ulp(ulpmc, toep, W_TCB_T_FLAGS, + ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, toep->tid, W_TCB_T_FLAGS, V_TF_RX_FLOW_CONTROL_DDP(1), V_TF_RX_FLOW_CONTROL_DDP(1)); #endif diff --git a/sys/dev/cxgbe/tom/t4_tls.c b/sys/dev/cxgbe/tom/t4_tls.c index bdd03edd3a6f..c6377980fca9 100644 --- a/sys/dev/cxgbe/tom/t4_tls.c +++ b/sys/dev/cxgbe/tom/t4_tls.c @@ -1075,41 +1075,6 @@ out: m_freem(m); } -/* SET_TCB_FIELD sent as a ULP command looks like this */ -#define LEN__SET_TCB_FIELD_ULP (sizeof(struct ulp_txpkt) + \ - sizeof(struct ulptx_idata) + sizeof(struct cpl_set_tcb_field_core)) - -static inline void * -mk_set_tcb_field_ulp(struct ulp_txpkt *ulpmc, struct toepcb *toep, - uint64_t word, uint64_t mask, uint64_t val) -{ - struct ulptx_idata *ulpsc; - struct cpl_set_tcb_field_core *req; - - ulpmc->cmd_dest = htonl(V_ULPTX_CMD(ULP_TX_PKT) | V_ULP_TXPKT_DEST(0)); - ulpmc->len = htobe32(howmany(LEN__SET_TCB_FIELD_ULP, 16)); - - ulpsc = (struct ulptx_idata *)(ulpmc + 1); - ulpsc->cmd_more = htobe32(V_ULPTX_CMD(ULP_TX_SC_IMM)); - ulpsc->len = htobe32(sizeof(*req)); - - req = (struct cpl_set_tcb_field_core *)(ulpsc + 1); - OPCODE_TID(req) = htobe32(MK_OPCODE_TID(CPL_SET_TCB_FIELD, toep->tid)); - req->reply_ctrl = htobe16(V_NO_REPLY(1) | - V_QUEUENO(toep->ofld_rxq->iq.abs_id)); - req->word_cookie = htobe16(V_WORD(word) | V_COOKIE(0)); - req->mask = htobe64(mask); - req->val = htobe64(val); - - ulpsc = (struct ulptx_idata *)(req + 1); - if (LEN__SET_TCB_FIELD_ULP % 16) { - ulpsc->cmd_more = htobe32(V_ULPTX_CMD(ULP_TX_SC_NOOP)); - ulpsc->len = htobe32(0); - return (ulpsc + 1); - } - return (ulpsc); -} - /* * Send a work request setting multiple TCB fields to enable * ULP_MODE_TLS. @@ -1164,7 +1129,7 @@ tls_update_tcb(struct adapter *sc, struct toepcb *toep, uint64_t seqno) * decryption. Word 30 is zero and Word 31 contains * the keyid. */ - ulpmc = mk_set_tcb_field_ulp(ulpmc, toep, 26, + ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, toep->tid, 26, 0xffffffffffffffff, 0); /* @@ -1173,15 +1138,15 @@ tls_update_tcb(struct adapter *sc, struct toepcb *toep, uint64_t seqno) * units of 64 bytes. */ key_offset = toep->tls.rx_key_addr - sc->vres.key.start; - ulpmc = mk_set_tcb_field_ulp(ulpmc, toep, 30, + ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, toep->tid, 30, 0xffffffffffffffff, (uint64_t)V_TCB_RX_TLS_KEY_TAG(key_offset / 64) << 32); CTR3(KTR_CXGBE, "%s: tid %d enable TLS seqno %lu", __func__, toep->tid, seqno); - ulpmc = mk_set_tcb_field_ulp(ulpmc, toep, W_TCB_TLS_SEQ, + ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, toep->tid, W_TCB_TLS_SEQ, V_TCB_TLS_SEQ(M_TCB_TLS_SEQ), V_TCB_TLS_SEQ(seqno)); - ulpmc = mk_set_tcb_field_ulp(ulpmc, toep, W_TCB_ULP_RAW, + ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, toep->tid, W_TCB_ULP_RAW, V_TCB_ULP_RAW(M_TCB_ULP_RAW), V_TCB_ULP_RAW((V_TF_TLS_KEY_SIZE(3) | V_TF_TLS_CONTROL(1) | V_TF_TLS_ACTIVE(1) | V_TF_TLS_ENABLE(1)))); @@ -1191,12 +1156,11 @@ tls_update_tcb(struct adapter *sc, struct toepcb *toep, uint64_t seqno) /* Set the ULP mode to ULP_MODE_TLS. */ toep->params.ulp_mode = ULP_MODE_TLS; - ulpmc = mk_set_tcb_field_ulp(ulpmc, toep, W_TCB_ULP_TYPE, - V_TCB_ULP_TYPE(M_TCB_ULP_TYPE), - V_TCB_ULP_TYPE(ULP_MODE_TLS)); + ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, toep->tid, W_TCB_ULP_TYPE, + V_TCB_ULP_TYPE(M_TCB_ULP_TYPE), V_TCB_ULP_TYPE(ULP_MODE_TLS)); /* Clear TF_RX_QUIESCE. */ - ulpmc = mk_set_tcb_field_ulp(ulpmc, toep, W_TCB_T_FLAGS, + ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, toep->tid, W_TCB_T_FLAGS, V_TF_RX_QUIESCE(1), 0); t4_wrq_tx(sc, wr); diff --git a/sys/dev/cxgbe/tom/t4_tom.c b/sys/dev/cxgbe/tom/t4_tom.c index ac5bba75f904..3fe34c7c01a3 100644 --- a/sys/dev/cxgbe/tom/t4_tom.c +++ b/sys/dev/cxgbe/tom/t4_tom.c @@ -838,40 +838,6 @@ t4_alloc_tls_session(struct toedev *tod, struct tcpcb *tp, } #endif -/* SET_TCB_FIELD sent as a ULP command looks like this */ -#define LEN__SET_TCB_FIELD_ULP (sizeof(struct ulp_txpkt) + \ - sizeof(struct ulptx_idata) + sizeof(struct cpl_set_tcb_field_core)) - -static void * -mk_set_tcb_field_ulp(struct ulp_txpkt *ulpmc, uint64_t word, uint64_t mask, - uint64_t val, uint32_t tid) -{ - struct ulptx_idata *ulpsc; - struct cpl_set_tcb_field_core *req; - - ulpmc->cmd_dest = htonl(V_ULPTX_CMD(ULP_TX_PKT) | V_ULP_TXPKT_DEST(0)); - ulpmc->len = htobe32(howmany(LEN__SET_TCB_FIELD_ULP, 16)); - - ulpsc = (struct ulptx_idata *)(ulpmc + 1); - ulpsc->cmd_more = htobe32(V_ULPTX_CMD(ULP_TX_SC_IMM)); - ulpsc->len = htobe32(sizeof(*req)); - - req = (struct cpl_set_tcb_field_core *)(ulpsc + 1); - OPCODE_TID(req) = htobe32(MK_OPCODE_TID(CPL_SET_TCB_FIELD, tid)); - req->reply_ctrl = htobe16(V_NO_REPLY(1)); - req->word_cookie = htobe16(V_WORD(word) | V_COOKIE(0)); - req->mask = htobe64(mask); - req->val = htobe64(val); - - ulpsc = (struct ulptx_idata *)(req + 1); - if (LEN__SET_TCB_FIELD_ULP % 16) { - ulpsc->cmd_more = htobe32(V_ULPTX_CMD(ULP_TX_SC_NOOP)); - ulpsc->len = htobe32(0); - return (ulpsc + 1); - } - return (ulpsc); -} - static void send_mss_flowc_wr(struct adapter *sc, struct toepcb *toep) { @@ -958,10 +924,10 @@ t4_pmtu_update(struct toedev *tod, struct tcpcb *tp, tcp_seq seq, int mtu) } INIT_ULPTX_WRH(wrh, len, 1, 0); /* atomic */ ulpmc = (struct ulp_txpkt *)(wrh + 1); - ulpmc = mk_set_tcb_field_ulp(ulpmc, W_TCB_T_MAXSEG, - V_TCB_T_MAXSEG(M_TCB_T_MAXSEG), V_TCB_T_MAXSEG(idx), toep->tid); - ulpmc = mk_set_tcb_field_ulp(ulpmc, W_TCB_TIMESTAMP, - V_TCB_TIMESTAMP(0x7FFFFULL << 11), 0, toep->tid); + ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, toep->tid, W_TCB_T_MAXSEG, + V_TCB_T_MAXSEG(M_TCB_T_MAXSEG), V_TCB_T_MAXSEG(idx)); + ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, toep->tid, W_TCB_TIMESTAMP, + V_TCB_TIMESTAMP(0x7FFFFULL << 11), 0); commit_wrq_wr(toep->ctrlq, wrh, &cookie); /* Update the software toepcb and tcpcb. */ From nobody Sat May 18 00:05:31 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vh3xl6LKCz5Kd0V; Sat, 18 May 2024 00:05:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vh3xl4qywz4gvG; Sat, 18 May 2024 00:05:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715990731; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RipKbH+YH9ep/vXshw3v/1tr+egNyIEtjHvoCggx0HA=; b=PiOHQTIe3nuYUExPJZI2kYd9c7Y8oGkSb4LePry6fl6vZOgzykj7TtcBPnDwLie40tT/Rc 6kNgm1UOk8HemMV4X63R8MrzHhUrLJ2im71FVMDoiY0Wl9rl5mRk6kLtk3zvfhehUqGHSn hnef70f/q8kzoQXAnEBfd3EaXkVJBIB7EZfKpRmSP3pTGbzbChalr5xLlO3Dmh/hNobplC crerqtSFiUwpb89hd0JfTwJsmqrdXcUqAdI/GBnKYrVLNDzcsQrjLsC0BDcxSJ9n55e0eK jk7L++1U3p307bfaxvZ8X2tBbKmi2heemaLEG625WYXFjuLGgJgsfNaVhBZMZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715990731; a=rsa-sha256; cv=none; b=hJ30nPi26PTmCxRR1QYEBKcKL6RYK+V6HLZd9rvmpHLUOYgzway8egCN8GKWx4tNHgsjv9 pTUw4dsdZiIGLK0mSx5jrJJN/o9qvF8sI5EYIRGLF4z/fgJWrQhuM4S/T5Dskr9klw4LHV UL+GRIBf851KlF1qxB9QnLOf4S+NrcUjNDEoki6YmgYpLKA8BLQp5b6yOZN6GkNxc3HCbm TbemjCUttVCnpdbig7B50Ej/yirbl1ahUzpWNLbj1ekMHbz+pjMJEmzmRT2NxtF6ddhG+u 6pycFEGmfqLvFFWKeDaTgLsgO2LrIxf34TR9JyLRF5JLQSD6L8ewavlRaHePJg== 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=1715990731; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RipKbH+YH9ep/vXshw3v/1tr+egNyIEtjHvoCggx0HA=; b=c/we+NS7AVbiZruPYKcehoyNWkNdHWQ9SXhazwym8rjDGEvIbWt3WPPzPkTuuUwECTewFD BLc5TaJXQHFxMf6bLDNL6QB7K9XmHmwU7gM0TTD1w5/tCd1wWWM/yYBOvQ/cLS5oZ8amEh ObmMkogZqZ8oxJNNUsCzewbysDtBquHM0Tzl0RuLWu+/drG6gOF8/WGp3WX+pZ+VN+Xqwf /tezQ7kl+HBvXKgG5NV9qaD341AYrAymKR9gTpYe4nH5Wck4IDOfn5KkntaOR9Fi+KIP+d pU02Z9+scBN5xhr9H7NvljYY9C1F+jCqaZOhVGCYPwlJaZ3ACdG8EOypFNb5iw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vh3xl4K46z13TL; Sat, 18 May 2024 00:05: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 44I05V6s061668; Sat, 18 May 2024 00:05:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44I05VSN061665; Sat, 18 May 2024 00:05:31 GMT (envelope-from git) Date: Sat, 18 May 2024 00:05:31 GMT Message-Id: <202405180005.44I05VSN061665@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: fb623aab3927 - main - diff: honour -B flag with -q List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fb623aab3927a6825ff7731198ec2e33426f7607 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=fb623aab3927a6825ff7731198ec2e33426f7607 commit fb623aab3927a6825ff7731198ec2e33426f7607 Author: Ed Maste AuthorDate: 2024-05-16 14:53:23 +0000 Commit: Ed Maste CommitDate: 2024-05-18 00:03:56 +0000 diff: honour -B flag with -q PR: 278988 Reviewed by: bapt Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45220 --- usr.bin/diff/diffreg.c | 3 ++- usr.bin/diff/tests/diff_test.sh | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index 06d914215b11..6073feebf5fb 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -408,7 +408,8 @@ diffreg_stone(char *file1, char *file2, int flags, int capsicum) } if (diff_format == D_BRIEF && ignore_pats == NULL && - (flags & (D_FOLDBLANKS|D_IGNOREBLANKS|D_IGNORECASE|D_STRIPCR)) == 0) + (flags & (D_FOLDBLANKS|D_IGNOREBLANKS|D_IGNORECASE| + D_SKIPBLANKLINES|D_STRIPCR)) == 0) { rval = D_DIFFER; status |= 1; diff --git a/usr.bin/diff/tests/diff_test.sh b/usr.bin/diff/tests/diff_test.sh index 146c23fa303d..9a17d180da02 100755 --- a/usr.bin/diff/tests/diff_test.sh +++ b/usr.bin/diff/tests/diff_test.sh @@ -11,6 +11,7 @@ atf_test_case brief_format atf_test_case b230049 atf_test_case stripcr_o atf_test_case b252515 +atf_test_case b278988 atf_test_case Bflag atf_test_case Nflag atf_test_case tabsize @@ -89,6 +90,15 @@ b252515_body() diff -qw b252515_a.in b252515_b.in } +b278988_body() +{ + printf 'a\nb\nn' > b278988.a.in + printf 'a\n\nb\nn' > b278988.b.in + atf_check -o empty -s eq:0 \ + diff -Bw b278988.a.in b278988.b.in + +} + header_body() { export TZ=UTC @@ -369,6 +379,7 @@ atf_init_test_cases() atf_add_test_case b230049 atf_add_test_case stripcr_o atf_add_test_case b252515 + atf_add_test_case b278988 atf_add_test_case Bflag atf_add_test_case Nflag atf_add_test_case tabsize From nobody Sat May 18 00:57:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vh55S3R1dz5Kj4b; Sat, 18 May 2024 00:57:16 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vh55S2thNz4lpr; Sat, 18 May 2024 00:57:16 +0000 (UTC) (envelope-from zlei@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715993836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rAcpMD+llIDTgaBFAY0UWDY39oojLzKk8bYhreUfYSY=; b=C9th32hPa+cTQlrj4PxYr+04ottyMJ2X70vT1yDWE40LIPOBqQYdHH6ciw8YfIyx8ywDF5 x2eIGtGHuLNInC2aPgqyykdbVUPophfAz2q8FQAXNSEDrctDH6cHJQtY0HOzpu2ReJrR2Y 07oe8/VLWeA1wN1nWhPRYaKkLSGr31VHP6+TjfYLe8Zar4BSiUUfINpf6/B/DR7CFQVbPK LI/jXhN9WBPV/US442s+SiFiRqdAQRwtgvrqeZytBrOwc/CDqIeKyYWYq/wz51q8DlUNEu WwdWTIEv/ws58b7+Xo4cxIl6LmfApvvcp4j9l7PbxqeJwSIWDgudvUMdzorWmw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715993836; a=rsa-sha256; cv=none; b=nkrklatMnMkwg4hOCgzUiL8HbsbdaRAIH9Jv7hsbCnYq7XZ8eazDEvo0n4Dx0O20+zt6ba PHlYE3rl0fM7MrQcvELM0c4JJ4XnxJ5NsAYysiQ+a6hLbQtc8zeRYfDL7T6+7gxcA1KBjv N/G4/1w3BWd+WC+fcso/HSIHbx1k57sdDTes0aYOJgLt/1+e1sVbxt8BSLYBYBMEL3s5Pr ssNRnkN4N7jINj488yHV3x+4EU/pvwNksWHzLdiMk/tFGVFYG8zhorrfmfmyUp9rS1FFOu YJHJnz7d6ez+yW7iVRNNMdTuaj5VVmg3t6YwTC2nAl4z5n2db4dpLwzU+/In9Q== 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=1715993836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rAcpMD+llIDTgaBFAY0UWDY39oojLzKk8bYhreUfYSY=; b=wfO0QVokZqq4IZ0ydjDPrSLng5mfbYMlLu/dog+xlwzBUpLBfIYUD7iwyDZtYrEGLb0tZt N4vG6PdfbKxxhf+jLKLjs3IsyyNQL6jqjDV1XP8QIO2Zv9nNiZOsNwo+k9j4dd1UhfkjVR vHANpLK8Kvt8cFuLFxuIfwaABgihNxbWyYsDUXmauE4oNNELdvcgOKVjqfGWBMqaY14jr9 D/WxYo/4RjoZ0ofmoC8JJBMhg1TUc35WMvvvs8sxtdNkaxVp56uQ+fBkW3YZnRiJYpGxQo hA4BDS7WpyCoeeDtz9Rzpnl+zmhEXTXBDOES+dDzfugbo6g6TPjVunssyEQ37g== Received: from smtpclient.apple (unknown [IPv6:2001:19f0:6001:9db:98f0:9fe0:3545:10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: zlei/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Vh55Q6MKZzS6H; Sat, 18 May 2024 00:57:14 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.8\)) Subject: Re: git: f7d45c5443ed - main - bhyve: avoid side effect in assertion From: Zhenlei Huang In-Reply-To: <202405172000.44HK0Xw3049841@gitrepo.freebsd.org> Date: Sat, 18 May 2024 08:57:08 +0800 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202405172000.44HK0Xw3049841@gitrepo.freebsd.org> To: Ed Maste X-Mailer: Apple Mail (2.3696.120.41.1.8) > On May 18, 2024, at 4:00 AM, Ed Maste wrote: >=20 > The branch main has been updated by emaste: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Df7d45c5443edc99857fdda19c68301b5= ec4a8971 >=20 > commit f7d45c5443edc99857fdda19c68301b5ec4a8971 > Author: Pierre Pronchery > AuthorDate: 2024-05-17 07:31:32 +0000 > Commit: Ed Maste > CommitDate: 2024-05-17 19:45:18 +0000 >=20 > bhyve: avoid side effect in assertion >=20 > An assert() was setting the error variable instead of checking it. >=20 > Reported by: Coverity Scan > CID: 1521431 > Reviewed by: jhb > Sponsored by: The FreeBSD Foundation > Pull Request: https://github.com/freebsd/freebsd-src/pull/1244 > --- > usr.sbin/bhyve/tpm_ppi_qemu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/usr.sbin/bhyve/tpm_ppi_qemu.c = b/usr.sbin/bhyve/tpm_ppi_qemu.c > index ad66ecb09683..239d39184589 100644 > --- a/usr.sbin/bhyve/tpm_ppi_qemu.c > +++ b/usr.sbin/bhyve/tpm_ppi_qemu.c > @@ -161,7 +161,7 @@ tpm_ppi_deinit(void *sc) > ppi =3D sc; >=20 > error =3D unregister_mem(&ppi_mmio); > - assert(error =3D 0); > + assert(error =3D=3D 0); Emm, does that not get caught by compilers ? >=20 > free(ppi); > } From nobody Sat May 18 01:24:39 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vh5jC5g0hz5Kl6Q; Sat, 18 May 2024 01:24:47 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vh5jC3H4wz4ptg; Sat, 18 May 2024 01:24:47 +0000 (UTC) (envelope-from zlei@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715995487; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7qls1BulOE7j/5ZZ44tM8ioDm/g4kiV6fhjeO+vCTA8=; b=ai2hUMfBTdsQtDuVykrNT4ewCGGQTD2lrzV/orW02TWWccNaJ1A79avqEjDlBd0DndbFzE mQztF1muWmJPIsAGXslyEKaqZyC8+JBPW2HzaPjJxgCojo3zfagX5rZIoiXUEKE+unlJDq YnIFcEKAEibUHc2uYBwtD853lE/IGP17qYQOwdwlIyVJgI4yQXQo/BeehE4z+yIgsjTuuH mlb1m7ZbHHy2DOM/NkvT9+bMhjW82I5AF5Tmc517xwZ8wgvzhmA9sL/WEkvPQpznD3ik63 DnsgYWovDG4pw7uh4reWMprgdvOCARYVevZOzlyrnlylZ4ypLoQjrNs35ZCcuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715995487; a=rsa-sha256; cv=none; b=vz4dxznDcB360L0i0efvQJuJY/Tmo15eOrnGkRlonFnJoLl4W5ERh28sKexFEd3ZTOpaAq ZNj0KVOHtbbzrgg3yzetR+bGWqdhpsPuac91idtVHN5621Nm4gjnEzoUsUlBWg1l8+inaQ FG97nKgInBeNzpkaxOAtltdMC95s40lua1XItXyT7Gq2FZlbXHLC5F2FCynebK5E72qNES S+D7Gkl//CB1wBVJb2JBWK3UXVina44ZoiUEKIw0UT/JWpf8zUYN1zoXbTUxtASwmlNdI6 qpRHXCz4qVMu8MuWpnlwl6km3MXgmn4nsl8StGTPStg/AHGR3NDBwTgwLK8KYQ== 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=1715995487; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7qls1BulOE7j/5ZZ44tM8ioDm/g4kiV6fhjeO+vCTA8=; b=M39vDvUMg4xnZha/F60y2SoQsUKH0fkjJzwfe9XBp7oGsaBErab9WMdrfRQCHTuObCiipt ej19IFeupOAzIlv5PGlI3Ab1s1SsrT6gFV7jbRFBBfg9ExoUKf3bxPR+hxaYcygJPy2YOA vQjTy+5F8HgmMW9x306EzzaBAewCTYqpzEGc3eO7EURrNnQIEyctjIBR8FAfY9gKPa9pjN 7rC7H3t8fbS0N6MwHwS4d1jJmq/OA9KVSG7QaUOmKuPSXqjEK6peHliQDFPfASLWian1Z3 6mDVg0F8YDemOS8w6CYjazSjAH6JkH3OLQDiKWJDFASyq4e2i47mmn8qWiHdvw== Received: from smtpclient.apple (ns1.oxydns.net [45.32.91.63]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: zlei/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Vh5jB0LkvzTKw; Sat, 18 May 2024 01:24:45 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.8\)) Subject: Re: git: f7d45c5443ed - main - bhyve: avoid side effect in assertion From: Zhenlei Huang In-Reply-To: Date: Sat, 18 May 2024 09:24:39 +0800 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <87605178-E3BF-4B48-B1D9-2D54EE2FADA7@FreeBSD.org> References: <202405172000.44HK0Xw3049841@gitrepo.freebsd.org> To: Ed Maste X-Mailer: Apple Mail (2.3696.120.41.1.8) > On May 18, 2024, at 8:57 AM, Zhenlei Huang wrote: >=20 >=20 >=20 >> On May 18, 2024, at 4:00 AM, Ed Maste wrote: >>=20 >> The branch main has been updated by emaste: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3Df7d45c5443edc99857fdda19c68301b5= ec4a8971 >>=20 >> commit f7d45c5443edc99857fdda19c68301b5ec4a8971 >> Author: Pierre Pronchery >> AuthorDate: 2024-05-17 07:31:32 +0000 >> Commit: Ed Maste >> CommitDate: 2024-05-17 19:45:18 +0000 >>=20 >> bhyve: avoid side effect in assertion >>=20 >> An assert() was setting the error variable instead of checking it. >>=20 >> Reported by: Coverity Scan >> CID: 1521431 >> Reviewed by: jhb >> Sponsored by: The FreeBSD Foundation >> Pull Request: https://github.com/freebsd/freebsd-src/pull/1244 >> --- >> usr.sbin/bhyve/tpm_ppi_qemu.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >>=20 >> diff --git a/usr.sbin/bhyve/tpm_ppi_qemu.c = b/usr.sbin/bhyve/tpm_ppi_qemu.c >> index ad66ecb09683..239d39184589 100644 >> --- a/usr.sbin/bhyve/tpm_ppi_qemu.c >> +++ b/usr.sbin/bhyve/tpm_ppi_qemu.c >> @@ -161,7 +161,7 @@ tpm_ppi_deinit(void *sc) >> ppi =3D sc; >>=20 >> error =3D unregister_mem(&ppi_mmio); >> - assert(error =3D 0); >> + assert(error =3D=3D 0); >=20 > Emm, does that not get caught by compilers ? Unfortunately not. assert is defined as a macro as such ``` #define assert(e) ((e) ? (void)0 : __assert(__func__, __FILE__, \ __LINE__, #e)) ``` So `e` is enclosed with () and compiler can not catch that. >=20 >>=20 >> free(ppi); >> } >=20 >=20 >=20 From nobody Sat May 18 13:10:13 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VhPMB0kpMz5KllQ; Sat, 18 May 2024 13:10:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VhPMB00V4z51Lg; Sat, 18 May 2024 13:10:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716037814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YmnjISzJ7xzrS2xZM8w+HU9S+13IQ1Xj/fhmfCeYlCM=; b=rd+lE4KqB/zRRsynKsFAZ2jAZWOBYdk2kBhdqtphP0pdM/clz/2JZYdwbayLl6qo1OWUOB u3VeWSho31Y3uSILrM/J8PAwv74IsTrPfAxK1VURzwYsb1B1AK8CKLmfpKKlm/i11cvqN+ alM0ygrRe/xCtyUX6w18mPSX9Z4RNQvJbqfHcuGDqTig807AsYx96xIc4ZHv7M7y4tvUwu 0+4dFdbVrxeVftilM5I7OAkPj0CRL6z9krCfAfORji0efQNHBYQEIsPGjOM+BmSkff2z1Y VTUtrctsHdphWS1iphkk06qre94CXIdHx2UqeQCr9mwVBJhz01XAS+2Gr7lr2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716037814; a=rsa-sha256; cv=none; b=o8W1oNm1lyH3PlNeOMlV/ZTewrvcFsYMH/U0JNBmhOaeIyEpPVTfhw4k46BXQEsKJw06gA w0Dnj7FxkYELqixNBVyAV/KhxRk0EcADC/w8aBA3LCAM3RDfuVJrIoENMJ0k8RZhQnx1Ev 9chFaYBhbujFyNUN7WVPFVq1kddWYHL/k2Fsr/oXQWYWQZaWnJkxUSrM5Vr7jSpnBhogn9 NwGmkIn5aqPgO27k9WUaOFx1OnDp7lHxRsL5lHzDrIqdLH1DeUyHcPLdBjpYi070Xon/Rd 0dMbg5NoYoejP9RltKNSN7xSA2jsF8HZfEP1v5LoIml+hlCv45OK45OC7LgtSg== 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=1716037814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YmnjISzJ7xzrS2xZM8w+HU9S+13IQ1Xj/fhmfCeYlCM=; b=LAZXkVSHTky6s99Pz1jJPIzgjLQqKvqtpNdA22RLITd/xnRpHPt2u0SkwTCvnc5+Er9b0W xejszACeVtMRAlZNTHsVacF8//+AM4nFxc2TSok43D8+3gww1iK0QDatSrMm51o1N1J5kV KS7cViZFhjfCjm2fPhrKHWqPbiuGvbkkrAVY/l4DG8yKVXPfDtHQueCST4bK/FTMdLY3XC 8SySrNpOwRfjJ6ZxymOq9KjsffK2J3svdxUYNN5yVtkdsiPKh/7hwOKQ7zTOcPm39muLbs HkaN+mfDYiUG8Y3wJOaTsVTVVlclvVO0lD9IElHoq4ZRKifRAo1sAuAH/mhliw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VhPM96Q3XzQpN; Sat, 18 May 2024 13:10:13 +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 44IDADOp085655; Sat, 18 May 2024 13:10:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44IDADZC085643; Sat, 18 May 2024 13:10:13 GMT (envelope-from git) Date: Sat, 18 May 2024 13:10:13 GMT Message-Id: <202405181310.44IDADZC085643@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 97aedd3395b4 - main - devctl: Disable the boottime optimization of suppressing NOMATCH List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 97aedd3395b4e9b017e29823096771aff0835ff0 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=97aedd3395b4e9b017e29823096771aff0835ff0 commit 97aedd3395b4e9b017e29823096771aff0835ff0 Author: Warner Losh AuthorDate: 2024-05-18 13:07:16 +0000 Commit: Warner Losh CommitDate: 2024-05-18 13:07:16 +0000 devctl: Disable the boottime optimization of suppressing NOMATCH The usb bus code (uhub) doens't present the same information to devctl as it does to the NOMATCH events it generats. As such, devmatch fails to find USB devices on boot when NOMATCH events are optimized out. Since the savings of boot time is relatively trivial for all but the most demanding boot environments, disable it by default until this issue is fixed. Fixes: 6437872c1d66 MFC After: 1 minute Sponsored by: Netflix --- sys/kern/kern_devctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_devctl.c b/sys/kern/kern_devctl.c index 0dd05a49c9ad..602b82105525 100644 --- a/sys/kern/kern_devctl.c +++ b/sys/kern/kern_devctl.c @@ -89,7 +89,7 @@ static int sysctl_devctl_queue(SYSCTL_HANDLER_ARGS); static int devctl_queue_length = DEVCTL_DEFAULT_QUEUE_LEN; SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_queue, CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, NULL, 0, sysctl_devctl_queue, "I", "devctl queue length"); -static bool nomatch_enabled = false; +static bool nomatch_enabled = true; SYSCTL_BOOL(_hw_bus, OID_AUTO, devctl_nomatch_enabled, CTLFLAG_RWTUN, &nomatch_enabled, 0, "enable nomatch events"); From nobody Sat May 18 14:58:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VhRmL4CSsz5KyGg; Sat, 18 May 2024 14:58: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 4VhRmL3X8Vz42H6; Sat, 18 May 2024 14:58:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716044322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uCGluXIGyn+ni/J9sToj0o7gbs+8Ll1nqyEjqS/ils4=; b=Qi28c7/ht+jZxYdUPi3uvQ6kMiI4IihMvFUl211HaCGLesMO2pxEZvf4xRkXKJweiozjdJ g0pL1hlxxN4TayJv4Ny0V6k0kGk3N5LwHW2XHgsS/p7gk2uZkmXuE9aIyDyV4aSyHF5dyw ZZTpdgnc2FSc6jVrPhWnFQe/L4vJbAozpzJOyMCTsF2rA5NTuvHmMXkpbMRj4JlN9bmVOU klyoiGPViTMTvMagl7VPiR8TTCD/d0zL8SZ5sGgTSpbV14VMOxLoh+KCCCVmEy7bDGu4q8 GM61FFDh5I/LAOJEoOCdHjjqstoQbMx3C1LaqhvWdDeY0ev+GuongtMqvk9Wog== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716044322; a=rsa-sha256; cv=none; b=uMtKbv0LPNvYhfEqRPuw/yoNaOub8D/rMgY99mylvc5m3ADPyIjb+jo4Zb1K8TpmDSQknp EXXnCaVeQEngpw4YuV6R9bDNXfqNE2EXbSXUBdSBNgLEhOsJkePpcFNhBzvl+idn0EHkAR hNJD14NrdhgOem3a8yWmVoIh2U+gwKPTCnuoh5e3vON6MDEGzqM00lS+epCFvxaTr5nPHS ZopcQOmUu/EJUWeF/naPDjbwnx52Ig9Bgcmqj1fOBFOs2cJ3MOJWrZJ1ijbmnHnm+iWLWT P52CqBHogBuAJVVTbGeSZXqdhJYOfe+/K0lzDDzc3LLK9N0DfT4tQy+qHqMuMQ== 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=1716044322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uCGluXIGyn+ni/J9sToj0o7gbs+8Ll1nqyEjqS/ils4=; b=hq4/r1mS9dE6qptmusj0u242P80g21ral/OAcnrvMJRkqgBXj0UX5HFCAdhFO28rtRH2T3 Seth/LU0jatvgI5I+K/typf6okEvuyIucIBGjqisTCNXDdayhSO5DSWUsx90rq9h85SEY/ Iv0iDs3IiXiq34QweteczdZuggbSTviiVRe8YHmVC75p87wSuIQCL1xOintyebqILnyhlo NTobNZuvk5z/pg+mKVPsQA4rBg7WzOor6OTo/jRahRpOXqDD/CT5fGFyCGa0muos1rtcl0 FqAhrUdePIMK7nho2y7XNwHdncqTz42ZbpGdvS50xT339MuMeP7TcLQ4T6eBWg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VhRmL37B7zWLm; Sat, 18 May 2024 14:58: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 44IEwghc064448; Sat, 18 May 2024 14:58:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44IEwgdO064445; Sat, 18 May 2024 14:58:42 GMT (envelope-from git) Date: Sat, 18 May 2024 14:58:42 GMT Message-Id: <202405181458.44IEwgdO064445@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Randall Stewart Subject: git: ea916b64125b - main - Remove TCP_SAD optional code now that the sack filter performs this function. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rrs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ea916b64125bf43e918db9079532d39f996953ef Auto-Submitted: auto-generated The branch main has been updated by rrs: URL: https://cgit.FreeBSD.org/src/commit/?id=ea916b64125bf43e918db9079532d39f996953ef commit ea916b64125bf43e918db9079532d39f996953ef Author: Randall Stewart AuthorDate: 2024-05-18 14:57:04 +0000 Commit: Randall Stewart CommitDate: 2024-05-18 14:57:04 +0000 Remove TCP_SAD optional code now that the sack filter performs this function. With the commit of D44903 we no longer need the SAD option. Instead all stacks that use the sack filter inherit its protection against sack-attack. Reviewed by: tuexen@ Differential Revision:https://reviews.freebsd.org/D45216 --- sys/conf/options | 1 - sys/netinet/tcp_stacks/rack.c | 709 +------------------------------------- sys/netinet/tcp_stacks/tcp_rack.h | 9 +- sys/netinet/tcp_subr.c | 52 --- sys/netinet/tcp_var.h | 13 - 5 files changed, 16 insertions(+), 768 deletions(-) diff --git a/sys/conf/options b/sys/conf/options index 40c24799aa0c..d9bc981232c4 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -242,7 +242,6 @@ TCP_RACK opt_inet.h # algorithm that uses "normal" behaviour with SACK's to detect # a possible attack. It is strictly experimental at this point. # -TCP_SAD_DETECTION opt_inet.h TURNSTILE_PROFILING UMTX_PROFILING UMTX_CHAINS opt_global.h diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index b0d0f94b8f0e..551ccc1d337a 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -536,7 +536,7 @@ static int32_t rack_output(struct tcpcb *tp); static uint32_t rack_proc_sack_blk(struct tcpcb *tp, struct tcp_rack *rack, struct sackblk *sack, struct tcpopt *to, struct rack_sendmap **prsm, - uint32_t cts, int *no_extra, int *moved_two, uint32_t segsiz); + uint32_t cts, uint32_t segsiz); static void rack_post_recovery(struct tcpcb *tp, uint32_t th_seq); static void rack_remxt_tmr(struct tcpcb *tp); static int rack_set_sockopt(struct tcpcb *tp, struct sockopt *sopt); @@ -2752,8 +2752,6 @@ rack_log_retran_reason(struct tcp_rack *rack, struct rack_sendmap *rsm, uint32_t union tcp_log_stackspecific log; struct timeval tv; - if (rack->sack_attack_disable > 0) - goto log_anyway; if ((mod != 1) && (rack_verbose_logging == 0)) { /* * We get 3 values currently for mod @@ -2766,7 +2764,6 @@ rack_log_retran_reason(struct tcp_rack *rack, struct rack_sendmap *rsm, uint32_t */ return; } -log_anyway: memset(&log.u_bbr, 0, sizeof(log.u_bbr)); log.u_bbr.flex1 = tsused; log.u_bbr.flex2 = thresh; @@ -3007,13 +3004,8 @@ rack_log_rtt_sample(struct tcp_rack *rack, uint32_t rtt) /* Convert our ms to a microsecond */ memset(&log, 0, sizeof(log)); log.u_bbr.flex1 = rtt; - log.u_bbr.flex2 = rack->r_ctl.ack_count; - log.u_bbr.flex3 = rack->r_ctl.sack_count; - log.u_bbr.flex4 = rack->r_ctl.sack_noextra_move; - log.u_bbr.flex5 = rack->r_ctl.sack_moved_extra; log.u_bbr.flex6 = rack->rc_tp->t_rxtcur; log.u_bbr.flex7 = 1; - log.u_bbr.flex8 = rack->sack_attack_disable; log.u_bbr.timeStamp = tcp_get_usecs(&tv); log.u_bbr.inflight = ctf_flight_size(rack->rc_tp, rack->r_ctl.rc_sacked); log.u_bbr.pkts_out = rack->r_ctl.rc_out_at_rto; @@ -3144,7 +3136,6 @@ rack_log_type_bbrsnd(struct tcp_rack *rack, uint32_t len, uint32_t slot, uint32_ else log.u_bbr.flex2 = rack->r_ctl.rc_prr_sndcnt; log.u_bbr.flex4 = rack->r_ctl.rc_hpts_flags; - log.u_bbr.flex5 = rack->r_ctl.ack_during_sd; log.u_bbr.flex6 = line; log.u_bbr.flex7 = (0x0000ffff & rack->r_ctl.rc_hpts_flags); log.u_bbr.flex8 = rack->rc_in_persist; @@ -3406,40 +3397,6 @@ rack_log_to_prr(struct tcp_rack *rack, int frm, int orig_cwnd, int line) } } -#ifdef TCP_SAD_DETECTION -static void -rack_log_sad(struct tcp_rack *rack, int event) -{ - if (tcp_bblogging_on(rack->rc_tp)) { - union tcp_log_stackspecific log; - struct timeval tv; - - memset(&log.u_bbr, 0, sizeof(log.u_bbr)); - log.u_bbr.flex1 = rack->r_ctl.sack_count; - log.u_bbr.flex2 = rack->r_ctl.ack_count; - log.u_bbr.flex3 = rack->r_ctl.sack_moved_extra; - log.u_bbr.flex4 = rack->r_ctl.sack_noextra_move; - log.u_bbr.flex5 = rack->r_ctl.rc_num_maps_alloced; - log.u_bbr.flex6 = tcp_sack_to_ack_thresh; - log.u_bbr.pkts_out = tcp_sack_to_move_thresh; - log.u_bbr.lt_epoch = (tcp_force_detection << 8); - log.u_bbr.lt_epoch |= rack->do_detection; - log.u_bbr.applimited = tcp_map_minimum; - log.u_bbr.flex7 = rack->sack_attack_disable; - log.u_bbr.flex8 = event; - log.u_bbr.bbr_state = rack->rc_suspicious; - log.u_bbr.timeStamp = tcp_get_usecs(&tv); - log.u_bbr.inflight = ctf_flight_size(rack->rc_tp, rack->r_ctl.rc_sacked); - log.u_bbr.delivered = tcp_sad_decay_val; - TCP_LOG_EVENTP(rack->rc_tp, NULL, - &rack->rc_inp->inp_socket->so_rcv, - &rack->rc_inp->inp_socket->so_snd, - TCP_SAD_DETECT, 0, - 0, &log, false, &tv); - } -} -#endif - static void rack_counter_destroy(void) { @@ -3549,7 +3506,6 @@ static struct rack_sendmap * rack_alloc_full_limit(struct tcp_rack *rack) { if ((V_tcp_map_entries_limit > 0) && - (rack->do_detection == 0) && (rack->r_ctl.rc_num_maps_alloced >= V_tcp_map_entries_limit)) { counter_u64_add(rack_to_alloc_limited, 1); if (!rack->alloc_limit_reported) { @@ -3570,7 +3526,6 @@ rack_alloc_limit(struct tcp_rack *rack, uint8_t limit_type) if (limit_type) { /* currently there is only one limit type */ if (rack->r_ctl.rc_split_limit > 0 && - (rack->do_detection == 0) && rack->r_ctl.rc_num_split_allocs >= rack->r_ctl.rc_split_limit) { counter_u64_add(rack_split_limited, 1); if (!rack->alloc_limit_reported) { @@ -3578,17 +3533,6 @@ rack_alloc_limit(struct tcp_rack *rack, uint8_t limit_type) counter_u64_add(rack_alloc_limited_conns, 1); } return (NULL); -#ifdef TCP_SAD_DETECTION - } else if ((tcp_sad_limit != 0) && - (rack->do_detection == 1) && - (rack->r_ctl.rc_num_split_allocs >= tcp_sad_limit)) { - counter_u64_add(rack_split_limited, 1); - if (!rack->alloc_limit_reported) { - rack->alloc_limit_reported = 1; - counter_u64_add(rack_alloc_limited_conns, 1); - } - return (NULL); -#endif } } @@ -6812,7 +6756,6 @@ rack_timer_start(struct tcpcb *tp, struct tcp_rack *rack, uint32_t cts, int sup_ } rack->rc_on_min_to = 0; if ((tp->t_state < TCPS_ESTABLISHED) || - (rack->sack_attack_disable > 0) || ((tp->t_flags & TF_SACK_PERMIT) == 0)) { goto activate_rxt; } @@ -6884,16 +6827,6 @@ activate_rxt: goto activate_rxt; } } - if (rack->sack_attack_disable) { - /* - * We don't want to do - * any TLP's if you are an attacker. - * Though if you are doing what - * is expected you may still have - * SACK-PASSED marks. - */ - goto activate_rxt; - } /* Convert from ms to usecs */ if ((rsm->r_flags & RACK_SACK_PASSED) || (rsm->r_flags & RACK_RWND_COLLAPSED) || @@ -7304,25 +7237,6 @@ rack_start_hpts_timer (struct tcp_rack *rack, struct tcpcb *tp, uint32_t cts, } } hpts_timeout = rack_timer_start(tp, rack, cts, sup_rack); -#ifdef TCP_SAD_DETECTION - if (rack->sack_attack_disable && - (rack->r_ctl.ack_during_sd > 0) && - (slot < tcp_sad_pacing_interval)) { - /* - * We have a potential attacker on - * the line. We have possibly some - * (or now) pacing time set. We want to - * slow down the processing of sacks by some - * amount (if it is an attacker). Set the default - * slot for attackers in place (unless the original - * interval is longer). Its stored in - * micro-seconds, so lets convert to msecs. - */ - slot = tcp_sad_pacing_interval; - rack_log_type_bbrsnd(rack, tot_len_this_send, slot, us_cts, &tv, __LINE__); - rack->r_ctl.ack_during_sd = 0; - } -#endif if (tp->t_flags & TF_DELACK) { delayed_ack = TICKS_2_USEC(tcp_delacktime); rack->r_ctl.rc_hpts_flags |= PACE_TMR_DELACK; @@ -7472,11 +7386,7 @@ rack_start_hpts_timer (struct tcp_rack *rack, struct tcpcb *tp, uint32_t cts, tp->t_flags2 |= TF2_DONT_SACK_QUEUE; } } - /* For sack attackers we want to ignore sack */ - if (rack->sack_attack_disable == 1) { - tp->t_flags2 |= (TF2_DONT_SACK_QUEUE | - TF2_MBUF_QUEUE_READY); - } else if (rack->rc_ack_can_sendout_data) { + if (rack->rc_ack_can_sendout_data) { /* * Ahh but wait, this is that special case * where the pacing timer can be disturbed @@ -8281,11 +8191,8 @@ rack_remxt_tmr(struct tcpcb *tp) rack->r_ctl.rc_resend = tqhash_min(rack->r_ctl.tqh); if (rack->r_ctl.rc_resend != NULL) rack->r_ctl.rc_resend->r_flags |= RACK_TO_REXT; - if ((((tp->t_flags & TF_SACK_PERMIT) == 0) -#ifdef TCP_SAD_DETECTION - || (rack->sack_attack_disable != 0) -#endif - ) && ((tp->t_flags & TF_SENTFIN) == 0)) { + if (((tp->t_flags & TF_SACK_PERMIT) == 0) && + ((tp->t_flags & TF_SENTFIN) == 0)) { /* * For non-sack customers new data * needs to go out as retransmits until @@ -10102,40 +10009,19 @@ is_rsm_inside_declared_tlp_block(struct tcp_rack *rack, struct rack_sendmap *rsm static uint32_t rack_proc_sack_blk(struct tcpcb *tp, struct tcp_rack *rack, struct sackblk *sack, struct tcpopt *to, struct rack_sendmap **prsm, uint32_t cts, - int *no_extra, - int *moved_two, uint32_t segsiz) + uint32_t segsiz) { uint32_t start, end, changed = 0; struct rack_sendmap stack_map; struct rack_sendmap *rsm, *nrsm, *prev, *next; int insret __diagused; int32_t used_ref = 1; - int moved = 0; -#ifdef TCP_SAD_DETECTION - int allow_segsiz; - int first_time_through = 1; -#endif - int noextra = 0; int can_use_hookery = 0; start = sack->start; end = sack->end; rsm = *prsm; -#ifdef TCP_SAD_DETECTION - /* - * There are a strange number of proxys and meddle boxes in the world - * that seem to cut up segments on different boundaries. This gets us - * smaller sacks that are still ok in terms of it being an attacker. - * We use the base segsiz to calculate an allowable smallness but - * also enforce a min on the segsiz in case it is an attacker playing - * games with MSS. So basically if the sack arrives and it is - * larger than a worse case 960 bytes, we don't classify the guy - * as supicious. - */ - allow_segsiz = max(segsiz, 1200) * sad_seg_size_per; - allow_segsiz /= 1000; -#endif do_rest_ofb: if ((rsm == NULL) || (SEQ_LT(end, rsm->r_start)) || @@ -10147,105 +10033,11 @@ do_rest_ofb: */ used_ref = 0; rsm = tqhash_find(rack->r_ctl.tqh, start); - moved++; } if (rsm == NULL) { /* TSNH */ goto out; } -#ifdef TCP_SAD_DETECTION - /* Now we must check for suspicous activity */ - if ((first_time_through == 1) && - ((end - start) < min((rsm->r_end - rsm->r_start), allow_segsiz)) && - ((rsm->r_flags & RACK_PMTU_CHG) == 0) && - ((rsm->r_flags & RACK_TLP) == 0)) { - /* - * Its less than a full MSS or the segment being acked - * this should only happen if the rsm in question had the - * r_just_ret flag set the end matches the end of - * the rsm block. - * - * Note we do not look at segments that have had TLP's on - * them since we can get un-reported rwnd collapses that - * basically we TLP on and then we get back a sack block - * that goes from the start to only a small way. - * - */ - int loss, ok; - - ok = 0; - if (SEQ_GEQ(end, rsm->r_end)) { - if (rsm->r_just_ret == 1) { - /* This was at the end of a send which is ok */ - ok = 1; - } else { - /* A bit harder was it the end of our segment */ - int segs, len; - - len = (rsm->r_end - rsm->r_start); - segs = len / segsiz; - segs *= segsiz; - if ((segs + (rsm->r_end - start)) == len) { - /* - * So this last bit was the - * end of our send if we cut it - * up into segsiz pieces so its ok. - */ - ok = 1; - } - } - } - if (ok == 0) { - /* - * This guy is doing something suspicious - * lets start detection. - */ - if (rack->rc_suspicious == 0) { - tcp_trace_point(rack->rc_tp, TCP_TP_SAD_SUSPECT); - counter_u64_add(rack_sack_attacks_suspect, 1); - rack->rc_suspicious = 1; - rack_log_sad(rack, 4); - if (tcp_bblogging_on(rack->rc_tp)) { - union tcp_log_stackspecific log; - struct timeval tv; - - memset(&log.u_bbr, 0, sizeof(log.u_bbr)); - log.u_bbr.flex1 = end; - log.u_bbr.flex2 = start; - log.u_bbr.flex3 = rsm->r_end; - log.u_bbr.flex4 = rsm->r_start; - log.u_bbr.flex5 = segsiz; - log.u_bbr.flex6 = rsm->r_fas; - log.u_bbr.flex7 = rsm->r_bas; - log.u_bbr.flex8 = 5; - log.u_bbr.pkts_out = rsm->r_flags; - log.u_bbr.bbr_state = rack->rc_suspicious; - log.u_bbr.bbr_substate = rsm->r_just_ret; - log.u_bbr.timeStamp = tcp_get_usecs(&tv); - log.u_bbr.inflight = ctf_flight_size(rack->rc_tp, rack->r_ctl.rc_sacked); - TCP_LOG_EVENTP(rack->rc_tp, NULL, - &rack->rc_inp->inp_socket->so_rcv, - &rack->rc_inp->inp_socket->so_snd, - TCP_SAD_DETECTION, 0, - 0, &log, false, &tv); - } - } - /* You loose some ack count every time you sack - * a small bit that is not butting to the end of - * what we have sent. This is because we never - * send small bits unless its the end of the sb. - * Anyone sending a sack that is not at the end - * is thus very very suspicious. - */ - loss = (segsiz/2) / (end - start); - if (loss < rack->r_ctl.ack_count) - rack->r_ctl.ack_count -= loss; - else - rack->r_ctl.ack_count = 0; - } - } - first_time_through = 0; -#endif /* Ok we have an ACK for some piece of this rsm */ if (rsm->r_start != start) { if ((rsm->r_flags & RACK_ACKED) == 0) { @@ -10342,7 +10134,6 @@ do_rest_ofb: * use to update all the gizmos. */ /* Copy up our fudge block */ - noextra++; nrsm = &stack_map; memcpy(nrsm, rsm, sizeof(struct rack_sendmap)); /* Now adjust our tree blocks */ @@ -10393,9 +10184,6 @@ do_rest_ofb: if (rack->app_limited_needs_set) rack_need_set_test(tp, rack, nrsm, tp->snd_una, __LINE__, RACK_USE_END); changed += (nrsm->r_end - nrsm->r_start); - /* You get a count for acking a whole segment or more */ - if ((nrsm->r_end - nrsm->r_start) >= segsiz) - rack->r_ctl.ack_count += ((nrsm->r_end - nrsm->r_start) / segsiz); rack->r_ctl.rc_sacked += (nrsm->r_end - nrsm->r_start); if (rsm->r_flags & RACK_WAS_LOST) { int my_chg; @@ -10473,7 +10261,6 @@ do_rest_ofb: } counter_u64_add(rack_sack_splits, 1); rack_clone_rsm(rack, nrsm, rsm, start); - moved++; rsm->r_just_ret = 0; #ifndef INVARIANTS (void)tqhash_insert(rack->r_ctl.tqh, nrsm); @@ -10495,14 +10282,12 @@ do_rest_ofb: } else { /* Already sacked this piece */ counter_u64_add(rack_sack_skipped_acked, 1); - moved++; if (end == rsm->r_end) { /* Done with block */ rsm = tqhash_next(rack->r_ctl.tqh, rsm); goto out; } else if (SEQ_LT(end, rsm->r_end)) { /* A partial sack to a already sacked block */ - moved++; rsm = tqhash_next(rack->r_ctl.tqh, rsm); goto out; } else { @@ -10569,8 +10354,6 @@ do_rest_ofb: rack_update_rtt(tp, rack, rsm, to, cts, SACKED, 0); changed += (rsm->r_end - rsm->r_start); /* You get a count for acking a whole segment or more */ - if ((rsm->r_end - rsm->r_start) >= segsiz) - rack->r_ctl.ack_count += ((rsm->r_end - rsm->r_start) / segsiz); if (rsm->r_flags & RACK_WAS_LOST) { int my_chg; @@ -10605,7 +10388,6 @@ do_rest_ofb: rack_log_map_chg(tp, rack, NULL, rsm, NULL, MAP_SACK_M3, end, __LINE__); } else { counter_u64_add(rack_sack_skipped_acked, 1); - moved++; } if (end == rsm->r_end) { /* This block only - done, setup for next */ @@ -10703,7 +10485,6 @@ do_rest_ofb: * Note if either prev/rsm is a TLP we don't * do this. */ - noextra++; nrsm = &stack_map; memcpy(nrsm, rsm, sizeof(struct rack_sendmap)); tqhash_update_end(rack->r_ctl.tqh, prev, end); @@ -10762,10 +10543,6 @@ do_rest_ofb: if (rack->app_limited_needs_set) rack_need_set_test(tp, rack, nrsm, tp->snd_una, __LINE__, RACK_USE_END); changed += (nrsm->r_end - nrsm->r_start); - /* You get a count for acking a whole segment or more */ - if ((nrsm->r_end - nrsm->r_start) >= segsiz) - rack->r_ctl.ack_count += ((nrsm->r_end - nrsm->r_start) / segsiz); - rack->r_ctl.rc_sacked += (nrsm->r_end - nrsm->r_start); if (rsm->r_flags & RACK_WAS_LOST) { int my_chg; @@ -10852,7 +10629,6 @@ do_rest_ofb: */ counter_u64_add(rack_sack_splits, 1); rack_clone_rsm(rack, nrsm, rsm, end); - moved++; rsm->r_flags &= (~RACK_HAS_FIN); rsm->r_just_ret = 0; #ifndef INVARIANTS @@ -10871,9 +10647,6 @@ do_rest_ofb: rack_log_retran_reason(rack, nrsm, __LINE__, 0, 2); rack_update_rtt(tp, rack, rsm, to, cts, SACKED, 0); changed += (rsm->r_end - rsm->r_start); - /* You get a count for acking a whole segment or more */ - if ((rsm->r_end - rsm->r_start) >= segsiz) - rack->r_ctl.ack_count += ((rsm->r_end - rsm->r_start) / segsiz); if (rsm->r_flags & RACK_WAS_LOST) { int my_chg; @@ -10913,7 +10686,6 @@ do_rest_ofb: * The block was already acked. */ counter_u64_add(rack_sack_skipped_acked, 1); - moved++; } out: if (rsm && @@ -10950,7 +10722,6 @@ out: if (next->r_flags & RACK_ACKED) { /* yep this and next can be merged */ rsm = rack_merge_rsm(rack, rsm, next); - noextra++; next = tqhash_next(rack->r_ctl.tqh, rsm); } else break; @@ -10982,7 +10753,6 @@ out: if (prev->r_flags & RACK_ACKED) { /* yep the previous and this can be merged */ rsm = rack_merge_rsm(rack, prev, rsm); - noextra++; prev = tqhash_prev(rack->r_ctl.tqh, rsm); } else break; @@ -10996,9 +10766,6 @@ out: /* Save off the next one for quick reference. */ nrsm = tqhash_find(rack->r_ctl.tqh, end); *prsm = rack->r_ctl.rc_sacklast = nrsm; - /* Pass back the moved. */ - *moved_two = moved; - *no_extra = noextra; if (IN_RECOVERY(tp->t_flags)) { rack->r_ctl.bytes_acked_in_recovery += changed; } @@ -11040,66 +10807,6 @@ rack_peer_reneges(struct tcp_rack *rack, struct rack_sendmap *rsm, tcp_seq th_ac } -static void -rack_do_decay(struct tcp_rack *rack) -{ - struct timeval res; - -#define timersub(tvp, uvp, vvp) \ - do { \ - (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \ - (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \ - if ((vvp)->tv_usec < 0) { \ - (vvp)->tv_sec--; \ - (vvp)->tv_usec += 1000000; \ - } \ - } while (0) - - timersub(&rack->r_ctl.act_rcv_time, &rack->r_ctl.rc_last_time_decay, &res); -#undef timersub - - rack->r_ctl.input_pkt++; - if ((rack->rc_in_persist) || - (res.tv_sec >= 1) || - (rack->rc_tp->snd_max == rack->rc_tp->snd_una)) { - /* - * Check for decay of non-SAD, - * we want all SAD detection metrics to - * decay 1/4 per second (or more) passed. - * Current default is 800 so it decays - * 80% every second. - */ -#ifdef TCP_SAD_DETECTION - uint32_t pkt_delta; - - pkt_delta = rack->r_ctl.input_pkt - rack->r_ctl.saved_input_pkt; -#endif - /* Update our saved tracking values */ - rack->r_ctl.saved_input_pkt = rack->r_ctl.input_pkt; - rack->r_ctl.rc_last_time_decay = rack->r_ctl.act_rcv_time; - /* Now do we escape without decay? */ -#ifdef TCP_SAD_DETECTION - if (rack->rc_in_persist || - (rack->rc_tp->snd_max == rack->rc_tp->snd_una) || - (pkt_delta < tcp_sad_low_pps)){ - /* - * We don't decay idle connections - * or ones that have a low input pps. - */ - return; - } - /* Decay the counters */ - rack->r_ctl.ack_count = ctf_decay_count(rack->r_ctl.ack_count, - tcp_sad_decay_val); - rack->r_ctl.sack_count = ctf_decay_count(rack->r_ctl.sack_count, - tcp_sad_decay_val); - rack->r_ctl.sack_moved_extra = ctf_decay_count(rack->r_ctl.sack_moved_extra, - tcp_sad_decay_val); - rack->r_ctl.sack_noextra_move = ctf_decay_count(rack->r_ctl.sack_noextra_move, - tcp_sad_decay_val); -#endif - } -} static void inline rack_rsm_sender_update(struct tcp_rack *rack, struct tcpcb *tp, struct rack_sendmap *rsm, uint8_t from) @@ -11623,185 +11330,6 @@ rack_handle_might_revert(struct tcpcb *tp, struct tcp_rack *rack) } } -#ifdef TCP_SAD_DETECTION - -static void -rack_merge_out_sacks(struct tcp_rack *rack) -{ - struct rack_sendmap *cur, *next, *rsm, *trsm = NULL; - - cur = tqhash_min(rack->r_ctl.tqh); - while(cur) { - next = tqhash_next(rack->r_ctl.tqh, cur); - /* - * The idea is to go through all and merge back - * together the pieces sent together, - */ - if ((next != NULL) && - (cur->r_tim_lastsent[0] == next->r_tim_lastsent[0])) { - rack_merge_rsm(rack, cur, next); - } else { - cur = next; - } - } - /* - * now treat it like a rxt event, everything is outstanding - * and sent nothing acvked and dupacks are all zero. If this - * is not an attacker it will have to dupack its way through - * it all. - */ - TAILQ_INIT(&rack->r_ctl.rc_tmap); - TQHASH_FOREACH(rsm, rack->r_ctl.tqh) { - rsm->r_dupack = 0; - /* We must re-add it back to the tlist */ - if (trsm == NULL) { - TAILQ_INSERT_HEAD(&rack->r_ctl.rc_tmap, rsm, r_tnext); - } else { - TAILQ_INSERT_AFTER(&rack->r_ctl.rc_tmap, trsm, rsm, r_tnext); - } - rsm->r_in_tmap = 1; - trsm = rsm; - rsm->r_flags &= ~(RACK_ACKED | RACK_SACK_PASSED | RACK_WAS_SACKPASS | RACK_RWND_COLLAPSED); - } - sack_filter_clear(&rack->r_ctl.rack_sf, rack->rc_tp->snd_una); -} - -static void -rack_do_detection(struct tcpcb *tp, struct tcp_rack *rack, uint32_t bytes_this_ack, uint32_t segsiz) -{ - int do_detection = 0; - - if (rack->sack_attack_disable || rack->rc_suspicious) { - /* - * If we have been disabled we must detect - * to possibly reverse it. Or if the guy has - * sent in suspicious sacks we want to do detection too. - */ - do_detection = 1; - - } else if ((rack->do_detection || tcp_force_detection) && - (tcp_sack_to_ack_thresh > 0) && - (tcp_sack_to_move_thresh > 0) && - (rack->r_ctl.rc_num_maps_alloced > tcp_map_minimum)) { - /* - * We only detect here if: - * 1) System wide forcing is on do_detection is on - * - * 2) We have thresholds for move and ack (set one to 0 and we are off) - * - * 3) We have maps allocated larger than our min (500). - */ - do_detection = 1; - } - if (do_detection > 0) { - /* - * We have thresholds set to find - * possible attackers and disable sack. - * Check them. - */ - uint64_t ackratio, moveratio, movetotal; - - /* Log detecting */ - rack_log_sad(rack, 1); - /* Do we establish a ack ratio */ - if ((rack->r_ctl.sack_count > tcp_map_minimum) || - (rack->rc_suspicious == 1) || - (rack->sack_attack_disable > 0)) { - ackratio = (uint64_t)(rack->r_ctl.sack_count); - ackratio *= (uint64_t)(1000); - if (rack->r_ctl.ack_count) - ackratio /= (uint64_t)(rack->r_ctl.ack_count); - else { - /* We can hit this due to ack totals degregation (via small sacks) */ - ackratio = 1000; - } - } else { - /* - * No ack ratio needed if we have not - * seen more sacks then the number of map entries. - * The exception to that is if we have disabled sack then - * we need to find a ratio. - */ - ackratio = 0; - } - - if ((rack->sack_attack_disable == 0) && - (ackratio > rack_highest_sack_thresh_seen)) - rack_highest_sack_thresh_seen = (uint32_t)ackratio; - /* Do we establish a move ratio? */ - if ((rack->r_ctl.sack_moved_extra > tcp_map_minimum) || - (rack->rc_suspicious == 1) || - (rack->sack_attack_disable > 0)) { - /* - * We need to have more sack moves than maps - * allocated to have a move ratio considered. - */ - movetotal = rack->r_ctl.sack_moved_extra; - movetotal += rack->r_ctl.sack_noextra_move; - moveratio = rack->r_ctl.sack_moved_extra; - moveratio *= (uint64_t)1000; - if (movetotal) - moveratio /= movetotal; - else { - /* No moves, thats pretty good */ - moveratio = 0; - } - } else { - /* - * Not enough moves have occured to consider - * if we are out of whack in that ratio. - * The exception to that is if we have disabled sack then - * we need to find a ratio. - */ - moveratio = 0; - } - if ((rack->sack_attack_disable == 0) && - (moveratio > rack_highest_move_thresh_seen)) - rack_highest_move_thresh_seen = (uint32_t)moveratio; - /* Now the tests */ - if (rack->sack_attack_disable == 0) { - /* Not disabled, do we need to disable? */ - if ((ackratio > tcp_sack_to_ack_thresh) && - (moveratio > tcp_sack_to_move_thresh)) { - /* Disable sack processing */ - tcp_trace_point(rack->rc_tp, TCP_TP_SAD_TRIGGERED); - rack->sack_attack_disable = 1; - /* set it so we have the built in delay */ - rack->r_ctl.ack_during_sd = 1; - if (rack_merge_out_sacks_on_attack) - rack_merge_out_sacks(rack); - counter_u64_add(rack_sack_attacks_detected, 1); - tcp_trace_point(rack->rc_tp, TCP_TP_SAD_TRIGGERED); - /* Clamp the cwnd at flight size */ - rack->r_ctl.rc_saved_cwnd = rack->rc_tp->snd_cwnd; - rack->rc_tp->snd_cwnd = ctf_flight_size(rack->rc_tp, rack->r_ctl.rc_sacked); - rack_log_sad(rack, 2); - } - } else { - /* We are sack-disabled check for false positives */ - if ((ackratio <= tcp_restoral_thresh) || - ((rack_merge_out_sacks_on_attack == 0) && - (rack->rc_suspicious == 0) && - (rack->r_ctl.rc_num_maps_alloced <= (tcp_map_minimum/2)))) { - rack->sack_attack_disable = 0; - rack_log_sad(rack, 3); - /* Restart counting */ - rack->r_ctl.sack_count = 0; - rack->r_ctl.sack_moved_extra = 0; - rack->r_ctl.sack_noextra_move = 1; - rack->rc_suspicious = 0; - rack->r_ctl.ack_count = max(1, - (bytes_this_ack / segsiz)); - - counter_u64_add(rack_sack_attacks_reversed, 1); - /* Restore the cwnd */ - if (rack->r_ctl.rc_saved_cwnd > rack->rc_tp->snd_cwnd) - rack->rc_tp->snd_cwnd = rack->r_ctl.rc_saved_cwnd; - } - } - } -} -#endif static int rack_note_dsack(struct tcp_rack *rack, tcp_seq start, tcp_seq end) @@ -11958,9 +11486,9 @@ rack_log_ack(struct tcpcb *tp, struct tcpopt *to, struct tcphdr *th, int entered register uint32_t th_ack; int32_t i, j, k, num_sack_blks = 0; uint32_t cts, acked, ack_point; - int loop_start = 0, moved_two = 0, no_extra = 0; + int loop_start = 0; uint32_t tsused; - uint32_t segsiz, o_cnt; + uint32_t segsiz; INP_WLOCK_ASSERT(tptoinpcb(tp)); @@ -11973,8 +11501,6 @@ rack_log_ack(struct tcpcb *tp, struct tcpopt *to, struct tcphdr *th, int entered rsm = tqhash_min(rack->r_ctl.tqh); changed = 0; th_ack = th->th_ack; - if (rack->sack_attack_disable == 0) - rack_do_decay(rack); segsiz = ctf_fixed_maxseg(rack->rc_tp); if (BYTES_THIS_ACK(tp, th) >= segsiz) { /* @@ -11985,17 +11511,8 @@ rack_log_ack(struct tcpcb *tp, struct tcpopt *to, struct tcphdr *th, int entered int ac; ac = BYTES_THIS_ACK(tp, th) / ctf_fixed_maxseg(rack->rc_tp); - rack->r_ctl.ack_count += ac; counter_u64_add(rack_ack_total, ac); } - if (rack->r_ctl.ack_count > 0xfff00000) { - /* - * reduce the number to keep us under - * a uint32_t. - */ - rack->r_ctl.ack_count /= 2; - rack->r_ctl.sack_count /= 2; - } if (SEQ_GT(th_ack, tp->snd_una)) { rack_log_progress_event(rack, tp, ticks, PROGRESS_UPDATE, __LINE__); tp->t_acktime = ticks; @@ -12061,7 +11578,6 @@ rack_log_ack(struct tcpcb *tp, struct tcpopt *to, struct tcphdr *th, int entered * Sort the SACK blocks so we can update the rack scoreboard with * just one pass. */ - o_cnt = num_sack_blks; num_sack_blks = sack_filter_blks(tp, &rack->r_ctl.rack_sf, sack_blocks, num_sack_blks, th->th_ack); ctf_log_sack_filter(rack->rc_tp, num_sack_blks, sack_blocks); @@ -12069,44 +11585,9 @@ rack_log_ack(struct tcpcb *tp, struct tcpopt *to, struct tcphdr *th, int entered *sacks_seen = num_sack_blks; if (num_sack_blks == 0) { /* Nothing to sack, but we need to update counts */ - if ((o_cnt == 1) && - (*dsack_seen != 1)) - rack->r_ctl.sack_count++; - else if (o_cnt > 1) - rack->r_ctl.sack_count++; goto out_with_totals; } - if (rack->sack_attack_disable) { - /* - * An attacker disablement is in place, for - * every sack block that is not at least a full MSS - * count up sack_count. - */ - for (i = 0; i < num_sack_blks; i++) { - if ((sack_blocks[i].end - sack_blocks[i].start) < segsiz) { - rack->r_ctl.sack_count++; - } - if (rack->r_ctl.sack_count > 0xfff00000) { - /* - * reduce the number to keep us under - * a uint32_t. - */ - rack->r_ctl.ack_count /= 2; - rack->r_ctl.sack_count /= 2; - } - } - goto out; - } /* Its a sack of some sort */ - rack->r_ctl.sack_count += num_sack_blks; - if (rack->r_ctl.sack_count > 0xfff00000) { - /* - * reduce the number to keep us under - * a uint32_t. - */ - rack->r_ctl.ack_count /= 2; - rack->r_ctl.sack_count /= 2; - } if (num_sack_blks < 2) { /* Only one, we don't need to sort */ goto do_sack_work; @@ -12174,7 +11655,7 @@ do_sack_work: * We probably did the FR and the next * SACK in continues as we would expect. */ - acked = rack_proc_sack_blk(tp, rack, &sack_blocks[0], to, &rsm, cts, &no_extra, &moved_two, segsiz); + acked = rack_proc_sack_blk(tp, rack, &sack_blocks[0], to, &rsm, cts, segsiz); if (acked) { rack->r_wanted_output = 1; changed += acked; @@ -12190,40 +11671,8 @@ do_sack_work: * are acked). Count this as ACK'd data to boost * up the chances of recovering any false positives. */ - rack->r_ctl.ack_count += (acked / ctf_fixed_maxseg(rack->rc_tp)); counter_u64_add(rack_ack_total, (acked / ctf_fixed_maxseg(rack->rc_tp))); counter_u64_add(rack_express_sack, 1); - if (rack->r_ctl.ack_count > 0xfff00000) { - /* - * reduce the number to keep us under - * a uint32_t. - */ - rack->r_ctl.ack_count /= 2; - rack->r_ctl.sack_count /= 2; - } - if (moved_two) { - /* - * If we did not get a SACK for at least a MSS and - * had to move at all, or if we moved more than our - * threshold, it counts against the "extra" move. - */ - rack->r_ctl.sack_moved_extra += moved_two; - rack->r_ctl.sack_noextra_move += no_extra; - counter_u64_add(rack_move_some, 1); - } else { - /* - * else we did not have to move - * any more than we would expect. - */ - rack->r_ctl.sack_noextra_move += no_extra; - rack->r_ctl.sack_noextra_move++; - counter_u64_add(rack_move_none, 1); - } - if ((rack->r_ctl.sack_moved_extra > 0xfff00000) || - (rack->r_ctl.sack_noextra_move > 0xfff00000)) { - rack->r_ctl.sack_moved_extra /= 2; - rack->r_ctl.sack_noextra_move /= 2; - } goto out_with_totals; } else { /* @@ -12236,57 +11685,11 @@ do_sack_work: counter_u64_add(rack_sack_total, 1); rsm = rack->r_ctl.rc_sacklast; for (i = loop_start; i < num_sack_blks; i++) { - acked = rack_proc_sack_blk(tp, rack, &sack_blocks[i], to, &rsm, cts, &no_extra, &moved_two, segsiz); + acked = rack_proc_sack_blk(tp, rack, &sack_blocks[i], to, &rsm, cts, segsiz); if (acked) { rack->r_wanted_output = 1; changed += acked; } - if (moved_two) { - /* - * If we did not get a SACK for at least a MSS and - * had to move at all, or if we moved more than our - * threshold, it counts against the "extra" move. - */ - rack->r_ctl.sack_moved_extra += moved_two; - rack->r_ctl.sack_noextra_move += no_extra; - counter_u64_add(rack_move_some, 1); - } else { - /* - * else we did not have to move - * any more than we would expect. - */ - rack->r_ctl.sack_noextra_move += no_extra; - rack->r_ctl.sack_noextra_move++; - counter_u64_add(rack_move_none, 1); - } - if ((rack->r_ctl.sack_moved_extra > 0xfff00000) || - (rack->r_ctl.sack_noextra_move > 0xfff00000)) { - rack->r_ctl.sack_moved_extra /= 2; - rack->r_ctl.sack_noextra_move /= 2; - } - if (moved_two && (acked < ctf_fixed_maxseg(rack->rc_tp))) { - /* - * If the SACK was not a full MSS then - * we add to sack_count the number of - * MSS's (or possibly more than - * a MSS if its a TSO send) we had to skip by. - */ - rack->r_ctl.sack_count += moved_two; - if (rack->r_ctl.sack_count > 0xfff00000) { - rack->r_ctl.ack_count /= 2; - rack->r_ctl.sack_count /= 2; - } - counter_u64_add(rack_sack_total, moved_two); - } - /* - * Now we need to setup for the next - * round. First we make sure we won't - * exceed the size of our uint32_t on - * the various counts, and then clear out - * moved_two. - */ - moved_two = 0; - no_extra = 0; } out_with_totals: if (num_sack_blks > 1) { @@ -12298,13 +11701,9 @@ out_with_totals: * it could be an attacker constantly * moving us. */ - rack->r_ctl.sack_moved_extra++; counter_u64_add(rack_move_some, 1); } out: -#ifdef TCP_SAD_DETECTION - rack_do_detection(tp, rack, BYTES_THIS_ACK(tp, th), ctf_fixed_maxseg(rack->rc_tp)); -#endif if (changed) { /* Something changed cancel the rack timer */ *** 317 LINES SKIPPED *** From nobody Sat May 18 15:51:40 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VhSxT4SQwz5L308; Sat, 18 May 2024 15:51: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 4VhSxT0vdFz48jK; Sat, 18 May 2024 15:51:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716047501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J6yZMNs74LRjlzZIg+2rxpK7hHfSoCaSs3FlondzK8w=; b=vvLDSElLY6d57lqnuUq8BRBF957aNDCl3ao7n9XrJVxxB+1Y8Lh854H1ia0s90fLJIOF+B j1z6FmGLDI6QMlzDRXDvpx8YmCYv5zAmByF8wme9n+qXYygC1P7IbAbly+gIWNuXjHr+qw 4VwatZMej7tQW0JJoq/CjOYQKbpjIbkO0MC3E1p5f/fJbObrVqWEj3E+Ou6MyIsU3mDG54 D/96k/LYyes66491Emc3En4cMaJaHEcVEeYrbujd+1yrqOrH6DFYDMCwubj3UNJJKqlQRr Q5wnyvxY0aBPtwZqTX51J4C2Ng7WTujihW0+/XsLb3JSibnnx2U2sjEcu/wB3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716047501; a=rsa-sha256; cv=none; b=KLkoz0NAFUKTlleR0wQnFoWK/LK/KpF/+JeyaZaBQqkHUawlhoFcMnep+Px4yWipZjn9R2 dSMUE6yZuGiFVGNVaNRqNt6U2ES5IiorP/dJw6xc/HDXAj0Ft4HEx1AmcT7urJvIBuJivJ NZrSBCEk0VpnQSvYV0V3G9ftcLjmuOyNyqXypTf0CFu5HhoYCmKC+hTo+eIyRe844c1X5s 1/MsOV5ibHJaJuJLDZYjtbr3Rhwh940Bmy3EZeiCsjccYA2MzgxmeGtMrujAbBWdO/HTAx j84IC6VIdXERno2yRHkMux4FA+tiVPV1i6G//+C2B9LknKxj9wxkbeGgKD39hA== 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=1716047501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J6yZMNs74LRjlzZIg+2rxpK7hHfSoCaSs3FlondzK8w=; b=ZSAchULobLv+XI3/Dv2IgdXzTT4bhF2B7clayCeucNnETOI0Z96I/yhwIRWVtwuQjOYCkn evw+fHCluWktejW5jC852191MFh7JZa21UBa9U8AEqQsepWEpFElOYT24qKWqynj2PX2+p NMXI04HRxC2+larNe6n+3jO5TSin8YhZ8qTRYj93BlKjYz7++7OVGvwpRKwhFcRhpC64Sl NTuSMtiyKVvGANx4C75sCWlpEuXb4/WhjFnJZQPjAa8kde9tCKmnuhiA5ySaHwgWXgRt7b yUd4PQokNfW/Ty33aPoQ4yxWKYVzMbKmYQKHJQBHo6Tn+yHrGgU9l0cYkW4c/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 4VhSxT0WFlzXCk; Sat, 18 May 2024 15:51: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 44IFpeOb061026; Sat, 18 May 2024 15:51:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44IFpenT061023; Sat, 18 May 2024 15:51:40 GMT (envelope-from git) Date: Sat, 18 May 2024 15:51:40 GMT Message-Id: <202405181551.44IFpenT061023@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 3bb5428ad643 - main - rc.conf.5: remove obsolete advice about kld_list List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3bb5428ad643e38dd755c8d66c8ac2ae8f7575b5 Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=3bb5428ad643e38dd755c8d66c8ac2ae8f7575b5 commit 3bb5428ad643e38dd755c8d66c8ac2ae8f7575b5 Author: Alan Somers AuthorDate: 2024-05-18 14:25:10 +0000 Commit: Alan Somers CommitDate: 2024-05-18 15:51:15 +0000 rc.conf.5: remove obsolete advice about kld_list Loading modules via kld_list is no longer substantially faster than via loader.conf. [skip ci] MFC after: 2 weeks Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D45242 --- share/man/man5/rc.conf.5 | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index 68d8dade2c6d..51a48341be60 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 4, 2024 +.Dd May 18, 2024 .Dt RC.CONF 5 .Os .Sh NAME @@ -334,10 +334,6 @@ A whitespace-separated list of kernel modules to load right after the local disks are mounted, without any .Pa .ko extension or path. -Loading modules at this point in the boot process is -much faster than doing it via -.Pa /boot/loader.conf -for those modules not necessary for mounting local disks. .It Va kldxref_enable .Pq Vt bool Set to From nobody Sat May 18 16:03:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VhTC10y6jz5L3jr for ; Sat, 18 May 2024 16:03:25 +0000 (UTC) (envelope-from 0100018f8c718fa2-97f5fd82-ec7e-4e28-8cee-7c6da90cecbd-000000@amazonses.com) Received: from a8-13.smtp-out.amazonses.com (a8-13.smtp-out.amazonses.com [54.240.8.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4VhTC06H7Gz4Brl for ; Sat, 18 May 2024 16:03:24 +0000 (UTC) (envelope-from 0100018f8c718fa2-97f5fd82-ec7e-4e28-8cee-7c6da90cecbd-000000@amazonses.com) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=dqtolf56kk3wpt62c3jnwboqvr7iedax; d=tarsnap.com; t=1716048203; h=Message-ID:Date:MIME-Version:Subject:To:References:From:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=E2msjR+qPTouXoN07PxqHtLevL9Wk8t/wYAFL1qS49c=; b=Z9O4DxMfgze0Etf7To2uZpaqpq3LbXT4+XhELIjFPzM18CFSMf9PSE6MbWvIN9Rx +NdR4BNpQ9rME1CjDiidYL4g9VOaUFh2uEs/HhvK/VpD7T7chpyH6IFPvK2jBYx4oyW JxdE6he/DCDbG2wNRf3tMZXW8oEsKghPy3X1pyaQ= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1716048203; h=Message-ID:Date:MIME-Version:Subject:To:References:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=E2msjR+qPTouXoN07PxqHtLevL9Wk8t/wYAFL1qS49c=; b=c2BHXDR0W+5freoHxA5/C6LtdlAfVp/kQMBn5CtS45ZY2tgwN0t+vBPQp2Ezn492 j0FKQgv9XaiodygCrtj0ElAq8hDuWbIEBSYPs6EcuCMKLFy2JxcdCwKBCqMQwNLNE0H AE5/9W4FMSdjFVDWuWybKDO6lZKsjBS/LcmWKBgc= Message-ID: <0100018f8c718fa2-97f5fd82-ec7e-4e28-8cee-7c6da90cecbd-000000@email.amazonses.com> Date: Sat, 18 May 2024 16:03:23 +0000 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 3bb5428ad643 - main - rc.conf.5: remove obsolete advice about kld_list To: Alan Somers , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202405181551.44IFpenT061023@gitrepo.freebsd.org> Content-Language: en-US From: Colin Percival Autocrypt: addr=cperciva@tarsnap.com; keydata= xsFNBGWMSrYBEACdWRqDn3B3SKO7IG0/fGHYtfs26f3Q5QeAcasy1fQLniwGQWn5rlILhbCD K/jdNoDm5Zxq20eqyffoDNObCjnHgg4tGANdi+RmDy+7CDpE789H8dss9y7Pt5DlGGAXQQnt hxush3EYS/Ctprd9UUL/lzOOLOU1aNtzB84tNrJBtcJmL7OYHfyTSNFxvedqJrrasejIQOLI t/DQ89BPzz+vsKHz7FJPXh3fsVkzLA00DJYcfkgxyABfJNA7U6yMwd4DVSdx/SsvfIDMVXnu UXCXswo106WPZbYGlZPpq0wW6iibtTerJix+8AeuwXvl9O1p8yESK4ErkIxCnmghTSz+pdzj z/6xBRkdDM9VdZ0r+CzsaNXMpDOzFuKyjaiYBdgCLljbDnXIHFcqXenrZ7Xwkm09g/M4uVSh pIUG2RYa6tsHSQoGCp3f2RZv1znfViKQFbbL83QjtPA20AhseZSYbHp1FPhXyy9J0wkGL16L e99g6gdGeIRE82BZjBjKGDkoyDPq+oDRSFl8NtzmIKy+cfz00nViqcTF4bREXEawFGhlpO0X O9q8mijI9iFB6zaPBiSdJGBL5ML5qLTNCl8Zlf4m1TBvmRTqF/lzMHVXHidDoUhpSh/y3AFZ 1KrYc27ztJQywDJPJPWPbtY8YhFLFs377gfP8WldsZjzp8nvoQARAQABzSVDb2xpbiBQZXJj aXZhbCA8Y3BlcmNpdmFAdGFyc25hcC5jb20+wsGRBBMBCAA7FiEEglY7hNBiDtwN+4ZBOJfy 4i5lrT8FAmWMSyYCGwMICwkNCAwHCwMFFQoJCAsFFgMCAQACHgUCF4AACgkQOJfy4i5lrT+i Yg/+PYyJNoFuygtV5t/skcjYmvEC93mnazEvh+x99vGYZnGKeJ8NDOF4QCUzeHquOWxDi8Zl reXyswKcrIquPxxX6+YyGe97VbvLnez3ksfzOYRj1F4qV0Rq8ZNK51+bvIrbcS3SfDaRioAk D7WWwFor8y/hSwxYkfsKbtP5PRcem20JUxuC085zqWLaKv5t5n2CBzAGMjwJaQ3tM3AXVwWJ uJaHA6ot/6fntJlmkfcyCYyyr0D6b0guRj3STbZ2hNn5o2AI+f6LJJ31s2sPFjl6rs7fORf3 hFSNOHDd2HxfVBXFdQy24ROkC4orBBz2xh9GScjxxT/hbXkfufkubFubw7n0HkvHzA3UF+Qq A8JiI3n+d7ocsP0/5BQ2sZdeqPGJgHx6RkAMuW1tJ29wSvCN1qMgFwhYkpQdfvHlociQrimU fvlRfSrBEe8o7tvIuEdpvwvCZSTJqQbVoMw8UHFE7nzyCXUSab5h6PbjakCqim13ekVO2KFF TTPcz5o5jEeUY75tzbIwcDfFbT5KqNjWy06TVdM9VEJDHSfOfxHR3kSEwZ+tT2aTvL3grsUn gFwSNcj4Cl4CRFfUw8zVZY+7O7RiMlhBqykikvUurrdGKc1Scwa0yuppdA6eVvylyTWSQGrQ +uLWtV1LUKN7ZqKJWBkLPt9nS4XZWGyBvxOHYqjOwU0EZYxKtgEQANYfgbtUMVnhjxDHhWLp g5kLHK3YW0TfJKzpXqDB7NiqxHofn4OcbZnVC3MKggcbs9o1/UtsjnlsG8550PfiYkDXvPiO RJwgbGs6MGIDK797C6cnBLQ8xwBa9SL4cl5iQFnhWmt6vwnJ+an/cm5JpYves3wL7jV09qU9 57hkHXEUcl38r4FssZzVcLKPUVTa3Un+QGRTGDGe/f4ctjMaqv0ZCM+l2ixPhf/vqESrfSLv V/+T3dmtUfXjazO3SABvsHwxgGuTTYOlKoPCaebr+BRdqm0xeIShoIlhvTI8y4clchqx/Uxg UG5X2kvU13k3DS3Q8uLE4Et9x1CcZT6WGgBZSR6R0WfD0SDnzufNnRWJ0dEPA2MtJHE7+85R Vi9j/IgZV+y5Ur+bnPkjDG1s2SVciX5v9HQ0oilcBhvx0j5lGE9hhurD9F+fCvkr4KdbCknE 6Y8ce8pCNBUoB/DqibJivOzTk9K9MGB5x0De5TerIrFiaw3/mQC9nGeO9dtE7wvDJetWeoTq 4BEaCzpufNqbkpOaTQILr4V6Gp7M6v97g83TVAwZntz/q8ptwuKQPZ2JaSFLZn7oWUpYXA5s +SIODFHLn6iMoYpBQskHQjnj4lEPJadl4qj+ZKA89iDAKsniyoFXsbJe2CPbMS1yzBxKZq6K D/jpt7BOnuHr/JrXABEBAAHCwXYEGAEIACAWIQSCVjuE0GIO3A37hkE4l/LiLmWtPwUCZYxK tgIbDAAKCRA4l/LiLmWtP3jmEACQrh9gWe8F1Tkw3m6VoHKwLc5he4tX3WpQa//soPO6iGG3 S3WPruQ46NrAaAojoOcKI9UONDO5rxG0ZTX53S+lu2EO47jbcLwOCjaEpjKpDRt9ZXBQE8Xl mtBE9Bp3W9gpjB1nE3KNM1mJYgsK0QdRpwwfh4pVgGpOj8j23I6MCK+v99zEBnpgCn2GX8W/ kctRXHqWwndHysOJtRP/zrl7dDaABF1f9efUl0LL3TD3GJ9VDz+DNOin/uK2a1hiJo8QzTRk PpfUQ2ebzDsrd1i/pOWkMSkdH+rEu4AGrXWtaBwrMyrGkL6Icb6yO+P9/z0W2wlgBf3P1YRt JPgQt/Dj3yvA/UnaV/QmuVQPjl13o24UnJGsZM8XGnNdfWBKkC1Q6VXC4QT+dyBHYH9MuE9d 6oGl8pFM1+cTfEfbM62/rRoPkF1yHMsI/903VxEvuUIKfhEZAVLFyHldooNxuchntHQP9y8J 8Ou9bWYQP7MnEn+kwSwrZkjurfPkan+xQvp6dDYnj3V0GwA5pprBMaB928VIDVOv+1PNQI3t Cvk5VPv/skq+TJRMHW7bFSt8PRa91cUf1FOLIz9APDiJOzXkwxUEHGV3zPSaUhs1JYjyBeGT wDAvtLUdjOnRhEUOwlnIrztmvyciutjJoVzKEEjj5WXnHk9L9kQ1bpAjkjTONw== In-Reply-To: <202405181551.44IFpenT061023@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-SES-Outgoing: 2024.05.18-54.240.8.13 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:14618, ipnet:54.240.8.0/21, country:US] X-Rspamd-Queue-Id: 4VhTC06H7Gz4Brl On 5/18/24 08:51, Alan Somers wrote: > commit 3bb5428ad643e38dd755c8d66c8ac2ae8f7575b5 > > rc.conf.5: remove obsolete advice about kld_list > > Loading modules via kld_list is no longer substantially faster than via > loader.conf. Where did you benchmark this? I can believe that performance is similar using UEFI, but on systems booting with BIOS doing I/O from the loader is very slow because the 20-bit address space forces us to use small I/Os. -- Colin Percival FreeBSD Release Engineering Lead & EC2 platform maintainer Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From nobody Sat May 18 16:37:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VhTyW1qtWz5L67C for ; Sat, 18 May 2024 16:37:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VhTyV6g5yz4GZy for ; Sat, 18 May 2024 16:37:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-51ff65b1e14so3420261e87.2 for ; Sat, 18 May 2024 09:37:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1716050256; x=1716655056; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=QQFB2q0gAoQr9/XMNQDXCI4Rc5un2TKSc/bJtOOvqTE=; b=ci3WSZMjLcF/M+mvNnbB9c4PSenDU7adujLPuxtoBgYhJHag+dHo+KbmR1dMwaKOHv vUWpJ39hO9ZpzDnXdoLI9JZ6pMSL6TBfs+biBmfFID4FSeLc7g6WM9feQs+W9ZB/8yhv rzAmMvN9fp9x9U3lXNyvK5sjJByKck4uV6UFcJ37X5/XeYwBe0qTDTXtZxkYV2dkoprF tW8CstI2ko32e2dirYztSRE53Q9OgzcvyiiYuCQUZyswLohM8OO1Gl0hfbyotnfPC2NO HuwYVqeVlNxrLh7++rM2F5HmypUsq65uWMlXmCuKpQ5kXSEajUK3WI7+lhcuOuSEm4ac DddQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716050256; x=1716655056; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QQFB2q0gAoQr9/XMNQDXCI4Rc5un2TKSc/bJtOOvqTE=; b=eEeWt1wxDiJtD84KBOEngoFCcmxpQP50T/G3chSDMpdzpNjkmwSG4QyWgPAJMTYTr5 mGuWBOeaK04k+yCp0LBbn/v8MK7B7gTc2My8wfRGqeYZuK7gFP/LD4Rjqz0u5cSImA9i lxLlvoVnVpUJXD9P59u/UNgZzIdhmh8E7/8VvpL6ZSsR9U+1TzPVbUnGzTiOENJo4bgx oTM1bkV2ls43MW9e8SPBPcYBHTimQjH3J1pOw4CSx3OtoRfDrXLalZFY5sDyhQtFmWOF 2laxjPyu8hruvkGj3hwXS0I/QzhDzAXZiIi/vBNYoOvRy1YujniODmWmE7kQg6ybphXm 56JQ== X-Forwarded-Encrypted: i=1; AJvYcCUupKU1eb0tuJxH9GOCbJpbEc9fDcvyqe0hF+lNFIVd4/Nfn+IgvxUEEYWYoM2vwxAxfmHvhcd5ojw6tkt8syGL3/DC3BOq87mBKFuaJQjM X-Gm-Message-State: AOJu0Yxmbuo6QdsROQyp+0KxFV0qmGG5nGaQE+HXQwVV5ANY8hIwvdc4 cH2Clcy2m+ruLgq9J30Jvx+xmHGWsEced4jWCENrtKB+vhbegtxP4mNtQgVJ1lLKULH4PJf/W/K zeOD8VUFUhKM9nYh4iuDoSKWz+5bWQ25j2Cx7hg== X-Google-Smtp-Source: AGHT+IEMJGZ+MWz8NBfqGZLQ8iEZnhdVOXFLlFgeAqYY47Zovwh482GLqZFrvSCiZUJiWitZp17lvX8zoEj4dC7n/nQ= X-Received: by 2002:a05:6512:3194:b0:523:b19a:25fe with SMTP id 2adb3069b0e04-523b19a28a8mr7174655e87.6.1716050255404; Sat, 18 May 2024 09:37:35 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202405181551.44IFpenT061023@gitrepo.freebsd.org> <0100018f8c718fa1-b3f56c7f-bc2b-42c3-9a8a-03cd3a5e08d2-000000@email.amazonses.com> In-Reply-To: <0100018f8c718fa1-b3f56c7f-bc2b-42c3-9a8a-03cd3a5e08d2-000000@email.amazonses.com> From: Warner Losh Date: Sat, 18 May 2024 10:37:23 -0600 Message-ID: Subject: Re: git: 3bb5428ad643 - main - rc.conf.5: remove obsolete advice about kld_list To: Colin Percival Cc: Alan Somers , src-committers , "" , "" Content-Type: multipart/alternative; boundary="000000000000e406050618bd1521" X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Queue-Id: 4VhTyV6g5yz4GZy --000000000000e406050618bd1521 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, May 18, 2024, 10:03=E2=80=AFAM Colin Percival wrote: > On 5/18/24 08:51, Alan Somers wrote: > > commit 3bb5428ad643e38dd755c8d66c8ac2ae8f7575b5 > > > > rc.conf.5: remove obsolete advice about kld_list > > > > Loading modules via kld_list is no longer substantially faster tha= n > via > > loader.conf. > Where did you benchmark this? I can believe that performance is similar > using UEFI, but on systems booting with BIOS doing I/O from the loader is > very slow because the 20-bit address space forces us to use small I/Os. > The performance problem was there was no buffer cache in the boot loader at all. BIOS is still a little slower, but ot that much slower on anything made in the last decade.... It used to be like 10-20s faster. Now it's less than a second, even for BIOS booting. And UEFI is about the same. The block cache is responsible for most of this. And BIOS doesn't matter so much these days: it is still in use, but few people use it and the IO speed when they do is DMA speeds not REPS INB speeds. Plus it causes some memory fragmentation and there are subtle bugs with it (like kld_list=3D"uhid ums" working but kld_list=3D"ums uhid" failing). Warner --=20 > Colin Percival > FreeBSD Release Engineering Lead & EC2 platform maintainer > Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoi= d > --000000000000e406050618bd1521 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Sat, May 18, 2024, 10:03=E2=80=AFAM Colin Percival = <cperciva@tarsnap.com> wrote:
On 5/18/24 08:51, Alan Somers wrote:
> commit 3bb5428ad643e38dd755c8d66c8ac2ae8f7575b5
>
>=C2=A0 =C2=A0 =C2=A0 rc.conf.5: remove obsolete advice about kld_list >=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 Loading modules via kld_list is no longer substant= ially faster than via
>=C2=A0 =C2=A0 =C2=A0 loader.conf.
Where did you benchmark this?=C2=A0 I can believe that performance is simil= ar
using UEFI, but on systems booting with BIOS doing I/O from the loader is very slow because the 20-bit address space forces us to use small I/Os.
=

The = performance problem was there was no buffer cache in the boot loader at all= . BIOS is still a little slower, but=C2=A0 ot that much slower on anything = made in the last decade....

It used to be like 10-20s faster. Now it's less than a second, even= for BIOS booting. And UEFI is about the same. The block cache is responsib= le for most of this. And BIOS doesn't matter so much these days: it is = still in use, but few people use it and the IO speed when they do is DMA sp= eeds not REPS INB speeds.

Plus it causes some memory fragmentation and there are subtle bugs with i= t (like kld_list=3D"uhid ums" working but kld_list=3D"ums uh= id" failing).

Warne= r

--
Colin Percival
FreeBSD Release Engineering Lead & EC2 platform maintainer
Founder, Tarsnap | www.tarsnap.com | Online backups = for the truly paranoid
--000000000000e406050618bd1521-- From nobody Sat May 18 18:42:39 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VhXkr1VHDz5LHSM for ; Sat, 18 May 2024 18:42:44 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from sonic307-9.consmr.mail.ne1.yahoo.com (sonic307-9.consmr.mail.ne1.yahoo.com [66.163.190.32]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4VhXkp6vRXz4YBm for ; Sat, 18 May 2024 18:42:42 +0000 (UTC) (envelope-from pfg@freebsd.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=BO+HhwsC; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=freebsd.org (policy=none); spf=softfail (mx1.freebsd.org: 66.163.190.32 is neither permitted nor denied by domain of pfg@freebsd.org) smtp.mailfrom=pfg@freebsd.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1716057760; bh=DIJdN3W80lXVEB3Y79IAMMkk/Gem/XoSKg20BF8lZ5Y=; h=Date:From:To:In-Reply-To:References:Subject:From:Subject:Reply-To; b=BO+HhwsCjW2pFJn14XdQhdC4eWD2y+Z3nqEggC2z5sDIW6mjoGzJkZ6RvpjrBbJ2uCKkhe3VLdR4z0HWZfJiqHBfEIS/I4t41vhE/4KzjIt1URsaPbTSlxoUI3hiaAa/hhBw6421Q8ufeL3Pb2EHVPBgvOydHIRlEG/FKlpqvdSkFLImn8WXEZBSQtkoVpV7NJxg46nwpFkmB3YdcBgxEfdchuFB6R2/aoqRz3RutIWzECFjq8dRrmwU3loF0xpU5fdx2kffAFSGZFxGrBhm8nOjkV/ddQqUvS0mZ6SGRzBeymjs+LWVGZXlBzHt5SrHGOaGb34VVyHBXbnmpj4N8Q== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1716057760; bh=bDl4p+CskUJa8cuSZpFiHRRJK+o7wG4yr9aYdsq1DsF=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=c5hjf6ddF+SK8hlRV4S/Md8Y2Uj6sOqtf9HN0wiTzmFGYannoCNuGgiIITvlirvHOuA2JkpJQP5PWbY1NscYlJYsAFij9BfV9IeXgam+o1YsJRCJAqSoeEt8YCYTYC2SzZr8kMq+03P5ccJINBGJO6ogkFYwv5eXQ7O5Dv/DdtUbjEe47Kv0gy33fZ6A7A7t6n21j+7+koWNR//ge+yBkjC077mT8WKyctPq6/V91v8c8557DwxeWlFqV48nnLla1DrlqlCMswwtow6rOqtbocFwU6rCJkndNGPGa7KiZa3pltgDvUY/PAkxrOOig0H47BisS30Rp8zrt4vTYq3wxg== X-YMail-OSG: KzT0eQIVM1kcCxjCxlTD9hwXHJFHm91d7fHQ4ZCn3XljlsPeTDljs6c6aMOk1pS z7N1Mmq.5rj2.mSo7La8TAh63CCqg8BYzRQnnlhDs2bgVIo9Fy0lI_k6XefoqJG.XtT_U4EZH.CK va8nwhBCaybhMA7L_yTbk3WbCbefwaO7XefNnN5S7MzeN7AxcKaO.SDaOmZP2ygdEpCR9djjD847 P37mK8JzflR7F_ymw6pFbE_6NjaKebuVyyAwMcgg0mRjhDpMc9vILeqOE4HDFAYj4KXpRNG28bWK lXgnnMeVicBX4YbOmZ4NnDGwsKy54Hq0KZ4fJkIgMMZdGMJy84CZw0QvLYX8qlto.G5FkqR8r8vt SjEuBCxY5pfM9d3V5Kl5PXk3OVPLmi_MjX7MHeNvc8mm1aDc8tqlC4vG5x1KmbvFd6y248dd4s3j 7iW8ejVfN2BZH0yNHqy0svVNT5LBIEXwrPPQoOsY47g2nsiTkuDRx4upi6ljRrQokWtCORniGY1e .bkpAl2TzLlPTVTg9kGZ3.LnkPuQ4VwiwXxjvkG8GAenYLWzXwaXYvBbEbYTg_c0MmnO1c5z2Xy6 IgAjg4OrYne.Jj8bBu0q_eM3fJ0xHOm5u6NIJwTB9lfbPVzmsLGqaHtxSoIOhWptpQP9LL39vCiQ isfSPSWcAcTVreRQJ0hOTFEKM44c.eF_hrOdGCZN0W4wA4sJfoFmQXqLJKcXQqoHyy_H.wP9fk54 lOlJUbSMDLtlkGvi3HFsg8NT2v5edFrHapBOInUxL2dPtWqg7MwWgH8snAUHwBzgXnImScK7aNbG YjJxtBwWtq49hVdl2MY5prt0cvy5_V7vGbhtp7USI3T40M6L994N2hB9qjKgWN9N6qQa3rFKjGxe QvjjOJcDemFZIKsRxEbQdm37bRowsO.Ui8_rB7gGp.8NNhgRg.K_5PZLIeKl6wTAOFEO7maAyFzt Q2Qt5v.8JJSilSYRLEdiooRNL7EFDkvldF1rZlbVsMbcN2K30dnZ6Wtfort_KEo8HpgZr_BiHz.g _zcxZTghGpggd3RL907Iu4LZ7YS0wF_jDoPeCSNH4CWo5QqSCqcBA0nXWWNm6Q86T3kOm9rVNF29 WvZKBnUBXSN4zVdno0EcSF3FsZxzNFnFP1fMzuekFsuDuBMgcwNbL95JcSQkzOjpMQnU94CRb7k_ JZqHAQ_mgIm0pLr7xO7PkMIXWDj3L7kU7CfrLmYUBDVKpadbwPJj1LM4RRY5wPNoaItZF3iPKBTR LTV8hgSRP.15D.7YjB.pDoGXgPOyv6AsL8N6dh.APRbq8dFz3stSe4jnrU7QunCLSjlSpkKQRO6M qWjVBwXA0_Fka2UV.uAEjqpyoQW8k6jO7140HziiFgW_zDJVpdp7Zhi9QIciz7diPD4sxttzTZVU 9fsOuCzY9RLaC8G3feQ_5eoX2dZG72sFbO1MyAAx2q3PHQjlCgwM.TDnYnIdOPbZNg.wMZP8R8Sa hopkvN_U1Acow6EfeHzDTFGX0pZfJfXvnwdD9bpa1eKO27XPQ4VHr2Pqoxmt0Jrp5yOm9p6m.nz4 zWJf6jltu3oBmSDVsk.0cfEQ4VEbr.B5ZCy5Q3GCBCyj_kyQ7R8fat1YV0yu.Om9ca5sKK9NPo8b 2XqQj1W1vNxu0LrFU5poC41doBZUcuCWosbdROa5FpNlYyPHUZ4EIQqyMGYHsfuu14_KDb8vD.4s 6krMOzorxgYHgBzP1uqV49SKC7sE9zEl0xi01HQ..A1mu2KoQREgc.eUWieJ1ZJSKIlsMkQcaaig GWS9V82Fgky12VMXUATLU0ZpTQDKlLsZagmj3qsH.KCphM1_LIXjvVV9CqHMxBCMziU3Eua84EwX rjYb5QDttMeY1IG6RA1P8IoTMk5v4a_F9jQogNg2fnayDlkVMkbZQ2aiDJ.lLPMw1BCeC13EJ9US xTEqMEeDzxF7tGJsc0kLDBXvkPFKBlNmr7l5iDZ6cQ.UCxkgxFBc8PIUcrv6.7LUdkFK4ZuYUJtY E17MxFf2T1QD7sFvxtFEzhLgVVMkVCzyRFOc0doMrvmHyWmqV4FWVWZm4YdZTj8mphiMuls2OjOP LUl04h1aG7w8zFSGBjC7AtaByGbUHqIhwcRczqJOsN3fVfSgTk7otsdIDMx0MaZHn5A4jQjsNfsi E8kQnpZCdjhWsO.V3in7g_fuzD7IXzSk4EJVmYfDN05xZ X-Sonic-MF: X-Sonic-ID: f7f10cf2-24a3-4749-84aa-2ca3da38d593 Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.ne1.yahoo.com with HTTP; Sat, 18 May 2024 18:42:40 +0000 Date: Sat, 18 May 2024 18:42:39 +0000 (UTC) From: Pedro Giffuni To: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" , Kyle Evans Message-ID: <177052019.1587022.1716057759658@mail.yahoo.com> In-Reply-To: <202405130524.44D5O9mN084277@gitrepo.freebsd.org> References: <202405130524.44D5O9mN084277@gitrepo.freebsd.org> Subject: Re: git: be04fec42638 - main - Import _FORTIFY_SOURCE implementation from NetBSD List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1587021_1250298158.1716057759643" X-Mailer: WebService/1.1.22356 YMailNorrin X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.20 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : No valid SPF, DKIM not aligned (relaxed),none]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; ASN(0.00)[asn:36646, ipnet:66.163.184.0/21, country:US]; FREEFALL_USER(0.00)[pfg]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_COUNT_ONE(0.00)[1]; TO_DN_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[66.163.190.32:from]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_SOFTFAIL(0.00)[~all:c]; FROM_EQ_ENVFROM(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[66.163.190.32:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org]; DKIM_TRACE(0.00)[yahoo.com:+] X-Rspamd-Queue-Id: 4VhXkp6vRXz4YBm ------=_Part_1587021_1250298158.1716057759643 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Oh no .. please not... We went into that in a GSoC: https://wiki.freebsd.org/SummerOfCode2015/FreeBSDLibcSecurityExtensions Ultimately it proved to be useless since stack-protector-strong. The NetBSD code was not well adapted to clang either. Ask me more if you really want to dig into it, but we don't want this. Pedro. On Monday, May 13, 2024 at 12:24:13 AM GMT-5, Kyle Evans wrote: =20 =20 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=3Dbe04fec42638f30f50b5b55fd8e3= 634c0fb89928 commit be04fec42638f30f50b5b55fd8e3634c0fb89928 Author:=C2=A0 =C2=A0 Kyle Evans AuthorDate: 2024-05-13 05:23:49 +0000 Commit:=C2=A0 =C2=A0 Kyle Evans CommitDate: 2024-05-13 05:23:49 +0000 =C2=A0 =C2=A0 Import _FORTIFY_SOURCE implementation from NetBSD =C2=A0 =C2=A0=20 =C2=A0 =C2=A0 This is a mostly-unmodified copy of the various *_chk impleme= ntations =C2=A0 =C2=A0 and headers from NetBSD, without yet modifying system headers= to start =C2=A0 =C2=A0 actually including them.=C2=A0 A future commit will also appl= y the needed =C2=A0 =C2=A0 bits to fix ssp/unistd.h. =C2=A0 =C2=A0=20 =C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 imp, pauamma_gundo.com (both previo= us versions), kib =C2=A0 =C2=A0 Sponsored by:=C2=A0 Stormshield =C2=A0 =C2=A0 Sponsored by:=C2=A0 Klara, Inc. =C2=A0 =C2=A0 Differential Revision:=C2=A0 https://reviews.freebsd.org/D323= 06 --- etc/mtree/BSD.include.dist=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 2 + include/Makefile=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 |=C2=A0 2 +- include/ssp/Makefile=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2= =A0 6 ++ include/ssp/ssp.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 |=C2=A0 91 ++++++++++++++++++++++++++ include/ssp/stdio.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= |=C2=A0 93 ++++++++++++++++++++++++++ include/ssp/string.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | 129= ++++++++++++++++++++++++++++++++++++ include/ssp/strings.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2= =A0 67 +++++++++++++++++++ include/ssp/unistd.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2= =A0 54 +++++++++++++++ lib/libc/secure/Makefile.inc=C2=A0 =C2=A0 =C2=A0 |=C2=A0 11 ++++ lib/libc/secure/Symbol.map=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 18 +++++ lib/libc/secure/fgets_chk.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 54 ++++++++= +++++++ lib/libc/secure/gets_chk.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 74 +++++++++= ++++++++++++ lib/libc/secure/memcpy_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 53 ++++++++++++++= + lib/libc/secure/memmove_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 47 +++++++++++++ lib/libc/secure/memset_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 46 +++++++++++++ lib/libc/secure/snprintf_chk.c=C2=A0 =C2=A0 |=C2=A0 56 ++++++++++++++++ lib/libc/secure/sprintf_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 61 +++++++++++++= ++++ lib/libc/secure/ssp_internal.h=C2=A0 =C2=A0 |=C2=A0 37 +++++++++++ lib/libc/secure/stpcpy_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 55 ++++++++++++++= ++ lib/libc/secure/stpncpy_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 53 +++++++++++++= ++ lib/libc/secure/strcat_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 60 ++++++++++++++= +++ lib/libc/secure/strcpy_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 54 ++++++++++++++= + lib/libc/secure/strncat_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 70 +++++++++++++= +++++++ lib/libc/secure/strncpy_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 53 +++++++++++++= ++ lib/libc/secure/vsnprintf_chk.c=C2=A0 =C2=A0 |=C2=A0 49 ++++++++++++++ lib/libc/secure/vsprintf_chk.c=C2=A0 =C2=A0 |=C2=A0 58 ++++++++++++++++ lib/libssp/Makefile=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= |=C2=A0 20 +++++- lib/libssp/Symbol.map=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2= =A0 12 ++-- lib/libssp/Versions.def=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 5= ++ lib/libssp/__builtin_object_size.3 | 110 +++++++++++++++++++++++++++++++ lib/libssp/fortify_stubs.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 | 131 --------------= ----------------------- lib/libssp/ssp.3=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 | 130 ++++++++++++++++++++++++++++++++++++ 32 files changed, 1621 insertions(+), 140 deletions(-) diff --git a/etc/mtree/BSD.include.dist b/etc/mtree/BSD.include.dist index a6bd5880bf61..f8c83d6dde7a 100644 --- a/etc/mtree/BSD.include.dist +++ b/etc/mtree/BSD.include.dist @@ -372,6 +372,8 @@ =C2=A0 =C2=A0 =C2=A0 =C2=A0 mac_veriexec =C2=A0 =C2=A0 =C2=A0 =C2=A0 .. =C2=A0 =C2=A0 .. +=C2=A0 =C2=A0 ssp +=C2=A0 =C2=A0 .. =C2=A0 =C2=A0 sys =C2=A0 =C2=A0 =C2=A0 =C2=A0 disk =C2=A0 =C2=A0 =C2=A0 =C2=A0 .. diff --git a/include/Makefile b/include/Makefile index 19e6beb95203..32774419f162 100644 --- a/include/Makefile +++ b/include/Makefile @@ -4,7 +4,7 @@ =20 PACKAGE=3Dclibs CLEANFILES=3D osreldate.h version -SUBDIR=3D arpa protocols rpcsvc rpc xlocale +SUBDIR=3D arpa protocols rpcsvc rpc ssp xlocale .if ${MACHINE_CPUARCH} =3D=3D "amd64" SUBDIR+=3D=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 i386 INCLUDE_SUBDIRS+=3D=C2=A0=C2=A0=C2=A0 i386 diff --git a/include/ssp/Makefile b/include/ssp/Makefile new file mode 100644 index 000000000000..dff19f43c920 --- /dev/null +++ b/include/ssp/Makefile @@ -0,0 +1,6 @@ +# $FreeBSD$ + +INCS=3D=C2=A0=C2=A0=C2=A0 ssp.h stdio.h string.h strings.h unistd.h +INCSDIR=3D=C2=A0=C2=A0=C2=A0 ${INCLUDEDIR}/ssp + +.include diff --git a/include/ssp/ssp.h b/include/ssp/ssp.h new file mode 100644 index 000000000000..35a9aeee02df --- /dev/null +++ b/include/ssp/ssp.h @@ -0,0 +1,91 @@ +/*=C2=A0=C2=A0=C2=A0 $NetBSD: ssp.h,v 1.13 2015/09/03 20:43:47 plunky Exp = $=C2=A0=C2=A0=C2=A0 */ + +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006, 2011 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF = THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _SSP_SSP_H_ +#define _SSP_SSP_H_ + +#include + +#if !defined(__cplusplus) +# if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && \ +=C2=A0 =C2=A0 (__OPTIMIZE__ > 0 || defined(__clang__)) +#=C2=A0 if _FORTIFY_SOURCE > 1 +#=C2=A0 define __SSP_FORTIFY_LEVEL 2 +#=C2=A0 else +#=C2=A0 define __SSP_FORTIFY_LEVEL 1 +#=C2=A0 endif +# else +#=C2=A0 define __SSP_FORTIFY_LEVEL 0 +# endif +#else +# define __SSP_FORTIFY_LEVEL 0 +#endif + +#define=C2=A0=C2=A0=C2=A0 __ssp_var(type)=C2=A0=C2=A0=C2=A0 __CONCAT(__ssp= _ ## type, __COUNTER__) + +/* __ssp_real is used by the implementation in libc */ +#if __SSP_FORTIFY_LEVEL =3D=3D 0 +#define __ssp_real_(fun)=C2=A0=C2=A0=C2=A0 fun +#else +#define __ssp_real_(fun)=C2=A0=C2=A0=C2=A0 __ssp_real_ ## fun +#endif +#define __ssp_real(fun)=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __ssp_real_(f= un) + +#define __ssp_inline static __inline __attribute__((__always_inline__)) + +#define __ssp_bos(ptr) __builtin_object_size(ptr, __SSP_FORTIFY_LEVEL > 1) +#define __ssp_bos0(ptr) __builtin_object_size(ptr, 0) + +#define __ssp_check(buf, len, bos) \ +=C2=A0=C2=A0=C2=A0 if (bos(buf) !=3D (size_t)-1 && len > bos(buf)) \ +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail() +#define __ssp_redirect_raw(rtype, fun, symbol, args, call, cond, bos) \ +rtype __ssp_real_(fun) args __RENAME(symbol); \ +__ssp_inline rtype fun args __RENAME(__ssp_protected_ ## fun); \ +__ssp_inline rtype fun args { \ +=C2=A0=C2=A0=C2=A0 if (cond) \ +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __ssp_check(__buf, __len, bos); \ +=C2=A0=C2=A0=C2=A0 return __ssp_real_(fun) call; \ +} + +#define __ssp_redirect(rtype, fun, args, call) \ +=C2=A0 =C2=A0 __ssp_redirect_raw(rtype, fun, fun, args, call, 1, __ssp_bos= ) +#define __ssp_redirect0(rtype, fun, args, call) \ +=C2=A0 =C2=A0 __ssp_redirect_raw(rtype, fun, fun, args, call, 1, __ssp_bos= 0) + +__BEGIN_DECLS +void __stack_chk_fail(void) __dead2; +void __chk_fail(void) __dead2; +__END_DECLS + +#endif /* _SSP_SSP_H_ */ diff --git a/include/ssp/stdio.h b/include/ssp/stdio.h new file mode 100644 index 000000000000..72e3236eac80 --- /dev/null +++ b/include/ssp/stdio.h @@ -0,0 +1,93 @@ +/*=C2=A0=C2=A0=C2=A0 $NetBSD: stdio.h,v 1.5 2011/07/17 20:54:34 joerg Exp = $=C2=A0=C2=A0=C2=A0 */ + +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF = THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _SSP_STDIO_H_ +#define _SSP_STDIO_H_ + +#include + +__BEGIN_DECLS +int __sprintf_chk(char *__restrict, int, size_t, const char *__restrict, .= ..) +=C2=A0 =C2=A0 __printflike(4, 5); +int __vsprintf_chk(char *__restrict, int, size_t, const char *__restrict, +=C2=A0 =C2=A0 __va_list) +=C2=A0 =C2=A0 __printflike(4, 0); +int __snprintf_chk(char *__restrict, size_t, int, size_t, +=C2=A0 =C2=A0 const char *__restrict, ...) +=C2=A0 =C2=A0 __printflike(5, 6); +int __vsnprintf_chk(char *__restrict, size_t, int, size_t, +=C2=A0 =C2=A0 const char *__restrict, __va_list) +=C2=A0 =C2=A0 __printflike(5, 0); +char *__gets_chk(char *, size_t); +char *__fgets_chk(char *, int, size_t, FILE *); +__END_DECLS + +#if __SSP_FORTIFY_LEVEL > 0 + +#define sprintf(str, ...) ({=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 char *_ssp_str =3D (str);=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __builtin___sprintf_chk(_ssp_str, 0, __ssp_bos(_ssp_str),=C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 =C2=A0 =C2=A0 __VA_ARGS__); \ +}) + +#define vsprintf(str, fmt, ap) ({=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 char *_ssp_str =3D (str);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 \ +=C2=A0 =C2=A0 __builtin___vsprintf_chk(_ssp_str, 0, __ssp_bos(_ssp_str), f= mt,=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 =C2=A0 =C2=A0 ap);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +}) + +#define snprintf(str, len, ...) ({=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 char *_ssp_str =3D (str);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 \ +=C2=A0 =C2=A0 __builtin___snprintf_chk(_ssp_str, len, 0, __ssp_bos(_ssp_st= r),=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 =C2=A0 =C2=A0 __VA_ARGS__);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0 \ +}) + +#define vsnprintf(str, len, fmt, ap) ({=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 char *_ssp_str =3D (str);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 \ +=C2=A0 =C2=A0 __builtin___vsnprintf_chk(_ssp_str, len, 0, __ssp_bos(_ssp_s= tr),=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 =C2=A0 =C2=A0 fmt, ap);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 \ +}) + +#define gets(str) ({=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 \ +=C2=A0 char *_ssp_str =3D (str);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __gets_chk(_ssp_str, __ssp_bos(_ssp_str));=C2=A0=C2=A0=C2=A0= \ +}) + +#define fgets(str, len, fp) ({=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 char *_ssp_str =3D (str);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 \ +=C2=A0 =C2=A0 __fgets_chk(_ssp_str, len, __ssp_bos(_ssp_str), fp);=C2=A0= =C2=A0=C2=A0 \ +}) + +#endif /* __SSP_FORTIFY_LEVEL > 0 */ + +#endif /* _SSP_STDIO_H_ */ diff --git a/include/ssp/string.h b/include/ssp/string.h new file mode 100644 index 000000000000..996020fda778 --- /dev/null +++ b/include/ssp/string.h @@ -0,0 +1,129 @@ +/*=C2=A0=C2=A0=C2=A0 $NetBSD: string.h,v 1.14 2020/09/05 13:37:59 mrg Exp = $=C2=A0=C2=A0=C2=A0 */ + +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF = THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _SSP_STRING_H_ +#define _SSP_STRING_H_ + +#include + +__BEGIN_DECLS +void *__memcpy_chk(void *, const void *, size_t, size_t); +void *__memmove_chk(void *, const void *, size_t, size_t); +void *__memset_chk(void *, int, size_t, size_t); +char *__stpcpy_chk(char *, const char *, size_t); +char *__stpncpy_chk(char *, const char *, size_t, size_t); +char *__strcat_chk(char *, const char *, size_t); +char *__strcpy_chk(char *, const char *, size_t); +char *__strncat_chk(char *, const char *, size_t, size_t); +char *__strncpy_chk(char *, const char *, size_t, size_t); +__END_DECLS + +#if __SSP_FORTIFY_LEVEL > 0 + +#define __ssp_bos_check3_typed_var(fun, dsttype, dsrvar, dst, srctype, src= var, \ +=C2=A0 =C2=A0 src, lenvar, len) ({=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 srctype srcvar =3D (src);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 dsttype dstvar =3D (dst);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 size_t lenvar =3D (len);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 ((__ssp_bos0(dstvar) !=3D (size_t)-1) ?=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __builtin___ ## fun ## _chk(dstvar, srcvar, lenvar,=C2=A0=C2= =A0=C2=A0 \ +=C2=A0 =C2=A0 =C2=A0 =C2=A0 __ssp_bos0(dstvar)) :=C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __ ## fun ## _ichk(dstvar, srcvar, lenvar));=C2=A0=C2=A0=C2= =A0 \ +}) + +#define __ssp_bos_check3_typed(fun, dsttype, dst, srctype, src, len)=C2=A0= =C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __ssp_bos_check3_typed_var(fun, dsttype, __ssp_var(dstv), ds= t,=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 =C2=A0 =C2=A0 srctype, __ssp_var(srcv), src, __ssp_var(lenv)= , len) + +#define __ssp_bos_check3(fun, dst, src, len)=C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0 \ +=C2=A0 =C2=A0 __ssp_bos_check3_typed_var(fun, void *, __ssp_var(dstv), dst= ,=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 =C2=A0 =C2=A0 const void *, __ssp_var(srcv), src, __ssp_var(= lenv), len) + +#define __ssp_bos_check2_var(fun, dstvar, dst, srcvar, src) ({=C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 const void *srcvar =3D (src);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 void *dstvar =3D (dst);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 ((__ssp_bos0(dstvar) !=3D (size_t)-1) ?=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __builtin___ ## fun ## _chk(dstvar, srcvar,=C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 =C2=A0 =C2=A0 __ssp_bos0(dstvar)) :=C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __ ## fun ## _ichk(dstvar, srcvar));=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 \ +}) + +#define __ssp_bos_check2(fun, dst, src)=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __ssp_bos_check2_var(fun, __ssp_var(dstv), dst, __ssp_var(sr= cv), src) + +#define __ssp_bos_icheck3_restrict(fun, type1, type2) \ +static __inline type1 __ ## fun ## _ichk(type1 __restrict, type2 __restric= t, size_t); \ +static __inline __attribute__((__always_inline__)) type1 \ +__ ## fun ## _ichk(type1 __restrict dst, type2 __restrict src, size_t len)= { \ +=C2=A0=C2=A0=C2=A0 return __builtin___ ## fun ## _chk(dst, src, len, __ssp= _bos0(dst)); \ +} + +#define __ssp_bos_icheck3(fun, type1, type2) \ +static __inline type1 __ ## fun ## _ichk(type1, type2, size_t); \ +static __inline __attribute__((__always_inline__)) type1 \ +__ ## fun ## _ichk(type1 dst, type2 src, size_t len) { \ +=C2=A0=C2=A0=C2=A0 return __builtin___ ## fun ## _chk(dst, src, len, __ssp= _bos0(dst)); \ +} + +#define __ssp_bos_icheck2_restrict(fun, type1, type2) \ +static __inline type1 __ ## fun ## _ichk(type1, type2); \ +static __inline __attribute__((__always_inline__)) type1 \ +__ ## fun ## _ichk(type1 __restrict dst, type2 __restrict src) { \ +=C2=A0=C2=A0=C2=A0 return __builtin___ ## fun ## _chk(dst, src, __ssp_bos0= (dst)); \ +} + +__BEGIN_DECLS +__ssp_bos_icheck3_restrict(memcpy, void *, const void *) +__ssp_bos_icheck3(memmove, void *, const void *) +__ssp_bos_icheck3(memset, void *, int) +__ssp_bos_icheck2_restrict(stpcpy, char *, const char *) +__ssp_bos_icheck3_restrict(stpncpy, char *, const char *) +__ssp_bos_icheck2_restrict(strcpy, char *, const char *) +__ssp_bos_icheck2_restrict(strcat, char *, const char *) +__ssp_bos_icheck3_restrict(strncpy, char *, const char *) +__ssp_bos_icheck3_restrict(strncat, char *, const char *) +__END_DECLS + +#define memcpy(dst, src, len) __ssp_bos_check3(memcpy, dst, src, len) +#define memmove(dst, src, len) __ssp_bos_check3(memmove, dst, src, len) +#define memset(dst, val, len) \ +=C2=A0 =C2=A0 __ssp_bos_check3_typed(memset, void *, dst, int, val, len) +#define stpcpy(dst, src) __ssp_bos_check2(stpcpy, dst, src) +#define stpncpy(dst, src, len) __ssp_bos_check3(stpncpy, dst, src, len) +#define strcpy(dst, src) __ssp_bos_check2(strcpy, dst, src) +#define strcat(dst, src) __ssp_bos_check2(strcat, dst, src) +#define strncpy(dst, src, len) __ssp_bos_check3(strncpy, dst, src, len) +#define strncat(dst, src, len) __ssp_bos_check3(strncat, dst, src, len) + +#endif /* __SSP_FORTIFY_LEVEL > 0 */ +#endif /* _SSP_STRING_H_ */ diff --git a/include/ssp/strings.h b/include/ssp/strings.h new file mode 100644 index 000000000000..06c9c7cc0a09 --- /dev/null +++ b/include/ssp/strings.h @@ -0,0 +1,67 @@ +/*=C2=A0=C2=A0=C2=A0 $NetBSD: strings.h,v 1.3 2008/04/28 20:22:54 martin E= xp $=C2=A0=C2=A0=C2=A0 */ + +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2007 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF = THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _SSP_STRINGS_H_ +#define _SSP_STRINGS_H_ + +#include +#include + +#if __SSP_FORTIFY_LEVEL > 0 + +#define _ssp_bcopy(srcvar, src, dstvar, dst, lenvar,=C2=A0 len) ({=C2=A0= =C2=A0=C2=A0 \ +=C2=A0 =C2=A0 const void *srcvar =3D (src);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 void *dstvar =3D (dst);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 size_t lenvar =3D (len);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 ((__ssp_bos0(dstvar) !=3D (size_t)-1) ?=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __builtin___memmove_chk(dstvar, srcvar, lenvar,=C2=A0=C2=A0= =C2=A0 \ +=C2=A0 =C2=A0 =C2=A0 =C2=A0 __ssp_bos0(dstvar)) :=C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __memmove_ichk(dstvar, srcvar, lenvar));=C2=A0=C2=A0=C2=A0 \ +}) + +#define=C2=A0=C2=A0=C2=A0 bcopy(src, dst, len)=C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 _ssp_bcopy(__ssp_var(srcv), src, __ssp_var(dstv), dst, __ssp= _var(lenv), len) + +#define _ssp_bzero(dstvar, dst, lenvar, len) ({=C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 \ +=C2=A0 =C2=A0 void *dstvar =3D (dst);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 size_t lenvar =3D (len);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 ((__ssp_bos0(dstvar) !=3D (size_t)-1) ?=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __builtin___memset_chk(dstvar, 0, lenvar,=C2=A0=C2=A0=C2=A0 = \ +=C2=A0 =C2=A0 =C2=A0 =C2=A0 __ssp_bos0(dstvar)) : \ +=C2=A0 =C2=A0 __memset_ichk(dstvar, 0, lenvar));=C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 \ +}) + +#define=C2=A0=C2=A0=C2=A0 bzero(dst, len)=C2=A0=C2=A0=C2=A0 _ssp_bzero(__s= sp_var(dstv), dst, __ssp_var(lenv), len) + +#endif /* __SSP_FORTIFY_LEVEL > 0 */ +#endif /* _SSP_STRINGS_H_ */ diff --git a/include/ssp/unistd.h b/include/ssp/unistd.h new file mode 100644 index 000000000000..2414e2baa96b --- /dev/null +++ b/include/ssp/unistd.h @@ -0,0 +1,54 @@ +/*=C2=A0=C2=A0=C2=A0 $NetBSD: unistd.h,v 1.7 2015/06/25 18:41:03 joerg Exp= $=C2=A0=C2=A0=C2=A0 */ + +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF = THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _SSP_UNISTD_H_ +#define _SSP_UNISTD_H_ + +#include + +#if __SSP_FORTIFY_LEVEL > 0 +__BEGIN_DECLS + +__ssp_redirect0(ssize_t, read, (int __fd, void *__buf, size_t __len), \ +=C2=A0 =C2=A0 (__fd, __buf, __len)); + +__ssp_redirect(ssize_t, readlink, (const char *__restrict __path, \ +=C2=A0 =C2=A0 char *__restrict __buf, size_t __len), (__path, __buf, __len= )); + +__ssp_redirect_raw(char *, getcwd, getcwd, (char *__buf, size_t __len), +=C2=A0 =C2=A0 (__buf, __len), __buf !=3D 0, __ssp_bos); + +__END_DECLS + +#endif /* __SSP_FORTIFY_LEVEL > 0 */ +#endif /* _SSP_UNISTD_H_ */ diff --git a/lib/libc/secure/Makefile.inc b/lib/libc/secure/Makefile.inc index 8574c5a05dc5..3b1ad879c715 100644 --- a/lib/libc/secure/Makefile.inc +++ b/lib/libc/secure/Makefile.inc @@ -3,6 +3,17 @@ =20 .PATH: ${LIBC_SRCTOP}/secure =20 +# _FORTIFY_SOURCE +SRCS+=3D=C2=A0=C2=A0=C2=A0 gets_chk.c fgets_chk.c memcpy_chk.c memmove_chk= .c memset_chk.c \ +=C2=A0=C2=A0=C2=A0 snprintf_chk.c sprintf_chk.c stpcpy_chk.c stpncpy_chk.c= \ +=C2=A0=C2=A0=C2=A0 strcat_chk.c strcpy_chk.c strncat_chk.c strncpy_chk.c \ +=C2=A0=C2=A0=C2=A0 vsnprintf_chk.c vsprintf_chk.c + +CFLAGS.snprintf_chk.c+=3D=C2=A0=C2=A0=C2=A0 -Wno-unused-parameter +CFLAGS.sprintf_chk.c+=3D=C2=A0=C2=A0=C2=A0 -Wno-unused-parameter +CFLAGS.vsnprintf_chk.c+=3D=C2=A0=C2=A0=C2=A0 -Wno-unused-parameter +CFLAGS.vsprintf_chk.c+=3D=C2=A0=C2=A0=C2=A0 -Wno-unused-parameter + # Sources common to both syscall interfaces: SRCS+=3D=C2=A0=C2=A0=C2=A0 stack_protector.c \ =C2=A0=C2=A0=C2=A0 stack_protector_compat.c diff --git a/lib/libc/secure/Symbol.map b/lib/libc/secure/Symbol.map index 641f451b5421..7859fcee3821 100644 --- a/lib/libc/secure/Symbol.map +++ b/lib/libc/secure/Symbol.map @@ -3,3 +3,21 @@ FBSD_1.0 { =C2=A0=C2=A0=C2=A0 __stack_chk_fail; =C2=A0=C2=A0=C2=A0 __stack_chk_guard; }; + +FBSD_1.8 { +=C2=A0=C2=A0=C2=A0 __gets_chk; +=C2=A0=C2=A0=C2=A0 __fgets_chk; +=C2=A0=C2=A0=C2=A0 __memcpy_chk; +=C2=A0=C2=A0=C2=A0 __memmove_chk; +=C2=A0=C2=A0=C2=A0 __memset_chk; +=C2=A0=C2=A0=C2=A0 __snprintf_chk; +=C2=A0=C2=A0=C2=A0 __sprintf_chk; +=C2=A0=C2=A0=C2=A0 __stpcpy_chk; +=C2=A0=C2=A0=C2=A0 __stpncpy_chk; +=C2=A0=C2=A0=C2=A0 __strcat_chk; +=C2=A0=C2=A0=C2=A0 __strcpy_chk; +=C2=A0=C2=A0=C2=A0 __strncat_chk; +=C2=A0=C2=A0=C2=A0 __strncpy_chk; +=C2=A0=C2=A0=C2=A0 __vsnprintf_chk; +=C2=A0=C2=A0=C2=A0 __vsprintf_chk; +}; diff --git a/lib/libc/secure/fgets_chk.c b/lib/libc/secure/fgets_chk.c new file mode 100644 index 000000000000..72aa1d816ce1 --- /dev/null +++ b/lib/libc/secure/fgets_chk.c @@ -0,0 +1,54 @@ +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * 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 +__RCSID("$NetBSD: fgets_chk.c,v 1.6 2009/02/05 05:41:51 lukem Exp $"); + +#include +#include +#include +#include + +#include +#include +#undef fgets + +char * +__fgets_chk(char * __restrict buf, int len, size_t slen, FILE *fp) +{ +=C2=A0=C2=A0=C2=A0 if (slen >=3D (size_t)INT_MAX) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 return (fgets(buf, len, fp)); + +=C2=A0=C2=A0=C2=A0 if (len >=3D 0 && (size_t)len > slen) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail(); + +=C2=A0=C2=A0=C2=A0 return (fgets(buf, len, fp)); +} diff --git a/lib/libc/secure/gets_chk.c b/lib/libc/secure/gets_chk.c new file mode 100644 index 000000000000..18c1e2d18f43 --- /dev/null +++ b/lib/libc/secure/gets_chk.c @@ -0,0 +1,74 @@ +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * 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 +__RCSID("$NetBSD: gets_chk.c,v 1.7 2013/10/04 20:49:16 christos Exp $"); + +#include +#include +#include +#include + +#include +#include + +char *__gets_unsafe(char *); + +char * +__gets_chk(char * __restrict buf, size_t slen) +{ +=C2=A0=C2=A0=C2=A0 char *abuf; +=C2=A0=C2=A0=C2=A0 size_t len; + +=C2=A0=C2=A0=C2=A0 if (slen >=3D (size_t)INT_MAX) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 return (__gets_unsafe(buf)); + +=C2=A0=C2=A0=C2=A0 if ((abuf =3D malloc(slen + 1)) =3D=3D NULL) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 return (__gets_unsafe(buf)); + +=C2=A0=C2=A0=C2=A0 if (fgets(abuf, (int)(slen + 1), stdin) =3D=3D NULL) { +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 free(abuf); +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 return (NULL); +=C2=A0=C2=A0=C2=A0 } + +=C2=A0=C2=A0=C2=A0 len =3D strlen(abuf); +=C2=A0=C2=A0=C2=A0 if (len > 0 && abuf[len - 1] =3D=3D '\n') +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 --len; + +=C2=A0=C2=A0=C2=A0 if (len >=3D slen) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail(); + +=C2=A0=C2=A0=C2=A0 (void)memcpy(buf, abuf, len); + +=C2=A0=C2=A0=C2=A0 buf[len] =3D '\0'; +=C2=A0=C2=A0=C2=A0 free(abuf); +=C2=A0=C2=A0=C2=A0 return (buf); +} diff --git a/lib/libc/secure/memcpy_chk.c b/lib/libc/secure/memcpy_chk.c new file mode 100644 index 000000000000..99cf2d5f13ff --- /dev/null +++ b/lib/libc/secure/memcpy_chk.c @@ -0,0 +1,53 @@ +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * 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 +__RCSID("$NetBSD: memcpy_chk.c,v 1.7 2015/05/13 19:57:16 joerg Exp $"); + +#include + +#include +#undef memcpy + +#include "ssp_internal.h" + +void * +__memcpy_chk(void * __restrict dst, const void * __restrict src, size_t le= n, +=C2=A0 =C2=A0 size_t slen) +{ +=C2=A0=C2=A0=C2=A0 if (len > slen) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail(); + +=C2=A0=C2=A0=C2=A0 if (__ssp_overlap((const char *)src, (const char *)dst,= len)) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail(); + +=C2=A0=C2=A0=C2=A0 return (memcpy(dst, src, len)); +} diff --git a/lib/libc/secure/memmove_chk.c b/lib/libc/secure/memmove_chk.c new file mode 100644 index 000000000000..07f965d608fc --- /dev/null +++ b/lib/libc/secure/memmove_chk.c @@ -0,0 +1,47 @@ +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * 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 +__RCSID("$NetBSD: memmove_chk.c,v 1.6 2020/09/05 13:37:59 mrg Exp $"); + +#include + +#include +#undef memmove + +void * +__memmove_chk(void *dst, const void *src, size_t len, +=C2=A0 =C2=A0 size_t slen) +{ +=C2=A0=C2=A0=C2=A0 if (len > slen) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail(); +=C2=A0=C2=A0=C2=A0 return (memmove(dst, src, len)); +} diff --git a/lib/libc/secure/memset_chk.c b/lib/libc/secure/memset_chk.c new file mode 100644 index 000000000000..f337be98b46d --- /dev/null +++ b/lib/libc/secure/memset_chk.c @@ -0,0 +1,46 @@ +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * 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 +__RCSID("$NetBSD: memset_chk.c,v 1.5 2014/09/17 00:39:28 joerg Exp $"); + +#include + +#include +#undef memset + +void * +__memset_chk(void * __restrict dst, int val, size_t len, size_t slen) +{ +=C2=A0=C2=A0=C2=A0 if (len > slen) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail(); +=C2=A0=C2=A0=C2=A0 return (memset(dst, val, len)); +} diff --git a/lib/libc/secure/snprintf_chk.c b/lib/libc/secure/snprintf_chk.= c new file mode 100644 index 000000000000..52ef874ede5b --- /dev/null +++ b/lib/libc/secure/snprintf_chk.c @@ -0,0 +1,56 @@ +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * 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 +__RCSID("$NetBSD: snprintf_chk.c,v 1.5 2008/04/28 20:23:00 martin Exp $"); + +#include +#include + +#include +#undef vsnprintf + +int +__snprintf_chk(char * __restrict buf, size_t len, int flags, size_t slen, +=C2=A0 =C2=A0 const char * __restrict fmt, ...) +{ +=C2=A0=C2=A0=C2=A0 va_list ap; +=C2=A0=C2=A0=C2=A0 int rv; + +=C2=A0=C2=A0=C2=A0 if (len > slen) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail(); + +=C2=A0=C2=A0=C2=A0 va_start(ap, fmt); +=C2=A0=C2=A0=C2=A0 rv =3D vsnprintf(buf, len, fmt, ap); +=C2=A0=C2=A0=C2=A0 va_end(ap); + +=C2=A0=C2=A0=C2=A0 return (rv); +} diff --git a/lib/libc/secure/sprintf_chk.c b/lib/libc/secure/sprintf_chk.c new file mode 100644 index 000000000000..d4c42ccba3ce --- /dev/null +++ b/lib/libc/secure/sprintf_chk.c @@ -0,0 +1,61 @@ +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation *** 1063 LINES SKIPPED *** =20 ------=_Part_1587021_1250298158.1716057759643 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Oh no .. please not...
=

We went into that in a GSoC:



<= /div>
Ultimately it proved to be usel= ess since stack-protector-strong.

The NetBSD code was not= well adapted to clang either.
=
Ask me more if you really = want to dig into it, but we don't want this.

Pedro.
=


=20
=20
On Monday, May 13, 2024 at 12:24:13 AM GMT-5, Kyle = Evans <kevans@freebsd.org> wrote:


=20 =20
The branch main has been updated by k= evans:


commit be04fec42638f30f50b5b55fd8e3634c= 0fb89928
Author:    Kyle Evans <kevan= s@FreeBSD.org>
AuthorDate: 2024-05-13 05:2= 3:49 +0000
Commit:    Kyle Evans <<= a href=3D"mailto:kevans@FreeBSD.org" rel=3D"nofollow" target=3D"_blank">kev= ans@FreeBSD.org>
CommitDate: 2024-05-13 05= :23:49 +0000

  &n= bsp; Import _FORTIFY_SOURCE implementation from NetBSD
   
    This is a most= ly-unmodified copy of the various *_chk implementations
    and headers from NetBSD, without yet modifying syste= m headers to start
    actually includi= ng them.  A future commit will also apply the needed
    bits to fix ssp/unistd.h.
=    
    Reviewed by:  &= nbsp; imp, pauamma_gundo.com (both previous versions), kib
    Sponsored by:  Stormshield
    Sponsored by:  Klara, Inc.
    Differential Revision:  https://reviews.= freebsd.org/D32306
---
etc/mtree/BSD.include.dist        |  2 +
include/Makefile         =         |  2 +-
incl= ude/ssp/Makefile              |  = 6 ++
include/ssp/ssp.h       = ;           |  91 ++++++++++++++++++++++++++<= br>
include/ssp/stdio.h        &= nbsp;       |  93 ++++++++++++++++++++++++++
<= div dir=3D"ltr"> include/ssp/string.h          &nb= sp;   | 129 ++++++++++++++++++++++++++++++++++++
include/ssp/strings.h             = ; |  67 +++++++++++++++++++
include/ssp/uni= std.h              |  54 +++++++++= ++++++
lib/libc/secure/Makefile.inc   =   |  11 ++++
lib/libc/secure/Symbol.= map        |  18 +++++
= lib/libc/secure/fgets_chk.c        |  54 ++++++++= +++++++
lib/libc/secure/gets_chk.c    =     |  74 +++++++++++++++++++++
= lib/libc/secure/memcpy_chk.c      |  53 ++++++++++++++= +
lib/libc/secure/memmove_chk.c    &nb= sp; |  47 +++++++++++++
lib/libc/secure/mem= set_chk.c      |  46 +++++++++++++
lib/libc/secure/snprintf_chk.c    |  56 +++++++++= +++++++
lib/libc/secure/sprintf_chk.c  &nbs= p;   |  61 +++++++++++++++++
lib/libc/= secure/ssp_internal.h    |  37 +++++++++++
lib/libc/secure/stpcpy_chk.c      |  55 +++= +++++++++++++
lib/libc/secure/stpncpy_chk.c = ;     |  53 +++++++++++++++
lib/l= ibc/secure/strcat_chk.c      |  60 +++++++++++++++++
lib/libc/secure/strcpy_chk.c      = |  54 +++++++++++++++
lib/libc/secure/strn= cat_chk.c      |  70 ++++++++++++++++++++
lib/libc/secure/strncpy_chk.c      |  53 = +++++++++++++++
lib/libc/secure/vsnprintf_chk.c&= nbsp;   |  49 ++++++++++++++
lib/libc/= secure/vsprintf_chk.c    |  58 ++++++++++++++++
lib/libssp/Makefile           = ;     |  20 +++++-
lib/libssp/Sym= bol.map              |  12 ++--
=
lib/libssp/Versions.def        =     |  5 ++
lib/libssp/__builtin= _object_size.3 | 110 +++++++++++++++++++++++++++++++
lib/libssp/fortify_stubs.c        | 131 ---------= ----------------------------
lib/libssp/ssp.3&nb= sp;                 | 130 ++++++++= ++++++++++++++++++++++++++++
32 files changed, 1= 621 insertions(+), 140 deletions(-)

diff --git a/etc/mtree/BSD.include.dist b/etc/mtree/BSD.inclu= de.dist
index a6bd5880bf61..f8c83d6dde7a 100644
--- a/etc/mtree/BSD.include.dist
+++ b/etc/mtree/BSD.include.dist
@@ -372= ,6 +372,8 @@
        mac_ver= iexec
        ..
    ..
+    s= sp
+    ..
&n= bsp;   sys
        dis= k
        ..
diff --git a/include/Makefile b/include/Makefile
index 19e6beb95203..32774419f162 100644
--- a/include/Makefile
+++ b/include/Makefile
@@ -4,7 +4,7 @@

PACKAGE=3Dclibs
CLEANFILES= =3D osreldate.h version
-SUBDIR=3D arpa protocols= rpcsvc rpc xlocale
+SUBDIR=3D arpa protocols rpc= svc rpc ssp xlocale
.if ${MACHINE_CPUARCH} =3D= =3D "amd64"
SUBDIR+=3D     &= nbsp;  i386
INCLUDE_SUBDIRS+=3D  =   i386
diff --git a/include/ssp/Makefile b/i= nclude/ssp/Makefile
new file mode 100644
index 000000000000..dff19f43c920
--- /dev/null
+++ b/include/ssp/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$<= br>
+
+INCS=3D  &= nbsp; ssp.h stdio.h string.h strings.h unistd.h
+= INCSDIR=3D    ${INCLUDEDIR}/ssp
+<= br>
+.include <bsd.prog.mk>
diff --git a/include/ssp/ssp.h b/include/ssp/ssp.h
new file mode 100644
index 00000000000= 0..35a9aeee02df
--- /dev/null
+++ b/include/ssp/ssp.h
@@ -0,0 +1,91 @@=
+/*    $NetBSD: ssp.h,v 1.13 2015= /09/03 20:43:47 plunky Exp $    */
+
+/*-
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2006, 2011 The Net= BSD Foundation, Inc.
+ * All rights reserved.
=
+ *
+ * This code is deriv= ed from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or wi= thout
+ * modification, are permitted provided th= at the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the abo= ve copyright
+ *    notice, this list o= f 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
+ *    docu= mentation and/or other materials provided with the distribution.
<= div dir=3D"ltr">+ *
+ * THIS SOFTWARE IS PROVIDED= BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
= + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTAB= ILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE AR= E DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE= CIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (IN= CLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * S= UBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
=
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY O= F LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIAB= ILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED O= F THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef _SSP_SSP_H_
+#define _SSP_SSP_H_
+
+#include <sys/cdefs.h>
+=
+#if !defined(__cplusplus)
+# if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 &= & \
+    (__OPTIMIZE__ > 0 || d= efined(__clang__))
+#  if _FORTIFY_SOURCE &g= t; 1
+#  define __SSP_FORTIFY_LEVEL 2
+#  else
+#  defi= ne __SSP_FORTIFY_LEVEL 1
+#  endif
=
+# else
+#  define __SSP_FO= RTIFY_LEVEL 0
+# endif
= +#else
+# define __SSP_FORTIFY_LEVEL 0
<= div dir=3D"ltr">+#endif
+
+#define    __ssp_var(type)    __CONCAT(__= ssp_ ## type, __COUNTER__)
+
+/* __ssp_real is used by the implementation in libc */
+#if __SSP_FORTIFY_LEVEL =3D=3D 0
+#= define __ssp_real_(fun)    fun
+#e= lse
+#define __ssp_real_(fun)    _= _ssp_real_ ## fun
+#endif
+#define __ssp_real(fun)        __ssp_real= _(fun)
+
+#define __ssp= _inline static __inline __attribute__((__always_inline__))
+
+#define __ssp_bos(ptr) __builtin_obj= ect_size(ptr, __SSP_FORTIFY_LEVEL > 1)
+#defin= e __ssp_bos0(ptr) __builtin_object_size(ptr, 0)
+=
+#define __ssp_check(buf, len, bos) \
<= div dir=3D"ltr">+    if (bos(buf) !=3D (size_t)-1 &&= len > bos(buf)) \
+     &= nbsp;  __chk_fail()
+#define __ssp_redirect_= raw(rtype, fun, symbol, args, call, cond, bos) \
= +rtype __ssp_real_(fun) args __RENAME(symbol); \
= +__ssp_inline rtype fun args __RENAME(__ssp_protected_ ## fun); \
=
+__ssp_inline rtype fun args { \
+    if (cond) \
+  &nb= sp;     __ssp_check(__buf, __len, bos); \
+    return __ssp_real_(fun) call; \
+}
+
+#defi= ne __ssp_redirect(rtype, fun, args, call) \
+&nbs= p;   __ssp_redirect_raw(rtype, fun, fun, args, call, 1, __ssp_bos)
=
+#define __ssp_redirect0(rtype, fun, args, call) \
+    __ssp_redirect_raw(rtype, fun, fun,= args, call, 1, __ssp_bos0)
+
+__BEGIN_DECLS
+void __stack_chk_fail(vo= id) __dead2;
+void __chk_fail(void) __dead2;
<= /div>
+__END_DECLS
+
+#endif /* _SSP_SSP_H_ */
diff --gi= t a/include/ssp/stdio.h b/include/ssp/stdio.h
new= file mode 100644
index 000000000000..72e3236eac8= 0
--- /dev/null
+++ b/i= nclude/ssp/stdio.h
@@ -0,0 +1,93 @@
+/*    $NetBSD: stdio.h,v 1.5 2011/07/17 20:54:= 34 joerg Exp $    */
+
+/*-
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2006 The NetBSD Foundation, Inc.<= br>
+ * All rights reserved.
+ *
+ * This code is derived from software cont= ributed to The NetBSD Foundation
+ * by Christos = Zoulas.
+ *
+ * Redistr= ibution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following cond= itions
+ * are met:
+ *= 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the = following disclaimer.
+ * 2. Redistributions in b= inary form must reproduce the above copyright
+ *=     notice, this list of conditions and the following disclaimer = in the
+ *    documentation and/or othe= r materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDA= TION, INC. 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.  I= N NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+= * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMI= TED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SE= RVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER = IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLU= DING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY = WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef _SSP_STDIO_H_
+= #define _SSP_STDIO_H_
+
+#include <ssp/ssp.h>
+
+__BEGIN_DECLS
+int __sprintf_chk(char *= __restrict, int, size_t, const char *__restrict, ...)
+    __printflike(4, 5);
+int __vs= printf_chk(char *__restrict, int, size_t, const char *__restrict,
=
+    __va_list)
+ = ;   __printflike(4, 0);
+int __snprintf_chk(= char *__restrict, size_t, int, size_t,
+  &n= bsp; const char *__restrict, ...)
+    = __printflike(5, 6);
+int __vsnprintf_chk(char *__= restrict, size_t, int, size_t,
+    co= nst char *__restrict, __va_list)
+    _= _printflike(5, 0);
+char *__gets_chk(char *, size= _t);
+char *__fgets_chk(char *, int, size_t, FILE= *);
+__END_DECLS
+
=
+#if __SSP_FORTIFY_LEVEL > 0
+
+#define sprintf(str, ...) ({  =   \
+    char *_ssp_str =3D (str);=     \
+    __builtin___s= printf_chk(_ssp_str, 0, __ssp_bos(_ssp_str),      =   \
+        __VA_ARGS__= ); \
+})
+
+#define vsprintf(str, fmt, ap) ({    \
+    char *_ssp_str =3D (str);  &nb= sp;     \
+    __builtin= ___vsprintf_chk(_ssp_str, 0, __ssp_bos(_ssp_str), fmt,    \<= br>
+        ap);  &nbs= p;             \
+})
+
+#de= fine snprintf(str, len, ...) ({    \
+    char *_ssp_str =3D (str);      &= nbsp; \
+    __builtin___snprintf_chk(_= ssp_str, len, 0, __ssp_bos(_ssp_str),    \
+        __VA_ARGS__);     = ;       \
+})
<= div dir=3D"ltr">+
+#define vsnprintf(str, len, fm= t, ap) ({    \
+    char= *_ssp_str =3D (str);        \
+    __builtin___vsnprintf_chk(_ssp_str, len, 0, __ss= p_bos(_ssp_str),    \
+  &nbs= p;     fmt, ap);          = ;  \
+})
+
+#define gets(str) ({      &nbs= p;     \
+  char *_ssp_str = =3D (str);        \
+    __gets_chk(_ssp_str, __ssp_bos(_ssp_str));   = ; \
+})
+
+#define fgets(str, len, fp) ({      =   \
+    char *_ssp_str =3D (str);=         \
+  &= nbsp; __fgets_chk(_ssp_str, len, __ssp_bos(_ssp_str), fp);   = ; \
+})
+
+#endif /* __SSP_FORTIFY_LEVEL > 0 */
+
+#endif /* _SSP_STDIO_H_ */
diff --git a/include/ssp/string.h b/include/ssp/string.h
new file mode 100644
index 00= 0000000000..996020fda778
--- /dev/null
<= div dir=3D"ltr">+++ b/include/ssp/string.h
@@ -0,= 0 +1,129 @@
+/*    $NetBSD: string= .h,v 1.14 2020/09/05 13:37:59 mrg Exp $    */
+
+/*-
+ *<= br>
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2006 The= NetBSD Foundation, Inc.
+ * All rights reserved.=
+ *
+ * This code is d= erived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with o= r without
+ * modification, are permitted provide= d that the following conditions
+ * are met:
<= /div>
+ * 1. Redistributions of source code must retain the= above copyright
+ *    notice, this li= st of conditions and the following disclaimer.
+ = * 2. Redistributions in binary form must reproduce the above copyright
<= /div>
+ *    notice, this list of conditions and = the following disclaimer in the
+ *    = documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROV= IDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT= LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHA= NTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOS= E ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION 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 THEO= RY 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 ADVIS= ED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef _SSP_STRING_H_
+#define _SSP_STRING_H_
= +
+#include <ssp/ssp.h>
+
+__BEGIN_DECLS
+void *__memcpy_chk(void *, const void *, size_t, size_t);
+void *__memmove_chk(void *, const void *, size_t, size_t);
+void *__memset_chk(void *, int, size_t, size_t);
+char *__stpcpy_chk(char *, const char *, size_t);=
+char *__stpncpy_chk(char *, const char *, size_= t, size_t);
+char *__strcat_chk(char *, const cha= r *, size_t);
+char *__strcpy_chk(char *, const c= har *, size_t);
+char *__strncat_chk(char *, cons= t char *, size_t, size_t);
+char *__strncpy_chk(c= har *, const char *, size_t, size_t);
+__END_DECL= S
+
+#if __SSP_FORTIFY_= LEVEL > 0
+
+#define= __ssp_bos_check3_typed_var(fun, dsttype, dsrvar, dst, srctype, srcvar, \
+    src, lenvar, len) ({  &nb= sp;             \
+    srctype srcvar =3D (src);    &n= bsp;           \
+    dsttype dstvar =3D (dst);     &= nbsp;          \
+    size_t lenvar =3D (len);      &n= bsp;         \
+&nb= sp;   ((__ssp_bos0(dstvar) !=3D (size_t)-1) ?     =    \
+    __builtin___ ## fun= ## _chk(dstvar, srcvar, lenvar,    \
+        __ssp_bos0(dstvar)) :    &n= bsp;           \
+    __ ## fun ## _ichk(dstvar, srcvar, lenvar)); &= nbsp;  \
+})
+
=
+#define __ssp_bos_check3_typed(fun, dsttype, dst, s= rctype, src, len)    \
+  &nb= sp; __ssp_bos_check3_typed_var(fun, dsttype, __ssp_var(dstv), dst, &nb= sp;  \
+        srctype,= __ssp_var(srcv), src, __ssp_var(lenv), len)
+
+#define __ssp_bos_check3(fun, dst, src, len) =        \
+    = __ssp_bos_check3_typed_var(fun, void *, __ssp_var(dstv), dst,  &n= bsp; \
+        const void *,= __ssp_var(srcv), src, __ssp_var(lenv), len)
+
+#define __ssp_bos_check2_var(fun, dstvar, dst, src= var, src) ({        \
+    const void *srcvar =3D (src);     &nb= sp;          \
+    void *dstvar =3D (dst);       = ;         \
+ =   ((__ssp_bos0(dstvar) !=3D (size_t)-1) ?     &nb= sp;  \
+    __builtin___ ## fun ##= _chk(dstvar, srcvar,        \
+        __ssp_bos0(dstvar)) :  &= nbsp;             \
<= div dir=3D"ltr">+    __ ## fun ## _ichk(dstvar, srcvar)); &n= bsp;      \
+})
+
+#define __ssp_bos_check2(fun, dst= , src)            \
<= div dir=3D"ltr">+    __ssp_bos_check2_var(fun, __ssp_var(dstv), d= st, __ssp_var(srcv), src)
+
+#define __ssp_bos_icheck3_restrict(fun, type1, type2) \
+static __inline type1 __ ## fun ## _ichk(type1 __restrict, ty= pe2 __restrict, size_t); \
+static __inline __att= ribute__((__always_inline__)) type1 \
+__ ## fun = ## _ichk(type1 __restrict dst, type2 __restrict src, size_t len) { \
+    return __builtin___ ## fun ## _chk(= dst, src, len, __ssp_bos0(dst)); \
+}
+
+#define __ssp_bos_icheck3(fun, = type1, type2) \
+static __inline type1 __ ## fun = ## _ichk(type1, type2, size_t); \
+static __inlin= e __attribute__((__always_inline__)) type1 \
+__ = ## fun ## _ichk(type1 dst, type2 src, size_t len) { \
+    return __builtin___ ## fun ## _chk(dst, src, len, = __ssp_bos0(dst)); \
+}
= +
+#define __ssp_bos_icheck2_restrict(fun, type1,= type2) \
+static __inline type1 __ ## fun ## _ic= hk(type1, type2); \
+static __inline __attribute_= _((__always_inline__)) type1 \
+__ ## fun ## _ich= k(type1 __restrict dst, type2 __restrict src) { \
+    return __builtin___ ## fun ## _chk(dst, src, __ssp_bos= 0(dst)); \
+}
+
+__BEGIN_DECLS
+__ssp_bos_iche= ck3_restrict(memcpy, void *, const void *)
+__ssp= _bos_icheck3(memmove, void *, const void *)
+__ss= p_bos_icheck3(memset, void *, int)
+__ssp_bos_ich= eck2_restrict(stpcpy, char *, const char *)
+__ss= p_bos_icheck3_restrict(stpncpy, char *, const char *)
+__ssp_bos_icheck2_restrict(strcpy, char *, const char *)
+__ssp_bos_icheck2_restrict(strcat, char *, const char *)
=
+__ssp_bos_icheck3_restrict(strncpy, char *, const c= har *)
+__ssp_bos_icheck3_restrict(strncat, char = *, const char *)
+__END_DECLS
+
+#define memcpy(dst, src, len) __ssp_b= os_check3(memcpy, dst, src, len)
+#define memmove= (dst, src, len) __ssp_bos_check3(memmove, dst, src, len)
+#define memset(dst, val, len) \
+ =   __ssp_bos_check3_typed(memset, void *, dst, int, val, len)
+#define stpcpy(dst, src) __ssp_bos_check2(stpcpy, dst, s= rc)
+#define stpncpy(dst, src, len) __ssp_bos_che= ck3(stpncpy, dst, src, len)
+#define strcpy(dst, = src) __ssp_bos_check2(strcpy, dst, src)
+#define = strcat(dst, src) __ssp_bos_check2(strcat, dst, src)
+#define strncpy(dst, src, len) __ssp_bos_check3(strncpy, dst, src, len)=
+#define strncat(dst, src, len) __ssp_bos_check3= (strncat, dst, src, len)
+
+#endif /* __SSP_FORTIFY_LEVEL > 0 */
+#en= dif /* _SSP_STRING_H_ */
diff --git a/include/ssp= /strings.h b/include/ssp/strings.h
new file mode = 100644
index 000000000000..06c9c7cc0a09
=
--- /dev/null
+++ b/include/ssp/= strings.h
@@ -0,0 +1,67 @@
+/*    $NetBSD: strings.h,v 1.3 2008/04/28 20:22:54 mart= in Exp $    */
+
+/*-
+ *
+ * S= PDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *<= br>
+ * This code is derived from software contribute= d to The NetBSD Foundation
+ * by Christos Zoulas= .
+ *
+ * Redistributio= n and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions=
+ * are met:
+ * 1. Re= distributions of source code must retain the above copyright
+ *    notice, this list of conditions and the follow= ing 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 mate= rials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, = INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRE= SS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PAR= TICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO E= VENT SHALL THE FOUNDATION 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 N= EGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OU= T OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef _SSP_STRINGS_H_
+#def= ine _SSP_STRINGS_H_
+
+= #include <ssp/ssp.h>
+#include <string.h= >
+
+#if __SSP_FORTI= FY_LEVEL > 0
+
+#def= ine _ssp_bcopy(srcvar, src, dstvar, dst, lenvar,  len) ({  &= nbsp; \
+    const void *srcvar =3D (sr= c);            \
+    void *dstvar =3D (dst);     = ;       \
+   = size_t lenvar =3D (len);          =   \
+    ((__ssp_bos0(dstvar) !=3D= (size_t)-1) ?    \
+   = __builtin___memmove_chk(dstvar, srcvar, lenvar,    \
+        __ssp_bos0(dstvar)) : = ;           \
+    __memmove_ichk(dstvar, srcvar, lenvar));  &nb= sp; \
+})
+
+#define    bcopy(src, dst, len)  &= nbsp;         \
+&n= bsp;   _ssp_bcopy(__ssp_var(srcv), src, __ssp_var(dstv), dst, __ssp_va= r(lenv), len)
+
+#defin= e _ssp_bzero(dstvar, dst, lenvar, len) ({      &nb= sp; \
+    void *dstvar =3D (dst); = ;           \
+    size_t lenvar =3D (len);      =       \
+    ((__ss= p_bos0(dstvar) !=3D (size_t)-1) ?    \
+    __builtin___memset_chk(dstvar, 0, lenvar,  &n= bsp; \
+        __ssp_bos0(ds= tvar)) : \
+    __memset_ichk(dstvar, 0= , lenvar));        \
+})
+
+#define &= nbsp;  bzero(dst, len)    _ssp_bzero(__ssp_var(dstv), d= st, __ssp_var(lenv), len)
+
+#endif /* __SSP_FORTIFY_LEVEL > 0 */
+#e= ndif /* _SSP_STRINGS_H_ */
diff --git a/include/s= sp/unistd.h b/include/ssp/unistd.h
new file mode = 100644
index 000000000000..2414e2baa96b
=
--- /dev/null
+++ b/include/ssp/= unistd.h
@@ -0,0 +1,54 @@
+/*    $NetBSD: unistd.h,v 1.7 2015/06/25 18:41:03 joerg = Exp $    */
+
+/*-
+ *
+ * SPDX= -License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2006 The NetBSD Foundation, Inc.
=
+ * All rights reserved.
+ *
=
+ * This code is derived from software contributed t= o The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution a= nd use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redis= tributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following= disclaimer.
+ * 2. Redistributions in binary for= m must reproduce the above copyright
+ *  &n= bsp; notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materia= ls provided with the distribution.
+ *
<= div dir=3D"ltr">+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC= . AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS = OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTIC= ULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVEN= T SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIA= BLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
<= div dir=3D"ltr">+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, P= ROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; L= OSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INT= ERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGL= IGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT O= F THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
<= div dir=3D"ltr">+#ifndef _SSP_UNISTD_H_
+#define = _SSP_UNISTD_H_
+
+#incl= ude <ssp/ssp.h>
+
+#if __SSP_FORTIFY_LEVEL > 0
+__BEGIN_DECLS
+
+__ssp_redirect0(ssize= _t, read, (int __fd, void *__buf, size_t __len), \
+    (__fd, __buf, __len));
+
+__ssp_redirect(ssize_t, readlink, (const char *__restri= ct __path, \
+    char *__restrict __bu= f, size_t __len), (__path, __buf, __len));
+
<= /div>
+__ssp_redirect_raw(char *, getcwd, getcwd, (char *__= buf, size_t __len),
+    (__buf, __len)= , __buf !=3D 0, __ssp_bos);
+
+__END_DECLS
+
+#endif /* __SSP_FORTIFY_LEVEL > 0 */
+#endif= /* _SSP_UNISTD_H_ */
diff --git a/lib/libc/secur= e/Makefile.inc b/lib/libc/secure/Makefile.inc
ind= ex 8574c5a05dc5..3b1ad879c715 100644
--- a/lib/li= bc/secure/Makefile.inc
+++ b/lib/libc/secure/Make= file.inc
@@ -3,6 +3,17 @@

.PATH: ${LIBC_SRCTOP}/secure

+# _FORTIFY_SOURCE
+SRCS+=3D    gets_chk.c fgets_chk.c memcpy_chk.c m= emmove_chk.c memset_chk.c \
+    s= nprintf_chk.c sprintf_chk.c stpcpy_chk.c stpncpy_chk.c \
+    strcat_chk.c strcpy_chk.c strncat_chk.c strncp= y_chk.c \
+    vsnprintf_chk.c vsp= rintf_chk.c
+
+CFLAGS.s= nprintf_chk.c+=3D    -Wno-unused-parameter
+CFLAGS.sprintf_chk.c+=3D    -Wno-unused-parameter<= br>
+CFLAGS.vsnprintf_chk.c+=3D    -Wn= o-unused-parameter
+CFLAGS.vsprintf_chk.c+=3D&nbs= p;   -Wno-unused-parameter
+
<= div dir=3D"ltr"> # Sources common to both syscall interfaces:
SRCS+=3D    stack_protector.c \
    stack_protector_compat.c
diff --git a/lib/libc/secure/Symbol.map b/lib/libc/secure/Symbol.m= ap
index 641f451b5421..7859fcee3821 100644
--- a/lib/libc/secure/Symbol.map
+++ b/lib/libc/secure/Symbol.map
@@ -3,3 +3,2= 1 @@ FBSD_1.0 {
    __stack_chk_f= ail;
    __stack_chk_guard;
};
+
+FBSD_1.8 {
+    __gets_chk;
+    __fgets_chk;
+    __memcpy_chk;
+ = ;   __memmove_chk;
+    = __memset_chk;
+    __snprintf_chk;=
+    __sprintf_chk;
+    __stpcpy_chk;
+&= nbsp;   __stpncpy_chk;
+  &nb= sp; __strcat_chk;
+    __strcpy_ch= k;
+    __strncat_chk;
+    __strncpy_chk;
+    __vsnprintf_chk;
+ &nbs= p;  __vsprintf_chk;
+};
diff --git a/lib/libc/secure/fgets_chk.c b/lib/libc/secure/fgets_chk.= c
new file mode 100644
= index 000000000000..72aa1d816ce1
--- /dev/null
+++ b/lib/libc/secure/fgets_chk.c
@@ -0,0 +1,54 @@
+/*-
+ *
+ * SPDX-License-Identifier: BSD-2-C= lause
+ *
+ * Copyright= (c) 2006 The NetBSD Foundation, Inc.
+ * All rig= hts reserved.
+ *
+ * T= his code is derived from software contributed to The NetBSD Foundation
<= /div>
+ * by Christos Zoulas.
+ *=
+ * Redistribution and use in source and binary = forms, with or without
+ * modification, are perm= itted provided that the following conditions
+ * = are met:
+ * 1. Redistributions of source code mu= st retain the above copyright
+ *    no= tice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above c= opyright
+ *    notice, this list of co= nditions and the following disclaimer in the
+ *&= nbsp;   documentation and/or other materials provided with the distrib= ution.
+ *
+ * THIS SOF= TWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
=
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLU= DING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANT= IES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CO= NTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT= , INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUE= NTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS= ; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AN= D ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONT= RACT, 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 DA= MAGE.
+ */
+#include &l= t;sys/cdefs.h>
+__RCSID("$NetBSD: fgets_chk.c,= v 1.6 2009/02/05 05:41:51 lukem Exp $");
+
+#include <limits.h>
+#= include <stdio.h>
+#include <stdlib.h>= ;
+#include <string.h>
+
+#include <ssp/stdio.h>
+#include <ssp/string.h>
+#u= ndef fgets
+
+char *
+__fgets_chk(char * __restrict buf, int len, size_t= slen, FILE *fp)
+{
+&n= bsp;   if (slen >=3D (size_t)INT_MAX)
+        return (fgets(buf, len, fp));
<= /div>
+
+    if (l= en >=3D 0 && (size_t)len > slen)
+&= nbsp;       __chk_fail();
+
+    return (fgets(buf, len, f= p));
+}
diff --git a/li= b/libc/secure/gets_chk.c b/lib/libc/secure/gets_chk.c
new file mode 100644
index 000000000000..18c= 1e2d18f43
--- /dev/null
+++ b/lib/libc/secure/gets_chk.c
@@ -0,0 +1,74 @= @
+/*-
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2006 The NetBSD Fo= undation, Inc.
+ * All rights reserved.
=
+ *
+ * This code is derived fro= m software contributed to The NetBSD Foundation
+= * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without<= br>
+ * modification, are permitted provided that the= following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above cop= yright
+ *    notice, this list of cond= itions and the following disclaimer.
+ * 2. Redis= tributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the follow= ing disclaimer in the
+ *    documentat= ion and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY TH= E NETBSD FOUNDATION, INC. 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 DISC= LAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, = EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDIN= G, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTIT= UTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
=
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIAB= ILITY, 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<= br>
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: gets_chk.c,v 1.7 2013/10/04 20:49:1= 6 christos Exp $");
+
+= #include <limits.h>
+#include <stdio.h&g= t;
+#include <stdlib.h>
+#include <string.h>
+
+#include <ssp/stdio.h>
+#in= clude <ssp/string.h>
+
+char *__gets_unsafe(char *);
+
+char *
+__gets_chk(char * __restr= ict buf, size_t slen)
+{
+    char *abuf;
+  &n= bsp; size_t len;
+
+&nb= sp;   if (slen >=3D (size_t)INT_MAX)
+        return (__gets_unsafe(buf));
+
+    if ((ab= uf =3D malloc(slen + 1)) =3D=3D NULL)
+ &nbs= p;      return (__gets_unsafe(buf));
+
+    if (fgets(abuf, (i= nt)(slen + 1), stdin) =3D=3D NULL) {
+  = ;      free(abuf);
+ &nb= sp;      return (NULL);
+&nbs= p;   }
+
+&nb= sp;   len =3D strlen(abuf);
+ &nbs= p;  if (len > 0 && abuf[len - 1] =3D=3D '\n')
+        --len;
+
+    if (len >=3D s= len)
+        __chk= _fail();
+
+  = ;  (void)memcpy(buf, abuf, len);
+
=
+    buf[len] =3D '\0';
+    free(abuf);
+ &= nbsp;  return (buf);
+}
diff --git a/lib/libc/secure/memcpy_chk.c b/lib/libc/secure/memcpy_ch= k.c
new file mode 100644
index 000000000000..99cf2d5f13ff
--- /dev/null<= br>
+++ b/lib/libc/secure/memcpy_chk.c
@@ -0,0 +1,53 @@
+/*-
+ *
+ * SPDX-License-Identifier: BSD-2= -Clause
+ *
+ * Copyrig= ht (c) 2006 The NetBSD Foundation, Inc.
+ * All r= ights reserved.
+ *
+ *= This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+= *
+ * Redistribution and use in source and binar= y forms, with or without
+ * modification, are pe= rmitted 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 distr= ibution.
+ *
+ * THIS S= OFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INC= LUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRA= NTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR = CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRE= CT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQ= UENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFI= TS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED = AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CO= NTRACT, 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 = <sys/cdefs.h>
+__RCSID("$NetBSD: memcpy_chk= .c,v 1.7 2015/05/13 19:57:16 joerg Exp $");
+
=
+#include <string.h>
+
+#include <ssp/string.h>
+#undef memcpy
+
+#include "ssp_internal.h"
+
+void *
+__memcpy_chk(void * __restric= t dst, const void * __restrict src, size_t len,
+=     size_t slen)
+{
+    if (len > slen)
+=         __chk_fail();
+
+    if (__ssp_overlap((const= char *)src, (const char *)dst, len))
+ &nbs= p;      __chk_fail();
+
+    return (memcpy(dst, src, len));
+}
diff --git a/lib/libc/= secure/memmove_chk.c b/lib/libc/secure/memmove_chk.c
new file mode 100644
index 000000000000..07f9= 65d608fc
--- /dev/null
= +++ b/lib/libc/secure/memmove_chk.c
@@ -0,0 +1,47= @@
+/*-
+ *
<= div dir=3D"ltr">+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2006 The NetBSD Fo= undation, Inc.
+ * All rights reserved.
=
+ *
+ * This code is derived fro= m software contributed to The NetBSD Foundation
+= * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without<= br>
+ * modification, are permitted provided that the= following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above cop= yright
+ *    notice, this list of cond= itions and the following disclaimer.
+ * 2. Redis= tributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the follow= ing disclaimer in the
+ *    documentat= ion and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY TH= E NETBSD FOUNDATION, INC. 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 DISC= LAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, = EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDIN= G, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTIT= UTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
=
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIAB= ILITY, 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<= br>
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: memmove_chk.c,v 1.6 2020/09/05 13:3= 7:59 mrg Exp $");
+
+#i= nclude <string.h>
+
+#include <ssp/string.h>
+#undef memmove=
+
+void *
+__memmove_chk(void *dst, const void *src, size_t len,
+    size_t slen)
+= {
+    if (len > slen)
+        __chk_fail();
<= /div>
+    return (memmove(dst, src, len));<= br>
+}
diff --git a/lib/lib= c/secure/memset_chk.c b/lib/libc/secure/memset_chk.c
new file mode 100644
index 000000000000..f337= be98b46d
--- /dev/null
= +++ b/lib/libc/secure/memset_chk.c
@@ -0,0 +1,46 = @@
+/*-
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2006 The NetBSD Fo= undation, Inc.
+ * All rights reserved.
=
+ *
+ * This code is derived fro= m software contributed to The NetBSD Foundation
+= * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without<= br>
+ * modification, are permitted provided that the= following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above cop= yright
+ *    notice, this list of cond= itions and the following disclaimer.
+ * 2. Redis= tributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the follow= ing disclaimer in the
+ *    documentat= ion and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY TH= E NETBSD FOUNDATION, INC. 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 DISC= LAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, = EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDIN= G, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTIT= UTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
=
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIAB= ILITY, 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<= br>
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: memset_chk.c,v 1.5 2014/09/17 00:39= :28 joerg Exp $");
+
+#= include <string.h>
+
+#include <ssp/string.h>
+#undef memset=
+
+void *
+__memset_chk(void * __restrict dst, int val, size_t len, siz= e_t slen)
+{
+ &nb= sp;  if (len > slen)
+    =     __chk_fail();
+  &nb= sp; return (memset(dst, val, len));
+}
<= div dir=3D"ltr">diff --git a/lib/libc/secure/snprintf_chk.c b/lib/libc/secu= re/snprintf_chk.c
new file mode 100644
<= div dir=3D"ltr">index 000000000000..52ef874ede5b
= --- /dev/null
+++ b/lib/libc/secure/snprintf_chk.= c
@@ -0,0 +1,56 @@
+/*-=
+ *
+ * SPDX-License-I= dentifier: BSD-2-Clause
+ *
+ * Copyright (c) 2006 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The Ne= tBSD Foundation
+ * by Christos Zoulas.
=
+ *
+ * Redistribution and use i= n source and binary forms, with or without
+ * mo= dification, are permitted provided that the following conditions
<= div dir=3D"ltr">+ * are met:
+ * 1. Redistributio= ns of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclai= mer.
+ * 2. Redistributions in binary form must r= eproduce the above copyright
+ *    not= ice, this list of conditions and the following disclaimer in the
<= div dir=3D"ltr">+ *    documentation and/or other materials provi= ded with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND C= ONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPL= IED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO= , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL= THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR= ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREM= ENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF = USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTI= ON) 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 U= SE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * P= OSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("= $NetBSD: snprintf_chk.c,v 1.5 2008/04/28 20:23:00 martin Exp $");
=
+
+#include <stdarg.h>
=
+#include <stdio.h>
= +
+#include <ssp/stdio.h>
+#undef vsnprintf
+
+int
+__snprintf_chk(char * __restrict buf,= size_t len, int flags, size_t slen,
+  &nbs= p; const char * __restrict fmt, ...)
+{
=
+    va_list ap;
= +    int rv;
+
+    if (len > slen)
+=         __chk_fail();
+
+    va_start(ap, fmt);
+    rv =3D vsnprintf(buf, len, fmt, ap= );
+    va_end(ap);
+
+    return (rv);
+}
diff --git a/lib/libc/= secure/sprintf_chk.c b/lib/libc/secure/sprintf_chk.c
new file mode 100644
index 000000000000..d4c4= 2ccba3ce
--- /dev/null
= +++ b/lib/libc/secure/sprintf_chk.c
@@ -0,0 +1,61= @@
+/*-
+ *
<= div dir=3D"ltr">+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2006 The NetBSD Fo= undation, Inc.
+ * All rights reserved.
=
+ *
+ * This code is derived fro= m software contributed to The NetBSD Foundation
*= ** 1063 LINES SKIPPED ***
------=_Part_1587021_1250298158.1716057759643-- From nobody Sat May 18 19:07:15 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VhYHD3mXVz5LJtN for ; Sat, 18 May 2024 19:07:20 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from sonic306-21.consmr.mail.ne1.yahoo.com (sonic306-21.consmr.mail.ne1.yahoo.com [66.163.189.83]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4VhYHC55Ppz4fcL for ; Sat, 18 May 2024 19:07:19 +0000 (UTC) (envelope-from pfg@freebsd.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=tGHCvJJe; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=freebsd.org (policy=none); spf=softfail (mx1.freebsd.org: 66.163.189.83 is neither permitted nor denied by domain of pfg@freebsd.org) smtp.mailfrom=pfg@freebsd.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1716059237; bh=LlUkLWlQzfzvkfwv2qpoRfYG7dgk+WxRJeb9Dnv6Nsg=; h=Date:From:To:In-Reply-To:References:Subject:From:Subject:Reply-To; b=tGHCvJJeGcz7XuOUOv+K9Ir6E+mZguW8vWJW+I6Chne6aTgWwb6ed83geQkXXP0ePyJxIQp793GtZ+dPvr0A2jeEig4kZyLt0KJwYtUUPUMwOJbVZshwe+YGRT+p/APhqV1Inizg6IKgSAQsTINa4YfBaEMEVMWipHhXrZ7jD8mphn84e8ooRdJ0Wv0ZNxVo5o+OrLz7O1xXnjXOIWRTSjxzgkyKsjHpTNOAyhNSZtn53IGgSWmavJ5Pn7kOtmYuXrVXPdVVp+nvFzx89ggmynrAQN4QD5bsIb4wMcsVoEm4G9n6nCA1R4hEo2dT7RtWqLhrlm5ZrUg+WZ+OT2Vtcg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1716059237; bh=DP+ihhaki9RGPUm6TcgfROCvFW8q5/d0BUl0JLO7PjO=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=aqKbq5MRhVN0hOgYDBCQX5bNcSwQqqfCanh/lsWsP/3lLCrrCC4b743zt6vGWZIV02hmlS4cXvHAGzrUi0RCmPfb1x6nqEROf2BRCTrsfw9ssM9btTHt+sqb2jbNV6+25FSuRaV3ozsNq1YYHvtv9vsivvU9zXjt7bsj5CvqQ77J9FpoHCg33iKWc3GMZ9X7UpCWDyszH+8ovCicE7RRF6iMiSZQsL0hVI6BdACWgWjZyJSNJMsHofYmmWkOFk7HAQyfZtzm3CDzhLtAVClzzqcTLOS0d/m9a8ZJIaTCmeDh9Ze61QRRtFl20NhhWMXmXOFC0eo15d9M+WS03QAjrg== X-YMail-OSG: UBPig9cVM1lQlvXCCcJojDXEso0GlJlH39Pm8tjhZC11pG6pv2JSWh0cPa9c234 QuT9k9ab6rmkc4ks4V_25J.ZJJGF0N1omqcRMItXX1XNnf_Tlr01ZCuCMafNo4TxcIPdlUHtueQX 5TURaUcF2LWBJt7queZiY9Z_a5JOVbtmas_JWl025VJOdnTXRc9WiAwAUIav8PvIC_ker_I1uoGm kiMOPr2D8XkKkHhYQd8yGTFRIWBRWPPvI.Nns9RbX_tYqLHNGQIbnQRRZaaiQsz7w1bNoS21yIxo xZASNJfzrlo3ItLwirRautN8hLSu5yu3ZeQ4TesFf5o.tKnKtLi1E7Uhw5Rw.Ey2q0r1L.g5ZMLP QOF.S7BQQhViZ3IzHwr9G6llJHavUU9eui0Rjw9AkqMR6Uc0UFkmpox5X8yFTcor7XgmAMFiAUgh wKACxafSeLNWvCP_9VRaLRRJMCcEHmwXDojpFgodZ6DgeKz7EjdvWvdnLv4EClEq9Xt5r.899XOk .Mf4m0v8qFErYGuJbEPOgBwD_eaDtC_ZBM4Rz6MvO.uogCmXgMIgJ3O5T6KabzYClDfvyHq2h7Jr 25YQp9jB6GSPZjc0ksuWE3kIDbrJPmFjIH_rbkX5OMfb50Hsl.4sFEDrI2uRgE2nAPmFxStwfrWf iQ8x6FVPJRJjVtu9IwSyB7lcduONw30nZE_reuhOGlH320gpfZ8mwV..odvJV7qYj6TM9CKgGIQp qcs7ouIg3s0XDQAeyHe9nJVK9nfWc.cE.8GFr1HmlToDxAKgruYZYIQXhz2eWBow.Jb3APrtg.e2 73qyNw647DrWWX2CuaosbHMKeZH.rZ4hU6fGIMqSafd1uK2inFrvQxp_DkAwXLk.XTiPCDqk3AVH EnNj8Uusn9Pj7Z6BBfJOv8JO9mU5VtMLRTcbk4VfoJGwwnVujhjgUKQrzzdf9qfwOO5TsmNK7SoL e1R_zyhpzndesFcxB515yKxTuSR.2wvucMEuOaVEfvX2GiRl1cb2iQjTLMuF0dRL5wwtTzkOYuu1 SrY4vZceVJ68ZIrKEAzL1YyStvOLUl24DHew9k55hf74vOravU9gdefw3M5RaeSW48q7qUAZHA6p tZyFcME0zCpJWxKELoCVQFDfr731ttkEnXj1dW9AaW6oOaegorBXQx_MgmIXWPAswfRSPH1EGg1G zzpSnm1gB70lkuuSaANj2mLPFmLzGzuUT7LHo9GzwEabplWjngjBBNorllGrIcfB5EuP8BJ9KbjO eC2tAAgBgigauMAUS8FE9hPMcpv.iXRQHxNz7vzbypjMwBXeVmd.VAksA9tyu_WlaWnTrWtSd_q8 YktRsh37p3tRYuOHLcKiDjaHr67COFnEekoEeKNOFTVDEbbD0e9EbHn_x3.UOxh.wOATDk_PnAIT y17uLr2OW7arLquwtEXQFqgYd7BuJ50VHMVNbzp.gvAio36DZ4OAE_kfbLns4vcKchBWOrJcwY_t VxHg8C6znhn4Wk0L_Vq2X604zCZ53_VPQzMDpVdE6o9qCYA2dv3tqKz8uZUJfITbCxmZvCB4rNZ3 NX2iVVf1uvk1dI75Xtox87Hs._NwBUkjTxQzNeq.1kCmOWnI9wERJh.vUxOmnaq8pKLqq4Rne5DO wgOi9Otk1_KXIRcMHfJKgFJrJBB576KTFUtLpokuTK6yPGWm8oYY0OAW43btIqgRl3sse_34RpIZ 1m_jOu0uOddadAmr1nUqsY6QMmbBdkJG1.zcj1EXouPVs_HFyB.KOyMyawAd.HrhcIwvPA9_KYXw AQTephb22sj3CwhmHdsthnIRHM6SBHmss2TdAZUxJv.6nsRM8weP0qzD.Du62YqHRjdf6uMia7T9 G5pJqNUhtdGE9hGg8aimW4yRFh0pyt3u0OEwXTuuDsyUfVXCOfOrWtRO.bDzQ4l4E8VxNkmpI0W2 Z2N1jdAnkImMUoxehUVhF623DCz8mT.VOg4RPSm4mrpgdeUC.BHAGxfLdlTelaWjk4QUxaIe.YFY QnCi8smgsOJBE5BB6tkPl2ma_eRwgi.TqFolTxSHGjAHYcO4UeVUk8PRlwjUjmfoVnfh3FKYeT_0 V0w2X3YXBJP5ExlIgtFrnmBbQQWdt4VPQwJ1wEzhW.BvIcYWGMCBnJYNMyIbMUaCLExsF4qg4waq V1PZNVqUcpzU8J8g6lw-- X-Sonic-MF: X-Sonic-ID: 80156c6e-32d3-4ee3-aa4d-a8d629db0564 Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ne1.yahoo.com with HTTP; Sat, 18 May 2024 19:07:17 +0000 Date: Sat, 18 May 2024 19:07:15 +0000 (UTC) From: Pedro Giffuni To: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" , Kyle Evans Message-ID: <220172210.1591640.1716059235914@mail.yahoo.com> In-Reply-To: <202405130524.44D5OBT1084367@gitrepo.freebsd.org> References: <202405130524.44D5OBT1084367@gitrepo.freebsd.org> Subject: Re: git: 9bfd3b4076a7 - main - Add a build knob for _FORTIFY_SOURCE List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1591639_634665037.1716059235908" X-Mailer: WebService/1.1.22356 YMailNorrin X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.20 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : No valid SPF, DKIM not aligned (relaxed),none]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; ASN(0.00)[asn:36646, ipnet:66.163.184.0/21, country:US]; FREEFALL_USER(0.00)[pfg]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_COUNT_ONE(0.00)[1]; TO_DN_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[66.163.189.83:from]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[66.163.189.83:from]; R_SPF_SOFTFAIL(0.00)[~all]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org]; DKIM_TRACE(0.00)[yahoo.com:+] X-Rspamd-Queue-Id: 4VhYHC55Ppz4fcL ------=_Part_1591639_634665037.1716059235908 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sorry for noticing so late ... I was unaware this was being worked on and = =C2=A0I was very busy with since my dad passed away recently. The static checker component of Fortify source only works well on GCC, for = clang this lacks the support that was added by Google on Android's libc (wh= ich is not bery useful either). We already had some stubs for the ssp functions but we never used them and = this just adds bloat to our libc. I suggest reverting. Again sorry. Pedro. On Monday, May 13, 2024 at 12:24:16 AM GMT-5, Kyle Evans wrote: =20 =20 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=3D9bfd3b4076a7b0dfd27ab22318e5= 113dc84fea28 commit 9bfd3b4076a7b0dfd27ab22318e5113dc84fea28 Author:=C2=A0 =C2=A0 Kyle Evans AuthorDate: 2024-05-13 05:23:50 +0000 Commit:=C2=A0 =C2=A0 Kyle Evans CommitDate: 2024-05-13 05:23:50 +0000 =C2=A0 =C2=A0 Add a build knob for _FORTIFY_SOURCE =C2=A0 =C2=A0=20 =C2=A0 =C2=A0 In the future, we will Default to _FORTIFY_SOURCE=3D2 if SSP = is enabled, =C2=A0 =C2=A0 otherwise default to _FORTIFY_SOURCE=3D0.=C2=A0 For now we de= fault it to 0 =C2=A0 =C2=A0 unconditionally to ease bisect across older versions without = the new =C2=A0 =C2=A0 symbols, and we'll put out a call for testing. =C2=A0 =C2=A0=20 =C2=A0 =C2=A0 include/*.h include their ssp/*.h equivalents as needed based= on the =C2=A0 =C2=A0 knob. Programs and users are allowed to override FORTIFY_SOUR= CE in their =C2=A0 =C2=A0 Makefiles or src.conf/make.conf to force it off. =C2=A0 =C2=A0=20 =C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 des, markj =C2=A0 =C2=A0 Relnotes:=C2=A0 =C2=A0 =C2=A0 yes =C2=A0 =C2=A0 Sponsored by:=C2=A0 Stormshield =C2=A0 =C2=A0 Sponsored by:=C2=A0 Klara, Inc. =C2=A0 =C2=A0 Differential Revision:=C2=A0 https://reviews.freebsd.org/D323= 08 --- include/stdio.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |= =C2=A0 3 ++ include/string.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |= =C2=A0 3 ++ include/strings.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 = 3 ++ include/unistd.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |= =C2=A0 4 +++ lib/libthr/Makefile=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 3 ++ libexec/rtld-elf/Makefile=C2=A0 =C2=A0 =C2=A0 |=C2=A0 4 +++ share/man/man7/security.7=C2=A0 =C2=A0 =C2=A0 | 75 +++++++++++++++++++++++= ++++++++++++++++++ share/mk/bsd.sys.mk=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 7 +++= + tools/build/options/WITHOUT_SSP |=C2=A0 3 ++ tools/build/options/WITH_SSP=C2=A0 =C2=A0 |=C2=A0 3 ++ 10 files changed, 108 insertions(+) diff --git a/include/stdio.h b/include/stdio.h index fe7a6f7d6f82..30bc638082d8 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -530,4 +530,7 @@ extern int __isthreaded; __END_DECLS __NULLABILITY_PRAGMA_POP =20 +#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 +#include +#endif #endif /* !_STDIO_H_ */ diff --git a/include/string.h b/include/string.h index 597308020cdb..a595f6e3e260 100644 --- a/include/string.h +++ b/include/string.h @@ -168,4 +168,7 @@ errno_t memset_s(void *, rsize_t, int, rsize_t); #endif /* __EXT1_VISIBLE */ __END_DECLS =20 +#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 +#include +#endif #endif /* _STRING_H_ */ diff --git a/include/strings.h b/include/strings.h index fde007186e04..6fe6a09e7dd3 100644 --- a/include/strings.h +++ b/include/strings.h @@ -68,4 +68,7 @@ int=C2=A0=C2=A0=C2=A0 strncasecmp(const char *, const cha= r *, size_t) __pure; #endif __END_DECLS =20 +#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 +#include +#endif #endif /* _STRINGS_H_ */ diff --git a/include/unistd.h b/include/unistd.h index e4e5c62fbb67..59738cbf6e68 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -37,6 +37,10 @@ #include #include =20 +#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 +#include +#endif + #ifndef _GID_T_DECLARED typedef=C2=A0=C2=A0=C2=A0 __gid_t=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 gid= _t; #define=C2=A0=C2=A0=C2=A0 _GID_T_DECLARED diff --git a/lib/libthr/Makefile b/lib/libthr/Makefile index a5bf5da44170..85c028f521a1 100644 --- a/lib/libthr/Makefile +++ b/lib/libthr/Makefile @@ -11,6 +11,9 @@ LDFLAGS+=3D=C2=A0=C2=A0=C2=A0 -Wl,--rpath=3D/usr/lib${COM= PAT_libcompat} =20 .include MK_SSP=3D=C2=A0=C2=A0=C2=A0 no +# SSP forced off already implies FORTIFY_SOURCE=3D0, but we must make sure= that +# one cannot turn it back on. +FORTIFY_SOURCE=3D=C2=A0=C2=A0=C2=A0 0 =20 LIB=3Dthr SHLIB_MAJOR=3D 3 diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile index 37c3840538d5..864448ad782a 100644 --- a/libexec/rtld-elf/Makefile +++ b/libexec/rtld-elf/Makefile @@ -15,6 +15,10 @@ MK_UBSAN=3D=C2=A0=C2=A0=C2=A0 no =20 .include =20 +# SSP forced off already implies FORTIFY_SOURCE=3D0, but we must make sure= that +# one cannot turn it back on. +FORTIFY_SOURCE=3D=C2=A0=C2=A0=C2=A0 0 + .if !defined(NEED_COMPAT) CONFS=3D=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 libmap.conf .endif diff --git a/share/man/man7/security.7 b/share/man/man7/security.7 index ccbeeb4575ce..2e690e35d534 100644 --- a/share/man/man7/security.7 +++ b/share/man/man7/security.7 @@ -939,6 +939,81 @@ option that SSH allows in its .Pa authorized_keys file to make the key only usable to entities logging in from specific machines. +.Sh STACK OVERFLOW PROTECTION +.Fx +supports stack overflow protection using the Stack Smashing Protector +.Pq SSP +compiler feature. +In userland, SSP adds a per-process randomized canary at the end of every = stack +frame which is checked for corruption upon return from the function. +In the kernel, a single randomized canary is used globally except on aarch= 64, +which has a +.Dv PERTHREAD_SSP +.Xr config 8 +option to enable per-thread randomized canaries. +If stack corruption is detected, then the process aborts to avoid potentia= lly +malicious execution as a result of the corruption. +SSP may be enabled or disabled when building +.Fx +base with the +.Xr src.conf 5 +SSP knob. +.Pp +When +.Va WITH_SSP +is enabled, which is the default, world is built with the +.Fl fstack-protector-strong +compiler option. +The kernel is built with the +.Fl fstack-protector +option. +.Pp +In addition to SSP, a +.Dq FORTIFY_SOURCE +implementation is supported up to level 2 by defining +.Va _FORTIFY_SOURCE +to +.Dv 1 +or +.Dv 2 +before including any +.Fx +headers. +.Fx +world builds can set +.Va FORTIFY_SOURCE +to provide a default value for +.Va _FORTIFY_SOURCE . +When enabled, +.Dq FORTIFY_SOURCE +enables extra bounds checking in various functions that accept buffers to = be +written into. +These functions currently have extra bounds checking support: +.Bl -column -offset indent "snprintf" "memmove" "strncpy" "vsnprintf" "rea= dlink" +.It bcopy=C2=A0 =C2=A0 Ta bzero=C2=A0 =C2=A0 Ta fgets=C2=A0 =C2=A0 Ta getc= wd=C2=A0 =C2=A0 Ta gets +.It memcpy=C2=A0 Ta memmove=C2=A0 Ta memset=C2=A0 =C2=A0 Ta read=C2=A0 =C2= =A0 =C2=A0 Ta readlink +.It snprintf Ta sprintf=C2=A0 Ta stpcpy=C2=A0 =C2=A0 Ta stpncpy=C2=A0 Ta s= trcat +.It strcpy=C2=A0 Ta strncat=C2=A0 Ta strncpy=C2=A0 Ta vsnprintf Ta vsprint= f +.El +.Pp +.Dq FORTIFY_SOURCE +requires compiler support from +.Xr clang 1 +or +.Xr gcc 1 , +which provide the +.Xr __builtin_object_size 3 +function that is used to determine the bounds of an object. +This feature works best at optimization levels +.Fl O1 +and above, as some object sizes may be less obvious without some data that= the +compiler would collect in an optimization pass. +.Pp +Similar to SSP, violating the bounds of an object will cause the program t= o +abort in an effort to avoid malicious execution. +This effectively provides finer-grained protection than SSP for some class= of +function and system calls, along with some protection for buffers allocate= d as +part of the program data. .Sh KNOBS AND TWEAKS .Fx provides several knobs and tweak handles that make some introspection diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index de91e00d8cc7..52c3d07746c7 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -294,11 +294,18 @@ CFLAGS.clang+=3D=C2=A0=C2=A0=C2=A0 -Qunused-arguments # but not yet. CXXFLAGS.clang+=3D=C2=A0=C2=A0=C2=A0 -Wno-c++11-extensions =20 +# XXX This should be defaulted to 2 when WITH_SSP is in use after further +# testing and soak time. +FORTIFY_SOURCE?=3D=C2=A0=C2=A0=C2=A0 0 .if ${MK_SSP} !=3D "no" # Don't use -Wstack-protector as it breaks world with -Werror. SSP_CFLAGS?=3D=C2=A0=C2=A0=C2=A0 -fstack-protector-strong CFLAGS+=3D=C2=A0=C2=A0=C2=A0 ${SSP_CFLAGS} .endif # SSP +.if ${FORTIFY_SOURCE} > 0 +CFLAGS+=3D=C2=A0=C2=A0=C2=A0 -D_FORTIFY_SOURCE=3D${FORTIFY_SOURCE} +CXXFLAGS+=3D=C2=A0=C2=A0=C2=A0 -D_FORTIFY_SOURCE=3D${FORTIFY_SOURCE} +.endif =20 # Additional flags passed in CFLAGS and CXXFLAGS when MK_DEBUG_FILES is # enabled. diff --git a/tools/build/options/WITHOUT_SSP b/tools/build/options/WITHOUT_= SSP index 88162cecf14a..7a773fe1e5aa 100644 --- a/tools/build/options/WITHOUT_SSP +++ b/tools/build/options/WITHOUT_SSP @@ -1 +1,4 @@ Do not build world with stack smashing protection. +See +.Xr security 7 +for more information. diff --git a/tools/build/options/WITH_SSP b/tools/build/options/WITH_SSP index 0088dd133782..4f06a73d4173 100644 --- a/tools/build/options/WITH_SSP +++ b/tools/build/options/WITH_SSP @@ -1 +1,4 @@ Build world with stack smashing protection. +See +.Xr security 7 +for more information. =20 ------=_Part_1591639_634665037.1716059235908 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Sorry for noticing so late .= .. I was unaware this was being worked on and  I was very busy with since my dad passed away recently= .

The static checker component of Fortify s= ource only works well on GCC, for clang this lacks the support that was add= ed by Google on Android's libc (which is not bery useful either).

We already had some stubs for the ssp functions but we never use= d them and this just adds bloat to our libc.

I suggest reverting. Again sorry.

Pedro.

=20
=20
On Monday, May 13, 2024 at 12:24:16 AM GMT-5, Kyle = Evans <kevans@freebsd.org> wrote:


=20 =20
The branch main has been updated by k= evans:


commit 9bfd3b4076a7b0dfd27ab22318e5113d= c84fea28
Author:    Kyle Evans <kevan= s@FreeBSD.org>
AuthorDate: 2024-05-13 05:2= 3:50 +0000
Commit:    Kyle Evans <<= a href=3D"mailto:kevans@FreeBSD.org" rel=3D"nofollow" target=3D"_blank">kev= ans@FreeBSD.org>
CommitDate: 2024-05-13 05= :23:50 +0000

  &n= bsp; Add a build knob for _FORTIFY_SOURCE
  =  
    In the future, we will Defa= ult to _FORTIFY_SOURCE=3D2 if SSP is enabled,
&nb= sp;   otherwise default to _FORTIFY_SOURCE=3D0.  For now we defau= lt it to 0
    unconditionally to ease = bisect across older versions without the new
&nbs= p;   symbols, and we'll put out a call for testing.
   
    include/*.h= include their ssp/*.h equivalents as needed based on the
    knob. Programs and users are allowed to override FOR= TIFY_SOURCE in their
    Makefiles or s= rc.conf/make.conf to force it off.
    =
    Reviewed by:    des, mar= kj
    Relnotes:      y= es
    Sponsored by:  Stormshield=
    Sponsored by:  Klara, Inc.
    Differential Revision:  = https://reviews.freebsd.org/D32308
---
include/stdio.h          &nbs= p;     |  3 ++
include/string.h&= nbsp;               |  3 ++
include/strings.h          &nb= sp;   |  3 ++
include/unistd.h  =               |  4 +++
lib/libthr/Makefile           = |  3 ++
libexec/rtld-elf/Makefile  &= nbsp;   |  4 +++
share/man/man7/secur= ity.7      | 75 +++++++++++++++++++++++++++++++++++++++++
share/mk/bsd.sys.mk        &n= bsp;   |  7 ++++
tools/build/options/= WITHOUT_SSP |  3 ++
tools/build/options/WIT= H_SSP    |  3 ++
10 files changed= , 108 insertions(+)

di= ff --git a/include/stdio.h b/include/stdio.h
inde= x fe7a6f7d6f82..30bc638082d8 100644
--- a/include= /stdio.h
+++ b/include/stdio.h
@@ -530,4 +530,7 @@ extern int __isthreaded;
__END_DECLS
__NULLABILITY_PRAGMA_POP

+#if defined(_FORTIFY_SOUR= CE) && _FORTIFY_SOURCE > 0
+#include &= lt;ssp/stdio.h>
+#endif
#endif /* !_STDIO_H_ */
diff --git a/include= /string.h b/include/string.h
index 597308020cdb..= a595f6e3e260 100644
--- a/include/string.h
+++ b/include/string.h
@@ -16= 8,4 +168,7 @@ errno_t memset_s(void *, rsize_t, int, rsize_t);
#endif /* __EXT1_VISIBLE */
__END= _DECLS

+#if defined(_= FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
+#include <ssp/string.h>
+#endif
=
#endif /* _STRING_H_ */
diff --= git a/include/strings.h b/include/strings.h
index= fde007186e04..6fe6a09e7dd3 100644
--- a/include/= strings.h
+++ b/include/strings.h
@@ -68,4 +68,7 @@ int    strncasecmp(const char = *, const char *, size_t) __pure;
#endif
__END_DECLS

+#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
+#include <ssp/strings.h>
+#endif
#endif /* _STRINGS_H_ */
diff --git a/include/unistd.h b/include/unistd.h
index e4e5c62fbb67..59738cbf6e68 100644
--- a/include/unistd.h
+++ b/include/u= nistd.h
@@ -37,6 +37,10 @@
#include <sys/_null.h>
#include <s= ys/_types.h>

+#if = defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
+#include <ssp/unistd.h>
+#endif<= br>
+
#ifndef _GID_T_DECLA= RED
typedef    __gid_t  = ;      gid_t;
#define &= nbsp;  _GID_T_DECLARED
diff --git a/lib/libt= hr/Makefile b/lib/libthr/Makefile
index a5bf5da44= 170..85c028f521a1 100644
--- a/lib/libthr/Makefil= e
+++ b/lib/libthr/Makefile
@@ -11,6 +11,9 @@ LDFLAGS+=3D    -Wl,--rpath=3D/usr/lib= ${COMPAT_libcompat}

= .include <src.opts.mk>
MK_SSP=3D &nbs= p;  no
+# SSP forced off already implies FOR= TIFY_SOURCE=3D0, but we must make sure that
+# on= e cannot turn it back on.
+FORTIFY_SOURCE=3D = ;   0

LIB= =3Dthr
SHLIB_MAJOR=3D 3
diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile
index 37c3840538d5..864448ad782a 100644
--- a/libexec/rtld-elf/Makefile
+++ b/= libexec/rtld-elf/Makefile
@@ -15,6 +15,10 @@ MK_U= BSAN=3D    no

.include <bsd.compat.pre.mk>
+# SSP forced off already implies FORTIFY_SOURCE=3D= 0, but we must make sure that
+# one cannot turn = it back on.
+FORTIFY_SOURCE=3D    = 0
+
.if !defined(NEED_= COMPAT)
CONFS=3D      &= nbsp; libmap.conf
.endif
diff --git a/share/man/man7/security.7 b/share/man/man7/security.7
index ccbeeb4575ce..2e690e35d534 100644
--- a/share/man/man7/security.7
+++ b= /share/man/man7/security.7
@@ -939,6 +939,81 @@ o= ption that SSH allows in its
.Pa authorized_keys=
file to make the key only usable to entities lo= gging in from specific
machines.
+.Sh STACK OVERFLOW PROTECTION
+.Fx
+supports stack overflow protection using the Stack= Smashing Protector
+.Pq SSP
+compiler feature.
+In userland, SSP adds a= per-process randomized canary at the end of every stack
+frame which is checked for corruption upon return from the functi= on.
+In the kernel, a single randomized canary is= used globally except on aarch64,
+which has a
+.Dv PERTHREAD_SSP
+.Xr c= onfig 8
+option to enable per-thread randomized c= anaries.
+If stack corruption is detected, then t= he process aborts to avoid potentially
+malicious= execution as a result of the corruption.
+SSP ma= y be enabled or disabled when building
+.Fx
+base with the
+.Xr src.conf= 5
+SSP knob.
+.Pp
<= /div>
+When
+.Va WITH_SSP
+is enabled, which is the default, world is built with t= he
+.Fl fstack-protector-strong
+compiler option.
+The kernel is built w= ith the
+.Fl fstack-protector
+option.
+.Pp
= +In addition to SSP, a
+.Dq FORTIFY_SOURCE
+implementation is supported up to level 2 by defining<= br>
+.Va _FORTIFY_SOURCE
+t= o
+.Dv 1
+or
<= div dir=3D"ltr">+.Dv 2
+before including any
<= /div>
+.Fx
+headers.
+.Fx
+world builds can set
+.Va FORTIFY_SOURCE
+to provide= a default value for
+.Va _FORTIFY_SOURCE .
+When enabled,
+.Dq FORTIFY_= SOURCE
+enables extra bounds checking in various = functions that accept buffers to be
+written into= .
+These functions currently have extra bounds ch= ecking support:
+.Bl -column -offset indent "snpr= intf" "memmove" "strncpy" "vsnprintf" "readlink"
= +.It bcopy    Ta bzero    Ta fgets    Ta get= cwd    Ta gets
+.It memcpy  Ta me= mmove  Ta memset    Ta read      Ta readlink<= br>
+.It snprintf Ta sprintf  Ta stpcpy  &n= bsp; Ta stpncpy  Ta strcat
+.It strcpy = ; Ta strncat  Ta strncpy  Ta vsnprintf Ta vsprintf
+.El
+.Pp
+.Dq FORTIFY_SOURCE
+requires compiler support f= rom
+.Xr clang 1
+or
+.Xr gcc 1 ,
+which provi= de the
+.Xr __builtin_object_size 3
+function that is used to determine the bounds of an object.
+This feature works best at optimization levels
+.Fl O1
+and above, as so= me object sizes may be less obvious without some data that the
+compiler would collect in an optimization pass.
+.Pp
+Similar to SSP, violating the= bounds of an object will cause the program to
+a= bort in an effort to avoid malicious execution.
+= This effectively provides finer-grained protection than SSP for some class = of
+function and system calls, along with some pr= otection for buffers allocated as
+part of the pr= ogram data.
.Sh KNOBS AND TWEAKS
.Fx
provides several knobs and tweak= handles that make some introspection
diff --git = a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk
index= de91e00d8cc7..52c3d07746c7 100644
--- a/share/mk= /bsd.sys.mk
+++ b/share/mk/bsd.sys.mk
@@ -294,11 +294,18 @@ CFLAGS.clang+=3D    -Q= unused-arguments
# but not yet.
CXXFLAGS.clang+=3D    -Wno-c++11-extensions
<= /div>

+# XXX This should be def= aulted to 2 when WITH_SSP is in use after further
+# testing and soak time.
+FORTIFY_SOURCE?=3D&nb= sp;   0
.if ${MK_SSP} !=3D "no"
# Don't use -Wstack-protector as it breaks world with = -Werror.
SSP_CFLAGS?=3D    -fstac= k-protector-strong
CFLAGS+=3D    = ${SSP_CFLAGS}
.endif # SSP
+.if ${FORTIFY_SOURCE} > 0
+CFLAGS+=3D&nb= sp;   -D_FORTIFY_SOURCE=3D${FORTIFY_SOURCE}
+CXXFLAGS+=3D    -D_FORTIFY_SOURCE=3D${FORTIFY_SOURCE}<= br>
+.endif

# Additional flags passed in CFLAGS and CXXFLAGS when MK_DEBU= G_FILES is
# enabled.
= diff --git a/tools/build/options/WITHOUT_SSP b/tools/build/options/WITHOUT_= SSP
index 88162cecf14a..7a773fe1e5aa 100644
--- a/tools/build/options/WITHOUT_SSP
+++ b/tools/build/options/WITHOUT_SSP
@= @ -1 +1,4 @@
Do not build world with stack smash= ing protection.
+See
+.= Xr security 7
+for more information.
diff --git a/tools/build/options/WITH_SSP b/tools/build/optio= ns/WITH_SSP
index 0088dd133782..4f06a73d4173 1006= 44
--- a/tools/build/options/WITH_SSP
+++ b/tools/build/options/WITH_SSP
@@ -1 +1,4 @@
Build world with stack smashing p= rotection.
+See
+.Xr se= curity 7
+for more information.
------=_Part_1591639_634665037.1716059235908-- From nobody Sat May 18 19:45:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VhZ7H5VPsz5LMwy for ; Sat, 18 May 2024 19:45:31 +0000 (UTC) (envelope-from giffunip@yahoo.com) Received: from sonic302-22.consmr.mail.ne1.yahoo.com (sonic302-22.consmr.mail.ne1.yahoo.com [66.163.186.148]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4VhZ7G5pzZz4jFw for ; Sat, 18 May 2024 19:45:30 +0000 (UTC) (envelope-from giffunip@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=Ufgi0Vu2; dmarc=pass (policy=reject) header.from=yahoo.com; spf=pass (mx1.freebsd.org: domain of giffunip@yahoo.com designates 66.163.186.148 as permitted sender) smtp.mailfrom=giffunip@yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1716061528; bh=m72qXPMCj15dDMZ5FXzcjPe9q5Mh+fLHzPoKEag1a/Y=; h=Date:From:To:In-Reply-To:References:Subject:From:Subject:Reply-To; b=Ufgi0Vu2XpQjR+wprOfp4xW9RYk1lWn3udB3lhSLMO41obpvMzzGhhn6FwVFdxICQALHbo/DLq2KXNLs+ekAbx/v7yxQBAUx9F+mRarQZx8CosMSnaFVsobgUG2zpH9ERaeVWaM8F4QYmlrloe10yb2/8fbSrWUGM06afE7jEr6CMhWoeg1z7ZBovXu0tLvVule97yQ6D/bnmmxTU5N6FiOhiJY+m6G5+qOvpXtNUP8xM1YrBmlJ8+VplokIb44Vgd4Att3CLA7D5bvWxIbY4i3pxtwWjqG8yn6neFRpqL5YUallNvCQ13sZ/9o2KRUq0UlNmnVPiLtyKjc4E9DJ+A== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1716061528; bh=J0HwAKSK4jm1PqsDOgUbTFoYd81hpNY7CtiqCfao4GA=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=Cw2ANpAiE4yPvc4oRtpYRCMuKZBrKkiGy2g34mapaHQe00aPj5R0OMzd44hqOhk9LS5IpGG9D1ILsVngEahmhzEcQ2QegfBbq/hU66b3PAgAYM4w4W7CLX8Ton/tMlxKHhEWX5dqDErp3uBcsnxp6ponEi5nIQsw5NS8riq0n88Uj613NW3OtOu6LSykCfy10NR3rET56FRqbNtrW251PZ8BsbUtyoriEP47EQeg5YYnZta0lnZBa04EZ5nIr0mEu8oRi9F/ua9tUS9QcYRhVcNj1Y7oBvDa5te1k33rUHDR9F6DJuVVGryvLALOtiFwlV5psWT7hg3JDn817rJbuw== X-YMail-OSG: JRHEMwYVM1mYVr_Q2nKJ_zHTpwjDtz_sw3VaBoCbEvf0NmLauRCeZcig_8p8eUq o.mHc9S40LqrPR_8ps.ilOFckWTw_LfF5KQZREaZOTUGWdKfmnjcsPxSj8Nh.Jx_71Rlhw9i4w4A N6TqOrXdlseTsPPqaeeAw7kcxEIbNmMAR5X.bF_DrNAUtjhARMqRvvAz.GJbIbnPgEWzDHhNlE9b q_lgUFwqo0bovWyCJfv2dgsTQMIpguuWXImSkENdQxCSo2mRVyv6DOELU1YlUPoJYS4y0f8Ndpg1 oBkjZXTuyW7y5sKKb6teql2l9.6.RvY_ok.lRHcLoQplfvjkp8bqb5EgN5oGGV3nQf3uRWIeRBCo dYa2KBdEfk52jxtqFOGG8z5mwnyEIx.SM6FAwfB0TyEYGe5X1LWuSbymrLxy8vkZz6mZBVEG7p19 6FzoO0j5er0hS8ISlg2L3_vWRDsY4hgKqJsmnbUqI6xXyijF6tXmehKRK7P9xqmTpSp94__1MeYW HrTFJKwqUVQWKvzCtWJnSSQVHO8_0eMey7vF.aB5eacpSAdA_J0Xyh6WYt_sDvxEZBpQ6eldN77p 3lWvzcUHAaur5PdoYBflR5B1.IEeDv17alYNXg2woI6jt_MTJYaBZuMGtyFxOOBJrTB4VbgA1aVD 4xO38Rp_.PuNcZBRENj5TrnR5bFlkLJcghrJ_2RZjK9T45eKw7zOBkP5iSvat0zoa.RkUFT8_quu NACILAXA3iMdCDVCVqW1dLe0zwdKVwvUGQAz8eKubVL6bEM6WhV0XX5u3BLs6yBRNqJu9C1zogem V80l6Na4YmIHCiI7CGf.VyRqGK43oiY9Gxs2HgSIMo495pmaydTwUWM5FWhI_VxxZ0rYKR38BZyB fUT.4qLBSzLHES0e_KPh8znCd93u.6N9dqFyIKOKxphAcwFyGmRYQgiy6M6sQ5R3pfZ_C49g2Zac 4Zq0HPHbrqvJGd7YRsC1PQ4eh3PM3Ius4f5l2hTdK..o77l4ed.e1tuoxhlo7G68SGMIaX61Aflo v5drVJKndst8t.t5ugZ8LiMHSI7sa9kcgs8vOkybUkh.OUC9rMSvCMSJbIGk_xLfnMeOZe2byO9x yCi8GVgtx17C1nP_mKhhoXlSR_HDisJmwjJpPIUNYtq26uHVtYoJij6MuAA.PsONfOuqFF4.xxvt _FyNz.GhI0D0HIVMVAjGPw8quwD7HlwFHPOTz4bIEHTWIRoSReMxU36lF3intTYA85dp7MBPyYJe BLFHMx_usFwgjB.uqKyOHnKqeVnCzKICnuyP42CwxF_fxp9KoA_zr4uKfl77UGesmNFcoXgcYtuB 6dz1is0amXSlaVRZwhJmVAKHByAJmNhjyb49RQa_Iu2lu1icFND3LyPtb6t6DIUqQ2DPPrlgmqCf MBzDCH0ts9LDibbp136nxx09VXC0iuqL.SU_BirqDRx2tAwXalzrXuVOo3GG9MGDG71xmeu4fnmj WTwnrToKDpW0q1XWCDi2yxr.fSzKxxDkscQOh_XggIivucdPlLWtApQo4.srjIjUmLKnDZhIt.fp CA06vSnGCl48CdMoWQE7T29AzqJg1_opjM0Ev3GZ0DjTatCppGw7X9TTyk4nH7hxNdvTRzokO_8Z 7KmLo7bGJoqiMv8xtqHwwzbyeTMfYbGZ7CRraGm58ZpB0HinoyzFlNiJ4FZAldY2XyiNcX2JHF5h .Xsoc1EGu8ceGvL_c8NulBjxmWdx8lcY3dvDEjmRKbBSfqyOz2t7MnCs7wfsb_i.u5p7tR9TO2sf J01k75i7Cwk0PNMuA2S4D4eNH4l53txnBcVN32VBm7TCzfiAZOd2y0Jkbu4251piGOVpsPBDqx61 BOivn0sJ_.YhS7Q99Ytae18SrYCvRvdCT3dUQ6f2LRLg3ZKiLE2NLeMiAZSGFCyMRaR5HnuRW7S5 Ra22YnhEVDIJeBVviSsRYV3K94VDwszmn7pUhxvgjTJRgiaQ3bvEH2CqIy3gBqCAIajY0VpG6oWy vqnLUICSDOPOIxBPsqsnjc6C8NL59XST1O3leNdJImBIcoTX2I3VOhOI4kW6vPsK1jytbYVLZ9wo sf4h3VFRXrGebUB1wgjZ.wy3PXlCn3_bpLaBd.LeO5f6Is.hfBuvbnAim0Tlcglf1WOsR6xXTU5S gDftYbs3Mc5Afkh3BhxI- X-Sonic-MF: X-Sonic-ID: 6d02e040-2bf4-48be-a734-5787015f7638 Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.ne1.yahoo.com with HTTP; Sat, 18 May 2024 19:45:28 +0000 Date: Sat, 18 May 2024 19:45:26 +0000 (UTC) From: "Pedro F. Giffuni" To: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" , Kyle Evans Message-ID: <836513301.1592591.1716061526201@mail.yahoo.com> In-Reply-To: <177052019.1587022.1716057759658@mail.yahoo.com> References: <202405130524.44D5O9mN084277@gitrepo.freebsd.org> <177052019.1587022.1716057759658@mail.yahoo.com> Subject: Re: git: be04fec42638 - main - Import _FORTIFY_SOURCE implementation from NetBSD List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1592590_625024558.1716061526186" X-Mailer: WebService/1.1.22356 YMailNorrin X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.993]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.com]; TO_DN_EQ_ADDR_SOME(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; TO_DN_SOME(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; FROM_HAS_DN(0.00)[]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; MID_RHS_MATCH_FROMTLD(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org]; ASN(0.00)[asn:36646, ipnet:66.163.184.0/21, country:US]; RWL_MAILSPIKE_POSSIBLE(0.00)[66.163.186.148:from]; RCVD_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[66.163.186.148:from] X-Rspamd-Queue-Id: 4VhZ7G5pzZz4jFw ------=_Part_1592590_625024558.1716061526186 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable It was just pointed out to me this sounded insulting .. for which I am sor= ry. It's been almost 10 years since I last looked at it and it is disappointing= to see my almost-mistake happening. This was a lot of work by Kyle and I d= idn't mean to be dismissive of it. So ]I'll just shudup and creep back into my hole, sorry for disturbing the = real work going on. Pedro. On Saturday, May 18, 2024 at 01:42:54 PM GMT-5, Pedro Giffuni wrote: =20 =20 Oh no .. please not... We went into that in a GSoC: https://wiki.freebsd.org/SummerOfCode2015/FreeBSDLibcSecurityExtensions Ultimately it proved to be useless since stack-protector-strong. The NetBSD code was not well adapted to clang either. Ask me more if you really want to dig into it, but we don't want this. Pedro. On Monday, May 13, 2024 at 12:24:13 AM GMT-5, Kyle Evans wrote: =20 =20 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=3Dbe04fec42638f30f50b5b55fd8e3= 634c0fb89928 commit be04fec42638f30f50b5b55fd8e3634c0fb89928 Author:=C2=A0 =C2=A0 Kyle Evans AuthorDate: 2024-05-13 05:23:49 +0000 Commit:=C2=A0 =C2=A0 Kyle Evans CommitDate: 2024-05-13 05:23:49 +0000 =C2=A0 =C2=A0 Import _FORTIFY_SOURCE implementation from NetBSD =C2=A0 =C2=A0=20 =C2=A0 =C2=A0 This is a mostly-unmodified copy of the various *_chk impleme= ntations =C2=A0 =C2=A0 and headers from NetBSD, without yet modifying system headers= to start =C2=A0 =C2=A0 actually including them.=C2=A0 A future commit will also appl= y the needed =C2=A0 =C2=A0 bits to fix ssp/unistd.h. =C2=A0 =C2=A0=20 =C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 imp, pauamma_gundo.com (both previo= us versions), kib =C2=A0 =C2=A0 Sponsored by:=C2=A0 Stormshield =C2=A0 =C2=A0 Sponsored by:=C2=A0 Klara, Inc. =C2=A0 =C2=A0 Differential Revision:=C2=A0 https://reviews.freebsd.org/D323= 06 --- etc/mtree/BSD.include.dist=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 2 + include/Makefile=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 |=C2=A0 2 +- include/ssp/Makefile=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2= =A0 6 ++ include/ssp/ssp.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 |=C2=A0 91 ++++++++++++++++++++++++++ include/ssp/stdio.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= |=C2=A0 93 ++++++++++++++++++++++++++ include/ssp/string.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | 129= ++++++++++++++++++++++++++++++++++++ include/ssp/strings.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2= =A0 67 +++++++++++++++++++ include/ssp/unistd.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2= =A0 54 +++++++++++++++ lib/libc/secure/Makefile.inc=C2=A0 =C2=A0 =C2=A0 |=C2=A0 11 ++++ lib/libc/secure/Symbol.map=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 18 +++++ lib/libc/secure/fgets_chk.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 54 ++++++++= +++++++ lib/libc/secure/gets_chk.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 74 +++++++++= ++++++++++++ lib/libc/secure/memcpy_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 53 ++++++++++++++= + lib/libc/secure/memmove_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 47 +++++++++++++ lib/libc/secure/memset_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 46 +++++++++++++ lib/libc/secure/snprintf_chk.c=C2=A0 =C2=A0 |=C2=A0 56 ++++++++++++++++ lib/libc/secure/sprintf_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 61 +++++++++++++= ++++ lib/libc/secure/ssp_internal.h=C2=A0 =C2=A0 |=C2=A0 37 +++++++++++ lib/libc/secure/stpcpy_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 55 ++++++++++++++= ++ lib/libc/secure/stpncpy_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 53 +++++++++++++= ++ lib/libc/secure/strcat_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 60 ++++++++++++++= +++ lib/libc/secure/strcpy_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 54 ++++++++++++++= + lib/libc/secure/strncat_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 70 +++++++++++++= +++++++ lib/libc/secure/strncpy_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 53 +++++++++++++= ++ lib/libc/secure/vsnprintf_chk.c=C2=A0 =C2=A0 |=C2=A0 49 ++++++++++++++ lib/libc/secure/vsprintf_chk.c=C2=A0 =C2=A0 |=C2=A0 58 ++++++++++++++++ lib/libssp/Makefile=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= |=C2=A0 20 +++++- lib/libssp/Symbol.map=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2= =A0 12 ++-- lib/libssp/Versions.def=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 5= ++ lib/libssp/__builtin_object_size.3 | 110 +++++++++++++++++++++++++++++++ lib/libssp/fortify_stubs.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 | 131 --------------= ----------------------- lib/libssp/ssp.3=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 | 130 ++++++++++++++++++++++++++++++++++++ 32 files changed, 1621 insertions(+), 140 deletions(-) diff --git a/etc/mtree/BSD.include.dist b/etc/mtree/BSD.include.dist index a6bd5880bf61..f8c83d6dde7a 100644 --- a/etc/mtree/BSD.include.dist +++ b/etc/mtree/BSD.include.dist @@ -372,6 +372,8 @@ =C2=A0 =C2=A0 =C2=A0 =C2=A0 mac_veriexec =C2=A0 =C2=A0 =C2=A0 =C2=A0 .. =C2=A0 =C2=A0 .. +=C2=A0 =C2=A0 ssp +=C2=A0 =C2=A0 .. =C2=A0 =C2=A0 sys =C2=A0 =C2=A0 =C2=A0 =C2=A0 disk =C2=A0 =C2=A0 =C2=A0 =C2=A0 .. diff --git a/include/Makefile b/include/Makefile index 19e6beb95203..32774419f162 100644 --- a/include/Makefile +++ b/include/Makefile @@ -4,7 +4,7 @@ =20 PACKAGE=3Dclibs CLEANFILES=3D osreldate.h version -SUBDIR=3D arpa protocols rpcsvc rpc xlocale +SUBDIR=3D arpa protocols rpcsvc rpc ssp xlocale .if ${MACHINE_CPUARCH} =3D=3D "amd64" SUBDIR+=3D=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 i386 INCLUDE_SUBDIRS+=3D=C2=A0=C2=A0=C2=A0 i386 diff --git a/include/ssp/Makefile b/include/ssp/Makefile new file mode 100644 index 000000000000..dff19f43c920 --- /dev/null +++ b/include/ssp/Makefile @@ -0,0 +1,6 @@ +# $FreeBSD$ + +INCS=3D=C2=A0=C2=A0=C2=A0 ssp.h stdio.h string.h strings.h unistd.h +INCSDIR=3D=C2=A0=C2=A0=C2=A0 ${INCLUDEDIR}/ssp + +.include diff --git a/include/ssp/ssp.h b/include/ssp/ssp.h new file mode 100644 index 000000000000..35a9aeee02df --- /dev/null +++ b/include/ssp/ssp.h @@ -0,0 +1,91 @@ +/*=C2=A0=C2=A0=C2=A0 $NetBSD: ssp.h,v 1.13 2015/09/03 20:43:47 plunky Exp = $=C2=A0=C2=A0=C2=A0 */ + +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006, 2011 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF = THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _SSP_SSP_H_ +#define _SSP_SSP_H_ + +#include + +#if !defined(__cplusplus) +# if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && \ +=C2=A0 =C2=A0 (__OPTIMIZE__ > 0 || defined(__clang__)) +#=C2=A0 if _FORTIFY_SOURCE > 1 +#=C2=A0 define __SSP_FORTIFY_LEVEL 2 +#=C2=A0 else +#=C2=A0 define __SSP_FORTIFY_LEVEL 1 +#=C2=A0 endif +# else +#=C2=A0 define __SSP_FORTIFY_LEVEL 0 +# endif +#else +# define __SSP_FORTIFY_LEVEL 0 +#endif + +#define=C2=A0=C2=A0=C2=A0 __ssp_var(type)=C2=A0=C2=A0=C2=A0 __CONCAT(__ssp= _ ## type, __COUNTER__) + +/* __ssp_real is used by the implementation in libc */ +#if __SSP_FORTIFY_LEVEL =3D=3D 0 +#define __ssp_real_(fun)=C2=A0=C2=A0=C2=A0 fun +#else +#define __ssp_real_(fun)=C2=A0=C2=A0=C2=A0 __ssp_real_ ## fun +#endif +#define __ssp_real(fun)=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __ssp_real_(f= un) + +#define __ssp_inline static __inline __attribute__((__always_inline__)) + +#define __ssp_bos(ptr) __builtin_object_size(ptr, __SSP_FORTIFY_LEVEL > 1) +#define __ssp_bos0(ptr) __builtin_object_size(ptr, 0) + +#define __ssp_check(buf, len, bos) \ +=C2=A0=C2=A0=C2=A0 if (bos(buf) !=3D (size_t)-1 && len > bos(buf)) \ +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail() +#define __ssp_redirect_raw(rtype, fun, symbol, args, call, cond, bos) \ +rtype __ssp_real_(fun) args __RENAME(symbol); \ +__ssp_inline rtype fun args __RENAME(__ssp_protected_ ## fun); \ +__ssp_inline rtype fun args { \ +=C2=A0=C2=A0=C2=A0 if (cond) \ +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __ssp_check(__buf, __len, bos); \ +=C2=A0=C2=A0=C2=A0 return __ssp_real_(fun) call; \ +} + +#define __ssp_redirect(rtype, fun, args, call) \ +=C2=A0 =C2=A0 __ssp_redirect_raw(rtype, fun, fun, args, call, 1, __ssp_bos= ) +#define __ssp_redirect0(rtype, fun, args, call) \ +=C2=A0 =C2=A0 __ssp_redirect_raw(rtype, fun, fun, args, call, 1, __ssp_bos= 0) + +__BEGIN_DECLS +void __stack_chk_fail(void) __dead2; +void __chk_fail(void) __dead2; +__END_DECLS + +#endif /* _SSP_SSP_H_ */ diff --git a/include/ssp/stdio.h b/include/ssp/stdio.h new file mode 100644 index 000000000000..72e3236eac80 --- /dev/null +++ b/include/ssp/stdio.h @@ -0,0 +1,93 @@ +/*=C2=A0=C2=A0=C2=A0 $NetBSD: stdio.h,v 1.5 2011/07/17 20:54:34 joerg Exp = $=C2=A0=C2=A0=C2=A0 */ + +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF = THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _SSP_STDIO_H_ +#define _SSP_STDIO_H_ + +#include + +__BEGIN_DECLS +int __sprintf_chk(char *__restrict, int, size_t, const char *__restrict, .= ..) +=C2=A0 =C2=A0 __printflike(4, 5); +int __vsprintf_chk(char *__restrict, int, size_t, const char *__restrict, +=C2=A0 =C2=A0 __va_list) +=C2=A0 =C2=A0 __printflike(4, 0); +int __snprintf_chk(char *__restrict, size_t, int, size_t, +=C2=A0 =C2=A0 const char *__restrict, ...) +=C2=A0 =C2=A0 __printflike(5, 6); +int __vsnprintf_chk(char *__restrict, size_t, int, size_t, +=C2=A0 =C2=A0 const char *__restrict, __va_list) +=C2=A0 =C2=A0 __printflike(5, 0); +char *__gets_chk(char *, size_t); +char *__fgets_chk(char *, int, size_t, FILE *); +__END_DECLS + +#if __SSP_FORTIFY_LEVEL > 0 + +#define sprintf(str, ...) ({=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 char *_ssp_str =3D (str);=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __builtin___sprintf_chk(_ssp_str, 0, __ssp_bos(_ssp_str),=C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 =C2=A0 =C2=A0 __VA_ARGS__); \ +}) + +#define vsprintf(str, fmt, ap) ({=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 char *_ssp_str =3D (str);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 \ +=C2=A0 =C2=A0 __builtin___vsprintf_chk(_ssp_str, 0, __ssp_bos(_ssp_str), f= mt,=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 =C2=A0 =C2=A0 ap);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +}) + +#define snprintf(str, len, ...) ({=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 char *_ssp_str =3D (str);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 \ +=C2=A0 =C2=A0 __builtin___snprintf_chk(_ssp_str, len, 0, __ssp_bos(_ssp_st= r),=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 =C2=A0 =C2=A0 __VA_ARGS__);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0 \ +}) + +#define vsnprintf(str, len, fmt, ap) ({=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 char *_ssp_str =3D (str);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 \ +=C2=A0 =C2=A0 __builtin___vsnprintf_chk(_ssp_str, len, 0, __ssp_bos(_ssp_s= tr),=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 =C2=A0 =C2=A0 fmt, ap);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 \ +}) + +#define gets(str) ({=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 \ +=C2=A0 char *_ssp_str =3D (str);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __gets_chk(_ssp_str, __ssp_bos(_ssp_str));=C2=A0=C2=A0=C2=A0= \ +}) + +#define fgets(str, len, fp) ({=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 char *_ssp_str =3D (str);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 \ +=C2=A0 =C2=A0 __fgets_chk(_ssp_str, len, __ssp_bos(_ssp_str), fp);=C2=A0= =C2=A0=C2=A0 \ +}) + +#endif /* __SSP_FORTIFY_LEVEL > 0 */ + +#endif /* _SSP_STDIO_H_ */ diff --git a/include/ssp/string.h b/include/ssp/string.h new file mode 100644 index 000000000000..996020fda778 --- /dev/null +++ b/include/ssp/string.h @@ -0,0 +1,129 @@ +/*=C2=A0=C2=A0=C2=A0 $NetBSD: string.h,v 1.14 2020/09/05 13:37:59 mrg Exp = $=C2=A0=C2=A0=C2=A0 */ + +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF = THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _SSP_STRING_H_ +#define _SSP_STRING_H_ + +#include + +__BEGIN_DECLS +void *__memcpy_chk(void *, const void *, size_t, size_t); +void *__memmove_chk(void *, const void *, size_t, size_t); +void *__memset_chk(void *, int, size_t, size_t); +char *__stpcpy_chk(char *, const char *, size_t); +char *__stpncpy_chk(char *, const char *, size_t, size_t); +char *__strcat_chk(char *, const char *, size_t); +char *__strcpy_chk(char *, const char *, size_t); +char *__strncat_chk(char *, const char *, size_t, size_t); +char *__strncpy_chk(char *, const char *, size_t, size_t); +__END_DECLS + +#if __SSP_FORTIFY_LEVEL > 0 + +#define __ssp_bos_check3_typed_var(fun, dsttype, dsrvar, dst, srctype, src= var, \ +=C2=A0 =C2=A0 src, lenvar, len) ({=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 srctype srcvar =3D (src);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 dsttype dstvar =3D (dst);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 size_t lenvar =3D (len);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 ((__ssp_bos0(dstvar) !=3D (size_t)-1) ?=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __builtin___ ## fun ## _chk(dstvar, srcvar, lenvar,=C2=A0=C2= =A0=C2=A0 \ +=C2=A0 =C2=A0 =C2=A0 =C2=A0 __ssp_bos0(dstvar)) :=C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __ ## fun ## _ichk(dstvar, srcvar, lenvar));=C2=A0=C2=A0=C2= =A0 \ +}) + +#define __ssp_bos_check3_typed(fun, dsttype, dst, srctype, src, len)=C2=A0= =C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __ssp_bos_check3_typed_var(fun, dsttype, __ssp_var(dstv), ds= t,=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 =C2=A0 =C2=A0 srctype, __ssp_var(srcv), src, __ssp_var(lenv)= , len) + +#define __ssp_bos_check3(fun, dst, src, len)=C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0 \ +=C2=A0 =C2=A0 __ssp_bos_check3_typed_var(fun, void *, __ssp_var(dstv), dst= ,=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 =C2=A0 =C2=A0 const void *, __ssp_var(srcv), src, __ssp_var(= lenv), len) + +#define __ssp_bos_check2_var(fun, dstvar, dst, srcvar, src) ({=C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 const void *srcvar =3D (src);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 void *dstvar =3D (dst);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 ((__ssp_bos0(dstvar) !=3D (size_t)-1) ?=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __builtin___ ## fun ## _chk(dstvar, srcvar,=C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 =C2=A0 =C2=A0 __ssp_bos0(dstvar)) :=C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __ ## fun ## _ichk(dstvar, srcvar));=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 \ +}) + +#define __ssp_bos_check2(fun, dst, src)=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __ssp_bos_check2_var(fun, __ssp_var(dstv), dst, __ssp_var(sr= cv), src) + +#define __ssp_bos_icheck3_restrict(fun, type1, type2) \ +static __inline type1 __ ## fun ## _ichk(type1 __restrict, type2 __restric= t, size_t); \ +static __inline __attribute__((__always_inline__)) type1 \ +__ ## fun ## _ichk(type1 __restrict dst, type2 __restrict src, size_t len)= { \ +=C2=A0=C2=A0=C2=A0 return __builtin___ ## fun ## _chk(dst, src, len, __ssp= _bos0(dst)); \ +} + +#define __ssp_bos_icheck3(fun, type1, type2) \ +static __inline type1 __ ## fun ## _ichk(type1, type2, size_t); \ +static __inline __attribute__((__always_inline__)) type1 \ +__ ## fun ## _ichk(type1 dst, type2 src, size_t len) { \ +=C2=A0=C2=A0=C2=A0 return __builtin___ ## fun ## _chk(dst, src, len, __ssp= _bos0(dst)); \ +} + +#define __ssp_bos_icheck2_restrict(fun, type1, type2) \ +static __inline type1 __ ## fun ## _ichk(type1, type2); \ +static __inline __attribute__((__always_inline__)) type1 \ +__ ## fun ## _ichk(type1 __restrict dst, type2 __restrict src) { \ +=C2=A0=C2=A0=C2=A0 return __builtin___ ## fun ## _chk(dst, src, __ssp_bos0= (dst)); \ +} + +__BEGIN_DECLS +__ssp_bos_icheck3_restrict(memcpy, void *, const void *) +__ssp_bos_icheck3(memmove, void *, const void *) +__ssp_bos_icheck3(memset, void *, int) +__ssp_bos_icheck2_restrict(stpcpy, char *, const char *) +__ssp_bos_icheck3_restrict(stpncpy, char *, const char *) +__ssp_bos_icheck2_restrict(strcpy, char *, const char *) +__ssp_bos_icheck2_restrict(strcat, char *, const char *) +__ssp_bos_icheck3_restrict(strncpy, char *, const char *) +__ssp_bos_icheck3_restrict(strncat, char *, const char *) +__END_DECLS + +#define memcpy(dst, src, len) __ssp_bos_check3(memcpy, dst, src, len) +#define memmove(dst, src, len) __ssp_bos_check3(memmove, dst, src, len) +#define memset(dst, val, len) \ +=C2=A0 =C2=A0 __ssp_bos_check3_typed(memset, void *, dst, int, val, len) +#define stpcpy(dst, src) __ssp_bos_check2(stpcpy, dst, src) +#define stpncpy(dst, src, len) __ssp_bos_check3(stpncpy, dst, src, len) +#define strcpy(dst, src) __ssp_bos_check2(strcpy, dst, src) +#define strcat(dst, src) __ssp_bos_check2(strcat, dst, src) +#define strncpy(dst, src, len) __ssp_bos_check3(strncpy, dst, src, len) +#define strncat(dst, src, len) __ssp_bos_check3(strncat, dst, src, len) + +#endif /* __SSP_FORTIFY_LEVEL > 0 */ +#endif /* _SSP_STRING_H_ */ diff --git a/include/ssp/strings.h b/include/ssp/strings.h new file mode 100644 index 000000000000..06c9c7cc0a09 --- /dev/null +++ b/include/ssp/strings.h @@ -0,0 +1,67 @@ +/*=C2=A0=C2=A0=C2=A0 $NetBSD: strings.h,v 1.3 2008/04/28 20:22:54 martin E= xp $=C2=A0=C2=A0=C2=A0 */ + +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2007 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF = THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _SSP_STRINGS_H_ +#define _SSP_STRINGS_H_ + +#include +#include + +#if __SSP_FORTIFY_LEVEL > 0 + +#define _ssp_bcopy(srcvar, src, dstvar, dst, lenvar,=C2=A0 len) ({=C2=A0= =C2=A0=C2=A0 \ +=C2=A0 =C2=A0 const void *srcvar =3D (src);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 void *dstvar =3D (dst);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 size_t lenvar =3D (len);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 ((__ssp_bos0(dstvar) !=3D (size_t)-1) ?=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __builtin___memmove_chk(dstvar, srcvar, lenvar,=C2=A0=C2=A0= =C2=A0 \ +=C2=A0 =C2=A0 =C2=A0 =C2=A0 __ssp_bos0(dstvar)) :=C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __memmove_ichk(dstvar, srcvar, lenvar));=C2=A0=C2=A0=C2=A0 \ +}) + +#define=C2=A0=C2=A0=C2=A0 bcopy(src, dst, len)=C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 _ssp_bcopy(__ssp_var(srcv), src, __ssp_var(dstv), dst, __ssp= _var(lenv), len) + +#define _ssp_bzero(dstvar, dst, lenvar, len) ({=C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 \ +=C2=A0 =C2=A0 void *dstvar =3D (dst);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 size_t lenvar =3D (len);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 ((__ssp_bos0(dstvar) !=3D (size_t)-1) ?=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __builtin___memset_chk(dstvar, 0, lenvar,=C2=A0=C2=A0=C2=A0 = \ +=C2=A0 =C2=A0 =C2=A0 =C2=A0 __ssp_bos0(dstvar)) : \ +=C2=A0 =C2=A0 __memset_ichk(dstvar, 0, lenvar));=C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 \ +}) + +#define=C2=A0=C2=A0=C2=A0 bzero(dst, len)=C2=A0=C2=A0=C2=A0 _ssp_bzero(__s= sp_var(dstv), dst, __ssp_var(lenv), len) + +#endif /* __SSP_FORTIFY_LEVEL > 0 */ +#endif /* _SSP_STRINGS_H_ */ diff --git a/include/ssp/unistd.h b/include/ssp/unistd.h new file mode 100644 index 000000000000..2414e2baa96b --- /dev/null +++ b/include/ssp/unistd.h @@ -0,0 +1,54 @@ +/*=C2=A0=C2=A0=C2=A0 $NetBSD: unistd.h,v 1.7 2015/06/25 18:41:03 joerg Exp= $=C2=A0=C2=A0=C2=A0 */ + +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF = THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _SSP_UNISTD_H_ +#define _SSP_UNISTD_H_ + +#include + +#if __SSP_FORTIFY_LEVEL > 0 +__BEGIN_DECLS + +__ssp_redirect0(ssize_t, read, (int __fd, void *__buf, size_t __len), \ +=C2=A0 =C2=A0 (__fd, __buf, __len)); + +__ssp_redirect(ssize_t, readlink, (const char *__restrict __path, \ +=C2=A0 =C2=A0 char *__restrict __buf, size_t __len), (__path, __buf, __len= )); + +__ssp_redirect_raw(char *, getcwd, getcwd, (char *__buf, size_t __len), +=C2=A0 =C2=A0 (__buf, __len), __buf !=3D 0, __ssp_bos); + +__END_DECLS + +#endif /* __SSP_FORTIFY_LEVEL > 0 */ +#endif /* _SSP_UNISTD_H_ */ diff --git a/lib/libc/secure/Makefile.inc b/lib/libc/secure/Makefile.inc index 8574c5a05dc5..3b1ad879c715 100644 --- a/lib/libc/secure/Makefile.inc +++ b/lib/libc/secure/Makefile.inc @@ -3,6 +3,17 @@ =20 .PATH: ${LIBC_SRCTOP}/secure =20 +# _FORTIFY_SOURCE +SRCS+=3D=C2=A0=C2=A0=C2=A0 gets_chk.c fgets_chk.c memcpy_chk.c memmove_chk= .c memset_chk.c \ +=C2=A0=C2=A0=C2=A0 snprintf_chk.c sprintf_chk.c stpcpy_chk.c stpncpy_chk.c= \ +=C2=A0=C2=A0=C2=A0 strcat_chk.c strcpy_chk.c strncat_chk.c strncpy_chk.c \ +=C2=A0=C2=A0=C2=A0 vsnprintf_chk.c vsprintf_chk.c + +CFLAGS.snprintf_chk.c+=3D=C2=A0=C2=A0=C2=A0 -Wno-unused-parameter +CFLAGS.sprintf_chk.c+=3D=C2=A0=C2=A0=C2=A0 -Wno-unused-parameter +CFLAGS.vsnprintf_chk.c+=3D=C2=A0=C2=A0=C2=A0 -Wno-unused-parameter +CFLAGS.vsprintf_chk.c+=3D=C2=A0=C2=A0=C2=A0 -Wno-unused-parameter + # Sources common to both syscall interfaces: SRCS+=3D=C2=A0=C2=A0=C2=A0 stack_protector.c \ =C2=A0=C2=A0=C2=A0 stack_protector_compat.c diff --git a/lib/libc/secure/Symbol.map b/lib/libc/secure/Symbol.map index 641f451b5421..7859fcee3821 100644 --- a/lib/libc/secure/Symbol.map +++ b/lib/libc/secure/Symbol.map @@ -3,3 +3,21 @@ FBSD_1.0 { =C2=A0=C2=A0=C2=A0 __stack_chk_fail; =C2=A0=C2=A0=C2=A0 __stack_chk_guard; }; + +FBSD_1.8 { +=C2=A0=C2=A0=C2=A0 __gets_chk; +=C2=A0=C2=A0=C2=A0 __fgets_chk; +=C2=A0=C2=A0=C2=A0 __memcpy_chk; +=C2=A0=C2=A0=C2=A0 __memmove_chk; +=C2=A0=C2=A0=C2=A0 __memset_chk; +=C2=A0=C2=A0=C2=A0 __snprintf_chk; +=C2=A0=C2=A0=C2=A0 __sprintf_chk; +=C2=A0=C2=A0=C2=A0 __stpcpy_chk; +=C2=A0=C2=A0=C2=A0 __stpncpy_chk; +=C2=A0=C2=A0=C2=A0 __strcat_chk; +=C2=A0=C2=A0=C2=A0 __strcpy_chk; +=C2=A0=C2=A0=C2=A0 __strncat_chk; +=C2=A0=C2=A0=C2=A0 __strncpy_chk; +=C2=A0=C2=A0=C2=A0 __vsnprintf_chk; +=C2=A0=C2=A0=C2=A0 __vsprintf_chk; +}; diff --git a/lib/libc/secure/fgets_chk.c b/lib/libc/secure/fgets_chk.c new file mode 100644 index 000000000000..72aa1d816ce1 --- /dev/null +++ b/lib/libc/secure/fgets_chk.c @@ -0,0 +1,54 @@ +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * 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 +__RCSID("$NetBSD: fgets_chk.c,v 1.6 2009/02/05 05:41:51 lukem Exp $"); + +#include +#include +#include +#include + +#include +#include +#undef fgets + +char * +__fgets_chk(char * __restrict buf, int len, size_t slen, FILE *fp) +{ +=C2=A0=C2=A0=C2=A0 if (slen >=3D (size_t)INT_MAX) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 return (fgets(buf, len, fp)); + +=C2=A0=C2=A0=C2=A0 if (len >=3D 0 && (size_t)len > slen) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail(); + +=C2=A0=C2=A0=C2=A0 return (fgets(buf, len, fp)); +} diff --git a/lib/libc/secure/gets_chk.c b/lib/libc/secure/gets_chk.c new file mode 100644 index 000000000000..18c1e2d18f43 --- /dev/null +++ b/lib/libc/secure/gets_chk.c @@ -0,0 +1,74 @@ +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * 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 +__RCSID("$NetBSD: gets_chk.c,v 1.7 2013/10/04 20:49:16 christos Exp $"); + +#include +#include +#include +#include + +#include +#include + +char *__gets_unsafe(char *); + +char * +__gets_chk(char * __restrict buf, size_t slen) +{ +=C2=A0=C2=A0=C2=A0 char *abuf; +=C2=A0=C2=A0=C2=A0 size_t len; + +=C2=A0=C2=A0=C2=A0 if (slen >=3D (size_t)INT_MAX) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 return (__gets_unsafe(buf)); + +=C2=A0=C2=A0=C2=A0 if ((abuf =3D malloc(slen + 1)) =3D=3D NULL) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 return (__gets_unsafe(buf)); + +=C2=A0=C2=A0=C2=A0 if (fgets(abuf, (int)(slen + 1), stdin) =3D=3D NULL) { +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 free(abuf); +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 return (NULL); +=C2=A0=C2=A0=C2=A0 } + +=C2=A0=C2=A0=C2=A0 len =3D strlen(abuf); +=C2=A0=C2=A0=C2=A0 if (len > 0 && abuf[len - 1] =3D=3D '\n') +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 --len; + +=C2=A0=C2=A0=C2=A0 if (len >=3D slen) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail(); + +=C2=A0=C2=A0=C2=A0 (void)memcpy(buf, abuf, len); + +=C2=A0=C2=A0=C2=A0 buf[len] =3D '\0'; +=C2=A0=C2=A0=C2=A0 free(abuf); +=C2=A0=C2=A0=C2=A0 return (buf); +} diff --git a/lib/libc/secure/memcpy_chk.c b/lib/libc/secure/memcpy_chk.c new file mode 100644 index 000000000000..99cf2d5f13ff --- /dev/null +++ b/lib/libc/secure/memcpy_chk.c @@ -0,0 +1,53 @@ +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * 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 +__RCSID("$NetBSD: memcpy_chk.c,v 1.7 2015/05/13 19:57:16 joerg Exp $"); + +#include + +#include +#undef memcpy + +#include "ssp_internal.h" + +void * +__memcpy_chk(void * __restrict dst, const void * __restrict src, size_t le= n, +=C2=A0 =C2=A0 size_t slen) +{ +=C2=A0=C2=A0=C2=A0 if (len > slen) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail(); + +=C2=A0=C2=A0=C2=A0 if (__ssp_overlap((const char *)src, (const char *)dst,= len)) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail(); + +=C2=A0=C2=A0=C2=A0 return (memcpy(dst, src, len)); +} diff --git a/lib/libc/secure/memmove_chk.c b/lib/libc/secure/memmove_chk.c new file mode 100644 index 000000000000..07f965d608fc --- /dev/null +++ b/lib/libc/secure/memmove_chk.c @@ -0,0 +1,47 @@ +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * 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 +__RCSID("$NetBSD: memmove_chk.c,v 1.6 2020/09/05 13:37:59 mrg Exp $"); + +#include + +#include +#undef memmove + +void * +__memmove_chk(void *dst, const void *src, size_t len, +=C2=A0 =C2=A0 size_t slen) +{ +=C2=A0=C2=A0=C2=A0 if (len > slen) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail(); +=C2=A0=C2=A0=C2=A0 return (memmove(dst, src, len)); +} diff --git a/lib/libc/secure/memset_chk.c b/lib/libc/secure/memset_chk.c new file mode 100644 index 000000000000..f337be98b46d --- /dev/null +++ b/lib/libc/secure/memset_chk.c @@ -0,0 +1,46 @@ +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * 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 +__RCSID("$NetBSD: memset_chk.c,v 1.5 2014/09/17 00:39:28 joerg Exp $"); + +#include + +#include +#undef memset + +void * +__memset_chk(void * __restrict dst, int val, size_t len, size_t slen) +{ +=C2=A0=C2=A0=C2=A0 if (len > slen) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail(); +=C2=A0=C2=A0=C2=A0 return (memset(dst, val, len)); +} diff --git a/lib/libc/secure/snprintf_chk.c b/lib/libc/secure/snprintf_chk.= c new file mode 100644 index 000000000000..52ef874ede5b --- /dev/null +++ b/lib/libc/secure/snprintf_chk.c @@ -0,0 +1,56 @@ +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * 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 +__RCSID("$NetBSD: snprintf_chk.c,v 1.5 2008/04/28 20:23:00 martin Exp $"); + +#include +#include + +#include +#undef vsnprintf + +int +__snprintf_chk(char * __restrict buf, size_t len, int flags, size_t slen, +=C2=A0 =C2=A0 const char * __restrict fmt, ...) +{ +=C2=A0=C2=A0=C2=A0 va_list ap; +=C2=A0=C2=A0=C2=A0 int rv; + +=C2=A0=C2=A0=C2=A0 if (len > slen) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail(); + +=C2=A0=C2=A0=C2=A0 va_start(ap, fmt); +=C2=A0=C2=A0=C2=A0 rv =3D vsnprintf(buf, len, fmt, ap); +=C2=A0=C2=A0=C2=A0 va_end(ap); + +=C2=A0=C2=A0=C2=A0 return (rv); +} diff --git a/lib/libc/secure/sprintf_chk.c b/lib/libc/secure/sprintf_chk.c new file mode 100644 index 000000000000..d4c42ccba3ce --- /dev/null +++ b/lib/libc/secure/sprintf_chk.c @@ -0,0 +1,61 @@ +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation *** 1063 LINES SKIPPED *** =20 ------=_Part_1592590_625024558.1716061526186 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
=
It was just pointed out to m= e this sounded insulting .. for which I am sorry.

It's be= en almost 10 years since I last looked at it and it is disappointing to see= my almost-mistake happening. This was a lot of work by Kyle and I didn't m= ean to be dismissive of it.

So ]I'll just shudup and creep back into my hole, sorry for dis= turbing the real work going on.

Pedro.

=20
=20
On Saturday, May 18, 2024 at 01:42:54 PM GMT-5, Ped= ro Giffuni <pfg@freebsd.org> wrote:


=20 =20
Oh no .. please not...

We went into that in a GSoC:



Ultimately it proved to be useless since stack-pr= otector-strong.

The NetBSD code was not well adapted to clang either.

Ask me more if you really w= ant to dig into it, but we don't want this.

Pedro.

=

=20
=20
On Monday, May 13, 2024 at 12:24:13 AM GMT-5, Kyle = Evans <kevans@freebsd.org> wrote:


=20 =20

commit be04fec42638f30f50b5b55fd8e3634c0= fb89928
Author:    Kyle= Evans <kevans@FreeBSD.org>
=
AuthorDate: 2024-05-13 05:23:49 +0000
Commit:    Kyle Evans <keva= ns@FreeBSD.org>
CommitDate:= 2024-05-13 05:23:49 +0000

    Import _FORTIFY_SOURCE imp= lementation from NetBSD
  &nb= sp;
    This is a mostl= y-unmodified copy of the various *_chk implementations
    and headers from NetBSD, without yet mod= ifying system headers to start
&nb= sp;   actually including them.  A future commit will also apply t= he needed
    bits to fi= x ssp/unistd.h.
   
    Reviewed by:  &nbs= p; imp, pauamma_gundo.com (both previous versions), kib
<= /div>
    Sponsored by:  Stormshield
    Sponsored by:  Klara= , Inc.
    Differential = Revision:  https://reviews.freebsd.org/D32306
etc/mtree/BSD.include.dist        | = ; 2 +
include/ssp/ssp.h             = ;     |  91 ++++++++++++++++++++++++++
include/ssp/stdio.h          =       |  93 ++++++++++++++++++++++++++
include/ssp/string.h        &= nbsp;     | 129 ++++++++++++++++++++++++++++++++++++
include/ssp/strings.h      &n= bsp;       |  67 +++++++++++++++++++
=
include/ssp/unistd.h        &nb= sp;     |  54 +++++++++++++++
lib/libc/secure/Makefile.inc      |  11 += +++
lib/libc/secure/Symbol.map&nb= sp;       |  18 +++++
lib/libc/secure/fgets_chk.c        |  54= +++++++++++++++
lib/libc/secure/= gets_chk.c        |  74 +++++++++++++++++++++
lib/libc/secure/memcpy_chk.c  &= nbsp;   |  53 +++++++++++++++
lib/libc/secure/memmove_chk.c      |  47 ++++= +++++++++
lib/libc/secure/memset_= chk.c      |  46 +++++++++++++
lib/libc/secure/snprintf_chk.c    |  56 = ++++++++++++++++
lib/libc/secure/= sprintf_chk.c      |  61 +++++++++++++++++
lib/libc/secure/ssp_internal.h    = |  37 +++++++++++
lib/libc/s= ecure/stpcpy_chk.c      |  55 ++++++++++++++++
lib/libc/secure/stpncpy_chk.c  &nbs= p;   |  53 +++++++++++++++
lib/libc/secure/strcat_chk.c      |  60 ++++++++++= +++++++
lib/libc/secure/strcpy_ch= k.c      |  54 +++++++++++++++
lib/libc/secure/strncat_chk.c      | = ; 70 ++++++++++++++++++++
lib/lib= c/secure/strncpy_chk.c      |  53 +++++++++++++++
lib/libc/secure/vsnprintf_chk.c  =   |  49 ++++++++++++++
= lib/libc/secure/vsprintf_chk.c    |  58 ++++++++++++++++
lib/libssp/Makefile    &n= bsp;           |  20 +++++-
lib/libssp/Symbol.map        &= nbsp;     |  12 ++--
lib/libssp/Versions.def            | = 5 ++
lib/libssp/__builtin_objec= t_size.3 | 110 +++++++++++++++++++++++++++++++
lib/libssp/fortify_stubs.c        | 131 = -------------------------------------
lib/libssp/ssp.3               = ;   | 130 ++++++++++++++++++++++++++++++++++++
32 files changed, 1621 insertions(+), 140 deletions(-)<= br clear=3D"none">

diff --git a/etc/mtree/BSD.include.dist b/etc/mtree/BSD.include.di= st
index a6bd5880bf61..f8c83d6dde7= a 100644
--- a/etc/mtree/BSD.inclu= de.dist
+++ b/etc/mtree/BSD.includ= e.dist
@@ -372,6 +372,8 @@
        mac_veriexec=
        ..
    ..
+    ssp
+    ..
  =   sys
      &= nbsp; disk
      &= nbsp; ..
diff --git a/include/Mak= efile b/include/Makefile
index 19e= 6beb95203..32774419f162 100644
---= a/include/Makefile
+++ b/include/= Makefile
@@ -4,7 +4,7 @@

PACKAGE=3Dclibs
CLEANFILES=3D o= sreldate.h version
-SUBDIR=3D arpa= protocols rpcsvc rpc xlocale
+SUB= DIR=3D arpa protocols rpcsvc rpc ssp xlocale
.if ${MACHINE_CPUARCH} =3D=3D "amd64"
<= div dir=3D"ltr"> SUBDIR+=3D        i386
INCLUDE_SUBDIRS+=3D    = i386
diff --git a/include/ssp/Make= file b/include/ssp/Makefile
new fi= le mode 100644
index 000000000000.= .dff19f43c920
--- /dev/null
+++ b/include/ssp/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+INCS=3D    ssp.h stdio.h s= tring.h strings.h unistd.h
+INCSDI= R=3D    ${INCLUDEDIR}/ssp
+
+.include <bsd.prog.= mk>
diff --git a/include/ssp/ss= p.h b/include/ssp/ssp.h
new file m= ode 100644
index 000000000000..35a= 9aeee02df
--- /dev/null
+++ b/include/ssp/ssp.h
=
@@ -0,0 +1,91 @@
+/*    $NetBSD: ssp.h,v 1.13 2015/09/03 20:43:47 plunk= y Exp $    */
+
+/*-
+ *
+ * SPDX-License-Iden= tifier: BSD-2-Clause
+ *
+ * Copyright (c) 2006, 2011 The NetBSD Fo= undation, Inc.
+ * All rights rese= rved.
+ *
=
+ * This code is derived from software contributed to The = NetBSD Foundation
+ * by Christos = Zoulas.
+ *
+ * Redistribution and use in source and binary forms, w= ith or without
+ * modification, a= re permitted provided that the following conditions
+ * are met:
+ *= 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of cond= itions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright=
+ *    notice, this lis= t of conditions and the following disclaimer in the
+ *    documentation and/or other materials pro= vided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY TH= E NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BU= T NOT LIMITED
+ * TO, THE IMPLIED = WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHAL= L THE FOUNDATION OR CONTRIBUTORS
+= * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDIN= G, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUS= INESS
+ * INTERRUPTION) HOWEVER CA= USED 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.
+ */
+#ifn= def _SSP_SSP_H_
+#define _SSP_SSP_= H_
+
+#include <sys/cdefs.h>
+
+#if !defined(__cpluspl= us)
+# if defined(_FORTIFY_SOURCE)= && _FORTIFY_SOURCE > 0 && \
+    (__OPTIMIZE__ > 0 || defined(__clang__))
+#  if _FORTIFY_SOURCE > 1<= br clear=3D"none">
+#  define __SSP_FORTIFY_LEV= EL 2
+#  else
+#  define __SSP_FORTIFY_LEVEL 1
+#  endif
+# else
+#  def= ine __SSP_FORTIFY_LEVEL 0
+# endif=
+#else
+# define __SSP_FORTIFY_LEVEL 0
+#endif
+
+#define __ssp_bos(ptr) __builtin_object_size(ptr, __SS= P_FORTIFY_LEVEL > 1)
+#define _= _ssp_bos0(ptr) __builtin_object_size(ptr, 0)
+
+#define __ssp_check(= buf, len, bos) \
+  &nbs= p; if (bos(buf) !=3D (size_t)-1 && len > bos(buf)) \
+        __chk_= fail()
+#define __ssp_redirect_raw= (rtype, fun, symbol, args, call, cond, bos) \
+rtype __ssp_real_(fun) args __RENAME(symbol); \
+__ssp_inline rtype fun args __RENAME(__ssp_prot= ected_ ## fun); \
+__ssp_inline rt= ype fun args { \
+  &nbs= p; if (cond) \
+   =     __ssp_check(__buf, __len, bos); \
+    return __ssp_real_(fun) call; \
+}
+
+#define __ssp_redirect= (rtype, fun, args, call) \
+ =   __ssp_redirect_raw(rtype, fun, fun, args, call, 1, __ssp_bos)
+#define __ssp_redirect0(rtype, fun, ar= gs, call) \
+    __ssp_r= edirect_raw(rtype, fun, fun, args, call, 1, __ssp_bos0)
<= /div>
+
+__BEGIN_D= ECLS
+void __stack_chk_fail(void) = __dead2;
+void __chk_fail(void) __= dead2;
+__END_DECLS
+
+#end= if /* _SSP_SSP_H_ */
diff --git a/= include/ssp/stdio.h b/include/ssp/stdio.h
new file mode 100644
inde= x 000000000000..72e3236eac80
--- /= dev/null
+++ b/include/ssp/stdio.h=
@@ -0,0 +1,93 @@
+/*    $NetBSD: stdio.h,v 1.5 2011/= 07/17 20:54:34 joerg Exp $    */
+
+/*-
+ *
+ = * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2006 T= he NetBSD Foundation, Inc.
+ * All= rights reserved.
+ *
+ * This code is derived from software contrib= uted to The NetBSD Foundation
+ * = by Christos Zoulas.
+ *
+ * Redistribution and use in source and b= inary forms, with or without
+ * m= odification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above cop= yright
+ *    notice, th= is list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the = above copyright
+ *    n= otice, this list of conditions and the following disclaimer in the
+ *    documentation and/or othe= r materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS= PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES= , INCLUDING, BUT NOT LIMITED
+ * T= O, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  I= N NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, = EXEMPLARY, OR
+ * CONSEQUENTIAL DA= MAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR = PROFITS; OR BUSINESS
+ * INTERRUPT= ION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLU= DING NEGLIGENCE OR OTHERWISE)
+ * = ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE<= br clear=3D"none">
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef _SSP_STDIO_H_
+= #define _SSP_STDIO_H_
+
+#include <ssp/ssp.h>
+
+__BE= GIN_DECLS
+int __sprintf_chk(char = *__restrict, int, size_t, const char *__restrict, ...)
+    __printflike(4, 5);
<= /div>
+int __vsprintf_chk(char *__restrict, int, size_t, co= nst char *__restrict,
+  &nbs= p; __va_list)
+    __pri= ntflike(4, 0);
+int __snprintf_chk= (char *__restrict, size_t, int, size_t,
+    const char *__restrict, ...)
<= div dir=3D"ltr">+    __printflike(5, 6);
=
+int __vsnprintf_chk(char *__restrict, size_t, int, size_t= ,
+    const char *__re= strict, __va_list)
+    = __printflike(5, 0);
+char *__gets_= chk(char *, size_t);
+char *__fget= s_chk(char *, int, size_t, FILE *);
+__END_DECLS
+
+#if __SSP_FORTIFY_LEVEL > 0
<= /div>
+
+#define s= printf(str, ...) ({    \
+    char *_ssp_str =3D (str);    \
+    __builtin___sprintf_chk(_ss= p_str, 0, __ssp_bos(_ssp_str),        \
+        __VA_ARGS_= _); \
+})
=
+
+#define vsprin= tf(str, fmt, ap) ({    \
+    char *_ssp_str =3D (str);     &nbs= p;  \
+    __builti= n___vsprintf_chk(_ssp_str, 0, __ssp_bos(_ssp_str), fmt,    \=
+        ap);=                = \
+})
+
+#define snprintf(= str, len, ...) ({    \
+    char *_ssp_str =3D (str);      =   \
+    __builtin_= __snprintf_chk(_ssp_str, len, 0, __ssp_bos(_ssp_str),    \
+        __VA_A= RGS__);            \
+})
+
+#define vsnprintf(str, len, = fmt, ap) ({    \
+&= nbsp;   char *_ssp_str =3D (str);       = \
+    __builtin___vsnp= rintf_chk(_ssp_str, len, 0, __ssp_bos(_ssp_str),    \
+        fmt, ap);&n= bsp;           \
=
+})
+
+#define gets(str) ({   =         \
+  char *_ssp_str =3D (str);      &= nbsp; \
+    __gets_chk(= _ssp_str, __ssp_bos(_ssp_str));    \
+})
+
+#define fgets(str, len, fp) ({  = ;      \
+&nbs= p;   char *_ssp_str =3D (str);        \<= br clear=3D"none">
+    __fgets_chk(_ssp_st= r, len, __ssp_bos(_ssp_str), fp);    \
+})
+
+#endif /* __SSP_FORTIFY_LEVEL > 0 */
+
+#endif /* _SSP_STDIO_H_ */
diff --git a/include/ssp/string.h b/include/ssp/string.h
new file mode 100644
index 000000000000..996020fda778
--- /dev/null
+++ b/in= clude/ssp/string.h
@@ -0,0 +1,129 = @@
+/*    $NetBSD: = string.h,v 1.14 2020/09/05 13:37:59 mrg Exp $    */
+
+/*-
+ *
=
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * C= opyright (c) 2006 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived fr= om software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and us= e in source and binary forms, with or without
+ * modification, are permitted provided that the following con= ditions
+ * are met:
+ * 1. Redistributions of source code must reta= in the above copyright
+ *  &= nbsp; notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form mus= t reproduce the above copyright
+ = *    notice, this list of conditions and the following disclaimer= in the
+ *    documenta= tion and/or other materials provided with the distribution.
+ *
+ * = THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IM= PLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FO= R A PARTICULAR
+ * PURPOSE ARE DIS= CLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCID= ENTAL, SPECIAL, EXEMPLARY, OR
+ * = CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS O= F USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER= IN
+ * CONTRACT, STRICT LIABILITY= , OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF= ADVISED OF THE
+ * POSSIBILITY OF= SUCH DAMAGE.
+ */
+#ifndef _SSP_STRING_H_
<= div dir=3D"ltr">+#define _SSP_STRING_H_
+
+#include <ssp/ssp.h>= ;
+
+__BEGIN_DECLS
+void *_= _memcpy_chk(void *, const void *, size_t, size_t);
=
+void *__memmove_chk(void *, const void *, size_t, size_t)= ;
+void *__memset_chk(void *, int,= size_t, size_t);
+char *__stpcpy_= chk(char *, const char *, size_t);
+char *__stpncpy_chk(char *, const char *, size_t, size_t);
+char *__strcat_chk(char *, const char *, size_t= );
+char *__strcpy_chk(char *, con= st char *, size_t);
+char *__strnc= at_chk(char *, const char *, size_t, size_t);
+char *__strncpy_chk(char *, const char *, size_t, size_t);
+__END_DECLS
=
+
+#if __SSP_FORT= IFY_LEVEL > 0
+
+#define __ssp_bos_check3_typed_var(fun, dsttype,= dsrvar, dst, srctype, srcvar, \
+=     src, lenvar, len) ({        &nb= sp;       \
+    srctype srcvar =3D (src);      &= nbsp;         \
+    dsttype dstvar =3D (dst);    &nbs= p;           \
+    size_t lenvar =3D (len);  &nb= sp;             \
+    ((__ssp_bos0(dstvar) !=3D (size= _t)-1) ?        \
+    __builtin___ ## fun ## _chk(dstvar, srcvar, le= nvar,    \
+  =       __ssp_bos0(dstvar)) :      &n= bsp;         \
+    __ ## fun ## _ichk(dstvar, srcvar, lenvar)); = ;   \
+})
+
+#def= ine __ssp_bos_check3_typed(fun, dsttype, dst, srctype, src, len)  = ;  \
+    __ssp_bos= _check3_typed_var(fun, dsttype, __ssp_var(dstv), dst,    \
+        srctyp= e, __ssp_var(srcv), src, __ssp_var(lenv), len)
+
+#define __ssp_bos_= check3(fun, dst, src, len)        \
+    __ssp_bos_check3_typed_var(= fun, void *, __ssp_var(dstv), dst,    \
+        const void *, __ssp_var(s= rcv), src, __ssp_var(lenv), len)
+=
+#define __ssp_bos_check2_var(fun= , dstvar, dst, srcvar, src) ({        \
+    const void *srcvar =3D (= src);              &= nbsp; \
+    void *dstva= r =3D (dst);             =    \
+    ((__= ssp_bos0(dstvar) !=3D (size_t)-1) ?        \<= br clear=3D"none">
+    __builtin___ ## fun= ## _chk(dstvar, srcvar,        \
+        __ssp_bos0(dstva= r)) :              &= nbsp; \
+    __ ## fun #= # _ichk(dstvar, srcvar));        \
+})
+
+#define __ssp_bos_check2(fun= , dst, src)            \
+    __ssp_bos_check2_var(fun= , __ssp_var(dstv), dst, __ssp_var(srcv), src)
+
+#define __ssp_bos_i= check3_restrict(fun, type1, type2) \
+static __inline type1 __ ## fun ## _ichk(type1 __restrict, type2 __rest= rict, size_t); \
+static __inline = __attribute__((__always_inline__)) type1 \
+__ ## fun ## _ichk(type1 __restrict dst, type2 __restrict src, si= ze_t len) { \
+    = return __builtin___ ## fun ## _chk(dst, src, len, __ssp_bos0(dst)); \
+}
+
+#define __ssp_bos_icheck3(= fun, type1, type2) \
+static __inl= ine type1 __ ## fun ## _ichk(type1, type2, size_t); \
+static __inline __attribute__((__always_inline__)) typ= e1 \
+__ ## fun ## _ichk(type1 dst= , type2 src, size_t len) { \
+&nbs= p;   return __builtin___ ## fun ## _chk(dst, src, len, __ssp_bos0= (dst)); \
+}
+
+#define __s= sp_bos_icheck2_restrict(fun, type1, type2) \
+static __inline type1 __ ## fun ## _ichk(type1, type2); \
+static __inline __attribute__((__alway= s_inline__)) type1 \
+__ ## fun ##= _ichk(type1 __restrict dst, type2 __restrict src) { \
+    return __builtin___ ## fun ## _chk= (dst, src, __ssp_bos0(dst)); \
+}<= br clear=3D"none">
+
+__BEGIN_DECLS
+__ssp_bos= _icheck3_restrict(memcpy, void *, const void *)
+__ssp_bos_icheck3(memmove, void *, const void *)
+__ssp_bos_icheck3(memset, void *, int)
+__ssp_bos_icheck2_restrict(stpcpy, cha= r *, const char *)
+__ssp_bos_iche= ck3_restrict(stpncpy, char *, const char *)
+__ssp_bos_icheck2_restrict(strcpy, char *, const char *)
+__ssp_bos_icheck2_restrict(strcat, char = *, const char *)
+__ssp_bos_icheck= 3_restrict(strncpy, char *, const char *)
+__ssp_bos_icheck3_restrict(strncat, char *, const char *)
+__END_DECLS
+
+#define memcpy(dst= , src, len) __ssp_bos_check3(memcpy, dst, src, len)
+#define memmove(dst, src, len) __ssp_bos_check3(memmove,= dst, src, len)
+#define memset(ds= t, val, len) \
+    __ss= p_bos_check3_typed(memset, void *, dst, int, val, len)
+#define stpcpy(dst, src) __ssp_bos_check2(stpcpy, dst= , src)
+#define stpncpy(dst, src, = len) __ssp_bos_check3(stpncpy, dst, src, len)
+#define strcpy(dst, src) __ssp_bos_check2(strcpy, dst, src)
+#define strcat(dst, src) __ssp_bos_= check2(strcat, dst, src)
+#define = strncpy(dst, src, len) __ssp_bos_check3(strncpy, dst, src, len)
+#define strncat(dst, src, len) __ssp_bos_che= ck3(strncat, dst, src, len)
+
+#endif /* __SSP_FORTIFY_LEVEL > 0 = */
+#endif /* _SSP_STRING_H_ */
diff --git a/include/ssp/strings.h b= /include/ssp/strings.h
new file mo= de 100644
index 000000000000..06c9= c7cc0a09
--- /dev/null
+++ b/include/ssp/strings.h
@@ -0,0 +1,67 @@
+/*    $NetBSD: strings.h,v 1.3 2008/04/28 20:22:54= martin Exp $    */
+
+/*-
+ *
+ * SPDX-Licens= e-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2007 The NetBSD Fou= ndation, Inc.
+ * All rights reser= ved.
+ *
<= div dir=3D"ltr">+ * This code is derived from software contributed to The N= etBSD Foundation
+ * by Christos Z= oulas.
+ *
+ * Redistribution and use in source and binary forms, wi= th or without
+ * modification, ar= e permitted provided that the following conditions
=
+ * are met:
+ * = 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of cond= itions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright=
+ *    notice, this lis= t of conditions and the following disclaimer in the
+ *    documentation and/or other materials pro= vided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY TH= E NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BU= T NOT LIMITED
+ * TO, THE IMPLIED = WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHAL= L THE FOUNDATION OR CONTRIBUTORS
+= * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDIN= G, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUS= INESS
+ * INTERRUPTION) HOWEVER CA= USED 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.
+ */
+#ifn= def _SSP_STRINGS_H_
+#define _SSP_= STRINGS_H_
+
+#include <ssp/ssp.h>
+#include <string.h>
+
+#if __SSP_FORTIFY_LEVE= L > 0
+
+#define _ssp_bcopy(srcvar, src, dstvar, dst, lenvar,&nbs= p; len) ({    \
+&n= bsp;   const void *srcvar =3D (src);      &nb= sp;     \
+  &= nbsp; void *dstvar =3D (dst);         &n= bsp;  \
+    size_t= lenvar =3D (len);            = \
+    ((__ssp_bos0(dstv= ar) !=3D (size_t)-1) ?    \
+    __builtin___memmove_chk(dstvar, srcvar, lenvar,&nbs= p;   \
+    &n= bsp;   __ssp_bos0(dstvar)) :        &nbs= p;   \
+    __= memmove_ichk(dstvar, srcvar, lenvar));    \
+})
+
+#define    bcopy(src,= dst, len)            \
+    _ssp_bcopy(__ssp_var(srcv= ), src, __ssp_var(dstv), dst, __ssp_var(lenv), len)
+
+#define _ssp_= bzero(dstvar, dst, lenvar, len) ({        \
+    void *dstvar =3D (ds= t);            \
+    size_t lenvar =3D (len); &n= bsp;          \
=
+    ((__ssp_bos0(dstvar) !=3D (size_t)-1) ?&nbs= p;   \
+    __= builtin___memset_chk(dstvar, 0, lenvar,    \
+        __ssp_bos0(dstvar)) = : \
+    __memset_ichk(d= stvar, 0, lenvar));        \
+})
+
+#define    bzero(dst,= len)    _ssp_bzero(__ssp_var(dstv), dst, __ssp_var(lenv), l= en)
+
+#endif /* __SSP_FORTIFY_LEVEL > 0 */
+#endif /* _SSP_STRINGS_H_ */
<= div dir=3D"ltr">diff --git a/include/ssp/unistd.h b/include/ssp/unistd.h
new file mode 100644
index 000000000000..2414e2baa96b
--- /dev/null
+++ b/include/ssp/unistd.h
@@= -0,0 +1,54 @@
+/*  &nbs= p; $NetBSD: unistd.h,v 1.7 2015/06/25 18:41:03 joerg Exp $   = ; */
+
+/*-
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2006 The NetBSD Foundation, Inc.
+ * All rights reserved.
=
+ *
+ * This code= is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistr= ibution 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 discl= aimer.
+ * 2. Redistributions in b= inary form must reproduce the above copyright
+ *    notice, this list of conditions and the follow= ing disclaimer in the
+ *  &n= bsp; documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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
+ * P= URPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTO= RS
+ * BE LIABLE FOR ANY DIRECT, I= NDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCURE= MENT OF
+ * SUBSTITUTE GOODS OR SE= RVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
=
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIAB= ILITY, WHETHER IN
+ * CONTRACT, ST= RICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOF= TWARE, EVEN IF ADVISED OF THE
+ * = POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef _SSP_UNISTD_H_
+#define _SSP_UNISTD_H_
+
+#include &l= t;ssp/ssp.h>
+
+#if __SSP_FORTIFY_LEVEL > 0
=
+__BEGIN_DECLS
+
+__ssp_redirect0(ssize_t, re= ad, (int __fd, void *__buf, size_t __len), \
+    (__fd, __buf, __len));
+
+__ssp_redirect(s= size_t, readlink, (const char *__restrict __path, \
+    char *__restrict __buf, size_t __len), (__= path, __buf, __len));
+
+__ssp_redirect_raw(char *, getcwd, getcwd= , (char *__buf, size_t __len),
+&n= bsp;   (__buf, __len), __buf !=3D 0, __ssp_bos);
+
+__END_DECLS=
+
+#endif /* __SSP_FORTIFY_LEVEL > 0 */
=
+#endif /* _SSP_UNISTD_H_ */
diff --git a/lib/libc/secure/Makefile.inc b/lib/libc/secure/Mak= efile.inc
index 8574c5a05dc5..3b1a= d879c715 100644
--- a/lib/libc/sec= ure/Makefile.inc
+++ b/lib/libc/se= cure/Makefile.inc
@@ -3,6 +3,17 @@=

.PATH: ${LIBC_SRCTOP}/secure

+# _FORTIFY_SOURCE
+SRCS+=3D    gets_chk.c fg= ets_chk.c memcpy_chk.c memmove_chk.c memset_chk.c \
+    snprintf_chk.c sprintf_chk.c stpcpy_c= hk.c stpncpy_chk.c \
+  =   strcat_chk.c strcpy_chk.c strncat_chk.c strncpy_chk.c \
+    vsnprintf_chk.c vsprintf_c= hk.c
+
+CFLAGS.snprintf_chk.c+=3D    -Wno-unused-para= meter
+CFLAGS.sprintf_chk.c+=3D&nb= sp;   -Wno-unused-parameter
+CFLAGS.vsnprintf_chk.c+=3D    -Wno-unused-parameter
+CFLAGS.vsprintf_chk.c+=3D  = ;  -Wno-unused-parameter
+
# Sources common to both syscall in= terfaces:
SRCS+=3D  &nb= sp; stack_protector.c \
 &nb= sp;  stack_protector_compat.c
diff --git a/lib/libc/secure/Symbol.map b/lib/libc/secure/Symbol.map
index 641f451b5421..7859fcee3821 100644=
--- a/lib/libc/secure/Symbol.map<= br clear=3D"none">
+++ b/lib/libc/secure/Symbol.map
@@ -3,3 +3,21 @@ FBSD_1.0 {
    __stack_chk_fail;
    __stack_chk_guard= ;
};
+
+FBSD_1.8 {
+    __gets_chk;
+    __fgets_chk;
+    __memcpy_chk;
+    __memmove_chk;
+    __memset_chk;
+    __snprintf_chk;
+    __sprintf_chk;
+    __stpcpy_chk;
+    __stpncpy_chk;
+    __strcat_chk;
+    __strcpy_chk;
+    __strncat_chk;
+    __strncpy_chk;
+    __vsnprintf_chk= ;
+    __vsprintf_c= hk;
+};
diff --git a/lib/libc/secure/fgets_chk.c b/lib/libc/secure/f= gets_chk.c
new file mode 100644
index 000000000000..72aa1d816ce1
--- /dev/null
+++ b/lib/libc/secure/fgets_chk.c
@@ -0,0 +1,54 @@
+/*-
+ *
=
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * C= opyright (c) 2006 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived fr= om software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and us= e in source and binary forms, with or without
+ * modification, are permitted provided that the following con= ditions
+ * are met:
+ * 1. Redistributions of source code must reta= in the above copyright
+ *  &= nbsp; notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form mus= t reproduce the above copyright
+ = *    notice, this list of conditions and the following disclaimer= in the
+ *    documenta= tion and/or other materials provided with the distribution.
+ *
+ * = THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IM= PLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FO= R A PARTICULAR
+ * PURPOSE ARE DIS= CLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCID= ENTAL, SPECIAL, EXEMPLARY, OR
+ * = CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS O= F 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 <sys/cdefs.h>
<= /div>
+__RCSID("$NetBSD: fgets_chk.c,v 1.6 2009/02/05 05:41= :51 lukem Exp $");
+
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+=
+#include <ssp/stdio.h>
+#include <ssp/string.h>
+#undef fgets
+
+char *
+__fgets_chk(char * __restrict buf, int le= n, size_t slen, FILE *fp)
+{
+    if (slen >=3D (s= ize_t)INT_MAX)
+   =     return (fgets(buf, len, fp));
<= div dir=3D"ltr">+
+  &nb= sp; if (len >=3D 0 && (size_t)len > slen)
<= /div>
+        __chk_fail();<= br clear=3D"none">
+
+    return (fgets(buf, len, fp));
+}
diff -= -git a/lib/libc/secure/gets_chk.c b/lib/libc/secure/gets_chk.c
new file mode 100644
<= div dir=3D"ltr">index 000000000000..18c1e2d18f43
--- /dev/null
+++ b= /lib/libc/secure/gets_chk.c
@@ -0,= 0 +1,74 @@
+/*-
=
+ *
+ * SPD= X-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2006 The Ne= tBSD Foundation, Inc.
+ * All righ= ts reserved.
+ *
+ * This code is derived from software contributed = to The NetBSD Foundation
+ * by Ch= ristos Zoulas.
+ *
+ * Redistribution and use in source and binary f= orms, with or without
+ * modifica= tion, 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 co= pyright
+ *    notice, t= his list of conditions and the following disclaimer in the
+ *    documentation and/or other materi= als provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDE= D BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
<= div dir=3D"ltr">+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUD= ING, BUT NOT LIMITED
+ * TO, THE I= MPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EV= ENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMP= LARY, OR
+ * CONSEQUENTIAL DAMAGES= (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFI= TS; OR BUSINESS
+ * INTERRUPTION) = HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING = NEGLIGENCE OR OTHERWISE)
+ * ARISI= NG IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: gets_chk.c,v 1.7 2013/10/04 20:49:16 christos Exp $");<= br clear=3D"none">
+
+#include <limits.h>
+#include <stdio.h>
+#incl= ude <stdlib.h>
+#include <= ;string.h>
+
=
+#include <ssp/stdio.h>
+#include <ssp/string.h>
<= div dir=3D"ltr">+
+char *__gets_un= safe(char *);
+
=
+char *
+__= gets_chk(char * __restrict buf, size_t slen)
+{
+    = char *abuf;
+    si= ze_t len;
+
+    if (slen >=3D (size_t)INT_MAX)
+      &nbs= p; return (__gets_unsafe(buf));
+<= br clear=3D"none">
+    if ((abuf =3D = malloc(slen + 1)) =3D=3D NULL)
+&n= bsp;       return (__gets_unsafe(buf));
+
+    if (fgets(abuf, (int)(slen + 1), stdin) =3D=3D NULL) {=
+      &= nbsp; free(abuf);
+  &nb= sp;     return (NULL);
+    }
+
+    len =3D strlen(abuf)= ;
+    if (len >= 0 && abuf[len - 1] =3D=3D '\n')
+        --len;
+
+ &nbs= p;  if (len >=3D slen)
+&n= bsp;       __chk_fail();
<= div dir=3D"ltr">+
+  &nb= sp; (void)memcpy(buf, abuf, len);
= +
+    buf[len] =3D= '\0';
+    free(ab= uf);
+    return (b= uf);
+}
diff --git a/lib/libc/secure/memcpy_chk.c b/lib/libc/secure/= memcpy_chk.c
new file mode 100644<= br clear=3D"none">
index 000000000000..99cf2d5f13ff
--- /dev/null
+++ b/lib/libc/secure/memcpy_chk.c
@@ -0,0 +1,53 @@
+/*-
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ = * Copyright (c) 2006 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived= from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution an= d use in source and binary forms, with or without
<= div dir=3D"ltr">+ * modification, are permitted provided that the following= conditions
+ * are met:
+ * 1. Redistributions of source code must= retain the above copyright
+ *&nb= sp;   notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary for= m must reproduce the above copyright
+ *    notice, this list of conditions and the following discl= aimer in the
+ *    docu= mentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIB= UTORS
+ * ``AS IS'' AND ANY EXPRES= S OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT= NESS FOR A PARTICULAR
+ * PURPOSE = ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION 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 LI= ABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, = EVEN IF ADVISED OF THE
+ * POSSIBI= LITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: memcpy_chk.c,v 1.7 2015/05/= 13 19:57:16 joerg Exp $");
+
+#include <string.h>
+
+#i= nclude <ssp/string.h>
+#unde= f memcpy
+
+#include "ssp_internal.h"
+
+void *
+__memcpy_chk(void * __restrict dst, const void= * __restrict src, size_t len,
+&n= bsp;   size_t slen)
+{
+    if (len > slen)
+      &nb= sp; __chk_fail();
+
+    if (__ssp_overlap((const cha= r *)src, (const char *)dst, len))
= +        __chk_fail();
+
+  =   return (memcpy(dst, src, len));
+}
diff --git a/lib/libc/secu= re/memmove_chk.c b/lib/libc/secure/memmove_chk.c
new file mode 100644
index 000000000000..07f965d608fc
--- /dev/null
+++ b/lib/libc/secu= re/memmove_chk.c
@@ -0,0 +1,47 @@<= br clear=3D"none">
+/*-
+ *
+ * SPDX-License-I= dentifier: BSD-2-Clause
+ *
+ * Copyright (c) 2006 The NetBSD Founda= tion, Inc.
+ * All rights reserved= .
+ *
+ * This code is derived from software contributed to The NetB= SD Foundation
+ * by Christos Zoul= as.
+ *
+ * Redistribution and use in source and binary forms, with = or without
+ * modification, are p= ermitted provided that the following conditions
+ * are met:
+ * 1. = Redistributions of source code must retain the above copyright
+ *    notice, this list of conditio= ns 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 provide= d with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NE= TBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NO= T LIMITED
+ * TO, THE IMPLIED WARR= ANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL TH= E FOUNDATION OR CONTRIBUTORS
+ * B= E LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, B= UT NOT LIMITED TO, PROCUREMENT OF
= + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINES= S
+ * 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
<= /div>
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include= <sys/cdefs.h>
+__RCSID("$Ne= tBSD: memmove_chk.c,v 1.6 2020/09/05 13:37:59 mrg Exp $");
+
+#inclu= de <string.h>
+
+#include <ssp/string.h>
+#undef memmove
+
+void *
+__memmove_chk(void *dst, const void *src, size_t= len,
+    size_t slen)<= br clear=3D"none">
+{
+    if (len > slen)
+        __chk_fail();
+    return (memmove(dst, = src, len));
+}
<= /div>
diff --git a/lib/libc/secure/memset_chk.c b/lib/libc/= secure/memset_chk.c
new file mode = 100644
index 000000000000..f337be9= 8b46d
--- /dev/null
+++ b/lib/libc/secure/memset_chk.c
@@ -0,0 +1,46 @@
+/*-
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2006 The NetBSD Foundation, Inc.
<= /div>
+ * All rights reserved.
+ *
+ * This code is = derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribut= ion and use in source and binary forms, with or without
<= /div>
+ * modification, are permitted provided that the fol= lowing conditions
+ * are met:
+ * 1. Redistributions of source code= must retain the above copyright
+= *    notice, this list of conditions and the following disclaime= r.
+ * 2. Redistributions in binar= y 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 NETBSD FOUNDATION, INC. AND C= ONTRIBUTORS
+ * ``AS IS'' AND ANY = EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY A= ND FITNESS FOR A PARTICULAR
+ * PU= RPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTOR= S
+ * BE LIABLE FOR ANY DIRECT, IN= DIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREM= ENT OF
+ * SUBSTITUTE GOODS OR SER= VICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
<= div dir=3D"ltr">+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABI= LITY, WHETHER IN
+ * CONTRACT, STR= ICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFT= WARE, EVEN IF ADVISED OF THE
+ * P= OSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: memset_chk.c,v 1.5 20= 14/09/17 00:39:28 joerg Exp $");
+=
+#include <string.h>
+
+#include <ssp/string.h>
= +#undef memset
+
+void *
+_= _memset_chk(void * __restrict dst, int val, size_t len, size_t slen)
+{
+    if (len > slen)
+        __chk_fail();
+    return (memset(dst, val, le= n));
+}
diff --git a/lib/libc/secure/snprintf_chk.c b/lib/libc/secur= e/snprintf_chk.c
new file mode 100= 644
index 000000000000..52ef874ede= 5b
--- /dev/null
+++ b/lib/libc/secure/snprintf_chk.c
@@ -0,0 +1,56 @@
+/*-
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2006 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is d= erived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistributi= on and use in source and binary forms, with or without
+ * modification, are permitted provided that the foll= owing 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 NETBSD FOUNDATION, INC. AND C= ONTRIBUTORS
+ * ``AS IS'' AND ANY = EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY A= ND FITNESS FOR A PARTICULAR
+ * PU= RPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTOR= S
+ * BE LIABLE FOR ANY DIRECT, IN= DIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREM= ENT OF
+ * SUBSTITUTE GOODS OR SER= VICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
<= div dir=3D"ltr">+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABI= LITY, WHETHER IN
+ * CONTRACT, STR= ICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFT= WARE, EVEN IF ADVISED OF THE
+ * P= OSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: snprintf_chk.c,v 1.5 = 2008/04/28 20:23:00 martin Exp $");
+
+#include <stdarg.h>
+#include <stdio.h>
+
+#= include <ssp/stdio.h>
+#unde= f vsnprintf
+
+int
+__snpri= ntf_chk(char * __restrict buf, size_t len, int flags, size_t slen,
+    const char * __restrict fmt= , ...)
+{
=
+    va_list ap;
+    int rv;
+
+    if = (len > slen)
+   = ;     __chk_fail();
+
+    va_start(ap= , fmt);
+    rv =3D= vsnprintf(buf, len, fmt, ap);
+&n= bsp;   va_end(ap);
+
+    return (rv);
+}
diff --git a/lib/libc/secure/sprintf_chk.c b/lib/libc/secure/sprintf_= chk.c
new file mode 100644
index 000000000000..d4c42ccba3ce
--- /dev/null
+++ b/lib/libc/secure/sprintf_chk.c
@@ -0,0 +1,61 @@
+/= *-
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
<= /div>
+ *
+ * Copy= right (c) 2006 The NetBSD Foundation, Inc.
+ * All rights reserved.
= + *
+ * This code is derived from = software contributed to The NetBSD Foundation
*** 1063 LINES SKIPPED ***
------=_Part_1592590_625024558.1716061526186-- From nobody Sat May 18 22:50:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VhfF55pQBz5K9NW; Sat, 18 May 2024 22:50: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 4VhfF55486z3wp5; Sat, 18 May 2024 22:50:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716072649; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GOk7igSl/BWEbeMOZXwfE5YVb7RnuGuB7/CqtCwBxW4=; b=sLFRXFuBqALPpgv4OzYPULM0myv+RrMpgblYd6DZ1ZjuVvlgzmuFtDaHfIMkuDPJnpHzKs QXvLWDN4aWzilmrw6Ep9tc0tHDvoMkcPnynmnnEAx8vF0qtxINON+wC0S+SF3QjPgIPSIY ExzPq8uFT8XOW6Aa7fdh1WwS9EYETGXza9lXjHWev37q+EtIMNrnnlXoOM3jcJhCzIC9/T Odktd50gaeGzWXjwtmC8eCibcLEMT+vpRLYjmGSUzIVyvjJvDsfEESXyZqvREica20xmR9 9ENZ5Zb4x2DjKKZluN9Xd/KvLc6YUWfT3x1klO9oWfT7iiBv0LT2ShFSj7uzHQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716072649; a=rsa-sha256; cv=none; b=Gzb8ufUHERd1nXzgQ8dWfd/WUHdnxeZDzps0gUQdd+gLIyqzTf9Ebu5CR1i6iGW9k84tv0 pZNip1oWsak+aJ4JRuE+mloWHuqLe06Ax7G3PxrIhW6D1EJ+ScgpFeZE90P+wfzd0k+d2B dT6vIE7IBgWUv2qK+sD/kyoGiqLueHHqjrfljOspY1fU5QP4bzNLhI+gMmwz+73q7wWbfR 2QZmQYo8DSCtkrmqWsiBhMpNIbZ8F1scp9Cq6JMh5QCknuo+CUdtoN82x2p3H6GpY08btx RsDQyhcdi/6zPm3u4LzMumewtGMnO9eVdd+sKXIfWcua8rmcBUT6PMU5wnGQrA== 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=1716072649; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GOk7igSl/BWEbeMOZXwfE5YVb7RnuGuB7/CqtCwBxW4=; b=fBg49tODNO8rZgrPqqsiJw/wTPZflGfUO6x3MQcf9Ww8VC5dgW16CHXeiLbwHFr6y/g7Xa +c+0H58aUm+eMyknHWkJ9A9x/dTwm+pbLYmDRvNVdy/uWpDLEb7h1eTo9t+rI0JDgVF91b YQr9UUFKBkMdBX5egeicLsZPVJ8vDG1sy2DZ5e7OdnFrLapYkLx42A6iAY0oQoykcS+IEB NBoOp29tqR01jUghjE/0OQb7AeWlt52xkxab0wZZEG0Xd4yY6Rie6fh69b8BMpyd261uOP J2Lb3SMSx+Zm3CaEJkZE+jLgi4vBwmUMuB7rzwhdg25igrGLODj20AnsAuLk7w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VhfF54gkdzkfc; Sat, 18 May 2024 22:50: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 44IMonqi068606; Sat, 18 May 2024 22:50:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44IMonJP068603; Sat, 18 May 2024 22:50:49 GMT (envelope-from git) Date: Sat, 18 May 2024 22:50:49 GMT Message-Id: <202405182250.44IMonJP068603@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: ff4480baf6f1 - main - nfs client comment typo fix List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ff4480baf6f15551aee58707bffc9b15608d89d8 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ff4480baf6f15551aee58707bffc9b15608d89d8 commit ff4480baf6f15551aee58707bffc9b15608d89d8 Author: Konstantin Belousov AuthorDate: 2024-05-18 22:49:59 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-18 22:49:59 +0000 nfs client comment typo fix Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/fs/nfsclient/nfs_clbio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c index ed7149c27903..fe2ed0dff0dd 100644 --- a/sys/fs/nfsclient/nfs_clbio.c +++ b/sys/fs/nfsclient/nfs_clbio.c @@ -366,7 +366,7 @@ nfs_bioread_check_cons(struct vnode *vp, struct thread *td, struct ucred *cred) bool old_lock; /* - * Ensure the exclusove access to the node before checking + * Ensure the exclusive access to the node before checking * whether the cache is consistent. */ old_lock = ncl_excl_start(vp); From nobody Sat May 18 22:54:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VhfKX6XKhz5K9mm; Sat, 18 May 2024 22:54:40 +0000 (UTC) (envelope-from kaevans@fastmail.com) Received: from wfout6-smtp.messagingengine.com (wfout6-smtp.messagingengine.com [64.147.123.149]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4VhfKW6N71z3xXx; Sat, 18 May 2024 22:54:39 +0000 (UTC) (envelope-from kaevans@fastmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=fastmail.com header.s=fm1 header.b=I5PKKia9; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=Jplcu3rv; dmarc=pass (policy=none) header.from=fastmail.com; spf=pass (mx1.freebsd.org: domain of kaevans@fastmail.com designates 64.147.123.149 as permitted sender) smtp.mailfrom=kaevans@fastmail.com Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfout.west.internal (Postfix) with ESMTP id 7E0821C00086; Sat, 18 May 2024 18:54:37 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sat, 18 May 2024 18:54:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:message-id:mime-version:reply-to :subject:subject:to:to; s=fm1; t=1716072877; x=1716159277; bh=J2 pYBBVuRXIqa2aHGUnzCOOk0MsVUSUvPIIuO84Lb8g=; b=I5PKKia9ODFkX+zML/ MKkdh26z9ON77QG5Byp8sdQ0JcTumfh2q7wPwOF0ev0x4KHnb+F/V4N/QZbb/vCt X9WeEU5yhuodrJMX+zgD32oqY7RwFez37AXgA90DM1ky2HA+8TM9Q2TM3/2AZzit xRhq2qmTgvZ9zcpTebt7AbAbh2qCEBDqf87g7B4zodWu8iudUs3HqHjWM24yOq3v Yi3bCz052kQS+qm/fnthoMDYSsPq/hDBDRy+6xVidChDkC4gnHqEStqHPDqCQ4iQ w6/J3nV7CdWlPGYBZLbb7cA5XZRkxsUPCxIL/kGxqzpBr6Q56gvyc6geyAjqpfQQ whTA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:message-id:mime-version:reply-to:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1716072877; x=1716159277; bh=J2pYBBVuRXIqa 2aHGUnzCOOk0MsVUSUvPIIuO84Lb8g=; b=Jplcu3rvBwxxdVDk916K31SxqPnaP uASNc/nbAmVKIdRAa74nmNNYeQkEkIwcbL1EbStdxMlsgofoIqeSWGQsgaD1aG6R tjxqoczxJfkdjz3FrgUPsqA10VfjfuvbGsocYkzUJL0uIr/8Bd8sM5v5MmFtIxDI QqZyoCgHMFLmv92LByUoHnPvFl3e3SgimB2CfsV0T7gOf1VQUu/DkZi4B/uDIPHf Af3GNgPbM30zZFwVjSTtrQktv68u6NC34wCkPSMOrqmUXgZzHhzCA7ghTIbz0S+/ nW7Q7mB8tW1j1IjzDCtR7LSBxZ1JNY0lmk4CZCORcAAv4v+eWY6B6oK+g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdehjedgudehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffuffkhffvvegkrfgigggtgfeshh gsredttddtjeenucfhrhhomhepmfihlhgvucfgvhgrnhhsuceokhgrvghvrghnshesfhgr shhtmhgrihhlrdgtohhmqeenucggtffrrghtthgvrhhnpeekleeileeugfevgfdutdeiud eujedvhfdvteekueeuhfdtjeekiefhgfehjedtveenucffohhmrghinhepfhhrvggvsghs ugdrohhrghdpphhrohhgrdhmkhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehkrggvvhgrnhhssehfrghsthhmrghilhdrtghomh X-ME-Proxy: Feedback-ID: i4c21499f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 18 May 2024 18:54:35 -0400 (EDT) Date: Sat, 18 May 2024 17:54:28 -0500 Subject: Re: git: be04fec42638 - main - Import _FORTIFY_SOURCE implementation from NetBSD Message-ID: <02326b5e-a1fe-4411-a869-d21f9a76130c@email.android.com> X-Android-Message-ID: <02326b5e-a1fe-4411-a869-d21f9a76130c@email.android.com> From: Kyle Evans To: Pedro Giffuni Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Importance: Normal X-Priority: 3 X-MSMail-Priority: Normal List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: base64 X-Spamd-Bar: / X-Spamd-Result: default: False [0.37 / 15.00]; THREAD_HIJACKING_FROM_INJECTOR(2.00)[]; FAKE_REPLY(1.00)[]; MIME_BASE64_TEXT_BOGUS(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; NEURAL_HAM_SHORT(-0.93)[-0.926]; DMARC_POLICY_ALLOW(-0.50)[fastmail.com,none]; R_DKIM_ALLOW(-0.20)[fastmail.com:s=fm1,messagingengine.com:s=fm1]; MIME_HTML_ONLY(0.20)[]; R_SPF_ALLOW(-0.20)[+ip4:64.147.123.128/27]; RCVD_IN_DNSWL_LOW(-0.10)[64.147.123.149:from]; MIME_BASE64_TEXT(0.10)[]; RCVD_COUNT_THREE(0.00)[3]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:~]; FREEMAIL_FROM(0.00)[fastmail.com]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[fastmail.com:+,messagingengine.com:+]; HAS_X_PRIO_THREE(0.00)[3]; RCVD_VIA_SMTP_AUTH(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ASN(0.00)[asn:29838, ipnet:64.147.123.0/24, country:US]; RCPT_COUNT_THREE(0.00)[4]; MISSING_XM_UA(0.00)[]; FREEMAIL_ENVFROM(0.00)[fastmail.com]; DWL_DNSWL_NONE(0.00)[messagingengine.com:dkim] X-Rspamd-Queue-Id: 4VhfKW6N71z3xXx PGRpdiBkaXI9J2F1dG8nPjxkaXY+PGJyPjxkaXYgY2xhc3M9ImdtYWlsX2V4dHJhIj48YnI+PGRp diBjbGFzcz0iZ21haWxfcXVvdGUiPk9uIE1heSAxOCwgMjAyNCAxMzo0MiwgUGVkcm8gR2lmZnVu aSAmbHQ7cGZnQGZyZWVic2Qub3JnJmd0OyB3cm90ZTo8YnIgdHlwZT0iYXR0cmlidXRpb24iPjxi bG9ja3F1b3RlIGNsYXNzPSJxdW90ZSIgc3R5bGU9Im1hcmdpbjowIDAgMCAuOGV4O2JvcmRlci1s ZWZ0OjFweCAjY2NjIHNvbGlkO3BhZGRpbmctbGVmdDoxZXgiPjxkaXY+PGRpdiBzdHlsZT0iZm9u dC1mYW1pbHk6J2hlbHZldGljYSBuZXVlJyAsICdoZWx2ZXRpY2EnICwgJ2FyaWFsJyAsIHNhbnMt c2VyaWY7Zm9udC1zaXplOjE2cHgiPjxkaXY+PC9kaXY+CiAgICAgICAgPGRpdiBkaXI9Imx0ciI+ T2ggbm8gLi4gcGxlYXNlIG5vdC4uLjwvZGl2PjxkaXYgZGlyPSJsdHIiPjxicj48L2Rpdj48ZGl2 IGRpcj0ibHRyIj5XZSB3ZW50IGludG8gdGhhdCBpbiBhIEdTb0M6PC9kaXY+PGRpdiBkaXI9Imx0 ciI+PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPjxhIGhyZWY9Imh0dHBzOi8vd2lraS5mcmVlYnNk Lm9yZy9TdW1tZXJPZkNvZGUyMDE1L0ZyZWVCU0RMaWJjU2VjdXJpdHlFeHRlbnNpb25zIj5odHRw czovL3dpa2kuZnJlZWJzZC5vcmcvU3VtbWVyT2ZDb2RlMjAxNS9GcmVlQlNETGliY1NlY3VyaXR5 RXh0ZW5zaW9uczwvYT48YnI+PC9kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj48YnI+PC9kaXY+PGRp diBkaXI9Imx0ciI+VWx0aW1hdGVseSBpdCBwcm92ZWQgdG8gYmUgdXNlbGVzcyBzaW5jZSBzdGFj ay1wcm90ZWN0b3Itc3Ryb25nLjwvZGl2PjwvZGl2PjwvZGl2PjwvYmxvY2txdW90ZT48L2Rpdj48 L2Rpdj48L2Rpdj48ZGl2IGRpcj0iYXV0byI+PGJyPjwvZGl2PjxkaXYgZGlyPSJhdXRvIj5SZXNw ZWN0ZnVsbHksIEkgZGlzYWdyZWUgd2l0aCB5b3VyIGNvbmNsdXNpb24gaGVyZTo8L2Rpdj48ZGl2 IGRpcj0iYXV0byI+PGJyPjwvZGl2PjxkaXYgZGlyPSJhdXRvIj4xLikgX0ZPUlRJRllfU09VUkNF IHByb3ZpZGVzIG1vcmUgZ3JhbnVsYXIgZGV0ZWN0aW9uIG9mIG92ZXJmbG93OyBJIGRvbid0IGhh dmUgdG8gb3ZlcmZsb3cgYWxsIHRoZSB3YXkgaW50byB0aGUgY2FuYXJ5IGF0IHRoZSBlbmQgb2Yg dGhlIGZyYW1lIHRvIGJlIGRldGVjdGVkLCBzbyBteSBtaW5vciBidWcgbm93IGNhbiBiZSBjYXVn aHQgYmVmb3JlIHNvbWV0aGluZyBjYXVzZXMgdGhlIHN0YWNrIGZyYW1lIHRvIGJlIHJlYXJyYW5n ZWQgYW5kIHR1cm4gaXQgaW50byBhIHNlY3VyaXR5IGlzc3VlIGxhdGVyPC9kaXY+PGRpdiBkaXI9 ImF1dG8iPjxicj48L2Rpdj48ZGl2IGRpcj0iYXV0byI+Mi4pIF9fYnVpbHRpbl9vYmplY3Rfc2l6 ZSBkb2Vzbid0IHdvcmsgb24gaGVhcCBvYmplY3RzLCBidXQgaXQgYWN0dWFsbHkgY2FuIHdvcmsg b24gc3Vib2JqZWN0cyBmcm9tIGEgaGVhcCBhbGxvY2F0aW9uIChlLmcuLCAmYW1wO2Zvby0mZ3Q7 bmFtZSksIHNvIHRoZSBjb3ZlcmFnZSBleHRlbmRzIGJleW9uZCB0aGUgc3RhY2sgaW50byBzdGFy dGluZyB0byBkZXRlY3Qgb3RoZXIga2luZHMgb2Ygb3ZlcmZsb3cmbmJzcDs8L2Rpdj48ZGl2IGRp cj0iYXV0byI+PGJyPjwvZGl2PjxkaXYgZGlyPSJhdXRvIj5XaGlsZSB0aGUgc2VjdXJpdHkgdmFs dWUgb3ZlciBzdGFjay1wcm90ZWN0b3Itc3Ryb25nIG1heSBiZSBtYXJnaW5hbCAoSSB3b24ndCBk ZWJhdGUgdGhpcyBzcGVjaWZpY2FsbHkpLCB0aGUgZmVhdHVyZSBzdGlsbCBoYXMgdmFsdWUgaW4g Z2VuZXJhbC48L2Rpdj48ZGl2IGRpcj0iYXV0byI+PGJyPjwvZGl2PjxkaXYgZGlyPSJhdXRvIj5U aGFua3MsPC9kaXY+PGRpdiBkaXI9ImF1dG8iPjxicj48L2Rpdj48ZGl2IGRpcj0iYXV0byI+S3ls ZSBFdmFuczwvZGl2PjxkaXYgZGlyPSJhdXRvIj48YnI+PC9kaXY+PGRpdiBkaXI9ImF1dG8iPjxk aXYgY2xhc3M9ImdtYWlsX2V4dHJhIj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+PGJsb2NrcXVv dGUgY2xhc3M9InF1b3RlIiBzdHlsZT0ibWFyZ2luOjAgMCAwIC44ZXg7Ym9yZGVyLWxlZnQ6MXB4 ICNjY2Mgc29saWQ7cGFkZGluZy1sZWZ0OjFleCI+PGRpdj48ZGl2IHN0eWxlPSJmb250LWZhbWls eTonaGVsdmV0aWNhIG5ldWUnICwgJ2hlbHZldGljYScgLCAnYXJpYWwnICwgc2Fucy1zZXJpZjtm b250LXNpemU6MTZweCI+PGRpdiBkaXI9Imx0ciI+VGhlIE5ldEJTRCBjb2RlIHdhcyBub3Qgd2Vs bCBhZGFwdGVkIHRvIGNsYW5nIGVpdGhlci48L2Rpdj48ZGl2IGRpcj0ibHRyIj48YnI+PC9kaXY+ PGRpdiBkaXI9Imx0ciI+QXNrIG1lIG1vcmUgaWYgeW91IHJlYWxseSB3YW50IHRvIGRpZyBpbnRv IGl0LCBidXQgd2UgZG9uJ3Qgd2FudCB0aGlzLjwvZGl2PjxkaXYgZGlyPSJsdHIiPjxicj48L2Rp dj48ZGl2IGRpcj0ibHRyIj5QZWRyby48L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2Pjxicj48L2Rp dj4KICAgICAgICAKICAgICAgICA8L2Rpdj48ZGl2PgogICAgICAgICAgICA8ZGl2IHN0eWxlPSJm b250LWZhbWlseTonaGVsdmV0aWNhIG5ldWUnICwgJ2hlbHZldGljYScgLCAnYXJpYWwnICwgc2Fu cy1zZXJpZjtmb250LXNpemU6MTNweDtjb2xvcjojMjYyODJhIj4KICAgICAgICAgICAgICAgIAog ICAgICAgICAgICAgICAgPGRpdj4KICAgICAgICAgICAgICAgICAgICAgICAgT24gTW9uZGF5LCBN YXkgMTMsIDIwMjQgYXQgMTI6MjQ6MTMgQU0gR01ULTUsIEt5bGUgRXZhbnMgJmx0O2tldmFuc0Bm cmVlYnNkLm9yZyZndDsgd3JvdGU6CiAgICAgICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAg ICAgICAgICAgICAgPGRpdj48YnI+PC9kaXY+CiAgICAgICAgICAgICAgICAgICAgPGRpdj48YnI+ PC9kaXY+CiAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAg PGRpdj48ZGl2IGRpcj0ibHRyIj5UaGUgYnJhbmNoIG1haW4gaGFzIGJlZW4gdXBkYXRlZCBieSBr ZXZhbnM6PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj5V Ukw6IDxhIGhyZWY9Imh0dHBzOi8vY2dpdC5GcmVlQlNELm9yZy9zcmMvY29tbWl0Lz9pZD1iZTA0 ZmVjNDI2MzhmMzBmNTBiNWI1NWZkOGUzNjM0YzBmYjg5OTI4Ij5odHRwczovL2NnaXQuRnJlZUJT RC5vcmcvc3JjL2NvbW1pdC8/aWQ9YmUwNGZlYzQyNjM4ZjMwZjUwYjViNTVmZDhlMzYzNGMwZmI4 OTkyODwvYT48YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIi PmNvbW1pdCBiZTA0ZmVjNDI2MzhmMzBmNTBiNWI1NWZkOGUzNjM0YzBmYjg5OTI4PGJyPjwvZGl2 PjxkaXYgZGlyPSJsdHIiPkF1dGhvcjombmJzcDsgJm5ic3A7ICBLeWxlIEV2YW5zICZsdDs8YSBo cmVmPSJtYWlsdG86a2V2YW5zQEZyZWVCU0Qub3JnIj5rZXZhbnNARnJlZUJTRC5vcmc8L2E+Jmd0 Ozxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj5BdXRob3JEYXRlOiAyMDI0LTA1LTEzIDA1OjIzOjQ5 ICswMDAwPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPkNvbW1pdDombmJzcDsgJm5ic3A7ICBLeWxl IEV2YW5zICZsdDs8YSBocmVmPSJtYWlsdG86a2V2YW5zQEZyZWVCU0Qub3JnIj5rZXZhbnNARnJl ZUJTRC5vcmc8L2E+Jmd0Ozxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj5Db21taXREYXRlOiAyMDI0 LTA1LTEzIDA1OjIzOjQ5ICswMDAwPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPjxicj48L2Rpdj48 ZGl2IGRpcj0ibHRyIj4mbmJzcDsgJm5ic3A7IEltcG9ydCBfRk9SVElGWV9TT1VSQ0UgaW1wbGVt ZW50YXRpb24gZnJvbSBOZXRCU0Q8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+Jm5ic3A7ICZuYnNw OyA8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+Jm5ic3A7ICZuYnNwOyBUaGlzIGlzIGEgbW9zdGx5 LXVubW9kaWZpZWQgY29weSBvZiB0aGUgdmFyaW91cyAqX2NoayBpbXBsZW1lbnRhdGlvbnM8YnI+ PC9kaXY+PGRpdiBkaXI9Imx0ciI+Jm5ic3A7ICZuYnNwOyBhbmQgaGVhZGVycyBmcm9tIE5ldEJT RCwgd2l0aG91dCB5ZXQgbW9kaWZ5aW5nIHN5c3RlbSBoZWFkZXJzIHRvIHN0YXJ0PGJyPjwvZGl2 PjxkaXYgZGlyPSJsdHIiPiZuYnNwOyAmbmJzcDsgYWN0dWFsbHkgaW5jbHVkaW5nIHRoZW0uJm5i c3A7IEEgZnV0dXJlIGNvbW1pdCB3aWxsIGFsc28gYXBwbHkgdGhlIG5lZWRlZDxicj48L2Rpdj48 ZGl2IGRpcj0ibHRyIj4mbmJzcDsgJm5ic3A7IGJpdHMgdG8gZml4IHNzcC91bmlzdGQuaC48YnI+ PC9kaXY+PGRpdiBkaXI9Imx0ciI+Jm5ic3A7ICZuYnNwOyA8YnI+PC9kaXY+PGRpdiBkaXI9Imx0 ciI+Jm5ic3A7ICZuYnNwOyBSZXZpZXdlZCBieTombmJzcDsgJm5ic3A7IGltcCwgcGF1YW1tYV9n dW5kby5jb20gKGJvdGggcHJldmlvdXMgdmVyc2lvbnMpLCBraWI8YnI+PC9kaXY+PGRpdiBkaXI9 Imx0ciI+Jm5ic3A7ICZuYnNwOyBTcG9uc29yZWQgYnk6Jm5ic3A7ICBTdG9ybXNoaWVsZDxicj48 L2Rpdj48ZGl2IGRpcj0ibHRyIj4mbmJzcDsgJm5ic3A7IFNwb25zb3JlZCBieTombmJzcDsgIEts YXJhLCBJbmMuPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPiZuYnNwOyAmbmJzcDsgRGlmZmVyZW50 aWFsIFJldmlzaW9uOiZuYnNwOyA8YSBocmVmPSJodHRwczovL3Jldmlld3MuZnJlZWJzZC5vcmcv RDMyMzA2Ij5odHRwczovL3Jldmlld3MuZnJlZWJzZC5vcmcvRDMyMzA2PC9hPjxicj48L2Rpdj48 ZGl2IGRpcj0ibHRyIj4tLS08YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+IGV0Yy9tdHJlZS9CU0Qu aW5jbHVkZS5kaXN0Jm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICB8Jm5ic3A7ICAyICs8YnI+ PC9kaXY+PGRpdiBkaXI9Imx0ciI+IGluY2x1ZGUvTWFrZWZpbGUmbmJzcDsgJm5ic3A7ICZuYnNw OyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAgfCZuYnNwOyAgMiAr LTxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4gaW5jbHVkZS9zc3AvTWFrZWZpbGUmbmJzcDsgJm5i c3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgIHwmbmJzcDsgIDYgKys8YnI+ PC9kaXY+PGRpdiBkaXI9Imx0ciI+IGluY2x1ZGUvc3NwL3NzcC5oJm5ic3A7ICZuYnNwOyAmbmJz cDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgfCZuYnNwOyA5MSAr KysrKysrKysrKysrKysrKysrKysrKysrKzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4gaW5jbHVk ZS9zc3Avc3RkaW8uaCZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZu YnNwOyAmbmJzcDsgfCZuYnNwOyA5MyArKysrKysrKysrKysrKysrKysrKysrKysrKzxicj48L2Rp dj48ZGl2IGRpcj0ibHRyIj4gaW5jbHVkZS9zc3Avc3RyaW5nLmgmbmJzcDsgJm5ic3A7ICZuYnNw OyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgIHwgMTI5ICsrKysrKysrKysrKysrKysrKysr KysrKysrKysrKysrKysrKzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4gaW5jbHVkZS9zc3Avc3Ry aW5ncy5oJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7IHwm bmJzcDsgNjcgKysrKysrKysrKysrKysrKysrKzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4gaW5j bHVkZS9zc3AvdW5pc3RkLmgmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNw OyAmbmJzcDsgIHwmbmJzcDsgNTQgKysrKysrKysrKysrKysrPGJyPjwvZGl2PjxkaXYgZGlyPSJs dHIiPiBsaWIvbGliYy9zZWN1cmUvTWFrZWZpbGUuaW5jJm5ic3A7ICZuYnNwOyAmbmJzcDsgIHwm bmJzcDsgMTEgKysrKzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4gbGliL2xpYmMvc2VjdXJlL1N5 bWJvbC5tYXAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgIHwmbmJzcDsgMTggKysrKys8YnI+ PC9kaXY+PGRpdiBkaXI9Imx0ciI+IGxpYi9saWJjL3NlY3VyZS9mZ2V0c19jaGsuYyZuYnNwOyAm bmJzcDsgJm5ic3A7ICZuYnNwOyB8Jm5ic3A7IDU0ICsrKysrKysrKysrKysrKzxicj48L2Rpdj48 ZGl2IGRpcj0ibHRyIj4gbGliL2xpYmMvc2VjdXJlL2dldHNfY2hrLmMmbmJzcDsgJm5ic3A7ICZu YnNwOyAmbmJzcDsgIHwmbmJzcDsgNzQgKysrKysrKysrKysrKysrKysrKysrPGJyPjwvZGl2Pjxk aXYgZGlyPSJsdHIiPiBsaWIvbGliYy9zZWN1cmUvbWVtY3B5X2Noay5jJm5ic3A7ICZuYnNwOyAm bmJzcDsgIHwmbmJzcDsgNTMgKysrKysrKysrKysrKysrPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIi PiBsaWIvbGliYy9zZWN1cmUvbWVtbW92ZV9jaGsuYyZuYnNwOyAmbmJzcDsgJm5ic3A7IHwmbmJz cDsgNDcgKysrKysrKysrKysrKzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4gbGliL2xpYmMvc2Vj dXJlL21lbXNldF9jaGsuYyZuYnNwOyAmbmJzcDsgJm5ic3A7ICB8Jm5ic3A7IDQ2ICsrKysrKysr KysrKys8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+IGxpYi9saWJjL3NlY3VyZS9zbnByaW50Zl9j aGsuYyZuYnNwOyAmbmJzcDsgIHwmbmJzcDsgNTYgKysrKysrKysrKysrKysrKzxicj48L2Rpdj48 ZGl2IGRpcj0ibHRyIj4gbGliL2xpYmMvc2VjdXJlL3NwcmludGZfY2hrLmMmbmJzcDsgJm5ic3A7 ICZuYnNwOyB8Jm5ic3A7IDYxICsrKysrKysrKysrKysrKysrPGJyPjwvZGl2PjxkaXYgZGlyPSJs dHIiPiBsaWIvbGliYy9zZWN1cmUvc3NwX2ludGVybmFsLmgmbmJzcDsgJm5ic3A7ICB8Jm5ic3A7 IDM3ICsrKysrKysrKysrPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPiBsaWIvbGliYy9zZWN1cmUv c3RwY3B5X2Noay5jJm5ic3A7ICZuYnNwOyAmbmJzcDsgIHwmbmJzcDsgNTUgKysrKysrKysrKysr KysrKzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4gbGliL2xpYmMvc2VjdXJlL3N0cG5jcHlfY2hr LmMmbmJzcDsgJm5ic3A7ICZuYnNwOyB8Jm5ic3A7IDUzICsrKysrKysrKysrKysrKzxicj48L2Rp dj48ZGl2IGRpcj0ibHRyIj4gbGliL2xpYmMvc2VjdXJlL3N0cmNhdF9jaGsuYyZuYnNwOyAmbmJz cDsgJm5ic3A7ICB8Jm5ic3A7IDYwICsrKysrKysrKysrKysrKysrPGJyPjwvZGl2PjxkaXYgZGly PSJsdHIiPiBsaWIvbGliYy9zZWN1cmUvc3RyY3B5X2Noay5jJm5ic3A7ICZuYnNwOyAmbmJzcDsg IHwmbmJzcDsgNTQgKysrKysrKysrKysrKysrPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPiBsaWIv bGliYy9zZWN1cmUvc3RybmNhdF9jaGsuYyZuYnNwOyAmbmJzcDsgJm5ic3A7IHwmbmJzcDsgNzAg KysrKysrKysrKysrKysrKysrKys8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+IGxpYi9saWJjL3Nl Y3VyZS9zdHJuY3B5X2Noay5jJm5ic3A7ICZuYnNwOyAmbmJzcDsgfCZuYnNwOyA1MyArKysrKysr KysrKysrKys8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+IGxpYi9saWJjL3NlY3VyZS92c25wcmlu dGZfY2hrLmMmbmJzcDsgJm5ic3A7IHwmbmJzcDsgNDkgKysrKysrKysrKysrKys8YnI+PC9kaXY+ PGRpdiBkaXI9Imx0ciI+IGxpYi9saWJjL3NlY3VyZS92c3ByaW50Zl9jaGsuYyZuYnNwOyAmbmJz cDsgIHwmbmJzcDsgNTggKysrKysrKysrKysrKysrKzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4g bGliL2xpYnNzcC9NYWtlZmlsZSZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5i c3A7ICZuYnNwOyAmbmJzcDsgfCZuYnNwOyAyMCArKysrKy08YnI+PC9kaXY+PGRpdiBkaXI9Imx0 ciI+IGxpYi9saWJzc3AvU3ltYm9sLm1hcCZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJz cDsgJm5ic3A7ICZuYnNwOyB8Jm5ic3A7IDEyICsrLS08YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+ IGxpYi9saWJzc3AvVmVyc2lvbnMuZGVmJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNw OyAmbmJzcDsgfCZuYnNwOyAgNSArKzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4gbGliL2xpYnNz cC9fX2J1aWx0aW5fb2JqZWN0X3NpemUuMyB8IDExMCArKysrKysrKysrKysrKysrKysrKysrKysr KysrKysrPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPiBsaWIvbGlic3NwL2ZvcnRpZnlfc3R1YnMu YyZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAgfCAxMzEgLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLTxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4gbGliL2xpYnNzcC9zc3Au MyZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsg Jm5ic3A7ICB8IDEzMCArKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKys8YnI+PC9k aXY+PGRpdiBkaXI9Imx0ciI+IDMyIGZpbGVzIGNoYW5nZWQsIDE2MjEgaW5zZXJ0aW9ucygrKSwg MTQwIGRlbGV0aW9ucygtKTxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj48YnI+PC9kaXY+PGRpdiBk aXI9Imx0ciI+ZGlmZiAtLWdpdCBhL2V0Yy9tdHJlZS9CU0QuaW5jbHVkZS5kaXN0IGIvZXRjL210 cmVlL0JTRC5pbmNsdWRlLmRpc3Q8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+aW5kZXggYTZiZDU4 ODBiZjYxLi5mOGM4M2Q2ZGRlN2EgMTAwNjQ0PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPi0tLSBh L2V0Yy9tdHJlZS9CU0QuaW5jbHVkZS5kaXN0PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisrKyBi L2V0Yy9tdHJlZS9CU0QuaW5jbHVkZS5kaXN0PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPkBAIC0z NzIsNiArMzcyLDggQEA8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+Jm5ic3A7ICZuYnNwOyAmbmJz cDsgJm5ic3A7ICBtYWNfdmVyaWV4ZWM8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+Jm5ic3A7ICZu YnNwOyAmbmJzcDsgJm5ic3A7ICAuLjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4mbmJzcDsgJm5i c3A7ICAuLjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rJm5ic3A7ICZuYnNwOyBzc3A8YnI+PC9k aXY+PGRpdiBkaXI9Imx0ciI+KyZuYnNwOyAmbmJzcDsgLi48YnI+PC9kaXY+PGRpdiBkaXI9Imx0 ciI+Jm5ic3A7ICZuYnNwOyAgc3lzPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPiZuYnNwOyAmbmJz cDsgJm5ic3A7ICZuYnNwOyAgZGlzazxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4mbmJzcDsgJm5i c3A7ICZuYnNwOyAmbmJzcDsgIC4uPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPmRpZmYgLS1naXQg YS9pbmNsdWRlL01ha2VmaWxlIGIvaW5jbHVkZS9NYWtlZmlsZTxicj48L2Rpdj48ZGl2IGRpcj0i bHRyIj5pbmRleCAxOWU2YmViOTUyMDMuLjMyNzc0NDE5ZjE2MiAxMDA2NDQ8YnI+PC9kaXY+PGRp diBkaXI9Imx0ciI+LS0tIGEvaW5jbHVkZS9NYWtlZmlsZTxicj48L2Rpdj48ZGl2IGRpcj0ibHRy Ij4rKysgYi9pbmNsdWRlL01ha2VmaWxlPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPkBAIC00LDcg KzQsNyBAQDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4gPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIi PiBQQUNLQUdFPWNsaWJzPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPiBDTEVBTkZJTEVTPSBvc3Jl bGRhdGUuaCB2ZXJzaW9uPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPi1TVUJESVI9IGFycGEgcHJv dG9jb2xzIHJwY3N2YyBycGMgeGxvY2FsZTxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rU1VCRElS PSBhcnBhIHByb3RvY29scyBycGNzdmMgcnBjIHNzcCB4bG9jYWxlPGJyPjwvZGl2PjxkaXYgZGly PSJsdHIiPiAuaWYgJHtNQUNISU5FX0NQVUFSQ0h9ID09ICJhbWQ2NCI8YnI+PC9kaXY+PGRpdiBk aXI9Imx0ciI+IFNVQkRJUis9Jm5ic3A7Jm5ic3A7Jm5ic3A7ICZuYnNwOyZuYnNwOyZuYnNwOyBp Mzg2PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPiBJTkNMVURFX1NVQkRJUlMrPSZuYnNwOyZuYnNw OyZuYnNwOyBpMzg2PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPmRpZmYgLS1naXQgYS9pbmNsdWRl L3NzcC9NYWtlZmlsZSBiL2luY2x1ZGUvc3NwL01ha2VmaWxlPGJyPjwvZGl2PjxkaXYgZGlyPSJs dHIiPm5ldyBmaWxlIG1vZGUgMTAwNjQ0PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPmluZGV4IDAw MDAwMDAwMDAwMC4uZGZmMTlmNDNjOTIwPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPi0tLSAvZGV2 L251bGw8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KysrIGIvaW5jbHVkZS9zc3AvTWFrZWZpbGU8 YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+QEAgLTAsMCArMSw2IEBAPGJyPjwvZGl2PjxkaXYgZGly PSJsdHIiPisjICRGcmVlQlNEJDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rPGJyPjwvZGl2Pjxk aXYgZGlyPSJsdHIiPitJTkNTPSZuYnNwOyZuYnNwOyZuYnNwOyBzc3AuaCBzdGRpby5oIHN0cmlu Zy5oIHN0cmluZ3MuaCB1bmlzdGQuaDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rSU5DU0RJUj0m bmJzcDsmbmJzcDsmbmJzcDsgJHtJTkNMVURFRElSfS9zc3A8YnI+PC9kaXY+PGRpdiBkaXI9Imx0 ciI+Kzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rLmluY2x1ZGUgJmx0O2JzZC5wcm9nLm1rJmd0 Ozxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj5kaWZmIC0tZ2l0IGEvaW5jbHVkZS9zc3Avc3NwLmgg Yi9pbmNsdWRlL3NzcC9zc3AuaDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj5uZXcgZmlsZSBtb2Rl IDEwMDY0NDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj5pbmRleCAwMDAwMDAwMDAwMDAuLjM1YTlh ZWVlMDJkZjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4tLS0gL2Rldi9udWxsPGJyPjwvZGl2Pjxk aXYgZGlyPSJsdHIiPisrKyBiL2luY2x1ZGUvc3NwL3NzcC5oPGJyPjwvZGl2PjxkaXYgZGlyPSJs dHIiPkBAIC0wLDAgKzEsOTEgQEA8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+Ky8qJm5ic3A7Jm5i c3A7Jm5ic3A7ICROZXRCU0Q6IHNzcC5oLHYgMS4xMyAyMDE1LzA5LzAzIDIwOjQzOjQ3IHBsdW5r eSBFeHAgJCZuYnNwOyZuYnNwOyZuYnNwOyAqLzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rPGJy PjwvZGl2PjxkaXYgZGlyPSJsdHIiPisvKi08YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqPGJy PjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBTUERYLUxpY2Vuc2UtSWRlbnRpZmllcjogQlNELTIt Q2xhdXNlPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKjxicj48L2Rpdj48ZGl2IGRpcj0ibHRy Ij4rICogQ29weXJpZ2h0IChjKSAyMDA2LCAyMDExIFRoZSBOZXRCU0QgRm91bmRhdGlvbiwgSW5j Ljxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogQWxsIHJpZ2h0cyByZXNlcnZlZC48YnI+PC9k aXY+PGRpdiBkaXI9Imx0ciI+KyAqPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBUaGlzIGNv ZGUgaXMgZGVyaXZlZCBmcm9tIHNvZnR3YXJlIGNvbnRyaWJ1dGVkIHRvIFRoZSBOZXRCU0QgRm91 bmRhdGlvbjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogYnkgQ2hyaXN0b3MgWm91bGFzLjxi cj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICo8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIFJl ZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Ig d2l0aG91dDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogbW9kaWZpY2F0aW9uLCBhcmUgcGVy bWl0dGVkIHByb3ZpZGVkIHRoYXQgdGhlIGZvbGxvd2luZyBjb25kaXRpb25zPGJyPjwvZGl2Pjxk aXYgZGlyPSJsdHIiPisgKiBhcmUgbWV0Ojxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogMS4g UmVkaXN0cmlidXRpb25zIG9mIHNvdXJjZSBjb2RlIG11c3QgcmV0YWluIHRoZSBhYm92ZSBjb3B5 cmlnaHQ8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqJm5ic3A7ICZuYnNwOyBub3RpY2UsIHRo aXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIuPGJyPjwv ZGl2PjxkaXYgZGlyPSJsdHIiPisgKiAyLiBSZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0g bXVzdCByZXByb2R1Y2UgdGhlIGFib3ZlIGNvcHlyaWdodDxicj48L2Rpdj48ZGl2IGRpcj0ibHRy Ij4rICombmJzcDsgJm5ic3A7IG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRo ZSBmb2xsb3dpbmcgZGlzY2xhaW1lciBpbiB0aGU8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAq Jm5ic3A7ICZuYnNwOyBkb2N1bWVudGF0aW9uIGFuZC9vciBvdGhlciBtYXRlcmlhbHMgcHJvdmlk ZWQgd2l0aCB0aGUgZGlzdHJpYnV0aW9uLjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICo8YnI+ PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIFRISVMgU09GVFdBUkUgSVMgUFJPVklERUQgQlkgVEhF IE5FVEJTRCBGT1VOREFUSU9OLCBJTkMuIEFORCBDT05UUklCVVRPUlM8YnI+PC9kaXY+PGRpdiBk aXI9Imx0ciI+KyAqIGBgQVMgSVMnJyBBTkQgQU5ZIEVYUFJFU1MgT1IgSU1QTElFRCBXQVJSQU5U SUVTLCBJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4r ICogVE8sIFRIRSBJTVBMSUVEIFdBUlJBTlRJRVMgT0YgTUVSQ0hBTlRBQklMSVRZIEFORCBGSVRO RVNTIEZPUiBBIFBBUlRJQ1VMQVI8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIFBVUlBPU0Ug QVJFIERJU0NMQUlNRUQuJm5ic3A7IElOIE5PIEVWRU5UIFNIQUxMIFRIRSBGT1VOREFUSU9OIE9S IENPTlRSSUJVVE9SUzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogQkUgTElBQkxFIEZPUiBB TlkgRElSRUNULCBJTkRJUkVDVCwgSU5DSURFTlRBTCwgU1BFQ0lBTCwgRVhFTVBMQVJZLCBPUjxi cj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogQ09OU0VRVUVOVElBTCBEQU1BR0VTIChJTkNMVURJ TkcsIEJVVCBOT1QgTElNSVRFRCBUTywgUFJPQ1VSRU1FTlQgT0Y8YnI+PC9kaXY+PGRpdiBkaXI9 Imx0ciI+KyAqIFNVQlNUSVRVVEUgR09PRFMgT1IgU0VSVklDRVM7IExPU1MgT0YgVVNFLCBEQVRB LCBPUiBQUk9GSVRTOyBPUiBCVVNJTkVTUzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogSU5U RVJSVVBUSU9OKSBIT1dFVkVSIENBVVNFRCBBTkQgT04gQU5ZIFRIRU9SWSBPRiBMSUFCSUxJVFks IFdIRVRIRVIgSU48YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIENPTlRSQUNULCBTVFJJQ1Qg TElBQklMSVRZLCBPUiBUT1JUIChJTkNMVURJTkcgTkVHTElHRU5DRSBPUiBPVEhFUldJU0UpPGJy PjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBBUklTSU5HIElOIEFOWSBXQVkgT1VUIE9GIFRIRSBV U0UgT0YgVEhJUyBTT0ZUV0FSRSwgRVZFTiBJRiBBRFZJU0VEIE9GIFRIRTxicj48L2Rpdj48ZGl2 IGRpcj0ibHRyIj4rICogUE9TU0lCSUxJVFkgT0YgU1VDSCBEQU1BR0UuPGJyPjwvZGl2PjxkaXYg ZGlyPSJsdHIiPisgKi88YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyNpZm5kZWYgX1NTUF9TU1Bf SF88YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyNkZWZpbmUgX1NTUF9TU1BfSF88YnI+PC9kaXY+ PGRpdiBkaXI9Imx0ciI+Kzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rI2luY2x1ZGUgJmx0O3N5 cy9jZGVmcy5oJmd0Ozxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rPGJyPjwvZGl2PjxkaXYgZGly PSJsdHIiPisjaWYgIWRlZmluZWQoX19jcGx1c3BsdXMpPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIi PisjIGlmIGRlZmluZWQoX0ZPUlRJRllfU09VUkNFKSAmYW1wOyZhbXA7IF9GT1JUSUZZX1NPVVJD RSAmZ3Q7IDAgJmFtcDsmYW1wOyBcPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPismbmJzcDsgJm5i c3A7ICAoX19PUFRJTUlaRV9fICZndDsgMCB8fCBkZWZpbmVkKF9fY2xhbmdfXykpPGJyPjwvZGl2 PjxkaXYgZGlyPSJsdHIiPisjJm5ic3A7IGlmIF9GT1JUSUZZX1NPVVJDRSAmZ3Q7IDE8YnI+PC9k aXY+PGRpdiBkaXI9Imx0ciI+KyMmbmJzcDsgIGRlZmluZSBfX1NTUF9GT1JUSUZZX0xFVkVMIDI8 YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyMmbmJzcDsgZWxzZTxicj48L2Rpdj48ZGl2IGRpcj0i bHRyIj4rIyZuYnNwOyAgZGVmaW5lIF9fU1NQX0ZPUlRJRllfTEVWRUwgMTxicj48L2Rpdj48ZGl2 IGRpcj0ibHRyIj4rIyZuYnNwOyBlbmRpZjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rIyBlbHNl PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisjJm5ic3A7IGRlZmluZSBfX1NTUF9GT1JUSUZZX0xF VkVMIDA8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyMgZW5kaWY8YnI+PC9kaXY+PGRpdiBkaXI9 Imx0ciI+KyNlbHNlPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisjIGRlZmluZSBfX1NTUF9GT1JU SUZZX0xFVkVMIDA8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyNlbmRpZjxicj48L2Rpdj48ZGl2 IGRpcj0ibHRyIj4rPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisjZGVmaW5lJm5ic3A7Jm5ic3A7 Jm5ic3A7IF9fc3NwX3Zhcih0eXBlKSZuYnNwOyZuYnNwOyZuYnNwOyBfX0NPTkNBVChfX3NzcF8g IyMgdHlwZSwgX19DT1VOVEVSX18pPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPis8YnI+PC9kaXY+ PGRpdiBkaXI9Imx0ciI+Ky8qIF9fc3NwX3JlYWwgaXMgdXNlZCBieSB0aGUgaW1wbGVtZW50YXRp b24gaW4gbGliYyAqLzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rI2lmIF9fU1NQX0ZPUlRJRllf TEVWRUwgPT0gMDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rI2RlZmluZSBfX3NzcF9yZWFsXyhm dW4pJm5ic3A7Jm5ic3A7Jm5ic3A7IGZ1bjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rI2Vsc2U8 YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyNkZWZpbmUgX19zc3BfcmVhbF8oZnVuKSZuYnNwOyZu YnNwOyZuYnNwOyBfX3NzcF9yZWFsXyAjIyBmdW48YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyNl bmRpZjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rI2RlZmluZSBfX3NzcF9yZWFsKGZ1bikmbmJz cDsmbmJzcDsmbmJzcDsgJm5ic3A7Jm5ic3A7Jm5ic3A7IF9fc3NwX3JlYWxfKGZ1bik8YnI+PC9k aXY+PGRpdiBkaXI9Imx0ciI+Kzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rI2RlZmluZSBfX3Nz cF9pbmxpbmUgc3RhdGljIF9faW5saW5lIF9fYXR0cmlidXRlX18oKF9fYWx3YXlzX2lubGluZV9f KSk8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+Kzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rI2Rl ZmluZSBfX3NzcF9ib3MocHRyKSBfX2J1aWx0aW5fb2JqZWN0X3NpemUocHRyLCBfX1NTUF9GT1JU SUZZX0xFVkVMICZndDsgMSk8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyNkZWZpbmUgX19zc3Bf Ym9zMChwdHIpIF9fYnVpbHRpbl9vYmplY3Rfc2l6ZShwdHIsIDApPGJyPjwvZGl2PjxkaXYgZGly PSJsdHIiPis8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyNkZWZpbmUgX19zc3BfY2hlY2soYnVm LCBsZW4sIGJvcykgXDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rJm5ic3A7Jm5ic3A7Jm5ic3A7 IGlmIChib3MoYnVmKSAhPSAoc2l6ZV90KS0xICZhbXA7JmFtcDsgbGVuICZndDsgYm9zKGJ1Zikp IFw8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyZuYnNwOyZuYnNwOyZuYnNwOyAmbmJzcDsmbmJz cDsmbmJzcDsgX19jaGtfZmFpbCgpPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisjZGVmaW5lIF9f c3NwX3JlZGlyZWN0X3JhdyhydHlwZSwgZnVuLCBzeW1ib2wsIGFyZ3MsIGNhbGwsIGNvbmQsIGJv cykgXDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rcnR5cGUgX19zc3BfcmVhbF8oZnVuKSBhcmdz IF9fUkVOQU1FKHN5bWJvbCk7IFw8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+K19fc3NwX2lubGlu ZSBydHlwZSBmdW4gYXJncyBfX1JFTkFNRShfX3NzcF9wcm90ZWN0ZWRfICMjIGZ1bik7IFw8YnI+ PC9kaXY+PGRpdiBkaXI9Imx0ciI+K19fc3NwX2lubGluZSBydHlwZSBmdW4gYXJncyB7IFw8YnI+ PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyZuYnNwOyZuYnNwOyZuYnNwOyBpZiAoY29uZCkgXDxicj48 L2Rpdj48ZGl2IGRpcj0ibHRyIj4rJm5ic3A7Jm5ic3A7Jm5ic3A7ICZuYnNwOyZuYnNwOyZuYnNw OyBfX3NzcF9jaGVjayhfX2J1ZiwgX19sZW4sIGJvcyk7IFw8YnI+PC9kaXY+PGRpdiBkaXI9Imx0 ciI+KyZuYnNwOyZuYnNwOyZuYnNwOyByZXR1cm4gX19zc3BfcmVhbF8oZnVuKSBjYWxsOyBcPGJy PjwvZGl2PjxkaXYgZGlyPSJsdHIiPit9PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPis8YnI+PC9k aXY+PGRpdiBkaXI9Imx0ciI+KyNkZWZpbmUgX19zc3BfcmVkaXJlY3QocnR5cGUsIGZ1biwgYXJn cywgY2FsbCkgXDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rJm5ic3A7ICZuYnNwOyBfX3NzcF9y ZWRpcmVjdF9yYXcocnR5cGUsIGZ1biwgZnVuLCBhcmdzLCBjYWxsLCAxLCBfX3NzcF9ib3MpPGJy PjwvZGl2PjxkaXYgZGlyPSJsdHIiPisjZGVmaW5lIF9fc3NwX3JlZGlyZWN0MChydHlwZSwgZnVu LCBhcmdzLCBjYWxsKSBcPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPismbmJzcDsgJm5ic3A7IF9f c3NwX3JlZGlyZWN0X3JhdyhydHlwZSwgZnVuLCBmdW4sIGFyZ3MsIGNhbGwsIDEsIF9fc3NwX2Jv czApPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPis8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+K19f QkVHSU5fREVDTFM8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+K3ZvaWQgX19zdGFja19jaGtfZmFp bCh2b2lkKSBfX2RlYWQyOzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rdm9pZCBfX2Noa19mYWls KHZvaWQpIF9fZGVhZDI7PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPitfX0VORF9ERUNMUzxicj48 L2Rpdj48ZGl2IGRpcj0ibHRyIj4rPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisjZW5kaWYgLyog X1NTUF9TU1BfSF8gKi88YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+ZGlmZiAtLWdpdCBhL2luY2x1 ZGUvc3NwL3N0ZGlvLmggYi9pbmNsdWRlL3NzcC9zdGRpby5oPGJyPjwvZGl2PjxkaXYgZGlyPSJs dHIiPm5ldyBmaWxlIG1vZGUgMTAwNjQ0PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPmluZGV4IDAw MDAwMDAwMDAwMC4uNzJlMzIzNmVhYzgwPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPi0tLSAvZGV2 L251bGw8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KysrIGIvaW5jbHVkZS9zc3Avc3RkaW8uaDxi cj48L2Rpdj48ZGl2IGRpcj0ibHRyIj5AQCAtMCwwICsxLDkzIEBAPGJyPjwvZGl2PjxkaXYgZGly PSJsdHIiPisvKiZuYnNwOyZuYnNwOyZuYnNwOyAkTmV0QlNEOiBzdGRpby5oLHYgMS41IDIwMTEv MDcvMTcgMjA6NTQ6MzQgam9lcmcgRXhwICQmbmJzcDsmbmJzcDsmbmJzcDsgKi88YnI+PC9kaXY+ PGRpdiBkaXI9Imx0ciI+Kzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rLyotPGJyPjwvZGl2Pjxk aXYgZGlyPSJsdHIiPisgKjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogU1BEWC1MaWNlbnNl LUlkZW50aWZpZXI6IEJTRC0yLUNsYXVzZTxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICo8YnI+ PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIENvcHlyaWdodCAoYykgMjAwNiBUaGUgTmV0QlNEIEZv dW5kYXRpb24sIEluYy48YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIEFsbCByaWdodHMgcmVz ZXJ2ZWQuPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKjxicj48L2Rpdj48ZGl2IGRpcj0ibHRy Ij4rICogVGhpcyBjb2RlIGlzIGRlcml2ZWQgZnJvbSBzb2Z0d2FyZSBjb250cmlidXRlZCB0byBU aGUgTmV0QlNEIEZvdW5kYXRpb248YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIGJ5IENocmlz dG9zIFpvdWxhcy48YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqPGJyPjwvZGl2PjxkaXYgZGly PSJsdHIiPisgKiBSZWRpc3RyaWJ1dGlvbiBhbmQgdXNlIGluIHNvdXJjZSBhbmQgYmluYXJ5IGZv cm1zLCB3aXRoIG9yIHdpdGhvdXQ8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIG1vZGlmaWNh dGlvbiwgYXJlIHBlcm1pdHRlZCBwcm92aWRlZCB0aGF0IHRoZSBmb2xsb3dpbmcgY29uZGl0aW9u czxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogYXJlIG1ldDo8YnI+PC9kaXY+PGRpdiBkaXI9 Imx0ciI+KyAqIDEuIFJlZGlzdHJpYnV0aW9ucyBvZiBzb3VyY2UgY29kZSBtdXN0IHJldGFpbiB0 aGUgYWJvdmUgY29weXJpZ2h0PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiZuYnNwOyAmbmJz cDsgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNj bGFpbWVyLjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogMi4gUmVkaXN0cmlidXRpb25zIGlu IGJpbmFyeSBmb3JtIG11c3QgcmVwcm9kdWNlIHRoZSBhYm92ZSBjb3B5cmlnaHQ8YnI+PC9kaXY+ PGRpdiBkaXI9Imx0ciI+KyAqJm5ic3A7ICZuYnNwOyBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25k aXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIgaW4gdGhlPGJyPjwvZGl2PjxkaXYg ZGlyPSJsdHIiPisgKiZuYnNwOyAmbmJzcDsgZG9jdW1lbnRhdGlvbiBhbmQvb3Igb3RoZXIgbWF0 ZXJpYWxzIHByb3ZpZGVkIHdpdGggdGhlIGRpc3RyaWJ1dGlvbi48YnI+PC9kaXY+PGRpdiBkaXI9 Imx0ciI+KyAqPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBUSElTIFNPRlRXQVJFIElTIFBS T1ZJREVEIEJZIFRIRSBORVRCU0QgRk9VTkRBVElPTiwgSU5DLiBBTkQgQ09OVFJJQlVUT1JTPGJy PjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBgYEFTIElTJycgQU5EIEFOWSBFWFBSRVNTIE9SIElN UExJRUQgV0FSUkFOVElFUywgSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQ8YnI+PC9kaXY+PGRp diBkaXI9Imx0ciI+KyAqIFRPLCBUSEUgSU1QTElFRCBXQVJSQU5USUVTIE9GIE1FUkNIQU5UQUJJ TElUWSBBTkQgRklUTkVTUyBGT1IgQSBQQVJUSUNVTEFSPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIi PisgKiBQVVJQT1NFIEFSRSBESVNDTEFJTUVELiZuYnNwOyBJTiBOTyBFVkVOVCBTSEFMTCBUSEUg Rk9VTkRBVElPTiBPUiBDT05UUklCVVRPUlM8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIEJF IExJQUJMRSBGT1IgQU5ZIERJUkVDVCwgSU5ESVJFQ1QsIElOQ0lERU5UQUwsIFNQRUNJQUwsIEVY RU1QTEFSWSwgT1I8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIENPTlNFUVVFTlRJQUwgREFN QUdFUyAoSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQgVE8sIFBST0NVUkVNRU5UIE9GPGJyPjwv ZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBTVUJTVElUVVRFIEdPT0RTIE9SIFNFUlZJQ0VTOyBMT1NT IE9GIFVTRSwgREFUQSwgT1IgUFJPRklUUzsgT1IgQlVTSU5FU1M8YnI+PC9kaXY+PGRpdiBkaXI9 Imx0ciI+KyAqIElOVEVSUlVQVElPTikgSE9XRVZFUiBDQVVTRUQgQU5EIE9OIEFOWSBUSEVPUlkg T0YgTElBQklMSVRZLCBXSEVUSEVSIElOPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBDT05U UkFDVCwgU1RSSUNUIExJQUJJTElUWSwgT1IgVE9SVCAoSU5DTFVESU5HIE5FR0xJR0VOQ0UgT1Ig T1RIRVJXSVNFKTxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogQVJJU0lORyBJTiBBTlkgV0FZ IE9VVCBPRiBUSEUgVVNFIE9GIFRISVMgU09GVFdBUkUsIEVWRU4gSUYgQURWSVNFRCBPRiBUSEU8 YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLjxi cj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICovPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisjaWZu ZGVmIF9TU1BfU1RESU9fSF88YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyNkZWZpbmUgX1NTUF9T VERJT19IXzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIi PisjaW5jbHVkZSAmbHQ7c3NwL3NzcC5oJmd0Ozxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rPGJy PjwvZGl2PjxkaXYgZGlyPSJsdHIiPitfX0JFR0lOX0RFQ0xTPGJyPjwvZGl2PjxkaXYgZGlyPSJs dHIiPitpbnQgX19zcHJpbnRmX2NoayhjaGFyICpfX3Jlc3RyaWN0LCBpbnQsIHNpemVfdCwgY29u c3QgY2hhciAqX19yZXN0cmljdCwgLi4uKTxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rJm5ic3A7 ICZuYnNwOyBfX3ByaW50Zmxpa2UoNCwgNSk7PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPitpbnQg X192c3ByaW50Zl9jaGsoY2hhciAqX19yZXN0cmljdCwgaW50LCBzaXplX3QsIGNvbnN0IGNoYXIg Kl9fcmVzdHJpY3QsPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPismbmJzcDsgJm5ic3A7IF9fdmFf bGlzdCk8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyZuYnNwOyAmbmJzcDsgX19wcmludGZsaWtl KDQsIDApOzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4raW50IF9fc25wcmludGZfY2hrKGNoYXIg Kl9fcmVzdHJpY3QsIHNpemVfdCwgaW50LCBzaXplX3QsPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIi PismbmJzcDsgJm5ic3A7IGNvbnN0IGNoYXIgKl9fcmVzdHJpY3QsIC4uLik8YnI+PC9kaXY+PGRp diBkaXI9Imx0ciI+KyZuYnNwOyAmbmJzcDsgX19wcmludGZsaWtlKDUsIDYpOzxicj48L2Rpdj48 ZGl2IGRpcj0ibHRyIj4raW50IF9fdnNucHJpbnRmX2NoayhjaGFyICpfX3Jlc3RyaWN0LCBzaXpl X3QsIGludCwgc2l6ZV90LDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rJm5ic3A7ICZuYnNwOyAg Y29uc3QgY2hhciAqX19yZXN0cmljdCwgX192YV9saXN0KTxicj48L2Rpdj48ZGl2IGRpcj0ibHRy Ij4rJm5ic3A7ICZuYnNwOyBfX3ByaW50Zmxpa2UoNSwgMCk7PGJyPjwvZGl2PjxkaXYgZGlyPSJs dHIiPitjaGFyICpfX2dldHNfY2hrKGNoYXIgKiwgc2l6ZV90KTs8YnI+PC9kaXY+PGRpdiBkaXI9 Imx0ciI+K2NoYXIgKl9fZmdldHNfY2hrKGNoYXIgKiwgaW50LCBzaXplX3QsIEZJTEUgKik7PGJy PjwvZGl2PjxkaXYgZGlyPSJsdHIiPitfX0VORF9ERUNMUzxicj48L2Rpdj48ZGl2IGRpcj0ibHRy Ij4rPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisjaWYgX19TU1BfRk9SVElGWV9MRVZFTCAmZ3Q7 IDA8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+Kzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rI2Rl ZmluZSBzcHJpbnRmKHN0ciwgLi4uKSAoeyZuYnNwOyZuYnNwOyZuYnNwOyBcPGJyPjwvZGl2Pjxk aXYgZGlyPSJsdHIiPismbmJzcDsgJm5ic3A7IGNoYXIgKl9zc3Bfc3RyID0gKHN0cik7Jm5ic3A7 Jm5ic3A7Jm5ic3A7IFw8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyZuYnNwOyAmbmJzcDsgX19i dWlsdGluX19fc3ByaW50Zl9jaGsoX3NzcF9zdHIsIDAsIF9fc3NwX2Jvcyhfc3NwX3N0ciksJm5i c3A7Jm5ic3A7Jm5ic3A7ICZuYnNwOyZuYnNwOyZuYnNwOyBcPGJyPjwvZGl2PjxkaXYgZGlyPSJs dHIiPismbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgX19WQV9BUkdTX18pOyBcPGJyPjwvZGl2 PjxkaXYgZGlyPSJsdHIiPit9KTxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rPGJyPjwvZGl2Pjxk aXYgZGlyPSJsdHIiPisjZGVmaW5lIHZzcHJpbnRmKHN0ciwgZm10LCBhcCkgKHsmbmJzcDsmbmJz cDsmbmJzcDsgXDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rJm5ic3A7ICZuYnNwOyBjaGFyICpf c3NwX3N0ciA9IChzdHIpOyZuYnNwOyZuYnNwOyZuYnNwOyAmbmJzcDsmbmJzcDsmbmJzcDsgXDxi cj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rJm5ic3A7ICZuYnNwOyBfX2J1aWx0aW5fX192c3ByaW50 Zl9jaGsoX3NzcF9zdHIsIDAsIF9fc3NwX2Jvcyhfc3NwX3N0ciksIGZtdCwmbmJzcDsmbmJzcDsm bmJzcDsgXDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5i c3A7IGFwKTsmbmJzcDsmbmJzcDsmbmJzcDsgJm5ic3A7Jm5ic3A7Jm5ic3A7ICZuYnNwOyZuYnNw OyZuYnNwOyAmbmJzcDsmbmJzcDsmbmJzcDsgXDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rfSk8 YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+Kzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rI2RlZmlu ZSBzbnByaW50ZihzdHIsIGxlbiwgLi4uKSAoeyZuYnNwOyZuYnNwOyZuYnNwOyBcPGJyPjwvZGl2 PjxkaXYgZGlyPSJsdHIiPismbmJzcDsgJm5ic3A7IGNoYXIgKl9zc3Bfc3RyID0gKHN0cik7Jm5i c3A7Jm5ic3A7Jm5ic3A7ICZuYnNwOyZuYnNwOyZuYnNwOyBcPGJyPjwvZGl2PjxkaXYgZGlyPSJs dHIiPismbmJzcDsgJm5ic3A7IF9fYnVpbHRpbl9fX3NucHJpbnRmX2Noayhfc3NwX3N0ciwgbGVu LCAwLCBfX3NzcF9ib3MoX3NzcF9zdHIpLCZuYnNwOyZuYnNwOyZuYnNwOyBcPGJyPjwvZGl2Pjxk aXYgZGlyPSJsdHIiPismbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgX19WQV9BUkdTX18pOyZu YnNwOyZuYnNwOyZuYnNwOyAmbmJzcDsmbmJzcDsmbmJzcDsgJm5ic3A7Jm5ic3A7Jm5ic3A7IFw8 YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+K30pPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPis8YnI+ PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyNkZWZpbmUgdnNucHJpbnRmKHN0ciwgbGVuLCBmbXQsIGFw KSAoeyZuYnNwOyZuYnNwOyZuYnNwOyBcPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPismbmJzcDsg Jm5ic3A7IGNoYXIgKl9zc3Bfc3RyID0gKHN0cik7Jm5ic3A7Jm5ic3A7Jm5ic3A7ICZuYnNwOyZu YnNwOyZuYnNwOyBcPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPismbmJzcDsgJm5ic3A7IF9fYnVp bHRpbl9fX3ZzbnByaW50Zl9jaGsoX3NzcF9zdHIsIGxlbiwgMCwgX19zc3BfYm9zKF9zc3Bfc3Ry KSwmbmJzcDsmbmJzcDsmbmJzcDsgXDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rJm5ic3A7ICZu YnNwOyAmbmJzcDsgJm5ic3A7IGZtdCwgYXApOyZuYnNwOyZuYnNwOyZuYnNwOyAmbmJzcDsmbmJz cDsmbmJzcDsgJm5ic3A7Jm5ic3A7Jm5ic3A7IFw8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+K30p PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPis8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyNkZWZp bmUgZ2V0cyhzdHIpICh7Jm5ic3A7Jm5ic3A7Jm5ic3A7ICZuYnNwOyZuYnNwOyZuYnNwOyAmbmJz cDsmbmJzcDsmbmJzcDsgXDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rJm5ic3A7ICBjaGFyICpf c3NwX3N0ciA9IChzdHIpOyZuYnNwOyZuYnNwOyZuYnNwOyAmbmJzcDsmbmJzcDsmbmJzcDsgXDxi cj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rJm5ic3A7ICZuYnNwOyBfX2dldHNfY2hrKF9zc3Bfc3Ry LCBfX3NzcF9ib3MoX3NzcF9zdHIpKTsmbmJzcDsmbmJzcDsmbmJzcDsgXDxicj48L2Rpdj48ZGl2 IGRpcj0ibHRyIj4rfSk8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+Kzxicj48L2Rpdj48ZGl2IGRp cj0ibHRyIj4rI2RlZmluZSBmZ2V0cyhzdHIsIGxlbiwgZnApICh7Jm5ic3A7Jm5ic3A7Jm5ic3A7 ICZuYnNwOyZuYnNwOyZuYnNwOyBcPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPismbmJzcDsgJm5i c3A7IGNoYXIgKl9zc3Bfc3RyID0gKHN0cik7Jm5ic3A7Jm5ic3A7Jm5ic3A7ICZuYnNwOyZuYnNw OyZuYnNwOyBcPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPismbmJzcDsgJm5ic3A7IF9fZmdldHNf Y2hrKF9zc3Bfc3RyLCBsZW4sIF9fc3NwX2Jvcyhfc3NwX3N0ciksIGZwKTsmbmJzcDsmbmJzcDsm bmJzcDsgXDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rfSk8YnI+PC9kaXY+PGRpdiBkaXI9Imx0 ciI+Kzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rI2VuZGlmIC8qIF9fU1NQX0ZPUlRJRllfTEVW RUwgJmd0OyAwICovPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPis8YnI+PC9kaXY+PGRpdiBkaXI9 Imx0ciI+KyNlbmRpZiAvKiBfU1NQX1NURElPX0hfICovPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIi PmRpZmYgLS1naXQgYS9pbmNsdWRlL3NzcC9zdHJpbmcuaCBiL2luY2x1ZGUvc3NwL3N0cmluZy5o PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPm5ldyBmaWxlIG1vZGUgMTAwNjQ0PGJyPjwvZGl2Pjxk aXYgZGlyPSJsdHIiPmluZGV4IDAwMDAwMDAwMDAwMC4uOTk2MDIwZmRhNzc4PGJyPjwvZGl2Pjxk aXYgZGlyPSJsdHIiPi0tLSAvZGV2L251bGw8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KysrIGIv aW5jbHVkZS9zc3Avc3RyaW5nLmg8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+QEAgLTAsMCArMSwx MjkgQEA8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+Ky8qJm5ic3A7Jm5ic3A7Jm5ic3A7ICROZXRC U0Q6IHN0cmluZy5oLHYgMS4xNCAyMDIwLzA5LzA1IDEzOjM3OjU5IG1yZyBFeHAgJCZuYnNwOyZu YnNwOyZuYnNwOyAqLzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rPGJyPjwvZGl2PjxkaXYgZGly PSJsdHIiPisvKi08YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqPGJyPjwvZGl2PjxkaXYgZGly PSJsdHIiPisgKiBTUERYLUxpY2Vuc2UtSWRlbnRpZmllcjogQlNELTItQ2xhdXNlPGJyPjwvZGl2 PjxkaXYgZGlyPSJsdHIiPisgKjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogQ29weXJpZ2h0 IChjKSAyMDA2IFRoZSBOZXRCU0QgRm91bmRhdGlvbiwgSW5jLjxicj48L2Rpdj48ZGl2IGRpcj0i bHRyIj4rICogQWxsIHJpZ2h0cyByZXNlcnZlZC48YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAq PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBUaGlzIGNvZGUgaXMgZGVyaXZlZCBmcm9tIHNv ZnR3YXJlIGNvbnRyaWJ1dGVkIHRvIFRoZSBOZXRCU0QgRm91bmRhdGlvbjxicj48L2Rpdj48ZGl2 IGRpcj0ibHRyIj4rICogYnkgQ2hyaXN0b3MgWm91bGFzLjxicj48L2Rpdj48ZGl2IGRpcj0ibHRy Ij4rICo8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2Ug aW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dDxicj48L2Rpdj48ZGl2 IGRpcj0ibHRyIj4rICogbW9kaWZpY2F0aW9uLCBhcmUgcGVybWl0dGVkIHByb3ZpZGVkIHRoYXQg dGhlIGZvbGxvd2luZyBjb25kaXRpb25zPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBhcmUg bWV0Ojxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogMS4gUmVkaXN0cmlidXRpb25zIG9mIHNv dXJjZSBjb2RlIG11c3QgcmV0YWluIHRoZSBhYm92ZSBjb3B5cmlnaHQ8YnI+PC9kaXY+PGRpdiBk aXI9Imx0ciI+KyAqJm5ic3A7ICZuYnNwOyBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25z IGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIuPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisg KiAyLiBSZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVzdCByZXByb2R1Y2UgdGhlIGFi b3ZlIGNvcHlyaWdodDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICombmJzcDsgJm5ic3A7IG5v dGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1l ciBpbiB0aGU8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqJm5ic3A7ICZuYnNwOyBkb2N1bWVu dGF0aW9uIGFuZC9vciBvdGhlciBtYXRlcmlhbHMgcHJvdmlkZWQgd2l0aCB0aGUgZGlzdHJpYnV0 aW9uLjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICo8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+ KyAqIFRISVMgU09GVFdBUkUgSVMgUFJPVklERUQgQlkgVEhFIE5FVEJTRCBGT1VOREFUSU9OLCBJ TkMuIEFORCBDT05UUklCVVRPUlM8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIGBgQVMgSVMn JyBBTkQgQU5ZIEVYUFJFU1MgT1IgSU1QTElFRCBXQVJSQU5USUVTLCBJTkNMVURJTkcsIEJVVCBO T1QgTElNSVRFRDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogVE8sIFRIRSBJTVBMSUVEIFdB UlJBTlRJRVMgT0YgTUVSQ0hBTlRBQklMSVRZIEFORCBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVI8 YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIFBVUlBPU0UgQVJFIERJU0NMQUlNRUQuJm5ic3A7 IElOIE5PIEVWRU5UIFNIQUxMIFRIRSBGT1VOREFUSU9OIE9SIENPTlRSSUJVVE9SUzxicj48L2Rp dj48ZGl2IGRpcj0ibHRyIj4rICogQkUgTElBQkxFIEZPUiBBTlkgRElSRUNULCBJTkRJUkVDVCwg SU5DSURFTlRBTCwgU1BFQ0lBTCwgRVhFTVBMQVJZLCBPUjxicj48L2Rpdj48ZGl2IGRpcj0ibHRy Ij4rICogQ09OU0VRVUVOVElBTCBEQU1BR0VTIChJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBU TywgUFJPQ1VSRU1FTlQgT0Y8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIFNVQlNUSVRVVEUg R09PRFMgT1IgU0VSVklDRVM7IExPU1MgT0YgVVNFLCBEQVRBLCBPUiBQUk9GSVRTOyBPUiBCVVNJ TkVTUzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogSU5URVJSVVBUSU9OKSBIT1dFVkVSIENB VVNFRCBBTkQgT04gQU5ZIFRIRU9SWSBPRiBMSUFCSUxJVFksIFdIRVRIRVIgSU48YnI+PC9kaXY+ PGRpdiBkaXI9Imx0ciI+KyAqIENPTlRSQUNULCBTVFJJQ1QgTElBQklMSVRZLCBPUiBUT1JUIChJ TkNMVURJTkcgTkVHTElHRU5DRSBPUiBPVEhFUldJU0UpPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIi PisgKiBBUklTSU5HIElOIEFOWSBXQVkgT1VUIE9GIFRIRSBVU0UgT0YgVEhJUyBTT0ZUV0FSRSwg RVZFTiBJRiBBRFZJU0VEIE9GIFRIRTxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogUE9TU0lC SUxJVFkgT0YgU1VDSCBEQU1BR0UuPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKi88YnI+PC9k aXY+PGRpdiBkaXI9Imx0ciI+KyNpZm5kZWYgX1NTUF9TVFJJTkdfSF88YnI+PC9kaXY+PGRpdiBk aXI9Imx0ciI+KyNkZWZpbmUgX1NTUF9TVFJJTkdfSF88YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+ Kzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rI2luY2x1ZGUgJmx0O3NzcC9zc3AuaCZndDs8YnI+ PC9kaXY+PGRpdiBkaXI9Imx0ciI+Kzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rX19CRUdJTl9E RUNMUzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rdm9pZCAqX19tZW1jcHlfY2hrKHZvaWQgKiwg Y29uc3Qgdm9pZCAqLCBzaXplX3QsIHNpemVfdCk7PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPit2 b2lkICpfX21lbW1vdmVfY2hrKHZvaWQgKiwgY29uc3Qgdm9pZCAqLCBzaXplX3QsIHNpemVfdCk7 PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPit2b2lkICpfX21lbXNldF9jaGsodm9pZCAqLCBpbnQs IHNpemVfdCwgc2l6ZV90KTs8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+K2NoYXIgKl9fc3RwY3B5 X2NoayhjaGFyICosIGNvbnN0IGNoYXIgKiwgc2l6ZV90KTs8YnI+PC9kaXY+PGRpdiBkaXI9Imx0 ciI+K2NoYXIgKl9fc3RwbmNweV9jaGsoY2hhciAqLCBjb25zdCBjaGFyICosIHNpemVfdCwgc2l6 ZV90KTs8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+K2NoYXIgKl9fc3RyY2F0X2NoayhjaGFyICos IGNvbnN0IGNoYXIgKiwgc2l6ZV90KTs8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+K2NoYXIgKl9f c3RyY3B5X2NoayhjaGFyICosIGNvbnN0IGNoYXIgKiwgc2l6ZV90KTs8YnI+PC9kaXY+PGRpdiBk aXI9Imx0ciI+K2NoYXIgKl9fc3RybmNhdF9jaGsoY2hhciAqLCBjb25zdCBjaGFyICosIHNpemVf dCwgc2l6ZV90KTs8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+K2NoYXIgKl9fc3RybmNweV9jaGso Y2hhciAqLCBjb25zdCBjaGFyICosIHNpemVfdCwgc2l6ZV90KTs8YnI+PC9kaXY+PGRpdiBkaXI9 Imx0ciI+K19fRU5EX0RFQ0xTPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPis8YnI+PC9kaXY+PGRp diBkaXI9Imx0ciI+KyNpZiBfX1NTUF9GT1JUSUZZX0xFVkVMICZndDsgMDxicj48L2Rpdj48ZGl2 IGRpcj0ibHRyIj4rPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisjZGVmaW5lIF9fc3NwX2Jvc19j aGVjazNfdHlwZWRfdmFyKGZ1biwgZHN0dHlwZSwgZHNydmFyLCBkc3QsIHNyY3R5cGUsIHNyY3Zh ciwgXDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rJm5ic3A7ICZuYnNwOyBzcmMsIGxlbnZhciwg bGVuKSAoeyZuYnNwOyZuYnNwOyZuYnNwOyAmbmJzcDsmbmJzcDsmbmJzcDsgJm5ic3A7Jm5ic3A7 Jm5ic3A7ICZuYnNwOyZuYnNwOyZuYnNwOyBcPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPismbmJz cDsgJm5ic3A7IHNyY3R5cGUgc3JjdmFyID0gKHNyYyk7Jm5ic3A7Jm5ic3A7Jm5ic3A7ICZuYnNw OyZuYnNwOyZuYnNwOyAmbmJzcDsmbmJzcDsmbmJzcDsgJm5ic3A7Jm5ic3A7Jm5ic3A7IFw8YnI+ PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyZuYnNwOyAmbmJzcDsgZHN0dHlwZSBkc3R2YXIgPSAoZHN0 KTsmbmJzcDsmbmJzcDsmbmJzcDsgJm5ic3A7Jm5ic3A7Jm5ic3A7ICZuYnNwOyZuYnNwOyZuYnNw OyAmbmJzcDsmbmJzcDsmbmJzcDsgXDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rJm5ic3A7ICZu YnNwOyBzaXplX3QgbGVudmFyID0gKGxlbik7Jm5ic3A7Jm5ic3A7Jm5ic3A7ICZuYnNwOyZuYnNw OyZuYnNwOyAmbmJzcDsmbmJzcDsmbmJzcDsgJm5ic3A7Jm5ic3A7Jm5ic3A7IFw8YnI+PC9kaXY+ PGRpdiBkaXI9Imx0ciI+KyZuYnNwOyAmbmJzcDsgKChfX3NzcF9ib3MwKGRzdHZhcikgIT0gKHNp emVfdCktMSkgPyZuYnNwOyZuYnNwOyZuYnNwOyAmbmJzcDsmbmJzcDsmbmJzcDsgXDxicj48L2Rp dj48ZGl2IGRpcj0ibHRyIj4rJm5ic3A7ICZuYnNwOyBfX2J1aWx0aW5fX18gIyMgZnVuICMjIF9j aGsoZHN0dmFyLCBzcmN2YXIsIGxlbnZhciwmbmJzcDsmbmJzcDsmbmJzcDsgXDxicj48L2Rpdj48 ZGl2IGRpcj0ibHRyIj4rJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7IF9fc3NwX2JvczAoZHN0 dmFyKSkgOiZuYnNwOyZuYnNwOyZuYnNwOyAmbmJzcDsmbmJzcDsmbmJzcDsgJm5ic3A7Jm5ic3A7 Jm5ic3A7ICZuYnNwOyZuYnNwOyZuYnNwOyBcPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPismbmJz cDsgJm5ic3A7IF9fICMjIGZ1biAjIyBfaWNoayhkc3R2YXIsIHNyY3ZhciwgbGVudmFyKSk7Jm5i c3A7Jm5ic3A7Jm5ic3A7IFw8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+K30pPGJyPjwvZGl2Pjxk aXYgZGlyPSJsdHIiPis8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyNkZWZpbmUgX19zc3BfYm9z X2NoZWNrM190eXBlZChmdW4sIGRzdHR5cGUsIGRzdCwgc3JjdHlwZSwgc3JjLCBsZW4pJm5ic3A7 Jm5ic3A7Jm5ic3A7IFw8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyZuYnNwOyAmbmJzcDsgX19z c3BfYm9zX2NoZWNrM190eXBlZF92YXIoZnVuLCBkc3R0eXBlLCBfX3NzcF92YXIoZHN0diksIGRz dCwmbmJzcDsmbmJzcDsmbmJzcDsgXDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rJm5ic3A7ICZu YnNwOyAmbmJzcDsgJm5ic3A7IHNyY3R5cGUsIF9fc3NwX3ZhcihzcmN2KSwgc3JjLCBfX3NzcF92 YXIobGVudiksIGxlbik8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+Kzxicj48L2Rpdj48ZGl2IGRp cj0ibHRyIj4rI2RlZmluZSBfX3NzcF9ib3NfY2hlY2szKGZ1biwgZHN0LCBzcmMsIGxlbikmbmJz cDsmbmJzcDsmbmJzcDsgJm5ic3A7Jm5ic3A7Jm5ic3A7IFw8YnI+PC9kaXY+PGRpdiBkaXI9Imx0 ciI+KyZuYnNwOyAmbmJzcDsgX19zc3BfYm9zX2NoZWNrM190eXBlZF92YXIoZnVuLCB2b2lkICos IF9fc3NwX3Zhcihkc3R2KSwgZHN0LCZuYnNwOyZuYnNwOyZuYnNwOyBcPGJyPjwvZGl2PjxkaXYg ZGlyPSJsdHIiPismbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgY29uc3Qgdm9pZCAqLCBfX3Nz cF92YXIoc3JjdiksIHNyYywgX19zc3BfdmFyKGxlbnYpLCBsZW4pPGJyPjwvZGl2PjxkaXYgZGly PSJsdHIiPis8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyNkZWZpbmUgX19zc3BfYm9zX2NoZWNr Ml92YXIoZnVuLCBkc3R2YXIsIGRzdCwgc3JjdmFyLCBzcmMpICh7Jm5ic3A7Jm5ic3A7Jm5ic3A7 ICZuYnNwOyZuYnNwOyZuYnNwOyBcPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPismbmJzcDsgJm5i c3A7IGNvbnN0IHZvaWQgKnNyY3ZhciA9IChzcmMpOyZuYnNwOyZuYnNwOyZuYnNwOyAmbmJzcDsm bmJzcDsmbmJzcDsgJm5ic3A7Jm5ic3A7Jm5ic3A7ICZuYnNwOyZuYnNwOyZuYnNwOyBcPGJyPjwv ZGl2PjxkaXYgZGlyPSJsdHIiPismbmJzcDsgJm5ic3A7IHZvaWQgKmRzdHZhciA9IChkc3QpOyZu YnNwOyZuYnNwOyZuYnNwOyAmbmJzcDsmbmJzcDsmbmJzcDsgJm5ic3A7Jm5ic3A7Jm5ic3A7ICZu YnNwOyZuYnNwOyZuYnNwOyBcPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPismbmJzcDsgJm5ic3A7 ICgoX19zc3BfYm9zMChkc3R2YXIpICE9IChzaXplX3QpLTEpID8mbmJzcDsmbmJzcDsmbmJzcDsg Jm5ic3A7Jm5ic3A7Jm5ic3A7IFw8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyZuYnNwOyAmbmJz cDsgX19idWlsdGluX19fICMjIGZ1biAjIyBfY2hrKGRzdHZhciwgc3JjdmFyLCZuYnNwOyZuYnNw OyZuYnNwOyAmbmJzcDsmbmJzcDsmbmJzcDsgXDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rJm5i c3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7IF9fc3NwX2JvczAoZHN0dmFyKSkgOiZuYnNwOyZuYnNw OyZuYnNwOyAmbmJzcDsmbmJzcDsmbmJzcDsgJm5ic3A7Jm5ic3A7Jm5ic3A7ICZuYnNwOyZuYnNw OyZuYnNwOyBcPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPismbmJzcDsgJm5ic3A7IF9fICMjIGZ1 biAjIyBfaWNoayhkc3R2YXIsIHNyY3ZhcikpOyZuYnNwOyZuYnNwOyZuYnNwOyAmbmJzcDsmbmJz cDsmbmJzcDsgXDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rfSk8YnI+PC9kaXY+PGRpdiBkaXI9 Imx0ciI+Kzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rI2RlZmluZSBfX3NzcF9ib3NfY2hlY2sy KGZ1biwgZHN0LCBzcmMpJm5ic3A7Jm5ic3A7Jm5ic3A7ICZuYnNwOyZuYnNwOyZuYnNwOyAmbmJz cDsmbmJzcDsmbmJzcDsgXDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rJm5ic3A7ICZuYnNwOyBf X3NzcF9ib3NfY2hlY2syX3ZhcihmdW4sIF9fc3NwX3Zhcihkc3R2KSwgZHN0LCBfX3NzcF92YXIo c3JjdiksIHNyYyk8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+Kzxicj48L2Rpdj48ZGl2IGRpcj0i bHRyIj4rI2RlZmluZSBfX3NzcF9ib3NfaWNoZWNrM19yZXN0cmljdChmdW4sIHR5cGUxLCB0eXBl MikgXDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rc3RhdGljIF9faW5saW5lIHR5cGUxIF9fICMj IGZ1biAjIyBfaWNoayh0eXBlMSBfX3Jlc3RyaWN0LCB0eXBlMiBfX3Jlc3RyaWN0LCBzaXplX3Qp OyBcPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPitzdGF0aWMgX19pbmxpbmUgX19hdHRyaWJ1dGVf XygoX19hbHdheXNfaW5saW5lX18pKSB0eXBlMSBcPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPitf XyAjIyBmdW4gIyMgX2ljaGsodHlwZTEgX19yZXN0cmljdCBkc3QsIHR5cGUyIF9fcmVzdHJpY3Qg c3JjLCBzaXplX3QgbGVuKSB7IFw8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyZuYnNwOyZuYnNw OyZuYnNwOyByZXR1cm4gX19idWlsdGluX19fICMjIGZ1biAjIyBfY2hrKGRzdCwgc3JjLCBsZW4s IF9fc3NwX2JvczAoZHN0KSk7IFw8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+K308YnI+PC9kaXY+ PGRpdiBkaXI9Imx0ciI+Kzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rI2RlZmluZSBfX3NzcF9i b3NfaWNoZWNrMyhmdW4sIHR5cGUxLCB0eXBlMikgXDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4r c3RhdGljIF9faW5saW5lIHR5cGUxIF9fICMjIGZ1biAjIyBfaWNoayh0eXBlMSwgdHlwZTIsIHNp emVfdCk7IFw8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+K3N0YXRpYyBfX2lubGluZSBfX2F0dHJp YnV0ZV9fKChfX2Fsd2F5c19pbmxpbmVfXykpIHR5cGUxIFw8YnI+PC9kaXY+PGRpdiBkaXI9Imx0 ciI+K19fICMjIGZ1biAjIyBfaWNoayh0eXBlMSBkc3QsIHR5cGUyIHNyYywgc2l6ZV90IGxlbikg eyBcPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPismbmJzcDsmbmJzcDsmbmJzcDsgcmV0dXJuIF9f YnVpbHRpbl9fXyAjIyBmdW4gIyMgX2Noayhkc3QsIHNyYywgbGVuLCBfX3NzcF9ib3MwKGRzdCkp OyBcPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPit9PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPis8 YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyNkZWZpbmUgX19zc3BfYm9zX2ljaGVjazJfcmVzdHJp Y3QoZnVuLCB0eXBlMSwgdHlwZTIpIFw8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+K3N0YXRpYyBf X2lubGluZSB0eXBlMSBfXyAjIyBmdW4gIyMgX2ljaGsodHlwZTEsIHR5cGUyKTsgXDxicj48L2Rp dj48ZGl2IGRpcj0ibHRyIj4rc3RhdGljIF9faW5saW5lIF9fYXR0cmlidXRlX18oKF9fYWx3YXlz X2lubGluZV9fKSkgdHlwZTEgXDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rX18gIyMgZnVuICMj IF9pY2hrKHR5cGUxIF9fcmVzdHJpY3QgZHN0LCB0eXBlMiBfX3Jlc3RyaWN0IHNyYykgeyBcPGJy PjwvZGl2PjxkaXYgZGlyPSJsdHIiPismbmJzcDsmbmJzcDsmbmJzcDsgcmV0dXJuIF9fYnVpbHRp bl9fXyAjIyBmdW4gIyMgX2Noayhkc3QsIHNyYywgX19zc3BfYm9zMChkc3QpKTsgXDxicj48L2Rp dj48ZGl2IGRpcj0ibHRyIj4rfTxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rPGJyPjwvZGl2Pjxk aXYgZGlyPSJsdHIiPitfX0JFR0lOX0RFQ0xTPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPitfX3Nz cF9ib3NfaWNoZWNrM19yZXN0cmljdChtZW1jcHksIHZvaWQgKiwgY29uc3Qgdm9pZCAqKTxicj48 L2Rpdj48ZGl2IGRpcj0ibHRyIj4rX19zc3BfYm9zX2ljaGVjazMobWVtbW92ZSwgdm9pZCAqLCBj b25zdCB2b2lkICopPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPitfX3NzcF9ib3NfaWNoZWNrMyht ZW1zZXQsIHZvaWQgKiwgaW50KTxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rX19zc3BfYm9zX2lj aGVjazJfcmVzdHJpY3Qoc3RwY3B5LCBjaGFyICosIGNvbnN0IGNoYXIgKik8YnI+PC9kaXY+PGRp diBkaXI9Imx0ciI+K19fc3NwX2Jvc19pY2hlY2szX3Jlc3RyaWN0KHN0cG5jcHksIGNoYXIgKiwg Y29uc3QgY2hhciAqKTxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rX19zc3BfYm9zX2ljaGVjazJf cmVzdHJpY3Qoc3RyY3B5LCBjaGFyICosIGNvbnN0IGNoYXIgKik8YnI+PC9kaXY+PGRpdiBkaXI9 Imx0ciI+K19fc3NwX2Jvc19pY2hlY2syX3Jlc3RyaWN0KHN0cmNhdCwgY2hhciAqLCBjb25zdCBj aGFyICopPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPitfX3NzcF9ib3NfaWNoZWNrM19yZXN0cmlj dChzdHJuY3B5LCBjaGFyICosIGNvbnN0IGNoYXIgKik8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+ K19fc3NwX2Jvc19pY2hlY2szX3Jlc3RyaWN0KHN0cm5jYXQsIGNoYXIgKiwgY29uc3QgY2hhciAq KTxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rX19FTkRfREVDTFM8YnI+PC9kaXY+PGRpdiBkaXI9 Imx0ciI+Kzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rI2RlZmluZSBtZW1jcHkoZHN0LCBzcmMs IGxlbikgX19zc3BfYm9zX2NoZWNrMyhtZW1jcHksIGRzdCwgc3JjLCBsZW4pPGJyPjwvZGl2Pjxk aXYgZGlyPSJsdHIiPisjZGVmaW5lIG1lbW1vdmUoZHN0LCBzcmMsIGxlbikgX19zc3BfYm9zX2No ZWNrMyhtZW1tb3ZlLCBkc3QsIHNyYywgbGVuKTxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rI2Rl ZmluZSBtZW1zZXQoZHN0LCB2YWwsIGxlbikgXDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rJm5i c3A7ICZuYnNwOyBfX3NzcF9ib3NfY2hlY2szX3R5cGVkKG1lbXNldCwgdm9pZCAqLCBkc3QsIGlu dCwgdmFsLCBsZW4pPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisjZGVmaW5lIHN0cGNweShkc3Qs IHNyYykgX19zc3BfYm9zX2NoZWNrMihzdHBjcHksIGRzdCwgc3JjKTxicj48L2Rpdj48ZGl2IGRp cj0ibHRyIj4rI2RlZmluZSBzdHBuY3B5KGRzdCwgc3JjLCBsZW4pIF9fc3NwX2Jvc19jaGVjazMo c3RwbmNweSwgZHN0LCBzcmMsIGxlbik8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyNkZWZpbmUg c3RyY3B5KGRzdCwgc3JjKSBfX3NzcF9ib3NfY2hlY2syKHN0cmNweSwgZHN0LCBzcmMpPGJyPjwv ZGl2PjxkaXYgZGlyPSJsdHIiPisjZGVmaW5lIHN0cmNhdChkc3QsIHNyYykgX19zc3BfYm9zX2No ZWNrMihzdHJjYXQsIGRzdCwgc3JjKTxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rI2RlZmluZSBz dHJuY3B5KGRzdCwgc3JjLCBsZW4pIF9fc3NwX2Jvc19jaGVjazMoc3RybmNweSwgZHN0LCBzcmMs IGxlbik8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyNkZWZpbmUgc3RybmNhdChkc3QsIHNyYywg bGVuKSBfX3NzcF9ib3NfY2hlY2szKHN0cm5jYXQsIGRzdCwgc3JjLCBsZW4pPGJyPjwvZGl2Pjxk aXYgZGlyPSJsdHIiPis8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyNlbmRpZiAvKiBfX1NTUF9G T1JUSUZZX0xFVkVMICZndDsgMCAqLzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rI2VuZGlmIC8q IF9TU1BfU1RSSU5HX0hfICovPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPmRpZmYgLS1naXQgYS9p bmNsdWRlL3NzcC9zdHJpbmdzLmggYi9pbmNsdWRlL3NzcC9zdHJpbmdzLmg8YnI+PC9kaXY+PGRp diBkaXI9Imx0ciI+bmV3IGZpbGUgbW9kZSAxMDA2NDQ8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+ aW5kZXggMDAwMDAwMDAwMDAwLi4wNmM5YzdjYzBhMDk8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+ LS0tIC9kZXYvbnVsbDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rKysgYi9pbmNsdWRlL3NzcC9z dHJpbmdzLmg8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+QEAgLTAsMCArMSw2NyBAQDxicj48L2Rp dj48ZGl2IGRpcj0ibHRyIj4rLyombmJzcDsmbmJzcDsmbmJzcDsgJE5ldEJTRDogc3RyaW5ncy5o LHYgMS4zIDIwMDgvMDQvMjggMjA6MjI6NTQgbWFydGluIEV4cCAkJm5ic3A7Jm5ic3A7Jm5ic3A7 ICovPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPis8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+Ky8q LTxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICo8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAq IFNQRFgtTGljZW5zZS1JZGVudGlmaWVyOiBCU0QtMi1DbGF1c2U8YnI+PC9kaXY+PGRpdiBkaXI9 Imx0ciI+KyAqPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBDb3B5cmlnaHQgKGMpIDIwMDcg VGhlIE5ldEJTRCBGb3VuZGF0aW9uLCBJbmMuPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBB bGwgcmlnaHRzIHJlc2VydmVkLjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICo8YnI+PC9kaXY+ PGRpdiBkaXI9Imx0ciI+KyAqIFRoaXMgY29kZSBpcyBkZXJpdmVkIGZyb20gc29mdHdhcmUgY29u dHJpYnV0ZWQgdG8gVGhlIE5ldEJTRCBGb3VuZGF0aW9uPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIi PisgKiBieSBDaHJpc3RvcyBab3VsYXMuPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKjxicj48 L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2Ug YW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIi PisgKiBtb2RpZmljYXRpb24sIGFyZSBwZXJtaXR0ZWQgcHJvdmlkZWQgdGhhdCB0aGUgZm9sbG93 aW5nIGNvbmRpdGlvbnM8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIGFyZSBtZXQ6PGJyPjwv ZGl2PjxkaXYgZGlyPSJsdHIiPisgKiAxLiBSZWRpc3RyaWJ1dGlvbnMgb2Ygc291cmNlIGNvZGUg bXVzdCByZXRhaW4gdGhlIGFib3ZlIGNvcHlyaWdodDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4r ICombmJzcDsgJm5ic3A7IG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBm b2xsb3dpbmcgZGlzY2xhaW1lci48YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIDIuIFJlZGlz dHJpYnV0aW9ucyBpbiBiaW5hcnkgZm9ybSBtdXN0IHJlcHJvZHVjZSB0aGUgYWJvdmUgY29weXJp Z2h0PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiZuYnNwOyAmbmJzcDsgbm90aWNlLCB0aGlz IGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyIGluIHRoZTxi cj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICombmJzcDsgJm5ic3A7IGRvY3VtZW50YXRpb24gYW5k L29yIG90aGVyIG1hdGVyaWFscyBwcm92aWRlZCB3aXRoIHRoZSBkaXN0cmlidXRpb24uPGJyPjwv ZGl2PjxkaXYgZGlyPSJsdHIiPisgKjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogVEhJUyBT T0ZUV0FSRSBJUyBQUk9WSURFRCBCWSBUSEUgTkVUQlNEIEZPVU5EQVRJT04sIElOQy4gQU5EIENP TlRSSUJVVE9SUzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogYGBBUyBJUycnIEFORCBBTlkg RVhQUkVTUyBPUiBJTVBMSUVEIFdBUlJBTlRJRVMsIElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVE PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBUTywgVEhFIElNUExJRUQgV0FSUkFOVElFUyBP RiBNRVJDSEFOVEFCSUxJVFkgQU5EIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUjxicj48L2Rpdj48 ZGl2IGRpcj0ibHRyIj4rICogUFVSUE9TRSBBUkUgRElTQ0xBSU1FRC4mbmJzcDsgSU4gTk8gRVZF TlQgU0hBTEwgVEhFIEZPVU5EQVRJT04gT1IgQ09OVFJJQlVUT1JTPGJyPjwvZGl2PjxkaXYgZGly PSJsdHIiPisgKiBCRSBMSUFCTEUgRk9SIEFOWSBESVJFQ1QsIElORElSRUNULCBJTkNJREVOVEFM LCBTUEVDSUFMLCBFWEVNUExBUlksIE9SPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBDT05T RVFVRU5USUFMIERBTUFHRVMgKElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBQUk9DVVJF TUVOVCBPRjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogU1VCU1RJVFVURSBHT09EUyBPUiBT RVJWSUNFUzsgTE9TUyBPRiBVU0UsIERBVEEsIE9SIFBST0ZJVFM7IE9SIEJVU0lORVNTPGJyPjwv ZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBJTlRFUlJVUFRJT04pIEhPV0VWRVIgQ0FVU0VEIEFORCBP TiBBTlkgVEhFT1JZIE9GIExJQUJJTElUWSwgV0hFVEhFUiBJTjxicj48L2Rpdj48ZGl2IGRpcj0i bHRyIj4rICogQ09OVFJBQ1QsIFNUUklDVCBMSUFCSUxJVFksIE9SIFRPUlQgKElOQ0xVRElORyBO RUdMSUdFTkNFIE9SIE9USEVSV0lTRSk8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIEFSSVNJ TkcgSU4gQU5ZIFdBWSBPVVQgT0YgVEhFIFVTRSBPRiBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFE VklTRUQgT0YgVEhFPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBQT1NTSUJJTElUWSBPRiBT VUNIIERBTUFHRS48YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqLzxicj48L2Rpdj48ZGl2IGRp cj0ibHRyIj4rI2lmbmRlZiBfU1NQX1NUUklOR1NfSF88YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+ KyNkZWZpbmUgX1NTUF9TVFJJTkdTX0hfPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPis8YnI+PC9k aXY+PGRpdiBkaXI9Imx0ciI+KyNpbmNsdWRlICZsdDtzc3Avc3NwLmgmZ3Q7PGJyPjwvZGl2Pjxk aXYgZGlyPSJsdHIiPisjaW5jbHVkZSAmbHQ7c3RyaW5nLmgmZ3Q7PGJyPjwvZGl2PjxkaXYgZGly PSJsdHIiPis8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyNpZiBfX1NTUF9GT1JUSUZZX0xFVkVM ICZndDsgMDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIi PisjZGVmaW5lIF9zc3BfYmNvcHkoc3JjdmFyLCBzcmMsIGRzdHZhciwgZHN0LCBsZW52YXIsJm5i c3A7IGxlbikgKHsmbmJzcDsmbmJzcDsmbmJzcDsgXDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4r Jm5ic3A7ICZuYnNwOyBjb25zdCB2b2lkICpzcmN2YXIgPSAoc3JjKTsmbmJzcDsmbmJzcDsmbmJz cDsgJm5ic3A7Jm5ic3A7Jm5ic3A7ICZuYnNwOyZuYnNwOyZuYnNwOyBcPGJyPjwvZGl2PjxkaXYg ZGlyPSJsdHIiPismbmJzcDsgJm5ic3A7IHZvaWQgKmRzdHZhciA9IChkc3QpOyZuYnNwOyZuYnNw OyZuYnNwOyAmbmJzcDsmbmJzcDsmbmJzcDsgJm5ic3A7Jm5ic3A7Jm5ic3A7IFw8YnI+PC9kaXY+ PGRpdiBkaXI9Imx0ciI+KyZuYnNwOyAmbmJzcDsgc2l6ZV90IGxlbnZhciA9IChsZW4pOyZuYnNw OyZuYnNwOyZuYnNwOyAmbmJzcDsmbmJzcDsmbmJzcDsgJm5ic3A7Jm5ic3A7Jm5ic3A7IFw8YnI+ PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyZuYnNwOyAmbmJzcDsgKChfX3NzcF9ib3MwKGRzdHZhcikg IT0gKHNpemVfdCktMSkgPyZuYnNwOyZuYnNwOyZuYnNwOyBcPGJyPjwvZGl2PjxkaXYgZGlyPSJs dHIiPismbmJzcDsgJm5ic3A7IF9fYnVpbHRpbl9fX21lbW1vdmVfY2hrKGRzdHZhciwgc3JjdmFy LCBsZW52YXIsJm5ic3A7Jm5ic3A7Jm5ic3A7IFw8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyZu YnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyBfX3NzcF9ib3MwKGRzdHZhcikpIDombmJzcDsmbmJz cDsmbmJzcDsgJm5ic3A7Jm5ic3A7Jm5ic3A7ICZuYnNwOyZuYnNwOyZuYnNwOyBcPGJyPjwvZGl2 PjxkaXYgZGlyPSJsdHIiPismbmJzcDsgJm5ic3A7IF9fbWVtbW92ZV9pY2hrKGRzdHZhciwgc3Jj dmFyLCBsZW52YXIpKTsmbmJzcDsmbmJzcDsmbmJzcDsgXDxicj48L2Rpdj48ZGl2IGRpcj0ibHRy Ij4rfSk8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+Kzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4r I2RlZmluZSZuYnNwOyZuYnNwOyZuYnNwOyBiY29weShzcmMsIGRzdCwgbGVuKSZuYnNwOyZuYnNw OyZuYnNwOyAmbmJzcDsmbmJzcDsmbmJzcDsgJm5ic3A7Jm5ic3A7Jm5ic3A7IFw8YnI+PC9kaXY+ PGRpdiBkaXI9Imx0ciI+KyZuYnNwOyAmbmJzcDsgX3NzcF9iY29weShfX3NzcF92YXIoc3Jjdiks IHNyYywgX19zc3BfdmFyKGRzdHYpLCBkc3QsIF9fc3NwX3ZhcihsZW52KSwgbGVuKTxicj48L2Rp dj48ZGl2IGRpcj0ibHRyIj4rPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisjZGVmaW5lIF9zc3Bf Ynplcm8oZHN0dmFyLCBkc3QsIGxlbnZhciwgbGVuKSAoeyZuYnNwOyZuYnNwOyZuYnNwOyAmbmJz cDsmbmJzcDsmbmJzcDsgXDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rJm5ic3A7ICZuYnNwOyB2 b2lkICpkc3R2YXIgPSAoZHN0KTsmbmJzcDsmbmJzcDsmbmJzcDsgJm5ic3A7Jm5ic3A7Jm5ic3A7 ICZuYnNwOyZuYnNwOyZuYnNwOyBcPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPismbmJzcDsgJm5i c3A7IHNpemVfdCBsZW52YXIgPSAobGVuKTsmbmJzcDsmbmJzcDsmbmJzcDsgJm5ic3A7Jm5ic3A7 Jm5ic3A7ICZuYnNwOyZuYnNwOyZuYnNwOyBcPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPismbmJz cDsgJm5ic3A7ICgoX19zc3BfYm9zMChkc3R2YXIpICE9IChzaXplX3QpLTEpID8mbmJzcDsmbmJz cDsmbmJzcDsgXDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rJm5ic3A7ICZuYnNwOyBfX2J1aWx0 aW5fX19tZW1zZXRfY2hrKGRzdHZhciwgMCwgbGVudmFyLCZuYnNwOyZuYnNwOyZuYnNwOyBcPGJy PjwvZGl2PjxkaXYgZGlyPSJsdHIiPismbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgX19zc3Bf Ym9zMChkc3R2YXIpKSA6IFw8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyZuYnNwOyAmbmJzcDsg X19tZW1zZXRfaWNoayhkc3R2YXIsIDAsIGxlbnZhcikpOyZuYnNwOyZuYnNwOyZuYnNwOyAmbmJz cDsmbmJzcDsmbmJzcDsgXDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rfSk8YnI+PC9kaXY+PGRp diBkaXI9Imx0ciI+Kzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rI2RlZmluZSZuYnNwOyZuYnNw OyZuYnNwOyBiemVybyhkc3QsIGxlbikmbmJzcDsmbmJzcDsmbmJzcDsgX3NzcF9iemVybyhfX3Nz cF92YXIoZHN0diksIGRzdCwgX19zc3BfdmFyKGxlbnYpLCBsZW4pPGJyPjwvZGl2PjxkaXYgZGly PSJsdHIiPis8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyNlbmRpZiAvKiBfX1NTUF9GT1JUSUZZ X0xFVkVMICZndDsgMCAqLzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rI2VuZGlmIC8qIF9TU1Bf U1RSSU5HU19IXyAqLzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj5kaWZmIC0tZ2l0IGEvaW5jbHVk ZS9zc3AvdW5pc3RkLmggYi9pbmNsdWRlL3NzcC91bmlzdGQuaDxicj48L2Rpdj48ZGl2IGRpcj0i bHRyIj5uZXcgZmlsZSBtb2RlIDEwMDY0NDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj5pbmRleCAw MDAwMDAwMDAwMDAuLjI0MTRlMmJhYTk2Yjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4tLS0gL2Rl di9udWxsPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisrKyBiL2luY2x1ZGUvc3NwL3VuaXN0ZC5o PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPkBAIC0wLDAgKzEsNTQgQEA8YnI+PC9kaXY+PGRpdiBk aXI9Imx0ciI+Ky8qJm5ic3A7Jm5ic3A7Jm5ic3A7ICROZXRCU0Q6IHVuaXN0ZC5oLHYgMS43IDIw MTUvMDYvMjUgMTg6NDE6MDMgam9lcmcgRXhwICQmbmJzcDsmbmJzcDsmbmJzcDsgKi88YnI+PC9k aXY+PGRpdiBkaXI9Imx0ciI+Kzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rLyotPGJyPjwvZGl2 PjxkaXYgZGlyPSJsdHIiPisgKjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogU1BEWC1MaWNl bnNlLUlkZW50aWZpZXI6IEJTRC0yLUNsYXVzZTxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICo8 YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIENvcHlyaWdodCAoYykgMjAwNiBUaGUgTmV0QlNE IEZvdW5kYXRpb24sIEluYy48YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIEFsbCByaWdodHMg cmVzZXJ2ZWQuPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKjxicj48L2Rpdj48ZGl2IGRpcj0i bHRyIj4rICogVGhpcyBjb2RlIGlzIGRlcml2ZWQgZnJvbSBzb2Z0d2FyZSBjb250cmlidXRlZCB0 byBUaGUgTmV0QlNEIEZvdW5kYXRpb248YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIGJ5IENo cmlzdG9zIFpvdWxhcy48YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqPGJyPjwvZGl2PjxkaXYg ZGlyPSJsdHIiPisgKiBSZWRpc3RyaWJ1dGlvbiBhbmQgdXNlIGluIHNvdXJjZSBhbmQgYmluYXJ5 IGZvcm1zLCB3aXRoIG9yIHdpdGhvdXQ8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIG1vZGlm aWNhdGlvbiwgYXJlIHBlcm1pdHRlZCBwcm92aWRlZCB0aGF0IHRoZSBmb2xsb3dpbmcgY29uZGl0 aW9uczxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogYXJlIG1ldDo8YnI+PC9kaXY+PGRpdiBk aXI9Imx0ciI+KyAqIDEuIFJlZGlzdHJpYnV0aW9ucyBvZiBzb3VyY2UgY29kZSBtdXN0IHJldGFp biB0aGUgYWJvdmUgY29weXJpZ2h0PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiZuYnNwOyAm bmJzcDsgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBk aXNjbGFpbWVyLjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogMi4gUmVkaXN0cmlidXRpb25z IGluIGJpbmFyeSBmb3JtIG11c3QgcmVwcm9kdWNlIHRoZSBhYm92ZSBjb3B5cmlnaHQ8YnI+PC9k aXY+PGRpdiBkaXI9Imx0ciI+KyAqJm5ic3A7ICZuYnNwOyBub3RpY2UsIHRoaXMgbGlzdCBvZiBj b25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIgaW4gdGhlPGJyPjwvZGl2Pjxk aXYgZGlyPSJsdHIiPisgKiZuYnNwOyAmbmJzcDsgZG9jdW1lbnRhdGlvbiBhbmQvb3Igb3RoZXIg bWF0ZXJpYWxzIHByb3ZpZGVkIHdpdGggdGhlIGRpc3RyaWJ1dGlvbi48YnI+PC9kaXY+PGRpdiBk aXI9Imx0ciI+KyAqPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBUSElTIFNPRlRXQVJFIElT IFBST1ZJREVEIEJZIFRIRSBORVRCU0QgRk9VTkRBVElPTiwgSU5DLiBBTkQgQ09OVFJJQlVUT1JT PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBgYEFTIElTJycgQU5EIEFOWSBFWFBSRVNTIE9S IElNUExJRUQgV0FSUkFOVElFUywgSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQ8YnI+PC9kaXY+ PGRpdiBkaXI9Imx0ciI+KyAqIFRPLCBUSEUgSU1QTElFRCBXQVJSQU5USUVTIE9GIE1FUkNIQU5U QUJJTElUWSBBTkQgRklUTkVTUyBGT1IgQSBQQVJUSUNVTEFSPGJyPjwvZGl2PjxkaXYgZGlyPSJs dHIiPisgKiBQVVJQT1NFIEFSRSBESVNDTEFJTUVELiZuYnNwOyBJTiBOTyBFVkVOVCBTSEFMTCBU SEUgRk9VTkRBVElPTiBPUiBDT05UUklCVVRPUlM8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAq IEJFIExJQUJMRSBGT1IgQU5ZIERJUkVDVCwgSU5ESVJFQ1QsIElOQ0lERU5UQUwsIFNQRUNJQUws IEVYRU1QTEFSWSwgT1I8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIENPTlNFUVVFTlRJQUwg REFNQUdFUyAoSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQgVE8sIFBST0NVUkVNRU5UIE9GPGJy PjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBTVUJTVElUVVRFIEdPT0RTIE9SIFNFUlZJQ0VTOyBM T1NTIE9GIFVTRSwgREFUQSwgT1IgUFJPRklUUzsgT1IgQlVTSU5FU1M8YnI+PC9kaXY+PGRpdiBk aXI9Imx0ciI+KyAqIElOVEVSUlVQVElPTikgSE9XRVZFUiBDQVVTRUQgQU5EIE9OIEFOWSBUSEVP UlkgT0YgTElBQklMSVRZLCBXSEVUSEVSIElOPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBD T05UUkFDVCwgU1RSSUNUIExJQUJJTElUWSwgT1IgVE9SVCAoSU5DTFVESU5HIE5FR0xJR0VOQ0Ug T1IgT1RIRVJXSVNFKTxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogQVJJU0lORyBJTiBBTlkg V0FZIE9VVCBPRiBUSEUgVVNFIE9GIFRISVMgU09GVFdBUkUsIEVWRU4gSUYgQURWSVNFRCBPRiBU SEU8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdF Ljxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICovPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisj aWZuZGVmIF9TU1BfVU5JU1REX0hfPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisjZGVmaW5lIF9T U1BfVU5JU1REX0hfPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPis8YnI+PC9kaXY+PGRpdiBkaXI9 Imx0ciI+KyNpbmNsdWRlICZsdDtzc3Avc3NwLmgmZ3Q7PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIi Pis8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyNpZiBfX1NTUF9GT1JUSUZZX0xFVkVMICZndDsg MDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rX19CRUdJTl9ERUNMUzxicj48L2Rpdj48ZGl2IGRp cj0ibHRyIj4rPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPitfX3NzcF9yZWRpcmVjdDAoc3NpemVf dCwgcmVhZCwgKGludCBfX2ZkLCB2b2lkICpfX2J1Ziwgc2l6ZV90IF9fbGVuKSwgXDxicj48L2Rp dj48ZGl2IGRpcj0ibHRyIj4rJm5ic3A7ICZuYnNwOyAoX19mZCwgX19idWYsIF9fbGVuKSk7PGJy PjwvZGl2PjxkaXYgZGlyPSJsdHIiPis8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+K19fc3NwX3Jl ZGlyZWN0KHNzaXplX3QsIHJlYWRsaW5rLCAoY29uc3QgY2hhciAqX19yZXN0cmljdCBfX3BhdGgs IFw8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyZuYnNwOyAmbmJzcDsgY2hhciAqX19yZXN0cmlj dCBfX2J1Ziwgc2l6ZV90IF9fbGVuKSwgKF9fcGF0aCwgX19idWYsIF9fbGVuKSk7PGJyPjwvZGl2 PjxkaXYgZGlyPSJsdHIiPis8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+K19fc3NwX3JlZGlyZWN0 X3JhdyhjaGFyICosIGdldGN3ZCwgZ2V0Y3dkLCAoY2hhciAqX19idWYsIHNpemVfdCBfX2xlbiks PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPismbmJzcDsgJm5ic3A7IChfX2J1ZiwgX19sZW4pLCBf X2J1ZiAhPSAwLCBfX3NzcF9ib3MpOzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rPGJyPjwvZGl2 PjxkaXYgZGlyPSJsdHIiPitfX0VORF9ERUNMUzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rPGJy PjwvZGl2PjxkaXYgZGlyPSJsdHIiPisjZW5kaWYgLyogX19TU1BfRk9SVElGWV9MRVZFTCAmZ3Q7 IDAgKi88YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyNlbmRpZiAvKiBfU1NQX1VOSVNURF9IXyAq Lzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj5kaWZmIC0tZ2l0IGEvbGliL2xpYmMvc2VjdXJlL01h a2VmaWxlLmluYyBiL2xpYi9saWJjL3NlY3VyZS9NYWtlZmlsZS5pbmM8YnI+PC9kaXY+PGRpdiBk aXI9Imx0ciI+aW5kZXggODU3NGM1YTA1ZGM1Li4zYjFhZDg3OWM3MTUgMTAwNjQ0PGJyPjwvZGl2 PjxkaXYgZGlyPSJsdHIiPi0tLSBhL2xpYi9saWJjL3NlY3VyZS9NYWtlZmlsZS5pbmM8YnI+PC9k aXY+PGRpdiBkaXI9Imx0ciI+KysrIGIvbGliL2xpYmMvc2VjdXJlL01ha2VmaWxlLmluYzxicj48 L2Rpdj48ZGl2IGRpcj0ibHRyIj5AQCAtMyw2ICszLDE3IEBAPGJyPjwvZGl2PjxkaXYgZGlyPSJs dHIiPiA8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+IC5QQVRIOiAke0xJQkNfU1JDVE9QfS9zZWN1 cmU8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+IDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rIyBf Rk9SVElGWV9TT1VSQ0U8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+K1NSQ1MrPSZuYnNwOyZuYnNw OyZuYnNwOyBnZXRzX2Noay5jIGZnZXRzX2Noay5jIG1lbWNweV9jaGsuYyBtZW1tb3ZlX2Noay5j IG1lbXNldF9jaGsuYyBcPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPismbmJzcDsmbmJzcDsmbmJz cDsgc25wcmludGZfY2hrLmMgc3ByaW50Zl9jaGsuYyBzdHBjcHlfY2hrLmMgc3RwbmNweV9jaGsu YyBcPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPismbmJzcDsmbmJzcDsmbmJzcDsgc3RyY2F0X2No ay5jIHN0cmNweV9jaGsuYyBzdHJuY2F0X2Noay5jIHN0cm5jcHlfY2hrLmMgXDxicj48L2Rpdj48 ZGl2IGRpcj0ibHRyIj4rJm5ic3A7Jm5ic3A7Jm5ic3A7IHZzbnByaW50Zl9jaGsuYyB2c3ByaW50 Zl9jaGsuYzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIi PitDRkxBR1Muc25wcmludGZfY2hrLmMrPSZuYnNwOyZuYnNwOyZuYnNwOyAtV25vLXVudXNlZC1w YXJhbWV0ZXI8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+K0NGTEFHUy5zcHJpbnRmX2Noay5jKz0m bmJzcDsmbmJzcDsmbmJzcDsgLVduby11bnVzZWQtcGFyYW1ldGVyPGJyPjwvZGl2PjxkaXYgZGly PSJsdHIiPitDRkxBR1MudnNucHJpbnRmX2Noay5jKz0mbmJzcDsmbmJzcDsmbmJzcDsgLVduby11 bnVzZWQtcGFyYW1ldGVyPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPitDRkxBR1MudnNwcmludGZf Y2hrLmMrPSZuYnNwOyZuYnNwOyZuYnNwOyAtV25vLXVudXNlZC1wYXJhbWV0ZXI8YnI+PC9kaXY+ PGRpdiBkaXI9Imx0ciI+Kzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4gIyBTb3VyY2VzIGNvbW1v biB0byBib3RoIHN5c2NhbGwgaW50ZXJmYWNlczo8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+IFNS Q1MrPSZuYnNwOyZuYnNwOyZuYnNwOyBzdGFja19wcm90ZWN0b3IuYyBcPGJyPjwvZGl2PjxkaXYg ZGlyPSJsdHIiPiAmbmJzcDsmbmJzcDsmbmJzcDsgc3RhY2tfcHJvdGVjdG9yX2NvbXBhdC5jPGJy PjwvZGl2PjxkaXYgZGlyPSJsdHIiPmRpZmYgLS1naXQgYS9saWIvbGliYy9zZWN1cmUvU3ltYm9s Lm1hcCBiL2xpYi9saWJjL3NlY3VyZS9TeW1ib2wubWFwPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIi PmluZGV4IDY0MWY0NTFiNTQyMS4uNzg1OWZjZWUzODIxIDEwMDY0NDxicj48L2Rpdj48ZGl2IGRp cj0ibHRyIj4tLS0gYS9saWIvbGliYy9zZWN1cmUvU3ltYm9sLm1hcDxicj48L2Rpdj48ZGl2IGRp cj0ibHRyIj4rKysgYi9saWIvbGliYy9zZWN1cmUvU3ltYm9sLm1hcDxicj48L2Rpdj48ZGl2IGRp cj0ibHRyIj5AQCAtMywzICszLDIxIEBAIEZCU0RfMS4wIHs8IS0tIC0tPjxicj48L2Rpdj48ZGl2 IGRpcj0ibHRyIj4gJm5ic3A7Jm5ic3A7Jm5ic3A7IF9fc3RhY2tfY2hrX2ZhaWw7PGJyPjwvZGl2 PjxkaXYgZGlyPSJsdHIiPiAmbmJzcDsmbmJzcDsmbmJzcDsgX19zdGFja19jaGtfZ3VhcmQ7PGJy PjwvZGl2PjxkaXYgZGlyPSJsdHIiPiB9Ozxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rPGJyPjwv ZGl2PjxkaXYgZGlyPSJsdHIiPitGQlNEXzEuOCB7PCEtLSAtLT48YnI+PC9kaXY+PGRpdiBkaXI9 Imx0ciI+KyZuYnNwOyZuYnNwOyZuYnNwOyBfX2dldHNfY2hrOzxicj48L2Rpdj48ZGl2IGRpcj0i bHRyIj4rJm5ic3A7Jm5ic3A7Jm5ic3A7IF9fZmdldHNfY2hrOzxicj48L2Rpdj48ZGl2IGRpcj0i bHRyIj4rJm5ic3A7Jm5ic3A7Jm5ic3A7IF9fbWVtY3B5X2Noazs8YnI+PC9kaXY+PGRpdiBkaXI9 Imx0ciI+KyZuYnNwOyZuYnNwOyZuYnNwOyBfX21lbW1vdmVfY2hrOzxicj48L2Rpdj48ZGl2IGRp cj0ibHRyIj4rJm5ic3A7Jm5ic3A7Jm5ic3A7IF9fbWVtc2V0X2Noazs8YnI+PC9kaXY+PGRpdiBk aXI9Imx0ciI+KyZuYnNwOyZuYnNwOyZuYnNwOyBfX3NucHJpbnRmX2Noazs8YnI+PC9kaXY+PGRp diBkaXI9Imx0ciI+KyZuYnNwOyZuYnNwOyZuYnNwOyBfX3NwcmludGZfY2hrOzxicj48L2Rpdj48 ZGl2IGRpcj0ibHRyIj4rJm5ic3A7Jm5ic3A7Jm5ic3A7IF9fc3RwY3B5X2Noazs8YnI+PC9kaXY+ PGRpdiBkaXI9Imx0ciI+KyZuYnNwOyZuYnNwOyZuYnNwOyBfX3N0cG5jcHlfY2hrOzxicj48L2Rp dj48ZGl2IGRpcj0ibHRyIj4rJm5ic3A7Jm5ic3A7Jm5ic3A7IF9fc3RyY2F0X2Noazs8YnI+PC9k aXY+PGRpdiBkaXI9Imx0ciI+KyZuYnNwOyZuYnNwOyZuYnNwOyBfX3N0cmNweV9jaGs7PGJyPjwv ZGl2PjxkaXYgZGlyPSJsdHIiPismbmJzcDsmbmJzcDsmbmJzcDsgX19zdHJuY2F0X2Noazs8YnI+ PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyZuYnNwOyZuYnNwOyZuYnNwOyBfX3N0cm5jcHlfY2hrOzxi cj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rJm5ic3A7Jm5ic3A7Jm5ic3A7IF9fdnNucHJpbnRmX2No azs8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyZuYnNwOyZuYnNwOyZuYnNwOyBfX3ZzcHJpbnRm X2Noazs8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+K307PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIi PmRpZmYgLS1naXQgYS9saWIvbGliYy9zZWN1cmUvZmdldHNfY2hrLmMgYi9saWIvbGliYy9zZWN1 cmUvZmdldHNfY2hrLmM8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+bmV3IGZpbGUgbW9kZSAxMDA2 NDQ8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+aW5kZXggMDAwMDAwMDAwMDAwLi43MmFhMWQ4MTZj ZTE8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+LS0tIC9kZXYvbnVsbDxicj48L2Rpdj48ZGl2IGRp cj0ibHRyIj4rKysgYi9saWIvbGliYy9zZWN1cmUvZmdldHNfY2hrLmM8YnI+PC9kaXY+PGRpdiBk aXI9Imx0ciI+QEAgLTAsMCArMSw1NCBAQDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rLyotPGJy PjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogU1BE WC1MaWNlbnNlLUlkZW50aWZpZXI6IEJTRC0yLUNsYXVzZTxicj48L2Rpdj48ZGl2IGRpcj0ibHRy Ij4rICo8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIENvcHlyaWdodCAoYykgMjAwNiBUaGUg TmV0QlNEIEZvdW5kYXRpb24sIEluYy48YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIEFsbCBy aWdodHMgcmVzZXJ2ZWQuPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKjxicj48L2Rpdj48ZGl2 IGRpcj0ibHRyIj4rICogVGhpcyBjb2RlIGlzIGRlcml2ZWQgZnJvbSBzb2Z0d2FyZSBjb250cmli dXRlZCB0byBUaGUgTmV0QlNEIEZvdW5kYXRpb248YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAq IGJ5IENocmlzdG9zIFpvdWxhcy48YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqPGJyPjwvZGl2 PjxkaXYgZGlyPSJsdHIiPisgKiBSZWRpc3RyaWJ1dGlvbiBhbmQgdXNlIGluIHNvdXJjZSBhbmQg YmluYXJ5IGZvcm1zLCB3aXRoIG9yIHdpdGhvdXQ8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAq IG1vZGlmaWNhdGlvbiwgYXJlIHBlcm1pdHRlZCBwcm92aWRlZCB0aGF0IHRoZSBmb2xsb3dpbmcg Y29uZGl0aW9uczxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogYXJlIG1ldDo8YnI+PC9kaXY+ PGRpdiBkaXI9Imx0ciI+KyAqIDEuIFJlZGlzdHJpYnV0aW9ucyBvZiBzb3VyY2UgY29kZSBtdXN0 IHJldGFpbiB0aGUgYWJvdmUgY29weXJpZ2h0PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiZu YnNwOyAmbmJzcDsgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxv d2luZyBkaXNjbGFpbWVyLjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogMi4gUmVkaXN0cmli dXRpb25zIGluIGJpbmFyeSBmb3JtIG11c3QgcmVwcm9kdWNlIHRoZSBhYm92ZSBjb3B5cmlnaHQ8 YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqJm5ic3A7ICZuYnNwOyBub3RpY2UsIHRoaXMgbGlz dCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIgaW4gdGhlPGJyPjwv ZGl2PjxkaXYgZGlyPSJsdHIiPisgKiZuYnNwOyAmbmJzcDsgZG9jdW1lbnRhdGlvbiBhbmQvb3Ig b3RoZXIgbWF0ZXJpYWxzIHByb3ZpZGVkIHdpdGggdGhlIGRpc3RyaWJ1dGlvbi48YnI+PC9kaXY+ PGRpdiBkaXI9Imx0ciI+KyAqPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBUSElTIFNPRlRX QVJFIElTIFBST1ZJREVEIEJZIFRIRSBORVRCU0QgRk9VTkRBVElPTiwgSU5DLiBBTkQgQ09OVFJJ QlVUT1JTPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBgYEFTIElTJycgQU5EIEFOWSBFWFBS RVNTIE9SIElNUExJRUQgV0FSUkFOVElFUywgSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQ8YnI+ PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIFRPLCBUSEUgSU1QTElFRCBXQVJSQU5USUVTIE9GIE1F UkNIQU5UQUJJTElUWSBBTkQgRklUTkVTUyBGT1IgQSBQQVJUSUNVTEFSPGJyPjwvZGl2PjxkaXYg ZGlyPSJsdHIiPisgKiBQVVJQT1NFIEFSRSBESVNDTEFJTUVELiZuYnNwOyBJTiBOTyBFVkVOVCBT SEFMTCBUSEUgRk9VTkRBVElPTiBPUiBDT05UUklCVVRPUlM8YnI+PC9kaXY+PGRpdiBkaXI9Imx0 ciI+KyAqIEJFIExJQUJMRSBGT1IgQU5ZIERJUkVDVCwgSU5ESVJFQ1QsIElOQ0lERU5UQUwsIFNQ RUNJQUwsIEVYRU1QTEFSWSwgT1I8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIENPTlNFUVVF TlRJQUwgREFNQUdFUyAoSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQgVE8sIFBST0NVUkVNRU5U IE9GPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBTVUJTVElUVVRFIEdPT0RTIE9SIFNFUlZJ Q0VTOyBMT1NTIE9GIFVTRSwgREFUQSwgT1IgUFJPRklUUzsgT1IgQlVTSU5FU1M8YnI+PC9kaXY+ PGRpdiBkaXI9Imx0ciI+KyAqIElOVEVSUlVQVElPTikgSE9XRVZFUiBDQVVTRUQgQU5EIE9OIEFO WSBUSEVPUlkgT0YgTElBQklMSVRZLCBXSEVUSEVSIElOPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIi PisgKiBDT05UUkFDVCwgU1RSSUNUIExJQUJJTElUWSwgT1IgVE9SVCAoSU5DTFVESU5HIE5FR0xJ R0VOQ0UgT1IgT1RIRVJXSVNFKTxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogQVJJU0lORyBJ TiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNFIE9GIFRISVMgU09GVFdBUkUsIEVWRU4gSUYgQURWSVNF RCBPRiBUSEU8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIFBPU1NJQklMSVRZIE9GIFNVQ0gg REFNQUdFLjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICovPGJyPjwvZGl2PjxkaXYgZGlyPSJs dHIiPisjaW5jbHVkZSAmbHQ7c3lzL2NkZWZzLmgmZ3Q7PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIi PitfX1JDU0lEKCIkTmV0QlNEOiBmZ2V0c19jaGsuYyx2IDEuNiAyMDA5LzAyLzA1IDA1OjQxOjUx IGx1a2VtIEV4cCAkIik7PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPis8YnI+PC9kaXY+PGRpdiBk aXI9Imx0ciI+KyNpbmNsdWRlICZsdDtsaW1pdHMuaCZndDs8YnI+PC9kaXY+PGRpdiBkaXI9Imx0 ciI+KyNpbmNsdWRlICZsdDtzdGRpby5oJmd0Ozxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rI2lu Y2x1ZGUgJmx0O3N0ZGxpYi5oJmd0Ozxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rI2luY2x1ZGUg Jmx0O3N0cmluZy5oJmd0Ozxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rPGJyPjwvZGl2PjxkaXYg ZGlyPSJsdHIiPisjaW5jbHVkZSAmbHQ7c3NwL3N0ZGlvLmgmZ3Q7PGJyPjwvZGl2PjxkaXYgZGly PSJsdHIiPisjaW5jbHVkZSAmbHQ7c3NwL3N0cmluZy5oJmd0Ozxicj48L2Rpdj48ZGl2IGRpcj0i bHRyIj4rI3VuZGVmIGZnZXRzPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPis8YnI+PC9kaXY+PGRp diBkaXI9Imx0ciI+K2NoYXIgKjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rX19mZ2V0c19jaGso Y2hhciAqIF9fcmVzdHJpY3QgYnVmLCBpbnQgbGVuLCBzaXplX3Qgc2xlbiwgRklMRSAqZnApPGJy PjwvZGl2PjxkaXYgZGlyPSJsdHIiPit7PCEtLSAtLT48YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+ KyZuYnNwOyZuYnNwOyZuYnNwOyBpZiAoc2xlbiAmZ3Q7PSAoc2l6ZV90KUlOVF9NQVgpPGJyPjwv ZGl2PjxkaXYgZGlyPSJsdHIiPismbmJzcDsmbmJzcDsmbmJzcDsgJm5ic3A7Jm5ic3A7Jm5ic3A7 IHJldHVybiAoZmdldHMoYnVmLCBsZW4sIGZwKSk7PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPis8 YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyZuYnNwOyZuYnNwOyZuYnNwOyBpZiAobGVuICZndDs9 IDAgJmFtcDsmYW1wOyAoc2l6ZV90KWxlbiAmZ3Q7IHNsZW4pPGJyPjwvZGl2PjxkaXYgZGlyPSJs dHIiPismbmJzcDsmbmJzcDsmbmJzcDsgJm5ic3A7Jm5ic3A7Jm5ic3A7IF9fY2hrX2ZhaWwoKTs8 YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+Kzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rJm5ic3A7 Jm5ic3A7Jm5ic3A7IHJldHVybiAoZmdldHMoYnVmLCBsZW4sIGZwKSk7PGJyPjwvZGl2PjxkaXYg ZGlyPSJsdHIiPit9PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPmRpZmYgLS1naXQgYS9saWIvbGli Yy9zZWN1cmUvZ2V0c19jaGsuYyBiL2xpYi9saWJjL3NlY3VyZS9nZXRzX2Noay5jPGJyPjwvZGl2 PjxkaXYgZGlyPSJsdHIiPm5ldyBmaWxlIG1vZGUgMTAwNjQ0PGJyPjwvZGl2PjxkaXYgZGlyPSJs dHIiPmluZGV4IDAwMDAwMDAwMDAwMC4uMThjMWUyZDE4ZjQzPGJyPjwvZGl2PjxkaXYgZGlyPSJs dHIiPi0tLSAvZGV2L251bGw8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KysrIGIvbGliL2xpYmMv c2VjdXJlL2dldHNfY2hrLmM8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+QEAgLTAsMCArMSw3NCBA QDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rLyotPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisg Kjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IEJT RC0yLUNsYXVzZTxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICo8YnI+PC9kaXY+PGRpdiBkaXI9 Imx0ciI+KyAqIENvcHlyaWdodCAoYykgMjAwNiBUaGUgTmV0QlNEIEZvdW5kYXRpb24sIEluYy48 YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIEFsbCByaWdodHMgcmVzZXJ2ZWQuPGJyPjwvZGl2 PjxkaXYgZGlyPSJsdHIiPisgKjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogVGhpcyBjb2Rl IGlzIGRlcml2ZWQgZnJvbSBzb2Z0d2FyZSBjb250cmlidXRlZCB0byBUaGUgTmV0QlNEIEZvdW5k YXRpb248YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIGJ5IENocmlzdG9zIFpvdWxhcy48YnI+ PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBSZWRp c3RyaWJ1dGlvbiBhbmQgdXNlIGluIHNvdXJjZSBhbmQgYmluYXJ5IGZvcm1zLCB3aXRoIG9yIHdp dGhvdXQ8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIG1vZGlmaWNhdGlvbiwgYXJlIHBlcm1p dHRlZCBwcm92aWRlZCB0aGF0IHRoZSBmb2xsb3dpbmcgY29uZGl0aW9uczxicj48L2Rpdj48ZGl2 IGRpcj0ibHRyIj4rICogYXJlIG1ldDo8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIDEuIFJl ZGlzdHJpYnV0aW9ucyBvZiBzb3VyY2UgY29kZSBtdXN0IHJldGFpbiB0aGUgYWJvdmUgY29weXJp Z2h0PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiZuYnNwOyAmbmJzcDsgbm90aWNlLCB0aGlz IGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyLjxicj48L2Rp dj48ZGl2IGRpcj0ibHRyIj4rICogMi4gUmVkaXN0cmlidXRpb25zIGluIGJpbmFyeSBmb3JtIG11 c3QgcmVwcm9kdWNlIHRoZSBhYm92ZSBjb3B5cmlnaHQ8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+ KyAqJm5ic3A7ICZuYnNwOyBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUg Zm9sbG93aW5nIGRpc2NsYWltZXIgaW4gdGhlPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiZu YnNwOyAmbmJzcDsgZG9jdW1lbnRhdGlvbiBhbmQvb3Igb3RoZXIgbWF0ZXJpYWxzIHByb3ZpZGVk IHdpdGggdGhlIGRpc3RyaWJ1dGlvbi48YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqPGJyPjwv ZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBUSElTIFNPRlRXQVJFIElTIFBST1ZJREVEIEJZIFRIRSBO RVRCU0QgRk9VTkRBVElPTiwgSU5DLiBBTkQgQ09OVFJJQlVUT1JTPGJyPjwvZGl2PjxkaXYgZGly PSJsdHIiPisgKiBgYEFTIElTJycgQU5EIEFOWSBFWFBSRVNTIE9SIElNUExJRUQgV0FSUkFOVElF UywgSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQ8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAq IFRPLCBUSEUgSU1QTElFRCBXQVJSQU5USUVTIE9GIE1FUkNIQU5UQUJJTElUWSBBTkQgRklUTkVT UyBGT1IgQSBQQVJUSUNVTEFSPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBQVVJQT1NFIEFS RSBESVNDTEFJTUVELiZuYnNwOyBJTiBOTyBFVkVOVCBTSEFMTCBUSEUgRk9VTkRBVElPTiBPUiBD T05UUklCVVRPUlM8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIEJFIExJQUJMRSBGT1IgQU5Z IERJUkVDVCwgSU5ESVJFQ1QsIElOQ0lERU5UQUwsIFNQRUNJQUwsIEVYRU1QTEFSWSwgT1I8YnI+ PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIENPTlNFUVVFTlRJQUwgREFNQUdFUyAoSU5DTFVESU5H LCBCVVQgTk9UIExJTUlURUQgVE8sIFBST0NVUkVNRU5UIE9GPGJyPjwvZGl2PjxkaXYgZGlyPSJs dHIiPisgKiBTVUJTVElUVVRFIEdPT0RTIE9SIFNFUlZJQ0VTOyBMT1NTIE9GIFVTRSwgREFUQSwg T1IgUFJPRklUUzsgT1IgQlVTSU5FU1M8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIElOVEVS UlVQVElPTikgSE9XRVZFUiBDQVVTRUQgQU5EIE9OIEFOWSBUSEVPUlkgT0YgTElBQklMSVRZLCBX SEVUSEVSIElOPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBDT05UUkFDVCwgU1RSSUNUIExJ QUJJTElUWSwgT1IgVE9SVCAoSU5DTFVESU5HIE5FR0xJR0VOQ0UgT1IgT1RIRVJXSVNFKTxicj48 L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogQVJJU0lORyBJTiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNF IE9GIFRISVMgU09GVFdBUkUsIEVWRU4gSUYgQURWSVNFRCBPRiBUSEU8YnI+PC9kaXY+PGRpdiBk aXI9Imx0ciI+KyAqIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLjxicj48L2Rpdj48ZGl2IGRp cj0ibHRyIj4rICovPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisjaW5jbHVkZSAmbHQ7c3lzL2Nk ZWZzLmgmZ3Q7PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPitfX1JDU0lEKCIkTmV0QlNEOiBnZXRz X2Noay5jLHYgMS43IDIwMTMvMTAvMDQgMjA6NDk6MTYgY2hyaXN0b3MgRXhwICQiKTs8YnI+PC9k aXY+PGRpdiBkaXI9Imx0ciI+Kzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rI2luY2x1ZGUgJmx0 O2xpbWl0cy5oJmd0Ozxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rI2luY2x1ZGUgJmx0O3N0ZGlv LmgmZ3Q7PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisjaW5jbHVkZSAmbHQ7c3RkbGliLmgmZ3Q7 PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisjaW5jbHVkZSAmbHQ7c3RyaW5nLmgmZ3Q7PGJyPjwv ZGl2PjxkaXYgZGlyPSJsdHIiPis8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyNpbmNsdWRlICZs dDtzc3Avc3RkaW8uaCZndDs8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyNpbmNsdWRlICZsdDtz c3Avc3RyaW5nLmgmZ3Q7PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPis8YnI+PC9kaXY+PGRpdiBk aXI9Imx0ciI+K2NoYXIgKl9fZ2V0c191bnNhZmUoY2hhciAqKTs8YnI+PC9kaXY+PGRpdiBkaXI9 Imx0ciI+Kzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rY2hhciAqPGJyPjwvZGl2PjxkaXYgZGly PSJsdHIiPitfX2dldHNfY2hrKGNoYXIgKiBfX3Jlc3RyaWN0IGJ1Ziwgc2l6ZV90IHNsZW4pPGJy PjwvZGl2PjxkaXYgZGlyPSJsdHIiPit7PCEtLSAtLT48YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+ KyZuYnNwOyZuYnNwOyZuYnNwOyBjaGFyICphYnVmOzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4r Jm5ic3A7Jm5ic3A7Jm5ic3A7IHNpemVfdCBsZW47PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPis8 YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyZuYnNwOyZuYnNwOyZuYnNwOyBpZiAoc2xlbiAmZ3Q7 PSAoc2l6ZV90KUlOVF9NQVgpPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPismbmJzcDsmbmJzcDsm bmJzcDsgJm5ic3A7Jm5ic3A7Jm5ic3A7IHJldHVybiAoX19nZXRzX3Vuc2FmZShidWYpKTs8YnI+ PC9kaXY+PGRpdiBkaXI9Imx0ciI+Kzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rJm5ic3A7Jm5i c3A7Jm5ic3A7IGlmICgoYWJ1ZiA9IG1hbGxvYyhzbGVuICsgMSkpID09IE5VTEwpPGJyPjwvZGl2 PjxkaXYgZGlyPSJsdHIiPismbmJzcDsmbmJzcDsmbmJzcDsgJm5ic3A7Jm5ic3A7Jm5ic3A7IHJl dHVybiAoX19nZXRzX3Vuc2FmZShidWYpKTs8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+Kzxicj48 L2Rpdj48ZGl2IGRpcj0ibHRyIj4rJm5ic3A7Jm5ic3A7Jm5ic3A7IGlmIChmZ2V0cyhhYnVmLCAo aW50KShzbGVuICsgMSksIHN0ZGluKSA9PSBOVUxMKSB7PCEtLSAtLT48YnI+PC9kaXY+PGRpdiBk aXI9Imx0ciI+KyZuYnNwOyZuYnNwOyZuYnNwOyAmbmJzcDsmbmJzcDsmbmJzcDsgZnJlZShhYnVm KTs8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyZuYnNwOyZuYnNwOyZuYnNwOyAmbmJzcDsmbmJz cDsmbmJzcDsgcmV0dXJuIChOVUxMKTs8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyZuYnNwOyZu YnNwOyZuYnNwOyB9PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPis8YnI+PC9kaXY+PGRpdiBkaXI9 Imx0ciI+KyZuYnNwOyZuYnNwOyZuYnNwOyBsZW4gPSBzdHJsZW4oYWJ1Zik7PGJyPjwvZGl2Pjxk aXYgZGlyPSJsdHIiPismbmJzcDsmbmJzcDsmbmJzcDsgaWYgKGxlbiAmZ3Q7IDAgJmFtcDsmYW1w OyBhYnVmW2xlbiAtIDFdID09ICdcbicpPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPismbmJzcDsm bmJzcDsmbmJzcDsgJm5ic3A7Jm5ic3A7Jm5ic3A7IC0tbGVuOzxicj48L2Rpdj48ZGl2IGRpcj0i bHRyIj4rPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPismbmJzcDsmbmJzcDsmbmJzcDsgaWYgKGxl biAmZ3Q7PSBzbGVuKTxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rJm5ic3A7Jm5ic3A7Jm5ic3A7 ICZuYnNwOyZuYnNwOyZuYnNwOyBfX2Noa19mYWlsKCk7PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIi Pis8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyZuYnNwOyZuYnNwOyZuYnNwOyAodm9pZCltZW1j cHkoYnVmLCBhYnVmLCBsZW4pOzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rPGJyPjwvZGl2Pjxk aXYgZGlyPSJsdHIiPismbmJzcDsmbmJzcDsmbmJzcDsgYnVmW2xlbl0gPSAnXDAnOzxicj48L2Rp dj48ZGl2IGRpcj0ibHRyIj4rJm5ic3A7Jm5ic3A7Jm5ic3A7IGZyZWUoYWJ1Zik7PGJyPjwvZGl2 PjxkaXYgZGlyPSJsdHIiPismbmJzcDsmbmJzcDsmbmJzcDsgcmV0dXJuIChidWYpOzxicj48L2Rp dj48ZGl2IGRpcj0ibHRyIj4rfTxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj5kaWZmIC0tZ2l0IGEv bGliL2xpYmMvc2VjdXJlL21lbWNweV9jaGsuYyBiL2xpYi9saWJjL3NlY3VyZS9tZW1jcHlfY2hr LmM8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+bmV3IGZpbGUgbW9kZSAxMDA2NDQ8YnI+PC9kaXY+ PGRpdiBkaXI9Imx0ciI+aW5kZXggMDAwMDAwMDAwMDAwLi45OWNmMmQ1ZjEzZmY8YnI+PC9kaXY+ PGRpdiBkaXI9Imx0ciI+LS0tIC9kZXYvbnVsbDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rKysg Yi9saWIvbGliYy9zZWN1cmUvbWVtY3B5X2Noay5jPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPkBA IC0wLDAgKzEsNTMgQEA8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+Ky8qLTxicj48L2Rpdj48ZGl2 IGRpcj0ibHRyIj4rICo8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIFNQRFgtTGljZW5zZS1J ZGVudGlmaWVyOiBCU0QtMi1DbGF1c2U8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqPGJyPjwv ZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBDb3B5cmlnaHQgKGMpIDIwMDYgVGhlIE5ldEJTRCBGb3Vu ZGF0aW9uLCBJbmMuPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBBbGwgcmlnaHRzIHJlc2Vy dmVkLjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICo8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+ KyAqIFRoaXMgY29kZSBpcyBkZXJpdmVkIGZyb20gc29mdHdhcmUgY29udHJpYnV0ZWQgdG8gVGhl IE5ldEJTRCBGb3VuZGF0aW9uPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBieSBDaHJpc3Rv cyBab3VsYXMuPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKjxicj48L2Rpdj48ZGl2IGRpcj0i bHRyIj4rICogUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jt cywgd2l0aCBvciB3aXRob3V0PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBtb2RpZmljYXRp b24sIGFyZSBwZXJtaXR0ZWQgcHJvdmlkZWQgdGhhdCB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbnM8 YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIGFyZSBtZXQ6PGJyPjwvZGl2PjxkaXYgZGlyPSJs dHIiPisgKiAxLiBSZWRpc3RyaWJ1dGlvbnMgb2Ygc291cmNlIGNvZGUgbXVzdCByZXRhaW4gdGhl IGFib3ZlIGNvcHlyaWdodDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICombmJzcDsgJm5ic3A7 IG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xh aW1lci48YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIDIuIFJlZGlzdHJpYnV0aW9ucyBpbiBi aW5hcnkgZm9ybSBtdXN0IHJlcHJvZHVjZSB0aGUgYWJvdmUgY29weXJpZ2h0PGJyPjwvZGl2Pjxk aXYgZGlyPSJsdHIiPisgKiZuYnNwOyAmbmJzcDsgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0 aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyIGluIHRoZTxicj48L2Rpdj48ZGl2IGRp cj0ibHRyIj4rICombmJzcDsgJm5ic3A7IGRvY3VtZW50YXRpb24gYW5kL29yIG90aGVyIG1hdGVy aWFscyBwcm92aWRlZCB3aXRoIHRoZSBkaXN0cmlidXRpb24uPGJyPjwvZGl2PjxkaXYgZGlyPSJs dHIiPisgKjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogVEhJUyBTT0ZUV0FSRSBJUyBQUk9W SURFRCBCWSBUSEUgTkVUQlNEIEZPVU5EQVRJT04sIElOQy4gQU5EIENPTlRSSUJVVE9SUzxicj48 L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogYGBBUyBJUycnIEFORCBBTlkgRVhQUkVTUyBPUiBJTVBM SUVEIFdBUlJBTlRJRVMsIElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEPGJyPjwvZGl2PjxkaXYg ZGlyPSJsdHIiPisgKiBUTywgVEhFIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJ VFkgQU5EIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4r ICogUFVSUE9TRSBBUkUgRElTQ0xBSU1FRC4mbmJzcDsgSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEZP VU5EQVRJT04gT1IgQ09OVFJJQlVUT1JTPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBCRSBM SUFCTEUgRk9SIEFOWSBESVJFQ1QsIElORElSRUNULCBJTkNJREVOVEFMLCBTUEVDSUFMLCBFWEVN UExBUlksIE9SPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBDT05TRVFVRU5USUFMIERBTUFH RVMgKElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBQUk9DVVJFTUVOVCBPRjxicj48L2Rp dj48ZGl2IGRpcj0ibHRyIj4rICogU1VCU1RJVFVURSBHT09EUyBPUiBTRVJWSUNFUzsgTE9TUyBP RiBVU0UsIERBVEEsIE9SIFBST0ZJVFM7IE9SIEJVU0lORVNTPGJyPjwvZGl2PjxkaXYgZGlyPSJs dHIiPisgKiBJTlRFUlJVUFRJT04pIEhPV0VWRVIgQ0FVU0VEIEFORCBPTiBBTlkgVEhFT1JZIE9G IExJQUJJTElUWSwgV0hFVEhFUiBJTjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogQ09OVFJB Q1QsIFNUUklDVCBMSUFCSUxJVFksIE9SIFRPUlQgKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9U SEVSV0lTRSk8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIEFSSVNJTkcgSU4gQU5ZIFdBWSBP VVQgT0YgVEhFIFVTRSBPRiBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFPGJy PjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBQT1NTSUJJTElUWSBPRiBTVUNIIERBTUFHRS48YnI+ PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqLzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rI2luY2x1 ZGUgJmx0O3N5cy9jZGVmcy5oJmd0Ozxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rX19SQ1NJRCgi JE5ldEJTRDogbWVtY3B5X2Noay5jLHYgMS43IDIwMTUvMDUvMTMgMTk6NTc6MTYgam9lcmcgRXhw ICQiKTs8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+Kzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4r I2luY2x1ZGUgJmx0O3N0cmluZy5oJmd0Ozxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rPGJyPjwv ZGl2PjxkaXYgZGlyPSJsdHIiPisjaW5jbHVkZSAmbHQ7c3NwL3N0cmluZy5oJmd0Ozxicj48L2Rp dj48ZGl2IGRpcj0ibHRyIj4rI3VuZGVmIG1lbWNweTxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4r PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisjaW5jbHVkZSAic3NwX2ludGVybmFsLmgiPGJyPjwv ZGl2PjxkaXYgZGlyPSJsdHIiPis8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+K3ZvaWQgKjxicj48 L2Rpdj48ZGl2IGRpcj0ibHRyIj4rX19tZW1jcHlfY2hrKHZvaWQgKiBfX3Jlc3RyaWN0IGRzdCwg Y29uc3Qgdm9pZCAqIF9fcmVzdHJpY3Qgc3JjLCBzaXplX3QgbGVuLDxicj48L2Rpdj48ZGl2IGRp cj0ibHRyIj4rJm5ic3A7ICZuYnNwOyBzaXplX3Qgc2xlbik8YnI+PC9kaXY+PGRpdiBkaXI9Imx0 ciI+K3s8IS0tIC0tPjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rJm5ic3A7Jm5ic3A7Jm5ic3A7 IGlmIChsZW4gJmd0OyBzbGVuKTxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rJm5ic3A7Jm5ic3A7 Jm5ic3A7ICZuYnNwOyZuYnNwOyZuYnNwOyBfX2Noa19mYWlsKCk7PGJyPjwvZGl2PjxkaXYgZGly PSJsdHIiPis8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyZuYnNwOyZuYnNwOyZuYnNwOyBpZiAo X19zc3Bfb3ZlcmxhcCgoY29uc3QgY2hhciAqKXNyYywgKGNvbnN0IGNoYXIgKilkc3QsIGxlbikp PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPismbmJzcDsmbmJzcDsmbmJzcDsgJm5ic3A7Jm5ic3A7 Jm5ic3A7IF9fY2hrX2ZhaWwoKTs8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+Kzxicj48L2Rpdj48 ZGl2IGRpcj0ibHRyIj4rJm5ic3A7Jm5ic3A7Jm5ic3A7IHJldHVybiAobWVtY3B5KGRzdCwgc3Jj LCBsZW4pKTs8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+K308YnI+PC9kaXY+PGRpdiBkaXI9Imx0 ciI+ZGlmZiAtLWdpdCBhL2xpYi9saWJjL3NlY3VyZS9tZW1tb3ZlX2Noay5jIGIvbGliL2xpYmMv c2VjdXJlL21lbW1vdmVfY2hrLmM8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+bmV3IGZpbGUgbW9k ZSAxMDA2NDQ8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+aW5kZXggMDAwMDAwMDAwMDAwLi4wN2Y5 NjVkNjA4ZmM8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+LS0tIC9kZXYvbnVsbDxicj48L2Rpdj48 ZGl2IGRpcj0ibHRyIj4rKysgYi9saWIvbGliYy9zZWN1cmUvbWVtbW92ZV9jaGsuYzxicj48L2Rp dj48ZGl2IGRpcj0ibHRyIj5AQCAtMCwwICsxLDQ3IEBAPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIi PisvKi08YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIi PisgKiBTUERYLUxpY2Vuc2UtSWRlbnRpZmllcjogQlNELTItQ2xhdXNlPGJyPjwvZGl2PjxkaXYg ZGlyPSJsdHIiPisgKjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogQ29weXJpZ2h0IChjKSAy MDA2IFRoZSBOZXRCU0QgRm91bmRhdGlvbiwgSW5jLjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4r ICogQWxsIHJpZ2h0cyByZXNlcnZlZC48YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqPGJyPjwv ZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBUaGlzIGNvZGUgaXMgZGVyaXZlZCBmcm9tIHNvZnR3YXJl IGNvbnRyaWJ1dGVkIHRvIFRoZSBOZXRCU0QgRm91bmRhdGlvbjxicj48L2Rpdj48ZGl2IGRpcj0i bHRyIj4rICogYnkgQ2hyaXN0b3MgWm91bGFzLjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICo8 YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291 cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dDxicj48L2Rpdj48ZGl2IGRpcj0i bHRyIj4rICogbW9kaWZpY2F0aW9uLCBhcmUgcGVybWl0dGVkIHByb3ZpZGVkIHRoYXQgdGhlIGZv bGxvd2luZyBjb25kaXRpb25zPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBhcmUgbWV0Ojxi cj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogMS4gUmVkaXN0cmlidXRpb25zIG9mIHNvdXJjZSBj b2RlIG11c3QgcmV0YWluIHRoZSBhYm92ZSBjb3B5cmlnaHQ8YnI+PC9kaXY+PGRpdiBkaXI9Imx0 ciI+KyAqJm5ic3A7ICZuYnNwOyBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0 aGUgZm9sbG93aW5nIGRpc2NsYWltZXIuPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiAyLiBS ZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVzdCByZXByb2R1Y2UgdGhlIGFib3ZlIGNv cHlyaWdodDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICombmJzcDsgJm5ic3A7IG5vdGljZSwg dGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lciBpbiB0 aGU8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqJm5ic3A7ICZuYnNwOyBkb2N1bWVudGF0aW9u IGFuZC9vciBvdGhlciBtYXRlcmlhbHMgcHJvdmlkZWQgd2l0aCB0aGUgZGlzdHJpYnV0aW9uLjxi cj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICo8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIFRI SVMgU09GVFdBUkUgSVMgUFJPVklERUQgQlkgVEhFIE5FVEJTRCBGT1VOREFUSU9OLCBJTkMuIEFO RCBDT05UUklCVVRPUlM8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIGBgQVMgSVMnJyBBTkQg QU5ZIEVYUFJFU1MgT1IgSU1QTElFRCBXQVJSQU5USUVTLCBJTkNMVURJTkcsIEJVVCBOT1QgTElN SVRFRDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogVE8sIFRIRSBJTVBMSUVEIFdBUlJBTlRJ RVMgT0YgTUVSQ0hBTlRBQklMSVRZIEFORCBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVI8YnI+PC9k aXY+PGRpdiBkaXI9Imx0ciI+KyAqIFBVUlBPU0UgQVJFIERJU0NMQUlNRUQuJm5ic3A7IElOIE5P IEVWRU5UIFNIQUxMIFRIRSBGT1VOREFUSU9OIE9SIENPTlRSSUJVVE9SUzxicj48L2Rpdj48ZGl2 IGRpcj0ibHRyIj4rICogQkUgTElBQkxFIEZPUiBBTlkgRElSRUNULCBJTkRJUkVDVCwgSU5DSURF TlRBTCwgU1BFQ0lBTCwgRVhFTVBMQVJZLCBPUjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICog Q09OU0VRVUVOVElBTCBEQU1BR0VTIChJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgUFJP Q1VSRU1FTlQgT0Y8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIFNVQlNUSVRVVEUgR09PRFMg T1IgU0VSVklDRVM7IExPU1MgT0YgVVNFLCBEQVRBLCBPUiBQUk9GSVRTOyBPUiBCVVNJTkVTUzxi cj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogSU5URVJSVVBUSU9OKSBIT1dFVkVSIENBVVNFRCBB TkQgT04gQU5ZIFRIRU9SWSBPRiBMSUFCSUxJVFksIFdIRVRIRVIgSU48YnI+PC9kaXY+PGRpdiBk aXI9Imx0ciI+KyAqIENPTlRSQUNULCBTVFJJQ1QgTElBQklMSVRZLCBPUiBUT1JUIChJTkNMVURJ TkcgTkVHTElHRU5DRSBPUiBPVEhFUldJU0UpPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBB UklTSU5HIElOIEFOWSBXQVkgT1VUIE9GIFRIRSBVU0UgT0YgVEhJUyBTT0ZUV0FSRSwgRVZFTiBJ RiBBRFZJU0VEIE9GIFRIRTxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogUE9TU0lCSUxJVFkg T0YgU1VDSCBEQU1BR0UuPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKi88YnI+PC9kaXY+PGRp diBkaXI9Imx0ciI+KyNpbmNsdWRlICZsdDtzeXMvY2RlZnMuaCZndDs8YnI+PC9kaXY+PGRpdiBk aXI9Imx0ciI+K19fUkNTSUQoIiROZXRCU0Q6IG1lbW1vdmVfY2hrLmMsdiAxLjYgMjAyMC8wOS8w NSAxMzozNzo1OSBtcmcgRXhwICQiKTs8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+Kzxicj48L2Rp dj48ZGl2IGRpcj0ibHRyIj4rI2luY2x1ZGUgJmx0O3N0cmluZy5oJmd0Ozxicj48L2Rpdj48ZGl2 IGRpcj0ibHRyIj4rPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisjaW5jbHVkZSAmbHQ7c3NwL3N0 cmluZy5oJmd0Ozxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rI3VuZGVmIG1lbW1vdmU8YnI+PC9k aXY+PGRpdiBkaXI9Imx0ciI+Kzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rdm9pZCAqPGJyPjwv ZGl2PjxkaXYgZGlyPSJsdHIiPitfX21lbW1vdmVfY2hrKHZvaWQgKmRzdCwgY29uc3Qgdm9pZCAq c3JjLCBzaXplX3QgbGVuLDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rJm5ic3A7ICZuYnNwOyBz aXplX3Qgc2xlbik8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+K3s8IS0tIC0tPjxicj48L2Rpdj48 ZGl2IGRpcj0ibHRyIj4rJm5ic3A7Jm5ic3A7Jm5ic3A7IGlmIChsZW4gJmd0OyBzbGVuKTxicj48 L2Rpdj48ZGl2IGRpcj0ibHRyIj4rJm5ic3A7Jm5ic3A7Jm5ic3A7ICZuYnNwOyZuYnNwOyZuYnNw OyBfX2Noa19mYWlsKCk7PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPismbmJzcDsmbmJzcDsmbmJz cDsgcmV0dXJuIChtZW1tb3ZlKGRzdCwgc3JjLCBsZW4pKTs8YnI+PC9kaXY+PGRpdiBkaXI9Imx0 ciI+K308YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+ZGlmZiAtLWdpdCBhL2xpYi9saWJjL3NlY3Vy ZS9tZW1zZXRfY2hrLmMgYi9saWIvbGliYy9zZWN1cmUvbWVtc2V0X2Noay5jPGJyPjwvZGl2Pjxk aXYgZGlyPSJsdHIiPm5ldyBmaWxlIG1vZGUgMTAwNjQ0PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIi PmluZGV4IDAwMDAwMDAwMDAwMC4uZjMzN2JlOThiNDZkPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIi Pi0tLSAvZGV2L251bGw8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KysrIGIvbGliL2xpYmMvc2Vj dXJlL21lbXNldF9jaGsuYzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj5AQCAtMCwwICsxLDQ2IEBA PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisvKi08YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAq PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBTUERYLUxpY2Vuc2UtSWRlbnRpZmllcjogQlNE LTItQ2xhdXNlPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKjxicj48L2Rpdj48ZGl2IGRpcj0i bHRyIj4rICogQ29weXJpZ2h0IChjKSAyMDA2IFRoZSBOZXRCU0QgRm91bmRhdGlvbiwgSW5jLjxi cj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogQWxsIHJpZ2h0cyByZXNlcnZlZC48YnI+PC9kaXY+ PGRpdiBkaXI9Imx0ciI+KyAqPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBUaGlzIGNvZGUg aXMgZGVyaXZlZCBmcm9tIHNvZnR3YXJlIGNvbnRyaWJ1dGVkIHRvIFRoZSBOZXRCU0QgRm91bmRh dGlvbjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogYnkgQ2hyaXN0b3MgWm91bGFzLjxicj48 L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICo8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIFJlZGlz dHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0 aG91dDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogbW9kaWZpY2F0aW9uLCBhcmUgcGVybWl0 dGVkIHByb3ZpZGVkIHRoYXQgdGhlIGZvbGxvd2luZyBjb25kaXRpb25zPGJyPjwvZGl2PjxkaXYg ZGlyPSJsdHIiPisgKiBhcmUgbWV0Ojxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogMS4gUmVk aXN0cmlidXRpb25zIG9mIHNvdXJjZSBjb2RlIG11c3QgcmV0YWluIHRoZSBhYm92ZSBjb3B5cmln aHQ8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqJm5ic3A7ICZuYnNwOyBub3RpY2UsIHRoaXMg bGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIuPGJyPjwvZGl2 PjxkaXYgZGlyPSJsdHIiPisgKiAyLiBSZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVz dCByZXByb2R1Y2UgdGhlIGFib3ZlIGNvcHlyaWdodDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4r ICombmJzcDsgJm5ic3A7IG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBm b2xsb3dpbmcgZGlzY2xhaW1lciBpbiB0aGU8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqJm5i c3A7ICZuYnNwOyBkb2N1bWVudGF0aW9uIGFuZC9vciBvdGhlciBtYXRlcmlhbHMgcHJvdmlkZWQg d2l0aCB0aGUgZGlzdHJpYnV0aW9uLjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICo8YnI+PC9k aXY+PGRpdiBkaXI9Imx0ciI+KyAqIFRISVMgU09GVFdBUkUgSVMgUFJPVklERUQgQlkgVEhFIE5F VEJTRCBGT1VOREFUSU9OLCBJTkMuIEFORCBDT05UUklCVVRPUlM8YnI+PC9kaXY+PGRpdiBkaXI9 Imx0ciI+KyAqIGBgQVMgSVMnJyBBTkQgQU5ZIEVYUFJFU1MgT1IgSU1QTElFRCBXQVJSQU5USUVT LCBJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRDxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICog VE8sIFRIRSBJTVBMSUVEIFdBUlJBTlRJRVMgT0YgTUVSQ0hBTlRBQklMSVRZIEFORCBGSVRORVNT IEZPUiBBIFBBUlRJQ1VMQVI8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIFBVUlBPU0UgQVJF IERJU0NMQUlNRUQuJm5ic3A7IElOIE5PIEVWRU5UIFNIQUxMIFRIRSBGT1VOREFUSU9OIE9SIENP TlRSSUJVVE9SUzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogQkUgTElBQkxFIEZPUiBBTlkg RElSRUNULCBJTkRJUkVDVCwgSU5DSURFTlRBTCwgU1BFQ0lBTCwgRVhFTVBMQVJZLCBPUjxicj48 L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogQ09OU0VRVUVOVElBTCBEQU1BR0VTIChJTkNMVURJTkcs IEJVVCBOT1QgTElNSVRFRCBUTywgUFJPQ1VSRU1FTlQgT0Y8YnI+PC9kaXY+PGRpdiBkaXI9Imx0 ciI+KyAqIFNVQlNUSVRVVEUgR09PRFMgT1IgU0VSVklDRVM7IExPU1MgT0YgVVNFLCBEQVRBLCBP UiBQUk9GSVRTOyBPUiBCVVNJTkVTUzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogSU5URVJS VVBUSU9OKSBIT1dFVkVSIENBVVNFRCBBTkQgT04gQU5ZIFRIRU9SWSBPRiBMSUFCSUxJVFksIFdI RVRIRVIgSU48YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIENPTlRSQUNULCBTVFJJQ1QgTElB QklMSVRZLCBPUiBUT1JUIChJTkNMVURJTkcgTkVHTElHRU5DRSBPUiBPVEhFUldJU0UpPGJyPjwv ZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBBUklTSU5HIElOIEFOWSBXQVkgT1VUIE9GIFRIRSBVU0Ug T0YgVEhJUyBTT0ZUV0FSRSwgRVZFTiBJRiBBRFZJU0VEIE9GIFRIRTxicj48L2Rpdj48ZGl2IGRp cj0ibHRyIj4rICogUE9TU0lCSUxJVFkgT0YgU1VDSCBEQU1BR0UuPGJyPjwvZGl2PjxkaXYgZGly PSJsdHIiPisgKi88YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyNpbmNsdWRlICZsdDtzeXMvY2Rl ZnMuaCZndDs8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+K19fUkNTSUQoIiROZXRCU0Q6IG1lbXNl dF9jaGsuYyx2IDEuNSAyMDE0LzA5LzE3IDAwOjM5OjI4IGpvZXJnIEV4cCAkIik7PGJyPjwvZGl2 PjxkaXYgZGlyPSJsdHIiPis8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyNpbmNsdWRlICZsdDtz dHJpbmcuaCZndDs8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+Kzxicj48L2Rpdj48ZGl2IGRpcj0i bHRyIj4rI2luY2x1ZGUgJmx0O3NzcC9zdHJpbmcuaCZndDs8YnI+PC9kaXY+PGRpdiBkaXI9Imx0 ciI+KyN1bmRlZiBtZW1zZXQ8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+Kzxicj48L2Rpdj48ZGl2 IGRpcj0ibHRyIj4rdm9pZCAqPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPitfX21lbXNldF9jaGso dm9pZCAqIF9fcmVzdHJpY3QgZHN0LCBpbnQgdmFsLCBzaXplX3QgbGVuLCBzaXplX3Qgc2xlbik8 YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+K3s8IS0tIC0tPjxicj48L2Rpdj48ZGl2IGRpcj0ibHRy Ij4rJm5ic3A7Jm5ic3A7Jm5ic3A7IGlmIChsZW4gJmd0OyBzbGVuKTxicj48L2Rpdj48ZGl2IGRp cj0ibHRyIj4rJm5ic3A7Jm5ic3A7Jm5ic3A7ICZuYnNwOyZuYnNwOyZuYnNwOyBfX2Noa19mYWls KCk7PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPismbmJzcDsmbmJzcDsmbmJzcDsgcmV0dXJuICht ZW1zZXQoZHN0LCB2YWwsIGxlbikpOzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rfTxicj48L2Rp dj48ZGl2IGRpcj0ibHRyIj5kaWZmIC0tZ2l0IGEvbGliL2xpYmMvc2VjdXJlL3NucHJpbnRmX2No ay5jIGIvbGliL2xpYmMvc2VjdXJlL3NucHJpbnRmX2Noay5jPGJyPjwvZGl2PjxkaXYgZGlyPSJs dHIiPm5ldyBmaWxlIG1vZGUgMTAwNjQ0PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPmluZGV4IDAw MDAwMDAwMDAwMC4uNTJlZjg3NGVkZTViPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPi0tLSAvZGV2 L251bGw8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KysrIGIvbGliL2xpYmMvc2VjdXJlL3NucHJp bnRmX2Noay5jPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPkBAIC0wLDAgKzEsNTYgQEA8YnI+PC9k aXY+PGRpdiBkaXI9Imx0ciI+Ky8qLTxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICo8YnI+PC9k aXY+PGRpdiBkaXI9Imx0ciI+KyAqIFNQRFgtTGljZW5zZS1JZGVudGlmaWVyOiBCU0QtMi1DbGF1 c2U8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisg KiBDb3B5cmlnaHQgKGMpIDIwMDYgVGhlIE5ldEJTRCBGb3VuZGF0aW9uLCBJbmMuPGJyPjwvZGl2 PjxkaXYgZGlyPSJsdHIiPisgKiBBbGwgcmlnaHRzIHJlc2VydmVkLjxicj48L2Rpdj48ZGl2IGRp cj0ibHRyIj4rICo8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqIFRoaXMgY29kZSBpcyBkZXJp dmVkIGZyb20gc29mdHdhcmUgY29udHJpYnV0ZWQgdG8gVGhlIE5ldEJTRCBGb3VuZGF0aW9uPGJy PjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBieSBDaHJpc3RvcyBab3VsYXMuPGJyPjwvZGl2Pjxk aXYgZGlyPSJsdHIiPisgKjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogUmVkaXN0cmlidXRp b24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0PGJy PjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBtb2RpZmljYXRpb24sIGFyZSBwZXJtaXR0ZWQgcHJv dmlkZWQgdGhhdCB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbnM8YnI+PC9kaXY+PGRpdiBkaXI9Imx0 ciI+KyAqIGFyZSBtZXQ6PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiAxLiBSZWRpc3RyaWJ1 dGlvbnMgb2Ygc291cmNlIGNvZGUgbXVzdCByZXRhaW4gdGhlIGFib3ZlIGNvcHlyaWdodDxicj48 L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICombmJzcDsgJm5ic3A7IG5vdGljZSwgdGhpcyBsaXN0IG9m IGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lci48YnI+PC9kaXY+PGRpdiBk aXI9Imx0ciI+KyAqIDIuIFJlZGlzdHJpYnV0aW9ucyBpbiBiaW5hcnkgZm9ybSBtdXN0IHJlcHJv ZHVjZSB0aGUgYWJvdmUgY29weXJpZ2h0PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiZuYnNw OyAmbmJzcDsgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2lu ZyBkaXNjbGFpbWVyIGluIHRoZTxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICombmJzcDsgJm5i c3A7IGRvY3VtZW50YXRpb24gYW5kL29yIG90aGVyIG1hdGVyaWFscyBwcm92aWRlZCB3aXRoIHRo ZSBkaXN0cmlidXRpb24uPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKjxicj48L2Rpdj48ZGl2 IGRpcj0ibHRyIj4rICogVEhJUyBTT0ZUV0FSRSBJUyBQUk9WSURFRCBCWSBUSEUgTkVUQlNEIEZP VU5EQVRJT04sIElOQy4gQU5EIENPTlRSSUJVVE9SUzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4r ICogYGBBUyBJUycnIEFORCBBTlkgRVhQUkVTUyBPUiBJTVBMSUVEIFdBUlJBTlRJRVMsIElOQ0xV RElORywgQlVUIE5PVCBMSU1JVEVEPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBUTywgVEhF IElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkgQU5EIEZJVE5FU1MgRk9SIEEg UEFSVElDVUxBUjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogUFVSUE9TRSBBUkUgRElTQ0xB SU1FRC4mbmJzcDsgSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEZPVU5EQVRJT04gT1IgQ09OVFJJQlVU T1JTPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBCRSBMSUFCTEUgRk9SIEFOWSBESVJFQ1Qs IElORElSRUNULCBJTkNJREVOVEFMLCBTUEVDSUFMLCBFWEVNUExBUlksIE9SPGJyPjwvZGl2Pjxk aXYgZGlyPSJsdHIiPisgKiBDT05TRVFVRU5USUFMIERBTUFHRVMgKElOQ0xVRElORywgQlVUIE5P VCBMSU1JVEVEIFRPLCBQUk9DVVJFTUVOVCBPRjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICog U1VCU1RJVFVURSBHT09EUyBPUiBTRVJWSUNFUzsgTE9TUyBPRiBVU0UsIERBVEEsIE9SIFBST0ZJ VFM7IE9SIEJVU0lORVNTPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBJTlRFUlJVUFRJT04p IEhPV0VWRVIgQ0FVU0VEIEFORCBPTiBBTlkgVEhFT1JZIE9GIExJQUJJTElUWSwgV0hFVEhFUiBJ Tjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogQ09OVFJBQ1QsIFNUUklDVCBMSUFCSUxJVFks IE9SIFRPUlQgKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9USEVSV0lTRSk8YnI+PC9kaXY+PGRp diBkaXI9Imx0ciI+KyAqIEFSSVNJTkcgSU4gQU5ZIFdBWSBPVVQgT0YgVEhFIFVTRSBPRiBUSElT IFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIi PisgKiBQT1NTSUJJTElUWSBPRiBTVUNIIERBTUFHRS48YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+ KyAqLzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rI2luY2x1ZGUgJmx0O3N5cy9jZGVmcy5oJmd0 Ozxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rX19SQ1NJRCgiJE5ldEJTRDogc25wcmludGZfY2hr LmMsdiAxLjUgMjAwOC8wNC8yOCAyMDoyMzowMCBtYXJ0aW4gRXhwICQiKTs8YnI+PC9kaXY+PGRp diBkaXI9Imx0ciI+Kzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rI2luY2x1ZGUgJmx0O3N0ZGFy Zy5oJmd0Ozxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rI2luY2x1ZGUgJmx0O3N0ZGlvLmgmZ3Q7 PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPis8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyNpbmNs dWRlICZsdDtzc3Avc3RkaW8uaCZndDs8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyN1bmRlZiB2 c25wcmludGY8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+Kzxicj48L2Rpdj48ZGl2IGRpcj0ibHRy Ij4raW50PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPitfX3NucHJpbnRmX2NoayhjaGFyICogX19y ZXN0cmljdCBidWYsIHNpemVfdCBsZW4sIGludCBmbGFncywgc2l6ZV90IHNsZW4sPGJyPjwvZGl2 PjxkaXYgZGlyPSJsdHIiPismbmJzcDsgJm5ic3A7IGNvbnN0IGNoYXIgKiBfX3Jlc3RyaWN0IGZt dCwgLi4uKTxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rezwhLS0gLS0+PGJyPjwvZGl2PjxkaXYg ZGlyPSJsdHIiPismbmJzcDsmbmJzcDsmbmJzcDsgdmFfbGlzdCBhcDs8YnI+PC9kaXY+PGRpdiBk aXI9Imx0ciI+KyZuYnNwOyZuYnNwOyZuYnNwOyBpbnQgcnY7PGJyPjwvZGl2PjxkaXYgZGlyPSJs dHIiPis8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyZuYnNwOyZuYnNwOyZuYnNwOyBpZiAobGVu ICZndDsgc2xlbik8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyZuYnNwOyZuYnNwOyZuYnNwOyAm bmJzcDsmbmJzcDsmbmJzcDsgX19jaGtfZmFpbCgpOzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4r PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPismbmJzcDsmbmJzcDsmbmJzcDsgdmFfc3RhcnQoYXAs IGZtdCk7PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPismbmJzcDsmbmJzcDsmbmJzcDsgcnYgPSB2 c25wcmludGYoYnVmLCBsZW4sIGZtdCwgYXApOzxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rJm5i c3A7Jm5ic3A7Jm5ic3A7IHZhX2VuZChhcCk7PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPis8YnI+ PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyZuYnNwOyZuYnNwOyZuYnNwOyByZXR1cm4gKHJ2KTs8YnI+ PC9kaXY+PGRpdiBkaXI9Imx0ciI+K308YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+ZGlmZiAtLWdp dCBhL2xpYi9saWJjL3NlY3VyZS9zcHJpbnRmX2Noay5jIGIvbGliL2xpYmMvc2VjdXJlL3Nwcmlu dGZfY2hrLmM8YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+bmV3IGZpbGUgbW9kZSAxMDA2NDQ8YnI+ PC9kaXY+PGRpdiBkaXI9Imx0ciI+aW5kZXggMDAwMDAwMDAwMDAwLi5kNGM0MmNjYmEzY2U8YnI+ PC9kaXY+PGRpdiBkaXI9Imx0ciI+LS0tIC9kZXYvbnVsbDxicj48L2Rpdj48ZGl2IGRpcj0ibHRy Ij4rKysgYi9saWIvbGliYy9zZWN1cmUvc3ByaW50Zl9jaGsuYzxicj48L2Rpdj48ZGl2IGRpcj0i bHRyIj5AQCAtMCwwICsxLDYxIEBAPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisvKi08YnI+PC9k aXY+PGRpdiBkaXI9Imx0ciI+KyAqPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisgKiBTUERYLUxp Y2Vuc2UtSWRlbnRpZmllcjogQlNELTItQ2xhdXNlPGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPisg Kjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogQ29weXJpZ2h0IChjKSAyMDA2IFRoZSBOZXRC U0QgRm91bmRhdGlvbiwgSW5jLjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4rICogQWxsIHJpZ2h0 cyByZXNlcnZlZC48YnI+PC9kaXY+PGRpdiBkaXI9Imx0ciI+KyAqPGJyPjwvZGl2PjxkaXYgZGly PSJsdHIiPisgKiBUaGlzIGNvZGUgaXMgZGVyaXZlZCBmcm9tIHNvZnR3YXJlIGNvbnRyaWJ1dGVk IHRvIFRoZSBOZXRCU0QgRm91bmRhdGlvbjxicj48L2Rpdj48ZGl2IGRpcj0ibHRyIj4qKiogMTA2 MyBMSU5FUyBTS0lQUEVEICoqKjxicj48L2Rpdj48L2Rpdj4KICAgICAgICAgICAgPC9kaXY+CiAg ICAgICAgPC9kaXY+PC9kaXY+PC9ibG9ja3F1b3RlPjwvZGl2Pjxicj48L2Rpdj48L2Rpdj48L2Rp dj4= From nobody Sun May 19 00:58:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vhj4K65vbz5KMkx; Sun, 19 May 2024 00:58: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 4Vhj4K5Vtpz49Xk; Sun, 19 May 2024 00:58:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716080305; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TohgD0pIxxTihrb2AUCtCYxGjtIdIWHkLeTOE23Bqvg=; b=G+sVQ9L8gMfXOaBJ3cjAQIh/Y3LPE3v482byGvLxVs/77+Ip1Ve+mWpDjnjkNQT109mV0f D3LnKtfFShaZh2UJbeakUL5qZKFTNk9rjek97p3Fkj22StPXu+Qc+L/jsisNBPFSugWyRO G/nie3uA19AditOMJWZSOj7pc3u+vRNkGzEYXx0cQf9dYZhPPu6D+Z/LX7Yu/Fso6Jo388 wooFJLyZiTAlbersanoxoDouOqkie6XCFIkKveGnB+0OQiex3e//5Lnx+3Nk3J6vUeF8Jz BYv4NHpx7owpVYdgIJMSNh8VcUCLfRZs4GDSoz4mPum1OSUcjAE6omlf0tAcgQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716080305; a=rsa-sha256; cv=none; b=vHaitg2ZC/wF+7MSuF1sUueOgA0NTDDuU0Jp2jMOB0cnJ1Fb84eOAlw7ipKyx7VOa1gWPJ MBHAHHr9eov+kc3n71nrnM+AVN0inzD9yPA+zRlGOsvBVSPtAytAA6IylkywDnAR+xs4Do AmV1qKh7+xyM2Nd7F9VJjxvkhSeLCIl6ex7d2CF7UVhMelVuXF52MdtWxYe1DOv0v7NpGL 9SDzO82jDkQw5eee1duc2VFA8+Iste/kTMGYlStBpqhAw99NN6eVRt46U2skU51eBvh7XR RipeDQLJfWI1BtnHdKv7jpNDcwHJud4pP68qsEAk6/7USndT/e078fqy+KLywA== 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=1716080305; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TohgD0pIxxTihrb2AUCtCYxGjtIdIWHkLeTOE23Bqvg=; b=GObXTBRZo6QB+wsvx3n+dQzj772Ak45ExUVC5axi/oUMTfyGsN2Q5FWtisUSxahJVIo6BN OPrhGO9GLz2viZggm2RRTzLSqzZDhy2+sV1xOkK3SFUfc1EdnzCKn0kjAf12wpSW9XmYwv 3/kfP/yb7/5wRnSUUNjjyFx00MO3/bQO3XWmtnAKcOsik3tpfC53hO0v4Mhjuec6NhvNKo /KamFQevSwjX3FUdl20vLGvUqxI0l+ZDkTyntDt9RzOSt/cDQYsHeS4HxdrOlt00H02ss8 9xaBYEWPw7po8zqoCpTdSzHjxlFX3garWEvgt1RO1aR/+eRJcZb4WSucNP0+LA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vhj4K55hhzpGP; Sun, 19 May 2024 00:58: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 44J0wPZS079728; Sun, 19 May 2024 00:58:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44J0wPb9079725; Sun, 19 May 2024 00:58:25 GMT (envelope-from git) Date: Sun, 19 May 2024 00:58:25 GMT Message-Id: <202405190058.44J0wPb9079725@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: 4018bcdea8e1 - stable/14 - cdev_pager_allocate(): ensure that the cdev_pager_ops ctr is called only once List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4018bcdea8e1934eedba4b800e6feb2099b1091d Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4018bcdea8e1934eedba4b800e6feb2099b1091d commit 4018bcdea8e1934eedba4b800e6feb2099b1091d Author: Konstantin Belousov AuthorDate: 2024-05-07 13:23:28 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-19 00:57:54 +0000 cdev_pager_allocate(): ensure that the cdev_pager_ops ctr is called only once PR: 278826 (cherry picked from commit e93404065177d6c909cd64bf7d74fe0d8df35edf) --- sys/vm/device_pager.c | 70 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 51 insertions(+), 19 deletions(-) diff --git a/sys/vm/device_pager.c b/sys/vm/device_pager.c index 2d8f003c6f92..cb3b0e522d9a 100644 --- a/sys/vm/device_pager.c +++ b/sys/vm/device_pager.c @@ -118,8 +118,15 @@ cdev_pager_lookup(void *handle) { vm_object_t object; +again: mtx_lock(&dev_pager_mtx); object = vm_pager_object_lookup(&dev_pager_object_list, handle); + if (object != NULL && object->un_pager.devp.dev == NULL) { + msleep(&object->un_pager.devp.dev, &dev_pager_mtx, + PVM | PDROP, "cdplkp", 0); + vm_object_deallocate(object); + goto again; + } mtx_unlock(&dev_pager_mtx); return (object); } @@ -129,9 +136,8 @@ cdev_pager_allocate(void *handle, enum obj_type tp, const struct cdev_pager_ops *ops, vm_ooffset_t size, vm_prot_t prot, vm_ooffset_t foff, struct ucred *cred) { - vm_object_t object, object1; + vm_object_t object; vm_pindex_t pindex; - u_short color; if (tp != OBJT_DEVICE && tp != OBJT_MGTDEVICE) return (NULL); @@ -157,16 +163,16 @@ cdev_pager_allocate(void *handle, enum obj_type tp, pindex < OFF_TO_IDX(size)) return (NULL); - if (ops->cdev_pg_ctor(handle, size, prot, foff, cred, &color) != 0) - return (NULL); +again: mtx_lock(&dev_pager_mtx); /* * Look up pager, creating as necessary. */ - object1 = NULL; object = vm_pager_object_lookup(&dev_pager_object_list, handle); if (object == NULL) { + vm_object_t object1; + /* * Allocate object and associate it with the pager. Initialize * the object's pg_color based upon the physical address of the @@ -174,15 +180,19 @@ cdev_pager_allocate(void *handle, enum obj_type tp, */ mtx_unlock(&dev_pager_mtx); object1 = vm_object_allocate(tp, pindex); - object1->flags |= OBJ_COLORED; - object1->pg_color = color; - object1->handle = handle; - object1->un_pager.devp.ops = ops; - object1->un_pager.devp.dev = handle; - TAILQ_INIT(&object1->un_pager.devp.devp_pglist); mtx_lock(&dev_pager_mtx); object = vm_pager_object_lookup(&dev_pager_object_list, handle); if (object != NULL) { + object1->type = OBJT_DEAD; + vm_object_deallocate(object1); + object1 = NULL; + if (object->un_pager.devp.dev == NULL) { + msleep(&object->un_pager.devp.dev, + &dev_pager_mtx, PVM | PDROP, "cdplkp", 0); + vm_object_deallocate(object); + goto again; + } + /* * We raced with other thread while allocating object. */ @@ -194,29 +204,51 @@ cdev_pager_allocate(void *handle, enum obj_type tp, KASSERT(object->un_pager.devp.ops == ops, ("Inconsistent devops %p %p", object, ops)); } else { + u_short color; + object = object1; object1 = NULL; object->handle = handle; + object->un_pager.devp.ops = ops; + TAILQ_INIT(&object->un_pager.devp.devp_pglist); TAILQ_INSERT_TAIL(&dev_pager_object_list, object, pager_object_list); + mtx_unlock(&dev_pager_mtx); if (ops->cdev_pg_populate != NULL) vm_object_set_flag(object, OBJ_POPULATE); + if (ops->cdev_pg_ctor(handle, size, prot, foff, + cred, &color) != 0) { + mtx_lock(&dev_pager_mtx); + TAILQ_REMOVE(&dev_pager_object_list, object, + pager_object_list); + wakeup(&object->un_pager.devp.dev); + mtx_unlock(&dev_pager_mtx); + object->type = OBJT_DEAD; + vm_object_deallocate(object); + object = NULL; + mtx_lock(&dev_pager_mtx); + } else { + mtx_lock(&dev_pager_mtx); + object->flags |= OBJ_COLORED; + object->pg_color = color; + object->un_pager.devp.dev = handle; + wakeup(&object->un_pager.devp.dev); + } } + MPASS(object1 == NULL); } else { + if (object->un_pager.devp.dev == NULL) { + msleep(&object->un_pager.devp.dev, + &dev_pager_mtx, PVM | PDROP, "cdplkp", 0); + vm_object_deallocate(object); + goto again; + } if (pindex > object->size) object->size = pindex; KASSERT(object->type == tp, ("Inconsistent device pager type %p %d", object, tp)); } mtx_unlock(&dev_pager_mtx); - if (object1 != NULL) { - object1->handle = object1; - mtx_lock(&dev_pager_mtx); - TAILQ_INSERT_TAIL(&dev_pager_object_list, object1, - pager_object_list); - mtx_unlock(&dev_pager_mtx); - vm_object_deallocate(object1); - } return (object); } From nobody Sun May 19 00:58:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vhj4M0NYFz5KMky; Sun, 19 May 2024 00:58: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 4Vhj4L6DyZz49mt; Sun, 19 May 2024 00:58:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716080306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kw/1VV3FHUleFj5DgnnWlGQULnTF+TYkVBP2bUYFPHA=; b=KEMV+4HiUZ0M5q/UNNmtn6LLj1vGB8GpFstK7DRudxeuKKNQNHy0X486rk8sauYlCgiAEu AP9wJME/xLxdqeFwyPyYxx/kcqubwSvJnNvUtrumnXetL7EkvgilGgENBDRb6A5xF7b20g 6YOwezo42/+eoaTHS00T2mHAiqmd16rn+F/4xzQE/aAoTQZ79zHeWKWg8wcCZZOTjS8F4S IBmpQhUEOul0vSfNzt7b1ce8UL2VLXUROsFf9zvQgbo9Gc3LsxVI1r4rdMCR6qvmjsyVWe r/BEITpaz8FagV+kP5efAGkK6gPVe+x786324j9aWC5/Qxi4yby1wr/4aOJHyg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716080306; a=rsa-sha256; cv=none; b=Z9n92icfiKtkuE3QOBgGD36Ji+VsPnE9zDgh2u75tirtYWMMVkZcHJhDrmVffq3cS0m+OP X/0F59KVrwQ5kswNXMcxlY8WI3HJ97uMPViWyHns7op+riY74hcMxnKPpz2zYTDo8TJcHF vTDrnCQfHq4G2NbUqsV0gZTew5PR32Ut5RrkQMAHQMVtrmbt0nk73tG6UF84ZpcQwnHRBh YfUlN9Dw3W+OjGpG9Bwx0lLKDbJhFFBFJGo6+1ByaQmZhE4QbSdaUweWgdMnkqx0xqjN3L PSnghEXlEYGaJKTHno0a7hPNlCc8kXrjrmwuO7RJ2IEHJMFA36DuQs6SIfgtgw== 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=1716080306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kw/1VV3FHUleFj5DgnnWlGQULnTF+TYkVBP2bUYFPHA=; b=TSFQ7/DgTzIxaOCZVWOjz1AKk1Cj+/g2K6GotwGtYxT2fUI1ITBuRaRDvm8m8s+0f8fb9I 11L3Ar1fFfXY8GzgvaFb2LXbDncpq8Q7oeIsawkxEUxWEFTm6Ma3FpL2eKW/k9ZPo0jI6w SECdFsnWfYn57IXLUtk9rnB2iMtVxtaVya7uPW5VsjSolGTsG3nzcghhD7ziXevqo3PUUT I5SkN7x3bp2+Eesgo5V4Z3rJjB2ptl9dDyBmxLmjPezrpcd2JaOim5K7AFNLKm1VotShWu PKj7O/5Lk+huhSbGsgJnYrOOUcImy0+HwZs7ao33brCWlFKgJGLesRm06lC4Tw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vhj4L5rJNzpFs; Sun, 19 May 2024 00:58: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 44J0wQXl079783; Sun, 19 May 2024 00:58:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44J0wQ3t079780; Sun, 19 May 2024 00:58:26 GMT (envelope-from git) Date: Sun, 19 May 2024 00:58:26 GMT Message-Id: <202405190058.44J0wQ3t079780@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: 9ccd5394123b - stable/14 - devfs_allocv(): style List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9ccd5394123bf429b09b4404fa6cb8543b617331 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9ccd5394123bf429b09b4404fa6cb8543b617331 commit 9ccd5394123bf429b09b4404fa6cb8543b617331 Author: Konstantin Belousov AuthorDate: 2024-05-07 12:33:01 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-19 00:57:54 +0000 devfs_allocv(): style (cherry picked from commit 6d79564fe341c8dbf09405cae1a0a76460aaf8aa) --- sys/fs/devfs/devfs_vnops.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index cda4afc8c241..9dcf3b235feb 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -557,8 +557,7 @@ loop: if (devfs_allocv_drop_refs(0, dmp, de)) { vput(vp); return (ENOENT); - } - else if (VN_IS_DOOMED(vp)) { + } else if (VN_IS_DOOMED(vp)) { mtx_lock(&devfs_de_interlock); if (de->de_vnode == vp) { de->de_vnode = NULL; From nobody Sun May 19 00:58:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vhj4N0Ygjz5KMx5; Sun, 19 May 2024 00:58: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 4Vhj4M72nbz49l0; Sun, 19 May 2024 00:58:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716080308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vd4pWnEtE+otasuBHg/xwjS31P6ggrxT/01b/BLRLzY=; b=uM6URHqnZTju6GaYlmhZL67QY91UbQchgVHAMkE6d0i5+Cx/M9y0Q8/mfB0hdF6RvLSgll aBVV4p5ByJJaw8Df166qlomWR8bSqADFmT6VEoklNBCAqSQ5HQ9G8DkJ6LfkweG7Y+5S+M ncoqP4ISc866v/pqAp86KfHweqfNQoGV8zNCWMqKhVxSZ3jEQ6H1NfsHP+yEO7mixn85aR pBpyLK6YD/lhdlySd6ZamDvNL2TNLaWWLV+FDRM+1vYgelsysJSIsST5j6AGTNCc7FKu3B p2mPWl3ApRcYCNAiajSxNZRPHi+YZXugdqI3LMJwZQVGcLTc4isXWsNdecQQIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716080308; a=rsa-sha256; cv=none; b=k78296PGyUHbPxUy8IT2mhdnHnDJq+EoCDSUpr7lNSW34Shh/iPkohmKxhTZLB14tnNw2q 0f49zTzOtODWQXRvSwlOQ/57kjSIoh+Gimy9nVRWJncn3ZGH2wbv/eUs2KqWg9DBLjuayh OvxfVY4Z/tonk5b+aJjHGo9j8v68G8DQVS6XobtJZpyRl/1kJsS5F3sJ7G1/YtY/z6YAu3 hCDsocplOQBji/2HOJ+AOSCYjZqDNQKad6VAD/mni7f102JILZZWskL6WJBtfCoK6bV/ES IOMAP7Z0j+IYiixiVGogjb01AgQUrTaGo2anM/72Nr9FVSUgyaft46TT4zjo6g== 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=1716080308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vd4pWnEtE+otasuBHg/xwjS31P6ggrxT/01b/BLRLzY=; b=SSXqekeMozu4CJ2gKcOi8DE7i3ZlackzdM20siiSnBJI9dKdzZ1aSB2WgSup/uOYkESLa6 lYFgntEzV5l3nY0TcU5QlY6hjsy2sdsuTlZmLQSwyMvbumLE3DoLNj3XCgHxabD2/CH6H6 5qlTjAvQ08b8TywZ1zvU3kIKUz3H0wDmzvYVS/jWHqcpkLvzRx0dXuaDk/+zkulPwZRhOc sfarZVtbtJ/A2iMOYTQSi629/1/RJWZgfjfIscbDqv67/AWlnQXyVnwZLDgZuIohB/G7Zv T6qEZxURmNpVKo7b2H7Cy9ogPUzYKiSkL5Vg9muBQ5gCzdNnjyPjS/tfy7K84g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vhj4M6P76zpK3; Sun, 19 May 2024 00:58: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 44J0wRfb079942; Sun, 19 May 2024 00:58:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44J0wRSO079939; Sun, 19 May 2024 00:58:27 GMT (envelope-from git) Date: Sun, 19 May 2024 00:58:27 GMT Message-Id: <202405190058.44J0wRSO079939@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: 936aa8ec7cb5 - stable/14 - vfs_domount_update(): style, use space instead of tab List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 936aa8ec7cb57a32387e1f6e636d055d3397edcf Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=936aa8ec7cb57a32387e1f6e636d055d3397edcf commit 936aa8ec7cb57a32387e1f6e636d055d3397edcf Author: Konstantin Belousov AuthorDate: 2024-05-16 00:59:21 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-19 00:57:54 +0000 vfs_domount_update(): style, use space instead of tab (cherry picked from commit 5a061a38cdfa151315051a1ca1400bb32e39cde2) --- sys/kern/vfs_mount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 49d1d21d2d6d..9289c35e4f86 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -1518,7 +1518,7 @@ vfs_domount_update( MNT_ILOCK(mp); if (error == 0) { - mp->mnt_flag &= ~(MNT_UPDATE | MNT_RELOAD | MNT_FORCE | + mp->mnt_flag &= ~(MNT_UPDATE | MNT_RELOAD | MNT_FORCE | MNT_SNAPSHOT); } else { /* From nobody Sun May 19 00:59:41 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vhj5p0CJHz5KMxj; Sun, 19 May 2024 00:59: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 4Vhj5n6WRZz4Ccg; Sun, 19 May 2024 00:59:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716080381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=azIyx/ndEm9iHtwBQH+IQooeVSFPn9up6VByzyrheLc=; b=nCVxOqIH1eIkBNDbq8dmRRV7QvXkbJ/lnjxz+lhaHvkzulGcrbPhp6D+hHZGH1YN7lyS0d rtXrGj1kr6IFEQ7Zp/B0DMNAyaze5jE/hKLBN+r/kWzD9Zo5vC3Dr+1KrrQx0eYYwIT4I0 C/uCHut0Gx/Pe0+k1M9jfTOjJ5UswLloRtuRwE++2+zD6JZSl1qIVqwFTMjTY/TS9e2X6k MFcwFd0AQ5qamESwCMIuyoRiZh687qpk/mIbi2v2VWYdXN6Mg4VJOqicgAdT36a1ak+8tX +FPueSmKGN7sfimBIW+/aK9Yk9+CCkBnh1uUSl9MF8gBF5KAIWo/tNW2dTdlJQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716080381; a=rsa-sha256; cv=none; b=Ui6ab4+HGmBaF6ZKkp/vhrq17YqrZEXUHbfAgAAHiEwE8Sa5TCKXLkzQGvJGAKqoRkbhPT gfILkWdJJPVfKT9gR8bj2vlftvqHDrWbLAYW+7OZpEWdyMgZcRUeJgcpc4lh96bx1mNaih OQNww8Tf9AIRnBjj5eJn1xuCZmytK3qj+MuQ3p+NRxHLbRZI7oPosRNrvFHSmriaq+Uhps sb+1da7hsOt5Ga4LU/h5qjbxB5QOla9iJKvrhw5jSuSS19NKuOjfeGQ3jrVMRHAGvi/v8c Q/5HU7lV4YM/h+GTvn0pSg+ilYpJmAqjOFpoB6S+1C+9koLIvfQoXgUrUYV2GA== 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=1716080381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=azIyx/ndEm9iHtwBQH+IQooeVSFPn9up6VByzyrheLc=; b=gtLG8PeMsM83K/2RUr/feyy3eVbbcoocoI1diISuxu1tF5GOQtShQlYv18x/GcN7oSL5JJ s2oZoeg4MkKfeZzP+pnBXmr90q/1n5/pLX/EiKRb3mhNzn9mfdT0rFvCNXtlfg7/S3i4dg TSAcmTwHm145H282+5Fl7RvTlQIRvILfBmjNA8Dzha7rvhGET77m5k6nNkUx/V3CMCaSNb TrCEhTfqQ0zeXqvWJ1h8AhZXhrbToznotlNNX1CAZy+HAjCWIknLfi0Kj+JknYuILjATej cdRIzcb4zXlIfnPhUEvWrpRUPNVXpE8BzrdydtBL1pMLjd0mAM5qDu1h5s7qxQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vhj5n66RxzpML; Sun, 19 May 2024 00:59: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 44J0xfFU080305; Sun, 19 May 2024 00:59:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44J0xfx3080301; Sun, 19 May 2024 00:59:41 GMT (envelope-from git) Date: Sun, 19 May 2024 00:59:41 GMT Message-Id: <202405190059.44J0xfx3080301@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: 2eeb0e9fc130 - stable/13 - cdev_pager_allocate(): ensure that the cdev_pager_ops ctr is called only once List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2eeb0e9fc1306f40ec684af1ea56a8871a9a3684 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2eeb0e9fc1306f40ec684af1ea56a8871a9a3684 commit 2eeb0e9fc1306f40ec684af1ea56a8871a9a3684 Author: Konstantin Belousov AuthorDate: 2024-05-07 13:23:28 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-19 00:59:13 +0000 cdev_pager_allocate(): ensure that the cdev_pager_ops ctr is called only once PR: 278826 (cherry picked from commit e93404065177d6c909cd64bf7d74fe0d8df35edf) --- sys/vm/device_pager.c | 70 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 51 insertions(+), 19 deletions(-) diff --git a/sys/vm/device_pager.c b/sys/vm/device_pager.c index 2d8f003c6f92..cb3b0e522d9a 100644 --- a/sys/vm/device_pager.c +++ b/sys/vm/device_pager.c @@ -118,8 +118,15 @@ cdev_pager_lookup(void *handle) { vm_object_t object; +again: mtx_lock(&dev_pager_mtx); object = vm_pager_object_lookup(&dev_pager_object_list, handle); + if (object != NULL && object->un_pager.devp.dev == NULL) { + msleep(&object->un_pager.devp.dev, &dev_pager_mtx, + PVM | PDROP, "cdplkp", 0); + vm_object_deallocate(object); + goto again; + } mtx_unlock(&dev_pager_mtx); return (object); } @@ -129,9 +136,8 @@ cdev_pager_allocate(void *handle, enum obj_type tp, const struct cdev_pager_ops *ops, vm_ooffset_t size, vm_prot_t prot, vm_ooffset_t foff, struct ucred *cred) { - vm_object_t object, object1; + vm_object_t object; vm_pindex_t pindex; - u_short color; if (tp != OBJT_DEVICE && tp != OBJT_MGTDEVICE) return (NULL); @@ -157,16 +163,16 @@ cdev_pager_allocate(void *handle, enum obj_type tp, pindex < OFF_TO_IDX(size)) return (NULL); - if (ops->cdev_pg_ctor(handle, size, prot, foff, cred, &color) != 0) - return (NULL); +again: mtx_lock(&dev_pager_mtx); /* * Look up pager, creating as necessary. */ - object1 = NULL; object = vm_pager_object_lookup(&dev_pager_object_list, handle); if (object == NULL) { + vm_object_t object1; + /* * Allocate object and associate it with the pager. Initialize * the object's pg_color based upon the physical address of the @@ -174,15 +180,19 @@ cdev_pager_allocate(void *handle, enum obj_type tp, */ mtx_unlock(&dev_pager_mtx); object1 = vm_object_allocate(tp, pindex); - object1->flags |= OBJ_COLORED; - object1->pg_color = color; - object1->handle = handle; - object1->un_pager.devp.ops = ops; - object1->un_pager.devp.dev = handle; - TAILQ_INIT(&object1->un_pager.devp.devp_pglist); mtx_lock(&dev_pager_mtx); object = vm_pager_object_lookup(&dev_pager_object_list, handle); if (object != NULL) { + object1->type = OBJT_DEAD; + vm_object_deallocate(object1); + object1 = NULL; + if (object->un_pager.devp.dev == NULL) { + msleep(&object->un_pager.devp.dev, + &dev_pager_mtx, PVM | PDROP, "cdplkp", 0); + vm_object_deallocate(object); + goto again; + } + /* * We raced with other thread while allocating object. */ @@ -194,29 +204,51 @@ cdev_pager_allocate(void *handle, enum obj_type tp, KASSERT(object->un_pager.devp.ops == ops, ("Inconsistent devops %p %p", object, ops)); } else { + u_short color; + object = object1; object1 = NULL; object->handle = handle; + object->un_pager.devp.ops = ops; + TAILQ_INIT(&object->un_pager.devp.devp_pglist); TAILQ_INSERT_TAIL(&dev_pager_object_list, object, pager_object_list); + mtx_unlock(&dev_pager_mtx); if (ops->cdev_pg_populate != NULL) vm_object_set_flag(object, OBJ_POPULATE); + if (ops->cdev_pg_ctor(handle, size, prot, foff, + cred, &color) != 0) { + mtx_lock(&dev_pager_mtx); + TAILQ_REMOVE(&dev_pager_object_list, object, + pager_object_list); + wakeup(&object->un_pager.devp.dev); + mtx_unlock(&dev_pager_mtx); + object->type = OBJT_DEAD; + vm_object_deallocate(object); + object = NULL; + mtx_lock(&dev_pager_mtx); + } else { + mtx_lock(&dev_pager_mtx); + object->flags |= OBJ_COLORED; + object->pg_color = color; + object->un_pager.devp.dev = handle; + wakeup(&object->un_pager.devp.dev); + } } + MPASS(object1 == NULL); } else { + if (object->un_pager.devp.dev == NULL) { + msleep(&object->un_pager.devp.dev, + &dev_pager_mtx, PVM | PDROP, "cdplkp", 0); + vm_object_deallocate(object); + goto again; + } if (pindex > object->size) object->size = pindex; KASSERT(object->type == tp, ("Inconsistent device pager type %p %d", object, tp)); } mtx_unlock(&dev_pager_mtx); - if (object1 != NULL) { - object1->handle = object1; - mtx_lock(&dev_pager_mtx); - TAILQ_INSERT_TAIL(&dev_pager_object_list, object1, - pager_object_list); - mtx_unlock(&dev_pager_mtx); - vm_object_deallocate(object1); - } return (object); } From nobody Sun May 19 00:59:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vhj5q1yPgz5KNFK; Sun, 19 May 2024 00:59: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 4Vhj5q0dK5z4CWs; Sun, 19 May 2024 00:59:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716080383; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IX8rhTCKcTrLAltrvJxjD5dovwVSiVIPiGrU4GkRuEk=; b=NtHMiQhrXIxVihXkxQjMaoER+17ZX+OqmaVNo8wCUl3HGD6XoADrjhuuNV81PO44WUDrHt tgtfNO1ourcZQa5x0XncAgI3cdfVW/FuEKsleXkIuQ/c4z2189pq/5bLnpSPfzBJZQqvXa zt1mNPkNwhEo0ghU7ew1jvokbhka1ANnsbDqCdGETC2wCzQOdeUZ2nJjRvny/wvJHiPM6O nPTZELbHX+0+Pq2W8stqKS2tqJ7UgUr1c7jsmvQ/x8WbbCyUay2ov4CY8mRplKGQmu2/2e HZYmrP2fYzTZhYFQXTeT7mlB3LE7VjxD/x+kEfhv0QyugSvoAt50uIjkDPfboQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716080383; a=rsa-sha256; cv=none; b=Mq9KVgXz08yeEKL3aWEH41/mGjb/lN84zTj7wFKzUig3//IO29TaFhYSpNzzTRA+gGrR1j 8Ce70yirH+qnaxjt7fX8ea4A7q17k94bv6wQXkVx4wmaqxXeEran66ZY9e/QKcDDNeESSP S5+J+pwDi0qfwRDd1T2Cko1mXRQgy9Si8/MEyqjHtUgNg8PjKN6D4bQ7Yn5Xs1cGI33vb9 bY3Qn530gs2Qx8tf8vZKzGSu8o0SioqLzKPxAOC7XogxgG7uWib7EQh2bwXWqWiPqfo7wC UsGknhGeYrFowzR8uQErb5T/cKS9tzdmdqlvpOe/0NPURQCpdCqo2GaWT2HXig== 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=1716080383; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IX8rhTCKcTrLAltrvJxjD5dovwVSiVIPiGrU4GkRuEk=; b=FYoIjrqe9gHnHL4jq6DldUIPpzm6g/j8OszuAgh9vx5bcRh6SpS1eR/LHp15m6Rn7AlD0Z 4bS/9wl9p1d7rpyyT3VmoLTPzAomN8r+0gS+fv3Li4Nu/zNQruAXmFY/306ihENKCBV1wd ibn8s7GWZEPpn66EO6pkknrJuv5ukGfLHbCgfmR2vGMt5//Xbj8PQrWV2QsTwzT7u/sOpf CwjM5//bceVxK9H0mO3yhvaJ3oJ8eOD3Gyq4+JlAosI/l7JPStBW4FliaiTQZ0TyKXaF46 L2NtVpS1XNXHep+ZOUOiI/iR71T79iLjd9pOEH7crbZ8saKEp++Jrbqo1wx6pA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vhj5q0FXdzpZJ; Sun, 19 May 2024 00:59: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 44J0xgdj080345; Sun, 19 May 2024 00:59:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44J0xgVr080342; Sun, 19 May 2024 00:59:42 GMT (envelope-from git) Date: Sun, 19 May 2024 00:59:42 GMT Message-Id: <202405190059.44J0xgVr080342@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: 7c23465541f3 - stable/13 - devfs_allocv(): style List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7c23465541f328acab2192c870be31324ce436d9 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7c23465541f328acab2192c870be31324ce436d9 commit 7c23465541f328acab2192c870be31324ce436d9 Author: Konstantin Belousov AuthorDate: 2024-05-07 12:33:01 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-19 00:59:13 +0000 devfs_allocv(): style (cherry picked from commit 6d79564fe341c8dbf09405cae1a0a76460aaf8aa) --- sys/fs/devfs/devfs_vnops.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index 919ab2ff4381..535b2c198e64 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -574,8 +574,7 @@ loop: if (devfs_allocv_drop_refs(0, dmp, de)) { vput(vp); return (ENOENT); - } - else if (VN_IS_DOOMED(vp)) { + } else if (VN_IS_DOOMED(vp)) { mtx_lock(&devfs_de_interlock); if (de->de_vnode == vp) { de->de_vnode = NULL; From nobody Sun May 19 00:59:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vhj5r2K2Sz5KNL6; Sun, 19 May 2024 00:59:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vhj5r1MKqz4Cw6; Sun, 19 May 2024 00:59:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716080384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sk7RO+aqrfw2jh5GPf0I3Yt5RffoIRspXEi1d4QWO/I=; b=wr2brVXe1YO/bNmxTlCx3adVBXMieuqFklooQY8E+TyW0fSAznR64Gj47D+NEtTbywzP/y FZ3B1IkkW2477N+Br+EzKYZV/iyMyOqkGfC2lxh/Kavt4om+ZKTET2bJ+SO+bkKGoeWckU MtC9/cL8GK3oN7Drwj5jm6VpYf0YJoKYRNjGygn73Y6Uv0QtLO5oK4eFKyQ11ETyaOwPU2 CPckxWBq7g8wrvSAVvCGO3oPyMj9SL5b5pSj8sZFFHC90w0/S8JqA+fEueDjwKP0QpSwJ0 rPt2dUi9l7qc2Qx81z2trGo4K+rx0zsMQ763iZ9InFsrz0EPtCOnCOLk2mvf5w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716080384; a=rsa-sha256; cv=none; b=L0MlgAT5nKLu3oSEKG+4FPMVUm6vmMzZrE53JCYjgV55PIs27+GOWdZ/qwPpoxePYgvL+m 0W3xul8qgr+CbBlVexe+k97u0Q/agzAn0OLqpodlUT9J+tFlGrbcX9pvifvzCqzJ+ZmMtx UcAaJwMZ4XUl/ChUWEjLYa4AB41SqQYK71GNizQDJyoNnfNi3mPGuZo+AtWyNgG8hUc2sY QwQ8DnS0oeDc9Qk3lXadnvxBXV43DdVa7Ic7Xr+QXNYoPxAV5w4LJ8OUdGSOQSPElDzTA7 cTphL5p2ozh4BGc7lEMP0wliLxrb5zuyiyVbLXfPf9JgrXEOVuMK6eHOL2j/4g== 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=1716080384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sk7RO+aqrfw2jh5GPf0I3Yt5RffoIRspXEi1d4QWO/I=; b=am5Zx/vZ5WMs5V893GtwRddz5mJhJx4aQnEAZtreN2JZUqOQFmLSXOJ+fa7LnKbtk35V6V 2dCrgqXHDj5O0RAOTao7Ws0nF3AEiOizu/qNqUjS85+8qx9lDaBx4uPeUNvvXNe26UDkrn MmqcfwVsEDDxdnAeXOMyFDbgFpdo+G5/fT1m9HIqRIKQHTbeHeCCdgpZPaUD6TvjePhm2K RO++t3VOVP8KrjwfV0dA3PVB5B51tOw9S2MmBJou+0F1eAezxGQPKBXHQvrkMWsp1MV2yL nrA49LLyDDrTaUmCcOTWdYbuEE7ncIzJZjAoQS9IPCilHBZVmbkJgiC1HVOKHw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vhj5r0zgjzpZK; Sun, 19 May 2024 00:59: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 44J0xigW080394; Sun, 19 May 2024 00:59:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44J0xiGv080391; Sun, 19 May 2024 00:59:44 GMT (envelope-from git) Date: Sun, 19 May 2024 00:59:44 GMT Message-Id: <202405190059.44J0xiGv080391@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: e4df9d84b19f - stable/13 - vfs_domount_update(): style, use space instead of tab List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e4df9d84b19f2e6d1930abf65ef0679196600114 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e4df9d84b19f2e6d1930abf65ef0679196600114 commit e4df9d84b19f2e6d1930abf65ef0679196600114 Author: Konstantin Belousov AuthorDate: 2024-05-16 00:59:21 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-19 00:59:13 +0000 vfs_domount_update(): style, use space instead of tab (cherry picked from commit 5a061a38cdfa151315051a1ca1400bb32e39cde2) --- sys/kern/vfs_mount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 756ac4789c8c..68b22d1a77a8 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -1359,7 +1359,7 @@ vfs_domount_update( MNT_ILOCK(mp); if (error == 0) { - mp->mnt_flag &= ~(MNT_UPDATE | MNT_RELOAD | MNT_FORCE | + mp->mnt_flag &= ~(MNT_UPDATE | MNT_RELOAD | MNT_FORCE | MNT_SNAPSHOT); } else { /* From nobody Sun May 19 01:09:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VhjJy0NJNz5KNrD for ; Sun, 19 May 2024 01:09:22 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from sonic310-25.consmr.mail.ne1.yahoo.com (sonic310-25.consmr.mail.ne1.yahoo.com [66.163.186.206]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4VhjJx3r6Rz4G0x for ; Sun, 19 May 2024 01:09:21 +0000 (UTC) (envelope-from pfg@freebsd.org) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1716080959; bh=3DZe5c5wF8QflidXyJDTTBxp1tKs8uP5jj3+Wj86MHM=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From:Subject:Reply-To; b=lpjCeQA852XjZ3p63k+n3x+yHhBA72+h3iIfIWAdF17u1xpyc+YVuXkYZHxBh5gn0HBmopaC/dvAI/yZBGZmXgPrXgsKhL7zfr21Hb5pmMzKVCMimpQboQ6BQJm9oH7oqBiAev1eEDSlawZ6CjGgmWAW7lSxbrht5Bk59OdgomaRPvVNzruSz6J1WMmQV+UoCLyZcmY0+Yz4LzIpQB7q42vglm3LiRn3zH7dbfpO1fGdHmyBi8kep+BCf64U6ib575uKSUuBE3IKrTNVi0Br6PRBvvV9UdNVgux5hPobG53Bxa0HbrzGe0tXanopPtYQmbw1wWjSoq34WNasEp20HQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1716080959; bh=f4UOUS0KlS5B1q8JfBELMx3cDwwi52sNBQ4iQe1Bmdt=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=EjcD0n5gE9gS4c9qHZo02IUWwJuFdT8L89JkD0BIb4i1tEIYddO5MJYpQjNFiRpmyUpWu8FRHQVrHca470kE6+CaOzvkmzlITBJ8PRfF96c2BE4aTHZBxo8GC5c4xNEh9jzLsmyFEfLyFSAwwSdXKcVTfE3IZVQGmnCDXaf5ouv0arF55r0DMK9VSnf6lyOSkkwEISVe2orOcN1L6jH9DjVo3Fo5gvVqJuIjul2JdsMLw4ePYqLzAbADIqIHZcIPTjtAudSPCvCJQsdwsxFo8ObVyb6ewxQ+4ovTyw4XKyuvyWP1qtN6y4v/co3V/oEcviHpOncz0EKgyESlNODvKw== X-YMail-OSG: l.NTAQcVM1mkm_NRe1qNRlKDD0BxV0aTUf3Zu3iljhA_vOVp2zEt3wXFlLS2.z4 1rc5MlYVv9S9x6vHTnD9rqDLwaJ44a13vXE8Tj8BbYq.IUQZw_BrVs_3OQXXJE.u9p64r1x71nlK xysXccMxuI_mMzwKsW5MVz1qgo5_HEXCV5SvJ.GQNplI_XByCm3hD.tCUlwLPDBrbQyzeQmfBrfD uwjD7dax2_7x9LDSPKHf1ZHsCw2NAx1.Wt5STI2srKu_t0LFAMMW3VAkDhqXet3yohG8jd8weQEG lc.YZvDCYytrLEdMSZGFyVF.FQj3g_QUaOb0nVOOX0bzBTVqsEvO3lfDp0nHQP_dRwG6GHTvP.Tb TCp6KEDT7M4dqbEGLAIgmwJ5uxIRnK4N.sqoBaBl3Gmj2FYAELN81ZUwgKCefiJzB7Ijs3Vq_KEq xdhYrIa6FyaBE3T5sx3WTfts6fUlaPzrOfBaBfBWw.uU_F_DIl6D8si.xJDDg.EpkCE7RWw_EIMn HxtZAEGg6i1M5yuNoKRFCS_VeGGcbC.gLRWUEH01Nmq7uOANA9U2YgSOhnO.wCCKYsoniFE3ofNF s8PJ.aGMCzRrrQf.lPNgAC.k6Vp2cYL.KYXeeUBTNUznpBVYOpUlq0OFXOpx6b6pxXu33bPae5Pe wl7uFqmGSfzGTCKTFBcKEgv0rJGJbXrkAe0BbSZ1UsGA91EMpouylE5Gybc53VFP8mzt9W6nhGjE MCmw6AumEKRh3lLAUwOp0ekZVQQ2m2QZNI5INrNK5fJ5Ub0TFiA5qJzVTPo9IxmXVnYwG_KnOOYC uYTx6WAcUtkBUrBVu403svuMEoLigRbPnyyPuKQI9o_buR35RnJCDRjpNfW1rrQSBytsMa.6el5P 6skuPg4ZEbxPuOvJ9LO_u2lmKEwW2.AxHst3rLn7aX3FFslgo_mRoHIMiB4IGUN1YTNdIbeBWpMc GgnV3Xf_hp0zZx_Huxc0_acZWMJCzNkqL5rL_MZe.Y9xkDZlqt90FLYWBeveWeb6_zth.JHCJGwH SpGHzjGJmda3BhfKv6C7udjz2tiY.cIXMYVTBjE.QaR4CUimpMTPe9zduFg_BCgdbUbXz3uNMCs0 GXwkCfmafxHepXN_KpB7UmVyR2wftDcLgDiKkNU542EJdlfEXmeRKLojuNf5gLz5wMjiPBJ9TjDF O1C5UHZ.GlEaMO9xw9UkxuT6fBTVShkhpFwFFKEDbHF1rCKDxWtHMZpyeiQ6FrK8lJwZrc4RRsgR ERUDNSMRUZIAIM2RxgJniByJw70FpHlimGhRKmu_U3sWS.AXqlIXTy7sp6P8hV1YCffagS8mTSyo 96ceMxehHJi2mPHL.kKbBp0Z3Ir6AcI.zXLNydNiRhIAGOZp1k_ul8r_Gur0d0XYLCyqKeKziYHN UWRyOIgJYZSjKeMPE564AChtRU3KCwN2vGwkPtCZ2Z_2ppAScg17gtwI6o1fCX.ICJ1_sm44n8It NIRev9LWgdtLX7U7d7oQOJ_i00bsIcJ5rxDTktJYXBOu231btGb2Z03m5EeGAmKJ3crU6Pw_Ea5y NY4tzDpxspB.k5HayD0qt0_goiLwUBdrMG60nAV1lzeXwkWZ7I37XjqXEiS_EKqAz_k8HskJgZNg ZlXq1kp2V6FH6fJrgfPN_sdN2YCDaYBc7Jxb3mUaBL8BURO3aeQ_MjIRmea1O0ZVvKxGkNGn2.Ce BN_7aLh8nv_jIv3f3MO3uzkF4jo2THRU3BhK5MHiQGRc7H2nqB45bq6wq5NcLgJxGgyZ3hPghyED Nf3sWlBcaTc_PNKAhYLTZC7WsbOLFKFNtezY8AWcEOY1l2KKUiuqNikFk_bf6gVmEoDiTNcg7Uw2 6VWveeJSUn_MQL0GZUZpFyyPc_qYVu4VYnpEjxv.xKrlpieaYgEcZAgboBxZGr.4CMEzR__Vh9uN Sj5I6YB_IYB68sEJ2cJUhZ1xisNbDpxl3TrkKLLCwCcDx8shj4cPQWjmcSbt.bfBICf71EVyRr.4 uhiZ2C0dgCbimpBwC_lHSY4cZ5QXghX_zLRAGGZaUdkLu476IFamUiMWysLTnvLHIxHyTc93h.HH MNDk8Kk5y.60bJfKRB_iHLDZWc173u4FF5WebbdJ9EGfKCLFJO6MkOpBteHqYpy6f5PZtnXqSptu zJsWjqv4u4.yomVRngYpK8hVaPoghVdgZ7zMaWCDgWs0- X-Sonic-MF: X-Sonic-ID: 23b927bd-1ef4-4b0b-b1e9-817dc30c0204 Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.ne1.yahoo.com with HTTP; Sun, 19 May 2024 01:09:19 +0000 Date: Sun, 19 May 2024 01:09:17 +0000 (UTC) From: Pedro Giffuni To: Kyle Evans Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Message-ID: <999469960.1638478.1716080957814@mail.yahoo.com> In-Reply-To: <02326b5e-a1fe-4411-a869-d21f9a76130c@email.android.com> References: <02326b5e-a1fe-4411-a869-d21f9a76130c@email.android.com> Subject: Re: git: be04fec42638 - main - Import _FORTIFY_SOURCE implementation from NetBSD List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1638477_2102893408.1716080957796" X-Mailer: WebService/1.1.22356 YMailNorrin X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36646, ipnet:66.163.184.0/21, country:US] X-Rspamd-Queue-Id: 4VhjJx3r6Rz4G0x ------=_Part_1638477_2102893408.1716080957796 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable (sorry for top posting .. my mailer just sucks)Hi; I used to like the limited static checking FORTIFY_SOURCE provides and when= I ran it over FreeBSD it did find a couple of minor issues. It only works = for GCC though. I guess it doesn't really hurt to have FORTIFY_SOURCE around and NetBSD had= the least intrusive implementation the last time I checked but I would cer= tainly request it should never be activated by default, specially with clan= g. The GCC version has seen more development on glibc but I still think its= a dead end. What I would like to see working on FreeBSD is Safestack as a replacement f= or the stack protector, which we were so very slow to adopt even when it wa= s originally developed in FreeBSD. I think other projects based on FreeBSD = (Chimera and hardenedBSD) have been using it but I don't know the details. This is just all my $0.02 Pedro. On Saturday, May 18, 2024 at 05:54:42 PM GMT-5, Kyle Evans wrote: =20 =20 =20 On May 18, 2024 13:42, Pedro Giffuni wrote: Oh no .. please not... We went into that in a GSoC: https://wiki.freebsd.org/SummerOfCode2015/FreeBSDLibcSecurityExtensions Ultimately it proved to be useless since stack-protector-strong. Respectfully, I disagree with your conclusion here: 1.) _FORTIFY_SOURCE provides more granular detection of overflow; I don't h= ave to overflow all the way into the canary at the end of the frame to be d= etected, so my minor bug now can be caught before something causes the stac= k frame to be rearranged and turn it into a security issue later 2.) __builtin_object_size doesn't work on heap objects, but it actually can= work on subobjects from a heap allocation (e.g., &foo->name), so the cover= age extends beyond the stack into starting to detect other kinds of overflo= w=C2=A0 While the security value over stack-protector-strong may be marginal (I won= 't debate this specifically), the feature still has value in general. Thanks, Kyle Evans The NetBSD code was not well adapted to clang either. Ask me more if you really want to dig into it, but we don't want this. Pedro. On Monday, May 13, 2024 at 12:24:13 AM GMT-5, Kyle Evans wrote: =20 =20 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=3Dbe04fec42638f30f50b5b55fd8e3= 634c0fb89928 commit be04fec42638f30f50b5b55fd8e3634c0fb89928 Author:=C2=A0 =C2=A0 Kyle Evans AuthorDate: 2024-05-13 05:23:49 +0000 Commit:=C2=A0 =C2=A0 Kyle Evans CommitDate: 2024-05-13 05:23:49 +0000 =C2=A0 =C2=A0 Import _FORTIFY_SOURCE implementation from NetBSD =C2=A0 =C2=A0=20 =C2=A0 =C2=A0 This is a mostly-unmodified copy of the various *_chk impleme= ntations =C2=A0 =C2=A0 and headers from NetBSD, without yet modifying system headers= to start =C2=A0 =C2=A0 actually including them.=C2=A0 A future commit will also appl= y the needed =C2=A0 =C2=A0 bits to fix ssp/unistd.h. =C2=A0 =C2=A0=20 =C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 imp, pauamma_gundo.com (both previo= us versions), kib =C2=A0 =C2=A0 Sponsored by:=C2=A0 Stormshield =C2=A0 =C2=A0 Sponsored by:=C2=A0 Klara, Inc. =C2=A0 =C2=A0 Differential Revision:=C2=A0 https://reviews.freebsd.org/D323= 06 --- etc/mtree/BSD.include.dist=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 2 + include/Makefile=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 |=C2=A0 2 +- include/ssp/Makefile=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2= =A0 6 ++ include/ssp/ssp.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 |=C2=A0 91 ++++++++++++++++++++++++++ include/ssp/stdio.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= |=C2=A0 93 ++++++++++++++++++++++++++ include/ssp/string.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | 129= ++++++++++++++++++++++++++++++++++++ include/ssp/strings.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2= =A0 67 +++++++++++++++++++ include/ssp/unistd.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2= =A0 54 +++++++++++++++ lib/libc/secure/Makefile.inc=C2=A0 =C2=A0 =C2=A0 |=C2=A0 11 ++++ lib/libc/secure/Symbol.map=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 18 +++++ lib/libc/secure/fgets_chk.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 54 ++++++++= +++++++ lib/libc/secure/gets_chk.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 74 +++++++++= ++++++++++++ lib/libc/secure/memcpy_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 53 ++++++++++++++= + lib/libc/secure/memmove_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 47 +++++++++++++ lib/libc/secure/memset_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 46 +++++++++++++ lib/libc/secure/snprintf_chk.c=C2=A0 =C2=A0 |=C2=A0 56 ++++++++++++++++ lib/libc/secure/sprintf_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 61 +++++++++++++= ++++ lib/libc/secure/ssp_internal.h=C2=A0 =C2=A0 |=C2=A0 37 +++++++++++ lib/libc/secure/stpcpy_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 55 ++++++++++++++= ++ lib/libc/secure/stpncpy_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 53 +++++++++++++= ++ lib/libc/secure/strcat_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 60 ++++++++++++++= +++ lib/libc/secure/strcpy_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 54 ++++++++++++++= + lib/libc/secure/strncat_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 70 +++++++++++++= +++++++ lib/libc/secure/strncpy_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 53 +++++++++++++= ++ lib/libc/secure/vsnprintf_chk.c=C2=A0 =C2=A0 |=C2=A0 49 ++++++++++++++ lib/libc/secure/vsprintf_chk.c=C2=A0 =C2=A0 |=C2=A0 58 ++++++++++++++++ lib/libssp/Makefile=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= |=C2=A0 20 +++++- lib/libssp/Symbol.map=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2= =A0 12 ++-- lib/libssp/Versions.def=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 5= ++ lib/libssp/__builtin_object_size.3 | 110 +++++++++++++++++++++++++++++++ lib/libssp/fortify_stubs.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 | 131 --------------= ----------------------- lib/libssp/ssp.3=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 | 130 ++++++++++++++++++++++++++++++++++++ 32 files changed, 1621 insertions(+), 140 deletions(-) diff --git a/etc/mtree/BSD.include.dist b/etc/mtree/BSD.include.dist index a6bd5880bf61..f8c83d6dde7a 100644 --- a/etc/mtree/BSD.include.dist +++ b/etc/mtree/BSD.include.dist @@ -372,6 +372,8 @@ =C2=A0 =C2=A0 =C2=A0 =C2=A0 mac_veriexec =C2=A0 =C2=A0 =C2=A0 =C2=A0 .. =C2=A0 =C2=A0 .. +=C2=A0 =C2=A0 ssp +=C2=A0 =C2=A0 .. =C2=A0 =C2=A0 sys =C2=A0 =C2=A0 =C2=A0 =C2=A0 disk =C2=A0 =C2=A0 =C2=A0 =C2=A0 .. diff --git a/include/Makefile b/include/Makefile index 19e6beb95203..32774419f162 100644 --- a/include/Makefile +++ b/include/Makefile @@ -4,7 +4,7 @@ =20 PACKAGE=3Dclibs CLEANFILES=3D osreldate.h version -SUBDIR=3D arpa protocols rpcsvc rpc xlocale +SUBDIR=3D arpa protocols rpcsvc rpc ssp xlocale .if ${MACHINE_CPUARCH} =3D=3D "amd64" SUBDIR+=3D=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 i386 INCLUDE_SUBDIRS+=3D=C2=A0=C2=A0=C2=A0 i386 diff --git a/include/ssp/Makefile b/include/ssp/Makefile new file mode 100644 index 000000000000..dff19f43c920 --- /dev/null +++ b/include/ssp/Makefile @@ -0,0 +1,6 @@ +# $FreeBSD$ + +INCS=3D=C2=A0=C2=A0=C2=A0 ssp.h stdio.h string.h strings.h unistd.h +INCSDIR=3D=C2=A0=C2=A0=C2=A0 ${INCLUDEDIR}/ssp + +.include diff --git a/include/ssp/ssp.h b/include/ssp/ssp.h new file mode 100644 index 000000000000..35a9aeee02df --- /dev/null +++ b/include/ssp/ssp.h @@ -0,0 +1,91 @@ +/*=C2=A0=C2=A0=C2=A0 $NetBSD: ssp.h,v 1.13 2015/09/03 20:43:47 plunky Exp = $=C2=A0=C2=A0=C2=A0 */ + +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006, 2011 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF = THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _SSP_SSP_H_ +#define _SSP_SSP_H_ + +#include + +#if !defined(__cplusplus) +# if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && \ +=C2=A0 =C2=A0 (__OPTIMIZE__ > 0 || defined(__clang__)) +#=C2=A0 if _FORTIFY_SOURCE > 1 +#=C2=A0 define __SSP_FORTIFY_LEVEL 2 +#=C2=A0 else +#=C2=A0 define __SSP_FORTIFY_LEVEL 1 +#=C2=A0 endif +# else +#=C2=A0 define __SSP_FORTIFY_LEVEL 0 +# endif +#else +# define __SSP_FORTIFY_LEVEL 0 +#endif + +#define=C2=A0=C2=A0=C2=A0 __ssp_var(type)=C2=A0=C2=A0=C2=A0 __CONCAT(__ssp= _ ## type, __COUNTER__) + +/* __ssp_real is used by the implementation in libc */ +#if __SSP_FORTIFY_LEVEL =3D=3D 0 +#define __ssp_real_(fun)=C2=A0=C2=A0=C2=A0 fun +#else +#define __ssp_real_(fun)=C2=A0=C2=A0=C2=A0 __ssp_real_ ## fun +#endif +#define __ssp_real(fun)=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __ssp_real_(f= un) + +#define __ssp_inline static __inline __attribute__((__always_inline__)) + +#define __ssp_bos(ptr) __builtin_object_size(ptr, __SSP_FORTIFY_LEVEL > 1) +#define __ssp_bos0(ptr) __builtin_object_size(ptr, 0) + +#define __ssp_check(buf, len, bos) \ +=C2=A0=C2=A0=C2=A0 if (bos(buf) !=3D (size_t)-1 && len > bos(buf)) \ +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail() +#define __ssp_redirect_raw(rtype, fun, symbol, args, call, cond, bos) \ +rtype __ssp_real_(fun) args __RENAME(symbol); \ +__ssp_inline rtype fun args __RENAME(__ssp_protected_ ## fun); \ +__ssp_inline rtype fun args { \ +=C2=A0=C2=A0=C2=A0 if (cond) \ +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __ssp_check(__buf, __len, bos); \ +=C2=A0=C2=A0=C2=A0 return __ssp_real_(fun) call; \ +} + +#define __ssp_redirect(rtype, fun, args, call) \ +=C2=A0 =C2=A0 __ssp_redirect_raw(rtype, fun, fun, args, call, 1, __ssp_bos= ) +#define __ssp_redirect0(rtype, fun, args, call) \ +=C2=A0 =C2=A0 __ssp_redirect_raw(rtype, fun, fun, args, call, 1, __ssp_bos= 0) + +__BEGIN_DECLS +void __stack_chk_fail(void) __dead2; +void __chk_fail(void) __dead2; +__END_DECLS + +#endif /* _SSP_SSP_H_ */ diff --git a/include/ssp/stdio.h b/include/ssp/stdio.h new file mode 100644 index 000000000000..72e3236eac80 --- /dev/null +++ b/include/ssp/stdio.h @@ -0,0 +1,93 @@ +/*=C2=A0=C2=A0=C2=A0 $NetBSD: stdio.h,v 1.5 2011/07/17 20:54:34 joerg Exp = $=C2=A0=C2=A0=C2=A0 */ + +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF = THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _SSP_STDIO_H_ +#define _SSP_STDIO_H_ + +#include + +__BEGIN_DECLS +int __sprintf_chk(char *__restrict, int, size_t, const char *__restrict, .= ..) +=C2=A0 =C2=A0 __printflike(4, 5); +int __vsprintf_chk(char *__restrict, int, size_t, const char *__restrict, +=C2=A0 =C2=A0 __va_list) +=C2=A0 =C2=A0 __printflike(4, 0); +int __snprintf_chk(char *__restrict, size_t, int, size_t, +=C2=A0 =C2=A0 const char *__restrict, ...) +=C2=A0 =C2=A0 __printflike(5, 6); +int __vsnprintf_chk(char *__restrict, size_t, int, size_t, +=C2=A0 =C2=A0 const char *__restrict, __va_list) +=C2=A0 =C2=A0 __printflike(5, 0); +char *__gets_chk(char *, size_t); +char *__fgets_chk(char *, int, size_t, FILE *); +__END_DECLS + +#if __SSP_FORTIFY_LEVEL > 0 + +#define sprintf(str, ...) ({=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 char *_ssp_str =3D (str);=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __builtin___sprintf_chk(_ssp_str, 0, __ssp_bos(_ssp_str),=C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 =C2=A0 =C2=A0 __VA_ARGS__); \ +}) + +#define vsprintf(str, fmt, ap) ({=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 char *_ssp_str =3D (str);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 \ +=C2=A0 =C2=A0 __builtin___vsprintf_chk(_ssp_str, 0, __ssp_bos(_ssp_str), f= mt,=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 =C2=A0 =C2=A0 ap);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +}) + +#define snprintf(str, len, ...) ({=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 char *_ssp_str =3D (str);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 \ +=C2=A0 =C2=A0 __builtin___snprintf_chk(_ssp_str, len, 0, __ssp_bos(_ssp_st= r),=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 =C2=A0 =C2=A0 __VA_ARGS__);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0 \ +}) + +#define vsnprintf(str, len, fmt, ap) ({=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 char *_ssp_str =3D (str);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 \ +=C2=A0 =C2=A0 __builtin___vsnprintf_chk(_ssp_str, len, 0, __ssp_bos(_ssp_s= tr),=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 =C2=A0 =C2=A0 fmt, ap);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 \ +}) + +#define gets(str) ({=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 \ +=C2=A0 char *_ssp_str =3D (str);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __gets_chk(_ssp_str, __ssp_bos(_ssp_str));=C2=A0=C2=A0=C2=A0= \ +}) + +#define fgets(str, len, fp) ({=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 char *_ssp_str =3D (str);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 \ +=C2=A0 =C2=A0 __fgets_chk(_ssp_str, len, __ssp_bos(_ssp_str), fp);=C2=A0= =C2=A0=C2=A0 \ +}) + +#endif /* __SSP_FORTIFY_LEVEL > 0 */ + +#endif /* _SSP_STDIO_H_ */ diff --git a/include/ssp/string.h b/include/ssp/string.h new file mode 100644 index 000000000000..996020fda778 --- /dev/null +++ b/include/ssp/string.h @@ -0,0 +1,129 @@ +/*=C2=A0=C2=A0=C2=A0 $NetBSD: string.h,v 1.14 2020/09/05 13:37:59 mrg Exp = $=C2=A0=C2=A0=C2=A0 */ + +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF = THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _SSP_STRING_H_ +#define _SSP_STRING_H_ + +#include + +__BEGIN_DECLS +void *__memcpy_chk(void *, const void *, size_t, size_t); +void *__memmove_chk(void *, const void *, size_t, size_t); +void *__memset_chk(void *, int, size_t, size_t); +char *__stpcpy_chk(char *, const char *, size_t); +char *__stpncpy_chk(char *, const char *, size_t, size_t); +char *__strcat_chk(char *, const char *, size_t); +char *__strcpy_chk(char *, const char *, size_t); +char *__strncat_chk(char *, const char *, size_t, size_t); +char *__strncpy_chk(char *, const char *, size_t, size_t); +__END_DECLS + +#if __SSP_FORTIFY_LEVEL > 0 + +#define __ssp_bos_check3_typed_var(fun, dsttype, dsrvar, dst, srctype, src= var, \ +=C2=A0 =C2=A0 src, lenvar, len) ({=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 srctype srcvar =3D (src);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 dsttype dstvar =3D (dst);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 size_t lenvar =3D (len);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 ((__ssp_bos0(dstvar) !=3D (size_t)-1) ?=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __builtin___ ## fun ## _chk(dstvar, srcvar, lenvar,=C2=A0=C2= =A0=C2=A0 \ +=C2=A0 =C2=A0 =C2=A0 =C2=A0 __ssp_bos0(dstvar)) :=C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __ ## fun ## _ichk(dstvar, srcvar, lenvar));=C2=A0=C2=A0=C2= =A0 \ +}) + +#define __ssp_bos_check3_typed(fun, dsttype, dst, srctype, src, len)=C2=A0= =C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __ssp_bos_check3_typed_var(fun, dsttype, __ssp_var(dstv), ds= t,=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 =C2=A0 =C2=A0 srctype, __ssp_var(srcv), src, __ssp_var(lenv)= , len) + +#define __ssp_bos_check3(fun, dst, src, len)=C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0 \ +=C2=A0 =C2=A0 __ssp_bos_check3_typed_var(fun, void *, __ssp_var(dstv), dst= ,=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 =C2=A0 =C2=A0 const void *, __ssp_var(srcv), src, __ssp_var(= lenv), len) + +#define __ssp_bos_check2_var(fun, dstvar, dst, srcvar, src) ({=C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 const void *srcvar =3D (src);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 void *dstvar =3D (dst);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 ((__ssp_bos0(dstvar) !=3D (size_t)-1) ?=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __builtin___ ## fun ## _chk(dstvar, srcvar,=C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 =C2=A0 =C2=A0 __ssp_bos0(dstvar)) :=C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __ ## fun ## _ichk(dstvar, srcvar));=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 \ +}) + +#define __ssp_bos_check2(fun, dst, src)=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __ssp_bos_check2_var(fun, __ssp_var(dstv), dst, __ssp_var(sr= cv), src) + +#define __ssp_bos_icheck3_restrict(fun, type1, type2) \ +static __inline type1 __ ## fun ## _ichk(type1 __restrict, type2 __restric= t, size_t); \ +static __inline __attribute__((__always_inline__)) type1 \ +__ ## fun ## _ichk(type1 __restrict dst, type2 __restrict src, size_t len)= { \ +=C2=A0=C2=A0=C2=A0 return __builtin___ ## fun ## _chk(dst, src, len, __ssp= _bos0(dst)); \ +} + +#define __ssp_bos_icheck3(fun, type1, type2) \ +static __inline type1 __ ## fun ## _ichk(type1, type2, size_t); \ +static __inline __attribute__((__always_inline__)) type1 \ +__ ## fun ## _ichk(type1 dst, type2 src, size_t len) { \ +=C2=A0=C2=A0=C2=A0 return __builtin___ ## fun ## _chk(dst, src, len, __ssp= _bos0(dst)); \ +} + +#define __ssp_bos_icheck2_restrict(fun, type1, type2) \ +static __inline type1 __ ## fun ## _ichk(type1, type2); \ +static __inline __attribute__((__always_inline__)) type1 \ +__ ## fun ## _ichk(type1 __restrict dst, type2 __restrict src) { \ +=C2=A0=C2=A0=C2=A0 return __builtin___ ## fun ## _chk(dst, src, __ssp_bos0= (dst)); \ +} + +__BEGIN_DECLS +__ssp_bos_icheck3_restrict(memcpy, void *, const void *) +__ssp_bos_icheck3(memmove, void *, const void *) +__ssp_bos_icheck3(memset, void *, int) +__ssp_bos_icheck2_restrict(stpcpy, char *, const char *) +__ssp_bos_icheck3_restrict(stpncpy, char *, const char *) +__ssp_bos_icheck2_restrict(strcpy, char *, const char *) +__ssp_bos_icheck2_restrict(strcat, char *, const char *) +__ssp_bos_icheck3_restrict(strncpy, char *, const char *) +__ssp_bos_icheck3_restrict(strncat, char *, const char *) +__END_DECLS + +#define memcpy(dst, src, len) __ssp_bos_check3(memcpy, dst, src, len) +#define memmove(dst, src, len) __ssp_bos_check3(memmove, dst, src, len) +#define memset(dst, val, len) \ +=C2=A0 =C2=A0 __ssp_bos_check3_typed(memset, void *, dst, int, val, len) +#define stpcpy(dst, src) __ssp_bos_check2(stpcpy, dst, src) +#define stpncpy(dst, src, len) __ssp_bos_check3(stpncpy, dst, src, len) +#define strcpy(dst, src) __ssp_bos_check2(strcpy, dst, src) +#define strcat(dst, src) __ssp_bos_check2(strcat, dst, src) +#define strncpy(dst, src, len) __ssp_bos_check3(strncpy, dst, src, len) +#define strncat(dst, src, len) __ssp_bos_check3(strncat, dst, src, len) + +#endif /* __SSP_FORTIFY_LEVEL > 0 */ +#endif /* _SSP_STRING_H_ */ diff --git a/include/ssp/strings.h b/include/ssp/strings.h new file mode 100644 index 000000000000..06c9c7cc0a09 --- /dev/null +++ b/include/ssp/strings.h @@ -0,0 +1,67 @@ +/*=C2=A0=C2=A0=C2=A0 $NetBSD: strings.h,v 1.3 2008/04/28 20:22:54 martin E= xp $=C2=A0=C2=A0=C2=A0 */ + +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2007 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF = THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _SSP_STRINGS_H_ +#define _SSP_STRINGS_H_ + +#include +#include + +#if __SSP_FORTIFY_LEVEL > 0 + +#define _ssp_bcopy(srcvar, src, dstvar, dst, lenvar,=C2=A0 len) ({=C2=A0= =C2=A0=C2=A0 \ +=C2=A0 =C2=A0 const void *srcvar =3D (src);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 void *dstvar =3D (dst);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 size_t lenvar =3D (len);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 ((__ssp_bos0(dstvar) !=3D (size_t)-1) ?=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __builtin___memmove_chk(dstvar, srcvar, lenvar,=C2=A0=C2=A0= =C2=A0 \ +=C2=A0 =C2=A0 =C2=A0 =C2=A0 __ssp_bos0(dstvar)) :=C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __memmove_ichk(dstvar, srcvar, lenvar));=C2=A0=C2=A0=C2=A0 \ +}) + +#define=C2=A0=C2=A0=C2=A0 bcopy(src, dst, len)=C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 _ssp_bcopy(__ssp_var(srcv), src, __ssp_var(dstv), dst, __ssp= _var(lenv), len) + +#define _ssp_bzero(dstvar, dst, lenvar, len) ({=C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 \ +=C2=A0 =C2=A0 void *dstvar =3D (dst);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 size_t lenvar =3D (len);=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 ((__ssp_bos0(dstvar) !=3D (size_t)-1) ?=C2=A0=C2=A0=C2=A0 \ +=C2=A0 =C2=A0 __builtin___memset_chk(dstvar, 0, lenvar,=C2=A0=C2=A0=C2=A0 = \ +=C2=A0 =C2=A0 =C2=A0 =C2=A0 __ssp_bos0(dstvar)) : \ +=C2=A0 =C2=A0 __memset_ichk(dstvar, 0, lenvar));=C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 \ +}) + +#define=C2=A0=C2=A0=C2=A0 bzero(dst, len)=C2=A0=C2=A0=C2=A0 _ssp_bzero(__s= sp_var(dstv), dst, __ssp_var(lenv), len) + +#endif /* __SSP_FORTIFY_LEVEL > 0 */ +#endif /* _SSP_STRINGS_H_ */ diff --git a/include/ssp/unistd.h b/include/ssp/unistd.h new file mode 100644 index 000000000000..2414e2baa96b --- /dev/null +++ b/include/ssp/unistd.h @@ -0,0 +1,54 @@ +/*=C2=A0=C2=A0=C2=A0 $NetBSD: unistd.h,v 1.7 2015/06/25 18:41:03 joerg Exp= $=C2=A0=C2=A0=C2=A0 */ + +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF = THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _SSP_UNISTD_H_ +#define _SSP_UNISTD_H_ + +#include + +#if __SSP_FORTIFY_LEVEL > 0 +__BEGIN_DECLS + +__ssp_redirect0(ssize_t, read, (int __fd, void *__buf, size_t __len), \ +=C2=A0 =C2=A0 (__fd, __buf, __len)); + +__ssp_redirect(ssize_t, readlink, (const char *__restrict __path, \ +=C2=A0 =C2=A0 char *__restrict __buf, size_t __len), (__path, __buf, __len= )); + +__ssp_redirect_raw(char *, getcwd, getcwd, (char *__buf, size_t __len), +=C2=A0 =C2=A0 (__buf, __len), __buf !=3D 0, __ssp_bos); + +__END_DECLS + +#endif /* __SSP_FORTIFY_LEVEL > 0 */ +#endif /* _SSP_UNISTD_H_ */ diff --git a/lib/libc/secure/Makefile.inc b/lib/libc/secure/Makefile.inc index 8574c5a05dc5..3b1ad879c715 100644 --- a/lib/libc/secure/Makefile.inc +++ b/lib/libc/secure/Makefile.inc @@ -3,6 +3,17 @@ =20 .PATH: ${LIBC_SRCTOP}/secure =20 +# _FORTIFY_SOURCE +SRCS+=3D=C2=A0=C2=A0=C2=A0 gets_chk.c fgets_chk.c memcpy_chk.c memmove_chk= .c memset_chk.c \ +=C2=A0=C2=A0=C2=A0 snprintf_chk.c sprintf_chk.c stpcpy_chk.c stpncpy_chk.c= \ +=C2=A0=C2=A0=C2=A0 strcat_chk.c strcpy_chk.c strncat_chk.c strncpy_chk.c \ +=C2=A0=C2=A0=C2=A0 vsnprintf_chk.c vsprintf_chk.c + +CFLAGS.snprintf_chk.c+=3D=C2=A0=C2=A0=C2=A0 -Wno-unused-parameter +CFLAGS.sprintf_chk.c+=3D=C2=A0=C2=A0=C2=A0 -Wno-unused-parameter +CFLAGS.vsnprintf_chk.c+=3D=C2=A0=C2=A0=C2=A0 -Wno-unused-parameter +CFLAGS.vsprintf_chk.c+=3D=C2=A0=C2=A0=C2=A0 -Wno-unused-parameter + # Sources common to both syscall interfaces: SRCS+=3D=C2=A0=C2=A0=C2=A0 stack_protector.c \ =C2=A0=C2=A0=C2=A0 stack_protector_compat.c diff --git a/lib/libc/secure/Symbol.map b/lib/libc/secure/Symbol.map index 641f451b5421..7859fcee3821 100644 --- a/lib/libc/secure/Symbol.map +++ b/lib/libc/secure/Symbol.map @@ -3,3 +3,21 @@ FBSD_1.0 { =C2=A0=C2=A0=C2=A0 __stack_chk_fail; =C2=A0=C2=A0=C2=A0 __stack_chk_guard; }; + +FBSD_1.8 { +=C2=A0=C2=A0=C2=A0 __gets_chk; +=C2=A0=C2=A0=C2=A0 __fgets_chk; +=C2=A0=C2=A0=C2=A0 __memcpy_chk; +=C2=A0=C2=A0=C2=A0 __memmove_chk; +=C2=A0=C2=A0=C2=A0 __memset_chk; +=C2=A0=C2=A0=C2=A0 __snprintf_chk; +=C2=A0=C2=A0=C2=A0 __sprintf_chk; +=C2=A0=C2=A0=C2=A0 __stpcpy_chk; +=C2=A0=C2=A0=C2=A0 __stpncpy_chk; +=C2=A0=C2=A0=C2=A0 __strcat_chk; +=C2=A0=C2=A0=C2=A0 __strcpy_chk; +=C2=A0=C2=A0=C2=A0 __strncat_chk; +=C2=A0=C2=A0=C2=A0 __strncpy_chk; +=C2=A0=C2=A0=C2=A0 __vsnprintf_chk; +=C2=A0=C2=A0=C2=A0 __vsprintf_chk; +}; diff --git a/lib/libc/secure/fgets_chk.c b/lib/libc/secure/fgets_chk.c new file mode 100644 index 000000000000..72aa1d816ce1 --- /dev/null +++ b/lib/libc/secure/fgets_chk.c @@ -0,0 +1,54 @@ +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * 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 +__RCSID("$NetBSD: fgets_chk.c,v 1.6 2009/02/05 05:41:51 lukem Exp $"); + +#include +#include +#include +#include + +#include +#include +#undef fgets + +char * +__fgets_chk(char * __restrict buf, int len, size_t slen, FILE *fp) +{ +=C2=A0=C2=A0=C2=A0 if (slen >=3D (size_t)INT_MAX) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 return (fgets(buf, len, fp)); + +=C2=A0=C2=A0=C2=A0 if (len >=3D 0 && (size_t)len > slen) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail(); + +=C2=A0=C2=A0=C2=A0 return (fgets(buf, len, fp)); +} diff --git a/lib/libc/secure/gets_chk.c b/lib/libc/secure/gets_chk.c new file mode 100644 index 000000000000..18c1e2d18f43 --- /dev/null +++ b/lib/libc/secure/gets_chk.c @@ -0,0 +1,74 @@ +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * 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 +__RCSID("$NetBSD: gets_chk.c,v 1.7 2013/10/04 20:49:16 christos Exp $"); + +#include +#include +#include +#include + +#include +#include + +char *__gets_unsafe(char *); + +char * +__gets_chk(char * __restrict buf, size_t slen) +{ +=C2=A0=C2=A0=C2=A0 char *abuf; +=C2=A0=C2=A0=C2=A0 size_t len; + +=C2=A0=C2=A0=C2=A0 if (slen >=3D (size_t)INT_MAX) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 return (__gets_unsafe(buf)); + +=C2=A0=C2=A0=C2=A0 if ((abuf =3D malloc(slen + 1)) =3D=3D NULL) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 return (__gets_unsafe(buf)); + +=C2=A0=C2=A0=C2=A0 if (fgets(abuf, (int)(slen + 1), stdin) =3D=3D NULL) { +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 free(abuf); +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 return (NULL); +=C2=A0=C2=A0=C2=A0 } + +=C2=A0=C2=A0=C2=A0 len =3D strlen(abuf); +=C2=A0=C2=A0=C2=A0 if (len > 0 && abuf[len - 1] =3D=3D '\n') +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 --len; + +=C2=A0=C2=A0=C2=A0 if (len >=3D slen) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail(); + +=C2=A0=C2=A0=C2=A0 (void)memcpy(buf, abuf, len); + +=C2=A0=C2=A0=C2=A0 buf[len] =3D '\0'; +=C2=A0=C2=A0=C2=A0 free(abuf); +=C2=A0=C2=A0=C2=A0 return (buf); +} diff --git a/lib/libc/secure/memcpy_chk.c b/lib/libc/secure/memcpy_chk.c new file mode 100644 index 000000000000..99cf2d5f13ff --- /dev/null +++ b/lib/libc/secure/memcpy_chk.c @@ -0,0 +1,53 @@ +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * 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 +__RCSID("$NetBSD: memcpy_chk.c,v 1.7 2015/05/13 19:57:16 joerg Exp $"); + +#include + +#include +#undef memcpy + +#include "ssp_internal.h" + +void * +__memcpy_chk(void * __restrict dst, const void * __restrict src, size_t le= n, +=C2=A0 =C2=A0 size_t slen) +{ +=C2=A0=C2=A0=C2=A0 if (len > slen) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail(); + +=C2=A0=C2=A0=C2=A0 if (__ssp_overlap((const char *)src, (const char *)dst,= len)) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail(); + +=C2=A0=C2=A0=C2=A0 return (memcpy(dst, src, len)); +} diff --git a/lib/libc/secure/memmove_chk.c b/lib/libc/secure/memmove_chk.c new file mode 100644 index 000000000000..07f965d608fc --- /dev/null +++ b/lib/libc/secure/memmove_chk.c @@ -0,0 +1,47 @@ +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * 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 +__RCSID("$NetBSD: memmove_chk.c,v 1.6 2020/09/05 13:37:59 mrg Exp $"); + +#include + +#include +#undef memmove + +void * +__memmove_chk(void *dst, const void *src, size_t len, +=C2=A0 =C2=A0 size_t slen) +{ +=C2=A0=C2=A0=C2=A0 if (len > slen) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail(); +=C2=A0=C2=A0=C2=A0 return (memmove(dst, src, len)); +} diff --git a/lib/libc/secure/memset_chk.c b/lib/libc/secure/memset_chk.c new file mode 100644 index 000000000000..f337be98b46d --- /dev/null +++ b/lib/libc/secure/memset_chk.c @@ -0,0 +1,46 @@ +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * 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 +__RCSID("$NetBSD: memset_chk.c,v 1.5 2014/09/17 00:39:28 joerg Exp $"); + +#include + +#include +#undef memset + +void * +__memset_chk(void * __restrict dst, int val, size_t len, size_t slen) +{ +=C2=A0=C2=A0=C2=A0 if (len > slen) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail(); +=C2=A0=C2=A0=C2=A0 return (memset(dst, val, len)); +} diff --git a/lib/libc/secure/snprintf_chk.c b/lib/libc/secure/snprintf_chk.= c new file mode 100644 index 000000000000..52ef874ede5b --- /dev/null +++ b/lib/libc/secure/snprintf_chk.c @@ -0,0 +1,56 @@ +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er. + * 2. Redistributions in binary form must reproduce the above copyright + *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the + *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTO= RS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM= ITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU= LAR + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUNDATION OR CONTR= IBUTORS + * 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 BUSINES= S + * 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 +__RCSID("$NetBSD: snprintf_chk.c,v 1.5 2008/04/28 20:23:00 martin Exp $"); + +#include +#include + +#include +#undef vsnprintf + +int +__snprintf_chk(char * __restrict buf, size_t len, int flags, size_t slen, +=C2=A0 =C2=A0 const char * __restrict fmt, ...) +{ +=C2=A0=C2=A0=C2=A0 va_list ap; +=C2=A0=C2=A0=C2=A0 int rv; + +=C2=A0=C2=A0=C2=A0 if (len > slen) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail(); + +=C2=A0=C2=A0=C2=A0 va_start(ap, fmt); +=C2=A0=C2=A0=C2=A0 rv =3D vsnprintf(buf, len, fmt, ap); +=C2=A0=C2=A0=C2=A0 va_end(ap); + +=C2=A0=C2=A0=C2=A0 return (rv); +} diff --git a/lib/libc/secure/sprintf_chk.c b/lib/libc/secure/sprintf_chk.c new file mode 100644 index 000000000000..d4c42ccba3ce --- /dev/null +++ b/lib/libc/secure/sprintf_chk.c @@ -0,0 +1,61 @@ +/*- + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation *** 1063 LINES SKIPPED *** =20 =20 ------=_Part_1638477_2102893408.1716080957796 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
(sorry for top posting .. my= mailer just sucks)
Hi;

I used to like the limited static checking FORTIFY_SOURCE provid= es and when I ran it over FreeBSD it did find a couple of minor issues. It = only works for GCC though.

=
I guess it doesn't really hurt= to have FORTIFY_SOURCE around and NetBSD had the least intrusive implement= ation the last time I checked but I would certainly request it should never= be activated by default, specially with clang. The GCC version has seen mo= re development on glibc but I still think its a dead end.

What I would like to see working on FreeBSD is Safestack as a replacement = for the stack protector, which we were so very slow to adopt even when it w= as originally developed in FreeBSD. I think other projects based on FreeBSD= (Chimera and hardenedBSD) have been using it but I don't know the details.=

This is just al= l my $0.02

Pedro.

=20
=20
On Saturday, May 18, 2024 at 05:54:42 PM GMT-5, Kyl= e Evans <kaevans@fastmail.com> wrote:


=20 =20


1.) _FORTIFY_SOURCE provides more granular detection of overflow; I d= on't have to overflow all the way into the canary at the end of the frame t= o be detected, so my minor bug now can be caught before something causes th= e stack frame to be rearranged and turn it into a security issue later

2.) __builtin_object_size doesn't work = on heap objects, but it actually can work on subobjects from a heap allocat= ion (e.g., &foo->name), so the coverage extends beyond the stack int= o starting to detect other kinds of overflow 

While the security value over stack-protector-strong may be= marginal (I won't debate this specifically), the feature still has value i= n general.

Thanks,

Kyle Evans

=
The NetBSD code was not well = adapted to clang either.

Ask me more if you really want to dig into it, but we don't w= ant this.

P= edro.


=20
=20
On Monday, May 13, 2024 at 12:24:13 AM GMT-5, Kyle = Evans <kevans@freebsd.org> wrote:


=20 =20

commit be04fec42638f30f50b5b55fd8e3634c0= fb89928
=
AuthorDate: 2024-05-13 05:23:49 +0000
Commit:    Kyle Evans <keva= ns@FreeBSD.org>
CommitDate:= 2024-05-13 05:23:49 +0000

    Import _FORTIFY_SOURCE imp= lementation from NetBSD
  &nb= sp;
    This is a mostl= y-unmodified copy of the various *_chk implementations
    and headers from NetBSD, without yet mod= ifying system headers to start
&nb= sp;   actually including them.  A future commit will also apply t= he needed
    bits to fi= x ssp/unistd.h.
   
    Reviewed by:  &nbs= p; imp, pauamma_gundo.com (both previous versions), kib
<= /div>
    Sponsored by:  Stormshield
    Sponsored by:  Klara= , Inc.
    Differential = Revision:  https://reviews.freebsd.org/D32306
etc/mtree/BSD.include.dist        | = ; 2 +
include/ssp/ssp.h             = ;     |  91 ++++++++++++++++++++++++++
include/ssp/stdio.h          =       |  93 ++++++++++++++++++++++++++
include/ssp/string.h        &= nbsp;     | 129 ++++++++++++++++++++++++++++++++++++
include/ssp/strings.h      &n= bsp;       |  67 +++++++++++++++++++
=
include/ssp/unistd.h        &nb= sp;     |  54 +++++++++++++++
lib/libc/secure/Makefile.inc      |  11 += +++
lib/libc/secure/Symbol.map&nb= sp;       |  18 +++++
lib/libc/secure/fgets_chk.c        |  54= +++++++++++++++
lib/libc/secure/= gets_chk.c        |  74 +++++++++++++++++++++
lib/libc/secure/memcpy_chk.c  &= nbsp;   |  53 +++++++++++++++
lib/libc/secure/memmove_chk.c      |  47 ++++= +++++++++
lib/libc/secure/memset_= chk.c      |  46 +++++++++++++
lib/libc/secure/snprintf_chk.c    |  56 = ++++++++++++++++
lib/libc/secure/= sprintf_chk.c      |  61 +++++++++++++++++
lib/libc/secure/ssp_internal.h    = |  37 +++++++++++
lib/libc/s= ecure/stpcpy_chk.c      |  55 ++++++++++++++++
lib/libc/secure/stpncpy_chk.c  &nbs= p;   |  53 +++++++++++++++
lib/libc/secure/strcat_chk.c      |  60 ++++++++++= +++++++
lib/libc/secure/strcpy_ch= k.c      |  54 +++++++++++++++
lib/libc/secure/strncat_chk.c      | = ; 70 ++++++++++++++++++++
lib/lib= c/secure/strncpy_chk.c      |  53 +++++++++++++++
lib/libc/secure/vsnprintf_chk.c  =   |  49 ++++++++++++++
= lib/libc/secure/vsprintf_chk.c    |  58 ++++++++++++++++
lib/libssp/Makefile    &n= bsp;           |  20 +++++-
lib/libssp/Symbol.map        &= nbsp;     |  12 ++--
lib/libssp/Versions.def            | = 5 ++
lib/libssp/__builtin_objec= t_size.3 | 110 +++++++++++++++++++++++++++++++
lib/libssp/fortify_stubs.c        | 131 = -------------------------------------
lib/libssp/ssp.3               = ;   | 130 ++++++++++++++++++++++++++++++++++++
32 files changed, 1621 insertions(+), 140 deletions(-)<= br clear=3D"none">

diff --git a/etc/mtree/BSD.include.dist b/etc/mtree/BSD.include.di= st
index a6bd5880bf61..f8c83d6dde7= a 100644
--- a/etc/mtree/BSD.inclu= de.dist
+++ b/etc/mtree/BSD.includ= e.dist
@@ -372,6 +372,8 @@
        mac_veriexec=
        ..
    ..
+    ssp
+    ..
  =   sys
      &= nbsp; disk
      &= nbsp; ..
diff --git a/include/Mak= efile b/include/Makefile
index 19e= 6beb95203..32774419f162 100644
---= a/include/Makefile
+++ b/include/= Makefile
@@ -4,7 +4,7 @@

PACKAGE=3Dclibs
CLEANFILES=3D o= sreldate.h version
-SUBDIR=3D arpa= protocols rpcsvc rpc xlocale
+SUB= DIR=3D arpa protocols rpcsvc rpc ssp xlocale
.if ${MACHINE_CPUARCH} =3D=3D "amd64"
<= div dir=3D"ltr"> SUBDIR+=3D        i386
INCLUDE_SUBDIRS+=3D    = i386
diff --git a/include/ssp/Make= file b/include/ssp/Makefile
new fi= le mode 100644
index 000000000000.= .dff19f43c920
--- /dev/null
+++ b/include/ssp/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+INCS=3D    ssp.h stdio.h s= tring.h strings.h unistd.h
+INCSDI= R=3D    ${INCLUDEDIR}/ssp
+
+.include <bsd.prog.= mk>
diff --git a/include/ssp/ss= p.h b/include/ssp/ssp.h
new file m= ode 100644
index 000000000000..35a= 9aeee02df
--- /dev/null
+++ b/include/ssp/ssp.h
=
@@ -0,0 +1,91 @@
+/*    $NetBSD: ssp.h,v 1.13 2015/09/03 20:43:47 plunk= y Exp $    */
+
+/*-
+ *
+ * SPDX-License-Iden= tifier: BSD-2-Clause
+ *
+ * Copyright (c) 2006, 2011 The NetBSD Fo= undation, Inc.
+ * All rights rese= rved.
+ *
=
+ * This code is derived from software contributed to The = NetBSD Foundation
+ * by Christos = Zoulas.
+ *
+ * Redistribution and use in source and binary forms, w= ith or without
+ * modification, a= re permitted provided that the following conditions
+ * are met:
+ *= 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of cond= itions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright=
+ *    notice, this lis= t of conditions and the following disclaimer in the
+ *    documentation and/or other materials pro= vided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY TH= E NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BU= T NOT LIMITED
+ * TO, THE IMPLIED = WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHAL= L THE FOUNDATION OR CONTRIBUTORS
+= * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDIN= G, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUS= INESS
+ * INTERRUPTION) HOWEVER CA= USED 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.
+ */
+#ifn= def _SSP_SSP_H_
+#define _SSP_SSP_= H_
+
+#include <sys/cdefs.h>
+
+#if !defined(__cpluspl= us)
+# if defined(_FORTIFY_SOURCE)= && _FORTIFY_SOURCE > 0 && \
+    (__OPTIMIZE__ > 0 || defined(__clang__))
+#  if _FORTIFY_SOURCE > 1<= br clear=3D"none">
+#  define __SSP_FORTIFY_LEV= EL 2
+#  else
+#  define __SSP_FORTIFY_LEVEL 1
+#  endif
+# else
+#  def= ine __SSP_FORTIFY_LEVEL 0
+# endif=
+#else
+# define __SSP_FORTIFY_LEVEL 0
+#endif
+
+#define __ssp_bos(ptr) __builtin_object_size(ptr, __SS= P_FORTIFY_LEVEL > 1)
+#define _= _ssp_bos0(ptr) __builtin_object_size(ptr, 0)
+
+#define __ssp_check(= buf, len, bos) \
+  &nbs= p; if (bos(buf) !=3D (size_t)-1 && len > bos(buf)) \
+        __chk_= fail()
+#define __ssp_redirect_raw= (rtype, fun, symbol, args, call, cond, bos) \
+rtype __ssp_real_(fun) args __RENAME(symbol); \
+__ssp_inline rtype fun args __RENAME(__ssp_prot= ected_ ## fun); \
+__ssp_inline rt= ype fun args { \
+  &nbs= p; if (cond) \
+   =     __ssp_check(__buf, __len, bos); \
+    return __ssp_real_(fun) call; \
+}
+
+#define __ssp_redirect= (rtype, fun, args, call) \
+ =   __ssp_redirect_raw(rtype, fun, fun, args, call, 1, __ssp_bos)
+#define __ssp_redirect0(rtype, fun, ar= gs, call) \
+    __ssp_r= edirect_raw(rtype, fun, fun, args, call, 1, __ssp_bos0)
<= /div>
+
+__BEGIN_D= ECLS
+void __stack_chk_fail(void) = __dead2;
+void __chk_fail(void) __= dead2;
+__END_DECLS
+
+#end= if /* _SSP_SSP_H_ */
diff --git a/= include/ssp/stdio.h b/include/ssp/stdio.h
new file mode 100644
inde= x 000000000000..72e3236eac80
--- /= dev/null
+++ b/include/ssp/stdio.h=
@@ -0,0 +1,93 @@
+/*    $NetBSD: stdio.h,v 1.5 2011/= 07/17 20:54:34 joerg Exp $    */
+
+/*-
+ *
+ = * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2006 T= he NetBSD Foundation, Inc.
+ * All= rights reserved.
+ *
+ * This code is derived from software contrib= uted to The NetBSD Foundation
+ * = by Christos Zoulas.
+ *
+ * Redistribution and use in source and b= inary forms, with or without
+ * m= odification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above cop= yright
+ *    notice, th= is list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the = above copyright
+ *    n= otice, this list of conditions and the following disclaimer in the
+ *    documentation and/or othe= r materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS= PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES= , INCLUDING, BUT NOT LIMITED
+ * T= O, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  I= N NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, = EXEMPLARY, OR
+ * CONSEQUENTIAL DA= MAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR = PROFITS; OR BUSINESS
+ * INTERRUPT= ION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLU= DING NEGLIGENCE OR OTHERWISE)
+ * = ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE<= br clear=3D"none">
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef _SSP_STDIO_H_
+= #define _SSP_STDIO_H_
+
+#include <ssp/ssp.h>
+
+__BE= GIN_DECLS
+int __sprintf_chk(char = *__restrict, int, size_t, const char *__restrict, ...)
+    __printflike(4, 5);
<= /div>
+int __vsprintf_chk(char *__restrict, int, size_t, co= nst char *__restrict,
+  &nbs= p; __va_list)
+    __pri= ntflike(4, 0);
+int __snprintf_chk= (char *__restrict, size_t, int, size_t,
+    const char *__restrict, ...)
<= div dir=3D"ltr">+    __printflike(5, 6);
=
+int __vsnprintf_chk(char *__restrict, size_t, int, size_t= ,
+    const char *__re= strict, __va_list)
+    = __printflike(5, 0);
+char *__gets_= chk(char *, size_t);
+char *__fget= s_chk(char *, int, size_t, FILE *);
+__END_DECLS
+
+#if __SSP_FORTIFY_LEVEL > 0
<= /div>
+
+#define s= printf(str, ...) ({    \
+    char *_ssp_str =3D (str);    \
+    __builtin___sprintf_chk(_ss= p_str, 0, __ssp_bos(_ssp_str),        \
+        __VA_ARGS_= _); \
+})
=
+
+#define vsprin= tf(str, fmt, ap) ({    \
+    char *_ssp_str =3D (str);     &nbs= p;  \
+    __builti= n___vsprintf_chk(_ssp_str, 0, __ssp_bos(_ssp_str), fmt,    \=
+        ap);=                = \
+})
+
+#define snprintf(= str, len, ...) ({    \
+    char *_ssp_str =3D (str);      =   \
+    __builtin_= __snprintf_chk(_ssp_str, len, 0, __ssp_bos(_ssp_str),    \
+        __VA_A= RGS__);            \
+})
+
+#define vsnprintf(str, len, = fmt, ap) ({    \
+&= nbsp;   char *_ssp_str =3D (str);       = \
+    __builtin___vsnp= rintf_chk(_ssp_str, len, 0, __ssp_bos(_ssp_str),    \
+        fmt, ap);&n= bsp;           \
=
+})
+
+#define gets(str) ({   =         \
+  char *_ssp_str =3D (str);      &= nbsp; \
+    __gets_chk(= _ssp_str, __ssp_bos(_ssp_str));    \
+})
+
+#define fgets(str, len, fp) ({  = ;      \
+&nbs= p;   char *_ssp_str =3D (str);        \<= br clear=3D"none">
+    __fgets_chk(_ssp_st= r, len, __ssp_bos(_ssp_str), fp);    \
+})
+
+#endif /* __SSP_FORTIFY_LEVEL > 0 */
+
+#endif /* _SSP_STDIO_H_ */
diff --git a/include/ssp/string.h b/include/ssp/string.h
new file mode 100644
index 000000000000..996020fda778
--- /dev/null
+++ b/in= clude/ssp/string.h
@@ -0,0 +1,129 = @@
+/*    $NetBSD: = string.h,v 1.14 2020/09/05 13:37:59 mrg Exp $    */
+
+/*-
+ *
=
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * C= opyright (c) 2006 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived fr= om software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and us= e in source and binary forms, with or without
+ * modification, are permitted provided that the following con= ditions
+ * are met:
+ * 1. Redistributions of source code must reta= in the above copyright
+ *  &= nbsp; notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form mus= t reproduce the above copyright
+ = *    notice, this list of conditions and the following disclaimer= in the
+ *    documenta= tion and/or other materials provided with the distribution.
+ *
+ * = THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IM= PLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FO= R A PARTICULAR
+ * PURPOSE ARE DIS= CLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCID= ENTAL, SPECIAL, EXEMPLARY, OR
+ * = CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS O= F USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER= IN
+ * CONTRACT, STRICT LIABILITY= , OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF= ADVISED OF THE
+ * POSSIBILITY OF= SUCH DAMAGE.
+ */
+#ifndef _SSP_STRING_H_
<= div dir=3D"ltr">+#define _SSP_STRING_H_
+
+#include <ssp/ssp.h>= ;
+
+__BEGIN_DECLS
+void *_= _memcpy_chk(void *, const void *, size_t, size_t);
=
+void *__memmove_chk(void *, const void *, size_t, size_t)= ;
+void *__memset_chk(void *, int,= size_t, size_t);
+char *__stpcpy_= chk(char *, const char *, size_t);
+char *__stpncpy_chk(char *, const char *, size_t, size_t);
+char *__strcat_chk(char *, const char *, size_t= );
+char *__strcpy_chk(char *, con= st char *, size_t);
+char *__strnc= at_chk(char *, const char *, size_t, size_t);
+char *__strncpy_chk(char *, const char *, size_t, size_t);
+__END_DECLS
=
+
+#if __SSP_FORT= IFY_LEVEL > 0
+
+#define __ssp_bos_check3_typed_var(fun, dsttype,= dsrvar, dst, srctype, srcvar, \
+=     src, lenvar, len) ({        &nb= sp;       \
+    srctype srcvar =3D (src);      &= nbsp;         \
+    dsttype dstvar =3D (dst);    &nbs= p;           \
+    size_t lenvar =3D (len);  &nb= sp;             \
+    ((__ssp_bos0(dstvar) !=3D (size= _t)-1) ?        \
+    __builtin___ ## fun ## _chk(dstvar, srcvar, le= nvar,    \
+  =       __ssp_bos0(dstvar)) :      &n= bsp;         \
+    __ ## fun ## _ichk(dstvar, srcvar, lenvar)); = ;   \
+})
+
+#def= ine __ssp_bos_check3_typed(fun, dsttype, dst, srctype, src, len)  = ;  \
+    __ssp_bos= _check3_typed_var(fun, dsttype, __ssp_var(dstv), dst,    \
+        srctyp= e, __ssp_var(srcv), src, __ssp_var(lenv), len)
+
+#define __ssp_bos_= check3(fun, dst, src, len)        \
+    __ssp_bos_check3_typed_var(= fun, void *, __ssp_var(dstv), dst,    \
+        const void *, __ssp_var(s= rcv), src, __ssp_var(lenv), len)
+=
+#define __ssp_bos_check2_var(fun= , dstvar, dst, srcvar, src) ({        \
+    const void *srcvar =3D (= src);              &= nbsp; \
+    void *dstva= r =3D (dst);             =    \
+    ((__= ssp_bos0(dstvar) !=3D (size_t)-1) ?        \<= br clear=3D"none">
+    __builtin___ ## fun= ## _chk(dstvar, srcvar,        \
+        __ssp_bos0(dstva= r)) :              &= nbsp; \
+    __ ## fun #= # _ichk(dstvar, srcvar));        \
+})
+
+#define __ssp_bos_check2(fun= , dst, src)            \
+    __ssp_bos_check2_var(fun= , __ssp_var(dstv), dst, __ssp_var(srcv), src)
+
+#define __ssp_bos_i= check3_restrict(fun, type1, type2) \
+static __inline type1 __ ## fun ## _ichk(type1 __restrict, type2 __rest= rict, size_t); \
+static __inline = __attribute__((__always_inline__)) type1 \
+__ ## fun ## _ichk(type1 __restrict dst, type2 __restrict src, si= ze_t len) { \
+    = return __builtin___ ## fun ## _chk(dst, src, len, __ssp_bos0(dst)); \
+}
+
+#define __ssp_bos_icheck3(= fun, type1, type2) \
+static __inl= ine type1 __ ## fun ## _ichk(type1, type2, size_t); \
+static __inline __attribute__((__always_inline__)) typ= e1 \
+__ ## fun ## _ichk(type1 dst= , type2 src, size_t len) { \
+&nbs= p;   return __builtin___ ## fun ## _chk(dst, src, len, __ssp_bos0= (dst)); \
+}
+
+#define __s= sp_bos_icheck2_restrict(fun, type1, type2) \
+static __inline type1 __ ## fun ## _ichk(type1, type2); \
+static __inline __attribute__((__alway= s_inline__)) type1 \
+__ ## fun ##= _ichk(type1 __restrict dst, type2 __restrict src) { \
+    return __builtin___ ## fun ## _chk= (dst, src, __ssp_bos0(dst)); \
+}<= br clear=3D"none">
+
+__BEGIN_DECLS
+__ssp_bos= _icheck3_restrict(memcpy, void *, const void *)
+__ssp_bos_icheck3(memmove, void *, const void *)
+__ssp_bos_icheck3(memset, void *, int)
+__ssp_bos_icheck2_restrict(stpcpy, cha= r *, const char *)
+__ssp_bos_iche= ck3_restrict(stpncpy, char *, const char *)
+__ssp_bos_icheck2_restrict(strcpy, char *, const char *)
+__ssp_bos_icheck2_restrict(strcat, char = *, const char *)
+__ssp_bos_icheck= 3_restrict(strncpy, char *, const char *)
+__ssp_bos_icheck3_restrict(strncat, char *, const char *)
+__END_DECLS
+
+#define memcpy(dst= , src, len) __ssp_bos_check3(memcpy, dst, src, len)
+#define memmove(dst, src, len) __ssp_bos_check3(memmove,= dst, src, len)
+#define memset(ds= t, val, len) \
+    __ss= p_bos_check3_typed(memset, void *, dst, int, val, len)
+#define stpcpy(dst, src) __ssp_bos_check2(stpcpy, dst= , src)
+#define stpncpy(dst, src, = len) __ssp_bos_check3(stpncpy, dst, src, len)
+#define strcpy(dst, src) __ssp_bos_check2(strcpy, dst, src)
+#define strcat(dst, src) __ssp_bos_= check2(strcat, dst, src)
+#define = strncpy(dst, src, len) __ssp_bos_check3(strncpy, dst, src, len)
+#define strncat(dst, src, len) __ssp_bos_che= ck3(strncat, dst, src, len)
+
+#endif /* __SSP_FORTIFY_LEVEL > 0 = */
+#endif /* _SSP_STRING_H_ */
diff --git a/include/ssp/strings.h b= /include/ssp/strings.h
new file mo= de 100644
index 000000000000..06c9= c7cc0a09
--- /dev/null
+++ b/include/ssp/strings.h
@@ -0,0 +1,67 @@
+/*    $NetBSD: strings.h,v 1.3 2008/04/28 20:22:54= martin Exp $    */
+
+/*-
+ *
+ * SPDX-Licens= e-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2007 The NetBSD Fou= ndation, Inc.
+ * All rights reser= ved.
+ *
<= div dir=3D"ltr">+ * This code is derived from software contributed to The N= etBSD Foundation
+ * by Christos Z= oulas.
+ *
+ * Redistribution and use in source and binary forms, wi= th or without
+ * modification, ar= e permitted provided that the following conditions
=
+ * are met:
+ * = 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of cond= itions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright=
+ *    notice, this lis= t of conditions and the following disclaimer in the
+ *    documentation and/or other materials pro= vided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY TH= E NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BU= T NOT LIMITED
+ * TO, THE IMPLIED = WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHAL= L THE FOUNDATION OR CONTRIBUTORS
+= * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDIN= G, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUS= INESS
+ * INTERRUPTION) HOWEVER CA= USED 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.
+ */
+#ifn= def _SSP_STRINGS_H_
+#define _SSP_= STRINGS_H_
+
+#include <ssp/ssp.h>
+#include <string.h>
+
+#if __SSP_FORTIFY_LEVE= L > 0
+
+#define _ssp_bcopy(srcvar, src, dstvar, dst, lenvar,&nbs= p; len) ({    \
+&n= bsp;   const void *srcvar =3D (src);      &nb= sp;     \
+  &= nbsp; void *dstvar =3D (dst);         &n= bsp;  \
+    size_t= lenvar =3D (len);            = \
+    ((__ssp_bos0(dstv= ar) !=3D (size_t)-1) ?    \
+    __builtin___memmove_chk(dstvar, srcvar, lenvar,&nbs= p;   \
+    &n= bsp;   __ssp_bos0(dstvar)) :        &nbs= p;   \
+    __= memmove_ichk(dstvar, srcvar, lenvar));    \
+})
+
+#define    bcopy(src,= dst, len)            \
+    _ssp_bcopy(__ssp_var(srcv= ), src, __ssp_var(dstv), dst, __ssp_var(lenv), len)
+
+#define _ssp_= bzero(dstvar, dst, lenvar, len) ({        \
+    void *dstvar =3D (ds= t);            \
+    size_t lenvar =3D (len); &n= bsp;          \
=
+    ((__ssp_bos0(dstvar) !=3D (size_t)-1) ?&nbs= p;   \
+    __= builtin___memset_chk(dstvar, 0, lenvar,    \
+        __ssp_bos0(dstvar)) = : \
+    __memset_ichk(d= stvar, 0, lenvar));        \
+})
+
+#define    bzero(dst,= len)    _ssp_bzero(__ssp_var(dstv), dst, __ssp_var(lenv), l= en)
+
+#endif /* __SSP_FORTIFY_LEVEL > 0 */
+#endif /* _SSP_STRINGS_H_ */
<= div dir=3D"ltr">diff --git a/include/ssp/unistd.h b/include/ssp/unistd.h
new file mode 100644
index 000000000000..2414e2baa96b
--- /dev/null
+++ b/include/ssp/unistd.h
@@= -0,0 +1,54 @@
+/*  &nbs= p; $NetBSD: unistd.h,v 1.7 2015/06/25 18:41:03 joerg Exp $   = ; */
+
+/*-
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2006 The NetBSD Foundation, Inc.
+ * All rights reserved.
=
+ *
+ * This code= is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistr= ibution 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 discl= aimer.
+ * 2. Redistributions in b= inary form must reproduce the above copyright
+ *    notice, this list of conditions and the follow= ing disclaimer in the
+ *  &n= bsp; documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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
+ * P= URPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTO= RS
+ * BE LIABLE FOR ANY DIRECT, I= NDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCURE= MENT OF
+ * SUBSTITUTE GOODS OR SE= RVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
=
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIAB= ILITY, WHETHER IN
+ * CONTRACT, ST= RICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOF= TWARE, EVEN IF ADVISED OF THE
+ * = POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef _SSP_UNISTD_H_
+#define _SSP_UNISTD_H_
+
+#include &l= t;ssp/ssp.h>
+
+#if __SSP_FORTIFY_LEVEL > 0
=
+__BEGIN_DECLS
+
+__ssp_redirect0(ssize_t, re= ad, (int __fd, void *__buf, size_t __len), \
+    (__fd, __buf, __len));
+
+__ssp_redirect(s= size_t, readlink, (const char *__restrict __path, \
+    char *__restrict __buf, size_t __len), (__= path, __buf, __len));
+
+__ssp_redirect_raw(char *, getcwd, getcwd= , (char *__buf, size_t __len),
+&n= bsp;   (__buf, __len), __buf !=3D 0, __ssp_bos);
+
+__END_DECLS=
+
+#endif /* __SSP_FORTIFY_LEVEL > 0 */
=
+#endif /* _SSP_UNISTD_H_ */
diff --git a/lib/libc/secure/Makefile.inc b/lib/libc/secure/Mak= efile.inc
index 8574c5a05dc5..3b1a= d879c715 100644
--- a/lib/libc/sec= ure/Makefile.inc
+++ b/lib/libc/se= cure/Makefile.inc
@@ -3,6 +3,17 @@=

.PATH: ${LIBC_SRCTOP}/secure

+# _FORTIFY_SOURCE
+SRCS+=3D    gets_chk.c fg= ets_chk.c memcpy_chk.c memmove_chk.c memset_chk.c \
+    snprintf_chk.c sprintf_chk.c stpcpy_c= hk.c stpncpy_chk.c \
+  =   strcat_chk.c strcpy_chk.c strncat_chk.c strncpy_chk.c \
+    vsnprintf_chk.c vsprintf_c= hk.c
+
+CFLAGS.snprintf_chk.c+=3D    -Wno-unused-para= meter
+CFLAGS.sprintf_chk.c+=3D&nb= sp;   -Wno-unused-parameter
+CFLAGS.vsnprintf_chk.c+=3D    -Wno-unused-parameter
+CFLAGS.vsprintf_chk.c+=3D  = ;  -Wno-unused-parameter
+
# Sources common to both syscall in= terfaces:
SRCS+=3D  &nb= sp; stack_protector.c \
 &nb= sp;  stack_protector_compat.c
diff --git a/lib/libc/secure/Symbol.map b/lib/libc/secure/Symbol.map
index 641f451b5421..7859fcee3821 100644=
--- a/lib/libc/secure/Symbol.map<= br clear=3D"none">
+++ b/lib/libc/secure/Symbol.map
@@ -3,3 +3,21 @@ FBSD_1.0 {
    __stack_chk_fail;
    __stack_chk_guard= ;
};
+
+FBSD_1.8 {
+    __gets_chk;
+    __fgets_chk;
+    __memcpy_chk;
+    __memmove_chk;
+    __memset_chk;
+    __snprintf_chk;
+    __sprintf_chk;
+    __stpcpy_chk;
+    __stpncpy_chk;
+    __strcat_chk;
+    __strcpy_chk;
+    __strncat_chk;
+    __strncpy_chk;
+    __vsnprintf_chk= ;
+    __vsprintf_c= hk;
+};
diff --git a/lib/libc/secure/fgets_chk.c b/lib/libc/secure/f= gets_chk.c
new file mode 100644
index 000000000000..72aa1d816ce1
--- /dev/null
+++ b/lib/libc/secure/fgets_chk.c
@@ -0,0 +1,54 @@
+/*-
+ *
=
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * C= opyright (c) 2006 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived fr= om software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and us= e in source and binary forms, with or without
+ * modification, are permitted provided that the following con= ditions
+ * are met:
+ * 1. Redistributions of source code must reta= in the above copyright
+ *  &= nbsp; notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form mus= t reproduce the above copyright
+ = *    notice, this list of conditions and the following disclaimer= in the
+ *    documenta= tion and/or other materials provided with the distribution.
+ *
+ * = THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IM= PLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FO= R A PARTICULAR
+ * PURPOSE ARE DIS= CLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCID= ENTAL, SPECIAL, EXEMPLARY, OR
+ * = CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS O= F 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 <sys/cdefs.h>
<= /div>
+__RCSID("$NetBSD: fgets_chk.c,v 1.6 2009/02/05 05:41= :51 lukem Exp $");
+
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+=
+#include <ssp/stdio.h>
+#include <ssp/string.h>
+#undef fgets
+
+char *
+__fgets_chk(char * __restrict buf, int le= n, size_t slen, FILE *fp)
+{
+    if (slen >=3D (s= ize_t)INT_MAX)
+   =     return (fgets(buf, len, fp));
<= div dir=3D"ltr">+
+  &nb= sp; if (len >=3D 0 && (size_t)len > slen)
<= /div>
+        __chk_fail();<= br clear=3D"none">
+
+    return (fgets(buf, len, fp));
+}
diff -= -git a/lib/libc/secure/gets_chk.c b/lib/libc/secure/gets_chk.c
new file mode 100644
<= div dir=3D"ltr">index 000000000000..18c1e2d18f43
--- /dev/null
+++ b= /lib/libc/secure/gets_chk.c
@@ -0,= 0 +1,74 @@
+/*-
=
+ *
+ * SPD= X-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2006 The Ne= tBSD Foundation, Inc.
+ * All righ= ts reserved.
+ *
+ * This code is derived from software contributed = to The NetBSD Foundation
+ * by Ch= ristos Zoulas.
+ *
+ * Redistribution and use in source and binary f= orms, with or without
+ * modifica= tion, 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 co= pyright
+ *    notice, t= his list of conditions and the following disclaimer in the
+ *    documentation and/or other materi= als provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDE= D BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
<= div dir=3D"ltr">+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUD= ING, BUT NOT LIMITED
+ * TO, THE I= MPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EV= ENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMP= LARY, OR
+ * CONSEQUENTIAL DAMAGES= (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFI= TS; OR BUSINESS
+ * INTERRUPTION) = HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING = NEGLIGENCE OR OTHERWISE)
+ * ARISI= NG IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: gets_chk.c,v 1.7 2013/10/04 20:49:16 christos Exp $");<= br clear=3D"none">
+
+#include <limits.h>
+#include <stdio.h>
+#incl= ude <stdlib.h>
+#include <= ;string.h>
+
=
+#include <ssp/stdio.h>
+#include <ssp/string.h>
<= div dir=3D"ltr">+
+char *__gets_un= safe(char *);
+
=
+char *
+__= gets_chk(char * __restrict buf, size_t slen)
+{
+    = char *abuf;
+    si= ze_t len;
+
+    if (slen >=3D (size_t)INT_MAX)
+      &nbs= p; return (__gets_unsafe(buf));
+<= br clear=3D"none">
+    if ((abuf =3D = malloc(slen + 1)) =3D=3D NULL)
+&n= bsp;       return (__gets_unsafe(buf));
+
+    if (fgets(abuf, (int)(slen + 1), stdin) =3D=3D NULL) {=
+      &= nbsp; free(abuf);
+  &nb= sp;     return (NULL);
+    }
+
+    len =3D strlen(abuf)= ;
+    if (len >= 0 && abuf[len - 1] =3D=3D '\n')
+        --len;
+
+ &nbs= p;  if (len >=3D slen)
+&n= bsp;       __chk_fail();
<= div dir=3D"ltr">+
+  &nb= sp; (void)memcpy(buf, abuf, len);
= +
+    buf[len] =3D= '\0';
+    free(ab= uf);
+    return (b= uf);
+}
diff --git a/lib/libc/secure/memcpy_chk.c b/lib/libc/secure/= memcpy_chk.c
new file mode 100644<= br clear=3D"none">
index 000000000000..99cf2d5f13ff
--- /dev/null
+++ b/lib/libc/secure/memcpy_chk.c
@@ -0,0 +1,53 @@
+/*-
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ = * Copyright (c) 2006 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived= from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution an= d use in source and binary forms, with or without
<= div dir=3D"ltr">+ * modification, are permitted provided that the following= conditions
+ * are met:
+ * 1. Redistributions of source code must= retain the above copyright
+ *&nb= sp;   notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary for= m must reproduce the above copyright
+ *    notice, this list of conditions and the following discl= aimer in the
+ *    docu= mentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIB= UTORS
+ * ``AS IS'' AND ANY EXPRES= S OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT= NESS FOR A PARTICULAR
+ * PURPOSE = ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION 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 LI= ABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, = EVEN IF ADVISED OF THE
+ * POSSIBI= LITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: memcpy_chk.c,v 1.7 2015/05/= 13 19:57:16 joerg Exp $");
+
+#include <string.h>
+
+#i= nclude <ssp/string.h>
+#unde= f memcpy
+
+#include "ssp_internal.h"
+
+void *
+__memcpy_chk(void * __restrict dst, const void= * __restrict src, size_t len,
+&n= bsp;   size_t slen)
+{
+    if (len > slen)
+      &nb= sp; __chk_fail();
+
+    if (__ssp_overlap((const cha= r *)src, (const char *)dst, len))
= +        __chk_fail();
+
+  =   return (memcpy(dst, src, len));
+}
diff --git a/lib/libc/secu= re/memmove_chk.c b/lib/libc/secure/memmove_chk.c
new file mode 100644
index 000000000000..07f965d608fc
--- /dev/null
+++ b/lib/libc/secu= re/memmove_chk.c
@@ -0,0 +1,47 @@<= br clear=3D"none">
+/*-
+ *
+ * SPDX-License-I= dentifier: BSD-2-Clause
+ *
+ * Copyright (c) 2006 The NetBSD Founda= tion, Inc.
+ * All rights reserved= .
+ *
+ * This code is derived from software contributed to The NetB= SD Foundation
+ * by Christos Zoul= as.
+ *
+ * Redistribution and use in source and binary forms, with = or without
+ * modification, are p= ermitted provided that the following conditions
+ * are met:
+ * 1. = Redistributions of source code must retain the above copyright
+ *    notice, this list of conditio= ns 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 provide= d with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NE= TBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NO= T LIMITED
+ * TO, THE IMPLIED WARR= ANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL TH= E FOUNDATION OR CONTRIBUTORS
+ * B= E LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, B= UT NOT LIMITED TO, PROCUREMENT OF
= + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINES= S
+ * 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
<= /div>
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include= <sys/cdefs.h>
+__RCSID("$Ne= tBSD: memmove_chk.c,v 1.6 2020/09/05 13:37:59 mrg Exp $");
+
+#inclu= de <string.h>
+
+#include <ssp/string.h>
+#undef memmove
+
+void *
+__memmove_chk(void *dst, const void *src, size_t= len,
+    size_t slen)<= br clear=3D"none">
+{
+    if (len > slen)
+        __chk_fail();
+    return (memmove(dst, = src, len));
+}
<= /div>
diff --git a/lib/libc/secure/memset_chk.c b/lib/libc/= secure/memset_chk.c
new file mode = 100644
index 000000000000..f337be9= 8b46d
--- /dev/null
+++ b/lib/libc/secure/memset_chk.c
@@ -0,0 +1,46 @@
+/*-
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2006 The NetBSD Foundation, Inc.
<= /div>
+ * All rights reserved.
+ *
+ * This code is = derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribut= ion and use in source and binary forms, with or without
<= /div>
+ * modification, are permitted provided that the fol= lowing conditions
+ * are met:
+ * 1. Redistributions of source code= must retain the above copyright
+= *    notice, this list of conditions and the following disclaime= r.
+ * 2. Redistributions in binar= y 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 NETBSD FOUNDATION, INC. AND C= ONTRIBUTORS
+ * ``AS IS'' AND ANY = EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY A= ND FITNESS FOR A PARTICULAR
+ * PU= RPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTOR= S
+ * BE LIABLE FOR ANY DIRECT, IN= DIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREM= ENT OF
+ * SUBSTITUTE GOODS OR SER= VICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
<= div dir=3D"ltr">+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABI= LITY, WHETHER IN
+ * CONTRACT, STR= ICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFT= WARE, EVEN IF ADVISED OF THE
+ * P= OSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: memset_chk.c,v 1.5 20= 14/09/17 00:39:28 joerg Exp $");
+=
+#include <string.h>
+
+#include <ssp/string.h>
= +#undef memset
+
+void *
+_= _memset_chk(void * __restrict dst, int val, size_t len, size_t slen)
+{
+    if (len > slen)
+        __chk_fail();
+    return (memset(dst, val, le= n));
+}
diff --git a/lib/libc/secure/snprintf_chk.c b/lib/libc/secur= e/snprintf_chk.c
new file mode 100= 644
index 000000000000..52ef874ede= 5b
--- /dev/null
+++ b/lib/libc/secure/snprintf_chk.c
@@ -0,0 +1,56 @@
+/*-
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2006 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is d= erived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistributi= on and use in source and binary forms, with or without
+ * modification, are permitted provided that the foll= owing 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 NETBSD FOUNDATION, INC. AND C= ONTRIBUTORS
+ * ``AS IS'' AND ANY = EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY A= ND FITNESS FOR A PARTICULAR
+ * PU= RPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTOR= S
+ * BE LIABLE FOR ANY DIRECT, IN= DIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREM= ENT OF
+ * SUBSTITUTE GOODS OR SER= VICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
<= div dir=3D"ltr">+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABI= LITY, WHETHER IN
+ * CONTRACT, STR= ICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFT= WARE, EVEN IF ADVISED OF THE
+ * P= OSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: snprintf_chk.c,v 1.5 = 2008/04/28 20:23:00 martin Exp $");
+
+#include <stdarg.h>
+#include <stdio.h>
+
+#= include <ssp/stdio.h>
+#unde= f vsnprintf
+
+int
+__snpri= ntf_chk(char * __restrict buf, size_t len, int flags, size_t slen,
+    const char * __restrict fmt= , ...)
+{
=
+    va_list ap;
+    int rv;
+
+    if = (len > slen)
+   = ;     __chk_fail();
+
+    va_start(ap= , fmt);
+    rv =3D= vsnprintf(buf, len, fmt, ap);
+&n= bsp;   va_end(ap);
+
+    return (rv);
+}
diff --git a/lib/libc/secure/sprintf_chk.c b/lib/libc/secure/sprintf_= chk.c
new file mode 100644
index 000000000000..d4c42ccba3ce
--- /dev/null
+++ b/lib/libc/secure/sprintf_chk.c
@@ -0,0 +1,61 @@
+/= *-
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
<= /div>
+ *
+ * Copy= right (c) 2006 The NetBSD Foundation, Inc.
+ * All rights reserved.
= + *
+ * This code is derived from = software contributed to The NetBSD Foundation
*** 1063 LINES SKIPPED ***

------=_Part_1638477_2102893408.1716080957796-- From nobody Sun May 19 02:08:48 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VhkdZ6Sv8z5KV3H; Sun, 19 May 2024 02:08:50 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VhkdZ603Nz4LhJ; Sun, 19 May 2024 02:08:50 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716084530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Rk77lL97lo3zuH9IJS8WVVC+sMTWXjnomXkEu760FaQ=; b=kpUqnL/WQ2MVXaznTrkABeunzGSWVkV5vWtE6GOjaCQNyoiLytf4dvBORQOHIsBszfNqAF MKa2S9hwVRQgidG4E1sJO2FW4k+0MvpWiwHx6GC1Us1aPpZElWhxVsjYpw8MrY4sFWAR81 GnajkaBfhTLDYlTlr+1X+bX1nXWmfqaThxXZ5vWStFmWUV5P2otXbEojVEGklPukaHu++h ACFh2doTp1Yod/WBjh6fUY8ccDi0p+GpTYKVcBsYVmfWpcHOd25mwGOdcOPZLlmZWyuVEg A2MQbsOk7tCmbJqa4JjeqMl0KllRGBZR3HOT4DpKK8gw4hw5cFc1uguKZWjjMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716084530; a=rsa-sha256; cv=none; b=H2W4egxSbIB93BxSQsEOQwXY17Ti6VPB4ztc0HXOKLZ5R3njBmCpEi06xfob91dnpX3laP TOgbgWV5I187v2zj1rIBK23XdE3BPj/auWM4X4dkkorbFAlELg28ubR/NbTNt0E+zjBQYD 5wGuZ+B/RdoiQdn7M53SWJZ9rWxrMmlKjxgAUjbwNFKY0xhyUANt5H4OdqiRt9O0ZBAGSk JvIIwOGaGAr8d7WSBE69zM0g9xL9UC8yaq/Xdo2WgexJUG0wK+urfBmpfSXkFIPURuqPVn Jltp+1xHp6gTDUR+jnw0wbxZfhUYOQPDtgKkf4OPmTiAqQhwJMqOS0bYVfEgGg== 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=1716084530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Rk77lL97lo3zuH9IJS8WVVC+sMTWXjnomXkEu760FaQ=; b=Hv93zAjdkmjSoF4N0T1xL+aNPWJfzK0NsOI3vlwDSsU7AuzUWZa2aq12v0lgoqp78hU9qk OAcD/rBjuw2dr/JaXnPg8h404J1RCO3dIG4MwXSyrZLkSH7XtFlWhZfVgs+dKcw1GPlpuU udqOby1GZ6wF00L2H0PyQSa4yy5B/VselnFHz9aOBgzvElQ7y2M27vMussoeODAmXmNml3 D9g3/Lr5YR/KrR2KFjTBT85OKPz7+xHRY2mtgq/WptSwZ0RxAKHZ3/wuDDR9iRsPez9b1V DoLh/S5USRqe5B4ALZwgCHL5z5hor68zOK+4FOdz1MB3XNpnWZ6gkyYXu1FBBA== Received: from [10.9.4.95] (unknown [209.182.120.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: kevans/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4VhkdZ1Xpyz1DSn; Sun, 19 May 2024 02:08:50 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: <6276b721-6c7b-41cd-9d1b-4169e86ec5e9@FreeBSD.org> Date: Sat, 18 May 2024 21:08:48 -0500 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: be04fec42638 - main - Import _FORTIFY_SOURCE implementation from NetBSD Content-Language: en-US To: Pedro Giffuni Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <02326b5e-a1fe-4411-a869-d21f9a76130c@email.android.com> <999469960.1638478.1716080957814@mail.yahoo.com> From: Kyle Evans In-Reply-To: <999469960.1638478.1716080957814@mail.yahoo.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 5/18/24 20:09, Pedro Giffuni wrote: > (sorry for top posting .. my mailer just sucks) > Hi; > > I used to like the limited static checking FORTIFY_SOURCE provides and > when I ran it over FreeBSD it did find a couple of minor issues. It only > works for GCC though. > I don't think this is particularly true anymore; I haven't found a case yet where __builtin_object_size(3) doesn't give me the correct size while GCC did. I'd welcome counter-examples here, though -- we have funding to both finish the project (widen the _FORTIFY_SOURCE net to more of libc/libsys) and add tests to demonstrate that it's both functional and correct. It would be useful to also document deficiencies in the tests. > I guess it doesn't really hurt to have FORTIFY_SOURCE around and NetBSD > had the least intrusive implementation the last time I checked but I > would certainly request it should never be activated by default, > specially with clang. The GCC version has seen more development on glibc > but I still think its a dead end. > I don't see a compelling reason to avoid enabling it by default; see above, the functionality that we need in clang appears to be just fine (and, iirc, was also fine when I checked at the beginning of working on this in 2021) and it provides useful > What I would like to see working on FreeBSD is Safestack as a > replacement for the stack protector, which we were so very slow to adopt > even when it was originally developed in FreeBSD. I think other projects > based on FreeBSD (Chimera and hardenedBSD) have been using it but I > don't know the details. > No comment there, though I think Shawn Webb / HardenedBSD had been playing around with SafeStack (and might have enabled it? I haven't actually looked in a while now). > This is just all my $0.02 > > Pedro. Thanks, Kyle Evans > > On Saturday, May 18, 2024 at 05:54:42 PM GMT-5, Kyle Evans > wrote: > > > > > On May 18, 2024 13:42, Pedro Giffuni wrote: > > Oh no .. please not... > > We went into that in a GSoC: > > https://wiki.freebsd.org/SummerOfCode2015/FreeBSDLibcSecurityExtensions > > > Ultimately it proved to be useless since stack-protector-strong. > > > Respectfully, I disagree with your conclusion here: > > 1.) _FORTIFY_SOURCE provides more granular detection of overflow; I > don't have to overflow all the way into the canary at the end of the > frame to be detected, so my minor bug now can be caught before something > causes the stack frame to be rearranged and turn it into a security > issue later > > 2.) __builtin_object_size doesn't work on heap objects, but it actually > can work on subobjects from a heap allocation (e.g., &foo->name), so the > coverage extends beyond the stack into starting to detect other kinds of > overflow > > While the security value over stack-protector-strong may be marginal (I > won't debate this specifically), the feature still has value in general. > > Thanks, > > Kyle Evans > > The NetBSD code was not well adapted to clang either. > > Ask me more if you really want to dig into it, but we don't want this. > > Pedro. > > > On Monday, May 13, 2024 at 12:24:13 AM GMT-5, Kyle Evans > wrote: > > > The branch main has been updated by kevans: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=be04fec42638f30f50b5b55fd8e3634c0fb89928 > > commit be04fec42638f30f50b5b55fd8e3634c0fb89928 > Author:    Kyle Evans > > AuthorDate: 2024-05-13 05:23:49 +0000 > Commit:    Kyle Evans > > CommitDate: 2024-05-13 05:23:49 +0000 > >     Import _FORTIFY_SOURCE implementation from NetBSD > >     This is a mostly-unmodified copy of the various *_chk > implementations >     and headers from NetBSD, without yet modifying system headers > to start >     actually including them.  A future commit will also apply the > needed >     bits to fix ssp/unistd.h. > >     Reviewed by:    imp, pauamma_gundo.com (both previous > versions), kib >     Sponsored by:  Stormshield >     Sponsored by:  Klara, Inc. >     Differential Revision: https://reviews.freebsd.org/D32306 > > --- > etc/mtree/BSD.include.dist        |  2 + > include/Makefile                  |  2 +- > include/ssp/Makefile              |  6 ++ > include/ssp/ssp.h                  |  91 ++++++++++++++++++++++++++ > include/ssp/stdio.h                |  93 ++++++++++++++++++++++++++ > include/ssp/string.h              | 129 > ++++++++++++++++++++++++++++++++++++ > include/ssp/strings.h              |  67 +++++++++++++++++++ > include/ssp/unistd.h              |  54 +++++++++++++++ > lib/libc/secure/Makefile.inc      |  11 ++++ > lib/libc/secure/Symbol.map        |  18 +++++ > lib/libc/secure/fgets_chk.c        |  54 +++++++++++++++ > lib/libc/secure/gets_chk.c        |  74 +++++++++++++++++++++ > lib/libc/secure/memcpy_chk.c      |  53 +++++++++++++++ > lib/libc/secure/memmove_chk.c      |  47 +++++++++++++ > lib/libc/secure/memset_chk.c      |  46 +++++++++++++ > lib/libc/secure/snprintf_chk.c    |  56 ++++++++++++++++ > lib/libc/secure/sprintf_chk.c      |  61 +++++++++++++++++ > lib/libc/secure/ssp_internal.h    |  37 +++++++++++ > lib/libc/secure/stpcpy_chk.c      |  55 ++++++++++++++++ > lib/libc/secure/stpncpy_chk.c      |  53 +++++++++++++++ > lib/libc/secure/strcat_chk.c      |  60 +++++++++++++++++ > lib/libc/secure/strcpy_chk.c      |  54 +++++++++++++++ > lib/libc/secure/strncat_chk.c      |  70 ++++++++++++++++++++ > lib/libc/secure/strncpy_chk.c      |  53 +++++++++++++++ > lib/libc/secure/vsnprintf_chk.c    |  49 ++++++++++++++ > lib/libc/secure/vsprintf_chk.c    |  58 ++++++++++++++++ > lib/libssp/Makefile                |  20 +++++- > lib/libssp/Symbol.map              |  12 ++-- > lib/libssp/Versions.def            |  5 ++ > lib/libssp/__builtin_object_size.3 | 110 +++++++++++++++++++++++++++++++ > lib/libssp/fortify_stubs.c        | 131 > ------------------------------------- > lib/libssp/ssp.3                  | 130 > ++++++++++++++++++++++++++++++++++++ > 32 files changed, 1621 insertions(+), 140 deletions(-) > > diff --git a/etc/mtree/BSD.include.dist b/etc/mtree/BSD.include.dist > index a6bd5880bf61..f8c83d6dde7a 100644 > --- a/etc/mtree/BSD.include.dist > +++ b/etc/mtree/BSD.include.dist > @@ -372,6 +372,8 @@ >         mac_veriexec >         .. >     .. > +    ssp > +    .. >     sys >         disk >         .. > diff --git a/include/Makefile b/include/Makefile > index 19e6beb95203..32774419f162 100644 > --- a/include/Makefile > +++ b/include/Makefile > @@ -4,7 +4,7 @@ > > PACKAGE=clibs > CLEANFILES= osreldate.h version > -SUBDIR= arpa protocols rpcsvc rpc xlocale > +SUBDIR= arpa protocols rpcsvc rpc ssp xlocale > .if ${MACHINE_CPUARCH} == "amd64" > SUBDIR+=        i386 > INCLUDE_SUBDIRS+=    i386 > diff --git a/include/ssp/Makefile b/include/ssp/Makefile > new file mode 100644 > index 000000000000..dff19f43c920 > --- /dev/null > +++ b/include/ssp/Makefile > @@ -0,0 +1,6 @@ > +# $FreeBSD$ > + > +INCS=    ssp.h stdio.h string.h strings.h unistd.h > +INCSDIR=    ${INCLUDEDIR}/ssp > + > +.include > diff --git a/include/ssp/ssp.h b/include/ssp/ssp.h > new file mode 100644 > index 000000000000..35a9aeee02df > --- /dev/null > +++ b/include/ssp/ssp.h > @@ -0,0 +1,91 @@ > +/*    $NetBSD: ssp.h,v 1.13 2015/09/03 20:43:47 plunky Exp $    */ > + > +/*- > + * > + * SPDX-License-Identifier: BSD-2-Clause > + * > + * Copyright (c) 2006, 2011 The NetBSD Foundation, Inc. > + * All rights reserved. > + * > + * This code is derived from software contributed to The NetBSD > Foundation > + * by Christos Zoulas. > + * > + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION OR > CONTRIBUTORS > + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, > EXEMPLARY, OR > + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF > + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR > BUSINESS > + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, > WHETHER IN > + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR > OTHERWISE) > + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF > ADVISED OF THE > + * POSSIBILITY OF SUCH DAMAGE. > + */ > +#ifndef _SSP_SSP_H_ > +#define _SSP_SSP_H_ > + > +#include > + > +#if !defined(__cplusplus) > +# if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && \ > +    (__OPTIMIZE__ > 0 || defined(__clang__)) > +#  if _FORTIFY_SOURCE > 1 > +#  define __SSP_FORTIFY_LEVEL 2 > +#  else > +#  define __SSP_FORTIFY_LEVEL 1 > +#  endif > +# else > +#  define __SSP_FORTIFY_LEVEL 0 > +# endif > +#else > +# define __SSP_FORTIFY_LEVEL 0 > +#endif > + > +#define    __ssp_var(type)    __CONCAT(__ssp_ ## type, __COUNTER__) > + > +/* __ssp_real is used by the implementation in libc */ > +#if __SSP_FORTIFY_LEVEL == 0 > +#define __ssp_real_(fun)    fun > +#else > +#define __ssp_real_(fun)    __ssp_real_ ## fun > +#endif > +#define __ssp_real(fun)        __ssp_real_(fun) > + > +#define __ssp_inline static __inline __attribute__((__always_inline__)) > + > +#define __ssp_bos(ptr) __builtin_object_size(ptr, > __SSP_FORTIFY_LEVEL > 1) > +#define __ssp_bos0(ptr) __builtin_object_size(ptr, 0) > + > +#define __ssp_check(buf, len, bos) \ > +    if (bos(buf) != (size_t)-1 && len > bos(buf)) \ > +        __chk_fail() > +#define __ssp_redirect_raw(rtype, fun, symbol, args, call, cond, bos) \ > +rtype __ssp_real_(fun) args __RENAME(symbol); \ > +__ssp_inline rtype fun args __RENAME(__ssp_protected_ ## fun); \ > +__ssp_inline rtype fun args { \ > +    if (cond) \ > +        __ssp_check(__buf, __len, bos); \ > +    return __ssp_real_(fun) call; \ > +} > + > +#define __ssp_redirect(rtype, fun, args, call) \ > +    __ssp_redirect_raw(rtype, fun, fun, args, call, 1, __ssp_bos) > +#define __ssp_redirect0(rtype, fun, args, call) \ > +    __ssp_redirect_raw(rtype, fun, fun, args, call, 1, __ssp_bos0) > + > +__BEGIN_DECLS > +void __stack_chk_fail(void) __dead2; > +void __chk_fail(void) __dead2; > +__END_DECLS > + > +#endif /* _SSP_SSP_H_ */ > diff --git a/include/ssp/stdio.h b/include/ssp/stdio.h > new file mode 100644 > index 000000000000..72e3236eac80 > --- /dev/null > +++ b/include/ssp/stdio.h > @@ -0,0 +1,93 @@ > +/*    $NetBSD: stdio.h,v 1.5 2011/07/17 20:54:34 joerg Exp $    */ > + > +/*- > + * > + * SPDX-License-Identifier: BSD-2-Clause > + * > + * Copyright (c) 2006 The NetBSD Foundation, Inc. > + * All rights reserved. > + * > + * This code is derived from software contributed to The NetBSD > Foundation > + * by Christos Zoulas. > + * > + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION OR > CONTRIBUTORS > + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, > EXEMPLARY, OR > + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF > + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR > BUSINESS > + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, > WHETHER IN > + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR > OTHERWISE) > + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF > ADVISED OF THE > + * POSSIBILITY OF SUCH DAMAGE. > + */ > +#ifndef _SSP_STDIO_H_ > +#define _SSP_STDIO_H_ > + > +#include > + > +__BEGIN_DECLS > +int __sprintf_chk(char *__restrict, int, size_t, const char > *__restrict, ...) > +    __printflike(4, 5); > +int __vsprintf_chk(char *__restrict, int, size_t, const char > *__restrict, > +    __va_list) > +    __printflike(4, 0); > +int __snprintf_chk(char *__restrict, size_t, int, size_t, > +    const char *__restrict, ...) > +    __printflike(5, 6); > +int __vsnprintf_chk(char *__restrict, size_t, int, size_t, > +    const char *__restrict, __va_list) > +    __printflike(5, 0); > +char *__gets_chk(char *, size_t); > +char *__fgets_chk(char *, int, size_t, FILE *); > +__END_DECLS > + > +#if __SSP_FORTIFY_LEVEL > 0 > + > +#define sprintf(str, ...) ({    \ > +    char *_ssp_str = (str);    \ > +    __builtin___sprintf_chk(_ssp_str, 0, __ssp_bos(_ssp_str),        \ > +        __VA_ARGS__); \ > +}) > + > +#define vsprintf(str, fmt, ap) ({    \ > +    char *_ssp_str = (str);        \ > +    __builtin___vsprintf_chk(_ssp_str, 0, __ssp_bos(_ssp_str), > fmt,    \ > +        ap);                \ > +}) > + > +#define snprintf(str, len, ...) ({    \ > +    char *_ssp_str = (str);        \ > +    __builtin___snprintf_chk(_ssp_str, len, 0, > __ssp_bos(_ssp_str),    \ > +        __VA_ARGS__);            \ > +}) > + > +#define vsnprintf(str, len, fmt, ap) ({    \ > +    char *_ssp_str = (str);        \ > +    __builtin___vsnprintf_chk(_ssp_str, len, 0, > __ssp_bos(_ssp_str),    \ > +        fmt, ap);            \ > +}) > + > +#define gets(str) ({            \ > +  char *_ssp_str = (str);        \ > +    __gets_chk(_ssp_str, __ssp_bos(_ssp_str));    \ > +}) > + > +#define fgets(str, len, fp) ({        \ > +    char *_ssp_str = (str);        \ > +    __fgets_chk(_ssp_str, len, __ssp_bos(_ssp_str), fp);    \ > +}) > + > +#endif /* __SSP_FORTIFY_LEVEL > 0 */ > + > +#endif /* _SSP_STDIO_H_ */ > diff --git a/include/ssp/string.h b/include/ssp/string.h > new file mode 100644 > index 000000000000..996020fda778 > --- /dev/null > +++ b/include/ssp/string.h > @@ -0,0 +1,129 @@ > +/*    $NetBSD: string.h,v 1.14 2020/09/05 13:37:59 mrg Exp $    */ > + > +/*- > + * > + * SPDX-License-Identifier: BSD-2-Clause > + * > + * Copyright (c) 2006 The NetBSD Foundation, Inc. > + * All rights reserved. > + * > + * This code is derived from software contributed to The NetBSD > Foundation > + * by Christos Zoulas. > + * > + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION OR > CONTRIBUTORS > + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, > EXEMPLARY, OR > + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF > + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR > BUSINESS > + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, > WHETHER IN > + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR > OTHERWISE) > + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF > ADVISED OF THE > + * POSSIBILITY OF SUCH DAMAGE. > + */ > +#ifndef _SSP_STRING_H_ > +#define _SSP_STRING_H_ > + > +#include > + > +__BEGIN_DECLS > +void *__memcpy_chk(void *, const void *, size_t, size_t); > +void *__memmove_chk(void *, const void *, size_t, size_t); > +void *__memset_chk(void *, int, size_t, size_t); > +char *__stpcpy_chk(char *, const char *, size_t); > +char *__stpncpy_chk(char *, const char *, size_t, size_t); > +char *__strcat_chk(char *, const char *, size_t); > +char *__strcpy_chk(char *, const char *, size_t); > +char *__strncat_chk(char *, const char *, size_t, size_t); > +char *__strncpy_chk(char *, const char *, size_t, size_t); > +__END_DECLS > + > +#if __SSP_FORTIFY_LEVEL > 0 > + > +#define __ssp_bos_check3_typed_var(fun, dsttype, dsrvar, dst, > srctype, srcvar, \ > +    src, lenvar, len) ({                \ > +    srctype srcvar = (src);                \ > +    dsttype dstvar = (dst);                \ > +    size_t lenvar = (len);                \ > +    ((__ssp_bos0(dstvar) != (size_t)-1) ?        \ > +    __builtin___ ## fun ## _chk(dstvar, srcvar, lenvar,    \ > +        __ssp_bos0(dstvar)) :                \ > +    __ ## fun ## _ichk(dstvar, srcvar, lenvar));    \ > +}) > + > +#define __ssp_bos_check3_typed(fun, dsttype, dst, srctype, src, > len)    \ > +    __ssp_bos_check3_typed_var(fun, dsttype, __ssp_var(dstv), dst,    \ > +        srctype, __ssp_var(srcv), src, __ssp_var(lenv), len) > + > +#define __ssp_bos_check3(fun, dst, src, len)        \ > +    __ssp_bos_check3_typed_var(fun, void *, __ssp_var(dstv), dst,    \ > +        const void *, __ssp_var(srcv), src, __ssp_var(lenv), len) > + > +#define __ssp_bos_check2_var(fun, dstvar, dst, srcvar, src) ({        \ > +    const void *srcvar = (src);                \ > +    void *dstvar = (dst);                \ > +    ((__ssp_bos0(dstvar) != (size_t)-1) ?        \ > +    __builtin___ ## fun ## _chk(dstvar, srcvar,        \ > +        __ssp_bos0(dstvar)) :                \ > +    __ ## fun ## _ichk(dstvar, srcvar));        \ > +}) > + > +#define __ssp_bos_check2(fun, dst, src)            \ > +    __ssp_bos_check2_var(fun, __ssp_var(dstv), dst, > __ssp_var(srcv), src) > + > +#define __ssp_bos_icheck3_restrict(fun, type1, type2) \ > +static __inline type1 __ ## fun ## _ichk(type1 __restrict, type2 > __restrict, size_t); \ > +static __inline __attribute__((__always_inline__)) type1 \ > +__ ## fun ## _ichk(type1 __restrict dst, type2 __restrict src, > size_t len) { \ > +    return __builtin___ ## fun ## _chk(dst, src, len, > __ssp_bos0(dst)); \ > +} > + > +#define __ssp_bos_icheck3(fun, type1, type2) \ > +static __inline type1 __ ## fun ## _ichk(type1, type2, size_t); \ > +static __inline __attribute__((__always_inline__)) type1 \ > +__ ## fun ## _ichk(type1 dst, type2 src, size_t len) { \ > +    return __builtin___ ## fun ## _chk(dst, src, len, > __ssp_bos0(dst)); \ > +} > + > +#define __ssp_bos_icheck2_restrict(fun, type1, type2) \ > +static __inline type1 __ ## fun ## _ichk(type1, type2); \ > +static __inline __attribute__((__always_inline__)) type1 \ > +__ ## fun ## _ichk(type1 __restrict dst, type2 __restrict src) { \ > +    return __builtin___ ## fun ## _chk(dst, src, __ssp_bos0(dst)); \ > +} > + > +__BEGIN_DECLS > +__ssp_bos_icheck3_restrict(memcpy, void *, const void *) > +__ssp_bos_icheck3(memmove, void *, const void *) > +__ssp_bos_icheck3(memset, void *, int) > +__ssp_bos_icheck2_restrict(stpcpy, char *, const char *) > +__ssp_bos_icheck3_restrict(stpncpy, char *, const char *) > +__ssp_bos_icheck2_restrict(strcpy, char *, const char *) > +__ssp_bos_icheck2_restrict(strcat, char *, const char *) > +__ssp_bos_icheck3_restrict(strncpy, char *, const char *) > +__ssp_bos_icheck3_restrict(strncat, char *, const char *) > +__END_DECLS > + > +#define memcpy(dst, src, len) __ssp_bos_check3(memcpy, dst, src, len) > +#define memmove(dst, src, len) __ssp_bos_check3(memmove, dst, src, len) > +#define memset(dst, val, len) \ > +    __ssp_bos_check3_typed(memset, void *, dst, int, val, len) > +#define stpcpy(dst, src) __ssp_bos_check2(stpcpy, dst, src) > +#define stpncpy(dst, src, len) __ssp_bos_check3(stpncpy, dst, src, len) > +#define strcpy(dst, src) __ssp_bos_check2(strcpy, dst, src) > +#define strcat(dst, src) __ssp_bos_check2(strcat, dst, src) > +#define strncpy(dst, src, len) __ssp_bos_check3(strncpy, dst, src, len) > +#define strncat(dst, src, len) __ssp_bos_check3(strncat, dst, src, len) > + > +#endif /* __SSP_FORTIFY_LEVEL > 0 */ > +#endif /* _SSP_STRING_H_ */ > diff --git a/include/ssp/strings.h b/include/ssp/strings.h > new file mode 100644 > index 000000000000..06c9c7cc0a09 > --- /dev/null > +++ b/include/ssp/strings.h > @@ -0,0 +1,67 @@ > +/*    $NetBSD: strings.h,v 1.3 2008/04/28 20:22:54 martin Exp $    */ > + > +/*- > + * > + * SPDX-License-Identifier: BSD-2-Clause > + * > + * Copyright (c) 2007 The NetBSD Foundation, Inc. > + * All rights reserved. > + * > + * This code is derived from software contributed to The NetBSD > Foundation > + * by Christos Zoulas. > + * > + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION OR > CONTRIBUTORS > + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, > EXEMPLARY, OR > + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF > + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR > BUSINESS > + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, > WHETHER IN > + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR > OTHERWISE) > + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF > ADVISED OF THE > + * POSSIBILITY OF SUCH DAMAGE. > + */ > +#ifndef _SSP_STRINGS_H_ > +#define _SSP_STRINGS_H_ > + > +#include > +#include > + > +#if __SSP_FORTIFY_LEVEL > 0 > + > +#define _ssp_bcopy(srcvar, src, dstvar, dst, lenvar,  len) ({    \ > +    const void *srcvar = (src);            \ > +    void *dstvar = (dst);            \ > +    size_t lenvar = (len);            \ > +    ((__ssp_bos0(dstvar) != (size_t)-1) ?    \ > +    __builtin___memmove_chk(dstvar, srcvar, lenvar,    \ > +        __ssp_bos0(dstvar)) :            \ > +    __memmove_ichk(dstvar, srcvar, lenvar));    \ > +}) > + > +#define    bcopy(src, dst, len)            \ > +    _ssp_bcopy(__ssp_var(srcv), src, __ssp_var(dstv), dst, > __ssp_var(lenv), len) > + > +#define _ssp_bzero(dstvar, dst, lenvar, len) ({        \ > +    void *dstvar = (dst);            \ > +    size_t lenvar = (len);            \ > +    ((__ssp_bos0(dstvar) != (size_t)-1) ?    \ > +    __builtin___memset_chk(dstvar, 0, lenvar,    \ > +        __ssp_bos0(dstvar)) : \ > +    __memset_ichk(dstvar, 0, lenvar));        \ > +}) > + > +#define    bzero(dst, len)    _ssp_bzero(__ssp_var(dstv), dst, > __ssp_var(lenv), len) > + > +#endif /* __SSP_FORTIFY_LEVEL > 0 */ > +#endif /* _SSP_STRINGS_H_ */ > diff --git a/include/ssp/unistd.h b/include/ssp/unistd.h > new file mode 100644 > index 000000000000..2414e2baa96b > --- /dev/null > +++ b/include/ssp/unistd.h > @@ -0,0 +1,54 @@ > +/*    $NetBSD: unistd.h,v 1.7 2015/06/25 18:41:03 joerg Exp $    */ > + > +/*- > + * > + * SPDX-License-Identifier: BSD-2-Clause > + * > + * Copyright (c) 2006 The NetBSD Foundation, Inc. > + * All rights reserved. > + * > + * This code is derived from software contributed to The NetBSD > Foundation > + * by Christos Zoulas. > + * > + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION OR > CONTRIBUTORS > + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, > EXEMPLARY, OR > + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF > + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR > BUSINESS > + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, > WHETHER IN > + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR > OTHERWISE) > + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF > ADVISED OF THE > + * POSSIBILITY OF SUCH DAMAGE. > + */ > +#ifndef _SSP_UNISTD_H_ > +#define _SSP_UNISTD_H_ > + > +#include > + > +#if __SSP_FORTIFY_LEVEL > 0 > +__BEGIN_DECLS > + > +__ssp_redirect0(ssize_t, read, (int __fd, void *__buf, size_t __len), \ > +    (__fd, __buf, __len)); > + > +__ssp_redirect(ssize_t, readlink, (const char *__restrict __path, \ > +    char *__restrict __buf, size_t __len), (__path, __buf, __len)); > + > +__ssp_redirect_raw(char *, getcwd, getcwd, (char *__buf, size_t __len), > +    (__buf, __len), __buf != 0, __ssp_bos); > + > +__END_DECLS > + > +#endif /* __SSP_FORTIFY_LEVEL > 0 */ > +#endif /* _SSP_UNISTD_H_ */ > diff --git a/lib/libc/secure/Makefile.inc b/lib/libc/secure/Makefile.inc > index 8574c5a05dc5..3b1ad879c715 100644 > --- a/lib/libc/secure/Makefile.inc > +++ b/lib/libc/secure/Makefile.inc > @@ -3,6 +3,17 @@ > > .PATH: ${LIBC_SRCTOP}/secure > > +# _FORTIFY_SOURCE > +SRCS+=    gets_chk.c fgets_chk.c memcpy_chk.c memmove_chk.c > memset_chk.c \ > +    snprintf_chk.c sprintf_chk.c stpcpy_chk.c stpncpy_chk.c \ > +    strcat_chk.c strcpy_chk.c strncat_chk.c strncpy_chk.c \ > +    vsnprintf_chk.c vsprintf_chk.c > + > +CFLAGS.snprintf_chk.c+=    -Wno-unused-parameter > +CFLAGS.sprintf_chk.c+=    -Wno-unused-parameter > +CFLAGS.vsnprintf_chk.c+=    -Wno-unused-parameter > +CFLAGS.vsprintf_chk.c+=    -Wno-unused-parameter > + > # Sources common to both syscall interfaces: > SRCS+=    stack_protector.c \ >     stack_protector_compat.c > diff --git a/lib/libc/secure/Symbol.map b/lib/libc/secure/Symbol.map > index 641f451b5421..7859fcee3821 100644 > --- a/lib/libc/secure/Symbol.map > +++ b/lib/libc/secure/Symbol.map > @@ -3,3 +3,21 @@ FBSD_1.0 { >     __stack_chk_fail; >     __stack_chk_guard; > }; > + > +FBSD_1.8 { > +    __gets_chk; > +    __fgets_chk; > +    __memcpy_chk; > +    __memmove_chk; > +    __memset_chk; > +    __snprintf_chk; > +    __sprintf_chk; > +    __stpcpy_chk; > +    __stpncpy_chk; > +    __strcat_chk; > +    __strcpy_chk; > +    __strncat_chk; > +    __strncpy_chk; > +    __vsnprintf_chk; > +    __vsprintf_chk; > +}; > diff --git a/lib/libc/secure/fgets_chk.c b/lib/libc/secure/fgets_chk.c > new file mode 100644 > index 000000000000..72aa1d816ce1 > --- /dev/null > +++ b/lib/libc/secure/fgets_chk.c > @@ -0,0 +1,54 @@ > +/*- > + * > + * SPDX-License-Identifier: BSD-2-Clause > + * > + * Copyright (c) 2006 The NetBSD Foundation, Inc. > + * All rights reserved. > + * > + * This code is derived from software contributed to The NetBSD > Foundation > + * by Christos Zoulas. > + * > + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 > +__RCSID("$NetBSD: fgets_chk.c,v 1.6 2009/02/05 05:41:51 lukem Exp $"); > + > +#include > +#include > +#include > +#include > + > +#include > +#include > +#undef fgets > + > +char * > +__fgets_chk(char * __restrict buf, int len, size_t slen, FILE *fp) > +{ > +    if (slen >= (size_t)INT_MAX) > +        return (fgets(buf, len, fp)); > + > +    if (len >= 0 && (size_t)len > slen) > +        __chk_fail(); > + > +    return (fgets(buf, len, fp)); > +} > diff --git a/lib/libc/secure/gets_chk.c b/lib/libc/secure/gets_chk.c > new file mode 100644 > index 000000000000..18c1e2d18f43 > --- /dev/null > +++ b/lib/libc/secure/gets_chk.c > @@ -0,0 +1,74 @@ > +/*- > + * > + * SPDX-License-Identifier: BSD-2-Clause > + * > + * Copyright (c) 2006 The NetBSD Foundation, Inc. > + * All rights reserved. > + * > + * This code is derived from software contributed to The NetBSD > Foundation > + * by Christos Zoulas. > + * > + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 > +__RCSID("$NetBSD: gets_chk.c,v 1.7 2013/10/04 20:49:16 christos Exp > $"); > + > +#include > +#include > +#include > +#include > + > +#include > +#include > + > +char *__gets_unsafe(char *); > + > +char * > +__gets_chk(char * __restrict buf, size_t slen) > +{ > +    char *abuf; > +    size_t len; > + > +    if (slen >= (size_t)INT_MAX) > +        return (__gets_unsafe(buf)); > + > +    if ((abuf = malloc(slen + 1)) == NULL) > +        return (__gets_unsafe(buf)); > + > +    if (fgets(abuf, (int)(slen + 1), stdin) == NULL) { > +        free(abuf); > +        return (NULL); > +    } > + > +    len = strlen(abuf); > +    if (len > 0 && abuf[len - 1] == '\n') > +        --len; > + > +    if (len >= slen) > +        __chk_fail(); > + > +    (void)memcpy(buf, abuf, len); > + > +    buf[len] = '\0'; > +    free(abuf); > +    return (buf); > +} > diff --git a/lib/libc/secure/memcpy_chk.c b/lib/libc/secure/memcpy_chk.c > new file mode 100644 > index 000000000000..99cf2d5f13ff > --- /dev/null > +++ b/lib/libc/secure/memcpy_chk.c > @@ -0,0 +1,53 @@ > +/*- > + * > + * SPDX-License-Identifier: BSD-2-Clause > + * > + * Copyright (c) 2006 The NetBSD Foundation, Inc. > + * All rights reserved. > + * > + * This code is derived from software contributed to The NetBSD > Foundation > + * by Christos Zoulas. > + * > + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 > +__RCSID("$NetBSD: memcpy_chk.c,v 1.7 2015/05/13 19:57:16 joerg Exp $"); > + > +#include > + > +#include > +#undef memcpy > + > +#include "ssp_internal.h" > + > +void * > +__memcpy_chk(void * __restrict dst, const void * __restrict src, > size_t len, > +    size_t slen) > +{ > +    if (len > slen) > +        __chk_fail(); > + > +    if (__ssp_overlap((const char *)src, (const char *)dst, len)) > +        __chk_fail(); > + > +    return (memcpy(dst, src, len)); > +} > diff --git a/lib/libc/secure/memmove_chk.c > b/lib/libc/secure/memmove_chk.c > new file mode 100644 > index 000000000000..07f965d608fc > --- /dev/null > +++ b/lib/libc/secure/memmove_chk.c > @@ -0,0 +1,47 @@ > +/*- > + * > + * SPDX-License-Identifier: BSD-2-Clause > + * > + * Copyright (c) 2006 The NetBSD Foundation, Inc. > + * All rights reserved. > + * > + * This code is derived from software contributed to The NetBSD > Foundation > + * by Christos Zoulas. > + * > + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 > +__RCSID("$NetBSD: memmove_chk.c,v 1.6 2020/09/05 13:37:59 mrg Exp $"); > + > +#include > + > +#include > +#undef memmove > + > +void * > +__memmove_chk(void *dst, const void *src, size_t len, > +    size_t slen) > +{ > +    if (len > slen) > +        __chk_fail(); > +    return (memmove(dst, src, len)); > +} > diff --git a/lib/libc/secure/memset_chk.c b/lib/libc/secure/memset_chk.c > new file mode 100644 > index 000000000000..f337be98b46d > --- /dev/null > +++ b/lib/libc/secure/memset_chk.c > @@ -0,0 +1,46 @@ > +/*- > + * > + * SPDX-License-Identifier: BSD-2-Clause > + * > + * Copyright (c) 2006 The NetBSD Foundation, Inc. > + * All rights reserved. > + * > + * This code is derived from software contributed to The NetBSD > Foundation > + * by Christos Zoulas. > + * > + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 > +__RCSID("$NetBSD: memset_chk.c,v 1.5 2014/09/17 00:39:28 joerg Exp $"); > + > +#include > + > +#include > +#undef memset > + > +void * > +__memset_chk(void * __restrict dst, int val, size_t len, size_t slen) > +{ > +    if (len > slen) > +        __chk_fail(); > +    return (memset(dst, val, len)); > +} > diff --git a/lib/libc/secure/snprintf_chk.c > b/lib/libc/secure/snprintf_chk.c > new file mode 100644 > index 000000000000..52ef874ede5b > --- /dev/null > +++ b/lib/libc/secure/snprintf_chk.c > @@ -0,0 +1,56 @@ > +/*- > + * > + * SPDX-License-Identifier: BSD-2-Clause > + * > + * Copyright (c) 2006 The NetBSD Foundation, Inc. > + * All rights reserved. > + * > + * This code is derived from software contributed to The NetBSD > Foundation > + * by Christos Zoulas. > + * > + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 > +__RCSID("$NetBSD: snprintf_chk.c,v 1.5 2008/04/28 20:23:00 martin > Exp $"); > + > +#include > +#include > + > +#include > +#undef vsnprintf > + > +int > +__snprintf_chk(char * __restrict buf, size_t len, int flags, size_t > slen, > +    const char * __restrict fmt, ...) > +{ > +    va_list ap; > +    int rv; > + > +    if (len > slen) > +        __chk_fail(); > + > +    va_start(ap, fmt); > +    rv = vsnprintf(buf, len, fmt, ap); > +    va_end(ap); > + > +    return (rv); > +} > diff --git a/lib/libc/secure/sprintf_chk.c > b/lib/libc/secure/sprintf_chk.c > new file mode 100644 > index 000000000000..d4c42ccba3ce > --- /dev/null > +++ b/lib/libc/secure/sprintf_chk.c > @@ -0,0 +1,61 @@ > +/*- > + * > + * SPDX-License-Identifier: BSD-2-Clause > + * > + * Copyright (c) 2006 The NetBSD Foundation, Inc. > + * All rights reserved. > + * > + * This code is derived from software contributed to The NetBSD > Foundation > *** 1063 LINES SKIPPED *** > > From nobody Sun May 19 02:17:34 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vhkqk2mDyz5KVWk for ; Sun, 19 May 2024 02:17:38 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vhkqk0vV8z4MxV for ; Sun, 19 May 2024 02:17:38 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Authentication-Results: mx1.freebsd.org; none Received: by mail-io1-xd33.google.com with SMTP id ca18e2360f4ac-7e21e11f36bso84246839f.0 for ; Sat, 18 May 2024 19:17:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; t=1716085056; x=1716689856; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=5oGMAqZ8Yv4NWFuvUVLk2TtW7ANG4dGw74Ktu4bUdNY=; b=ZHznsjE75dbpwryJXGK21uG/YdmTSM32H8oNO8eMd3h3zJmOU5Ckwz5tyCvgrgYzsH wUcfDhHSzgqLho7VqcNYQPv1YnP1gEbbLjSssH7k3jr2iJjyKHUfulvMqh+mPG1u0wYH NGFCzQ7F18Wi3H+mef75stu6l/Rn28AAINHbBDWGn9chS78mNefqLFJgxOQDNIJCTIzH uFBtV9Fj9NF8o0HQuJnN8iS1J216BqkIElISkhuxceV0PuWweSqTqeuLVW0YbtcS7M+u blwExQbM5PS1uWLayJU1FCXjorUZhrwdxEjZw1OkwoZ1omh4VNWFDbZK3N4EOC8izbv+ TLAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716085056; x=1716689856; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=5oGMAqZ8Yv4NWFuvUVLk2TtW7ANG4dGw74Ktu4bUdNY=; b=j1qnzXqKlgFYXmAwx+tbOc72bPmhZ3ta8vDoH0XRhkWUpLNCsG/C1Gsg3FkBFGz+3l ClEq8Mwt0KcxtS4Iqp36O05O5WVL/mlv/ld+t3aI2gjWKiC0QQeotq7FUv7kHXy+aNZB zBRAPBmL5tmOYIMwzkP5HpmFdb/Uy4CRmQY7rX/v11333hE1xdjs99CL74zJHMI5Z1Dt pZzR7+htzWFZWuhjVBdujJCUrCXwDN8H+aiOCVv2A8NENB9HYVr4+mxOajeo16VKfI26 YyCGZVk93XsqkLpEzyWbPm3q6e/QDfTCGEfnncO2ajcJUowPRrBO2ZQ7TQbQqRXv3Or3 v6Mg== X-Forwarded-Encrypted: i=1; AJvYcCXUZK6bdcIsHDC3maR4PcLqvhko1nRYbvNqjPvQxWrer/NT3hfiFO93+QRzYFliD8R8OcM1hjTArHJRqXWTrdbYHLiBDoDDW5Bv4qipliJL X-Gm-Message-State: AOJu0Yyg+YqkTWtR/Dl0QkcsZLHkZcmzHj8IiaEeDFB4RlgZtBSSFu9Z aYXht2KeNcRB1Yjknii5wacTrGWdtLGzibGcetzgNfcc00wfkjU0/hcn3UuMgQQ= X-Google-Smtp-Source: AGHT+IFIAmUXGQBEJIcIqcS6G4dEE0/oBLksafspcSWVfbZQsmrCrkco088uUF0FBT+L80gK5TsnHw== X-Received: by 2002:a6b:f812:0:b0:7e2:1e0:3352 with SMTP id ca18e2360f4ac-7e201e033c9mr1408658339f.9.1716085056563; Sat, 18 May 2024 19:17:36 -0700 (PDT) Received: from mutt-hbsd ([184.99.37.29]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4893701155bsm5352630173.31.2024.05.18.19.17.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 May 2024 19:17:35 -0700 (PDT) Date: Sun, 19 May 2024 02:17:34 +0000 From: Shawn Webb To: Kyle Evans Cc: Pedro Giffuni , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: be04fec42638 - main - Import _FORTIFY_SOURCE implementation from NetBSD Message-ID: X-Operating-System: FreeBSD mutt-hbsd 15.0-CURRENT-HBSD FreeBSD 15.0-CURRENT-HBSD X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <02326b5e-a1fe-4411-a869-d21f9a76130c@email.android.com> <999469960.1638478.1716080957814@mail.yahoo.com> <6276b721-6c7b-41cd-9d1b-4169e86ec5e9@FreeBSD.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="66ccod2zjktdeno2" Content-Disposition: inline In-Reply-To: <6276b721-6c7b-41cd-9d1b-4169e86ec5e9@FreeBSD.org> X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4Vhkqk0vV8z4MxV --66ccod2zjktdeno2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, May 18, 2024 at 09:08:48PM -0500, Kyle Evans wrote: >=20 >=20 > On 5/18/24 20:09, Pedro Giffuni wrote: > > (sorry for top posting .. my mailer just sucks) > > Hi; > >=20 > > I used to like the limited static checking FORTIFY_SOURCE provides and > > when I ran it over FreeBSD it did find a couple of minor issues. It only > > works for GCC though. > >=20 >=20 > I don't think this is particularly true anymore; I haven't found a case y= et > where __builtin_object_size(3) doesn't give me the correct size while GCC > did. I'd welcome counter-examples here, though -- we have funding to both > finish the project (widen the _FORTIFY_SOURCE net to more of libc/libsys) > and add tests to demonstrate that it's both functional and correct. It > would be useful to also document deficiencies in the tests. >=20 > > I guess it doesn't really hurt to have FORTIFY_SOURCE around and NetBSD > > had the least intrusive implementation the last time I checked but I > > would certainly request it should never be activated by default, > > specially with clang. The GCC version has seen more development on glibc > > but I still think its a dead end. > >=20 >=20 > I don't see a compelling reason to avoid enabling it by default; see abov= e, > the functionality that we need in clang appears to be just fine (and, iir= c, > was also fine when I checked at the beginning of working on this in 2021) > and it provides useful >=20 > > What I would like to see working on FreeBSD is Safestack as a > > replacement for the stack protector, which we were so very slow to adopt > > even when it was originally developed in FreeBSD. I think other projects > > based on FreeBSD (Chimera and hardenedBSD) have been using it but I > > don't know the details. > >=20 >=20 > No comment there, though I think Shawn Webb / HardenedBSD had been playing > around with SafeStack (and might have enabled it? I haven't actually look= ed > in a while now). =20 HardenedBSD has enabled SafeStack for userland applications and base and a few ports. HardenedBSD uses -fstack-protector-all. I don't see _FORTIFY_SOURCE, SafeStack, and SSP as mutually exclusive. In fact, I view all three as complementary. _FORTIFY_SOURCE can have a much wider reach than SafeStack at the moment. SafeStack cannot be applied to shared objects, only dynamically-loaded executables (ELF ET_DYN and ET_EXEC). SafeStack relies on both ASLR and W^X for efficacy. SafeStack cannot be used with setjmp/longjmp. I would like to see SafeStack reach completion and have made attempts in the past to help push the needle in that direction. We need explicit support in the RTLD and libc in order to apply it to libraries. Additionally, we would like to apply it to statically-linked binaries. Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Tor-ified Signal: +1 303-901-1600 / shawn_webb_opsec.50 https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --66ccod2zjktdeno2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmZJYSgACgkQ/y5nonf4 4foEuQ//SqRetIhK6PGoaW1c11RZxy6aauHMpXnab1QWn+Lfm45jiwctkCw38oDz YEzN3iWXBof/7VyUdFC0dk4U7xT3s1DEmQYasWV3yhOp+9WLffWSsFHXP0H1uxiK Obvb8EhJ9DqMWkc20owofHxro2dnHgdG/15r13irdEW9McgeDiVZ+sjqdlJa0ahJ RP78qfiINmruN91sdKVS5K+qJjl43CFnaTd4AzxZpdyjPR8feH12CJCWzZH2xijW DZZ9fIhlJ02++GPCWoiJxuIXSC8EFYn11vTHxYGNUXosVN3F28V5eDpNRMwQ7cDY HCV8DF7HsFNjnliP+fEddrUd6BHYKmbXLZ1tHxDMw/TOkQF8e9eHkcuou9+zrFY+ Jk7A9Gx8GaKLRV0k3WhDBFl+55L99Pl6Rrn+IEoAkBrn/B3mbhGYDGgMcGXBsHg/ jdwqLetePTXlmatxNmIYeTwQf7sXntzD2CO4BJhASvoQPW6KYlfPWZlBBuJSqMbO eR/fuKoQErs+j9TESx9XV/PL/Ip0op7rOThm6S51p9EAUXKL3ZBSGk6T1vtKBS+V brrfH6TwtS8hGB7aDy//2JSXuPmhgzD/YtS1TSGNRiwC5v9T5PYBAvmtoo082mz6 dt/oN9B1JYsI+tNXSzhhojbso8MATvH2OTkb+jKRpgkqzKBNCFA= =qMV8 -----END PGP SIGNATURE----- --66ccod2zjktdeno2-- From nobody Sun May 19 04:39:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vhp156G8Hz5KjSd for ; Sun, 19 May 2024 04:40:57 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from sonic312-25.consmr.mail.ne1.yahoo.com (sonic312-25.consmr.mail.ne1.yahoo.com [66.163.191.206]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vhp150FPJz4YRL for ; Sun, 19 May 2024 04:40:57 +0000 (UTC) (envelope-from pfg@freebsd.org) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1716093655; bh=TfLtg4OGpel4SvEehvOlCRMjTVrEhG9LJ11EqL30rsM=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From:Subject:Reply-To; b=BjpvR3QPwttefICEgAFErgtc8voVumOmmILJjFs/FJNYf192DZBcvABecr+UL6Mb0y5HZiOGuInK7fJ/IU5wZGStp7cxZH8gR2Z34PgrsMTb04BKlhZCRFYMNsKkPwPKhBVQ90K3i8fuL6FkrjmYBxE5mHrwbZViEStqA7Vcp27Ytbq2mzTOMc3aBiZCtAAW4qOB6jlLTBbTuamz9gKSpvRkXVOrE85E9OEfTmlfQ/HBC9uwEyXVsYlNrx3ZA11vnyL6zg413vB2qOG/ShxNv/F/9Dz7P82w57tQwzM4I2tQatZNkDr6rNC6XKherNJ7cUncsqmGQuhS2pZ/97BGuQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1716093655; bh=KeEYwaL0r34LTfYnO3TiL1JIGLMcNlCIgcZFOdEBS1U=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=U2NQevDAgpkgM4evZLYKOiNRSPY13gt2qcdCx7vBiS4LqjWKWvEWoZ0ei6JzUQGZ8yLdAOlTNqZcxMp/iNE+CI2DYjvsVD8qWl/rCMiTYWZN0725O5CTITd+5kkOdlRno0niZJ7yd9xhN+ycuITTL9NN7qvUDK/KSlXLnCQ7mQOAQLwFMX//Kw3PGoP3asCCtUz18SCLCCHgEc6G0NwEdd6sIYC0/2jb7L0ZIhpAkGVij0GGcLmy0aAGivVOwW0gLI4QBKnbS0ZnPDJ00jzZQZVmf6IILbUavq6PgnmBHXW5U5y9t3jllr7jRxSQPXcSsPq9O3SryvfKams9tmBh+g== X-YMail-OSG: NfHQxPkVM1lyWSbxTLcy5WjLovkUrES3884IrIcKeD9lCPGUN4mwhCYrY5xaQVs 9RKea8AcaTUSYPbQmzK423cIg0U5FgHx6_3VWWom5d0waA9DbBPgysz81ZHfSQtn3RM3Rnn0gtAe bolesal9I2A2tbm.qFO_uBH7zia4ROpX8EHVLRalqEjYeKkVhNHBzxKpk1mgQ3hN5938i7UDySod glfBhoglaLQ29rBwWhq8TXm49IRoDp8DLpws78sg3tFFoy4wbxfKTaeeaRCf7MeD9XNdGgwLG4KH IFmbJQoGoI3S2FTan0OHkzZS6Ac465TJFRzOv1AE6Hr4ydA2dOwEXZ4RRAheiKtLKmY4Eig0.3oY YplBW0T2.IhT9aVtXu8U7_lL5lu_U36sdRrS2L0dCJyIYOuOAIAjyDNZ5eigKKHSHqd9_.uyuHDB Vvd74abRKb1SGS6goxp90vkabK4TwTOtidtWncXxuUlVfDeXwaPFpP4BDxPw.7VwSitXmGGzDqAW m31RJBbcS4_LMYc1k5Zk26IRqiuQ6Q2oB_WePlo5xnG8ozrYWgLTbUW3eoZzGUPkoygCodKwNynG xl_k.1vnBjyBOFzqfOzcNMVJW3QVr7Xhs0lyekT7Vhfp0fp8Oxp3FlraUuz5RkNmns6DrOnXdQVE zeVkxnxccY_9QMNK5KZNJZGcLa9xLZL9pSx.4HLmEAmCmQZkC04zsUxYJRpi_okSYhEuignDS6Bq pBf.VI0NULNInLnnOFhhtiPIVuBftvsLRAwUC7C6OPTQwVbCIiJfGboiKFaioA4DiG2VJoLZ4mx8 9NQiYvIx4p_JHBVof7XRvmfTHofnxkONMfyeUc5aLEiHBdPfuMHYXNunJbyRjdEsHKccKrIToCzL 7Vo28em78YHgmV6x4oQvzFOJi5QNckotjzTWnBpcBIvwxa4jrh.eXWZP9IiY93.SBpu4u1eEw5G8 ceWnrsrRufDHeCfJfHLLpSwDVA8w7aiHcmYTsWb8dxi7uaWp39GS2iLM2dqL_8KdBLIrqk14xVju ZlzuP2Fw2LJVQh9ublzYWRI3Wp.J79V_7W43Ozh7.79h5Jn.X.wrlE9B6pe7H3kc4jLW8pYMRgMA ofZ5oxnBeKjOVSuBp92crHapEYRntqMqIsQKxAmtKysDPDibJ7ahOQ.wWFu2hg94JoxJlQOwGM8C quCN5sw4OORJqalnky0IqSR6Ia.uAXB4YWBkxSobp9cIVMENW5dfsO6DEN3gw_Z4LocTLZGIaLVL zpnCWIr2pi4qArT8d6r62RQXfgjNGoXo9Y4gcv.eVIl2fUy1kBG3AJGKBsEYdrVtlmzYIcg73xK_ y.Uzuo9gQbUVxt9TWjKAHj7npc0X0pwAb2FwI8meYl_4mZN_SRSsyTnBxKeN8dKBrHkM70QFGC.p nsZEaTEbYKvlXRTPDIPW2NWXuwWQaMcGEQNDYtnxa2lp2fq67dJTzUW6Uc9M.HHUsWHNC7rBjEn4 ze.Imto301kH.VNuR6GNzyAvoF3W9ch9vu7wOsI9RK4ZVYruU7Yr0T1XGwr8NLk30P3KRrREXrC_ wmTicFwKYoMNZUnOQsmWChcEFT9CQvu8aIJtYX68Has0V5qyVgfO1E2_RC6nRxELLLWNjpngmKfv kZL2L.II4p0OrFQ25AxaI__Lz3Z5r1yWiFlKsYdrTIlKCHxWfirxQ2iRSLnxmjuaVZh5f4f33yzW YGggKHU5gfO_NFcYV.1Fr6W0Xuebzu1g8pIu248iu_Gn1_epsB6ZWkg7c1F2pH1SHnq.df4i8RTH PwPsMRBIAby9Ds0tjdTiSYEBlNyGsjrUtBDEWlkzSGu9rirJYO_JJCBw3gq7b_jIwEzs4icq9LYQ K8sUUcKvkZNDywd_Ar4nymtCuhZoJhBQES4vuCSBSiEMTXeC150lAd.M5atty3egyQ4HBPsPunWv HPE6aiZVVVdeBCI5A4YaEgwizbRU0wT4FwpJyNl2aEOpRZldCms5PUZeOTxOY40ZV9E_g7tPuNpt MyvTf7i.p4V4h9cVyh9ANVzfyc8gWdAB0Uv1uspM7WTJojZVB7PU4I89IhJCJv7c4efynbUGUrKf o4WyVYXcXDoCoHN4fCfHLkPo01WmzBZNsaYnS42PuRWMWK6JXIGbpN4nvihYW9p1qGgif8TILdYa eEgugXE4.cg_4kTH68LfbRYSq9m5nno5MqNG7aDwrTlting-- X-Sonic-MF: X-Sonic-ID: 48b962ac-1ce0-4092-8985-2219a3a1900a Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.ne1.yahoo.com with HTTP; Sun, 19 May 2024 04:40:55 +0000 Date: Sun, 19 May 2024 04:39:59 +0000 (UTC) From: Pedro Giffuni To: Kyle Evans Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Message-ID: <1413980952.1357400.1716093599901@mail.yahoo.com> In-Reply-To: <6276b721-6c7b-41cd-9d1b-4169e86ec5e9@FreeBSD.org> References: <02326b5e-a1fe-4411-a869-d21f9a76130c@email.android.com> <999469960.1638478.1716080957814@mail.yahoo.com> <6276b721-6c7b-41cd-9d1b-4169e86ec5e9@FreeBSD.org> Subject: Re: git: be04fec42638 - main - Import _FORTIFY_SOURCE implementation from NetBSD List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1357399_2058372477.1716093599883" X-Mailer: WebService/1.1.22356 YMailNorrin X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36646, ipnet:66.163.184.0/21, country:US] X-Rspamd-Queue-Id: 4Vhp150FPJz4YRL ------=_Part_1357399_2058372477.1716093599883 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable FWIW .. and let me be clear I haven't worked on this in ages and I am not = planning to retake this either... clang just couldn't do the static=C2=A0 fortify_source checks=C2=A0 due to = the way llvm uses an intermediate representation; the size just couldn't be= handled in the preprocessor. Google did spend some time adding extra attri= butes to clang to improve the debugging and you can see that implemented in= bionic libc but that was it. musl didn't even try. fortify_source does replace some key libc functions with memory checking al= ternatives and that turns out to be annoying when debugging. In a way it br= eaks that principle C programmers once had, where developers are expected t= o know what they are doing, and if the error is caught at runtime by the st= ack protector anyways it ends up being redundant. One more thing about the static checks. Most of the linux distributions out= there indeed have built their software packages with GCC and fortify_sourc= e >=3D2. As a consequence, when we ran an exp-run on the ports tree (with G= CC), fortify_source didn't find anything: it was basically a waste of time. Another reason for not setting it by default is performance. And here I ans= wer Shawn's comment on why not enable stack-protector-all and safestack and= fortify_source at the same time: running unnecessary checks over and over = again wastes energy and can have some performance hit. The later may seem n= egligible in modern processors, but why do them if they bring no benefit? (= No need to answer ... just left as food for thought) Pedro. On Saturday, May 18, 2024 at 09:08:52 PM GMT-5, Kyle Evans wrote: =20 =20 =20 On 5/18/24 20:09, Pedro Giffuni wrote: > (sorry for top posting .. my mailer just sucks) > Hi; >=20 > I used to like the limited static checking FORTIFY_SOURCE provides and=20 > when I ran it over FreeBSD it did find a couple of minor issues. It only= =20 > works for GCC though. >=20 I don't think this is particularly true anymore; I haven't found a case=20 yet where __builtin_object_size(3) doesn't give me the correct size=20 while GCC did.=C2=A0 I'd welcome counter-examples here, though -- we have= =20 funding to both finish the project (widen the _FORTIFY_SOURCE net to=20 more of libc/libsys) and add tests to demonstrate that it's both=20 functional and correct.=C2=A0 It would be useful to also document=20 deficiencies in the tests. > I guess it doesn't really hurt to have FORTIFY_SOURCE around and NetBSD= =20 > had the least intrusive implementation the last time I checked but I=20 > would certainly request it should never be activated by default,=20 > specially with clang. The GCC version has seen more development on glibc= =20 > but I still think its a dead end. >=20 I don't see a compelling reason to avoid enabling it by default; see=20 above, the functionality that we need in clang appears to be just fine=20 (and, iirc, was also fine when I checked at the beginning of working on=20 this in 2021) and it provides useful > What I would like to see working on FreeBSD is Safestack as a=20 > replacement for the stack protector, which we were so very slow to adopt= =20 > even when it was originally developed in FreeBSD. I think other projects= =20 > based on FreeBSD (Chimera and hardenedBSD) have been using it but I=20 > don't know the details. >=20 No comment there, though I think Shawn Webb / HardenedBSD had been=20 playing around with SafeStack (and might have enabled it? I haven't=20 actually looked in a while now). > This is just all my $0.02 >=20 > Pedro. Thanks, Kyle Evans >=20 > On Saturday, May 18, 2024 at 05:54:42 PM GMT-5, Kyle Evans=20 > wrote: >=20 >=20 >=20 >=20 > On May 18, 2024 13:42, Pedro Giffuni wrote: >=20 >=C2=A0 =C2=A0 Oh no .. please not... >=20 >=C2=A0 =C2=A0 We went into that in a GSoC: >=20 >=C2=A0 =C2=A0 https://wiki.freebsd.org/SummerOfCode2015/FreeBSDLibcSecurit= yExtensions >=20 >=20 >=C2=A0 =C2=A0 Ultimately it proved to be useless since stack-protector-str= ong. >=20 >=20 > Respectfully, I disagree with your conclusion here: >=20 > 1.) _FORTIFY_SOURCE provides more granular detection of overflow; I=20 > don't have to overflow all the way into the canary at the end of the=20 > frame to be detected, so my minor bug now can be caught before something= =20 > causes the stack frame to be rearranged and turn it into a security=20 > issue later >=20 > 2.) __builtin_object_size doesn't work on heap objects, but it actually= =20 > can work on subobjects from a heap allocation (e.g., &foo->name), so the= =20 > coverage extends beyond the stack into starting to detect other kinds of= =20 > overflow >=20 > While the security value over stack-protector-strong may be marginal (I= =20 > won't debate this specifically), the feature still has value in general. >=20 > Thanks, >=20 > Kyle Evans >=20 >=C2=A0 =C2=A0 The NetBSD code was not well adapted to clang either. >=20 >=C2=A0 =C2=A0 Ask me more if you really want to dig into it, but we don't = want this. >=20 >=C2=A0 =C2=A0 Pedro. >=20 >=20 >=C2=A0 =C2=A0 On Monday, May 13, 2024 at 12:24:13 AM GMT-5, Kyle Evans >=C2=A0 =C2=A0 wrote: >=20 >=20 >=C2=A0 =C2=A0 The branch main has been updated by kevans: >=20 >=C2=A0 =C2=A0 URL: >=C2=A0 =C2=A0 https://cgit.FreeBSD.org/src/commit/?id=3Dbe04fec42638f30f50= b5b55fd8e3634c0fb89928 >=20 >=C2=A0 =C2=A0 commit be04fec42638f30f50b5b55fd8e3634c0fb89928 >=C2=A0 =C2=A0 Author:=C2=A0 =C2=A0 Kyle Evans > >=C2=A0 =C2=A0 AuthorDate: 2024-05-13 05:23:49 +0000 >=C2=A0 =C2=A0 Commit:=C2=A0 =C2=A0 Kyle Evans > >=C2=A0 =C2=A0 CommitDate: 2024-05-13 05:23:49 +0000 >=20 >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Import _FORTIFY_SOURCE implementation f= rom NetBSD >=20 >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 This is a mostly-unmodified copy of the= various *_chk >=C2=A0 =C2=A0 implementations >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 and headers from NetBSD, without yet mo= difying system headers >=C2=A0 =C2=A0 to start >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 actually including them.=C2=A0 A future= commit will also apply the >=C2=A0 =C2=A0 needed >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 bits to fix ssp/unistd.h. >=20 >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 imp, pauamma_= gundo.com (both previous >=C2=A0 =C2=A0 versions), kib >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Sponsored by:=C2=A0 Stormshield >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Sponsored by:=C2=A0 Klara, Inc. >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Differential Revision: https://reviews.= freebsd.org/D32306 >=C2=A0 =C2=A0 >=C2=A0 =C2=A0 --- >=C2=A0 =C2=A0 etc/mtree/BSD.include.dist=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2= =A0 2 + >=C2=A0 =C2=A0 include/Makefile=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 |=C2=A0 2 +- >=C2=A0 =C2=A0 include/ssp/Makefile=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 |=C2=A0 6 ++ >=C2=A0 =C2=A0 include/ssp/ssp.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 |=C2=A0 91 ++++++++++++++++++++++++++ >=C2=A0 =C2=A0 include/ssp/stdio.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 |=C2=A0 93 ++++++++++++++++++++++++++ >=C2=A0 =C2=A0 include/ssp/string.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 | 129 >=C2=A0 =C2=A0 ++++++++++++++++++++++++++++++++++++ >=C2=A0 =C2=A0 include/ssp/strings.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 |=C2=A0 67 +++++++++++++++++++ >=C2=A0 =C2=A0 include/ssp/unistd.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 |=C2=A0 54 +++++++++++++++ >=C2=A0 =C2=A0 lib/libc/secure/Makefile.inc=C2=A0 =C2=A0 =C2=A0 |=C2=A0 11 = ++++ >=C2=A0 =C2=A0 lib/libc/secure/Symbol.map=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2= =A0 18 +++++ >=C2=A0 =C2=A0 lib/libc/secure/fgets_chk.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2= =A0 54 +++++++++++++++ >=C2=A0 =C2=A0 lib/libc/secure/gets_chk.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2= =A0 74 +++++++++++++++++++++ >=C2=A0 =C2=A0 lib/libc/secure/memcpy_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 53 = +++++++++++++++ >=C2=A0 =C2=A0 lib/libc/secure/memmove_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 47= +++++++++++++ >=C2=A0 =C2=A0 lib/libc/secure/memset_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 46 = +++++++++++++ >=C2=A0 =C2=A0 lib/libc/secure/snprintf_chk.c=C2=A0 =C2=A0 |=C2=A0 56 +++++= +++++++++++ >=C2=A0 =C2=A0 lib/libc/secure/sprintf_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 61= +++++++++++++++++ >=C2=A0 =C2=A0 lib/libc/secure/ssp_internal.h=C2=A0 =C2=A0 |=C2=A0 37 +++++= ++++++ >=C2=A0 =C2=A0 lib/libc/secure/stpcpy_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 55 = ++++++++++++++++ >=C2=A0 =C2=A0 lib/libc/secure/stpncpy_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 53= +++++++++++++++ >=C2=A0 =C2=A0 lib/libc/secure/strcat_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 60 = +++++++++++++++++ >=C2=A0 =C2=A0 lib/libc/secure/strcpy_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 54 = +++++++++++++++ >=C2=A0 =C2=A0 lib/libc/secure/strncat_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 70= ++++++++++++++++++++ >=C2=A0 =C2=A0 lib/libc/secure/strncpy_chk.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 53= +++++++++++++++ >=C2=A0 =C2=A0 lib/libc/secure/vsnprintf_chk.c=C2=A0 =C2=A0 |=C2=A0 49 ++++= ++++++++++ >=C2=A0 =C2=A0 lib/libc/secure/vsprintf_chk.c=C2=A0 =C2=A0 |=C2=A0 58 +++++= +++++++++++ >=C2=A0 =C2=A0 lib/libssp/Makefile=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 |=C2=A0 20 +++++- >=C2=A0 =C2=A0 lib/libssp/Symbol.map=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 |=C2=A0 12 ++-- >=C2=A0 =C2=A0 lib/libssp/Versions.def=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 |=C2=A0 5 ++ >=C2=A0 =C2=A0 lib/libssp/__builtin_object_size.3 | 110 +++++++++++++++++++= ++++++++++++ >=C2=A0 =C2=A0 lib/libssp/fortify_stubs.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 | 131 >=C2=A0 =C2=A0 ------------------------------------- >=C2=A0 =C2=A0 lib/libssp/ssp.3=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 | 130 >=C2=A0 =C2=A0 ++++++++++++++++++++++++++++++++++++ >=C2=A0 =C2=A0 32 files changed, 1621 insertions(+), 140 deletions(-) >=20 >=C2=A0 =C2=A0 diff --git a/etc/mtree/BSD.include.dist b/etc/mtree/BSD.incl= ude.dist >=C2=A0 =C2=A0 index a6bd5880bf61..f8c83d6dde7a 100644 >=C2=A0 =C2=A0 --- a/etc/mtree/BSD.include.dist >=C2=A0 =C2=A0 +++ b/etc/mtree/BSD.include.dist >=C2=A0 =C2=A0 @@ -372,6 +372,8 @@ >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 mac_veriexec >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .. >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .. >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 ssp >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 .. >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sys >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 disk >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .. >=C2=A0 =C2=A0 diff --git a/include/Makefile b/include/Makefile >=C2=A0 =C2=A0 index 19e6beb95203..32774419f162 100644 >=C2=A0 =C2=A0 --- a/include/Makefile >=C2=A0 =C2=A0 +++ b/include/Makefile >=C2=A0 =C2=A0 @@ -4,7 +4,7 @@ >=20 >=C2=A0 =C2=A0 PACKAGE=3Dclibs >=C2=A0 =C2=A0 CLEANFILES=3D osreldate.h version >=C2=A0 =C2=A0 -SUBDIR=3D arpa protocols rpcsvc rpc xlocale >=C2=A0 =C2=A0 +SUBDIR=3D arpa protocols rpcsvc rpc ssp xlocale >=C2=A0 =C2=A0 .if ${MACHINE_CPUARCH} =3D=3D "amd64" >=C2=A0 =C2=A0 SUBDIR+=3D=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 i386 >=C2=A0 =C2=A0 INCLUDE_SUBDIRS+=3D=C2=A0=C2=A0=C2=A0 i386 >=C2=A0 =C2=A0 diff --git a/include/ssp/Makefile b/include/ssp/Makefile >=C2=A0 =C2=A0 new file mode 100644 >=C2=A0 =C2=A0 index 000000000000..dff19f43c920 >=C2=A0 =C2=A0 --- /dev/null >=C2=A0 =C2=A0 +++ b/include/ssp/Makefile >=C2=A0 =C2=A0 @@ -0,0 +1,6 @@ >=C2=A0 =C2=A0 +# $FreeBSD$ >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +INCS=3D=C2=A0=C2=A0=C2=A0 ssp.h stdio.h string.h strings.h = unistd.h >=C2=A0 =C2=A0 +INCSDIR=3D=C2=A0=C2=A0=C2=A0 ${INCLUDEDIR}/ssp >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +.include >=C2=A0 =C2=A0 diff --git a/include/ssp/ssp.h b/include/ssp/ssp.h >=C2=A0 =C2=A0 new file mode 100644 >=C2=A0 =C2=A0 index 000000000000..35a9aeee02df >=C2=A0 =C2=A0 --- /dev/null >=C2=A0 =C2=A0 +++ b/include/ssp/ssp.h >=C2=A0 =C2=A0 @@ -0,0 +1,91 @@ >=C2=A0 =C2=A0 +/*=C2=A0=C2=A0=C2=A0 $NetBSD: ssp.h,v 1.13 2015/09/03 20:43= :47 plunky Exp $=C2=A0=C2=A0=C2=A0 */ >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +/*- >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * SPDX-License-Identifier: BSD-2-Clause >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * Copyright (c) 2006, 2011 The NetBSD Foundation, Inc. >=C2=A0 =C2=A0 + * All rights reserved. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * This code is derived from software contributed to The Ne= tBSD >=C2=A0 =C2=A0 Foundation >=C2=A0 =C2=A0 + * by Christos Zoulas. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * Redistribution and use in source and binary forms, with = or without >=C2=A0 =C2=A0 + * modification, are permitted provided that the following = conditions >=C2=A0 =C2=A0 + * are met: >=C2=A0 =C2=A0 + * 1. Redistributions of source code must retain the above = copyright >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 notice, this list of conditions and the fol= lowing disclaimer. >=C2=A0 =C2=A0 + * 2. Redistributions in binary form must reproduce the abo= ve copyright >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 notice, this list of conditions and the fol= lowing disclaimer >=C2=A0 =C2=A0 in the >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 documentation and/or other materials provid= ed with the >=C2=A0 =C2=A0 distribution. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC.= AND >=C2=A0 =C2=A0 CONTRIBUTORS >=C2=A0 =C2=A0 + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDI= NG, BUT >=C2=A0 =C2=A0 NOT LIMITED >=C2=A0 =C2=A0 + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNES= S FOR A >=C2=A0 =C2=A0 PARTICULAR >=C2=A0 =C2=A0 + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUN= DATION OR >=C2=A0 =C2=A0 CONTRIBUTORS >=C2=A0 =C2=A0 + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >=C2=A0 =C2=A0 EXEMPLARY, OR >=C2=A0 =C2=A0 + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PR= OCUREMENT OF >=C2=A0 =C2=A0 + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROF= ITS; OR >=C2=A0 =C2=A0 BUSINESS >=C2=A0 =C2=A0 + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABIL= ITY, >=C2=A0 =C2=A0 WHETHER IN >=C2=A0 =C2=A0 + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENC= E OR >=C2=A0 =C2=A0 OTHERWISE) >=C2=A0 =C2=A0 + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN= IF >=C2=A0 =C2=A0 ADVISED OF THE >=C2=A0 =C2=A0 + * POSSIBILITY OF SUCH DAMAGE. >=C2=A0 =C2=A0 + */ >=C2=A0 =C2=A0 +#ifndef _SSP_SSP_H_ >=C2=A0 =C2=A0 +#define _SSP_SSP_H_ >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#if !defined(__cplusplus) >=C2=A0 =C2=A0 +# if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 (__OPTIMIZE__ > 0 || defined(__clang__)) >=C2=A0 =C2=A0 +#=C2=A0 if _FORTIFY_SOURCE > 1 >=C2=A0 =C2=A0 +#=C2=A0 define __SSP_FORTIFY_LEVEL 2 >=C2=A0 =C2=A0 +#=C2=A0 else >=C2=A0 =C2=A0 +#=C2=A0 define __SSP_FORTIFY_LEVEL 1 >=C2=A0 =C2=A0 +#=C2=A0 endif >=C2=A0 =C2=A0 +# else >=C2=A0 =C2=A0 +#=C2=A0 define __SSP_FORTIFY_LEVEL 0 >=C2=A0 =C2=A0 +# endif >=C2=A0 =C2=A0 +#else >=C2=A0 =C2=A0 +# define __SSP_FORTIFY_LEVEL 0 >=C2=A0 =C2=A0 +#endif >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#define=C2=A0=C2=A0=C2=A0 __ssp_var(type)=C2=A0=C2=A0=C2=A0= __CONCAT(__ssp_ ## type, __COUNTER__) >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +/* __ssp_real is used by the implementation in libc */ >=C2=A0 =C2=A0 +#if __SSP_FORTIFY_LEVEL =3D=3D 0 >=C2=A0 =C2=A0 +#define __ssp_real_(fun)=C2=A0=C2=A0=C2=A0 fun >=C2=A0 =C2=A0 +#else >=C2=A0 =C2=A0 +#define __ssp_real_(fun)=C2=A0=C2=A0=C2=A0 __ssp_real_ ## f= un >=C2=A0 =C2=A0 +#endif >=C2=A0 =C2=A0 +#define __ssp_real(fun)=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 __ssp_real_(fun) >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#define __ssp_inline static __inline __attribute__((__alway= s_inline__)) >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#define __ssp_bos(ptr) __builtin_object_size(ptr, >=C2=A0 =C2=A0 __SSP_FORTIFY_LEVEL > 1) >=C2=A0 =C2=A0 +#define __ssp_bos0(ptr) __builtin_object_size(ptr, 0) >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#define __ssp_check(buf, len, bos) \ >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 if (bos(buf) !=3D (size_t)-1 && len > bo= s(buf)) \ >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail() >=C2=A0 =C2=A0 +#define __ssp_redirect_raw(rtype, fun, symbol, args, call, = cond, bos) \ >=C2=A0 =C2=A0 +rtype __ssp_real_(fun) args __RENAME(symbol); \ >=C2=A0 =C2=A0 +__ssp_inline rtype fun args __RENAME(__ssp_protected_ ## fu= n); \ >=C2=A0 =C2=A0 +__ssp_inline rtype fun args { \ >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 if (cond) \ >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __ssp_check(__buf, __= len, bos); \ >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 return __ssp_real_(fun) call; \ >=C2=A0 =C2=A0 +} >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#define __ssp_redirect(rtype, fun, args, call) \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 __ssp_redirect_raw(rtype, fun, fun, args, cal= l, 1, __ssp_bos) >=C2=A0 =C2=A0 +#define __ssp_redirect0(rtype, fun, args, call) \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 __ssp_redirect_raw(rtype, fun, fun, args, cal= l, 1, __ssp_bos0) >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +__BEGIN_DECLS >=C2=A0 =C2=A0 +void __stack_chk_fail(void) __dead2; >=C2=A0 =C2=A0 +void __chk_fail(void) __dead2; >=C2=A0 =C2=A0 +__END_DECLS >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#endif /* _SSP_SSP_H_ */ >=C2=A0 =C2=A0 diff --git a/include/ssp/stdio.h b/include/ssp/stdio.h >=C2=A0 =C2=A0 new file mode 100644 >=C2=A0 =C2=A0 index 000000000000..72e3236eac80 >=C2=A0 =C2=A0 --- /dev/null >=C2=A0 =C2=A0 +++ b/include/ssp/stdio.h >=C2=A0 =C2=A0 @@ -0,0 +1,93 @@ >=C2=A0 =C2=A0 +/*=C2=A0=C2=A0=C2=A0 $NetBSD: stdio.h,v 1.5 2011/07/17 20:5= 4:34 joerg Exp $=C2=A0=C2=A0=C2=A0 */ >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +/*- >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * SPDX-License-Identifier: BSD-2-Clause >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * Copyright (c) 2006 The NetBSD Foundation, Inc. >=C2=A0 =C2=A0 + * All rights reserved. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * This code is derived from software contributed to The Ne= tBSD >=C2=A0 =C2=A0 Foundation >=C2=A0 =C2=A0 + * by Christos Zoulas. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * Redistribution and use in source and binary forms, with = or without >=C2=A0 =C2=A0 + * modification, are permitted provided that the following = conditions >=C2=A0 =C2=A0 + * are met: >=C2=A0 =C2=A0 + * 1. Redistributions of source code must retain the above = copyright >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 notice, this list of conditions and the fol= lowing disclaimer. >=C2=A0 =C2=A0 + * 2. Redistributions in binary form must reproduce the abo= ve copyright >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 notice, this list of conditions and the fol= lowing disclaimer >=C2=A0 =C2=A0 in the >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 documentation and/or other materials provid= ed with the >=C2=A0 =C2=A0 distribution. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC.= AND >=C2=A0 =C2=A0 CONTRIBUTORS >=C2=A0 =C2=A0 + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDI= NG, BUT >=C2=A0 =C2=A0 NOT LIMITED >=C2=A0 =C2=A0 + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNES= S FOR A >=C2=A0 =C2=A0 PARTICULAR >=C2=A0 =C2=A0 + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUN= DATION OR >=C2=A0 =C2=A0 CONTRIBUTORS >=C2=A0 =C2=A0 + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >=C2=A0 =C2=A0 EXEMPLARY, OR >=C2=A0 =C2=A0 + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PR= OCUREMENT OF >=C2=A0 =C2=A0 + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROF= ITS; OR >=C2=A0 =C2=A0 BUSINESS >=C2=A0 =C2=A0 + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABIL= ITY, >=C2=A0 =C2=A0 WHETHER IN >=C2=A0 =C2=A0 + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENC= E OR >=C2=A0 =C2=A0 OTHERWISE) >=C2=A0 =C2=A0 + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN= IF >=C2=A0 =C2=A0 ADVISED OF THE >=C2=A0 =C2=A0 + * POSSIBILITY OF SUCH DAMAGE. >=C2=A0 =C2=A0 + */ >=C2=A0 =C2=A0 +#ifndef _SSP_STDIO_H_ >=C2=A0 =C2=A0 +#define _SSP_STDIO_H_ >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +__BEGIN_DECLS >=C2=A0 =C2=A0 +int __sprintf_chk(char *__restrict, int, size_t, const char >=C2=A0 =C2=A0 *__restrict, ...) >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 __printflike(4, 5); >=C2=A0 =C2=A0 +int __vsprintf_chk(char *__restrict, int, size_t, const cha= r >=C2=A0 =C2=A0 *__restrict, >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 __va_list) >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 __printflike(4, 0); >=C2=A0 =C2=A0 +int __snprintf_chk(char *__restrict, size_t, int, size_t, >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 const char *__restrict, ...) >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 __printflike(5, 6); >=C2=A0 =C2=A0 +int __vsnprintf_chk(char *__restrict, size_t, int, size_t, >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 const char *__restrict, __va_list) >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 __printflike(5, 0); >=C2=A0 =C2=A0 +char *__gets_chk(char *, size_t); >=C2=A0 =C2=A0 +char *__fgets_chk(char *, int, size_t, FILE *); >=C2=A0 =C2=A0 +__END_DECLS >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#if __SSP_FORTIFY_LEVEL > 0 >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#define sprintf(str, ...) ({=C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 char *_ssp_str =3D (str);=C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 __builtin___sprintf_chk(_ssp_str, 0, __ssp_bo= s(_ssp_str),=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 =C2=A0 =C2=A0 __VA_ARGS__); \ >=C2=A0 =C2=A0 +}) >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#define vsprintf(str, fmt, ap) ({=C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 char *_ssp_str =3D (str);=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 __builtin___vsprintf_chk(_ssp_str, 0, __ssp_b= os(_ssp_str), >=C2=A0 =C2=A0 fmt,=C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 =C2=A0 =C2=A0 ap);=C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +}) >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#define snprintf(str, len, ...) ({=C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 char *_ssp_str =3D (str);=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 __builtin___snprintf_chk(_ssp_str, len, 0, >=C2=A0 =C2=A0 __ssp_bos(_ssp_str),=C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 =C2=A0 =C2=A0 __VA_ARGS__);=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +}) >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#define vsnprintf(str, len, fmt, ap) ({=C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 char *_ssp_str =3D (str);=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 __builtin___vsnprintf_chk(_ssp_str, len, 0, >=C2=A0 =C2=A0 __ssp_bos(_ssp_str),=C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 =C2=A0 =C2=A0 fmt, ap);=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +}) >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#define gets(str) ({=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 char *_ssp_str =3D (str);=C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 __gets_chk(_ssp_str, __ssp_bos(_ssp_str));=C2= =A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +}) >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#define fgets(str, len, fp) ({=C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 char *_ssp_str =3D (str);=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 __fgets_chk(_ssp_str, len, __ssp_bos(_ssp_str= ), fp);=C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +}) >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#endif /* __SSP_FORTIFY_LEVEL > 0 */ >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#endif /* _SSP_STDIO_H_ */ >=C2=A0 =C2=A0 diff --git a/include/ssp/string.h b/include/ssp/string.h >=C2=A0 =C2=A0 new file mode 100644 >=C2=A0 =C2=A0 index 000000000000..996020fda778 >=C2=A0 =C2=A0 --- /dev/null >=C2=A0 =C2=A0 +++ b/include/ssp/string.h >=C2=A0 =C2=A0 @@ -0,0 +1,129 @@ >=C2=A0 =C2=A0 +/*=C2=A0=C2=A0=C2=A0 $NetBSD: string.h,v 1.14 2020/09/05 13= :37:59 mrg Exp $=C2=A0=C2=A0=C2=A0 */ >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +/*- >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * SPDX-License-Identifier: BSD-2-Clause >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * Copyright (c) 2006 The NetBSD Foundation, Inc. >=C2=A0 =C2=A0 + * All rights reserved. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * This code is derived from software contributed to The Ne= tBSD >=C2=A0 =C2=A0 Foundation >=C2=A0 =C2=A0 + * by Christos Zoulas. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * Redistribution and use in source and binary forms, with = or without >=C2=A0 =C2=A0 + * modification, are permitted provided that the following = conditions >=C2=A0 =C2=A0 + * are met: >=C2=A0 =C2=A0 + * 1. Redistributions of source code must retain the above = copyright >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 notice, this list of conditions and the fol= lowing disclaimer. >=C2=A0 =C2=A0 + * 2. Redistributions in binary form must reproduce the abo= ve copyright >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 notice, this list of conditions and the fol= lowing disclaimer >=C2=A0 =C2=A0 in the >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 documentation and/or other materials provid= ed with the >=C2=A0 =C2=A0 distribution. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC.= AND >=C2=A0 =C2=A0 CONTRIBUTORS >=C2=A0 =C2=A0 + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDI= NG, BUT >=C2=A0 =C2=A0 NOT LIMITED >=C2=A0 =C2=A0 + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNES= S FOR A >=C2=A0 =C2=A0 PARTICULAR >=C2=A0 =C2=A0 + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUN= DATION OR >=C2=A0 =C2=A0 CONTRIBUTORS >=C2=A0 =C2=A0 + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >=C2=A0 =C2=A0 EXEMPLARY, OR >=C2=A0 =C2=A0 + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PR= OCUREMENT OF >=C2=A0 =C2=A0 + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROF= ITS; OR >=C2=A0 =C2=A0 BUSINESS >=C2=A0 =C2=A0 + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABIL= ITY, >=C2=A0 =C2=A0 WHETHER IN >=C2=A0 =C2=A0 + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENC= E OR >=C2=A0 =C2=A0 OTHERWISE) >=C2=A0 =C2=A0 + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN= IF >=C2=A0 =C2=A0 ADVISED OF THE >=C2=A0 =C2=A0 + * POSSIBILITY OF SUCH DAMAGE. >=C2=A0 =C2=A0 + */ >=C2=A0 =C2=A0 +#ifndef _SSP_STRING_H_ >=C2=A0 =C2=A0 +#define _SSP_STRING_H_ >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +__BEGIN_DECLS >=C2=A0 =C2=A0 +void *__memcpy_chk(void *, const void *, size_t, size_t); >=C2=A0 =C2=A0 +void *__memmove_chk(void *, const void *, size_t, size_t); >=C2=A0 =C2=A0 +void *__memset_chk(void *, int, size_t, size_t); >=C2=A0 =C2=A0 +char *__stpcpy_chk(char *, const char *, size_t); >=C2=A0 =C2=A0 +char *__stpncpy_chk(char *, const char *, size_t, size_t); >=C2=A0 =C2=A0 +char *__strcat_chk(char *, const char *, size_t); >=C2=A0 =C2=A0 +char *__strcpy_chk(char *, const char *, size_t); >=C2=A0 =C2=A0 +char *__strncat_chk(char *, const char *, size_t, size_t); >=C2=A0 =C2=A0 +char *__strncpy_chk(char *, const char *, size_t, size_t); >=C2=A0 =C2=A0 +__END_DECLS >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#if __SSP_FORTIFY_LEVEL > 0 >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#define __ssp_bos_check3_typed_var(fun, dsttype, dsrvar, ds= t, >=C2=A0 =C2=A0 srctype, srcvar, \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 src, lenvar, len) ({=C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 srctype srcvar =3D (src);=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 dsttype dstvar =3D (dst);=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 size_t lenvar =3D (len);=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 ((__ssp_bos0(dstvar) !=3D (size_t)-1) ?=C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 __builtin___ ## fun ## _chk(dstvar, srcvar, l= envar,=C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 =C2=A0 =C2=A0 __ssp_bos0(dstvar)) :=C2=A0=C2= =A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 __ ## fun ## _ichk(dstvar, srcvar, lenvar));= =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +}) >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#define __ssp_bos_check3_typed(fun, dsttype, dst, srctype, = src, >=C2=A0 =C2=A0 len)=C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 __ssp_bos_check3_typed_var(fun, dsttype, __ss= p_var(dstv), dst,=C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 =C2=A0 =C2=A0 srctype, __ssp_var(srcv), src, = __ssp_var(lenv), len) >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#define __ssp_bos_check3(fun, dst, src, len)=C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 __ssp_bos_check3_typed_var(fun, void *, __ssp= _var(dstv), dst,=C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 =C2=A0 =C2=A0 const void *, __ssp_var(srcv), = src, __ssp_var(lenv), len) >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#define __ssp_bos_check2_var(fun, dstvar, dst, srcvar, src)= ({=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 const void *srcvar =3D (src);=C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 void *dstvar =3D (dst);=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 ((__ssp_bos0(dstvar) !=3D (size_t)-1) ?=C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 __builtin___ ## fun ## _chk(dstvar, srcvar,= =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 =C2=A0 =C2=A0 __ssp_bos0(dstvar)) :=C2=A0=C2= =A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 __ ## fun ## _ichk(dstvar, srcvar));=C2=A0=C2= =A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +}) >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#define __ssp_bos_check2(fun, dst, src)=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 __ssp_bos_check2_var(fun, __ssp_var(dstv), ds= t, >=C2=A0 =C2=A0 __ssp_var(srcv), src) >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#define __ssp_bos_icheck3_restrict(fun, type1, type2) \ >=C2=A0 =C2=A0 +static __inline type1 __ ## fun ## _ichk(type1 __restrict, = type2 >=C2=A0 =C2=A0 __restrict, size_t); \ >=C2=A0 =C2=A0 +static __inline __attribute__((__always_inline__)) type1 \ >=C2=A0 =C2=A0 +__ ## fun ## _ichk(type1 __restrict dst, type2 __restrict s= rc, >=C2=A0 =C2=A0 size_t len) { \ >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 return __builtin___ ## fun ## _chk(dst, = src, len, >=C2=A0 =C2=A0 __ssp_bos0(dst)); \ >=C2=A0 =C2=A0 +} >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#define __ssp_bos_icheck3(fun, type1, type2) \ >=C2=A0 =C2=A0 +static __inline type1 __ ## fun ## _ichk(type1, type2, size= _t); \ >=C2=A0 =C2=A0 +static __inline __attribute__((__always_inline__)) type1 \ >=C2=A0 =C2=A0 +__ ## fun ## _ichk(type1 dst, type2 src, size_t len) { \ >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 return __builtin___ ## fun ## _chk(dst, = src, len, >=C2=A0 =C2=A0 __ssp_bos0(dst)); \ >=C2=A0 =C2=A0 +} >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#define __ssp_bos_icheck2_restrict(fun, type1, type2) \ >=C2=A0 =C2=A0 +static __inline type1 __ ## fun ## _ichk(type1, type2); \ >=C2=A0 =C2=A0 +static __inline __attribute__((__always_inline__)) type1 \ >=C2=A0 =C2=A0 +__ ## fun ## _ichk(type1 __restrict dst, type2 __restrict s= rc) { \ >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 return __builtin___ ## fun ## _chk(dst, = src, __ssp_bos0(dst)); \ >=C2=A0 =C2=A0 +} >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +__BEGIN_DECLS >=C2=A0 =C2=A0 +__ssp_bos_icheck3_restrict(memcpy, void *, const void *) >=C2=A0 =C2=A0 +__ssp_bos_icheck3(memmove, void *, const void *) >=C2=A0 =C2=A0 +__ssp_bos_icheck3(memset, void *, int) >=C2=A0 =C2=A0 +__ssp_bos_icheck2_restrict(stpcpy, char *, const char *) >=C2=A0 =C2=A0 +__ssp_bos_icheck3_restrict(stpncpy, char *, const char *) >=C2=A0 =C2=A0 +__ssp_bos_icheck2_restrict(strcpy, char *, const char *) >=C2=A0 =C2=A0 +__ssp_bos_icheck2_restrict(strcat, char *, const char *) >=C2=A0 =C2=A0 +__ssp_bos_icheck3_restrict(strncpy, char *, const char *) >=C2=A0 =C2=A0 +__ssp_bos_icheck3_restrict(strncat, char *, const char *) >=C2=A0 =C2=A0 +__END_DECLS >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#define memcpy(dst, src, len) __ssp_bos_check3(memcpy, dst,= src, len) >=C2=A0 =C2=A0 +#define memmove(dst, src, len) __ssp_bos_check3(memmove, ds= t, src, len) >=C2=A0 =C2=A0 +#define memset(dst, val, len) \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 __ssp_bos_check3_typed(memset, void *, dst, i= nt, val, len) >=C2=A0 =C2=A0 +#define stpcpy(dst, src) __ssp_bos_check2(stpcpy, dst, src) >=C2=A0 =C2=A0 +#define stpncpy(dst, src, len) __ssp_bos_check3(stpncpy, ds= t, src, len) >=C2=A0 =C2=A0 +#define strcpy(dst, src) __ssp_bos_check2(strcpy, dst, src) >=C2=A0 =C2=A0 +#define strcat(dst, src) __ssp_bos_check2(strcat, dst, src) >=C2=A0 =C2=A0 +#define strncpy(dst, src, len) __ssp_bos_check3(strncpy, ds= t, src, len) >=C2=A0 =C2=A0 +#define strncat(dst, src, len) __ssp_bos_check3(strncat, ds= t, src, len) >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#endif /* __SSP_FORTIFY_LEVEL > 0 */ >=C2=A0 =C2=A0 +#endif /* _SSP_STRING_H_ */ >=C2=A0 =C2=A0 diff --git a/include/ssp/strings.h b/include/ssp/strings.h >=C2=A0 =C2=A0 new file mode 100644 >=C2=A0 =C2=A0 index 000000000000..06c9c7cc0a09 >=C2=A0 =C2=A0 --- /dev/null >=C2=A0 =C2=A0 +++ b/include/ssp/strings.h >=C2=A0 =C2=A0 @@ -0,0 +1,67 @@ >=C2=A0 =C2=A0 +/*=C2=A0=C2=A0=C2=A0 $NetBSD: strings.h,v 1.3 2008/04/28 20= :22:54 martin Exp $=C2=A0=C2=A0=C2=A0 */ >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +/*- >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * SPDX-License-Identifier: BSD-2-Clause >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * Copyright (c) 2007 The NetBSD Foundation, Inc. >=C2=A0 =C2=A0 + * All rights reserved. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * This code is derived from software contributed to The Ne= tBSD >=C2=A0 =C2=A0 Foundation >=C2=A0 =C2=A0 + * by Christos Zoulas. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * Redistribution and use in source and binary forms, with = or without >=C2=A0 =C2=A0 + * modification, are permitted provided that the following = conditions >=C2=A0 =C2=A0 + * are met: >=C2=A0 =C2=A0 + * 1. Redistributions of source code must retain the above = copyright >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 notice, this list of conditions and the fol= lowing disclaimer. >=C2=A0 =C2=A0 + * 2. Redistributions in binary form must reproduce the abo= ve copyright >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 notice, this list of conditions and the fol= lowing disclaimer >=C2=A0 =C2=A0 in the >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 documentation and/or other materials provid= ed with the >=C2=A0 =C2=A0 distribution. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC.= AND >=C2=A0 =C2=A0 CONTRIBUTORS >=C2=A0 =C2=A0 + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDI= NG, BUT >=C2=A0 =C2=A0 NOT LIMITED >=C2=A0 =C2=A0 + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNES= S FOR A >=C2=A0 =C2=A0 PARTICULAR >=C2=A0 =C2=A0 + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUN= DATION OR >=C2=A0 =C2=A0 CONTRIBUTORS >=C2=A0 =C2=A0 + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >=C2=A0 =C2=A0 EXEMPLARY, OR >=C2=A0 =C2=A0 + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PR= OCUREMENT OF >=C2=A0 =C2=A0 + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROF= ITS; OR >=C2=A0 =C2=A0 BUSINESS >=C2=A0 =C2=A0 + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABIL= ITY, >=C2=A0 =C2=A0 WHETHER IN >=C2=A0 =C2=A0 + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENC= E OR >=C2=A0 =C2=A0 OTHERWISE) >=C2=A0 =C2=A0 + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN= IF >=C2=A0 =C2=A0 ADVISED OF THE >=C2=A0 =C2=A0 + * POSSIBILITY OF SUCH DAMAGE. >=C2=A0 =C2=A0 + */ >=C2=A0 =C2=A0 +#ifndef _SSP_STRINGS_H_ >=C2=A0 =C2=A0 +#define _SSP_STRINGS_H_ >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#if __SSP_FORTIFY_LEVEL > 0 >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#define _ssp_bcopy(srcvar, src, dstvar, dst, lenvar,=C2=A0 = len) ({=C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 const void *srcvar =3D (src);=C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 void *dstvar =3D (dst);=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 size_t lenvar =3D (len);=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 ((__ssp_bos0(dstvar) !=3D (size_t)-1) ?=C2=A0= =C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 __builtin___memmove_chk(dstvar, srcvar, lenva= r,=C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 =C2=A0 =C2=A0 __ssp_bos0(dstvar)) :=C2=A0=C2= =A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 __memmove_ichk(dstvar, srcvar, lenvar));=C2= =A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +}) >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#define=C2=A0=C2=A0=C2=A0 bcopy(src, dst, len)=C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 _ssp_bcopy(__ssp_var(srcv), src, __ssp_var(ds= tv), dst, >=C2=A0 =C2=A0 __ssp_var(lenv), len) >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#define _ssp_bzero(dstvar, dst, lenvar, len) ({=C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 void *dstvar =3D (dst);=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 size_t lenvar =3D (len);=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 ((__ssp_bos0(dstvar) !=3D (size_t)-1) ?=C2=A0= =C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 __builtin___memset_chk(dstvar, 0, lenvar,=C2= =A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 =C2=A0 =C2=A0 __ssp_bos0(dstvar)) : \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 __memset_ichk(dstvar, 0, lenvar));=C2=A0=C2= =A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ >=C2=A0 =C2=A0 +}) >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#define=C2=A0=C2=A0=C2=A0 bzero(dst, len)=C2=A0=C2=A0=C2=A0= _ssp_bzero(__ssp_var(dstv), dst, >=C2=A0 =C2=A0 __ssp_var(lenv), len) >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#endif /* __SSP_FORTIFY_LEVEL > 0 */ >=C2=A0 =C2=A0 +#endif /* _SSP_STRINGS_H_ */ >=C2=A0 =C2=A0 diff --git a/include/ssp/unistd.h b/include/ssp/unistd.h >=C2=A0 =C2=A0 new file mode 100644 >=C2=A0 =C2=A0 index 000000000000..2414e2baa96b >=C2=A0 =C2=A0 --- /dev/null >=C2=A0 =C2=A0 +++ b/include/ssp/unistd.h >=C2=A0 =C2=A0 @@ -0,0 +1,54 @@ >=C2=A0 =C2=A0 +/*=C2=A0=C2=A0=C2=A0 $NetBSD: unistd.h,v 1.7 2015/06/25 18:= 41:03 joerg Exp $=C2=A0=C2=A0=C2=A0 */ >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +/*- >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * SPDX-License-Identifier: BSD-2-Clause >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * Copyright (c) 2006 The NetBSD Foundation, Inc. >=C2=A0 =C2=A0 + * All rights reserved. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * This code is derived from software contributed to The Ne= tBSD >=C2=A0 =C2=A0 Foundation >=C2=A0 =C2=A0 + * by Christos Zoulas. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * Redistribution and use in source and binary forms, with = or without >=C2=A0 =C2=A0 + * modification, are permitted provided that the following = conditions >=C2=A0 =C2=A0 + * are met: >=C2=A0 =C2=A0 + * 1. Redistributions of source code must retain the above = copyright >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 notice, this list of conditions and the fol= lowing disclaimer. >=C2=A0 =C2=A0 + * 2. Redistributions in binary form must reproduce the abo= ve copyright >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 notice, this list of conditions and the fol= lowing disclaimer >=C2=A0 =C2=A0 in the >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 documentation and/or other materials provid= ed with the >=C2=A0 =C2=A0 distribution. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC.= AND >=C2=A0 =C2=A0 CONTRIBUTORS >=C2=A0 =C2=A0 + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDI= NG, BUT >=C2=A0 =C2=A0 NOT LIMITED >=C2=A0 =C2=A0 + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNES= S FOR A >=C2=A0 =C2=A0 PARTICULAR >=C2=A0 =C2=A0 + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUN= DATION OR >=C2=A0 =C2=A0 CONTRIBUTORS >=C2=A0 =C2=A0 + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >=C2=A0 =C2=A0 EXEMPLARY, OR >=C2=A0 =C2=A0 + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PR= OCUREMENT OF >=C2=A0 =C2=A0 + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROF= ITS; OR >=C2=A0 =C2=A0 BUSINESS >=C2=A0 =C2=A0 + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABIL= ITY, >=C2=A0 =C2=A0 WHETHER IN >=C2=A0 =C2=A0 + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENC= E OR >=C2=A0 =C2=A0 OTHERWISE) >=C2=A0 =C2=A0 + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN= IF >=C2=A0 =C2=A0 ADVISED OF THE >=C2=A0 =C2=A0 + * POSSIBILITY OF SUCH DAMAGE. >=C2=A0 =C2=A0 + */ >=C2=A0 =C2=A0 +#ifndef _SSP_UNISTD_H_ >=C2=A0 =C2=A0 +#define _SSP_UNISTD_H_ >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#if __SSP_FORTIFY_LEVEL > 0 >=C2=A0 =C2=A0 +__BEGIN_DECLS >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +__ssp_redirect0(ssize_t, read, (int __fd, void *__buf, size= _t __len), \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 (__fd, __buf, __len)); >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +__ssp_redirect(ssize_t, readlink, (const char *__restrict _= _path, \ >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 char *__restrict __buf, size_t __len), (__pat= h, __buf, __len)); >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +__ssp_redirect_raw(char *, getcwd, getcwd, (char *__buf, si= ze_t __len), >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 (__buf, __len), __buf !=3D 0, __ssp_bos); >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +__END_DECLS >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#endif /* __SSP_FORTIFY_LEVEL > 0 */ >=C2=A0 =C2=A0 +#endif /* _SSP_UNISTD_H_ */ >=C2=A0 =C2=A0 diff --git a/lib/libc/secure/Makefile.inc b/lib/libc/secure/= Makefile.inc >=C2=A0 =C2=A0 index 8574c5a05dc5..3b1ad879c715 100644 >=C2=A0 =C2=A0 --- a/lib/libc/secure/Makefile.inc >=C2=A0 =C2=A0 +++ b/lib/libc/secure/Makefile.inc >=C2=A0 =C2=A0 @@ -3,6 +3,17 @@ >=20 >=C2=A0 =C2=A0 .PATH: ${LIBC_SRCTOP}/secure >=20 >=C2=A0 =C2=A0 +# _FORTIFY_SOURCE >=C2=A0 =C2=A0 +SRCS+=3D=C2=A0=C2=A0=C2=A0 gets_chk.c fgets_chk.c memcpy_ch= k.c memmove_chk.c >=C2=A0 =C2=A0 memset_chk.c \ >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 snprintf_chk.c sprintf_chk.c stpcpy_chk.= c stpncpy_chk.c \ >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 strcat_chk.c strcpy_chk.c strncat_chk.c = strncpy_chk.c \ >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 vsnprintf_chk.c vsprintf_chk.c >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +CFLAGS.snprintf_chk.c+=3D=C2=A0=C2=A0=C2=A0 -Wno-unused-par= ameter >=C2=A0 =C2=A0 +CFLAGS.sprintf_chk.c+=3D=C2=A0=C2=A0=C2=A0 -Wno-unused-para= meter >=C2=A0 =C2=A0 +CFLAGS.vsnprintf_chk.c+=3D=C2=A0=C2=A0=C2=A0 -Wno-unused-pa= rameter >=C2=A0 =C2=A0 +CFLAGS.vsprintf_chk.c+=3D=C2=A0=C2=A0=C2=A0 -Wno-unused-par= ameter >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 # Sources common to both syscall interfaces: >=C2=A0 =C2=A0 SRCS+=3D=C2=A0=C2=A0=C2=A0 stack_protector.c \ >=C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0=C2=A0 stack_protector_compat.c >=C2=A0 =C2=A0 diff --git a/lib/libc/secure/Symbol.map b/lib/libc/secure/Sy= mbol.map >=C2=A0 =C2=A0 index 641f451b5421..7859fcee3821 100644 >=C2=A0 =C2=A0 --- a/lib/libc/secure/Symbol.map >=C2=A0 =C2=A0 +++ b/lib/libc/secure/Symbol.map >=C2=A0 =C2=A0 @@ -3,3 +3,21 @@ FBSD_1.0 { >=C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0=C2=A0 __stack_chk_fail; >=C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0=C2=A0 __stack_chk_guard; >=C2=A0 =C2=A0 }; >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +FBSD_1.8 { >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 __gets_chk; >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 __fgets_chk; >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 __memcpy_chk; >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 __memmove_chk; >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 __memset_chk; >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 __snprintf_chk; >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 __sprintf_chk; >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 __stpcpy_chk; >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 __stpncpy_chk; >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 __strcat_chk; >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 __strcpy_chk; >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 __strncat_chk; >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 __strncpy_chk; >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 __vsnprintf_chk; >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 __vsprintf_chk; >=C2=A0 =C2=A0 +}; >=C2=A0 =C2=A0 diff --git a/lib/libc/secure/fgets_chk.c b/lib/libc/secure/f= gets_chk.c >=C2=A0 =C2=A0 new file mode 100644 >=C2=A0 =C2=A0 index 000000000000..72aa1d816ce1 >=C2=A0 =C2=A0 --- /dev/null >=C2=A0 =C2=A0 +++ b/lib/libc/secure/fgets_chk.c >=C2=A0 =C2=A0 @@ -0,0 +1,54 @@ >=C2=A0 =C2=A0 +/*- >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * SPDX-License-Identifier: BSD-2-Clause >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * Copyright (c) 2006 The NetBSD Foundation, Inc. >=C2=A0 =C2=A0 + * All rights reserved. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * This code is derived from software contributed to The Ne= tBSD >=C2=A0 =C2=A0 Foundation >=C2=A0 =C2=A0 + * by Christos Zoulas. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * Redistribution and use in source and binary forms, with = or without >=C2=A0 =C2=A0 + * modification, are permitted provided that the following = conditions >=C2=A0 =C2=A0 + * are met: >=C2=A0 =C2=A0 + * 1. Redistributions of source code must retain the above = copyright >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 notice, this list of conditions and the fol= lowing disclaimer. >=C2=A0 =C2=A0 + * 2. Redistributions in binary form must reproduce the abo= ve copyright >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 notice, this list of conditions and the fol= lowing disclaimer >=C2=A0 =C2=A0 in the >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 documentation and/or other materials provid= ed with the >=C2=A0 =C2=A0 distribution. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC.= AND >=C2=A0 =C2=A0 CONTRIBUTORS >=C2=A0 =C2=A0 + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDI= NG, BUT >=C2=A0 =C2=A0 NOT LIMITED >=C2=A0 =C2=A0 + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNES= S FOR A >=C2=A0 =C2=A0 PARTICULAR >=C2=A0 =C2=A0 + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUN= DATION OR >=C2=A0 =C2=A0 CONTRIBUTORS >=C2=A0 =C2=A0 + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >=C2=A0 =C2=A0 EXEMPLARY, OR >=C2=A0 =C2=A0 + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PR= OCUREMENT OF >=C2=A0 =C2=A0 + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROF= ITS; OR >=C2=A0 =C2=A0 BUSINESS >=C2=A0 =C2=A0 + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABIL= ITY, >=C2=A0 =C2=A0 WHETHER IN >=C2=A0 =C2=A0 + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENC= E OR >=C2=A0 =C2=A0 OTHERWISE) >=C2=A0 =C2=A0 + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN= IF >=C2=A0 =C2=A0 ADVISED OF THE >=C2=A0 =C2=A0 + * POSSIBILITY OF SUCH DAMAGE. >=C2=A0 =C2=A0 + */ >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 +__RCSID("$NetBSD: fgets_chk.c,v 1.6 2009/02/05 05:41:51 luk= em Exp $"); >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 +#undef fgets >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +char * >=C2=A0 =C2=A0 +__fgets_chk(char * __restrict buf, int len, size_t slen, FI= LE *fp) >=C2=A0 =C2=A0 +{ >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 if (slen >=3D (size_t)INT_MAX) >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 return (fgets(buf, le= n, fp)); >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 if (len >=3D 0 && (size_t)len > slen) >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail(); >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 return (fgets(buf, len, fp)); >=C2=A0 =C2=A0 +} >=C2=A0 =C2=A0 diff --git a/lib/libc/secure/gets_chk.c b/lib/libc/secure/ge= ts_chk.c >=C2=A0 =C2=A0 new file mode 100644 >=C2=A0 =C2=A0 index 000000000000..18c1e2d18f43 >=C2=A0 =C2=A0 --- /dev/null >=C2=A0 =C2=A0 +++ b/lib/libc/secure/gets_chk.c >=C2=A0 =C2=A0 @@ -0,0 +1,74 @@ >=C2=A0 =C2=A0 +/*- >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * SPDX-License-Identifier: BSD-2-Clause >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * Copyright (c) 2006 The NetBSD Foundation, Inc. >=C2=A0 =C2=A0 + * All rights reserved. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * This code is derived from software contributed to The Ne= tBSD >=C2=A0 =C2=A0 Foundation >=C2=A0 =C2=A0 + * by Christos Zoulas. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * Redistribution and use in source and binary forms, with = or without >=C2=A0 =C2=A0 + * modification, are permitted provided that the following = conditions >=C2=A0 =C2=A0 + * are met: >=C2=A0 =C2=A0 + * 1. Redistributions of source code must retain the above = copyright >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 notice, this list of conditions and the fol= lowing disclaimer. >=C2=A0 =C2=A0 + * 2. Redistributions in binary form must reproduce the abo= ve copyright >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 notice, this list of conditions and the fol= lowing disclaimer >=C2=A0 =C2=A0 in the >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 documentation and/or other materials provid= ed with the >=C2=A0 =C2=A0 distribution. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC.= AND >=C2=A0 =C2=A0 CONTRIBUTORS >=C2=A0 =C2=A0 + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDI= NG, BUT >=C2=A0 =C2=A0 NOT LIMITED >=C2=A0 =C2=A0 + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNES= S FOR A >=C2=A0 =C2=A0 PARTICULAR >=C2=A0 =C2=A0 + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUN= DATION OR >=C2=A0 =C2=A0 CONTRIBUTORS >=C2=A0 =C2=A0 + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >=C2=A0 =C2=A0 EXEMPLARY, OR >=C2=A0 =C2=A0 + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PR= OCUREMENT OF >=C2=A0 =C2=A0 + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROF= ITS; OR >=C2=A0 =C2=A0 BUSINESS >=C2=A0 =C2=A0 + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABIL= ITY, >=C2=A0 =C2=A0 WHETHER IN >=C2=A0 =C2=A0 + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENC= E OR >=C2=A0 =C2=A0 OTHERWISE) >=C2=A0 =C2=A0 + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN= IF >=C2=A0 =C2=A0 ADVISED OF THE >=C2=A0 =C2=A0 + * POSSIBILITY OF SUCH DAMAGE. >=C2=A0 =C2=A0 + */ >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 +__RCSID("$NetBSD: gets_chk.c,v 1.7 2013/10/04 20:49:16 chri= stos Exp >=C2=A0 =C2=A0 $"); >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +char *__gets_unsafe(char *); >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +char * >=C2=A0 =C2=A0 +__gets_chk(char * __restrict buf, size_t slen) >=C2=A0 =C2=A0 +{ >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 char *abuf; >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 size_t len; >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 if (slen >=3D (size_t)INT_MAX) >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 return (__gets_unsafe= (buf)); >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 if ((abuf =3D malloc(slen + 1)) =3D=3D N= ULL) >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 return (__gets_unsafe= (buf)); >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 if (fgets(abuf, (int)(slen + 1), stdin) = =3D=3D NULL) { >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 free(abuf); >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 return (NULL); >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 } >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 len =3D strlen(abuf); >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 if (len > 0 && abuf[len - 1] =3D=3D '\n'= ) >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 --len; >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 if (len >=3D slen) >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail(); >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 (void)memcpy(buf, abuf, len); >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 buf[len] =3D '\0'; >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 free(abuf); >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 return (buf); >=C2=A0 =C2=A0 +} >=C2=A0 =C2=A0 diff --git a/lib/libc/secure/memcpy_chk.c b/lib/libc/secure/= memcpy_chk.c >=C2=A0 =C2=A0 new file mode 100644 >=C2=A0 =C2=A0 index 000000000000..99cf2d5f13ff >=C2=A0 =C2=A0 --- /dev/null >=C2=A0 =C2=A0 +++ b/lib/libc/secure/memcpy_chk.c >=C2=A0 =C2=A0 @@ -0,0 +1,53 @@ >=C2=A0 =C2=A0 +/*- >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * SPDX-License-Identifier: BSD-2-Clause >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * Copyright (c) 2006 The NetBSD Foundation, Inc. >=C2=A0 =C2=A0 + * All rights reserved. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * This code is derived from software contributed to The Ne= tBSD >=C2=A0 =C2=A0 Foundation >=C2=A0 =C2=A0 + * by Christos Zoulas. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * Redistribution and use in source and binary forms, with = or without >=C2=A0 =C2=A0 + * modification, are permitted provided that the following = conditions >=C2=A0 =C2=A0 + * are met: >=C2=A0 =C2=A0 + * 1. Redistributions of source code must retain the above = copyright >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 notice, this list of conditions and the fol= lowing disclaimer. >=C2=A0 =C2=A0 + * 2. Redistributions in binary form must reproduce the abo= ve copyright >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 notice, this list of conditions and the fol= lowing disclaimer >=C2=A0 =C2=A0 in the >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 documentation and/or other materials provid= ed with the >=C2=A0 =C2=A0 distribution. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC.= AND >=C2=A0 =C2=A0 CONTRIBUTORS >=C2=A0 =C2=A0 + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDI= NG, BUT >=C2=A0 =C2=A0 NOT LIMITED >=C2=A0 =C2=A0 + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNES= S FOR A >=C2=A0 =C2=A0 PARTICULAR >=C2=A0 =C2=A0 + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUN= DATION OR >=C2=A0 =C2=A0 CONTRIBUTORS >=C2=A0 =C2=A0 + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >=C2=A0 =C2=A0 EXEMPLARY, OR >=C2=A0 =C2=A0 + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PR= OCUREMENT OF >=C2=A0 =C2=A0 + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROF= ITS; OR >=C2=A0 =C2=A0 BUSINESS >=C2=A0 =C2=A0 + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABIL= ITY, >=C2=A0 =C2=A0 WHETHER IN >=C2=A0 =C2=A0 + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENC= E OR >=C2=A0 =C2=A0 OTHERWISE) >=C2=A0 =C2=A0 + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN= IF >=C2=A0 =C2=A0 ADVISED OF THE >=C2=A0 =C2=A0 + * POSSIBILITY OF SUCH DAMAGE. >=C2=A0 =C2=A0 + */ >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 +__RCSID("$NetBSD: memcpy_chk.c,v 1.7 2015/05/13 19:57:16 jo= erg Exp $"); >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 +#undef memcpy >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#include "ssp_internal.h" >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +void * >=C2=A0 =C2=A0 +__memcpy_chk(void * __restrict dst, const void * __restrict= src, >=C2=A0 =C2=A0 size_t len, >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 size_t slen) >=C2=A0 =C2=A0 +{ >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 if (len > slen) >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail(); >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 if (__ssp_overlap((const char *)src, (co= nst char *)dst, len)) >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail(); >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 return (memcpy(dst, src, len)); >=C2=A0 =C2=A0 +} >=C2=A0 =C2=A0 diff --git a/lib/libc/secure/memmove_chk.c >=C2=A0 =C2=A0 b/lib/libc/secure/memmove_chk.c >=C2=A0 =C2=A0 new file mode 100644 >=C2=A0 =C2=A0 index 000000000000..07f965d608fc >=C2=A0 =C2=A0 --- /dev/null >=C2=A0 =C2=A0 +++ b/lib/libc/secure/memmove_chk.c >=C2=A0 =C2=A0 @@ -0,0 +1,47 @@ >=C2=A0 =C2=A0 +/*- >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * SPDX-License-Identifier: BSD-2-Clause >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * Copyright (c) 2006 The NetBSD Foundation, Inc. >=C2=A0 =C2=A0 + * All rights reserved. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * This code is derived from software contributed to The Ne= tBSD >=C2=A0 =C2=A0 Foundation >=C2=A0 =C2=A0 + * by Christos Zoulas. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * Redistribution and use in source and binary forms, with = or without >=C2=A0 =C2=A0 + * modification, are permitted provided that the following = conditions >=C2=A0 =C2=A0 + * are met: >=C2=A0 =C2=A0 + * 1. Redistributions of source code must retain the above = copyright >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 notice, this list of conditions and the fol= lowing disclaimer. >=C2=A0 =C2=A0 + * 2. Redistributions in binary form must reproduce the abo= ve copyright >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 notice, this list of conditions and the fol= lowing disclaimer >=C2=A0 =C2=A0 in the >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 documentation and/or other materials provid= ed with the >=C2=A0 =C2=A0 distribution. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC.= AND >=C2=A0 =C2=A0 CONTRIBUTORS >=C2=A0 =C2=A0 + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDI= NG, BUT >=C2=A0 =C2=A0 NOT LIMITED >=C2=A0 =C2=A0 + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNES= S FOR A >=C2=A0 =C2=A0 PARTICULAR >=C2=A0 =C2=A0 + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUN= DATION OR >=C2=A0 =C2=A0 CONTRIBUTORS >=C2=A0 =C2=A0 + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >=C2=A0 =C2=A0 EXEMPLARY, OR >=C2=A0 =C2=A0 + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PR= OCUREMENT OF >=C2=A0 =C2=A0 + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROF= ITS; OR >=C2=A0 =C2=A0 BUSINESS >=C2=A0 =C2=A0 + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABIL= ITY, >=C2=A0 =C2=A0 WHETHER IN >=C2=A0 =C2=A0 + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENC= E OR >=C2=A0 =C2=A0 OTHERWISE) >=C2=A0 =C2=A0 + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN= IF >=C2=A0 =C2=A0 ADVISED OF THE >=C2=A0 =C2=A0 + * POSSIBILITY OF SUCH DAMAGE. >=C2=A0 =C2=A0 + */ >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 +__RCSID("$NetBSD: memmove_chk.c,v 1.6 2020/09/05 13:37:59 m= rg Exp $"); >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 +#undef memmove >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +void * >=C2=A0 =C2=A0 +__memmove_chk(void *dst, const void *src, size_t len, >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 size_t slen) >=C2=A0 =C2=A0 +{ >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 if (len > slen) >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail(); >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 return (memmove(dst, src, len)); >=C2=A0 =C2=A0 +} >=C2=A0 =C2=A0 diff --git a/lib/libc/secure/memset_chk.c b/lib/libc/secure/= memset_chk.c >=C2=A0 =C2=A0 new file mode 100644 >=C2=A0 =C2=A0 index 000000000000..f337be98b46d >=C2=A0 =C2=A0 --- /dev/null >=C2=A0 =C2=A0 +++ b/lib/libc/secure/memset_chk.c >=C2=A0 =C2=A0 @@ -0,0 +1,46 @@ >=C2=A0 =C2=A0 +/*- >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * SPDX-License-Identifier: BSD-2-Clause >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * Copyright (c) 2006 The NetBSD Foundation, Inc. >=C2=A0 =C2=A0 + * All rights reserved. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * This code is derived from software contributed to The Ne= tBSD >=C2=A0 =C2=A0 Foundation >=C2=A0 =C2=A0 + * by Christos Zoulas. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * Redistribution and use in source and binary forms, with = or without >=C2=A0 =C2=A0 + * modification, are permitted provided that the following = conditions >=C2=A0 =C2=A0 + * are met: >=C2=A0 =C2=A0 + * 1. Redistributions of source code must retain the above = copyright >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 notice, this list of conditions and the fol= lowing disclaimer. >=C2=A0 =C2=A0 + * 2. Redistributions in binary form must reproduce the abo= ve copyright >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 notice, this list of conditions and the fol= lowing disclaimer >=C2=A0 =C2=A0 in the >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 documentation and/or other materials provid= ed with the >=C2=A0 =C2=A0 distribution. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC.= AND >=C2=A0 =C2=A0 CONTRIBUTORS >=C2=A0 =C2=A0 + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDI= NG, BUT >=C2=A0 =C2=A0 NOT LIMITED >=C2=A0 =C2=A0 + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNES= S FOR A >=C2=A0 =C2=A0 PARTICULAR >=C2=A0 =C2=A0 + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUN= DATION OR >=C2=A0 =C2=A0 CONTRIBUTORS >=C2=A0 =C2=A0 + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >=C2=A0 =C2=A0 EXEMPLARY, OR >=C2=A0 =C2=A0 + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PR= OCUREMENT OF >=C2=A0 =C2=A0 + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROF= ITS; OR >=C2=A0 =C2=A0 BUSINESS >=C2=A0 =C2=A0 + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABIL= ITY, >=C2=A0 =C2=A0 WHETHER IN >=C2=A0 =C2=A0 + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENC= E OR >=C2=A0 =C2=A0 OTHERWISE) >=C2=A0 =C2=A0 + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN= IF >=C2=A0 =C2=A0 ADVISED OF THE >=C2=A0 =C2=A0 + * POSSIBILITY OF SUCH DAMAGE. >=C2=A0 =C2=A0 + */ >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 +__RCSID("$NetBSD: memset_chk.c,v 1.5 2014/09/17 00:39:28 jo= erg Exp $"); >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 +#undef memset >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +void * >=C2=A0 =C2=A0 +__memset_chk(void * __restrict dst, int val, size_t len, si= ze_t slen) >=C2=A0 =C2=A0 +{ >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 if (len > slen) >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail(); >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 return (memset(dst, val, len)); >=C2=A0 =C2=A0 +} >=C2=A0 =C2=A0 diff --git a/lib/libc/secure/snprintf_chk.c >=C2=A0 =C2=A0 b/lib/libc/secure/snprintf_chk.c >=C2=A0 =C2=A0 new file mode 100644 >=C2=A0 =C2=A0 index 000000000000..52ef874ede5b >=C2=A0 =C2=A0 --- /dev/null >=C2=A0 =C2=A0 +++ b/lib/libc/secure/snprintf_chk.c >=C2=A0 =C2=A0 @@ -0,0 +1,56 @@ >=C2=A0 =C2=A0 +/*- >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * SPDX-License-Identifier: BSD-2-Clause >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * Copyright (c) 2006 The NetBSD Foundation, Inc. >=C2=A0 =C2=A0 + * All rights reserved. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * This code is derived from software contributed to The Ne= tBSD >=C2=A0 =C2=A0 Foundation >=C2=A0 =C2=A0 + * by Christos Zoulas. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * Redistribution and use in source and binary forms, with = or without >=C2=A0 =C2=A0 + * modification, are permitted provided that the following = conditions >=C2=A0 =C2=A0 + * are met: >=C2=A0 =C2=A0 + * 1. Redistributions of source code must retain the above = copyright >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 notice, this list of conditions and the fol= lowing disclaimer. >=C2=A0 =C2=A0 + * 2. Redistributions in binary form must reproduce the abo= ve copyright >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 notice, this list of conditions and the fol= lowing disclaimer >=C2=A0 =C2=A0 in the >=C2=A0 =C2=A0 + *=C2=A0 =C2=A0 documentation and/or other materials provid= ed with the >=C2=A0 =C2=A0 distribution. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC.= AND >=C2=A0 =C2=A0 CONTRIBUTORS >=C2=A0 =C2=A0 + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDI= NG, BUT >=C2=A0 =C2=A0 NOT LIMITED >=C2=A0 =C2=A0 + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNES= S FOR A >=C2=A0 =C2=A0 PARTICULAR >=C2=A0 =C2=A0 + * PURPOSE ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE FOUN= DATION OR >=C2=A0 =C2=A0 CONTRIBUTORS >=C2=A0 =C2=A0 + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >=C2=A0 =C2=A0 EXEMPLARY, OR >=C2=A0 =C2=A0 + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PR= OCUREMENT OF >=C2=A0 =C2=A0 + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROF= ITS; OR >=C2=A0 =C2=A0 BUSINESS >=C2=A0 =C2=A0 + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABIL= ITY, >=C2=A0 =C2=A0 WHETHER IN >=C2=A0 =C2=A0 + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENC= E OR >=C2=A0 =C2=A0 OTHERWISE) >=C2=A0 =C2=A0 + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN= IF >=C2=A0 =C2=A0 ADVISED OF THE >=C2=A0 =C2=A0 + * POSSIBILITY OF SUCH DAMAGE. >=C2=A0 =C2=A0 + */ >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 +__RCSID("$NetBSD: snprintf_chk.c,v 1.5 2008/04/28 20:23:00 = martin >=C2=A0 =C2=A0 Exp $"); >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +#include >=C2=A0 =C2=A0 +#undef vsnprintf >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +int >=C2=A0 =C2=A0 +__snprintf_chk(char * __restrict buf, size_t len, int flags= , size_t >=C2=A0 =C2=A0 slen, >=C2=A0 =C2=A0 +=C2=A0 =C2=A0 const char * __restrict fmt, ...) >=C2=A0 =C2=A0 +{ >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 va_list ap; >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 int rv; >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 if (len > slen) >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 __chk_fail(); >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 va_start(ap, fmt); >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 rv =3D vsnprintf(buf, len, fmt, ap); >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 va_end(ap); >=C2=A0 =C2=A0 + >=C2=A0 =C2=A0 +=C2=A0=C2=A0=C2=A0 return (rv); >=C2=A0 =C2=A0 +} >=C2=A0 =C2=A0 diff --git a/lib/libc/secure/sprintf_chk.c >=C2=A0 =C2=A0 b/lib/libc/secure/sprintf_chk.c >=C2=A0 =C2=A0 new file mode 100644 >=C2=A0 =C2=A0 index 000000000000..d4c42ccba3ce >=C2=A0 =C2=A0 --- /dev/null >=C2=A0 =C2=A0 +++ b/lib/libc/secure/sprintf_chk.c >=C2=A0 =C2=A0 @@ -0,0 +1,61 @@ >=C2=A0 =C2=A0 +/*- >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * SPDX-License-Identifier: BSD-2-Clause >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * Copyright (c) 2006 The NetBSD Foundation, Inc. >=C2=A0 =C2=A0 + * All rights reserved. >=C2=A0 =C2=A0 + * >=C2=A0 =C2=A0 + * This code is derived from software contributed to The Ne= tBSD >=C2=A0 =C2=A0 Foundation >=C2=A0 =C2=A0 *** 1063 LINES SKIPPED *** >=20 >=20 =20 ------=_Part_1357399_2058372477.1716093599883 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
=
FWIW .. and let me be clear = I haven't worked on this in ages and I am not planning to retake this eithe= r...

clang just couldn't do the static  fortify_sour= ce checks  d= ue to the way llvm uses an intermediate representation; the size just could= n't be handled in the preprocessor. Google did spend some time adding extra= attributes to clang to improve the debugging and you can see that implemen= ted in bionic libc but that was it. musl didn't even try.

fortify_source does replace some key libc functions with memory checking a= lternatives and that turns out to be annoying when debugging. In a way it b= reaks that principle C programmers once had, where developers are expected = to know what they are doing, and if the error is caught at runtime by the s= tack protector anyways it ends up being redundant.

One mo= re thing about the static checks. Most of the linux distributions out there= indeed have built their software packages with GCC and fortify_source >= =3D2. As a consequence, when we ran an exp-run on the ports tree (with GCC)= , fortify_source didn't find anything: it was basically a waste of time.

Another reason for not setting it by default is performance= . And here I answer Shawn's comment on why not enable stack-protector-all a= nd safestack and fortify_source at the same time: running unnecessary check= s over and over again wastes energy and can have some performance hit. The = later may seem negligible in modern processors, but why do them if they bri= ng no benefit? (No need to answer ... just left as food for thought)
<= div dir=3D"ltr" data-setdir=3D"false">
Pedro.

=20
=20
On Saturday, May 18, 2024 at 09:08:52 PM GMT-5, Kyl= e Evans <kevans@freebsd.org> wrote:


=20 =20


=
On 5/18/24 20:09, Pedro Giffuni wrote:
> (sorry for top posting .. my mailer just sucks)
> Hi;
>
> I used to like the limited static checking FORTIFY_SOURCE provide= s and
> when I ran it over FreeBSD it did fin= d a couple of minor issues. It only
> works f= or GCC though.
>
I don't think this is particularly true anymore; I= haven't found a case
yet where __builtin_object= _size(3) doesn't give me the correct size
while = GCC did.  I'd welcome counter-examples here, though -- we have
funding to both finish the project (widen the _FORTIFY_= SOURCE net to
more of libc/libsys) and add tests= to demonstrate that it's both
functional and co= rrect.  It would be useful to also document
deficiencies in the tests.

> I guess it doesn't really hurt to have FORTIFY_SOURCE around and= NetBSD
> had the least intrusive implementat= ion the last time I checked but I
> would cer= tainly request it should never be activated by default,
> specially with clang. The GCC version has seen more developme= nt on glibc
> but I still think its a dead en= d.
>

I don't see a compelling reason to avoid enabling it by defaul= t; see
above, the functionality that we need in = clang appears to be just fine
(and, iirc, was al= so fine when I checked at the beginning of working on
this in 2021) and it provides useful

> What I would like to see working on FreeBSD is Sa= festack as a
> replacement for the stack prot= ector, which we were so very slow to adopt
> = even when it was originally developed in FreeBSD. I think other projects
> based on FreeBSD (Chimera and hardenedBSD) ha= ve been using it but I
> don't know the detai= ls.
>

No comment there, though I think Shawn Webb / HardenedBSD had= been
playing around with SafeStack (and might h= ave enabled it? I haven't
actually looked in a w= hile now).

> This i= s just all my $0.02
>
> Pedro.

Thanks,=

Kyle Evans
<= div dir=3D"ltr">
>
= > On Saturday, May 18, 2024 at 05:54:42 PM GMT-5, Kyle Evans
<= div dir=3D"ltr">> <
kaevans@fastmail.com> wrote:
>
>
>
>
> On Ma= y 18, 2024 13:42, Pedro Giffuni <pfg@freebsd.org> wrote:
>
>    Oh no .. p= lease not...
>
>=     We went into that in a GSoC:
> =
>    https://wiki.freebsd.org/SummerOfCode2015/FreeBSDLibcSecurit= yExtensions <https://wik= i.freebsd.org/SummerOfCode2015/FreeBSDLibcSecurityExtensions>
>
>
>    Ultimately it proved to be useless since stack-= protector-strong.
>
>
> Respectfully, I disagree with your co= nclusion here:
>
&g= t; 1.) _FORTIFY_SOURCE provides more granular detection of overflow; I
=
> don't have to overflow all the way into the can= ary at the end of the
> frame to be detected,= so my minor bug now can be caught before something
> causes the stack frame to be rearranged and turn it into a securit= y
> issue later
>= ;
> 2.) __builtin_object_size doesn't work on= heap objects, but it actually
> can work on = subobjects from a heap allocation (e.g., &foo->name), so the
> coverage extends beyond the stack into starting to= detect other kinds of
> overflow
>
> While the security valu= e over stack-protector-strong may be marginal (I
> won't debate this specifically), the feature still has value in gener= al.
>
> Thanks,<= br>
>
> Kyle Evans
>
>    = The NetBSD code was not well adapted to clang either.
>
>    Ask me more if you= really want to dig into it, but we don't want this.
>
>    Pedro.
>
>
>    On Monday, May 13, 2024 at 12:24:13 AM GMT-5, Kyle Eva= ns
>    <kevans@freebsd.org>= ; wrote:
>
>
>    The branch main has been updated= by kevans:
>
>&= nbsp;   URL:
>
>    commit be04fec4= 2638f30f50b5b55fd8e3634c0fb89928
>   = ; Author:    Kyle Evans <kevans@FreeBSD.org <mailto:keva= ns@FreeBSD.org>>
>    AuthorD= ate: 2024-05-13 05:23:49 +0000
>    = Commit:    Kyle Evans <kevans@FreeBSD.org <mailto:kevans= @FreeBSD.org>>
>    CommitDat= e: 2024-05-13 05:23:49 +0000
>
>          Import _FORTIFY_SOURCE i= mplementation from NetBSD
>
>          This is a mostly-unmodified= copy of the various *_chk
>    imp= lementations
>        &nbs= p; and headers from NetBSD, without yet modifying system headers
<= div dir=3D"ltr">>    to start
>&= nbsp;         actually including them.  A future c= ommit will also apply the
>    need= ed
>          bits to= fix ssp/unistd.h.
>
>          Reviewed by:    imp, pau= amma_gundo.com (both previous
>    = versions), kib
>        &n= bsp; Sponsored by:  Stormshield
>  &= nbsp;       Sponsored by:  Klara, Inc.
>          Differential Revision: https://reviews.freebsd.org/D32306
>&n= bsp;   <https://reviews.freebsd.org/D32306>
>    ---
>&nbs= p;   etc/mtree/BSD.include.dist        |  2 = +
>    include/Makefile   = ;               |  2 +-
>    include/ssp/Makefile      =         |  6 ++
>&nbs= p;   include/ssp/ssp.h             = ;     |  91 ++++++++++++++++++++++++++
>    include/ssp/stdio.h        &nbs= p;       |  93 ++++++++++++++++++++++++++
>    include/ssp/string.h      &n= bsp;       | 129
>   = ++++++++++++++++++++++++++++++++++++
> =   include/ssp/strings.h            &nb= sp; |  67 +++++++++++++++++++
>  &nb= sp; include/ssp/unistd.h              |=   54 +++++++++++++++
>    lib/= libc/secure/Makefile.inc      |  11 ++++
>    lib/libc/secure/Symbol.map    &nbs= p;   |  18 +++++
>    lib= /libc/secure/fgets_chk.c        |  54 ++++++++++++= +++
>    lib/libc/secure/gets_chk.c=         |  74 +++++++++++++++++++++
>    lib/libc/secure/memcpy_chk.c    &n= bsp; |  53 +++++++++++++++
>   = lib/libc/secure/memmove_chk.c      |  47 ++++++++++++= +
>    lib/libc/secure/memset_chk.c=       |  46 +++++++++++++
>= ;    lib/libc/secure/snprintf_chk.c    |  56 ++++= ++++++++++++
>    lib/libc/secure/s= printf_chk.c      |  61 +++++++++++++++++
>    lib/libc/secure/ssp_internal.h   = |  37 +++++++++++
>    lib/li= bc/secure/stpcpy_chk.c      |  55 ++++++++++++++++
<= /div>
>    lib/libc/secure/stpncpy_chk.c = ;     |  53 +++++++++++++++
>&n= bsp;   lib/libc/secure/strcat_chk.c      |  60 ++= +++++++++++++++
>    lib/libc/secur= e/strcpy_chk.c      |  54 +++++++++++++++
>    lib/libc/secure/strncat_chk.c    =   |  70 ++++++++++++++++++++
> =   lib/libc/secure/strncpy_chk.c      |  53 +++++= ++++++++++
>    lib/libc/secure/vsn= printf_chk.c    |  49 ++++++++++++++
>    lib/libc/secure/vsprintf_chk.c    |  5= 8 ++++++++++++++++
>    lib/libssp/= Makefile                |  20 = +++++-
>    lib/libssp/Symbol.map&n= bsp;             |  12 ++--
>    lib/libssp/Versions.def     = ;       |  5 ++
>  &n= bsp; lib/libssp/__builtin_object_size.3 | 110 ++++++++++++++++++++++++++++= +++
>    lib/libssp/fortify_stubs.c=         | 131
>  &nbs= p; -------------------------------------
>&nb= sp;   lib/libssp/ssp.3             = ;     | 130
>    ++++++++= ++++++++++++++++++++++++++++
>    3= 2 files changed, 1621 insertions(+), 140 deletions(-)
>
>    diff --git a/etc/mt= ree/BSD.include.dist b/etc/mtree/BSD.include.dist
>    index a6bd5880bf61..f8c83d6dde7a 100644
>    --- a/etc/mtree/BSD.include.dist
>    +++ b/etc/mtree/BSD.include.dist
=
>    @@ -372,6 +372,8 @@
>              mac_veriexec<= br>
>            &nb= sp; ..
>          ..<= br>
>    +    ssp
>    +    ..
>          sys
>= ;              disk
>              ..
>    diff --git a/include/Makefile b/include/Mak= efile
>    index 19e6beb95203..3277= 4419f162 100644
>    --- a/include/= Makefile
>    +++ b/include/Makefil= e
>    @@ -4,7 +4,7 @@
>
>    PACKAGE=3D= clibs
>    CLEANFILES=3D osreldate.= h version
>    -SUBDIR=3D arpa prot= ocols rpcsvc rpc xlocale
>    +SUBD= IR=3D arpa protocols rpcsvc rpc ssp xlocale
>&= nbsp;   .if ${MACHINE_CPUARCH} =3D=3D "amd64"
>    SUBDIR+=3D        i386<= br>
>    INCLUDE_SUBDIRS+=3D  = ;  i386
>    diff --git a/incl= ude/ssp/Makefile b/include/ssp/Makefile
> = ;   new file mode 100644
>    = index 000000000000..dff19f43c920
>  &nbs= p; --- /dev/null
>    +++ b/includ= e/ssp/Makefile
>    @@ -0,0 +1,6 @@=
>    +# $FreeBSD$
>    +
>    = +INCS=3D    ssp.h stdio.h string.h strings.h unistd.h
>    +INCSDIR=3D    ${INC= LUDEDIR}/ssp
>    +
>    +.include <bsd.prog.mk>
>    diff --git a/include/ssp/ssp.h b/include/ssp/= ssp.h
>    new file mode 100644
=
>    index 000000000000..35a9aeee02df<= br>
>    --- /dev/null
>    +++ b/include/ssp/ssp.h
>    @@ -0,0 +1,91 @@
> = ;   +/*    $NetBSD: ssp.h,v 1.13 2015/09/03 20:43:47 p= lunky Exp $    */
>   = ; +
>    +/*-
>    + *
>    += * SPDX-License-Identifier: BSD-2-Clause
>&nbs= p;   + *
>    + * Copyright (= c) 2006, 2011 The NetBSD Foundation, Inc.
>&nb= sp;   + * All rights reserved.
>  &= nbsp; + *
>    + * This code is de= rived from software contributed to The NetBSD
>= ;    Foundation
>    + *= by Christos Zoulas.
>    + *
>    + * Redistribution and use in sourc= e and binary forms, with or without
>  &n= bsp; + * modification, are permitted provided that the following condition= s
>    + * are met:
>    + * 1. Redistributions of source code must re= tain the above copyright
>    + *&n= bsp;   notice, this list of conditions and the following disclaimer.
>    + * 2. Redistributions in binar= y form must reproduce the above copyright
>&nb= sp;   + *    notice, this list of conditions and the follow= ing disclaimer
>    in the
>    + *    documentation and/or = other materials provided with the
>  &nbs= p; distribution.
>    + *
>    + * THIS SOFTWARE IS PROVIDED BY THE N= ETBSD FOUNDATION, INC. AND
>    CON= TRIBUTORS
>    + * ``AS IS'' AND AN= Y EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
&= gt;    NOT LIMITED
>    = + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
>    PARTICULAR
= >    + * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE = FOUNDATION OR
>    CONTRIBUTORS
=
>    + * BE LIABLE FOR ANY DIRECT, IND= IRECT, INCIDENTAL, SPECIAL,
>    EX= EMPLARY, OR
>    + * CONSEQUENTIAL = DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
>    + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DAT= A, OR PROFITS; OR
>    BUSINESS
=
>    + * INTERRUPTION) HOWEVER CAUSED = AND ON ANY THEORY OF LIABILITY,
>   = WHETHER IN
>    + * CONTRACT, STR= ICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
&= gt;    OTHERWISE)
>    += * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
>    ADVISED OF THE
&= gt;    + * POSSIBILITY OF SUCH DAMAGE.
>    + */
>    +#ifn= def _SSP_SSP_H_
>    +#define _SSP_= SSP_H_
>    +
>    +#include <sys/cdefs.h>
>    +
>    +#if= !defined(__cplusplus)
>    +# if d= efined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && \
<= /div>
>    +    (__OPTIMIZE__ > = 0 || defined(__clang__))
>    +#&nb= sp; if _FORTIFY_SOURCE > 1
>    = +#  define __SSP_FORTIFY_LEVEL 2
>  =   +#  else
>    +# = define __SSP_FORTIFY_LEVEL 1
>    = +#  endif
>    +# else
>    +#  define __SSP_FORTIFY_LEVEL 0=
>    +# endif
>    +#else
>   = +# define __SSP_FORTIFY_LEVEL 0
>  &nbs= p; +#endif
>    +
>    +#define    __ssp_var(type)&nbs= p;   __CONCAT(__ssp_ ## type, __COUNTER__)
>    +
>    +/* _= _ssp_real is used by the implementation in libc */
>    +#if __SSP_FORTIFY_LEVEL =3D=3D 0
>    +#define __ssp_real_(fun)    fun
>    +#else
>    +#define __ssp_real_(fun)    __ssp_real_= ## fun
>    +#endif
>    +#define __ssp_real(fun)    &= nbsp;   __ssp_real_(fun)
>  &nb= sp; +
>    +#define __ssp_inline s= tatic __inline __attribute__((__always_inline__))
>    +
>    +#define= __ssp_bos(ptr) __builtin_object_size(ptr,
>&n= bsp;   __SSP_FORTIFY_LEVEL > 1)
>&nbs= p;   +#define __ssp_bos0(ptr) __builtin_object_size(ptr, 0)
=
>    +
>  =   +#define __ssp_check(buf, len, bos) \
>= ;    +    if (bos(buf) !=3D (size_t)-1 &&= len > bos(buf)) \
>    + &= nbsp;      __chk_fail()
>&= nbsp;   +#define __ssp_redirect_raw(rtype, fun, symbol, args, call, c= ond, bos) \
>    +rtype __ssp_real_= (fun) args __RENAME(symbol); \
>    = +__ssp_inline rtype fun args __RENAME(__ssp_protected_ ## fun); \
>    +__ssp_inline rtype fun args { \
>    +    if (cond) \
=
>    +      &= nbsp; __ssp_check(__buf, __len, bos); \
> = ;   +    return __ssp_real_(fun) call; \
>    +}
>  &nb= sp; +
>    +#define __ssp_redirect= (rtype, fun, args, call) \
>    +&n= bsp;   __ssp_redirect_raw(rtype, fun, fun, args, call, 1, __ssp_bos)
>    +#define __ssp_redirect0(rtype,= fun, args, call) \
>    +  &n= bsp; __ssp_redirect_raw(rtype, fun, fun, args, call, 1, __ssp_bos0)
>    +
> = ;   +__BEGIN_DECLS
>    +void= __stack_chk_fail(void) __dead2;
>   = ; +void __chk_fail(void) __dead2;
>  &nb= sp; +__END_DECLS
>    +
<= div dir=3D"ltr">>    +#endif /* _SSP_SSP_H_ */
>    diff --git a/include/ssp/stdio.h b/include/s= sp/stdio.h
>    new file mode 10064= 4
>    index 000000000000..72e3236e= ac80
>    --- /dev/null
>    +++ b/include/ssp/stdio.h
>    @@ -0,0 +1,93 @@
&g= t;    +/*    $NetBSD: stdio.h,v 1.5 2011/07/17 20= :54:34 joerg Exp $    */
> = ;   +
>    +/*-
>    + *
>  &n= bsp; + * SPDX-License-Identifier: BSD-2-Clause
&= gt;    + *
>    + * Copy= right (c) 2006 The NetBSD Foundation, Inc.
>&n= bsp;   + * All rights reserved.
>  =   + *
>    + * This code is d= erived from software contributed to The NetBSD
&g= t;    Foundation
>    + = * by Christos Zoulas.
>    + *
<= /div>
>    + * Redistribution and use in sour= ce and binary forms, with or without
>  &= nbsp; + * modification, are permitted provided that the following conditio= ns
>    + * are met:
>    + * 1. Redistributions of source code must r= etain the above copyright
>    + *&= nbsp;   notice, this list of conditions and the following disclaimer.<= br>
>    + * 2. Redistributions in bina= ry form must reproduce the above copyright
>&n= bsp;   + *    notice, this list of conditions and the follo= wing disclaimer
>    in the
>    + *    documentation and/or= other materials provided with the
>  &nb= sp; distribution.
>    + *
>    + * THIS SOFTWARE IS PROVIDED BY THE = NETBSD FOUNDATION, INC. AND
>    CO= NTRIBUTORS
>    + * ``AS IS'' AND A= NY 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= FOUNDATION OR
>    CONTRIBUTORS
>    + * BE LIABLE FOR ANY DIRECT, IN= DIRECT, INCIDENTAL, SPECIAL,
>    E= XEMPLARY, OR
>    + * CONSEQUENTIAL= DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
>    + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, = DATA, OR PROFITS; OR
>    BUSINESS<= br>
>    + * INTERRUPTION) HOWEVER CAUS= ED AND ON ANY THEORY OF LIABILITY,
>  &nb= sp; WHETHER IN
>    + * CONTRACT, = STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
>    OTHERWISE)
>   = + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
=
>    ADVISED OF THE
>    + * POSSIBILITY OF SUCH DAMAGE.
>    + */
>    +#= ifndef _SSP_STDIO_H_
>    +#define = _SSP_STDIO_H_
>    +
>    +#include <ssp/ssp.h>
>    +
>    = +__BEGIN_DECLS
>    +int __sprintf= _chk(char *__restrict, int, size_t, const char
&g= t;    *__restrict, ...)
>  &nb= sp; +    __printflike(4, 5);
> = ;   +int __vsprintf_chk(char *__restrict, int, size_t, const char
=
>    *__restrict,
>    +    __va_list)
>    +    __printflike(4, 0);
>    +int __snprintf_chk(char *__restrict, size_t, i= nt, size_t,
>    +    con= st char *__restrict, ...)
>    +&nb= sp;   __printflike(5, 6);
>    = +int __vsnprintf_chk(char *__restrict, size_t, int, size_t,
>    +    const char *__restrict, __va_= list)
>    +    __printfl= ike(5, 0);
>    +char *__gets_chk(c= har *, size_t);
>    +char *__fgets= _chk(char *, int, size_t, FILE *);
>  &nb= sp; +__END_DECLS
>    +
<= div dir=3D"ltr">>    +#if __SSP_FORTIFY_LEVEL > 0
>    +
> =   +#define sprintf(str, ...) ({    \
>    +    char *_ssp_str =3D (str); =    \
>    +    = __builtin___sprintf_chk(_ssp_str, 0, __ssp_bos(_ssp_str),   =     \
>    +  =       __VA_ARGS__); \
>  &= nbsp; +})
>    +
>    +#define vsprintf(str, fmt, ap) ({  &= nbsp; \
>    +    char *_= ssp_str =3D (str);        \
>    +    __builtin___vsprintf_chk(_ssp_st= r, 0, __ssp_bos(_ssp_str),
>    fmt= ,    \
>    +  =       ap);          =       \
>    +}= )
>    +
= >    +#define snprintf(str, len, ...) ({    \<= br>
>    +    char *_ssp_str = =3D (str);        \
>    +    __builtin___snprintf_chk(_ssp_str, len, = 0,
>    __ssp_bos(_ssp_str), &= nbsp;  \
>    +    &= nbsp;   __VA_ARGS__);          = ;  \
>    +})
>    +
>    = +#define vsnprintf(str, len, fmt, ap) ({    \
>    +    char *_ssp_str =3D (str);&nb= sp;       \
>  &= nbsp; +    __builtin___vsnprintf_chk(_ssp_str, len, 0,
=
>    __ssp_bos(_ssp_str),    = \
>    +       = fmt, ap);            \
>    +})
>&n= bsp;   +
>    +#define gets(s= tr) ({            \
<= div dir=3D"ltr">>    +  char *_ssp_str =3D (str); &= nbsp;      \
>   = ; +    __gets_chk(_ssp_str, __ssp_bos(_ssp_str));  &nb= sp; \
>    +})
>    +
>    +#d= efine fgets(str, len, fp) ({        \
>    +    char *_ssp_str =3D (st= r);        \
>&n= bsp;   +    __fgets_chk(_ssp_str, len, __ssp_bos(_ssp_str),= fp);    \
>    +})<= br>
>    +
&g= t;    +#endif /* __SSP_FORTIFY_LEVEL > 0 */
>    +
>    = +#endif /* _SSP_STDIO_H_ */
>    di= ff --git a/include/ssp/string.h b/include/ssp/string.h
>    new file mode 100644
>= ;    index 000000000000..996020fda778
= >    --- /dev/null
>   = ; +++ b/include/ssp/string.h
>    = @@ -0,0 +1,129 @@
>    +/* &nb= sp;  $NetBSD: string.h,v 1.14 2020/09/05 13:37:59 mrg Exp $  = ;  */
>    +
>    +/*-
>   = ; + *
>    + * SPDX-License-Identi= fier: BSD-2-Clause
>    + *
>    + * Copyright (c) 2006 The NetBSD Fou= ndation, Inc.
>    + * All rights r= eserved.
>    + *
>    + * This code is derived from software contribu= ted to The NetBSD
>    Foundation
>    + * by Christos Zoulas.
>    + *
>&nb= sp;   + * 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 lis= t of conditions and the following disclaimer.
>= ;    + * 2. Redistributions in binary form must reproduce the ab= ove copyright
>    + *   = notice, this list of conditions and the following disclaimer
>    in the
> =   + *    documentation and/or other materials provided wit= h the
>    distribution.
<= div dir=3D"ltr">>    + *
> =   + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
>    CONTRIBUTORS
>    + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRAN= TIES, INCLUDING, BUT
>    NOT LIMIT= ED
>    + * TO, THE IMPLIED WARRANT= IES OF MERCHANTABILITY AND FITNESS FOR A
>&nbs= p;   PARTICULAR
>    + * PURP= OSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION 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 LIABIL= ITY,
>    WHETHER IN
>    + * CONTRACT, STRICT LIABILITY, OR TORT (INC= LUDING NEGLIGENCE OR
>    OTHERWISE= )
>    + * ARISING IN ANY WAY OUT O= F THE USE OF THIS SOFTWARE, EVEN IF
>  &n= bsp; ADVISED OF THE
>    + * POSSI= BILITY OF SUCH DAMAGE.
>    + */
>    +#ifndef _SSP_STRING_H_
>    +#define _SSP_STRING_H_
>    +
>   = ; +#include <ssp/ssp.h>
>    = +
>    +__BEGIN_DECLS
>    +void *__memcpy_chk(void *, const void *, = size_t, size_t);
>    +void *__memm= ove_chk(void *, const void *, size_t, size_t);
&g= t;    +void *__memset_chk(void *, int, size_t, size_t);
>    +char *__stpcpy_chk(char *, const char= *, size_t);
>    +char *__stpncpy_= chk(char *, const char *, size_t, size_t);
>&n= bsp;   +char *__strcat_chk(char *, const char *, size_t);
>    +char *__strcpy_chk(char *, const char *,= size_t);
>    +char *__strncat_chk= (char *, const char *, size_t, size_t);
> = ;   +char *__strncpy_chk(char *, const char *, size_t, size_t);
>    +__END_DECLS
>    +
>    +#if = __SSP_FORTIFY_LEVEL > 0
>    +
>    +#define __ssp_bos_check3_typed= _var(fun, dsttype, dsrvar, dst,
>   = srctype, srcvar, \
>    +  &= nbsp; src, lenvar, len) ({          = ;      \
>    +=     srctype srcvar =3D (src);       = ;         \
>&nb= sp;   +    dsttype dstvar =3D (dst);    &nbs= p;           \
>    +    size_t lenvar =3D (len);  = ;              \
>    +    ((__ssp_bos0(dstvar) != =3D (size_t)-1) ?        \
>    +    __builtin___ ## fun ## _chk(dstv= ar, srcvar, lenvar,    \
> = ;   +        __ssp_bos0(dstvar)) :  &nb= sp;             \
>    +    __ ## fun ## _ichk(dstvar, = srcvar, lenvar));    \
>  =   +})
>    +
>    +#define __ssp_bos_check3_typed(fun, dsttype, = dst, srctype, src,
>    len) &= nbsp;  \
>    +    _= _ssp_bos_check3_typed_var(fun, dsttype, __ssp_var(dstv), dst,  &n= bsp; \
>    +      &= nbsp; srctype, __ssp_var(srcv), src, __ssp_var(lenv), len)
>    +
>    = +#define __ssp_bos_check3(fun, dst, src, len)     &nbs= p;  \
>    +    __ss= p_bos_check3_typed_var(fun, void *, __ssp_var(dstv), dst,   = \
>    +       = ; const void *, __ssp_var(srcv), src, __ssp_var(lenv), len)
>    +
>   = +#define __ssp_bos_check2_var(fun, dstvar, dst, srcvar, src) ({ &nbs= p;      \
>    = +    const void *srcvar =3D (src);      =           \
&g= t;    +    void *dstvar =3D (dst);    &= nbsp;           \
>    +    ((__ssp_bos0(dstvar) !=3D (size_= t)-1) ?        \
&g= t;    +    __builtin___ ## fun ## _chk(dstvar, srcvar,=         \
> = ;   +        __ssp_bos0(dstvar)) :  &nb= sp;             \
>    +    __ ## fun ## _ichk(dstvar, = srcvar));        \
= >    +})
>    +
>    +#define __ssp_bos_check2(fun, dst,= src)            \
>    +    __ssp_bos_check2_var(fun, = __ssp_var(dstv), dst,
>    __ssp_va= r(srcv), src)
>    +
>    +#define __ssp_bos_icheck3_restrict(fun, typ= e1, type2) \
>    +static __inline = type1 __ ## fun ## _ichk(type1 __restrict, type2
= >    __restrict, size_t); \
>&nb= sp;   +static __inline __attribute__((__always_inline__)) type1 \
=
>    +__ ## fun ## _ichk(type1 __restr= ict dst, type2 __restrict src,
>    = size_t len) { \
>    +  =   return __builtin___ ## fun ## _chk(dst, src, len,
>    __ssp_bos0(dst)); \
&= gt;    +}
>    +
>    +#define __ssp_bos_icheck3(fun, type1= , type2) \
>    +static __inline ty= pe1 __ ## fun ## _ichk(type1, type2, size_t); \
&= gt;    +static __inline __attribute__((__always_inline__)) type1= \
>    +__ ## fun ## _ichk(type1 d= st, type2 src, size_t len) { \
>    = +    return __builtin___ ## fun ## _chk(dst, src, len,
<= /div>
>    __ssp_bos0(dst)); \
>    +}
>  &nbs= p; +
>    +#define __ssp_bos_ichec= k2_restrict(fun, type1, type2) \
>   = ; +static __inline type1 __ ## fun ## _ichk(type1, type2); \
>    +static __inline __attribute__((__always_in= line__)) type1 \
>    +__ ## fun ##= _ichk(type1 __restrict dst, type2 __restrict src) { \
>    +    return __builtin___ ## fun ## = _chk(dst, src, __ssp_bos0(dst)); \
>  &nb= sp; +}
>    +
>    +__BEGIN_DECLS
> = ;   +__ssp_bos_icheck3_restrict(memcpy, void *, const void *)
>    +__ssp_bos_icheck3(memmove, void *, c= onst void *)
>    +__ssp_bos_icheck= 3(memset, void *, int)
>    +__ssp_= bos_icheck2_restrict(stpcpy, char *, const char *)
>    +__ssp_bos_icheck3_restrict(stpncpy, char *, const cha= r *)
>    +__ssp_bos_icheck2_restri= ct(strcpy, char *, const char *)
>   = ; +__ssp_bos_icheck2_restrict(strcat, char *, const char *)
>    +__ssp_bos_icheck3_restrict(strncpy, char *,= const char *)
>    +__ssp_bos_iche= ck3_restrict(strncat, char *, const char *)
>&= nbsp;   +__END_DECLS
>    +
>    +#define memcpy(dst, src, len) = __ssp_bos_check3(memcpy, dst, src, len)
> = ;   +#define memmove(dst, src, len) __ssp_bos_check3(memmove, dst, sr= c, len)
>    +#define memset(dst, v= al, len) \
>    +    __ss= p_bos_check3_typed(memset, void *, dst, int, val, len)
>    +#define stpcpy(dst, src) __ssp_bos_check2(stpcpy,= dst, src)
>    +#define stpncpy(ds= t, src, len) __ssp_bos_check3(stpncpy, dst, src, len)
>    +#define strcpy(dst, src) __ssp_bos_check2(strcpy, = dst, src)
>    +#define strcat(dst,= src) __ssp_bos_check2(strcat, dst, src)
>&nbs= p;   +#define strncpy(dst, src, len) __ssp_bos_check3(strncpy, dst, s= rc, len)
>    +#define strncat(dst,= src, len) __ssp_bos_check3(strncat, dst, src, len)
>    +
>    +#endi= f /* __SSP_FORTIFY_LEVEL > 0 */
>  &nb= sp; +#endif /* _SSP_STRING_H_ */
>  &nbs= p; diff --git a/include/ssp/strings.h b/include/ssp/strings.h
>    new file mode 100644
>    index 000000000000..06c9c7cc0a09
>    --- /dev/null
>&nb= sp;   +++ b/include/ssp/strings.h
> = ;   @@ -0,0 +1,67 @@
>    +/*=     $NetBSD: strings.h,v 1.3 2008/04/28 20:22:54 martin Exp = $    */
>    +
>    +/*-
>=     + *
>    + * SPDX-Li= cense-Identifier: BSD-2-Clause
>    = + *
>    + * Copyright (c) 2007 Th= e NetBSD Foundation, Inc.
>    + * = All rights reserved.
>    + *
>    + * This code is derived from softw= are contributed to The NetBSD
>    = Foundation
>    + * by Christos Zou= las.
>    + *
>    + * Redistribution and use in source and binary for= ms, with or without
>    + * modifi= cation, are permitted provided that the following conditions
>    + * are met:
>&= nbsp;   + * 1. Redistributions of source code must retain the above c= opyright
>    + *    noti= ce, this list of conditions and the following disclaimer.
>    + * 2. Redistributions in binary form must repr= oduce the above copyright
>    + *&= nbsp;   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 NETBSD FOUNDATION= , INC. AND
>    CONTRIBUTORS
>    + * ``AS IS'' AND ANY EXPRESS OR IMP= LIED WARRANTIES, INCLUDING, BUT
>   = NOT LIMITED
>    + * TO, THE IMPL= IED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
>    PARTICULAR
>   = ; + * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
>    CONTRIBUTORS
>    + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDEN= TAL, SPECIAL,
>    EXEMPLARY, OR
>    + * CONSEQUENTIAL DAMAGES (INCLU= DING, BUT NOT LIMITED TO, PROCUREMENT OF
>&nbs= p;   + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;= OR
>    BUSINESS
>    + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THE= ORY OF LIABILITY,
>    WHETHER IN
>    + * CONTRACT, STRICT LIABILITY,= OR TORT (INCLUDING NEGLIGENCE OR
>  &nbs= p; OTHERWISE)
>    + * ARISING IN = ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
= >    ADVISED OF THE
>  &nbs= p; + * POSSIBILITY OF SUCH DAMAGE.
>  &n= bsp; + */
>    +#ifndef _SSP_STRIN= GS_H_
>    +#define _SSP_STRINGS_H_=
>    +
&= gt;    +#include <ssp/ssp.h>
>= ;    +#include <string.h>
>&n= bsp;   +
>    +#if __SSP_FORT= IFY_LEVEL > 0
>    +
>    +#define _ssp_bcopy(srcvar, src, dstvar, = dst, lenvar,  len) ({    \
&g= t;    +    const void *srcvar =3D (src);  &n= bsp;         \
>=     +    void *dstvar =3D (dst);    &nb= sp;       \
>  &= nbsp; +    size_t lenvar =3D (len);     &nbs= p;      \
>    = +    ((__ssp_bos0(dstvar) !=3D (size_t)-1) ?    \<= br>
>    +    __builtin___mem= move_chk(dstvar, srcvar, lenvar,    \
>    +        __ssp_bos0(dstvar)) :&n= bsp;           \
>    +    __memmove_ichk(dstvar, srcvar, l= envar));    \
>    += })
>    +
>    +#define    bcopy(src, dst, len) &n= bsp;          \
>    +    _ssp_bcopy(__ssp_var(srcv), src, __ssp_= var(dstv), dst,
>    __ssp_var(lenv= ), len)
>    +
>    +#define _ssp_bzero(dstvar, dst, lenvar, len) ({&n= bsp;       \
>  =   +    void *dstvar =3D (dst);     &nbs= p;      \
>    = +    size_t lenvar =3D (len);       = ;     \
>    + =   ((__ssp_bos0(dstvar) !=3D (size_t)-1) ?    \
>    +    __builtin___memset_chk= (dstvar, 0, lenvar,    \
> = ;   +        __ssp_bos0(dstvar)) : \
>    +    __memset_ichk(dstvar, 0, le= nvar));        \
&g= t;    +})
>    +
>    +#define    bzero(dst,= len)    _ssp_bzero(__ssp_var(dstv), dst,
>    __ssp_var(lenv), len)
>    +
>    +#endif = /* __SSP_FORTIFY_LEVEL > 0 */
>   = ; +#endif /* _SSP_STRINGS_H_ */
>   = ; diff --git a/include/ssp/unistd.h b/include/ssp/unistd.h
>    new file mode 100644
>    index 000000000000..2414e2baa96b
>    --- /dev/null
>  =   +++ b/include/ssp/unistd.h
>  &nb= sp; @@ -0,0 +1,54 @@
>    +/* = ;   $NetBSD: unistd.h,v 1.7 2015/06/25 18:41:03 joerg Exp $ =    */
>    +
>    +/*-
>  =   + *
>    + * SPDX-License-I= dentifier: BSD-2-Clause
>    + *
>    + * Copyright (c) 2006 The NetBS= D Foundation, Inc.
>    + * All rig= hts reserved.
>    + *
>    + * This code is derived from software con= tributed to The NetBSD
>    Foundat= ion
>    + * by Christos Zoulas.
>    + *
&g= t;    + * Redistribution and use in source and binary forms, wit= h or without
>    + * modification,= are permitted provided that the following conditions
>    + * are met:
>  &= nbsp; + * 1. Redistributions of source code must retain the above copyrigh= t
>    + *    notice, thi= s list of conditions and the following disclaimer.
>    + * 2. Redistributions in binary form must reproduce t= he above copyright
>    + *  &= nbsp; notice, this list of conditions and the following disclaimer
>    in the
>&= nbsp;   + *    documentation and/or other materials provide= d with the
>    distribution.
>    + *
>&= nbsp;   + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. = AND
>    CONTRIBUTORS
>    + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WA= RRANTIES, INCLUDING, BUT
>    NOT L= IMITED
>    + * TO, THE IMPLIED WAR= RANTIES OF MERCHANTABILITY AND FITNESS FOR A
>=     PARTICULAR
>    + * = PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
=
>    CONTRIBUTORS
= >    + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPEC= IAL,
>    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 LI= ABILITY,
>    WHETHER IN
<= div dir=3D"ltr">>    + * CONTRACT, STRICT LIABILITY, OR TORT = (INCLUDING NEGLIGENCE OR
>    OTHER= WISE)
>    + * ARISING IN ANY WAY O= UT OF THE USE OF THIS SOFTWARE, EVEN IF
> = ;   ADVISED OF THE
>    + * P= OSSIBILITY OF SUCH DAMAGE.
>    + *= /
>    +#ifndef _SSP_UNISTD_H_
<= /div>
>    +#define _SSP_UNISTD_H_
<= div dir=3D"ltr">>    +
>  &= nbsp; +#include <ssp/ssp.h>
>  &nb= sp; +
>    +#if __SSP_FORTIFY_LEVE= L > 0
>    +__BEGIN_DECLS
>    +
>&nbs= p;   +__ssp_redirect0(ssize_t, read, (int __fd, void *__buf, size_t _= _len), \
>    +    (__fd,= __buf, __len));
>    +
>    +__ssp_redirect(ssize_t, readlink, (const= char *__restrict __path, \
>    +&= nbsp;   char *__restrict __buf, size_t __len), (__path, __buf, __len))= ;
>    +
= >    +__ssp_redirect_raw(char *, getcwd, getcwd, (char *__buf= , size_t __len),
>    +   = ; (__buf, __len), __buf !=3D 0, __ssp_bos);
>&= nbsp;   +
>    +__END_DECLS
>    +
>= ;    +#endif /* __SSP_FORTIFY_LEVEL > 0 */
>    +#endif /* _SSP_UNISTD_H_ */
>    diff --git a/lib/libc/secure/Makefile.inc b/lib= /libc/secure/Makefile.inc
>    inde= x 8574c5a05dc5..3b1ad879c715 100644
>  &n= bsp; --- a/lib/libc/secure/Makefile.inc
>&nbs= p;   +++ b/lib/libc/secure/Makefile.inc
>= ;    @@ -3,6 +3,17 @@
>
<= div dir=3D"ltr">>    .PATH: ${LIBC_SRCTOP}/secure
>
>    +# _FORTI= FY_SOURCE
>    +SRCS+=3D  = ;  gets_chk.c fgets_chk.c memcpy_chk.c memmove_chk.c
>    memset_chk.c \
>&n= bsp;   +    snprintf_chk.c sprintf_chk.c stpcpy_chk.c = stpncpy_chk.c \
>    +  &= nbsp; strcat_chk.c strcpy_chk.c strncat_chk.c strncpy_chk.c \
>    +    vsnprintf_chk.c vsprint= f_chk.c
>    +
>    +CFLAGS.snprintf_chk.c+=3D    -Wno-= unused-parameter
>    +CFLAGS.sprin= tf_chk.c+=3D    -Wno-unused-parameter
>    +CFLAGS.vsnprintf_chk.c+=3D    -Wno-u= nused-parameter
>    +CFLAGS.vsprin= tf_chk.c+=3D    -Wno-unused-parameter
>    +
>    # Sou= rces common to both syscall interfaces:
> = ;   SRCS+=3D    stack_protector.c \
>          stack_protector_compat= .c
>    diff --git a/lib/libc/secur= e/Symbol.map b/lib/libc/secure/Symbol.map
>&nb= sp;   index 641f451b5421..7859fcee3821 100644
>    --- a/lib/libc/secure/Symbol.map
>    +++ b/lib/libc/secure/Symbol.map
>    @@ -3,3 +3,21 @@ FBSD_1.0 {
>          __stack_chk_fail;
<= /div>
>          __stack_c= hk_guard;
>    };
>    +
>    = +FBSD_1.8 {
>    +   = ; __gets_chk;
>    +  &nb= sp; __fgets_chk;
>    +  =   __memcpy_chk;
>    + &n= bsp;  __memmove_chk;
>    +&nb= sp;   __memset_chk;
>    = +    __snprintf_chk;
>  &n= bsp; +    __sprintf_chk;
>&nbs= p;   +    __stpcpy_chk;
>=     +    __stpncpy_chk;
>    +    __strcat_chk;
>    +    __strcpy_chk;
>    +    __strncat_chk;
>    +    __strncpy_chk;
>    +    __vsnprintf_chk;<= br>
>    +    __vsprintf= _chk;
>    +};
>    diff --git a/lib/libc/secure/fgets_chk.c b/lib/lib= c/secure/fgets_chk.c
>    new file = mode 100644
>    index 000000000000= ..72aa1d816ce1
>    --- /dev/null
>    +++ b/lib/libc/secure/fgets_chk= .c
>    @@ -0,0 +1,54 @@
<= div dir=3D"ltr">>    +/*-
> = ;   + *
>    + * SPDX-License= -Identifier: BSD-2-Clause
>    + *<= br>
>    + * Copyright (c) 2006 The Net= BSD Foundation, Inc.
>    + * All r= ights reserved.
>    + *
<= div dir=3D"ltr">>    + * This code is derived from software c= ontributed to The NetBSD
>    Found= ation
>    + * by Christos Zoulas.<= br>
>    + *
= >    + * Redistribution and use in source and binary forms, w= ith or without
>    + * modificatio= n, are permitted provided that the following conditions
>    + * are met:
>&nbs= p;   + * 1. Redistributions of source code must retain the above copy= right
>    + *    notice,= this list of conditions and the following disclaimer.
>    + * 2. Redistributions in binary form must reprodu= ce the above copyright
>    + *&nbs= p;   notice, this list of conditions and the following disclaimer
<= /div>
>    in the
&= gt;    + *    documentation and/or other materials pro= vided with the
>    distribution.
>    + *
&= gt;    + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, I= NC. AND
>    CONTRIBUTORS
=
>    + * ``AS IS'' AND ANY EXPRESS OR IMPLIE= D WARRANTIES, INCLUDING, BUT
>    N= OT LIMITED
>    + * TO, THE IMPLIED= WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
= >    PARTICULAR
>    = + * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
>    CONTRIBUTORS
>    + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, = SPECIAL,
>    EXEMPLARY, OR
>    + * CONSEQUENTIAL DAMAGES (INCLUDING,= BUT NOT LIMITED TO, PROCUREMENT OF
>  &n= bsp; + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
>    BUSINESS
>    + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY O= F LIABILITY,
>    WHETHER IN
>    + * CONTRACT, STRICT LIABILITY, OR T= ORT (INCLUDING NEGLIGENCE OR
>    O= THERWISE)
>    + * ARISING IN ANY W= AY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
>&= nbsp;   ADVISED OF THE
>    += * POSSIBILITY OF SUCH DAMAGE.
>    = + */
>    +#include <sys/cdefs.= h>
>    +__RCSID("$NetBSD: fgets= _chk.c,v 1.6 2009/02/05 05:41:51 lukem Exp $");
&= gt;    +
>    +#include = <limits.h>
>    +#include <= ;stdio.h>
>    +#include <std= lib.h>
>    +#include <string= .h>
>    +
>    +#include <ssp/stdio.h>
>    +#include <ssp/string.h>
>    +#undef fgets
> =   +
>    +char *
>    +__fgets_chk(char * __restrict buf, int l= en, size_t slen, FILE *fp)
>    +{<= br>
>    +    if (slen &= gt;=3D (size_t)INT_MAX)
>    + = ;       return (fgets(buf, len, fp));
>    +
>  &nb= sp; +    if (len >=3D 0 && (size_t)len > slen= )
>    +     &n= bsp;  __chk_fail();
>    +
=
>    +    return (fgets= (buf, len, fp));
>    +}
<= div dir=3D"ltr">>    diff --git a/lib/libc/secure/gets_chk.c = b/lib/libc/secure/gets_chk.c
>    n= ew file mode 100644
>    index 0000= 00000000..18c1e2d18f43
>    --- /de= v/null
>    +++ b/lib/libc/secure/g= ets_chk.c
>    @@ -0,0 +1,74 @@
=
>    +/*-
&g= t;    + *
>    + * SPDX-= License-Identifier: BSD-2-Clause
>   = ; + *
>    + * Copyright (c) 2006 = The NetBSD Foundation, Inc.
>    + = * All rights reserved.
>    + *
=
>    + * This code is derived from sof= tware contributed to The NetBSD
>   = Foundation
>    + * by Christos Z= oulas.
>    + *
>    + * Redistribution and use in source and binary= forms, with or without
>    + * mo= dification, are permitted provided that the following conditions
<= div dir=3D"ltr">>    + * are met:
&= gt;    + * 1. Redistributions of source code must retain the abo= ve 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 disclaim= er
>    in the
>    + *    documentation and/or other materi= als provided with the
>    distribu= tion.
>    + *
>    + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDA= TION, INC. AND
>    CONTRIBUTORS
>    + * ``AS IS'' AND ANY EXPRESS OR= IMPLIED WARRANTIES, INCLUDING, BUT
>  &n= bsp; NOT LIMITED
>    + * TO, THE = IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
>    PARTICULAR
> =   + * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION= OR
>    CONTRIBUTORS
>    + * BE LIABLE FOR ANY DIRECT, INDIRECT, INC= IDENTAL, SPECIAL,
>    EXEMPLARY, O= R
>    + * CONSEQUENTIAL DAMAGES (I= NCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
>=     + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROF= ITS; OR
>    BUSINESS
>    + * INTERRUPTION) HOWEVER CAUSED AND ON ANY= THEORY OF LIABILITY,
>    WHETHER = IN
>    + * CONTRACT, STRICT LIABIL= ITY, 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 <s= ys/cdefs.h>
>    +__RCSID("$NetB= SD: gets_chk.c,v 1.7 2013/10/04 20:49:16 christos Exp
>    $");
>    +=
>    +#include <limits.h>
>    +#include <stdio.h>
>    +#include <stdlib.h>
=
>    +#include <string.h>
>    +
>  &nb= sp; +#include <ssp/stdio.h>
>  &nb= sp; +#include <ssp/string.h>
>  &n= bsp; +
>    +char *__gets_unsafe(c= har *);
>    +
>    +char *
>   = ; +__gets_chk(char * __restrict buf, size_t slen)
>    +{
>    + = ;   char *abuf;
>    +&nb= sp;   size_t len;
>    +<= br>
>    +    if (slen &= gt;=3D (size_t)INT_MAX)
>    + = ;       return (__gets_unsafe(buf));
>    +
>  &nbs= p; +    if ((abuf =3D malloc(slen + 1)) =3D=3D NULL)
>    +      &nbs= p; return (__gets_unsafe(buf));
>   = +
>    +    if (fg= ets(abuf, (int)(slen + 1), stdin) =3D=3D NULL) {
= >    +        free(abuf);
>    +      &nb= sp; return (NULL);
>    + &nbs= p;  }
>    +
>    +    len =3D strlen(abuf);
>    +    if (len > 0 = && abuf[len - 1] =3D=3D '\n')
>  =   +        --len;
>    +
>    +&nb= sp;   if (len >=3D slen)
>  =   +        __chk_fail();
>    +
>   = ; +    (void)memcpy(buf, abuf, len);
>    +
>    +&nbs= p;   buf[len] =3D '\0';
>  &nbs= p; +    free(abuf);
>  &n= bsp; +    return (buf);
> = ;   +}
>    diff --git a/lib/= libc/secure/memcpy_chk.c b/lib/libc/secure/memcpy_chk.c
>    new file mode 100644
= >    index 000000000000..99cf2d5f13ff
>    --- /dev/null
>  &n= bsp; +++ b/lib/libc/secure/memcpy_chk.c
>&nbs= p;   @@ -0,0 +1,53 @@
>    +/= *-
>    + *
>    + * SPDX-License-Identifier: BSD-2-Clause
>    + *
>  =   + * Copyright (c) 2006 The NetBSD Foundation, Inc.
>    + * All rights reserved.
>    + *
>    + = * This code is derived from software contributed to The NetBSD
>    Foundation
>&= nbsp;   + * by Christos Zoulas.
>  =   + *
>    + * Redistribution= and use in source and binary forms, with or without
>    + * modification, are permitted provided that the fo= llowing conditions
>    + * are met= :
>    + * 1. Redistributions of so= urce code must retain the above copyright
>&nb= sp;   + *    notice, this list of conditions and the follow= ing disclaimer.
>    + * 2. Redistr= ibutions in binary form must reproduce the above copyright
>    + *    notice, this list of conditio= ns and the following disclaimer
>   = in the
>    + *    docu= mentation and/or other materials provided with the
>    distribution.
>  &nb= sp; + *
>    + * THIS SOFTWARE IS = PROVIDED BY THE NETBSD FOUNDATION, INC. AND
>&= nbsp;   CONTRIBUTORS
>    + *= ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
<= div dir=3D"ltr">>    NOT LIMITED
&g= t;    + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITN= ESS FOR A
>    PARTICULAR
=
>    + * PURPOSE ARE DISCLAIMED.  IN NO= EVENT SHALL THE FOUNDATION OR
>    = CONTRIBUTORS
>    + * BE LIABLE FO= R 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
>  &nb= sp; BUSINESS
>    + * INTERRUPTION= ) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
= >    WHETHER IN
>    = + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
<= div dir=3D"ltr">>    OTHERWISE)
>= ;    + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVE= N IF
>    ADVISED OF THE
<= div dir=3D"ltr">>    + * POSSIBILITY OF SUCH DAMAGE.
>    + */
>&nb= sp;   +#include <sys/cdefs.h>
>&nb= sp;   +__RCSID("$NetBSD: memcpy_chk.c,v 1.7 2015/05/13 19:57:16 joerg= Exp $");
>    +
>    +#include <string.h>
>    +
>    +#i= nclude <ssp/string.h>
>    +#= undef memcpy
>    +
>    +#include "ssp_internal.h"
>    +
>    = +void *
>    +__memcpy_chk(void * _= _restrict dst, const void * __restrict src,
>&= nbsp;   size_t len,
>    +&nb= sp;   size_t slen)
>    +{
=
>    +    if (len > = slen)
>    +    &nbs= p;   __chk_fail();
>    +=
>    +    if (__ssp= _overlap((const char *)src, (const char *)dst, len))
>    +        __chk_fail();=
>    +
&= gt;    +    return (memcpy(dst, src, len));
>    +}
>&n= bsp;   diff --git a/lib/libc/secure/memmove_chk.c
>    b/lib/libc/secure/memmove_chk.c
>    new file mode 100644
>    index 000000000000..07f965d608fc
>    --- /dev/null
>  =   +++ b/lib/libc/secure/memmove_chk.c
>&= nbsp;   @@ -0,0 +1,47 @@
>    = +/*-
>    + *
>    + * SPDX-License-Identifier: BSD-2-Clause
>    + *
>&nbs= p;   + * Copyright (c) 2006 The NetBSD Foundation, Inc.
>    + * All rights reserved.
>    + *
>   = + * This code is derived from software contributed to The NetBSD
>    Foundation
&= gt;    + * by Christos Zoulas.
>&nb= sp;   + *
>    + * Redistribu= tion and use in source and binary forms, with or without
>    + * modification, are permitted provided that t= he following conditions
>    + * ar= e met:
>    + * 1. Redistributions = of source code must retain the above copyright
&g= t;    + *    notice, this list of conditions and the f= ollowing disclaimer.
>    + * 2. Re= distributions in binary form must reproduce the above copyright
>    + *    notice, this list of con= ditions and the following disclaimer
>  &= nbsp; in the
>    + *   = documentation and/or other materials provided with the
>    distribution.
>&nb= sp;   + *
>    + * THIS SOFTW= ARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
>    CONTRIBUTORS
>  &nbs= p; + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
=
>    NOT LIMITED
>    + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY A= ND FITNESS FOR A
>    PARTICULAR
>    + * PURPOSE ARE DISCLAIMED. = ; IN NO EVENT SHALL THE FOUNDATION OR
>  =   CONTRIBUTORS
>    + * BE LI= ABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
>    EXEMPLARY, OR
>  &n= bsp; + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT= OF
>    + * SUBSTITUTE GOODS OR SE= RVICES; LOSS OF USE, DATA, OR PROFITS; OR
>&nb= sp;   BUSINESS
>    + * INTER= RUPTION) 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 SOFT= WARE, EVEN IF
>    ADVISED OF THE
>    + * POSSIBILITY OF SUCH DAMAGE.=
>    + */
>    +#include <sys/cdefs.h>
>    +__RCSID("$NetBSD: memmove_chk.c,v 1.6 2020/09/05 13:3= 7:59 mrg Exp $");
>    +
<= div dir=3D"ltr">>    +#include <string.h>
>    +
>  &nbs= p; +#include <ssp/string.h>
>  &nb= sp; +#undef memmove
>    +
>    +void *
>= ;    +__memmove_chk(void *dst, const void *src, size_t len,
<= /div>
>    +    size_t slen)
>    +{
>&nb= sp;   +    if (len > slen)
>    +        __chk_fail();
>    +    return (mem= move(dst, src, len));
>    +}
>    diff --git a/lib/libc/secure/memset= _chk.c b/lib/libc/secure/memset_chk.c
>  =   new file mode 100644
>    i= ndex 000000000000..f337be98b46d
>   = --- /dev/null
>    +++ b/lib/libc= /secure/memset_chk.c
>    @@ -0,0 += 1,46 @@
>    +/*-
>    + *
>   = + * SPDX-License-Identifier: BSD-2-Clause
>&= nbsp;   + *
>    + * Copyrigh= t (c) 2006 The NetBSD Foundation, Inc.
> =   + * All rights reserved.
>  &nbs= p; + *
>    + * This code is deriv= ed from software contributed to The NetBSD
>&n= bsp;   Foundation
>    + * by= Christos Zoulas.
>    + *
>    + * Redistribution and use in source a= nd binary forms, with or without
>   = ; + * modification, are permitted provided that the following conditions
>    + * are met:
>    + * 1. Redistributions of source code must reta= in the above copyright
>    + *&nbs= p;   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 followin= g disclaimer
>    in the
<= div dir=3D"ltr">>    + *    documentation and/or ot= her materials provided with the
>   = distribution.
>    + *
<= div dir=3D"ltr">>    + * THIS SOFTWARE IS PROVIDED BY THE NET= BSD FOUNDATION, INC. AND
>    CONTR= IBUTORS
>    + * ``AS IS'' AND ANY = EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
>= ;    NOT LIMITED
>    + = * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
=
>    PARTICULAR
&g= t;    + * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FO= UNDATION OR
>    CONTRIBUTORS
>    + * BE LIABLE FOR ANY DIRECT, INDIR= ECT, INCIDENTAL, SPECIAL,
>    EXEM= PLARY, OR
>    + * CONSEQUENTIAL DA= MAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
>    + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,= OR PROFITS; OR
>    BUSINESS
>    + * INTERRUPTION) HOWEVER CAUSED AN= D ON ANY THEORY OF LIABILITY,
>    = WHETHER IN
>    + * CONTRACT, STRIC= T 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.
&= gt;    + */
>    +#inclu= de <sys/cdefs.h>
>    +__RCSI= D("$NetBSD: memset_chk.c,v 1.5 2014/09/17 00:39:28 joerg Exp $");
=
>    +
>  =   +#include <string.h>
>  &nb= sp; +
>    +#include <ssp/strin= g.h>
>    +#undef memset
>    +
> = ;   +void *
>    +__memset_ch= k(void * __restrict dst, int val, size_t len, size_t slen)
>    +{
>   = +    if (len > slen)
>&nbs= p;   +        __chk_fail();
>    +    return (memset(dst, v= al, len));
>    +}
>    diff --git a/lib/libc/secure/snprintf_chk.c
>    b/lib/libc/secure/snprintf_chk.c=
>    new file mode 100644
>    index 000000000000..52ef874ede5b
>    --- /dev/null
>    +++ b/lib/libc/secure/snprintf_chk.c
>    @@ -0,0 +1,56 @@
&= gt;    +/*-
>    + *
=
>    + * SPDX-License-Identifier: BSD-= 2-Clause
>    + *
>    + * Copyright (c) 2006 The NetBSD Foundation, I= nc.
>    + * All rights reserved.
>    + *
&= gt;    + * This code is derived from software contributed to The= NetBSD
>    Foundation
>    + * by Christos Zoulas.
>    + *
>   = + * Redistribution and use in source and binary forms, with or without
>    + * modification, are permitted = provided that the following conditions
> =   + * are met:
>    + * 1. R= edistributions of source code must retain the above copyright
>    + *    notice, this list of condi= tions and the following disclaimer.
>  &n= bsp; + * 2. Redistributions in binary form must reproduce the above copyri= ght
>    + *    notice, t= his list of conditions and the following disclaimer
>    in the
>    += *    documentation and/or other materials provided with the
<= /div>
>    distribution.
>    + *
>    += * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
>    CONTRIBUTORS
&g= t;    + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLU= DING, BUT
>    NOT LIMITED
>    + * TO, THE IMPLIED WARRANTIES OF MERC= HANTABILITY AND FITNESS FOR A
>    = PARTICULAR
>    + * PURPOSE ARE DIS= CLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
>    CONTRIBUTORS
>  &nbs= p; + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
<= div dir=3D"ltr">>    EXEMPLARY, OR
= >    + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO= , PROCUREMENT OF
>    + * SUBSTITUT= E GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
>    BUSINESS
>  &nbs= p; + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
>    WHETHER IN
>    + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGL= IGENCE OR
>    OTHERWISE)
=
>    + * ARISING IN ANY WAY OUT OF THE USE O= F THIS SOFTWARE, EVEN IF
>    ADVIS= ED OF THE
>    + * POSSIBILITY OF S= UCH DAMAGE.
>    + */
>    +#include <sys/cdefs.h>
>    +__RCSID("$NetBSD: snprintf_chk.c,v 1.5 200= 8/04/28 20:23:00 martin
>    Exp $"= );
>    +
>    +#include <stdarg.h>
&g= t;    +#include <stdio.h>
>&n= bsp;   +
>    +#include <s= sp/stdio.h>
>    +#undef vsnprin= tf
>    +
>    +int
>    +__sn= printf_chk(char * __restrict buf, size_t len, int flags, size_t
>    slen,
> = ;   +    const char * __restrict fmt, ...)
>    +{
>   = +    va_list ap;
>  &nbs= p; +    int rv;
>   = +
>    +    if (le= n > slen)
>    +  &nbs= p;     __chk_fail();
>  &n= bsp; +
>    +    va= _start(ap, fmt);
>    +  =   rv =3D vsnprintf(buf, len, fmt, ap);
>&= nbsp;   +    va_end(ap);
>= ;    +
>    +  = ;  return (rv);
>    +}
>    diff --git a/lib/libc/secure/sprintf= _chk.c
>    b/lib/libc/secure/sprin= tf_chk.c
>    new file mode 100644<= br>
>    index 000000000000..d4c42ccba3= ce
>    --- /dev/null
>    +++ b/lib/libc/secure/sprintf_chk.c
>    @@ -0,0 +1,61 @@
>    +/*-
>    = + *
>    + * SPDX-License-Identifie= r: BSD-2-Clause
>    + *
<= div dir=3D"ltr">>    + * Copyright (c) 2006 The NetBSD Founda= tion, Inc.
>    + * All rights rese= rved.
>    + *
>    + * This code is derived from software contributed= to The NetBSD
>    Foundation
<= /div>
>    *** 1063 LINES SKIPPED ***
>
>
------=_Part_1357399_2058372477.1716093599883-- From nobody Sun May 19 05:09:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vhpfj1fFRz5Kldr; Sun, 19 May 2024 05:10:05 +0000 (UTC) (envelope-from joerg@bec.de) Received: from mail.bec.de (mail.bec.de [163.172.4.16]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vhpfh6ZS2z4bRd; Sun, 19 May 2024 05:10:04 +0000 (UTC) (envelope-from joerg@bec.de) Authentication-Results: mx1.freebsd.org; none From: =?ISO-8859-1?Q?J=F6rg?= Sonnenberger DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bec.de; s=mail; t=1716095397; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oFlPLDWldszaklAXAFgHXS1Dn6qjJZ7CCGuQyU91xw8=; b=Glmd1NagSyNsuvDm0YqWxCvSEuQ1k8w801ChkwYh1BPAc0IQlzmI7/1fiq9wFHLwxVVrqU EnxjlnBz1Udbi2QQG66hz+yNSey1EfygLR8ofpF6fsxT3lTimYnBw9HYYK2l9gsL84gCoR LigGLhyon1StvHw2e/v2MfmOt2p1NaL01EiLqQldsRjIxbmyOIDsKxAioMZV3kVwj+cmLr Y+wdodbHvOuAAXmIUyISG6xuMxhdvDPhGd07ePMQK+1VXx6xCMV8U5fWXLgFSWKZuWga2T UxJH4zNzs0TcGQDWsJjdl30vHllii3bmr6evsx5dKC5zx21vqubO3u1hzm9pfg== To: Kyle Evans , dev-commits-src-all@freebsd.org Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" , Pedro Giffuni Subject: Re: git: be04fec42638 - main - Import _FORTIFY_SOURCE implementation from NetBSD Date: Sun, 19 May 2024 07:09:56 +0200 Message-ID: <4888579.OV4Wx5bFTl@britannica.bec.de> In-Reply-To: <1413980952.1357400.1716093599901@mail.yahoo.com> References: <02326b5e-a1fe-4411-a869-d21f9a76130c@email.android.com> <6276b721-6c7b-41cd-9d1b-4169e86ec5e9@FreeBSD.org> <1413980952.1357400.1716093599901@mail.yahoo.com> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="nextPart26428586.1r3eYUQgxm" Content-Transfer-Encoding: 7Bit X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:12876, ipnet:163.172.0.0/16, country:FR] X-Rspamd-Queue-Id: 4Vhpfh6ZS2z4bRd This is a multi-part message in MIME format. --nextPart26428586.1r3eYUQgxm Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" On Sunday, May 19, 2024 6:39:59=E2=80=AFAM GMT+2 Pedro Giffuni wrote: > FWIW .. and let me be clear I haven't worked on this in ages and I am no= t planning to retake this either... > clang just couldn't do the static fortify_source checks due to the way = llvm uses an intermediate representation; the size just couldn't be handled= in the preprocessor. That hasn't been true for a long time. __builtin_object_size is only folded in the frontend if it absolutely has to because the context requires an Integer Constant Expression, otherwise it is folded only if the answer is definite. In all other cases it is left for the IR passes = to lower. > fortify_source does replace some key libc functions with memory checking = alternatives and that turns out to be annoying when debugging. Since the wrapper functions are always_inline, they are pretty much invisib= le to debuggers. Joerg --nextPart26428586.1r3eYUQgxm Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="utf-8"

On Sunday, May 19, 2024 6:39:59=E2=80=AFAM GMT+2 Pedro Giffuni wrote:

>= ;  FWIW .. and let me be clear I haven't worked on this in ages and I = am not planning to retake this either...

>= ; clang just couldn't do the static=C2=A0 fortify_source checks=C2=A0 due t= o the way llvm uses an intermediate representation; the size just couldn't = be handled in the preprocessor.


That hasn't been true for a long time. __builtin_object_size is only

fol= ded in the frontend if it absolutely has to because the context

req= uires an Integer Constant Expression, otherwise it is folded only

if = the answer is definite. In all other cases it is left for the IR passes to<= /p>

low= er.


> fortify_source does replace some key libc functions with memory che= cking alternatives and that turns out to be annoying when debugging.


Since the wrapper functions are always_inline, they are pretty much invi= sible to debuggers.


Joerg

--nextPart26428586.1r3eYUQgxm-- From nobody Sun May 19 05:12:58 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vhpk45mpjz5Kllc; Sun, 19 May 2024 05:13:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vhpk413Dfz4c1b; Sun, 19 May 2024 05:13:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716095580; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MfGtBBNaI5vw1dLcZlPqGYHdS6oG27xEPLASdUxFIOY=; b=IxItk7BZc8nDy1k//JPrCkNJfETGVq5u0OzCaxnZnE/+MS7uB3nrpgTltTr+WTQ3bR8eGX gVPsk51w8bJzInoV7TyFpCLf8D5g3rvr1bSh5qq/VRqjQe/x8aXiiC99rD8z9WT1cv4c4h TKU7xj80wlT90U0KrWQweqUf1wT1DSU0a90KImMRw1xqd3JBjPHFBCY7AOm/ZU3vr0HFvi 5EL4ohUXEbXJfptwFXLR83SwmxfLa+kSEfFwPLQIndA0TQ2BHNlGMAPrWRxZ7AJ6O2bHNn koKNBOrH47PcXRJ+XJs1ZwGMpu73c4PbyaQKaALu6EOnQaxUELDFzG5pGnelDQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716095580; a=rsa-sha256; cv=none; b=YSb83fMiGd7EUknZLJ9TkYNqNhj6a3lWqCcbr3tTfuzOdhlz7U0H0AXNy9ZAa/Q6wgBoNj Vi8Rbd/LsfPxWxpYYefBIJnQDsBMrdK1CdHd4yfWLtIgZ9jDlsuK2guKqweNAXlkYxVezg 3Te1lKtmavcy2LacI5zpzkbIm+Oh7YP+pwHQTjx0AaQAdIsE6T7/MQ8sLRazi3VsRbP+Vn 5LxRmzZ4pnxPI+YuTdJKCAprgvMF1vUVuCUvbGt+LKNl5inmRKm1zXVzqTKERiWLemFQZ9 leYnVAjikzbCGHn/5qjYGpZL2u9nYaxF4yh/fMUJZkjBsDwxkKZZzInWUmL9nQ== 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=1716095580; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MfGtBBNaI5vw1dLcZlPqGYHdS6oG27xEPLASdUxFIOY=; b=pxouevAlPbbxXfkhQoscB5G9DLJSoMFgnK5YYn4Vo6t3BIfF70VBhVqB2tWRHb07PoqYPZ DdhPvXz+prImnF4EYcq/kQag/IUqExeVCZiDfq8AaZtSgB50ErEEC6H5KeC6LYR+hPbffI sH8PhNC1FVk2lJ7eE09gsiTqOWTUPnQtq/fgp3brh0xjOVz8SPWpZxGf74wyr1VNMxnw6B 1+nWSF5M1kqvsDfnRzBKrLG8QE809XfOs/VCUvsxOOIMmoeHpdYUeLBeLV77I+GHDobSph pHp9ubGCyjb47XN0lBHrzGXXyY8jgBU99IKc/s7s1CWhGhB6R/CIXzxyEXKTkQ== Received: from [10.9.4.95] (unknown [209.182.120.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: kevans/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Vhpk32Bsmz1Hs3; Sun, 19 May 2024 05:12:59 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: <216ca4a4-c0b8-4d72-bc6f-95e82a6b77da@FreeBSD.org> Date: Sun, 19 May 2024 00:12:58 -0500 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: be04fec42638 - main - Import _FORTIFY_SOURCE implementation from NetBSD Content-Language: en-US To: Pedro Giffuni Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <02326b5e-a1fe-4411-a869-d21f9a76130c@email.android.com> <999469960.1638478.1716080957814@mail.yahoo.com> <6276b721-6c7b-41cd-9d1b-4169e86ec5e9@FreeBSD.org> <1413980952.1357400.1716093599901@mail.yahoo.com> From: Kyle Evans In-Reply-To: <1413980952.1357400.1716093599901@mail.yahoo.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 5/18/24 23:39, Pedro Giffuni wrote: > FWIW .. and let me be clear I haven't worked on this in ages and I am > not planning to retake this either... > > clang just couldn't do the static  fortify_source checks  due to the way > llvm uses an intermediate representation; the size just couldn't be > handled in the preprocessor. Google did spend some time adding extra > attributes to clang to improve the debugging and you can see that > implemented in bionic libc but that was it. musl didn't even try. > Admittedly, I have no idea what you're talking about here; none of this implementation requires any knowledge of anything at preproc time. __builtin_object_size() does the right thing, and the typically performance critical string/memory ops use __builtin___foo_chk() that do successfully get optimized away in the common case to the underlying foo() call. This all works very well with clang, I haven't tested it under GCC but, as you've noted, would assume that it works at least as well. > fortify_source does replace some key libc functions with memory checking > alternatives and that turns out to be annoying when debugging. In a way > it breaks that principle C programmers once had, where developers are > expected to know what they are doing, and if the error is caught at > runtime by the stack protector anyways it ends up being redundant. > > One more thing about the static checks. Most of the linux distributions > out there indeed have built their software packages with GCC and > fortify_source >=2. As a consequence, when we ran an exp-run on the > ports tree (with GCC), fortify_source didn't find anything: it was > basically a waste of time. > > Another reason for not setting it by default is performance. And here I > answer Shawn's comment on why not enable stack-protector-all and > safestack and fortify_source at the same time: running unnecessary > checks over and over again wastes energy and can have some performance > hit. The later may seem negligible in modern processors, but why do them > if they bring no benefit? (No need to answer ... just left as food for > thought) > > Pedro. > > On Saturday, May 18, 2024 at 09:08:52 PM GMT-5, Kyle Evans > wrote: > > > > > On 5/18/24 20:09, Pedro Giffuni wrote: > > (sorry for top posting .. my mailer just sucks) > > Hi; > > > > I used to like the limited static checking FORTIFY_SOURCE provides and > > when I ran it over FreeBSD it did find a couple of minor issues. It only > > works for GCC though. > > > > I don't think this is particularly true anymore; I haven't found a case > yet where __builtin_object_size(3) doesn't give me the correct size > while GCC did.  I'd welcome counter-examples here, though -- we have > funding to both finish the project (widen the _FORTIFY_SOURCE net to > more of libc/libsys) and add tests to demonstrate that it's both > functional and correct.  It would be useful to also document > deficiencies in the tests. > > > I guess it doesn't really hurt to have FORTIFY_SOURCE around and NetBSD > > had the least intrusive implementation the last time I checked but I > > would certainly request it should never be activated by default, > > specially with clang. The GCC version has seen more development on glibc > > but I still think its a dead end. > > > > I don't see a compelling reason to avoid enabling it by default; see > above, the functionality that we need in clang appears to be just fine > (and, iirc, was also fine when I checked at the beginning of working on > this in 2021) and it provides useful > > > What I would like to see working on FreeBSD is Safestack as a > > replacement for the stack protector, which we were so very slow to adopt > > even when it was originally developed in FreeBSD. I think other projects > > based on FreeBSD (Chimera and hardenedBSD) have been using it but I > > don't know the details. > > > > No comment there, though I think Shawn Webb / HardenedBSD had been > playing around with SafeStack (and might have enabled it? I haven't > actually looked in a while now). > > > This is just all my $0.02 > > > > Pedro. > > Thanks, > > Kyle Evans > > > > > On Saturday, May 18, 2024 at 05:54:42 PM GMT-5, Kyle Evans > > > wrote: > > > > > > > > > > On May 18, 2024 13:42, Pedro Giffuni > wrote: > > > >    Oh no .. please not... > > > >    We went into that in a GSoC: > > > > > https://wiki.freebsd.org/SummerOfCode2015/FreeBSDLibcSecurityExtensions > > > > > > > >    Ultimately it proved to be useless since stack-protector-strong. > > > > > > Respectfully, I disagree with your conclusion here: > > > > 1.) _FORTIFY_SOURCE provides more granular detection of overflow; I > > don't have to overflow all the way into the canary at the end of the > > frame to be detected, so my minor bug now can be caught before something > > causes the stack frame to be rearranged and turn it into a security > > issue later > > > > 2.) __builtin_object_size doesn't work on heap objects, but it actually > > can work on subobjects from a heap allocation (e.g., &foo->name), so the > > coverage extends beyond the stack into starting to detect other kinds of > > overflow > > > > While the security value over stack-protector-strong may be marginal (I > > won't debate this specifically), the feature still has value in general. > > > > Thanks, > > > > Kyle Evans > From nobody Sun May 19 12:54:37 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vj0yj5Zvrz5JyhD; Sun, 19 May 2024 12:54: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 4Vj0yj4TDWz4FRW; Sun, 19 May 2024 12:54:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716123277; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B3N4Z58bNWCdT5a9JaD8fG/MilWmLR65dHZ3xTdmIzY=; b=XZ+eAP+22MEK1hcD7Y08Wt3lqo4bD0bodT0CAERQeSBqtI54muUqN6/oGO3aqVKUE4d1OO N5zw2/QR81tSqUiNAYFCodIaNSMQp2CDYc+3kd8DzccWCgbSmeb87vIN0U3hOWRAGsLK1j y+2+35pAgFpbUJvfjRFw1ATgOpW+plzgOTpd4v0qfL5wOX8sPYY430OS3TznyA+5a97Vox RsEIEhDu+FEwxZmpX3wPjLcrSmdEXyG/DWLJN5eSZkKl4Jx123InrD7nLtoHSMtDHu5Ve9 X6oNKxYDOpwHnfRCEYUdn72LPq0F3XkCmC9MfV/OmjKUiWruGl5EhMQrf4fDFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716123277; a=rsa-sha256; cv=none; b=qiRXeFQS7mM8T0Vi9bJwaH3shvd51xMrF5lRcw7JawwxSCnp2YRGXMAZWfSnriIATN9Ybw 0tdfIWFUGXQAN7z2AOIc6a0yCoao/6TWLaG80+hZIlKklUHOq478k6NcvxYIFvpOuajZcl xOJz4sscWywD6hMswwPI/qyhYsnNydQNokcWmFzWWCtrD8TQPONqum/OQhjdaoLHb06fZY sLmcombr26AQk2iSKh2UDiZ2K2mQ2VtccTnvkgE4WkHeVQTflH71prwlGMew6dwTZMpahv QNlrgLELEIXLcQUkSVp2tJGNwwimbG3pWcYU7HlCyablD26FNFTD0FIe5E2J0w== 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=1716123277; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B3N4Z58bNWCdT5a9JaD8fG/MilWmLR65dHZ3xTdmIzY=; b=RdlHDyQ9TPYlMG6gByQ4Ga+sc36w298FJwAdy//b3htvSWvElGa6C9fwtPhKrby6HNFnxD mUDvqFQeLgiudZ8fSOyw5zk46lO1DLD4CHTxARCb5rYpJ70l8AgT0bWg2H7a7dNmi/fnj7 Jl6Y9bauRTKwht2/2W3CAlU9DUWJQyyowgRUOvGqCqLlRkVlfYqlBcb4RSd+GX6wbJPiN6 vonp+sOsrB1n247RQ6eAPYuWwVHTKj4F441E3MLlZx/RF1J8QTMRttEQs6NVJsIqmvqXBT 5ql80YMjpmsArq6sfXn38FoYIO4EewNdI1Q/NtZ3XDQ1jZLFhc5SBTgVuywyXg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vj0yj45T9z19H2; Sun, 19 May 2024 12:54: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 44JCsbaP095266; Sun, 19 May 2024 12:54:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44JCsbvl095263; Sun, 19 May 2024 12:54:37 GMT (envelope-from git) Date: Sun, 19 May 2024 12:54:37 GMT Message-Id: <202405191254.44JCsbvl095263@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mariusz Zaborski Subject: git: 4b3141f5d537 - main - geli: allocate a UMA pool earlier List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4b3141f5d5373989598f9447ab5a9f87e2d1c9fb Auto-Submitted: auto-generated The branch main has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=4b3141f5d5373989598f9447ab5a9f87e2d1c9fb commit 4b3141f5d5373989598f9447ab5a9f87e2d1c9fb Author: Mariusz Zaborski AuthorDate: 2024-05-19 12:53:17 +0000 Commit: Mariusz Zaborski CommitDate: 2024-05-19 12:53:17 +0000 geli: allocate a UMA pool earlier The functions g_eli_init_uma and g_eli_fini_uma are used to trace the number of devices in GELI. There is an issue where the g_eli_create function may fail before g_eli_init_uma is called, however g_eli_fini_uma is still executed in the fail path. This can incorrectly decrease the device count to zero, potentially leading to the UMA pool being freed. Accessing the device after the pool has been freed causes a system panic. This commit resolves the issue by ensuring devices count is increassed eariler. PR: 278828 Reported by: Andre Albsmeier Reviewed by: asomers MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D45225 --- sys/geom/eli/g_eli.c | 4 +++- tests/sys/geom/class/eli/attach_test.sh | 29 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c index 5d769d606d20..ddb148ebd5db 100644 --- a/sys/geom/eli/g_eli.c +++ b/sys/geom/eli/g_eli.c @@ -1046,10 +1046,12 @@ g_eli_create(struct gctl_req *req, struct g_class *mp, struct g_provider *bpp, bioq_init(&sc->sc_queue); mtx_init(&sc->sc_queue_mtx, "geli:queue", NULL, MTX_DEF); mtx_init(&sc->sc_ekeys_lock, "geli:ekeys", NULL, MTX_DEF); + g_eli_init_uma(); pp = NULL; cp = g_new_consumer(gp); cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; + error = g_attach(cp, bpp); if (error != 0) { if (req != NULL) { @@ -1092,7 +1094,6 @@ g_eli_create(struct gctl_req *req, struct g_class *mp, struct g_provider *bpp, if (threads == 0) threads = mp_ncpus; sc->sc_cpubind = (mp_ncpus > 1 && threads == mp_ncpus); - g_eli_init_uma(); for (i = 0; i < threads; i++) { if (g_eli_cpu_is_disabled(i)) { G_ELI_DEBUG(1, "%s: CPU %u disabled, skipping.", @@ -1164,6 +1165,7 @@ g_eli_create(struct gctl_req *req, struct g_class *mp, struct g_provider *bpp, sc->sc_crypto == G_ELI_CRYPTO_SW_ACCEL ? "accelerated software" : sc->sc_crypto == G_ELI_CRYPTO_SW ? "software" : "hardware"); return (gp); + failed: mtx_lock(&sc->sc_queue_mtx); sc->sc_flags |= G_ELI_FLAG_DESTROY; diff --git a/tests/sys/geom/class/eli/attach_test.sh b/tests/sys/geom/class/eli/attach_test.sh index eb59234f014b..b6b1848f2d37 100644 --- a/tests/sys/geom/class/eli/attach_test.sh +++ b/tests/sys/geom/class/eli/attach_test.sh @@ -39,6 +39,34 @@ attach_d_cleanup() geli_test_cleanup } +atf_test_case atach_multiple_fails cleanup +attach_multiple_fails_head() +{ + atf_set "descr" "test multiple failed attach of geli provider" + atf_set "require.user" "root" +} +attach_multiple_fails_body() +{ + geli_test_setup + + sectors=1000 + attach_md md -t malloc -s `expr $sectors + 1` + atf_check dd if=/dev/random of=keyfile bs=512 count=16 status=none + + atf_check geli init -B none -P -K keyfile ${md} + atf_check geli attach -d -p -k keyfile ${md} + + for i in $(jot 100); do + atf_check -s not-exit:0 -e ignore -- geli attach -d -p -k keyfile ${md} + done + atf_check -o ignore -- newfs ${md}.eli +} +attach_multiple_fails_cleanup() +{ + geli_test_cleanup +} + + atf_test_case attach_r cleanup attach_r_head() { @@ -125,5 +153,6 @@ atf_init_test_cases() atf_add_test_case attach_d atf_add_test_case attach_r atf_add_test_case attach_multiple + atf_add_test_case attach_multiple_fails atf_add_test_case nokey } From nobody Sun May 19 13:36:47 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vj1vM2my2z5K3DR; Sun, 19 May 2024 13:36: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 4Vj1vM1vBYz4JB4; Sun, 19 May 2024 13:36:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716125807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TEwVL2L37lKYGxYA6JUZqez5t2k+2pyuJi90edqPC48=; b=PFX9THTv2Z/Jru2F/rVCUgR2kg+IKCdPdkxrSGtLk8fUYzlm9bOQHi+lGEgGWRJ7v+M3uz tl+gp6NleAzW+XJDoktSsK0FPDhZfjtHnvfM8OKmrcRt6IvYUCGWfwY02de5awmX7sr0w9 /rNlljB8imotR83mmM6h07Foxlmjiq8TCH+vsTLjUcRU7/65wPC/WyU+FQcV7vp3Ig8f2K VwbW6Xp/wyOkXQaCJA33YanbGJmTTXu1/NuicxUN+R1snUb2/PmmxxMVBfKs3WSNBLAM/7 jEU6t0HI517tuEEPASzWU+Z80xNhOz7jPsttakZUCtqtY5UeznNElMdXtJXYjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716125807; a=rsa-sha256; cv=none; b=YMnIaHCDsEzk1kXAWPdN+YDKhgaMdoLWWflGO31LsA/xRDJwl1QBDJ1C180856Fq/G+73z +DWFV9XCfICmGe9sL25F6fEYl6HLCYbZ4CYfCIBkiurj0T9BQiBkC1jl6Bb4hkegKDQzS0 imwNWspkx4nIcviRnyd0aF0YtJdcYIM8aMq2ijFYdwZVPQJ80g3A/g7LQd83otGJKi37w3 zqWTAyDlxmPYSeLJHnfeiwdoOEeylNc2Wzx2Q26zerKl2gd++XkFECyNyDPxxqcOUEiTi4 ebK1uZbmNI/nzAdk2TWE5ctRzVwxDs7cAyyz0sodNjl+jgIl512DAHRttgW2DA== 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=1716125807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TEwVL2L37lKYGxYA6JUZqez5t2k+2pyuJi90edqPC48=; b=HXxtvjpMLpOip38/seRcWHgLDCPTxzxRdAWQqXlciiLl/z7pHpwVsOpib4jclEfsGxUX5z nFJsBBnrhMObUh8dqz44grh3jAqs8+v7YAwryn2tD06xynqRBRBs6p0EwnJhmexDF5yOci bfY7Gwi7eBpmqM6yWJHHWDrek8/AY7xdj5cQU2EBjryd2IojuA9hV6NPT0dUcBbVdYyzA9 uBs/h+vsBWpVVi9X1mxA5e0FFj3KK3favaYSrS6wCyxb8seWahVs/ENZKGPxrgPYAY5eiS FaqiqyYLHkaA+v3gl+t9MlbF9mf0K/rK0yTZxTzMjkt0IdNRLHFsoPWjFHUTzg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vj1vM1VW7z1BD1; Sun, 19 May 2024 13:36: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 44JDalnD063366; Sun, 19 May 2024 13:36:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44JDalVj063363; Sun, 19 May 2024 13:36:47 GMT (envelope-from git) Date: Sun, 19 May 2024 13:36:47 GMT Message-Id: <202405191336.44JDalVj063363@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mariusz Zaborski Subject: git: 838d5ae6d82a - main - geli: fix indentation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 838d5ae6d82a604e3f3338273b24e476a4eabb39 Auto-Submitted: auto-generated The branch main has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=838d5ae6d82a604e3f3338273b24e476a4eabb39 commit 838d5ae6d82a604e3f3338273b24e476a4eabb39 Author: Mariusz Zaborski AuthorDate: 2024-05-19 13:37:07 +0000 Commit: Mariusz Zaborski CommitDate: 2024-05-19 13:37:07 +0000 geli: fix indentation no functional changes --- sys/geom/eli/g_eli.c | 252 +++++++++++++++++++++++++-------------------------- 1 file changed, 126 insertions(+), 126 deletions(-) diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c index ddb148ebd5db..a9f356299a8d 100644 --- a/sys/geom/eli/g_eli.c +++ b/sys/geom/eli/g_eli.c @@ -172,32 +172,32 @@ static void zero_boot_passcache(void) { - explicit_bzero(cached_passphrase, sizeof(cached_passphrase)); + explicit_bzero(cached_passphrase, sizeof(cached_passphrase)); } static void zero_geli_intake_keys(void) { - struct keybuf *keybuf; - int i; - - if ((keybuf = get_keybuf()) != NULL) { - /* Scan the key buffer, clear all GELI keys. */ - for (i = 0; i < keybuf->kb_nents; i++) { - if (keybuf->kb_ents[i].ke_type == KEYBUF_TYPE_GELI) { - explicit_bzero(keybuf->kb_ents[i].ke_data, - sizeof(keybuf->kb_ents[i].ke_data)); - keybuf->kb_ents[i].ke_type = KEYBUF_TYPE_NONE; - } - } - } + struct keybuf *keybuf; + int i; + + if ((keybuf = get_keybuf()) != NULL) { + /* Scan the key buffer, clear all GELI keys. */ + for (i = 0; i < keybuf->kb_nents; i++) { + if (keybuf->kb_ents[i].ke_type == KEYBUF_TYPE_GELI) { + explicit_bzero(keybuf->kb_ents[i].ke_data, + sizeof(keybuf->kb_ents[i].ke_data)); + keybuf->kb_ents[i].ke_type = KEYBUF_TYPE_NONE; + } + } + } } static void zero_intake_passcache(void *dummy) { - zero_boot_passcache(); - zero_geli_intake_keys(); + zero_boot_passcache(); + zero_geli_intake_keys(); } EVENTHANDLER_DEFINE(mountroot, zero_intake_passcache, NULL, 0); @@ -269,7 +269,7 @@ g_eli_crypto_rerun(struct cryptop *crp) static void g_eli_getattr_done(struct bio *bp) { - if (bp->bio_error == 0 && + if (bp->bio_error == 0 && !strcmp(bp->bio_attribute, "GEOM::physpath")) { strlcat(bp->bio_data, "/eli", bp->bio_length); } @@ -891,8 +891,8 @@ g_eli_init_uma(void) * likely to see. */ g_eli_alloc_sz = roundup2((PAGE_SIZE + sizeof(int) + - G_ELI_AUTH_SECKEYLEN) * nsw_cluster_max + - sizeof(uintptr_t), PAGE_SIZE); + G_ELI_AUTH_SECKEYLEN) * nsw_cluster_max + + sizeof(uintptr_t), PAGE_SIZE); g_eli_uma = uma_zcreate("GELI buffers", g_eli_alloc_sz, NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); @@ -1327,7 +1327,7 @@ g_eli_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) u_char key[G_ELI_USERKEYLEN], mkey[G_ELI_DATAIVKEYLEN]; u_int i, nkey, nkeyfiles, tries, showpass; int error; - struct keybuf *keybuf; + struct keybuf *keybuf; g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, pp->name); g_topology_assert(); @@ -1372,116 +1372,116 @@ g_eli_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) tries = g_eli_tries; } - if ((keybuf = get_keybuf()) != NULL) { - /* Scan the key buffer, try all GELI keys. */ - for (i = 0; i < keybuf->kb_nents; i++) { - if (keybuf->kb_ents[i].ke_type == KEYBUF_TYPE_GELI) { - memcpy(key, keybuf->kb_ents[i].ke_data, - sizeof(key)); - - if (g_eli_mkey_decrypt_any(&md, key, - mkey, &nkey) == 0 ) { - explicit_bzero(key, sizeof(key)); - goto have_key; - } - } - } - } - - for (i = 0; i <= tries; i++) { - g_eli_crypto_hmac_init(&ctx, NULL, 0); - - /* - * Load all key files. - */ - nkeyfiles = g_eli_keyfiles_load(&ctx, pp->name); - - if (nkeyfiles == 0 && md.md_iterations == -1) { - /* - * No key files and no passphrase, something is - * definitely wrong here. - * geli(8) doesn't allow for such situation, so assume - * that there was really no passphrase and in that case - * key files are no properly defined in loader.conf. - */ - G_ELI_DEBUG(0, - "Found no key files in loader.conf for %s.", - pp->name); - return (NULL); - } - - /* Ask for the passphrase if defined. */ - if (md.md_iterations >= 0) { - /* Try first with cached passphrase. */ - if (i == 0) { - if (!g_eli_boot_passcache) - continue; - memcpy(passphrase, cached_passphrase, - sizeof(passphrase)); - } else { - printf("Enter passphrase for %s: ", pp->name); + if ((keybuf = get_keybuf()) != NULL) { + /* Scan the key buffer, try all GELI keys. */ + for (i = 0; i < keybuf->kb_nents; i++) { + if (keybuf->kb_ents[i].ke_type == KEYBUF_TYPE_GELI) { + memcpy(key, keybuf->kb_ents[i].ke_data, + sizeof(key)); + + if (g_eli_mkey_decrypt_any(&md, key, + mkey, &nkey) == 0 ) { + explicit_bzero(key, sizeof(key)); + goto have_key; + } + } + } + } + + for (i = 0; i <= tries; i++) { + g_eli_crypto_hmac_init(&ctx, NULL, 0); + + /* + * Load all key files. + */ + nkeyfiles = g_eli_keyfiles_load(&ctx, pp->name); + + if (nkeyfiles == 0 && md.md_iterations == -1) { + /* + * No key files and no passphrase, something is + * definitely wrong here. + * geli(8) doesn't allow for such situation, so assume + * that there was really no passphrase and in that case + * key files are no properly defined in loader.conf. + */ + G_ELI_DEBUG(0, + "Found no key files in loader.conf for %s.", + pp->name); + return (NULL); + } + + /* Ask for the passphrase if defined. */ + if (md.md_iterations >= 0) { + /* Try first with cached passphrase. */ + if (i == 0) { + if (!g_eli_boot_passcache) + continue; + memcpy(passphrase, cached_passphrase, + sizeof(passphrase)); + } else { + printf("Enter passphrase for %s: ", pp->name); showpass = g_eli_visible_passphrase; if ((md.md_flags & G_ELI_FLAG_GELIDISPLAYPASS) != 0) showpass = GETS_ECHOPASS; - cngets(passphrase, sizeof(passphrase), + cngets(passphrase, sizeof(passphrase), showpass); - memcpy(cached_passphrase, passphrase, - sizeof(passphrase)); - } - } - - /* - * Prepare Derived-Key from the user passphrase. - */ - if (md.md_iterations == 0) { - g_eli_crypto_hmac_update(&ctx, md.md_salt, - sizeof(md.md_salt)); - g_eli_crypto_hmac_update(&ctx, passphrase, - strlen(passphrase)); - explicit_bzero(passphrase, sizeof(passphrase)); - } else if (md.md_iterations > 0) { - u_char dkey[G_ELI_USERKEYLEN]; - - pkcs5v2_genkey(dkey, sizeof(dkey), md.md_salt, - sizeof(md.md_salt), passphrase, md.md_iterations); - explicit_bzero(passphrase, sizeof(passphrase)); - g_eli_crypto_hmac_update(&ctx, dkey, sizeof(dkey)); - explicit_bzero(dkey, sizeof(dkey)); - } - - g_eli_crypto_hmac_final(&ctx, key, 0); - - /* - * Decrypt Master-Key. - */ - error = g_eli_mkey_decrypt_any(&md, key, mkey, &nkey); - explicit_bzero(key, sizeof(key)); - if (error == -1) { - if (i == tries) { - G_ELI_DEBUG(0, - "Wrong key for %s. No tries left.", - pp->name); - g_eli_keyfiles_clear(pp->name); - return (NULL); - } - if (i > 0) { - G_ELI_DEBUG(0, - "Wrong key for %s. Tries left: %u.", - pp->name, tries - i); - } - /* Try again. */ - continue; - } else if (error > 0) { - G_ELI_DEBUG(0, - "Cannot decrypt Master Key for %s (error=%d).", - pp->name, error); - g_eli_keyfiles_clear(pp->name); - return (NULL); - } - g_eli_keyfiles_clear(pp->name); - G_ELI_DEBUG(1, "Using Master Key %u for %s.", nkey, pp->name); - break; - } + memcpy(cached_passphrase, passphrase, + sizeof(passphrase)); + } + } + + /* + * Prepare Derived-Key from the user passphrase. + */ + if (md.md_iterations == 0) { + g_eli_crypto_hmac_update(&ctx, md.md_salt, + sizeof(md.md_salt)); + g_eli_crypto_hmac_update(&ctx, passphrase, + strlen(passphrase)); + explicit_bzero(passphrase, sizeof(passphrase)); + } else if (md.md_iterations > 0) { + u_char dkey[G_ELI_USERKEYLEN]; + + pkcs5v2_genkey(dkey, sizeof(dkey), md.md_salt, + sizeof(md.md_salt), passphrase, md.md_iterations); + explicit_bzero(passphrase, sizeof(passphrase)); + g_eli_crypto_hmac_update(&ctx, dkey, sizeof(dkey)); + explicit_bzero(dkey, sizeof(dkey)); + } + + g_eli_crypto_hmac_final(&ctx, key, 0); + + /* + * Decrypt Master-Key. + */ + error = g_eli_mkey_decrypt_any(&md, key, mkey, &nkey); + explicit_bzero(key, sizeof(key)); + if (error == -1) { + if (i == tries) { + G_ELI_DEBUG(0, + "Wrong key for %s. No tries left.", + pp->name); + g_eli_keyfiles_clear(pp->name); + return (NULL); + } + if (i > 0) { + G_ELI_DEBUG(0, + "Wrong key for %s. Tries left: %u.", + pp->name, tries - i); + } + /* Try again. */ + continue; + } else if (error > 0) { + G_ELI_DEBUG(0, + "Cannot decrypt Master Key for %s (error=%d).", + pp->name, error); + g_eli_keyfiles_clear(pp->name); + return (NULL); + } + g_eli_keyfiles_clear(pp->name); + G_ELI_DEBUG(1, "Using Master Key %u for %s.", nkey, pp->name); + break; + } have_key: /* From nobody Sun May 19 14:10:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vj2fm4hNKz5K5xp for ; Sun, 19 May 2024 14:10:56 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from sonic314-20.consmr.mail.ne1.yahoo.com (sonic314-20.consmr.mail.ne1.yahoo.com [66.163.189.146]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vj2fl6dNsz4MK0 for ; Sun, 19 May 2024 14:10:55 +0000 (UTC) (envelope-from pfg@freebsd.org) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1716127854; bh=7cj1Qyg+MPiT1VT9LMj372JWEYPpASuRVi5/YNcY8FA=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From:Subject:Reply-To; b=NNv7eAN/42eHsMoHZtGNmHU+OO7h5dn5C/nCBMezPXYrx/6d5jIFfHGh/vbtQ34IvJxhEEF1OQGCUj6cGqyk2kRGD1wyHx6lJDc9VduQMiRYBUeLwxIEfKdskg8j6YvdPtTPs6dGY84geMr4H29spdDl517XGb4GwxKJ2F1F7ye13Xp5GSAFYpdwTKHDDcp+WrrcFJXUkF8s+J1zIu2/3b8y8Mp2X4kM3cw0EIVTYjOTI8rUVEptxByEYdKdx8o5AsRc9xA+awXIlMBn03bMS7idlc1tHxfgF/mUA5r04D9oVpvnqas3SbmQMbJQ0fOc1rYbbqmV4XmdwHeRH7yQmw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1716127854; bh=yZ2B/w+fUf86P/+bQY7jekejNKia68iXuO0FjaL2s33=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=RyhdLbKaMdEJQpG7ArIKWKF53PNdQxRmYUfPCYCLHtA5zHGVGc4P6cDa9Cubo2iVcS6fj2eSGT3lNWjD2to0ty69NVMoQSu0kqhErScRho93xf9LocMdT7nITYoannePgQ1x90ANdHG9l2ZQ133UeEb+VDa6D7Hdp3ZNnheYYgdh8A8LcoXmq+DeL0xkwICOrSUfEeVKzyQGpAS68vlHEImfVnJn6utZv1/fd8SM/nmbo2N97HvkxStztHDFq+PKmjugsvtbOiVg06T4XSEjLHX8qwJEWJvV5XquZDhZsO8XHVB8AKHvyKlsuobRrUItDLgLyrF+cRUOHfTW3d64Yw== X-YMail-OSG: 3co50foVM1lId5xTcgA61gJ.JRTJSajx663xzfUCILAmTlV.v.l1SazGjLTwer2 pCyDia.xsmIQ0Vb7EFE7e0EVJY.kU_lDEGpuA16HIx5ircNvysivKAl38Kgg5yqWDVKL3o12jbfA ea.7zV9fple4iuBgcNz0JKs7bdVGy6WakXC1FMBcM_0EBwbO7O6ycrvdsRnGwvvK02FNoljcwvWG sw6GS_Ir8lcRSEy4BLX73t7JjglB3XzUmorawSM3BaYEuwPDGhwFcnKUeob5tEcs2CQQjKCcZr16 jYPcDAywo6gMgVmhO_Yy0OVo5KIG7fuS8daPkDTijZjQwdXEfU6eQeTTnO6vxsu5fbcw0hjxnLB. ltM0UIgZsvgOKJLQvTInEhk1Kx9_atkRp7K_3NTgg_WO23aeRkALIg.YVW.z8oCpRSJwEjLZAwMJ V.Kd41YQXYf26RKjY5wOcOlz9s8AtkrR97GIone8jSdQcHGEt5BtANTXGwDrseyBhoqAWz9T8TrC X2eYCl1O3x4nk64dofeX91Bchaj_ZYrP5L0CS61_ap7YqUCV.ip4dnQMhHW.KTaJi3ea5uUMFdtj qXtquR8Q.7DYC3Uch8_87DzlSw6.wLtTlNFmnXhYLEZ1KgSN2NU4jyTrUy1Nw57WKDoye21EqP5n 8BVYIUCxXkIaU0ZcdkLtCAB7HknQBnVsTSF6oh9HFvXHBwz9GtfNjsmK6YOIdlDuDG.rqdbRpxtd 7IMBH8XJgtZ4nbxnugtg_pIDXZgPmUP2QP4PXWTHXRphBYEItszhNUzUSaM09lwmz4Q_Wn3aO47E _Z5rPVcVwyN3nO.jYt1jkRbHf2e1o6XyCrrErXA3RrMo5MdusTX34m9pg5TF3MVnglSj3CYcVZ8G KcS7uWrOw3YPUofn654pLjTxRIb3CsiEpKt5aCjeRZqHtT4cIVvkUM6WqiZluyobZg5EkrxzOx.k MNqmScD5SHoqov.UUWXLuAyvpKYNh2ePWmqIaw635KbiFfd4GghaLLALZdfL03eUVo6QRLzidhCP J6TTX_i0M2AVuou0Zt.AyECerH0dM2q4QZfeBAsXzLqPMYomKhaaR3KNnLJaZROfgQTkaF3s1F6t jSDpvZil94z5n4aQt6bAM85Wx8clRvO47XNkvo5fpmbT6PTAuDDWrH3KRa2.g0Jjj5ebE2bgrtjn x8ZRsavmjaAHMy1E.HaD.0ZWjQWN2ttQPJ13YBjWT8hfwzI4kH.maWMQStErxHLiWZNThWHzmBVe HWeuDMferNJZuQDUBig1NZmEteNteOiRlo0jhkE_K61tMRoIcjZt5OIHwoNAgZZdJcNdgaXFv9sO ia_AMPEwpNLiSEuR7GFxbJhx83BXU6LQruO3LyYqGyiXsafHnrn62UEY9wvQD2P2Uzbn5eNJ9_3P Az0eQyhmNvRH7H5L_qRyb49RtqgwDxY66i04m8rcZJt3hkmumkV0ZbZptojmCEERLtlHSqGuYyN7 EpIGCFQ2YnqRVlTpzsH2ZxOv25tWRU6wrHqnaFqpOsLvHXhCsO1guSz2V0PtLiJn3gKZ5py_lYyw B1iqRq892dto64a31V3BDdlGZLb8ZqDopt1X6wYYRcfoNQJKEeBBMzDugO5uQQATMKtzHVVSV.HA LfPYpTaFR.OKhZBwdT9Q.EeHlM0zE8LfpEnoZYprremEKmTo4KhnSE2htWyB7jZv_CUUvwRDw2l1 uKafh4QAwWFNGGmQQ9ctbpiR2V_f5.4X2.HGjwGe3F.DT15Sw54enxUXikZHIL_MZxnVmzSNcE9m 6RqNae9ONfXM5jUPe0mTf2TwNUyX.LsdOz.VoTpkcFN3UsXejuZamVFx3OowF7pLNKFBDEv2l3xZ YfanlulrZQXwqWPWJGScwu14WMdDgQ0tFtDWb7a48_BKwPktYZQcCA0isWvsN.pTeG3EKbq9UoKa m4mcWnnhm3pPMSTojE0FeaaA2NNDbEyiMuj8O2hZ87ePse4yNeF0OTCTaitFmM8qwKM9iO1GHDIn t60Jbu1VN46MgeRoBQ1D1eLiU6x7G81UQUMbGi3qZOrH8rtjU4.pf9P0REIWgKpfrhDjm8zrsolc MLmqbK1lZEyuu86oZdlcn8giJ8xxdwIPg091K6zUNCYWYNK3H_3uxqRhAUV3OUQA.4TMfLYDDB3m fXotR_PMLsmWX_POQ8Oc3WzTwyjypKULmRCw5TJsaGQOSlPCvGMsOUQ-- X-Sonic-MF: X-Sonic-ID: a5b606b5-fc51-4c37-ac01-414bbac8b011 Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.ne1.yahoo.com with HTTP; Sun, 19 May 2024 14:10:54 +0000 Date: Sun, 19 May 2024 14:10:49 +0000 (UTC) From: Pedro Giffuni To: Kyle Evans , "dev-commits-src-all@freebsd.org" , =?UTF-8?Q?J=C3=B6rg_Sonnenberger?= Cc: "src-committers@freebsd.org" , "dev-commits-src-main@freebsd.org" Message-ID: <625859379.1707787.1716127849819@mail.yahoo.com> In-Reply-To: <4888579.OV4Wx5bFTl@britannica.bec.de> References: <02326b5e-a1fe-4411-a869-d21f9a76130c@email.android.com> <6276b721-6c7b-41cd-9d1b-4169e86ec5e9@FreeBSD.org> <1413980952.1357400.1716093599901@mail.yahoo.com> <4888579.OV4Wx5bFTl@britannica.bec.de> Subject: Re: Re: git: be04fec42638 - main - Import _FORTIFY_SOURCE implementation from NetBSD List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1707786_1868843335.1716127849818" X-Mailer: WebService/1.1.22356 YMailNorrin X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36646, ipnet:66.163.184.0/21, country:US] X-Rspamd-Queue-Id: 4Vj2fl6dNsz4MK0 ------=_Part_1707786_1868843335.1716127849818 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable For the record ... When I was working on this, the default compiler on FreeBSD was still GCC 4= .2 and the static checks worked fine with it but not on clang. The runtime = checks worked fine on both. Pedro. On Sunday, May 19, 2024 at 12:11:15 AM GMT-5, J=C3=B6rg Sonnenberger wrote: =20 =20 =20 On Sunday, May 19, 2024 6:39:59=E2=80=AFAM GMT+2 Pedro Giffuni wrote: >=C2=A0 FWIW .. and let me be clear I haven't worked on this in ages and I = am not planning to retake this either... > clang just couldn't do the static=C2=A0 fortify_source checks=C2=A0 due t= o the way llvm uses an intermediate representation; the size just couldn't = be handled in the preprocessor. That hasn't been true for a long time. __builtin_object_size is only folded in the frontend if it absolutely has to because the context requires an Integer Constant Expression, otherwise it is folded only if the answer is definite. In all other cases it is left for the IR passes = to lower. > fortify_source does replace some key libc functions with memory checking = alternatives and that turns out to be annoying when debugging. Since the wrapper functions are always_inline, they are pretty much invisib= le to debuggers. Joerg =20 ------=_Part_1707786_1868843335.1716127849818 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
For the record ...

When I was working on this, the default compiler on FreeBSD was = still GCC 4.2 and the static checks worked fine with it but not on clang. T= he runtime checks worked fine on both.

Pedro.
<= br>
=20
=20
On Sunday, May 19, 2024 at 12:11:15 AM GMT-5, J=C3= =B6rg Sonnenberger <joerg@bec.de> wrote:


=20 =20
=20

On Sunday, May 19, 2024 6:39:59=E2=80=AFAM GMT+2 Pedro Giffuni wrote:

>= ;  FWIW .. and let me be clear I haven't worked on this in ages and I = am not planning to retake this either...

>= ; clang just couldn't do the static  fortify_source checks  due t= o the way llvm uses an intermediate representation; the size just couldn't = be handled in the preprocessor.


That hasn't been true for a long time. __builtin_object_size is only

fol= ded in the frontend if it absolutely has to because the context

req= uires an Integer Constant Expression, otherwise it is folded only

if = the answer is definite. In all other cases it is left for the IR passes to<= /p>

low= er.


> fortify_source does replace some key libc functions with memory check= ing alternatives and that turns out to be annoying when debugging.


Since the wrapper functions are always_inline, they are pretty much invisi= ble to debuggers.


Joerg

------=_Part_1707786_1868843335.1716127849818-- From nobody Sun May 19 14:47:22 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vj3Sw4fnYz5K9Ry for ; Sun, 19 May 2024 14:47:28 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from sonic314-20.consmr.mail.ne1.yahoo.com (sonic314-20.consmr.mail.ne1.yahoo.com [66.163.189.146]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vj3Sw0jcgz4RPK for ; Sun, 19 May 2024 14:47:28 +0000 (UTC) (envelope-from pfg@freebsd.org) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1716130046; bh=MdP7lKzjEjjXLyMi5pW4qrgyir4AUPwN22e20aRAgIU=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From:Subject:Reply-To; b=eSiJuUccv33Qa1OuxFJY2+gfoRZz2kD4mEghpquiF25ANP0iiCR0sFgHXdKMuNfFb6bU62nTPXEdgf49gLeolP8rbQ+ZP45xArWxw6N1lvU1o4D0iNt/UFGCEqMGhbINtmg2JDY7OLMUoyZqxSH1E+gFQsQ3686js6jRyJklUJKkUTpIuMnTo2CAKqQgXih3hO9VnyXHp485y63tDZ6ZVlLpLQKJBazNlQcotbeesVWwJtXBxpTKC1Vr6Yf2mesY7m0v3SdGSFPwY50D78pVxjNNn47v/WzDE6FRtk++4BAI6gs83BNCIQF6cank+zLOZikYWrJ88S9+UhNezHgnrQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1716130046; bh=W3XqQYYe0xuG1vJ//Llc5YvKhlOPanyvD4nanxiMPPz=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=latoFbXdChx+vtmYXkSfHf90u3J4mYiYLPdCeE1R2/3/b/r37/4yry2OhAXBuDaJd0I90chcrLnalB9z9KEbg5jWssUXaEgJIePy1mBDls1UPoxYT3SJ84ycdHx+LJ6ZMAyJzPVwROamKkdwgztor3haDuLOhyiht4bG/Odo8FfHVmesNtnrEgIDQR3F0Jxq7zJNbJSbfyd660vIYfh3SIYh/oF4mxSl7YEjcVO9jJfqEV+/cNCQTHO0Qz6gMkBBY3NQOhq1BxuDSuBpZDrGuWXZo+5H4QwXN8K/WNpsNwr4L0Sn1sR5FGDVxvpgc9Q7GQUyW9uyWHUeq4n8cli0kg== X-YMail-OSG: WjkridoVM1n0B.yo9bN6nAgioDdYxG0xe.jwKS6sRFt4J9YzMO_eabFhwQVgfYa WoBJspfkC5ARNtKGBS8qDqJg4klGfCKnKNGbG_l0I7e3FJc_j364d3XA2gYQgpzMU7O8yJf6feuv jR6zla5Aq3of8hXntyH2zK23xuZ6Un4JjpvBnKKpBCb2Zqsk6NBWkJPiKSXorD0v.1vfHqjPgiDq s_anLGaPw.ndx_EWws5JK6ZdAE.my7MNPAPFK9Omjci3GRMhW9I4Nhe9S1Qtk94kVjWx2YbB4ADH JDl0cPvHVxh7YMxj1cIac1qBlAwM9aKPMMb3hnj1htKFXJJfYKfU2pQKLnyQ6e6.mquoGVvQrLgA QjSL4eIbKzjKKlfyaVbdV.CdWrFqkVx1CIkq4DxWaTv9o2uXnFgiU.nshAn_C4.IGNo_YqCypC11 Pzqhiy_nJA7HU5lRps2SKcx1ZBwT3yv7TVgOLfZtWd1g1iweq8W2Sb1VII1hRKbZej7GhnuwLQYU JGEz8UTkeqA8fgz7B10jcyBZ0bXujt2EWt00Z6wnqkPJ1GjD6Wjol5gEHt5mz5TEiiCZXKXe1Pq0 T.DoeVwTgKsQIO9tEkhpwtKX1aBKX.ZR8opY9Y4y9lnMYs33NkXSmVWl7ojeh1ddzh149RdqmuQr 8f3Vf08EMZtbj9pqfY9HArQGgJbXhQtYOAULOjW8WqeTPyfkrr7p1Q9zhOuIKD.f6HlZQTlvOoan _YbrjCQSpHe3.6WgxHKpaQ_.dcJVwpxNkFfPodb3pmHZ7GHrx5iRz924DSreMNvx30INQrGYO3Rn qU6ESobBbU3C0D0kt7EiiblssaoabCQU7J.vVjIBa1ToTxN4wfGLhA3gOHAiqs1oFV6HPbOo65Px 1tM876Hf4H_nNA9M8yRSmUeNfpUxoa9K1xyD1_wPdkABG64BQE2qMaRXWDI2txDEXoynX9TlRL0f dxtl7WqVgN7RKcEJ6.6ZBCA3Ij8Q7Xgt2o6pVaKxHBjOJt5Fc91nt0S0PLNFHdLMNLUinne3U5ho QuvoH.soaccLawf1EVL.sjDDcLYNutwDhRUZ.WQK.XLm7XqML1mVU3fahXJIb5Z5Sk0mzzKstUpk jDUVmuJqrpUP5HN8exFFD79IP2XtBeUK9TPQpgcGP.tD3cZkWyfGHkG5r4ILGf0Y7UI0woc7C3NT MM9fuNbVgZul7rDPICZdMXj35PcxRE8uuQKCuWfOh8wFL7S0Js8iXkCKnvmP9FRW5YXXUuziuWW6 4WR2Yv9AFg6hmp98ej2uQHcYtzNuLPYwWDGj.xT4PF.YTnqRdjqAAwuUWUZ2OV08.HlkC6Ug9_yJ xpyczx9cRH7grAIHA2dq0b688ZL5t9mAPBQdQgucfZgKrInhz8MoUQKp18OVM1tDhj08GzyyQ0vW blRQvTfW3piGWSMoTmAPmwd46y43hdi7Rk7J5TzFSfwyZodcJLqP7Y9yE3m5i4hlmvv3epVU62C0 qqSGc66n.LBqSekOGna2.3c2Whn6JOsbg_cbEMwYVcC_d0P7ei5gH7YD37gB7HXUt9O45FCDEL6n 9PTU.15ruFnTmTZp_evZh7avSPAwN.TwMNBqaHI5ci7fWuTXqk1wX_o3OjcRMMjO8Hnps75y0Twn 0DF8hkwE1QsKbNzVCArkdZhyKAj1YyXa59VBM2XEC_4eRekSrC.G7m6EP8_fltNGVSmoCCl0Zt.G I28Xb6OuS8K1TsakVHXVGoS9X5pwa8tcrKpArliANoLDua_I0hjzhnUOM6tUJSq1rno5rXgM3JTu L84wI0_SZ1fNyASs7nCEc.DvRQSG3zYPJJACu9ORvjakDs2cGRj.tGaD2GAWMSsSyJVT6.z6gEr3 FHyTIeiBLmRxgMcA4v3xxCdZRY4j0fy3m2kvw3ap2BqzNaLInCZA_.S80l_UwqSWsJHYGTjMduSb 5PizSKZBfzVJiMx_yreaQpY_KY6YiSdgu6IgxeG6DJmkZaDtLjj8Ofx5LX0ECGbs5LA5lvVDWXJ4 ek1djInrRuNcOFOTMw0ddpOJUwu0W.t6IghdjKewB5OwlL_7TrjwSpZXfa9IZj1e2bNH0rOGP4My g6m2FNwYtEodRc8eG1fWv.HmW_p5jpdHemXXwVH1ES_xOJx062dhWwoVqrTySSXgrDwz28ArApu3 xGu_sfDqc0xcjaipHoNzdJnnnVHjBQ75DQ8TDpzR.6pBL_q8- X-Sonic-MF: X-Sonic-ID: e988718f-097e-4045-b607-d1995a7638d5 Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.ne1.yahoo.com with HTTP; Sun, 19 May 2024 14:47:26 +0000 Date: Sun, 19 May 2024 14:47:22 +0000 (UTC) From: Pedro Giffuni To: Kyle Evans Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Message-ID: <418178403.1722964.1716130042183@mail.yahoo.com> In-Reply-To: <216ca4a4-c0b8-4d72-bc6f-95e82a6b77da@FreeBSD.org> References: <02326b5e-a1fe-4411-a869-d21f9a76130c@email.android.com> <999469960.1638478.1716080957814@mail.yahoo.com> <6276b721-6c7b-41cd-9d1b-4169e86ec5e9@FreeBSD.org> <1413980952.1357400.1716093599901@mail.yahoo.com> <216ca4a4-c0b8-4d72-bc6f-95e82a6b77da@FreeBSD.org> Subject: Re: git: be04fec42638 - main - Import _FORTIFY_SOURCE implementation from NetBSD List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1722963_885190984.1716130042180" X-Mailer: WebService/1.1.22356 YMailNorrin X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36646, ipnet:66.163.184.0/21, country:US] X-Rspamd-Queue-Id: 4Vj3Sw0jcgz4RPK ------=_Part_1722963_885190984.1716130042180 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hmm... well. In all honesty I understand I am doomed to lose this battle :).FORTIFY_SOUR= CE is in linux and in Apple and that weights enough that it had to find it'= s way to FreeBSD sooner or later. Plus I am just not much involved in FreeB= SD or OSs anymore so I don't feel like stopping other people from doing dev= elopment. best of lucks! Pedro. ps. Just for the reference, the Google guys did develop a document on how t= hey implemented this for clang on bionic:https://goo.gl/8HS2dW On Sunday, May 19, 2024 at 12:13:00 AM GMT-5, Kyle Evans wrote: =20 =20 On 5/18/24 23:39, Pedro Giffuni wrote: > FWIW .. and let me be clear I haven't worked on this in ages and I am=20 > not planning to retake this either... >=20 > clang just couldn't do the static=C2=A0 fortify_source checks=C2=A0 due t= o the way=20 > llvm uses an intermediate representation; the size just couldn't be=20 > handled in the preprocessor. Google did spend some time adding extra=20 > attributes to clang to improve the debugging and you can see that=20 > implemented in bionic libc but that was it. musl didn't even try. >=20 Admittedly, I have no idea what you're talking about here; none of this=20 implementation requires any knowledge of anything at preproc time.=20 __builtin_object_size() does the right thing, and the typically=20 performance critical string/memory ops use __builtin___foo_chk() that do=20 successfully get optimized away in the common case to the underlying=20 foo() call.=C2=A0 This all works very well with clang, I haven't tested it= =20 under GCC but, as you've noted, would assume that it works at least as well= . > fortify_source does replace some key libc functions with memory checking= =20 > alternatives and that turns out to be annoying when debugging. In a way= =20 > it breaks that principle C programmers once had, where developers are=20 > expected to know what they are doing, and if the error is caught at=20 > runtime by the stack protector anyways it ends up being redundant. > > One more thing about the static checks. Most of the linux distributions > out there indeed have built their software packages with GCC and=20 > fortify_source >=3D2. As a consequence, when we ran an exp-run on the=20 > ports tree (with GCC), fortify_source didn't find anything: it was=20 > basically a waste of time. >=20 > Another reason for not setting it by default is performance. And here I= =20 > answer Shawn's comment on why not enable stack-protector-all and=20 > safestack and fortify_source at the same time: running unnecessary=20 > checks over and over again wastes energy and can have some performance=20 > hit. The later may seem negligible in modern processors, but why do them= =20 > if they bring no benefit? (No need to answer ... just left as food for=20 > thought) >=20 > Pedro. >=20 > On Saturday, May 18, 2024 at 09:08:52 PM GMT-5, Kyle Evans=20 > wrote: >=20 >=20 >=20 >=20 > On 5/18/24 20:09, Pedro Giffuni wrote: >=C2=A0 > (sorry for top posting .. my mailer just sucks) >=C2=A0 > Hi; >=C2=A0 > >=C2=A0 > I used to like the limited static checking FORTIFY_SOURCE provide= s and >=C2=A0 > when I ran it over FreeBSD it did find a couple of minor issues. = It only >=C2=A0 > works for GCC though. >=C2=A0 > >=20 > I don't think this is particularly true anymore; I haven't found a case > yet where __builtin_object_size(3) doesn't give me the correct size > while GCC did.=C2=A0 I'd welcome counter-examples here, though -- we have > funding to both finish the project (widen the _FORTIFY_SOURCE net to > more of libc/libsys) and add tests to demonstrate that it's both > functional and correct.=C2=A0 It would be useful to also document > deficiencies in the tests. >=20 >=C2=A0 > I guess it doesn't really hurt to have FORTIFY_SOURCE around and = NetBSD >=C2=A0 > had the least intrusive implementation the last time I checked bu= t I >=C2=A0 > would certainly request it should never be activated by default, >=C2=A0 > specially with clang. The GCC version has seen more development o= n glibc >=C2=A0 > but I still think its a dead end. >=C2=A0 > >=20 > I don't see a compelling reason to avoid enabling it by default; see > above, the functionality that we need in clang appears to be just fine > (and, iirc, was also fine when I checked at the beginning of working on > this in 2021) and it provides useful >=20 >=C2=A0 > What I would like to see working on FreeBSD is Safestack as a >=C2=A0 > replacement for the stack protector, which we were so very slow t= o adopt >=C2=A0 > even when it was originally developed in FreeBSD. I think other p= rojects >=C2=A0 > based on FreeBSD (Chimera and hardenedBSD) have been using it but= I >=C2=A0 > don't know the details. >=C2=A0 > >=20 > No comment there, though I think Shawn Webb / HardenedBSD had been > playing around with SafeStack (and might have enabled it? I haven't > actually looked in a while now). >=20 >=C2=A0 > This is just all my $0.02 >=C2=A0 > >=C2=A0 > Pedro. >=20 > Thanks, >=20 > Kyle Evans >=20 >=C2=A0 > >=C2=A0 > On Saturday, May 18, 2024 at 05:54:42 PM GMT-5, Kyle Evans >=C2=A0 > > wrote: >=C2=A0 > >=C2=A0 > >=C2=A0 > >=C2=A0 > >=C2=A0 > On May 18, 2024 13:42, Pedro Giffuni > wrote: >=C2=A0 > >=C2=A0 >=C2=A0 =C2=A0 Oh no .. please not... >=C2=A0 > >=C2=A0 >=C2=A0 =C2=A0 We went into that in a GSoC: >=C2=A0 > >=C2=A0 >=20 > https://wiki.freebsd.org/SummerOfCode2015/FreeBSDLibcSecurityExtensions= =20 > = > >=C2=A0 > >=C2=A0 > >=C2=A0 >=C2=A0 =C2=A0 Ultimately it proved to be useless since stack-prote= ctor-strong. >=C2=A0 > >=C2=A0 > >=C2=A0 > Respectfully, I disagree with your conclusion here: >=C2=A0 > >=C2=A0 > 1.) _FORTIFY_SOURCE provides more granular detection of overflow;= I >=C2=A0 > don't have to overflow all the way into the canary at the end of = the >=C2=A0 > frame to be detected, so my minor bug now can be caught before so= mething >=C2=A0 > causes the stack frame to be rearranged and turn it into a securi= ty >=C2=A0 > issue later >=C2=A0 > >=C2=A0 > 2.) __builtin_object_size doesn't work on heap objects, but it ac= tually >=C2=A0 > can work on subobjects from a heap allocation (e.g., &foo->name),= so the >=C2=A0 > coverage extends beyond the stack into starting to detect other k= inds of >=C2=A0 > overflow >=C2=A0 > >=C2=A0 > While the security value over stack-protector-strong may be margi= nal (I >=C2=A0 > won't debate this specifically), the feature still has value in g= eneral. >=C2=A0 > >=C2=A0 > Thanks, >=C2=A0 > >=C2=A0 > Kyle Evans >=C2=A0=20 =20 ------=_Part_1722963_885190984.1716130042180 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
<= div>
Hmm... well.

In all honesty I understand I am doomed to lose this battle :).
<= div dir=3D"ltr" data-setdir=3D"false">FORTIFY_SOURCE is in linux and in App= le and that weights enough that it had to find it's way to FreeBSD sooner o= r later. Plus I am just not much involved in FreeBSD or OSs anymore so I do= n't feel like stopping other people from doing development.

best of lucks!

<= div dir=3D"ltr" data-setdir=3D"false">Pedro.

ps. Just for the reference, the Google guys did develop a do= cument on how they implemented this for clang on bionic:

=
=20
=20
On Sunday, May 19, 2024 at 12:13:00 AM GMT-5, Kyle = Evans <kevans@freebsd.org> wrote:


=20 =20
On 5/18/24 23:39, Pedro Giffuni wrote= :
> FWIW .. and let me be clear I haven't work= ed on this in ages and I am
> not planning to= retake this either...
>
> clang just couldn't do the static  fortify_source checks&nb= sp; due to the way
> llvm uses an intermediat= e representation; the size just couldn't be
>= handled in the preprocessor. Google did spend some time adding extra
<= /div>
> attributes to clang to improve the debugging and= you can see that
> implemented in bionic lib= c but that was it. musl didn't even try.
>

Admittedly, I have no id= ea what you're talking about here; none of this
= implementation requires any knowledge of anything at preproc time.
__builtin_object_size() does the right thing, and the ty= pically
performance critical string/memory ops u= se __builtin___foo_chk() that do
successfully ge= t optimized away in the common case to the underlying
foo() call.  This all works very well with clang, I haven't test= ed it
under GCC but, as you've noted, would assu= me that it works at least as well.

> fortify_source does replace some key libc functions with = memory checking
> alternatives and that turns= out to be annoying when debugging. In a way
>= ; it breaks that principle C programmers once had, where developers are
> expected to know what they are doing, and if t= he error is caught at
> runtime by the stack = protector anyways it ends up being redundant.
>= ; > One more thing about the static checks. Most of the linux distributi= ons
> out there indeed have built their softwa= re packages with GCC and
> fortify_source >= ;=3D2. As a consequence, when we ran an exp-run on the
> ports tree (with GCC), fortify_source didn't find anything: i= t was
> basically a waste of time.
<= div dir=3D"ltr">>
> Another reason for not= setting it by default is performance. And here I
> answer Shawn's comment on why not enable stack-protector-all and
> safestack and fortify_source at the same time:= running unnecessary
> checks over and over a= gain wastes energy and can have some performance
> hit. The later may seem negligible in modern processors, but why do t= hem
> if they bring no benefit? (No need to a= nswer ... just left as food for
> thought)
>
> Pedro.
>
> On Saturday, May 18= , 2024 at 09:08:52 PM GMT-5, Kyle Evans
> <= ;k= evans@freebsd.org> wrote:
>
<= div dir=3D"ltr">>
>
>
> On 5/18/24 20:09, Pedro Giffuni w= rote:
>  > (sorry for top posting .. m= y mailer just sucks)
>  > Hi;
>  >
>  >= I used to like the limited static checking FORTIFY_SOURCE provides and
=
>  > when I ran it over FreeBSD it did fi= nd a couple of minor issues. It only
>  &= gt; works for GCC though.
>  >
>
> I don't think this = is particularly true anymore; I haven't found a case
> yet where __builtin_object_size(3) doesn't give me the correct siz= e
> while GCC did.  I'd welcome counter-e= xamples here, though -- we have
> funding to b= oth finish the project (widen the _FORTIFY_SOURCE net to
> more of libc/libsys) and add tests to demonstrate that it's b= oth
> functional and correct.  It would b= e useful to also document
> deficiencies in th= e tests.
>
>&nbs= p; > I guess it doesn't really hurt to have FORTIFY_SOURCE around and Ne= tBSD
>  > had the least intrusive impl= ementation the last time I checked but I
>&nbs= p; > would certainly request it should never be activated by default,
>  > specially with clang. The GCC versi= on has seen more development on glibc
>  = > but I still think its a dead end.
> = >
>
> I don'= t see a compelling reason to avoid enabling it by default; see
> above, the functionality that we need in clang appears t= o be just fine
> (and, iirc, was also fine whe= n I checked at the beginning of working on
> t= his in 2021) and it provides useful
>
>  > What I would like to see working on Free= BSD is Safestack as a
>  > replacement= for the stack protector, which we were so very slow to adopt
>  > even when it was originally developed in FreeB= SD. I think other projects
>  > based = on FreeBSD (Chimera and hardenedBSD) have been using it but I
>  > don't know the details.
>  >
>
> No comment there, though I think Shawn Webb / HardenedBSD had been<= br>
> playing around with SafeStack (and might hav= e enabled it? I haven't
> actually looked in a= while now).
>
>=   > This is just all my $0.02
>  = >
>  > Pedro.
>
> Thanks,
>
> Kyle Evans
= >
>  >
&= gt;  > On Saturday, May 18, 2024 at 05:54:42 PM GMT-5, Kyle Evans
>  > <kaevans@fastmail.com <m= ailto:kaevans@fastmail.com>> wrote:
>&nb= sp; >
>  >
>  >
>  >
>  > On May 18, 2024 13:42, Pedro Giffuni <pfg@freebsd.= org
> <mailto:pfg@freebsd.org>> = wrote:
>  >
= >  >    Oh no .. please not...
>  >
>  >    W= e went into that in a GSoC:
>  >
>  >
>  >
&g= t;  >
>  >    Ultima= tely it proved to be useless since stack-protector-strong.
>  >
>  >
>  > Respectfully, I disagree with your concl= usion here:
>  >
>  > 1.) _FORTIFY_SOURCE provides more granular detection o= f overflow; I
>  > don't have to overf= low all the way into the canary at the end of the
>  > frame to be detected, so my minor bug now can be caught be= fore something
>  > causes the stack f= rame to be rearranged and turn it into a security
>  > issue later
>  >
<= /div>
>  > 2.) __builtin_object_size doesn't wor= k on heap objects, but it actually
>  >= ; can work on subobjects from a heap allocation (e.g., &foo->name), = so the
>  > coverage extends beyond th= e stack into starting to detect other kinds of
&g= t;  > overflow
>  >
<= div dir=3D"ltr">>  > While the security value over stack-protect= or-strong may be marginal (I
>  > won'= t debate this specifically), the feature still has value in general.
>  >
>  &g= t; Thanks,
>  >
>  > Kyle Evans

------=_Part_1722963_885190984.1716130042180-- From nobody Sun May 19 15:53:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vj4xY3DJCz5KWyn; Sun, 19 May 2024 15:53: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 4Vj4xY2gKqz4XH5; Sun, 19 May 2024 15:53:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716134033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ahU3tGcH0eVklNLEeWrPECo2quxnJQHqbSmmAmV5u9w=; b=fjOMbCAo8lz7PfZCMH+HBHrrUcs2Fo4ewDm3k4jngevxZoDcqnDoi9Xzy0bmWtbIPR8eoh y6k6A1e0cZIP8jXFRtOkvtbJ1odYRNRLENqI/YyQuWjn2XFjufCaBLBEHsqB1RloWWLKgE 8NrA1nYVu9F8LWjVHfI7Ayb7IHfqqiCWLVV3nab570ljhVspvLrDJsH+fvQW+a8eSQU80o ij4ebjsixVA8qfXYTzJrjmBm7LCjS+uPs9f9atbBs/HZDLazafTK2yOxn9F4paGbsyxzwb r5ztZmFgMeBqh9REs7de5XBsDQKrbvj0DN9g+ELJZTdoL1BookldGXrzmTuqNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716134033; a=rsa-sha256; cv=none; b=QsXCkWQJUfWclQOBZLup4I62KusD+PwT9ymYDN1tmyccCEcy1cl/CJS5QiSuqc0ZBoLVj1 RJdNfhe106vIgA05LvoGgKpDBl5ecBkIIgsNQaEEn5HNeZv//1uDTWPmgSlOSgarhicsHz YQ0I3iGabVqHQNNPb2Jxb20CCeeUFxi2usljNSDMhaSfnRfvTNtAguA61+wzHfmgzug2Z9 EFi9HwomorHaeDFsqYbUS+CGW+U5ojJby5RLG3lLvvAj2XK9Fn6zC1D/aFkDuGG5Uf6nTy ycMfofXilfa0rHo9J63wtvrOYNZ8OC0PDbmiVgPH+ajtYa3kIFMx4E6oFwy4QA== 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=1716134033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ahU3tGcH0eVklNLEeWrPECo2quxnJQHqbSmmAmV5u9w=; b=S9/rkdOiUqEHIxS2IUIeP5O3Y/pBdOVAvBz9ubsI0c8HaJD1KPYpR/Zwp0/2+uAuyz8aoi pigFyxVJXS2StGewVjr7DT9IIK0eIY6nR4OUo5iooVLjCD/dsXiA9hRfofjjL/8rkcYvpF 1yFOr2roHV8Lw1st9Nb7uJjW04eZiRD1tDHuODPvRjpEcfBtXo+FR/TXcJUoFIHQeqmHvn O/rI20CaH8WQle0OMqps0Bc1p1ZV1WCBQ65BAfJUmCiUpJN3HOeeTnBnrvMEo92ZGGi4hy 5xzHSjQya2FTMiWe4e4M4onA8ihp4enZ8uSvhWIsUELHsNPCIy+FcBlneoorkA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vj4xY2GF3z1F5n; Sun, 19 May 2024 15:53: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 44JFrrlg098820; Sun, 19 May 2024 15:53:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44JFrrae098817; Sun, 19 May 2024 15:53:53 GMT (envelope-from git) Date: Sun, 19 May 2024 15:53:53 GMT Message-Id: <202405191553.44JFrrae098817@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 3cc1b35bc1bd - main - vfs_getopt(9): fix typo List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3cc1b35bc1bdcdee279b3ee7d0e0946b684df898 Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=3cc1b35bc1bdcdee279b3ee7d0e0946b684df898 commit 3cc1b35bc1bdcdee279b3ee7d0e0946b684df898 Author: Alan Somers AuthorDate: 2024-05-19 15:49:03 +0000 Commit: Alan Somers CommitDate: 2024-05-19 15:49:03 +0000 vfs_getopt(9): fix typo [skip ci] Reported by: Claudiu MFC after: 2 weeks --- share/man/man9/vfs_getopt.9 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man9/vfs_getopt.9 b/share/man/man9/vfs_getopt.9 index 0e68655f540f..ff0f027314c7 100644 --- a/share/man/man9/vfs_getopt.9 +++ b/share/man/man9/vfs_getopt.9 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH .\" DAMAGE. .\" -.Dd July 31, 2011 +.Dd May 19, 2024 .Dt VFS_GETOPT 9 .Os .Sh NAME @@ -46,7 +46,7 @@ .Fa "struct vfsoptlist *opts" "const char *name" "void **buf" "int *len" .Fc .Ft "char *" -.Fn vfs_getops "struct vfsoptlist *opts" "const char *name" "int *error" +.Fn vfs_getopts "struct vfsoptlist *opts" "const char *name" "int *error" .Ft int .Fo vfs_flagopt .Fa "struct vfsoptlist *opts" "const char *name" "uint64_t *flags" "uint64_t flag" @@ -177,7 +177,7 @@ function returns 0 if the option was found; otherwise, is returned. .Pp The -.Fn vfs_getops +.Fn vfs_getopts function returns the specified option if it is found, and is .Dv NUL terminated. From nobody Sun May 19 18:11:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vj80B4d02z5KsYf for ; Sun, 19 May 2024 18:11:22 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vj8096vFWz4yxS for ; Sun, 19 May 2024 18:11:21 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Authentication-Results: mx1.freebsd.org; none Received: by mail-io1-xd2f.google.com with SMTP id ca18e2360f4ac-7e18adf7268so115102639f.0 for ; Sun, 19 May 2024 11:11:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; t=1716142279; x=1716747079; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=pV7ecV2+Xq8l2PD6zPE3eYsW8FDemf2JtdJLrXKns48=; b=KzmOrTJHl5d8rycpYa7KlRh4ydKDffM76RCClmpc7AYFBCjE1ZFuh9YNDT8acDwEXZ DDp7SLOrMbTWyvmbtOw92zdIb0DLKQSPwMJmvPibt30R4kg0/VFoEt5IpfVrgWEV/gY/ LeGod8KPhIM8bUGHZG2U6P78JgHT3GoxNZBZrv8xCYlXT3+XVwo67h9kJDmQpigyPQ1k dQSRiVzTSVDr1nStlLCKCKahn4jyTPQrg3RiiU+hjMeb5kksS+WQHt2LXUkD9vVJkk4g JelkWNJo/JmOQBnvH00j5Nic9ACoE9guVt0lgvQ8Gkkm/bdTXi8av/yi6gFgSqJZc25/ +e5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716142279; x=1716747079; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=pV7ecV2+Xq8l2PD6zPE3eYsW8FDemf2JtdJLrXKns48=; b=vFB1orPrJepVhe3AepXUQ1Icb58k0LZ9rfqyIs+9FsGfE5dd+m117QcYJZHj3uJAqt Vb8CV47s7a05W/WbnmzYkr7gzNRbfjbw921K68YXeAXffTmUOjei9vzC8SfNO0o9Lb3x JnL5yWs13kMrzkHhdOCJdjhJJif5X0hpLlMJvotqPv3ODt55c3NnwxB/SQHiX1yT8Ik4 yQGalro+EkLxSoRcvS0270IeJ9ltHpZkvdNJDKADQPiKNH3+Chsc5tOxFbayHReAcorU WahybBBReRpOA/kIvPhmz8xFqaKEibSbzvt8hUuJFTw7r2SR8tjpMkreBgRNt/8Rwv+0 RqhA== X-Forwarded-Encrypted: i=1; AJvYcCVDCUaKIz1LQ5JlnGzBlYVYrzbR7NNrw2CnLREviKzM93aG7rR+RhlJx0p5EWPCJBWqnei7P+Z1kCq5LDBnb8UbV5OEa7tg74tr6wRt+bBS X-Gm-Message-State: AOJu0YwcLJpGJyhjCL+Znv6s4jEBk+rMOVdtHfkCDFUiK8Sg/F0nlzLY pSqV88lfRMEUVwRYLSTxnuF7RW8I49HhYCQiGen8kI7Ymep/0kIocknAR54ujfo= X-Google-Smtp-Source: AGHT+IG/sFIOG6ehNgitRRhIqCe6pONnwSGBbDuN3obHFSMf2PnHPbr87zGQ193d24WaOG1K9tYwyQ== X-Received: by 2002:a5d:948e:0:b0:7d9:6351:4ef3 with SMTP id ca18e2360f4ac-7e1b51bb73amr2647964839f.5.1716142279369; Sun, 19 May 2024 11:11:19 -0700 (PDT) Received: from mutt-hbsd ([184.99.37.29]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-489376dc822sm5821808173.131.2024.05.19.11.11.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 11:11:18 -0700 (PDT) Date: Sun, 19 May 2024 18:11:17 +0000 From: Shawn Webb To: Pedro Giffuni Cc: Kyle Evans , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: be04fec42638 - main - Import _FORTIFY_SOURCE implementation from NetBSD Message-ID: X-Operating-System: FreeBSD mutt-hbsd 15.0-CURRENT-HBSD FreeBSD 15.0-CURRENT-HBSD X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <02326b5e-a1fe-4411-a869-d21f9a76130c@email.android.com> <999469960.1638478.1716080957814@mail.yahoo.com> <6276b721-6c7b-41cd-9d1b-4169e86ec5e9@FreeBSD.org> <1413980952.1357400.1716093599901@mail.yahoo.com> <216ca4a4-c0b8-4d72-bc6f-95e82a6b77da@FreeBSD.org> <418178403.1722964.1716130042183@mail.yahoo.com> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="rvc6baalkatqcyi5" Content-Disposition: inline In-Reply-To: <418178403.1722964.1716130042183@mail.yahoo.com> X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4Vj8096vFWz4yxS --rvc6baalkatqcyi5 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I did not know a battle was even being fought. :-) I'd like to give a little hypothetical as to why I think these features are complementary to each other. The primary goal of SafeStack is to protect the control flow. This means putting spillable data in a separate stack, named the unsafe stack. Spilling one buffer into another is (usually) not as bad as spilling onto the return address pointer on the stack. SafeStack does not attempt to prevent spillage. The primary goal of the SSP canary is also to protect control flow. However, in some cases, the check may be too late. If a function pointer sits adjacent to a spilled buffer, and the function pointer is called after the buffer is overflowed, the attacker gains arbitrary code execution. One feature critical to _FORTIFY_SOURCE is better bounds checking, both at compile time and run time. Let's say, hypothetically, that two buffers are created and sit adjacent to each other. SafeStack put these two buffers on the unsafe stack. The second buffer contains authentication and authorization data. By overflowing into the second buffer, the attacker can gain new privileges. If the buffer contains authentication data, perhaps the attacker can (from this point forward) steal the session from another user. If the buffer contains authorization data, perhaps the attacker can (from this point forward) perform privileged operations. This is where _FORTIFY_SOURCE comes in. If _FORTIFY_SOURCE can prevent the overflow from happening, the attacker cannot steal sessions or perform privileged operations. I intentionally skipped over SSP in this hypothetical. In this particular case, trying to protect the return address pointer saved on the stack is moot. SSP is still useful, but not for this particular hypothetical. I hope this makes sense. Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Tor-ified Signal: +1 303-901-1600 / shawn_webb_opsec.50 https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc On Sun, May 19, 2024 at 02:47:22PM +0000, Pedro Giffuni wrote: > Hmm... well. > In all honesty I understand I am doomed to lose this battle :).FORTIFY_SO= URCE is in linux and in Apple and that weights enough that it had to find i= t's way to FreeBSD sooner or later. Plus I am just not much involved in Fre= eBSD or OSs anymore so I don't feel like stopping other people from doing d= evelopment. > best of lucks! > Pedro. > ps. Just for the reference, the Google guys did develop a document on how= they implemented this for clang on bionic:https://goo.gl/8HS2dW >=20 > On Sunday, May 19, 2024 at 12:13:00 AM GMT-5, Kyle Evans wrote: =20 > =20 > On 5/18/24 23:39, Pedro Giffuni wrote: > > FWIW .. and let me be clear I haven't worked on this in ages and I am= =20 > > not planning to retake this either... > >=20 > > clang just couldn't do the static=A0 fortify_source checks=A0 due to th= e way=20 > > llvm uses an intermediate representation; the size just couldn't be=20 > > handled in the preprocessor. Google did spend some time adding extra=20 > > attributes to clang to improve the debugging and you can see that=20 > > implemented in bionic libc but that was it. musl didn't even try. > >=20 >=20 > Admittedly, I have no idea what you're talking about here; none of this= =20 > implementation requires any knowledge of anything at preproc time.=20 > __builtin_object_size() does the right thing, and the typically=20 > performance critical string/memory ops use __builtin___foo_chk() that do= =20 > successfully get optimized away in the common case to the underlying=20 > foo() call.=A0 This all works very well with clang, I haven't tested it= =20 > under GCC but, as you've noted, would assume that it works at least as we= ll. >=20 > > fortify_source does replace some key libc functions with memory checkin= g=20 > > alternatives and that turns out to be annoying when debugging. In a way= =20 > > it breaks that principle C programmers once had, where developers are= =20 > > expected to know what they are doing, and if the error is caught at=20 > > runtime by the stack protector anyways it ends up being redundant. > > > One more thing about the static checks. Most of the linux distributio= ns > > out there indeed have built their software packages with GCC and=20 > > fortify_source >=3D2. As a consequence, when we ran an exp-run on the= =20 > > ports tree (with GCC), fortify_source didn't find anything: it was=20 > > basically a waste of time. > >=20 > > Another reason for not setting it by default is performance. And here I= =20 > > answer Shawn's comment on why not enable stack-protector-all and=20 > > safestack and fortify_source at the same time: running unnecessary=20 > > checks over and over again wastes energy and can have some performance= =20 > > hit. The later may seem negligible in modern processors, but why do the= m=20 > > if they bring no benefit? (No need to answer ... just left as food for= =20 > > thought) > >=20 > > Pedro. > >=20 > > On Saturday, May 18, 2024 at 09:08:52 PM GMT-5, Kyle Evans=20 > > wrote: > >=20 > >=20 > >=20 > >=20 > > On 5/18/24 20:09, Pedro Giffuni wrote: > >=A0 > (sorry for top posting .. my mailer just sucks) > >=A0 > Hi; > >=A0 > > >=A0 > I used to like the limited static checking FORTIFY_SOURCE provides= and > >=A0 > when I ran it over FreeBSD it did find a couple of minor issues. I= t only > >=A0 > works for GCC though. > >=A0 > > >=20 > > I don't think this is particularly true anymore; I haven't found a case > > yet where __builtin_object_size(3) doesn't give me the correct size > > while GCC did.=A0 I'd welcome counter-examples here, though -- we have > > funding to both finish the project (widen the _FORTIFY_SOURCE net to > > more of libc/libsys) and add tests to demonstrate that it's both > > functional and correct.=A0 It would be useful to also document > > deficiencies in the tests. > >=20 > >=A0 > I guess it doesn't really hurt to have FORTIFY_SOURCE around and N= etBSD > >=A0 > had the least intrusive implementation the last time I checked but= I > >=A0 > would certainly request it should never be activated by default, > >=A0 > specially with clang. The GCC version has seen more development on= glibc > >=A0 > but I still think its a dead end. > >=A0 > > >=20 > > I don't see a compelling reason to avoid enabling it by default; see > > above, the functionality that we need in clang appears to be just fine > > (and, iirc, was also fine when I checked at the beginning of working on > > this in 2021) and it provides useful > >=20 > >=A0 > What I would like to see working on FreeBSD is Safestack as a > >=A0 > replacement for the stack protector, which we were so very slow to= adopt > >=A0 > even when it was originally developed in FreeBSD. I think other pr= ojects > >=A0 > based on FreeBSD (Chimera and hardenedBSD) have been using it but I > >=A0 > don't know the details. > >=A0 > > >=20 > > No comment there, though I think Shawn Webb / HardenedBSD had been > > playing around with SafeStack (and might have enabled it? I haven't > > actually looked in a while now). > >=20 > >=A0 > This is just all my $0.02 > >=A0 > > >=A0 > Pedro. > >=20 > > Thanks, > >=20 > > Kyle Evans > >=20 > >=A0 > > >=A0 > On Saturday, May 18, 2024 at 05:54:42 PM GMT-5, Kyle Evans > >=A0 > > wrote: > >=A0 > > >=A0 > > >=A0 > > >=A0 > > >=A0 > On May 18, 2024 13:42, Pedro Giffuni > > wrote: > >=A0 > > >=A0 >=A0 =A0 Oh no .. please not... > >=A0 > > >=A0 >=A0 =A0 We went into that in a GSoC: > >=A0 > > >=A0 >=20 > > https://wiki.freebsd.org/SummerOfCode2015/FreeBSDLibcSecurityExtensions= =20 > > > > >=A0 > > >=A0 > > >=A0 >=A0 =A0 Ultimately it proved to be useless since stack-protector-st= rong. > >=A0 > > >=A0 > > >=A0 > Respectfully, I disagree with your conclusion here: > >=A0 > > >=A0 > 1.) _FORTIFY_SOURCE provides more granular detection of overflow; I > >=A0 > don't have to overflow all the way into the canary at the end of t= he > >=A0 > frame to be detected, so my minor bug now can be caught before som= ething > >=A0 > causes the stack frame to be rearranged and turn it into a security > >=A0 > issue later > >=A0 > > >=A0 > 2.) __builtin_object_size doesn't work on heap objects, but it act= ually > >=A0 > can work on subobjects from a heap allocation (e.g., &foo->name), = so the > >=A0 > coverage extends beyond the stack into starting to detect other ki= nds of > >=A0 > overflow > >=A0 > > >=A0 > While the security value over stack-protector-strong may be margin= al (I > >=A0 > won't debate this specifically), the feature still has value in ge= neral. > >=A0 > > >=A0 > Thanks, > >=A0 > > >=A0 > Kyle Evans > >=A0=20 > =20 --rvc6baalkatqcyi5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmZKQL4ACgkQ/y5nonf4 4fqYPg//X6q7NdewhCWT8sE2tvZSp2rCCMqnTNYN3OqzwVXQeuhuqcypJ3zL8bfS QMCUSvqVxH+YWt9Fg1vyVICW1Ly12nVhm8yhbIzHrZP3OeEJXGNu/sDqwNxDRYza aKlw3ac74dkNJpikpeZn7mMT0iGJpsranm9SyIwshJwxxvF4YT5/Ax4ovxsQspga zIy/LX5Pne3ZSTTKLwxLMns3neD2s9bn3qA9qW3AOaFZcJIt2lPouKzduW/FI4bs 8eVEH7aH/8OjFbWAiE9ZgjWK2rrclNc19HSnE0jw0LxoivmUMNL4DMY4BTAS9BOL RtUR48QbSHVs9GQeRulZYcu2l7hizN7oQMaA6eZcSj1Syy+gWlHa12bEoj5oTCvl JSDPPQv8vMr6x8vmccfhIMVPRZz31gxlNZ5UQDecxBF5CTaNH24nXK8ntYoRxkp+ gzaeuaGjw8Q2Rmltoju8+CrWPdrobP5WdAGznKazNVul2tjLj/F61d3FMxMMwvV7 M+jpOMc6JUdE5BpOXXZiCv/yLKa2RE0FT0xooJM/FlpinodZC3Fopbhd8RmjO1CD giOJYw6cgpZrECLAaVkdX5k/Kom7/35jBTFZs+pqYqV9Iw9L282+2JfNM7g3kPMl 6WEq8COklrpCRPBQu3YfQJ1hnd9gc97UKmAY5BrCsJqt9TGrbwg= =lS9x -----END PGP SIGNATURE----- --rvc6baalkatqcyi5-- From nobody Sun May 19 19:43:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjB2x3FtTz5L28V; Sun, 19 May 2024 19:43: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 4VjB2x2Zykz57g1; Sun, 19 May 2024 19:43:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716147833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E+MMQ5L/IvriThYzzxppsPMqalAmNKPT5JOzo9Z9tyQ=; b=Z7KR2TslBdG6bhYQgWXz5TyVXrmZEF1a0tyTT3c2e4oqQ95d5sFctdBWWRwId2lDe0x0ho DamthjDzFjTLwQZ/aBzYUUIG/bPCdh8I2FGYS/DxBbYOOjmPImgWuFw6VJmIE0mE7dHqkZ wAcGD40d6/jo2uqSlnsOfuCyRzmcxY7neM4BF60FtWLgDdlOlVnawHGoZMpVzj8ZlyqcU5 pmFV5N+l9Cxqi5qz/KIJrpxjCo2sINFQ+Dp19w0f6AwRC0BEivK7YGlKpsCyUv9XNVjSQB rkfrUDCSIKwluaqXuSAs6sNbe4Za231rgF8UApBd/pQIdYjxcGdqhwv1oRKxng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716147833; a=rsa-sha256; cv=none; b=hXyGd1CASrOrMdlE4339doS/j6vD9kYxjO/DAG/y1lYNL/qTCHul0OMtw1zbXi6fSe4hHX NdSXqvH7MDlRToZd3/AG5m93HqX4fz7aYd/O9SCaZxb06YPGyLHxlM7n0RElNblqznfNAm 8FXJQaHnfBixPvCjEQnh3NnzGGl7ZDEflx+ex+Q6eigVk8UwtDPfkPw3O6Id8ja05W6jm+ uAHqSC6o1TeJousNenOm0MP+gJ5DPA60mCSwlKLLMWrR9cPkpW1R4w8nX9JEgvM0rNBNAm hH5uvoewhi0/fWRxLdYdyBKFp2lu1T2N5dfdVYN8WI3QdPUqcqJM1D2ZuNXFPA== 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=1716147833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E+MMQ5L/IvriThYzzxppsPMqalAmNKPT5JOzo9Z9tyQ=; b=HGcAynPut+sY+OVa+B5gYE2M/oZWG98F/Qb8GRGV/4NMDgxRnhGXIzSTrtGzDMoadn6Gzo uihUUicVWWdj3SZZeRSP0dsFZ9YC2FOjYe6PO62rcW4KLjahBXLElCoYpaZf1OVKTTfDQQ p1zuVLT9auyOhTSqUknw6h3DBZKVl03v4IhhLsWV1/Zl17kAY4X/uLjGuD3DRzNvUqot5j 0iFu4psAcGdBZ4muA2oDITlCSDihb9/w8H1oXTPtOz7Y6cC2hLA6A3BvfXk7zrPagyYf80 yI1xW1DNEXs5KdlSteSaPPOAcs8Wabnb7mvgYbkvPQWCfEMg607kmEkO1OeECw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjB2x29t1z1Mj4; Sun, 19 May 2024 19:43: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 44JJhrxA027788; Sun, 19 May 2024 19:43:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44JJhr2S027786; Sun, 19 May 2024 19:43:53 GMT (envelope-from git) Date: Sun, 19 May 2024 19:43:53 GMT Message-Id: <202405191943.44JJhr2S027786@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Cox Subject: git: 4f77144279f2 - main - arm64 pmap: eliminate a redundant variable List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4f77144279f210ce65d77c13470c6363c3ce3c57 Auto-Submitted: auto-generated The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=4f77144279f210ce65d77c13470c6363c3ce3c57 commit 4f77144279f210ce65d77c13470c6363c3ce3c57 Author: Alan Cox AuthorDate: 2024-05-19 19:22:53 +0000 Commit: Alan Cox CommitDate: 2024-05-19 19:33:19 +0000 arm64 pmap: eliminate a redundant variable Moreover, if we attempt an L2 promotion on the kernel pmap from pmap_enter_quick_locked(), this change eliminates the recomputation of the L2 entry's address. MFC after: 1 week --- sys/arm64/arm64/pmap.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index a6056a5edfc2..269513589d78 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -5848,7 +5848,6 @@ static vm_page_t pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, vm_page_t mpte, struct rwlock **lockp) { - pd_entry_t *pde; pt_entry_t *l1, *l2, *l3, l3_val; vm_paddr_t pa; int lvl; @@ -5913,13 +5912,13 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, l3 = &l3[pmap_l3_index(va)]; } else { mpte = NULL; - pde = pmap_pde(kernel_pmap, va, &lvl); - KASSERT(pde != NULL, + l2 = pmap_pde(kernel_pmap, va, &lvl); + KASSERT(l2 != NULL, ("pmap_enter_quick_locked: Invalid page entry, va: 0x%lx", va)); KASSERT(lvl == 2, ("pmap_enter_quick_locked: Invalid level %d", lvl)); - l3 = pmap_l2_to_l3(pde, va); + l3 = pmap_l2_to_l3(l2, va); } /* From nobody Sun May 19 23:11:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjGfv70M6z5LBr9; Sun, 19 May 2024 23:11: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 4VjGfv6XpXz4gSD; Sun, 19 May 2024 23:11:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716160311; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iRPYfH8DkdkXIB6ZL3ehpcs7guG5lzGl1roScICXUr8=; b=hANkn1MayZ1LloyAmh2hjeQht+pXx92jDtxquH4Y41LIJxxZqBPw4Z8UUr6Dz7wXQ/ZUHS JzYLJGFoZ0oJpa4SZEfHGHYakMKd/nzn0gGok8bijRX6mvak1tcC1POJmtRwNmMHtS1B05 UxgP/eQKaY8IvVmkuh5n+99c8tIOVeZHqFs8xtxalQ4h1oLzsKqlilV18jFo2spodV+PRA MyesIOQB2R6s8vca2OfP+dw6ZTaUqH+2P0finDvB9oY3HYa9epJcbtCnA6QI3N+8pyX5u3 YgkvtBlqGJL/Vwt7VzvIaCitq5ZiZSv5NuyWpRTMbRdwzH5o/cOcNfMFaHg5TQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716160311; a=rsa-sha256; cv=none; b=N0OBWvKBywPl5YqrCu4hmSZfGbvCyT6MYiZuxI8mcROs4a1rtd3oD4P8EHGWuU68TkAyhw kGtPDrLcN9WCpA7+anCZv4qKKhfIpBemWGS1gRaBgITpYalCrbSXxApfUMjOs4LaYsTY2+ 3TaOA3kZB41MMonlzto6d4VVzVRZtm43gzSbzr9Vfmty2yq83qDPmGC8i/YqsMLQQiV7cS 5+YhRhedTE1uTcMyYsEMwM8gQOhwPCQs6yiZhxWIODEmQ145x7gsvkpJQxJ2sl2VBkV3Om 4/uOuH+zpBhcm1F6v0uipaO3jFKL/V8fFWxglrY1KeQUwRIkGUdt/ao1qs1Xkg== 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=1716160311; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iRPYfH8DkdkXIB6ZL3ehpcs7guG5lzGl1roScICXUr8=; b=JpvY+36hIGlZOrTxy2k2675FHzv4y9VIRO4FmRIfpoTY0oy9wlEnrlByLvidDhFi6GjruV Hl+HMhGkEXGKY8DudqfQx7sjeYdTBnERXh7duafB2TGyvt4lsFpQMV7wbaoFIM2GQ7IKAP pgES9J8TPi2iC95x+Nc5gG9B0asr4+rMs/T1irWqYhm1pkoWji5qBPwF5rjgnSDRJU3CCW 1gdGPFktiYzXtF/vfjNU04BUUrYInT6WDpsEnRNXlPT0z6ng5Z1PIhjnf0N0SxgLDpj8OE v8ezMtNY92KsGUI6jUNDEpQbEiaXTh3X+q0xu6cMCdAPE+pO8CJKP74oZHWuyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjGfv68KZzF2Q; Sun, 19 May 2024 23:11: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 44JNBpNx088367; Sun, 19 May 2024 23:11:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44JNBpbw088364; Sun, 19 May 2024 23:11:51 GMT (envelope-from git) Date: Sun, 19 May 2024 23:11:51 GMT Message-Id: <202405192311.44JNBpbw088364@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 6cba29c09a96 - main - acpidump IVRS table format: change 'IOMMUId' into 'IOMMU DeviceId' List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6cba29c09a966be33b0958f912a7c03d92b926b8 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6cba29c09a966be33b0958f912a7c03d92b926b8 commit 6cba29c09a966be33b0958f912a7c03d92b926b8 Author: Konstantin Belousov AuthorDate: 2024-05-19 23:01:43 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-19 23:04:45 +0000 acpidump IVRS table format: change 'IOMMUId' into 'IOMMU DeviceId' and apply the consistent format for device ids used in other IVRS elements. The field seems to be the PCI Device ID of the IOMMU itself, instead of an abstract unit ID. Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- usr.sbin/acpi/acpidump/acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c index 0cc3f76ac018..fc2e8cb82c49 100644 --- a/usr.sbin/acpi/acpidump/acpi.c +++ b/usr.sbin/acpi/acpidump/acpi.c @@ -1504,7 +1504,7 @@ acpi_handle_dmar(ACPI_TABLE_HEADER *sdp) static void acpi_handle_ivrs_ivhd_header(ACPI_IVRS_HEADER *addr) { - printf("\n\tIVHD Type=%#x IOMMUId=%x\n\tFlags=", + printf("\n\tIVHD Type=%#x IOMMU DeviceId=%#06x\n\tFlags=", addr->Type, addr->DeviceId); #define PRINTFLAG(flag, name) printflag(addr->Flags, flag, #name) PRINTFLAG(ACPI_IVHD_TT_ENABLE, HtTunEn);