From nobody Mon Jan 29 00:22:39 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TNTXJ6Wjcz57dFp; Mon, 29 Jan 2024 00:22:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TNTXJ2KBbz4nT9; Mon, 29 Jan 2024 00:22:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706487760; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=87csPBVudKT6HSm6HlJ9IJaJ2RfbNgKdZ7he6Og/2cw=; b=Um8ftOPhqbbzgQZ7sfNxSJzdmhpDtYqOs01Fvzcwnd6wgCDeSQIAlIpe3Dgi9KJ3QDz5X7 gyxsrl5tZJTn0etjukthhRIw6SfHVb+Pa6DGAtjRtCzLzBKcimggzb/xnXnYQMQ+Ulgz1T /fkdAWa2NuvdTrqgt6WBGZBu/5fznh0wQoTlb8tTUA9SgpBaSoecpeS+HQ4O9BqhVcTFRf azik9/WEaOrsoTH1lZ7BB77pPHb4sFOwoMDs1uKKwd9MuM7fmi65s6Ln2yDAxqDJCf8VAD QTdcsqAvrlJLJLsNMu9OaBC5je/YZS8gkDhmx9CHYwa0h5arqWvnhLenpnWz+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706487760; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=87csPBVudKT6HSm6HlJ9IJaJ2RfbNgKdZ7he6Og/2cw=; b=vRkolzklM97AaYMAgrKwGBpQe6n2BceEMKQYacRR3GSUvNlbS029VVivx4tUvqROti3bOV tAE5MbL7rJwKlh8Oyhrl5EeR07Ni5wnEyh0OiTnKG7o+lrCD3DjViiJyx0hTHfwQ/Mo7bg tAiWDcuLp4MoC0yQKhLbiUQKDWlmES7fzL8nFCrKzC/6VZxCiutsR5NSZOL2r/7zD0sDCB PHU+nY6RakWHN6UbNxL3soi+bDVwskv8D2tPK6lFWMuzjAhdoq43tiHkfbG7KmUjqWE0Uc 8u4wteYsNCjIN+b/oTiwMUsQ+Vv/z7FLVMwmudGkzQjxTgCvx7DEywlBfpemng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706487760; a=rsa-sha256; cv=none; b=CmliY3HEU7p9RW6XPUhYxyHptFlwcJNl8EFtDl4QxqTdup4wNMtojX0sOAaPs/ce/BkFKK x+RLy8WsmqfrFTNkZmRqPdbOmAYPvrQYAcNs4+xKNX1BRnLHXNIfnXwITYJOFzweoplTDW pBqVW3oyOdIIcY5J/CSc2ULVra8nJMUb+VqLyLi7Lwt+BHeUg2PcmFo/a9khOrqU3emB8g uXTftbYVP563SCAycHoJRCImmDy2TuwHWlkeHo+U8PXGwnyWXMpSMNqTHk/Tdq80FJ7yqq lr4T+hGToLwQE0INoPB40Mi2By3a/u0NsX4tncOlUke7QebRIjnA5FWIpZkTjA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TNTXH64F2zV3m; Mon, 29 Jan 2024 00:22: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 40T0MdFT070982; Mon, 29 Jan 2024 00:22:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40T0MdKZ070979; Mon, 29 Jan 2024 00:22:39 GMT (envelope-from git) Date: Mon, 29 Jan 2024 00:22:39 GMT Message-Id: <202401290022.40T0MdKZ070979@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Chuck Tuffli Subject: git: 0d7fef9124c1 - stable/13 - bhyve nvme: Add NQN value List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: chuck X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0d7fef9124c125f25e3c03740cc5d0a1f16391b7 Auto-Submitted: auto-generated The branch stable/13 has been updated by chuck: URL: https://cgit.FreeBSD.org/src/commit/?id=0d7fef9124c125f25e3c03740cc5d0a1f16391b7 commit 0d7fef9124c125f25e3c03740cc5d0a1f16391b7 Author: Chuck Tuffli AuthorDate: 2023-10-12 22:04:17 +0000 Commit: Chuck Tuffli CommitDate: 2024-01-29 07:55:18 +0000 bhyve nvme: Add NQN value Add a NVMe Qualified Name (NQN) to the Controller Data structure using the "first format" (i.e., "... used by any organization that owns a domain name" Section 7.9 NVM-Express 1.4c 2021.06.28 Ratified). This avoids a Linux kernel warning about a missing or invalid NQN. (cherry picked from commit 32557d16e2c3c24c04eccfafd895e1514dc65b35) --- usr.sbin/bhyve/pci_nvme.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index 073b37d4d6d9..3db306a19119 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -516,6 +516,7 @@ static void pci_nvme_init_ctrldata(struct pci_nvme_softc *sc) { struct nvme_controller_data *cd = &sc->ctrldata; + int ret; cd->vid = 0xFB5D; cd->ssvid = 0x0000; @@ -585,6 +586,13 @@ pci_nvme_init_ctrldata(struct pci_nvme_softc *sc) NVME_CTRLR_DATA_FNA_FORMAT_ALL_SHIFT; cd->vwc = NVME_CTRLR_DATA_VWC_ALL_NO << NVME_CTRLR_DATA_VWC_ALL_SHIFT; + + ret = snprintf(cd->subnqn, sizeof(cd->subnqn), + "nqn.2013-12.org.freebsd:bhyve-%s-%u-%u-%u", + get_config_value("name"), sc->nsc_pi->pi_bus, + sc->nsc_pi->pi_slot, sc->nsc_pi->pi_func); + if ((ret < 0) || ((unsigned)ret > sizeof(cd->subnqn))) + EPRINTLN("%s: error setting subnqn (%d)", __func__, ret); } /* @@ -3361,7 +3369,6 @@ pci_nvme_init(struct pci_devinst *pi, nvlist_t *nvl) pci_nvme_aen_init(sc); pci_nvme_reset(sc); - done: return (error); } From nobody Mon Jan 29 00:29:50 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TNThb1wtHz57dkF; Mon, 29 Jan 2024 00:29: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 4TNThb1T2nz4nsX; Mon, 29 Jan 2024 00:29:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706488191; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9c6q+Apcq5twkKbkGD4XsLWRf8F/hPvurdELmCeKMNs=; b=cxWzps3XWQ6V3IvRA1AI5sIR+i9po5+BM1zIxskIv9v5e7NPSRFLwR0wZ70BR96TSQmPYG y9e6oIGRLS+qexBmsk7kFSwRRvPPmpVaL8sG+f6GoXRILZPqYJ9U8FAiI419EnAbazS+Vl 6ps0Ay1dVyd20upJl9XE/0JcWWKkf7kmusnomxubrMdyfru4B52fAH0CH+qJ4zmcsDVy9c mmRT7p/BkfidTsakJVDxSvqDI+uU6DZ5+ScOjpXMonSz9xtRQcVMyeu3ke5/XQkaNfZzxS OwXO1/AciPJ/KfHlu3T3KDZVLMbKA6VNYtBSptlcqNnQ1cUrAqpa4C4DtkK4NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706488191; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9c6q+Apcq5twkKbkGD4XsLWRf8F/hPvurdELmCeKMNs=; b=QeZ2MmVUidae3UuJs8JEA25au7krLhNP8bdqwkcXgFfAF56+XdDP8CJUxWfltIcnZspBoA Iir7P5/csfZ3iNkHVYk7sjCBBHUk0wqqqtOxiYO2Id1+/GA1kJXSuycjfOT39vUsULftzc eO1zfa9a81En5UQfqr6OmReVmMW5JZZrcw5EQ9JoVk3x+mLK9eI45avvniGETepKndIhrC BxWxGL88oFfnp2vqrWgD8LXzuxdHbZGxiUDasunVWGc7ufJPRSDFS2ZerbIaNKdaBUfJU1 YSSw3X7svbCtB+O1LtaozPWyaKhRzNEZehBGqOlTDSArKhWxjvTtIf1aLQeIug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706488191; a=rsa-sha256; cv=none; b=hcewIdu51sSHn6GeHBmeHS1P/vA95lW/BWBEeBFttjlSuG+9Jr0ZJW/DFY7bxjXbJc6odU K/gI0mJyI5NGQFPiV1PJu4FYqiMev3M02FBrkQASX2lbB4i9QUnMnVfd2XSSwTar3k1epc DbEjD8Mz4pf0VywvCC0MUEzCylJcko6lmwFnG9FhHWBRstli6WDuCWbd2P0ZuTNt1Yczvj KVXfwFGnE5zsSZ4xbnuDZgvvyKQWgnWUk/8j2hjP/fQXp+DrxMQS9yCWj7+lUxOEH9qxh4 8Eu0Wh+XWGYdXOs5HBZpNOVZ/lp+7yBB+I5LOmDNmotoPaPrU3wueS7YdkhiOw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TNThb0PWfzVDD; Mon, 29 Jan 2024 00:29: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 40T0TolT072007; Mon, 29 Jan 2024 00:29:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40T0ToTD072004; Mon, 29 Jan 2024 00:29:50 GMT (envelope-from git) Date: Mon, 29 Jan 2024 00:29:50 GMT Message-Id: <202401290029.40T0ToTD072004@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 83ab4d6cc58b - stable/14 - rc.d/kdc: Support start of MIT krb5kdc List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 83ab4d6cc58bd53b84a819d51b032ba17f3f6a8c Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=83ab4d6cc58bd53b84a819d51b032ba17f3f6a8c commit 83ab4d6cc58bd53b84a819d51b032ba17f3f6a8c Author: Cy Schubert AuthorDate: 2024-01-20 13:52:35 +0000 Commit: Cy Schubert CommitDate: 2024-01-29 00:26:05 +0000 rc.d/kdc: Support start of MIT krb5kdc Some users wishing to use the MIT krb5kdc have discovered the kdc script workaround applied to the MIT krb5 ports is insufficient. Let's build into this rc script the smarts to determine whether base or ports Hiemdal kdc is being invoked or the MIT krb5kdc. While at it, remove kdc_start_precmd(). This will simplify a future jail patch. Suggested by: netchild Original patch: netchild Reviewed by: emaste, netchild Differential Revision: https://reviews.freebsd.org/D43523 (cherry picked from commit 91f78c32befa08bf4010db7afd4407277a3e585f) --- libexec/rc/rc.d/kdc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libexec/rc/rc.d/kdc b/libexec/rc/rc.d/kdc index 4b8cf87197e8..c3059f261e09 100755 --- a/libexec/rc/rc.d/kdc +++ b/libexec/rc/rc.d/kdc @@ -12,17 +12,15 @@ name=kdc desc="Kerberos 5 server" rcvar=${name}_enable -start_precmd=${name}_start_precmd set_rcvar_obsolete kerberos5_server_enable kdc_enable set_rcvar_obsolete kerberos5_server kdc_program set_rcvar_obsolete kerberos5_server_flags kdc_flags -kdc_start_precmd() -{ - - command_args="$command_args --detach" -} load_rc_config $name +if [ "${kdc_program}" = /usr/libexec/kdc -o \ + "${kdc_program}" = /usr/local/libexec/kdc ]; then + command_args="$command_args --detach" +fi run_rc_command "$1" From nobody Mon Jan 29 00:29:57 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TNThk0XVrz57dpq; Mon, 29 Jan 2024 00:29: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 4TNThj5TWmz4p81; Mon, 29 Jan 2024 00:29:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706488197; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Lf+MHZRKtJtpNBClwkabgxd625imv+UtvXQ9tsp/z9g=; b=fDLp1jKJMyvYuChgidJ4Pn11epAwdIjbfrv4KflzrZyAsObBLV0dSNFJdhqYlCkpQYaKLv QTvvu4hjKpAYrLvMjK2F0CGzVYr1fbnQqsXEUJJKmVH8vzqarb1LpIY7zC1vjF8f7odrMY /vjLrpBr2xN9WWKOU5EKMpxgNNidzL4XJI+ga/u+p5F1emMkOJTjrX2io5eI5GTRHTFonx ogvVNpR6+fggCxDABnNh45jq3+TlCs8pLOmD+6pbizGC1j/V7F0lwoumTihqkBA+9Zky/z zqU4FmzdrJ4l/AzsplJt+Xkn2FK6CoyGsh0/EQCE36MXywtmcHkZBEsjQcr+gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706488197; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Lf+MHZRKtJtpNBClwkabgxd625imv+UtvXQ9tsp/z9g=; b=WId02pP9QyjO1khbBPmrU2RoHbchX/FLTtgIz0Hu0gZ2sp9JrZuHhMRIoEDHeB1WfZfP81 O2QwN74gnvI5fOC4p53mHoxYeCZp++DOT6OBvmeftPVO1HJDefiKAYcTg39+vDmw0Yv/jJ puIbiKxcPDOoXFmo/Wdyk2LK9jv2e5+ddFvcOpy0IlGUHC2w3bUZr6TutP8OvOoJmOS0ZZ MkHmOPnWis9tFZinpogj2UNGdBT+WqyZolIdUxsqpLadxP7EqDtYoNI3Wj3lef7WpI/HjK 0Z9Q6sYWFdfT0KwePOHTWMkdjk+qhQ0orTg2a67dWetA1MUgknBsPK2NCvzZhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706488197; a=rsa-sha256; cv=none; b=ag0872WhCFYW5PNw835Urnsx1qMOD7abT8NsBSwWrrkFAXZrvUODIbW1IV9w2UTRWBCTm6 NJSwKW92O7RH3vqRc+vWio1448uPGUJVY1UZdtAWK0EsZmg/x3abgyQdKdr4e/Uja58aLQ KBngiEO78+i2UlpqT+YFU8KteYmO4qVBiiPPVz5nmF/k8X0Qnq2qhawyVRiL4r0Kmf2TZH 4vL5XrzUloqY3sUOOARFKnxxiYTzsVcnRgqsXMYShRr2FsaEFm931f+JjQzuX5ckCzcd6J sft4yBB9lbd7i6GcFp+LVxIzUSREUMWyFz3BTENttLCD7ZIVLvI5VKd+tPMZvw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TNThj46RVzV7W; Mon, 29 Jan 2024 00:29: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 40T0Tvcb072161; Mon, 29 Jan 2024 00:29:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40T0TvbS072158; Mon, 29 Jan 2024 00:29:57 GMT (envelope-from git) Date: Mon, 29 Jan 2024 00:29:57 GMT Message-Id: <202401290029.40T0TvbS072158@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 02f097e7f341 - stable/13 - rc.d/kdc: Support start of MIT krb5kdc List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 02f097e7f34199813201b940ad2b608b6f36bd83 Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=02f097e7f34199813201b940ad2b608b6f36bd83 commit 02f097e7f34199813201b940ad2b608b6f36bd83 Author: Cy Schubert AuthorDate: 2024-01-20 13:52:35 +0000 Commit: Cy Schubert CommitDate: 2024-01-29 00:26:13 +0000 rc.d/kdc: Support start of MIT krb5kdc Some users wishing to use the MIT krb5kdc have discovered the kdc script workaround applied to the MIT krb5 ports is insufficient. Let's build into this rc script the smarts to determine whether base or ports Hiemdal kdc is being invoked or the MIT krb5kdc. While at it, remove kdc_start_precmd(). This will simplify a future jail patch. Suggested by: netchild Original patch: netchild Reviewed by: emaste, netchild Differential Revision: https://reviews.freebsd.org/D43523 (cherry picked from commit 91f78c32befa08bf4010db7afd4407277a3e585f) --- libexec/rc/rc.d/kdc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libexec/rc/rc.d/kdc b/libexec/rc/rc.d/kdc index 4b8cf87197e8..c3059f261e09 100755 --- a/libexec/rc/rc.d/kdc +++ b/libexec/rc/rc.d/kdc @@ -12,17 +12,15 @@ name=kdc desc="Kerberos 5 server" rcvar=${name}_enable -start_precmd=${name}_start_precmd set_rcvar_obsolete kerberos5_server_enable kdc_enable set_rcvar_obsolete kerberos5_server kdc_program set_rcvar_obsolete kerberos5_server_flags kdc_flags -kdc_start_precmd() -{ - - command_args="$command_args --detach" -} load_rc_config $name +if [ "${kdc_program}" = /usr/libexec/kdc -o \ + "${kdc_program}" = /usr/local/libexec/kdc ]; then + command_args="$command_args --detach" +fi run_rc_command "$1" From nobody Mon Jan 29 14:28:07 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TNrHq3czJz58pP8; Mon, 29 Jan 2024 14:28: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 4TNrHq38DXz4WB3; Mon, 29 Jan 2024 14:28:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706538487; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZS9+2wJTZZH5uJI7yNKgSwCAQEWODD7o67ySfIRP3Rs=; b=nMrp8+vlQRRz4Fcuf7Yxj+sFM9ojDdb2ORVVK0pH72i1JMh7GrwBQH5oZDegSA+RbbWQ0H FMad2TB9QLkT0RH4HArkeAOU3QDwiiJgWv/mSPY4n1oQfXbOwBD3jjc5tLd4wQqYGP/vAZ lVjCcGUV+ekHlw9JKOgihzdGJJABNz8DLf6XPBqQ4jUzlFnOygS3xg6UdVQtUUOBQeQn9W O8iqVBJ5NgXGYVfY/3XV9wLrbIX0sQ/ww9DDugSXiqFpOkdwC0rtsL++PZWeBZy0S8evWy EpWRmkLLBQKb80PJzgzNGG0Rur47pFgDWzP26ejDqEFQPIVVkMsqgKfsuUZfRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706538487; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZS9+2wJTZZH5uJI7yNKgSwCAQEWODD7o67ySfIRP3Rs=; b=xscBM2qb387BFPX7IeMVTV1+P241Inx8yjQ4oJ7LlNmnWHznJBVrj86hVmRwJctgH/yfqs 9yvDIaRuLm3uyqTvHJ/qytEzHiMGBUtkeVKuQJbDmq1flJ2fDaX3cdIa2J04av5piWhdES ICS/S0wbiXm5ooTqfDPanV+SJwA7eXcLQCp8HSGikiKP40pKVnlJiv/uqXq5w2dO20i0Oe ftkrWetbGtQRlbtt1Rf9jAZ+iovxV6s2lijVgqXJUWdpZfmcmaX2P6tpQo4XZBU8kDY9hu EmtWFklK0ZoRagvDbIJmLteeoXANDHrzY6dKnIT0nzxSDHN+ACcsT3+OnQEEwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706538487; a=rsa-sha256; cv=none; b=aIajgZ79jboCOR2vv6B6pJbIUn0J3+9NLVa4CEYoiRCcQtacLRfeH4gaZD6W4Q9+AoBacr OC8y4ASjt2JFr2eRIvrmT9cxEo1fVmqbiFrrZ1ZFjRk+mnvb6xcPTUjSDK198xo5h5pWQj ibqOYP6PCBEamQRV0R+khVL16uvBvXpXGVUvSZOY8cuGurrLHuSGq/EhMDXV1pZV0Bi7LF 2n0eOb6SJkkg2J3BFtXlIvViuV4RrBtMBBe8slxb7X/0a4HDy4ysIPAsINY1u2hTZG19dy qG5puTNPV76wMO8IQm14XZ+WH0JQI3K/ZxuWFXRzCI5dxoEFqMqfwCeHk8hT1g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TNrHq2DG3zvGs; Mon, 29 Jan 2024 14:28: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 40TES7AT086660; Mon, 29 Jan 2024 14:28:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40TES7bj086657; Mon, 29 Jan 2024 14:28:07 GMT (envelope-from git) Date: Mon, 29 Jan 2024 14:28:07 GMT Message-Id: <202401291428.40TES7bj086657@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 08dbe7213452 - stable/14 - condvar: Clean up condvar.h a bit List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 08dbe72134524de9c5b4a675b0bdf6773bbee8b0 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=08dbe72134524de9c5b4a675b0bdf6773bbee8b0 commit 08dbe72134524de9c5b4a675b0bdf6773bbee8b0 Author: Mark Johnston AuthorDate: 2024-01-15 17:27:11 +0000 Commit: Mark Johnston CommitDate: 2024-01-29 14:25:45 +0000 condvar: Clean up condvar.h a bit - Remove a typedef that has been unused for a long time. - Remove a LOCORE guard. MI headers like condvar.h don't need such a guard in general. - Move a forward declaration into the _KERNEL block. - Add a types.h include to make the file self-contained. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D43449 (cherry picked from commit 61b0092be751b8241b65cc14e4167d431f1e5ad8) --- sys/sys/condvar.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/sys/sys/condvar.h b/sys/sys/condvar.h index 23558879452c..cd16c85024d4 100644 --- a/sys/sys/condvar.h +++ b/sys/sys/condvar.h @@ -29,14 +29,6 @@ #ifndef _SYS_CONDVAR_H_ #define _SYS_CONDVAR_H_ -#ifndef LOCORE -#include - -struct lock_object; -struct thread; - -TAILQ_HEAD(cv_waitq, thread); - /* * Condition variable. The waiters count is protected by the mutex that * protects the condition; that is, the mutex that is passed to cv_wait*() @@ -49,6 +41,10 @@ struct cv { }; #ifdef _KERNEL +#include + +struct lock_object; + void cv_init(struct cv *cvp, const char *desc); void cv_destroy(struct cv *cvp); @@ -85,5 +81,4 @@ void cv_broadcastpri(struct cv *cvp, int pri); #define cv_wmesg(cvp) ((cvp)->cv_description) #endif /* _KERNEL */ -#endif /* !LOCORE */ #endif /* _SYS_CONDVAR_H_ */ From nobody Mon Jan 29 14:28:08 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TNrHr6TjHz58pKd; Mon, 29 Jan 2024 14: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 4TNrHr4BtCz4W3B; Mon, 29 Jan 2024 14: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=1706538488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8UuhYEX25WdilLyH2TzShx3TgjQOGHwZByXLUM8ynpc=; b=Pen08UJSffv4+rJbczErps7ZJJa9PcysNUNi73RA17GNL/irzerxQCaS9+a83+PkaT/tba N88j3BK9zLUDFl0QZgvz/9f5tAYKcIXWPkeP0tcmPJO+zDeu1UZAEpE7Pz67ZBvf05LzJ3 6iLyUebviJCyhq8Gb0mwWihE4H+eUzyjFYq7lqqjJAU3jT8Phj2nRf5Q8MHYwqIwcGaed2 WnWjfBFQLD2Gmb3/MHyU0qTWF10k/lj8XUK5b36TCrX7rUwPv7LjnFaMLFSp+nKm9SNLw5 8ojTjW236I1UOuczGXeeEI3iL3t7jaBIfcmMd1jR+65PVqVR/XeRsXjdNg7xMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706538488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8UuhYEX25WdilLyH2TzShx3TgjQOGHwZByXLUM8ynpc=; b=SQrQMffOx5nRPy45FFlqPCC2lXzQfaBO6Qokx8TplyFK6znHuLGSGmCaAqNB9BRmVn2uGB Qc6mos2m4F6wktDCzjctNEXaX4BvDR7mIAS4EMNRMU8EP8QKzP5+Gi7+Yk+SKMVXl65+E7 zViWVjiWC1aZz8rh6qAAJrud3LD9qDpMMPUaArz7bkyQipElSoEk7ka98Oy+Dn52804Oy+ dMtk4QM4YGZ17atnySvyxrTNEmZBrVBBAbEwhkd1CzEt0c+rxddMrKab/HBSMa1VM1hwaL wVn76OmI0vsl3vY1GqmFXIn25xknoYEo0/2ZZfSGUkYT3DmYanFUJnk9gmmd6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706538488; a=rsa-sha256; cv=none; b=QTPaRIxQgZtrjZlEPorAYwF2Y5Vl/keK1lzUUahuGJJcmaPA/VVrpV+rF+yuyQDN9cZ8Hz RdDbH5e00OcvhxeJQgESQudEXCXgCeF2yRzrk+38c9DkOas+xhW9R1TRT3kWZ6MleklZ1P 2jl4sN6WsE1yBxpwNf59IyAWcd7dptBPTb4oFfSeLhka3dGM4XjPeqeJAKQUFSMyI/PRW6 QCLhfEXuil+aIbigQaxWsLWVG57M0VkFEoAwvLyzx3JmVLRWko+j0OTnoM9M/pxa0Q+38z bTxLqsxFaRUpKE2zmThMOqLyZ4HqP331OYx/QRlq3cr4oDqe4yypYmD9Mr89Ww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TNrHr3GRBzvgB; Mon, 29 Jan 2024 14: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 40TES8kB086717; Mon, 29 Jan 2024 14: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 40TES8Oc086714; Mon, 29 Jan 2024 14:28:08 GMT (envelope-from git) Date: Mon, 29 Jan 2024 14:28:08 GMT Message-Id: <202401291428.40TES8Oc086714@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 11cf350c3893 - stable/14 - condvar: Fix a user-after-free in _cv_wait() when ktrace is enabled List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 11cf350c3893d7077dbb28b9177585e9c903007c Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=11cf350c3893d7077dbb28b9177585e9c903007c commit 11cf350c3893d7077dbb28b9177585e9c903007c Author: Mark Johnston AuthorDate: 2024-01-15 17:29:02 +0000 Commit: Mark Johnston CommitDate: 2024-01-29 14:25:52 +0000 condvar: Fix a user-after-free in _cv_wait() when ktrace is enabled When a thread wakes up after sleeping on a CV, it must not dereference the CV structure, as it may already have been freed. At least ZFS relies on this invariant, see commit c636f94bd2ff15be5b904939872b4bce31456c18 for example. Thus, when logging context-switch events, copy the wmesg into a stack buffer while it is still safe to do so, and log that after waking up. While here, move the initial ktrcsw() call later, after assertions and the SCHEDULER_STOPPED_TD() condition are checked. Reported by: syzkaller Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D43450 (cherry picked from commit a5ef95cd228e43bcc459a5c8a9911e57888ba5fd) --- sys/kern/kern_condvar.c | 109 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 75 insertions(+), 34 deletions(-) diff --git a/sys/kern/kern_condvar.c b/sys/kern/kern_condvar.c index 6b5f2933e041..2731f581a29f 100644 --- a/sys/kern/kern_condvar.c +++ b/sys/kern/kern_condvar.c @@ -43,8 +43,9 @@ #include #include #ifdef KTRACE -#include #include +#include +#include #endif /* @@ -107,24 +108,32 @@ void _cv_wait(struct cv *cvp, struct lock_object *lock) { WITNESS_SAVE_DECL(lock_witness); +#ifdef KTRACE + char wmesg[WMESGLEN + 1]; +#endif struct lock_class *class; struct thread *td; uintptr_t lock_state; td = curthread; - lock_state = 0; -#ifdef KTRACE - if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0, cv_wmesg(cvp)); -#endif CV_ASSERT(cvp, lock, td); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, "Waiting on \"%s\"", cvp->cv_description); - class = LOCK_CLASS(lock); if (SCHEDULER_STOPPED_TD(td)) return; +#ifdef KTRACE + if (KTRPOINT(td, KTR_CSW)) { + strlcpy(wmesg, cv_wmesg(cvp), sizeof(wmesg)); + ktrcsw(1, 0, wmesg); + } else { + wmesg[0] = '\0'; + } +#endif + + class = LOCK_CLASS(lock); + lock_state = 0; sleepq_lock(cvp); CV_WAITERS_INC(cvp); @@ -145,7 +154,7 @@ _cv_wait(struct cv *cvp, struct lock_object *lock) #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0, cv_wmesg(cvp)); + ktrcsw(0, 0, wmesg); #endif PICKUP_GIANT(); if (lock != &Giant.lock_object) { @@ -161,14 +170,13 @@ _cv_wait(struct cv *cvp, struct lock_object *lock) void _cv_wait_unlock(struct cv *cvp, struct lock_object *lock) { +#ifdef KTRACE + char wmesg[WMESGLEN + 1]; +#endif struct lock_class *class; struct thread *td; td = curthread; -#ifdef KTRACE - if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0, cv_wmesg(cvp)); -#endif CV_ASSERT(cvp, lock, td); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, "Waiting on \"%s\"", cvp->cv_description); @@ -181,6 +189,15 @@ _cv_wait_unlock(struct cv *cvp, struct lock_object *lock) return; } +#ifdef KTRACE + if (KTRPOINT(td, KTR_CSW)) { + strlcpy(wmesg, cv_wmesg(cvp), sizeof(wmesg)); + ktrcsw(1, 0, wmesg); + } else { + wmesg[0] = '\0'; + } +#endif + sleepq_lock(cvp); CV_WAITERS_INC(cvp); @@ -196,7 +213,7 @@ _cv_wait_unlock(struct cv *cvp, struct lock_object *lock) #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0, cv_wmesg(cvp)); + ktrcsw(0, 0, wmesg); #endif PICKUP_GIANT(); } @@ -211,25 +228,33 @@ int _cv_wait_sig(struct cv *cvp, struct lock_object *lock) { WITNESS_SAVE_DECL(lock_witness); +#ifdef KTRACE + char wmesg[WMESGLEN + 1]; +#endif struct lock_class *class; struct thread *td; uintptr_t lock_state; int rval; td = curthread; - lock_state = 0; -#ifdef KTRACE - if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0, cv_wmesg(cvp)); -#endif CV_ASSERT(cvp, lock, td); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, "Waiting on \"%s\"", cvp->cv_description); - class = LOCK_CLASS(lock); if (SCHEDULER_STOPPED_TD(td)) return (0); +#ifdef KTRACE + if (KTRPOINT(td, KTR_CSW)) { + strlcpy(wmesg, cv_wmesg(cvp), sizeof(wmesg)); + ktrcsw(1, 0, wmesg); + } else { + wmesg[0] = '\0'; + } +#endif + + class = LOCK_CLASS(lock); + lock_state = 0; sleepq_lock(cvp); CV_WAITERS_INC(cvp); @@ -251,7 +276,7 @@ _cv_wait_sig(struct cv *cvp, struct lock_object *lock) #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0, cv_wmesg(cvp)); + ktrcsw(0, 0, wmesg); #endif PICKUP_GIANT(); if (lock != &Giant.lock_object) { @@ -272,24 +297,32 @@ _cv_timedwait_sbt(struct cv *cvp, struct lock_object *lock, sbintime_t sbt, sbintime_t pr, int flags) { WITNESS_SAVE_DECL(lock_witness); +#ifdef KTRACE + char wmesg[WMESGLEN + 1]; +#endif struct lock_class *class; struct thread *td; int lock_state, rval; td = curthread; - lock_state = 0; -#ifdef KTRACE - if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0, cv_wmesg(cvp)); -#endif CV_ASSERT(cvp, lock, td); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, "Waiting on \"%s\"", cvp->cv_description); - class = LOCK_CLASS(lock); if (SCHEDULER_STOPPED_TD(td)) return (0); +#ifdef KTRACE + if (KTRPOINT(td, KTR_CSW)) { + strlcpy(wmesg, cv_wmesg(cvp), sizeof(wmesg)); + ktrcsw(1, 0, wmesg); + } else { + wmesg[0] = '\0'; + } +#endif + + class = LOCK_CLASS(lock); + lock_state = 0; sleepq_lock(cvp); CV_WAITERS_INC(cvp); @@ -311,7 +344,7 @@ _cv_timedwait_sbt(struct cv *cvp, struct lock_object *lock, sbintime_t sbt, #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0, cv_wmesg(cvp)); + ktrcsw(0, 0, wmesg); #endif PICKUP_GIANT(); if (lock != &Giant.lock_object) { @@ -334,24 +367,32 @@ _cv_timedwait_sig_sbt(struct cv *cvp, struct lock_object *lock, sbintime_t sbt, sbintime_t pr, int flags) { WITNESS_SAVE_DECL(lock_witness); +#ifdef KTRACE + char wmesg[WMESGLEN + 1]; +#endif struct lock_class *class; struct thread *td; int lock_state, rval; td = curthread; - lock_state = 0; -#ifdef KTRACE - if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0, cv_wmesg(cvp)); -#endif CV_ASSERT(cvp, lock, td); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, "Waiting on \"%s\"", cvp->cv_description); - class = LOCK_CLASS(lock); if (SCHEDULER_STOPPED_TD(td)) return (0); +#ifdef KTRACE + if (KTRPOINT(td, KTR_CSW)) { + strlcpy(wmesg, cv_wmesg(cvp), sizeof(wmesg)); + ktrcsw(1, 0, wmesg); + } else { + wmesg[0] = '\0'; + } +#endif + + class = LOCK_CLASS(lock); + lock_state = 0; sleepq_lock(cvp); CV_WAITERS_INC(cvp); @@ -374,7 +415,7 @@ _cv_timedwait_sig_sbt(struct cv *cvp, struct lock_object *lock, #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0, cv_wmesg(cvp)); + ktrcsw(0, 0, wmesg); #endif PICKUP_GIANT(); if (lock != &Giant.lock_object) { From nobody Mon Jan 29 14:28:17 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TNrJ15sp2z58p4g; Mon, 29 Jan 2024 14:28: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 4TNrJ14g2dz4Wbd; Mon, 29 Jan 2024 14:28:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706538497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FF3RdVvjb+WddnAh0iK60rxyFpNGxVYNeh9HRl+Ka4M=; b=JD6FGABn+NHGZw3dp9xF2IWbt9BW8X79ZtYRUxHhjZuIStklu/3JETJWbWFf+WJ9oSpKrv 2LzJouI1zDM0uvFBilllYv4ArfEd6LciVLwFuir5A6rWI63FjMtOjpkWBZ4YV1MLDNX54k Qm4/T0ua8DGgh1upFQTzQV1l3fCBUH7lW/ogbUVBxzldR0H4HGrBL/kDcOkbD83AtHmbED r/3sTGc5HUkT/bgvzj5dInWlHRHBO/XZ+ETLcNLvHBhRnF4ulgi4NGVMynkOyxIWVKYv1Y kQtecBVuxywWqt9ATX+B4r016GWcer0YWI3RwkW9Axoai8Mi1qOsBoomS7gl3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706538497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FF3RdVvjb+WddnAh0iK60rxyFpNGxVYNeh9HRl+Ka4M=; b=vVPYkoKfPZkSHjVaWzm4r8y36EXrpEV+m0ORvFPwbyUBt1h5A4ieQAnYxyhjCIvIBeEKiM 5yR0EEM2djxm/bjEhKWnyYDxWIVQhK4WzDKg1gN5ec69IkZq+x/9QcbbqQFdp7Zh8LNhTX cqdhutbl+2r4M2yAmfsF5N9Wx0fomlOBUkznpOUid3PtCTZ8VMLdLWBRxd8XK43oveyaxV QUFRwFYpzVwTh6FscHUSur0yuv244urBYFIBzEHFaeoIAtblzEy2X12XNB1ZaoCZh+eNtg klRD29JC97fdmHO9sPrE67PNT3eg4Nsj12uyY1R7JBPHGMQ9uJ9kYpKT9pZaWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706538497; a=rsa-sha256; cv=none; b=EZ9BMqvaVWekUW1StiNk6rziZLqXRMvGkuWlmLGEZDUYNLRRMS9I0611ScCsUqmgdMCkCZ VqZcHQ9KE3RGEarcwG9y7Uy+YBwWtHG9UlFkjbvKpYkLiqFVKKOFP2mScPJz89b2aO9UGm dahoBPniR1rDWcd/qQQWuz5dv9CymuNEM3w6BS98AZJTh4wVMRj3wY0reA0AGG2oGnRbce cAOyRJ9x2x1iANfc+MPdTu4EXyKSufd9jpjZHjz+2YtnN5+CE7hlUIOfhRVyvEm5tTmqEl 24xEbMYXhe+RcI551KYnQGuLEqYU8QTxXbVG+k4Klyx/wXaomD5dtIOasZ3y3g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TNrJ13mMVztw0; Mon, 29 Jan 2024 14:28: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 40TESHPM086873; Mon, 29 Jan 2024 14:28:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40TESHio086870; Mon, 29 Jan 2024 14:28:17 GMT (envelope-from git) Date: Mon, 29 Jan 2024 14:28:17 GMT Message-Id: <202401291428.40TESHio086870@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 604b80f152f2 - stable/13 - condvar: Clean up condvar.h a bit List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 604b80f152f20c1efa6313f9a0a483956e867225 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=604b80f152f20c1efa6313f9a0a483956e867225 commit 604b80f152f20c1efa6313f9a0a483956e867225 Author: Mark Johnston AuthorDate: 2024-01-15 17:27:11 +0000 Commit: Mark Johnston CommitDate: 2024-01-29 14:26:22 +0000 condvar: Clean up condvar.h a bit - Remove a typedef that has been unused for a long time. - Remove a LOCORE guard. MI headers like condvar.h don't need such a guard in general. - Move a forward declaration into the _KERNEL block. - Add a types.h include to make the file self-contained. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D43449 (cherry picked from commit 61b0092be751b8241b65cc14e4167d431f1e5ad8) --- sys/sys/condvar.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/sys/sys/condvar.h b/sys/sys/condvar.h index 23558879452c..cd16c85024d4 100644 --- a/sys/sys/condvar.h +++ b/sys/sys/condvar.h @@ -29,14 +29,6 @@ #ifndef _SYS_CONDVAR_H_ #define _SYS_CONDVAR_H_ -#ifndef LOCORE -#include - -struct lock_object; -struct thread; - -TAILQ_HEAD(cv_waitq, thread); - /* * Condition variable. The waiters count is protected by the mutex that * protects the condition; that is, the mutex that is passed to cv_wait*() @@ -49,6 +41,10 @@ struct cv { }; #ifdef _KERNEL +#include + +struct lock_object; + void cv_init(struct cv *cvp, const char *desc); void cv_destroy(struct cv *cvp); @@ -85,5 +81,4 @@ void cv_broadcastpri(struct cv *cvp, int pri); #define cv_wmesg(cvp) ((cvp)->cv_description) #endif /* _KERNEL */ -#endif /* !LOCORE */ #endif /* _SYS_CONDVAR_H_ */ From nobody Mon Jan 29 14:28:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TNrJ271Yrz58nwb; Mon, 29 Jan 2024 14:28: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 4TNrJ25Ybjz4Wbf; Mon, 29 Jan 2024 14:28:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706538498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gr/szfyg2xKmEm6B0WaKT5s0v6PBfjXDhLHQH8awvdQ=; b=EUZhmyZdMYm1RCj9XtX0gj7zGWC2k0CEDhA8ZpszlNRNHaS4bBC2lYOlVCEfQvl5mulvxY JwnfEn6LKcIh41t2OOx6l+2DqYtP+nWa4drFL+3hpUCARKUFaA0NvIfVNgnoj4JYlYXo+9 KIttKj5EvraqTIEFjh9oHqzbV/BOkC9Y0h2qwITj4ir8o3ItLjrlfC+fleyaWubZIX6bqN drMgbLLlqZQWYFqk5/xeDKIEvZr95Kk2FIW5Z8PirxLgLsbo1x9LrwBBH6ev/mZ0uehxxf RZEx+jYCPkIHvlcfO+IDqbLMDKgN8YAAnY+W3ZK+iPK1dwpVnppAGBs505rjOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706538498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gr/szfyg2xKmEm6B0WaKT5s0v6PBfjXDhLHQH8awvdQ=; b=wuCf1U2aQgPbg49nFdrrKUF0g/qWRSUSCYK6Ugqsykd9L2Af/XYA0AyFpH0Yd2vaFq1JUx I86VHJ/wGozCbDdEWDkYd1zUar9lUjI4HcG7BYFWPjy3NHaklii7A3wnlc78agkL1HDxjS B2wHpQzsIy07AZBA94M03dpFojCOiCUjnWhR6u3vUCf5M5SssR00fhLtlQqBO0HSIua4s9 Y+sLzo9b8mYocWFmvGKQ2BIN2sPxqp+s4pgptmkfFaXAIb7cHka3T4+xUAMqUFBjATo55W /MjIHTeIjGKeG15L3be0EhQebTRvfxLGFMecqAP+rgxqCM7InPhuogpPefgSCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706538498; a=rsa-sha256; cv=none; b=Iu9JEZm+yzigG5QugF4xmhge/ooSNlFvdiEZhkp5ezWsRkvTlrshE3UJMVWsHrmgvGJDvS CE4lx88SV7mKpEmtBJ+vOf1cVok0MN+DMgrDy3ZIH4De5zb04o3pAhcUTp6+qaRH26RXsy VHcgN8/6ucViGVBrKMzobMzW/XxSgbAwFkVXl+/UMRxdFnMosGWIkD2K24fTYh/GlcO9G1 c9WaT1qbUlS5wG/OUkmKRk76FxzUC+JQnUViN97Mk3Rv7tqfc/sJWDGL9j6hR8ciRzFeRg oqtKRPtknhX9aU4u8iQBSj+6aZSvxWujakiQQAGjRh4p29LXTH+KSOALcsuiBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TNrJ24g76ztw1; Mon, 29 Jan 2024 14:28: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 40TESIM4086933; Mon, 29 Jan 2024 14:28:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40TESIjk086930; Mon, 29 Jan 2024 14:28:18 GMT (envelope-from git) Date: Mon, 29 Jan 2024 14:28:18 GMT Message-Id: <202401291428.40TESIjk086930@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: dcaf7895039d - stable/13 - condvar: Fix a user-after-free in _cv_wait() when ktrace is enabled List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: dcaf7895039d3f71fc4ab9da1697c126c7d6bf44 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=dcaf7895039d3f71fc4ab9da1697c126c7d6bf44 commit dcaf7895039d3f71fc4ab9da1697c126c7d6bf44 Author: Mark Johnston AuthorDate: 2024-01-15 17:29:02 +0000 Commit: Mark Johnston CommitDate: 2024-01-29 14:26:29 +0000 condvar: Fix a user-after-free in _cv_wait() when ktrace is enabled When a thread wakes up after sleeping on a CV, it must not dereference the CV structure, as it may already have been freed. At least ZFS relies on this invariant, see commit c636f94bd2ff15be5b904939872b4bce31456c18 for example. Thus, when logging context-switch events, copy the wmesg into a stack buffer while it is still safe to do so, and log that after waking up. While here, move the initial ktrcsw() call later, after assertions and the SCHEDULER_STOPPED_TD() condition are checked. Reported by: syzkaller Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D43450 (cherry picked from commit a5ef95cd228e43bcc459a5c8a9911e57888ba5fd) --- sys/kern/kern_condvar.c | 109 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 75 insertions(+), 34 deletions(-) diff --git a/sys/kern/kern_condvar.c b/sys/kern/kern_condvar.c index 6b5f2933e041..2731f581a29f 100644 --- a/sys/kern/kern_condvar.c +++ b/sys/kern/kern_condvar.c @@ -43,8 +43,9 @@ #include #include #ifdef KTRACE -#include #include +#include +#include #endif /* @@ -107,24 +108,32 @@ void _cv_wait(struct cv *cvp, struct lock_object *lock) { WITNESS_SAVE_DECL(lock_witness); +#ifdef KTRACE + char wmesg[WMESGLEN + 1]; +#endif struct lock_class *class; struct thread *td; uintptr_t lock_state; td = curthread; - lock_state = 0; -#ifdef KTRACE - if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0, cv_wmesg(cvp)); -#endif CV_ASSERT(cvp, lock, td); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, "Waiting on \"%s\"", cvp->cv_description); - class = LOCK_CLASS(lock); if (SCHEDULER_STOPPED_TD(td)) return; +#ifdef KTRACE + if (KTRPOINT(td, KTR_CSW)) { + strlcpy(wmesg, cv_wmesg(cvp), sizeof(wmesg)); + ktrcsw(1, 0, wmesg); + } else { + wmesg[0] = '\0'; + } +#endif + + class = LOCK_CLASS(lock); + lock_state = 0; sleepq_lock(cvp); CV_WAITERS_INC(cvp); @@ -145,7 +154,7 @@ _cv_wait(struct cv *cvp, struct lock_object *lock) #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0, cv_wmesg(cvp)); + ktrcsw(0, 0, wmesg); #endif PICKUP_GIANT(); if (lock != &Giant.lock_object) { @@ -161,14 +170,13 @@ _cv_wait(struct cv *cvp, struct lock_object *lock) void _cv_wait_unlock(struct cv *cvp, struct lock_object *lock) { +#ifdef KTRACE + char wmesg[WMESGLEN + 1]; +#endif struct lock_class *class; struct thread *td; td = curthread; -#ifdef KTRACE - if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0, cv_wmesg(cvp)); -#endif CV_ASSERT(cvp, lock, td); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, "Waiting on \"%s\"", cvp->cv_description); @@ -181,6 +189,15 @@ _cv_wait_unlock(struct cv *cvp, struct lock_object *lock) return; } +#ifdef KTRACE + if (KTRPOINT(td, KTR_CSW)) { + strlcpy(wmesg, cv_wmesg(cvp), sizeof(wmesg)); + ktrcsw(1, 0, wmesg); + } else { + wmesg[0] = '\0'; + } +#endif + sleepq_lock(cvp); CV_WAITERS_INC(cvp); @@ -196,7 +213,7 @@ _cv_wait_unlock(struct cv *cvp, struct lock_object *lock) #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0, cv_wmesg(cvp)); + ktrcsw(0, 0, wmesg); #endif PICKUP_GIANT(); } @@ -211,25 +228,33 @@ int _cv_wait_sig(struct cv *cvp, struct lock_object *lock) { WITNESS_SAVE_DECL(lock_witness); +#ifdef KTRACE + char wmesg[WMESGLEN + 1]; +#endif struct lock_class *class; struct thread *td; uintptr_t lock_state; int rval; td = curthread; - lock_state = 0; -#ifdef KTRACE - if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0, cv_wmesg(cvp)); -#endif CV_ASSERT(cvp, lock, td); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, "Waiting on \"%s\"", cvp->cv_description); - class = LOCK_CLASS(lock); if (SCHEDULER_STOPPED_TD(td)) return (0); +#ifdef KTRACE + if (KTRPOINT(td, KTR_CSW)) { + strlcpy(wmesg, cv_wmesg(cvp), sizeof(wmesg)); + ktrcsw(1, 0, wmesg); + } else { + wmesg[0] = '\0'; + } +#endif + + class = LOCK_CLASS(lock); + lock_state = 0; sleepq_lock(cvp); CV_WAITERS_INC(cvp); @@ -251,7 +276,7 @@ _cv_wait_sig(struct cv *cvp, struct lock_object *lock) #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0, cv_wmesg(cvp)); + ktrcsw(0, 0, wmesg); #endif PICKUP_GIANT(); if (lock != &Giant.lock_object) { @@ -272,24 +297,32 @@ _cv_timedwait_sbt(struct cv *cvp, struct lock_object *lock, sbintime_t sbt, sbintime_t pr, int flags) { WITNESS_SAVE_DECL(lock_witness); +#ifdef KTRACE + char wmesg[WMESGLEN + 1]; +#endif struct lock_class *class; struct thread *td; int lock_state, rval; td = curthread; - lock_state = 0; -#ifdef KTRACE - if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0, cv_wmesg(cvp)); -#endif CV_ASSERT(cvp, lock, td); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, "Waiting on \"%s\"", cvp->cv_description); - class = LOCK_CLASS(lock); if (SCHEDULER_STOPPED_TD(td)) return (0); +#ifdef KTRACE + if (KTRPOINT(td, KTR_CSW)) { + strlcpy(wmesg, cv_wmesg(cvp), sizeof(wmesg)); + ktrcsw(1, 0, wmesg); + } else { + wmesg[0] = '\0'; + } +#endif + + class = LOCK_CLASS(lock); + lock_state = 0; sleepq_lock(cvp); CV_WAITERS_INC(cvp); @@ -311,7 +344,7 @@ _cv_timedwait_sbt(struct cv *cvp, struct lock_object *lock, sbintime_t sbt, #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0, cv_wmesg(cvp)); + ktrcsw(0, 0, wmesg); #endif PICKUP_GIANT(); if (lock != &Giant.lock_object) { @@ -334,24 +367,32 @@ _cv_timedwait_sig_sbt(struct cv *cvp, struct lock_object *lock, sbintime_t sbt, sbintime_t pr, int flags) { WITNESS_SAVE_DECL(lock_witness); +#ifdef KTRACE + char wmesg[WMESGLEN + 1]; +#endif struct lock_class *class; struct thread *td; int lock_state, rval; td = curthread; - lock_state = 0; -#ifdef KTRACE - if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0, cv_wmesg(cvp)); -#endif CV_ASSERT(cvp, lock, td); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, "Waiting on \"%s\"", cvp->cv_description); - class = LOCK_CLASS(lock); if (SCHEDULER_STOPPED_TD(td)) return (0); +#ifdef KTRACE + if (KTRPOINT(td, KTR_CSW)) { + strlcpy(wmesg, cv_wmesg(cvp), sizeof(wmesg)); + ktrcsw(1, 0, wmesg); + } else { + wmesg[0] = '\0'; + } +#endif + + class = LOCK_CLASS(lock); + lock_state = 0; sleepq_lock(cvp); CV_WAITERS_INC(cvp); @@ -374,7 +415,7 @@ _cv_timedwait_sig_sbt(struct cv *cvp, struct lock_object *lock, #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0, cv_wmesg(cvp)); + ktrcsw(0, 0, wmesg); #endif PICKUP_GIANT(); if (lock != &Giant.lock_object) { From nobody Tue Jan 30 05:39:20 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPDWD41stz58L3F; Tue, 30 Jan 2024 05:39: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 4TPDWD39hxz4Wfk; Tue, 30 Jan 2024 05:39:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706593160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Lqgg8J3Uuyv0xHiEGBFIsnDy2y9JR1C9T7K/qtdXlI=; b=wOKOUw9i7BIADdKdkJhRJHBvLD/weVfLLVgzforxgJbd4UMv13CVGkW07xbaZwu5jmITf0 /Ku/GUPF8bqd5Q3qOrtTs7Y8winzEc8eraiuXC9/Wmy/DVoHXDhlaBEUcJJqbJ2oTH0Ijn C2WLrRS+nxzA0Gsit+69zUr8loc+Wr5N/w1LE/b6P0VbB7jNxzlPUm7N+Z/ZMWuemABSEp qw96Uhu/sXh3hV2SMD804cCfFczi/PducmxLBPRBbc0iS7rIUhq8gyjvIvJ165w/XEDtPl Wdr2w2mQHdBFbUY8iqFKPgTaOwOoqtPLfQYLcRNX6KQEvR4e87oBSoduZ5bCyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706593160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Lqgg8J3Uuyv0xHiEGBFIsnDy2y9JR1C9T7K/qtdXlI=; b=rysWmL2baoIMJJk2ko56ewmIIZvIev1F7qkrX45+WCtP4MDsDKj6kiuOoJVzJdmw+DwiGT P/4HAG2xancuTv7EbvbR6cKCJM9ub+BYj6kXZLpvlhB4rZlg2xAdUSW+TinNDK53r+WayW U20IMPzgTPxnOWnOKtdFm+rTQmlIqcI7rmKJsD1ssSct8cViB146eLD5qYPnNbtJD6lVzs MDcctrZXcLW4DyVjLEkHns/jaQSW0kbeWjhptzEhViHR5JxDIuSKRwE+6X2PLn+StUSDLx o26ryxe5A6lnMMl8LK7276hEF1UMjjxIJoRr6nVhifoeUnjEedPU9Mfo3Ym/yQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706593160; a=rsa-sha256; cv=none; b=I7fNmCB3zqGskXRFjeOogL3xDU4Hw/U4okZL+g00g1XgSuEcUzrDS80RTAS19cgy7ErFrq rcUSJdtdKsnRRj/f2ABmTzVxxVNKKFi2rDebS3gogx7qwjp+iruUX2f0iscYQB4L9ELuNH E24w9rvIU18++XG48hfRZ4rcWgJtrPeLO9Vo/R3yIsWGawmkDk02VlrI9eoiAqFSkxAV2d QANFYqJEy6G9tNYaAOwsHA9YXwQv5nnuKClESe9KtPJmKLY5x54c4VP8fnfgM5rKTfrcgj jg5yNaYrbBo7fv5uuvjrOq217keJUy6WKyxzTxWzjFgXJKWuMiVLeezyAQaAmw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPDWD2F9bzNfD; Tue, 30 Jan 2024 05:39: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 40U5dK5G019095; Tue, 30 Jan 2024 05:39:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40U5dK0x019092; Tue, 30 Jan 2024 05:39:20 GMT (envelope-from git) Date: Tue, 30 Jan 2024 05:39:20 GMT Message-Id: <202401300539.40U5dK0x019092@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 3deeb70f7f70 - stable/13 - wg: detach bpf upon destroy as well List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 3deeb70f7f70e5fbabde85efc7ea603cde915f6a Auto-Submitted: auto-generated The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=3deeb70f7f70e5fbabde85efc7ea603cde915f6a commit 3deeb70f7f70e5fbabde85efc7ea603cde915f6a Author: Aaron LI AuthorDate: 2024-01-22 16:18:56 +0000 Commit: Kyle Evans CommitDate: 2024-01-30 05:38:01 +0000 wg: detach bpf upon destroy as well bpfattach() is called in wg_clone_create(), but the bpfdetach() is missing from wg_close_destroy(). Add the missing bpfdetach() to avoid leaking both the associated bpf bits as well as the ifnet that bpf will hold a reference to. PR: 276526 (cherry picked from commit 43be2d7aaf25b719aec8f49aab110c0061f1edec) --- sys/dev/wg/if_wg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/wg/if_wg.c b/sys/dev/wg/if_wg.c index e961c9f24d94..89b5e52b7b2b 100644 --- a/sys/dev/wg/if_wg.c +++ b/sys/dev/wg/if_wg.c @@ -2876,6 +2876,7 @@ wg_clone_destroy(struct if_clone *ifc, struct ifnet *ifp, uint32_t flags) if (cred != NULL) crfree(cred); + bpfdetach(sc->sc_ifp); if_detach(sc->sc_ifp); if_free(sc->sc_ifp); From nobody Tue Jan 30 05:39:25 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPDWK55X8z58L3J; Tue, 30 Jan 2024 05:39: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 4TPDWK4DRpz4WQT; Tue, 30 Jan 2024 05:39:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706593165; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6MxAsiv05/6xZa+fvJUPnnta1mUo89SOw9pMMtQdyq0=; b=bnKiO+wVh08JRNHMCud5TFeq0Wd5uD5w2IaACFoYGFhZ2Wc8aOFDvs5bgeCoCEBpEQoHNE Cs6aBzwCDUgsjS3EnZLIlD57S+KL+ZtJ2zYuRBb0Wtu3QF9pqBVX74ANevLKMdgnfaCXr4 9RFYaLMqic9cdt/cL3bzSnmVZeOQ8sBYqdTtQ1jf2K1YisPoUTwc4/BIaaIDvyaLaiUxn+ qGuxQqjPA/gVbiZlREeDhC1UbdIVxmpSyQtdFDJ83mf5t84qFlmxAoBRN4g/Ys9WkZ+QAq iPIDOD5+t8qqrPn9YX8p+4kCpKL/znBD352VzVEjV3oCwDbZ+MM2G85zPhJmow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706593165; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6MxAsiv05/6xZa+fvJUPnnta1mUo89SOw9pMMtQdyq0=; b=DIMS/9GL9o0/fEutlDQm09I48zfU3o04KFrmtDSCAZB/hER7yTsUDSMKhWSOZTVmGSlasi /qxVf4N9i6NRcYRWWFqbp0JVQ1ppPDLZGDbxNuR0QvKVqqvSsr7gymuGjI4Fzi+QbdM5Hh 1j1Uortvtii1nkGL+eiZicGI80knR8F7gtkVhsXAk9EpyFhcGqGdejBe+ZGWYCE8iIni8o rn3QjoU3/Ug8lMpJvdfgVDNsD6EIC45LNvYqsxRGArwLzYS/gLZ18/MOEI/5l/COpVTVuh tn1YvHy6IuhvZokbAQPs4KJE1Vk/fRjJomM9zFzQOOpjHYtXDdylmtKhQhH11A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706593165; a=rsa-sha256; cv=none; b=SUicE5c+yDrYFJoUJgdD1HfCBBGlwvYudMnfTs7tDCZUVjH/NEYbDK9qaL0dXekfGjzv4Q MSWD6Khc6qYv2OiNAmbk2UtzLeT30frGAKd8rEeBPCaD4fqcZjNAiDUoVnVCVNtmDiQv7A IqFk2GKFeSpVUBqc/Iqq2YZp2EknfiJ85yz0x+wLuBqAbv88tiRR+GulwEBYY3pCPgxHgw 927+Q46BQ5t0iAgDAXkuV8KgPAWNxRNc6+gKMMozfKVd1iFXmB7r4pJbe87awGaqRJNZgN VxKRDzTEEZ6QitmJu6pPUATU+JHYWgmoGjZB1ZFz6V4P2aEVE4YuorEL3yEmhQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPDWK2CJmzNTC; Tue, 30 Jan 2024 05: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 40U5dPEo019291; Tue, 30 Jan 2024 05: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 40U5dPBE019288; Tue, 30 Jan 2024 05:39:25 GMT (envelope-from git) Date: Tue, 30 Jan 2024 05:39:25 GMT Message-Id: <202401300539.40U5dPBE019288@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 86986d381072 - stable/14 - if_wg: fix erroneous calculation in calculate_padding() for p_mtu == 0 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 86986d381072171a5d6183701ae2f96c2d9a6406 Auto-Submitted: auto-generated The branch stable/14 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=86986d381072171a5d6183701ae2f96c2d9a6406 commit 86986d381072171a5d6183701ae2f96c2d9a6406 Author: Aaron LI AuthorDate: 2024-01-17 23:29:23 +0000 Commit: Kyle Evans CommitDate: 2024-01-30 05:37:29 +0000 if_wg: fix erroneous calculation in calculate_padding() for p_mtu == 0 In practice this is harmless; only keepalive packets may realistically have p_mtu == 0, and they'll also have no payload so the math works out the same either way. Still, let's prefer technical accuracy and calculate the amount of padding needed rather than the padded length... PR: 276363 (cherry picked from commit b891f61ef538a4e9b4658b4b756635c8036a5788) --- sys/dev/wg/if_wg.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/dev/wg/if_wg.c b/sys/dev/wg/if_wg.c index 0ea40b763416..738b1e76fa85 100644 --- a/sys/dev/wg/if_wg.c +++ b/sys/dev/wg/if_wg.c @@ -1461,8 +1461,12 @@ calculate_padding(struct wg_packet *pkt) { unsigned int padded_size, last_unit = pkt->p_mbuf->m_pkthdr.len; - if (__predict_false(!pkt->p_mtu)) - return (last_unit + (WG_PKT_PADDING - 1)) & ~(WG_PKT_PADDING - 1); + /* Keepalive packets don't set p_mtu, but also have a length of zero. */ + if (__predict_false(pkt->p_mtu == 0)) { + padded_size = (last_unit + (WG_PKT_PADDING - 1)) & + ~(WG_PKT_PADDING - 1); + return (padded_size - last_unit); + } if (__predict_false(last_unit > pkt->p_mtu)) last_unit %= pkt->p_mtu; @@ -1470,7 +1474,7 @@ calculate_padding(struct wg_packet *pkt) padded_size = (last_unit + (WG_PKT_PADDING - 1)) & ~(WG_PKT_PADDING - 1); if (pkt->p_mtu < padded_size) padded_size = pkt->p_mtu; - return padded_size - last_unit; + return (padded_size - last_unit); } static void From nobody Tue Jan 30 05:39:26 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPDWL6Fpsz58LDM; Tue, 30 Jan 2024 05: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 4TPDWL5WMwz4Wfp; Tue, 30 Jan 2024 05: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=1706593166; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bsWfeUsNgViJs81flVvf2ljPLcmW+v9XoqSPnqk7Vvg=; b=o3qBpbAnWAUlTkWUEJZW5C9I8nlYIZYdHw0btaAadiFyyX2gvDFKxxfRhHF4jca/UoQfgo NB/MkPgWUgZY5PgFr4JqCjlHMyu0Vbp+fQV0qs6Ovh+S8SYAWxyarSkdUUy7SxKWcIph7s e8FZ1OwtmBQekJaYDnTR76ziAkSqJwrbQ5bEk6pqRiGcEiV31MHe74DhDZOZnoonSicr0d 36SRC9tAnXPSEJxXglLehu6hNroI9Hn23HCdYuSUGlXsODe0SFi4SIvoZlrfpEuxhUB80a XeiI03OMvY/lpcHrVJW5ma6TFApcArjqvuoerXwA/OZ4jkPj19SzhxGhR1sG1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706593166; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bsWfeUsNgViJs81flVvf2ljPLcmW+v9XoqSPnqk7Vvg=; b=uleuGrgrJdK9kBvG4Q2VNFNTJZI1YbeSoYcSNxA4bHHWMCcDH3telopK1C4OL78yRLOFc2 5WbijMGN08B1bnXd28tCtYNuDfK009+dQMnrmFlcFRXhoPI7JRLxQSZ6z3tCyEKwApHHht 1cbZ/103F7o6P2xy4FuxkFrVT7Pp8p/rHQ3xk8uSBZ+drLq9T2aoHybMsj+KZCoJv1P0dS zpy6ARoTk+KZPKuk00Re4kq3Y4prWV+z80H99jqW4YFbn89szUmZNY29/VP+5PFyvYdD91 0MZLb/XS3jOYtshuSMIBJ/mnOCX+0P+oT9uhsBVY9yCAJTMQPwVi0HI3+CBL5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706593166; a=rsa-sha256; cv=none; b=yLVRddVOyre1XwpQIROPLSNxcbkghx0w10uUhRAoVsDwfj1zncn2LQ3Hce1Tq81mq9PcF0 9biE3+vWe/XGDUSkQER1VB7S085Q0rsNpxcQ5lPn6nyi7dNPGYnaWgkdDlxH1IycH4O8W/ +EU0e6CquUyDrVKkLM5otKqJfbQaEt3EkbRGRlrEyVIjHTYIlldJehQXevFOvG6R3S+X8w un1imSTdz8q1qwqcjF5XScSSmbNzf2EDbxJoET8wZu2zlJeyfUKrcBARntWrRXIYBvB9rs jyh42+IM3dLP9JQrTG3SWVt/NNKDgzk6W7T+Q72PbKw12w2+/Dxf/li0C49t3g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPDWL2SWXzNYJ; Tue, 30 Jan 2024 05: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 40U5dQXW019339; Tue, 30 Jan 2024 05: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 40U5dQHH019336; Tue, 30 Jan 2024 05:39:26 GMT (envelope-from git) Date: Tue, 30 Jan 2024 05:39:26 GMT Message-Id: <202401300539.40U5dQHH019336@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: b0fa37f356fd - stable/14 - if_wg: fix access to noise_local->l_has_identity and l_private List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: b0fa37f356fd9dd5040c034c7523ec235fbb311b Auto-Submitted: auto-generated The branch stable/14 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=b0fa37f356fd9dd5040c034c7523ec235fbb311b commit b0fa37f356fd9dd5040c034c7523ec235fbb311b Author: Aaron LI AuthorDate: 2024-01-17 23:29:23 +0000 Commit: Kyle Evans CommitDate: 2024-01-30 05:37:33 +0000 if_wg: fix access to noise_local->l_has_identity and l_private These members are protected by the identity lock, so rlock it in noise_remote_alloc() and then assert that we have it held to some extent in noise_precompute_ss(). PR: 276392 (cherry picked from commit 7a4d1d1df0b2e369adcb32aea9ef8c180f885751) --- sys/dev/wg/wg_noise.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/wg/wg_noise.c b/sys/dev/wg/wg_noise.c index 3db74ac9580f..a727a2f99d15 100644 --- a/sys/dev/wg/wg_noise.c +++ b/sys/dev/wg/wg_noise.c @@ -281,6 +281,7 @@ noise_local_keys(struct noise_local *l, uint8_t public[NOISE_PUBLIC_KEY_LEN], static void noise_precompute_ss(struct noise_local *l, struct noise_remote *r) { + rw_assert(&l->l_identity_lock, RA_LOCKED); rw_wlock(&r->r_handshake_lock); if (!l->l_has_identity || !curve25519(r->r_ss, l->l_private, r->r_public)) @@ -302,7 +303,10 @@ noise_remote_alloc(struct noise_local *l, void *arg, r->r_handshake_state = HANDSHAKE_DEAD; r->r_last_sent = TIMER_RESET; r->r_last_init_recv = TIMER_RESET; + + rw_rlock(&l->l_identity_lock); noise_precompute_ss(l, r); + rw_runlock(&l->l_identity_lock); refcount_init(&r->r_refcnt, 1); r->r_local = noise_local_ref(l); From nobody Tue Jan 30 05:39:27 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPDWM6mkHz58Kw5; Tue, 30 Jan 2024 05: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 4TPDWM5sCZz4Wc0; Tue, 30 Jan 2024 05: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=1706593167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wwzd9H9Qy2DWnG7AWnklJ/yXqn8uaVx+8Q09wk/6VHw=; b=doIZ8QPZnLXXrfVp083RI47QW72KghwodxKlPjgFPOfMDICSVS1QsPgItRqD2HKki+ewta 7dLv04onA9ftfPVeemkQ1OFnXXuOrlf++M4T2g63wloozkSC9rvnYvqVMKq7jKk/U3IPfE i6Vk1nuAeBx5AS1Ot0lCOIQVIHDTd28YAcHwY10RrQXuQz/BXbIzhtQbRP7oJukAUUTahW vHxLwDAETSanLVc9czDmUZE2aRgSfBKJMapCEObZ4PNBNP7azZI6y+Lwnm+vxT7Rw9hmzb V1lv5W3WbrQRu+jDhDWcMzEzepxtnquD08zZBtrLaEym1WKx1iqYGP9omkND8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706593167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wwzd9H9Qy2DWnG7AWnklJ/yXqn8uaVx+8Q09wk/6VHw=; b=tH9OtFCJfKvNW1K9OmktfSq7X+xEMgCdImtfRrxtlAAEU2V0MPfYlzfKAgHAqWPXUVF3eP Rvf58dYYO+IsCv+NRG6irqo7O6JU6jfmZYIUgDQBTEYZWPD+cs9yb/8EM6vWe0nJ6Vp4Xo hLzIrsaUE+8P+PfuZGMRBRzb9MX3jIk0ofKusGomknq+5C9CWZ3WfoAp3gvsa4Mxt3nNd2 NVRcL4J0iFkX9CGKyXn5eRC9qV6vDXAG4RbJGhbajA4rVMnSM9Su7GXLargWUhjYt1BcaZ zu8gsh97q+ZnSzJgZJmUSeKhdR1NnXIk6wPtCGhpdTxb9mQ2tQ3UDdxHk49d2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706593167; a=rsa-sha256; cv=none; b=tR7qB1OEcP4rQdz7UvbTx9oVAw5rntVURyheloK+3rm6CsDEviYdAKUUyWCmxCrj2Nu7Tm 2ixdoPCwxiBDB9vmErJzkym5ZTLyR9LaYnKCKVQLXU3mh6hAEEZceN/nTNhJZW0bD8KS3X 6IDYDTs11PUIxijARnWb+nuAtC59QiQ+o5H61rAe5xqTcyREMOvsVU1ipue4aWgpNTOTXR 3XOxjDvljSOghdRrokLmVv/2BHgHn7PJVlikAuqhS66tFuQgawePw7BLBb7MoV0RAfGaq5 Ws1M6AW9cFqbT8acOg+I60GhuRO+v4OErl2uj9PrBDCai0Zy+CSZm+0WyFbCkg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPDWM31rtzNYK; Tue, 30 Jan 2024 05: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 40U5dRm3019388; Tue, 30 Jan 2024 05: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 40U5dRGs019385; Tue, 30 Jan 2024 05:39:27 GMT (envelope-from git) Date: Tue, 30 Jan 2024 05:39:27 GMT Message-Id: <202401300539.40U5dRGs019385@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: c0c932b27f95 - stable/14 - wg: detach bpf upon destroy as well List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: c0c932b27f9551742daa84b02967f3021fbfef52 Auto-Submitted: auto-generated The branch stable/14 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=c0c932b27f9551742daa84b02967f3021fbfef52 commit c0c932b27f9551742daa84b02967f3021fbfef52 Author: Aaron LI AuthorDate: 2024-01-22 16:18:56 +0000 Commit: Kyle Evans CommitDate: 2024-01-30 05:37:36 +0000 wg: detach bpf upon destroy as well bpfattach() is called in wg_clone_create(), but the bpfdetach() is missing from wg_close_destroy(). Add the missing bpfdetach() to avoid leaking both the associated bpf bits as well as the ifnet that bpf will hold a reference to. PR: 276526 (cherry picked from commit 43be2d7aaf25b719aec8f49aab110c0061f1edec) --- sys/dev/wg/if_wg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/wg/if_wg.c b/sys/dev/wg/if_wg.c index 738b1e76fa85..c324b5fb048b 100644 --- a/sys/dev/wg/if_wg.c +++ b/sys/dev/wg/if_wg.c @@ -2874,6 +2874,7 @@ wg_clone_destroy(struct if_clone *ifc, if_t ifp, uint32_t flags) if (cred != NULL) crfree(cred); + bpfdetach(sc->sc_ifp); if_detach(sc->sc_ifp); if_free(sc->sc_ifp); From nobody Tue Jan 30 07:22:09 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPGns32VVz58VGb; Tue, 30 Jan 2024 07:22: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 4TPGns1yMJz4pXD; Tue, 30 Jan 2024 07:22:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706599329; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CH5gfW68kt/QhHWmlop3ptttd8j4mZcl8foWm/rc6M8=; b=N3n3k+TY4E79ift+/+b8tRm8mZxaDBeU6UASwJgbNxvdob0/C6f79kkL3QyWtVi6EP1fbb OxmTtPc/6qLKK5E0pX65LVOwvSvKHj3bnwQH0aA6q3wJg0KQo9P6dmwsBdjR8T1tVuXof1 i6Ja797ouOaiW/WmrlKVWxvGjthQt5KL7o1xsNBnuAkF2/ak1jkUNckPiZ3Pmw2fBCn6Dv 7n4JtO+9bkti0zbET5zGuHPgD8h7c4lh4/i6PECVEa+QO4HWj3oefjykDsMJlzebTKWKQa JTkWWx+wowwBMTHq6swDJ0Z2Vi287QqEaclZPORrjM5KSfS+qGqjGD8fvPHajg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706599329; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CH5gfW68kt/QhHWmlop3ptttd8j4mZcl8foWm/rc6M8=; b=KF1NxjSjlfMw2dqt5KnRWoF3C5+FXcRsO7uws+KJTfc3tmH3cbPoKio9PJ+V3vogqosuKV No01lvjQngieqWbM9viEgLdvefe4Zledo+xbVefVdTrqkBJ0ajtXTOmdHE/bKFW4+we/GT hBzqq6NNkPndliiiI9w8j8DY5IkFpBZO27vFouYBgfLjRzFAgi8uAUkE+71CzeKJp1M1Wv BtlwMma5Ip43BH9VqS380QYLmkFf/JoaGfU/DR4+EqOTQMDrUMIHjRxttYlYXCLqFT8a/w yCKpQDHJktzNmbsoHHO78jQkIS8ONKgH2r5yp3sJhld3WA0rxdsMMgqyWggpjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706599329; a=rsa-sha256; cv=none; b=OX/TaIOehsdMKJ89DZIs/F2u5m/HeGGRN/TaKYsqezOR4fK0WmTdHyJL7TcygDnz3+04X1 XD7bzORQm9VcQkhkLMAaoNkJ4bUd95ZZlsujRvBLNztU2j/CeNXakfc5nNvRtUhXWP6/Fn a/9/VhUkMYs3IgOW4RJ5G53a/8ImlGNR+dpthp+57YUlLPpbPUxMfXc+EdT9Amm9nbSsZh eolro57gkDOTd2N83pLmgrUCin4roQxybybULZKhi+MFNouXJHe6xghOqz3irIydh5b5+Y m4jHbnbl0ULao3LzQU0x9Dgig4+jjCpYy2IV0qOqQA8HFtXToaBKgN3dTutRRg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPGns13DZzQYD; Tue, 30 Jan 2024 07:22: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 40U7M9uM003621; Tue, 30 Jan 2024 07:22:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40U7M98T003618; Tue, 30 Jan 2024 07:22:09 GMT (envelope-from git) Date: Tue, 30 Jan 2024 07:22:09 GMT Message-Id: <202401300722.40U7M98T003618@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: c682a9501853 - stable/14 - releng-gce: Advertise the availability of UEFI support in GCE images. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c682a95018539571cdc83a73ff38716d972e1b24 Auto-Submitted: auto-generated The branch stable/14 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=c682a95018539571cdc83a73ff38716d972e1b24 commit c682a95018539571cdc83a73ff38716d972e1b24 Author: Xin LI AuthorDate: 2024-01-27 03:09:39 +0000 Commit: Xin LI CommitDate: 2024-01-30 07:21:47 +0000 releng-gce: Advertise the availability of UEFI support in GCE images. The amd64 and arm64 images supported UEFI, mark it as so users can take advantage of UEFI boot on GCE. This is already done on FreeBSD 14.0-RELEASE but never codified into the release tools (and should). PR: conf/276532 Reviewed by: lwhsu Differential Revision: https://reviews.freebsd.org/D43557 (cherry picked from commit 72dd306e44bc531fa723f4cdb631cb63cc5f09cb) --- release/Makefile.gce | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/Makefile.gce b/release/Makefile.gce index f244e6c89640..2bfdf4edc246 100644 --- a/release/Makefile.gce +++ b/release/Makefile.gce @@ -73,7 +73,7 @@ gce-do-upload-${_FS}: gs://${GCE_BUCKET}/ /usr/local/bin/gcloud compute images create ${GCE_TARGET_${_FS}} \ --family=${GCE_FAMILY}${GCE_FAMILY_SUFX} ${GCE_LICENSE} \ - --guest-os-features=GVNIC \ + --guest-os-features=GVNIC,UEFI_COMPATIBLE \ --source-uri gs://${GCE_BUCKET}/${GCE_TARGET_${_FS}}.tar.gz touch ${.OBJDIR}/${.TARGET} .endfor From nobody Tue Jan 30 07:23:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPGqC4NFJz58VTN; Tue, 30 Jan 2024 07:23:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TPGqC2MM9z4pnM; Tue, 30 Jan 2024 07:23:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706599399; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5bdrLVBm9U+/qFJB6buC7Gn0ccy9BND7h4y1eQ4U/rw=; b=G8X8G6x6qoV6vrZhcgjznzR/spfovoUdjYk5rYw4En9UJknoRdajo6NpzfhjIGydn4hTGB IGmVHBS0yJPvij8bD2DR1kAZASFVYwsXovIzVgtF4BF8z9WNds9vQp8ezRqzpyxcvt8MHL 8mOAB4fN4jPfL0Ev7By02IuEsR25YgoR631ufztE1mkZ91I2H9SiPjuxsX266NYStm41mr qBeY0u7pSOg6zSPoY0FGr3i9XFHI3pnMwHQWKYoArTWCB9lJFphctDnTgrNtzH0K9Uh7Kr wVhCHS+lxzS/vJfDt2JJL3+jNzE79gi58GIAYnpukwzxIOdasZ7BxDj8anmFQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706599399; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5bdrLVBm9U+/qFJB6buC7Gn0ccy9BND7h4y1eQ4U/rw=; b=wrYbGrdYDSlrRP1LKd6mzs5RhmPBs04ZpdRIYg6dsD1XHlAhp//omyAR3tHn/fksZbbKcw kML5rMbd58r3oAeSYfhcKdZ1mgnb3Bp7Fx6pXk6KdPAgZoY4w8hruGuvy72S63QCI9Fop6 a1AW3AvDSIhbGa7Xmbp9lN1sU4Mx54dgQF50jLTj230z5WtfQxhycJNjlol3LIzFqdtfmq 7Bi9n7rtxDZNnc4T9l0kZNmy0uPphNpRXoosynku7Xle6Y72wNHfOzdozi2gfidd4veQwk ruFYYsmDAOLyehAUiSRoNOUjb7HEgpWt9EhDA13J9cPzc3vbHRKS5Qp53altRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706599399; a=rsa-sha256; cv=none; b=jRbR5Q+d50m23HVjjnfFF0u2Z1HQwltt4zKCtA8hCcRbBNtkb4fcp1pc7Z2UZF92OlblP3 Bm8i2WM2X6pDCgRMw660yOPMThHfsboKUXc06DjmfsJ5oGSQQffmqJXx45LY00JShM9dmT dtecUHLInAL8GqoOqrb9WYz0+7ne1DgxzxOj0xBpmSjKJIbaj3tOky42gRGeMk1Ws00pM2 D2NYREGEhJpMyR9s8zmx3sNeQL6ZRzJkwRSMlrovag6gwGbq4wFV2/iTPDqdVWHXWHrphf Z3J1Vli1EhKMMtbPKz7Y3TR8YVRoHJdpz9mfjhFvJiGtpbH/M6+Xvx90/3PAzQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPGqC1PltzQYG; Tue, 30 Jan 2024 07:23: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 40U7NJJ2003943; Tue, 30 Jan 2024 07:23:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40U7NJPO003940; Tue, 30 Jan 2024 07:23:19 GMT (envelope-from git) Date: Tue, 30 Jan 2024 07:23:19 GMT Message-Id: <202401300723.40U7NJPO003940@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: a465a52e8092 - stable/13 - releng-gce: Advertise the availability of UEFI support in GCE images. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a465a52e80922510cb4ab493f29b51055ca78bf8 Auto-Submitted: auto-generated The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=a465a52e80922510cb4ab493f29b51055ca78bf8 commit a465a52e80922510cb4ab493f29b51055ca78bf8 Author: Xin LI AuthorDate: 2024-01-27 03:09:39 +0000 Commit: Xin LI CommitDate: 2024-01-30 07:23:06 +0000 releng-gce: Advertise the availability of UEFI support in GCE images. The amd64 and arm64 images supported UEFI, mark it as so users can take advantage of UEFI boot on GCE. This is already done on FreeBSD 14.0-RELEASE but never codified into the release tools (and should). PR: conf/276532 Reviewed by: lwhsu Differential Revision: https://reviews.freebsd.org/D43557 (cherry picked from commit 72dd306e44bc531fa723f4cdb631cb63cc5f09cb) --- release/Makefile.gce | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/Makefile.gce b/release/Makefile.gce index c0b4985937a0..ea5daf290e3c 100644 --- a/release/Makefile.gce +++ b/release/Makefile.gce @@ -72,7 +72,7 @@ gce-do-upload: gs://${GCE_BUCKET}/ /usr/local/bin/gcloud compute images create ${GCE_TARGET} \ --family=${GCE_FAMILY}${GCE_FAMILY_SUFX} ${GCE_LICENSE} \ - --guest-os-features=GVNIC \ + --guest-os-features=GVNIC,UEFI_COMPATIBLE \ --source-uri gs://${GCE_BUCKET}/${GCE_TARGET}.tar.gz touch ${.OBJDIR}/${.TARGET} From nobody Tue Jan 30 11:08:21 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPMpt1sQQz58dQC; Tue, 30 Jan 2024 11:08: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 4TPMpt1cbJz4HCY; Tue, 30 Jan 2024 11:08:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706612902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jjADzkLTYRa0aQb5rgOeEu1yg38R1NVRkalIUn13WgU=; b=yZKJoQEcrX5E+14+zAg7T0CR+GqB/fwFqAxhkB7meKWQbDvkkHXmCWn7x84oOvioKH7q4f 6xW6IpTzEkeKcdmNGRFypd51SW91k44JcqXWR2rNaQNWHgpwKrZ3pPKh3UdIZ63PA3+GTO eTs2u/Vc41Fwh3LDrrsh4erwrjoaVFbIv/9YP8yJj8P49/jucKUuamsyu3Y0cjX35x2yP0 oSv7+VMvwe6K5rnvIb7auAdU+XvUNEASrtqe62A/4yawkNEuubjDwN6ksvzYdosZGxtDJ0 epSmGUmE/Ke8fdC5N3O+bEWrXUTgQMRJbAN2x2PhZQiNjvA3+Pf3+hpWiD5npA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706612902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jjADzkLTYRa0aQb5rgOeEu1yg38R1NVRkalIUn13WgU=; b=UQtrG9CnXflPoFxotyb7Qo39p8v5UjODbKu7iBHSj5GFKABKkfOI4SHBssTwGWFnOZUn0R vzDaiWCF75psx5smv0GzhvybXM9K4Ovre+n8cQxUpjG+UoD/IOuyOpPpykyJ9SQQY5PXhw XHG47j7vVbLFS2+QhGz/Ms5LAQCN4wmFN5Jqc1M6iawZKXesqFzKTv6qdLsBoZr76rW/qr VPaMb1XhAeq9Eb/t8rw6OR6P+Jn5Eii/UKK0kocTmWe2IthGzOgvmUaDlFDgtXDjW0VHtZ JZHKrdZWT/CDQ+EiVl5cuxqSu3QoHRKLpUgC2sPWFPY4tkr++EDGJ7ulWLRROg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706612902; a=rsa-sha256; cv=none; b=uHajHMKU3aVorRhmTg5ojYROpYPF0hfWmgB1oo8Vt8In/GhlDUqn3iNqXZ7TE1Zpl1OhCa 1zZVtFwxoJUyXxpPxFoykwW76uxm892ntrAYvB+/6H7i0p2EbQu2vhHl6Jwfo7sUadNk56 bseDOmFA3NjG+CtWSjf3Nw+KgKdM0U6XjMNkGYUtIZo5GDhXdoNcm10/NvAcSq7sWG/3oe PRE7l6OkIdjOcfZCMXNZLPqLCOjr9zdpmzhl0LxBjc/K+Aj4eMoj+b0n1i+QJS/QvuPl6u g20xRzJon22HXQsrprScLl9JwfuD6sbJvvtWsvAkaeg/iqFujp0fYxibPr47fw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPMpt0cwjzYRh; Tue, 30 Jan 2024 11:08: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 40UB8Lcg075721; Tue, 30 Jan 2024 11:08:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UB8Lwh075719; Tue, 30 Jan 2024 11:08:21 GMT (envelope-from git) Date: Tue, 30 Jan 2024 11:08:21 GMT Message-Id: <202401301108.40UB8Lwh075719@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: 59fccd1e84e7 - stable/14 - Setups with digital audio connections like SPDIF and ADAT require a designated master clock to stay in sync. Add a sysctl setting to control the preferred clock source for each HDSPe sound card. Complement this by sysctl values to list available clock sources, show the currently effective clock source and display the sync status of all connections. Clock sources are named according to RME user manuals. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 59fccd1e84e7ca9132a31d7f7ce028359eef1733 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=59fccd1e84e7ca9132a31d7f7ce028359eef1733 commit 59fccd1e84e7ca9132a31d7f7ce028359eef1733 Author: Ruslan Bukin AuthorDate: 2024-01-04 09:35:00 +0000 Commit: Christos Margiolis CommitDate: 2024-01-30 11:07:28 +0000 Setups with digital audio connections like SPDIF and ADAT require a designated master clock to stay in sync. Add a sysctl setting to control the preferred clock source for each HDSPe sound card. Complement this by sysctl values to list available clock sources, show the currently effective clock source and display the sync status of all connections. Clock sources are named according to RME user manuals. Submitted by: Florian Walpen Differential Revision: https://reviews.freebsd.org/D43252 (cherry picked from commit b6052c10fb4ad70915e2f82ce606fd7715477eef) --- share/man/man4/snd_hdspe.4 | 41 +++++++- sys/dev/sound/pci/hdspe-pcm.c | 4 +- sys/dev/sound/pci/hdspe.c | 226 ++++++++++++++++++++++++++++++++++++++++-- sys/dev/sound/pci/hdspe.h | 27 +++-- 4 files changed, 282 insertions(+), 16 deletions(-) diff --git a/share/man/man4/snd_hdspe.4 b/share/man/man4/snd_hdspe.4 index dba81f653d4b..4b925b14aef6 100644 --- a/share/man/man4/snd_hdspe.4 +++ b/share/man/man4/snd_hdspe.4 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 13, 2012 +.Dd December 30, 2023 .Dt SND_HDSPE 4 .Os .Sh NAME @@ -59,6 +59,45 @@ RME HDSPe AIO .It RME HDSPe RayDAT .El +.Sh SYSCTL TUNABLES +These settings and informational values can be accessed at runtime with the +.Xr sysctl 8 +command. +If multiple RME HDSPe sound cards are installed, each device has a separate +configuration. +To adjust the following sysctl identifiers for a specific sound card, insert +the respective device number in place of +.Ql 0 . +.Bl -tag -width indent +.It Va dev.hdspe.0.clock_list +Lists possible clock sources to sync with, depending on the hardware model. +This includes internal and external master clocks as well as incoming digital +audio signals like AES, S/PDIF and ADAT. +.It Va dev.hdspe.0.clock_preference +Select a preferred clock source from the clock list. +HDSPe cards will sync to this clock source when available, but fall back to +auto-sync with any other digital clock signal they receive. +Set this to +.Ql internal +if the HDSPe card should act as master clock. +.It Va dev.hdspe.0.clock_source +Shows the actual clock source in use (read only). +This differs from what is set as clock preference when in auto-sync mode. +.It Va dev.hdspe.0.sync_status +Display the current sync status of all external clock sources. +Status indications are +.Ql none +for no signal at all, +.Ql lock +for when a valid signal is present, and +.Ql sync +for accurately synchronized signals (required for recording digital +audio). +.El +.Pp +Where appropriate these sysctl values are modeled after official RME software on +other platforms, and adopt their terminology. +Consult the RME user manuals for additional information. .Sh SEE ALSO .Xr sound 4 .Sh HISTORY diff --git a/sys/dev/sound/pci/hdspe-pcm.c b/sys/dev/sound/pci/hdspe-pcm.c index 04ab7d2d35ce..b3daed4d9599 100644 --- a/sys/dev/sound/pci/hdspe-pcm.c +++ b/sys/dev/sound/pci/hdspe-pcm.c @@ -519,8 +519,8 @@ hdspechan_setspeed(kobj_t obj, void *data, uint32_t speed) } switch (sc->type) { - case RAYDAT: - case AIO: + case HDSPE_RAYDAT: + case HDSPE_AIO: period = HDSPE_FREQ_AIO; break; default: diff --git a/sys/dev/sound/pci/hdspe.c b/sys/dev/sound/pci/hdspe.c index 7124fb1f5c57..8a7cac87fc1a 100644 --- a/sys/dev/sound/pci/hdspe.c +++ b/sys/dev/sound/pci/hdspe.c @@ -31,6 +31,9 @@ * Supported cards: AIO, RayDAT. */ +#include +#include + #include #include #include @@ -40,6 +43,31 @@ #include +static struct hdspe_clock_source hdspe_clock_source_table_rd[] = { + { "internal", 0 << 1 | 1, HDSPE_STATUS1_CLOCK(15), 0, 0 }, + { "word", 0 << 1 | 0, HDSPE_STATUS1_CLOCK( 0), 1 << 24, 1 << 25 }, + { "aes", 1 << 1 | 0, HDSPE_STATUS1_CLOCK( 1), 1 << 0, 1 << 8 }, + { "spdif", 2 << 1 | 0, HDSPE_STATUS1_CLOCK( 2), 1 << 1, 1 << 9 }, + { "adat1", 3 << 1 | 0, HDSPE_STATUS1_CLOCK( 3), 1 << 2, 1 << 10 }, + { "adat2", 4 << 1 | 0, HDSPE_STATUS1_CLOCK( 4), 1 << 3, 1 << 11 }, + { "adat3", 5 << 1 | 0, HDSPE_STATUS1_CLOCK( 5), 1 << 4, 1 << 12 }, + { "adat4", 6 << 1 | 0, HDSPE_STATUS1_CLOCK( 6), 1 << 5, 1 << 13 }, + { "tco", 9 << 1 | 0, HDSPE_STATUS1_CLOCK( 9), 1 << 26, 1 << 27 }, + { "sync_in", 10 << 1 | 0, HDSPE_STATUS1_CLOCK(10), 0, 0 }, + { NULL, 0 << 1 | 0, HDSPE_STATUS1_CLOCK( 0), 0, 0 }, +}; + +static struct hdspe_clock_source hdspe_clock_source_table_aio[] = { + { "internal", 0 << 1 | 1, HDSPE_STATUS1_CLOCK(15), 0, 0 }, + { "word", 0 << 1 | 0, HDSPE_STATUS1_CLOCK( 0), 1 << 24, 1 << 25 }, + { "aes", 1 << 1 | 0, HDSPE_STATUS1_CLOCK( 1), 1 << 0, 1 << 8 }, + { "spdif", 2 << 1 | 0, HDSPE_STATUS1_CLOCK( 2), 1 << 1, 1 << 9 }, + { "adat", 3 << 1 | 0, HDSPE_STATUS1_CLOCK( 3), 1 << 2, 1 << 10 }, + { "tco", 9 << 1 | 0, HDSPE_STATUS1_CLOCK( 9), 1 << 26, 1 << 27 }, + { "sync_in", 10 << 1 | 0, HDSPE_STATUS1_CLOCK(10), 0, 0 }, + { NULL, 0 << 1 | 0, HDSPE_STATUS1_CLOCK( 0), 0, 0 }, +}; + static struct hdspe_channel chan_map_aio[] = { { 0, 1, "line", 1, 1 }, { 6, 7, "phone", 1, 0 }, @@ -224,6 +252,169 @@ hdspe_map_dmabuf(struct sc_info *sc) } } +static int +hdspe_sysctl_clock_preference(SYSCTL_HANDLER_ARGS) +{ + struct sc_info *sc; + struct hdspe_clock_source *clock_table, *clock; + char buf[16] = "invalid"; + int error; + uint32_t setting; + + sc = oidp->oid_arg1; + + /* Select sync ports table for device type. */ + if (sc->type == HDSPE_AIO) + clock_table = hdspe_clock_source_table_aio; + else if (sc->type == HDSPE_RAYDAT) + clock_table = hdspe_clock_source_table_rd; + else + return (ENXIO); + + /* Extract preferred clock source from settings register. */ + setting = sc->settings_register & HDSPE_SETTING_CLOCK_MASK; + for (clock = clock_table; clock->name != NULL; ++clock) { + if (clock->setting == setting) + break; + } + if (clock->name != NULL) + strlcpy(buf, clock->name, sizeof(buf)); + + /* Process sysctl string request. */ + error = sysctl_handle_string(oidp, buf, sizeof(buf), req); + if (error != 0 || req->newptr == NULL) + return (error); + + /* Find clock source matching the sysctl string. */ + for (clock = clock_table; clock->name != NULL; ++clock) { + if (strncasecmp(buf, clock->name, sizeof(buf)) == 0) + break; + } + + /* Set preferred clock source in settings register. */ + if (clock->name != NULL) { + setting = clock->setting & HDSPE_SETTING_CLOCK_MASK; + snd_mtxlock(sc->lock); + sc->settings_register &= ~HDSPE_SETTING_CLOCK_MASK; + sc->settings_register |= setting; + hdspe_write_4(sc, HDSPE_SETTINGS_REG, sc->settings_register); + snd_mtxunlock(sc->lock); + } + return (0); +} + +static int +hdspe_sysctl_clock_source(SYSCTL_HANDLER_ARGS) +{ + struct sc_info *sc; + struct hdspe_clock_source *clock_table, *clock; + char buf[16] = "invalid"; + uint32_t status; + + sc = oidp->oid_arg1; + + /* Select sync ports table for device type. */ + if (sc->type == HDSPE_AIO) + clock_table = hdspe_clock_source_table_aio; + else if (sc->type == HDSPE_RAYDAT) + clock_table = hdspe_clock_source_table_rd; + else + return (ENXIO); + + /* Read current (autosync) clock source from status register. */ + snd_mtxlock(sc->lock); + status = hdspe_read_4(sc, HDSPE_STATUS1_REG); + status &= HDSPE_STATUS1_CLOCK_MASK; + snd_mtxunlock(sc->lock); + + /* Translate status register value to clock source. */ + for (clock = clock_table; clock->name != NULL; ++clock) { + /* In clock master mode, override with internal clock source. */ + if (sc->settings_register & HDSPE_SETTING_MASTER) { + if (clock->setting & HDSPE_SETTING_MASTER) + break; + } else if (clock->status == status) + break; + } + + /* Process sysctl string request. */ + if (clock->name != NULL) + strlcpy(buf, clock->name, sizeof(buf)); + return (sysctl_handle_string(oidp, buf, sizeof(buf), req)); +} + +static int +hdspe_sysctl_clock_list(SYSCTL_HANDLER_ARGS) +{ + struct sc_info *sc; + struct hdspe_clock_source *clock_table, *clock; + char buf[256]; + int n; + + sc = oidp->oid_arg1; + n = 0; + + /* Select clock source table for device type. */ + if (sc->type == HDSPE_AIO) + clock_table = hdspe_clock_source_table_aio; + else if (sc->type == HDSPE_RAYDAT) + clock_table = hdspe_clock_source_table_rd; + else + return (ENXIO); + + /* List available clock sources. */ + buf[0] = 0; + for (clock = clock_table; clock->name != NULL; ++clock) { + if (n > 0) + n += strlcpy(buf + n, ",", sizeof(buf) - n); + n += strlcpy(buf + n, clock->name, sizeof(buf) - n); + } + return (sysctl_handle_string(oidp, buf, sizeof(buf), req)); +} + +static int +hdspe_sysctl_sync_status(SYSCTL_HANDLER_ARGS) +{ + struct sc_info *sc; + struct hdspe_clock_source *clock_table, *clock; + char buf[256]; + char *state; + int n; + uint32_t status; + + sc = oidp->oid_arg1; + n = 0; + + /* Select sync ports table for device type. */ + if (sc->type == HDSPE_AIO) + clock_table = hdspe_clock_source_table_aio; + else if (sc->type == HDSPE_RAYDAT) + clock_table = hdspe_clock_source_table_rd; + else + return (ENXIO); + + /* Read current lock and sync bits from status register. */ + snd_mtxlock(sc->lock); + status = hdspe_read_4(sc, HDSPE_STATUS1_REG); + snd_mtxunlock(sc->lock); + + /* List clock sources with lock and sync state. */ + for (clock = clock_table; clock->name != NULL; ++clock) { + if (clock->sync_bit != 0) { + if (n > 0) + n += strlcpy(buf + n, ",", sizeof(buf) - n); + state = "none"; + if ((clock->sync_bit & status) != 0) + state = "sync"; + else if ((clock->lock_bit & status) != 0) + state = "lock"; + n += snprintf(buf + n, sizeof(buf) - n, "%s(%s)", + clock->name, state); + } + } + return (sysctl_handle_string(oidp, buf, sizeof(buf), req)); +} + static int hdspe_probe(device_t dev) { @@ -250,9 +441,6 @@ hdspe_init(struct sc_info *sc) { long long period; - /* Set defaults. */ - sc->ctrl_register |= HDSPM_CLOCK_MODE_MASTER; - /* Set latency. */ sc->period = 32; sc->ctrl_register = hdspe_encode_latency(7); @@ -264,8 +452,8 @@ hdspe_init(struct sc_info *sc) hdspe_write_4(sc, HDSPE_CONTROL_REG, sc->ctrl_register); switch (sc->type) { - case RAYDAT: - case AIO: + case HDSPE_RAYDAT: + case HDSPE_AIO: period = HDSPE_FREQ_AIO; break; default: @@ -305,11 +493,11 @@ hdspe_attach(device_t dev) rev = pci_get_revid(dev); switch (rev) { case PCI_REVISION_AIO: - sc->type = AIO; + sc->type = HDSPE_AIO; chan_map = chan_map_aio; break; case PCI_REVISION_RAYDAT: - sc->type = RAYDAT; + sc->type = HDSPE_RAYDAT; chan_map = chan_map_rd; break; default: @@ -336,6 +524,30 @@ hdspe_attach(device_t dev) hdspe_map_dmabuf(sc); + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "sync_status", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, + sc, 0, hdspe_sysctl_sync_status, "A", + "List clock source signal lock and sync status"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "clock_source", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, + sc, 0, hdspe_sysctl_clock_source, "A", + "Currently effective clock source"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "clock_preference", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, + sc, 0, hdspe_sysctl_clock_preference, "A", + "Set 'internal' (master) or preferred autosync clock source"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "clock_list", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, + sc, 0, hdspe_sysctl_clock_list, "A", + "List of supported clock sources"); + return (bus_generic_attach(dev)); } diff --git a/sys/dev/sound/pci/hdspe.h b/sys/dev/sound/pci/hdspe.h index 7056a75a66c1..58362641cb01 100644 --- a/sys/dev/sound/pci/hdspe.h +++ b/sys/dev/sound/pci/hdspe.h @@ -32,8 +32,8 @@ #define PCI_REVISION_AIO 212 #define PCI_REVISION_RAYDAT 211 -#define AIO 0 -#define RAYDAT 1 +#define HDSPE_AIO 0 +#define HDSPE_RAYDAT 1 /* Hardware mixer */ #define HDSPE_OUT_ENABLE_BASE 512 @@ -95,15 +95,13 @@ #define HDSP_PhoneGainMinus6dB (HDSP_PhoneGain0) #define HDSP_PhoneGainMinus12dB 0 -#define HDSPM_statusRegister 0 -#define HDSPM_statusRegister2 192 - /* Settings */ #define HDSPE_SETTINGS_REG 0 #define HDSPE_CONTROL_REG 64 #define HDSPE_STATUS_REG 0 +#define HDSPE_STATUS1_REG 64 +#define HDSPE_STATUS2_REG 192 #define HDSPE_ENABLE (1 << 0) -#define HDSPM_CLOCK_MODE_MASTER (1 << 4) /* Interrupts */ #define HDSPE_AUDIO_IRQ_PENDING (1 << 0) @@ -126,6 +124,23 @@ struct hdspe_channel { uint32_t rec; }; +/* Clock sources */ +#define HDSPE_SETTING_MASTER (1 << 0) +#define HDSPE_SETTING_CLOCK_MASK 0x1f + +#define HDSPE_STATUS1_CLOCK_SHIFT 28 +#define HDSPE_STATUS1_CLOCK_MASK (0x0f << HDSPE_STATUS1_CLOCK_SHIFT) +#define HDSPE_STATUS1_CLOCK(n) (((n) << HDSPE_STATUS1_CLOCK_SHIFT) & \ + HDSPE_STATUS1_CLOCK_MASK) + +struct hdspe_clock_source { + char *name; + uint32_t setting; + uint32_t status; + uint32_t lock_bit; + uint32_t sync_bit; +}; + static MALLOC_DEFINE(M_HDSPE, "hdspe", "hdspe audio"); /* Channel registers */ From nobody Tue Jan 30 11:08:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPMpv4MHnz58dZy; Tue, 30 Jan 2024 11:08: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 4TPMpv2V3tz4HTy; Tue, 30 Jan 2024 11:08:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706612903; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h0cAub2kLmfRj+OxOODQCqGdxvD3MuvNmBOBIb/XlPQ=; b=bDrOOPxc+F/rmxhx/WdLh10m37F5oNBySu060SXtO3HbbHiGTMtGr26W4NOBl3pettQ0AQ 3PLcWzXeXuCI81qAihpLtLLR7QlAp8pyPaW3+RdPrlcZDN3VAX/q1U2PJ5+Gd5GKK5Bvsf La1qq5H5fPhs2aIAgTyy7cpNCU2tKrt2XLfbef/gly8DpX/cgX3yDcea2T+ttKgxgoubQ0 dH+6LYtwauHTFBJMC7mD6DopSBdC09EeutGpkuC4j/gCX6p2Xs7opPR9AV9nE3SpH7ob9a ErzLoww4u0RZSjDZjK21TcypPETpvS7/axYfS/5rRXKRPIuEUIOLNXI0mzFDZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706612903; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h0cAub2kLmfRj+OxOODQCqGdxvD3MuvNmBOBIb/XlPQ=; b=vAtW63qLiyXflbbmCcyEB9t328zxEjN3RUFySrmvztwwo0RcrEWNzNVL24wCd6YpgFi4L2 7Xh5Rfbw9rs2qZJclxDH/PwWL+VZ/IkO6GhJPq8zGu67Im320oJ0I85CrHOLnyyWJb1Xhp NpvyQp99qNF55ZHMWauc65dHYBkP7a2DF0msqGqXvJQ9qCdgafY2SUaDXc0FZYVpSuPWQQ xPU4nr232V+xSPLEeQHifcZ7nJefiDjeMekTGiMzvE0vWZB/HwP+x6FLknrES5qYJXGhIU +yDochMJqu4ncpb7/5Cv0LeO+qctRTB9PbtUnx6X3EJrwjd1AIvLUZ5N+dibUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706612903; a=rsa-sha256; cv=none; b=TU1OGGJ7eSiPeTEWjFUoW33HUxmncipSnG5UEM5C2D6JMEosA2UVXIcP1ZcJWZSZldrypj DPk1vorb7QcBmNSfdLr1P8dlD3V1je6GHxHnHNzlMFsqmByoI72XS0iR3YIj2Pvl1GppYe j8Tt/53G+EV3NEia3Y9ItcOe033FMDs2IjZSZgKZ7Hczta8gCTXb7OCclHadukBBsrzhep LT4y+5XgvJH4VmbcYQb0Lddyj29XcXtVXRWI2O5jL0tA4evki2JjqVuk1XXEeNcSe+TQrK +mD7vGCrLmW9Os51oG44kSVGDgcc7xEc+cm/Z2zxLORtbtr4ZGOg+27gFHA25g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPMpv1ZT2zYT2; Tue, 30 Jan 2024 11:08: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 40UB8NVE075772; Tue, 30 Jan 2024 11:08:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UB8N8O075769; Tue, 30 Jan 2024 11:08:23 GMT (envelope-from git) Date: Tue, 30 Jan 2024 11:08:23 GMT Message-Id: <202401301108.40UB8N8O075769@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: 8e471fbc7dc4 - stable/14 - snd_hdspe(4): One pcm device per physical ADAT port. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 8e471fbc7dc4ee0a6c6cc696b28858401ebc8d63 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=8e471fbc7dc4ee0a6c6cc696b28858401ebc8d63 commit 8e471fbc7dc4ee0a6c6cc696b28858401ebc8d63 Author: Florian Walpen AuthorDate: 2024-01-15 10:21:57 +0000 Commit: Christos Margiolis CommitDate: 2024-01-30 11:07:28 +0000 snd_hdspe(4): One pcm device per physical ADAT port. ADAT connections transport 8, 4 or 2 audio channels depending on the sample rate. Instead of splitting each physical ADAT port into 4 (potentially unmapped) stereo pcm devices, create just one pcm device of variable channel width for every ADAT port. Depending on the sample rate and channel width selected, the pcm channels may be only partially mapped to ADAT channels and vice versa. Added flexibility of the new channel mapping is also prerequisite to introduce more pcm device layouts in follow-up commits. Reviewed by: br Differential Revision: https://reviews.freebsd.org/D43393 (cherry picked from commit d7fde2c9eccf90b2a889e92800f3bc07376e84f6) --- share/man/man4/snd_hdspe.4 | 11 +- sys/dev/sound/pci/hdspe-pcm.c | 462 +++++++++++++++++++++++++++++++++++------- sys/dev/sound/pci/hdspe.c | 52 ++--- sys/dev/sound/pci/hdspe.h | 36 +++- 4 files changed, 443 insertions(+), 118 deletions(-) diff --git a/share/man/man4/snd_hdspe.4 b/share/man/man4/snd_hdspe.4 index 4b925b14aef6..6023cd3d2ccd 100644 --- a/share/man/man4/snd_hdspe.4 +++ b/share/man/man4/snd_hdspe.4 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 30, 2023 +.Dd January 8, 2024 .Dt SND_HDSPE 4 .Os .Sh NAME @@ -59,6 +59,13 @@ RME HDSPe AIO .It RME HDSPe RayDAT .El +.Pp +By default, each +.Xr pcm 4 +device corresponds to a physical port on the sound card. +For ADAT ports, 8 channel, 4 channel and 2 channel formats are supported. +Depending on sample rate and channel format selected, not all pcm channels can +be mapped to ADAT channels and vice versa. .Sh SYSCTL TUNABLES These settings and informational values can be accessed at runtime with the .Xr sysctl 8 @@ -111,3 +118,5 @@ The .Nm driver was written by .An Ruslan Bukin . +.An Florian Walpen +contributed clock source settings and restructured the pcm device mapping. diff --git a/sys/dev/sound/pci/hdspe-pcm.c b/sys/dev/sound/pci/hdspe-pcm.c index b3daed4d9599..d9d40c9877ad 100644 --- a/sys/dev/sound/pci/hdspe-pcm.c +++ b/sys/dev/sound/pci/hdspe-pcm.c @@ -2,6 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2012-2021 Ruslan Bukin + * Copyright (c) 2023-2024 Florian Walpen * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -78,6 +79,152 @@ static struct hdspe_rate rate_map[] = { { 0, 0 }, }; +static uint32_t +hdspe_channel_play_ports(struct hdspe_channel *hc) +{ + return (hc->ports & (HDSPE_CHAN_AIO_ALL | HDSPE_CHAN_RAY_ALL)); +} + +static uint32_t +hdspe_channel_rec_ports(struct hdspe_channel *hc) +{ + return (hc->ports & (HDSPE_CHAN_AIO_ALL_REC | HDSPE_CHAN_RAY_ALL)); +} + +static unsigned int +hdspe_adat_width(uint32_t speed) +{ + if (speed > 96000) + return (2); + if (speed > 48000) + return (4); + return (8); +} + +static uint32_t +hdspe_port_first(uint32_t ports) +{ + return (ports & (~(ports - 1))); /* Extract first bit set. */ +} + +static uint32_t +hdspe_port_first_row(uint32_t ports) +{ + uint32_t ends; + + /* Restrict ports to one set with contiguous slots. */ + if (ports & HDSPE_CHAN_AIO_LINE) + ports = HDSPE_CHAN_AIO_LINE; /* Gap in the AIO slots here. */ + else if (ports & HDSPE_CHAN_AIO_ALL) + ports &= HDSPE_CHAN_AIO_ALL; /* Rest of the AIO slots. */ + else if (ports & HDSPE_CHAN_RAY_ALL) + ports &= HDSPE_CHAN_RAY_ALL; /* All RayDAT slots. */ + + /* Ends of port rows are followed by a port which is not in the set. */ + ends = ports & (~(ports >> 1)); + /* First row of contiguous ports ends in the first row end. */ + return (ports & (ends ^ (ends - 1))); +} + +static unsigned int +hdspe_channel_count(uint32_t ports, uint32_t adat_width) +{ + unsigned int count = 0; + + if (ports & HDSPE_CHAN_AIO_ALL) { + /* AIO ports. */ + if (ports & HDSPE_CHAN_AIO_LINE) + count += 2; + if (ports & HDSPE_CHAN_AIO_PHONE) + count += 2; + if (ports & HDSPE_CHAN_AIO_AES) + count += 2; + if (ports & HDSPE_CHAN_AIO_SPDIF) + count += 2; + if (ports & HDSPE_CHAN_AIO_ADAT) + count += adat_width; + } else if (ports & HDSPE_CHAN_RAY_ALL) { + /* RayDAT ports. */ + if (ports & HDSPE_CHAN_RAY_AES) + count += 2; + if (ports & HDSPE_CHAN_RAY_SPDIF) + count += 2; + if (ports & HDSPE_CHAN_RAY_ADAT1) + count += adat_width; + if (ports & HDSPE_CHAN_RAY_ADAT2) + count += adat_width; + if (ports & HDSPE_CHAN_RAY_ADAT3) + count += adat_width; + if (ports & HDSPE_CHAN_RAY_ADAT4) + count += adat_width; + } + + return (count); +} + +static unsigned int +hdspe_channel_offset(uint32_t subset, uint32_t ports, unsigned int adat_width) +{ + uint32_t preceding; + + /* Make sure we have a subset of ports. */ + subset &= ports; + /* Include all ports preceding the first one of the subset. */ + preceding = ports & (~subset & (subset - 1)); + + if (preceding & HDSPE_CHAN_AIO_ALL) + preceding &= HDSPE_CHAN_AIO_ALL; /* Contiguous AIO slots. */ + else if (preceding & HDSPE_CHAN_RAY_ALL) + preceding &= HDSPE_CHAN_RAY_ALL; /* Contiguous RayDAT slots. */ + + return (hdspe_channel_count(preceding, adat_width)); +} + +static unsigned int +hdspe_port_slot_offset(uint32_t port, unsigned int adat_width) +{ + /* Exctract the first port (lowest bit) if set of ports. */ + switch (hdspe_port_first(port)) { + /* AIO ports */ + case HDSPE_CHAN_AIO_LINE: + return (0); + case HDSPE_CHAN_AIO_PHONE: + return (6); + case HDSPE_CHAN_AIO_AES: + return (8); + case HDSPE_CHAN_AIO_SPDIF: + return (10); + case HDSPE_CHAN_AIO_ADAT: + return (12); + + /* RayDAT ports */ + case HDSPE_CHAN_RAY_AES: + return (0); + case HDSPE_CHAN_RAY_SPDIF: + return (2); + case HDSPE_CHAN_RAY_ADAT1: + return (4); + case HDSPE_CHAN_RAY_ADAT2: + return (4 + adat_width); + case HDSPE_CHAN_RAY_ADAT3: + return (4 + 2 * adat_width); + case HDSPE_CHAN_RAY_ADAT4: + return (4 + 3 * adat_width); + default: + return (0); + } +} + +static unsigned int +hdspe_port_slot_width(uint32_t ports, unsigned int adat_width) +{ + uint32_t row; + + /* Count number of contiguous slots from the first physical port. */ + row = hdspe_port_first_row(ports); + return (hdspe_channel_count(row, adat_width)); +} + static int hdspe_hw_mixer(struct sc_chinfo *ch, unsigned int dst, unsigned int src, unsigned short data) @@ -103,11 +250,34 @@ hdspe_hw_mixer(struct sc_chinfo *ch, unsigned int dst, static int hdspechan_setgain(struct sc_chinfo *ch) { + struct sc_info *sc; + uint32_t port, ports; + unsigned int slot, end_slot; + unsigned short volume; + + sc = ch->parent->sc; + + /* Iterate through all physical ports of the channel. */ + ports = ch->ports; + port = hdspe_port_first(ports); + while (port != 0) { + /* Get slot range of the physical port. */ + slot = + hdspe_port_slot_offset(port, hdspe_adat_width(sc->speed)); + end_slot = slot + + hdspe_port_slot_width(port, hdspe_adat_width(sc->speed)); + + /* Treat first slot as left channel. */ + volume = ch->lvol * HDSPE_MAX_GAIN / 100; + for (; slot < end_slot; slot++) { + hdspe_hw_mixer(ch, slot, slot, volume); + /* Subsequent slots all get the right channel volume. */ + volume = ch->rvol * HDSPE_MAX_GAIN / 100; + } - hdspe_hw_mixer(ch, ch->lslot, ch->lslot, - ch->lvol * HDSPE_MAX_GAIN / 100); - hdspe_hw_mixer(ch, ch->rslot, ch->rslot, - ch->rvol * HDSPE_MAX_GAIN / 100); + ports &= ~port; + port = hdspe_port_first(ports); + } return (0); } @@ -126,10 +296,10 @@ hdspemixer_init(struct snd_mixer *m) mask = SOUND_MASK_PCM; - if (scp->hc->play) + if (hdspe_channel_play_ports(scp->hc)) mask |= SOUND_MASK_VOLUME; - if (scp->hc->rec) + if (hdspe_channel_rec_ports(scp->hc)) mask |= SOUND_MASK_RECLEV; snd_mtxlock(sc->lock); @@ -181,7 +351,9 @@ hdspechan_enable(struct sc_chinfo *ch, int value) { struct sc_pcminfo *scp; struct sc_info *sc; + uint32_t row, ports; int reg; + unsigned int slot, end_slot; scp = ch->parent; sc = scp->sc; @@ -193,9 +365,22 @@ hdspechan_enable(struct sc_chinfo *ch, int value) ch->run = value; - hdspe_write_1(sc, reg + (4 * ch->lslot), value); - if (AFMT_CHANNEL(ch->format) == 2) - hdspe_write_1(sc, reg + (4 * ch->rslot), value); + /* Iterate through rows of ports with contiguous slots. */ + ports = ch->ports; + row = hdspe_port_first_row(ports); + while (row != 0) { + slot = + hdspe_port_slot_offset(row, hdspe_adat_width(sc->speed)); + end_slot = slot + + hdspe_port_slot_width(row, hdspe_adat_width(sc->speed)); + + for (; slot < end_slot; slot++) { + hdspe_write_1(sc, reg + (4 * slot), value); + } + + ports &= ~row; + row = hdspe_port_first_row(ports); + } } static int @@ -253,56 +438,152 @@ hdspe_stop_audio(struct sc_info *sc) hdspe_write_4(sc, HDSPE_CONTROL_REG, sc->ctrl_register); } -/* Multiplex / demultiplex: 2.0 <-> 2 x 1.0. */ +static void +buffer_mux_write(uint32_t *dma, uint32_t *pcm, unsigned int pos, + unsigned int samples, unsigned int slots, unsigned int channels) +{ + int slot; + + for (; samples > 0; samples--) { + for (slot = 0; slot < slots; slot++) { + dma[slot * HDSPE_CHANBUF_SAMPLES + pos] = + pcm[pos * channels + slot]; + } + pos = (pos + 1) % HDSPE_CHANBUF_SAMPLES; + } +} + +static void +buffer_mux_port(uint32_t *dma, uint32_t *pcm, uint32_t subset, uint32_t ports, + unsigned int pos, unsigned int samples, unsigned int adat_width, + unsigned int pcm_width) +{ + unsigned int slot_offset, slots; + unsigned int channels, chan_pos; + + /* Translate DMA slot offset to DMA buffer offset. */ + slot_offset = hdspe_port_slot_offset(subset, adat_width); + dma += slot_offset * HDSPE_CHANBUF_SAMPLES; + + /* Channel position of the port subset and total number of channels. */ + chan_pos = hdspe_channel_offset(subset, ports, pcm_width); + pcm += chan_pos; + channels = hdspe_channel_count(ports, pcm_width); + + /* Only copy as much as supported by both hardware and pcm channel. */ + slots = hdspe_port_slot_width(subset, MIN(adat_width, pcm_width)); + + /* Let the compiler inline and loop unroll common cases. */ + if (slots == 2) + buffer_mux_write(dma, pcm, pos, samples, 2, channels); + else if (slots == 4) + buffer_mux_write(dma, pcm, pos, samples, 4, channels); + else if (slots == 8) + buffer_mux_write(dma, pcm, pos, samples, 8, channels); + else + buffer_mux_write(dma, pcm, pos, samples, slots, channels); +} + +static void +buffer_demux_read(uint32_t *dma, uint32_t *pcm, unsigned int pos, + unsigned int samples, unsigned int slots, unsigned int channels) +{ + int slot; + + for (; samples > 0; samples--) { + for (slot = 0; slot < slots; slot++) { + pcm[pos * channels + slot] = + dma[slot * HDSPE_CHANBUF_SAMPLES + pos]; + } + pos = (pos + 1) % HDSPE_CHANBUF_SAMPLES; + } +} + +static void +buffer_demux_port(uint32_t *dma, uint32_t *pcm, uint32_t subset, uint32_t ports, + unsigned int pos, unsigned int samples, unsigned int adat_width, + unsigned int pcm_width) +{ + unsigned int slot_offset, slots; + unsigned int channels, chan_pos; + + /* Translate port slot offset to DMA buffer offset. */ + slot_offset = hdspe_port_slot_offset(subset, adat_width); + dma += slot_offset * HDSPE_CHANBUF_SAMPLES; + + /* Channel position of the port subset and total number of channels. */ + chan_pos = hdspe_channel_offset(subset, ports, pcm_width); + pcm += chan_pos; + channels = hdspe_channel_count(ports, pcm_width); + + /* Only copy as much as supported by both hardware and pcm channel. */ + slots = hdspe_port_slot_width(subset, MIN(adat_width, pcm_width)); + + /* Let the compiler inline and loop unroll common cases. */ + if (slots == 2) + buffer_demux_read(dma, pcm, pos, samples, 2, channels); + else if (slots == 4) + buffer_demux_read(dma, pcm, pos, samples, 4, channels); + else if (slots == 8) + buffer_demux_read(dma, pcm, pos, samples, 8, channels); + else + buffer_demux_read(dma, pcm, pos, samples, slots, channels); +} + + +/* Copy data between DMA and PCM buffers. */ static void buffer_copy(struct sc_chinfo *ch) { struct sc_pcminfo *scp; struct sc_info *sc; - int ssize, dsize; - int src, dst; - int n; - int i; + uint32_t row, ports; + unsigned int pos; + unsigned int n; + unsigned int adat_width, pcm_width; scp = ch->parent; sc = scp->sc; n = AFMT_CHANNEL(ch->format); /* n channels */ - if (ch->dir == PCMDIR_PLAY) { - src = sndbuf_getreadyptr(ch->buffer); - } else { - src = sndbuf_getfreeptr(ch->buffer); - } - - src /= 4; /* Bytes per sample. */ - dst = src / n; /* Destination buffer n-times smaller. */ - - ssize = ch->size / 4; - dsize = ch->size / (4 * n); + /* Let pcm formats differ from current hardware ADAT width. */ + adat_width = hdspe_adat_width(sc->speed); + if (n == hdspe_channel_count(ch->ports, 2)) + pcm_width = 2; + else if (n == hdspe_channel_count(ch->ports, 4)) + pcm_width = 4; + else + pcm_width = 8; - /* - * Use two fragment buffer to avoid sound clipping. - */ + if (ch->dir == PCMDIR_PLAY) + pos = sndbuf_getreadyptr(ch->buffer); + else + pos = sndbuf_getfreeptr(ch->buffer); - for (i = 0; i < sc->period * 2 /* fragments */; i++) { - if (ch->dir == PCMDIR_PLAY) { - sc->pbuf[dst + HDSPE_CHANBUF_SAMPLES * ch->lslot] = - ch->data[src]; - sc->pbuf[dst + HDSPE_CHANBUF_SAMPLES * ch->rslot] = - ch->data[src + 1]; - - } else { - ch->data[src] = - sc->rbuf[dst + HDSPE_CHANBUF_SAMPLES * ch->lslot]; - ch->data[src+1] = - sc->rbuf[dst + HDSPE_CHANBUF_SAMPLES * ch->rslot]; - } + pos /= 4; /* Bytes per sample. */ + pos /= n; /* Destination buffer n-times smaller. */ - dst+=1; - dst %= dsize; - src += n; - src %= ssize; + /* Iterate through rows of ports with contiguous slots. */ + ports = ch->ports; + if (pcm_width == adat_width) + row = hdspe_port_first_row(ports); + else + row = hdspe_port_first(ports); + + while (row != 0) { + if (ch->dir == PCMDIR_PLAY) + buffer_mux_port(sc->pbuf, ch->data, row, ch->ports, pos, + sc->period * 2, adat_width, pcm_width); + else + buffer_demux_port(sc->rbuf, ch->data, row, ch->ports, + pos, sc->period * 2, adat_width, pcm_width); + + ports &= ~row; + if (pcm_width == adat_width) + row = hdspe_port_first_row(ports); + else + row = hdspe_port_first(ports); } } @@ -312,17 +593,30 @@ clean(struct sc_chinfo *ch) struct sc_pcminfo *scp; struct sc_info *sc; uint32_t *buf; + uint32_t row, ports; + unsigned int offset, slots; scp = ch->parent; sc = scp->sc; buf = sc->rbuf; - if (ch->dir == PCMDIR_PLAY) { + if (ch->dir == PCMDIR_PLAY) buf = sc->pbuf; - } - bzero(buf + HDSPE_CHANBUF_SAMPLES * ch->lslot, HDSPE_CHANBUF_SIZE); - bzero(buf + HDSPE_CHANBUF_SAMPLES * ch->rslot, HDSPE_CHANBUF_SIZE); + /* Iterate through rows of ports with contiguous slots. */ + ports = ch->ports; + row = hdspe_port_first_row(ports); + while (row != 0) { + offset = hdspe_port_slot_offset(row, + hdspe_adat_width(sc->speed)); + slots = hdspe_port_slot_width(row, hdspe_adat_width(sc->speed)); + + bzero(buf + offset * HDSPE_CHANBUF_SAMPLES, + slots * HDSPE_CHANBUF_SIZE); + + ports &= ~row; + row = hdspe_port_first_row(ports); + } return (0); } @@ -344,13 +638,29 @@ hdspechan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, num = scp->chnum; ch = &scp->chan[num]; - ch->lslot = scp->hc->left; - ch->rslot = scp->hc->right; + + if (dir == PCMDIR_PLAY) + ch->ports = hdspe_channel_play_ports(scp->hc); + else + ch->ports = hdspe_channel_rec_ports(scp->hc); + ch->run = 0; ch->lvol = 0; ch->rvol = 0; - ch->size = HDSPE_CHANBUF_SIZE * 2; /* max size */ + /* Support all possible ADAT widths as channel formats. */ + ch->cap_fmts[0] = + SND_FORMAT(AFMT_S32_LE, hdspe_channel_count(ch->ports, 2), 0); + ch->cap_fmts[1] = + SND_FORMAT(AFMT_S32_LE, hdspe_channel_count(ch->ports, 4), 0); + ch->cap_fmts[2] = + SND_FORMAT(AFMT_S32_LE, hdspe_channel_count(ch->ports, 8), 0); + ch->cap_fmts[3] = 0; + ch->caps = malloc(sizeof(struct pcmchan_caps), M_HDSPE, M_NOWAIT); + *(ch->caps) = (struct pcmchan_caps) {32000, 192000, ch->cap_fmts, 0}; + + /* Allocate maximum buffer size. */ + ch->size = HDSPE_CHANBUF_SIZE * hdspe_channel_count(ch->ports, 8); ch->data = malloc(ch->size, M_HDSPE, M_NOWAIT); ch->buffer = b; @@ -430,8 +740,7 @@ hdspechan_getptr(kobj_t obj, void *data) snd_mtxunlock(sc->lock); pos = ret & HDSPE_BUF_POSITION_MASK; - if (AFMT_CHANNEL(ch->format) == 2) - pos *= 2; /* Hardbuf twice bigger. */ + pos *= AFMT_CHANNEL(ch->format); /* Hardbuf with multiple channels. */ return (pos); } @@ -456,6 +765,10 @@ hdspechan_free(kobj_t obj, void *data) free(ch->data, M_HDSPE); ch->data = NULL; } + if (ch->caps != NULL) { + free(ch->caps, M_HDSPE); + ch->caps = NULL; + } snd_mtxunlock(sc->lock); return (0); @@ -580,9 +893,8 @@ hdspechan_setblocksize(kobj_t obj, void *data, uint32_t blocksize) /* First look for equal latency. */ for (i = 0; latency_map[i].period != 0; i++) { - if (latency_map[i].period == blocksize) { + if (latency_map[i].period == blocksize) hl = &latency_map[i]; - } } /* If no match, just find nearest. */ @@ -615,20 +927,12 @@ end: return (sndbuf_getblksz(ch->buffer)); } -static uint32_t hdspe_rfmt[] = { - SND_FORMAT(AFMT_S32_LE, 2, 0), - 0 -}; - -static struct pcmchan_caps hdspe_rcaps = {32000, 192000, hdspe_rfmt, 0}; - -static uint32_t hdspe_pfmt[] = { - SND_FORMAT(AFMT_S32_LE, 1, 0), +static uint32_t hdspe_bkp_fmt[] = { SND_FORMAT(AFMT_S32_LE, 2, 0), 0 }; -static struct pcmchan_caps hdspe_pcaps = {32000, 192000, hdspe_pfmt, 0}; +static struct pcmchan_caps hdspe_bkp_caps = {32000, 192000, hdspe_bkp_fmt, 0}; static struct pcmchan_caps * hdspechan_getcaps(kobj_t obj, void *data) @@ -642,8 +946,10 @@ hdspechan_getcaps(kobj_t obj, void *data) device_printf(scp->dev, "hdspechan_getcaps()\n"); #endif - return ((ch->dir == PCMDIR_PLAY) ? - &hdspe_pcaps : &hdspe_rcaps); + if (ch->caps != NULL) + return (ch->caps); + + return (&hdspe_bkp_caps); } static kobj_method_t hdspechan_methods[] = { @@ -695,13 +1001,21 @@ hdspe_pcm_attach(device_t dev) char status[SND_STATUSLEN]; struct sc_pcminfo *scp; char desc[64]; - int i, err; + int err; + int play, rec; scp = device_get_ivars(dev); scp->ih = &hdspe_pcm_intr; bzero(desc, sizeof(desc)); - snprintf(desc, sizeof(desc), "HDSPe AIO [%s]", scp->hc->descr); + if (scp->hc->ports & HDSPE_CHAN_AIO_ALL) + snprintf(desc, sizeof(desc), "HDSPe AIO [%s]", + scp->hc->descr); + else if (scp->hc->ports & HDSPE_CHAN_RAY_ALL) + snprintf(desc, sizeof(desc), "HDSPe RayDAT [%s]", + scp->hc->descr); + else + snprintf(desc, sizeof(desc), "HDSPe ? [%s]", scp->hc->descr); device_set_desc_copy(dev, desc); /* @@ -710,19 +1024,21 @@ hdspe_pcm_attach(device_t dev) */ pcm_setflags(dev, pcm_getflags(dev) | SD_F_MPSAFE); - err = pcm_register(dev, scp, scp->hc->play, scp->hc->rec); + play = (hdspe_channel_play_ports(scp->hc)) ? 1 : 0; + rec = (hdspe_channel_rec_ports(scp->hc)) ? 1 : 0; + err = pcm_register(dev, scp, play, rec); if (err) { device_printf(dev, "Can't register pcm.\n"); return (ENXIO); } scp->chnum = 0; - for (i = 0; i < scp->hc->play; i++) { + if (play) { pcm_addchan(dev, PCMDIR_PLAY, &hdspechan_class, scp); scp->chnum++; } - for (i = 0; i < scp->hc->rec; i++) { + if (rec) { pcm_addchan(dev, PCMDIR_REC, &hdspechan_class, scp); scp->chnum++; } diff --git a/sys/dev/sound/pci/hdspe.c b/sys/dev/sound/pci/hdspe.c index 8a7cac87fc1a..e0197d1e981a 100644 --- a/sys/dev/sound/pci/hdspe.c +++ b/sys/dev/sound/pci/hdspe.c @@ -2,6 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2012-2016 Ruslan Bukin + * Copyright (c) 2023-2024 Florian Walpen * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -69,47 +70,22 @@ static struct hdspe_clock_source hdspe_clock_source_table_aio[] = { }; static struct hdspe_channel chan_map_aio[] = { - { 0, 1, "line", 1, 1 }, - { 6, 7, "phone", 1, 0 }, - { 8, 9, "aes", 1, 1 }, - { 10, 11, "s/pdif", 1, 1 }, - { 12, 16, "adat", 1, 1 }, - - /* Single or double speed. */ - { 14, 18, "adat", 1, 1 }, - - /* Single speed only. */ - { 13, 15, "adat", 1, 1 }, - { 17, 19, "adat", 1, 1 }, - - { 0, 0, NULL, 0, 0 }, + { HDSPE_CHAN_AIO_LINE, "line" }, + { HDSPE_CHAN_AIO_PHONE, "phone" }, + { HDSPE_CHAN_AIO_AES, "aes" }, + { HDSPE_CHAN_AIO_SPDIF, "s/pdif" }, + { HDSPE_CHAN_AIO_ADAT, "adat" }, + { 0, NULL }, }; static struct hdspe_channel chan_map_rd[] = { - { 0, 1, "aes", 1, 1 }, - { 2, 3, "s/pdif", 1, 1 }, - { 4, 5, "adat", 1, 1 }, - { 6, 7, "adat", 1, 1 }, - { 8, 9, "adat", 1, 1 }, - { 10, 11, "adat", 1, 1 }, - - /* Single or double speed. */ - { 12, 13, "adat", 1, 1 }, - { 14, 15, "adat", 1, 1 }, - { 16, 17, "adat", 1, 1 }, - { 18, 19, "adat", 1, 1 }, - - /* Single speed only. */ - { 20, 21, "adat", 1, 1 }, - { 22, 23, "adat", 1, 1 }, - { 24, 25, "adat", 1, 1 }, - { 26, 27, "adat", 1, 1 }, - { 28, 29, "adat", 1, 1 }, - { 30, 31, "adat", 1, 1 }, - { 32, 33, "adat", 1, 1 }, - { 34, 35, "adat", 1, 1 }, - - { 0, 0, NULL, 0, 0 }, + { HDSPE_CHAN_RAY_AES, "aes" }, + { HDSPE_CHAN_RAY_SPDIF, "s/pdif" }, + { HDSPE_CHAN_RAY_ADAT1, "adat1" }, + { HDSPE_CHAN_RAY_ADAT2, "adat2" }, + { HDSPE_CHAN_RAY_ADAT3, "adat3" }, + { HDSPE_CHAN_RAY_ADAT4, "adat4" }, + { 0, NULL }, }; static void diff --git a/sys/dev/sound/pci/hdspe.h b/sys/dev/sound/pci/hdspe.h index 58362641cb01..d5d8dd46e580 100644 --- a/sys/dev/sound/pci/hdspe.h +++ b/sys/dev/sound/pci/hdspe.h @@ -2,6 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2012-2016 Ruslan Bukin + * Copyright (c) 2023-2024 Florian Walpen * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -116,12 +117,34 @@ #define HDSPE_CHANBUF_SIZE (4 * HDSPE_CHANBUF_SAMPLES) #define HDSPE_DMASEGSIZE (HDSPE_CHANBUF_SIZE * HDSPE_MAX_SLOTS) +#define HDSPE_CHAN_AIO_LINE (1 << 0) +#define HDSPE_CHAN_AIO_PHONE (1 << 1) +#define HDSPE_CHAN_AIO_AES (1 << 2) +#define HDSPE_CHAN_AIO_SPDIF (1 << 3) +#define HDSPE_CHAN_AIO_ADAT (1 << 4) +#define HDSPE_CHAN_AIO_ALL_REC (HDSPE_CHAN_AIO_LINE | \ + HDSPE_CHAN_AIO_AES | \ + HDSPE_CHAN_AIO_SPDIF | \ + HDSPE_CHAN_AIO_ADAT) +#define HDSPE_CHAN_AIO_ALL (HDSPE_CHAN_AIO_ALL_REC | \ + HDSPE_CHAN_AIO_PHONE) \ + +#define HDSPE_CHAN_RAY_AES (1 << 5) +#define HDSPE_CHAN_RAY_SPDIF (1 << 6) +#define HDSPE_CHAN_RAY_ADAT1 (1 << 7) +#define HDSPE_CHAN_RAY_ADAT2 (1 << 8) +#define HDSPE_CHAN_RAY_ADAT3 (1 << 9) +#define HDSPE_CHAN_RAY_ADAT4 (1 << 10) +#define HDSPE_CHAN_RAY_ALL (HDSPE_CHAN_RAY_AES | \ + HDSPE_CHAN_RAY_SPDIF | \ + HDSPE_CHAN_RAY_ADAT1 | \ + HDSPE_CHAN_RAY_ADAT2 | \ + HDSPE_CHAN_RAY_ADAT3 | \ + HDSPE_CHAN_RAY_ADAT4) + struct hdspe_channel { - uint32_t left; - uint32_t right; + uint32_t ports; char *descr; - uint32_t play; - uint32_t rec; }; /* Clock sources */ @@ -150,10 +173,11 @@ struct sc_chinfo { struct sc_pcminfo *parent; /* Channel information */ + struct pcmchan_caps *caps; + uint32_t cap_fmts[4]; uint32_t dir; uint32_t format; - uint32_t lslot; - uint32_t rslot; + uint32_t ports; uint32_t lvol; uint32_t rvol; From nobody Tue Jan 30 11:08:24 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPMpw6BR1z58dMq; Tue, 30 Jan 2024 11:08: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 4TPMpw4zPsz4HPH; Tue, 30 Jan 2024 11:08:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706612904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R7jS4eHby9roV1cAgWR51H1o5Va3vcdQR/pqGGquQ7k=; b=Ld5boljIX73+b+O5k5s35n2VyJ8xmg9PHstyOVMQJI9im+M5ZCVLqC00LyXKEd5EtrXFnc Ot3gyAfApR7FuFmw8lPK/gIiiZrroo1IZ3mV/kNvxpW+d2O00+naugCZzCj7fOEUGSPsqG idPP7s4fdP7oUuX1rqwMFktgMBEF+PUe5Z57pCPmda6qwznI3//RPxbux1OENMyHM9PgcC DfHC27CeaVrw2HA8wLEXo04TtI65Yylu4m2NqrQ7Hg8/RfdUievWLv7o4gdBSlNiCZRR51 cVcFewjUbPr8Ijrbf1yAvu3U0rw1ZC6V3DopQBKVJ2lgD41TahXdIQZoakpNMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706612904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R7jS4eHby9roV1cAgWR51H1o5Va3vcdQR/pqGGquQ7k=; b=xKlYTnbRJ/krUqUEtXqQNg7PB0vIf3bc8Hg1TqO2gbreeEYiBf+1AfnhE2QpyKNSGua+YW cq3cgyEHya1wMi9QMn3jJzCmCwrhttX68Z7L5FMRIzba/Z1szoPKQEyA8CwVRKbYWFf7j1 GrmbvrMt58UGS5UPY9yj1EHgkbI/czARwM0LiNtyW8nTwZtQ6k64nLJtKvGYPIie1ucyLR zP9pZM9nuseSlIcC7lj/um2jO4OcegRjWgxj+b5l/qsKLZVfUh6Zke0xxoyAgIVNhY6Yog FeX3AzF8SjAYkxalRunlsGU+odEqEusRQRDuN1DjJt0FeWSbV1uopGlovKpbXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706612904; a=rsa-sha256; cv=none; b=a6s+Wwn6KD5/Mzk08RNWp73vVhPOkMkigzbUCefAtVU0qxXNZByjn4AKoyvUAfVTOEAaGh OQomomxWKLgN3eqeYr0gfbbPfDIkJK7B69iFgg8PjBc3V5rS6zQUd/RTCCdagEeAjbMQsP JvNsIYvO1gakHZNvAGJ+c6CxJhn4a/QII868dNf92F7PkaebX4zZ/6wsXDplt4irUmwb+l UWd3FeTZlBzxWIFxNDVIBHo1ZZWBFECVIAcZJE0Ddxc6hSbZ2ErFFbjzql+fob+yh1IffG Tp8uP8As25w+JUY5C+zUC6SyAfLYy7ajz083lFw2CQqWlOB7DYtdOmPBJbTuyg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPMpw1yLlzYpg; Tue, 30 Jan 2024 11:08: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 40UB8Oi5075838; Tue, 30 Jan 2024 11:08:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UB8O6j075835; Tue, 30 Jan 2024 11:08:24 GMT (envelope-from git) Date: Tue, 30 Jan 2024 11:08:24 GMT Message-Id: <202401301108.40UB8O6j075835@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: 626d9b855302 - stable/14 - snd_uaudio: provide information about the device name and attached driver List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 626d9b855302ac97809bb429cfe5ae0e4c99c1ac Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=626d9b855302ac97809bb429cfe5ae0e4c99c1ac commit 626d9b855302ac97809bb429cfe5ae0e4c99c1ac Author: Christos Margiolis AuthorDate: 2024-01-16 16:46:49 +0000 Commit: Christos Margiolis CommitDate: 2024-01-30 11:07:28 +0000 snd_uaudio: provide information about the device name and attached driver Unlike the other sound drivers, snd_uaudio(4) doesn't provide information about the device's description and the driver it's attached to. A side-effect of this is that applications such as mixer(8), that fetch these strings through the OSS API's SNDCTL_CARDINFO ioctl will show a USB audio device as: pcm0:mixer: at ? kld snd_uaudio This patch replaces the generic "USB Audio" description with the device's actual manufacturer and product strings, and the "at ?" string with the driver it's attached to: pcm0:mixer: at uaudio0 kld snd_uaudio Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D43347 (cherry picked from commit 18d87fe4fe3b310796e138855016678453140423) --- sys/dev/sound/usb/uaudio.c | 11 +++++++++-- sys/dev/sound/usb/uaudio_pcm.c | 1 - 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index a14cdf805353..3237093bcbfa 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -1171,7 +1171,7 @@ uaudio_attach_sub(device_t dev, kobj_class_t mixer_class, kobj_class_t chan_clas { struct uaudio_softc *sc = device_get_softc(device_get_parent(dev)); unsigned i = uaudio_get_child_index_by_dev(sc, dev); - char status[SND_STATUSLEN]; + char status[SND_STATUSLEN], desc[128]; uaudio_mixer_init(sc, i); @@ -1199,7 +1199,14 @@ uaudio_attach_sub(device_t dev, kobj_class_t mixer_class, kobj_class_t chan_clas mixer_hwvol_init(dev); - snprintf(status, sizeof(status), "at ? %s", PCM_KLDSTRING(snd_uaudio)); + snprintf(desc, sizeof(desc), "%s %s", + usb_get_manufacturer(sc->sc_udev), + usb_get_product(sc->sc_udev)); + device_set_desc_copy(dev, desc); + + snprintf(status, sizeof(status), "at %s %s", + device_get_nameunit(device_get_parent(dev)), + PCM_KLDSTRING(snd_uaudio)); if (pcm_register(dev, sc, (sc->sc_play_chan[i].num_alt > 0) ? 1 : 0, diff --git a/sys/dev/sound/usb/uaudio_pcm.c b/sys/dev/sound/usb/uaudio_pcm.c index 3236e1bd2e5c..bf1f2ebb5e33 100644 --- a/sys/dev/sound/usb/uaudio_pcm.c +++ b/sys/dev/sound/usb/uaudio_pcm.c @@ -201,7 +201,6 @@ ua_probe(device_t dev) (func->func != SCF_PCM)) { return (ENXIO); } - device_set_desc(dev, "USB audio"); return (BUS_PROBE_DEFAULT); } From nobody Tue Jan 30 11:08:25 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPMpx5F1Cz58dKM; Tue, 30 Jan 2024 11:08:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TPMpx4Y9vz4HPY; Tue, 30 Jan 2024 11:08:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706612905; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DpVg/coAhi5qs8LlNIObiO+K3I0sQrK3Ku5yDzpSKFw=; b=kCtl1JEoSlGZFmQhBDTabPPPpI5hAaLMjkH9TSSVsDCs/aQ1f9XXnlukfDyaFuZwDY4gLA n9H0MnnPmW55Agt0XoS77Qu1LhBkmIKWjqRx8jn+vhUGXBb2LE3wik2NgPTs0w01zNmJBT lLIxZLKVxSC/CB5A9cWMDGJW3NNiNgUaKQF++19vKT9HC+j2h46n+Y1kY8QjvcSIC/C1qR xMO5sq4i2OGiqDJmFEMab0XDbskte/JGOmNdNcO2cQl1bVz7ArPvnv3gkTT3k5dBB0R62J 2Etgg3QnwbGhQvaeHRr56Qcy6dbrdqXajkJ3U0jjTL1wyf26f6qTZaBTLWM1yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706612905; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DpVg/coAhi5qs8LlNIObiO+K3I0sQrK3Ku5yDzpSKFw=; b=S3twRsITa4fJRCxqrTqN7DUJw0FyJPnKNQHrupa4Ty+EEJfULIvg9uFb4RFASaBZqHidp+ 273nYVncy41Of8L1fAiOPl3GW4CzgLI5FSiaMxZ5Kgi6KTusL8MsEjnj9cHyKEXB5UR09t stSQpXVQjMkMHW7f0lQuW0LAF5abTuUrHCGcQy1+JTLc6+KDh1rDWmmCxK9vm6wgbP7L3U eAqh69srjgEeMuk96LHTj09Xr3ECVUGDpbQttpk/qzfqXXb1XGrFB+tYRWSnqlZdKWNew1 5XV2l4Jggd9q90Ewp15bPR5gsQvpER43AqblTMl4KL/8hznpEJjkOT3fqU/KxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706612905; a=rsa-sha256; cv=none; b=VaxR6RwoMdoXyDl4ufYwhxKOc+ERXIG9blLGpRKVlfhMK4AIjlAA7lMewlsvXdq+Dhy6rN c1CgdZ+xnGfaas07wEw0cPt26KE1M10oKKL7ORUBgbzatKqi7mSpIoU1eK2TE1+KL1e7O7 XCVo3PqjYYHh4Iw8n5CroKj8k6U5DhWBkSM4hGlxArd3Ja5yJHRojMEOMZbElN+0iFWDAS FVqn/8QtgVTLovbVYMmeM5yK4SwrxCtm4FhS9sjUfK5SWpmkHWQxANZYwBJMSWbJqmYwZY 27nZiwmQAiidkqtXyAvwQUrumNsyjP3HOtkvsUYnRuyFH6USi7YRxCRbMmn1Mw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPMpx2YkNzYRj; Tue, 30 Jan 2024 11:08: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 40UB8PqV075890; Tue, 30 Jan 2024 11:08:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UB8P7B075887; Tue, 30 Jan 2024 11:08:25 GMT (envelope-from git) Date: Tue, 30 Jan 2024 11:08:25 GMT Message-Id: <202401301108.40UB8P7B075887@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: 9b40b4faa7bd - stable/14 - sound: remove PCM_KLDSTRING() and fix status strings List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 9b40b4faa7bd79a4e840e5ed38c0915bf2c82fbb Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=9b40b4faa7bd79a4e840e5ed38c0915bf2c82fbb commit 9b40b4faa7bd79a4e840e5ed38c0915bf2c82fbb Author: Christos Margiolis AuthorDate: 2024-01-16 16:48:14 +0000 Commit: Christos Margiolis CommitDate: 2024-01-30 11:07:28 +0000 sound: remove PCM_KLDSTRING() and fix status strings PCM_KLDSTRING() prints the kernel module associated with a given audio device only when that module is not compiled in. Get rid of PCM_KLDSTRING() altogether and print the driver name (even for modules that are compiled in) instead, as it implies the module as well. While here, convert all status strings to the following dmesg-like format: [ ] on Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: markj, imp Differential Revision: https://reviews.freebsd.org/D43349 (cherry picked from commit 837cd192ebf2d0d4f5ded8883403ef11e6fa6438) --- sys/dev/sound/pci/als4000.c | 5 +++-- sys/dev/sound/pci/atiixp.c | 4 ++-- sys/dev/sound/pci/cmi.c | 5 +++-- sys/dev/sound/pci/cs4281.c | 7 ++++--- sys/dev/sound/pci/csapcm.c | 5 +++-- sys/dev/sound/pci/emu10k1.c | 4 ++-- sys/dev/sound/pci/emu10kx-pcm.c | 3 ++- sys/dev/sound/pci/envy24.c | 5 +++-- sys/dev/sound/pci/envy24ht.c | 5 +++-- sys/dev/sound/pci/es137x.c | 6 +++--- sys/dev/sound/pci/fm801.c | 7 ++++--- sys/dev/sound/pci/hda/hdaa.c | 5 ++--- sys/dev/sound/pci/hdspe-pcm.c | 4 ++-- sys/dev/sound/pci/ich.c | 5 +++-- sys/dev/sound/pci/maestro3.c | 6 +++--- sys/dev/sound/pci/neomagic.c | 5 +++-- sys/dev/sound/pci/solo.c | 5 +++-- sys/dev/sound/pci/t4dwave.c | 5 +++-- sys/dev/sound/pci/via8233.c | 4 ++-- sys/dev/sound/pci/via82c686.c | 4 ++-- sys/dev/sound/pci/vibes.c | 5 +++-- sys/dev/sound/pcm/sound.h | 6 ------ sys/dev/sound/usb/uaudio.c | 5 ++--- 23 files changed, 60 insertions(+), 55 deletions(-) diff --git a/sys/dev/sound/pci/als4000.c b/sys/dev/sound/pci/als4000.c index 5b7247517c13..b1376d2b6e5a 100644 --- a/sys/dev/sound/pci/als4000.c +++ b/sys/dev/sound/pci/als4000.c @@ -847,8 +847,9 @@ als_pci_attach(device_t dev) pcm_addchan(dev, PCMDIR_PLAY, &alspchan_class, sc); pcm_addchan(dev, PCMDIR_REC, &alsrchan_class, sc); - snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd %s", - rman_get_start(sc->reg), rman_get_start(sc->irq),PCM_KLDSTRING(snd_als4000)); + snprintf(status, SND_STATUSLEN, "port 0x%jx irq %jd on %s", + rman_get_start(sc->reg), rman_get_start(sc->irq), + device_get_nameunit(device_get_parent(dev))); pcm_setstatus(dev, status); return 0; diff --git a/sys/dev/sound/pci/atiixp.c b/sys/dev/sound/pci/atiixp.c index 78be9475acd3..dcbf041f9605 100644 --- a/sys/dev/sound/pci/atiixp.c +++ b/sys/dev/sound/pci/atiixp.c @@ -1097,9 +1097,9 @@ atiixp_chip_post_init(void *arg) "polling", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc->dev, sizeof(sc->dev), sysctl_atiixp_polling, "I", "Enable polling mode"); - snprintf(status, SND_STATUSLEN, "at memory 0x%jx irq %jd %s", + snprintf(status, SND_STATUSLEN, "mem 0x%jx irq %jd on %s", rman_get_start(sc->reg), rman_get_start(sc->irq), - PCM_KLDSTRING(snd_atiixp)); + device_get_nameunit(device_get_parent(sc->dev))); pcm_setstatus(sc->dev, status); diff --git a/sys/dev/sound/pci/cmi.c b/sys/dev/sound/pci/cmi.c index 4fd6ac4c0a75..9a92066c51a4 100644 --- a/sys/dev/sound/pci/cmi.c +++ b/sys/dev/sound/pci/cmi.c @@ -990,8 +990,9 @@ cmi_attach(device_t dev) pcm_addchan(dev, PCMDIR_PLAY, &cmichan_class, sc); pcm_addchan(dev, PCMDIR_REC, &cmichan_class, sc); - snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd %s", - rman_get_start(sc->reg), rman_get_start(sc->irq),PCM_KLDSTRING(snd_cmi)); + snprintf(status, SND_STATUSLEN, "port 0x%jx irq %jd on %s", + rman_get_start(sc->reg), rman_get_start(sc->irq), + device_get_nameunit(device_get_parent(dev))); pcm_setstatus(dev, status); DEB(printf("cmi_attach: succeeded\n")); diff --git a/sys/dev/sound/pci/cs4281.c b/sys/dev/sound/pci/cs4281.c index 25beb3f7fd0d..972b83efff8f 100644 --- a/sys/dev/sound/pci/cs4281.c +++ b/sys/dev/sound/pci/cs4281.c @@ -845,9 +845,10 @@ cs4281_pci_attach(device_t dev) pcm_addchan(dev, PCMDIR_PLAY, &cs4281chan_class, sc); pcm_addchan(dev, PCMDIR_REC, &cs4281chan_class, sc); - snprintf(status, SND_STATUSLEN, "at %s 0x%jx irq %jd %s", - (sc->regtype == SYS_RES_IOPORT)? "io" : "memory", - rman_get_start(sc->reg), rman_get_start(sc->irq),PCM_KLDSTRING(snd_cs4281)); + snprintf(status, SND_STATUSLEN, "%s 0x%jx irq %jd on %s", + (sc->regtype == SYS_RES_IOPORT)? "port" : "mem", + rman_get_start(sc->reg), rman_get_start(sc->irq), + device_get_nameunit(device_get_parent(dev))); pcm_setstatus(dev, status); return 0; diff --git a/sys/dev/sound/pci/csapcm.c b/sys/dev/sound/pci/csapcm.c index 8715072ec0e5..71b9a0253cdb 100644 --- a/sys/dev/sound/pci/csapcm.c +++ b/sys/dev/sound/pci/csapcm.c @@ -819,8 +819,9 @@ pcmcsa_attach(device_t dev) return (ENXIO); } - snprintf(status, SND_STATUSLEN, "at irq %jd %s", - rman_get_start(resp->irq),PCM_KLDSTRING(snd_csa)); + snprintf(status, SND_STATUSLEN, "irq %jd on %s", + rman_get_start(resp->irq), + device_get_nameunit(device_get_parent(dev))); /* Enable interrupt. */ if (snd_setup_intr(dev, resp->irq, 0, csa_intr, csa, &csa->ih)) { diff --git a/sys/dev/sound/pci/emu10k1.c b/sys/dev/sound/pci/emu10k1.c index 92937c2d0c42..0813f89c87b8 100644 --- a/sys/dev/sound/pci/emu10k1.c +++ b/sys/dev/sound/pci/emu10k1.c @@ -2126,9 +2126,9 @@ emu_pci_attach(device_t dev) goto bad; } - snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd %s", + snprintf(status, SND_STATUSLEN, "port 0x%jx irq %jd on %s", rman_get_start(sc->reg), rman_get_start(sc->irq), - PCM_KLDSTRING(snd_emu10k1)); + device_get_nameunit(device_get_parent(dev))); if (pcm_register(dev, sc, sc->nchans, gotmic ? 3 : 2)) goto bad; for (i = 0; i < sc->nchans; i++) diff --git a/sys/dev/sound/pci/emu10kx-pcm.c b/sys/dev/sound/pci/emu10kx-pcm.c index 661d65165190..b4633efdddc7 100644 --- a/sys/dev/sound/pci/emu10kx-pcm.c +++ b/sys/dev/sound/pci/emu10kx-pcm.c @@ -1477,7 +1477,8 @@ emu_pcm_attach(device_t dev) if (route == RT_MCHRECORD) pcm_addchan(dev, PCMDIR_REC, &emufxrchan_class, sc); - snprintf(status, SND_STATUSLEN, "on %s", device_get_nameunit(device_get_parent(dev))); + snprintf(status, SND_STATUSLEN, "on %s", + device_get_nameunit(device_get_parent(dev))); pcm_setstatus(dev, status); return (0); diff --git a/sys/dev/sound/pci/envy24.c b/sys/dev/sound/pci/envy24.c index 24b5abc0eeb9..f7cc7ff5724d 100644 --- a/sys/dev/sound/pci/envy24.c +++ b/sys/dev/sound/pci/envy24.c @@ -2590,7 +2590,7 @@ envy24_pci_attach(device_t dev) /* set status iformation */ snprintf(status, SND_STATUSLEN, - "at io 0x%jx:%jd,0x%jx:%jd,0x%jx:%jd,0x%jx:%jd irq %jd", + "port 0x%jx:%jd,0x%jx:%jd,0x%jx:%jd,0x%jx:%jd irq %jd on %s", rman_get_start(sc->cs), rman_get_end(sc->cs) - rman_get_start(sc->cs) + 1, rman_get_start(sc->ddma), @@ -2599,7 +2599,8 @@ envy24_pci_attach(device_t dev) rman_get_end(sc->ds) - rman_get_start(sc->ds) + 1, rman_get_start(sc->mt), rman_get_end(sc->mt) - rman_get_start(sc->mt) + 1, - rman_get_start(sc->irq)); + rman_get_start(sc->irq), + device_get_nameunit(device_get_parent(dev))); pcm_setstatus(dev, status); return 0; diff --git a/sys/dev/sound/pci/envy24ht.c b/sys/dev/sound/pci/envy24ht.c index 6a3ef5afcf59..65c67b84ce53 100644 --- a/sys/dev/sound/pci/envy24ht.c +++ b/sys/dev/sound/pci/envy24ht.c @@ -2496,12 +2496,13 @@ envy24ht_pci_attach(device_t dev) /* set status iformation */ snprintf(status, SND_STATUSLEN, - "at io 0x%jx:%jd,0x%jx:%jd irq %jd", + "port 0x%jx:%jd,0x%jx:%jd irq %jd on %s", rman_get_start(sc->cs), rman_get_end(sc->cs) - rman_get_start(sc->cs) + 1, rman_get_start(sc->mt), rman_get_end(sc->mt) - rman_get_start(sc->mt) + 1, - rman_get_start(sc->irq)); + rman_get_start(sc->irq), + device_get_nameunit(device_get_parent(dev))); pcm_setstatus(dev, status); return 0; diff --git a/sys/dev/sound/pci/es137x.c b/sys/dev/sound/pci/es137x.c index 8c1c2b34e1cf..8f832d899dd3 100644 --- a/sys/dev/sound/pci/es137x.c +++ b/sys/dev/sound/pci/es137x.c @@ -1856,10 +1856,10 @@ es_pci_attach(device_t dev) goto bad; } - snprintf(status, SND_STATUSLEN, "at %s 0x%jx irq %jd %s", - (es->regtype == SYS_RES_IOPORT)? "io" : "memory", + snprintf(status, SND_STATUSLEN, "%s 0x%jx irq %jd on %s", + (es->regtype == SYS_RES_IOPORT)? "port" : "mem", rman_get_start(es->reg), rman_get_start(es->irq), - PCM_KLDSTRING(snd_es137x)); + device_get_nameunit(device_get_parent(dev))); if (pcm_register(dev, es, numplay, 1)) goto bad; diff --git a/sys/dev/sound/pci/fm801.c b/sys/dev/sound/pci/fm801.c index d7aa731175bb..fbde14f37afe 100644 --- a/sys/dev/sound/pci/fm801.c +++ b/sys/dev/sound/pci/fm801.c @@ -636,9 +636,10 @@ fm801_pci_attach(device_t dev) goto oops; } - snprintf(status, 64, "at %s 0x%jx irq %jd %s", - (fm801->regtype == SYS_RES_IOPORT)? "io" : "memory", - rman_get_start(fm801->reg), rman_get_start(fm801->irq),PCM_KLDSTRING(snd_fm801)); + snprintf(status, SND_STATUSLEN, "%s 0x%jx irq %jd on %s", + (fm801->regtype == SYS_RES_IOPORT)? "port" : "mem", + rman_get_start(fm801->reg), rman_get_start(fm801->irq), + device_get_nameunit(device_get_parent(dev))); #define FM801_MAXPLAYCH 1 if (pcm_register(dev, fm801, FM801_MAXPLAYCH, 1)) goto oops; diff --git a/sys/dev/sound/pci/hda/hdaa.c b/sys/dev/sound/pci/hda/hdaa.c index 1831ae0c1f19..e64eac6114e4 100644 --- a/sys/dev/sound/pci/hda/hdaa.c +++ b/sys/dev/sound/pci/hda/hdaa.c @@ -7114,9 +7114,8 @@ hdaa_pcm_attach(device_t dev) hdaa_unlock(devinfo); } - snprintf(status, SND_STATUSLEN, "on %s %s", - device_get_nameunit(device_get_parent(dev)), - PCM_KLDSTRING(snd_hda)); + snprintf(status, SND_STATUSLEN, "on %s", + device_get_nameunit(device_get_parent(dev))); pcm_setstatus(dev, status); return (0); diff --git a/sys/dev/sound/pci/hdspe-pcm.c b/sys/dev/sound/pci/hdspe-pcm.c index d9d40c9877ad..0360e84fbe91 100644 --- a/sys/dev/sound/pci/hdspe-pcm.c +++ b/sys/dev/sound/pci/hdspe-pcm.c @@ -1043,10 +1043,10 @@ hdspe_pcm_attach(device_t dev) scp->chnum++; } - snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd %s", + snprintf(status, SND_STATUSLEN, "port 0x%jx irq %jd on %s", rman_get_start(scp->sc->cs), rman_get_start(scp->sc->irq), - PCM_KLDSTRING(snd_hdspe)); + device_get_nameunit(device_get_parent(dev))); pcm_setstatus(dev, status); mixer_init(dev, &hdspemixer_class, scp); diff --git a/sys/dev/sound/pci/ich.c b/sys/dev/sound/pci/ich.c index 70a9440d9b23..fbde0accfd28 100644 --- a/sys/dev/sound/pci/ich.c +++ b/sys/dev/sound/pci/ich.c @@ -686,9 +686,10 @@ ich_setstatus(struct sc_info *sc) char status[SND_STATUSLEN]; snprintf(status, SND_STATUSLEN, - "at io 0x%jx, 0x%jx irq %jd bufsz %u %s", + "port 0x%jx,0x%jx irq %jd on %s", rman_get_start(sc->nambar), rman_get_start(sc->nabmbar), - rman_get_start(sc->irq), sc->bufsz,PCM_KLDSTRING(snd_ich)); + rman_get_start(sc->irq), + device_get_nameunit(device_get_parent(sc->dev))); if (bootverbose && (sc->flags & ICH_DMA_NOCACHE)) device_printf(sc->dev, diff --git a/sys/dev/sound/pci/maestro3.c b/sys/dev/sound/pci/maestro3.c index 9ba83fe4de11..6dd54a66f683 100644 --- a/sys/dev/sound/pci/maestro3.c +++ b/sys/dev/sound/pci/maestro3.c @@ -1439,10 +1439,10 @@ m3_pci_attach(device_t dev) goto bad; } } - snprintf(status, SND_STATUSLEN, "at %s 0x%jx irq %jd %s", - (sc->regtype == SYS_RES_IOPORT)? "io" : "memory", + snprintf(status, SND_STATUSLEN, "%s 0x%jx irq %jd on %s", + (sc->regtype == SYS_RES_IOPORT)? "port" : "mem", rman_get_start(sc->reg), rman_get_start(sc->irq), - PCM_KLDSTRING(snd_maestro3)); + device_get_nameunit(device_get_parent(dev))); if (pcm_setstatus(dev, status)) { device_printf(dev, "attach: pcm_setstatus error\n"); goto bad; diff --git a/sys/dev/sound/pci/neomagic.c b/sys/dev/sound/pci/neomagic.c index 1b325205da5f..25273633ff18 100644 --- a/sys/dev/sound/pci/neomagic.c +++ b/sys/dev/sound/pci/neomagic.c @@ -702,9 +702,10 @@ nm_pci_attach(device_t dev) goto bad; } - snprintf(status, SND_STATUSLEN, "at memory 0x%jx, 0x%jx irq %jd %s", + snprintf(status, SND_STATUSLEN, "mem 0x%jx,0x%jx irq %jd on %s", rman_get_start(sc->buf), rman_get_start(sc->reg), - rman_get_start(sc->irq),PCM_KLDSTRING(snd_neomagic)); + rman_get_start(sc->irq), + device_get_nameunit(device_get_parent(dev))); if (pcm_register(dev, sc, 1, 1)) goto bad; pcm_addchan(dev, PCMDIR_REC, &nmchan_class, sc); diff --git a/sys/dev/sound/pci/solo.c b/sys/dev/sound/pci/solo.c index d626da4fbb68..bee79e723696 100644 --- a/sys/dev/sound/pci/solo.c +++ b/sys/dev/sound/pci/solo.c @@ -1022,9 +1022,10 @@ ess_attach(device_t dev) if (mixer_init(dev, &solomixer_class, sc)) goto no; - snprintf(status, SND_STATUSLEN, "at io 0x%jx,0x%jx,0x%jx irq %jd %s", + snprintf(status, SND_STATUSLEN, "port 0x%jx,0x%jx,0x%jx irq %jd on %s", rman_get_start(sc->io), rman_get_start(sc->sb), rman_get_start(sc->vc), - rman_get_start(sc->irq),PCM_KLDSTRING(snd_solo)); + rman_get_start(sc->irq), + device_get_nameunit(device_get_parent(dev))); if (pcm_register(dev, sc, 1, 1)) goto no; diff --git a/sys/dev/sound/pci/t4dwave.c b/sys/dev/sound/pci/t4dwave.c index 250b04426482..653e610febbe 100644 --- a/sys/dev/sound/pci/t4dwave.c +++ b/sys/dev/sound/pci/t4dwave.c @@ -917,8 +917,9 @@ tr_pci_attach(device_t dev) goto bad; } - snprintf(status, 64, "at io 0x%jx irq %jd %s", - rman_get_start(tr->reg), rman_get_start(tr->irq),PCM_KLDSTRING(snd_t4dwave)); + snprintf(status, SND_STATUSLEN, "port 0x%jx irq %jd on %s", + rman_get_start(tr->reg), rman_get_start(tr->irq), + device_get_nameunit(device_get_parent(dev))); if (pcm_register(dev, tr, dacn, 1)) goto bad; diff --git a/sys/dev/sound/pci/via8233.c b/sys/dev/sound/pci/via8233.c index 517e80fadb4f..9f3b312e4365 100644 --- a/sys/dev/sound/pci/via8233.c +++ b/sys/dev/sound/pci/via8233.c @@ -1347,9 +1347,9 @@ via_attach(device_t dev) ac97_setextmode(via->codec, ext); } - snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd %s", + snprintf(status, SND_STATUSLEN, "port 0x%jx irq %jd on %s", rman_get_start(via->reg), rman_get_start(via->irq), - PCM_KLDSTRING(snd_via8233)); + device_get_nameunit(device_get_parent(dev))); /* Register */ if (pcm_register(dev, via, via_dxs_chnum + via_sgd_chnum, NWRCHANS)) diff --git a/sys/dev/sound/pci/via82c686.c b/sys/dev/sound/pci/via82c686.c index 266441a938c6..44f846b684d7 100644 --- a/sys/dev/sound/pci/via82c686.c +++ b/sys/dev/sound/pci/via82c686.c @@ -580,9 +580,9 @@ via_attach(device_t dev) NSEGS * sizeof(struct via_dma_op), dma_cb, via, 0) != 0) goto bad; - snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd %s", + snprintf(status, SND_STATUSLEN, "port 0x%jx irq %jd on %s", rman_get_start(via->reg), rman_get_start(via->irq), - PCM_KLDSTRING(snd_via82c686)); + device_get_nameunit(device_get_parent(dev))); /* Register */ if (pcm_register(dev, via, 1, 1)) goto bad; diff --git a/sys/dev/sound/pci/vibes.c b/sys/dev/sound/pci/vibes.c index 538aa961d987..e587f0113b5d 100644 --- a/sys/dev/sound/pci/vibes.c +++ b/sys/dev/sound/pci/vibes.c @@ -874,8 +874,9 @@ sv_attach(device_t dev) { pcm_addchan(dev, PCMDIR_PLAY, &svpchan_class, sc); pcm_addchan(dev, PCMDIR_REC, &svrchan_class, sc); - snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd %s", - rman_get_start(sc->enh_reg), rman_get_start(sc->irq),PCM_KLDSTRING(snd_vibes)); + snprintf(status, SND_STATUSLEN, "port 0x%jx irq %jd on %s", + rman_get_start(sc->enh_reg), rman_get_start(sc->irq), + device_get_nameunit(device_get_parent(dev))); pcm_setstatus(dev, status); DEB(printf("sv_attach: succeeded\n")); diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index 5981266116fb..5b366a62630c 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -598,12 +598,6 @@ int sound_oss_card_info(oss_card_info *); PCM_GIANT_EXIT(x); \ } while (0) -#ifdef KLD_MODULE -#define PCM_KLDSTRING(a) ("kld " # a) -#else -#define PCM_KLDSTRING(a) "" -#endif - #endif /* _KERNEL */ #endif /* _OS_H_ */ diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index 3237093bcbfa..36985d4666a4 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -1204,9 +1204,8 @@ uaudio_attach_sub(device_t dev, kobj_class_t mixer_class, kobj_class_t chan_clas usb_get_product(sc->sc_udev)); device_set_desc_copy(dev, desc); - snprintf(status, sizeof(status), "at %s %s", - device_get_nameunit(device_get_parent(dev)), - PCM_KLDSTRING(snd_uaudio)); + snprintf(status, sizeof(status), "on %s", + device_get_nameunit(device_get_parent(dev))); if (pcm_register(dev, sc, (sc->sc_play_chan[i].num_alt > 0) ? 1 : 0, From nobody Tue Jan 30 11:08:26 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPMpz1S6yz58dVb; Tue, 30 Jan 2024 11:08:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TPMpy61kzz4HYy; Tue, 30 Jan 2024 11:08:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706612906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ItlOU8liOA7aB5MdFK1lD1z3R8kG2qfq5+v+W+BY4eQ=; b=mDIAac9hEetpEZESq97tJlVD4lwLy+nNqrFDAu1007428aL0Njw/GnwX7pwsG8o/+YLtQD cGe9Z0ysHsymNo512pZCsm/oGw4y5aojpyIrQxCKohPzsDLtRDpbArCpAaPEN8z5TcIVfC GpJEOIT0kDLj8A68/WLfoh6ZttgtzxLElz+gesil2Q3Ohm3Ppna7NvceuXob5xg3T13waH sLJWYnjHn0HyRm0sJjsXpe+m7pFP0hBmkOtdQiEQIqxpgTZwwdwwOatCNSQe0cOd/D1DiZ Lbhzw+2bfWQWZVgO/AUcknJyGHEy8Mgi/fGA/Wq8c3cdplP/VMy7kGTxCDf8OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706612906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ItlOU8liOA7aB5MdFK1lD1z3R8kG2qfq5+v+W+BY4eQ=; b=a/6JZO21M6MVeBP2zIGRlbWQsYzosbml7/VT233dwgqh6CTQx3koQ2RYj0xKjHchCnAAFV BmMVUY67xWZtx91m6knRfycVs/wLy0/NhNEqEXeLweywN6Y2uUbqP8glDAlQvaWhrLYGCb 5ngypZKi23AJvxnnOKE6EwJfBEU8x8fQXXwiR4NvjKSotIIK2ewuf2KOzk15LEzFfzsrG7 6f295OWgUgvJJMatJYzLG+GQ39Oy4IHl1uBjvl05haGXlALiPWZrQ2vi6GYM/ffbB9H5Vf dsEniLgfiPdhanodm8huEyd2cqKY1CC09DetV8N9tUmXWqFv104ALYgS2MY1bg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706612906; a=rsa-sha256; cv=none; b=ljLeZ63f647utdBZksUUAEXp9ezVJoB+/OcxIPuvBps+L9chPAXxDHk7oyirhBxImeaTt4 QlXd62vzoTm3nNwFrvOcMwQCy33w5GclncniZ8pWI3T+iybV63/pfznCclYw1MgPSZER1U eRxXvAnhrZ9tUl9GxAm7INNRYSDi19Ka5w51HSMwEmK6SgBfUKqaX3rPZazwV+3Nj9odb4 ZguuPamaggls60I8HwTVqVa+8OvFGBmh333+69inZ6bP0P/vk4SPBFxZDRQUml1Wpgi5c8 EaBJHZrIHM4xTnN+177LTSKho7hG0kObyIaEK9scVspoeFdZ5hrdUVaCO3tCOg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPMpy3ny1zYHX; Tue, 30 Jan 2024 11:08:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40UB8Q7k075935; Tue, 30 Jan 2024 11:08:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UB8QvT075932; Tue, 30 Jan 2024 11:08:26 GMT (envelope-from git) Date: Tue, 30 Jan 2024 11:08:26 GMT Message-Id: <202401301108.40UB8QvT075932@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: b70d135ab471 - stable/14 - snd_uaudio: prefix module declaration with "snd_" List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: b70d135ab4718892568bd6261febdeb22d480aef Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=b70d135ab4718892568bd6261febdeb22d480aef commit b70d135ab4718892568bd6261febdeb22d480aef Author: Christos Margiolis AuthorDate: 2024-01-16 16:48:49 +0000 Commit: Christos Margiolis CommitDate: 2024-01-30 11:07:29 +0000 snd_uaudio: prefix module declaration with "snd_" Although the module is compiled "snd_uaudio.ko", follow the rest of the sound modules' naming convention in the declaration as well. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D43396 (cherry picked from commit 06a4376346e55d1c7aefe7a48063dddc4d1da9b9) --- sys/dev/sound/usb/uaudio.c | 10 +++++----- sys/dev/sound/usb/uaudio_pcm.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index 36985d4666a4..ebbff0e633e4 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -6230,10 +6230,10 @@ uaudio_hid_detach(struct uaudio_softc *sc) usbd_transfer_unsetup(sc->sc_hid.xfer, UAUDIO_HID_N_TRANSFER); } -DRIVER_MODULE_ORDERED(uaudio, uhub, uaudio_driver, NULL, NULL, SI_ORDER_ANY); -MODULE_DEPEND(uaudio, usb, 1, 1, 1); -MODULE_DEPEND(uaudio, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER); -MODULE_DEPEND(uaudio, hid, 1, 1, 1); -MODULE_VERSION(uaudio, 1); +DRIVER_MODULE_ORDERED(snd_uaudio, uhub, uaudio_driver, NULL, NULL, SI_ORDER_ANY); +MODULE_DEPEND(snd_uaudio, usb, 1, 1, 1); +MODULE_DEPEND(snd_uaudio, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER); +MODULE_DEPEND(snd_uaudio, hid, 1, 1, 1); +MODULE_VERSION(snd_uaudio, 1); USB_PNP_HOST_INFO(uaudio_devs); USB_PNP_HOST_INFO(uaudio_vendor_midi); diff --git a/sys/dev/sound/usb/uaudio_pcm.c b/sys/dev/sound/usb/uaudio_pcm.c index bf1f2ebb5e33..9b17cb232907 100644 --- a/sys/dev/sound/usb/uaudio_pcm.c +++ b/sys/dev/sound/usb/uaudio_pcm.c @@ -235,6 +235,6 @@ static driver_t ua_pcm_driver = { }; DRIVER_MODULE(ua_pcm, uaudio, ua_pcm_driver, 0, 0); -MODULE_DEPEND(ua_pcm, uaudio, 1, 1, 1); +MODULE_DEPEND(ua_pcm, snd_uaudio, 1, 1, 1); MODULE_DEPEND(ua_pcm, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER); MODULE_VERSION(ua_pcm, 1); From nobody Tue Jan 30 11:08:27 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPMq01mtlz58dMx; Tue, 30 Jan 2024 11:08:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TPMpz675wz4HRw; Tue, 30 Jan 2024 11:08:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706612907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XShIP72eOXKESc7VTj4Cq63t4+pAe18e8XF7Mt0K2HU=; b=PR9ZFfCT6fFj0vpGYLK9w9RDr0haaSB69b6gR/jmVuxNc77+d0F18UrLmbUtT/vq/1X02w hJ0bXU+fdxnWCfTslzmb6FWx7LPd+8li7J4oEtmJQFL521LDribgF3u8QKwG3fvEcTOAlZ OMLtvgBNRRCBaMsBGEJ1RpFDCyX4m1V47DIEme4fLefzR86fHzNBB723qANbSQFgPUmg97 q5eiyHnX14iVkbafa1uKdL2ZT4sMn/Nq+uKfHjOU2bwqGWYdN6xPXcWnz0fNAKqrfX077O Mm0Ct+iFDWDLaLH+mZkfalvyEYC+5ZegyFe5hGfF0ZDK1Xv/Vdr4YRrhb6uu4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706612907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XShIP72eOXKESc7VTj4Cq63t4+pAe18e8XF7Mt0K2HU=; b=KJpo34bto2OHx0SxpThrOo/g25CgEsCxSEKZkQpMq/tQvH96cdBpg06+kjVJnxa6ILHppa JcSg4QER/0/bRC/H0DmUcm0RtGpNB0VNT/WLRxdeHKvUjZOgEzP7g13emQPQfpyjDUkVTP XEKLHPL+cvmdvDDQk84Aq7OmHPUdIPgloacCKVjGOTjHD+Klb2fM84vzieBlldx/zs1Dx6 o6K6JTYJhL4awfl1RxAFFTaasu+IDqroL+nZzDce7l7f7pefiFFpB2Emrxlo6EE2OBpXO3 drFdrSTpgu2LYmpPLlBNef2vTHtG0mPv0PNz/Kbk5r5e8wtJuC02z8sgVD2xnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706612907; a=rsa-sha256; cv=none; b=WjObk8gP53q/f5k+JOupRDhtpw9uwl+rfehPJAa4Mbk6T8NyggGGH/TtvwdbP8/sECf6sh n0uU477oy+1k26GAAJ+61n8IaQdoZKLeaf3uanMl2FGQZQqWDESfp22y4ibs1TU3XDE8gJ wfRH/SJbRiw7C/6igUhjMxpcBTM94bAAqEeGWw7zQDxBj8M3ukQ0LVNlPu2lBhXKC2L1R3 y9oW/3wV/rByArAZ+k+IMGkcCdw7rUIBCcIO9iPHqJ/Ccwr0EuC9zB7I5Tk/nb8RPX14l2 I4T9gxIrexeEzZVknsdI759ZVHsl/bVfUV4OW7eBGRFjd/K/QkBXTIsc7xCWng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPMpz4NWvzYHY; Tue, 30 Jan 2024 11:08:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40UB8RKL075980; Tue, 30 Jan 2024 11:08:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UB8RKn075977; Tue, 30 Jan 2024 11:08:27 GMT (envelope-from git) Date: Tue, 30 Jan 2024 11:08:27 GMT Message-Id: <202401301108.40UB8RKn075977@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: f7db1b3d7bbf - stable/14 - sound: add missing modules to snd_driver List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: f7db1b3d7bbfd171515fc3cab4e2b059db16790f Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=f7db1b3d7bbfd171515fc3cab4e2b059db16790f commit f7db1b3d7bbfd171515fc3cab4e2b059db16790f Author: Christos Margiolis AuthorDate: 2024-01-16 16:48:56 +0000 Commit: Christos Margiolis CommitDate: 2024-01-30 11:07:29 +0000 sound: add missing modules to snd_driver While here, remove unnecessary break. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D43394 (cherry picked from commit 3a79c3ac8aa3c548aab9ad38acc4f480ab9e7a5b) --- sys/dev/sound/driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/sound/driver.c b/sys/dev/sound/driver.c index b7791f5223c9..927941ab3d01 100644 --- a/sys/dev/sound/driver.c +++ b/sys/dev/sound/driver.c @@ -43,7 +43,6 @@ snd_modevent(module_t mod, int type, void *data) break; default: return (ENOTSUP); - break; } return 0; } @@ -68,6 +67,7 @@ MODULE_DEPEND(snd_driver, snd_envy24ht, 1, 1, 1); MODULE_DEPEND(snd_driver, snd_es137x, 1, 1, 1); MODULE_DEPEND(snd_driver, snd_fm801, 1, 1, 1); MODULE_DEPEND(snd_driver, snd_hda, 1, 1, 1); +MODULE_DEPEND(snd_driver, snd_hdspe, 1, 1, 1); MODULE_DEPEND(snd_driver, snd_ich, 1, 1, 1); MODULE_DEPEND(snd_driver, snd_maestro3, 1, 1, 1); MODULE_DEPEND(snd_driver, snd_neomagic, 1, 1, 1); @@ -77,3 +77,4 @@ MODULE_DEPEND(snd_driver, snd_t4dwave, 1, 1, 1); MODULE_DEPEND(snd_driver, snd_via8233, 1, 1, 1); MODULE_DEPEND(snd_driver, snd_via82c686, 1, 1, 1); MODULE_DEPEND(snd_driver, snd_vibes, 1, 1, 1); +MODULE_DEPEND(snd_driver, snd_uaudio, 1, 1, 1); From nobody Tue Jan 30 11:08:28 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPMq131Rfz58dXr; Tue, 30 Jan 2024 11:08:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TPMq06MVwz4HjJ; Tue, 30 Jan 2024 11:08:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706612908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=13sFHBaNc6ZKDbGqA5ujgVlKSIN1ltFWvhoJfXte3fs=; b=E8zvQ5Wuhebjit0AkwVITYuTBtM6JFRhgUa96oWodKcN41rOjL7WDXLcqu0Ok9TQ4hRwQV rm0IrDFq/YbxgbjAk8kIiFBF6JVtOOteffDQ14uk+GLwBqQHeMR7wPWx53bk32OeuAG0LG 09mxGvF7tG/Xp9qu8b8MwIh4k9b7trkcJq6IVhMUffdx/5aF4n+CTgYKIGGYyqI98evsX6 wmHKiWtUbx4Ecigb9+gojb3zNG5rI9XxyDlzZh76wxu9g90I5C8rA0ZVOTOtEwpmdYN8Ii Ky7nVlU2sdZsvwrdIawQisq1tkze3JeWvBZgtlh9MntbWmMu+3el72leAnBCUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706612908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=13sFHBaNc6ZKDbGqA5ujgVlKSIN1ltFWvhoJfXte3fs=; b=Q0shpJBTeXYKjl6VY9LDRTpEAV9foM1u3XvOGaS+7zMwNhSxfkcDOeUubdkdisqTd16LyP iQ9HoU1W0sgD/aU3sSH1DKugHXi3RTNzpC3h0aMnfBRKMqzo5s1Amocu4d4CyDNI9UMHkq 748SZvWFiP8GskUAWjtVqPoUp4voFvcicwdGte6pR0cfLioL9oA4I5KQtrfOAkGfX/VH0a 9FbTrG9i19Uk/q1WDM86VvqcaAZqCAs5rZb3OHhOT+CjTiHLamrRS9mI6F3TuxlBfYaMrx ewHJtGyQGQfv9+O6ezNjzeJnA9NRl22aE18OuVmOFkSGluWwt8Q4Y6bKD5rZeg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706612908; a=rsa-sha256; cv=none; b=Ixin5v92C8Zm0AgVdXrOQdcFx5koou+PNjidwkLCT84FTDwMVlxraeZAcpuesB7XnmHd5O tEVS8NPYxeI8/pwwR7LtY3V+2Fm4/QtT7s9MwEZFqeZTVVwzCpHrJHnRYknBHcGnaks9Nr 9EM/MxMdxvR7sDf5vRS6aWwynzgbZRXjfPO0mORDcTKJZt8zCAcA8nNtwfFEx4pgtIzgZT q/LwlB2sTQOB0NHR03kRgvifk0dqT6pJgiD+G45af066gNz2AVnvkKp6Dk0LJHlKcJpn2z iAS2Ye+FiNOKm7CwJZGThFOG+4RMiaajrs7sp9IeC2AsfrZi9lhOkkx6bf63IQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPMq05MYQzYbd; Tue, 30 Jan 2024 11:08:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40UB8SmV076019; Tue, 30 Jan 2024 11:08:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UB8SFD076016; Tue, 30 Jan 2024 11:08:28 GMT (envelope-from git) Date: Tue, 30 Jan 2024 11:08:28 GMT Message-Id: <202401301108.40UB8SFD076016@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: 0452659e53db - stable/14 - pcm.4: mention snd_uaudio auto-load List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 0452659e53db3cf488848345a5fab98f85526be7 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=0452659e53db3cf488848345a5fab98f85526be7 commit 0452659e53db3cf488848345a5fab98f85526be7 Author: Christos Margiolis AuthorDate: 2024-01-16 16:49:02 +0000 Commit: Christos Margiolis CommitDate: 2024-01-30 11:07:29 +0000 pcm.4: mention snd_uaudio auto-load Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43397 (cherry picked from commit ebc9b69c77850d3b5a23473cd9a889b8c6d8685a) --- share/man/man4/pcm.4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man4/pcm.4 b/share/man/man4/pcm.4 index 1803eaca42eb..54efd86a2b52 100644 --- a/share/man/man4/pcm.4 +++ b/share/man/man4/pcm.4 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 2, 2023 +.Dd January 10, 2024 .Dt SOUND 4 .Os .Sh NAME @@ -113,7 +113,7 @@ The following bridge device drivers are available: .It .Xr snd_spicds 4 .It -.Xr snd_uaudio 4 (enabled by default on amd64, i386, powerpc) +.Xr snd_uaudio 4 (auto-loaded on device plug) .It .Xr snd_via8233 4 (enabled by default on amd64, i386) .It From nobody Tue Jan 30 11:08:29 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPMq22mk0z58dMy; Tue, 30 Jan 2024 11:08:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TPMq20HGDz4HMQ; Tue, 30 Jan 2024 11:08:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706612910; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q2wMrFLd3FpRt8VocLFwPY04FlBkQz7FjRXO79e8ed8=; b=H1OmV6925HM+AXsHs1m7hd6HHiU3wkp0F1D6z8ujuK6d3z9GKPjPI5k/dhbVN9C6V6sRen 3NkGDFKZMAZMRlrciXauxO+fECdtZ0Tktyhzv0n8+z0MJXF10MK3/QcciHJAcjXXgtsSL0 J9ivyDOGwE/WdsYoANCsL+bM+9OE/v/TfXg6rtxEJmF5kyjOEvQBdfb5PCeYyae5ZvZ/ho xB0EOsJbNljqB8H5okvxNkuzMZxkeEiuKeushVdFAI0GEBacb1y11N1CwGSfs2GW45/2+F ndR/O+XVN7psJnIhkna6ULRPATQYUJ1YJ62tNN9PQbU8ODVu2MF40vqi5GSAnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706612910; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q2wMrFLd3FpRt8VocLFwPY04FlBkQz7FjRXO79e8ed8=; b=XbVK6hbTZwSbAdkAOGApQbh/CTdIQ0Ezd+f2DpiPHLW0rvt084A55qfQGwnl6MdusZVUdn HmjjTiLUFF2jA/9lOVupOThougwZcBYtvGF0uUn/snQr3Nkoq6aUUWptQXWK3xyL/i+kWK edsREVZIQADWe0A/wygd6yYMiKuCT93/6K26BQrr96S80P+XmGPKtBGUyegWopU/4FtMbx jZJKOb8a+uxE2SditeD+siAEve+gXJcgw8M2CuNOQ0tUnFt4L0YGuPyKiVYMyNcOHWl5Ry +yGLWgZ0XgGhB1kJEvQUQNMwi2fF/jPixrTPIm0RiF4xzLw1KnaquRzOqfczJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706612910; a=rsa-sha256; cv=none; b=HR8dhAjsntpuDjKbQe9lRLs7S/46GqsxlTkKsVfgw8b53zUegT/F7Ssaft0aaqeB45hwFv DDH+CCP4+/CBDLe0Z9vPiS6iePtsaiQemRDyGHWqOgtycPu7eBS/Zb+HwajfF0t+n9guLg NlrMjoeDCexVsm0yZ05iDBiY/Hxrtrhdr+yKgKLa+gKyM+iNF+u3MWDN+LX6GyXYL2ddpE NvqERPHWenjRXoTUJVHZhxMc/x80eGyMHoSLcjzDK2+c2KUhpNLpCH3w/ntmowzIw2590k Qv3kE57vJHnB6QbI/5UUcCI6/Ni4ut8kECeEmpb5sORsGtzmriSLyMd+Yy1CBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPMq16N41zYbf; Tue, 30 Jan 2024 11:08:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40UB8TrH076066; Tue, 30 Jan 2024 11:08:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UB8TGQ076063; Tue, 30 Jan 2024 11:08:29 GMT (envelope-from git) Date: Tue, 30 Jan 2024 11:08:29 GMT Message-Id: <202401301108.40UB8TGQ076063@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: e95213b35b2c - stable/14 - usb: use only usb_devinfo() in device_set_usb_desc() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: e95213b35b2c0662f6cb34ea9b521f6159d78e32 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=e95213b35b2c0662f6cb34ea9b521f6159d78e32 commit e95213b35b2c0662f6cb34ea9b521f6159d78e32 Author: Christos Margiolis AuthorDate: 2024-01-16 16:49:08 +0000 Commit: Christos Margiolis CommitDate: 2024-01-30 11:07:29 +0000 usb: use only usb_devinfo() in device_set_usb_desc() device_set_usb_desc() first tries to fetch device information through the iInterface descriptor, otherwise it falls back to usb_devinfo(). Since usb_devinfo() is both guaranteed to work, and is more verbose, get rid of the initial iInterface attempt. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D43383 (cherry picked from commit 45cd29412eadbb0e8c40590a94b10663addac17a) --- sys/dev/usb/usb_util.c | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/sys/dev/usb/usb_util.c b/sys/dev/usb/usb_util.c index f9d50bdefdea..cd2dd7d6039e 100644 --- a/sys/dev/usb/usb_util.c +++ b/sys/dev/usb/usb_util.c @@ -73,9 +73,7 @@ device_set_usb_desc(device_t dev) { struct usb_attach_arg *uaa; struct usb_device *udev; - struct usb_interface *iface; char *temp_p; - usb_error_t err; uint8_t do_unlock; if (dev == NULL) { @@ -88,33 +86,11 @@ device_set_usb_desc(device_t dev) return; } udev = uaa->device; - iface = uaa->iface; - - if ((iface == NULL) || - (iface->idesc == NULL) || - (iface->idesc->iInterface == 0)) { - err = USB_ERR_INVAL; - } else { - err = 0; - } /* Protect scratch area */ do_unlock = usbd_ctrl_lock(udev); - temp_p = (char *)udev->scratch.data; - - if (err == 0) { - /* try to get the interface string ! */ - err = usbd_req_get_string_any(udev, NULL, temp_p, - sizeof(udev->scratch.data), - iface->idesc->iInterface); - } - if (err != 0) { - /* use default description */ - usb_devinfo(udev, temp_p, - sizeof(udev->scratch.data)); - } - + usb_devinfo(udev, temp_p, sizeof(udev->scratch.data)); if (do_unlock) usbd_ctrl_unlock(udev); From nobody Tue Jan 30 11:08:30 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPMq33V4qz58dQM; Tue, 30 Jan 2024 11:08: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 4TPMq31yMsz4HgM; Tue, 30 Jan 2024 11:08:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706612911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m4If+AXt3IzpXI3ke07ptOuehaCq/IrSl4IGbF1XSC0=; b=NGPYedixPk6XvpfsX7d3YKSLW8Nc/CKMUiOUchWOCNFBbwvw4XJU3GxKQTGNDAjM+srD4r 5c34psJxh8Ny6jJ2aEj7buUIhLH/gIYy6W8hhmK8TsAi5dS9Cdxj/rWE/VWFeJOmpBI7o7 iWAQG3ZxNSubKUEYXLyXl2lts/9Il18zYryq6aXhUKWK5dpCBRks8h3lPBRRZyDHI5e6Fw MFAtDYARyYC0X0gwCFAcvhWNFtp8qKI/mRRXQGNG215F5Vzmv1EqLyuOeVbIqxuRowifZs TQyaHVF3FqtRuSTah2aSmLWkfCIO9XeHrxEC0+P4wTZsc1OnxBoThjTdU3FA0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706612911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m4If+AXt3IzpXI3ke07ptOuehaCq/IrSl4IGbF1XSC0=; b=va6eo8hXEUEwQKF9pdPBMpR6zWibKZScvPMYY2+8jwjFi0QUX0WLIyhXnXAarCabfY8sSB dS7hCTcXmaEODkdQg1t6v6f1htqee+GBhavOn0qV9maPOk/x9XZ/rIub1Wjg3DOUIxao01 R+x0lJo90OBh9lnwabOC4cg/Ln8329c75Oqtersvf8lWWwiqSJUoATeG/+yD5V7EEHPjyw CkIlLDmIIY6VEDENKvY8gdmMWai8JMLW09WVGw9S9JTfmw2eo4W9RexZ6cwtqTfZn0Wl7i FpsXDBwS2/JK9j4qDUDrtYU0ZiBYnZ4qOlB1Sqty2dVpZjNfQmGuukr7nDc9RA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706612911; a=rsa-sha256; cv=none; b=hhg3wMUNtJTovKzSMfIsgr3ya3PB7CT/8CB1GsEGOGENWIC2DS6BkLyf+3nPP82aErWfu+ Pv0h24XMT51FGBK2yvJF6+epqamMrFDn1VGXIIPtsmrAGDYXvPbPQIKdKan2qncxAc1WiL a2Ky6aC4BZWF5C4TmyOFEkgqBbVEyNL0U9CepSU82jl1LOrGRdBlNTQ9HUCF+zBbHGcPuB 2P30cxkgJgXnCHDk52hoqtX7QMhg+BnwWrGbGRN2Fs8vJuOeDVfG/+MSdSg96ltZ2CMvBO LaxRK1/M2PqKpjWw+ifg5J8/gPNvj45klyEfVOLMvqsfD27XTd5uK6LC6xW62w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPMq2725ZzYXD; Tue, 30 Jan 2024 11:08:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40UB8UJ5076118; Tue, 30 Jan 2024 11:08:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UB8UNj076115; Tue, 30 Jan 2024 11:08:30 GMT (envelope-from git) Date: Tue, 30 Jan 2024 11:08:30 GMT Message-Id: <202401301108.40UB8UNj076115@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: 847d9b31df5e - stable/14 - subr_bus: introduce device_set_descf() and modify allocation logic List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 847d9b31df5e6d9fb41a0d4827b88fb4cd21068e Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=847d9b31df5e6d9fb41a0d4827b88fb4cd21068e commit 847d9b31df5e6d9fb41a0d4827b88fb4cd21068e Author: Christos Margiolis AuthorDate: 2024-01-16 16:49:15 +0000 Commit: Christos Margiolis CommitDate: 2024-01-30 11:07:29 +0000 subr_bus: introduce device_set_descf() and modify allocation logic device_set_descf() is a printf-like version of device_set_desc(). Allocation code has been transferred from device_set_desc_internal() to device_set_desc_copy() and device_set_descf() to avoid complicating device_set_desc_internal(). The "copy" argument in device_set_desc_internal() has been replaced with a flag which is set when the description string has been allocated with M_BUS. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D43370 (cherry picked from commit 6b6914c1e21b625503a1b8d8d5cfdfbc4c6a6acd) --- share/man/man9/Makefile | 1 + share/man/man9/device_set_desc.9 | 8 +++++++- sys/kern/subr_bus.c | 43 ++++++++++++++++++++++++++-------------- sys/sys/bus.h | 1 + 4 files changed, 37 insertions(+), 16 deletions(-) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 77b2038628be..505298899561 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1011,6 +1011,7 @@ MLINKS+=device_get_sysctl.9 device_get_sysctl_ctx.9 \ MLINKS+=device_quiet.9 device_is_quiet.9 \ device_quiet.9 device_verbose.9 MLINKS+=device_set_desc.9 device_get_desc.9 \ + device_set_desc.9 device_set_descf.9 \ device_set_desc.9 device_set_desc_copy.9 MLINKS+=device_set_flags.9 device_get_flags.9 MLINKS+=devstat.9 devicestat.9 \ diff --git a/share/man/man9/device_set_desc.9 b/share/man/man9/device_set_desc.9 index 69d6cfe18c6b..5037c90fedb1 100644 --- a/share/man/man9/device_set_desc.9 +++ b/share/man/man9/device_set_desc.9 @@ -26,11 +26,12 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd June 16, 1998 +.Dd January 9, 2024 .Dt DEVICE_SET_DESC 9 .Os .Sh NAME .Nm device_set_desc , +.Nm device_set_descf , .Nm device_set_desc_copy , .Nm device_get_desc .Nd access the description of a device @@ -40,6 +41,8 @@ .Ft void .Fn device_set_desc "device_t dev" "const char *desc" .Ft void +.Fn device_set_descf "device_t dev" "const char *fmt" "..." +.Ft void .Fn device_set_desc_copy "device_t dev" "const char *desc" .Ft const char * .Fn device_get_desc "device_t dev" @@ -54,6 +57,9 @@ is used to set the description if the string passed is a temporary buffer which will be overwritten. In this case, the system will copy the string, otherwise the pointer passed will be used directly. +.Fn device_set_descf +is a printf-like version of +.Fn device_set_desc . .Sh SEE ALSO .Xr device 9 .Sh AUTHORS diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 040b3556d156..d3db7ca5431c 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -1997,7 +1997,7 @@ device_log(device_t dev, int pri, const char * fmt, ...) * @internal */ static void -device_set_desc_internal(device_t dev, const char* desc, int copy) +device_set_desc_internal(device_t dev, const char *desc, bool allocated) { if (dev->desc && (dev->flags & DF_DESCMALLOCED)) { free(dev->desc, M_BUS); @@ -2005,16 +2005,9 @@ device_set_desc_internal(device_t dev, const char* desc, int copy) dev->desc = NULL; } - if (copy && desc) { - dev->desc = malloc(strlen(desc) + 1, M_BUS, M_NOWAIT); - if (dev->desc) { - strcpy(dev->desc, desc); - dev->flags |= DF_DESCMALLOCED; - } - } else { - /* Avoid a -Wcast-qual warning */ - dev->desc = (char *)(uintptr_t) desc; - } + if (allocated && desc) + dev->flags |= DF_DESCMALLOCED; + dev->desc = __DECONST(char *, desc); bus_data_generation_update(); } @@ -2027,9 +2020,26 @@ device_set_desc_internal(device_t dev, const char* desc, int copy) * call to device_set_desc() or device_set_desc_copy()). */ void -device_set_desc(device_t dev, const char* desc) +device_set_desc(device_t dev, const char *desc) +{ + device_set_desc_internal(dev, desc, false); +} + +/** + * @brief Set the device's description + * + * A printf-like version of device_set_desc(). + */ +void +device_set_descf(device_t dev, const char *fmt, ...) { - device_set_desc_internal(dev, desc, FALSE); + va_list ap; + char *buf = NULL; + + va_start(ap, fmt); + vasprintf(&buf, M_BUS, fmt, ap); + va_end(ap); + device_set_desc_internal(dev, buf, true); } /** @@ -2039,9 +2049,12 @@ device_set_desc(device_t dev, const char* desc) * the device description is generated, (e.g. with sprintf()). */ void -device_set_desc_copy(device_t dev, const char* desc) +device_set_desc_copy(device_t dev, const char *desc) { - device_set_desc_internal(dev, desc, TRUE); + char *buf; + + buf = strdup_flags(desc, M_BUS, M_NOWAIT); + device_set_desc_internal(dev, buf, true); } /** diff --git a/sys/sys/bus.h b/sys/sys/bus.h index 2ec735659452..581e81352be4 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -660,6 +660,7 @@ int device_quiesce(device_t dev); void device_quiet(device_t dev); void device_quiet_children(device_t dev); void device_set_desc(device_t dev, const char* desc); +void device_set_descf(device_t dev, const char* fmt, ...) __printflike(2, 3); void device_set_desc_copy(device_t dev, const char* desc); int device_set_devclass(device_t dev, const char *classname); int device_set_devclass_fixed(device_t dev, const char *classname); From nobody Tue Jan 30 11:08:32 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPMq43dFXz58dVk; Tue, 30 Jan 2024 11:08:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TPMq41vx5z4Hjr; Tue, 30 Jan 2024 11:08:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706612912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LCib1Yqr/o156tM8IEhszUaLEdQN6hEM5BBUzYXk4cg=; b=rmfxlOM3/OCu5npl+x2qiwr/x7t8/VJcsWOy7Aquy4YwOd9cqhtt9mzJrvEkYZ+7sXhyUp XmQUaisRrrEMh846WdHDmZSouRvWocPWCEuwV9cO57lIj9nSX1FQWla4ZS6i4j7xSf4KiY QNRFJmihljcrpFIe3jMJICgsJd9AT0kVhu7cFPbuMogYFAFfkxrsVRWendNJHfaeaNBV3z wrpAN/VvtDyUs+qj6d0JmyylPPeQC28n8MwEDTiOPI0QTrNTD65J5rDZMv3+e0Nk4jxHu/ w2HSIrsCX3mOM7vE3fV4Nxg26x7w60WiBuT81GNWNHI3gKMYt1VxTe4HWRPlDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706612912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LCib1Yqr/o156tM8IEhszUaLEdQN6hEM5BBUzYXk4cg=; b=aYMPKEh7p5ce5fOnDriKiEj6g7fg7AwkuWW838Txh5GIS1vRzKdU+Qj/X7euLtc6DcNyDt rcKu4F2X7uLcFwJBfWiVRgarDQfAYZanHlWScgWwTCZJH40EI0EbtAhn12gQEwSDN1iZX2 I/ZaXDzpEFYFCOEV5mrDGxdbg8vop1Fh+xbCU/HARHZPFh5gzcqtciRtbmDATH92y73PuE Q3R9CJbdfBRCfGzaMzNS8BETM5WL0Ebu+Wh4s+AgGiNeoJVaO8ca67dKopfQXC0P3cjm9c w7ZmJMbECyTxAjx5gUBqO1eNbHV9flZ2aTqkcTMzAVOecUe3SV4dGvkyG9uYSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706612912; a=rsa-sha256; cv=none; b=tnqWvYcZXpvNSr3fkj4RHjRCwZiQq89GaqotUqifp1iDyeaNZocdYxgH18W3tOIyv2q0Zn WvXF80VOx5n3463w9XCLAY5mV1GqAToxSy0v8FXUVzTFnlvJ6KJdNJD6r09ldu5Xh0W3Cz kYLTWsuHTFYMxx2sA1GlIuAbUmkb88K8oyP8b0EIncu8fLb3gYwHmfmp5pNExccvIBFct2 N+xLefX6m86gWWENoK2Xl4LeCJosbil3qTVOmWhZSPOE4HHIS5ZQtcndsve07DKb3JXvSW 4ISi5YaQfPbJD5+/uoPAWKnIcHX+giitpXQpqwSpnz3KuqLseR/YTBFdeSweww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPMq40zhSzYXF; Tue, 30 Jan 2024 11:08:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40UB8WSW076169; Tue, 30 Jan 2024 11:08:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UB8WB4076166; Tue, 30 Jan 2024 11:08:32 GMT (envelope-from git) Date: Tue, 30 Jan 2024 11:08:32 GMT Message-Id: <202401301108.40UB8WB4076166@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: 406d5c58148c - stable/14 - sound: use device_set_descf() to set device descriptions List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 406d5c58148c5cb41c549f60240ddbfe85a8081e Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=406d5c58148c5cb41c549f60240ddbfe85a8081e commit 406d5c58148c5cb41c549f60240ddbfe85a8081e Author: Christos Margiolis AuthorDate: 2024-01-22 09:44:51 +0000 Commit: Christos Margiolis CommitDate: 2024-01-30 11:07:29 +0000 sound: use device_set_descf() to set device descriptions Commit 6b6914c1e21b introduced a printf-like version of device_set_desc(), so use it to simplify device description setting in the audio stack. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D43467 (cherry picked from commit f7d3d0a4ded35ba15d63cdf9287b4a2d6f80da11) --- sys/dev/sound/pci/emu10kx-pcm.c | 4 +--- sys/dev/sound/pci/emu10kx.c | 12 ++---------- sys/dev/sound/pci/hda/hdaa.c | 8 ++------ sys/dev/sound/pci/hda/hdac.c | 6 ++---- sys/dev/sound/pci/hda/hdacc.c | 3 +-- sys/dev/sound/pci/hdspe-pcm.c | 13 +++++-------- sys/dev/sound/usb/uaudio.c | 5 ++--- 7 files changed, 15 insertions(+), 36 deletions(-) diff --git a/sys/dev/sound/pci/emu10kx-pcm.c b/sys/dev/sound/pci/emu10kx-pcm.c index b4633efdddc7..825a39fc4e63 100644 --- a/sys/dev/sound/pci/emu10kx-pcm.c +++ b/sys/dev/sound/pci/emu10kx-pcm.c @@ -1298,7 +1298,6 @@ emu_pcm_probe(device_t dev) { uintptr_t func, route; const char *rt; - char buffer[255]; BUS_READ_IVAR(device_get_parent(dev), dev, EMU_VAR_FUNC, &func); @@ -1328,8 +1327,7 @@ emu_pcm_probe(device_t dev) break; } - snprintf(buffer, 255, "EMU10Kx DSP %s PCM interface", rt); - device_set_desc_copy(dev, buffer); + device_set_descf(dev, "EMU10Kx DSP %s PCM interface", rt); return (0); } diff --git a/sys/dev/sound/pci/emu10kx.c b/sys/dev/sound/pci/emu10kx.c index 29366c3b61f3..6bbbfcc1df0e 100644 --- a/sys/dev/sound/pci/emu10kx.c +++ b/sys/dev/sound/pci/emu10kx.c @@ -2985,7 +2985,6 @@ emu_write_ivar(device_t bus __unused, device_t dev __unused, static int emu_pci_probe(device_t dev) { - struct sbuf *s; unsigned int thiscard = 0; uint16_t vendor; @@ -2997,15 +2996,8 @@ emu_pci_probe(device_t dev) if (thiscard == 0) return (ENXIO); - s = sbuf_new(NULL, NULL, 4096, 0); - if (s == NULL) - return (ENOMEM); - sbuf_printf(s, "Creative %s [%s]", emu_cards[thiscard].desc, emu_cards[thiscard].SBcode); - sbuf_finish(s); - - device_set_desc_copy(dev, sbuf_data(s)); - - sbuf_delete(s); + device_set_descf(dev, "Creative %s [%s]", + emu_cards[thiscard].desc, emu_cards[thiscard].SBcode); return (BUS_PROBE_DEFAULT); } diff --git a/sys/dev/sound/pci/hda/hdaa.c b/sys/dev/sound/pci/hda/hdaa.c index e64eac6114e4..02f4babcd331 100644 --- a/sys/dev/sound/pci/hda/hdaa.c +++ b/sys/dev/sound/pci/hda/hdaa.c @@ -6577,14 +6577,12 @@ static int hdaa_probe(device_t dev) { const char *pdesc; - char buf[128]; if (hda_get_node_type(dev) != HDA_PARAM_FCT_GRP_TYPE_NODE_TYPE_AUDIO) return (ENXIO); pdesc = device_get_desc(device_get_parent(dev)); - snprintf(buf, sizeof(buf), "%.*s Audio Function Group", + device_set_descf(dev, "%.*s Audio Function Group", (int)(strlen(pdesc) - 10), pdesc); - device_set_desc_copy(dev, buf); return (BUS_PROBE_DEFAULT); } @@ -6939,7 +6937,6 @@ hdaa_pcm_probe(device_t dev) struct hdaa_devinfo *devinfo = pdevinfo->devinfo; const char *pdesc; char chans1[8], chans2[8]; - char buf[128]; int loc1, loc2, t1, t2; if (pdevinfo->playas >= 0) @@ -6984,7 +6981,7 @@ hdaa_pcm_probe(device_t dev) if (pdevinfo->digital) t1 = -2; pdesc = device_get_desc(device_get_parent(dev)); - snprintf(buf, sizeof(buf), "%.*s (%s%s%s%s%s%s%s%s%s)", + device_set_descf(dev, "%.*s (%s%s%s%s%s%s%s%s%s)", (int)(strlen(pdesc) - 21), pdesc, loc1 >= 0 ? HDA_LOCS[loc1] : "", loc1 >= 0 ? " " : "", (pdevinfo->digital == 0x7)?"HDMI/DP": @@ -6994,7 +6991,6 @@ hdaa_pcm_probe(device_t dev) chans1[0] ? " " : "", chans1, chans2[0] ? "/" : "", chans2, t1 >= 0 ? " " : "", t1 >= 0 ? HDA_DEVS[t1] : ""); - device_set_desc_copy(dev, buf); return (BUS_PROBE_SPECIFIC); } diff --git a/sys/dev/sound/pci/hda/hdac.c b/sys/dev/sound/pci/hda/hdac.c index 2cf9239499af..1f06692ba36e 100644 --- a/sys/dev/sound/pci/hda/hdac.c +++ b/sys/dev/sound/pci/hda/hdac.c @@ -1101,10 +1101,8 @@ hdac_probe(device_t dev) snprintf(desc, sizeof(desc), "Generic (0x%08x)", model); result = BUS_PROBE_GENERIC; } - if (result != ENXIO) { - strlcat(desc, " HDA Controller", sizeof(desc)); - device_set_desc_copy(dev, desc); - } + if (result != ENXIO) + device_set_descf(dev, "%s HDA Controller", desc); return (result); } diff --git a/sys/dev/sound/pci/hda/hdacc.c b/sys/dev/sound/pci/hda/hdacc.c index b551b4b37701..f815e39392d4 100644 --- a/sys/dev/sound/pci/hda/hdacc.c +++ b/sys/dev/sound/pci/hda/hdacc.c @@ -472,8 +472,7 @@ hdacc_probe(device_t dev) hdacc_codecs[i].name, hda_get_device_id(dev)); } else snprintf(buf, sizeof(buf), "Generic (0x%04x)", id); - strlcat(buf, " HDA CODEC", sizeof(buf)); - device_set_desc_copy(dev, buf); + device_set_descf(dev, "%s HDA CODEC", buf); return (BUS_PROBE_DEFAULT); } diff --git a/sys/dev/sound/pci/hdspe-pcm.c b/sys/dev/sound/pci/hdspe-pcm.c index 0360e84fbe91..db39b867879f 100644 --- a/sys/dev/sound/pci/hdspe-pcm.c +++ b/sys/dev/sound/pci/hdspe-pcm.c @@ -1000,23 +1000,20 @@ hdspe_pcm_attach(device_t dev) { char status[SND_STATUSLEN]; struct sc_pcminfo *scp; - char desc[64]; + const char *buf; int err; int play, rec; scp = device_get_ivars(dev); scp->ih = &hdspe_pcm_intr; - bzero(desc, sizeof(desc)); if (scp->hc->ports & HDSPE_CHAN_AIO_ALL) - snprintf(desc, sizeof(desc), "HDSPe AIO [%s]", - scp->hc->descr); + buf = "AIO"; else if (scp->hc->ports & HDSPE_CHAN_RAY_ALL) - snprintf(desc, sizeof(desc), "HDSPe RayDAT [%s]", - scp->hc->descr); + buf = "RayDAT"; else - snprintf(desc, sizeof(desc), "HDSPe ? [%s]", scp->hc->descr); - device_set_desc_copy(dev, desc); + buf = "?"; + device_set_descf(dev, "HDSPe %s [%s]", buf, scp->hc->descr); /* * We don't register interrupt handler with snd_setup_intr diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index ebbff0e633e4..917b6bd3f238 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -1171,7 +1171,7 @@ uaudio_attach_sub(device_t dev, kobj_class_t mixer_class, kobj_class_t chan_clas { struct uaudio_softc *sc = device_get_softc(device_get_parent(dev)); unsigned i = uaudio_get_child_index_by_dev(sc, dev); - char status[SND_STATUSLEN], desc[128]; + char status[SND_STATUSLEN]; uaudio_mixer_init(sc, i); @@ -1199,10 +1199,9 @@ uaudio_attach_sub(device_t dev, kobj_class_t mixer_class, kobj_class_t chan_clas mixer_hwvol_init(dev); - snprintf(desc, sizeof(desc), "%s %s", + device_set_descf(dev, "%s %s", usb_get_manufacturer(sc->sc_udev), usb_get_product(sc->sc_udev)); - device_set_desc_copy(dev, desc); snprintf(status, sizeof(status), "on %s", device_get_nameunit(device_get_parent(dev))); From nobody Tue Jan 30 11:08:33 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPMq54c6Yz58dN0; Tue, 30 Jan 2024 11:08:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TPMq52hLkz4HSg; Tue, 30 Jan 2024 11:08:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706612913; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GIesgA+yGEOerdcuCJAiNGSdoZo7T+U5b6SQpz8YWa4=; b=vYgYq9/Y03yDF4v9DhWMdW/deJhZj7qUnpF6PxXS9UWfG8zEbFu8Azi3i/7x1j8eoha8sX +SG1j9pjkSedjQvtHhHSPUK7NFWPP1q80JdEDuGneSPsOAzfC+oAyEKAWSURR+89hiDPs+ T3DXEMM6+ajbOu434Cec52tlxAiKHUFDfi1bbLzxvbvzv5sOxKjHFl+t1smB6OZCeeYyyt V7UNH44gNFmazOc+BzY/SmMoSSvuxZ5ab3gsnYYX2VbzDJOr8fk0nsJElPFJGknFFnhv2g IORpRzWFtk95/1m3LczTvD9hcQ6+uokioJXnfodGuScG7ZAyQw/xAv2Z0gosrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706612913; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GIesgA+yGEOerdcuCJAiNGSdoZo7T+U5b6SQpz8YWa4=; b=htM7LO+vFYj4p90hrG1Eyg1DlkQ3obad34z+UdQw/Imv/Sqg+SrsCCXJKUZEMU9I7LiKaY SeJQvCYPBHNFC5e+eFu4k54vlUBtR6F9TisLT4ypfeXWzU3QtyUe03SDV/MHSnrEmsCkH2 aM9P1Rd05RabLjM/XVg+2V0Ialu31c1aYYn+4y/KbKD/yldT3ebYf2dZdh2b2nX9iWKvY+ SH4fUI4peiEzocKe244u3PcaTU8umnXIBtAeVPzDDbI5tPewABdsVGiuI2xt1FI8lduqFp cO10GoxohbNIl9zUhnH533mQDE7+6+fXsufhiLIuwgL4mhUUjRGqi9j6NCezxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706612913; a=rsa-sha256; cv=none; b=yPajiehOTCbOhX8TkUNJcwXn/nw13H9DVFGIrfeAWdty5Ze29UpYkJjT3F6FxEApFBVqFx utuGUcrJ01Kc7Sgu3eP5bmFjb7geFDxCVe/E4IqpXmY77gaUUQIwXsRJh0zumGX/dqCCIu 1KvItaAqFJvdFo/E+1LY11Oto0b7/70MFypGwUne+baoCmZ2zSHaTdYKjudOIpzz9oPcjm t5gT9/5H+mQV06rerk3CaK6BgwGB5q0M7zSuFMqUosqBZEILjaDOBZ65kimr4qBuRwF6Pb n7dzf3YmQQOyKanAp8AxN90oSiRFrYO5pG9/0KDKOuo19rCyCJAuv8f72jBZWQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPMq51TFPzYph; Tue, 30 Jan 2024 11:08:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40UB8X7a076220; Tue, 30 Jan 2024 11:08:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UB8XO9076218; Tue, 30 Jan 2024 11:08:33 GMT (envelope-from git) Date: Tue, 30 Jan 2024 11:08:33 GMT Message-Id: <202401301108.40UB8XO9076218@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: c191e1d018c7 - stable/14 - acpiconf: remove trailing space in "Mesurement Accuracy" output List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: c191e1d018c7e652d8c728d30071e669bde0631d Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=c191e1d018c7e652d8c728d30071e669bde0631d commit c191e1d018c7e652d8c728d30071e669bde0631d Author: Christos Margiolis AuthorDate: 2024-01-23 15:39:40 +0000 Commit: Christos Margiolis CommitDate: 2024-01-30 11:07:29 +0000 acpiconf: remove trailing space in "Mesurement Accuracy" output No functional change intended. MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D43561 (cherry picked from commit 9f550134a4a4c8319e79f0ae9f44c58d30f6c26f) --- usr.sbin/acpi/acpiconf/acpiconf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/acpi/acpiconf/acpiconf.c b/usr.sbin/acpi/acpiconf/acpiconf.c index 44c39ca66368..4f5cb08325dc 100644 --- a/usr.sbin/acpi/acpiconf/acpiconf.c +++ b/usr.sbin/acpi/acpiconf/acpiconf.c @@ -131,7 +131,7 @@ acpi_battinfo(int num) if (ACPI_BIX_REV_MIN_CHECK(battio.bix.rev, ACPI_BIX_REV_0)) { if (battio.bix.cycles != ACPI_BATT_UNKNOWN) printf("Cycle Count:\t\t%d\n", battio.bix.cycles); - printf("Measurement Accuracy:\t%d %%\n", + printf("Measurement Accuracy:\t%d%%\n", battio.bix.accuracy / 1000); if (battio.bix.stmax != ACPI_BATT_UNKNOWN) printf("Max Sampling Time:\t%d ms\n", From nobody Tue Jan 30 11:42:08 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPNYr6S6bz58hCl; Tue, 30 Jan 2024 11:42: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 4TPNYr5Chqz4NFY; Tue, 30 Jan 2024 11:42:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706614928; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DPEf3WUDF7f/wJhZI42uA3rqh5FgNBxnMNHvrXJXbDY=; b=BpJ+jYmQFV9ppfg/e+wqA/BVPrBT7st0Ozz/Z3pL3ugFRYMcUqlWabS8avb6knQsBPxXww s7mumrpiJFCeZu4aCCx1FI+DHTa4v0Uz5C+x1hZsiR315VP7fACjGpS7IKPz3xSGP8a/Or tLdzgw/sU4ue3qx3Lm/0NG8Mj6UHcFUv9NNj/JJzo+I0oJJKq2ueTV5w2Ifudvqeu6ddF8 Cqgu24E083UpUIFJ+uIpfHfqljtdQCjlwXZzf8hPb+cpPtMY58cGDZYodkoVzKLip9lcwz U4sda3qfBm5IgcdUEmWp6QryPzEeIFIXXPrCt2Vl1dBpnbokgKUWx/ElRHhzKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706614928; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DPEf3WUDF7f/wJhZI42uA3rqh5FgNBxnMNHvrXJXbDY=; b=izPjE2lOkwVZvyxqPG8bMvPakLW+ZmqBIoCPRZfhkU5SypllxJNMh4PI92irzNRgXZYWL5 9Ykqqd2olrRu2u79hq2DC8aCKSs1Vb1J5k3jqEaL3GVCkoM/hzfQ4LlQ3bGtQPelJGdajf wOLxlDX5TdKkpgkuiA1YWQr796UM2G7C5IVEEBe4HPQ6/4kWSK/bnNj8AHwZDurwLSI+po PCxO87hUtzivoOPcdSzeCC2TrsDNyQ0mdik2yOvMndh5z7M1JG6zKTGPgmToD/Ozd16BhV oNVSlVf33GOZE4WdVQShyZv1YjpHMM0hoUtmut9BHiMvQRhdsNwB3eflwI0VWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706614928; a=rsa-sha256; cv=none; b=GTQ7InWZoQR9E9auUUomlCwQGGqyD1xg2QTaA7uibH/bBHIUduSkq48I6eVHwLGw+xn0Hf /2xX1OGKciGFq9tbQ/rY4i5Rl2nt0jXHevdqKJTJHMHqNydjYABzSpnbISAm04A/Krld7v gUf4FZAAps6QCmhzphlXuqs/rIUdC0uzyputPBNYwFZdf3BN3im9VcVlQfXPBldHSai7hv sZTGjo0MwCnQGUmLPhAajCs+xXe+6xZbupEHm2CjVlyEQnELiSzznPWSXDKyHNcPhvtbl2 g+oEwCHhOE6rz9l1Uad8Fdh9Zje3p1DWUrot8FJ37RVkUYFLVI4BTAvKYMcAbA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPNYr4GTlzZnf; Tue, 30 Jan 2024 11:42: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 40UBg8ms042218; Tue, 30 Jan 2024 11:42:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UBg8vq042215; Tue, 30 Jan 2024 11:42:08 GMT (envelope-from git) Date: Tue, 30 Jan 2024 11:42:08 GMT Message-Id: <202401301142.40UBg8vq042215@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Osipov Subject: git: 538994626b9f - stable/14 - periodic: Make security diff(1) output as small is possible List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: michaelo X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 538994626b9f80a016bbb593d30cda2fac12f5e6 Auto-Submitted: auto-generated The branch stable/14 has been updated by michaelo: URL: https://cgit.FreeBSD.org/src/commit/?id=538994626b9f80a016bbb593d30cda2fac12f5e6 commit 538994626b9f80a016bbb593d30cda2fac12f5e6 Author: Michael Osipov AuthorDate: 2023-11-24 09:26:41 +0000 Commit: Michael Osipov CommitDate: 2024-01-30 11:40:48 +0000 periodic: Make security diff(1) output as small is possible Make, by default, security diff(1) produce a unified output with a context of zero (0) lines. This reduces output of unrelated lines in e-mails delivered to root. PR: 270266 Approved by: jrm (mentor), karels MFC after: 1 month Relnotes: yes Differential Revision: https://reviews.freebsd.org/D43071 (cherry picked from commit 3aa71ea7c231a4e60a7e1b9b677e379e17432fc8) --- share/man/man5/periodic.conf.5 | 5 +++-- usr.sbin/periodic/periodic.conf | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/share/man/man5/periodic.conf.5 b/share/man/man5/periodic.conf.5 index 3ad39070839f..f434069bc96e 100644 --- a/share/man/man5/periodic.conf.5 +++ b/share/man/man5/periodic.conf.5 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 9, 2022 +.Dd December 31, 2023 .Dt PERIODIC.CONF 5 .Os .Sh NAME @@ -807,7 +807,8 @@ Set to the arguments to pass to the .Xr diff 1 utility when generating differences. The default is -.Fl b u . +.Fl b +.Fl U Cm 0 . .It Va security_status_chksetuid_enable .Pq Vt bool Set to diff --git a/usr.sbin/periodic/periodic.conf b/usr.sbin/periodic/periodic.conf index 8a69a7e703aa..0c35d33b63aa 100644 --- a/usr.sbin/periodic/periodic.conf +++ b/usr.sbin/periodic/periodic.conf @@ -248,7 +248,7 @@ security_show_badconfig="NO" # scripts returning 2 # These options are used by the security periodic(8) scripts spawned in # daily and weekly 450.status-security. security_status_logdir="/var/log" # Directory for logs -security_status_diff_flags="-b -u" # flags for diff output +security_status_diff_flags="-b -U 0" # flags for diff output # Each of the security_status_*_period options below can have one of the # following values: From nobody Tue Jan 30 11:42:09 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPNYt1DLlz58hDy; Tue, 30 Jan 2024 11:42: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 4TPNYt09BKz4NFd; Tue, 30 Jan 2024 11:42:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706614930; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0OPG3k/4+vC0QR8lRUAEjy6ga2oYM1uSVEyAyT6Ls5U=; b=MhXLyGCYvmpvEFJhaAFpq8fcRWeUMg9lz3vogfEe2qJKNvJbVPmCSrcWNY6/oL980khvg8 W5fpuPRI9thAeZFzYYGF1dZ7l653mc7b2e0BEMi3+8wSgjpBkWyEkSXubA3g6P7vJiw8Xb 7DM8mNTrOyuLuafZ1v8VTi7ZfwVamBchaXI9TicCblR76Oxu3bCcaSatsO8aVC5UwHeq0g vAcA41bqLLZQev4jNHGbaLnVlStnN6/Rrv4mX9LWh2gMxPKIWXqi6O+TH6XZy4jSekupsb 4gKO9qokqCUUAp5DUPzzSPKvUpbPOZA++chgGR+KnVLF0VIvugANw+hLLDfduQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706614930; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0OPG3k/4+vC0QR8lRUAEjy6ga2oYM1uSVEyAyT6Ls5U=; b=S82Inlbq9prx59I5jsjlI/EhVXeyE0MBCVlTXcp2agSZbnWWGl7QPgp1mJV45DNFPDIy9X 2wqy6ovZwm3cJpt9QhHFjFBhPVVeJsbxKbGvepEDH0bHnOpw58sSrUX8EFD3tB+EyxrL3y /rDsViJgjTr2Qt7W8Koo+9U851lw8a8P0W7nOoE4xmSfVeNTSYXU09YZtJ3qPmKR0r68zN 6/P1ppDhFclYlhDvgimkm7Z9EeVH0kn9jJPJHhwAoaNcOL4zD/sPzT93y1QxhLmYKrqhqC kdKDy5l04VIcz6ximd6y0Zu8oHINkW/rmRG2MuSw+5O2X3ICjKrjrWGazK96IQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706614930; a=rsa-sha256; cv=none; b=Cpteasa+mqLdY4RRoN9nJwbPbdtpi1FnCTXyVOAwD5O3tW+f+qEnWzcC9+Bg1O6487ZkN8 5mOW46rXffg+oG+csNLI4X1vwc2kBAMPkmdpISo1/V4tLkNgLZClqnCnBT0wIfMRzrKs0v WIDMLpiC34iU8+Rn44XtrgrbOzKg8fyoMOPBasVlVYACNNQuV5/bCzqQiRbRrehwGZqTJl YijmAxUNQ7Ewfmrhf9QejvcxlQr/VuIkIKcPNz13g+6l8s+iwbRH3UloZaLYk1pgiALBsP Geyj95nIkeRqh+TZkVqh11SH4T16LFhVZ3O+B/RBZqbbmtmkvrCYVHcDinHcsQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPNYs5bWLzZqq; Tue, 30 Jan 2024 11:42: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 40UBg9Li042269; Tue, 30 Jan 2024 11:42:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UBg9Sq042266; Tue, 30 Jan 2024 11:42:09 GMT (envelope-from git) Date: Tue, 30 Jan 2024 11:42:09 GMT Message-Id: <202401301142.40UBg9Sq042266@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Osipov Subject: git: 37dc394170a5 - stable/14 - periodic: Make daily diff(1) flags configurable with daily_diff_flags List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: michaelo X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 37dc394170a5cbb85adde6753bd33f9d10b87022 Auto-Submitted: auto-generated The branch stable/14 has been updated by michaelo: URL: https://cgit.FreeBSD.org/src/commit/?id=37dc394170a5cbb85adde6753bd33f9d10b87022 commit 37dc394170a5cbb85adde6753bd33f9d10b87022 Author: Michael Osipov AuthorDate: 2023-11-24 09:26:41 +0000 Commit: Michael Osipov CommitDate: 2024-01-30 11:41:30 +0000 periodic: Make daily diff(1) flags configurable with daily_diff_flags PR: 270266 Approved by: jrm (mentor), karels MFC after: 1 month Relnotes: yes Differential Revision: https://reviews.freebsd.org/D42900 (cherry picked from commit 15e35d058cff847d1a7bc671fcf48b99f5d2f73b) --- share/man/man5/periodic.conf.5 | 5 +++++ usr.sbin/periodic/etc/daily/200.backup-passwd | 4 ++-- usr.sbin/periodic/etc/daily/210.backup-aliases | 2 +- usr.sbin/periodic/etc/daily/221.backup-gpart | 2 +- usr.sbin/periodic/etc/daily/222.backup-gmirror | 2 +- usr.sbin/periodic/etc/daily/223.backup-zfs | 2 +- usr.sbin/periodic/periodic.conf | 1 + 7 files changed, 12 insertions(+), 6 deletions(-) diff --git a/share/man/man5/periodic.conf.5 b/share/man/man5/periodic.conf.5 index f434069bc96e..da1eb355d7db 100644 --- a/share/man/man5/periodic.conf.5 +++ b/share/man/man5/periodic.conf.5 @@ -639,6 +639,11 @@ but specific to the pool Set to a list of extra scripts that should be run after all other daily scripts. All scripts must be absolute path names. +.It Va daily_diff_flags +.Pq Vt str +Set to the arguments to pass to the +.Xr diff 1 +utility when generating differences. .El .Pp The following variables are used by the standard scripts that reside in diff --git a/usr.sbin/periodic/etc/daily/200.backup-passwd b/usr.sbin/periodic/etc/daily/200.backup-passwd index 44da5993a3a6..e165e7f0f0ed 100755 --- a/usr.sbin/periodic/etc/daily/200.backup-passwd +++ b/usr.sbin/periodic/etc/daily/200.backup-passwd @@ -40,7 +40,7 @@ case "$daily_backup_passwd_enable" in then [ $rc -lt 1 ] && rc=1 echo "$host passwd diffs:" - diff -uI '^#' $bak/master.passwd.bak /etc/master.passwd |\ + diff ${daily_diff_flags:--u} -I '^#' $bak/master.passwd.bak /etc/master.passwd |\ sed 's/^\([-+ ][^:]*\):[^:]*:/\1:(password):/' mv $bak/master.passwd.bak $bak/master.passwd.bak2 cp -p /etc/master.passwd $bak/master.passwd.bak || rc=3 @@ -57,7 +57,7 @@ case "$daily_backup_passwd_enable" in then [ $rc -lt 1 ] && rc=1 echo "$host group diffs:" - diff -u $bak/group.bak /etc/group + diff ${daily_diff_flags:--u} $bak/group.bak /etc/group mv $bak/group.bak $bak/group.bak2 cp -p /etc/group $bak/group.bak || rc=3 fi diff --git a/usr.sbin/periodic/etc/daily/210.backup-aliases b/usr.sbin/periodic/etc/daily/210.backup-aliases index 3b689e3eaa1b..25e2bd021a84 100755 --- a/usr.sbin/periodic/etc/daily/210.backup-aliases +++ b/usr.sbin/periodic/etc/daily/210.backup-aliases @@ -34,7 +34,7 @@ case "$daily_backup_aliases_enable" in then [ $rc -lt 1 ] && rc=1 echo "$host aliases diffs:" - diff -u $bak/aliases.bak /etc/mail/aliases + diff ${daily_diff_flags:--u} $bak/aliases.bak /etc/mail/aliases mv $bak/aliases.bak $bak/aliases.bak2 cp -p /etc/mail/aliases $bak/aliases.bak || rc=3 fi diff --git a/usr.sbin/periodic/etc/daily/221.backup-gpart b/usr.sbin/periodic/etc/daily/221.backup-gpart index da59a6d5d724..50096e38f118 100755 --- a/usr.sbin/periodic/etc/daily/221.backup-gpart +++ b/usr.sbin/periodic/etc/daily/221.backup-gpart @@ -27,7 +27,7 @@ rotate() { rm "${file}.tmp" else rc=1 - [ -n "$show_diff" ] && diff "${file}.bak" "${file}.tmp" + [ -n "$show_diff" ] && diff ${daily_diff_flags} "${file}.bak" "${file}.tmp" mv "${file}.bak" "${file}.bak2" || rc=3 mv "${file}.tmp" "${file}.bak" || rc=3 fi diff --git a/usr.sbin/periodic/etc/daily/222.backup-gmirror b/usr.sbin/periodic/etc/daily/222.backup-gmirror index 866a00497759..45c656dc4f41 100755 --- a/usr.sbin/periodic/etc/daily/222.backup-gmirror +++ b/usr.sbin/periodic/etc/daily/222.backup-gmirror @@ -25,7 +25,7 @@ rotate() { rm "${file}.tmp" else rc=1 - [ -n "$show_diff" ] && diff "${file}.bak" "${file}.tmp" + [ -n "$show_diff" ] && diff ${daily_diff_flags} "${file}.bak" "${file}.tmp" mv "${file}.bak" "${file}.bak2" || rc=3 mv "${file}.tmp" "${file}.bak" || rc=3 fi diff --git a/usr.sbin/periodic/etc/daily/223.backup-zfs b/usr.sbin/periodic/etc/daily/223.backup-zfs index 03876df53f13..a49bbb2eaa04 100755 --- a/usr.sbin/periodic/etc/daily/223.backup-zfs +++ b/usr.sbin/periodic/etc/daily/223.backup-zfs @@ -25,7 +25,7 @@ rotate() { rm "${file}.tmp" else rc=1 - [ -n "$show_diff" ] && diff "${file}.bak" "${file}.tmp" + [ -n "$show_diff" ] && diff ${daily_diff_flags} "${file}.bak" "${file}.tmp" mv "${file}.bak" "${file}.bak2" || rc=3 mv "${file}.tmp" "${file}.bak" || rc=3 fi diff --git a/usr.sbin/periodic/periodic.conf b/usr.sbin/periodic/periodic.conf index 0c35d33b63aa..0a8f7961c2f9 100644 --- a/usr.sbin/periodic/periodic.conf +++ b/usr.sbin/periodic/periodic.conf @@ -31,6 +31,7 @@ anticongestion_sleeptime=3600 # that output. $daily_output might be set to /var/log/daily.log if you # wish to log the daily output and have the files rotated by newsyslog(8) # +daily_diff_flags="" # flags for diff output daily_output="root" # user or /file daily_show_success="YES" # scripts returning 0 daily_show_info="YES" # scripts returning 1 From nobody Tue Jan 30 11:42:10 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPNYv2L6Zz58hF4; Tue, 30 Jan 2024 11:42: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 4TPNYv0SK2z4NNw; Tue, 30 Jan 2024 11:42:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706614931; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k4u1NjYxbbfz2G1gFSpl94Uhfq8ij7e89TL92cYMhr4=; b=WxNonJNgBmifVaQFv5UrajGFl60umBeDoz4zKJoE33UtdFWrqRq61JXpCaAYNk4hMepI5b tHmJNj44E7dmECLcufoVXZUBKEoDQ1SGBF6jzkjKvOVN3XshhJLfSC2oC0tB77S0B+xgDB 7o3/yJSMifWML22NR/gm/2VcAEFbwAgehrDPdSn1vLwbeGQhGff0Whe2ipkuVX5IhxzeJs nXtKCAblzC21d4wveZgsC82FamVtT7F4HxcZkkt/IuYF2sGS0B8CXx3Gvxgsn/REbyt2I0 ZPZB7Tb+3Xa3W+HU2Yd2l/DYbNLsfVnC7fzGdR34gVM+Wta6qeaZ+OulduFwkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706614931; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k4u1NjYxbbfz2G1gFSpl94Uhfq8ij7e89TL92cYMhr4=; b=mmzgX+tmmRwlN9Kn96jYvg1v84kP+O6I3yPJdcerbuU2wcehijZwl8JoPhkmaCq8MI3o9P eZcPiqGjqE2Mb7MvaQp3H8TNy7hY7gGadLhCX2TOqTfd2y4yHAUBRNBh1YalWkOOWjVlCO 6dIja85kwe2deYgD/bw498yfwNlSNsjdgDmW4W8EAIuCS5IRJa4pLPZuFDNcQGDdH1a35z kKan2uOCqQxbQRQ1JbPLxufpFLdGdNYsP6l8wKi3zj36yMzF/RrV/ENcLQzOnZpaMn/bfP zddGuQ0mTvBIt3REmanlRml34gnlyCiSrDb5Bq8qSHbvlWN3cOZ9WzYCXeF9Pg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706614931; a=rsa-sha256; cv=none; b=FtwERElduLHpEgnUdUJa0hWRu9BPODeXOSQYN5f/ceUBNv/ADMT5cDfCQlgcVDiM1YHvgx J7ME+oSgzFWD3QyMGROPlJII1EgPU7vhoDAxPN5K6/jdVGVGUhAFD4Y8F1u84nfa6frN/n GXp47CB+yLBtjJe9p5eqkb6gNT550PmdJVCqIesSGfLszk+/2Q/c1VrUtECYO2yiihQSba xjfj9SShnApjO9sAoQ61//GQlkYy4RRfzTE6gVreQhcr8OSillrMAY2xUjgUKXpUFerET4 sjP5+oB/fBzIs0zoKU9ROI+CPnHEsvq1h2zDF4pKV0f7xWjjPfUiKACFL42cgQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPNYt6S8gzZtG; Tue, 30 Jan 2024 11:42: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 40UBgAYb042323; Tue, 30 Jan 2024 11:42:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UBgAOb042320; Tue, 30 Jan 2024 11:42:10 GMT (envelope-from git) Date: Tue, 30 Jan 2024 11:42:10 GMT Message-Id: <202401301142.40UBgAOb042320@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Osipov Subject: git: 128e78ffb084 - stable/14 - periodic: Make daily diff(1) output as small is possible List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: michaelo X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 128e78ffb0847640ca5b411b4f55eb915d7ca15e Auto-Submitted: auto-generated The branch stable/14 has been updated by michaelo: URL: https://cgit.FreeBSD.org/src/commit/?id=128e78ffb0847640ca5b411b4f55eb915d7ca15e commit 128e78ffb0847640ca5b411b4f55eb915d7ca15e Author: Michael Osipov AuthorDate: 2023-11-24 09:26:41 +0000 Commit: Michael Osipov CommitDate: 2024-01-30 11:41:38 +0000 periodic: Make daily diff(1) output as small is possible Make, by default, daily diff(1) ignore whitespace changes and the unified output a context of zero (0) lines. This reduces output of unrelated lines in e-mails delivered to root. PR: 270266 Approved by: jrm (mentor), karels MFC after: 1 month Relnotes: yes Differential Revision: https://reviews.freebsd.org/D42762 (cherry picked from commit e2f6bafc3887c7752986526f3758525d24701fce) --- share/man/man5/periodic.conf.5 | 3 +++ usr.sbin/periodic/etc/daily/200.backup-passwd | 4 ++-- usr.sbin/periodic/etc/daily/210.backup-aliases | 2 +- usr.sbin/periodic/periodic.conf | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/share/man/man5/periodic.conf.5 b/share/man/man5/periodic.conf.5 index da1eb355d7db..29fff146c212 100644 --- a/share/man/man5/periodic.conf.5 +++ b/share/man/man5/periodic.conf.5 @@ -644,6 +644,9 @@ All scripts must be absolute path names. Set to the arguments to pass to the .Xr diff 1 utility when generating differences. +The default is +.Fl b +.Fl U Cm 0 . .El .Pp The following variables are used by the standard scripts that reside in diff --git a/usr.sbin/periodic/etc/daily/200.backup-passwd b/usr.sbin/periodic/etc/daily/200.backup-passwd index e165e7f0f0ed..7cd52fc7be4b 100755 --- a/usr.sbin/periodic/etc/daily/200.backup-passwd +++ b/usr.sbin/periodic/etc/daily/200.backup-passwd @@ -40,7 +40,7 @@ case "$daily_backup_passwd_enable" in then [ $rc -lt 1 ] && rc=1 echo "$host passwd diffs:" - diff ${daily_diff_flags:--u} -I '^#' $bak/master.passwd.bak /etc/master.passwd |\ + diff ${daily_diff_flags} -I '^#' $bak/master.passwd.bak /etc/master.passwd |\ sed 's/^\([-+ ][^:]*\):[^:]*:/\1:(password):/' mv $bak/master.passwd.bak $bak/master.passwd.bak2 cp -p /etc/master.passwd $bak/master.passwd.bak || rc=3 @@ -57,7 +57,7 @@ case "$daily_backup_passwd_enable" in then [ $rc -lt 1 ] && rc=1 echo "$host group diffs:" - diff ${daily_diff_flags:--u} $bak/group.bak /etc/group + diff ${daily_diff_flags} $bak/group.bak /etc/group mv $bak/group.bak $bak/group.bak2 cp -p /etc/group $bak/group.bak || rc=3 fi diff --git a/usr.sbin/periodic/etc/daily/210.backup-aliases b/usr.sbin/periodic/etc/daily/210.backup-aliases index 25e2bd021a84..d236d9615dba 100755 --- a/usr.sbin/periodic/etc/daily/210.backup-aliases +++ b/usr.sbin/periodic/etc/daily/210.backup-aliases @@ -34,7 +34,7 @@ case "$daily_backup_aliases_enable" in then [ $rc -lt 1 ] && rc=1 echo "$host aliases diffs:" - diff ${daily_diff_flags:--u} $bak/aliases.bak /etc/mail/aliases + diff ${daily_diff_flags} $bak/aliases.bak /etc/mail/aliases mv $bak/aliases.bak $bak/aliases.bak2 cp -p /etc/mail/aliases $bak/aliases.bak || rc=3 fi diff --git a/usr.sbin/periodic/periodic.conf b/usr.sbin/periodic/periodic.conf index 0a8f7961c2f9..5e3a7837c6b4 100644 --- a/usr.sbin/periodic/periodic.conf +++ b/usr.sbin/periodic/periodic.conf @@ -31,7 +31,7 @@ anticongestion_sleeptime=3600 # that output. $daily_output might be set to /var/log/daily.log if you # wish to log the daily output and have the files rotated by newsyslog(8) # -daily_diff_flags="" # flags for diff output +daily_diff_flags="-b -U 0" # flags for diff output daily_output="root" # user or /file daily_show_success="YES" # scripts returning 0 daily_show_info="YES" # scripts returning 1 From nobody Tue Jan 30 11:44:33 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPNcf0cZ1z58hPk; Tue, 30 Jan 2024 11:44: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 4TPNcd6rbGz4PFF; Tue, 30 Jan 2024 11:44:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706615074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oUZFNWD8gPThTMW4iWYlAAEGjZxWXi/9yVOpPgxKQNU=; b=LwqrlviKrOp5ztZ7qEwY1z/Po1OphiTYde1V6dv4d305kFX0zgZjOhyqtcBM4iVmsGrU2C 1md53M7a6JY2wQMFe8MiA6R1ircKClrsCCBld3BDXtdZZQQYTLhaljxxFPHgR5vb5gvkTK ZA2AUdBy53Funn8MJXi/MOAwltNDg3lLpa/HQgcH6rTJKf593FBtixUGW0L+Eitr/VHKeS RD/MyMGiVBcm33enrqciRIFlkF2mMhpq+EVWtYSPWFRJnfqhdIcW+n6idO+KMqSCt7OW6f mh20mm+Nsh62hRsrmFbIftivjOvheZicRA/n81kJizIkJicKxmqpQdV46D1nNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706615074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oUZFNWD8gPThTMW4iWYlAAEGjZxWXi/9yVOpPgxKQNU=; b=EqswnecBZUiPxdv6y3CdhjtZZkUhqp/lO4rRyaVdr2L4qGT2uv2c3Ok4zc0GBKUuEiwnND x5vwVTtKgr1gFVp0pp0phQklYE0843OdxeN0PR+VL438pBrX6IlWd5HGSyOsJ3HYOBLPrh gorc1/S2D2NNeAZTgoR9gQQWtp8d+XK/I/9+ly2OHAVNUWqAglQOkBhQ1e4A6hodETGv2J H181/F8kcAuBUgRk0zKTxQ1D4R/2IETvwiftdyfAGWjgNU4zSZbQzmCgaJbGiAxqt3PfMk YOw9IDQGNv3PFrdE7YWJb46GVFQRfV2zdFPDbYMJp22dxN2nXR1KRPDd2+6dIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706615074; a=rsa-sha256; cv=none; b=ye5GTCn3zx2AY33R5gX9jhK3eIQowmU9hDc5A4YsddrdRrDWYlIJUa4dUjYamEOAVfegef mnagvIYuxJKCrG/A8yPDKuIWcfehR+RElkADb6Dcdijy0cEPkZ1vPTVRqeCwS7zHl+Bhvo Z2LebDQzZCbxdhTXryDzPn5/ApVRu7oZGqnrSRX9UazaC6ZX3l3EdF4pdvFRZmeV3gZFZO cVJk/Ng/EV5dDATmtJncyYhd8PAN2w/eq6gM2678Vq+Bb+UqMJnMui3qwcbWMtWJlFeZya bj9CoFbYbekkphZFMgZmXP6+1l3KLyZ+LP397a/kbGIdBfUOPXhrp3zV7XbxHw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPNcd4cNCzZKJ; Tue, 30 Jan 2024 11:44: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 40UBiXua042828; Tue, 30 Jan 2024 11:44:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UBiX2e042825; Tue, 30 Jan 2024 11:44:33 GMT (envelope-from git) Date: Tue, 30 Jan 2024 11:44:33 GMT Message-Id: <202401301144.40UBiX2e042825@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Osipov Subject: git: 6d9195b5f763 - stable/13 - periodic: Make security diff(1) output as small is possible List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: michaelo X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6d9195b5f763803f2bce37e0283563db76950aae Auto-Submitted: auto-generated The branch stable/13 has been updated by michaelo: URL: https://cgit.FreeBSD.org/src/commit/?id=6d9195b5f763803f2bce37e0283563db76950aae commit 6d9195b5f763803f2bce37e0283563db76950aae Author: Michael Osipov AuthorDate: 2023-11-24 09:26:41 +0000 Commit: Michael Osipov CommitDate: 2024-01-30 11:43:33 +0000 periodic: Make security diff(1) output as small is possible Make, by default, security diff(1) produce a unified output with a context of zero (0) lines. This reduces output of unrelated lines in e-mails delivered to root. PR: 270266 Approved by: jrm (mentor), karels MFC after: 1 month Relnotes: yes Differential Revision: https://reviews.freebsd.org/D43071 (cherry picked from commit 3aa71ea7c231a4e60a7e1b9b677e379e17432fc8) --- share/man/man5/periodic.conf.5 | 5 +++-- usr.sbin/periodic/periodic.conf | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/share/man/man5/periodic.conf.5 b/share/man/man5/periodic.conf.5 index 681f3696b87f..6043263f3e3a 100644 --- a/share/man/man5/periodic.conf.5 +++ b/share/man/man5/periodic.conf.5 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 7, 2020 +.Dd December 31, 2023 .Dt PERIODIC.CONF 5 .Os .Sh NAME @@ -813,7 +813,8 @@ Set to the arguments to pass to the .Xr diff 1 utility when generating differences. The default is -.Fl b u . +.Fl b +.Fl U Cm 0 . .It Va security_status_chksetuid_enable .Pq Vt bool Set to diff --git a/usr.sbin/periodic/periodic.conf b/usr.sbin/periodic/periodic.conf index d37928d09925..2da2ac1ae384 100644 --- a/usr.sbin/periodic/periodic.conf +++ b/usr.sbin/periodic/periodic.conf @@ -251,7 +251,7 @@ security_show_badconfig="NO" # scripts returning 2 # These options are used by the security periodic(8) scripts spawned in # daily and weekly 450.status-security. security_status_logdir="/var/log" # Directory for logs -security_status_diff_flags="-b -u" # flags for diff output +security_status_diff_flags="-b -U 0" # flags for diff output # Each of the security_status_*_period options below can have one of the # following values: From nobody Tue Jan 30 11:44:34 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPNcg1WY8z58hTs; Tue, 30 Jan 2024 11:44: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 4TPNcf6GcXz4PCB; Tue, 30 Jan 2024 11:44:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706615074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RNbvY1gKmsHSoCg2s6LFxaYQZqSTwqzzI5Ce71XiZnQ=; b=rm8F2+yHMn+L0VZxx7XZbW8/gITtBBeHcEKrGD3D4OhCXdkQ/Y4mwSU3UjEf++sns324ht 2Omc1FI/rVOuDoIp6xMgGRshrcMOs6P0uhTRW9r9w3lVyVJDCOa1Fvta0XPo5wqC+nMWSv kdsemYqZdEUWi4JiVKkfNAPkx0m1yO4mde0FPi3A40hhO+tfHxKU/KVan3S5sRX/mfAgf0 LQrufwnpLK5cJgbXQ3bDmmJ2SKRcK+T9+WyqTCdirkJ+vghMdzyCGQunouH8FSZFNRafdP glpWSkuuvngx6jyxIbUzEakTYD9Yxg3gDIvFUjFc8KgNNXmrVDJQkDA4Qgi/sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706615074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RNbvY1gKmsHSoCg2s6LFxaYQZqSTwqzzI5Ce71XiZnQ=; b=vJSH1AsUzND1T9rcfxXwGTQeVkpsYXqAgLPSvjaximIxnT+bsB2k12I8iUqBTWC2O19zc9 +qbP1nSQRu7TqGPSPhqUhmzJWTRmBJeEL/MIkvJTz2A1V7MpDSFP9r8XWe4tM7XDPHU+vm L9AuSKRriCEWco5ZpdxSybddyze4S8yZL2oAZ34kEDCQmpWpWS0CCagElQOrPRjIAU+34w 3Wy8dZj/HdPJ6bTlTKf4Z+2MMKa2Zj0ahTk9wN9SlClkhYmBYs6bk3UbEull0d+G/Z+YfY YNPRAWM6QHhP3pxwI8EDB08ge0fRmeQpScDom5vAOYl+66jFoQulQ3F2vbbhZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706615074; a=rsa-sha256; cv=none; b=INggalUXgD2cd3NaQrsaJUxCF3S6GwvL/s6EFK5ON96ZnLJFfASTM1bg4NEYZOVbysbsAI sARS5zbHJ4Yz9wHtNOPyOPXdSp3Tu57MdIbGycK3qQpE+ahYNpxjoIP/PW8dvIdUZIzeg4 oTMxjpoAPZJ/D/oNr5S6ti0WbB209kbwTNWpN1MjbV0YWe7ky895O/8szdhxUJtAffP4nq IvBkjLm/VGGfjC+9osRG9gI2xQuxJ3pw7+cju9WsZ1XKwkLUL3zvEEC0eT9ekF7pJj10Ab wn7ALT5TYpnIJFd5NG04ULMVSHIc7gQJP/GMl/z5QiBhPufOaryJ6yDOyXO1GQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPNcf5KY5zZqt; Tue, 30 Jan 2024 11:44: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 40UBiY73042882; Tue, 30 Jan 2024 11:44:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UBiYPO042879; Tue, 30 Jan 2024 11:44:34 GMT (envelope-from git) Date: Tue, 30 Jan 2024 11:44:34 GMT Message-Id: <202401301144.40UBiYPO042879@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Osipov Subject: git: 6455c2cf85a9 - stable/13 - periodic: Make daily diff(1) flags configurable with daily_diff_flags List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: michaelo X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6455c2cf85a920577dfe6bced32f97d9216abc73 Auto-Submitted: auto-generated The branch stable/13 has been updated by michaelo: URL: https://cgit.FreeBSD.org/src/commit/?id=6455c2cf85a920577dfe6bced32f97d9216abc73 commit 6455c2cf85a920577dfe6bced32f97d9216abc73 Author: Michael Osipov AuthorDate: 2023-11-24 09:26:41 +0000 Commit: Michael Osipov CommitDate: 2024-01-30 11:43:54 +0000 periodic: Make daily diff(1) flags configurable with daily_diff_flags PR: 270266 Approved by: jrm (mentor), karels MFC after: 1 month Relnotes: yes Differential Revision: https://reviews.freebsd.org/D42900 (cherry picked from commit 15e35d058cff847d1a7bc671fcf48b99f5d2f73b) --- share/man/man5/periodic.conf.5 | 5 +++++ usr.sbin/periodic/etc/daily/200.backup-passwd | 4 ++-- usr.sbin/periodic/etc/daily/210.backup-aliases | 2 +- usr.sbin/periodic/etc/daily/221.backup-gpart | 2 +- usr.sbin/periodic/etc/daily/222.backup-gmirror | 2 +- usr.sbin/periodic/etc/daily/223.backup-zfs | 2 +- usr.sbin/periodic/periodic.conf | 1 + 7 files changed, 12 insertions(+), 6 deletions(-) diff --git a/share/man/man5/periodic.conf.5 b/share/man/man5/periodic.conf.5 index 6043263f3e3a..1edc8bf14767 100644 --- a/share/man/man5/periodic.conf.5 +++ b/share/man/man5/periodic.conf.5 @@ -645,6 +645,11 @@ but specific to the pool Set to a list of extra scripts that should be run after all other daily scripts. All scripts must be absolute path names. +.It Va daily_diff_flags +.Pq Vt str +Set to the arguments to pass to the +.Xr diff 1 +utility when generating differences. .El .Pp The following variables are used by the standard scripts that reside in diff --git a/usr.sbin/periodic/etc/daily/200.backup-passwd b/usr.sbin/periodic/etc/daily/200.backup-passwd index 44da5993a3a6..e165e7f0f0ed 100755 --- a/usr.sbin/periodic/etc/daily/200.backup-passwd +++ b/usr.sbin/periodic/etc/daily/200.backup-passwd @@ -40,7 +40,7 @@ case "$daily_backup_passwd_enable" in then [ $rc -lt 1 ] && rc=1 echo "$host passwd diffs:" - diff -uI '^#' $bak/master.passwd.bak /etc/master.passwd |\ + diff ${daily_diff_flags:--u} -I '^#' $bak/master.passwd.bak /etc/master.passwd |\ sed 's/^\([-+ ][^:]*\):[^:]*:/\1:(password):/' mv $bak/master.passwd.bak $bak/master.passwd.bak2 cp -p /etc/master.passwd $bak/master.passwd.bak || rc=3 @@ -57,7 +57,7 @@ case "$daily_backup_passwd_enable" in then [ $rc -lt 1 ] && rc=1 echo "$host group diffs:" - diff -u $bak/group.bak /etc/group + diff ${daily_diff_flags:--u} $bak/group.bak /etc/group mv $bak/group.bak $bak/group.bak2 cp -p /etc/group $bak/group.bak || rc=3 fi diff --git a/usr.sbin/periodic/etc/daily/210.backup-aliases b/usr.sbin/periodic/etc/daily/210.backup-aliases index 3b689e3eaa1b..25e2bd021a84 100755 --- a/usr.sbin/periodic/etc/daily/210.backup-aliases +++ b/usr.sbin/periodic/etc/daily/210.backup-aliases @@ -34,7 +34,7 @@ case "$daily_backup_aliases_enable" in then [ $rc -lt 1 ] && rc=1 echo "$host aliases diffs:" - diff -u $bak/aliases.bak /etc/mail/aliases + diff ${daily_diff_flags:--u} $bak/aliases.bak /etc/mail/aliases mv $bak/aliases.bak $bak/aliases.bak2 cp -p /etc/mail/aliases $bak/aliases.bak || rc=3 fi diff --git a/usr.sbin/periodic/etc/daily/221.backup-gpart b/usr.sbin/periodic/etc/daily/221.backup-gpart index da59a6d5d724..50096e38f118 100755 --- a/usr.sbin/periodic/etc/daily/221.backup-gpart +++ b/usr.sbin/periodic/etc/daily/221.backup-gpart @@ -27,7 +27,7 @@ rotate() { rm "${file}.tmp" else rc=1 - [ -n "$show_diff" ] && diff "${file}.bak" "${file}.tmp" + [ -n "$show_diff" ] && diff ${daily_diff_flags} "${file}.bak" "${file}.tmp" mv "${file}.bak" "${file}.bak2" || rc=3 mv "${file}.tmp" "${file}.bak" || rc=3 fi diff --git a/usr.sbin/periodic/etc/daily/222.backup-gmirror b/usr.sbin/periodic/etc/daily/222.backup-gmirror index 866a00497759..45c656dc4f41 100755 --- a/usr.sbin/periodic/etc/daily/222.backup-gmirror +++ b/usr.sbin/periodic/etc/daily/222.backup-gmirror @@ -25,7 +25,7 @@ rotate() { rm "${file}.tmp" else rc=1 - [ -n "$show_diff" ] && diff "${file}.bak" "${file}.tmp" + [ -n "$show_diff" ] && diff ${daily_diff_flags} "${file}.bak" "${file}.tmp" mv "${file}.bak" "${file}.bak2" || rc=3 mv "${file}.tmp" "${file}.bak" || rc=3 fi diff --git a/usr.sbin/periodic/etc/daily/223.backup-zfs b/usr.sbin/periodic/etc/daily/223.backup-zfs index 03876df53f13..a49bbb2eaa04 100755 --- a/usr.sbin/periodic/etc/daily/223.backup-zfs +++ b/usr.sbin/periodic/etc/daily/223.backup-zfs @@ -25,7 +25,7 @@ rotate() { rm "${file}.tmp" else rc=1 - [ -n "$show_diff" ] && diff "${file}.bak" "${file}.tmp" + [ -n "$show_diff" ] && diff ${daily_diff_flags} "${file}.bak" "${file}.tmp" mv "${file}.bak" "${file}.bak2" || rc=3 mv "${file}.tmp" "${file}.bak" || rc=3 fi diff --git a/usr.sbin/periodic/periodic.conf b/usr.sbin/periodic/periodic.conf index 2da2ac1ae384..6f52f3f1aacf 100644 --- a/usr.sbin/periodic/periodic.conf +++ b/usr.sbin/periodic/periodic.conf @@ -31,6 +31,7 @@ anticongestion_sleeptime=3600 # that output. $daily_output might be set to /var/log/daily.log if you # wish to log the daily output and have the files rotated by newsyslog(8) # +daily_diff_flags="" # flags for diff output daily_output="root" # user or /file daily_show_success="YES" # scripts returning 0 daily_show_info="YES" # scripts returning 1 From nobody Tue Jan 30 11:44:35 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPNch0g7pz58hGs; Tue, 30 Jan 2024 11:44: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 4TPNcg6vgXz4PKS; Tue, 30 Jan 2024 11:44:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706615076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gW+bUr8Y2L5MIRQJnrBvPNJ9OoY6ppJGq8kxoHt4fEI=; b=R4VmO1tfNf0BV6GPzqOdHvPPNmG9gP2/oeHt/T6QEZgLGGc5LnTH0mBztMu0yRLDvmR9Fu iJ23Z+nGKq2brWTGh1JmmPW3kPazHgYWcJrcQAkZtl16ihRPV+ExxVrmOCWXxaS3of4s2v /WsU42cM8LdEqLKVM93JVL8Pe9rLeIb7SIVXQ3LlJ1KDwRIN6OsYuKUzy+mYRWwuVXw6E1 aKEBQFEam55bf/sujrpge41Kbx5WyzKEH7KPT/A7nsbieMjvuQOsCHSmCm+4o1aUwbUQYB kSsDeYWnh8pTAuMf/A/zjbt4zYZMrZPGtFVlAZI0wI6Kq2hseRJbVRhkf9egLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706615076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gW+bUr8Y2L5MIRQJnrBvPNJ9OoY6ppJGq8kxoHt4fEI=; b=jfAjXeLhIJ/h/Wn+dW2ykMv4GYKFNdjJzq9g57dbIcwQG5yIDSB3scQHMNFBurT3jLV5B2 9ERqOQ/BY16/LH03FsUzOaTpCQ0zwe46Iqjb8VdnHFZYP5SsMu7vWConKdgCjL8tjbI27v pTHUMFTNoMSYHOu+0sZU1qtFPDyvDbGGAw/J3UuLLHc5ohyNUUH0BF98Li7nKNgnho3vIe cM3ChiMv/sqyQwOYqaxclw/7oEYu8An3sI2yAnXWNuMm/wqpGAFsL5kCWOuLEgc9oRaPdP 2aEkQfjKyh0bc0hXbtUN0I91ZcnYbHQnYC3j+9NYr58oYMMs81T9EYLzQcb4nA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706615076; a=rsa-sha256; cv=none; b=MHJYtaZ+Udq3RKyL7P/bkH6sWxHyBd17JqHKu/bv+zV1tqSC2vBWY+EplLA5OeuhrZdBN5 ZgWGnOw1+0hL5pDXbYSA+arxEpWKWJ9O2rYthV/Dx12M9xwQYvG7noQ00Oomk1R4I3eLYq oYhdv0hdF6cr2mgHwqqVOTVqE3dOx6EUmRFLckPwrOjfDGonupXjaSa9RDEWOcBwU8IOkA 9kj5zfI7+r04bjg/dCY9VNogUHSVRqNTDEJyxOpzs+lDSlU2SHa8gW1y5JYce+aGCtDgEg jLvbDEGGAIww1YrZit7aGcPsAZuUEJhqOv4K4WJ0SBW2Urk0KEVN6FQVUC8Shw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPNcg5yN3zZlK; Tue, 30 Jan 2024 11:44: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 40UBiZi0042944; Tue, 30 Jan 2024 11:44:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UBiZ0S042941; Tue, 30 Jan 2024 11:44:35 GMT (envelope-from git) Date: Tue, 30 Jan 2024 11:44:35 GMT Message-Id: <202401301144.40UBiZ0S042941@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Osipov Subject: git: 4c14a3a6aebe - stable/13 - periodic: Make daily diff(1) output as small is possible List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: michaelo X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4c14a3a6aebe94d61da00c2dac2ef4bb2d9a2b3b Auto-Submitted: auto-generated The branch stable/13 has been updated by michaelo: URL: https://cgit.FreeBSD.org/src/commit/?id=4c14a3a6aebe94d61da00c2dac2ef4bb2d9a2b3b commit 4c14a3a6aebe94d61da00c2dac2ef4bb2d9a2b3b Author: Michael Osipov AuthorDate: 2023-11-24 09:26:41 +0000 Commit: Michael Osipov CommitDate: 2024-01-30 11:44:14 +0000 periodic: Make daily diff(1) output as small is possible Make, by default, daily diff(1) ignore whitespace changes and the unified output a context of zero (0) lines. This reduces output of unrelated lines in e-mails delivered to root. PR: 270266 Approved by: jrm (mentor), karels MFC after: 1 month Relnotes: yes Differential Revision: https://reviews.freebsd.org/D42762 (cherry picked from commit e2f6bafc3887c7752986526f3758525d24701fce) --- share/man/man5/periodic.conf.5 | 3 +++ usr.sbin/periodic/etc/daily/200.backup-passwd | 4 ++-- usr.sbin/periodic/etc/daily/210.backup-aliases | 2 +- usr.sbin/periodic/periodic.conf | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/share/man/man5/periodic.conf.5 b/share/man/man5/periodic.conf.5 index 1edc8bf14767..ab13ad7c2b66 100644 --- a/share/man/man5/periodic.conf.5 +++ b/share/man/man5/periodic.conf.5 @@ -650,6 +650,9 @@ All scripts must be absolute path names. Set to the arguments to pass to the .Xr diff 1 utility when generating differences. +The default is +.Fl b +.Fl U Cm 0 . .El .Pp The following variables are used by the standard scripts that reside in diff --git a/usr.sbin/periodic/etc/daily/200.backup-passwd b/usr.sbin/periodic/etc/daily/200.backup-passwd index e165e7f0f0ed..7cd52fc7be4b 100755 --- a/usr.sbin/periodic/etc/daily/200.backup-passwd +++ b/usr.sbin/periodic/etc/daily/200.backup-passwd @@ -40,7 +40,7 @@ case "$daily_backup_passwd_enable" in then [ $rc -lt 1 ] && rc=1 echo "$host passwd diffs:" - diff ${daily_diff_flags:--u} -I '^#' $bak/master.passwd.bak /etc/master.passwd |\ + diff ${daily_diff_flags} -I '^#' $bak/master.passwd.bak /etc/master.passwd |\ sed 's/^\([-+ ][^:]*\):[^:]*:/\1:(password):/' mv $bak/master.passwd.bak $bak/master.passwd.bak2 cp -p /etc/master.passwd $bak/master.passwd.bak || rc=3 @@ -57,7 +57,7 @@ case "$daily_backup_passwd_enable" in then [ $rc -lt 1 ] && rc=1 echo "$host group diffs:" - diff ${daily_diff_flags:--u} $bak/group.bak /etc/group + diff ${daily_diff_flags} $bak/group.bak /etc/group mv $bak/group.bak $bak/group.bak2 cp -p /etc/group $bak/group.bak || rc=3 fi diff --git a/usr.sbin/periodic/etc/daily/210.backup-aliases b/usr.sbin/periodic/etc/daily/210.backup-aliases index 25e2bd021a84..d236d9615dba 100755 --- a/usr.sbin/periodic/etc/daily/210.backup-aliases +++ b/usr.sbin/periodic/etc/daily/210.backup-aliases @@ -34,7 +34,7 @@ case "$daily_backup_aliases_enable" in then [ $rc -lt 1 ] && rc=1 echo "$host aliases diffs:" - diff ${daily_diff_flags:--u} $bak/aliases.bak /etc/mail/aliases + diff ${daily_diff_flags} $bak/aliases.bak /etc/mail/aliases mv $bak/aliases.bak $bak/aliases.bak2 cp -p /etc/mail/aliases $bak/aliases.bak || rc=3 fi diff --git a/usr.sbin/periodic/periodic.conf b/usr.sbin/periodic/periodic.conf index 6f52f3f1aacf..9fc2ad3af0d0 100644 --- a/usr.sbin/periodic/periodic.conf +++ b/usr.sbin/periodic/periodic.conf @@ -31,7 +31,7 @@ anticongestion_sleeptime=3600 # that output. $daily_output might be set to /var/log/daily.log if you # wish to log the daily output and have the files rotated by newsyslog(8) # -daily_diff_flags="" # flags for diff output +daily_diff_flags="-b -U 0" # flags for diff output daily_output="root" # user or /file daily_show_success="YES" # scripts returning 0 daily_show_info="YES" # scripts returning 1 From nobody Tue Jan 30 14:19:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPS3C3ZJ5z58w4C; Tue, 30 Jan 2024 14:19:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TPS3C33knz4jkw; Tue, 30 Jan 2024 14:19:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706624359; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s8xrfpvTqJW8BmXLjk+tzt3IhcpnWGV+SiKhxQ+DIYA=; b=OYgaU3rivl9SgMH6fKNJRokn91lbQMTfaSBiB/kwkbggRvVCxF0Hr2m0rZkXH9eNQsA15c yYkXDWrGxt2cu8kPSl0CsrjvKdU2IcLI5+5zalV/eWOfjsUka0086ZbgtEtt5CYYezQxJ6 SfDCBTe/vj9xshr5lU4yKDofxrm17QEmwQj9iJgUJOus3PPczDECwA8qI7/GIMPKMN6alS 1vY3iP3h7xRV7c3I9sG4YH30YEcu3lO04CM+Q/cWFz7JhD4u4vtcrIWEq3o9Ucpqcrs0gj wZ349NR7EkSvN+UXIRDYEsMvJ1SK1/IN0YeL29GhnYuS9T0M19d0xlJhBAYfpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706624359; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s8xrfpvTqJW8BmXLjk+tzt3IhcpnWGV+SiKhxQ+DIYA=; b=Uq8TFTA4leQ2L2CCCpXEi+kGn8P0FORKbViPztwcFsb5uaMfwrdU4NvS5dw6Rsowo8ohHu O/opxx3bjPlO47i3z0v2Cda2FXvUk+U5FT8t0ybEvuATjZbkvaam7nb3lfEVZV+mUH0gwA dzUsnspJ41113ipbUWN5TXUA5/NmGANUJbsnoqAUPtFnPIRfR3repEvtwjGPAO421lbOBt JKNLynyTrkQIRzxhdFFKJYDCz1EOoLWITP1MiFvCbatqYZt+jK4xryLC80BiOXOAITJ91K wHornhcKav0ODuW/GsP8XLp0LmxXU5Q9kfSIiJBRnDlwd8N8v5EbEQC5cXJFrg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706624359; a=rsa-sha256; cv=none; b=F79Dzv1hIfUljQgWLyrJ8fEboFrEFIyZoXgobz6luwEunM/bhz93Og4Yi2LVPnQJFPFjWk dYGTK91DlBVoZJ3Q4mgUxQpbAQFhTLp0zcSdcCKQrWVOsYoVEkt9wi4D9xMgQmFL4GxBrd QCNKmESPBch6hzSMSyiovhwHJvNLIm/xx0UnCp1qbl0y7f3Q7aWCaIxvhdBtBo1xMXHnER BULulK+Z8V0QJKQAIqPgExMdeA2cRk9USjCelWR5iZ4GR1+y56VJ1L3UDhpjHoxTVpliTy 4nEdPkYnPd3pfdZAvpC90ZCKIRuviGwINN0KUkI491scqq+7T2Dy8MXkPsGAsQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPS3C26pkzfTn; Tue, 30 Jan 2024 14:19: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 40UEJJlk096474; Tue, 30 Jan 2024 14:19:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UEJJN4096471; Tue, 30 Jan 2024 14:19:19 GMT (envelope-from git) Date: Tue, 30 Jan 2024 14:19:19 GMT Message-Id: <202401301419.40UEJJN4096471@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 91ebe67e90d5 - stable/14 - bhyve: Avoid underflows when handling remote commands List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 91ebe67e90d5859df282aac9c978e54789217b12 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=91ebe67e90d5859df282aac9c978e54789217b12 commit 91ebe67e90d5859df282aac9c978e54789217b12 Author: Mark Johnston AuthorDate: 2024-01-23 16:40:40 +0000 Commit: Mark Johnston CommitDate: 2024-01-30 14:18:53 +0000 bhyve: Avoid underflows when handling remote commands Reviewed by: corvink, jhb MFC after: 1 week Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D43480 (cherry picked from commit cfa2c78aee859bfc6549951bb6a36085fdd374e8) --- usr.sbin/bhyve/gdb.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bhyve/gdb.c b/usr.sbin/bhyve/gdb.c index 9748f7d82b44..cc05a32a5c56 100644 --- a/usr.sbin/bhyve/gdb.c +++ b/usr.sbin/bhyve/gdb.c @@ -1053,6 +1053,8 @@ gdb_read_mem(const uint8_t *data, size_t len) bool started; int error; + assert(len >= 1); + /* Skip 'm' */ data += 1; len -= 1; @@ -1164,6 +1166,8 @@ gdb_write_mem(const uint8_t *data, size_t len) size_t resid, todo, bytes; int error; + assert(len >= 1); + /* Skip 'M' */ data += 1; len -= 1; @@ -1558,7 +1562,7 @@ gdb_query(const uint8_t *data, size_t len) data += strlen("qThreadExtraInfo"); len -= strlen("qThreadExtraInfo"); - if (*data != ',') { + if (len == 0 || *data != ',') { send_error(EINVAL); return; } @@ -1609,7 +1613,7 @@ handle_command(const uint8_t *data, size_t len) case 'H': { int tid; - if (data[1] != 'g' && data[1] != 'c') { + if (len < 2 || (data[1] != 'g' && data[1] != 'c')) { send_error(EINVAL); break; } From nobody Tue Jan 30 14:19:20 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPS3D5BsBz58w8V; Tue, 30 Jan 2024 14:19: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 4TPS3D4N6rz4jvr; Tue, 30 Jan 2024 14:19:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706624360; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l3WjGvebDZUMw3abx54r/DT8rQs/mlQ8qqUjEMtBFLM=; b=i5Ga0rmUbTp0TFgNCOzW1/f/sxt+79YyHWfGe5Ai1i48q8vG8k2yHg5kw1b/zp0k8fCVTp kKFEAO69pSqY/5VnR8aPIb1+Nduwc3Yxy3jOpVyRKfYq+K/d8g+06/XOxM+d7sefV+aUj6 VXvVh8gGF3On1ApnyCMTFgUZ1DvamPkppZyVvj5wnOcxr8YFJoBzUpJDSbCpJU1XCeZ143 hkmW+EuJQCOZjss2HK+s0P5vv7h9nBFKAiIOG3N6jkyyrrRKaGvsggT4WkpNlx8nkQYjjL qeDNqoQsD452rs0VkxpaBkAfKd7GddoDYHW61E9+s3d0HlYwVWOF5DV8e3xgqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706624360; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l3WjGvebDZUMw3abx54r/DT8rQs/mlQ8qqUjEMtBFLM=; b=NhhjwHqLUj+6bDK94D+0dLcdBzgO8C0wpLAOw+mswLWWkJspudl/m7hGRFrzh4eY3xyNFI zxFZMZYBtJ4to//cveZvVqx/IZUZ5Ij9HOL98cy8mTZTVGMHBvSSGEKWWQf98Rra9udW4O QO+NSE+v8ukpE+DmRUcmRAdg1qCYHm0v1cElRb6f/zWhprE36YX5P86W1f7DCPeLgRBlcO T8xtiOWiHBtSnnRlcEPMmtNB1nfx3bZxjOpKUrEc2lVFB8F26VxTqgUxDODbgQFfNdHk3l rpsYvDsDYBSh8vMCpSkpq4aeWiBsD5YPXS78WpVbScsjjCg1zTf8fi9iN0R0+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706624360; a=rsa-sha256; cv=none; b=UVuuFmTDupaEyen/byy6RNjFXQ34EXtiuZsvf1zDp+jezkWZnt+jnteCNYilNa4m3K2hm+ 8ksndE/95anNVNKR2Gi+dutD5EnH5abzWTSMho6AAgOLsPD0/wGAsOOwkhfoa3jDOCeH5h sDPxvEy62qU9WKe70/kJKmQ8AOu0ZJ1jmTlnJDAN3B6ZQRt5gxEqRMskdgIMfEtJvG37kO 2f8u4zpZ18JLHMJRJqjfb8dTYtzGZqn9cx3MXzTxXbaIJTtN+BrkP7u7bEhatuJoGTCHEs /dxUPUXfMW6jESYFW5Ie38pa4KG9KGqahreFlatH4rkY7Lcqf39cs9b2nMDNlQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPS3D36nyzfTp; Tue, 30 Jan 2024 14:19: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 40UEJK8o096519; Tue, 30 Jan 2024 14:19:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UEJKlJ096516; Tue, 30 Jan 2024 14:19:20 GMT (envelope-from git) Date: Tue, 30 Jan 2024 14:19:20 GMT Message-Id: <202401301419.40UEJKlJ096516@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 8c931d6c8db2 - stable/14 - bhyve: Simplify register definitions a bit List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8c931d6c8db27dcdba908dfb0b5713b852d2c1f0 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8c931d6c8db27dcdba908dfb0b5713b852d2c1f0 commit 8c931d6c8db27dcdba908dfb0b5713b852d2c1f0 Author: Mark Johnston AuthorDate: 2024-01-23 16:40:52 +0000 Commit: Mark Johnston CommitDate: 2024-01-30 14:18:54 +0000 bhyve: Simplify register definitions a bit It's awkward to have separate tables for information which is logically connected. Merge the gdb_regset[] and gdb_regsize[] arrays and update gdb_read_regs() to cope with the result. This makes the addition of arm64 support a bit cleaner. No functional change intended. Reviewed by: corvink, jhb MFC after: 1 week Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D43481 (cherry picked from commit 5e728af444b16f480ec0f43803ca2a7a3e6e2e48) --- usr.sbin/bhyve/gdb.c | 89 ++++++++++++++++++++-------------------------------- 1 file changed, 34 insertions(+), 55 deletions(-) diff --git a/usr.sbin/bhyve/gdb.c b/usr.sbin/bhyve/gdb.c index cc05a32a5c56..1b0049c9e6ae 100644 --- a/usr.sbin/bhyve/gdb.c +++ b/usr.sbin/bhyve/gdb.c @@ -135,58 +135,34 @@ static struct vcpu **vcpus; static int cur_vcpu, stopped_vcpu; static bool gdb_active = false; -static const int gdb_regset[] = { - VM_REG_GUEST_RAX, - VM_REG_GUEST_RBX, - VM_REG_GUEST_RCX, - VM_REG_GUEST_RDX, - VM_REG_GUEST_RSI, - VM_REG_GUEST_RDI, - VM_REG_GUEST_RBP, - VM_REG_GUEST_RSP, - VM_REG_GUEST_R8, - VM_REG_GUEST_R9, - VM_REG_GUEST_R10, - VM_REG_GUEST_R11, - VM_REG_GUEST_R12, - VM_REG_GUEST_R13, - VM_REG_GUEST_R14, - VM_REG_GUEST_R15, - VM_REG_GUEST_RIP, - VM_REG_GUEST_RFLAGS, - VM_REG_GUEST_CS, - VM_REG_GUEST_SS, - VM_REG_GUEST_DS, - VM_REG_GUEST_ES, - VM_REG_GUEST_FS, - VM_REG_GUEST_GS -}; - -static const int gdb_regsize[] = { - 8, - 8, - 8, - 8, - 8, - 8, - 8, - 8, - 8, - 8, - 8, - 8, - 8, - 8, - 8, - 8, - 8, - 4, - 4, - 4, - 4, - 4, - 4, - 4 +static const struct gdb_reg { + enum vm_reg_name id; + int size; +} gdb_regset[] = { + { .id = VM_REG_GUEST_RAX, .size = 8 }, + { .id = VM_REG_GUEST_RBX, .size = 8 }, + { .id = VM_REG_GUEST_RCX, .size = 8 }, + { .id = VM_REG_GUEST_RDX, .size = 8 }, + { .id = VM_REG_GUEST_RSI, .size = 8 }, + { .id = VM_REG_GUEST_RDI, .size = 8 }, + { .id = VM_REG_GUEST_RBP, .size = 8 }, + { .id = VM_REG_GUEST_RSP, .size = 8 }, + { .id = VM_REG_GUEST_R8, .size = 8 }, + { .id = VM_REG_GUEST_R9, .size = 8 }, + { .id = VM_REG_GUEST_R10, .size = 8 }, + { .id = VM_REG_GUEST_R11, .size = 8 }, + { .id = VM_REG_GUEST_R12, .size = 8 }, + { .id = VM_REG_GUEST_R13, .size = 8 }, + { .id = VM_REG_GUEST_R14, .size = 8 }, + { .id = VM_REG_GUEST_R15, .size = 8 }, + { .id = VM_REG_GUEST_RIP, .size = 8 }, + { .id = VM_REG_GUEST_RFLAGS, .size = 4 }, + { .id = VM_REG_GUEST_CS, .size = 4 }, + { .id = VM_REG_GUEST_SS, .size = 4 }, + { .id = VM_REG_GUEST_DS, .size = 4 }, + { .id = VM_REG_GUEST_ES, .size = 4 }, + { .id = VM_REG_GUEST_FS, .size = 4 }, + { .id = VM_REG_GUEST_GS, .size = 4 }, }; #ifdef GDB_LOG @@ -1032,15 +1008,18 @@ static void gdb_read_regs(void) { uint64_t regvals[nitems(gdb_regset)]; + int regnums[nitems(gdb_regset)]; + for (size_t i = 0; i < nitems(gdb_regset); i++) + regnums[i] = gdb_regset[i].id; if (vm_get_register_set(vcpus[cur_vcpu], nitems(gdb_regset), - gdb_regset, regvals) == -1) { + regnums, regvals) == -1) { send_error(errno); return; } start_packet(); - for (size_t i = 0; i < nitems(regvals); i++) - append_unsigned_native(regvals[i], gdb_regsize[i]); + for (size_t i = 0; i < nitems(gdb_regset); i++) + append_unsigned_native(regvals[i], gdb_regset[i].size); finish_packet(); } From nobody Tue Jan 30 14:19:21 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPS3G3sLGz58w6b; Tue, 30 Jan 2024 14:19: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 4TPS3F6Xp8z4jtB; Tue, 30 Jan 2024 14:19:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706624361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sIovrin/oUHN5YY8y0PyWj27M9Remf8Rfp+J5nGQ+2w=; b=mCwaDf2R3EJTyH4J/aKdGklTFqPqjyHhS0No/bD/VlX2jdwnkdbLESl8xIindAdHUdosuz PUgFQdvuAt+iRTiZTemXSou7UjECmZ8oAbvN2ctrlwx3pC+xnKbfFiWAugNfcJ251vTCDZ tZLM9w8dlBByYDqPJXij14u7u+dOmimj7jrX0QjohqwVsLxVppZey9Y1zZ4lZPQ4Jhki47 yhDH35i+HMfG5aVNcc0fu9LjzGnbqGVMV0Wdq1gbihqseSYckCriBkpN87Sq98o84m4QgR yFlFPOXTdHxqeDu+UwLgsPr8w3JEk3gSPAinNyCdmhDLCL3ucYZpGZmEwDf2VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706624361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sIovrin/oUHN5YY8y0PyWj27M9Remf8Rfp+J5nGQ+2w=; b=qhjDH30wOcs8AbH+Rp0CRmQEvgZyepddyvNCoJjuwygkSgJDii0Kd77Ki3FJBDPboYIKyK H8O044fnt5kJs5DXI6hM3WJvHi1YwXPoASiX6h7ivD4+Yt8ZHwws0tUV7Q1FSfRsWddXyw vWzuOm+Ww6Fx0FneZ3dHo8YxPb6SuGNgeigNTUypDHOOLfvbGeBWneRcfI29AqiVta8zb/ 2L+9tpUzDfvh8BC4ucz4ANFhyRE0Wz7wGmv9eJJdyyiOnCyaeSdcw4SH0tMbC6fb05UTfu 4/jSfzWw4xOFm6TN8vKpS94xdvotyW3mk8C9gNmlpgFl0CKVxH8eMkfbIn6S+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706624361; a=rsa-sha256; cv=none; b=yyiDoH6FeEg5mf/qfE8aRz/fP/BSzdJKzDQgbHNh7dol8Jc1mFZXiukpVhTCOPrUjUzlgq g2W1F+230LzWEpnHvz411TRq5c1pKjJ8QaHczrgYhUDCrx9Xgv/rJt2LHn30TvCL7MXQdx iBc258nINIrDSofsPZB1U7QZ1UyZiJaU8R7X7nCffKBabp7lohfM3VSwIblcORKwbkzfs2 kI73bCnCjIpdV29ul/N02a8JTHADacMrDIGpVVObfyK2LsZvXWRu4duV1VUQEa4lPFLzTh WE1bH/eVmY/xfbkCVh7kv+i3o3p3q2ZH5CZTn3aqzHu/qgGffTXAQgsdmaTjjA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPS3F48nWzf5x; Tue, 30 Jan 2024 14:19: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 40UEJL17096583; Tue, 30 Jan 2024 14:19:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UEJLW8096580; Tue, 30 Jan 2024 14:19:21 GMT (envelope-from git) Date: Tue, 30 Jan 2024 14:19:21 GMT Message-Id: <202401301419.40UEJLW8096580@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 596fe0bdc9f6 - stable/14 - bhyve: Prepare to add arm64 support to the gdb stub List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 596fe0bdc9f656c856c597c1b179317a587e7d86 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=596fe0bdc9f656c856c597c1b179317a587e7d86 commit 596fe0bdc9f656c856c597c1b179317a587e7d86 Author: Mark Johnston AuthorDate: 2024-01-23 16:41:13 +0000 Commit: Mark Johnston CommitDate: 2024-01-30 14:18:55 +0000 bhyve: Prepare to add arm64 support to the gdb stub In particular: - Stop assuming that the breakpoint size is one byte. - Avoid referencing the "rip" field in machine-independent code, use a helper. No functional change intended. Reviewed by: corvink, jhb MFC after: 1 week Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D43483 (cherry picked from commit 5f086566e02a3d21dc840564b90d46f1d3b829bb) --- usr.sbin/bhyve/gdb.c | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/usr.sbin/bhyve/gdb.c b/usr.sbin/bhyve/gdb.c index 1b0049c9e6ae..f2976622c79a 100644 --- a/usr.sbin/bhyve/gdb.c +++ b/usr.sbin/bhyve/gdb.c @@ -70,6 +70,13 @@ */ #define GDB_SIGNAL_TRAP 5 +#define GDB_BP_SIZE 1 +#define GDB_BP_INSTR (uint8_t []){0xcc} +#define GDB_PC_REGNAME VM_REG_GUEST_RIP + +_Static_assert(sizeof(GDB_BP_INSTR) == GDB_BP_SIZE, + "GDB_BP_INSTR has wrong size"); + static void gdb_resume_vcpus(void); static void check_command(int fd); @@ -96,7 +103,7 @@ struct io_buffer { struct breakpoint { uint64_t gpa; - uint8_t shadow_inst; + uint8_t shadow_inst[GDB_BP_SIZE]; TAILQ_ENTRY(breakpoint) link; }; @@ -264,6 +271,12 @@ guest_vaddr2paddr(struct vcpu *vcpu, uint64_t vaddr, uint64_t *paddr) return (1); } +static uint64_t +guest_pc(struct vm_exit *vme) +{ + return (vme->rip); +} + static void io_buffer_reset(struct io_buffer *io) { @@ -932,7 +945,7 @@ gdb_cpu_breakpoint(struct vcpu *vcpu, struct vm_exit *vmexit) } vcpuid = vcpu_id(vcpu); pthread_mutex_lock(&gdb_lock); - error = guest_vaddr2paddr(vcpu, vmexit->rip, &gpa); + error = guest_vaddr2paddr(vcpu, guest_pc(vmexit), &gpa); assert(error == 1); bp = find_breakpoint(gpa); if (bp != NULL) { @@ -941,11 +954,11 @@ gdb_cpu_breakpoint(struct vcpu *vcpu, struct vm_exit *vmexit) assert(vs->stepped == false); assert(vs->hit_swbreak == false); vs->hit_swbreak = true; - vm_set_register(vcpu, VM_REG_GUEST_RIP, vmexit->rip); + vm_set_register(vcpu, GDB_PC_REGNAME, guest_pc(vmexit)); for (;;) { if (stopped_vcpu == -1) { debug("$vCPU %d reporting breakpoint at rip %#lx\n", - vcpuid, vmexit->rip); + vcpuid, guest_pc(vmexit)); stopped_vcpu = vcpuid; gdb_suspend_vcpus(); } @@ -964,7 +977,7 @@ gdb_cpu_breakpoint(struct vcpu *vcpu, struct vm_exit *vmexit) gdb_cpu_resume(vcpu); } else { debug("$vCPU %d injecting breakpoint at rip %#lx\n", vcpuid, - vmexit->rip); + guest_pc(vmexit)); error = vm_set_register(vcpu, VM_REG_GUEST_ENTRY_INST_LENGTH, vmexit->u.bpt.inst_length); assert(error == 0); @@ -1278,8 +1291,8 @@ remove_all_sw_breakpoints(void) TAILQ_FOREACH_SAFE(bp, &breakpoints, link, nbp) { debug("remove breakpoint at %#lx\n", bp->gpa); - cp = paddr_guest2host(ctx, bp->gpa, 1); - *cp = bp->shadow_inst; + cp = paddr_guest2host(ctx, bp->gpa, sizeof(bp->shadow_inst)); + memcpy(cp, bp->shadow_inst, sizeof(bp->shadow_inst)); TAILQ_REMOVE(&breakpoints, bp, link); free(bp); } @@ -1295,7 +1308,7 @@ update_sw_breakpoint(uint64_t gva, int kind, bool insert) uint8_t *cp; int error; - if (kind != 1) { + if (kind != GDB_BP_SIZE) { send_error(EINVAL); return; } @@ -1310,7 +1323,7 @@ update_sw_breakpoint(uint64_t gva, int kind, bool insert) return; } - cp = paddr_guest2host(ctx, gpa, 1); + cp = paddr_guest2host(ctx, gpa, sizeof(bp->shadow_inst)); /* Only permit breakpoints in guest RAM. */ if (cp == NULL) { @@ -1334,15 +1347,15 @@ update_sw_breakpoint(uint64_t gva, int kind, bool insert) } bp = malloc(sizeof(*bp)); bp->gpa = gpa; - bp->shadow_inst = *cp; - *cp = 0xcc; /* INT 3 */ + memcpy(bp->shadow_inst, cp, sizeof(bp->shadow_inst)); + memcpy(cp, GDB_BP_INSTR, sizeof(bp->shadow_inst)); TAILQ_INSERT_TAIL(&breakpoints, bp, link); debug("new breakpoint at %#lx\n", gpa); } } else { if (bp != NULL) { debug("remove breakpoint at %#lx\n", gpa); - *cp = bp->shadow_inst; + memcpy(cp, bp->shadow_inst, sizeof(bp->shadow_inst)); TAILQ_REMOVE(&breakpoints, bp, link); free(bp); if (TAILQ_EMPTY(&breakpoints)) From nobody Tue Jan 30 14:19:35 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPS3X4mJDz58vyf; Tue, 30 Jan 2024 14:19: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 4TPS3X1WQGz4kht; Tue, 30 Jan 2024 14:19:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706624376; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=947GsZtzOQOOdiLemwtax8h5uXxqhX4Pb9HYQWGzLMI=; b=ceVQhM8Pjw2WCG5RWFlQfc7iXE5zL6RhvBBs4+Hyw04G4O2Q8SPerErXA01V9Xuc+Zb737 2HDPUmC42wb5blzDYVJLgRIJ37Vn0VCTEYJX8bkF8T0K89ZIuxNDSOMTFnBGP3f1kFj/iS +CNXcH7POvLES36vLflm637/TIUnLWshl3LXfeYGiIbKG/jyQh1zltqAV95a9krmENo8Fx lM8+/XYq7zaBIJd6+be89YVnJXJ2SKxboZbh7Ny+BzVmoEJyW3oIZ27feufaori23KtFTd QBlUB/sATQiThr7PHRCGSbul1N/HBIUavk2G56XKsl7kAnbDwJrqY5M5+o2V1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706624376; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=947GsZtzOQOOdiLemwtax8h5uXxqhX4Pb9HYQWGzLMI=; b=rfW7b+tFBEMOMD6a0vV4tncFCntZLhvNsI+hPHlGouZn7Sj8Kyhcfijzv0xknMhWyjXzOA jReDofmah8FHWQ72JmKhyaIwqXpDt/LE8xpu2z3dyHVnihVgYtbTkKRt7oGG8xmZJuG0Pd 865R8dC9MKuij/QiFoi1aGFRSIh6bl/NhFruEjwBHeWFesmgh3fkb4pUQJNpmVP2/3JXTC eM5YuCMjYyhFnCQv6Cw//ET5xqvb0ub6tVkQ7UXkymdXJC01fetxxju8/DqjLA3JpydDtw S4uDLWQos/TuE9n/80taHloASLI9m9YijoAp0dzZ+g50ZPooZRPuVAM8sDlMJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706624376; a=rsa-sha256; cv=none; b=DZBteJIxqyA3/AEjkKqmhFmh+LXWIFH7BCj/tuekPiTBsN+OPOYvZKTQOkVRkDilk3l26S f1W2CQDdr1QHIKf+46ZKNLCuCy03xA/SW0FNV0rHF1ezWC+jEBGCKMRts5NXzfR5kyIpsC A7XkYYCw+5bqHMj04sdG91XDYw7z9C6vj7Qc5FyGU55g4A/GEbn3/dCbaS/63YmJDlS1LZ YMQDIEQfeVSUTsHkswUW5Ht0BiX3nrcObS9RNi6ziCPplEWkOkMVb6yV9DN3YBUJF7Lyhs YKF6bBXWFcoi/9Uc+dY37SyXnQZjvRIEMzw7plnbS8Xr54GQTm9/3aUEkJtwZg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPS3X0Vd3zfX5; Tue, 30 Jan 2024 14:19: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 40UEJZZh096754; Tue, 30 Jan 2024 14:19:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UEJZCu096751; Tue, 30 Jan 2024 14:19:35 GMT (envelope-from git) Date: Tue, 30 Jan 2024 14:19:35 GMT Message-Id: <202401301419.40UEJZCu096751@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 83b800c59020 - stable/13 - bhyve: Avoid underflows when handling remote commands List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 83b800c59020f4b208666459896281d385fdc557 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=83b800c59020f4b208666459896281d385fdc557 commit 83b800c59020f4b208666459896281d385fdc557 Author: Mark Johnston AuthorDate: 2024-01-23 16:40:40 +0000 Commit: Mark Johnston CommitDate: 2024-01-30 14:19:28 +0000 bhyve: Avoid underflows when handling remote commands Reviewed by: corvink, jhb MFC after: 1 week Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D43480 (cherry picked from commit cfa2c78aee859bfc6549951bb6a36085fdd374e8) --- usr.sbin/bhyve/gdb.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bhyve/gdb.c b/usr.sbin/bhyve/gdb.c index cec9ac92ac1c..62f16998450f 100644 --- a/usr.sbin/bhyve/gdb.c +++ b/usr.sbin/bhyve/gdb.c @@ -983,6 +983,8 @@ gdb_read_mem(const uint8_t *data, size_t len) bool started; int error; + assert(len >= 1); + /* Skip 'm' */ data += 1; len -= 1; @@ -1094,6 +1096,8 @@ gdb_write_mem(const uint8_t *data, size_t len) size_t resid, todo, bytes; int error; + assert(len >= 1); + /* Skip 'M' */ data += 1; len -= 1; @@ -1488,7 +1492,7 @@ gdb_query(const uint8_t *data, size_t len) data += strlen("qThreadExtraInfo"); len -= strlen("qThreadExtraInfo"); - if (*data != ',') { + if (len == 0 || *data != ',') { send_error(EINVAL); return; } @@ -1539,7 +1543,7 @@ handle_command(const uint8_t *data, size_t len) case 'H': { int tid; - if (data[1] != 'g' && data[1] != 'c') { + if (len < 2 || (data[1] != 'g' && data[1] != 'c')) { send_error(EINVAL); break; } From nobody Tue Jan 30 14:31:13 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPSJx6nLyz58x00; Tue, 30 Jan 2024 14: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 4TPSJx6JhNz4mKY; Tue, 30 Jan 2024 14: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=1706625073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K33teYIhHghiqd9o1tq/DLILVO6jAXGEpQqi9btMGYA=; b=B0NmwXoK2j7h5A2hxIuJsLJsQSW0JQjVltWGlDGAgv2VGm/dNCg242qYv0SMzN0mNiUEdZ VLFAE10PorPb/lFsk7pFlqzW+BhRnhe+vtZ07MGjW4pbrWm5eKVP5KYFKoMjLt+H1l3ijg DB37SoGi2k2MW0COTVFI+dnM0m7pRwKWUKULrrzBatpVZ+BIX7L3RFqFZNFwZhmIKeQJGO jQbS5TEkqEXEcWHd8CEtCxUUt+Wkwt4Ddqyv8/Biqtg9nXPVoJvcHPEQh2qJdgIzpeuPTP TRYImp4TvUqtAPyNnTGYGqOVuH9DHWrVxbWLb/FI58lAInsY8OVtijGHMltmmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706625073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K33teYIhHghiqd9o1tq/DLILVO6jAXGEpQqi9btMGYA=; b=IQ7na6x0tQxC7z5B+GDw7ljvNiWlhMAaqG+mzOeD+6qjx41BwWuqLs2VQceOzlLTVEfG43 +cm+DAEZ6zm16moa+vGE4yl3tk5ssWA0MOTDGS/I1f9UvM8iOQH+RJnxSxyDI/sKIWeVNA bqmI8uoBhgzghtHL2kTe7xIl/VT80e+KIZnbwUH/bfixGXVRicBeGofOlNTYdD2vAqLKsE f4ngfa6vndZQjGyUh7U29N87foObKNDR1CDkNcvLj1SgieCzTjRw3hZl28dKNlBtSyi2ti v5ez3jPOS0xCldZergoZkmW2YdWLmFEhvnig2iEHHJIzckLHZXBcOQbKDzLJnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706625073; a=rsa-sha256; cv=none; b=D84rfPoBdnbbmixGgLnaWjZ5ebS5Sl/elv/rziwZ6cisgZOBpxzp7UdLem/yoGdRO05Y/c EaGHg9jZEoUw6kRuaowHixwOd20M/1sseuFn2hjWZ+iqv+38hcuIGXYbqFc205aONDEFz7 r0cGG/v2PkPiCCOJxpyrHwuxGk6/FsNE07QanH3s1KEOLS43u1U7Km8FKGWEPdPEjkM1j8 DrlMciTbLRtaOLreqGkZDYFY3/AKSIv070ClxYZEsmN/btmrZeRTH5X+EgdmTNSxd8F0li Km2wn66+pMngmQ7K+B5++qJy8H1hGX3+n7TGWYkeCTykNFrI1rXZaLr15fTsTw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPSJx5FgXzftG; Tue, 30 Jan 2024 14: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 40UEVDS7024050; Tue, 30 Jan 2024 14: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 40UEVDEl024047; Tue, 30 Jan 2024 14:31:13 GMT (envelope-from git) Date: Tue, 30 Jan 2024 14:31:13 GMT Message-Id: <202401301431.40UEVDEl024047@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: f0122974fba0 - stable/13 - amdsmn(4), amdtemp(4): add support for Zen 4 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f0122974fba0cee78e8bd86351803d855ce85758 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f0122974fba0cee78e8bd86351803d855ce85758 commit f0122974fba0cee78e8bd86351803d855ce85758 Author: Akio Morita AuthorDate: 2023-08-01 20:32:12 +0000 Commit: Mark Johnston CommitDate: 2024-01-30 14:26:29 +0000 amdsmn(4), amdtemp(4): add support for Zen 4 Zen 4 support, tested on Ryzen 9 7900 Reviewed by: imp (previous version), mhorne Approved by: mhorne Obtained from: http://jyurai.ddo.jp/~amorita/diary/?date=20221102#p01 Differential Revision: https://reviews.freebsd.org/D41049 (cherry picked from commit 323a94afb6236bcec3a07721566aec6f2ea2b209) --- sys/dev/amdsmn/amdsmn.c | 7 +++++++ sys/dev/amdtemp/amdtemp.c | 17 +++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/sys/dev/amdsmn/amdsmn.c b/sys/dev/amdsmn/amdsmn.c index c38a549756c5..7737a3c3fa4c 100644 --- a/sys/dev/amdsmn/amdsmn.c +++ b/sys/dev/amdsmn/amdsmn.c @@ -59,6 +59,7 @@ #define PCI_DEVICE_ID_AMD_17H_M10H_ROOT 0x15d0 #define PCI_DEVICE_ID_AMD_17H_M30H_ROOT 0x1480 /* Also M70H, F19H M00H/M20H */ #define PCI_DEVICE_ID_AMD_17H_M60H_ROOT 0x1630 +#define PCI_DEVICE_ID_AMD_19H_M60H_ROOT 0x14d8 struct pciid; struct amdsmn_softc { @@ -102,6 +103,12 @@ static const struct pciid { .amdsmn_addr_reg = F17H_SMN_ADDR_REG, .amdsmn_data_reg = F17H_SMN_DATA_REG, }, + { + .amdsmn_vendorid = CPU_VENDOR_AMD, + .amdsmn_deviceid = PCI_DEVICE_ID_AMD_19H_M60H_ROOT, + .amdsmn_addr_reg = F17H_SMN_ADDR_REG, + .amdsmn_data_reg = F17H_SMN_DATA_REG, + }, }; /* diff --git a/sys/dev/amdtemp/amdtemp.c b/sys/dev/amdtemp/amdtemp.c index 2ead5ba96cf5..2fdecead6c0f 100644 --- a/sys/dev/amdtemp/amdtemp.c +++ b/sys/dev/amdtemp/amdtemp.c @@ -82,6 +82,7 @@ struct amdtemp_softc { #define AMDTEMP_FLAG_CT_10BIT 0x02 /* CurTmp is 10-bit wide. */ #define AMDTEMP_FLAG_ALT_OFFSET 0x04 /* CurTmp starts at -28C. */ int32_t sc_offset; + int32_t sc_temp_base; int32_t (*sc_gettemp)(device_t, amdsensor_t); struct sysctl_oid *sc_sysctl_cpu[MAXCPU]; struct intr_config_hook sc_ich; @@ -109,6 +110,7 @@ struct amdtemp_softc { #define DEVICEID_AMD_HOSTB17H_M10H_ROOT 0x15d0 #define DEVICEID_AMD_HOSTB17H_M30H_ROOT 0x1480 /* Also M70H, F19H M00H/M20H */ #define DEVICEID_AMD_HOSTB17H_M60H_ROOT 0x1630 +#define DEVICEID_AMD_HOSTB19H_M60H_ROOT 0x14d8 static const struct amdtemp_product { uint16_t amdtemp_vendorid; @@ -133,6 +135,7 @@ static const struct amdtemp_product { { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_M10H_ROOT, false }, { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_M30H_ROOT, false }, { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_M60H_ROOT, false }, + { VENDORID_AMD, DEVICEID_AMD_HOSTB19H_M60H_ROOT, false }, }; /* @@ -178,6 +181,8 @@ static const struct amdtemp_product { #define AMDTEMP_17H_CCD_TMP_BASE 0x59954 #define AMDTEMP_17H_CCD_TMP_VALID (1u << 11) +#define AMDTEMP_ZEN4_CCD_TMP_BASE 0x59b08 + /* * AMD temperature range adjustment, in deciKelvins (i.e., 49.0 Celsius). */ @@ -519,6 +524,8 @@ amdtemp_attach(device_t dev) dev, CORE0_SENSOR0, amdtemp_sysctl, "IK", "Core 0 / Sensor 0 temperature"); + sc->sc_temp_base = AMDTEMP_17H_CCD_TMP_BASE; + if (family == 0x17) amdtemp_probe_ccd_sensors17h(dev, model); else if (family == 0x19) @@ -780,7 +787,7 @@ amdtemp_gettemp17h(device_t dev, amdsensor_t sensor) return (amdtemp_decode_fam17h_tctl(sc->sc_offset, val)); case CCD_BASE ... CCD_MAX: /* Tccd */ - error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CCD_TMP_BASE + + error = amdsmn_read(sc->sc_smn, sc->sc_temp_base + (((int)sensor - CCD_BASE) * sizeof(val)), &val); KASSERT(error == 0, ("amdsmn_read2")); KASSERT((val & AMDTEMP_17H_CCD_TMP_VALID) != 0, @@ -801,7 +808,7 @@ amdtemp_probe_ccd_sensors(device_t dev, uint32_t maxreg) sc = device_get_softc(dev); for (i = 0; i < maxreg; i++) { - error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CCD_TMP_BASE + + error = amdsmn_read(sc->sc_smn, sc->sc_temp_base + (i * sizeof(val)), &val); if (error != 0) continue; @@ -846,6 +853,7 @@ amdtemp_probe_ccd_sensors17h(device_t dev, uint32_t model) static void amdtemp_probe_ccd_sensors19h(device_t dev, uint32_t model) { + struct amdtemp_softc *sc = device_get_softc(dev); uint32_t maxreg; switch (model) { @@ -854,6 +862,11 @@ amdtemp_probe_ccd_sensors19h(device_t dev, uint32_t model) maxreg = 8; _Static_assert((int)NUM_CCDS >= 8, ""); break; + case 0x60 ... 0x6f: /* Zen4 Ryzen "Raphael" */ + sc->sc_temp_base = AMDTEMP_ZEN4_CCD_TMP_BASE; + maxreg = 8; + _Static_assert((int)NUM_CCDS >= 8, ""); + break; default: device_printf(dev, "Unrecognized Family 19h Model: %02xh\n", model); From nobody Tue Jan 30 17:11:25 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPWsn2v07z59ByL; Tue, 30 Jan 2024 17:11: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 4TPWsn2MBMz4DxC; Tue, 30 Jan 2024 17:11:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706634685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VskOxNNwlUsYruJzlJdTeCch6S3tCeplWfP5xxct8jk=; b=F5tmCRI0aIOnVjp87DmRBhiUbmPZyMkTq5R27nxyV6uhIs1C/KzEzSiii9RciASB65uQqn LB5J3A4cud1P9+c04SwQfgFNC8ylDLBND+5KHE1aBWku8fq28IdqnXX9vPnAcf+HI22WtR HPEG8QZQ6pL1eVPif9Hc5bPZzsqDw5nTZLKtIsjeXiTN0/OwjqUSzO+374eCiFd/pINF9Z T0VBz7Gy0s0pm6B8BgHxiRLSFxbVDj64QXKmeTSlRO3ioUtsymvK/Tuq0/X1zgyyoiHA8Z 3Yjmrjbzojd05cAW+0hphkZHPxIJThIAo1xzuNabb0gFZmZlpHLMbyCKsHP4Ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706634685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VskOxNNwlUsYruJzlJdTeCch6S3tCeplWfP5xxct8jk=; b=Ec0E8jzzaK9R9O8sPU2YOM3dtf4/7rTNgJKasz4sRgn2qDqzsJ/X6NibyT3/dYYml5mPVx nG3UitqtsYzu1ybRXmAhNBJ4u7qzC/NcbyBpwxBdCpzVkoet3xyJKqg9AhUH5RgYoqqMdp aFZw5BKiwef2qloV8LucKRY9NQkZQGxLWABW+pdUGAuqDq3zOE17QPxcbzgSItFSVrZlYu gu5pZC+uyGq3pwrbR8T+EQk/fO2qKtcYUoOArsTE/+QMoEoHS1ssM8OByCZTov2rZgdXOJ SYclHLrXya74EFzpUuVmWRAkXktlbWmNdcj8BrVSqLnrpgu797b95ZIJ/kw2hg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706634685; a=rsa-sha256; cv=none; b=oXruFTq9WHe4GDxE7urOskFMC9lnGtaljwXUIjNTjgNUnbtT2KJi8rfCK4tehod3FKLIgc gbDnh1Q5iVhhhqPDZee9kkyLPMf/mHdadI8VBHzC1v6kW9HIfQU07u/RnJDwdcLqIkdupq S3f0agAuJ80SKF2UZH9TZWaoJ7FCC0jCoVBoQq3ok2HfQd90e2yCGDtZYg4GqmP4b8E5v2 KhcIKjA+eXKfFXXy7jHoUup6CR/B6Yc3cmlgHTEAqk5m/6/UlGUOByrU3pMCgF8Dt8vsHG y9R+lZIJw8F1CwM4N5wztVYGBDNoVbCSGjJDps3Dfhs/jgyplsrKyD8/89fWeA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPWsn15mZzkG2; Tue, 30 Jan 2024 17:11: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 40UHBPY6093552; Tue, 30 Jan 2024 17:11:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UHBP1p093549; Tue, 30 Jan 2024 17:11:25 GMT (envelope-from git) Date: Tue, 30 Jan 2024 17:11:25 GMT Message-Id: <202401301711.40UHBP1p093549@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 2a05c2033908 - stable/13 - kern: tty: fix EOF handling for canonical reads List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 2a05c20339082c19e64f9027f80706b8d24a082d Auto-Submitted: auto-generated The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=2a05c20339082c19e64f9027f80706b8d24a082d commit 2a05c20339082c19e64f9027f80706b8d24a082d Author: Kyle Evans AuthorDate: 2024-01-16 02:55:58 +0000 Commit: Kyle Evans CommitDate: 2024-01-30 17:11:09 +0000 kern: tty: fix EOF handling for canonical reads If the read(2) buffer is one byte short of an EOF, then we'll end up reading the line into the buffer, then re-entering and seeing an EOF at the beginning of the inq, assuming it's a zero-length line. Fix this corner-case by searching one more byte than we have available for an EOF. If we found it, then we'll trim it here; otherwise, we'll limit our read to just the space we have in the out buffer and the next read(2) will (potentially) read the remainder of the line. Fix FIONREAD while we're here to match what an application can expect read(2) to return -- scan for the first break character in the part of the input that's been canonicalized, we'll never return more than that. PR: 276220 Reviewed by: cy, imp (both previous version), kib (cherry picked from commit d51dac5f1370bdca1ea20c6b48cdea463f6f5dda) --- sys/kern/tty.c | 2 +- sys/kern/tty_ttydisc.c | 72 ++++++++++++++++++++++++++++++++++++++++++++------ sys/sys/ttydisc.h | 1 + 3 files changed, 66 insertions(+), 9 deletions(-) diff --git a/sys/kern/tty.c b/sys/kern/tty.c index eaf69446afa2..d46462842038 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -1671,7 +1671,7 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *data, int fflag, /* This device supports non-blocking operation. */ return (0); case FIONREAD: - *(int *)data = ttyinq_bytescanonicalized(&tp->t_inq); + *(int *)data = ttydisc_bytesavail(tp); return (0); case FIONWRITE: case TIOCOUTQ: diff --git a/sys/kern/tty_ttydisc.c b/sys/kern/tty_ttydisc.c index cb5bf672d040..04d99c336438 100644 --- a/sys/kern/tty_ttydisc.c +++ b/sys/kern/tty_ttydisc.c @@ -113,15 +113,20 @@ ttydisc_close(struct tty *tp) ttyhook_close(tp); } -static int -ttydisc_read_canonical(struct tty *tp, struct uio *uio, int ioflag) +/* + * Populate our break array; it should likely be at least 4 bytes in size to + * allow for \n, VEOF, and VEOL. + */ +static void +ttydisc_read_break(struct tty *tp, char *breakc, size_t breaksz) { - char breakc[4] = { CNL }; /* enough to hold \n, VEOF and VEOL. */ - int error; - size_t clen, flen = 0, n = 1; - unsigned char lastc = _POSIX_VDISABLE; + size_t n = 0; + MPASS(breaksz != 0); + + breakc[n++] = CNL; #define BREAK_ADD(c) do { \ + MPASS(n < breaksz - 1); /* NUL terminated */ \ if (tp->t_termios.c_cc[c] != _POSIX_VDISABLE) \ breakc[n++] = tp->t_termios.c_cc[c]; \ } while (0) @@ -129,7 +134,48 @@ ttydisc_read_canonical(struct tty *tp, struct uio *uio, int ioflag) BREAK_ADD(VEOF); BREAK_ADD(VEOL); #undef BREAK_ADD + breakc[n] = '\0'; +} + +size_t +ttydisc_bytesavail(struct tty *tp) +{ + size_t clen; + char breakc[4]; + unsigned char lastc = _POSIX_VDISABLE; + + clen = ttyinq_bytescanonicalized(&tp->t_inq); + if (!CMP_FLAG(l, ICANON) || clen == 0) + return (clen); + + ttydisc_read_break(tp, &breakc[0], sizeof(breakc)); + clen = ttyinq_findchar(&tp->t_inq, breakc, clen, &lastc); + + /* + * We might have a partial line canonicalized in the input queue if we, + * for instance, switched to ICANON after taking some input in raw mode. + * In this case, read(2) will block because we only have a partial line. + */ + if (lastc == _POSIX_VDISABLE) + return (0); + + /* If VEOF was our terminal, it must be discarded (not counted). */ + if (CMP_CC(VEOF, lastc)) + clen--; + + return (clen); +} + +static int +ttydisc_read_canonical(struct tty *tp, struct uio *uio, int ioflag) +{ + char breakc[4]; /* enough to hold \n, VEOF and VEOL. */ + int error; + size_t clen, flen = 0; + unsigned char lastc = _POSIX_VDISABLE; + + ttydisc_read_break(tp, &breakc[0], sizeof(breakc)); do { error = tty_wait_background(tp, curthread, SIGTTIN); @@ -154,7 +200,7 @@ ttydisc_read_canonical(struct tty *tp, struct uio *uio, int ioflag) * cause the TTY layer to return data in chunks using * the blocksize (except the first and last blocks). */ - clen = ttyinq_findchar(&tp->t_inq, breakc, uio->uio_resid, + clen = ttyinq_findchar(&tp->t_inq, breakc, uio->uio_resid + 1, &lastc); /* No more data. */ @@ -170,10 +216,20 @@ ttydisc_read_canonical(struct tty *tp, struct uio *uio, int ioflag) continue; } - /* Don't send the EOF char back to userspace. */ + /* + * Don't send the EOF char back to userspace. Our above call to + * ttyinq_findchar overreads by 1 character in case we would + * otherwise be leaving an EOF for the next read(). We'll trim + * clen back down to uio_resid whether we find our EOF or not. + */ if (CMP_CC(VEOF, lastc)) flen = 1; + /* + * Trim clen back down to the buffer size, since we had + * intentionally over-read. + */ + clen = MIN(uio->uio_resid + flen, clen); MPASS(flen <= clen); /* Read and throw away the EOF character. */ diff --git a/sys/sys/ttydisc.h b/sys/sys/ttydisc.h index 0458fae6e34b..81d436139555 100644 --- a/sys/sys/ttydisc.h +++ b/sys/sys/ttydisc.h @@ -44,6 +44,7 @@ struct uio; /* Top half routines. */ void ttydisc_open(struct tty *tp); void ttydisc_close(struct tty *tp); +size_t ttydisc_bytesavail(struct tty *tp); int ttydisc_read(struct tty *tp, struct uio *uio, int ioflag); int ttydisc_write(struct tty *tp, struct uio *uio, int ioflag); void ttydisc_optimize(struct tty *tp); From nobody Tue Jan 30 17:11:26 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPWsp6hdrz59Bv4; Tue, 30 Jan 2024 17:11: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 4TPWsp2vFQz4F2d; Tue, 30 Jan 2024 17:11:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706634686; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=12mMrBwnJqOzbJMsYPBu2SrxBQMqbOfg9jI2CQgtjeo=; b=Q8m7/71A+ubhxVlCX2HAJHP8Xnoej3Ae6qf7gpfT6R0e0FeIoKbcDPzV50wF7kEhbdEcyl g9BE5o4w+gCllRpXa3OsnA3BcHTF6I9ypsP0l23PV2NWlm/6l0ylP0d45RXrHl0DnRRY45 TB66JLLXjBBrvdmJUEf5/dkX9RCmbHE9xP67ljj3oS5Tkci9cHFJ0BV3tX7x6zYbbxbIhH U4mLzj+mouSrvyCErW/aRM9iA3LABX/wWfaSBkfFfpsSv3lYKqr+dQVeBhf0UINzSQNe0F nkjEJ8eCBV1m/OUYKPHLMl9HNr3Xk60QKnpfF97ypuXKHeNolokKNjAl/AkcSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706634686; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=12mMrBwnJqOzbJMsYPBu2SrxBQMqbOfg9jI2CQgtjeo=; b=RYZM7pfbhstsVnwX+/bzAdehwZIXL6m3RSzFk32khTDBIKMeo1QG1sKbdephpYV5igGWPw vl51cIfdAuTKhYnSaAPQ/zAt1e477BA5k3SDW/aB8S97CUmwPz77HOQIBmZiuMv64b16OB 6HqCQi0XCX1XnUHK6htnVlyUwbqGVtKiWmO46bUTSGmNn0ByRjYr6gV0w/K8X3Mr2BcQrs XZIF1/IBeKeC7RZ8/DkYGsMdkYVSq9oOaBk081KDYkOZvQYmartK3oW3c7TF7Dtvi9PZIn A5eR5ieItI2+EX1Dmk29lJm4COrBzvucdU7F4aHw6JM8cyQ+Ip4g2otXBuCmgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706634686; a=rsa-sha256; cv=none; b=g4kMv6mzJy6aUGBBrjPhFywHCMgaw18tQHep6PzGNQqbkMzy8KDHdRUkALI0vQ40qg37pi jQpggXISOZwm9xnFDdlHyeaGn433zQ/NIWUH6iKcbnx7xmrN0whXIK2/RjjPH66sVG/HaL b4cM76S4ai4Ro+zLC2DDjxlLLqKTlo+BzZkO5X18a1t8BRHO14nrPvkrbexE3HYfIREloG kiimRS+XhofHsJUyA/10elKh5M2FIusu4Lmoke/6yihQdGloN2l3Un77hDtL0CxGkh2ptn M7+PjO72keJNRTrTrpjpJMhguYi6grg1IJshvyrSy/vddW27jhsaefUpUHUwgw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPWsp20qxzkG3; Tue, 30 Jan 2024 17:11: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 40UHBQO6093609; Tue, 30 Jan 2024 17:11:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UHBQHr093606; Tue, 30 Jan 2024 17:11:26 GMT (envelope-from git) Date: Tue, 30 Jan 2024 17:11:26 GMT Message-Id: <202401301711.40UHBQHr093606@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 984128ce2d5e - stable/13 - kern: pts: do not special case closed slave side List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 984128ce2d5eb7d3374dd4b245d443ec2f5d96b2 Auto-Submitted: auto-generated The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=984128ce2d5eb7d3374dd4b245d443ec2f5d96b2 commit 984128ce2d5eb7d3374dd4b245d443ec2f5d96b2 Author: Kyle Evans AuthorDate: 2024-01-16 02:55:59 +0000 Commit: Kyle Evans CommitDate: 2024-01-30 17:11:10 +0000 kern: pts: do not special case closed slave side This would previously return 1 if the slave side of the pts was closed to force an application to read() from it and observe the EOF, but it's not clear why and this is inconsistent both with how we handle devices with similar mechanics (like pipes) and also with other kernels, such as OpenBSD/NetBSD and Linux. PR: 239604 Reviewed by: kib (cherry picked from commit 30189156d325fbcc9d1997d791daedc9fa3bed20) --- sys/kern/tty_pts.c | 7 +----- tests/sys/kern/Makefile | 3 +++ tests/sys/kern/tty_pts.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 6 deletions(-) diff --git a/sys/kern/tty_pts.c b/sys/kern/tty_pts.c index 5e35c52b9038..1351560ba05a 100644 --- a/sys/kern/tty_pts.c +++ b/sys/kern/tty_pts.c @@ -271,12 +271,7 @@ ptsdev_ioctl(struct file *fp, u_long cmd, void *data, return (0); case FIONREAD: tty_lock(tp); - if (psc->pts_flags & PTS_FINISHED) { - /* Force read() to be called. */ - *(int *)data = 1; - } else { - *(int *)data = ttydisc_getc_poll(tp); - } + *(int *)data = ttydisc_getc_poll(tp); tty_unlock(tp); return (0); case FIODGNAME: diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile index 16faeeb40421..74c987e55734 100644 --- a/tests/sys/kern/Makefile +++ b/tests/sys/kern/Makefile @@ -34,6 +34,7 @@ ATF_TESTS_C+= subr_physmem_test PLAIN_TESTS_C+= subr_unit_test ATF_TESTS_C+= sysctl_kern_proc ATF_TESTS_C+= sys_getrandom +ATF_TESTS_C+= tty_pts ATF_TESTS_C+= unix_passfd_test ATF_TESTS_C+= unix_seqpacket_test TEST_METADATA.unix_seqpacket_test+= timeout="15" @@ -77,6 +78,8 @@ NETBSD_ATF_TESTS_C+= sysv_test CFLAGS.mqueue_test+= -I${SRCTOP}/tests LIBADD.mqueue_test+= rt +LIBADD.tty_pts+= atf_c util + ATF_TESTS_C+= libkern_crc32 SRCS.libkern_crc32+= libkern_crc32.c .PATH: ${SRCTOP}/sys/libkern diff --git a/tests/sys/kern/tty_pts.c b/tests/sys/kern/tty_pts.c new file mode 100644 index 000000000000..241cb085a5a7 --- /dev/null +++ b/tests/sys/kern/tty_pts.c @@ -0,0 +1,64 @@ +/*- + * Copyright (c) 2024 Kyle Evans + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include +#include + +#include + +#include +#include + +/* Just a little more concise. */ +#define newpty(masterp, slavep) openpty((masterp), (slavep), NULL, NULL, NULL) + +ATF_TC_WITHOUT_HEAD(fionread); +ATF_TC_BODY(fionread, tc) +{ + char rbuf[32]; + char buf[] = "Hello"; + int master, slave; + int bytes; + + ATF_REQUIRE_EQ(0, newpty(&master, &slave)); + + /* Should be empty to begin with. */ + ATF_REQUIRE_EQ(0, ioctl(master, FIONREAD, &bytes)); + ATF_REQUIRE_EQ(0, bytes); + + ATF_REQUIRE_EQ(sizeof(buf) - 1, write(slave, buf, sizeof(buf) - 1)); + ATF_REQUIRE_EQ(0, ioctl(master, FIONREAD, &bytes)); + ATF_REQUIRE_EQ(sizeof(buf) - 1, bytes); + + /* Drain what we have available, should result in 0 bytes again. */ + ATF_REQUIRE_EQ(sizeof(buf) - 1, read(master, rbuf, sizeof(rbuf))); + ATF_REQUIRE_EQ(0, ioctl(master, FIONREAD, &bytes)); + ATF_REQUIRE_EQ(0, bytes); + + /* + * Write once more, then close the slave side with data still in the + * buffer. + */ + ATF_REQUIRE_EQ(sizeof(buf) - 1, write(slave, buf, sizeof(buf) - 1)); + ATF_REQUIRE_EQ(0, ioctl(master, FIONREAD, &bytes)); + ATF_REQUIRE_EQ(sizeof(buf) - 1, bytes); + + ATF_REQUIRE_EQ(0, close(slave)); + + /* + * The tty's output queue is discarded upon close, so we shouldn't have + * anything else to read(). + */ + ATF_REQUIRE_EQ(0, ioctl(master, FIONREAD, &bytes)); + ATF_REQUIRE_EQ(0, bytes); + ATF_REQUIRE_EQ(0, read(master, rbuf, sizeof(rbuf))); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, fionread); + return (atf_no_error()); +} From nobody Tue Jan 30 17:11:27 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPWsq6Jg7z59CPB; Tue, 30 Jan 2024 17:11: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 4TPWsq3xCmz4DxP; Tue, 30 Jan 2024 17:11:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706634687; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vRmso0ni+aXoI1Vt1ZYLVuq3GlLHpiFZPwDaP+Rdk5k=; b=ywneib5i+mE3Pvd2IndIHTetq8o3ZG8xmBQihuDu3FZlLFJDlP60kBlp1Uh75Ss93UMIaB q1CmAMPBg/xDCXcG90jKzCm6vrrKei08ZjtEySbRV8QJlCis6YqZqOM9R6u2RdD3SHKovs kdYPruB0KlimB6lhoJjDmck9KH/UcxVsingiVZiFQfbRn1EMDXZ/gHbjRI4EiZeWRgEY2/ IMcY303rio0jl8GBYnEI1GnxcuFSTjXuzskV9ZZ9Wd6NXxm/OoVP35x31+2kIIQSXrb8Mz LXu+Tzlh3dCfMDNyf9RWA+v+kQAmN+uZ/8/Nhdpb7idIKAqwNnNPVj1gPzo87Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706634687; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vRmso0ni+aXoI1Vt1ZYLVuq3GlLHpiFZPwDaP+Rdk5k=; b=YbX5mUqb9NzwNSjAi+VXd/gZBkQa+jkc/GAMDN3FXkmb4p2So5LnznOYIhiPNzdDSp/Iex hfa/jQ8hYT5UjV9tF8Ja99k+zd46oso3AShkXJbbv2f9qU1VX+1HQPA22AM/pKtDJljA3c oXfVqMgIUz/oK6Y+vmrOlXSbmCLUKAXvbtgSknQUVrcFn7jBQKW3pYh0yqSLiYvlkDcfFq Q9f5s1XteryRZnyaFjfPhjWDYDMJxou31cX1pv+sqB13fRtNUQM1dT9DNSijHCqffS+mT4 ZUqPoeEH8O3ARsuLQ2HZM2XOQ06uyOfVfKy/bcz8KRt8gwXK53lFQOj+4/B7sA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706634687; a=rsa-sha256; cv=none; b=tN5fd/iNXafyv+kpdk7tvkp0Q496+z9jGQeiEJO6b41yrw/0CCtM0SaBJ7PkWUF0MsNbH/ oHGZsYJF7tQPlbuSKunMllNASGXJOukBd0UIkT0IqX42ZldiR/nRcgFA4fjqKJ3+GSUBAu am8G4jMxAieKs2nhMpwYNaiRundUQGjyPrfQCoZpPgX9ebvuHBJ5rkT8A5hwqvI6xRZMza aZ3NbszS+hRE7Zhr64+FjVgauPkov2/a/w5pCptPkKAK4loRebYjU3ECubJ9hnbjPKll16 4X+9L+OKO71CHuXjVc9KUk6f9TiWpG2yl4OQBQmFOEYC5M7mjm+afHNI7F1tcA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPWsq32DdzkZF; Tue, 30 Jan 2024 17:11: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 40UHBRuD093662; Tue, 30 Jan 2024 17:11:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UHBReA093659; Tue, 30 Jan 2024 17:11:27 GMT (envelope-from git) Date: Tue, 30 Jan 2024 17:11:27 GMT Message-Id: <202401301711.40UHBReA093659@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 050b4db5a8c1 - stable/13 - kern: tty: recanonicalize the buffer on ICANON/VEOF/VEOL changes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 050b4db5a8c1a32a0c77391b7dc81ef5a2ef93f7 Auto-Submitted: auto-generated The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=050b4db5a8c1a32a0c77391b7dc81ef5a2ef93f7 commit 050b4db5a8c1a32a0c77391b7dc81ef5a2ef93f7 Author: Kyle Evans AuthorDate: 2024-01-16 02:55:59 +0000 Commit: Kyle Evans CommitDate: 2024-01-30 17:11:10 +0000 kern: tty: recanonicalize the buffer on ICANON/VEOF/VEOL changes Before this change, we would canonicalize any partial input if the new local mode is not ICANON, but that's about it. If we were switching from -ICANON -> ICANON, or if VEOF/VEOL changes, then our internal canon accounting would be wrong. The main consequence of this is that in ICANON mode, we would potentially hang a read(2) longer if the new VEOF/VEOL appears later in the buffer, and FIONREAD would be similarly wrong as a result. Reviewed by: kib (cherry picked from commit 522083ffbd1ab9b485861750e889d606dc75ed0a) (cherry picked from commit 5738d741fb796c1f0a6b5c2157af7de58104ac97) --- sys/kern/tty.c | 22 +++++++++++++++++++--- sys/kern/tty_inq.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ sys/kern/tty_ttydisc.c | 22 ++++++++++++++++++++++ sys/sys/ttydisc.h | 1 + sys/sys/ttyqueue.h | 1 + 5 files changed, 92 insertions(+), 3 deletions(-) diff --git a/sys/kern/tty.c b/sys/kern/tty.c index d46462842038..d7f9a914166a 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -1703,6 +1703,7 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *data, int fflag, case TIOCSETAW: case TIOCSETAF: { struct termios *t = data; + bool canonicalize = false; /* * Who makes up these funny rules? According to POSIX, @@ -1752,6 +1753,19 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *data, int fflag, return (error); } + /* + * We'll canonicalize any partial input if we're transitioning + * ICANON one way or the other. If we're going from -ICANON -> + * ICANON, then in the worst case scenario we're in the middle + * of a line but both ttydisc_read() and FIONREAD will search + * for one of our line terminals. + */ + if ((t->c_lflag & ICANON) != (tp->t_termios.c_lflag & ICANON)) + canonicalize = true; + else if (tp->t_termios.c_cc[VEOF] != t->c_cc[VEOF] || + tp->t_termios.c_cc[VEOL] != t->c_cc[VEOL]) + canonicalize = true; + /* Copy new non-device driver parameters. */ tp->t_termios.c_iflag = t->c_iflag; tp->t_termios.c_oflag = t->c_oflag; @@ -1760,13 +1774,15 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *data, int fflag, ttydisc_optimize(tp); + if (canonicalize) + ttydisc_canonicalize(tp); if ((t->c_lflag & ICANON) == 0) { /* * When in non-canonical mode, wake up all - * readers. Canonicalize any partial input. VMIN - * and VTIME could also be adjusted. + * readers. Any partial input has already been + * canonicalized above if we were in canonical mode. + * VMIN and VTIME could also be adjusted. */ - ttyinq_canonicalize(&tp->t_inq); tty_wakeup(tp, FREAD); } diff --git a/sys/kern/tty_inq.c b/sys/kern/tty_inq.c index 291a815fa2db..daf3bde77712 100644 --- a/sys/kern/tty_inq.c +++ b/sys/kern/tty_inq.c @@ -346,6 +346,55 @@ ttyinq_canonicalize(struct ttyinq *ti) ti->ti_startblock = ti->ti_reprintblock = ti->ti_lastblock; } +/* + * Canonicalize at one of the break characters; we'll work backwards from the + * lastblock to firstblock to try and find the latest one. + */ +void +ttyinq_canonicalize_break(struct ttyinq *ti, const char *breakc) +{ + struct ttyinq_block *tib = ti->ti_lastblock; + unsigned int canon, off; + unsigned int boff; + + /* No block, no change needed. */ + if (tib == NULL || ti->ti_end == 0) + return; + + /* Start just past the end... */ + off = ti->ti_end; + canon = ti->ti_begin; + + while (off > ti->ti_begin) { + off--; + boff = off % TTYINQ_DATASIZE; + + if (strchr(breakc, tib->tib_data[boff]) && !GETBIT(tib, boff)) { + canon = off + 1; + break; + } + + if (off != ti->ti_begin && boff == 0) + tib = tib->tib_prev; + } + + MPASS(canon > ti->ti_begin || off == ti->ti_begin); + + /* + * We should only be able to hit canon == ti_begin if we walked + * everything we have and didn't find any of the break characters, so + * if canon == ti_begin then tib is already the correct block and we + * should avoid touching it. + * + * For all other scenarios, if canon lies on a block boundary then tib + * has already advanced to the previous block. + */ + if (canon != ti->ti_begin && (canon % TTYINQ_DATASIZE) == 0) + tib = tib->tib_next; + ti->ti_linestart = ti->ti_reprint = canon; + ti->ti_startblock = ti->ti_reprintblock = tib; +} + size_t ttyinq_findchar(struct ttyinq *ti, const char *breakc, size_t maxlen, char *lastc) diff --git a/sys/kern/tty_ttydisc.c b/sys/kern/tty_ttydisc.c index 04d99c336438..92f75d672269 100644 --- a/sys/kern/tty_ttydisc.c +++ b/sys/kern/tty_ttydisc.c @@ -167,6 +167,28 @@ ttydisc_bytesavail(struct tty *tp) return (clen); } +void +ttydisc_canonicalize(struct tty *tp) +{ + char breakc[4]; + + /* + * If we're in non-canonical mode, it's as easy as just canonicalizing + * the current partial line. + */ + if (!CMP_FLAG(l, ICANON)) { + ttyinq_canonicalize(&tp->t_inq); + return; + } + + /* + * For canonical mode, we need to rescan the buffer for the last EOL + * indicator. + */ + ttydisc_read_break(tp, &breakc[0], sizeof(breakc)); + ttyinq_canonicalize_break(&tp->t_inq, breakc); +} + static int ttydisc_read_canonical(struct tty *tp, struct uio *uio, int ioflag) { diff --git a/sys/sys/ttydisc.h b/sys/sys/ttydisc.h index 81d436139555..cdd3576afedf 100644 --- a/sys/sys/ttydisc.h +++ b/sys/sys/ttydisc.h @@ -47,6 +47,7 @@ void ttydisc_close(struct tty *tp); size_t ttydisc_bytesavail(struct tty *tp); int ttydisc_read(struct tty *tp, struct uio *uio, int ioflag); int ttydisc_write(struct tty *tp, struct uio *uio, int ioflag); +void ttydisc_canonicalize(struct tty *tp); void ttydisc_optimize(struct tty *tp); /* Bottom half routines. */ diff --git a/sys/sys/ttyqueue.h b/sys/sys/ttyqueue.h index fd5a6bf7719e..89c07b7faa10 100644 --- a/sys/sys/ttyqueue.h +++ b/sys/sys/ttyqueue.h @@ -78,6 +78,7 @@ size_t ttyinq_write(struct ttyinq *ti, const void *buf, size_t len, int ttyinq_write_nofrag(struct ttyinq *ti, const void *buf, size_t len, int quote); void ttyinq_canonicalize(struct ttyinq *ti); +void ttyinq_canonicalize_break(struct ttyinq *ti, const char *breakc); size_t ttyinq_findchar(struct ttyinq *ti, const char *breakc, size_t maxlen, char *lastc); void ttyinq_flush(struct ttyinq *ti); From nobody Tue Jan 30 17:11:30 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPWst3MfVz59C38; Tue, 30 Jan 2024 17:11: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 4TPWst29Y1z4F7v; Tue, 30 Jan 2024 17:11:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706634690; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aW9huxDQzJgDQ7O8xkwVXG/xIjYYWRjCsobt0RbtypE=; b=qNp2M+QCun6IRRrJRq9SWh/BuXFOEXckMMHSHcMYA9yH2ZzHr9a/AjQcJQHlDf0cAM6a08 YRUZw3Zz98fEfL3udDD6Xhpc+xrt61tt2hHsM7gKSh6AgwmzbvQKE0xQNRWpMjX0Eo5QxF xP4zYk1X93xtuViZFATKm8YzO9pW3hybyD5M2hAcAnyxjCMDPeMLy4DtZHH+qo/bKNN7YK kDZNTkM6N627PeF3a1HQ3MweKF/NG0yfGITnBfeKWds8liJRK3grl6pirPKL9Jk5/MVKbv Zl3axGaHqq3MxOMPpTnRecWSWqf+GjorNrPLN2BEXvM3aF1+ztV14bS3wgtZQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706634690; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aW9huxDQzJgDQ7O8xkwVXG/xIjYYWRjCsobt0RbtypE=; b=QP7b8MtcTAVDOuSF8wUV17oPxKU9UCoAIPPKhrtmp3KQLn3lqixgwjo1N5HobueGk58lwC YpjVe77a5UV8CFEEDVPaTgxsfHM8yVWjM/vnupxmmVqoK97GVMasCVxFeVALjm8Q0fUJvB xt3KW1vRvWaIZlYcCaBasOrplanjQS2SMCGrNNWN/UoURq226WG5JYxI2vqHQzz9nTQsET ylmNxd4IvYmoxJnPzPNddC9Ms+OcbUsk+KROFAFmD0SZxrgZmoWUVV8LpfzAmTADv0fijo uskVKH3ILptBuBERzrpIwNdys19HdIO8PZ5qhdxEZB0Be+i9GudZrQDnrJNW3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706634690; a=rsa-sha256; cv=none; b=JdeXGDBa4dHAqb1tnD2wfuWBwfftYnEoXEovhGVvqmjtEHNITm4fj4Rqr0OFI9mNgl+g7H aOVaVHvl1ocavu81ioISCCuiXG1CvyylCBpfnY5l4/WQ0AWHcEuNOreYa0mhingueNpDo9 qKaw9JSUFNbM6zvnCwFyerz0DLfVabUa9eCmQCXwVZdlVKDKKPagL+ycdqvtOFqE51+h8m tG0+Lj1g+tk7nZzVHFGBwgKMMqQf8TRIRPVTLXG2sEQERZYWucl2JVx0iJWdiskWEHtU/S R9kllh6pfWDKJR7gMfs7dCUy5BFrdsWLcqXdsJVwRl3HqTdRzKxDlGvddYTcXw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPWst1GZfzklx; Tue, 30 Jan 2024 17:11: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 40UHBUNS093895; Tue, 30 Jan 2024 17:11:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UHBUPF093893; Tue, 30 Jan 2024 17:11:30 GMT (envelope-from git) Date: Tue, 30 Jan 2024 17:11:30 GMT Message-Id: <202401301711.40UHBUPF093893@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: aebaa32c3108 - stable/14 - kern: pts: do not special case closed slave side List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: aebaa32c3108e99cc28d9aef7229ed4fe7da18ca Auto-Submitted: auto-generated The branch stable/14 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=aebaa32c3108e99cc28d9aef7229ed4fe7da18ca commit aebaa32c3108e99cc28d9aef7229ed4fe7da18ca Author: Kyle Evans AuthorDate: 2024-01-16 02:55:59 +0000 Commit: Kyle Evans CommitDate: 2024-01-30 17:11:24 +0000 kern: pts: do not special case closed slave side This would previously return 1 if the slave side of the pts was closed to force an application to read() from it and observe the EOF, but it's not clear why and this is inconsistent both with how we handle devices with similar mechanics (like pipes) and also with other kernels, such as OpenBSD/NetBSD and Linux. PR: 239604 Reviewed by: kib (cherry picked from commit 30189156d325fbcc9d1997d791daedc9fa3bed20) --- sys/kern/tty_pts.c | 7 +----- tests/sys/kern/Makefile | 3 +++ tests/sys/kern/tty_pts.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 6 deletions(-) diff --git a/sys/kern/tty_pts.c b/sys/kern/tty_pts.c index f79c9cc3e979..31122d422a28 100644 --- a/sys/kern/tty_pts.c +++ b/sys/kern/tty_pts.c @@ -271,12 +271,7 @@ ptsdev_ioctl(struct file *fp, u_long cmd, void *data, return (0); case FIONREAD: tty_lock(tp); - if (psc->pts_flags & PTS_FINISHED) { - /* Force read() to be called. */ - *(int *)data = 1; - } else { - *(int *)data = ttydisc_getc_poll(tp); - } + *(int *)data = ttydisc_getc_poll(tp); tty_unlock(tp); return (0); case FIODGNAME: diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile index e449d9deeed1..b95be12d9665 100644 --- a/tests/sys/kern/Makefile +++ b/tests/sys/kern/Makefile @@ -38,6 +38,7 @@ ATF_TESTS_C+= subr_physmem_test PLAIN_TESTS_C+= subr_unit_test ATF_TESTS_C+= sysctl_kern_proc ATF_TESTS_C+= sys_getrandom +ATF_TESTS_C+= tty_pts ATF_TESTS_C+= unix_dgram ATF_TESTS_C+= unix_passfd_dgram TEST_METADATA.unix_passfd_dgram+= is_exclusive="true" @@ -86,6 +87,8 @@ NETBSD_ATF_TESTS_C+= sysv_test CFLAGS.mqueue_test+= -I${SRCTOP}/tests LIBADD.mqueue_test+= rt +LIBADD.tty_pts+= atf_c util + ATF_TESTS_C+= libkern_crc32 SRCS.libkern_crc32+= libkern_crc32.c .PATH: ${SRCTOP}/sys/libkern diff --git a/tests/sys/kern/tty_pts.c b/tests/sys/kern/tty_pts.c new file mode 100644 index 000000000000..241cb085a5a7 --- /dev/null +++ b/tests/sys/kern/tty_pts.c @@ -0,0 +1,64 @@ +/*- + * Copyright (c) 2024 Kyle Evans + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include +#include + +#include + +#include +#include + +/* Just a little more concise. */ +#define newpty(masterp, slavep) openpty((masterp), (slavep), NULL, NULL, NULL) + +ATF_TC_WITHOUT_HEAD(fionread); +ATF_TC_BODY(fionread, tc) +{ + char rbuf[32]; + char buf[] = "Hello"; + int master, slave; + int bytes; + + ATF_REQUIRE_EQ(0, newpty(&master, &slave)); + + /* Should be empty to begin with. */ + ATF_REQUIRE_EQ(0, ioctl(master, FIONREAD, &bytes)); + ATF_REQUIRE_EQ(0, bytes); + + ATF_REQUIRE_EQ(sizeof(buf) - 1, write(slave, buf, sizeof(buf) - 1)); + ATF_REQUIRE_EQ(0, ioctl(master, FIONREAD, &bytes)); + ATF_REQUIRE_EQ(sizeof(buf) - 1, bytes); + + /* Drain what we have available, should result in 0 bytes again. */ + ATF_REQUIRE_EQ(sizeof(buf) - 1, read(master, rbuf, sizeof(rbuf))); + ATF_REQUIRE_EQ(0, ioctl(master, FIONREAD, &bytes)); + ATF_REQUIRE_EQ(0, bytes); + + /* + * Write once more, then close the slave side with data still in the + * buffer. + */ + ATF_REQUIRE_EQ(sizeof(buf) - 1, write(slave, buf, sizeof(buf) - 1)); + ATF_REQUIRE_EQ(0, ioctl(master, FIONREAD, &bytes)); + ATF_REQUIRE_EQ(sizeof(buf) - 1, bytes); + + ATF_REQUIRE_EQ(0, close(slave)); + + /* + * The tty's output queue is discarded upon close, so we shouldn't have + * anything else to read(). + */ + ATF_REQUIRE_EQ(0, ioctl(master, FIONREAD, &bytes)); + ATF_REQUIRE_EQ(0, bytes); + ATF_REQUIRE_EQ(0, read(master, rbuf, sizeof(rbuf))); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, fionread); + return (atf_no_error()); +} From nobody Tue Jan 30 17:11:28 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPWss2RDVz59CDk; Tue, 30 Jan 2024 17:11: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 4TPWss18Ssz4FQJ; Tue, 30 Jan 2024 17:11:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706634689; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IzmabWnyjDvuFZH+RfBgxOhVXtuFmF15YtSzrToRoJk=; b=MdIC/RmCEh4aiz70njG5aHR/oAS8mAK7Ijjibd9m3F7MnoHGpwV9d9o/qEsOy1HQ3ZriSe aNgS62UAY8zGpNWS74EVD2UFVkunI5jwUS1noUhB/sWWNzQeHG9wPFpwuNzKbHCmH1a4xK pyXzTm0meg4F6+sLZ1D8LWzXQperi0L37jOClgu0133LbQVzpWMKlAlvlP4XUieWwxK2c3 Rg3UisGnJr76m+pG0Dmko6sjzHFslMrx6pf6791m2DLpuqEPhWzvv9KZ3WCHePOCW/u2PG g0ZV7rYmyW88y7oYnXpSD2QV09v4PAY6Bjn2Wy/THT6gykJAApJhjgItDHH/Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706634689; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IzmabWnyjDvuFZH+RfBgxOhVXtuFmF15YtSzrToRoJk=; b=qDf38yw9f3epogmRghO0z6/V2lSNAwG8uVi3IC0IM/7uCS560zhMy+MpsGskwic0eOqOFD VtOH95tZd9tNRzgNkEKpjIyJSlr1kkOY3kpSyWhUG6kijRD+xq6PNqp8W8bmjc8dTr9/VE 0+6iqynPg/apANVkJz/U9x2C87xQ85sb2d9f985WOkYObDx3lxbSL2YCP2wGkwHtCK2XiR MHr61v6I3Br6OOdL1cArUkfyXGg6u2z2kqKzXMVEbRpAKT2C2iajkoHTlreEPc04ELHpLR hSyIniFJ6IKDkTX1g9h37m+z4sDk8PPmjPuDzW/cGMm+y49s6dasH/irA4atGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706634689; a=rsa-sha256; cv=none; b=Wa05xajQ7hdNzGfJarCsB9xaREmerhRu6H9WFYNCNtOu+YNWSnG5v9sKeXK7AZUbC9fH57 OR2NYmwSG0F7AF09NUn1JaOMZ37ZzCcmUFG+Sf3otCoaS8Qgmseaw69KCZ3YXNnL72iyq5 G73s7QUON0iJmS0tmspBKJTEyT5thzTSPSlfGF4LJKFzcfvdTsSUHoNmz2TYvIAc52EFLQ QqJQvKfbL2pTJjL36EdkrmeJNq4Esay+oNr3K7bQWl7Zy6AKvFEKU5kS2OwDX3BoihxNXt CNHTJHBc8JpwrPlzGJo1K9rChE1auMLyj+poldfmvvcYawNH+88TA+CNL+nnYQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPWss0DqqzkXW; Tue, 30 Jan 2024 17:11: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 40UHBSBi093838; Tue, 30 Jan 2024 17:11:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UHBSHp093835; Tue, 30 Jan 2024 17:11:28 GMT (envelope-from git) Date: Tue, 30 Jan 2024 17:11:28 GMT Message-Id: <202401301711.40UHBSHp093835@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 8fb7d0ddd3e3 - stable/14 - kern: tty: fix EOF handling for canonical reads List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 8fb7d0ddd3e3b4af91f10536b6f307f8f8792190 Auto-Submitted: auto-generated The branch stable/14 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=8fb7d0ddd3e3b4af91f10536b6f307f8f8792190 commit 8fb7d0ddd3e3b4af91f10536b6f307f8f8792190 Author: Kyle Evans AuthorDate: 2024-01-16 02:55:58 +0000 Commit: Kyle Evans CommitDate: 2024-01-30 17:11:24 +0000 kern: tty: fix EOF handling for canonical reads If the read(2) buffer is one byte short of an EOF, then we'll end up reading the line into the buffer, then re-entering and seeing an EOF at the beginning of the inq, assuming it's a zero-length line. Fix this corner-case by searching one more byte than we have available for an EOF. If we found it, then we'll trim it here; otherwise, we'll limit our read to just the space we have in the out buffer and the next read(2) will (potentially) read the remainder of the line. Fix FIONREAD while we're here to match what an application can expect read(2) to return -- scan for the first break character in the part of the input that's been canonicalized, we'll never return more than that. PR: 276220 Reviewed by: cy, imp (both previous version), kib (cherry picked from commit d51dac5f1370bdca1ea20c6b48cdea463f6f5dda) --- sys/kern/tty.c | 2 +- sys/kern/tty_ttydisc.c | 72 ++++++++++++++++++++++++++++++++++++++++++++------ sys/sys/ttydisc.h | 1 + 3 files changed, 66 insertions(+), 9 deletions(-) diff --git a/sys/kern/tty.c b/sys/kern/tty.c index e051c66ab0c9..959a5644e9e2 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -1671,7 +1671,7 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *data, int fflag, /* This device supports non-blocking operation. */ return (0); case FIONREAD: - *(int *)data = ttyinq_bytescanonicalized(&tp->t_inq); + *(int *)data = ttydisc_bytesavail(tp); return (0); case FIONWRITE: case TIOCOUTQ: diff --git a/sys/kern/tty_ttydisc.c b/sys/kern/tty_ttydisc.c index cb5bf672d040..04d99c336438 100644 --- a/sys/kern/tty_ttydisc.c +++ b/sys/kern/tty_ttydisc.c @@ -113,15 +113,20 @@ ttydisc_close(struct tty *tp) ttyhook_close(tp); } -static int -ttydisc_read_canonical(struct tty *tp, struct uio *uio, int ioflag) +/* + * Populate our break array; it should likely be at least 4 bytes in size to + * allow for \n, VEOF, and VEOL. + */ +static void +ttydisc_read_break(struct tty *tp, char *breakc, size_t breaksz) { - char breakc[4] = { CNL }; /* enough to hold \n, VEOF and VEOL. */ - int error; - size_t clen, flen = 0, n = 1; - unsigned char lastc = _POSIX_VDISABLE; + size_t n = 0; + MPASS(breaksz != 0); + + breakc[n++] = CNL; #define BREAK_ADD(c) do { \ + MPASS(n < breaksz - 1); /* NUL terminated */ \ if (tp->t_termios.c_cc[c] != _POSIX_VDISABLE) \ breakc[n++] = tp->t_termios.c_cc[c]; \ } while (0) @@ -129,7 +134,48 @@ ttydisc_read_canonical(struct tty *tp, struct uio *uio, int ioflag) BREAK_ADD(VEOF); BREAK_ADD(VEOL); #undef BREAK_ADD + breakc[n] = '\0'; +} + +size_t +ttydisc_bytesavail(struct tty *tp) +{ + size_t clen; + char breakc[4]; + unsigned char lastc = _POSIX_VDISABLE; + + clen = ttyinq_bytescanonicalized(&tp->t_inq); + if (!CMP_FLAG(l, ICANON) || clen == 0) + return (clen); + + ttydisc_read_break(tp, &breakc[0], sizeof(breakc)); + clen = ttyinq_findchar(&tp->t_inq, breakc, clen, &lastc); + + /* + * We might have a partial line canonicalized in the input queue if we, + * for instance, switched to ICANON after taking some input in raw mode. + * In this case, read(2) will block because we only have a partial line. + */ + if (lastc == _POSIX_VDISABLE) + return (0); + + /* If VEOF was our terminal, it must be discarded (not counted). */ + if (CMP_CC(VEOF, lastc)) + clen--; + + return (clen); +} + +static int +ttydisc_read_canonical(struct tty *tp, struct uio *uio, int ioflag) +{ + char breakc[4]; /* enough to hold \n, VEOF and VEOL. */ + int error; + size_t clen, flen = 0; + unsigned char lastc = _POSIX_VDISABLE; + + ttydisc_read_break(tp, &breakc[0], sizeof(breakc)); do { error = tty_wait_background(tp, curthread, SIGTTIN); @@ -154,7 +200,7 @@ ttydisc_read_canonical(struct tty *tp, struct uio *uio, int ioflag) * cause the TTY layer to return data in chunks using * the blocksize (except the first and last blocks). */ - clen = ttyinq_findchar(&tp->t_inq, breakc, uio->uio_resid, + clen = ttyinq_findchar(&tp->t_inq, breakc, uio->uio_resid + 1, &lastc); /* No more data. */ @@ -170,10 +216,20 @@ ttydisc_read_canonical(struct tty *tp, struct uio *uio, int ioflag) continue; } - /* Don't send the EOF char back to userspace. */ + /* + * Don't send the EOF char back to userspace. Our above call to + * ttyinq_findchar overreads by 1 character in case we would + * otherwise be leaving an EOF for the next read(). We'll trim + * clen back down to uio_resid whether we find our EOF or not. + */ if (CMP_CC(VEOF, lastc)) flen = 1; + /* + * Trim clen back down to the buffer size, since we had + * intentionally over-read. + */ + clen = MIN(uio->uio_resid + flen, clen); MPASS(flen <= clen); /* Read and throw away the EOF character. */ diff --git a/sys/sys/ttydisc.h b/sys/sys/ttydisc.h index 0458fae6e34b..81d436139555 100644 --- a/sys/sys/ttydisc.h +++ b/sys/sys/ttydisc.h @@ -44,6 +44,7 @@ struct uio; /* Top half routines. */ void ttydisc_open(struct tty *tp); void ttydisc_close(struct tty *tp); +size_t ttydisc_bytesavail(struct tty *tp); int ttydisc_read(struct tty *tp, struct uio *uio, int ioflag); int ttydisc_write(struct tty *tp, struct uio *uio, int ioflag); void ttydisc_optimize(struct tty *tp); From nobody Tue Jan 30 17:11:31 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPWsv5JkBz59CBF; Tue, 30 Jan 2024 17:11: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 4TPWsv3YDFz4FDk; Tue, 30 Jan 2024 17:11:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706634691; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uea+WnSxY+w5S+OtLuuh08Z/pqVMhtl4RB6PPkm8nyg=; b=sxxpB2Hkb5OkRDFJUg6pOWiXgMqn6KacKcXlAcvMxFgsQoDbT+Qk9jS/AFquarZ5n8ai3s q5Zd11nco1KtODDH18UtnOW3H028ObjJ+/5O2NBfC97IesXrLNsNiyzo2GUExYliEMZ7+g KwwBfnjxpw6kErRDGXvn8HpbDWlKPDMc1qaZ4Avs2HBLQkqaHQHyiGYYZiOQyNkjfSU061 I16q0rE7JQM+rP+T4h2UGkwiA7ATkSkHpbvmjpHw3lTET869BBJBfL9ar0YBkvNE4DenAM pTo8H3xPuiuhfwWXeReIyOfG3kyihUqDkV+STEZ/NsYbCA21K7oOqdHVAQoswA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706634691; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uea+WnSxY+w5S+OtLuuh08Z/pqVMhtl4RB6PPkm8nyg=; b=loxB+G7Y6bqYPIw5WtJY+/a/HtAbqfp9dQl+QonfMBB1zoPZMnwB171Miu8bkJjKJYPdUV 8KQ+fYIp/MxnvySmZjCOtW0Kb2YU5GBGhKZsepjh06yFcj8/Zk/7u4OA+JtsLfu0QmcyUF iL2TIDcqmRP5SwY2lJVmHbFEiWyiRKDfePpDrIyZ+w9kUO+EPIvTM0LvarNA7CJd95cp0s KY+2GaSkp18PtBwqaOI4DUqFgh0VhL6Mtpornm9l5I8mHuJWzPcflqBG1WjkS/IOVR0xu0 NGQloLhuochMrPGB7PYm6axBDv9TETCpE0bNVzFHD0Pn0E5DFUc3Ukhzs6ETvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706634691; a=rsa-sha256; cv=none; b=d5PmPedD3BDSud0uytYR2dSuLd8sXBI363kd1EElk3utViIAOYgHJMvXsskraghFXIPwDb oXeUa70+3kuQf0f4sVxLSeQ3kMYtTJmJKEXY3o8RgjbcNHFIXWgOh887cd8vLuz26yHtni pTbwpKt4WZS2skv+Ak9NlANd0n6a9ip2OfOHmwWJ2UwGWYGk5goWUonXr3umYknHKHB2WN zG4RfqCAOcDHXBl+TbufB745EXcgFbCtL6q+YeyHOSqCldbXrUYIRCQef+UclxR/8cnSHu eYIzPlA4b9LiQVzbjOTZOWSLh6XpuYOqR7fInv7EyAA+GXSnJO69cU84REhh1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPWsv2bpTzkk8; Tue, 30 Jan 2024 17:11: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 40UHBV9R093946; Tue, 30 Jan 2024 17:11:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UHBVqv093943; Tue, 30 Jan 2024 17:11:31 GMT (envelope-from git) Date: Tue, 30 Jan 2024 17:11:31 GMT Message-Id: <202401301711.40UHBVqv093943@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: ae7357f2e712 - stable/14 - kern: tty: recanonicalize the buffer on ICANON/VEOF/VEOL changes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: ae7357f2e712026685709ddf98ad6f767f00675b Auto-Submitted: auto-generated The branch stable/14 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=ae7357f2e712026685709ddf98ad6f767f00675b commit ae7357f2e712026685709ddf98ad6f767f00675b Author: Kyle Evans AuthorDate: 2024-01-16 02:55:59 +0000 Commit: Kyle Evans CommitDate: 2024-01-30 17:11:24 +0000 kern: tty: recanonicalize the buffer on ICANON/VEOF/VEOL changes Before this change, we would canonicalize any partial input if the new local mode is not ICANON, but that's about it. If we were switching from -ICANON -> ICANON, or if VEOF/VEOL changes, then our internal canon accounting would be wrong. The main consequence of this is that in ICANON mode, we would potentially hang a read(2) longer if the new VEOF/VEOL appears later in the buffer, and FIONREAD would be similarly wrong as a result. Reviewed by: kib (cherry picked from commit 522083ffbd1ab9b485861750e889d606dc75ed0a) (cherry picked from commit 5738d741fb796c1f0a6b5c2157af7de58104ac97) --- sys/kern/tty.c | 22 +++++++++++++++++++--- sys/kern/tty_inq.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ sys/kern/tty_ttydisc.c | 22 ++++++++++++++++++++++ sys/sys/ttydisc.h | 1 + sys/sys/ttyqueue.h | 1 + 5 files changed, 92 insertions(+), 3 deletions(-) diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 959a5644e9e2..353a3b58846c 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -1703,6 +1703,7 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *data, int fflag, case TIOCSETAW: case TIOCSETAF: { struct termios *t = data; + bool canonicalize = false; /* * Who makes up these funny rules? According to POSIX, @@ -1752,6 +1753,19 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *data, int fflag, return (error); } + /* + * We'll canonicalize any partial input if we're transitioning + * ICANON one way or the other. If we're going from -ICANON -> + * ICANON, then in the worst case scenario we're in the middle + * of a line but both ttydisc_read() and FIONREAD will search + * for one of our line terminals. + */ + if ((t->c_lflag & ICANON) != (tp->t_termios.c_lflag & ICANON)) + canonicalize = true; + else if (tp->t_termios.c_cc[VEOF] != t->c_cc[VEOF] || + tp->t_termios.c_cc[VEOL] != t->c_cc[VEOL]) + canonicalize = true; + /* Copy new non-device driver parameters. */ tp->t_termios.c_iflag = t->c_iflag; tp->t_termios.c_oflag = t->c_oflag; @@ -1760,13 +1774,15 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *data, int fflag, ttydisc_optimize(tp); + if (canonicalize) + ttydisc_canonicalize(tp); if ((t->c_lflag & ICANON) == 0) { /* * When in non-canonical mode, wake up all - * readers. Canonicalize any partial input. VMIN - * and VTIME could also be adjusted. + * readers. Any partial input has already been + * canonicalized above if we were in canonical mode. + * VMIN and VTIME could also be adjusted. */ - ttyinq_canonicalize(&tp->t_inq); tty_wakeup(tp, FREAD); } diff --git a/sys/kern/tty_inq.c b/sys/kern/tty_inq.c index 291a815fa2db..daf3bde77712 100644 --- a/sys/kern/tty_inq.c +++ b/sys/kern/tty_inq.c @@ -346,6 +346,55 @@ ttyinq_canonicalize(struct ttyinq *ti) ti->ti_startblock = ti->ti_reprintblock = ti->ti_lastblock; } +/* + * Canonicalize at one of the break characters; we'll work backwards from the + * lastblock to firstblock to try and find the latest one. + */ +void +ttyinq_canonicalize_break(struct ttyinq *ti, const char *breakc) +{ + struct ttyinq_block *tib = ti->ti_lastblock; + unsigned int canon, off; + unsigned int boff; + + /* No block, no change needed. */ + if (tib == NULL || ti->ti_end == 0) + return; + + /* Start just past the end... */ + off = ti->ti_end; + canon = ti->ti_begin; + + while (off > ti->ti_begin) { + off--; + boff = off % TTYINQ_DATASIZE; + + if (strchr(breakc, tib->tib_data[boff]) && !GETBIT(tib, boff)) { + canon = off + 1; + break; + } + + if (off != ti->ti_begin && boff == 0) + tib = tib->tib_prev; + } + + MPASS(canon > ti->ti_begin || off == ti->ti_begin); + + /* + * We should only be able to hit canon == ti_begin if we walked + * everything we have and didn't find any of the break characters, so + * if canon == ti_begin then tib is already the correct block and we + * should avoid touching it. + * + * For all other scenarios, if canon lies on a block boundary then tib + * has already advanced to the previous block. + */ + if (canon != ti->ti_begin && (canon % TTYINQ_DATASIZE) == 0) + tib = tib->tib_next; + ti->ti_linestart = ti->ti_reprint = canon; + ti->ti_startblock = ti->ti_reprintblock = tib; +} + size_t ttyinq_findchar(struct ttyinq *ti, const char *breakc, size_t maxlen, char *lastc) diff --git a/sys/kern/tty_ttydisc.c b/sys/kern/tty_ttydisc.c index 04d99c336438..92f75d672269 100644 --- a/sys/kern/tty_ttydisc.c +++ b/sys/kern/tty_ttydisc.c @@ -167,6 +167,28 @@ ttydisc_bytesavail(struct tty *tp) return (clen); } +void +ttydisc_canonicalize(struct tty *tp) +{ + char breakc[4]; + + /* + * If we're in non-canonical mode, it's as easy as just canonicalizing + * the current partial line. + */ + if (!CMP_FLAG(l, ICANON)) { + ttyinq_canonicalize(&tp->t_inq); + return; + } + + /* + * For canonical mode, we need to rescan the buffer for the last EOL + * indicator. + */ + ttydisc_read_break(tp, &breakc[0], sizeof(breakc)); + ttyinq_canonicalize_break(&tp->t_inq, breakc); +} + static int ttydisc_read_canonical(struct tty *tp, struct uio *uio, int ioflag) { diff --git a/sys/sys/ttydisc.h b/sys/sys/ttydisc.h index 81d436139555..cdd3576afedf 100644 --- a/sys/sys/ttydisc.h +++ b/sys/sys/ttydisc.h @@ -47,6 +47,7 @@ void ttydisc_close(struct tty *tp); size_t ttydisc_bytesavail(struct tty *tp); int ttydisc_read(struct tty *tp, struct uio *uio, int ioflag); int ttydisc_write(struct tty *tp, struct uio *uio, int ioflag); +void ttydisc_canonicalize(struct tty *tp); void ttydisc_optimize(struct tty *tp); /* Bottom half routines. */ diff --git a/sys/sys/ttyqueue.h b/sys/sys/ttyqueue.h index fd5a6bf7719e..89c07b7faa10 100644 --- a/sys/sys/ttyqueue.h +++ b/sys/sys/ttyqueue.h @@ -78,6 +78,7 @@ size_t ttyinq_write(struct ttyinq *ti, const void *buf, size_t len, int ttyinq_write_nofrag(struct ttyinq *ti, const void *buf, size_t len, int quote); void ttyinq_canonicalize(struct ttyinq *ti); +void ttyinq_canonicalize_break(struct ttyinq *ti, const char *breakc); size_t ttyinq_findchar(struct ttyinq *ti, const char *breakc, size_t maxlen, char *lastc); void ttyinq_flush(struct ttyinq *ti); From nobody Tue Jan 30 17:55:02 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPXr63sGYz59GkG; Tue, 30 Jan 2024 17:55: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 4TPXr63HxNz4M58; Tue, 30 Jan 2024 17:55:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706637302; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7Ny6NywoWunmzBhBBNySUcKZc+wNrxnrl/30NE5mnGY=; b=n/zvUKdcCkUPBWbSy94Xmd0vCvPv6DMqaSH5t9HJbl39Dz6sBfn0ntunNF/iLIDQt0FUI5 ucQDK/f/JXiRszRNoIKEhK7fcnkQhKn/wIQ+rHsXruVQBaQzBFOwKKBOe4EaDdOZMSSPnm AS+XXANa5k27/zd5J7MW6qiWkuKQmQ06tDHRSVUpJbyPKS4SuvkuqHGcjJ2ynta2uTLOga o42CBrZiHXRtXXnIE7MKCWK+7AJ4vMoTGRUTcbtgHEkI/IcKzrEhCb9jYZcZu4waayLmGj 8QxGIvHSdnW90KjIyBKy3qZqLSl0aqOn/LAmLncm9kpT77+Kpfe++6eK43sb6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706637302; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7Ny6NywoWunmzBhBBNySUcKZc+wNrxnrl/30NE5mnGY=; b=qFggtmSsq1VLJCo4fI/9B0BG3S571Mh+Dn4rdZV9j+fdzl5I7L++oipCCAX5JPRmJ0Vn+K GwgwjXIe66ofhsVMELk+wMR0uo9VmE7vL5N1I5NLgLxrnD8JTqkEhIgy5fIxR8RJJcbWHE i1lO5zzNk3IKmZ4NETGfZXMN9Lfi7Hnoq5t6W9AVpOKwDY0P2JMLnUVLeq6sND7zVbgFwk TUJm5AYSox2Tz/DXLq57705yqzefTarUn64WUSAXPGOquE1SO0/nq+ssHj0S+COCC6BUWR wDZjwchGVzyADGzyHU4AnODpE1kiQyA5hlc8SI1Ov02UTWNkY1GIaIHeQJ5hSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706637302; a=rsa-sha256; cv=none; b=FAvmuedU9Y7lPwX5/xmNFOCAiEQ+zO6WDqViwE89OMzUBClbRBqV2CyvQfj+alPSXYK1h9 Jo4GiZD026sdg3yBlMOXZKXqg+gQtf5K2j8FNr2PVH/z0QIR4ZXcWrATtBvyZ7EZtinp4/ c3dY6yEPGOacLSz0ykJGrbTmga6QVyZLukWcA2M2mCBZLC0uSQ1F8VIMyLgB42bF3Latkc sP5k5iL7k7aMrbb1Ep/SiA5mUrtosI/YPc+kkm2JSU2nsBrLrGzUPIINyrl8BDiNV8jOjY HDfr0PQyE+ifLEZYSeYny6DGVrDKnhWmu3/70KJpXLEbRa8BrcA8kYdJy8f5og== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPXr62DQLzl39; Tue, 30 Jan 2024 17:55: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 40UHt2wH066388; Tue, 30 Jan 2024 17:55:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UHt2tW066385; Tue, 30 Jan 2024 17:55:02 GMT (envelope-from git) Date: Tue, 30 Jan 2024 17:55:02 GMT Message-Id: <202401301755.40UHt2tW066385@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 31c3fc40dedd - stable/14 - Merge commit 16a1ef86cbc5 from llvm-project (by David CARLIER): List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 31c3fc40dedddadaaa143f0ddf3d61ee7b2493ee Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=31c3fc40dedddadaaa143f0ddf3d61ee7b2493ee commit 31c3fc40dedddadaaa143f0ddf3d61ee7b2493ee Author: Dimitry Andric AuthorDate: 2024-01-27 21:48:58 +0000 Commit: Dimitry Andric CommitDate: 2024-01-30 17:53:14 +0000 Merge commit 16a1ef86cbc5 from llvm-project (by David CARLIER): [compiler-rt] remove hexdump interception. (#79378) a freebsd dev member reported a symbol conflict and intercepting this had little value anyway. This is one part of fixing the WITH_ASAN build. Some executables in the base system define their own hexdump() symbol, which would otherwise conflict with the ASan-intercepted one. Reported by: markj PR: 276597 MFC after: 3 days (cherry picked from commit 31aedef26fc0613f5d61204c624451d57e716ed9) --- .../sanitizer_common/sanitizer_common_interceptors.inc | 15 --------------- .../sanitizer_common/sanitizer_platform_interceptors.h | 1 - 2 files changed, 16 deletions(-) diff --git a/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc b/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc index 0e563fa12022..a6cda8c6bd4f 100644 --- a/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc +++ b/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc @@ -10180,20 +10180,6 @@ INTERCEPTOR(int, __xuname, int size, void *utsname) { #define INIT___XUNAME #endif -#if SANITIZER_INTERCEPT_HEXDUMP -INTERCEPTOR(void, hexdump, const void *ptr, int length, const char *header, int flags) { - void *ctx; - COMMON_INTERCEPTOR_ENTER(ctx, hexdump, ptr, length, header, flags); - COMMON_INTERCEPTOR_READ_RANGE(ctx, ptr, length); - COMMON_INTERCEPTOR_READ_RANGE(ctx, header, internal_strlen(header) + 1); - REAL(hexdump)(ptr, length, header, flags); -} - -#define INIT_HEXDUMP COMMON_INTERCEPT_FUNCTION(hexdump); -#else -#define INIT_HEXDUMP -#endif - #if SANITIZER_INTERCEPT_ARGP_PARSE INTERCEPTOR(int, argp_parse, const struct argp *argp, int argc, char **argv, unsigned flags, int *arg_index, void *input) { @@ -10543,7 +10529,6 @@ static void InitializeCommonInterceptors() { INIT_PROCCTL INIT_UNAME; INIT___XUNAME; - INIT_HEXDUMP; INIT_ARGP_PARSE; INIT_CPUSET_GETAFFINITY; diff --git a/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h b/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h index c740778b6228..d7fe7e29b105 100644 --- a/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h +++ b/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h @@ -594,7 +594,6 @@ #define SANITIZER_INTERCEPT___XUNAME SI_FREEBSD #define SANITIZER_INTERCEPT_FLOPEN SI_FREEBSD #define SANITIZER_INTERCEPT_PROCCTL SI_FREEBSD -#define SANITIZER_INTERCEPT_HEXDUMP SI_FREEBSD #define SANITIZER_INTERCEPT_ARGP_PARSE SI_GLIBC #define SANITIZER_INTERCEPT_CPUSET_GETAFFINITY SI_FREEBSD From nobody Tue Jan 30 17:55:03 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPXr74Yf1z59Gmy; Tue, 30 Jan 2024 17:55: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 4TPXr73xXbz4LxK; Tue, 30 Jan 2024 17:55:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706637303; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xMdm3Zp+0nanhMhZavVOP01u2gNmioNEDvoB2czhBXs=; b=qTwUGqV/BkPeq3nvJy7WJNNjsDf/AFWS/fsMPcSIlyK38ATncjleAIRb1dMMkxN4idO95W kulpNZ8Y3rRshUPwdiZrZJbS7qwkPseS6jPhxEXtd/JJmx7cbLF0gPpdn82DliXjUavVn2 xSxxVvJ+R5HjlZVzRis8rjwX24LBMRY/dVOMM0wzfuJ2hCSe93dPT2A/7LGtDyQ9v7lZOc 8i01ts1jaKL0fsoqkIUW2+D10zAHLyfynm7auU/7n2/iJKj5/FBSAm6EUl0LGeCFwIAu8Q S+ec/A/m/mK1NyLm+UXWo3RZrdbvFJ7lnbwIHJIj3Mhw7pcXimYWYBrMm7oMrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706637303; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xMdm3Zp+0nanhMhZavVOP01u2gNmioNEDvoB2czhBXs=; b=veb+H6di9ytv0sPesEqwbExzdfFvJsjl0ZBHKlNKZjLZjX4T6B2wgWclKcq83nsuREBjXw WyqPZ0hQ5LWSB8ABWqwUbbOUTkZmKy8Dve3en2AnSFbEJxy0TR8kejTAsnoIvoO4kv9DO+ g1tpB7Rdn2x5gazxlxejo+iM4wFDa0/3H88mnJ7fQ7q8z7NWNVjlwZI3kVNoD5p0jvhfNs T8sQSZJRXWKlCrZzLalfQQ4LiTY8GY871Ro6MRfxBu5tKgoTVJ0heh+ylt7LR6kuLSd86e nk5YcGqcGjbiPH7+CuQgzWkVjtmetkzESCkKPS0tZvXzRIMzB7y5X6TkEZG+Nw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706637303; a=rsa-sha256; cv=none; b=NOLLQHvFLG011/ndvsceSiYP+ee02LMUU9gVnKmuFtWB1ugokfTX1ZxI5kiaqm96wK60lc Z4FuUWmBmfjM1Vkl32w6x5mCc3pOmg9H1xHJalMxZbaqKlpvNhnkJB88MaSo4jmWlsPVDd B2bNDXhLrHoT6BQ4ICx22fMDFL0+ZNCLYSAWtYKHjLV514tVqW80EXWqM/TyzQx9VWIxqN eA5/e+PwfNY1TVRWmLMl29ihmHnA0T1THO/V5J38i0d0dOVCxAf+JvdtrRI9afVJXObrJv RCdbOLCYoK75GRg+cVIk7tyzkqbrmCwDYFrp2hd2NFnjbmOrFP8vWWJRDm5k1w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPXr732pyzl80; Tue, 30 Jan 2024 17:55: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 40UHt3YG066439; Tue, 30 Jan 2024 17:55:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UHt3Dq066436; Tue, 30 Jan 2024 17:55:03 GMT (envelope-from git) Date: Tue, 30 Jan 2024 17:55:03 GMT Message-Id: <202401301755.40UHt3Dq066436@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 277382e92885 - stable/14 - msun: remove fabs from Symbol.map, and adjust comment List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 277382e92885ebe2adf29c5052b7e2669c36b58e Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=277382e92885ebe2adf29c5052b7e2669c36b58e commit 277382e92885ebe2adf29c5052b7e2669c36b58e Author: Dimitry Andric AuthorDate: 2024-01-27 21:24:38 +0000 Commit: Dimitry Andric CommitDate: 2024-01-30 17:53:19 +0000 msun: remove fabs from Symbol.map, and adjust comment We have s_fabs.c, but fabs(3) is already provided by libc due to historical reasons, so it is not compiled into libm. When the linker does not use --undefined-version, this leads to a complaint about the symbol being nonexistent, so remove it from Symbol.map. While here, adjust the comment about some functions being supplied by libc: while it is true that all these are indeed in libc, libm still includes its own versions of frexp(3), isnan(3), isnanf(3), and isnanl(3). Reported by: Steve Kargl MFC after: 3 days (cherry picked from commit d04e03c19a8d7660ea36f62720eef9bc96b69889) --- lib/msun/Makefile | 3 ++- lib/msun/Symbol.map | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/msun/Makefile b/lib/msun/Makefile index 9917be01d863..9b64674bbe7d 100644 --- a/lib/msun/Makefile +++ b/lib/msun/Makefile @@ -156,7 +156,8 @@ COMMON_SRCS+= catrig.c catrigf.c \ s_cproj.c s_cprojf.c s_creal.c s_crealf.c s_creall.c \ s_csinh.c s_csinhf.c s_ctanh.c s_ctanhf.c -# FreeBSD's C library supplies these functions: +# FreeBSD's C library supplies these functions (but note we still have s_frexp.c +# and s_isnan.c enabled above, so they are duplicated): #COMMON_SRCS+= s_fabs.c s_frexp.c s_isnan.c s_ldexp.c s_modf.c # Exclude the generic versions of what we provide in the MD area. diff --git a/lib/msun/Symbol.map b/lib/msun/Symbol.map index 6e74918ade6e..4d5a5e4d7e6e 100644 --- a/lib/msun/Symbol.map +++ b/lib/msun/Symbol.map @@ -88,7 +88,6 @@ FBSD_1.0 { exp2f; expm1; expm1f; - fabs; fabsf; fabsl; fdim; From nobody Tue Jan 30 17:55:04 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPXr91FRYz59Grw; Tue, 30 Jan 2024 17:55: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 4TPXr84n8qz4M1F; Tue, 30 Jan 2024 17:55:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706637304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kOGixETthcLi5ke2itnYwwKMQY3y7qCH+lRG1iNwujE=; b=YsclSW9Mya6dhd6X2K7hBl+26shWKPz+oU7pwFckaiDvsAZdWAjrsiAOfqXJK05CjKfpQQ JPc/5/hNEasbxXPBkYMYKX8Fi9ZcYjnjPUrthCnLbbgmE6hEb0HXESW399ISqRp/16DUx1 myGfRABNmKsbAuE32MRjIHYmZmVe7zEq28zvasmvh2CjjYXSy0kZo+TzPl1gzgRYt5Wj9T Vns+/9j7iMf26WqZqDWt9ZdieJDJ6cIN+viR5ewt5B7qn4okA3DiKRlUfm4gy9D6vtvMPF Eq1q0reEAUIOr9SgGEjsSGnn4NdSxB01v30c8S08fKFeKNAuQ23CSnH/m3jcOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706637304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kOGixETthcLi5ke2itnYwwKMQY3y7qCH+lRG1iNwujE=; b=CT6ulup2dW+gjiGOecZpHN2TuaAf3NXjkX81TU9CMiT+b7Wnlb5e01EpaYrx68uy/s5uC9 IR4SPL+d9/K2VbdmSe2FXJ/bl8mYcB4+Ci8OwbqjtZusDH9/GJxC29GA5+z1GLcxvBfQeh rAm2dRIrXTNAXSXJiQaxXrP6eiVGAJt5PkrharVBSy1M63pFJaPraHJxOpGTkuxJnYcEsi xoZNWpJYkh2P9HeWtVGqDKf7Z6ERAJ134xMw1/JCI8KbHtqgbeHrOBlZgEiv+JZ8Fnt1OI LxCpTd4NoHyjL/xeCBpIz6OlNvfXB2i/JZE/Usji6cFgVvOme5WkZyfVnOelAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706637304; a=rsa-sha256; cv=none; b=mu42FKh9mhCSHmNb+BYdD5ypEyquit1P6cR1JRG1tA2cE4pHApLjW34qFZjwtTp/8Xwgvf 6wd3Ko8VoHfsux2udbtS2QYEy4vIQd+RtTfq9TZk45UXx1eMgv3RnFP0aTxMKgzTGtuZIJ nFQigkMXTW2WceyX1LRhqcImU+vrMf287zMP3P7SbW8x4zd/O+/Gsj1x9CxbVkbcBXP+XS PxZ9jwuPli/ClLm47MXZQjjlwTLsTYpZ9MJyXWY3l6s7j6IblFUklbQ7c8P9W6uvfMTEwV ceaOHSIIj08Qwy13koE75PcjK9+WZ6lpGnrVtzBgUR+pB3W6KnywkuZLy3UOYw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPXr83tRxzlm8; Tue, 30 Jan 2024 17:55: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 40UHt49M066497; Tue, 30 Jan 2024 17:55:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UHt41P066494; Tue, 30 Jan 2024 17:55:04 GMT (envelope-from git) Date: Tue, 30 Jan 2024 17:55:04 GMT Message-Id: <202401301755.40UHt41P066494@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 6ccc51fd6f28 - stable/14 - Add libllvm and liblldb source files to enable WITH_ASAN build List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6ccc51fd6f28af3a4516cc058135f519cbeb30e0 Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=6ccc51fd6f28af3a4516cc058135f519cbeb30e0 commit 6ccc51fd6f28af3a4516cc058135f519cbeb30e0 Author: Dimitry Andric AuthorDate: 2024-01-27 21:51:08 +0000 Commit: Dimitry Andric CommitDate: 2024-01-30 17:53:25 +0000 Add libllvm and liblldb source files to enable WITH_ASAN build This is another part of fixing the WITH_ASAN build. Some additional source files had to be added to libllvm and liblldb, since the ASan instrumentation causes symbols in those files to be referenced. Reported by: markj PR: 276597 MFC after: 3 days (cherry picked from commit 5c38ea60a04199dae2c6e5db82461e7275c7def6) --- lib/clang/liblldb/Makefile | 5 +++++ lib/clang/libllvm/Makefile | 2 ++ 2 files changed, 7 insertions(+) diff --git a/lib/clang/liblldb/Makefile b/lib/clang/liblldb/Makefile index 0dbcac7d3068..c32e4a387b2e 100644 --- a/lib/clang/liblldb/Makefile +++ b/lib/clang/liblldb/Makefile @@ -421,8 +421,13 @@ SRCS+= Plugins/Language/ObjC/NSString.cpp SRCS+= Plugins/Language/ObjC/ObjCLanguage.cpp SRCS+= Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp SRCS+= Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp +SRCS+= Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp +SRCS+= Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp SRCS+= Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp +SRCS+= Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp +SRCS+= Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp SRCS+= Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp +SRCS+= Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp SRCS+= Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp SRCS+= Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.cpp SRCS+= Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp diff --git a/lib/clang/libllvm/Makefile b/lib/clang/libllvm/Makefile index 3ac81305df19..df39f2eb212e 100644 --- a/lib/clang/libllvm/Makefile +++ b/lib/clang/libllvm/Makefile @@ -666,6 +666,7 @@ SRCS_MIW+= DebugInfo/Symbolize/Symbolize.cpp SRCS_MIW+= Debuginfod/BuildIDFetcher.cpp SRCS_MIW+= Debuginfod/Debuginfod.cpp SRCS_MIW+= Debuginfod/HTTPClient.cpp +SRCS_MIW+= Debuginfod/HTTPServer.cpp SRCS_MIN+= Demangle/DLangDemangle.cpp SRCS_MIN+= Demangle/Demangle.cpp SRCS_MIN+= Demangle/ItaniumDemangle.cpp @@ -1645,6 +1646,7 @@ SRCS_MIW+= TextAPI/ArchitectureSet.cpp SRCS_MIW+= TextAPI/InterfaceFile.cpp SRCS_MIW+= TextAPI/PackedVersion.cpp SRCS_MIW+= TextAPI/Platform.cpp +SRCS_MIW+= TextAPI/Symbol.cpp SRCS_MIW+= TextAPI/SymbolSet.cpp SRCS_MIW+= TextAPI/Target.cpp SRCS_MIW+= TextAPI/TextStub.cpp From nobody Tue Jan 30 17:55:20 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPXrS5PqVz59GPt; Tue, 30 Jan 2024 17:55:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TPXrS4t8yz4N5d; Tue, 30 Jan 2024 17:55:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706637320; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xlYmRDYLKHrNg9hbwYuhuYsBhxazLlaci88QulhgCTA=; b=fDkbVXgBS17hX5B0JA5oSYy5FZCS0MOfZ+6N78G2V4IgUqltJYskpyTVNsMINLrTaT0pZd Wr05Dp1Qu9pE14ZZMhKuSrKw5SCmNoIhkhLFmLq++fo6vi/eDl4XKZ2TzeoDZNdBtobR4W EvOSK57B3tJPsm+bd2Z/KOpcMlHY8nsoy9t4JdjiBaYfgJWZu3JY6mVpfPgAnd8RBzk34m n+WY8mUrJGTTsG2bRYV6W6iWx+YZnYynkinRbG3DA7alaqpYRjKrlMiXnGXYYGOTdcpQdh MCnRCeCrRYab6iuuNpHygfUgdSMI5IUxIZGXvg/g4NW6rjHicF4sXP3w+sUCNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706637320; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xlYmRDYLKHrNg9hbwYuhuYsBhxazLlaci88QulhgCTA=; b=E7oUs52/TY/ZaDZZQlkv8SQxA3LfovycnTc9iJsctUyAJCp+QMhCdIwbirBp5O0A7NPRJX OGo4mJaQ1qVB6m6A6pSgdw9t/5KfpCZ1P64zcV/IrnN3DaiIge+Uidx1Wp9Qz+WTJnV4FY v54l2YV0TCTcLGbYu8RvZG4fmYRXC2MoMlrBwaJ9oZ1+RrdSusuxS6+KqnqMPzFcFQilA1 6Q+l3twFBIOVaJsxEaoB6ABtbaLW9yqIkXwhty0a6kBgZNOOWJJWAFJ6hYOelNweahWii7 NWY+n8uIPZzXNcQBHOi/bt8icWZb4e7DHbQxM4gUbF+zLpNLxPJZ4tVpZ09iuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706637320; a=rsa-sha256; cv=none; b=SQlVxmC9DQXEkJI8zKI0r/5vQmshHn44hQsYIbzwiw65ZQzMliIKBVG3DZVgOX8X0FzsCG s5NFDOS44lo4YTp/yIF8Ga6EWGD67rrG1+9DlY5zmrsg4KT2Q2y6X9xp1eRfLV1RflP+ug 4ky4D8qat5NvG9v+rGn9LC3M/Mil6EZp+T5SMdUOZLjEtb6Ptmlt8s/JMcU/uUIsQLcmmF roZ2cONFbVjRh9jOdaqAearWNwmfyYdJsHJlgntYEIkDqXS3czjyeUy8zvokR81UEZCIX4 Wo421ml+fgxgc41rZqmEwwTmLRDmSQUKbn5SU0jAbWpwZVPE70QkhaJr4u0xkA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPXrS3zxGzlT0; Tue, 30 Jan 2024 17:55:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40UHtKw3066713; Tue, 30 Jan 2024 17:55:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UHtKxh066710; Tue, 30 Jan 2024 17:55:20 GMT (envelope-from git) Date: Tue, 30 Jan 2024 17:55:20 GMT Message-Id: <202401301755.40UHtKxh066710@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 3bd3724e4c86 - stable/13 - Merge commit 16a1ef86cbc5 from llvm-project (by David CARLIER): List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3bd3724e4c8685d98bfc6feb3024b8bb213eed49 Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=3bd3724e4c8685d98bfc6feb3024b8bb213eed49 commit 3bd3724e4c8685d98bfc6feb3024b8bb213eed49 Author: Dimitry Andric AuthorDate: 2024-01-27 21:48:58 +0000 Commit: Dimitry Andric CommitDate: 2024-01-30 17:53:39 +0000 Merge commit 16a1ef86cbc5 from llvm-project (by David CARLIER): [compiler-rt] remove hexdump interception. (#79378) a freebsd dev member reported a symbol conflict and intercepting this had little value anyway. This is one part of fixing the WITH_ASAN build. Some executables in the base system define their own hexdump() symbol, which would otherwise conflict with the ASan-intercepted one. Reported by: markj PR: 276597 MFC after: 3 days (cherry picked from commit 31aedef26fc0613f5d61204c624451d57e716ed9) --- .../sanitizer_common/sanitizer_common_interceptors.inc | 15 --------------- .../sanitizer_common/sanitizer_platform_interceptors.h | 1 - 2 files changed, 16 deletions(-) diff --git a/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc b/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc index 0e563fa12022..a6cda8c6bd4f 100644 --- a/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc +++ b/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc @@ -10180,20 +10180,6 @@ INTERCEPTOR(int, __xuname, int size, void *utsname) { #define INIT___XUNAME #endif -#if SANITIZER_INTERCEPT_HEXDUMP -INTERCEPTOR(void, hexdump, const void *ptr, int length, const char *header, int flags) { - void *ctx; - COMMON_INTERCEPTOR_ENTER(ctx, hexdump, ptr, length, header, flags); - COMMON_INTERCEPTOR_READ_RANGE(ctx, ptr, length); - COMMON_INTERCEPTOR_READ_RANGE(ctx, header, internal_strlen(header) + 1); - REAL(hexdump)(ptr, length, header, flags); -} - -#define INIT_HEXDUMP COMMON_INTERCEPT_FUNCTION(hexdump); -#else -#define INIT_HEXDUMP -#endif - #if SANITIZER_INTERCEPT_ARGP_PARSE INTERCEPTOR(int, argp_parse, const struct argp *argp, int argc, char **argv, unsigned flags, int *arg_index, void *input) { @@ -10543,7 +10529,6 @@ static void InitializeCommonInterceptors() { INIT_PROCCTL INIT_UNAME; INIT___XUNAME; - INIT_HEXDUMP; INIT_ARGP_PARSE; INIT_CPUSET_GETAFFINITY; diff --git a/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h b/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h index c740778b6228..d7fe7e29b105 100644 --- a/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h +++ b/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h @@ -594,7 +594,6 @@ #define SANITIZER_INTERCEPT___XUNAME SI_FREEBSD #define SANITIZER_INTERCEPT_FLOPEN SI_FREEBSD #define SANITIZER_INTERCEPT_PROCCTL SI_FREEBSD -#define SANITIZER_INTERCEPT_HEXDUMP SI_FREEBSD #define SANITIZER_INTERCEPT_ARGP_PARSE SI_GLIBC #define SANITIZER_INTERCEPT_CPUSET_GETAFFINITY SI_FREEBSD From nobody Tue Jan 30 17:55:21 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPXrT6RnXz59Ggw; Tue, 30 Jan 2024 17:55: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 4TPXrT5wzVz4N3W; Tue, 30 Jan 2024 17:55:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706637321; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ay8g1isjJSSLdLQUvvBBofwNSN2zIKKnipFREjiMdb8=; b=u+Z/WT6TFxMWDwLlzT2MeeVgbXZasxZ1dkvODM9eqGRBiYrEZVzvuBwMxbUapybFDBsVSB 7KKqYLx7abyIm2Eu6YMRkShHZFwxfl8ynrasxsGPDgAY0QT+ytZGDqVKDeFDEG3HEzAJNM WjwMucjXNaAhF5U5p3LodIvyWz0oCHcIIi+vEorHhJqoAI2LiSLOK1FtKBTadqsxidoerz o09VVK2IOBbmMC8F7poZ7h/3KbrrBrq92A3ngSm5zCYUAwsNGe7rUDECC9AQk4s8qhKWkc rDcloKt3xAezheawhlqxvD3LZvDiu88wzZVNCti/hCrRZv9x78tl6OnoqxqPEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706637321; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ay8g1isjJSSLdLQUvvBBofwNSN2zIKKnipFREjiMdb8=; b=quqS6bx2ugPQko4RMi3vH90YN0URkCy22xrxGRPEN/aGDtR95O0cEHUV9N8ojG4m/eC61n 4i9DgZna/8pSS2+E58bAnobKFRI1e5Rpro6xF9fBC4LU1RhiW+QCiXTaaOnVGorCp8tjjF vm0MmuhXZzH09GfpZxD50xnkLlFacFHpxFB+rOjj9Os8+WG/VOzIt268XcZdbX9M/DD+G4 Pjgqsh4AxXulYwbX29+YRVM9iMT9xRuZaRz07LSlG8LNPWEgxnPVhL48L0xZsUwjLdwoog e6VqhOTzzMzYXG66d7wplihiPbqNQJUuWrsWdYurrAXY4Ps/lfXBTcY3VbBdHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706637321; a=rsa-sha256; cv=none; b=eI74pd6tLGxV228ukcLWLWTeKvShWQ/+rRauC9vJOdDkLGnHnzRxhWgGGSnNHYm1GqOf95 bTrdFQgv4pXkvj1psI2gZKyw32oLffd1ZBKSQ54qgWGSLCOAc0bKiB2g8mr4j1azJfNbHl 8GFSSBOS5Mv2G2jM8bJMsCt2GAihD+CkD/e+iE+lqG0a6q7H9OHIqvoTRyX/EEYcnaqpXZ O/Ae4OqsBYnfAww4sgUySFlEcz8BTrIHBegAZHmHYu0x/58d4tBYcSYHkFhX0jJBmxpynO VYpBkMChuHbm3jEtuWpvvlh4t8xfGtBSP3PKQr1pGsMulcT2fF4hcgN6t7T/FA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPXrT52TGzldR; Tue, 30 Jan 2024 17:55: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 40UHtLKD066764; Tue, 30 Jan 2024 17:55:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UHtLEQ066761; Tue, 30 Jan 2024 17:55:21 GMT (envelope-from git) Date: Tue, 30 Jan 2024 17:55:21 GMT Message-Id: <202401301755.40UHtLEQ066761@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 869cfe9fedd7 - stable/13 - msun: remove fabs from Symbol.map, and adjust comment List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 869cfe9fedd77d676dec565ffb2cbe1e5c5e5d5d Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=869cfe9fedd77d676dec565ffb2cbe1e5c5e5d5d commit 869cfe9fedd77d676dec565ffb2cbe1e5c5e5d5d Author: Dimitry Andric AuthorDate: 2024-01-27 21:24:38 +0000 Commit: Dimitry Andric CommitDate: 2024-01-30 17:53:47 +0000 msun: remove fabs from Symbol.map, and adjust comment We have s_fabs.c, but fabs(3) is already provided by libc due to historical reasons, so it is not compiled into libm. When the linker does not use --undefined-version, this leads to a complaint about the symbol being nonexistent, so remove it from Symbol.map. While here, adjust the comment about some functions being supplied by libc: while it is true that all these are indeed in libc, libm still includes its own versions of frexp(3), isnan(3), isnanf(3), and isnanl(3). Reported by: Steve Kargl MFC after: 3 days (cherry picked from commit d04e03c19a8d7660ea36f62720eef9bc96b69889) --- lib/msun/Makefile | 3 ++- lib/msun/Symbol.map | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/msun/Makefile b/lib/msun/Makefile index 8bc984c2c342..03146bd39463 100644 --- a/lib/msun/Makefile +++ b/lib/msun/Makefile @@ -146,7 +146,8 @@ COMMON_SRCS+= catrig.c catrigf.c \ s_cproj.c s_cprojf.c s_creal.c s_crealf.c s_creall.c \ s_csinh.c s_csinhf.c s_ctanh.c s_ctanhf.c -# FreeBSD's C library supplies these functions: +# FreeBSD's C library supplies these functions (but note we still have s_frexp.c +# and s_isnan.c enabled above, so they are duplicated): #COMMON_SRCS+= s_fabs.c s_frexp.c s_isnan.c s_ldexp.c s_modf.c # Exclude the generic versions of what we provide in the MD area. diff --git a/lib/msun/Symbol.map b/lib/msun/Symbol.map index 6e74918ade6e..4d5a5e4d7e6e 100644 --- a/lib/msun/Symbol.map +++ b/lib/msun/Symbol.map @@ -88,7 +88,6 @@ FBSD_1.0 { exp2f; expm1; expm1f; - fabs; fabsf; fabsl; fdim; From nobody Tue Jan 30 17:55:22 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPXrW2D79z59Ggx; Tue, 30 Jan 2024 17:55: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 4TPXrV6h39z4Mvj; Tue, 30 Jan 2024 17:55:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706637322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qkvx3GF3Tle6Ny6lArNEv6bmPX38YqW1K0B4LLF4ryg=; b=pajuv/YPiJfCRkdXTjoAltsXTND1BroldXMjXdlw/m06GZ0yyfPitzilpTGz3UV/9pHKIM wyYHhNCvQmMHu4+RDuBLsJitg/tTLmpNiCa/9DiGV33iIe9qfiTo/ZHE8rRQ14NuShuQ3Q L1dQ0cU7ft+D2jakc5I7ej0XkZmcRtc45A1NwggWEH31P+VBKDV02+gY/2aZdb61OWEdjQ PjURlWhb4urRtmk0iThRw/75G/hgd2NSTPtsefBytRRfmOUFBRk4VZhmBBEmBsGCJ4WPFy L7mn9PkkIgepfuFE7x979xTmPT+4nYeAbVE3d9fzx+qHJ1S5prA81PbnWI1tQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706637322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qkvx3GF3Tle6Ny6lArNEv6bmPX38YqW1K0B4LLF4ryg=; b=IrT0jJD2u0rqAHnYXhW6867JVhI1m9NiLxX4wnZUkgVGlVhO0vuvXzxrRyiBM1yhOrT7+g 3VEorHQUYZ6SI9UO7EVjm3sGzprHOLyC0CA4czPAWRPZTBniwmbS4DEIQkPubpagtVPmzw 3iegefuxvNkpEmDfT7RTf2CcJQ5nNZpfdsP9oc0S0NSns9RDaxBI08FAgBkJlE1Z96jDJ1 gvkdcbh3tlu6z+rhLxuHvBsSvXK/lh7QK2+SuUho/76rLMenA1dxATwrfZsK5yrOa+MQTK GJJmA/iLhK4n+gkMizw9GMHwc7ndvYS4dUw6l/RZCWAVKExSJjyQMRe+oZ04YA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706637322; a=rsa-sha256; cv=none; b=XA/uDqIqfQRgiRQls07pM4W21WqYgc7oTK70s9s9ky1lrKOz/1vtifmTZXIps4mM3/I1q5 kfVggbFnZA+gEf8vdQrIF3QObPIe61R91MdfG0GyP+hPxWSr65qBFOXXmEnIN/Tol4Q+yh UNviJ2vSlRQ7iZHz1tJAaYsm9LSw5beg0LOczo65eGBqAi9rjwjNFwglo0QdIlWL+KfWQ+ 7YUL9RPyyIbQbPP6MshUDDMmcGRmKF8wvvqDzvnDzo4peh9/9ruoTxQF9fpkqStE6hP8CC G0kFWpRCL7b7QzgDdsphLTbYnDRbQfVrDyEVAxuJz4t8ZKrDMded36HDLySHPQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPXrV5krMzldS; Tue, 30 Jan 2024 17:55: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 40UHtMqT066821; Tue, 30 Jan 2024 17:55:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UHtM96066818; Tue, 30 Jan 2024 17:55:22 GMT (envelope-from git) Date: Tue, 30 Jan 2024 17:55:22 GMT Message-Id: <202401301755.40UHtM96066818@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: e68356676e9c - stable/13 - Add libllvm and liblldb source files to enable WITH_ASAN build List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e68356676e9c4e5a36dd20560f19845ae073dab3 Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=e68356676e9c4e5a36dd20560f19845ae073dab3 commit e68356676e9c4e5a36dd20560f19845ae073dab3 Author: Dimitry Andric AuthorDate: 2024-01-27 21:51:08 +0000 Commit: Dimitry Andric CommitDate: 2024-01-30 17:53:51 +0000 Add libllvm and liblldb source files to enable WITH_ASAN build This is another part of fixing the WITH_ASAN build. Some additional source files had to be added to libllvm and liblldb, since the ASan instrumentation causes symbols in those files to be referenced. Reported by: markj PR: 276597 MFC after: 3 days (cherry picked from commit 5c38ea60a04199dae2c6e5db82461e7275c7def6) --- lib/clang/liblldb/Makefile | 5 +++++ lib/clang/libllvm/Makefile | 2 ++ 2 files changed, 7 insertions(+) diff --git a/lib/clang/liblldb/Makefile b/lib/clang/liblldb/Makefile index 0dbcac7d3068..c32e4a387b2e 100644 --- a/lib/clang/liblldb/Makefile +++ b/lib/clang/liblldb/Makefile @@ -421,8 +421,13 @@ SRCS+= Plugins/Language/ObjC/NSString.cpp SRCS+= Plugins/Language/ObjC/ObjCLanguage.cpp SRCS+= Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp SRCS+= Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp +SRCS+= Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp +SRCS+= Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp SRCS+= Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp +SRCS+= Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp +SRCS+= Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp SRCS+= Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp +SRCS+= Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp SRCS+= Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp SRCS+= Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.cpp SRCS+= Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp diff --git a/lib/clang/libllvm/Makefile b/lib/clang/libllvm/Makefile index 3ac81305df19..df39f2eb212e 100644 --- a/lib/clang/libllvm/Makefile +++ b/lib/clang/libllvm/Makefile @@ -666,6 +666,7 @@ SRCS_MIW+= DebugInfo/Symbolize/Symbolize.cpp SRCS_MIW+= Debuginfod/BuildIDFetcher.cpp SRCS_MIW+= Debuginfod/Debuginfod.cpp SRCS_MIW+= Debuginfod/HTTPClient.cpp +SRCS_MIW+= Debuginfod/HTTPServer.cpp SRCS_MIN+= Demangle/DLangDemangle.cpp SRCS_MIN+= Demangle/Demangle.cpp SRCS_MIN+= Demangle/ItaniumDemangle.cpp @@ -1645,6 +1646,7 @@ SRCS_MIW+= TextAPI/ArchitectureSet.cpp SRCS_MIW+= TextAPI/InterfaceFile.cpp SRCS_MIW+= TextAPI/PackedVersion.cpp SRCS_MIW+= TextAPI/Platform.cpp +SRCS_MIW+= TextAPI/Symbol.cpp SRCS_MIW+= TextAPI/SymbolSet.cpp SRCS_MIW+= TextAPI/Target.cpp SRCS_MIW+= TextAPI/TextStub.cpp From nobody Tue Jan 30 17:56:58 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPXtM0GBcz59GsN; Tue, 30 Jan 2024 17:56: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 4TPXtL6gRfz4Ns0; Tue, 30 Jan 2024 17:56:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706637418; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kmYsTLL2VvV/4yv/URzSeFb5E8EB6CK5+h6vX0UO0Kc=; b=dkXt3ycOjV7GQ5MHM8E3o/hftHVy1llN5gRC1KBvoeG044V7V3DM5w5OfremePE5SOGpbG 14QNpL8kjFYgWccu7MGL+8beblLKwnswYpHTIKRLw2WBxXTGdP9FmIn0hdDSviY0gSBMC8 elY7yOxOEmAH88qpt+Q+M7q+NVl2rNNo/iBFjX4X9VA6Qtcbi3HblgxpdATfv4w8kZ+uKP TKTOL3yrIncgUUF8tmBM0DhSszTqF8Lve2TnsukSQ3ZiPl1N/hQeYpff/MxXeeiu3uHzaZ R+7PKVo0P7jpLL7So15JhKOg0AbxA2Q4yfIKSRcyyNyif7amAbBo9em7AOMggg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706637418; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kmYsTLL2VvV/4yv/URzSeFb5E8EB6CK5+h6vX0UO0Kc=; b=cBOIYOx6vkheAj7IEqueDVSjJ1olarWkBG2HW8lAWn4aTvgcbXbB6EvTUsw+SKE17gLc15 udUnuT/Sab+owGaonoTVltaHG3cLugHOnCTNaxwoUlqQq4ePe/zvVbeVVFjTeXushC1Kf1 96UmOR2d/zkv96Sq0Q9QSy8JUhDGmzuha/v5rvnj3dvk4jyWSKvUk/ThGCL9D4XY8nsiNa 6oE/6lrmJbBulv3IqgpaN73VSOKtrYNYaU6t35Vl3LzfXXmE02VCftiZ2iYnFYlTRw0woS ocxnmIP1FSWQqibug6q6TaSTYvYfk28VumILQINc8rBvF9PIHd/RucA7uHCyGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706637418; a=rsa-sha256; cv=none; b=jV2FG1WRV1L3BE3vHbkHtR6Yy6Y764o/6bS1JYLad4fyuVAgOfb2duLd1ovdO1Q8lz2WUK UdBlKu1Amcan6E2XiY54RGxWOmVc2bos9Hu73oOsJtcG+NGpG81zeBgLH4h/DRRJ4ru3Za luSs//B90A6wmZqDiCEriiI8PTTRIrgmM2McD8kghLHqB7OY8dHl+c+ITjjCFWtv3Qv/uC WICouKd6T6oAdaa6KiarIr/yb36y2sXH7Qvz6m0cUmapzbejQUklWv91H1bzLvzaMYs6bc emex5O0k1j7Hwl3Ul/M0B/rtEUBiGaDrjBZRaqCOLZqejrJFNF3DmhpL1f5GJg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPXtL5ch1zldb; Tue, 30 Jan 2024 17:56: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 40UHuwMr067292; Tue, 30 Jan 2024 17:56:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UHuw2d067289; Tue, 30 Jan 2024 17:56:58 GMT (envelope-from git) Date: Tue, 30 Jan 2024 17:56:58 GMT Message-Id: <202401301756.40UHuw2d067289@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: ca89a51d407a - stable/12 - msun: remove fabs from Symbol.map, and adjust comment List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ca89a51d407a1d6b78d27b8d407f0c12f7c8c9a1 Auto-Submitted: auto-generated The branch stable/12 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=ca89a51d407a1d6b78d27b8d407f0c12f7c8c9a1 commit ca89a51d407a1d6b78d27b8d407f0c12f7c8c9a1 Author: Dimitry Andric AuthorDate: 2024-01-27 21:24:38 +0000 Commit: Dimitry Andric CommitDate: 2024-01-30 17:52:55 +0000 msun: remove fabs from Symbol.map, and adjust comment We have s_fabs.c, but fabs(3) is already provided by libc due to historical reasons, so it is not compiled into libm. When the linker does not use --undefined-version, this leads to a complaint about the symbol being nonexistent, so remove it from Symbol.map. While here, adjust the comment about some functions being supplied by libc: while it is true that all these are indeed in libc, libm still includes its own versions of frexp(3), isnan(3), isnanf(3), and isnanl(3). Reported by: Steve Kargl MFC after: 3 days (cherry picked from commit d04e03c19a8d7660ea36f62720eef9bc96b69889) --- lib/msun/Makefile | 3 ++- lib/msun/Symbol.map | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/msun/Makefile b/lib/msun/Makefile index 4771de91c561..15c56d10a8e3 100644 --- a/lib/msun/Makefile +++ b/lib/msun/Makefile @@ -143,7 +143,8 @@ COMMON_SRCS+= catrig.c catrigf.c \ s_cproj.c s_cprojf.c s_creal.c s_crealf.c s_creall.c \ s_csinh.c s_csinhf.c s_ctanh.c s_ctanhf.c -# FreeBSD's C library supplies these functions: +# FreeBSD's C library supplies these functions (but note we still have s_frexp.c +# and s_isnan.c enabled above, so they are duplicated): #COMMON_SRCS+= s_fabs.c s_frexp.c s_isnan.c s_ldexp.c s_modf.c # Exclude the generic versions of what we provide in the MD area. diff --git a/lib/msun/Symbol.map b/lib/msun/Symbol.map index 51deded732f0..435fbed5642e 100644 --- a/lib/msun/Symbol.map +++ b/lib/msun/Symbol.map @@ -89,7 +89,6 @@ FBSD_1.0 { exp2f; expm1; expm1f; - fabs; fabsf; fabsl; fdim; From nobody Tue Jan 30 18:20:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPYPG2Mpcz59Jd0; Tue, 30 Jan 2024 18:20:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TPYPG1v9Dz4RVq; Tue, 30 Jan 2024 18:20:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706638818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1pLeFOrHdrUC103vjqZ3SQkaEybHKS7iT+UPJs6Pkf0=; b=bi8T8Xav3EEOhxNoWtNQqcYjiEi361OV1sZ6pvskIR8h4hIFKOCHdXgM/NVYNGuj9SID9d /a09Oi9yOfF5dKLOrr1qR6XGyZqClsX1ZuE0ICgPgZiNPpu9f2CPkBBYDNtI6RiU3ZSWU8 5HaPt0feUKLGDGC+fLCr5a9RufY+LiQdnylMEoQKb0ZnDv7bXWH9Ow0nRuYqZIYHeX32fp CYF27TfEoJlXaZNBSTPhm5mWM6fCqhHCQr+5rk73Q1WdUu75gbKB4CLk4V4u9NVYOB8D0u UidHIhgDbTpmrNQ0dQ2I4ZCVCWvDrS7af0JiQeMHnIglpswB0NysEvJO5GC9FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706638818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1pLeFOrHdrUC103vjqZ3SQkaEybHKS7iT+UPJs6Pkf0=; b=QcMuRt+Gm7HVg7p/QkQkjQPh6GqeL/bO/X4Xh5V+y2m8eLdSMSAxuic9JSvy34aBya+PIM tqjNoW7HZRUO7H35EMXbv5OhKBwObAd2IGsTF+hKAkOqOg8peMHGiDPZPxARXnZHg+2cVr sZfGbzGnr52k4CSLrn/C8rHw+806eTGK0+LnmwkMMGs47WEQyY20BPwS3XgbQ/C5hmZmBI SvMYrG1KiwMYO3YY4lAWQZflihbiM6KrgZ5auUhrY4wlxIE12xtdnkZKPmC+GFVx3hhwQ+ j89RgbYnsDgfgJmNLZUhkOqFvx/iWcfd5kN/+0D203uAfv7LTEx9Whv3Bl9q7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706638818; a=rsa-sha256; cv=none; b=WcE++Uc0PxsY9/99a6IHy7E/iH1nCoT5BiSDjUfRBZhKlWt5KGBkcKE39kpjN7qswOwpgJ JsEt3KxtagBceArcnlf9YIuO0dd/GH5vU5P1ofu1P2SCi2SFwBAnuf8oBWqRglPO6zVsiE r18pGd07NvYUe/vsW1Oe/7cHqPjL1/c1VLoATNuDnfmevzQw2CZZZTjYDrM2P2GWlYjbmb zjKoSHO+tlL8iacu1G0/zJWtQTQ4AWW8omb4KYP7pLdhFEiZGIACxuk3+3O0qWzMo04J7R eio+qCr5PB+5HzvK05HJazXEF3kmxtBEUmr3gDd/Vo5au92F+HCmMlsGy3ti0g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPYPG0rg4zmPK; Tue, 30 Jan 2024 18:20:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40UIKIFo010987; Tue, 30 Jan 2024 18:20:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UIKIqc010979; Tue, 30 Jan 2024 18:20:18 GMT (envelope-from git) Date: Tue, 30 Jan 2024 18:20:18 GMT Message-Id: <202401301820.40UIKIqc010979@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 06fc42c0cb1f - stable/14 - libc/amd64: Disable ASAN for amd64_archlevel.c List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 06fc42c0cb1f34063a206d82c7076cba4caf13b9 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=06fc42c0cb1f34063a206d82c7076cba4caf13b9 commit 06fc42c0cb1f34063a206d82c7076cba4caf13b9 Author: Mark Johnston AuthorDate: 2024-01-28 02:49:41 +0000 Commit: Mark Johnston CommitDate: 2024-01-30 18:01:58 +0000 libc/amd64: Disable ASAN for amd64_archlevel.c The code in this file runs before the sanitizer can initialize its shadow map. Fixes: ad2fac552c3f ("lib/libc/amd64: add archlevel-based simd dispatch framework") (cherry picked from commit 4dedcb1bb54cbbe8043c79ad733f966b6ffc6972) --- lib/libc/amd64/string/Makefile.inc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/libc/amd64/string/Makefile.inc b/lib/libc/amd64/string/Makefile.inc index b1369841bc74..d5bb646c5c53 100644 --- a/lib/libc/amd64/string/Makefile.inc +++ b/lib/libc/amd64/string/Makefile.inc @@ -28,3 +28,9 @@ MDSRCS+= \ strspn.S \ timingsafe_bcmp.S \ timingsafe_memcmp.S + +.if ${MK_ASAN} != "no" +# Disable ASAN for amd64_archlevel.c since its code is executed before the +# sanitizer runtime can initialize itself. +CFLAGS.amd64_archlevel.c+= -fno-sanitize=address +.endif From nobody Tue Jan 30 20:10:44 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPbrh5Kccz59T95; Tue, 30 Jan 2024 20:10:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TPbrh4mpXz4dGf; Tue, 30 Jan 2024 20:10:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706645444; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WciP65kVBJSWODgoQUYO8FPgBpN5E6iEm8Wk1CquDwk=; b=nUYveJFenEz2YiaXo8yQ8VONw+DD17FZRwV40KolDuqkWWuHDjhPgwvYYWVwyPWpJFOrzJ il6qC0MoO6dpmj5Y9KTwRmnrRemPqd8FWYHx6ahPuk5+gGT52iBp68VodgFBZLXCDlcowP 1MPh3BqRRh0IbSwUone5tpHE6WxOwdBRDNXqXOBMXepNRAhaf8wRGSb2YvGzdydsoShCp4 zi0hHe3EHgsMZnO8YfN+xoI2cGc3OhEmDSHiLUcZDyQKV+I6I3j85tByX+OweiCdWbbLIR ABRc705vjyo/pppFiLxQXtzPHa58ruKvQrWUa/5liwXV4/7h5fTwIwzS9/Om6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706645444; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WciP65kVBJSWODgoQUYO8FPgBpN5E6iEm8Wk1CquDwk=; b=TKcBV8Y4Tuj2hbKHaJ4oFbu6wc1tObifD2mf7FPact31UojpFxyQeKO6IZHETopt5E0qlP vkpYZY4B5cFJBFjrY0F8AyEgi1AoDp684734ePfJtq0xzI+cpyPp2oZSk57ods1yXJoyyd Ev77hBiExdjKuEp12CblGtaVnh3kZz9WpFbLXr3VumqJngjyQ8r3d17f9XNdz3WjFq7trz p8NF/mshcMv0muFNnhigc8OQ3Q+KSqkeUiqIibAPeiQC1rvZwN8F3aqop0EQN1y2sKzr/s ibapCayX+gzhNruQATX0mtfcH/DM5/XO9I4Wvg2K2aPwz0/6ad/GHgxh/I7WMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706645444; a=rsa-sha256; cv=none; b=PapZHe1a5EUbpKTwUfHt2ycOkUcZM8lxyDZbjZK2tiK7hl4hJ/eIbiGJlrH0G3HLkI1KRJ 2csJ6XzxqwKdEEbyzegbhsBldIGzj0DPKjIdccQ8cGZ4JYwohf46Z4sRdHlvog1jGcykzZ tTF29UOvyLFRpXFg2o32Q60Y/ev7jeD+MPm3oX7xEzCMcGRLeJc7xTicEIC26DSpBwJueB BW3C4LJ0YuSdo/Slh/B2fk0ZmnHGZ9kGaeX06uE86NxHdpPkL6N9etVOoYnxNLVHEX9Z5g T6bJX4nB7FS8K9CDQEFO4h2WAlEFVEdhKMaZhtcksX95azVdhW5zWOB72571GA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPbrh3qvmzpsC; Tue, 30 Jan 2024 20:10: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 40UKAiKk096773; Tue, 30 Jan 2024 20:10:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UKAiTM096770; Tue, 30 Jan 2024 20:10:44 GMT (envelope-from git) Date: Tue, 30 Jan 2024 20:10:44 GMT Message-Id: <202401302010.40UKAiTM096770@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: 0c6e3bfd1362 - stable/14 - arm64/RPI: enable powerd by default on arm64-aarch64-RPI images List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0c6e3bfd13621cfa2dbc432b08cbfb3dcf012d87 Auto-Submitted: auto-generated The branch stable/14 has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=0c6e3bfd13621cfa2dbc432b08cbfb3dcf012d87 commit 0c6e3bfd13621cfa2dbc432b08cbfb3dcf012d87 Author: Mike Karels AuthorDate: 2024-01-05 19:41:24 +0000 Commit: Mike Karels CommitDate: 2024-01-30 20:10:00 +0000 arm64/RPI: enable powerd by default on arm64-aarch64-RPI images Most 64-bit Raspberry Pi models have a variable processor clock speed that defaults to a slow speed (e.g. 600 MHz for a nominal 1.5 GHz clock). This results in everything running slowly unless or until powerd is started, and FreeBSD is then thought to be slow. Enable powerd by default in /etc/rc.conf on the arm64-aarch64-RPI images. Tested on Raspberry Pi 3B+ and 4B so far. PR: 256836 Reviewed by: rgrimes Differential Revision: https://reviews.freebsd.org/D43296 (cherry picked from commit 4347ef60501f2a55ad31f7532ad903b81f3af18f) --- release/arm64/RPI.conf | 1 + release/tools/arm.subr | 3 +++ 2 files changed, 4 insertions(+) diff --git a/release/arm64/RPI.conf b/release/arm64/RPI.conf index 4f668cabea77..1a36a3af521e 100644 --- a/release/arm64/RPI.conf +++ b/release/arm64/RPI.conf @@ -17,6 +17,7 @@ OL_DIR="${DTB_DIR}/overlays" OVERLAYS="mmc.dtbo pwm.dtbo disable-bt.dtbo" PART_SCHEME="MBR" export BOARDNAME="RPI" +CONFIG_POWERD_ENABLE=1 arm_install_uboot() { UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi-arm64" diff --git a/release/tools/arm.subr b/release/tools/arm.subr index c7beb6692f7a..2a3a278fbee6 100644 --- a/release/tools/arm.subr +++ b/release/tools/arm.subr @@ -224,6 +224,9 @@ arm_install_base() { echo 'sendmail_outbound_enable="NO"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf echo 'sendmail_msp_queue_enable="NO"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf echo 'growfs_enable="YES"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf + if [ -n "${CONFIG_POWERD_ENABLE}" ]; then + echo 'powerd_enable="YES"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf + fi sync umount_loop ${CHROOTDIR}/${DESTDIR} From nobody Tue Jan 30 20:10:45 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPbrk0xSjz59TFn; Tue, 30 Jan 2024 20:10: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 4TPbrj65B2z4dXl; Tue, 30 Jan 2024 20:10:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706645445; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KG5nuZgFrqjl5FJvsl3XSlaQwlfznoA9yFw4uRDkZXs=; b=SyMz39KLJe2y74yFoTlcy2Xp8aw72fZalHxhk3E7hDJmWbZbGmniuZjcGZdIApSHFxEap2 71yQtfx6N3JOjL1HLBDyMlmTqzANOlN1GEE92FNp7drhGsxHVL9djaHfTJhFg0DBCShs5V S95zS0PTkVxFaKxVAi8CcDjENcLpvDVFC9Ggx0QpdybtwH/0/lnU9XAWLD+vu0IKbZoZW+ sRUvtpd4Pq+VFK4fwsQvom5V65/19CgXiSc39W4r9dWoMljhEqKLS/uiQ04AnU0MufAW6t V1JqEHF+MiU3hiHsclsHSIzltuMspPpcc9KJAPuk0EcyairoUXkNAiQtZTqnoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706645445; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KG5nuZgFrqjl5FJvsl3XSlaQwlfznoA9yFw4uRDkZXs=; b=JhRJcWbFN9IyYfwTeFo2c01jbFlCtFO1v/B66axGak0oH23zEVtJIO6z8qRbx7WVej+Y52 4RUJCH8mECHSQkkIgIR4h2lAgUCYl1hKzAKKiqyEy1ASTjyo2SHxsk3zVPQtfkh7lf24lX VSjDewatxKVI94T46eoqiPn5mu7BFRdbXxf4JF1aKBoUPi7Eq6grzQwBOoc+uoRjZ2BhJa EJ1SwjudqJ2lRSHsZV7Qe8cceebKNZFDXAK3aIiljuFLDrYxFO3SnijgCConS6w0AAOARI sHXxEW457M50orRCWIoIvSTsacO2Nwrm1AAKzjQ2yA+bc8O7D2dyS922Ay6YnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706645445; a=rsa-sha256; cv=none; b=bVF654KK/q6Bpc6YDpJW31vGYOFOEYsVZ7otUIPgnZfU1vGxatClR1xRtVomzGIRroo0gs GntEYvevOeb+8CYgoHNapMtBZ8i80yaPWp2TEyygG8IGpXZK1yaxNczjOer1At9ghtBi7l 79ZrNPjpiH9xjdhaad5wk2aCohvIMQ58u+hGR/EHk40hmRaFonEFHAGmNYT2IXfcxiftYI 19K/TD6rCyufQtuTV6dRA4DQAdcegdej3bFhsycY6B5A7p7ehDKIhVgd8ci5FPKMLThhml 2oc2M/O70eNo9PKk/bzpLRt+aYOlqwINln2W2X7EJzv9x2HD5t/pjrOail/1SA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPbrj4rG6zpyP; Tue, 30 Jan 2024 20:10: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 40UKAjR8096824; Tue, 30 Jan 2024 20:10:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UKAj7E096820; Tue, 30 Jan 2024 20:10:45 GMT (envelope-from git) Date: Tue, 30 Jan 2024 20:10:45 GMT Message-Id: <202401302010.40UKAj7E096820@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: e9e63d77c6b5 - stable/14 - inet(3): clarify syntax accepted by inet_pton List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e9e63d77c6b5ecd26c78502734cbc0fe85364685 Auto-Submitted: auto-generated The branch stable/14 has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=e9e63d77c6b5ecd26c78502734cbc0fe85364685 commit e9e63d77c6b5ecd26c78502734cbc0fe85364685 Author: Mike Karels AuthorDate: 2024-01-27 15:40:07 +0000 Commit: Mike Karels CommitDate: 2024-01-30 20:10:30 +0000 inet(3): clarify syntax accepted by inet_pton The section INTERNET ADDRESSES describes the acceptance of dotted values with varying number of parts in multiple bases. This applies to inet_aton and inet_addr, but not to inet_pton. Clarify this section by listing the functions to which this applies. Move the description of what inet_pton accepts into this section from STANDARDS, where it is easily missed. Rename the section to clarify that it applies only to IPv4. (inet_pton also works with IPv6.) Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43537 (cherry picked from commit 9231c42127bf8e47588169ecc395f57cae0e15fb) --- lib/libc/net/inet.3 | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/lib/libc/net/inet.3 b/lib/libc/net/inet.3 index 69ccf3df9e77..85b7997d998f 100644 --- a/lib/libc/net/inet.3 +++ b/lib/libc/net/inet.3 @@ -175,10 +175,15 @@ All Internet addresses are returned in network order (bytes ordered from left to right). All network numbers and local address parts are returned as machine byte order integer values. -.Sh INTERNET ADDRESSES -Values specified using the +.Sh INTERNET ADDRESSES (IP VERSION 4) +The +.Fn inet_aton +and +.Fn inet_addr +functions accept IPv4 +values specified using the .Ql .\& -notation take one +notation in one of the following forms: .Bd -literal -offset indent a.b.c.d @@ -212,6 +217,13 @@ may be decimal, octal, or hexadecimal, as specified in the C language (i.e., a leading 0x or 0X implies hexadecimal; otherwise, a leading 0 implies octal; otherwise, the number is interpreted as decimal). +.Pp +Note that +.Fn inet_pton +does not accept 1-, 2-, or 3-part dotted addresses; all four parts +must be specified and are interpreted only as decimal values. +This is a narrower input set than that accepted by +.Fn inet_aton . .Sh DIAGNOSTICS The constant .Dv INADDR_NONE @@ -258,12 +270,6 @@ and .Fn inet_pton functions conform to .St -xns5.2 . -Note that -.Fn inet_pton -does not accept 1-, 2-, or 3-part dotted addresses; all four parts -must be specified and are interpreted only as decimal values. -This is a narrower input set than that accepted by -.Fn inet_aton . .Sh HISTORY These functions appeared in From nobody Tue Jan 30 20:11:13 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPbsG1DWdz59T0D; Tue, 30 Jan 2024 20:11: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 4TPbsG0msDz4fD2; Tue, 30 Jan 2024 20:11:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706645474; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X6/i9pqaHndhIJmnfFRVARB7ZtgQwW1SdEcdvYT1SgM=; b=bcTW0e0/4TwsIePEb3o4rewvusnMgzUs+TiCTwiV2ohdUC+Cf7Dba/7XT0r8wrFtE1g8KO ke2bP99u2mXfub4UhtH7uuTMRNZD9c9jBzOKtDIiqE8BlYp70OIjF6fLYDLFU4wd0EvTgg gpsoZHj8p9TZVEoGjTL9rKQkNGjtsG9qQ6vDuQyfY4/QyWqRqny0y2fX7raJs0aQ5AYlBG MZSuZlp7FB9k+dn2vaatMj2KDqThLI9GUT2dRtv3H1dXVS5trWB5NFHaAYbiUrqWtBIiCn +J4rs5AyxjWjeuexUjxGIJCG9cAGohiNlESKug31yGfhuhG8O3QIPWo5+KFRlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706645474; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X6/i9pqaHndhIJmnfFRVARB7ZtgQwW1SdEcdvYT1SgM=; b=vAU19O6XuW5QHwBCOwpGqUEPQJkEpQLHVMjLPEODOJRFiXdHMVnuewg+5f/W/legHGGUzF cZERcEdExdwojFZGKAhijMD1QA0GQmudtUNExiIpOzMf8uj0AoLaxeWMQAI0xj5n5Z3+UG NFrWlMUUtBa7kTywKj0CgGPiyD9jF6KD0UgDFHea7RcBe1QNYe66O/RnMjzGF37PGxLtBv sFuZPWlW96GfB4O/SqorLP17z7vvB+UL7MKfkcn2FthV9BIaNkSSt412Wk7B3S/dXnveNZ /HglX3T8deSAK+hIWPpUGnRsfMKQtx6QkcEcO8wnQyuGI/6kjCe1awpNAoszDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706645474; a=rsa-sha256; cv=none; b=gDjCRZr0ak0g0EF7UAqtadI/p98aPtwqcdW9Wdu2bbY3XgdLSQGiQF6ox1IysgeqI6cqCQ VGYorxXUHCJZYexS7vBo6mAB2OyfLE43WPZz76dv7BqrNUoutvhKct00/DSLfhix/k9GAo JyW9UnxdIEhhR3xcBH555Flp2Va1JeR1st12AHou/Ok1btrYf10Ghe3BsZahnAqdR7uZxj G5+fnHg+M4XgHhi2nU4GUkMVeyIA8PQAAJokWLMeRqbq5v1ERaW9RXA9jcYEozr69uUwZV DdBh76oA19Qh5retODZoZyLgzfSSRjqlHmtOkq1sQ6FBPKl0Ar4MytBHjcJeTw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPbsF6z76zpmQ; Tue, 30 Jan 2024 20:11: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 40UKBDid097969; Tue, 30 Jan 2024 20:11:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UKBDc4097966; Tue, 30 Jan 2024 20:11:13 GMT (envelope-from git) Date: Tue, 30 Jan 2024 20:11:13 GMT Message-Id: <202401302011.40UKBDc4097966@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: e889b5a892b6 - stable/13 - arm64/RPI: enable powerd by default on arm64-aarch64-RPI images List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e889b5a892b63e5868ffbcbf82f55cbe79dda5ac Auto-Submitted: auto-generated The branch stable/13 has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=e889b5a892b63e5868ffbcbf82f55cbe79dda5ac commit e889b5a892b63e5868ffbcbf82f55cbe79dda5ac Author: Mike Karels AuthorDate: 2024-01-05 19:41:24 +0000 Commit: Mike Karels CommitDate: 2024-01-30 20:10:56 +0000 arm64/RPI: enable powerd by default on arm64-aarch64-RPI images Most 64-bit Raspberry Pi models have a variable processor clock speed that defaults to a slow speed (e.g. 600 MHz for a nominal 1.5 GHz clock). This results in everything running slowly unless or until powerd is started, and FreeBSD is then thought to be slow. Enable powerd by default in /etc/rc.conf on the arm64-aarch64-RPI images. Tested on Raspberry Pi 3B+ and 4B so far. PR: 256836 Reviewed by: rgrimes Differential Revision: https://reviews.freebsd.org/D43296 (cherry picked from commit 4347ef60501f2a55ad31f7532ad903b81f3af18f) --- release/arm64/RPI.conf | 1 + release/tools/arm.subr | 3 +++ 2 files changed, 4 insertions(+) diff --git a/release/arm64/RPI.conf b/release/arm64/RPI.conf index 6030bc584574..27b638702c6a 100644 --- a/release/arm64/RPI.conf +++ b/release/arm64/RPI.conf @@ -17,6 +17,7 @@ OL_DIR="${DTB_DIR}/overlays" OVERLAYS="mmc.dtbo pwm.dtbo disable-bt.dtbo" PART_SCHEME="MBR" export BOARDNAME="RPI" +CONFIG_POWERD_ENABLE=1 arm_install_uboot() { UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi-arm64" diff --git a/release/tools/arm.subr b/release/tools/arm.subr index 6656cbff81e8..cdc086c56337 100644 --- a/release/tools/arm.subr +++ b/release/tools/arm.subr @@ -223,6 +223,9 @@ arm_install_base() { echo 'sendmail_outbound_enable="NO"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf echo 'sendmail_msp_queue_enable="NO"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf echo 'growfs_enable="YES"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf + if [ -n "${CONFIG_POWERD_ENABLE}" ]; then + echo 'powerd_enable="YES"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf + fi sync umount_loop ${CHROOTDIR}/${DESTDIR} From nobody Tue Jan 30 20:11:15 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPbsH41Qvz59T9J; Tue, 30 Jan 2024 20:11: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 4TPbsH1rhLz4f5F; Tue, 30 Jan 2024 20:11:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706645475; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XoWElV3ScNElPbQ66PJuolicmstqymr3RqEasoGiw14=; b=eA63e7vapky2iqbQbo7yFz8cpTzmXkiABa8fAHUxJ6WRpMkTtu/afjgmJi+yxkgQ2EuCl2 +NYy2wqh2CA/7uoDQgWjtIdvJujpZM0MZ1eWDL/gvNMQf2eMGwlo7zDfAgiGHnPivfGSee ULgbYX1rHxGSTBgtfCjfxP00Xb7SbHNfuDAZ7EizLqXw5ZyrRa5GaOzxCzWnR7+uSlWDOM BqLrMfFkgiOqTDMqcQhD1nPbaUG/9MRcG1ayP4dQ8T4b7J2naSiQ5Ypr7FECyJb3cNNMxa wHCmtr8ZXxMRrJUYczZzi+i5EnG+ChkkxGfdbj0s7ZXwpXbyicjzpcYaOSyeRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706645475; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XoWElV3ScNElPbQ66PJuolicmstqymr3RqEasoGiw14=; b=vp/Uz5L7PQO2Hf1gs3Esj/g/HsEVFsNanWq1r4fD5tuepqtCboAr7z/Z0GwNfj8vKvHElC Cg+Kzm89y2KRA++4tW+ICnfliqstTZ788Wt6vGYIk8KUHcJadu7hjupdmjSxVRYTvvcocl KS5vzeidx27S86JxDGdFjNVmizFH+Pz2VAe9YzbzvKsFAtikHvikZrv0VsFHDc2Hti4z/2 VWDxqXU2T+lCfcKTie7GvVB9UJ81rbwNoXO7NzlMXsW2RoLXuu8FHXJ7DNFiq9/aSKHyW2 qGT1vGoIDLdWeMa8raSAuk+e+nnTg/XJiiOANdT8EUQVfMecR3/uAkmUqjI9ow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706645475; a=rsa-sha256; cv=none; b=T5EtkDo1U++dRgnIoRDmqIFQa8FPpLQZnMFCJ4v4UN9sdc1Q1my+oEz6TvwhGiAvuAx1J5 ZmHSk0RYZ5JAjcfdcrtbV0MF2WigjDvEtJ8jZJpt0Y5lg2JwOjGax2t0dtY9COyoKpXisY hm8Bm1bveGbqVOaJYhlB2NGu6G9mv+JcpeR9mFAgJpxknyDAxdXaAwHZ+oYc/D12EIhBTF sn3hBqLpSYipBFfpSP6GX6aczKuaB2++1Q9ogZ5hum0ORrjLKqi3nK92CjlrKsNVSmQOE3 GP6pu7F2lVC3VVSO28ywraI5De7uar5+k2uRLsIJwFani6q3NDwn+OyKlGQc7Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPbsH0wCFzppS; Tue, 30 Jan 2024 20:11:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40UKBFZr098014; Tue, 30 Jan 2024 20:11:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UKBFXU098011; Tue, 30 Jan 2024 20:11:15 GMT (envelope-from git) Date: Tue, 30 Jan 2024 20:11:15 GMT Message-Id: <202401302011.40UKBFXU098011@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: 28a8192a34ca - stable/13 - inet(3): clarify syntax accepted by inet_pton List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 28a8192a34ca5d428f130330b52c113b475b5756 Auto-Submitted: auto-generated The branch stable/13 has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=28a8192a34ca5d428f130330b52c113b475b5756 commit 28a8192a34ca5d428f130330b52c113b475b5756 Author: Mike Karels AuthorDate: 2024-01-27 15:40:07 +0000 Commit: Mike Karels CommitDate: 2024-01-30 20:11:07 +0000 inet(3): clarify syntax accepted by inet_pton The section INTERNET ADDRESSES describes the acceptance of dotted values with varying number of parts in multiple bases. This applies to inet_aton and inet_addr, but not to inet_pton. Clarify this section by listing the functions to which this applies. Move the description of what inet_pton accepts into this section from STANDARDS, where it is easily missed. Rename the section to clarify that it applies only to IPv4. (inet_pton also works with IPv6.) Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43537 (cherry picked from commit 9231c42127bf8e47588169ecc395f57cae0e15fb) --- lib/libc/net/inet.3 | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/lib/libc/net/inet.3 b/lib/libc/net/inet.3 index 69ccf3df9e77..85b7997d998f 100644 --- a/lib/libc/net/inet.3 +++ b/lib/libc/net/inet.3 @@ -175,10 +175,15 @@ All Internet addresses are returned in network order (bytes ordered from left to right). All network numbers and local address parts are returned as machine byte order integer values. -.Sh INTERNET ADDRESSES -Values specified using the +.Sh INTERNET ADDRESSES (IP VERSION 4) +The +.Fn inet_aton +and +.Fn inet_addr +functions accept IPv4 +values specified using the .Ql .\& -notation take one +notation in one of the following forms: .Bd -literal -offset indent a.b.c.d @@ -212,6 +217,13 @@ may be decimal, octal, or hexadecimal, as specified in the C language (i.e., a leading 0x or 0X implies hexadecimal; otherwise, a leading 0 implies octal; otherwise, the number is interpreted as decimal). +.Pp +Note that +.Fn inet_pton +does not accept 1-, 2-, or 3-part dotted addresses; all four parts +must be specified and are interpreted only as decimal values. +This is a narrower input set than that accepted by +.Fn inet_aton . .Sh DIAGNOSTICS The constant .Dv INADDR_NONE @@ -258,12 +270,6 @@ and .Fn inet_pton functions conform to .St -xns5.2 . -Note that -.Fn inet_pton -does not accept 1-, 2-, or 3-part dotted addresses; all four parts -must be specified and are interpreted only as decimal values. -This is a narrower input set than that accepted by -.Fn inet_aton . .Sh HISTORY These functions appeared in From nobody Wed Jan 31 00:46:01 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPjyK6GFNz580Rx; Wed, 31 Jan 2024 00:46: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 4TPjyK5m20z45Wr; Wed, 31 Jan 2024 00:46:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661961; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q0ghJ7TBF/uPTcmNTK1YgIZrzm3TY3UasiwDKtkKpM4=; b=yQJdbua3Z4R4ky2oBEFwkb7OErepUYxtnNYIBnWZTriVBVrwJ7kCvWe37w4H4bfbOZJ2Cd IkYI7WbcAK8GQfNBnkqc2DOYvoFbNLeWR59RqkzW8kNGL9ulN81Hspat27NyI61++hq4Vy mL+V/4Hx7ulllpOqHjFCupdHJ2hdBLqludPUKWdD/rLynCWr5AawCT2/mIQ0BYyD1DvwFP ycOVnEqNMIgSqScOHio1YA8qan2Glny+lDlv3tIGcayeWUc2pbim6WjmEhQUkHYWo8Ntui cr+QNkI/GlLInVZPrz/+8nTcfqAFT1Ytz9fy0DdUsTfDnOK1GvxLni0yz+l/Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661961; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q0ghJ7TBF/uPTcmNTK1YgIZrzm3TY3UasiwDKtkKpM4=; b=eBL52s3DkX2PFe450Nv2FVsRW/Xjm4DgHno9pbQgFZZk0aIjmkxPoSc2P8DnmDRwOpEHVE DU3MxF/XDdIiT/Cxs5oAs1t2dkJ0Tn+EM4vcuIBpzHpva6Is1oLA2UY24A1RT4MW4vPtRI iHL4ihO8aiIoncRqdflLUPlEBWQW+fDTCNLhm4MBXpibCkOHMrJX4FqjJXv4cQLUiCLudV 5iCzqFOSj1mCGOK/QYZvaviTTbQqTzVgOrQigec2J7s4+QS8bVbbHv6zW+74gvpRB96Nsl Fr4jr8e+qyNSK1QjRfrZgLn3UQ0aajtHywtAyy26UPPQRgq+lH40PV6yyAbY8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706661961; a=rsa-sha256; cv=none; b=v45v3iCUC0h0YP0SufJ12VYnXT5b8LUtKxWQr34jkahL49T8GXBqQEg29NGwkNJY/cP1vt nrP3hQo8QyHXKnSDBPsajoa9LgTxE2lpi2SqNUdI3Zmz0hn8vdLJJM8EjBlhtEwtHTfbLY mRqmkPL+eNjnUXUBmvLMvFv8vYz3JAiJdyXuTcr0JFbPlAjuvMY+lDuWB9TayYmqEVJTeR wvZ+qm8GnIZyNEcGrPr7Xg/MIS/BytY2Tc87FDByDPfaIrZLPFLG0ZsxbYp/0P0//j/ScN 3tg2MhkNtE+OLCiHlIQ3ga7lEn20sVL0b7A46IYj6UPVhbtgmFGwVmw9mO4U7g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPjyK4rl2zxmc; Wed, 31 Jan 2024 00:46: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 40V0k1xd063182; Wed, 31 Jan 2024 00:46:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40V0k114063179; Wed, 31 Jan 2024 00:46:01 GMT (envelope-from git) Date: Wed, 31 Jan 2024 00:46:01 GMT Message-Id: <202401310046.40V0k114063179@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: 6a5396c1c682 - stable/14 - kern_openat(): rename fd argument to dirfd List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6a5396c1c682b71e6dc5e8e959860f78ad9aa550 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6a5396c1c682b71e6dc5e8e959860f78ad9aa550 commit 6a5396c1c682b71e6dc5e8e959860f78ad9aa550 Author: Konstantin Belousov AuthorDate: 2024-01-20 21:41:12 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-30 20:24:41 +0000 kern_openat(): rename fd argument to dirfd (cherry picked from commit 2a284076ecb4d22928b78249070efa46153666ff) --- sys/kern/vfs_syscalls.c | 6 +++--- sys/sys/syscallsubr.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index d735a8a4929b..2fac2bd46a15 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1113,8 +1113,8 @@ sys_openat(struct thread *td, struct openat_args *uap) } int -kern_openat(struct thread *td, int fd, const char *path, enum uio_seg pathseg, - int flags, int mode) +kern_openat(struct thread *td, int dirfd, const char *path, + enum uio_seg pathseg, int flags, int mode) { struct proc *p = td->td_proc; struct filedesc *fdp; @@ -1161,7 +1161,7 @@ kern_openat(struct thread *td, int fd, const char *path, enum uio_seg pathseg, fp->f_flag = flags & FMASK; cmode = ((mode & ~pdp->pd_cmask) & ALLPERMS) & ~S_ISTXT; NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | AUDITVNODE1 | WANTIOCTLCAPS, - pathseg, path, fd, &rights); + pathseg, path, dirfd, &rights); td->td_dupfd = -1; /* XXX check for fdopen */ error = vn_open_cred(&nd, &flags, cmode, VN_OPEN_WANTIOCTLCAPS, td->td_ucred, fp); diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h index 0480eda2fca4..294ff6ef00b9 100644 --- a/sys/sys/syscallsubr.h +++ b/sys/sys/syscallsubr.h @@ -251,7 +251,7 @@ int kern_ogetdirentries(struct thread *td, struct ogetdirentries_args *uap, long *ploff); int kern_ommap(struct thread *td, uintptr_t hint, int len, int oprot, int oflags, int fd, long pos); -int kern_openat(struct thread *td, int fd, const char *path, +int kern_openat(struct thread *td, int dirfd, const char *path, enum uio_seg pathseg, int flags, int mode); int kern_pathconf(struct thread *td, const char *path, enum uio_seg pathseg, int name, u_long flags, long *valuep); From nobody Wed Jan 31 00:46:02 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPjyM0m52z580cw; Wed, 31 Jan 2024 00:46: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 4TPjyL71B7z45Tj; Wed, 31 Jan 2024 00:46:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661963; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eVeAdDy5F1h9OVk6p0tMDCgm5KWANnY/hi/v9nkbWWc=; b=s+gV4motRgt2jZt3qiAk3TcVjh6i0xh2OluBVxlk3GRsW6AdHuLJzKCyuiEWtgnNS2VYkn UmoI7NqULtPN5Lh3q+BfZAl0I8xZdzDgqszANmpcvMoK/g+RN/93GLT1Gzb5HJWP1l2Fku 1PEm1fR9YJM4MXg1iz1CURwSHs10sIZxGJqXvOkDrZosIyyXysrVx9e4U3QBf3UGdD4xS0 ETjPrlxpX4wegitcGUIGWWKTUFFIFiMRz7S72SKgjkkeQ7OOPD1CSlApfKfveic2iq9JL2 DO8YuFsjdPm21Qq9wjgVv/Rkb82DNF1u4hB+gO8ySnlwDIymLam9aKXYxr+FlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661963; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eVeAdDy5F1h9OVk6p0tMDCgm5KWANnY/hi/v9nkbWWc=; b=a8qrpxaWfKoRC6XfpnED0X8vAS0exG4SqnL79RHznqv35qrwsy4dm7/dSx9Jn9X7lW3Owc NBRo6TEz5s0zOLY9HM7rOSYpaW7hLAuBJ1RH4gAfjOFT9s9F06I629wyZM8rLUYrxLgUs3 4bMrlZ0VQOhZF8CWwSshkFvSn/mOscH+Z70z7491rkKAh6UJJA/X3uYH4+qHI3GRdbVsYW cp4reh1A4oKVganCkfLiV5Wqdo8npz+8qWH9Bnsf3ZBBdmLef0BByI19FcPoFnxL1zXmjT LtEq8eIqNlUd8oYsxlCMrkUis+c0FF7BiIMvTaDGAd/9yWfBDMViwBKQQwRVUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706661963; a=rsa-sha256; cv=none; b=pT7Cs8To2Gvr+VsCCpZqO5vvHohiDSAvebYZQAWSkVdZ9pSDJM3drTF61dUtIsXpkEl66R o+gPnkuvhevpuidlzvfnKbduihW+D4AQ0oHUgGuXw0HTnb+yFqm2qqCOZGDS5O3e18iEnh YLSX0sd8G6hSH4LKEyjp8HMcqb9+L2RP7q/1Nb9NvLXJL3O5zTkBX6np9/XBS6vix/RSxv 8unPbIZPPfl5y5QZvbatbw0bsji+RIBtFvq16movK85mnJQ12MGRMciySB4BhBQK/p+U8e yTT9Da3yWKnm5U8PiAkVzLfWTtWIhsJQwVtw1W3nVH/treRxyXgyp2ix4rn0rQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPjyL646ZzxxD; Wed, 31 Jan 2024 00:46: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 40V0k2CV063221; Wed, 31 Jan 2024 00:46:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40V0k2Ys063219; Wed, 31 Jan 2024 00:46:02 GMT (envelope-from git) Date: Wed, 31 Jan 2024 00:46:02 GMT Message-Id: <202401310046.40V0k2Ys063219@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: c728101ff44c - stable/14 - kern_openat(): minor style fixes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c728101ff44c95a83c7e9a2c6c370eaac06e105d Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c728101ff44c95a83c7e9a2c6c370eaac06e105d commit c728101ff44c95a83c7e9a2c6c370eaac06e105d Author: Konstantin Belousov AuthorDate: 2024-01-20 21:42:39 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-30 20:24:42 +0000 kern_openat(): minor style fixes (cherry picked from commit 3d59b93b207e5008ea0b79b38268243abf225546) --- sys/kern/vfs_syscalls.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 2fac2bd46a15..41bf2ff1d3c7 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1116,16 +1116,18 @@ int kern_openat(struct thread *td, int dirfd, const char *path, enum uio_seg pathseg, int flags, int mode) { - struct proc *p = td->td_proc; + struct proc *p; struct filedesc *fdp; struct pwddesc *pdp; struct file *fp; struct vnode *vp; + struct filecaps *fcaps; struct nameidata nd; cap_rights_t rights; int cmode, error, indx; indx = -1; + p = td->td_proc; fdp = p->p_fd; pdp = p->p_pd; @@ -1231,8 +1233,6 @@ success: * If we haven't already installed the FD (for dupfdopen), do so now. */ if (indx == -1) { - struct filecaps *fcaps; - #ifdef CAPABILITIES if ((nd.ni_resflags & NIRES_STRICTREL) != 0) fcaps = &nd.ni_filecaps; From nobody Wed Jan 31 00:46:03 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPjyN1c9jz580Ry; Wed, 31 Jan 2024 00:46: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 4TPjyN0bcCz45Nv; Wed, 31 Jan 2024 00:46:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661964; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WhzCGmkC24qO6OO9P0pjIaq/1Z3Dh/5v/wnS6OceJxE=; b=kVNLPoGBTbv/5i2/EyREmyBwtMJRxjhBeGVlTEGcOqolB2BceXxOje4Zy+/YpPkCHTVB+9 Ncsgir9mRjgploRSW+2QdQLUZcWkP4e2CEBeu9XEOw9HsHcqiDQDHeY4rVyE3itwM6cnqI OUOyRMSvJz+m9AdpamzOol/BUcCPpIpBP2CGKDZiieFJ7bQU3t/7R4aJ2UCSsJG3lrKC6K 1xs8x5A1JTTlU9oWUrFCWAWpL3e3ubJqg7vnMZ6rPAmQMjEdzVwbFpfat9FwFXhBiWkLwp 39cMnOLVBiTI5b4Yl8PQCHu/qIf8iM6KhihfGODuXz+RLbXk+PhC24vBap0B9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661964; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WhzCGmkC24qO6OO9P0pjIaq/1Z3Dh/5v/wnS6OceJxE=; b=eozmQ2cgUy6ShzhHEp21Eh3DfTm0nU9GLh6WvXzbXYJF2QCxyX2UqhwcS7KYPmxFmmo2FC 8EVFNzRa61qSLanZ976o3gTNLaN9eDeR9ahyrq1M7pSc6aeZc2K1iagCdYgNNG80RvD7on km3kwZ/08yLsECh5zJzzBzoTXfXFSBxtQPPAI5JGHebzPCSD3gzM2kQgFZqeZ06ljaM1Wb KZJBk1f75fIVbT+oV5zcBTETqL2JkO5IycdN5GS58oGjh+GNsbA9iJEfvJ21aPBeu84gZM 1Udl4DoSGXTU5iq5HHzgnXVCn7zWOQdd59ki/rwHLq/mjxP+DyCXBvtiIa6q8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706661964; a=rsa-sha256; cv=none; b=Yzs7hhC6Hvu1gHmWERu6F6BmyrUWzH3/OvsNdpb4Q4663tPVKck5Rm5UjDJEwaRW2K2Jzs lFzBwzxoHoOOANDFN7jXmfv704TrnX8RH13k5j3QHV4/voVPQa86oKJM26zoQLuNeSS2VG Pt9uTzco5urE/ZTD6xNXkWVqSI/xGHK93fTYcLaifIlowKDlz0LKh+5ECw7DzVpm3xYkn/ f/nZ278ikqD9zmCUstoPuk/IDPGj4QLyUCTpw6GH6BT6YGv0BK5cCLYMuvX0rZhVkFP2z+ Wv0h9Z2BLretcOVlhTUV/Bq9wkJ4FTNpQOT76qzJ08/GHIpMAaXzdqtDUjiBOg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPjyM6nBtzxxF; Wed, 31 Jan 2024 00:46: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 40V0k3Z7063254; Wed, 31 Jan 2024 00:46:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40V0k38U063251; Wed, 31 Jan 2024 00:46:03 GMT (envelope-from git) Date: Wed, 31 Jan 2024 00:46:03 GMT Message-Id: <202401310046.40V0k38U063251@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: 8732746cbeff - stable/14 - Add kern_openatfp(9) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8732746cbeffb3831ba144ac5999b200d63332a0 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8732746cbeffb3831ba144ac5999b200d63332a0 commit 8732746cbeffb3831ba144ac5999b200d63332a0 Author: Konstantin Belousov AuthorDate: 2024-01-20 20:34:46 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-30 20:24:42 +0000 Add kern_openatfp(9) (cherry picked from commit c662306e19ce60d0f5e5e32a22ddcd5c79a90849) --- sys/kern/vfs_syscalls.c | 39 ++++++++++++++++++++++++++++++++++++--- sys/sys/syscallsubr.h | 2 ++ 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 41bf2ff1d3c7..0915751785f4 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1112,9 +1112,14 @@ sys_openat(struct thread *td, struct openat_args *uap) uap->mode)); } -int -kern_openat(struct thread *td, int dirfd, const char *path, - enum uio_seg pathseg, int flags, int mode) +/* + * If fpp != NULL, opened file is not installed into the file + * descriptor table, instead it is returned in *fpp. This is + * incompatible with fdopen(), in which case we return EINVAL. + */ +static int +openatfp(struct thread *td, int dirfd, const char *path, + enum uio_seg pathseg, int flags, int mode, struct file **fpp) { struct proc *p; struct filedesc *fdp; @@ -1188,6 +1193,7 @@ kern_openat(struct thread *td, int dirfd, const char *path, if ((nd.ni_resflags & NIRES_STRICTREL) == 0 && (error == ENODEV || error == ENXIO) && td->td_dupfd >= 0) { + MPASS(fpp == NULL); error = dupfdopen(td, fdp, td->td_dupfd, flags, error, &indx); if (error == 0) @@ -1229,6 +1235,13 @@ kern_openat(struct thread *td, int dirfd, const char *path, goto bad; } success: + if (fpp != NULL) { + MPASS(error == 0); + NDFREE_IOCTLCAPS(&nd); + *fpp = fp; + return (0); + } + /* * If we haven't already installed the FD (for dupfdopen), do so now. */ @@ -1258,6 +1271,26 @@ bad: return (error); } +int +kern_openat(struct thread *td, int dirfd, const char *path, + enum uio_seg pathseg, int flags, int mode) +{ + return (openatfp(td, dirfd, path, pathseg, flags, mode, NULL)); +} + +int +kern_openatfp(struct thread *td, int dirfd, const char *path, + enum uio_seg pathseg, int flags, int mode, struct file **fpp) +{ + int error, old_dupfd; + + old_dupfd = td->td_dupfd; + td->td_dupfd = -1; + error = openatfp(td, dirfd, path, pathseg, flags, mode, fpp); + td->td_dupfd = old_dupfd; + return (error); +} + #ifdef COMPAT_43 /* * Create a file. diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h index 294ff6ef00b9..15e05985e75f 100644 --- a/sys/sys/syscallsubr.h +++ b/sys/sys/syscallsubr.h @@ -253,6 +253,8 @@ int kern_ommap(struct thread *td, uintptr_t hint, int len, int oprot, int oflags, int fd, long pos); int kern_openat(struct thread *td, int dirfd, const char *path, enum uio_seg pathseg, int flags, int mode); +int kern_openatfp(struct thread *td, int dirfd, const char *path, + enum uio_seg pathseg, int flags, int mode, struct file **fpp); int kern_pathconf(struct thread *td, const char *path, enum uio_seg pathseg, int name, u_long flags, long *valuep); int kern_pipe(struct thread *td, int fildes[2], int flags, From nobody Wed Jan 31 00:46:04 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPjyP3gvmz580d3; Wed, 31 Jan 2024 00:46:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TPjyP1ZXcz45JD; Wed, 31 Jan 2024 00:46:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YJDAVkUnIu4ZjD6jbzJS/6wY4E6/F2LgREbVnKMDcMM=; b=qap77qechA3o07cnzMiJngbCLayFfB6CA7wI+x3qAUgJhgQDyXvTaVuI/OeB6J9Dc06uCa e4blq3jMwjkYEt65U50aXQRB/+GAt3v2QJ63lXdep8/vKGd8K91vpHUaJXoIlJrbXOIar5 TwjNVyGAS8vM3mqZ5fD49fckzcTFp3Lr8QoPPIV/B4c16x7G8j6nZh0ZNY/yk/+HWGc3hs l7As7gprn88TnIjL+BsoBQfq5duTQxA+bjliurTG5U3hDOgQdizeqT4Jp67A9kW6Bgb6dX QbL+4d9bg47a97+ryabkS58Z0b2ZsXfwj4D+Qcz9KsvcvbWgOeuExnMXtcE9dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YJDAVkUnIu4ZjD6jbzJS/6wY4E6/F2LgREbVnKMDcMM=; b=lJxKcfJM5RDvMytcHh+FkF91P0IcKyCkHFaimBFdbbmoUtqD1kNIpVL7tPDpfxV9gLPkoj uvMmWgvKZro74P0+pfRJSoK1qFhL9M8TR/8BCu/OGjB2JT+Zwb3E0jYY7dUmFiQWLNdVGd iL6tqumB8o8LPAQdlbhQZM9g4+ukp6YQQvjl70p7b3FaF+hNtd06mXNxBk+MPIC11F7psU bYL2c7lJPb3Kv0TTRef2UF4QnXQtXA1hEZEjxJvzqtFCGRvM4MxXr7JiqOoAtbZ0BY7plC r7zM7EtDJlYsVfd93V11QoRhC4E8boNoDkb8tcdRv9b0KlKYclCwQAiGGTz7RQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706661965; a=rsa-sha256; cv=none; b=TyBU3s2nTOD87TVCE1b9kAHKOySgIxgRO2emy2I/oWDU2XXjDoOed4NOvScOJ4v0GmQz7g 20oe0KYlHlrr7suDxgPuFYBghXFHteNlmTqIBAqp6N7Na+x80J1t3QSkZsstCe84c48YW1 d0+Dmsu6xLixpxAknQ6vjldIOHRjaIO3urLw0hju5wWvKzSBq3GGTm5LuR7OFOxeYhyNgn VG/RJN337RrO+ZSCqwOPLl4SxZpG+l+IPBSq2CrH4071DEcnT2Ncxy2KoH7bfCUCg4WNPM /9f6BJNhn6JRiTo7ScFtcs3mLUPeCPAZT9tChv7PeQx/C+vNBLH0IRIqtVA2iw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPjyP0gq9zxZ7; Wed, 31 Jan 2024 00:46: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 40V0k55g063289; Wed, 31 Jan 2024 00:46:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40V0k41Y063286; Wed, 31 Jan 2024 00:46:04 GMT (envelope-from git) Date: Wed, 31 Jan 2024 00:46:04 GMT Message-Id: <202401310046.40V0k41Y063286@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: 0de404fc0b5f - stable/14 - sys/file.h: style List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0de404fc0b5fbab24f1d5153116a49063099d1c1 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0de404fc0b5fbab24f1d5153116a49063099d1c1 commit 0de404fc0b5fbab24f1d5153116a49063099d1c1 Author: Konstantin Belousov AuthorDate: 2024-01-20 21:49:11 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-30 20:24:42 +0000 sys/file.h: style (cherry picked from commit 24fee9771e0b1e2f4836b9bb1688cbe8104b403a) --- sys/sys/file.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/sys/file.h b/sys/sys/file.h index dcc739e2e9de..cf2544ee70cf 100644 --- a/sys/sys/file.h +++ b/sys/sys/file.h @@ -481,8 +481,9 @@ fo_fallocate(struct file *fp, off_t offset, off_t len, struct thread *td) return ((*fp->f_ops->fo_fallocate)(fp, offset, len, td)); } -static __inline int fo_fspacectl(struct file *fp, int cmd, off_t *offset, - off_t *length, int flags, struct ucred *active_cred, struct thread *td) +static __inline int +fo_fspacectl(struct file *fp, int cmd, off_t *offset, off_t *length, + int flags, struct ucred *active_cred, struct thread *td) { if (fp->f_ops->fo_fspacectl == NULL) @@ -491,7 +492,6 @@ static __inline int fo_fspacectl(struct file *fp, int cmd, off_t *offset, active_cred, td)); } - #endif /* _KERNEL */ #endif /* !SYS_FILE_H */ From nobody Wed Jan 31 00:46:06 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPjyQ4mbBz580d5; Wed, 31 Jan 2024 00:46:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TPjyQ2lX3z45VR; Wed, 31 Jan 2024 00:46:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EenYaNVYpIMbCuawSUQ+A2Qdnr/oXzvUfjSiUWpgdv8=; b=HwLzc79kYXRnd88mX+a8t/NctfpZuU9pZj7TU38lEZRR64JakivLahSfbq8tvm4iI0E7dg RWb9Nf32mnz68mGEGZrMka12rYcgU06q2KvnaGj/q8g/OlomGzs0209rc7TSWu9MwJMjHn HBLWyZ2OpBYBK2gcixmI7/HH7Jlh7d+2JB/ZOPegTvhCcOEBqcpHhy8E+H1rnaIXX0OTfX s3ku5j/Zm5c9kx8oXCXwRFQKsv6yZuXaB7nGjk2HTHM7/XFAQ/XQbnQQ4av0iWzcf1/bb8 DE3rDE0/VMws45pjUdh8CszB6gH1XqwsG2gHfbtUjkZFQ2Ch2uMV2skv7+ugZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EenYaNVYpIMbCuawSUQ+A2Qdnr/oXzvUfjSiUWpgdv8=; b=IQCzyyOPVIrRab+Z7yVXVkp92DNCZRLwlMHephaFbAqru9tFJWh8D68cbMzg1Kml8+R5fn GRiOVIC/3iJ6DBrdByOS+mNJVBIO2K6fsfa9eTDIU4h1k23Q1NJHQnsE2bIo+Q3fPIJNcb EEl2K4YYIgds/yhDtBKBTHtpic837ajYIax1Fftx8Dry9XXbOxqFZRFLlOsC/HCjyK9pmJ SXLsIZomo4sDKtBiOrdTwK3l22U+DctyBYR65vjhY8EIwONWc1WtZ6A9V61/bDXJiT8hk9 QnDMTKVi1/0a2UMuhEvBJ9ZhLbQKniVpmpTR+w9Go4/+VGeEbIPPWScOqG6gTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706661966; a=rsa-sha256; cv=none; b=L8p6VdQLv9f8Cx72FQJnLz8FQaIQnRZKS/Hw/COkQmE8tPMItbt6/kLjkFK8NqBuXjQRG8 2XJcurson277Dg4SBZ2BncbanGlWqm37JSmk6CDfvs3SmUovGW/Gd7xeUwt5vvQH5TKOTi ylUAmliCcfEw2CBG93inDyavivHPK7sQmtzRP4sdHdsqSHltHD5zW9GZS/Gh37rikLUOFN tHn7XVQNzJAXoiXT99YreSSEnOY6rUj1mZJ3evlCtG3sARE31AXQSp3W9Zz2q0aPLdgPER 63D/72+UyKOFpvHY+4ykcCbJ6SdD2baCRzzLFo+Vhp3HpnXMa2AuYldMtLtrXA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPjyQ1fM2zxmd; Wed, 31 Jan 2024 00:46: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 40V0k6j4063327; Wed, 31 Jan 2024 00:46:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40V0k6qU063324; Wed, 31 Jan 2024 00:46:06 GMT (envelope-from git) Date: Wed, 31 Jan 2024 00:46:06 GMT Message-Id: <202401310046.40V0k6qU063324@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: 3e3b87ea6e69 - stable/14 - Add fget_remote() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3e3b87ea6e6936c4757391477075d487b6745a12 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3e3b87ea6e6936c4757391477075d487b6745a12 commit 3e3b87ea6e6936c4757391477075d487b6745a12 Author: Konstantin Belousov AuthorDate: 2024-01-22 22:31:55 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-30 20:24:42 +0000 Add fget_remote() (cherry picked from commit 58d3171698341c664d7c676541b86385a924ae93) --- sys/kern/kern_descrip.c | 32 ++++++++++++++++++++++++++++++++ sys/sys/file.h | 1 + 2 files changed, 33 insertions(+) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index fe6928e421db..7bb392eee6b2 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -2962,6 +2962,38 @@ fget_cap(struct thread *td, int fd, cap_rights_t *needrightsp, } #endif +int +fget_remote(struct thread *td, struct proc *p, int fd, struct file **fpp) +{ + struct filedesc *fdp; + struct file *fp; + int error; + + if (p == td->td_proc) /* curproc */ + return (fget_unlocked(td, fd, &cap_no_rights, fpp)); + + PROC_LOCK(p); + fdp = fdhold(p); + PROC_UNLOCK(p); + if (fdp == NULL) + return (ENOENT); + FILEDESC_SLOCK(fdp); + if (refcount_load(&fdp->fd_refcnt) != 0) { + fp = fget_noref(fdp, fd); + if (fp != NULL && fhold(fp)) { + *fpp = fp; + error = 0; + } else { + error = EBADF; + } + } else { + error = ENOENT; + } + FILEDESC_SUNLOCK(fdp); + fddrop(fdp); + return (error); +} + #ifdef CAPABILITIES int fgetvp_lookup_smr(struct nameidata *ndp, struct vnode **vpp, bool *fsearch) diff --git a/sys/sys/file.h b/sys/sys/file.h index cf2544ee70cf..ab8aefbb32f1 100644 --- a/sys/sys/file.h +++ b/sys/sys/file.h @@ -263,6 +263,7 @@ int fget_write(struct thread *td, int fd, cap_rights_t *rightsp, int fget_fcntl(struct thread *td, int fd, cap_rights_t *rightsp, int needfcntl, struct file **fpp); int _fdrop(struct file *fp, struct thread *td); +int fget_remote(struct thread *td, struct proc *p, int fd, struct file **fpp); fo_rdwr_t invfo_rdwr; fo_truncate_t invfo_truncate; From nobody Wed Jan 31 00:46:07 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPjyR6jS6z580hm; Wed, 31 Jan 2024 00:46:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TPjyR3Wrlz45Jw; Wed, 31 Jan 2024 00:46:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6jQE43YJfPgyb2w6KMUmOheOmgiQZS4sqjb/1cjiK8c=; b=dMPuCQHhwb5PTtrvLo4TWkbO3W+KqJOsONow5514zUgBO6MFG894H9evGC1jcSDcx/TMbW Bo6RUJDCHoO3mCSapp3SS54yRiYh+Oz/0ZTWgnjs0VQx9Y77kDC8t+PC8u9nJHO2SrXJjV uhys/sVhYCXHgVFufgTz29lFw53Zn/hgCLwqv2jT0guZ67qBH5ovygvxrrRvEXKrjpnS9P Lmu4H8VWTnVdYhfwpgB/FnQVslGJzkCYDAXZxaWkAX5on7usGhoeO2O6a1HtZe38QDWGO7 i6vNCWDGHpQjHoGpieXpnCmP6KBqxFwnGGZtIoCVlkDdIpF7HN8gB6dkFmK/Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6jQE43YJfPgyb2w6KMUmOheOmgiQZS4sqjb/1cjiK8c=; b=As2LkKBad8PJxoSa5ETEcgITMZJa6TSzmLYmL5bHxH1pWjHL9XUXi0LQ64NV59O/lTlAcT 1BFEx5TYjccAgEyGmhxvqU0S4t+QYbUCGNgwGrUgD5SK/Ivcy90unCQC8ARrcl84V/xcgR SSzO4vmI2WPgJHNemEERKcTVMjeeC1SiHHr4FK0UgsRySRERVMzu6rafmAJvaCZb1f/boQ lHknbt496G/QLafZ12V/ZZYdrid1sPXRrUCl6Jm52f51ow2Veihh2sc2drRJuGMjdvxdDk fZ5nJQGdM5x1E84xaWKIGzvsLLvrhE/6tSh6nloDDnnDldTVTBcpLjXwEd57pw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706661967; a=rsa-sha256; cv=none; b=q+nh6X53Sjul93XfKeAD5Px5NwkFQsgt7mJXFM/9rInkA2kf2hu0GNDeIe6l21ZVLFr5za 8H0HM/m9Yd6Bpt34eg9gK8TEre/0HP//oP/dhyjvbudTI8JcQtPkIcaSFrHCMnEMp3Pjg2 szgL5dY7gJ52LJcF/yC4zsMW3p28zYsPesY7vDH0ZGwO/ho+cVewQf+AzDH0jiJksdShvW Ln3vNMgoDpaC/5UCyJWtDuEDoRkI1+pQZ3NPVgFgUyPXzKxbCf/m0ySIsXqPVK87wyr73t yi0eB8V1f3c7OOc5czVUA5C9TNmUGWCd6vuLJp+zbHSa6Sqy8qdtKKJ9eHStLA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPjyR2cyCzxxG; Wed, 31 Jan 2024 00:46: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 40V0k77r063366; Wed, 31 Jan 2024 00:46:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40V0k7LH063363; Wed, 31 Jan 2024 00:46:07 GMT (envelope-from git) Date: Wed, 31 Jan 2024 00:46:07 GMT Message-Id: <202401310046.40V0k7LH063363@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: d7c4a6205feb - stable/14 - file: add fo_cmp method List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d7c4a6205feb6ba2d44159e343ec61cae3ecffb4 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d7c4a6205feb6ba2d44159e343ec61cae3ecffb4 commit d7c4a6205feb6ba2d44159e343ec61cae3ecffb4 Author: Konstantin Belousov AuthorDate: 2024-01-19 21:01:35 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-30 20:24:42 +0000 file: add fo_cmp method (cherry picked from commit 168c7580c6328342945db0e19a0791466bb07624) --- sys/sys/file.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sys/sys/file.h b/sys/sys/file.h index ab8aefbb32f1..540f1f525736 100644 --- a/sys/sys/file.h +++ b/sys/sys/file.h @@ -131,6 +131,7 @@ typedef int fo_fallocate_t(struct file *fp, off_t offset, off_t len, typedef int fo_fspacectl_t(struct file *fp, int cmd, off_t *offset, off_t *length, int flags, struct ucred *active_cred, struct thread *td); +typedef int fo_cmp_t(struct file *fp, struct file *fp1, struct thread *td); typedef int fo_spare_t(struct file *fp); typedef int fo_flags_t; @@ -154,7 +155,8 @@ struct fileops { fo_get_seals_t *fo_get_seals; fo_fallocate_t *fo_fallocate; fo_fspacectl_t *fo_fspacectl; - fo_spare_t *fo_spares[8]; /* Spare slots */ + fo_cmp_t *fo_cmp; + fo_spare_t *fo_spares[7]; /* Spare slots */ fo_flags_t fo_flags; /* DFLAG_* below */ }; @@ -493,6 +495,15 @@ fo_fspacectl(struct file *fp, int cmd, off_t *offset, off_t *length, active_cred, td)); } +static __inline int +fo_cmp(struct file *fp1, struct file *fp2, struct thread *td) +{ + + if (fp1->f_ops->fo_cmp == NULL) + return (ENODEV); + return ((*fp1->f_ops->fo_cmp)(fp1, fp2, td)); +} + #endif /* _KERNEL */ #endif /* !SYS_FILE_H */ From nobody Wed Jan 31 00:46:09 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPjyV0MjMz580hr; Wed, 31 Jan 2024 00:46:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TPjyT5X0Gz45Px; Wed, 31 Jan 2024 00:46:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661969; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MSsdcSuofAmxdedrMpDWmiCp3GWmU2CrNhxizxVNqvo=; b=duI3mSQAQu/1bqMzG348EY1SslZXT6PSBVX51ZR68bdJ1sO67B89FJU4jyzKzdjkDYzlfd ZJsfCIf3nJzlocq9ZIM4TKLzRXtujaIHAkNggp6V3iJbKvT+3feiOk/IVkwFmRqt/4TYjD gEYjHnDKvrZ4j4K9Q4i9+E/nuHWLbzLIeZ4Kq2Urn1iJ0Lsy0wpOJ56cVepjgBd6+W4AyZ z7OQeIamv2HxET4roQAxpt4qjyJ0NraZewhZLCDcxuAOxbNrv7dxvwE4hgYb5ElI3EdQdG IL7tHqJU3U5DGbcbw3H6XvP4hPPKu6p9AmTZxei+S6KXf6Oy202dIHOTWOucyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661969; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MSsdcSuofAmxdedrMpDWmiCp3GWmU2CrNhxizxVNqvo=; b=jaFKMgoeUd4fOipjbRkNh64Pg5gcM8uQGs31yUQHJrcgu/BlAi0rdOV7LENRwGccJcD8q6 zh1pHzLD83cYSRejx6bZZLLKBhkyfNs1Z7hpRpQluIWVpW8F3BwFcq9tjNkDCKABwaDkHt 2VGd/0HuzbRvYsGbd7j5nlYqIiWm6RBDttcLC64qHEL0ZKLXMJleMryvkH7/d06XywhXr8 VPKJb3IP8ijkMjNlbnxYFNeTXzcqtkOQtVcj2Is9ZM5EBxrKOh6ig0nBaVYlg8YP9MDoRz 5Eah1Ve0qsVon8RKn1SHmdkpR8SOU5XhL66S8tIDEY0DUE4S9+ts9aL0Ar6Jmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706661969; a=rsa-sha256; cv=none; b=CxAn0DplVo/n+gjjooOdp99zL78NKgBoIER7fEGmnw8jvu7+CNpFNZiOHSD72JAlSQOBz8 Kyeo356j9O6rYVclTA0duVpbT8Bep6bceTtapWJWeAOonjIfe2G+wNWRHIivu7I/uwYBju BnjG24E2fkba7TqGvmz4Z6xEkTz5G0ZcyK3peTkyAqrL4Prz1lK3vaCWcfdDkD0VKrmBQq oOoBYot3f4t2zNaTuCgv30Wlnbr40FEemk72/yRfQU3oWzsfnnF1l1xNTuWuLsu0gM48DT 6cUpS2O0pXKNWnC4wmYfeo1f/eVV2NeZek+aHDWglKBh5eLL0HcP/XwiRCWUuQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPjyT4dbKzxZ8; Wed, 31 Jan 2024 00:46: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 40V0k9Ev063444; Wed, 31 Jan 2024 00:46:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40V0k9L8063441; Wed, 31 Jan 2024 00:46:09 GMT (envelope-from git) Date: Wed, 31 Jan 2024 00:46:09 GMT Message-Id: <202401310046.40V0k9L8063441@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: f8d885c08dfc - stable/14 - Add kcmp(2) userspace bits List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f8d885c08dfc3d93ba00ae216c9587e990d64a5b Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f8d885c08dfc3d93ba00ae216c9587e990d64a5b commit f8d885c08dfc3d93ba00ae216c9587e990d64a5b Author: Konstantin Belousov AuthorDate: 2024-01-19 19:55:11 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-30 20:24:42 +0000 Add kcmp(2) userspace bits (cherry picked from commit 211bdd601ee51f90da9b123807ef68ac122116b9) --- include/unistd.h | 1 + lib/libc/sys/Symbol.map | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/include/unistd.h b/include/unistd.h index 337f6befd717..7d3aace103d0 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -521,6 +521,7 @@ int iruserok(unsigned long, int, const char *, const char *); int iruserok_sa(const void *, int, int, const char *, const char *); int issetugid(void); void __FreeBSD_libc_enter_restricted_mode(void); +int kcmp(pid_t pid1, pid_t pid2, int type, uintptr_t idx1, uintptr_t idx2); long lpathconf(const char *, int); #ifndef _MKDTEMP_DECLARED char *mkdtemp(char *); diff --git a/lib/libc/sys/Symbol.map b/lib/libc/sys/Symbol.map index f17aae279b8d..6c79f89016d1 100644 --- a/lib/libc/sys/Symbol.map +++ b/lib/libc/sys/Symbol.map @@ -424,6 +424,10 @@ FBSD_1.7 { timerfd_settime; }; +FBSD_1.8 { + kcmp; +}; + FBSDprivate_1.0 { ___acl_aclcheck_fd; __sys___acl_aclcheck_fd; From nobody Wed Jan 31 00:46:08 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPjyT01Mnz580VW; Wed, 31 Jan 2024 00:46:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TPjyS4byPz45MC; Wed, 31 Jan 2024 00:46:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cJol7t5z3rxwrN8EffLTD2g0RKHdew/xPQCQ/0gW278=; b=YoDDigOstcVnTPeRXtMenzl4CUvuiBYXpuGhZi242dzc6yYbrt3o9mnkgjM9N3dXUQwu1Y wLKkZwLcRJ9R9FDYAz2nbhIIhNPl0QG4DnD8YP1ZAiZdyftqe9DwUijQf7r6utFOOJufY8 ney5CFqdGWhqlKhNzreG13ZaPnke959QmYCNbTo28MYV0WIYsSisQW359rNn5c18zO80AD rJq8pxYwNUvZswY96KFtFwTsav1GVYRYh9p27LHMFakanwdnBQ8Rlv/jTxE5peFvm7Avuw ccbLN97mz00KaET/sMQdi7S9bGCTpylxcQT2zlVwCpxmbSlUPek5fbGN39E5pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cJol7t5z3rxwrN8EffLTD2g0RKHdew/xPQCQ/0gW278=; b=VHiyR7TKtCp1cMxU3b8siN35Y84ivaGoPb7af7IySl7ugMJOmnOvMQzjiX4xZtosOBStv4 /rOHIqMoJH+cVooMDKnAIZF3PhLxqUrJlGMUtX869QManr/SPfbMKoyhYu4w415CqTbTnW Dz3CR8x9Yuylw1CPNV6i0LKkYrDkKXrcv2duwznnaX/dHEQ02kemZepGMXtCArWrPlHXPF QeAhVhT27Fmd2R66VfEjW2GcqHVbBkW0L8acTr+DyIQUI3ScMoIWBph/UBFHlMYjv4fxgs KWqpnfT6Mps9LpI7R+kuuCxFIlvMM7gf0lOKgPuNpxrDRj7lBh2PfJRZg70Q5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706661968; a=rsa-sha256; cv=none; b=oi+uKQ1iTaShhbrjA7hn/rYXzDYYAGD4U51S82DuDsMnubDE2+/4+7BdFAVgvkJg6Zm6BD 7SyaPM1LIs+G6A6SJINWI2ZCo6MrsHSSIVhPbJSSZV2ZBxATbujoraLwCt/4mYUq2CwyGN YmJeV8qKssbLRmwqYkiJStw6PSObKKDBm0L4Hh4SihjrT7uEZhx3FNQ3/aGihvLoVflkmc nxibE/VR8YBMACIw2I9ZeYnoFSCO717I8G/YXgrP/NARYKrCsjiPxQdwe/QWFlopJDfGdy e+8GzfC84iP81Sfk/QATbtRUMxAqlC9xy/sDWMT+tgyjzuFsql588SkP4uBfjw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPjyS3hlszxj0; Wed, 31 Jan 2024 00:46: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 40V0k87Y063405; Wed, 31 Jan 2024 00:46:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40V0k849063402; Wed, 31 Jan 2024 00:46:08 GMT (envelope-from git) Date: Wed, 31 Jan 2024 00:46:08 GMT Message-Id: <202401310046.40V0k849063402@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: add51cc280f3 - stable/14 - Add kcmp(2) kernel bits List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: add51cc280f3a48abb2f4fc2e2e4f56efc186d54 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=add51cc280f3a48abb2f4fc2e2e4f56efc186d54 commit add51cc280f3a48abb2f4fc2e2e4f56efc186d54 Author: Konstantin Belousov AuthorDate: 2024-01-19 19:49:36 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-30 20:24:42 +0000 Add kcmp(2) kernel bits (cherry picked from commit d8decc9ae31af7ffc77276c89639fb13eb1020cc) --- sys/kern/sys_generic.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++++ sys/kern/syscalls.master | 10 +++++- sys/sys/syscallsubr.h | 2 ++ sys/sys/systm.h | 2 ++ sys/sys/unistd.h | 7 ++++ 5 files changed, 107 insertions(+), 1 deletion(-) diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index 961bfeaf2bad..b3aaa2956d6f 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -67,6 +67,7 @@ #include #include #include +#include #include #include #include @@ -2073,3 +2074,89 @@ kern_posix_error(struct thread *td, int error) td->td_retval[0] = error; return (0); } + +int +kcmp_cmp(uintptr_t a, uintptr_t b) +{ + if (a == b) + return (0); + else if (a < b) + return (1); + return (2); +} + +static int +kcmp_pget(struct thread *td, pid_t pid, struct proc **pp) +{ + if (pid == td->td_proc->p_pid) { + *pp = td->td_proc; + return (0); + } + return (pget(pid, PGET_CANDEBUG | PGET_NOTWEXIT | PGET_HOLD, pp)); +} + +int +kern_kcmp(struct thread *td, pid_t pid1, pid_t pid2, int type, + uintptr_t idx1, uintptr_t idx2) +{ + struct proc *p1, *p2; + struct file *fp1, *fp2; + int error, res; + + res = -1; + p1 = p2 = NULL; + error = kcmp_pget(td, pid1, &p1); + if (error == 0) + error = kcmp_pget(td, pid2, &p2); + if (error != 0) + goto out; + + switch (type) { + case KCMP_FILE: + case KCMP_FILEOBJ: + error = fget_remote(td, p1, idx1, &fp1); + if (error == 0) { + error = fget_remote(td, p2, idx2, &fp2); + if (error == 0) { + if (type == KCMP_FILEOBJ) + res = fo_cmp(fp1, fp2, td); + else + res = kcmp_cmp((uintptr_t)fp1, + (uintptr_t)fp2); + fdrop(fp2, td); + } + fdrop(fp1, td); + } + break; + case KCMP_FILES: + res = kcmp_cmp((uintptr_t)p1->p_fd, (uintptr_t)p2->p_fd); + break; + case KCMP_SIGHAND: + res = kcmp_cmp((uintptr_t)p1->p_sigacts, + (uintptr_t)p2->p_sigacts); + break; + case KCMP_VM: + res = kcmp_cmp((uintptr_t)p1->p_vmspace, + (uintptr_t)p2->p_vmspace); + break; + default: + error = EINVAL; + break; + } + +out: + if (p1 != NULL && p1 != td->td_proc) + PRELE(p1); + if (p2 != NULL && p2 != td->td_proc) + PRELE(p2); + + td->td_retval[0] = res; + return (error); +} + +int +sys_kcmp(struct thread *td, struct kcmp_args *uap) +{ + return (kern_kcmp(td, uap->pid1, uap->pid2, uap->type, + uap->idx1, uap->idx2)); +} diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master index f7c235ced26c..a50d7723378c 100644 --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -3338,6 +3338,14 @@ _Out_opt_ _Contains_long_timet_ struct itimerspec *old_value ); } - +588 AUE_NULL STD { + int kcmp( + pid_t pid1, + pid_t pid2, + int type, + uintptr_t idx1, + uintptr_t idx2 + ); + } ; vim: syntax=off diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h index 15e05985e75f..29c7c364ccf6 100644 --- a/sys/sys/syscallsubr.h +++ b/sys/sys/syscallsubr.h @@ -200,6 +200,8 @@ int kern_ioctl(struct thread *td, int fd, u_long com, caddr_t data); int kern_jail(struct thread *td, struct jail *j); int kern_jail_get(struct thread *td, struct uio *options, int flags); int kern_jail_set(struct thread *td, struct uio *options, int flags); +int kern_kcmp(struct thread *td, pid_t pid1, pid_t pid2, int type, + uintptr_t idx1, uintptr_t idx2); int kern_kevent(struct thread *td, int fd, int nchanges, int nevents, struct kevent_copyops *k_ops, const struct timespec *timeout); int kern_kevent_anonymous(struct thread *td, int nevents, diff --git a/sys/sys/systm.h b/sys/sys/systm.h index 0e90b6062b72..9a0932e50dc9 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -487,6 +487,8 @@ int poll_no_poll(int events); /* XXX: Should be void nanodelay(u_int nsec); */ void DELAY(int usec); +int kcmp_cmp(uintptr_t a, uintptr_t b); + /* Root mount holdback API */ struct root_hold_token { int flags; diff --git a/sys/sys/unistd.h b/sys/sys/unistd.h index 77df90cd26b1..1b9262c75af4 100644 --- a/sys/sys/unistd.h +++ b/sys/sys/unistd.h @@ -197,6 +197,13 @@ RFPROCDESC | RFSPAWN | RFPPWAIT) #define RFKERNELONLY (RFSTOPPED | RFHIGHPID | RFPROCDESC) +/* kcmp() options. */ +#define KCMP_FILE 100 +#define KCMP_FILEOBJ 101 +#define KCMP_FILES 102 +#define KCMP_SIGHAND 103 +#define KCMP_VM 104 + #define SWAPOFF_FORCE 0x00000001 /* From nobody Wed Jan 31 00:46:10 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPjyW1mKvz580Zp; Wed, 31 Jan 2024 00: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 4TPjyV6rBYz45KZ; Wed, 31 Jan 2024 00: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=1706661971; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8Fcz90f/J2DPswxTigoalvGaWmTj6xeYPNn/OUeSugM=; b=LeyxPVbVWbJtYDtfSsH2Dx0f6m7A9m4ervpol96qm1z1058BE18BDnEWqeupuArGyhMGJz jggHrKITtFsuWxaJBCO48rVKZ0HrKu8gQfZ+SOHBziOeR3+92vFQPEZvmrNuwu8Asr+1/J b/ZMd3XlUuhQseuTqoQMd2MEMiwsHTC+gZW9ND9lV4x6tqfERRLAwa9oeihbozdMcWgwpu hWxcFD+WF9szKFPh05LmfonLx4M0t3g+QUaBcCj1tAnnQ5rp5AC5bNR0wqZlpkETqjPQ1x NjIccYJ7JhhPn7/hNeDPB2OQbtpSgBtXsHb6mkxK4LmLCCflmYFgIzkz7TZolg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661971; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8Fcz90f/J2DPswxTigoalvGaWmTj6xeYPNn/OUeSugM=; b=h8VwFhG8/9chlYgwul1gg0La6JdRRo/7sS7WyF/slpz01F+YHEHzdiBxsctileytgvKCz/ FcElZ86tk4ZlNruu/uADQvgobQnVinZKtbvKNgF0t34jTVhfJF64Tm+uDaYeukJPftxx/G Zz2sj+sfn7UbWkJkmj/fMqBAjmiH9hSbuHuXyyC+r8YT6SkplCfWnKM9x+Az8L1jvX/J/E AX+BrKBAD/4DFOvDR9FlxkBxPBBBfffvpmfOXfqwIeh5+p+lJBvY8XnZF7sGlEaaf5Yo6Q qOWf8e06g3pjSmHH2PJpfaLLU++U72cAwbJ+lm/HXDW4DT/s8Tdt5d8GgTYUsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706661971; a=rsa-sha256; cv=none; b=bScEWJ2UGFuXFnbeeCk5r947hGAe1EYUi4vhEoDKvZGJRI1pas5w2NjPCceWE2TyGFp9vP +Eoz33HdIYPB98TpNlGVPOl5Pv4vUB6bzf5ztsrK6V0p76jtHL+YQMG6XVX941UFH5taRj ns+Pel9yJld4MDLkIOeVDPZE+nAvqmcXcCdEclGfFp11AR7LwKLGs2npMzj4bSH9QMPSFF TJCr9Rn136yVHqhFlOmE+is6TViKaJGGW9JSHryNTsgwYyR3ZA2QrqxPxceFi4dgvacNNK D43T938zMTIsCybY7x4YYIqLiDfpcxVIKhKr62U83FXP6Z1fgE9+P4tkwsXWlw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPjyV5sVSzxwG; Wed, 31 Jan 2024 00: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 40V0kA9C063489; Wed, 31 Jan 2024 00: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 40V0kAou063486; Wed, 31 Jan 2024 00:46:10 GMT (envelope-from git) Date: Wed, 31 Jan 2024 00:46:10 GMT Message-Id: <202401310046.40V0kAou063486@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: 575a909aa243 - stable/14 - kcmp(2): implement for generic file types List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 575a909aa2430fcfe5b8ca8ae0d063a8b775fe4b Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=575a909aa2430fcfe5b8ca8ae0d063a8b775fe4b commit 575a909aa2430fcfe5b8ca8ae0d063a8b775fe4b Author: Konstantin Belousov AuthorDate: 2024-01-19 21:44:37 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-30 20:24:42 +0000 kcmp(2): implement for generic file types (cherry picked from commit f28526e9466cd60ed33053e922238ba1c9040341) --- sys/kern/kern_event.c | 1 + sys/kern/sys_eventfd.c | 1 + sys/kern/sys_generic.c | 8 ++++++++ sys/kern/sys_pipe.c | 1 + sys/kern/sys_socket.c | 1 + sys/kern/sys_timerfd.c | 1 + sys/kern/tty_pts.c | 1 + sys/kern/uipc_mqueue.c | 1 + sys/kern/uipc_sem.c | 1 + sys/kern/uipc_shm.c | 1 + sys/sys/file.h | 1 + 11 files changed, 18 insertions(+) diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 540fd58d2e2a..41295c374e65 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -139,6 +139,7 @@ static struct fileops kqueueops = { .fo_chmod = invfo_chmod, .fo_chown = invfo_chown, .fo_sendfile = invfo_sendfile, + .fo_cmp = file_kcmp_generic, .fo_fill_kinfo = kqueue_fill_kinfo, }; diff --git a/sys/kern/sys_eventfd.c b/sys/kern/sys_eventfd.c index 5efad129edae..739dbf75b01e 100644 --- a/sys/kern/sys_eventfd.c +++ b/sys/kern/sys_eventfd.c @@ -77,6 +77,7 @@ static struct fileops eventfdops = { .fo_chown = invfo_chown, .fo_sendfile = invfo_sendfile, .fo_fill_kinfo = eventfd_fill_kinfo, + .fo_cmp = file_kcmp_generic, .fo_flags = DFLAG_PASSABLE }; diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index b3aaa2956d6f..c999bd60f95d 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -2160,3 +2160,11 @@ sys_kcmp(struct thread *td, struct kcmp_args *uap) return (kern_kcmp(td, uap->pid1, uap->pid2, uap->type, uap->idx1, uap->idx2)); } + +int +file_kcmp_generic(struct file *fp1, struct file *fp2, struct thread *td) +{ + if (fp1->f_type != fp2->f_type) + return (3); + return (kcmp_cmp((uintptr_t)fp1->f_data, (uintptr_t)fp2->f_data)); +} diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 6e64ff41db0a..1c8d72f70a92 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -166,6 +166,7 @@ struct fileops pipeops = { .fo_chown = pipe_chown, .fo_sendfile = invfo_sendfile, .fo_fill_kinfo = pipe_fill_kinfo, + .fo_cmp = file_kcmp_generic, .fo_flags = DFLAG_PASSABLE }; diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index 6c7c1de94f5b..45b458f81f19 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -112,6 +112,7 @@ struct fileops socketops = { .fo_sendfile = invfo_sendfile, .fo_fill_kinfo = soo_fill_kinfo, .fo_aio_queue = soo_aio_queue, + .fo_cmp = file_kcmp_generic, .fo_flags = DFLAG_PASSABLE }; diff --git a/sys/kern/sys_timerfd.c b/sys/kern/sys_timerfd.c index e245baed88be..d9c0e189baf2 100644 --- a/sys/kern/sys_timerfd.c +++ b/sys/kern/sys_timerfd.c @@ -371,6 +371,7 @@ static struct fileops timerfdops = { .fo_chown = invfo_chown, .fo_sendfile = invfo_sendfile, .fo_fill_kinfo = timerfd_fill_kinfo, + .fo_cmp = file_kcmp_generic, .fo_flags = DFLAG_PASSABLE, }; diff --git a/sys/kern/tty_pts.c b/sys/kern/tty_pts.c index 31122d422a28..4a3b3d77c89e 100644 --- a/sys/kern/tty_pts.c +++ b/sys/kern/tty_pts.c @@ -610,6 +610,7 @@ static struct fileops ptsdev_ops = { .fo_chown = invfo_chown, .fo_sendfile = invfo_sendfile, .fo_fill_kinfo = ptsdev_fill_kinfo, + .fo_cmp = file_kcmp_generic, .fo_flags = DFLAG_PASSABLE, }; diff --git a/sys/kern/uipc_mqueue.c b/sys/kern/uipc_mqueue.c index f4660be70da8..f7695945fcc4 100644 --- a/sys/kern/uipc_mqueue.c +++ b/sys/kern/uipc_mqueue.c @@ -2661,6 +2661,7 @@ static struct fileops mqueueops = { .fo_chown = mqf_chown, .fo_sendfile = invfo_sendfile, .fo_fill_kinfo = mqf_fill_kinfo, + .fo_cmp = file_kcmp_generic, .fo_flags = DFLAG_PASSABLE, }; diff --git a/sys/kern/uipc_sem.c b/sys/kern/uipc_sem.c index d3c77a37400a..b4652e9106ac 100644 --- a/sys/kern/uipc_sem.c +++ b/sys/kern/uipc_sem.c @@ -153,6 +153,7 @@ static struct fileops ksem_ops = { .fo_chown = ksem_chown, .fo_sendfile = invfo_sendfile, .fo_fill_kinfo = ksem_fill_kinfo, + .fo_cmp = file_kcmp_generic, .fo_flags = DFLAG_PASSABLE }; diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c index a8e2502808a0..1b9434aa438c 100644 --- a/sys/kern/uipc_shm.c +++ b/sys/kern/uipc_shm.c @@ -169,6 +169,7 @@ struct fileops shm_ops = { .fo_add_seals = shm_add_seals, .fo_fallocate = shm_fallocate, .fo_fspacectl = shm_fspacectl, + .fo_cmp = file_kcmp_generic, .fo_flags = DFLAG_PASSABLE | DFLAG_SEEKABLE, }; diff --git a/sys/sys/file.h b/sys/sys/file.h index 540f1f525736..bfc2c6ab4652 100644 --- a/sys/sys/file.h +++ b/sys/sys/file.h @@ -281,6 +281,7 @@ fo_seek_t vn_seek; fo_fill_kinfo_t vn_fill_kinfo; fo_kqfilter_t vn_kqfilter_opath; int vn_fill_kinfo_vnode(struct vnode *vp, struct kinfo_file *kif); +int file_kcmp_generic(struct file *fp1, struct file *fp2, struct thread *td); void finit(struct file *, u_int, short, void *, struct fileops *); void finit_vnode(struct file *, u_int, void *, struct fileops *); From nobody Wed Jan 31 00:46:11 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPjyX5QX9z580dM; Wed, 31 Jan 2024 00:46:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TPjyX0pbdz45dZ; Wed, 31 Jan 2024 00:46:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661972; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oKNKlXuTALxa/rRS/rKV6eta6y9nm68YMNyVDyTZPRo=; b=YtqY+0HxtrXipE37qbyZL+13cLYmygjt3nb8qyV04p0bu+2i5IpE/8WqIezNe5QWKsiB3G hgNzjPqCyp4iRJEN7TpSgYWegfOIV2UmY0/Q/wJDnAiwu2YaYFDRN5RdPbGp9BVkq5T4WT 6msAlXXOmDMbgapW6PTaC6gcUL7au7OV36dhwAki6Lwcq2guNf3RQ7uJdCVyw1UMySiKA9 p2N0rrm9AopbUFYjoE/OVIGMgCA4m9vJP4vlxQmlPqLjrGnjB7Rz3Qa+o6uUXuKSTIa6eP 7mJD7Y9z3oZJ80dauBj5O38himDxew/hrOZWD6MgJ2ZwKuaUxtyTLifzmg7wAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661972; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oKNKlXuTALxa/rRS/rKV6eta6y9nm68YMNyVDyTZPRo=; b=SMBPvA7miscAB5K3dgKIYecfC8gFw3jqz6LvfcFTJy5RrZqnH/vYIjDS57VfRj5+bPr8AS IpKq4aU20ruFieAhJUM+kBIahm4yPyyRMSIregSj6nYWQeUkOzQ8H7Z74lBSAyl2BErOZt pWvLMmOysPAqjG9DYjooCHDmWeywWELTWddCsE6YRYKG1/4kUg9LHKTmdnsKLJFsImEcGj aP/D88Ui22PuJgb+XCsKgvJYuXTztoJpUotmmyC8q2V1CrIjupJOSC3VQDjPiNt24i89di ilavSj2FZDXgnKsXRZxlvOaDnq7Tx/0KqT+yE+6YImWhINKhJmL0/QxJr1pf+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706661972; a=rsa-sha256; cv=none; b=DMh+f6eUHHzrxxOy6cb7KGNmNqYfTy2ouI22qHdrnze0DShfYMOZq7bdlWcSKvu/j2lOjU FdgAXPPHGDczhEA+BOP+askgxaZjivsUWJFGaux0al7zUKqa0cHXDxPUXtgxUjjVaGnebZ bTAoVIrzhQw7qAKId7eH/uDW7ecuXAJbdbVI4Iw65jlUA6KhcTwiwan0VrMvRYBV2N9d5I ZAn6IcpcCAFMC31ylpOzxuRKrcOg7q9lvxG6Fk5d6/Wa12TQx3QExlH1k/qzcj8Yjh/MkP /Pd6GIMbv8A+LlcjzE5tpFTYrOXQ6z+MM8mBN1XotvR+gmdih6jYuRMSzeb1Gw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPjyW6tBQzxVs; Wed, 31 Jan 2024 00:46: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 40V0kBLh063542; Wed, 31 Jan 2024 00:46:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40V0kBVq063539; Wed, 31 Jan 2024 00:46:11 GMT (envelope-from git) Date: Wed, 31 Jan 2024 00:46:11 GMT Message-Id: <202401310046.40V0kBVq063539@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: 098500b79e17 - stable/14 - kcmp(2): implement for vnode files List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 098500b79e1734f269743eabb624c854804c67ac Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=098500b79e1734f269743eabb624c854804c67ac commit 098500b79e1734f269743eabb624c854804c67ac Author: Konstantin Belousov AuthorDate: 2024-01-19 21:24:31 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-30 20:24:42 +0000 kcmp(2): implement for vnode files (cherry picked from commit f04220c1b0641fa68d01dc85d9fef706b02f4079) --- sys/kern/kern_descrip.c | 1 + sys/kern/vfs_vnops.c | 9 +++++++++ sys/sys/vnode.h | 1 + 3 files changed, 11 insertions(+) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 7bb392eee6b2..30d82f74d725 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -5287,6 +5287,7 @@ struct fileops path_fileops = { .fo_chown = badfo_chown, .fo_sendfile = badfo_sendfile, .fo_fill_kinfo = vn_fill_kinfo, + .fo_cmp = vn_cmp, .fo_flags = DFLAG_PASSABLE, }; diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 50f202d6ea1a..b650b32ccc55 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -125,6 +125,7 @@ struct fileops vnops = { .fo_mmap = vn_mmap, .fo_fallocate = vn_fallocate, .fo_fspacectl = vn_fspacectl, + .fo_cmp = vn_cmp, .fo_flags = DFLAG_PASSABLE | DFLAG_SEEKABLE }; @@ -4230,3 +4231,11 @@ vn_lktype_write(struct mount *mp, struct vnode *vp) return (LK_SHARED); return (LK_EXCLUSIVE); } + +int +vn_cmp(struct file *fp1, struct file *fp2, struct thread *td) +{ + if (fp2->f_type != DTYPE_VNODE) + return (3); + return (kcmp_cmp((uintptr_t)fp1->f_vnode, (uintptr_t)fp2->f_vnode)); +} diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 07b1a419b916..2667b77d7c52 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -820,6 +820,7 @@ int vn_vget_ino_gen(struct vnode *vp, vn_get_ino_t alloc, void *alloc_arg, int lkflags, struct vnode **rvp); int vn_utimes_perm(struct vnode *vp, struct vattr *vap, struct ucred *cred, struct thread *td); +int vn_cmp(struct file *, struct file *, struct thread *td); int vn_io_fault_uiomove(char *data, int xfersize, struct uio *uio); int vn_io_fault_pgmove(vm_page_t ma[], vm_offset_t offset, int xfersize, From nobody Wed Jan 31 00:46:14 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPjyZ5swLz580Zw; Wed, 31 Jan 2024 00:46: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 4TPjyZ3HJxz45h3; Wed, 31 Jan 2024 00:46:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UrZOlxfj9F8lNEEQeN+boRAsM2MyMb/LyBx+qhqrU4s=; b=Wgspx6VrxMgiNWBhVZ0Kwf62KBfrJk7NbVgPPgeJPMKTrWtzbUXIXa9FVQg4p4PaVFMB/8 sfB+GO60tik7cCRfI/3qzgkIVqjJgMrytEfddV76gFKB2tjQbTx17XEp2OSPwhsG77A7jt BZ48hXVvzLquyXw9WHy3d5uXIZCLIE8313uzoRdbZaXGs3NRzJOJEog6LL+C8Vo74D5OJe Sy3VYsQCMh84hp3j9kgJjlofDrqOwm/rRsLvy1ojNAxl6ot125cs6jC30LRIUxRT9MdoNP vaGE7GANPc18uEcIoo28y/yS6mO5l2UT5OywNNWezSxpWOx0JqNLNXvMeS6dVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UrZOlxfj9F8lNEEQeN+boRAsM2MyMb/LyBx+qhqrU4s=; b=uT9h0TccMGP7GhpwpHkinuKQYnMLEStgOonrb4iqFC6FAUQUmJvdd7UrgXNfluCMMscEpi vIHnMn85KyX+/oVOoNSNwsUEnLQHRXI2D/sAjiBJaKx9WwoL56Vl/C6uK19agtYp+NuDT2 1zoAz+WJHE+Vt2/PNo+xLmaU5qzlOp+sS0WY9JYcv+y42ANw2bjSjzYyzLNJ+GLMFltpA+ VRbAktPm04iF/RU7NUrpGYQQekVoKplRhqJs/tiZl+jQa+yKzD0za+XbRvDfZ6Js9fkpSB 5rE3A0VmmcQS162dWjg7ZeOmnIVnnfGhKeEuiiwq4l/dvtSzCHfEnmiTBPM83Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706661974; a=rsa-sha256; cv=none; b=mcRnYTSGEaBvdysJ05u2AL+uCHNjbTwP8E6J8QWyWj1d99u/ngLUUKoReaCY8jOjYuGoD3 LeVrqYJYJd77dLJBwiKDh7FUktet++SNXIgeYYs45thIn+ZDk8l+sfIwuWIQW8mxpgnPOM Q2XOAJk6P/GVRI2d9JJA4sWCfmeiSuPV2HU52czQmBRU8brMDiSfkDk9jyeeU+psuMGJGX oFbQVEY1yl2xlnFMgOJEH5cJJVvIaoZ0zZmffsR1q+/LDc9XmBqyd2m+V3KIE5fsr6oDC8 JH1Lmo2dG0V7sFeIjEEo296rVXKTJdVcp5G5gjsawQZCyQV4BGtnuKNFWIfE0g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPjyZ1k9jzxVt; Wed, 31 Jan 2024 00:46: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 40V0kEll063635; Wed, 31 Jan 2024 00:46:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40V0kE48063632; Wed, 31 Jan 2024 00:46:14 GMT (envelope-from git) Date: Wed, 31 Jan 2024 00:46:14 GMT Message-Id: <202401310046.40V0kE48063632@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: 81cee1350ff8 - stable/14 - kcmp(2): implement for linuxkpi cdevs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 81cee1350ff87537f8203d2db0e8ed2acdff7aef Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=81cee1350ff87537f8203d2db0e8ed2acdff7aef commit 81cee1350ff87537f8203d2db0e8ed2acdff7aef Author: Konstantin Belousov AuthorDate: 2024-01-19 21:54:03 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-30 20:24:43 +0000 kcmp(2): implement for linuxkpi cdevs (cherry picked from commit 41fb6dc3d4df632ffacf91b5631a718442d129d5) --- sys/compat/linuxkpi/common/src/linux_compat.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index b913ae602ab3..69a17ea1a4a4 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -1899,6 +1899,19 @@ linux_iminor(struct inode *inode) return (minor(ldev->dev)); } +static int +linux_file_kcmp(struct file *fp1, struct file *fp2, struct thread *td) +{ + struct linux_file *filp1, *filp2; + + if (fp2->f_type != DTYPE_DEV) + return (3); + + filp1 = fp1->f_data; + filp2 = fp2->f_data; + return (kcmp_cmp((uintptr_t)filp1->f_cdev, (uintptr_t)filp2->f_cdev)); +} + struct fileops linuxfileops = { .fo_read = linux_file_read, .fo_write = linux_file_write, @@ -1913,6 +1926,7 @@ struct fileops linuxfileops = { .fo_chmod = invfo_chmod, .fo_chown = invfo_chown, .fo_sendfile = invfo_sendfile, + .fo_cmp = linux_file_kcmp, .fo_flags = DFLAG_PASSABLE, }; From nobody Wed Jan 31 00:46:12 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPjyY58nkz580Xn; Wed, 31 Jan 2024 00:46:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TPjyY1vrrz45gn; Wed, 31 Jan 2024 00:46:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661973; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pi1L2w2AxnJntDPsqa7ht+38iTOrk57JguT5UMZY7pU=; b=huCPcb+oiktxrRtQ8WnznwbN2rYQfE06no7jCFGGX5CqwQG8PI5YLscd/UibU0KyQ/saJu 8nPqHrKk4N6UyXaq9L2Dpg2Tp8y8jQS3e2IPwfQ9zutOtjcL5OHg/UavXqRnH5wu+Nxa/C 5iNGA0lAoAfjUbQLi60SPctO2HMXHaeiR99Vjc12D4CxfHKeuCppvPIbKJcqmfzvNCgsCa NoGclZf1SV98C6siSa7FiQV77TKekJxBp49hjDPHeqnocR0VjkSrp+xe8rbCec6Sfc6PR0 VEcJqGGmq1PG/dAjZWFCWHaRg8Wes6RTW7APq5A4pnCW6eIPOofpEVzQFFbrLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661973; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pi1L2w2AxnJntDPsqa7ht+38iTOrk57JguT5UMZY7pU=; b=mFiY7dsWSDCh6lk4qSTwbfigh+GPU8aeCyf25G/qsNctrcbsDb1+Qq3LHQgHv+1PnCeo/e zNeZtRyBCH6K3ceTbwIJC5hjVE6DEjjS472czc5/clYvQZm8VvMz8WI4aetL79hgukmUzf xaN3hXp/NPPjBRVIAakN0ycRI5mSslo15HrNttxKc7Q6uGySvWRvgc5n1duaQv3/Yqt34D qvWdMuuubXfjS1mUsTGh2jlEFCd5+VNuSwKOKzMjlP4z2gK15ftFAuQFcAYBZ11rp8YEZ5 clBm15gpV5Ge3+8xdTiiqa3FwihAGKJiGDoFoCq+nBpdIpSPqBtOTXejWFgYWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706661973; a=rsa-sha256; cv=none; b=gtwzTVD2uygQ7IwTvFtu0wpofwBQUUT2WPFEryTHGKrTinOHfM3BuSzYJtp4o/ejeE1hhL lExj1Pw1jInDLe9gHOwKcaJeQCDTT+KPJuBUayZlqlels7HmNtDj4xkQpa9ibDnRlMQVpg GW/6QpPQTRfadyGx70OAO5ngCBjWex0soumBRyPh8IStNFzUrlCta98H5toACc3LD/dyfF Gi8dRHDu5fy6IYZ//uEtij345lS2Chp+0/1F+URG6kFBUVzxvL/cxVUQHVlRL/jEcZKmlF ICo5B3MY4tgTu/lqluEGXtsDNJmd2MdotsxDrpxFRABrgNLYR4jkzMVD4Z+DwA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPjyY0h2mzxxH; Wed, 31 Jan 2024 00:46: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 40V0kDsd063593; Wed, 31 Jan 2024 00:46:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40V0kCdL063590; Wed, 31 Jan 2024 00:46:12 GMT (envelope-from git) Date: Wed, 31 Jan 2024 00:46:12 GMT Message-Id: <202401310046.40V0kCdL063590@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: 7dff3d1cdfd1 - stable/14 - kcmp(2): implement for devfs files List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7dff3d1cdfd1556d2137ddd8dd1916e0945ed240 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7dff3d1cdfd1556d2137ddd8dd1916e0945ed240 commit 7dff3d1cdfd1556d2137ddd8dd1916e0945ed240 Author: Konstantin Belousov AuthorDate: 2024-01-19 21:36:50 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-30 20:24:43 +0000 kcmp(2): implement for devfs files (cherry picked from commit 5c41d888de1aba0e82531fb6df4cc3b6989d37bd) --- sys/fs/devfs/devfs_vnops.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index 1df7d13be919..b8cf8c12d32e 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -2012,6 +2012,14 @@ dev2udev(struct cdev *x) return (cdev2priv(x)->cdp_inode); } +static int +devfs_cmp_f(struct file *fp1, struct file *fp2, struct thread *td) +{ + if (fp2->f_type != DTYPE_VNODE || fp2->f_ops != &devfs_ops_f) + return (3); + return (kcmp_cmp((uintptr_t)fp1->f_data, (uintptr_t)fp2->f_data)); +} + static struct fileops devfs_ops_f = { .fo_read = devfs_read_f, .fo_write = devfs_write_f, @@ -2027,6 +2035,7 @@ static struct fileops devfs_ops_f = { .fo_seek = vn_seek, .fo_fill_kinfo = vn_fill_kinfo, .fo_mmap = devfs_mmap_f, + .fo_cmp = devfs_cmp_f, .fo_flags = DFLAG_PASSABLE | DFLAG_SEEKABLE }; From nobody Wed Jan 31 00:46:15 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPjyb5rYNz580b3; Wed, 31 Jan 2024 00:46: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 4TPjyb3Qkyz45hF; Wed, 31 Jan 2024 00:46:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a4BvHkBYmmgH/6sp6ZNwLGXdB345KorE1uK1aB1hxWg=; b=F8gVzIb4XVpOykOBl92mDE9tSazYMaWzEqoA6Zr0bLel/Lrat+wvNzv+w8HdkoFpVc6LZQ y/1ldYCcJZGHkH9vP9Xxklwti8zlzk81yNyN0tVPdrYetSsLs13ebGEcstowPqzyEZ75AE oU1Uz9Zea7G+UE01CSq9BYPzYakNm2HTQZVq0DHFY+nl4ObV9wSseS3Py4+zgTKrIGRAOe OrTUvtVKIy5JSf3FcFuVn9VpM+c8RCuaBCfpPBj/Ss973K2OBEsG6RcnzHSpqo4rzmKLYY XXFgkDcMcpE7TS0ZiJHcX0xCtUCdzCFX4c9c9MwIviDilZeUhis1Im4qxmUX4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a4BvHkBYmmgH/6sp6ZNwLGXdB345KorE1uK1aB1hxWg=; b=mDDTg7KN5DAPXsNgL5SQnwAQNA0rvD8IOUsLUwQQx5esDM23HcF0CX6HqW92Fun6Zf0Pf2 uPkZNGMn06HYlOdpUD73fdwSkE9gy5t3N0RyNcCJFrASHofASmTCrWgBDfqkYyWvicX0Tj 9/wdoS+Bjbyt72lR32TJyDHYGGfwSiyz0Y3kWKORXrn+54nF5QPXNKJMfCh1u/Ev8hzUt1 N0xWUB+Uct+W/6qIhJk7OrwB8h1SWQR4/oJ8ouW4m4yoazad3IgKlhMTnu+XGvNbDlY0hE lXuRGj8vpDxsWJ+hZvkqvcVKoTNYXoEpXk6EXoaRt68b+FYVjFWJ47Ebc7LLFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706661975; a=rsa-sha256; cv=none; b=BBuyNGKboXro59cPPTqlgZxK7gmlT+fq1ota46eLMUHWnaXBQtRR6J1O/OeUXSZVRAHGiS i69SG7HzHImchtX10WXLas4B6K2nWDjvnkrqB34Bs+/l9S1vCrefu6ObOpqXRfbPILUQ9e Hixhvpxzc7ordYF+NTfKiPlpJpUigrRi4312/jdqhIf5zUFVfNjNxn6KUBQydW6fZBavAg rzPPBm/swg+7ak6U8u0J2C55PvNQmQ6xgBF8v8ioYuWVNW1tuZGbus28QdsXXybrHHhmZh hBVOEcIciVOiYuDqqKfSd2sXSsEtwaikBbr2LhA/zDlEDUKotU0oNY8+jVqavQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPjyb2WbGzxwH; Wed, 31 Jan 2024 00:46:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40V0kFde063674; Wed, 31 Jan 2024 00:46:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40V0kFhT063671; Wed, 31 Jan 2024 00:46:15 GMT (envelope-from git) Date: Wed, 31 Jan 2024 00:46:15 GMT Message-Id: <202401310046.40V0kFhT063671@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: 0b864eb03f66 - stable/14 - kcmp(2): implement for procdesc List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0b864eb03f6621d9d0f122e6b18360a4778a4647 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0b864eb03f6621d9d0f122e6b18360a4778a4647 commit 0b864eb03f6621d9d0f122e6b18360a4778a4647 Author: Konstantin Belousov AuthorDate: 2024-01-19 22:37:39 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-30 20:24:43 +0000 kcmp(2): implement for procdesc (cherry picked from commit f006524d6d696cc2a10b9e90a9a6ea412f1839eb) --- sys/kern/sys_procdesc.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sys/kern/sys_procdesc.c b/sys/kern/sys_procdesc.c index ac94c3b44730..e8e0efd5bb00 100644 --- a/sys/kern/sys_procdesc.c +++ b/sys/kern/sys_procdesc.c @@ -97,6 +97,7 @@ static fo_kqfilter_t procdesc_kqfilter; static fo_stat_t procdesc_stat; static fo_close_t procdesc_close; static fo_fill_kinfo_t procdesc_fill_kinfo; +static fo_cmp_t procdesc_cmp; static struct fileops procdesc_ops = { .fo_read = invfo_rdwr, @@ -111,6 +112,7 @@ static struct fileops procdesc_ops = { .fo_chown = invfo_chown, .fo_sendfile = invfo_sendfile, .fo_fill_kinfo = procdesc_fill_kinfo, + .fo_cmp = procdesc_cmp, .fo_flags = DFLAG_PASSABLE, }; @@ -555,3 +557,15 @@ procdesc_fill_kinfo(struct file *fp, struct kinfo_file *kif, kif->kf_un.kf_proc.kf_pid = pdp->pd_pid; return (0); } + +static int +procdesc_cmp(struct file *fp1, struct file *fp2, struct thread *td) +{ + struct procdesc *pdp1, *pdp2; + + if (fp2->f_type != DTYPE_PROCDESC) + return (3); + pdp1 = fp1->f_data; + pdp2 = fp2->f_data; + return (kcmp_cmp((uintptr_t)pdp1->pd_pid, (uintptr_t)pdp2->pd_pid)); +} From nobody Wed Jan 31 00:46:16 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPjyc66zfz580nt; Wed, 31 Jan 2024 00: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 4TPjyc4QzNz45kl; Wed, 31 Jan 2024 00: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=1706661976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1BVOiGIBAOe6qA5GVrH19oOv9r/ZPsVQDo/uXwuqxyY=; b=v3Uo88d8zVoM60B40yVcfsyeuQMttn4NmOV7vyFEfFvoAn5MaB37k6mkF5l7iRTqbzeUpj ThN8tH+LOMQqskv/znkN0u/M37jF27Z+HUymBNHu0yvGUUZlx49KK5qCXhKwoB4w3IJI/f T/XbbffGd1f+BxhnBHuXCL2/ytRrGOdUmvVD9hhkWgcjr/ZvIwOTmlFcJgFOIPWji2fXY7 SFuj+HAnc+hOsQ77D3C0tO/tNqYcA0K+NJTdskO+3e+sEqqoYPhK5RuV58y35JQ83U2bOd oqzKIocP1mm6SmSUo4Hh5bG7ONiPrV5GncQXa8l8XvET8Pek5IW4hB23WO4vTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1BVOiGIBAOe6qA5GVrH19oOv9r/ZPsVQDo/uXwuqxyY=; b=E3pKtXGNzrd+lW1+FmYUthosYN2t8YcwunhWHle5/xdo9gBqL/V/2s1aONkxaMqJHVFEI6 whBL8VBbgb6BeMc13o7DyqVKsoD/LCFk2w0djoagR7RMT8O7fYmzUMae9jwUWeUOmGFe+P X9V9HbXBsr7QNtTuqzQ5IOu6ntGW6LZqv58ZpKtOOaAMrwIkWgIBkvq4Lw1ajqgtP5LSpU +vO0MdmcQrDujI4bnmldJm1RMb8Ac/v3QKJCDujhnCbS1ML1nytKe4T8hytUnrGUyTjLSn AxrcTs8KsctsuZn9cy4y8gmeeobnpWFfe3cwdXo1Uj6gFOC4DAsrgRRE+d63xg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706661976; a=rsa-sha256; cv=none; b=dDFxbfKQnUjN/jINMAGh0R7ZMCFdvtWp53RKK6P+/MrX8V52CGx4J/iojZehhgmW6uh9q8 tPYrxBLnvN5dSMkpQr+yP8JPJOamcq+gUni3bGlFEDDUs4gGrXDW2QvgB07Vcjmw/KEJ/m RUICwmc3wmRTYC9lu9XdkfzcRs5CGh3PAP2NeDmcm8PF0wQ2rTnyesHigJq1wIjcJMYJGt GSgKDKQS+bLN5qKV4hklDH+myCmCR6JY+LmGL/fWK0JPhp7wM9ETreqa7kx31VO7cWH0Y+ vNLzgyKFwIextOmtomkmTV8ahC7dkBGQuHUFvaz9UcSYn5y/Z+ipXY9HQPbt4g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPjyc3WS2zxZ9; Wed, 31 Jan 2024 00: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 40V0kGJa063704; Wed, 31 Jan 2024 00: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 40V0kGEe063701; Wed, 31 Jan 2024 00:46:16 GMT (envelope-from git) Date: Wed, 31 Jan 2024 00:46:16 GMT Message-Id: <202401310046.40V0kGEe063701@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: 136d75ad86d1 - stable/14 - regen List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 136d75ad86d1a62d673490ed2679e7819444f0a9 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=136d75ad86d1a62d673490ed2679e7819444f0a9 commit 136d75ad86d1a62d673490ed2679e7819444f0a9 Author: Konstantin Belousov AuthorDate: 2024-01-24 05:21:28 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-30 20:24:43 +0000 regen --- sys/compat/freebsd32/freebsd32_syscall.h | 3 +- sys/compat/freebsd32/freebsd32_syscalls.c | 1 + sys/compat/freebsd32/freebsd32_sysent.c | 1 + sys/compat/freebsd32/freebsd32_systrace_args.c | 38 ++++++++++++++++++++++++++ sys/kern/init_sysent.c | 1 + sys/kern/syscalls.c | 1 + sys/kern/systrace_args.c | 38 ++++++++++++++++++++++++++ sys/sys/syscall.h | 3 +- sys/sys/syscall.mk | 3 +- sys/sys/sysproto.h | 9 ++++++ 10 files changed, 95 insertions(+), 3 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32_syscall.h b/sys/compat/freebsd32/freebsd32_syscall.h index 3123c3b1f74c..26b47e766d4a 100644 --- a/sys/compat/freebsd32/freebsd32_syscall.h +++ b/sys/compat/freebsd32/freebsd32_syscall.h @@ -506,4 +506,5 @@ #define FREEBSD32_SYS_timerfd_create 585 #define FREEBSD32_SYS_freebsd32_timerfd_gettime 586 #define FREEBSD32_SYS_freebsd32_timerfd_settime 587 -#define FREEBSD32_SYS_MAXSYSCALL 588 +#define FREEBSD32_SYS_kcmp 588 +#define FREEBSD32_SYS_MAXSYSCALL 589 diff --git a/sys/compat/freebsd32/freebsd32_syscalls.c b/sys/compat/freebsd32/freebsd32_syscalls.c index e64c36b32d00..8511d56552e6 100644 --- a/sys/compat/freebsd32/freebsd32_syscalls.c +++ b/sys/compat/freebsd32/freebsd32_syscalls.c @@ -593,4 +593,5 @@ const char *freebsd32_syscallnames[] = { "timerfd_create", /* 585 = timerfd_create */ "freebsd32_timerfd_gettime", /* 586 = freebsd32_timerfd_gettime */ "freebsd32_timerfd_settime", /* 587 = freebsd32_timerfd_settime */ + "kcmp", /* 588 = kcmp */ }; diff --git a/sys/compat/freebsd32/freebsd32_sysent.c b/sys/compat/freebsd32/freebsd32_sysent.c index 2bb45fc3d2e2..ecde86d07965 100644 --- a/sys/compat/freebsd32/freebsd32_sysent.c +++ b/sys/compat/freebsd32/freebsd32_sysent.c @@ -649,4 +649,5 @@ struct sysent freebsd32_sysent[] = { { .sy_narg = AS(timerfd_create_args), .sy_call = (sy_call_t *)sys_timerfd_create, .sy_auevent = AUE_TIMERFD, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 585 = timerfd_create */ { .sy_narg = AS(freebsd32_timerfd_gettime_args), .sy_call = (sy_call_t *)freebsd32_timerfd_gettime, .sy_auevent = AUE_TIMERFD, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 586 = freebsd32_timerfd_gettime */ { .sy_narg = AS(freebsd32_timerfd_settime_args), .sy_call = (sy_call_t *)freebsd32_timerfd_settime, .sy_auevent = AUE_TIMERFD, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 587 = freebsd32_timerfd_settime */ + { .sy_narg = AS(kcmp_args), .sy_call = (sy_call_t *)sys_kcmp, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 588 = kcmp */ }; diff --git a/sys/compat/freebsd32/freebsd32_systrace_args.c b/sys/compat/freebsd32/freebsd32_systrace_args.c index fb1fddc6ae5e..8bf3c29ecdbd 100644 --- a/sys/compat/freebsd32/freebsd32_systrace_args.c +++ b/sys/compat/freebsd32/freebsd32_systrace_args.c @@ -3371,6 +3371,17 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) *n_args = 4; break; } + /* kcmp */ + case 588: { + struct kcmp_args *p = params; + iarg[a++] = p->pid1; /* pid_t */ + iarg[a++] = p->pid2; /* pid_t */ + iarg[a++] = p->type; /* int */ + uarg[a++] = (intptr_t)p->idx1; /* uintptr_t */ + uarg[a++] = (intptr_t)p->idx2; /* uintptr_t */ + *n_args = 5; + break; + } default: *n_args = 0; break; @@ -9101,6 +9112,28 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) break; }; break; + /* kcmp */ + case 588: + switch (ndx) { + case 0: + p = "pid_t"; + break; + case 1: + p = "pid_t"; + break; + case 2: + p = "int"; + break; + case 3: + p = "uintptr_t"; + break; + case 4: + p = "uintptr_t"; + break; + default: + break; + }; + break; default: break; }; @@ -10989,6 +11022,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) if (ndx == 0 || ndx == 1) p = "int"; break; + /* kcmp */ + case 588: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; diff --git a/sys/kern/init_sysent.c b/sys/kern/init_sysent.c index d44fec54fcd7..a893deb73d9b 100644 --- a/sys/kern/init_sysent.c +++ b/sys/kern/init_sysent.c @@ -648,4 +648,5 @@ struct sysent sysent[] = { { .sy_narg = AS(timerfd_create_args), .sy_call = (sy_call_t *)sys_timerfd_create, .sy_auevent = AUE_TIMERFD, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 585 = timerfd_create */ { .sy_narg = AS(timerfd_gettime_args), .sy_call = (sy_call_t *)sys_timerfd_gettime, .sy_auevent = AUE_TIMERFD, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 586 = timerfd_gettime */ { .sy_narg = AS(timerfd_settime_args), .sy_call = (sy_call_t *)sys_timerfd_settime, .sy_auevent = AUE_TIMERFD, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 587 = timerfd_settime */ + { .sy_narg = AS(kcmp_args), .sy_call = (sy_call_t *)sys_kcmp, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 588 = kcmp */ }; diff --git a/sys/kern/syscalls.c b/sys/kern/syscalls.c index 8f13ccb186ee..552d94f0d439 100644 --- a/sys/kern/syscalls.c +++ b/sys/kern/syscalls.c @@ -593,4 +593,5 @@ const char *syscallnames[] = { "timerfd_create", /* 585 = timerfd_create */ "timerfd_gettime", /* 586 = timerfd_gettime */ "timerfd_settime", /* 587 = timerfd_settime */ + "kcmp", /* 588 = kcmp */ }; diff --git a/sys/kern/systrace_args.c b/sys/kern/systrace_args.c index 1b14b68c84d1..33b723ae0c36 100644 --- a/sys/kern/systrace_args.c +++ b/sys/kern/systrace_args.c @@ -3458,6 +3458,17 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) *n_args = 4; break; } + /* kcmp */ + case 588: { + struct kcmp_args *p = params; + iarg[a++] = p->pid1; /* pid_t */ + iarg[a++] = p->pid2; /* pid_t */ + iarg[a++] = p->type; /* int */ + uarg[a++] = (intptr_t)p->idx1; /* uintptr_t */ + uarg[a++] = (intptr_t)p->idx2; /* uintptr_t */ + *n_args = 5; + break; + } default: *n_args = 0; break; @@ -9246,6 +9257,28 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) break; }; break; + /* kcmp */ + case 588: + switch (ndx) { + case 0: + p = "pid_t"; + break; + case 1: + p = "pid_t"; + break; + case 2: + p = "int"; + break; + case 3: + p = "uintptr_t"; + break; + case 4: + p = "uintptr_t"; + break; + default: + break; + }; + break; default: break; }; @@ -11224,6 +11257,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) if (ndx == 0 || ndx == 1) p = "int"; break; + /* kcmp */ + case 588: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; diff --git a/sys/sys/syscall.h b/sys/sys/syscall.h index 724ca454dbf7..3cff10924501 100644 --- a/sys/sys/syscall.h +++ b/sys/sys/syscall.h @@ -524,4 +524,5 @@ #define SYS_timerfd_create 585 #define SYS_timerfd_gettime 586 #define SYS_timerfd_settime 587 -#define SYS_MAXSYSCALL 588 +#define SYS_kcmp 588 +#define SYS_MAXSYSCALL 589 diff --git a/sys/sys/syscall.mk b/sys/sys/syscall.mk index ef58619ea6d4..98aa9e370d0a 100644 --- a/sys/sys/syscall.mk +++ b/sys/sys/syscall.mk @@ -429,4 +429,5 @@ MIASM = \ membarrier.o \ timerfd_create.o \ timerfd_gettime.o \ - timerfd_settime.o + timerfd_settime.o \ + kcmp.o diff --git a/sys/sys/sysproto.h b/sys/sys/sysproto.h index d0eb5a43d00b..d96acfc47f91 100644 --- a/sys/sys/sysproto.h +++ b/sys/sys/sysproto.h @@ -1876,6 +1876,13 @@ struct timerfd_settime_args { char new_value_l_[PADL_(const struct itimerspec *)]; const struct itimerspec * new_value; char new_value_r_[PADR_(const struct itimerspec *)]; char old_value_l_[PADL_(struct itimerspec *)]; struct itimerspec * old_value; char old_value_r_[PADR_(struct itimerspec *)]; }; +struct kcmp_args { + char pid1_l_[PADL_(pid_t)]; pid_t pid1; char pid1_r_[PADR_(pid_t)]; + char pid2_l_[PADL_(pid_t)]; pid_t pid2; char pid2_r_[PADR_(pid_t)]; + char type_l_[PADL_(int)]; int type; char type_r_[PADR_(int)]; + char idx1_l_[PADL_(uintptr_t)]; uintptr_t idx1; char idx1_r_[PADR_(uintptr_t)]; + char idx2_l_[PADL_(uintptr_t)]; uintptr_t idx2; char idx2_r_[PADR_(uintptr_t)]; +}; int sys_exit(struct thread *, struct exit_args *); int sys_fork(struct thread *, struct fork_args *); int sys_read(struct thread *, struct read_args *); @@ -2276,6 +2283,7 @@ int sys_membarrier(struct thread *, struct membarrier_args *); int sys_timerfd_create(struct thread *, struct timerfd_create_args *); int sys_timerfd_gettime(struct thread *, struct timerfd_gettime_args *); int sys_timerfd_settime(struct thread *, struct timerfd_settime_args *); +int sys_kcmp(struct thread *, struct kcmp_args *); #ifdef COMPAT_43 @@ -3250,6 +3258,7 @@ int freebsd13_swapoff(struct thread *, struct freebsd13_swapoff_args *); #define SYS_AUE_timerfd_create AUE_TIMERFD #define SYS_AUE_timerfd_gettime AUE_TIMERFD #define SYS_AUE_timerfd_settime AUE_TIMERFD +#define SYS_AUE_kcmp AUE_NULL #undef PAD_ #undef PADL_ From nobody Wed Jan 31 00:49:05 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPk1s49ggz580yv; Wed, 31 Jan 2024 00:49: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 4TPk1s3Dk9z49mJ; Wed, 31 Jan 2024 00:49:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706662145; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MDy0XtMSrZcriAdFTPDJuUD9BoLtXpC0WHkyzSxxwV4=; b=cLaDVRzMzaGHU7yenEFWx7u+UZXdtKEYnjf5ScTupOlit40J8gaK3CDYsDj6yLkQ6kw9Fu N9b6uWKn7RlBnx2X9YpRfRW0HovlYm1cbPG7BtTuRyJ8R0MdcHVq4yDza/xXKXjRXjMZ/y fm45DwDMeH8n0SobNLMJIJA6NCJeZSJNDzeZq1zA76fWFcWjxK1r0CrKKp6P7K2tdwrwRJ cvIYoDhayVkflownADgqcri/rl200TdFbpWmcVRtp9fQs6VED80YTDAwdpRcOh6W2cPi9V hHf6Lq6SiHBRU2AWTjSCATM4IvKONTIs44O0sQ2lUodgOwDMBAdneVaip9MrOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706662145; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MDy0XtMSrZcriAdFTPDJuUD9BoLtXpC0WHkyzSxxwV4=; b=uE66m1yQhXRhKWHEEUtR16dkaIyvULO2C4jMd8QdSWsQzbTuUVtIBdqDgQiXycwmoxuLPH Fhr7BU4hlRyI8/Up4vrDGfFGtjEdjDTDvK7yVRpOkXmZP3Kvn1jqd/boHGUDLllw8+ad+r OUu/RjldQZaWnKE85bmysnjIXwAJsBrQNjjG0AMsnjlFgGO5HvYIOqUeIlNzSG9Ns8iHZN tqdU6O6JZrAbPpcZla/j+iZITtcjucFpiqj0r8OTFORd/UUBgrAGlzUKcLPkqbZxwoejYl IQsPY+Wyz/u9ivwXyNoBVsM0fr5L4/5yUARwsnrtoX9VI1oS3YpqnwsTE6He5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706662145; a=rsa-sha256; cv=none; b=h43r6CZZI9Lz6VCU/dYvRaVxg0UTC9ieTex+Rhvzqp94o7ou13cGACKyGdjRQ7v1FZCv5f rRXjnlTiS8OKEAMNebbfZOaZZX+W8f7v4RU4CYwDeIvhdom2WjxC32auAwncDH9RsdkaS0 WEO5Ibjwk0bdUiM0dglSPT9gN1SqImhyl+WhMcFKdT/M0TnSN5DEplLv0E+HDLwRfmmf6q TVlsdUPmVsNksLEKd953N9h65j4shtoGXyCZj3QQWJTllcDBF9DZZFK2juOq8Zm4BdCA6k oI9gi3oGxIEjYk95JRrF2mVP1p9vnQp05H9Je7G4oRa/1uVKxObqbdyXmZjPVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPk1s2Hm0zxZG; Wed, 31 Jan 2024 00:49: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 40V0n5l7064296; Wed, 31 Jan 2024 00:49:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40V0n5at064293; Wed, 31 Jan 2024 00:49:05 GMT (envelope-from git) Date: Wed, 31 Jan 2024 00:49:05 GMT Message-Id: <202401310049.40V0n5at064293@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: b566e44b2b88 - stable/14 - stable/14: bump __FreeBSD_version for kcmp(2) and kern_openatfp(9) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b566e44b2b88eb9f1b3b658998c7418cccab9e2f Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b566e44b2b88eb9f1b3b658998c7418cccab9e2f commit b566e44b2b88eb9f1b3b658998c7418cccab9e2f Author: Konstantin Belousov AuthorDate: 2024-01-31 00:47:49 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-31 00:48:31 +0000 stable/14: bump __FreeBSD_version for kcmp(2) and kern_openatfp(9) Sponsored by: The FreeBSD Foundation --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index 7afa1fc98af9..0cfd3517c0e8 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -75,7 +75,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1400506 +#define __FreeBSD_version 1400507 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Wed Jan 31 01:02:03 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPkJr1t44z5825w; Wed, 31 Jan 2024 01:02: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 4TPkJr01Ttz4CbL; Wed, 31 Jan 2024 01:02:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706662924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t6HTUWeklD3Xw9ooZ2SMrVctCBp+e9st2ONYh7OpT10=; b=W65mnMn9KBie+3lDRtBU4UsogmUJnAsTieMyruAgM6N9oNSvm9ro+QFn2GZJ+LJLMloC9L mLKL5KhOWKPg0c5NfwHnxjUopEjAl+DJO/eWMp1xJQ8onBI6woSFEvWcVhHuau2haLpYad 4HvI0ks1aaul6h6nJhxpiICewCc4bx53zdjcJjTrqZJ+jzqeoXIQuqc+keQeUenLtwgYmD IiN66eFzYBiavoidma4HkkVtEdIKVz3TbAi9srW70aj6t32Sba0FyMtvRCaHqVrIWWa0Tp D2mZTBiubjV4F9IqA1rtR8qeQ0UCSf2j2f6EbJ/tuUo4NRnRGhsvUyRx+AiCZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706662924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t6HTUWeklD3Xw9ooZ2SMrVctCBp+e9st2ONYh7OpT10=; b=SJ8oNYpD80TssX+DFQzJXUxUFaEU3S93XRRtwlINXTfI75f7+C0sT8pvTKNXKmNhhKL8bF SXsyL7cZ57oEQ3mKzqtnFTRfKwJHU0pH4j5wufMpRWmh7ZJ6kBNRSazLG87ZxJUafRiFMk NfAhvjHNIAmbpqWGqI5mDtaPye4M1YMz7UNvXlEpbdznWXXaKbUD8Hf4cUBhFD120sTlrX M9lnyGKBlwZfcBE9HlNZKCnjdleBew6hSiXSePCWm7t4Rvw3jOXSjEwYH0CCCgfU663Gqu PqcD5pp+bxkUAeHYtsDEvL/zjK2YKnlFT5F5pNRme8dkBQyXWM+dCYSzvbc6RA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706662924; a=rsa-sha256; cv=none; b=xHM2eoCgdOKDqGyFfj8GOu07BA/dkj6U88ueILuFdLt0/ERmsstidFiQJtyWvu/j9I2EK1 AbwEkNXDeZH7HjTBogCE3oyMT1Tm2jqetaGAxGfQ/AOhHo46d//M2sNVG2fHGqPFpzV2W/ /ii6c2v1udUImutjA4bgeN+HNLJB125bFfOnUQ/I2sj6qccXRYIoupuQcERv0txhj1NNsT sd+Jtes1pjFa/T2pD+dI88X/kC7ePxF1FNGo5cl/mMceq67Q/7ZZ8+U9bmjcF6pg1VG5sN IfSsCAMb7TZyr0d3cmWeG258Q64yVZKWTqYvhx+IHPZz2kVYttnw7shxEjjQ/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 4TPkJq69y7zyKt; Wed, 31 Jan 2024 01:02: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 40V123cY096801; Wed, 31 Jan 2024 01:02:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40V123BT096798; Wed, 31 Jan 2024 01:02:03 GMT (envelope-from git) Date: Wed, 31 Jan 2024 01:02:03 GMT Message-Id: <202401310102.40V123BT096798@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: ebdc39c9e9c7 - stable/13 - kern_openat(): rename fd argument to dirfd List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ebdc39c9e9c7a9682c28691d3a06f4fff043af3f Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ebdc39c9e9c7a9682c28691d3a06f4fff043af3f commit ebdc39c9e9c7a9682c28691d3a06f4fff043af3f Author: Konstantin Belousov AuthorDate: 2024-01-20 21:41:12 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-30 20:24:33 +0000 kern_openat(): rename fd argument to dirfd (cherry picked from commit 2a284076ecb4d22928b78249070efa46153666ff) --- sys/kern/vfs_syscalls.c | 6 +++--- sys/sys/syscallsubr.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 830f0d008aca..3c45610a8853 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1104,8 +1104,8 @@ sys_openat(struct thread *td, struct openat_args *uap) } int -kern_openat(struct thread *td, int fd, const char *path, enum uio_seg pathseg, - int flags, int mode) +kern_openat(struct thread *td, int dirfd, const char *path, + enum uio_seg pathseg, int flags, int mode) { struct proc *p = td->td_proc; struct filedesc *fdp; @@ -1152,7 +1152,7 @@ kern_openat(struct thread *td, int fd, const char *path, enum uio_seg pathseg, fp->f_flag = flags & FMASK; cmode = ((mode & ~pdp->pd_cmask) & ALLPERMS) & ~S_ISTXT; NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | AUDITVNODE1 | WANTIOCTLCAPS, - pathseg, path, fd, &rights, td); + pathseg, path, dirfd, &rights, td); td->td_dupfd = -1; /* XXX check for fdopen */ error = vn_open_cred(&nd, &flags, cmode, VN_OPEN_WANTIOCTLCAPS, td->td_ucred, fp); diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h index aabcb19448cc..02e5b1a4c077 100644 --- a/sys/sys/syscallsubr.h +++ b/sys/sys/syscallsubr.h @@ -228,7 +228,7 @@ int kern_nanosleep(struct thread *td, struct timespec *rqt, int kern_ntp_adjtime(struct thread *td, struct timex *ntv, int *retvalp); int kern_ogetdirentries(struct thread *td, struct ogetdirentries_args *uap, long *ploff); -int kern_openat(struct thread *td, int fd, const char *path, +int kern_openat(struct thread *td, int dirfd, const char *path, enum uio_seg pathseg, int flags, int mode); int kern_pathconf(struct thread *td, const char *path, enum uio_seg pathseg, int name, u_long flags, long *valuep); From nobody Wed Jan 31 01:02:04 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPkJs2bYtz582Tq; Wed, 31 Jan 2024 01:02: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 4TPkJs0w0Mz4ChB; Wed, 31 Jan 2024 01:02:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706662925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mkU09zrNbpgwImCggiweT+CZ4BbKqd/xgosrsyjc9BA=; b=bVSiCTvkAs+sxYgM5ihoEPJ0YmNYICmfGIiDF/og/3OOxyfYS3K1CwRn9NsWkpw3nVKykB ujLD22alwnuT5zXevC+TttZRbQAfiSdOhg736vBjxKhOUZdH8z2xli7nYK8TVnPoeuV6D+ sAfP7ShlHqhWzc9f7W5AY0apAYf6r4r2xqTKGFbqf1nz6ox4FHbVzkc/b22zl7GEqd5CSM JfWjOWrY68Z/xXUDEb31s7iwISkAucIT1ucDVdrkGEU+HKWN/uzB2boUr4tceiSrsn/pUn E3xXJyiVBvGTnYL3+SalMsZURAebr4v40IpQqrKJcF5Yy4bFGIrSwTmX9ZjJ8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706662925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mkU09zrNbpgwImCggiweT+CZ4BbKqd/xgosrsyjc9BA=; b=KgjBlUJvSZ8RAS6jogUoFtsOVmaWcoRJNWjyH5/rI1uxpp4exrAZNtc2By5FEj0ruiXnYA 9YBEL6bS677lJu2WWsO6qXzEqW6Smyp/sRaZIgD1bh3S2fi0KHZ/hvtJJL9odMepRCOF4Q pHnga9cUG81h27pEKB6kaQyIuZk1v5J5vkmUkhfmMmdszds3wMF6PvoTo5A4rCviPLLZ3o JrlHr7Mxaca1uqXGS4pibP7XGVnQemnpunNAv0MhOK+iGGpeZJBhZ4Qym1nzZe9U+Eol2U EDaCGrVnc45gtqwJT3o5wWvbAbBCHz/5sDuMdr7fhSNFwNV8NHDtvOuzgKehCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706662925; a=rsa-sha256; cv=none; b=tz4/t0NWlUHx70LucEgc12iVTws3e+UfXjRdp83Rbmy1l2mR/v6C0Cpz8qrVzF94Dr376A SOxDc1CBfB+VUAEA0jn7jbGf1HmdvD9IZmEBAGqn/BedN9M2BA+z2EVj2fBtIITOKLOMkG eE2YXSvdsR4+Obxt7LAE9o1Lse9LXiv0I2QGI3K6Nx9KbR6r7VKpQXoRRj2XzjcirsaFMv sT1npZAm9Y0Y2L6OSW0pLHq2sgqrX9GNkP/6plV5Ksa8Q+U51tSTZexMlUwem2fp5g7r7e mjNP/lLwhuxArOiauitHeqN3NRKccIpv1sPCeQ5ZSB7URPGaH4iw1tXN9K5MIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPkJr75F0zy6f; Wed, 31 Jan 2024 01:02: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 40V124il096840; Wed, 31 Jan 2024 01:02:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40V124se096837; Wed, 31 Jan 2024 01:02:04 GMT (envelope-from git) Date: Wed, 31 Jan 2024 01:02:04 GMT Message-Id: <202401310102.40V124se096837@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: a93ef23ecac0 - stable/13 - kern_openat(): minor style fixes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a93ef23ecac0aaea2044029aa9b5b0d28c17a65c Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a93ef23ecac0aaea2044029aa9b5b0d28c17a65c commit a93ef23ecac0aaea2044029aa9b5b0d28c17a65c Author: Konstantin Belousov AuthorDate: 2024-01-20 21:42:39 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-30 20:24:33 +0000 kern_openat(): minor style fixes (cherry picked from commit 3d59b93b207e5008ea0b79b38268243abf225546) --- sys/kern/vfs_syscalls.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 3c45610a8853..494bae687406 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1107,16 +1107,18 @@ int kern_openat(struct thread *td, int dirfd, const char *path, enum uio_seg pathseg, int flags, int mode) { - struct proc *p = td->td_proc; + struct proc *p; struct filedesc *fdp; struct pwddesc *pdp; struct file *fp; struct vnode *vp; + struct filecaps *fcaps; struct nameidata nd; cap_rights_t rights; int cmode, error, indx; indx = -1; + p = td->td_proc; fdp = p->p_fd; pdp = p->p_pd; @@ -1222,8 +1224,6 @@ success: * If we haven't already installed the FD (for dupfdopen), do so now. */ if (indx == -1) { - struct filecaps *fcaps; - #ifdef CAPABILITIES if ((nd.ni_resflags & NIRES_STRICTREL) != 0) fcaps = &nd.ni_filecaps; From nobody Wed Jan 31 01:02:06 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPkJt2vDBz582R2; Wed, 31 Jan 2024 01:02: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 4TPkJt1gNvz4Cdg; Wed, 31 Jan 2024 01:02:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706662926; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OqoMl7nS3vClPm2qBmgTsPQW5wTdrMUY0R15uC15C6I=; b=W0/0XYyy+ziMzug6/4QFvC4AsyMKfSeZWITlTxueUJ9cJPMUfHlM2q4fwlqvuFXYCiO+nI 5mamjIFaYeeVYnHDtZNZfYmQoERw2cuviYRi3FhWcp0mXh22gnxtWlemeStQBG5Ss+0zrF FW9iAwIswqxd4DpcpLLQBKJV5Tfcgy4EtNymXqeiHlZDpmV1HQ4i4Ry6r2PxVhyfhUogIN SuaCiAqJiOboNF9QFXsSfu2tdMnBYkfqYr5vaN/VRddUpOfg2vxZKK+u2xJXXA1KyiUFcy 5vPcXbX1b73unQBnYQu+TswIcM16ApRnMooPv6nMA6kThN0u0ipra5wDpPmvoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706662926; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OqoMl7nS3vClPm2qBmgTsPQW5wTdrMUY0R15uC15C6I=; b=lt4nIgO+IgDygtFdjObT9zLHY/w/zk5/xo2RKvLfDD9roNqB8oEfTN3a9tqjroTzuOmqBg /epDDcxsFCn+PB5NhqnAcrXvpjZ3PtqDkasSmf4fiL6zMEU+eSQ403LcJm+L1hpP3IVCcn JxUSqifbjJ/GRghQiJT8zMJNZ5Qo1gfsWHC+eT/4O4CbCXLOQH/t/sGWvu5bBu7ztlUPX6 EoQBKNTVROhKN3hv79ZpmDbQmRD3VwhO2LRCWesRXab/uwZJo+qQV8qkkMNLtqXG2L8KDZ ZfnE+dpEZEXWGHikCzbmfF96WXUj+loxyLm/EwI0Ov5lUwUDXc6wbBhWuR/hiA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706662926; a=rsa-sha256; cv=none; b=jKgqricAyCY5WKOi6h/04eqop8QqEm5gmn5J5zkmRoL5NgA59SlCREOsY/IMGqY2QlQn6A 0w2vDFo5SegZOBIF3b1RqmYOw2eLU0E8POvu/00jdbFg45B2/StKTxb2XmV5z0pOlpA+cd v5l7C90Wf/1yYBEQHa32pjneSTbk51NXLP+d2mLQvelAmTMDTS6yrUMOAldlXl69A5+YrY B2U9y5yScpROde5sRJ6MLj6E9QsjNlkwuzK9bk8QnF/8CNpWl3pW6gXUGmpqV+z727tu2A YgIhWZQV/e1movcFVeOBicqOS7YlrXtQp2rEyHLi4+Ox3kJkqDTHUb6uf+8SXQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPkJt0k3NzyTH; Wed, 31 Jan 2024 01:02: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 40V126xx096879; Wed, 31 Jan 2024 01:02:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40V126UM096876; Wed, 31 Jan 2024 01:02:06 GMT (envelope-from git) Date: Wed, 31 Jan 2024 01:02:06 GMT Message-Id: <202401310102.40V126UM096876@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: ca39124ff3bb - stable/13 - Add kern_openatfp(9) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ca39124ff3bbebc34a62f36b4a231976e2de9f10 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ca39124ff3bbebc34a62f36b4a231976e2de9f10 commit ca39124ff3bbebc34a62f36b4a231976e2de9f10 Author: Konstantin Belousov AuthorDate: 2024-01-20 20:34:46 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-30 20:24:33 +0000 Add kern_openatfp(9) (cherry picked from commit c662306e19ce60d0f5e5e32a22ddcd5c79a90849) --- sys/kern/vfs_syscalls.c | 39 ++++++++++++++++++++++++++++++++++++--- sys/sys/syscallsubr.h | 2 ++ 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 494bae687406..7dcdaa66adb8 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1103,9 +1103,14 @@ sys_openat(struct thread *td, struct openat_args *uap) uap->mode)); } -int -kern_openat(struct thread *td, int dirfd, const char *path, - enum uio_seg pathseg, int flags, int mode) +/* + * If fpp != NULL, opened file is not installed into the file + * descriptor table, instead it is returned in *fpp. This is + * incompatible with fdopen(), in which case we return EINVAL. + */ +static int +openatfp(struct thread *td, int dirfd, const char *path, + enum uio_seg pathseg, int flags, int mode, struct file **fpp) { struct proc *p; struct filedesc *fdp; @@ -1179,6 +1184,7 @@ kern_openat(struct thread *td, int dirfd, const char *path, if ((nd.ni_resflags & NIRES_STRICTREL) == 0 && (error == ENODEV || error == ENXIO) && td->td_dupfd >= 0) { + MPASS(fpp == NULL); error = dupfdopen(td, fdp, td->td_dupfd, flags, error, &indx); if (error == 0) @@ -1220,6 +1226,13 @@ kern_openat(struct thread *td, int dirfd, const char *path, goto bad; } success: + if (fpp != NULL) { + MPASS(error == 0); + NDFREE_IOCTLCAPS(&nd); + *fpp = fp; + return (0); + } + /* * If we haven't already installed the FD (for dupfdopen), do so now. */ @@ -1249,6 +1262,26 @@ bad: return (error); } +int +kern_openat(struct thread *td, int dirfd, const char *path, + enum uio_seg pathseg, int flags, int mode) +{ + return (openatfp(td, dirfd, path, pathseg, flags, mode, NULL)); +} + +int +kern_openatfp(struct thread *td, int dirfd, const char *path, + enum uio_seg pathseg, int flags, int mode, struct file **fpp) +{ + int error, old_dupfd; + + old_dupfd = td->td_dupfd; + td->td_dupfd = -1; + error = openatfp(td, dirfd, path, pathseg, flags, mode, fpp); + td->td_dupfd = old_dupfd; + return (error); +} + #ifdef COMPAT_43 /* * Create a file. diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h index 02e5b1a4c077..77c16d8fffc0 100644 --- a/sys/sys/syscallsubr.h +++ b/sys/sys/syscallsubr.h @@ -230,6 +230,8 @@ int kern_ogetdirentries(struct thread *td, struct ogetdirentries_args *uap, long *ploff); int kern_openat(struct thread *td, int dirfd, const char *path, enum uio_seg pathseg, int flags, int mode); +int kern_openatfp(struct thread *td, int dirfd, const char *path, + enum uio_seg pathseg, int flags, int mode, struct file **fpp); int kern_pathconf(struct thread *td, const char *path, enum uio_seg pathseg, int name, u_long flags, long *valuep); int kern_pipe(struct thread *td, int fildes[2], int flags, From nobody Wed Jan 31 01:02:07 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPkJv5Trjz582P6; Wed, 31 Jan 2024 01:02: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 4TPkJv2sMDz4ChG; Wed, 31 Jan 2024 01:02:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706662927; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ELIsYewQIJMy/jof5iELGpN/VtWuxH4vVDhy+DrK6MA=; b=iEDPVW1ukoDR+RkJZ5zaEwB4Bm0FP8ojijkK9/6dT1nkfOyMjSq5v7K58V29B4kT5bm4a4 Hf/Asm5ykZpl2YW+GWJy++qJVwCPk9R8sXM0CzOjgOTWdG1Rm4QFbCu2EZfqarBvB7Ciz9 EeNibK8uLtuLIJ0m50Z4Bt5mpJCq62o46yWmc7WWzR71yo6QUiMSwWoFQPOqhRAuTA4Z/L 9aEU7ZLDR2XewYKiTCLtR9FiBGiapBsZBzVhkaMddNtV59tIqbVfOfTkXDxmPEhF3NytAs zm5dMQ/BEGHeH9IjG3T+7TKzNzXNXhT3na+oLm/6jHTvzIEciS6lJ3vZBnQK9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706662927; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ELIsYewQIJMy/jof5iELGpN/VtWuxH4vVDhy+DrK6MA=; b=YeXO8o34MWU7GRZ3nGE0agN1p9u8PTkpMbnpruVv+hIXQ8mKVhL5LVdwLKeGT7idlEHOca icvNeRfhCbgVmV4bjvsyBrkIOfko0GGLIXq/z6bH6e2u35Bu0bo89TSyefpRcWN2y9U5xp druLovgZjgY9MIIYjl33FxmJpzybuo7QcaOWIRL9LvDTks7FQj6G4/dbGyGG+317myX1zM KPVxpifcvWv39NukQkCMsSvLhWCdNaXLsC/7QJPNPKbQlY7u8WTDHk6w23EUp7n44lKoIq j3o7b2nPIhPlvvAz2FZUQStPQ7sYtsA25+MG+l/anZUT+ZM8IaUUYyiu7KCoUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706662927; a=rsa-sha256; cv=none; b=uIQlOdh0Vg7YYiDfLKp/X/X/a++cs2XUZfnXHeapXh/ABhVMPFghyQ7b+slbtdsUo+TxPr m9f6VGVXT8DwELibXv6KEhnfMc2L5+FpRs8Jm6+gYflODmu/3qD/NOd8hnErIWl3xxhAoY ioaRGQE9atuOSUiymrN2Stpm2WSrkvKlBotB59ty+XFDlloXb67ggm5j2ILEXUf2tOgHEN 1HMMxlFEccj2FUOGNFUAReg6rbMLKMJmnXtv2ZOI1qFntbfR2cGJdUmTDzSSy03NEL1+DR /uDvP/E9+gsTB5dfqRJ0AK35/vPAwHAT9WS1XZydA1C7dARLpWVtTKEPfiePRA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPkJv1zq7zy1Z; Wed, 31 Jan 2024 01:02: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 40V1277m096922; Wed, 31 Jan 2024 01:02:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40V1276i096919; Wed, 31 Jan 2024 01:02:07 GMT (envelope-from git) Date: Wed, 31 Jan 2024 01:02:07 GMT Message-Id: <202401310102.40V1276i096919@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: 1b70e4f53bde - stable/13 - stable/13: bump __FreeBSD_version for kern_openatfp(9) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1b70e4f53bde13988c1b0cf8014484d00d062440 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1b70e4f53bde13988c1b0cf8014484d00d062440 commit 1b70e4f53bde13988c1b0cf8014484d00d062440 Author: Konstantin Belousov AuthorDate: 2024-01-31 00:49:54 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-31 00:50:37 +0000 stable/13: bump __FreeBSD_version for kern_openatfp(9) Sponsored by: The FreeBSD Foundation --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index bf8697633d18..d5f5992c4a47 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -59,7 +59,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1302511 /* Master, propagated to newvers */ +#define __FreeBSD_version 1302512 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Wed Jan 31 07:14:54 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPtb22Lv2z58dTr; Wed, 31 Jan 2024 07:14: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 4TPtb21sY9z4rnC; Wed, 31 Jan 2024 07:14:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706685294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uzWYFHbZdfVUySUu6y8CRXr2daDxRkFkzqCkAMqFYYE=; b=gMmCwVzR+YmnbpN31VjAd5NUfXCtRbB4gmAzdrZ1JhrQjHKLcRsaByjUtoVb2RJXIJjxRs YQkGue43UghTZis7HMwQgnaP2UVOZIBQTv1XJzxgbVrALLYnbov7Ix85NsNOjwo5Yiw6B8 nZMqTQco97rmXIO+ZdxEQnkMjnNc1ruWt7miCEpLWRAc3zhw/n3O0yfpnBMAVtvVfWKTXi YX+GLyVXMSihxkdDKZKPQSXzuJ+0hi7hDzqCEIM/yLA6SgfRV8/eIsKd5VdZ7Ov+TK5kXe NiEZUsd4FBxZqJurx6Ivl/2Ew6k6R2HUYimu37LAGwBlZeo7tocDgNXOCSBufA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706685294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uzWYFHbZdfVUySUu6y8CRXr2daDxRkFkzqCkAMqFYYE=; b=aoNoQP/xWXKZA7/bJPWL/8BekqYxuLTpE3YS+IhN+JC65nxnwSIqiFicsv+ck4QuficCSJ /CeQtlqdzCM5UyAMXD4VZCLYBWkBZq+NxgIx8aISqKG4EfTD+RwY8jG77hc6eyEGI7/NUB 5DWtvtcBjCkuQ09IzbzyknY79/ANrIukdecqnq34cM4GlwjRt99DQutg1E92ZjnWstTNtV zx5smw8mCHCm49W34FGAo47DxUrHblK2j9YS0iuCxAAnlJWNf+jVfaYQAadz2CyTkOsLSu +HlW9GP4L2NO+WapopnIJBDjA8Ln77SBbpPFwEft0fiGYs06ZBFrdNBsM6a91w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706685294; a=rsa-sha256; cv=none; b=mrYwv32O6C348hfOzI8PGvlfOxmIjJPaUNyKrWbhpq4v585wSVC6zA17Df51rcuXQVbKv6 x8QLmrC4GJJr7N/v8kieTW4WtVNUAHWAS4LBjDm7TgXTvasl/jWoeuSxHAuu7FAJcKEr7U sWqJuNXrLG8qs8SVqZOnxYStRjgHqIUM7C3eQdv/SesQFRZ6JBTiHUp73rvMU8tLzBNEoR bZ51ZBbTHkNZBXi0Ga0anvUfVlKEZMauQwaXvctlN/JS4A7cVAzaExCg8wezRSJuzdy0FB lgNUU0NDf9wUrOvgBc96aj6M/pV5Hl5W8E1e7S2lKw7IWbymfCK7CivG7JVXaQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPtb20wQpz18Wr; Wed, 31 Jan 2024 07:14: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 40V7EsfB020392; Wed, 31 Jan 2024 07:14:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40V7EslA020389; Wed, 31 Jan 2024 07:14:54 GMT (envelope-from git) Date: Wed, 31 Jan 2024 07:14:54 GMT Message-Id: <202401310714.40V7EslA020389@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: c0565e7d34ac - stable/14 - Create namespace for the symbols added during 15-CURRENT cycle List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: c0565e7d34ac248bf3c20c66f341a64a6e33d6d9 Auto-Submitted: auto-generated The branch stable/14 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=c0565e7d34ac248bf3c20c66f341a64a6e33d6d9 commit c0565e7d34ac248bf3c20c66f341a64a6e33d6d9 Author: Yuri Pankov AuthorDate: 2023-09-22 07:57:35 +0000 Commit: Kyle Evans CommitDate: 2024-01-31 07:14:38 +0000 Create namespace for the symbols added during 15-CURRENT cycle Reviewed by: kib (cherry picked from commit 95a4709b2cca726c6b76c6743ba2d665c1730666) --- lib/libc/Versions.def | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/libc/Versions.def b/lib/libc/Versions.def index a605378654a4..184e107d225a 100644 --- a/lib/libc/Versions.def +++ b/lib/libc/Versions.def @@ -38,6 +38,10 @@ FBSD_1.6 { FBSD_1.7 { } FBSD_1.6; +# This version was first added to 15.0-current. +FBSD_1.8 { +} FBSD_1.7; + # This is our private namespace. Any global interfaces that are # strictly for use only by other FreeBSD applications and libraries # are listed here. We use a separate namespace so we can write @@ -45,4 +49,4 @@ FBSD_1.7 { # # Please do NOT increment the version of this namespace. FBSDprivate_1.0 { -} FBSD_1.7; +} FBSD_1.8; From nobody Wed Jan 31 08:54:49 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPwpK2Khnz58nWb; Wed, 31 Jan 2024 08:54: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 4TPwpK1pfYz45jX; Wed, 31 Jan 2024 08:54:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706691289; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7t0TIHlYDoLVf1B8dPTH8XP+tq1GcRFxbnM/945wdcE=; b=c1j1oSfOBnNKZLwhfReR5X51zFfzG12Y8MQcuJfV0GxAxAnuwdxJu2TQ/NbHOd+YG9ll2E du+/jU7ojTmXqEiHFG2uqA/hHywOKZp4xp75kqmh5vkMe7POB5kECfUZ0/eVkxbOEAVyqf s/b/89x8M6896QPIANUMosHj4k/6/BKjwwjBwWeSILECYjemoL8pYoc9aW+IKEj7xM5/NK pBnLC94xnphtArET0FUtVLthM//786G+sCEcUClYAlT9VLkHE6ENvOkdwGSP4dS61xrxAy bh+o5v3lWjo+Z1AKMBZvIl1tz4EJshX84Ngwq1oHu2AhssUSRfH3yxMdPCf12A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706691289; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7t0TIHlYDoLVf1B8dPTH8XP+tq1GcRFxbnM/945wdcE=; b=XCTNzDM3isgfZwyWwkUWGfZjrRGzsblKImf3tdcD0gst6DsJzBOb+KVODdQELKkzU9cOwZ r/2i3taPQy96eFUzGSwon/o+M2nX6Ja9IGiYaYmYGzWQ5TkKc55nRnbi35WGyZP7unkPDT CuUc5j3Dmo8Az4JNxg6fQ9QdabuaQupRMVzOQcryTX9Gdd1bA8XFzxiTm1cKDUPqA4K0GG SYclQuTOSSgBdg9BoZYtalMBN0dTNea9H+mLI6+lm0wEKqN6hR55l1HhfpwhsB9MfqTSxA 8WuwvNAmKp9JtJDlVzPu7r+YYy7XKnwvBD4u+CIuOawef5Qfs9rBpCjMw5eI/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706691289; a=rsa-sha256; cv=none; b=rfckz9OPI79nwgM8dWifmIp9t4NSrlGIo5uEPlEQKiqebpkhPfbpRRFoLwxo9ADRPWQBIe fOI6aogMbjjTwVPy7QW4obswxc1UEVusqKxx0XWNlSgMvNa1FifJbj1jTVq9j97Dq82zNn TCe7IR3R1ug22oBD9ZkCyqTCIdhBHEmO7bazEsrCbOSh1c4C0U5S2QAQoGwM5S368t9fYm hi6USr2MzaFZVFIQJjuAulKAs2nPAz0TsSkIPTAyEOWfSOwlyz0RTZJ7fDE92ABuYj9umh 4zTgycmMksx2LgF82M+JsyzLN+kzAdyWrp4DF8YSlXBBMxjO6C1y93bYDoZBww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPwpK0t50z1Bnl; Wed, 31 Jan 2024 08:54: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 40V8snaK087197; Wed, 31 Jan 2024 08:54:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40V8snKx087194; Wed, 31 Jan 2024 08:54:49 GMT (envelope-from git) Date: Wed, 31 Jan 2024 08:54:49 GMT Message-Id: <202401310854.40V8snKx087194@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Tijl Coosemans Subject: git: aaefd6898a73 - stable/14 - join(1): Fix ordering in case of missing fields List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tijl X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: aaefd6898a73528d3888331a51983cbcc9f06125 Auto-Submitted: auto-generated The branch stable/14 has been updated by tijl: URL: https://cgit.FreeBSD.org/src/commit/?id=aaefd6898a73528d3888331a51983cbcc9f06125 commit aaefd6898a73528d3888331a51983cbcc9f06125 Author: Tijl Coosemans AuthorDate: 2024-01-22 10:35:31 +0000 Commit: Tijl Coosemans CommitDate: 2024-01-31 08:53:11 +0000 join(1): Fix ordering in case of missing fields The comparison function had the ordering reversed causing join(1) to miss some matching lines. PR: 232405 Submitted by: Martijn van Duren (cherry picked from commit 95bf75895ddcf17402b1f69dce26cb821c922476) --- usr.bin/join/join.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/join/join.c b/usr.bin/join/join.c index b9e708dd98cd..eab0dbcac900 100644 --- a/usr.bin/join/join.c +++ b/usr.bin/join/join.c @@ -392,9 +392,9 @@ static int cmp(LINE *lp1, u_long fieldno1, LINE *lp2, u_long fieldno2) { if (lp1->fieldcnt <= fieldno1) - return (lp2->fieldcnt <= fieldno2 ? 0 : 1); + return (lp2->fieldcnt <= fieldno2 ? 0 : -1); if (lp2->fieldcnt <= fieldno2) - return (-1); + return (1); return (mbscoll(lp1->fields[fieldno1], lp2->fields[fieldno2])); } From nobody Wed Jan 31 09:20:03 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPxMS247Zz57M9m; Wed, 31 Jan 2024 09:20: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 4TPxMS1WDjz47tV; Wed, 31 Jan 2024 09:20:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706692804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W6P0o4fSH3L7antwhm6YY3qxeE5BXRkUU0/ySytLG3o=; b=N3ET0WUTKKMICHlhRGNElsmAHSTTQM1PfFbiq9pSVfNeN/AaDkOmkgGIzKoDbIEMDNhnhk GYv9OVL2nqMdgXC1pdqXkN4/xAy4GQOWu6NyVYnenYtYqds3k00a8SOMIgxke8X8gX0kK+ l4FVRWgkz/2oaLGXaqkHqb/S50bL4Ka4lAUi3k+V54f6Nr6c0oF3Yk2aiCVnlz94V6HDvi Drizp+yymdyPgj3u0s7+vJYAR/CN3mN5lRoed4ByyoWqaBHpLnzDtbCD7P/tbJZhiGdn0K 3w+jii9hXnP8Be4kAfX3sN5Uv2cHAhJjApjR9hcmCSxaVMt4zK8/gEQDX5IhSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706692804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W6P0o4fSH3L7antwhm6YY3qxeE5BXRkUU0/ySytLG3o=; b=BUBzdVdmaXHCJAQ0z8gheQXP1oc012ba99P1WTggoxIZCARhiWQj5otDdgOCzczc6hNNqm iXGyS4nPz5LtzYVmuav1l27CZ9QhvqLMwVEvCNIsQdqnpzi1pKXy7R8TDz9OBoVCYVps74 LNKNZB2LwSYS8tFnJi6d0Btj3I2knZBxJ9kGo52kyTu6dtgo1vTwDXXa/aBijpZe4XNtFR Dw1aEYFTPHWevQbgPLi3IMxxbWb3QJwmZQZpFyn41ULVy0VFdwogL6c05Ro988YcqbqKd/ esfodBhqmB6hIeLt8G6Nsr47X6eanSDiB/pCK/ZiBXkrS//wrBwic4HQ33vUfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706692804; a=rsa-sha256; cv=none; b=rEFC1gzsGqSLWfAyrhHVOCi6FPteYhBljj9MezNmmOlT7ptzqAp5V1+OysPq0+lYir9g81 9/PkWbgyp3ufvC+rJ/H7F0IRRKzzc07BHz6gedhkMi6E4KL4Y/X27xpYnFUlxZU04mjALz pREVUKLOLlR/ZtSBampqSRH9+KBWMIBxVtqvJYynxG0XhwhRcXKNnQ7eb3k6FZCn+p0JCm Taj4BYfjVwqWYBjlS0iuQZq0/7D3WiOhFYN65LFBxT53gHRL8Q4a06yWLnH1VxNbRJ8vdv mOhonLjahACMMrPK2TmLzkEzcFaEotgJyAlhjFa2h7+NIBAbQXBhgBGuhhIp7Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPxMS0SkTz1C1q; Wed, 31 Jan 2024 09:20: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 40V9K3KM025158; Wed, 31 Jan 2024 09:20:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40V9K3Kw025153; Wed, 31 Jan 2024 09:20:03 GMT (envelope-from git) Date: Wed, 31 Jan 2024 09:20:03 GMT Message-Id: <202401310920.40V9K3Kw025153@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Tijl Coosemans Subject: git: 085ab2c143eb - stable/13 - join(1): Fix ordering in case of missing fields List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tijl X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 085ab2c143eb5192ea18b8dd52bd8fa69c9f2d06 Auto-Submitted: auto-generated The branch stable/13 has been updated by tijl: URL: https://cgit.FreeBSD.org/src/commit/?id=085ab2c143eb5192ea18b8dd52bd8fa69c9f2d06 commit 085ab2c143eb5192ea18b8dd52bd8fa69c9f2d06 Author: Tijl Coosemans AuthorDate: 2024-01-22 10:35:31 +0000 Commit: Tijl Coosemans CommitDate: 2024-01-31 09:19:00 +0000 join(1): Fix ordering in case of missing fields The comparison function had the ordering reversed causing join(1) to miss some matching lines. PR: 232405 Submitted by: Martijn van Duren (cherry picked from commit 95bf75895ddcf17402b1f69dce26cb821c922476) --- usr.bin/join/join.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/join/join.c b/usr.bin/join/join.c index 35b327c89ee4..c4bd42728fa7 100644 --- a/usr.bin/join/join.c +++ b/usr.bin/join/join.c @@ -392,9 +392,9 @@ static int cmp(LINE *lp1, u_long fieldno1, LINE *lp2, u_long fieldno2) { if (lp1->fieldcnt <= fieldno1) - return (lp2->fieldcnt <= fieldno2 ? 0 : 1); + return (lp2->fieldcnt <= fieldno2 ? 0 : -1); if (lp2->fieldcnt <= fieldno2) - return (-1); + return (1); return (mbscoll(lp1->fields[fieldno1], lp2->fields[fieldno2])); } From nobody Wed Jan 31 14:29:15 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQ4DD23CZz58dSb; Wed, 31 Jan 2024 14:29: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 4TQ4DD1Ww8z4rhw; Wed, 31 Jan 2024 14:29:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706711356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s61VgGTSMDrMvjFw8Zh0y1srMFgxEDW1UPIs2uXizyA=; b=AEqENDJQpC76vF+q/eg7DS8E4BX+1RCw3wDs0BY4x3wPICef8P9qGF0mMUnzo7t8ry4nt1 xbT2mzHTxYIfN0Kcr4TC0Hmw8r3P+E0GVMHur+Y9kD597qjEUVvz6rMpKeaeMnx8lJqLYF bHkKgfgFv9J3J81zHeQfh+Wm7SqOHSrQtMTYht4ddNbFYoXELVGCCavxAqLaqKRIlGGaP1 qRmv2Sy/eSNyVZvDSWstyWCTtWtDGhKJli7He+9zMe/2w/hiD7fe+HaoVir/fT2fIlHg59 DLescDygoiVZn1OYTfWJD7nuBBLuzs+cAOvxAQkBeJhAozM3v32uLCLgNq3mfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706711356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s61VgGTSMDrMvjFw8Zh0y1srMFgxEDW1UPIs2uXizyA=; b=b/7kfZjf1+OxZiFseoD+MxRlxsA1HYfFb5t8xXIykBvKeCNvSe8RFKUkApYk8b1UtgDP/S 3iFqAvE7IcalJBkLSPbDqOkOvBcM55Fd+6YxSIpcw+73vcXLCNcijPmCOKxdc7C4eHAPW1 pma0NDwVBQ0Lil23blXKQ3rjVetkqYH9v/PmyphzUAAwXhEcioFxJDGnQEX7gvFKvBfi5H 8cZUHbPQoTzds73o2SV3EAV3wBm2Zpg0XIyTlujBsepiprWNbL7HvXTccMQL4EooyKEDZt OxpA1pwaRLNAgX72H7AjVwOGywTc0NtiJG145TCqUGcPP+kgJ5PNJD409vVqPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706711356; a=rsa-sha256; cv=none; b=FRgFZLRXwEH96z2nCW8m5K157kiVmhmspYvXR28Oic6WB/hjsXBSZvREUzX64ZI8mHlSck Rv6zSSeyrfJ0p5ItSKuRDnY7lYlTbYxOJdcVGQnWNSIy/UxASStuvIBy2A4z9DC64G1Lgl Bq6RTbiSRoc5FzTHAAmdxSDayutk3wMiipkUKniSw3YOnUvBR/DNIazOT8vp35sS0R9JKD kCznCiX8vKZD4oCOF7JenaPHV8ig1Y585RC0zPYRPOsqRvmb6sS0lRatYgfFk8J0HZZfmg uvUC9Pjbi9ZeowoayJgzW/GD+mArEDopQiR08DXj1G0CoaDNQ1dwSrHYfcU3Uw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQ4DD0bYMzM4D; Wed, 31 Jan 2024 14:29: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 40VETFqq042393; Wed, 31 Jan 2024 14:29:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40VETFHK042390; Wed, 31 Jan 2024 14:29:15 GMT (envelope-from git) Date: Wed, 31 Jan 2024 14:29:15 GMT Message-Id: <202401311429.40VETFHK042390@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: da2bb86507b7 - stable/13 - mpsutil: Clean up libutil deps List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: da2bb86507b78b6c58e49c85db25fb4be1c3f4b5 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=da2bb86507b78b6c58e49c85db25fb4be1c3f4b5 commit da2bb86507b78b6c58e49c85db25fb4be1c3f4b5 Author: Mark Johnston AuthorDate: 2024-01-24 19:47:56 +0000 Commit: Mark Johnston CommitDate: 2024-01-31 14:17:25 +0000 mpsutil: Clean up libutil deps mpsutil doesn't use libutil, so doesn't need to include libutil.h. See commit 76103694a051335bec1da318f9c6e3a676dc0145. No functional change intended. MFC after: 1 week (cherry picked from commit d56ce5915c41517ccc7de2510daec200e100ef68) --- usr.sbin/mpsutil/Makefile | 4 ---- usr.sbin/mpsutil/mps_debug.c | 1 - usr.sbin/mpsutil/mps_set.c | 1 - usr.sbin/mpsutil/mps_show.c | 1 - 4 files changed, 7 deletions(-) diff --git a/usr.sbin/mpsutil/Makefile b/usr.sbin/mpsutil/Makefile index a19c2f310167..aa59d8cddf76 100644 --- a/usr.sbin/mpsutil/Makefile +++ b/usr.sbin/mpsutil/Makefile @@ -1,17 +1,13 @@ - PROG= mpsutil SRCS= mps_cmd.c mps_debug.c mps_flash.c mps_set.c mps_show.c mps_slot.c mpsutil.c MAN= mpsutil.8 WARNS?= 3 -#LIBADD= cam util LINKS= ${BINDIR}/mpsutil ${BINDIR}/mprutil MLINKS= mpsutil.8 mprutil.8 CFLAGS+= -I${SRCTOP}/sys -I. -DUSE_MPT_IOCTLS -# Avoid dirdep dependency on libutil -CFLAGS+= -I${SRCTOP}/lib/libutil # Here be dragons .ifdef DEBUG diff --git a/usr.sbin/mpsutil/mps_debug.c b/usr.sbin/mpsutil/mps_debug.c index a3297b4176cd..7fabd41ab00b 100644 --- a/usr.sbin/mpsutil/mps_debug.c +++ b/usr.sbin/mpsutil/mps_debug.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include diff --git a/usr.sbin/mpsutil/mps_set.c b/usr.sbin/mpsutil/mps_set.c index b75f327cb993..8dd42a0acb41 100644 --- a/usr.sbin/mpsutil/mps_set.c +++ b/usr.sbin/mpsutil/mps_set.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include diff --git a/usr.sbin/mpsutil/mps_show.c b/usr.sbin/mpsutil/mps_show.c index 6efa9b76dd3d..15c88f72ad0b 100644 --- a/usr.sbin/mpsutil/mps_show.c +++ b/usr.sbin/mpsutil/mps_show.c @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include From nobody Wed Jan 31 14:29:25 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQ4DP3rtWz58dHD; Wed, 31 Jan 2024 14:29: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 4TQ4DP3MzHz4rkr; Wed, 31 Jan 2024 14:29:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706711365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y2tuCG/Ehlcm+3woNsBMHwABUZc6JUFVCiy7Sqik02Y=; b=Dk1J08knXuSTK6fQjg6P8n9+mChFeTZytuXxACK1aP2LYDquuFMIUSUZ+iBcDwy9h4V+yf gPPiFvdmfknJevzEZDzru0mQyZLNYDv3Me+QoCq98jWe03nmvkmpfqC3BuZCATWHF/SJAF QoE5s6I5TRg/w20HwYfHuB63HYQckcaKrBmt5c4wCcDeDFrpQAYRWTGSJMcoDVHSB9S7rK G3+e2pK2cM7k6D4D09nOu7LXhbF4j0cmbzbcm0KH0qTb9yyAu0Uw1W+EJeO7/Je/nOsqwD pFAUjIbk19z3dtKiKCf2HpowO1AXSXlDIoMVZA4B8FnlS2iAgUwLAKAEoMxsKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706711365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y2tuCG/Ehlcm+3woNsBMHwABUZc6JUFVCiy7Sqik02Y=; b=lTIvyS1tIPwUvfhdr4UEDBxHoQRy7R8Ojx586CD+OarnmR9h2JMyquZqt7MoRyXn+5foaD k0Zz5cXi09T0FSWJImQi0XyuK3xJC/Ggj2q1/VXQ/+BPngCc8MahsgPQ/nJ2tCPXZpNXmr EjEGQ9mBxwwVOlOhwDAT+lKmqhWOJMg9onVnI30TGmhLgPo/APxrutFec+ehbRuFxcpQj0 PckcrTr8dvPaP8JpKEtS9yZmtMlbmAoWeSfqvlQYYW3t2O4TF3c+IiKKex7X1arZ9lN99C tjzSeLMA8BlcLvkjJAjnc8yt64WnLvRMxeRNkS179iqv5d/3Jgxxz/wxEPZ6ZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706711365; a=rsa-sha256; cv=none; b=NDiOPcxdjLi5f7WQgJOzdkjCaSiHM1PwpzZzuTID1aG29G/SJbVzo/syVpPoEJVR7yOm45 s78GpW8yVUxY3vdL7VORnRfmEDHT88r5yRxMrI2n99Siwna071lzmL7n8AsnA+axYmZRoq dSVGjUac2W8Dd0MsTfKDsD1kzStyDCsZJ/7eu5Pf5NGM8iDv0Lzx2V+LHg+mELYR9zpDQj eVRBelHzjg5jdMMs+n+TYDL0mu72QGpGrjYurFOLmmR3G3flIo0irbuvbKM07T4gmGiy1o 8EUGg5lY9G7Qc+sgzOCxmixlsNR2r8a7mlXUwBZcYO6Jkwo7iUgWaSwE1qZCsg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQ4DP2RqxzM4F; Wed, 31 Jan 2024 14:29: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 40VETPwn042539; Wed, 31 Jan 2024 14:29:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40VETP08042536; Wed, 31 Jan 2024 14:29:25 GMT (envelope-from git) Date: Wed, 31 Jan 2024 14:29:25 GMT Message-Id: <202401311429.40VETP08042536@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: d2f3bcf90ae0 - stable/14 - mpsutil: Clean up libutil deps List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d2f3bcf90ae09448d690d7c95455da5965dd170d Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d2f3bcf90ae09448d690d7c95455da5965dd170d commit d2f3bcf90ae09448d690d7c95455da5965dd170d Author: Mark Johnston AuthorDate: 2024-01-24 19:47:56 +0000 Commit: Mark Johnston CommitDate: 2024-01-31 14:16:23 +0000 mpsutil: Clean up libutil deps mpsutil doesn't use libutil, so doesn't need to include libutil.h. See commit 76103694a051335bec1da318f9c6e3a676dc0145. No functional change intended. MFC after: 1 week (cherry picked from commit d56ce5915c41517ccc7de2510daec200e100ef68) --- usr.sbin/mpsutil/Makefile | 4 ---- usr.sbin/mpsutil/mps_debug.c | 1 - usr.sbin/mpsutil/mps_set.c | 1 - usr.sbin/mpsutil/mps_show.c | 1 - 4 files changed, 7 deletions(-) diff --git a/usr.sbin/mpsutil/Makefile b/usr.sbin/mpsutil/Makefile index a19c2f310167..aa59d8cddf76 100644 --- a/usr.sbin/mpsutil/Makefile +++ b/usr.sbin/mpsutil/Makefile @@ -1,17 +1,13 @@ - PROG= mpsutil SRCS= mps_cmd.c mps_debug.c mps_flash.c mps_set.c mps_show.c mps_slot.c mpsutil.c MAN= mpsutil.8 WARNS?= 3 -#LIBADD= cam util LINKS= ${BINDIR}/mpsutil ${BINDIR}/mprutil MLINKS= mpsutil.8 mprutil.8 CFLAGS+= -I${SRCTOP}/sys -I. -DUSE_MPT_IOCTLS -# Avoid dirdep dependency on libutil -CFLAGS+= -I${SRCTOP}/lib/libutil # Here be dragons .ifdef DEBUG diff --git a/usr.sbin/mpsutil/mps_debug.c b/usr.sbin/mpsutil/mps_debug.c index a3297b4176cd..7fabd41ab00b 100644 --- a/usr.sbin/mpsutil/mps_debug.c +++ b/usr.sbin/mpsutil/mps_debug.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include diff --git a/usr.sbin/mpsutil/mps_set.c b/usr.sbin/mpsutil/mps_set.c index b75f327cb993..8dd42a0acb41 100644 --- a/usr.sbin/mpsutil/mps_set.c +++ b/usr.sbin/mpsutil/mps_set.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include diff --git a/usr.sbin/mpsutil/mps_show.c b/usr.sbin/mpsutil/mps_show.c index 6efa9b76dd3d..15c88f72ad0b 100644 --- a/usr.sbin/mpsutil/mps_show.c +++ b/usr.sbin/mpsutil/mps_show.c @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include From nobody Wed Jan 31 14:29:26 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQ4DQ538tz58dZZ; Wed, 31 Jan 2024 14:29: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 4TQ4DQ3pGXz4rks; Wed, 31 Jan 2024 14:29:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706711366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9BsmXeczbpIX6HubJxOtWKqGsdi4ikwzc3AqUH5guE4=; b=UzfhfZUO5KOMEyjDJDIa6Vxa2uhiTrIKGQE9Deig14u3bRb9QP7OjPmU6q/q7FAxK0Yk5s SOapufyYsfPwcoBLcTyb3xa4HlHC0cben4HYf1FsRvekai/tHf6byPnZ+Vlc7lOsQl8+zZ /4IgbEFIg5/L///t+nhwTEiZwrPwVdvt7WusTScoOtQNWSQwU/Ot6zDuEuHPtJlK2VZClK 2nHcfganpMDaIpRG0tI+WmRVE0Ll3ygxgeROuJAzEmWBbH7NwE6fSVs+IYXLZWsQgO2l+A rMpVgIk3yxq8c2mHkyzOD3fKqp/J1CbjJZXB0/ToKEY5Lo41JygsG++EKH+l6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706711366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9BsmXeczbpIX6HubJxOtWKqGsdi4ikwzc3AqUH5guE4=; b=Q//ivZPSBVg66wlIf50Unu2E5G/Sqa0GhVDgo8FRxcEcsW8wzY4FmHazwquXRydj2GMxlZ URsx07IIrrAAU+5k66SikiuvnPsq0gFaJAREEICTGB3ALKeNH5n41fwHI4EK6Ka4q1yXdw mQ0I7Iblfd/leBsleSA6Nkev5dSWK7aXMmdk8OoKevznAYDmEBMrrWL7FecJYH6EJQ5FPi WWW1RUmPfsCXCh+2qchMB0eCHgstdzyyvkO7pWOnqQTOZaWPmqbWYQEa9r7qA98ZNhxyMF SFWX+Jtg+p5KNApQqv62w9zcshJo9VJkwP+uSIgwgPF1SS3srq4NGfL9hLbtrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706711366; a=rsa-sha256; cv=none; b=PoEvFhwbXkKgbV1Wcd8jF5xcuYK2gBXVNHs4+QC0e+zsW9XzX02BQ6SZr5aiKnhxAM8ReC WAfeLUlbEcrEpWHmM2Q9R4larnhWNMIWLMxFg7LPfUhgfKswe0iAzKc7DS9oNwauhiKRLW Elxgtdth+3S8BTRL2q5rLDXifklMK98Xh4m4JkNvM3W8b7FU2wSTLz4OL9b+G5VU6WoXy5 gV805E4oNk3D1a4VW1nULvmPJ/5fVWUtYRqsZdFzObUHLlxqdzhCZjITJinkoksoGcj7QV Wu5fBv2wp6ry+ELxLhsAWIVlrTM2/a2YinxWzcr2hEGjFZewrUougZRRZLdFPw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQ4DQ2stjzMN9; Wed, 31 Jan 2024 14:29: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 40VETQNr042581; Wed, 31 Jan 2024 14:29:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40VETQUc042578; Wed, 31 Jan 2024 14:29:26 GMT (envelope-from git) Date: Wed, 31 Jan 2024 14:29:26 GMT Message-Id: <202401311429.40VETQUc042578@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: ea3197e69bf3 - stable/14 - kcmp: Add a manual page List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ea3197e69bf3c232999bd2bdf20cc968e1a361bb Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ea3197e69bf3c232999bd2bdf20cc968e1a361bb commit ea3197e69bf3c232999bd2bdf20cc968e1a361bb Author: Mark Johnston AuthorDate: 2024-01-24 14:41:31 +0000 Commit: Mark Johnston CommitDate: 2024-01-31 14:16:29 +0000 kcmp: Add a manual page Reviewed by: kib, emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D43562 (cherry picked from commit af0d437dd31f71726f7eb5e9aca9fbd374a8277a) --- lib/libc/sys/Makefile.inc | 1 + lib/libc/sys/kcmp.2 | 230 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 231 insertions(+) diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index 13769e5bdf19..76d9300ca8fb 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -219,6 +219,7 @@ MAN+= abort2.2 \ ioctl.2 \ issetugid.2 \ jail.2 \ + kcmp.2 \ kenv.2 \ kill.2 \ kldfind.2 \ diff --git a/lib/libc/sys/kcmp.2 b/lib/libc/sys/kcmp.2 new file mode 100644 index 000000000000..5491e09b918b --- /dev/null +++ b/lib/libc/sys/kcmp.2 @@ -0,0 +1,230 @@ +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2024 The FreeBSD Foundation +.\" +.\" This documentation was written by +.\" Mark Johnston under sponsorship +.\" from the FreeBSD Foundation. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS 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 January 23, 2024 +.Dt KCMP 2 +.Os +.Sh NAME +.Nm kcmp +.Nd compare two kernel objects +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In unistd.h +.Ft int +.Fn kcmp "pid_t pid1" "pid_t pid2" "int type" "uintptr_t idx1" "uintptr_t idx2" +.Sh DESCRIPTION +The +.Nm +system call allows the caller to determine whether the two processes with +PIDs +.Fa pid1 +and +.Fa pid2 +reference the same kernel object. +The +.Fa type +parameter specifies the type of object, and +.Fa idx1 +and +.Fa idx2 +are identifiers which refer to some object in the context of process +.Fa pid1 +and +.Fa pid2 , +respectively. +.Pp +The following values for +.Fa type +may be specified: +.Bl -tag -width KCMP_FILE +.It Dv KCMP_FILE +Compare two file descriptions referred to by file descriptors +.Fa idx1 +and +.Fa idx2 . +They may be equivalent if, for example, one of the descriptors was +created by applying +.Xr dup 2 +to the other descriptor. +.It Dv KCMP_FILEOBJ +Perform a +.Dq deep comparison +of the file descriptions referred to by file descriptors +.Fa idx1 +and +.Fa idx2 . +This tests whether the underlying object referred to by the file descriptions +is the same. +For example, if the same filesystem path is opened twice, the kernel will create +two separate file descriptions to back the two file descriptors, but they will +refer to the same underlying object, a +.Xr vnode 9 . +When compared using the +.Dv KCMP_FILE +type, these descriptors will be different, but using the +.Dv KCMP_FILEOBJ +type, they will be equal (assuming that the path was not unlinked in between +the two opens). +.It Dv KCMP_FILES +Determine whether the two processes share the same file descriptor table. +This will be the case if one of the processes was created by +.Xr rfork 2 +without specifying the +.Dv RFFDG +flag. +The +.Fa idx1 +and +.Fa idx2 +parameters are ignored. +.It Dv KCMP_SIGHAND +Determine whether the two processes share the same signal handler table. +This will be the case if one of the processes was created using the +.Dv RFSIGSHARE +flag to +.Xr rfork 2 . +The +.Fa idx1 +and +.Fa idx2 +parameters are ignored. +.It Dv KCMP_VM +Determine whether the two processes share a virtual memory address space. +This may be the case if one of the processes created the other using +.Xr vfork 2 +or +.Xr rfork 2 +with the +.Dv RFMEM +flag. +The +.Fa idx1 +and +.Fa idx2 +parameters are ignored. +.El +The caller of +.Nm +must have permission to debug both processes, otherwise the system call +will fail. +.Sh RETURN VALUES +If +.Fa idx1 +and +.Fa idx2 +refer to the same object, +.Nm +returns 0. +If the object referred to by +.Fa pid1 +and +.Fa idx1 +is less or greater than the object referred to by +.Fa pid2 +and +.Fa idx2 , +.Nm +returns the values 1 and 2, respectively. +The order is defined internally by the kernel and is stable until the system +reboots. +If the two objects cannot be compared for some reason, +.Nm +returns 3. +For example, if +.Fa type +is +.Dv KCMP_FILEOBJ +and +.Fa idx1 +and +.Fa idx2 +are different descriptor types, e.g., a socket and a file, then +.Nm +will return 3. +.Pp +If an error occurs, the value -1 is returned and the global variable +.Va errno +is set to indicate the error. +.Sh ERRORS +.Nm +may fail with the following errors: +.Bl -tag -width Er +.It Bq Er ENODEV +.Dv KCMP_FILEOBJ +was specified and +.Fa idx1 +refers to a file descriptor which does not implement a comparison operator. +.It Bq Er EINVAL +The value of +.Fa type +is invalid. +.It Bq Er EBADF +One of the file descriptors referred to by +.Fa idx1 +or +.Fa idx2 +is not valid. +.It Bq Er ESRCH +One of the processes referred to by +.Fa pid1 +or +.Fa pid2 +does not exist or is not visible (e.g., due to jail restrictions). +.It Bq Er EPERM +The caller does not have permission to access one of the processes referred to +by +.Fa pid1 +or +.Fa pid2 . +.El +.Sh SEE ALSO +.Xr dup 2 , +.Xr fcntl 2 , +.Xr fork 2 , +.Xr rfork 2 , +.Xr vfork 2 +.Sh STANDARDS +The +.Nm +system call originated in Linux. +This implementation aims to be source-compatible with the Linux implementation. +.Fx +implements only a subset of the possible values for +.Fa type +supported in Linux. +More values may be added in the future. +The +.Dv KCMP_FILEOBJ +type is a FreeBSD extension. +.Sh HISTORY +The +.Nm +function was introduced in +.Fx 14.1 . From nobody Wed Jan 31 15:23:36 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQ5Qw6KZQz58kHJ; Wed, 31 Jan 2024 15:23: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 4TQ5Qw5lWMz45Bt; Wed, 31 Jan 2024 15:23:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706714616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L6gzxbu3C7lFUl30ouk152vzCV+aAE84o5YGl1iZqNg=; b=pnG45WUFS6Qtlz7IqenvTWYx8RxrR57VWChMCdyAhHJHidxl0Vtg3+G/v9MSoKY2i01xjP /G+Oh6bCLz/VBANAZkk6MjoudsdduVwrGQC6Wr11vVHbJ2KcKYB7c9XcEoXhT0MXEdHXWK R7diasicXsw7rXyl5cPiy+agUm4dVWt20mSrYMEfHzuFlvf42rJVYX7jQ/fJLat+rMqQd/ +QJQ5db7uy9qjJUQAcyRA4bDT6tH8N+XSxlwVJ2o1yU4aBo5rE+YL3cjXaL5T8v0m+2amK +9wFkYO/Czb01es/sU/Rmz+utbebnKPbAbHCcfUPUOO8Xlannb1CLTYy3Rps0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706714616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L6gzxbu3C7lFUl30ouk152vzCV+aAE84o5YGl1iZqNg=; b=SGU6G89sR2GCLs26tI/kL1xpJaZJYOu+fcfoFNJ5nbKXbofM6WDuasEmtGwvJDtBX/WzxV TxCLPVrTmHQfcBzfxFIznl1ctqSztoo5n7+lP4nLNQE5LqWHaXFixq3sfK+Dfk5U1WaDst 1NqIeWAUdZ9pzk0XX9pAQRzliV/qDFA/OTDcm0749u5X+/zh5aOueZ//gYNJqsBUCisuTu 01Is+wMpbOzIOu5ab+hUjhFEytxPwG2/AGDPjndhskJMKUVUhSRRkADjIS328lC+zqlq+r zwXb1rtDH7/NURNkP9dSs5JqoBY2imkckAWiAqy2ehd3DTMq0WKDFND0BFkTrg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706714616; a=rsa-sha256; cv=none; b=hk7ljuSMJs/vBAaTYOW/XcMgyHt0tRYYiU3vaYT/6GzF8/GLcKY46ICIrPzNTF5+yY3VDz 8GcN/H5rUhRxuomjiilRIqFjI6VUIWTQgh8bZgaL2D3MooXik3sAo0bN1liyysHSJAvk23 UCIcCT4yw13bmDblH4jgrZ/BMUrFp8zg8Xfwoc4qPdxELjnlB36TkEsYn061wDEplQtPiR 0CFtnBs1DdMrYWQeV3pm8kaPiRFcqQtH3U7eOs2YahFOhEj5xO6xsv4UF88dvB99NeY2jK 60vLRL/vgKZadR4Gs/98uLR0c2T4DfJ/EJYlJuGwbTvZSuXKP64j9ukiQQTn1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQ5Qw4pWMzP8D; Wed, 31 Jan 2024 15:23: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 40VFNaMk042369; Wed, 31 Jan 2024 15:23:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40VFNahI042366; Wed, 31 Jan 2024 15:23:36 GMT (envelope-from git) Date: Wed, 31 Jan 2024 15:23:36 GMT Message-Id: <202401311523.40VFNahI042366@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Wolfram Schneider Subject: git: 47cb760dac09 - stable/14 - man: support special characters in filenames List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wosch X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 47cb760dac09ee10343e58cd46e923f27bd87f9b Auto-Submitted: auto-generated The branch stable/14 has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=47cb760dac09ee10343e58cd46e923f27bd87f9b commit 47cb760dac09ee10343e58cd46e923f27bd87f9b Author: Wolfram Schneider AuthorDate: 2024-01-25 07:14:06 +0000 Commit: Wolfram Schneider CommitDate: 2024-01-31 14:47:33 +0000 man: support special characters in filenames man.sh needs to handle double quotes and sub shell character as '`' '$' etc. PR: 275967 Reviewed by: bapt MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43453 (cherry picked from commit b8a484ec343d163a40f7cf4a6026e880f992c738) --- usr.bin/man/man.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/usr.bin/man/man.sh b/usr.bin/man/man.sh index 777726f880db..cd047862727d 100755 --- a/usr.bin/man/man.sh +++ b/usr.bin/man/man.sh @@ -349,7 +349,7 @@ man_display_page() { decho "Command: $cattool \"$catpage\" | $MANPAGER" ret=0 else - eval "$cattool \"$catpage\" | $MANPAGER" + $cattool "$catpage" | $MANPAGER ret=$? fi fi @@ -374,7 +374,7 @@ man_display_page() { pipeline="mandoc $mandoc_args | $MANPAGER" fi - if ! eval "$cattool \"$manpage\" | $testline" ;then + if ! $cattool "$manpage" | eval "$testline"; then if which -s groff; then man_display_page_groff else @@ -387,10 +387,10 @@ man_display_page() { fi if [ $debug -gt 0 ]; then - decho "Command: $cattool \"$manpage\" | $pipeline" + decho "Command: $cattool \"$manpage\" | eval \"$pipeline\"" ret=0 else - eval "$cattool \"$manpage\" | $pipeline" + $cattool "$manpage" | eval "$pipeline" ret=$? fi } @@ -480,10 +480,10 @@ man_display_page_groff() { fi if [ $debug -gt 0 ]; then - decho "Command: $cattool \"$manpage\" | $pipeline" + decho "Command: $cattool \"$manpage\" | eval \"$pipeline\"" ret=0 else - eval "$cattool \"$manpage\" | $pipeline" + $cattool "$manpage" | eval "$pipeline" ret=$? fi } From nobody Thu Feb 1 00:31:02 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQKZZ60nXz58d0V; Thu, 1 Feb 2024 00: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 4TQKZZ5MZYz4KdS; Thu, 1 Feb 2024 00: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=1706747462; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0ch/uTBqvihE23FrFRvOg8Aw8wa98T56qPnr9eirgks=; b=EK1x4yx+Fj642a4JZXXXvQm4CGdcsHralOsXvnqDwTAwIiQeZttczzR6QLo6YejfjPLpmV qpiOS/dV0p/0bNDvYb3chxDyKE8ukvifnRQoAMwB6v6HjoBu0yLNxlONEPezoiGjPeQauJ l+pTqHMCQGEHLYtzYTjUdvttfXmy3jb3DLFPEiLAuz+WJ2zAlu+VsSKXjCUlW65EsModzo UHEtufC8TUyw4/1smSvXKs6rF6itJlB1uw+CuGz7+eDVVfe4MY39Y9q57zf+X08YKF/3nR xEIHaNv9e/5sYglnEGlIK87gDwPnkwYRT9fDtr+O9mFgcJGGxEf7WRRGWLiUyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706747462; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0ch/uTBqvihE23FrFRvOg8Aw8wa98T56qPnr9eirgks=; b=ndvXM2YIuWNFEI9IjLyeYfiQI1u1HqH0DZRBmpQpjKpTO+kE+QfilclEpbstVupz+H2zJz wcylq1CZYeIWqYbcCvyfXnkGTmW1yVvxLuANsEQxGssaY6kJCKZ6KuPUR4pyyXW0z9ljz2 2L6SFVaZDFlYd6qa5NiMl4ZT0j75zu7uclrNH7alIHtKIl4NVeLgmH0kvOB4IlYfrhU85N AS+82rXuf9kE+8mPGTFCXOh+0083UD0d9EKMCOjKnsJqkbHZ29fac+3DtIX5rc9XT01afg v+gc9NwF66U/hdjv6mED+pCuC25xOQ9jZypBy0cKEpKSdo84N7re2A4mBOnWXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706747462; a=rsa-sha256; cv=none; b=ENssuAGq6VNyq+EkEqR7+dSiwopr2LF25OEw/E94mIlfsrqtx1N+Qua+/H7VcyGyeyMNxx gzLvN+tweKb9PEKrfyhOSktoQOjk3BSDqHYFTnmHX4q2D5oSkilXwfl8zkqJKENZqqXt6J xCyGAGOxehgk4Lt0xOHzh7RGPqb+MPD5wcn+7bB2loFKigj3W4f+90GZP7yhUDqTuMGYR5 RozAD0yObMRAZH/NW4p6ilkoe0dbIPqtOEUsAI5OdWcJDajyyQrCbWHDqYiLxUVp35fFoL J44AVAt4o0mAL6NnlntTiHDbhfIpj40wPnVjFyNCV07aTIQ03Ro19amJUYaJEQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQKZZ4Rw7zgJ2; Thu, 1 Feb 2024 00: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 4110V2ZV063396; Thu, 1 Feb 2024 00: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 4110V23Y063393; Thu, 1 Feb 2024 00:31:02 GMT (envelope-from git) Date: Thu, 1 Feb 2024 00:31:02 GMT Message-Id: <202402010031.4110V23Y063393@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: 14b7cf92e73a - stable/14 - open(2): describe *at behavior for dirfd opened without O_SEARCH List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 14b7cf92e73ab46f6b0eb22fc40a3f4c872c3598 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=14b7cf92e73ab46f6b0eb22fc40a3f4c872c3598 commit 14b7cf92e73ab46f6b0eb22fc40a3f4c872c3598 Author: Konstantin Belousov AuthorDate: 2024-01-29 17:54:32 +0000 Commit: Konstantin Belousov CommitDate: 2024-02-01 00:30:40 +0000 open(2): describe *at behavior for dirfd opened without O_SEARCH (cherry picked from commit a570fe4d0dd979ce099374259ffc45d56ae4e471) --- lib/libc/sys/open.2 | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 index ff0441d64507..67a059db10da 100644 --- a/lib/libc/sys/open.2 +++ b/lib/libc/sys/open.2 @@ -25,9 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)open.2 8.2 (Berkeley) 11/16/93 -.\" -.Dd May 29, 2023 +.Dd January 29, 2024 .Dt OPEN 2 .Os .Sh NAME @@ -316,6 +314,12 @@ may not be used for any read operations like The primary use for this descriptor will be as the lookup descriptor for the .Fn *at family of functions. +If +.Dv O_SEARCH +was not requested at open time, then the +.Fn *at +functions use the current directory permissions for the directory referenced +by the descriptor at the time of the call. .Pp .Dv O_PATH returns a file descriptor that can be used as a directory file descriptor for @@ -658,6 +662,23 @@ when is set in flags and the final component of pathname is a symbolic link to distinguish it from the case of too many symbolic link traversals in one of its non-final components. +.Pp +The Open Group Extended API Set 2 specification, that introduced the +.Fn *at +API, required that the test for whether +.Fa fd +is searchable is based on whether +.Fa fd +is open for searching, not whether the underlying directory currently +permits searches. +The present implementation of the +.Fa openat +system call is believed to be compatible with +.St -p1003.1-2017 , +which specifies that behavior for +.Dv O_SEARCH , +in the absence of the flag the implementation checks the current +permissions of a directory. .Sh HISTORY The .Fn open @@ -670,17 +691,6 @@ function was introduced in .Dv O_DSYNC appeared in 13.0. .Sh BUGS -The Open Group Extended API Set 2 specification requires that the test -for whether -.Fa fd -is searchable is based on whether -.Fa fd -is open for searching, not whether the underlying directory currently -permits searches. -The present implementation of the -.Fa openat -checks the current permissions of directory instead. -.Pp The .Fa mode argument is variadic and may result in different calling conventions From nobody Thu Feb 1 00:32:04 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQKbm5MC9z58cqB; Thu, 1 Feb 2024 00:32: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 4TQKbm4gwYz4LMx; Thu, 1 Feb 2024 00:32:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706747524; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KZxstPqWgDQChtawMN4zpnf5Mhh4TQrveCyctknMhzQ=; b=T4pHgp5lmeEkHcCyh7ac5KXQmbFrnM+2YBC1t7O1T94vZEzCYgzjAxrI9Jaaeqx9Q5lrqa Q7Pexbi84wzzG1rAWigCB25QfAqKE+fQImg89VzzT6S/6D98XAjmZKsIiDc/1eDY/3mS0w MGUPatLRVQPFYV/W2U+21z9by3qB4qjOQL+nUbxhFtu/ZiGqdby2oyWvnopUQf2msT4JzS Y01dWTYtD1sqGNt/OtOU6g4DsM1xgcTHIUcfm6UVuxVmkE/8NELU5AfQRLt7pfDtudHitX CD/VtcxvjM97F06YuIkOw+HlhDqPttqib9xh2sBU6rrfPzm3tJ6Xg9qi2RgiDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706747524; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KZxstPqWgDQChtawMN4zpnf5Mhh4TQrveCyctknMhzQ=; b=ijpMl523qv14lfrso+LRX6oAx7khqt1JYhQ5bMbVnq0a2dC9kkSPPYQ0m1+DpBlAZq7kRq 6QU8mSR6nxY8ilISscpPTteBPiend96ANgnGFvjDghIt7fweOSbdWgDsJZRvJZ8Pik2qhq Zwki8bBnGj/y+1UtOgQjfYjWMB4ixaaQLsnZlp+NxxiHJlsHINF9COQlMuwYfhSReJ8K+P PKpNOUjSNdfOLYN0xhkPEGQ1FxkH0Ot6FjVehsuS2vdINypj3DiTADnK1EyyuQE3GpUK9N 56iL3969Qf/F5iYcSXQfO4v8k14V9zjqh3Tm4isOFMem+gw1cTxI63iBB77ZcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706747524; a=rsa-sha256; cv=none; b=S9nxeYWErmXjzdxHzELkMcfH1kTMwW00eHox6p8e1HcBIM9qgpTzzewp2U4Pg8yRGcu4my 1g8+XxNUrX0MLMqcQAPeGfCVmr/KtvGtDJdkMtkgXR/gYdQN3NIL+M+Cf0bvN0Q1HYBmty k6VSYMn/WeB+AGiCmIoiKmZg5EY+6lHraU62MAO+BiS8y7U51P8o7t1Q207hhpVG+anlXM E06YttavWzZOE0gcL2v/zKtRKb8eA65l/vZVODjrXxXQUzc4pN8lU/TgFk9ZtHvBap9p0l VbD0Lzh9EPVohWqkUCi93awmN1iv/27U4YgdU2oK3UY8D/aYiKutu3GB6mMsIw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQKbm3MhnzgJB; Thu, 1 Feb 2024 00:32: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 4110W4an068431; Thu, 1 Feb 2024 00:32:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4110W4Rk068416; Thu, 1 Feb 2024 00:32:04 GMT (envelope-from git) Date: Thu, 1 Feb 2024 00:32:04 GMT Message-Id: <202402010032.4110W4Rk068416@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: 617695812a38 - stable/13 - open(2): describe *at behavior for dirfd opened without O_SEARCH List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 617695812a3821ab9767df5f5c6959ad01daec8c Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=617695812a3821ab9767df5f5c6959ad01daec8c commit 617695812a3821ab9767df5f5c6959ad01daec8c Author: Konstantin Belousov AuthorDate: 2024-01-29 17:54:32 +0000 Commit: Konstantin Belousov CommitDate: 2024-02-01 00:31:38 +0000 open(2): describe *at behavior for dirfd opened without O_SEARCH (cherry picked from commit a570fe4d0dd979ce099374259ffc45d56ae4e471) --- lib/libc/sys/open.2 | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 index 74149ddba487..61722c7e08ea 100644 --- a/lib/libc/sys/open.2 +++ b/lib/libc/sys/open.2 @@ -25,9 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)open.2 8.2 (Berkeley) 11/16/93 -.\" -.Dd May 29, 2023 +.Dd January 29, 2024 .Dt OPEN 2 .Os .Sh NAME @@ -316,6 +314,12 @@ may not be used for any read operations like The primary use for this descriptor will be as the lookup descriptor for the .Fn *at family of functions. +If +.Dv O_SEARCH +was not requested at open time, then the +.Fn *at +functions use the current directory permissions for the directory referenced +by the descriptor at the time of the call. .Pp .Dv O_PATH returns a file descriptor that can be used as a directory file descriptor for @@ -651,6 +655,23 @@ when is set in flags and the final component of pathname is a symbolic link to distinguish it from the case of too many symbolic link traversals in one of its non-final components. +.Pp +The Open Group Extended API Set 2 specification, that introduced the +.Fn *at +API, required that the test for whether +.Fa fd +is searchable is based on whether +.Fa fd +is open for searching, not whether the underlying directory currently +permits searches. +The present implementation of the +.Fa openat +system call is believed to be compatible with +.St -p1003.1-2017 , +which specifies that behavior for +.Dv O_SEARCH , +in the absence of the flag the implementation checks the current +permissions of a directory. .Sh HISTORY The .Fn open @@ -663,17 +684,6 @@ function was introduced in .Dv O_DSYNC appeared in 13.0. .Sh BUGS -The Open Group Extended API Set 2 specification requires that the test -for whether -.Fa fd -is searchable is based on whether -.Fa fd -is open for searching, not whether the underlying directory currently -permits searches. -The present implementation of the -.Fa openat -checks the current permissions of directory instead. -.Pp The .Fa mode argument is variadic and may result in different calling conventions From nobody Thu Feb 1 14:02:57 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQgbP6PNdz58j7F; Thu, 1 Feb 2024 14:02: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 4TQgbP5s8yz4f4W; Thu, 1 Feb 2024 14:02:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706796177; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rrIXF4xainR631Tcu2vGApvSgJJHwWo2Y3l9IwXhmOo=; b=nMm+VW0UFKVZrR1rmjJYAlFjbLzHyzdqEJcR2x/j+C8mWMtcjx6vD3GAE3I/qeHA/CvslE FM/NtrGi6cXOTSXVq6ZJR5fvVXQx6O8TLW3embyzuyUpm44E/3ANGtjXVfqkXUPgrK+MJv aAWMRa8eejK1R6QvihlV8zG+gcsrWYbcVxfbnngHej5FWu3A7M6i2urykjdbHNT1WMUsnJ DIVxFkCjZuiBQXnEEw23mQJphtJCdjFQ3e/v0Frfk7wUD8AB1NyrrLYAtopaAP8ePLF+2x 5ZicF5kG7BdFcpy/jwjdJ2i+wW86irMeBcI247PJ0wzNzfd+BlZpVdQiYtGl3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706796177; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rrIXF4xainR631Tcu2vGApvSgJJHwWo2Y3l9IwXhmOo=; b=Ri8PklFA8drqAh5D71pq146mi/Neao3gfRRDH0gsuRKOypxi306SPOK4NWFITOBL0bZkr1 HK9eTBtvJFga5FtfOvEPMREQQaA1Zh023/B2tT+lN2pZ6bI9EXMSxcRXkQBbciHJfKue5i y7rwUuJ2nw+G3lRj0RLt0+nKfjAPi93PiE4HQMHur2xAcZqdeCUDhnTIG2Z0aLhfYS/Q1l 7UwXG/q6QSqyj+TkhCdU9KG15yFsFPldgpxZK3g8U2qfG4krvfaYrFWggskE2skejWObpe 60vUcKWBqWk3J422Zj9Dl4N+O+dxJFKWiOqVOwYZpjBvxbeqsBovdAasv5dcQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706796177; a=rsa-sha256; cv=none; b=V+BPh9gCjOncWleq9dyD2vuR/ftgZUX2PhqDNoY0a2/ZYLQjvrJVueq03V+FfEIXduLUG2 h7reXtMJZx0cK6S5mz6BZaO2wv0GJ2ts4gs0spM02h0hukCCg72IKpheOxLzsaLeOvE4GY SGLFNoEJ46nLoyQCKquAZ6xpXxT0E14bK91V2HambIXp7VxtMytOtYD9beb2qzVbFAhZJo ykp2mElLZ5N70U7XWk4DIWKLlhlPEYkD3qFifOKgtP3FQ09DKOR0IB7oY1oqwIqE8n6+ve ko3B4fgvkY4950SEfZP1KKKBSXlU/boPxSPGsEFgoi6n6bnFcrkp3w9OUMo3og== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQgbP4wHWz155k; Thu, 1 Feb 2024 14:02: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 411E2vB5030022; Thu, 1 Feb 2024 14:02:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 411E2v4o030019; Thu, 1 Feb 2024 14:02:57 GMT (envelope-from git) Date: Thu, 1 Feb 2024 14:02:57 GMT Message-Id: <202402011402.411E2v4o030019@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: d87ebf35c828 - stable/14 - mlx5: Zero DMA memory mlx5_alloc_cmd_msg() and alloc_cmd_page() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d87ebf35c82843874e2b84e454ba4fbcea4b16b7 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d87ebf35c82843874e2b84e454ba4fbcea4b16b7 commit d87ebf35c82843874e2b84e454ba4fbcea4b16b7 Author: Mark Johnston AuthorDate: 2024-01-18 21:47:52 +0000 Commit: Mark Johnston CommitDate: 2024-02-01 14:02:48 +0000 mlx5: Zero DMA memory mlx5_alloc_cmd_msg() and alloc_cmd_page() These functions may map more memory for DMA than is actually used, since the allocator operates on multiples of a 4KB page size. Thus, bus_dmamap_sync() can trigger KMSAN reports when the unused portion of a page is not zero-ed. Reported by: KMSAN Reviewed by: kib MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D43133 (cherry picked from commit 47a6fb9d5a2ebec12114a604053ffbd2929f0021) --- sys/dev/mlx5/mlx5_core/mlx5_cmd.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/dev/mlx5/mlx5_core/mlx5_cmd.c b/sys/dev/mlx5/mlx5_core/mlx5_cmd.c index 721b27b9120c..d46feb4b9e5b 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_cmd.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_cmd.c @@ -1113,11 +1113,16 @@ mlx5_alloc_cmd_msg(struct mlx5_core_dev *dev, gfp_t flags, size_t size) block = mlx5_fwp_get_virt(msg, i * MLX5_CMD_MBOX_SIZE); - memset(block, 0, MLX5_CMD_MBOX_SIZE); - if (i != (n - 1)) { + memset(block, 0, MLX5_CMD_MBOX_SIZE); + u64 dma = mlx5_fwp_get_dma(msg, (i + 1) * MLX5_CMD_MBOX_SIZE); block->next = cpu_to_be64(dma); + } else { + /* Zero the rest of the page to satisfy KMSAN. */ + memset(block, 0, MLX5_ADAPTER_PAGE_SIZE - + (i % MLX5_NUM_CMDS_IN_ADAPTER_PAGE) * + MLX5_CMD_MBOX_SIZE); } block->block_num = cpu_to_be32(i); } @@ -1508,6 +1513,7 @@ alloc_cmd_page(struct mlx5_core_dev *dev, struct mlx5_cmd *cmd) } cmd->dma = mlx5_fwp_get_dma(cmd->cmd_page, 0); cmd->cmd_buf = mlx5_fwp_get_virt(cmd->cmd_page, 0); + memset(cmd->cmd_buf, 0, MLX5_ADAPTER_PAGE_SIZE); return (0); failure_alloc_page: From nobody Thu Feb 1 17:46:26 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQmYG6T0pz58KNr; Thu, 1 Feb 2024 17:46: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 4TQmYG54lGz46DZ; Thu, 1 Feb 2024 17:46:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706809586; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1A0rN7E23tUtkbijAX5ehs/gCPCAw1jQO2b9jfj5eFI=; b=WhPkJ2G+qc/TcbVepaf17FxL6imIaDtvZYZnOpnASZTVZg2PshhmVfs6IoZ7fYlkTwvcS6 FWim7TXucX+/jnni1Pj3rzkpYRlqSBIuNUeWsNMzrS3e9dkwfQPsAdA68eaeXWnaCTqftO OIdlkNavV/+dLL5CHEbNXZYJawjOcdDQR9ndjhj/Ec7pszQOGgVLaShlVej3GNhe6Q5EPo eHcfcwtgL9nCp0afLV6pjAXTGzEv84YsUKqZCgs6MHaYroXqD0E9K+PIdY2EII+gcmBrEG sGrX5ZGK/UFUeMqHiplXbCQNEROVsFQUM4MDxw2xKHVwgWU/cLOufUvYnfprFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706809586; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1A0rN7E23tUtkbijAX5ehs/gCPCAw1jQO2b9jfj5eFI=; b=xVu6bBlpfvFtNa4sTDd1blPGeIGCYip1vKSvmz2bNK6uu79EuuBee3+UldTrRMqP5qdxQb tEc6BYFSOZERGLKcU9wg9c23mVZCeJDA8A5/nOsmBDfHBnN+z+jcY3nk4mCnGDz1rp34Vc 4XaVvO9A2q4ou8nfZiUwoTYhdHXTN/he7RVfvCwcHjfajp43yQQW8SGufFYq8L/OuqAqbY /DBTg3GCyzOd6nlPrxz1Uo0rhuVgdT/j2vBVYcaoKMFDAO7lox/XW82kicyL7CxeNGX7yj 3hcpFwODORbshzqQg7hod8escW7rI3bEXGN67B/3s8gy4RFjUIXoS0e1KGU11g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706809586; a=rsa-sha256; cv=none; b=dZMJP0HpBSiTZe+m60s4O7Un4eD4tG5UlHQgro5+1v7ULlDwmWOGb0H1shLI6EA8Y6iWJv RcvcsHaZxZhKX9u6b1BL+0wi6WX2HGlBPysemlCfBFYIFDCMCPfOexJCyQA06ez9iu2IIw +z5BfHDFubekcxbVMcoaaOploW1WFrpH+HNRtZx1s2BiYRWMbdzvk2P8QTVWbtt/8hCaE8 Se+IzAw0pEGWbibT9cKYNzryMNrxmmVZzsrArzVCWhVZhwpP5dQPRS1OTssKjpOZNGrpyX dDapudQsEUnQ1iHEP62bLWRHyA3/s0+RT1MUXjjo7MJapr8gbeWhZLxcxHBblg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQmYG45MVz1B5b; Thu, 1 Feb 2024 17:46: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 411HkQdA099697; Thu, 1 Feb 2024 17:46:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 411HkQ0x099694; Thu, 1 Feb 2024 17:46:26 GMT (envelope-from git) Date: Thu, 1 Feb 2024 17:46:26 GMT Message-Id: <202402011746.411HkQ0x099694@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: 3d6778d84eaa - stable/14 - Add kenv .Xr in kldload(8) and loader.conf(5) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3d6778d84eaa06b6c48b41f006f10147b2149ba8 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=3d6778d84eaa06b6c48b41f006f10147b2149ba8 commit 3d6778d84eaa06b6c48b41f006f10147b2149ba8 Author: Warner Losh AuthorDate: 2023-12-21 04:15:42 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-02-01 17:43:25 +0000 Add kenv .Xr in kldload(8) and loader.conf(5) Sponsored by: Netflix (cherry picked from commit 64db9a0f82863d212ac0bcd49bc0254ccb9dd1ac) --- sbin/kldload/kldload.8 | 3 ++- stand/defaults/loader.conf.5 | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sbin/kldload/kldload.8 b/sbin/kldload/kldload.8 index 4140f845b5e2..0dea7838d75c 100644 --- a/sbin/kldload/kldload.8 +++ b/sbin/kldload/kldload.8 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 11, 2021 +.Dd December 20, 2023 .Dt KLDLOAD 8 .Os .Sh NAME @@ -114,6 +114,7 @@ Only those modules necessary for booting the system, including those required for mounting the root filesystem, should be handled by .Xr loader.conf 5 . .Sh SEE ALSO +.Xr kenv 1 , .Xr kldload 2 , .Xr loader.conf 5 , .Xr rc.conf 5 , diff --git a/stand/defaults/loader.conf.5 b/stand/defaults/loader.conf.5 index 195b34e75fdd..8b7508c8a5b2 100644 --- a/stand/defaults/loader.conf.5 +++ b/stand/defaults/loader.conf.5 @@ -21,7 +21,7 @@ .\" 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 July 31, 2021 +.Dd December 20, 2023 .Dt LOADER.CONF 5 .Os .Sh NAME @@ -431,6 +431,7 @@ user defined settings written in lua. machine-specific settings for sites with a common loader.conf. .El .Sh SEE ALSO +.Xr kenv 1 , .Xr loader.conf.lua 5 , .Xr rc.conf 5 , .Xr boot 8 , From nobody Thu Feb 1 17:46:27 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQmYH40Srz58KLb; Thu, 1 Feb 2024 17:46: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 4TQmYH1h1dz46KL; Thu, 1 Feb 2024 17:46:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706809587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7ML/OyIobFilCNQ3pIyu5/55oZvLGrtqpgQVNxRe3Q8=; b=TTqODAxszo/0D/Tdbiut95z/W0JiTTeq7R3LP1UKNoHf25NidU9onE6K+1lxNequHppmc+ 1KwjtQEVzSb8EqIHvDir2v78bAwVl9dXPtHoiAgvo3YChl1wlQo2khRPc2MObq2KMq43sU CgU3gbqONy0DxiM6vlcwPEHtit9ckjzXCEaNMs7Cyt8NJFyYhKPZL6Jx9OeOOJ/qf6iKH6 aXBjgZ82k6J48z1aukfJhigaWwcGXDPcwte+j1FxoK13cDrBt0FafUYkTctrUZZekZK/aD ErAuLZh+hmk9Qq0aVULSCKfIC7EtX/BFWMFDnLJVk8xo7muA82QdN9uGrpiOeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706809587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7ML/OyIobFilCNQ3pIyu5/55oZvLGrtqpgQVNxRe3Q8=; b=I2Wv21Sd1UAljYRloTtkk1KEKI7mU9X8nSUZ0uuxHqSBLOibOewgQCtHHkDMxnStsmRigq FxGB8zLss37kPGRoywpupaBTstisik91vtDpHqgbbVd3+CktRdI1RI6fLXEZVpdnZxozh1 O4Tzm+saRpNM6C5o6E51Z2Ckcq08aeCO7EuN3StFIjZiLAwduERJD8QHBqEtt6PZno00/6 sGF3LLRGSVbem6kA8hZM5x9hTGSNARGTZoIsAkNQE7FQv679dhyv98szQam2l5ORF2QLXF TiDXoC8T+p4C9gRtMp1Nrt9TAbbVD8tFqTmGxwVqGPcVkv/3Qyr5DutNOzhgNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706809587; a=rsa-sha256; cv=none; b=AQI6ziqUU2mwLBtALcwHuN5Rx+hpfRhy3Xa/j+NeSoTv2RfUm4JjpXNwJU1gPzwhu+0mFm oPwFjz2MC83CqDqWPyKRmz0z8hKCmqzvo7okXsgltEyzWSSlWcK/iYWyd89NcLfKFS1Bew Kf3Pqh/QC0lJ7vO6R1c0FbX+d+P2NDm/56PBGGiQeiE4avqR1Tfo4mOFfQReaeGFB/tm39 /L0tzXI3cmErvnngoW9fuJTqb3mfXCabRmcu0w7ab2YDGLPsI12GF7x63lv3QlRFZt4Vl0 X6es0oGx0AJxVhM+0NmZvyYcRPhRrM7I8Zk6mi16lBX+9F1bBnhmP0L9UBX1gA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQmYH0kZyz1BH9; Thu, 1 Feb 2024 17:46: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 411HkRs5099819; Thu, 1 Feb 2024 17:46:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 411HkRvA099816; Thu, 1 Feb 2024 17:46:27 GMT (envelope-from git) Date: Thu, 1 Feb 2024 17:46:27 GMT Message-Id: <202402011746.411HkRvA099816@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: 5d7b049f9904 - stable/13 - Add kenv .Xr in kldload(8) and loader.conf(5) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5d7b049f99047f73d52a1319c5f062fc62d3fc95 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=5d7b049f99047f73d52a1319c5f062fc62d3fc95 commit 5d7b049f99047f73d52a1319c5f062fc62d3fc95 Author: Warner Losh AuthorDate: 2023-12-21 04:15:42 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-02-01 17:46:13 +0000 Add kenv .Xr in kldload(8) and loader.conf(5) Sponsored by: Netflix (cherry picked from commit 64db9a0f82863d212ac0bcd49bc0254ccb9dd1ac) --- sbin/kldload/kldload.8 | 3 ++- stand/defaults/loader.conf.5 | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sbin/kldload/kldload.8 b/sbin/kldload/kldload.8 index 47254bd0c665..5104cdd9b685 100644 --- a/sbin/kldload/kldload.8 +++ b/sbin/kldload/kldload.8 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 27, 2017 +.Dd December 20, 2023 .Dt KLDLOAD 8 .Os .Sh NAME @@ -108,6 +108,7 @@ statement is used. Modules may also be auto-loaded through their addition to .Xr loader.conf 5 . .Sh SEE ALSO +.Xr kenv 1 , .Xr kldload 2 , .Xr loader.conf 5 , .Xr rc.conf 5 , diff --git a/stand/defaults/loader.conf.5 b/stand/defaults/loader.conf.5 index 60390adcd541..229bd2b27132 100644 --- a/stand/defaults/loader.conf.5 +++ b/stand/defaults/loader.conf.5 @@ -21,7 +21,7 @@ .\" 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 July 31, 2021 +.Dd December 20, 2023 .Dt LOADER.CONF 5 .Os .Sh NAME @@ -429,6 +429,7 @@ user defined settings. machine-specific settings for sites with a common loader.conf. .El .Sh SEE ALSO +.Xr kenv 1 , .Xr rc.conf 5 , .Xr boot 8 , .Xr cpucontrol 8 , From nobody Thu Feb 1 17:46:27 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQmYJ38vPz58KLd; Thu, 1 Feb 2024 17:46: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 4TQmYJ1XqTz468j; Thu, 1 Feb 2024 17:46:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706809588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qSy5T+DB8hcvr4lMsapzkTi1/0f21g4HLA+d3W+aEq0=; b=rjPG2rhkiqEPYKVKgpUB1KIUjTnBEIXG4d3OuCQEYoLKBJbJ+vBHFj3Z9kZIbCNBg/Enum 83tWYdpcNJABbGX4ZKb96PCLMF72KSjUU482m0xKRdr35YKqvt+dS/KH3mLxLbkghsrSaO PW79dWrIpPNqF3m0cU5b5lDW/dPO8lBZ8TWWsQpKxgeVCBcIeAubIbTzzk4RTipLSZosvx VMdTdiHjYdc2injQ+3pjKwjBbGiYYM7hWiqPAJzEhjsRfZ+LcO8IdpXBRKG7iXgfLxbkZP X4fnEyDkmisOnN26+FDJylEGLtFWILxHeEvJ2Vx8F8o3Xr/lBAZyOFSccxKTCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706809588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qSy5T+DB8hcvr4lMsapzkTi1/0f21g4HLA+d3W+aEq0=; b=tXAYRMlopxl+Ivif3vTFScQtob5wUBD4uf3M8L8tG6bjiEmUxE0z+Jqx9li6r2HuoMyud1 3OlBGtaZ6i4OqLk7zFFms/bJiJ08Iowm+iFeTEA2oS4SL64jTZ8VWp4qRpjgSFqqC8njK2 oQBx1nn/av8J8SrJ9bsqxN+MiLGoxC5TKe65k3gFENh03+STNBHYtQ0mwqJd7/CFfEYSDB QJHFNvyDTgC49QCy1HfvZR+6wQcj+C22xtBwiLu3NnXUDxJjbFg4L5BtuzDli9EMbHkEG/ NkaeC/T0Sev++2htIsahdnkbDQ+Qy3zR5Enx2q367TnGMJSwFQH6Z6QFAQeHUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706809588; a=rsa-sha256; cv=none; b=FTlWpKxNygzLk6rd+7g/di0h/AFk94Jb79dpbBwntou+FSyT9JlDJsXimieLVLFrlA1jlZ onu6uaxwE5DAqepqmhlM5rHgx6aqwQVtDqL82eEh/vwGs2XypP6upupz7dlJm+lZ2/itQd pjZAqr8d24B2TuFABQ91FrYtAsGfK9KuJqWuI9/PMXkPQx5mZ81F4oDiPt03gECDz8DAMm dAehHokdPlgqdLqrG53vBOvT63S+Iw3IhIEPJgqQbyWdMhu1SZHXIpuEafW27PcWP7eori fNtBJz/uiprexYlbKNbL+PDrbiR+8NHTqwz8Zw46Bjdqk4u2EKL6pnnJPwv7Eg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQmYH71Kxz1BXr; Thu, 1 Feb 2024 17:46: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 411HkRTl099877; Thu, 1 Feb 2024 17:46:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 411HkRRg099874; Thu, 1 Feb 2024 17:46:27 GMT (envelope-from git) Date: Thu, 1 Feb 2024 17:46:27 GMT Message-Id: <202402011746.411HkRRg099874@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: 3a9cb4da4e75 - stable/14 - stand: Add 1440p to the list of known resolutions. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3a9cb4da4e7539b700c805c8c4ca0f1d3f4dff2e Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=3a9cb4da4e7539b700c805c8c4ca0f1d3f4dff2e commit 3a9cb4da4e7539b700c805c8c4ca0f1d3f4dff2e Author: Dag-Erling Smørgrav AuthorDate: 2024-01-23 14:20:27 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-02-01 17:43:25 +0000 stand: Add 1440p to the list of known resolutions. MFC after: 1 week Reviewed by: manu, kevans, imp Differential Revision: https://reviews.freebsd.org/D43391 (cherry picked from commit 7edbf69b79c13debff251e6edfee1f57eeac3a6b) --- stand/defaults/loader.conf | 2 +- stand/defaults/loader.conf.5 | 3 ++- stand/efi/loader/framebuffer.c | 5 +++++ stand/i386/libi386/vbe.c | 5 +++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/stand/defaults/loader.conf b/stand/defaults/loader.conf index 08406aa43bc8..e0062bbc8149 100644 --- a/stand/defaults/loader.conf +++ b/stand/defaults/loader.conf @@ -95,7 +95,7 @@ audit_event_type="etc_security_audit_event" bootenv_autolist="YES" # Auto populate the list of ZFS Boot Environments #beastie_disable="NO" # Turn the beastie boot menu on and off efi_max_resolution="1x1" # Set the max resolution for EFI loader to use: - # 480p, 720p, 1080p, 2160p/4k, 5k, or specify + # 480p, 720p, 1080p, 1440p, 2160p/4k, 5k, or # WidthxHeight (e.g. 1920x1080) #kernels="kernel kernel.old" # Kernels to display in the boot menu kernels_autodetect="YES" # Auto-detect kernel directories in /boot diff --git a/stand/defaults/loader.conf.5 b/stand/defaults/loader.conf.5 index 8b7508c8a5b2..42e5712d93b8 100644 --- a/stand/defaults/loader.conf.5 +++ b/stand/defaults/loader.conf.5 @@ -21,7 +21,7 @@ .\" 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 December 20, 2023 +.Dd January 10, 2024 .Dt LOADER.CONF 5 .Os .Sh NAME @@ -315,6 +315,7 @@ The following values are accepted: .It 480p Ta 640x480 .It 720p Ta 1280x720 .It 1080p Ta 1920x1080 +.It 1440p Ta 2560x1440 .It 2160p Ta 3840x2160 .It 4k Ta 3840x2160 .It 5k Ta 5120x2880 diff --git a/stand/efi/loader/framebuffer.c b/stand/efi/loader/framebuffer.c index b8e61dc73acf..56693187b576 100644 --- a/stand/efi/loader/framebuffer.c +++ b/stand/efi/loader/framebuffer.c @@ -77,6 +77,11 @@ static struct named_resolution { .width = 1920, .height = 1080, }, + { + .name = "1440p", + .width = 2560, + .height = 1440, + }, { .name = "2160p", .alias = "4k", diff --git a/stand/i386/libi386/vbe.c b/stand/i386/libi386/vbe.c index 8fbfaa9a3475..61339a1e7911 100644 --- a/stand/i386/libi386/vbe.c +++ b/stand/i386/libi386/vbe.c @@ -84,6 +84,11 @@ static struct named_resolution { .width = 1920, .height = 1080, }, + { + .name = "1440p", + .width = 2560, + .height = 1440, + }, { .name = "2160p", .alias = "4k", From nobody Thu Feb 1 17:46:28 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQmYJ42Msz58KCJ; Thu, 1 Feb 2024 17:46: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 4TQmYJ2plWz46KP; Thu, 1 Feb 2024 17:46:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706809588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bnCLFBX7kEYfECkNAwyM3yBPfA0vlJzRUUQeuD7SC9s=; b=nHXjwfF3I48Su3wMk3uzm3mOZO1DfH5tMHIjeRoyUwiEzMRLQBfmYbPqrfKVnZCDsG0V5H 6hhgoT2StU9uuH7297DEkpsVsggdYg5tWt106GYYDSSEX1y+0QpIoIi6ge/GJS1x/8JNsG 2UG84pqZg5KYlLUchY+/2e7XSW7tduIXAeV0Vl2RIX0Bs70IIHcn7zgcn4llGztVY9fi9U ntcxPgSqsfMdghdsk9EsQfL7MDU9HS+T1t+WYkVLPtSY7twq+qEJ3kDTgVE0GBTUef7Hhe kA57+svrmyR3RJKsY/31RawWb8tG2XNVTSuPvO2WP/23uWlAA4D01vKYhYU36Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706809588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bnCLFBX7kEYfECkNAwyM3yBPfA0vlJzRUUQeuD7SC9s=; b=qrx8QuTGGtuNiO6BxALKedtWnBgrqDqLEanQs1u1Drcge34bQBdqdboBPGGXjT3GTq/VwL CJbIdiIBaHnkNSkQ212jUeZT0hakvUhzcpGyglqpqE6YofRZ9tVaEx/OIVTZGhpICYsEIq zQcr2gGYMG3HOn1LVBUepuEv8F3/KsLTd8pYmVcG7hIiZ1fTbrG+vEVcl/lHPVFDkU9QEr sMqNugReVeWkPog/kp/uwPaEnfIB4QrMBTPE2j1rgdWhEJPCuigfMJMIVnHWXm8zhvNcfV NjESt3tDf96nH0LFKhRo3sF6sORjQQyls7N7nw/LD+pP2e8wOQTrIU6xS1yhiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706809588; a=rsa-sha256; cv=none; b=iP9FVzAVqCdVsoC36oxYJ8/ImlYOJxrsjpSIoM+3MCFlAkl0euTUk2FzinnK4c2F0DibDp aludLP0Kq9BqFgip62Jj6LzLx3BXgtmo0KgMjkgJJba06JLaIGLuh+3prxYlUBA/DYTFcF 25NrBLsQpJbCQftwO6arPG515HTZfPo5KrJiWfSE+5lqQMoEF9/X3zRC0AbFBGH2wEHm3v viTAmYOQZC5nQDrgIZm+2MnoQQPKlH1moKX91ekmN7mbxnNx1AzvHi8BmDZ6NRPrBHbMyN 0POLRrBKiKLeprLqUWFuD8bKXPnf37XFyy34pOTjMekaUydmZ5hI4YcwxDdfxA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQmYJ1lwZz1B7j; Thu, 1 Feb 2024 17:46: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 411HkStF099934; Thu, 1 Feb 2024 17:46:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 411HkS5k099931; Thu, 1 Feb 2024 17:46:28 GMT (envelope-from git) Date: Thu, 1 Feb 2024 17:46:28 GMT Message-Id: <202402011746.411HkS5k099931@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: 6ef4fc44f962 - stable/13 - stand: Add 1440p to the list of known resolutions. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6ef4fc44f96263b2e334aa0a58de8fefb2d15a8d Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=6ef4fc44f96263b2e334aa0a58de8fefb2d15a8d commit 6ef4fc44f96263b2e334aa0a58de8fefb2d15a8d Author: Dag-Erling Smørgrav AuthorDate: 2024-01-23 14:20:27 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-02-01 17:46:13 +0000 stand: Add 1440p to the list of known resolutions. MFC after: 1 week Reviewed by: manu, kevans, imp Differential Revision: https://reviews.freebsd.org/D43391 (cherry picked from commit 7edbf69b79c13debff251e6edfee1f57eeac3a6b) --- stand/defaults/loader.conf | 2 +- stand/defaults/loader.conf.5 | 3 ++- stand/efi/loader/framebuffer.c | 5 +++++ stand/i386/libi386/vbe.c | 5 +++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/stand/defaults/loader.conf b/stand/defaults/loader.conf index 3c7dab540c9c..1f820eaaec46 100644 --- a/stand/defaults/loader.conf +++ b/stand/defaults/loader.conf @@ -95,7 +95,7 @@ audit_event_type="etc_security_audit_event" bootenv_autolist="YES" # Auto populate the list of ZFS Boot Environments #beastie_disable="NO" # Turn the beastie boot menu on and off efi_max_resolution="1x1" # Set the max resolution for EFI loader to use: - # 480p, 720p, 1080p, 2160p/4k, 5k, or specify + # 480p, 720p, 1080p, 1440p, 2160p/4k, 5k, or # WidthxHeight (e.g. 1920x1080) #kernels="kernel kernel.old" # Kernels to display in the boot menu kernels_autodetect="YES" # Auto-detect kernel directories in /boot diff --git a/stand/defaults/loader.conf.5 b/stand/defaults/loader.conf.5 index 229bd2b27132..bb40df0333cf 100644 --- a/stand/defaults/loader.conf.5 +++ b/stand/defaults/loader.conf.5 @@ -21,7 +21,7 @@ .\" 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 December 20, 2023 +.Dd January 10, 2024 .Dt LOADER.CONF 5 .Os .Sh NAME @@ -315,6 +315,7 @@ The following values are accepted: .It 480p Ta 640x480 .It 720p Ta 1280x720 .It 1080p Ta 1920x1080 +.It 1440p Ta 2560x1440 .It 2160p Ta 3840x2160 .It 4k Ta 3840x2160 .It 5k Ta 5120x2880 diff --git a/stand/efi/loader/framebuffer.c b/stand/efi/loader/framebuffer.c index b8e61dc73acf..56693187b576 100644 --- a/stand/efi/loader/framebuffer.c +++ b/stand/efi/loader/framebuffer.c @@ -77,6 +77,11 @@ static struct named_resolution { .width = 1920, .height = 1080, }, + { + .name = "1440p", + .width = 2560, + .height = 1440, + }, { .name = "2160p", .alias = "4k", diff --git a/stand/i386/libi386/vbe.c b/stand/i386/libi386/vbe.c index 8fbfaa9a3475..61339a1e7911 100644 --- a/stand/i386/libi386/vbe.c +++ b/stand/i386/libi386/vbe.c @@ -84,6 +84,11 @@ static struct named_resolution { .width = 1920, .height = 1080, }, + { + .name = "1440p", + .width = 2560, + .height = 1440, + }, { .name = "2160p", .alias = "4k", From nobody Thu Feb 1 21:25:59 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsQb4nYfz58gsn; Thu, 1 Feb 2024 21:25: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 4TQsQb4H1Mz4Vqy; Thu, 1 Feb 2024 21:25:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Q6caTSvvWgGdc1j5331GD5MQ+YCDHdXmq8vt486Z9M=; b=yL9yJUEvf72ITJaXi431uoHQw9PXCG33oRoBgTOYibh2oWw/v78f/FDXpiaGPvkKe/g7BX LLJNeNtidYHWdWGnQY+yy+sw2UMFrg4ta0bgiXyqKIVVOICh5RwxStHoF7SmPybw/WBfQ1 0jw3dA3nLgLjt8pSwmQKXTSQ+gvTnPwbB9EbeWID/wgTP2r1K/FW+DTVV/WFTwldUWRj5C URVjms9Dncd+VPAY+Mp/2Nc2C8lUmQBjVBYHwlTqNYYM9nR1PCXyJONSEKPFi0UPsr6YD6 GWFolk9JG2ddDhnXCPhEE7aTz4s0uxjKnlIZ7D5h6iIai4iY97/PomLDysAMTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Q6caTSvvWgGdc1j5331GD5MQ+YCDHdXmq8vt486Z9M=; b=uE8hx6I+n+N6yktnfmh+KkrEgtza+1beR58rPrrylnZQ13VMfjgKaIT7iR9sKZVPTuKsID xNdPnmg8epgtDWvgthE0H8gNYCv6aIg4nsruaWZreRgfv1twTO0lRXEl2Ne9OTOW0Z4a/Z o1ExQF4f776I+OhEFY8EOKVtwRSwGWsgbwzRzsKydvaOLbyq9PxAd6fEsh+BHcjzES3d2v AKwHeEHa7crD4fQFoB308BzP7BO1vc4osH0LBX++lTvIMVPZNTtw0EkuBCMAbz40BGLVvj z+UJMTSfb+OJgdWS/WhO5PhL2oroAqadceYmwSHzNp+aSkzwng4G3bPLCjQfNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706822759; a=rsa-sha256; cv=none; b=MgyCwqbb09yjowcM0SkD1i/4sfo7Rz/AlR4Ge0MpTGuXDjyiBhXjS6uvlY1ZHoq3kquXFd bh0EaHlOFsvBx7JLNkZ7qMDZ1H0wC9Zk1CVlc7KWqosSJm2MaEeiL6SUrivZnJAp4tX/Y0 fs2X07gd9ntVEydzDRCcziTW665V0kHRQakWTtRPi7vP3W9GCOns1nCegvmw5NxgaDE59r bZ/F28SI0vrEap5O19/kaYYi3j3epBCKtaghpEdmJgVw+JSuEaHjnQmcUu6ZGvNk8e094r fObVSNMuJZDab1knl5VbFi5DCBVBc6/t5jXQSc5/6/RJsMEhlqcNIGZ9H2B4iw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsQb3LKBz1HbM; Thu, 1 Feb 2024 21:25: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 411LPxxs070088; Thu, 1 Feb 2024 21:25:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 411LPxXA070085; Thu, 1 Feb 2024 21:25:59 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:25:59 GMT Message-Id: <202402012125.411LPxXA070085@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: 2006be8bc46f - stable/13 - setusercontext(): umask: Set it only once (in the common case) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2006be8bc46fef3c37404827dbaf49749122553c Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=2006be8bc46fef3c37404827dbaf49749122553c commit 2006be8bc46fef3c37404827dbaf49749122553c Author: Olivier Certner AuthorDate: 2023-05-25 12:18:45 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:22:26 +0000 setusercontext(): umask: Set it only once (in the common case) Simplify the code and make it more coherent (umask was the only context setting not modified by setlogincontext() directly). Preserve the current behavior of not changing the umask if none is specified in the login class capabilities database, but without the superfluous umask() dance. (The only exception to this is that a special value no user is likely to input in the database now stands for no specification.) If some user has a 'umask' override in its '~/.login_conf', the umask will still be set twice as before (as is the case for all other context settings overriden in '~/.login_conf'). Log a warning in case of an invalid umask specification. This change makes it apparent that the value of LOGIN_DEFUMASK doesn't matter. It will be removed in a subsequent commit. PR: 271747 Reviewed by: emaste, kib (earlier version) Approved by: emaste MFC after: 3 days Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40344 (cherry picked from commit e99c28e93bd4d04ff877459734e9ce06ad2335a7) Approved by: markj (mentor) --- lib/libutil/login_class.c | 45 +++++++++++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/lib/libutil/login_class.c b/lib/libutil/login_class.c index 1036e9f9208c..2b85425d8d8e 100644 --- a/lib/libutil/login_class.c +++ b/lib/libutil/login_class.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -385,17 +386,40 @@ setclasscontext(const char *classname, unsigned int flags) * Private function which takes care of processing */ -static mode_t -setlogincontext(login_cap_t *lc, const struct passwd *pwd, - mode_t mymask, unsigned long flags) +static void +setlogincontext(login_cap_t *lc, const struct passwd *pwd, unsigned long flags) { if (lc) { /* Set resources */ if (flags & LOGIN_SETRESOURCES) setclassresources(lc); /* See if there's a umask override */ - if (flags & LOGIN_SETUMASK) - mymask = (mode_t)login_getcapnum(lc, "umask", mymask, mymask); + if (flags & LOGIN_SETUMASK) { + /* + * Make it unlikely that someone would input our default sentinel + * indicating no specification. + */ + const rlim_t def_val = INT64_MIN + 1, err_val = INT64_MIN; + const rlim_t val = login_getcapnum(lc, "umask", def_val, err_val); + + if (val != def_val) { + if (val < 0 || val > UINT16_MAX) { + /* We get here also on 'err_val'. */ + syslog(LOG_WARNING, + "%s%s%sLogin class '%s': " + "Invalid umask specification: '%s'", + pwd ? "Login '" : "", + pwd ? pwd->pw_name : "", + pwd ? "': " : "", + lc->lc_class, + login_getcapstr(lc, "umask", "", "")); + } else { + const mode_t mode = val; + + umask(mode); + } + } + } /* Set paths */ if (flags & LOGIN_SETPATH) setclassenvironment(lc, pwd, 1); @@ -406,7 +430,6 @@ setlogincontext(login_cap_t *lc, const struct passwd *pwd, if (flags & LOGIN_SETCPUMASK) setclasscpumask(lc); } - return (mymask); } @@ -429,7 +452,6 @@ int setusercontext(login_cap_t *lc, const struct passwd *pwd, uid_t uid, unsigned int flags) { rlim_t p; - mode_t mymask; login_cap_t *llc = NULL; struct rtprio rtp; int error; @@ -533,8 +555,7 @@ setusercontext(login_cap_t *lc, const struct passwd *pwd, uid_t uid, unsigned in } } - mymask = (flags & LOGIN_SETUMASK) ? umask(LOGIN_DEFUMASK) : 0; - mymask = setlogincontext(lc, pwd, mymask, flags); + setlogincontext(lc, pwd, flags); login_close(llc); /* This needs to be done after anything that needs root privs */ @@ -547,13 +568,9 @@ setusercontext(login_cap_t *lc, const struct passwd *pwd, uid_t uid, unsigned in * Now, we repeat some of the above for the user's private entries */ if (geteuid() == uid && (lc = login_getuserclass(pwd)) != NULL) { - mymask = setlogincontext(lc, pwd, mymask, flags); + setlogincontext(lc, pwd, flags); login_close(lc); } - /* Finally, set any umask we've found */ - if (flags & LOGIN_SETUMASK) - umask(mymask); - return (0); } From nobody Thu Feb 1 21:26:00 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsQc6xKBz58hTY; Thu, 1 Feb 2024 21:26: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 4TQsQc5Ff6z4Vgw; Thu, 1 Feb 2024 21:26:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822760; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AqoI2/ix46p4JeEm9N9fL3l3K76qoD4GVFbweAzOLso=; b=JRiwQzz7pnNElGwvVMEEqebO/SLaaDf25sotuldpknpMYbr47BoXm0D2BMG96yYH7YuhL9 LxgmlnPNuflhrecDsZnYzIA2pJXUoyk/hwRf9Br4IkI5+kGGa4EYjCFVD2WeAAxCTwaI4I ADDgG+YGYBe9a3DsnAjACJVrHoWlRc14juQnlcGQ3VGpdJI6qqOUDRIi8RsuJNdGb+PKSF uyie0XusGjvsHcEzNPdwShqdtwrIa3LhVdP8i7FxqAPB3Zm00boXspkgRm+MwFqxS0EOOP 5vtJyviwlNr/RTepO7ge3CEg/xAMIvzMxBSh5hRx8DkFAx1PBylmtWCR2shu7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822760; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AqoI2/ix46p4JeEm9N9fL3l3K76qoD4GVFbweAzOLso=; b=kit8pYxKJsnhNvsO28/nu9o6vb9Ick8NTo4ThwGKKloLFwDD6QVxHZMUIYXF2tNfffExCn BAWjSRjjvbu7rASpTmLxu3BfKyYA7JPoQdQFdcODi0wYmbVjQ+a5H27utESqi2EKz/ofYK ZYrU5k2XACIVzMufYL9mGIGunjJzajDtujCnyveYkIxu2Q596lmqioNsWRZiFX52I75Ay0 V4ZhDDM7RNXHMCT9BdTBAc6KQ2yCc/L5OS6wZQqJHFTafs89FR1zVYVNJgqE8meLis0+gp RaoZS06mu1wig8Mjjv01NOmUO2LLQEw3YLH5aULUiTdUyPhSilyhXd7joazTng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706822760; a=rsa-sha256; cv=none; b=MMY5X/dIjlWQ0KkXjlvji32DVCkXvjREXXOPqeqLWN5O+fHUS57/RwnLqdkUmADkLC+xtf mLBmplbUCF5Ib4SZ20FJDeamLLqHYfiqHcXxMh4sXAktijs2vSM7eMqSfMhqEQz92vA7xs hQ0KfGNcs+/ULIGJbPBJ76KxhyRLodIlzGSwezNTNQVOZPx28xDDDtrNp+2MasGrNq7vbQ JT+dgAT9qPVXLQyQuxJ8gTKEHqL24OxArJbFG83/ZXS3nm0rJBEZOa6M9urfEtbT4xe8Sl fyKWoCDS8ZpPCKljp6rh7e6Sqv8jXSyrqmJ3yGnJUhcjQMvD7hOFPv3tNvixXA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsQc4KGxz1J4n; Thu, 1 Feb 2024 21:26: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 411LQ0H9070139; Thu, 1 Feb 2024 21:26:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 411LQ08g070136; Thu, 1 Feb 2024 21:26:00 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:26:00 GMT Message-Id: <202402012126.411LQ08g070136@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: 11919f8eaf97 - stable/13 - login.conf(5): umask has no default value List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 11919f8eaf973018d81618da8a2b0ec214b22ee6 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=11919f8eaf973018d81618da8a2b0ec214b22ee6 commit 11919f8eaf973018d81618da8a2b0ec214b22ee6 Author: Olivier Certner AuthorDate: 2023-05-25 12:41:03 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:22:46 +0000 login.conf(5): umask has no default value The umask is simply left unchanged if no explicit value is specified in the login class capabilities database. PR: 271747 Reviewed by: emaste Approved by: emaste (mentor) MFC after: 3 days Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40345 (cherry picked from commit 0d1fe948d97d2d6e3708349b74cf438f9604a8d1) Approved by: markj (mentor) --- lib/libutil/login.conf.5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libutil/login.conf.5 b/lib/libutil/login.conf.5 index a0b46debbfd1..7449c11f2ba5 100644 --- a/lib/libutil/login.conf.5 +++ b/lib/libutil/login.conf.5 @@ -253,7 +253,7 @@ contain the shell specified in the password file. .It "term string Default terminal type if not able to determine" from other means. .It "timezone string Default value of $TZ environment variable." -.It "umask number 022 Initial umask. Should always have a leading 0 to" +.It "umask number Initial umask. Should always have a leading 0 to" ensure octal interpretation. .It "welcome file /etc/motd File containing welcome message." .El From nobody Thu Feb 1 21:26:01 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsQf2B9Xz58hRL; Thu, 1 Feb 2024 21:26: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 4TQsQd73mjz4Vpd; Thu, 1 Feb 2024 21:26:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v4Tx7bxJCSAM5wxqT4gt1PyRBFgPKHj7hITYDHGkIX4=; b=mhDsmQIR+Y7fAF8ucek7EY9XpB9gC4Q2vPlngi3f+AKK+VHS5TystsDQShJ5jJfGu7RUwh 2pUDAuoMUdFcV/DU1Sj9004rSgZ+WSuD07Q8flul0Y+Q53baWNwIwvohW4CZmG8UeuGa0N S59ehYDjGSYNOOFAXBuIYGiOG05wZfzoDGRJiQGFCb9nVLqLwKLBiSFQy6zTp0+Svx2QJb Mlmv22j6ZpchiXPvavnFMe2MbiM+uUAeJg+nNZSWTMwmagZ+7U52oTmfvfx2e6RMsdYApi yohHsdocm3UAbGfHrqCSRyj3Dagm6KG2jFpYT7SMY7kQyrmRZYOJVCPJlBb7nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v4Tx7bxJCSAM5wxqT4gt1PyRBFgPKHj7hITYDHGkIX4=; b=R58Mmy/F5d5zMxYEKEG287LHXDZtBkCTyqYUMy0ZyxdSFryPchOTSzK8ZpTuRKQhUcmasm 6XhROxU6bKYgx0FOLDrJl0uxCjBgUmcLuQ92wQ9H5C1y014S35u9UPBX6f96WVqvkVjy/W Q9zkGLZgVsc5u953ajSHki9w5ckrQN6Ma22naSRGyuRwB2wE+tjGQNwOFp9RXbbvJ7I25N Lln++9aX2AMyRB7r3z1V2wP0y+FHBCT1nvWGfNtBH+6mJfsQjxj7Xgnz26mV9G4S82fO1w KKqgCvNj3Uvq4G5ZNsGUB+ZbkWu3L1okWLuebO4XYoHCuq5ovvm2ighJzoru8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706822762; a=rsa-sha256; cv=none; b=c+xyd2JluGA9H6v/YbR/ushO4TOGHURT/rZIEtEVofkJL0646Ix8RdcT5bxOA3WBxVMhk4 2D0/maPo5gJhsGjv9rGlSfPLj1mtOL16GOGm60eGAsF5CoypT3hFQUUIGb5/7iWzWfTyuc P12prjsA51N/56gvO3oUUwY1+0nsYH69A91SAbE4/9maF8n4CX/sAyW1O0DeKpZFgSS1Nh 23XTXbj1pgfihCkjm8iNA9OyLYWn+4WeVSiD1pHX7ge2wnOxgO7RsuRGaIBke8YsUCPbQJ t2iIE3CmjZuQKBPVYBh0MyYAzGbmnjK2jLfMvmVQrwLba0GDC+43idkncNLR4g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsQd5CzSz1J4p; Thu, 1 Feb 2024 21:26: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 411LQ1OU070194; Thu, 1 Feb 2024 21:26:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 411LQ1f0070191; Thu, 1 Feb 2024 21:26:01 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:26:01 GMT Message-Id: <202402012126.411LQ1f0070191@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: fc7a8cb67754 - stable/13 - New login_getcapenum(): Allows to read named enum values List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fc7a8cb677544f64cf06ae9f6b6eb914808706b8 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=fc7a8cb677544f64cf06ae9f6b6eb914808706b8 commit fc7a8cb677544f64cf06ae9f6b6eb914808706b8 Author: Olivier Certner AuthorDate: 2023-06-20 16:41:32 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:22:52 +0000 New login_getcapenum(): Allows to read named enum values Reviewed by: emaste Approved by: emaste (mentor) MFC after: 3 days Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40684 (cherry picked from commit 90e914cd5ac1c8ecbf1ea88e9a65e7fa866c17a9) Approved by: markj (mentor) --- lib/libutil/login_cap.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ lib/libutil/login_cap.h | 2 ++ 2 files changed, 48 insertions(+) diff --git a/lib/libutil/login_cap.c b/lib/libutil/login_cap.c index 2b19218a8aaa..2e245d202815 100644 --- a/lib/libutil/login_cap.c +++ b/lib/libutil/login_cap.c @@ -764,6 +764,52 @@ login_getcapnum(login_cap_t *lc, const char *cap, rlim_t def, rlim_t error) return val; } +/* + * Extract a string capability expected to hold a specific value from a list. + * + * 'values' must be a NULL-terminated array of strings listing the possible + * values. + * + * A non-negative return code indicates success, and is the index of the value + * in 'values' the capability is set to. + * + * Negative return codes indicate an error: + * -4: 'lc' or 'cap' insufficiently initialized or not valid. + * -3: System error (allocation failure). + * -2: Capability not found or not a string. + * -1: Capability has a string value, but not one listed in 'values'. + */ +int +login_getcapenum(login_cap_t *lc, const char *cap, const char * const *values) +{ + int ret, i; + char *cand; + const char * const *val; + + if (lc == NULL || lc->lc_cap == NULL || cap == NULL || *cap == '\0') + return (-4); + + ret = cgetstr(lc->lc_cap, cap, &cand); + + if (ret == -1) + /* Cap not found. */ + return (-2); + else if (ret < 0) + /* System error (normally, allocation failure). */ + return (-3); + + ret = -1; + + for (i = 0, val = values; *val != NULL; val++) + if (strcmp(cand, *val) == 0) { + ret = i; + break; + } + + free(cand); + return (ret); +} + /* diff --git a/lib/libutil/login_cap.h b/lib/libutil/login_cap.h index 7312914900a8..0037b41d9055 100644 --- a/lib/libutil/login_cap.h +++ b/lib/libutil/login_cap.h @@ -110,6 +110,8 @@ const char **login_getcaplist(login_cap_t *, const char *, const char *); const char *login_getstyle(login_cap_t *, const char *, const char *); rlim_t login_getcaptime(login_cap_t *, const char *, rlim_t, rlim_t); rlim_t login_getcapnum(login_cap_t *, const char *, rlim_t, rlim_t); +int login_getcapenum(login_cap_t *lc, const char *cap, + const char * const *values); rlim_t login_getcapsize(login_cap_t *, const char *, rlim_t, rlim_t); const char *login_getpath(login_cap_t *, const char *, const char *); int login_getcapbool(login_cap_t *, const char *, int); From nobody Thu Feb 1 21:26:02 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsQg3KYwz58hCv; Thu, 1 Feb 2024 21:26: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 4TQsQf6n9fz4VvJ; Thu, 1 Feb 2024 21:26:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UpMvYhv9GV//F2+kABSrsM5hdHmftGb4uFWA9yfl+KM=; b=XTiimqampT/Vxb9npF29nYHSw+6vi+S2YLWbS53/MeoAfWDkGsX/LdK4OUdyRo9toUXfgE g6N3pIx5rlVKnFlBSz9/tOYHxSj92/X84NIbvFwF5TYQ0ktQdCs2S5MaL8eaPNSK4fTsLg 4lJFGz5TkBjcXoXZFvXRuMRQKsR9Kat3zcOW8S2jH3mbVbYGLN4pcQGWDZlF+vTz2s54zs 4vjD7/CVzrx4j3yvmXoygNvjO2uMVSe9mwqEAiDsYbVXAseXoMIRuLCjhmn1BBGmtJ87qp TWdNNZfJ2Xo2UOEDrVoPTfSBe9n/kR21hNfm27Q0AFs6/uj+SO86/+6gnmGBNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UpMvYhv9GV//F2+kABSrsM5hdHmftGb4uFWA9yfl+KM=; b=BNwenkcMn6rhDLLdst2xzLx3iqzpFpc/0gyVbHJTpB/jiPZtT/Q7JZ/MrChHjYjKJyZW+2 9i+HtvncQTkECGlusaROQuKfkqFKHOYGbYfmkKWobKfsReR7+JoebGYIISe43RtxEePIoi HYpo2cMKNC64HeFdIHRgzVHtWUh0hKWhHM8MLTKXPOqopKBsT22c+7V6vJhLf6XdUgSGxF WVAy1TViEPJ6J+RfzBe0TUVAFGJusu8SuRaoFj2/Sjc+QXq8A0+14I2Juj/5H38OpNI/d0 RRKGITPmlqRcrGutW/RL3jjgVvlkU1JoS2i4gTvlFcuQ5NorYSKIUvGBfUhFtQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706822762; a=rsa-sha256; cv=none; b=cgxOYYIGWufZHNfqHDbL2kzqt+c5lIm6D4bgkw6CYX/SvZhX/u4duKYpdB+8ejTepV/J1u Fa5uNxL3Dfre1sVqlY0bz6jclBn7lbtzTXsLy4aTF9EnE1g9d6B+sQJuTllB0XXh0R6X6H JghtK/xoU4qWlSGKRJU48+64vAaF3xvd/l+39OXQQKAEzUaCHj1z1951RLkq1pwKF2O98U 9WcZuYQh83Nzr7fvZ8U2+qDJThKr+s6AaCFIzMFjh4wX6S2aX38OGKrQN8+1kPCaw+L0u6 8jJjPkoiZQyHz+FPeXZ5nSgxO6AF6e36Dm7ddg5QmzXxPKSZs88IHUtRJA9dMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsQf5syRz1HbN; Thu, 1 Feb 2024 21:26: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 411LQ2rV070237; Thu, 1 Feb 2024 21:26:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 411LQ2RE070235; Thu, 1 Feb 2024 21:26:02 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:26:02 GMT Message-Id: <202402012126.411LQ2RE070235@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: 6ceb32fa4a2c - stable/13 - login_cap(3): Document login_getcapenum() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6ceb32fa4a2ce53e5dac1b4a5208ddc600ecf20d Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=6ceb32fa4a2ce53e5dac1b4a5208ddc600ecf20d commit 6ceb32fa4a2ce53e5dac1b4a5208ddc600ecf20d Author: Olivier Certner AuthorDate: 2023-06-20 20:09:57 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:22:58 +0000 login_cap(3): Document login_getcapenum() Reviewed by: emaste Approved by: emaste (mentor) MFC after: 3 days Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40685 (cherry picked from commit 97256feb7a65cccac51a03846c5308894a2cb445) Approved by: markj (mentor) --- lib/libutil/login_cap.3 | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/lib/libutil/login_cap.3 b/lib/libutil/login_cap.3 index 0281c8428ed5..86142c3b19f9 100644 --- a/lib/libutil/login_cap.3 +++ b/lib/libutil/login_cap.3 @@ -25,6 +25,7 @@ .Nm login_getcapbool , .Nm login_getcaplist , .Nm login_getcapnum , +.Nm login_getcapenum , .Nm login_getcapstr , .Nm login_getcapsize , .Nm login_getcaptime , @@ -60,6 +61,8 @@ .Fn login_getcaptime "login_cap_t *lc" "const char *cap" "rlim_t def" "rlim_t error" .Ft rlim_t .Fn login_getcapnum "login_cap_t *lc" "const char *cap" "rlim_t def" "rlim_t error" +.Ft int +.Fn login_getcapenum "login_cap_t *lc" "const char *cap" "const char * const *values" .Ft rlim_t .Fn login_getcapsize "login_cap_t *lc" "const char *cap" "rlim_t def" "rlim_t error" .Ft int @@ -459,6 +462,31 @@ If the given capability tag cannot be found, the parameter is returned, and if an error occurs, the .Fa error parameter is returned. +.It Fn login_getcapenum +This function returns whether the searched capability is a string with value +among a predefined set passed in argument +.Fa values +as a NULL-terminated array of strings. +.Pp +A non-negative value indicates a match and is the index of the capability's +value in array +.Fa values . +Other possible return values are: +.Bl -tag -width "-4" +.It -4 +Returned if +.Fa lc +or +.Fa cap +are insufficiently initialized or invalid. +.It -3 +Returned on allocation failure (out of memory). +.It -2 +Returned if the capability isn't specified or its value is not a string. +.It -1 +Returned if the capability is specified and a string but its value is not among +.Fa values . +.El .It Fn login_getcapsize .Fn login_getcapsize returns a value representing a size (typically, file or memory) From nobody Thu Feb 1 21:26:03 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsQh35MRz58hK8; Thu, 1 Feb 2024 21:26: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 4TQsQh0z41z4W5S; Thu, 1 Feb 2024 21:26:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822764; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/ih32X/rGL+7kioNBcLjXf6MJJRQ8MIGvTf10rEy4ho=; b=pKAlPo/iL/X4g/T/531BOiEZugQxNDW9BfX8Nv2iNX1sDt+CsPrbuy/8hJ27r6GocR5oXZ YzOsoMhnFZu+/1qU815uM33f3biYjIvlSHlzYhJCE913SlU9tCpFz5O0r8QNHjKnYSQECS HPbUMAIW6jTjWaTbb6DedTAwyRrqZ5ifiKlNKpD1/z5XBM1nOsaWvPVSPpUd+V5rs0Jdv8 MKPERVhxr+eoX7RfmEg8ZbDoAn/gW8VNZgvZfiNoSKeD2o4DfrOMMrAj1HqAG1Ekyo4yKo fFvP560jS4NSxlkPA95QzceCKPiPkVN/n6jseM1kOrz54N4GCSN8jD7/HAs5xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822764; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/ih32X/rGL+7kioNBcLjXf6MJJRQ8MIGvTf10rEy4ho=; b=hI39/sSvFmrW+jbkCiNcYuqvmgJBM+b0UTiwCSvXkeHaskLZD6SOakYICgbJg9A0YZrnHA 7wo2yZ/6m33717/eJzwLM0zdKqqNPl0uo3cShXcWkzePEWemb8RLz/Go7qfFIs6chzmoSW gmabupdrZg9Tox8IhKMNgxribXNdHY66EulIbwFZiunIs41pQoulyQDhGCvvosSJ54L/U/ ULAf6qkUSftR2+ZPrwuZ57P6d0T4RiHG/G4+Hk/GH+8CNvmMyyGghnjGmJ/Tle6ejuJkwI eAGmK+eAyMyDrJ+9WjX7gp2mAkizVa0r9bEZIcrUf05mNy1zZOwQ2soHGOBNoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706822764; a=rsa-sha256; cv=none; b=w4Dl2twlVBCpus4Z+dcrHzxeK49/c8wk/GfYUdDsdqdIAs40Y8nR5/gMKhhu7uI0uhyNED CymiUt3Xr5rgzOBwsBNCau+KCYUNcdjVOaUn7/nfRotpXlCGh5q/Nqkns0U26Yo22amGVD jeJQhzBgijcuVM0xeZw4QnjFXrm4N5cNwXxP9EtX0jOSGO5RAUHadt83kt2myXcWe+LL2k 6/mbRxnxQF9dWc1oUoNl1Xb8W2hbxv1NQJfRSO+atGPBnwINSBUjiYkbEQ6kklNgsogWtU pFXLhHT0g5F+/fLGcz7FwGfp67p8GqSwD/FPA3KQ2iaEO5n58iRZCJVOckL9zA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsQg6vk7z1HMD; Thu, 1 Feb 2024 21:26: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 411LQ3fG070292; Thu, 1 Feb 2024 21:26:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 411LQ3Yt070289; Thu, 1 Feb 2024 21:26:03 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:26:03 GMT Message-Id: <202402012126.411LQ3Yt070289@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: ffd3cd7c6d86 - stable/13 - setusercontext(): Set umask in a separate function, setclassumask() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ffd3cd7c6d861b3a4a4a91f5301ba37e0ac20f67 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=ffd3cd7c6d861b3a4a4a91f5301ba37e0ac20f67 commit ffd3cd7c6d861b3a4a4a91f5301ba37e0ac20f67 Author: Olivier Certner AuthorDate: 2023-06-20 16:46:31 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:23:04 +0000 setusercontext(): Set umask in a separate function, setclassumask() Reviewed by: emaste Approved by: emaste (mentor) MFC after: 3 days Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40686 (cherry picked from commit 0dd1705f584947625892988afe59e4cedb5cdd09) Approved by: markj (mentor) --- lib/libutil/login_class.c | 59 ++++++++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 26 deletions(-) diff --git a/lib/libutil/login_class.c b/lib/libutil/login_class.c index 2b85425d8d8e..69230db32961 100644 --- a/lib/libutil/login_class.c +++ b/lib/libutil/login_class.c @@ -381,6 +381,37 @@ setclasscontext(const char *classname, unsigned int flags) } +/* + * Private function setting umask from the login class. + */ +static void +setclassumask(login_cap_t *lc, const struct passwd *pwd) +{ + /* + * Make it unlikely that someone would input our default sentinel + * indicating no specification. + */ + const rlim_t def_val = INT64_MIN + 1, err_val = INT64_MIN; + const rlim_t val = login_getcapnum(lc, "umask", def_val, err_val); + + if (val != def_val) { + if (val < 0 || val > UINT16_MAX) { + /* We get here also on 'err_val'. */ + syslog(LOG_WARNING, + "%s%s%sLogin class '%s': " + "Invalid umask specification: '%s'", + pwd ? "Login '" : "", + pwd ? pwd->pw_name : "", + pwd ? "': " : "", + lc->lc_class, + login_getcapstr(lc, "umask", "", "")); + } else { + const mode_t mode = val; + + umask(mode); + } + } +} /* * Private function which takes care of processing @@ -394,32 +425,8 @@ setlogincontext(login_cap_t *lc, const struct passwd *pwd, unsigned long flags) if (flags & LOGIN_SETRESOURCES) setclassresources(lc); /* See if there's a umask override */ - if (flags & LOGIN_SETUMASK) { - /* - * Make it unlikely that someone would input our default sentinel - * indicating no specification. - */ - const rlim_t def_val = INT64_MIN + 1, err_val = INT64_MIN; - const rlim_t val = login_getcapnum(lc, "umask", def_val, err_val); - - if (val != def_val) { - if (val < 0 || val > UINT16_MAX) { - /* We get here also on 'err_val'. */ - syslog(LOG_WARNING, - "%s%s%sLogin class '%s': " - "Invalid umask specification: '%s'", - pwd ? "Login '" : "", - pwd ? pwd->pw_name : "", - pwd ? "': " : "", - lc->lc_class, - login_getcapstr(lc, "umask", "", "")); - } else { - const mode_t mode = val; - - umask(mode); - } - } - } + if (flags & LOGIN_SETUMASK) + setclassumask(lc, pwd); /* Set paths */ if (flags & LOGIN_SETPATH) setclassenvironment(lc, pwd, 1); From nobody Thu Feb 1 21:26:04 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsQj4mdSz58hG2; Thu, 1 Feb 2024 21:26: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 4TQsQj259kz4WB7; Thu, 1 Feb 2024 21:26:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822765; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JCS/vocxEo5sQ9yJtKVW5KpaXpNMU0zbbcljCCKWQDM=; b=fPoUE2+us9gubcHLVrCFTKDTCQzbg509ocP0JGVihnQ/ynEL/fOoOc5wnKcZt6l2CZ6EjF fnKWuksW4BLLcJnvRgwUY9TFmsXy47WZbwa1Tf16jylxIxqDh0XIBz1A3hTDnzwAa2xSsA WPlhaKwYEH61F80ZHXGTxl3CG1wCN8lAvqqxvXeDYlAiNubyfDC4tCEkdza1uqQf4CaWRl cCLD3K9fRAnqHnjUkG9h8xSLeji4d0Gd2y3Z8VWa2JJ+LQjFWnVLfI2bZZBL0p+wkcW7yW LagQjNpM78UMQkwk0Rbl9Es7bgz9TgItgFdGc5YL2sMNt/2QIgxV02NFOVKKfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822765; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JCS/vocxEo5sQ9yJtKVW5KpaXpNMU0zbbcljCCKWQDM=; b=LiwYqpUiK9wUHymbQLc9ClYNTjTfs8F6kfINrPfUf/3ajcHonp6ioOx0Yu7Xp9Z2lpXv2H zNnrKRwsr3AbSNgv59l8bQ1AdNXd2+WOTXpjW9CegaVamsEkETIeZgWsPNJicl3IDxTG7H pw3JTNLbNsfrrKeht6gn5YvLBXiDsq13721cduxj7ThlmJL+Pw7HKrJxrU7shj74d3lNf1 8PNJhRLf+E8oJpTqEgg5otKaaz5ZUsprCNeDAwcMfXidKjgChMnDx6mzyX9p6kE/cDABuK zT4+Izjiaf4Si3v6ZCU6F91qzz8WBtKkshOciVRIihwZS4gUH+0r/zvNHON+TA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706822765; a=rsa-sha256; cv=none; b=gJ/qsbvsrilR2/KrdyuuWjvQoLjEQhTP9W1r3wTcqpzAfvE2zRMaZ7R27q9/J5EeYb+IG6 FWhtTAuNtmquT9iIJc3Xp9pIjH1sWiIKDIdRO/HYsmLnsUbWfyUVQRarj86XUZG87aIU5N ZI/Rc7nNkxJlQ5Na++jSOrB6XXEteqQDkWAZRN1t0Khu867FMuRqDsEvrxJZtNzCjzCb6g c6C1Lk8p8E0uG3R9BzkGWJs0khyoO6BGLg2dm8/aUDXhgNIeEwVzi0ey8XFTX964Soflez z8NhQPUM4IdsA45eDpUnC2cQLIgnwMM+bRaeFmQePqIwAHPLcKR9Xkah0h3PKw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsQj0R88z1J4q; Thu, 1 Feb 2024 21:26: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 411LQ5uV070338; Thu, 1 Feb 2024 21:26:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 411LQ4gA070335; Thu, 1 Feb 2024 21:26:04 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:26:04 GMT Message-Id: <202402012126.411LQ4gA070335@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: 16e02df98ad6 - stable/13 - setclassumask(): Accept 'inherit' as a value List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 16e02df98ad64753fed6ab73c1d1c2aa857b6394 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=16e02df98ad64753fed6ab73c1d1c2aa857b6394 commit 16e02df98ad64753fed6ab73c1d1c2aa857b6394 Author: Olivier Certner AuthorDate: 2023-06-20 19:41:04 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:23:11 +0000 setclassumask(): Accept 'inherit' as a value 'inherit' explicitly indicates that the umask should not be changed. Reviewed by: emaste Approved by: emaste (mentor) MFC after: 3 days Relnotes: yes Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40687 (cherry picked from commit c328e6c6ccaa4cdf921c16d68a2f2c5992dd3b72) Approved by: markj (mentor) --- lib/libutil/login_class.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/libutil/login_class.c b/lib/libutil/login_class.c index 69230db32961..e6485afade43 100644 --- a/lib/libutil/login_class.c +++ b/lib/libutil/login_class.c @@ -381,6 +381,11 @@ setclasscontext(const char *classname, unsigned int flags) } +static const char * const inherit_enum[] = { + "inherit", + NULL +}; + /* * Private function setting umask from the login class. */ @@ -392,7 +397,13 @@ setclassumask(login_cap_t *lc, const struct passwd *pwd) * indicating no specification. */ const rlim_t def_val = INT64_MIN + 1, err_val = INT64_MIN; - const rlim_t val = login_getcapnum(lc, "umask", def_val, err_val); + rlim_t val; + + /* If value is "inherit", nothing to change. */ + if (login_getcapenum(lc, "umask", inherit_enum) == 0) + return; + + val = login_getcapnum(lc, "umask", def_val, err_val); if (val != def_val) { if (val < 0 || val > UINT16_MAX) { From nobody Thu Feb 1 21:26:06 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsQk4XbMz58hTl; Thu, 1 Feb 2024 21:26: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 4TQsQk2Ms8z4WBH; Thu, 1 Feb 2024 21:26:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822766; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZYyAV5wf8cyf3yudOHao2r4S5hjx6kR8Kizs9D4ZvYg=; b=PQsKcqs8FxgGhnnd8emfyUl/XIPF/5x3nbz+LEBzNr0RmTXM3ZZ8d5ksQSOpTiE0VZOFjP SnaLQX68rMqoX/XU9aXXF7GMhrQsZk+6kjyq/D8yYP3Ib3UhX8GOWmsD7hR156AtyhLpTY /kq25IDY2MiAsgsvcw/GCgNzGvZXNfZT30E9xxp4un3Gd3+zz0SOWfbBx2UIH8HXY2dypS ymI6diuzkXbDZ4BCJMiwOAAsRGKhTYSqM0krbZo8LCGZZntQ42h3Vb+KKzx6GFTJCg9qG1 HkYvmQTwlNE9ATizHyNylA20F1woEf+7Cd+3sakapad7TNyl4CdxfgMWy1d/Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822766; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZYyAV5wf8cyf3yudOHao2r4S5hjx6kR8Kizs9D4ZvYg=; b=XJdaPfZt69T5NJanUADi8Zr4RPapzxV6oldejPxC6YkBLx0BAFEHWfrNnQmkKfjNo+/oRj W92m7DtlHUl2hxG7VZu3VA1Lz0kp+XV3RVWhhHRBjPBd8rECAfGp1rAfecGGaMitT4hFja wBeARs5eKVYyHsgayrG4pT9MIz1rqYbZt//GEbWf5c5LTIg+sOai5IyBSUrBVkpm/oBPrN wfE/ADT6mwC92CNknRrav8h2A/QxIp/uFDeO5loC5+stUU149mTD0B0b/XOLeybObV3dvB g7xxshaPVx9pcOKu2SD+1sNH40D5STfoizVUFVUbTbaqV2XmVy4yWk7326eXEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706822766; a=rsa-sha256; cv=none; b=rIagxpiRwr5gYDYDYm/5bUzXWFuEMwirwFarYdKtJsBlI+EZrMaVX5RNKu1yK2MeOaykQ3 8hg/hMabGJDYir4YUKpE2bRgUWslAqwXcyeU7RhOJDjhvskFpydzWjg09S7rt6WB3aaV/6 flq/gDE4dWPIq0pSMp1PKakuUCJ2Aguq/D5OgvBKNihkQnOgXUamwGHi0onu5c8koDIlrn kf3mH7a1gbL2LQmaYgD7ZwCq7UwOTj3vimfRcF7Dw9OW4Dk22D+74K8BgndAPyVKQqi3yY wocRISsIQgRQuyztc7/AqMHdL5NBxjv6sUxeVp6HXBnyyWejR3pbHqNxNozFwA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsQk1SrKz1HbP; Thu, 1 Feb 2024 21:26: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 411LQ6CO070383; Thu, 1 Feb 2024 21:26:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 411LQ6BT070380; Thu, 1 Feb 2024 21:26:06 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:26:06 GMT Message-Id: <202402012126.411LQ6BT070380@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: 569f0eb3f259 - stable/13 - login.conf(5): Document umask's special value 'inherit' List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 569f0eb3f259d9870429c8b014154dea728e5f00 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=569f0eb3f259d9870429c8b014154dea728e5f00 commit 569f0eb3f259d9870429c8b014154dea728e5f00 Author: Olivier Certner AuthorDate: 2023-06-21 08:42:44 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:23:17 +0000 login.conf(5): Document umask's special value 'inherit' Reviewed by: emaste Approved by: emaste (mentor) MFC after: 3 days Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40688 (cherry picked from commit ea9bd448102b938ccb8d4b484684a6ba2d934931) Approved by: markj (mentor) --- lib/libutil/login.conf.5 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/libutil/login.conf.5 b/lib/libutil/login.conf.5 index 7449c11f2ba5..b2478bb7a88c 100644 --- a/lib/libutil/login.conf.5 +++ b/lib/libutil/login.conf.5 @@ -255,6 +255,9 @@ from other means. .It "timezone string Default value of $TZ environment variable." .It "umask number Initial umask. Should always have a leading 0 to" ensure octal interpretation. +Special value +.Ql inherit +explicitly indicates not to change the umask. .It "welcome file /etc/motd File containing welcome message." .El .Sh AUTHENTICATION From nobody Thu Feb 1 21:26:07 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsQl4ffxz58hNw; Thu, 1 Feb 2024 21:26: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 4TQsQl3cCyz4WN6; Thu, 1 Feb 2024 21:26:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822767; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9nBw+/jFvecV8IcIm5IqaooND63LV7y8YSdGssr6PNU=; b=tMqfCrUwqnKiZXN9BuIStyC08UWrM2et603HoO9LMDRkjHKaEHiPxvvbhigyipsuhAzNXP hAYXXIvnOUZKun/NoxwxHzuy5kVdA5yuSjC6NzMaI+wrPmuZvNJFR4p7XcIVx8gWUB6EMe rBeAghPViKVXAC6AxBmP5OqKZzQOURR7hnmgoG7lKP5ZoKSJRe2Upywi/OF9qo7dFM1eQ8 fTBJYHm0xM/Sb4wk15LIVtPu1arkU+2s5ilD/KP1Pp7u1p01fe//2EGzHoVOh4jb0YCaSE 3jRc67c9aBohAgu43y803J/XuNoRBIEgZp4iRfLIb1r+Ki7F2CmnI25ooWSchw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822767; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9nBw+/jFvecV8IcIm5IqaooND63LV7y8YSdGssr6PNU=; b=RQiawE1LR8epgXPPux3Ntvpk0KUuEmLmR9gFxA9V7eA45Rp0k9xZnVuLafy7pKyiv9QDuc /g5E31hm527fyi3cqCq4XPDS3Vai5eaHdF0Bd+CWz7fmJzqlovhj5i1SvqTcKlxK2D6R5U R9xJqeGdFww6kh0i6di08Yi49a1p4sNSd0mffv6hxOz/15lRMg5QYctAAuWjcnKstxaEMQ wOMYsS5hJCme+SkxmXUPazR14vLvvOrzDjMjpbRyY6poP+URMrsbzNFZYofcNnPkaV6hye WkZLEn8A6wGt+DZIK0YiyBf5V4S0Qy9u07+78/H0LEmwBaDIe+HBJcsX5/Cc6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706822767; a=rsa-sha256; cv=none; b=dtUWP/PmoPraMF+9C1xfqo3mi2ZepYlOkqt9b3aiSB1/xheXPx1DaOP2AWNKeDkRQQ+iKx xo7gL3tBY1xVf9r9qjDzHjgKkgH54t8cI82HPWxFoRyB3YuZJqedKJHMJaGFC2KSzQR04E DJq4tM+vsMnNZWCcVg2RGXdKcp++tWkPhnVQfqtf04uCIFCj92/AVj6PJgZE3pGbaLOSfZ Cngq7yjuUfkHGIT3SgWd4s20MSAP0TXo2g8ejlSg2REzwqzedpLBLjLDt3gSornxsGebSx RrPpTInADzAq80FUM1318zS3GsECN1LKWFYCRuOwUYoT2NjlqFA6XPX1ztkVkw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsQl2kCpz1HbQ; Thu, 1 Feb 2024 21:26: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 411LQ7eF070423; Thu, 1 Feb 2024 21:26:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 411LQ7Ab070420; Thu, 1 Feb 2024 21:26:07 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:26:07 GMT Message-Id: <202402012126.411LQ7Ab070420@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: 6843f1c2ef08 - stable/13 - setlogincontext(): Comply to style(9) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6843f1c2ef08822dab352101decb69f9f6e1cae8 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=6843f1c2ef08822dab352101decb69f9f6e1cae8 commit 6843f1c2ef08822dab352101decb69f9f6e1cae8 Author: Olivier Certner AuthorDate: 2023-05-25 14:29:22 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:23:23 +0000 setlogincontext(): Comply to style(9) Remove indentation by inverting the big 'if (lc)' and using 'return'. Use explicit binary operators to produce booleans. Reviewed by: emaste, kib, dchagin Approved by: emaste (mentor) MFC after: 3 days Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40346 (cherry picked from commit 771d5c93ab5a3fb1701d9706df2ce87d6a9da6f3) Approved by: markj (mentor) --- lib/libutil/login_class.c | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/lib/libutil/login_class.c b/lib/libutil/login_class.c index e6485afade43..33a2189277ca 100644 --- a/lib/libutil/login_class.c +++ b/lib/libutil/login_class.c @@ -431,23 +431,28 @@ setclassumask(login_cap_t *lc, const struct passwd *pwd) static void setlogincontext(login_cap_t *lc, const struct passwd *pwd, unsigned long flags) { - if (lc) { - /* Set resources */ - if (flags & LOGIN_SETRESOURCES) - setclassresources(lc); - /* See if there's a umask override */ - if (flags & LOGIN_SETUMASK) - setclassumask(lc, pwd); - /* Set paths */ - if (flags & LOGIN_SETPATH) - setclassenvironment(lc, pwd, 1); - /* Set environment */ - if (flags & LOGIN_SETENV) - setclassenvironment(lc, pwd, 0); - /* Set cpu affinity */ - if (flags & LOGIN_SETCPUMASK) - setclasscpumask(lc); - } + if (lc == NULL) + return; + + /* Set resources. */ + if ((flags & LOGIN_SETRESOURCES) != 0) + setclassresources(lc); + + /* See if there's a umask override. */ + if ((flags & LOGIN_SETUMASK) != 0) + setclassumask(lc, pwd); + + /* Set paths. */ + if ((flags & LOGIN_SETPATH) != 0) + setclassenvironment(lc, pwd, 1); + + /* Set environment. */ + if ((flags & LOGIN_SETENV) != 0) + setclassenvironment(lc, pwd, 0); + + /* Set cpu affinity. */ + if ((flags & LOGIN_SETCPUMASK) != 0) + setclasscpumask(lc); } From nobody Thu Feb 1 21:26:08 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsQn17Msz58hKH; Thu, 1 Feb 2024 21:26: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 4TQsQm4Tnzz4W1F; Thu, 1 Feb 2024 21:26:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822768; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=11MNRV76Z/twB5G1MOgIVw/42aWHz2dwDBCAG4gzq24=; b=I7x4bA9mNLF43aUCIOB6Y4kx5rYvgNTruc8Iho/UeV3+wseogfpFipvCFI1BuNFt/syLno xncep4evQtw0NhNWfg073Az6h9RRTrwev2yi7rlQ0ZJJEjlL+9KD4jRSQlJfIYegg3MhKI g69jt/io0fQ5yXU8HKxDnb6kAS9WEnn+aKAMtk8gwobigq1blqWEsmfsVDw4h6MZ0JjoVR IbT+hL10z8PqDkOuKsL9XaAy+Ec78XrG8gj6XYJCfdtYyYQR4rZm2N78YfsnEtX9txkzrn nXtkhZXNZWBeoE+0X9TNczU46jtKuvZ8EAjJRag6ivoI13LkAS15OGa/MJMDfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822768; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=11MNRV76Z/twB5G1MOgIVw/42aWHz2dwDBCAG4gzq24=; b=Iu8ATBSmu0vHANJq+QEo+1J2NvRn49RocMFSmk0zJ3cSyENzjIFMLNczCb6T8lQ0nwyZDI NLizaKUCBwXDIRR/umtrIBe07aN3CbADpwwlNax1azqV/vW4v4PXzh9xIfFs0ZgEMfY5NB C0YMuonCN6dgv8Ra/6XYlvYjsaCVDTs5L+mof/UchRrN7+cE1JchaaaBXrtRXrJzllqeWb 008HcsyrX3ygh9NVRiN/CB2YJVqfeQXqJWdIYMbh0wlrTCAfsOi7fXrQ87/PEW3A5oE5ZC s7TtDS9SQkNJNj0lityrRb1H19xteDl3jVe9lW/6OE4u1L7A8/CKWg4kiYp9gg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706822768; a=rsa-sha256; cv=none; b=R3b79LSBk0ZIIrAVE6N+Gp/CGNVdYmV+t4ZX0gGL1S/NyvKwfAAI5/qvadF1iu0aBot8jA 1Sp8dkGVk9c1zicNpxHYh6TcEJo3CQ+KqUEnEzkxUDwKpxfZMmkXzfsoi0UmDBoDewVqRY 5hAcff+dnHDZl6keMGwbE2qcLljjpYzLJDY+Gik63Lcik0Wtp+dkPblhmsI0Cma8ezRpaV FiVDmeKrLMq3Qp7CWdFsydiLFzkh5rVAZo/9MsYTwXRZbh/OepLH+sSDUm7WC0ox62H9bY VGkAsP9n3dwrBByRs9d/at/THuGMctjlNoLzbcYIGvrgdUzY7gwCjG5V9rK6kw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsQm3W1Rz1J4r; Thu, 1 Feb 2024 21:26: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 411LQ81l070486; Thu, 1 Feb 2024 21:26:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 411LQ8tu070483; Thu, 1 Feb 2024 21:26:08 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:26:08 GMT Message-Id: <202402012126.411LQ8tu070483@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: 8f4c3ef048e3 - stable/13 - login.conf(5): Default values: Rename column, elaborate on absence of such List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8f4c3ef048e3cc6df1d1648b431ccb6b383b3bb3 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=8f4c3ef048e3cc6df1d1648b431ccb6b383b3bb3 commit 8f4c3ef048e3cc6df1d1648b431ccb6b383b3bb3 Author: Olivier Certner AuthorDate: 2023-05-29 14:06:37 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:23:30 +0000 login.conf(5): Default values: Rename column, elaborate on absence of such Column "Notes" in fact only contains default values for capabilities, so make this clear by renaming it to "Default". Add a small introductory text mentioning it, and what an absence of default value means (inheritance). PR: 271748 Reviewed by: emaste Approved by: emaste (mentor) MFC after: 3 days Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40347 (cherry picked from commit 92b2c4358f57ef84f161efd8370ba4832bd9261a) Approved by: markj (mentor) --- lib/libutil/login.conf.5 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/libutil/login.conf.5 b/lib/libutil/login.conf.5 index b2478bb7a88c..35ca11452811 100644 --- a/lib/libutil/login.conf.5 +++ b/lib/libutil/login.conf.5 @@ -181,9 +181,15 @@ are considered infinite values. The usual convention to interpolate capability entries using the special .Em tc=value notation may be used. +.Pp +Default values are specified in the +.Ql Default +column. +If there is no default, the value is inherited from the process setting up the +login environment. .Sh RESOURCE LIMITS .Bl -column pseudoterminals indent indent -.It Sy "Name Type Notes Description" +.It Sy "Name Type Default Description" .It "coredumpsize size Maximum coredump size limit." .It "cputime time CPU usage limit." .It "datasize size Maximum data size limit." @@ -209,7 +215,7 @@ The maximum and current limits may be specified individually by appending a -max or -cur to the capability name. .Sh ENVIRONMENT .Bl -column ignorenologin indent xbinxxusrxbin -.It Sy "Name Type Notes Description" +.It Sy "Name Type Default Description" .It "charset string Set $MM_CHARSET environment variable to the specified" value. .It "cpumask string List of cpus to bind the user to." @@ -262,7 +268,7 @@ explicitly indicates not to change the umask. .El .Sh AUTHENTICATION .Bl -column passwd_prompt indent indent -.It Sy "Name Type Notes Description" +.It Sy "Name Type Default Description" .\" .It "approve program Program to approve login. .It "copyright file File containing additional copyright information" .It "host.allow list List of remote host wildcards from which users in" @@ -406,7 +412,7 @@ The following capabilities are reserved for the purposes indicated and may be supported by third-party software. They are not implemented in the base system. .Bl -column host.accounted indent indent -.It Sy "Name Type Notes Description" +.It Sy "Name Type Default Description" .It "accounted bool false Enable session time accounting for all users" in this class. .It "auth list passwd Allowed authentication styles." From nobody Thu Feb 1 21:26:09 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsQp0NNYz58hP2; Thu, 1 Feb 2024 21:26: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 4TQsQn5cxYz4WK0; Thu, 1 Feb 2024 21:26:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822769; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TnUK5IGKPHL9nQQEGMLyoFB3rA6ldgZUCPBz7P7aHqA=; b=NgP/WglNzqoYkZhrmjNl3WPbVoPMWBaCF0J7e2XuqFcFOW12SaqrxU62w8mT0BTRoDjd8F 3Zpo2VFHNapmdyhORnIclG7j12B37zj4ayNl/RxGveC7OdU9W2OZKWGXV6RGSBEp14aJOr vT3GT8QMhanGRzoqR9TM8X6i2iE/yEJ2hX548sq2B2k9i8jU+Xdlgpwpri5MSN09Gsbou1 ScWyh+b8h16e/vfQyK9ft6mo57OsjBPMHxnNKZtEb7Zv3Z8pJd2W0woB0y+NV/M34GhjV5 KTniVFmHd8JCw4HuaPiUkEFZX23XjXdcA+HrbJezSyvBjnEc5T2VI24UTwaP6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822769; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TnUK5IGKPHL9nQQEGMLyoFB3rA6ldgZUCPBz7P7aHqA=; b=MowkToBohpm9UtaqhySqu6LZatRgxulAMYDSaVx7SwCjI7aGPdXZmTrIRZ0CLIjVH9RRCO +NA0cmK+Y8ziGS7fD9j8U7wAKBmJVgUhBopaxYYjV5SulRTG85atY/us63Cdhg4qkwIwXQ /4l9sFp7TPhPWOMvqBtb3QWehC/fJpcS5RA7li3Pvihy+GdND5fFeV2igY6IwEBFs8OGsh vpX6sB8EY8DeXy9LaE6OLWYyq2vvSkLeYxnyjLsvNSAIHGUeYMZvBi1c5lhZZIjKRfZrjG jOLoDCzHD6wFtxe2muTpvQ4Z3ycDk4HggDp/Qx6JrPn7ZlUMdRWy4o5HLxF6xg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706822769; a=rsa-sha256; cv=none; b=sxBIzBzeW9ZDw4IHD700sd+B1906hKBrRLvu0agqLIahGyhM0Pjs64/JhwG89wHpStbfpG cwEIjuJu+LCjWH3XY8s6lVOSIGxF4wqD+8ZzEvUV0CT7KCBZfRhBP8Il7xEUjm5H8vqKGc kB3GxYb4psEqyWzV5GgJzFktMA3DNsSBGP6O7BhKX7iPv7Oa98O2HGgn3N1MTV5S0K0Ii9 uu80I+R1vlj6j/NiBfZbZ8SoKiFfsZwBgUGpdS4O9DoVK8uJiN14utAF/ioyBSJJ5Cas3H npPQRMAqAfps331KdWPOLrRIWaTGtdQMwEGcChtT+2y8aPT+R8ATlCo5q3PY/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 4TQsQn4hlcz1HgR; Thu, 1 Feb 2024 21:26: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 411LQ9AS070545; Thu, 1 Feb 2024 21:26:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 411LQ9PT070542; Thu, 1 Feb 2024 21:26:09 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:26:09 GMT Message-Id: <202402012126.411LQ9PT070542@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: 0a366bb44e65 - stable/13 - setusercontext(): Better error messages when priority is not set correctly List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0a366bb44e65efeed9568b47c673ddc648a4d7e2 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=0a366bb44e65efeed9568b47c673ddc648a4d7e2 commit 0a366bb44e65efeed9568b47c673ddc648a4d7e2 Author: Olivier Certner AuthorDate: 2023-05-29 16:39:04 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:23:37 +0000 setusercontext(): Better error messages when priority is not set correctly Polish the syslog messages to contain readily useful information. Behavior of capability 'priority' is inconsistent with what is done for all other contexts: 'umask', 'cpumask', resource limits, etc., where an absence of capability means to inherit the value. It is currently preserved for compatibility, but is subject to change on a future major release. Reviewed by: emaste, kib (older version) Approved by: emaste (mentor) MFC after: 3 days Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40349 (cherry picked from commit d988621b0c25209866ed5a98b1a8b20269935761) Approved by: markj (mentor) --- lib/libutil/login_class.c | 51 +++++++++++++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/lib/libutil/login_class.c b/lib/libutil/login_class.c index 33a2189277ca..9c3285736f3b 100644 --- a/lib/libutil/login_class.c +++ b/lib/libutil/login_class.c @@ -474,9 +474,7 @@ setlogincontext(login_cap_t *lc, const struct passwd *pwd, unsigned long flags) int setusercontext(login_cap_t *lc, const struct passwd *pwd, uid_t uid, unsigned int flags) { - rlim_t p; login_cap_t *llc = NULL; - struct rtprio rtp; int error; if (lc == NULL) { @@ -493,30 +491,49 @@ setusercontext(login_cap_t *lc, const struct passwd *pwd, uid_t uid, unsigned in /* Set the process priority */ if (flags & LOGIN_SETPRIORITY) { - p = login_getcapnum(lc, "priority", LOGIN_DEFPRI, LOGIN_DEFPRI); + const rlim_t def_val = LOGIN_DEFPRI, err_val = INT64_MIN; + rlim_t p = login_getcapnum(lc, "priority", def_val, err_val); + int rc; + + if (p == err_val) { + /* Invariant: 'lc' != NULL. */ + syslog(LOG_WARNING, + "%s%s%sLogin class '%s': " + "Invalid priority specification: '%s'", + pwd ? "Login '" : "", + pwd ? pwd->pw_name : "", + pwd ? "': " : "", + lc->lc_class, + login_getcapstr(lc, "priority", "", "")); + /* Reset the priority, as if the capability was not present. */ + p = def_val; + } if (p > PRIO_MAX) { + struct rtprio rtp; + rtp.type = RTP_PRIO_IDLE; p += RTP_PRIO_MIN - (PRIO_MAX + 1); rtp.prio = p > RTP_PRIO_MAX ? RTP_PRIO_MAX : p; - if (rtprio(RTP_SET, 0, &rtp)) - syslog(LOG_WARNING, "rtprio '%s' (%s): %m", - pwd ? pwd->pw_name : "-", - lc ? lc->lc_class : LOGIN_DEFCLASS); + rc = rtprio(RTP_SET, 0, &rtp); } else if (p < PRIO_MIN) { + struct rtprio rtp; + rtp.type = RTP_PRIO_REALTIME; p += RTP_PRIO_MAX - (PRIO_MIN - 1); rtp.prio = p < RTP_PRIO_MIN ? RTP_PRIO_MIN : p; - if (rtprio(RTP_SET, 0, &rtp)) - syslog(LOG_WARNING, "rtprio '%s' (%s): %m", - pwd ? pwd->pw_name : "-", - lc ? lc->lc_class : LOGIN_DEFCLASS); - } else { - if (setpriority(PRIO_PROCESS, 0, (int)p) != 0) - syslog(LOG_WARNING, "setpriority '%s' (%s): %m", - pwd ? pwd->pw_name : "-", - lc ? lc->lc_class : LOGIN_DEFCLASS); - } + rc = rtprio(RTP_SET, 0, &rtp); + } else + rc = setpriority(PRIO_PROCESS, 0, (int)p); + + if (rc != 0) + syslog(LOG_WARNING, + "%s%s%sLogin class '%s': " + "Setting priority failed: %m", + pwd ? "Login '" : "", + pwd ? pwd->pw_name : "", + pwd ? "': " : "", + lc ? lc->lc_class : ""); } /* Setup the user's group permissions */ From nobody Thu Feb 1 21:26:10 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsQq1v2Qz58hTs; Thu, 1 Feb 2024 21:26: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 4TQsQq02ZLz4WLY; Thu, 1 Feb 2024 21:26:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Op+wpL0hvro79/eTGFN6/RKxJQJLZRkqrqG7orAFPp0=; b=GSID1j4HaXET1QpRqz/73opa6shHOAUQVoDQibv5x3URh3qLcaGdSKIlfSRiFK9WPiIyap QdXjxcLP4ZbsoAOq30/Jn63n91XdtU/jB+wPY2n57B6Zold+BcZoXbqJvpdFMBatk3vNAv 3kWDi9TbNk+JjgMCNYxad15gd3p58msoWip4s9VKElyzBbZaCTL7Gc+f7+CVjLP/au0h0k R3oZRHsyWEKQ+IwFmM4bbgGWW+869qmCr6yZUDopEu3yvNS3ZkOgOafKvc9XLaj+pcTGFb BXNOtR/b/6I+5F6YqJheopmPQEULUdPCn6YoQw+LfJhihSli+qvCIY1HoiCbzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Op+wpL0hvro79/eTGFN6/RKxJQJLZRkqrqG7orAFPp0=; b=x3PWjfy1cgXtZoeYZ44YMQFL4JLxKW5g3FvdeFws/4EesrQqMcBoFSgonMQhUGrjeH6tUF dIu0J+ObJpVa72rqi+Hwl7sjRdBGMWJu+4xENZ3y7ILTyqtpDfwICIAvRsZvlPkvYce36Y QSE0P07fGd4iott+I5ZVuv3z879Z+QYp3xi7OvxKVX/8FTpOwO/cuoDPSPRay4RIPVsROY x3aTL84DEEBe0oxsBzPTXaJRbugfvfa2OtjumoV2jSBZQ6qzNGNwQP5faF/BaSxRXUoN13 8hd0AkwCEX5ctf9USW7zwWvsbHnAkc3K6525pHnDe5XwvVAm6TJQAz8YVaOLwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706822771; a=rsa-sha256; cv=none; b=wNLa3Mnai0RgjHgFu/CNdcbKA3uPdFrPrriX1cE8OzCFuQkBCrADzwkABS+kkg1I3I6ViQ B8H9O231TXEY3VD+Plylw0sf02Jg+o0n4A36qJR4qSPunOBPI2UcC/RFaJ6SHvHGGCGVnK o1f6AWGdhI/AQA42uCkP5SkBlisH67bl9nTN/H7pNvakgSLX6vv7Tp67NJWeCmxJwM+9OX 0OUCk92ALVtcLv+AoqaVXWvjoDfLurdkqqhSTukeZpAc6NkgoGu9l51biqgKc0FCBtKcIM qLX9Ph7YPvnyHfIWknInvG+ZDfPniLDHfDuAXWvpdw1AdgliG4q+QSdx0tgCkw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsQp5lJZz1Hw0; Thu, 1 Feb 2024 21:26: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 411LQAXJ070593; Thu, 1 Feb 2024 21:26:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 411LQAO5070590; Thu, 1 Feb 2024 21:26:10 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:26:10 GMT Message-Id: <202402012126.411LQAO5070590@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: 72d463479fcc - stable/13 - login.conf(5): Document priority's default and possible values List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 72d463479fcc72435c75c5f8643e53e1a54fa799 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=72d463479fcc72435c75c5f8643e53e1a54fa799 commit 72d463479fcc72435c75c5f8643e53e1a54fa799 Author: Olivier Certner AuthorDate: 2023-06-21 08:39:15 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:23:45 +0000 login.conf(5): Document priority's default and possible values Priority is reset to 0 if not explicitly specified. While here, be more explicit about what "Initial priority (nice) level" means and document that it is possible to set real-time or idle class' priorities with this capability. Reviewed by: emaste Approved by: emaste (mentor) MFC after: 3 days Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40689 (cherry picked from commit aa96945e71b0f724e6ce673194d23f58d2d637d3) Approved by: markj (mentor) --- lib/libutil/login.conf.5 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/libutil/login.conf.5 b/lib/libutil/login.conf.5 index 35ca11452811..4a98ee818139 100644 --- a/lib/libutil/login.conf.5 +++ b/lib/libutil/login.conf.5 @@ -247,7 +247,21 @@ for details. .It "nologin file If the file exists it will be displayed and" the login session will be terminated. .It "path path /bin /usr/bin Default search path." -.It "priority number Initial priority (nice) level." +.It "priority number 0 Initial priority level." +A value in the nice range +.Pq -20 to 20 included , +extended below with the 32 real-time class priorities +.Po +so -52 maps to priority 0 in the real-time class, -51 to 1, and so on until -21 +which maps to 31; see +.Xr rtprio 1 +.Pc +and above with the 32 idle class priorities +.Po +so 21 maps to priority 0 in the idle class, 22 to 1, and so on until 52 which +maps to 31; see +.Xr idprio 1 +.Pc . .It "requirehome bool false Require a valid home directory to login." .It "setenv list A comma-separated list of environment variables and" values to which they are to be set. From nobody Thu Feb 1 21:26:11 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsQr2TLnz58hGD; Thu, 1 Feb 2024 21:26: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 4TQsQr0Zd6z4WKR; Thu, 1 Feb 2024 21:26:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822772; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kpCGYSVp264IBY5TqIid0PH1b7TgtlLFpwI4Pf+DMH0=; b=iXoFPryxyYa9ToJOcx7iAYYeBH+xX8eV0aXr49w4zphOUZFGoX9PduNrI/pHXHMQ+zCLz7 bKBHQTf3aMLmHbjB7CnxdmdOclZdM1RMl/j3vNwzpMPHOROtB7r+rHC87V4aQ2K0PE8HP0 wXjhHlUAfVOsRihbzZNgthKsLY/+obyYrr1qGJp2vHdIfowrdms6WXPTkiJHUo6gO+29di BBs1/YgbXCL8CzUpmFj5PXD4HWHPjvJNUmJsp0H9pXj1h5ZandUVFhGsF7JMetFGU0+T8w tSqNUXBrhNjcxW3XcJJvhKVginW2KSyQK71ohthoDTQeEm5PeBP8WBopSW8UcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822772; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kpCGYSVp264IBY5TqIid0PH1b7TgtlLFpwI4Pf+DMH0=; b=RP9+lw2efrscg8T6hp+Aqm0NFpDoLGomzkjCHntNY5ARSp7gEkJVdaSTf48hwDh2YUSasD On8hLKx8FWduKgM4L0hlFM6HIA5HSRPWUHgAWxJHo6WqxD/hKGUDUGCYYDUl7g+9BYNFy6 i2IGdMS2Bn/kw+B2aoco0wsIVAsF7danIJoDB5jHH3GZK36Bveu9mNWdUQjzlm1tijDBAZ mbQHRQoAilKHuAJgVLZgtR6rDrbD/zWDIDkIjkhi650WxoDJk65ONiMSkycw4EqAzeMEWg G92SKi4hej/kBElQaaQHHV1s3WTpNl5nwbfSPhNIFitEACpyp3/m0STFnJRzJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706822772; a=rsa-sha256; cv=none; b=Fl6rAkocPNdroJCIOuzwLhAok0P7GiyZY6Y7KF8qCRIsAJu0JIYV7Z3+5zdxgtXO39oVQi HUCXb4V0VbmaEnY6+vWVmpTX2zdXb8cWvW328+FyA1QYbP3BkRoBpdiu9cRGakDGnVhfIK PXdzFMVuCvLLa9qujIYuhO8Y+12LMYcgKQ23O8aukMjdQe0xX9FDEuU5K2h3lWcQFyUJl4 eFE79kZ8AnjsrA2J002n0uUCATvdSUSGIcjl9ZylHPWZp63ZGlHbtb1bJEQc24EbE0SPbZ mfLXII2ijGF0PHPIvCaOBXDxJevuSlRDy+MM1zI47R96Jv/6QrGCuIxm7Fk75Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsQq6mWXz1Hcs; Thu, 1 Feb 2024 21:26: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 411LQBMg070641; Thu, 1 Feb 2024 21:26:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 411LQBb3070638; Thu, 1 Feb 2024 21:26:11 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:26:11 GMT Message-Id: <202402012126.411LQBb3070638@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: 3fc149c302ab - stable/13 - setusercontext(): Move priority setting in new setclasspriority() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3fc149c302ab7287e063e7fdd0a0d7031947e3fb Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=3fc149c302ab7287e063e7fdd0a0d7031947e3fb commit 3fc149c302ab7287e063e7fdd0a0d7031947e3fb Author: Olivier Certner AuthorDate: 2023-05-29 17:09:36 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:23:52 +0000 setusercontext(): Move priority setting in new setclasspriority() In preparation for setting priorities from '~/.login_conf' and to ease reading of setusercontext(). No functional change. Reviewed by: emaste Approved by: emaste (mentor) MFC after: 3 days Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40350 (cherry picked from commit 7b94ec550ef6e7b75d608e125e9b78478197d4e7) Approved by: markj (mentor) --- lib/libutil/login_class.c | 97 +++++++++++++++++++++++++---------------------- 1 file changed, 52 insertions(+), 45 deletions(-) diff --git a/lib/libutil/login_class.c b/lib/libutil/login_class.c index 9c3285736f3b..9d8dc652d678 100644 --- a/lib/libutil/login_class.c +++ b/lib/libutil/login_class.c @@ -456,6 +456,56 @@ setlogincontext(login_cap_t *lc, const struct passwd *pwd, unsigned long flags) } +/* + * Private function to set process priority. + */ +static void +setclasspriority(login_cap_t * const lc, struct passwd const * const pwd) +{ + const rlim_t def_val = LOGIN_DEFPRI, err_val = INT64_MIN; + rlim_t p = login_getcapnum(lc, "priority", def_val, err_val); + int rc; + + if (p == err_val) { + /* Invariant: 'lc' != NULL. */ + syslog(LOG_WARNING, + "%s%s%sLogin class '%s': " + "Invalid priority specification: '%s'", + pwd ? "Login '" : "", + pwd ? pwd->pw_name : "", + pwd ? "': " : "", + lc->lc_class, + login_getcapstr(lc, "priority", "", "")); + /* Reset the priority, as if the capability was not present. */ + p = def_val; + } + + if (p > PRIO_MAX) { + struct rtprio rtp; + + rtp.type = RTP_PRIO_IDLE; + p += RTP_PRIO_MIN - (PRIO_MAX + 1); + rtp.prio = p > RTP_PRIO_MAX ? RTP_PRIO_MAX : p; + rc = rtprio(RTP_SET, 0, &rtp); + } else if (p < PRIO_MIN) { + struct rtprio rtp; + + rtp.type = RTP_PRIO_REALTIME; + p += RTP_PRIO_MAX - (PRIO_MIN - 1); + rtp.prio = p < RTP_PRIO_MIN ? RTP_PRIO_MIN : p; + rc = rtprio(RTP_SET, 0, &rtp); + } else + rc = setpriority(PRIO_PROCESS, 0, (int)p); + + if (rc != 0) + syslog(LOG_WARNING, + "%s%s%sLogin class '%s': " + "Setting priority failed: %m", + pwd ? "Login '" : "", + pwd ? pwd->pw_name : "", + pwd ? "': " : "", + lc ? lc->lc_class : ""); +} /* * setusercontext() @@ -490,51 +540,8 @@ setusercontext(login_cap_t *lc, const struct passwd *pwd, uid_t uid, unsigned in flags &= ~(LOGIN_SETGROUP | LOGIN_SETLOGIN | LOGIN_SETMAC); /* Set the process priority */ - if (flags & LOGIN_SETPRIORITY) { - const rlim_t def_val = LOGIN_DEFPRI, err_val = INT64_MIN; - rlim_t p = login_getcapnum(lc, "priority", def_val, err_val); - int rc; - - if (p == err_val) { - /* Invariant: 'lc' != NULL. */ - syslog(LOG_WARNING, - "%s%s%sLogin class '%s': " - "Invalid priority specification: '%s'", - pwd ? "Login '" : "", - pwd ? pwd->pw_name : "", - pwd ? "': " : "", - lc->lc_class, - login_getcapstr(lc, "priority", "", "")); - /* Reset the priority, as if the capability was not present. */ - p = def_val; - } - - if (p > PRIO_MAX) { - struct rtprio rtp; - - rtp.type = RTP_PRIO_IDLE; - p += RTP_PRIO_MIN - (PRIO_MAX + 1); - rtp.prio = p > RTP_PRIO_MAX ? RTP_PRIO_MAX : p; - rc = rtprio(RTP_SET, 0, &rtp); - } else if (p < PRIO_MIN) { - struct rtprio rtp; - - rtp.type = RTP_PRIO_REALTIME; - p += RTP_PRIO_MAX - (PRIO_MIN - 1); - rtp.prio = p < RTP_PRIO_MIN ? RTP_PRIO_MIN : p; - rc = rtprio(RTP_SET, 0, &rtp); - } else - rc = setpriority(PRIO_PROCESS, 0, (int)p); - - if (rc != 0) - syslog(LOG_WARNING, - "%s%s%sLogin class '%s': " - "Setting priority failed: %m", - pwd ? "Login '" : "", - pwd ? pwd->pw_name : "", - pwd ? "': " : "", - lc ? lc->lc_class : ""); - } + if (flags & LOGIN_SETPRIORITY) + setclasspriority(lc, pwd); /* Setup the user's group permissions */ if (flags & LOGIN_SETGROUP) { From nobody Thu Feb 1 21:26:13 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsQs2lCkz58hKR; Thu, 1 Feb 2024 21:26: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 4TQsQs1sjDz4WQx; Thu, 1 Feb 2024 21:26:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YBU7LOLYfw9YEurZEFSbDMTIrNGPPnJ0XGhkFO3yfxk=; b=qgucTSW1oodwwjv8EuXKmvgSENQi80FECegBxnUalmu0clLzZvKrzVFou+G+ID1SEq96+p 604pMjneVvSARvXXd08/UhkzXtU48yBw8kcP6eYhGIf+SLxTBVoRKlY25Ytq4IPZKLlo60 QpxBDnHkGYofMeCfB3+yDMUu+pTL7Ue+h4Yxt90WqsKOION6837sldUkiEVfvHJhE0Qu3A kWkU0G6RilHag3nQD5qjC1i8C8OWO9lpEzcv5rQpyCbZbrHx63V+I9xLpmFB/iXTAvW8G7 i2uO6gALI43BcYXadspZu5Bcomk2SnWbPRQIzF5oozqcBQnYGdM+FSxVj+ySoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YBU7LOLYfw9YEurZEFSbDMTIrNGPPnJ0XGhkFO3yfxk=; b=RDAS24fCD4BoYWfVs/8XcIa+u4hyx+wHDTydsE/MJnsdb7l9cof817/4FxUuUE5cXEbbgK bp+aN53ix0FLB0DUsuqb6TfF1xrP687E55V0FRqsbTNldVTOqPZZHVmNM0PQLgmwK+F78f qqcQgH9ouGjuw5v4L3vxY6nHDsFYib5D11PR/R9gIe4HXZUzfBF8Y7ZfeBLgcSjIROAxdC eLQpANoXsUSqJyVkD7heAc4MEgFPnjQZXEnxMpuLpOLRafXzL01LBV756RO8Rf8+gfQjI1 +6l/ci0vef30rT/J21xLwPWyR1i6T0SHloTI46LYsCTgTynVw2OT3r1Ld6qF2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706822773; a=rsa-sha256; cv=none; b=e1pJ9JrWBq4z+t3hByaBICXAjRnpDYElD6Rw4B+tlqHV/K5De2RzlPDoW1CQBXhMwoPGdZ HyW+qQRcoOs3mMgNTC9ggzlueMAzj93NFr4JFDNHUC162oo83JVtmrQeEB3da2L9MHins3 505yGafB2o/n4G1K+hK0DZeK61GhmcQGLgUReZqa086K1jIPq5CxmH0N5OCNdP47YIRblv u2r85pYjAICC/crW6dZXe7/5Sfw++VE+9EpAjnGOhiGCTKDKoWptQd8w6rsNtiHkl8Qbb+ DELh/H3y5MmgeVyYYhmUfQ4Powp43LVyGuburh5kGfcrfCKyLVN3Co83h60Ztw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsQs0jtKz1Hsj; Thu, 1 Feb 2024 21:26: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 411LQDne070686; Thu, 1 Feb 2024 21:26:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 411LQDin070683; Thu, 1 Feb 2024 21:26:13 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:26:13 GMT Message-Id: <202402012126.411LQDin070683@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: e074746fec21 - stable/13 - setclasspriority(): New possible value 'inherit' List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e074746fec21fbc4a66e936408e3b585f89b73bd Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=e074746fec21fbc4a66e936408e3b585f89b73bd commit e074746fec21fbc4a66e936408e3b585f89b73bd Author: Olivier Certner AuthorDate: 2023-06-21 08:53:37 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:23:59 +0000 setclasspriority(): New possible value 'inherit' It indicates to the login.conf machinery (setusercontext() / setclasscontext()) to leave priority alone, effectively inheriting it from the parent process. PR: 271749 Reviewed by: emaste, yuripv Approved by: emaste (mentor) MFC after: 3 days Relnotes: yes Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40690 (cherry picked from commit d162d7e2ad327ceada4102c5d6779f9ecd809502) Approved by: markj (mentor) --- lib/libutil/login_class.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/libutil/login_class.c b/lib/libutil/login_class.c index 9d8dc652d678..f545e3661520 100644 --- a/lib/libutil/login_class.c +++ b/lib/libutil/login_class.c @@ -463,9 +463,15 @@ static void setclasspriority(login_cap_t * const lc, struct passwd const * const pwd) { const rlim_t def_val = LOGIN_DEFPRI, err_val = INT64_MIN; - rlim_t p = login_getcapnum(lc, "priority", def_val, err_val); + rlim_t p; int rc; + /* If value is "inherit", nothing to change. */ + if (login_getcapenum(lc, "priority", inherit_enum) == 0) + return; + + p = login_getcapnum(lc, "priority", def_val, err_val); + if (p == err_val) { /* Invariant: 'lc' != NULL. */ syslog(LOG_WARNING, From nobody Thu Feb 1 21:26:14 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsQt5gglz58hKY; Thu, 1 Feb 2024 21:26: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 4TQsQt2cT6z4WTb; Thu, 1 Feb 2024 21:26:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822774; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+JG06sDEI2rsxrJfMkzpfaZL6GwpDtlrwQS21ezsiM8=; b=UEY/WDIi6sS3g/VZpV+FdnJ4sMvUXif4YXgSiE74wAuTfmwy+phT+ezf+Px4oQkXKFY4I8 P+o/wxsoPfsCINWreIG9JIz8v/2hIpQOdTWhnZBwQISie7BNNl7YRTOjhk4q1Ix6emgsWo yAV3jgHypBbDW3uR9So1j555t0ZsktZw4pqYw+gLkWitJBhN66wkfTuFJl6IoFH+Uow350 VU/epreUVUv6gzcpUtakVA0wXIZWang1uSZ2g80r+NLq5q6ZmaQDQKoZKVLZG0QrcK1kgL VM2ueo4abXhqo1XfOcrbwnM5Av1Z9Al5uYcaC8paaNNOctKy+phEEY70RqWa9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822774; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+JG06sDEI2rsxrJfMkzpfaZL6GwpDtlrwQS21ezsiM8=; b=MOFh2R/qHyPgBtWySThXRcLQd3zauRiOlBjTi5ZETa0+yAmyCw3pRWrFHlA+R6GCgifg9v AF2yDa3fFrpQLy4+yZctfNeWHAOj55YzNemm+l3dyLmKhATtTe9LkGCcKvAeGSNMyyAkdT jWv5zOLpVI6xtVgVgl00VGEqi2TyZ8Sl3fy+int1R5XhacPrPGo9W9c1hyum3Tb7OccA21 ERp2LTDGPh4KNvTomVNJhSZSPlPdarhcQLaZ3LkSrnvsZqKqeAWmsyTTe5CgcVfT/tt8Iz 7l3c8nq9E5Ylm+rF1Bd5bROsW9FQckHlgMe85qA7LexS+PtvoutK4DubBhJrMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706822774; a=rsa-sha256; cv=none; b=f7z+f1bRbi5t4MrAYxcDrOfcwaC0XC4fYUOWCxrnWyqRZm4MnlCnNHci6BRZvTedzMsUYs exlkPE3umelXrbWrrQlv40n8DwM+OTGbi6FqH26RiPqQv7G0+ghgyYX/CJs351jKKAltah 72IOkC/xBCd4C4H5N2leR1GiUL+jTzTxH21GG1fyt5/HKilBF/Ewmbxyzf03DA9c6wl3uC h6kojMfRWiC4JxuLHvSnZt9LIXasK/oZbmcNLU88fqaPaoN3PPw/WezfZokaW4aO6wCbZZ uetBvHSiGggF2aVyxv9Bt6CQDcEsqU9O2agWmwTNHR3gpb41xc6JCgsidrhYCQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsQt1k5cz1HgS; Thu, 1 Feb 2024 21:26: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 411LQEkn070737; Thu, 1 Feb 2024 21:26:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 411LQEPx070734; Thu, 1 Feb 2024 21:26:14 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:26:14 GMT Message-Id: <202402012126.411LQEPx070734@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: d836f951d9fe - stable/13 - login.conf(5): Document priority's special value 'inherit' List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d836f951d9fee1d8cd7b77b4b87fb13c54d8cf15 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=d836f951d9fee1d8cd7b77b4b87fb13c54d8cf15 commit d836f951d9fee1d8cd7b77b4b87fb13c54d8cf15 Author: Olivier Certner AuthorDate: 2023-06-21 08:39:47 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:24:06 +0000 login.conf(5): Document priority's special value 'inherit' Reviewed by: emaste, yuripv (older version) Approved by: emaste (mentor) MFC after: 3 days Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40691 (cherry picked from commit 33d4ce5496efe96bbaa7663e298876395b1db62c) Approved by: markj (mentor) --- lib/libutil/login.conf.5 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/libutil/login.conf.5 b/lib/libutil/login.conf.5 index 4a98ee818139..a749fe5519ab 100644 --- a/lib/libutil/login.conf.5 +++ b/lib/libutil/login.conf.5 @@ -262,6 +262,9 @@ so 21 maps to priority 0 in the idle class, 22 to 1, and so on until 52 which maps to 31; see .Xr idprio 1 .Pc . +Special value +.Ql inherit +prevents resetting the priority. .It "requirehome bool false Require a valid home directory to login." .It "setenv list A comma-separated list of environment variables and" values to which they are to be set. From nobody Thu Feb 1 21:26:15 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsQv5WkVz58hMP; Thu, 1 Feb 2024 21:26: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 4TQsQv3fSGz4WRL; Thu, 1 Feb 2024 21:26:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kt/AwLfKMqlCSrHC9EoBhACw1HMVOxk+zj4sBjXfQos=; b=fSWHswQ629G/KEYdJvMYIoyAuCJAySxamhYK1Uk4NhYw+Y/hMHwOvvf1lIWt3ZhU3rY8h4 gn5auwjiwPbJfQ9sqGyBrPdAeMZr7K26FImWQE+GFVFCL6VSGcgsDTB9PA1uYlu5ykRq6C QPnFBja6xUyqyy1PZyUHGq4nD/tiyYwW+5Yt1WvXTGOpLCx1tZYPfGr0zd1PMl8vSP8kIa 8e5ilv6TQkFyit+ZZD2kqCyS1y5WZDym3T8eakmzS1r1K7BzChxiIowCPrE3OvxKXs7iv6 +8Mufsat+9xrUG8xydVNr6VathMbWyqiHCHzdYnddF0IMlaEoAtFwgwG9LrfpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kt/AwLfKMqlCSrHC9EoBhACw1HMVOxk+zj4sBjXfQos=; b=mC+1B+zfZIROr8IRgnDgCBiJZPlH5OcDloTZZODJDzRjucghfLVl3yUW1HeFUlHxyWJ4hR QQ2WElT4x93fX6IFIVLbvH2Xdc2xj6Wf89PypreGpSvtAWQQ4WAjdwWE1YezHCwXmF9ALo IfcbXZVtD3VzgZlLv90Km44yKoniy7NIwBb3DQiY3f/yTEgtvbZXmRVFBwis0tP9qWjwie czLzCBve2So475ZqSvwlIFu0I8Ht1QyuezrIj/OUfy61K/hK1kVKhJv90moUFJIHCz2+pJ ls8s9JNJ15qNWVRAZ8m/zmSP6564PMFgU4w1hlK0ToryASZT9py6m65MGzRPXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706822775; a=rsa-sha256; cv=none; b=r28W+fmwn8pfKccuGkEgyMiJrJH8Ou4F1ejYYqqZqkXsq71qX4eAlb0Xq5nWufHS9mUYTq /eHLawuskkN2cX4rRgQ9rl7fkv4DT07vrLA/SA6CEVlSlg4I90Dmz+/vOxJo/sGxUOee/m X7BZNXUP669X+7JjnS4pYy2GMG9gGgu3SHptsHYJRnG0SKmUUX9Q3zA/w58XEZzTHL5Pos HczF/U4m0j8+8t9NV7uh5d09MD+dHP18Kway54jNBUVQhD9Ox912cIWr3fV0FZJlleNSsL 1yyqih+ARXyAZWDVUrom3flU6AoFunlLC6mp6FS01zNecnZruABlCht7YLiw8Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsQv2lhvz1HgT; Thu, 1 Feb 2024 21:26:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 411LQFdk070785; Thu, 1 Feb 2024 21:26:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 411LQFer070782; Thu, 1 Feb 2024 21:26:15 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:26:15 GMT Message-Id: <202402012126.411LQFer070782@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: 8b359002747a - stable/13 - setusercontext(): Set priority from '~/.login_conf' as well List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8b359002747a3ce84414fb64a9b89eab20ab7c25 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=8b359002747a3ce84414fb64a9b89eab20ab7c25 commit 8b359002747a3ce84414fb64a9b89eab20ab7c25 Author: Olivier Certner AuthorDate: 2023-05-30 15:14:50 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:24:13 +0000 setusercontext(): Set priority from '~/.login_conf' as well Setting the process priority is done only when the current process' effective UID corresponds to that for which context is to be set. Consequently, setting priority is done with appropriate credentials and will fail if the target user tries to raise it unduly via his '~/.login_conf'. PR: 271751 Reviewed by: kib, Andrew Gierth Approved by: emaste (mentor) MFC after: 3 days Relnotes: yes Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40352 (cherry picked from commit f2a0277d3e51a6a839151eef17f466d0db2b7300) Approved by: markj (mentor) --- lib/libutil/login_class.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libutil/login_class.c b/lib/libutil/login_class.c index f545e3661520..b4e52951bf9c 100644 --- a/lib/libutil/login_class.c +++ b/lib/libutil/login_class.c @@ -622,6 +622,8 @@ setusercontext(login_cap_t *lc, const struct passwd *pwd, uid_t uid, unsigned in */ if (geteuid() == uid && (lc = login_getuserclass(pwd)) != NULL) { setlogincontext(lc, pwd, flags); + if (flags & LOGIN_SETPRIORITY) + setclasspriority(lc, pwd); login_close(lc); } From nobody Thu Feb 1 21:26:16 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsQx0By4z58hDN; Thu, 1 Feb 2024 21:26: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 4TQsQw4jDjz4WMy; Thu, 1 Feb 2024 21:26:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822776; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fts/tX8ENba/ln+SeeEUIqjI+godA3Jzp96TbdDTKHw=; b=NjxMGpKgwqw6KutyhSBKJ0SfvrdG2ErFuDiSgfYQUGKypEFnPlyLnxZr/ANxF0JMvPvg/0 xA7nBJT+rTFwsVcYdv7wwkvKnSCsMMpGAj8IAzf7+pN612aDh4YMtZzTG9ckGLCsESm5ex 7uZcsgJrkXbJVOOGPsTYVsamuHtmAY28kPU1BuLtB9kQTX5eLf3649L8NsuqSzkRyA6p8j 7giV5bK8HtfPSamgvzaFDdJyKvY6u7OEi4pneCWQgg6At0rLo2xsGhyP24nviGWLcB5Eod gxks1TiKRPe7IlY7YTdDzWQ36WCuW3BbxJIm9scEwf8I8Y6EKmZY1iIg+5kitw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822776; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fts/tX8ENba/ln+SeeEUIqjI+godA3Jzp96TbdDTKHw=; b=EfpIDfU69coOaBnscCcAwsWR4PtENhtO/hbN5OrQW5gHYiabXbLBjUiXkgIKUJ0730HXo+ Mi/SjPtKAqYTK0fnzPTBQbR3lJm6YS6QnH9ZxM2maGhF1Kb3frtXwj+zN5vqUp/Op5ZmEU ybDfaJXBSECZK516VopuWwBeW27gTF/flp68NihAlz/wejENArCADx3jFAoJQvXvYfImr3 Wk04eZbfQ4477G0Tm2u3eIS9HbchTKf++idV2IDfS9zGYpZRcVXMjg1vs8DdfzQ+m6jgqB TDuiMiRXyu7gNuuswtQcbcF2yAxxmb0pCtXodyk6fUiil1sOGNPOGqpuMqjTTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706822776; a=rsa-sha256; cv=none; b=E5XdWQRLRiNbasmZwzcPxbiWXA3uT9/iRxbMbbsAbpHGwm0/+yCZdn41brBspz24x/PjhM wfCb8HMSkBiYAtNWzsY2lu/Y2nZFAdLSDl93cg+uTUfy/KSQuyhVdvu6ipZ0+X3/M/rYKs N3Yl4kPPdzsIKdDo/aEdT0KOwlukXy8M+IQf4FxF+mIStBLnqukZ7U6w7wi8HiWBIvInXh zJtHz2g2+5iyBMaSajpQU9i8kE6XHEKi2l9/Lfx3hqQMgKI2RPf3TYZExHGkz5ACoflJI/ WhOltSjk4JuamK8cCERiwKY1awIq3FCe/7RZg0dRxtNZ+Pyp5l6LKOYAVUNxXQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsQw3npnz1J4s; Thu, 1 Feb 2024 21:26: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 411LQGXD070822; Thu, 1 Feb 2024 21:26:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 411LQGJK070819; Thu, 1 Feb 2024 21:26:16 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:26:16 GMT Message-Id: <202402012126.411LQGJK070819@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: 943af0501107 - stable/13 - login_cap.h: Remove LOGIN_DEFUMASK List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 943af0501107f88312a98b217b6956f3d0f2fa76 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=943af0501107f88312a98b217b6956f3d0f2fa76 commit 943af0501107f88312a98b217b6956f3d0f2fa76 Author: Olivier Certner AuthorDate: 2024-01-25 22:10:40 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:24:22 +0000 login_cap.h: Remove LOGIN_DEFUMASK This public constant has not been used in-tree since 1997 (this was noticed while working on previous commit "setusercontext(): umask: Set it only once (in the common case)"). Since it was an implementation detail and GitHub's code search and Google show no use of this symbol today, simply remove it. PR: 276570 (exp-run) Reviewed by: emaste, kib (earlier version, then part of D40344) Approved by: emaste (mentor) MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D43608 (cherry picked from commit e3a396eb2a029e5dc9161469735aa3f7f16845d1) Approved by: markj (mentor) --- lib/libutil/login_cap.h | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/libutil/login_cap.h b/lib/libutil/login_cap.h index 0037b41d9055..a48246804a47 100644 --- a/lib/libutil/login_cap.h +++ b/lib/libutil/login_cap.h @@ -32,7 +32,6 @@ #define LOGIN_MECLASS "me" #define LOGIN_DEFSTYLE "passwd" #define LOGIN_DEFSERVICE "login" -#define LOGIN_DEFUMASK 022 #define LOGIN_DEFPRI 0 #define _PATH_LOGIN_CONF "/etc/login.conf" #define _FILE_LOGIN_CONF ".login_conf" From nobody Thu Feb 1 21:26:17 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsQy0RKgz58hXB; Thu, 1 Feb 2024 21:26:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TQsQx5QTpz4WRn; Thu, 1 Feb 2024 21:26:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qJww0QTDYa9+PdyF8WU9rMBckSKPX2NuxVGwAArE6Yc=; b=naOIqngut2lajJab+JQbJPH0DbqjSBY7cWljmAzV3gK+n+/Fxf7nOs9TlH42VBy5s6OMOf kWyXB5ut/KfaS9CVAtd8Y0DvBUB5l/n2OfaHwim45tofyZkVgawY5ircTZaldR4U3+FM9A 47C8NUHX44iHp+bRSrqA0hcZQBnQeogh9R5ViREi9/PB02E8xwPZ/x8bfA+M4mSFCJ/J6X 4ZU1E63EvnVu8mmPITNaj0xzvY3pTtOjojKZnKz88G5d9YOM2gwy2MScuQwoW0NyJwUuSw POnlPed+5LhwEK68N/5/NZpYZ+CZFFXv9+YI7mRLU68vsQNSvF2Tt8Oca5ewvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qJww0QTDYa9+PdyF8WU9rMBckSKPX2NuxVGwAArE6Yc=; b=AT8RcRvMbooxFIuI4CIHl9b9lgctbsTQ1K8laZb6x4dtK5xZDAq+F183RQq4kQiOFxLYMJ a1Paq98uZHSukYmnlt65AJGvu77+A7YHKuejqpDjSFyY3iW2ivipZQVXW4bitI5d4mhSu5 cJ7i4ixXSpc5dBEcQoZ3cwymLxI9E5IGKNHinqMvGJrFy6K1SSr6fTtK/3N49Fj/aS6cok aWd9yMkDEz+1Bm8PC1YhEiA5mDeLDMAvHRqpNvIYfmV0vuHNlwqH9wUOP68CgOSfQTp/Cs G6hs2H08bio+WPHQ4KjPFCkWlV/rC6DObjawI6GKAFbU40E7easTRDf7iWxR6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706822777; a=rsa-sha256; cv=none; b=OpvmHobJsl+qvoqmmH2QH/mrgdyTnnYXkM0vLGvpf+x0Gp+4ck1ywF1mO+ChO1q6x4a6Q+ TFneMwK+gIErNVHu4zcCrdCkOgv9st1XK1OL9N8o6PZtuLt5dTaxZmavgXU2k/zgGAN/Tt hvNTnPQlsw+oWXIomxdqzlzIVvUKuP/V0IS7mJRixIyUx5a/fpWkyO/BigqKKu1dZIc5wG 0VyVj030QcgTidxIw2ZiMSSwX8PeYutzuu9ITv0WRXNC628W6LttoSozDp4eDjOfFiXO6A uy1skVVd7mxZOVZjpndu+yJkarzVQ8sckOAtOPZLmZnBUopvlrlXurWS3popRQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsQx4XSnz1HgV; Thu, 1 Feb 2024 21:26: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 411LQH6C070858; Thu, 1 Feb 2024 21:26:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 411LQHrh070855; Thu, 1 Feb 2024 21:26:17 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:26:17 GMT Message-Id: <202402012126.411LQHrh070855@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: 634f86a3c47f - stable/13 - login_cap.h: Remove LOGIN_DEFPRI List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 634f86a3c47ffc8dfe7699ea599ab34c88b25324 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=634f86a3c47ffc8dfe7699ea599ab34c88b25324 commit 634f86a3c47ffc8dfe7699ea599ab34c88b25324 Author: Olivier Certner AuthorDate: 2024-01-25 22:25:10 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:24:30 +0000 login_cap.h: Remove LOGIN_DEFPRI This is an implementation detail which is likely to become irrelevant in the future, as we move to not resetting the priority if the corresponding capability is not present in the configuration file ('/etc/login.conf'). GitHub's code search and Google show no use of this public constant, and it doesn't exist in OpenBSD and NetBSD. So, remove this definition and its sole use in-tree. PR: 276570 (exp-run) Reviewed by: emaste Approved by: emaste (mentor) MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D43609 (cherry picked from commit c7e645269f1c7e9872a7ccf6b72f045c55a66793) Approved by: markj (mentor) --- lib/libutil/login_cap.h | 1 - lib/libutil/login_class.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/libutil/login_cap.h b/lib/libutil/login_cap.h index a48246804a47..316d6e62d790 100644 --- a/lib/libutil/login_cap.h +++ b/lib/libutil/login_cap.h @@ -32,7 +32,6 @@ #define LOGIN_MECLASS "me" #define LOGIN_DEFSTYLE "passwd" #define LOGIN_DEFSERVICE "login" -#define LOGIN_DEFPRI 0 #define _PATH_LOGIN_CONF "/etc/login.conf" #define _FILE_LOGIN_CONF ".login_conf" #define _PATH_AUTHPROG "/usr/libexec/login_" diff --git a/lib/libutil/login_class.c b/lib/libutil/login_class.c index b4e52951bf9c..eb16ad501881 100644 --- a/lib/libutil/login_class.c +++ b/lib/libutil/login_class.c @@ -462,7 +462,7 @@ setlogincontext(login_cap_t *lc, const struct passwd *pwd, unsigned long flags) static void setclasspriority(login_cap_t * const lc, struct passwd const * const pwd) { - const rlim_t def_val = LOGIN_DEFPRI, err_val = INT64_MIN; + const rlim_t def_val = 0, err_val = INT64_MIN; rlim_t p; int rc; From nobody Thu Feb 1 21:31:05 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsXT5xjLz58jD9; Thu, 1 Feb 2024 21: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 4TQsXT5Vgbz4bV1; Thu, 1 Feb 2024 21: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=1706823065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xbX6s9pKeoVdQse50Tikjab3mVkW8paKI4mBzzDP89o=; b=ugO03pp+DQ+a1AVMKX2vjzQwPgh1lO0HMPps6cUNAUeBmW3fvboPX+IXzfjeT3ULcJV0H9 +IZnoe3zRM+JEoWwmDaPgIK3zSimzYfsS9gvQTEusmPQEnWg85XiHfbMXWkDwuN53BgEyJ v3a7XGQrwDPr3nzviSCZcu++QAyt4Nufwa6miGJKVGxHwgt9mb/JCcqAa/gbq23e639dfG ixxLTM2U4xKxo/DUqSsV3Qbhxe67nJjFoMQtuITO5lwFr9u+6Dh440tC+IDqZ4zvb1np3x s5oDlxdfFaMDJFd8J4UT1VYw/N7NKcqDU82d5nbmpwdrWzMuqKqV3cJjF1RLQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706823065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xbX6s9pKeoVdQse50Tikjab3mVkW8paKI4mBzzDP89o=; b=UML4UL7R0sDYVFeY8okTYpK2DKlNpySUqoEzpdqMviN3FygZPbr3Vvm6wU8asM/J+csqzC N9V0HmVTI9YbKAx7melH0q74anGxTCVWH+cmFgqX9K92u23J0RIJ0pHenl0rjkgBed6xXz Vx6FMDR5MoX7cUc7ZQ407tZTzl0MrdQd98DIlUBWKmR2teZ0g7phDFHP7rUWNBiefI26zP PRdYd7nmSn4Fn8d97Ff+zWvk5zwpo04xqBu1NzQYPoHoMXQ9xkA7RqQwn+cd9w3pGWrHav Lq+yuw+ypNeJdnYLDme8scB+DcCd97hq/usBsIpqRhjLC1+vLCVBUeY0K7vYDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706823065; a=rsa-sha256; cv=none; b=Jwki1LwbI62Uhu5HlJEedTRffU+g23K2M9JiohBhM+wOK8bvuDDloRIYa/DziGCPLyMT+B n5RydpS9p9+pi0ZCURNKaOXpMpfkAAluVjT24TYQbuSguDy+DpXNZ9RqedRHuBLRHgp9Sw WJdKa8y/cPlAPZe3Tbg/vecrFnruLpjEWeWX7P7k0ANeh2nHRBPho8mJVFB5E8C7+fwZvg T2LuUGgiQkIkzceT0OTH6TxDklENZjdBiGcgfE0qJIJY3JdQ7GJdHV2vUquCtDr1eqTqqX HkowWMbaVmXZUubvIPXDHkC2LUGJa3nAHaSpgAZMLqSMk2PhXS8rvqfhu0DgSg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsXT4Zbgz1HwJ; Thu, 1 Feb 2024 21: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 411LV5oU080324; Thu, 1 Feb 2024 21: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 411LV5MH080321; Thu, 1 Feb 2024 21:31:05 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:31:05 GMT Message-Id: <202402012131.411LV5MH080321@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: 3dec4c30c76b - stable/14 - setusercontext(): umask: Set it only once (in the common case) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3dec4c30c76b1646c835768863c876f516852fc3 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=3dec4c30c76b1646c835768863c876f516852fc3 commit 3dec4c30c76b1646c835768863c876f516852fc3 Author: Olivier Certner AuthorDate: 2023-05-25 12:18:45 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:28:27 +0000 setusercontext(): umask: Set it only once (in the common case) Simplify the code and make it more coherent (umask was the only context setting not modified by setlogincontext() directly). Preserve the current behavior of not changing the umask if none is specified in the login class capabilities database, but without the superfluous umask() dance. (The only exception to this is that a special value no user is likely to input in the database now stands for no specification.) If some user has a 'umask' override in its '~/.login_conf', the umask will still be set twice as before (as is the case for all other context settings overriden in '~/.login_conf'). Log a warning in case of an invalid umask specification. This change makes it apparent that the value of LOGIN_DEFUMASK doesn't matter. It will be removed in a subsequent commit. PR: 271747 Reviewed by: emaste, kib (earlier version) Approved by: emaste MFC after: 3 days Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40344 (cherry picked from commit e99c28e93bd4d04ff877459734e9ce06ad2335a7) Approved by: markj (mentor) --- lib/libutil/login_class.c | 45 +++++++++++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/lib/libutil/login_class.c b/lib/libutil/login_class.c index 1036e9f9208c..2b85425d8d8e 100644 --- a/lib/libutil/login_class.c +++ b/lib/libutil/login_class.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -385,17 +386,40 @@ setclasscontext(const char *classname, unsigned int flags) * Private function which takes care of processing */ -static mode_t -setlogincontext(login_cap_t *lc, const struct passwd *pwd, - mode_t mymask, unsigned long flags) +static void +setlogincontext(login_cap_t *lc, const struct passwd *pwd, unsigned long flags) { if (lc) { /* Set resources */ if (flags & LOGIN_SETRESOURCES) setclassresources(lc); /* See if there's a umask override */ - if (flags & LOGIN_SETUMASK) - mymask = (mode_t)login_getcapnum(lc, "umask", mymask, mymask); + if (flags & LOGIN_SETUMASK) { + /* + * Make it unlikely that someone would input our default sentinel + * indicating no specification. + */ + const rlim_t def_val = INT64_MIN + 1, err_val = INT64_MIN; + const rlim_t val = login_getcapnum(lc, "umask", def_val, err_val); + + if (val != def_val) { + if (val < 0 || val > UINT16_MAX) { + /* We get here also on 'err_val'. */ + syslog(LOG_WARNING, + "%s%s%sLogin class '%s': " + "Invalid umask specification: '%s'", + pwd ? "Login '" : "", + pwd ? pwd->pw_name : "", + pwd ? "': " : "", + lc->lc_class, + login_getcapstr(lc, "umask", "", "")); + } else { + const mode_t mode = val; + + umask(mode); + } + } + } /* Set paths */ if (flags & LOGIN_SETPATH) setclassenvironment(lc, pwd, 1); @@ -406,7 +430,6 @@ setlogincontext(login_cap_t *lc, const struct passwd *pwd, if (flags & LOGIN_SETCPUMASK) setclasscpumask(lc); } - return (mymask); } @@ -429,7 +452,6 @@ int setusercontext(login_cap_t *lc, const struct passwd *pwd, uid_t uid, unsigned int flags) { rlim_t p; - mode_t mymask; login_cap_t *llc = NULL; struct rtprio rtp; int error; @@ -533,8 +555,7 @@ setusercontext(login_cap_t *lc, const struct passwd *pwd, uid_t uid, unsigned in } } - mymask = (flags & LOGIN_SETUMASK) ? umask(LOGIN_DEFUMASK) : 0; - mymask = setlogincontext(lc, pwd, mymask, flags); + setlogincontext(lc, pwd, flags); login_close(llc); /* This needs to be done after anything that needs root privs */ @@ -547,13 +568,9 @@ setusercontext(login_cap_t *lc, const struct passwd *pwd, uid_t uid, unsigned in * Now, we repeat some of the above for the user's private entries */ if (geteuid() == uid && (lc = login_getuserclass(pwd)) != NULL) { - mymask = setlogincontext(lc, pwd, mymask, flags); + setlogincontext(lc, pwd, flags); login_close(lc); } - /* Finally, set any umask we've found */ - if (flags & LOGIN_SETUMASK) - umask(mymask); - return (0); } From nobody Thu Feb 1 21:31:06 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsXW17rQz58jDF; Thu, 1 Feb 2024 21: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 4TQsXV6VTCz4brs; Thu, 1 Feb 2024 21: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=1706823066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RdUNtds3riuLG8B0mLpCg7wPhGKAZVlnNQd3WpGM6l0=; b=uAMvXBYUSE2+2cDK5aRJAJJYSBCkXrNolloiGi7ZXoRYPsInCIz7bPGf3LW5yHNr9AvLk/ qFjU1pbKC/kWvmzlPmYLTNC264MRmx4/sONyVfLkG7y9L3FvgykJv9vBn8fawXQ18EuBVq 6kyb6s5WFSs0RVRxdXHW8mcGssqs3S5hEBGW9TDeN7kerNZ8znZd75xJ0RgQ+6paGx5/oo UPWJNqethBvQogFLF+YAumtXPpSLzISXqxd6tw+6B8Sj1vwb2uRf0CELPaJPE1o9COj57P Tkg5acjVAEjfIgNWyN60VXFotTOQlYQeRDuZc6euFrYrU/EghP4AIonM/LpMsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706823066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RdUNtds3riuLG8B0mLpCg7wPhGKAZVlnNQd3WpGM6l0=; b=f4AcEbUKl4vksU9xHtv1mpmOJXP/STs/Jc5G6O0CoeqikhtUGJC/QC6zzyiOjbxPbh6GT+ 2/9as4fJM9+vKFzUhYPB4hxG9y0Tfii86gHD5Ms1YDhs15qWQGrh1VC9Lmxtd2fFEzVmdM ucPnA4ln6LkR/qYVjGZMnfatNz0ZA1AITaIJ7EHuLnYn0X0I266jVel0UtrrXWre6eqKAo Yv/OkBLBBepNTO75yGTIu0iczFPDbFQSMMPI/1HbVAmzNigtYcpAQAG0h3aLqSUEpF9Pcr IpE6WtyZH49k/uJTAJ7NJKXOtuDIhdWvMv2g0fUoJjgNO86SyaGGJ1nbzT9LJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706823066; a=rsa-sha256; cv=none; b=bpgrOKPxPUoRojTUkCrzJqE6ngAge5bQ30BASq1lXJFtTi//iM9AY4jVS5mdOLlJcuegQo VPjkWqksoA72v4KYQitay5NmKk5+Znjb88i6HLio9FZx9xLEic72637Yrk3lS2E8oNM0p0 5U406ZYlXY627/DkuRfI+4h4r1MxAo+iAlbJWwfMGDu6h93a9VpixR7C1DROGZnMgDFIn8 fufM/o/JfKJi/m3TP/E0elcxLyrXsVC9k8VoArfZoP28c6sYdyh6xGcZYp8ti16iENV4lm wWymxWXCcjfKbZPXE9uGmiDvOAWB8MrF+4PP058OsQLzm+DBhoX0TMw/F3ZnkA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsXV5ZWnz1Gvy; Thu, 1 Feb 2024 21: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 411LV6hL080369; Thu, 1 Feb 2024 21: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 411LV69Z080366; Thu, 1 Feb 2024 21:31:06 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:31:06 GMT Message-Id: <202402012131.411LV69Z080366@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: f0551aa362c9 - stable/14 - login.conf(5): umask has no default value List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f0551aa362c946c16a246e744ceba53dec66ea8e Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=f0551aa362c946c16a246e744ceba53dec66ea8e commit f0551aa362c946c16a246e744ceba53dec66ea8e Author: Olivier Certner AuthorDate: 2023-05-25 12:41:03 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:28:34 +0000 login.conf(5): umask has no default value The umask is simply left unchanged if no explicit value is specified in the login class capabilities database. PR: 271747 Reviewed by: emaste Approved by: emaste (mentor) MFC after: 3 days Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40345 (cherry picked from commit 0d1fe948d97d2d6e3708349b74cf438f9604a8d1) Approved by: markj (mentor) --- lib/libutil/login.conf.5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libutil/login.conf.5 b/lib/libutil/login.conf.5 index a0b46debbfd1..7449c11f2ba5 100644 --- a/lib/libutil/login.conf.5 +++ b/lib/libutil/login.conf.5 @@ -253,7 +253,7 @@ contain the shell specified in the password file. .It "term string Default terminal type if not able to determine" from other means. .It "timezone string Default value of $TZ environment variable." -.It "umask number 022 Initial umask. Should always have a leading 0 to" +.It "umask number Initial umask. Should always have a leading 0 to" ensure octal interpretation. .It "welcome file /etc/motd File containing welcome message." .El From nobody Thu Feb 1 21:31:07 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsXX1Tl3z58jCp; Thu, 1 Feb 2024 21: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 4TQsXX0QRPz4bV4; Thu, 1 Feb 2024 21: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=1706823068; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iD6bkPXh5jI2l2LMu4lB90jH1BlPVj8H2BNDA96pqhg=; b=TsymL6rwj8XaK8sgMLum8opcLrdHngpkBVyb0wdlkXtO0wpfpXtSkLAZ7+N4sTK75fgDm/ jD8qFngr4YjfIbEYOzsV9zCQ/y9m9GI/DRZu16yrsgwsi0eWc/ThQeIaPQAYQPWOzHMKN4 GVhv3/H/30LEFTDB2HPf+jrCtwUzmm5MZ0ctjwPFIsVbgJpFWV4PGJyxKlpvM3RIcpZh+J 9OO9hef+HMp1Nhhd31CQ7Gka/3OB5DlKlrzqzh8TO7n6qkZ5xtE2kWiXuITsXEZO5RqBOz ei8MP5CpG4SvOVmzI0rGVoNEiuMLqURTa8cWsjtzzIKO9GSOs5ZU94YKK73cUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706823068; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iD6bkPXh5jI2l2LMu4lB90jH1BlPVj8H2BNDA96pqhg=; b=V+oOzRyCzAIqOFX0OeaoT9/bg5eW6SD10++sKDc0V+ikKUPupTIVYCz/t6bDm8iE5kCDzx 4IRY4Mg5L1wp/5NLSBFWMeY225tw8w4xQ9Ht+SPzHcwchVgKoxnJJ3mVUwd2lJoLZdwF06 48ST+a/sfbl/zCHWNbsSbkcaGkfA2vjAjI5zUkXSpCCwMtVK6qaqHQJTc0ZJNXVovyZbCA YIiHrkkPYpleXbmq1PMopq3CfOI3rN2E3MkTNXzHEmypZR9VmwrNSn9F05FGXwCluYv7w3 6b+NuMrfFNsuEeo0L6N3C/FsSOh859/u6PQ2CH3vLEW1E7zDYIEQW4xqwWkcNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706823068; a=rsa-sha256; cv=none; b=SSX0cWO+f5MMaZ/0wYOma2eMfXi1+9VbIQhEIB6JJSRNwGdbLva9SuE5VvqRB0+CYbmOuA wiGsMjnWW+xeiIHfKvkFmVQFIOalWO65SXcF6gN7S/bwjld1a7asKY0iyvuhn24FDPkeYr tfOCd90MHkWcuC0rBIZfa+YmQi5dfLBPbFTiJCtyeU19ekXNCYuz3ZDnxXYBSZsqcAe1rf f5CV2f2OHD5J0FQfEuqPlafijeJJ0KdVtL4ZPnM6hxAHsMPp3cbyFvQB/scPlNC3w2m7Ln VWPpXj90/oa3GjFDWnI6PsPFHZhDSQikaVAg0e7eRexlOprrA3DkNB4cWqZGMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsXW6d6mz1HwK; Thu, 1 Feb 2024 21:31: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 411LV7oC080426; Thu, 1 Feb 2024 21: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 411LV7HI080423; Thu, 1 Feb 2024 21:31:07 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:31:07 GMT Message-Id: <202402012131.411LV7HI080423@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: 37aaacd41016 - stable/14 - New login_getcapenum(): Allows to read named enum values List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 37aaacd410163ec3c2ffb3e402ba8c192a26c171 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=37aaacd410163ec3c2ffb3e402ba8c192a26c171 commit 37aaacd410163ec3c2ffb3e402ba8c192a26c171 Author: Olivier Certner AuthorDate: 2023-06-20 16:41:32 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:28:40 +0000 New login_getcapenum(): Allows to read named enum values Reviewed by: emaste Approved by: emaste (mentor) MFC after: 3 days Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40684 (cherry picked from commit 90e914cd5ac1c8ecbf1ea88e9a65e7fa866c17a9) Approved by: markj (mentor) --- lib/libutil/login_cap.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ lib/libutil/login_cap.h | 2 ++ 2 files changed, 48 insertions(+) diff --git a/lib/libutil/login_cap.c b/lib/libutil/login_cap.c index aeda7d5e828b..eeaf12836597 100644 --- a/lib/libutil/login_cap.c +++ b/lib/libutil/login_cap.c @@ -761,6 +761,52 @@ login_getcapnum(login_cap_t *lc, const char *cap, rlim_t def, rlim_t error) return val; } +/* + * Extract a string capability expected to hold a specific value from a list. + * + * 'values' must be a NULL-terminated array of strings listing the possible + * values. + * + * A non-negative return code indicates success, and is the index of the value + * in 'values' the capability is set to. + * + * Negative return codes indicate an error: + * -4: 'lc' or 'cap' insufficiently initialized or not valid. + * -3: System error (allocation failure). + * -2: Capability not found or not a string. + * -1: Capability has a string value, but not one listed in 'values'. + */ +int +login_getcapenum(login_cap_t *lc, const char *cap, const char * const *values) +{ + int ret, i; + char *cand; + const char * const *val; + + if (lc == NULL || lc->lc_cap == NULL || cap == NULL || *cap == '\0') + return (-4); + + ret = cgetstr(lc->lc_cap, cap, &cand); + + if (ret == -1) + /* Cap not found. */ + return (-2); + else if (ret < 0) + /* System error (normally, allocation failure). */ + return (-3); + + ret = -1; + + for (i = 0, val = values; *val != NULL; val++) + if (strcmp(cand, *val) == 0) { + ret = i; + break; + } + + free(cand); + return (ret); +} + /* diff --git a/lib/libutil/login_cap.h b/lib/libutil/login_cap.h index 7312914900a8..0037b41d9055 100644 --- a/lib/libutil/login_cap.h +++ b/lib/libutil/login_cap.h @@ -110,6 +110,8 @@ const char **login_getcaplist(login_cap_t *, const char *, const char *); const char *login_getstyle(login_cap_t *, const char *, const char *); rlim_t login_getcaptime(login_cap_t *, const char *, rlim_t, rlim_t); rlim_t login_getcapnum(login_cap_t *, const char *, rlim_t, rlim_t); +int login_getcapenum(login_cap_t *lc, const char *cap, + const char * const *values); rlim_t login_getcapsize(login_cap_t *, const char *, rlim_t, rlim_t); const char *login_getpath(login_cap_t *, const char *, const char *); int login_getcapbool(login_cap_t *, const char *, int); From nobody Thu Feb 1 21:31:08 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsXY3VfWz58jCq; Thu, 1 Feb 2024 21: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 4TQsXY1JQlz4bs3; Thu, 1 Feb 2024 21: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=1706823069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cs0+MgxEKzp6E1tRx5rJJuJM5QY3qKXmU6ulJdGo2Oc=; b=fhPBemJCKWavFpsEdKmzE8qLFZwda+3YRR7LN37Bn+wXf1Q/1ofS9xqqD8Z6+zYfdq5nSM Dx/quyPQja4ytQ+o/K2whpPVrP/EXgyiMSuJQHIgVtW16FT37hlkyhm1ZP2jVF/qvs8FOx 8iYOoTkVnzIGCCEiCA2FmUr5kxuzfta+urjln40yKErSbCIzqzkBWFD5plgL/5ksTEwOII uZJ1I6A06Ztb/DlkeFsf+JxAzRBu6X/sGqFiwH2CTQPPmd3JZvv1Dks19m3KiGbyr6pAJx 52z1UBeSFa2GRHyAgO4uOuCOLxpvFllT8fGlXCdPji7HHlWvegMrshoX/EiS0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706823069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cs0+MgxEKzp6E1tRx5rJJuJM5QY3qKXmU6ulJdGo2Oc=; b=Ufg+H4A8opXfZObBk/gmfq8vRdrsXyNRPA9ojnB4vQTSAgAnxIwFOzFtx8IDhaLy3UTxCD +62XnRgP5Qfd7nlKn1n/8LJC5dIwBwWwVzN1BJsTNaRkNCTrND/5fmdZ6dXE/SNK0h2F4U HqsaksX/u5BZuh2sg/Q6IHJqDQ7LLklY6cTCH9yEF3j992MpFqaq9EaRRXbn3SLLjVc76W hzLM9K58B/TQAs/WYLoVg3L1SApPteF9j9kYiRTRDC0G3H7Dx1FgkXVpQUMSBcP5sY5bwy lfQjKxYj7UdHbbo35hpELVvHMCOiE3pQQxOfuGN9gWeTHLL9vNlFhayE7eQxCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706823069; a=rsa-sha256; cv=none; b=KWajHvoapJQVhd57LALE9DeJUJgegVDfC0+X1S9yJhtMKOX5yXvJPowtCANft6tkUQLU2Y J3gYTe+/s7cBfgOvYpVcR7mk1sU6VfpS2IxVh/7xBzRpY9mN8+SAYXP7pOkT76On/TD7D4 TWYlAf/P0gHX4yv+Dw3UEuwdYiZewL6PxT7KxG/NSLw2xcimPbiGiLxd/X1+BKYWStSBBt jSE8rqlSfJ4wn00J7VDNb7qKiJfQWJ6iXZMSefID6JMCBZrAlbZVXsp2LOxLBpSGkl9oFd vT/qg5bUsMZr2zbwQHQLUy3OApdEQk8C4JikbXbUyYql1AUXw9sJHYCjVKABIQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsXY0PfJz1Gw0; Thu, 1 Feb 2024 21: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 411LV8Cd080464; Thu, 1 Feb 2024 21: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 411LV87e080461; Thu, 1 Feb 2024 21:31:08 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:31:08 GMT Message-Id: <202402012131.411LV87e080461@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: 44c898329da1 - stable/14 - login_cap(3): Document login_getcapenum() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 44c898329da12257b298cd48736cd2113ed5a6d8 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=44c898329da12257b298cd48736cd2113ed5a6d8 commit 44c898329da12257b298cd48736cd2113ed5a6d8 Author: Olivier Certner AuthorDate: 2023-06-20 20:09:57 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:28:46 +0000 login_cap(3): Document login_getcapenum() Reviewed by: emaste Approved by: emaste (mentor) MFC after: 3 days Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40685 (cherry picked from commit 97256feb7a65cccac51a03846c5308894a2cb445) Approved by: markj (mentor) --- lib/libutil/login_cap.3 | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/lib/libutil/login_cap.3 b/lib/libutil/login_cap.3 index 0281c8428ed5..86142c3b19f9 100644 --- a/lib/libutil/login_cap.3 +++ b/lib/libutil/login_cap.3 @@ -25,6 +25,7 @@ .Nm login_getcapbool , .Nm login_getcaplist , .Nm login_getcapnum , +.Nm login_getcapenum , .Nm login_getcapstr , .Nm login_getcapsize , .Nm login_getcaptime , @@ -60,6 +61,8 @@ .Fn login_getcaptime "login_cap_t *lc" "const char *cap" "rlim_t def" "rlim_t error" .Ft rlim_t .Fn login_getcapnum "login_cap_t *lc" "const char *cap" "rlim_t def" "rlim_t error" +.Ft int +.Fn login_getcapenum "login_cap_t *lc" "const char *cap" "const char * const *values" .Ft rlim_t .Fn login_getcapsize "login_cap_t *lc" "const char *cap" "rlim_t def" "rlim_t error" .Ft int @@ -459,6 +462,31 @@ If the given capability tag cannot be found, the parameter is returned, and if an error occurs, the .Fa error parameter is returned. +.It Fn login_getcapenum +This function returns whether the searched capability is a string with value +among a predefined set passed in argument +.Fa values +as a NULL-terminated array of strings. +.Pp +A non-negative value indicates a match and is the index of the capability's +value in array +.Fa values . +Other possible return values are: +.Bl -tag -width "-4" +.It -4 +Returned if +.Fa lc +or +.Fa cap +are insufficiently initialized or invalid. +.It -3 +Returned on allocation failure (out of memory). +.It -2 +Returned if the capability isn't specified or its value is not a string. +.It -1 +Returned if the capability is specified and a string but its value is not among +.Fa values . +.El .It Fn login_getcapsize .Fn login_getcapsize returns a value representing a size (typically, file or memory) From nobody Thu Feb 1 21:31:10 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsXZ451gz58jDK; Thu, 1 Feb 2024 21:31:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TQsXZ2LzBz4bs8; Thu, 1 Feb 2024 21: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=1706823070; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mt77MkzPaOalxlQUrIQasg4ZDxf86ZITEJNzn7R/NMg=; b=Gsscg4ErRGgegc0Vpw6JUrRfJ1AesBvWC62+AZLehTqYWmq0AwhWnUuzo6QIAzjdEtqC9J qkOd7TTeSE7dP1jGixFmoz0BBjoJ5rsD3cxdgjecAe4z3oeZ+fyVEVwGahqNhoxkec5S2i nIKuDgEjTUF2e37qepztQWRmT0fwTigkwCk69QkCGUAnk8Sq6xRktaPcHZxhQKK1i7I2y5 VuKU7T7We4enOiWWSxOUoUb52YE1Cb3PxwD6U9AfvNVUCTHo2aCcwtf+KiyApuDq8Q1qpq k5keK18ycIAUT8uYiRRZuH+8QusIxjfhIQqmsRnySm/MEsSW9uQynGS3I9Kwdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706823070; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mt77MkzPaOalxlQUrIQasg4ZDxf86ZITEJNzn7R/NMg=; b=vdOM/GtSPmG45j6UI87dt57uBDtpZk3c/oy/jOTtzcr+0yO/oTiY+wGETY5v5NzQRZXNSP slJSD6NcxsOdTPDXHKpsZp3edsyYn+TZY5L6yzKyh2n/DszvAPnZ/H9LyuFkA0TdGGWihS iCY3KiGfKbTrP0TcorZcNeVSYcn0McVTuKl44q8QB3T55g9IY7uNoV2Xe0G+hLquSguYc7 KgZlQT0qhls3SEStIeXz0Hnc9dkzk+NIyapYZBIGeVyLyfZPexGEPCzoMr588Gn4Dj2D1Y MaSxOqfUeEbPa6GkpYpQsNYROAP/DuERb9wsSISEbV+OgJQjYpSOfa6BdgaVTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706823070; a=rsa-sha256; cv=none; b=FKFJxLEnmMHe7zX7wwNCfIFZp2FuN9twa79sN6lPdNTN4jt4y16EqqkScCMculpf4rBDUU KmF4ptEX8m+GLFYB17ekMn7UEC/nIO7d0tEDj2Ew7A5OTIpX7TaKZ45Oz3j0U8ZKM07jsk iIYJkRfLJ63dhhR0RHZOoADOQSeZLERGjYjLzbWrR7AMZoK3TBzlaUnKCLpAik1L9EaLcK 9MVbCTQwevDFpagGsllwuOkpL1v/AQrw5SC8O2dAJ+wQ8t8XhVusQQuh2i7aQ0lMxtmZA5 Hj+dTjBEtyEodI0ieBmbUXwNhjBNZM4+8gRkfMT0F6MojVt8PomqhZJsYIEfmA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsXZ1SmCz1Gw1; Thu, 1 Feb 2024 21: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 411LVAWo080517; Thu, 1 Feb 2024 21: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 411LVA06080514; Thu, 1 Feb 2024 21:31:10 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:31:10 GMT Message-Id: <202402012131.411LVA06080514@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: 787abe7d6eb6 - stable/14 - setusercontext(): Set umask in a separate function, setclassumask() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 787abe7d6eb64cefe0d92a6a9f00324f960bd55e Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=787abe7d6eb64cefe0d92a6a9f00324f960bd55e commit 787abe7d6eb64cefe0d92a6a9f00324f960bd55e Author: Olivier Certner AuthorDate: 2023-06-20 16:46:31 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:28:52 +0000 setusercontext(): Set umask in a separate function, setclassumask() Reviewed by: emaste Approved by: emaste (mentor) MFC after: 3 days Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40686 (cherry picked from commit 0dd1705f584947625892988afe59e4cedb5cdd09) Approved by: markj (mentor) --- lib/libutil/login_class.c | 59 ++++++++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 26 deletions(-) diff --git a/lib/libutil/login_class.c b/lib/libutil/login_class.c index 2b85425d8d8e..69230db32961 100644 --- a/lib/libutil/login_class.c +++ b/lib/libutil/login_class.c @@ -381,6 +381,37 @@ setclasscontext(const char *classname, unsigned int flags) } +/* + * Private function setting umask from the login class. + */ +static void +setclassumask(login_cap_t *lc, const struct passwd *pwd) +{ + /* + * Make it unlikely that someone would input our default sentinel + * indicating no specification. + */ + const rlim_t def_val = INT64_MIN + 1, err_val = INT64_MIN; + const rlim_t val = login_getcapnum(lc, "umask", def_val, err_val); + + if (val != def_val) { + if (val < 0 || val > UINT16_MAX) { + /* We get here also on 'err_val'. */ + syslog(LOG_WARNING, + "%s%s%sLogin class '%s': " + "Invalid umask specification: '%s'", + pwd ? "Login '" : "", + pwd ? pwd->pw_name : "", + pwd ? "': " : "", + lc->lc_class, + login_getcapstr(lc, "umask", "", "")); + } else { + const mode_t mode = val; + + umask(mode); + } + } +} /* * Private function which takes care of processing @@ -394,32 +425,8 @@ setlogincontext(login_cap_t *lc, const struct passwd *pwd, unsigned long flags) if (flags & LOGIN_SETRESOURCES) setclassresources(lc); /* See if there's a umask override */ - if (flags & LOGIN_SETUMASK) { - /* - * Make it unlikely that someone would input our default sentinel - * indicating no specification. - */ - const rlim_t def_val = INT64_MIN + 1, err_val = INT64_MIN; - const rlim_t val = login_getcapnum(lc, "umask", def_val, err_val); - - if (val != def_val) { - if (val < 0 || val > UINT16_MAX) { - /* We get here also on 'err_val'. */ - syslog(LOG_WARNING, - "%s%s%sLogin class '%s': " - "Invalid umask specification: '%s'", - pwd ? "Login '" : "", - pwd ? pwd->pw_name : "", - pwd ? "': " : "", - lc->lc_class, - login_getcapstr(lc, "umask", "", "")); - } else { - const mode_t mode = val; - - umask(mode); - } - } - } + if (flags & LOGIN_SETUMASK) + setclassumask(lc, pwd); /* Set paths */ if (flags & LOGIN_SETPATH) setclassenvironment(lc, pwd, 1); From nobody Thu Feb 1 21:31:11 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsXb5bqqz58hfK; Thu, 1 Feb 2024 21: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 4TQsXb34L9z4bxr; Thu, 1 Feb 2024 21: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=1706823071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l86Nny6ORBOqOhDlI8PjtGkwagvEdQc7fuTdJWfh3/Q=; b=VbWMrKi8JyNM1x9f4uoFpcUyF8XRmiCFFMUXEHliiKJMaEPePIRENVFqOV/61ntTw0kMgY kftaPAyrKicZy2eiTN0S60Bjcxp3IhUOk1StGORtRUQS0hy5EarlHW9jCNmFsg5v0YRyo3 Dq1oNcB4UOf3pqHsNNFvDKlGWdkSSW4AzkY/KavTyQOnK0C6ZeNK6Cl5Ad26rGpz7E+avw 0Oeari7Z+Ts8EMSTTrIWa2c/stMD+H63OzGw3AZxdrxagE/8GYR6uj8+RBbjtnIpsDvSLL zI47KF+oXlXIfSonRlDcAsvlw3BtCyvulgzLjf1+Iasnb6ZZBemPwQAwREjscA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706823071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l86Nny6ORBOqOhDlI8PjtGkwagvEdQc7fuTdJWfh3/Q=; b=Eq8iAS7rxTDm0VKxFSHlaVffrhK9nSGyhWapNqvlglJMqxPmkl33qTBvO3cKFxPvMkLNFg h5CVD7KXDTY2rGTVolK0dd7sUbko8Vs8dH3ALv+W+TaX7Ur+MPV9vGYyriSjtbdEMGgy8c EI9+sHSLpIeqGU7ogePFhA1suIuN/sgODoXdGITWrIVRP2IqyznySStUCZ/1kI0ep3z2fJ omxE+niqWdhaOrw3GLkx8KBpd0OWc8nZxcu8adG6/jtISrehmje8wV8EkLGsaCKx3rF1sA J8a7oPpqWk/vJQgBxdp9aNJ++G5J3CCUSIF4mzxw7GQ1dA3b+/HEGsHI/HSBXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706823071; a=rsa-sha256; cv=none; b=EQmpQkLZ5U8Fw5aXX2/SoeyzsCpNTLCoIJpN+0QCqCX2tXo/lq37oibFzLcsCRZ7haRwBY VsESQywxHMibLMoprmsW+R4X9nqE+BHnXvKULFIB5b3DnwktOHJT02Dito8gUGLOsmjQTH mUGLFGc/OSb1i5DDQVEL6KHM0lPuNCepE/ZlGi2QxQhWCpNQqYHIJi5wsEw3YhvTOuZ9rt TK6lZTQ9jQLcuf1ows23WHNzoO/uG0FBmr3jjlrxjanZzogp1wB8ecI4EFHa7HtODQ6aEh WP7W5aiPP8yFoiBxzcwZnF0nSo2IyUXb6aWgGXvNZ/XVE/qe9gppeRJZTYhp+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 4TQsXb28bqz1J5G; Thu, 1 Feb 2024 21: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 411LVB0q080562; Thu, 1 Feb 2024 21: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 411LVBkb080559; Thu, 1 Feb 2024 21:31:11 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:31:11 GMT Message-Id: <202402012131.411LVBkb080559@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: 6f6186e19fe5 - stable/14 - setclassumask(): Accept 'inherit' as a value List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6f6186e19fe5a56af8bc52b7a20ca19f5f5e73c3 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=6f6186e19fe5a56af8bc52b7a20ca19f5f5e73c3 commit 6f6186e19fe5a56af8bc52b7a20ca19f5f5e73c3 Author: Olivier Certner AuthorDate: 2023-06-20 19:41:04 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:28:58 +0000 setclassumask(): Accept 'inherit' as a value 'inherit' explicitly indicates that the umask should not be changed. Reviewed by: emaste Approved by: emaste (mentor) MFC after: 3 days Relnotes: yes Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40687 (cherry picked from commit c328e6c6ccaa4cdf921c16d68a2f2c5992dd3b72) Approved by: markj (mentor) --- lib/libutil/login_class.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/libutil/login_class.c b/lib/libutil/login_class.c index 69230db32961..e6485afade43 100644 --- a/lib/libutil/login_class.c +++ b/lib/libutil/login_class.c @@ -381,6 +381,11 @@ setclasscontext(const char *classname, unsigned int flags) } +static const char * const inherit_enum[] = { + "inherit", + NULL +}; + /* * Private function setting umask from the login class. */ @@ -392,7 +397,13 @@ setclassumask(login_cap_t *lc, const struct passwd *pwd) * indicating no specification. */ const rlim_t def_val = INT64_MIN + 1, err_val = INT64_MIN; - const rlim_t val = login_getcapnum(lc, "umask", def_val, err_val); + rlim_t val; + + /* If value is "inherit", nothing to change. */ + if (login_getcapenum(lc, "umask", inherit_enum) == 0) + return; + + val = login_getcapnum(lc, "umask", def_val, err_val); if (val != def_val) { if (val < 0 || val > UINT16_MAX) { From nobody Thu Feb 1 21:31:12 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsXc6j0kz58jDR; Thu, 1 Feb 2024 21:31: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 4TQsXc3tcnz4bgg; Thu, 1 Feb 2024 21: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=1706823072; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yEB+rw+XFxIfrAU/RD9iKNHHP5nBIBh/KzAQpuD7wW4=; b=FvTMcylzLBD+/aWgDDRq84wv5fiwvSJxY0x+/mqlAV1rWSo4FZd9Buu1QnFfFGc6XAvYX+ MQEU6IdkfwbryKCII0GbbDQirV7r2pL4IDFC/cvQ8rz6uemi8E4nFeFp19eZ4MU8rLOk4a OKV8v4N2k9z5nmLk9hVlko9kv/D/jkU4v7VAcZ2EvSPAoxDrH3vJ9xiBo+lsYBbXdgikjX m+7F3XsbeaSNyBUWAQ95xsnM7DoLn/fE/lnKBkpjUo9hYkM2TwtLpNbbeg65IPIbXhvJAg 7WPK638Xq5cXiUyUM8poSS2zK/sVJkor5wzn1RGDZlkYbqGNosQRdARvesSAVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706823072; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yEB+rw+XFxIfrAU/RD9iKNHHP5nBIBh/KzAQpuD7wW4=; b=G9+fvNdNAZZ9oDhe8hPBfsr3ffinV2F+N9snxLr9WrNkiZPEVHblPaqSdHnsj6ytARIALV 7hJPd1DsM2l05zbWFgfBGGTi0+oEe6Pife0azHrJrFldl+L64hZuVfbnYo7ZoMHD4Lu4SD uH1/EmaW9JT6d6sSWSuvRcda+SPAc5wUW05eXeQudXitXnGmBafrKVJdC7X5RUflZAh2ie 1ZL8xZuJ11W4rA0DoNFUFgc6HMuC5zM/48ImDhVznZbG9ph19+Md2ln+cjEM8Tw+zVvkiG kM6QoAtfU7vJD9JN68j0hoeTxfipXF4IsHr9gThBuxJ491itvO5aE3/zFufCTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706823072; a=rsa-sha256; cv=none; b=ZzX+1LR70Glsqqt/xvokjGqe4yXBNj1amC6UNGQ3ka8e5Db9mgutVcBVlqb8ogJOVJq/8V bfJleQxfw5KCw36kSOgEISMq+9vr5WFYXh1PcBgvfGmO0hX9Bc/gYzkM6Wo8j/z0JM+5Ie oQyX8bNRDa1RdbS3iQP8kNUrbkNfYWY6nl18D/+xrqW90zrBZhXPgFnYKwJYNKJtkL6sTe DqUxF2wJTzchvRdPwq7PiTAKUvh1advMeq69z4X4vFQysm+O+o0XU80KzmOf8xvCxmtyEj 9LQTPJ8GLIXeS1ou8b+daxEdPCYkiEBbG2OGR2IDlrV7TvcbeMe/7Ar2c9oZzw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsXc2xpyz1Hgk; Thu, 1 Feb 2024 21: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 411LVCul080610; Thu, 1 Feb 2024 21: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 411LVC2G080607; Thu, 1 Feb 2024 21:31:12 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:31:12 GMT Message-Id: <202402012131.411LVC2G080607@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: bbbe9b4c641c - stable/14 - login.conf(5): Document umask's special value 'inherit' List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bbbe9b4c641cdd7996b9e2836476f19f1938cf76 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=bbbe9b4c641cdd7996b9e2836476f19f1938cf76 commit bbbe9b4c641cdd7996b9e2836476f19f1938cf76 Author: Olivier Certner AuthorDate: 2023-06-21 08:42:44 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:29:09 +0000 login.conf(5): Document umask's special value 'inherit' Reviewed by: emaste Approved by: emaste (mentor) MFC after: 3 days Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40688 (cherry picked from commit ea9bd448102b938ccb8d4b484684a6ba2d934931) Approved by: markj (mentor) --- lib/libutil/login.conf.5 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/libutil/login.conf.5 b/lib/libutil/login.conf.5 index 7449c11f2ba5..b2478bb7a88c 100644 --- a/lib/libutil/login.conf.5 +++ b/lib/libutil/login.conf.5 @@ -255,6 +255,9 @@ from other means. .It "timezone string Default value of $TZ environment variable." .It "umask number Initial umask. Should always have a leading 0 to" ensure octal interpretation. +Special value +.Ql inherit +explicitly indicates not to change the umask. .It "welcome file /etc/motd File containing welcome message." .El .Sh AUTHENTICATION From nobody Thu Feb 1 21:31:13 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsXf0sS1z58j06; Thu, 1 Feb 2024 21: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 4TQsXd563cz4bbd; Thu, 1 Feb 2024 21: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=1706823073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wqsMNkX08sd3qpAESuQcDTDi0VwD763W4lmLgUG6mIA=; b=Mw7JKNjCTmc1vMu7GCw6OyT76UwhP+HWlGMo/dm3fqA8u9cgTO9FeGhROjxuAh7NIm1EMG VNdyQFAeJZkCYPQnirH4+ayHrs414pW1wuZ2YIWf4l6LSSnaMUN7VK5MhnSNuFiMR+sV8U 72RL0y2rLUHWJOLg30U7M3/ZGDYx3jckkayRlb3zNTtbY22SeW3O2oXAqD0Gts2XnMy8Xt GK5tpF5xxwosSqzGuiM3us6HrdfGDh9GaTIPV+Py9ssVsaZe8BUgsH6WocE9Rsir/uRJIF 1m0W0sM3iM1cH9oKdrpqlTK6bDBAMHb2yx4yBFre+MAFasbMj0Dse4IbJvV41A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706823073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wqsMNkX08sd3qpAESuQcDTDi0VwD763W4lmLgUG6mIA=; b=slwd8JVmD+DyF/BKTPzv5EJLc2dfUqgLccrALtZAJZQ9gBTgmfvH/yMx6+J9C3UgyltNsr pKtgpQX61eOf+gAPlvWuK5kVjqG/+uvJvdDm8r/bkxCXCCU8XHzn0qnTLapXUz8kMmhcJr IcfkoLHXn1xB3Wh4fIPw2t0SNXc6/OSqp6wmyp06Vt3wO31TzWC5HeZY/H5eTeoTW31hDa pqF9geg/S8VfKYUacXKLduMiSylpGTw2r3Q4rSivQqZRYwaDcGx3n1Eztni1mPRwGRhy3m C9zKnc4aWCO/iBZosFQcJiyFvN/8g/ZiJ30gcsfsgTUXrmPK8b8beDL/hW+Mkw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706823073; a=rsa-sha256; cv=none; b=NokWvG7Li5OgQwLN5geY4qkCp22uZas0F02bCK9BSorFS3q3nM1+QHvQH+L2isbBwAQ7tf BoThVACM8LRqNs/7e06Wh/f1W8U5SIC7CIcBESDUmyT+RQan7dqb9BxOAdArEDSMYCPF7W +zp2eECiaI0xdB3H2uhILWJ3T1jTpu3YeXGbmbNOEBTy8jteMV/WGExGHsFk7Bwv8azzeZ lDx4jeEvSncsHSjn2M4MJeBeF6ZZKRnqk9QQzQkzX2DcG6+No0P2DzW7TurNi3aN9dUxjC Zl5WuKdm98hpe4JMP7PnO5ezunKmMvI4sydf36G1UTPU3F7Sk2djRC+yWN0xAg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsXd4CTcz1HMQ; Thu, 1 Feb 2024 21: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 411LVDWi080653; Thu, 1 Feb 2024 21: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 411LVDCr080650; Thu, 1 Feb 2024 21:31:13 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:31:13 GMT Message-Id: <202402012131.411LVDCr080650@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: 83ac32d9a0f8 - stable/14 - setlogincontext(): Comply to style(9) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 83ac32d9a0f81ccf89f708d159e6d060b53d5a32 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=83ac32d9a0f81ccf89f708d159e6d060b53d5a32 commit 83ac32d9a0f81ccf89f708d159e6d060b53d5a32 Author: Olivier Certner AuthorDate: 2023-05-25 14:29:22 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:29:17 +0000 setlogincontext(): Comply to style(9) Remove indentation by inverting the big 'if (lc)' and using 'return'. Use explicit binary operators to produce booleans. Reviewed by: emaste, kib, dchagin Approved by: emaste (mentor) MFC after: 3 days Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40346 (cherry picked from commit 771d5c93ab5a3fb1701d9706df2ce87d6a9da6f3) Approved by: markj (mentor) --- lib/libutil/login_class.c | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/lib/libutil/login_class.c b/lib/libutil/login_class.c index e6485afade43..33a2189277ca 100644 --- a/lib/libutil/login_class.c +++ b/lib/libutil/login_class.c @@ -431,23 +431,28 @@ setclassumask(login_cap_t *lc, const struct passwd *pwd) static void setlogincontext(login_cap_t *lc, const struct passwd *pwd, unsigned long flags) { - if (lc) { - /* Set resources */ - if (flags & LOGIN_SETRESOURCES) - setclassresources(lc); - /* See if there's a umask override */ - if (flags & LOGIN_SETUMASK) - setclassumask(lc, pwd); - /* Set paths */ - if (flags & LOGIN_SETPATH) - setclassenvironment(lc, pwd, 1); - /* Set environment */ - if (flags & LOGIN_SETENV) - setclassenvironment(lc, pwd, 0); - /* Set cpu affinity */ - if (flags & LOGIN_SETCPUMASK) - setclasscpumask(lc); - } + if (lc == NULL) + return; + + /* Set resources. */ + if ((flags & LOGIN_SETRESOURCES) != 0) + setclassresources(lc); + + /* See if there's a umask override. */ + if ((flags & LOGIN_SETUMASK) != 0) + setclassumask(lc, pwd); + + /* Set paths. */ + if ((flags & LOGIN_SETPATH) != 0) + setclassenvironment(lc, pwd, 1); + + /* Set environment. */ + if ((flags & LOGIN_SETENV) != 0) + setclassenvironment(lc, pwd, 0); + + /* Set cpu affinity. */ + if ((flags & LOGIN_SETCPUMASK) != 0) + setclasscpumask(lc); } From nobody Thu Feb 1 21:31:14 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsXg0X3lz58hvD; Thu, 1 Feb 2024 21: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 4TQsXf69dkz4bhD; Thu, 1 Feb 2024 21:31:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706823074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YAIkZaad4vMZyhYEVIOSKu0s+YamfhBqTXkRLJ4ptbE=; b=FAQLjhy9QSMqpJbfMBrak8m+9ipoEvXyxdEkLti6GDlG2aodSseelk/fgkszfW546gmyaQ uTCUSosgXjlQwYp7nWpCrE93i2J+VgZPb6VhrfgvLsegi+hEcAArKvlOSchBMxO/cXHPCb kBpsIASBQNYckqnxRgO/hQQD3Z32cPaqLLG/VV0r5iE7Ym+jtCGF3O34WsTtOvw7xK4PjW 4m+ZrXbGfRJYuxu6qWqwVxPi1gh836sEijYc9WN+m6mrRXc3L5j1fPlX1juZdDNJePdYza d1NFl9n29YNEMOQmANqxwGFARGxfGQuYim7P9zcd9y/uc/gxX1ygxoKUanG95Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706823074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YAIkZaad4vMZyhYEVIOSKu0s+YamfhBqTXkRLJ4ptbE=; b=q83fBmEE3FxFCvG29GmLc4MrajyFkI87hINHw0MuN6S7IpTM6c7lZSClOgIYYbtD1sQaPJ pMVwESdVJZwEwALLHDJIH4d5hYWcvJv+65aDbWwaYUW+k1dnnldF1t419/Bros3y48APny 0fG8Du9ZKO0uyofKS3NF9u8dDv3pW4ZTkkLV31eNiqqf7MVwkljc+QiCcQ9hfRxGyzrP+y WGW+Wvqf3boZj7AaPKH8vZn/sCMnbGynpzn3MAJWQ5piyKBk2mWl76ZipMXN6BDgx0Uzpr zIqKjfN3Ho8tAPVhKDbIfw1U0jL6YOhErEdHzE7j2CX1BYvn++iIG8wNmcvixg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706823074; a=rsa-sha256; cv=none; b=T+RF0yMfjnAaT0FznIS4Ij2BFcbMMmgC29bejBadreUE/nRmCQ+RKiMhdm59kn76Fam8wH gxDUNA3zm7C3NZmmWbvGBHkOGAugggHpS9ym1kuyUNjG4fZOz4dWCNj1k2Q4Itwj4fGz6T yG9v24yilsRHEhormHnkUilOv3y7/Y0FC6wWwj50yvcqoacAmMd+zgFnhyveTzmJoZ2dks OJ16QjSIpaSvsJlhF4tUkw1VMNps8ohFZJTbm0oyrlqH2xzh/CAMk5gBw5vqJv/+gO1DrS xG7CJN9jOTeA4HVVtnwc8V6JpJMYDe+IPpl91fOdsxecVpsX8gHqPmcAJ5SFBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsXf5H41z1Hby; Thu, 1 Feb 2024 21: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 411LVEI1080712; Thu, 1 Feb 2024 21: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 411LVEFc080709; Thu, 1 Feb 2024 21:31:14 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:31:14 GMT Message-Id: <202402012131.411LVEFc080709@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: 63c3be3b4f4b - stable/14 - login.conf(5): Default values: Rename column, elaborate on absence of such List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 63c3be3b4f4b8383916816c4f756e593474a02b1 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=63c3be3b4f4b8383916816c4f756e593474a02b1 commit 63c3be3b4f4b8383916816c4f756e593474a02b1 Author: Olivier Certner AuthorDate: 2023-05-29 14:06:37 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:29:26 +0000 login.conf(5): Default values: Rename column, elaborate on absence of such Column "Notes" in fact only contains default values for capabilities, so make this clear by renaming it to "Default". Add a small introductory text mentioning it, and what an absence of default value means (inheritance). PR: 271748 Reviewed by: emaste Approved by: emaste (mentor) MFC after: 3 days Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40347 (cherry picked from commit 92b2c4358f57ef84f161efd8370ba4832bd9261a) Approved by: markj (mentor) --- lib/libutil/login.conf.5 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/libutil/login.conf.5 b/lib/libutil/login.conf.5 index b2478bb7a88c..35ca11452811 100644 --- a/lib/libutil/login.conf.5 +++ b/lib/libutil/login.conf.5 @@ -181,9 +181,15 @@ are considered infinite values. The usual convention to interpolate capability entries using the special .Em tc=value notation may be used. +.Pp +Default values are specified in the +.Ql Default +column. +If there is no default, the value is inherited from the process setting up the +login environment. .Sh RESOURCE LIMITS .Bl -column pseudoterminals indent indent -.It Sy "Name Type Notes Description" +.It Sy "Name Type Default Description" .It "coredumpsize size Maximum coredump size limit." .It "cputime time CPU usage limit." .It "datasize size Maximum data size limit." @@ -209,7 +215,7 @@ The maximum and current limits may be specified individually by appending a -max or -cur to the capability name. .Sh ENVIRONMENT .Bl -column ignorenologin indent xbinxxusrxbin -.It Sy "Name Type Notes Description" +.It Sy "Name Type Default Description" .It "charset string Set $MM_CHARSET environment variable to the specified" value. .It "cpumask string List of cpus to bind the user to." @@ -262,7 +268,7 @@ explicitly indicates not to change the umask. .El .Sh AUTHENTICATION .Bl -column passwd_prompt indent indent -.It Sy "Name Type Notes Description" +.It Sy "Name Type Default Description" .\" .It "approve program Program to approve login. .It "copyright file File containing additional copyright information" .It "host.allow list List of remote host wildcards from which users in" @@ -406,7 +412,7 @@ The following capabilities are reserved for the purposes indicated and may be supported by third-party software. They are not implemented in the base system. .Bl -column host.accounted indent indent -.It Sy "Name Type Notes Description" +.It Sy "Name Type Default Description" .It "accounted bool false Enable session time accounting for all users" in this class. .It "auth list passwd Allowed authentication styles." From nobody Thu Feb 1 21:31:15 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsXh2TThz58hrC; Thu, 1 Feb 2024 21: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 4TQsXg6zB2z4c6N; Thu, 1 Feb 2024 21: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=1706823076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+1TqVgY0V70Kfa1jZcqKfaoj6XMsUONSH3WxYtUTWLY=; b=K+nHKKGQgGMwQFZsn/Kvn9oEwg0xI2xPWCe8dfGmFsTQCHxsbYAlJsUcIrIpeyI41+ESuh zALjM+M4026YcHtp1E3dgfR3fn9bQq/yM4BSBzyFyNAioSNXWWJuLChp0Ks2HPynXQPMdL Ha+atIfGtoUSMWtTk6BlbUn1ifidVszNCbqH0Zasj1P0zitrWP0CAX+hwiw3ZaO3IB+6iA LXNLB59wdRvBfAtsVck6i10xD79q7D4RitduKevJVz/JWMHheTWV6zwNK8YfbbXj+t3daw ghqFu4xrqMnK9VTMnbnqR4ajmezitL5ad2ZLVuPrVb5UcQDyUaxpe3ZNTeDUnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706823076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+1TqVgY0V70Kfa1jZcqKfaoj6XMsUONSH3WxYtUTWLY=; b=MGlSXPxUc2qMJKMwGJG9dAMe7d8vk4P4XGul2NvyM7qTPbJQobEpX85ISdNrjurRNYiXkJ yxLfvw8luszs8vxJ6gZzKcOXhzbZ+9+qU8mfzuydOwkZfFKp3uabJlDPuvpZXC38ytRQwP VMYndBqQPj4W+R3YMIqR/mJHVZyyUHrNjN6f4oONCrbU9TwbDcSc6NGFD1/PQcOvQbVLlW W+2dOZUAiChYgUcHv9ulgCN7XjEuSUBOGXDhJzzL3fChfyHRDOaSlxHhybpie4wMVmxbo3 FO7+zSSa8aBPkW2JoE7bG4axPNKsjFcJxW3xHbAD3eOxORiR2Wcxb2+b09ougg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706823076; a=rsa-sha256; cv=none; b=AiXDdm2i1n+9Fx6SbW4HJszTaQP+5NQDcLFc2BkNdYGYGdpRe6b+cklDTrX1oQvyaGSGdI Mpyr07PlB3ivDgjtEsGjKuozdlmQiiVfwZ/YGPyz7EmejAsXC6SSa3gpdFcUaYnlZQ1B1G mjQKd8kr1kGXvzOuTDMxwEu8l0pa2OUhCB85NS8M29Sbibp0/Zgb3GSodAfY102l+AGPO9 1JwgiXpz92XBTHpr6h7NM+RVir3IBRtrFDsLXzalmnzDcTO/Plb0gGUNrFMxdpV5SIwgEr Fwr0sG5mpBU1LzDWNdjMHomlJCwha2oIXDJEpXDm1+rEzsiDfcNXTJ2afJQvrQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsXg64dPz1Hgl; Thu, 1 Feb 2024 21:31:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 411LVFLH080770; Thu, 1 Feb 2024 21:31:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 411LVFFi080767; Thu, 1 Feb 2024 21:31:15 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:31:15 GMT Message-Id: <202402012131.411LVFFi080767@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: f17cc92d15ff - stable/14 - setusercontext(): Better error messages when priority is not set correctly List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f17cc92d15ffb4cfe59d3e268f324ffb22175424 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=f17cc92d15ffb4cfe59d3e268f324ffb22175424 commit f17cc92d15ffb4cfe59d3e268f324ffb22175424 Author: Olivier Certner AuthorDate: 2023-05-29 16:39:04 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:29:35 +0000 setusercontext(): Better error messages when priority is not set correctly Polish the syslog messages to contain readily useful information. Behavior of capability 'priority' is inconsistent with what is done for all other contexts: 'umask', 'cpumask', resource limits, etc., where an absence of capability means to inherit the value. It is currently preserved for compatibility, but is subject to change on a future major release. Reviewed by: emaste, kib (older version) Approved by: emaste (mentor) MFC after: 3 days Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40349 (cherry picked from commit d988621b0c25209866ed5a98b1a8b20269935761) Approved by: markj (mentor) --- lib/libutil/login_class.c | 51 +++++++++++++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/lib/libutil/login_class.c b/lib/libutil/login_class.c index 33a2189277ca..9c3285736f3b 100644 --- a/lib/libutil/login_class.c +++ b/lib/libutil/login_class.c @@ -474,9 +474,7 @@ setlogincontext(login_cap_t *lc, const struct passwd *pwd, unsigned long flags) int setusercontext(login_cap_t *lc, const struct passwd *pwd, uid_t uid, unsigned int flags) { - rlim_t p; login_cap_t *llc = NULL; - struct rtprio rtp; int error; if (lc == NULL) { @@ -493,30 +491,49 @@ setusercontext(login_cap_t *lc, const struct passwd *pwd, uid_t uid, unsigned in /* Set the process priority */ if (flags & LOGIN_SETPRIORITY) { - p = login_getcapnum(lc, "priority", LOGIN_DEFPRI, LOGIN_DEFPRI); + const rlim_t def_val = LOGIN_DEFPRI, err_val = INT64_MIN; + rlim_t p = login_getcapnum(lc, "priority", def_val, err_val); + int rc; + + if (p == err_val) { + /* Invariant: 'lc' != NULL. */ + syslog(LOG_WARNING, + "%s%s%sLogin class '%s': " + "Invalid priority specification: '%s'", + pwd ? "Login '" : "", + pwd ? pwd->pw_name : "", + pwd ? "': " : "", + lc->lc_class, + login_getcapstr(lc, "priority", "", "")); + /* Reset the priority, as if the capability was not present. */ + p = def_val; + } if (p > PRIO_MAX) { + struct rtprio rtp; + rtp.type = RTP_PRIO_IDLE; p += RTP_PRIO_MIN - (PRIO_MAX + 1); rtp.prio = p > RTP_PRIO_MAX ? RTP_PRIO_MAX : p; - if (rtprio(RTP_SET, 0, &rtp)) - syslog(LOG_WARNING, "rtprio '%s' (%s): %m", - pwd ? pwd->pw_name : "-", - lc ? lc->lc_class : LOGIN_DEFCLASS); + rc = rtprio(RTP_SET, 0, &rtp); } else if (p < PRIO_MIN) { + struct rtprio rtp; + rtp.type = RTP_PRIO_REALTIME; p += RTP_PRIO_MAX - (PRIO_MIN - 1); rtp.prio = p < RTP_PRIO_MIN ? RTP_PRIO_MIN : p; - if (rtprio(RTP_SET, 0, &rtp)) - syslog(LOG_WARNING, "rtprio '%s' (%s): %m", - pwd ? pwd->pw_name : "-", - lc ? lc->lc_class : LOGIN_DEFCLASS); - } else { - if (setpriority(PRIO_PROCESS, 0, (int)p) != 0) - syslog(LOG_WARNING, "setpriority '%s' (%s): %m", - pwd ? pwd->pw_name : "-", - lc ? lc->lc_class : LOGIN_DEFCLASS); - } + rc = rtprio(RTP_SET, 0, &rtp); + } else + rc = setpriority(PRIO_PROCESS, 0, (int)p); + + if (rc != 0) + syslog(LOG_WARNING, + "%s%s%sLogin class '%s': " + "Setting priority failed: %m", + pwd ? "Login '" : "", + pwd ? pwd->pw_name : "", + pwd ? "': " : "", + lc ? lc->lc_class : ""); } /* Setup the user's group permissions */ From nobody Thu Feb 1 21:31:16 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsXj41lxz58hrJ; Thu, 1 Feb 2024 21: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 4TQsXj18Cyz4c0D; Thu, 1 Feb 2024 21: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=1706823077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dXDUGbtjUZ9fnOx3VdhRLdha6flHkIQ6KUcgvjF+wsE=; b=LkQxrPOG4sLYSSpo8HkvT7vFkOYz8vUq9Pj6B1rkfDxn2kqXHoORIhA1yIj2B7+6OZd8Lo QtoG2Qi1Cf1iqHvs+b4k1UwyhQYL5LmssXp7X44HJskh90rSKPNMHSenslHBXjMRLua9U4 8RyPZBK96koLeUgKmbPmmkjUsQdCZ2siVoHSOA7UcRmIatGjHfA5Z7hSwflURRzYYOazR+ O6Re51T0RIW9QrYe/aCwoGLBSKr/zmT87kJlaoTSGaDfLI9qIaFrQ1YOrMjKgvAGLiR7SP 8a7vw9fQ133nLiYFAyS1cYmG53LB1aPIYXNGbpEAgG2rwIPByvlmDD3vgT5/tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706823077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dXDUGbtjUZ9fnOx3VdhRLdha6flHkIQ6KUcgvjF+wsE=; b=mfYSWQGKvC/2JQgs8zN0CHEA9dfvxrly1vmBZ2kH4iFWwR5DbBoamqU8axzZo12souRiUO hk4VNEmsog3VYFHbcEPebWo1wUCzAOwTNEd3toaGLvk092UDdF/phuN0659Xs1ip+n/MMi PVEgjIbRqMzyDPQ/mYJU8Mua4enom5cEdj/pLyAL/h/0Kns0/qcfGLBc99p9kk/tMM5rye V1DKrFGrz8xhyAuXCX0m9WfK4eopYQ7mbZSjEDHM7gcuNdMxOmeAOhGumFKHX9XQehU9Pm phDaIf0TQFI8oiRcG95l18ReCwnv2Gb3OirTSDUK5Y7mWpxAh9hBcP+nNYEl8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706823077; a=rsa-sha256; cv=none; b=XJBSHsq6XiyLhRXhRNRi+Jbb8DyqvQsVacYCjzaEckSfZXB16vOS9MWMxffd2d0ZuNvZ3K IIJxsNJHTeqUDHNVzS4XNuRPXaM50pQCqzzapufc3OzgGMW6ZwTByH3N213ypxOEqWlj8r qBJzsSUOlb30dE1ozLis6kt25cpOZF8kpW1z7oj9md90AJ0XOTt4IKJ1K5iobVxlYj6iaL OOvv8PwHQLAHv2HLSemGnAckUlFFBxCRWlmmhIPXzTgZmkcy33vfv2+zysToTO88HxQMs9 yFkfs/z/fcWYOnv3rmAceWQMGY5NHuU7gcYqiV4D3/wKPFzm9aTNhSLffzf63w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsXj0FkGz1Ht7; Thu, 1 Feb 2024 21: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 411LVGQF080818; Thu, 1 Feb 2024 21: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 411LVGWa080815; Thu, 1 Feb 2024 21:31:16 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:31:16 GMT Message-Id: <202402012131.411LVGWa080815@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: e7b89962dc6d - stable/14 - login.conf(5): Document priority's default and possible values List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e7b89962dc6d26badc3d524235fd9bf29c1b44ac Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=e7b89962dc6d26badc3d524235fd9bf29c1b44ac commit e7b89962dc6d26badc3d524235fd9bf29c1b44ac Author: Olivier Certner AuthorDate: 2023-06-21 08:39:15 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:29:41 +0000 login.conf(5): Document priority's default and possible values Priority is reset to 0 if not explicitly specified. While here, be more explicit about what "Initial priority (nice) level" means and document that it is possible to set real-time or idle class' priorities with this capability. Reviewed by: emaste Approved by: emaste (mentor) MFC after: 3 days Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40689 (cherry picked from commit aa96945e71b0f724e6ce673194d23f58d2d637d3) Approved by: markj (mentor) --- lib/libutil/login.conf.5 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/libutil/login.conf.5 b/lib/libutil/login.conf.5 index 35ca11452811..4a98ee818139 100644 --- a/lib/libutil/login.conf.5 +++ b/lib/libutil/login.conf.5 @@ -247,7 +247,21 @@ for details. .It "nologin file If the file exists it will be displayed and" the login session will be terminated. .It "path path /bin /usr/bin Default search path." -.It "priority number Initial priority (nice) level." +.It "priority number 0 Initial priority level." +A value in the nice range +.Pq -20 to 20 included , +extended below with the 32 real-time class priorities +.Po +so -52 maps to priority 0 in the real-time class, -51 to 1, and so on until -21 +which maps to 31; see +.Xr rtprio 1 +.Pc +and above with the 32 idle class priorities +.Po +so 21 maps to priority 0 in the idle class, 22 to 1, and so on until 52 which +maps to 31; see +.Xr idprio 1 +.Pc . .It "requirehome bool false Require a valid home directory to login." .It "setenv list A comma-separated list of environment variables and" values to which they are to be set. From nobody Thu Feb 1 21:31:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsXk4fKtz58hfX; Thu, 1 Feb 2024 21: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 4TQsXk3rvLz4bwp; Thu, 1 Feb 2024 21: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=1706823078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rYlyO8HvQqvfg/ubEgdpMBEP74KabcS6vRMh6CWBflk=; b=coJN3yP86MZoZH/riMma96cco0gxg54TC1XiqYJOUiTBkgUhPFV1vi4ZSadrhM6gGy5YuT OA5OpswFlh1zD+zFpogMiRYKfFcd77PGNiL9Xi6/U7wvPPrHJbXTIxTlpy56iUbYq9nJjk JknwavBGpz3zx+tzNzLxg1wYooxNrUS+WL7nHuiEMLO6wjCjQVQxqo8hurjNz3qz8nKDB5 tMydxmh8dgu54undTFxcFlT0xyvn/VqDeDI0uMd7EjCGDE7ji/1/J/ET3RbzmFq3qQIAXv rI7N3PyZWm6nD5U/z29yhYsRUmvoZJWZ2yO/0lNoejxzRyiYQg/j1RLaAC86fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706823078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rYlyO8HvQqvfg/ubEgdpMBEP74KabcS6vRMh6CWBflk=; b=cynpPy65y2o+FsfdcQUOjhz+tDyAB7P/MQ501pvdMU+V3X3fw71gam5hrnohkcRv2fFP8J aygraqzUJb/WanIqAOROIThJdcw79c804mX/9nQltRYURRgYbowdQvMYexpyE6NJOUQat1 WZamcZ+59WXbioqwErbFmnTzGDOK25PWv1kp2P7CpknkcIJ+cwQE+ZDDP6fkjIowV2Zz+X j3mjnyFGTgk2wcLkfQ2o1Bveo6ZRFcB7zWzd8pID7BuHihvp/EcOYl4qMUeRm4fSC/XkDJ sV2Gr2B4u8UkeP8zAFTNyFVlR6n33mAZrpnE+NlDdm9wIX951+y3UiBV2P0rdQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706823078; a=rsa-sha256; cv=none; b=jVq7DjA7VlfAtcY0e3oWU6FNWhLxJbC5DF93VZgkthh0GWSqm+IjTVbvPEbSkiaMRNW9L2 ujrRcdte/WtYAbjnkmSyt8sd6XPG8souiB0yI2kKAA3N+M4niM9XjAFo7kOzYg3vkqlCZq SzwJ2eyRcWaGD7Q81pkg/Fb045GfSfkpPag6cHlYkeezSxgFd6ZGjdSCzjs1kfxtu8nA6k tZUChEp8/vrLDOwGwt+eJvKEf1a6y2me1yxc7BAruG2F07s/9T0W/awdKeW6HXQIVT68f1 01z7SG7xdlIRRPZ+9MrsEcWrgg2BOflbTLQfnlnrTqZ4ION2lpiCkeaZgue8Nw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsXk1HfXz1Gw2; Thu, 1 Feb 2024 21: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 411LVIj9080866; Thu, 1 Feb 2024 21: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 411LVIDX080863; Thu, 1 Feb 2024 21:31:18 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:31:18 GMT Message-Id: <202402012131.411LVIDX080863@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: f49953dd49f2 - stable/14 - setusercontext(): Move priority setting in new setclasspriority() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f49953dd49f28169a5f3b86a414936c095c19ea9 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=f49953dd49f28169a5f3b86a414936c095c19ea9 commit f49953dd49f28169a5f3b86a414936c095c19ea9 Author: Olivier Certner AuthorDate: 2023-05-29 17:09:36 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:29:48 +0000 setusercontext(): Move priority setting in new setclasspriority() In preparation for setting priorities from '~/.login_conf' and to ease reading of setusercontext(). No functional change. Reviewed by: emaste Approved by: emaste (mentor) MFC after: 3 days Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40350 (cherry picked from commit 7b94ec550ef6e7b75d608e125e9b78478197d4e7) Approved by: markj (mentor) --- lib/libutil/login_class.c | 97 +++++++++++++++++++++++++---------------------- 1 file changed, 52 insertions(+), 45 deletions(-) diff --git a/lib/libutil/login_class.c b/lib/libutil/login_class.c index 9c3285736f3b..9d8dc652d678 100644 --- a/lib/libutil/login_class.c +++ b/lib/libutil/login_class.c @@ -456,6 +456,56 @@ setlogincontext(login_cap_t *lc, const struct passwd *pwd, unsigned long flags) } +/* + * Private function to set process priority. + */ +static void +setclasspriority(login_cap_t * const lc, struct passwd const * const pwd) +{ + const rlim_t def_val = LOGIN_DEFPRI, err_val = INT64_MIN; + rlim_t p = login_getcapnum(lc, "priority", def_val, err_val); + int rc; + + if (p == err_val) { + /* Invariant: 'lc' != NULL. */ + syslog(LOG_WARNING, + "%s%s%sLogin class '%s': " + "Invalid priority specification: '%s'", + pwd ? "Login '" : "", + pwd ? pwd->pw_name : "", + pwd ? "': " : "", + lc->lc_class, + login_getcapstr(lc, "priority", "", "")); + /* Reset the priority, as if the capability was not present. */ + p = def_val; + } + + if (p > PRIO_MAX) { + struct rtprio rtp; + + rtp.type = RTP_PRIO_IDLE; + p += RTP_PRIO_MIN - (PRIO_MAX + 1); + rtp.prio = p > RTP_PRIO_MAX ? RTP_PRIO_MAX : p; + rc = rtprio(RTP_SET, 0, &rtp); + } else if (p < PRIO_MIN) { + struct rtprio rtp; + + rtp.type = RTP_PRIO_REALTIME; + p += RTP_PRIO_MAX - (PRIO_MIN - 1); + rtp.prio = p < RTP_PRIO_MIN ? RTP_PRIO_MIN : p; + rc = rtprio(RTP_SET, 0, &rtp); + } else + rc = setpriority(PRIO_PROCESS, 0, (int)p); + + if (rc != 0) + syslog(LOG_WARNING, + "%s%s%sLogin class '%s': " + "Setting priority failed: %m", + pwd ? "Login '" : "", + pwd ? pwd->pw_name : "", + pwd ? "': " : "", + lc ? lc->lc_class : ""); +} /* * setusercontext() @@ -490,51 +540,8 @@ setusercontext(login_cap_t *lc, const struct passwd *pwd, uid_t uid, unsigned in flags &= ~(LOGIN_SETGROUP | LOGIN_SETLOGIN | LOGIN_SETMAC); /* Set the process priority */ - if (flags & LOGIN_SETPRIORITY) { - const rlim_t def_val = LOGIN_DEFPRI, err_val = INT64_MIN; - rlim_t p = login_getcapnum(lc, "priority", def_val, err_val); - int rc; - - if (p == err_val) { - /* Invariant: 'lc' != NULL. */ - syslog(LOG_WARNING, - "%s%s%sLogin class '%s': " - "Invalid priority specification: '%s'", - pwd ? "Login '" : "", - pwd ? pwd->pw_name : "", - pwd ? "': " : "", - lc->lc_class, - login_getcapstr(lc, "priority", "", "")); - /* Reset the priority, as if the capability was not present. */ - p = def_val; - } - - if (p > PRIO_MAX) { - struct rtprio rtp; - - rtp.type = RTP_PRIO_IDLE; - p += RTP_PRIO_MIN - (PRIO_MAX + 1); - rtp.prio = p > RTP_PRIO_MAX ? RTP_PRIO_MAX : p; - rc = rtprio(RTP_SET, 0, &rtp); - } else if (p < PRIO_MIN) { - struct rtprio rtp; - - rtp.type = RTP_PRIO_REALTIME; - p += RTP_PRIO_MAX - (PRIO_MIN - 1); - rtp.prio = p < RTP_PRIO_MIN ? RTP_PRIO_MIN : p; - rc = rtprio(RTP_SET, 0, &rtp); - } else - rc = setpriority(PRIO_PROCESS, 0, (int)p); - - if (rc != 0) - syslog(LOG_WARNING, - "%s%s%sLogin class '%s': " - "Setting priority failed: %m", - pwd ? "Login '" : "", - pwd ? pwd->pw_name : "", - pwd ? "': " : "", - lc ? lc->lc_class : ""); - } + if (flags & LOGIN_SETPRIORITY) + setclasspriority(lc, pwd); /* Setup the user's group permissions */ if (flags & LOGIN_SETGROUP) { From nobody Thu Feb 1 21:31:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsXl48RVz58jDW; Thu, 1 Feb 2024 21:31:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TQsXl2g30z4c4s; Thu, 1 Feb 2024 21: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=1706823079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C9l7fR1F1hcMZnPqVD5NE4eVz2JKJF7L1LLO1hOYH8c=; b=MES9gqsUd0W3ZzPOVYHdxXmUOVAhwxhUxvu8CXLAgpMtDczxobZqmYwLXqMh2KlMW6tJH9 r6eCcoEJ9AJm4ykZH2A0OR+yD9dkOFdmq8YAEuxmbn9ElbyezU707jyThZPGyQVly5rf5y k61vHxMY0WRhJrCRcOS4koDle2n8fcm98A3oBU++/6KvDgtH1WJRRu200na0A/ohn0RsQK Qf770nagyZ9AeagLTuT0iBXCVYtpkrULMzTIitBu7XyvErDn4mYyZTZ9HuX7gNW1T8NYRs MtoFSFSzD8FhtCNgAaL9pQIlgAv8Bz+7DK6rjbyP+6VUxGa66y/if4FzDmdi9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706823079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C9l7fR1F1hcMZnPqVD5NE4eVz2JKJF7L1LLO1hOYH8c=; b=Fc9BYR7sQBzw5mq505pZAzqPGMfpSCZf1ltXBuzucZwcRuMjd9gHW4OO1sGLgAM3qhQwcx 8cZvEtHrDKGvCJw1jIfyqZHdzRwCzs6jlrGLQ26zRugdozIOs5y9Qo23ieVUO4U4RgIHhG sCwMmgcFnIqRg+Fy1Sz4I/++s8WhguvBr7FWiaeh+BY4ErWTIZ+kPWOkP2S+ZcZOGj/7RC 8I3vvDa+p7ur6ms6ppvxMuMKDWCVUrrzxDHHw17RE5MdEJeb+ukX12hz1xmxkFNoHoHFvl xf99fXewLl18x2Gdv06LuCs8nD30g+0pEGNgOEY6xV5l2PI0yBojBsNDgT1z/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706823079; a=rsa-sha256; cv=none; b=f9e5Fh3AYNeibh3cFP+Cl9ztxrrAsfbqIUen1AqMJPmq+tGfL7LHoMT865EpdREWWc6NHH 6F1s7dw8xalfA5lli7eLcDIE+sUL2UNNlFbsktHKiFkZjgPQNcOwTCPTefQ0SROtTlGSyM R0/+PdQwjz6Z/c/nbGtlKhiooJChzkJB0HWme03zF9RzSmTEPru4UK9fA4y0L3sBoV9v9J R7xbxUNQ4IapPWZEmdbZWPTdHyg0rFuykXcndBAQAxXgiOwCDG6kxtAttnkgnKH4h5dulD IqhWBQVDTSMezfxQwsJiHERZ1ofMtJJqPPOI1q9zzsDNHeszJQHdsYtgvxYdkg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsXl1mmtz1Ht9; Thu, 1 Feb 2024 21: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 411LVJHm080912; Thu, 1 Feb 2024 21: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 411LVJg3080909; Thu, 1 Feb 2024 21:31:19 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:31:19 GMT Message-Id: <202402012131.411LVJg3080909@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: a8c273b3c97f - stable/14 - setclasspriority(): New possible value 'inherit' List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a8c273b3c97fa3d0eaf566136d3784257f137d6e Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=a8c273b3c97fa3d0eaf566136d3784257f137d6e commit a8c273b3c97fa3d0eaf566136d3784257f137d6e Author: Olivier Certner AuthorDate: 2023-06-21 08:53:37 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:29:55 +0000 setclasspriority(): New possible value 'inherit' It indicates to the login.conf machinery (setusercontext() / setclasscontext()) to leave priority alone, effectively inheriting it from the parent process. PR: 271749 Reviewed by: emaste, yuripv Approved by: emaste (mentor) MFC after: 3 days Relnotes: yes Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40690 (cherry picked from commit d162d7e2ad327ceada4102c5d6779f9ecd809502) Approved by: markj (mentor) --- lib/libutil/login_class.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/libutil/login_class.c b/lib/libutil/login_class.c index 9d8dc652d678..f545e3661520 100644 --- a/lib/libutil/login_class.c +++ b/lib/libutil/login_class.c @@ -463,9 +463,15 @@ static void setclasspriority(login_cap_t * const lc, struct passwd const * const pwd) { const rlim_t def_val = LOGIN_DEFPRI, err_val = INT64_MIN; - rlim_t p = login_getcapnum(lc, "priority", def_val, err_val); + rlim_t p; int rc; + /* If value is "inherit", nothing to change. */ + if (login_getcapenum(lc, "priority", inherit_enum) == 0) + return; + + p = login_getcapnum(lc, "priority", def_val, err_val); + if (p == err_val) { /* Invariant: 'lc' != NULL. */ syslog(LOG_WARNING, From nobody Thu Feb 1 21:31:20 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsXn0Gxxz58hrY; Thu, 1 Feb 2024 21: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 4TQsXm3X4Pz4c53; Thu, 1 Feb 2024 21: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=1706823080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UkVfu/XtQPhbFXSTAh+BC39kGR/ZnqPgWaGtO3+YYDs=; b=MA69XU+S5B0hW8MsZdIFGqCjX0Ix/2GZGyt69SQUSBnugstAwD0db17CDl4/KnX477mrUB jrxXX1On6eyJryruePO9ZcIOnh2kge2+NEgpDIrbwiTHUi9dyJ43t06XpRozOgUFe/w3dF W+ATK/lz+ahqYgNjwyrp1BtBu6cKLPyFYCmiInyuY5Pl+t/KLmUV4xffbO25PLo2afhR1t 23MGme/SMhSnuT0Nx0ZDIx6SCuf6ZRFwtnsbThxAILePtAOIQU+6Q+lagSjXSFG2qEGCNg W+vddwcazdgb3JhoFYuxRo91T1bR4jcpI7kt+r+y66Q0x0IQwRaHyE7SLCJZ6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706823080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UkVfu/XtQPhbFXSTAh+BC39kGR/ZnqPgWaGtO3+YYDs=; b=uU8wXnwHOBkEDbqufmCPjaeXYGp6tFkoOZhTxqYBeDrPbAklzaDBzPcehrBnO3ez0ZQ+wM XZzERZRgSJUQHxnhGvBwkWCt6R053WAQYoH0DEbosp0dEwl/cMosZ/RJXkRUr4Qq1Mtsuj xwYunps3YzMjCXU0V1fjGceckjUIKtP4CeiaSmG6XwIWvQ7BMcQ3wjDYaGtavJBv2b+zQ6 1tsF46dXm7jfRVUt0/C3fgk8BLuS50bWr6qGIKOk/CduhaIAgs+vPpy9HH9ojcZhI633sr 32YzSOYPmheagJIRTMl/WYLdTXvoVe0stTKED+8kF29/L0uma2p2ZdJsmRVvWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706823080; a=rsa-sha256; cv=none; b=KV5zDirdwvdt/N52FyKhuUG0i7zaPOkwhxIcBZRQkdEgxthGp32bYrVHRoB6QxsTuG+ZPv 1rprPkw70/l/ooHN0MbjlBbNaPDw61Zchfhti4LSslDFilSBduMvBqKAb3fL+8hN2rRY/1 u665Kx9pqkvku1h9Vr/QM/6UnRsqf9l5r22drhVNpvO7Y4xOzKorTWFDRhv8PdLIA7c47Q RjfjSSX3YhqNZ5DOHN+gHI3DOkMi/49LXcuTFPQ0j5XA/unO72CFxv4ymrLDB6w8A1pS72 3aLyc6UCY/CGU+CD9sE43Tld1NzV24vCje7/NvaEnd0BlI2Hb+LSbZQ/VPq1dw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsXm2dXQz1HdB; Thu, 1 Feb 2024 21: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 411LVKOW080959; Thu, 1 Feb 2024 21: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 411LVKHO080956; Thu, 1 Feb 2024 21:31:20 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:31:20 GMT Message-Id: <202402012131.411LVKHO080956@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: a2fe14d73fca - stable/14 - login.conf(5): Document priority's special value 'inherit' List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a2fe14d73fca365f68f352fec875e5570db3ca26 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=a2fe14d73fca365f68f352fec875e5570db3ca26 commit a2fe14d73fca365f68f352fec875e5570db3ca26 Author: Olivier Certner AuthorDate: 2023-06-21 08:39:47 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:30:01 +0000 login.conf(5): Document priority's special value 'inherit' Reviewed by: emaste, yuripv (older version) Approved by: emaste (mentor) MFC after: 3 days Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40691 (cherry picked from commit 33d4ce5496efe96bbaa7663e298876395b1db62c) Approved by: markj (mentor) --- lib/libutil/login.conf.5 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/libutil/login.conf.5 b/lib/libutil/login.conf.5 index 4a98ee818139..a749fe5519ab 100644 --- a/lib/libutil/login.conf.5 +++ b/lib/libutil/login.conf.5 @@ -262,6 +262,9 @@ so 21 maps to priority 0 in the idle class, 22 to 1, and so on until 52 which maps to 31; see .Xr idprio 1 .Pc . +Special value +.Ql inherit +prevents resetting the priority. .It "requirehome bool false Require a valid home directory to login." .It "setenv list A comma-separated list of environment variables and" values to which they are to be set. From nobody Thu Feb 1 21:31:21 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsXn5MMBz58jDf; Thu, 1 Feb 2024 21: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 4TQsXn4KG4z4cCv; Thu, 1 Feb 2024 21:31:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706823081; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JiSK17nb5X05NHxJffnCWA/v8YqNvBJmSekt0YvMCfg=; b=o3b0HhTiV3yyyQ8E4vYi8qZeXFRIlP8SVhjVzjQpLcDQ3ujo4+xWURxX40x+Aiykk/wMpq 5zvVkpZlMVRlMn9ZzlLOjih+Juutz0GVcJJ5oa6aPtNgOrx0/dpjYu6D7b1ZmAytOQDMhG qZ+lmKBYC42fU2xwLCF/+9vRUg+V15K1yvwAQAkEcgvjjXdK5uwpaelzNvFmyxs04Q8nHk uJT2QmnpzeD8H5NC4zq3Gc3jEy9jEakbcGwlppXfo1+36x3VdWzucP3M61EfBMyiofTFmi GDIKqXh3wCWti/CPyBwJd7lQInofYloLlr1V+KakfUpySTshmdtD7AGvEeY4NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706823081; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JiSK17nb5X05NHxJffnCWA/v8YqNvBJmSekt0YvMCfg=; b=wxtOtM8TlVgrOvsbJWRZE04GgueLcG7IlHQoTrN2G6WNddQ104yzQ/CPvpWKgxFqtkkiw/ Qt3oQf77a6wKYjaik9nw/jrp8Ym679KqNRyp92gDsn60/ebroMFvlVZ7GxuMzyqBIJqLyg X5EgJMNRcReVzTEQyU5J2ajkowc794FQA+qa3rPHgFoBVmD9sdw8K2ozWLT5/n3eLb4iKB xVuK8ueIZk2x8KzM6qIHDwMCdrGq7++A/I+leInNWWCqRHCdK/Kg+kE8MWH9IIxQN4ZPIx gin11/IfcFrLeThKhzlZuHctcah7kjc3de/pQH3pg4R/Pj0CcXlj6N6bzWkmiA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706823081; a=rsa-sha256; cv=none; b=w1RT9Ob5NlnqUqs9uI4QG0lIwRcDFNTVd4u6Hso/6YsZV07EfGI0Av7DE/086naC0hlhsL 6ukEfCIenXRPlhwpBDyr7eugopOp9M3q/d4h5RBwn6bSvQZEP5WPIoEwkeAhVqootPVGMC EhEsFOm1QkG61TWr9DTC81laPhQxa88eGtNvJeus7vuqJpUx1YagvGMpf2ANXWOXv7oK9t 0WJY7UrMLNok1v4CWGLm9vksokT+/xyi9fJyiEGKvWvdDesBiVW3T+1dqAda6+65cWH8Xb tUSDzyJveTvC8v/m2VIGtgstcnaR/RFg8sRs+4soKbdlDoGHX3ttgv2JYSqVtQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsXn3R0wz1HwN; Thu, 1 Feb 2024 21:31: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 411LVLBG081008; Thu, 1 Feb 2024 21:31:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 411LVLka081005; Thu, 1 Feb 2024 21:31:21 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:31:21 GMT Message-Id: <202402012131.411LVLka081005@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: d2d66fedc418 - stable/14 - setusercontext(): Set priority from '~/.login_conf' as well List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d2d66fedc418a9bccbe4ea92345f269106d6af32 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=d2d66fedc418a9bccbe4ea92345f269106d6af32 commit d2d66fedc418a9bccbe4ea92345f269106d6af32 Author: Olivier Certner AuthorDate: 2023-05-30 15:14:50 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:30:08 +0000 setusercontext(): Set priority from '~/.login_conf' as well Setting the process priority is done only when the current process' effective UID corresponds to that for which context is to be set. Consequently, setting priority is done with appropriate credentials and will fail if the target user tries to raise it unduly via his '~/.login_conf'. PR: 271751 Reviewed by: kib, Andrew Gierth Approved by: emaste (mentor) MFC after: 3 days Relnotes: yes Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40352 (cherry picked from commit f2a0277d3e51a6a839151eef17f466d0db2b7300) Approved by: markj (mentor) --- lib/libutil/login_class.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libutil/login_class.c b/lib/libutil/login_class.c index f545e3661520..b4e52951bf9c 100644 --- a/lib/libutil/login_class.c +++ b/lib/libutil/login_class.c @@ -622,6 +622,8 @@ setusercontext(login_cap_t *lc, const struct passwd *pwd, uid_t uid, unsigned in */ if (geteuid() == uid && (lc = login_getuserclass(pwd)) != NULL) { setlogincontext(lc, pwd, flags); + if (flags & LOGIN_SETPRIORITY) + setclasspriority(lc, pwd); login_close(lc); } From nobody Thu Feb 1 21:31:22 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsXq0Trkz58jH3; Thu, 1 Feb 2024 21:31: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 4TQsXp5K0kz4cM5; Thu, 1 Feb 2024 21:31:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706823082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GBKkh88KouUP0Ae2iHRwaew7JNU/koEmTld7YGx7X7g=; b=s+F7gN9K/4E0RiRUtGlLgh1llB4giw90gpZToPsXYrUFP4GaXE72jo87FXkclKB6rmBHe2 TkH6q9hTtWz1wMgIBqGzxhDILCP63fAkLfZcM3I0YZiFO3VIGWnSq4Gr7MhmJK2koyDUro 2svIqtQH81RhC0v2X/G0nT9z8BNmK/ArrMGOStY7WvXrQDtK9bfG1hcuMWd6sez0dNkJDB yQUGKP5cxj2vjhOSzUhn3lG8cijZKrYw4YoXPV5uWsEFmuPN3dXWzS0bPIN97kcCZ98F34 Y0S0mp+OcuNCh5BmSAoU+pL98YmQnHaBsjD7U30g1nx0hP/pIqDEpbAwSf9CUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706823082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GBKkh88KouUP0Ae2iHRwaew7JNU/koEmTld7YGx7X7g=; b=a3diu62mjy6lX31g1lFmYOQG3sWELZ9IDyBnG6dXlPYOWPFi9w9fxv1h5cLTw1tLUHRa9F ZqizV++lVgEf3MA25gFAmjnMvd0ps8Yx6BFS4JaJJmXygK8tFz3qd0MvmOduEO2r7IdQkA qDCD/Jpt8A2bXGnfbc7NxsnV/qr5/cFBpcjhRaga+bu4EvW6tBhsvwj/LgB7Yl9C0R9QTy gqkzFY3CM8Ttou4Ox2MGllQJfglP3z7kg5BXs+GYUleJnYQni4FICsAqXhqmzQyhVQpdTX aVyDriaBrcwgK+qIZ57CpMTecjWHv32j9JcqtqymCyB3iLuHRL92C+jFGYMc0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706823082; a=rsa-sha256; cv=none; b=QZyfp2EnwGfTAakDJBDW8f9MZ6tZYLgBeS1apueC2xSu52pGwlpnn1yT7/9h39s83Lknks iZ+V0SO+bk7j0FUDg1X46WOex3R2gT1SS0klShw8lhJgg7VYFLWdE0gqnkNHW+ZxYvXZ8w bP636T2ua4E2Ls/Dr6+VZ2MQ+n3butgr5/324lH06fWStCWE//snrLGZeEQDWjqgxqLig+ fvQqiWIQFkO9X5lwTm+iWSs14gP2Mww3/R8rrgpLNv5Y/JDj/K1RG52GUVEHFkhfTdGMDy oTQQP+JHBNpDtQiOhM7d5n9YzuhVar3yC9Ucz4GlJlrRFK2BfHzXtamQk6cZDw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsXp4Prxz1J5R; Thu, 1 Feb 2024 21:31: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 411LVM5R081044; Thu, 1 Feb 2024 21:31:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 411LVMND081041; Thu, 1 Feb 2024 21:31:22 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:31:22 GMT Message-Id: <202402012131.411LVMND081041@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: ce92a977dbd2 - stable/14 - login_cap.h: Remove LOGIN_DEFUMASK List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ce92a977dbd24301f5f5348d45f51795c5f98786 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=ce92a977dbd24301f5f5348d45f51795c5f98786 commit ce92a977dbd24301f5f5348d45f51795c5f98786 Author: Olivier Certner AuthorDate: 2024-01-25 22:10:40 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:30:14 +0000 login_cap.h: Remove LOGIN_DEFUMASK This public constant has not been used in-tree since 1997 (this was noticed while working on previous commit "setusercontext(): umask: Set it only once (in the common case)"). Since it was an implementation detail and GitHub's code search and Google show no use of this symbol today, simply remove it. PR: 276570 (exp-run) Reviewed by: emaste, kib (earlier version, then part of D40344) Approved by: emaste (mentor) MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D43608 (cherry picked from commit e3a396eb2a029e5dc9161469735aa3f7f16845d1) Approved by: markj (mentor) --- lib/libutil/login_cap.h | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/libutil/login_cap.h b/lib/libutil/login_cap.h index 0037b41d9055..a48246804a47 100644 --- a/lib/libutil/login_cap.h +++ b/lib/libutil/login_cap.h @@ -32,7 +32,6 @@ #define LOGIN_MECLASS "me" #define LOGIN_DEFSTYLE "passwd" #define LOGIN_DEFSERVICE "login" -#define LOGIN_DEFUMASK 022 #define LOGIN_DEFPRI 0 #define _PATH_LOGIN_CONF "/etc/login.conf" #define _FILE_LOGIN_CONF ".login_conf" From nobody Thu Feb 1 21:31:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQsXr1tH6z58jH4; Thu, 1 Feb 2024 21:31: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 4TQsXq6M7Nz4c5f; Thu, 1 Feb 2024 21:31:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706823083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8qz4LuJ9gejPquN3cb04+IHosrDhQAMNZJLol8dxu5M=; b=A7AfgZFlzdhcWQPaaA9i4b3PnKyMNYpvvo0cMfkwYDx0X0OlouXTkAOAoth+Bu11BXlnmN YDh62RcVz4L07p0zowjA7i02nJAh31y/wrSwZ7E1Z5Sv2OlYlWwdM2mfvrK3qJNvzP2F0b gnEVxNMcYMC9d3nvdVHT9gcIhXc1UZdExmrmk9zB3L1yYY/Fek8UXkbduZa4nh1WKDk/io yPf/EnlnhWaUDlb5ZWji9EYZmqkevi34UG5m/UcwpFng6Ukrdl6w71LjkBzT8xmndTowij PcteJGiChTZRa5ok0LaT4XFs4RinIU8rnSaCARjepJkVRt38BEW8uSZA+hInvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706823083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8qz4LuJ9gejPquN3cb04+IHosrDhQAMNZJLol8dxu5M=; b=dGCSklI6mJ/vuifZT5v7dI/lfRn9CmBpgafaq6LK528Ijrd691cuBW3FQjHutN4HxyIPby bDe/wkNqg4jDk500At2Kc1ToHwGJjRjAQ3yqzaspZd7YJcNg7S3I9FgTina9dF/0ICtubu Wi2xiE7BuytduuQzDON/ZpQLjXwnj9Q7h4H82IzJpiCOD8po+QV42GU2hefDwYAb8mI2c5 O1IzH9Jmz5O7RQmEg4q30fH+pcpI0h9rh7MHpkmcBF0aWeXZNBW7iZkfNc1aSwy0+RB9c/ 9angyo5HcMf6wz8CMe+AxDy89Iyzf/s+tXfa2XpO5PHnUpgugA+A95Zh01tZgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706823083; a=rsa-sha256; cv=none; b=D/glcubvdv9bihlk9h4SaSSpB2yA0pGE8K2MhGiQGW0U5SiJFm8rL3Wp9jYr+oFol55kRG mY6Z+VjjR2FR39W0ANDqzlR8SgWqPhu/1eP0e2eHGcOdPTtdjsHMHloVDFjXxyTCyytDpe EkjUumxg6rDTc/wOTGu9NMNFJENOJ+FkBt/C6zjkSBQ+kAW18my/VdKhZdzFmgU6EUzxAU wEnyaQBrcQVxIDw2EfcG5lUPsoj+Uf3uJ12qBZ3K7hLzka2PinYBMsek++BnlVwNUfieI4 u1cKIBLA7r7POFMGIbZ3Tko8y3CyxC/cZeFotvOGY7ALUSZHs8NmuJvYXF9tXA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQsXq5T7Pz1HdC; Thu, 1 Feb 2024 21:31: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 411LVNKq081083; Thu, 1 Feb 2024 21:31:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 411LVNwK081080; Thu, 1 Feb 2024 21:31:23 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:31:23 GMT Message-Id: <202402012131.411LVNwK081080@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: 7e2bfa3d7a2a - stable/14 - login_cap.h: Remove LOGIN_DEFPRI List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7e2bfa3d7a2a3025c6351a35b4ea52cdb2ea9c2f Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=7e2bfa3d7a2a3025c6351a35b4ea52cdb2ea9c2f commit 7e2bfa3d7a2a3025c6351a35b4ea52cdb2ea9c2f Author: Olivier Certner AuthorDate: 2024-01-25 22:25:10 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:30:20 +0000 login_cap.h: Remove LOGIN_DEFPRI This is an implementation detail which is likely to become irrelevant in the future, as we move to not resetting the priority if the corresponding capability is not present in the configuration file ('/etc/login.conf'). GitHub's code search and Google show no use of this public constant, and it doesn't exist in OpenBSD and NetBSD. So, remove this definition and its sole use in-tree. PR: 276570 (exp-run) Reviewed by: emaste Approved by: emaste (mentor) MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D43609 (cherry picked from commit c7e645269f1c7e9872a7ccf6b72f045c55a66793) Approved by: markj (mentor) --- lib/libutil/login_cap.h | 1 - lib/libutil/login_class.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/libutil/login_cap.h b/lib/libutil/login_cap.h index a48246804a47..316d6e62d790 100644 --- a/lib/libutil/login_cap.h +++ b/lib/libutil/login_cap.h @@ -32,7 +32,6 @@ #define LOGIN_MECLASS "me" #define LOGIN_DEFSTYLE "passwd" #define LOGIN_DEFSERVICE "login" -#define LOGIN_DEFPRI 0 #define _PATH_LOGIN_CONF "/etc/login.conf" #define _FILE_LOGIN_CONF ".login_conf" #define _PATH_AUTHPROG "/usr/libexec/login_" diff --git a/lib/libutil/login_class.c b/lib/libutil/login_class.c index b4e52951bf9c..eb16ad501881 100644 --- a/lib/libutil/login_class.c +++ b/lib/libutil/login_class.c @@ -462,7 +462,7 @@ setlogincontext(login_cap_t *lc, const struct passwd *pwd, unsigned long flags) static void setclasspriority(login_cap_t * const lc, struct passwd const * const pwd) { - const rlim_t def_val = LOGIN_DEFPRI, err_val = INT64_MIN; + const rlim_t def_val = 0, err_val = INT64_MIN; rlim_t p; int rc; From nobody Thu Feb 1 22:04:30 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQtH33JLgz58lg2; Thu, 1 Feb 2024 22:04:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TQtH317Zcz4ldr; Thu, 1 Feb 2024 22:04:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706825071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=37iqfLQViu5NulLv+5zPgF3FmLPs3R9HzPuPIRKOvJk=; b=iZVj98cBZGjTOC+gARmLRnT50ywBBC6MGuFhQ4KTAaqBuqYijg55rdisVUq64+mIsDb4hE Sta3JmSrmQ4hL0XMShH0qzwxZlg9ELYEE/gWgHqGBleS45XTuS5mdJ4KLIxmPTn05o7VIh V2nWsE8wGpWykFLGSfGsB1xv3SaKVDwb+ObzgCdcSkr73J0JarOOqb8dG1aEy/KmhaFqej PomZAyA8SApfq6fJMqB0Yxe1UvKPITDcCDwvsJoOChZKImjEsVFqME2ST8+6beXKSDaXxI gkJwdkOmSPLbqSOZCigw2pKQO3oTwTWkX3Vzd7fTJMjHnF+o9nd+EE1xHl5b9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706825071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=37iqfLQViu5NulLv+5zPgF3FmLPs3R9HzPuPIRKOvJk=; b=RpueAkg8v2SuZULwTHXApdf0ZAmWGMGjfBWWtL0AXgmkFWHjt/auIAwgfesoJTWFA/2apI b/4xlo0I5lWjgHepiISa3JJrO53bISsrcIjCWZyHaONkz1Dl9SMqYskqDA//nel1wpZJtq 36CDEdnIjjZzSXeXC6ZeiVF8ubOtCZoT/B8SzviM4s5Crai99jAkAdBtbP9pwOpRVYbM+o H53/kWUpyFkYr8CK+iGCKPdTBUQE3NGuGSDIsyTPUyo34nvQUFEBNOTRsVw9QOpktRLAyO DhpPzK+2OWtEYHUmOsoWFyh0cDJpNkWfzKOTnU62hwe60b06K2irGFsJitEAHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706825071; a=rsa-sha256; cv=none; b=DDEOIcc0bbOZWxAGC3xpJN/afWg5Pyx7s6FYYLwVfwZPi1mcwTj5ZaK4QiN9P1VIZFz/HD bF69tr4L4ZnsjD2W8jtvHSgK17eaIuXG2IyeTbW+NCIfc2iuWNvABcJ4PIyiUkT27WKrCo TwChdivBIbsqbsKeU7AO6YIf0ssUsWxdWtfO1rBChj2L59hOg7NHrkJcL8+fKiOJWhIePD 8MolcjJk2vf85XVoLGsEIzCTVq5yM/LNFHPDTiwL0GXui78szW2/xYwgCNNcZiz30md6Af ewwqJC3IIMNvNjeQY3Nekj6NojaAtF+qs9qlw6Rt5aN8HlktF0UQ4k6N+eDZDQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQtH30C0qz1K4X; Thu, 1 Feb 2024 22:04: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 411M4UGV039486; Thu, 1 Feb 2024 22:04:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 411M4Urp039483; Thu, 1 Feb 2024 22:04:30 GMT (envelope-from git) Date: Thu, 1 Feb 2024 22:04:30 GMT Message-Id: <202402012204.411M4Urp039483@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: 0dd45fdb747b - stable/14 - sys/mount.h: use __inline List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0dd45fdb747bbc86ff3eba5e69c683099e833648 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0dd45fdb747bbc86ff3eba5e69c683099e833648 commit 0dd45fdb747bbc86ff3eba5e69c683099e833648 Author: Konstantin Belousov AuthorDate: 2024-01-30 22:14:25 +0000 Commit: Konstantin Belousov CommitDate: 2024-02-01 22:04:10 +0000 sys/mount.h: use __inline (cherry picked from commit f76cb7bd08e02d868e640b3442b2bc45edf8f56a) --- sys/sys/mount.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/mount.h b/sys/sys/mount.h index 2c2d4a0a479d..9c36657f69f7 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -53,7 +53,7 @@ typedef struct fsid { int32_t val[2]; } fsid_t; /* filesystem id type */ /* Returns non-zero if fsids are different. */ -static inline int +static __inline int fsidcmp(const fsid_t *a, const fsid_t *b) { return (a->val[0] != b->val[0] || a->val[1] != b->val[1]); From nobody Thu Feb 1 22:05:25 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQtJ56L7dz58llx; Thu, 1 Feb 2024 22:05: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 4TQtJ55vGKz4lph; Thu, 1 Feb 2024 22:05:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706825125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8Mp5Ed0K2gqdQhVIa7IOJrA60OydC3h9LtcIUWTWGEQ=; b=R6eziNL9xV5Rm7M82PymFsCvBW7o8xe9L4uSK2kvDpA+Kxv9sm1kPfnayk0ulj5b9JJozS Hs0rc98y+0EMons5epGXI39nhncJKKjZggLa7J2mC3BvfErkYz9AuIsSASYdX4Kcrr4iCJ Gz3WTPMIpJaMcpNjS+ySRQPbLAGIkKx9ICeLhn+I/mQgO4RQ7aulEs1g1rYyl3lP0tbpqs Aty0nG6fbNg8gGjcS4PR7ju6CtxdfUl53gtWYTPjDaYoMDgIZ3ahKsgPnT2B2xLd3ECNTB VyDFelF8DI/rQMNayi22kJISP/0e5MJ5kMe0Od0kDPQv2NbQ/U6RxtsOt6RaXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706825125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8Mp5Ed0K2gqdQhVIa7IOJrA60OydC3h9LtcIUWTWGEQ=; b=ki1ufi1ADJahVGj5klfaMMjl6HzTCcBPi0ogs5/JRCNiWL/nJfme80ajk0scfCBlieq8Lt +gkKgecKg3MacbWOAaE91zrNuWLqylcD7Go6ZsJuesMyQFmU0KYTdyYnXcEbyk7ZVm3THn Sw0hHPMQZdziJdDGhr0sAjz4iEwEND1rAF71gOt/UOd8i82GwabkXZpuUj92CeGMsKAj3Z 6vEEqWHDquJj4ug9Kdg5YQtqV7tQYx1KLQk+71OUKiALyz8ehlIM/ZoPnJNT/kfgVDFAhq Df+RxYJO0XDwmf1rM5P66Ir1+sigQ4l1YEnmVSVJvKnS+8nGYKfkYTN0+OCftA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706825125; a=rsa-sha256; cv=none; b=hQvzZtysAQAp382ZwDfjwrSxuN3H/G7wDioOsYNNdThzQKFYeZ6cO1jG/NcM6p/gDWyX2j uDf8dh3W7kCr1iMqQ2CFASrZRqBmDBeaxTxCotGk+jTUzZ/i7OuFs+Z5xwcwHdojc5zD/F 63Q54P+qTBGztfCiSgPHXtaKJZWKu1oLhDhQ141MNMe/v3E8HSQtGDj9LeqE8+xVAy0nCT Rnf/IPySHL3DpFxl5Ei//5k33KjrfEAgniMdsjAkTYDwn5VQccpRCuqcjH+rnfqTsDrs+q esv0mZ40G4kXvQ82O0TCSeIb1el66Ogq2uPB9W1cWdSQiOSCsayb6y74gELdSQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQtJ551Dbz1JJ9; Thu, 1 Feb 2024 22:05: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 411M5PkG039738; Thu, 1 Feb 2024 22:05:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 411M5PoP039735; Thu, 1 Feb 2024 22:05:25 GMT (envelope-from git) Date: Thu, 1 Feb 2024 22:05:25 GMT Message-Id: <202402012205.411M5PoP039735@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: 1414121fc3f3 - stable/13 - sys/mount.h: use __inline List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1414121fc3f3db204baa2eedde3a72c99dc95f12 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1414121fc3f3db204baa2eedde3a72c99dc95f12 commit 1414121fc3f3db204baa2eedde3a72c99dc95f12 Author: Konstantin Belousov AuthorDate: 2024-01-30 22:14:25 +0000 Commit: Konstantin Belousov CommitDate: 2024-02-01 22:05:03 +0000 sys/mount.h: use __inline (cherry picked from commit f76cb7bd08e02d868e640b3442b2bc45edf8f56a) --- sys/sys/mount.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/mount.h b/sys/sys/mount.h index bb8719d8a4f1..90e68e560b2f 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -52,7 +52,7 @@ typedef struct fsid { int32_t val[2]; } fsid_t; /* filesystem id type */ /* Returns non-zero if fsids are different. */ -static inline int +static __inline int fsidcmp(const fsid_t *a, const fsid_t *b) { return (a->val[0] != b->val[0] || a->val[1] != b->val[1]); From nobody Fri Feb 2 00:06:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQwzZ3k3bz58yj2; Fri, 2 Feb 2024 00:06: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 4TQwzZ35rLz3xxZ; Fri, 2 Feb 2024 00:06:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706832378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iOdv1fT6vBdaY8thtsF3yVcHcHNIuQn5oxmggxEcq1c=; b=w5MbQxhpQd7Wg0UlNr8kOkC1U8IOVv4dvgTnPGpdWq8fdNBFfOF9TIrxodLMk4ftKYBbBg qg/g+PEVCckKoen5zB7jNj0YnXO+WudbuHvNC4hxCn581CF2HTkdt8amLtAk4qBWimoBwM 8EUH45qHndUaM4u7MpOpeMQfZ8aKEzjreHIS53hBw4lS4MgJLl+TOWMXGiM7U1Zhtm1o2C ZzLxUmLYYeoHcPfvR7J81gZFXoNSnofDrHJ21sAKia7+jYnjUmSZVGHAoPLFbP9/Tkgb+X LkU2w5vfmGbpPZ28Lc4BKJwS+h5FRiUBBCfmfTG4rDt3sVQU88OMKe76OF+k3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706832378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iOdv1fT6vBdaY8thtsF3yVcHcHNIuQn5oxmggxEcq1c=; b=HYvrzsIqspVW4OzKIJomMr4ktxcXaw5Oljc6KMGz6XvaqvYJut8J3ydPTtm2gtCgkPNJIL Tlp4aav15B9rTeADas676AtMwtTVAnK0DWyehzEcGKAYSSFguvum3ddBb3XUgllsuwHEdA vr25YYncvxn9F1SvcdHzpzQ5ERB+2QCHw9FoBBokzbE5nZbNcwknC7jkd+7hlWcK4r5sl8 eKkU3rmaIPDPZAzQLowyogfvkNPnELrWK6Uohd5tXSf50UMThZsvoUsQbUVUoq+Ks05Alf Gix/paPxqCd1P8rELEMWAKD4BbDw5J2QeI+zahghW1EDgBiBYj5FeSwa8r8zDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706832378; a=rsa-sha256; cv=none; b=s0EUDwe4tcZvHk7pBwlx4SYuDsZC4b2LAEocveoTy9eJhFhU8Yg7PWyrUnN8WaIDdPwHPf J2eyFsxzgqsG5eKuiC408MWnxcgHxF+68RkRnqeAppT9nasaT65qXyuSFUeo0jzh2TaVDV iHq3glE14w5kggGrZ4HIC/89R4Zvp+jaNUlYE19dqlrBMvPjRpLERYKM9l6dIFkf5TmCmu ZLXq/8K8QCrzj/np8ZeuH2j3E7tnCSxayKuwIFETqSsEY7dzwkU2RDn+GKF6mkI+Q0s8Kx Ufy4+kIbGFONPsAOA59wBcWXUxqiaQAbT+EVcUNifMBy2JdBFW18iIEmMtCfaw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQwzZ27Ygz1N63; Fri, 2 Feb 2024 00:06: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 41206IpK041343; Fri, 2 Feb 2024 00:06:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41206I5x041340; Fri, 2 Feb 2024 00:06:18 GMT (envelope-from git) Date: Fri, 2 Feb 2024 00:06:18 GMT Message-Id: <202402020006.41206I5x041340@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: 6c2137593990 - releng/13.3 - 13.3: create releng/13.3 branch List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 6c2137593990a0d671ad93339f2965a485495198 Auto-Submitted: auto-generated The branch releng/13.3 has been created by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=6c2137593990a0d671ad93339f2965a485495198 commit 6c2137593990a0d671ad93339f2965a485495198 Author: Colin Percival AuthorDate: 2024-02-02 00:05:47 +0000 Commit: Colin Percival CommitDate: 2024-02-02 00:05:47 +0000 13.3: create releng/13.3 branch Update from PRERELEASE to BETA1 Switch pkg(8) configuration to use the quarterly repository Bump __FreeBSD_version Approved by: re (implicit) Sponsored by: https://www.patreon.com/cperciva --- release/pkg_repos/release-dvd.conf | 2 +- sys/conf/newvers.sh | 2 +- sys/sys/param.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/release/pkg_repos/release-dvd.conf b/release/pkg_repos/release-dvd.conf index c2e64c43a56f..600c309d5979 100644 --- a/release/pkg_repos/release-dvd.conf +++ b/release/pkg_repos/release-dvd.conf @@ -1,5 +1,5 @@ release: { - url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest", + url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 9b2511c4ab16..fcefdda1d34c 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="13.3" -BRANCH="PRERELEASE" +BRANCH="BETA1" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi diff --git a/sys/sys/param.h b/sys/sys/param.h index d5f5992c4a47..21c9593c6635 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -59,7 +59,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1302512 /* Master, propagated to newvers */ +#define __FreeBSD_version 1303000 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Fri Feb 2 00:07:35 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TQx140Llyz58yd6; Fri, 2 Feb 2024 00:07: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 4TQx136wqSz3y9c; Fri, 2 Feb 2024 00: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=1706832456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O1Ri/Fw30t06Y7hkHxZImKWLCLh3xrG10zeKSfOSoLU=; b=uCplNaMjEu8F/2BIgs7dqIKZvgcvsbWFI2Wj4tLa3kimHgPef1Z6gVzIXhGQiJMdZeJK/S 2q4AhB3YIqvi4RqR5BjUQ3GDh1VfYArDKiI9Hf1qIWHoZWkeWTNOiJaU8KVeP+W/T5Ixp5 rIRb4Wqab9Qu4AWedOB/KAexMsKICqDdUK+/IvJnOTBbOg3MTl9jGS8hy3+/5VYTkgGj4N ggxVvRV1JdC4w7plNLz7oOIA6n3gc3q6w00+Zzt/z1fD93QAYcmrPnDhVY9Uoc8PLdJRKe zVYFcyVzVJyXGWj/bQ5Ozl0/DZUpqQAPzF1qxHaENm6dcKQBV6QHeZyxLpYKQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706832456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O1Ri/Fw30t06Y7hkHxZImKWLCLh3xrG10zeKSfOSoLU=; b=wayv/vzW0qdr8swk6deCmqwyszu4iKBfIskr8xKSYsyz+iAPeM9wBEQcZb8RqH+ciJj1xq bBHOLiM2eN2K82CTsdGBDPLFZuFNsu01e3V0kp9hb+gyuAZdfZcWrhGOu+RAIeqVudbQce JihltIH76MqZ+fVHwMiVPQ1aorzglb7linrRncTdMp9ftTcxJGwBmaBFmjxQrGxNNqdPtV p/A3/+Mpr3FJ6xRD5jLxBrqncpBuPgE9rwqCdW5Jz5B5a9W+WslzPWKr9snsLav0A8/yRz ox6BeaBxgCfEJTa+iJHxeZVX5e9w+7003pT6CfLagHC1bTB9I+0btvB3ALuMDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706832456; a=rsa-sha256; cv=none; b=sHrMn6jDDHIgSYyqgf21pZgw5NENNIF58R5kFuUWVvuzcr0TKXzqv7ZZ8B8EDjAZ/Z5iAv YzhUjCWA7IWRJHVeNgHYG68uvNIuIJZUxHpfrpitZ7/cG77N9+lZ3OEYiUZQcQfz2spFJ0 vUindyyMp2PD997qizmrZpElsDf3SHxEzxSe9fibFgWmFS06vo+RkR2gOc/82Wvrd8MOgM sm9v2mCQV2GwWftK+TBgczGHGryC05jxIb3+z67EM5rYhUUirqrQdaitzzDlIgD5DOvpBK djAmRj/jinWfK1GSv2zGXvGm6wnv96wiLSu/lUuUbXy3Wga8LatUxCkr3ftUbw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TQx1360ZLz1MRY; Fri, 2 Feb 2024 00: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 41207Zr1041626; Fri, 2 Feb 2024 00: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 41207ZQx041623; Fri, 2 Feb 2024 00:07:35 GMT (envelope-from git) Date: Fri, 2 Feb 2024 00:07:35 GMT Message-Id: <202402020007.41207ZQx041623@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: 9b0319f78a9c - stable/13 - Post-13.3-branch updates List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9b0319f78a9cea7e2f422778a0bff978588a2ed2 Auto-Submitted: auto-generated The branch stable/13 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=9b0319f78a9cea7e2f422778a0bff978588a2ed2 commit 9b0319f78a9cea7e2f422778a0bff978588a2ed2 Author: Colin Percival AuthorDate: 2024-02-02 00:07:16 +0000 Commit: Colin Percival CommitDate: 2024-02-02 00:07:16 +0000 Post-13.3-branch updates Rename stable/13 to -STABLE Bump __FreeBSD_version Approved by: re (implicit) Sponsored by: https://www.patreon.com/cperciva --- sys/conf/newvers.sh | 2 +- sys/sys/param.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 9b2511c4ab16..bdda58fae469 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="13.3" -BRANCH="PRERELEASE" +BRANCH="STABLE" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi diff --git a/sys/sys/param.h b/sys/sys/param.h index d5f5992c4a47..be58e408b5ad 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -59,7 +59,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1302512 /* Master, propagated to newvers */ +#define __FreeBSD_version 1303500 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Fri Feb 2 14:31:49 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TRJBF44G9z58rnT; Fri, 2 Feb 2024 14:31:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TRJBF3bT0z4FlB; Fri, 2 Feb 2024 14:31:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706884309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0ObAFCB1zFsbCnDGggwxXRneIPWrRYp5NcbhijgzHsk=; b=qyxcudluhBGa61G1LtU7aB2JbAz1tEd5oQzXAc3U4pC3Pw31SAGL6B/5PUb4wvNZVJhIet Rge0zJ7WDY2uqf4qYkYu1VNMlB6ryk89fl4phz8nQvCmYDwp159EzdkInrhpaSyrMpLbqJ eMzgp5cHW4RaVwoFTKXfWpqoghYKiMbTIzmptmmYYNfwzuQDrBT98KvAw33RbyfXx9x6IQ B0pksEgyFaIS3yDyOSvX4QdQw+/MUkv9T9up5vYv3gskaMAlS5U8z6k/LHKih5gEDs+xpQ 7DD4U8fn7UscRz+SX2gMvBYR9UmS4+FM1vwaK1+MjygWvoW17qUQN0XWgDwYsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706884309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0ObAFCB1zFsbCnDGggwxXRneIPWrRYp5NcbhijgzHsk=; b=XlybGtJAXv1F9Gf5L6sskmrsuHcjYAa2ajaT/Gxv5qP0VuSpTuGcgVzavqUNeZT0PsrbIC 1/0xTQOLzq5mLGT1A0fIxhahx57gLy63l0xlV1x2t0fF8k/bk5jmosotAiZTCAXJbidqC4 mJb37y8uNcDS8jaL/bR8CdDV4pnitRLJrGlmfJwdcC415LyKiLAb0J0EBA9FrPfj0LEcov UQ53JRutbbKcd5oxcz9Fu2aqY0gd4CWkfOO4fg7rsq299Vqoh7duicygpDrErEadAbJSVo ELlHPNZkU767my9t5o9as5eOXjpyfRSI74fYKOwWPW3zdkCnvfuqLwab5Wo8ew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706884309; a=rsa-sha256; cv=none; b=kVcKPwB0f7Td3Y5kaJdjpCtQcKxZhzSIlWmxqZmhnyptDRXYQet1RfLGx0E9AguJTOEYkJ GVy+fOxPGXbWe1BzpvixAGsSoOnhTuX4K+f1xxBzL3UuCy9Awox+wNPlPLDg3kHNqEDq8B Elbv823nsGU8oBcCmdlTXwAPEZ5eSpYuzFg6mrzwyqWcPI273UuwqBPCVmkLEj0nd+PxG3 JCRBlRPEjzbhPZOMKnRVTGkKnAJMi8NsNodgVbeI6HKK4x4PhVmH0cjzuPeg4eXUXBdLmW KFAvk9ya+4knbHBrFEjR27GQ/4dOT5RmfZxxt9+dchrlMQFQEja6y0S2C3O9YA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TRJBF2j9YzYbp; Fri, 2 Feb 2024 14:31: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 412EVnhW098323; Fri, 2 Feb 2024 14:31:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 412EVnwR098320; Fri, 2 Feb 2024 14:31:49 GMT (envelope-from git) Date: Fri, 2 Feb 2024 14:31:49 GMT Message-Id: <202402021431.412EVnwR098320@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 40adc2787879 - stable/14 - arm64: Remove pmap_san_bootstrap() and call kasan_init_early() directly List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 40adc2787879f9b0cd5e61e3042e96b0ee30f95a Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=40adc2787879f9b0cd5e61e3042e96b0ee30f95a commit 40adc2787879f9b0cd5e61e3042e96b0ee30f95a Author: Mark Johnston AuthorDate: 2024-01-26 15:35:40 +0000 Commit: Mark Johnston CommitDate: 2024-02-02 14:31:08 +0000 arm64: Remove pmap_san_bootstrap() and call kasan_init_early() directly pmap_san_bootstrap() doesn't really do much, and it was hard-coding the the bootstrap stack size defined in locore.S. Moreover, the name is a bit confusing given the existence of pmap_bootstrap_san(). Just remove it and call kasan_init_early() directly like we do on amd64. It will not be used by KMSAN in a forthcoming patch series. No functional change intended. MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D43403 (cherry picked from commit 90372a9e3cda838914bc8518dbc4340906351e98) --- sys/amd64/include/pmap.h | 1 - sys/arm64/arm64/locore.S | 11 +++++++++-- sys/arm64/arm64/pmap.c | 6 ------ sys/arm64/include/pmap.h | 1 - 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index 09bfc7aa5685..bf531ab6ae56 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -498,7 +498,6 @@ void pmap_page_array_startup(long count); vm_page_t pmap_page_alloc_below_4g(bool zeroed); #if defined(KASAN) || defined(KMSAN) -void pmap_san_bootstrap(void); void pmap_san_enter(vm_offset_t); #endif diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index 0da7eea8d982..ac925f13f069 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -45,6 +45,11 @@ #define L3_PAGE_COUNT 32 #endif +/* + * The size of our bootstrap stack. + */ +#define BOOT_STACK_SIZE (KSTACK_PAGES * PAGE_SIZE) + .globl kernbase .set kernbase, KERNBASE @@ -151,7 +156,9 @@ virtdone: mov x19, x0 /* Bootstrap an early shadow map for the boot stack. */ - bl pmap_san_bootstrap + ldr x0, [x0, #BP_KERN_STACK] + ldr x1, =BOOT_STACK_SIZE + bl kasan_init_early /* Restore bootparams */ mov x0, x19 @@ -886,7 +893,7 @@ END(abort) .bss .align PAGE_SHIFT initstack: - .space (PAGE_SIZE * KSTACK_PAGES) + .space BOOT_STACK_SIZE initstack_end: .section .init_pagetable, "aw", %nobits diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 320223c43345..9849a58dd070 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -7834,12 +7834,6 @@ pmap_is_valid_memattr(pmap_t pmap __unused, vm_memattr_t mode) #if defined(KASAN) static pd_entry_t *pmap_san_early_l2; -void __nosanitizeaddress -pmap_san_bootstrap(struct arm64_bootparams *abp) -{ - kasan_init_early(abp->kern_stack, KSTACK_PAGES * PAGE_SIZE); -} - #define SAN_BOOTSTRAP_L2_SIZE (1 * L2_SIZE) #define SAN_BOOTSTRAP_SIZE (2 * PAGE_SIZE) static vm_offset_t __nosanitizeaddress diff --git a/sys/arm64/include/pmap.h b/sys/arm64/include/pmap.h index 1789588210c3..bb226df2099c 100644 --- a/sys/arm64/include/pmap.h +++ b/sys/arm64/include/pmap.h @@ -194,7 +194,6 @@ struct arm64_bootparams; void pmap_bootstrap_san(vm_paddr_t); void pmap_san_enter(vm_offset_t); -void pmap_san_bootstrap(struct arm64_bootparams *); #endif #endif /* _KERNEL */ From nobody Fri Feb 2 14:39:33 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TRJM94SrJz58s54; Fri, 2 Feb 2024 14: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 4TRJM93zpqz4GLf; Fri, 2 Feb 2024 14: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=1706884773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CJnq/PtWUJCGgivlqixn/BSxUC4VBwQojb+xdEeN+jA=; b=nwRyLjtNYMwoz9JKJqTvzQiHDuOckInqbFJXk7OcAJqosjlDps5Tunq4SKNA4yGOOmQzCW cw7hfMT4hgN6bhFOi+7/cvc7gwqM978pZo/L1nqw/ucZcJB5I6zunPpL+nkej2EBUnkBRC fQlkGtE986zVHvhqJHhet+G8gOkHVfK/63vJrR9TbqbfWDJgzFg8QBlkTVGMU0xJGbNnOh Qz32q5EqV/PM/amAW5y7iViR0aQiypgQ3oScO44VOOmCX01ZkqQDlA8L6dpd3W244ENSVQ ICYdWnAR4i6qPan3QxcmPPpdCRTRum/Gegol5Ybg+MuZyEtbND74RmX6uRNhLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706884773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CJnq/PtWUJCGgivlqixn/BSxUC4VBwQojb+xdEeN+jA=; b=wcLYNrTF7PVT+XEsGMJQLHXS4oLC7csL+Pd/cNFVezPx9yiArvh9jGMvt8KUc1cRK4aHaf 0dX6fJ2pESfBFn7TQbX4KHiNlmoqWULqQRgUtFVRK11kBErkEooXxRuFIBfxWoHIonH62w EhxKTQWbhmo7+qbxCzi5wYvQW6nL0PkDsSjP+hz/JU+jjS0//kwRZgVZwSg35iJzcvC2hW NpoGxEqVhObpISkbBuJTf9US7ZaGCTrdHE6YP2YrZ3e6sDuzwH1ttpvJVtv0M87zRi/57W qxHBq10BDzPqepViyuNY6TIBlKl18Haw6tcpxmwWdt9kvS8aY0RxcM2Rucoc+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706884773; a=rsa-sha256; cv=none; b=R/PiXy78AJ7HXd7ixrhNX+zlrgCnWU7rE0E5jI4lw7YCsU1k5fcyeA6NJ7K0bCZfYqs5bO ih3BYvFdLXSh75hzbcLPVg92ZgciV3DIQa19xRBuwSkfbw4umvMRaLn1lM9W/SQcgENKvj UrclTCT6OyKPPcXpxMJNvv2/7cV2LSrcUjEqh75yrdA9TLzJkmXNdafqB7+WDSgrXjcr3x LwWP8S3kTyRiKqclaWfDTo+hei1CEuVc+i5MjZp6a0pCXZWGikG7MH3fCZj9klwn4u0ptw Uto4o4+QTp2bosnA9V55eGL+B9JNflp2m74sz8eRlTW+qs3o/Ab/xsnr0leOPg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TRJM932RGzZTy; Fri, 2 Feb 2024 14: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 412EdXwl000430; Fri, 2 Feb 2024 14: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 412EdXue000427; Fri, 2 Feb 2024 14:39:33 GMT (envelope-from git) Date: Fri, 2 Feb 2024 14:39:33 GMT Message-Id: <202402021439.412EdXue000427@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: b3772accd926 - stable/14 - traceroute: Implement ECN bleaching detection List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b3772accd92642440c0e7ed79621ab4138c3db7c Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b3772accd92642440c0e7ed79621ab4138c3db7c commit b3772accd92642440c0e7ed79621ab4138c3db7c Author: Jose Luis Duran AuthorDate: 2023-10-28 00:28:52 +0000 Commit: Mark Johnston CommitDate: 2024-02-02 14:32:24 +0000 traceroute: Implement ECN bleaching detection Explicit Congestion Notification (ECN) is a mechanism that allows end-to-end notification of network congestion without dropping packets by explicitly setting the ECN code point (2 bits). Per RFC 8087, section 3.5, network devices should not be configured to change the ECN code point in the packets that they forward, except to set the CE (Congestion Experienced) code point ('11') to signal incipient congestion. The current commit adds an -E flag to traceroute that crafts a packet with an ECT(1) code point ('01'). If the packet is received back with a zero ECN code point ('00'), it outputs that the hop in question erases or "bleaches" the ECN code point values. Bleaching may occur for various reasons (including normalizing packets to hide which equipment supports ECN). This policy prevents the use of ECN by applications. If the packet is received back with an all-ones ECN code point ('11'), it outputs that the hop in question is experiencing "congestion". If the packet is received back with a different ECN code point ('10'), it outputs that the hop in question changes or "mangles" the ECN code point values. If the packet is received with the same ECN code point that was sent ('01'), it outputs that the hop has "passed" the ECN bits appropriately. Inspired by: Darwin Reviewed by: imp, markj MFC after: 1 month Pull Request: https://github.com/freebsd/freebsd-src/pull/879 (cherry picked from commit 8aafae66394fe64489d6371c22da5a5fb7ee7c81) --- contrib/traceroute/traceroute.8 | 20 ++++++++++++++++++-- contrib/traceroute/traceroute.c | 30 ++++++++++++++++++++++++++++-- 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/contrib/traceroute/traceroute.8 b/contrib/traceroute/traceroute.8 index 85a7e9d3a17e..21427ef6e97c 100644 --- a/contrib/traceroute/traceroute.8 +++ b/contrib/traceroute/traceroute.8 @@ -16,7 +16,7 @@ .\" $Id: traceroute.8,v 1.19 2000/09/21 08:44:19 leres Exp $ .\" $FreeBSD$ .\" -.Dd November 25, 2020 +.Dd October 25, 2023 .Dt TRACEROUTE 8 .Os .Sh NAME @@ -25,7 +25,7 @@ .Sh SYNOPSIS .Nm .Bk -words -.Op Fl adDeFISnrvx +.Op Fl adDeEFISnrvx .Op Fl f Ar first_ttl .Op Fl g Ar gateway .Op Fl M Ar first_ttl @@ -67,6 +67,22 @@ default. Firewall evasion mode. Use fixed destination ports for UDP, UDP-Lite, TCP and SCTP probes. The destination port does NOT increment with each packet sent. +.It Fl E +Detect ECN bleaching. +Set the +.Em IPTOS_ECN_ECT1 +Explicit Congestion Notification (ECN) bits +.Pq Dv 01 , +and report if the hop has bleached +.Pq Dv 00 +or mangled +.Pq Dv 10 +them, or if it is experiencing congestion +.Pq Dv 11 . +Otherwise, report that it passed the bits appropriately. +If +.Fl t +is also specified, the corresponding ECN bits will be replaced. .It Fl f Ar first_ttl Set the initial time-to-live used in the first outgoing probe packet. .It Fl F diff --git a/contrib/traceroute/traceroute.c b/contrib/traceroute/traceroute.c index fc87575ea043..6f2350150bd8 100644 --- a/contrib/traceroute/traceroute.c +++ b/contrib/traceroute/traceroute.c @@ -365,6 +365,7 @@ int doipcksum = 1; /* calculate ip checksums by default */ int optlen; /* length of ip options */ int fixedPort = 0; /* Use fixed destination port for TCP and UDP */ int printdiff = 0; /* Print the difference between sent and quoted */ +int ecnflag = 0; /* ECN bleaching detection flag */ extern int optind; extern int opterr; @@ -597,7 +598,7 @@ main(int argc, char **argv) prog = argv[0]; opterr = 0; - while ((op = getopt(argc, argv, "aA:edDFInrSvxf:g:i:M:m:P:p:q:s:t:w:z:")) != EOF) + while ((op = getopt(argc, argv, "aA:eEdDFInrSvxf:g:i:M:m:P:p:q:s:t:w:z:")) != EOF) switch (op) { case 'a': as_path = 1; @@ -620,6 +621,10 @@ main(int argc, char **argv) fixedPort = 1; break; + case 'E': + ecnflag = 1; + break; + case 'f': case 'M': /* FreeBSD compat. */ first_ttl = str2val(optarg, "first ttl", 1, 255); @@ -784,6 +789,10 @@ main(int argc, char **argv) outip->ip_v = IPVERSION; if (settos) outip->ip_tos = tos; + if (ecnflag) { + outip->ip_tos &= ~IPTOS_ECN_MASK; + outip->ip_tos |= IPTOS_ECN_ECT1; + } #ifdef BYTESWAP_IP_HDR outip->ip_len = htons(packlen); outip->ip_off = htons(off); @@ -1122,6 +1131,23 @@ main(int argc, char **argv) #endif precis = 3; Printf(" %.*f ms", precis, T); + if (ecnflag) { + u_char ecn = hip->ip_tos & IPTOS_ECN_MASK; + switch (ecn) { + case IPTOS_ECN_ECT1: + Printf(" (ecn=passed)"); + break; + case IPTOS_ECN_NOTECT: + Printf(" (ecn=bleached)"); + break; + case IPTOS_ECN_CE: + Printf(" (ecn=congested)"); + break; + default: + Printf(" (ecn=mangled)"); + break; + } + } if (printdiff) { Printf("\n"); Printf("%*.*s%s\n", @@ -2126,7 +2152,7 @@ usage(void) Fprintf(stderr, "Version %s\n", version); Fprintf(stderr, - "Usage: %s [-adDeFInrSvx] [-f first_ttl] [-g gateway] [-i iface]\n" + "Usage: %s [-adDeEFInrSvx] [-f first_ttl] [-g gateway] [-i iface]\n" "\t[-m max_ttl] [-p port] [-P proto] [-q nqueries] [-s src_addr]\n" "\t[-t tos] [-w waittime] [-A as_server] [-z pausemsecs] host [packetlen]\n", prog); exit(1); From nobody Fri Feb 2 14:39:34 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TRJMB6SfSz58sN4; Fri, 2 Feb 2024 14:39: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 4TRJMB4cLzz4G7m; Fri, 2 Feb 2024 14:39:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706884774; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PznFGdRL0R7gsddoYBo/urGA6pqesDKdL6kpH30IaHg=; b=IyXo9od6nO+gom8Ml0HndTHzuIgkRkg6LYAhF+u9nrY/80wS0fzcVWIGklHp2WKD7dNHdz Osx6xK76E/LJoBH9EFTgI3jhINqA5VGxwoZwwDOz275s1ChwMoC4tIE8r12ccOESlSroD4 JEuXPwP9cNVCjQHAVOejhEwrzsmM9XJYVSHwfFCVVBJTJc9kyRvwnojNxkpXdQ7t4NhIH1 JvksxACojBQHyP1oR+gnVY+jJoJkKPS35mRZyfYYstRAKWJWmQg5W9BI8wK4095hcqaoWD 5U5a/YgM39TLHhgd3sGnBpxa2JOgblb6AoIdOH6Yk+ZiyUnH1ETBOZCl7zEkOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706884774; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PznFGdRL0R7gsddoYBo/urGA6pqesDKdL6kpH30IaHg=; b=GbCj93HP/L2z77DAGgUwinfIx4DN17mW15uVtFq2PhceCh8lTEWtLd9syUUptjrJdncwIM nVNkjJxLBozDmMNyAKb5vCSiXZjgt/kEfjQCe3XoCMo7OWHf6Clys8uoReZo4Lwg0AIkMX 4PA/bfc4C2BixulfwITTVAQh97HQsNZt3w4QJoEwrZaqC0NuB2g2RyO1aTDyvjwQ8FC2xX 6Nnib8fqAQFQlFaf9QNfF6UILhJitVfpVUyobx6luwXZvykwLMNwjXI2Bj1m/3vS/chg+C cW+oAeca+AQErYl/N8N3Mb0yacwBFhKZMoZCS4un4RbDSS97Ze21YwhSzwtjiA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706884774; a=rsa-sha256; cv=none; b=LBTv8b6eB5uRqB+jRuScF7tecFAx3Wz6wp2oUtnWqWQ1uoMf5I5zzVv23Mxq00H6t8pxL7 eEWe6IV6XLNg19T24kQv3wg6tHi2CwDDek1C490uBVx6VnbM8EkKvMi+VJzCBj8UNknUZU vYNvzBRvmHyClShS8S6hjPrrydD+T20FRBsr7LpWYhWj/aftwVO/wW271NekbVmROFYnqx TJ3Qu5e+su2FkniOdAgOZ64G/D3Df9GeqYweKUfLQUBoZpgXQ/dNK+Vf7GtNsM0dahzOV1 xN07SSoZulYuFKCBP3hO7TbOnJ72anJYnCUc1PNeGt+WKbe1lLAVS5LculqZXQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TRJMB3js0zZZQ; Fri, 2 Feb 2024 14:39: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 412EdY07000475; Fri, 2 Feb 2024 14:39:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 412EdYoH000472; Fri, 2 Feb 2024 14:39:34 GMT (envelope-from git) Date: Fri, 2 Feb 2024 14:39:34 GMT Message-Id: <202402021439.412EdYoH000472@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 73ef676c9ffd - stable/14 - traceroute6: Implement ECN bleaching detection List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 73ef676c9ffd625027fa7fd0ccb9948adae00d93 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=73ef676c9ffd625027fa7fd0ccb9948adae00d93 commit 73ef676c9ffd625027fa7fd0ccb9948adae00d93 Author: Jose Luis Duran AuthorDate: 2023-10-27 23:59:28 +0000 Commit: Mark Johnston CommitDate: 2024-02-02 14:32:30 +0000 traceroute6: Implement ECN bleaching detection Explicit Congestion Notification (ECN) is a mechanism that allows end-to-end notification of network congestion without dropping packets by explicitly setting the ECN code point (2 bits). Per RFC 8087, section 3.5, network devices should not be configured to change the ECN code point in the packets that they forward, except to set the CE (Congestion Experienced) code point ('11') to signal incipient congestion. The current commit adds an -E flag to traceroute6 that crafts a packet with an ECT(1) code point ('01'). If the packet is received back with a zero ECN code point ('00'), it outputs that the hop in question erases or "bleaches" the ECN code point values. Bleaching may occur for various reasons (including normalizing packets to hide which equipment supports ECN). This policy prevents the use of ECN by applications. If the packet is received back with an all-ones ECN code point ('11'), it outputs that the hop in question is experiencing "congestion". If the packet is received back with a different ECN code point ('10'), it outputs that the hop in question changes or "mangles" the ECN code point values. If the packet is received with the same ECN code point that was sent ('01'), it outputs that the hop has "passed" the ECN bits appropriately. Inspired by: Darwin Reviewed by: imp, markj MFC after: 1 month Pull Request: https://github.com/freebsd/freebsd-src/pull/879 (cherry picked from commit 0c2218d1d5fda2c579d3d33f1fd3af9ad447e160) --- usr.sbin/traceroute6/traceroute6.8 | 20 +++++++++++++++-- usr.sbin/traceroute6/traceroute6.c | 44 ++++++++++++++++++++++++++++++++------ 2 files changed, 56 insertions(+), 8 deletions(-) diff --git a/usr.sbin/traceroute6/traceroute6.8 b/usr.sbin/traceroute6/traceroute6.8 index f02b08872ea5..13917eb47c7f 100644 --- a/usr.sbin/traceroute6/traceroute6.8 +++ b/usr.sbin/traceroute6/traceroute6.8 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 25, 2020 +.Dd October 25, 2023 .Dt TRACEROUTE6 8 .Os .\" @@ -38,7 +38,7 @@ .Sh SYNOPSIS .Nm .Bk -words -.Op Fl adIlnNrSTUv +.Op Fl adEIlnNrSTUv .Ek .Bk -words .Op Fl f Ar firsthop @@ -94,6 +94,22 @@ Turn on AS# lookups for each hop encountered. Turn on AS# lookups and use the given server instead of the default. .It Fl d Debug mode. +.It Fl E +Detect ECN bleaching. +Set the +.Em IPTOS_ECN_ECT1 +Explicit Congestion Notification (ECN) bits +.Pq Dv 01 , +and report if the hop has bleached +.Pq Dv 00 +or mangled +.Pq Dv 10 +them, or if it is experiencing congestion +.Pq Dv 11 . +Otherwise, report that it passed the bits appropriately. +If +.Fl t +is also specified, the corresponding ECN bits will be replaced. .It Fl f Ar firsthop Specify how many hops to skip in trace. .It Fl g Ar gateway diff --git a/usr.sbin/traceroute6/traceroute6.c b/usr.sbin/traceroute6/traceroute6.c index 7907952e9328..1f5fc0a6b3a3 100644 --- a/usr.sbin/traceroute6/traceroute6.c +++ b/usr.sbin/traceroute6/traceroute6.c @@ -274,6 +274,7 @@ static char sccsid[] = "@(#)traceroute.c 8.1 (Berkeley) 6/6/93"; #include #include +#include #include #include #include @@ -306,7 +307,7 @@ void capdns_open(void); int get_hoplim(struct msghdr *); double deltaT(struct timeval *, struct timeval *); const char *pr_type(int); -int packet_ok(struct msghdr *, int, int, u_char *, u_char *); +int packet_ok(struct msghdr *, int, int, u_char *, u_char *, u_char *); void print(struct msghdr *, int); const char *inetname(struct sockaddr *); u_int32_t sctp_crc32c(void *, u_int32_t); @@ -352,6 +353,7 @@ static int nflag; /* print addresses numerically */ static int useproto = IPPROTO_UDP; /* protocol to use to send packet */ static int lflag; /* print both numerical address & hostname */ static int as_path; /* print as numbers for each hop */ +static int ecnflag; /* ECN bleaching detection flag */ static char *as_server = NULL; static void *asn; @@ -367,7 +369,7 @@ main(int argc, char *argv[]) struct hostent *hp; size_t size, minlen; uid_t uid; - u_char type, code; + u_char type, code, ecn; #if defined(IPSEC) && defined(IPSEC_POLICY_IPSEC) char ipsec_inpolicy[] = "in bypass"; char ipsec_outpolicy[] = "out bypass"; @@ -413,7 +415,7 @@ main(int argc, char *argv[]) seq = 0; ident = htons(getpid() & 0xffff); /* same as ping6 */ - while ((ch = getopt(argc, argv, "aA:df:g:Ilm:nNp:q:rs:St:TUvw:")) != -1) + while ((ch = getopt(argc, argv, "aA:dEf:g:Ilm:nNp:q:rs:St:TUvw:")) != -1) switch (ch) { case 'a': as_path = 1; @@ -425,6 +427,9 @@ main(int argc, char *argv[]) case 'd': options |= SO_DEBUG; break; + case 'E': + ecnflag = 1; + break; case 'f': ep = NULL; errno = 0; @@ -596,6 +601,15 @@ main(int argc, char *argv[]) exit(1); } + if (ecnflag) { + if (tclass != -1) { + tclass &= ~IPTOS_ECN_MASK; + } else { + tclass = 0; + } + tclass |= IPTOS_ECN_ECT1; + } + /* revoke privs */ uid = getuid(); if (setresuid(uid, uid, uid) == -1) { @@ -960,7 +974,7 @@ main(int argc, char *argv[]) send_probe(++seq, hops); while ((cc = wait_for_reply(rcvsock, &rcvmhdr))) { (void) gettimeofday(&t2, NULL); - if (packet_ok(&rcvmhdr, cc, seq, &type, &code)) { + if (packet_ok(&rcvmhdr, cc, seq, &type, &code, &ecn)) { if (!IN6_ARE_ADDR_EQUAL(&Rcv.sin6_addr, &lastaddr)) { if (probe > 0) @@ -969,6 +983,22 @@ main(int argc, char *argv[]) lastaddr = Rcv.sin6_addr; } printf(" %.3f ms", deltaT(&t1, &t2)); + if (ecnflag) { + switch (ecn) { + case IPTOS_ECN_ECT1: + printf(" (ecn=passed)"); + break; + case IPTOS_ECN_NOTECT: + printf(" (ecn=bleached)"); + break; + case IPTOS_ECN_CE: + printf(" (ecn=congested)"); + break; + default: + printf(" (ecn=mangled)"); + break; + } + } if (type == ICMP6_DST_UNREACH) { switch (code) { case ICMP6_DST_UNREACH_NOROUTE: @@ -1302,7 +1332,8 @@ pr_type(int t0) } int -packet_ok(struct msghdr *mhdr, int cc, int seq, u_char *type, u_char *code) +packet_ok(struct msghdr *mhdr, int cc, int seq, u_char *type, u_char *code, + u_char *ecn) { struct icmp6_hdr *icp; struct sockaddr_in6 *from = (struct sockaddr_in6 *)mhdr->msg_name; @@ -1385,6 +1416,7 @@ packet_ok(struct msghdr *mhdr, int cc, int seq, u_char *type, u_char *code) void *up; hip = (struct ip6_hdr *)(icp + 1); + *ecn = ntohl(hip->ip6_flow & IPV6_ECN_MASK) >> 20; if ((up = get_uphdr(hip, (u_char *)(buf + cc))) == NULL) { if (verbose) warnx("failed to get upper layer header"); @@ -1804,7 +1836,7 @@ usage(void) { fprintf(stderr, -"usage: traceroute6 [-adIlnNrSTUv] [-A as_server] [-f firsthop] [-g gateway]\n" +"usage: traceroute6 [-adEIlnNrSTUv] [-A as_server] [-f firsthop] [-g gateway]\n" " [-m hoplimit] [-p port] [-q probes] [-s src] [-w waittime] target\n" " [datalen]\n"); exit(1); From nobody Fri Feb 2 16:45:44 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TRM8m7412z594gn; Fri, 2 Feb 2024 16:45: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 4TRM8m6RJxz4T7j; Fri, 2 Feb 2024 16:45:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706892344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tygH2W/GPh0ZYQZB4wbZYWIcf0MmRV+DFqMbUT4bjgk=; b=JS3wdMTm4MCgm3gEIuipzKhM+XSoHYE/kNak73GcAibRqp4guzCno4sM/xY7Xa1mw8hSDF FrW50rA79HNdF1BB9+m2PG7PRlbWEA2j2uWEm0nhbglHpAnu25DBr53j5U1quMwYYjw1aY pL4eMKEt7w0K9Tf9O5aNVw6L9Q32VSzrKGs/P/Rzn5R2CwFlaQBEDoZdwX/1atis+tGh3O YDJ4PM0brdg3mWLBpue2Ictx/95+FMa555KrcZu5/+c0FP1ZNonGFAXNJLib3Uer0RU1Sa C67uBMlgYFU3TGkb/Icd0XXJQSZpQsXEmpiB1hwuCb0GIDmT3NbIq3UU9O5MeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706892344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tygH2W/GPh0ZYQZB4wbZYWIcf0MmRV+DFqMbUT4bjgk=; b=eImLmOEZ5koHxN8ihYgk0+eIvMk6/wyOsmZQlDAWm3S2GP3/MSmqJL7dueoh+8vptJv4Lx znMlKjgAuaZAU9fJrPoPJITj86Ah0TBsNvB/tMIEybnfFY9sv2SJMoZ/oEo6CfrffDjSkA 7dR88nicOyvlKjfQ5JIbUg13XdR/zYtvbDXNLMDy76WU+cjgBHAEc7zNtqstOlB7263LJT tZ1k3k1Dyt4pX7eB2IU+ybkKDZesN3e0zvH+KOpldVlYcr/+61I5phHg4JcMzTo3ktt9cO myH5nnal+xt9/FiSb3+e4gTuDDzdcFdl/u1/OuZjlZlYP3jd23WSzWs57oLIqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706892344; a=rsa-sha256; cv=none; b=PshRapwsDW/TsvNeUzN1rVhp5ciNOdlBcpDVyGboJLaxuU9DDGWDDbjtM94hmAga195PP5 Tv7A1SZ+IXN3iFafYkfn4khFK9VGlCtcjXMDWLamZvqwLl5+1BaZ/fkC4C06MditYnv1Vt evKe6FQAr8ledtq+USyR3D83N5i7O89U8Hz6yzG3QpEpicQ/pf4KcBDtbLB4VF5Gesoyf+ eO9NeeODGxoGLpAr4bRxdlqetQSKgxM6udKBEJYbt84sK9X9V/uLKxHWZ77hq8s5ao8qLJ IF0cN5ybzXsb90zZ/F9Sdv/Tj5+567IjXmRdff0BJjf2wPLMSLRnTOA4N+eNPw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TRM8m5Ns1zdKZ; Fri, 2 Feb 2024 16:45: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 412Gji7d017983; Fri, 2 Feb 2024 16:45:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 412GjiCv017980; Fri, 2 Feb 2024 16:45:44 GMT (envelope-from git) Date: Fri, 2 Feb 2024 16:45:44 GMT Message-Id: <202402021645.412GjiCv017980@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jamie Gritton Subject: git: dcae96578145 - stable/14 - MFC jail: make sure jail.conf parse errors exit, and not crash. Reported by: Mason Loring Bliss List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: dcae9657814544c4ac2c28bec0022346eb7c587f Auto-Submitted: auto-generated The branch stable/14 has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=dcae9657814544c4ac2c28bec0022346eb7c587f commit dcae9657814544c4ac2c28bec0022346eb7c587f Author: Jamie Gritton AuthorDate: 2024-01-21 05:20:59 +0000 Commit: Jamie Gritton CommitDate: 2024-02-02 16:44:20 +0000 MFC jail: make sure jail.conf parse errors exit, and not crash. Reported by: Mason Loring Bliss (cherry picked from commit 768149ff156e7d34a035853030bf946ca94cb461) --- usr.sbin/jail/jailparse.y | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/usr.sbin/jail/jailparse.y b/usr.sbin/jail/jailparse.y index 047ca882e59f..048cfcf11c2b 100644 --- a/usr.sbin/jail/jailparse.y +++ b/usr.sbin/jail/jailparse.y @@ -234,16 +234,19 @@ extern int YYLEX_DECL(); static void YYERROR_DECL() { + struct cflex *cflex = yyget_extra(scanner); + if (!yyget_text(scanner)) warnx("%s line %d: %s", - yyget_extra(scanner)->cfname, yyget_lineno(scanner), s); + cflex->cfname, yyget_lineno(scanner), s); else if (!yyget_text(scanner)[0]) warnx("%s: unexpected EOF", - yyget_extra(scanner)->cfname); + cflex->cfname); else warnx("%s line %d: %s: %s", - yyget_extra(scanner)->cfname, yyget_lineno(scanner), + cflex->cfname, yyget_lineno(scanner), yyget_text(scanner), s); + cflex->error = 1; } /* Handle special parameters (i.e. the include directive). From nobody Fri Feb 2 21:31:27 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TRTVS0zqcz58KVd; Fri, 2 Feb 2024 21:31:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TRTVR72Ngz58g2; Fri, 2 Feb 2024 21:31:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706909488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bMTOJIjp9GvZGq26Fy/kxEZdWvnaYNOfSXmlpmU44LE=; b=Vegk1GyscwGzmnGSmEoz56dvQCn3u18Q3w1bah1Uwt1qCzoWoz93KscZhXlS+ReHOmAvG6 xjpE+XT1nhHv28bhRF4MR+Oq219tsvnt9TuFcFCIorQKO1Ytvc6Gdtqnmxl2dZEdL64XhH jw9iKe81A/Gk2qgbrJ+fEt80U46k69PcuV0XuNoGexx5wVWe7fF2P96vqxmS5TizQOa5ys EIspQSw/c7e9TO/l4gc3zEHPmoDwNz4WaNsqr4Uadz8yureGXkjTXSanPTsin2Y82dMUyo /2zOLpV14hTC8bWHpBg8JZyt6wvqK/cyHoBaczdo74Xd61B47SAQROiRjhdryg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706909488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bMTOJIjp9GvZGq26Fy/kxEZdWvnaYNOfSXmlpmU44LE=; b=T27YFEWwMzvqpqrgLnDyChwtY0IWL5fnGHj6P2WhaGIgR/v6oUYhvflnZA79VfgTSx/Go3 +uRSD+95BYTYHhOPbsvka1jy5kWyL6YFsuc7dQ3tGDw1gIuIwMbQ+bPJFCN23nN3keuoEv cjWNszcaxmNCZILuQJnpLpuni42w5h/BYCEk91M3jEmY/hslClXD/F511xUy25QppWJWPD v8ssQJcflU/fLKtrAj3xnsD2vl0rMb2EtXoqGOKw8h7V4K7SuKK+ksPSbfQ2pzQ0XL+Ega /RAS/r58CPasX/rWeB1dS0Lv0OGVDHn3oKV6XGMpF2wDGZBlvqzhixrM04o9bw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706909488; a=rsa-sha256; cv=none; b=PXzRWOKfFVF9ZvFFkZuM7LoELMS5T3Qj4ePgUPyDZBdQJnK58DWk/btFGmwIwgqD44r8eo qXe7q0sIk89qaj05d05uM+VTBAAigGw1MvW2EVyNySdjQxneGTwLVKJwPYDPnE9uLHjws2 gwzTj21JoJFFNyVpqOwt4dwMmiCb5gpTCbYv4PYFJEUOmNbrkUFm25Jv4C3FGfFo2cAdGx JRjLfFaFhWe0ho+iXLj7SV8kaFDVyRRsRFgQz2hZ9hKS1WDIlfkmj0Du+1F6vzx5Qp3gju srhDlycpsnuK+wqgfJIfJlFxBeYOgTOTwbJKUhPjGcJiutuNgUMzLxYi+eHIeA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TRTVR66Hxzmt8; Fri, 2 Feb 2024 21:31: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 412LVRN6005163; Fri, 2 Feb 2024 21:31:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 412LVRoG005160; Fri, 2 Feb 2024 21:31:27 GMT (envelope-from git) Date: Fri, 2 Feb 2024 21:31:27 GMT Message-Id: <202402022131.412LVRoG005160@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 49e8190c76c1 - stable/13 - fusefs: fix an interaction between copy_file_range and mmap List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 49e8190c76c1525c55ae94b33832cbb09563ae1e Auto-Submitted: auto-generated The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=49e8190c76c1525c55ae94b33832cbb09563ae1e commit 49e8190c76c1525c55ae94b33832cbb09563ae1e Author: Alan Somers AuthorDate: 2023-12-31 14:31:16 +0000 Commit: Alan Somers CommitDate: 2024-02-02 21:31:19 +0000 fusefs: fix an interaction between copy_file_range and mmap If a copy_file_range operation tries to read from a page that was previously written via mmap, that page must be flushed first. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D43451 (cherry picked from commit 1c909c300b92601f7690610097ac98126caff835) --- sys/fs/fuse/fuse_vnops.c | 1 + tests/sys/fs/fusefs/copy_file_range.cc | 68 +++++++++++++++++++++++++ tests/sys/fs/fusefs/io.cc | 90 ++++++++++++++++++++++++++++++++-- 3 files changed, 154 insertions(+), 5 deletions(-) diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c index 6de23cf71cf3..75b83c648d38 100644 --- a/sys/fs/fuse/fuse_vnops.c +++ b/sys/fs/fuse/fuse_vnops.c @@ -908,6 +908,7 @@ fuse_vnop_copy_file_range(struct vop_copy_file_range_args *ap) if (err) goto unlock; + vnode_pager_clean_sync(invp); err = fuse_inval_buf_range(outvp, outfilesize, *ap->a_outoffp, *ap->a_outoffp + io.uio_resid); if (err) diff --git a/tests/sys/fs/fusefs/copy_file_range.cc b/tests/sys/fs/fusefs/copy_file_range.cc index 8640780c0b58..17b21b888736 100644 --- a/tests/sys/fs/fusefs/copy_file_range.cc +++ b/tests/sys/fs/fusefs/copy_file_range.cc @@ -27,6 +27,7 @@ extern "C" { #include +#include #include #include @@ -320,6 +321,73 @@ TEST_F(CopyFileRange, fallback) ASSERT_EQ(len, copy_file_range(fd1, &start1, fd2, &start2, len, 0)); } +/* + * Writes via mmap should not conflict with using copy_file_range. Any dirty + * pages that overlap with copy_file_range's input should be flushed before + * FUSE_COPY_FILE_RANGE is sent. + */ +TEST_F(CopyFileRange, mmap_write) +{ + const char FULLPATH[] = "mountpoint/src.txt"; + const char RELPATH[] = "src.txt"; + uint8_t *wbuf, *fbuf; + void *p; + size_t fsize = 0x6000; + size_t wsize = 0x3000; + ssize_t r; + off_t offset2_in = 0; + off_t offset2_out = wsize; + size_t copysize = wsize; + const uint64_t ino = 42; + const uint64_t fh = 0xdeadbeef1a7ebabe; + int fd; + const mode_t mode = 0644; + + fbuf = (uint8_t*)calloc(1, fsize); + wbuf = (uint8_t*)malloc(wsize); + memset(wbuf, 1, wsize); + + expect_lookup(RELPATH, ino, S_IFREG | mode, fsize, 1); + expect_open(ino, 0, 1, fh); + /* This read is initiated by the mmap write */ + expect_read(ino, 0, fsize, fsize, fbuf, -1, fh); + /* This write flushes the buffer filled by the mmap write */ + expect_write(ino, 0, wsize, wsize, wbuf); + + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_COPY_FILE_RANGE && + (off_t)in.body.copy_file_range.off_in == offset2_in && + (off_t)in.body.copy_file_range.off_out == offset2_out && + in.body.copy_file_range.len == copysize + ); + }, Eq(true)), + _) + ).WillOnce(Invoke(ReturnImmediate([&](auto in __unused, auto& out) { + SET_OUT_HEADER_LEN(out, write); + out.body.write.size = copysize; + }))); + + fd = open(FULLPATH, O_RDWR); + + /* First, write some data via mmap */ + p = mmap(NULL, wsize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + ASSERT_NE(MAP_FAILED, p) << strerror(errno); + memmove((uint8_t*)p, wbuf, wsize); + ASSERT_EQ(0, munmap(p, wsize)) << strerror(errno); + + /* + * Then copy it around the file via copy_file_range. This should + * trigger a FUSE_WRITE to flush the pages written by mmap. + */ + r = copy_file_range(fd, &offset2_in, fd, &offset2_out, copysize, 0); + ASSERT_EQ(copysize, (size_t)r) << strerror(errno); + + free(wbuf); + free(fbuf); +} + + /* * copy_file_range should send SIGXFSZ and return EFBIG when the operation * would exceed the limit imposed by RLIMIT_FSIZE. diff --git a/tests/sys/fs/fusefs/io.cc b/tests/sys/fs/fusefs/io.cc index 3c14621f0b66..fc648f44d755 100644 --- a/tests/sys/fs/fusefs/io.cc +++ b/tests/sys/fs/fusefs/io.cc @@ -73,7 +73,7 @@ static void compare(const void *tbuf, const void *controlbuf, off_t baseofs, } } -typedef tuple IoParam; +typedef tuple IoParam; class Io: public FuseTest, public WithParamInterface { public: @@ -112,6 +112,7 @@ void SetUp() default: FAIL() << "Unknown cache mode"; } + m_kernel_minor_version = get<3>(GetParam()); m_noatime = true; // To prevent SETATTR for atime on close FuseTest::SetUp(); @@ -120,9 +121,10 @@ void SetUp() if (verbosity > 0) { printf("Test Parameters: init_flags=%#x maxwrite=%#x " - "%sasync cache=%s\n", + "%sasync cache=%s kernel_minor_version=%d\n", m_init_flags, m_maxwrite, m_async? "" : "no", - cache_mode_to_s(get<2>(GetParam()))); + cache_mode_to_s(get<2>(GetParam())), + m_kernel_minor_version); } expect_lookup(RELPATH, ino, S_IFREG | 0644, 0, 1); @@ -195,6 +197,30 @@ void SetUp() }, Eq(true)), _) ).WillRepeatedly(Invoke(ReturnErrno(0))); + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_COPY_FILE_RANGE && + in.header.nodeid == ino && + in.body.copy_file_range.nodeid_out == ino && + in.body.copy_file_range.flags == 0); + }, Eq(true)), + _) + ).WillRepeatedly(Invoke(ReturnImmediate([=](auto in, auto& out) { + off_t off_in = in.body.copy_file_range.off_in; + off_t off_out = in.body.copy_file_range.off_out; + ASSERT_EQ((ssize_t)in.body.copy_file_range.len, + copy_file_range(m_backing_fd, &off_in, m_backing_fd, + &off_out, in.body.copy_file_range.len, 0)); + SET_OUT_HEADER_LEN(out, write); + out.body.write.size = in.body.copy_file_range.len; + }))); + /* Claim that we don't support FUSE_LSEEK */ + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_LSEEK); + }, Eq(true)), + _) + ).WillRepeatedly(Invoke(ReturnErrno(ENOSYS))); m_test_fd = open(FULLPATH, O_RDWR ); EXPECT_LE(0, m_test_fd) << strerror(errno); @@ -223,6 +249,31 @@ void do_closeopen() ASSERT_LE(0, m_control_fd) << strerror(errno); } +void do_copy_file_range(off_t off_in, off_t off_out, size_t size) +{ + ssize_t r; + off_t test_off_in = off_in; + off_t test_off_out = off_out; + off_t test_size = size; + off_t control_off_in = off_in; + off_t control_off_out = off_out; + off_t control_size = size; + + while (test_size > 0) { + r = copy_file_range(m_test_fd, &test_off_in, m_test_fd, + &test_off_out, test_size, 0); + ASSERT_GT(r, 0) << strerror(errno); + test_size -= r; + } + while (control_size > 0) { + r = copy_file_range(m_control_fd, &control_off_in, m_control_fd, + &control_off_out, control_size, 0); + ASSERT_GT(r, 0) << strerror(errno); + control_size -= r; + } + m_filesize = std::max(m_filesize, off_out + (off_t)size); +} + void do_ftruncate(off_t offs) { ASSERT_EQ(0, ftruncate(m_test_fd, offs)) << strerror(errno); @@ -345,6 +396,13 @@ virtual void SetUp() { } }; +class IoCopyFileRange: public Io { +public: +virtual void SetUp() { + Io::SetUp(); +} +}; + /* * Extend a file with dirty data in the last page of the last block. * @@ -517,16 +575,38 @@ TEST_P(IoCacheable, vnode_pager_generic_putpage_clean_block_at_eof) do_mapwrite(0x1bbc3, 0x3b4e0); } +/* + * A copy_file_range that follows an mmap write to the input area needs to + * flush the mmap buffer first. + */ +TEST_P(IoCopyFileRange, copy_file_range_from_mapped_write) +{ + do_mapwrite(0x1000, 0); + do_copy_file_range(0, 0x1000, 0x1000); + do_read(0x1000, 0x1000); +} + + INSTANTIATE_TEST_CASE_P(Io, Io, Combine(Bool(), /* async read */ Values(0x1000, 0x10000, 0x20000), /* m_maxwrite */ - Values(Uncached, Writethrough, Writeback, WritebackAsync) + Values(Uncached, Writethrough, Writeback, WritebackAsync), + Values(28) /* kernel_minor_vers */ ) ); INSTANTIATE_TEST_CASE_P(Io, IoCacheable, Combine(Bool(), /* async read */ Values(0x1000, 0x10000, 0x20000), /* m_maxwrite */ - Values(Writethrough, Writeback, WritebackAsync) + Values(Writethrough, Writeback, WritebackAsync), + Values(28) /* kernel_minor_vers */ + ) +); + +INSTANTIATE_TEST_CASE_P(Io, IoCopyFileRange, + Combine(Bool(), /* async read */ + Values(0x10000), /* m_maxwrite */ + Values(Writethrough, Writeback, WritebackAsync), + Values(27, 28) /* kernel_minor_vers */ ) ); From nobody Sat Feb 3 19:11:37 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TS2Ld4xR6z58DMs; Sat, 3 Feb 2024 19:11: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 4TS2Ld4SC6z40CM; Sat, 3 Feb 2024 19:11:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706987497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r/uOQXxqBeqKEL3z4ux8QXbyF9D8dZrfQ5pMF+vaHLI=; b=RU/7olff4W0O7U0rRv788C5dbgdrFrd6O4v1TgWp37hUZBLRy3ARkmq7i1QC8mxtRlmf3Z UrMyzgv+FgK+UTqn9aTgNmUjUnGy4qdt0Vvw9/UOEGBwjK0oEW9fpk2MZFAgq8LL7vHPyZ cd9NYjl7nPJ3Naox+S6jARkahLVsdWoUKRy5N8nRmtrBraXAtcdq3ud/+CGT7j0RZttnQD Y6OBw34dnA1gYA/kWs8khhW3BI9lDUBYybcZxE+2QQ5IZh/5yzLkEfBza9M2dk/UmnlACp BO6VpmZBiE49aOsN1a9fr2QpBu+ES2GTjuoOa0Lphs6G99xa/OZHyll9TGXWWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706987497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r/uOQXxqBeqKEL3z4ux8QXbyF9D8dZrfQ5pMF+vaHLI=; b=yX/YQY8rPmJVJXR8uSGC3odIvQ1yscTqbmiOwnLxlxrzAupXMRbwHVGhsfrRLomiRsJp7c vGYNQnKN4+0tU6obu1d60tzfOOfiYK+/iXqeZOBPFE61WA/+LEQnIPbzBVvbWwBzEcM5Kv QXdJPnuk1l8IX3cQBn4HhpbM0jXcTrSs1ZOG2fHrgrFWP3KzjT9FQLkZ3l4W6maoRdygBc 9kvMpTI6u/a+3KVARGYdLNHHLBVuMkuLRLeBHLDIMXZwYANcQsYtojU6NgGOaOhkc+ZjlZ 6nbI/QWelqcJ4kp6KjhYiz5oDd8aZSiEr9sA5Qj0Ai11wfdied7aQxmoZtVKHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706987497; a=rsa-sha256; cv=none; b=bRh2O9576jGHApu4iuQqYjk5Uvu7IjwOjmdLIokvcFpGgcQX9OBeDMRNQ+mSUR5IX5cyOm fXAMdBXadXr3UEgxiwWhMVruk98werf3vl1KXdetEuG2nCMl3KHnoZPavxrIx+YdTdE6dz qdpNaKoydVr3oww5BQmGqJ8Tv1oFtCQx+GCdT4Ggn1320K+AsVgvX9PWabVUFCfmsNtqKu +jMi9jAiENGD5KFA2yvV2m8+8Jkuv4aCir+fI8SrQpEDIzT2SyD2lLIuVXtT+F4BER5j7T yPkflsUbBRB6RHQKCqebikA/sZJshfv6hyg/zcSnKBJPQIjSaspdh07EygWmBA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TS2Ld3WvXzQTL; Sat, 3 Feb 2024 19:11: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 413JBbVk092984; Sat, 3 Feb 2024 19:11:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 413JBbOY092962; Sat, 3 Feb 2024 19:11:37 GMT (envelope-from git) Date: Sat, 3 Feb 2024 19:11:37 GMT Message-Id: <202402031911.413JBbOY092962@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 93f523ab3668 - stable/14 - netinet: Remove stale references to Giant from comments List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 93f523ab3668516f34d13d844a7772c92411891a Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=93f523ab3668516f34d13d844a7772c92411891a commit 93f523ab3668516f34d13d844a7772c92411891a Author: Mark Johnston AuthorDate: 2023-03-12 18:59:42 +0000 Commit: Mark Johnston CommitDate: 2024-02-03 19:10:36 +0000 netinet: Remove stale references to Giant from comments MFC after: 1 week (cherry picked from commit bbf86c65d04d6013fd3f7b6d74a341256c4e7336) --- sys/netinet/igmp.c | 2 -- sys/netinet/in_mcast.c | 15 +++++---------- sys/netinet6/in6_mcast.c | 7 ++----- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c index 3a60feadcdab..ae58dc0b8b04 100644 --- a/sys/netinet/igmp.c +++ b/sys/netinet/igmp.c @@ -168,7 +168,6 @@ static const struct netisr_handler igmp_nh = { * Any may be taken independently; if any are held at the same * time, the above lock order must be followed. * * All output is delegated to the netisr. - * Now that Giant has been eliminated, the netisr may be inlined. * * IN_MULTI_LIST_LOCK covers in_multi. * * IGMP_LOCK covers igmp_ifsoftc and any global variables in this file, * including the output queue. @@ -1674,7 +1673,6 @@ igmp_fasttimo(void *arg __unused) /* * Fast timeout handler (per-vnet). - * Sends are shuffled off to a netisr to deal with Giant. * * VIMAGE: Assume caller has set up our curvnet. */ diff --git a/sys/netinet/in_mcast.c b/sys/netinet/in_mcast.c index 362e3f25115c..94fc807ccea7 100644 --- a/sys/netinet/in_mcast.c +++ b/sys/netinet/in_mcast.c @@ -93,8 +93,8 @@ static MALLOC_DEFINE(M_IPMSOURCE, "ip_msource", /* * Locking: * - * - Lock order is: Giant, IN_MULTI_LOCK, INP_WLOCK, - * IN_MULTI_LIST_LOCK, IGMP_LOCK, IF_ADDR_LOCK. + * - Lock order is: IN_MULTI_LOCK, INP_WLOCK, IN_MULTI_LIST_LOCK, IGMP_LOCK, + * IF_ADDR_LOCK. * - The IF_ADDR_LOCK is implicitly taken by inm_lookup() earlier, however * it can be taken by code in net/if.c also. * - ip_moptions and in_mfilter are covered by the INP_WLOCK. @@ -1188,9 +1188,9 @@ inm_purge(struct in_multi *inm) /* * Join a multicast group; unlocked entry point. * - * SMPng: XXX: in_joingroup() is called from in_control() when Giant - * is not held. Fortunately, ifp is unlikely to have been detached - * at this point, so we assume it's OK to recurse. + * SMPng: XXX: in_joingroup() is called from in_control(). Fortunately, + * ifp is unlikely to have been detached at this point, so we assume + * it's OK to recurse. */ int in_joingroup(struct ifnet *ifp, const struct in_addr *gina, @@ -1364,8 +1364,6 @@ in_leavegroup_locked(struct in_multi *inm, /*const*/ struct in_mfilter *imf) * The delta-based API applies only to exclusive-mode memberships. * An IGMP downcall will be performed. * - * SMPng: NOTE: Must take Giant as a join may create a new ifma. - * * Return 0 if successful, otherwise return an appropriate error code. */ static int @@ -1552,7 +1550,6 @@ out_inp_locked: * Given an inpcb, return its multicast options structure pointer. Accepts * an unlocked inpcb pointer, but will return it locked. May sleep. * - * SMPng: NOTE: Potentially calls malloc(M_WAITOK) with Giant held. * SMPng: NOTE: Returns with the INP write lock held. */ static struct ip_moptions * @@ -2522,8 +2519,6 @@ inp_set_multicast_if(struct inpcb *inp, struct sockopt *sopt) /* * Atomically set source filters on a socket for an IPv4 multicast group. - * - * SMPng: NOTE: Potentially calls malloc(M_WAITOK) with Giant held. */ static int inp_set_source_filters(struct inpcb *inp, struct sockopt *sopt) diff --git a/sys/netinet6/in6_mcast.c b/sys/netinet6/in6_mcast.c index db2176614f38..a6186568ecb2 100644 --- a/sys/netinet6/in6_mcast.c +++ b/sys/netinet6/in6_mcast.c @@ -101,8 +101,8 @@ RB_GENERATE(ip6_msource_tree, ip6_msource, im6s_link, ip6_msource_cmp); /* * Locking: - * - Lock order is: Giant, IN6_MULTI_LOCK, INP_WLOCK, - * IN6_MULTI_LIST_LOCK, MLD_LOCK, IF_ADDR_LOCK. + * - Lock order is: IN6_MULTI_LOCK, INP_WLOCK, IN6_MULTI_LIST_LOCK, MLD_LOCK, + * IF_ADDR_LOCK. * - The IF_ADDR_LOCK is implicitly taken by in6m_lookup() earlier, however * it can be taken by code in net/if.c also. * - ip6_moptions and in6_mfilter are covered by the INP_WLOCK. @@ -1418,8 +1418,6 @@ in6_leavegroup_locked(struct in6_multi *inm, /*const*/ struct in6_mfilter *imf) * The delta-based API applies only to exclusive-mode memberships. * An MLD downcall will be performed. * - * SMPng: NOTE: Must take Giant as a join may create a new ifma. - * * Return 0 if successful, otherwise return an appropriate error code. */ static int @@ -1581,7 +1579,6 @@ out_in6p_locked: * Given an inpcb, return its multicast options structure pointer. Accepts * an unlocked inpcb pointer, but will return it locked. May sleep. * - * SMPng: NOTE: Potentially calls malloc(M_WAITOK) with Giant held. * SMPng: NOTE: Returns with the INP write lock held. */ static struct ip6_moptions * From nobody Sat Feb 3 19:11:38 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TS2Lf6HLwz58DMt; Sat, 3 Feb 2024 19:11: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 4TS2Lf5VBDz40CN; Sat, 3 Feb 2024 19:11:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706987498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uN1/owwh7ihFbB8oo4ffWovuXDh4SYZXwiT9aUFLiwc=; b=TtORXi9JrFlep/HZP8LD0RF8S7a4fUxVzsFGBlZn+taQBdHhiHoF1B6Jfxu6xb+KL8ltNv vBVyQqdW010vxCk4q0ePE2Uf/4u/E1x57JAZ2SptBnKcos43mviXJt5ooYDUq/11XYqPPu 78xrhkk1xhkSeMUtZXD7isg+NRqn2n5Pq1PazROZZ7+5tYgdAhvrK8xK55BSUaBbeCwlBJ nhTaM7I7/nH0V119pDOSUd6vBQ0tITfSYv0q9N8hgtEj3A7DE/uxlKBNF+97z+6tCavDel xW9NGGsfJyQcwUECB1Mp6UnbLK696yfFCFTKl4MdjiqupcTGApwGjrOFFv23Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706987498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uN1/owwh7ihFbB8oo4ffWovuXDh4SYZXwiT9aUFLiwc=; b=yM92C7/6F3DQcHqnICIjWJcuEYBGFPSVfoO4qMTYHC0sa7aDrK2XK2BHYyuNj05dwUqLLy m26BPNTHkMbU1S1Ixf2ntF1aKiYPtx6EgSH0m24BuUfUMN60Mr+NcHupliXZwTErrgxjBy TayEQnzT9o+DZLk6d5SV/qjEvyts2Iz2ePzXHsHSvowVat31SEutc266riKhWy2lyak8c8 eFKXrcDXgOuhImvh6G59kp5DMua7Ry/ohrMcfMfSr2oW69Ef+r8qfdPybbiJ2e7no5mE6H GUaLzhdr+IbkEOjNj0mjB66604YkfIv87ij1N7RfGn6v8Lj46jStJtBjB3BH0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706987498; a=rsa-sha256; cv=none; b=F9G1c9ecdf+oqjgnlorU095/EUGYQN8Bc8QBqZuUiCeLbdRx6skD1Q/YwBDLWHdP2sg8js e1GoxW8LvldDcPw5sl4tCUgYQFwUK8R7w4aJvIXnSLwu2ySnLr9YhjXdpkIqnfdl6F++2u JF8YSh2OzVDt+0KYZY8uQprEkG1R6HZHkynXm64ZRW7hq+bND7hNuUO5OccY272WYbDTfc pD8/K9vySW6P5pCGVv7xFrG4dOsYo/jpS1VS5XhyVxAWWlQkiGgKWLTeBk2kR1MmmCzG0P TBYJyY38mhW5FXc5PMWNd2ogWCIkhXHCu91x5qsFdzey1fq9fnnNJUCQq7YRHA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TS2Lf4ZRPzQWn; Sat, 3 Feb 2024 19:11: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 413JBc07093807; Sat, 3 Feb 2024 19:11:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 413JBcx8093804; Sat, 3 Feb 2024 19:11:38 GMT (envelope-from git) Date: Sat, 3 Feb 2024 19:11:38 GMT Message-Id: <202402031911.413JBcx8093804@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: d139062ffb01 - stable/14 - makefs: Make it possible to silence warnings about duplicate paths List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d139062ffb01cdce1145d1a95c530da0e792d559 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d139062ffb01cdce1145d1a95c530da0e792d559 commit d139062ffb01cdce1145d1a95c530da0e792d559 Author: Mark Johnston AuthorDate: 2024-01-19 19:06:16 +0000 Commit: Mark Johnston CommitDate: 2024-02-03 19:10:43 +0000 makefs: Make it possible to silence warnings about duplicate paths When generating a VM image from an installworld mtree manifest, makefs spits out several thousand warnings about duplicate paths in the manifest. These are harmless and have been around for a long time (see the phabricator revision for some more details), so let's at least have a way to make makefs quieter. Reviewed by: brooks, imp, emaste MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D43513 (cherry picked from commit e0deb85065efbcd2123d65f65eb54bd1dcf0588c) --- usr.sbin/makefs/makefs.8 | 4 +++- usr.sbin/makefs/makefs.c | 2 +- usr.sbin/makefs/mtree.c | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/usr.sbin/makefs/makefs.8 b/usr.sbin/makefs/makefs.8 index a5e15a045ec6..c6aeae961196 100644 --- a/usr.sbin/makefs/makefs.8 +++ b/usr.sbin/makefs/makefs.8 @@ -33,7 +33,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 2, 2024 +.Dd January 19, 2024 .Dt MAKEFS 8 .Os @@ -110,6 +110,8 @@ suffix may be provided to indicate that indicates a percentage of the calculated image size. .It Fl D Treat duplicate paths in an mtree manifest as warnings not error. +If this flag is specified more than once, warnings about duplicate paths +are not printed at all. .It Fl d Ar debug-mask Enable various levels of debugging, depending upon which bits are set in diff --git a/usr.sbin/makefs/makefs.c b/usr.sbin/makefs/makefs.c index 8c8e03b9d59f..e02571f42997 100644 --- a/usr.sbin/makefs/makefs.c +++ b/usr.sbin/makefs/makefs.c @@ -165,7 +165,7 @@ main(int argc, char *argv[]) break; case 'D': - dupsok = 1; + dupsok++; break; case 'd': diff --git a/usr.sbin/makefs/mtree.c b/usr.sbin/makefs/mtree.c index 3e62afbc1137..dabc9f787f88 100644 --- a/usr.sbin/makefs/mtree.c +++ b/usr.sbin/makefs/mtree.c @@ -895,11 +895,11 @@ read_mtree_spec1(FILE *fp, bool def, const char *name) if (strcmp(name, node->name) == 0) { if (def == true) { - if (!dupsok) + if (dupsok == 0) mtree_error( "duplicate definition of %s", name); - else + else if (dupsok == 1) mtree_warning( "duplicate definition of %s", name); From nobody Sat Feb 3 19:11:39 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TS2Lh2mBVz58DCm; Sat, 3 Feb 2024 19:11: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 4TS2Lg6GWVz40CH; Sat, 3 Feb 2024 19:11:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706987499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CrFdxniUlhVfbovxOHE7eb8MXnTd4y+jGRf38xD0rfQ=; b=uJHrYxy8BJuKJn5NQhBxkCbHdsKGuQ8tw1nO48bHpqMwl6yvZr6N179/Kg4/PcpjF8LOh5 10YFl94P83hHkJ7NEQ+GavuV0J9rh7Ph0Pwbnl5mFZy8hy8En+DF/pPjbTOjG496/pitHe Y9TRJfwDmNqBAjeUviLC4gkfU9JFSLdyA6+cktLPiLETxy1n7UTHhHAznzD7pxCE6fB0Nk R5iV+hk0dI8syA53/aLq4ChMSerJYnfjVlkcc2upxg8VoBH8sk1aK7NF3N7978eg/XRTFD B2igjiJE+gnSdPVIpqLVSjOYOab5aEeUJLdFAtOqhtcVEA/G4zqHNH+utYm3jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706987499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CrFdxniUlhVfbovxOHE7eb8MXnTd4y+jGRf38xD0rfQ=; b=Wkvsc8Z9bb57CVp9RVtH7Li1lTBdtD3v6hjjaCaG6GSjoQnCbCzSxk7Gu8Gol0IyxB5WLU CY0HlNfM263f0s8pAXgyPxWvsQ2gyc7NED7BPyTUtcIhp3gZMp+NyZ0T/I13jvFJhhWdnw OfwYK52Je8VZcxYO6UMhQwxSG3C8bsQWZL9Ik0EHKJqR1Z/YoA6Np0PPV7KMrinOHtX9VY q0JmMyUnKUBGpF5+k8bH6XVe1Jzccn48j32w6p59rO80BW27jo6LAb03q0oF/MHOb7sds8 gYRjN4Dj+7hD78XeiXNTdqZvlvzxV2hUsuS9/twL9CLdXau2O+EJrmmAswIFuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706987499; a=rsa-sha256; cv=none; b=P64jJSLRyOAeRFrbFwbK2PwjlNidL/xIDkeRCxi3Vv5qvK5Jh1jBPhlouA3YGA50ds+EO1 vC/4mu73hClEk0js/YhqtSPYSIZ1YZHcOjYnLlPFYHzh3d99S3+Han3shHLnVGoFlgZHdY PzxnuDnC1+DZDIcwMqSht2U8iY6OscaT0jw5liFc4hVlfl7ZmBM1cZwFpS6HqKqKmzFhJJ XDPEdXKVoMWjrknigwOnZrSMS4METbMeIYklQtko2AUSoa1CVWOCabfa0KrNsxpCKYq92m 6tbdsvGT4/sjFEY+s6We4bn8MPNtZTvoc7n4pv0yJJ4mYvxf8nIWXUgFlChVCQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TS2Lg5L4XzQRY; Sat, 3 Feb 2024 19:11: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 413JBd1J093847; Sat, 3 Feb 2024 19:11:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 413JBdm2093844; Sat, 3 Feb 2024 19:11:39 GMT (envelope-from git) Date: Sat, 3 Feb 2024 19:11:39 GMT Message-Id: <202402031911.413JBdm2093844@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 92baae0fec65 - stable/14 - route tests: Serialize List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 92baae0fec65e190c2b32dbdd9f48ab39510ec2e Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=92baae0fec65e190c2b32dbdd9f48ab39510ec2e commit 92baae0fec65e190c2b32dbdd9f48ab39510ec2e Author: Mark Johnston AuthorDate: 2023-03-25 19:59:20 +0000 Commit: Mark Johnston CommitDate: 2024-02-03 19:10:50 +0000 route tests: Serialize These tests reuse jail names and so cannot run in parallel. MFC after: 1 week (cherry picked from commit 2e55256de3e6193b5073f9774362b06ce690e482) --- sbin/route/tests/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sbin/route/tests/Makefile b/sbin/route/tests/Makefile index 1ae964693ff4..23e5ecb79143 100644 --- a/sbin/route/tests/Makefile +++ b/sbin/route/tests/Makefile @@ -1,10 +1,10 @@ PACKAGE= tests -ATF_TESTS_SH+= \ - basic +ATF_TESTS_SH+= basic +# Tests reuse jail names and so cannot run in parallel. +TEST_METADATA.basic+= is_exclusive=true -${PACKAGE}FILES+= \ - utils.subr +${PACKAGE}FILES+= utils.subr .include From nobody Sat Feb 3 19:11:40 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TS2Lj4hmRz58D5V; Sat, 3 Feb 2024 19:11: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 4TS2Lj0KcDz400Z; Sat, 3 Feb 2024 19:11:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706987501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Cuq+jJYpTiATSL6MJ71uDpXAK0P2um/xDts2XMFWWE=; b=RaCy0YZAU9wITz6YYcvjII9lBkqU8tM4LwVqwyWmzK8wgOYINb09DIdy9RYeMJbxiuWCKQ UUDv2ZcOEcsfTX6djW6TesywpOJCkAoZs6srEvtCfFVmT/fQGb1+wOI/n1XYra+mcLCsiO sB2dLHOzCI772/ddnbR5JABlqfToy96sgrOITK0aOGzGLsQlHx1NP2vwee39GCAagNNveF YkYDzvVF4ZQ7Z7VClY43XurN64+2n1eAcUnD/RKvoVrNm8sIFCLIN6eU1TdCYN0rRgqYSs SCZtiG6yJYyBOA0oRov+BMTfjXwLcI0vW9W3qJv7LVoNMsEJWBQT2UAmsVo3Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706987501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Cuq+jJYpTiATSL6MJ71uDpXAK0P2um/xDts2XMFWWE=; b=M/1Uf/HD1JwtJ3vLfOS+m0Y0yW4h5/wuSATKv662FZ8uTFgN6vHuItlzHSUofNI17rZ3uH bCtuaEzyfWlQgn48SMCGT+IWGXnsK5IJIJdoJmx/Fyo9a+EfdHQQjrGRHAF6PG2S58ex35 tftmNW5q3M9noVf5Yj/7V8vY0nFhjl8hJ1ISFZ/pcFcXhGuA0WTTvTyKN7AJOb18ra7g0L GmLoaMn3bZycxlL1VMHAmuFQCcU6O56JUzGbUduAjXVFg4Nh1IQxPeyh5E2nX5ts1MAYPz l9kZYxS3nwDwiSy/laFoe/LvnnsOwO6X4en4hi+ZRQSfckY82KaYzW3LbaA0HA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706987501; a=rsa-sha256; cv=none; b=xTqyoSGZxxO++dwc9/glyp42F3LnSt6AbID8Oh/gFnQPv3M12liGCz0oshC8nzgJh3e3iO SSgbjnO+NUd/a9CY7r2wdEesJoSdApNwLuQPoqCsLJvj4bSNnNDDAyeZ3cYfr+cse8gFRf QwpCe2Qbb2YdGgfPhMyuKP9ipR3TLI6aOIOny/VXLKd/V4IpzdC4Zoo57hRL/tEL4gl1Ip Lwf/15e0hzyA9G7qp/CTcyGrS6sALJoUNTNnq5KI+tEMXShtRzdTjAREIcTPFMpVnv6hcd Dg+Fa49/TJ67j0CMIh2tSGO+7zDxL2i7wcpNAkJqK9EDvA/MB4U/vn6UWLnSyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TS2Lh6Xq0zQhV; Sat, 3 Feb 2024 19:11: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 413JBeRh093892; Sat, 3 Feb 2024 19:11:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 413JBevY093889; Sat, 3 Feb 2024 19:11:40 GMT (envelope-from git) Date: Sat, 3 Feb 2024 19:11:40 GMT Message-Id: <202402031911.413JBevY093889@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 7a14a721c09d - stable/14 - netinet6 tests: Restore an atf_check invocation List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7a14a721c09d3af74adea7eccd9984468d1ee0b6 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7a14a721c09d3af74adea7eccd9984468d1ee0b6 commit 7a14a721c09d3af74adea7eccd9984468d1ee0b6 Author: Mark Johnston AuthorDate: 2023-03-31 00:07:20 +0000 Commit: Mark Johnston CommitDate: 2024-02-03 19:10:56 +0000 netinet6 tests: Restore an atf_check invocation This one has been commented out since the initial commit, but doesn't appear to pose any problems. MFC after: 1 week (cherry picked from commit 3f73fbb0acd4131b08dba4f7590061826ab08df1) --- tests/sys/netinet6/forward6.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sys/netinet6/forward6.sh b/tests/sys/netinet6/forward6.sh index 2eecbf382461..b3ccd30aea62 100755 --- a/tests/sys/netinet6/forward6.sh +++ b/tests/sys/netinet6/forward6.sh @@ -375,7 +375,7 @@ fwd_ip6_gu_icmp_gw_gu_slow_success_body() { jexec ${jname} sysctl net.inet6.ip6.forwarding=1 # Do not turn off route redirects to ensure slow path is on - # atf_check -s exit:0 + atf_check -s exit:0 \ $(atf_get_srcdir)/${script_name} \ --test_name fwd_ip6_icmp \ --smac ${our_mac} --dmac ${jail_mac} \ From nobody Sat Feb 3 19:11:41 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TS2Lk1pNxz58DKy; Sat, 3 Feb 2024 19:11: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 4TS2Lk0vMrz40Pj; Sat, 3 Feb 2024 19:11:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706987502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tqMLzRdkh8HX2rNc7ZiKpNM1B1VWrCbyhkF2ngoNEL8=; b=Du8VOJFhXJmu8d01GJzpMNzDjcpupwzmDsOKSkm4b4/xPTjXEsMmjsxWRRoWJn0d4bYcJv tvMl3U82roDblss9iLs/qsVb099hHjU3QSQvARvqNLDTzOfwq40G/w4QZ2avkmXCQ8K/L7 RgOQBN4aEETrauFyVBdJDIeKnqsGyueUKeu7bWZh9eZCM8v2oemMEIrXRmgN4+Qw/SsYTC FXV70RvHl2OaS+P9mu9Gmd6OFfVGXNkx5bGXRfLvE10LOHa9sUgDDIJB3NiWkyoLDNbGct UhHWxHNdUFBz+tI/uQhRzeXYooPaNa5OC2HorYkii7BcwqNeDGn7QU8GJjBktQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706987502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tqMLzRdkh8HX2rNc7ZiKpNM1B1VWrCbyhkF2ngoNEL8=; b=whFPW4eL9UbEkrn1NI/WqAniZ8yrEGrOj3So8vD4l7sSohESLvVTYGNHOCfCkrj41IFsXr Zi3DEq/atCh0jHaO6Ssp1MvA/40Aj7Iu6+1mkRlGKksamaHy+KnzDmcDkBCKxiVmfoiCbv z4o7HG3q5WXbw6cM/QC5OdfLf/YwNSl5CE2AXThXX1f1Wk8vOIf8YUpZQsGm6QIEy2kghh 8KZB+atibr055YDVlbFn5KFLTv9ORJa9wh6KhzRk5XyyS2QZ3h28ctoLNlZvydhiVHGEd4 irtu2wJhSwONdDp/MNdiDwxw50inxjMzYmebD3c+AuSYgYq1plvxce3wcqEbLw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706987502; a=rsa-sha256; cv=none; b=pWmpMkxdAuyZDTqPW9Jd3TCGyluJcylEjYhgnKTbwD5Ga/MjaiPPd93WKlYJNa2evuKL0C BhqKTkKfC77V5AIQaPjzwACyZd+PeH9rOqjJ9gsRm2nUH+ocPNazbvjFlATqO0noaLsEHP vf1wA0pmFbhQN9s65jAD15sgG7+aMmAGc+D3uqZ6ojHwlkmjTv6bBmfYzqMldIj4PX33b+ 0XXPLxUGv8M4lGPBww/Dfcd2FnqPlunvnbnCxg03ytfgXKUyFUlsDzF1bVU0b0CSDpMfuV FpL3Z9c36VGL6jVGuu+WUUr5SUGFkwyKI8k0GYV2fgWSnFeklBpqkhZ7fijMhQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TS2Lk00ybzQWq; Sat, 3 Feb 2024 19:11: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 413JBfg4093940; Sat, 3 Feb 2024 19:11:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 413JBfbd093937; Sat, 3 Feb 2024 19:11:41 GMT (envelope-from git) Date: Sat, 3 Feb 2024 19:11:41 GMT Message-Id: <202402031911.413JBfbd093937@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: e9264b568128 - stable/14 - netinet tests: Make test jail names unique List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e9264b5681289f925c6daca9f31489173b625591 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e9264b5681289f925c6daca9f31489173b625591 commit e9264b5681289f925c6daca9f31489173b625591 Author: Mark Johnston AuthorDate: 2024-01-27 15:26:22 +0000 Commit: Mark Johnston CommitDate: 2024-02-03 19:11:09 +0000 netinet tests: Make test jail names unique Otherwise we get spurious test failures when running tests in parallel. The intent here was to name jails after the tests, but this was done incorrectly in a couple of places. MFC after: 1 week (cherry picked from commit 001c48b4139ff6f07de70a16518161dcea5598b9) --- tests/sys/netinet/output.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/sys/netinet/output.sh b/tests/sys/netinet/output.sh index 9ede7e66aaa5..23d427605878 100755 --- a/tests/sys/netinet/output.sh +++ b/tests/sys/netinet/output.sh @@ -386,7 +386,7 @@ output_udp_flowid_mpath_success_body() script_name=`dirname $0`/../common/net_receiver.py script_name=`realpath ${script_name}` - jname="v4t-output_tcp_flowid_mpath_success" + jname="v4t-output_udp_flowid_mpath_success" epair0=$(vnet_mkepair) epair1=$(vnet_mkepair) @@ -510,7 +510,7 @@ output_raw_flowid_mpath_success_body() plen=24 text="testtesttst" - jname="v4t-output_tcp_flowid_mpath_success" + jname="v4t-output_raw_flowid_mpath_success" epair0=$(vnet_mkepair) epair1=$(vnet_mkepair) From nobody Sun Feb 4 00:27:12 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TS9Ln0Fc2z58lvM; Sun, 4 Feb 2024 00:27: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 4TS9Lm74wGz4Tdc; Sun, 4 Feb 2024 00:27:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707006433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IVjtQlDHVEP8h0aXiEDp5Oht8abmI3vKQO1NtPMm7NQ=; b=ZrnFOkwH/2hgaXFII9jZvhoyjOELXYAPfthy/lhO5brbaVKAJx6tz0w/vbpV9mwsR20keA n+LxmepJdJDBw50Y36n9helXcFgak8Bm4/OoDzvOHExAnL8nuToBb2iM6lwdCRDhz54RXo jIFW+DC6NccHKAIWRxn5/YAg7EL+eQpK/gJkLDPv0z8s6yzw+VlgeDvjcyvbTfzAIFwijM ZiA//KDsZaMCSIMMx2mMJZymYJhT6v9NaRib1dIqlZfL1jzTV0DDC6CNRRQRv1wTmD8eeU w9pwnsQBAeKQSzmfIzoqaWuxkR3ZVhcNKQqfNVcCuoQPj7Dwm3Yrcm5m9IfrcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707006433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IVjtQlDHVEP8h0aXiEDp5Oht8abmI3vKQO1NtPMm7NQ=; b=QuE8grSzqF51tgt1a1Cu10sAHCbNdeZxAAm+K8RY1t7Gx3Kfv/wU5jdxJcJp+UhP+6Zlj0 oyV6TFb1sM2LUb4kYKth2VoLJBl8eBVtxt7DKHdtjKOZlEdhMPpb/vjLEH/QOR5sTR84w6 todFxuzXWnh5IzgBve+m1AWhlZeCA05N83BLUreQieUaFjOyThFZWrNx7AtBdju0h33Wjw vWnQaq3CdZ82s1zAVbncYuV34rjfbNEXdm1+Xk01DdxpNK96Sf++xDW93sAFVOl8JiyVeM ATy/as9O13V7I0GvQm7Xeg/ns1BN+WyDfouaQKFk3Ik8r/iCGqciStd0uOhxNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707006433; a=rsa-sha256; cv=none; b=eCjNIScyieiF6GIEYk5gE75lEujaetseaB6t1nW4W1XiHVewVIxZsCdd8P2CeVS6dTCtEj Dh1qzSKfknWTKgNMDYBs/H2qmDOz+qvKrNZmSPI11HjJxw5McjIs64w8Uk8J355/C1wBwr r7KRS0tTNokB7ZqeMTH+QxZwo8H/ECCev6+9g5WcGanePAbsfC09MQeLMO/6KYrc9E4pi0 OPGeEKEFfjZyIY9ifeMnwE9Ze+4YwYTKP5gFUYoFPnxvg17HWELvJq4Pms1fCBdQ7t1pAU DyLXF8+z7/HwAJ7jBJGnaAtLprjPZ8l0kyZSe5lgDjEOQZXehzDOp1NImxVT0Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TS9Lm6806zbKS; Sun, 4 Feb 2024 00:27: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 4140RCIZ016196; Sun, 4 Feb 2024 00:27:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4140RCet016193; Sun, 4 Feb 2024 00:27:12 GMT (envelope-from git) Date: Sun, 4 Feb 2024 00:27:12 GMT Message-Id: <202402040027.4140RCet016193@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: 66aa73282ab8 - stable/14 - lib/msun: Cleanup after $FreeBSD$ removal List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 66aa73282ab879009cf021a3fcd435e1ab083b82 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=66aa73282ab879009cf021a3fcd435e1ab083b82 commit 66aa73282ab879009cf021a3fcd435e1ab083b82 Author: Steve Kargl AuthorDate: 2024-01-28 09:14:50 +0000 Commit: Konstantin Belousov CommitDate: 2024-02-04 00:26:28 +0000 lib/msun: Cleanup after $FreeBSD$ removal PR: 276669 (cherry picked from commit 0dd5a5603e7a33d976f8e6015620bbc79839c609) --- lib/msun/bsdsrc/b_exp.c | 2 -- lib/msun/bsdsrc/b_log.c | 2 -- lib/msun/bsdsrc/b_tgamma.c | 2 -- lib/msun/bsdsrc/mathimpl.h | 1 - lib/msun/i387/invtrig.c | 1 - lib/msun/ld128/e_lgammal_r.c | 1 - lib/msun/ld128/e_powl.c | 1 - lib/msun/ld128/e_rem_pio2l.h | 1 - lib/msun/ld128/invtrig.c | 1 - lib/msun/ld128/k_cosl.c | 1 - lib/msun/ld128/k_expl.h | 1 - lib/msun/ld128/k_sinl.c | 1 - lib/msun/ld128/k_tanl.c | 1 - lib/msun/ld128/s_cexpl.c | 1 - lib/msun/ld128/s_erfl.c | 1 - lib/msun/ld128/s_exp2l.c | 1 - lib/msun/ld128/s_expl.c | 1 - lib/msun/ld128/s_logl.c | 1 - lib/msun/ld80/e_lgammal_r.c | 1 - lib/msun/ld80/e_powl.c | 2 -- lib/msun/ld80/e_rem_pio2l.h | 1 - lib/msun/ld80/invtrig.c | 1 - lib/msun/ld80/k_cosl.c | 1 - lib/msun/ld80/k_expl.h | 1 - lib/msun/ld80/k_sinl.c | 1 - lib/msun/ld80/k_tanl.c | 1 - lib/msun/ld80/s_cexpl.c | 1 - lib/msun/ld80/s_erfl.c | 1 - lib/msun/ld80/s_exp2l.c | 1 - lib/msun/ld80/s_expl.c | 1 - lib/msun/ld80/s_logl.c | 1 - lib/msun/src/catrig.c | 1 - lib/msun/src/catrigf.c | 1 - lib/msun/src/catrigl.c | 1 - lib/msun/src/e_acos.c | 1 - lib/msun/src/e_acosf.c | 1 - lib/msun/src/e_acosh.c | 1 - lib/msun/src/e_acoshf.c | 1 - lib/msun/src/e_acoshl.c | 1 - lib/msun/src/e_acosl.c | 1 - lib/msun/src/e_asin.c | 1 - lib/msun/src/e_asinf.c | 1 - lib/msun/src/e_asinl.c | 1 - lib/msun/src/e_atan2.c | 1 - lib/msun/src/e_atan2f.c | 1 - lib/msun/src/e_atan2l.c | 1 - lib/msun/src/e_atanh.c | 1 - lib/msun/src/e_atanhf.c | 1 - lib/msun/src/e_atanhl.c | 1 - lib/msun/src/e_cosh.c | 1 - lib/msun/src/e_coshf.c | 1 - lib/msun/src/e_coshl.c | 1 - lib/msun/src/e_exp.c | 1 - lib/msun/src/e_expf.c | 1 - lib/msun/src/e_fmod.c | 1 - lib/msun/src/e_fmodf.c | 1 - lib/msun/src/e_fmodl.c | 1 - lib/msun/src/e_gamma.c | 1 - lib/msun/src/e_gamma_r.c | 1 - lib/msun/src/e_gammaf.c | 1 - lib/msun/src/e_gammaf_r.c | 1 - lib/msun/src/e_hypot.c | 1 - lib/msun/src/e_hypotf.c | 1 - lib/msun/src/e_hypotl.c | 1 - lib/msun/src/e_j0.c | 1 - lib/msun/src/e_j0f.c | 1 - lib/msun/src/e_j1.c | 1 - lib/msun/src/e_j1f.c | 1 - lib/msun/src/e_jn.c | 1 - lib/msun/src/e_jnf.c | 1 - lib/msun/src/e_lgamma.c | 1 - lib/msun/src/e_lgamma_r.c | 1 - lib/msun/src/e_lgammaf.c | 1 - lib/msun/src/e_lgammaf_r.c | 1 - lib/msun/src/e_lgammal.c | 1 - lib/msun/src/e_log.c | 1 - lib/msun/src/e_log10.c | 1 - lib/msun/src/e_log10f.c | 1 - lib/msun/src/e_log2.c | 1 - lib/msun/src/e_log2f.c | 1 - lib/msun/src/e_logf.c | 1 - lib/msun/src/e_pow.c | 1 - lib/msun/src/e_powf.c | 1 - lib/msun/src/e_rem_pio2.c | 1 - lib/msun/src/e_rem_pio2f.c | 1 - lib/msun/src/e_remainder.c | 1 - lib/msun/src/e_remainderf.c | 1 - lib/msun/src/e_remainderl.c | 1 - lib/msun/src/e_scalb.c | 1 - lib/msun/src/e_scalbf.c | 1 - lib/msun/src/e_sinh.c | 1 - lib/msun/src/e_sinhf.c | 1 - lib/msun/src/e_sinhl.c | 1 - lib/msun/src/e_sqrt.c | 1 - lib/msun/src/e_sqrtl.c | 1 - lib/msun/src/k_cos.c | 1 - lib/msun/src/k_cosf.c | 4 ---- lib/msun/src/k_exp.c | 1 - lib/msun/src/k_expf.c | 1 - lib/msun/src/k_log.h | 1 - lib/msun/src/k_logf.h | 1 - lib/msun/src/k_rem_pio2.c | 1 - lib/msun/src/k_sin.c | 1 - lib/msun/src/k_sincos.h | 1 - lib/msun/src/k_sincosf.h | 1 - lib/msun/src/k_sincosl.h | 1 - lib/msun/src/k_sinf.c | 4 ---- lib/msun/src/k_tan.c | 2 -- lib/msun/src/k_tanf.c | 4 ---- lib/msun/src/math.h | 1 - lib/msun/src/s_asinh.c | 1 - lib/msun/src/s_asinhf.c | 1 - lib/msun/src/s_asinhl.c | 1 - lib/msun/src/s_atan.c | 1 - lib/msun/src/s_atanf.c | 1 - lib/msun/src/s_atanl.c | 1 - lib/msun/src/s_carg.c | 1 - lib/msun/src/s_cargf.c | 1 - lib/msun/src/s_cargl.c | 1 - lib/msun/src/s_cbrt.c | 1 - lib/msun/src/s_cbrtf.c | 1 - lib/msun/src/s_cbrtl.c | 1 - lib/msun/src/s_ccosh.c | 1 - lib/msun/src/s_ccoshf.c | 1 - lib/msun/src/s_ceil.c | 1 - lib/msun/src/s_ceilf.c | 1 - lib/msun/src/s_ceill.c | 1 - lib/msun/src/s_cexp.c | 1 - lib/msun/src/s_cexpf.c | 1 - lib/msun/src/s_clog.c | 1 - lib/msun/src/s_clogf.c | 1 - lib/msun/src/s_clogl.c | 1 - lib/msun/src/s_copysign.c | 1 - lib/msun/src/s_copysignf.c | 1 - lib/msun/src/s_cos.c | 1 - lib/msun/src/s_cosf.c | 1 - lib/msun/src/s_cosl.c | 1 - lib/msun/src/s_cpow.c | 1 - lib/msun/src/s_cpowf.c | 1 - lib/msun/src/s_cpowl.c | 1 - lib/msun/src/s_cproj.c | 1 - lib/msun/src/s_cprojf.c | 1 - lib/msun/src/s_cprojl.c | 1 - lib/msun/src/s_csinh.c | 1 - lib/msun/src/s_csinhf.c | 1 - lib/msun/src/s_csqrt.c | 1 - lib/msun/src/s_csqrtf.c | 1 - lib/msun/src/s_csqrtl.c | 1 - lib/msun/src/s_ctanh.c | 1 - lib/msun/src/s_ctanhf.c | 1 - lib/msun/src/s_erf.c | 1 - lib/msun/src/s_erff.c | 1 - lib/msun/src/s_exp2.c | 1 - lib/msun/src/s_exp2f.c | 1 - lib/msun/src/s_expm1.c | 1 - lib/msun/src/s_expm1f.c | 1 - lib/msun/src/s_fabs.c | 1 - lib/msun/src/s_fabsf.c | 1 - lib/msun/src/s_fdim.c | 1 - lib/msun/src/s_finite.c | 1 - lib/msun/src/s_finitef.c | 1 - lib/msun/src/s_floor.c | 1 - lib/msun/src/s_floorf.c | 1 - lib/msun/src/s_floorl.c | 1 - lib/msun/src/s_fma.c | 1 - lib/msun/src/s_fmaf.c | 1 - lib/msun/src/s_fmal.c | 1 - lib/msun/src/s_fmax.c | 1 - lib/msun/src/s_fmaxf.c | 1 - lib/msun/src/s_fmaxl.c | 1 - lib/msun/src/s_fmin.c | 1 - lib/msun/src/s_fminf.c | 1 - lib/msun/src/s_fminl.c | 1 - lib/msun/src/s_frexp.c | 1 - lib/msun/src/s_frexpf.c | 1 - lib/msun/src/s_ilogb.c | 1 - lib/msun/src/s_ilogbf.c | 1 - lib/msun/src/s_ilogbl.c | 1 - lib/msun/src/s_llrint.c | 1 - lib/msun/src/s_llrintf.c | 1 - lib/msun/src/s_llrintl.c | 1 - lib/msun/src/s_llround.c | 1 - lib/msun/src/s_llroundf.c | 1 - lib/msun/src/s_llroundl.c | 1 - lib/msun/src/s_log1p.c | 1 - lib/msun/src/s_log1pf.c | 1 - lib/msun/src/s_logb.c | 1 - lib/msun/src/s_logbf.c | 1 - lib/msun/src/s_logbl.c | 1 - lib/msun/src/s_lrint.c | 1 - lib/msun/src/s_lrintf.c | 1 - lib/msun/src/s_lrintl.c | 1 - lib/msun/src/s_lround.c | 1 - lib/msun/src/s_lroundf.c | 1 - lib/msun/src/s_lroundl.c | 1 - lib/msun/src/s_modff.c | 1 - lib/msun/src/s_nearbyint.c | 1 - lib/msun/src/s_nextafter.c | 1 - lib/msun/src/s_nextafterf.c | 1 - lib/msun/src/s_nextafterl.c | 1 - lib/msun/src/s_nexttoward.c | 1 - lib/msun/src/s_nexttowardf.c | 1 - lib/msun/src/s_remquo.c | 1 - lib/msun/src/s_remquof.c | 1 - lib/msun/src/s_remquol.c | 1 - lib/msun/src/s_rint.c | 1 - lib/msun/src/s_rintf.c | 1 - lib/msun/src/s_rintl.c | 1 - lib/msun/src/s_round.c | 1 - lib/msun/src/s_roundf.c | 1 - lib/msun/src/s_roundl.c | 1 - lib/msun/src/s_scalbln.c | 1 - lib/msun/src/s_significand.c | 1 - lib/msun/src/s_significandf.c | 1 - lib/msun/src/s_sin.c | 1 - lib/msun/src/s_sincos.c | 1 - lib/msun/src/s_sincosf.c | 1 - lib/msun/src/s_sincosl.c | 1 - lib/msun/src/s_sinf.c | 1 - lib/msun/src/s_sinl.c | 1 - lib/msun/src/s_tan.c | 1 - lib/msun/src/s_tanf.c | 1 - lib/msun/src/s_tanh.c | 1 - lib/msun/src/s_tanhf.c | 1 - lib/msun/src/s_tanhl.c | 1 - lib/msun/src/s_tanl.c | 1 - lib/msun/src/s_tgammaf.c | 1 - lib/msun/src/s_trunc.c | 1 - lib/msun/src/s_truncf.c | 1 - lib/msun/src/s_truncl.c | 1 - lib/msun/src/w_cabs.c | 1 - lib/msun/src/w_cabsl.c | 1 - lib/msun/tests/rem_test.c | 1 - 233 files changed, 247 deletions(-) diff --git a/lib/msun/bsdsrc/b_exp.c b/lib/msun/bsdsrc/b_exp.c index 398755a0aaeb..44cd5190de92 100644 --- a/lib/msun/bsdsrc/b_exp.c +++ b/lib/msun/bsdsrc/b_exp.c @@ -29,8 +29,6 @@ * SUCH DAMAGE. */ -/* @(#)exp.c 8.1 (Berkeley) 6/4/93 */ -#include /* EXP(X) * RETURN THE EXPONENTIAL OF X * DOUBLE PRECISION (IEEE 53 bits, VAX D FORMAT 56 BITS) diff --git a/lib/msun/bsdsrc/b_log.c b/lib/msun/bsdsrc/b_log.c index aeec29368412..a82140bb98b5 100644 --- a/lib/msun/bsdsrc/b_log.c +++ b/lib/msun/bsdsrc/b_log.c @@ -29,8 +29,6 @@ * SUCH DAMAGE. */ -/* @(#)log.c 8.2 (Berkeley) 11/30/93 */ -#include /* Table-driven natural logarithm. * * This code was derived, with minor modifications, from: diff --git a/lib/msun/bsdsrc/b_tgamma.c b/lib/msun/bsdsrc/b_tgamma.c index cc9f8f70297e..8369477c18b7 100644 --- a/lib/msun/bsdsrc/b_tgamma.c +++ b/lib/msun/bsdsrc/b_tgamma.c @@ -42,8 +42,6 @@ * porting to other precisions. */ -/* @(#)gamma.c 8.1 (Berkeley) 6/4/93 */ -#include #include #include "math.h" diff --git a/lib/msun/bsdsrc/mathimpl.h b/lib/msun/bsdsrc/mathimpl.h index 3d6554747dac..a7d2c59476b5 100644 --- a/lib/msun/bsdsrc/mathimpl.h +++ b/lib/msun/bsdsrc/mathimpl.h @@ -38,7 +38,6 @@ #ifndef _MATHIMPL_H_ #define _MATHIMPL_H_ -#include #include #include "../src/math_private.h" diff --git a/lib/msun/i387/invtrig.c b/lib/msun/i387/invtrig.c index 523f022e0546..50d8d3af9343 100644 --- a/lib/msun/i387/invtrig.c +++ b/lib/msun/i387/invtrig.c @@ -26,7 +26,6 @@ * SUCH DAMAGE. */ -#include #include #define STRUCT_DECLS diff --git a/lib/msun/ld128/e_lgammal_r.c b/lib/msun/ld128/e_lgammal_r.c index e3d97b6d18b7..3f23a2a7ae38 100644 --- a/lib/msun/ld128/e_lgammal_r.c +++ b/lib/msun/ld128/e_lgammal_r.c @@ -10,7 +10,6 @@ * ==================================================== */ -#include /* * See e_lgamma_r.c for complete comments. * diff --git a/lib/msun/ld128/e_powl.c b/lib/msun/ld128/e_powl.c index fd8b57b66bd5..f5a993cf0054 100644 --- a/lib/msun/ld128/e_powl.c +++ b/lib/msun/ld128/e_powl.c @@ -59,7 +59,6 @@ * */ -#include #include #include diff --git a/lib/msun/ld128/e_rem_pio2l.h b/lib/msun/ld128/e_rem_pio2l.h index 35ed0b865a7c..5d1f9bde92da 100644 --- a/lib/msun/ld128/e_rem_pio2l.h +++ b/lib/msun/ld128/e_rem_pio2l.h @@ -13,7 +13,6 @@ * Optimized by Bruce D. Evans. */ -#include /* ld128 version of __ieee754_rem_pio2l(x,y) * * return the remainder of x rem pi/2 in y[0]+y[1] diff --git a/lib/msun/ld128/invtrig.c b/lib/msun/ld128/invtrig.c index cd9a276b68d1..75aef7b5166a 100644 --- a/lib/msun/ld128/invtrig.c +++ b/lib/msun/ld128/invtrig.c @@ -26,7 +26,6 @@ * SUCH DAMAGE. */ -#include #include "invtrig.h" /* diff --git a/lib/msun/ld128/k_cosl.c b/lib/msun/ld128/k_cosl.c index 8280378c429c..7b5f0c60fbb3 100644 --- a/lib/msun/ld128/k_cosl.c +++ b/lib/msun/ld128/k_cosl.c @@ -11,7 +11,6 @@ * ==================================================== */ -#include /* * ld128 version of k_cos.c. See ../src/k_cos.c for most comments. */ diff --git a/lib/msun/ld128/k_expl.h b/lib/msun/ld128/k_expl.h index 71924f16c8a4..86811dd8e089 100644 --- a/lib/msun/ld128/k_expl.h +++ b/lib/msun/ld128/k_expl.h @@ -30,7 +30,6 @@ * Optimized by Bruce D. Evans. */ -#include /* * ld128 version of k_expl.h. See ../ld80/s_expl.c for most comments. * diff --git a/lib/msun/ld128/k_sinl.c b/lib/msun/ld128/k_sinl.c index ca54f9f1a630..eb458e974ae0 100644 --- a/lib/msun/ld128/k_sinl.c +++ b/lib/msun/ld128/k_sinl.c @@ -11,7 +11,6 @@ * ==================================================== */ -#include /* * ld128 version of k_sin.c. See ../src/k_sin.c for most comments. */ diff --git a/lib/msun/ld128/k_tanl.c b/lib/msun/ld128/k_tanl.c index daff6b2bde8c..62e8b8648c44 100644 --- a/lib/msun/ld128/k_tanl.c +++ b/lib/msun/ld128/k_tanl.c @@ -11,7 +11,6 @@ * ==================================================== */ -#include /* * ld128 version of k_tan.c. See ../src/k_tan.c for most comments. */ diff --git a/lib/msun/ld128/s_cexpl.c b/lib/msun/ld128/s_cexpl.c index 1e4141f162c5..9e3eebfa750e 100644 --- a/lib/msun/ld128/s_cexpl.c +++ b/lib/msun/ld128/s_cexpl.c @@ -26,7 +26,6 @@ * SUCH DAMAGE. */ -#include #include #include #include diff --git a/lib/msun/ld128/s_erfl.c b/lib/msun/ld128/s_erfl.c index 43ba2f0bed8b..1cc2dd04df23 100644 --- a/lib/msun/ld128/s_erfl.c +++ b/lib/msun/ld128/s_erfl.c @@ -10,7 +10,6 @@ * ==================================================== */ -#include /* * See s_erf.c for complete comments. * diff --git a/lib/msun/ld128/s_exp2l.c b/lib/msun/ld128/s_exp2l.c index 74ae8c2daad8..249cb4cb8bb0 100644 --- a/lib/msun/ld128/s_exp2l.c +++ b/lib/msun/ld128/s_exp2l.c @@ -26,7 +26,6 @@ * SUCH DAMAGE. */ -#include #include #include diff --git a/lib/msun/ld128/s_expl.c b/lib/msun/ld128/s_expl.c index 6d6c22d917fe..e1358e2213a0 100644 --- a/lib/msun/ld128/s_expl.c +++ b/lib/msun/ld128/s_expl.c @@ -28,7 +28,6 @@ * Optimized by Bruce D. Evans. */ -#include /* * ld128 version of s_expl.c. See ../ld80/s_expl.c for most comments. */ diff --git a/lib/msun/ld128/s_logl.c b/lib/msun/ld128/s_logl.c index 8961dd0c96db..4d32462e5653 100644 --- a/lib/msun/ld128/s_logl.c +++ b/lib/msun/ld128/s_logl.c @@ -26,7 +26,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include /** * Implementation of the natural logarithm of x for 128-bit format. * diff --git a/lib/msun/ld80/e_lgammal_r.c b/lib/msun/ld80/e_lgammal_r.c index cfd73b408b87..8bac285c97d6 100644 --- a/lib/msun/ld80/e_lgammal_r.c +++ b/lib/msun/ld80/e_lgammal_r.c @@ -10,7 +10,6 @@ * ==================================================== */ -#include /* * See e_lgamma_r.c for complete comments. * diff --git a/lib/msun/ld80/e_powl.c b/lib/msun/ld80/e_powl.c index 2daf26aab93b..b028d3cb7ff2 100644 --- a/lib/msun/ld80/e_powl.c +++ b/lib/msun/ld80/e_powl.c @@ -14,7 +14,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include #include #include "math_private.h" @@ -114,7 +113,6 @@ __p1evll(long double x, long double *PP, int n) * */ -#include #include #include diff --git a/lib/msun/ld80/e_rem_pio2l.h b/lib/msun/ld80/e_rem_pio2l.h index d9e4d3a0941f..88412c3d0cf9 100644 --- a/lib/msun/ld80/e_rem_pio2l.h +++ b/lib/msun/ld80/e_rem_pio2l.h @@ -13,7 +13,6 @@ * Optimized by Bruce D. Evans. */ -#include /* ld80 version of __ieee754_rem_pio2l(x,y) * * return the remainder of x rem pi/2 in y[0]+y[1] diff --git a/lib/msun/ld80/invtrig.c b/lib/msun/ld80/invtrig.c index 0e2d49546391..76eb681454d3 100644 --- a/lib/msun/ld80/invtrig.c +++ b/lib/msun/ld80/invtrig.c @@ -26,7 +26,6 @@ * SUCH DAMAGE. */ -#include #include "invtrig.h" /* diff --git a/lib/msun/ld80/k_cosl.c b/lib/msun/ld80/k_cosl.c index e76d429b90ef..b4bcf6fe38f3 100644 --- a/lib/msun/ld80/k_cosl.c +++ b/lib/msun/ld80/k_cosl.c @@ -11,7 +11,6 @@ * ==================================================== */ -#include /* * ld80 version of k_cos.c. See ../src/k_cos.c for most comments. */ diff --git a/lib/msun/ld80/k_expl.h b/lib/msun/ld80/k_expl.h index 8c3617e4b177..fabf5a792205 100644 --- a/lib/msun/ld80/k_expl.h +++ b/lib/msun/ld80/k_expl.h @@ -30,7 +30,6 @@ * Optimized by Bruce D. Evans. */ -#include /* * See s_expl.c for more comments about __k_expl(). * diff --git a/lib/msun/ld80/k_sinl.c b/lib/msun/ld80/k_sinl.c index 21c1946b5e1b..b9a7fbe7c698 100644 --- a/lib/msun/ld80/k_sinl.c +++ b/lib/msun/ld80/k_sinl.c @@ -11,7 +11,6 @@ * ==================================================== */ -#include /* * ld80 version of k_sin.c. See ../src/k_sin.c for most comments. */ diff --git a/lib/msun/ld80/k_tanl.c b/lib/msun/ld80/k_tanl.c index 4965c669979f..07d13608a5f6 100644 --- a/lib/msun/ld80/k_tanl.c +++ b/lib/msun/ld80/k_tanl.c @@ -11,7 +11,6 @@ * ==================================================== */ -#include /* * ld80 version of k_tan.c. See ../src/k_tan.c for most comments. */ diff --git a/lib/msun/ld80/s_cexpl.c b/lib/msun/ld80/s_cexpl.c index 81a4d727561b..cbe9dcd64099 100644 --- a/lib/msun/ld80/s_cexpl.c +++ b/lib/msun/ld80/s_cexpl.c @@ -28,7 +28,6 @@ * src/s_cexp.c converted to long double complex by Steven G. Kargl */ -#include #include #include #ifdef __i386__ diff --git a/lib/msun/ld80/s_erfl.c b/lib/msun/ld80/s_erfl.c index 362b4f07d6bc..13b7d11e09ea 100644 --- a/lib/msun/ld80/s_erfl.c +++ b/lib/msun/ld80/s_erfl.c @@ -10,7 +10,6 @@ * ==================================================== */ -#include /* * See s_erf.c for complete comments. * diff --git a/lib/msun/ld80/s_exp2l.c b/lib/msun/ld80/s_exp2l.c index 94aecf1843cd..9d979994ece8 100644 --- a/lib/msun/ld80/s_exp2l.c +++ b/lib/msun/ld80/s_exp2l.c @@ -26,7 +26,6 @@ * SUCH DAMAGE. */ -#include #include #include diff --git a/lib/msun/ld80/s_expl.c b/lib/msun/ld80/s_expl.c index 065e02fae1b0..03d7b366151a 100644 --- a/lib/msun/ld80/s_expl.c +++ b/lib/msun/ld80/s_expl.c @@ -28,7 +28,6 @@ * Optimized by Bruce D. Evans. */ -#include /** * Compute the exponential of x for Intel 80-bit format. This is based on: * diff --git a/lib/msun/ld80/s_logl.c b/lib/msun/ld80/s_logl.c index 459374d7d164..2c5d1e2dd08f 100644 --- a/lib/msun/ld80/s_logl.c +++ b/lib/msun/ld80/s_logl.c @@ -26,7 +26,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include /** * Implementation of the natural logarithm of x for Intel 80-bit format. * diff --git a/lib/msun/src/catrig.c b/lib/msun/src/catrig.c index 929811a09a3b..45af164a66c5 100644 --- a/lib/msun/src/catrig.c +++ b/lib/msun/src/catrig.c @@ -26,7 +26,6 @@ * SUCH DAMAGE. */ -#include #include #include diff --git a/lib/msun/src/catrigf.c b/lib/msun/src/catrigf.c index 7feecfc5de38..da90629ec076 100644 --- a/lib/msun/src/catrigf.c +++ b/lib/msun/src/catrigf.c @@ -40,7 +40,6 @@ * a few comments on the right of declarations remain. */ -#include #include #include diff --git a/lib/msun/src/catrigl.c b/lib/msun/src/catrigl.c index 7cc3c1431731..faf9d299670e 100644 --- a/lib/msun/src/catrigl.c +++ b/lib/msun/src/catrigl.c @@ -39,7 +39,6 @@ * a few comments on the right of declarations remain. */ -#include #include #include diff --git a/lib/msun/src/e_acos.c b/lib/msun/src/e_acos.c index 275d0ebb7756..021245667728 100644 --- a/lib/msun/src/e_acos.c +++ b/lib/msun/src/e_acos.c @@ -11,7 +11,6 @@ * ==================================================== */ -#include /* acos(x) * Method : * acos(x) = pi/2 - asin(x) diff --git a/lib/msun/src/e_acosf.c b/lib/msun/src/e_acosf.c index 29f6d4a78495..42ba126d1baa 100644 --- a/lib/msun/src/e_acosf.c +++ b/lib/msun/src/e_acosf.c @@ -13,7 +13,6 @@ * ==================================================== */ -#include #include "math.h" #include "math_private.h" diff --git a/lib/msun/src/e_acosh.c b/lib/msun/src/e_acosh.c index d50f5513ee59..31400c473cec 100644 --- a/lib/msun/src/e_acosh.c +++ b/lib/msun/src/e_acosh.c @@ -12,7 +12,6 @@ * */ -#include /* acosh(x) * Method : * Based on diff --git a/lib/msun/src/e_acoshf.c b/lib/msun/src/e_acoshf.c index df12609671cf..b6fbd2c14cb4 100644 --- a/lib/msun/src/e_acoshf.c +++ b/lib/msun/src/e_acoshf.c @@ -13,7 +13,6 @@ * ==================================================== */ -#include #include "math.h" #include "math_private.h" diff --git a/lib/msun/src/e_acoshl.c b/lib/msun/src/e_acoshl.c index 8f3d3963e7cf..fcadaa8b08ac 100644 --- a/lib/msun/src/e_acoshl.c +++ b/lib/msun/src/e_acoshl.c @@ -13,7 +13,6 @@ * */ -#include /* * See e_acosh.c for complete comments. * diff --git a/lib/msun/src/e_acosl.c b/lib/msun/src/e_acosl.c index 524fa756a103..fd72794bc017 100644 --- a/lib/msun/src/e_acosl.c +++ b/lib/msun/src/e_acosl.c @@ -12,7 +12,6 @@ * ==================================================== */ -#include /* * See comments in e_acos.c. * Converted to long double by David Schultz . diff --git a/lib/msun/src/e_asin.c b/lib/msun/src/e_asin.c index ae6e496850e1..6662f95faccc 100644 --- a/lib/msun/src/e_asin.c +++ b/lib/msun/src/e_asin.c @@ -11,7 +11,6 @@ * ==================================================== */ -#include /* asin(x) * Method : * Since asin(x) = x + x^3/6 + x^5*3/40 + x^7*15/336 + ... diff --git a/lib/msun/src/e_asinf.c b/lib/msun/src/e_asinf.c index 391c15870f84..a2ee1a166f03 100644 --- a/lib/msun/src/e_asinf.c +++ b/lib/msun/src/e_asinf.c @@ -13,7 +13,6 @@ * ==================================================== */ -#include #include "math.h" #include "math_private.h" diff --git a/lib/msun/src/e_asinl.c b/lib/msun/src/e_asinl.c index d0cff2f536fa..e73ed1c3a4f0 100644 --- a/lib/msun/src/e_asinl.c +++ b/lib/msun/src/e_asinl.c @@ -12,7 +12,6 @@ * ==================================================== */ -#include /* * See comments in e_asin.c. * Converted to long double by David Schultz . diff --git a/lib/msun/src/e_atan2.c b/lib/msun/src/e_atan2.c index f4d3ed2e00db..45c00199458b 100644 --- a/lib/msun/src/e_atan2.c +++ b/lib/msun/src/e_atan2.c @@ -12,7 +12,6 @@ * */ -#include /* atan2(y,x) * Method : * 1. Reduce y to positive by atan2(y,x)=-atan2(-y,x). diff --git a/lib/msun/src/e_atan2f.c b/lib/msun/src/e_atan2f.c index af8c00851476..408f3646f612 100644 --- a/lib/msun/src/e_atan2f.c +++ b/lib/msun/src/e_atan2f.c @@ -13,7 +13,6 @@ * ==================================================== */ -#include #include "math.h" #include "math_private.h" diff --git a/lib/msun/src/e_atan2l.c b/lib/msun/src/e_atan2l.c index 722334f76791..66fe42bd8aa8 100644 --- a/lib/msun/src/e_atan2l.c +++ b/lib/msun/src/e_atan2l.c @@ -13,7 +13,6 @@ * */ -#include /* * See comments in e_atan2.c. * Converted to long double by David Schultz . diff --git a/lib/msun/src/e_atanh.c b/lib/msun/src/e_atanh.c index 3eabaaf82403..4e13c3fc1661 100644 --- a/lib/msun/src/e_atanh.c +++ b/lib/msun/src/e_atanh.c @@ -12,7 +12,6 @@ * */ -#include /* atanh(x) * Method : * 1.Reduced x to positive by atanh(-x) = -atanh(x) diff --git a/lib/msun/src/e_atanhf.c b/lib/msun/src/e_atanhf.c index 134513e5b817..a2d6b69a6812 100644 --- a/lib/msun/src/e_atanhf.c +++ b/lib/msun/src/e_atanhf.c @@ -13,7 +13,6 @@ * ==================================================== */ -#include #include "math.h" #include "math_private.h" diff --git a/lib/msun/src/e_atanhl.c b/lib/msun/src/e_atanhl.c index 66a301f52ab6..331328e1ae1f 100644 --- a/lib/msun/src/e_atanhl.c +++ b/lib/msun/src/e_atanhl.c @@ -13,7 +13,6 @@ * */ -#include /* * See e_atanh.c for complete comments. * diff --git a/lib/msun/src/e_cosh.c b/lib/msun/src/e_cosh.c index 56ec7d56093d..60b9aa2c7dd2 100644 --- a/lib/msun/src/e_cosh.c +++ b/lib/msun/src/e_cosh.c @@ -11,7 +11,6 @@ * ==================================================== */ -#include /* cosh(x) * Method : * mathematically cosh(x) if defined to be (exp(x)+exp(-x))/2 diff --git a/lib/msun/src/e_coshf.c b/lib/msun/src/e_coshf.c index 8c5457e24a51..40443b8b84d3 100644 --- a/lib/msun/src/e_coshf.c +++ b/lib/msun/src/e_coshf.c @@ -13,7 +13,6 @@ * ==================================================== */ -#include #include "math.h" #include "math_private.h" diff --git a/lib/msun/src/e_coshl.c b/lib/msun/src/e_coshl.c index de54b8183bbb..efb5094d39f9 100644 --- a/lib/msun/src/e_coshl.c +++ b/lib/msun/src/e_coshl.c @@ -11,7 +11,6 @@ * ==================================================== */ -#include /* * See e_cosh.c for complete comments. * diff --git a/lib/msun/src/e_exp.c b/lib/msun/src/e_exp.c index afbcdb3db7b6..040a28260db0 100644 --- a/lib/msun/src/e_exp.c +++ b/lib/msun/src/e_exp.c @@ -10,7 +10,6 @@ * ==================================================== */ -#include /* exp(x) * Returns the exponential of x. * diff --git a/lib/msun/src/e_expf.c b/lib/msun/src/e_expf.c index 2dbce9dd870d..fe2e6779469f 100644 --- a/lib/msun/src/e_expf.c +++ b/lib/msun/src/e_expf.c @@ -13,7 +13,6 @@ * ==================================================== */ -#include #include #include "math.h" diff --git a/lib/msun/src/e_fmod.c b/lib/msun/src/e_fmod.c index fdfb56c2a475..dd96f6bcd7cb 100644 --- a/lib/msun/src/e_fmod.c +++ b/lib/msun/src/e_fmod.c @@ -11,7 +11,6 @@ * ==================================================== */ -#include /* * fmod(x,y) * Return x mod y in exact arithmetic diff --git a/lib/msun/src/e_fmodf.c b/lib/msun/src/e_fmodf.c index 0e6633fbe739..a7d1a0c22acd 100644 --- a/lib/msun/src/e_fmodf.c +++ b/lib/msun/src/e_fmodf.c @@ -13,7 +13,6 @@ * ==================================================== */ -#include /* * fmodf(x,y) * Return x mod y in exact arithmetic diff --git a/lib/msun/src/e_fmodl.c b/lib/msun/src/e_fmodl.c index 8a348ee117e7..6984b52fc8d5 100644 --- a/lib/msun/src/e_fmodl.c +++ b/lib/msun/src/e_fmodl.c @@ -10,7 +10,6 @@ * ==================================================== */ -#include #include #include diff --git a/lib/msun/src/e_gamma.c b/lib/msun/src/e_gamma.c index 7757337b59af..0b1db544c35e 100644 --- a/lib/msun/src/e_gamma.c +++ b/lib/msun/src/e_gamma.c @@ -12,7 +12,6 @@ * */ -#include /* gamma(x) * Return the logarithm of the Gamma function of x. * diff --git a/lib/msun/src/e_gamma_r.c b/lib/msun/src/e_gamma_r.c index f204685c3f7a..3f62026d90c1 100644 --- a/lib/msun/src/e_gamma_r.c +++ b/lib/msun/src/e_gamma_r.c @@ -12,7 +12,6 @@ * */ -#include /* gamma_r(x, signgamp) * Reentrant version of the logarithm of the Gamma function * with user provide pointer for the sign of Gamma(x). diff --git a/lib/msun/src/e_gammaf.c b/lib/msun/src/e_gammaf.c index 3afef79de53a..98da5711e811 100644 --- a/lib/msun/src/e_gammaf.c +++ b/lib/msun/src/e_gammaf.c @@ -13,7 +13,6 @@ * ==================================================== */ -#include /* gammaf(x) * Return the logarithm of the Gamma function of x. * diff --git a/lib/msun/src/e_gammaf_r.c b/lib/msun/src/e_gammaf_r.c index 5b3bd535aa42..ae80c1bae2cc 100644 --- a/lib/msun/src/e_gammaf_r.c +++ b/lib/msun/src/e_gammaf_r.c *** 2052 LINES SKIPPED ***