From nobody Sat Feb 4 20:07:55 2023 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 4P8Nqb4JWhz3nnsM; Sat, 4 Feb 2023 20:07:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P8Nqb3kHLz3QK6; Sat, 4 Feb 2023 20:07:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675541275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mjav1ddsFm1E3QsxnsL3DCTsB4C2n433d3QtNRRdbf4=; b=CKFGGqzfMq2/Wbfa+dMOrpEJocYaIgaPHdOxXciKPxD+HNAfLuks2W/76emCrzwrRUzBSK EL1IOWLGw4f/5ID1hj+7a3w1aDXqWak7NS6hbjuC9wbOdZVbyOYmEPNMNxA+v2H+34lly7 mAYlmN9lQ1tVAXMlEQhxogp17fXehpn5rcIf05tJSlHRunDeD971l2sZyzQurf2PQD68Dg uWlogfr3Gqf2jd0f9Q2jRwr+azKa5O7VieeKbragtYQ2owTOpJMo9W5YiH4XGE6hSDzP84 O+vdmstzxfEzTxDyMhsDR8EdbLydokps3cD4tym4wGIa1SML58O5xK9/yqCWqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675541275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mjav1ddsFm1E3QsxnsL3DCTsB4C2n433d3QtNRRdbf4=; b=hNa9Y3jXsLhifR2oKDMwOFmKrTPBm5y5oTZndAKlb4pTS8Rh+WPU9reYUicC3ACz2rqaSJ k9nNWRepLrBvGs501n37WfMZPWAjAW0Pg1ujWOarSH1/WK2oXRqCP24xrFz1Jx1Uczv3iu SnZuYgk5FB6F5fBU2g9YsSPsNycqtCbj61XAnR3UZAwlhhBDMUg9wjNrWgpEy2RWBs3GdT LvA5Au0lbCXH74u3ndkghnfa1ZRwU/Cmc5HUZ7DqdSYxxS4VVl8HQ5oR/bGczeSCbJZ7Rf hqvhIO6rNsbzpuEwE6zAz1QqV/gZczD+eC1u9QwAS1gkMEloM8Z37S57wJ7sNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675541275; a=rsa-sha256; cv=none; b=YfP7H3cqMsULE5zepyt2PpN/MNs/7/Y2o4ookClyCXPfwJTlzg7DLhDr3b4em4Kwd0rMyN iS40OUWm8YCaHW1hBif6EsG7h/i98wJ3g0Zsty0HU8VA6AdrzJKqc8wHu5byowCBzLkTgk Qdek4DYH6b8DN2aHpxY01w5Jqbzl8IzjMgDJIeUpZn1STwrrK9roVSnwIK3HGtCMc5bvp3 Pozt/J0ucEW6KxQuMkHEc4+5rCezJFB8ldONRBxW6lmdpM/E7Qmx6KREKyb1YOB5asR2wt 5LpZ6MzEXZCxQORlRiwW/b/DdA2Tzjm1aM6YoSiamE7yTGYGDTT5jjFYiAN0wQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P8Nqb2lw9zSGj; Sat, 4 Feb 2023 20:07:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 314K7tHP034431; Sat, 4 Feb 2023 20:07:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 314K7tVb034430; Sat, 4 Feb 2023 20:07:55 GMT (envelope-from git) Date: Sat, 4 Feb 2023 20:07:55 GMT Message-Id: <202302042007.314K7tVb034430@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 3d7a882488a4 - stable/13 - zfs: fix mounting snapshots in .zfs/snapshot as a regular user 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: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3d7a882488a4c1c69283614ae179df7c1d2f3a7e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=3d7a882488a4c1c69283614ae179df7c1d2f3a7e commit 3d7a882488a4c1c69283614ae179df7c1d2f3a7e Author: Martin Matuska AuthorDate: 2023-02-04 18:39:12 +0000 Commit: Martin Matuska CommitDate: 2023-02-04 19:50:33 +0000 zfs: fix mounting snapshots in .zfs/snapshot as a regular user This is a cherry-pick from vendor/openzfs/master resulting in a direct commit to stable/13 The cherry-pick to branch zfs-2.1-release has been proposed upstream. Vendor pull requeset merges: #13758 Allow mounting snapshots in .zfs/snapshot as a regular user #14218 Bugfix: Avoid a null pointer dereference in zfs_mount() on FreeBSD PR: 260160 (cherry picked from commit 595d3ac2ed61331124feda2cf5787c3dd4c7ae09) (cherry picked from commit d27a00283faf4ec2b997ff2376dee4a080e1ca7b) --- .../openzfs/module/os/freebsd/spl/spl_vfs.c | 10 +- .../openzfs/module/os/freebsd/zfs/zfs_vfsops.c | 279 ++++++++++++++++++++- 2 files changed, 276 insertions(+), 13 deletions(-) diff --git a/sys/contrib/openzfs/module/os/freebsd/spl/spl_vfs.c b/sys/contrib/openzfs/module/os/freebsd/spl/spl_vfs.c index 60ea627e975b..53ef46fb8ce5 100644 --- a/sys/contrib/openzfs/module/os/freebsd/spl/spl_vfs.c +++ b/sys/contrib/openzfs/module/os/freebsd/spl/spl_vfs.c @@ -125,7 +125,6 @@ mount_snapshot(kthread_t *td, vnode_t **vpp, const char *fstype, char *fspath, struct vfsconf *vfsp; struct mount *mp; vnode_t *vp, *mvp; - struct ucred *cr; int error; ASSERT_VOP_ELOCKED(*vpp, "mount_snapshot"); @@ -194,15 +193,8 @@ mount_snapshot(kthread_t *td, vnode_t **vpp, const char *fstype, char *fspath, * mount(8) and df(1) output. */ mp->mnt_flag |= MNT_IGNORE; - /* - * XXX: This is evil, but we can't mount a snapshot as a regular user. - * XXX: Is is safe when snapshot is mounted from within a jail? - */ - cr = td->td_ucred; - td->td_ucred = kcred; - error = VFS_MOUNT(mp); - td->td_ucred = cr; + error = VFS_MOUNT(mp); if (error != 0) { /* * Clear VI_MOUNT and decrement the use count "atomically", diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c index 248b2d924f8c..85449ebb9d97 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c @@ -64,6 +64,7 @@ #include #include #include +#include #include #include @@ -90,6 +91,20 @@ int zfs_debug_level; SYSCTL_INT(_vfs_zfs, OID_AUTO, debug, CTLFLAG_RWTUN, &zfs_debug_level, 0, "Debug level"); +struct zfs_jailparam { + int mount_snapshot; +}; + +static struct zfs_jailparam zfs_jailparam0 = { + .mount_snapshot = 0, +}; + +static int zfs_jailparam_slot; + +SYSCTL_JAIL_PARAM_SYS_NODE(zfs, CTLFLAG_RW, "Jail ZFS parameters"); +SYSCTL_JAIL_PARAM(_zfs, mount_snapshot, CTLTYPE_INT | CTLFLAG_RW, "I", + "Allow mounting snapshots in the .zfs directory for unjailed datasets"); + SYSCTL_NODE(_vfs_zfs, OID_AUTO, version, CTLFLAG_RD, 0, "ZFS versions"); static int zfs_version_acl = ZFS_ACL_VERSION; SYSCTL_INT(_vfs_zfs_version, OID_AUTO, acl, CTLFLAG_RD, &zfs_version_acl, 0, @@ -1332,7 +1347,7 @@ zfs_mount(vfs_t *vfsp) char *osname; int error = 0; int canwrite; - bool checkpointrewind; + bool checkpointrewind, isctlsnap = false; if (vfs_getopt(vfsp->mnt_optnew, "from", (void **)&osname, NULL)) return (SET_ERROR(EINVAL)); @@ -1347,6 +1362,8 @@ zfs_mount(vfs_t *vfsp) } fetch_osname_options(osname, &checkpointrewind); + isctlsnap = (mvp != NULL && zfsctl_is_node(mvp) && + strchr(osname, '@') != NULL); /* * Check for mount privilege? @@ -1355,7 +1372,9 @@ zfs_mount(vfs_t *vfsp) * we have local permission to allow it */ error = secpolicy_fs_mount(cr, mvp, vfsp); - if (error) { + if (error && isctlsnap) { + secpolicy_fs_mount_clearopts(cr, vfsp); + } else if (error) { if (dsl_deleg_access(osname, ZFS_DELEG_PERM_MOUNT, cr) != 0) goto out; @@ -1392,8 +1411,27 @@ zfs_mount(vfs_t *vfsp) */ if (!INGLOBALZONE(curproc) && (!zone_dataset_visible(osname, &canwrite) || !canwrite)) { - error = SET_ERROR(EPERM); - goto out; + boolean_t mount_snapshot = B_FALSE; + + /* + * Snapshots may be mounted in .zfs for unjailed datasets + * if allowed by the jail param zfs.mount_snapshot. + */ + if (isctlsnap) { + struct prison *pr; + struct zfs_jailparam *zjp; + + pr = curthread->td_ucred->cr_prison; + mtx_lock(&pr->pr_mtx); + zjp = osd_jail_get(pr, zfs_jailparam_slot); + mtx_unlock(&pr->pr_mtx); + if (zjp && zjp->mount_snapshot) + mount_snapshot = B_TRUE; + } + if (!mount_snapshot) { + error = SET_ERROR(EPERM); + goto out; + } } vfsp->vfs_flag |= MNT_NFS4ACLS; @@ -2343,3 +2381,236 @@ zfsvfs_update_fromname(const char *oldname, const char *newname) mtx_unlock(&mountlist_mtx); } #endif + +/* + * Find a prison with ZFS info. + * Return the ZFS info and the (locked) prison. + */ +static struct zfs_jailparam * +zfs_jailparam_find(struct prison *spr, struct prison **prp) +{ + struct prison *pr; + struct zfs_jailparam *zjp; + + for (pr = spr; ; pr = pr->pr_parent) { + mtx_lock(&pr->pr_mtx); + if (pr == &prison0) { + zjp = &zfs_jailparam0; + break; + } + zjp = osd_jail_get(pr, zfs_jailparam_slot); + if (zjp != NULL) + break; + mtx_unlock(&pr->pr_mtx); + } + *prp = pr; + + return (zjp); +} + +/* + * Ensure a prison has its own ZFS info. If zjpp is non-null, point it to the + * ZFS info and lock the prison. + */ +static void +zfs_jailparam_alloc(struct prison *pr, struct zfs_jailparam **zjpp) +{ + struct prison *ppr; + struct zfs_jailparam *zjp, *nzjp; + void **rsv; + + /* If this prison already has ZFS info, return that. */ + zjp = zfs_jailparam_find(pr, &ppr); + if (ppr == pr) + goto done; + + /* + * Allocate a new info record. Then check again, in case something + * changed during the allocation. + */ + mtx_unlock(&ppr->pr_mtx); + nzjp = malloc(sizeof (struct zfs_jailparam), M_PRISON, M_WAITOK); + rsv = osd_reserve(zfs_jailparam_slot); + zjp = zfs_jailparam_find(pr, &ppr); + if (ppr == pr) { + free(nzjp, M_PRISON); + osd_free_reserved(rsv); + goto done; + } + /* Inherit the initial values from the ancestor. */ + mtx_lock(&pr->pr_mtx); + (void) osd_jail_set_reserved(pr, zfs_jailparam_slot, rsv, nzjp); + (void) memcpy(nzjp, zjp, sizeof (*zjp)); + zjp = nzjp; + mtx_unlock(&ppr->pr_mtx); +done: + if (zjpp != NULL) + *zjpp = zjp; + else + mtx_unlock(&pr->pr_mtx); +} + +/* + * Jail OSD methods for ZFS VFS info. + */ +static int +zfs_jailparam_create(void *obj, void *data) +{ + struct prison *pr = obj; + struct vfsoptlist *opts = data; + int jsys; + + if (vfs_copyopt(opts, "zfs", &jsys, sizeof (jsys)) == 0 && + jsys == JAIL_SYS_INHERIT) + return (0); + /* + * Inherit a prison's initial values from its parent + * (different from JAIL_SYS_INHERIT which also inherits changes). + */ + zfs_jailparam_alloc(pr, NULL); + return (0); +} + +static int +zfs_jailparam_get(void *obj, void *data) +{ + struct prison *ppr, *pr = obj; + struct vfsoptlist *opts = data; + struct zfs_jailparam *zjp; + int jsys, error; + + zjp = zfs_jailparam_find(pr, &ppr); + jsys = (ppr == pr) ? JAIL_SYS_NEW : JAIL_SYS_INHERIT; + error = vfs_setopt(opts, "zfs", &jsys, sizeof (jsys)); + if (error != 0 && error != ENOENT) + goto done; + if (jsys == JAIL_SYS_NEW) { + error = vfs_setopt(opts, "zfs.mount_snapshot", + &zjp->mount_snapshot, sizeof (zjp->mount_snapshot)); + if (error != 0 && error != ENOENT) + goto done; + } else { + /* + * If this prison is inheriting its ZFS info, report + * empty/zero parameters. + */ + static int mount_snapshot = 0; + + error = vfs_setopt(opts, "zfs.mount_snapshot", + &mount_snapshot, sizeof (mount_snapshot)); + if (error != 0 && error != ENOENT) + goto done; + } + error = 0; +done: + mtx_unlock(&ppr->pr_mtx); + return (error); +} + +static int +zfs_jailparam_set(void *obj, void *data) +{ + struct prison *pr = obj; + struct prison *ppr; + struct vfsoptlist *opts = data; + int error, jsys, mount_snapshot; + + /* Set the parameters, which should be correct. */ + error = vfs_copyopt(opts, "zfs", &jsys, sizeof (jsys)); + if (error == ENOENT) + jsys = -1; + error = vfs_copyopt(opts, "zfs.mount_snapshot", &mount_snapshot, + sizeof (mount_snapshot)); + if (error == ENOENT) + mount_snapshot = -1; + else + jsys = JAIL_SYS_NEW; + if (jsys == JAIL_SYS_NEW) { + /* "zfs=new" or "zfs.*": the prison gets its own ZFS info. */ + struct zfs_jailparam *zjp; + + /* + * A child jail cannot have more permissions than its parent + */ + if (pr->pr_parent != &prison0) { + zjp = zfs_jailparam_find(pr->pr_parent, &ppr); + mtx_unlock(&ppr->pr_mtx); + if (zjp->mount_snapshot < mount_snapshot) { + return (EPERM); + } + } + zfs_jailparam_alloc(pr, &zjp); + if (mount_snapshot != -1) + zjp->mount_snapshot = mount_snapshot; + mtx_unlock(&pr->pr_mtx); + } else { + /* "zfs=inherit": inherit the parent's ZFS info. */ + mtx_lock(&pr->pr_mtx); + osd_jail_del(pr, zfs_jailparam_slot); + mtx_unlock(&pr->pr_mtx); + } + return (0); +} + +static int +zfs_jailparam_check(void *obj __unused, void *data) +{ + struct vfsoptlist *opts = data; + int error, jsys, mount_snapshot; + + /* Check that the parameters are correct. */ + error = vfs_copyopt(opts, "zfs", &jsys, sizeof (jsys)); + if (error != ENOENT) { + if (error != 0) + return (error); + if (jsys != JAIL_SYS_NEW && jsys != JAIL_SYS_INHERIT) + return (EINVAL); + } + error = vfs_copyopt(opts, "zfs.mount_snapshot", &mount_snapshot, + sizeof (mount_snapshot)); + if (error != ENOENT) { + if (error != 0) + return (error); + if (mount_snapshot != 0 && mount_snapshot != 1) + return (EINVAL); + } + return (0); +} + +static void +zfs_jailparam_destroy(void *data) +{ + + free(data, M_PRISON); +} + +static void +zfs_jailparam_sysinit(void *arg __unused) +{ + struct prison *pr; + osd_method_t methods[PR_MAXMETHOD] = { + [PR_METHOD_CREATE] = zfs_jailparam_create, + [PR_METHOD_GET] = zfs_jailparam_get, + [PR_METHOD_SET] = zfs_jailparam_set, + [PR_METHOD_CHECK] = zfs_jailparam_check, + }; + + zfs_jailparam_slot = osd_jail_register(zfs_jailparam_destroy, methods); + /* Copy the defaults to any existing prisons. */ + sx_slock(&allprison_lock); + TAILQ_FOREACH(pr, &allprison, pr_list) + zfs_jailparam_alloc(pr, NULL); + sx_sunlock(&allprison_lock); +} + +static void +zfs_jailparam_sysuninit(void *arg __unused) +{ + + osd_jail_deregister(zfs_jailparam_slot); +} + +SYSINIT(zfs_jailparam_sysinit, SI_SUB_DRIVERS, SI_ORDER_ANY, + zfs_jailparam_sysinit, NULL); +SYSUNINIT(zfs_jailparam_sysuninit, SI_SUB_DRIVERS, SI_ORDER_ANY, + zfs_jailparam_sysuninit, NULL); From nobody Sun Feb 5 13:40:36 2023 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 4P8rBF0TnVz3nYWG; Sun, 5 Feb 2023 13:40: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 4P8rBD74WTz3vg2; Sun, 5 Feb 2023 13:40:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675604437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4i81rX/q29z9c7C2Lek605Ci7oDqgVIghBDqZ0hJMIQ=; b=keRNNbsWC/wg7lIF7bEm4s0tH5jscPneYHkPN1z2vRXvUd+kP+FdZ93ZrS6wGt+5hGbmzb FnorBACv+0QrKaNNopIV5UsHwTgz6Z80rFo5UFY6FYzCoH36WAMCnk2EAiuf6ROsCOkMUu YdqNEAMOfIgB65qKLXbbI/n1d4lcCaB2IlypFxWr+mPfAYGrAPvFtFM47b6m6HuzAIIEwd NxI3ImVzy2fkAU/g58u29oLcq2qN3XVrXiZO0fY6YlupOcwp1J3IIXyjzGyccwvm5aSTLM mq/Q4IvBfoR3tD7BhjpJehw9ZCga8VrChnz+dvCuTv4ATmq6t0cGjyBraKIIvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675604437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4i81rX/q29z9c7C2Lek605Ci7oDqgVIghBDqZ0hJMIQ=; b=DOvVdEp2U5TPZPm498PYhUYBWDEQY8ARLfwe2kgB+6KxorfwoRHe24MCg4ingWaz9JLn6v 92inLx+mwLD6bKD69/Wz1Hf9IKJOOwTIi/YKuYduWrgDouNd+atl65WoiiEHnzoYoB/4eV pKLLLorTKOJG1HrSVcMiR4OUcgCIZs3iNFymHZLa8Ta4x6II18PwYA/69jM/yOlU5kogmM GQ1ypFmkBlQOjsCDoYb0SQMf/vd/mJ4E398AkcisW3Hv5yyKUM05MIjRmMArrQ5nn38pcN Z+BLQtIGMsIbSQxrYbLjHSAkq16W6E5h04m9Z0f0FgKsflLEw6L4EGirwA0LUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675604437; a=rsa-sha256; cv=none; b=qxOmm4379z+FlL5sAPT/2tn+U7tmMvx+iF7lxQB7q4FsFcm0cBegquhE/tAofrLZoeRcZE 9M7Il+IopC2BcLIfyMwADtDEx321mUUznEpWBzQXvaL8e9kQqbZZs/MPn6lqYhiVWoGe/1 cTcho7nEUTWUlo0xdjwO/nkStd2AQ0cybYo1b/GyYzu7W1H+0SNI41h2n/fapfGQY2U8Hf 1cRdu8YecBn7oeKGvmTT2aO5wd4QaHdrv5evt2ZSU/soJ/PV6GRCcAgBobXfcs7eumCe+q 3jD/J5fqDHTH3rMFLxiIPqkHd25mXmEH1NCkbEH8nkqsK9dnBhnL/QwCkVWdFQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P8rBD68jwzwp7; Sun, 5 Feb 2023 13:40:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 315DeaiF033466; Sun, 5 Feb 2023 13:40:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 315Dea3n033465; Sun, 5 Feb 2023 13:40:36 GMT (envelope-from git) Date: Sun, 5 Feb 2023 13:40:36 GMT Message-Id: <202302051340.315Dea3n033465@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Nuno Teixeira Subject: git: 3732e805b3f7 - stable/13 - sound: add patch for Lenovo Legion 5 Intel 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: eduardo X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3732e805b3f75008caf3bfc2a139d2893812457e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by eduardo (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=3732e805b3f75008caf3bfc2a139d2893812457e commit 3732e805b3f75008caf3bfc2a139d2893812457e Author: Nuno Teixeira AuthorDate: 2022-09-16 13:29:30 +0000 Commit: Nuno Teixeira CommitDate: 2023-02-05 13:39:55 +0000 sound: add patch for Lenovo Legion 5 Intel Laptop Legion Lenovo 5 15MH05 (Intel) Patch to fix the sound on this machine. It requires sending the speaker and the headphone jack to the same nid. PR: 265632 Approved by: emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D36511 (cherry picked from commit b44869cba1b391931b831135a9cefcc6ca635103) --- sys/dev/sound/pci/hda/hdaa_patches.c | 3 ++- sys/dev/sound/pci/hda/hdac.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/sound/pci/hda/hdaa_patches.c b/sys/dev/sound/pci/hda/hdaa_patches.c index c64a824d7d5e..a8e45139494e 100644 --- a/sys/dev/sound/pci/hda/hdaa_patches.c +++ b/sys/dev/sound/pci/hda/hdaa_patches.c @@ -313,7 +313,8 @@ hdac_pin_patch(struct hdaa_widget *w) break; } } else if (id == HDA_CODEC_ALC257 && - (subid == LENOVO_L5AMD_SUBVENDOR)) { + (subid == LENOVO_L5AMD_SUBVENDOR || + subid == LENOVO_L5INTEL_SUBVENDOR)) { switch (nid) { case 20: patch_str = "as=1 seq=0"; diff --git a/sys/dev/sound/pci/hda/hdac.h b/sys/dev/sound/pci/hda/hdac.h index 5261bf9c7543..4a31d26c2b6a 100644 --- a/sys/dev/sound/pci/hda/hdac.h +++ b/sys/dev/sound/pci/hda/hdac.h @@ -376,6 +376,7 @@ #define LENOVO_T431S_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x2208) #define LENOVO_G580_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x3977) #define LENOVO_L5AMD_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x381b) +#define LENOVO_L5INTEL_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x380f) #define LENOVO_3000_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x384e) #define LENOVO_ALL_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0xffff) From nobody Sun Feb 5 21:47:00 2023 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 4P92zS5LW8z3ktq8; Sun, 5 Feb 2023 21:47: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 4P92zS4rVdz3jxf; Sun, 5 Feb 2023 21:47:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675633620; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p85Z6E3e32a8aeC1KLav8Cb+vzxCl4dAN8UWr6SAKRo=; b=oi0GF4NSRTTk2vFF9ReC4hRxI1q3tDK6Fn4+lYeKCb7yI4CLoBfpZAEgkxImBiMjrQFolH 3tHU9juFFk83elHyVDC/5ii2I+2of6aHvxjFYpR2ztHKPexoyraL8mPE2EbjUlDMJZcvsl wp+uqDA8zMH3u88/LmcMcLdHIUj6E3dNmRg9v8UA8tlMI0hCBqYW+x2zn8mHWG5bfVKC/9 t5oJ6VNFLelZZHr9TDrIWZ4E04dM23gXVDq5rTKvyfIKYwkUKpg51dPuLlhCeX6GVEQddm FHMyJ1rCqs9J3EIsdEo59KEh+NFc48JRw+Fl2W9AikBteddpBh9XYGV8V3cKNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675633620; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p85Z6E3e32a8aeC1KLav8Cb+vzxCl4dAN8UWr6SAKRo=; b=Ucq1DJ+sBvzy5QHTU7uPmcqcESW0FTVHtvlFJBN80u6DwpoXb6sB08svX4iyEc0OBg+Jnc /s3fDvx/Mwv7d/+Ycz2pQFbjkDBn/DnXBiIhz0hLsYMzX1+EmO01iK+ahMRblcggk0kIN7 h8vCapQvgWCFo+xdw/lTsW3B635CSaYXeabDsXLXU92XvCsKpfb88EIuJZHM52/r1UWOMP TaXcTTouESnnULS7sAS3mc+CLI9xAPkbx8riUVAh4ToVIO1+IHkKCagjx87aJrjbZyXJty 31mp77WcW9CAc6v14LTpUdZTqqRcoI4byIbs9wW4FYWljFtuFKtij1ISWK9TWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675633620; a=rsa-sha256; cv=none; b=u4vw3sfFobBjO361i6w+tcDcxURvDFUcBMdfoTPx3Qt7HPNGllf5GgrqvVfDknu1BTRYgY 0SxNQu35PZsPvUFudq978m1v+DRDDGiIdcSGXI3B8MIMAldCl8iX5n7HDAOtify6jvOrPv C9Ti5G3FnqbQSDP9n8tZ5BYmBZs5REkZeA3VtzTatsIdTwHzdu+USibC2an8kV5STYnuWh vO0HfI/yJVOusUgUUdIET6pGOAeWTW7LVRjt8bUnKQBnTJsSmlA8ot7MQkRZCZnNu7wZoT 6yF3lAi7EpaJX/hpuqM5iaJUImMnNyCbv2+2iFSjzWhPhwA4YwWqrLs8VcMrNw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P92zS3vcbz198W; Sun, 5 Feb 2023 21:47:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 315Ll0pq048500; Sun, 5 Feb 2023 21:47:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 315Ll0rm048499; Sun, 5 Feb 2023 21:47:00 GMT (envelope-from git) Date: Sun, 5 Feb 2023 21:47:00 GMT Message-Id: <202302052147.315Ll0rm048499@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: a599eea13521 - stable/13 - release: Remove C-like string comparison operator 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: a599eea13521c7d1d26bc42bc944f2ac5f6fddbf Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=a599eea13521c7d1d26bc42bc944f2ac5f6fddbf commit a599eea13521c7d1d26bc42bc944f2ac5f6fddbf Author: Jose Luis Duran AuthorDate: 2021-06-20 00:00:19 +0000 Commit: Colin Percival CommitDate: 2023-02-05 21:45:55 +0000 release: Remove C-like string comparison operator Per [(1), i.e. test(1), the string comparison operator should be `=`, not `==` in sh(1) scripts. No functional change. FreeBSD's test accepts `==` as an alias for `=` for compatibility with gnu test's `==` extension. Reviewed by: imp@, gjb@ Pull Request: https://github.com/freebsd/freebsd-src/pull/485 (cherry picked from commit 3f197b101f71ee4f4949c53bf330f61b43749ce9) --- release/tools/arm.subr | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/release/tools/arm.subr b/release/tools/arm.subr index 9758c898ca24..69f56c7c6520 100644 --- a/release/tools/arm.subr +++ b/release/tools/arm.subr @@ -69,13 +69,13 @@ arm_create_disk() { # Create the target raw file and temporary work directory. chroot ${CHROOTDIR} gpart create -s ${PART_SCHEME} ${mddev} - if [ "${PART_SCHEME}" == "GPT" ]; then + if [ "${PART_SCHEME}" = "GPT" ]; then chroot ${CHROOTDIR} gpart add -t efi -l efi -a 512k -s ${FAT_SIZE} ${mddev} chroot ${CHROOTDIR} newfs_msdos -L efi -F ${FAT_TYPE} /dev/${mddev}p1 chroot ${CHROOTDIR} gpart add -t freebsd-ufs -l rootfs -a 64k ${mddev} chroot ${CHROOTDIR} newfs -U -L rootfs /dev/${mddev}p2 fi - if [ "${PART_SCHEME}" == "MBR" ]; then + if [ "${PART_SCHEME}" = "MBR" ]; then chroot ${CHROOTDIR} gpart add -t '!12' -a 512k -s ${FAT_SIZE} ${mddev} chroot ${CHROOTDIR} gpart set -a active -i 1 ${mddev} chroot ${CHROOTDIR} newfs_msdos -L msdosboot -F ${FAT_TYPE} /dev/${mddev}s1 @@ -173,10 +173,10 @@ arm_setup_minimal_loader() { } arm_install_base() { - if [ "${PART_SCHEME}" == "GPT" ]; then + if [ "${PART_SCHEME}" = "GPT" ]; then chroot ${CHROOTDIR} mount /dev/${mddev}p2 ${DESTDIR} fi - if [ "${PART_SCHEME}" == "MBR" ]; then + if [ "${PART_SCHEME}" = "MBR" ]; then chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${DESTDIR} fi _OSVERSION=$(chroot ${CHROOTDIR} /usr/bin/uname -U) @@ -200,13 +200,13 @@ arm_install_base() { echo '# Custom /etc/fstab for FreeBSD embedded images' \ > ${CHROOTDIR}/${DESTDIR}/etc/fstab - if [ "${PART_SCHEME}" == "GPT" ]; then + if [ "${PART_SCHEME}" = "GPT" ]; then echo "/dev/ufs/rootfs / ufs rw 1 1" \ >> ${CHROOTDIR}/${DESTDIR}/etc/fstab echo "/dev/msdosfs/EFI /boot/efi msdosfs rw,noatime 0 0" \ >> ${CHROOTDIR}/${DESTDIR}/etc/fstab fi - if [ "${PART_SCHEME}" == "MBR" ]; then + if [ "${PART_SCHEME}" = "MBR" ]; then echo "/dev/ufs/rootfs / ufs rw 1 1" \ >> ${CHROOTDIR}/${DESTDIR}/etc/fstab echo "/dev/msdosfs/MSDOSBOOT /boot/msdos msdosfs rw,noatime 0 0" \ @@ -236,11 +236,11 @@ arm_install_boot() { FATMOUNT="${DESTDIR%${KERNEL}}/fat" UFSMOUNT="${DESTDIR%${KERNEL}}/ufs" chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" - if [ "${PART_SCHEME}" == "GPT" ]; then + if [ "${PART_SCHEME}" = "GPT" ]; then dospart="/dev/${mddev}p1" ufspart="/dev/${mddev}p2" fi - if [ "${PART_SCHEME}" == "MBR" ]; then + if [ "${PART_SCHEME}" = "MBR" ]; then dospart="/dev/${mddev}s1" ufspart="/dev/${mddev}s2a" fi @@ -248,7 +248,7 @@ arm_install_boot() { chroot ${CHROOTDIR} mount_msdosfs ${dospart} ${FATMOUNT} chroot ${CHROOTDIR} mount ${ufspart} ${UFSMOUNT} - if [ "${EMBEDDED_TARGET}" == "arm" ]; then + if [ "${EMBEDDED_TARGET}" = "arm" ]; then chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \ ${FATMOUNT}/ubldr.bin fi From nobody Sun Feb 5 21:47:01 2023 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 4P92zT6rlnz3ktnf; Sun, 5 Feb 2023 21:47: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 4P92zT5ZWMz3k3d; Sun, 5 Feb 2023 21:47:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675633621; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cJidN5WtEbiCYsBj0vdiVfFLPpEtrEMwBjgep+B949E=; b=SgxehPD4/43ogOymPzCrOcrIDcvKvCEK07jRStTSwZWmYd2zA4BEGnPHFVE4ni0sq/GPNL 0PrPJpBiVogV8t+8lfLT/fByNlmx6ukfP3BCW9DLlTdT1XXcoLNyyQXLsUfM/qAXrlWjaE gvxC+YQw9fOAq6ml10xLV+Ksjb8BZW4Md4gbNvPDngfaBAgt3XxCyb7DsScC+86HJFlDfv vvk1AXdrivLPiKrXeeOjaPEpKHJiy/HAvNEmfxqPkyzX+NYGma/ywZTIITaQIwTpYsjngf ADWohh+8dEx+gTeSahGS6tEWb/6U3u/2TysmKy4n5Mt9wns+6OWcuAfFfx+d/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675633621; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cJidN5WtEbiCYsBj0vdiVfFLPpEtrEMwBjgep+B949E=; b=mh61OeLh2H+0jl9o9IF8T7LEL0qSQMEs524QRwIYxeQ1qWLoDDBf+pFrSFVqV75GGoL2tV MR6eXQn6zh5b+RtPoX/4Y/O0Rp2XRjv5/ZMLbCIC1yqWEtg+1iYFzeLpGWItYXW3su1F0i rm44u4+vV6BiDb3UE354GjPUVUcC6eLqJ2sH9suoI7TXpiVda6bn/g/cZG0yeTG++9NMpu rRMSOwwDQrAz7+HzuexuR478Ix8X64nmJso830XHGWq9gN8o1cHLpse6QmMwCz+AgUSUSb 6dP52z2UyZ9C7zrCzOPzfdtqE8luI+fWhldnZaZH69cljj1ejW/Rdh1C8ZUBNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675633621; a=rsa-sha256; cv=none; b=L1tMBZuyvxtIbdMK/wak6dwjmKucSPIe/TwMpf7nlMZuvjKatLFfVR8vc63G7BOUA7Upd5 1m4kxfCq0e44IGmwQII+QTXyBourtB7rrxPFlCT+tJQhWKZW04Z7woHEJeowrOKzqEhN8g 7Az8Gw9c2TB6/wXJ5+nknt6aS7kwW3Pv4UGMPSUwprOmW5cGTeLyEedOebWlv4uqGLwThA bt+zI9wXilpjrbhqIewiPocm9Tg1ul6Ocm1m2CCLNCvubTMsvd7PKb3NVmmo7syVxVFYJm kUxnyYnfAyiUPCAM8tb2HEvapuRHgcPn6YVEnsxIjccm2O20pNwJYtdSenkSpw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P92zT4XZGz19N6; Sun, 5 Feb 2023 21:47:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 315Ll1wH048530; Sun, 5 Feb 2023 21:47:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 315Ll1ZX048529; Sun, 5 Feb 2023 21:47:01 GMT (envelope-from git) Date: Sun, 5 Feb 2023 21:47:01 GMT Message-Id: <202302052147.315Ll1ZX048529@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: 15d0c8a17270 - stable/13 - release: Don't install ubldr.bin 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: 15d0c8a1727036fcb319e3e230e80eb9825e2596 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=15d0c8a1727036fcb319e3e230e80eb9825e2596 commit 15d0c8a1727036fcb319e3e230e80eb9825e2596 Author: Warner Losh AuthorDate: 2022-02-07 20:16:15 +0000 Commit: Colin Percival CommitDate: 2023-02-05 21:46:07 +0000 release: Don't install ubldr.bin ubldr.bin was obsoleted by our uboot ports last year, so this is completely unused in the default config (some customers still use it, but that's not relevant to this script). Don't copy it at all since it won't be used for re@ produced images. Sponsored by: Netflix Reviewed by: kevans, gjb (re@) Differential Revision: https://reviews.freebsd.org/D34192 (cherry picked from commit 4e46c6fb35b3d5803f10c5edb5dabaf3cc308517) --- release/tools/arm.subr | 5 ----- 1 file changed, 5 deletions(-) diff --git a/release/tools/arm.subr b/release/tools/arm.subr index 69f56c7c6520..d07dbb41b48b 100644 --- a/release/tools/arm.subr +++ b/release/tools/arm.subr @@ -248,11 +248,6 @@ arm_install_boot() { chroot ${CHROOTDIR} mount_msdosfs ${dospart} ${FATMOUNT} chroot ${CHROOTDIR} mount ${ufspart} ${UFSMOUNT} - if [ "${EMBEDDED_TARGET}" = "arm" ]; then - chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \ - ${FATMOUNT}/ubldr.bin - fi - BOOTFILES="$(chroot ${CHROOTDIR} \ env TARGET=${EMBEDDED_TARGET} TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ WITH_UNIFIED_OBJDIR=yes \ From nobody Mon Feb 6 14:20:46 2023 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 4P9T262wkdz3kpK8; Mon, 6 Feb 2023 14:20: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 4P9T262Twvz44GK; Mon, 6 Feb 2023 14:20:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675693246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E+XA6BvVF4U435KQaYeEafNokcb4C0Xsx4azdolx1W8=; b=NjEk6WRxjITdvlNVFYunHZ/cl3Y8ST9qq4+nmNe5yMefM5dyPlUq/5m1e4D6BhxcdbwA4f 2AY679eCrxdfxzczrvgSzilcFMSml/RxVHBuevQuMI0Z4oPCgoF3xUY64hNRW2bqnpXOE0 OPae4NrOEvKdcd3GeOnvD4udycCOOWoyrmCIgsm+zj3laOY6cscu06TFhJFjM388kFLaEr qahXswJ80+BUWsyVduuy4/KRNRKIkmuYI9uBO8iQ62/ix1Eb4fEZ4f92AmKFNkBFdDtvbG TekNjT2rOaFSabtKHtL4yg8n0FHAkCsz6f9iAEcqOqy6nyUPEiLsmHeSpY8nvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675693246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E+XA6BvVF4U435KQaYeEafNokcb4C0Xsx4azdolx1W8=; b=NZ8VAadpZrFE3lIx6MIugsDpIt8UAtwUuUjDpRp1k2WS0h0Cz3W9B46uBAQJ1Txzqq6luM 45IpXRY2ypiVKdJQj2BmVfLX8tUiRkviFoqglSF/Y29eu6zIWdsUSI+FjsM8qCRMDbt666 uznyKwk9Sr5UvewhQwBN9SQNvRuB1g+TdOHIG5uu3QAJTKbFVL6s182w+Op5q8qDedVtSs Aqdv9GK9xaVneFfkfrzdjzf9bphfkLBg9/uA39XLBfDRidUAOsoiL988MirfiOpngZd/Xb SkIqpnG5E7XnO6J9Hy/KznGudxxIAnPGhNHJY63d3nQw1NQyQ3VND63VYl5T5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675693246; a=rsa-sha256; cv=none; b=v8A1uJHp0055dxyBr6sttaxyc5ZwCq9cLisAhMo4eR+aK7/2jIdCJ0lzB45KPpyBnV3Hdz 6X9fCEgRs96i19vStf3ZUBMGwOOFcyaCLwVQ4L3MPWcMvsHdAlMwqYhkpfaVsla1Mwh77s JDXJoO2FqZhmqfs3jox9T47jmZ6oK68Jpz6GbVnKFszeIEyW+fwH4JmPgrLetLkSW23EjH 0dq00v5utDwUnbBD1ipaUy/SBUJvf8JLMfSeoecxYU6FeipdhyCXUfX+FYvcrOXfbZVUFh DJW8QkTt0MjoEWPKMIDbrPtbcdV69gQdWJGtpU1kQpeihNK2cHtCgn2mymWVoA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P9T261Yf7zd80; Mon, 6 Feb 2023 14:20:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 316EKk2n067501; Mon, 6 Feb 2023 14:20:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 316EKkn7067499; Mon, 6 Feb 2023 14:20:46 GMT (envelope-from git) Date: Mon, 6 Feb 2023 14:20:46 GMT Message-Id: <202302061420.316EKkn7067499@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: 17b95975d1de - stable/13 - bridge: Fix whitespace List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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: 17b95975d1de1f147f27107bf33d118a0c919b00 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=17b95975d1de1f147f27107bf33d118a0c919b00 commit 17b95975d1de1f147f27107bf33d118a0c919b00 Author: Mark Johnston AuthorDate: 2023-01-24 16:00:56 +0000 Commit: Mark Johnston CommitDate: 2023-02-06 14:20:24 +0000 bridge: Fix whitespace No functional change intended. MFC after: 1 week (cherry picked from commit 92b7d1db9291f11fa56e2c88f70149f319e31622) --- sys/net/if_bridgevar.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/net/if_bridgevar.h b/sys/net/if_bridgevar.h index c12ee4598548..6a32355d4d67 100644 --- a/sys/net/if_bridgevar.h +++ b/sys/net/if_bridgevar.h @@ -301,18 +301,18 @@ struct ifbpstpconf { #ifdef _KERNEL -#define BRIDGE_INPUT(_ifp, _m) do { \ - KASSERT((_ifp)->if_bridge_input != NULL, \ +#define BRIDGE_INPUT(_ifp, _m) do { \ + KASSERT((_ifp)->if_bridge_input != NULL, \ ("%s: if_bridge not loaded!", __func__)); \ - _m = (*(_ifp)->if_bridge_input)(_ifp, _m); \ + _m = (*(_ifp)->if_bridge_input)(_ifp, _m); \ if (_m != NULL) \ _ifp = _m->m_pkthdr.rcvif; \ } while (0) -#define BRIDGE_OUTPUT(_ifp, _m, _err) do { \ - KASSERT((_ifp)->if_bridge_output != NULL, \ - ("%s: if_bridge not loaded!", __func__)); \ - _err = (*(_ifp)->if_bridge_output)(_ifp, _m, NULL, NULL); \ +#define BRIDGE_OUTPUT(_ifp, _m, _err) do { \ + KASSERT((_ifp)->if_bridge_output != NULL, \ + ("%s: if_bridge not loaded!", __func__)); \ + _err = (*(_ifp)->if_bridge_output)(_ifp, _m, NULL, NULL); \ } while (0) extern void (*bridge_dn_p)(struct mbuf *, struct ifnet *); From nobody Mon Feb 6 14:20:47 2023 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 4P9T2742Cdz3kp2Y; Mon, 6 Feb 2023 14:20:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P9T273bYhz445j; Mon, 6 Feb 2023 14:20:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675693247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Z2zMAKD0cHdkC6tZ1qP9Wwfnj+J4TfHZ8GdPjpzhMo=; b=x0LALPevKOVSwjP90l35l5YizpgQu4gOGvv5iatL/YlYEp2cTXjTDv7dQzOglqpPe9YJFI IyKmDQqEn2GdWxDcveqNgFuDyjkK7uXetmCTTptbGUXnSMfx2E9nJ89l5doftOAQA332FZ 6AYEJJ4KHeD4AXvgnxZ6YwZb+Ytu+67e93wZ3oY5sDoNFYGYuyVBeajIkahh1TP/6MHGUm ql6mb8FfwQ55zIC7z3crdrAU/CbTc+jALT0YkV7BzSAGkhS420tH/sY+0m5fJvDvsX10qe m46UwiM2/4ZxRjd7j/j3UXecGmoMeQOlngGLoKMvTikrWFhcOC4K4QebMVKzAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675693247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Z2zMAKD0cHdkC6tZ1qP9Wwfnj+J4TfHZ8GdPjpzhMo=; b=MKpcj37YlP73t4uIPaXCnHlbY5yVH1Le+5aV04Wmvsp5F44VarGt0ZrIFsI/wk0PURdBqh OCIAOiyhmA+geXwwRUXhWyxC/Ywizyu2eslaJgZlF9HNblpbK9snswOiPzLvxyZ1Gh2RFT 6JJT8x+RMQJHN9frBTQSOiRohd45AVa8ArdzyDjJL5CjEKr2AAyY2ctsVQrwSLwoZZEcLz X/AlkP1B/dlYeZuaVB6JZhC96n6OMRYc1rngVC9swSXJLt8deWdMQ2sijonI8n+L+YVOCm rGO9Ng14P8Cw3OqOclTzqd+XBuHa8PKhIA2h5fhDgpKuirJQN5jyL0KsDItaCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675693247; a=rsa-sha256; cv=none; b=kxlnDlb/vlpovBhXmnqjc/Ys6VbYbbwxWlurYA7Cp6aB0Rdz8d0ZwHFcaTHPR56+zphHfr jTqroCeASPYJwXAGcI9qj2I49CzKV9YbKUpIsTfTAg/KG+tMy4SUI5xaFKS2wuoR8wDnEe bmsa0IieQOG3kEHSn2asH1PSo0huf0sLOo0Sa92zphxygTOwB1r7NGLBRh+4HN3LguqsWv FYU9ayc6YZMf/4E4Csu4WmGp5qz89ALJtz1c6ZO+7TAnEWhaC+UZxmcHdqxgXm+WliPlgS GIGG+K1rVWAI2TaU2pStRI7NFIXe1ZN2qOUVC0gQ7PyN5NW3uihLFRFFiuixXw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P9T272Z1zzd81; Mon, 6 Feb 2023 14:20:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 316EKl2D067528; Mon, 6 Feb 2023 14:20:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 316EKleg067527; Mon, 6 Feb 2023 14:20:47 GMT (envelope-from git) Date: Mon, 6 Feb 2023 14:20:47 GMT Message-Id: <202302061420.316EKleg067527@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: 92f9219d07ce - stable/13 - man(1): Support zstd compressed manpages using zstdcat 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: 92f9219d07ce8bebe5066f27a5e0184548fbf511 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=92f9219d07ce8bebe5066f27a5e0184548fbf511 commit 92f9219d07ce8bebe5066f27a5e0184548fbf511 Author: Cameron Katri AuthorDate: 2023-01-30 18:11:14 +0000 Commit: Mark Johnston CommitDate: 2023-02-06 14:20:35 +0000 man(1): Support zstd compressed manpages using zstdcat Reviewed by: emaste, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D32296 (cherry picked from commit c8abb673a57587fdf9de2d5bd4d3d1f54dfedc19) --- usr.bin/man/man.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.bin/man/man.sh b/usr.bin/man/man.sh index 084f4a06829b..cf90b64f7991 100755 --- a/usr.bin/man/man.sh +++ b/usr.bin/man/man.sh @@ -897,6 +897,7 @@ setup_cattool() { *.gz) cattool='/usr/bin/zcat' ;; *.lzma) cattool='/usr/bin/lzcat' ;; *.xz) cattool='/usr/bin/xzcat' ;; + *.zst) cattool='/usr/bin/zstdcat' ;; *) cattool='/usr/bin/zcat -f' ;; esac } From nobody Mon Feb 6 18:32:02 2023 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 4P9Zc23Y78z3n2f5; Mon, 6 Feb 2023 18:32: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 4P9Zc23385z3LFK; Mon, 6 Feb 2023 18:32:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675708322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BgJT/yiWP/2dlxoTfccE9EKGtFpIQD/wn0V+2vDSjJE=; b=aS0aZoQIhJXnjbgHdBcSSBacTrDtRxtBEOtrf+AmOZJcaF8BG68+pBdcP3zLz8czdYO5Qy sfjBh51u0titlopxIhEhp7EMTLFHn7NsQyHNmVFbO0LqaUoHvRoRHjAOIcPV4LYcZRvXhG ghy4XD21hJLOnxnKdsujvh/3gaNmkFs0QBKIWtzdTz1t3EUf18qZ1m+3iZ3sWwHGgkZMSz j15GJQIvGCLWDFfdCR9WnuCnqK5Tthu9YdLLTLOJ8md0+icFGupjaCDZZE171EqaI6dCOh MK0TLk7j4ll1WpflYoS0Tn0Iy0neMJYzcWGtvDJ3T4kLcWquprDI6gcL6oFHzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675708322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BgJT/yiWP/2dlxoTfccE9EKGtFpIQD/wn0V+2vDSjJE=; b=AodyQ+ALFdTjjYRZorCw3BIkUy3d8Xh8+DYHNktinq8A0eMwLFuzv31k4XC7Eac0MKv/cP Xy1Q76/SpdJVjLtpBxHHErupWt8DE/PcA5FmiZXdoOxjT/1l6PHeRGaka5P+NCCBmOMvkN aqq3rBSUtODdNlaPzBticOCUJl9+/D813lEOUt5wJZ0Ko2yC7v/sYnnLGQ+ETlft8uLsHa zVK4myDDnWKojvAYm4IRxRwGndTNZz2cqm9NtIOQr41oemuOcgfFKiIHQjXbPl62uATlSz BrPGI63aNqNdTW+ExVjex5JG1Xjip0C11jX6JPjep2hu9/IrAZ350VqPq3IdYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675708322; a=rsa-sha256; cv=none; b=tugeh+GUTCxQrThtop5yegGs14DTa29VnThG4bSy+36LRFqr9PKPPiRPKjwZ2NfBmj3nte 849UrthPwkYNDD6mTNQiyxk238m75+ilJrJBoaxkbdA+1QUwiI58ei2WqTZnT44KP22DTD ZUm9XkGQap1wAkoBSFvtZbWIUB+4JfhMXEbFC8/PDKrkTs0DL8EbSAwCtg2vyaOTf7pAVN uuaXBpU4/NgD5aXWlbi27QLFsigeXmRTDwTsOVTTHFCIKEx5DY2AtUwjAmepYKrkGi4GEG Ysy+E1Rvp3qQ1HtzRehZTohWTCTiFFO24iuPhJSeVcMcMvutwF7zYXH61juqug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P9Zc228JPzlWl; Mon, 6 Feb 2023 18:32:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 316IW2vN032582; Mon, 6 Feb 2023 18:32:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 316IW2xj032581; Mon, 6 Feb 2023 18:32:02 GMT (envelope-from git) Date: Mon, 6 Feb 2023 18:32:02 GMT Message-Id: <202302061832.316IW2xj032581@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Sergey A. Osokin" Subject: git: dbe8292614ba - stable/13 - bsd-family-tree: add DragonFly 6.4.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: osa X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: dbe8292614ba8085e2acaa2819178088fcd77d23 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by osa (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=dbe8292614ba8085e2acaa2819178088fcd77d23 commit dbe8292614ba8085e2acaa2819178088fcd77d23 Author: Sergey A. Osokin AuthorDate: 2023-01-05 21:36:57 +0000 Commit: Sergey A. Osokin CommitDate: 2023-02-06 18:31:42 +0000 bsd-family-tree: add DragonFly 6.4.0 MFC after: 3 days (cherry picked from commit c47015fafa4836d881977607c4de86f444ae8f14) --- share/misc/bsd-family-tree | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/misc/bsd-family-tree b/share/misc/bsd-family-tree index 2d78f52ab066..c764ffc222f8 100644 --- a/share/misc/bsd-family-tree +++ b/share/misc/bsd-family-tree @@ -442,6 +442,7 @@ FreeBSD 5.2 | | | | | | 13 | | | | FreeBSD | | | | | 12.4 | | | | + | | | | DragonFly 6.4.0 | | | | | FreeBSD 14 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | @@ -865,6 +866,7 @@ NetBSD 9.3 2022-08-04 [NBD] OpenBSD 7.2 2022-10-20 [OBD] macOS 13 2022-10-24 [APL] FreeBSD 12.4 2022-12-05 [FBD] +DragonFly 6.4 2022-12-30 [DFB] Bibliography ------------------------ From nobody Mon Feb 6 19:07:39 2023 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 4P9bP72brnz3n4Kt; Mon, 6 Feb 2023 19:07:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P9bP7255bz3PKy; Mon, 6 Feb 2023 19:07:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675710459; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GdVu49rYOgKGVAUXxiGS46B52SUmBmdwh953/V5oNz8=; b=ul5VORRqf5AnfCd6x+Pn7ocFzlKMKW38rcnl+dpsu9IAveSP2qX9DkK67YZbYa4tkX015J hScbumNn2Dil3UVuRiF7Om8ydYmi8Putkga14BqWCBj/Dkbic2ChWKhmy5GTGEo6hT22K3 Hkt/LATE+q6sJQd/VHvjumimPtuB52UDNrFfkt38OF11uoDwTcoL1EuVxxqCGINO1Co20D hejt6nE1zyB4iO55fc/WbdSR61vcQMoHbvdWA4LsqCd3AXpLgYSmRL7Ah11Ta9h8nQeEG8 4kN2ONFGr76iU0UlJY9jy6Wta7CoDS8u3+gMkgkJ58MsNxOXxnl3370aum+O7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675710459; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GdVu49rYOgKGVAUXxiGS46B52SUmBmdwh953/V5oNz8=; b=vK0ppTSFlki01fyCsxxm9zKcfxCMKO4HXTdugNO9630bMktYOSrzYUJ8ismilk6U3d91fh KAEYNuXDVYGSol881I0h4TztJiwXlJjbZKGpDoL2jxNZLOB9DMGXhM+s0Wb1ShTnzQ8QxC 3Ska5dCBcDR4JfYUskz/EuAwwmxNF2M0aKwWqE36LnouBKk0+Hogs/Ln7Uk4p/y4NQCbF5 zao9BYQjNb1A0P0VaHbiLVPd8VgU2Q77ItRiqvXHtSE7iLfb+4+nR6FCipNmQJLAoKf2fb xvqf+upFDj8D5T/c1GFDe6H35MOosdB7AmGhPNy14O/cnvF1CARIj4FV7lhvVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675710459; a=rsa-sha256; cv=none; b=ivJaLDyYbzCH38OC56J5Sujx+texZY/qLsNGixJ8reQC9ap9HkA2oporTHPyfxh856A5H0 F26Fbw678Ox2xCldbZTbwJWvozph5LELD/Flc5DhR63Sx0SBGET1/EKdPAAn3CZu3eZEvv 9aK/mLjNMC7U1GBXdXvYW/f8AEDuTbsg2z/h47RAfeYZzbaxrv2RAJtEn0Pj6Zq4XaWFv1 YfnIOFEQaT5TbFS0yZqhBTxa4M6Er4mR73XouwEO4ouYJN0XwNfgkUeGcNWL/F0cxNqhlm ei9PQQZob7a2oigDmUkejet0BUCHvVLnXZzO4pDu/XHL+hIpLzZ2qKEVUNm9uA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P9bP70pVQzm2r; Mon, 6 Feb 2023 19:07:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 316J7dns076753; Mon, 6 Feb 2023 19:07:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 316J7dmY076752; Mon, 6 Feb 2023 19:07:39 GMT (envelope-from git) Date: Mon, 6 Feb 2023 19:07:39 GMT Message-Id: <202302061907.316J7dmY076752@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 3e60d3d3c4b3 - stable/13 - linux(4): Rework statfs conversion routine. 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3e60d3d3c4b3e9690c0f1a77fa163e3d07c9b245 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=3e60d3d3c4b3e9690c0f1a77fa163e3d07c9b245 commit 3e60d3d3c4b3e9690c0f1a77fa163e3d07c9b245 Author: Dmitry Chagin AuthorDate: 2023-01-28 10:19:41 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-06 19:06:29 +0000 linux(4): Rework statfs conversion routine. Rework the routines to convert a native statfs structure (with fixed-size 64-bit counters) to a Linux statfs structure (with long-sized counters) for 32-bit apps. Instead of following Linux and return an EOVERFLOW error from statfs() family of syscalls when actual fs stat value(s) are large enough to not fit into 32 bits, apply scale logics used by FreeBSD to convert a 5.x statfs structure to a 4.x statfs structure. For more details see cc479dda. Tested by: glebius MFC after: 1 week (cherry picked from commit 953688e823a67c3e9c0096252c33b1e7ecf9a095) --- sys/compat/linux/linux_stats.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c index fb2dd2fe01ef..63a5c37e1acf 100644 --- a/sys/compat/linux/linux_stats.c +++ b/sys/compat/linux/linux_stats.c @@ -413,26 +413,22 @@ bsd_to_linux_ftype(const char *fstypename) static int bsd_to_linux_statfs(struct statfs *bsd_statfs, struct l_statfs *linux_statfs) { -#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) - uint64_t tmp; - -#define LINUX_HIBITS 0xffffffff00000000ULL - tmp = bsd_statfs->f_blocks | bsd_statfs->f_bfree | bsd_statfs->f_files | - bsd_statfs->f_bsize; - if ((bsd_statfs->f_bavail != -1 && (bsd_statfs->f_bavail & LINUX_HIBITS)) || - (bsd_statfs->f_ffree != -1 && (bsd_statfs->f_ffree & LINUX_HIBITS)) || - (tmp & LINUX_HIBITS)) - return (EOVERFLOW); -#undef LINUX_HIBITS +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) + statfs_scale_blocks(bsd_statfs, INT32_MAX); #endif linux_statfs->f_type = bsd_to_linux_ftype(bsd_statfs->f_fstypename); linux_statfs->f_bsize = bsd_statfs->f_bsize; linux_statfs->f_blocks = bsd_statfs->f_blocks; linux_statfs->f_bfree = bsd_statfs->f_bfree; linux_statfs->f_bavail = bsd_statfs->f_bavail; +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) + linux_statfs->f_ffree = MIN(bsd_statfs->f_ffree, INT32_MAX); + linux_statfs->f_files = MIN(bsd_statfs->f_files, INT32_MAX); +#else linux_statfs->f_ffree = bsd_statfs->f_ffree; linux_statfs->f_files = bsd_statfs->f_files; +#endif linux_statfs->f_fsid.val[0] = bsd_statfs->f_fsid.val[0]; linux_statfs->f_fsid.val[1] = bsd_statfs->f_fsid.val[1]; linux_statfs->f_namelen = MAXNAMLEN; From nobody Mon Feb 6 19:07:40 2023 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 4P9bP82lPcz3n43f; Mon, 6 Feb 2023 19:07: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 4P9bP82Krjz3Pbd; Mon, 6 Feb 2023 19:07:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675710460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+OuUuvYwOpk2NQaLAh17qxSTWnkfi5X1bswRWGD17/o=; b=QAR9kPihs8A3FqwgzojHFY1mlM3HnZ/Gmd92oeywMuym87zTs0IYqm5+W9YTvmJ8Emt/hf JXLTt7B1YGTEFqqEYnT3wPnOXewg0tCPUBFIcQMRjPCBo1ezA3lF5hcGmFiO9bVsftisEQ yo8lGIOz8/2Rpu0GZ6odY9TeD7COJRgUtGZaHcBFEfo8bsIMOIPILnDHW+Ta+/cdSCnEML mx9Kmbdvx71Ad0BFfnupo3mPjk+oFplz3OKH723dfSI37I8pKmNj7fxY+bSzvfsAe+1aLO M6e3iRzU8DKLImJr7DJTfwuF/efJ71zom5s4yEhm14Be7LsN65vuh8ZfeTu3uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675710460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+OuUuvYwOpk2NQaLAh17qxSTWnkfi5X1bswRWGD17/o=; b=jBMavFDUdOoveH8E/l25q+qqlMJVWRXrV3/ld5gIWGO/Xhele7xlrJXY2ETAP/0UyggkVw Rxoz2c0SLEnoCSr1oswgogmjwKVi5mIkdlpXhehso8ycYRIH6rOa0E8qqXITqTo39z0LyM FmAKmXU8tMlJ9mMmgxtfO27IJgSI1he2kQO2K/nwcW8EYemQTzArG6GP3yFAUzX5UqXsSe E5ZlJtaq3Piz/ynMa5R7M15qkR7YOQjrjFakHUsW6uMDoHYR37jElwwatATZ2SGjx9/LMS Ov0ZiQWQx2VqmJ1dLXKC8+5GJtzESFBUhjluOCrq8N6xs/apq2jByYY1puUijw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675710460; a=rsa-sha256; cv=none; b=kCDg1irSgizF+s67m8RLLiCB7iU6v+m6AlI844e7AMIi7Qk8CatVlxx6FeVshR0zJuyetH vmyL/nGC+quQKrRvXKkewYUd2cPB6ucBJUyZXJedcqbe/LuuyOIjLwOn3BbhaScopKLpRu aJs4pvCHlxodfq5LOBY71ficAN694y5TY2xYcUOs8WUROWdA0blz55SU/dO2d6gTOlnOWX 0DKrJssSjd0gIo2yqMN48qQVbxHQCydSJ3S4L06vVybE934K2tQkqvw5JZGq1/Yv6BRKLD nxKluutzy84xcxUPWksTEmk3KC/89TjFzQQl/SkeRBsqp+LNV1v3voOP0Aufyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P9bP81NPmzmJL; Mon, 6 Feb 2023 19:07:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 316J7eH3076783; Mon, 6 Feb 2023 19:07:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 316J7eFj076782; Mon, 6 Feb 2023 19:07:40 GMT (envelope-from git) Date: Mon, 6 Feb 2023 19:07:40 GMT Message-Id: <202302061907.316J7eFj076782@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: ef4f2cca6085 - stable/13 - linux(4): Convert mount exported flags for statfs system calls. 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ef4f2cca6085e79f4610897dbc62c489f1976a9c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=ef4f2cca6085e79f4610897dbc62c489f1976a9c commit ef4f2cca6085e79f4610897dbc62c489f1976a9c Author: Dmitry Chagin AuthorDate: 2023-01-28 10:20:27 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-06 19:06:29 +0000 linux(4): Convert mount exported flags for statfs system calls. MFC after: 1 week (cherry picked from commit 9922bccbc9c4effb02b99391088d0405f9c0f75e) --- sys/compat/linux/linux.h | 15 +++++++++++++++ sys/compat/linux/linux_stats.c | 25 +++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/sys/compat/linux/linux.h b/sys/compat/linux/linux.h index 6400de4cb228..40e563014fde 100644 --- a/sys/compat/linux/linux.h +++ b/sys/compat/linux/linux.h @@ -264,6 +264,21 @@ struct l_statx { uint64_t __spare2[13]; }; +/* + * statfs f_flags + */ +#define LINUX_ST_RDONLY 0x0001 +#define LINUX_ST_NOSUID 0x0002 +#define LINUX_ST_NODEV 0x0004 /* No native analogue */ +#define LINUX_ST_NOEXEC 0x0008 +#define LINUX_ST_SYNCHRONOUS 0x0010 +#define LINUX_ST_VALID 0x0020 +#define LINUX_ST_MANDLOCK 0x0040 /* No native analogue */ +#define LINUX_ST_NOATIME 0x0400 +#define LINUX_ST_NODIRATIME 0x0800 /* No native analogue */ +#define LINUX_ST_RELATIME 0x1000 /* No native analogue */ +#define LINUX_ST_NOSYMFOLLOW 0x2000 + #define lower_32_bits(n) ((uint32_t)((n) & 0xffffffff)) #ifdef KTRACE diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c index 63a5c37e1acf..a1cc2bb7bf8b 100644 --- a/sys/compat/linux/linux_stats.c +++ b/sys/compat/linux/linux_stats.c @@ -410,6 +410,27 @@ bsd_to_linux_ftype(const char *fstypename) return (0L); } +static int +bsd_to_linux_mnt_flags(int f_flags) +{ + int flags = LINUX_ST_VALID; + + if (f_flags & MNT_RDONLY) + flags |= LINUX_ST_RDONLY; + if (f_flags & MNT_NOEXEC) + flags |= LINUX_ST_NOEXEC; + if (f_flags & MNT_NOSUID) + flags |= LINUX_ST_NOSUID; + if (f_flags & MNT_NOATIME) + flags |= LINUX_ST_NOATIME; + if (f_flags & MNT_NOSYMFOLLOW) + flags |= LINUX_ST_NOSYMFOLLOW; + if (f_flags & MNT_SYNCHRONOUS) + flags |= LINUX_ST_SYNCHRONOUS; + + return (flags); +} + static int bsd_to_linux_statfs(struct statfs *bsd_statfs, struct l_statfs *linux_statfs) { @@ -433,7 +454,7 @@ bsd_to_linux_statfs(struct statfs *bsd_statfs, struct l_statfs *linux_statfs) linux_statfs->f_fsid.val[1] = bsd_statfs->f_fsid.val[1]; linux_statfs->f_namelen = MAXNAMLEN; linux_statfs->f_frsize = bsd_statfs->f_bsize; - linux_statfs->f_flags = 0; + linux_statfs->f_flags = bsd_to_linux_mnt_flags(bsd_statfs->f_flags); memset(linux_statfs->f_spare, 0, sizeof(linux_statfs->f_spare)); return (0); @@ -480,7 +501,7 @@ bsd_to_linux_statfs64(struct statfs *bsd_statfs, struct l_statfs64 *linux_statfs linux_statfs->f_fsid.val[1] = bsd_statfs->f_fsid.val[1]; linux_statfs->f_namelen = MAXNAMLEN; linux_statfs->f_frsize = bsd_statfs->f_bsize; - linux_statfs->f_flags = 0; + linux_statfs->f_flags = bsd_to_linux_mnt_flags(bsd_statfs->f_flags); memset(linux_statfs->f_spare, 0, sizeof(linux_statfs->f_spare)); } From nobody Mon Feb 6 19:07:41 2023 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 4P9bP95S6zz3n4F3; Mon, 6 Feb 2023 19:07: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 4P9bP93FMnz3PZC; Mon, 6 Feb 2023 19:07:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675710461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c8nxDJf1Cmcv8kqTxoOlfr12K8N9T5Mj3vKCMJlFtF0=; b=FQIDf5mqOw8t/MjjGLtWo1Ai1dw2lJST2KiuRhIB7QU4V9o8Q1I/OwWQdcGKv873ktsFLT EW8DGIbNSkSU1NXolQdNuFGQhdkfBn4XiKqvNHsHfFWyvDZ99kcH6scK1YTVpF9tmffK7m CkC6Utv+u9AkIEl4gS/n7vfAbHJmWd3LXqbVn20aTn4RCB/VQCZMBfFLAiOfbRoL0vDhMJ VP7NOxzaZ+nd6k1Af9VI1Gto2k9rZV28ugvH4MOxRGd4REImDtw+S0w53ciFmriSdWdjnG nBHTz9HHHjw8oPiAponMiyIxuHrHMT+r27JjZhAtmUG9Y29CBU+Vi2BqAJ7Z9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675710461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c8nxDJf1Cmcv8kqTxoOlfr12K8N9T5Mj3vKCMJlFtF0=; b=IJTUD4A1kERE2R22TpBi7S1hN/noIrrMPmp90T+iZVof9iZahjFjedj4F9qGoENnifQJas nxFdXHxsGL9+spERntIzz+ZfB9vYApQOtEAo8cPoBqeFNDL2jLhQdY/aKnFDB+dUqkTKTe +kqFqUirShTpRJ+yt93EOrx7pWcMbuTjxWrCPNDYX7QAzPP5zgpZFPUTVxsB2zeiMFBmdr tM0gWd4HVX5mPocvtYWauVHHQvbnf297hO427l/ZfHSG2tt4AgKPYp0YIchP3r8srKDJ2/ yGiiXbR4Xd9VQ2Iwb5toAv8d+/epd53Icq3heH7V3pKnneLkPA23EQy+u5dH7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675710461; a=rsa-sha256; cv=none; b=lAOGveKKAf/5kfMucaeKVKTJ5OcqSoTgUw7ii6AM5H/M2yMIe8QxI4hHo+tilwKgClK/cC IXzs33SMOy8Iv+s6y5NkC6a5X6aPVBIL3kHkwKZnigTpERcoPmBGHaj+8a59TPemZoW2TB 8xi+q705No0tbA3atG9oJZeFDKqALsAUzdjxsB5m/ZBPDHkKLNb0LeGbbdZihdfPFWdRYI 02mVfd3RygJx805pct86+KxQMuOhjIfiz9NFxHGAUAqBrb4OWa5gvmcxX4wCjuWX5+XMsP a6wcyMxeepekloY2T3ZMeU/kDaAs408Zg2XnDGTdrwT1JtTqjJ9fSnBPi3x94w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P9bP92M3xzmJM; Mon, 6 Feb 2023 19:07:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 316J7fcF076809; Mon, 6 Feb 2023 19:07:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 316J7fe9076808; Mon, 6 Feb 2023 19:07:41 GMT (envelope-from git) Date: Mon, 6 Feb 2023 19:07:41 GMT Message-Id: <202302061907.316J7fe9076808@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: fcab90d8e540 - stable/13 - linux_common: Fixup .PATH. 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fcab90d8e540557355b38216965df7dec2c74dd9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=fcab90d8e540557355b38216965df7dec2c74dd9 commit fcab90d8e540557355b38216965df7dec2c74dd9 Author: Dmitry Chagin AuthorDate: 2023-01-28 17:31:38 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-06 19:06:29 +0000 linux_common: Fixup .PATH. Since we have arm64, and awaiting ppc64 Linuxulator, do not include x86 specific path to the module build for non x86 architectures. MFC after: 1 week (cherry picked from commit c19fc5cd9b49115604ce2b89279e3434c7f120cc) --- sys/modules/linux_common/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/modules/linux_common/Makefile b/sys/modules/linux_common/Makefile index 6e67e7ab2578..204cfe5059e5 100644 --- a/sys/modules/linux_common/Makefile +++ b/sys/modules/linux_common/Makefile @@ -1,6 +1,9 @@ # $FreeBSD$ -.PATH: ${SRCTOP}/sys/compat/linux ${SRCTOP}/sys/x86/linux +.PATH: ${SRCTOP}/sys/compat/linux +.if ${MACHINE_CPUARCH} == "amd64" +.PATH: ${SRCTOP}/sys/x86/linux +.endif KMOD= linux_common SRCS= linux_common.c linux_mib.c linux_mmap.c linux_util.c linux_emul.c \ From nobody Mon Feb 6 19:07:42 2023 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 4P9bPB58B4z3n4HY; Mon, 6 Feb 2023 19:07:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P9bPB4Hc2z3Pnl; Mon, 6 Feb 2023 19:07:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675710462; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X5NBFz7dGgPzWSqX7de0jFpkmU66x+nNg988F9lsO94=; b=gJibCVtq3lSjYwOTQktY0mHtQGL3qx+/xArc0SHRxHWMvA9NZRXbraHoQk8k/BQOsy2pr3 EqkD9UJ02pMvsz8P0dUnclmWIqVAVCglSMW/H4cf0VrH/gDKl4V2pJJTACokuSch47odnk 8Pv8MGWlGsmVccd0HBSDne7bsFHVvNLUvUgqjU8wCIZaiMlpdj4VV+4es6hzHNx4X32UFT UBJMHQXMCNLGMGqWeHXc/6oLNqpkiBbBMqm6x942H6tbm1GpYSapAwYj/YxdUx76Cqch7U IOYHOIfYyyaGxuZGlpvJ2MhmD/JDqujBAVogjUKfmC5vDpiEQeut4cme9e9ZbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675710462; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X5NBFz7dGgPzWSqX7de0jFpkmU66x+nNg988F9lsO94=; b=UYavQksJ2Ko96WGkZ64EeMwB0l6YR3SAvWe64HsAH5PimDY703x3gU7066BUmoemgGPzeK spHm7s7mH6lTYi5UjzOPLgUeC9NroQAjrF/lj36J9Rnh0/FcMLXd/GsGi5h5b7M5Qu4Rc2 +DQoQcWT2ARAXEn7P4+b3n/FX+HX55W0CLjNQNe7Wkl4NQxCXuh89+284/CyNCDuHbmRSk sa8lAQkAc870JOCYDxHZS0pQMOAnDDwhiyXYccgATdz2bLhjTd5JB41avRU46rpVLtYyi8 UQgSvc7pLEPWHcgkMTk6M9W9015NEHwgV3WNTu8KuDwnbmVa+68RGNDfA9Y+mA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675710462; a=rsa-sha256; cv=none; b=t91CqU/WMNAbIJJGfmFoG0UDFmSJ6B08NjY3vN5fRYJiRIzQkefumO497cXgjbeCkGDhb0 1S5fsscQC97UII5WdeKKu11VNTWVRecUTR29qG8vUio1oIfWF23HC7YtyrF9WKyEsWVd0P hc52+x+k8rHbeoqib89HuuTfopO/URmVZhKqeP7X7h/AJrJWNqRM8ADpHypqIq5KjohJXx o7do5rN3sCTqxje8po1TwrTLitNofz6Z+EFEmY+Kf9KJhM83iJDUdODxq/FLmdW5ioJ0dH wvVFIzztWkhvAneEuYLPctc1XTLyFUH/2uIGJjCelzExGUR538ONnpo9x6vV5Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P9bPB3JTfzm2s; Mon, 6 Feb 2023 19:07:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 316J7gpf076833; Mon, 6 Feb 2023 19:07:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 316J7gR0076832; Mon, 6 Feb 2023 19:07:42 GMT (envelope-from git) Date: Mon, 6 Feb 2023 19:07:42 GMT Message-Id: <202302061907.316J7gR0076832@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: e600dd820db3 - stable/13 - smp: Drop confusing braces and return statement as panic() is never returns. 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e600dd820db343e87bb858e03988c31eb7e44b5e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=e600dd820db343e87bb858e03988c31eb7e44b5e commit e600dd820db343e87bb858e03988c31eb7e44b5e Author: Dmitry Chagin AuthorDate: 2023-01-29 12:33:16 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-06 19:06:30 +0000 smp: Drop confusing braces and return statement as panic() is never returns. Reviewed by: imp, kib Differential Revision: https://reviews.freebsd.org/D38235 MFC after: 1 week (cherry picked from commit 6fdf04a2be9b5b509c5b3d927e087122189ad1fb) --- sys/x86/x86/mp_x86.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/x86/x86/mp_x86.c b/sys/x86/x86/mp_x86.c index a7aa508f7699..5ced8eb50479 100644 --- a/sys/x86/x86/mp_x86.c +++ b/sys/x86/x86/mp_x86.c @@ -983,10 +983,9 @@ void cpu_add(u_int apic_id, char boot_cpu) { - if (apic_id > max_apic_id) { + if (apic_id > max_apic_id) panic("SMP: APIC ID %d too high", apic_id); - return; - } + KASSERT(cpu_info[apic_id].cpu_present == 0, ("CPU %u added twice", apic_id)); cpu_info[apic_id].cpu_present = 1; From nobody Mon Feb 6 19:07:43 2023 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 4P9bPC63h8z3n43n; Mon, 6 Feb 2023 19:07:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P9bPC5DGSz3Pwp; Mon, 6 Feb 2023 19:07:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675710463; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LoCLz8r7dijSrBVa0epDT78LS/gHAG+sQIS7EToFhzs=; b=l8F1E2FJZ+c1LOhrDxxnNUfZpg9e8PBoyG0NqOw6iqUR3e9wCk3M1qidyspRNkwzGbCBfI rpLXAbNshJlwTZsO0XkcZXXJsx1X/WyGBVp7YkG6vk+IJIeZoz4S4qZyUqMCgBrefJxdD+ l+pM+kyZ/Y4GH/DtiJTrgEKjJvIYOBXU8WvK1k93iNbWDl3ToL/tDIN1tIoxeq41AQQrHc JlgUgd1ZcrT7wOQ6YGFP9Qpg8a2U5oLAazuCqTLywUaJ2zoeyaAl46jzwfK+VOeAF3VQzQ bWAwGMxnK2Ro+F39OwVA+tUa3sX177QqVcrSKGU76x1XVvG3kr32uAIYTHkn7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675710463; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LoCLz8r7dijSrBVa0epDT78LS/gHAG+sQIS7EToFhzs=; b=Rk5L+Ai9q1fzJkY8ZFwgSH6giidWq9naCeXmO7BrLlzExiyfiVJEGR+h5bVw9/jDwAq3XR 5XFnB3DNtOiPZA0TPZ1iwE5yFO7Qw2/mqCsbA++TBIU1qAU20reXmycZ79u7sy/Dqkb6m+ P+VIdPVe50BbHvtFI53W9JfveaWMaBszB5TvGsRLiX1u2uKswJz5WHWh15r42YcQNtxi4a D8Ykj1z4IXbO9l7RfCTY+cuc0SUBeB+aOeuQXl46xlgJJ1lb5VKVVlBdlMCWTbiItrZxix g5aRQCZSnVvg3xZHHo1nC4hwh87uSXQmGa7nv67+1NQrelqrjrL88ClGuu+0/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675710463; a=rsa-sha256; cv=none; b=RvSXClKtL+H1pTHDTKVC4vL0Qp0wQ+it+hqe3nZKbcTYBa8R865TfJ3ioXGGjcT0D4LN+E FyNP/e5khx2tGVZvypxepji0FO+Ib25MYGNEkmfkpCLlgmDE+DoB4ob9RbCWaRL1z3eED6 wojcKrkK3l8zEjnld1x5NBb/01HDhQoaIoRKBPNS4Bt07L47zYsjHVl/VLv7s0E/bLeDp0 TFgjpCobpHUr+IytGIFdHixB8DtwUL1YyI+A2xgoGDKT1nb/mAhATjKWL4qll+xuQJUpxs 9WCCq9pDKY1s27zWpr1nXdEzwxKzzETw9AUkfi1YJ3QheKP9VHXoehVK8wyqTA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P9bPC4JN5zm2t; Mon, 6 Feb 2023 19:07:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 316J7hND076857; Mon, 6 Feb 2023 19:07:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 316J7hwD076856; Mon, 6 Feb 2023 19:07:43 GMT (envelope-from git) Date: Mon, 6 Feb 2023 19:07:43 GMT Message-Id: <202302061907.316J7hwD076856@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 669dc70e40ff - stable/13 - sched.h: Fix _S macros for better compatibility with glibc. 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 669dc70e40ff68e6d58df84ce21c175fe6c6321f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=669dc70e40ff68e6d58df84ce21c175fe6c6321f commit 669dc70e40ff68e6d58df84ce21c175fe6c6321f Author: Dmitry Chagin AuthorDate: 2023-01-29 12:34:10 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-06 19:06:30 +0000 sched.h: Fix _S macros for better compatibility with glibc. In e2650af157 was added "_S" macros for compatibility with glibc, but it's still incompatible as under glibc the macros whose names end with "_S" operate on the dynamically allocated CPU set(s) whose size is in bytes, not in bits. While here remove limiting ifdef to non-kernel case. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D38110 MFC after: 1 week (cherry picked from commit 02f7670ed243498aea96150962c2c9916bab7c98) --- sys/sys/cpuset.h | 20 ++++++------- tests/sys/kern/sched_affinity.c | 62 ++++++++++++++++++++--------------------- 2 files changed, 40 insertions(+), 42 deletions(-) diff --git a/sys/sys/cpuset.h b/sys/sys/cpuset.h index 5df5cff6497b..601da08a46a8 100644 --- a/sys/sys/cpuset.h +++ b/sys/sys/cpuset.h @@ -75,23 +75,21 @@ #define CPUSET_FSET __BITSET_FSET(_NCPUWORDS) #define CPUSET_T_INITIALIZER(x) __BITSET_T_INITIALIZER(x) -#if !defined(_KERNEL) #define CPU_ALLOC_SIZE(_s) __BITSET_SIZE(_s) #define CPU_ALLOC(_s) __cpuset_alloc(_s) #define CPU_FREE(p) __cpuset_free(p) -#define CPU_ISSET_S(n, _s, p) __BIT_ISSET(_s, n, p) -#define CPU_SET_S(n, _s, p) __BIT_SET(_s, n, p) -#define CPU_CLR_S(n, _s, p) __BIT_CLR(_s, n, p) -#define CPU_ZERO_S(_s, p) __BIT_ZERO(_s, p) +#define CPU_ISSET_S(n, _s, p) __BIT_ISSET((_s) * 8, n, p) +#define CPU_SET_S(n, _s, p) __BIT_SET((_s) * 8, n, p) +#define CPU_CLR_S(n, _s, p) __BIT_CLR((_s) * 8, n, p) +#define CPU_ZERO_S(_s, p) __BIT_ZERO((_s) * 8, p) -#define CPU_OR_S(_s, d, s1, s2) __BIT_OR2(_s, d, s1, s2) -#define CPU_AND_S(_s, d, s1, s2) __BIT_AND2(_s, d, s1, s2) -#define CPU_XOR_S(_s, d, s1, s2) __BIT_XOR2(_s, d, s1, s2) +#define CPU_OR_S(_s, d, s1, s2) __BIT_OR2((_s) * 8, d, s1, s2) +#define CPU_AND_S(_s, d, s1, s2) __BIT_AND2((_s) * 8, d, s1, s2) +#define CPU_XOR_S(_s, d, s1, s2) __BIT_XOR2((_s) * 8, d, s1, s2) -#define CPU_COUNT_S(_s, p) ((int)__BIT_COUNT(_s, p)) -#define CPU_EQUAL_S(_s, p, c) (__BIT_CMP(_s, p, c) == 0) -#endif +#define CPU_COUNT_S(_s, p) ((int)__BIT_COUNT((_s) * 8, p)) +#define CPU_EQUAL_S(_s, p, c) (__BIT_CMP((_s) * 8, p, c) == 0) /* * Valid cpulevel_t values. diff --git a/tests/sys/kern/sched_affinity.c b/tests/sys/kern/sched_affinity.c index 0c864342ff01..db8d9132550c 100644 --- a/tests/sys/kern/sched_affinity.c +++ b/tests/sys/kern/sched_affinity.c @@ -50,7 +50,7 @@ support_getmaxcpuid(void) setsize = CPU_ALLOC_SIZE(i); set = CPU_ALLOC(i); ATF_REQUIRE(set != NULL); - CPU_ZERO_S(i, set); + CPU_ZERO_S(setsize, set); rv = cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, setsize, set); if (rv == 0) { @@ -73,18 +73,18 @@ ATF_TC_BODY(test_setinvalidcpu, tc) cpusetsize = CPU_ALLOC_SIZE(maxcpuid + 1); set = CPU_ALLOC(maxcpuid + 1); ATF_REQUIRE(set != NULL); - CPU_ZERO_S(maxcpuid + 1, set); - CPU_SET_S(maxcpuid + 1, maxcpuid + 1, set); - CPU_SET_S(maxcpuid - 1, maxcpuid + 1, set); + CPU_ZERO_S(cpusetsize, set); + CPU_SET_S(maxcpuid + 1, cpusetsize, set); + CPU_SET_S(maxcpuid - 1, cpusetsize, set); ATF_REQUIRE(sched_setaffinity(0, cpusetsize, set) == 0); CPU_FREE(set); cpusetsize = CPU_ALLOC_SIZE(maxcpus + 1); set = CPU_ALLOC(maxcpus + 1); ATF_REQUIRE(set != NULL); - CPU_ZERO_S(maxcpus + 1, set); - CPU_SET_S(maxcpuid + 1, maxcpus + 1, set); - CPU_SET_S(maxcpuid - 1, maxcpus + 1, set); + CPU_ZERO_S(cpusetsize, set); + CPU_SET_S(maxcpuid + 1, cpusetsize, set); + CPU_SET_S(maxcpuid - 1, cpusetsize, set); ATF_REQUIRE(cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, cpusetsize, set) == -1); ATF_REQUIRE_EQ(errno, EINVAL); @@ -104,8 +104,8 @@ ATF_TC_BODY(test_setvalidcpu, tc) cpusetsize = CPU_ALLOC_SIZE(maxcpus + 1); set = CPU_ALLOC(maxcpus + 1); ATF_REQUIRE(set != NULL); - CPU_ZERO_S(maxcpus + 1, set); - CPU_SET_S(cpu, maxcpus + 1, set); + CPU_ZERO_S(cpusetsize, set); + CPU_SET_S(cpu, cpusetsize, set); ATF_REQUIRE(cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, cpusetsize, set) == 0); ATF_REQUIRE_EQ(cpu, sched_getcpu()); @@ -121,7 +121,7 @@ ATF_TC_BODY(test_setzeroset1, tc) cpusetsize = CPU_ALLOC_SIZE(maxcpuid + 1); set = CPU_ALLOC(maxcpuid + 1); ATF_REQUIRE(set != NULL); - CPU_ZERO_S(maxcpuid + 1, set); + CPU_ZERO_S(cpusetsize, set); ATF_REQUIRE(sched_setaffinity(0, cpusetsize, set) == -1); ATF_REQUIRE_EQ(errno, EINVAL); CPU_FREE(set); @@ -136,7 +136,7 @@ ATF_TC_BODY(test_setzeroset2, tc) cpusetsize = CPU_ALLOC_SIZE(maxcpuid + 1); set = CPU_ALLOC(maxcpuid + 1); ATF_REQUIRE(set != NULL); - CPU_ZERO_S(maxcpuid + 1, set); + CPU_ZERO_S(cpusetsize, set); ATF_REQUIRE(cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, cpusetsize, set) == -1); ATF_REQUIRE_EQ(errno, EDEADLK); @@ -152,20 +152,20 @@ ATF_TC_BODY(test_setmaxsetsize, tc) cpusetsize = CPU_ALLOC_SIZE(maxcpus * 2); set = CPU_ALLOC(maxcpus * 2); ATF_REQUIRE(set != NULL); - CPU_ZERO_S(maxcpus * 2, set); - ATF_REQUIRE(CPU_COUNT_S(maxcpus * 2, set) == 0); - CPU_SET_S(0, maxcpus * 2, set); - ATF_REQUIRE(CPU_COUNT_S(maxcpus * 2, set) == 1); + CPU_ZERO_S(cpusetsize, set); + ATF_REQUIRE(CPU_COUNT_S(cpusetsize, set) == 0); + CPU_SET_S(0, cpusetsize, set); + ATF_REQUIRE(CPU_COUNT_S(cpusetsize, set) == 1); ATF_REQUIRE(cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, cpusetsize, set) == 0); - CPU_ZERO_S(maxcpus * 2, set); - CPU_SET_S(maxcpuid, maxcpus * 2, set); + CPU_ZERO_S(cpusetsize, set); + CPU_SET_S(maxcpuid, cpusetsize, set); ATF_REQUIRE(cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, cpusetsize, set) == 0); - CPU_ZERO_S(maxcpus * 2, set); - CPU_SET_S(maxcpuid + 1, maxcpus * 2, set); + CPU_ZERO_S(cpusetsize, set); + CPU_SET_S(maxcpuid + 1, cpusetsize, set); ATF_REQUIRE(cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, cpusetsize, set) == -1); ATF_REQUIRE_EQ(errno, EINVAL); @@ -212,7 +212,7 @@ ATF_TC_BODY(test_getsetsize, tc) cpusetsize = CPU_ALLOC_SIZE(maxcpuid + 1); set = CPU_ALLOC(maxcpuid + 1); ATF_REQUIRE(set != NULL); - CPU_ZERO_S(maxcpuid + 1, set); + CPU_ZERO_S(cpusetsize, set); ATF_REQUIRE(cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, cpusetsize, set) == 0); CPU_FREE(set); @@ -227,26 +227,26 @@ ATF_TC_BODY(test_holes, tc) cpusetsize = CPU_ALLOC_SIZE(maxcpus * 2); set = CPU_ALLOC(maxcpus * 2); ATF_REQUIRE(set != NULL); - CPU_ZERO_S(maxcpus * 2, set); - ATF_REQUIRE(CPU_COUNT_S(maxcpus * 2, set) == 0); - CPU_SET_S(maxcpuid, maxcpus * 2, set); - ATF_REQUIRE(CPU_COUNT_S(maxcpus * 2, set) == 1); + CPU_ZERO_S(cpusetsize, set); + ATF_REQUIRE(CPU_COUNT_S(cpusetsize, set) == 0); + CPU_SET_S(maxcpuid, cpusetsize, set); + ATF_REQUIRE(CPU_COUNT_S(cpusetsize, set) == 1); ATF_REQUIRE(cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, cpusetsize, set) == 0); - CPU_ZERO_S(maxcpus * 2, set); - ATF_REQUIRE(CPU_COUNT_S(maxcpus * 2, set) == 0); - CPU_SET_S(maxcpuid + 1, maxcpus * 2, set); - ATF_REQUIRE(CPU_COUNT_S(maxcpus * 2, set) == 1); + CPU_ZERO_S(cpusetsize, set); + ATF_REQUIRE(CPU_COUNT_S(cpusetsize, set) == 0); + CPU_SET_S(maxcpuid + 1, cpusetsize, set); + ATF_REQUIRE(CPU_COUNT_S(cpusetsize, set) == 1); ATF_REQUIRE(cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, cpusetsize, set) == -1); ATF_REQUIRE_EQ(errno, EINVAL); - ATF_REQUIRE(CPU_COUNT_S(maxcpus * 2, set) == 1); + ATF_REQUIRE(CPU_COUNT_S(cpusetsize, set) == 1); ATF_REQUIRE(cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, cpusetsize, set) == 0); - ATF_REQUIRE(CPU_ISSET_S(maxcpuid + 1, maxcpus * 2, set) == false); - ATF_REQUIRE(CPU_ISSET_S(maxcpuid, maxcpus * 2, set) == true); + ATF_REQUIRE(CPU_ISSET_S(maxcpuid + 1, cpusetsize, set) == false); + ATF_REQUIRE(CPU_ISSET_S(maxcpuid, cpusetsize, set) == true); ATF_REQUIRE_EQ(maxcpuid, (uint32_t)sched_getcpu()); } From nobody Mon Feb 6 19:07:44 2023 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 4P9bPD6r1Hz3n4QD; Mon, 6 Feb 2023 19:07: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 4P9bPD6GkDz3Pvp; Mon, 6 Feb 2023 19:07:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675710464; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1AjxQd6Rbg+Sm8j0BjelFGx2/KffhW4LdlnL+wZE4uQ=; b=Cbl91v1ZJiq2NT9rJAoQPeKBDpWm4zsHQdj1/iPtVCq82iYHMCRAw1gLecoMUtjuXDuQM/ FCeT4yllx7b27npMV3NaTwKpzg2hEOx4S57KTTXUzz8RYbzMiBPQeraPAkZF4VUO/59Nmu A85SNnc/0c2hWF58wX6R9yB3Tw6Q9mAYxr5zAyaGJI6jo1W63i52XkP69F/sSJzFVhaypw fUWQnJtCxLVgTuqhQzGOc/s9FazZP9wniy9aTvGjHjDKVdITlIyko+yBMT2yUY/HKX6LcB xzSEHcbYSPa1ro2xzOh+XEL2EPTyWpBWxV7b6pjXV5e2/fkrRDOHB5WTQ+xkfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675710464; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1AjxQd6Rbg+Sm8j0BjelFGx2/KffhW4LdlnL+wZE4uQ=; b=BT5SFynr3KWIv8IuJMK0AI0pVFG+gV2ZBR/yUb/KQy1MJdfcTJ8G3xPVlgepmvspnB5xmu npwDv0hk9xHpu2L6fOTWzPCHIAeC6qIBL8i94dSzmYcG7dIixMP6HL/6IH7JzG3UYBe22L X/oSqHbft37JoS6ULlU3nztQCgzeawD6ky83RuQy6MZzcPyzq3TnPqm/0vVerfZVjxGMqY q0QkBmaQthlJIjrpOdt5IMuKUyDH2rau9KaSShh1lZTrQ7Kr8fNLKaSV2RqU7m1O8gzdNv 6EQB9M7Q/cpwkWSHLrkDDF3qNl0CGFzSX8DIl97Gf0C1btHVDnJQn+PjsAvgKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675710464; a=rsa-sha256; cv=none; b=QM2Cx92+/SxPgp+oeqBhju7J5oYS8xRyGUUS6c/IiuLJDIi5mBSkzjnsl7IPG/Fh5bPjPU lxI50bRGZt/ZKjFCW8Lipb4PIxGOKoVHlvdWXZMfqiG47Uow2i29bOoAKS/gmpnbraxbgF OH4mKRh/TeSNRgXJHi/qCbu5WXT3WqUgG0k0j/KTanqSnyCkyYMqPB55piSFsuQlsFY4ZP 9p+InTlTH5waSGraQXPshBYLV9ibSGZJh9IawiihcF9TUM2CSW4PsDQ8VvLKb89ICUx/ht gWqdpgzs1EODzcT/h9TXF3sAuU4evo+jWMmJzCbenChcarNXc9C/iXb+m1OJhA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P9bPD5K4Tzm0Q; Mon, 6 Feb 2023 19:07:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 316J7iJE076881; Mon, 6 Feb 2023 19:07:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 316J7i8J076880; Mon, 6 Feb 2023 19:07:44 GMT (envelope-from git) Date: Mon, 6 Feb 2023 19:07:44 GMT Message-Id: <202302061907.316J7i8J076880@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: bdb06df5ca6e - stable/13 - libthr: Fix pthread_attr_[g|s]etaffinity_np to match it's manual and the kernel. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bdb06df5ca6e44af87b5246771c77e6b851b6f71 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=bdb06df5ca6e44af87b5246771c77e6b851b6f71 commit bdb06df5ca6e44af87b5246771c77e6b851b6f71 Author: Dmitry Chagin AuthorDate: 2023-01-29 12:35:18 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-06 19:06:30 +0000 libthr: Fix pthread_attr_[g|s]etaffinity_np to match it's manual and the kernel. Since f35093f8 semantics of a thread affinity functions is changed to be a compatible with Linux: In case of getaffinity(), the minimum cpuset_t size that the kernel permits is the maximum CPU id, present in the system, / NBBY bytes, the maximum size is not limited. In case of setaffinity(), the kernel does not limit the size of the user-provided cpuset_t, internally using only the meaningful part of the set, where the upper bound is the maximum CPU id, present in the system, no larger than the size of the kernel cpuset_t. To match pthread_attr_[g|s]etaffinity_np checks of the user-provided cpusets to the kernel behavior export the minimum cpuset_t size allowed by running kernel via new sysctl kern.sched.cpusetsizemin and use it in checks. Reviewed by: Differential Revision: https://reviews.freebsd.org/D38112 MFC after: 1 week (cherry picked from commit 01f74ccd5a0d1a444703e931339709c7de5296b5) --- lib/libthr/thread/thr_attr.c | 6 ++++-- sys/kern/kern_cpuset.c | 6 ++++++ sys/kern/subr_smp.c | 2 ++ sys/sys/cpuset.h | 1 + 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/libthr/thread/thr_attr.c b/lib/libthr/thread/thr_attr.c index 6ff23aa5a3da..5a06f793f4f8 100644 --- a/lib/libthr/thread/thr_attr.c +++ b/lib/libthr/thread/thr_attr.c @@ -599,8 +599,10 @@ _get_kern_cpuset_size(void) size_t len; len = sizeof(kern_cpuset_size); - if (sysctlbyname("kern.sched.cpusetsize", &kern_cpuset_size, - &len, NULL, 0)) + if (sysctlbyname("kern.sched.cpusetsizemin", &kern_cpuset_size, + &len, NULL, 0) != 0 && + sysctlbyname("kern.sched.cpusetsize", &kern_cpuset_size, + &len, NULL, 0) != 0) PANIC("failed to get sysctl kern.sched.cpusetsize"); } diff --git a/sys/kern/kern_cpuset.c b/sys/kern/kern_cpuset.c index affc48e78862..d2bbfff1337d 100644 --- a/sys/kern/kern_cpuset.c +++ b/sys/kern/kern_cpuset.c @@ -136,11 +136,17 @@ static struct domainlist cpuset_domains; static struct unrhdr *cpuset_unr; static struct cpuset *cpuset_zero, *cpuset_default, *cpuset_kernel; static struct domainset *domainset0, *domainset2; +u_int cpusetsizemin = 1; /* Return the size of cpuset_t at the kernel level */ SYSCTL_INT(_kern_sched, OID_AUTO, cpusetsize, CTLFLAG_RD | CTLFLAG_CAPRD, SYSCTL_NULL_INT_PTR, sizeof(cpuset_t), "sizeof(cpuset_t)"); +/* Return the minimum size of cpuset_t allowed by the kernel */ +SYSCTL_UINT(_kern_sched, OID_AUTO, cpusetsizemin, + CTLFLAG_RD | CTLFLAG_CAPRD, &cpusetsizemin, 0, + "The minimum size of cpuset_t allowed by the kernel"); + cpuset_t *cpuset_root; cpuset_t cpuset_domain[MAXMEMDOM]; diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c index d66120666f9d..c83e05a4d87a 100644 --- a/sys/kern/subr_smp.c +++ b/sys/kern/subr_smp.c @@ -148,6 +148,8 @@ mp_setmaxid(void *dummy) KASSERT(mp_maxid >= mp_ncpus - 1, ("%s: counters out of sync: max %d, count %d", __func__, mp_maxid, mp_ncpus)); + + cpusetsizemin = howmany(mp_maxid + 1, NBBY); } SYSINIT(cpu_mp_setmaxid, SI_SUB_TUNABLES, SI_ORDER_FIRST, mp_setmaxid, NULL); diff --git a/sys/sys/cpuset.h b/sys/sys/cpuset.h index 601da08a46a8..f8fc36b99aa7 100644 --- a/sys/sys/cpuset.h +++ b/sys/sys/cpuset.h @@ -120,6 +120,7 @@ #include LIST_HEAD(setlist, cpuset); +extern u_int cpusetsizemin; /* * cpusets encapsulate cpu binding information for one or more threads. From nobody Mon Feb 6 19:07:45 2023 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 4P9bPG4M7Tz3n4L4; Mon, 6 Feb 2023 19:07:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P9bPG02PWz3Pxd; Mon, 6 Feb 2023 19:07:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675710466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WrviYzgvofCt6qjtsqfMYO4DILgT+GbLdM6LitVMMuI=; b=J+CNGMRVn5HgKnu77cOTgM8olwHVIbF+GHORGej3vfY35LWmKRIQ/mDkBypw6drmKtQj5O 1F/GgxrolISp2PsI9mtAeD5DAC/mTVwB8NyyxK9HmjNLa8WsC2VbdWyv+/FpeYN6g+jKCD U34m6yPFCk4+12GnBR3+9y8z4L0EBNK8NkD2SF7NL3oNxEzJc4oiknajhnlZmE8DmVsSO8 4Ye2fBlrUPbopqrob2okBnJ/M0RimXBuuMSOU4TfbDzZDm+jSBFLKKuJmY2oPvYUpVqCwm 7wNL45tEPhdNDFx94jpF4Y+6xc9xXBNJnKTryd48i+0KmyjI88mjhMe4anZH2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675710466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WrviYzgvofCt6qjtsqfMYO4DILgT+GbLdM6LitVMMuI=; b=XDScyIxU82Fj4Pd5ad7B4+KL4N7HOay7TQm21MQ+DBTCRyD6wnPRZ332+vjLWroDKJ+478 GOmI/2KdCgk4DvrrcEcHdXSW8AymJkKWpXYEDibSJwaHwCGzoSDLC127Twr1hujY87m454 V1QzK+37Jmm6Zz9S72Wqmdxms8ZnXQh5paXzv71cOkbB6MKi5BN8rONh6o9V7+JOyudL4y mcnPA0fsI/JiO9piTJLi721bzRs8L2gq7HS/cVWBauh777aBwkTdZQ7ffBx8+2EZwI9Do4 t0VpMNnruBvWZBhLWeiCq6CArepA3HQpa/01mTGcsoSnipSibuHbF12QduWgPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675710466; a=rsa-sha256; cv=none; b=E3IRrMSmMf8+D/WQPNTmfiTnbs0j+NFEHe8R+2spdsfcp3yaLE2TgcprA1T//Xj5TZZfFO TYbxltT7HnkL+0JjPqAKQk4OwhAf/upsS5Ss1VjV8KXKmT1hoyxMXsq+vvSBZ3/W4PBjgQ NsBglHQt8G/47fS1fgZrglnXaXvQW5cRRIx6D5vkLzsHenhDxVDnVsdsXSv79bqUB9GfY+ 4NUNeX99oDOCmutnjS+tsfWVzOLW+2FvRpM76LSyCmjFwm3ZVCGuV/HTwsHzp8kGuS6YKZ nI6zY07cRJwTf4hUG0lPpIf875mRn1wFohCi3WXo+IH+vHUKsrX3DxM9huBy2A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P9bPF6FcbzmLw; Mon, 6 Feb 2023 19:07:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 316J7jfg076907; Mon, 6 Feb 2023 19:07:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 316J7j2N076906; Mon, 6 Feb 2023 19:07:45 GMT (envelope-from git) Date: Mon, 6 Feb 2023 19:07:45 GMT Message-Id: <202302061907.316J7j2N076906@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: d365be955fef - stable/13 - libthr: Fix pthread_[g|s]etaffinity_np manual. 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d365be955fef0e3faf4983edf62183aa51dee011 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=d365be955fef0e3faf4983edf62183aa51dee011 commit d365be955fef0e3faf4983edf62183aa51dee011 Author: Dmitry Chagin AuthorDate: 2023-01-29 12:36:25 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-06 19:06:30 +0000 libthr: Fix pthread_[g|s]etaffinity_np manual. Since f35093f8 semantics of a thread affinity functions is changed to be a compatible with Linux: In case of getaffinity(), the minimum cpuset_t size that the kernel permits is the maximum CPU id, present in the system, / NBBY bytes, the maximum size is not limited. In case of setaffinity(), the kernel does not limit the size of the user-provided cpuset_t, internally using only the meaningful part of the set, where the upper bound is the maximum CPU id, present in the system, no larger than the size of the kernel cpuset_t. Reviewed by: jhb, kib Differential Revision: https://reviews.freebsd.org/D38111 MFC after: 1 week (cherry picked from commit 62801712dfc17fed6f8d4c9b64dca18d51a2bf9b) --- share/man/man3/pthread_affinity_np.3 | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/share/man/man3/pthread_affinity_np.3 b/share/man/man3/pthread_affinity_np.3 index 0a52add2ee3c..b36e5772c1e3 100644 --- a/share/man/man3/pthread_affinity_np.3 +++ b/share/man/man3/pthread_affinity_np.3 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 12, 2021 +.Dd January 29, 2023 .Dt PTHREAD_AFFINITY_NP 3 .Os .Sh NAME @@ -50,14 +50,19 @@ Masks of type are composed using the .Dv CPU_SET macros. -The kernel tolerates large sets as long as all CPUs specified -in the set exist. -Sets smaller than the kernel uses generate an error on calls to +If the user-supplied mask is not large enough to fit all of the matching CPUs, .Fn pthread_getaffinity_np -even if the result set would fit within the user supplied set. +fails with +.Er ERANGE . Calls to .Fn pthread_setaffinity_np -tolerate small sets with no restrictions. +tolerate masks of any size with no restrictions. +The kernel uses the meaningful part of the mask, where the upper bound is +the maximum CPU id present in the system. +If bits for non-existing CPUs are set, calls to +.Fn pthread_setaffinity_np +fails with +.Er EINVAL . .Pp The supplied mask should have a size of .Fa cpusetsize @@ -96,6 +101,12 @@ and .Fn pthread_setaffinity_np functions may fail if: .Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa cpusetp +argument specified when calling +.Fn pthread_setaffinity_np +was not a valid value. .It Bq Er EDEADLK The .Fn pthread_setaffinity_np @@ -112,7 +123,7 @@ argument could not be found. .It Bq Er ERANGE The .Fa cpusetsize -was either preposterously large or smaller than the kernel set size. +was smaller than needed to fit all of the matching CPUs. .It Bq Er EPERM The calling thread did not have the credentials required to complete the operation. From nobody Mon Feb 6 19:07:46 2023 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 4P9bPH4jvXz3n4QG; Mon, 6 Feb 2023 19:07:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P9bPH0l35z3QDV; Mon, 6 Feb 2023 19:07:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675710467; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XoOmcL1834+zYlVqh9w3FxYz72lPa13c4gEe8PbJ8dw=; b=ux+rwoEMvEQqatiqgx+WjcM2uJN430XtmIp6dGJh0MhRAUouXxTIccf3HghYU5wOv7hItE Ep8AjRrG9mOqODVyuacgidMlMhn9IGEn+YG5xqIZjRsBlH17bPIkMNdbX8C/IS2KNdbx8I Q4Xxf+y84cUYs34Qlmvy/AozSffy226IKY86Zb/tNQ6XVGOVKxYanG9oeBB2Ah+gvqJpFa O8OI5t3BCtrlarYqHg8NbxNMBBUIuY8TLUCIPKhjp+YAEDIdUycDdoehUnQzhCkU291oM2 Yn1jhQN/o5KIayG29S+EngwC/YtZCwpLpLj2lF0qk5PRAdBN72FrYPqQ9ntPxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675710467; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XoOmcL1834+zYlVqh9w3FxYz72lPa13c4gEe8PbJ8dw=; b=x8eC8s5oR0uKSW1lSUlVEJiRgTzBrfcHgthoHm+tj2Bxe3GwK6A5BrdnP8+mTMDYmEeGjF Q+9Zi660t3ZVcCcjNFzbCwZJWVmK4Iu0G14+VMBXaihmAefSforWHl4xPtA/7/sEL4ne/X zn2EX2nHlIVCmS+zXVHaRKkkks+xDEqrUM+6Sqh531YPkw5EmdFbDJQE+ooaIzorkS1lWx qy4RLdcjJ3EwQ0ZQMP/rV+NDR6MabP0WUVg3k36pCBdK3WI97g/Oy3cefzPApqSpxpApnT 3sLG+AQrGLBglsB2CdsrUrKjBrPWe+4DzbOXsettoLaq0C3sFUxBkvWkae5R7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675710467; a=rsa-sha256; cv=none; b=fQmoshXmyGsSU4dPVqDWsoaO9YCI8WtjfjbhokFpWf7pbrW37UIcRGtB470kMzAb+47vQo fsgwcg5kb1QLfJ9DHPCEHhIuobHr7W5a2ph0aRj8SfIkohuWLkydykPluOWUBGtdgT6LGK fIOcBxgechwS/F/Uc3tLRFDHrgN8ZvxHrgDPSRR1KPrWzatuYiQxLnqolS1DyPXqud31Wn OlPYUOF24Fh9T9+ZGi9NpMXx1F33NX6eV/kjbxlvsq6C3Xbj9itztyycY7uE8eYnzJXE4P WqVxzy2sP79PH3oQ/+DWL2Zi3x9pHsnVG4o/TnGO8pavz9CELcrom9d7i4NS9Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P9bPG6xfZzmWJ; Mon, 6 Feb 2023 19:07:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 316J7kb0076935; Mon, 6 Feb 2023 19:07:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 316J7keq076934; Mon, 6 Feb 2023 19:07:46 GMT (envelope-from git) Date: Mon, 6 Feb 2023 19:07:46 GMT Message-Id: <202302061907.316J7keq076934@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: dda428e2a539 - stable/13 - libthr: Fix pthread_attr_[g|s]etaffinity_np manual. 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: dda428e2a539a5aa7d8e6f2401265e1896c3806b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=dda428e2a539a5aa7d8e6f2401265e1896c3806b commit dda428e2a539a5aa7d8e6f2401265e1896c3806b Author: Dmitry Chagin AuthorDate: 2023-01-29 12:37:18 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-06 19:06:30 +0000 libthr: Fix pthread_attr_[g|s]etaffinity_np manual. Fix my fault in f35093f8. MFC after: 1 week (cherry picked from commit 2b87addf526e058158a332547d44b24a80f71321) --- share/man/man3/pthread_attr_affinity_np.3 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/share/man/man3/pthread_attr_affinity_np.3 b/share/man/man3/pthread_attr_affinity_np.3 index 2c85aee9ac19..c1b9d0d79cd8 100644 --- a/share/man/man3/pthread_attr_affinity_np.3 +++ b/share/man/man3/pthread_attr_affinity_np.3 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 27, 2022 +.Dd January 29, 2023 .Dt PTHREAD_ATTR_AFFINITY_NP 3 .Os .Sh NAME @@ -52,16 +52,17 @@ are composed using the .Dv CPU_SET macros. If the user-supplied mask is not large enough to fit all of the matching CPUs, -.Fn cpuset_getaffinity +.Fn pthread_attr_getaffinity_np fails with .Er ERANGE . Calls to -.Fn cpuset_setaffinity +.Fn pthread_attr_setaffinity_np tolerate masks of any size with no restrictions. -The kernel uses the meaningful part of the mask, where the upper bound is +.Fn pthread_attr_setaffinity_np +uses the meaningful part of the mask, where the upper bound is the maximum CPU id present in the system. If bits for non-existing CPUs are set, calls to -.Fn cpuset_setaffinity +.Fn pthread_attr_setaffinity_np fails with .Er EINVAL . .Pp From nobody Mon Feb 6 19:07:48 2023 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 4P9bPJ2d15z3n4Hj; Mon, 6 Feb 2023 19:07:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P9bPJ1kTrz3Q63; Mon, 6 Feb 2023 19:07:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675710468; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DlhbJh/h1MtCglP99/5dHAjWkO/jxPAVUleEaUuM9f8=; b=TuVukaJK9/m3eq0iZboIrKns6iJkOG/NDhUu1dcvhwDvtgukow5CL6lACMxd3Arcz13pH/ BShBhfkEA4fJ0G+nUIz96Z43xao+3lBTe72aEmPFTHau0W+XGr0Lu8ziqFSlm65FR7mykv NX4F07ocPbGfgP97+bjuT4iKdH4h+qG6UGitgHz7PB+Hbvmn989C6aXiwYESccmkG9b07X 52h62zgeZUeea0TSUmZu+DYf3I3075VDJ2kj002KetRHzLt6VahFXubPHw14MH6gav8S06 Z1jU1sCW+SFsGkpRf3x1r7tEriBhfPOOlzd8rDlroJRtQkcBamYGZRIUwY8lOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675710468; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DlhbJh/h1MtCglP99/5dHAjWkO/jxPAVUleEaUuM9f8=; b=DEOtnVYM5SMr535OKhIpED8cLBsmGqFORg13YJ6xL49maNbNki5uuXeuFfHmMTIgAfMyfD DfYKD8SFngxD9N8VnSiTunoylNC3OqoXeSqtdYHdhtQ1d17QsOLsScYcRMN+K77PUL6Son 5m6aM/v4yT1vT6N/p7v4V1Fr7NZfAoDF097SpXiwJYCmzN1ehH9BokVMdsWnj36DxvvYSY qJIU4AtVds/J0h+4UHU77Ducx41PZzZH/rDWFZtF/5LVMz2XBXNkC3fbEbzFDffVABBw46 Ps3D3IUpMpExVYsxgSNtdtotywq7DdKSExK1maPAKJUzGhlP2IHB+pYzeW8Xzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675710468; a=rsa-sha256; cv=none; b=kEQU+F4ZIEl6EXvK9iwb+yhPH11AWIK1cELsoTq34I9ZzDZEMWnjPvE2W9AIZ9KL1R4ntn 7t/pEBpXQjJ0VpzQZk2/yj0Hyy2B/bpAL11uGdrdCmqHebVuruU/k/yX9GXnCNJ3vj7B2k 29+A9ac58BAssOMO+8Jcay6G52TMvvwywgT150LiIcagHV2KptqRtbq89aGeeJn9u2p7gd rLDcgeq5S/FjlP3p7H6RuaCVy4u2heH2Gzh6yEbJoozMihDuYIMD9qDpUGWdPhktgUOZEA 5upC4tWvHwAOa4iEdx/hpuVmkg23tfMu2WO71uO0yK9CozZmkjpw+c8iJrpz9w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P9bPJ0pltzmJN; Mon, 6 Feb 2023 19:07:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 316J7mTY076959; Mon, 6 Feb 2023 19:07:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 316J7moD076958; Mon, 6 Feb 2023 19:07:48 GMT (envelope-from git) Date: Mon, 6 Feb 2023 19:07:48 GMT Message-Id: <202302061907.316J7moD076958@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 0c21dc519c83 - stable/13 - libthr: Trim trailing whitespaces in pthread_attr_affinity. 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0c21dc519c838326c90e8b3bbdcc0ad0abf50614 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=0c21dc519c838326c90e8b3bbdcc0ad0abf50614 commit 0c21dc519c838326c90e8b3bbdcc0ad0abf50614 Author: Dmitry Chagin AuthorDate: 2023-01-29 12:38:04 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-06 19:06:31 +0000 libthr: Trim trailing whitespaces in pthread_attr_affinity. MFC after: 1 week (cherry picked from commit f8660ea4b14d8ef8beefd4699d79098c738dddd8) --- lib/libthr/thread/thr_attr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libthr/thread/thr_attr.c b/lib/libthr/thread/thr_attr.c index 5a06f793f4f8..a5957fa407a8 100644 --- a/lib/libthr/thread/thr_attr.c +++ b/lib/libthr/thread/thr_attr.c @@ -629,7 +629,7 @@ _pthread_attr_setaffinity_np(pthread_attr_t *pattr, size_t cpusetsize, return (0); } size_t kern_size = _get_kern_cpuset_size(); - /* Kernel rejects small set, we check it here too. */ + /* Kernel rejects small set, we check it here too. */ if (cpusetsize < kern_size) return (ERANGE); if (cpusetsize > kern_size) { @@ -663,7 +663,7 @@ _pthread_attr_getaffinity_np(const pthread_attr_t *pattr, size_t cpusetsize, if (pattr == NULL || (attr = (*pattr)) == NULL) ret = EINVAL; else { - /* Kernel rejects small set, we check it here too. */ + /* Kernel rejects small set, we check it here too. */ size_t kern_size = _get_kern_cpuset_size(); if (cpusetsize < kern_size) return (ERANGE); @@ -673,7 +673,7 @@ _pthread_attr_getaffinity_np(const pthread_attr_t *pattr, size_t cpusetsize, else memset(cpusetp, -1, kern_size); if (cpusetsize > kern_size) - memset(((char *)cpusetp) + kern_size, 0, + memset(((char *)cpusetp) + kern_size, 0, cpusetsize - kern_size); } return (ret); From nobody Mon Feb 6 19:07:49 2023 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 4P9bPK3q43z3n4QM; Mon, 6 Feb 2023 19:07:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P9bPK2rRBz3QH3; Mon, 6 Feb 2023 19:07:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675710469; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VyjxEDGXYqpJASeX3/pR6jUrRTL/EMMK0v5r9UBFqcs=; b=SUQjMUkv9sxbD1H6WQZzpRDMbj/AtIOEVKQ02KtyFLwMGYz+1Z0DCoexHBWz85RhXP7E5g kZ9QMLLK8exWDkFkRo6VW+9U6x7xzN0kbQEZoQqMbVKo5aEuzO5OWM2ow0sXo8YeV2MOXd HTAwnhFxLcHhee5ExrlDDJOFe9ZZEx4hZxRkJqqS/yz3MF9+mAKhKWZZBckrb1N3gWS4O5 N11A7nl3y1CoADOWB8wJ2YM75mgWuQCCISeHnkM6qbBThGtQQwtD+fY18iIk8/J4UJWsQK HaxBtZDcB2ti00XdHMiRiTRagmYXuxuD2jBuRv/Ac6j+yYRiIxhKg76SYa1HVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675710469; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VyjxEDGXYqpJASeX3/pR6jUrRTL/EMMK0v5r9UBFqcs=; b=b/Li69qrobrxbftnncuq/SYVt37fAzFxjVdhs7dJQrDAQzz2c6vLSX29Jqk3+nrtD98D8z x+JewYnduGMRSbJQPrah/vfT/hXTswvxp6uv+AteNKyTdpe5YmRo6zuaZrwNctKxqIQ86s ktK8+hTaNMu5oPlDfDUwLLLafxrgvq6Dv/SP05fe/c8I1YEego6VXNQz2sLWe1POTqNW2/ cvN/qEA4t4K6RJagL+g8cSZoH2yWGh+X6/1suhOgN2Y/MtruLCYU1TLW9dVreQg5QEubco CCZjrXzoGXVsaT3agGwYt6f5XvTGIPo1gb5gafjxc6jyxUoSlgg9CIx0kzbTZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675710469; a=rsa-sha256; cv=none; b=xWzRmJkZyd1SRLiCuUT++rTRyRt+BQd48ruhKPaPG6sSc0GU0uGEzaq2yAyREAOWQbrhgG AZu5X+FEJ70NHU/Y7oPRri1nlJ++CP3m7/5y0bBobumfQjqfTNKQgAMMIu6C9wFBr6BIU0 JxWbvPIlTq09c5WsDPBeHHuX9NbzJ1KNOA4vse/3L0uiTgaRCUxHNAP6mTWpiKMtJe1P1z vyEVxblfE8glCv3vd7wKWfBliJxZ25qZFvAkcIjzOG5lsma8ETCbDWpxnTlL13CaO64GL7 xeS7w8q9A/awQKx+PZNg+BMSXfbW/HQQVKRuO56PPm93Q5u4HW7QS/nlY44fzw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P9bPK1xXWzmLx; Mon, 6 Feb 2023 19:07:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 316J7n43076983; Mon, 6 Feb 2023 19:07:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 316J7nEZ076982; Mon, 6 Feb 2023 19:07:49 GMT (envelope-from git) Date: Mon, 6 Feb 2023 19:07:49 GMT Message-Id: <202302061907.316J7nEZ076982@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 69e8cea385db - stable/13 - cpuset: Fix sched_[g|s]etaffinity() for better compatibility with Linux. 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 69e8cea385db64f86ccd3e9a2ab6ff61c5976f64 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=69e8cea385db64f86ccd3e9a2ab6ff61c5976f64 commit 69e8cea385db64f86ccd3e9a2ab6ff61c5976f64 Author: Dmitry Chagin AuthorDate: 2023-01-29 13:17:33 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-06 19:06:31 +0000 cpuset: Fix sched_[g|s]etaffinity() for better compatibility with Linux. Under Linux to sched_[g|s]etaffinity() functions the value returned from a call to gettid(2) (thread id) can be passed in the argument pid. Specifying pid as 0 will set the attribute for the calling thread, and passing the value returned from a call to getpid(2) (process id) will set the attribute for the main thread of the thread group. Native cpuset(2) family of system calls has "which" argument to determine how the value of id argument is interpreted, i.e., CPU_WHICH_TID is used to pass a thread id and CPU_WHICH_PID - to pass a process id. For now native sched_[g|s]etaffinity() implementation is wrong as uses "which" CPU_WHICH_PID to pass both (process and thread id) to the kernel. To fix this adding a new "which" CPU_WHICH_TIDPID intended to handle both id's. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D38209 MFC after: 1 week (cherry picked from commit c21b080f3dc2f5e91ada608d4385b7ed6538ba9b) --- lib/libc/gen/sched_getaffinity.c | 2 +- lib/libc/gen/sched_setaffinity.c | 2 +- lib/libc/sys/cpuset.2 | 4 +++- sys/kern/kern_cpuset.c | 42 +++++++++++++++++++++++++++++++++++++++- sys/sys/cpuset.h | 1 + 5 files changed, 47 insertions(+), 4 deletions(-) diff --git a/lib/libc/gen/sched_getaffinity.c b/lib/libc/gen/sched_getaffinity.c index ed304c111985..95145a1eb019 100644 --- a/lib/libc/gen/sched_getaffinity.c +++ b/lib/libc/gen/sched_getaffinity.c @@ -35,7 +35,7 @@ sched_getaffinity(pid_t pid, size_t cpusetsz, cpuset_t *cpuset) { int error; - error = cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, + error = cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TIDPID, pid == 0 ? -1 : pid, cpusetsz, cpuset); if (error == -1 && errno == ERANGE) errno = EINVAL; diff --git a/lib/libc/gen/sched_setaffinity.c b/lib/libc/gen/sched_setaffinity.c index 0052521cd081..36ed0f45d417 100644 --- a/lib/libc/gen/sched_setaffinity.c +++ b/lib/libc/gen/sched_setaffinity.c @@ -58,7 +58,7 @@ sched_setaffinity(pid_t pid, size_t cpusetsz, const cpuset_t *cpuset) if (cpu > mp_maxid) CPU_CLR(cpu, &c); } - error = cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, + error = cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TIDPID, pid == 0 ? -1 : pid, sizeof(cpuset_t), &c); if (error == -1 && errno == EDEADLK) errno = EINVAL; diff --git a/lib/libc/sys/cpuset.2 b/lib/libc/sys/cpuset.2 index a2e5269ac042..35adf6a9de41 100644 --- a/lib/libc/sys/cpuset.2 +++ b/lib/libc/sys/cpuset.2 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 3, 2017 +.Dd January 29, 2023 .Dt CPUSET 2 .Os .Sh NAME @@ -99,6 +99,7 @@ argument may have the following values: .Bl -column CPU_WHICH_INTRHANDLER -offset indent .It Dv CPU_WHICH_TID Ta "id is lwpid_t (thread id)" .It Dv CPU_WHICH_PID Ta "id is pid_t (process id)" +.It Dv CPU_WHICH_TIDPID Ta "id is either a thread or process id" .It Dv CPU_WHICH_JAIL Ta "id is jid (jail id)" .It Dv CPU_WHICH_CPUSET Ta "id is a cpusetid_t (cpuset id)" .It Dv CPU_WHICH_IRQ Ta "id is an irq number" @@ -114,6 +115,7 @@ of '-1' may be used with a of .Dv CPU_WHICH_TID , .Dv CPU_WHICH_PID , +.Dv CPU_WHICH_TIDPID , or .Dv CPU_WHICH_CPUSET to mean the current thread, process, or current thread's diff --git a/sys/kern/kern_cpuset.c b/sys/kern/kern_cpuset.c index d2bbfff1337d..1c8fa09cc224 100644 --- a/sys/kern/kern_cpuset.c +++ b/sys/kern/kern_cpuset.c @@ -927,6 +927,22 @@ cpuset_which(cpuwhich_t which, id_t id, struct proc **pp, struct thread **tdp, return (ESRCH); p = td->td_proc; break; + case CPU_WHICH_TIDPID: + if (id == -1) { + PROC_LOCK(curproc); + td = curthread; + p = curproc; + } else if (id > PID_MAX) { + td = tdfind(id, -1); + if (td == NULL) + return (ESRCH); + p = td->td_proc; + } else { + p = pfind(id); + if (p == NULL) + return (ESRCH); + } + break; case CPU_WHICH_CPUSET: if (id == -1) { thread_lock(curthread); @@ -1739,7 +1755,11 @@ cpuset_check_capabilities(struct thread *td, cpulevel_t level, cpuwhich_t which, if (IN_CAPABILITY_MODE(td)) { if (level != CPU_LEVEL_WHICH) return (ECAPMODE); - if (which != CPU_WHICH_TID && which != CPU_WHICH_PID) + if (which != CPU_WHICH_TID && which != CPU_WHICH_PID && + which != CPU_WHICH_TIDPID) + return (ECAPMODE); + if (id != -1 && which == CPU_WHICH_TIDPID && + id != td->td_tid && id != td->td_proc->p_pid) return (ECAPMODE); if (id != -1 && !(which == CPU_WHICH_TID && id == td->td_tid) && @@ -1986,6 +2006,19 @@ kern_cpuset_getaffinity(struct thread *td, cpulevel_t level, cpuwhich_t which, thread_unlock(ttd); } break; + case CPU_WHICH_TIDPID: + if (id > PID_MAX || id == -1) { + thread_lock(ttd); + CPU_COPY(&ttd->td_cpuset->cs_mask, mask); + thread_unlock(ttd); + break; + } + FOREACH_THREAD_IN_PROC(p, ttd) { + thread_lock(ttd); + CPU_OR(mask, mask, &ttd->td_cpuset->cs_mask); + thread_unlock(ttd); + } + break; case CPU_WHICH_CPUSET: case CPU_WHICH_JAIL: CPU_COPY(&set->cs_mask, mask); @@ -2135,6 +2168,13 @@ kern_cpuset_setaffinity(struct thread *td, cpulevel_t level, cpuwhich_t which, case CPU_WHICH_PID: error = cpuset_setproc(id, NULL, mask, NULL, false); break; + case CPU_WHICH_TIDPID: + if (id > PID_MAX || id == -1) + error = cpuset_setthread(id, mask); + else + error = cpuset_setproc(id, NULL, mask, NULL, + false); + break; case CPU_WHICH_CPUSET: case CPU_WHICH_JAIL: error = cpuset_which(which, id, &p, &ttd, &set); diff --git a/sys/sys/cpuset.h b/sys/sys/cpuset.h index f8fc36b99aa7..55e1ec5def0c 100644 --- a/sys/sys/cpuset.h +++ b/sys/sys/cpuset.h @@ -109,6 +109,7 @@ #define CPU_WHICH_DOMAIN 6 /* Specifies a NUMA domain id. */ #define CPU_WHICH_INTRHANDLER 7 /* Specifies an irq # (not ithread). */ #define CPU_WHICH_ITHREAD 8 /* Specifies an irq's ithread. */ +#define CPU_WHICH_TIDPID 9 /* Specifies a process or thread id. */ /* * Reserved cpuset identifiers. From nobody Mon Feb 6 19:07:50 2023 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 4P9bPL5Z9gz3n4Vb; Mon, 6 Feb 2023 19:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P9bPL3xh9z3Q9J; Mon, 6 Feb 2023 19:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675710470; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sL6h42Qjl1sDUPOqeu5Dsne8CODNEy4VOrEuuGW95nM=; b=LGgExvkP6DrHVJeONPpoGOUAOlXiXAf+8zvR31Pu2q8RFqt/jRMToFGRBN7r3xoRv2W4/z wqRsHCGzYZ6pFRe/v+Yd7Pfs+4EOVDDV3485gClMMV9vLIRlSMZ5W7yMw7VZj4UTM1XvJ3 UDI+5RWflZtZ36XdCyokxHUEGgNY5Bqd9T55+UXFPl2KUuEdtZ017LeKSvWXiv7lO3MyON MYKVMjiypC2jl75aCe9mtSXtRatb86U89cMLu5i/+2LQjeDOygtqSpClGVEYvIyrpyDB3l crnwGUxjv+e+nqLpVCMzp+w5PJfoDYCEenoUiNYz7rXYaY5uDB30eZbdU1R/qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675710470; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sL6h42Qjl1sDUPOqeu5Dsne8CODNEy4VOrEuuGW95nM=; b=a8+6f6PYoVQ4eaAc7Dnd0R2VYE9EUWCVXK9B2AQFFuYdQPlg/Dxvr4+L3rFH+HPtAsVM+5 RLGq0s3x4T9MswcSEIGZ8T8Zy9kMcxxS+lZqrERaH6LcvEiKOaOMCU8Iup2bgOzMki8wVO QK71ANl23YokfB8Z036VnPI+zz0mADIgdUHveG3ljRh/0/EEaXu6qCXtSiYUfmLhKhaizh IbcrOsWczOp6YxHwFOvCEuzjl0ZyHFSOrY2ANjLaGazaLZP82XBGGvYU7+xzq1VK7a1Wyp KxoREhVyGu7j0VuYsrAotnuWPw6wNLN9DKG5i1q+s5IagHqYZsRBM9eZIOgLDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675710470; a=rsa-sha256; cv=none; b=ad7sP3utH/uFgUauPeso4MFTtQ6kuJib87/C1d46akzkKrk/VSdLsqg/Kk5midt6Hk2y08 m//r/vZn05nBhJuP65FvOeojfj5vQJrVM///IFGArvnr9dF3JmbU0WDbZ5dZQkml6GOHU9 eM3NXKXWsXG+TVQ0hwYQR4M2oHBOmZKaRh/4/nbA6xXz8Cef+JSF8tpIA02ELI3yg5pEty 8rIFaeWUHNYk6XauaN0ToC23L9cVbBJ55eUrgNNgqmbIbNqYMn57ccn131oGMkCSzGMrvC /wOTxdapvfTUpVg4jeS7w3zQd+0dKMnJB4lYO5E/TAACe3pmz8SzI3h2PYasKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P9bPL32kVzm2v; Mon, 6 Feb 2023 19:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 316J7o5D077007; Mon, 6 Feb 2023 19:07:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 316J7oFC077006; Mon, 6 Feb 2023 19:07:50 GMT (envelope-from git) Date: Mon, 6 Feb 2023 19:07:50 GMT Message-Id: <202302061907.316J7oFC077006@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: cbe75c6d7714 - stable/13 - subr_smp: Trim trailing whitespaces. 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cbe75c6d77147026a75f56f3332f2f849d359c0b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=cbe75c6d77147026a75f56f3332f2f849d359c0b commit cbe75c6d77147026a75f56f3332f2f849d359c0b Author: Dmitry Chagin AuthorDate: 2023-01-29 13:18:17 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-06 19:06:31 +0000 subr_smp: Trim trailing whitespaces. MFC after: 1 week (cherry picked from commit e4754c80366dcbc28e625efab5cfe84057784c19) --- sys/kern/subr_smp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c index c83e05a4d87a..7b250aeccc56 100644 --- a/sys/kern/subr_smp.c +++ b/sys/kern/subr_smp.c @@ -125,11 +125,11 @@ static void (*volatile smp_rv_teardown_func)(void *arg); static void *volatile smp_rv_func_arg; static volatile int smp_rv_waiters[4]; -/* +/* * Shared mutex to restrict busywaits between smp_rendezvous() and * smp(_targeted)_tlb_shootdown(). A deadlock occurs if both of these * functions trigger at once and cause multiple CPUs to busywait with - * interrupts disabled. + * interrupts disabled. */ struct mtx smp_ipi_mtx; @@ -334,7 +334,7 @@ suspend_cpus(cpuset_t map) #endif /* - * Called by a CPU to restart stopped CPUs. + * Called by a CPU to restart stopped CPUs. * * Usually (but not necessarily) called with 'stopped_cpus' as its arg. * @@ -437,7 +437,7 @@ resume_cpus(cpuset_t map) #undef X86 /* - * All-CPU rendezvous. CPUs are signalled, all execute the setup function + * All-CPU rendezvous. CPUs are signalled, all execute the setup function * (if specified), rendezvous, execute the action function (if specified), * rendezvous again, execute the teardown function (if specified), and then * resume. From nobody Mon Feb 6 19:07:51 2023 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 4P9bPM5SFwz3n4QP; Mon, 6 Feb 2023 19:07:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P9bPM4m90z3QNK; Mon, 6 Feb 2023 19:07:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675710471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=28+Gj1GvCyXKdWS3UUM/zEhLw7tvnWkOBGMy+eCrCo8=; b=FbpHP8L6uMOmHB3kr7MEKjgYRk7c2uvuGv1QZwLR5XbeyeVJ68BQdsk82KrUr33SANrUZZ qhF/8JnNsXtX+jziTySPv1VWjgjwT6X8Z+gsx2huUiQXsUaHK+IGjkTMWgjp8k5q3NIMPK od4vUKEaFTF6CaBu3Va8/5I1WHONOzUx6Nr1IKqP9ZgQozxlFSbmeGIiAAWHyL+xeZOpAA GzeJ0l6lLCXxTRDp1y9pvPR76sJ8i1b1/Wa8qcn+UoPzosZho1DJUXGEXStzyCTt/JOLcD 5LpaWQf29AdrhpoZAQM3nv/uTWsC1GYSQxUeGoHMNC0FCefCYdrnPNOdVWWg8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675710471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=28+Gj1GvCyXKdWS3UUM/zEhLw7tvnWkOBGMy+eCrCo8=; b=UpnJu33c1AShzxoxzdDrCjT41xmzR6302pytm7G3fZUczUDV/nGjpIRJF3yVe9iz4F/qyy kq6JlpPtWCcK0hnjZePw35ToW9HSvKkmeQbQ+/a04h0kFdTJs3YIo8o3QZCFwaeRdv/YFv dx4TMOwWWK8CyxchdXKX8jK2aVbD/Q6SZKbQLkGmmhTkSj7q/xWQz37dz7m749XPS55IPl tCuN2i373NnnCdWA5iynPstocRZfg5bZ1D8l6fnlvUEvOAZf2oX4rVbQ+i5dpfFUoHI0AD /cUs5M2B5myAdRm1kktPpCZZ1DfJ2Y6v2YVVjnXOUKve3JAIKy94NvYKrJuFYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675710471; a=rsa-sha256; cv=none; b=H8bTjq9zIXpZXNPFX/gEL+r/aFry3aW09q/Mlkd/QSHsLMAgIRXm3J/Hg58f0YsWgDpPMT cnShmaxXjxi+efIxqFVbKL4mOakJmXrAWzc4OcstLIrPvcH/2BGg20fMUuP6ocovoDoWgQ OZkQF+393BnK7oo9iwrV+A9CVUFtrqxH7iecMGWgp5Ggd+Cg+YkDX2Y/F+BHNLNvz7WUPO dv7onJluCrjLMZDGx1Vlvb6kaO7Oz5iM4fViF6ByOIfyPee/2AXchfs0ZDCd0kdmXc7DHA /MiexmeVaKP4mvoSmZmNX2AZiwjB1DYkW9GzlNbfjA91RURVN9XfIsLWulihXQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P9bPM3qmxzmLy; Mon, 6 Feb 2023 19:07:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 316J7p1A077033; Mon, 6 Feb 2023 19:07:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 316J7pvc077032; Mon, 6 Feb 2023 19:07:51 GMT (envelope-from git) Date: Mon, 6 Feb 2023 19:07:51 GMT Message-Id: <202302061907.316J7pvc077032@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: d23a3b412955 - stable/13 - mp_x86: Trim trailing whitespaces. 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d23a3b412955ec9c4505936ea0d98354802a35ce Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=d23a3b412955ec9c4505936ea0d98354802a35ce commit d23a3b412955ec9c4505936ea0d98354802a35ce Author: Dmitry Chagin AuthorDate: 2023-01-29 13:18:39 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-06 19:06:31 +0000 mp_x86: Trim trailing whitespaces. MFC after: 1 week (cherry picked from commit 290afc5d55fa370338cb837c7aaabf40670628a8) --- sys/x86/x86/mp_x86.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/x86/x86/mp_x86.c b/sys/x86/x86/mp_x86.c index 5ced8eb50479..f5e08e5aaf1f 100644 --- a/sys/x86/x86/mp_x86.c +++ b/sys/x86/x86/mp_x86.c @@ -1717,7 +1717,7 @@ mp_ipi_intrcnt(void *dummy) intrcnt_add(buf, &ipi_rendezvous_counts[i]); snprintf(buf, sizeof(buf), "cpu%d:hardclock", i); intrcnt_add(buf, &ipi_hardclock_counts[i]); - } + } } SYSINIT(mp_ipi_intrcnt, SI_SUB_INTR, SI_ORDER_MIDDLE, mp_ipi_intrcnt, NULL); #endif From nobody Mon Feb 6 19:07:52 2023 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 4P9bPN6V1Pz3n466; Mon, 6 Feb 2023 19:07:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P9bPN5tx6z3QWZ; Mon, 6 Feb 2023 19:07:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675710472; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3tl/bQ3B5X2ry1Q2xSowgWn6rcE2r0f/3dx7sXgKE4s=; b=xyFhkX6NtbIBcG92zyXG05fXm40DAU2HrV4NgtFkYLXLCP3DIr2xgPhn+EUJqRiXfeF0jC kM2BC+YdxIwJ/tCLnZzC005toeFEbvFjco/DqNkiCKEMd6FrarWttC8fy9NxVC35bpq3L9 WzNh+7a271wChz3Zym33MAozQyudnaQLiXctHqKP1bfPf9p7s6EumXU8IOp3hpOb0tQCOP AIit6LFWqn2rdAkojttdwaFw6LmB1eJlzgd5YiY3lclJG7sNgW8gEeUDPWPplvU9ZqxV9E CimnmtHNQ12gzZBpJBanLWs16/Lutq0XrHFvcshvDWzzw43P4bNjFRW6PyGUKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675710472; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3tl/bQ3B5X2ry1Q2xSowgWn6rcE2r0f/3dx7sXgKE4s=; b=fQRwaF3R6bYfRNEPMSdhOFZXhXiVnwzvSO4uLVabvW3/+haoNOT7Tjk9hlTsxgeMvHAcB1 iQIsc+Pb/Fr3kO3/OQJ6jpo/yEBEedJc7FAu9CPIMXFDJgZa02QwQ7c8WBWIbZS9fpo6bQ Avdo9z5GBAJrKczygHm8BYS2m2M9nnwXdUPtQaY5KZuVtdkDI50+CYkwygTYPCON2y6JHp CZ7RYba9PcHvx+9O2AajYhNJXXsqDbZvvTOdjqbGqUqboQYggloTH5qdkgFDkPvvxBFDvn Ei4yHQphtzVjtKRKmiDC6JlXBTRpy16HUw8kzAWCMcO5hjuxrfFYcWQn1GCRKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675710472; a=rsa-sha256; cv=none; b=UVTc34whr8BlZwoNDqRuojY7XD9aZuq0FTZfmd9nJtWloGgASmEaBdCFKtxWREPv3g8DgD 6HpLIDl/MopeK9L9SGU7WhzOXmgqARFibjiDvzEDuhR0nku2ot4NZ4DJZEz9OHGozaEOf5 TrWzFMsLyxYReLCyoAMWcyf6HH1lEFDyF2qIOdOtLP2co7lNjOYlZDlrKhlgXJCPo7MkC0 0QjCLvm6kd9mxQXNZ7EHUoPlbnc8rNOFG8R8w+pBGwnSP4Vee1ptWyhVySzPbJ/qFKHquw HYsH2YLcTuajh4cg6RHNV4qzoCcbj17Ps8irxP61s5rLJ6Xht2pB8gac3TVGcQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P9bPN50VyzmWK; Mon, 6 Feb 2023 19:07:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 316J7qBh077061; Mon, 6 Feb 2023 19:07:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 316J7q2N077060; Mon, 6 Feb 2023 19:07:52 GMT (envelope-from git) Date: Mon, 6 Feb 2023 19:07:52 GMT Message-Id: <202302061907.316J7q2N077060@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 11ade1dffc8d - stable/13 - cpuset: Handle CPU_WHICH_TIDPID wherever cpuset_which() is called. 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 11ade1dffc8dbdcf2541b2f9b2da61a998ccafc7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=11ade1dffc8dbdcf2541b2f9b2da61a998ccafc7 commit 11ade1dffc8dbdcf2541b2f9b2da61a998ccafc7 Author: Dmitry Chagin AuthorDate: 2023-01-30 16:28:54 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-06 19:06:31 +0000 cpuset: Handle CPU_WHICH_TIDPID wherever cpuset_which() is called. cpuset_which() resolves the argument pair which and id and returns references to an appropriate resources. To avoid leaking resources or accessing unresolved references to a resources handle new which CPU_WHICH_TIDPID wherever cpuset_which() is called. To avoid code duplication cpuset_which2() has been added. Reported by: syzbot+331e8402e0f7347f0f2a@syzkaller.appspotmail.com Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D38272 MFC after: 2 weeks (cherry picked from commit 2058f075b4afc543b8735599bea7278e37b2e9f9) --- sys/kern/kern_cpuset.c | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/sys/kern/kern_cpuset.c b/sys/kern/kern_cpuset.c index 1c8fa09cc224..dfc32d01295e 100644 --- a/sys/kern/kern_cpuset.c +++ b/sys/kern/kern_cpuset.c @@ -150,6 +150,8 @@ SYSCTL_UINT(_kern_sched, OID_AUTO, cpusetsizemin, cpuset_t *cpuset_root; cpuset_t cpuset_domain[MAXMEMDOM]; +static int cpuset_which2(cpuwhich_t *, id_t, struct proc **, struct thread **, + struct cpuset **); static int domainset_valid(const struct domainset *, const struct domainset *); /* @@ -988,6 +990,20 @@ cpuset_which(cpuwhich_t which, id_t id, struct proc **pp, struct thread **tdp, return (0); } +static int +cpuset_which2(cpuwhich_t *which, id_t id, struct proc **pp, struct thread **tdp, + struct cpuset **setp) +{ + + if (*which == CPU_WHICH_TIDPID) { + if (id == -1 || id > PID_MAX) + *which = CPU_WHICH_TID; + else + *which = CPU_WHICH_PID; + } + return (cpuset_which(*which, id, pp, tdp, setp)); +} + static int cpuset_testshadow(struct cpuset *set, const cpuset_t *mask, const struct domainset *domain) @@ -1902,6 +1918,7 @@ kern_cpuset_getid(struct thread *td, cpulevel_t level, cpuwhich_t which, switch (which) { case CPU_WHICH_TID: case CPU_WHICH_PID: + case CPU_WHICH_TIDPID: thread_lock(ttd); set = cpuset_refbase(ttd->td_cpuset); thread_unlock(ttd); @@ -1963,7 +1980,7 @@ kern_cpuset_getaffinity(struct thread *td, cpulevel_t level, cpuwhich_t which, error = cpuset_check_capabilities(td, level, which, id); if (error != 0) return (error); - error = cpuset_which(which, id, &p, &ttd, &set); + error = cpuset_which2(&which, id, &p, &ttd, &set); if (error != 0) return (error); switch (level) { @@ -2006,19 +2023,6 @@ kern_cpuset_getaffinity(struct thread *td, cpulevel_t level, cpuwhich_t which, thread_unlock(ttd); } break; - case CPU_WHICH_TIDPID: - if (id > PID_MAX || id == -1) { - thread_lock(ttd); - CPU_COPY(&ttd->td_cpuset->cs_mask, mask); - thread_unlock(ttd); - break; - } - FOREACH_THREAD_IN_PROC(p, ttd) { - thread_lock(ttd); - CPU_OR(mask, mask, &ttd->td_cpuset->cs_mask); - thread_unlock(ttd); - } - break; case CPU_WHICH_CPUSET: case CPU_WHICH_JAIL: CPU_COPY(&set->cs_mask, mask); @@ -2138,6 +2142,7 @@ kern_cpuset_setaffinity(struct thread *td, cpulevel_t level, cpuwhich_t which, switch (which) { case CPU_WHICH_TID: case CPU_WHICH_PID: + case CPU_WHICH_TIDPID: thread_lock(ttd); set = cpuset_ref(ttd->td_cpuset); thread_unlock(ttd); @@ -2283,7 +2288,7 @@ kern_cpuset_getdomain(struct thread *td, cpulevel_t level, cpuwhich_t which, return (error); mask = malloc(domainsetsize, M_TEMP, M_WAITOK | M_ZERO); bzero(&outset, sizeof(outset)); - error = cpuset_which(which, id, &p, &ttd, &set); + error = cpuset_which2(&which, id, &p, &ttd, &set); if (error) goto out; switch (level) { @@ -2475,6 +2480,7 @@ kern_cpuset_setdomain(struct thread *td, cpulevel_t level, cpuwhich_t which, switch (which) { case CPU_WHICH_TID: case CPU_WHICH_PID: + case CPU_WHICH_TIDPID: thread_lock(ttd); set = cpuset_ref(ttd->td_cpuset); thread_unlock(ttd); @@ -2506,6 +2512,13 @@ kern_cpuset_setdomain(struct thread *td, cpulevel_t level, cpuwhich_t which, case CPU_WHICH_PID: error = cpuset_setproc(id, NULL, NULL, &domain, false); break; + case CPU_WHICH_TIDPID: + if (id > PID_MAX || id == -1) + error = _cpuset_setthread(id, NULL, &domain); + else + error = cpuset_setproc(id, NULL, NULL, &domain, + false); + break; case CPU_WHICH_CPUSET: case CPU_WHICH_JAIL: error = cpuset_which(which, id, &p, &ttd, &set); From nobody Mon Feb 6 19:36:57 2023 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 4P9c2x6gtKz3n5fx; Mon, 6 Feb 2023 19:36: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 4P9c2x4wH5z3pTJ; Mon, 6 Feb 2023 19:36:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675712217; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ralxQB67FwWpnMSWmWS3lsPFoxgUCU4Ti1CO+9OoxiY=; b=Meu6JwiYfbLa09eMQcaHZ/CAXiHPuN7LkeKwO+ASPCvjd1+BodaGW3o5WS1cGg4IVXPnI+ RmzTUob8L/I9CyPtMyiBymhrY/Aw0+0blgtaNScEHUUTrdmt/YX5kK+jYAWgHTo85sPB+N r5CNo8ePThq7aZf43xiyruG9MgCxm5WYfPsZEKWdsXmC+B3STwFEuU5g+5MFXXLvfd9cPl 3MRUGmu4OHjDTuyGiRcK6UXlCnlXqrg0bbrS2tdBKUlh/xIonqGY/9R4a/boXODW1+5Ogc EsEPuvMv0zBSxNpllkO02xF7bduGIJbWNjffveWIxM2iMuAcKhECVVbdi2CqJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675712217; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ralxQB67FwWpnMSWmWS3lsPFoxgUCU4Ti1CO+9OoxiY=; b=QFskwoILg5OL50m2aumJtTrpFJx5q1ngI4eGw9Uu4gY4go0FBFIbVCLMAJNPiEgbfKdY/T 15VcskSDJ/l/3uQSnNav5WdjzgA7u1VzcL/SnYs8OdZto6xyqGojhXjfTda6ZD0s1v5fPR iU9BHXn1TGIFq0KNkcTp9fsn5Uq3pkTFMmtf0KMgODNK4H0ggOeAHLdJRbEFN+M5rDl9VB 73GoxiELbnU0XG0dlJ8BMVvW0ou5azherKJmucUvxNMPucPNQ/Ol69GFbycoAnTvLNv7t1 l3ZGBrgEt9e/V5ZSwRbJHHtTIYyvWa29ChTkdz4Zn2L0GP5teCQJwhpw87hPnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675712217; a=rsa-sha256; cv=none; b=frpUqBn8wYJ0s3v7IIvzDsb9NjfZSaghgRqmE+oepYgQbHyCgcVMCkC/urBiAi6urfGgmN sGjK8ChWXGV+HQVf4sFC9Xrt0N1YJap58gzWoHqfk1k7/wOUb8atQ5/qKX1kS/qZJeuMY3 XaxFmKuODlnCDYaOgtfHSMfynt4HSwFJMnGDEV/KHtlbYdnopKVCPQBoujRVEOtc7cHlu9 vapu5Qay+fLR4fxIOwxMAonp4y+3JiUywL/io5kbhnwfTL/epNC3MbmedghYaDMrlVdSmA Ccbfjf/mg4cPW1PyLVOf0rBuZAZ8fUM305R6aIhHhRu8EZnx7Sztk3bkWc+zzQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P9c2x40mYznCh; Mon, 6 Feb 2023 19:36:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 316JavNU020430; Mon, 6 Feb 2023 19:36:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 316JaveR020429; Mon, 6 Feb 2023 19:36:57 GMT (envelope-from git) Date: Mon, 6 Feb 2023 19:36:57 GMT Message-Id: <202302061936.316JaveR020429@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 2f12145a37be - stable/13 - kern_reboot: unconditionally call shutdown_reset() 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: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2f12145a37befc2bae3db859699d394611e96e2d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=2f12145a37befc2bae3db859699d394611e96e2d commit 2f12145a37befc2bae3db859699d394611e96e2d Author: Mitchell Horne AuthorDate: 2023-01-23 18:47:11 +0000 Commit: Mitchell Horne CommitDate: 2023-02-06 19:34:36 +0000 kern_reboot: unconditionally call shutdown_reset() Currently shutdown_reset() is registered as the final entry of the shutdown_final event handler. However, if a panic occurs early in boot before the event is registered (SI_SUB_INTRINSIC), we may end up spinning in the subsequent infinite for loop and failing to reset altogether. Instead we can simply call this function unconditionally. Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D37981 (cherry picked from commit 627ca221c311b5d9c4132e03664a96f390ff5c0d) --- sys/kern/kern_shutdown.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index aaa5c5a0243f..ee6faa222206 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -265,8 +265,6 @@ shutdown_conf(void *unused) SHUTDOWN_PRI_LAST + 100); EVENTHANDLER_REGISTER(shutdown_final, shutdown_panic, NULL, SHUTDOWN_PRI_LAST + 100); - EVENTHANDLER_REGISTER(shutdown_final, shutdown_reset, NULL, - SHUTDOWN_PRI_LAST + 200); } SYSINIT(shutdown_conf, SI_SUB_INTRINSIC, SI_ORDER_ANY, shutdown_conf, NULL); @@ -499,6 +497,12 @@ kern_reboot(int howto) /* Now that we're going to really halt the system... */ EVENTHANDLER_INVOKE(shutdown_final, howto); + /* + * Call this directly so that reset is attempted even if shutdown + * handlers are not yet registered. + */ + shutdown_reset(NULL, howto); + for(;;) ; /* safety against shutdown_reset not working */ /* NOTREACHED */ } From nobody Mon Feb 6 19:36:58 2023 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 4P9c2y6r6Nz3n631; Mon, 6 Feb 2023 19:36: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 4P9c2y6B4rz3pcR; Mon, 6 Feb 2023 19:36:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675712218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mU0COFoQcbmVC6F4GxUYVcn22wdYMLF0TnzDLMHjKnY=; b=ksDND9zxU01BmGl/qmIq/p+qkmk6+j+MwuDelaLbwh7TByJ7jbCGZfSYs8geZl4WXm8VwG echnws+asOYK47GdqgVQqFTEYBkCqWZLfdlu8IQCAZ97YITL4/hQxDmDDUTEa2eiKJKnBh uPGsxF9oeEMO+yPGt3y0A6QZZvWB0DMCvptt7cpscGFzNhvdWIkJUvMrgBVQ8qlH+z17Yt GVOvdP6Huc+bU6LHj30RYG062EzEf1E0u9/9QxENVeTGs0+IS5cdfexpzFnDn6BobYzsse DIWRzh7eEwtlbInxfIjuKbcurQ46z2qnJaJbC+873zmjZScEuX2RAFAJ1Q6tIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675712218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mU0COFoQcbmVC6F4GxUYVcn22wdYMLF0TnzDLMHjKnY=; b=Sme/niQZYK529LqFoAPA3EB2swDnmp+nPQsMTf3Tbz5+bX7o/B7o2tHLx1DZff6Y17BkpH FeGO82CvO/0tuWtaMPM1OzTPWpyz7R5cfcWNcLB588fbtHUtzVqSSICGOfAIbnP3YW2yue JimjObyJMhbviqNB/7jt1yXwEfTqX53i1PS+fHAJfZUSI8n/bCdxgSM1AIbMffVz7EU8Hk Fac8h4Lvh7UNsiTmctZtPZAh0D0n1QVqJWgrlPikiGa64sHEXP5e2ttYCqedEHFvTQ4VZF SELa2eb/U6lifXzKQENuk8phEZPtbd+RM1zpDDZUhL42vyB7CwlE+duJZN+u2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675712218; a=rsa-sha256; cv=none; b=vPMLtZrx2Y2ZNbsohLnyspvxuGDlkmqWN6Pla7PLr0TbieehVwAshJ5D190Umk4AenMF2N zPLOR3EtKCTSu8+r63EiJffqhVWGSbpLJPx4nVUPGyYO+I1OYNuipSBl02dt7cdXZfiTDK U9mS1dm33Tb3uoFI+rbzvuFNcDlfwL7uMAYTEy1aORnY7LKg3jjvkIOSdXqOLJ8hsGungI WNIUqLLphO62ShalSFQD+EBTpd7hk4UYGz9O47kYJgAmWyECMTLe2Zco76Uazj/l7+Bd9H BkT2tEczLxLRYNRajnQwa7tQITvJbcuKzCu0zS12Vxz3iU82mkJt6Gi8aHOHMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P9c2y4yjRzn0r; Mon, 6 Feb 2023 19:36:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 316JawiS020463; Mon, 6 Feb 2023 19:36:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 316JawJR020462; Mon, 6 Feb 2023 19:36:58 GMT (envelope-from git) Date: Mon, 6 Feb 2023 19:36:58 GMT Message-Id: <202302061936.316JawJR020462@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: f0e49ab720d3 - stable/13 - ddb: have 'reset' command use normal reboot path 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: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f0e49ab720d3bc71f82dc1e73db4047f3a03defb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=f0e49ab720d3bc71f82dc1e73db4047f3a03defb commit f0e49ab720d3bc71f82dc1e73db4047f3a03defb Author: Mitchell Horne AuthorDate: 2023-01-07 18:09:28 +0000 Commit: Mitchell Horne CommitDate: 2023-02-06 19:34:37 +0000 ddb: have 'reset' command use normal reboot path This conditionally gives all registered shutdown handlers a chance to perform the reboot, with cpu_reset() being the fallback. The '\s' modifier can be used with the command to get the previous behaviour. The motivation is that some platforms may not be able do anything meaningful via cpu_reset(), due to a lack of standardized reset mechanism and/or firmware shortcomings. However, they may have a separate device driver attached that normally performs the reboot. Such is the case for some versions of the Raspberry Pi, where reset via PSCI fails, but the BCM2835 watchdog driver has a shutdown hook. Reported by: bz Reviewed by: markj (slightly earlier version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D37981 (cherry picked from commit 5644850620aead7c257a4e3040e20201b510f499) --- share/man/man4/ddb.4 | 14 ++++++++++++-- sys/ddb/db_command.c | 14 +++++++++++++- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/share/man/man4/ddb.4 b/share/man/man4/ddb.4 index db5b59f4e8f0..8ef78cc8b156 100644 --- a/share/man/man4/ddb.4 +++ b/share/man/man4/ddb.4 @@ -524,13 +524,23 @@ The optional argument limits the search. .\" .Pp -.It Ic reboot Op Ar seconds -.It Ic reset Op Ar seconds +.It Xo +.Ic Ic reboot Ns Op Li / Ns Cm s +.Op Ar seconds +.Xc +.It Xo +.Ic Ic reset Ns Op Li / Ns Cm s +.Op Ar seconds +.Xc Hard reset the system. If the optional argument .Ar seconds is given, the debugger will wait for this long, at most a week, before rebooting. +When the +.Cm s +modifier is given, the command will skip running any registered shutdown +handlers and attempt the most basic reset. .Pp .It Ic thread Ar addr | tid Switch the debugger to the thread with ID diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c index 28c7faee670b..ae983c46df8d 100644 --- a/sys/ddb/db_command.c +++ b/sys/ddb/db_command.c @@ -729,7 +729,7 @@ out: static void db_reset(db_expr_t addr, bool have_addr, db_expr_t count __unused, - char *modif __unused) + char *modif) { int delay, loop; @@ -754,6 +754,18 @@ db_reset(db_expr_t addr, bool have_addr, db_expr_t count __unused, } } + /* + * Conditionally try the standard reboot path, so any registered + * shutdown/reset handlers have a chance to run first. Some platforms + * may not support the machine-dependent mechanism used by cpu_reset() + * and rely on some other non-standard mechanism to perform the reset. + * For example, the BCM2835 watchdog driver or gpio-poweroff driver. + */ + if (modif[0] != 's') { + kern_reboot(RB_NOSYNC); + /* NOTREACHED */ + } + cpu_reset(); } From nobody Mon Feb 6 19:36:59 2023 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 4P9c300WhSz3n5lP; Mon, 6 Feb 2023 19:37: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 4P9c2z6jXpz3pVP; Mon, 6 Feb 2023 19:36:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675712219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CYDM+WeXC+yFbHDYFfql5dsc0ELIHIJM01xegT/4W3I=; b=eCWIYF7rwNO4EO+TvdUot3u8IF2N5VdChpIVidE98dGX/6XTg8WEPN1csdJALp34iLrLyI PieDi+FwwSDtQyKMwTFAou+MQoN0xbL9/WPeTpzJQVXNn74q45noIf10QO1SnMRqlIAjts Pz9UwodhIVByURB81RIYSn7NWGLU6E26vallepZe7pm1ooCu2Qatu1uozDIwfvv+GFlMnf csn/OPKDlz4b+5+RurXYxvXfqQfd+za/bDORWnr15HDyXji5a1aK88NHz1rNOuO07zwEHz xmWonG3ahVogdXwUn8mzftqBT2VdAiCUztwqIV0paH/ZkdTzb2mteppdxkvcgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675712219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CYDM+WeXC+yFbHDYFfql5dsc0ELIHIJM01xegT/4W3I=; b=BR/7qJkvsf32tF8m8GSf8qkhbEUKgkS8MzCrgxk0vsyUTfao8oARo3GNmeefA9CqbJXdI0 Z0sG2+OiSk3z+gIulg66Rq493wcoeClhw/voXRtoAIhiB7Ot+hXw/JWDspSAqf5pCkAn1h L0yOoirp8ZLuCtwpWXq8Le84ikQ+vf5SIe6IfyE5DWWC4t+Kd7Q0sniYXkcJEz53t3Nlfu 7x+jTbZzZ7EJh6MTyRAl4yz3it9j+BxUW20SlB863fWLoJu0wU42ySK0k0BF/R2B4P5Xim 0P6wxQE3kyK4OTPoUe7UzwNUOxAQvEHUilDGSpjdCzm1Jucfinnx6Ok4mgPCpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675712219; a=rsa-sha256; cv=none; b=KAj9KWx9Zn275YIjWcYAwljQ0zDKu3J+DhWJkl58C1TbR/0RZKBzOG5ATihri+v7m3938j 28EufiWlOcOYscUBjSS0D9oH/g84kcknd9EFzyrPacq1sb/zAN/KlhyPt/nRNB9zyvHNjJ 2k+8idHanMh6j1WAjo70wfFuljnpCpvMDZLnBjqMbb+apwvoTbKmr3rpqD7JRRXNITNpin QfzhZtA6Vzs1zmP8znTpV5Ndq5bRD9GS03PIJicox22vUlbi9fiP/Xjj4P5EB0jLdiKvqI e/8Hj9wOLgiPau1KC2ENy4Ydw/Ki5bKGAxfJ/5fvt21X9QMBYjEKPVmGtlNgcg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P9c2z5pD5znHT; Mon, 6 Feb 2023 19:36:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 316Jaxwi020487; Mon, 6 Feb 2023 19:36:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 316JaxV4020486; Mon, 6 Feb 2023 19:36:59 GMT (envelope-from git) Date: Mon, 6 Feb 2023 19:36:59 GMT Message-Id: <202302061936.316JaxV4020486@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: a6a064ec6f27 - stable/13 - elf_common.h: remove obsolete riscv relocations 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: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a6a064ec6f2710a3a0e527ec8b52ff666858cffb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=a6a064ec6f2710a3a0e527ec8b52ff666858cffb commit a6a064ec6f2710a3a0e527ec8b52ff666858cffb Author: Mitchell Horne AuthorDate: 2023-01-28 18:19:44 +0000 Commit: Mitchell Horne CommitDate: 2023-02-06 19:34:37 +0000 elf_common.h: remove obsolete riscv relocations These were specified at one time, but later removed. Reviewed by: jrtc27, imp, emaste MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38174 (cherry picked from commit 7738bb89a3cc70dc83ed4e80ee5160c18a7721f3) --- sys/sys/elf_common.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h index 884b8bb18d4f..f32d9b985605 100644 --- a/sys/sys/elf_common.h +++ b/sys/sys/elf_common.h @@ -1362,8 +1362,6 @@ typedef struct { #define R_RISCV_SUB16 38 #define R_RISCV_SUB32 39 #define R_RISCV_SUB64 40 -#define R_RISCV_GNU_VTINHERIT 41 -#define R_RISCV_GNU_VTENTRY 42 #define R_RISCV_ALIGN 43 #define R_RISCV_RVC_BRANCH 44 #define R_RISCV_RVC_JUMP 45 From nobody Mon Feb 6 19:37:00 2023 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 4P9c3110vfz3n5g1; Mon, 6 Feb 2023 19:37: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 4P9c310KLRz3pxF; Mon, 6 Feb 2023 19:37:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675712221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=blj1duDTzv+36rKV9DJhMoMKnuQTeCpgK/bmOH2oF1k=; b=W8GtR8yliHSqbcfjYCC/6QN9HZ/DRTip1T1anyddjS4ITMAULOgUTEEH5RNIlHAg5kdVKj UpQD4HXmqPcJsohYZ/lhWPcyE72oRbPE9kRr1VkKwKsxPGpXJEA5VLfhGSrbsjDv3Dk3nI K8B6HwKSUb/MpD3Dr2TddaximDG1Fj1lWYg3yTICNRzv8Kx9vqjALH7jBRp3+CmlO0MD0n Q8MkUoHfEMsP6fhgFdezcUY8ooC2ME3o1+BPW91TmcB21GHc9yC1XOq5QpY4cLE+82UcQC Y+mh2TmHMcvVvomOrt6AayepD24o8U6P1BHiltXw4Kb8TDsVS+t+GRR8L8LHXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675712221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=blj1duDTzv+36rKV9DJhMoMKnuQTeCpgK/bmOH2oF1k=; b=BUWuHSec2LRlDv7Db0I+ScPF+InA7+3r8OeE70aGGoCOYQP8Aazf+Z8pkuCo8n6ADX5gzr vUyTDfUco5wOZIQEckUshCbZTzrzg31bwxnjMknpLWY56AggRO/BvYfYSmVBywOrk2knHx kd2DumE511SnBjrI91I9ZnHppwmCYrtl4FSRcpbZngmFd1MImy/eM6CB5A8UPYvBBoYE7I RrSXnkrg4EryeqcDmj9nk/5aeNy8huszXKcC+ErbfljpgHKkJfMulxH+uEPO/Ptzal8Z2N fN6AS5D8E92Ik/zrWmfOM4GRgm1DSSbxDIMr7vWoX+xnfmNgS3+kYbS+y/dwGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675712221; a=rsa-sha256; cv=none; b=X32WCYwipiC+CN1Ca5X5AGIKGC0J+CLH5LizfFyIwhHD4YuITUQ40DIHmM3oOVE6R1pcKs AAs7n721q4jxa2hrOg+soZ+/mJdg/HscKEPkHCYp9mTzxmGe3ad0yeVy+COW7jNJ628265 1m5Z7Hgmcem8OjtHVoL9w/RaWwzeuccI4hnjr+ob/lO4X020oKgIWjef2Hz1qM0fXAgox2 Db61ee0DJGFe5pZiLeH4bSyTEp+mWT1z3OL+PinxqP8RKokRGAFRFfhUo5r9JYDEdZ3Wx1 ODDmCWZ8a0VuPPS8rV8LCntcApB+YrO/cq2GLEYqyl6o9kaBg7VMoJLZlMvBmw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P9c306WQXzmxl; Mon, 6 Feb 2023 19:37:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 316Jb0lc020513; Mon, 6 Feb 2023 19:37:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 316Jb0YK020512; Mon, 6 Feb 2023 19:37:00 GMT (envelope-from git) Date: Mon, 6 Feb 2023 19:37:00 GMT Message-Id: <202302061937.316Jb0YK020512@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 6b9f6aeac69b - stable/13 - elftoolchain: update the list of riscv relocations 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: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6b9f6aeac69b8bffc8db7a23e37fc1a4cdab43b8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=6b9f6aeac69b8bffc8db7a23e37fc1a4cdab43b8 commit 6b9f6aeac69b8bffc8db7a23e37fc1a4cdab43b8 Author: Mitchell Horne AuthorDate: 2023-01-28 18:19:26 +0000 Commit: Mitchell Horne CommitDate: 2023-02-06 19:34:37 +0000 elftoolchain: update the list of riscv relocations A few have been added, a couple removed. Reviewed by: jrtc27, imp, emaste MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38175 (cherry picked from commit 537c166b767879398338370701fa60f67acec112) --- contrib/elftoolchain/common/elfdefinitions.h | 12 ++++++++---- contrib/elftoolchain/libelftc/elftc_reloc_type_str.c | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/contrib/elftoolchain/common/elfdefinitions.h b/contrib/elftoolchain/common/elfdefinitions.h index 1b3a190ad055..0d230fffe3d3 100644 --- a/contrib/elftoolchain/common/elfdefinitions.h +++ b/contrib/elftoolchain/common/elfdefinitions.h @@ -2143,14 +2143,18 @@ _ELF_DEFINE_RELOC(R_RISCV_SUB8, 37) \ _ELF_DEFINE_RELOC(R_RISCV_SUB16, 38) \ _ELF_DEFINE_RELOC(R_RISCV_SUB32, 39) \ _ELF_DEFINE_RELOC(R_RISCV_SUB64, 40) \ -_ELF_DEFINE_RELOC(R_RISCV_GNU_VTINHERIT, 41) \ -_ELF_DEFINE_RELOC(R_RISCV_GNU_VTENTRY, 42) \ _ELF_DEFINE_RELOC(R_RISCV_ALIGN, 43) \ _ELF_DEFINE_RELOC(R_RISCV_RVC_BRANCH, 44) \ _ELF_DEFINE_RELOC(R_RISCV_RVC_JUMP, 45) \ _ELF_DEFINE_RELOC(R_RISCV_RVC_LUI, 46) \ -_ELF_DEFINE_RELOC(R_RISCV_GPREL_I, 47) \ -_ELF_DEFINE_RELOC(R_RISCV_GPREL_S, 48) +_ELF_DEFINE_RELOC(R_RISCV_RELAX, 51) \ +_ELF_DEFINE_RELOC(R_RISCV_SUB6, 52) \ +_ELF_DEFINE_RELOC(R_RISCV_SET6, 53) \ +_ELF_DEFINE_RELOC(R_RISCV_SET8, 54) \ +_ELF_DEFINE_RELOC(R_RISCV_SET16, 55) \ +_ELF_DEFINE_RELOC(R_RISCV_SET32, 56) \ +_ELF_DEFINE_RELOC(R_RISCV_32_PCREL, 57) \ +_ELF_DEFINE_RELOC(R_RISCV_IRELATIVE, 58) #define _ELF_DEFINE_SPARC_RELOCATIONS() \ _ELF_DEFINE_RELOC(R_SPARC_NONE, 0) \ diff --git a/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c b/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c index 4fa715ae0734..bc8ff6c0d2c6 100644 --- a/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c +++ b/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c @@ -656,14 +656,18 @@ elftc_reloc_type_str(unsigned int mach, unsigned int type) case 38: return "R_RISCV_SUB16"; case 39: return "R_RISCV_SUB32"; case 40: return "R_RISCV_SUB64"; - case 41: return "R_RISCV_GNU_VTINHERIT"; - case 42: return "R_RISCV_GNU_VTENTRY"; case 43: return "R_RISCV_ALIGN"; case 44: return "R_RISCV_RVC_BRANCH"; case 45: return "R_RISCV_RVC_JUMP"; case 46: return "R_RISCV_RVC_LUI"; - case 47: return "R_RISCV_GPREL_I"; - case 48: return "R_RISCV_GPREL_S"; + case 51: return "R_RISCV_RELAX"; + case 52: return "R_RISCV_SUB6"; + case 53: return "R_RISCV_SET6"; + case 54: return "R_RISCV_SET8"; + case 55: return "R_RISCV_SET16"; + case 56: return "R_RISCV_SET32"; + case 57: return "R_RISCV_32_PCREL"; + case 58: return "R_RISCV_IRELATIVE"; } break; case EM_S390: From nobody Mon Feb 6 22:21:03 2023 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 4P9ghH75m4z3nVRN; Mon, 6 Feb 2023 22:21: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 4P9ghH6Mcpz4Grn; Mon, 6 Feb 2023 22:21:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675722063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zJ+TEA5LO3gZkEeKiJ3mncuXJMUzabk8v+3Mq2SfjIk=; b=IVSN9pup+65EebY/zc+0kptzfxWALztIww94RYkGzh9tn/A+2nrS7WXqDJkAkEjVYmkOqC 1iquXADf1vLOr/37jScXqm458RAVXphbuaZj+5K+uIPSC62w8kkqU82pGo4HMiRZ08x6c8 x/fkU7h9qu3Ikj0Tt1T34uqmk2B/f8SC+/KTOIyQYtjnyP/yZ099ktaIH04o73lPLnxa8N RHcAMsgzXn5Phl1t6nheVk67Af9+N5RXR924pK80JlNKCYoFZfv6VJ+PsZmEhESv+qLiHU drQm6iJm2pi7zDrOHyRa7hP4+aQ+sHYdIbBn8ckO32eq9UsndH1UmpOLbRonUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675722063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zJ+TEA5LO3gZkEeKiJ3mncuXJMUzabk8v+3Mq2SfjIk=; b=b31uDxxNRcAu9iZwgpUvPvX6zVgRVs++/0LPCL8IZgwbe6e1ITtPc8asFNk5WW535gtZz1 q7uLmH7iwn+tMin5y0UjHDPsZcLgQQgvHMmQaRropBwB5WMd+LrxLTdUNsE7NWk5x61XTf X4xTY/JeoLldQviz3bhXyIVbS6ajK3XNYeK1QBROY5ZInY0DX1aTwM3yAHFt1ZjC4ZXRsJ m42FVavV3gsns3ODeaQt6nfUuYxiZNAbSXPoX56TtpjtViXD6MEsyZj02ryF7pNuIKtmrK K8/e/ucHjBvbEPdZQ2pnlHenD+SPulfen6aqggitjBri2beKIberZmqumlp/lw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675722063; a=rsa-sha256; cv=none; b=v+cbpW142ky3ySJokB0z4uCULCACMCwPT0kpMX89HtrDxoSg/BXDUvUQZR57wPvOxf1nEK JWrilDzqdjfTaMVJHrUHHjtxPnv3ljkkii155emKcu5x97KQVsN8sG60uC78sesaRTXRDc groYiJHRYS2LQfpZQ8YPWrMBtllUgbSwhZpsATgS6g5qSnYs+jG97Rep8hbIj1qjFTPWF0 Y7rdMKXfYpf8+7+QV0F+ZdcixcXJV9UULUXe1uZ34pGszTwfYTFqQcUjT186QqJ313X2hq 8F1jLpOIsKYNsdq7Wl3d8M3gG36EU4bmKpAPjVAR5143LMCkVbqHxyH0czchRg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P9ghH5R2Pzs8r; Mon, 6 Feb 2023 22:21:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 316ML3xX060045; Mon, 6 Feb 2023 22:21:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 316ML3cb060044; Mon, 6 Feb 2023 22:21:03 GMT (envelope-from git) Date: Mon, 6 Feb 2023 22:21:03 GMT Message-Id: <202302062221.316ML3cb060044@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 6cfb1cf3c9d4 - stable/13 - tcp: improve error handling of net.inet.tcp.udp_tunneling_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: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6cfb1cf3c9d4cdf9bc39566f6a94bae4a60096c7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=6cfb1cf3c9d4cdf9bc39566f6a94bae4a60096c7 commit 6cfb1cf3c9d4cdf9bc39566f6a94bae4a60096c7 Author: Michael Tuexen AuthorDate: 2023-01-26 21:55:22 +0000 Commit: Michael Tuexen CommitDate: 2023-02-06 22:17:09 +0000 tcp: improve error handling of net.inet.tcp.udp_tunneling_port In case the new port can't be set, set the port to 0. Sponsored by: Netflix, Inc. (cherry picked from commit e2d14a04c5fc49ad1aab280e3c2e7283bbacc948) --- sys/netinet/tcp_subr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 62042df50d18..811e6e10354c 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -843,6 +843,9 @@ sysctl_net_inet_tcp_udp_tunneling_port_check(SYSCTL_HANDLER_ARGS) } if (new != 0) { error = tcp_over_udp_start(); + if (error != 0) { + V_tcp_udp_tunneling_port = 0; + } } } } From nobody Mon Feb 6 22:21:04 2023 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 4P9ghK10Vmz3nVFQ; Mon, 6 Feb 2023 22:21: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 4P9ghK0Stfz4H0j; Mon, 6 Feb 2023 22:21:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675722065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W+wyhc1jFX+IxQMA0GHKJumNA9z2fdmohjQ7ku3aEkU=; b=A0Rlzo2pgmL5uzAi8XvP1OpdNzbfcUvbzb7q4YWZ9WxA3Xh/tunYpnSw/Z2Gn9BHa+4rpw rxYaLRt2fbSbQlIuzEdcHgmPnThTwq/zw8Jy7qD5xlLKpbjerS9cH6T20Pyqaxlp6HajOG 7gz6e+r2Z5vc3REQaSg0cyhg3uGdApOksPDp2tH2NRl1ZlRcVmlbjLBDMS5lr6R5U+cN7I H61ZOAxXxxj0nu5fzo+gJmd0dBusJO6p5I9Q9Bt7S8inuoRzdvHWw7k/9LXWxUFC+EhaCp Ls5Qs7KrSTu+jOFafQpLyopWPqZWBZVI6G3p8LPDNc6qI6DBH6PYKrVCeaoZag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675722065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W+wyhc1jFX+IxQMA0GHKJumNA9z2fdmohjQ7ku3aEkU=; b=W4uWhsM4tx2aJOW9D1TDitOviaEGunKZ8mUYLub73mNvTrvy5Fzb5JA5I0kftU0TC0K4OX NoHn0Rpj1nZFibRvsRQQg2J/EtsxyZ0POf2t/OrcJOHYCeyw6ybIkdKPiC3px00Kwapotz H4po4Rx8H5lF7SYoSGEdSsljEBrITuNe1cumlLIaL5nXs1GBko4vfSPETuU6o+nuqraHzZ gpUvcIvoYBol69Sta4qbXYb5AG0K/Vm52ZOMqm6QD2IwTrdVXxXQE4ZBDe3pm4lvFcZgR2 w+LWBwny8vwiHXLgaM/3d4EmIPZGSyisQ//cYc0xBH15HzCik43TSbwG5HH96A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675722065; a=rsa-sha256; cv=none; b=MTpfUgW2qOH+wzsObz9QuTeugI+s4SwzxBWgaZfrI/1aiad80fV9vqLLnDnhqdiEZNGfQ3 AJn30R9xZUkcrGPFYyNZlHCwj+Cf66iTdO2uTSii5RheReSJ1NYo+CSo+3010Yqz0h8fyP XiMqkcRNu1w8EAM2eLFG6WfPbBkpdWQ1zKGdaHkTjSGAxQcR8fFARaar2JFBCLdtHbmbuF EviqnYKh78DJ5Ju5CzS6McNr8laYIsEkcYSgDSrGpTBrJuJH5J0L56Ea7LBuMuskQZ8loS 8xtvsRdwqCheD2h9BdRtsybgf6v2UTHMUuZK9/1S2EIg7ViWJvgucnVNvew4YA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P9ghJ6c4JzsL7; Mon, 6 Feb 2023 22:21:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 316ML41O060076; Mon, 6 Feb 2023 22:21:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 316ML4lZ060075; Mon, 6 Feb 2023 22:21:04 GMT (envelope-from git) Date: Mon, 6 Feb 2023 22:21:04 GMT Message-Id: <202302062221.316ML4lZ060075@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 4da78e7a355e - stable/13 - sctp: improve delivery of stream reset notifications 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: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4da78e7a355e702d5cc353f06669b6ef6f43b559 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=4da78e7a355e702d5cc353f06669b6ef6f43b559 commit 4da78e7a355e702d5cc353f06669b6ef6f43b559 Author: Michael Tuexen AuthorDate: 2023-02-02 13:46:10 +0000 Commit: Michael Tuexen CommitDate: 2023-02-06 22:20:32 +0000 sctp: improve delivery of stream reset notifications Two functions are not called via sctp_ulp_notify() and therefore need additional checks when being called. Reported by: syzbot+eb888d3a5a6c54413de5@syzkaller.appspotmail.com (cherry picked from commit 7b2f1a7fe9445ea318f34bd3db971076b61ef831) --- sys/netinet/sctputil.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 1b2ba9371021..a56120b99f47 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -3815,10 +3815,17 @@ sctp_notify_stream_reset_add(struct sctp_tcb *stcb, uint16_t numberin, uint16_t struct sctp_stream_change_event *stradd; if ((stcb == NULL) || - (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_STREAM_CHANGEEVNT))) { + (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) || + (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || + (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET)) { + /* If the socket is gone we are out of here. */ + return; + } + if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_STREAM_CHANGEEVNT)) { /* event not enabled */ return; } + if ((stcb->asoc.peer_req_out) && flag) { /* Peer made the request, don't tell the local user */ stcb->asoc.peer_req_out = 0; @@ -3871,10 +3878,17 @@ sctp_notify_stream_reset_tsn(struct sctp_tcb *stcb, uint32_t sending_tsn, uint32 struct sctp_assoc_reset_event *strasoc; if ((stcb == NULL) || - (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_ASSOC_RESETEVNT))) { + (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) || + (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || + (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET)) { + /* If the socket is gone we are out of here. */ + return; + } + if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_ASSOC_RESETEVNT)) { /* event not enabled */ return; } + m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_assoc_reset_event), 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) /* no space left */ From nobody Mon Feb 6 22:48:45 2023 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 4P9hJF6nbPz3nX3M; Mon, 6 Feb 2023 22:48:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P9hJF6DTmz4KyH; Mon, 6 Feb 2023 22:48:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675723725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=krAyndUCVOmRq4oF+TOhXfxmlDhkoqwr/cwFekNlI2I=; b=OP4qxXTUyEjYwaomiXbop3i5J2BRpdl9h43gxutvyG4ANxufYpN3hQn8HYsTkPd1zwH/66 MDnHDq6TFWJ3WKJsmXvUZk5zFNpCF3nlIey0eZ17sRtcc1mfFtwLOBBQCZHbzZKj7sKgrp /+EjLOyWM0ju5V/r2tN+hvEUWIu2bRqUBGaD0MoSp8n6DDh3pAmC9qJqZLGkY0UQbph4OE xVuc2lK5gQtgfwuNvmQf7hSrLnX/kOVH7/XTGLFiQDcW3fCtYm/barWKwWm3gZs9OPOQNX g5QmCaUfF1SilN6WQtEY6i8UIPbbmP7oocXycdxqanckjI0kNPCmVMy2XcFBQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675723725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=krAyndUCVOmRq4oF+TOhXfxmlDhkoqwr/cwFekNlI2I=; b=hDQdJrNkF61bpUI4WA8ke9Yk7q9FnJzUsfrgCQ++2R9oGvtXZ60aCVARN91FMZuwTy+Akh KWgEz86swVYSzqBB9LeuNhbmTLt230DZN7qOT2fAFEYpglRPcA989cXwMWcRxZWoWlWqz2 2g9mLVyhoLK+LfM8pF01o377dU5oM/hn0ZWeftAsSiFh+OxG0WApm8ELF1Y+R4c6XsCdh4 1a+guxOuO9Hg/ds1TWsLJBkulFH+w6j0xD6UC3AEnyXbY99cRL3YCAHc50DKll2cLqeCeb fUT/lbVP7mTkn80ZPeSAIT5JFT9TYs1s0XZgmIkYeao/S1YgCpP/y/ph2ESYig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675723725; a=rsa-sha256; cv=none; b=T60T17XHR92HrYHVYLHP57tvA8Y65eH7u1hF4Haur36afvRRRt+wPQ7O9wEpN09g5xpXrK Z7B14IKU5Cb+arohLRW8CBW3+n9c9k0qA+hefNKiWlncCjZqT0H679RuR4y/mY1RvEyJIi r4EOJTlB+Bq/u4kn73DoVgwPQ7PTK5B5FRCeNSqK/75UUUdg6FEHqipeU01Qh7en3T6sAC /JYjepolOoTOPe9jmXppu+C+qybT8vdHIpDifJfC+e0NGbNtTmvFsTtSaMBEOo88XJhesA 9xDGTFdy54Mvlac7iIUmvg7eK3BAuvKKpPct5RMXa7ru3iggq8QGMV+Ukt+T7A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P9hJF5BS2zt8m; Mon, 6 Feb 2023 22:48:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 316MmjOH094343; Mon, 6 Feb 2023 22:48:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 316MmjDK094342; Mon, 6 Feb 2023 22:48:45 GMT (envelope-from git) Date: Mon, 6 Feb 2023 22:48:45 GMT Message-Id: <202302062248.316MmjDK094342@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: 7aaa7dad32ca - stable/13 - vtd: Increase DRHD_MAX_UNITS 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: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7aaa7dad32ca350e972d7c4688e39c50d818b45b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=7aaa7dad32ca350e972d7c4688e39c50d818b45b commit 7aaa7dad32ca350e972d7c4688e39c50d818b45b Author: Eric Joyner AuthorDate: 2023-01-30 21:34:03 +0000 Commit: Eric Joyner CommitDate: 2023-02-06 22:48:19 +0000 vtd: Increase DRHD_MAX_UNITS Observed on a couple Ice Lake-SP platforms (Intel Coyote Pass, Dell R750), there are more than 8 DRHD sections enumerated in the DMAR ACPI section. Since the previous limit was 8, this resulted in some of these not being parsed by vtd when the iommu is initialized; in this case when PCI devices are being passthru'd to a bhyve VM. This omission later causes a kernel panic later in initialization when devices could not be found in a valid DRHD scope because the DHRD containing the device's scope was not added to vtd. Signed-off-by: Eric Joyner PR: 268486 Sponsored by: Intel Corporation Reviewed by: rew@, corvink@ Differential Revision: https://reviews.freebsd.org/D38285 (cherry picked from commit 53545967642d850eee4f2dd9fa27cae52ae981b9) --- sys/amd64/vmm/intel/vtd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/amd64/vmm/intel/vtd.c b/sys/amd64/vmm/intel/vtd.c index 8f06dc823364..c3af7779a7ca 100644 --- a/sys/amd64/vmm/intel/vtd.c +++ b/sys/amd64/vmm/intel/vtd.c @@ -117,7 +117,7 @@ struct domain { static SLIST_HEAD(, domain) domhead; -#define DRHD_MAX_UNITS 8 +#define DRHD_MAX_UNITS 16 static ACPI_DMAR_HARDWARE_UNIT *drhds[DRHD_MAX_UNITS]; static int drhd_num; static struct vtdmap *vtdmaps[DRHD_MAX_UNITS]; From nobody Mon Feb 6 22:52:26 2023 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 4P9hNV25Smz3nXjl; Mon, 6 Feb 2023 22:52: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 4P9hNV1fkSz4LcF; Mon, 6 Feb 2023 22:52:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675723946; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cjRzmGIPs80Hhl7wydGYKdVG1ch/hPGnLM9vdYdJ4Ug=; b=g9lWSVqwaN8AG5gxyQl2I9U8ZYkW9pycW/kF/Ww+lXskae9HGW7fekuJ+zAfCVXG/4U3Y4 Ws7YsoUWU3dPyP8uzs1HVYUQaHA1pLubWrWq/dKYM+wSIO5WRel6soSSPK1xOI1awN74CK 3UM4v3k1gfqYnK3xP34Q4Gu1IpPu0bG1KRnLrzjhWHnq160HNNtYeBzHw0BEyCD5sMQvl2 RHYlXlmktS1wtEDZoI1BJ/bX/rPUoeVPaequDaPiixZaNdLgYO2IchFFiKILgUQUXUhysq HNulyu06I5YbkPLtY9HFeVufRRjY5hcnszPMtr+2MM7jMJ27CjoyAX/VjsD0Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675723946; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cjRzmGIPs80Hhl7wydGYKdVG1ch/hPGnLM9vdYdJ4Ug=; b=k9yO4usSHaDuwyqYfajEgMcPow9fwTLS7crI7vR67Mt/IfZDWt6P34BFrGm8vaU5wVbFzj mYUcCRhXQDmlQQt+DZGW5EhqY0WLXrINmEbsuIQ8FeB8kS4jOaSt/FdTqaGTv4ep14sDgA 2vRE7e0TnofeV+2OBuIVZRkEW6Zhc6AqMF4CPsLuwMsRyux94frvtxfP9RGOioMM0SLiYc 7vh/oKZ6BHEKOn+Zk51UP8Du4+qMo1PCnX+5Ke3RBh3r72r17+uOBRAsHhISotzCa55mGi /EL8eaJS5+49SerQI5vElvDOE0MpiblekP7lRjzNFSdmjXK080+sldY4RrpQsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675723946; a=rsa-sha256; cv=none; b=mB39sITSCJ5c2E8gl8yDlEVAHRi3IWhzIBkW/EPDSGuz37Q3w3zkYl5qKwTVPXFia/2yWl bA/eYJ3ZOFvMP+SqCwLrzCRdMVi3Ty30B2HZX6/OaKdNOnUckAeo8hkyX1myQzXkTlLFrI CMZQ6A2aYEYocXuj5A80CnlAaoTzAXPA045UsSGVOtCZwXheMbPVbnlJgOlv30iZcg6xW9 gzPeP8mNuXEh67IfnY8xl+R2x2MDFbSmvYEBEx9AP8cIPNzPtZPsHrt6YMmgOLFnhEjHwW AHTg92WJGRf9LMjgTiLxpYjo5Jzjx/fLOZ99X7CZaKcolO58T4m/fueykUIJLw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P9hNV0jDVzsgM; Mon, 6 Feb 2023 22:52:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 316MqQ6T007652; Mon, 6 Feb 2023 22:52:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 316MqQuQ007651; Mon, 6 Feb 2023 22:52:26 GMT (envelope-from git) Date: Mon, 6 Feb 2023 22:52:26 GMT Message-Id: <202302062252.316MqQuQ007651@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: b4e0be6df772 - stable/12 - vtd: Increase DRHD_MAX_UNITS 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: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: b4e0be6df772a3bd5f235e2a840ff4fdbe57e2d1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=b4e0be6df772a3bd5f235e2a840ff4fdbe57e2d1 commit b4e0be6df772a3bd5f235e2a840ff4fdbe57e2d1 Author: Eric Joyner AuthorDate: 2023-01-30 21:34:03 +0000 Commit: Eric Joyner CommitDate: 2023-02-06 22:52:10 +0000 vtd: Increase DRHD_MAX_UNITS Observed on a couple Ice Lake-SP platforms (Intel Coyote Pass, Dell R750), there are more than 8 DRHD sections enumerated in the DMAR ACPI section. Since the previous limit was 8, this resulted in some of these not being parsed by vtd when the iommu is initialized; in this case when PCI devices are being passthru'd to a bhyve VM. This omission later causes a kernel panic later in initialization when devices could not be found in a valid DRHD scope because the DHRD containing the device's scope was not added to vtd. Signed-off-by: Eric Joyner PR: 268486 Sponsored by: Intel Corporation Reviewed by: rew@, corvink@ Differential Revision: https://reviews.freebsd.org/D38285 (cherry picked from commit 53545967642d850eee4f2dd9fa27cae52ae981b9) --- sys/amd64/vmm/intel/vtd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/amd64/vmm/intel/vtd.c b/sys/amd64/vmm/intel/vtd.c index 489e7c179f2d..de5676b908d1 100644 --- a/sys/amd64/vmm/intel/vtd.c +++ b/sys/amd64/vmm/intel/vtd.c @@ -117,7 +117,7 @@ struct domain { static SLIST_HEAD(, domain) domhead; -#define DRHD_MAX_UNITS 8 +#define DRHD_MAX_UNITS 16 static ACPI_DMAR_HARDWARE_UNIT *drhds[DRHD_MAX_UNITS]; static int drhd_num; static struct vtdmap *vtdmaps[DRHD_MAX_UNITS]; From nobody Mon Feb 6 23:17:56 2023 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 4P9hxw6SN0z3nZBl; Mon, 6 Feb 2023 23:17:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P9hxw64Xbz4P9t; Mon, 6 Feb 2023 23:17:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675725476; h=from:from:reply-to:subject:subject: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/zTlRGysXbX/J30pTejgKX14Q/tN5MY7mrqieNN4kQ=; b=iDD4U+fVoj294bbrQlcTBa2JsnXuJpRJoT7LKGQKpEp74CNYTWM7S+v3W0CGCV1zPxgPMr sDJZCu0O5rpsbq8Ri3AKMmJQ1tWwyvgmCI2ZsyOdsOjfyzdkQTeA1JXLJVUedIMQrVXKWf vVQnv78jpkFN2nTjGsVgBkxUDEYd0C+UQ2w9cBEO38Nt6GXGwB+EtppBwDmdX3maHKMBJR 3ZviEkvwqhFEe20JDHo6rC/Uz6vn5Xu8giwAXptiAxapc7NOlzFi6PKVf8vzhGDFXgHuuW WnxECgfAezAlUHb5mV58bCGX/8tOCHrZ43rc/epOg5yeC1R1OW88MuiXB8bVsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675725476; h=from:from:reply-to:subject:subject: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/zTlRGysXbX/J30pTejgKX14Q/tN5MY7mrqieNN4kQ=; b=DWgwMAwVNl1HFprbcymwMqHkbXfbqijYKiuqXFIav0M3QEntoeMvR7nW8kifvK004ryRgM TIBxbGntP8Nx3FQWlABYN3vSliNqnEPlH/B/MJvUuaQPoEH4m20z/mpcYed6lzqkFhqmC2 SyaxGiSdz6BCbCSMNcbdBWI2NNSqnNfweEI52KFpH7uU0/n/iEk9oCDynzFS+ctiJPMDUL 7a2tXrPN3Yx6zYAYWEw+1Dr5uFDoLC6OjHo4jv4Z1yZydQuBDw5G4plfOLHbBfdpnb62I4 NsD60RK1lJuDkJdsNMZRyTqv1lB8iV9KActD6cOh3QeugtaGcELW1LTuBFdCOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675725476; a=rsa-sha256; cv=none; b=hVS4ZOCXrQjiW2fjtMXH24miBYUX/fFgam1G75whXFF2OQMpUGQcaHlJ1SjPUpNWgmQUje 2yIuu7P3UpGCiPbtdsGebJBVfj3r206wUqLp2qsEN7XZHgzrzE7eq4W/I/7GTCRex5adH2 dI5QAv7fu5PQikOxdYqEJHGzye0mglEIzWmTfGa2dqE/j4DVLdrrWI4w6XYNHWxq1rMIpU CaY4Kc1YgozQrCj95b1pB9Zc4PHLUNbbjO1Hx/4bq7Fq+niCMUJY/j7XJIH0XyTVId1WAN K/2YwAb3AqVfzFS/QuCtn8BiLFAtn/BFNBAfhrnKCqc4fHspf0d47BeR9+T/Aw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P9hxw58ghztDW; Mon, 6 Feb 2023 23:17:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 316NHuJv037601; Mon, 6 Feb 2023 23:17:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 316NHuFa037599; Mon, 6 Feb 2023 23:17:56 GMT (envelope-from git) Date: Mon, 6 Feb 2023 23:17:56 GMT Message-Id: <202302062317.316NHuFa037599@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 668dfa016698 - stable/13 - Document the mntopts(3) functions. 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: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 668dfa01669858c2468a96d7d0a8b5c808aea5e2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=668dfa01669858c2468a96d7d0a8b5c808aea5e2 commit 668dfa01669858c2468a96d7d0a8b5c808aea5e2 Author: Kirk McKusick AuthorDate: 2023-01-15 18:20:48 +0000 Commit: Kirk McKusick CommitDate: 2023-02-06 23:17:39 +0000 Document the mntopts(3) functions. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37907 (cherry picked from commit 906c312bbf7493ccbcce883936d67e5c66a9c3c2) --- sbin/fsck/Makefile | 4 + sbin/fsck/fsck.c | 5 +- sbin/fsck/fsutil.c | 44 ------ sbin/fsck/fsutil.h | 1 - sbin/fsck_ffs/main.c | 96 +----------- sbin/growfs/growfs.c | 110 ++------------ sbin/mount/Makefile | 11 +- sbin/mount/getmntopts.3 | 181 ----------------------- sbin/mount/getmntopts.c | 95 +++++++++++- sbin/mount/mntopts.3 | 381 ++++++++++++++++++++++++++++++++++++++++++++++++ sbin/mount/mntopts.h | 2 + sbin/mount/mount.c | 18 +-- sbin/tunefs/tunefs.c | 33 +---- 13 files changed, 513 insertions(+), 468 deletions(-) diff --git a/sbin/fsck/Makefile b/sbin/fsck/Makefile index 8d3dd214857e..d8106d082230 100644 --- a/sbin/fsck/Makefile +++ b/sbin/fsck/Makefile @@ -4,6 +4,10 @@ PACKAGE=runtime PROG= fsck SRCS= fsck.c fsutil.c preen.c +SRCS+= getmntopts.c MAN= fsck.8 +MOUNT= ${SRCTOP}/sbin/mount +CFLAGS+= -I${MOUNT} +.PATH: ${MOUNT} .include diff --git a/sbin/fsck/fsck.c b/sbin/fsck/fsck.c index bb053fe56253..b6ad92ebf49b 100644 --- a/sbin/fsck/fsck.c +++ b/sbin/fsck/fsck.c @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -206,7 +207,7 @@ main(int argc, char *argv[]) _PATH_DEV, spec); spec = device; } - mntp = getmntpt(spec); + mntp = getmntpoint(spec); if (mntp != NULL) { spec = mntp->f_mntfromname; mntpt = mntp->f_mntonname; @@ -269,7 +270,7 @@ isok(struct fstab *fs) if (flags & DO_BACKGRD) { if (!strcmp(fs->fs_type, FSTAB_RO)) return (0); - if (getmntpt(fs->fs_spec) == NULL) + if (getmntpoint(fs->fs_spec) == NULL) return (0); if (checkfs(fs->fs_vfstype, fs->fs_spec, fs->fs_file, "-F", 0)) return (0); diff --git a/sbin/fsck/fsutil.c b/sbin/fsck/fsutil.c index 9644697e2530..a3888eeea25a 100644 --- a/sbin/fsck/fsutil.c +++ b/sbin/fsck/fsutil.c @@ -188,50 +188,6 @@ devcheck(const char *origname) return (origname); } -/* - * Get the mount point information for name. - */ -struct statfs * -getmntpt(const char *name) -{ - struct stat devstat, mntdevstat; - char device[sizeof(_PATH_DEV) - 1 + MNAMELEN]; - char *dev_name; - struct statfs *mntbuf, *statfsp; - int i, mntsize, isdev; - - if (stat(name, &devstat) != 0) - return (NULL); - if (S_ISCHR(devstat.st_mode) || S_ISBLK(devstat.st_mode)) - isdev = 1; - else - isdev = 0; - mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); - for (i = 0; i < mntsize; i++) { - statfsp = &mntbuf[i]; - dev_name = statfsp->f_mntfromname; - if (*dev_name != '/') { - if (strlen(_PATH_DEV) + strlen(dev_name) + 1 > - sizeof(statfsp->f_mntfromname)) - continue; - strcpy(device, _PATH_DEV); - strcat(device, dev_name); - strcpy(statfsp->f_mntfromname, device); - } - if (isdev == 0) { - if (strcmp(name, statfsp->f_mntonname)) - continue; - return (statfsp); - } - if (stat(dev_name, &mntdevstat) == 0 && - mntdevstat.st_rdev == devstat.st_rdev) - return (statfsp); - } - statfsp = NULL; - return (statfsp); -} - - void * emalloc(size_t s) { diff --git a/sbin/fsck/fsutil.h b/sbin/fsck/fsutil.h index e65f5ddecb01..bd0954d44ba1 100644 --- a/sbin/fsck/fsutil.h +++ b/sbin/fsck/fsutil.h @@ -39,7 +39,6 @@ void panic(const char *, ...) __dead2 __printflike(1, 2); const char *devcheck(const char *); const char *cdevname(void); void setcdevname(const char *, int); -struct statfs *getmntpt(const char *); void *emalloc(size_t); void *erealloc(void *, size_t); char *estrdup(const char *); diff --git a/sbin/fsck_ffs/main.c b/sbin/fsck_ffs/main.c index 3a492c289bfe..c5dc10f1c3b0 100644 --- a/sbin/fsck_ffs/main.c +++ b/sbin/fsck_ffs/main.c @@ -76,8 +76,6 @@ static void usage(void) __dead2; static intmax_t argtoimax(int flag, const char *req, const char *str, int base); static int checkfilesys(char *filesys); static int setup_bkgrdchk(struct statfs *mntp, int sbrdfailed, char **filesys); -static int chkdoreload(struct statfs *mntp); -static struct statfs *getmntpt(const char *); int main(int argc, char *argv[]) @@ -258,7 +256,7 @@ checkfilesys(char *filesys) * if it is listed among the mounted file systems. Failing that * check to see if it is listed in /etc/fstab. */ - mntp = getmntpt(filesys); + mntp = getmntpoint(filesys); if (mntp != NULL) filesys = mntp->f_mntfromname; else @@ -311,7 +309,7 @@ checkfilesys(char *filesys) (FS_UNCLEAN | FS_NEEDSFSCK)) == 0) { bufinit(); gjournal_check(filesys); - if (chkdoreload(mntp) == 0) + if (chkdoreload(mntp, pwarn) == 0) exit(0); exit(4); } else { @@ -357,7 +355,7 @@ checkfilesys(char *filesys) sujrecovery = 1; if (suj_check(filesys) == 0) { printf("\n***** FILE SYSTEM MARKED CLEAN *****\n"); - if (chkdoreload(mntp) == 0) + if (chkdoreload(mntp, pwarn) == 0) exit(0); exit(4); } @@ -561,7 +559,7 @@ checkfilesys(char *filesys) return (ERESTART); printf("\n***** PLEASE RERUN FSCK *****\n"); } - if (chkdoreload(mntp) != 0) { + if (chkdoreload(mntp, pwarn) != 0) { if (!fsmodified) return (0); if (!preen) @@ -715,92 +713,6 @@ setup_bkgrdchk(struct statfs *mntp, int sbreadfailed, char **filesys) return (1); } -static int -chkdoreload(struct statfs *mntp) -{ - struct iovec *iov; - int iovlen; - char errmsg[255]; - - if (mntp == NULL) - return (0); - - iov = NULL; - iovlen = 0; - errmsg[0] = '\0'; - /* - * We modified a mounted file system. Do a mount update on - * it unless it is read-write, so we can continue using it - * as safely as possible. - */ - if (mntp->f_flags & MNT_RDONLY) { - build_iovec(&iov, &iovlen, "fstype", "ffs", 4); - build_iovec(&iov, &iovlen, "from", mntp->f_mntfromname, - (size_t)-1); - build_iovec(&iov, &iovlen, "fspath", mntp->f_mntonname, - (size_t)-1); - build_iovec(&iov, &iovlen, "errmsg", errmsg, - sizeof(errmsg)); - build_iovec(&iov, &iovlen, "update", NULL, 0); - build_iovec(&iov, &iovlen, "reload", NULL, 0); - /* - * XX: We need the following line until we clean up - * nmount parsing of root mounts and NFS root mounts. - */ - build_iovec(&iov, &iovlen, "ro", NULL, 0); - if (nmount(iov, iovlen, mntp->f_flags) == 0) { - return (0); - } - pwarn("mount reload of '%s' failed: %s %s\n\n", - mntp->f_mntonname, strerror(errno), errmsg); - return (1); - } - return (0); -} - -/* - * Get the mount point information for name. - */ -static struct statfs * -getmntpt(const char *name) -{ - struct stat devstat, mntdevstat; - char device[sizeof(_PATH_DEV) - 1 + MNAMELEN]; - char *ddevname; - struct statfs *mntbuf, *statfsp; - int i, mntsize, isdev; - - if (stat(name, &devstat) != 0) - return (NULL); - if (S_ISCHR(devstat.st_mode) || S_ISBLK(devstat.st_mode)) - isdev = 1; - else - isdev = 0; - mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); - for (i = 0; i < mntsize; i++) { - statfsp = &mntbuf[i]; - ddevname = statfsp->f_mntfromname; - if (*ddevname != '/') { - if (strlen(_PATH_DEV) + strlen(ddevname) + 1 > - sizeof(statfsp->f_mntfromname)) - continue; - strcpy(device, _PATH_DEV); - strcat(device, ddevname); - strcpy(statfsp->f_mntfromname, device); - } - if (isdev == 0) { - if (strcmp(name, statfsp->f_mntonname)) - continue; - return (statfsp); - } - if (stat(ddevname, &mntdevstat) == 0 && - mntdevstat.st_rdev == devstat.st_rdev) - return (statfsp); - } - statfsp = NULL; - return (statfsp); -} - static void usage(void) { diff --git a/sbin/growfs/growfs.c b/sbin/growfs/growfs.c index 69e6f04dd4c2..c7ef0ced4ed6 100644 --- a/sbin/growfs/growfs.c +++ b/sbin/growfs/growfs.c @@ -118,7 +118,6 @@ static void updjcg(int, time_t, int, int, unsigned int); static void updcsloc(time_t, int, int, unsigned int); static void frag_adjust(ufs2_daddr_t, int); static void updclst(int); -static void mount_reload(const struct statfs *stfs); static void cgckhash(struct cg *); /* @@ -1263,76 +1262,11 @@ is_dev(const char *name) return (1); } -/* - * Return mountpoint on which the device is currently mounted. - */ -static const struct statfs * -dev_to_statfs(const char *dev) -{ - struct stat devstat, mntdevstat; - struct statfs *mntbuf, *statfsp; - char device[MAXPATHLEN]; - char *mntdevname; - int i, mntsize; - - /* - * First check the mounted filesystems. - */ - if (stat(dev, &devstat) != 0) - return (NULL); - if (!S_ISCHR(devstat.st_mode) && !S_ISBLK(devstat.st_mode)) - return (NULL); - - mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); - for (i = 0; i < mntsize; i++) { - statfsp = &mntbuf[i]; - mntdevname = statfsp->f_mntfromname; - if (*mntdevname != '/') { - strcpy(device, _PATH_DEV); - strcat(device, mntdevname); - mntdevname = device; - } - if (stat(mntdevname, &mntdevstat) == 0 && - mntdevstat.st_rdev == devstat.st_rdev) - return (statfsp); - } - - return (NULL); -} - static const char * -mountpoint_to_dev(const char *mountpoint) -{ - struct statfs *mntbuf, *statfsp; - struct fstab *fs; - int i, mntsize; - - /* - * First check the mounted filesystems. - */ - mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); - for (i = 0; i < mntsize; i++) { - statfsp = &mntbuf[i]; - - if (strcmp(statfsp->f_mntonname, mountpoint) == 0) - return (statfsp->f_mntfromname); - } - - /* - * Check the fstab. - */ - fs = getfsfile(mountpoint); - if (fs != NULL) - return (fs->fs_spec); - - return (NULL); -} - -static const char * -getdev(const char *name) +getdev(const char *name, struct statfs *statfsp) { static char device[MAXPATHLEN]; - const char *cp, *dev; + const char *cp; if (is_dev(name)) return (name); @@ -1344,9 +1278,8 @@ getdev(const char *name) return (device); } - dev = mountpoint_to_dev(name); - if (dev != NULL && is_dev(dev)) - return (dev); + if (statfsp != NULL) + return (statfsp->f_mntfromname); return (NULL); } @@ -1378,7 +1311,7 @@ main(int argc, char **argv) DBG_FUNC("main") struct fs *fs; const char *device; - const struct statfs *statfsp; + struct statfs *statfsp; uint64_t size = 0; off_t mediasize; int error, j, fsi, fso, ch, ret, Nflag = 0, yflag = 0; @@ -1430,12 +1363,11 @@ main(int argc, char **argv) /* * Now try to guess the device name. */ - device = getdev(*argv); + statfsp = getmntpoint(*argv); + device = getdev(*argv, statfsp); if (device == NULL) errx(1, "cannot find special device for %s", *argv); - statfsp = dev_to_statfs(device); - fsi = open(device, O_RDONLY); if (fsi < 0) err(1, "%s", device); @@ -1666,8 +1598,9 @@ main(int argc, char **argv) error = close(fso); if (error != 0) err(1, "close"); - if (statfsp != NULL && (statfsp->f_flags & MNT_RDONLY) != 0) - mount_reload(statfsp); + if (statfsp != NULL && (statfsp->f_flags & MNT_RDONLY) != 0 && + chkdoreload(statfsp, warn) != 0) + exit(9); } DBG_CLOSE; @@ -1734,29 +1667,6 @@ updclst(int block) return; } -static void -mount_reload(const struct statfs *stfs) -{ - char errmsg[255]; - struct iovec *iov; - int iovlen; - - iov = NULL; - iovlen = 0; - *errmsg = '\0'; - build_iovec(&iov, &iovlen, "fstype", __DECONST(char *, "ffs"), 4); - build_iovec(&iov, &iovlen, "fspath", __DECONST(char *, stfs->f_mntonname), (size_t)-1); - build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); - build_iovec(&iov, &iovlen, "update", NULL, 0); - build_iovec(&iov, &iovlen, "reload", NULL, 0); - - if (nmount(iov, iovlen, stfs->f_flags) < 0) { - errmsg[sizeof(errmsg) - 1] = '\0'; - err(9, "%s: cannot reload filesystem%s%s", stfs->f_mntonname, - *errmsg != '\0' ? ": " : "", errmsg); - } -} - /* * Calculate the check-hash of the cylinder group. */ diff --git a/sbin/mount/Makefile b/sbin/mount/Makefile index 34ba498a2a3f..1bc84039b121 100644 --- a/sbin/mount/Makefile +++ b/sbin/mount/Makefile @@ -4,8 +4,15 @@ PACKAGE=runtime PROG= mount SRCS= mount.c mount_fs.c getmntopts.c vfslist.c -MAN= mount.8 -# We do NOT install the getmntopts.3 man page. +MAN= mntopts.3 mount.8 +MLINKS+= mntopts.3 getmntopts.3 +MLINKS+= mntopts.3 getmntpoint.3 +MLINKS+= mntopts.3 chkdoreload.3 +MLINKS+= mntopts.3 build_iovec.3 +MLINKS+= mntopts.3 build_iovec_argf.3 +MLINKS+= mntopts.3 free_iovec.3 +MLINKS+= mntopts.3 checkpath.3 +MLINKS+= mntopts.3 rmslashes.3 LIBADD= util xo diff --git a/sbin/mount/getmntopts.3 b/sbin/mount/getmntopts.3 deleted file mode 100644 index b87956d051b7..000000000000 --- a/sbin/mount/getmntopts.3 +++ /dev/null @@ -1,181 +0,0 @@ -.\" Copyright (c) 1994 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.\" @(#)getmntopts.3 8.3 (Berkeley) 3/30/95 -.\" $FreeBSD$ -.\" -.Dd February 17, 2008 -.Dt GETMNTOPTS 3 -.Os -.Sh NAME -.Nm getmntopts -.Nd scan mount options -.Sh SYNOPSIS -.Fd #include \&"mntopts.h" -.Ft void -.Fo getmntopts -.Fa "const char *options" "const struct mntopt *mopts" -.Fa "int *flagp" "int *altflagp" -.Fc -.Sh DESCRIPTION -The -.Fn getmntopts -function takes a comma separated option list and a list -of valid option names, and computes the bitmask -corresponding to the requested set of options. -.Pp -The string -.Fa options -is broken down into a sequence of comma separated tokens. -Each token is looked up in the table described by -.Fa mopts -and the bits in -the word referenced by either -.Fa flagp -or -.Fa altflagp -(depending on the -.Va m_altloc -field of the option's table entry) -are updated. -The flag words are not initialized by -.Fn getmntopts . -The table, -.Fa mopts , -has the following format: -.Bd -literal -struct mntopt { - char *m_option; /* option name */ - int m_inverse; /* is this a negative option, e.g., "dev" */ - int m_flag; /* bit to set, e.g., MNT_RDONLY */ - int m_altloc; /* non-zero to use altflagp rather than flagp */ -}; -.Ed -.Pp -The members of this structure are: -.Bl -tag -width m_inverse -.It Va m_option -the option name, -for example -.Dq Li suid . -.It Va m_inverse -tells -.Fn getmntopts -that the name has the inverse meaning of the -bit. -For example, -.Dq Li suid -is the string, whereas the -mount flag is -.Dv MNT_NOSUID . -In this case, the sense of the string and the flag -are inverted, so the -.Va m_inverse -flag should be set. -.It Va m_flag -the value of the bit to be set or cleared in -the flag word when the option is recognized. -The bit is set when the option is discovered, -but cleared if the option name was preceded -by the letters -.Dq Li no . -The -.Va m_inverse -flag causes these two operations to be reversed. -.It Va m_altloc -the bit should be set or cleared in -.Fa altflagp -rather than -.Fa flagp . -.El -.Pp -Each of the user visible -.Dv MNT_ -flags has a corresponding -.Dv MOPT_ -macro which defines an appropriate -.Vt "struct mntopt" -entry. -To simplify the program interface and ensure consistency across all -programs, a general purpose macro, -.Dv MOPT_STDOPTS , -is defined which -contains an entry for all the generic VFS options. -In addition, the macros -.Dv MOPT_FORCE -and -.Dv MOPT_UPDATE -exist to enable the -.Dv MNT_FORCE -and -.Dv MNT_UPDATE -flags to be set. -Finally, the table must be terminated by an entry with a -.Dv NULL -first element. -.Sh EXAMPLES -Most commands will use the standard option set. -Local file systems which support the -.Dv MNT_UPDATE -flag, would also have an -.Dv MOPT_UPDATE -entry. -This can be declared and used as follows: -.Bd -literal -#include "mntopts.h" - -struct mntopt mopts[] = { - MOPT_STDOPTS, - MOPT_UPDATE, - { NULL } -}; - - ... - mntflags = mntaltflags = 0; - ... - getmntopts(options, mopts, &mntflags, &mntaltflags); - ... -.Ed -.Sh DIAGNOSTICS -If the external integer variable -.Va getmnt_silent -is zero, then the -.Fn getmntopts -function displays an error message and exits if an -unrecognized option is encountered. -Otherwise unrecognized options are silently ignored. -By default -.Va getmnt_silent -is zero. -.Sh SEE ALSO -.Xr err 3 , -.Xr mount 8 -.Sh HISTORY -The -.Fn getmntopts -function appeared in -.Bx 4.4 . diff --git a/sbin/mount/getmntopts.c b/sbin/mount/getmntopts.c index 0ee6d99ed8b9..e6607c385341 100644 --- a/sbin/mount/getmntopts.c +++ b/sbin/mount/getmntopts.c @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -153,6 +154,98 @@ checkpath_allow_file(const char *path, char *resolved) return (0); } +/* + * Get the mount point information for name. Name may be mount point name + * or device name (with or without /dev/ preprended). + */ +struct statfs * +getmntpoint(const char *name) +{ + struct stat devstat, mntdevstat; + char device[sizeof(_PATH_DEV) - 1 + MNAMELEN]; + char *ddevname; + struct statfs *mntbuf, *statfsp; + int i, mntsize, isdev; + + if (stat(name, &devstat) != 0) + return (NULL); + if (S_ISCHR(devstat.st_mode) || S_ISBLK(devstat.st_mode)) + isdev = 1; + else + isdev = 0; + mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); + for (i = 0; i < mntsize; i++) { + statfsp = &mntbuf[i]; + ddevname = statfsp->f_mntfromname; + if (*ddevname != '/') { + if (strlen(_PATH_DEV) + strlen(ddevname) + 1 > + sizeof(statfsp->f_mntfromname)) + continue; + strcpy(device, _PATH_DEV); + strcat(device, ddevname); + strcpy(statfsp->f_mntfromname, device); + } + if (isdev == 0) { + if (strcmp(name, statfsp->f_mntonname)) + continue; + return (statfsp); + } + if (stat(ddevname, &mntdevstat) == 0 && + mntdevstat.st_rdev == devstat.st_rdev) + return (statfsp); + } + return (NULL); +} + +/* + * If possible reload a mounted filesystem. + * When prtmsg != NULL print a warning if a reload is attempted, but fails. + * Return 0 on success, 1 on failure. + */ +int +chkdoreload(struct statfs *mntp, + void (*prtmsg)(const char *, ...) __printflike(1,2)) +{ + struct iovec *iov; + int iovlen, error; + char errmsg[255]; + + /* + * If the filesystem is not mounted it does not need to be reloaded. + * If it is mounted for writing, then it could not have been opened + * for writing by a utility, so does not need to be reloaded. + */ + if (mntp == NULL || (mntp->f_flags & MNT_RDONLY) == 0) + return (0); + + /* + * We modified a mounted file system. Do a mount update on + * it so we can continue using it as safely as possible. + */ + iov = NULL; + iovlen = 0; + errmsg[0] = '\0'; + build_iovec(&iov, &iovlen, "fstype", __DECONST(void *, "ffs"), 4); + build_iovec(&iov, &iovlen, "from", mntp->f_mntfromname, (size_t)-1); + build_iovec(&iov, &iovlen, "fspath", mntp->f_mntonname, (size_t)-1); + build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); + build_iovec(&iov, &iovlen, "update", NULL, 0); + build_iovec(&iov, &iovlen, "reload", NULL, 0); + /* + * XX: We need the following line until we clean up + * nmount parsing of root mounts and NFS root mounts. + */ + build_iovec(&iov, &iovlen, "ro", NULL, 0); + error = nmount(iov, iovlen, mntp->f_flags); + free_iovec(&iov, &iovlen); + if (error == 0) + return (0); + if (prtmsg != NULL) + prtmsg("mount reload of '%s' failed: %s %s\n\n", + mntp->f_mntonname, strerror(errno), errmsg); + return (1); +} + void build_iovec(struct iovec **iov, int *iovlen, const char *name, void *val, size_t len) @@ -207,7 +300,7 @@ free_iovec(struct iovec **iov, int *iovlen) { int i; - for (i = 0; i < *iovlen; i++) + for (i = 0; i < *iovlen; i += 2) free((*iov)[i].iov_base); free(*iov); } diff --git a/sbin/mount/mntopts.3 b/sbin/mount/mntopts.3 new file mode 100644 index 000000000000..782acabef1a0 --- /dev/null +++ b/sbin/mount/mntopts.3 @@ -0,0 +1,381 @@ +.\" Copyright (c) 2023 Marshall Kirk McKusick +.\" Copyright (c) 1994 The Regents of the University of California. +.\" +.\" 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. +.\" +.\" @(#)getmntopts.3 8.3 (Berkeley) 3/30/95 +.\" +.Dd January 19, 2023 +.Dt MNTOPTS 3 +.Os +.Sh NAME +.Nm getmntopts , +.Nm getmntpoint , +.Nm chkdoreload , +.Nm build_iovec , +.Nm build_iovec_argf , +.Nm free_iovec , +.Nm checkpath , +.Nm rmslashes +.Nd "mount point operations" +.Sh SYNOPSIS +.In mntopts.h +.Ft void +.Fo getmntopts +.Fa "const char *options" "const struct mntopt *mopts" +.Fa "int *flagp" "int *altflagp" +.Fc +.Ft struct statfs * +.Fn getmntpoint "const char *name" +.Ft int +.Fo chkdoreload +.Fa "struct statfs *mntp" +.Fa "void (*prtmsg)(const char *fmt, ...)" +.Fc +.Ft void +.Fo build_iovec +.Fa "struct iovec **iov" "int *iovlen" "const char *name" "void *val" +.Fa "size_t len" +.Fc +.Ft void +.Fo build_iovec_argf +.Fa "struct iovec **iov" "int *iovlen" "const char *name" +.Fa "const char *fmt" "..." +.Fc +.Ft void +.Fn free_iovec "struct iovec **iov" "int *iovlen" +.Ft int +.Fn checkpath "const char *path" "char *resolved" +.Ft void +.Fn rmslashes "char *rrpin" "char *rrpout" +.Sh DESCRIPTION +The +.Nm mntopts +functions support operations associated with a mount point. +For historic reasons are in a file in the sources for the +.Xr mount 8 +program. +Thus, to access them the following lines need to be added to the +.Nm Makefile +of the program wanting to use them: +.Bd -literal +SRCS+= getmntopts.c +MOUNT= ${SRCTOP}/sbin/mount +CFLAGS+= -I${MOUNT} +\&.PATH: ${MOUNT} +.Ed +.Pp +The +.Fn getmntopts +function takes a comma separated option list and a list +of valid option names, and computes the bitmask +corresponding to the requested set of options. +.Pp +The string +.Fa options +is broken down into a sequence of comma separated tokens. +Each token is looked up in the table described by +.Fa mopts +and the bits in +the word referenced by either +.Fa flagp +or +.Fa altflagp +(depending on the +.Va m_altloc +field of the option's table entry) +are updated. +The flag words are not initialized by +.Fn getmntopts . +The table, +.Fa mopts , +has the following format: +.Bd -literal +struct mntopt { + char *m_option; /* option name */ + int m_inverse; /* is this a negative option, e.g., "dev" */ + int m_flag; /* bit to set, e.g., MNT_RDONLY */ + int m_altloc; /* non-zero to use altflagp rather than flagp */ +}; +.Ed +.Pp +The members of this structure are: +.Bl -tag -width m_inverse +.It Va m_option +the option name, +for example +.Dq Li suid . +.It Va m_inverse +tells +.Fn getmntopts +that the name has the inverse meaning of the +bit. +For example, +.Dq Li suid +is the string, whereas the +mount flag is +.Dv MNT_NOSUID . +In this case, the sense of the string and the flag +are inverted, so the +.Va m_inverse +flag should be set. +.It Va m_flag +the value of the bit to be set or cleared in +the flag word when the option is recognized. +The bit is set when the option is discovered, +but cleared if the option name was preceded +by the letters +.Dq Li no . +The +.Va m_inverse +flag causes these two operations to be reversed. +.It Va m_altloc +the bit should be set or cleared in +.Fa altflagp +rather than +.Fa flagp . +.El +.Pp +Each of the user visible +.Dv MNT_ +flags has a corresponding +.Dv MOPT_ +macro which defines an appropriate +.Vt "struct mntopt" +entry. +To simplify the program interface and ensure consistency across all +programs, a general purpose macro, +.Dv MOPT_STDOPTS , +is defined which +contains an entry for all the generic VFS options. +In addition, the macros +.Dv MOPT_FORCE +and +.Dv MOPT_UPDATE +exist to enable the +.Dv MNT_FORCE +and +.Dv MNT_UPDATE +flags to be set. +Finally, the table must be terminated by an entry with a +.Dv NULL +first element. +.Pp +The +.Fn getmntpoint +function takes the pathname of a possible mount point +or of a device (with or without +.Pa /dev/ +prepended to it). +If the pathname is a directory or a file, +.Fn getmntpoint +checks to see if the mount point currently has a filesystem +mounted on it. +If the pathname is a device, +.Fn getmntpoint +checks to see if it is currently mounted. +If there is an associated mount, a pointer to a +.Vt "struct statfs" *** 319 LINES SKIPPED *** From nobody Mon Feb 6 23:17:57 2023 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 4P9hxy0nxcz3nZ5v; Mon, 6 Feb 2023 23:17: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 4P9hxy0312z4P5Z; Mon, 6 Feb 2023 23:17:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675725478; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rNRzaSQwienUexRunZrSvg2MlZRzi2iaqB5PFYaLF9I=; b=hOKvQ7B2FyYGyIhmILluQsn/TqMZyN4tgKsrKTxmitRZMJSQdJzdbNlZ33V5EhJEIksdIP ysPOlER+5g1762qqwlGrOBdFBlFdOqHRCD46l3QqKlHF0ZCh7EV/UQI0N+gRxtfxCaH6DT +qI9kzXgeDKrZ0DijO5oZMv0A44r3pAIGfrsaYt69a3QImerLiC0E/Ba7ZP1RZn5ILAJ7j 4/stYQz8x16l5/g9NB3rxkO+9i51TBKojw2jQ8aK9VNqahD/QXGXFUy0vRQZ0mCE06yZ8Q CSkB3zbwzTwwLlItYgvlhboxGIn7IWIky7PHJwjo0rRNWgybFxh4rh4zZdwMGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675725478; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rNRzaSQwienUexRunZrSvg2MlZRzi2iaqB5PFYaLF9I=; b=Vlqg6WZf5ZFRfQ+hx2D4l7zKpZ0K9Sm4OijXRUfI6wVmWcHsfA1w3dFjC0A87Lh88NgYrV 8DS+1UikgqXB2cfM6UW0WqvrmQ1aeQzFuVD2sCT6rClt61vtvdIBS8m42dS0cA70ILaOt6 PWHR4oSpI+cr+hTsL7hfKm/jTrICMhUuMMtUPGF2IhgY0Q83R3pdOURQBB2pFEameg9LXw gq82q65jcj/Q2x9Db+0sAiUThxBKsn04QwSYmsHVkVp+TE3J1jnUVm7pxvstqbwmZ5tFa2 Wfk2BVFYxCace4jqi+gAHeLLnviH3XMc/STTi0zHn/A9gpQIAFHKd2jmZNMQPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675725478; a=rsa-sha256; cv=none; b=VrOLiV6IUHluTHNt2HBvY3vQT8rBYieBB5p/ulFTuW5udaJXlsSsoW4b6+LcxwPd+OkTbZ eVMDc0gdEnH8g9wEQ8yyrQauyXBQWlIN6sATPV5O5y52MRUqmhenXiG0sMIdG+lAdpTBsj rVYsg0zzFh+spFafAMF1WqbJr5TG5udA8UxY14zmYC5CY9oFx37XPIkgnnP6xNAwwdqSBf msoX7scZdb1081OrpcTu6iB/4U3hGMIknHJgFp6UZ8ARdhyAjE483S0TvZ7lJEntEU/u+c SCzh0IjpOWyfoQuudazUeCkaDmKhVev2Q0uB7a6hy68rswFPpCozFjTyr2RvhQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P9hxx63N5ztWW; Mon, 6 Feb 2023 23:17:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 316NHvJX037625; Mon, 6 Feb 2023 23:17:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 316NHvDl037624; Mon, 6 Feb 2023 23:17:57 GMT (envelope-from git) Date: Mon, 6 Feb 2023 23:17:57 GMT Message-Id: <202302062317.316NHvDl037624@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: e11fe183004b - stable/13 - Rewrite to avoid Coverity false positive. 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: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e11fe183004beaba7ec25b120c7394732fdef680 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=e11fe183004beaba7ec25b120c7394732fdef680 commit e11fe183004beaba7ec25b120c7394732fdef680 Author: Kirk McKusick AuthorDate: 2023-01-26 00:57:26 +0000 Commit: Kirk McKusick CommitDate: 2023-02-06 23:17:39 +0000 Rewrite to avoid Coverity false positive. Reported by: Coverity (CID 1502669) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37907 (cherry picked from commit 0bd4c448ec1dfdc2300a6cacca42e1fc7c4d8f14) --- sbin/mount/getmntopts.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sbin/mount/getmntopts.c b/sbin/mount/getmntopts.c index e6607c385341..7702da903749 100644 --- a/sbin/mount/getmntopts.c +++ b/sbin/mount/getmntopts.c @@ -166,6 +166,7 @@ getmntpoint(const char *name) char *ddevname; struct statfs *mntbuf, *statfsp; int i, mntsize, isdev; + u_long len; if (stat(name, &devstat) != 0) return (NULL); @@ -178,12 +179,13 @@ getmntpoint(const char *name) statfsp = &mntbuf[i]; ddevname = statfsp->f_mntfromname; if (*ddevname != '/') { - if (strlen(_PATH_DEV) + strlen(ddevname) + 1 > - sizeof(statfsp->f_mntfromname)) + if ((len = strlen(_PATH_DEV) + strlen(ddevname) + 1) > + sizeof(statfsp->f_mntfromname) || + len > sizeof(device)) continue; - strcpy(device, _PATH_DEV); - strcat(device, ddevname); - strcpy(statfsp->f_mntfromname, device); + strncpy(device, _PATH_DEV, len); + strncat(device, ddevname, len); + strncpy(statfsp->f_mntfromname, device, len); } if (isdev == 0) { if (strcmp(name, statfsp->f_mntonname)) From nobody Mon Feb 6 23:17:58 2023 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 4P9hxz1yYvz3nZ8Q; Mon, 6 Feb 2023 23:17: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 4P9hxz1JSpz4Nsj; Mon, 6 Feb 2023 23:17:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675725479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ggA6UXotCOkGyAPu8JMD4AXoRBKvavQL7QTRkH404DQ=; b=SPNZf6gsY2f0SY3fpCcRWM7NwzcefZufS2M+RbMOj3mCwtpnpjRXOGeloCU13Ll1XKOww2 E8ZC9Rive32212z7XMLPDkJO/aYpwyqLRSOfIvKMW60bZN2Vh7CP5GD2kcfgKyjvftvVQQ fi4jTgqvBl2AgZgpHWVrJJS5WPhanrD2ddXk08JgbuIwlJDcMMWsYvpVc0OuHjIN5O4MWf 4tqp0mwrHELkYqfmfCHYhrEw820T5oqO2vu8jgZ0c5PKs2NBxrzdsNc3dGTEa0voQm7OGH LIhPyK6C0359Mtr28orFTtnUc31tBsy/ptQplMvo3pvEyyinTDQA+yOv7UXnWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675725479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ggA6UXotCOkGyAPu8JMD4AXoRBKvavQL7QTRkH404DQ=; b=gvtY/p74ffdtrO/pBmLxBdy97pg6Ymu+WfAFuXHpFINFTxYvrVUFCJJ+6FE9d+cgmdxcuL nJ/3LCACuAEyll9o7P2RfSqtNIrmR6b3EGeqXFazF+38urh0YCemVt0GsfXxjbdLXGDCua DIsej3XhrMVp+vIxJuuoVVgONRUwJducrtDwsupoIV99LDDIdj26vYseIyLP3S5jMhefa/ Uw70ekMV94zpSMK8LG8KpI225m/e/9nokR4O2HBN/3D35eWfTmlDk5njnpJOTKwOT9mu1e 6FrU/Ik4lGZCoMqwNm/RCcK4dSDXA7oxBC1DT79LNOV+O/p5Bgwf5AWZrD8gAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675725479; a=rsa-sha256; cv=none; b=CJg40k+ge41NRxdgo98Oc42rpq9GkTMYwjEteOz27sqinImb/EfbDVSvpYl8cne6M4cVbf IBHIKcedeGSd4C/h18pnN3nnIk17vzeDeA7O+IFcFuqPPa5kTSs3NSVXGbLLCB0I7TTepP yGqlEtHxMObVWuhJ8C/vaylcKUbENMh8/Z0BjcaW+eKOhUH0zNTF1apjDJKANOcB777dT2 SvS4YVVdoyF/IMuFaoA2OyUaW78QHl2uEtVG8/qzVfYHUVwr0OhvA9NGYIQi7N59+9+v0v 2awQKE2j1J9bDbbpGw1TeCNwYfD34C4HiTy5otIo8mUFfMK95+FKstD5J8cvfA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P9hxy70L0ztft; Mon, 6 Feb 2023 23:17:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 316NHw6G037650; Mon, 6 Feb 2023 23:17:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 316NHwf3037649; Mon, 6 Feb 2023 23:17:58 GMT (envelope-from git) Date: Mon, 6 Feb 2023 23:17:58 GMT Message-Id: <202302062317.316NHwf3037649@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 975ebddbf547 - stable/13 - Fix for getmntpoint(3) when checking for NFS mount points. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 975ebddbf5475cbe7748a37cd0308606525f9956 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=975ebddbf5475cbe7748a37cd0308606525f9956 commit 975ebddbf5475cbe7748a37cd0308606525f9956 Author: Kirk McKusick AuthorDate: 2023-01-29 23:12:48 +0000 Commit: Kirk McKusick CommitDate: 2023-02-06 23:17:39 +0000 Fix for getmntpoint(3) when checking for NFS mount points. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37907 (cherry picked from commit ad055467bec35885dc3eff2f4dd765f5b2f53259) --- sbin/mount/getmntopts.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sbin/mount/getmntopts.c b/sbin/mount/getmntopts.c index 7702da903749..3a5cac0d9bac 100644 --- a/sbin/mount/getmntopts.c +++ b/sbin/mount/getmntopts.c @@ -177,6 +177,11 @@ getmntpoint(const char *name) mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); for (i = 0; i < mntsize; i++) { statfsp = &mntbuf[i]; + if (isdev == 0) { + if (strcmp(name, statfsp->f_mntonname)) + continue; + return (statfsp); + } ddevname = statfsp->f_mntfromname; if (*ddevname != '/') { if ((len = strlen(_PATH_DEV) + strlen(ddevname) + 1) > @@ -185,12 +190,8 @@ getmntpoint(const char *name) continue; strncpy(device, _PATH_DEV, len); strncat(device, ddevname, len); - strncpy(statfsp->f_mntfromname, device, len); - } - if (isdev == 0) { - if (strcmp(name, statfsp->f_mntonname)) - continue; - return (statfsp); + if (stat(device, &mntdevstat) == 0) + strncpy(statfsp->f_mntfromname, device, len); } if (stat(ddevname, &mntdevstat) == 0 && mntdevstat.st_rdev == devstat.st_rdev) From nobody Tue Feb 7 00:16:16 2023 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 4P9kFD2yW0z3ncqv; Tue, 7 Feb 2023 00:16: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 4P9kFD2PdXz3DrF; Tue, 7 Feb 2023 00:16:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675728976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FBFoD/TyFWGUGBEszyDrG9rfCJFiR1Aw6CVe3q7977M=; b=pkqXIKKKuuQCGs7RrUh/ohYtdyzltKBAjuJ1AuntRs/UuaRY/T5SpPwgPTsyzwM7VDMCqS lwxRSibkCSUXUk8cKWhX/25tsycHhU6wE2TP5sRqfqbzA3MwcRMSW/gVSdEstzwaPiChgJ yCQwvL1Rwg6iuafLVxImtIHk6npn8UtbnDynIA7gRXZ8kK/o6IN/1D2c4CwPmNFwUu3YAF wg88VEC5hGDqVGU2ISOCYYarBU4PCaWLh6j03nfj1jTPp1Sm4c9DXhhiCgA+D71SvVqxUc OQaQN+MhOMK7pxGpZ28GXy6bOdbELQlGgKsGStKLOGo6cnfrbE2QX8na/VDCTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675728976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FBFoD/TyFWGUGBEszyDrG9rfCJFiR1Aw6CVe3q7977M=; b=kKe4T/TEtFNGCF/8fB5sNRa7J4s2cyPr+5cCW0nz+Zw8I/Pnbq8F3FuXnEvOAXgv3xjgIs aCopg19ac87ZFrMf6ZppMdhHgktHMgPauD67f2OR6sUNYLXgI8Ys8Fh9mElTN1QrJFWNRk BKnaUBUecZywT1wNlVsohI9YVBH0iPCxQGL56l8vihDgCQgS/wirlvX+58/VK0L97tmL2f NxHMZ9I53UPNyUS+qa6HLJNi2M5x44Sxc8apAqlnELMFNN/EQj7WNWGjVZK8AaOFq31HiO i29vX+RqCBFsgZQ145+qLPbnkiH+hemW1hlazgdbwURpf+WgQ66HFGPmQbwd5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675728976; a=rsa-sha256; cv=none; b=tjXjbuddTZezp2cvXv/2YZjNqhY4CWjQHaN3O16FB5U83HpGWe3eCYLL97+r+CTJHsjmhL 1amwzAyJiYsoLvGPiQlSlc/tqg4N07x50Yo4tkkPQ2iO6MIFNYvN8LXDUVdsUxBGfQPOv7 HM2+JMxeTDDCnfI+gtq+lQfkDm7udrCRrfit4ylggrZae6bHFtYTfn4vEgwLZA6+eot3BO yZag2byfXAadj0W/AVsu+4A2ygGpQptKLPZa288wjEe5vMGRIh4QNminkBq2XYcLWsVX46 KdL3eVGJhRuWk6/lxHmKBdX4CIy3Q2/wof8kDL9GPboH1BL7sbZIACz+OzLEwQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P9kFD1QQlzwCc; Tue, 7 Feb 2023 00:16:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3170GGQc022253; Tue, 7 Feb 2023 00:16:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3170GGC4022252; Tue, 7 Feb 2023 00:16:16 GMT (envelope-from git) Date: Tue, 7 Feb 2023 00:16:16 GMT Message-Id: <202302070016.3170GGC4022252@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: 4ad47cfc1458 - stable/13 - iflib: Add null check to iflib_stop() 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: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4ad47cfc1458263564dfecf483c5dfc253008b6f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=4ad47cfc1458263564dfecf483c5dfc253008b6f commit 4ad47cfc1458263564dfecf483c5dfc253008b6f Author: Przemyslaw Lewandowski AuthorDate: 2023-01-24 23:41:15 +0000 Commit: Eric Joyner CommitDate: 2023-02-07 00:16:02 +0000 iflib: Add null check to iflib_stop() Ever since gtaskqueue_drain() was added to iflib_stop(), a kernel panic occurs when the ice(4) driver is in recovery mode. Queues are not initialized in this mode, so gt_taskqueue is not initialized, and gtaskqueue_drain() will panic. Fix this by only doing a drain if an RX queue's gt_taskqueue is initialized. Signed-off-by: Eric Joyner Reviewed by: erj@ MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D37892 (cherry picked from commit 9147969bc277b389a62373c6a5050a2ebfd39071) --- sys/net/iflib.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 39072eedc0bb..748970a58f3f 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -2613,8 +2613,9 @@ iflib_stop(if_ctx_t ctx) bzero((void *)di->idi_vaddr, di->idi_size); } for (i = 0; i < scctx->isc_nrxqsets; i++, rxq++) { - gtaskqueue_drain(rxq->ifr_task.gt_taskqueue, - &rxq->ifr_task.gt_task); + if (rxq->ifr_task.gt_taskqueue != NULL) + gtaskqueue_drain(rxq->ifr_task.gt_taskqueue, + &rxq->ifr_task.gt_task); rxq->ifr_cq_cidx = 0; for (j = 0, di = rxq->ifr_ifdi; j < sctx->isc_nrxqs; j++, di++) From nobody Tue Feb 7 00:32:13 2023 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 4P9kbd5jzvz3nf9w; Tue, 7 Feb 2023 00:32: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 4P9kbd5BKVz3G5y; Tue, 7 Feb 2023 00:32:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675729933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oTlrs3DsQ48KWAeG1aztkX5cQEZthElWAgBXJ2M0q2w=; b=OucLXxUbh0LfMNGeQm3VUBvn6tUneniHLRxxRIYa59zJT16RmI8JlpJ5cUR1b9dXNanfrL Vtu2jrobB8s6Tmma21hHSAoZ3Z2NkQL4DQqldAteVdBqSlC5hvP58PK6ld1on5rmfctisH pjY7KTZY4gtxtf4Syv0Kb84B4jMTNXRuEB1kv7dgDdH9YyC6211Usk7cq4tDTykSQPWZCV zyZXmTVUDDhh64qvm0Da+vDiemy4RCPfLIWiANNGs2Z/XloYWLPOtU6wykYFVdgDJ00zXn Y6N/I9r59sALOOpgZt/jGdyppIHXSqqjGwnxeVa1OUUlT1KVRMb/Z5eaPzWp9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675729933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oTlrs3DsQ48KWAeG1aztkX5cQEZthElWAgBXJ2M0q2w=; b=r3j7DfFnG9GUdqDORmLMSA3LmxYNsr8IXLOku47MOR8tB8t4wHqYLf1RfyRQGacwRKw8+2 qx14enCuVHe9yPq84f7g6F214gBFCwzTj4o2klvq2jVfZUgy19vBAh5yJFnCAPpVcJT3q8 pxw4BRIo9ahodNaMcyd/uf5AGaBvJlZ2YiW6nNjBDkiAE7nvZAx6Z8z417f86ACtr22I6U PBPfYrO32ba1FvIwX7H2SrJ1KoMAkMpfOf+8qg4PaGEe0NoGiWj9OnGqc4iFfhocHQnYXV pzdKFPNER1hyqippMv026tRAs+xjvw3G3kpEMKUQOZ8YBKMUGTtdvYeVrOTMaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675729933; a=rsa-sha256; cv=none; b=Vhnb1S5NI4MQwGzMuqqONaZ0EFM8f9BE+06J6RARrNTWDiviWBjlxuRUTJcbq75r3+s5jq ScSdEl5FeGe4xmhfxnvirkd6kOs3xv+YCpR94nShNPrVvDVXWqlpcvGpvWN6RjGAvkWtdR oj75baTC6Mwcnerrg5FJre7ht40+Eqoo21KfXaCVZ1GNgqcRI/1LTOBO828SH5+QUJUoBy wkaCKjseRg9/WIUDwAwUG8eqBQQy3dmAXH+aKUkt7uiPcfuWXffx39TEe7jiS95EuqUVZO dr00laiiiELBL56hzs4HcM0ISsMO2A9tLIB4zJ+W7jQJWAaPGSgfcK7tFcmd+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 4P9kbd4G8vzwS2; Tue, 7 Feb 2023 00:32:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3170WDHr050463; Tue, 7 Feb 2023 00:32:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3170WDZi050462; Tue, 7 Feb 2023 00:32:13 GMT (envelope-from git) Date: Tue, 7 Feb 2023 00:32:13 GMT Message-Id: <202302070032.3170WDZi050462@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: c907f13af0e6 - stable/12 - iflib: Add null check to iflib_stop() 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: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: c907f13af0e66ea7f3112a06716d4ed6e04da258 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=c907f13af0e66ea7f3112a06716d4ed6e04da258 commit c907f13af0e66ea7f3112a06716d4ed6e04da258 Author: Przemyslaw Lewandowski AuthorDate: 2023-01-24 23:41:15 +0000 Commit: Eric Joyner CommitDate: 2023-02-07 00:24:10 +0000 iflib: Add null check to iflib_stop() Ever since gtaskqueue_drain() was added to iflib_stop(), a kernel panic occurs when the ice(4) driver is in recovery mode. Queues are not initialized in this mode, so gt_taskqueue is not initialized, and gtaskqueue_drain() will panic. Fix this by only doing a drain if an RX queue's gt_taskqueue is initialized. Signed-off-by: Eric Joyner Reviewed by: erj@ MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D37892 (cherry picked from commit 9147969bc277b389a62373c6a5050a2ebfd39071) --- sys/net/iflib.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 869985857e4b..3690be2b2a77 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -2692,8 +2692,9 @@ iflib_stop(if_ctx_t ctx) bzero((void *)di->idi_vaddr, di->idi_size); } for (i = 0; i < scctx->isc_nrxqsets; i++, rxq++) { - gtaskqueue_drain(rxq->ifr_task.gt_taskqueue, - &rxq->ifr_task.gt_task); + if (rxq->ifr_task.gt_taskqueue != NULL) + gtaskqueue_drain(rxq->ifr_task.gt_taskqueue, + &rxq->ifr_task.gt_task); rxq->ifr_cq_cidx = 0; for (j = 0, di = rxq->ifr_ifdi; j < sctx->isc_nrxqs; j++, di++) From nobody Tue Feb 7 16:35:04 2023 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 4PB7yc5nmHz3nQfH; Tue, 7 Feb 2023 16:35: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 4PB7yc5Yb6z455j; Tue, 7 Feb 2023 16:35:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675787704; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RQjYKurHKTTcACR6KyzLS/HWXr85haxus11i7AnzZeY=; b=WvHxw0Nw7rdx4sr7FDFvAQskQZh/6jS/HdHlnn1Rq/2hJcWEuwsXaeChrBdeAxm1TOO4Pj zEZEATjc2B9DzsTBYbDfZtWckNv2/hIT8c+4GlyuOk/tyHJLo/oB7v9zIhR4m6R085e+h+ SLXSTm/gyArLIrkxzETQHFoTjAIsSGGQMNPCfjeR7i96Iv4mrvbHkaa7rkOWOcK6r3vS6Z t1D3x7aFq5I7ENWUDuIT25DcmKiCGWl1mnHZPMKPKVEY9buq5fylrPwWF9/RAhGPNDVGIY E77Vjq49Zj2FY3WFoEQ01kdxhlJ8U1s6aCRu13MmVG8hZ/jwi3Zeb5HjFudc1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675787704; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RQjYKurHKTTcACR6KyzLS/HWXr85haxus11i7AnzZeY=; b=BlDjAwYoZRlQGYuTysLNKVM9Pk34HykZTntbgY4hnzLBNKSWC/IstijIr5yFTZn6Qo24qs dONSaIm3oe+dCfwMe8KrYut5FpDT07cl7k69A87OQtDOc7M30o57A4B0tCNAhiGPnvFTsR 5fU30g36JG5IzDbS/oavgYO7xrfRs5uZSpslY9ry1BLMormJhrbEVOXMVjGQt3VNvkCThY yccPxpLeBm9SjDwVc/by/SYhQhWs3x5iB+cuHpccBKzggIKJqRNjmYh0yC5CCY/1nxyooQ IoBLdPE+T6VYbJf4UsgkjqgjCDRlbrUF+592lLm65rGuO18u43YMw71DorphSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675787704; a=rsa-sha256; cv=none; b=IJppZQRQbcufWTlpp1RvIA5c7tjlnoE8nyO6XO8w7mufB/sP9gVFYjyotETVQOGRrsRdHR PDfXNP9MxbnZMMtqypiLo7MVuyjL0isx/tYetZv4kp/2vDvUzHym6/fhglZsFFWxLwBAZc lCEBgFJTHqpgMrhjVMcAOEML48hDxZrGYvvHusAs/XYIWQGO45Oikt5B/pDS3K0xdNrtf6 dLJmZgf0QPnZlr+KBWiyVLcovCkSmouIjdLTdo9piIsmt/gV+0s4gRMagTOkdaBH64M0LP G6RZjYrPtijjqEJV1Qbyb8Glifo8hcvfZFOZUnUVSUakGxBZ5a3NpC2ZGy4QyA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PB7yc4d51zNgM; Tue, 7 Feb 2023 16:35:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 317GZ4FN017871; Tue, 7 Feb 2023 16:35:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 317GZ4q6017870; Tue, 7 Feb 2023 16:35:04 GMT (envelope-from git) Date: Tue, 7 Feb 2023 16:35:04 GMT Message-Id: <202302071635.317GZ4q6017870@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Stefan=20E=C3=9Fer?= Subject: git: 6b05c3fc615b - stable/13 - contrib/bc: update to version 6.2.2 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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: se X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6b05c3fc615bbbb1f28ecd2533711122d7e16fc4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=6b05c3fc615bbbb1f28ecd2533711122d7e16fc4 commit 6b05c3fc615bbbb1f28ecd2533711122d7e16fc4 Author: Stefan Eßer AuthorDate: 2022-03-07 22:23:56 +0000 Commit: Stefan Eßer CommitDate: 2023-02-07 16:34:03 +0000 contrib/bc: update to version 6.2.2 This is a squashed commit that updates bc from version 5.2.2 to version 6.2.2: contrib/bc: update to version 5.2.3 This version fixes a parse error when passing a file to bc using -f if that file has a multiline comment or string in it. Merge commit '3673adf1ee311d6f83176d3e43cf0efb314764e4' (cherry picked from commit 23210c9f42af94dc6bcdae3996d8a3d010dd6bfe) contrib/bc: include assert.h when building with C11 or newer This chunk should have been committed with the MFV commit 23210c9f42af94dc but was missing for an unknown reasn. (cherry picked from commit b66d67d97aa58d0f239056917bbdbab26f41446a) contrib/bc: import version 5.2.4 This update fixes an issue in input line editing: when going left to the start of the line, the cursor would jump to the end of the line instead. Merge commit 'bc75dcc4ce682562390fa32e7cd63c08160e21b9' (cherry picked from commit b85b9c88eb02298ea7fa3885619f54ac0e930ba4) vendor/bc: import of version 5.2.5 This is a production release that fixes this bc's behavior on ^D to match GNU bc. (cherry picked from commit ed0603704174b01c25b49efc08c82e1532dc5622) (cherry picked from commit f4ff1c300ef4081696bdd6ad34547be9242e419c) usr.bin/bc: update to version 5.3.1 This version adds support for command line editing and history using the libedit or readline libraries in addition to the line editing features available in previous versions. The version in the base system is configured to use libedit. This allows to choose between emacs and vi line editing commands and to use command overrides via a ~/.editrc file. Merge commit 'bd54318046bfee055b140705a5cfd4148e78da07' (cherry picked from commit 78bc019d220e05abb5b12f678f9b4a847019bbcc) contrib/bc: merge from vendor release 5.3.3 This update fixes a build issue of release 5.3.2 on the FreeBSD base system. Merge commit '3f739b0595b7d6ac4bac9aaa1cae0910f11f92e2' (cherry picked from commit f53b5fe7865f4e4240e40ba0f6345f81d337a823) vendor/bc: update to upstream commit ca53adf83b7a The filter_text function in scripts/functions.sh in version 5.3.3 had commented out a "rm" command, probably for debugging purposes. This caused temporary files to persist in /tmp when the bc program had been built. This commit fixes the build process with no change of the resulting artefacts. (cherry picked from commit 1576f66712876ee8b0fcc8b35fb062e1813b4fc0) (cherry picked from commit f6ed05f1233043eb30a7e5a1efcb7247ad2add90) contrib/bc: merge from vendor release 6.2.2 This update fixes a few issues in history editing and the processing of the "quit" function. The "quit" function will no longer cause bc to exit when encountered in a script file (before any command from the script has been executed). New functions is_number(), is_string return 1 if the passed argument is a number resp. a string. The asciify() function has been extended to support the conversion of an array of numbers into a string. Merge commit '1a63323d17fedb05b6962853e821c9d7c6b9853e' (cherry picked from commit d101cdd6edd782f6ec56eef63ed91abd77a8b317) --- contrib/bc/.gitignore | 80 -- contrib/bc/LICENSE.md | 6 +- contrib/bc/MEMORY_BUGS.md | 53 + contrib/bc/Makefile.in | 33 +- contrib/bc/NEWS.md | 193 +++ contrib/bc/NOTICE.md | 2 +- contrib/bc/README.md | 95 +- contrib/bc/configure.sh | 421 +++++- contrib/bc/gen/bc_help.txt | 66 +- contrib/bc/gen/dc_help.txt | 64 +- contrib/bc/gen/lib.bc | 3 +- contrib/bc/gen/lib2.bc | 15 +- contrib/bc/gen/strgen.c | 310 ++++- contrib/bc/gen/strgen.sh | 35 +- contrib/bc/include/args.h | 33 +- contrib/bc/include/bc.h | 71 +- contrib/bc/include/bcl.h | 305 ++-- contrib/bc/include/dc.h | 17 +- contrib/bc/include/file.h | 100 +- contrib/bc/include/history.h | 165 ++- contrib/bc/include/lang.h | 129 +- contrib/bc/include/lex.h | 101 +- contrib/bc/include/library.h | 198 +-- contrib/bc/include/num.h | 175 ++- contrib/bc/include/opt.h | 26 +- contrib/bc/include/parse.h | 83 +- contrib/bc/include/program.h | 1153 +++++++++------- contrib/bc/include/rand.h | 50 +- contrib/bc/include/read.h | 14 +- contrib/bc/include/status.h | 490 +++++-- contrib/bc/include/vector.h | 120 +- contrib/bc/include/version.h | 4 +- contrib/bc/include/vm.h | 450 ++++-- contrib/bc/locales/de_DE.ISO8859-1.msg | 17 +- contrib/bc/locales/de_DE.UTF-8.msg | 17 +- contrib/bc/locales/en_US.msg | 21 +- contrib/bc/locales/es_ES.ISO8859-1.msg | 17 +- contrib/bc/locales/es_ES.UTF-8.msg | 17 +- contrib/bc/locales/fr_FR.ISO8859-1.msg | 17 +- contrib/bc/locales/fr_FR.UTF-8.msg | 17 +- contrib/bc/locales/ja_JP.UTF-8.msg | 17 +- contrib/bc/locales/ja_JP.eucJP.msg | 17 +- contrib/bc/locales/nl_NL.ISO8859-1.msg | 17 +- contrib/bc/locales/nl_NL.UTF-8.msg | 17 +- contrib/bc/locales/pl_PL.ISO8859-2.msg | 17 +- contrib/bc/locales/pl_PL.UTF-8.msg | 17 +- contrib/bc/locales/pt_PT.ISO8859-1.msg | 17 +- contrib/bc/locales/pt_PT.UTF-8.msg | 17 +- contrib/bc/locales/ru_RU.CP1251.msg | 17 +- contrib/bc/locales/ru_RU.CP866.msg | 17 +- contrib/bc/locales/ru_RU.ISO8859-5.msg | 17 +- contrib/bc/locales/ru_RU.KOI8-R.msg | 17 +- contrib/bc/locales/ru_RU.UTF-8.msg | 17 +- contrib/bc/locales/zh_CN.GB18030.msg | 17 +- contrib/bc/locales/zh_CN.GB2312.msg | 17 +- contrib/bc/locales/zh_CN.GBK.msg | 17 +- contrib/bc/locales/zh_CN.UTF-8.msg | 17 +- contrib/bc/locales/zh_CN.eucCN.msg | 17 +- contrib/bc/manuals/algorithms.md | 2 +- contrib/bc/manuals/bc/A.1 | 433 ++++-- contrib/bc/manuals/bc/A.1.md | 355 +++-- contrib/bc/manuals/bc/E.1 | 404 ++++-- contrib/bc/manuals/bc/E.1.md | 337 +++-- contrib/bc/manuals/bc/EH.1 | 404 ++++-- contrib/bc/manuals/bc/EH.1.md | 337 +++-- contrib/bc/manuals/bc/EHN.1 | 404 ++++-- contrib/bc/manuals/bc/EHN.1.md | 337 +++-- contrib/bc/manuals/bc/EN.1 | 404 ++++-- contrib/bc/manuals/bc/EN.1.md | 337 +++-- contrib/bc/manuals/bc/H.1 | 433 ++++-- contrib/bc/manuals/bc/H.1.md | 355 +++-- contrib/bc/manuals/bc/HN.1 | 433 ++++-- contrib/bc/manuals/bc/HN.1.md | 355 +++-- contrib/bc/manuals/bc/N.1 | 433 ++++-- contrib/bc/manuals/bc/N.1.md | 355 +++-- contrib/bc/manuals/bcl.3 | 211 ++- contrib/bc/manuals/bcl.3.md | 171 ++- contrib/bc/manuals/build.md | 166 ++- contrib/bc/manuals/dc/A.1 | 323 +++-- contrib/bc/manuals/dc/A.1.md | 245 +++- contrib/bc/manuals/dc/E.1 | 308 +++-- contrib/bc/manuals/dc/E.1.md | 236 +++- contrib/bc/manuals/dc/EH.1 | 308 +++-- contrib/bc/manuals/dc/EH.1.md | 236 +++- contrib/bc/manuals/dc/EHN.1 | 308 +++-- contrib/bc/manuals/dc/EHN.1.md | 236 +++- contrib/bc/manuals/dc/EN.1 | 308 +++-- contrib/bc/manuals/dc/EN.1.md | 236 +++- contrib/bc/manuals/dc/H.1 | 323 +++-- contrib/bc/manuals/dc/H.1.md | 245 +++- contrib/bc/manuals/dc/HN.1 | 323 +++-- contrib/bc/manuals/dc/HN.1.md | 245 +++- contrib/bc/manuals/dc/N.1 | 323 +++-- contrib/bc/manuals/dc/N.1.md | 245 +++- contrib/bc/scripts/exec-install.sh | 2 +- contrib/bc/scripts/format.sh | 51 + contrib/bc/scripts/functions.sh | 93 +- contrib/bc/scripts/karatsuba.py | 2 +- contrib/bc/scripts/link.sh | 2 +- contrib/bc/scripts/lint.sh | 63 + contrib/bc/scripts/locale_install.sh | 2 +- contrib/bc/scripts/locale_uninstall.sh | 2 +- contrib/bc/src/args.c | 209 ++- contrib/bc/src/bc.c | 21 +- contrib/bc/src/bc_lex.c | 98 +- contrib/bc/src/bc_parse.c | 880 ++++++++---- contrib/bc/src/data.c | 908 ++++++------ contrib/bc/src/dc.c | 21 +- contrib/bc/src/dc_lex.c | 83 +- contrib/bc/src/dc_parse.c | 181 ++- contrib/bc/src/file.c | 329 +++-- contrib/bc/src/history.c | 951 +++++++++---- contrib/bc/src/lang.c | 138 +- contrib/bc/src/lex.c | 191 ++- contrib/bc/src/library.c | 912 +++++++----- contrib/bc/src/main.c | 33 +- contrib/bc/src/num.c | 1659 ++++++++++++++-------- contrib/bc/src/opt.c | 149 +- contrib/bc/src/parse.c | 136 +- contrib/bc/src/program.c | 1690 +++++++++++++++-------- contrib/bc/src/rand.c | 198 ++- contrib/bc/src/read.c | 133 +- contrib/bc/src/vector.c | 290 ++-- contrib/bc/src/vm.c | 1286 ++++++++++------- contrib/bc/tests/all.sh | 15 +- contrib/bc/tests/bc/all.txt | 7 + contrib/bc/tests/bc/asciify_array.txt | 17 + contrib/bc/tests/bc/asciify_array_results.txt | 3 + contrib/bc/tests/bc/errors/33.txt | 2 + contrib/bc/tests/bc/errors/34.txt | 357 +++++ contrib/bc/tests/bc/errors/35.txt | 1 + contrib/bc/tests/bc/errors/36.txt | 11 + contrib/bc/tests/bc/is_number.txt | 13 + contrib/bc/tests/bc/is_number_results.txt | 10 + contrib/bc/tests/bc/is_string.txt | 13 + contrib/bc/tests/bc/is_string_results.txt | 10 + contrib/bc/tests/bc/line_by_line1.txt | 10 + contrib/bc/tests/bc/line_by_line1_results.txt | 1 + contrib/bc/tests/bc/line_by_line2.txt | 9 + contrib/bc/tests/bc/line_by_line2_results.txt | 3 + contrib/bc/tests/bc/line_loop_quit1.txt | 2 + contrib/bc/tests/bc/line_loop_quit1_results.txt | 4 + contrib/bc/tests/bc/line_loop_quit2.txt | 3 + contrib/bc/tests/bc/line_loop_quit2_results.txt | 4 + contrib/bc/tests/bc/scripts/afl1.bc | 261 ++++ contrib/bc/tests/bc/scripts/afl1.txt | 1571 +++++++++++++++++++++ contrib/bc/tests/bc/scripts/all.txt | 2 + contrib/bc/tests/bc/scripts/array2.bc | 20 + contrib/bc/tests/bc/scripts/array2.txt | 2 + contrib/bc/tests/bc/timeconst.sh | 2 +- contrib/bc/tests/bcl.c | 76 +- contrib/bc/tests/dc/all.txt | 3 + contrib/bc/tests/dc/errors/15.txt | 128 +- contrib/bc/tests/dc/errors/34.txt | 117 -- contrib/bc/tests/dc/is_number.txt | 9 + contrib/bc/tests/dc/is_number_results.txt | 9 + contrib/bc/tests/dc/is_string.txt | 9 + contrib/bc/tests/dc/is_string_results.txt | 9 + contrib/bc/tests/dc/misc1.txt | 26 + contrib/bc/tests/dc/misc1_results.txt | 21 + contrib/bc/tests/dc/scripts/all.txt | 1 + contrib/bc/tests/dc/scripts/no_clamp.dc | 29 + contrib/bc/tests/dc/scripts/no_clamp.txt | 29 + contrib/bc/tests/error.sh | 48 +- contrib/bc/tests/errors.sh | 2 +- contrib/bc/tests/history.py | 19 +- contrib/bc/tests/history.sh | 2 +- contrib/bc/tests/other.sh | 151 +- contrib/bc/tests/read.sh | 2 +- contrib/bc/tests/script.sh | 23 +- contrib/bc/tests/scripts.sh | 2 +- contrib/bc/tests/stdin.sh | 2 +- contrib/bc/tests/test.sh | 10 +- contrib/bc/vs/bc.vcxproj | 49 +- usr.bin/gh-bc/Makefile | 11 +- 175 files changed, 21508 insertions(+), 8948 deletions(-) diff --git a/contrib/bc/.gitignore b/contrib/bc/.gitignore deleted file mode 100644 index 31e43aa61efc..000000000000 --- a/contrib/bc/.gitignore +++ /dev/null @@ -1,80 +0,0 @@ -*.config -*.creator -*.files -*.includes -*.creator.user* -*.cflags -*.cxxflags -bin/*bc -bin/*bc.exe -bin/*dc -bin/*dc.exe -bin/bcl -bc.old -*.o -*.a -.log_*.txt -.test.txt -.math.txt -.results.txt -.ops.txt -manuals/bc.1 -manuals/bc.1.ronn -manuals/bc.1.md -manuals/dc.1 -manuals/dc.1.ronn -manuals/dc.1.md -gen/strgen -lib.c -lib2.c -lib3.c -bc_help.c -dc_help.c -config.mak -timeconst.bc -Makefile - -tests/fuzzing/bc_outputs1/* -tests/fuzzing/bc_outputs2/* -tests/fuzzing/bc_outputs3/* -tests/fuzzing/dc_outputs/* -tests/bc_outputs/* -tests/dc_outputs/* - -.gdb_history - -# Ignore the generated test files -parse.txt -parse_results.txt -print.txt -print_results.txt -bessel.txt -bessel_results.txt -prime.txt -strings2.txt -strings2_results.txt -tests/bc/scripts/add.txt -tests/bc/scripts/divide.txt -tests/bc/scripts/multiply.txt -tests/bc/scripts/subtract.txt -tests/bc/scripts/strings2.txt -benchmarks/bc/*.txt -benchmarks/dc/*.txt -scripts/ministat -scripts/bitgen -perf.data -perf.data.old -*.gcda -*.gcno -*.gcov -*.html -*.profraw - -core.* - -cscope*.out -tags - -*.vcxproj.user -Debug/* -Release/* diff --git a/contrib/bc/LICENSE.md b/contrib/bc/LICENSE.md index 8ab2e6069881..8e6b7e0b9051 100644 --- a/contrib/bc/LICENSE.md +++ b/contrib/bc/LICENSE.md @@ -1,6 +1,6 @@ # License -Copyright (c) 2018-2021 Gavin D. Howard +Copyright (c) 2018-2023 Gavin D. Howard Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -31,7 +31,7 @@ copyrights and license: Copyright (c) 2010-2014, Salvatore Sanfilippo
Copyright (c) 2010-2013, Pieter Noordhuis
Copyright (c) 2018 rain-1
-Copyright (c) 2018-2021, Gavin D. Howard +Copyright (c) 2018-2023, Gavin D. Howard Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -60,7 +60,7 @@ The files `src/rand.c` and `include/rand.h` are under the following copyrights and license: Copyright (c) 2014-2017 Melissa O'Neill and PCG Project contributors -Copyright (c) 2018-2021 Gavin D. Howard +Copyright (c) 2018-2023 Gavin D. Howard Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/contrib/bc/MEMORY_BUGS.md b/contrib/bc/MEMORY_BUGS.md new file mode 100644 index 000000000000..d675b28b342a --- /dev/null +++ b/contrib/bc/MEMORY_BUGS.md @@ -0,0 +1,53 @@ +# Memory Bugs + +This is a list of all of the memory bugs that were found in *released* versions +of `bc`, `dc`, or `bcl`. (Non-released commits with memory bugs do not count.) + +I made this list for two reasons: first, so users can know what versions of +`bc`, `dc`, and `bcl` have vulnerabilities, and two, I once had a perfect record +and then found a couple, but forgot and claimed I still had a perfect record +right after, which was embarrassing. + +This list is sorted by the first version a bug exists in, not the last it +existed in. + +* In versions `1.1.0` until `6.2.0` (inclusive) of `bc` and `dc`, there is a + out of bounds read and write in history when pressing ctrl+r (or any other + unused letter) then inserting two characters. + + The first version without this bug is `6.2.1`. + +* In versions `3.0.0` until `6.0.1` (inclusive) of `bc` and `dc`, there is a + double-free on `SIGINT` when using command-line expressions with `-e` and + `-f`. This was caused by not properly ending a jump series. + + The first version without this bug is `6.0.2`. + +* In versions `5.0.0` until `6.0.4` (inclusive) of `bc`, there is an + out-of-bounds access if a non-local (non-`auto`) variable is set to a string + with `asciify()`, then the function is redefined with a use of the same + non-local variable. + + This happened because strings were stored per-function, and the non-local + variable now had a reference to the string in the old function, which could be + at a higher index than exists in the new function. Strings are stored globally + now, and they are *not* freed once not used. + + The first version without this bug is `6.1.0`. + +* In versions `5.0.0` until `6.0.4` (inclusive) of `bc`, there is another + out-of-bounds access if an array is passed to the `asciify()` built-in + function as the only argument. This happened because arrays are allowed as + function arguments, which allowed them to be used as arguments to `asciify()`, + but they should not have been allowed. However, since they were, the + `asciify()` code tried to access an argument that was not there. + + The first version without this bug is `6.1.0`. + +* In version `6.0.0` of `bcl`, there are several uses of initialized data that + have the same root cause: I forgot to call `memset()` on the per-thread global + data. This is because the data used to be *actually* global, which meant that + it was initialized to zero by the system. This happened because I thought I + had properly hooked Valgrind into my `bcl` tests, but I had not. + + The first version without this bug is `6.0.1`. diff --git a/contrib/bc/Makefile.in b/contrib/bc/Makefile.in index b9136a57aa92..83417a333826 100644 --- a/contrib/bc/Makefile.in +++ b/contrib/bc/Makefile.in @@ -1,7 +1,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -55,7 +55,7 @@ HISTORY_HEADERS = $(INCDIR)/history.h EXTRA_MATH_HEADERS = $(INCDIR)/rand.h LIBRARY_HEADERS = $(INCDIR)/bcl.h $(INCDIR)/library.h -GEN_DIR = gen +GEN_DIR = %%GEN_DIR%% GEN = %%GEN%% GEN_EXEC = $(GEN_DIR)/$(GEN) GEN_C = $(GENDIR)/$(GEN).c @@ -146,7 +146,7 @@ BC_ENABLE_HISTORY = %%HISTORY%% BC_ENABLE_EXTRA_MATH_NAME = BC_ENABLE_EXTRA_MATH BC_ENABLE_EXTRA_MATH = %%EXTRA_MATH%% BC_ENABLE_NLS = %%NLS%% -BC_LONG_BIT = %%LONG_BIT%% +BC_EXCLUDE_EXTRA_MATH = %%EXCLUDE_EXTRA_MATH%% BC_ENABLE_AFL = %%FUZZ%% BC_ENABLE_MEMCHECK = %%MEMCHECK%% @@ -160,6 +160,8 @@ BC_DEFAULT_PROMPT = %%BC_DEFAULT_PROMPT%% DC_DEFAULT_PROMPT = %%DC_DEFAULT_PROMPT%% BC_DEFAULT_EXPR_EXIT = %%BC_DEFAULT_EXPR_EXIT%% DC_DEFAULT_EXPR_EXIT = %%DC_DEFAULT_EXPR_EXIT%% +BC_DEFAULT_DIGIT_CLAMP = %%BC_DEFAULT_DIGIT_CLAMP%% +DC_DEFAULT_DIGIT_CLAMP = %%DC_DEFAULT_DIGIT_CLAMP%% RM = rm MKDIR = mkdir @@ -191,17 +193,19 @@ BC_DEFS1 = -DBC_DEFAULT_SIGINT_RESET=$(BC_DEFAULT_SIGINT_RESET) BC_DEFS2 = -DBC_DEFAULT_TTY_MODE=$(BC_DEFAULT_TTY_MODE) BC_DEFS3 = -DBC_DEFAULT_PROMPT=$(BC_DEFAULT_PROMPT) BC_DEFS4 = -DBC_DEFAULT_EXPR_EXIT=$(BC_DEFAULT_EXPR_EXIT) -BC_DEFS = $(BC_DEFS0) $(BC_DEFS1) $(BC_DEFS2) $(BC_DEFS3) $(BC_DEFS4) +BC_DEFS5 = -DBC_DEFAULT_DIGIT_CLAMP=$(BC_DEFAULT_DIGIT_CLAMP) +BC_DEFS = $(BC_DEFS0) $(BC_DEFS1) $(BC_DEFS2) $(BC_DEFS3) $(BC_DEFS4) $(BC_DEFS5) DC_DEFS1 = -DDC_DEFAULT_SIGINT_RESET=$(DC_DEFAULT_SIGINT_RESET) DC_DEFS2 = -DDC_DEFAULT_TTY_MODE=$(DC_DEFAULT_TTY_MODE) DC_DEFS3 = -DDC_DEFAULT_PROMPT=$(DC_DEFAULT_PROMPT) DC_DEFS4 = -DDC_DEFAULT_EXPR_EXIT=$(DC_DEFAULT_EXPR_EXIT) -DC_DEFS = $(DC_DEFS1) $(DC_DEFS2) $(DC_DEFS3) $(DC_DEFS4) +DC_DEFS5 = -DDC_DEFAULT_DIGIT_CLAMP=$(DC_DEFAULT_DIGIT_CLAMP) +DC_DEFS = $(DC_DEFS1) $(DC_DEFS2) $(DC_DEFS3) $(DC_DEFS4) $(DC_DEFS5) CPPFLAGS1 = -D$(BC_ENABLED_NAME)=$(BC_ENABLED) -D$(DC_ENABLED_NAME)=$(DC_ENABLED) CPPFLAGS2 = $(CPPFLAGS1) -I$(INCDIR)/ -DBUILD_TYPE=$(BC_BUILD_TYPE) %%LONG_BIT_DEFINE%% CPPFLAGS3 = $(CPPFLAGS2) -DEXECPREFIX=$(EXEC_PREFIX) -DMAINEXEC=$(MAIN_EXEC) -CPPFLAGS4 = $(CPPFLAGS3) -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 %%BSD%% +CPPFLAGS4 = $(CPPFLAGS3) %%BSD%% CPPFLAGS5 = $(CPPFLAGS4) -DBC_NUM_KARATSUBA_LEN=$(BC_NUM_KARATSUBA_LEN) CPPFLAGS6 = $(CPPFLAGS5) -DBC_ENABLE_NLS=$(BC_ENABLE_NLS) CPPFLAGS7 = $(CPPFLAGS6) -D$(BC_ENABLE_EXTRA_MATH_NAME)=$(BC_ENABLE_EXTRA_MATH) @@ -235,25 +239,25 @@ $(GEN_EXEC): $(GEN_DIR) %%GEN_EXEC_TARGET%% $(BC_LIB_C): $(GEN_EXEC) $(BC_LIB) - $(GEN_EMU) $(GEN_EXEC) $(BC_LIB) $(BC_LIB_C) $(BC_LIB_C_ARGS) + $(GEN_EMU) $(GEN_EXEC) $(BC_LIB) $(BC_LIB_C) $(BC_EXCLUDE_EXTRA_MATH) $(BC_LIB_C_ARGS) $(BC_LIB_O): $(BC_LIB_C) $(CC) $(CFLAGS) -o $@ -c $< $(BC_LIB2_C): $(GEN_EXEC) $(BC_LIB2) - $(GEN_EMU) $(GEN_EXEC) $(BC_LIB2) $(BC_LIB2_C) $(BC_LIB2_C_ARGS) + $(GEN_EMU) $(GEN_EXEC) $(BC_LIB2) $(BC_LIB2_C) $(BC_EXCLUDE_EXTRA_MATH) $(BC_LIB2_C_ARGS) $(BC_LIB2_O): $(BC_LIB2_C) $(CC) $(CFLAGS) -o $@ -c $< $(BC_HELP_C): $(GEN_EXEC) $(BC_HELP) - $(GEN_EMU) $(GEN_EXEC) $(BC_HELP) $(BC_HELP_C) bc_help "" $(BC_ENABLED_NAME) + $(GEN_EMU) $(GEN_EXEC) $(BC_HELP) $(BC_HELP_C) $(BC_EXCLUDE_EXTRA_MATH) bc_help "" $(BC_ENABLED_NAME) $(BC_HELP_O): $(BC_HELP_C) $(CC) $(CFLAGS) -o $@ -c $< $(DC_HELP_C): $(GEN_EXEC) $(DC_HELP) - $(GEN_EMU) $(GEN_EXEC) $(DC_HELP) $(DC_HELP_C) dc_help "" $(DC_ENABLED_NAME) + $(GEN_EMU) $(GEN_EXEC) $(DC_HELP) $(DC_HELP_C) $(BC_EXCLUDE_EXTRA_MATH) dc_help "" $(DC_ENABLED_NAME) $(DC_HELP_O): $(DC_HELP_C) $(CC) $(CFLAGS) -o $@ -c $< @@ -298,11 +302,6 @@ help: @printf ' time_test_dc runs the dc test suite, displaying times for some things\n' @printf ' timeconst runs the test on the Linux timeconst.bc script,\n' @printf ' if it exists and bc has been built\n' - @printf ' valgrind runs the test suite through valgrind\n' - @printf ' valgrind_bc runs the bc test suite, if bc has been built,\n' - @printf ' through valgrind\n' - @printf ' valgrind_dc runs the dc test suite, if dc has been built,\n' - @printf ' through valgrind\n' run_all_tests: bc_all_tests timeconst_all_tests dc_all_tests @@ -501,10 +500,10 @@ test_history_header: @printf '$(TEST_STARS)\n\nRunning history tests...\n\n' library_test: $(LIBBC) - $(CC) $(CFLAGS) $(BCL_TEST_C) $(LIBBC) -o $(BCL_TEST) + $(CC) $(CFLAGS) -lpthread $(BCL_TEST_C) $(LIBBC) -o $(BCL_TEST) test_library: library_test - $(BCL_TEST) + %%BCL_TEST_EXEC%% karatsuba: %%KARATSUBA%% diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md index 9a354e537d9f..36952fdaf582 100644 --- a/contrib/bc/NEWS.md +++ b/contrib/bc/NEWS.md @@ -1,5 +1,198 @@ # News +## 6.2.2 + +This is a production release that fixes a bug. + +The bug was that if an array element was used as a parameter, and then a later +parameter had the same name as the array whose element was used, `bc` would grab +the element from the new array parameter, not the actual element from before the +function call. + +## 6.2.1 + +This is a production release with one bug fix for a memory bug in history. + +## 6.2.0 + +This is a production release with a new feature and a few bug fixes. + +The bug fixes include: + +* A crash when `bc` and `dc` are built using editline, but history is not + activated. +* A missing local in the `uint*()` family of functions in the extended math + library. +* A failure to clear the tail call list in `dc` on error. +* A crash when attempting to swap characters in command-line history when no + characters exist. +* `SIGWINCH` was activated even when history was not. + +The new feature is that stack traces are now given for runtime errors. In debug +mode, the C source file and line of errors are given as well. + +## 6.1.1 + +This is a production release that fixes a build issue with predefined builds and +generated tests. + +## 6.1.0 + +This is a production release that fixes a discrepancy from the `bc` standard, +a couple of memory bugs, and adds new features. + +The discrepancy from the `bc` standard was with regards to the behavior of the +`quit` command. This `bc` used to quit whenever it encountered `quit` during +parsing, even if it was parsing a full file. Now, `bc` only quits when +encountering `quit` *after* it has executed all executable statements up to that +point. + +This behavior is slightly different from GNU `bc`, but users will only notice +the difference if they put `quit` on the same line as other statements. + +The first memory bug could be reproduced by assigning a string to a non-local +variable in a function, then redefining the function with use of the same +non-local variable, which would still refer to a string in the previous version +of the function. + +The second memory bug was caused by passing an array argument to the `asciify()` +built-in function. In certain cases, that was wrongly allowed, and the +interpreter just assumed everything was correct and accessed memory. Now that +arrays are allowed as arguments (see below), this is not an issue. + +The first feature was the addition of the `is_number()` built-in function (`u` +in `dc`) that returns 1 if the runtime argument is a number and 0 otherwise. + +The second feature was the addition of the `is_string()` built-in function (`t` +in `dc`) that returns 1 if the runtime argument is a string and 0 otherwise. + +These features were added because I realized that type-checking is necessary now +that strings can be assigned to variables in `bc` and because they've always +been assignable to variables in `dc`. + +The last added feature is the ability of the `asciify()` built-in function in +`bc` to convert a full array of numbers into a string. This means that +character-by-character printing will not be necessary, and more strings than +just single-character ones will be able to be created. + +## 6.0.4 + +This is a production release that most users will not need to upgrade to. + +This fixes a build bug for `bcl` only on OpenBSD. Users that do not need `bcl` +or have not run into build errors with `bcl` do ***NOT*** need to upgrade. + +## 6.0.3 + +This is a production release that fixes a build bug for cross-compilation. + +Users that do not need cross-compilation do ***NOT*** need to upgrade. + +## 6.0.2 + +This is a production release that fixes two bugs: + +* The `-l` option overrode the `-S` option. +* A double-free and crash when sending a `SIGINT` while executing expressions + given on the command-line. + +## 6.0.1 + +This is a production release that fixes memory bugs and memory leaks in `bcl`. + +Users that do not use `bcl` (use only `bc` and/or `dc`) do ***NOT*** need to +upgrade. + +These happened because I was unaware that the `bcl` test was not hooked into the +Valgrind test infrastructure. Then, when I ran the release script, which tests +everything under Valgrind (or so I thought), it caught nothing, and I thought it +was safe. + +But it was not. + +Nevertheless, I have now run it under Valgrind and fixed all of the memory bugs +(caused by not using `memset()` where I should have but previously didn't have +to) and memory leaks. + +## 6.0.0 + +This is a production release that fixes an oversight in the `bc` parser (that +sometimes caused the wrong error message) and adds a feature for compatibility +with the BSD `bc` and `dc`: turning off digit clamping when parsing numbers. + +The default for clamping can be set during the build (see the [build +manual][13]), it can be set with the `BC_DIGIT_CLAMP` and `DC_DIGIT_CLAMP` +environment variables, and it can be set with the `-c` and `-C` command-line +options. + +Turning off clamping was also added to the `bcl` library. + +In addition, signal handling was removed from the `bcl` library in order to add +the capability for multi-threading. This required a major version bump. I +apologize to all library users (I don't know of any), but signals and threads do +not play well together. + +To help with building, a convenience option (`-p`) to `configure.sh` was added +to build a `bc` and `dc` that is by default compatible with either the BSD `bc` +and `dc` or the GNU `bc` and `dc`. + +## 5.3.3 + +This is a production release that fixes a build problem in the FreeBSD base +system. + +All other users do **NOT** need to upgrade. + +## 5.3.2 + +This is a production release that fixes prompt bugs with editline and readline +where the `BC_PROMPT` environment variable was not being respected. + +This also fixes editline and readline output on `EOF`. + +## 5.3.1 + +This is a production release that fixes a build problem in the FreeBSD base +system, as well as a problem in the `en_US` locale. If you don't have problems +with either, you do not need to upgrade. + +## 5.3.0 + +This is a production release that adds features and has a few bug fixes. + +First, support for editline and readline history has been added. To use +editline, pass `-e` to `configure.sh`, and to use readline, pass `-r`. + +Second, history support for Windows has been fixed and re-enabled. + +Third, command-line options to set `scale`, `ibase`, `obase`, and `seed` were +added. This was requested long ago, and I originally disagreed with the idea. + +Fourth, the manuals had typos and were missing information. That has been fixed. + +Fifth, the manuals received different formatting to be more readable as +manpages. + +## 5.2.5 + +This is a production release that fixes this `bc`'s behavior on `^D` to match +GNU `bc`. + +## 5.2.4 + +This is a production release that fixes two bugs in history: + +* Without prompt, the cursor could not be placed on the first character in a + line. +* Home and End key handling in `tmux` was fixed. + +Any users that do not care about these improvements do not need to upgrade. + +## 5.2.3 + +This is a production release that fixes one bug, a parse error when passing a +file to `bc` using `-f` if that file had a multiline comment or string in it. + ## 5.2.2 This is a production release that fixes one bug, a segmentation fault if diff --git a/contrib/bc/NOTICE.md b/contrib/bc/NOTICE.md index 56d2935ab4b3..c0d3ded5797a 100644 --- a/contrib/bc/NOTICE.md +++ b/contrib/bc/NOTICE.md @@ -1,6 +1,6 @@ # Notice -Copyright 2018-2021 Gavin D. Howard and contributors. +Copyright 2018-2023 Gavin D. Howard and contributors. ## Contributors diff --git a/contrib/bc/README.md b/contrib/bc/README.md index 259ab923bfc4..438cab0d1694 100644 --- a/contrib/bc/README.md +++ b/contrib/bc/README.md @@ -1,5 +1,10 @@ # `bc` +***WARNING: New user registration for https://git.yzena.com/ is disabled because +of spam. If you need to report a bug with `bc`, email gavin at this site minus +the `git.` part for an account, and I will create one for you. Or you can report +an issue at [GitHub][29].*** + ***WARNING: This project has moved to [https://git.yzena.com/][20] for [these reasons][21], though GitHub will remain a mirror.*** @@ -71,8 +76,8 @@ Also, if building with MSBuild, the MSBuild bundled with Visual Studio is required. **Note**: Unlike the POSIX-compatible platforms, only one build configuration is -supported on Windows: extra math and prompt enabled, history and NLS (locale -support) disabled, with both calculators built. +supported on Windows: extra math and history enabled, NLS (locale support) +disabled, with both calculators built. #### `bc` @@ -166,8 +171,8 @@ other locations, use the `PREFIX` environment variable when running #### Library -This `bc` does provide a way to build a math library with C bindings. This is -done by the `-a` or `--library` options to `configure.sh`: +To build the math library, pass the `-a` or `--library` options to +`configure.sh`: ``` ./configure.sh -a @@ -179,9 +184,6 @@ see the [build manual][5]. The library API can be found in [`manuals/bcl.3.md`][26] or `man bcl` once the library is installed. -The library is built as `bin/libbcl.a` on POSIX-compatible systems or as -`Release/bcl/bcl.lib` on Windows. - #### Package and Distro Maintainers This section is for package and distro maintainers. @@ -289,8 +291,7 @@ with POSIX `bc`. The math has been tested with 40+ million random problems, so it is as correct as I can make it. This `bc` can be used as a drop-in replacement for any existing `bc`. This `bc` -is also compatible with MinGW toolchains, though history is not supported on -Windows. +is also compatible with MinGW toolchains. In addition, this `bc` is considered complete; i.e., there will be no more releases with additional features. However, it *is* actively maintained, so if @@ -317,7 +318,8 @@ may prove useful to any serious users. This `bc` compares favorably to GNU `bc`. * This `bc` builds natively on Windows. -* It has more extensions, which make this `bc` more useful for scripting. +* It has more extensions, which make this `bc` more useful for scripting. (See + [Extensions](#extensions).) * This `bc` is a bit more POSIX compliant. * It has a much less buggy parser. The GNU `bc` will give parse errors for what is actually valid `bc` code, or should be. For example, putting an `else` on @@ -340,6 +342,58 @@ There is one instance where this `bc` is slower: if scripts are light on math. This is because this `bc`'s intepreter is slightly slower than GNU `bc`, but that is because it is more robust. See the [benchmarks][19]. +### Extensions + +Below is a non-comprehensive list of extensions that this `bc` and `dc` have +that all others do not. + +* An extended math library. (See [here][30] for more information.) +* A command-line prompt. +* Turning on and off digit clamping. (Digit clamping is about how to treat + "invalid" digits for a particular base. GNU `bc` uses it, and the BSD `bc` + does not. Mine does both.) +* A pseudo-random number generator. This includes the ability to set the seed + and get reproducible streams of random numbers. +* The ability to use stacks for the globals `scale`, `ibase`, and `obase` + instead of needing to restore them in *every* function. +* The ability to *not* use non-standard keywords. For example, `abs` is a + keyword (a built-in function), but if some script actually defines a function + called that, it's possible to tell my `bc` to not treat it as a keyword, which + will make the script parses correctly. +* The ability to turn on and off printing leading zeroes on numbers greater than + `-1` and less than `1`. +* Outputting in scientific and engineering notation. +* Accepting input in scientific and engineering notation. +* Passing strings and arrays to the `length()` built-in function. (In `dc`, the + `Y` command will do this for arrays, and the `Z` command will do this for both + numbers and strings.) +* The `abs()` built-in function. (This is the `b` command in `dc`.) +* The `is_number()` and `is_string()` built-in functions. (These tell whether a + variable is holding a string or a number, for runtime type checking. The + commands are `u` and `t` in `dc`.) +* For `bc` only, the `divmod()` built-in function for computing a quotient and + remainder at the same time. +* For `bc` only, the `asciify()` built-in function for converting an array to a + string. +* The `$` truncation operator. (It's the same in `bc` and `dc`.) +* The `@` "set scale" operator. (It's the same in `bc` and `dc`.) +* The decimal shift operators. (`<<` and `>>` in `bc`, `H` and `h` in `dc`.) +* Built-in functions or commands to get the max of `scale`, `ibase`, and + `obase`. +* The ability to put strings into variables in `bc`. (This always existed in + `dc`.) +* The `'` command in `dc` for the depth of the execution stack. +* The `y` command in `dc` for the depth of register stacks. +* Built-in functions or commands to get the value of certain environment + variables that might affect execution. +* The `stream` keyword to do the same thing as the `P` command in `dc`. +* Defined order of evaluation. +* Defined exit statuses. +* All environment variables other than `POSIXLY_CORRECT`, `BC_ENV_ARGS`, and + `BC_LINE_LENGTH`. +* The ability for users to define their own defaults for various options during + build. (See [here][31] for more information.) + ## Algorithms To see what algorithms this `bc` uses, see the [algorithms manual][7]. @@ -405,18 +459,18 @@ Files: Makefile.in The Makefile template. NEWS.md The changelog. NOTICE.md List of contributors and copyright owners. - RELEASE.md A checklist for making a release (maintainer use only). Folders: - gen The bc math library, help texts, and code to generate C source. - include All header files. - locales Locale files, in .msg format. Patches welcome for translations. - manuals Manuals for both programs. - src All source code. - scripts A bunch of shell scripts to help with development and building. - tests All tests. - vs Files needed for the build on Windows. + benchmarks A folder of benchmarks for various aspects of bc performance. + gen The bc math library, help texts, and code to generate C source. + include All header files. + locales Locale files, in .msg format. Patches welcome for translations. + manuals Manuals for both programs. + src All source code. + scripts A bunch of shell scripts to help with development and building. + tests All tests. + vs Files needed for the build on Windows. [1]: https://www.gnu.org/software/bc/ [4]: ./LICENSE.md @@ -439,3 +493,6 @@ Folders: [26]: ./manuals/bcl.3.md [27]: https://en.wikipedia.org/wiki/Bus_factor [28]: ./manuals/development.md +[29]: https://github.com/gavinhoward/bc +[30]: ./manuals/bc/A.1.md#extended-library +[31]: ./manuals/build.md#settings diff --git a/contrib/bc/configure.sh b/contrib/bc/configure.sh index fc66ffc51066..3ada5298e9ed 100755 --- a/contrib/bc/configure.sh +++ b/contrib/bc/configure.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -43,7 +43,7 @@ usage() { _usage_val=1 - printf "%s\n\n" "$1" + printf '%s\n\n' "$1" else _usage_val=0 @@ -52,17 +52,25 @@ usage() { printf 'usage:\n' printf ' %s -h\n' "$script" printf ' %s --help\n' "$script" - printf ' %s [-a|-bD|-dB|-c] [-CEfgGHlmMNtTvz] [-O OPT_LEVEL] [-k KARATSUBA_LEN]\\\n' "$script" - printf ' [-s SETTING] [-S SETTING]\n' + printf ' %s [-a|-bD|-dB|-c] [-CeEfgGHilmMNPrtTvz] [-O OPT_LEVEL] [-k KARATSUBA_LEN]\\\n' "$script" + printf ' [-s SETTING] [-S SETTING] [-p TYPE]\n' printf ' %s \\\n' "$script" printf ' [--library|--bc-only --disable-dc|--dc-only --disable-bc|--coverage] \\\n' printf ' [--force --debug --disable-extra-math --disable-generated-tests] \\\n' printf ' [--disable-history --disable-man-pages --disable-nls --disable-strip] \\\n' - printf ' [--install-all-locales] [--opt=OPT_LEVEL] \\\n' - printf ' [--karatsuba-len=KARATSUBA_LEN] \\\n' + printf ' [--enable-editline] [--enable-readline] [--enable-internal-history] \\\n' + printf ' [--disable-problematic-tests] [--install-all-locales] \\\n' + printf ' [--opt=OPT_LEVEL] [--karatsuba-len=KARATSUBA_LEN] \\\n' printf ' [--set-default-on=SETTING] [--set-default-off=SETTING] \\\n' *** 51905 LINES SKIPPED *** From nobody Tue Feb 7 17:41:32 2023 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 4PB9RK29c4z3nV8g; Tue, 7 Feb 2023 17:41: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 4PB9RK1ZFrz4H9H; Tue, 7 Feb 2023 17:41:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675791693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=60nvd4w1p1rZJ/o7xjOjEsAhOkwV+jp+IXipXdGAtcY=; b=BPbGxQj+oJxVcfr9zxhQtJQYeXf7y9k4w8Iu23Se2GgnmBbyrgot0ElV0MyR3/PV/jmqB1 10ay3fjPZH0q6kB/hKqP6b+AtlstDZU8YZcaXjM6X5RJ9x74jvebex6EERkhZnJXgerUWb pH25EmbRPKRYjpfPeqMZvKxQVSZO8ZqkJEcQGscF+0ckpv5V4Uo8IZ5mCQtCx1VccHBlOs DrkFt/0Veu0+NQGs6SINmjVPg6YLGGng4v2p7pDzpg1R1WELti3G223s+i07iynlRpGOz+ EjFCL0pTSdRDxfNEb0x2RT5sPW6eWoSoggSYOmhpW7tqPq9wSJD+KSA4MA1xAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675791693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=60nvd4w1p1rZJ/o7xjOjEsAhOkwV+jp+IXipXdGAtcY=; b=DE5M++Qpr4GDMdCgezyJyzpaoYy4GMtswDxm/g0sokV5de1mUlEqMQo2c3qJRHgBmiMOdb WWai1SgwS30h0phnwd/sWpKL/wCzG4il8fWmEVvKkgF7YXMYdiTi13zgjBRTHJR522keUP hSWmj86t7RBN449hxqx5KpaIlGDPi702Xjx/4hXi9GZNlRl6zTPDsZhSg1/eOgyAiDgERm U8Zyli2uOTx2t0bXCrLUY12meSbLZoFKp7MZQ3spnjfeDv+I2dbDydZBs5/lsCZHl6sy3K nX83qTjgbt4Kt+2BDOUKG+/Y6rjnmDNmhVdm66kKPSjWhQxx+TasJBn1ZG0RCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675791693; a=rsa-sha256; cv=none; b=q7Curxr5EFuN4qSgo8ylFI9aUGl6Q1AKQHscUVyvy55iWZBKCfgJJOhvDKxQqQ1HqaXWvF S/y/cYOB2MhuzyxYRe3+nI+weWvDTeZrwIXWMMrsxQsukY2VN93TSbisM+JqrWL8n1hTN9 APMFZGQndfwb7hnwmEoDvH/0N0b/EykiXMjFKOQUp5dUU15M2Z2ycLPg8ra/G6xnwL9c1a VJSqqzmnBM5piNK2A6S8BkoY2uzHuGf3EYGDcg3CsPc7clIEweMx/7oitMx3vYXkpZOxvg frwg0xI5q3Uqdys87I59wy8y4mXrcAy9mbnxNaUuEP2z/ezwbthwkViE5znnsg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PB9RK0fbCzQ2B; Tue, 7 Feb 2023 17:41:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 317HfWGB018618; Tue, 7 Feb 2023 17:41:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 317HfWxg018617; Tue, 7 Feb 2023 17:41:32 GMT (envelope-from git) Date: Tue, 7 Feb 2023 17:41:32 GMT Message-Id: <202302071741.317HfWxg018617@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 0a4f7dbd9e94 - stable/13 - timeout: Move from /usr/bin to /bin 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: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0a4f7dbd9e9450cea25af944d47dce578960a1b8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=0a4f7dbd9e9450cea25af944d47dce578960a1b8 commit 0a4f7dbd9e9450cea25af944d47dce578960a1b8 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2023-02-01 15:24:59 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2023-02-07 17:37:53 +0000 timeout: Move from /usr/bin to /bin timeout(1) is used by /etc/rc.d/zfskeys. Unfortunately, having timeout(1) installed in /usr/bin causes problems when /usr is an encrypted ZFS partition. Implementing timeout(1) in sh(1) is not trivial. A more elegant solution is to move timeout(1) to /bin so that it is available to early services in the boot process. PR: 265221 Reviewed by: allanjude, des, imp Approved by: allanjude, des, imp Reported by: Ivan Fixes: 33ff39796ffe Add zfskeys rc.d script for auto-loading encryption keys Relnotes: yes Sponsored by: Modirum MDPay Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D38344 (cherry picked from commit e7ab133648a168c4bf7c11da840663c5581771d8) --- ObsoleteFiles.inc | 4 ++++ bin/Makefile | 1 + {usr.bin => bin}/timeout/Makefile | 2 ++ {usr.bin => bin}/timeout/Makefile.depend | 0 {usr.bin => bin}/timeout/tests/Makefile | 0 {usr.bin => bin}/timeout/tests/Makefile.depend | 0 {usr.bin => bin}/timeout/tests/timeout_test.sh | 0 {usr.bin => bin}/timeout/timeout.1 | 0 {usr.bin => bin}/timeout/timeout.c | 0 etc/mtree/BSD.tests.dist | 4 ++-- usr.bin/Makefile | 1 - 11 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 1dac72154539..fd0c71b4814a 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -52,6 +52,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20230201: timeout moved from /usr/bin to /bin +OLD_FILES+=usr/tests/usr.bin/timeout/Kyuafile +OLD_FILES+=usr/tests/usr.bin/timeout/timeout_test + # 20221015: update the ithread(9) man page OLD_FILES+=usr/share/man/man9/ithread.9.gz OLD_FILES+=usr/share/man/man9/ithread_add_handler.9.gz diff --git a/bin/Makefile b/bin/Makefile index 3ad97ac8d624..cdd96d0b84e8 100644 --- a/bin/Makefile +++ b/bin/Makefile @@ -38,6 +38,7 @@ SUBDIR= cat \ stty \ sync \ test \ + timeout \ uuidgen SUBDIR.${MK_SENDMAIL}+= rmail diff --git a/usr.bin/timeout/Makefile b/bin/timeout/Makefile similarity index 69% rename from usr.bin/timeout/Makefile rename to bin/timeout/Makefile index fc1c87edfb7a..2eb88d6827fa 100644 --- a/usr.bin/timeout/Makefile +++ b/bin/timeout/Makefile @@ -4,6 +4,8 @@ PROG= timeout +SYMLINKS= ../..${BINDIR}/timeout /usr/bin/timeout + HAS_TESTS= SUBDIR.${MK_TESTS}+= tests diff --git a/usr.bin/timeout/Makefile.depend b/bin/timeout/Makefile.depend similarity index 100% rename from usr.bin/timeout/Makefile.depend rename to bin/timeout/Makefile.depend diff --git a/usr.bin/timeout/tests/Makefile b/bin/timeout/tests/Makefile similarity index 100% rename from usr.bin/timeout/tests/Makefile rename to bin/timeout/tests/Makefile diff --git a/usr.bin/timeout/tests/Makefile.depend b/bin/timeout/tests/Makefile.depend similarity index 100% rename from usr.bin/timeout/tests/Makefile.depend rename to bin/timeout/tests/Makefile.depend diff --git a/usr.bin/timeout/tests/timeout_test.sh b/bin/timeout/tests/timeout_test.sh similarity index 100% rename from usr.bin/timeout/tests/timeout_test.sh rename to bin/timeout/tests/timeout_test.sh diff --git a/usr.bin/timeout/timeout.1 b/bin/timeout/timeout.1 similarity index 100% rename from usr.bin/timeout/timeout.1 rename to bin/timeout/timeout.1 diff --git a/usr.bin/timeout/timeout.c b/bin/timeout/timeout.c similarity index 100% rename from usr.bin/timeout/timeout.c rename to bin/timeout/timeout.c diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 136877db00d6..1b2c94f42a6b 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -62,6 +62,8 @@ .. test .. + timeout + .. .. cddl lib @@ -1090,8 +1092,6 @@ .. tar .. - timeout - .. tr .. truncate diff --git a/usr.bin/Makefile b/usr.bin/Makefile index cd0e6730d568..0b32b8a7f745 100644 --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -153,7 +153,6 @@ SUBDIR= alias \ tcopy \ tee \ time \ - timeout \ tip \ top \ touch \ From nobody Tue Feb 7 22:40:53 2023 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 4PBJ4j6TK8z3npJm; Tue, 7 Feb 2023 22:40:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PBJ4j698Wz3jk6; Tue, 7 Feb 2023 22:40:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675809653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DfkRCsEksFjZ3Pgjk5MeUYTF/TxVBO7xe38bYHDIQvA=; b=VVLt/4KE4q/eTpPZPROX0QDsvA8B5dVS/SRtvJR7Ulhk0ZFbd5flzXdT0dNQFRAnLjdEum A78qmdoVQrl1AxHIJ6vfDeAvU6dtbAUZfaF2sGl3Z3/NauGg9TCPYG4BLbn3znMMZsSYKq Uj4ofoyX2nopPi8bGFLNw6bl3RjEmv5lSCTuvNMuupNFIabwA8Fx0xnNHVnGmu63cEfF7H tDSGs1zxTwzXcDL7ksr1R8ihHo8lN5R0dKa2G/AixdiwYjhp/B/+n+9AjyRVl9R9lCWtyw br8ydUEA/MP09G+hCvmtPj87+ErpaNFM01c0HQSq5I8PE5xoVr/wYbQaXWrxmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675809653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DfkRCsEksFjZ3Pgjk5MeUYTF/TxVBO7xe38bYHDIQvA=; b=Kq3DhfkmDQwR2NTa3JVGW9diP7Aa3Fav+tZ3+vlenbt+mbNTnlfkDbmfnzpXnLIEUGNvWB vol1BxgsxqP7JLy58npX9HaMkJEIbkh4+1BqOn7m/I+ohJ3pnp97JgVJb92/pPZ73Pl/ZL qezM7JB4jmn7vRQPXVg/lgXgAHPCMKzAIWo7mXHQcrfmcGulItk+Z20MyyQoQg396SAPVK PCF8CK1CLl/CSnCMX0YgRs/2DD76NuFuX37B0m9ZrENmZRPuNpnhDH7h/BqVby9d7/rBH9 aHWYGACcdQKbxMTe1e2LhXhn+VTk6J+4MhxdHzE/aEYrBm9XxjhOEcextNBRoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675809653; a=rsa-sha256; cv=none; b=CWDWRZAwEkvgIRtHfOMFTU7P434+nsZ+v3ty7d2rU+Vh4BVkku6q/hg5S6eAZF64MK/lUJ pduQk0RrgGkbSiNEVRtOI8XeQNqbVwiRNIFY+XOPzl+7vwE4GJVmGxOtZHjdarv6JVwvnm wTOb5jW36LV90wJ81vl+i0IM/pMuRpZL8aDBCoE0FK1mtDEtN8HttYjOUhvZ9nKkmuBtBm FkpAejItbYpDDcd3jeEEHF2qxczdEN1xQktcVpagb388sFMXxqyldxNNNxa2QhRr4pzqPg ySsM77bCE0doNTWFsAjRsMQCrEq4ftp3FWi3v+xSLFbUCTwATenp3D6E5NcUtg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBJ4j5D1kzZ8j; Tue, 7 Feb 2023 22:40:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 317MerKW046362; Tue, 7 Feb 2023 22:40:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 317MerM1046361; Tue, 7 Feb 2023 22:40:53 GMT (envelope-from git) Date: Tue, 7 Feb 2023 22:40:53 GMT Message-Id: <202302072240.317MerM1046361@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jung-uk Kim Subject: git: 0904c29a0a11 - stable/13 - OpenSSL: Merge OpenSSL 1.1.1t 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: jkim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0904c29a0a116eb7d67a2d35d926580a65f0ddfb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=0904c29a0a116eb7d67a2d35d926580a65f0ddfb commit 0904c29a0a116eb7d67a2d35d926580a65f0ddfb Author: Jung-uk Kim AuthorDate: 2023-02-07 18:51:38 +0000 Commit: Jung-uk Kim CommitDate: 2023-02-07 22:38:40 +0000 OpenSSL: Merge OpenSSL 1.1.1t (cherry picked from commit 640242a5915761ce63205bdb0542fa3c1473c0ff) --- crypto/openssl/CHANGES | 76 ++- crypto/openssl/Configure | 18 +- crypto/openssl/NEWS | 7 + crypto/openssl/README | 2 +- crypto/openssl/crypto/asn1/asn_mime.c | 6 +- crypto/openssl/crypto/asn1/bio_asn1.c | 4 +- crypto/openssl/crypto/asn1/bio_ndef.c | 41 +- crypto/openssl/crypto/bio/b_print.c | 22 +- crypto/openssl/crypto/bn/bn_blind.c | 16 +- crypto/openssl/crypto/bn/bn_err.c | 4 +- crypto/openssl/crypto/bn/bn_exp.c | 36 +- crypto/openssl/crypto/bn/bn_local.h | 36 +- crypto/openssl/crypto/bn/bn_mont.c | 4 +- crypto/openssl/crypto/bn/build.info | 3 +- crypto/openssl/crypto/bn/rsa_sup_mul.c | 614 +++++++++++++++++++++++++ crypto/openssl/crypto/cms/cms_enc.c | 5 + crypto/openssl/crypto/cms/cms_err.c | 2 + crypto/openssl/crypto/err/openssl.txt | 5 +- crypto/openssl/crypto/evp/bio_enc.c | 9 +- crypto/openssl/crypto/pem/pem_lib.c | 8 +- crypto/openssl/crypto/rsa/rsa_ameth.c | 1 + crypto/openssl/crypto/rsa/rsa_ossl.c | 19 +- crypto/openssl/crypto/txt_db/txt_db.c | 4 +- crypto/openssl/crypto/x509/by_dir.c | 18 +- crypto/openssl/crypto/x509/x_name.c | 8 +- crypto/openssl/crypto/x509v3/v3_genn.c | 4 +- crypto/openssl/engines/asm/e_padlock-x86.pl | 4 +- crypto/openssl/engines/asm/e_padlock-x86_64.pl | 4 +- crypto/openssl/include/crypto/bn.h | 7 +- crypto/openssl/include/openssl/bnerr.h | 3 +- crypto/openssl/include/openssl/cmserr.h | 1 + crypto/openssl/include/openssl/opensslv.h | 4 +- crypto/openssl/include/openssl/x509v3.h | 4 +- crypto/openssl/ssl/record/rec_layer_s3.c | 26 +- crypto/openssl/ssl/record/ssl3_buffer.c | 9 +- 35 files changed, 938 insertions(+), 96 deletions(-) diff --git a/crypto/openssl/CHANGES b/crypto/openssl/CHANGES index 882dd2034efe..459605bf71b6 100644 --- a/crypto/openssl/CHANGES +++ b/crypto/openssl/CHANGES @@ -7,11 +7,85 @@ https://github.com/openssl/openssl/commits/ and pick the appropriate release branch. + Changes between 1.1.1s and 1.1.1t [7 Feb 2023] + + *) Fixed X.400 address type confusion in X.509 GeneralName. + + There is a type confusion vulnerability relating to X.400 address processing + inside an X.509 GeneralName. X.400 addresses were parsed as an ASN1_STRING + but subsequently interpreted by GENERAL_NAME_cmp as an ASN1_TYPE. This + vulnerability may allow an attacker who can provide a certificate chain and + CRL (neither of which need have a valid signature) to pass arbitrary + pointers to a memcmp call, creating a possible read primitive, subject to + some constraints. Refer to the advisory for more information. Thanks to + David Benjamin for discovering this issue. (CVE-2023-0286) + + This issue has been fixed by changing the public header file definition of + GENERAL_NAME so that x400Address reflects the implementation. It was not + possible for any existing application to successfully use the existing + definition; however, if any application references the x400Address field + (e.g. in dead code), note that the type of this field has changed. There is + no ABI change. + [Hugo Landau] + + *) Fixed Use-after-free following BIO_new_NDEF. + + The public API function BIO_new_NDEF is a helper function used for + streaming ASN.1 data via a BIO. It is primarily used internally to OpenSSL + to support the SMIME, CMS and PKCS7 streaming capabilities, but may also + be called directly by end user applications. + + The function receives a BIO from the caller, prepends a new BIO_f_asn1 + filter BIO onto the front of it to form a BIO chain, and then returns + the new head of the BIO chain to the caller. Under certain conditions, + for example if a CMS recipient public key is invalid, the new filter BIO + is freed and the function returns a NULL result indicating a failure. + However, in this case, the BIO chain is not properly cleaned up and the + BIO passed by the caller still retains internal pointers to the previously + freed filter BIO. If the caller then goes on to call BIO_pop() on the BIO + then a use-after-free will occur. This will most likely result in a crash. + (CVE-2023-0215) + [Viktor Dukhovni, Matt Caswell] + + *) Fixed Double free after calling PEM_read_bio_ex. + + The function PEM_read_bio_ex() reads a PEM file from a BIO and parses and + decodes the "name" (e.g. "CERTIFICATE"), any header data and the payload + data. If the function succeeds then the "name_out", "header" and "data" + arguments are populated with pointers to buffers containing the relevant + decoded data. The caller is responsible for freeing those buffers. It is + possible to construct a PEM file that results in 0 bytes of payload data. + In this case PEM_read_bio_ex() will return a failure code but will populate + the header argument with a pointer to a buffer that has already been freed. + If the caller also frees this buffer then a double free will occur. This + will most likely lead to a crash. + + The functions PEM_read_bio() and PEM_read() are simple wrappers around + PEM_read_bio_ex() and therefore these functions are also directly affected. + + These functions are also called indirectly by a number of other OpenSSL + functions including PEM_X509_INFO_read_bio_ex() and + SSL_CTX_use_serverinfo_file() which are also vulnerable. Some OpenSSL + internal uses of these functions are not vulnerable because the caller does + not free the header argument if PEM_read_bio_ex() returns a failure code. + (CVE-2022-4450) + [Kurt Roeckx, Matt Caswell] + + *) Fixed Timing Oracle in RSA Decryption. + + A timing based side channel exists in the OpenSSL RSA Decryption + implementation which could be sufficient to recover a plaintext across + a network in a Bleichenbacher style attack. To achieve a successful + decryption an attacker would have to be able to send a very large number + of trial messages for decryption. The vulnerability affects all RSA padding + modes: PKCS#1 v1.5, RSA-OEAP and RSASVE. + (CVE-2022-4304) + [Dmitry Belyavsky, Hubert Kario] + Changes between 1.1.1r and 1.1.1s [1 Nov 2022] *) Fixed a regression introduced in 1.1.1r version not refreshing the certificate data to be signed before signing the certificate. - [Gibeom Gwon] Changes between 1.1.1q and 1.1.1r [11 Oct 2022] diff --git a/crypto/openssl/Configure b/crypto/openssl/Configure index 92e59b9ce7a6..37a99d14715c 100755 --- a/crypto/openssl/Configure +++ b/crypto/openssl/Configure @@ -1,6 +1,6 @@ #! /usr/bin/env perl # -*- mode: perl; -*- -# Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2016-2023 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -1217,7 +1217,7 @@ $target{build_scheme} = [ $target{build_scheme} ] my ($builder, $builder_platform, @builder_opts) = @{$target{build_scheme}}; -foreach my $checker (($builder_platform."-".$target{build_file}."-checker.pm", +foreach my $checker (($builder_platform."-".$config{build_file}."-checker.pm", $builder_platform."-checker.pm")) { my $checker_path = catfile($srcdir, "Configurations", $checker); if (-f $checker_path) { @@ -1741,8 +1741,8 @@ if ($builder eq "unified") { # Store the name of the template file we will build the build file from # in %config. This may be useful for the build file itself. my @build_file_template_names = - ( $builder_platform."-".$target{build_file}.".tmpl", - $target{build_file}.".tmpl" ); + ( $builder_platform."-".$config{build_file}.".tmpl", + $config{build_file}.".tmpl" ); my @build_file_templates = (); # First, look in the user provided directory, if given @@ -1966,8 +1966,8 @@ if ($builder eq "unified") { } next if @skip && $skip[$#skip] <= 0; push @rawlines, $_ - if ($target_kind eq $target{build_file} - || $target_kind eq $target{build_file}."(".$builder_platform.")"); + if ($target_kind eq $config{build_file} + || $target_kind eq $config{build_file}."(".$builder_platform.")"); } }, qr/^\s*(?:#.*)?$/ => sub { }, @@ -2842,8 +2842,8 @@ if ($builder_platform eq 'unix') { my %builders = ( unified => sub { - print 'Creating ',$target{build_file},"\n"; - run_dofile(catfile($blddir, $target{build_file}), + print 'Creating ',$config{build_file},"\n"; + run_dofile(catfile($blddir, $config{build_file}), @{$config{build_file_templates}}); }, ); @@ -2897,7 +2897,7 @@ exit(0); # sub death_handler { die @_ if $^S; # To prevent the added message in eval blocks - my $build_file = $target{build_file} // "build file"; + my $build_file = $config{build_file} // "build file"; my @message = ( <<"_____", @_ ); Failure! $build_file wasn't produced. diff --git a/crypto/openssl/NEWS b/crypto/openssl/NEWS index c9e63eea63a6..2724fc4d85ba 100644 --- a/crypto/openssl/NEWS +++ b/crypto/openssl/NEWS @@ -5,6 +5,13 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.1.1s and OpenSSL 1.1.1t [7 Feb 2023] + + o Fixed X.400 address type confusion in X.509 GeneralName (CVE-2023-0286) + o Fixed Use-after-free following BIO_new_NDEF (CVE-2023-0215) + o Fixed Double free after calling PEM_read_bio_ex (CVE-2022-4450) + o Fixed Timing Oracle in RSA Decryption (CVE-2022-4304) + Major changes between OpenSSL 1.1.1r and OpenSSL 1.1.1s [1 Nov 2022] o Fixed a regression introduced in OpenSSL 1.1.1r not refreshing the diff --git a/crypto/openssl/README b/crypto/openssl/README index 2f6d91c6337c..b2f806be3a44 100644 --- a/crypto/openssl/README +++ b/crypto/openssl/README @@ -1,5 +1,5 @@ - OpenSSL 1.1.1s 1 Nov 2022 + OpenSSL 1.1.1t 7 Feb 2023 Copyright (c) 1998-2022 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson diff --git a/crypto/openssl/crypto/asn1/asn_mime.c b/crypto/openssl/crypto/asn1/asn_mime.c index 38735cd86f3e..36853612b69c 100644 --- a/crypto/openssl/crypto/asn1/asn_mime.c +++ b/crypto/openssl/crypto/asn1/asn_mime.c @@ -489,6 +489,7 @@ int SMIME_crlf_copy(BIO *in, BIO *out, int flags) char eol; int len; char linebuf[MAX_SMLEN]; + int ret; /* * Buffer output so we don't write one line at a time. This is useful * when streaming as we don't end up with one OCTET STRING per line. @@ -523,9 +524,12 @@ int SMIME_crlf_copy(BIO *in, BIO *out, int flags) BIO_write(out, "\r\n", 2); } } - (void)BIO_flush(out); + ret = BIO_flush(out); BIO_pop(out); BIO_free(bf); + if (ret <= 0) + return 0; + return 1; } diff --git a/crypto/openssl/crypto/asn1/bio_asn1.c b/crypto/openssl/crypto/asn1/bio_asn1.c index 914d77c866c6..17b0d1aa6cad 100644 --- a/crypto/openssl/crypto/asn1/bio_asn1.c +++ b/crypto/openssl/crypto/asn1/bio_asn1.c @@ -172,7 +172,7 @@ static int asn1_bio_write(BIO *b, const char *in, int inl) case ASN1_STATE_START: if (!asn1_bio_setup_ex(b, ctx, ctx->prefix, ASN1_STATE_PRE_COPY, ASN1_STATE_HEADER)) - return 0; + return -1; break; /* Copy any pre data first */ @@ -189,7 +189,7 @@ static int asn1_bio_write(BIO *b, const char *in, int inl) case ASN1_STATE_HEADER: ctx->buflen = ASN1_object_size(0, inl, ctx->asn1_tag) - inl; if (!ossl_assert(ctx->buflen <= ctx->bufsize)) - return 0; + return -1; p = ctx->buf; ASN1_put_object(&p, 0, inl, ctx->asn1_tag, ctx->asn1_class); ctx->copylen = inl; diff --git a/crypto/openssl/crypto/asn1/bio_ndef.c b/crypto/openssl/crypto/asn1/bio_ndef.c index 760e4846a474..c8a776b482d0 100644 --- a/crypto/openssl/crypto/asn1/bio_ndef.c +++ b/crypto/openssl/crypto/asn1/bio_ndef.c @@ -1,5 +1,5 @@ /* - * Copyright 2008-2021 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2008-2023 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -49,12 +49,19 @@ static int ndef_suffix(BIO *b, unsigned char **pbuf, int *plen, void *parg); static int ndef_suffix_free(BIO *b, unsigned char **pbuf, int *plen, void *parg); +/* + * On success, the returned BIO owns the input BIO as part of its BIO chain. + * On failure, NULL is returned and the input BIO is owned by the caller. + * + * Unfortunately cannot constify this due to CMS_stream() and PKCS7_stream() + */ BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it) { NDEF_SUPPORT *ndef_aux = NULL; BIO *asn_bio = NULL; const ASN1_AUX *aux = it->funcs; ASN1_STREAM_ARG sarg; + BIO *pop_bio = NULL; if (!aux || !aux->asn1_cb) { ASN1err(ASN1_F_BIO_NEW_NDEF, ASN1_R_STREAMING_NOT_SUPPORTED); @@ -69,21 +76,39 @@ BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it) out = BIO_push(asn_bio, out); if (out == NULL) goto err; + pop_bio = asn_bio; - BIO_asn1_set_prefix(asn_bio, ndef_prefix, ndef_prefix_free); - BIO_asn1_set_suffix(asn_bio, ndef_suffix, ndef_suffix_free); + if (BIO_asn1_set_prefix(asn_bio, ndef_prefix, ndef_prefix_free) <= 0 + || BIO_asn1_set_suffix(asn_bio, ndef_suffix, ndef_suffix_free) <= 0 + || BIO_ctrl(asn_bio, BIO_C_SET_EX_ARG, 0, ndef_aux) <= 0) + goto err; /* - * Now let callback prepends any digest, cipher etc BIOs ASN1 structure - * needs. + * Now let the callback prepend any digest, cipher, etc., that the BIO's + * ASN1 structure needs. */ sarg.out = out; sarg.ndef_bio = NULL; sarg.boundary = NULL; - if (aux->asn1_cb(ASN1_OP_STREAM_PRE, &val, it, &sarg) <= 0) + /* + * The asn1_cb(), must not have mutated asn_bio on error, leaving it in the + * middle of some partially built, but not returned BIO chain. + */ + if (aux->asn1_cb(ASN1_OP_STREAM_PRE, &val, it, &sarg) <= 0) { + /* + * ndef_aux is now owned by asn_bio so we must not free it in the err + * clean up block + */ + ndef_aux = NULL; goto err; + } + + /* + * We must not fail now because the callback has prepended additional + * BIOs to the chain + */ ndef_aux->val = val; ndef_aux->it = it; @@ -91,11 +116,11 @@ BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it) ndef_aux->boundary = sarg.boundary; ndef_aux->out = out; - BIO_ctrl(asn_bio, BIO_C_SET_EX_ARG, 0, ndef_aux); - return sarg.ndef_bio; err: + /* BIO_pop() is NULL safe */ + (void)BIO_pop(pop_bio); BIO_free(asn_bio); OPENSSL_free(ndef_aux); return NULL; diff --git a/crypto/openssl/crypto/bio/b_print.c b/crypto/openssl/crypto/bio/b_print.c index 41b7f5e2f61d..45d4e9f004b1 100644 --- a/crypto/openssl/crypto/bio/b_print.c +++ b/crypto/openssl/crypto/bio/b_print.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -13,6 +13,7 @@ #include "crypto/ctype.h" #include "internal/numbers.h" #include +#include /* * Copyright Patrick Powell 1995 @@ -31,8 +32,10 @@ static int fmtstr(char **, char **, size_t *, size_t *, const char *, int, int, int); static int fmtint(char **, char **, size_t *, size_t *, int64_t, int, int, int, int); +#ifndef OPENSSL_SYS_UEFI static int fmtfp(char **, char **, size_t *, size_t *, LDOUBLE, int, int, int, int); +#endif static int doapr_outch(char **, char **, size_t *, size_t *, int); static int _dopr(char **sbuffer, char **buffer, size_t *maxlen, size_t *retlen, int *truncated, @@ -88,7 +91,9 @@ _dopr(char **sbuffer, { char ch; int64_t value; +#ifndef OPENSSL_SYS_UEFI LDOUBLE fvalue; +#endif char *strvalue; int min; int max; @@ -259,6 +264,7 @@ _dopr(char **sbuffer, min, max, flags)) return 0; break; +#ifndef OPENSSL_SYS_UEFI case 'f': if (cflags == DP_C_LDOUBLE) fvalue = va_arg(args, LDOUBLE); @@ -292,6 +298,16 @@ _dopr(char **sbuffer, flags, G_FORMAT)) return 0; break; +#else + case 'f': + case 'E': + case 'e': + case 'G': + case 'g': + /* not implemented for UEFI */ + ERR_raise(ERR_LIB_BIO, ERR_R_UNSUPPORTED); + return 0; +#endif case 'c': if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, va_arg(args, int))) @@ -512,6 +528,8 @@ fmtint(char **sbuffer, return 1; } +#ifndef OPENSSL_SYS_UEFI + static LDOUBLE abs_val(LDOUBLE value) { LDOUBLE result = value; @@ -803,6 +821,8 @@ fmtfp(char **sbuffer, return 1; } +#endif /* OPENSSL_SYS_UEFI */ + #define BUFFER_INC 1024 static int diff --git a/crypto/openssl/crypto/bn/bn_blind.c b/crypto/openssl/crypto/bn/bn_blind.c index 76fc7ebcffc0..dd5beea7c93e 100644 --- a/crypto/openssl/crypto/bn/bn_blind.c +++ b/crypto/openssl/crypto/bn/bn_blind.c @@ -1,5 +1,5 @@ /* - * Copyright 1998-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1998-2023 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -13,20 +13,6 @@ #define BN_BLINDING_COUNTER 32 -struct bn_blinding_st { - BIGNUM *A; - BIGNUM *Ai; - BIGNUM *e; - BIGNUM *mod; /* just a reference */ - CRYPTO_THREAD_ID tid; - int counter; - unsigned long flags; - BN_MONT_CTX *m_ctx; - int (*bn_mod_exp) (BIGNUM *r, const BIGNUM *a, const BIGNUM *p, - const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); - CRYPTO_RWLOCK *lock; -}; - BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod) { BN_BLINDING *ret = NULL; diff --git a/crypto/openssl/crypto/bn/bn_err.c b/crypto/openssl/crypto/bn/bn_err.c index dd87c152cf37..6f5464b54054 100644 --- a/crypto/openssl/crypto/bn/bn_err.c +++ b/crypto/openssl/crypto/bn/bn_err.c @@ -1,6 +1,6 @@ /* * Generated by util/mkerr.pl DO NOT EDIT - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -73,6 +73,8 @@ static const ERR_STRING_DATA BN_str_functs[] = { {ERR_PACK(ERR_LIB_BN, BN_F_BN_SET_WORDS, 0), "bn_set_words"}, {ERR_PACK(ERR_LIB_BN, BN_F_BN_STACK_PUSH, 0), "BN_STACK_push"}, {ERR_PACK(ERR_LIB_BN, BN_F_BN_USUB, 0), "BN_usub"}, + {ERR_PACK(ERR_LIB_BN, BN_F_OSSL_BN_RSA_DO_UNBLIND, 0), + "ossl_bn_rsa_do_unblind"}, {0, NULL} }; diff --git a/crypto/openssl/crypto/bn/bn_exp.c b/crypto/openssl/crypto/bn/bn_exp.c index e21dcff027c5..517e3c29fc70 100644 --- a/crypto/openssl/crypto/bn/bn_exp.c +++ b/crypto/openssl/crypto/bn/bn_exp.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -37,6 +37,15 @@ extern unsigned int OPENSSL_sparcv9cap_P[]; /* maximum precomputation table size for *variable* sliding windows */ #define TABLE_SIZE 32 +/* + * Beyond this limit the constant time code is disabled due to + * the possible overflow in the computation of powerbufLen in + * BN_mod_exp_mont_consttime. + * When this limit is exceeded, the computation will be done using + * non-constant time code, but it will take very long. + */ +#define BN_CONSTTIME_SIZE_LIMIT (INT_MAX / BN_BYTES / 256) + /* this one works - simple but works */ int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) { @@ -305,12 +314,6 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, BIGNUM *val[TABLE_SIZE]; BN_MONT_CTX *mont = NULL; - if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0 - || BN_get_flags(a, BN_FLG_CONSTTIME) != 0 - || BN_get_flags(m, BN_FLG_CONSTTIME) != 0) { - return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont); - } - bn_check_top(a); bn_check_top(p); bn_check_top(m); @@ -319,6 +322,14 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, BNerr(BN_F_BN_MOD_EXP_MONT, BN_R_CALLED_WITH_EVEN_MODULUS); return 0; } + + if (m->top <= BN_CONSTTIME_SIZE_LIMIT + && (BN_get_flags(p, BN_FLG_CONSTTIME) != 0 + || BN_get_flags(a, BN_FLG_CONSTTIME) != 0 + || BN_get_flags(m, BN_FLG_CONSTTIME) != 0)) { + return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont); + } + bits = BN_num_bits(p); if (bits == 0) { /* x**0 mod 1, or x**0 mod -1 is still zero. */ @@ -618,6 +629,11 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, top = m->top; + if (top > BN_CONSTTIME_SIZE_LIMIT) { + /* Prevent overflowing the powerbufLen computation below */ + return BN_mod_exp_mont(rr, a, p, m, ctx, in_mont); + } + /* * Use all bits stored in |p|, rather than |BN_num_bits|, so we do not leak * whether the top bits are zero. @@ -697,7 +713,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, else #endif #if defined(OPENSSL_BN_ASM_MONT5) - if (window >= 5) { + if (window >= 5 && top <= BN_SOFT_LIMIT) { window = 5; /* ~5% improvement for RSA2048 sign, and even * for RSA4096 */ /* reserve space for mont->N.d[] copy */ @@ -758,6 +774,9 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, if (!bn_to_mont_fixed_top(&am, a, mont, ctx)) goto err; + if (top > BN_SOFT_LIMIT) + goto fallback; + #if defined(SPARC_T4_MONT) if (t4) { typedef int (*bn_pwr5_mont_f) (BN_ULONG *tp, const BN_ULONG *np, @@ -1029,6 +1048,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, } else #endif { + fallback: if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&tmp, top, powerbuf, 0, window)) goto err; if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&am, top, powerbuf, 1, window)) diff --git a/crypto/openssl/crypto/bn/bn_local.h b/crypto/openssl/crypto/bn/bn_local.h index 8ad69ccd3639..30b7614fdbb2 100644 --- a/crypto/openssl/crypto/bn/bn_local.h +++ b/crypto/openssl/crypto/bn/bn_local.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -35,6 +35,26 @@ /* #define BN_DEBUG */ /* #define BN_DEBUG_RAND */ +/* + * This should limit the stack usage due to alloca to about 4K. + * BN_SOFT_LIMIT is a soft limit equivalent to 2*OPENSSL_RSA_MAX_MODULUS_BITS. + * Beyond that size bn_mul_mont is no longer used, and the constant time + * assembler code is disabled, due to the blatant alloca and bn_mul_mont usage. + * Note that bn_mul_mont does an alloca that is hidden away in assembly. + * It is not recommended to do computations with numbers exceeding this limit, + * since the result will be highly version dependent: + * While the current OpenSSL version will use non-optimized, but safe code, + * previous versions will use optimized code, that may crash due to unexpected + * stack overflow, and future versions may very well turn this into a hard + * limit. + * Note however, that it is possible to override the size limit using + * "./config -DBN_SOFT_LIMIT=" if necessary, and the O/S specific + * stack limit is known and taken into consideration. + */ +# ifndef BN_SOFT_LIMIT +# define BN_SOFT_LIMIT (4096 / BN_BYTES) +# endif + # ifndef OPENSSL_SMALL_FOOTPRINT # define BN_MUL_COMBA # define BN_SQR_COMBA @@ -263,6 +283,20 @@ struct bn_gencb_st { } cb; }; +struct bn_blinding_st { + BIGNUM *A; + BIGNUM *Ai; + BIGNUM *e; + BIGNUM *mod; /* just a reference */ + CRYPTO_THREAD_ID tid; + int counter; + unsigned long flags; + BN_MONT_CTX *m_ctx; + int (*bn_mod_exp) (BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); + CRYPTO_RWLOCK *lock; +}; + /*- * BN_window_bits_for_exponent_size -- macro for sliding window mod_exp functions * diff --git a/crypto/openssl/crypto/bn/bn_mont.c b/crypto/openssl/crypto/bn/bn_mont.c index 1e5045a010bb..7617b0df5e70 100644 --- a/crypto/openssl/crypto/bn/bn_mont.c +++ b/crypto/openssl/crypto/bn/bn_mont.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -42,7 +42,7 @@ int bn_mul_mont_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, int num = mont->N.top; #if defined(OPENSSL_BN_ASM_MONT) && defined(MONT_WORD) - if (num > 1 && a->top == num && b->top == num) { + if (num > 1 && num <= BN_SOFT_LIMIT && a->top == num && b->top == num) { if (bn_wexpand(r, num) == NULL) return 0; if (bn_mul_mont(r->d, a->d, b->d, mont->N.d, mont->n0, num)) { diff --git a/crypto/openssl/crypto/bn/build.info b/crypto/openssl/crypto/bn/build.info index b9ed5322fa68..c9fe2fdada69 100644 --- a/crypto/openssl/crypto/bn/build.info +++ b/crypto/openssl/crypto/bn/build.info @@ -5,7 +5,8 @@ SOURCE[../../libcrypto]=\ bn_kron.c bn_sqrt.c bn_gcd.c bn_prime.c bn_err.c bn_sqr.c \ {- $target{bn_asm_src} -} \ bn_recp.c bn_mont.c bn_mpi.c bn_exp2.c bn_gf2m.c bn_nist.c \ - bn_depr.c bn_const.c bn_x931p.c bn_intern.c bn_dh.c bn_srp.c + bn_depr.c bn_const.c bn_x931p.c bn_intern.c bn_dh.c bn_srp.c \ + rsa_sup_mul.c INCLUDE[bn_exp.o]=.. diff --git a/crypto/openssl/crypto/bn/rsa_sup_mul.c b/crypto/openssl/crypto/bn/rsa_sup_mul.c new file mode 100644 index 000000000000..acafefd5febf --- /dev/null +++ b/crypto/openssl/crypto/bn/rsa_sup_mul.c @@ -0,0 +1,614 @@ +#include +#include +#include +#include +#include +#include +#include +#include "internal/numbers.h" +#include "internal/constant_time.h" +#include "bn_local.h" + +# if BN_BYTES == 8 +typedef uint64_t limb_t; +# if defined(__SIZEOF_INT128__) && __SIZEOF_INT128__ == 16 +/* nonstandard; implemented by gcc on 64-bit platforms */ +typedef __uint128_t limb2_t; +# define HAVE_LIMB2_T +# endif +# define LIMB_BIT_SIZE 64 +# define LIMB_BYTE_SIZE 8 +# elif BN_BYTES == 4 +typedef uint32_t limb_t; +typedef uint64_t limb2_t; +# define LIMB_BIT_SIZE 32 +# define LIMB_BYTE_SIZE 4 +# define HAVE_LIMB2_T +# else +# error "Not supported" +# endif + +/* + * For multiplication we're using schoolbook multiplication, + * so if we have two numbers, each with 6 "digits" (words) + * the multiplication is calculated as follows: + * A B C D E F + * x I J K L M N + * -------------- + * N*F + * N*E + * N*D + * N*C + * N*B + * N*A + * M*F + * M*E + * M*D + * M*C + * M*B + * M*A + * L*F + * L*E + * L*D + * L*C + * L*B + * L*A + * K*F + * K*E + * K*D + * K*C + * K*B + * K*A + * J*F + * J*E + * J*D + * J*C + * J*B + * J*A + * I*F + * I*E + * I*D + * I*C + * I*B + * + I*A + * ========================== + * N*B N*D N*F + * + N*A N*C N*E + * + M*B M*D M*F + * + M*A M*C M*E + * + L*B L*D L*F + * + L*A L*C L*E + * + K*B K*D K*F + * + K*A K*C K*E + * + J*B J*D J*F + * + J*A J*C J*E + * + I*B I*D I*F + * + I*A I*C I*E + * + * 1+1 1+3 1+5 + * 1+0 1+2 1+4 + * 0+1 0+3 0+5 + * 0+0 0+2 0+4 + * + * 0 1 2 3 4 5 6 + * which requires n^2 multiplications and 2n full length additions + * as we can keep every other result of limb multiplication in two separate + * limbs + */ + +#if defined HAVE_LIMB2_T +static ossl_inline void _mul_limb(limb_t *hi, limb_t *lo, limb_t a, limb_t b) +{ + limb2_t t; + /* + * this is idiomatic code to tell compiler to use the native mul + * those three lines will actually compile to single instruction + */ + + t = (limb2_t)a * b; + *hi = t >> LIMB_BIT_SIZE; + *lo = (limb_t)t; +} +#elif (BN_BYTES == 8) && (defined _MSC_VER) +/* https://learn.microsoft.com/en-us/cpp/intrinsics/umul128?view=msvc-170 */ +#pragma intrinsic(_umul128) +static ossl_inline void _mul_limb(limb_t *hi, limb_t *lo, limb_t a, limb_t b) +{ + *lo = _umul128(a, b, hi); +} +#else +/* + * if the compiler doesn't have either a 128bit data type nor a "return + * high 64 bits of multiplication" + */ +static ossl_inline void _mul_limb(limb_t *hi, limb_t *lo, limb_t a, limb_t b) +{ + limb_t a_low = (limb_t)(uint32_t)a; + limb_t a_hi = a >> 32; + limb_t b_low = (limb_t)(uint32_t)b; + limb_t b_hi = b >> 32; + + limb_t p0 = a_low * b_low; + limb_t p1 = a_low * b_hi; + limb_t p2 = a_hi * b_low; + limb_t p3 = a_hi * b_hi; + + uint32_t cy = (uint32_t)(((p0 >> 32) + (uint32_t)p1 + (uint32_t)p2) >> 32); + + *lo = p0 + (p1 << 32) + (p2 << 32); + *hi = p3 + (p1 >> 32) + (p2 >> 32) + cy; +} +#endif + +/* add two limbs with carry in, return carry out */ +static ossl_inline limb_t _add_limb(limb_t *ret, limb_t a, limb_t b, limb_t carry) +{ + limb_t carry1, carry2, t; + /* + * `c = a + b; if (c < a)` is idiomatic code that makes compilers + * use add with carry on assembly level + */ + + *ret = a + carry; + if (*ret < a) + carry1 = 1; + else + carry1 = 0; + + t = *ret; + *ret = t + b; + if (*ret < t) + carry2 = 1; + else + carry2 = 0; + + return carry1 + carry2; +} + +/* + * add two numbers of the same size, return overflow + * + * add a to b, place result in ret; all arrays need to be n limbs long + * return overflow from addition (0 or 1) + */ +static ossl_inline limb_t add(limb_t *ret, limb_t *a, limb_t *b, size_t n) +{ + limb_t c = 0; + ossl_ssize_t i; + + for(i = n - 1; i > -1; i--) + c = _add_limb(&ret[i], a[i], b[i], c); + + return c; +} + +/* + * return number of limbs necessary for temporary values + * when multiplying numbers n limbs large + */ +static ossl_inline size_t mul_limb_numb(size_t n) +{ + return 2 * n * 2; +} + +/* + * multiply two numbers of the same size + * + * multiply a by b, place result in ret; a and b need to be n limbs long + * ret needs to be 2*n limbs long, tmp needs to be mul_limb_numb(n) limbs + * long + */ +static void limb_mul(limb_t *ret, limb_t *a, limb_t *b, size_t n, limb_t *tmp) +{ + limb_t *r_odd, *r_even; + size_t i, j, k; + + r_odd = tmp; + r_even = &tmp[2 * n]; + + memset(ret, 0, 2 * n * sizeof(limb_t)); + + for (i = 0; i < n; i++) { + for (k = 0; k < i + n + 1; k++) { + r_even[k] = 0; + r_odd[k] = 0; + } + for (j = 0; j < n; j++) { + /* + * place results from even and odd limbs in separate arrays so that + * we don't have to calculate overflow every time we get individual + * limb multiplication result + */ + if (j % 2 == 0) + _mul_limb(&r_even[i + j], &r_even[i + j + 1], a[i], b[j]); + else + _mul_limb(&r_odd[i + j], &r_odd[i + j + 1], a[i], b[j]); + } + /* + * skip the least significant limbs when adding multiples of + * more significant limbs (they're zero anyway) + */ + add(ret, ret, r_even, n + i + 1); + add(ret, ret, r_odd, n + i + 1); + } +} + +/* modifies the value in place by performing a right shift by one bit */ +static ossl_inline void rshift1(limb_t *val, size_t n) +{ + limb_t shift_in = 0, shift_out = 0; + size_t i; + + for (i = 0; i < n; i++) { + shift_out = val[i] & 1; + val[i] = shift_in << (LIMB_BIT_SIZE - 1) | (val[i] >> 1); + shift_in = shift_out; + } +} + +/* extend the LSB of flag to all bits of limb */ +static ossl_inline limb_t mk_mask(limb_t flag) +{ + flag |= flag << 1; + flag |= flag << 2; + flag |= flag << 4; + flag |= flag << 8; + flag |= flag << 16; +#if (LIMB_BYTE_SIZE == 8) + flag |= flag << 32; +#endif + return flag; +} + +/* + * copy from either a or b to ret based on flag + * when flag == 0, then copies from b + * when flag == 1, then copies from a + */ +static ossl_inline void cselect(limb_t flag, limb_t *ret, limb_t *a, limb_t *b, size_t n) +{ + /* + * would be more efficient with non volatile mask, but then gcc + * generates code with jumps + */ + volatile limb_t mask; + size_t i; + + mask = mk_mask(flag); + for (i = 0; i < n; i++) { +#if (LIMB_BYTE_SIZE == 8) + ret[i] = constant_time_select_64(mask, a[i], b[i]); +#else + ret[i] = constant_time_select_32(mask, a[i], b[i]); +#endif + } +} + *** 834 LINES SKIPPED *** From nobody Tue Feb 7 22:40:54 2023 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 4PBJ4l1h7Tz3np5P; Tue, 7 Feb 2023 22:40:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PBJ4k74RMz3jkc; Tue, 7 Feb 2023 22:40:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675809655; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nc64Dxw1Z/cMlPPObkmwch1yBCSKOU+IeD5d00ni/LQ=; b=YNA5L/uj1KjIXjfap15JWi32Wots4dttkALNn9m4kVqI74bNUFjCkcyKwkOH4ZM9trIKvq EwAkJ0cloqPb/qTtV9WM5OkN63ODMF9Yw8DGxKonzu5xhGw6luAWDbMEYKeljoS6QvoeAe bpdr5Qtn+9gHSzhUoflRkVLyOr9RCCACfGNCPLHc9M1OKSinm0YMGw7y3J2CEXIthVe6zb 7CChnETUscI0i0SnvYyPpfxVIBJkM/39nKiVL7ow7KwvuK766z0mV50miaqaSrSI9KTTRF Wrc8L6B0IxgW6Fzps14Ahdu13zw5N3p77elYgZ1FCCK2JAO5MSwuxGEnV2qxMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675809655; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nc64Dxw1Z/cMlPPObkmwch1yBCSKOU+IeD5d00ni/LQ=; b=etUXU5DDDkjbQLxXg7qcjP+Hm5KtqV4v7jxBQtiv0zYkFf/hK1vePUTcDBuWsdy4wRsu8f YTse+eDZx0gdiqhKhF4j5rM14zqYay4kORbMFGeJj0FaISwpNbjMwpTRM5XSmldOIZHZNE AfYkaVPnnCh63BCLWf+Qci1N0VuRjm01Fy1950OBuIFlBCF0QX4XI6rmsmBPSuciviLM/c 6Hv4yfMptReRnjCDlOoBgIsUzw0r6qDunNrmSUjbFji/FYNJBvu6GoDcF0auHlK9EAgksf ytiL9HMqcz9nS5pRj3fBzvchcy61HSWOizZvVyzHrOSOgrcXLLmxhF96RFFDMg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675809655; a=rsa-sha256; cv=none; b=N+cAqEcICExMwF4aH1oMFjxwgu6JLXjPbAlGpa1omLDGCLc4gCFGmNL274FlYKKMPAim3/ dG+34FeYgE05yrfZOk2FMRyngMyyNdNdMkXPjVFx8OIMCaV2MP30fzO/KauKvQ0/pFru3w LpIzxo6BmN6SI81vunCn3Ax9ae/r3oigAtmoqt7NmaUHoJHMFkbgY+8XbJxaoHG8MTjL/U n23de3wyJDczQEp+V/BQUFXtBYt9FfSUji8dX0LsbpVP+V6DqB2x661ZFtmFDtIYoODRfb wmESdPmabYc7xgqvZ2wpnd5c1RyLriBm1ilrsNQ2X/KXxyAcSMqOsPd0Y3Iy+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 4PBJ4k5dCBzZ4J; Tue, 7 Feb 2023 22:40:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 317MesRv046386; Tue, 7 Feb 2023 22:40:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 317Mes4f046385; Tue, 7 Feb 2023 22:40:54 GMT (envelope-from git) Date: Tue, 7 Feb 2023 22:40:54 GMT Message-Id: <202302072240.317Mes4f046385@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jung-uk Kim Subject: git: 03b4dfb4d90b - stable/13 - OpenSSL: Merge OpenSSL 1.1.1t 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: jkim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 03b4dfb4d90bb782adb6810a00c1112d4dae0ac1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=03b4dfb4d90bb782adb6810a00c1112d4dae0ac1 commit 03b4dfb4d90bb782adb6810a00c1112d4dae0ac1 Author: Jung-uk Kim AuthorDate: 2023-02-07 18:54:16 +0000 Commit: Jung-uk Kim CommitDate: 2023-02-07 22:39:07 +0000 OpenSSL: Merge OpenSSL 1.1.1t (cherry picked from commit fb3134558138e52322ebcdf66fee8288ee308d78) --- secure/lib/libcrypto/Makefile | 1 + secure/lib/libcrypto/Makefile.inc | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/secure/lib/libcrypto/Makefile b/secure/lib/libcrypto/Makefile index d8b8f454122c..8fde4f19d046 100644 --- a/secure/lib/libcrypto/Makefile +++ b/secure/lib/libcrypto/Makefile @@ -121,6 +121,7 @@ SRCS+= ppc.S ppc-mont.S .else SRCS+= bn_asm.c .endif +SRCS+= rsa_sup_mul.c # Full of strict aliasing violations that LLVM has been seen to break with # optimisations, which can lead to ECDSA signatures not working. See diff --git a/secure/lib/libcrypto/Makefile.inc b/secure/lib/libcrypto/Makefile.inc index 59f39be8fef3..8b89b9e36a08 100644 --- a/secure/lib/libcrypto/Makefile.inc +++ b/secure/lib/libcrypto/Makefile.inc @@ -3,8 +3,8 @@ .include # OpenSSL version used for manual page generation -OPENSSL_VER= 1.1.1s -OPENSSL_DATE= 2022-11-01 +OPENSSL_VER= 1.1.1t +OPENSSL_DATE= 2023-02-07 LCRYPTO_SRC= ${SRCTOP}/crypto/openssl LCRYPTO_DOC= ${LCRYPTO_SRC}/doc From nobody Tue Feb 7 22:40:55 2023 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 4PBJ4m2hWzz3npJr; Tue, 7 Feb 2023 22:40:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PBJ4m1Pf5z3jfV; Tue, 7 Feb 2023 22:40:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675809656; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QXW4Cu/jdMYVe98nlluYvMleDU72BNETJRQ9F8LIFoo=; b=URSw13HDALafMk8Z/tCiIzLCb5atEyND/Y5E8lEVcI/f1r5QNrJjw9yw4J/hPrcLSs0rEL gxUsdsh+7ygURgo+BsOKiuJxhaLtkKK0J4Muq+uxho2UCd+tCFiX5iackRHhYUabyfUPHm 4uaD3W+g6yViCUhSel28SLAI1bPRBu+Ml9IuIIHra364i+LcYRVN8Ra6FYZPRwoR9DT276 5YmQqJZjIYGjQD4md5PHWGzuzWRRe2eGhiZphuShDZLd3pEf7ocpyAw7k3Td70rPwetY5i A+VklG5DXsRIqU/vZtOhFlQbgwBnDYvtiJ9kN5S3AuCcub2OmlzNu820Nkpf5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675809656; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QXW4Cu/jdMYVe98nlluYvMleDU72BNETJRQ9F8LIFoo=; b=g+5jDwqjdAbInBajhGhzyjUB3ixvXgKBik3P7Q97YX94HPHE74uEb669icgivZmRWxxpZZ BYRVnA3ovTYcsVrA8T7wxS2e2V5RQY7GXtf9owl9TkinM4jouxD4xiWvV79A224bzb1bG+ Y1y2cbG0djIIJOrE/I7vxMtTHpSlBpYOIps3w1Xob78AuTzmUkUymgB47xaSIAF/lHPgyx ohkh63AgZfWT47dzyM/PRhDF6nqiXZUhU7WvqS6WCfj1ItIpCltq+YMBAs8HMLjLAMtCT7 t+QrYyf3IC+gwxDYuGA3Vi4/3fRK6tS/xm9p7nXQxYt9CB5Oqm4avGoTQHwBAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675809656; a=rsa-sha256; cv=none; b=ZuQbC2O8VgA6bswohpMEBMxIZ2vN9uWJCYmeZ52f5QhA3U8G4WyO08gKmB1fd3CocX1RqI 9NYYPpmokBKVl14BM/SHeZDZ4IDCaSvkUsHnrS6KOMs2nuh1G+ZfctIozVVij0dunQK//V WfGvb3mx//Yv4sUOZs2d+jNOfVSA6tAo3LASnnL84RJTamnecp7/b3rjdtzULQhvw5xhtk QJ/bCFKbRxeULWQdfXAPaYSkhlj6SW03ow2zuzvBWRT3FX+oReRkpd57l79aG3qeqn9Obc 3WvS68GRg7Md58RNEt0UBF9/Y/yMLKEqtLkn4//bc3zQEHTwYvpYhAldtdE6dw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBJ4l6k8szZFZ; Tue, 7 Feb 2023 22:40:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 317Met7A046410; Tue, 7 Feb 2023 22:40:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 317Metel046409; Tue, 7 Feb 2023 22:40:55 GMT (envelope-from git) Date: Tue, 7 Feb 2023 22:40:55 GMT Message-Id: <202302072240.317Metel046409@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jung-uk Kim Subject: git: 7c83b34ab36e - stable/13 - OpenSSL: Regen assembly files for OpenSSL 1.1.1t 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: jkim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7c83b34ab36ee2941360a170d4b806df19648947 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=7c83b34ab36ee2941360a170d4b806df19648947 commit 7c83b34ab36ee2941360a170d4b806df19648947 Author: Jung-uk Kim AuthorDate: 2023-02-07 18:55:17 +0000 Commit: Jung-uk Kim CommitDate: 2023-02-07 22:39:41 +0000 OpenSSL: Regen assembly files for OpenSSL 1.1.1t (cherry picked from commit f1cf49002dbb0b1976ef1ebd8e689a7825e3e06f) --- sys/crypto/openssl/amd64/e_padlock-x86_64.S | 2 ++ sys/crypto/openssl/i386/e_padlock-x86.S | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/sys/crypto/openssl/amd64/e_padlock-x86_64.S b/sys/crypto/openssl/amd64/e_padlock-x86_64.S index de2866844652..b19cf1d0b2d3 100644 --- a/sys/crypto/openssl/amd64/e_padlock-x86_64.S +++ b/sys/crypto/openssl/amd64/e_padlock-x86_64.S @@ -45,6 +45,8 @@ padlock_capability: .align 16 padlock_key_bswap: movl 240(%rdi),%edx + incl %edx + shll $2,%edx .Lbswap_loop: movl (%rdi),%eax bswapl %eax diff --git a/sys/crypto/openssl/i386/e_padlock-x86.S b/sys/crypto/openssl/i386/e_padlock-x86.S index 4ddc50bcaf58..58085b33679b 100644 --- a/sys/crypto/openssl/i386/e_padlock-x86.S +++ b/sys/crypto/openssl/i386/e_padlock-x86.S @@ -69,6 +69,8 @@ padlock_key_bswap: .L_padlock_key_bswap_begin: movl 4(%esp),%edx movl 240(%edx),%ecx + incl %ecx + shll $2,%ecx .L003bswap_loop: movl (%edx),%eax bswap %eax @@ -1109,6 +1111,8 @@ padlock_key_bswap: .L_padlock_key_bswap_begin: movl 4(%esp),%edx movl 240(%edx),%ecx + incl %ecx + shll $2,%ecx .L003bswap_loop: movl (%edx),%eax bswap %eax From nobody Tue Feb 7 22:40:56 2023 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 4PBJ4n61wNz3npGh; Tue, 7 Feb 2023 22:40: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 4PBJ4n3yHmz3jl4; Tue, 7 Feb 2023 22:40:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675809657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BD9evOpQSvy2TwCZ+5uPq2Wrr/sU6NtZV9LMedT74Is=; b=q78NhcuaOPwGXSWayGY6HrNtqbyJ4BFIlF6Iv44ew+f20fzJVawZ+MLXkFfkFsS5QoW2uX 2EO7+qFLEchGGbMjFNdkMqw5w0BVIUC+FE4NaZen2Dta/9wZAnZYHVpbu0aFAJsdZAAAgb CAkfG4irIlCOcV6yx0qFTCvLc7mHlUxzmasOD94/6NRnlfiffhcTmhkg6EzicIQy97Z8ev FY52dnOzSqp9XaAmNAtleXfv5BVEjhw9c0jMIjCmBx1Gp0XVCNOyZUooSx/Qc1sEzhdeq5 KohtosFZIHwuTzgO6SqoqbZaK9djL902Ni+fD6eSxfRcZ5N2wenX7Bk7G20PaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675809657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BD9evOpQSvy2TwCZ+5uPq2Wrr/sU6NtZV9LMedT74Is=; b=SwA7Oh4mvX5ectN+7bK7ljQgtAWAKRSXva/5fV2exN1DpuC/X5xlcS9wSFsk8+iZDv8tNl OoxQZeyvCwP91NzGiHWeU8cM+1sk3gkGb/3I0VDOZl9FuZ5YC10oUY3luNhtRnM+YEZPNj ZyEUXCCz8U4nwBBHbTE57fe/6WlNgBiOAtjq5NVBfUAAElPkf22Unj4MeYfaJk6C2FMq0x 2P7GF/+Sb93YJy6SH9feQt6gSlQnD6iAnTKqbsm67hig8n0mXng02eke9tLYgsV+SfVMRm NmDC4QrIa/oW5xyJo80/3ERBdNKYQ9MI0/uVTd8S7RdvHNKpyrkMYxq0kmGIqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675809657; a=rsa-sha256; cv=none; b=d3+QsyVVs0ZLUxYuXuJzLmubolb6d/qXpKS4NXpy+HpPwGW2B8n4tZ1LohYbnRVYL4wOPB bn5l+tT3H6kpvlwg/dRjr2dqxDYUr+0YuTqDEH7dZtM6DkW6cfSM0q9SDd+9S3WR1FVotA fRaEEhZ/gUUVntjmXfxYQ0mWU+9Cg75KrpQLPGFmQ6aqO/th1s9b6Go97iVXZQQdd+YtWR VdASJTSNAviYJCw5zcYmjranpgHg8x5++hzGmq1/p9OcoayBdQcpNn5EZ90n0I6BcDmCzy bF4bmD4R7fy6C8KbB7vXnaiHqvkdoavJ3eepctNAHe4Oh3PW1voly6MX01zwbg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBJ4n1XvQzYkB; Tue, 7 Feb 2023 22:40:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 317MevbK046434; Tue, 7 Feb 2023 22:40:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 317MeuBZ046433; Tue, 7 Feb 2023 22:40:56 GMT (envelope-from git) Date: Tue, 7 Feb 2023 22:40:56 GMT Message-Id: <202302072240.317MeuBZ046433@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jung-uk Kim Subject: git: 4f0087aa7c0d - stable/13 - OpenSSL: Regen manual pages for OpenSSL 1.1.1t 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: jkim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4f0087aa7c0d7a57c39f7ca8f6c6784ebd5e0b85 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=4f0087aa7c0d7a57c39f7ca8f6c6784ebd5e0b85 commit 4f0087aa7c0d7a57c39f7ca8f6c6784ebd5e0b85 Author: Jung-uk Kim AuthorDate: 2023-02-07 19:01:15 +0000 Commit: Jung-uk Kim CommitDate: 2023-02-07 22:40:12 +0000 OpenSSL: Regen manual pages for OpenSSL 1.1.1t (cherry picked from commit eb9b98fb5aea1b20d71b0be948454f472b024da7) --- secure/lib/libcrypto/man/man3/ADMISSIONS.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_INTEGER_get_int64.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_STRING_length.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_STRING_new.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_STRING_print_ex.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_TIME_set.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_TYPE_get.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_generate_nconf.3 | 2 +- secure/lib/libcrypto/man/man3/ASYNC_WAIT_CTX_new.3 | 2 +- secure/lib/libcrypto/man/man3/ASYNC_start_job.3 | 2 +- secure/lib/libcrypto/man/man3/BF_encrypt.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_ADDR.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_ADDRINFO.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_connect.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_ctrl.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_f_base64.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_f_buffer.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_f_cipher.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_f_md.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_f_null.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_f_ssl.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_find_type.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_get_data.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_get_ex_new_index.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_new.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_new_CMS.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_parse_hostserv.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_printf.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_push.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_read.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_accept.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_bio.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_connect.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_fd.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_file.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_mem.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_null.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_socket.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_set_callback.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_should_retry.3 | 2 +- secure/lib/libcrypto/man/man3/BN_BLINDING_new.3 | 2 +- secure/lib/libcrypto/man/man3/BN_CTX_new.3 | 2 +- secure/lib/libcrypto/man/man3/BN_CTX_start.3 | 2 +- secure/lib/libcrypto/man/man3/BN_add.3 | 2 +- secure/lib/libcrypto/man/man3/BN_add_word.3 | 2 +- secure/lib/libcrypto/man/man3/BN_bn2bin.3 | 2 +- secure/lib/libcrypto/man/man3/BN_cmp.3 | 2 +- secure/lib/libcrypto/man/man3/BN_copy.3 | 2 +- secure/lib/libcrypto/man/man3/BN_generate_prime.3 | 2 +- secure/lib/libcrypto/man/man3/BN_mod_inverse.3 | 2 +- secure/lib/libcrypto/man/man3/BN_mod_mul_montgomery.3 | 2 +- secure/lib/libcrypto/man/man3/BN_mod_mul_reciprocal.3 | 2 +- secure/lib/libcrypto/man/man3/BN_new.3 | 2 +- secure/lib/libcrypto/man/man3/BN_num_bytes.3 | 2 +- secure/lib/libcrypto/man/man3/BN_rand.3 | 2 +- secure/lib/libcrypto/man/man3/BN_security_bits.3 | 2 +- secure/lib/libcrypto/man/man3/BN_set_bit.3 | 2 +- secure/lib/libcrypto/man/man3/BN_swap.3 | 2 +- secure/lib/libcrypto/man/man3/BN_zero.3 | 2 +- secure/lib/libcrypto/man/man3/BUF_MEM_new.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_add0_cert.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_add1_recipient_cert.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_add1_signer.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_compress.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_decrypt.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_encrypt.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_final.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_get0_RecipientInfos.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_get0_SignerInfos.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_get0_type.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_get1_ReceiptRequest.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_sign.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_sign_receipt.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_uncompress.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_verify.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_verify_receipt.3 | 2 +- secure/lib/libcrypto/man/man3/CONF_modules_free.3 | 2 +- secure/lib/libcrypto/man/man3/CONF_modules_load_file.3 | 2 +- secure/lib/libcrypto/man/man3/CRYPTO_THREAD_run_once.3 | 2 +- secure/lib/libcrypto/man/man3/CRYPTO_get_ex_new_index.3 | 2 +- secure/lib/libcrypto/man/man3/CRYPTO_memcmp.3 | 2 +- secure/lib/libcrypto/man/man3/CTLOG_STORE_get0_log_by_id.3 | 2 +- secure/lib/libcrypto/man/man3/CTLOG_STORE_new.3 | 2 +- secure/lib/libcrypto/man/man3/CTLOG_new.3 | 2 +- secure/lib/libcrypto/man/man3/CT_POLICY_EVAL_CTX_new.3 | 2 +- secure/lib/libcrypto/man/man3/DEFINE_STACK_OF.3 | 2 +- secure/lib/libcrypto/man/man3/DES_random_key.3 | 2 +- secure/lib/libcrypto/man/man3/DH_generate_key.3 | 2 +- secure/lib/libcrypto/man/man3/DH_generate_parameters.3 | 2 +- secure/lib/libcrypto/man/man3/DH_get0_pqg.3 | 2 +- secure/lib/libcrypto/man/man3/DH_get_1024_160.3 | 2 +- secure/lib/libcrypto/man/man3/DH_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/DH_new.3 | 2 +- secure/lib/libcrypto/man/man3/DH_new_by_nid.3 | 2 +- secure/lib/libcrypto/man/man3/DH_set_method.3 | 2 +- secure/lib/libcrypto/man/man3/DH_size.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_SIG_new.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_do_sign.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_dup_DH.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_generate_key.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_generate_parameters.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_get0_pqg.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_new.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_set_method.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_sign.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_size.3 | 2 +- secure/lib/libcrypto/man/man3/DTLS_get_data_mtu.3 | 2 +- secure/lib/libcrypto/man/man3/DTLS_set_timer_cb.3 | 2 +- secure/lib/libcrypto/man/man3/DTLSv1_listen.3 | 2 +- secure/lib/libcrypto/man/man3/ECDSA_SIG_new.3 | 2 +- secure/lib/libcrypto/man/man3/ECPKParameters_print.3 | 2 +- secure/lib/libcrypto/man/man3/EC_GFp_simple_method.3 | 2 +- secure/lib/libcrypto/man/man3/EC_GROUP_copy.3 | 2 +- secure/lib/libcrypto/man/man3/EC_GROUP_new.3 | 2 +- secure/lib/libcrypto/man/man3/EC_KEY_get_enc_flags.3 | 2 +- secure/lib/libcrypto/man/man3/EC_KEY_new.3 | 2 +- secure/lib/libcrypto/man/man3/EC_POINT_add.3 | 2 +- secure/lib/libcrypto/man/man3/EC_POINT_new.3 | 2 +- secure/lib/libcrypto/man/man3/ENGINE_add.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_GET_LIB.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_clear_error.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_error_string.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_get_error.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_load_crypto_strings.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_load_strings.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_print_errors.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_put_error.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_remove_state.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_set_mark.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_BytesToKey.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_CIPHER_CTX_get_cipher_data.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_CIPHER_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_DigestInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_DigestSignInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_DigestVerifyInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_EncodeInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_EncryptInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_MD_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_OpenInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_ASN1_METHOD.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_ctrl.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_new.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_set1_pbe_pass.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_set_hkdf_md.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_set_rsa_pss_keygen_md.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_set_scrypt_N.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_set_tls1_prf_md.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_asn1_get_count.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_cmp.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_decrypt.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_derive.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_encrypt.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_get_default_digest_nid.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_keygen.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_meth_get_count.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_new.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_print_private.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_set1_RSA.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_sign.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_size.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_verify.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_verify_recover.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_SealInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_SignInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_VerifyInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_aes.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_aria.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_bf_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_blake2b512.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_camellia.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_cast5_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_chacha20.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_des.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_desx_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_idea_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_md2.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_md4.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_md5.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_mdc2.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_rc2_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_rc4.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_rc5_32_12_16_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_ripemd160.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_seed_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_sha1.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_sha224.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_sha3_224.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_sm3.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_sm4_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_whirlpool.3 | 2 +- secure/lib/libcrypto/man/man3/HMAC.3 | 2 +- secure/lib/libcrypto/man/man3/MD5.3 | 2 +- secure/lib/libcrypto/man/man3/MDC2_Init.3 | 2 +- secure/lib/libcrypto/man/man3/OBJ_nid2obj.3 | 2 +- secure/lib/libcrypto/man/man3/OCSP_REQUEST_new.3 | 2 +- secure/lib/libcrypto/man/man3/OCSP_cert_to_id.3 | 2 +- secure/lib/libcrypto/man/man3/OCSP_request_add1_nonce.3 | 2 +- secure/lib/libcrypto/man/man3/OCSP_resp_find_status.3 | 2 +- secure/lib/libcrypto/man/man3/OCSP_response_status.3 | 2 +- secure/lib/libcrypto/man/man3/OCSP_sendreq_new.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_Applink.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_LH_COMPFUNC.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_LH_stats.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_VERSION_NUMBER.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_config.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_fork_prepare.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_ia32cap.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_init_crypto.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_init_ssl.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_instrument_bus.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_load_builtin_modules.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_malloc.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_secure_malloc.3 | 2 +- secure/lib/libcrypto/man/man3/OSSL_STORE_INFO.3 | 2 +- secure/lib/libcrypto/man/man3/OSSL_STORE_LOADER.3 | 2 +- secure/lib/libcrypto/man/man3/OSSL_STORE_SEARCH.3 | 2 +- secure/lib/libcrypto/man/man3/OSSL_STORE_expect.3 | 2 +- secure/lib/libcrypto/man/man3/OSSL_STORE_open.3 | 2 +- secure/lib/libcrypto/man/man3/OpenSSL_add_all_algorithms.3 | 2 +- secure/lib/libcrypto/man/man3/PEM_bytes_read_bio.3 | 2 +- secure/lib/libcrypto/man/man3/PEM_read.3 | 2 +- secure/lib/libcrypto/man/man3/PEM_read_CMS.3 | 2 +- secure/lib/libcrypto/man/man3/PEM_read_bio_PrivateKey.3 | 2 +- secure/lib/libcrypto/man/man3/PEM_read_bio_ex.3 | 2 +- secure/lib/libcrypto/man/man3/PEM_write_bio_CMS_stream.3 | 2 +- secure/lib/libcrypto/man/man3/PEM_write_bio_PKCS7_stream.3 | 2 +- secure/lib/libcrypto/man/man3/PKCS12_create.3 | 2 +- secure/lib/libcrypto/man/man3/PKCS12_newpass.3 | 2 +- secure/lib/libcrypto/man/man3/PKCS12_parse.3 | 2 +- secure/lib/libcrypto/man/man3/PKCS5_PBKDF2_HMAC.3 | 2 +- secure/lib/libcrypto/man/man3/PKCS7_decrypt.3 | 2 +- secure/lib/libcrypto/man/man3/PKCS7_encrypt.3 | 2 +- secure/lib/libcrypto/man/man3/PKCS7_sign.3 | 2 +- secure/lib/libcrypto/man/man3/PKCS7_sign_add_signer.3 | 2 +- secure/lib/libcrypto/man/man3/PKCS7_verify.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_DRBG_generate.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_DRBG_get0_master.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_DRBG_new.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_DRBG_reseed.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_DRBG_set_callbacks.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_DRBG_set_ex_data.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_add.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_bytes.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_cleanup.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_egd.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_load_file.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_set_rand_method.3 | 2 +- secure/lib/libcrypto/man/man3/RC4_set_key.3 | 2 +- secure/lib/libcrypto/man/man3/RIPEMD160_Init.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_blinding_on.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_check_key.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_generate_key.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_get0_key.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_new.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_padding_add_PKCS1_type_1.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_print.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_private_encrypt.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_public_encrypt.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_set_method.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_sign.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_sign_ASN1_OCTET_STRING.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_size.3 | 2 +- secure/lib/libcrypto/man/man3/SCT_new.3 | 2 +- secure/lib/libcrypto/man/man3/SCT_print.3 | 2 +- secure/lib/libcrypto/man/man3/SCT_validate.3 | 2 +- secure/lib/libcrypto/man/man3/SHA256_Init.3 | 2 +- secure/lib/libcrypto/man/man3/SMIME_read_CMS.3 | 2 +- secure/lib/libcrypto/man/man3/SMIME_read_PKCS7.3 | 2 +- secure/lib/libcrypto/man/man3/SMIME_write_CMS.3 | 2 +- secure/lib/libcrypto/man/man3/SMIME_write_PKCS7.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CIPHER_get_name.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_COMP_add_compression_method.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CONF_CTX_new.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CONF_CTX_set1_prefix.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CONF_CTX_set_flags.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CONF_CTX_set_ssl_ctx.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CONF_cmd.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CONF_cmd_argv.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_add1_chain_cert.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_add_extra_chain_cert.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_add_session.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_config.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_ctrl.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_dane_enable.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_flush_sessions.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_free.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_get0_param.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_get_verify_mode.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_has_client_custom_ext.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_load_verify_locations.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_new.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_sess_number.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_sess_set_cache_size.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_sess_set_get_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_sessions.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set0_CA_list.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set1_curves.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set1_sigalgs.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set1_verify_cert_store.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_alpn_select_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_cert_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_cert_store.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_cert_verify_callback.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_cipher_list.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_client_cert_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_client_hello_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_ct_validation_callback.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_ctlog_list_file.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_default_passwd_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_ex_data.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_generate_session_id.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_info_callback.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_keylog_callback.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_max_cert_list.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_min_proto_version.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_mode.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_msg_callback.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_num_tickets.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_options.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_psk_client_callback.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_quiet_shutdown.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_read_ahead.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_record_padding_callback.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_security_level.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_session_cache_mode.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_session_id_context.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_session_ticket_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_split_send_fragment.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_ssl_version.3 | 2 +- .../lib/libcrypto/man/man3/SSL_CTX_set_stateless_cookie_generate_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_timeout.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_tlsext_servername_callback.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_tlsext_status_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_tlsext_ticket_key_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_tlsext_use_srtp.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_tmp_dh_callback.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_verify.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_use_certificate.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_use_psk_identity_hint.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_use_serverinfo.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_free.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_get0_cipher.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_get0_hostname.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_get0_id_context.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_get0_peer.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_get_compress_id.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_get_ex_data.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_get_protocol_version.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_get_time.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_has_ticket.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_is_resumable.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_print.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_set1_id.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_accept.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_alert_type_string.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_alloc_buffers.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_check_chain.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_clear.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_connect.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_do_handshake.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_export_keying_material.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_extension_supported.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_free.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get0_peer_scts.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_SSL_CTX.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_all_async_fds.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_ciphers.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_client_random.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_current_cipher.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_default_timeout.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_error.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_extms_support.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_fd.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_peer_cert_chain.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_peer_certificate.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_peer_signature_nid.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_peer_tmp_key.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_psk_identity.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_rbio.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_session.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_shared_sigalgs.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_verify_result.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_version.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_in_init.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_key_update.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_library_init.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_load_client_CA_file.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_new.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_pending.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_read.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_read_early_data.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_rstate_string.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_session_reused.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_set1_host.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_set_bio.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_set_connect_state.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_set_fd.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_set_session.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_set_shutdown.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_set_verify_result.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_shutdown.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_state_string.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_want.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_write.3 | 2 +- secure/lib/libcrypto/man/man3/UI_STRING.3 | 2 +- secure/lib/libcrypto/man/man3/UI_UTIL_read_pw.3 | 2 +- secure/lib/libcrypto/man/man3/UI_create_method.3 | 2 +- secure/lib/libcrypto/man/man3/UI_new.3 | 2 +- secure/lib/libcrypto/man/man3/X509V3_get_d2i.3 | 2 +- secure/lib/libcrypto/man/man3/X509_ALGOR_dup.3 | 2 +- secure/lib/libcrypto/man/man3/X509_CRL_get0_by_serial.3 | 2 +- secure/lib/libcrypto/man/man3/X509_EXTENSION_set_object.3 | 2 +- secure/lib/libcrypto/man/man3/X509_LOOKUP.3 | 2 +- secure/lib/libcrypto/man/man3/X509_LOOKUP_hash_dir.3 | 2 +- secure/lib/libcrypto/man/man3/X509_LOOKUP_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/X509_NAME_ENTRY_get_object.3 | 2 +- secure/lib/libcrypto/man/man3/X509_NAME_add_entry_by_txt.3 | 2 +- secure/lib/libcrypto/man/man3/X509_NAME_get0_der.3 | 2 +- secure/lib/libcrypto/man/man3/X509_NAME_get_index_by_NID.3 | 2 +- secure/lib/libcrypto/man/man3/X509_NAME_print_ex.3 | 2 +- secure/lib/libcrypto/man/man3/X509_PUBKEY_new.3 | 2 +- secure/lib/libcrypto/man/man3/X509_SIG_get0.3 | 2 +- secure/lib/libcrypto/man/man3/X509_STORE_CTX_get_error.3 | 2 +- secure/lib/libcrypto/man/man3/X509_STORE_CTX_new.3 | 2 +- secure/lib/libcrypto/man/man3/X509_STORE_CTX_set_verify_cb.3 | 2 +- secure/lib/libcrypto/man/man3/X509_STORE_add_cert.3 | 2 +- secure/lib/libcrypto/man/man3/X509_STORE_get0_param.3 | 2 +- secure/lib/libcrypto/man/man3/X509_STORE_new.3 | 2 +- secure/lib/libcrypto/man/man3/X509_STORE_set_verify_cb_func.3 | 2 +- secure/lib/libcrypto/man/man3/X509_VERIFY_PARAM_set_flags.3 | 2 +- secure/lib/libcrypto/man/man3/X509_check_ca.3 | 2 +- secure/lib/libcrypto/man/man3/X509_check_host.3 | 2 +- secure/lib/libcrypto/man/man3/X509_check_issued.3 | 2 +- secure/lib/libcrypto/man/man3/X509_check_private_key.3 | 2 +- secure/lib/libcrypto/man/man3/X509_check_purpose.3 | 2 +- secure/lib/libcrypto/man/man3/X509_cmp.3 | 2 +- secure/lib/libcrypto/man/man3/X509_cmp_time.3 | 2 +- secure/lib/libcrypto/man/man3/X509_digest.3 | 2 +- secure/lib/libcrypto/man/man3/X509_dup.3 | 2 +- secure/lib/libcrypto/man/man3/X509_get0_notBefore.3 | 2 +- secure/lib/libcrypto/man/man3/X509_get0_signature.3 | 2 +- secure/lib/libcrypto/man/man3/X509_get0_uids.3 | 2 +- secure/lib/libcrypto/man/man3/X509_get_extension_flags.3 | 2 +- secure/lib/libcrypto/man/man3/X509_get_pubkey.3 | 2 +- secure/lib/libcrypto/man/man3/X509_get_serialNumber.3 | 2 +- secure/lib/libcrypto/man/man3/X509_get_subject_name.3 | 2 +- secure/lib/libcrypto/man/man3/X509_get_version.3 | 2 +- secure/lib/libcrypto/man/man3/X509_new.3 | 2 +- secure/lib/libcrypto/man/man3/X509_sign.3 | 2 +- secure/lib/libcrypto/man/man3/X509_verify_cert.3 | 2 +- secure/lib/libcrypto/man/man3/X509v3_get_ext_by_NID.3 | 2 +- secure/lib/libcrypto/man/man3/d2i_DHparams.3 | 2 +- secure/lib/libcrypto/man/man3/d2i_PKCS8PrivateKey_bio.3 | 2 +- secure/lib/libcrypto/man/man3/d2i_PrivateKey.3 | 2 +- secure/lib/libcrypto/man/man3/d2i_SSL_SESSION.3 | 2 +- secure/lib/libcrypto/man/man3/d2i_X509.3 | 2 +- secure/lib/libcrypto/man/man3/i2d_CMS_bio_stream.3 | 2 +- secure/lib/libcrypto/man/man3/i2d_PKCS7_bio_stream.3 | 2 +- secure/lib/libcrypto/man/man3/i2d_re_X509_tbs.3 | 2 +- secure/lib/libcrypto/man/man3/o2i_SCT_LIST.3 | 2 +- secure/lib/libcrypto/man/man5/x509v3_config.5 | 2 +- secure/lib/libcrypto/man/man7/Ed25519.7 | 2 +- secure/lib/libcrypto/man/man7/RAND.7 | 2 +- secure/lib/libcrypto/man/man7/RAND_DRBG.7 | 2 +- secure/lib/libcrypto/man/man7/RSA-PSS.7 | 2 +- secure/lib/libcrypto/man/man7/SM2.7 | 2 +- secure/lib/libcrypto/man/man7/X25519.7 | 2 +- secure/lib/libcrypto/man/man7/bio.7 | 2 +- secure/lib/libcrypto/man/man7/ct.7 | 2 +- secure/lib/libcrypto/man/man7/des_modes.7 | 2 +- secure/lib/libcrypto/man/man7/evp.7 | 2 +- secure/lib/libcrypto/man/man7/ossl_store-file.7 | 2 +- secure/lib/libcrypto/man/man7/ossl_store.7 | 2 +- secure/lib/libcrypto/man/man7/passphrase-encoding.7 | 2 +- secure/lib/libcrypto/man/man7/proxy-certificates.7 | 2 +- secure/lib/libcrypto/man/man7/scrypt.7 | 2 +- secure/lib/libcrypto/man/man7/ssl.7 | 2 +- secure/lib/libcrypto/man/man7/x509.7 | 2 +- secure/usr.bin/openssl/man/CA.pl.1 | 2 +- secure/usr.bin/openssl/man/asn1parse.1 | 2 +- secure/usr.bin/openssl/man/ca.1 | 2 +- secure/usr.bin/openssl/man/ciphers.1 | 2 +- secure/usr.bin/openssl/man/cms.1 | 2 +- secure/usr.bin/openssl/man/crl.1 | 2 +- secure/usr.bin/openssl/man/crl2pkcs7.1 | 2 +- secure/usr.bin/openssl/man/dgst.1 | 2 +- secure/usr.bin/openssl/man/dhparam.1 | 2 +- secure/usr.bin/openssl/man/dsa.1 | 2 +- secure/usr.bin/openssl/man/dsaparam.1 | 2 +- secure/usr.bin/openssl/man/ec.1 | 2 +- secure/usr.bin/openssl/man/ecparam.1 | 2 +- secure/usr.bin/openssl/man/enc.1 | 2 +- secure/usr.bin/openssl/man/engine.1 | 2 +- secure/usr.bin/openssl/man/errstr.1 | 2 +- secure/usr.bin/openssl/man/gendsa.1 | 2 +- secure/usr.bin/openssl/man/genpkey.1 | 2 +- secure/usr.bin/openssl/man/genrsa.1 | 2 +- secure/usr.bin/openssl/man/list.1 | 2 +- secure/usr.bin/openssl/man/nseq.1 | 2 +- secure/usr.bin/openssl/man/ocsp.1 | 2 +- secure/usr.bin/openssl/man/openssl.1 | 2 +- secure/usr.bin/openssl/man/passwd.1 | 2 +- secure/usr.bin/openssl/man/pkcs12.1 | 2 +- secure/usr.bin/openssl/man/pkcs7.1 | 2 +- secure/usr.bin/openssl/man/pkcs8.1 | 2 +- secure/usr.bin/openssl/man/pkey.1 | 2 +- secure/usr.bin/openssl/man/pkeyparam.1 | 2 +- secure/usr.bin/openssl/man/pkeyutl.1 | 2 +- secure/usr.bin/openssl/man/prime.1 | 2 +- secure/usr.bin/openssl/man/rand.1 | 2 +- secure/usr.bin/openssl/man/req.1 | 2 +- secure/usr.bin/openssl/man/rsa.1 | 2 +- secure/usr.bin/openssl/man/rsautl.1 | 2 +- secure/usr.bin/openssl/man/s_client.1 | 2 +- secure/usr.bin/openssl/man/s_server.1 | 2 +- secure/usr.bin/openssl/man/s_time.1 | 2 +- secure/usr.bin/openssl/man/sess_id.1 | 2 +- secure/usr.bin/openssl/man/smime.1 | 2 +- secure/usr.bin/openssl/man/speed.1 | 2 +- secure/usr.bin/openssl/man/spkac.1 | 2 +- secure/usr.bin/openssl/man/srp.1 | 2 +- secure/usr.bin/openssl/man/storeutl.1 | 2 +- secure/usr.bin/openssl/man/ts.1 | 2 +- secure/usr.bin/openssl/man/tsget.1 | 2 +- secure/usr.bin/openssl/man/verify.1 | 2 +- secure/usr.bin/openssl/man/version.1 | 2 +- secure/usr.bin/openssl/man/x509.1 | 2 +- 534 files changed, 534 insertions(+), 534 deletions(-) diff --git a/secure/lib/libcrypto/man/man3/ADMISSIONS.3 b/secure/lib/libcrypto/man/man3/ADMISSIONS.3 index 472c17c50dcc..86256c7a2b0b 100644 --- a/secure/lib/libcrypto/man/man3/ADMISSIONS.3 +++ b/secure/lib/libcrypto/man/man3/ADMISSIONS.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ADMISSIONS 3" -.TH ADMISSIONS 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH ADMISSIONS 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/ASN1_INTEGER_get_int64.3 b/secure/lib/libcrypto/man/man3/ASN1_INTEGER_get_int64.3 index 925c09322317..0c269e1a2c57 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_INTEGER_get_int64.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_INTEGER_get_int64.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_INTEGER_GET_INT64 3" -.TH ASN1_INTEGER_GET_INT64 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH ASN1_INTEGER_GET_INT64 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3 b/secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3 index 5fc515f69ee9..a282236912de 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_ITEM_LOOKUP 3" -.TH ASN1_ITEM_LOOKUP 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH ASN1_ITEM_LOOKUP 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3 b/secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3 index e16515ca3c90..c3ff9addda94 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_OBJECT_NEW 3" -.TH ASN1_OBJECT_NEW 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH ASN1_OBJECT_NEW 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3 b/secure/lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3 index 4e8a6899ad62..8c7001950daf 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_STRING_TABLE_ADD 3" -.TH ASN1_STRING_TABLE_ADD 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH ASN1_STRING_TABLE_ADD 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/ASN1_STRING_length.3 b/secure/lib/libcrypto/man/man3/ASN1_STRING_length.3 index 05a85780b2c4..d421c56becf7 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_STRING_length.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_STRING_length.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_STRING_LENGTH 3" -.TH ASN1_STRING_LENGTH 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH ASN1_STRING_LENGTH 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/ASN1_STRING_new.3 b/secure/lib/libcrypto/man/man3/ASN1_STRING_new.3 index 2699b54569a7..1664da0434fe 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_STRING_new.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_STRING_new.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_STRING_NEW 3" -.TH ASN1_STRING_NEW 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH ASN1_STRING_NEW 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/ASN1_STRING_print_ex.3 b/secure/lib/libcrypto/man/man3/ASN1_STRING_print_ex.3 index 0c3c1688f87d..5cd6f3c9d916 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_STRING_print_ex.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_STRING_print_ex.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_STRING_PRINT_EX 3" -.TH ASN1_STRING_PRINT_EX 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH ASN1_STRING_PRINT_EX 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/ASN1_TIME_set.3 b/secure/lib/libcrypto/man/man3/ASN1_TIME_set.3 index cc4c09abca96..54a8367928de 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_TIME_set.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_TIME_set.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_TIME_SET 3" -.TH ASN1_TIME_SET 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH ASN1_TIME_SET 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/ASN1_TYPE_get.3 b/secure/lib/libcrypto/man/man3/ASN1_TYPE_get.3 index 793b67b92b8b..eed7f68cbe5c 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_TYPE_get.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_TYPE_get.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_TYPE_GET 3" -.TH ASN1_TYPE_GET 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH ASN1_TYPE_GET 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/ASN1_generate_nconf.3 b/secure/lib/libcrypto/man/man3/ASN1_generate_nconf.3 index 0cb6b90db135..9dbc10923ed2 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_generate_nconf.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_generate_nconf.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_GENERATE_NCONF 3" -.TH ASN1_GENERATE_NCONF 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH ASN1_GENERATE_NCONF 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/ASYNC_WAIT_CTX_new.3 b/secure/lib/libcrypto/man/man3/ASYNC_WAIT_CTX_new.3 index 67916ea1764a..29d120b2d673 100644 --- a/secure/lib/libcrypto/man/man3/ASYNC_WAIT_CTX_new.3 +++ b/secure/lib/libcrypto/man/man3/ASYNC_WAIT_CTX_new.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASYNC_WAIT_CTX_NEW 3" -.TH ASYNC_WAIT_CTX_NEW 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH ASYNC_WAIT_CTX_NEW 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/ASYNC_start_job.3 b/secure/lib/libcrypto/man/man3/ASYNC_start_job.3 index 97361e504a22..dbd50cdebca7 100644 --- a/secure/lib/libcrypto/man/man3/ASYNC_start_job.3 +++ b/secure/lib/libcrypto/man/man3/ASYNC_start_job.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASYNC_START_JOB 3" -.TH ASYNC_START_JOB 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH ASYNC_START_JOB 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BF_encrypt.3 b/secure/lib/libcrypto/man/man3/BF_encrypt.3 index f969016051cd..54cbc2c1f127 100644 --- a/secure/lib/libcrypto/man/man3/BF_encrypt.3 +++ b/secure/lib/libcrypto/man/man3/BF_encrypt.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BF_ENCRYPT 3" -.TH BF_ENCRYPT 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BF_ENCRYPT 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_ADDR.3 b/secure/lib/libcrypto/man/man3/BIO_ADDR.3 index 7b9dc781f3dc..f535ffa1461c 100644 --- a/secure/lib/libcrypto/man/man3/BIO_ADDR.3 +++ b/secure/lib/libcrypto/man/man3/BIO_ADDR.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_ADDR 3" -.TH BIO_ADDR 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_ADDR 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_ADDRINFO.3 b/secure/lib/libcrypto/man/man3/BIO_ADDRINFO.3 index 6b49c9addd18..c19447fabf54 100644 --- a/secure/lib/libcrypto/man/man3/BIO_ADDRINFO.3 +++ b/secure/lib/libcrypto/man/man3/BIO_ADDRINFO.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_ADDRINFO 3" -.TH BIO_ADDRINFO 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_ADDRINFO 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_connect.3 b/secure/lib/libcrypto/man/man3/BIO_connect.3 index b8863dbf6c98..520bde6a36ba 100644 --- a/secure/lib/libcrypto/man/man3/BIO_connect.3 +++ b/secure/lib/libcrypto/man/man3/BIO_connect.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_CONNECT 3" -.TH BIO_CONNECT 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_CONNECT 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_ctrl.3 b/secure/lib/libcrypto/man/man3/BIO_ctrl.3 index 9ee3694676b7..d0b951703094 100644 --- a/secure/lib/libcrypto/man/man3/BIO_ctrl.3 +++ b/secure/lib/libcrypto/man/man3/BIO_ctrl.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_CTRL 3" -.TH BIO_CTRL 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_CTRL 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_f_base64.3 b/secure/lib/libcrypto/man/man3/BIO_f_base64.3 index d538546bb927..244affad64c1 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_base64.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_base64.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_F_BASE64 3" -.TH BIO_F_BASE64 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_F_BASE64 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_f_buffer.3 b/secure/lib/libcrypto/man/man3/BIO_f_buffer.3 index ac59ca2f3d2e..85342305399e 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_buffer.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_buffer.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_F_BUFFER 3" -.TH BIO_F_BUFFER 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_F_BUFFER 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_f_cipher.3 b/secure/lib/libcrypto/man/man3/BIO_f_cipher.3 index 4183f466ac82..2d6f4d9aef76 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_cipher.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_cipher.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_F_CIPHER 3" -.TH BIO_F_CIPHER 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_F_CIPHER 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_f_md.3 b/secure/lib/libcrypto/man/man3/BIO_f_md.3 index b9c7003e1a16..d9838f76ac56 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_md.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_md.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_F_MD 3" -.TH BIO_F_MD 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_F_MD 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_f_null.3 b/secure/lib/libcrypto/man/man3/BIO_f_null.3 index b2ddb5c9bd0f..942955c6b55e 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_null.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_null.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_F_NULL 3" -.TH BIO_F_NULL 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_F_NULL 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_f_ssl.3 b/secure/lib/libcrypto/man/man3/BIO_f_ssl.3 index 2dfe01321313..d2c15f86bdc9 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_ssl.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_ssl.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_F_SSL 3" -.TH BIO_F_SSL 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_F_SSL 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_find_type.3 b/secure/lib/libcrypto/man/man3/BIO_find_type.3 index a6d5c8a83b17..a878b414af9a 100644 --- a/secure/lib/libcrypto/man/man3/BIO_find_type.3 +++ b/secure/lib/libcrypto/man/man3/BIO_find_type.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_FIND_TYPE 3" -.TH BIO_FIND_TYPE 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_FIND_TYPE 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_get_data.3 b/secure/lib/libcrypto/man/man3/BIO_get_data.3 index 92f74a0fadb5..815fd66e44e4 100644 --- a/secure/lib/libcrypto/man/man3/BIO_get_data.3 +++ b/secure/lib/libcrypto/man/man3/BIO_get_data.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_GET_DATA 3" -.TH BIO_GET_DATA 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_GET_DATA 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_get_ex_new_index.3 b/secure/lib/libcrypto/man/man3/BIO_get_ex_new_index.3 index 76a6fc5f8e92..08d894831848 100644 --- a/secure/lib/libcrypto/man/man3/BIO_get_ex_new_index.3 +++ b/secure/lib/libcrypto/man/man3/BIO_get_ex_new_index.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_GET_EX_NEW_INDEX 3" -.TH BIO_GET_EX_NEW_INDEX 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_GET_EX_NEW_INDEX 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_meth_new.3 b/secure/lib/libcrypto/man/man3/BIO_meth_new.3 index a5b20c23f39b..56bd2108ec49 100644 --- a/secure/lib/libcrypto/man/man3/BIO_meth_new.3 +++ b/secure/lib/libcrypto/man/man3/BIO_meth_new.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_METH_NEW 3" -.TH BIO_METH_NEW 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_METH_NEW 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_new.3 b/secure/lib/libcrypto/man/man3/BIO_new.3 index 7113af6046ee..28c9d496d238 100644 --- a/secure/lib/libcrypto/man/man3/BIO_new.3 +++ b/secure/lib/libcrypto/man/man3/BIO_new.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_NEW 3" -.TH BIO_NEW 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_NEW 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_new_CMS.3 b/secure/lib/libcrypto/man/man3/BIO_new_CMS.3 index fa4a277e0a7b..75687e8582bb 100644 --- a/secure/lib/libcrypto/man/man3/BIO_new_CMS.3 +++ b/secure/lib/libcrypto/man/man3/BIO_new_CMS.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_NEW_CMS 3" -.TH BIO_NEW_CMS 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_NEW_CMS 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_parse_hostserv.3 b/secure/lib/libcrypto/man/man3/BIO_parse_hostserv.3 index 377108fb07b3..7aa82048178b 100644 --- a/secure/lib/libcrypto/man/man3/BIO_parse_hostserv.3 +++ b/secure/lib/libcrypto/man/man3/BIO_parse_hostserv.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_PARSE_HOSTSERV 3" -.TH BIO_PARSE_HOSTSERV 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_PARSE_HOSTSERV 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_printf.3 b/secure/lib/libcrypto/man/man3/BIO_printf.3 index cdfbdd839ec9..bfdb71cfd6cb 100644 --- a/secure/lib/libcrypto/man/man3/BIO_printf.3 +++ b/secure/lib/libcrypto/man/man3/BIO_printf.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_PRINTF 3" -.TH BIO_PRINTF 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_PRINTF 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_push.3 b/secure/lib/libcrypto/man/man3/BIO_push.3 index d3214d1cc631..e1e93ad666bd 100644 --- a/secure/lib/libcrypto/man/man3/BIO_push.3 +++ b/secure/lib/libcrypto/man/man3/BIO_push.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_PUSH 3" -.TH BIO_PUSH 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_PUSH 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_read.3 b/secure/lib/libcrypto/man/man3/BIO_read.3 index 65ed6b567f2c..4f91ea08954c 100644 --- a/secure/lib/libcrypto/man/man3/BIO_read.3 +++ b/secure/lib/libcrypto/man/man3/BIO_read.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_READ 3" *** 6505 LINES SKIPPED *** From nobody Tue Feb 7 23:08:00 2023 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 4PBJh04Fvkz3nqkn; Tue, 7 Feb 2023 23:08:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PBJh03kkvz3pHT; Tue, 7 Feb 2023 23:08:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675811280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WAeJGqz02CtsjzcZkQsZC6TwhCEbyZAa9hsOC23O1Rg=; b=a9eVBIgQ2KyRPJ4aOSFHmm2xg3UwAjlv3yawP4ZXkOLvwACj5fWnj9Ab01DaIGzd9QnOH4 q0xv9CgObJSQzOd5/GNqYs+dn17QLg16ldnIy5Tz25oD2WU6sap7y7RYuJyaVGxmvC1Ukv gaoHLlUQ1VIUx+3gtpMfdR9cWqRipP2ntK13/mdOvBiD+yGhYaGeRB6YAe7RdmvtO69rR8 KnIKc6dlmtBj2GiNInxQzr4d/ghZFKfIB2y7D4nwV4f5ktwCI54dkxvvgzWNl1PhNi49nJ 6ZVEY80vs3PsuXLqresdKaJGHkNhXbFhBcF98zyp3RJfvceN8yjA1ZzkxHSiiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675811280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WAeJGqz02CtsjzcZkQsZC6TwhCEbyZAa9hsOC23O1Rg=; b=qSUpTH2a45OS6ERctiLvOCeqebCm7/Znw4oWC1HffuKPP6LwJQRCE4uQg1TDe4neIH7q5G rrLymzTK4No2fUjSwAQwoDk4l0SLsPQ1r9k18k/omkC/focT5QUKakPIM8IV90QQpOW9Uv 9c1q0Z18Z5M8nSb7cio2s5gQwHgAI120AsR8eoTTmnHtaEy5UC5W6dprtVxt9Xe8qkXCmG lLXJ6E08OU3RSJDuShLxXPs+eQdMg8A5jTT5ogMfoWiA4oqfKysfVC/MJCAjzWNWUAev/U TQ38JRCQWFgAIPnDCJhE3EeuHEozVo9sStoMnJfKATH9goNjXhh9ZN/8CNRz3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675811280; a=rsa-sha256; cv=none; b=Ah740IRKLhIHq5iLHpbq5KVmk7F7m5wT69tZAI1kycvS1inSn9fTHEZHSFQLvtI7aIRxwV jEkrsPfCQDJPithcYmAeXU88BVQkP0f9K9huOV9BImoPNb9fo9RUd6lAJbzQ1BEg8sbjns T5+pPDgthMpdhme/8KbFZ20qDcmTz++9GKUDwZ/p+PRlpJh5Tp7H6AfuaWMqisq/mPf+CC em9yJ1JViOJ6OoJqjaccFQZrpPpYBnYc4lqpErZ2LGbuieufpWg4ZzF7brCwGLJelnumpY gib6jVmZN2vLyFWetuYCMiKEFFejXk/O6QaiJ5wYnuA4AGVmIpwhkaO7K4P2bg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBJh02nh4zZsD; Tue, 7 Feb 2023 23:08:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 317N80t7081260; Tue, 7 Feb 2023 23:08:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 317N80uT081259; Tue, 7 Feb 2023 23:08:00 GMT (envelope-from git) Date: Tue, 7 Feb 2023 23:08:00 GMT Message-Id: <202302072308.317N80uT081259@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jung-uk Kim Subject: git: f86f992d4377 - stable/12 - OpenSSL: Merge OpenSSL 1.1.1t 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: jkim X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: f86f992d4377940dc841aa4a7abb8a1702fe3aa7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=f86f992d4377940dc841aa4a7abb8a1702fe3aa7 commit f86f992d4377940dc841aa4a7abb8a1702fe3aa7 Author: Jung-uk Kim AuthorDate: 2023-02-07 17:05:11 +0000 Commit: Jung-uk Kim CommitDate: 2023-02-07 23:03:38 +0000 OpenSSL: Merge OpenSSL 1.1.1t (cherry picked from commit 0d51f658515c605fcc4a8073cb5a8e0d7d904088) --- crypto/openssl/CHANGES | 76 ++- crypto/openssl/Configure | 18 +- crypto/openssl/NEWS | 7 + crypto/openssl/README | 2 +- crypto/openssl/crypto/asn1/asn_mime.c | 6 +- crypto/openssl/crypto/asn1/bio_asn1.c | 4 +- crypto/openssl/crypto/asn1/bio_ndef.c | 41 +- crypto/openssl/crypto/bio/b_print.c | 22 +- crypto/openssl/crypto/bn/bn_blind.c | 16 +- crypto/openssl/crypto/bn/bn_err.c | 4 +- crypto/openssl/crypto/bn/bn_exp.c | 36 +- crypto/openssl/crypto/bn/bn_local.h | 36 +- crypto/openssl/crypto/bn/bn_mont.c | 4 +- crypto/openssl/crypto/bn/build.info | 3 +- crypto/openssl/crypto/bn/rsa_sup_mul.c | 614 +++++++++++++++++++++++++ crypto/openssl/crypto/cms/cms_enc.c | 5 + crypto/openssl/crypto/cms/cms_err.c | 2 + crypto/openssl/crypto/err/openssl.txt | 5 +- crypto/openssl/crypto/evp/bio_enc.c | 9 +- crypto/openssl/crypto/pem/pem_lib.c | 8 +- crypto/openssl/crypto/rsa/rsa_ameth.c | 1 + crypto/openssl/crypto/rsa/rsa_ossl.c | 19 +- crypto/openssl/crypto/txt_db/txt_db.c | 4 +- crypto/openssl/crypto/x509/by_dir.c | 18 +- crypto/openssl/crypto/x509/x_name.c | 8 +- crypto/openssl/crypto/x509v3/v3_genn.c | 4 +- crypto/openssl/engines/asm/e_padlock-x86.pl | 4 +- crypto/openssl/engines/asm/e_padlock-x86_64.pl | 4 +- crypto/openssl/include/crypto/bn.h | 7 +- crypto/openssl/include/openssl/bnerr.h | 3 +- crypto/openssl/include/openssl/cmserr.h | 1 + crypto/openssl/include/openssl/opensslv.h | 4 +- crypto/openssl/include/openssl/x509v3.h | 4 +- crypto/openssl/ssl/record/rec_layer_s3.c | 17 +- crypto/openssl/ssl/record/ssl3_buffer.c | 9 +- 35 files changed, 934 insertions(+), 91 deletions(-) diff --git a/crypto/openssl/CHANGES b/crypto/openssl/CHANGES index 979170072d17..1e2d651b7514 100644 --- a/crypto/openssl/CHANGES +++ b/crypto/openssl/CHANGES @@ -7,11 +7,85 @@ https://github.com/openssl/openssl/commits/ and pick the appropriate release branch. + Changes between 1.1.1s and 1.1.1t [7 Feb 2023] + + *) Fixed X.400 address type confusion in X.509 GeneralName. + + There is a type confusion vulnerability relating to X.400 address processing + inside an X.509 GeneralName. X.400 addresses were parsed as an ASN1_STRING + but subsequently interpreted by GENERAL_NAME_cmp as an ASN1_TYPE. This + vulnerability may allow an attacker who can provide a certificate chain and + CRL (neither of which need have a valid signature) to pass arbitrary + pointers to a memcmp call, creating a possible read primitive, subject to + some constraints. Refer to the advisory for more information. Thanks to + David Benjamin for discovering this issue. (CVE-2023-0286) + + This issue has been fixed by changing the public header file definition of + GENERAL_NAME so that x400Address reflects the implementation. It was not + possible for any existing application to successfully use the existing + definition; however, if any application references the x400Address field + (e.g. in dead code), note that the type of this field has changed. There is + no ABI change. + [Hugo Landau] + + *) Fixed Use-after-free following BIO_new_NDEF. + + The public API function BIO_new_NDEF is a helper function used for + streaming ASN.1 data via a BIO. It is primarily used internally to OpenSSL + to support the SMIME, CMS and PKCS7 streaming capabilities, but may also + be called directly by end user applications. + + The function receives a BIO from the caller, prepends a new BIO_f_asn1 + filter BIO onto the front of it to form a BIO chain, and then returns + the new head of the BIO chain to the caller. Under certain conditions, + for example if a CMS recipient public key is invalid, the new filter BIO + is freed and the function returns a NULL result indicating a failure. + However, in this case, the BIO chain is not properly cleaned up and the + BIO passed by the caller still retains internal pointers to the previously + freed filter BIO. If the caller then goes on to call BIO_pop() on the BIO + then a use-after-free will occur. This will most likely result in a crash. + (CVE-2023-0215) + [Viktor Dukhovni, Matt Caswell] + + *) Fixed Double free after calling PEM_read_bio_ex. + + The function PEM_read_bio_ex() reads a PEM file from a BIO and parses and + decodes the "name" (e.g. "CERTIFICATE"), any header data and the payload + data. If the function succeeds then the "name_out", "header" and "data" + arguments are populated with pointers to buffers containing the relevant + decoded data. The caller is responsible for freeing those buffers. It is + possible to construct a PEM file that results in 0 bytes of payload data. + In this case PEM_read_bio_ex() will return a failure code but will populate + the header argument with a pointer to a buffer that has already been freed. + If the caller also frees this buffer then a double free will occur. This + will most likely lead to a crash. + + The functions PEM_read_bio() and PEM_read() are simple wrappers around + PEM_read_bio_ex() and therefore these functions are also directly affected. + + These functions are also called indirectly by a number of other OpenSSL + functions including PEM_X509_INFO_read_bio_ex() and + SSL_CTX_use_serverinfo_file() which are also vulnerable. Some OpenSSL + internal uses of these functions are not vulnerable because the caller does + not free the header argument if PEM_read_bio_ex() returns a failure code. + (CVE-2022-4450) + [Kurt Roeckx, Matt Caswell] + + *) Fixed Timing Oracle in RSA Decryption. + + A timing based side channel exists in the OpenSSL RSA Decryption + implementation which could be sufficient to recover a plaintext across + a network in a Bleichenbacher style attack. To achieve a successful + decryption an attacker would have to be able to send a very large number + of trial messages for decryption. The vulnerability affects all RSA padding + modes: PKCS#1 v1.5, RSA-OEAP and RSASVE. + (CVE-2022-4304) + [Dmitry Belyavsky, Hubert Kario] + Changes between 1.1.1r and 1.1.1s [1 Nov 2022] *) Fixed a regression introduced in 1.1.1r version not refreshing the certificate data to be signed before signing the certificate. - [Gibeom Gwon] Changes between 1.1.1q and 1.1.1r [11 Oct 2022] diff --git a/crypto/openssl/Configure b/crypto/openssl/Configure index 4bea49d7da76..6cb1a84f4b7f 100755 --- a/crypto/openssl/Configure +++ b/crypto/openssl/Configure @@ -1,6 +1,6 @@ #! /usr/bin/env perl # -*- mode: perl; -*- -# Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2016-2023 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -1215,7 +1215,7 @@ $target{build_scheme} = [ $target{build_scheme} ] my ($builder, $builder_platform, @builder_opts) = @{$target{build_scheme}}; -foreach my $checker (($builder_platform."-".$target{build_file}."-checker.pm", +foreach my $checker (($builder_platform."-".$config{build_file}."-checker.pm", $builder_platform."-checker.pm")) { my $checker_path = catfile($srcdir, "Configurations", $checker); if (-f $checker_path) { @@ -1712,8 +1712,8 @@ if ($builder eq "unified") { # Store the name of the template file we will build the build file from # in %config. This may be useful for the build file itself. my @build_file_template_names = - ( $builder_platform."-".$target{build_file}.".tmpl", - $target{build_file}.".tmpl" ); + ( $builder_platform."-".$config{build_file}.".tmpl", + $config{build_file}.".tmpl" ); my @build_file_templates = (); # First, look in the user provided directory, if given @@ -1937,8 +1937,8 @@ if ($builder eq "unified") { } next if @skip && $skip[$#skip] <= 0; push @rawlines, $_ - if ($target_kind eq $target{build_file} - || $target_kind eq $target{build_file}."(".$builder_platform.")"); + if ($target_kind eq $config{build_file} + || $target_kind eq $config{build_file}."(".$builder_platform.")"); } }, qr/^\s*(?:#.*)?$/ => sub { }, @@ -2813,8 +2813,8 @@ if ($builder_platform eq 'unix') { my %builders = ( unified => sub { - print 'Creating ',$target{build_file},"\n"; - run_dofile(catfile($blddir, $target{build_file}), + print 'Creating ',$config{build_file},"\n"; + run_dofile(catfile($blddir, $config{build_file}), @{$config{build_file_templates}}); }, ); @@ -2868,7 +2868,7 @@ exit(0); # sub death_handler { die @_ if $^S; # To prevent the added message in eval blocks - my $build_file = $target{build_file} // "build file"; + my $build_file = $config{build_file} // "build file"; my @message = ( <<"_____", @_ ); Failure! $build_file wasn't produced. diff --git a/crypto/openssl/NEWS b/crypto/openssl/NEWS index c9e63eea63a6..2724fc4d85ba 100644 --- a/crypto/openssl/NEWS +++ b/crypto/openssl/NEWS @@ -5,6 +5,13 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.1.1s and OpenSSL 1.1.1t [7 Feb 2023] + + o Fixed X.400 address type confusion in X.509 GeneralName (CVE-2023-0286) + o Fixed Use-after-free following BIO_new_NDEF (CVE-2023-0215) + o Fixed Double free after calling PEM_read_bio_ex (CVE-2022-4450) + o Fixed Timing Oracle in RSA Decryption (CVE-2022-4304) + Major changes between OpenSSL 1.1.1r and OpenSSL 1.1.1s [1 Nov 2022] o Fixed a regression introduced in OpenSSL 1.1.1r not refreshing the diff --git a/crypto/openssl/README b/crypto/openssl/README index 2f6d91c6337c..b2f806be3a44 100644 --- a/crypto/openssl/README +++ b/crypto/openssl/README @@ -1,5 +1,5 @@ - OpenSSL 1.1.1s 1 Nov 2022 + OpenSSL 1.1.1t 7 Feb 2023 Copyright (c) 1998-2022 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson diff --git a/crypto/openssl/crypto/asn1/asn_mime.c b/crypto/openssl/crypto/asn1/asn_mime.c index 38735cd86f3e..36853612b69c 100644 --- a/crypto/openssl/crypto/asn1/asn_mime.c +++ b/crypto/openssl/crypto/asn1/asn_mime.c @@ -489,6 +489,7 @@ int SMIME_crlf_copy(BIO *in, BIO *out, int flags) char eol; int len; char linebuf[MAX_SMLEN]; + int ret; /* * Buffer output so we don't write one line at a time. This is useful * when streaming as we don't end up with one OCTET STRING per line. @@ -523,9 +524,12 @@ int SMIME_crlf_copy(BIO *in, BIO *out, int flags) BIO_write(out, "\r\n", 2); } } - (void)BIO_flush(out); + ret = BIO_flush(out); BIO_pop(out); BIO_free(bf); + if (ret <= 0) + return 0; + return 1; } diff --git a/crypto/openssl/crypto/asn1/bio_asn1.c b/crypto/openssl/crypto/asn1/bio_asn1.c index 914d77c866c6..17b0d1aa6cad 100644 --- a/crypto/openssl/crypto/asn1/bio_asn1.c +++ b/crypto/openssl/crypto/asn1/bio_asn1.c @@ -172,7 +172,7 @@ static int asn1_bio_write(BIO *b, const char *in, int inl) case ASN1_STATE_START: if (!asn1_bio_setup_ex(b, ctx, ctx->prefix, ASN1_STATE_PRE_COPY, ASN1_STATE_HEADER)) - return 0; + return -1; break; /* Copy any pre data first */ @@ -189,7 +189,7 @@ static int asn1_bio_write(BIO *b, const char *in, int inl) case ASN1_STATE_HEADER: ctx->buflen = ASN1_object_size(0, inl, ctx->asn1_tag) - inl; if (!ossl_assert(ctx->buflen <= ctx->bufsize)) - return 0; + return -1; p = ctx->buf; ASN1_put_object(&p, 0, inl, ctx->asn1_tag, ctx->asn1_class); ctx->copylen = inl; diff --git a/crypto/openssl/crypto/asn1/bio_ndef.c b/crypto/openssl/crypto/asn1/bio_ndef.c index 760e4846a474..c8a776b482d0 100644 --- a/crypto/openssl/crypto/asn1/bio_ndef.c +++ b/crypto/openssl/crypto/asn1/bio_ndef.c @@ -1,5 +1,5 @@ /* - * Copyright 2008-2021 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2008-2023 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -49,12 +49,19 @@ static int ndef_suffix(BIO *b, unsigned char **pbuf, int *plen, void *parg); static int ndef_suffix_free(BIO *b, unsigned char **pbuf, int *plen, void *parg); +/* + * On success, the returned BIO owns the input BIO as part of its BIO chain. + * On failure, NULL is returned and the input BIO is owned by the caller. + * + * Unfortunately cannot constify this due to CMS_stream() and PKCS7_stream() + */ BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it) { NDEF_SUPPORT *ndef_aux = NULL; BIO *asn_bio = NULL; const ASN1_AUX *aux = it->funcs; ASN1_STREAM_ARG sarg; + BIO *pop_bio = NULL; if (!aux || !aux->asn1_cb) { ASN1err(ASN1_F_BIO_NEW_NDEF, ASN1_R_STREAMING_NOT_SUPPORTED); @@ -69,21 +76,39 @@ BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it) out = BIO_push(asn_bio, out); if (out == NULL) goto err; + pop_bio = asn_bio; - BIO_asn1_set_prefix(asn_bio, ndef_prefix, ndef_prefix_free); - BIO_asn1_set_suffix(asn_bio, ndef_suffix, ndef_suffix_free); + if (BIO_asn1_set_prefix(asn_bio, ndef_prefix, ndef_prefix_free) <= 0 + || BIO_asn1_set_suffix(asn_bio, ndef_suffix, ndef_suffix_free) <= 0 + || BIO_ctrl(asn_bio, BIO_C_SET_EX_ARG, 0, ndef_aux) <= 0) + goto err; /* - * Now let callback prepends any digest, cipher etc BIOs ASN1 structure - * needs. + * Now let the callback prepend any digest, cipher, etc., that the BIO's + * ASN1 structure needs. */ sarg.out = out; sarg.ndef_bio = NULL; sarg.boundary = NULL; - if (aux->asn1_cb(ASN1_OP_STREAM_PRE, &val, it, &sarg) <= 0) + /* + * The asn1_cb(), must not have mutated asn_bio on error, leaving it in the + * middle of some partially built, but not returned BIO chain. + */ + if (aux->asn1_cb(ASN1_OP_STREAM_PRE, &val, it, &sarg) <= 0) { + /* + * ndef_aux is now owned by asn_bio so we must not free it in the err + * clean up block + */ + ndef_aux = NULL; goto err; + } + + /* + * We must not fail now because the callback has prepended additional + * BIOs to the chain + */ ndef_aux->val = val; ndef_aux->it = it; @@ -91,11 +116,11 @@ BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it) ndef_aux->boundary = sarg.boundary; ndef_aux->out = out; - BIO_ctrl(asn_bio, BIO_C_SET_EX_ARG, 0, ndef_aux); - return sarg.ndef_bio; err: + /* BIO_pop() is NULL safe */ + (void)BIO_pop(pop_bio); BIO_free(asn_bio); OPENSSL_free(ndef_aux); return NULL; diff --git a/crypto/openssl/crypto/bio/b_print.c b/crypto/openssl/crypto/bio/b_print.c index 41b7f5e2f61d..45d4e9f004b1 100644 --- a/crypto/openssl/crypto/bio/b_print.c +++ b/crypto/openssl/crypto/bio/b_print.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -13,6 +13,7 @@ #include "crypto/ctype.h" #include "internal/numbers.h" #include +#include /* * Copyright Patrick Powell 1995 @@ -31,8 +32,10 @@ static int fmtstr(char **, char **, size_t *, size_t *, const char *, int, int, int); static int fmtint(char **, char **, size_t *, size_t *, int64_t, int, int, int, int); +#ifndef OPENSSL_SYS_UEFI static int fmtfp(char **, char **, size_t *, size_t *, LDOUBLE, int, int, int, int); +#endif static int doapr_outch(char **, char **, size_t *, size_t *, int); static int _dopr(char **sbuffer, char **buffer, size_t *maxlen, size_t *retlen, int *truncated, @@ -88,7 +91,9 @@ _dopr(char **sbuffer, { char ch; int64_t value; +#ifndef OPENSSL_SYS_UEFI LDOUBLE fvalue; +#endif char *strvalue; int min; int max; @@ -259,6 +264,7 @@ _dopr(char **sbuffer, min, max, flags)) return 0; break; +#ifndef OPENSSL_SYS_UEFI case 'f': if (cflags == DP_C_LDOUBLE) fvalue = va_arg(args, LDOUBLE); @@ -292,6 +298,16 @@ _dopr(char **sbuffer, flags, G_FORMAT)) return 0; break; +#else + case 'f': + case 'E': + case 'e': + case 'G': + case 'g': + /* not implemented for UEFI */ + ERR_raise(ERR_LIB_BIO, ERR_R_UNSUPPORTED); + return 0; +#endif case 'c': if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, va_arg(args, int))) @@ -512,6 +528,8 @@ fmtint(char **sbuffer, return 1; } +#ifndef OPENSSL_SYS_UEFI + static LDOUBLE abs_val(LDOUBLE value) { LDOUBLE result = value; @@ -803,6 +821,8 @@ fmtfp(char **sbuffer, return 1; } +#endif /* OPENSSL_SYS_UEFI */ + #define BUFFER_INC 1024 static int diff --git a/crypto/openssl/crypto/bn/bn_blind.c b/crypto/openssl/crypto/bn/bn_blind.c index 76fc7ebcffc0..dd5beea7c93e 100644 --- a/crypto/openssl/crypto/bn/bn_blind.c +++ b/crypto/openssl/crypto/bn/bn_blind.c @@ -1,5 +1,5 @@ /* - * Copyright 1998-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1998-2023 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -13,20 +13,6 @@ #define BN_BLINDING_COUNTER 32 -struct bn_blinding_st { - BIGNUM *A; - BIGNUM *Ai; - BIGNUM *e; - BIGNUM *mod; /* just a reference */ - CRYPTO_THREAD_ID tid; - int counter; - unsigned long flags; - BN_MONT_CTX *m_ctx; - int (*bn_mod_exp) (BIGNUM *r, const BIGNUM *a, const BIGNUM *p, - const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); - CRYPTO_RWLOCK *lock; -}; - BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod) { BN_BLINDING *ret = NULL; diff --git a/crypto/openssl/crypto/bn/bn_err.c b/crypto/openssl/crypto/bn/bn_err.c index dd87c152cf37..6f5464b54054 100644 --- a/crypto/openssl/crypto/bn/bn_err.c +++ b/crypto/openssl/crypto/bn/bn_err.c @@ -1,6 +1,6 @@ /* * Generated by util/mkerr.pl DO NOT EDIT - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -73,6 +73,8 @@ static const ERR_STRING_DATA BN_str_functs[] = { {ERR_PACK(ERR_LIB_BN, BN_F_BN_SET_WORDS, 0), "bn_set_words"}, {ERR_PACK(ERR_LIB_BN, BN_F_BN_STACK_PUSH, 0), "BN_STACK_push"}, {ERR_PACK(ERR_LIB_BN, BN_F_BN_USUB, 0), "BN_usub"}, + {ERR_PACK(ERR_LIB_BN, BN_F_OSSL_BN_RSA_DO_UNBLIND, 0), + "ossl_bn_rsa_do_unblind"}, {0, NULL} }; diff --git a/crypto/openssl/crypto/bn/bn_exp.c b/crypto/openssl/crypto/bn/bn_exp.c index e21dcff027c5..517e3c29fc70 100644 --- a/crypto/openssl/crypto/bn/bn_exp.c +++ b/crypto/openssl/crypto/bn/bn_exp.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -37,6 +37,15 @@ extern unsigned int OPENSSL_sparcv9cap_P[]; /* maximum precomputation table size for *variable* sliding windows */ #define TABLE_SIZE 32 +/* + * Beyond this limit the constant time code is disabled due to + * the possible overflow in the computation of powerbufLen in + * BN_mod_exp_mont_consttime. + * When this limit is exceeded, the computation will be done using + * non-constant time code, but it will take very long. + */ +#define BN_CONSTTIME_SIZE_LIMIT (INT_MAX / BN_BYTES / 256) + /* this one works - simple but works */ int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) { @@ -305,12 +314,6 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, BIGNUM *val[TABLE_SIZE]; BN_MONT_CTX *mont = NULL; - if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0 - || BN_get_flags(a, BN_FLG_CONSTTIME) != 0 - || BN_get_flags(m, BN_FLG_CONSTTIME) != 0) { - return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont); - } - bn_check_top(a); bn_check_top(p); bn_check_top(m); @@ -319,6 +322,14 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, BNerr(BN_F_BN_MOD_EXP_MONT, BN_R_CALLED_WITH_EVEN_MODULUS); return 0; } + + if (m->top <= BN_CONSTTIME_SIZE_LIMIT + && (BN_get_flags(p, BN_FLG_CONSTTIME) != 0 + || BN_get_flags(a, BN_FLG_CONSTTIME) != 0 + || BN_get_flags(m, BN_FLG_CONSTTIME) != 0)) { + return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont); + } + bits = BN_num_bits(p); if (bits == 0) { /* x**0 mod 1, or x**0 mod -1 is still zero. */ @@ -618,6 +629,11 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, top = m->top; + if (top > BN_CONSTTIME_SIZE_LIMIT) { + /* Prevent overflowing the powerbufLen computation below */ + return BN_mod_exp_mont(rr, a, p, m, ctx, in_mont); + } + /* * Use all bits stored in |p|, rather than |BN_num_bits|, so we do not leak * whether the top bits are zero. @@ -697,7 +713,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, else #endif #if defined(OPENSSL_BN_ASM_MONT5) - if (window >= 5) { + if (window >= 5 && top <= BN_SOFT_LIMIT) { window = 5; /* ~5% improvement for RSA2048 sign, and even * for RSA4096 */ /* reserve space for mont->N.d[] copy */ @@ -758,6 +774,9 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, if (!bn_to_mont_fixed_top(&am, a, mont, ctx)) goto err; + if (top > BN_SOFT_LIMIT) + goto fallback; + #if defined(SPARC_T4_MONT) if (t4) { typedef int (*bn_pwr5_mont_f) (BN_ULONG *tp, const BN_ULONG *np, @@ -1029,6 +1048,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, } else #endif { + fallback: if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&tmp, top, powerbuf, 0, window)) goto err; if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&am, top, powerbuf, 1, window)) diff --git a/crypto/openssl/crypto/bn/bn_local.h b/crypto/openssl/crypto/bn/bn_local.h index 8ad69ccd3639..30b7614fdbb2 100644 --- a/crypto/openssl/crypto/bn/bn_local.h +++ b/crypto/openssl/crypto/bn/bn_local.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -35,6 +35,26 @@ /* #define BN_DEBUG */ /* #define BN_DEBUG_RAND */ +/* + * This should limit the stack usage due to alloca to about 4K. + * BN_SOFT_LIMIT is a soft limit equivalent to 2*OPENSSL_RSA_MAX_MODULUS_BITS. + * Beyond that size bn_mul_mont is no longer used, and the constant time + * assembler code is disabled, due to the blatant alloca and bn_mul_mont usage. + * Note that bn_mul_mont does an alloca that is hidden away in assembly. + * It is not recommended to do computations with numbers exceeding this limit, + * since the result will be highly version dependent: + * While the current OpenSSL version will use non-optimized, but safe code, + * previous versions will use optimized code, that may crash due to unexpected + * stack overflow, and future versions may very well turn this into a hard + * limit. + * Note however, that it is possible to override the size limit using + * "./config -DBN_SOFT_LIMIT=" if necessary, and the O/S specific + * stack limit is known and taken into consideration. + */ +# ifndef BN_SOFT_LIMIT +# define BN_SOFT_LIMIT (4096 / BN_BYTES) +# endif + # ifndef OPENSSL_SMALL_FOOTPRINT # define BN_MUL_COMBA # define BN_SQR_COMBA @@ -263,6 +283,20 @@ struct bn_gencb_st { } cb; }; +struct bn_blinding_st { + BIGNUM *A; + BIGNUM *Ai; + BIGNUM *e; + BIGNUM *mod; /* just a reference */ + CRYPTO_THREAD_ID tid; + int counter; + unsigned long flags; + BN_MONT_CTX *m_ctx; + int (*bn_mod_exp) (BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); + CRYPTO_RWLOCK *lock; +}; + /*- * BN_window_bits_for_exponent_size -- macro for sliding window mod_exp functions * diff --git a/crypto/openssl/crypto/bn/bn_mont.c b/crypto/openssl/crypto/bn/bn_mont.c index 1e5045a010bb..7617b0df5e70 100644 --- a/crypto/openssl/crypto/bn/bn_mont.c +++ b/crypto/openssl/crypto/bn/bn_mont.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -42,7 +42,7 @@ int bn_mul_mont_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, int num = mont->N.top; #if defined(OPENSSL_BN_ASM_MONT) && defined(MONT_WORD) - if (num > 1 && a->top == num && b->top == num) { + if (num > 1 && num <= BN_SOFT_LIMIT && a->top == num && b->top == num) { if (bn_wexpand(r, num) == NULL) return 0; if (bn_mul_mont(r->d, a->d, b->d, mont->N.d, mont->n0, num)) { diff --git a/crypto/openssl/crypto/bn/build.info b/crypto/openssl/crypto/bn/build.info index b9ed5322fa68..c9fe2fdada69 100644 --- a/crypto/openssl/crypto/bn/build.info +++ b/crypto/openssl/crypto/bn/build.info @@ -5,7 +5,8 @@ SOURCE[../../libcrypto]=\ bn_kron.c bn_sqrt.c bn_gcd.c bn_prime.c bn_err.c bn_sqr.c \ {- $target{bn_asm_src} -} \ bn_recp.c bn_mont.c bn_mpi.c bn_exp2.c bn_gf2m.c bn_nist.c \ - bn_depr.c bn_const.c bn_x931p.c bn_intern.c bn_dh.c bn_srp.c + bn_depr.c bn_const.c bn_x931p.c bn_intern.c bn_dh.c bn_srp.c \ + rsa_sup_mul.c INCLUDE[bn_exp.o]=.. diff --git a/crypto/openssl/crypto/bn/rsa_sup_mul.c b/crypto/openssl/crypto/bn/rsa_sup_mul.c new file mode 100644 index 000000000000..acafefd5febf --- /dev/null +++ b/crypto/openssl/crypto/bn/rsa_sup_mul.c @@ -0,0 +1,614 @@ +#include +#include +#include +#include +#include +#include +#include +#include "internal/numbers.h" +#include "internal/constant_time.h" +#include "bn_local.h" + +# if BN_BYTES == 8 +typedef uint64_t limb_t; +# if defined(__SIZEOF_INT128__) && __SIZEOF_INT128__ == 16 +/* nonstandard; implemented by gcc on 64-bit platforms */ +typedef __uint128_t limb2_t; +# define HAVE_LIMB2_T +# endif +# define LIMB_BIT_SIZE 64 +# define LIMB_BYTE_SIZE 8 +# elif BN_BYTES == 4 +typedef uint32_t limb_t; +typedef uint64_t limb2_t; +# define LIMB_BIT_SIZE 32 +# define LIMB_BYTE_SIZE 4 +# define HAVE_LIMB2_T +# else +# error "Not supported" +# endif + +/* + * For multiplication we're using schoolbook multiplication, + * so if we have two numbers, each with 6 "digits" (words) + * the multiplication is calculated as follows: + * A B C D E F + * x I J K L M N + * -------------- + * N*F + * N*E + * N*D + * N*C + * N*B + * N*A + * M*F + * M*E + * M*D + * M*C + * M*B + * M*A + * L*F + * L*E + * L*D + * L*C + * L*B + * L*A + * K*F + * K*E + * K*D + * K*C + * K*B + * K*A + * J*F + * J*E + * J*D + * J*C + * J*B + * J*A + * I*F + * I*E + * I*D + * I*C + * I*B + * + I*A + * ========================== + * N*B N*D N*F + * + N*A N*C N*E + * + M*B M*D M*F + * + M*A M*C M*E + * + L*B L*D L*F + * + L*A L*C L*E + * + K*B K*D K*F + * + K*A K*C K*E + * + J*B J*D J*F + * + J*A J*C J*E + * + I*B I*D I*F + * + I*A I*C I*E + * + * 1+1 1+3 1+5 + * 1+0 1+2 1+4 + * 0+1 0+3 0+5 + * 0+0 0+2 0+4 + * + * 0 1 2 3 4 5 6 + * which requires n^2 multiplications and 2n full length additions + * as we can keep every other result of limb multiplication in two separate + * limbs + */ + +#if defined HAVE_LIMB2_T +static ossl_inline void _mul_limb(limb_t *hi, limb_t *lo, limb_t a, limb_t b) +{ + limb2_t t; + /* + * this is idiomatic code to tell compiler to use the native mul + * those three lines will actually compile to single instruction + */ + + t = (limb2_t)a * b; + *hi = t >> LIMB_BIT_SIZE; + *lo = (limb_t)t; +} +#elif (BN_BYTES == 8) && (defined _MSC_VER) +/* https://learn.microsoft.com/en-us/cpp/intrinsics/umul128?view=msvc-170 */ +#pragma intrinsic(_umul128) +static ossl_inline void _mul_limb(limb_t *hi, limb_t *lo, limb_t a, limb_t b) +{ + *lo = _umul128(a, b, hi); +} +#else +/* + * if the compiler doesn't have either a 128bit data type nor a "return + * high 64 bits of multiplication" + */ +static ossl_inline void _mul_limb(limb_t *hi, limb_t *lo, limb_t a, limb_t b) +{ + limb_t a_low = (limb_t)(uint32_t)a; + limb_t a_hi = a >> 32; + limb_t b_low = (limb_t)(uint32_t)b; + limb_t b_hi = b >> 32; + + limb_t p0 = a_low * b_low; + limb_t p1 = a_low * b_hi; + limb_t p2 = a_hi * b_low; + limb_t p3 = a_hi * b_hi; + + uint32_t cy = (uint32_t)(((p0 >> 32) + (uint32_t)p1 + (uint32_t)p2) >> 32); + + *lo = p0 + (p1 << 32) + (p2 << 32); + *hi = p3 + (p1 >> 32) + (p2 >> 32) + cy; +} +#endif + +/* add two limbs with carry in, return carry out */ +static ossl_inline limb_t _add_limb(limb_t *ret, limb_t a, limb_t b, limb_t carry) +{ + limb_t carry1, carry2, t; + /* + * `c = a + b; if (c < a)` is idiomatic code that makes compilers + * use add with carry on assembly level + */ + + *ret = a + carry; + if (*ret < a) + carry1 = 1; + else + carry1 = 0; + + t = *ret; + *ret = t + b; + if (*ret < t) + carry2 = 1; + else + carry2 = 0; + + return carry1 + carry2; +} + +/* + * add two numbers of the same size, return overflow + * + * add a to b, place result in ret; all arrays need to be n limbs long + * return overflow from addition (0 or 1) + */ +static ossl_inline limb_t add(limb_t *ret, limb_t *a, limb_t *b, size_t n) +{ + limb_t c = 0; + ossl_ssize_t i; + + for(i = n - 1; i > -1; i--) + c = _add_limb(&ret[i], a[i], b[i], c); + + return c; +} + +/* + * return number of limbs necessary for temporary values + * when multiplying numbers n limbs large + */ +static ossl_inline size_t mul_limb_numb(size_t n) +{ + return 2 * n * 2; +} + +/* + * multiply two numbers of the same size + * + * multiply a by b, place result in ret; a and b need to be n limbs long + * ret needs to be 2*n limbs long, tmp needs to be mul_limb_numb(n) limbs + * long + */ +static void limb_mul(limb_t *ret, limb_t *a, limb_t *b, size_t n, limb_t *tmp) +{ + limb_t *r_odd, *r_even; + size_t i, j, k; + + r_odd = tmp; + r_even = &tmp[2 * n]; + + memset(ret, 0, 2 * n * sizeof(limb_t)); + + for (i = 0; i < n; i++) { + for (k = 0; k < i + n + 1; k++) { + r_even[k] = 0; + r_odd[k] = 0; + } + for (j = 0; j < n; j++) { + /* + * place results from even and odd limbs in separate arrays so that + * we don't have to calculate overflow every time we get individual + * limb multiplication result + */ + if (j % 2 == 0) + _mul_limb(&r_even[i + j], &r_even[i + j + 1], a[i], b[j]); + else + _mul_limb(&r_odd[i + j], &r_odd[i + j + 1], a[i], b[j]); + } + /* + * skip the least significant limbs when adding multiples of + * more significant limbs (they're zero anyway) + */ + add(ret, ret, r_even, n + i + 1); + add(ret, ret, r_odd, n + i + 1); + } +} + +/* modifies the value in place by performing a right shift by one bit */ +static ossl_inline void rshift1(limb_t *val, size_t n) +{ + limb_t shift_in = 0, shift_out = 0; + size_t i; + + for (i = 0; i < n; i++) { + shift_out = val[i] & 1; + val[i] = shift_in << (LIMB_BIT_SIZE - 1) | (val[i] >> 1); + shift_in = shift_out; + } +} + +/* extend the LSB of flag to all bits of limb */ +static ossl_inline limb_t mk_mask(limb_t flag) +{ + flag |= flag << 1; + flag |= flag << 2; + flag |= flag << 4; + flag |= flag << 8; + flag |= flag << 16; +#if (LIMB_BYTE_SIZE == 8) + flag |= flag << 32; +#endif + return flag; +} + +/* + * copy from either a or b to ret based on flag + * when flag == 0, then copies from b + * when flag == 1, then copies from a + */ +static ossl_inline void cselect(limb_t flag, limb_t *ret, limb_t *a, limb_t *b, size_t n) +{ + /* + * would be more efficient with non volatile mask, but then gcc + * generates code with jumps + */ + volatile limb_t mask; + size_t i; + + mask = mk_mask(flag); + for (i = 0; i < n; i++) { +#if (LIMB_BYTE_SIZE == 8) + ret[i] = constant_time_select_64(mask, a[i], b[i]); +#else + ret[i] = constant_time_select_32(mask, a[i], b[i]); +#endif + } +} + *** 823 LINES SKIPPED *** From nobody Tue Feb 7 23:08:01 2023 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 4PBJh15t6Kz3nqbK; Tue, 7 Feb 2023 23:08: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 4PBJh14p3fz3pKY; Tue, 7 Feb 2023 23:08:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675811281; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6YO5tBG52yfvruv8ehsSvtwsjOGOYkVFcO5T9uv9MS4=; b=JWvQtiqTx7oIrcy0zIeoF3W00TwE+Bh21mc1lAooGQwiXlkEvAfA9LDPH8TFKdYBKt/Yk5 NNHXhfCDArqw1Ub1oBeQ9CLwaC0CDje1c5LNyu9nQN8JD6bX6CvdMvMZmgtYP5+KscLksH CzpRPZrPvD/7UsLeZqJd0IhD2+0Cmrr1oVcUNzFqqV4MIyb+FLnhoviLiZ9HZmQ8yLhI2A 5TAum0nPRxczzPa5qwg5omYwtmDr4hs01hWpTnDKDW2lyZ8iwcns8YAgjsYngrSihdl8gP +7UaHTkIufgNKASIZdVT/8a87NhanZBPOq54XDqvk0/Nc4IdUKTDwQEoWP/64g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675811281; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6YO5tBG52yfvruv8ehsSvtwsjOGOYkVFcO5T9uv9MS4=; b=LTSCHXvcMRY1y7ezwU+oUOP9sWXBMZcj4SML/RMgjnTOXqcHYewAJcmBE2DSM7DxfJpz93 EC7vSFsuE5ZpeA1nb334wleApwhLOj2sXRd7eNQXy2/ZT4iq7EU9oJL4nU4eZ8Z1Y5mtPX NbAnfgwfCf56hnLpOyycUyLGDu4SYxwA8Rgo3/NGnJT7T9I3vWnZC/kp8DSF9b5PZWB0m5 PpIpM8LDndr1WjoJ+rQ2MZ2C8bSiNmDgT89yifww/DkPMNz7FirvTaIoflbkpU21aNkW2W Af9hefNTTwstnUOVk1MLYxBgD+9eVOK+qh4zHIRt+NfV4sMt2RDv2E9kpI+DYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675811281; a=rsa-sha256; cv=none; b=plv7Pk25QRti9IPLtfrNrm7DYzC1xf58ZGo4foOxnfqLVzoRFclyH3HMwBlN4aigtA+RN6 U/oawI+YVnU0EZdCbSRwNQNJEm3C3xgIO8O61XfgoZiFH2ubT5KFxJbt0OU5owd23iFc6X yJKVSjwNpcOO0/MzBfO5DyYsb3K3/sgPauwoZ2pKcCcaYQofOFQSmJmh8Y/Y39wQnRxjNS FpnNkAKqB49fUi4bjKln7YDRLvSLv0YwG/zz0EqbXiDMjCCKtxFcvTTOI5kBVfqW6l/Xjw i5JcZ4L6vRL4N0l4kjD+dFsB9Z1waBlUyx2d3i1Lx9HM3uSzMDU9cjVaTlEzVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBJh13jYbzZfk; Tue, 7 Feb 2023 23:08:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 317N81EC081284; Tue, 7 Feb 2023 23:08:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 317N81NF081283; Tue, 7 Feb 2023 23:08:01 GMT (envelope-from git) Date: Tue, 7 Feb 2023 23:08:01 GMT Message-Id: <202302072308.317N81NF081283@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jung-uk Kim Subject: git: 1bf57e058b62 - stable/12 - OpenSSL: Merge OpenSSL 1.1.1t 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: jkim X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 1bf57e058b62b3f52203c4698c149f2af758e89f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=1bf57e058b62b3f52203c4698c149f2af758e89f commit 1bf57e058b62b3f52203c4698c149f2af758e89f Author: Jung-uk Kim AuthorDate: 2023-02-07 18:54:16 +0000 Commit: Jung-uk Kim CommitDate: 2023-02-07 23:04:28 +0000 OpenSSL: Merge OpenSSL 1.1.1t (cherry picked from commit fb3134558138e52322ebcdf66fee8288ee308d78) --- secure/lib/libcrypto/Makefile | 1 + secure/lib/libcrypto/Makefile.inc | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/secure/lib/libcrypto/Makefile b/secure/lib/libcrypto/Makefile index 9a57b31a0c87..98c474ea167e 100644 --- a/secure/lib/libcrypto/Makefile +++ b/secure/lib/libcrypto/Makefile @@ -101,6 +101,7 @@ SRCS+= bn-586.S co-586.S x86-gf2m.S x86-mont.S .else SRCS+= bn_asm.c .endif +SRCS+= rsa_sup_mul.c # buffer SRCS+= buf_err.c buffer.c diff --git a/secure/lib/libcrypto/Makefile.inc b/secure/lib/libcrypto/Makefile.inc index 3c85c6d89a21..4496320e4628 100644 --- a/secure/lib/libcrypto/Makefile.inc +++ b/secure/lib/libcrypto/Makefile.inc @@ -3,8 +3,8 @@ .include # OpenSSL version used for manual page generation -OPENSSL_VER= 1.1.1s -OPENSSL_DATE= 2022-11-01 +OPENSSL_VER= 1.1.1t +OPENSSL_DATE= 2023-02-07 LCRYPTO_SRC= ${SRCTOP}/crypto/openssl LCRYPTO_DOC= ${LCRYPTO_SRC}/doc From nobody Tue Feb 7 23:08:02 2023 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 4PBJh26gknz3nqdp; Tue, 7 Feb 2023 23:08:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PBJh25ts6z3pYC; Tue, 7 Feb 2023 23:08:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675811282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qTE5B5sLayOf0tR66D3axHq77czekVeQOpiJ7EotsWQ=; b=UoSOMwIspI6kxaci5ViOkOzD3jX04B29CjECMqkytccX4cNGUdVr91YKdiZJ1DZ433JbQZ oiz7KRL4d6HdYErJOR5V3GpWliJPyXYyMkrNMpMkMynMp21z19eKhbb4op/mD9BdnmcaaL CB3jcLnd/XpjlxFTxUlMry1IyNXqoGXBvQkiVsurgTfEq0OdSiT6+460q/oCdca03S71ia NFpyNea79vtRQJ3wcGNV9sMjS070ZUyK18ucjizz1jMhc/I+nH/N3yX9qMXVwd8Mp18NEX caheWlXrTuAYIvD9dUiDxhd9VyF31W5t3gcDeAZ3dEg/gRjitMm+f2YbvApOPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675811282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qTE5B5sLayOf0tR66D3axHq77czekVeQOpiJ7EotsWQ=; b=kkAGxYwcBFf6vAsyZhBZqnfXGrn9vrrxgfsmkOB9BS6N57+bJrPE7yw/mVWPZ7KnLKvZC8 3cCZyDv0KZgoBC0hXR/efQ724I7y44v8jyqpPueTuvMgY/pcDRQmAXt96kEKNI4ATNJ3Bh gfBHP5i4v3rcilMhxDcjwribVoE3Ls39VszRqGH8lACQKvKf98vXA+hP4TTV/KzQ7cNA6x eUDRMBOjgHOdT3iwc+rQcqdht8YZQr0LHKy/z+cGq6s767fVMQGQh/89Udt5ikcT79hI3M lSIj3jo4mWEoyLG89Kh3LshRYb6JMyxo2o8BecY+HYrUMyop1Gv1u1q6TYg0gQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675811282; a=rsa-sha256; cv=none; b=ddEXgs8suMwJV2qk9g2RisjRUKutI3qiteqIkaPgZPpv/vIR6bluQMLYwTXunoyOXQ8B16 /uW5oIL7vhj/XjLi5nsTtuuL7tNz2HkmFWLGrf8NJ3ggeC/r0vrHz71xAN7XPmNJ9Cnhed Q11/HfQmTx5rMdxghHYVaEAOpKhZ1OkEU32pzpdahMb+MRkdAKGtjr8OrWgNAreAFda4fs pFy2fDZsigQA/QXdpO0KKzVtfQy9ptvVFwbGcXSSUK2T2uzlRPQOBR5l8+I9ofSMwBHwMU XOj2DyORZ34LJXApdtTAZUoQROBDQcs8LDM9N6sibVPY+dAQkB6Ko4qfTDFUAw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBJh24hPtzZfl; Tue, 7 Feb 2023 23:08:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 317N829I081308; Tue, 7 Feb 2023 23:08:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 317N82kt081307; Tue, 7 Feb 2023 23:08:02 GMT (envelope-from git) Date: Tue, 7 Feb 2023 23:08:02 GMT Message-Id: <202302072308.317N82kt081307@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jung-uk Kim Subject: git: 746c5cd56b36 - stable/12 - OpenSSL: Regen assembly files for OpenSSL 1.1.1t 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: jkim X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 746c5cd56b36b95a335911ee17ec89b9a6b9b9df Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=746c5cd56b36b95a335911ee17ec89b9a6b9b9df commit 746c5cd56b36b95a335911ee17ec89b9a6b9b9df Author: Jung-uk Kim AuthorDate: 2023-02-07 18:55:17 +0000 Commit: Jung-uk Kim CommitDate: 2023-02-07 23:04:45 +0000 OpenSSL: Regen assembly files for OpenSSL 1.1.1t (cherry picked from commit f1cf49002dbb0b1976ef1ebd8e689a7825e3e06f) --- secure/lib/libcrypto/amd64/e_padlock-x86_64.S | 2 ++ secure/lib/libcrypto/i386/e_padlock-x86.S | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/secure/lib/libcrypto/amd64/e_padlock-x86_64.S b/secure/lib/libcrypto/amd64/e_padlock-x86_64.S index de2866844652..b19cf1d0b2d3 100644 --- a/secure/lib/libcrypto/amd64/e_padlock-x86_64.S +++ b/secure/lib/libcrypto/amd64/e_padlock-x86_64.S @@ -45,6 +45,8 @@ padlock_capability: .align 16 padlock_key_bswap: movl 240(%rdi),%edx + incl %edx + shll $2,%edx .Lbswap_loop: movl (%rdi),%eax bswapl %eax diff --git a/secure/lib/libcrypto/i386/e_padlock-x86.S b/secure/lib/libcrypto/i386/e_padlock-x86.S index 4ddc50bcaf58..58085b33679b 100644 --- a/secure/lib/libcrypto/i386/e_padlock-x86.S +++ b/secure/lib/libcrypto/i386/e_padlock-x86.S @@ -69,6 +69,8 @@ padlock_key_bswap: .L_padlock_key_bswap_begin: movl 4(%esp),%edx movl 240(%edx),%ecx + incl %ecx + shll $2,%ecx .L003bswap_loop: movl (%edx),%eax bswap %eax @@ -1109,6 +1111,8 @@ padlock_key_bswap: .L_padlock_key_bswap_begin: movl 4(%esp),%edx movl 240(%edx),%ecx + incl %ecx + shll $2,%ecx .L003bswap_loop: movl (%edx),%eax bswap %eax From nobody Tue Feb 7 23:08:03 2023 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 4PBJh429hdz3nqSH; Tue, 7 Feb 2023 23:08: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 4PBJh41818z3pRK; Tue, 7 Feb 2023 23:08:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675811284; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0DPNjJlt6s9a0x7JQ8MEvULdjPDHJbvCOu5GrSP6t7A=; b=R/s21qOWbWBdYXtK1WyXkWvAaWZZknSv2VW1CQkdAmEsQOaK4gWKJh0DiRRnbvZPxQ046Y 6e9HZhfR3qNJ3NLOwHBzenKL+dQ0kVPPeNaU2B1j3k4b4PRpGguPoO44YV/kFj59BpZMq1 zxI6ZR93m2PHFimKv78RqV81KNprX3/58qUN7k8Wewbfy6XOWRxHcaaEF/pfpiy2XNWT5R R38jHMsMPxEQOTBhjZCGXV+z7CtvlIBCBWYLpCCgS6USV9Eo6Y/orzFvTiqAUlagd2Mpq1 ZUOWqGSIK6xB3l/lo+6jWfRDiaQfXQ/XnnmgRmVW467YzMayT7E2NuMeua1sYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675811284; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0DPNjJlt6s9a0x7JQ8MEvULdjPDHJbvCOu5GrSP6t7A=; b=PkKwSlm1BwW3pfOoWhENUPhK/2vts2nSI9TabTB5yNCN+4nefi3Mh0tGKKr0lgwC6vwcUA veOvGXBQLAdvqDRufEOaTVr4Xf2YTl9gtCRElSz8vWtYgMcm/6D0buCB2H8OHPfi+tnvj4 ZF0qvK/g1SHg1vkVfP+kVxb3fWP8VApW5mF3GudIpL1D73rvRfJb7TFWyJZcQ8whyA0zVo bgR6TlpFiYrk1CTwDFJIzktJUqgpDgOS+U4nJ/65yLIch85SYdMVT+quvmuyuGh0qaMQGD A6r5uztGDl+HhI3X5HJdHjWkqxN5PoMoemjYkxu0bD1LvrE7NGwO+E1e5n65Kg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675811284; a=rsa-sha256; cv=none; b=LRZ2vGgjUwAjAEiAHpV4B2BrMSt8tj0EqO0ka44E2P7l4iZW22Bdng0xU+KFDLml0yHPvr fzCR+a39KVbStRbqylDZPc4dNm99FWSFbXNGGCSm4W9E53sQlLqYr+dkcuzT4hOQOXmH8q aNf1NGQx6NlvTbJUYrYO/cKC+Qzn1agqkEL3/wItXtJc/P5ZEkzSFtJicA1VaxBKB3FFAF hb2MnY6aQkIE4BRIhQi9pjcJxBMRX/qiCXKmMy5WlHA0kxtZnjb9FU4ivkiNURMeYVnVhM yOb74EiuoxSLWuzYppwxCU6EbCxyMyJES/35ojtzFZ+afjme3si6POfjrHQ99A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBJh36cj9zZhW; Tue, 7 Feb 2023 23:08:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 317N83UT081332; Tue, 7 Feb 2023 23:08:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 317N83Il081331; Tue, 7 Feb 2023 23:08:03 GMT (envelope-from git) Date: Tue, 7 Feb 2023 23:08:03 GMT Message-Id: <202302072308.317N83Il081331@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jung-uk Kim Subject: git: 5983b92a92a0 - stable/12 - OpenSSL: Regen manual pages for OpenSSL 1.1.1t 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: jkim X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 5983b92a92a0eaf41831222d36feeba95a1f3e1f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=5983b92a92a0eaf41831222d36feeba95a1f3e1f commit 5983b92a92a0eaf41831222d36feeba95a1f3e1f Author: Jung-uk Kim AuthorDate: 2023-02-07 23:07:12 +0000 Commit: Jung-uk Kim CommitDate: 2023-02-07 23:07:12 +0000 OpenSSL: Regen manual pages for OpenSSL 1.1.1t --- secure/lib/libcrypto/man/man3/ADMISSIONS.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_INTEGER_get_int64.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_STRING_length.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_STRING_new.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_STRING_print_ex.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_TIME_set.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_TYPE_get.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_generate_nconf.3 | 2 +- secure/lib/libcrypto/man/man3/ASYNC_WAIT_CTX_new.3 | 2 +- secure/lib/libcrypto/man/man3/ASYNC_start_job.3 | 2 +- secure/lib/libcrypto/man/man3/BF_encrypt.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_ADDR.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_ADDRINFO.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_connect.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_ctrl.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_f_base64.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_f_buffer.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_f_cipher.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_f_md.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_f_null.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_f_ssl.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_find_type.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_get_data.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_get_ex_new_index.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_new.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_new_CMS.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_parse_hostserv.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_printf.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_push.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_read.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_accept.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_bio.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_connect.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_fd.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_file.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_mem.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_null.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_socket.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_set_callback.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_should_retry.3 | 2 +- secure/lib/libcrypto/man/man3/BN_BLINDING_new.3 | 2 +- secure/lib/libcrypto/man/man3/BN_CTX_new.3 | 2 +- secure/lib/libcrypto/man/man3/BN_CTX_start.3 | 2 +- secure/lib/libcrypto/man/man3/BN_add.3 | 2 +- secure/lib/libcrypto/man/man3/BN_add_word.3 | 2 +- secure/lib/libcrypto/man/man3/BN_bn2bin.3 | 2 +- secure/lib/libcrypto/man/man3/BN_cmp.3 | 2 +- secure/lib/libcrypto/man/man3/BN_copy.3 | 2 +- secure/lib/libcrypto/man/man3/BN_generate_prime.3 | 2 +- secure/lib/libcrypto/man/man3/BN_mod_inverse.3 | 2 +- secure/lib/libcrypto/man/man3/BN_mod_mul_montgomery.3 | 2 +- secure/lib/libcrypto/man/man3/BN_mod_mul_reciprocal.3 | 2 +- secure/lib/libcrypto/man/man3/BN_new.3 | 2 +- secure/lib/libcrypto/man/man3/BN_num_bytes.3 | 2 +- secure/lib/libcrypto/man/man3/BN_rand.3 | 2 +- secure/lib/libcrypto/man/man3/BN_security_bits.3 | 2 +- secure/lib/libcrypto/man/man3/BN_set_bit.3 | 2 +- secure/lib/libcrypto/man/man3/BN_swap.3 | 2 +- secure/lib/libcrypto/man/man3/BN_zero.3 | 2 +- secure/lib/libcrypto/man/man3/BUF_MEM_new.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_add0_cert.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_add1_recipient_cert.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_add1_signer.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_compress.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_decrypt.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_encrypt.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_final.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_get0_RecipientInfos.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_get0_SignerInfos.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_get0_type.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_get1_ReceiptRequest.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_sign.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_sign_receipt.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_uncompress.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_verify.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_verify_receipt.3 | 2 +- secure/lib/libcrypto/man/man3/CONF_modules_free.3 | 2 +- secure/lib/libcrypto/man/man3/CONF_modules_load_file.3 | 2 +- secure/lib/libcrypto/man/man3/CRYPTO_THREAD_run_once.3 | 2 +- secure/lib/libcrypto/man/man3/CRYPTO_get_ex_new_index.3 | 2 +- secure/lib/libcrypto/man/man3/CRYPTO_memcmp.3 | 2 +- secure/lib/libcrypto/man/man3/CTLOG_STORE_get0_log_by_id.3 | 2 +- secure/lib/libcrypto/man/man3/CTLOG_STORE_new.3 | 2 +- secure/lib/libcrypto/man/man3/CTLOG_new.3 | 2 +- secure/lib/libcrypto/man/man3/CT_POLICY_EVAL_CTX_new.3 | 2 +- secure/lib/libcrypto/man/man3/DEFINE_STACK_OF.3 | 2 +- secure/lib/libcrypto/man/man3/DES_random_key.3 | 2 +- secure/lib/libcrypto/man/man3/DH_generate_key.3 | 2 +- secure/lib/libcrypto/man/man3/DH_generate_parameters.3 | 2 +- secure/lib/libcrypto/man/man3/DH_get0_pqg.3 | 2 +- secure/lib/libcrypto/man/man3/DH_get_1024_160.3 | 2 +- secure/lib/libcrypto/man/man3/DH_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/DH_new.3 | 2 +- secure/lib/libcrypto/man/man3/DH_new_by_nid.3 | 2 +- secure/lib/libcrypto/man/man3/DH_set_method.3 | 2 +- secure/lib/libcrypto/man/man3/DH_size.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_SIG_new.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_do_sign.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_dup_DH.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_generate_key.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_generate_parameters.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_get0_pqg.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_new.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_set_method.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_sign.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_size.3 | 2 +- secure/lib/libcrypto/man/man3/DTLS_get_data_mtu.3 | 2 +- secure/lib/libcrypto/man/man3/DTLS_set_timer_cb.3 | 2 +- secure/lib/libcrypto/man/man3/DTLSv1_listen.3 | 2 +- secure/lib/libcrypto/man/man3/ECDSA_SIG_new.3 | 2 +- secure/lib/libcrypto/man/man3/ECPKParameters_print.3 | 2 +- secure/lib/libcrypto/man/man3/EC_GFp_simple_method.3 | 2 +- secure/lib/libcrypto/man/man3/EC_GROUP_copy.3 | 2 +- secure/lib/libcrypto/man/man3/EC_GROUP_new.3 | 2 +- secure/lib/libcrypto/man/man3/EC_KEY_get_enc_flags.3 | 2 +- secure/lib/libcrypto/man/man3/EC_KEY_new.3 | 2 +- secure/lib/libcrypto/man/man3/EC_POINT_add.3 | 2 +- secure/lib/libcrypto/man/man3/EC_POINT_new.3 | 2 +- secure/lib/libcrypto/man/man3/ENGINE_add.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_GET_LIB.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_clear_error.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_error_string.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_get_error.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_load_crypto_strings.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_load_strings.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_print_errors.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_put_error.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_remove_state.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_set_mark.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_BytesToKey.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_CIPHER_CTX_get_cipher_data.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_CIPHER_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_DigestInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_DigestSignInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_DigestVerifyInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_EncodeInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_EncryptInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_MD_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_OpenInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_ASN1_METHOD.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_ctrl.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_new.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_set1_pbe_pass.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_set_hkdf_md.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_set_rsa_pss_keygen_md.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_set_scrypt_N.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_set_tls1_prf_md.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_asn1_get_count.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_cmp.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_decrypt.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_derive.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_encrypt.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_get_default_digest_nid.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_keygen.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_meth_get_count.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_new.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_print_private.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_set1_RSA.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_sign.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_size.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_verify.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_verify_recover.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_SealInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_SignInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_VerifyInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_aes.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_aria.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_bf_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_blake2b512.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_camellia.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_cast5_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_chacha20.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_des.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_desx_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_idea_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_md2.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_md4.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_md5.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_mdc2.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_rc2_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_rc4.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_rc5_32_12_16_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_ripemd160.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_seed_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_sha1.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_sha224.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_sha3_224.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_sm3.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_sm4_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_whirlpool.3 | 2 +- secure/lib/libcrypto/man/man3/HMAC.3 | 2 +- secure/lib/libcrypto/man/man3/MD5.3 | 2 +- secure/lib/libcrypto/man/man3/MDC2_Init.3 | 2 +- secure/lib/libcrypto/man/man3/OBJ_nid2obj.3 | 2 +- secure/lib/libcrypto/man/man3/OCSP_REQUEST_new.3 | 2 +- secure/lib/libcrypto/man/man3/OCSP_cert_to_id.3 | 2 +- secure/lib/libcrypto/man/man3/OCSP_request_add1_nonce.3 | 2 +- secure/lib/libcrypto/man/man3/OCSP_resp_find_status.3 | 2 +- secure/lib/libcrypto/man/man3/OCSP_response_status.3 | 2 +- secure/lib/libcrypto/man/man3/OCSP_sendreq_new.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_Applink.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_LH_COMPFUNC.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_LH_stats.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_VERSION_NUMBER.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_config.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_fork_prepare.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_ia32cap.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_init_crypto.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_init_ssl.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_instrument_bus.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_load_builtin_modules.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_malloc.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_secure_malloc.3 | 2 +- secure/lib/libcrypto/man/man3/OSSL_STORE_INFO.3 | 2 +- secure/lib/libcrypto/man/man3/OSSL_STORE_LOADER.3 | 2 +- secure/lib/libcrypto/man/man3/OSSL_STORE_SEARCH.3 | 2 +- secure/lib/libcrypto/man/man3/OSSL_STORE_expect.3 | 2 +- secure/lib/libcrypto/man/man3/OSSL_STORE_open.3 | 2 +- secure/lib/libcrypto/man/man3/OpenSSL_add_all_algorithms.3 | 2 +- secure/lib/libcrypto/man/man3/PEM_bytes_read_bio.3 | 2 +- secure/lib/libcrypto/man/man3/PEM_read.3 | 2 +- secure/lib/libcrypto/man/man3/PEM_read_CMS.3 | 2 +- secure/lib/libcrypto/man/man3/PEM_read_bio_PrivateKey.3 | 2 +- secure/lib/libcrypto/man/man3/PEM_read_bio_ex.3 | 2 +- secure/lib/libcrypto/man/man3/PEM_write_bio_CMS_stream.3 | 2 +- secure/lib/libcrypto/man/man3/PEM_write_bio_PKCS7_stream.3 | 2 +- secure/lib/libcrypto/man/man3/PKCS12_create.3 | 2 +- secure/lib/libcrypto/man/man3/PKCS12_newpass.3 | 2 +- secure/lib/libcrypto/man/man3/PKCS12_parse.3 | 2 +- secure/lib/libcrypto/man/man3/PKCS5_PBKDF2_HMAC.3 | 2 +- secure/lib/libcrypto/man/man3/PKCS7_decrypt.3 | 2 +- secure/lib/libcrypto/man/man3/PKCS7_encrypt.3 | 2 +- secure/lib/libcrypto/man/man3/PKCS7_sign.3 | 2 +- secure/lib/libcrypto/man/man3/PKCS7_sign_add_signer.3 | 2 +- secure/lib/libcrypto/man/man3/PKCS7_verify.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_DRBG_generate.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_DRBG_get0_master.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_DRBG_new.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_DRBG_reseed.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_DRBG_set_callbacks.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_DRBG_set_ex_data.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_add.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_bytes.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_cleanup.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_egd.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_load_file.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_set_rand_method.3 | 2 +- secure/lib/libcrypto/man/man3/RC4_set_key.3 | 2 +- secure/lib/libcrypto/man/man3/RIPEMD160_Init.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_blinding_on.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_check_key.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_generate_key.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_get0_key.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_new.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_padding_add_PKCS1_type_1.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_print.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_private_encrypt.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_public_encrypt.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_set_method.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_sign.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_sign_ASN1_OCTET_STRING.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_size.3 | 2 +- secure/lib/libcrypto/man/man3/SCT_new.3 | 2 +- secure/lib/libcrypto/man/man3/SCT_print.3 | 2 +- secure/lib/libcrypto/man/man3/SCT_validate.3 | 2 +- secure/lib/libcrypto/man/man3/SHA256_Init.3 | 2 +- secure/lib/libcrypto/man/man3/SMIME_read_CMS.3 | 2 +- secure/lib/libcrypto/man/man3/SMIME_read_PKCS7.3 | 2 +- secure/lib/libcrypto/man/man3/SMIME_write_CMS.3 | 2 +- secure/lib/libcrypto/man/man3/SMIME_write_PKCS7.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CIPHER_get_name.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_COMP_add_compression_method.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CONF_CTX_new.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CONF_CTX_set1_prefix.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CONF_CTX_set_flags.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CONF_CTX_set_ssl_ctx.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CONF_cmd.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CONF_cmd_argv.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_add1_chain_cert.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_add_extra_chain_cert.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_add_session.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_config.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_ctrl.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_dane_enable.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_flush_sessions.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_free.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_get0_param.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_get_verify_mode.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_has_client_custom_ext.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_load_verify_locations.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_new.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_sess_number.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_sess_set_cache_size.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_sess_set_get_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_sessions.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set0_CA_list.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set1_curves.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set1_sigalgs.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set1_verify_cert_store.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_alpn_select_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_cert_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_cert_store.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_cert_verify_callback.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_cipher_list.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_client_cert_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_client_hello_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_ct_validation_callback.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_ctlog_list_file.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_default_passwd_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_ex_data.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_generate_session_id.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_info_callback.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_keylog_callback.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_max_cert_list.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_min_proto_version.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_mode.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_msg_callback.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_num_tickets.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_options.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_psk_client_callback.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_quiet_shutdown.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_read_ahead.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_record_padding_callback.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_security_level.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_session_cache_mode.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_session_id_context.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_session_ticket_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_split_send_fragment.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_ssl_version.3 | 2 +- .../lib/libcrypto/man/man3/SSL_CTX_set_stateless_cookie_generate_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_timeout.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_tlsext_servername_callback.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_tlsext_status_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_tlsext_ticket_key_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_tlsext_use_srtp.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_tmp_dh_callback.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_verify.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_use_certificate.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_use_psk_identity_hint.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_use_serverinfo.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_free.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_get0_cipher.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_get0_hostname.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_get0_id_context.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_get0_peer.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_get_compress_id.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_get_ex_data.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_get_protocol_version.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_get_time.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_has_ticket.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_is_resumable.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_print.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_set1_id.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_accept.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_alert_type_string.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_alloc_buffers.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_check_chain.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_clear.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_connect.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_do_handshake.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_export_keying_material.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_extension_supported.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_free.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get0_peer_scts.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_SSL_CTX.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_all_async_fds.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_ciphers.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_client_random.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_current_cipher.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_default_timeout.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_error.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_extms_support.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_fd.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_peer_cert_chain.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_peer_certificate.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_peer_signature_nid.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_peer_tmp_key.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_psk_identity.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_rbio.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_session.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_shared_sigalgs.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_verify_result.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_version.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_in_init.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_key_update.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_library_init.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_load_client_CA_file.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_new.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_pending.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_read.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_read_early_data.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_rstate_string.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_session_reused.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_set1_host.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_set_bio.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_set_connect_state.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_set_fd.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_set_session.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_set_shutdown.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_set_verify_result.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_shutdown.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_state_string.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_want.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_write.3 | 2 +- secure/lib/libcrypto/man/man3/UI_STRING.3 | 2 +- secure/lib/libcrypto/man/man3/UI_UTIL_read_pw.3 | 2 +- secure/lib/libcrypto/man/man3/UI_create_method.3 | 2 +- secure/lib/libcrypto/man/man3/UI_new.3 | 2 +- secure/lib/libcrypto/man/man3/X509V3_get_d2i.3 | 2 +- secure/lib/libcrypto/man/man3/X509_ALGOR_dup.3 | 2 +- secure/lib/libcrypto/man/man3/X509_CRL_get0_by_serial.3 | 2 +- secure/lib/libcrypto/man/man3/X509_EXTENSION_set_object.3 | 2 +- secure/lib/libcrypto/man/man3/X509_LOOKUP.3 | 2 +- secure/lib/libcrypto/man/man3/X509_LOOKUP_hash_dir.3 | 2 +- secure/lib/libcrypto/man/man3/X509_LOOKUP_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/X509_NAME_ENTRY_get_object.3 | 2 +- secure/lib/libcrypto/man/man3/X509_NAME_add_entry_by_txt.3 | 2 +- secure/lib/libcrypto/man/man3/X509_NAME_get0_der.3 | 2 +- secure/lib/libcrypto/man/man3/X509_NAME_get_index_by_NID.3 | 2 +- secure/lib/libcrypto/man/man3/X509_NAME_print_ex.3 | 2 +- secure/lib/libcrypto/man/man3/X509_PUBKEY_new.3 | 2 +- secure/lib/libcrypto/man/man3/X509_SIG_get0.3 | 2 +- secure/lib/libcrypto/man/man3/X509_STORE_CTX_get_error.3 | 2 +- secure/lib/libcrypto/man/man3/X509_STORE_CTX_new.3 | 2 +- secure/lib/libcrypto/man/man3/X509_STORE_CTX_set_verify_cb.3 | 2 +- secure/lib/libcrypto/man/man3/X509_STORE_add_cert.3 | 2 +- secure/lib/libcrypto/man/man3/X509_STORE_get0_param.3 | 2 +- secure/lib/libcrypto/man/man3/X509_STORE_new.3 | 2 +- secure/lib/libcrypto/man/man3/X509_STORE_set_verify_cb_func.3 | 2 +- secure/lib/libcrypto/man/man3/X509_VERIFY_PARAM_set_flags.3 | 2 +- secure/lib/libcrypto/man/man3/X509_check_ca.3 | 2 +- secure/lib/libcrypto/man/man3/X509_check_host.3 | 2 +- secure/lib/libcrypto/man/man3/X509_check_issued.3 | 2 +- secure/lib/libcrypto/man/man3/X509_check_private_key.3 | 2 +- secure/lib/libcrypto/man/man3/X509_check_purpose.3 | 2 +- secure/lib/libcrypto/man/man3/X509_cmp.3 | 2 +- secure/lib/libcrypto/man/man3/X509_cmp_time.3 | 2 +- secure/lib/libcrypto/man/man3/X509_digest.3 | 2 +- secure/lib/libcrypto/man/man3/X509_dup.3 | 2 +- secure/lib/libcrypto/man/man3/X509_get0_notBefore.3 | 2 +- secure/lib/libcrypto/man/man3/X509_get0_signature.3 | 2 +- secure/lib/libcrypto/man/man3/X509_get0_uids.3 | 2 +- secure/lib/libcrypto/man/man3/X509_get_extension_flags.3 | 2 +- secure/lib/libcrypto/man/man3/X509_get_pubkey.3 | 2 +- secure/lib/libcrypto/man/man3/X509_get_serialNumber.3 | 2 +- secure/lib/libcrypto/man/man3/X509_get_subject_name.3 | 2 +- secure/lib/libcrypto/man/man3/X509_get_version.3 | 2 +- secure/lib/libcrypto/man/man3/X509_new.3 | 2 +- secure/lib/libcrypto/man/man3/X509_sign.3 | 2 +- secure/lib/libcrypto/man/man3/X509_verify_cert.3 | 2 +- secure/lib/libcrypto/man/man3/X509v3_get_ext_by_NID.3 | 2 +- secure/lib/libcrypto/man/man3/d2i_DHparams.3 | 2 +- secure/lib/libcrypto/man/man3/d2i_PKCS8PrivateKey_bio.3 | 2 +- secure/lib/libcrypto/man/man3/d2i_PrivateKey.3 | 2 +- secure/lib/libcrypto/man/man3/d2i_SSL_SESSION.3 | 2 +- secure/lib/libcrypto/man/man3/d2i_X509.3 | 2 +- secure/lib/libcrypto/man/man3/i2d_CMS_bio_stream.3 | 2 +- secure/lib/libcrypto/man/man3/i2d_PKCS7_bio_stream.3 | 2 +- secure/lib/libcrypto/man/man3/i2d_re_X509_tbs.3 | 2 +- secure/lib/libcrypto/man/man3/o2i_SCT_LIST.3 | 2 +- secure/lib/libcrypto/man/man5/x509v3_config.5 | 2 +- secure/lib/libcrypto/man/man7/Ed25519.7 | 2 +- secure/lib/libcrypto/man/man7/RAND.7 | 2 +- secure/lib/libcrypto/man/man7/RAND_DRBG.7 | 2 +- secure/lib/libcrypto/man/man7/RSA-PSS.7 | 2 +- secure/lib/libcrypto/man/man7/SM2.7 | 2 +- secure/lib/libcrypto/man/man7/X25519.7 | 2 +- secure/lib/libcrypto/man/man7/bio.7 | 2 +- secure/lib/libcrypto/man/man7/ct.7 | 2 +- secure/lib/libcrypto/man/man7/des_modes.7 | 2 +- secure/lib/libcrypto/man/man7/evp.7 | 2 +- secure/lib/libcrypto/man/man7/ossl_store-file.7 | 2 +- secure/lib/libcrypto/man/man7/ossl_store.7 | 2 +- secure/lib/libcrypto/man/man7/passphrase-encoding.7 | 2 +- secure/lib/libcrypto/man/man7/proxy-certificates.7 | 2 +- secure/lib/libcrypto/man/man7/scrypt.7 | 2 +- secure/lib/libcrypto/man/man7/ssl.7 | 2 +- secure/lib/libcrypto/man/man7/x509.7 | 2 +- secure/usr.bin/openssl/man/CA.pl.1 | 2 +- secure/usr.bin/openssl/man/asn1parse.1 | 2 +- secure/usr.bin/openssl/man/ca.1 | 2 +- secure/usr.bin/openssl/man/ciphers.1 | 2 +- secure/usr.bin/openssl/man/cms.1 | 2 +- secure/usr.bin/openssl/man/crl.1 | 2 +- secure/usr.bin/openssl/man/crl2pkcs7.1 | 2 +- secure/usr.bin/openssl/man/dgst.1 | 2 +- secure/usr.bin/openssl/man/dhparam.1 | 2 +- secure/usr.bin/openssl/man/dsa.1 | 2 +- secure/usr.bin/openssl/man/dsaparam.1 | 2 +- secure/usr.bin/openssl/man/ec.1 | 2 +- secure/usr.bin/openssl/man/ecparam.1 | 2 +- secure/usr.bin/openssl/man/enc.1 | 2 +- secure/usr.bin/openssl/man/engine.1 | 2 +- secure/usr.bin/openssl/man/errstr.1 | 2 +- secure/usr.bin/openssl/man/gendsa.1 | 2 +- secure/usr.bin/openssl/man/genpkey.1 | 2 +- secure/usr.bin/openssl/man/genrsa.1 | 2 +- secure/usr.bin/openssl/man/list.1 | 2 +- secure/usr.bin/openssl/man/nseq.1 | 2 +- secure/usr.bin/openssl/man/ocsp.1 | 2 +- secure/usr.bin/openssl/man/openssl.1 | 2 +- secure/usr.bin/openssl/man/passwd.1 | 2 +- secure/usr.bin/openssl/man/pkcs12.1 | 2 +- secure/usr.bin/openssl/man/pkcs7.1 | 2 +- secure/usr.bin/openssl/man/pkcs8.1 | 2 +- secure/usr.bin/openssl/man/pkey.1 | 2 +- secure/usr.bin/openssl/man/pkeyparam.1 | 2 +- secure/usr.bin/openssl/man/pkeyutl.1 | 2 +- secure/usr.bin/openssl/man/prime.1 | 2 +- secure/usr.bin/openssl/man/rand.1 | 2 +- secure/usr.bin/openssl/man/req.1 | 2 +- secure/usr.bin/openssl/man/rsa.1 | 2 +- secure/usr.bin/openssl/man/rsautl.1 | 2 +- secure/usr.bin/openssl/man/s_client.1 | 2 +- secure/usr.bin/openssl/man/s_server.1 | 2 +- secure/usr.bin/openssl/man/s_time.1 | 2 +- secure/usr.bin/openssl/man/sess_id.1 | 2 +- secure/usr.bin/openssl/man/smime.1 | 2 +- secure/usr.bin/openssl/man/speed.1 | 2 +- secure/usr.bin/openssl/man/spkac.1 | 2 +- secure/usr.bin/openssl/man/srp.1 | 2 +- secure/usr.bin/openssl/man/storeutl.1 | 2 +- secure/usr.bin/openssl/man/ts.1 | 2 +- secure/usr.bin/openssl/man/tsget.1 | 2 +- secure/usr.bin/openssl/man/verify.1 | 2 +- secure/usr.bin/openssl/man/version.1 | 2 +- secure/usr.bin/openssl/man/x509.1 | 2 +- 534 files changed, 534 insertions(+), 534 deletions(-) diff --git a/secure/lib/libcrypto/man/man3/ADMISSIONS.3 b/secure/lib/libcrypto/man/man3/ADMISSIONS.3 index 472c17c50dcc..86256c7a2b0b 100644 --- a/secure/lib/libcrypto/man/man3/ADMISSIONS.3 +++ b/secure/lib/libcrypto/man/man3/ADMISSIONS.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ADMISSIONS 3" -.TH ADMISSIONS 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH ADMISSIONS 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/ASN1_INTEGER_get_int64.3 b/secure/lib/libcrypto/man/man3/ASN1_INTEGER_get_int64.3 index 925c09322317..0c269e1a2c57 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_INTEGER_get_int64.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_INTEGER_get_int64.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_INTEGER_GET_INT64 3" -.TH ASN1_INTEGER_GET_INT64 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH ASN1_INTEGER_GET_INT64 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3 b/secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3 index 5fc515f69ee9..a282236912de 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_ITEM_LOOKUP 3" -.TH ASN1_ITEM_LOOKUP 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH ASN1_ITEM_LOOKUP 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3 b/secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3 index e16515ca3c90..c3ff9addda94 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_OBJECT_NEW 3" -.TH ASN1_OBJECT_NEW 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH ASN1_OBJECT_NEW 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3 b/secure/lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3 index 4e8a6899ad62..8c7001950daf 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_STRING_TABLE_ADD 3" -.TH ASN1_STRING_TABLE_ADD 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH ASN1_STRING_TABLE_ADD 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/ASN1_STRING_length.3 b/secure/lib/libcrypto/man/man3/ASN1_STRING_length.3 index 05a85780b2c4..d421c56becf7 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_STRING_length.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_STRING_length.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_STRING_LENGTH 3" -.TH ASN1_STRING_LENGTH 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH ASN1_STRING_LENGTH 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/ASN1_STRING_new.3 b/secure/lib/libcrypto/man/man3/ASN1_STRING_new.3 index 2699b54569a7..1664da0434fe 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_STRING_new.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_STRING_new.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_STRING_NEW 3" -.TH ASN1_STRING_NEW 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH ASN1_STRING_NEW 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/ASN1_STRING_print_ex.3 b/secure/lib/libcrypto/man/man3/ASN1_STRING_print_ex.3 index 0c3c1688f87d..5cd6f3c9d916 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_STRING_print_ex.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_STRING_print_ex.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_STRING_PRINT_EX 3" -.TH ASN1_STRING_PRINT_EX 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH ASN1_STRING_PRINT_EX 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/ASN1_TIME_set.3 b/secure/lib/libcrypto/man/man3/ASN1_TIME_set.3 index cc4c09abca96..54a8367928de 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_TIME_set.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_TIME_set.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_TIME_SET 3" -.TH ASN1_TIME_SET 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH ASN1_TIME_SET 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/ASN1_TYPE_get.3 b/secure/lib/libcrypto/man/man3/ASN1_TYPE_get.3 index 793b67b92b8b..eed7f68cbe5c 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_TYPE_get.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_TYPE_get.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_TYPE_GET 3" -.TH ASN1_TYPE_GET 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH ASN1_TYPE_GET 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/ASN1_generate_nconf.3 b/secure/lib/libcrypto/man/man3/ASN1_generate_nconf.3 index 0cb6b90db135..9dbc10923ed2 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_generate_nconf.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_generate_nconf.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_GENERATE_NCONF 3" -.TH ASN1_GENERATE_NCONF 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH ASN1_GENERATE_NCONF 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/ASYNC_WAIT_CTX_new.3 b/secure/lib/libcrypto/man/man3/ASYNC_WAIT_CTX_new.3 index 67916ea1764a..29d120b2d673 100644 --- a/secure/lib/libcrypto/man/man3/ASYNC_WAIT_CTX_new.3 +++ b/secure/lib/libcrypto/man/man3/ASYNC_WAIT_CTX_new.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASYNC_WAIT_CTX_NEW 3" -.TH ASYNC_WAIT_CTX_NEW 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH ASYNC_WAIT_CTX_NEW 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/ASYNC_start_job.3 b/secure/lib/libcrypto/man/man3/ASYNC_start_job.3 index 97361e504a22..dbd50cdebca7 100644 --- a/secure/lib/libcrypto/man/man3/ASYNC_start_job.3 +++ b/secure/lib/libcrypto/man/man3/ASYNC_start_job.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASYNC_START_JOB 3" -.TH ASYNC_START_JOB 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH ASYNC_START_JOB 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BF_encrypt.3 b/secure/lib/libcrypto/man/man3/BF_encrypt.3 index f969016051cd..54cbc2c1f127 100644 --- a/secure/lib/libcrypto/man/man3/BF_encrypt.3 +++ b/secure/lib/libcrypto/man/man3/BF_encrypt.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BF_ENCRYPT 3" -.TH BF_ENCRYPT 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BF_ENCRYPT 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_ADDR.3 b/secure/lib/libcrypto/man/man3/BIO_ADDR.3 index 7b9dc781f3dc..f535ffa1461c 100644 --- a/secure/lib/libcrypto/man/man3/BIO_ADDR.3 +++ b/secure/lib/libcrypto/man/man3/BIO_ADDR.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_ADDR 3" -.TH BIO_ADDR 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_ADDR 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_ADDRINFO.3 b/secure/lib/libcrypto/man/man3/BIO_ADDRINFO.3 index 6b49c9addd18..c19447fabf54 100644 --- a/secure/lib/libcrypto/man/man3/BIO_ADDRINFO.3 +++ b/secure/lib/libcrypto/man/man3/BIO_ADDRINFO.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_ADDRINFO 3" -.TH BIO_ADDRINFO 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_ADDRINFO 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_connect.3 b/secure/lib/libcrypto/man/man3/BIO_connect.3 index b8863dbf6c98..520bde6a36ba 100644 --- a/secure/lib/libcrypto/man/man3/BIO_connect.3 +++ b/secure/lib/libcrypto/man/man3/BIO_connect.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_CONNECT 3" -.TH BIO_CONNECT 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_CONNECT 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_ctrl.3 b/secure/lib/libcrypto/man/man3/BIO_ctrl.3 index 6e7ab386b6cc..8e6948cb77a3 100644 --- a/secure/lib/libcrypto/man/man3/BIO_ctrl.3 +++ b/secure/lib/libcrypto/man/man3/BIO_ctrl.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_CTRL 3" -.TH BIO_CTRL 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_CTRL 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_f_base64.3 b/secure/lib/libcrypto/man/man3/BIO_f_base64.3 index d538546bb927..244affad64c1 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_base64.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_base64.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_F_BASE64 3" -.TH BIO_F_BASE64 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_F_BASE64 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_f_buffer.3 b/secure/lib/libcrypto/man/man3/BIO_f_buffer.3 index ac59ca2f3d2e..85342305399e 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_buffer.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_buffer.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_F_BUFFER 3" -.TH BIO_F_BUFFER 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_F_BUFFER 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_f_cipher.3 b/secure/lib/libcrypto/man/man3/BIO_f_cipher.3 index 4183f466ac82..2d6f4d9aef76 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_cipher.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_cipher.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_F_CIPHER 3" -.TH BIO_F_CIPHER 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_F_CIPHER 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_f_md.3 b/secure/lib/libcrypto/man/man3/BIO_f_md.3 index b9c7003e1a16..d9838f76ac56 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_md.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_md.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_F_MD 3" -.TH BIO_F_MD 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_F_MD 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_f_null.3 b/secure/lib/libcrypto/man/man3/BIO_f_null.3 index b2ddb5c9bd0f..942955c6b55e 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_null.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_null.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_F_NULL 3" -.TH BIO_F_NULL 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_F_NULL 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_f_ssl.3 b/secure/lib/libcrypto/man/man3/BIO_f_ssl.3 index 2dfe01321313..d2c15f86bdc9 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_ssl.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_ssl.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_F_SSL 3" -.TH BIO_F_SSL 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_F_SSL 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_find_type.3 b/secure/lib/libcrypto/man/man3/BIO_find_type.3 index a6d5c8a83b17..a878b414af9a 100644 --- a/secure/lib/libcrypto/man/man3/BIO_find_type.3 +++ b/secure/lib/libcrypto/man/man3/BIO_find_type.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_FIND_TYPE 3" -.TH BIO_FIND_TYPE 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_FIND_TYPE 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_get_data.3 b/secure/lib/libcrypto/man/man3/BIO_get_data.3 index 92f74a0fadb5..815fd66e44e4 100644 --- a/secure/lib/libcrypto/man/man3/BIO_get_data.3 +++ b/secure/lib/libcrypto/man/man3/BIO_get_data.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_GET_DATA 3" -.TH BIO_GET_DATA 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_GET_DATA 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_get_ex_new_index.3 b/secure/lib/libcrypto/man/man3/BIO_get_ex_new_index.3 index 76a6fc5f8e92..08d894831848 100644 --- a/secure/lib/libcrypto/man/man3/BIO_get_ex_new_index.3 +++ b/secure/lib/libcrypto/man/man3/BIO_get_ex_new_index.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_GET_EX_NEW_INDEX 3" -.TH BIO_GET_EX_NEW_INDEX 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_GET_EX_NEW_INDEX 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_meth_new.3 b/secure/lib/libcrypto/man/man3/BIO_meth_new.3 index a5b20c23f39b..56bd2108ec49 100644 --- a/secure/lib/libcrypto/man/man3/BIO_meth_new.3 +++ b/secure/lib/libcrypto/man/man3/BIO_meth_new.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_METH_NEW 3" -.TH BIO_METH_NEW 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_METH_NEW 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_new.3 b/secure/lib/libcrypto/man/man3/BIO_new.3 index 7113af6046ee..28c9d496d238 100644 --- a/secure/lib/libcrypto/man/man3/BIO_new.3 +++ b/secure/lib/libcrypto/man/man3/BIO_new.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_NEW 3" -.TH BIO_NEW 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_NEW 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_new_CMS.3 b/secure/lib/libcrypto/man/man3/BIO_new_CMS.3 index fa4a277e0a7b..75687e8582bb 100644 --- a/secure/lib/libcrypto/man/man3/BIO_new_CMS.3 +++ b/secure/lib/libcrypto/man/man3/BIO_new_CMS.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_NEW_CMS 3" -.TH BIO_NEW_CMS 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_NEW_CMS 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_parse_hostserv.3 b/secure/lib/libcrypto/man/man3/BIO_parse_hostserv.3 index 377108fb07b3..7aa82048178b 100644 --- a/secure/lib/libcrypto/man/man3/BIO_parse_hostserv.3 +++ b/secure/lib/libcrypto/man/man3/BIO_parse_hostserv.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_PARSE_HOSTSERV 3" -.TH BIO_PARSE_HOSTSERV 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_PARSE_HOSTSERV 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_printf.3 b/secure/lib/libcrypto/man/man3/BIO_printf.3 index cdfbdd839ec9..bfdb71cfd6cb 100644 --- a/secure/lib/libcrypto/man/man3/BIO_printf.3 +++ b/secure/lib/libcrypto/man/man3/BIO_printf.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_PRINTF 3" -.TH BIO_PRINTF 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_PRINTF 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_push.3 b/secure/lib/libcrypto/man/man3/BIO_push.3 index d3214d1cc631..e1e93ad666bd 100644 --- a/secure/lib/libcrypto/man/man3/BIO_push.3 +++ b/secure/lib/libcrypto/man/man3/BIO_push.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_PUSH 3" -.TH BIO_PUSH 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_PUSH 3 "2023-02-07" "1.1.1t" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_read.3 b/secure/lib/libcrypto/man/man3/BIO_read.3 index 65ed6b567f2c..4f91ea08954c 100644 --- a/secure/lib/libcrypto/man/man3/BIO_read.3 +++ b/secure/lib/libcrypto/man/man3/BIO_read.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_READ 3" -.TH BIO_READ 3 "2022-11-01" "1.1.1s" "OpenSSL" +.TH BIO_READ 3 "2023-02-07" "1.1.1t" "OpenSSL" *** 6503 LINES SKIPPED *** From nobody Wed Feb 8 00:26:14 2023 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 4PBLQH4DKcz3p99H; Wed, 8 Feb 2023 00: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 4PBLQH1hC0z41HX; Wed, 8 Feb 2023 00: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=1675815975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kgKnKhIE5xt9xjKJrPZA1eZzHFjmFK8tFVK8JiY9MAg=; b=qAK8IMY3NZ8jXTbs03M5oYWvtpITTHPfaPVpAd2JWohfm4eZNGQ08ubIcR9VuVpSfEpao5 cwZorun9XRgmMgGGccw4bbjfrFrcV+zHRT+5DPCaKE7/Gj28brArIN9mEWUSP/0sDnHm/h DrFueqEYGkNT+r4wFxRJRUG+BRQTVlnce9CfQxpadeF4djAKJ+vZFs5PGTJ/WHFll65fbh lxJuDGZMWfLR/l1Z0Rb12QvcB8atyxY0/sh6VcnqCuX1uFswn0ITrYKbD8tyFrPHS9WXTd S1mraY1u9TpZ5GeU3r0+7nwhMPFJYSdrwgf2gwxkqEjFgrQjwT+ZSooxW6Ypig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675815975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kgKnKhIE5xt9xjKJrPZA1eZzHFjmFK8tFVK8JiY9MAg=; b=WLEqaEgPreLGs1JEAUAZTVHGDNC226PH6DB3rKCeeggCAAfOB6WKyZJnUhB7z2kdNa7/6g bPPJTM/EVJ1AnZFZZ3gGe88yA/YPLyuGVe128VjqoGzxz8P6NNFp7mmk9++XL/dF07pg4S Ourom6mWbuatxWCDPo2If5q8Rm+fXGWHnJjzmXnoego/9fQc0Bd/pVMCv3EuPtu6lCaxIR DK4ME9IzbbP/Qq7C0dPdSfPU2lBbRsTFeCOzALTMrRc/+ngvUgYnDZ6STiqSI09Kp/fhtY W9oYWpNUQ4F9oeEU/UJa544ok3tFGScmkMOoEDvvEAIbW0AssoahnnCWhVJbVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675815975; a=rsa-sha256; cv=none; b=pVFIf2jsNwPZpOW/w3mansljlExQY/kB8jpKcg0Q8O7I/W7ItO1MufVvhxWa9LLI842J46 bAkJWWY7gaRLAgj1pb22+ZmmGIzlJljIVYGJoFozMfKyCS+9whR4mkftUdOE/z8DIYXbWj 09LQzxBctAWtOHyitehcMT/KykGpJiYlHmAz2cJhA+d4xIwUHKQBT0moLkYHt0d4zJZpEz AuTOJ1+wMo/GX98neifS7Cp97heZ+m0/HUbwYl4QpQn8Xai3cTAnhOGUtGZPnydafWS3T2 YTKLCDohIM2PUIi9C7cFytOWbqmHJgyeCJtVGeUbb1sggxzInURXdBEDx1WS7g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBLQH0lXmzc9L; Wed, 8 Feb 2023 00:26:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3180QFQ3096097; Wed, 8 Feb 2023 00:26:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3180QEp8096096; Wed, 8 Feb 2023 00:26:14 GMT (envelope-from git) Date: Wed, 8 Feb 2023 00:26:14 GMT Message-Id: <202302080026.3180QEp8096096@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: 42bad04a2156 - stable/13 - irdma: Add RDMA driver for Intel(R) Ethernet Controller E810 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: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 42bad04a21560f3a82ac3bdbd656d69634512cfc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=42bad04a21560f3a82ac3bdbd656d69634512cfc commit 42bad04a21560f3a82ac3bdbd656d69634512cfc Author: Bartosz Sobczak AuthorDate: 2022-05-23 23:39:27 +0000 Commit: Eric Joyner CommitDate: 2023-02-08 00:23:44 +0000 irdma: Add RDMA driver for Intel(R) Ethernet Controller E810 This is an initial commit for RDMA FreeBSD driver for Intel(R) Ethernet Controller E810, called irdma. Supporting both RoCEv2 and iWARP protocols in per-PF manner, RoCEv2 being the default. Testing has been done using krping tool, perftest, ucmatose, rping, ud_pingpong, rc_pingpong and others. Signed-off-by: Eric Joyner Reviewed by: #manpages (pauamma_gundo.com) [documentation] Relnotes: yes Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D34690 (cherry picked from commit cdcd52d41e246ba1c0fcfad0769bd691487355ef) (cherry picked from commit e602a30bb9fc7ee041a0e629d0fd2db7933ffa32) (cherry picked from commit a6e275af46644af1de365a1edf19742bfa28bb69) --- contrib/ofed/libirdma/abi.h | 180 ++ contrib/ofed/libirdma/i40e_devids.h | 69 + contrib/ofed/libirdma/i40iw_hw.h | 64 + contrib/ofed/libirdma/ice_devids.h | 92 + contrib/ofed/libirdma/irdma-abi.h | 143 + contrib/ofed/libirdma/irdma.h | 93 + contrib/ofed/libirdma/irdma_defs.h | 554 ++++ contrib/ofed/libirdma/irdma_uk.c | 1884 ++++++++++++ contrib/ofed/libirdma/irdma_umain.c | 255 ++ contrib/ofed/libirdma/irdma_umain.h | 218 ++ contrib/ofed/libirdma/irdma_user.h | 479 +++ contrib/ofed/libirdma/irdma_uverbs.c | 2262 ++++++++++++++ contrib/ofed/libirdma/libirdma.map | 10 + contrib/ofed/libirdma/osdep.h | 213 ++ lib/ofed/Makefile | 2 + lib/ofed/libirdma/Makefile | 23 + share/man/man4/irdma.4 | 233 ++ share/mk/bsd.libnames.mk | 1 + share/mk/src.libnames.mk | 3 + sys/amd64/conf/NOTES | 3 + sys/conf/files | 31 + sys/dev/irdma/fbsd_kcompat.c | 736 +++++ sys/dev/irdma/fbsd_kcompat.h | 251 ++ sys/dev/irdma/ice_devids.h | 92 + sys/dev/irdma/icrdma.c | 704 +++++ sys/dev/irdma/icrdma_hw.c | 418 +++ sys/dev/irdma/icrdma_hw.h | 137 + sys/dev/irdma/irdma-abi.h | 143 + sys/dev/irdma/irdma.h | 238 ++ sys/dev/irdma/irdma_cm.c | 4253 +++++++++++++++++++++++++ sys/dev/irdma/irdma_cm.h | 453 +++ sys/dev/irdma/irdma_ctrl.c | 5644 ++++++++++++++++++++++++++++++++++ sys/dev/irdma/irdma_defs.h | 2337 ++++++++++++++ sys/dev/irdma/irdma_hmc.c | 734 +++++ sys/dev/irdma/irdma_hmc.h | 202 ++ sys/dev/irdma/irdma_hw.c | 2829 +++++++++++++++++ sys/dev/irdma/irdma_kcompat.c | 1568 ++++++++++ sys/dev/irdma/irdma_main.h | 589 ++++ sys/dev/irdma/irdma_pble.c | 557 ++++ sys/dev/irdma/irdma_pble.h | 166 + sys/dev/irdma/irdma_protos.h | 141 + sys/dev/irdma/irdma_puda.c | 1856 +++++++++++ sys/dev/irdma/irdma_puda.h | 221 ++ sys/dev/irdma/irdma_type.h | 1533 +++++++++ sys/dev/irdma/irdma_uda.c | 318 ++ sys/dev/irdma/irdma_uda.h | 120 + sys/dev/irdma/irdma_uda_d.h | 415 +++ sys/dev/irdma/irdma_uk.c | 1808 +++++++++++ sys/dev/irdma/irdma_user.h | 477 +++ sys/dev/irdma/irdma_utils.c | 2325 ++++++++++++++ sys/dev/irdma/irdma_verbs.c | 3364 ++++++++++++++++++++ sys/dev/irdma/irdma_verbs.h | 313 ++ sys/dev/irdma/irdma_ws.c | 447 +++ sys/dev/irdma/irdma_ws.h | 74 + sys/dev/irdma/osdep.h | 247 ++ sys/modules/Makefile | 4 + sys/modules/irdma/Makefile | 23 + usr.bin/ofed/libibverbs/Makefile.inc | 2 +- usr.bin/ofed/librdmacm/Makefile.inc | 2 +- 59 files changed, 42551 insertions(+), 2 deletions(-) diff --git a/contrib/ofed/libirdma/abi.h b/contrib/ofed/libirdma/abi.h new file mode 100644 index 000000000000..ff7a2828efe0 --- /dev/null +++ b/contrib/ofed/libirdma/abi.h @@ -0,0 +1,180 @@ +/*- + * SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB + * + * Copyright (C) 2019 - 2020 Intel Corporation + * + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenFabrics.org BSD license below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +/*$FreeBSD$*/ + +#ifndef PROVIDER_IRDMA_ABI_H +#define PROVIDER_IRDMA_ABI_H + +#include "irdma.h" +#include +#include "irdma-abi.h" + +#define IRDMA_MIN_ABI_VERSION 0 +#define IRDMA_MAX_ABI_VERSION 5 + +struct irdma_ualloc_pd_resp { + struct ibv_alloc_pd_resp ibv_resp; + __u32 pd_id; + __u8 rsvd[4]; + +}; +struct irdma_ucreate_cq { + struct ibv_create_cq ibv_cmd; + __aligned_u64 user_cq_buf; + __aligned_u64 user_shadow_area; + +}; +struct irdma_ucreate_cq_resp { + struct ibv_create_cq_resp ibv_resp; + __u32 cq_id; + __u32 cq_size; + +}; +struct irdma_ucreate_cq_ex { + struct ibv_create_cq_ex ibv_cmd; + __aligned_u64 user_cq_buf; + __aligned_u64 user_shadow_area; + +}; +struct irdma_ucreate_cq_ex_resp { + struct ibv_create_cq_resp_ex ibv_resp; + __u32 cq_id; + __u32 cq_size; + +}; +struct irdma_uresize_cq { + struct ibv_resize_cq ibv_cmd; + __aligned_u64 user_cq_buffer; + +}; +struct irdma_uresize_cq_resp { + struct ibv_resize_cq_resp ibv_resp; + +}; +struct irdma_ucreate_qp { + struct ibv_create_qp ibv_cmd; + __aligned_u64 user_wqe_bufs; + __aligned_u64 user_compl_ctx; + +}; +struct irdma_ucreate_qp_resp { + struct ibv_create_qp_resp ibv_resp; + __u32 qp_id; + __u32 actual_sq_size; + __u32 actual_rq_size; + __u32 irdma_drv_opt; + __u16 push_idx; + __u8 lsmm; + __u8 rsvd; + __u32 qp_caps; + +}; +struct irdma_umodify_qp_resp { + struct ibv_modify_qp_resp_ex ibv_resp; + __aligned_u64 push_wqe_mmap_key; + __aligned_u64 push_db_mmap_key; + __u16 push_offset; + __u8 push_valid; + __u8 rd_fence_rate; + __u8 rsvd[4]; + +}; +struct irdma_get_context { + struct ibv_get_context ibv_cmd; + __u32 rsvd32; + __u8 userspace_ver; + __u8 rsvd8[3]; + +}; +struct irdma_get_context_resp { + struct ibv_get_context_resp ibv_resp; + __u32 max_pds; + __u32 max_qps; + __u32 wq_size; /* size of the WQs (SQ+RQ) in the mmaped area */ + __u8 kernel_ver; + __u8 rsvd[3]; + __aligned_u64 feature_flags; + __aligned_u64 db_mmap_key; + __u32 max_hw_wq_frags; + __u32 max_hw_read_sges; + __u32 max_hw_inline; + __u32 max_hw_rq_quanta; + __u32 max_hw_wq_quanta; + __u32 min_hw_cq_size; + __u32 max_hw_cq_size; + __u16 max_hw_sq_chunk; + __u8 hw_rev; + __u8 rsvd2; + +}; +struct irdma_ureg_mr { + struct ibv_reg_mr ibv_cmd; + __u16 reg_type; /* enum irdma_memreg_type */ + __u16 cq_pages; + __u16 rq_pages; + __u16 sq_pages; + +}; +struct irdma_ucreate_ah_resp { + struct ibv_create_ah_resp ibv_resp; + __u32 ah_id; + __u8 rsvd[4]; + +}; + +struct irdma_modify_qp_cmd { + struct ibv_modify_qp_ex ibv_cmd; + __u8 sq_flush; + __u8 rq_flush; + __u8 rsvd[6]; +}; + +struct irdma_query_device_ex { + struct ibv_query_device_ex ibv_cmd; +}; + +struct irdma_query_device_ex_resp { + struct ibv_query_device_resp_ex ibv_resp; + __u32 comp_mask; + __u32 response_length; + struct ibv_odp_caps_resp odp_caps; + __u64 timestamp_mask; + __u64 hca_core_clock; + __u64 device_cap_flags_ex; + struct ibv_rss_caps_resp rss_caps; + __u32 max_wq_type_rq; + __u32 raw_packet_caps; + struct ibv_tso_caps tso_caps; +}; +#endif /* PROVIDER_IRDMA_ABI_H */ diff --git a/contrib/ofed/libirdma/i40e_devids.h b/contrib/ofed/libirdma/i40e_devids.h new file mode 100644 index 000000000000..1b0eaae95b82 --- /dev/null +++ b/contrib/ofed/libirdma/i40e_devids.h @@ -0,0 +1,69 @@ +/*- + * SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB + * + * Copyright (c) 2015 - 2019 Intel Corporation + * + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenFabrics.org BSD license below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +/*$FreeBSD$*/ + +#ifndef I40E_DEVIDS_H +#define I40E_DEVIDS_H + +/* Vendor ID */ +#define I40E_INTEL_VENDOR_ID 0x8086 + +/* Device IDs */ +#define I40E_DEV_ID_SFP_XL710 0x1572 +#define I40E_DEV_ID_QEMU 0x1574 +#define I40E_DEV_ID_KX_B 0x1580 +#define I40E_DEV_ID_KX_C 0x1581 +#define I40E_DEV_ID_QSFP_A 0x1583 +#define I40E_DEV_ID_QSFP_B 0x1584 +#define I40E_DEV_ID_QSFP_C 0x1585 +#define I40E_DEV_ID_10G_BASE_T 0x1586 +#define I40E_DEV_ID_20G_KR2 0x1587 +#define I40E_DEV_ID_20G_KR2_A 0x1588 +#define I40E_DEV_ID_10G_BASE_T4 0x1589 +#define I40E_DEV_ID_25G_B 0x158A +#define I40E_DEV_ID_25G_SFP28 0x158B +#define I40E_DEV_ID_VF 0x154C +#define I40E_DEV_ID_VF_HV 0x1571 +#define I40E_DEV_ID_X722_A0 0x374C +#define I40E_DEV_ID_X722_A0_VF 0x374D +#define I40E_DEV_ID_KX_X722 0x37CE +#define I40E_DEV_ID_QSFP_X722 0x37CF +#define I40E_DEV_ID_SFP_X722 0x37D0 +#define I40E_DEV_ID_1G_BASE_T_X722 0x37D1 +#define I40E_DEV_ID_10G_BASE_T_X722 0x37D2 +#define I40E_DEV_ID_SFP_I_X722 0x37D3 +#define I40E_DEV_ID_X722_VF 0x37CD +#define I40E_DEV_ID_X722_VF_HV 0x37D9 + +#endif /* I40E_DEVIDS_H */ diff --git a/contrib/ofed/libirdma/i40iw_hw.h b/contrib/ofed/libirdma/i40iw_hw.h new file mode 100644 index 000000000000..38c7e37c35c9 --- /dev/null +++ b/contrib/ofed/libirdma/i40iw_hw.h @@ -0,0 +1,64 @@ +/*- + * SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB + * + * Copyright (c) 2015 - 2020 Intel Corporation + * + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenFabrics.org BSD license below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +/*$FreeBSD$*/ + +#ifndef I40IW_HW_H +#define I40IW_HW_H + +enum i40iw_device_caps_const { + I40IW_MAX_WQ_FRAGMENT_COUNT = 3, + I40IW_MAX_SGE_RD = 1, + I40IW_MAX_PUSH_PAGE_COUNT = 0, + I40IW_MAX_INLINE_DATA_SIZE = 48, + I40IW_MAX_IRD_SIZE = 63, + I40IW_MAX_ORD_SIZE = 127, + I40IW_MAX_WQ_ENTRIES = 2048, + I40IW_MAX_WQE_SIZE_RQ = 128, + I40IW_MAX_PDS = 32768, + I40IW_MAX_STATS_COUNT = 16, + I40IW_MAX_CQ_SIZE = 1048575, + I40IW_MAX_OUTBOUND_MSG_SIZE = 2147483647, + I40IW_MAX_INBOUND_MSG_SIZE = 2147483647, +}; + +#define I40IW_QP_WQE_MIN_SIZE 32 +#define I40IW_QP_WQE_MAX_SIZE 128 +#define I40IW_QP_SW_MIN_WQSIZE 4 +#define I40IW_MAX_RQ_WQE_SHIFT 2 +#define I40IW_MAX_QUANTA_PER_WR 2 + +#define I40IW_QP_SW_MAX_SQ_QUANTA 2048 +#define I40IW_QP_SW_MAX_RQ_QUANTA 16384 +#define I40IW_QP_SW_MAX_WQ_QUANTA 2048 +#endif /* I40IW_HW_H */ diff --git a/contrib/ofed/libirdma/ice_devids.h b/contrib/ofed/libirdma/ice_devids.h new file mode 100644 index 000000000000..57f26bc33260 --- /dev/null +++ b/contrib/ofed/libirdma/ice_devids.h @@ -0,0 +1,92 @@ +/*- + * SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB + * + * Copyright (c) 2019 - 2020 Intel Corporation + * + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenFabrics.org BSD license below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +/*$FreeBSD$*/ + +#ifndef ICE_DEVIDS_H +#define ICE_DEVIDS_H + +#define PCI_VENDOR_ID_INTEL 0x8086 + +/* Device IDs */ +/* Intel(R) Ethernet Connection E823-L for backplane */ +#define ICE_DEV_ID_E823L_BACKPLANE 0x124C +/* Intel(R) Ethernet Connection E823-L for SFP */ +#define ICE_DEV_ID_E823L_SFP 0x124D +/* Intel(R) Ethernet Connection E823-L/X557-AT 10GBASE-T */ +#define ICE_DEV_ID_E823L_10G_BASE_T 0x124E +/* Intel(R) Ethernet Connection E823-L 1GbE */ +#define ICE_DEV_ID_E823L_1GBE 0x124F +/* Intel(R) Ethernet Connection E823-L for QSFP */ +#define ICE_DEV_ID_E823L_QSFP 0x151D +/* Intel(R) Ethernet Controller E810-C for backplane */ +#define ICE_DEV_ID_E810C_BACKPLANE 0x1591 +/* Intel(R) Ethernet Controller E810-C for QSFP */ +#define ICE_DEV_ID_E810C_QSFP 0x1592 +/* Intel(R) Ethernet Controller E810-C for SFP */ +#define ICE_DEV_ID_E810C_SFP 0x1593 +/* Intel(R) Ethernet Controller E810-XXV for backplane */ +#define ICE_DEV_ID_E810_XXV_BACKPLANE 0x1599 +/* Intel(R) Ethernet Controller E810-XXV for QSFP */ +#define ICE_DEV_ID_E810_XXV_QSFP 0x159A +/* Intel(R) Ethernet Controller E810-XXV for SFP */ +#define ICE_DEV_ID_E810_XXV_SFP 0x159B +/* Intel(R) Ethernet Connection E823-C for backplane */ +#define ICE_DEV_ID_E823C_BACKPLANE 0x188A +/* Intel(R) Ethernet Connection E823-C for QSFP */ +#define ICE_DEV_ID_E823C_QSFP 0x188B +/* Intel(R) Ethernet Connection E823-C for SFP */ +#define ICE_DEV_ID_E823C_SFP 0x188C +/* Intel(R) Ethernet Connection E823-C/X557-AT 10GBASE-T */ +#define ICE_DEV_ID_E823C_10G_BASE_T 0x188D +/* Intel(R) Ethernet Connection E823-C 1GbE */ +#define ICE_DEV_ID_E823C_SGMII 0x188E +/* Intel(R) Ethernet Connection C822N for backplane */ +#define ICE_DEV_ID_C822N_BACKPLANE 0x1890 +/* Intel(R) Ethernet Connection C822N for QSFP */ +#define ICE_DEV_ID_C822N_QSFP 0x1891 +/* Intel(R) Ethernet Connection C822N for SFP */ +#define ICE_DEV_ID_C822N_SFP 0x1892 +/* Intel(R) Ethernet Connection E822-C/X557-AT 10GBASE-T */ +#define ICE_DEV_ID_E822C_10G_BASE_T 0x1893 +/* Intel(R) Ethernet Connection E822-C 1GbE */ +#define ICE_DEV_ID_E822C_SGMII 0x1894 +/* Intel(R) Ethernet Connection E822-L for backplane */ +#define ICE_DEV_ID_E822L_BACKPLANE 0x1897 +/* Intel(R) Ethernet Connection E822-L for SFP */ +#define ICE_DEV_ID_E822L_SFP 0x1898 +/* Intel(R) Ethernet Connection E822-L/X557-AT 10GBASE-T */ +#define ICE_DEV_ID_E822L_10G_BASE_T 0x1899 +/* Intel(R) Ethernet Connection E822-L 1GbE */ +#define ICE_DEV_ID_E822L_SGMII 0x189A +#endif /* ICE_DEVIDS_H */ diff --git a/contrib/ofed/libirdma/irdma-abi.h b/contrib/ofed/libirdma/irdma-abi.h new file mode 100644 index 000000000000..8a06198608e2 --- /dev/null +++ b/contrib/ofed/libirdma/irdma-abi.h @@ -0,0 +1,143 @@ +/*- + * SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) + * + * + * Copyright (c) 2006 - 2021 Intel Corporation. All rights reserved. + * Copyright (c) 2005 Topspin Communications. All rights reserved. + * Copyright (c) 2005 Cisco Systems. All rights reserved. + * Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved. + * + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenFabrics.org BSD license below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +/*$FreeBSD$*/ + +#ifndef IRDMA_ABI_H +#define IRDMA_ABI_H + +#include + +/* irdma must support legacy GEN_1 i40iw kernel + * and user-space whose last ABI ver is 5 + */ +#define IRDMA_ABI_VER 5 + +enum irdma_memreg_type { + IRDMA_MEMREG_TYPE_MEM = 0, + IRDMA_MEMREG_TYPE_QP = 1, + IRDMA_MEMREG_TYPE_CQ = 2, +}; + +struct irdma_alloc_ucontext_req { + __u32 rsvd32; + __u8 userspace_ver; + __u8 rsvd8[3]; +}; + +struct irdma_alloc_ucontext_resp { + __u32 max_pds; + __u32 max_qps; + __u32 wq_size; /* size of the WQs (SQ+RQ) in the mmaped area */ + __u8 kernel_ver; + __u8 rsvd[3]; + __aligned_u64 feature_flags; + __aligned_u64 db_mmap_key; + __u32 max_hw_wq_frags; + __u32 max_hw_read_sges; + __u32 max_hw_inline; + __u32 max_hw_rq_quanta; + __u32 max_hw_wq_quanta; + __u32 min_hw_cq_size; + __u32 max_hw_cq_size; + __u16 max_hw_sq_chunk; + __u8 hw_rev; + __u8 rsvd2; +}; + +struct irdma_alloc_pd_resp { + __u32 pd_id; + __u8 rsvd[4]; +}; + +struct irdma_resize_cq_req { + __aligned_u64 user_cq_buffer; +}; + +struct irdma_create_cq_req { + __aligned_u64 user_cq_buf; + __aligned_u64 user_shadow_area; +}; + +struct irdma_create_qp_req { + __aligned_u64 user_wqe_bufs; + __aligned_u64 user_compl_ctx; +}; + +struct irdma_mem_reg_req { + __u16 reg_type; /* enum irdma_memreg_type */ + __u16 cq_pages; + __u16 rq_pages; + __u16 sq_pages; +}; + +struct irdma_modify_qp_req { + __u8 sq_flush; + __u8 rq_flush; + __u8 rsvd[6]; +}; + +struct irdma_create_cq_resp { + __u32 cq_id; + __u32 cq_size; +}; + +struct irdma_create_qp_resp { + __u32 qp_id; + __u32 actual_sq_size; + __u32 actual_rq_size; + __u32 irdma_drv_opt; + __u16 push_idx; + __u8 lsmm; + __u8 rsvd; + __u32 qp_caps; +}; + +struct irdma_modify_qp_resp { + __aligned_u64 push_wqe_mmap_key; + __aligned_u64 push_db_mmap_key; + __u16 push_offset; + __u8 push_valid; + __u8 rd_fence_rate; + __u8 rsvd[4]; +}; + +struct irdma_create_ah_resp { + __u32 ah_id; + __u8 rsvd[4]; +}; +#endif /* IRDMA_ABI_H */ diff --git a/contrib/ofed/libirdma/irdma.h b/contrib/ofed/libirdma/irdma.h new file mode 100644 index 000000000000..27fa3d53d3e8 --- /dev/null +++ b/contrib/ofed/libirdma/irdma.h @@ -0,0 +1,93 @@ +/*- + * SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB + * + * Copyright (c) 2017 - 2021 Intel Corporation + * + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenFabrics.org BSD license below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +/*$FreeBSD$*/ + +#ifndef IRDMA_H +#define IRDMA_H + +#define RDMA_BIT2(type, a) ((u##type) 1UL << a) +#define RDMA_MASK3(type, mask, shift) ((u##type) mask << shift) +#define MAKEMASK(m, s) ((m) << (s)) +#define IRDMA_WQEALLOC_WQE_DESC_INDEX_S 20 +#define IRDMA_WQEALLOC_WQE_DESC_INDEX_M (0xfff << IRDMA_WQEALLOC_WQE_DESC_INDEX_S) + +enum irdma_vers { + IRDMA_GEN_RSVD, + IRDMA_GEN_1, + IRDMA_GEN_2, +}; + +struct irdma_uk_attrs { + u64 feature_flags; + u32 max_hw_wq_frags; + u32 max_hw_read_sges; + u32 max_hw_inline; + u32 max_hw_rq_quanta; + u32 max_hw_wq_quanta; + u32 min_hw_cq_size; + u32 max_hw_cq_size; + u16 max_hw_sq_chunk; + u16 max_hw_wq_size; + u16 min_sw_wq_size; + u8 hw_rev; +}; + +struct irdma_hw_attrs { + struct irdma_uk_attrs uk_attrs; + u64 max_hw_outbound_msg_size; + u64 max_hw_inbound_msg_size; + u64 max_mr_size; + u32 min_hw_qp_id; + u32 min_hw_aeq_size; + u32 max_hw_aeq_size; + u32 min_hw_ceq_size; + u32 max_hw_ceq_size; + u32 max_hw_device_pages; + u32 max_hw_vf_fpm_id; + u32 first_hw_vf_fpm_id; + u32 max_hw_ird; + u32 max_hw_ord; + u32 max_hw_wqes; + u32 max_hw_pds; + u32 max_hw_ena_vf_count; + u32 max_qp_wr; + u32 max_pe_ready_count; + u32 max_done_count; + u32 max_sleep_count; + u32 max_cqp_compl_wait_time_ms; + u16 max_stat_inst; + u16 max_stat_idx; +}; + +#endif /* IRDMA_H*/ diff --git a/contrib/ofed/libirdma/irdma_defs.h b/contrib/ofed/libirdma/irdma_defs.h new file mode 100644 index 000000000000..8fb9f1e2b622 --- /dev/null +++ b/contrib/ofed/libirdma/irdma_defs.h @@ -0,0 +1,554 @@ +/*- + * SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB + * + * Copyright (c) 2015 - 2021 Intel Corporation + * + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenFabrics.org BSD license below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +/*$FreeBSD$*/ + +#ifndef IRDMA_DEFS_H +#define IRDMA_DEFS_H + +#define IRDMA_BYTE_0 0 +#define IRDMA_BYTE_8 8 +#define IRDMA_BYTE_16 16 +#define IRDMA_BYTE_24 24 +#define IRDMA_BYTE_32 32 +#define IRDMA_BYTE_40 40 +#define IRDMA_BYTE_48 48 +#define IRDMA_BYTE_56 56 +#define IRDMA_BYTE_64 64 +#define IRDMA_BYTE_72 72 +#define IRDMA_BYTE_80 80 +#define IRDMA_BYTE_88 88 +#define IRDMA_BYTE_96 96 +#define IRDMA_BYTE_104 104 +#define IRDMA_BYTE_112 112 +#define IRDMA_BYTE_120 120 +#define IRDMA_BYTE_128 128 +#define IRDMA_BYTE_136 136 +#define IRDMA_BYTE_144 144 +#define IRDMA_BYTE_152 152 +#define IRDMA_BYTE_160 160 +#define IRDMA_BYTE_168 168 +#define IRDMA_BYTE_176 176 +#define IRDMA_BYTE_184 184 +#define IRDMA_BYTE_192 192 +#define IRDMA_BYTE_200 200 +#define IRDMA_BYTE_208 208 +#define IRDMA_BYTE_216 216 + +#define IRDMA_QP_TYPE_IWARP 1 +#define IRDMA_QP_TYPE_UDA 2 +#define IRDMA_QP_TYPE_ROCE_RC 3 +#define IRDMA_QP_TYPE_ROCE_UD 4 + +#define IRDMA_HW_PAGE_SIZE 4096 +#define IRDMA_HW_PAGE_SHIFT 12 +#define IRDMA_CQE_QTYPE_RQ 0 +#define IRDMA_CQE_QTYPE_SQ 1 + +#define IRDMA_QP_SW_MIN_WQSIZE 8u /* in WRs*/ +#define IRDMA_QP_WQE_MIN_SIZE 32 +#define IRDMA_QP_WQE_MAX_SIZE 256 +#define IRDMA_QP_WQE_MIN_QUANTA 1 +#define IRDMA_MAX_RQ_WQE_SHIFT_GEN1 2 +#define IRDMA_MAX_RQ_WQE_SHIFT_GEN2 3 + +#define IRDMA_SQ_RSVD 258 +#define IRDMA_RQ_RSVD 1 + +#define IRDMA_FEATURE_RTS_AE 1ULL +#define IRDMA_FEATURE_CQ_RESIZE 2ULL +#define IRDMA_FEATURE_RELAX_RQ_ORDER 4ULL +#define IRDMAQP_OP_RDMA_WRITE 0x00 +#define IRDMAQP_OP_RDMA_READ 0x01 +#define IRDMAQP_OP_RDMA_SEND 0x03 +#define IRDMAQP_OP_RDMA_SEND_INV 0x04 +#define IRDMAQP_OP_RDMA_SEND_SOL_EVENT 0x05 +#define IRDMAQP_OP_RDMA_SEND_SOL_EVENT_INV 0x06 +#define IRDMAQP_OP_BIND_MW 0x08 +#define IRDMAQP_OP_FAST_REGISTER 0x09 +#define IRDMAQP_OP_LOCAL_INVALIDATE 0x0a +#define IRDMAQP_OP_RDMA_READ_LOC_INV 0x0b +#define IRDMAQP_OP_NOP 0x0c + +#ifndef LS_64_1 +#define LS_64_1(val, bits) ((u64)(uintptr_t)(val) << (bits)) +#define RS_64_1(val, bits) ((u64)(uintptr_t)(val) >> (bits)) +#define LS_32_1(val, bits) ((u32)((val) << (bits))) +#define RS_32_1(val, bits) ((u32)((val) >> (bits))) +#endif +#define LS_64(val, field) (((u64)(val) << field ## _S) & (field ## _M)) +#define RS_64(val, field) ((u64)((val) & field ## _M) >> field ## _S) +#define LS_32(val, field) (((val) << field ## _S) & (field ## _M)) +#define RS_32(val, field) (((val) & field ## _M) >> field ## _S) + +#define IRDMA_CQPHC_QPCTX_S 0 +#define IRDMA_CQPHC_QPCTX_M \ + (0xffffffffffffffffULL << IRDMA_CQPHC_QPCTX_S) + +/* iWARP QP Doorbell shadow area */ +#define IRDMA_QP_DBSA_HW_SQ_TAIL_S 0 +#define IRDMA_QP_DBSA_HW_SQ_TAIL_M \ + (0x7fffULL << IRDMA_QP_DBSA_HW_SQ_TAIL_S) + +/* Completion Queue Doorbell shadow area */ +#define IRDMA_CQ_DBSA_CQEIDX_S 0 +#define IRDMA_CQ_DBSA_CQEIDX_M (0xfffffULL << IRDMA_CQ_DBSA_CQEIDX_S) + +#define IRDMA_CQ_DBSA_SW_CQ_SELECT_S 0 +#define IRDMA_CQ_DBSA_SW_CQ_SELECT_M \ + (0x3fffULL << IRDMA_CQ_DBSA_SW_CQ_SELECT_S) + +#define IRDMA_CQ_DBSA_ARM_NEXT_S 14 +#define IRDMA_CQ_DBSA_ARM_NEXT_M BIT_ULL(IRDMA_CQ_DBSA_ARM_NEXT_S) + +#define IRDMA_CQ_DBSA_ARM_NEXT_SE_S 15 +#define IRDMA_CQ_DBSA_ARM_NEXT_SE_M BIT_ULL(IRDMA_CQ_DBSA_ARM_NEXT_SE_S) + +#define IRDMA_CQ_DBSA_ARM_SEQ_NUM_S 16 +#define IRDMA_CQ_DBSA_ARM_SEQ_NUM_M \ + (0x3ULL << IRDMA_CQ_DBSA_ARM_SEQ_NUM_S) + +/* CQP and iWARP Completion Queue */ +#define IRDMA_CQ_QPCTX_S IRDMA_CQPHC_QPCTX_S +#define IRDMA_CQ_QPCTX_M IRDMA_CQPHC_QPCTX_M + +#define IRDMA_CQ_MINERR_S 0 +#define IRDMA_CQ_MINERR_M (0xffffULL << IRDMA_CQ_MINERR_S) + +#define IRDMA_CQ_MAJERR_S 16 +#define IRDMA_CQ_MAJERR_M (0xffffULL << IRDMA_CQ_MAJERR_S) + +#define IRDMA_CQ_WQEIDX_S 32 +#define IRDMA_CQ_WQEIDX_M (0x7fffULL << IRDMA_CQ_WQEIDX_S) + +#define IRDMA_CQ_EXTCQE_S 50 +#define IRDMA_CQ_EXTCQE_M BIT_ULL(IRDMA_CQ_EXTCQE_S) + +#define IRDMA_OOO_CMPL_S 54 +#define IRDMA_OOO_CMPL_M BIT_ULL(IRDMA_OOO_CMPL_S) + +#define IRDMA_CQ_ERROR_S 55 +#define IRDMA_CQ_ERROR_M BIT_ULL(IRDMA_CQ_ERROR_S) + +#define IRDMA_CQ_SQ_S 62 +#define IRDMA_CQ_SQ_M BIT_ULL(IRDMA_CQ_SQ_S) + +#define IRDMA_CQ_VALID_S 63 +#define IRDMA_CQ_VALID_M BIT_ULL(IRDMA_CQ_VALID_S) + +#define IRDMA_CQ_IMMVALID_S 62 +#define IRDMA_CQ_IMMVALID_M BIT_ULL(IRDMA_CQ_IMMVALID_S) + +#define IRDMA_CQ_UDSMACVALID_S 61 +#define IRDMA_CQ_UDSMACVALID_M BIT_ULL(IRDMA_CQ_UDSMACVALID_S) + +#define IRDMA_CQ_UDVLANVALID_S 60 +#define IRDMA_CQ_UDVLANVALID_M BIT_ULL(IRDMA_CQ_UDVLANVALID_S) + +#define IRDMA_CQ_UDSMAC_S 0 +#define IRDMA_CQ_UDSMAC_M (0xffffffffffffULL << IRDMA_CQ_UDSMAC_S) + +#define IRDMA_CQ_UDVLAN_S 48 +#define IRDMA_CQ_UDVLAN_M (0xffffULL << IRDMA_CQ_UDVLAN_S) + +#define IRDMA_CQ_IMMDATA_S 0 +#define IRDMA_CQ_IMMDATA_M (0xffffffffffffffffULL << IRDMA_CQ_IMMVALID_S) + +#define IRDMA_CQ_IMMDATALOW32_S 0 +#define IRDMA_CQ_IMMDATALOW32_M (0xffffffffULL << IRDMA_CQ_IMMDATALOW32_S) + +#define IRDMA_CQ_IMMDATAUP32_S 32 +#define IRDMA_CQ_IMMDATAUP32_M (0xffffffffULL << IRDMA_CQ_IMMDATAUP32_S) + +#define IRDMACQ_PAYLDLEN_S 0 +#define IRDMACQ_PAYLDLEN_M (0xffffffffULL << IRDMACQ_PAYLDLEN_S) + +#define IRDMACQ_TCPSEQNUMRTT_S 32 +#define IRDMACQ_TCPSEQNUMRTT_M (0xffffffffULL << IRDMACQ_TCPSEQNUMRTT_S) + +#define IRDMACQ_INVSTAG_S 0 +#define IRDMACQ_INVSTAG_M (0xffffffffULL << IRDMACQ_INVSTAG_S) + +#define IRDMACQ_QPID_S 32 +#define IRDMACQ_QPID_M (0xffffffULL << IRDMACQ_QPID_S) + +#define IRDMACQ_UDSRCQPN_S 0 +#define IRDMACQ_UDSRCQPN_M (0xffffffffULL << IRDMACQ_UDSRCQPN_S) + +#define IRDMACQ_PSHDROP_S 51 +#define IRDMACQ_PSHDROP_M BIT_ULL(IRDMACQ_PSHDROP_S) + +#define IRDMACQ_STAG_S 53 +#define IRDMACQ_STAG_M BIT_ULL(IRDMACQ_STAG_S) + *** 42084 LINES SKIPPED *** From nobody Wed Feb 8 00:26:16 2023 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 4PBLQJ4DMYz3p8t9; Wed, 8 Feb 2023 00:26: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 4PBLQJ2Mb4z41YT; Wed, 8 Feb 2023 00: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=1675815976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dO+6fRySOHNjnkHZw2j8NBhrquJt3jVwCoOTiXUrLa0=; b=MCbgSJyYxgt9YK2khhjVNbKWALA5A8DYyT4mwWg5jwTy0czETotC16bP+73HvvRWqv47zY 3PiW5227IQPwnhYuGwdtTCmkieIIAV7lMg1i9BE41Qu9eiAtS/eg0Hghm+JzTj9gMJ0R99 wD79a8STi8gtYDXAUhBvLbedvZ8wynq5xQHGZbCcJNomYs7GUMOP97zek7/mfcqYQlEZYz YJlvI6JAYTiWMvE6X3VaI+ibkOe9DTr8YxDSSf/rNtqMI3BOTSPtI3kRQngKxh2378nQjz q8VVaJpo+FLTHKzFZv0I+4usg2TH5Kpz5q9Tt9gsKEIEBkG4zhijVJCaZGbp8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675815976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dO+6fRySOHNjnkHZw2j8NBhrquJt3jVwCoOTiXUrLa0=; b=a2fbWjIBnWBWUjPVeofj1XmNMLAJn5Td36TpCa+cjBr+EHOdI6XbnD5x9Ry33tpyzEAbck WJ7Ow9k2QAhcQZ/zti47uSSb8lB2e+DLyN6eUq78PYILzgu+ojTk7RjJMDZItycjyKCuk4 3lY1hreP9USA8+Kxn26snPwyXvTVEChCzdYxY1yp9UQQSuEsreGmUkwZqj+rFjhObrvoxd xqA8yFPydIIzVREaVYdVZ5thsC9R3zFkQbjfvz+UzWe4yYTkSr/9y+maryWSan3qVp9WIn pv7oLMw5eG3hGEDYSvc80TmtI57L0vPjFU/JBq1K6mmDmTKTgqTZmEX+ij3nsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675815976; a=rsa-sha256; cv=none; b=lefBCBdw7Ao2N0VKaOQwjetUpIE4dvJGG9H+liH6MlDxtCd0gCnNziMkJVvQHMe/tkDe4Z Kp254bxexz3Js4IJQ/yA4VIjdynse/0wxJkE1S6kwmCYIYBoH4VPrQi819lridsoiA/8yM 6ez0jrZ49S7TkYz6TEKpTnRgnParheVSiuensrnoIh1euhuzw5xJeNIQl0DZJ0LiQLu5Lt Cm9s4azQ9tTXNyfnvtsU0vPgkKhR+uuZxLSr1lXiR/9KChYscKaNKyuGuOUYWVwBNaHpmX diczY5LVZUNbyLTi2etKh217PXULCzS2tD5lNhRDJdW39Sd12FyNniw7xxvP5g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBLQJ1QqRzcV8; Wed, 8 Feb 2023 00:26:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3180QGQU096121; Wed, 8 Feb 2023 00:26:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3180QG2H096120; Wed, 8 Feb 2023 00:26:16 GMT (envelope-from git) Date: Wed, 8 Feb 2023 00:26:16 GMT Message-Id: <202302080026.3180QG2H096120@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: 75b7e4f157e0 - stable/13 - Adjust irdma_prep_for_unregister() definition to avoid clang 15 warning 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: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 75b7e4f157e0ece9a028bb7c43ee9f5727a565a5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=75b7e4f157e0ece9a028bb7c43ee9f5727a565a5 commit 75b7e4f157e0ece9a028bb7c43ee9f5727a565a5 Author: Dimitry Andric AuthorDate: 2022-07-24 21:27:24 +0000 Commit: Eric Joyner CommitDate: 2023-02-08 00:23:49 +0000 Adjust irdma_prep_for_unregister() definition to avoid clang 15 warning With clang 15, the following -Werror warning is produced: sys/dev/irdma/icrdma.c:621:26: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] irdma_prep_for_unregister() ^ void This is because irdma_prep_for_unregister() is declared with a (void) argument list, but defined with an empty argument list. Make the definition match the declaration. (cherry picked from commit ee6c09ac73b5eab848c66e539f8b3293a5abd7f8) --- sys/dev/irdma/icrdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/irdma/icrdma.c b/sys/dev/irdma/icrdma.c index 1bc78dce90aa..c5a42eb863e6 100644 --- a/sys/dev/irdma/icrdma.c +++ b/sys/dev/irdma/icrdma.c @@ -618,7 +618,7 @@ irdma_remove(struct ice_rdma_peer *peer) * irdma_prep_for_unregister - ensure the driver is ready to unregister */ static void -irdma_prep_for_unregister() +irdma_prep_for_unregister(void) { struct irdma_handler *hdl; unsigned long flags; From nobody Wed Feb 8 00:26:17 2023 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 4PBLQL0QVyz3p96w; Wed, 8 Feb 2023 00: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 4PBLQK34yWz41kZ; Wed, 8 Feb 2023 00: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=1675815977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5S6fgN0evi7J102TKqS76qZ7BjZazHmj5b1yZm5vZUM=; b=CdqqQn2FCiw6e/8UgoQI/Qiitb3zyCw+WrWuyzR5o861p4MeQVCwPoitB/mUBZiX8Vv5yZ huvK/nn5TpIJDyWj6d0Ok3VMUjpaLnVDgLq++yG+Lgmokv+PdUznia79Owqz7vqzRUI0xZ AuefCvKKoJNf3oc4ol8xPHOGJnvGcHP1C9xl8nSjw8+3SWfcmPNC5OId25TZ9QQ9EryhRr /ndwvqPrs0I89JMRuWQqxny0ImzBs1Utjmo8j9VH9aPKMTM1pABwhZC8WLhNZTkOunPh3L C0BMbj1y4t7WNkJoyO9nt9vqL95kmQZ8AcEytvBjCIyEgl/TEoLyANQg5zJtaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675815977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5S6fgN0evi7J102TKqS76qZ7BjZazHmj5b1yZm5vZUM=; b=ytMkTtIzYdehDBBTsJea36oJ3Qcwfglb/kcb+h87FglwaZgMUH7R/5jW/h2wSSpTo68t5w zZA8ETMPyW07mJ9IdwYcMOwQ+exVy97sYmVW64BzKeHW0iajfHoFUab/4Oozix9pAke3P4 sds3oxdY8kd2N0N12lrr9BCxyUjP4xYHPkTtSnj6CuqhMGTuAcqeHRnr3codrEIJoitL6F b4oR6Md5d3NwsfoaatuKd0zbsLxdNhm/w4ZV3Qnx7CKtJVPwue7f8G59fl3PWl6Dz7IPKR g8DsDEq3D+qUAVUuPR1Xx8YNKIUtdUy16Nc0km357ALs/KB6Pwrhf+w0vGhxTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675815977; a=rsa-sha256; cv=none; b=m335XMcXZTawGreCFPNFc1i5ig863d/Bpggr1GXHpPVaQXMen9ejWb4jG8czSX8gjmtEfR PNs8c6/ZBjC/zwXYZZk8HuQRV4H5Sg46speQIvnKvQmTW2C7JwcDsBkxIJik7vsncKPITr nQ0g02azGo9O7BgaCNqyMbCFj34jf9MUGBIDwhjgEN9RxiY/OPYmGECi0nhWzq18DTFz0G 7gGDisif29iw6S1qC6qZeszPbi6eCmP88MmXFhSffQcL3PrHMFONDbqnuHWMHsHbd38l1u ZasXIwyXzf2K0RfJ1NUISPknBEiBIzMBG+azrc8lQn7ozhEqqhpv7PknJTn1HA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBLQK29tYzcdn; Wed, 8 Feb 2023 00:26:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3180QHLX096152; Wed, 8 Feb 2023 00:26:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3180QHq8096151; Wed, 8 Feb 2023 00:26:17 GMT (envelope-from git) Date: Wed, 8 Feb 2023 00:26:17 GMT Message-Id: <202302080026.3180QHq8096151@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: 3b65af50fc2a - stable/13 - ibcore: The use of IN_LOOPBACK() now requires a valid VNET context. 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: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3b65af50fc2aefbb5950cc48af0de6753be69762 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=3b65af50fc2aefbb5950cc48af0de6753be69762 commit 3b65af50fc2aefbb5950cc48af0de6753be69762 Author: Hans Petter Selasky AuthorDate: 2022-08-31 10:37:28 +0000 Commit: Eric Joyner CommitDate: 2023-02-08 00:23:56 +0000 ibcore: The use of IN_LOOPBACK() now requires a valid VNET context. Make sure the VNET is set before using this macro. Fixes: efe58855f3ea2cfc24cb705aabce3bc0fe1fb6d5 PR: 266054 Sponsored by: NVIDIA Networking (cherry picked from commit f50274674ebf3a51a77708f569d38a238cbad6ec) --- sys/dev/irdma/fbsd_kcompat.c | 4 +- sys/dev/irdma/irdma_cm.c | 15 ++++-- sys/dev/irdma/irdma_cm.h | 2 +- sys/dev/irdma/irdma_kcompat.c | 9 ++-- sys/ofed/drivers/infiniband/core/ib_cma.c | 81 ++++++++++++++++++++----------- 5 files changed, 76 insertions(+), 35 deletions(-) diff --git a/sys/dev/irdma/fbsd_kcompat.c b/sys/dev/irdma/fbsd_kcompat.c index 2f6b350ac5b0..cc6dd5c947ae 100644 --- a/sys/dev/irdma/fbsd_kcompat.c +++ b/sys/dev/irdma/fbsd_kcompat.c @@ -467,11 +467,13 @@ int irdma_resolve_neigh_lpb_chk(struct irdma_device *iwdev, struct irdma_cm_node *cm_node, struct irdma_cm_info *cm_info) { + struct rdma_cm_id *rdma_id = (struct rdma_cm_id *)cm_node->cm_id->context; + struct vnet *vnet = rdma_id->route.addr.dev_addr.net; int arpindex; int oldarpindex; if ((cm_node->ipv4 && - irdma_ipv4_is_lpb(cm_node->loc_addr[0], cm_node->rem_addr[0])) || + irdma_ipv4_is_lpb(vnet, cm_node->loc_addr[0], cm_node->rem_addr[0])) || (!cm_node->ipv4 && irdma_ipv6_is_lpb(cm_node->loc_addr, cm_node->rem_addr))) { cm_node->do_lpb = true; diff --git a/sys/dev/irdma/irdma_cm.c b/sys/dev/irdma/irdma_cm.c index e107903efe4d..410774226e78 100644 --- a/sys/dev/irdma/irdma_cm.c +++ b/sys/dev/irdma/irdma_cm.c @@ -2055,9 +2055,15 @@ irdma_add_hte_node(struct irdma_cm_core *cm_core, * @rem_addr: remote address */ bool -irdma_ipv4_is_lpb(u32 loc_addr, u32 rem_addr) +irdma_ipv4_is_lpb(struct vnet *vnet, u32 loc_addr, u32 rem_addr) { - return ipv4_is_loopback(htonl(rem_addr)) || (loc_addr == rem_addr); + bool ret; + + CURVNET_SET_QUIET(vnet); + ret = ipv4_is_loopback(htonl(rem_addr)) || (loc_addr == rem_addr); + CURVNET_RESTORE(); + + return (ret); } /** @@ -2083,6 +2089,8 @@ irdma_ipv6_is_lpb(u32 *loc_addr, u32 *rem_addr) static int irdma_cm_create_ah(struct irdma_cm_node *cm_node, bool wait) { + struct rdma_cm_id *rdma_id = (struct rdma_cm_id *)cm_node->cm_id->context; + struct vnet *vnet = rdma_id->route.addr.dev_addr.net; struct irdma_ah_info ah_info = {0}; struct irdma_device *iwdev = cm_node->iwdev; @@ -2096,7 +2104,8 @@ irdma_cm_create_ah(struct irdma_cm_node *cm_node, bool wait) ah_info.ipv4_valid = true; ah_info.dest_ip_addr[0] = cm_node->rem_addr[0]; ah_info.src_ip_addr[0] = cm_node->loc_addr[0]; - ah_info.do_lpbk = irdma_ipv4_is_lpb(ah_info.src_ip_addr[0], + ah_info.do_lpbk = irdma_ipv4_is_lpb(vnet, + ah_info.src_ip_addr[0], ah_info.dest_ip_addr[0]); } else { memcpy(ah_info.dest_ip_addr, cm_node->rem_addr, diff --git a/sys/dev/irdma/irdma_cm.h b/sys/dev/irdma/irdma_cm.h index e66db15a6fff..d3d55977cf3c 100644 --- a/sys/dev/irdma/irdma_cm.h +++ b/sys/dev/irdma/irdma_cm.h @@ -441,7 +441,7 @@ void irdma_cm_teardown_connections(struct irdma_device *iwdev, u32 *ipaddr, bool disconnect_all); int irdma_cm_start(struct irdma_device *dev); int irdma_cm_stop(struct irdma_device *dev); -bool irdma_ipv4_is_lpb(u32 loc_addr, u32 rem_addr); +bool irdma_ipv4_is_lpb(struct vnet *, u32 loc_addr, u32 rem_addr); bool irdma_ipv6_is_lpb(u32 *loc_addr, u32 *rem_addr); int irdma_arp_table(struct irdma_pci_f *rf, u32 *ip_addr, u8 *mac_addr, u32 action); diff --git a/sys/dev/irdma/irdma_kcompat.c b/sys/dev/irdma/irdma_kcompat.c index beff04f7dc6c..3d88187cb9ae 100644 --- a/sys/dev/irdma/irdma_kcompat.c +++ b/sys/dev/irdma/irdma_kcompat.c @@ -284,7 +284,8 @@ irdma_dealloc_pd(struct ib_pd *ibpd, struct ib_udata *udata) } static void -irdma_fill_ah_info(struct irdma_ah_info *ah_info, +irdma_fill_ah_info(struct vnet *vnet, + struct irdma_ah_info *ah_info, const struct ib_gid_attr *sgid_attr, struct sockaddr *sgid_addr, struct sockaddr *dgid_addr, u8 *dmac, u8 net_type) @@ -295,7 +296,8 @@ irdma_fill_ah_info(struct irdma_ah_info *ah_info, ntohl(((struct sockaddr_in *)dgid_addr)->sin_addr.s_addr); ah_info->src_ip_addr[0] = ntohl(((struct sockaddr_in *)sgid_addr)->sin_addr.s_addr); - ah_info->do_lpbk = irdma_ipv4_is_lpb(ah_info->src_ip_addr[0], + ah_info->do_lpbk = irdma_ipv4_is_lpb(vnet, + ah_info->src_ip_addr[0], ah_info->dest_ip_addr[0]); if (ipv4_is_multicast(((struct sockaddr_in *)dgid_addr)->sin_addr.s_addr)) { irdma_mcast_mac_v4(ah_info->dest_ip_addr, dmac); @@ -440,7 +442,8 @@ irdma_create_ah(struct ib_ah *ib_ah, ether_addr_copy(dmac, attr->dmac); - irdma_fill_ah_info(ah_info, &sgid_attr, &sgid_addr.saddr, &dgid_addr.saddr, + irdma_fill_ah_info(iwdev->netdev->if_vnet, + ah_info, &sgid_attr, &sgid_addr.saddr, &dgid_addr.saddr, dmac, ah->av.net_type); err = irdma_create_ah_vlan_tag(iwdev, ah_info, &sgid_attr, dmac); diff --git a/sys/ofed/drivers/infiniband/core/ib_cma.c b/sys/ofed/drivers/infiniband/core/ib_cma.c index 586524ac88bb..181f5f2cff1e 100644 --- a/sys/ofed/drivers/infiniband/core/ib_cma.c +++ b/sys/ofed/drivers/infiniband/core/ib_cma.c @@ -1059,9 +1059,15 @@ static inline int cma_loopback_addr(struct sockaddr *addr) } } -static inline int cma_any_addr(struct sockaddr *addr) +static inline bool cma_any_addr(struct vnet *vnet, struct sockaddr *addr) { - return cma_zero_addr(addr) || cma_loopback_addr(addr); + bool ret; + + CURVNET_SET_QUIET(vnet); + ret = cma_zero_addr(addr) || cma_loopback_addr(addr); + CURVNET_RESTORE(); + + return (ret); } static int cma_addr_cmp(struct sockaddr *src, struct sockaddr *dst) @@ -1364,6 +1370,21 @@ static int cma_save_req_info(const struct ib_cm_event *ib_event, return 0; } +#ifdef INET +static bool validate_ipv4_net_dev_addr(struct vnet *vnet, + const __be32 saddr, const __be32 daddr) +{ + bool ret; + CURVNET_SET(vnet); + ret = ipv4_is_multicast(saddr) || ipv4_is_lbcast(saddr) || + ipv4_is_lbcast(daddr) || ipv4_is_zeronet(saddr) || + ipv4_is_zeronet(daddr) || ipv4_is_loopback(daddr) || + ipv4_is_loopback(saddr); + CURVNET_RESTORE(); + return (ret); +} +#endif + static bool validate_ipv4_net_dev(struct ifnet *net_dev, const struct sockaddr_in *dst_addr, const struct sockaddr_in *src_addr) @@ -1375,10 +1396,7 @@ static bool validate_ipv4_net_dev(struct ifnet *net_dev, struct nhop_object *nh; bool ret; - if (ipv4_is_multicast(saddr) || ipv4_is_lbcast(saddr) || - ipv4_is_lbcast(daddr) || ipv4_is_zeronet(saddr) || - ipv4_is_zeronet(daddr) || ipv4_is_loopback(daddr) || - ipv4_is_loopback(saddr)) + if (validate_ipv4_net_dev_addr(net_dev->if_vnet, saddr, daddr)) return false; dst_dev = ip_ifp_find(net_dev->if_vnet, daddr); @@ -1554,13 +1572,14 @@ static bool sdp_match_private_data(struct rdma_id_private *id_priv, { __be32 ip4_addr; struct in6_addr ip6_addr; + struct vnet *vnet = id_priv->id.route.addr.dev_addr.net; switch (addr->sa_family) { case AF_INET: ip4_addr = ((struct sockaddr_in *)addr)->sin_addr.s_addr; if (sdp_get_ip_ver(hdr) != 4) return false; - if (!cma_any_addr(addr) && + if (!cma_any_addr(vnet, addr) && hdr->dst_addr.ip4.addr != ip4_addr) return false; break; @@ -1569,7 +1588,7 @@ static bool sdp_match_private_data(struct rdma_id_private *id_priv, if (sdp_get_ip_ver(hdr) != 6) return false; cma_ip6_clear_scope_id(&ip6_addr); - if (!cma_any_addr(addr) && + if (!cma_any_addr(vnet, addr) && memcmp(&hdr->dst_addr.ip6, &ip6_addr, sizeof(ip6_addr))) return false; break; @@ -1587,10 +1606,11 @@ static bool cma_match_private_data(struct rdma_id_private *id_priv, { const struct cma_hdr *hdr = vhdr; struct sockaddr *addr = cma_src_addr(id_priv); + struct vnet *vnet = id_priv->id.route.addr.dev_addr.net; __be32 ip4_addr; struct in6_addr ip6_addr; - if (cma_any_addr(addr) && !id_priv->afonly) + if (cma_any_addr(vnet, addr) && !id_priv->afonly) return true; if (id_priv->id.ps == RDMA_PS_SDP) @@ -1601,7 +1621,7 @@ static bool cma_match_private_data(struct rdma_id_private *id_priv, ip4_addr = ((struct sockaddr_in *)addr)->sin_addr.s_addr; if (cma_get_ip_ver(hdr) != 4) return false; - if (!cma_any_addr(addr) && + if (!cma_any_addr(vnet, addr) && hdr->dst_addr.ip4.addr != ip4_addr) return false; break; @@ -1610,7 +1630,7 @@ static bool cma_match_private_data(struct rdma_id_private *id_priv, if (cma_get_ip_ver(hdr) != 6) return false; cma_ip6_clear_scope_id(&ip6_addr); - if (!cma_any_addr(addr) && + if (!cma_any_addr(vnet, addr) && memcmp(&hdr->dst_addr.ip6, &ip6_addr, sizeof(ip6_addr))) return false; break; @@ -1782,6 +1802,8 @@ static void cma_cancel_listens(struct rdma_id_private *id_priv) static void cma_cancel_operation(struct rdma_id_private *id_priv, enum rdma_cm_state state) { + struct vnet *vnet = id_priv->id.route.addr.dev_addr.net; + switch (state) { case RDMA_CM_ADDR_QUERY: rdma_addr_cancel(&id_priv->id.route.addr.dev_addr); @@ -1790,7 +1812,7 @@ static void cma_cancel_operation(struct rdma_id_private *id_priv, cma_cancel_route(id_priv); break; case RDMA_CM_LISTEN: - if (cma_any_addr(cma_src_addr(id_priv)) && !id_priv->cma_dev) + if (cma_any_addr(vnet, cma_src_addr(id_priv)) && !id_priv->cma_dev) cma_cancel_listens(id_priv); break; default: @@ -2028,9 +2050,10 @@ static struct rdma_id_private *cma_new_conn_id(struct rdma_cm_id *listen_id, const sa_family_t ss_family = listen_id->route.addr.src_addr.ss_family; const __be64 service_id = ib_event->param.req_rcvd.primary_path->service_id; + struct vnet *vnet = listen_id->route.addr.dev_addr.net; int ret; - id = rdma_create_id(listen_id->route.addr.dev_addr.net, + id = rdma_create_id(vnet, listen_id->event_handler, listen_id->context, listen_id->ps, ib_event->param.req_rcvd.qp_type); if (IS_ERR(id)) @@ -2059,11 +2082,11 @@ static struct rdma_id_private *cma_new_conn_id(struct rdma_cm_id *listen_id, goto err; } else { if (!cma_protocol_roce(listen_id) && - cma_any_addr(cma_src_addr(id_priv))) { + cma_any_addr(vnet, cma_src_addr(id_priv))) { rt->addr.dev_addr.dev_type = ARPHRD_INFINIBAND; rdma_addr_set_sgid(&rt->addr.dev_addr, &rt->path_rec[0].sgid); ib_addr_set_pkey(&rt->addr.dev_addr, be16_to_cpu(rt->path_rec[0].pkey)); - } else if (!cma_any_addr(cma_src_addr(id_priv))) { + } else if (!cma_any_addr(vnet, cma_src_addr(id_priv))) { ret = cma_translate_addr(cma_src_addr(id_priv), &rt->addr.dev_addr); if (ret) goto err; @@ -2086,10 +2109,10 @@ static struct rdma_id_private *cma_new_udp_id(struct rdma_cm_id *listen_id, struct rdma_id_private *id_priv; struct rdma_cm_id *id; const sa_family_t ss_family = listen_id->route.addr.src_addr.ss_family; - struct vnet *net = listen_id->route.addr.dev_addr.net; + struct vnet *vnet = listen_id->route.addr.dev_addr.net; int ret; - id = rdma_create_id(net, listen_id->event_handler, listen_id->context, + id = rdma_create_id(vnet, listen_id->event_handler, listen_id->context, listen_id->ps, IB_QPT_UD); if (IS_ERR(id)) return NULL; @@ -2106,7 +2129,7 @@ static struct rdma_id_private *cma_new_udp_id(struct rdma_cm_id *listen_id, if (ret) goto err; } else { - if (!cma_any_addr(cma_src_addr(id_priv))) { + if (!cma_any_addr(vnet, cma_src_addr(id_priv))) { ret = cma_translate_addr(cma_src_addr(id_priv), &id->route.addr.dev_addr); if (ret) @@ -3042,6 +3065,7 @@ int rdma_resolve_addr(struct rdma_cm_id *id, struct sockaddr *src_addr, struct sockaddr *dst_addr, int timeout_ms) { struct rdma_id_private *id_priv; + struct vnet *vnet = id->route.addr.dev_addr.net; int ret; id_priv = container_of(id, struct rdma_id_private, id); @@ -3059,7 +3083,7 @@ int rdma_resolve_addr(struct rdma_cm_id *id, struct sockaddr *src_addr, atomic_inc(&id_priv->refcount); memcpy(cma_dst_addr(id_priv), dst_addr, rdma_addr_size(dst_addr)); - if (cma_any_addr(dst_addr)) { + if (cma_any_addr(vnet, dst_addr)) { ret = cma_resolve_loopback(id_priv); } else { if (dst_addr->sa_family == AF_IB) { @@ -3224,6 +3248,7 @@ static int cma_check_port(struct rdma_bind_list *bind_list, { struct rdma_id_private *cur_id; struct sockaddr *addr, *cur_addr; + struct vnet *vnet; addr = cma_src_addr(id_priv); hlist_for_each_entry(cur_id, &bind_list->owners, node) { @@ -3239,7 +3264,8 @@ static int cma_check_port(struct rdma_bind_list *bind_list, (addr->sa_family != cur_addr->sa_family)) continue; - if (cma_any_addr(addr) || cma_any_addr(cur_addr)) + vnet = cur_id->id.route.addr.dev_addr.net; + if (cma_any_addr(vnet, addr) || cma_any_addr(vnet, cur_addr)) return -EADDRNOTAVAIL; if (!cma_addr_cmp(addr, cur_addr)) @@ -3430,6 +3456,7 @@ EXPORT_SYMBOL(rdma_listen); int rdma_bind_addr(struct rdma_cm_id *id, struct sockaddr *addr) { struct rdma_id_private *id_priv; + struct vnet *vnet = id->route.addr.dev_addr.net; int ret; if (addr->sa_family != AF_INET && addr->sa_family != AF_INET6 && @@ -3445,7 +3472,7 @@ int rdma_bind_addr(struct rdma_cm_id *id, struct sockaddr *addr) goto err1; memcpy(cma_src_addr(id_priv), addr, rdma_addr_size(addr)); - if (!cma_any_addr(addr)) { + if (!cma_any_addr(vnet, addr)) { ret = cma_translate_addr(addr, &id->route.addr.dev_addr); if (ret) goto err1; @@ -3460,7 +3487,7 @@ int rdma_bind_addr(struct rdma_cm_id *id, struct sockaddr *addr) id_priv->afonly = 1; #ifdef INET6 else if (addr->sa_family == AF_INET6) { - CURVNET_SET_QUIET(id_priv->id.route.addr.dev_addr.net); + CURVNET_SET_QUIET(vnet); id_priv->afonly = V_ip6_v6only; CURVNET_RESTORE(); } @@ -4088,7 +4115,7 @@ static void cma_set_mgid(struct rdma_id_private *id_priv, struct sockaddr_in *sin = (struct sockaddr_in *) addr; struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) addr; - if (cma_any_addr(addr)) { + if (cma_any_addr(dev_addr->net, addr)) { memset(mgid, 0, sizeof *mgid); } else if ((addr->sa_family == AF_INET6) && ((be32_to_cpu(sin6->sin6_addr.s6_addr32[0]) & 0xFFF0FFFF) == @@ -4236,13 +4263,13 @@ static void iboe_mcast_work_handler(struct work_struct *work) kfree(mw); } -static void cma_iboe_set_mgid(struct sockaddr *addr, union ib_gid *mgid, - enum ib_gid_type gid_type) +static void cma_iboe_set_mgid(struct vnet *vnet, struct sockaddr *addr, + union ib_gid *mgid, enum ib_gid_type gid_type) { struct sockaddr_in *sin = (struct sockaddr_in *)addr; struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)addr; - if (cma_any_addr(addr)) { + if (cma_any_addr(vnet, addr)) { memset(mgid, 0, sizeof *mgid); } else if (addr->sa_family == AF_INET6) { memcpy(mgid, &sin6->sin6_addr, sizeof *mgid); @@ -4293,7 +4320,7 @@ static int cma_iboe_join_multicast(struct rdma_id_private *id_priv, gid_type = id_priv->cma_dev->default_gid_type[id_priv->id.port_num - rdma_start_port(id_priv->cma_dev->device)]; - cma_iboe_set_mgid(addr, &mc->multicast.ib->rec.mgid, gid_type); + cma_iboe_set_mgid(dev_addr->net, addr, &mc->multicast.ib->rec.mgid, gid_type); mc->multicast.ib->rec.pkey = cpu_to_be16(0xffff); if (id_priv->id.ps == RDMA_PS_UDP) From nobody Wed Feb 8 00:26:18 2023 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 4PBLQL5C99z3p970; Wed, 8 Feb 2023 00: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 4PBLQL4PQXz41ZC; Wed, 8 Feb 2023 00:26:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675815978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cd/RU3Wusx/J4GguSPWhO5mFdz2VTfRYDVg3hD/rTZw=; b=y28Jla3iKsSi4bv5+CsV9zAq2A8FtoYFUgH7DQhBE8YSK6vo0cwmA2g8hy99eE8c1oc+i5 W/OKe1iFffpHlpF5Qgwx7Kk/rJ5dafBTkA/3be2pzA2P0yuiCtbnOOlMs6EEP227pVPP55 P9cnNaM/Vwk4Fu7FZrbTc+DBlrUCVClswyA7R8eSy39mFufORQcM8Nz1j60c9Q/igZ7lno B3VICiaOm/Wdj77KmhiObQDdbSbc0eofmsQ7UVE4VuGFpSRCENwExWZLyVbVd5F5agatlX TRNLoVQBRdHQtbYIpuMD6OeymwThArzeo3lr5ieAxNBqeIlRDVLIrZCAbL1kig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675815978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cd/RU3Wusx/J4GguSPWhO5mFdz2VTfRYDVg3hD/rTZw=; b=cnYahEei9lz3GrbeFWQ4tQeM7hg90MAV88CAUyg9KUX8jOfH2NoKmoU+uwhHduCjbgu21u CnTX59BUouQ0FE1uQLrzd8MqucNaix+SkBotSe9wIRa2Lmgki3OqVbunDLNu9wRJ1CMxtx HeKyBoTWrgAtzCGAiNueKCzBLRqeau+85nCkIjY2lH5NXqCs66cQiKIp5qjBrmc7UfVMWF AojiL1htpelb1/CSgiFf+IWyYCzUhFw0m/kfLbhqm+dZlP5CVLodtN5badH6dFuZMFomEF LWHXFJHa7vl+CoGKeFQvliTpiJIX61a35UStIokOcS4rkKu+J3pY89rs9IbG4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675815978; a=rsa-sha256; cv=none; b=qYlJ0Q03uOmgqLKLSC0UfhU/TFF1OPyZNpWjn1Xhyk7q77jynpplWl6EObDgvqKpRLdgjt rYnnrKvqCHrlSeWqRJzFHrA5xtDaMD485YxbQfGnHyr6jJweRQgSgFzsSE2WVjG8GX9OCv KLdh7j9vkucWbwP+o739QuN0ngomq5zc6cyawwBhFuoNH9bXIDyaiKSX0MavHbDSDjjUod tnUEP1C17KChCHsNxgwL25ii95d4tDzQfRDPeex22/1jAQ7U/IHgzz+jrcypLtrKW8PRN3 fG2IA/LQdLk7cLzQp+ktj48AgAwe1MlZj7i2tXlFWfN4E5Eo3QJkvYorUABsjQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBLQL2qTYzckL; Wed, 8 Feb 2023 00:26:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3180QIuW096176; Wed, 8 Feb 2023 00:26:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3180QIJd096175; Wed, 8 Feb 2023 00:26:18 GMT (envelope-from git) Date: Wed, 8 Feb 2023 00:26:18 GMT Message-Id: <202302080026.3180QIJd096175@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: e894da6d9a1d - stable/13 - irdma(4): hide tasklet-related definitions to avoid redefines 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: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e894da6d9a1d3a96bdac5f330c3c94d75be8f83b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=e894da6d9a1d3a96bdac5f330c3c94d75be8f83b commit e894da6d9a1d3a96bdac5f330c3c94d75be8f83b Author: Bartosz Sobczak AuthorDate: 2023-01-23 10:17:53 +0000 Commit: Eric Joyner CommitDate: 2023-02-08 00:24:01 +0000 irdma(4): hide tasklet-related definitions to avoid redefines checking if either from_tasklet or tasklet_setup exists before defining irdma's own version. This is a result of changes introduced in: f2978460c7fd ("LinuxKPI: tasklet add (*callback) support", 2022-11-08) The code should be kept until the from_timer and tasklet_setup is defined in linuxkpi's interrupt.h This is a direct commit to the stable/13 branch. Signed-off-by: Bartosz Sobczak Signed-off-by: Eric Joyner --- sys/dev/irdma/fbsd_kcompat.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/irdma/fbsd_kcompat.h b/sys/dev/irdma/fbsd_kcompat.h index 179229d6be03..60be5e74d91d 100644 --- a/sys/dev/irdma/fbsd_kcompat.h +++ b/sys/dev/irdma/fbsd_kcompat.h @@ -40,12 +40,15 @@ #define TASKLET_DATA_TYPE unsigned long #define TASKLET_FUNC_TYPE void (*)(TASKLET_DATA_TYPE) +#ifndef tasklet_setup #define tasklet_setup(tasklet, callback) \ tasklet_init((tasklet), (TASKLET_FUNC_TYPE)(callback), \ (TASKLET_DATA_TYPE)(tasklet)) - +#endif +#ifndef from_tasklet #define from_tasklet(var, callback_tasklet, tasklet_fieldname) \ container_of(callback_tasklet, typeof(*var), tasklet_fieldname) +#endif #define IRDMA_SET_RDMA_OBJ_SIZE(ib_struct, drv_struct, member) \ (sizeof(struct drv_struct) + \ From nobody Wed Feb 8 00:26:19 2023 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 4PBLQN0smwz3p904; Wed, 8 Feb 2023 00:26:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PBLQM6dPgz41tD; Wed, 8 Feb 2023 00:26:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675815980; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I6weHqe8Q45Z+C+CppmbN30rOULiYZv9xyH07i9E4Dk=; b=tsbYisNfkfdYpfSBc9ojlbb9lt79xvkq/GCaDPnnptLVci7IMrg3m6LatagLkj46rjkM0T Eh2S7mZYcl2suH0UZgR9saUeBVjdLVv57ojWGzgABt9ARNB7ulqYkKWYTq54LXqEDZ+fXk YqWk2veJftLv5aSyDoK9xXcGOv9bjhrzn9X7zbMPTxTi70zZIRa8CY0DKsJAksyv55foSO qmfA2NWYYq1zLrvGxY0Rj2E83AVbqqDN4COZKE3S4Wt+2bPv1cjAogWlX7UOygbLFer67W Qu+E4sqMqXNinTu+7WXylG5m7F4/eUiVCwkUyso573Rkm7ymqIEvYNvE2wE8mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675815980; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I6weHqe8Q45Z+C+CppmbN30rOULiYZv9xyH07i9E4Dk=; b=F1p01Ob/4ZItnYCaRDVCghu5SImor6Htb+4u+PovnGErkKK8O0ELwuoYkEeFv3ceXMiRAj 3QOFEW5H6et0GtqwsjQmL5lQ4dGEqPhP4Uu/rHa+SWrTWIJ2VPMI4MfSTTy8E9eCxtirbE 2A8stAK1JdgHfA5Lik8n39+36dyhWtcbXYeyrn4q0CDbE3gD/HjkFdxSN+4c+Qlw5VUOQc YQwlMJDnZyMlm44QqqEfH/EW4+guCfooa8vzkSViq7kA86M2ejRz72wM4SCoPeyIywPM9X trK1sog9AbPYYgLczcNWb8PyMnHrR7+Rpc5dch4hGFpLKGtHdqe8eCES/ZFMRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675815980; a=rsa-sha256; cv=none; b=lJ+EdzuBwS/s7Tf1uK9n1x1yeZE5h/jlB1fUCiDNiotgro8k1GRzC/d51cJMOROj9plyOy DjyDtSGsoxI716SdJlfD8J+k1TDf30SbUOXyM3PHmVt+XTTPNmv7dB71dP2rJgUk+vtDxU QFBHd2wMW2c4eXTTjEz0QA7ZgVeHZ+sLYaZnavpRzsHOtlBzCuncud4aWWiQFoON7o5nHI aWAFhw20WldgU1jL1jJj8sdAf3aWQQfpRYZUOhCp6/hPTMYjC2lqGBw4YWk4trcTCOjBvu uq89NngBC1EXFrAKlXyHnTKj/eluymL8v3oFexNu5ZHn+BTTju/SqSFY2hCNFg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBLQM4nQpzcv7; Wed, 8 Feb 2023 00:26:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3180QJCT096200; Wed, 8 Feb 2023 00:26:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3180QJOJ096199; Wed, 8 Feb 2023 00:26:19 GMT (envelope-from git) Date: Wed, 8 Feb 2023 00:26:19 GMT Message-Id: <202302080026.3180QJOJ096199@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: c051c1ff703c - stable/13 - irdma(4): Upgrade driver to 1.1.5-k 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: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c051c1ff703cf279c80490c143a99bec0ce98e7f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=c051c1ff703cf279c80490c143a99bec0ce98e7f commit c051c1ff703cf279c80490c143a99bec0ce98e7f Author: Bartosz Sobczak AuthorDate: 2022-12-22 01:10:15 +0000 Commit: Eric Joyner CommitDate: 2023-02-08 00:24:06 +0000 irdma(4): Upgrade driver to 1.1.5-k This is to upgrade current irdma driver version (in support of RDMA on Intel(R) Ethernet Controller E810) to 1.1.5-k change summary: - refactor defines for hardware registers - rereg_mr verb added in libirdma - fix print warning during compilation - rt_ros2priority macro fix - irdma.4 validated with mandoc - fixing nd6_resolve usage - added libirdma_query_device - sysctl for irdma version - aeq_alloc_db fix - dwork_flush protected with qp refcount - PFC fixes Signed-off-by: Eric Joyner Reviewed by: erj@ Relnotes: yes Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D36944 (cherry picked from commit 777e472cd86b9394d07bf96c19dbafc2e1ff4fdc) --- contrib/ofed/libirdma/abi.h | 10 +- contrib/ofed/libirdma/i40iw_hw.h | 4 +- contrib/ofed/libirdma/irdma.h | 18 +- contrib/ofed/libirdma/irdma_defs.h | 259 ++---- contrib/ofed/libirdma/irdma_uk.c | 774 +++++++++------- contrib/ofed/libirdma/irdma_umain.c | 28 +- contrib/ofed/libirdma/irdma_umain.h | 30 +- contrib/ofed/libirdma/irdma_uquery.h | 50 + contrib/ofed/libirdma/irdma_user.h | 227 ++++- contrib/ofed/libirdma/irdma_uverbs.c | 377 ++++---- contrib/ofed/libirdma/libirdma.map | 8 +- contrib/ofed/libirdma/osdep.h | 17 +- share/man/man4/irdma.4 | 168 ++-- sys/dev/irdma/fbsd_kcompat.c | 17 +- sys/dev/irdma/fbsd_kcompat.h | 19 +- sys/dev/irdma/icrdma.c | 7 +- sys/dev/irdma/icrdma_hw.c | 39 +- sys/dev/irdma/icrdma_hw.h | 35 +- sys/dev/irdma/irdma-abi.h | 2 +- sys/dev/irdma/irdma.h | 158 ++-- sys/dev/irdma/irdma_cm.c | 110 +-- sys/dev/irdma/irdma_cm.h | 22 +- sys/dev/irdma/irdma_ctrl.c | 1330 +++++++++++++-------------- sys/dev/irdma/irdma_defs.h | 1678 ++++++++++------------------------ sys/dev/irdma/irdma_hmc.c | 33 +- sys/dev/irdma/irdma_hmc.h | 12 +- sys/dev/irdma/irdma_hw.c | 205 ++--- sys/dev/irdma/irdma_kcompat.c | 348 ++++--- sys/dev/irdma/irdma_main.h | 23 +- sys/dev/irdma/irdma_pble.c | 4 +- sys/dev/irdma/irdma_protos.h | 13 +- sys/dev/irdma/irdma_puda.c | 146 +-- sys/dev/irdma/irdma_type.h | 99 +- sys/dev/irdma/irdma_uda.c | 79 +- sys/dev/irdma/irdma_uda_d.h | 361 ++------ sys/dev/irdma/irdma_uk.c | 766 +++++++++------- sys/dev/irdma/irdma_user.h | 227 ++++- sys/dev/irdma/irdma_utils.c | 160 +++- sys/dev/irdma/irdma_verbs.c | 706 +++++++++----- sys/dev/irdma/irdma_verbs.h | 27 +- sys/dev/irdma/irdma_ws.c | 4 +- sys/dev/irdma/osdep.h | 6 +- 42 files changed, 4321 insertions(+), 4285 deletions(-) diff --git a/contrib/ofed/libirdma/abi.h b/contrib/ofed/libirdma/abi.h index ff7a2828efe0..e45a7b49caf8 100644 --- a/contrib/ofed/libirdma/abi.h +++ b/contrib/ofed/libirdma/abi.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB * - * Copyright (C) 2019 - 2020 Intel Corporation + * Copyright (C) 2019 - 2022 Intel Corporation * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -145,6 +145,14 @@ struct irdma_ureg_mr { __u16 rq_pages; __u16 sq_pages; +}; +struct irdma_urereg_mr { + struct ibv_rereg_mr ibv_cmd; + __u16 reg_type; /* enum irdma_memreg_type */ + __u16 cq_pages; + __u16 rq_pages; + __u16 sq_pages; + }; struct irdma_ucreate_ah_resp { struct ibv_create_ah_resp ibv_resp; diff --git a/contrib/ofed/libirdma/i40iw_hw.h b/contrib/ofed/libirdma/i40iw_hw.h index 38c7e37c35c9..c51d89a0fcb2 100644 --- a/contrib/ofed/libirdma/i40iw_hw.h +++ b/contrib/ofed/libirdma/i40iw_hw.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB * - * Copyright (c) 2015 - 2020 Intel Corporation + * Copyright (c) 2015 - 2022 Intel Corporation * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -50,11 +50,11 @@ enum i40iw_device_caps_const { I40IW_MAX_CQ_SIZE = 1048575, I40IW_MAX_OUTBOUND_MSG_SIZE = 2147483647, I40IW_MAX_INBOUND_MSG_SIZE = 2147483647, + I40IW_MIN_WQ_SIZE = 4 /* WQEs */, }; #define I40IW_QP_WQE_MIN_SIZE 32 #define I40IW_QP_WQE_MAX_SIZE 128 -#define I40IW_QP_SW_MIN_WQSIZE 4 #define I40IW_MAX_RQ_WQE_SHIFT 2 #define I40IW_MAX_QUANTA_PER_WR 2 diff --git a/contrib/ofed/libirdma/irdma.h b/contrib/ofed/libirdma/irdma.h index 27fa3d53d3e8..1dd09c36c7ea 100644 --- a/contrib/ofed/libirdma/irdma.h +++ b/contrib/ofed/libirdma/irdma.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB * - * Copyright (c) 2017 - 2021 Intel Corporation + * Copyright (c) 2017 - 2022 Intel Corporation * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -39,13 +39,15 @@ #define RDMA_BIT2(type, a) ((u##type) 1UL << a) #define RDMA_MASK3(type, mask, shift) ((u##type) mask << shift) #define MAKEMASK(m, s) ((m) << (s)) -#define IRDMA_WQEALLOC_WQE_DESC_INDEX_S 20 -#define IRDMA_WQEALLOC_WQE_DESC_INDEX_M (0xfff << IRDMA_WQEALLOC_WQE_DESC_INDEX_S) + +#define IRDMA_WQEALLOC_WQE_DESC_INDEX_S 20 +#define IRDMA_WQEALLOC_WQE_DESC_INDEX GENMASK(31, 20) enum irdma_vers { - IRDMA_GEN_RSVD, - IRDMA_GEN_1, - IRDMA_GEN_2, + IRDMA_GEN_RSVD = 0, + IRDMA_GEN_1 = 1, + IRDMA_GEN_2 = 2, + IRDMA_GEN_MAX = 2, }; struct irdma_uk_attrs { @@ -58,8 +60,7 @@ struct irdma_uk_attrs { u32 min_hw_cq_size; u32 max_hw_cq_size; u16 max_hw_sq_chunk; - u16 max_hw_wq_size; - u16 min_sw_wq_size; + u16 min_hw_wq_size; u8 hw_rev; }; @@ -68,6 +69,7 @@ struct irdma_hw_attrs { u64 max_hw_outbound_msg_size; u64 max_hw_inbound_msg_size; u64 max_mr_size; + u64 page_size_cap; u32 min_hw_qp_id; u32 min_hw_aeq_size; u32 max_hw_aeq_size; diff --git a/contrib/ofed/libirdma/irdma_defs.h b/contrib/ofed/libirdma/irdma_defs.h index 8fb9f1e2b622..932993fd44ce 100644 --- a/contrib/ofed/libirdma/irdma_defs.h +++ b/contrib/ofed/libirdma/irdma_defs.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB * - * Copyright (c) 2015 - 2021 Intel Corporation + * Copyright (c) 2015 - 2022 Intel Corporation * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -75,7 +75,6 @@ #define IRDMA_CQE_QTYPE_RQ 0 #define IRDMA_CQE_QTYPE_SQ 1 -#define IRDMA_QP_SW_MIN_WQSIZE 8u /* in WRs*/ #define IRDMA_QP_WQE_MIN_SIZE 32 #define IRDMA_QP_WQE_MAX_SIZE 256 #define IRDMA_QP_WQE_MIN_QUANTA 1 @@ -85,9 +84,11 @@ #define IRDMA_SQ_RSVD 258 #define IRDMA_RQ_RSVD 1 -#define IRDMA_FEATURE_RTS_AE 1ULL -#define IRDMA_FEATURE_CQ_RESIZE 2ULL -#define IRDMA_FEATURE_RELAX_RQ_ORDER 4ULL +#define IRDMA_FEATURE_RTS_AE BIT_ULL(0) +#define IRDMA_FEATURE_CQ_RESIZE BIT_ULL(1) +#define IRDMA_FEATURE_RELAX_RQ_ORDER BIT_ULL(2) +#define IRDMA_FEATURE_64_BYTE_CQE BIT_ULL(5) + #define IRDMAQP_OP_RDMA_WRITE 0x00 #define IRDMAQP_OP_RDMA_READ 0x01 #define IRDMAQP_OP_RDMA_SEND 0x03 @@ -106,262 +107,198 @@ #define LS_32_1(val, bits) ((u32)((val) << (bits))) #define RS_32_1(val, bits) ((u32)((val) >> (bits))) #endif -#define LS_64(val, field) (((u64)(val) << field ## _S) & (field ## _M)) -#define RS_64(val, field) ((u64)((val) & field ## _M) >> field ## _S) -#define LS_32(val, field) (((val) << field ## _S) & (field ## _M)) -#define RS_32(val, field) (((val) & field ## _M) >> field ## _S) +#ifndef GENMASK_ULL +#define GENMASK_ULL(high, low) ((0xFFFFFFFFFFFFFFFFULL >> (64ULL - ((high) - (low) + 1ULL))) << (low)) +#endif /* GENMASK_ULL */ +#ifndef GENMASK +#define GENMASK(high, low) ((0xFFFFFFFFUL >> (32UL - ((high) - (low) + 1UL))) << (low)) +#endif /* GENMASK */ +#ifndef FIELD_PREP +#define FIELD_PREP(mask, val) (((u64)(val) << mask##_S) & (mask)) +#define FIELD_GET(mask, val) (((val) & mask) >> mask##_S) +#endif /* FIELD_PREP */ #define IRDMA_CQPHC_QPCTX_S 0 -#define IRDMA_CQPHC_QPCTX_M \ - (0xffffffffffffffffULL << IRDMA_CQPHC_QPCTX_S) - -/* iWARP QP Doorbell shadow area */ +#define IRDMA_CQPHC_QPCTX GENMASK_ULL(63, 0) #define IRDMA_QP_DBSA_HW_SQ_TAIL_S 0 -#define IRDMA_QP_DBSA_HW_SQ_TAIL_M \ - (0x7fffULL << IRDMA_QP_DBSA_HW_SQ_TAIL_S) - -/* Completion Queue Doorbell shadow area */ +#define IRDMA_QP_DBSA_HW_SQ_TAIL GENMASK_ULL(14, 0) #define IRDMA_CQ_DBSA_CQEIDX_S 0 -#define IRDMA_CQ_DBSA_CQEIDX_M (0xfffffULL << IRDMA_CQ_DBSA_CQEIDX_S) - +#define IRDMA_CQ_DBSA_CQEIDX GENMASK_ULL(19, 0) #define IRDMA_CQ_DBSA_SW_CQ_SELECT_S 0 -#define IRDMA_CQ_DBSA_SW_CQ_SELECT_M \ - (0x3fffULL << IRDMA_CQ_DBSA_SW_CQ_SELECT_S) - +#define IRDMA_CQ_DBSA_SW_CQ_SELECT GENMASK_ULL(13, 0) #define IRDMA_CQ_DBSA_ARM_NEXT_S 14 -#define IRDMA_CQ_DBSA_ARM_NEXT_M BIT_ULL(IRDMA_CQ_DBSA_ARM_NEXT_S) - +#define IRDMA_CQ_DBSA_ARM_NEXT BIT_ULL(14) #define IRDMA_CQ_DBSA_ARM_NEXT_SE_S 15 -#define IRDMA_CQ_DBSA_ARM_NEXT_SE_M BIT_ULL(IRDMA_CQ_DBSA_ARM_NEXT_SE_S) - +#define IRDMA_CQ_DBSA_ARM_NEXT_SE BIT_ULL(15) #define IRDMA_CQ_DBSA_ARM_SEQ_NUM_S 16 -#define IRDMA_CQ_DBSA_ARM_SEQ_NUM_M \ - (0x3ULL << IRDMA_CQ_DBSA_ARM_SEQ_NUM_S) +#define IRDMA_CQ_DBSA_ARM_SEQ_NUM GENMASK_ULL(17, 16) /* CQP and iWARP Completion Queue */ #define IRDMA_CQ_QPCTX_S IRDMA_CQPHC_QPCTX_S -#define IRDMA_CQ_QPCTX_M IRDMA_CQPHC_QPCTX_M +#define IRDMA_CQ_QPCTX IRDMA_CQPHC_QPCTX #define IRDMA_CQ_MINERR_S 0 -#define IRDMA_CQ_MINERR_M (0xffffULL << IRDMA_CQ_MINERR_S) - +#define IRDMA_CQ_MINERR GENMASK_ULL(15, 0) #define IRDMA_CQ_MAJERR_S 16 -#define IRDMA_CQ_MAJERR_M (0xffffULL << IRDMA_CQ_MAJERR_S) - +#define IRDMA_CQ_MAJERR GENMASK_ULL(31, 16) #define IRDMA_CQ_WQEIDX_S 32 -#define IRDMA_CQ_WQEIDX_M (0x7fffULL << IRDMA_CQ_WQEIDX_S) - +#define IRDMA_CQ_WQEIDX GENMASK_ULL(46, 32) #define IRDMA_CQ_EXTCQE_S 50 -#define IRDMA_CQ_EXTCQE_M BIT_ULL(IRDMA_CQ_EXTCQE_S) - +#define IRDMA_CQ_EXTCQE BIT_ULL(50) #define IRDMA_OOO_CMPL_S 54 -#define IRDMA_OOO_CMPL_M BIT_ULL(IRDMA_OOO_CMPL_S) - +#define IRDMA_OOO_CMPL BIT_ULL(54) #define IRDMA_CQ_ERROR_S 55 -#define IRDMA_CQ_ERROR_M BIT_ULL(IRDMA_CQ_ERROR_S) - +#define IRDMA_CQ_ERROR BIT_ULL(55) #define IRDMA_CQ_SQ_S 62 -#define IRDMA_CQ_SQ_M BIT_ULL(IRDMA_CQ_SQ_S) +#define IRDMA_CQ_SQ BIT_ULL(62) #define IRDMA_CQ_VALID_S 63 -#define IRDMA_CQ_VALID_M BIT_ULL(IRDMA_CQ_VALID_S) - -#define IRDMA_CQ_IMMVALID_S 62 -#define IRDMA_CQ_IMMVALID_M BIT_ULL(IRDMA_CQ_IMMVALID_S) - +#define IRDMA_CQ_VALID BIT_ULL(63) +#define IRDMA_CQ_IMMVALID BIT_ULL(62) #define IRDMA_CQ_UDSMACVALID_S 61 -#define IRDMA_CQ_UDSMACVALID_M BIT_ULL(IRDMA_CQ_UDSMACVALID_S) - +#define IRDMA_CQ_UDSMACVALID BIT_ULL(61) #define IRDMA_CQ_UDVLANVALID_S 60 -#define IRDMA_CQ_UDVLANVALID_M BIT_ULL(IRDMA_CQ_UDVLANVALID_S) - +#define IRDMA_CQ_UDVLANVALID BIT_ULL(60) #define IRDMA_CQ_UDSMAC_S 0 -#define IRDMA_CQ_UDSMAC_M (0xffffffffffffULL << IRDMA_CQ_UDSMAC_S) - +#define IRDMA_CQ_UDSMAC GENMASK_ULL(47, 0) #define IRDMA_CQ_UDVLAN_S 48 -#define IRDMA_CQ_UDVLAN_M (0xffffULL << IRDMA_CQ_UDVLAN_S) +#define IRDMA_CQ_UDVLAN GENMASK_ULL(63, 48) #define IRDMA_CQ_IMMDATA_S 0 -#define IRDMA_CQ_IMMDATA_M (0xffffffffffffffffULL << IRDMA_CQ_IMMVALID_S) - +#define IRDMA_CQ_IMMVALID_S 62 +#define IRDMA_CQ_IMMDATA GENMASK_ULL(125, 62) #define IRDMA_CQ_IMMDATALOW32_S 0 -#define IRDMA_CQ_IMMDATALOW32_M (0xffffffffULL << IRDMA_CQ_IMMDATALOW32_S) - +#define IRDMA_CQ_IMMDATALOW32 GENMASK_ULL(31, 0) #define IRDMA_CQ_IMMDATAUP32_S 32 -#define IRDMA_CQ_IMMDATAUP32_M (0xffffffffULL << IRDMA_CQ_IMMDATAUP32_S) - +#define IRDMA_CQ_IMMDATAUP32 GENMASK_ULL(63, 32) #define IRDMACQ_PAYLDLEN_S 0 -#define IRDMACQ_PAYLDLEN_M (0xffffffffULL << IRDMACQ_PAYLDLEN_S) - -#define IRDMACQ_TCPSEQNUMRTT_S 32 -#define IRDMACQ_TCPSEQNUMRTT_M (0xffffffffULL << IRDMACQ_TCPSEQNUMRTT_S) - +#define IRDMACQ_PAYLDLEN GENMASK_ULL(31, 0) +#define IRDMACQ_TCPSQN_ROCEPSN_RTT_TS_S 32 +#define IRDMACQ_TCPSQN_ROCEPSN_RTT_TS GENMASK_ULL(63, 32) #define IRDMACQ_INVSTAG_S 0 -#define IRDMACQ_INVSTAG_M (0xffffffffULL << IRDMACQ_INVSTAG_S) - +#define IRDMACQ_INVSTAG GENMASK_ULL(31, 0) #define IRDMACQ_QPID_S 32 -#define IRDMACQ_QPID_M (0xffffffULL << IRDMACQ_QPID_S) +#define IRDMACQ_QPID GENMASK_ULL(55, 32) #define IRDMACQ_UDSRCQPN_S 0 -#define IRDMACQ_UDSRCQPN_M (0xffffffffULL << IRDMACQ_UDSRCQPN_S) - +#define IRDMACQ_UDSRCQPN GENMASK_ULL(31, 0) #define IRDMACQ_PSHDROP_S 51 -#define IRDMACQ_PSHDROP_M BIT_ULL(IRDMACQ_PSHDROP_S) - +#define IRDMACQ_PSHDROP BIT_ULL(51) #define IRDMACQ_STAG_S 53 -#define IRDMACQ_STAG_M BIT_ULL(IRDMACQ_STAG_S) - +#define IRDMACQ_STAG BIT_ULL(53) #define IRDMACQ_IPV4_S 53 -#define IRDMACQ_IPV4_M BIT_ULL(IRDMACQ_IPV4_S) - +#define IRDMACQ_IPV4 BIT_ULL(53) #define IRDMACQ_SOEVENT_S 54 -#define IRDMACQ_SOEVENT_M BIT_ULL(IRDMACQ_SOEVENT_S) - +#define IRDMACQ_SOEVENT BIT_ULL(54) #define IRDMACQ_OP_S 56 -#define IRDMACQ_OP_M (0x3fULL << IRDMACQ_OP_S) +#define IRDMACQ_OP GENMASK_ULL(61, 56) /* Manage Push Page - MPP */ #define IRDMA_INVALID_PUSH_PAGE_INDEX_GEN_1 0xffff #define IRDMA_INVALID_PUSH_PAGE_INDEX 0xffffffff -/* iwarp QP SQ WQE common fields */ #define IRDMAQPSQ_OPCODE_S 32 -#define IRDMAQPSQ_OPCODE_M (0x3fULL << IRDMAQPSQ_OPCODE_S) - +#define IRDMAQPSQ_OPCODE GENMASK_ULL(37, 32) #define IRDMAQPSQ_COPY_HOST_PBL_S 43 -#define IRDMAQPSQ_COPY_HOST_PBL_M BIT_ULL(IRDMAQPSQ_COPY_HOST_PBL_S) - +#define IRDMAQPSQ_COPY_HOST_PBL BIT_ULL(43) #define IRDMAQPSQ_ADDFRAGCNT_S 38 -#define IRDMAQPSQ_ADDFRAGCNT_M (0xfULL << IRDMAQPSQ_ADDFRAGCNT_S) - +#define IRDMAQPSQ_ADDFRAGCNT GENMASK_ULL(41, 38) #define IRDMAQPSQ_PUSHWQE_S 56 -#define IRDMAQPSQ_PUSHWQE_M BIT_ULL(IRDMAQPSQ_PUSHWQE_S) - +#define IRDMAQPSQ_PUSHWQE BIT_ULL(56) #define IRDMAQPSQ_STREAMMODE_S 58 -#define IRDMAQPSQ_STREAMMODE_M BIT_ULL(IRDMAQPSQ_STREAMMODE_S) - +#define IRDMAQPSQ_STREAMMODE BIT_ULL(58) #define IRDMAQPSQ_WAITFORRCVPDU_S 59 -#define IRDMAQPSQ_WAITFORRCVPDU_M BIT_ULL(IRDMAQPSQ_WAITFORRCVPDU_S) - +#define IRDMAQPSQ_WAITFORRCVPDU BIT_ULL(59) #define IRDMAQPSQ_READFENCE_S 60 -#define IRDMAQPSQ_READFENCE_M BIT_ULL(IRDMAQPSQ_READFENCE_S) - +#define IRDMAQPSQ_READFENCE BIT_ULL(60) #define IRDMAQPSQ_LOCALFENCE_S 61 -#define IRDMAQPSQ_LOCALFENCE_M BIT_ULL(IRDMAQPSQ_LOCALFENCE_S) - +#define IRDMAQPSQ_LOCALFENCE BIT_ULL(61) #define IRDMAQPSQ_UDPHEADER_S 61 -#define IRDMAQPSQ_UDPHEADER_M BIT_ULL(IRDMAQPSQ_UDPHEADER_S) - +#define IRDMAQPSQ_UDPHEADER BIT_ULL(61) #define IRDMAQPSQ_L4LEN_S 42 -#define IRDMAQPSQ_L4LEN_M ((u64)0xF << IRDMAQPSQ_L4LEN_S) - +#define IRDMAQPSQ_L4LEN GENMASK_ULL(45, 42) #define IRDMAQPSQ_SIGCOMPL_S 62 -#define IRDMAQPSQ_SIGCOMPL_M BIT_ULL(IRDMAQPSQ_SIGCOMPL_S) - +#define IRDMAQPSQ_SIGCOMPL BIT_ULL(62) #define IRDMAQPSQ_VALID_S 63 -#define IRDMAQPSQ_VALID_M BIT_ULL(IRDMAQPSQ_VALID_S) +#define IRDMAQPSQ_VALID BIT_ULL(63) #define IRDMAQPSQ_FRAG_TO_S IRDMA_CQPHC_QPCTX_S -#define IRDMAQPSQ_FRAG_TO_M IRDMA_CQPHC_QPCTX_M - +#define IRDMAQPSQ_FRAG_TO IRDMA_CQPHC_QPCTX #define IRDMAQPSQ_FRAG_VALID_S 63 -#define IRDMAQPSQ_FRAG_VALID_M BIT_ULL(IRDMAQPSQ_FRAG_VALID_S) - +#define IRDMAQPSQ_FRAG_VALID BIT_ULL(63) #define IRDMAQPSQ_FRAG_LEN_S 32 -#define IRDMAQPSQ_FRAG_LEN_M (0x7fffffffULL << IRDMAQPSQ_FRAG_LEN_S) - +#define IRDMAQPSQ_FRAG_LEN GENMASK_ULL(62, 32) #define IRDMAQPSQ_FRAG_STAG_S 0 -#define IRDMAQPSQ_FRAG_STAG_M (0xffffffffULL << IRDMAQPSQ_FRAG_STAG_S) - +#define IRDMAQPSQ_FRAG_STAG GENMASK_ULL(31, 0) #define IRDMAQPSQ_GEN1_FRAG_LEN_S 0 -#define IRDMAQPSQ_GEN1_FRAG_LEN_M (0xffffffffULL << IRDMAQPSQ_GEN1_FRAG_LEN_S) - +#define IRDMAQPSQ_GEN1_FRAG_LEN GENMASK_ULL(31, 0) #define IRDMAQPSQ_GEN1_FRAG_STAG_S 32 -#define IRDMAQPSQ_GEN1_FRAG_STAG_M (0xffffffffULL << IRDMAQPSQ_GEN1_FRAG_STAG_S) - +#define IRDMAQPSQ_GEN1_FRAG_STAG GENMASK_ULL(63, 32) #define IRDMAQPSQ_REMSTAGINV_S 0 -#define IRDMAQPSQ_REMSTAGINV_M (0xffffffffULL << IRDMAQPSQ_REMSTAGINV_S) - +#define IRDMAQPSQ_REMSTAGINV GENMASK_ULL(31, 0) #define IRDMAQPSQ_DESTQKEY_S 0 -#define IRDMAQPSQ_DESTQKEY_M (0xffffffffULL << IRDMAQPSQ_DESTQKEY_S) - +#define IRDMAQPSQ_DESTQKEY GENMASK_ULL(31, 0) #define IRDMAQPSQ_DESTQPN_S 32 -#define IRDMAQPSQ_DESTQPN_M (0x00ffffffULL << IRDMAQPSQ_DESTQPN_S) - +#define IRDMAQPSQ_DESTQPN GENMASK_ULL(55, 32) #define IRDMAQPSQ_AHID_S 0 -#define IRDMAQPSQ_AHID_M (0x0001ffffULL << IRDMAQPSQ_AHID_S) - +#define IRDMAQPSQ_AHID GENMASK_ULL(16, 0) #define IRDMAQPSQ_INLINEDATAFLAG_S 57 -#define IRDMAQPSQ_INLINEDATAFLAG_M BIT_ULL(IRDMAQPSQ_INLINEDATAFLAG_S) +#define IRDMAQPSQ_INLINEDATAFLAG BIT_ULL(57) #define IRDMA_INLINE_VALID_S 7 - #define IRDMAQPSQ_INLINEDATALEN_S 48 -#define IRDMAQPSQ_INLINEDATALEN_M \ - (0xffULL << IRDMAQPSQ_INLINEDATALEN_S) +#define IRDMAQPSQ_INLINEDATALEN GENMASK_ULL(55, 48) #define IRDMAQPSQ_IMMDATAFLAG_S 47 -#define IRDMAQPSQ_IMMDATAFLAG_M \ - BIT_ULL(IRDMAQPSQ_IMMDATAFLAG_S) +#define IRDMAQPSQ_IMMDATAFLAG BIT_ULL(47) #define IRDMAQPSQ_REPORTRTT_S 46 -#define IRDMAQPSQ_REPORTRTT_M \ - BIT_ULL(IRDMAQPSQ_REPORTRTT_S) +#define IRDMAQPSQ_REPORTRTT BIT_ULL(46) #define IRDMAQPSQ_IMMDATA_S 0 -#define IRDMAQPSQ_IMMDATA_M \ - (0xffffffffffffffffULL << IRDMAQPSQ_IMMDATA_S) - -/* rdma write */ +#define IRDMAQPSQ_IMMDATA GENMASK_ULL(63, 0) #define IRDMAQPSQ_REMSTAG_S 0 -#define IRDMAQPSQ_REMSTAG_M (0xffffffffULL << IRDMAQPSQ_REMSTAG_S) +#define IRDMAQPSQ_REMSTAG GENMASK_ULL(31, 0) #define IRDMAQPSQ_REMTO_S IRDMA_CQPHC_QPCTX_S -#define IRDMAQPSQ_REMTO_M IRDMA_CQPHC_QPCTX_M +#define IRDMAQPSQ_REMTO IRDMA_CQPHC_QPCTX -/* memory window */ #define IRDMAQPSQ_STAGRIGHTS_S 48 -#define IRDMAQPSQ_STAGRIGHTS_M (0x1fULL << IRDMAQPSQ_STAGRIGHTS_S) - +#define IRDMAQPSQ_STAGRIGHTS GENMASK_ULL(52, 48) #define IRDMAQPSQ_VABASEDTO_S 53 -#define IRDMAQPSQ_VABASEDTO_M BIT_ULL(IRDMAQPSQ_VABASEDTO_S) - +#define IRDMAQPSQ_VABASEDTO BIT_ULL(53) #define IRDMAQPSQ_MEMWINDOWTYPE_S 54 -#define IRDMAQPSQ_MEMWINDOWTYPE_M BIT_ULL(IRDMAQPSQ_MEMWINDOWTYPE_S) +#define IRDMAQPSQ_MEMWINDOWTYPE BIT_ULL(54) #define IRDMAQPSQ_MWLEN_S IRDMA_CQPHC_QPCTX_S -#define IRDMAQPSQ_MWLEN_M IRDMA_CQPHC_QPCTX_M - +#define IRDMAQPSQ_MWLEN IRDMA_CQPHC_QPCTX #define IRDMAQPSQ_PARENTMRSTAG_S 32 -#define IRDMAQPSQ_PARENTMRSTAG_M \ - (0xffffffffULL << IRDMAQPSQ_PARENTMRSTAG_S) - +#define IRDMAQPSQ_PARENTMRSTAG GENMASK_ULL(63, 32) #define IRDMAQPSQ_MWSTAG_S 0 -#define IRDMAQPSQ_MWSTAG_M (0xffffffffULL << IRDMAQPSQ_MWSTAG_S) +#define IRDMAQPSQ_MWSTAG GENMASK_ULL(31, 0) #define IRDMAQPSQ_BASEVA_TO_FBO_S IRDMA_CQPHC_QPCTX_S -#define IRDMAQPSQ_BASEVA_TO_FBO_M IRDMA_CQPHC_QPCTX_M +#define IRDMAQPSQ_BASEVA_TO_FBO IRDMA_CQPHC_QPCTX -/* Local Invalidate */ #define IRDMAQPSQ_LOCSTAG_S 0 -#define IRDMAQPSQ_LOCSTAG_M (0xffffffffULL << IRDMAQPSQ_LOCSTAG_S) +#define IRDMAQPSQ_LOCSTAG GENMASK_ULL(31, 0) /* iwarp QP RQ WQE common fields */ #define IRDMAQPRQ_ADDFRAGCNT_S IRDMAQPSQ_ADDFRAGCNT_S -#define IRDMAQPRQ_ADDFRAGCNT_M IRDMAQPSQ_ADDFRAGCNT_M +#define IRDMAQPRQ_ADDFRAGCNT IRDMAQPSQ_ADDFRAGCNT #define IRDMAQPRQ_VALID_S IRDMAQPSQ_VALID_S -#define IRDMAQPRQ_VALID_M IRDMAQPSQ_VALID_M +#define IRDMAQPRQ_VALID IRDMAQPSQ_VALID #define IRDMAQPRQ_COMPLCTX_S IRDMA_CQPHC_QPCTX_S -#define IRDMAQPRQ_COMPLCTX_M IRDMA_CQPHC_QPCTX_M +#define IRDMAQPRQ_COMPLCTX IRDMA_CQPHC_QPCTX #define IRDMAQPRQ_FRAG_LEN_S IRDMAQPSQ_FRAG_LEN_S -#define IRDMAQPRQ_FRAG_LEN_M IRDMAQPSQ_FRAG_LEN_M +#define IRDMAQPRQ_FRAG_LEN IRDMAQPSQ_FRAG_LEN #define IRDMAQPRQ_STAG_S IRDMAQPSQ_FRAG_STAG_S -#define IRDMAQPRQ_STAG_M IRDMAQPSQ_FRAG_STAG_M +#define IRDMAQPRQ_STAG IRDMAQPSQ_FRAG_STAG #define IRDMAQPRQ_TO_S IRDMAQPSQ_FRAG_TO_S -#define IRDMAQPRQ_TO_M IRDMAQPSQ_FRAG_TO_M +#define IRDMAQPRQ_TO IRDMAQPSQ_FRAG_TO #define IRDMAPFINT_OICR_HMC_ERR_M BIT(26) #define IRDMAPFINT_OICR_PE_PUSH_M BIT(27) @@ -500,6 +437,12 @@ IRDMA_RING_MOVE_HEAD(_ring, _retcode); \ } +enum irdma_protocol_used { + IRDMA_ANY_PROTOCOL = 0, + IRDMA_IWARP_PROTOCOL_ONLY = 1, + IRDMA_ROCE_PROTOCOL_ONLY = 2, +}; + enum irdma_qp_wqe_size { IRDMA_WQE_SIZE_32 = 32, IRDMA_WQE_SIZE_64 = 64, diff --git a/contrib/ofed/libirdma/irdma_uk.c b/contrib/ofed/libirdma/irdma_uk.c index 2f77c132d296..5201ad692dc1 100644 --- a/contrib/ofed/libirdma/irdma_uk.c +++ b/contrib/ofed/libirdma/irdma_uk.c @@ -51,15 +51,15 @@ irdma_set_fragment(__le64 * wqe, u32 offset, struct irdma_sge *sge, { if (sge) { set_64bit_val(wqe, offset, - LS_64(sge->tag_off, IRDMAQPSQ_FRAG_TO)); + FIELD_PREP(IRDMAQPSQ_FRAG_TO, sge->tag_off)); set_64bit_val(wqe, offset + IRDMA_BYTE_8, - LS_64(valid, IRDMAQPSQ_VALID) | - LS_64(sge->len, IRDMAQPSQ_FRAG_LEN) | - LS_64(sge->stag, IRDMAQPSQ_FRAG_STAG)); + FIELD_PREP(IRDMAQPSQ_VALID, valid) | + FIELD_PREP(IRDMAQPSQ_FRAG_LEN, sge->len) | + FIELD_PREP(IRDMAQPSQ_FRAG_STAG, sge->stag)); } else { set_64bit_val(wqe, offset, 0); set_64bit_val(wqe, offset + IRDMA_BYTE_8, - LS_64(valid, IRDMAQPSQ_VALID)); + FIELD_PREP(IRDMAQPSQ_VALID, valid)); } } @@ -76,16 +76,26 @@ irdma_set_fragment_gen_1(__le64 * wqe, u32 offset, { if (sge) { set_64bit_val(wqe, offset, - LS_64(sge->tag_off, IRDMAQPSQ_FRAG_TO)); + FIELD_PREP(IRDMAQPSQ_FRAG_TO, sge->tag_off)); set_64bit_val(wqe, offset + IRDMA_BYTE_8, - LS_64(sge->len, IRDMAQPSQ_GEN1_FRAG_LEN) | - LS_64(sge->stag, IRDMAQPSQ_GEN1_FRAG_STAG)); + FIELD_PREP(IRDMAQPSQ_GEN1_FRAG_LEN, sge->len) | + FIELD_PREP(IRDMAQPSQ_GEN1_FRAG_STAG, sge->stag)); } else { set_64bit_val(wqe, offset, 0); set_64bit_val(wqe, offset + IRDMA_BYTE_8, 0); } } +/** + * irdma_nop_hdr - Format header section of noop WQE + * @qp: hw qp ptr + */ +static inline u64 irdma_nop_hdr(struct irdma_qp_uk *qp){ + return FIELD_PREP(IRDMAQPSQ_OPCODE, IRDMAQP_OP_NOP) | + FIELD_PREP(IRDMAQPSQ_SIGCOMPL, false) | + FIELD_PREP(IRDMAQPSQ_VALID, qp->swqe_polarity); +} + /** * irdma_nop_1 - insert a NOP wqe * @qp: hw qp ptr @@ -93,10 +103,8 @@ irdma_set_fragment_gen_1(__le64 * wqe, u32 offset, static int irdma_nop_1(struct irdma_qp_uk *qp) { - u64 hdr; __le64 *wqe; u32 wqe_idx; - bool signaled = false; if (!qp->sq_ring.head) return EINVAL; @@ -110,14 +118,10 @@ irdma_nop_1(struct irdma_qp_uk *qp) set_64bit_val(wqe, IRDMA_BYTE_8, 0); set_64bit_val(wqe, IRDMA_BYTE_16, 0); - hdr = LS_64(IRDMAQP_OP_NOP, IRDMAQPSQ_OPCODE) | - LS_64(signaled, IRDMAQPSQ_SIGCOMPL) | - LS_64(qp->swqe_polarity, IRDMAQPSQ_VALID); - /* make sure WQE is written before valid bit is set */ udma_to_device_barrier(); - set_64bit_val(wqe, IRDMA_BYTE_24, hdr); + set_64bit_val(wqe, IRDMA_BYTE_24, irdma_nop_hdr(qp)); return 0; } @@ -160,7 +164,7 @@ irdma_uk_qp_post_wr(struct irdma_qp_uk *qp) /* read the doorbell shadow area */ get_64bit_val(qp->shadow_area, IRDMA_BYTE_0, &temp); - hw_sq_tail = (u32)RS_64(temp, IRDMA_QP_DBSA_HW_SQ_TAIL); + hw_sq_tail = (u32)FIELD_GET(IRDMA_QP_DBSA_HW_SQ_TAIL, temp); sw_sq_head = IRDMA_RING_CURRENT_HEAD(qp->sq_ring); if (sw_sq_head != qp->initial_ring.head) { if (qp->push_dropped) { @@ -191,7 +195,7 @@ static void irdma_qp_ring_push_db(struct irdma_qp_uk *qp, u32 wqe_idx) { set_32bit_val(qp->push_db, 0, - LS_32(wqe_idx >> 3, IRDMA_WQEALLOC_WQE_DESC_INDEX) | qp->qp_id); + FIELD_PREP(IRDMA_WQEALLOC_WQE_DESC_INDEX, wqe_idx >> 3) | qp->qp_id); qp->initial_ring.head = qp->sq_ring.head; qp->push_mode = true; qp->push_dropped = false; @@ -220,31 +224,32 @@ irdma_qp_push_wqe(struct irdma_qp_uk *qp, __le64 * wqe, u16 quanta, * irdma_qp_get_next_send_wqe - pad with NOP if needed, return where next WR should go * @qp: hw qp ptr * @wqe_idx: return wqe index - * @quanta: size of WR in quanta + * @quanta: (in/out) ptr to size of WR in quanta. Modified in case pad is needed * @total_size: size of WR in bytes * @info: info on WR */ __le64 * irdma_qp_get_next_send_wqe(struct irdma_qp_uk *qp, u32 *wqe_idx, - u16 quanta, u32 total_size, + u16 *quanta, u32 total_size, struct irdma_post_sq_info *info) { __le64 *wqe; __le64 *wqe_0 = NULL; u32 nop_wqe_idx; - u16 avail_quanta; + u16 avail_quanta, wqe_quanta = *quanta; u16 i; avail_quanta = qp->uk_attrs->max_hw_sq_chunk - (IRDMA_RING_CURRENT_HEAD(qp->sq_ring) % qp->uk_attrs->max_hw_sq_chunk); - if (quanta <= avail_quanta) { + + if (*quanta <= avail_quanta) { /* WR fits in current chunk */ - if (quanta > IRDMA_SQ_RING_FREE_QUANTA(qp->sq_ring)) + if (*quanta > IRDMA_SQ_RING_FREE_QUANTA(qp->sq_ring)) return NULL; } else { /* Need to pad with NOP */ - if (quanta + avail_quanta > + if (*quanta + avail_quanta > IRDMA_SQ_RING_FREE_QUANTA(qp->sq_ring)) return NULL; @@ -262,17 +267,19 @@ irdma_qp_get_next_send_wqe(struct irdma_qp_uk *qp, u32 *wqe_idx, if (!*wqe_idx) qp->swqe_polarity = !qp->swqe_polarity; - IRDMA_RING_MOVE_HEAD_BY_COUNT_NOCHECK(qp->sq_ring, quanta); + IRDMA_RING_MOVE_HEAD_BY_COUNT_NOCHECK(qp->sq_ring, *quanta); + + irdma_clr_wqes(qp, *wqe_idx); wqe = qp->sq_base[*wqe_idx].elem; - if (qp->uk_attrs->hw_rev == IRDMA_GEN_1 && quanta == 1 && + if (qp->uk_attrs->hw_rev == IRDMA_GEN_1 && wqe_quanta == 1 && (IRDMA_RING_CURRENT_HEAD(qp->sq_ring) & 1)) { wqe_0 = qp->sq_base[IRDMA_RING_CURRENT_HEAD(qp->sq_ring)].elem; - wqe_0[3] = htole64(LS_64(!qp->swqe_polarity, IRDMAQPSQ_VALID)); + wqe_0[3] = htole64(FIELD_PREP(IRDMAQPSQ_VALID, !qp->swqe_polarity)); } qp->sq_wrtrk_array[*wqe_idx].wrid = info->wr_id; qp->sq_wrtrk_array[*wqe_idx].wr_len = total_size; - qp->sq_wrtrk_array[*wqe_idx].quanta = quanta; + qp->sq_wrtrk_array[*wqe_idx].quanta = wqe_quanta; qp->sq_wrtrk_array[*wqe_idx].signaled = info->signaled; return wqe; @@ -344,20 +351,17 @@ irdma_uk_rdma_write(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info, if (ret_code) return ret_code; - wqe = irdma_qp_get_next_send_wqe(qp, &wqe_idx, quanta, total_size, - info); + wqe = irdma_qp_get_next_send_wqe(qp, &wqe_idx, &quanta, total_size, info); if (!wqe) return ENOSPC; - irdma_clr_wqes(qp, wqe_idx); - qp->sq_wrtrk_array[wqe_idx].signaled = info->signaled; set_64bit_val(wqe, IRDMA_BYTE_16, - LS_64(op_info->rem_addr.tag_off, IRDMAQPSQ_FRAG_TO)); + FIELD_PREP(IRDMAQPSQ_FRAG_TO, op_info->rem_addr.tag_off)); if (info->imm_data_valid) { set_64bit_val(wqe, IRDMA_BYTE_0, - LS_64(info->imm_data, IRDMAQPSQ_IMMDATA)); + FIELD_PREP(IRDMAQPSQ_IMMDATA, info->imm_data)); i = 0; } else { qp->wqe_ops.iw_set_fragment(wqe, IRDMA_BYTE_0, @@ -382,28 +386,24 @@ irdma_uk_rdma_write(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info, ++addl_frag_cnt; } - if (!op_info->rem_addr.stag && !total_size) - op_info->rem_addr.stag = 0x1234; - hdr = LS_64(op_info->rem_addr.stag, IRDMAQPSQ_REMSTAG) | - LS_64(info->op_type, IRDMAQPSQ_OPCODE) | - LS_64((info->imm_data_valid ? 1 : 0), IRDMAQPSQ_IMMDATAFLAG) | - LS_64((info->report_rtt ? 1 : 0), IRDMAQPSQ_REPORTRTT) | - LS_64(addl_frag_cnt, IRDMAQPSQ_ADDFRAGCNT) | - LS_64((info->push_wqe ? 1 : 0), IRDMAQPSQ_PUSHWQE) | - LS_64(read_fence, IRDMAQPSQ_READFENCE) | - LS_64(info->local_fence, IRDMAQPSQ_LOCALFENCE) | - LS_64(info->signaled, IRDMAQPSQ_SIGCOMPL) | - LS_64(qp->swqe_polarity, IRDMAQPSQ_VALID); + hdr = FIELD_PREP(IRDMAQPSQ_REMSTAG, op_info->rem_addr.stag) | + FIELD_PREP(IRDMAQPSQ_OPCODE, info->op_type) | + FIELD_PREP(IRDMAQPSQ_IMMDATAFLAG, info->imm_data_valid) | + FIELD_PREP(IRDMAQPSQ_REPORTRTT, info->report_rtt) | + FIELD_PREP(IRDMAQPSQ_ADDFRAGCNT, addl_frag_cnt) | + FIELD_PREP(IRDMAQPSQ_PUSHWQE, info->push_wqe) | + FIELD_PREP(IRDMAQPSQ_READFENCE, read_fence) | + FIELD_PREP(IRDMAQPSQ_LOCALFENCE, info->local_fence) | + FIELD_PREP(IRDMAQPSQ_SIGCOMPL, info->signaled) | + FIELD_PREP(IRDMAQPSQ_VALID, qp->swqe_polarity); udma_to_device_barrier(); /* make sure WQE is populated before valid bit is set */ set_64bit_val(wqe, IRDMA_BYTE_24, hdr); - if (info->push_wqe) { + if (info->push_wqe) irdma_qp_push_wqe(qp, wqe, quanta, wqe_idx, post_sq); - } else { - if (post_sq) - irdma_uk_qp_post_wr(qp); - } + else if (post_sq) + irdma_uk_qp_post_wr(qp); return 0; } @@ -443,8 +443,7 @@ irdma_uk_rdma_read(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info, if (ret_code) return ret_code; - wqe = irdma_qp_get_next_send_wqe(qp, &wqe_idx, quanta, total_size, - info); + wqe = irdma_qp_get_next_send_wqe(qp, &wqe_idx, &quanta, total_size, info); if (!wqe) return ENOSPC; @@ -453,8 +452,6 @@ irdma_uk_rdma_read(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info, qp->ord_cnt = 0; } - irdma_clr_wqes(qp, wqe_idx); - qp->sq_wrtrk_array[wqe_idx].signaled = info->signaled; addl_frag_cnt = op_info->num_lo_sges > 1 ? (op_info->num_lo_sges - 1) : 0; @@ -478,28 +475,26 @@ irdma_uk_rdma_read(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info, ++addl_frag_cnt; } set_64bit_val(wqe, IRDMA_BYTE_16, - LS_64(op_info->rem_addr.tag_off, IRDMAQPSQ_FRAG_TO)); - hdr = LS_64(op_info->rem_addr.stag, IRDMAQPSQ_REMSTAG) | - LS_64((info->report_rtt ? 1 : 0), IRDMAQPSQ_REPORTRTT) | - LS_64(addl_frag_cnt, IRDMAQPSQ_ADDFRAGCNT) | - LS_64((inv_stag ? IRDMAQP_OP_RDMA_READ_LOC_INV : IRDMAQP_OP_RDMA_READ), - IRDMAQPSQ_OPCODE) | - LS_64((info->push_wqe ? 1 : 0), IRDMAQPSQ_PUSHWQE) | - LS_64(info->read_fence || qp->force_fence || ord_fence ? 1 : 0, - IRDMAQPSQ_READFENCE) | - LS_64(local_fence, IRDMAQPSQ_LOCALFENCE) | - LS_64(info->signaled, IRDMAQPSQ_SIGCOMPL) | - LS_64(qp->swqe_polarity, IRDMAQPSQ_VALID); + FIELD_PREP(IRDMAQPSQ_FRAG_TO, op_info->rem_addr.tag_off)); + hdr = FIELD_PREP(IRDMAQPSQ_REMSTAG, op_info->rem_addr.stag) | + FIELD_PREP(IRDMAQPSQ_REPORTRTT, (info->report_rtt ? 1 : 0)) | + FIELD_PREP(IRDMAQPSQ_ADDFRAGCNT, addl_frag_cnt) | + FIELD_PREP(IRDMAQPSQ_OPCODE, + (inv_stag ? IRDMAQP_OP_RDMA_READ_LOC_INV : IRDMAQP_OP_RDMA_READ)) | + FIELD_PREP(IRDMAQPSQ_PUSHWQE, info->push_wqe) | + FIELD_PREP(IRDMAQPSQ_READFENCE, + info->read_fence || ord_fence ? 1 : 0) | + FIELD_PREP(IRDMAQPSQ_LOCALFENCE, local_fence) | + FIELD_PREP(IRDMAQPSQ_SIGCOMPL, info->signaled) | + FIELD_PREP(IRDMAQPSQ_VALID, qp->swqe_polarity); udma_to_device_barrier(); /* make sure WQE is populated before valid bit is set */ set_64bit_val(wqe, IRDMA_BYTE_24, hdr); - if (info->push_wqe) { + if (info->push_wqe) irdma_qp_push_wqe(qp, wqe, quanta, wqe_idx, post_sq); - } else { - if (post_sq) - irdma_uk_qp_post_wr(qp); - } + else if (post_sq) + irdma_uk_qp_post_wr(qp); return 0; } @@ -540,21 +535,19 @@ irdma_uk_send(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info, if (ret_code) return ret_code; - wqe = irdma_qp_get_next_send_wqe(qp, &wqe_idx, quanta, total_size, - info); + wqe = irdma_qp_get_next_send_wqe(qp, &wqe_idx, &quanta, total_size, info); if (!wqe) return ENOSPC; - irdma_clr_wqes(qp, wqe_idx); - read_fence |= info->read_fence; addl_frag_cnt = frag_cnt > 1 ? (frag_cnt - 1) : 0; if (info->imm_data_valid) { set_64bit_val(wqe, IRDMA_BYTE_0, - LS_64(info->imm_data, IRDMAQPSQ_IMMDATA)); + FIELD_PREP(IRDMAQPSQ_IMMDATA, info->imm_data)); i = 0; } else { - qp->wqe_ops.iw_set_fragment(wqe, IRDMA_BYTE_0, op_info->sg_list, + qp->wqe_ops.iw_set_fragment(wqe, IRDMA_BYTE_0, + frag_cnt ? op_info->sg_list : NULL, qp->swqe_polarity); i = 1; } @@ -575,31 +568,30 @@ irdma_uk_send(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info, } set_64bit_val(wqe, IRDMA_BYTE_16, - LS_64(op_info->qkey, IRDMAQPSQ_DESTQKEY) | - LS_64(op_info->dest_qp, IRDMAQPSQ_DESTQPN)); - hdr = LS_64(info->stag_to_inv, IRDMAQPSQ_REMSTAG) | - LS_64(op_info->ah_id, IRDMAQPSQ_AHID) | - LS_64((info->imm_data_valid ? 1 : 0), IRDMAQPSQ_IMMDATAFLAG) | - LS_64((info->report_rtt ? 1 : 0), IRDMAQPSQ_REPORTRTT) | - LS_64(info->op_type, IRDMAQPSQ_OPCODE) | - LS_64(addl_frag_cnt, IRDMAQPSQ_ADDFRAGCNT) | - LS_64((info->push_wqe ? 1 : 0), IRDMAQPSQ_PUSHWQE) | - LS_64(read_fence, IRDMAQPSQ_READFENCE) | - LS_64(info->local_fence, IRDMAQPSQ_LOCALFENCE) | - LS_64(info->signaled, IRDMAQPSQ_SIGCOMPL) | - LS_64(info->udp_hdr, IRDMAQPSQ_UDPHEADER) | - LS_64(info->l4len, IRDMAQPSQ_L4LEN) | - LS_64(qp->swqe_polarity, IRDMAQPSQ_VALID); + FIELD_PREP(IRDMAQPSQ_DESTQKEY, op_info->qkey) | + FIELD_PREP(IRDMAQPSQ_DESTQPN, op_info->dest_qp)); + hdr = FIELD_PREP(IRDMAQPSQ_REMSTAG, info->stag_to_inv) | + FIELD_PREP(IRDMAQPSQ_AHID, op_info->ah_id) | + FIELD_PREP(IRDMAQPSQ_IMMDATAFLAG, + (info->imm_data_valid ? 1 : 0)) | + FIELD_PREP(IRDMAQPSQ_REPORTRTT, (info->report_rtt ? 1 : 0)) | + FIELD_PREP(IRDMAQPSQ_OPCODE, info->op_type) | + FIELD_PREP(IRDMAQPSQ_ADDFRAGCNT, addl_frag_cnt) | + FIELD_PREP(IRDMAQPSQ_PUSHWQE, info->push_wqe) | + FIELD_PREP(IRDMAQPSQ_READFENCE, read_fence) | + FIELD_PREP(IRDMAQPSQ_LOCALFENCE, info->local_fence) | + FIELD_PREP(IRDMAQPSQ_SIGCOMPL, info->signaled) | + FIELD_PREP(IRDMAQPSQ_UDPHEADER, info->udp_hdr) | + FIELD_PREP(IRDMAQPSQ_L4LEN, info->l4len) | + FIELD_PREP(IRDMAQPSQ_VALID, qp->swqe_polarity); udma_to_device_barrier(); /* make sure WQE is populated before valid bit is set */ set_64bit_val(wqe, IRDMA_BYTE_24, hdr); - if (info->push_wqe) { + if (info->push_wqe) irdma_qp_push_wqe(qp, wqe, quanta, wqe_idx, post_sq); - } else { - if (post_sq) - irdma_uk_qp_post_wr(qp); - } + else if (post_sq) + irdma_uk_qp_post_wr(qp); return 0; } @@ -615,29 +607,45 @@ irdma_set_mw_bind_wqe_gen_1(__le64 * wqe, { set_64bit_val(wqe, IRDMA_BYTE_0, (uintptr_t)op_info->va); set_64bit_val(wqe, IRDMA_BYTE_8, - LS_64(op_info->mw_stag, IRDMAQPSQ_PARENTMRSTAG) | - LS_64(op_info->mr_stag, IRDMAQPSQ_MWSTAG)); + FIELD_PREP(IRDMAQPSQ_PARENTMRSTAG, op_info->mw_stag) | + FIELD_PREP(IRDMAQPSQ_MWSTAG, op_info->mr_stag)); set_64bit_val(wqe, IRDMA_BYTE_16, op_info->bind_len); } /** * irdma_copy_inline_data_gen_1 - Copy inline data to wqe - * @dest: pointer to wqe - * @src: pointer to inline data - * @len: length of inline data to copy + * @wqe: pointer to wqe + * @sge_list: table of pointers to inline data + * @num_sges: Total inline data length * @polarity: compatibility parameter */ static void -irdma_copy_inline_data_gen_1(u8 *dest, u8 *src, u32 len, - u8 polarity) +irdma_copy_inline_data_gen_1(u8 *wqe, struct irdma_sge *sge_list, + u32 num_sges, u8 polarity) { - if (len <= IRDMA_BYTE_16) { - irdma_memcpy(dest, src, len); - } else { *** 14300 LINES SKIPPED *** From nobody Wed Feb 8 00:26:20 2023 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 4PBLQP0X9sz3p8wC; Wed, 8 Feb 2023 00:26: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 4PBLQN6k0Tz41qn; Wed, 8 Feb 2023 00:26:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675815981; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=38mO1vUyh0feTuGqIIsn3MttP00GM4GNouRJr+W8QHA=; b=UPCuve1Ys7A1Yw0fQvxakd7xt+EGov0h3fAU0O/zjPywhJcaYM8c7OmsQF0xwSMNU4/tZb +oB/XpLUe5ji8rwbYxRCl+1hv+1adEZno/J5/0ZwfkLDDM2wfsd/WLcXAPq5//wEA8G5Bm krpGy6adca6CPQylVcpzDeAI8YCALmPkndpgMEtpqaO5ZEfSnLd+oymMUNY7m0Zn9U0wFF avt9RzYuuTbk6OqzWoQXz+jz7/drnI5lwPsC5I5i/o+mRaS0Hfk73hSD/bmr6xG+RsEoBj 8cChfD89M1r6nhvixU0J71+AV9/7yqVpnMEFinPkZEJJVUyykIml3YExYxPw8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675815981; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=38mO1vUyh0feTuGqIIsn3MttP00GM4GNouRJr+W8QHA=; b=t5G280UooL0S4MIfW9iqY2dfipPQQAZ23yX+zxdEvW+tcQysAGKvq7jzEWQcaJRoSsiaMb wkfAkDKR3BcoXptFe0+cwDDqMlw/UccCbk8uOAXHf9mXzil48kNyf/C5H5FS9t1fb8vO8J +Rqx+rXUm2zxg085agjT9685RkCFUt92MbByxWoYFd3cczUnjaun/bGoCtaQL3nbeDCJRZ u8JdnDQtZQh6opn/TyF9s5JbuzYQZ1cXZ+bc5K99p2FDbHp4ghOcn/KPZ6z1MpeCJfXKwa npBBpHcsS5E+xwlW1hpv2JTLfi/KzBUP44UoUkdNZ1p3mPzGHUtYJdF4mABhyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675815981; a=rsa-sha256; cv=none; b=Eb8WYnhzUyRbQrdXBWB/TTznnZDPwvUY0kpN9GqZuum6rOJNYpsbUPGh+Hgy8f1jUE98jk up9qKRz7hvFlYqsNPx2v2RFO+1MCa2R0LvjcFd6XSsQ5W+tHnXIAs4E1ZeiUnIPLDKnomG c0quf8vggO9rHzHkfg7ggc4nhIpAv/ZHe6DJ4JadLPb27O6Ap5b0XxBvfwEAPCl8McVzEy IXYkqn7VxprcTLjfFiWtyj5sHaY+T2d/NUT2BpCCF+vZgnuq0q8PR0lDgV/OyZRkzlyuks 8DgY/b5ZWYQDdJ48Hq10SltNBBZuOoAfZSaHMxmjG2XV1sVrCQ+4oOW/qSqDdw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBLQN58f9zcpK; Wed, 8 Feb 2023 00:26:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3180QKrF096225; Wed, 8 Feb 2023 00:26:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3180QKwY096224; Wed, 8 Feb 2023 00:26:20 GMT (envelope-from git) Date: Wed, 8 Feb 2023 00:26:20 GMT Message-Id: <202302080026.3180QKwY096224@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: e675a260ceba - stable/13 - irdma(4): Add code for compilation on stable/13 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: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e675a260ceba9b110d66fa9dd78d60ef23fc4439 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=e675a260ceba9b110d66fa9dd78d60ef23fc4439 commit e675a260ceba9b110d66fa9dd78d60ef23fc4439 Author: Bartosz Sobczak AuthorDate: 2023-02-06 22:37:39 +0000 Commit: Eric Joyner CommitDate: 2023-02-08 00:24:11 +0000 irdma(4): Add code for compilation on stable/13 branch Current content of the irdma(4) driver consists only of code that is compilable on current 14-CURRENT branch which makes it impossible to merge into stable/13 branch because of missing dependencies in the ofed tree. This patch adds missing code that allows for merging into stable branch. Once it is there, code relating only to version 14 or higher should be removed. Signed-off-by: Eric Joyner Reviewed by: erj@ MFC after: 1 day Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D38170 (cherry picked from commit a527c18cd7ba5d4afacbfb85817ca7b8b2487b52) --- contrib/ofed/libirdma/osdep.h | 3 + sys/dev/irdma/fbsd_kcompat.h | 70 +++++ sys/dev/irdma/irdma_kcompat.c | 609 +++++++++++++++++++++++++++++++++++++++++- sys/dev/irdma/irdma_main.h | 4 + sys/dev/irdma/irdma_verbs.c | 194 +++++++++++++- sys/dev/irdma/irdma_verbs.h | 24 ++ sys/dev/irdma/osdep.h | 3 + 7 files changed, 893 insertions(+), 14 deletions(-) diff --git a/contrib/ofed/libirdma/osdep.h b/contrib/ofed/libirdma/osdep.h index 4c226c8e5992..2cb4f8d57cb5 100644 --- a/contrib/ofed/libirdma/osdep.h +++ b/contrib/ofed/libirdma/osdep.h @@ -102,6 +102,9 @@ #define __aligned_u64 uint64_t __aligned(8) #define VLAN_PRIO_SHIFT 13 +#if __FreeBSD_version < 1400000 +#define IB_USER_VERBS_EX_CMD_MODIFY_QP IB_USER_VERBS_CMD_MODIFY_QP +#endif /* * debug definition section diff --git a/sys/dev/irdma/fbsd_kcompat.h b/sys/dev/irdma/fbsd_kcompat.h index 3b03189e41af..1e0544738d7e 100644 --- a/sys/dev/irdma/fbsd_kcompat.h +++ b/sys/dev/irdma/fbsd_kcompat.h @@ -50,12 +50,14 @@ container_of(callback_tasklet, typeof(*var), tasklet_fieldname) #endif +#if __FreeBSD_version >= 1400000 #define IRDMA_SET_RDMA_OBJ_SIZE(ib_struct, drv_struct, member) \ (sizeof(struct drv_struct) + \ BUILD_BUG_ON_ZERO(offsetof(struct drv_struct, member)) + \ BUILD_BUG_ON_ZERO( \ !__same_type(((struct drv_struct *)NULL)->member, \ struct ib_struct))) +#endif /* __FreeBSD_version > 1400000 */ #define set_ibdev_dma_device(ibdev, dev) \ ibdev.dma_device = (dev) @@ -69,11 +71,20 @@ #define kmap_local_page(pg) page_address(pg) #define kunmap(pg) #define kunmap_local(pg) +#if __FreeBSD_version >= 1400026 #define kc_free_lsmm_dereg_mr(iwdev, iwqp) \ ((iwdev)->ibdev.dereg_mr((iwqp)->lsmm_mr, NULL)) +#else +#define kc_free_lsmm_dereg_mr(iwdev, iwqp) \ + ((iwdev)->ibdev.dereg_mr((iwqp)->lsmm_mr)) +#endif #define IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION IB_CQ_FLAGS_TIMESTAMP_COMPLETION +#if __FreeBSD_version < 1400026 +#define kc_irdma_destroy_qp(ibqp, udata) irdma_destroy_qp(ibqp) +#else #define kc_irdma_destroy_qp(ibqp, udata) irdma_destroy_qp(ibqp, udata) +#endif #ifndef IB_QP_ATTR_STANDARD_BITS #define IB_QP_ATTR_STANDARD_BITS GENMASK(20, 0) #endif @@ -119,24 +130,53 @@ static inline u64 *irdma_next_pbl_addr(u64 *pbl, struct irdma_pble_info **pinfo, return (*pinfo)->addr; } +#if __FreeBSD_version < 1400026 +struct ib_cq *irdma_create_cq(struct ib_device *ibdev, + const struct ib_cq_init_attr *attr, + struct ib_ucontext *context, + struct ib_udata *udata); +#else int irdma_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr, struct ib_udata *udata); +#endif struct ib_qp *irdma_create_qp(struct ib_pd *ibpd, struct ib_qp_init_attr *init_attr, struct ib_udata *udata); +#if __FreeBSD_version >= 1400026 int irdma_create_ah(struct ib_ah *ib_ah, struct ib_ah_attr *attr, u32 flags, struct ib_udata *udata); int irdma_create_ah_stub(struct ib_ah *ib_ah, struct ib_ah_attr *attr, u32 flags, struct ib_udata *udata); +#else +struct ib_ah *irdma_create_ah(struct ib_pd *ibpd, + struct ib_ah_attr *attr, + struct ib_udata *udata); +struct ib_ah *irdma_create_ah_stub(struct ib_pd *ibpd, + struct ib_ah_attr *attr, + struct ib_udata *udata); +#endif void irdma_ether_copy(u8 *dmac, struct ib_ah_attr *attr); +#if __FreeBSD_version >= 1400026 void irdma_destroy_ah(struct ib_ah *ibah, u32 flags); void irdma_destroy_ah_stub(struct ib_ah *ibah, u32 flags); +#else +int irdma_destroy_ah(struct ib_ah *ibah); +int irdma_destroy_ah_stub(struct ib_ah *ibah); +#endif +#if __FreeBSD_version < 1400026 +int irdma_destroy_qp(struct ib_qp *ibqp); +#else int irdma_destroy_qp(struct ib_qp *ibqp, struct ib_udata *udata); +#endif +#if __FreeBSD_version < 1400026 +int irdma_dereg_mr(struct ib_mr *ib_mr); +#else int irdma_dereg_mr(struct ib_mr *ib_mr, struct ib_udata *udata); +#endif void irdma_get_eth_speed_and_width(u32 link_speed, u8 *active_speed, u8 *active_width); enum rdma_link_layer irdma_get_link_layer(struct ib_device *ibdev, @@ -163,6 +203,10 @@ int irdma_register_qset(struct irdma_sc_vsi *vsi, void irdma_unregister_qset(struct irdma_sc_vsi *vsi, struct irdma_ws_node *tc_node); void ib_unregister_device(struct ib_device *ibdev); +#if __FreeBSD_version < 1400026 +int rdma_user_mmap_io(struct ib_ucontext *ucontext, struct vm_area_struct *vma, + unsigned long pfn, unsigned long size, pgprot_t prot); +#endif void irdma_disassociate_ucontext(struct ib_ucontext *context); int kc_irdma_set_roce_cm_info(struct irdma_qp *iwqp, struct ib_qp_attr *attr, @@ -196,8 +240,13 @@ int irdma_rereg_user_mr(struct ib_mr *ib_mr, int flags, u64 start, u64 len, struct irdma_mr; struct irdma_cq; struct irdma_cq_buf; +#if __FreeBSD_version < 1400026 +struct ib_mr *irdma_alloc_mr(struct ib_pd *pd, enum ib_mr_type mr_type, + u32 max_num_sg); +#else struct ib_mr *irdma_alloc_mr(struct ib_pd *pd, enum ib_mr_type mr_type, u32 max_num_sg, struct ib_udata *udata); +#endif int irdma_hwreg_mr(struct irdma_device *iwdev, struct irdma_mr *iwmr, u16 access); struct ib_mr *irdma_rereg_mr_trans(struct irdma_mr *iwmr, u64 start, u64 len, @@ -230,11 +279,32 @@ void irdma_dealloc_push_page(struct irdma_pci_f *rf, struct irdma_sc_qp *qp); int irdma_process_resize_list(struct irdma_cq *iwcq, struct irdma_device *iwdev, struct irdma_cq_buf *lcqe_buf); +#if __FreeBSD_version < 1400026 +int irdma_destroy_cq(struct ib_cq *ib_cq); +#else void irdma_destroy_cq(struct ib_cq *ib_cq, struct ib_udata *udata); +#endif +#if __FreeBSD_version < 1400026 +struct ib_ucontext *irdma_alloc_ucontext(struct ib_device *, struct ib_udata *); +#else int irdma_alloc_ucontext(struct ib_ucontext *uctx, struct ib_udata *udata); +#endif +#if __FreeBSD_version < 1400026 +int irdma_dealloc_ucontext(struct ib_ucontext *); +#else void irdma_dealloc_ucontext(struct ib_ucontext *context); +#endif +#if __FreeBSD_version < 1400026 +struct ib_pd *irdma_alloc_pd(struct ib_device *, struct ib_ucontext *, + struct ib_udata *); +#else int irdma_alloc_pd(struct ib_pd *pd, struct ib_udata *udata); +#endif +#if __FreeBSD_version < 1400026 +int irdma_dealloc_pd(struct ib_pd *); +#else void irdma_dealloc_pd(struct ib_pd *ibpd, struct ib_udata *udata); +#endif int irdma_add_gid(struct ib_device *, u8, unsigned int, const union ib_gid *, const struct ib_gid_attr *, void **); int irdma_del_gid(struct ib_device *, u8, unsigned int, void **); diff --git a/sys/dev/irdma/irdma_kcompat.c b/sys/dev/irdma/irdma_kcompat.c index d0cf960b5147..d49293aedd78 100644 --- a/sys/dev/irdma/irdma_kcompat.c +++ b/sys/dev/irdma/irdma_kcompat.c @@ -97,6 +97,7 @@ irdma_del_gid(struct ib_device *device, return 0; } +#if __FreeBSD_version >= 1400026 /** * irdma_alloc_mr - register stag for fast memory registration * @pd: ibpd pointer @@ -108,6 +109,18 @@ struct ib_mr * irdma_alloc_mr(struct ib_pd *pd, enum ib_mr_type mr_type, u32 max_num_sg, struct ib_udata *udata) { +#else +/** + * irdma_alloc_mr - register stag for fast memory registration + * @pd: ibpd pointer + * @mr_type: memory for stag registrion + * @max_num_sg: man number of pages + */ +struct ib_mr * +irdma_alloc_mr(struct ib_pd *pd, enum ib_mr_type mr_type, + u32 max_num_sg) +{ +#endif struct irdma_device *iwdev = to_iwdev(pd->device); struct irdma_pble_alloc *palloc; struct irdma_pbl *iwpbl; @@ -162,6 +175,7 @@ err: #define IRDMA_ALLOC_UCTX_MIN_REQ_LEN offsetofend(struct irdma_alloc_ucontext_req, rsvd8) #define IRDMA_ALLOC_UCTX_MIN_RESP_LEN offsetofend(struct irdma_alloc_ucontext_resp, rsvd) +#if __FreeBSD_version >= 1400026 /** * irdma_alloc_ucontext - Allocate the user context data structure * @uctx: context @@ -253,7 +267,116 @@ ver_error: req.userspace_ver, IRDMA_ABI_VER); return -EINVAL; } +#endif +#if __FreeBSD_version < 1400026 +/** + * irdma_alloc_ucontext - Allocate the user context data structure + * @ibdev: ib device pointer + * @udata: user data + * + * This keeps track of all objects associated with a particular + * user-mode client. + */ +struct ib_ucontext * +irdma_alloc_ucontext(struct ib_device *ibdev, struct ib_udata *udata) +{ + struct irdma_device *iwdev = to_iwdev(ibdev); + struct irdma_alloc_ucontext_req req = {0}; + struct irdma_alloc_ucontext_resp uresp = {0}; + struct irdma_ucontext *ucontext; + struct irdma_uk_attrs *uk_attrs; + + if (udata->inlen < IRDMA_ALLOC_UCTX_MIN_REQ_LEN || + udata->outlen < IRDMA_ALLOC_UCTX_MIN_RESP_LEN) + return ERR_PTR(-EINVAL); + + if (ib_copy_from_udata(&req, udata, min(sizeof(req), udata->inlen))) + return ERR_PTR(-EINVAL); + + if (req.userspace_ver < 4 || req.userspace_ver > IRDMA_ABI_VER) + goto ver_error; + + ucontext = kzalloc(sizeof(*ucontext), GFP_KERNEL); + if (!ucontext) + return ERR_PTR(-ENOMEM); + + ucontext->iwdev = iwdev; + ucontext->abi_ver = req.userspace_ver; + + uk_attrs = &iwdev->rf->sc_dev.hw_attrs.uk_attrs; + /* GEN_1 legacy support with libi40iw */ + if (udata->outlen == IRDMA_ALLOC_UCTX_MIN_RESP_LEN) { + if (uk_attrs->hw_rev != IRDMA_GEN_1) { + kfree(ucontext); + return ERR_PTR(-EOPNOTSUPP); + } + + ucontext->legacy_mode = true; + uresp.max_qps = iwdev->rf->max_qp; + uresp.max_pds = iwdev->rf->sc_dev.hw_attrs.max_hw_pds; + uresp.wq_size = iwdev->rf->sc_dev.hw_attrs.max_qp_wr * 2; + uresp.kernel_ver = req.userspace_ver; + if (ib_copy_to_udata(udata, &uresp, min(sizeof(uresp), udata->outlen))) { + kfree(ucontext); + return ERR_PTR(-EFAULT); + } + } else { + u64 bar_off; + + uresp.kernel_ver = IRDMA_ABI_VER; + uresp.feature_flags = uk_attrs->feature_flags; + uresp.max_hw_wq_frags = uk_attrs->max_hw_wq_frags; + uresp.max_hw_read_sges = uk_attrs->max_hw_read_sges; + uresp.max_hw_inline = uk_attrs->max_hw_inline; + uresp.max_hw_rq_quanta = uk_attrs->max_hw_rq_quanta; + uresp.max_hw_wq_quanta = uk_attrs->max_hw_wq_quanta; + uresp.max_hw_sq_chunk = uk_attrs->max_hw_sq_chunk; + uresp.max_hw_cq_size = uk_attrs->max_hw_cq_size; + uresp.min_hw_cq_size = uk_attrs->min_hw_cq_size; + uresp.hw_rev = uk_attrs->hw_rev; + + bar_off = + (uintptr_t)iwdev->rf->sc_dev.hw_regs[IRDMA_DB_ADDR_OFFSET]; + + spin_lock_init(&ucontext->mmap_tbl_lock); + ucontext->db_mmap_entry = + irdma_user_mmap_entry_add_hash(ucontext, bar_off, + IRDMA_MMAP_IO_NC, + &uresp.db_mmap_key); + if (!ucontext->db_mmap_entry) { + spin_lock_destroy(&ucontext->mmap_tbl_lock); + kfree(ucontext); + return ERR_PTR(-ENOMEM); + } + + if (ib_copy_to_udata(udata, &uresp, + min(sizeof(uresp), udata->outlen))) { + irdma_user_mmap_entry_del_hash(ucontext->db_mmap_entry); + spin_lock_destroy(&ucontext->mmap_tbl_lock); + kfree(ucontext); + return ERR_PTR(-EFAULT); + } + } + + INIT_LIST_HEAD(&ucontext->cq_reg_mem_list); + spin_lock_init(&ucontext->cq_reg_mem_list_lock); + INIT_LIST_HEAD(&ucontext->qp_reg_mem_list); + spin_lock_init(&ucontext->qp_reg_mem_list_lock); + INIT_LIST_HEAD(&ucontext->vma_list); + mutex_init(&ucontext->vma_list_mutex); + + return &ucontext->ibucontext; + +ver_error: + ibdev_err(&iwdev->ibdev, + "Invalid userspace driver version detected. Detected version %d, should be %d\n", + req.userspace_ver, IRDMA_ABI_VER); + return ERR_PTR(-EINVAL); +} +#endif + +#if __FreeBSD_version >= 1400026 /** * irdma_dealloc_ucontext - deallocate the user context data structure * @context: user context created during alloc @@ -267,8 +390,28 @@ irdma_dealloc_ucontext(struct ib_ucontext *context) return; } +#endif + +#if __FreeBSD_version < 1400026 +/** + * irdma_dealloc_ucontext - deallocate the user context data structure + * @context: user context created during alloc + */ +int +irdma_dealloc_ucontext(struct ib_ucontext *context) +{ + struct irdma_ucontext *ucontext = to_ucontext(context); + + irdma_user_mmap_entry_del_hash(ucontext->db_mmap_entry); + spin_lock_destroy(&ucontext->mmap_tbl_lock); + kfree(ucontext); + + return 0; +} +#endif #define IRDMA_ALLOC_PD_MIN_RESP_LEN offsetofend(struct irdma_alloc_pd_resp, rsvd) +#if __FreeBSD_version >= 1400026 /** * irdma_alloc_pd - allocate protection domain * @pd: protection domain @@ -319,7 +462,67 @@ error: return err; } +#endif + +#if __FreeBSD_version < 1400026 +/** + * irdma_alloc_pd - allocate protection domain + * @ibdev: IB device + * @context: user context + * @udata: user data + */ +struct ib_pd * +irdma_alloc_pd(struct ib_device *ibdev, struct ib_ucontext *context, struct ib_udata *udata) +{ + struct irdma_pd *iwpd; + struct irdma_device *iwdev = to_iwdev(ibdev); + struct irdma_sc_dev *dev = &iwdev->rf->sc_dev; + struct irdma_pci_f *rf = iwdev->rf; + struct irdma_alloc_pd_resp uresp = {0}; + struct irdma_sc_pd *sc_pd; + u32 pd_id = 0; + int err; + + err = irdma_alloc_rsrc(rf, rf->allocated_pds, rf->max_pd, &pd_id, + &rf->next_pd); + if (err) + return ERR_PTR(err); + + iwpd = kzalloc(sizeof(*iwpd), GFP_KERNEL); + if (!iwpd) { + err = -ENOMEM; + goto free_res; + } + + sc_pd = &iwpd->sc_pd; + if (udata) { + struct irdma_ucontext *ucontext = to_ucontext(context); + + irdma_sc_pd_init(dev, sc_pd, pd_id, ucontext->abi_ver); + uresp.pd_id = pd_id; + if (ib_copy_to_udata(udata, &uresp, + min(sizeof(uresp), udata->outlen))) { + err = -EFAULT; + goto error; + } + } else { + irdma_sc_pd_init(dev, sc_pd, pd_id, IRDMA_ABI_VER); + } + + return &iwpd->ibpd; + +error: + kfree(iwpd); +free_res: + + irdma_free_rsrc(rf, rf->allocated_pds, pd_id); + return ERR_PTR(err); +} + +#endif + +#if __FreeBSD_version >= 1400026 void irdma_dealloc_pd(struct ib_pd *ibpd, struct ib_udata *udata) { @@ -329,6 +532,21 @@ irdma_dealloc_pd(struct ib_pd *ibpd, struct ib_udata *udata) irdma_free_rsrc(iwdev->rf, iwdev->rf->allocated_pds, iwpd->sc_pd.pd_id); } +#endif + +#if __FreeBSD_version < 1400026 +int +irdma_dealloc_pd(struct ib_pd *ibpd) +{ + struct irdma_pd *iwpd = to_iwpd(ibpd); + struct irdma_device *iwdev = to_iwdev(ibpd->device); + + irdma_free_rsrc(iwdev->rf, iwdev->rf->allocated_pds, iwpd->sc_pd.pd_id); + kfree(iwpd); + return 0; +} +#endif + static void irdma_fill_ah_info(struct vnet *vnet, struct irdma_ah_info *ah_info, const struct ib_gid_attr *sgid_attr, @@ -416,6 +634,7 @@ irdma_create_ah_wait(struct irdma_pci_f *rf, #define IRDMA_CREATE_AH_MIN_RESP_LEN offsetofend(struct irdma_create_ah_resp, rsvd) +#if __FreeBSD_version >= 1400026 /** * irdma_create_ah - create address handle * @ib_ah: ptr to AH @@ -539,6 +758,7 @@ err_gid_l2: return err; } +#endif void irdma_ether_copy(u8 *dmac, struct ib_ah_attr *attr) @@ -546,19 +766,172 @@ irdma_ether_copy(u8 *dmac, struct ib_ah_attr *attr) ether_addr_copy(dmac, attr->dmac); } +#if __FreeBSD_version < 1400026 +struct ib_ah * +irdma_create_ah_stub(struct ib_pd *ibpd, + struct ib_ah_attr *attr, + struct ib_udata *udata) +#else int irdma_create_ah_stub(struct ib_ah *ib_ah, struct ib_ah_attr *attr, u32 flags, struct ib_udata *udata) +#endif { +#if __FreeBSD_version >= 1400026 return -ENOSYS; +#else + return ERR_PTR(-ENOSYS); +#endif } +#if __FreeBSD_version >= 1400026 void irdma_destroy_ah_stub(struct ib_ah *ibah, u32 flags) { return; } +#else +int +irdma_destroy_ah_stub(struct ib_ah *ibah) +{ + return -ENOSYS; +} +#endif + +#if __FreeBSD_version < 1400026 +/** + * irdma_create_ah - create address handle + * @ibpd: ptr to pd + * @attr: address handle attributes + * @udata: user data + * + * returns a pointer to an address handle + */ +struct ib_ah * +irdma_create_ah(struct ib_pd *ibpd, + struct ib_ah_attr *attr, + struct ib_udata *udata) +{ + struct irdma_pd *pd = to_iwpd(ibpd); + struct irdma_device *iwdev = to_iwdev(ibpd->device); + struct irdma_ah *ah; + union ib_gid sgid; + struct ib_gid_attr sgid_attr; + struct irdma_pci_f *rf = iwdev->rf; + struct irdma_sc_ah *sc_ah; + u32 ah_id = 0; + struct irdma_ah_info *ah_info; + struct irdma_create_ah_resp uresp; + union { + struct sockaddr saddr; + struct sockaddr_in saddr_in; + struct sockaddr_in6 saddr_in6; + } sgid_addr, dgid_addr; + int err; + u8 dmac[ETH_ALEN]; + bool sleep = udata ? true : false; + + if (udata && udata->outlen < IRDMA_CREATE_AH_MIN_RESP_LEN) + return ERR_PTR(-EINVAL); + + err = irdma_alloc_rsrc(rf, rf->allocated_ahs, + rf->max_ah, &ah_id, &rf->next_ah); + + if (err) + return ERR_PTR(err); + + ah = kzalloc(sizeof(*ah), GFP_ATOMIC); + if (!ah) { + irdma_free_rsrc(rf, rf->allocated_ahs, ah_id); + return ERR_PTR(-ENOMEM); + } + + ah->pd = pd; + sc_ah = &ah->sc_ah; + sc_ah->ah_info.ah_idx = ah_id; + sc_ah->ah_info.vsi = &iwdev->vsi; + irdma_sc_init_ah(&rf->sc_dev, sc_ah); + ah->sgid_index = attr->grh.sgid_index; + memcpy(&ah->dgid, &attr->grh.dgid, sizeof(ah->dgid)); + rcu_read_lock(); + err = ib_get_cached_gid(&iwdev->ibdev, attr->port_num, + attr->grh.sgid_index, &sgid, &sgid_attr); + rcu_read_unlock(); + if (err) { + irdma_debug(iwdev_to_idev(iwdev), IRDMA_DEBUG_VERBS, + "GID lookup at idx=%d with port=%d failed\n", + attr->grh.sgid_index, attr->port_num); + err = -EINVAL; + goto err_gid_l2; + } + rdma_gid2ip((struct sockaddr *)&sgid_addr, &sgid); + rdma_gid2ip((struct sockaddr *)&dgid_addr, &attr->grh.dgid); + ah->av.attrs = *attr; + ah->av.net_type = kc_rdma_gid_attr_network_type(sgid_attr, + sgid_attr.gid_type, + &sgid); + + if (sgid_attr.ndev) + dev_put(sgid_attr.ndev); + + ah->av.sgid_addr.saddr = sgid_addr.saddr; + ah->av.dgid_addr.saddr = dgid_addr.saddr; + ah_info = &sc_ah->ah_info; + ah_info->ah_idx = ah_id; + ah_info->pd_idx = pd->sc_pd.pd_id; + + ether_addr_copy(ah_info->mac_addr, IF_LLADDR(iwdev->netdev)); + if (attr->ah_flags & IB_AH_GRH) { + ah_info->flow_label = attr->grh.flow_label; + ah_info->hop_ttl = attr->grh.hop_limit; + ah_info->tc_tos = attr->grh.traffic_class; + } + + if (udata) + ib_resolve_eth_dmac(ibpd->device, attr); + irdma_ether_copy(dmac, attr); + + irdma_fill_ah_info(iwdev->netdev->if_vnet, ah_info, &sgid_attr, &sgid_addr.saddr, &dgid_addr.saddr, + dmac, ah->av.net_type); + + err = irdma_create_ah_vlan_tag(iwdev, ah_info, &sgid_attr, dmac); + if (err) + goto err_gid_l2; + + err = irdma_ah_cqp_op(iwdev->rf, sc_ah, IRDMA_OP_AH_CREATE, + sleep, irdma_gsi_ud_qp_ah_cb, sc_ah); + if (err) { + irdma_debug(iwdev_to_idev(iwdev), IRDMA_DEBUG_VERBS, + "CQP-OP Create AH fail"); + goto err_gid_l2; + } + + err = irdma_create_ah_wait(rf, sc_ah, sleep); + if (err) { + irdma_debug(iwdev_to_idev(iwdev), IRDMA_DEBUG_VERBS, + "CQP create AH timed out"); + goto err_gid_l2; + } + + if (udata) { + uresp.ah_id = ah->sc_ah.ah_info.ah_idx; + err = ib_copy_to_udata(udata, &uresp, sizeof(uresp)); + if (err) { + irdma_ah_cqp_op(iwdev->rf, &ah->sc_ah, + IRDMA_OP_AH_DESTROY, false, NULL, ah); + goto err_gid_l2; + } + } + + return &ah->ibah; +err_gid_l2: + kfree(ah); + irdma_free_rsrc(iwdev->rf, iwdev->rf->allocated_ahs, ah_id); + + return ERR_PTR(err); +} +#endif /** * irdma_free_qp_rsrc - free up memory resources for qp @@ -797,8 +1170,13 @@ error: * @ibqp: qp's ib pointer also to get to device's qp address * @udata: user data */ +#if __FreeBSD_version >= 1400026 int irdma_destroy_qp(struct ib_qp *ibqp, struct ib_udata *udata) +#else +int +irdma_destroy_qp(struct ib_qp *ibqp) +#endif { struct irdma_qp *iwqp = to_iwqp(ibqp); struct irdma_device *iwdev = iwqp->iwdev; @@ -835,17 +1213,31 @@ free_rsrc: * @attr: attributes for cq * @udata: user data */ +#if __FreeBSD_version >= 1400026 int irdma_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr, struct ib_udata *udata) +#else +struct ib_cq * +irdma_create_cq(struct ib_device *ibdev, + const struct ib_cq_init_attr *attr, + struct ib_ucontext *context, + struct ib_udata *udata) +#endif { #define IRDMA_CREATE_CQ_MIN_REQ_LEN offsetofend(struct irdma_create_cq_req, user_cq_buf) #define IRDMA_CREATE_CQ_MIN_RESP_LEN offsetofend(struct irdma_create_cq_resp, cq_size) +#if __FreeBSD_version >= 1400026 struct ib_device *ibdev = ibcq->device; +#endif struct irdma_device *iwdev = to_iwdev(ibdev); struct irdma_pci_f *rf = iwdev->rf; +#if __FreeBSD_version >= 1400026 struct irdma_cq *iwcq = to_iwcq(ibcq); +#else + struct irdma_cq *iwcq; +#endif u32 cq_num = 0; struct irdma_sc_cq *cq; struct irdma_sc_dev *dev = &rf->sc_dev; @@ -859,6 +1251,7 @@ irdma_create_cq(struct ib_cq *ibcq, int entries = attr->cqe; bool cqe_64byte_ena; +#if __FreeBSD_version >= 1400026 err_code = cq_validate_flags(attr->flags, dev->hw_attrs.uk_attrs.hw_rev); if (err_code) return err_code; @@ -866,10 +1259,27 @@ irdma_create_cq(struct ib_cq *ibcq, if (udata && (udata->inlen < IRDMA_CREATE_CQ_MIN_REQ_LEN || udata->outlen < IRDMA_CREATE_CQ_MIN_RESP_LEN)) return -EINVAL; +#else + err_code = cq_validate_flags(attr->flags, dev->hw_attrs.uk_attrs.hw_rev); + if (err_code) + return ERR_PTR(err_code); + + if (udata && (udata->inlen < IRDMA_CREATE_CQ_MIN_REQ_LEN || + udata->outlen < IRDMA_CREATE_CQ_MIN_RESP_LEN)) + return ERR_PTR(-EINVAL); + + iwcq = kzalloc(sizeof(*iwcq), GFP_KERNEL); + if (!iwcq) + return ERR_PTR(-ENOMEM); +#endif err_code = irdma_alloc_rsrc(rf, rf->allocated_cqs, rf->max_cq, &cq_num, &rf->next_cq); if (err_code) +#if __FreeBSD_version >= 1400026 return err_code; +#else + goto error; +#endif cq = &iwcq->sc_cq; cq->back_cq = iwcq; atomic_set(&iwcq->refcnt, 1); @@ -898,7 +1308,11 @@ irdma_create_cq(struct ib_cq *ibcq, struct irdma_cq_mr *cqmr_shadow; iwcq->user_mode = true; +#if __FreeBSD_version >= 1400026 ucontext = rdma_udata_to_drv_context(udata, struct irdma_ucontext, ibucontext); +#else + ucontext = to_ucontext(context); +#endif if (ib_copy_from_udata(&req, udata, min(sizeof(req), udata->inlen))) { @@ -1030,12 +1444,22 @@ irdma_create_cq(struct ib_cq *ibcq, rf->cq_table[cq_num] = iwcq; init_completion(&iwcq->free_cq); +#if __FreeBSD_version >= 1400026 return 0; +#else + return &iwcq->ibcq; +#endif cq_destroy: irdma_cq_wq_destroy(rf, cq); cq_free_rsrc: irdma_cq_free_rsrc(rf, iwcq); +#if __FreeBSD_version >= 1400026 return err_code; +#else +error: + kfree(iwcq); + return ERR_PTR(err_code); +#endif } /** @@ -1085,6 +1509,7 @@ irdma_copy_user_pgaddrs(struct irdma_mr *iwmr, u64 *pbl, * @ah_flags: destroy flags */ +#if __FreeBSD_version >= 1400026 void irdma_destroy_ah(struct ib_ah *ibah, u32 ah_flags) { @@ -1097,9 +1522,33 @@ irdma_destroy_ah(struct ib_ah *ibah, u32 ah_flags) irdma_free_rsrc(iwdev->rf, iwdev->rf->allocated_ahs, ah->sc_ah.ah_info.ah_idx); } +#endif +#if __FreeBSD_version < 1400026 +int +irdma_destroy_ah(struct ib_ah *ibah) +{ + struct irdma_device *iwdev = to_iwdev(ibah->device); + struct irdma_ah *ah = to_iwah(ibah); + + irdma_ah_cqp_op(iwdev->rf, &ah->sc_ah, IRDMA_OP_AH_DESTROY, + false, NULL, ah); + + irdma_free_rsrc(iwdev->rf, iwdev->rf->allocated_ahs, + ah->sc_ah.ah_info.ah_idx); + + kfree(ah); + return 0; +} +#endif + +#if __FreeBSD_version >= 1400026 int irdma_dereg_mr(struct ib_mr *ib_mr, struct ib_udata *udata) +#else +int +irdma_dereg_mr(struct ib_mr *ib_mr) +#endif { struct irdma_mr *iwmr = to_iwmr(ib_mr); struct irdma_device *iwdev = to_iwdev(ib_mr->device); @@ -1109,10 +1558,15 @@ irdma_dereg_mr(struct ib_mr *ib_mr, struct ib_udata *udata) if (iwmr->type != IRDMA_MEMREG_TYPE_MEM) { if (iwmr->region) { struct irdma_ucontext *ucontext; +#if __FreeBSD_version >= 1400026 + + ucontext = rdma_udata_to_drv_context(udata, struct irdma_ucontext, ibucontext); + +#else + struct ib_pd *ibpd = ib_mr->pd; - ucontext = rdma_udata_to_drv_context(udata, - struct irdma_ucontext, - ibucontext); + ucontext = to_ucontext(ibpd->uobject->context); +#endif irdma_del_memlist(iwmr, ucontext); } goto done; @@ -1219,6 +1673,7 @@ kc_irdma_set_roce_cm_info(struct irdma_qp *iwqp, struct ib_qp_attr *attr, return 0; } +#if __FreeBSD_version >= 1400026 /** * irdma_destroy_cq - destroy cq * @ib_cq: cq pointer @@ -1253,6 +1708,46 @@ irdma_destroy_cq(struct ib_cq *ib_cq, struct ib_udata *udata) irdma_cq_free_rsrc(iwdev->rf, iwcq); } +#endif +#if __FreeBSD_version < 1400026 +/** + * irdma_destroy_cq - destroy cq + * @ib_cq: cq pointer + */ +int +irdma_destroy_cq(struct ib_cq *ib_cq) +{ + struct irdma_device *iwdev = to_iwdev(ib_cq->device); + struct irdma_cq *iwcq = to_iwcq(ib_cq); + struct irdma_sc_cq *cq = &iwcq->sc_cq; + struct irdma_sc_dev *dev = cq->dev; + struct irdma_sc_ceq *ceq = dev->ceq[cq->ceq_id]; + struct irdma_ceq *iwceq = container_of(ceq, struct irdma_ceq, sc_ceq); + unsigned long flags; + + spin_lock_irqsave(&iwcq->lock, flags); + if (!list_empty(&iwcq->cmpl_generated)) + irdma_remove_cmpls_list(iwcq); + if (!list_empty(&iwcq->resize_list)) + irdma_process_resize_list(iwcq, iwdev, NULL); + spin_unlock_irqrestore(&iwcq->lock, flags); + + irdma_cq_rem_ref(ib_cq); + wait_for_completion(&iwcq->free_cq); + + irdma_cq_wq_destroy(iwdev->rf, cq); + + spin_lock_irqsave(&iwceq->ce_lock, flags); + irdma_sc_cleanup_ceqes(cq, ceq); + spin_unlock_irqrestore(&iwceq->ce_lock, flags); + + irdma_cq_free_rsrc(iwdev->rf, iwcq); + kfree(iwcq); + + return 0; +} + +#endif /** * irdma_alloc_mw - Allocate memory window * @pd: Protection domain @@ -1316,6 +1811,75 @@ kc_set_loc_seq_num_mss(struct irdma_cm_node *cm_node) (cm_node->iwdev->vsi.mtu - IRDMA_MTU_TO_MSS_IPV6); } +#if __FreeBSD_version < 1400026 +struct irdma_vma_data { + struct list_head list; + struct vm_area_struct *vma; + struct mutex *vma_list_mutex; /* protect the vma_list */ +}; + +/** + * irdma_vma_open - + * @vma: User VMA + */ +static void +irdma_vma_open(struct vm_area_struct *vma) +{ + vma->vm_ops = NULL; +} + +/** + * irdma_vma_close - Remove vma data from vma list + * @vma: User VMA + */ +static void +irdma_vma_close(struct vm_area_struct *vma) +{ + struct irdma_vma_data *vma_data; + + vma_data = vma->vm_private_data; + vma->vm_private_data = NULL; + vma_data->vma = NULL; + mutex_lock(vma_data->vma_list_mutex); + list_del(&vma_data->list); + mutex_unlock(vma_data->vma_list_mutex); + kfree(vma_data); +} + +static const struct vm_operations_struct irdma_vm_ops = { + .open = irdma_vma_open, + .close = irdma_vma_close +}; + +/** + * irdma_set_vma_data - Save vma data in context list + * @vma: User VMA + * @context: ib user context + */ +static int +irdma_set_vma_data(struct vm_area_struct *vma, + struct irdma_ucontext *context) +{ + struct list_head *vma_head = &context->vma_list; + struct irdma_vma_data *vma_entry; + + vma_entry = kzalloc(sizeof(*vma_entry), GFP_KERNEL); + if (!vma_entry) + return -ENOMEM; + + vma->vm_private_data = vma_entry; + vma->vm_ops = &irdma_vm_ops; + + vma_entry->vma = vma; + vma_entry->vma_list_mutex = &context->vma_list_mutex; + + mutex_lock(&context->vma_list_mutex); + list_add(&vma_entry->list, vma_head); + mutex_unlock(&context->vma_list_mutex); + + return 0; +} + /** * irdma_disassociate_ucontext - Disassociate user context * @context: ib user context @@ -1323,8 +1887,47 @@ kc_set_loc_seq_num_mss(struct irdma_cm_node *cm_node) void irdma_disassociate_ucontext(struct ib_ucontext *context) { + struct irdma_ucontext *ucontext = to_ucontext(context); + + struct irdma_vma_data *vma_data, *n; + struct vm_area_struct *vma; + *** 504 LINES SKIPPED *** From nobody Wed Feb 8 00:26:21 2023 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 4PBLQQ1hh3z3p8kr; Wed, 8 Feb 2023 00:26: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 4PBLQQ0THDz41tx; Wed, 8 Feb 2023 00:26:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675815982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mng3JP6TwyhQ0iYXYwC6hWnsN3PUdPEWmesBAm0KmBM=; b=Jj4IO2Pu1V/8bGUpr7bUEaujaw1Smm3Zi5P+VhPAbQy2/hCFRlHrdsiFhu/fYjV9ITv3xI t2fjC8NG1wJcI46thxYGsuehCzEcpjw2a0l3u9lA6ZzPrVkxh2XsTnUXGlsDwnRCJLjnch S1CLO8uBcLmHznRUqJan8b42IuGGfFEo6fBQEcdhG1rBWmZw/CzVg6KFSP8TsdpAdQKt5f y/rjTw0cnOpIxUwxLaJ6AYIH3t7ssMLNUtaOrrG8iJCdqiOALiu75TVZzBHG3tPe7sq3cc x8+ehwXk0jZFUbftoX+KxxgoJM4dcnFyHMvzUlA/cA+K5xPwzuK0X6TnqwfNog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675815982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mng3JP6TwyhQ0iYXYwC6hWnsN3PUdPEWmesBAm0KmBM=; b=ydYLrD2nP4drBm/fOoSKiRlKwlsDcxqFM1awcauOowqY1/zMJwxJBKO96ehVA8h3EnvnuP Tj+goF3PTkjY6AtLWy8L1WIYZ6obdAtI8yt4AxCk3Mhp6LT1JjfhL6vHtG8vaOBZYZIxxo uegT70uhtwlaRjFruedrcUidrFRRpjEtqtlmnRUhZS4XUnTJ3C67hnOQQ+fBxCt45P50eK rxUUwc0CzUZpYCM/mjdQZxETEecTy3wmG4xpxBHTaTfLqGqMybkq9WhJX1tZaxWb1c3+LW 3oMDhl6dF35NhRAUytmV/O9AQ3TO+KDDd2v3mIzo9lQmETSpbYuDyRjEmHL+tg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675815982; a=rsa-sha256; cv=none; b=h4QePOR548kjHGIiRt5Bgl1QjgIbTMPKnUhb9h0it0lTeEh9UenErHlVMbSJHrycBv2t98 np6ErepmarW11C+Xt+ohaiOJNpyQ8IW8Pwrmyqo1VX/Rl0hbQxyKyymeiMNFaDfBKl9e0d bC194wuxLmWE60iZVKbOnfP93l99qtAMGadSBEisTim/y4ED24AqpcslmZQssSwG3GAAIi G5X1+zN+aGX/X9sld+VHYVG9Isw7czfmoWZmf+cTJeQlWZX9FD4U0PvyetDmOLvPM4XaLF +bArUA12itFNh0Za2oXB1w15FzIPxN1HP/xlpLZoiFjWhcE04xvcci6Mv3k+Bw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBLQP5vCDzcv8; Wed, 8 Feb 2023 00:26:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3180QLm3096249; Wed, 8 Feb 2023 00:26:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3180QLpP096248; Wed, 8 Feb 2023 00:26:21 GMT (envelope-from git) Date: Wed, 8 Feb 2023 00:26:21 GMT Message-Id: <202302080026.3180QLpP096248@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: e7a0ef3217c6 - stable/13 - irdma(4): remove 14-current specific code 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: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e7a0ef3217c609081bd759ab809c44bb5a8db113 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=e7a0ef3217c609081bd759ab809c44bb5a8db113 commit e7a0ef3217c609081bd759ab809c44bb5a8db113 Author: Bartosz Sobczak AuthorDate: 2023-01-20 08:28:36 +0000 Commit: Eric Joyner CommitDate: 2023-02-08 00:24:17 +0000 irdma(4): remove 14-current specific code This is a direct commit to the stable/13 branch. Signed-off-by: Bartosz Sobczak Signed-off-by: Eric Joyner --- contrib/ofed/libirdma/osdep.h | 2 - sys/dev/irdma/fbsd_kcompat.h | 73 ------- sys/dev/irdma/irdma_kcompat.c | 468 ------------------------------------------ sys/dev/irdma/irdma_main.h | 12 -- sys/dev/irdma/irdma_verbs.c | 132 +----------- sys/dev/irdma/irdma_verbs.h | 19 -- sys/dev/irdma/osdep.h | 2 - 7 files changed, 1 insertion(+), 707 deletions(-) diff --git a/contrib/ofed/libirdma/osdep.h b/contrib/ofed/libirdma/osdep.h index 2cb4f8d57cb5..23bdbe805b01 100644 --- a/contrib/ofed/libirdma/osdep.h +++ b/contrib/ofed/libirdma/osdep.h @@ -102,9 +102,7 @@ #define __aligned_u64 uint64_t __aligned(8) #define VLAN_PRIO_SHIFT 13 -#if __FreeBSD_version < 1400000 #define IB_USER_VERBS_EX_CMD_MODIFY_QP IB_USER_VERBS_CMD_MODIFY_QP -#endif /* * debug definition section diff --git a/sys/dev/irdma/fbsd_kcompat.h b/sys/dev/irdma/fbsd_kcompat.h index 1e0544738d7e..7184818399c7 100644 --- a/sys/dev/irdma/fbsd_kcompat.h +++ b/sys/dev/irdma/fbsd_kcompat.h @@ -50,15 +50,6 @@ container_of(callback_tasklet, typeof(*var), tasklet_fieldname) #endif -#if __FreeBSD_version >= 1400000 -#define IRDMA_SET_RDMA_OBJ_SIZE(ib_struct, drv_struct, member) \ - (sizeof(struct drv_struct) + \ - BUILD_BUG_ON_ZERO(offsetof(struct drv_struct, member)) + \ - BUILD_BUG_ON_ZERO( \ - !__same_type(((struct drv_struct *)NULL)->member, \ - struct ib_struct))) -#endif /* __FreeBSD_version > 1400000 */ - #define set_ibdev_dma_device(ibdev, dev) \ ibdev.dma_device = (dev) #define set_max_sge(props, rf) \ @@ -71,20 +62,11 @@ #define kmap_local_page(pg) page_address(pg) #define kunmap(pg) #define kunmap_local(pg) -#if __FreeBSD_version >= 1400026 -#define kc_free_lsmm_dereg_mr(iwdev, iwqp) \ - ((iwdev)->ibdev.dereg_mr((iwqp)->lsmm_mr, NULL)) -#else #define kc_free_lsmm_dereg_mr(iwdev, iwqp) \ ((iwdev)->ibdev.dereg_mr((iwqp)->lsmm_mr)) -#endif #define IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION IB_CQ_FLAGS_TIMESTAMP_COMPLETION -#if __FreeBSD_version < 1400026 #define kc_irdma_destroy_qp(ibqp, udata) irdma_destroy_qp(ibqp) -#else -#define kc_irdma_destroy_qp(ibqp, udata) irdma_destroy_qp(ibqp, udata) -#endif #ifndef IB_QP_ATTR_STANDARD_BITS #define IB_QP_ATTR_STANDARD_BITS GENMASK(20, 0) #endif @@ -130,53 +112,25 @@ static inline u64 *irdma_next_pbl_addr(u64 *pbl, struct irdma_pble_info **pinfo, return (*pinfo)->addr; } -#if __FreeBSD_version < 1400026 struct ib_cq *irdma_create_cq(struct ib_device *ibdev, const struct ib_cq_init_attr *attr, struct ib_ucontext *context, struct ib_udata *udata); -#else -int irdma_create_cq(struct ib_cq *ibcq, - const struct ib_cq_init_attr *attr, - struct ib_udata *udata); -#endif struct ib_qp *irdma_create_qp(struct ib_pd *ibpd, struct ib_qp_init_attr *init_attr, struct ib_udata *udata); -#if __FreeBSD_version >= 1400026 -int irdma_create_ah(struct ib_ah *ib_ah, - struct ib_ah_attr *attr, u32 flags, - struct ib_udata *udata); -int irdma_create_ah_stub(struct ib_ah *ib_ah, - struct ib_ah_attr *attr, u32 flags, - struct ib_udata *udata); -#else struct ib_ah *irdma_create_ah(struct ib_pd *ibpd, struct ib_ah_attr *attr, struct ib_udata *udata); struct ib_ah *irdma_create_ah_stub(struct ib_pd *ibpd, struct ib_ah_attr *attr, struct ib_udata *udata); -#endif void irdma_ether_copy(u8 *dmac, struct ib_ah_attr *attr); -#if __FreeBSD_version >= 1400026 -void irdma_destroy_ah(struct ib_ah *ibah, u32 flags); -void irdma_destroy_ah_stub(struct ib_ah *ibah, u32 flags); -#else int irdma_destroy_ah(struct ib_ah *ibah); int irdma_destroy_ah_stub(struct ib_ah *ibah); -#endif -#if __FreeBSD_version < 1400026 int irdma_destroy_qp(struct ib_qp *ibqp); -#else -int irdma_destroy_qp(struct ib_qp *ibqp, struct ib_udata *udata); -#endif -#if __FreeBSD_version < 1400026 int irdma_dereg_mr(struct ib_mr *ib_mr); -#else -int irdma_dereg_mr(struct ib_mr *ib_mr, struct ib_udata *udata); -#endif void irdma_get_eth_speed_and_width(u32 link_speed, u8 *active_speed, u8 *active_width); enum rdma_link_layer irdma_get_link_layer(struct ib_device *ibdev, @@ -203,10 +157,8 @@ int irdma_register_qset(struct irdma_sc_vsi *vsi, void irdma_unregister_qset(struct irdma_sc_vsi *vsi, struct irdma_ws_node *tc_node); void ib_unregister_device(struct ib_device *ibdev); -#if __FreeBSD_version < 1400026 int rdma_user_mmap_io(struct ib_ucontext *ucontext, struct vm_area_struct *vma, unsigned long pfn, unsigned long size, pgprot_t prot); -#endif void irdma_disassociate_ucontext(struct ib_ucontext *context); int kc_irdma_set_roce_cm_info(struct irdma_qp *iwqp, struct ib_qp_attr *attr, @@ -240,13 +192,8 @@ int irdma_rereg_user_mr(struct ib_mr *ib_mr, int flags, u64 start, u64 len, struct irdma_mr; struct irdma_cq; struct irdma_cq_buf; -#if __FreeBSD_version < 1400026 struct ib_mr *irdma_alloc_mr(struct ib_pd *pd, enum ib_mr_type mr_type, u32 max_num_sg); -#else -struct ib_mr *irdma_alloc_mr(struct ib_pd *pd, enum ib_mr_type mr_type, - u32 max_num_sg, struct ib_udata *udata); -#endif int irdma_hwreg_mr(struct irdma_device *iwdev, struct irdma_mr *iwmr, u16 access); struct ib_mr *irdma_rereg_mr_trans(struct irdma_mr *iwmr, u64 start, u64 len, @@ -279,32 +226,12 @@ void irdma_dealloc_push_page(struct irdma_pci_f *rf, struct irdma_sc_qp *qp); int irdma_process_resize_list(struct irdma_cq *iwcq, struct irdma_device *iwdev, struct irdma_cq_buf *lcqe_buf); -#if __FreeBSD_version < 1400026 int irdma_destroy_cq(struct ib_cq *ib_cq); -#else -void irdma_destroy_cq(struct ib_cq *ib_cq, struct ib_udata *udata); -#endif -#if __FreeBSD_version < 1400026 struct ib_ucontext *irdma_alloc_ucontext(struct ib_device *, struct ib_udata *); -#else -int irdma_alloc_ucontext(struct ib_ucontext *uctx, struct ib_udata *udata); -#endif -#if __FreeBSD_version < 1400026 int irdma_dealloc_ucontext(struct ib_ucontext *); -#else -void irdma_dealloc_ucontext(struct ib_ucontext *context); -#endif -#if __FreeBSD_version < 1400026 struct ib_pd *irdma_alloc_pd(struct ib_device *, struct ib_ucontext *, struct ib_udata *); -#else -int irdma_alloc_pd(struct ib_pd *pd, struct ib_udata *udata); -#endif -#if __FreeBSD_version < 1400026 int irdma_dealloc_pd(struct ib_pd *); -#else -void irdma_dealloc_pd(struct ib_pd *ibpd, struct ib_udata *udata); -#endif int irdma_add_gid(struct ib_device *, u8, unsigned int, const union ib_gid *, const struct ib_gid_attr *, void **); int irdma_del_gid(struct ib_device *, u8, unsigned int, void **); diff --git a/sys/dev/irdma/irdma_kcompat.c b/sys/dev/irdma/irdma_kcompat.c index d49293aedd78..3b219eff1901 100644 --- a/sys/dev/irdma/irdma_kcompat.c +++ b/sys/dev/irdma/irdma_kcompat.c @@ -97,19 +97,6 @@ irdma_del_gid(struct ib_device *device, return 0; } -#if __FreeBSD_version >= 1400026 -/** - * irdma_alloc_mr - register stag for fast memory registration - * @pd: ibpd pointer - * @mr_type: memory for stag registrion - * @max_num_sg: man number of pages - * @udata: user data - */ -struct ib_mr * -irdma_alloc_mr(struct ib_pd *pd, enum ib_mr_type mr_type, - u32 max_num_sg, struct ib_udata *udata) -{ -#else /** * irdma_alloc_mr - register stag for fast memory registration * @pd: ibpd pointer @@ -120,7 +107,6 @@ struct ib_mr * irdma_alloc_mr(struct ib_pd *pd, enum ib_mr_type mr_type, u32 max_num_sg) { -#endif struct irdma_device *iwdev = to_iwdev(pd->device); struct irdma_pble_alloc *palloc; struct irdma_pbl *iwpbl; @@ -175,101 +161,6 @@ err: #define IRDMA_ALLOC_UCTX_MIN_REQ_LEN offsetofend(struct irdma_alloc_ucontext_req, rsvd8) #define IRDMA_ALLOC_UCTX_MIN_RESP_LEN offsetofend(struct irdma_alloc_ucontext_resp, rsvd) -#if __FreeBSD_version >= 1400026 -/** - * irdma_alloc_ucontext - Allocate the user context data structure - * @uctx: context - * @udata: user data - * - * This keeps track of all objects associated with a particular - * user-mode client. - */ -int -irdma_alloc_ucontext(struct ib_ucontext *uctx, struct ib_udata *udata) -{ - struct ib_device *ibdev = uctx->device; - struct irdma_device *iwdev = to_iwdev(ibdev); - struct irdma_alloc_ucontext_req req = {0}; - struct irdma_alloc_ucontext_resp uresp = {0}; - struct irdma_ucontext *ucontext = to_ucontext(uctx); - struct irdma_uk_attrs *uk_attrs; - - if (udata->inlen < IRDMA_ALLOC_UCTX_MIN_REQ_LEN || - udata->outlen < IRDMA_ALLOC_UCTX_MIN_RESP_LEN) - return -EINVAL; - - if (ib_copy_from_udata(&req, udata, min(sizeof(req), udata->inlen))) - return -EINVAL; - - if (req.userspace_ver < 4 || req.userspace_ver > IRDMA_ABI_VER) - goto ver_error; - - ucontext->iwdev = iwdev; - ucontext->abi_ver = req.userspace_ver; - - uk_attrs = &iwdev->rf->sc_dev.hw_attrs.uk_attrs; - /* GEN_1 support for libi40iw */ - if (udata->outlen == IRDMA_ALLOC_UCTX_MIN_RESP_LEN) { - if (uk_attrs->hw_rev != IRDMA_GEN_1) - return -EOPNOTSUPP; - - ucontext->legacy_mode = true; - uresp.max_qps = iwdev->rf->max_qp; - uresp.max_pds = iwdev->rf->sc_dev.hw_attrs.max_hw_pds; - uresp.wq_size = iwdev->rf->sc_dev.hw_attrs.max_qp_wr * 2; - uresp.kernel_ver = req.userspace_ver; - if (ib_copy_to_udata(udata, &uresp, min(sizeof(uresp), udata->outlen))) - return -EFAULT; - } else { - u64 bar_off; - - uresp.kernel_ver = IRDMA_ABI_VER; - uresp.feature_flags = uk_attrs->feature_flags; - uresp.max_hw_wq_frags = uk_attrs->max_hw_wq_frags; - uresp.max_hw_read_sges = uk_attrs->max_hw_read_sges; - uresp.max_hw_inline = uk_attrs->max_hw_inline; - uresp.max_hw_rq_quanta = uk_attrs->max_hw_rq_quanta; - uresp.max_hw_wq_quanta = uk_attrs->max_hw_wq_quanta; - uresp.max_hw_sq_chunk = uk_attrs->max_hw_sq_chunk; - uresp.max_hw_cq_size = uk_attrs->max_hw_cq_size; - uresp.min_hw_cq_size = uk_attrs->min_hw_cq_size; - uresp.hw_rev = uk_attrs->hw_rev; - - bar_off = - (uintptr_t)iwdev->rf->sc_dev.hw_regs[IRDMA_DB_ADDR_OFFSET]; - ucontext->db_mmap_entry = - irdma_user_mmap_entry_insert(ucontext, bar_off, - IRDMA_MMAP_IO_NC, - &uresp.db_mmap_key); - if (!ucontext->db_mmap_entry) { - return -ENOMEM; - } - - if (ib_copy_to_udata(udata, &uresp, - min(sizeof(uresp), udata->outlen))) { - rdma_user_mmap_entry_remove(ucontext->db_mmap_entry); - return -EFAULT; - } - } - - INIT_LIST_HEAD(&ucontext->cq_reg_mem_list); - spin_lock_init(&ucontext->cq_reg_mem_list_lock); - INIT_LIST_HEAD(&ucontext->qp_reg_mem_list); - spin_lock_init(&ucontext->qp_reg_mem_list_lock); - INIT_LIST_HEAD(&ucontext->vma_list); - mutex_init(&ucontext->vma_list_mutex); - - return 0; - -ver_error: - irdma_dev_err(&iwdev->rf->sc_dev, - "Invalid userspace driver version detected. Detected version %d, should be %d\n", - req.userspace_ver, IRDMA_ABI_VER); - return -EINVAL; -} -#endif - -#if __FreeBSD_version < 1400026 /** * irdma_alloc_ucontext - Allocate the user context data structure * @ibdev: ib device pointer @@ -374,25 +265,7 @@ ver_error: req.userspace_ver, IRDMA_ABI_VER); return ERR_PTR(-EINVAL); } -#endif -#if __FreeBSD_version >= 1400026 -/** - * irdma_dealloc_ucontext - deallocate the user context data structure - * @context: user context created during alloc - */ -void -irdma_dealloc_ucontext(struct ib_ucontext *context) -{ - struct irdma_ucontext *ucontext = to_ucontext(context); - - rdma_user_mmap_entry_remove(ucontext->db_mmap_entry); - - return; -} -#endif - -#if __FreeBSD_version < 1400026 /** * irdma_dealloc_ucontext - deallocate the user context data structure * @context: user context created during alloc @@ -408,63 +281,8 @@ irdma_dealloc_ucontext(struct ib_ucontext *context) return 0; } -#endif #define IRDMA_ALLOC_PD_MIN_RESP_LEN offsetofend(struct irdma_alloc_pd_resp, rsvd) -#if __FreeBSD_version >= 1400026 -/** - * irdma_alloc_pd - allocate protection domain - * @pd: protection domain - * @udata: user data - */ -int -irdma_alloc_pd(struct ib_pd *pd, struct ib_udata *udata) -{ - struct irdma_pd *iwpd = to_iwpd(pd); - struct irdma_device *iwdev = to_iwdev(pd->device); - struct irdma_sc_dev *dev = &iwdev->rf->sc_dev; - struct irdma_pci_f *rf = iwdev->rf; - struct irdma_alloc_pd_resp uresp = {0}; - struct irdma_sc_pd *sc_pd; - u32 pd_id = 0; - int err; - - if (udata && udata->outlen < IRDMA_ALLOC_PD_MIN_RESP_LEN) - return -EINVAL; - - err = irdma_alloc_rsrc(rf, rf->allocated_pds, rf->max_pd, &pd_id, - &rf->next_pd); - if (err) - return err; - - sc_pd = &iwpd->sc_pd; - if (udata) { - struct irdma_ucontext *ucontext = - rdma_udata_to_drv_context(udata, struct irdma_ucontext, - ibucontext); - - irdma_sc_pd_init(dev, sc_pd, pd_id, ucontext->abi_ver); - uresp.pd_id = pd_id; - if (ib_copy_to_udata(udata, &uresp, - min(sizeof(uresp), udata->outlen))) { - err = -EFAULT; - goto error; - } - } else { - irdma_sc_pd_init(dev, sc_pd, pd_id, IRDMA_ABI_VER); - } - - return 0; - -error: - - irdma_free_rsrc(rf, rf->allocated_pds, pd_id); - - return err; -} -#endif - -#if __FreeBSD_version < 1400026 /** * irdma_alloc_pd - allocate protection domain * @ibdev: IB device @@ -520,21 +338,6 @@ free_res: return ERR_PTR(err); } -#endif - -#if __FreeBSD_version >= 1400026 -void -irdma_dealloc_pd(struct ib_pd *ibpd, struct ib_udata *udata) -{ - struct irdma_pd *iwpd = to_iwpd(ibpd); - struct irdma_device *iwdev = to_iwdev(ibpd->device); - - irdma_free_rsrc(iwdev->rf, iwdev->rf->allocated_pds, iwpd->sc_pd.pd_id); -} - -#endif - -#if __FreeBSD_version < 1400026 int irdma_dealloc_pd(struct ib_pd *ibpd) { @@ -545,7 +348,6 @@ irdma_dealloc_pd(struct ib_pd *ibpd) kfree(iwpd); return 0; } -#endif static void irdma_fill_ah_info(struct vnet *vnet, struct irdma_ah_info *ah_info, @@ -634,172 +436,26 @@ irdma_create_ah_wait(struct irdma_pci_f *rf, #define IRDMA_CREATE_AH_MIN_RESP_LEN offsetofend(struct irdma_create_ah_resp, rsvd) -#if __FreeBSD_version >= 1400026 -/** - * irdma_create_ah - create address handle - * @ib_ah: ptr to AH - * @attr: address handle attributes - * @flags: AH flags to wait - * @udata: user data - * - * returns 0 on success, error otherwise - */ -int -irdma_create_ah(struct ib_ah *ib_ah, - struct ib_ah_attr *attr, u32 flags, - struct ib_udata *udata) -{ - struct irdma_pd *pd = to_iwpd(ib_ah->pd); - struct irdma_ah *ah = container_of(ib_ah, struct irdma_ah, ibah); - struct irdma_device *iwdev = to_iwdev(ib_ah->pd->device); - union ib_gid sgid; - struct ib_gid_attr sgid_attr; - struct irdma_pci_f *rf = iwdev->rf; - struct irdma_sc_ah *sc_ah; - u32 ah_id = 0; - struct irdma_ah_info *ah_info; - struct irdma_create_ah_resp uresp; - union { - struct sockaddr saddr; - struct sockaddr_in saddr_in; - struct sockaddr_in6 saddr_in6; - } sgid_addr, dgid_addr; - int err; - u8 dmac[ETH_ALEN]; - bool sleep = (flags & RDMA_CREATE_AH_SLEEPABLE) != 0; - - if (udata && udata->outlen < IRDMA_CREATE_AH_MIN_RESP_LEN) - return -EINVAL; - - err = irdma_alloc_rsrc(rf, rf->allocated_ahs, - rf->max_ah, &ah_id, &rf->next_ah); - - if (err) - return err; - - ah->pd = pd; - sc_ah = &ah->sc_ah; - sc_ah->ah_info.ah_idx = ah_id; - sc_ah->ah_info.vsi = &iwdev->vsi; - irdma_sc_init_ah(&rf->sc_dev, sc_ah); - ah->sgid_index = attr->grh.sgid_index; - memcpy(&ah->dgid, &attr->grh.dgid, sizeof(ah->dgid)); - rcu_read_lock(); - err = ib_get_cached_gid(&iwdev->ibdev, attr->port_num, - attr->grh.sgid_index, &sgid, &sgid_attr); - rcu_read_unlock(); - if (err) { - irdma_debug(iwdev_to_idev(iwdev), IRDMA_DEBUG_VERBS, - "GID lookup at idx=%d with port=%d failed\n", - attr->grh.sgid_index, attr->port_num); - err = -EINVAL; - goto err_gid_l2; - } - rdma_gid2ip((struct sockaddr *)&sgid_addr, &sgid); - rdma_gid2ip((struct sockaddr *)&dgid_addr, &attr->grh.dgid); - ah->av.attrs = *attr; - ah->av.net_type = kc_rdma_gid_attr_network_type(sgid_attr, - sgid_attr.gid_type, - &sgid); - - if (sgid_attr.ndev) - dev_put(sgid_attr.ndev); - - ah->av.sgid_addr.saddr = sgid_addr.saddr; - ah->av.dgid_addr.saddr = dgid_addr.saddr; - ah_info = &sc_ah->ah_info; - ah_info->ah_idx = ah_id; - ah_info->pd_idx = pd->sc_pd.pd_id; - ether_addr_copy(ah_info->mac_addr, IF_LLADDR(iwdev->netdev)); - - if (attr->ah_flags & IB_AH_GRH) { - ah_info->flow_label = attr->grh.flow_label; - ah_info->hop_ttl = attr->grh.hop_limit; - ah_info->tc_tos = attr->grh.traffic_class; - } - - ether_addr_copy(dmac, attr->dmac); - - irdma_fill_ah_info(iwdev->netdev->if_vnet, ah_info, &sgid_attr, &sgid_addr.saddr, &dgid_addr.saddr, - dmac, ah->av.net_type); - - err = irdma_create_ah_vlan_tag(iwdev, ah_info, &sgid_attr, dmac); - if (err) - goto err_gid_l2; - - err = irdma_ah_cqp_op(iwdev->rf, sc_ah, IRDMA_OP_AH_CREATE, - sleep, irdma_gsi_ud_qp_ah_cb, sc_ah); - if (err) { - irdma_debug(iwdev_to_idev(iwdev), IRDMA_DEBUG_VERBS, - "CQP-OP Create AH fail"); - goto err_gid_l2; - } - - err = irdma_create_ah_wait(rf, sc_ah, sleep); - if (err) { - irdma_debug(iwdev_to_idev(iwdev), IRDMA_DEBUG_VERBS, - "CQP create AH timed out"); - goto err_gid_l2; - } - - if (udata) { - uresp.ah_id = ah->sc_ah.ah_info.ah_idx; - err = ib_copy_to_udata(udata, &uresp, sizeof(uresp)); - if (err) { - irdma_ah_cqp_op(iwdev->rf, &ah->sc_ah, - IRDMA_OP_AH_DESTROY, false, NULL, ah); - goto err_gid_l2; - } - } - - return 0; -err_gid_l2: - irdma_free_rsrc(iwdev->rf, iwdev->rf->allocated_ahs, ah_id); - - return err; -} -#endif - void irdma_ether_copy(u8 *dmac, struct ib_ah_attr *attr) { ether_addr_copy(dmac, attr->dmac); } -#if __FreeBSD_version < 1400026 struct ib_ah * irdma_create_ah_stub(struct ib_pd *ibpd, struct ib_ah_attr *attr, struct ib_udata *udata) -#else -int -irdma_create_ah_stub(struct ib_ah *ib_ah, - struct ib_ah_attr *attr, u32 flags, - struct ib_udata *udata) -#endif { -#if __FreeBSD_version >= 1400026 - return -ENOSYS; -#else return ERR_PTR(-ENOSYS); -#endif } -#if __FreeBSD_version >= 1400026 -void -irdma_destroy_ah_stub(struct ib_ah *ibah, u32 flags) -{ - return; -} -#else int irdma_destroy_ah_stub(struct ib_ah *ibah) { return -ENOSYS; } -#endif -#if __FreeBSD_version < 1400026 /** * irdma_create_ah - create address handle * @ibpd: ptr to pd @@ -931,7 +587,6 @@ err_gid_l2: return ERR_PTR(err); } -#endif /** * irdma_free_qp_rsrc - free up memory resources for qp @@ -1170,13 +825,8 @@ error: * @ibqp: qp's ib pointer also to get to device's qp address * @udata: user data */ -#if __FreeBSD_version >= 1400026 -int -irdma_destroy_qp(struct ib_qp *ibqp, struct ib_udata *udata) -#else int irdma_destroy_qp(struct ib_qp *ibqp) -#endif { struct irdma_qp *iwqp = to_iwqp(ibqp); struct irdma_device *iwdev = iwqp->iwdev; @@ -1213,31 +863,17 @@ free_rsrc: * @attr: attributes for cq * @udata: user data */ -#if __FreeBSD_version >= 1400026 -int -irdma_create_cq(struct ib_cq *ibcq, - const struct ib_cq_init_attr *attr, - struct ib_udata *udata) -#else struct ib_cq * irdma_create_cq(struct ib_device *ibdev, const struct ib_cq_init_attr *attr, struct ib_ucontext *context, struct ib_udata *udata) -#endif { #define IRDMA_CREATE_CQ_MIN_REQ_LEN offsetofend(struct irdma_create_cq_req, user_cq_buf) #define IRDMA_CREATE_CQ_MIN_RESP_LEN offsetofend(struct irdma_create_cq_resp, cq_size) -#if __FreeBSD_version >= 1400026 - struct ib_device *ibdev = ibcq->device; -#endif struct irdma_device *iwdev = to_iwdev(ibdev); struct irdma_pci_f *rf = iwdev->rf; -#if __FreeBSD_version >= 1400026 - struct irdma_cq *iwcq = to_iwcq(ibcq); -#else struct irdma_cq *iwcq; -#endif u32 cq_num = 0; struct irdma_sc_cq *cq; struct irdma_sc_dev *dev = &rf->sc_dev; @@ -1251,15 +887,6 @@ irdma_create_cq(struct ib_device *ibdev, int entries = attr->cqe; bool cqe_64byte_ena; -#if __FreeBSD_version >= 1400026 - err_code = cq_validate_flags(attr->flags, dev->hw_attrs.uk_attrs.hw_rev); - if (err_code) - return err_code; - - if (udata && (udata->inlen < IRDMA_CREATE_CQ_MIN_REQ_LEN || - udata->outlen < IRDMA_CREATE_CQ_MIN_RESP_LEN)) - return -EINVAL; -#else err_code = cq_validate_flags(attr->flags, dev->hw_attrs.uk_attrs.hw_rev); if (err_code) return ERR_PTR(err_code); @@ -1271,15 +898,10 @@ irdma_create_cq(struct ib_device *ibdev, iwcq = kzalloc(sizeof(*iwcq), GFP_KERNEL); if (!iwcq) return ERR_PTR(-ENOMEM); -#endif err_code = irdma_alloc_rsrc(rf, rf->allocated_cqs, rf->max_cq, &cq_num, &rf->next_cq); if (err_code) -#if __FreeBSD_version >= 1400026 - return err_code; -#else goto error; -#endif cq = &iwcq->sc_cq; cq->back_cq = iwcq; atomic_set(&iwcq->refcnt, 1); @@ -1308,11 +930,7 @@ irdma_create_cq(struct ib_device *ibdev, struct irdma_cq_mr *cqmr_shadow; iwcq->user_mode = true; -#if __FreeBSD_version >= 1400026 - ucontext = rdma_udata_to_drv_context(udata, struct irdma_ucontext, ibucontext); -#else ucontext = to_ucontext(context); -#endif if (ib_copy_from_udata(&req, udata, min(sizeof(req), udata->inlen))) { @@ -1444,22 +1062,14 @@ irdma_create_cq(struct ib_device *ibdev, rf->cq_table[cq_num] = iwcq; init_completion(&iwcq->free_cq); -#if __FreeBSD_version >= 1400026 - return 0; -#else return &iwcq->ibcq; -#endif cq_destroy: irdma_cq_wq_destroy(rf, cq); cq_free_rsrc: irdma_cq_free_rsrc(rf, iwcq); -#if __FreeBSD_version >= 1400026 - return err_code; -#else error: kfree(iwcq); return ERR_PTR(err_code); -#endif } /** @@ -1508,23 +1118,6 @@ irdma_copy_user_pgaddrs(struct irdma_mr *iwmr, u64 *pbl, * @ibah: pointer to address handle * @ah_flags: destroy flags */ - -#if __FreeBSD_version >= 1400026 -void -irdma_destroy_ah(struct ib_ah *ibah, u32 ah_flags) -{ - struct irdma_device *iwdev = to_iwdev(ibah->device); - struct irdma_ah *ah = to_iwah(ibah); - - irdma_ah_cqp_op(iwdev->rf, &ah->sc_ah, IRDMA_OP_AH_DESTROY, - false, NULL, ah); - - irdma_free_rsrc(iwdev->rf, iwdev->rf->allocated_ahs, - ah->sc_ah.ah_info.ah_idx); -} -#endif - -#if __FreeBSD_version < 1400026 int irdma_destroy_ah(struct ib_ah *ibah) { @@ -1540,15 +1133,9 @@ irdma_destroy_ah(struct ib_ah *ibah) kfree(ah); return 0; } -#endif -#if __FreeBSD_version >= 1400026 -int -irdma_dereg_mr(struct ib_mr *ib_mr, struct ib_udata *udata) -#else int irdma_dereg_mr(struct ib_mr *ib_mr) -#endif { struct irdma_mr *iwmr = to_iwmr(ib_mr); struct irdma_device *iwdev = to_iwdev(ib_mr->device); @@ -1558,15 +1145,9 @@ irdma_dereg_mr(struct ib_mr *ib_mr) if (iwmr->type != IRDMA_MEMREG_TYPE_MEM) { if (iwmr->region) { struct irdma_ucontext *ucontext; -#if __FreeBSD_version >= 1400026 - - ucontext = rdma_udata_to_drv_context(udata, struct irdma_ucontext, ibucontext); - -#else struct ib_pd *ibpd = ib_mr->pd; ucontext = to_ucontext(ibpd->uobject->context); -#endif irdma_del_memlist(iwmr, ucontext); } goto done; @@ -1673,43 +1254,6 @@ kc_irdma_set_roce_cm_info(struct irdma_qp *iwqp, struct ib_qp_attr *attr, return 0; } -#if __FreeBSD_version >= 1400026 -/** - * irdma_destroy_cq - destroy cq - * @ib_cq: cq pointer - * @udata: user data - */ -void -irdma_destroy_cq(struct ib_cq *ib_cq, struct ib_udata *udata) -{ - struct irdma_device *iwdev = to_iwdev(ib_cq->device); - struct irdma_cq *iwcq = to_iwcq(ib_cq); - struct irdma_sc_cq *cq = &iwcq->sc_cq; - struct irdma_sc_dev *dev = cq->dev; - struct irdma_sc_ceq *ceq = dev->ceq[cq->ceq_id]; - struct irdma_ceq *iwceq = container_of(ceq, struct irdma_ceq, sc_ceq); - unsigned long flags; - - spin_lock_irqsave(&iwcq->lock, flags); - if (!list_empty(&iwcq->cmpl_generated)) - irdma_remove_cmpls_list(iwcq); - if (!list_empty(&iwcq->resize_list)) - irdma_process_resize_list(iwcq, iwdev, NULL); - spin_unlock_irqrestore(&iwcq->lock, flags); - - irdma_cq_rem_ref(ib_cq); - wait_for_completion(&iwcq->free_cq); - - irdma_cq_wq_destroy(iwdev->rf, cq); - - spin_lock_irqsave(&iwceq->ce_lock, flags); - irdma_sc_cleanup_ceqes(cq, ceq); - spin_unlock_irqrestore(&iwceq->ce_lock, flags); - irdma_cq_free_rsrc(iwdev->rf, iwcq); -} - -#endif -#if __FreeBSD_version < 1400026 /** * irdma_destroy_cq - destroy cq * @ib_cq: cq pointer @@ -1747,7 +1291,6 @@ irdma_destroy_cq(struct ib_cq *ib_cq) return 0; } -#endif /** * irdma_alloc_mw - Allocate memory window * @pd: Protection domain @@ -1811,7 +1354,6 @@ kc_set_loc_seq_num_mss(struct irdma_cm_node *cm_node) (cm_node->iwdev->vsi.mtu - IRDMA_MTU_TO_MSS_IPV6); } -#if __FreeBSD_version < 1400026 struct irdma_vma_data { struct list_head list; struct vm_area_struct *vma; @@ -1917,16 +1459,6 @@ rdma_user_mmap_io(struct ib_ucontext *context, struct vm_area_struct *vma, return irdma_set_vma_data(vma, to_ucontext(context)); } -#else -/** - * irdma_disassociate_ucontext - Disassociate user context - * @context: ib user context - */ -void -irdma_disassociate_ucontext(struct ib_ucontext *context) -{ -} -#endif struct ib_device * ib_device_get_by_netdev(struct ifnet *netdev, int driver_id) diff --git a/sys/dev/irdma/irdma_main.h b/sys/dev/irdma/irdma_main.h index 180bff09d457..8ce4aaab4552 100644 --- a/sys/dev/irdma/irdma_main.h +++ b/sys/dev/irdma/irdma_main.h @@ -44,9 +44,6 @@ #include #include #include -#if __FreeBSD_version >= 1400000 -#include -#endif #include #include #include @@ -410,15 +407,6 @@ static inline struct irdma_ucontext *to_ucontext(struct ib_ucontext *ibucontext) return container_of(ibucontext, struct irdma_ucontext, ibucontext); } -#if __FreeBSD_version >= 1400026 -static inline struct irdma_user_mmap_entry * -to_irdma_mmap_entry(struct rdma_user_mmap_entry *rdma_entry) -{ - return container_of(rdma_entry, struct irdma_user_mmap_entry, - rdma_entry); -} - -#endif static inline struct irdma_pd *to_iwpd(struct ib_pd *ibpd) { return container_of(ibpd, struct irdma_pd, ibpd); diff --git a/sys/dev/irdma/irdma_verbs.c b/sys/dev/irdma/irdma_verbs.c index dbd20ea72d00..9daadf0706e5 100644 --- a/sys/dev/irdma/irdma_verbs.c +++ b/sys/dev/irdma/irdma_verbs.c @@ -107,49 +107,10 @@ irdma_mmap_legacy(struct irdma_ucontext *ucontext, pfn = ((uintptr_t)ucontext->iwdev->rf->sc_dev.hw_regs[IRDMA_DB_ADDR_OFFSET] + pci_resource_start(ucontext->iwdev->rf->pcidev, 0)) >> PAGE_SHIFT; -#if __FreeBSD_version >= 1400026 - return rdma_user_mmap_io(&ucontext->ibucontext, vma, pfn, PAGE_SIZE, - pgprot_noncached(vma->vm_page_prot), NULL); -#else return rdma_user_mmap_io(&ucontext->ibucontext, vma, pfn, PAGE_SIZE, pgprot_noncached(vma->vm_page_prot)); -#endif } -#if __FreeBSD_version >= 1400026 -static void -irdma_mmap_free(struct rdma_user_mmap_entry *rdma_entry) -{ - struct irdma_user_mmap_entry *entry = to_irdma_mmap_entry(rdma_entry); - - kfree(entry); -} - -struct rdma_user_mmap_entry * -irdma_user_mmap_entry_insert(struct irdma_ucontext *ucontext, u64 bar_offset, - enum irdma_mmap_flag mmap_flag, u64 *mmap_offset) -{ - struct irdma_user_mmap_entry *entry = kzalloc(sizeof(*entry), GFP_KERNEL); - int ret; - - if (!entry) - return NULL; - - entry->bar_offset = bar_offset; - entry->mmap_flag = mmap_flag; - - ret = rdma_user_mmap_entry_insert(&ucontext->ibucontext, - &entry->rdma_entry, PAGE_SIZE); - if (ret) { - kfree(entry); - return NULL; - } - *mmap_offset = rdma_user_mmap_get_offset(&entry->rdma_entry); - - return &entry->rdma_entry; -} - -#else static inline bool find_key_in_mmap_tbl(struct irdma_ucontext *ucontext, u64 key) { @@ -245,7 +206,6 @@ irdma_user_mmap_entry_del_hash(struct irdma_user_mmap_entry *entry) kfree(entry); } -#endif /** * irdma_mmap - user memory map * @context: context created during alloc @@ -254,9 +214,6 @@ irdma_user_mmap_entry_del_hash(struct irdma_user_mmap_entry *entry) static int irdma_mmap(struct ib_ucontext *context, struct vm_area_struct *vma) { -#if __FreeBSD_version >= 1400026 - struct rdma_user_mmap_entry *rdma_entry; -#endif struct irdma_user_mmap_entry *entry; struct irdma_ucontext *ucontext; u64 pfn; @@ -268,17 +225,6 @@ irdma_mmap(struct ib_ucontext *context, struct vm_area_struct *vma) if (ucontext->legacy_mode) return irdma_mmap_legacy(ucontext, vma); -#if __FreeBSD_version >= 1400026 - rdma_entry = rdma_user_mmap_entry_get(&ucontext->ibucontext, vma); - if (!rdma_entry) { - irdma_debug(iwdev_to_idev(ucontext->iwdev), IRDMA_DEBUG_VERBS, - "pgoff[0x%lx] does not have valid entry\n", - vma->vm_pgoff); - return -EINVAL; *** 282 LINES SKIPPED *** From nobody Wed Feb 8 00:27:13 2023 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 4PBLRP55LDz3p8lR; Wed, 8 Feb 2023 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 4PBLRP4W0nz43c5; Wed, 8 Feb 2023 00:27:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675816033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cXW9kFjgXIfL5shFJ+KHHu0ex7FqaH20T4qSEeuxqTI=; b=W5epflvXAzidQxp8XUnjvqnATPBMapNYRmlPWTdhe8iSPRLto81tw/NTHSqeXDMjt8nu5G 3751N8jkWValI7l0C1qxri6V2HszWy73k9YThHE2D2oMXl5ExUsRAc9UHpRM0r8HhUOo8X c6HkdYxj7ktDDrHtkslTuPs2g8o1A32cLo541QZZ23xOaJaHvAqpRYleMXaFeQJFxi2Jq7 frX9JsGr8p4S0R7YiyN+0YWtuGt+gOrOm0dIU5kiPvrbR0CE1JyQs9jMn9lVOnWwQWMDAl TDZ9f+Zm7hUm4DBXFvGNaNUM1PPuxqAFDeDXyRtjaN9hBy2p6tIli5sWZuN4mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675816033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cXW9kFjgXIfL5shFJ+KHHu0ex7FqaH20T4qSEeuxqTI=; b=FdB1NKbW+iaLya36GRZ93L+s3FiscDUdFiPmuCg1cx7Sd6/MVOQdGK/DTZumlPeNZdfncJ wpqxSzqja7I4WNVsWgfjw3oOKOpji4pA86hjtI7mcZTUjhYQS4vvjiwN025jG8REVOEjJD SEwtkott8iYdaaUUX8fXkDlAMy/NxIjt/vF6Hi9UGE9cU9wN46nWubdHAoenGhtQ1HH5H8 m+ZmTavowIKNlyQhZrV/dtc6KGPZenKsl+/6Go3Wwl5mNWQ3a5C21WANN/DIVe2u+llbxN i8wMwXMiiQhFBn/n5cgoApYODIV2mf0wAhrpNnEPYdYt04RSItAbsS9hXNGP+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675816033; a=rsa-sha256; cv=none; b=OoN+cOsXvsgitkSbMz67WhxcPsg9y78FkWDtnO/Xd0bFb0TUstfsghAOMdWfpcf4shA3Kd eAQTjclkA4syWzpuv6soG2m+AiNxxmsbSsLpXupv3o8NnDQe2w0pD2DWpr9CPLNk9J2c6U P2i/z9biMzLX7TUUVrV8SeJbV/rRijJWih0Bt4d86tXcf2b7fV35ZyEoCTizRRRYWw3Som xDPs7OZK7hmbPe53t1xaKM15n+//WsUlZYK58GAufsHGHdtZcAmNFocuMGeqqY6Zf/qL0d VWrLHyGCYG/ujcawk4UP2FxTaIXM8sYlMY8hTCeuoNYiXRWjZh5RB0rDfjY41g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBLRP3Z7pzcxY; Wed, 8 Feb 2023 00:27:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3180RDkH096551; Wed, 8 Feb 2023 00:27:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3180RDGs096550; Wed, 8 Feb 2023 00:27:13 GMT (envelope-from git) Date: Wed, 8 Feb 2023 00:27:13 GMT Message-Id: <202302080027.3180RDGs096550@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: 06e6efccbfab - stable/13 - libthr: add pshared_destroy() helper 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: 06e6efccbfab46410ff7b9e034353453ea19ac3d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=06e6efccbfab46410ff7b9e034353453ea19ac3d commit 06e6efccbfab46410ff7b9e034353453ea19ac3d Author: Konstantin Belousov AuthorDate: 2023-02-01 21:06:04 +0000 Commit: Konstantin Belousov CommitDate: 2023-02-08 00:26:59 +0000 libthr: add pshared_destroy() helper (cherry picked from commit 3cf37d1251bf71b2171e67af8f2ca43cbe3d874d) --- lib/libthr/thread/thr_pshared.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/libthr/thread/thr_pshared.c b/lib/libthr/thread/thr_pshared.c index d0219d0488f4..37b44ab73582 100644 --- a/lib/libthr/thread/thr_pshared.c +++ b/lib/libthr/thread/thr_pshared.c @@ -213,6 +213,17 @@ pshared_clean(void *key, void *val) _umtx_op(NULL, UMTX_OP_SHM, UMTX_SHM_DESTROY, key, NULL); } +static void +pshared_destroy(struct pthread *curthread, void *key) +{ + void *val; + + pshared_wlock(curthread); + val = pshared_remove(key); + pshared_unlock(curthread); + pshared_clean(key, val); +} + void * __thr_pshared_offpage(void *key, int doalloc) { @@ -248,13 +259,9 @@ void __thr_pshared_destroy(void *key) { struct pthread *curthread; - void *val; curthread = _get_curthread(); - pshared_wlock(curthread); - val = pshared_remove(key); - pshared_unlock(curthread); - pshared_clean(key, val); + pshared_destroy(curthread, key); pshared_gc(curthread); } From nobody Wed Feb 8 00:27:14 2023 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 4PBLRR18l5z3p8lS; Wed, 8 Feb 2023 00:27: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 4PBLRQ58bdz43X0; Wed, 8 Feb 2023 00:27:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675816034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7Nkr+nZiLd6IXkuZtC9J907L3yZJJk1IK+4MS+Lmzsg=; b=gcXCOUVqmfP5DEy6m9ryxJNE19zzfjqzbfEKIRFLYDByVOyAgs19rKArOp1xHFPNDIZpJx 6mH5VJLzvfRQwkJcEUU+sQy07HoILo6xlQ1LQRbYtc+i7h410q95ADH2Mfx6Rtg/4yLn7e Q+eykXHj2NXzhpN3tW0ZimGY/DvWFYtD9iI/kxpMgK6d6GIsjcOo+cdvfJhhOlbYexuyjB GfXFBQYqoC5pZhts1nhI8dTa0oc0eWjHRnonPeYRSkadWKb1Oapj8lVEQL8fIaxx6/zXkn sux/gNwWfCZftsSsjoS09T4gsmkIktUfiG/WxRdS0B3SZvFnyfD1EP0pFkipWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675816034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7Nkr+nZiLd6IXkuZtC9J907L3yZJJk1IK+4MS+Lmzsg=; b=Ej5k8c1ODsOhpREO/attlUYBLurqLDTowJcxiM4NEL0fiKgRs44nCziVN2lAha3+AS3cxo xtF9iXSGDigOnSH1TldbWoDSkC/4TbZMTFcD0Ec1M8fp/VtpIeKyCHQU+AjQARnBKWJ3Iy Q17YcArslD3IGtpq10Kf4WAQbcCI0sTgMF8WPVD+MRWa9R6BSdnDdN8c952GA/vE59wi3M gt6tPI0uKqFYI6Zo0/fuy4lnzpT55804H29Y2r3Js1gSABf+LoFnD2HZbhpgtSEgEjnyg3 1TZpsxqFBnpSlYer2HehNX7Pzet4BYoVdbDg5FAm2a9FiWas2KAmpN0xzdE8hg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675816034; a=rsa-sha256; cv=none; b=ncgEgvTuNsUeS5ksnSNsqdfvykQic64de/T3Fw6LdrprkHpwzhP/h+IOtynqU1VJpZH1R1 ML/ZHcZ/Tyr8jwugL8nzEZVCcS08kYIyuB08uaEelLI30LaZiRvb9xM0BNr/sK4V1m5HLo 0enAGPSvcw8JtUUaK/qkC8+W4wO3RRCFCESif3/CBhcmQZB86AI6JKDOamo7EUTNn3aNpf DskAmw+UO1tJGro9rXOoQrgpQ7fT8usL9PKUeTNOGruG0bKEBSDmLrCzCEp3HOdL39usKs OrS7fVVtGkE4Yf1dbnr1LuoQaxnukpoANIM3CfvvN52Ku3LA2clgxNZKUK6uEw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBLRQ4C2PzcVF; Wed, 8 Feb 2023 00:27:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3180REmq096576; Wed, 8 Feb 2023 00:27:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3180REGH096575; Wed, 8 Feb 2023 00:27:14 GMT (envelope-from git) Date: Wed, 8 Feb 2023 00:27:14 GMT Message-Id: <202302080027.3180REGH096575@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: c8452bdeed4f - stable/13 - libthr pshared: correct a bug in allocation 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: c8452bdeed4fc1f1feadf36c6008367263292254 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c8452bdeed4fc1f1feadf36c6008367263292254 commit c8452bdeed4fc1f1feadf36c6008367263292254 Author: Konstantin Belousov AuthorDate: 2023-02-01 20:12:45 +0000 Commit: Konstantin Belousov CommitDate: 2023-02-08 00:26:59 +0000 libthr pshared: correct a bug in allocation PR: 269277 (cherry picked from commit 25c862ae503a1c99458f4e055fd50c878fadbea3) --- lib/libthr/thread/thr_pshared.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/libthr/thread/thr_pshared.c b/lib/libthr/thread/thr_pshared.c index 37b44ab73582..446e9983bcae 100644 --- a/lib/libthr/thread/thr_pshared.c +++ b/lib/libthr/thread/thr_pshared.c @@ -232,11 +232,16 @@ __thr_pshared_offpage(void *key, int doalloc) int fd, ins_done; curthread = _get_curthread(); - pshared_rlock(curthread); - res = pshared_lookup(key); - pshared_unlock(curthread); - if (res != NULL) - return (res); + if (doalloc) { + pshared_destroy(curthread, key); + res = NULL; + } else { + pshared_rlock(curthread); + res = pshared_lookup(key); + pshared_unlock(curthread); + if (res != NULL) + return (res); + } fd = _umtx_op(NULL, UMTX_OP_SHM, doalloc ? UMTX_SHM_CREAT : UMTX_SHM_LOOKUP, key, NULL); if (fd == -1) From nobody Wed Feb 8 10:40:22 2023 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 4PBc2t5TLRz3n1f0; Wed, 8 Feb 2023 10:40: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 4PBc2t51jyz436r; Wed, 8 Feb 2023 10:40:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675852822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O0c4NlmJt0lF6BUYtUUQA/sK0Zd2/b6Veivk0pcmPNE=; b=y4HWdbywOyC3XYMFHke0VeMAnSWyh/6xGuKYJEamFy4w31z7dLdYaiv1n9S4EtisJQ2N0o Z8TM4Bpi0Mgud4SJ80jCphVa5qMds4ZLXx1hmKhmlgt6jEMZtbbYpjge+kdkX1/fAU407P /NFSj+pgWvAxjstjLgDXeXTNCIfOR8G2HKOJxq0PvSuAwSmfDrMg8+rPKNB43KiimqLL9W iAzwIHlPS7sCXy5RQyvfSWg0tKihy5cTS417oQMzt1QKEAgHtKprAdCra3Je5GnEOZwL7L 1nL+nRSsfqI+V//zb5Durf9f0MYoS5KNwKhq/v+DenB57J1tLSqEkSVzJBwnDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675852822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O0c4NlmJt0lF6BUYtUUQA/sK0Zd2/b6Veivk0pcmPNE=; b=skhO57M8R5jdHAv8Hht6k7GQYti7ivvyTHuP6KflUkgAv02mey62GOQk6k2GMhXnRjuy6q yuYaSP0iYhC8vA3j0dhaD4ZcEj72CG7zCCSR/6BPIMvY8ojUCe9THAoFx7Rrqd7YMKSUCZ 66MC2T3fDeZ8Ru7kDHYc3Pa6itsKyvCjKaMAdwO05RJZLbzsYRp0tO5NI2Do2wNlTEWZ5F SB7jHxqjGSY6CIwNrQAMsdU1fbE14rexMdFoya5BZRsPJSp1uP21lTeB9xHdUbdIL4j5CA stTtCUe6DniNMKG4kaYa02biZmRV9EBsVdUHcx9B8X2j8XlvlIAa3l9q0c+0Ng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675852822; a=rsa-sha256; cv=none; b=I10L2w6DgCCeSvDZ3SbwqsI8mx258moAGCQPizUUAcN91vdcfZwGAo3wXhNI2RN1sBVVCM m4c6E1ffgpNx5zX+VcX/ekcB86qRAksLd6g8tNL7fyBOY/3mS382J8pUAA5EXPBdmK5S48 /oIcGaKzE0ra0Ry5Uz387fxY0A+MdSQD7HylwrfBdCuiM3HgXAOHT7mWZ4WYbwrBKvepKp w2JpBIYe+sHPodBmzFTDZjDL8WFxc4KOIuqP28EX0vtWEpfoIht+wct40SK+iEjpJXZilv TIcJHbKxcx0cdFiq4tvoxA36TfFEwIY4E8XgnXW012nC9Vq+WcYwyUncrsdR1g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBc2t444rztdY; Wed, 8 Feb 2023 10:40:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 318AeMPM075550; Wed, 8 Feb 2023 10:40:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 318AeMVU075549; Wed, 8 Feb 2023 10:40:22 GMT (envelope-from git) Date: Wed, 8 Feb 2023 10:40:22 GMT Message-Id: <202302081040.318AeMVU075549@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: 7148611e4f56 - stable/13 - vmm: avoid spurious rendezvous 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: corvink X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7148611e4f560f375d4b92fdeb9451a792dc73fc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=7148611e4f560f375d4b92fdeb9451a792dc73fc commit 7148611e4f560f375d4b92fdeb9451a792dc73fc Author: Corvin Köhne AuthorDate: 2022-11-15 10:53:49 +0000 Commit: Corvin Köhne CommitDate: 2023-02-08 09:28:47 +0000 vmm: avoid spurious rendezvous A vcpu only checks if a rendezvous is in progress or not to decide if it should handle a rendezvous. This could lead to spurios rendezvous where a vcpu tries a handle a rendezvous it isn't part of. This situation is properly handled by vm_handle_rendezvous but it could potentially degrade the performance. Avoid that by an early check if the vcpu is part of the rendezvous or not. At the moment, rendezvous are only used to spin up application processors and to send ioapic interrupts. Spinning up application processors is done in the guest boot phase by sending INIT SIPI sequences to single vcpus. This is known to cause spurious rendezvous and only occurs in the boot phase. Sending ioapic interrupts is rare because modern guest will use msi and the rendezvous is always send to all vcpus. Reviewed by: jhb MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D37390 (cherry picked from commit 892feec2211d0dbd58252a34d78dbcb2d5dd7593) --- sys/amd64/include/vmm.h | 14 ++++++++++---- sys/amd64/vmm/amd/svm.c | 2 +- sys/amd64/vmm/intel/vmx.c | 2 +- sys/amd64/vmm/vmm.c | 3 ++- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/sys/amd64/include/vmm.h b/sys/amd64/include/vmm.h index 15f946d4f120..cb883bb0e143 100644 --- a/sys/amd64/include/vmm.h +++ b/sys/amd64/include/vmm.h @@ -159,7 +159,7 @@ struct pmap; enum snapshot_req; struct vm_eventinfo { - void *rptr; /* rendezvous cookie */ + cpuset_t *rptr; /* rendezvous cookie */ int *sptr; /* suspend cookie */ int *iptr; /* reqidle cookie */ }; @@ -331,10 +331,16 @@ void vm_await_start(struct vm *vm, const cpuset_t *waiting); #endif /* _SYS__CPUSET_H_ */ static __inline int -vcpu_rendezvous_pending(struct vm_eventinfo *info) +vcpu_rendezvous_pending(struct vcpu *vcpu, struct vm_eventinfo *info) { - - return (*((uintptr_t *)(info->rptr)) != 0); + /* + * This check isn't done with atomic operations or under a lock because + * there's no need to. If the vcpuid bit is set, the vcpu is part of a + * rendezvous and the bit won't be cleared until the vcpu enters the + * rendezvous. On rendezvous exit, the cpuset is cleared and the vcpu + * will see an empty cpuset. So, the races are harmless. + */ + return (CPU_ISSET(vcpu_vcpuid(vcpu), info->rptr)); } static __inline int diff --git a/sys/amd64/vmm/amd/svm.c b/sys/amd64/vmm/amd/svm.c index 2448501401e3..ee1154ef85b6 100644 --- a/sys/amd64/vmm/amd/svm.c +++ b/sys/amd64/vmm/amd/svm.c @@ -2053,7 +2053,7 @@ svm_run(void *vcpui, register_t rip, pmap_t pmap, struct vm_eventinfo *evinfo) break; } - if (vcpu_rendezvous_pending(evinfo)) { + if (vcpu_rendezvous_pending(vcpu->vcpu, evinfo)) { enable_gintr(); vm_exit_rendezvous(vcpu->vcpu, state->rip); break; diff --git a/sys/amd64/vmm/intel/vmx.c b/sys/amd64/vmm/intel/vmx.c index 4b65e254cc91..fa94c707001c 100644 --- a/sys/amd64/vmm/intel/vmx.c +++ b/sys/amd64/vmm/intel/vmx.c @@ -3071,7 +3071,7 @@ vmx_run(void *vcpui, register_t rip, pmap_t pmap, struct vm_eventinfo *evinfo) break; } - if (vcpu_rendezvous_pending(evinfo)) { + if (vcpu_rendezvous_pending(vcpu->vcpu, evinfo)) { enable_intr(); vm_exit_rendezvous(vcpu->vcpu, rip); break; diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index f0ee159dcbb9..123d35a983c0 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -1438,6 +1438,7 @@ vm_handle_rendezvous(struct vcpu *vcpu) if (CPU_CMP(&vm->rendezvous_req_cpus, &vm->rendezvous_done_cpus) == 0) { VMM_CTR0(vcpu, "Rendezvous completed"); + CPU_ZERO(&vm->rendezvous_req_cpus); vm->rendezvous_func = NULL; wakeup(&vm->rendezvous_func); break; @@ -1858,7 +1859,7 @@ vm_run(struct vcpu *vcpu, struct vm_exit *vme_user) pmap = vmspace_pmap(vm->vmspace); vme = &vcpu->exitinfo; - evinfo.rptr = &vm->rendezvous_func; + evinfo.rptr = &vm->rendezvous_req_cpus; evinfo.sptr = &vm->suspend; evinfo.iptr = &vcpu->reqidle; restart: From nobody Wed Feb 8 18:03:29 2023 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 4PBnt96Q7Jz3nkQb; Wed, 8 Feb 2023 18:03: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 4PBnt95vLMz3nMK; Wed, 8 Feb 2023 18:03:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675879409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h0rFRT8bMf6bgvpwc8fzmM7H5JseykY6bDb7NaPOVPM=; b=BqwrJr20OyY0iqgm/9cdkLjPYRpsBrAmlQogJO7UvY5x7KY+I0LVdkyTASOo1lMYU/I2XO pIBpddvYZ0ZblFraAc0RrfQeUmlfhCsFPsDnAx/gWM9ary9ceQVDbyRo4ZXGDMJo8YXqYK a+XLiqdJ9gter4CSTCuc2tYlEsf/cWcwxvL/4l0zHbFXP/W+vie3xDtvBmJM2Zk8/uS2X/ MxAIucjHO6YUs9lSCJfdbB0wCl6HqbDOTP83eDl5s0E7pNSpXdQjdnP/8kKwFgkvWmJBdE ee4fqbMawsBPR8+X2OFdOSriDhAM+a1Y0Fduo4/C9GA8dIz8Eug+ywKCSzZBvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675879409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h0rFRT8bMf6bgvpwc8fzmM7H5JseykY6bDb7NaPOVPM=; b=Rrr6x7HwNgyFOKb9sGEYtW1nHdEAi6C8ycYfw3Y35HdEDzbC7hmz/j4Mce0EHu+0UP3s7x eukCK+SGXkN9mJbrqkB21EVEgszVg5LXRsUaGv2KVrO/XLjTIsmD0g3g0S6ZXVyAStLwPp 9fVuNH+IxQepykIAiFFjsVYga3Z05OWaB/IwXh8BRWDOU34pEGrwrkkS0GJDj7WUCKP93j voWksGLkbFDjZNSGRPZY18qAGLMRT6zWxLYBm8tG9Min52aLs0zLiLJLdlsrhQvyI+bY5V DY96uyB9jZlnsue/0SpcdK3SBYDG8OrETOaiGuVk22BAJqSZxojT80I8rAOb3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675879409; a=rsa-sha256; cv=none; b=dfd8nht7lVqOSVD9LfFAK8joIh1yVnvK2LIRj5P73Qo8lk4jvDDGgdLV3X8cTmrzBqMXBY b5yu1RNgVpGRybjyOUbNle5tLocsRnK9i3dQYX3qFTjr+z2oERJ5kYPy2HjXEawVimhuVA m4InG8YHzYWRKafHZ5dELFiZ2tQuP2QZAlWLMAiGywIXuFjn2WRm9cGZtfHP8yUl+JwlEh 1obfdGw2WjnkWwYojKgtCMyx4XVgQisHuuXQyIU/3biEW/z+B2PBYQL/DHEZf+oIDKYnSQ 1KgtkokDqOn5eXsd8dd9HvE+hKHxb3XTnVZvAnwGB6Mp1KQJ0G2laRMN+3qEow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBnt94zWqz15x7; Wed, 8 Feb 2023 18:03:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 318I3TSe007560; Wed, 8 Feb 2023 18:03:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 318I3Tcf007559; Wed, 8 Feb 2023 18:03:29 GMT (envelope-from git) Date: Wed, 8 Feb 2023 18:03:29 GMT Message-Id: <202302081803.318I3Tcf007559@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 88bb08452ee3 - stable/13 - geli: split the initalization of HMAC 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: gordon X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 88bb08452ee3bbf67ad701a4909bbee6e8b200a6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=88bb08452ee3bbf67ad701a4909bbee6e8b200a6 commit 88bb08452ee3bbf67ad701a4909bbee6e8b200a6 Author: Mariusz Zaborski AuthorDate: 2023-02-08 16:41:06 +0000 Commit: Gordon Tetlow CommitDate: 2023-02-08 18:03:19 +0000 geli: split the initalization of HMAC GELI allows to read a user key from a standard input. However if user initialize multiple providers at once, the standard input will be empty for the second and next providers. This caused GELI to encrypt a master key with an empty key file. This commits initialize the HMAC with the key file, and then reuse the finalized structure to generate different encryption keys for different providers. Reported by: Nathan Dorfman Tested by: philip Security: FreeBSD-SA-23:01.geli Security: CVE-2023-0751 (cherry picked from commit 5fff09660e06a66bed6482da9c70df328e16bbb6) --- lib/geom/eli/geom_eli.c | 72 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 54 insertions(+), 18 deletions(-) diff --git a/lib/geom/eli/geom_eli.c b/lib/geom/eli/geom_eli.c index 4c04a9256b5e..8897af15b8f3 100644 --- a/lib/geom/eli/geom_eli.c +++ b/lib/geom/eli/geom_eli.c @@ -571,27 +571,35 @@ eli_genkey_passphrase(struct gctl_req *req, struct g_eli_metadata *md, bool new, return (0); } -static unsigned char * -eli_genkey(struct gctl_req *req, struct g_eli_metadata *md, unsigned char *key, - bool new) +static bool +eli_init_key_hmac_ctx(struct gctl_req *req, struct hmac_ctx *ctx, bool new) { - struct hmac_ctx ctx; - bool nopassphrase; int nfiles; + bool nopassphrase; nopassphrase = gctl_get_int(req, new ? "nonewpassphrase" : "nopassphrase"); - g_eli_crypto_hmac_init(&ctx, NULL, 0); - - nfiles = eli_genkey_files(req, new, "keyfile", &ctx, NULL, 0); - if (nfiles == -1) - return (NULL); - else if (nfiles == 0 && nopassphrase) { + g_eli_crypto_hmac_init(ctx, NULL, 0); + nfiles = eli_genkey_files(req, new, "keyfile", ctx, NULL, 0); + if (nfiles == -1) { + return (false); + } else if (nfiles == 0 && nopassphrase) { gctl_error(req, "No key components given."); - return (NULL); + return (false); } + return (true); +} + +static unsigned char * +eli_genkey(struct gctl_req *req, const struct hmac_ctx *ctxtemplate, + struct g_eli_metadata *md, unsigned char *key, bool new) +{ + struct hmac_ctx ctx; + + memcpy(&ctx, ctxtemplate, sizeof(ctx)); + if (eli_genkey_passphrase(req, md, new, &ctx) == -1) return (NULL); @@ -600,6 +608,22 @@ eli_genkey(struct gctl_req *req, struct g_eli_metadata *md, unsigned char *key, return (key); } +static unsigned char * +eli_genkey_single(struct gctl_req *req, struct g_eli_metadata *md, + unsigned char *key, bool new) +{ + struct hmac_ctx ctx; + unsigned char *rkey; + + if (!eli_init_key_hmac_ctx(req, &ctx, new)) { + return (NULL); + } + rkey = eli_genkey(req, &ctx, md, key, new); + explicit_bzero(&ctx, sizeof(ctx)); + + return (rkey); +} + static int eli_metadata_read(struct gctl_req *req, const char *prov, struct g_eli_metadata *md) @@ -711,6 +735,7 @@ eli_init(struct gctl_req *req) intmax_t val; int error, i, nargs, nparams, param; const int one = 1; + struct hmac_ctx ctxtemplate; nargs = gctl_get_int(req, "nargs"); if (nargs <= 0) { @@ -844,6 +869,10 @@ eli_init(struct gctl_req *req) */ nparams = req->narg - nargs - 1; + /* Generate HMAC context template. */ + if (!eli_init_key_hmac_ctx(req, &ctxtemplate, true)) + return; + /* Create new child request for each provider and issue to kernel */ for (i = 0; i < nargs; i++) { r = gctl_get_handle(); @@ -885,7 +914,7 @@ eli_init(struct gctl_req *req) arc4random_buf(md.md_mkeys, sizeof(md.md_mkeys)); /* Generate user key. */ - if (eli_genkey(r, &md, key, true) == NULL) { + if (eli_genkey(r, &ctxtemplate, &md, key, true) == NULL) { /* * Error generating key - details added to geom request * by eli_genkey(). @@ -1009,6 +1038,7 @@ out: /* Clear the cached metadata, including keys. */ explicit_bzero(&md, sizeof(md)); + explicit_bzero(&ctxtemplate, sizeof(ctxtemplate)); } static void @@ -1020,6 +1050,7 @@ eli_attach(struct gctl_req *req) off_t mediasize; int i, nargs, nparams, param; const int one = 1; + struct hmac_ctx ctxtemplate; nargs = gctl_get_int(req, "nargs"); if (nargs <= 0) { @@ -1035,6 +1066,10 @@ eli_attach(struct gctl_req *req) */ nparams = req->narg - nargs - 1; + /* Generate HMAC context template. */ + if (!eli_init_key_hmac_ctx(req, &ctxtemplate, false)) + return; + /* Create new child request for each provider and issue to kernel */ for (i = 0; i < nargs; i++) { r = gctl_get_handle(); @@ -1064,7 +1099,7 @@ eli_attach(struct gctl_req *req) goto out; } - if (eli_genkey(r, &md, key, false) == NULL) { + if (eli_genkey(r, &ctxtemplate, &md, key, false) == NULL) { /* * Error generating key - details added to geom request * by eli_genkey(). @@ -1098,6 +1133,7 @@ out: /* Clear sensitive data from memory. */ explicit_bzero(cached_passphrase, sizeof(cached_passphrase)); + explicit_bzero(&ctxtemplate, sizeof(ctxtemplate)); } static void @@ -1295,7 +1331,7 @@ eli_setkey_attached(struct gctl_req *req, struct g_eli_metadata *md) old = md->md_iterations; /* Generate key for Master Key encryption. */ - if (eli_genkey(req, md, key, true) == NULL) { + if (eli_genkey_single(req, md, key, true) == NULL) { explicit_bzero(key, sizeof(key)); return; } @@ -1330,7 +1366,7 @@ eli_setkey_detached(struct gctl_req *req, const char *prov, } /* Generate key for Master Key decryption. */ - if (eli_genkey(req, md, key, false) == NULL) { + if (eli_genkey_single(req, md, key, false) == NULL) { explicit_bzero(key, sizeof(key)); return; } @@ -1388,7 +1424,7 @@ eli_setkey_detached(struct gctl_req *req, const char *prov, explicit_bzero(mkey, sizeof(mkey)); /* Generate key for Master Key encryption. */ - if (eli_genkey(req, md, key, true) == NULL) { + if (eli_genkey_single(req, md, key, true) == NULL) { explicit_bzero(key, sizeof(key)); explicit_bzero(md, sizeof(*md)); return; @@ -1534,7 +1570,7 @@ eli_resume(struct gctl_req *req) return; } - if (eli_genkey(req, &md, key, false) == NULL) { + if (eli_genkey_single(req, &md, key, false) == NULL) { explicit_bzero(key, sizeof(key)); return; } From nobody Wed Feb 8 18:04:28 2023 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 4PBnvJ3rr7z3njfn; Wed, 8 Feb 2023 18:04: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 4PBnvJ34NLz3ndr; Wed, 8 Feb 2023 18:04:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675879468; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6sD/dwFdKFgPvaFUEREDt83BFgi2z9u0jeDphfFTE/k=; b=ZVCdpWz+OHpd6EUKDIbWZSEbg46NdEcA/t4AbYz3LICMcR8rqok6GVeaYZJ/4MQ5ks5+LR l25Sy3trClvvZ/zU/0HbeIvt055YOaM8hFXBpvqY2sED5Tq8v1XlYL/2BqG1kVKVGeX7Ft 0iAWbzLGj+HYVSqyrjVPvNk/XyNwNMtK7EFUzh+p2syraFW8BtaEfZUk8sP+/3Hxx9uhlf Phji+h92a++3gK1zS8k4JqLSEXoNMJ23X9IPDjVqhfULUMwb+NI5FWuADylTvC7Hje5NFs fhTtJsgYR1R/BuOF6zNy9HfzoIAwD/Wm6zvQzDLzMxMZDZ+l1vEPYj8O2/IjOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675879468; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6sD/dwFdKFgPvaFUEREDt83BFgi2z9u0jeDphfFTE/k=; b=vzJ8P/MVpo6Oz/+LyirlOFYYCybSBMiDMr97tTOfwRPjgsK7+6StZyGEA3nzJNkgwfHvHF l+5j5FAcw88mvwBw7Uq74Q5pEWAM+qQjXa90JBvLOv+RFfP3PogbPrP/vHrqvv/KGhUyc6 +XNTRKzEOlkd1nixqOPS+59y2SDSgA8Q/DlN9gxY3OZOfOemPDXFGLLgAX/jVBOrjaTMk8 xF9gIi73E7c9ing67r4rwyghE2j9r9yXwQuxYPJti9kFr981orexFlO+VpTjRI5R9PCwwu B1B94VzHrF/rmsfY/6+M8wzYFVE3Okg6dvU6tsj4OKrPF+nYpAeqNVGWZqWfNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675879468; a=rsa-sha256; cv=none; b=Dmbsgp1ITXcYAAsirzsY0dhayzz2jYEKP8VYAQy+7vzaaeD/Sf15eOm93n29d+7Lgg3l2t 8ob6Ibybm4eJl+Tj4DXx8ohZ9G52+rGSktGcGecQscAtvLiJZzpumSPUO4dBrsuxQ6nj/z 43OBsiEJwg1orF5wYNAUMF3pvLGhabOf+B8t8JUOjdLvAAETmbR2nfU4YW+oBvG1tYw02O t/O77bwvS/UBeaoAIIcP+cDkyE6CQmGFiUfu8NMXSTmq6c2e0Qb5yAe8n5ia5IkPnumlo6 ftCq+6iW5pSntqG0iCSrY/fsRQtzprKMqwdQ+psz6LLQxyX5+ejG/6MXgMOPLg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBnvJ27bKz15vG; Wed, 8 Feb 2023 18:04:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 318I4SSY007785; Wed, 8 Feb 2023 18:04:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 318I4SQH007784; Wed, 8 Feb 2023 18:04:28 GMT (envelope-from git) Date: Wed, 8 Feb 2023 18:04:28 GMT Message-Id: <202302081804.318I4SQH007784@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: a5afaf4e9abd - stable/12 - geli: split the initalization of HMAC 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: gordon X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: a5afaf4e9abd8d5e6cce5d6c433d2276bf9b8721 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=a5afaf4e9abd8d5e6cce5d6c433d2276bf9b8721 commit a5afaf4e9abd8d5e6cce5d6c433d2276bf9b8721 Author: Mariusz Zaborski AuthorDate: 2023-02-08 16:41:06 +0000 Commit: Gordon Tetlow CommitDate: 2023-02-08 18:04:14 +0000 geli: split the initalization of HMAC GELI allows to read a user key from a standard input. However if user initialize multiple providers at once, the standard input will be empty for the second and next providers. This caused GELI to encrypt a master key with an empty key file. This commits initialize the HMAC with the key file, and then reuse the finalized structure to generate different encryption keys for different providers. Reported by: Nathan Dorfman Tested by: philip Security: FreeBSD-SA-23:01.geli Security: CVE-2023-0751 (cherry picked from commit 5fff09660e06a66bed6482da9c70df328e16bbb6) --- lib/geom/eli/geom_eli.c | 72 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 54 insertions(+), 18 deletions(-) diff --git a/lib/geom/eli/geom_eli.c b/lib/geom/eli/geom_eli.c index a89ac69cf338..147807c46416 100644 --- a/lib/geom/eli/geom_eli.c +++ b/lib/geom/eli/geom_eli.c @@ -565,27 +565,35 @@ eli_genkey_passphrase(struct gctl_req *req, struct g_eli_metadata *md, bool new, return (0); } -static unsigned char * -eli_genkey(struct gctl_req *req, struct g_eli_metadata *md, unsigned char *key, - bool new) +static bool +eli_init_key_hmac_ctx(struct gctl_req *req, struct hmac_ctx *ctx, bool new) { - struct hmac_ctx ctx; - bool nopassphrase; int nfiles; + bool nopassphrase; nopassphrase = gctl_get_int(req, new ? "nonewpassphrase" : "nopassphrase"); - g_eli_crypto_hmac_init(&ctx, NULL, 0); - - nfiles = eli_genkey_files(req, new, "keyfile", &ctx, NULL, 0); - if (nfiles == -1) - return (NULL); - else if (nfiles == 0 && nopassphrase) { + g_eli_crypto_hmac_init(ctx, NULL, 0); + nfiles = eli_genkey_files(req, new, "keyfile", ctx, NULL, 0); + if (nfiles == -1) { + return (false); + } else if (nfiles == 0 && nopassphrase) { gctl_error(req, "No key components given."); - return (NULL); + return (false); } + return (true); +} + +static unsigned char * +eli_genkey(struct gctl_req *req, const struct hmac_ctx *ctxtemplate, + struct g_eli_metadata *md, unsigned char *key, bool new) +{ + struct hmac_ctx ctx; + + memcpy(&ctx, ctxtemplate, sizeof(ctx)); + if (eli_genkey_passphrase(req, md, new, &ctx) == -1) return (NULL); @@ -594,6 +602,22 @@ eli_genkey(struct gctl_req *req, struct g_eli_metadata *md, unsigned char *key, return (key); } +static unsigned char * +eli_genkey_single(struct gctl_req *req, struct g_eli_metadata *md, + unsigned char *key, bool new) +{ + struct hmac_ctx ctx; + unsigned char *rkey; + + if (!eli_init_key_hmac_ctx(req, &ctx, new)) { + return (NULL); + } + rkey = eli_genkey(req, &ctx, md, key, new); + explicit_bzero(&ctx, sizeof(ctx)); + + return (rkey); +} + static int eli_metadata_read(struct gctl_req *req, const char *prov, struct g_eli_metadata *md) @@ -705,6 +729,7 @@ eli_init(struct gctl_req *req) intmax_t val; int error, i, nargs, nparams, param; const int one = 1; + struct hmac_ctx ctxtemplate; nargs = gctl_get_int(req, "nargs"); if (nargs <= 0) { @@ -852,6 +877,10 @@ eli_init(struct gctl_req *req) */ nparams = req->narg - nargs - 1; + /* Generate HMAC context template. */ + if (!eli_init_key_hmac_ctx(req, &ctxtemplate, true)) + return; + /* Create new child request for each provider and issue to kernel */ for (i = 0; i < nargs; i++) { r = gctl_get_handle(); @@ -893,7 +922,7 @@ eli_init(struct gctl_req *req) arc4random_buf(md.md_mkeys, sizeof(md.md_mkeys)); /* Generate user key. */ - if (eli_genkey(r, &md, key, true) == NULL) { + if (eli_genkey(r, &ctxtemplate, &md, key, true) == NULL) { /* * Error generating key - details added to geom request * by eli_genkey(). @@ -1017,6 +1046,7 @@ out: /* Clear the cached metadata, including keys. */ explicit_bzero(&md, sizeof(md)); + explicit_bzero(&ctxtemplate, sizeof(ctxtemplate)); } static void @@ -1028,6 +1058,7 @@ eli_attach(struct gctl_req *req) off_t mediasize; int i, nargs, nparams, param; const int one = 1; + struct hmac_ctx ctxtemplate; nargs = gctl_get_int(req, "nargs"); if (nargs <= 0) { @@ -1043,6 +1074,10 @@ eli_attach(struct gctl_req *req) */ nparams = req->narg - nargs - 1; + /* Generate HMAC context template. */ + if (!eli_init_key_hmac_ctx(req, &ctxtemplate, false)) + return; + /* Create new child request for each provider and issue to kernel */ for (i = 0; i < nargs; i++) { r = gctl_get_handle(); @@ -1072,7 +1107,7 @@ eli_attach(struct gctl_req *req) goto out; } - if (eli_genkey(r, &md, key, false) == NULL) { + if (eli_genkey(r, &ctxtemplate, &md, key, false) == NULL) { /* * Error generating key - details added to geom request * by eli_genkey(). @@ -1106,6 +1141,7 @@ out: /* Clear sensitive data from memory. */ explicit_bzero(cached_passphrase, sizeof(cached_passphrase)); + explicit_bzero(&ctxtemplate, sizeof(ctxtemplate)); } static void @@ -1277,7 +1313,7 @@ eli_setkey_attached(struct gctl_req *req, struct g_eli_metadata *md) old = md->md_iterations; /* Generate key for Master Key encryption. */ - if (eli_genkey(req, md, key, true) == NULL) { + if (eli_genkey_single(req, md, key, true) == NULL) { explicit_bzero(key, sizeof(key)); return; } @@ -1312,7 +1348,7 @@ eli_setkey_detached(struct gctl_req *req, const char *prov, } /* Generate key for Master Key decryption. */ - if (eli_genkey(req, md, key, false) == NULL) { + if (eli_genkey_single(req, md, key, false) == NULL) { explicit_bzero(key, sizeof(key)); return; } @@ -1370,7 +1406,7 @@ eli_setkey_detached(struct gctl_req *req, const char *prov, explicit_bzero(mkey, sizeof(mkey)); /* Generate key for Master Key encryption. */ - if (eli_genkey(req, md, key, true) == NULL) { + if (eli_genkey_single(req, md, key, true) == NULL) { explicit_bzero(key, sizeof(key)); explicit_bzero(md, sizeof(*md)); return; @@ -1516,7 +1552,7 @@ eli_resume(struct gctl_req *req) return; } - if (eli_genkey(req, &md, key, false) == NULL) { + if (eli_genkey_single(req, &md, key, false) == NULL) { explicit_bzero(key, sizeof(key)); return; } From nobody Wed Feb 8 18:15:16 2023 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 4PBp7m3dkqz3nkf0; Wed, 8 Feb 2023 18:15: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 4PBp7m2vWbz3qN5; Wed, 8 Feb 2023 18:15:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675880116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gI4hbVaDOjd8u74e+SqKKu3fUsLp1TF7qPIrOQnNx4U=; b=Fu0Qu+bzHnccWbHVW9N5ADV8XMeuXl8mws2HETUqsJ1tCgOWQToe9tVCtGV1BO43etbZC9 Tm3QcQzdejARRiuAcOmx0rTIE3cZd/SKibVebDf5uaF9UO5f1LVq/Ubvm/MEjqifPwrwuJ G5r9FrI9cREOUt0bmdsKf6nEAFW+++tRZDDX1LJaPW9Ycw3YkTTsZ8TawBqzgXaxWpwY0D NqB6kyGxpkNBUTngz4NnIDNc0lAw3xzhB8FbWWJVLN0Ms44VbJYTk2kE29J6qYgiqpY2cE H9tgfOpHRy2nyWMkyFcS2EIlozJdGzDiWED8hiQyXHQbH9QxUuOfJlQJgoFIWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675880116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gI4hbVaDOjd8u74e+SqKKu3fUsLp1TF7qPIrOQnNx4U=; b=qUmLjXEP6oVkGBkug1IvTjwqDrNyzLcST5bz/6JaOIciSfHu6uGdWoAnlgPB6TLecm2rOM bcXiWG9RAB2noWH+2FEqSVelTqqwxeO92jPiYgdesCxAqDtRV1+7uuECkV17S/xX2OD+M7 eBu0KMLvIIBpqSUbX7riwl2IDtOzfwiRiTpHO8E7ZiZwkp+J2oFYdLgZM8l2gzVrZKVMbT ynOnGrziWht2K9q6Kb0KS1rirDr+cJjNPuHVM/VYUGAQ7r31GNdNqeZq56x3qSiYNIAxaJ OrW6Ls6ZiLXbjpPkuTD0e61lnk+Kc4jfSw3p/3qvickMdUzys0Y6QBxxl7Ma+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675880116; a=rsa-sha256; cv=none; b=hGJdL8jKfM9zNKZpW4737+F0en1Jr7MEpQaCMryOGN5Yvj2yaVEPP4KK+fzpYnlEuRQJaw i+P+xSWFEWa+Ev2GHuVFVVaKtFwhtKZeotb46hV2ONYW5Qt6QejZQ6mIigM0HsNGqOOCMV soEYLBUKh80wkw1cBdsueMfa6SCZTo1NHgjHyAIFr4KI0kJ6RMpcEpkjx0papH7627Z9ox yjZTOOXtzInCVcqbabLZwK/yLz1rMfFAf5n57ZgA+YHwRmgIxTfT3YNom2AnLaeUlk4QCM YCkIpU7da4/M9HPjD6QgZPYO8nto6nR54BD7VLEZhp6zJU8e8EMTXd9jx1e/tg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBp7m1xmYz167S; Wed, 8 Feb 2023 18:15:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 318IFGv7022260; Wed, 8 Feb 2023 18:15:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 318IFG4W022259; Wed, 8 Feb 2023 18:15:16 GMT (envelope-from git) Date: Wed, 8 Feb 2023 18:15:16 GMT Message-Id: <202302081815.318IFG4W022259@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 9e3b86743c4b - releng/13.1 - contrib/tzdata: import tzdata 2022g 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: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.1 X-Git-Reftype: branch X-Git-Commit: 9e3b86743c4b627240b4e3dacc37f500fb917df0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.1 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=9e3b86743c4b627240b4e3dacc37f500fb917df0 commit 9e3b86743c4b627240b4e3dacc37f500fb917df0 Author: Philip Paeps AuthorDate: 2022-11-30 01:36:28 +0000 Commit: Gordon Tetlow CommitDate: 2023-02-08 16:08:28 +0000 contrib/tzdata: import tzdata 2022g Changes: https://github.com/eggert/tz/blob/2022g/NEWS tzdata 2022g and later split America/Ciudad_Juarez from America/Ojinaga. Ensure this file is removed in builds WITHOUT_ZONEINFO. Approved by: so Security: FreeBSD-EN-23:01.tzdata (cherry picked from commit cf1ad5351036884e0a2e21d1bc9b712448467741) (cherry picked from commit 821549a9dfdf69f533feb84914b09450cd7311b6) (cherry picked from commit e851e0aabdffb4f193e05645ffa45593f0603a1d) --- contrib/tzdata/Makefile | 55 +++++++---- contrib/tzdata/NEWS | 89 ++++++++++++++++- contrib/tzdata/africa | 4 + contrib/tzdata/asia | 2 +- contrib/tzdata/backward | 1 + contrib/tzdata/backzone | 55 ++++++++++- contrib/tzdata/europe | 28 +++++- contrib/tzdata/northamerica | 161 ++++++++++++++++++------------- contrib/tzdata/southamerica | 9 +- contrib/tzdata/theory.html | 1 - contrib/tzdata/version | 2 +- contrib/tzdata/zone.tab | 26 ++--- contrib/tzdata/zone1970.tab | 26 ++--- tools/build/mk/OptionalObsoleteFiles.inc | 1 + 14 files changed, 335 insertions(+), 125 deletions(-) diff --git a/contrib/tzdata/Makefile b/contrib/tzdata/Makefile index 34cec49d3af4..afb9d538a203 100644 --- a/contrib/tzdata/Makefile +++ b/contrib/tzdata/Makefile @@ -196,6 +196,7 @@ PACKRATLIST= UTF8_LOCALE= en_US.utf8 # Non-default libraries needed to link. +# On some hosts, this should have -lintl unless CFLAGS has -DHAVE_GETTEXT=0. LDLIBS= # Add the following to the end of the "CFLAGS=" line as needed to override @@ -208,14 +209,18 @@ LDLIBS= # For example, N is 252460800 on AmigaOS. # -DHAVE_DECL_ASCTIME_R=0 if does not declare asctime_r # -DHAVE_DECL_ENVIRON if declares 'environ' +# -DHAVE_DECL_TIMEGM=0 if does not declare timegm # -DHAVE_DIRECT_H if mkdir needs (MS-Windows) -# -DHAVE_GENERIC=0 if _Generic does not work -# -DHAVE_GETRANDOM if getgrandom works (e.g., GNU/Linux)* -# -DHAVE_GETTEXT if 'gettext' works (e.g., GNU/Linux, FreeBSD, Solaris)* +# -DHAVE_GENERIC=0 if _Generic does not work* +# -DHAVE_GETRANDOM if getrandom works (e.g., GNU/Linux), +# -DHAVE_GETRANDOM=0 to avoid using getrandom +# -DHAVE_GETTEXT if gettext works (e.g., GNU/Linux, FreeBSD, Solaris), +# where LDLIBS also needs to contain -lintl on some hosts; +# -DHAVE_GETTEXT=0 to avoid using gettext # -DHAVE_INCOMPATIBLE_CTIME_R if your system's time.h declares # ctime_r and asctime_r incompatibly with the POSIX standard # (Solaris when _POSIX_PTHREAD_SEMANTICS is not defined). -# -DHAVE_INTTYPES_H if you have a non-C99 compiler with +# -DHAVE_INTTYPES_H=0 if does not work* # -DHAVE_LINK=0 if your system lacks a link function # -DHAVE_LOCALTIME_R=0 if your system lacks a localtime_r function # -DHAVE_LOCALTIME_RZ=0 if you do not want zdump to use localtime_rz @@ -225,15 +230,17 @@ LDLIBS= # functions like 'link' or variables like 'tzname' required by POSIX # -DHAVE_SETENV=0 if your system lacks the setenv function # -DHAVE_SNPRINTF=0 if your system lacks the snprintf function -# -DHAVE_STDINT_H if you have a non-C99 compiler with * +# -DHAVE_STDCKDINT_H=0 if neither nor substitutes like +# __builtin_add_overflow work* +# -DHAVE_STDINT_H=0 if does not work* # -DHAVE_STRFTIME_L if declares locale_t and strftime_l # -DHAVE_STRDUP=0 if your system lacks the strdup function # -DHAVE_STRTOLL=0 if your system lacks the strtoll function # -DHAVE_SYMLINK=0 if your system lacks the symlink function -# -DHAVE_SYS_STAT_H=0 if your compiler lacks a * +# -DHAVE_SYS_STAT_H=0 if does not work* # -DHAVE_TZSET=0 if your system lacks a tzset function -# -DHAVE_UNISTD_H=0 if your compiler lacks a * -# -DHAVE_UTMPX_H=0 if your compiler lacks a * +# -DHAVE_UNISTD_H=0 if does not work* +# -DHAVE_UTMPX_H=0 if does not work* # -Dlocale_t=XXX if your system uses XXX instead of locale_t # -DRESERVE_STD_EXT_IDS if your platform reserves standard identifiers # with external linkage, e.g., applications cannot define 'localtime'. @@ -280,7 +287,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ -Wdeclaration-after-statement -Wdouble-promotion \ -Wduplicated-branches -Wduplicated-cond \ -Wformat=2 -Wformat-overflow=2 -Wformat-signedness -Wformat-truncation \ - -Winit-self -Wlogical-op \ + -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wnull-dereference \ -Wold-style-definition -Woverlength-strings -Wpointer-arith \ @@ -293,7 +300,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ -Wtrampolines -Wundef -Wuninitialized -Wunused-macros -Wuse-after-free=3 \ -Wvariadic-macros -Wvla -Wwrite-strings \ -Wno-address -Wno-format-nonliteral -Wno-sign-compare \ - -Wno-type-limits -Wno-unused-parameter + -Wno-type-limits # # If your system has a "GMT offset" field in its "struct tm"s # (or if you decide to add such a field in your system's "time.h" file), @@ -340,14 +347,11 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ # If you want functions that were inspired by early versions of X3J11's work, # add # -DSTD_INSPIRED -# to the end of the "CFLAGS=" line. This arranges for the functions -# "offtime", "timelocal", "timegm", "timeoff", -# "posix2time", and "time2posix" to be added to the time conversion library. +# to the end of the "CFLAGS=" line. This arranges for the following +# functions to be added to the time conversion library. # "offtime" is like "gmtime" except that it accepts a second (long) argument # that gives an offset to add to the time_t when converting it. # "timelocal" is equivalent to "mktime". -# "timegm" is like "timelocal" except that it turns a struct tm into -# a time_t using UT (rather than local time as "timelocal" does). # "timeoff" is like "timegm" except that it accepts a second (long) argument # that gives an offset to use when converting to a time_t. # "posix2time" and "time2posix" are described in an included manual page. @@ -495,6 +499,11 @@ TARFLAGS= `if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; \ # Flags to give 'gzip' when making a distribution. GZIPFLAGS= -9n +# When comparing .tzs files, use GNU diff's -F'^TZ=' option if supported. +# This makes it easier to see which Zone has been affected. +DIFF_TZS= diff -u$$(! diff -u -F'^TZ=' - - <>/dev/null >&0 2>&1 \ + || echo ' -F^TZ=') + ############################################################################### #MAKE= make @@ -773,7 +782,8 @@ tzselect: tzselect.ksh version chmod +x $@.out mv $@.out $@ -check: check_character_set check_white_space check_links \ +check: check_back check_mild +check_mild: check_character_set check_white_space check_links \ check_name_lengths check_slashed_abbrs check_sorted \ check_tables check_web check_ziguard check_zishrink check_tzs @@ -824,16 +834,19 @@ check_slashed_abbrs: $(TDATA_TO_CHECK) CHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n; i++) print a[1], a[i]; } check_sorted: backward backzone iso3166.tab zone.tab zone1970.tab - $(AWK) '/^Link/ {printf "%.5d %s\n", g, $$3} /^$$/ {g++}' \ + $(AWK) '/^Link/ {printf "%.5d %s\n", g, $$3} !/./ {g++}' \ backward | LC_ALL=C sort -cu $(AWK) '/^Zone/ {print $$2}' backzone | LC_ALL=C sort -cu touch $@ -check_links: checklinks.awk $(TDATA_TO_CHECK) tzdata.zi +check_back: checklinks.awk $(TDATA_TO_CHECK) $(AWK) \ -v DATAFORM=$(DATAFORM) \ -v backcheck=backward \ -f checklinks.awk $(TDATA_TO_CHECK) + touch $@ + +check_links: checklinks.awk tzdata.zi $(AWK) \ -v DATAFORM=$(DATAFORM) \ -f checklinks.awk tzdata.zi @@ -849,7 +862,7 @@ check_tables: checktab.awk $(YDATA) backward $(ZONETABLES) check_tzs: $(TZS) $(TZS_NEW) if test -s $(TZS); then \ - diff -u $(TZS) $(TZS_NEW); \ + $(DIFF_TZS) $(TZS) $(TZS_NEW); \ else \ cp $(TZS_NEW) $(TZS); \ fi @@ -1050,7 +1063,7 @@ $(TIME_T_ALTERNATIVES): $(VERSION_DEPS) TZS_YEAR="$$range" TZS_CUTOFF_FLAG="-t $$range" \ D=$$wd/$@.dir \ to$$range.tzs) && \ - diff -u $(TIME_T_ALTERNATIVES_HEAD).dir/to$$range.tzs \ + $(DIFF_TZS) $(TIME_T_ALTERNATIVES_HEAD).dir/to$$range.tzs \ $@.dir/to$$range.tzs && \ if diff -q Makefile Makefile 2>/dev/null; then \ quiet_option='-q'; \ @@ -1220,7 +1233,7 @@ zdump.o: version.h zic.o: private.h tzfile.h version.h .PHONY: ALL INSTALL all -.PHONY: check check_time_t_alternatives +.PHONY: check check_mild check_time_t_alternatives .PHONY: check_web check_zishrink .PHONY: clean clean_misc dummy.zd force_tzs .PHONY: install install_data maintainer-clean names diff --git a/contrib/tzdata/NEWS b/contrib/tzdata/NEWS index 086151073a3b..701e490e4834 100644 --- a/contrib/tzdata/NEWS +++ b/contrib/tzdata/NEWS @@ -1,5 +1,91 @@ News for the tz database +Release 2022g - 2022-11-29 08:58:31 -0800 + + Briefly: + The northern edge of Chihuahua changes to US timekeeping. + Much of Greenland stops changing clocks after March 2023. + Fix some pre-1996 timestamps in northern Canada. + C89 is now deprecated; please use C99 or later. + Portability fixes for AIX, libintl, MS-Windows, musl, z/OS + In C code, use more C23 features if available. + C23 timegm now supported by default + Fixes for unlikely integer overflows + + Changes to future timestamps + + In the Mexican state of Chihuahua, the border strip near the US + will change to agree with nearby US locations on 2022-11-30. + The strip's western part, represented by Ciudad Juárez, switches + from -06 all year to -07/-06 with US DST rules, like El Paso, TX. + The eastern part, represented by Ojinaga, will observe US DST next + year, like Presidio, TX. (Thanks to Heitor David Pinto.) + A new Zone America/Ciudad_Juarez splits from America/Ojinaga. + + Much of Greenland, represented by America/Nuuk, stops observing + winter time after March 2023, so its daylight saving time becomes + standard time. (Thanks to Jonas Nyrup and Jürgen Appel.) + + Changes to past timestamps + + Changes for pre-1996 northern Canada (thanks to Chris Walton): + + Merge America/Iqaluit and America/Pangnirtung into the former, + with a backward compatibility link for the latter name. + There is no good evidence the two locations differ since 1970. + This change affects pre-1996 America/Pangnirtung timestamps. + + Cambridge Bay, Inuvik, Iqaluit, Rankin Inlet, Resolute and + Yellowknife did not observe DST in 1965, and did observe DST + from 1972 through 1979. + + Whitehorse moved from -09 to -08 on 1966-02-27, not 1967-05-28. + + Colombia's 1993 fallback was 02-06 24:00, not 04-04 00:00. + (Thanks to Alois Treindl.) + + Singapore's 1981-12-31 change was at 16:00 UTC (23:30 local time), + not 24:00 local time. (Thanks to Geoff Clare via Robert Elz.) + + Changes to code + + Although tzcode still works with C89, bugs found in recent routine + maintenance indicate that bitrot has set in and that in practice + C89 is no longer used to build tzcode. As it is a maintenance + burden, support for C89 is planned to be removed soon. Instead, + please use compilers compatible with C99, C11, C17, or C23. + + timegm, which tzcode implemented in 1989, will finally be + standardized 34 years later as part of C23, so timegm is now + supported even if STD_INSPIRED is not defined. + + Fix bug in zdump's tzalloc emulation on hosts that lack tm_zone. + (Problem reported by Đoàn Trần Công Danh.) + + Fix bug in zic on hosts where malloc(0) yields NULL on success. + (Problem reported by Tim McBrayer for AIX 6.1.) + + Fix zic configuration to avoid linkage failures on some platforms. + (Problems reported by Gilmore Davidson and Igor Ivanov.) + + Work around MS-Windows nmake incompatibility with POSIX. + (Problem reported by Manuela Friedrich.) + + Port mktime and strftime to debugging platforms where accessing + uninitialized data has undefined behavior (strftime problem + reported by Robert Elz). + + Check more carefully for unlikely integer overflows, preferring + C23 to overflow checking by hand, as the latter has + had obscure bugs. + + Changes to build procedure + + New Makefile rule check_mild that skips checking whether Link + lines are in the file 'backward'. (Inspired by a suggestion from + Stephen Colebourne.) + + Release 2022f - 2022-10-28 18:04:57 -0700 Briefly: @@ -16,7 +102,7 @@ Release 2022f - 2022-10-28 18:04:57 -0700 In C code, use some C23 features if available. Remove no-longer-needed workaround for Qt bug 53071. - Changes to future timestamps. + Changes to future timestamps Mexico will no longer observe DST after 2022, except for areas near the US border that continue to observe US DST rules. @@ -24,6 +110,7 @@ Release 2022f - 2022-10-28 18:04:57 -0700 from -07 (-06 with DST) to year-round -06, thus not changing its clocks that day. The new law states that Chihuahua near the US border no longer observes US DST. + (Thanks to gera for the heads-up about Chihuahua.) Fiji will not observe DST in 2022/3. (Thanks to Shalvin Narayan.) For now, assume DST is suspended indefinitely. diff --git a/contrib/tzdata/africa b/contrib/tzdata/africa index 92a61259f916..cfb9283c045d 100644 --- a/contrib/tzdata/africa +++ b/contrib/tzdata/africa @@ -588,6 +588,10 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis # Agalega Is, Rodriguez # no information; probably like Indian/Mauritius + +# Morocco +# See Africa/Ceuta for Spanish Morocco. + # From Alex Krivenyshev (2008-05-09): # Here is an article that Morocco plan to introduce Daylight Saving Time between # 1 June, 2008 and 27 September, 2008. diff --git a/contrib/tzdata/asia b/contrib/tzdata/asia index 6e8ad282ee61..199e6ad6adc3 100644 --- a/contrib/tzdata/asia +++ b/contrib/tzdata/asia @@ -3585,7 +3585,7 @@ Zone Asia/Singapore 6:55:25 - LMT 1901 Jan 1 7:20 - +0720 1941 Sep 1 7:30 - +0730 1942 Feb 16 9:00 - +09 1945 Sep 12 - 7:30 - +0730 1982 Jan 1 + 7:30 - +0730 1981 Dec 31 16:00u 8:00 - +08 # Spratly Is diff --git a/contrib/tzdata/backward b/contrib/tzdata/backward index 4c1c5d5f8f71..0ae5d74108e6 100644 --- a/contrib/tzdata/backward +++ b/contrib/tzdata/backward @@ -267,6 +267,7 @@ Link America/Tijuana America/Ensenada Link America/Indiana/Indianapolis America/Fort_Wayne Link America/Toronto America/Montreal Link America/Toronto America/Nipigon +Link America/Iqaluit America/Pangnirtung Link America/Rio_Branco America/Porto_Acre Link America/Winnipeg America/Rainy_River Link America/Argentina/Cordoba America/Rosario diff --git a/contrib/tzdata/backzone b/contrib/tzdata/backzone index b4ebd2e478c3..7803c57d095d 100644 --- a/contrib/tzdata/backzone +++ b/contrib/tzdata/backzone @@ -7,6 +7,10 @@ # tz@iana.org for general use in the future). For more, please see # the file CONTRIBUTING in the tz distribution. +# When proposing changes to this file, please use 'git format-patch' +# format, either by attaching the resulting .patch file to your email, +# or by using 'git send-email'. This will help maintainers save time. + # From Paul Eggert (2014-10-31): @@ -750,6 +754,55 @@ Zone America/Nipigon -5:53:04 - LMT 1895 -5:00 1:00 EDT 1942 Feb 9 2:00s -5:00 Canada E%sT +# From Rives McDow (1999-11-08): +# On October 31, when the rest of Nunavut went to Central time, +# Pangnirtung wobbled. Here is the result of their wobble: +# +# The following businesses and organizations in Pangnirtung use Central Time: +# +# First Air, Power Corp, Nunavut Construction, Health Center, RCMP, +# Eastern Arctic National Parks, A & D Specialist +# +# The following businesses and organizations in Pangnirtung use Eastern Time: +# +# Hamlet office, All other businesses, Both schools, Airport operator +# +# This has made for an interesting situation there, which warranted the news. +# No one there that I spoke with seems concerned, or has plans to +# change the local methods of keeping time, as it evidently does not +# really interfere with any activities or make things difficult locally. +# They plan to celebrate New Year's turn-over twice, one hour apart, +# so it appears that the situation will last at least that long. +# The Nunavut Intergovernmental Affairs hopes that they will "come to +# their senses", but the locals evidently don't see any problem with +# the current state of affairs. + +# From Michaela Rodrigue, writing in the +# Nunatsiaq News (1999-11-19): +# http://www.nunatsiaqonline.ca/archives/nunavut991130/nvt91119_17.html +# Clyde River, Pangnirtung and Sanikiluaq now operate with two time zones, +# central - or Nunavut time - for government offices, and eastern time +# for municipal offices and schools.... Igloolik [was similar but then] +# made the switch to central time on Saturday, Nov. 6. + +# From Chris Walton (2022-11-06): +# The implication is that Pangnirtung and Qikiqtarjuaq have observed Eastern +# Time as far back as 1984 (and likely even further back than that). +# It is possible that these communities never actually observed Atlantic +# Time, but that would be difficult to prove. +# From Paul Eggert (2022-11-06): +# This is in 'backzone' as we have no good evidence that Pangnirtung differs +# from America/Iqaluit since 1970. A Google Books snippet view of +# volume 2, page 186 of "Pilot of Arctic Canada", published 1959 by +# the Canadian Hydrographic Service, suggests (though does not state) +# that Pangnirtung observed EST then. +# +# aka Panniqtuuq +Zone America/Pangnirtung 0 - -00 1921 # trading post est. + -5:00 NT_YK E%sT 1999 Oct 31 2:00 + -6:00 Canada C%sT 2000 Oct 29 2:00 + -5:00 Canada E%sT + # United States # # From Paul Eggert (2018-03-18): @@ -1043,7 +1096,7 @@ Zone Asia/Kuala_Lumpur 6:46:46 - LMT 1901 Jan 1 7:20 - +0720 1941 Sep 1 7:30 - +0730 1942 Feb 16 9:00 - +09 1945 Sep 12 - 7:30 - +0730 1982 Jan 1 + 7:30 - +0730 1981 Dec 31 16:00u 8:00 - +08 # Kuwait diff --git a/contrib/tzdata/europe b/contrib/tzdata/europe index 6ac41e7272a2..a3547b4f81a4 100644 --- a/contrib/tzdata/europe +++ b/contrib/tzdata/europe @@ -1103,7 +1103,30 @@ Zone Atlantic/Faroe -0:27:04 - LMT 1908 Jan 11 # Tórshavn # "National Park" by Executive Order: # http://naalakkersuisut.gl/~/media/Nanoq/Files/Attached%20Files/Engelske-tekster/Legislation/Executive%20Order%20National%20Park.rtf # It is their only National Park. -# + +# From Jonas Nyrup (2022-11-24): +# On last Saturday in October 2023 when DST ends America/Nuuk will switch +# from -03/-02 to -02/-01 +# https://sermitsiaq.ag/forslagtidsforskel-danmark-mindskes-sommertid-beholdes +# ... +# https://sermitsiaq.ag/groenland-skifte-tidszone-trods-bekymringer +# +# From Jürgen Appel (2022-11-25): +# https://ina.gl/samlinger/oversigt-over-samlinger/samling/dagsordener/dagsorden.aspx?lang=da&day=24-11-2022 +# If I understand this correctly, from the next planned switch to +# summer time, Greenland will permanently stay at that time, i.e. no +# switch back to winter time in 2023 will occur. +# +# From Paul Eggert (2022-11-28): +# The official document in Danish +# https://naalakkersuisut.gl/-/media/naalakkersuisut/filer/kundgoerelser/2022/11/2511/31_da_inatsisartutlov-om-tidens-bestemmelse.pdf?la=da&hash=A33597D8A38CC7038465241119EF34F3 +# says standard time for Greenland is -02, that Naalakkersuisut can lay down +# rules for DST and can require some areas to use a different time zone, +# and that this all takes effect 2023-03-25 22:00. The abovementioned +# "bekymringer" URL says the intent is no transition March 25, that +# Greenland will not go back to winter time in fall 2023, and that +# only America/Nuuk is affected (though further changes may occur). + # Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Thule 1991 1992 - Mar lastSun 2:00 1:00 D Rule Thule 1991 1992 - Sep lastSun 2:00 0 S @@ -1126,7 +1149,8 @@ Zone America/Scoresbysund -1:27:52 - LMT 1916 Jul 28 # Ittoqqortoormiit -1:00 EU -01/+00 Zone America/Nuuk -3:26:56 - LMT 1916 Jul 28 # Godthåb -3:00 - -03 1980 Apr 6 2:00 - -3:00 EU -03/-02 + -3:00 EU -03/-02 2023 Mar 25 22:00 + -2:00 - -02 Zone America/Thule -4:35:08 - LMT 1916 Jul 28 # Pituffik -4:00 Thule A%sT diff --git a/contrib/tzdata/northamerica b/contrib/tzdata/northamerica index df1954359cce..d50581d00774 100644 --- a/contrib/tzdata/northamerica +++ b/contrib/tzdata/northamerica @@ -1969,6 +1969,37 @@ Zone America/Fort_Nelson -8:10:47 - LMT 1884 # Northwest Territories, Nunavut, Yukon +# From Chris Walton (2022-11-06): +# Whitehorse Star - Thursday April 22, 1965 - page 1 +# title: DST Starts Monday ... +# https://www.newspapers.com/image/578587481/ +# The title of this first article is wrong and/or misleading. +# Also, the start time shown in the article is vague; it simply says "after +# midnight" when it probably should have stated 2:00a.m.... +# +# Whitehorse Star - Monday October 25, 1965 - page 15 ... +# https://www.newspapers.com/image/578589147/ +# The 1965 Yukon Council minutes can be found here: +# http://assets.yukonarchives.ca/PER_YG_06_1965_C20_S02_v1.pdf +# ... I do not currently believe that NWT touched any of its clocks in 1965.... +# +# Whitehorse Star - Thursday Feb 24,1966 - page 2 +# title: It's Time for YDT ... +# https://www.newspapers.com/image/578575979/ ... +# America/Whitehorse as a permanent change from UTC-9(YST) to +# UTC-8(PST) at 00:00 on Sunday February 27, 1966.... +# +# Whitehorse Star - Friday April 28,1972 - page 6 +# title: Daylight Saving Time for N.W.T.... +# https://www.newspapers.com/image/578701610/ ... +# Nunavut and NWT zones ... DST starting in 1972.... Start and End ... +# should be the same as the rest of Canada +# +# +# From Paul Eggert (2022-11-06): +# For now, assume Yukon's 1965-04-22 spring forward was 00:00 -> 02:00, as this +# seems likely than 02:00 -> 04:00 and matches "after midnight". + # From Paul Eggert (2006-03-22): # Dawson switched to PST in 1973. Inuvik switched to MST in 1979. # Mathew Englander (1996-10-07) gives the following refs: @@ -2083,6 +2114,13 @@ Zone America/Fort_Nelson -8:10:47 - LMT 1884 # * Interpretation Act, RSY 2002, c 125 # https://www.canlii.org/en/yk/laws/stat/rsy-2002-c-125/latest/rsy-2002-c-125.html +# From Chris Walton (2022-11-06): +# The 5th edition of the Atlas of Canada contains a time zone map that +# shows both legislated and observed time zone boundaries. +# All communities on Baffin Island are shown to be observing Eastern time. +# The date on the map is 1984. +# https://ftp.maps.canada.ca/pub/nrcan_rncan/raster/atlas_5_ed/eng/other/referencemaps/mcr4056.pdf + # From Rives McDow (1999-09-04): # Nunavut ... moved ... to incorporate the whole territory into one time zone. # Nunavut moves to single time zone Oct. 31 @@ -2095,40 +2133,7 @@ Zone America/Fort_Nelson -8:10:47 - LMT 1884 # From Paul Eggert (1999-09-20): # Basic Facts: The New Territory # http://www.nunavut.com/basicfacts/english/basicfacts_1territory.html -# (1999) reports that Pangnirtung operates on eastern time, -# and that Coral Harbour does not observe DST. We don't know when -# Pangnirtung switched to eastern time; we'll guess 1995. - -# From Rives McDow (1999-11-08): -# On October 31, when the rest of Nunavut went to Central time, -# Pangnirtung wobbled. Here is the result of their wobble: -# -# The following businesses and organizations in Pangnirtung use Central Time: -# -# First Air, Power Corp, Nunavut Construction, Health Center, RCMP, -# Eastern Arctic National Parks, A & D Specialist -# -# The following businesses and organizations in Pangnirtung use Eastern Time: -# -# Hamlet office, All other businesses, Both schools, Airport operator -# -# This has made for an interesting situation there, which warranted the news. -# No one there that I spoke with seems concerned, or has plans to -# change the local methods of keeping time, as it evidently does not -# really interfere with any activities or make things difficult locally. -# They plan to celebrate New Year's turn-over twice, one hour apart, -# so it appears that the situation will last at least that long. -# The Nunavut Intergovernmental Affairs hopes that they will "come to -# their senses", but the locals evidently don't see any problem with -# the current state of affairs. - -# From Michaela Rodrigue, writing in the -# Nunatsiaq News (1999-11-19): -# http://www.nunatsiaqonline.ca/archives/nunavut991130/nvt91119_17.html -# Clyde River, Pangnirtung and Sanikiluaq now operate with two time zones, -# central - or Nunavut time - for government offices, and eastern time -# for municipal offices and schools.... Igloolik [was similar but then] -# made the switch to central time on Saturday, Nov. 6. +# (1999) reports that ... Coral Harbour does not observe DST. # From Paul Eggert (2000-10-02): # Matthews and Vincent (1998) say the following, but we lack histories @@ -2287,18 +2292,12 @@ Rule NT_YK 1919 only - Nov 1 0:00 0 S Rule NT_YK 1942 only - Feb 9 2:00 1:00 W # War Rule NT_YK 1945 only - Aug 14 23:00u 1:00 P # Peace Rule NT_YK 1945 only - Sep 30 2:00 0 S -Rule NT_YK 1965 only - Apr lastSun 0:00 2:00 DD -Rule NT_YK 1965 only - Oct lastSun 2:00 0 S -Rule NT_YK 1980 1986 - Apr lastSun 2:00 1:00 D -Rule NT_YK 1980 2006 - Oct lastSun 2:00 0 S +Rule NT_YK 1972 1986 - Apr lastSun 2:00 1:00 D +Rule NT_YK 1972 2006 - Oct lastSun 2:00 0 S Rule NT_YK 1987 2006 - Apr Sun>=1 2:00 1:00 D +Rule Yukon 1965 only - Apr lastSun 0:00 2:00 DD +Rule Yukon 1965 only - Oct lastSun 2:00 0 S # Zone NAME STDOFF RULES FORMAT [UNTIL] -# aka Panniqtuuq -Zone America/Pangnirtung 0 - -00 1921 # trading post est. - -4:00 NT_YK A%sT 1995 Apr Sun>=1 2:00 - -5:00 Canada E%sT 1999 Oct 31 2:00 - -6:00 Canada C%sT 2000 Oct 29 2:00 - -5:00 Canada E%sT # formerly Frobisher Bay Zone America/Iqaluit 0 - -00 1942 Aug # Frobisher Bay est. -5:00 NT_YK E%sT 1999 Oct 31 2:00 @@ -2331,13 +2330,15 @@ Zone America/Inuvik 0 - -00 1953 # Inuvik founded -7:00 NT_YK M%sT 1980 -7:00 Canada M%sT Zone America/Whitehorse -9:00:12 - LMT 1900 Aug 20 - -9:00 NT_YK Y%sT 1967 May 28 0:00 - -8:00 NT_YK P%sT 1980 + -9:00 NT_YK Y%sT 1965 + -9:00 Yukon Y%sT 1966 Feb 27 0:00 + -8:00 - PST 1980 -8:00 Canada P%sT 2020 Nov 1 -7:00 - MST Zone America/Dawson -9:17:40 - LMT 1900 Aug 20 - -9:00 NT_YK Y%sT 1973 Oct 28 0:00 - -8:00 NT_YK P%sT 1980 + -9:00 NT_YK Y%sT 1965 + -9:00 Yukon Y%sT 1973 Oct 28 0:00 + -8:00 - PST 1980 -8:00 Canada P%sT 2020 Nov 1 -7:00 - MST @@ -2559,6 +2560,14 @@ Zone America/Dawson -9:17:40 - LMT 1900 Aug 20 # This abolishes DST except where US DST rules are observed, # and in addition changes all of Chihuahua to -06 with no DST. +# From Heitor David Pinto (2022-11-28): +# Now the northern municipalities want to have the same time zone as the +# respective neighboring cities in the US, for example Juárez in UTC-7 with +# DST, matching El Paso, and Ojinaga in UTC-6 with DST, matching Presidio.... +# the president authorized the publication of the decree for November 29, +# so the time change would occur on November 30 at 0:00. +# http://puentelibre.mx/noticia/ciudad_juarez_cambio_horario_noviembre_2022/ + # Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Mexico 1931 only - May 1 23:00 1:00 D Rule Mexico 1931 only - Oct 1 0:00 0 S @@ -2590,14 +2599,12 @@ Zone America/Merida -5:58:28 - LMT 1922 Jan 1 6:00u -6:00 Mexico C%sT # Coahuila, Nuevo León, Tamaulipas (near US border) # This includes the following municipalities: -# in Coahuila: Ocampo, Acuña, Zaragoza, Jiménez, Piedras Negras, Nava, -# Guerrero, Hidalgo. -# in Nuevo León: Anáhuac, Los Aldama. +# in Coahuila: Acuña, Allende, Guerrero, Hidalgo, Jiménez, Morelos, Nava, +# Ocampo, Piedras Negras, Villa Unión, Zaragoza +# in Nuevo León: Anáhuac # in Tamaulipas: Nuevo Laredo, Guerrero, Mier, Miguel Alemán, Camargo, # Gustavo Díaz Ordaz, Reynosa, Río Bravo, Valle Hermoso, Matamoros. -# See: Inicia mañana Horario de Verano en zona fronteriza, El Universal, -# 2016-03-12 -# http://www.eluniversal.com.mx/articulo/estados/2016/03/12/inicia-manana-horario-de-verano-en-zona-fronteriza +# https://www.dof.gob.mx/nota_detalle.php?codigo=5670045&fecha=28/10/2022 Zone America/Matamoros -6:30:00 - LMT 1922 Jan 1 6:00u -6:00 - CST 1988 -6:00 US C%sT 1989 @@ -2616,10 +2623,24 @@ Zone America/Mexico_City -6:36:36 - LMT 1922 Jan 1 7:00u -6:00 Mexico C%sT 2001 Sep 30 2:00 -6:00 - CST 2002 Feb 20 -6:00 Mexico C%sT -# Chihuahua (near US border) +# Chihuahua (near US border - western side) # This includes the municipalities of Janos, Ascensión, Juárez, Guadalupe, -# Práxedis G Guerrero, Coyame del Sotol, Ojinaga, and Manuel Benavides. -# (See the 2016-03-12 El Universal source mentioned above.) +# and Práxedis G Guerrero. +# http://gaceta.diputados.gob.mx/PDF/65/2a022/nov/20221124-VII.pdf +Zone America/Ciudad_Juarez -7:05:56 - LMT 1922 Jan 1 7:00u + -7:00 - MST 1927 Jun 10 23:00 + -6:00 - CST 1930 Nov 15 + -7:00 Mexico M%sT 1932 Apr 1 + -6:00 - CST 1996 + -6:00 Mexico C%sT 1998 + -6:00 - CST 1998 Apr Sun>=1 3:00 + -7:00 Mexico M%sT 2010 + -7:00 US M%sT 2022 Oct 30 2:00 + -6:00 - CST 2022 Nov 30 0:00 + -7:00 US M%sT +# Chihuahua (near US border - eastern side) +# The municipalities of Coyame del Sotol, Ojinaga, and Manuel Benavides. +# http://gaceta.diputados.gob.mx/PDF/65/2a022/nov/20221124-VII.pdf Zone America/Ojinaga -6:57:40 - LMT 1922 Jan 1 7:00u -7:00 - MST 1927 Jun 10 23:00 -6:00 - CST 1930 Nov 15 @@ -2629,7 +2650,8 @@ Zone America/Ojinaga -6:57:40 - LMT 1922 Jan 1 7:00u -6:00 - CST 1998 Apr Sun>=1 3:00 -7:00 Mexico M%sT 2010 -7:00 US M%sT 2022 Oct 30 2:00 - -6:00 - CST + -6:00 - CST 2022 Nov 30 0:00 + -6:00 US C%sT # Chihuahua (away from US border) Zone America/Chihuahua -7:04:20 - LMT 1922 Jan 1 7:00u -7:00 - MST 1927 Jun 10 23:00 @@ -2651,6 +2673,18 @@ Zone America/Hermosillo -7:23:52 - LMT 1922 Jan 1 7:00u -7:00 Mexico M%sT 1999 -7:00 - MST +# Baja California Sur, Nayarit (except Bahía de Banderas), Sinaloa +Zone America/Mazatlan -7:05:40 - LMT 1922 Jan 1 7:00u + -7:00 - MST 1927 Jun 10 23:00 + -6:00 - CST 1930 Nov 15 + -7:00 Mexico M%sT 1932 Apr 1 + -6:00 - CST 1942 Apr 24 + -7:00 - MST 1949 Jan 14 + -8:00 - PST 1970 + -7:00 Mexico M%sT + +# Bahía de Banderas + # From Alexander Krivenyshev (2010-04-21): # According to news, Bahía de Banderas (Mexican state of Nayarit) # changed time zone UTC-7 to new time zone UTC-6 on April 4, 2010 (to @@ -2678,17 +2712,6 @@ Zone America/Hermosillo -7:23:52 - LMT 1922 Jan 1 7:00u # From Arthur David Olson (2010-05-01): # Use "Bahia_Banderas" to keep the name to fourteen characters. -# Mazatlán -Zone America/Mazatlan -7:05:40 - LMT 1922 Jan 1 7:00u - -7:00 - MST 1927 Jun 10 23:00 - -6:00 - CST 1930 Nov 15 - -7:00 Mexico M%sT 1932 Apr 1 - -6:00 - CST 1942 Apr 24 - -7:00 - MST 1949 Jan 14 - -8:00 - PST 1970 - -7:00 Mexico M%sT - -# Bahía de Banderas Zone America/Bahia_Banderas -7:01:00 - LMT 1922 Jan 1 7:00u -7:00 - MST 1927 Jun 10 23:00 -6:00 - CST 1930 Nov 15 diff --git a/contrib/tzdata/southamerica b/contrib/tzdata/southamerica index 13cc65efa32b..87b71d5f9210 100644 --- a/contrib/tzdata/southamerica +++ b/contrib/tzdata/southamerica @@ -1418,9 +1418,14 @@ Zone Antarctica/Palmer 0 - -00 1965 # Milne gives 4:56:16.4 for Bogotá time in 1899. He writes, # "A variation of fifteen minutes in the public clocks of Bogota is not rare." +# From Alois Treindl (2022-11-10): +# End of time change in Colombia 1993 ... should be 6 February 24h ... +# DECRETO 267 DE 1993 +# https://www.suin-juriscol.gov.co/viewDocument.asp?ruta=Decretos/1061335 + # Rule NAME FROM TO - IN ON AT SAVE LETTER/S -Rule CO 1992 only - May 3 0:00 1:00 - -Rule CO 1993 only - Apr 4 0:00 0 - +Rule CO 1992 only - May 3 0:00 1:00 - +Rule CO 1993 only - Feb 6 24:00 0 - # Zone NAME STDOFF RULES FORMAT [UNTIL] #STDOFF -4:56:16.4 Zone America/Bogota -4:56:16 - LMT 1884 Mar 13 diff --git a/contrib/tzdata/theory.html b/contrib/tzdata/theory.html index 298db866b39c..75e347f0f9d1 100644 --- a/contrib/tzdata/theory.html +++ b/contrib/tzdata/theory.html @@ -60,7 +60,6 @@ with current and future timestamps in the traditional North American mountain time zone can choose from the timezones America/Denver which observes US-style daylight saving time (DST), -America/Mazatlan which observes Mexican-style DST, and America/Phoenix which does not observe DST. Applications that also deal with past timestamps in the mountain time zone can choose from over a dozen timezones, such as diff --git a/contrib/tzdata/version b/contrib/tzdata/version index 5c8fbb478a2c..b74fa117a223 100644 --- a/contrib/tzdata/version +++ b/contrib/tzdata/version @@ -1 +1 @@ -2022f +2022g diff --git a/contrib/tzdata/zone.tab b/contrib/tzdata/zone.tab index 2636e21a9fca..6e5adb9fcca6 100644 --- a/contrib/tzdata/zone.tab +++ b/contrib/tzdata/zone.tab @@ -114,8 +114,7 @@ CA +4606-06447 America/Moncton Atlantic - New Brunswick CA +5320-06025 America/Goose_Bay Atlantic - Labrador (most areas) CA +5125-05707 America/Blanc-Sablon AST - QC (Lower North Shore) CA +4339-07923 America/Toronto Eastern - ON, QC (most areas) -CA +6344-06828 America/Iqaluit Eastern - NU (most east areas) -CA +6608-06544 America/Pangnirtung Eastern - NU (Pangnirtung) +CA +6344-06828 America/Iqaluit Eastern - NU (most areas) CA +484531-0913718 America/Atikokan EST - ON (Atikokan); NU (Coral H) CA +4953-09709 America/Winnipeg Central - ON (west); Manitoba CA +744144-0944945 America/Resolute Central - NU (Resolute) @@ -277,17 +276,18 @@ MT +3554+01431 Europe/Malta MU -2010+05730 Indian/Mauritius MV +0410+07330 Indian/Maldives MW -1547+03500 Africa/Blantyre -MX +1924-09909 America/Mexico_City Central Time -MX +2105-08646 America/Cancun Eastern Standard Time - Quintana Roo -MX +2058-08937 America/Merida Central Time - Campeche, Yucatan -MX +2540-10019 America/Monterrey Central Time - Durango; Coahuila, Nuevo Leon, Tamaulipas (most areas) -MX +2550-09730 America/Matamoros Central Time US - Coahuila, Nuevo Leon, Tamaulipas (US border) -MX +2313-10625 America/Mazatlan Mountain Time - Baja California Sur, Nayarit, Sinaloa -MX +2838-10605 America/Chihuahua Mountain Time - Chihuahua (most areas) -MX +2934-10425 America/Ojinaga Mountain Time US - Chihuahua (US border) -MX +2904-11058 America/Hermosillo Mountain Standard Time - Sonora -MX +3232-11701 America/Tijuana Pacific Time US - Baja California -MX +2048-10515 America/Bahia_Banderas Central Time - Bahia de Banderas +MX +1924-09909 America/Mexico_City Central Mexico +MX +2105-08646 America/Cancun Quintana Roo +MX +2058-08937 America/Merida Campeche, Yucatan +MX +2540-10019 America/Monterrey Durango; Coahuila, Nuevo Leon, Tamaulipas (most areas) +MX +2550-09730 America/Matamoros Coahuila, Nuevo Leon, Tamaulipas (US border) +MX +2838-10605 America/Chihuahua Chihuahua (most areas) +MX +3144-10629 America/Ciudad_Juarez Chihuahua (US border - west) +MX +2934-10425 America/Ojinaga Chihuahua (US border - east) +MX +2313-10625 America/Mazatlan Baja California Sur, Nayarit (most areas), Sinaloa +MX +2048-10515 America/Bahia_Banderas Bahia de Banderas +MX +2904-11058 America/Hermosillo Sonora +MX +3232-11701 America/Tijuana Baja California MY +0310+10142 Asia/Kuala_Lumpur Malaysia (peninsula) MY +0133+11020 Asia/Kuching Sabah, Sarawak MZ -2558+03235 Africa/Maputo diff --git a/contrib/tzdata/zone1970.tab b/contrib/tzdata/zone1970.tab index d48c9c5d9493..10dae7e7db17 100644 --- a/contrib/tzdata/zone1970.tab +++ b/contrib/tzdata/zone1970.tab @@ -103,8 +103,7 @@ CA +4612-05957 America/Glace_Bay Atlantic - NS (Cape Breton) CA +4606-06447 America/Moncton Atlantic - New Brunswick CA +5320-06025 America/Goose_Bay Atlantic - Labrador (most areas) CA,BS +4339-07923 America/Toronto Eastern - ON, QC (most areas), Bahamas -CA +6344-06828 America/Iqaluit Eastern - NU (most east areas) -CA +6608-06544 America/Pangnirtung Eastern - NU (Pangnirtung) +CA +6344-06828 America/Iqaluit Eastern - NU (most areas) CA +4953-09709 America/Winnipeg Central - ON (west); Manitoba CA +744144-0944945 America/Resolute Central - NU (Resolute) CA +624900-0920459 America/Rankin_Inlet Central - NU (central) @@ -215,17 +214,18 @@ MQ +1436-06105 America/Martinique MT +3554+01431 Europe/Malta MU -2010+05730 Indian/Mauritius MV,TF +0410+07330 Indian/Maldives Maldives, Kerguelen, St Paul I, Amsterdam I -MX +1924-09909 America/Mexico_City Central Time -MX +2105-08646 America/Cancun Eastern Standard Time - Quintana Roo -MX +2058-08937 America/Merida Central Time - Campeche, Yucatán -MX +2540-10019 America/Monterrey Central Time - Durango; Coahuila, Nuevo León, Tamaulipas (most areas) -MX +2550-09730 America/Matamoros Central Time US - Coahuila, Nuevo León, Tamaulipas (US border) -MX +2313-10625 America/Mazatlan Mountain Time - Baja California Sur, Nayarit, Sinaloa -MX +2838-10605 America/Chihuahua Mountain Time - Chihuahua (most areas) -MX +2934-10425 America/Ojinaga Mountain Time US - Chihuahua (US border) -MX +2904-11058 America/Hermosillo Mountain Standard Time - Sonora -MX +3232-11701 America/Tijuana Pacific Time US - Baja California -MX +2048-10515 America/Bahia_Banderas Central Time - Bahía de Banderas +MX +1924-09909 America/Mexico_City Central Mexico +MX +2105-08646 America/Cancun Quintana Roo +MX +2058-08937 America/Merida Campeche, Yucatán +MX +2540-10019 America/Monterrey Durango; Coahuila, Nuevo León, Tamaulipas (most areas) +MX +2550-09730 America/Matamoros Coahuila, Nuevo León, Tamaulipas (US border) +MX +2838-10605 America/Chihuahua Chihuahua (most areas) +MX +3144-10629 America/Ciudad_Juarez Chihuahua (US border - west) +MX +2934-10425 America/Ojinaga Chihuahua (US border - east) +MX +2313-10625 America/Mazatlan Baja California Sur, Nayarit (most areas), Sinaloa +MX +2048-10515 America/Bahia_Banderas Bahía de Banderas +MX +2904-11058 America/Hermosillo Sonora +MX +3232-11701 America/Tijuana Baja California MY,BN +0133+11020 Asia/Kuching Sabah, Sarawak, Brunei MZ,BI,BW,CD,MW,RW,ZM,ZW -2558+03235 Africa/Maputo Central Africa Time NA -2234+01706 Africa/Windhoek diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 70b7574040e0..63b6a3aa160a 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -9888,6 +9888,7 @@ OLD_FILES+=usr/share/zoneinfo/America/Cayenne OLD_FILES+=usr/share/zoneinfo/America/Cayman OLD_FILES+=usr/share/zoneinfo/America/Chicago OLD_FILES+=usr/share/zoneinfo/America/Chihuahua +OLD_FILES+=usr/share/zoneinfo/America/Ciudad_Juarez OLD_FILES+=usr/share/zoneinfo/America/Costa_Rica OLD_FILES+=usr/share/zoneinfo/America/Creston OLD_FILES+=usr/share/zoneinfo/America/Cuiaba From nobody Wed Feb 8 18:15:17 2023 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 4PBp7n5DFKz3nknK; Wed, 8 Feb 2023 18:15: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 4PBp7n4C2cz3qQl; Wed, 8 Feb 2023 18:15:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675880117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aEBrzdU78sAVXthTxljzaxnZ5Lim/Fe8RHxfz7VEtHg=; b=yWcVaQfbBzhCeMfCFPBNckyn9o1n7rdn15v11V3zL4M9Y40GPGaWnrpiukbKWWC4RjK1jE QOxU5oK43Fvy8JWtXLBFJGjlBuVrrJHCDdh/P0XUSmjAzrwILt9sGlkP/4BupEbgq+RdgN MeQRIinzo4zRmup06kv0IkIcwsS/jHSobQMsRM2dWbU5s2E2eegCUTF727KK/ElPR0sx0Q DOIvQ6CL1Euf2HHmNd0WYFhBb5UQ8QDmfOXEN31xo+dVsJHpiVwV5wQEkON+TV3FxePUPc 4VUuJXF4mW8yxSA5GfUBWcimG9Ao6P4QHB5MQxnhYb291B+T3/fB9ZEIdSWuMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675880117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aEBrzdU78sAVXthTxljzaxnZ5Lim/Fe8RHxfz7VEtHg=; b=icI2Q4nTOD7gYmL/f/Qu+CjkRCbLgQ02PtBNkIijeCCtYu2N2tXTO6LL8Eze+Llbnpjlx4 hmX1VevLHHxBc45YmrQoPp3qFdLgZ4li6qfaNvcLd9ael3UPqhqE23Un4f1UL42MrNL6An IM4xB9iNW8xXIAnQe1hjyKPZm6WBpv7nmHT+qZkXY7CZFOJplCaiHWjhOPMHXKnt5F67fr bDxSj/fNaih5xt9w082giCXMyl79GaHR0CDlzwvJHrE259JYNGi2dVNYmnSFutQmroJIhH oH8VyMf/Er6foA9868W7bR1f8tUMtkpWCe8J/GGZh45GLHkTY0eyFu3DS8l0Ig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675880117; a=rsa-sha256; cv=none; b=M5yqYgeLaeKOZ8jCAyRXvkY8nYC7XlOa2fCtWtnKNBFKKfX/Wi/Y2u179pnprGFNUeggsP dfSWrMb23IdlrDOWHEbRLWOIMN0spfZwwKDl+NzxohssGoYup7hkd0hiMkyTGVeeXj0GaA p+e84ql36JvUhBYtbz1tVrJmBX9zJkEmXa6F1B6Jymmy+SuHYtabpq9F72Uki7SqD5/Dfs eNe3vmtkLSX82KhrWWDgmHjNSG6rUqmtB2J/orgtWJrHQjaJBOPVcjX72KjBbXQn5UIG7l ///aKvxfnvnU0MDBLf6QmXLDYpY4dJPj6UHf1nUFDxGGbv815gi3hdpu4Bie4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBp7n39tZz15Mp; Wed, 8 Feb 2023 18:15:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 318IFHpW022285; Wed, 8 Feb 2023 18:15:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 318IFH7k022284; Wed, 8 Feb 2023 18:15:17 GMT (envelope-from git) Date: Wed, 8 Feb 2023 18:15:17 GMT Message-Id: <202302081815.318IFH7k022284@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 4b31a7861af0 - releng/13.1 - Fix sdhci(4) broken write-protect settings. 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: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.1 X-Git-Reftype: branch X-Git-Commit: 4b31a7861af02ec5c1528e20d375a7e9813cdc80 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.1 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=4b31a7861af02ec5c1528e20d375a7e9813cdc80 commit 4b31a7861af02ec5c1528e20d375a7e9813cdc80 Author: Gordon Tetlow AuthorDate: 2023-02-08 16:16:31 +0000 Commit: Gordon Tetlow CommitDate: 2023-02-08 16:16:31 +0000 Fix sdhci(4) broken write-protect settings. Approved by: so Security: FreeBSD-EN-23:02.sdhci --- sys/dev/sdhci/sdhci_xenon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/sdhci/sdhci_xenon.c b/sys/dev/sdhci/sdhci_xenon.c index b6f7513245eb..7ed94907e478 100644 --- a/sys/dev/sdhci/sdhci_xenon.c +++ b/sys/dev/sdhci/sdhci_xenon.c @@ -183,7 +183,7 @@ sdhci_xenon_get_ro(device_t bus, device_t dev) struct sdhci_xenon_softc *sc = device_get_softc(bus); return (sdhci_generic_get_ro(bus, dev) ^ - (sc->mmc_helper.props & MMC_PROP_WP_INVERTED)); + !!(sc->mmc_helper.props & MMC_PROP_WP_INVERTED)); } static bool From nobody Wed Feb 8 18:15:18 2023 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 4PBp7q0qrcz3nkf3; Wed, 8 Feb 2023 18:15:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PBp7p4XtSz3qQw; Wed, 8 Feb 2023 18:15:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675880118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gYHCsxQpLR/2kdkkwUdgopBagZ2rN45YwpFUrN6c5wQ=; b=hDut+UMZejViWJTzBFB+fcQ3gHqVL5qTo4pgRRBHkturUPPsUt/rwOEkw9NkdTjiS3UJrZ vUAe3DrJEVGzjCGwEvcv5Kgv9kgdDu0h8+bnaUTJ79VloBVG7XMuZQRpTH5+l/QSXNg2Sr BRKV7EXxTYzwGgTr3FR+vBP2Q2h7sowEuqYUBKtyS+6noxssks7IfKlQ15B59fzLDqvS6M DSn14dHoeB7uE7g3OArlQnPpM/klm9QnSgQG4tuYT2ApnIeLIgh2IAfQMikZwfIuDS02Gl VMkXmOs57jTM4ZR7ioQI/xPmslstqqQlCfqH9Ay9zs1enJkb38V85BCwKgB6jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675880118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gYHCsxQpLR/2kdkkwUdgopBagZ2rN45YwpFUrN6c5wQ=; b=ISfSVKuM3RYirAKLwpwP5Y9CCBRGn3QtFTwhUlpzWmGNuL3k7kFVgoqPtOLc61XWMmzTlp o6IFh+AxJpdUzTZKUVnQGQt1TbM0bFgWBh6tP6Juz4v6aDNm1RxHzps3Bmr+gKa02l4vVx jF2zlPqm+MWleFEFNVdMGclwyEwUkuGrxVCYNJOHzvjmO1mPQi9MQCP1DDQfd2WjNde0BC zhWqM+yWUttjCdIeXG4pmFhKcU5Lyy9yv+/WAaXWF/j0mf6NnovHwCfwUYQbBWWnUbASkP Qk9U9DsLj9oq9DL+o+tkgPvK8GEKQCyesUarNIpv22fcovOZluWd2IjSCx9vnA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675880118; a=rsa-sha256; cv=none; b=JQjtxYiwOXJ57ZGxwJsJrD5DE0ymEoXB59aszPhltzQoNWKQG6JVCPkbTMu2c3BGu4LcY0 Hl34R80SpgzbqS4+FkYhnoG6QxBKiaXMGxmyVxmdYSwGQ/45sYq69O2ai3E0cz2dEmj9tC u004pI/9Tna7iEW0hooQ12wkUbtqmikcgJZRbpvBWXIiChaXBYxLzfkNanAGQAVnK/uQal fTRjsn4OvCmmbc0QfqZkjO/oxpTRY5TFDDMQb/VKbnuWNJkAm2jw6oD9tnAKLxxJrMONMe hBXdtCOL/ksn9F/YNS8WJ4qPv+LzRtDeL06tFgPGHF+cbO/CAC6Z8/uVA+Tuew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBp7p3fpGz167T; Wed, 8 Feb 2023 18:15:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 318IFIYZ022312; Wed, 8 Feb 2023 18:15:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 318IFItT022311; Wed, 8 Feb 2023 18:15:18 GMT (envelope-from git) Date: Wed, 8 Feb 2023 18:15:18 GMT Message-Id: <202302081815.318IFItT022311@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: b508850e150e - releng/13.1 - Fix ena driver crash after reset in 7th gen AWS instance 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: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.1 X-Git-Reftype: branch X-Git-Commit: b508850e150ebc7a8bea0cdf0a4981c2bc4d5323 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.1 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=b508850e150ebc7a8bea0cdf0a4981c2bc4d5323 commit b508850e150ebc7a8bea0cdf0a4981c2bc4d5323 Author: Gordon Tetlow AuthorDate: 2023-02-08 16:18:27 +0000 Commit: Gordon Tetlow CommitDate: 2023-02-08 16:18:27 +0000 Fix ena driver crash after reset in 7th gen AWS instance types. Approved by: so Security: FreeBSD-EN-23:03.ena --- sys/dev/ena/ena.c | 54 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 20 deletions(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 1b26a91c5d9e..36b84dea9a76 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -155,6 +155,7 @@ static int ena_setup_ifnet(device_t, struct ena_adapter *, static int ena_enable_wc(device_t, struct resource *); static int ena_set_queues_placement_policy(device_t, struct ena_com_dev *, struct ena_admin_feature_llq_desc *, struct ena_llq_configurations *); +static int ena_map_llq_mem_bar(device_t, struct ena_com_dev *); static uint32_t ena_calc_max_io_queue_num(device_t, struct ena_com_dev *, struct ena_com_dev_get_features_ctx *); static int ena_calc_io_queue_size(struct ena_calc_queue_size_ctx *); @@ -2571,8 +2572,7 @@ ena_set_queues_placement_policy(device_t pdev, struct ena_com_dev *ena_dev, struct ena_admin_feature_llq_desc *llq, struct ena_llq_configurations *llq_default_configurations) { - struct ena_adapter *adapter = device_get_softc(pdev); - int rc, rid; + int rc; uint32_t llq_feature_mask; llq_feature_mask = 1 << ENA_ADMIN_LLQ; @@ -2583,26 +2583,36 @@ ena_set_queues_placement_policy(device_t pdev, struct ena_com_dev *ena_dev, return (0); } + if (ena_dev->mem_bar == NULL) { + ena_log(pdev, WARN, + "LLQ is advertised as supported but device doesn't expose mem bar.\n"); + ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_HOST; + return (0); + } + rc = ena_com_config_dev_mode(ena_dev, llq, llq_default_configurations); if (unlikely(rc != 0)) { ena_log(pdev, WARN, "Failed to configure the device mode. " "Fallback to host mode policy.\n"); ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_HOST; - return (0); } - /* Nothing to config, exit */ - if (ena_dev->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_HOST) - return (0); + return (0); +} + +static int +ena_map_llq_mem_bar(device_t pdev, struct ena_com_dev *ena_dev) +{ + struct ena_adapter *adapter = device_get_softc(pdev); + int rc, rid; /* Try to allocate resources for LLQ bar */ rid = PCIR_BAR(ENA_MEM_BAR); adapter->memory = bus_alloc_resource_any(pdev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (unlikely(adapter->memory == NULL)) { - ena_log(pdev, WARN, "unable to allocate LLQ bar resource. " - "Fallback to host mode policy.\n"); - ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_HOST; + ena_log(pdev, WARN, + "Unable to allocate LLQ bar resource. LLQ mode won't be used.\n"); return (0); } @@ -2791,6 +2801,7 @@ static int ena_device_init(struct ena_adapter *adapter, device_t pdev, struct ena_com_dev_get_features_ctx *get_feat_ctx, int *wd_active) { + struct ena_llq_configurations llq_config; struct ena_com_dev* ena_dev = adapter->ena_dev; bool readless_supported; uint32_t aenq_groups; @@ -2870,6 +2881,15 @@ ena_device_init(struct ena_adapter *adapter, device_t pdev, *wd_active = !!(aenq_groups & BIT(ENA_ADMIN_KEEP_ALIVE)); + set_default_llq_configurations(&llq_config, &get_feat_ctx->llq); + + rc = ena_set_queues_placement_policy(pdev, ena_dev, &get_feat_ctx->llq, + &llq_config); + if (unlikely(rc != 0)) { + ena_log(pdev, ERR, "Failed to set placement policy\n"); + goto err_admin_init; + } + return (0); err_admin_init: @@ -3506,7 +3526,6 @@ static int ena_attach(device_t pdev) { struct ena_com_dev_get_features_ctx get_feat_ctx; - struct ena_llq_configurations llq_config; struct ena_calc_queue_size_ctx calc_queue_ctx = { 0 }; static int version_printed; struct ena_adapter *adapter; @@ -3579,7 +3598,11 @@ ena_attach(device_t pdev) goto err_bus_free; } - ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_HOST; + rc = ena_map_llq_mem_bar(pdev, ena_dev); + if (unlikely(rc != 0)) { + ena_log(pdev, ERR, "Failed to map ENA mem bar"); + goto err_bus_free; + } /* Initially clear all the flags */ ENA_FLAG_ZERO(adapter); @@ -3592,15 +3615,6 @@ ena_attach(device_t pdev) goto err_bus_free; } - set_default_llq_configurations(&llq_config, &get_feat_ctx.llq); - - rc = ena_set_queues_placement_policy(pdev, ena_dev, &get_feat_ctx.llq, - &llq_config); - if (unlikely(rc != 0)) { - ena_log(pdev, ERR, "failed to set placement policy\n"); - goto err_com_free; - } - if (ena_dev->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) adapter->disable_meta_caching = !!(get_feat_ctx.llq.accel_mode.u.get.supported_flags & From nobody Wed Feb 8 18:15:19 2023 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 4PBp7r006Kz3nl3D; Wed, 8 Feb 2023 18:15: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 4PBp7q5sZBz3qbR; Wed, 8 Feb 2023 18:15:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675880119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RiNy3JLgd00RwV1l2hjY3wvFuYZ0uID0pCLJNunU2EI=; b=JDT9rFP9Hq/CC8kGXUcfYKsVaiSZBe7zSfHXyTjCt6ZuPvJu6i/xIDcx2iI2w7u2hJF1oj 9aJclfPwPChRxavX4rqzMwjbmg9+Fbypusq19TNWpzpD4+mnMGoiyka3ekT7gt5qwwIcS/ 2r/HfyrQONQqOumBeTm+zYOVumV9rOmN/vVwYDafBf+fVvF4zrDDVc/n9N/2lw6SUTnJ39 YCC/El2laEiqx9jOOKyI1PYXOUa6I1B1HctzK/4AhS6cm03sZLLmpZFQErL+63G6EqOUAb 3PK+kOVeftsSRc6BOfbo7n5GYU6SkgQ3V+4x23fBbwuP7mFV7ZB5fzZgT0Wa7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675880119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RiNy3JLgd00RwV1l2hjY3wvFuYZ0uID0pCLJNunU2EI=; b=tWsPybAsf6zsDblzibndd4blAqbrXny3NvgmWFrjzaHOTebwIG4jNbZU9SjUX3oCOqVANf jKydO76mEh+/QeEW6+WjKLm7Rr3LE+Zcf9yNmh10kDVTpvMDm+/W5vwFAJq0kQETiMkl0R Jh1LKdAub5IBjbBtNkkKemRFJFXftc3mxbYtRk1/bQozZ8mSWSmSbQ8zaVCXCOQapfoJee xxYUFrIt1Bh4RBrZiwsy9aoiHB7dufapOocN1ivZaVVU6GRQFRmy0sF2iMuhywSCQMBYot jI0NvkfR5gJHblpxJyABG+0g+yZYpqzewHImfX/TrveGQVmvnIK92Gy0g4+TYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675880119; a=rsa-sha256; cv=none; b=yo/pFDD3OEf45ka8JOgnBm4E63395MBX9WGKk0///NBLkGJrcfaJz6pod2ZkqMzg8F7fWr FX88BL+4gAePgkxeE7A95Re/Hx+G3/B+CZXhA0mLOkpO9CHY3RExdDa9wJEPLyVoM9XIKq W6d5iFkawPKGEUDh0DX5XeXSJUxMLWxY6PzBN8z7q6LMIuBbBlb5jFuLGQJSUq5ITPbav9 czagxb4ZeRaYBy33FcSPzdiKmiqYEAQ/aSWsHyDAPPZplAJbD/yjC9sk0eAsLE573z9yXx B2D3zoFrHdTFO9kzHdHcS5NxlvTjsVyM1xj68nVdNXTz5Jba4XTyNN/+kgFxLw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBp7q4tTgz1664; Wed, 8 Feb 2023 18:15:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 318IFJNC022340; Wed, 8 Feb 2023 18:15:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 318IFJFL022339; Wed, 8 Feb 2023 18:15:19 GMT (envelope-from git) Date: Wed, 8 Feb 2023 18:15:19 GMT Message-Id: <202302081815.318IFJFL022339@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: f3e20eb8d8f0 - releng/13.1 - ixgbe: workaround errata about UDP frames with zero checksum 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: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.1 X-Git-Reftype: branch X-Git-Commit: f3e20eb8d8f0b87ae828741c48e9ebd7913086ac Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.1 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=f3e20eb8d8f0b87ae828741c48e9ebd7913086ac commit f3e20eb8d8f0b87ae828741c48e9ebd7913086ac Author: Andrey V. Elsukov AuthorDate: 2022-11-10 09:34:40 +0000 Commit: Gordon Tetlow CommitDate: 2023-02-08 16:30:38 +0000 ixgbe: workaround errata about UDP frames with zero checksum Intel 82599 has errata related to IPv4 UDP frames with zero checksum. It reports such datagrams with L4 integrity errors in IXGBE_XEC register. And after afb1aa4e6df2 commit such errors are reported via IFCOUNTER_IERRORS. This confuses users, since actually all frames are handled correctly by the system. To workaround the problem, let's ignore the XEC register value for 82599 cards for now. PR: 266048 Discussed with: erj Sponsored by: Yandex LLC Approved by: so Security: FreeBSD-EN-23:04.ixgbe (cherry picked from commit 8526120ad41ca47367b43f8f4459e0fa61285571) (cherry picked from commit daf3d88ac1849c9a6c5f05d2a663c7fe57453b37) --- sys/dev/ixgbe/if_ix.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index 3077fc9ac4f8..abfdc1f5ba60 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -1585,8 +1585,12 @@ ixgbe_update_stats_counters(struct ixgbe_softc *sc) * - fragmented packets count, * - oversized packets count, * - jabber count. + * + * Ignore XEC errors for 82599 to workaround errata about + * UDP frames with zero checksum. */ - IXGBE_SET_IERRORS(sc, stats->crcerrs + stats->illerrc + stats->xec + + IXGBE_SET_IERRORS(sc, stats->crcerrs + stats->illerrc + + (hw->mac.type != ixgbe_mac_82599EB ? stats->xec : 0) + stats->mpc[0] + stats->rlec + stats->ruc + stats->rfc + stats->roc + stats->rjc); } /* ixgbe_update_stats_counters */ From nobody Wed Feb 8 18:15:20 2023 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 4PBp7s0skwz3nk6c; Wed, 8 Feb 2023 18:15: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 4PBp7r6lTPz3qgw; Wed, 8 Feb 2023 18:15:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675880121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7i8D0NMA5Qy95bxlPTv75PCkn4a5TEqdhUbsBFveCG0=; b=InwbiiCJedJ/LOk+CwzCjz4ax33uqxtoEJU8LZGwkFK4PF4o0H89YFpoW5BGpAovHoY6k4 QnCDGrgjrPo3kZAO2Q27GxD33KuAjAxJLecCpRnA8HG22bxg3hKFb4dvBvafANtJgAUvbl 8vHSGQu3QY7iSQfrSA3Y8u/Ndowg234uhLM/XTi/XEw5CfO3W3/XUMlA6x9Wrq69z/2uyY RoJi3/zeeoXF/uc3VwryoFGgpx5Wjytf0dLQqnGQOR/oB44Wkmrmdt03Gzktj3Z6uwDq79 K2OBStC8AHanisKHEx17CPfQJcIEnWn3bL2PMEJarrzrU6ow/NDQodsOEYmmkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675880121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7i8D0NMA5Qy95bxlPTv75PCkn4a5TEqdhUbsBFveCG0=; b=CHEtYARZUVQODnSueVB0LguvIhGIgA/x4KP2shbIxCUMIBiT7LFN/wgID0aBllw/ASI3/Z DqqOljpYKoe/m93k/WqUOrljFy+PfW0dzxseO2k/834Wo4RmXPOxTQgSHxCP9KyDrDlxF2 AFRoNhySLxsaeDw/lXe3RdyRUWmaURYdlfQMc4aId9IqyI0d6YTgJnIhJfaceNYwfPIppb 2TAW6h6Pk8J8d8yljUfaAXXJnexDlvXgbH4nn1Pj5fpWnxKe8baFTmdHcJ/GA3Z6hLxdoI skE6NyPX2wH4eD/WIty8WKAahQTLbRUJw0SS09JP5EuuhUxfYjQfVvwsIPBBQg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675880121; a=rsa-sha256; cv=none; b=Ma13+0nMXIpHCcSvDD2qNlrQkvPOt2wpwJEX1ByTBrDQMBtLlHZ+VNPIVWByHxRjLe3lM1 BwbbO8OP84+wuqb5QvAkQ3gyOBo4UU9VOrvNvm3vpdqH0OXRozTw/ljM5LbN8c4mjEJzcD u/FcoTwzwK0Fo1WkICN5IXqu3x0+RpYfWppSXCvRhKZgWGXh7+0pOwFk+3UCPIKDqnTnzS lKsIywDl10dQRAai0+L8OlSRebx1ZUT93ez/vc07gXw3bBsvRQDO8Kc8iYUGYzWE0GC0Vx 39XmXInSrmfUWVAhhXxhaLMLYdEFVZJxvFE7RK0ISdGa+s0HTbno1X4fEk9Hfw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBp7r5sGCz167V; Wed, 8 Feb 2023 18:15:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 318IFK7x022364; Wed, 8 Feb 2023 18:15:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 318IFK18022363; Wed, 8 Feb 2023 18:15:20 GMT (envelope-from git) Date: Wed, 8 Feb 2023 18:15:20 GMT Message-Id: <202302081815.318IFK18022363@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 98933c7013a5 - releng/13.1 - geli: split the initalization of HMAC 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: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.1 X-Git-Reftype: branch X-Git-Commit: 98933c7013a5c6ef5c0fdde8488b32bb78af23c6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.1 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=98933c7013a5c6ef5c0fdde8488b32bb78af23c6 commit 98933c7013a5c6ef5c0fdde8488b32bb78af23c6 Author: Mariusz Zaborski AuthorDate: 2023-02-08 16:41:06 +0000 Commit: Gordon Tetlow CommitDate: 2023-02-08 18:06:31 +0000 geli: split the initalization of HMAC GELI allows to read a user key from a standard input. However if user initialize multiple providers at once, the standard input will be empty for the second and next providers. This caused GELI to encrypt a master key with an empty key file. This commits initialize the HMAC with the key file, and then reuse the finalized structure to generate different encryption keys for different providers. Reported by: Nathan Dorfman Tested by: philip Approved by: so Security: FreeBSD-SA-23:01.geli Security: CVE-2023-0751 (cherry picked from commit 5fff09660e06a66bed6482da9c70df328e16bbb6) (cherry picked from commit 88bb08452ee3bbf67ad701a4909bbee6e8b200a6) --- lib/geom/eli/geom_eli.c | 72 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 54 insertions(+), 18 deletions(-) diff --git a/lib/geom/eli/geom_eli.c b/lib/geom/eli/geom_eli.c index 4c04a9256b5e..8897af15b8f3 100644 --- a/lib/geom/eli/geom_eli.c +++ b/lib/geom/eli/geom_eli.c @@ -571,27 +571,35 @@ eli_genkey_passphrase(struct gctl_req *req, struct g_eli_metadata *md, bool new, return (0); } -static unsigned char * -eli_genkey(struct gctl_req *req, struct g_eli_metadata *md, unsigned char *key, - bool new) +static bool +eli_init_key_hmac_ctx(struct gctl_req *req, struct hmac_ctx *ctx, bool new) { - struct hmac_ctx ctx; - bool nopassphrase; int nfiles; + bool nopassphrase; nopassphrase = gctl_get_int(req, new ? "nonewpassphrase" : "nopassphrase"); - g_eli_crypto_hmac_init(&ctx, NULL, 0); - - nfiles = eli_genkey_files(req, new, "keyfile", &ctx, NULL, 0); - if (nfiles == -1) - return (NULL); - else if (nfiles == 0 && nopassphrase) { + g_eli_crypto_hmac_init(ctx, NULL, 0); + nfiles = eli_genkey_files(req, new, "keyfile", ctx, NULL, 0); + if (nfiles == -1) { + return (false); + } else if (nfiles == 0 && nopassphrase) { gctl_error(req, "No key components given."); - return (NULL); + return (false); } + return (true); +} + +static unsigned char * +eli_genkey(struct gctl_req *req, const struct hmac_ctx *ctxtemplate, + struct g_eli_metadata *md, unsigned char *key, bool new) +{ + struct hmac_ctx ctx; + + memcpy(&ctx, ctxtemplate, sizeof(ctx)); + if (eli_genkey_passphrase(req, md, new, &ctx) == -1) return (NULL); @@ -600,6 +608,22 @@ eli_genkey(struct gctl_req *req, struct g_eli_metadata *md, unsigned char *key, return (key); } +static unsigned char * +eli_genkey_single(struct gctl_req *req, struct g_eli_metadata *md, + unsigned char *key, bool new) +{ + struct hmac_ctx ctx; + unsigned char *rkey; + + if (!eli_init_key_hmac_ctx(req, &ctx, new)) { + return (NULL); + } + rkey = eli_genkey(req, &ctx, md, key, new); + explicit_bzero(&ctx, sizeof(ctx)); + + return (rkey); +} + static int eli_metadata_read(struct gctl_req *req, const char *prov, struct g_eli_metadata *md) @@ -711,6 +735,7 @@ eli_init(struct gctl_req *req) intmax_t val; int error, i, nargs, nparams, param; const int one = 1; + struct hmac_ctx ctxtemplate; nargs = gctl_get_int(req, "nargs"); if (nargs <= 0) { @@ -844,6 +869,10 @@ eli_init(struct gctl_req *req) */ nparams = req->narg - nargs - 1; + /* Generate HMAC context template. */ + if (!eli_init_key_hmac_ctx(req, &ctxtemplate, true)) + return; + /* Create new child request for each provider and issue to kernel */ for (i = 0; i < nargs; i++) { r = gctl_get_handle(); @@ -885,7 +914,7 @@ eli_init(struct gctl_req *req) arc4random_buf(md.md_mkeys, sizeof(md.md_mkeys)); /* Generate user key. */ - if (eli_genkey(r, &md, key, true) == NULL) { + if (eli_genkey(r, &ctxtemplate, &md, key, true) == NULL) { /* * Error generating key - details added to geom request * by eli_genkey(). @@ -1009,6 +1038,7 @@ out: /* Clear the cached metadata, including keys. */ explicit_bzero(&md, sizeof(md)); + explicit_bzero(&ctxtemplate, sizeof(ctxtemplate)); } static void @@ -1020,6 +1050,7 @@ eli_attach(struct gctl_req *req) off_t mediasize; int i, nargs, nparams, param; const int one = 1; + struct hmac_ctx ctxtemplate; nargs = gctl_get_int(req, "nargs"); if (nargs <= 0) { @@ -1035,6 +1066,10 @@ eli_attach(struct gctl_req *req) */ nparams = req->narg - nargs - 1; + /* Generate HMAC context template. */ + if (!eli_init_key_hmac_ctx(req, &ctxtemplate, false)) + return; + /* Create new child request for each provider and issue to kernel */ for (i = 0; i < nargs; i++) { r = gctl_get_handle(); @@ -1064,7 +1099,7 @@ eli_attach(struct gctl_req *req) goto out; } - if (eli_genkey(r, &md, key, false) == NULL) { + if (eli_genkey(r, &ctxtemplate, &md, key, false) == NULL) { /* * Error generating key - details added to geom request * by eli_genkey(). @@ -1098,6 +1133,7 @@ out: /* Clear sensitive data from memory. */ explicit_bzero(cached_passphrase, sizeof(cached_passphrase)); + explicit_bzero(&ctxtemplate, sizeof(ctxtemplate)); } static void @@ -1295,7 +1331,7 @@ eli_setkey_attached(struct gctl_req *req, struct g_eli_metadata *md) old = md->md_iterations; /* Generate key for Master Key encryption. */ - if (eli_genkey(req, md, key, true) == NULL) { + if (eli_genkey_single(req, md, key, true) == NULL) { explicit_bzero(key, sizeof(key)); return; } @@ -1330,7 +1366,7 @@ eli_setkey_detached(struct gctl_req *req, const char *prov, } /* Generate key for Master Key decryption. */ - if (eli_genkey(req, md, key, false) == NULL) { + if (eli_genkey_single(req, md, key, false) == NULL) { explicit_bzero(key, sizeof(key)); return; } @@ -1388,7 +1424,7 @@ eli_setkey_detached(struct gctl_req *req, const char *prov, explicit_bzero(mkey, sizeof(mkey)); /* Generate key for Master Key encryption. */ - if (eli_genkey(req, md, key, true) == NULL) { + if (eli_genkey_single(req, md, key, true) == NULL) { explicit_bzero(key, sizeof(key)); explicit_bzero(md, sizeof(*md)); return; @@ -1534,7 +1570,7 @@ eli_resume(struct gctl_req *req) return; } - if (eli_genkey(req, &md, key, false) == NULL) { + if (eli_genkey_single(req, &md, key, false) == NULL) { explicit_bzero(key, sizeof(key)); return; } From nobody Wed Feb 8 18:15:21 2023 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 4PBp7t2ktKz3nl8R; Wed, 8 Feb 2023 18:15: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 4PBp7t1GhNz3qbw; Wed, 8 Feb 2023 18:15:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675880122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jehh070zmeT8GT2vYIYR/8US6/5HJOODBlh3PUa1oAo=; b=GQ+gYAzgIN5QujhCHUfD/9bjEXztu69VlKLPJ7bbSguCZdswSsQsWWa3PIwZFQFIT8pT3s rWoqnXupr5J9OKmdIJSc2HMVTIMSKhB7dRtfYGSFNp2Cg0WsEem6foebvctE9UzyWyC2gi ASsKQMUXy4uvCGHEvceO3xgPsGa5GmgvBtsQreZwdUg8FiMOYkU1Q9W9SN8pxFTTtq+MNT NusG9TC2nie4KerDDAIBEwpWPL2iwwn26ZlYoevUhWHYeUGvrFq0zcRYWtZxV/yJtRmoNV savyzX3gtzcgcEVxKjGwZk6zO5z52JAaV1acHKvhE84B7FEo56ndNqZlTRTO2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675880122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jehh070zmeT8GT2vYIYR/8US6/5HJOODBlh3PUa1oAo=; b=juSE6SHZiG0r8xep+b4c1LPp0FsJTuk1S0yg09E1s8hI8e0IMRHY3BgwYV4dMDb0MJNnNW Nb3dESKBvJuSQgO1AcosEjfwg3ej5Pnq5ZYxGZeNCRZWRTAEZzFDakTenLQ4v64A2iMHHF LhEVtOv74QTHIB6HUaAjbfWzYuvf/VMCaYvtDAoix5vcZ1+IW+IjIArKBNbjcvDk1p25b8 INkQ771ej14PAalgItsP6Tb1Tw8WADOQzHGerxA47m5b2vH9aFARJa3Nh9q1DiCL426WDP UMsv0YleidVgh/ZId2lRhkvxlHCAlO5CNOqxoSoRyqmjpoLj8FN/v4llMU5CWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675880122; a=rsa-sha256; cv=none; b=KSQjcSxCLgUj2gLGJQG3Ra2VwgzhOCt5wDggZbvdaIg2aYAaHXdLWvtis6+YEXbX85ZfpT DodzWhCgylNHeYvQmRTsjn6/n66dfO2TBi+UUADvvizQs9KFofNNmteridYduTFoLe0CHn kyXYbmQnJeODw29g9Sao/H9M/xf5gyTWPno1/jmi5wRu7KRNJOsIdu8wSUCRWF7e7ZB98K vGao5NdS9QLssq7tJO8qtOSiixMaQpx3z4lf9zi82RCvmoWF0FGyWbb5nDVeWvc34nQnAh e2sqBdv+aD6pe2yGggmTPevIGYDlcDXmDtSN/9k0rTZyKjYIWaVh5R1dm3Rciw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBp7s6dbvz1665; Wed, 8 Feb 2023 18:15:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 318IFLEj022390; Wed, 8 Feb 2023 18:15:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 318IFL7t022389; Wed, 8 Feb 2023 18:15:21 GMT (envelope-from git) Date: Wed, 8 Feb 2023 18:15:21 GMT Message-Id: <202302081815.318IFL7t022389@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 01efaef88f1e - releng/13.1 - Add UPDATING entries and bump version. 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: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.1 X-Git-Reftype: branch X-Git-Commit: 01efaef88f1efa5e76bfbfbc35e960393bbcf604 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.1 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=01efaef88f1efa5e76bfbfbc35e960393bbcf604 commit 01efaef88f1efa5e76bfbfbc35e960393bbcf604 Author: Gordon Tetlow AuthorDate: 2023-02-08 18:12:59 +0000 Commit: Gordon Tetlow CommitDate: 2023-02-08 18:12:59 +0000 Add UPDATING entries and bump version. Approved by: so --- UPDATING | 16 ++++++++++++++++ sys/conf/newvers.sh | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 0d63c5bb0637..da209c2d9f37 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,22 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20230208: + 13.1-RELEASE-p6 FreeBSD-SA-23:01.geli + FreeBSD-EN-23:01.tzdata + FreeBSD-EN-23:02.sdhci + FreeBSD-EN-23:03.ena + FreeBSD-EN-23:04.ixgbe + + Fix GELI silently omits the keyfile if read from stdin [SA-23:01.geli] + + Timezone database information update [EN-23:01.tzdata] + + Fix sdhci(4) broken write-protect settings [EN-23:02.sdhci] + + Fix ena driver crash after reset in 7th gen AWS instance types [EN-23:03.ena] + + Fix ixgbe incorrectly reporting input errors for 82599ES [EN-23:04.ixgbe] 20221129: 13.1-RELEASE-p5 FreeBSD-SA-22:15.ping FreeBSD-EN-22:28.heimdal diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index ba1bff62eb1a..388c21f7d02a 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -54,7 +54,7 @@ TYPE="FreeBSD" REVISION="13.1" -BRANCH="RELEASE-p5" +BRANCH="RELEASE-p6" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Wed Feb 8 18:27:49 2023 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 4PBpQG278kz3nlhP; Wed, 8 Feb 2023 18:27:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PBpQG1cz9z3t7x; Wed, 8 Feb 2023 18:27:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675880870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k06+TUQuu/0mSGbsZWq3IXicm7Yuz9PgBRSu2Qf0zFc=; b=od/VWP2fcDfKeYa0LV+cH3yQikrb1+obdq0uQ6RalA23Y6bdn+c+8zqCpqTYCbkVu5MZyP hTeOZ2f3qbLCOx7glUm6kxuUY5fq1xy8mcUQaZQhJYnaKKLZHI3ruZGzajqsUOuhxFQNkJ kHIt4205r6C01ao83m0i/m4LERBHz8+rD8wgFMLHBW8E0C5CXFUAbBHt9Q6A1p5UARxvH+ Usef0Go9129JIAVivPXXMnCBWW9g9N2HXjaxDRLV2QAhBwVZwGqbR9DlV29scdcT2Ziy9S Oe1/VR7gqatGurQmfkoeu3LACU9dk6/3fO/5h4BBUIJKBV6pZ/EVB0EFmmcrMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675880870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k06+TUQuu/0mSGbsZWq3IXicm7Yuz9PgBRSu2Qf0zFc=; b=th57027lehkzyFYVmGAmgPiEtkfDXbql2rHKnJpFfMxn5W43yG1tcaZPztzzAXeDypQ1Ge j4I25pBr/2Gsl0Ard0QJHlKeuHqyC6Fgouj7fNn1z0vhrsyoI0f+0zG7Wl2TOzGPRuz+oy UJd7pYpQ5BA8naohMUWVGs/Rh6PYUp4U8Kj5p9GuaXwgKMztjGo98C6FSZ+WaJO4yXlfg3 TGSAqIy0YCt6p1EeFGZjex4+D/xbiaSfGtg+M9/kt/MKRq7OoZgE11QOTRb2YMkwg9fbN2 6KplerX+mrTyFgzI6SW6BKL47QHhtQS8l6ETd9DR0GOiaKheFEQwHPpd89A1bA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675880870; a=rsa-sha256; cv=none; b=mn8cfjigddvga4CYVcUsNeAhLMJZXqitbrjoDDjO9nzWx4EY21kRPwCTI9Tzp+nc0uXu7O 6Gq5W4r+ASpGjnd9Xz4XCPV6XnCMGCpelUeq3JwUmfCXCY3i/+aogmYFhu8NPympD5Wzfd ocqYL/+v9vDAX2Hb4wSuVMvKH0CjCLteaQGgVZPX38rAak8ZGgt36TEstkC5dQQWK3G5Mz nLtC/wx9rgKgDX/G1QC8r+x8i7d0smp5/BT5DiDWWcJytRvdO2SCLCukN4tW2p1uInqkmB Gl6Fed373kk8teNJkodHOn1/OUfVQWCKZgK9wK9HE8ag9twCa2q6fbAN+WC0FQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBpQG0f58z16Qj; Wed, 8 Feb 2023 18:27:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 318IRols037014; Wed, 8 Feb 2023 18:27:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 318IRn4k037013; Wed, 8 Feb 2023 18:27:49 GMT (envelope-from git) Date: Wed, 8 Feb 2023 18:27:49 GMT Message-Id: <202302081827.318IRn4k037013@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: d4745a868116 - releng/12.3 - contrib/tzdata: import tzdata 2022g 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: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/12.3 X-Git-Reftype: branch X-Git-Commit: d4745a8681160931692d9d399174842b1f07cc94 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/12.3 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=d4745a8681160931692d9d399174842b1f07cc94 commit d4745a8681160931692d9d399174842b1f07cc94 Author: Philip Paeps AuthorDate: 2022-11-30 01:36:28 +0000 Commit: Gordon Tetlow CommitDate: 2023-02-08 16:11:52 +0000 contrib/tzdata: import tzdata 2022g Changes: https://github.com/eggert/tz/blob/2022g/NEWS tzdata 2022g and later split America/Ciudad_Juarez from America/Ojinaga. Ensure this file is removed in builds WITHOUT_ZONEINFO. Approved by: so Security: FreeBSD-EN-23:01.tzdata (cherry picked from commit cf1ad5351036884e0a2e21d1bc9b712448467741) (cherry picked from commit 821549a9dfdf69f533feb84914b09450cd7311b6) (cherry picked from commit e2861c40b1aac3e4592a7d618418914b8f13c1dc) --- contrib/tzdata/Makefile | 55 +++++++---- contrib/tzdata/NEWS | 89 ++++++++++++++++- contrib/tzdata/africa | 4 + contrib/tzdata/asia | 2 +- contrib/tzdata/backward | 1 + contrib/tzdata/backzone | 55 ++++++++++- contrib/tzdata/europe | 28 +++++- contrib/tzdata/northamerica | 161 ++++++++++++++++++------------- contrib/tzdata/southamerica | 9 +- contrib/tzdata/theory.html | 1 - contrib/tzdata/version | 2 +- contrib/tzdata/zone.tab | 26 ++--- contrib/tzdata/zone1970.tab | 26 ++--- tools/build/mk/OptionalObsoleteFiles.inc | 1 + 14 files changed, 335 insertions(+), 125 deletions(-) diff --git a/contrib/tzdata/Makefile b/contrib/tzdata/Makefile index 34cec49d3af4..afb9d538a203 100644 --- a/contrib/tzdata/Makefile +++ b/contrib/tzdata/Makefile @@ -196,6 +196,7 @@ PACKRATLIST= UTF8_LOCALE= en_US.utf8 # Non-default libraries needed to link. +# On some hosts, this should have -lintl unless CFLAGS has -DHAVE_GETTEXT=0. LDLIBS= # Add the following to the end of the "CFLAGS=" line as needed to override @@ -208,14 +209,18 @@ LDLIBS= # For example, N is 252460800 on AmigaOS. # -DHAVE_DECL_ASCTIME_R=0 if does not declare asctime_r # -DHAVE_DECL_ENVIRON if declares 'environ' +# -DHAVE_DECL_TIMEGM=0 if does not declare timegm # -DHAVE_DIRECT_H if mkdir needs (MS-Windows) -# -DHAVE_GENERIC=0 if _Generic does not work -# -DHAVE_GETRANDOM if getgrandom works (e.g., GNU/Linux)* -# -DHAVE_GETTEXT if 'gettext' works (e.g., GNU/Linux, FreeBSD, Solaris)* +# -DHAVE_GENERIC=0 if _Generic does not work* +# -DHAVE_GETRANDOM if getrandom works (e.g., GNU/Linux), +# -DHAVE_GETRANDOM=0 to avoid using getrandom +# -DHAVE_GETTEXT if gettext works (e.g., GNU/Linux, FreeBSD, Solaris), +# where LDLIBS also needs to contain -lintl on some hosts; +# -DHAVE_GETTEXT=0 to avoid using gettext # -DHAVE_INCOMPATIBLE_CTIME_R if your system's time.h declares # ctime_r and asctime_r incompatibly with the POSIX standard # (Solaris when _POSIX_PTHREAD_SEMANTICS is not defined). -# -DHAVE_INTTYPES_H if you have a non-C99 compiler with +# -DHAVE_INTTYPES_H=0 if does not work* # -DHAVE_LINK=0 if your system lacks a link function # -DHAVE_LOCALTIME_R=0 if your system lacks a localtime_r function # -DHAVE_LOCALTIME_RZ=0 if you do not want zdump to use localtime_rz @@ -225,15 +230,17 @@ LDLIBS= # functions like 'link' or variables like 'tzname' required by POSIX # -DHAVE_SETENV=0 if your system lacks the setenv function # -DHAVE_SNPRINTF=0 if your system lacks the snprintf function -# -DHAVE_STDINT_H if you have a non-C99 compiler with * +# -DHAVE_STDCKDINT_H=0 if neither nor substitutes like +# __builtin_add_overflow work* +# -DHAVE_STDINT_H=0 if does not work* # -DHAVE_STRFTIME_L if declares locale_t and strftime_l # -DHAVE_STRDUP=0 if your system lacks the strdup function # -DHAVE_STRTOLL=0 if your system lacks the strtoll function # -DHAVE_SYMLINK=0 if your system lacks the symlink function -# -DHAVE_SYS_STAT_H=0 if your compiler lacks a * +# -DHAVE_SYS_STAT_H=0 if does not work* # -DHAVE_TZSET=0 if your system lacks a tzset function -# -DHAVE_UNISTD_H=0 if your compiler lacks a * -# -DHAVE_UTMPX_H=0 if your compiler lacks a * +# -DHAVE_UNISTD_H=0 if does not work* +# -DHAVE_UTMPX_H=0 if does not work* # -Dlocale_t=XXX if your system uses XXX instead of locale_t # -DRESERVE_STD_EXT_IDS if your platform reserves standard identifiers # with external linkage, e.g., applications cannot define 'localtime'. @@ -280,7 +287,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ -Wdeclaration-after-statement -Wdouble-promotion \ -Wduplicated-branches -Wduplicated-cond \ -Wformat=2 -Wformat-overflow=2 -Wformat-signedness -Wformat-truncation \ - -Winit-self -Wlogical-op \ + -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wnull-dereference \ -Wold-style-definition -Woverlength-strings -Wpointer-arith \ @@ -293,7 +300,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ -Wtrampolines -Wundef -Wuninitialized -Wunused-macros -Wuse-after-free=3 \ -Wvariadic-macros -Wvla -Wwrite-strings \ -Wno-address -Wno-format-nonliteral -Wno-sign-compare \ - -Wno-type-limits -Wno-unused-parameter + -Wno-type-limits # # If your system has a "GMT offset" field in its "struct tm"s # (or if you decide to add such a field in your system's "time.h" file), @@ -340,14 +347,11 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ # If you want functions that were inspired by early versions of X3J11's work, # add # -DSTD_INSPIRED -# to the end of the "CFLAGS=" line. This arranges for the functions -# "offtime", "timelocal", "timegm", "timeoff", -# "posix2time", and "time2posix" to be added to the time conversion library. +# to the end of the "CFLAGS=" line. This arranges for the following +# functions to be added to the time conversion library. # "offtime" is like "gmtime" except that it accepts a second (long) argument # that gives an offset to add to the time_t when converting it. # "timelocal" is equivalent to "mktime". -# "timegm" is like "timelocal" except that it turns a struct tm into -# a time_t using UT (rather than local time as "timelocal" does). # "timeoff" is like "timegm" except that it accepts a second (long) argument # that gives an offset to use when converting to a time_t. # "posix2time" and "time2posix" are described in an included manual page. @@ -495,6 +499,11 @@ TARFLAGS= `if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; \ # Flags to give 'gzip' when making a distribution. GZIPFLAGS= -9n +# When comparing .tzs files, use GNU diff's -F'^TZ=' option if supported. +# This makes it easier to see which Zone has been affected. +DIFF_TZS= diff -u$$(! diff -u -F'^TZ=' - - <>/dev/null >&0 2>&1 \ + || echo ' -F^TZ=') + ############################################################################### #MAKE= make @@ -773,7 +782,8 @@ tzselect: tzselect.ksh version chmod +x $@.out mv $@.out $@ -check: check_character_set check_white_space check_links \ +check: check_back check_mild +check_mild: check_character_set check_white_space check_links \ check_name_lengths check_slashed_abbrs check_sorted \ check_tables check_web check_ziguard check_zishrink check_tzs @@ -824,16 +834,19 @@ check_slashed_abbrs: $(TDATA_TO_CHECK) CHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n; i++) print a[1], a[i]; } check_sorted: backward backzone iso3166.tab zone.tab zone1970.tab - $(AWK) '/^Link/ {printf "%.5d %s\n", g, $$3} /^$$/ {g++}' \ + $(AWK) '/^Link/ {printf "%.5d %s\n", g, $$3} !/./ {g++}' \ backward | LC_ALL=C sort -cu $(AWK) '/^Zone/ {print $$2}' backzone | LC_ALL=C sort -cu touch $@ -check_links: checklinks.awk $(TDATA_TO_CHECK) tzdata.zi +check_back: checklinks.awk $(TDATA_TO_CHECK) $(AWK) \ -v DATAFORM=$(DATAFORM) \ -v backcheck=backward \ -f checklinks.awk $(TDATA_TO_CHECK) + touch $@ + +check_links: checklinks.awk tzdata.zi $(AWK) \ -v DATAFORM=$(DATAFORM) \ -f checklinks.awk tzdata.zi @@ -849,7 +862,7 @@ check_tables: checktab.awk $(YDATA) backward $(ZONETABLES) check_tzs: $(TZS) $(TZS_NEW) if test -s $(TZS); then \ - diff -u $(TZS) $(TZS_NEW); \ + $(DIFF_TZS) $(TZS) $(TZS_NEW); \ else \ cp $(TZS_NEW) $(TZS); \ fi @@ -1050,7 +1063,7 @@ $(TIME_T_ALTERNATIVES): $(VERSION_DEPS) TZS_YEAR="$$range" TZS_CUTOFF_FLAG="-t $$range" \ D=$$wd/$@.dir \ to$$range.tzs) && \ - diff -u $(TIME_T_ALTERNATIVES_HEAD).dir/to$$range.tzs \ + $(DIFF_TZS) $(TIME_T_ALTERNATIVES_HEAD).dir/to$$range.tzs \ $@.dir/to$$range.tzs && \ if diff -q Makefile Makefile 2>/dev/null; then \ quiet_option='-q'; \ @@ -1220,7 +1233,7 @@ zdump.o: version.h zic.o: private.h tzfile.h version.h .PHONY: ALL INSTALL all -.PHONY: check check_time_t_alternatives +.PHONY: check check_mild check_time_t_alternatives .PHONY: check_web check_zishrink .PHONY: clean clean_misc dummy.zd force_tzs .PHONY: install install_data maintainer-clean names diff --git a/contrib/tzdata/NEWS b/contrib/tzdata/NEWS index 086151073a3b..701e490e4834 100644 --- a/contrib/tzdata/NEWS +++ b/contrib/tzdata/NEWS @@ -1,5 +1,91 @@ News for the tz database +Release 2022g - 2022-11-29 08:58:31 -0800 + + Briefly: + The northern edge of Chihuahua changes to US timekeeping. + Much of Greenland stops changing clocks after March 2023. + Fix some pre-1996 timestamps in northern Canada. + C89 is now deprecated; please use C99 or later. + Portability fixes for AIX, libintl, MS-Windows, musl, z/OS + In C code, use more C23 features if available. + C23 timegm now supported by default + Fixes for unlikely integer overflows + + Changes to future timestamps + + In the Mexican state of Chihuahua, the border strip near the US + will change to agree with nearby US locations on 2022-11-30. + The strip's western part, represented by Ciudad Juárez, switches + from -06 all year to -07/-06 with US DST rules, like El Paso, TX. + The eastern part, represented by Ojinaga, will observe US DST next + year, like Presidio, TX. (Thanks to Heitor David Pinto.) + A new Zone America/Ciudad_Juarez splits from America/Ojinaga. + + Much of Greenland, represented by America/Nuuk, stops observing + winter time after March 2023, so its daylight saving time becomes + standard time. (Thanks to Jonas Nyrup and Jürgen Appel.) + + Changes to past timestamps + + Changes for pre-1996 northern Canada (thanks to Chris Walton): + + Merge America/Iqaluit and America/Pangnirtung into the former, + with a backward compatibility link for the latter name. + There is no good evidence the two locations differ since 1970. + This change affects pre-1996 America/Pangnirtung timestamps. + + Cambridge Bay, Inuvik, Iqaluit, Rankin Inlet, Resolute and + Yellowknife did not observe DST in 1965, and did observe DST + from 1972 through 1979. + + Whitehorse moved from -09 to -08 on 1966-02-27, not 1967-05-28. + + Colombia's 1993 fallback was 02-06 24:00, not 04-04 00:00. + (Thanks to Alois Treindl.) + + Singapore's 1981-12-31 change was at 16:00 UTC (23:30 local time), + not 24:00 local time. (Thanks to Geoff Clare via Robert Elz.) + + Changes to code + + Although tzcode still works with C89, bugs found in recent routine + maintenance indicate that bitrot has set in and that in practice + C89 is no longer used to build tzcode. As it is a maintenance + burden, support for C89 is planned to be removed soon. Instead, + please use compilers compatible with C99, C11, C17, or C23. + + timegm, which tzcode implemented in 1989, will finally be + standardized 34 years later as part of C23, so timegm is now + supported even if STD_INSPIRED is not defined. + + Fix bug in zdump's tzalloc emulation on hosts that lack tm_zone. + (Problem reported by Đoàn Trần Công Danh.) + + Fix bug in zic on hosts where malloc(0) yields NULL on success. + (Problem reported by Tim McBrayer for AIX 6.1.) + + Fix zic configuration to avoid linkage failures on some platforms. + (Problems reported by Gilmore Davidson and Igor Ivanov.) + + Work around MS-Windows nmake incompatibility with POSIX. + (Problem reported by Manuela Friedrich.) + + Port mktime and strftime to debugging platforms where accessing + uninitialized data has undefined behavior (strftime problem + reported by Robert Elz). + + Check more carefully for unlikely integer overflows, preferring + C23 to overflow checking by hand, as the latter has + had obscure bugs. + + Changes to build procedure + + New Makefile rule check_mild that skips checking whether Link + lines are in the file 'backward'. (Inspired by a suggestion from + Stephen Colebourne.) + + Release 2022f - 2022-10-28 18:04:57 -0700 Briefly: @@ -16,7 +102,7 @@ Release 2022f - 2022-10-28 18:04:57 -0700 In C code, use some C23 features if available. Remove no-longer-needed workaround for Qt bug 53071. - Changes to future timestamps. + Changes to future timestamps Mexico will no longer observe DST after 2022, except for areas near the US border that continue to observe US DST rules. @@ -24,6 +110,7 @@ Release 2022f - 2022-10-28 18:04:57 -0700 from -07 (-06 with DST) to year-round -06, thus not changing its clocks that day. The new law states that Chihuahua near the US border no longer observes US DST. + (Thanks to gera for the heads-up about Chihuahua.) Fiji will not observe DST in 2022/3. (Thanks to Shalvin Narayan.) For now, assume DST is suspended indefinitely. diff --git a/contrib/tzdata/africa b/contrib/tzdata/africa index 92a61259f916..cfb9283c045d 100644 --- a/contrib/tzdata/africa +++ b/contrib/tzdata/africa @@ -588,6 +588,10 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis # Agalega Is, Rodriguez # no information; probably like Indian/Mauritius + +# Morocco +# See Africa/Ceuta for Spanish Morocco. + # From Alex Krivenyshev (2008-05-09): # Here is an article that Morocco plan to introduce Daylight Saving Time between # 1 June, 2008 and 27 September, 2008. diff --git a/contrib/tzdata/asia b/contrib/tzdata/asia index 6e8ad282ee61..199e6ad6adc3 100644 --- a/contrib/tzdata/asia +++ b/contrib/tzdata/asia @@ -3585,7 +3585,7 @@ Zone Asia/Singapore 6:55:25 - LMT 1901 Jan 1 7:20 - +0720 1941 Sep 1 7:30 - +0730 1942 Feb 16 9:00 - +09 1945 Sep 12 - 7:30 - +0730 1982 Jan 1 + 7:30 - +0730 1981 Dec 31 16:00u 8:00 - +08 # Spratly Is diff --git a/contrib/tzdata/backward b/contrib/tzdata/backward index 4c1c5d5f8f71..0ae5d74108e6 100644 --- a/contrib/tzdata/backward +++ b/contrib/tzdata/backward @@ -267,6 +267,7 @@ Link America/Tijuana America/Ensenada Link America/Indiana/Indianapolis America/Fort_Wayne Link America/Toronto America/Montreal Link America/Toronto America/Nipigon +Link America/Iqaluit America/Pangnirtung Link America/Rio_Branco America/Porto_Acre Link America/Winnipeg America/Rainy_River Link America/Argentina/Cordoba America/Rosario diff --git a/contrib/tzdata/backzone b/contrib/tzdata/backzone index b4ebd2e478c3..7803c57d095d 100644 --- a/contrib/tzdata/backzone +++ b/contrib/tzdata/backzone @@ -7,6 +7,10 @@ # tz@iana.org for general use in the future). For more, please see # the file CONTRIBUTING in the tz distribution. +# When proposing changes to this file, please use 'git format-patch' +# format, either by attaching the resulting .patch file to your email, +# or by using 'git send-email'. This will help maintainers save time. + # From Paul Eggert (2014-10-31): @@ -750,6 +754,55 @@ Zone America/Nipigon -5:53:04 - LMT 1895 -5:00 1:00 EDT 1942 Feb 9 2:00s -5:00 Canada E%sT +# From Rives McDow (1999-11-08): +# On October 31, when the rest of Nunavut went to Central time, +# Pangnirtung wobbled. Here is the result of their wobble: +# +# The following businesses and organizations in Pangnirtung use Central Time: +# +# First Air, Power Corp, Nunavut Construction, Health Center, RCMP, +# Eastern Arctic National Parks, A & D Specialist +# +# The following businesses and organizations in Pangnirtung use Eastern Time: +# +# Hamlet office, All other businesses, Both schools, Airport operator +# +# This has made for an interesting situation there, which warranted the news. +# No one there that I spoke with seems concerned, or has plans to +# change the local methods of keeping time, as it evidently does not +# really interfere with any activities or make things difficult locally. +# They plan to celebrate New Year's turn-over twice, one hour apart, +# so it appears that the situation will last at least that long. +# The Nunavut Intergovernmental Affairs hopes that they will "come to +# their senses", but the locals evidently don't see any problem with +# the current state of affairs. + +# From Michaela Rodrigue, writing in the +# Nunatsiaq News (1999-11-19): +# http://www.nunatsiaqonline.ca/archives/nunavut991130/nvt91119_17.html +# Clyde River, Pangnirtung and Sanikiluaq now operate with two time zones, +# central - or Nunavut time - for government offices, and eastern time +# for municipal offices and schools.... Igloolik [was similar but then] +# made the switch to central time on Saturday, Nov. 6. + +# From Chris Walton (2022-11-06): +# The implication is that Pangnirtung and Qikiqtarjuaq have observed Eastern +# Time as far back as 1984 (and likely even further back than that). +# It is possible that these communities never actually observed Atlantic +# Time, but that would be difficult to prove. +# From Paul Eggert (2022-11-06): +# This is in 'backzone' as we have no good evidence that Pangnirtung differs +# from America/Iqaluit since 1970. A Google Books snippet view of +# volume 2, page 186 of "Pilot of Arctic Canada", published 1959 by +# the Canadian Hydrographic Service, suggests (though does not state) +# that Pangnirtung observed EST then. +# +# aka Panniqtuuq +Zone America/Pangnirtung 0 - -00 1921 # trading post est. + -5:00 NT_YK E%sT 1999 Oct 31 2:00 + -6:00 Canada C%sT 2000 Oct 29 2:00 + -5:00 Canada E%sT + # United States # # From Paul Eggert (2018-03-18): @@ -1043,7 +1096,7 @@ Zone Asia/Kuala_Lumpur 6:46:46 - LMT 1901 Jan 1 7:20 - +0720 1941 Sep 1 7:30 - +0730 1942 Feb 16 9:00 - +09 1945 Sep 12 - 7:30 - +0730 1982 Jan 1 + 7:30 - +0730 1981 Dec 31 16:00u 8:00 - +08 # Kuwait diff --git a/contrib/tzdata/europe b/contrib/tzdata/europe index 6ac41e7272a2..a3547b4f81a4 100644 --- a/contrib/tzdata/europe +++ b/contrib/tzdata/europe @@ -1103,7 +1103,30 @@ Zone Atlantic/Faroe -0:27:04 - LMT 1908 Jan 11 # Tórshavn # "National Park" by Executive Order: # http://naalakkersuisut.gl/~/media/Nanoq/Files/Attached%20Files/Engelske-tekster/Legislation/Executive%20Order%20National%20Park.rtf # It is their only National Park. -# + +# From Jonas Nyrup (2022-11-24): +# On last Saturday in October 2023 when DST ends America/Nuuk will switch +# from -03/-02 to -02/-01 +# https://sermitsiaq.ag/forslagtidsforskel-danmark-mindskes-sommertid-beholdes +# ... +# https://sermitsiaq.ag/groenland-skifte-tidszone-trods-bekymringer +# +# From Jürgen Appel (2022-11-25): +# https://ina.gl/samlinger/oversigt-over-samlinger/samling/dagsordener/dagsorden.aspx?lang=da&day=24-11-2022 +# If I understand this correctly, from the next planned switch to +# summer time, Greenland will permanently stay at that time, i.e. no +# switch back to winter time in 2023 will occur. +# +# From Paul Eggert (2022-11-28): +# The official document in Danish +# https://naalakkersuisut.gl/-/media/naalakkersuisut/filer/kundgoerelser/2022/11/2511/31_da_inatsisartutlov-om-tidens-bestemmelse.pdf?la=da&hash=A33597D8A38CC7038465241119EF34F3 +# says standard time for Greenland is -02, that Naalakkersuisut can lay down +# rules for DST and can require some areas to use a different time zone, +# and that this all takes effect 2023-03-25 22:00. The abovementioned +# "bekymringer" URL says the intent is no transition March 25, that +# Greenland will not go back to winter time in fall 2023, and that +# only America/Nuuk is affected (though further changes may occur). + # Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Thule 1991 1992 - Mar lastSun 2:00 1:00 D Rule Thule 1991 1992 - Sep lastSun 2:00 0 S @@ -1126,7 +1149,8 @@ Zone America/Scoresbysund -1:27:52 - LMT 1916 Jul 28 # Ittoqqortoormiit -1:00 EU -01/+00 Zone America/Nuuk -3:26:56 - LMT 1916 Jul 28 # Godthåb -3:00 - -03 1980 Apr 6 2:00 - -3:00 EU -03/-02 + -3:00 EU -03/-02 2023 Mar 25 22:00 + -2:00 - -02 Zone America/Thule -4:35:08 - LMT 1916 Jul 28 # Pituffik -4:00 Thule A%sT diff --git a/contrib/tzdata/northamerica b/contrib/tzdata/northamerica index df1954359cce..d50581d00774 100644 --- a/contrib/tzdata/northamerica +++ b/contrib/tzdata/northamerica @@ -1969,6 +1969,37 @@ Zone America/Fort_Nelson -8:10:47 - LMT 1884 # Northwest Territories, Nunavut, Yukon +# From Chris Walton (2022-11-06): +# Whitehorse Star - Thursday April 22, 1965 - page 1 +# title: DST Starts Monday ... +# https://www.newspapers.com/image/578587481/ +# The title of this first article is wrong and/or misleading. +# Also, the start time shown in the article is vague; it simply says "after +# midnight" when it probably should have stated 2:00a.m.... +# +# Whitehorse Star - Monday October 25, 1965 - page 15 ... +# https://www.newspapers.com/image/578589147/ +# The 1965 Yukon Council minutes can be found here: +# http://assets.yukonarchives.ca/PER_YG_06_1965_C20_S02_v1.pdf +# ... I do not currently believe that NWT touched any of its clocks in 1965.... +# +# Whitehorse Star - Thursday Feb 24,1966 - page 2 +# title: It's Time for YDT ... +# https://www.newspapers.com/image/578575979/ ... +# America/Whitehorse as a permanent change from UTC-9(YST) to +# UTC-8(PST) at 00:00 on Sunday February 27, 1966.... +# +# Whitehorse Star - Friday April 28,1972 - page 6 +# title: Daylight Saving Time for N.W.T.... +# https://www.newspapers.com/image/578701610/ ... +# Nunavut and NWT zones ... DST starting in 1972.... Start and End ... +# should be the same as the rest of Canada +# +# +# From Paul Eggert (2022-11-06): +# For now, assume Yukon's 1965-04-22 spring forward was 00:00 -> 02:00, as this +# seems likely than 02:00 -> 04:00 and matches "after midnight". + # From Paul Eggert (2006-03-22): # Dawson switched to PST in 1973. Inuvik switched to MST in 1979. # Mathew Englander (1996-10-07) gives the following refs: @@ -2083,6 +2114,13 @@ Zone America/Fort_Nelson -8:10:47 - LMT 1884 # * Interpretation Act, RSY 2002, c 125 # https://www.canlii.org/en/yk/laws/stat/rsy-2002-c-125/latest/rsy-2002-c-125.html +# From Chris Walton (2022-11-06): +# The 5th edition of the Atlas of Canada contains a time zone map that +# shows both legislated and observed time zone boundaries. +# All communities on Baffin Island are shown to be observing Eastern time. +# The date on the map is 1984. +# https://ftp.maps.canada.ca/pub/nrcan_rncan/raster/atlas_5_ed/eng/other/referencemaps/mcr4056.pdf + # From Rives McDow (1999-09-04): # Nunavut ... moved ... to incorporate the whole territory into one time zone. # Nunavut moves to single time zone Oct. 31 @@ -2095,40 +2133,7 @@ Zone America/Fort_Nelson -8:10:47 - LMT 1884 # From Paul Eggert (1999-09-20): # Basic Facts: The New Territory # http://www.nunavut.com/basicfacts/english/basicfacts_1territory.html -# (1999) reports that Pangnirtung operates on eastern time, -# and that Coral Harbour does not observe DST. We don't know when -# Pangnirtung switched to eastern time; we'll guess 1995. - -# From Rives McDow (1999-11-08): -# On October 31, when the rest of Nunavut went to Central time, -# Pangnirtung wobbled. Here is the result of their wobble: -# -# The following businesses and organizations in Pangnirtung use Central Time: -# -# First Air, Power Corp, Nunavut Construction, Health Center, RCMP, -# Eastern Arctic National Parks, A & D Specialist -# -# The following businesses and organizations in Pangnirtung use Eastern Time: -# -# Hamlet office, All other businesses, Both schools, Airport operator -# -# This has made for an interesting situation there, which warranted the news. -# No one there that I spoke with seems concerned, or has plans to -# change the local methods of keeping time, as it evidently does not -# really interfere with any activities or make things difficult locally. -# They plan to celebrate New Year's turn-over twice, one hour apart, -# so it appears that the situation will last at least that long. -# The Nunavut Intergovernmental Affairs hopes that they will "come to -# their senses", but the locals evidently don't see any problem with -# the current state of affairs. - -# From Michaela Rodrigue, writing in the -# Nunatsiaq News (1999-11-19): -# http://www.nunatsiaqonline.ca/archives/nunavut991130/nvt91119_17.html -# Clyde River, Pangnirtung and Sanikiluaq now operate with two time zones, -# central - or Nunavut time - for government offices, and eastern time -# for municipal offices and schools.... Igloolik [was similar but then] -# made the switch to central time on Saturday, Nov. 6. +# (1999) reports that ... Coral Harbour does not observe DST. # From Paul Eggert (2000-10-02): # Matthews and Vincent (1998) say the following, but we lack histories @@ -2287,18 +2292,12 @@ Rule NT_YK 1919 only - Nov 1 0:00 0 S Rule NT_YK 1942 only - Feb 9 2:00 1:00 W # War Rule NT_YK 1945 only - Aug 14 23:00u 1:00 P # Peace Rule NT_YK 1945 only - Sep 30 2:00 0 S -Rule NT_YK 1965 only - Apr lastSun 0:00 2:00 DD -Rule NT_YK 1965 only - Oct lastSun 2:00 0 S -Rule NT_YK 1980 1986 - Apr lastSun 2:00 1:00 D -Rule NT_YK 1980 2006 - Oct lastSun 2:00 0 S +Rule NT_YK 1972 1986 - Apr lastSun 2:00 1:00 D +Rule NT_YK 1972 2006 - Oct lastSun 2:00 0 S Rule NT_YK 1987 2006 - Apr Sun>=1 2:00 1:00 D +Rule Yukon 1965 only - Apr lastSun 0:00 2:00 DD +Rule Yukon 1965 only - Oct lastSun 2:00 0 S # Zone NAME STDOFF RULES FORMAT [UNTIL] -# aka Panniqtuuq -Zone America/Pangnirtung 0 - -00 1921 # trading post est. - -4:00 NT_YK A%sT 1995 Apr Sun>=1 2:00 - -5:00 Canada E%sT 1999 Oct 31 2:00 - -6:00 Canada C%sT 2000 Oct 29 2:00 - -5:00 Canada E%sT # formerly Frobisher Bay Zone America/Iqaluit 0 - -00 1942 Aug # Frobisher Bay est. -5:00 NT_YK E%sT 1999 Oct 31 2:00 @@ -2331,13 +2330,15 @@ Zone America/Inuvik 0 - -00 1953 # Inuvik founded -7:00 NT_YK M%sT 1980 -7:00 Canada M%sT Zone America/Whitehorse -9:00:12 - LMT 1900 Aug 20 - -9:00 NT_YK Y%sT 1967 May 28 0:00 - -8:00 NT_YK P%sT 1980 + -9:00 NT_YK Y%sT 1965 + -9:00 Yukon Y%sT 1966 Feb 27 0:00 + -8:00 - PST 1980 -8:00 Canada P%sT 2020 Nov 1 -7:00 - MST Zone America/Dawson -9:17:40 - LMT 1900 Aug 20 - -9:00 NT_YK Y%sT 1973 Oct 28 0:00 - -8:00 NT_YK P%sT 1980 + -9:00 NT_YK Y%sT 1965 + -9:00 Yukon Y%sT 1973 Oct 28 0:00 + -8:00 - PST 1980 -8:00 Canada P%sT 2020 Nov 1 -7:00 - MST @@ -2559,6 +2560,14 @@ Zone America/Dawson -9:17:40 - LMT 1900 Aug 20 # This abolishes DST except where US DST rules are observed, # and in addition changes all of Chihuahua to -06 with no DST. +# From Heitor David Pinto (2022-11-28): +# Now the northern municipalities want to have the same time zone as the +# respective neighboring cities in the US, for example Juárez in UTC-7 with +# DST, matching El Paso, and Ojinaga in UTC-6 with DST, matching Presidio.... +# the president authorized the publication of the decree for November 29, +# so the time change would occur on November 30 at 0:00. +# http://puentelibre.mx/noticia/ciudad_juarez_cambio_horario_noviembre_2022/ + # Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Mexico 1931 only - May 1 23:00 1:00 D Rule Mexico 1931 only - Oct 1 0:00 0 S @@ -2590,14 +2599,12 @@ Zone America/Merida -5:58:28 - LMT 1922 Jan 1 6:00u -6:00 Mexico C%sT # Coahuila, Nuevo León, Tamaulipas (near US border) # This includes the following municipalities: -# in Coahuila: Ocampo, Acuña, Zaragoza, Jiménez, Piedras Negras, Nava, -# Guerrero, Hidalgo. -# in Nuevo León: Anáhuac, Los Aldama. +# in Coahuila: Acuña, Allende, Guerrero, Hidalgo, Jiménez, Morelos, Nava, +# Ocampo, Piedras Negras, Villa Unión, Zaragoza +# in Nuevo León: Anáhuac # in Tamaulipas: Nuevo Laredo, Guerrero, Mier, Miguel Alemán, Camargo, # Gustavo Díaz Ordaz, Reynosa, Río Bravo, Valle Hermoso, Matamoros. -# See: Inicia mañana Horario de Verano en zona fronteriza, El Universal, -# 2016-03-12 -# http://www.eluniversal.com.mx/articulo/estados/2016/03/12/inicia-manana-horario-de-verano-en-zona-fronteriza +# https://www.dof.gob.mx/nota_detalle.php?codigo=5670045&fecha=28/10/2022 Zone America/Matamoros -6:30:00 - LMT 1922 Jan 1 6:00u -6:00 - CST 1988 -6:00 US C%sT 1989 @@ -2616,10 +2623,24 @@ Zone America/Mexico_City -6:36:36 - LMT 1922 Jan 1 7:00u -6:00 Mexico C%sT 2001 Sep 30 2:00 -6:00 - CST 2002 Feb 20 -6:00 Mexico C%sT -# Chihuahua (near US border) +# Chihuahua (near US border - western side) # This includes the municipalities of Janos, Ascensión, Juárez, Guadalupe, -# Práxedis G Guerrero, Coyame del Sotol, Ojinaga, and Manuel Benavides. -# (See the 2016-03-12 El Universal source mentioned above.) +# and Práxedis G Guerrero. +# http://gaceta.diputados.gob.mx/PDF/65/2a022/nov/20221124-VII.pdf +Zone America/Ciudad_Juarez -7:05:56 - LMT 1922 Jan 1 7:00u + -7:00 - MST 1927 Jun 10 23:00 + -6:00 - CST 1930 Nov 15 + -7:00 Mexico M%sT 1932 Apr 1 + -6:00 - CST 1996 + -6:00 Mexico C%sT 1998 + -6:00 - CST 1998 Apr Sun>=1 3:00 + -7:00 Mexico M%sT 2010 + -7:00 US M%sT 2022 Oct 30 2:00 + -6:00 - CST 2022 Nov 30 0:00 + -7:00 US M%sT +# Chihuahua (near US border - eastern side) +# The municipalities of Coyame del Sotol, Ojinaga, and Manuel Benavides. +# http://gaceta.diputados.gob.mx/PDF/65/2a022/nov/20221124-VII.pdf Zone America/Ojinaga -6:57:40 - LMT 1922 Jan 1 7:00u -7:00 - MST 1927 Jun 10 23:00 -6:00 - CST 1930 Nov 15 @@ -2629,7 +2650,8 @@ Zone America/Ojinaga -6:57:40 - LMT 1922 Jan 1 7:00u -6:00 - CST 1998 Apr Sun>=1 3:00 -7:00 Mexico M%sT 2010 -7:00 US M%sT 2022 Oct 30 2:00 - -6:00 - CST + -6:00 - CST 2022 Nov 30 0:00 + -6:00 US C%sT # Chihuahua (away from US border) Zone America/Chihuahua -7:04:20 - LMT 1922 Jan 1 7:00u -7:00 - MST 1927 Jun 10 23:00 @@ -2651,6 +2673,18 @@ Zone America/Hermosillo -7:23:52 - LMT 1922 Jan 1 7:00u -7:00 Mexico M%sT 1999 -7:00 - MST +# Baja California Sur, Nayarit (except Bahía de Banderas), Sinaloa +Zone America/Mazatlan -7:05:40 - LMT 1922 Jan 1 7:00u + -7:00 - MST 1927 Jun 10 23:00 + -6:00 - CST 1930 Nov 15 + -7:00 Mexico M%sT 1932 Apr 1 + -6:00 - CST 1942 Apr 24 + -7:00 - MST 1949 Jan 14 + -8:00 - PST 1970 + -7:00 Mexico M%sT + +# Bahía de Banderas + # From Alexander Krivenyshev (2010-04-21): # According to news, Bahía de Banderas (Mexican state of Nayarit) # changed time zone UTC-7 to new time zone UTC-6 on April 4, 2010 (to @@ -2678,17 +2712,6 @@ Zone America/Hermosillo -7:23:52 - LMT 1922 Jan 1 7:00u # From Arthur David Olson (2010-05-01): # Use "Bahia_Banderas" to keep the name to fourteen characters. -# Mazatlán -Zone America/Mazatlan -7:05:40 - LMT 1922 Jan 1 7:00u - -7:00 - MST 1927 Jun 10 23:00 - -6:00 - CST 1930 Nov 15 - -7:00 Mexico M%sT 1932 Apr 1 - -6:00 - CST 1942 Apr 24 - -7:00 - MST 1949 Jan 14 - -8:00 - PST 1970 - -7:00 Mexico M%sT - -# Bahía de Banderas Zone America/Bahia_Banderas -7:01:00 - LMT 1922 Jan 1 7:00u -7:00 - MST 1927 Jun 10 23:00 -6:00 - CST 1930 Nov 15 diff --git a/contrib/tzdata/southamerica b/contrib/tzdata/southamerica index 13cc65efa32b..87b71d5f9210 100644 --- a/contrib/tzdata/southamerica +++ b/contrib/tzdata/southamerica @@ -1418,9 +1418,14 @@ Zone Antarctica/Palmer 0 - -00 1965 # Milne gives 4:56:16.4 for Bogotá time in 1899. He writes, # "A variation of fifteen minutes in the public clocks of Bogota is not rare." +# From Alois Treindl (2022-11-10): +# End of time change in Colombia 1993 ... should be 6 February 24h ... +# DECRETO 267 DE 1993 +# https://www.suin-juriscol.gov.co/viewDocument.asp?ruta=Decretos/1061335 + # Rule NAME FROM TO - IN ON AT SAVE LETTER/S -Rule CO 1992 only - May 3 0:00 1:00 - -Rule CO 1993 only - Apr 4 0:00 0 - +Rule CO 1992 only - May 3 0:00 1:00 - +Rule CO 1993 only - Feb 6 24:00 0 - # Zone NAME STDOFF RULES FORMAT [UNTIL] #STDOFF -4:56:16.4 Zone America/Bogota -4:56:16 - LMT 1884 Mar 13 diff --git a/contrib/tzdata/theory.html b/contrib/tzdata/theory.html index 298db866b39c..75e347f0f9d1 100644 --- a/contrib/tzdata/theory.html +++ b/contrib/tzdata/theory.html @@ -60,7 +60,6 @@ with current and future timestamps in the traditional North American mountain time zone can choose from the timezones America/Denver which observes US-style daylight saving time (DST), -America/Mazatlan which observes Mexican-style DST, and America/Phoenix which does not observe DST. Applications that also deal with past timestamps in the mountain time zone can choose from over a dozen timezones, such as diff --git a/contrib/tzdata/version b/contrib/tzdata/version index 5c8fbb478a2c..b74fa117a223 100644 --- a/contrib/tzdata/version +++ b/contrib/tzdata/version @@ -1 +1 @@ -2022f +2022g diff --git a/contrib/tzdata/zone.tab b/contrib/tzdata/zone.tab index 2636e21a9fca..6e5adb9fcca6 100644 --- a/contrib/tzdata/zone.tab +++ b/contrib/tzdata/zone.tab @@ -114,8 +114,7 @@ CA +4606-06447 America/Moncton Atlantic - New Brunswick CA +5320-06025 America/Goose_Bay Atlantic - Labrador (most areas) CA +5125-05707 America/Blanc-Sablon AST - QC (Lower North Shore) CA +4339-07923 America/Toronto Eastern - ON, QC (most areas) -CA +6344-06828 America/Iqaluit Eastern - NU (most east areas) -CA +6608-06544 America/Pangnirtung Eastern - NU (Pangnirtung) +CA +6344-06828 America/Iqaluit Eastern - NU (most areas) CA +484531-0913718 America/Atikokan EST - ON (Atikokan); NU (Coral H) CA +4953-09709 America/Winnipeg Central - ON (west); Manitoba CA +744144-0944945 America/Resolute Central - NU (Resolute) @@ -277,17 +276,18 @@ MT +3554+01431 Europe/Malta MU -2010+05730 Indian/Mauritius MV +0410+07330 Indian/Maldives MW -1547+03500 Africa/Blantyre -MX +1924-09909 America/Mexico_City Central Time -MX +2105-08646 America/Cancun Eastern Standard Time - Quintana Roo -MX +2058-08937 America/Merida Central Time - Campeche, Yucatan -MX +2540-10019 America/Monterrey Central Time - Durango; Coahuila, Nuevo Leon, Tamaulipas (most areas) -MX +2550-09730 America/Matamoros Central Time US - Coahuila, Nuevo Leon, Tamaulipas (US border) -MX +2313-10625 America/Mazatlan Mountain Time - Baja California Sur, Nayarit, Sinaloa -MX +2838-10605 America/Chihuahua Mountain Time - Chihuahua (most areas) -MX +2934-10425 America/Ojinaga Mountain Time US - Chihuahua (US border) -MX +2904-11058 America/Hermosillo Mountain Standard Time - Sonora -MX +3232-11701 America/Tijuana Pacific Time US - Baja California -MX +2048-10515 America/Bahia_Banderas Central Time - Bahia de Banderas +MX +1924-09909 America/Mexico_City Central Mexico +MX +2105-08646 America/Cancun Quintana Roo +MX +2058-08937 America/Merida Campeche, Yucatan +MX +2540-10019 America/Monterrey Durango; Coahuila, Nuevo Leon, Tamaulipas (most areas) +MX +2550-09730 America/Matamoros Coahuila, Nuevo Leon, Tamaulipas (US border) +MX +2838-10605 America/Chihuahua Chihuahua (most areas) +MX +3144-10629 America/Ciudad_Juarez Chihuahua (US border - west) +MX +2934-10425 America/Ojinaga Chihuahua (US border - east) +MX +2313-10625 America/Mazatlan Baja California Sur, Nayarit (most areas), Sinaloa +MX +2048-10515 America/Bahia_Banderas Bahia de Banderas +MX +2904-11058 America/Hermosillo Sonora +MX +3232-11701 America/Tijuana Baja California MY +0310+10142 Asia/Kuala_Lumpur Malaysia (peninsula) MY +0133+11020 Asia/Kuching Sabah, Sarawak MZ -2558+03235 Africa/Maputo diff --git a/contrib/tzdata/zone1970.tab b/contrib/tzdata/zone1970.tab index d48c9c5d9493..10dae7e7db17 100644 --- a/contrib/tzdata/zone1970.tab +++ b/contrib/tzdata/zone1970.tab @@ -103,8 +103,7 @@ CA +4612-05957 America/Glace_Bay Atlantic - NS (Cape Breton) CA +4606-06447 America/Moncton Atlantic - New Brunswick CA +5320-06025 America/Goose_Bay Atlantic - Labrador (most areas) CA,BS +4339-07923 America/Toronto Eastern - ON, QC (most areas), Bahamas -CA +6344-06828 America/Iqaluit Eastern - NU (most east areas) -CA +6608-06544 America/Pangnirtung Eastern - NU (Pangnirtung) +CA +6344-06828 America/Iqaluit Eastern - NU (most areas) CA +4953-09709 America/Winnipeg Central - ON (west); Manitoba CA +744144-0944945 America/Resolute Central - NU (Resolute) CA +624900-0920459 America/Rankin_Inlet Central - NU (central) @@ -215,17 +214,18 @@ MQ +1436-06105 America/Martinique MT +3554+01431 Europe/Malta MU -2010+05730 Indian/Mauritius MV,TF +0410+07330 Indian/Maldives Maldives, Kerguelen, St Paul I, Amsterdam I -MX +1924-09909 America/Mexico_City Central Time -MX +2105-08646 America/Cancun Eastern Standard Time - Quintana Roo -MX +2058-08937 America/Merida Central Time - Campeche, Yucatán -MX +2540-10019 America/Monterrey Central Time - Durango; Coahuila, Nuevo León, Tamaulipas (most areas) -MX +2550-09730 America/Matamoros Central Time US - Coahuila, Nuevo León, Tamaulipas (US border) -MX +2313-10625 America/Mazatlan Mountain Time - Baja California Sur, Nayarit, Sinaloa -MX +2838-10605 America/Chihuahua Mountain Time - Chihuahua (most areas) -MX +2934-10425 America/Ojinaga Mountain Time US - Chihuahua (US border) -MX +2904-11058 America/Hermosillo Mountain Standard Time - Sonora -MX +3232-11701 America/Tijuana Pacific Time US - Baja California -MX +2048-10515 America/Bahia_Banderas Central Time - Bahía de Banderas +MX +1924-09909 America/Mexico_City Central Mexico +MX +2105-08646 America/Cancun Quintana Roo +MX +2058-08937 America/Merida Campeche, Yucatán +MX +2540-10019 America/Monterrey Durango; Coahuila, Nuevo León, Tamaulipas (most areas) +MX +2550-09730 America/Matamoros Coahuila, Nuevo León, Tamaulipas (US border) +MX +2838-10605 America/Chihuahua Chihuahua (most areas) +MX +3144-10629 America/Ciudad_Juarez Chihuahua (US border - west) +MX +2934-10425 America/Ojinaga Chihuahua (US border - east) +MX +2313-10625 America/Mazatlan Baja California Sur, Nayarit (most areas), Sinaloa +MX +2048-10515 America/Bahia_Banderas Bahía de Banderas +MX +2904-11058 America/Hermosillo Sonora +MX +3232-11701 America/Tijuana Baja California MY,BN +0133+11020 Asia/Kuching Sabah, Sarawak, Brunei MZ,BI,BW,CD,MW,RW,ZM,ZW -2558+03235 Africa/Maputo Central Africa Time NA -2234+01706 Africa/Windhoek diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 5de6f66c95af..b68103db249b 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -10335,6 +10335,7 @@ OLD_FILES+=usr/share/zoneinfo/America/Cayenne OLD_FILES+=usr/share/zoneinfo/America/Cayman OLD_FILES+=usr/share/zoneinfo/America/Chicago OLD_FILES+=usr/share/zoneinfo/America/Chihuahua +OLD_FILES+=usr/share/zoneinfo/America/Ciudad_Juarez OLD_FILES+=usr/share/zoneinfo/America/Costa_Rica OLD_FILES+=usr/share/zoneinfo/America/Creston OLD_FILES+=usr/share/zoneinfo/America/Cuiaba From nobody Wed Feb 8 18:27:51 2023 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 4PBpQH3kHBz3nlVr; Wed, 8 Feb 2023 18:27: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 4PBpQH2h3Fz3tZq; Wed, 8 Feb 2023 18:27:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675880871; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lHV5kGsEhp56yGJXkOU82RgMkFyXVq673xL4bj+hduM=; b=hY+We5YWiHCgphaQbWstTovqLyEwXIXHO2xk6fJUBK6UvblYXxM15c1FZknkWqE+oISWGt 6ASvmN8lDAVJl3x6TJgE/Ly6gq7jy23VNdYAiV8j600bU8nMLBwpAjp8qm2OZsijPsRdlA njapUGdAep5+pJBXfL1SWQ6FbGNHpiaumrmr9OCojp+1LE4cFUyPyKhOvupfA9vX/PMRyD kTLOm5ctO1e5a95DHafH6EGjjXcuBISNHZZHLEiYP9avBv1/IlNmTEbTcXNktnft8wO+Qw emcQi06eqtazt98cG7oSZhbvFZbo3vwwVdzknZLfZj9vc41mNzxDr8UOkQqQTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675880871; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lHV5kGsEhp56yGJXkOU82RgMkFyXVq673xL4bj+hduM=; b=EzA8qsH9L6kFSv8y0Pbz7oBeOMD7y40JLQirAWQpLnvwbF0/ia6moI5EaTKAOmBjFhiU86 Joyt6sIbcEbdDtfcbAYwCxFIo8VC6yr6JId9lkStiw+2M4VKSCDeU85cjFfAXTfCr+n7rb O+Xz+6JIY7VJS5oBHRmvcf5kc/potV5C5GM542fjvQr0i7ny+whuT3wm6DcBbGbr/egUYA E8i970mtU3eTT5W01TmKjmj3wOc6VyTUlOZ2+SXw/kkHUbyB6asqsWfxiwz+SWZ6iM3/Ll NQ7YMNKLuLetaLqOE1cM3aalMO5CkR/LwWQcLwErKUWch+ZSIKHyNC+jU0KGDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675880871; a=rsa-sha256; cv=none; b=SqS6bGn1pUFq/XKNo5DVnsL6JVrTqHHqsO0gjFccB/ZIEUxhB5LgZ8XNtb68/HzGic6ZE+ crqEpyLMZdXo+AB2Sws3WxPEmh6MUjCeDHaB9MrQsrzUQ9+lGMpucV81/jWDNYFddn6uR1 woxIHkNms4rvYD0hM3QTHH9Zqc3hgjynzNMbz1iUXcuMugANZoBwKqoH5jaaFZFoXfuB8F HFeGHp0s30rxfWWBpgReRlYv+HD96x/Zqs9tnXjRjhSGxxU6Ujni5s3FlNm4r7Z/QqVKCs cA3gM2nf4PzsO9LACVEXUc9L8n0Abb3hryzs+voWKVDKaj1gYWRAdeCunBzILw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBpQH1ZZFz16Jf; Wed, 8 Feb 2023 18:27:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 318IRpKb037040; Wed, 8 Feb 2023 18:27:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 318IRpbR037039; Wed, 8 Feb 2023 18:27:51 GMT (envelope-from git) Date: Wed, 8 Feb 2023 18:27:51 GMT Message-Id: <202302081827.318IRpbR037039@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: f31403bfdd79 - releng/12.3 - ixgbe: workaround errata about UDP frames with zero checksum 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: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/12.3 X-Git-Reftype: branch X-Git-Commit: f31403bfdd79be98e11a00cccf4b6707e006ba7a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/12.3 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=f31403bfdd79be98e11a00cccf4b6707e006ba7a commit f31403bfdd79be98e11a00cccf4b6707e006ba7a Author: Andrey V. Elsukov AuthorDate: 2022-11-10 09:34:40 +0000 Commit: Gordon Tetlow CommitDate: 2023-02-08 16:32:26 +0000 ixgbe: workaround errata about UDP frames with zero checksum Intel 82599 has errata related to IPv4 UDP frames with zero checksum. It reports such datagrams with L4 integrity errors in IXGBE_XEC register. And after afb1aa4e6df2 commit such errors are reported via IFCOUNTER_IERRORS. This confuses users, since actually all frames are handled correctly by the system. To workaround the problem, let's ignore the XEC register value for 82599 cards for now. PR: 266048 Discussed with: erj Sponsored by: Yandex LLC Approved by: so Security: FreeBSD-EN-23:04.ixgbe (cherry picked from commit 8526120ad41ca47367b43f8f4459e0fa61285571) (cherry picked from commit fe9c4deda9d4aa2c5bed75071f8006bd2a0734a2) --- sys/dev/ixgbe/if_ix.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index 581944fa6a73..ad1b3be871b9 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -1539,8 +1539,12 @@ ixgbe_update_stats_counters(struct ixgbe_softc *sc) * - fragmented packets count, * - oversized packets count, * - jabber count. + * + * Ignore XEC errors for 82599 to workaround errata about + * UDP frames with zero checksum. */ - IXGBE_SET_IERRORS(sc, stats->crcerrs + stats->illerrc + stats->xec + + IXGBE_SET_IERRORS(sc, stats->crcerrs + stats->illerrc + + (hw->mac.type != ixgbe_mac_82599EB ? stats->xec : 0) + stats->mpc[0] + stats->rlec + stats->ruc + stats->rfc + stats->roc + stats->rjc); } /* ixgbe_update_stats_counters */ From nobody Wed Feb 8 18:27:52 2023 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 4PBpQJ50YGz3nlkx; Wed, 8 Feb 2023 18:27:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PBpQJ3txpz3tVQ; Wed, 8 Feb 2023 18:27:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675880872; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xeObQ81r8aJ9nmDU2QigZ0BpwsSNBT4KtLN8PulPOKY=; b=uBdT7sB7gd8TP2aXOcgy5tOnaSt0eU3+WU53h0t2bx3ZktwQoUnJjMmXMfI0SP4jytdZHo j2+j6K+nZt5sH64HelMHOfspPtlnwJgCbk/IjVRMRwhLeD7V73B+PhGh9t87TMsJSHoIbi XUpKJJ2TKNJ7nSQztONQJcwNH/SFPfZ/+eCdoqWQT481ccFjEmz52Wl3khqjaSQ9cZFuWh nDN5kQ7xJ27mko7M+Fx6ANQU14+2L/J9Vn+oSbAebIkZ26CRDx32XhvwPGYb9U57bWxNwB nBWQptEbeIlxL15Ym58dYEXMM9EEzeyuANLKbvog7ADfOXb725qlbXcV8MngJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675880872; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xeObQ81r8aJ9nmDU2QigZ0BpwsSNBT4KtLN8PulPOKY=; b=fH2X6qLPAwPwdgrBKaVOuri2WcmujZmrhwyE/ReovxQzN9nFI/MJWyYuPyTcjXLGKjEf0l yCyZ1QO29y3uZiLYeBP0X0raALolr7XmYs1eBG03nps7JU50ul+BtRRCkkx6bsutAi7KDj VUx197YytiRIkdK1r7JW4XcWI+i6wWZc1BepOUew3ThrqnRzGXVq+06x4OeO4WZN91MdZT 19xmAwrFBWnTcCr9IeK+NdqGMJSmtS+/iK91sZaEmEjs6DvD+oQQ31vC7M1de8prej07wO U3xbhITh4EiIJGqig4iRwmj+aRlzk/N/5DPffbCJ8YwQT5gL79jGtLKztjOG8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675880872; a=rsa-sha256; cv=none; b=cRK45VXwiGjWogPS8AKC6omSB1pWfdtom4GwlYoKMMPAVNd9z8kIi50f76hPYNTJloWCuK /IaQv2a7of0Cnndy1vu2dctTNR4Tasqn8KYlyM3T+UdtTlZiWn3kZdFhmN/7nLuSVnCGYq oEUKGH/ri26LpdC1/19guYdPfTQJgKJQSlZ5b2YI+/1xz3Dntd3F0wHPataMHHhXNGyBq1 T7yw5QUlvGtUdamog7htfWWoKCKHLAWoSATEGmlN+tjcfgr6unTaFqOQTqpTKubXj2u9MA 5f+lmlkz7epbigPC60xlWl7zv+IAmczfmgiAJicCjXIrdXgmUv53O/30esKRmA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBpQJ2J5kz16Ss; Wed, 8 Feb 2023 18:27:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 318IRqbO037071; Wed, 8 Feb 2023 18:27:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 318IRqo3037070; Wed, 8 Feb 2023 18:27:52 GMT (envelope-from git) Date: Wed, 8 Feb 2023 18:27:52 GMT Message-Id: <202302081827.318IRqo3037070@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 5e1ad8bebd36 - releng/12.3 - geli: split the initalization of HMAC 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: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/12.3 X-Git-Reftype: branch X-Git-Commit: 5e1ad8bebd36392eeaa898fe2fc5348bd5e5c863 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/12.3 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=5e1ad8bebd36392eeaa898fe2fc5348bd5e5c863 commit 5e1ad8bebd36392eeaa898fe2fc5348bd5e5c863 Author: Mariusz Zaborski AuthorDate: 2023-02-08 16:41:06 +0000 Commit: Gordon Tetlow CommitDate: 2023-02-08 18:09:41 +0000 geli: split the initalization of HMAC GELI allows to read a user key from a standard input. However if user initialize multiple providers at once, the standard input will be empty for the second and next providers. This caused GELI to encrypt a master key with an empty key file. This commits initialize the HMAC with the key file, and then reuse the finalized structure to generate different encryption keys for different providers. Reported by: Nathan Dorfman Tested by: philip Approved by: so Security: FreeBSD-SA-23:01.geli Security: CVE-2023-0751 (cherry picked from commit 5fff09660e06a66bed6482da9c70df328e16bbb6) (cherry picked from commit a5afaf4e9abd8d5e6cce5d6c433d2276bf9b8721) --- lib/geom/eli/geom_eli.c | 72 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 54 insertions(+), 18 deletions(-) diff --git a/lib/geom/eli/geom_eli.c b/lib/geom/eli/geom_eli.c index a89ac69cf338..147807c46416 100644 --- a/lib/geom/eli/geom_eli.c +++ b/lib/geom/eli/geom_eli.c @@ -565,27 +565,35 @@ eli_genkey_passphrase(struct gctl_req *req, struct g_eli_metadata *md, bool new, return (0); } -static unsigned char * -eli_genkey(struct gctl_req *req, struct g_eli_metadata *md, unsigned char *key, - bool new) +static bool +eli_init_key_hmac_ctx(struct gctl_req *req, struct hmac_ctx *ctx, bool new) { - struct hmac_ctx ctx; - bool nopassphrase; int nfiles; + bool nopassphrase; nopassphrase = gctl_get_int(req, new ? "nonewpassphrase" : "nopassphrase"); - g_eli_crypto_hmac_init(&ctx, NULL, 0); - - nfiles = eli_genkey_files(req, new, "keyfile", &ctx, NULL, 0); - if (nfiles == -1) - return (NULL); - else if (nfiles == 0 && nopassphrase) { + g_eli_crypto_hmac_init(ctx, NULL, 0); + nfiles = eli_genkey_files(req, new, "keyfile", ctx, NULL, 0); + if (nfiles == -1) { + return (false); + } else if (nfiles == 0 && nopassphrase) { gctl_error(req, "No key components given."); - return (NULL); + return (false); } + return (true); +} + +static unsigned char * +eli_genkey(struct gctl_req *req, const struct hmac_ctx *ctxtemplate, + struct g_eli_metadata *md, unsigned char *key, bool new) +{ + struct hmac_ctx ctx; + + memcpy(&ctx, ctxtemplate, sizeof(ctx)); + if (eli_genkey_passphrase(req, md, new, &ctx) == -1) return (NULL); @@ -594,6 +602,22 @@ eli_genkey(struct gctl_req *req, struct g_eli_metadata *md, unsigned char *key, return (key); } +static unsigned char * +eli_genkey_single(struct gctl_req *req, struct g_eli_metadata *md, + unsigned char *key, bool new) +{ + struct hmac_ctx ctx; + unsigned char *rkey; + + if (!eli_init_key_hmac_ctx(req, &ctx, new)) { + return (NULL); + } + rkey = eli_genkey(req, &ctx, md, key, new); + explicit_bzero(&ctx, sizeof(ctx)); + + return (rkey); +} + static int eli_metadata_read(struct gctl_req *req, const char *prov, struct g_eli_metadata *md) @@ -705,6 +729,7 @@ eli_init(struct gctl_req *req) intmax_t val; int error, i, nargs, nparams, param; const int one = 1; + struct hmac_ctx ctxtemplate; nargs = gctl_get_int(req, "nargs"); if (nargs <= 0) { @@ -852,6 +877,10 @@ eli_init(struct gctl_req *req) */ nparams = req->narg - nargs - 1; + /* Generate HMAC context template. */ + if (!eli_init_key_hmac_ctx(req, &ctxtemplate, true)) + return; + /* Create new child request for each provider and issue to kernel */ for (i = 0; i < nargs; i++) { r = gctl_get_handle(); @@ -893,7 +922,7 @@ eli_init(struct gctl_req *req) arc4random_buf(md.md_mkeys, sizeof(md.md_mkeys)); /* Generate user key. */ - if (eli_genkey(r, &md, key, true) == NULL) { + if (eli_genkey(r, &ctxtemplate, &md, key, true) == NULL) { /* * Error generating key - details added to geom request * by eli_genkey(). @@ -1017,6 +1046,7 @@ out: /* Clear the cached metadata, including keys. */ explicit_bzero(&md, sizeof(md)); + explicit_bzero(&ctxtemplate, sizeof(ctxtemplate)); } static void @@ -1028,6 +1058,7 @@ eli_attach(struct gctl_req *req) off_t mediasize; int i, nargs, nparams, param; const int one = 1; + struct hmac_ctx ctxtemplate; nargs = gctl_get_int(req, "nargs"); if (nargs <= 0) { @@ -1043,6 +1074,10 @@ eli_attach(struct gctl_req *req) */ nparams = req->narg - nargs - 1; + /* Generate HMAC context template. */ + if (!eli_init_key_hmac_ctx(req, &ctxtemplate, false)) + return; + /* Create new child request for each provider and issue to kernel */ for (i = 0; i < nargs; i++) { r = gctl_get_handle(); @@ -1072,7 +1107,7 @@ eli_attach(struct gctl_req *req) goto out; } - if (eli_genkey(r, &md, key, false) == NULL) { + if (eli_genkey(r, &ctxtemplate, &md, key, false) == NULL) { /* * Error generating key - details added to geom request * by eli_genkey(). @@ -1106,6 +1141,7 @@ out: /* Clear sensitive data from memory. */ explicit_bzero(cached_passphrase, sizeof(cached_passphrase)); + explicit_bzero(&ctxtemplate, sizeof(ctxtemplate)); } static void @@ -1277,7 +1313,7 @@ eli_setkey_attached(struct gctl_req *req, struct g_eli_metadata *md) old = md->md_iterations; /* Generate key for Master Key encryption. */ - if (eli_genkey(req, md, key, true) == NULL) { + if (eli_genkey_single(req, md, key, true) == NULL) { explicit_bzero(key, sizeof(key)); return; } @@ -1312,7 +1348,7 @@ eli_setkey_detached(struct gctl_req *req, const char *prov, } /* Generate key for Master Key decryption. */ - if (eli_genkey(req, md, key, false) == NULL) { + if (eli_genkey_single(req, md, key, false) == NULL) { explicit_bzero(key, sizeof(key)); return; } @@ -1370,7 +1406,7 @@ eli_setkey_detached(struct gctl_req *req, const char *prov, explicit_bzero(mkey, sizeof(mkey)); /* Generate key for Master Key encryption. */ - if (eli_genkey(req, md, key, true) == NULL) { + if (eli_genkey_single(req, md, key, true) == NULL) { explicit_bzero(key, sizeof(key)); explicit_bzero(md, sizeof(*md)); return; @@ -1516,7 +1552,7 @@ eli_resume(struct gctl_req *req) return; } - if (eli_genkey(req, &md, key, false) == NULL) { + if (eli_genkey_single(req, &md, key, false) == NULL) { explicit_bzero(key, sizeof(key)); return; } From nobody Wed Feb 8 18:27:53 2023 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 4PBpQL0sNBz3nlMl; Wed, 8 Feb 2023 18:27:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PBpQK4yp7z3tVg; Wed, 8 Feb 2023 18:27:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675880873; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W51HGuy4p/0E/c0DINb/vM0nq7hZPNJnsSrJtxtyy3M=; b=ueNQIpxOfwtx2xyZVZC00cOjK2y4JvwcQFro1V7d/hQYOGFvU3jXVRbiU6+jEkvsg8Qi2A GBrAYazGk+/QwXlmPl8wt3EPGU8tPpe9IEKoQWWIsreWi/9tdL9/I+gmyO+Psjzi7K8dQH hDgdZKU6y7Ld0h2J//DNY+EuoMxuIpdTmUGH3att3LG0cKzAxVjnHHqOyMFl1yRQU7e+Q+ 9CSyhYUzGmAi2FpHiojqkLZQE+mEsG0I4tLGm8WQC+aGh3q+S1e0lxsMnHHfsWBSVHfpUL t7UU6voorFUsTYVht9WADgUlsAud2SMTzxKAq2Sx+GiqxgPNSBYiFScNHN/60w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675880873; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W51HGuy4p/0E/c0DINb/vM0nq7hZPNJnsSrJtxtyy3M=; b=TPCKkgZ9aA5LoU/q8iauXgEqKO9s+HBiTYDo3Yef4hV796qTTEJY5hB6mBPLY9ks0s+dEV O/xVXBtgkSJXnQBKLugjrq5eKLO3x7MN+JNUDphrQ8X1wGkrmquaCLYiZ7aePCEj4bDNsH GmQ73USjnfdMprCvQexjcZ7vYWW4iI73Skiwg+fdFtG2hQW9zLmx+/NgI0hUIpQATwLW0Y VjUgm6xU7n+U8uDeD2txDaIUBkhnMigENfCjqqVcD7cpXv7krjjV0ARl6iD1YUQ0T0rKSD zHOvyB1QGNtARg5DHaz/AJk0JNLnpEeBq6+hrSyduFH/w2QBZ/zlEcQAe+0AuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675880873; a=rsa-sha256; cv=none; b=uocXZ6CgiEzBAfIzMSGd1tPOiDig8uVsWSgtADTTdJsxcvupdqWzzoip/R/fj5X/keSaZv YOXVIFFBJBwgWyc9ngwwtNmc5DbUbKGvsuu4YXBPDCHrsya08PsyJoXtn5PfY2ZGtAp4Cm DR6wWjhZx9Piuy7Es63q373aI7xKKOhpK29E51u6A7OQnYsuilK++LftOcIeWAgIey2Dtq nA8Wjm5WxxDdhhnOuoh+g+DGbM7NolnGbsNcisXMfdvqhVlf2zzmLY5qzGa37dHG9ItS+B SiXJ5p8XQIhu7LPx/gtwLjAo0jo5JS5n8kX/CNSgMk3Vj1gE915K/itZHRn8og== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBpQK3HPDz16Jg; Wed, 8 Feb 2023 18:27:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 318IRr5w037099; Wed, 8 Feb 2023 18:27:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 318IRr9d037098; Wed, 8 Feb 2023 18:27:53 GMT (envelope-from git) Date: Wed, 8 Feb 2023 18:27:53 GMT Message-Id: <202302081827.318IRr9d037098@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 138c4a1553a1 - releng/12.3 - Add UPDATING entries and bump version. 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: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/12.3 X-Git-Reftype: branch X-Git-Commit: 138c4a1553a19254dd6b427c0de13337c91ba5b9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/12.3 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=138c4a1553a19254dd6b427c0de13337c91ba5b9 commit 138c4a1553a19254dd6b427c0de13337c91ba5b9 Author: Gordon Tetlow AuthorDate: 2023-02-08 16:58:20 +0000 Commit: Gordon Tetlow CommitDate: 2023-02-08 18:10:08 +0000 Add UPDATING entries and bump version. Approved by: so --- UPDATING | 11 +++++++++++ sys/conf/newvers.sh | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 6fb6ab263579..714de864fb9d 100644 --- a/UPDATING +++ b/UPDATING @@ -17,6 +17,17 @@ from older versions of FreeBSD, try WITHOUT_CLANG and WITH_GCC to bootstrap to the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20230208: + 12.3-RELEASE-p11 FreeBSD-SA-23:01.geli + FreeBSD-EN-23:01.tzdata + FreeBSD-EN-23:04.ixgbe + + Fix GELI silently omits the keyfile if read from stdin [SA-23:01.geli] + + Timezone database information update [EN-23:01.tzdata] + + Fix ixgbe incorrectly reporting input errors for 82599ES [EN-23:04.ixgbe] + 20221129: 12.3-RELEASE-p10 FreeBSD-SA-22:15.ping FreeBSD-EN-22:28.heimdal diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 843288a9d40a..03f7dfad4abf 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -49,7 +49,7 @@ TYPE="FreeBSD" REVISION="12.3" -BRANCH="RELEASE-p10" +BRANCH="RELEASE-p11" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Wed Feb 8 18:29:26 2023 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 4PBpS661Kfz3nlnW; Wed, 8 Feb 2023 18: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 4PBpS64ztYz3w76; Wed, 8 Feb 2023 18: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=1675880966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ou4qY/GY8cx6jfLeFA0m4yUPJ6X0zjGdKvxrK9tb8Ns=; b=uqVzNww917W4bPGkopJrOUOWjjeeuEK9IU1t9CUsIFyG68vD6FjO4HZ+q8LHJ7fuoOFWk4 j4llAuBAesYv6hOZkNcyMkeOC7nEIXosHPYAA74pvm3LeBC8PJ+fjZ8/iTpMEbWJmBmF72 Iqz9ecPAMiN/ruYd9ij8JVTsJQCiBkYEhMgRgtOccjQknwjYukbzdq2toTYz1BMQxZfd6B eW8HqBE/61l3kAcXpRKNcApIegpU5I7JIMrFLtBsTlMHeVWxt9OJQowkP2zC2+T85KVVlc n6sNBCPellZhQ3HdqAx8hdetaPXGb4ucGj39FN4k4JRlo+txImi2iZN6d+sfSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675880966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ou4qY/GY8cx6jfLeFA0m4yUPJ6X0zjGdKvxrK9tb8Ns=; b=KZK/HXfbbWnX0ZwIHo0g/cc3RgDb5yRLUHzTesZrQ4I3eBm+7Ef0QRBJwvgF5GblJazDPl N8uH8iqo+CMC9H9FY2mWFTPQWDllM3W/o96MB5mpAK028ZERb8OdYPaJpNgPganzNr2cKe tXAwCOVJF2O9aJhyH5tRbn57Oz49WrytlJpLQXt4Fr6L+ZBRnhdRYfXrZ5odz9yEWwpZgs ErOxIq3Q6UDOzYdIO1Q2+dVNAEY2l0YVoewrVdRTmJ2+CpFp5Cg0+DATjKT6YBYjfQjmgv vixY/gm5ON+kYW1a4DFShu71OHYm2QlVK6VJdtqVr5U+8DEDEyDtf95T9hJc7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675880966; a=rsa-sha256; cv=none; b=r8iCVWYBomXhi3/LaKDsvURqPhVJC+i3fQhsfbGnejm0CosE9YVuZW3RZIjJ8s5FcIEA+u 3lh/lfvI05HPGPOSDdntU9m5V5HRC3v28QTt+yooG0zcDMSxNogkYEwBnYa0nPk5eJLmDX pHl7duUGjokcP7f/T493vT4eeBSNgMqxvu3Ik47v4q6xdmXjDqiorx5A/K5xA8tNtNPYU7 kUYFiTTCBKjAq8RrHVnFt7WkFiBueJqJctM+BGG598gBIx9StCW6sHik4H8YnIVd2empKL E1sB/V9fq83jhOTvbx5PxlWMQr1a/7L8/3vEv9OBa+G5EtBjHBFm/TTC9sTv8w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBpS643Vhz168Y; Wed, 8 Feb 2023 18:29:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 318ITQkl037441; Wed, 8 Feb 2023 18:29:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 318ITQ5n037440; Wed, 8 Feb 2023 18:29:26 GMT (envelope-from git) Date: Wed, 8 Feb 2023 18:29:26 GMT Message-Id: <202302081829.318ITQ5n037440@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: ab78a51c8d2b - releng/12.4 - contrib/tzdata: import tzdata 2022g 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: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/12.4 X-Git-Reftype: branch X-Git-Commit: ab78a51c8d2b28e94a08287804f941a5973c9940 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/12.4 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=ab78a51c8d2b28e94a08287804f941a5973c9940 commit ab78a51c8d2b28e94a08287804f941a5973c9940 Author: Philip Paeps AuthorDate: 2022-11-30 01:36:28 +0000 Commit: Gordon Tetlow CommitDate: 2023-02-08 16:11:01 +0000 contrib/tzdata: import tzdata 2022g Changes: https://github.com/eggert/tz/blob/2022g/NEWS tzdata 2022g and later split America/Ciudad_Juarez from America/Ojinaga. Ensure this file is removed in builds WITHOUT_ZONEINFO. Approved by: so Security: FreeBSD-EN-23:01.tzdata (cherry picked from commit cf1ad5351036884e0a2e21d1bc9b712448467741) (cherry picked from commit 821549a9dfdf69f533feb84914b09450cd7311b6) (cherry picked from commit e2861c40b1aac3e4592a7d618418914b8f13c1dc) --- contrib/tzdata/Makefile | 55 +++++++---- contrib/tzdata/NEWS | 89 ++++++++++++++++- contrib/tzdata/africa | 4 + contrib/tzdata/asia | 2 +- contrib/tzdata/backward | 1 + contrib/tzdata/backzone | 55 ++++++++++- contrib/tzdata/europe | 28 +++++- contrib/tzdata/northamerica | 161 ++++++++++++++++++------------- contrib/tzdata/southamerica | 9 +- contrib/tzdata/theory.html | 1 - contrib/tzdata/version | 2 +- contrib/tzdata/zone.tab | 26 ++--- contrib/tzdata/zone1970.tab | 26 ++--- tools/build/mk/OptionalObsoleteFiles.inc | 1 + 14 files changed, 335 insertions(+), 125 deletions(-) diff --git a/contrib/tzdata/Makefile b/contrib/tzdata/Makefile index 34cec49d3af4..afb9d538a203 100644 --- a/contrib/tzdata/Makefile +++ b/contrib/tzdata/Makefile @@ -196,6 +196,7 @@ PACKRATLIST= UTF8_LOCALE= en_US.utf8 # Non-default libraries needed to link. +# On some hosts, this should have -lintl unless CFLAGS has -DHAVE_GETTEXT=0. LDLIBS= # Add the following to the end of the "CFLAGS=" line as needed to override @@ -208,14 +209,18 @@ LDLIBS= # For example, N is 252460800 on AmigaOS. # -DHAVE_DECL_ASCTIME_R=0 if does not declare asctime_r # -DHAVE_DECL_ENVIRON if declares 'environ' +# -DHAVE_DECL_TIMEGM=0 if does not declare timegm # -DHAVE_DIRECT_H if mkdir needs (MS-Windows) -# -DHAVE_GENERIC=0 if _Generic does not work -# -DHAVE_GETRANDOM if getgrandom works (e.g., GNU/Linux)* -# -DHAVE_GETTEXT if 'gettext' works (e.g., GNU/Linux, FreeBSD, Solaris)* +# -DHAVE_GENERIC=0 if _Generic does not work* +# -DHAVE_GETRANDOM if getrandom works (e.g., GNU/Linux), +# -DHAVE_GETRANDOM=0 to avoid using getrandom +# -DHAVE_GETTEXT if gettext works (e.g., GNU/Linux, FreeBSD, Solaris), +# where LDLIBS also needs to contain -lintl on some hosts; +# -DHAVE_GETTEXT=0 to avoid using gettext # -DHAVE_INCOMPATIBLE_CTIME_R if your system's time.h declares # ctime_r and asctime_r incompatibly with the POSIX standard # (Solaris when _POSIX_PTHREAD_SEMANTICS is not defined). -# -DHAVE_INTTYPES_H if you have a non-C99 compiler with +# -DHAVE_INTTYPES_H=0 if does not work* # -DHAVE_LINK=0 if your system lacks a link function # -DHAVE_LOCALTIME_R=0 if your system lacks a localtime_r function # -DHAVE_LOCALTIME_RZ=0 if you do not want zdump to use localtime_rz @@ -225,15 +230,17 @@ LDLIBS= # functions like 'link' or variables like 'tzname' required by POSIX # -DHAVE_SETENV=0 if your system lacks the setenv function # -DHAVE_SNPRINTF=0 if your system lacks the snprintf function -# -DHAVE_STDINT_H if you have a non-C99 compiler with * +# -DHAVE_STDCKDINT_H=0 if neither nor substitutes like +# __builtin_add_overflow work* +# -DHAVE_STDINT_H=0 if does not work* # -DHAVE_STRFTIME_L if declares locale_t and strftime_l # -DHAVE_STRDUP=0 if your system lacks the strdup function # -DHAVE_STRTOLL=0 if your system lacks the strtoll function # -DHAVE_SYMLINK=0 if your system lacks the symlink function -# -DHAVE_SYS_STAT_H=0 if your compiler lacks a * +# -DHAVE_SYS_STAT_H=0 if does not work* # -DHAVE_TZSET=0 if your system lacks a tzset function -# -DHAVE_UNISTD_H=0 if your compiler lacks a * -# -DHAVE_UTMPX_H=0 if your compiler lacks a * +# -DHAVE_UNISTD_H=0 if does not work* +# -DHAVE_UTMPX_H=0 if does not work* # -Dlocale_t=XXX if your system uses XXX instead of locale_t # -DRESERVE_STD_EXT_IDS if your platform reserves standard identifiers # with external linkage, e.g., applications cannot define 'localtime'. @@ -280,7 +287,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ -Wdeclaration-after-statement -Wdouble-promotion \ -Wduplicated-branches -Wduplicated-cond \ -Wformat=2 -Wformat-overflow=2 -Wformat-signedness -Wformat-truncation \ - -Winit-self -Wlogical-op \ + -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wnull-dereference \ -Wold-style-definition -Woverlength-strings -Wpointer-arith \ @@ -293,7 +300,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ -Wtrampolines -Wundef -Wuninitialized -Wunused-macros -Wuse-after-free=3 \ -Wvariadic-macros -Wvla -Wwrite-strings \ -Wno-address -Wno-format-nonliteral -Wno-sign-compare \ - -Wno-type-limits -Wno-unused-parameter + -Wno-type-limits # # If your system has a "GMT offset" field in its "struct tm"s # (or if you decide to add such a field in your system's "time.h" file), @@ -340,14 +347,11 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ # If you want functions that were inspired by early versions of X3J11's work, # add # -DSTD_INSPIRED -# to the end of the "CFLAGS=" line. This arranges for the functions -# "offtime", "timelocal", "timegm", "timeoff", -# "posix2time", and "time2posix" to be added to the time conversion library. +# to the end of the "CFLAGS=" line. This arranges for the following +# functions to be added to the time conversion library. # "offtime" is like "gmtime" except that it accepts a second (long) argument # that gives an offset to add to the time_t when converting it. # "timelocal" is equivalent to "mktime". -# "timegm" is like "timelocal" except that it turns a struct tm into -# a time_t using UT (rather than local time as "timelocal" does). # "timeoff" is like "timegm" except that it accepts a second (long) argument # that gives an offset to use when converting to a time_t. # "posix2time" and "time2posix" are described in an included manual page. @@ -495,6 +499,11 @@ TARFLAGS= `if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; \ # Flags to give 'gzip' when making a distribution. GZIPFLAGS= -9n +# When comparing .tzs files, use GNU diff's -F'^TZ=' option if supported. +# This makes it easier to see which Zone has been affected. +DIFF_TZS= diff -u$$(! diff -u -F'^TZ=' - - <>/dev/null >&0 2>&1 \ + || echo ' -F^TZ=') + ############################################################################### #MAKE= make @@ -773,7 +782,8 @@ tzselect: tzselect.ksh version chmod +x $@.out mv $@.out $@ -check: check_character_set check_white_space check_links \ +check: check_back check_mild +check_mild: check_character_set check_white_space check_links \ check_name_lengths check_slashed_abbrs check_sorted \ check_tables check_web check_ziguard check_zishrink check_tzs @@ -824,16 +834,19 @@ check_slashed_abbrs: $(TDATA_TO_CHECK) CHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n; i++) print a[1], a[i]; } check_sorted: backward backzone iso3166.tab zone.tab zone1970.tab - $(AWK) '/^Link/ {printf "%.5d %s\n", g, $$3} /^$$/ {g++}' \ + $(AWK) '/^Link/ {printf "%.5d %s\n", g, $$3} !/./ {g++}' \ backward | LC_ALL=C sort -cu $(AWK) '/^Zone/ {print $$2}' backzone | LC_ALL=C sort -cu touch $@ -check_links: checklinks.awk $(TDATA_TO_CHECK) tzdata.zi +check_back: checklinks.awk $(TDATA_TO_CHECK) $(AWK) \ -v DATAFORM=$(DATAFORM) \ -v backcheck=backward \ -f checklinks.awk $(TDATA_TO_CHECK) + touch $@ + +check_links: checklinks.awk tzdata.zi $(AWK) \ -v DATAFORM=$(DATAFORM) \ -f checklinks.awk tzdata.zi @@ -849,7 +862,7 @@ check_tables: checktab.awk $(YDATA) backward $(ZONETABLES) check_tzs: $(TZS) $(TZS_NEW) if test -s $(TZS); then \ - diff -u $(TZS) $(TZS_NEW); \ + $(DIFF_TZS) $(TZS) $(TZS_NEW); \ else \ cp $(TZS_NEW) $(TZS); \ fi @@ -1050,7 +1063,7 @@ $(TIME_T_ALTERNATIVES): $(VERSION_DEPS) TZS_YEAR="$$range" TZS_CUTOFF_FLAG="-t $$range" \ D=$$wd/$@.dir \ to$$range.tzs) && \ - diff -u $(TIME_T_ALTERNATIVES_HEAD).dir/to$$range.tzs \ + $(DIFF_TZS) $(TIME_T_ALTERNATIVES_HEAD).dir/to$$range.tzs \ $@.dir/to$$range.tzs && \ if diff -q Makefile Makefile 2>/dev/null; then \ quiet_option='-q'; \ @@ -1220,7 +1233,7 @@ zdump.o: version.h zic.o: private.h tzfile.h version.h .PHONY: ALL INSTALL all -.PHONY: check check_time_t_alternatives +.PHONY: check check_mild check_time_t_alternatives .PHONY: check_web check_zishrink .PHONY: clean clean_misc dummy.zd force_tzs .PHONY: install install_data maintainer-clean names diff --git a/contrib/tzdata/NEWS b/contrib/tzdata/NEWS index 086151073a3b..701e490e4834 100644 --- a/contrib/tzdata/NEWS +++ b/contrib/tzdata/NEWS @@ -1,5 +1,91 @@ News for the tz database +Release 2022g - 2022-11-29 08:58:31 -0800 + + Briefly: + The northern edge of Chihuahua changes to US timekeeping. + Much of Greenland stops changing clocks after March 2023. + Fix some pre-1996 timestamps in northern Canada. + C89 is now deprecated; please use C99 or later. + Portability fixes for AIX, libintl, MS-Windows, musl, z/OS + In C code, use more C23 features if available. + C23 timegm now supported by default + Fixes for unlikely integer overflows + + Changes to future timestamps + + In the Mexican state of Chihuahua, the border strip near the US + will change to agree with nearby US locations on 2022-11-30. + The strip's western part, represented by Ciudad Juárez, switches + from -06 all year to -07/-06 with US DST rules, like El Paso, TX. + The eastern part, represented by Ojinaga, will observe US DST next + year, like Presidio, TX. (Thanks to Heitor David Pinto.) + A new Zone America/Ciudad_Juarez splits from America/Ojinaga. + + Much of Greenland, represented by America/Nuuk, stops observing + winter time after March 2023, so its daylight saving time becomes + standard time. (Thanks to Jonas Nyrup and Jürgen Appel.) + + Changes to past timestamps + + Changes for pre-1996 northern Canada (thanks to Chris Walton): + + Merge America/Iqaluit and America/Pangnirtung into the former, + with a backward compatibility link for the latter name. + There is no good evidence the two locations differ since 1970. + This change affects pre-1996 America/Pangnirtung timestamps. + + Cambridge Bay, Inuvik, Iqaluit, Rankin Inlet, Resolute and + Yellowknife did not observe DST in 1965, and did observe DST + from 1972 through 1979. + + Whitehorse moved from -09 to -08 on 1966-02-27, not 1967-05-28. + + Colombia's 1993 fallback was 02-06 24:00, not 04-04 00:00. + (Thanks to Alois Treindl.) + + Singapore's 1981-12-31 change was at 16:00 UTC (23:30 local time), + not 24:00 local time. (Thanks to Geoff Clare via Robert Elz.) + + Changes to code + + Although tzcode still works with C89, bugs found in recent routine + maintenance indicate that bitrot has set in and that in practice + C89 is no longer used to build tzcode. As it is a maintenance + burden, support for C89 is planned to be removed soon. Instead, + please use compilers compatible with C99, C11, C17, or C23. + + timegm, which tzcode implemented in 1989, will finally be + standardized 34 years later as part of C23, so timegm is now + supported even if STD_INSPIRED is not defined. + + Fix bug in zdump's tzalloc emulation on hosts that lack tm_zone. + (Problem reported by Đoàn Trần Công Danh.) + + Fix bug in zic on hosts where malloc(0) yields NULL on success. + (Problem reported by Tim McBrayer for AIX 6.1.) + + Fix zic configuration to avoid linkage failures on some platforms. + (Problems reported by Gilmore Davidson and Igor Ivanov.) + + Work around MS-Windows nmake incompatibility with POSIX. + (Problem reported by Manuela Friedrich.) + + Port mktime and strftime to debugging platforms where accessing + uninitialized data has undefined behavior (strftime problem + reported by Robert Elz). + + Check more carefully for unlikely integer overflows, preferring + C23 to overflow checking by hand, as the latter has + had obscure bugs. + + Changes to build procedure + + New Makefile rule check_mild that skips checking whether Link + lines are in the file 'backward'. (Inspired by a suggestion from + Stephen Colebourne.) + + Release 2022f - 2022-10-28 18:04:57 -0700 Briefly: @@ -16,7 +102,7 @@ Release 2022f - 2022-10-28 18:04:57 -0700 In C code, use some C23 features if available. Remove no-longer-needed workaround for Qt bug 53071. - Changes to future timestamps. + Changes to future timestamps Mexico will no longer observe DST after 2022, except for areas near the US border that continue to observe US DST rules. @@ -24,6 +110,7 @@ Release 2022f - 2022-10-28 18:04:57 -0700 from -07 (-06 with DST) to year-round -06, thus not changing its clocks that day. The new law states that Chihuahua near the US border no longer observes US DST. + (Thanks to gera for the heads-up about Chihuahua.) Fiji will not observe DST in 2022/3. (Thanks to Shalvin Narayan.) For now, assume DST is suspended indefinitely. diff --git a/contrib/tzdata/africa b/contrib/tzdata/africa index 92a61259f916..cfb9283c045d 100644 --- a/contrib/tzdata/africa +++ b/contrib/tzdata/africa @@ -588,6 +588,10 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis # Agalega Is, Rodriguez # no information; probably like Indian/Mauritius + +# Morocco +# See Africa/Ceuta for Spanish Morocco. + # From Alex Krivenyshev (2008-05-09): # Here is an article that Morocco plan to introduce Daylight Saving Time between # 1 June, 2008 and 27 September, 2008. diff --git a/contrib/tzdata/asia b/contrib/tzdata/asia index 6e8ad282ee61..199e6ad6adc3 100644 --- a/contrib/tzdata/asia +++ b/contrib/tzdata/asia @@ -3585,7 +3585,7 @@ Zone Asia/Singapore 6:55:25 - LMT 1901 Jan 1 7:20 - +0720 1941 Sep 1 7:30 - +0730 1942 Feb 16 9:00 - +09 1945 Sep 12 - 7:30 - +0730 1982 Jan 1 + 7:30 - +0730 1981 Dec 31 16:00u 8:00 - +08 # Spratly Is diff --git a/contrib/tzdata/backward b/contrib/tzdata/backward index 4c1c5d5f8f71..0ae5d74108e6 100644 --- a/contrib/tzdata/backward +++ b/contrib/tzdata/backward @@ -267,6 +267,7 @@ Link America/Tijuana America/Ensenada Link America/Indiana/Indianapolis America/Fort_Wayne Link America/Toronto America/Montreal Link America/Toronto America/Nipigon +Link America/Iqaluit America/Pangnirtung Link America/Rio_Branco America/Porto_Acre Link America/Winnipeg America/Rainy_River Link America/Argentina/Cordoba America/Rosario diff --git a/contrib/tzdata/backzone b/contrib/tzdata/backzone index b4ebd2e478c3..7803c57d095d 100644 --- a/contrib/tzdata/backzone +++ b/contrib/tzdata/backzone @@ -7,6 +7,10 @@ # tz@iana.org for general use in the future). For more, please see # the file CONTRIBUTING in the tz distribution. +# When proposing changes to this file, please use 'git format-patch' +# format, either by attaching the resulting .patch file to your email, +# or by using 'git send-email'. This will help maintainers save time. + # From Paul Eggert (2014-10-31): @@ -750,6 +754,55 @@ Zone America/Nipigon -5:53:04 - LMT 1895 -5:00 1:00 EDT 1942 Feb 9 2:00s -5:00 Canada E%sT +# From Rives McDow (1999-11-08): +# On October 31, when the rest of Nunavut went to Central time, +# Pangnirtung wobbled. Here is the result of their wobble: +# +# The following businesses and organizations in Pangnirtung use Central Time: +# +# First Air, Power Corp, Nunavut Construction, Health Center, RCMP, +# Eastern Arctic National Parks, A & D Specialist +# +# The following businesses and organizations in Pangnirtung use Eastern Time: +# +# Hamlet office, All other businesses, Both schools, Airport operator +# +# This has made for an interesting situation there, which warranted the news. +# No one there that I spoke with seems concerned, or has plans to +# change the local methods of keeping time, as it evidently does not +# really interfere with any activities or make things difficult locally. +# They plan to celebrate New Year's turn-over twice, one hour apart, +# so it appears that the situation will last at least that long. +# The Nunavut Intergovernmental Affairs hopes that they will "come to +# their senses", but the locals evidently don't see any problem with +# the current state of affairs. + +# From Michaela Rodrigue, writing in the +# Nunatsiaq News (1999-11-19): +# http://www.nunatsiaqonline.ca/archives/nunavut991130/nvt91119_17.html +# Clyde River, Pangnirtung and Sanikiluaq now operate with two time zones, +# central - or Nunavut time - for government offices, and eastern time +# for municipal offices and schools.... Igloolik [was similar but then] +# made the switch to central time on Saturday, Nov. 6. + +# From Chris Walton (2022-11-06): +# The implication is that Pangnirtung and Qikiqtarjuaq have observed Eastern +# Time as far back as 1984 (and likely even further back than that). +# It is possible that these communities never actually observed Atlantic +# Time, but that would be difficult to prove. +# From Paul Eggert (2022-11-06): +# This is in 'backzone' as we have no good evidence that Pangnirtung differs +# from America/Iqaluit since 1970. A Google Books snippet view of +# volume 2, page 186 of "Pilot of Arctic Canada", published 1959 by +# the Canadian Hydrographic Service, suggests (though does not state) +# that Pangnirtung observed EST then. +# +# aka Panniqtuuq +Zone America/Pangnirtung 0 - -00 1921 # trading post est. + -5:00 NT_YK E%sT 1999 Oct 31 2:00 + -6:00 Canada C%sT 2000 Oct 29 2:00 + -5:00 Canada E%sT + # United States # # From Paul Eggert (2018-03-18): @@ -1043,7 +1096,7 @@ Zone Asia/Kuala_Lumpur 6:46:46 - LMT 1901 Jan 1 7:20 - +0720 1941 Sep 1 7:30 - +0730 1942 Feb 16 9:00 - +09 1945 Sep 12 - 7:30 - +0730 1982 Jan 1 + 7:30 - +0730 1981 Dec 31 16:00u 8:00 - +08 # Kuwait diff --git a/contrib/tzdata/europe b/contrib/tzdata/europe index 6ac41e7272a2..a3547b4f81a4 100644 --- a/contrib/tzdata/europe +++ b/contrib/tzdata/europe @@ -1103,7 +1103,30 @@ Zone Atlantic/Faroe -0:27:04 - LMT 1908 Jan 11 # Tórshavn # "National Park" by Executive Order: # http://naalakkersuisut.gl/~/media/Nanoq/Files/Attached%20Files/Engelske-tekster/Legislation/Executive%20Order%20National%20Park.rtf # It is their only National Park. -# + +# From Jonas Nyrup (2022-11-24): +# On last Saturday in October 2023 when DST ends America/Nuuk will switch +# from -03/-02 to -02/-01 +# https://sermitsiaq.ag/forslagtidsforskel-danmark-mindskes-sommertid-beholdes +# ... +# https://sermitsiaq.ag/groenland-skifte-tidszone-trods-bekymringer +# +# From Jürgen Appel (2022-11-25): +# https://ina.gl/samlinger/oversigt-over-samlinger/samling/dagsordener/dagsorden.aspx?lang=da&day=24-11-2022 +# If I understand this correctly, from the next planned switch to +# summer time, Greenland will permanently stay at that time, i.e. no +# switch back to winter time in 2023 will occur. +# +# From Paul Eggert (2022-11-28): +# The official document in Danish +# https://naalakkersuisut.gl/-/media/naalakkersuisut/filer/kundgoerelser/2022/11/2511/31_da_inatsisartutlov-om-tidens-bestemmelse.pdf?la=da&hash=A33597D8A38CC7038465241119EF34F3 +# says standard time for Greenland is -02, that Naalakkersuisut can lay down +# rules for DST and can require some areas to use a different time zone, +# and that this all takes effect 2023-03-25 22:00. The abovementioned +# "bekymringer" URL says the intent is no transition March 25, that +# Greenland will not go back to winter time in fall 2023, and that +# only America/Nuuk is affected (though further changes may occur). + # Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Thule 1991 1992 - Mar lastSun 2:00 1:00 D Rule Thule 1991 1992 - Sep lastSun 2:00 0 S @@ -1126,7 +1149,8 @@ Zone America/Scoresbysund -1:27:52 - LMT 1916 Jul 28 # Ittoqqortoormiit -1:00 EU -01/+00 Zone America/Nuuk -3:26:56 - LMT 1916 Jul 28 # Godthåb -3:00 - -03 1980 Apr 6 2:00 - -3:00 EU -03/-02 + -3:00 EU -03/-02 2023 Mar 25 22:00 + -2:00 - -02 Zone America/Thule -4:35:08 - LMT 1916 Jul 28 # Pituffik -4:00 Thule A%sT diff --git a/contrib/tzdata/northamerica b/contrib/tzdata/northamerica index df1954359cce..d50581d00774 100644 --- a/contrib/tzdata/northamerica +++ b/contrib/tzdata/northamerica @@ -1969,6 +1969,37 @@ Zone America/Fort_Nelson -8:10:47 - LMT 1884 # Northwest Territories, Nunavut, Yukon +# From Chris Walton (2022-11-06): +# Whitehorse Star - Thursday April 22, 1965 - page 1 +# title: DST Starts Monday ... +# https://www.newspapers.com/image/578587481/ +# The title of this first article is wrong and/or misleading. +# Also, the start time shown in the article is vague; it simply says "after +# midnight" when it probably should have stated 2:00a.m.... +# +# Whitehorse Star - Monday October 25, 1965 - page 15 ... +# https://www.newspapers.com/image/578589147/ +# The 1965 Yukon Council minutes can be found here: +# http://assets.yukonarchives.ca/PER_YG_06_1965_C20_S02_v1.pdf +# ... I do not currently believe that NWT touched any of its clocks in 1965.... +# +# Whitehorse Star - Thursday Feb 24,1966 - page 2 +# title: It's Time for YDT ... +# https://www.newspapers.com/image/578575979/ ... +# America/Whitehorse as a permanent change from UTC-9(YST) to +# UTC-8(PST) at 00:00 on Sunday February 27, 1966.... +# +# Whitehorse Star - Friday April 28,1972 - page 6 +# title: Daylight Saving Time for N.W.T.... +# https://www.newspapers.com/image/578701610/ ... +# Nunavut and NWT zones ... DST starting in 1972.... Start and End ... +# should be the same as the rest of Canada +# +# +# From Paul Eggert (2022-11-06): +# For now, assume Yukon's 1965-04-22 spring forward was 00:00 -> 02:00, as this +# seems likely than 02:00 -> 04:00 and matches "after midnight". + # From Paul Eggert (2006-03-22): # Dawson switched to PST in 1973. Inuvik switched to MST in 1979. # Mathew Englander (1996-10-07) gives the following refs: @@ -2083,6 +2114,13 @@ Zone America/Fort_Nelson -8:10:47 - LMT 1884 # * Interpretation Act, RSY 2002, c 125 # https://www.canlii.org/en/yk/laws/stat/rsy-2002-c-125/latest/rsy-2002-c-125.html +# From Chris Walton (2022-11-06): +# The 5th edition of the Atlas of Canada contains a time zone map that +# shows both legislated and observed time zone boundaries. +# All communities on Baffin Island are shown to be observing Eastern time. +# The date on the map is 1984. +# https://ftp.maps.canada.ca/pub/nrcan_rncan/raster/atlas_5_ed/eng/other/referencemaps/mcr4056.pdf + # From Rives McDow (1999-09-04): # Nunavut ... moved ... to incorporate the whole territory into one time zone. # Nunavut moves to single time zone Oct. 31 @@ -2095,40 +2133,7 @@ Zone America/Fort_Nelson -8:10:47 - LMT 1884 # From Paul Eggert (1999-09-20): # Basic Facts: The New Territory # http://www.nunavut.com/basicfacts/english/basicfacts_1territory.html -# (1999) reports that Pangnirtung operates on eastern time, -# and that Coral Harbour does not observe DST. We don't know when -# Pangnirtung switched to eastern time; we'll guess 1995. - -# From Rives McDow (1999-11-08): -# On October 31, when the rest of Nunavut went to Central time, -# Pangnirtung wobbled. Here is the result of their wobble: -# -# The following businesses and organizations in Pangnirtung use Central Time: -# -# First Air, Power Corp, Nunavut Construction, Health Center, RCMP, -# Eastern Arctic National Parks, A & D Specialist -# -# The following businesses and organizations in Pangnirtung use Eastern Time: -# -# Hamlet office, All other businesses, Both schools, Airport operator -# -# This has made for an interesting situation there, which warranted the news. -# No one there that I spoke with seems concerned, or has plans to -# change the local methods of keeping time, as it evidently does not -# really interfere with any activities or make things difficult locally. -# They plan to celebrate New Year's turn-over twice, one hour apart, -# so it appears that the situation will last at least that long. -# The Nunavut Intergovernmental Affairs hopes that they will "come to -# their senses", but the locals evidently don't see any problem with -# the current state of affairs. - -# From Michaela Rodrigue, writing in the -# Nunatsiaq News (1999-11-19): -# http://www.nunatsiaqonline.ca/archives/nunavut991130/nvt91119_17.html -# Clyde River, Pangnirtung and Sanikiluaq now operate with two time zones, -# central - or Nunavut time - for government offices, and eastern time -# for municipal offices and schools.... Igloolik [was similar but then] -# made the switch to central time on Saturday, Nov. 6. +# (1999) reports that ... Coral Harbour does not observe DST. # From Paul Eggert (2000-10-02): # Matthews and Vincent (1998) say the following, but we lack histories @@ -2287,18 +2292,12 @@ Rule NT_YK 1919 only - Nov 1 0:00 0 S Rule NT_YK 1942 only - Feb 9 2:00 1:00 W # War Rule NT_YK 1945 only - Aug 14 23:00u 1:00 P # Peace Rule NT_YK 1945 only - Sep 30 2:00 0 S -Rule NT_YK 1965 only - Apr lastSun 0:00 2:00 DD -Rule NT_YK 1965 only - Oct lastSun 2:00 0 S -Rule NT_YK 1980 1986 - Apr lastSun 2:00 1:00 D -Rule NT_YK 1980 2006 - Oct lastSun 2:00 0 S +Rule NT_YK 1972 1986 - Apr lastSun 2:00 1:00 D +Rule NT_YK 1972 2006 - Oct lastSun 2:00 0 S Rule NT_YK 1987 2006 - Apr Sun>=1 2:00 1:00 D +Rule Yukon 1965 only - Apr lastSun 0:00 2:00 DD +Rule Yukon 1965 only - Oct lastSun 2:00 0 S # Zone NAME STDOFF RULES FORMAT [UNTIL] -# aka Panniqtuuq -Zone America/Pangnirtung 0 - -00 1921 # trading post est. - -4:00 NT_YK A%sT 1995 Apr Sun>=1 2:00 - -5:00 Canada E%sT 1999 Oct 31 2:00 - -6:00 Canada C%sT 2000 Oct 29 2:00 - -5:00 Canada E%sT # formerly Frobisher Bay Zone America/Iqaluit 0 - -00 1942 Aug # Frobisher Bay est. -5:00 NT_YK E%sT 1999 Oct 31 2:00 @@ -2331,13 +2330,15 @@ Zone America/Inuvik 0 - -00 1953 # Inuvik founded -7:00 NT_YK M%sT 1980 -7:00 Canada M%sT Zone America/Whitehorse -9:00:12 - LMT 1900 Aug 20 - -9:00 NT_YK Y%sT 1967 May 28 0:00 - -8:00 NT_YK P%sT 1980 + -9:00 NT_YK Y%sT 1965 + -9:00 Yukon Y%sT 1966 Feb 27 0:00 + -8:00 - PST 1980 -8:00 Canada P%sT 2020 Nov 1 -7:00 - MST Zone America/Dawson -9:17:40 - LMT 1900 Aug 20 - -9:00 NT_YK Y%sT 1973 Oct 28 0:00 - -8:00 NT_YK P%sT 1980 + -9:00 NT_YK Y%sT 1965 + -9:00 Yukon Y%sT 1973 Oct 28 0:00 + -8:00 - PST 1980 -8:00 Canada P%sT 2020 Nov 1 -7:00 - MST @@ -2559,6 +2560,14 @@ Zone America/Dawson -9:17:40 - LMT 1900 Aug 20 # This abolishes DST except where US DST rules are observed, # and in addition changes all of Chihuahua to -06 with no DST. +# From Heitor David Pinto (2022-11-28): +# Now the northern municipalities want to have the same time zone as the +# respective neighboring cities in the US, for example Juárez in UTC-7 with +# DST, matching El Paso, and Ojinaga in UTC-6 with DST, matching Presidio.... +# the president authorized the publication of the decree for November 29, +# so the time change would occur on November 30 at 0:00. +# http://puentelibre.mx/noticia/ciudad_juarez_cambio_horario_noviembre_2022/ + # Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Mexico 1931 only - May 1 23:00 1:00 D Rule Mexico 1931 only - Oct 1 0:00 0 S @@ -2590,14 +2599,12 @@ Zone America/Merida -5:58:28 - LMT 1922 Jan 1 6:00u -6:00 Mexico C%sT # Coahuila, Nuevo León, Tamaulipas (near US border) # This includes the following municipalities: -# in Coahuila: Ocampo, Acuña, Zaragoza, Jiménez, Piedras Negras, Nava, -# Guerrero, Hidalgo. -# in Nuevo León: Anáhuac, Los Aldama. +# in Coahuila: Acuña, Allende, Guerrero, Hidalgo, Jiménez, Morelos, Nava, +# Ocampo, Piedras Negras, Villa Unión, Zaragoza +# in Nuevo León: Anáhuac # in Tamaulipas: Nuevo Laredo, Guerrero, Mier, Miguel Alemán, Camargo, # Gustavo Díaz Ordaz, Reynosa, Río Bravo, Valle Hermoso, Matamoros. -# See: Inicia mañana Horario de Verano en zona fronteriza, El Universal, -# 2016-03-12 -# http://www.eluniversal.com.mx/articulo/estados/2016/03/12/inicia-manana-horario-de-verano-en-zona-fronteriza +# https://www.dof.gob.mx/nota_detalle.php?codigo=5670045&fecha=28/10/2022 Zone America/Matamoros -6:30:00 - LMT 1922 Jan 1 6:00u -6:00 - CST 1988 -6:00 US C%sT 1989 @@ -2616,10 +2623,24 @@ Zone America/Mexico_City -6:36:36 - LMT 1922 Jan 1 7:00u -6:00 Mexico C%sT 2001 Sep 30 2:00 -6:00 - CST 2002 Feb 20 -6:00 Mexico C%sT -# Chihuahua (near US border) +# Chihuahua (near US border - western side) # This includes the municipalities of Janos, Ascensión, Juárez, Guadalupe, -# Práxedis G Guerrero, Coyame del Sotol, Ojinaga, and Manuel Benavides. -# (See the 2016-03-12 El Universal source mentioned above.) +# and Práxedis G Guerrero. +# http://gaceta.diputados.gob.mx/PDF/65/2a022/nov/20221124-VII.pdf +Zone America/Ciudad_Juarez -7:05:56 - LMT 1922 Jan 1 7:00u + -7:00 - MST 1927 Jun 10 23:00 + -6:00 - CST 1930 Nov 15 + -7:00 Mexico M%sT 1932 Apr 1 + -6:00 - CST 1996 + -6:00 Mexico C%sT 1998 + -6:00 - CST 1998 Apr Sun>=1 3:00 + -7:00 Mexico M%sT 2010 + -7:00 US M%sT 2022 Oct 30 2:00 + -6:00 - CST 2022 Nov 30 0:00 + -7:00 US M%sT +# Chihuahua (near US border - eastern side) +# The municipalities of Coyame del Sotol, Ojinaga, and Manuel Benavides. +# http://gaceta.diputados.gob.mx/PDF/65/2a022/nov/20221124-VII.pdf Zone America/Ojinaga -6:57:40 - LMT 1922 Jan 1 7:00u -7:00 - MST 1927 Jun 10 23:00 -6:00 - CST 1930 Nov 15 @@ -2629,7 +2650,8 @@ Zone America/Ojinaga -6:57:40 - LMT 1922 Jan 1 7:00u -6:00 - CST 1998 Apr Sun>=1 3:00 -7:00 Mexico M%sT 2010 -7:00 US M%sT 2022 Oct 30 2:00 - -6:00 - CST + -6:00 - CST 2022 Nov 30 0:00 + -6:00 US C%sT # Chihuahua (away from US border) Zone America/Chihuahua -7:04:20 - LMT 1922 Jan 1 7:00u -7:00 - MST 1927 Jun 10 23:00 @@ -2651,6 +2673,18 @@ Zone America/Hermosillo -7:23:52 - LMT 1922 Jan 1 7:00u -7:00 Mexico M%sT 1999 -7:00 - MST +# Baja California Sur, Nayarit (except Bahía de Banderas), Sinaloa +Zone America/Mazatlan -7:05:40 - LMT 1922 Jan 1 7:00u + -7:00 - MST 1927 Jun 10 23:00 + -6:00 - CST 1930 Nov 15 + -7:00 Mexico M%sT 1932 Apr 1 + -6:00 - CST 1942 Apr 24 + -7:00 - MST 1949 Jan 14 + -8:00 - PST 1970 + -7:00 Mexico M%sT + +# Bahía de Banderas + # From Alexander Krivenyshev (2010-04-21): # According to news, Bahía de Banderas (Mexican state of Nayarit) # changed time zone UTC-7 to new time zone UTC-6 on April 4, 2010 (to @@ -2678,17 +2712,6 @@ Zone America/Hermosillo -7:23:52 - LMT 1922 Jan 1 7:00u # From Arthur David Olson (2010-05-01): # Use "Bahia_Banderas" to keep the name to fourteen characters. -# Mazatlán -Zone America/Mazatlan -7:05:40 - LMT 1922 Jan 1 7:00u - -7:00 - MST 1927 Jun 10 23:00 - -6:00 - CST 1930 Nov 15 - -7:00 Mexico M%sT 1932 Apr 1 - -6:00 - CST 1942 Apr 24 - -7:00 - MST 1949 Jan 14 - -8:00 - PST 1970 - -7:00 Mexico M%sT - -# Bahía de Banderas Zone America/Bahia_Banderas -7:01:00 - LMT 1922 Jan 1 7:00u -7:00 - MST 1927 Jun 10 23:00 -6:00 - CST 1930 Nov 15 diff --git a/contrib/tzdata/southamerica b/contrib/tzdata/southamerica index 13cc65efa32b..87b71d5f9210 100644 --- a/contrib/tzdata/southamerica +++ b/contrib/tzdata/southamerica @@ -1418,9 +1418,14 @@ Zone Antarctica/Palmer 0 - -00 1965 # Milne gives 4:56:16.4 for Bogotá time in 1899. He writes, # "A variation of fifteen minutes in the public clocks of Bogota is not rare." +# From Alois Treindl (2022-11-10): +# End of time change in Colombia 1993 ... should be 6 February 24h ... +# DECRETO 267 DE 1993 +# https://www.suin-juriscol.gov.co/viewDocument.asp?ruta=Decretos/1061335 + # Rule NAME FROM TO - IN ON AT SAVE LETTER/S -Rule CO 1992 only - May 3 0:00 1:00 - -Rule CO 1993 only - Apr 4 0:00 0 - +Rule CO 1992 only - May 3 0:00 1:00 - +Rule CO 1993 only - Feb 6 24:00 0 - # Zone NAME STDOFF RULES FORMAT [UNTIL] #STDOFF -4:56:16.4 Zone America/Bogota -4:56:16 - LMT 1884 Mar 13 diff --git a/contrib/tzdata/theory.html b/contrib/tzdata/theory.html index 298db866b39c..75e347f0f9d1 100644 --- a/contrib/tzdata/theory.html +++ b/contrib/tzdata/theory.html @@ -60,7 +60,6 @@ with current and future timestamps in the traditional North American mountain time zone can choose from the timezones America/Denver which observes US-style daylight saving time (DST), -America/Mazatlan which observes Mexican-style DST, and America/Phoenix which does not observe DST. Applications that also deal with past timestamps in the mountain time zone can choose from over a dozen timezones, such as diff --git a/contrib/tzdata/version b/contrib/tzdata/version index 5c8fbb478a2c..b74fa117a223 100644 --- a/contrib/tzdata/version +++ b/contrib/tzdata/version @@ -1 +1 @@ -2022f +2022g diff --git a/contrib/tzdata/zone.tab b/contrib/tzdata/zone.tab index 2636e21a9fca..6e5adb9fcca6 100644 --- a/contrib/tzdata/zone.tab +++ b/contrib/tzdata/zone.tab @@ -114,8 +114,7 @@ CA +4606-06447 America/Moncton Atlantic - New Brunswick CA +5320-06025 America/Goose_Bay Atlantic - Labrador (most areas) CA +5125-05707 America/Blanc-Sablon AST - QC (Lower North Shore) CA +4339-07923 America/Toronto Eastern - ON, QC (most areas) -CA +6344-06828 America/Iqaluit Eastern - NU (most east areas) -CA +6608-06544 America/Pangnirtung Eastern - NU (Pangnirtung) +CA +6344-06828 America/Iqaluit Eastern - NU (most areas) CA +484531-0913718 America/Atikokan EST - ON (Atikokan); NU (Coral H) CA +4953-09709 America/Winnipeg Central - ON (west); Manitoba CA +744144-0944945 America/Resolute Central - NU (Resolute) @@ -277,17 +276,18 @@ MT +3554+01431 Europe/Malta MU -2010+05730 Indian/Mauritius MV +0410+07330 Indian/Maldives MW -1547+03500 Africa/Blantyre -MX +1924-09909 America/Mexico_City Central Time -MX +2105-08646 America/Cancun Eastern Standard Time - Quintana Roo -MX +2058-08937 America/Merida Central Time - Campeche, Yucatan -MX +2540-10019 America/Monterrey Central Time - Durango; Coahuila, Nuevo Leon, Tamaulipas (most areas) -MX +2550-09730 America/Matamoros Central Time US - Coahuila, Nuevo Leon, Tamaulipas (US border) -MX +2313-10625 America/Mazatlan Mountain Time - Baja California Sur, Nayarit, Sinaloa -MX +2838-10605 America/Chihuahua Mountain Time - Chihuahua (most areas) -MX +2934-10425 America/Ojinaga Mountain Time US - Chihuahua (US border) -MX +2904-11058 America/Hermosillo Mountain Standard Time - Sonora -MX +3232-11701 America/Tijuana Pacific Time US - Baja California -MX +2048-10515 America/Bahia_Banderas Central Time - Bahia de Banderas +MX +1924-09909 America/Mexico_City Central Mexico +MX +2105-08646 America/Cancun Quintana Roo +MX +2058-08937 America/Merida Campeche, Yucatan +MX +2540-10019 America/Monterrey Durango; Coahuila, Nuevo Leon, Tamaulipas (most areas) +MX +2550-09730 America/Matamoros Coahuila, Nuevo Leon, Tamaulipas (US border) +MX +2838-10605 America/Chihuahua Chihuahua (most areas) +MX +3144-10629 America/Ciudad_Juarez Chihuahua (US border - west) +MX +2934-10425 America/Ojinaga Chihuahua (US border - east) +MX +2313-10625 America/Mazatlan Baja California Sur, Nayarit (most areas), Sinaloa +MX +2048-10515 America/Bahia_Banderas Bahia de Banderas +MX +2904-11058 America/Hermosillo Sonora +MX +3232-11701 America/Tijuana Baja California MY +0310+10142 Asia/Kuala_Lumpur Malaysia (peninsula) MY +0133+11020 Asia/Kuching Sabah, Sarawak MZ -2558+03235 Africa/Maputo diff --git a/contrib/tzdata/zone1970.tab b/contrib/tzdata/zone1970.tab index d48c9c5d9493..10dae7e7db17 100644 --- a/contrib/tzdata/zone1970.tab +++ b/contrib/tzdata/zone1970.tab @@ -103,8 +103,7 @@ CA +4612-05957 America/Glace_Bay Atlantic - NS (Cape Breton) CA +4606-06447 America/Moncton Atlantic - New Brunswick CA +5320-06025 America/Goose_Bay Atlantic - Labrador (most areas) CA,BS +4339-07923 America/Toronto Eastern - ON, QC (most areas), Bahamas -CA +6344-06828 America/Iqaluit Eastern - NU (most east areas) -CA +6608-06544 America/Pangnirtung Eastern - NU (Pangnirtung) +CA +6344-06828 America/Iqaluit Eastern - NU (most areas) CA +4953-09709 America/Winnipeg Central - ON (west); Manitoba CA +744144-0944945 America/Resolute Central - NU (Resolute) CA +624900-0920459 America/Rankin_Inlet Central - NU (central) @@ -215,17 +214,18 @@ MQ +1436-06105 America/Martinique MT +3554+01431 Europe/Malta MU -2010+05730 Indian/Mauritius MV,TF +0410+07330 Indian/Maldives Maldives, Kerguelen, St Paul I, Amsterdam I -MX +1924-09909 America/Mexico_City Central Time -MX +2105-08646 America/Cancun Eastern Standard Time - Quintana Roo -MX +2058-08937 America/Merida Central Time - Campeche, Yucatán -MX +2540-10019 America/Monterrey Central Time - Durango; Coahuila, Nuevo León, Tamaulipas (most areas) -MX +2550-09730 America/Matamoros Central Time US - Coahuila, Nuevo León, Tamaulipas (US border) -MX +2313-10625 America/Mazatlan Mountain Time - Baja California Sur, Nayarit, Sinaloa -MX +2838-10605 America/Chihuahua Mountain Time - Chihuahua (most areas) -MX +2934-10425 America/Ojinaga Mountain Time US - Chihuahua (US border) -MX +2904-11058 America/Hermosillo Mountain Standard Time - Sonora -MX +3232-11701 America/Tijuana Pacific Time US - Baja California -MX +2048-10515 America/Bahia_Banderas Central Time - Bahía de Banderas +MX +1924-09909 America/Mexico_City Central Mexico +MX +2105-08646 America/Cancun Quintana Roo +MX +2058-08937 America/Merida Campeche, Yucatán +MX +2540-10019 America/Monterrey Durango; Coahuila, Nuevo León, Tamaulipas (most areas) +MX +2550-09730 America/Matamoros Coahuila, Nuevo León, Tamaulipas (US border) +MX +2838-10605 America/Chihuahua Chihuahua (most areas) +MX +3144-10629 America/Ciudad_Juarez Chihuahua (US border - west) +MX +2934-10425 America/Ojinaga Chihuahua (US border - east) +MX +2313-10625 America/Mazatlan Baja California Sur, Nayarit (most areas), Sinaloa +MX +2048-10515 America/Bahia_Banderas Bahía de Banderas +MX +2904-11058 America/Hermosillo Sonora +MX +3232-11701 America/Tijuana Baja California MY,BN +0133+11020 Asia/Kuching Sabah, Sarawak, Brunei MZ,BI,BW,CD,MW,RW,ZM,ZW -2558+03235 Africa/Maputo Central Africa Time NA -2234+01706 Africa/Windhoek diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index eeb313d99a11..b4dee0e1e98b 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -10457,6 +10457,7 @@ OLD_FILES+=usr/share/zoneinfo/America/Cayenne OLD_FILES+=usr/share/zoneinfo/America/Cayman OLD_FILES+=usr/share/zoneinfo/America/Chicago OLD_FILES+=usr/share/zoneinfo/America/Chihuahua +OLD_FILES+=usr/share/zoneinfo/America/Ciudad_Juarez OLD_FILES+=usr/share/zoneinfo/America/Costa_Rica OLD_FILES+=usr/share/zoneinfo/America/Creston OLD_FILES+=usr/share/zoneinfo/America/Cuiaba From nobody Wed Feb 8 18:29:27 2023 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 4PBpS80DYNz3nlnc; Wed, 8 Feb 2023 18:29: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 4PBpS761cqz3w3K; Wed, 8 Feb 2023 18:29:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675880967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yUp+aKpqDJxfoDY+8AJk/2ZvL1OvTcBtO6dxaDVIacc=; b=cpGLsHD60Sic8J1Ybmfji1XN8ZFfdtGprZuyfVU+03jJkUudSjJUjXMKniwjlfxhU1CH8d PZb9O5zKaW3ugeJS+Z+1+OLCWBuBhCB3BglBpqNflpBE6A1m0W5T1cHd79wYVQAcV3LmIz D3CDN2nosaHA0PuocsfpsYYZsxDm4952bra/lCqX75pnPXiueadEDMcQbAn353tgfjKIF4 fxOCXOg9I+jq142AOq/FLt8VkdeVuvBSvNSmFgzqf9DeSjGWpgWVrjTQSn3zNl1QtrbQ5A KxnWzWRWdD4oLUrL3ScaYs/BAvSmw0z6GYDLELrrYvBVd4lDibSb5xI6gvmpsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675880967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yUp+aKpqDJxfoDY+8AJk/2ZvL1OvTcBtO6dxaDVIacc=; b=Iq2EaQHJx3PHf0JxdD4xrqSg7gnUj0ferOY2o0nlOiHeLzudVAgJ49jZAq7ig5R1HXnm1f /nU6wMbgA2iDq14IGbC6E2UHPfRTvVvV5Rz7jseFnYyq9o4ObdRbRLkz8FYCRnr1Ed8nMI TZNNqBGSUWOR7FvymHdPDz0jw6fcQIQObKItGp+XHryCzDwqG3xwy+Tl0wLA6iaJ7+CP51 9BHRVxnaiFPdHdLAh42EuY8Gl1o6fSKTwrlvRPla3LQCNIUf51zIwumuFX+G+gOHAeF5i5 YueaTBGmXMoljMj0Lx2YzLW+RBLF8APzsmYvnXaItcTAa1Pmpocog21v6zHT3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675880967; a=rsa-sha256; cv=none; b=FtKbxOXwHxoCYBzyVkPzU6Mw8HxCZQ6C60pZdM6+VJV1T5cJfgi4fEplWNsCfE9HbL4RaG yTJU6IOkx2mPgbvYq/M7naEa8yx36RFp9+MwawKGnm0bMEAHaLN4o8v7SWPqZuS2zZNr8z 09gHwSIiyNCFQx7UI3qbR6IgUWFAlo+o0KDcb8mjsh9qGDV1YpFccFPrG68CCFc6x/0yrH OTRRohBvmMc2TFBREj+YjGHVhJEdegnRsrIjMSpa+Jr8TB7Vq5KdMudb28cJehYgUaRv4K /THptTcN3ZqXSGKoNIdTzyKfufvXcunDrMSTT+hAxjKcXkhy9FADHOD073TQ1w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBpS752xYz16bS; Wed, 8 Feb 2023 18:29:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 318ITRNm037465; Wed, 8 Feb 2023 18:29:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 318ITRjZ037464; Wed, 8 Feb 2023 18:29:27 GMT (envelope-from git) Date: Wed, 8 Feb 2023 18:29:27 GMT Message-Id: <202302081829.318ITRjZ037464@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 36a39f0cc68f - releng/12.4 - ixgbe: workaround errata about UDP frames with zero checksum 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: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/12.4 X-Git-Reftype: branch X-Git-Commit: 36a39f0cc68fab01d2c33f4738e865664db31192 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/12.4 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=36a39f0cc68fab01d2c33f4738e865664db31192 commit 36a39f0cc68fab01d2c33f4738e865664db31192 Author: Andrey V. Elsukov AuthorDate: 2022-11-10 09:34:40 +0000 Commit: Gordon Tetlow CommitDate: 2023-02-08 16:32:02 +0000 ixgbe: workaround errata about UDP frames with zero checksum Intel 82599 has errata related to IPv4 UDP frames with zero checksum. It reports such datagrams with L4 integrity errors in IXGBE_XEC register. And after afb1aa4e6df2 commit such errors are reported via IFCOUNTER_IERRORS. This confuses users, since actually all frames are handled correctly by the system. To workaround the problem, let's ignore the XEC register value for 82599 cards for now. PR: 266048 Discussed with: erj Sponsored by: Yandex LLC Approved by: so Security: FreeBSD-EN-23:04.ixgbe (cherry picked from commit 8526120ad41ca47367b43f8f4459e0fa61285571) (cherry picked from commit fe9c4deda9d4aa2c5bed75071f8006bd2a0734a2) --- sys/dev/ixgbe/if_ix.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index a361645d3b9f..47f3918fd8ee 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -1574,8 +1574,12 @@ ixgbe_update_stats_counters(struct ixgbe_softc *sc) * - fragmented packets count, * - oversized packets count, * - jabber count. + * + * Ignore XEC errors for 82599 to workaround errata about + * UDP frames with zero checksum. */ - IXGBE_SET_IERRORS(sc, stats->crcerrs + stats->illerrc + stats->xec + + IXGBE_SET_IERRORS(sc, stats->crcerrs + stats->illerrc + + (hw->mac.type != ixgbe_mac_82599EB ? stats->xec : 0) + stats->mpc[0] + stats->rlec + stats->ruc + stats->rfc + stats->roc + stats->rjc); } /* ixgbe_update_stats_counters */ From nobody Wed Feb 8 18:29:28 2023 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 4PBpS906h9z3nlhY; Wed, 8 Feb 2023 18:29: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 4PBpS86X1bz3wJv; Wed, 8 Feb 2023 18:29:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675880968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JUkrEDONHfyiAiuqhF27+tCzHVtshyfNCbTkL8OhUcE=; b=tTSJu8HlPaEgUuZI9d1//IYsQNq9EN0vNwEp5AIAK5WERv8IwbKIAFb5EouAsIOiu29iVz 38FlK3ljI2l0e4huWm4tg03PVUUxwM+UuKDDCAN3RmHlFz9S/VH5qPMSsw6YBx3VWYfWuu g7TkJGLkkVTzWJk07ehwGsNc1IS3ZL9w5QMX+qcK2Pa57/1zDpNK/vQA30xSNYF93dBytB PZkNakxutCOIMouqpgFoGQ0eaaellh8rtPCROXbvRJtTZ0B90yBULAcqfrTB12QBrJ9vBn CtuI6ZBhBzEqUDtS2PWDJKIwXUv7qKzjYJQb4EDbPwKWPrBMCeSsBUyXhBU1wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675880968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JUkrEDONHfyiAiuqhF27+tCzHVtshyfNCbTkL8OhUcE=; b=iHSsswBQM8rtV/fn9232nirE33jyRfuVKRKxAO7/YsELPS0r2fg/1WZVbJootr4XZ8wgKn 4bm6+gPuJI8lu8k4G7q8SowSI2SP6g8CwuAOMcsjyzAbFO5NO2lEV7Enh/ozeNGwln5+z8 Dee7Ba3wOchARr9Buo+3+z0MPQKwXumxKI5wGXqHXXG3ieUA9VkJhZFK5tiQ90pqaNteN5 iePoOtPdLMtElECFS57KEln252Ukjyp+oEns548NbREha8WRHFRx+EDBm3SRY7Iw8GKN4Z ci7XSV5B6F2W/hOqn2VyGpyHKHMdxxHfGXH+4QPCvNKE9YYvn/gAcYTG6ZM7ww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675880968; a=rsa-sha256; cv=none; b=JqS78OwqNlOY9N/aPSJp+butkOm7n/ZwIlBYzv7CEQTMLf/sHhEIsljbykq43oQCV80IV7 QMOJPEhxY7j5Qd2IHwWmboaJRQrs8OSG2RJZY7oBFELd5R8w5WJZc6n9tgMUAhFznjQyJR R9t0WjXIjqqltyLnOsOhUOworRDrlJP2dU8qZrNpmUSLEbHuqfWl/QiGgKKnW2snIM4v89 OO8pDVPLiCBZW+ZWHbfqOHQWpZ6ySsEp22RDFVVj2AR8Hvvm9kulxoBmXsjLFGscdFTz2L C4qL7dcA9kSkogUDaM+oXaQBezg+E6ZQiBhm8WFQiccjKjdHFvnHmnqkhjM1Lw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBpS85d5wz16bT; Wed, 8 Feb 2023 18:29:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 318ITS2f037494; Wed, 8 Feb 2023 18:29:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 318ITS0o037493; Wed, 8 Feb 2023 18:29:28 GMT (envelope-from git) Date: Wed, 8 Feb 2023 18:29:28 GMT Message-Id: <202302081829.318ITS0o037493@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 256e92061356 - releng/12.4 - geli: split the initalization of HMAC 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: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/12.4 X-Git-Reftype: branch X-Git-Commit: 256e920613565f8c0572376ad21a7f37f2c26972 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/12.4 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=256e920613565f8c0572376ad21a7f37f2c26972 commit 256e920613565f8c0572376ad21a7f37f2c26972 Author: Mariusz Zaborski AuthorDate: 2023-02-08 16:41:06 +0000 Commit: Gordon Tetlow CommitDate: 2023-02-08 18:09:30 +0000 geli: split the initalization of HMAC GELI allows to read a user key from a standard input. However if user initialize multiple providers at once, the standard input will be empty for the second and next providers. This caused GELI to encrypt a master key with an empty key file. This commits initialize the HMAC with the key file, and then reuse the finalized structure to generate different encryption keys for different providers. Reported by: Nathan Dorfman Tested by: philip Approved by: so Security: FreeBSD-SA-23:01.geli Security: CVE-2023-0751 (cherry picked from commit 5fff09660e06a66bed6482da9c70df328e16bbb6) (cherry picked from commit a5afaf4e9abd8d5e6cce5d6c433d2276bf9b8721) --- lib/geom/eli/geom_eli.c | 72 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 54 insertions(+), 18 deletions(-) diff --git a/lib/geom/eli/geom_eli.c b/lib/geom/eli/geom_eli.c index a89ac69cf338..147807c46416 100644 --- a/lib/geom/eli/geom_eli.c +++ b/lib/geom/eli/geom_eli.c @@ -565,27 +565,35 @@ eli_genkey_passphrase(struct gctl_req *req, struct g_eli_metadata *md, bool new, return (0); } -static unsigned char * -eli_genkey(struct gctl_req *req, struct g_eli_metadata *md, unsigned char *key, - bool new) +static bool +eli_init_key_hmac_ctx(struct gctl_req *req, struct hmac_ctx *ctx, bool new) { - struct hmac_ctx ctx; - bool nopassphrase; int nfiles; + bool nopassphrase; nopassphrase = gctl_get_int(req, new ? "nonewpassphrase" : "nopassphrase"); - g_eli_crypto_hmac_init(&ctx, NULL, 0); - - nfiles = eli_genkey_files(req, new, "keyfile", &ctx, NULL, 0); - if (nfiles == -1) - return (NULL); - else if (nfiles == 0 && nopassphrase) { + g_eli_crypto_hmac_init(ctx, NULL, 0); + nfiles = eli_genkey_files(req, new, "keyfile", ctx, NULL, 0); + if (nfiles == -1) { + return (false); + } else if (nfiles == 0 && nopassphrase) { gctl_error(req, "No key components given."); - return (NULL); + return (false); } + return (true); +} + +static unsigned char * +eli_genkey(struct gctl_req *req, const struct hmac_ctx *ctxtemplate, + struct g_eli_metadata *md, unsigned char *key, bool new) +{ + struct hmac_ctx ctx; + + memcpy(&ctx, ctxtemplate, sizeof(ctx)); + if (eli_genkey_passphrase(req, md, new, &ctx) == -1) return (NULL); @@ -594,6 +602,22 @@ eli_genkey(struct gctl_req *req, struct g_eli_metadata *md, unsigned char *key, return (key); } +static unsigned char * +eli_genkey_single(struct gctl_req *req, struct g_eli_metadata *md, + unsigned char *key, bool new) +{ + struct hmac_ctx ctx; + unsigned char *rkey; + + if (!eli_init_key_hmac_ctx(req, &ctx, new)) { + return (NULL); + } + rkey = eli_genkey(req, &ctx, md, key, new); + explicit_bzero(&ctx, sizeof(ctx)); + + return (rkey); +} + static int eli_metadata_read(struct gctl_req *req, const char *prov, struct g_eli_metadata *md) @@ -705,6 +729,7 @@ eli_init(struct gctl_req *req) intmax_t val; int error, i, nargs, nparams, param; const int one = 1; + struct hmac_ctx ctxtemplate; nargs = gctl_get_int(req, "nargs"); if (nargs <= 0) { @@ -852,6 +877,10 @@ eli_init(struct gctl_req *req) */ nparams = req->narg - nargs - 1; + /* Generate HMAC context template. */ + if (!eli_init_key_hmac_ctx(req, &ctxtemplate, true)) + return; + /* Create new child request for each provider and issue to kernel */ for (i = 0; i < nargs; i++) { r = gctl_get_handle(); @@ -893,7 +922,7 @@ eli_init(struct gctl_req *req) arc4random_buf(md.md_mkeys, sizeof(md.md_mkeys)); /* Generate user key. */ - if (eli_genkey(r, &md, key, true) == NULL) { + if (eli_genkey(r, &ctxtemplate, &md, key, true) == NULL) { /* * Error generating key - details added to geom request * by eli_genkey(). @@ -1017,6 +1046,7 @@ out: /* Clear the cached metadata, including keys. */ explicit_bzero(&md, sizeof(md)); + explicit_bzero(&ctxtemplate, sizeof(ctxtemplate)); } static void @@ -1028,6 +1058,7 @@ eli_attach(struct gctl_req *req) off_t mediasize; int i, nargs, nparams, param; const int one = 1; + struct hmac_ctx ctxtemplate; nargs = gctl_get_int(req, "nargs"); if (nargs <= 0) { @@ -1043,6 +1074,10 @@ eli_attach(struct gctl_req *req) */ nparams = req->narg - nargs - 1; + /* Generate HMAC context template. */ + if (!eli_init_key_hmac_ctx(req, &ctxtemplate, false)) + return; + /* Create new child request for each provider and issue to kernel */ for (i = 0; i < nargs; i++) { r = gctl_get_handle(); @@ -1072,7 +1107,7 @@ eli_attach(struct gctl_req *req) goto out; } - if (eli_genkey(r, &md, key, false) == NULL) { + if (eli_genkey(r, &ctxtemplate, &md, key, false) == NULL) { /* * Error generating key - details added to geom request * by eli_genkey(). @@ -1106,6 +1141,7 @@ out: /* Clear sensitive data from memory. */ explicit_bzero(cached_passphrase, sizeof(cached_passphrase)); + explicit_bzero(&ctxtemplate, sizeof(ctxtemplate)); } static void @@ -1277,7 +1313,7 @@ eli_setkey_attached(struct gctl_req *req, struct g_eli_metadata *md) old = md->md_iterations; /* Generate key for Master Key encryption. */ - if (eli_genkey(req, md, key, true) == NULL) { + if (eli_genkey_single(req, md, key, true) == NULL) { explicit_bzero(key, sizeof(key)); return; } @@ -1312,7 +1348,7 @@ eli_setkey_detached(struct gctl_req *req, const char *prov, } /* Generate key for Master Key decryption. */ - if (eli_genkey(req, md, key, false) == NULL) { + if (eli_genkey_single(req, md, key, false) == NULL) { explicit_bzero(key, sizeof(key)); return; } @@ -1370,7 +1406,7 @@ eli_setkey_detached(struct gctl_req *req, const char *prov, explicit_bzero(mkey, sizeof(mkey)); /* Generate key for Master Key encryption. */ - if (eli_genkey(req, md, key, true) == NULL) { + if (eli_genkey_single(req, md, key, true) == NULL) { explicit_bzero(key, sizeof(key)); explicit_bzero(md, sizeof(*md)); return; @@ -1516,7 +1552,7 @@ eli_resume(struct gctl_req *req) return; } - if (eli_genkey(req, &md, key, false) == NULL) { + if (eli_genkey_single(req, &md, key, false) == NULL) { explicit_bzero(key, sizeof(key)); return; } From nobody Wed Feb 8 18:29:29 2023 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 4PBpSB37vKz3nlg7; Wed, 8 Feb 2023 18:29: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 4PBpSB10j2z3wMR; Wed, 8 Feb 2023 18:29:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675880970; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YHDSSLDv6J2Plmzrz6FEgroGOL/WcCcq4ilijol5uYI=; b=cdmRFlvKuTluO4LIPbjgDkIv9fgAPqYQx8CAcKwK9Odl5gmJlvpqjnzFgG9i7LKOFPV0il 7R8Gny1JVc9xjJdHIK5xqLXP/FYfCwLzZKUuUNgf8FcitiD8OFiqYSI76x4fEW/k2q6n/h h/+Eo8878QP13uxMk+lHp8vDDUHQRrobVEjJ10nP6DTccZqCr9A4y/dORL+ynEM6vmuHF0 as3fBJsS1odfTnogExuEcN4hgOBCIy54ybp7M+dhIdx1Qi9aLr0vk7CX2Mr553+1wonW56 6TVvG+n1tjKeGc/gwUBzIEkmTFk7lnGW6aNLxrouRM6dfcvpgkufSOTp5p7VoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675880970; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YHDSSLDv6J2Plmzrz6FEgroGOL/WcCcq4ilijol5uYI=; b=YS/BTztT/FCz+mDuGAqI3VTwKgLLWQIKmJGJ1HcKTfltSsddOS5Pdwr8P3n+7uiK57bc/V 2RmZmoHTmiiHgJDVxmENyWzjOH538n4pImY5a07aIobybzQ8s7MVT64bAXdVXFbtCbP2qt R3o9zO6PFNyijVQE2kHXnPmVNn80A6M/Dku/qG+tthRjSLjJxKkMhyZ2UnYA5ltDrvTeQi d1OeW70U9A3aEcVzbg+iigyLSZXk73LUxHNz1LdN62J7EIDS/qV6vKolGDj/wLCaufRDmv sfQHD5rOevSdJOqrNd1z6ISUzGqXWycqp/LaiATjXIVIT+3C3nkWoG0jQKcnag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675880970; a=rsa-sha256; cv=none; b=pzH4IMNh/PWxX/TWt+9rM1Ex41X0kuEGfTntixhVDq3z+oXlRV/VDfgYR3mxKC+Nn3j1z2 hGLB8f7ztkZDQs0xug6tWZqMqY8uDdlUz2slhZuMv43aOnOdSPFjpEFWpfn1IU8f7uY6Jp 4px2x/2+OFfBsGuTfrMa1Zhr4ww3YLDGzykCLL0h8Kh/i0KqmuGKYEM5Eb/t/YGcv/HPsN 16nSIYaC8hHzfL9IfkCtSCKxsmEy0tlXXYWeEjSJGuh+4spyiR+bY6BArNN0Cp+7HyeXco 3xJGyCXNYKvI01qhCrE85sQbyQ94q6FU3qLVN3lArxLBSJGydr48QbFExzWGGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBpS96n98z16Kp; Wed, 8 Feb 2023 18:29:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 318ITTl3037527; Wed, 8 Feb 2023 18:29:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 318ITTxM037526; Wed, 8 Feb 2023 18:29:29 GMT (envelope-from git) Date: Wed, 8 Feb 2023 18:29:29 GMT Message-Id: <202302081829.318ITTxM037526@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 52442e904dfc - releng/12.4 - Add UPDATING entries and bump version. 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: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/12.4 X-Git-Reftype: branch X-Git-Commit: 52442e904dfc2bd3fd8b567db447ebe537b61c86 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/12.4 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=52442e904dfc2bd3fd8b567db447ebe537b61c86 commit 52442e904dfc2bd3fd8b567db447ebe537b61c86 Author: Gordon Tetlow AuthorDate: 2023-02-08 16:56:49 +0000 Commit: Gordon Tetlow CommitDate: 2023-02-08 18:16:29 +0000 Add UPDATING entries and bump version. Approved by: so --- UPDATING | 11 +++++++++++ sys/conf/newvers.sh | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 49888b0fde9c..d4ff1f64515b 100644 --- a/UPDATING +++ b/UPDATING @@ -17,6 +17,17 @@ from older versions of FreeBSD, try WITHOUT_CLANG and WITH_GCC to bootstrap to the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20230208: + 12.4-RELEASE-p1 FreeBSD-SA-23:01.geli + FreeBSD-EN-23:01.tzdata + FreeBSD-EN-23:04.ixgbe + + Fix GELI silently omits the keyfile if read from stdin [SA-23:01.geli] + + Timezone database information update [EN-23:01.tzdata] + + Fix ixgbe incorrectly reporting input errors for 82599ES [EN-23:04.ixgbe] + 20221205: 12.4-RELEASE. diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 5c58afc6eac4..9103088c96b8 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -49,7 +49,7 @@ TYPE="FreeBSD" REVISION="12.4" -BRANCH="RELEASE" +BRANCH="RELEASE-p1" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Wed Feb 8 21:05:07 2023 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 4PBsvl5Cg2z3pKKy; Wed, 8 Feb 2023 21:05: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 4PBsvl4mQhz3jND; Wed, 8 Feb 2023 21:05:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675890307; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9HIox1qWvM+s/0IfYyMkmMOai3MKOgIn1of+mpE+aKU=; b=oD85KfgkFfPsPnTKhIp4Q/Lblaq8DfiLoUAu1Vlmes78kIN9h3JoTVDOEfcQyAFSWxyNHY lI2O0eZKIJCac7RGiYgdqnGGf6+UFfNPs/u+2e0SfkI8/O9x+rHl76w6yEX/9oJmrh0bdE RqIKG2oD+F+yfoQzhXccPuWuETwIQjiBMpHS5FlIfGS3mQ0DpYiLnkCTC/DqVRtAbYy6vP SqNi4RCIDfmM2ndFHBECW8MJ3bLBeUeVV3/z9QJDU3PJkUf9Bh8JtT7lNZEvxagpxeiQeA WWfYizCZA/7M1/ai5U3D2M1gZM4tnmVVZb8/wSDJ0tu5kXWIIAOWZYulqa9rbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675890307; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9HIox1qWvM+s/0IfYyMkmMOai3MKOgIn1of+mpE+aKU=; b=Z1syZ4V/aFMsqZfvxVoRylypFkxbBc9Wti3+ImL02DhWlIOdl8ij2dWrTP+/EP7e6HKYM0 /QNf97tpo4gEtjD875w+wfIxZv3WUZPobK5hzf35rmb4k1C9UyVtVmWCosWdjtbKClBdvS Jg3jYJzL3aXF5OwcXDTgUg935H6B5OK8pnsSGGeDBP8gctT3GIC110b6sFSOU/saI9Eu9I IXgb8cBY4g33pFhi+bkmbOfCNMpRH4sI/C2lcIFyU2Wrbd0H9hiRV6F4GI85mzjaGzKeTG ksyUSVP1DuDZOxD8t5SXNb6Nyptx0TbOTifoX83HGcEIjdtA7HAssLt2M4n07g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675890307; a=rsa-sha256; cv=none; b=gnMgIzsZtfJimVZ7buGBvOeO9cISRVcf7PtUlYw71Unl9shBCAIETg0kw8MvXArNcQu4Iu 0vf39D9DXJZdahP7cLCGy7LZKtmQjCLDjGwdcH9R7rA3zu7gueb/fyS6YPvZN1o+b4W7qk N++K3Y5GyrvC/Mcf2MDMTZXvIMqrwzHUI9RFhwJflLDrU3R7SFo5ZEHIJ5GehBdjiK51kU GB2rqS46Z40e3ZehLVAkC+p6g++Ke1fLE9vWbbKFsevq4rkqRBmiuEFEXrIF1EF6ZmQS0e Ioeg1PVBHFjBMTXtZIL6tdtMTsz0GWIo1Vo2FV7tJPG7XCj+yaIPCfZujOXmxQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBsvl3py6z1BLQ; Wed, 8 Feb 2023 21:05:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 318L57tO067611; Wed, 8 Feb 2023 21:05:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 318L57bd067610; Wed, 8 Feb 2023 21:05:07 GMT (envelope-from git) Date: Wed, 8 Feb 2023 21:05:07 GMT Message-Id: <202302082105.318L57bd067610@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 04c6f6ce1b4d - stable/13 - blacklistd: diff reduction against upstream 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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 04c6f6ce1b4d912d925aba0d0f5f0f1d03d9084a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=04c6f6ce1b4d912d925aba0d0f5f0f1d03d9084a commit 04c6f6ce1b4d912d925aba0d0f5f0f1d03d9084a Author: Ed Maste AuthorDate: 2023-01-23 16:19:46 +0000 Commit: Ed Maste CommitDate: 2023-02-08 21:04:36 +0000 blacklistd: diff reduction against upstream Add `conf_` prefix, maching https://github.com/zoulasc/blocklist Sponsored by: The FreeBSD Foundation (cherry picked from commit 8089749d38781946c008372f4016d69eee549f1c) --- contrib/blacklist/bin/conf.c | 54 +++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/contrib/blacklist/bin/conf.c b/contrib/blacklist/bin/conf.c index e2a45f80d787..f21dd8b05158 100644 --- a/contrib/blacklist/bin/conf.c +++ b/contrib/blacklist/bin/conf.c @@ -90,7 +90,7 @@ advance(char **p) } static int -getnum(const char *f, size_t l, bool local, void *rp, const char *name, +conf_getnum(const char *f, size_t l, bool local, void *rp, const char *name, const char *p) { int e; @@ -127,13 +127,14 @@ out: } static int -getnfail(const char *f, size_t l, bool local, struct conf *c, const char *p) +conf_getnfail(const char *f, size_t l, bool local, struct conf *c, + const char *p) { - return getnum(f, l, local, &c->c_nfail, "nfail", p); + return conf_getnum(f, l, local, &c->c_nfail, "nfail", p); } static int -getsecs(const char *f, size_t l, bool local, struct conf *c, const char *p) +conf_getsecs(const char *f, size_t l, bool local, struct conf *c, const char *p) { int e; char *ep; @@ -193,7 +194,7 @@ out: } static int -getport(const char *f, size_t l, bool local, void *r, const char *p) +conf_getport(const char *f, size_t l, bool local, void *r, const char *p) { struct servent *sv; @@ -207,11 +208,11 @@ getport(const char *f, size_t l, bool local, void *r, const char *p) return 0; } - return getnum(f, l, local, r, "service", p); + return conf_getnum(f, l, local, r, "service", p); } static int -getmask(const char *f, size_t l, bool local, const char **p, int *mask) +conf_getmask(const char *f, size_t l, bool local, const char **p, int *mask) { char *d; const char *s = *p; @@ -226,11 +227,12 @@ getmask(const char *f, size_t l, bool local, const char **p, int *mask) } *d++ = '\0'; - return getnum(f, l, local, mask, "mask", d); + return conf_getnum(f, l, local, mask, "mask", d); } static int -gethostport(const char *f, size_t l, bool local, struct conf *c, const char *p) +conf_gethostport(const char *f, size_t l, bool local, struct conf *c, + const char *p) { char *d; // XXX: Ok to write to string. in_port_t *port = NULL; @@ -249,7 +251,7 @@ gethostport(const char *f, size_t l, bool local, struct conf *c, const char *p) } else pstr = p; - if (getmask(f, l, local, &pstr, &c->c_lmask) == -1) + if (conf_getmask(f, l, local, &pstr, &c->c_lmask) == -1) goto out; if (d) { @@ -300,7 +302,7 @@ gethostport(const char *f, size_t l, bool local, struct conf *c, const char *p) } } - if (getport(f, l, local, &c->c_port, pstr) == -1) + if (conf_getport(f, l, local, &c->c_port, pstr) == -1) return -1; if (port && c->c_port != FSTAR && c->c_port != FEQUAL) @@ -320,7 +322,7 @@ out2: } static int -getproto(const char *f, size_t l, bool local __unused, struct conf *c, +conf_getproto(const char *f, size_t l, bool local __unused, struct conf *c, const char *p) { if (strcmp(p, "stream") == 0) { @@ -331,22 +333,22 @@ getproto(const char *f, size_t l, bool local __unused, struct conf *c, c->c_proto = IPPROTO_UDP; return 0; } - return getnum(f, l, local, &c->c_proto, "protocol", p); + return conf_getnum(f, l, local, &c->c_proto, "protocol", p); } static int -getfamily(const char *f, size_t l, bool local __unused, struct conf *c, +conf_getfamily(const char *f, size_t l, bool local __unused, struct conf *c, const char *p) { if (strncmp(p, "tcp", 3) == 0 || strncmp(p, "udp", 3) == 0) { c->c_family = p[3] == '6' ? AF_INET6 : AF_INET; return 0; } - return getnum(f, l, local, &c->c_family, "family", p); + return conf_getnum(f, l, local, &c->c_family, "family", p); } static int -getuid(const char *f, size_t l, bool local __unused, struct conf *c, +conf_getuid(const char *f, size_t l, bool local __unused, struct conf *c, const char *p) { struct passwd *pw; @@ -356,15 +358,15 @@ getuid(const char *f, size_t l, bool local __unused, struct conf *c, return 0; } - return getnum(f, l, local, &c->c_uid, "user", p); + return conf_getnum(f, l, local, &c->c_uid, "user", p); } static int -getname(const char *f, size_t l, bool local, struct conf *c, +conf_getname(const char *f, size_t l, bool local, struct conf *c, const char *p) { - if (getmask(f, l, local, &p, &c->c_rmask) == -1) + if (conf_getmask(f, l, local, &p, &c->c_rmask) == -1) return -1; if (strcmp(p, "*") == 0) { @@ -406,19 +408,19 @@ conf_parseline(const char *f, size_t l, char *p, struct conf *c, bool local) p++; memset(c, 0, sizeof(*c)); - e = getvalue(f, l, local, c, &p, gethostport); + e = getvalue(f, l, local, c, &p, conf_gethostport); if (e) return -1; - e = getvalue(f, l, local, c, &p, getproto); + e = getvalue(f, l, local, c, &p, conf_getproto); if (e) return -1; - e = getvalue(f, l, local, c, &p, getfamily); + e = getvalue(f, l, local, c, &p, conf_getfamily); if (e) return -1; - e = getvalue(f, l, local, c, &p, getuid); + e = getvalue(f, l, local, c, &p, conf_getuid); if (e) return -1; - e = getvalue(f, l, local, c, &p, getname); + e = getvalue(f, l, local, c, &p, conf_getname); if (e) return -1; - e = getvalue(f, l, local, c, &p, getnfail); + e = getvalue(f, l, local, c, &p, conf_getnfail); if (e) return -1; - e = getvalue(f, l, local, c, &p, getsecs); + e = getvalue(f, l, local, c, &p, conf_getsecs); if (e) return -1; return 0; From nobody Wed Feb 8 21:05:51 2023 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 4PBswb32Hhz3pK2b; Wed, 8 Feb 2023 21:05: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 4PBswb2YPHz3jlH; Wed, 8 Feb 2023 21:05:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675890351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KmqsrnINmO0aUpj+SI8DLRhzAUEt7Zr+zYTOYJWjVEE=; b=HxxYkTzDBi/fIUwh/jLSpkK5vAQV0hkzn/4p7PEs4nh7F9fM1QmpUkw6nJeKH5dX0AVzeV PslNH0Humn2g+UgjKs7nZdEzEhg6vbQx74unaXt/qJsa72o4NvEXUVZwQuj2chX5Kjjas3 3roNJQQI4Gg0zF/gtpq54wUKrofpZwiGaV5r17uuyAO8Eg+JjEuP8oTHoXfUY1/JVCelZ4 MKbeG3p6DHOhwKyb5zgDFphhzCE+wFSjnnK75TV7PTDn/bWMIlNdZADyTWb/mt7XSQCPk9 vptsZRSDqp6zbeWleR16p/OdgePfq9NVR/S7Y4X9rb+ZxyQau9Bryvqe8vLZFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675890351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KmqsrnINmO0aUpj+SI8DLRhzAUEt7Zr+zYTOYJWjVEE=; b=MnCzwd49hYsESwB1tsZZGNLPWlksmJ7VyPl3XSuGUXawttFJrAKRV6CotupMMhskZ8S039 mEKMIaQvXqhK4DU26/Kc2GTew608Xt6L2Fak+qz3hdN/N9B2qr6iIFnuiS3bgdeI6nOK6B CA/b7yRiLtewC7/xDJJ4aQeZLkiCYFsCdwYJnRNEXUGzD5PeiRNRj+/pS7Aaqr6auSl1I1 iwAtPJdm40l0TAnCcYZVHJHgp9A3FGIN802kDY9zRDazxuS3ZtyDF8L8xNPUfLKnegKu+2 49gz5fJyMypIdNtumYxLHEh86VSXAWq1Qfs2gQLSzS+DhIxXxf6ntQgGX01PTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675890351; a=rsa-sha256; cv=none; b=pO6WVFgCJD8EqO4n+1DbhEYcw+7sMOAhrZu9g7VIYxMviu31I4laU1isb3XBSwSrOJENI0 9pq4LTWq2tRVScU1eTJNDk5mnSHugfbQPSx0ekdU/Ldg832cgSkFTmPF07zHAHRIOEe6Ny aPu8QxwIx4IhkkxgYbxCMJnPo273V4QTEhUp+MDYqDFqtUq3kxLeRbjjiiRYLLVJdX814e K+zOiSrZNTDZWe1HAMqA8LZjMDfEOb/YQi/75X9dFWd0jMCmdVuvZaLKB7ZDLDf6fX8lL0 0akLtW3M531lN8dIJxZcQpVw9TGS9KqCymoI0VcF3gp1snO5fIZptFbCtIvgKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBswb1cVSz1BDY; Wed, 8 Feb 2023 21:05:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 318L5pjF067819; Wed, 8 Feb 2023 21:05:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 318L5pfk067818; Wed, 8 Feb 2023 21:05:51 GMT (envelope-from git) Date: Wed, 8 Feb 2023 21:05:51 GMT Message-Id: <202302082105.318L5pfk067818@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 296ec8eae0c8 - stable/13 - ssh: fix double-free caused by compat_kex_proposal() 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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 296ec8eae0c834088a491643a937d881bfb4b5dd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=296ec8eae0c834088a491643a937d881bfb4b5dd commit 296ec8eae0c834088a491643a937d881bfb4b5dd Author: Ed Maste AuthorDate: 2023-02-06 16:26:08 +0000 Commit: Ed Maste CommitDate: 2023-02-08 21:04:36 +0000 ssh: fix double-free caused by compat_kex_proposal() Security: CVE-2023-25136 Obtained from: OpenSSH-portable commit 12da78233364 Sponsored by: The FreeBSD Foundation (cherry picked from commit fe1371e8f3d7336748d291a7360b2aacce943fb1) --- crypto/openssh/compat.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/crypto/openssh/compat.c b/crypto/openssh/compat.c index 46dfe3a9c2e7..478a9403eeaa 100644 --- a/crypto/openssh/compat.c +++ b/crypto/openssh/compat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: compat.c,v 1.120 2022/07/01 03:35:45 dtucker Exp $ */ +/* $OpenBSD: compat.c,v 1.121 2023/02/02 12:10:05 djm Exp $ */ /* * Copyright (c) 1999, 2000, 2001, 2002 Markus Friedl. All rights reserved. * @@ -190,26 +190,26 @@ compat_pkalg_proposal(struct ssh *ssh, char *pkalg_prop) char * compat_kex_proposal(struct ssh *ssh, char *p) { - char *cp = NULL; + char *cp = NULL, *cp2 = NULL; if ((ssh->compat & (SSH_BUG_CURVE25519PAD|SSH_OLD_DHGEX)) == 0) return xstrdup(p); debug2_f("original KEX proposal: %s", p); if ((ssh->compat & SSH_BUG_CURVE25519PAD) != 0) - if ((p = match_filter_denylist(p, + if ((cp = match_filter_denylist(p, "curve25519-sha256@libssh.org")) == NULL) fatal("match_filter_denylist failed"); if ((ssh->compat & SSH_OLD_DHGEX) != 0) { - cp = p; - if ((p = match_filter_denylist(p, + if ((cp2 = match_filter_denylist(cp ? cp : p, "diffie-hellman-group-exchange-sha256," "diffie-hellman-group-exchange-sha1")) == NULL) fatal("match_filter_denylist failed"); free(cp); + cp = cp2; } - debug2_f("compat KEX proposal: %s", p); - if (*p == '\0') + if (cp == NULL || *cp == '\0') fatal("No supported key exchange algorithms found"); - return p; + debug2_f("compat KEX proposal: %s", cp); + return cp; } From nobody Wed Feb 8 21:05:52 2023 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 4PBswc6WHrz3pK8q; Wed, 8 Feb 2023 21:05:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PBswc3rwgz3jlW; Wed, 8 Feb 2023 21:05:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675890352; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0uiVxbSi1m5tW+c4gmj1vyybpwRxvj/0MK20JTt7Llg=; b=ePO8isdVlvXaFMC72QfAk89CNTA0o4madwl0VifDZbG42vtXIC62kBBqgbE0jTVLgFkoYC jNvO/mF4FOsifBM4HaXdBgaUsSvYyEDw0Ja2kMZSmzKVCwAEgGnUYKAJv990Pu+/KGviac exwktIxKF8KkLPAvqGaZIxHOxEPwAwO1YjemXLMZ7go3moRq/1DxnbBfyOBXRr5qqDRIW9 ngjWSLS7K/TgJrtFWJ1GgB64JLkI56X07+alNTC6kGe7pZlbyBsL+y5QzyXKvuCb+CPouX SSYb+L6/EHRpwd6wmZVpEmkPAAxUW2aMLjwBIVv2dFYrsFs+Q+4oPZnTn846iQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675890352; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0uiVxbSi1m5tW+c4gmj1vyybpwRxvj/0MK20JTt7Llg=; b=fCNj/PVKonIPIDuIuj1rTe5cG4lfwIJiHE3Q4Oi9aQbGQtJdRxSbpLECw+NpTSVdxBFU0p Wn5sfuR66eVd5CvPw4s2H3yNroq4zR1ECQw61Ojug0+SqjDJ65pybdxpMOZ+MD9QAxR8Am etc34x7JrvkqSpzIPka9dgloL2tiERW+J+WZ/ZNU0ZVyeBpMIyyR/50FOk6OxUAn/vOcOX l0LReS2LTmXPcM4uaMTejD1ioimWcciNGZnoNOWutB4nlAjgl75R62/8oyVWw/oJ0JElPU k7mGrfaLfFvGG81dxgFikVPCGAMIsFouC35kGak9K7zTn5n/9s6eUtguYrcCBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675890352; a=rsa-sha256; cv=none; b=ySIoDjXlFuuTIVJSQLHd5jeaXQhXiCvQMyUEKYcgALPQCbbCkxaESZJUVV2GjB5X815rNq soAdgp6CDwLg83jg0bi23XlhJus8cfCaFGWfi4T33jV+4zjVfvaRCkqMXnTcx4Umcfarvw SPHXwEB2FLL3xC/PHWk0wB/ICu+MPIx6I7vXFVlhqUYOS3/oHEoaz61EhBCGXBHjyHdtHs b+2VLbVk7K2LgfxTijpU2VGaHOznCGUH6yLhMdEsn6MYp/0ef2acAT9w+5v/IsOgGpcUiv D3CGdV7jz4+BJUhGTZjwcmizhYt7mBFd3HR3hMPKeKewpncovzyKtmufidGlqA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBswc2hXHz1BDZ; Wed, 8 Feb 2023 21:05:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 318L5qDo067843; Wed, 8 Feb 2023 21:05:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 318L5qCY067842; Wed, 8 Feb 2023 21:05:52 GMT (envelope-from git) Date: Wed, 8 Feb 2023 21:05:52 GMT Message-Id: <202302082105.318L5qCY067842@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 375bb3704d13 - stable/13 - ssh: fix bug in PermitRemoteOpen which caused it to ignore... 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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 375bb3704d1371dec08f49cf8767f7b98162da34 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=375bb3704d1371dec08f49cf8767f7b98162da34 commit 375bb3704d1371dec08f49cf8767f7b98162da34 Author: Ed Maste AuthorDate: 2023-02-06 16:33:38 +0000 Commit: Ed Maste CommitDate: 2023-02-08 21:04:36 +0000 ssh: fix bug in PermitRemoteOpen which caused it to ignore... its first argument unless it was one of the special keywords "any" or "none". Obtained from: OpenSSH-portable commit b3daa8dc5823 Sponsored by: The FreeBSD Foundation (cherry picked from commit 94e21add45344f0669f910ea77db499e8c892c90) --- crypto/openssh/readconf.c | 62 +++++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/crypto/openssh/readconf.c b/crypto/openssh/readconf.c index c4453540c47c..fda7937582f4 100644 --- a/crypto/openssh/readconf.c +++ b/crypto/openssh/readconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: readconf.c,v 1.369 2022/09/17 10:33:18 djm Exp $ */ +/* $OpenBSD: readconf.c,v 1.371 2023/01/02 07:03:30 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -1576,37 +1576,37 @@ parse_pubkey_algos: case oPermitRemoteOpen: uintptr = &options->num_permitted_remote_opens; cppptr = &options->permitted_remote_opens; - arg = argv_next(&ac, &av); - if (!arg || *arg == '\0') - fatal("%s line %d: missing %s specification", - filename, linenum, lookup_opcode_name(opcode)); uvalue = *uintptr; /* modified later */ - if (strcmp(arg, "any") == 0 || strcmp(arg, "none") == 0) { - if (*activep && uvalue == 0) { - *uintptr = 1; - *cppptr = xcalloc(1, sizeof(**cppptr)); - (*cppptr)[0] = xstrdup(arg); - } - break; - } + i = 0; while ((arg = argv_next(&ac, &av)) != NULL) { arg2 = xstrdup(arg); - p = hpdelim(&arg); - if (p == NULL) { - fatal("%s line %d: missing host in %s", - filename, linenum, - lookup_opcode_name(opcode)); - } - p = cleanhostname(p); - /* - * don't want to use permitopen_port to avoid - * dependency on channels.[ch] here. - */ - if (arg == NULL || - (strcmp(arg, "*") != 0 && a2port(arg) <= 0)) { - fatal("%s line %d: bad port number in %s", - filename, linenum, - lookup_opcode_name(opcode)); + /* Allow any/none only in first position */ + if (strcasecmp(arg, "none") == 0 || + strcasecmp(arg, "any") == 0) { + if (i > 0 || ac > 0) { + error("%s line %d: keyword %s \"%s\" " + "argument must appear alone.", + filename, linenum, keyword, arg); + goto out; + } + } else { + p = hpdelim(&arg); + if (p == NULL) { + fatal("%s line %d: missing host in %s", + filename, linenum, + lookup_opcode_name(opcode)); + } + p = cleanhostname(p); + /* + * don't want to use permitopen_port to avoid + * dependency on channels.[ch] here. + */ + if (arg == NULL || (strcmp(arg, "*") != 0 && + a2port(arg) <= 0)) { + fatal("%s line %d: bad port number " + "in %s", filename, linenum, + lookup_opcode_name(opcode)); + } } if (*activep && uvalue == 0) { opt_array_append(filename, linenum, @@ -1614,7 +1614,11 @@ parse_pubkey_algos: cppptr, uintptr, arg2); } free(arg2); + i++; } + if (i == 0) + fatal("%s line %d: missing %s specification", + filename, linenum, lookup_opcode_name(opcode)); break; case oClearAllForwardings: From nobody Wed Feb 8 21:05:53 2023 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 4PBswd5FF5z3pKNH; Wed, 8 Feb 2023 21:05:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PBswd4b4Hz3jfx; Wed, 8 Feb 2023 21:05:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675890353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DhKm/ClBnwRrVTYQJZIJ6/2XEag/3O3me1Uw+CZRUcQ=; b=Hn5+JOGM2sLx8X0jFJG4JO+PxHnJLBKhbGktr2Lc+A8l40/gAz8yz+S5UTvHeCqhKeWdup NenBCHa1B9sikZxI2CcSp2w5ZSFapsVIfW9HdV9BDMS3CFlbigVTODcE9YBKW2v6DyivZ+ 4BzVlQM2n18FID6VpXk+0mAmrNOfifYhwSI1UFNSA1KJDRZ8kLqtUuq/2aczy2DQHhsZhi 8ZmlYwbcVTJyUrpIOBTFhNC2V9+a6W6XE1S5qXLjIZ+PCycFjecMYYuyXb4q74jjoskaDJ sKIJ0wxipgARKHgOXru0sCqGfl5dbLifri5ub17snL/+lNAkHCmYL9YC5PMK8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675890353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DhKm/ClBnwRrVTYQJZIJ6/2XEag/3O3me1Uw+CZRUcQ=; b=clEClJKplRk4esZBZ948mrWbzKvUFyeHXIQhF2Sb0I4+yBgm6RaJKI80mzZixadcews/zJ e36RpmOzvPQNOUgOgnQDo0R2nBEVIS7lKubyd5hx0ceWPw0H4tbf+Ici79XPIvDcKjaS1p xvX8ZE6coLrdLx3iDqpX+2TR11MqTvPQXpsJw9fiGG+UDd65ZwX7eDp2S9JPwQT2aB2iGH q2jzDhnHruY19TFWRd2ELabEBemX896LaHuCeeHl96UCMRVUnif0QGyX6C0URMo3t/Rx4N a023vpLgGidPpjWEX4BCJJVdlD+BdSUbh/R4A2DKDthufwRG3v0nzESQ9RXU8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675890353; a=rsa-sha256; cv=none; b=yU8GAhYBgLUvNh75Si9T77hmcdMHyZo6GqbBv7N84ifw8ykXshVmkDy0mDEKFeLCWs93w2 nwf5llwjwHorm0jJqZFqQEO98KW1GpQG1LthPaw3R/4DTABlaPnup3EsLcEfqyWASM7jXe AMBr/RMNMzNstMWKqGkdYr4v8kHrJEP9O+s4SkonFIyt29V23UmZ35YhW0tO7t01F5ACQ7 Er8LxOj6FRB9PYhGVnW8yp1d6uU+vOOGjmVQojEanSDwm6I9DUbiQsXenx/q2YadW2/Inz JjRTAafzrNHK9Dhcu2SDWexyGMyJyKlXucKCsNleYAxBeW3ei0GtLcMJQ7/LfQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBswd3dlQz1BLw; Wed, 8 Feb 2023 21:05:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 318L5rOP067874; Wed, 8 Feb 2023 21:05:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 318L5rxA067873; Wed, 8 Feb 2023 21:05:53 GMT (envelope-from git) Date: Wed, 8 Feb 2023 21:05:53 GMT Message-Id: <202302082105.318L5rxA067873@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 6ad91c17b055 - stable/13 - ssh: Be more paranoid with host/domain names coming from the 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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6ad91c17b0555f0d28377f66fb9f7c8b4cee2b06 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=6ad91c17b0555f0d28377f66fb9f7c8b4cee2b06 commit 6ad91c17b0555f0d28377f66fb9f7c8b4cee2b06 Author: Ed Maste AuthorDate: 2023-02-06 16:45:52 +0000 Commit: Ed Maste CommitDate: 2023-02-08 21:04:36 +0000 ssh: Be more paranoid with host/domain names coming from the never write a name with bad characters to a known_hosts file. replace recently-added valid_domain() check for hostnames going to known_hosts with a more relaxed check for bad characters. Obtained from: OpenSSH-portable commit 445363433ba2 Obtained from: OpenSSH-portable commit 3cae9f92a318 Sponsored by: The FreeBSD Foundation (cherry picked from commit 2e828220579e3ada74ed0613871ec6ec61d669ba) --- crypto/openssh/ssh.c | 8 ++++++-- crypto/openssh/sshconnect.c | 15 +++++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/crypto/openssh/ssh.c b/crypto/openssh/ssh.c index 0c96f68bd8ae..549686b7798f 100644 --- a/crypto/openssh/ssh.c +++ b/crypto/openssh/ssh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh.c,v 1.576 2022/09/17 10:33:18 djm Exp $ */ +/* $OpenBSD: ssh.c,v 1.579 2022/10/24 22:43:36 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -251,6 +251,7 @@ static struct addrinfo * resolve_host(const char *name, int port, int logerr, char *cname, size_t clen) { char strport[NI_MAXSERV]; + const char *errstr = NULL; struct addrinfo hints, *res; int gaierr; LogLevel loglevel = SYSLOG_LEVEL_DEBUG1; @@ -276,7 +277,10 @@ resolve_host(const char *name, int port, int logerr, char *cname, size_t clen) return NULL; } if (cname != NULL && res->ai_canonname != NULL) { - if (strlcpy(cname, res->ai_canonname, clen) >= clen) { + if (!valid_domain(res->ai_canonname, 0, &errstr)) { + error("ignoring bad CNAME \"%s\" for host \"%s\": %s", + res->ai_canonname, name, errstr); + } else if (strlcpy(cname, res->ai_canonname, clen) >= clen) { error_f("host \"%s\" cname \"%s\" too long (max %lu)", name, res->ai_canonname, (u_long)clen); if (clen > 0) diff --git a/crypto/openssh/sshconnect.c b/crypto/openssh/sshconnect.c index eb5353e2d408..b44518d7acc7 100644 --- a/crypto/openssh/sshconnect.c +++ b/crypto/openssh/sshconnect.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sshconnect.c,v 1.358 2022/08/26 08:16:27 djm Exp $ */ +/* $OpenBSD: sshconnect.c,v 1.360 2022/11/03 21:59:20 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -935,7 +935,7 @@ check_host_key(char *hostname, const struct ssh_conn_info *cinfo, char *ip = NULL, *host = NULL; char hostline[1000], *hostp, *fp, *ra; char msg[1024]; - const char *type, *fail_reason; + const char *type, *fail_reason = NULL; const struct hostkey_entry *host_found = NULL, *ip_found = NULL; int len, cancelled_forwarding = 0, confirmed; int local = sockaddr_is_local(hostaddr); @@ -960,6 +960,17 @@ check_host_key(char *hostname, const struct ssh_conn_info *cinfo, return 0; } + /* + * Don't ever try to write an invalid name to a known hosts file. + * Note: do this before get_hostfile_hostname_ipaddr() to catch + * '[' or ']' in the name before they are added. + */ + if (strcspn(hostname, "@?*#[]|'\'\"\\") != strlen(hostname)) { + debug_f("invalid hostname \"%s\"; will not record: %s", + hostname, fail_reason); + readonly = RDONLY; + } + /* * Prepare the hostname and address strings used for hostkey lookup. * In some cases, these will have a port number appended. From nobody Wed Feb 8 21:06:31 2023 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 4PBsxQ07qlz3pKDW; Wed, 8 Feb 2023 21:06: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 4PBsxM3Lsyz3ksc; Wed, 8 Feb 2023 21:06:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675890391; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/Djh90TjvIl1T1o7ZLzG0M30g6crLHy1HbZb78W3tb0=; b=txhW0pV9gQw1DdoJps2Q+ilaxQMsI04PlGnUtDTDLc2+CeXe6Mdf9Avbm3utOmgWw4GOu6 rOs5mLrDIjP60fGRKtzjgM/R1Q9lBtKNPlVmoQMu03tlODllz7WqHm2cVXhoZ69H1Zhbnm DtukF/uNqxePGm6tOUkDQoORNmBL1XmgVy3v7QIn2KZhJ7HuD8hFttFItq1fd4nS0Uugkm 51FJgliS1AyGlbjKYZtBjH8I1SbdVYQEP1K5fF1VU6MlbhizK62joPeBclXOCJfaQz5ybQ 8FnXKGbf9YQjiuNTIvdA7qszABMDYuew6zQhR+EWitywju5kU5G5CILmAmLT2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675890391; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/Djh90TjvIl1T1o7ZLzG0M30g6crLHy1HbZb78W3tb0=; b=UhG9j91I95trUMimjsR8xgfB3C0HhXyS+2UwLa15v9Itbs6LcaMvTShXD7yTGhlHO8brbx APfHa5cixvS2FzFsptWQ3w2b7ruUsi9fdAl1GuTILeHWF9ZoC+kNxVFgzklju1mtwxnoSa 7GhYEGBRBZyk142Is3GivGDstBu0rU5m6UOBholjN5wiOqSv3eEN8Ic6p78GzgW46qAI0I EW6dk/8oEikx7VU9FXsPYSgnwxEAbiptROF6027GTCTydBa9DKlKJ06Ob9PYmM2DCjGXTy 6sE55yGP5KuFsTZj/sclX75y1g291cuOEZ2qo2zFeSVnoWzNmfEHwlnj3z3AAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675890391; a=rsa-sha256; cv=none; b=xeWG1mWknZEJJL/1ep4NP/uHKMC2DyxP64rG2cbCgF7vDifknQgl0CtcPKlUUBqI/RRHc1 42BrUppg7yE2pC4APFCBrk1tgYWjYXu5rYzT44m4B066AWNzfZ+L+BTHeQPEj5aDvCBR3l dSICzbC0IP3PslR6P8iMQpYexgD3yt0+heoqUdLz9vAiM6u21IxWa++KdIjyPZ1qF9b4xI OZBHgXwOJMNeOoDP8v1HossdQeipyYtKWwJ2AW9NogRMvvRoOF8m5bh4CYiQYqdcrF00Io vd5bJSrtIjNXyeF5MO2QGJv3iAOWVC8sK2AC/vR+oEQP0+oQNsWYlMlMs9I63A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBsxM2Srwz1BDb; Wed, 8 Feb 2023 21:06:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 318L6VLI068062; Wed, 8 Feb 2023 21:06:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 318L6VYh068061; Wed, 8 Feb 2023 21:06:31 GMT (envelope-from git) Date: Wed, 8 Feb 2023 21:06:31 GMT Message-Id: <202302082106.318L6VYh068061@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 2caac96a666c - stable/12 - ssh: fix double-free caused by compat_kex_proposal() 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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2caac96a666ce99703b16e4d59a417bab8f91d3c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2caac96a666ce99703b16e4d59a417bab8f91d3c commit 2caac96a666ce99703b16e4d59a417bab8f91d3c Author: Ed Maste AuthorDate: 2023-02-06 16:26:08 +0000 Commit: Ed Maste CommitDate: 2023-02-08 21:06:22 +0000 ssh: fix double-free caused by compat_kex_proposal() Security: CVE-2023-25136 Obtained from: OpenSSH-portable commit 12da78233364 Sponsored by: The FreeBSD Foundation (cherry picked from commit fe1371e8f3d7336748d291a7360b2aacce943fb1) (cherry picked from commit 296ec8eae0c834088a491643a937d881bfb4b5dd) --- crypto/openssh/compat.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/crypto/openssh/compat.c b/crypto/openssh/compat.c index 46dfe3a9c2e7..478a9403eeaa 100644 --- a/crypto/openssh/compat.c +++ b/crypto/openssh/compat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: compat.c,v 1.120 2022/07/01 03:35:45 dtucker Exp $ */ +/* $OpenBSD: compat.c,v 1.121 2023/02/02 12:10:05 djm Exp $ */ /* * Copyright (c) 1999, 2000, 2001, 2002 Markus Friedl. All rights reserved. * @@ -190,26 +190,26 @@ compat_pkalg_proposal(struct ssh *ssh, char *pkalg_prop) char * compat_kex_proposal(struct ssh *ssh, char *p) { - char *cp = NULL; + char *cp = NULL, *cp2 = NULL; if ((ssh->compat & (SSH_BUG_CURVE25519PAD|SSH_OLD_DHGEX)) == 0) return xstrdup(p); debug2_f("original KEX proposal: %s", p); if ((ssh->compat & SSH_BUG_CURVE25519PAD) != 0) - if ((p = match_filter_denylist(p, + if ((cp = match_filter_denylist(p, "curve25519-sha256@libssh.org")) == NULL) fatal("match_filter_denylist failed"); if ((ssh->compat & SSH_OLD_DHGEX) != 0) { - cp = p; - if ((p = match_filter_denylist(p, + if ((cp2 = match_filter_denylist(cp ? cp : p, "diffie-hellman-group-exchange-sha256," "diffie-hellman-group-exchange-sha1")) == NULL) fatal("match_filter_denylist failed"); free(cp); + cp = cp2; } - debug2_f("compat KEX proposal: %s", p); - if (*p == '\0') + if (cp == NULL || *cp == '\0') fatal("No supported key exchange algorithms found"); - return p; + debug2_f("compat KEX proposal: %s", cp); + return cp; } From nobody Wed Feb 8 21:06:32 2023 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 4PBsxQ3twbz3pKLc; Wed, 8 Feb 2023 21:06: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 4PBsxQ0v9qz3l3s; Wed, 8 Feb 2023 21:06:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675890394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aRD1qTb0AmTSDfHwBerZ/6QE6Ki/AMz6ZHnZ3hbXd1U=; b=oKQFZxWZbZo5eVP0e/A5SGn6QimxovsWhRgYE2JNw6JlW0fRSn5LhVbv4iyVzbQLSElCSf IcCs28L43L1PUzYDfr+ZtS7P8mLAoGxL7gFZ8sjE/ioOGRk70cwsGOTmCVmOgsXEJs61DD Smn7vr3q/I6psSoDpoTUDWbKhPs8nxkJsJ16oc2he9vjK2Gh5abp/CTltYO4IPHiERUN+7 sobu9Cd26q1Hho1z/PhtDpCS0MZEU5Id+0qipTiBeUYiEVKdzWM3/fmGAvk3RE7PuZ94R4 6AKuwpJ6AL6cvfPBiwqS4sD5Y7jjOLAr7AjCYIkAU3czjN05r0yXdjO03xirIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675890394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aRD1qTb0AmTSDfHwBerZ/6QE6Ki/AMz6ZHnZ3hbXd1U=; b=QLvzvctglA+rlJR6FVGncIyGGfN5eQChl17SZL4UZb/FFBTMNqcizWJfaZT8GRXGbr5tRh FG3G47W0x8OwLuPGg5GM09OBv3hNy5G1VW1mh4UyVqAqZs0IE1yDSsm/qQ/9zxDLYFMwAK C9/sA5UYmVbHZZ193HLjIJcRVEtQmvouwpEhHtpspRA9i6V1Be7ypYd+1TaObnfmqF/Wso yUBN3d2ePgdQSqdBkfMDoBtK9fq4OoAwg5qN+1f467X85xH2r523MRn9OnDfPfBMlwl+AU xs5PC9rvVgiwIKCXpkeEKpdQAd1hhHltP3jMB84j3/n05O2+CCkdYDqNBlKmgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675890394; a=rsa-sha256; cv=none; b=Dao/jqv2cNwW7JfpZ1to8IRCb0BaO5TvrtbsLHiUaMnh3a1sSKkRAX8f3j04+woXrmDt+S 6EVERd27xrNEqDHaSY7ciGjpIHAWNDMrVn1u7szo05jcdsLVyK0uKgWl0TZyOyWKex5VdN UQSZuIT4WYzFKT1tJhVhSBOiBR7+Npb23BlIZFSHtuLoI9atKXjk5W7LU6A5wzybTvq6zQ 4HyS75gHXUX1odVESK3NKuobqoExkhh0wqkAVakR5CbNZAF+P9XeO+I0aYLK4lg9Io/T3l XI+NEL9vTMmyfd9kvQVeoxrQ8T4n3lafeiAPrtODm2/2g0Bj62Y+3MKMEIN2OA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBsxN3R5Pz1BLy; Wed, 8 Feb 2023 21:06:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 318L6WqX068087; Wed, 8 Feb 2023 21:06:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 318L6WjF068086; Wed, 8 Feb 2023 21:06:32 GMT (envelope-from git) Date: Wed, 8 Feb 2023 21:06:32 GMT Message-Id: <202302082106.318L6WjF068086@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: d07cfacb67b9 - stable/12 - ssh: fix bug in PermitRemoteOpen which caused it to ignore... 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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: d07cfacb67b962d80bfe089aab22f5b312a439bd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=d07cfacb67b962d80bfe089aab22f5b312a439bd commit d07cfacb67b962d80bfe089aab22f5b312a439bd Author: Ed Maste AuthorDate: 2023-02-06 16:33:38 +0000 Commit: Ed Maste CommitDate: 2023-02-08 21:06:22 +0000 ssh: fix bug in PermitRemoteOpen which caused it to ignore... its first argument unless it was one of the special keywords "any" or "none". Obtained from: OpenSSH-portable commit b3daa8dc5823 Sponsored by: The FreeBSD Foundation (cherry picked from commit 94e21add45344f0669f910ea77db499e8c892c90) (cherry picked from commit 375bb3704d1371dec08f49cf8767f7b98162da34) --- crypto/openssh/readconf.c | 62 +++++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/crypto/openssh/readconf.c b/crypto/openssh/readconf.c index 4487b1066fa7..2bb38ff70a19 100644 --- a/crypto/openssh/readconf.c +++ b/crypto/openssh/readconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: readconf.c,v 1.369 2022/09/17 10:33:18 djm Exp $ */ +/* $OpenBSD: readconf.c,v 1.371 2023/01/02 07:03:30 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -1577,37 +1577,37 @@ parse_pubkey_algos: case oPermitRemoteOpen: uintptr = &options->num_permitted_remote_opens; cppptr = &options->permitted_remote_opens; - arg = argv_next(&ac, &av); - if (!arg || *arg == '\0') - fatal("%s line %d: missing %s specification", - filename, linenum, lookup_opcode_name(opcode)); uvalue = *uintptr; /* modified later */ - if (strcmp(arg, "any") == 0 || strcmp(arg, "none") == 0) { - if (*activep && uvalue == 0) { - *uintptr = 1; - *cppptr = xcalloc(1, sizeof(**cppptr)); - (*cppptr)[0] = xstrdup(arg); - } - break; - } + i = 0; while ((arg = argv_next(&ac, &av)) != NULL) { arg2 = xstrdup(arg); - p = hpdelim(&arg); - if (p == NULL) { - fatal("%s line %d: missing host in %s", - filename, linenum, - lookup_opcode_name(opcode)); - } - p = cleanhostname(p); - /* - * don't want to use permitopen_port to avoid - * dependency on channels.[ch] here. - */ - if (arg == NULL || - (strcmp(arg, "*") != 0 && a2port(arg) <= 0)) { - fatal("%s line %d: bad port number in %s", - filename, linenum, - lookup_opcode_name(opcode)); + /* Allow any/none only in first position */ + if (strcasecmp(arg, "none") == 0 || + strcasecmp(arg, "any") == 0) { + if (i > 0 || ac > 0) { + error("%s line %d: keyword %s \"%s\" " + "argument must appear alone.", + filename, linenum, keyword, arg); + goto out; + } + } else { + p = hpdelim(&arg); + if (p == NULL) { + fatal("%s line %d: missing host in %s", + filename, linenum, + lookup_opcode_name(opcode)); + } + p = cleanhostname(p); + /* + * don't want to use permitopen_port to avoid + * dependency on channels.[ch] here. + */ + if (arg == NULL || (strcmp(arg, "*") != 0 && + a2port(arg) <= 0)) { + fatal("%s line %d: bad port number " + "in %s", filename, linenum, + lookup_opcode_name(opcode)); + } } if (*activep && uvalue == 0) { opt_array_append(filename, linenum, @@ -1615,7 +1615,11 @@ parse_pubkey_algos: cppptr, uintptr, arg2); } free(arg2); + i++; } + if (i == 0) + fatal("%s line %d: missing %s specification", + filename, linenum, lookup_opcode_name(opcode)); break; case oClearAllForwardings: From nobody Wed Feb 8 21:06:33 2023 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 4PBsxQ604tz3pKTF; Wed, 8 Feb 2023 21:06: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 4PBsxQ0v5Mz3klZ; Wed, 8 Feb 2023 21:06:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675890394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5nflelcDnHpPx9cmhcLXOYZTZQ1fnB3g8+mLuHk4cr8=; b=esWvMvvB6OlADi+ZjwRwVAbpiFYjHddrDVUQe5XUqoiPod2N+oPwGy4pGqUNkVv8CMrvJK Y3F3/mUM+X2a7PnKDp2EYJ+mpj85VtAhmqvx0PyCfcwTmsoehVmWgLZpyoGs2MWVwRIrH0 gDb40rtA/lTGDHcYrHkwWMxLHwSOj9R/e+MTwnneTjh7G2Nl7FJxp0zzUlwXZePQ6pjwmW +69az89+Kp9I5vdkjhcAftioE2loTKgyZrlNox/7HIsL09iPiR2PUZnWXFfZsPZ3+YDYp0 q3UJqADrTA+G//aWR+3zEKYED1T/lEVbpGfweOzNj5VuOG/yrVVmGQy7rhjfSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675890394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5nflelcDnHpPx9cmhcLXOYZTZQ1fnB3g8+mLuHk4cr8=; b=mnNIn88cbNB5gTXmIC9/ciUsOFdWxDzswieXUTKS6Bqkv/C+ph7g/CPLFa8NxI/QN6GfY7 yQUQSDYNDfw+nm6B9kcq3raAl3TfaSgZkem7D7KCgOckL9gxOukj42pgjbeSFqiaI6ezr/ +qSUHjuAGwoiWUvuiXzjBzlMyPGcQbtZk7B//t1Nz9sAwFCtKdcS7yCr98cXKlmhBYthjF C5D02usP8l/JGKJtVyPdoDI5BozfX7xxQsE46Drm5fnZmL1y1aRl43m62ilvn9oeXad2rQ CMY1on+QnTy8tI9SzGYztVXlON8dZzerQRjccpoCzxiJpR8s2fa/aNgMR8SDMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675890394; a=rsa-sha256; cv=none; b=oDd6eUAxkcQnC4n5N8502r8L4OnfAhavMEevFGyOUwH6hl20FtDRCas5Lyh+RY6hq4X5uV t/EKDp/EifXEdq3caV+12R8Z6oHdzL5LRosgbA57akmjpG2R5aIJTmVT+smJMrT6EtW6ym SYyVkooFwX64jx+v3R4MmvMwyrnhBsq9PI7aGprzF6fVArSDYS+GwhYEpP/0RTEX+GA/9j ZivdfdeLoXJ9eEfzQzEW9sqTyBmXpNpDI13bQHrFc5Nbx4WMs/RgGH77BJO0Uvd5XENTiG rF5SLpIiOeodZc4IYH+2S1pNi5FsLq7V/WqzuN6JQkpNJgIk4iUiyXF3ClhDAw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PBsxP4N5Fz1BM0; Wed, 8 Feb 2023 21:06:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 318L6X1a068117; Wed, 8 Feb 2023 21:06:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 318L6XAx068116; Wed, 8 Feb 2023 21:06:33 GMT (envelope-from git) Date: Wed, 8 Feb 2023 21:06:33 GMT Message-Id: <202302082106.318L6XAx068116@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 6cf3164ff3d8 - stable/12 - ssh: Be more paranoid with host/domain names coming from the 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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 6cf3164ff3d838e13dc0d4de583380245057fec6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=6cf3164ff3d838e13dc0d4de583380245057fec6 commit 6cf3164ff3d838e13dc0d4de583380245057fec6 Author: Ed Maste AuthorDate: 2023-02-06 16:45:52 +0000 Commit: Ed Maste CommitDate: 2023-02-08 21:06:23 +0000 ssh: Be more paranoid with host/domain names coming from the never write a name with bad characters to a known_hosts file. replace recently-added valid_domain() check for hostnames going to known_hosts with a more relaxed check for bad characters. Obtained from: OpenSSH-portable commit 445363433ba2 Obtained from: OpenSSH-portable commit 3cae9f92a318 Sponsored by: The FreeBSD Foundation (cherry picked from commit 2e828220579e3ada74ed0613871ec6ec61d669ba) (cherry picked from commit 6ad91c17b0555f0d28377f66fb9f7c8b4cee2b06) --- crypto/openssh/ssh.c | 8 ++++++-- crypto/openssh/sshconnect.c | 15 +++++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/crypto/openssh/ssh.c b/crypto/openssh/ssh.c index 8ae20441205e..c5a4326bd1c6 100644 --- a/crypto/openssh/ssh.c +++ b/crypto/openssh/ssh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh.c,v 1.576 2022/09/17 10:33:18 djm Exp $ */ +/* $OpenBSD: ssh.c,v 1.579 2022/10/24 22:43:36 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -252,6 +252,7 @@ static struct addrinfo * resolve_host(const char *name, int port, int logerr, char *cname, size_t clen) { char strport[NI_MAXSERV]; + const char *errstr = NULL; struct addrinfo hints, *res; int gaierr; LogLevel loglevel = SYSLOG_LEVEL_DEBUG1; @@ -277,7 +278,10 @@ resolve_host(const char *name, int port, int logerr, char *cname, size_t clen) return NULL; } if (cname != NULL && res->ai_canonname != NULL) { - if (strlcpy(cname, res->ai_canonname, clen) >= clen) { + if (!valid_domain(res->ai_canonname, 0, &errstr)) { + error("ignoring bad CNAME \"%s\" for host \"%s\": %s", + res->ai_canonname, name, errstr); + } else if (strlcpy(cname, res->ai_canonname, clen) >= clen) { error_f("host \"%s\" cname \"%s\" too long (max %lu)", name, res->ai_canonname, (u_long)clen); if (clen > 0) diff --git a/crypto/openssh/sshconnect.c b/crypto/openssh/sshconnect.c index 76b85452bfa6..cebe110b9888 100644 --- a/crypto/openssh/sshconnect.c +++ b/crypto/openssh/sshconnect.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sshconnect.c,v 1.358 2022/08/26 08:16:27 djm Exp $ */ +/* $OpenBSD: sshconnect.c,v 1.360 2022/11/03 21:59:20 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -936,7 +936,7 @@ check_host_key(char *hostname, const struct ssh_conn_info *cinfo, char *ip = NULL, *host = NULL; char hostline[1000], *hostp, *fp, *ra; char msg[1024]; - const char *type, *fail_reason; + const char *type, *fail_reason = NULL; const struct hostkey_entry *host_found = NULL, *ip_found = NULL; int len, cancelled_forwarding = 0, confirmed; int local = sockaddr_is_local(hostaddr); @@ -961,6 +961,17 @@ check_host_key(char *hostname, const struct ssh_conn_info *cinfo, return 0; } + /* + * Don't ever try to write an invalid name to a known hosts file. + * Note: do this before get_hostfile_hostname_ipaddr() to catch + * '[' or ']' in the name before they are added. + */ + if (strcspn(hostname, "@?*#[]|'\'\"\\") != strlen(hostname)) { + debug_f("invalid hostname \"%s\"; will not record: %s", + hostname, fail_reason); + readonly = RDONLY; + } + /* * Prepare the hostname and address strings used for hostkey lookup. * In some cases, these will have a port number appended. From nobody Thu Feb 9 07:04:23 2023 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 4PC7CC63YVz3pqXk; Thu, 9 Feb 2023 07:04:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PC7CC5ScGz3xgZ; Thu, 9 Feb 2023 07:04:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675926263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YTTxFG6PWkbqa8WweMa1JUUQZBzK5saHZnrV92Uq2Pk=; b=a7QGmVjfW+fp0DxSO05zsAiVsraYYHHogZYMZzsVqNOL3twCKCAr6HTMcvK0jcxm8b0hIi I2aHJedM9tc15cXfo+FJngZmzsYFMIebRtVUAMJmzd3779Zbg4+rjGNuyj5oDRg7BCJQwr wuyQ0dcU+azNacp5FqTF+QFUXzIX68b5FvPcU8JKVoMDCim6I5AOQ/i16EpU9r6dS8Ktsc AaTMjpJ8O0nENBSBsqWIuC6qR6/QLBuWicglh5RhBchnsOpQsmIoBkUt+ub3xz/YVh5OBu Kpl2ZZKd04C2OqQ4CdiDxH6axJHiKV/064kxrejQ1N/hC2VDTa4LgsiQzrf+QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675926263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YTTxFG6PWkbqa8WweMa1JUUQZBzK5saHZnrV92Uq2Pk=; b=o3cJHDhjx8FOCt7+WWaGyuwWzzjuEnNeKhRQapullyT6ifRZgJotw9MYV7CawO7EaAZMg2 QmH3RCyRNa1l34dMCjPGfqZD1BrFD6Mu7Xd52S5n9ag2lXdKf+14V06921X7887YeQVCZi Tr3PmCGuhBvhWF+eCAukE94U1gkJvCTBvXFynAuhlwFWPk4L5MpL03+1B+SNFrYFmfHQlj FyuNIgzvctIiiQkZR6xPI0T0GIf8YouW5Q5/9lw9FGNQ073n0yUPPOAYU7YvE3QCTEoVEa RhJP0IpUQwIypG697YEe6Uf7F12sIS4KT8cYi4CJOa3P6/Z6i/GXATTrdpapLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675926263; a=rsa-sha256; cv=none; b=Oip4mK4XdAAcd08nqbHn5YTVMzPjvJQChMvmVDFTNZLPc/GgC1VJft6sJAmjvc3L7WbCVK 1SyG+/gki+mZ3YxumZ3zV+rFU/OF8BhULkzy1LisncUUK+162jhiwWSl58DhpDOCGOmBeX lmNMfARBwM2KYPnqQ5txfM83l8o/kfm6637E4o0I1D2m8UG/vLP1gyGVWbTc93eN08T444 zfQFozQq65zsaW0m3ks9NiQl19UYHNb8Kz6mZezGVOz+8ymYyZyytoaiBOqf5PsPS7sHFC 7plLaRADgWZNx+CbmXuilrRocKaJStYjj72OKVRZGQWRr7+d09N279gbn/hQ8g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PC7CC4VwgzSZP; Thu, 9 Feb 2023 07:04:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31974NXk021871; Thu, 9 Feb 2023 07:04:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31974NDH021870; Thu, 9 Feb 2023 07:04:23 GMT (envelope-from git) Date: Thu, 9 Feb 2023 07:04:23 GMT Message-Id: <202302090704.31974NDH021870@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: c592a3b0ae98 - stable/13 - atrtc: expose power loss as sysctl List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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: corvink X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c592a3b0ae98ca90c09f300afde6d705b84ff0d7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=c592a3b0ae98ca90c09f300afde6d705b84ff0d7 commit c592a3b0ae98ca90c09f300afde6d705b84ff0d7 Author: Corvin Köhne AuthorDate: 2022-12-08 07:28:42 +0000 Commit: Corvin Köhne CommitDate: 2023-02-09 07:03:59 +0000 atrtc: expose power loss as sysctl Exposing the a power loss of the rtc as an sysctl makes it easier to detect an empty cmos battery. Reviewed by: manu MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D38325 (cherry picked from commit 55f1ca209d37d7b5a6faf57b23c7341cb7f84ee6) --- sys/x86/isa/atrtc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/x86/isa/atrtc.c b/sys/x86/isa/atrtc.c index aff838c53851..167e7cfbf8fd 100644 --- a/sys/x86/isa/atrtc.c +++ b/sys/x86/isa/atrtc.c @@ -62,6 +62,11 @@ __FBSDID("$FreeBSD$"); #include #endif +/* tunable to detect a power loss of the rtc */ +static bool atrtc_power_lost = false; +SYSCTL_BOOL(_machdep, OID_AUTO, atrtc_power_lost, CTLFLAG_RD, &atrtc_power_lost, + false, "RTC lost power on last power cycle (probably caused by an emtpy cmos battery)"); + /* * atrtc_lock protects low-level access to individual hardware registers. * atrtc_time_lock protects the entire sequence of accessing multiple registers @@ -597,6 +602,7 @@ atrtc_gettime(device_t dev, struct timespec *ts) /* Look if we have a RTC present and the time is valid */ if (!(rtcin(RTC_STATUSD) & RTCSD_PWR)) { + atrtc_power_lost = true; device_printf(dev, "WARNING: Battery failure indication\n"); return (EINVAL); } From nobody Thu Feb 9 07:06:29 2023 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 4PC7Fd6V5Cz3pqmb; Thu, 9 Feb 2023 07:06: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 4PC7Fd60Phz3ymH; Thu, 9 Feb 2023 07:06:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675926389; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iEXEB8wgAH5ib/92Q2Vzxyj9r2KeZi0E2gBM+Ih/Spc=; b=jBvGeBfceJEdATsDY6kqKVtemy9DX/s1S1e2dPpSZkQCpDGaq0v1nLw3GXf9IXwRWTigvC Zn2PJgO2BSkw8Eoc98MGseR0gUCX4fU8qbAqbO2L3i7vOq1WznTyh0enhu/O/42cpQbsK5 7Q9NoqpWw/NsUGkdrLk+uHBR/8Ms02eifVLrq6eg0LBTg8MaF3j4eYLZb0q8q/kfOEToS5 6KwRztoGV7Yk0XapfuNFcOQy/EmXKApZJ4Xr1HTSRu6bqPBPuTN3w0UfPXAnYTQX/9eFfa 8NXvs/vwSICihyxbrRyoajE9NGjFqG22vrvtcKYpWYBk7eC90nIg3cptC1CKfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675926389; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iEXEB8wgAH5ib/92Q2Vzxyj9r2KeZi0E2gBM+Ih/Spc=; b=VxFv0Ff7Xgh8N3Mw4RUg7nKWEw8Ch1OAzNqQgEYNg6GGKY2WAiX4ahEUQgLsZGW9dDGrPQ 1RmAw1iBNlVFoNAs67IKU4ZIt7BoTz5IlE0/srHUWqwyMG9nSoA0G4pReXIYBKByZyYIqm YAcXl9tVqbIZFnQlmJWQNTQmoHAYuf6r7AfBFC/T2KmmzW0a2LtKpEyHP1FDWENsHRYYO9 qC8aZWE99o5GV4zwgoy0KEmtiwdegNZ6VYCV28LLivf3HlnSzAjSHCJ2Ox9Rq9zU3iOEzd GxkLHhcNhuAwC9j1/9C58CZ/6ClTVkisg99bhYo29++Kq3mHFhih81ProjB1Hg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675926389; a=rsa-sha256; cv=none; b=nmEORfsCwZg73czS0oGakUSIwTE05A16n6o/jDlMMazfjEZ6tEYwcgO6b52wICSJQO6TKo 0xTgsvPDslNI0eaMFac8sAKvIALYILqe/q0U3EGmv072iRmPL8zY+GyKQcs3l+kyLcEKOg lNGR148U60pPUTWXS46Z83XQGwyBaSMdWJgra/gmE9ELzNW2L+WjhtOtL5ig5sDA1AdLtF tH3niT2FcRD+lada7vDy+GikDgmebok6/kiQucU429kdK2Nnu3k7LJ3dgoYebFY84ZAPKd QKHhjs0JVRODrpU5R56szpt8l5mS5FQjWmNsOWjiui7UNG5sJXlJLCV+hcFA6A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PC7Fd542zzSZR; Thu, 9 Feb 2023 07:06:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31976TJb022218; Thu, 9 Feb 2023 07:06:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31976TNp022217; Thu, 9 Feb 2023 07:06:29 GMT (envelope-from git) Date: Thu, 9 Feb 2023 07:06:29 GMT Message-Id: <202302090706.31976TNp022217@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Doug Moore Subject: git: 26a9c64d9df9 - stable/13 - iommu_gas: initialize start_gap as first node 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: dougm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 26a9c64d9df9d4e9ac543a5efeca375918fd1cc5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=26a9c64d9df9d4e9ac543a5efeca375918fd1cc5 commit 26a9c64d9df9d4e9ac543a5efeca375918fd1cc5 Author: Doug Moore AuthorDate: 2023-02-08 17:04:13 +0000 Commit: Doug Moore CommitDate: 2023-02-09 07:05:51 +0000 iommu_gas: initialize start_gap as first node In iommu_gas.c, domain->start_gap points to one of the nodes on either side of the first free, unallocated range. In iommu_gas_init_domain, it is initialized to point to the node after the single free range. Change it to point to the node before that free range, so that, when 'lowaddr' is within the initial free range, the first allocation search for free space below 'lowaddr' does not begin and end at an address above 'lowaddr'. This fixes problems on a machine with Intel DMAR enabled. Reported by: jah Reviewed by: dougm Tested by: jah Obtained from: jah Fixes: commit db151ca0c343531256b8839f938a4ecbd8b4fd7e iommu_gas: start space search from 1st free space MFC after: 1 day (cherry picked from commit 87d405eab91169e0b650a7dd2e5097c0b990fac5) --- sys/dev/iommu/iommu_gas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/iommu/iommu_gas.c b/sys/dev/iommu/iommu_gas.c index 86fc3bfa093c..fbef902e2f69 100644 --- a/sys/dev/iommu/iommu_gas.c +++ b/sys/dev/iommu/iommu_gas.c @@ -264,7 +264,7 @@ iommu_gas_init_domain(struct iommu_domain *domain) begin->flags = IOMMU_MAP_ENTRY_PLACE | IOMMU_MAP_ENTRY_UNMAPPED; RB_INSERT_PREV(iommu_gas_entries_tree, &domain->rb_root, end, begin); - domain->start_gap = end; + domain->start_gap = begin; domain->first_place = begin; domain->last_place = end; domain->flags |= IOMMU_DOMAIN_GAS_INITED; From nobody Thu Feb 9 07:56:37 2023 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 4PC8MV32s0z3my5B; Thu, 9 Feb 2023 07:56: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 4PC8MT6WDGz44by; Thu, 9 Feb 2023 07:56:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929397; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+AlRpqsQmJit7TSvVkn9HMyFLLRSrTUwx3cWWcHi99U=; b=H51QAtmKz2WM+6LcDZPKo0UpR7fFMAlFKo8yUDmvHGb5az/xH+x55lufjbXFej5SZRdddv VfIZS/Cs1m3XiNXSaSdRslJx34ZbQHPtOsAhQLPRBoxFRenITxminPCnqvhzZ9xcZNk7nY 0JQWr4M1zgdVPbxGuEfw2LSAWzrajbzH/xTASDW2yfzWwW1fzWJCG83Zp+HK1BBDNfLrV5 suH+CXwcOPwot3IqWVcBAHK4xP++9e1oKBvTTyWNC45VIXSL0J6PacSSH9ylqskmwgZ/q7 uOJ9WCOYzNzu9NJ1eC0yVdMb0SnNgRbugYv3Yk8w4lzNN5KexwVe05zoAhTItQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929397; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+AlRpqsQmJit7TSvVkn9HMyFLLRSrTUwx3cWWcHi99U=; b=xQ8ogyf2Wa5Wv/D4AY44nbB32cNxVb6qGcdLkFhWznAb4N6cj6B8neSpWFJkugiVEONKUp OTcNHgCDMSAoXOoiym466+JSExDgDtg4GJWjeX2uECMfC0eH90yBtEXDgevy05w/wJak1D r48X0JyaYk3xVO+YvQfhrWhzlWUQpkXwpeuy/bjYCveSRWO8nW3sRzSwF6ra6YrC69EsYL 1tQ4gxWyqsbvz1T7YYHtY5XgwSST//8wNslOuL3ycDIwpXEYPkWXVMzA1MU3aUODHzZn8R 7hOCZvbNDfX7T+QkPMW+X+j7WIHA8h0cHyQrkYpoYjpitJWBMHMXuEXrodKg/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675929397; a=rsa-sha256; cv=none; b=rMPKYy+KVxMl6EAGt3UAsHtK229YBv/P8S4vYurloVOqzWTsglmXS9WPl1tbjCvVsjlITQ cWWTk/mvPenG3BiX9ROyy2Abv1sYZnxLEDh5q/g/QgsZAS2v9M7GXqR3WmzE4qEGFYmCCM m2sctatbXkxPhBHZAdtomJWrwlbX41D00m+1VdsoGK71ZIQPNW8IO6yavRScMeGKg3j+4v oh6M55q+Yjb53WBjSuUu+D/utZC620PWxSUGA7l1r4+7tl4ufZmnQ2wy7mTqhYUWlU8J3B oR4ZVaitv9khKG/QDhz0VPaQMzSYSMEIeU2Tn3z9PnuNvl98/sK7TtwqDoJUog== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PC8MT5cYtzVHg; Thu, 9 Feb 2023 07:56:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3197ubkB092772; Thu, 9 Feb 2023 07:56:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3197ubJf092771; Thu, 9 Feb 2023 07:56:37 GMT (envelope-from git) Date: Thu, 9 Feb 2023 07:56:37 GMT Message-Id: <202302090756.3197ubJf092771@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 87271de92c4a - stable/13 - Unstaticize {get,set}_fpcontext() on amd64 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 87271de92c4a69cfe92656c16bbef467e60b8c3b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=87271de92c4a69cfe92656c16bbef467e60b8c3b commit 87271de92c4a69cfe92656c16bbef467e60b8c3b Author: Edward Tomasz Napierala AuthorDate: 2022-01-04 13:25:12 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-09 07:54:16 +0000 Unstaticize {get,set}_fpcontext() on amd64 This will be used to fix Linux signal delivery. Discussed With: kib Sponsored By: EPSRC (cherry picked from commit 562bc0a943d1fad1a9b551557609d2941a851b4d) --- sys/amd64/amd64/exec_machdep.c | 9 ++------- sys/amd64/include/md_var.h | 5 +++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/amd64/amd64/exec_machdep.c b/sys/amd64/amd64/exec_machdep.c index 0c2bebaea8f3..233f222b49f1 100644 --- a/sys/amd64/amd64/exec_machdep.c +++ b/sys/amd64/amd64/exec_machdep.c @@ -95,11 +95,6 @@ __FBSDID("$FreeBSD$"); #include #include -static void get_fpcontext(struct thread *td, mcontext_t *mcp, - char **xfpusave, size_t *xfpusave_len); -static int set_fpcontext(struct thread *td, mcontext_t *mcp, - char *xfpustate, size_t xfpustate_len); - /* * Send an interrupt to process. * @@ -714,7 +709,7 @@ set_mcontext(struct thread *td, mcontext_t *mcp) return (0); } -static void +void get_fpcontext(struct thread *td, mcontext_t *mcp, char **xfpusave, size_t *xfpusave_len) { @@ -735,7 +730,7 @@ get_fpcontext(struct thread *td, mcontext_t *mcp, char **xfpusave, } } -static int +int set_fpcontext(struct thread *td, mcontext_t *mcp, char *xfpustate, size_t xfpustate_len) { diff --git a/sys/amd64/include/md_var.h b/sys/amd64/include/md_var.h index c8610f495bfe..13dedac784d1 100644 --- a/sys/amd64/include/md_var.h +++ b/sys/amd64/include/md_var.h @@ -54,6 +54,7 @@ extern vm_paddr_t KERNend; extern bool efi_boot; +struct __mcontext; struct savefpu; struct sysentvec; @@ -89,5 +90,9 @@ void set_top_of_stack_td(struct thread *td); struct savefpu *get_pcb_user_save_td(struct thread *td); struct savefpu *get_pcb_user_save_pcb(struct pcb *pcb); void pci_early_quirks(void); +void get_fpcontext(struct thread *td, struct __mcontext *mcp, + char **xfpusave, size_t *xfpusave_len); +int set_fpcontext(struct thread *td, struct __mcontext *mcp, + char *xfpustate, size_t xfpustate_len); #endif /* !_MACHINE_MD_VAR_H_ */ From nobody Thu Feb 9 07:56:38 2023 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 4PC8MW3plMz3myL7; Thu, 9 Feb 2023 07:56:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PC8MW0Cpqz44nC; Thu, 9 Feb 2023 07:56:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929399; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aN10wPJ1tOiX5s5mjsLA3EzO3XLBGbThjnhJIPQP1SQ=; b=OILhn7vECif8RGt8vSwtHH6FSPGXvPDTAbd55/ZPliE1xLyLB/2OBx98jvGdS/cXYyaGM3 tWbzpiSEtvgdg85LwFBY5Wmcm+gbkEtkSY8x8lPE0L+tHsuHbtIfTQ+e55NlWbF893jR9K zXaKIMaycS8U7uczsKHWHktuMxlAqud5JYT9JXAVm+CeiJOMLBSfkyIefIXLzLnZEPLcaG gfWlWwKeEnj/diUNAU259yU+GaDSVY1tNrhTlq0bWk+HPwDt5gnY5bhrvvFYem2SKXhkNq dpb1SGf3s614rM9HGPEh2/PQRsvgliL8CKTqhp6BTWve+WTZ2C18XQ2yBPx0ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929399; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aN10wPJ1tOiX5s5mjsLA3EzO3XLBGbThjnhJIPQP1SQ=; b=wdUFYuq6DIkdell9eqQgp25wpn7mO53b8XwRgiKo9Y2Oah6PoftvBiHpHdxurjHNB58m9S dYO2htSY8x7HQXqkK/hpy5o5fCO5Mw5bG3B307RdBIVhkIcJfIr2tObKZASd8g16Sts2NJ k41a+xQebAc4F0xjqC831d+TH+d7FIW862AxbERIM4tJKjm/07UPR5W/ArMD7bw9XnLMYE Ic/REW3V8igeC/dOmw1s1JKQvUsZ3XMbWhdhdMNBCfPm/ui4efJjY6cylTn1nlwMjQoE7S 7HLkj/Z8yFZVy8BcVqBshn4HMajvY3mxLEswHLCNyrVi66cf6fWpfmQ/tK60pQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675929399; a=rsa-sha256; cv=none; b=SS9GA5s6clLYB35jG4yUmuvKxbcS/HQWSrtL+Ss9jyjzvrsmEIvV8ffOE0KWiH+EqT4i8X LwbwmPj2IRnYXLUXy6jqNP6kUnfL1b0YU74CvAQsG1scyvX+YK2ufTH/TbcKjuPlWPxNXT bgVkoEKBLUAgENlNsNy05pAbbmbcydVleDABkS3LaK9If8n/lM3KS8cU49i3MhDrad4Pto lDgZVa3SeLqHT5nKNO1V32r8wVrPUQ0QEKOGlQ16OGzmIaPSfMnuvsyZxrpDLrO+kZIIW5 1W06CgCSC31KgGvWIRHhtXM8JN6RCEWZljLqfYGpLztSYpCowZL2ZDgd+JVp6A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PC8MV67HxzVSt; Thu, 9 Feb 2023 07:56:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3197ucFR092797; Thu, 9 Feb 2023 07:56:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3197uc4M092796; Thu, 9 Feb 2023 07:56:38 GMT (envelope-from git) Date: Thu, 9 Feb 2023 07:56:38 GMT Message-Id: <202302090756.3197uc4M092796@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 68c2bb67fec2 - stable/13 - amd64: Eliminate write only cpu_fxsr. 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 68c2bb67fec2c4838c254fe562a17d8a5c7278f7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=68c2bb67fec2c4838c254fe562a17d8a5c7278f7 commit 68c2bb67fec2c4838c254fe562a17d8a5c7278f7 Author: Dmitry Chagin AuthorDate: 2023-02-01 15:17:06 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-09 07:54:16 +0000 amd64: Eliminate write only cpu_fxsr. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D38289 MFC after: 1 week (cherry picked from commit 5c32146723ef88b07506c081653898cd2f293a52) --- sys/amd64/amd64/initcpu.c | 2 +- sys/i386/i386/npx.c | 1 + sys/i386/include/md_var.h | 1 + sys/x86/include/x86_var.h | 1 - sys/x86/x86/identcpu.c | 1 - 5 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/amd64/amd64/initcpu.c b/sys/amd64/amd64/initcpu.c index cddf8502437e..16780a9e069b 100644 --- a/sys/amd64/amd64/initcpu.c +++ b/sys/amd64/amd64/initcpu.c @@ -279,7 +279,7 @@ initializecpu(void) cr4 = rcr4(); if ((cpu_feature & CPUID_XMM) && (cpu_feature & CPUID_FXSR)) { cr4 |= CR4_FXSR | CR4_XMM; - cpu_fxsr = hw_instruction_sse = 1; + hw_instruction_sse = 1; } if (cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) cr4 |= CR4_FSGSBASE; diff --git a/sys/i386/i386/npx.c b/sys/i386/i386/npx.c index d5a730ce5870..86291ae9b96b 100644 --- a/sys/i386/i386/npx.c +++ b/sys/i386/i386/npx.c @@ -196,6 +196,7 @@ SYSCTL_INT(_hw, OID_AUTO, lazy_fpu_switch, CTLFLAG_RWTUN | CTLFLAG_NOFETCH, &lazy_fpu_switch, 0, "Lazily load FPU context after context switch"); +u_int cpu_fxsr; /* SSE enabled */ int use_xsave; uint64_t xsave_mask; static uma_zone_t fpu_save_area_zone; diff --git a/sys/i386/include/md_var.h b/sys/i386/include/md_var.h index 88b036a9cc24..d4fa7668b5f3 100644 --- a/sys/i386/include/md_var.h +++ b/sys/i386/include/md_var.h @@ -36,6 +36,7 @@ #include +extern u_int cpu_fxsr; extern u_int cyrix_did; #if defined(I586_CPU) && !defined(NO_F00F_HACK) extern int has_f00f_bug; diff --git a/sys/x86/include/x86_var.h b/sys/x86/include/x86_var.h index 756849cbe028..8829543f98a1 100644 --- a/sys/x86/include/x86_var.h +++ b/sys/x86/include/x86_var.h @@ -53,7 +53,6 @@ extern u_int cpu_stdext_feature; extern u_int cpu_stdext_feature2; extern u_int cpu_stdext_feature3; extern uint64_t cpu_ia32_arch_caps; -extern u_int cpu_fxsr; extern u_int cpu_high; extern u_int cpu_id; extern u_int cpu_max_ext_state_size; diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c index 263e05dcf0ae..e608fdb5f20d 100644 --- a/sys/x86/x86/identcpu.c +++ b/sys/x86/x86/identcpu.c @@ -106,7 +106,6 @@ u_int cpu_procinfo; /* HyperThreading Info / Brand Index / CLFUSH */ u_int cpu_procinfo2; /* Multicore info */ char cpu_vendor[20]; /* CPU Origin code */ u_int cpu_vendor_id; /* CPU vendor ID */ -u_int cpu_fxsr; /* SSE enabled */ u_int cpu_mxcsr_mask; /* Valid bits in mxcsr */ u_int cpu_clflush_line_size = 32; u_int cpu_stdext_feature; /* %ebx */ From nobody Thu Feb 9 07:56:39 2023 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 4PC8MX6590z3myB9; Thu, 9 Feb 2023 07:56: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 4PC8MX0vsKz44lB; Thu, 9 Feb 2023 07:56:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929400; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lYrw8DzXQ/1lnSu7OJb7AGGyIkJy0szRvcBqtwLhojA=; b=VBGdFRFdQ448DyognHhA6a+B7fCGrpLMmkTnnXPvQuqTGAVxP5kr/sLpytOVgrw/YnIcEA 9F99ceqdBJR3Ak1wr1iycZKPMGzV9LVGyCLIEs0xBL9T1jfaq3W92p8PfLb1QlWFhCZWfM X7AwlmrRbxQX/sTmxENvpbfvzgLiV1vyH0H8wWojLCdRSEkht54zd2XiTOMGm3uGJOWy23 R1Q4GPj3RlUTOrSbXEAvAlVLU1wrRlVe57lzRQ0wFuWcvxutz18kYRR0eOtsDttMWPMDJP hI6+61zJ9G91FMBpAZaW2Gk3tBOSPBpbgA1c+GMVQn3AstvuluLw2gHPalj72w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929400; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lYrw8DzXQ/1lnSu7OJb7AGGyIkJy0szRvcBqtwLhojA=; b=DaRjIxx8q1WdRL/+pySBJSY67f8G7Zn9bAziS8x3O9EXrX861BkWns7BIwuJYPq+0pLv9d b/rgT3usPw3aF8v4qEKjTZMHxDg65BgniJv/FF0YAOY7axVa1NDLCKmWcfd0h0JT+wbdkj VaIBjCw56MkFDLd3eYOQgmIX+Y4SM1k6vc2rNBv01Tff8Ac5f9xPYaDOsRtz3EuV6yDVoc kTaWMeH6NvPVRULDZfHINEPgDXsGspYW2zXh2e/Oeg8wy9mKLujSivK4tM+5TkFnZH75tK 5pATeIFO5GrJ/JpInSBS06rD7TsTd5jzrJ6tiB6bLblWezO/PA7OwmjkNmbxVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675929400; a=rsa-sha256; cv=none; b=P0gLgfBSxDhuVNtJiAIiP1ARgClNGzMw3Dp+yF0Oe7IKZVSNQvQnSc61y0d7C7ZIVd7xrU 09xLY+CB67NBgaJLtd7pXQ+idtbTDECFRGAn7IIU0KeVhsoWEGgdKaJZr7gRRv8gSSuur+ hb0C3HAVnanYIxW7us6hX7+zVty6Mt6G6tOARIcGwhiZUn7oWqb0kWmIJj0zkIfHhu6WUj vATS7u0FwrsFUestZ22rJEaeEPPhqttdeDv+wqugOjYJkwMzGoRkX2lZ+81rz6mmfm4QQL g9q4+wgklrxdHtfQsLuFFfWkfWcRuFSYWqBawsSnTORMiNzL2s9RXBHOC2VUGA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PC8MW73ZkzVZQ; Thu, 9 Feb 2023 07:56:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3197udC6092821; Thu, 9 Feb 2023 07:56:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3197udV3092820; Thu, 9 Feb 2023 07:56:39 GMT (envelope-from git) Date: Thu, 9 Feb 2023 07:56:39 GMT Message-Id: <202302090756.3197udV3092820@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: e00cdc17345e - stable/13 - linux(4): Deduplicate MI futex structures. 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e00cdc17345e131c94a77cfe6c633b8b2e71ef95 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=e00cdc17345e131c94a77cfe6c633b8b2e71ef95 commit e00cdc17345e131c94a77cfe6c633b8b2e71ef95 Author: Dmitry Chagin AuthorDate: 2023-02-01 18:57:04 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-09 07:54:16 +0000 linux(4): Deduplicate MI futex structures. MFC after: 1 week (cherry picked from commit 575e48f1c4eb05fe8df6aaeb5f55e17c63a02639) --- sys/amd64/linux/linux.h | 11 ----------- sys/amd64/linux32/linux.h | 11 ----------- sys/arm64/linux/linux.h | 11 ----------- sys/compat/linux/linux_futex.h | 11 +++++++++++ sys/i386/linux/linux.h | 11 ----------- sys/i386/linux/linux_copyout.c | 1 + 6 files changed, 12 insertions(+), 44 deletions(-) diff --git a/sys/amd64/linux/linux.h b/sys/amd64/linux/linux.h index c9e28f20ef94..b31b520cb573 100644 --- a/sys/amd64/linux/linux.h +++ b/sys/amd64/linux/linux.h @@ -277,17 +277,6 @@ struct l_ifconf { #define linux_copyout_rusage(r, u) copyout(r, u, sizeof(*r)) -/* robust futexes */ -struct linux_robust_list { - l_uintptr_t next; -}; - -struct linux_robust_list_head { - struct linux_robust_list list; - l_long futex_offset; - l_uintptr_t pending_list; -}; - /* This corresponds to 'struct user_regs_struct' in Linux. */ struct linux_pt_regset { l_ulong r15; diff --git a/sys/amd64/linux32/linux.h b/sys/amd64/linux32/linux.h index 7909c9c2081b..c77897344506 100644 --- a/sys/amd64/linux32/linux.h +++ b/sys/amd64/linux32/linux.h @@ -442,17 +442,6 @@ int linux32_copyinuio(struct l_iovec32 *iovp, l_ulong iovcnt, int linux_copyout_rusage(struct rusage *ru, void *uaddr); #endif /* _KERNEL */ -/* robust futexes */ -struct linux_robust_list { - l_uintptr_t next; -}; - -struct linux_robust_list_head { - struct linux_robust_list list; - l_long futex_offset; - l_uintptr_t pending_list; -}; - /* This corresponds to 'struct user_regs_struct32' in Linux. */ struct linux_pt_regset32 { l_uint ebx; diff --git a/sys/arm64/linux/linux.h b/sys/arm64/linux/linux.h index fe9c9b23e552..8ecadff2e220 100644 --- a/sys/arm64/linux/linux.h +++ b/sys/arm64/linux/linux.h @@ -217,17 +217,6 @@ struct l_ifreq { #define linux_copyout_rusage(r, u) copyout(r, u, sizeof(*r)) -/* robust futexes */ -struct linux_robust_list { - l_uintptr_t next; -}; - -struct linux_robust_list_head { - struct linux_robust_list list; - l_long futex_offset; - l_uintptr_t pending_list; -}; - struct linux_pt_regset { l_ulong x[31]; l_ulong sp; diff --git a/sys/compat/linux/linux_futex.h b/sys/compat/linux/linux_futex.h index 189db4e17c4f..53fe1bfd0955 100644 --- a/sys/compat/linux/linux_futex.h +++ b/sys/compat/linux/linux_futex.h @@ -79,6 +79,17 @@ #define FUTEX_TID_MASK 0x3fffffff #define FUTEX_BITSET_MATCH_ANY 0xffffffff +/* robust futexes */ +struct linux_robust_list { + l_uintptr_t next; +}; + +struct linux_robust_list_head { + struct linux_robust_list list; + l_long futex_offset; + l_uintptr_t pending_list; +}; + int futex_xchgl(int oparg, uint32_t *uaddr, int *oldval); int futex_addl(int oparg, uint32_t *uaddr, int *oldval); int futex_orl(int oparg, uint32_t *uaddr, int *oldval); diff --git a/sys/i386/linux/linux.h b/sys/i386/linux/linux.h index 86fca2976f83..c651da6b5857 100644 --- a/sys/i386/linux/linux.h +++ b/sys/i386/linux/linux.h @@ -395,15 +395,4 @@ struct l_desc_struct { #define linux_copyout_rusage(r, u) copyout(r, u, sizeof(*r)) -/* robust futexes */ -struct linux_robust_list { - struct linux_robust_list *next; -}; - -struct linux_robust_list_head { - struct linux_robust_list list; - l_long futex_offset; - struct linux_robust_list *pending_list; -}; - #endif /* !_I386_LINUX_H_ */ diff --git a/sys/i386/linux/linux_copyout.c b/sys/i386/linux/linux_copyout.c index 6dc98bc8bf5d..5672787d5df7 100644 --- a/sys/i386/linux/linux_copyout.c +++ b/sys/i386/linux/linux_copyout.c @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include From nobody Thu Feb 9 07:56:41 2023 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 4PC8MY4ByVz3mxwn; Thu, 9 Feb 2023 07:56: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 4PC8MY1pMnz44qx; Thu, 9 Feb 2023 07:56:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0SE9TYRTa21TrnLyubEFC57cES/HOKNC7VJNHt7iumU=; b=qhnMdmjswL7+sHpjr742H4gIpwuOtEkmDPQZRrpxw761tei5molLIqr8cz7du0hYyfwiQF V2/UijDyiQAVNnURnXyLw7ylKi727/dbzHJ7anrGHu+2cnba2H7nFymgq3mP1L5/f+wuOh lQriv97ThV//Dlvaj9aJCmxz5x4rd68KPqjkHSiYiTeE79FM1U1KwXPwY1uP8UdkPaZO9d 5bBnK05MRi7QeVJz+D3/a87CqIg55s1LvGRdAULgeXhPSY/wjR/P7L2JgrS/0xWQYtSJ5p a3B3oj/k3eJUeW0l8Kno4h39pGz/lFo4oFiOSxjBfMZ+pmg2N/O5l+oCHRwjiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0SE9TYRTa21TrnLyubEFC57cES/HOKNC7VJNHt7iumU=; b=dUU591vcj1Y5Q6/IqBneJZWqwqeO2YAt2qyXcKWEQSqq7bADN+mW3hzGdCseHfQWxQ91SQ wFPrkalwdggwL8W0wJi5LGonZ/Dy+2lkOsL71urSnljB6XRSg1if9I0kHfBXO/pXNGdDKc VfK92a0YXwwBtKxvjzzJ2sQuSPZwJIxq0LM+XK6SlcSwe4sqDT8S013DK+ICczdmb/GY6m rZVSL9Gj75miczkMDCQXaYA/93Jl+Ef0V9+IpCcZnjfVA1Zc9K9GKzv4N9lC53dcMgYXHm j7dMuw7AFk3+1zfueU2ylslgl1ObEWh3cpSJzEXZccXd1w7OCbFG3WptC1q8UA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675929401; a=rsa-sha256; cv=none; b=nQceAGElz6YHbwfLW00HUR6ZG3ghKajSmcLJmPOo3Q2qUwkVSFbVfPH2gN0PS+FSCG/pQ4 sQhqLqlOwLYjOwzcOCtiIAoGAyubEj+gm+2Auj475ILT4dvkCEloUxjIpjnUPaTZFc4iHJ Wt/5znViNWBp17/n2RFcttkULmc3hjEez9pw/z17DeOtp6R+JWfLItLNisdBWIH/7Z22tE 9h8PCToHSU10tKs9JwQmrjRBIXWG35pWeyJW4LqCpyRNgVQCNwhkG1RiiNInjwTsWBtvWx Ql2ULbPCz2qhpQ2xr2j9S0XezLYO/O8+ONdKdY9ZJXTahmRNYzg5Ml2n1I7skA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PC8MY0vxgzVSv; Thu, 9 Feb 2023 07:56:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3197ufJG092845; Thu, 9 Feb 2023 07:56:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3197uf9w092844; Thu, 9 Feb 2023 07:56:41 GMT (envelope-from git) Date: Thu, 9 Feb 2023 07:56:41 GMT Message-Id: <202302090756.3197uf9w092844@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 4f5d095fb4af - stable/13 - linux(4): Microoptimize linux_elf.h for future use. 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4f5d095fb4afb59dca19c0fb3e5004711538d0bf Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=4f5d095fb4afb59dca19c0fb3e5004711538d0bf commit 4f5d095fb4afb59dca19c0fb3e5004711538d0bf Author: Dmitry Chagin AuthorDate: 2023-02-02 14:58:06 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-09 07:54:16 +0000 linux(4): Microoptimize linux_elf.h for future use. In order to reduce code duplication move coredump support definitions into the appropriate header and hide private definitions. MFC after: 1 week (cherry picked from commit 7446514533a40b376eaeb349ea33531ce9c711c2) --- sys/amd64/linux/linux_sysvec.c | 1 + sys/amd64/linux32/linux32_sysvec.c | 1 + sys/arm64/linux/linux_sysvec.c | 3 +++ sys/compat/linux/linux_elf.c | 28 ++++++++++++++++++++++++---- sys/compat/linux/linux_elf.h | 30 ++++++++---------------------- sys/compat/linux/linux_emul.h | 6 ------ 6 files changed, 37 insertions(+), 32 deletions(-) diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index 60e90c03ad95..eb45fa183f84 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c index dc87d1a8a531..6aa171c3f5ea 100644 --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -82,6 +82,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include diff --git a/sys/arm64/linux/linux_sysvec.c b/sys/arm64/linux/linux_sysvec.c index 2533092b4cfd..bc9b0de9b095 100644 --- a/sys/arm64/linux/linux_sysvec.c +++ b/sys/arm64/linux/linux_sysvec.c @@ -29,6 +29,8 @@ #include __FBSDID("$FreeBSD$"); +#define __ELF_WORD_SIZE 64 + #include #include #include @@ -59,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include diff --git a/sys/compat/linux/linux_elf.c b/sys/compat/linux/linux_elf.c index b02b6e2cc777..e73dbdae888e 100644 --- a/sys/compat/linux/linux_elf.c +++ b/sys/compat/linux/linux_elf.c @@ -61,11 +61,31 @@ __FBSDID("$FreeBSD$"); #include #endif #include -#include -#include -/* This adds "linux32_" and "linux64_" prefixes. */ -#define __linuxN(x) __CONCAT(__CONCAT(__CONCAT(linux,__ELF_WORD_SIZE),_),x) +struct l_elf_siginfo { + l_int si_signo; + l_int si_code; + l_int si_errno; +}; + +typedef struct linux_pt_regset l_elf_gregset_t; + +struct linux_elf_prstatus { + struct l_elf_siginfo pr_info; + l_short pr_cursig; + l_ulong pr_sigpend; + l_ulong pr_sighold; + l_pid_t pr_pid; + l_pid_t pr_ppid; + l_pid_t pr_pgrp; + l_pid_t pr_sid; + l_timeval pr_utime; + l_timeval pr_stime; + l_timeval pr_cutime; + l_timeval pr_cstime; + l_elf_gregset_t pr_reg; + l_int pr_fpvalid; +}; #define LINUX_NT_AUXV 6 diff --git a/sys/compat/linux/linux_elf.h b/sys/compat/linux/linux_elf.h index 4bb9318e360b..18d229d8481e 100644 --- a/sys/compat/linux/linux_elf.h +++ b/sys/compat/linux/linux_elf.h @@ -28,29 +28,15 @@ #ifndef _COMPAT_LINUX_ELF_H_ #define _COMPAT_LINUX_ELF_H_ -struct l_elf_siginfo { - l_int si_signo; - l_int si_code; - l_int si_errno; -}; +struct note_info_list; -typedef struct linux_pt_regset l_elf_gregset_t; +/* Linux core notes are labeled "CORE" */ +#define LINUX_ABI_VENDOR "CORE" -struct linux_elf_prstatus { - struct l_elf_siginfo pr_info; - l_short pr_cursig; - l_ulong pr_sigpend; - l_ulong pr_sighold; - l_pid_t pr_pid; - l_pid_t pr_ppid; - l_pid_t pr_pgrp; - l_pid_t pr_sid; - l_timeval pr_utime; - l_timeval pr_stime; - l_timeval pr_cutime; - l_timeval pr_cstime; - l_elf_gregset_t pr_reg; - l_int pr_fpvalid; -}; +/* This adds "linux32_" and "linux64_" prefixes. */ +#define __linuxN(x) __CONCAT(__CONCAT(__CONCAT(linux,__ELF_WORD_SIZE),_),x) + +void __linuxN(prepare_notes)(struct thread *, struct note_info_list *, + size_t *); #endif diff --git a/sys/compat/linux/linux_emul.h b/sys/compat/linux/linux_emul.h index 9b552ab9c720..fde97c01895f 100644 --- a/sys/compat/linux/linux_emul.h +++ b/sys/compat/linux/linux_emul.h @@ -33,10 +33,6 @@ #define _LINUX_EMUL_H_ struct image_params; -struct note_info_list; - -/* Linux core notes are labeled "CORE" */ -#define LINUX_ABI_VENDOR "CORE" /* * modeled after similar structure in NetBSD @@ -61,8 +57,6 @@ void linux_schedtail(struct thread *); void linux_on_exec(struct proc *, struct image_params *); void linux_thread_dtor(struct thread *); int linux_common_execve(struct thread *, struct image_args *); -void linux32_prepare_notes(struct thread *, struct note_info_list *, size_t *); -void linux64_prepare_notes(struct thread *, struct note_info_list *, size_t *); /* process emuldata flags */ #define LINUX_XDEPR_REQUEUEOP 0x00000001 /* uses deprecated From nobody Thu Feb 9 07:56:42 2023 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 4PC8MZ3nKsz3myJP; Thu, 9 Feb 2023 07:56: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 4PC8MZ2mktz44jf; Thu, 9 Feb 2023 07:56:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929402; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lRTmPVd/TffbxWJ1PEF6jz8070WFwzWGG6tMMQ3YlfE=; b=a6Wq5aq9+wx1mw8qDwqNbQgrcoFhXJXDo1B2aoCfIHVHT7IaNYiqZHGSheIrO6adaANjZx Gu8YCLOa2im2ccwnhHZolcsfjhNxtyYuI+BSSHvrlXYgCR1b0aeiHC5XH+7SvtO9p7+Khm 1JdsxB+xhQ0xRYbm+P1MbmvQcq/m8GkzABPeSTmhCEjXIVo1dH3/dPSMXCiGRVi/wBtATq YWe642b88zLyOjCqkKJ4Kxt9klKzIHUxjUtjVEFKNMy0hIKouqEQRt4vE+yOhxrWvd1Uzv BR/5miYjkyfO9vx9wbWnjI/payqcHc3zsdWr/RxlWSJwNbPLLwxK+5JfU4+jwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929402; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lRTmPVd/TffbxWJ1PEF6jz8070WFwzWGG6tMMQ3YlfE=; b=jdUa9gopsBTZryHu7mMo9Laxfli09UXxyooE09wDtgw8yjNe8557WsYRtTwjqTtgznhSno nrtDng0TEZ1q7tT6OdfvvJuJl+AGZnYUmHNqK2piZL7JzN32VxJR7HSLeMSLs4I+s68HMm 9CAfRmEC9idC91cdTrRlghpTtVqel9rYUlY7Ha1lyxeqxGIn1i8oMr2ASDNVFlK2jUfYhf bQjX9wjjbGTVHSPMiACQN/c5WXheMZp93mWT54wTU1DL3GyKHof4IZjcyamC7s0ExR75Qg Z+Nf+fLvCH3plTzvHixY/WsCOd3xIRv+Kn85gEVZExi1Mbq6hTLQK3bfngjogA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675929402; a=rsa-sha256; cv=none; b=hcyFqm4dfqIXhlHRuRv/oIQVbIA0yTS1XMYmBlgOObd2nvDu9B3l6RmxXmolfBNA1z+lGh 6vLR06rKiRTgulWR3Y5u0gNaBdb4xqiA+y3AMdg2fBxZxobci8+E5GeiydXX11CIGCcIvW aGxF3HLOjsPnlyN0y7hdWFTmB4z2Fkvdm1De92VVYOvsAF5j49a4P6dbfvVm8+nmIvq5o4 ONwMavxrKG4PIq+LIxXL9g/yC73I3wHZqkUnX1GNro47KGCDhZyH2umCSTmglm5lfA6tkf re2Uoq67JUWohHBhr5bCkwO3NrEKCaf1ppuczcCOOS8geAM/jDuJJ1MkgPVMvA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PC8MZ1sTbzVG1; Thu, 9 Feb 2023 07:56:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3197ugDc092869; Thu, 9 Feb 2023 07:56:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3197ugD2092868; Thu, 9 Feb 2023 07:56:42 GMT (envelope-from git) Date: Thu, 9 Feb 2023 07:56:42 GMT Message-Id: <202302090756.3197ugD2092868@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: cc79fd889da4 - stable/13 - linux(4): Use COMPAT_LINUX32 enstead of __ELF_WORD_SIZE. 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cc79fd889da4466a29aa77893a64d64a95ec60b3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=cc79fd889da4466a29aa77893a64d64a95ec60b3 commit cc79fd889da4466a29aa77893a64d64a95ec60b3 Author: Dmitry Chagin AuthorDate: 2023-02-02 14:58:06 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-09 07:54:16 +0000 linux(4): Use COMPAT_LINUX32 enstead of __ELF_WORD_SIZE. COMPAT_LINUX32 option is defined for case when building 32-bit Linuxulator for the 64-bit host. Usage of __ELF_WORD_SIZE is wrong here as it is equal to 32 on i386 too. MFC after: 1 week (cherry picked from commit 6f8439db241c7409275d77f5376e8505967bef67) --- sys/compat/linux/linux_elf.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/compat/linux/linux_elf.c b/sys/compat/linux/linux_elf.c index e73dbdae888e..1da919f02a81 100644 --- a/sys/compat/linux/linux_elf.c +++ b/sys/compat/linux/linux_elf.c @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); #include -#if __ELF_WORD_SIZE == 32 +#ifdef COMPAT_LINUX32 #define linux_pt_regset linux_pt_regset32 #define bsd_to_linux_regset bsd_to_linux_regset32 #include @@ -135,7 +135,7 @@ __linuxN(prepare_notes)(struct thread *td, struct note_info_list *list, } typedef struct linux_elf_prstatus linux_elf_prstatus_t; -#if __ELF_WORD_SIZE == 32 +#ifdef COMPAT_LINUX32 typedef struct prpsinfo32 linux_elf_prpsinfo_t; typedef struct fpreg32 linux_elf_prfpregset_t; #else @@ -212,7 +212,7 @@ __linuxN(note_prstatus)(void *arg, struct sbuf *sb, size_t *sizep) { struct thread *td; linux_elf_prstatus_t *status; -#if __ELF_WORD_SIZE == 32 +#ifdef COMPAT_LINUX32 struct reg32 pr_reg; #else struct reg pr_reg; @@ -229,7 +229,7 @@ __linuxN(note_prstatus)(void *arg, struct sbuf *sb, size_t *sizep) status->pr_cursig = td->td_proc->p_sig; status->pr_pid = td->td_tid; -#if __ELF_WORD_SIZE == 32 +#ifdef COMPAT_LINUX32 fill_regs32(td, &pr_reg); #else fill_regs(td, &pr_reg); @@ -251,7 +251,7 @@ __linuxN(note_fpregset)(void *arg, struct sbuf *sb, size_t *sizep) if (sb != NULL) { KASSERT(*sizep == sizeof(*fpregset), ("invalid size")); fpregset = malloc(sizeof(*fpregset), M_TEMP, M_ZERO | M_WAITOK); -#if __ELF_WORD_SIZE == 32 +#ifdef COMPAT_LINUX32 fill_fpregs32(td, fpregset); #else fill_fpregs(td, fpregset); From nobody Thu Feb 9 07:56:43 2023 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 4PC8Md0y8pz3myDT; Thu, 9 Feb 2023 07:56:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PC8Mb3TZZz44m3; Thu, 9 Feb 2023 07:56:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929403; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wd4KTKEYp7g7K8oBtZUhlbVFhVnMCl7IGzRqCyGCQBE=; b=r88MbllfnXkecNhVGIvdk065yGCBW1UB9VordjPz9pBNfHy4JVPNPGqrGA+aJBSOzTDLl4 gkzGDsEJyEigb4P0y6ODeEp2GQAJyIKmgYwHtx2jWyAKNDcsZTfg9SCNuMHGKg70zGBpb0 dfaJRDvEQWtBqjKUev2vCO/lG+A7ImajPxrKAa0X+UslFRFiDUQR2T9TZQkG/fSlTnCmLM UdOosCLbgTPcZYfGDv9ze8slbGLezmpL8KUZlCl0g7idXZkMf0Ct1YMQPZ1lr77qwtsoqT fmQgWWvzfdI91o5E+ra9uNNZr7mW1/mbCgfqzMRrX6T/LPAwIUkdSBC/vbq+3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929403; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wd4KTKEYp7g7K8oBtZUhlbVFhVnMCl7IGzRqCyGCQBE=; b=JsGCCBdzBSGNs+SoJJqVsauSgklrpsjMImRqZ6YZTBmJ6DsJ3KhuwEwJmH+VfHT/noXns0 BZRfIJ4zjv05gDqUcOpEw6gY2i8cFRxhIL3kueeRSx6JMsWLyyBopGkSpYiIlRPgIVD4nK d9GKIXU2FohoPDsC7TPg2bDo55mtGw4RDwpyfYW3hv4hzXkVzP6Xhw0BJVxKXKfJG0h/qO B3AFSOxVn+s/zkh+7PO4WNx/Bo5uZc4BdrZFKBJn3o9pTbPvy0OzJ9ruqxWKver6y7Hkc8 n7juXElmvpvhS7Ssd75hquaRvsoBaiBeCQZprGt4usn+VJr6rdPgjhErdMFOWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675929403; a=rsa-sha256; cv=none; b=gFHHcv7gQqB1xzqoI1EGpGXDn4YJBiP4oVdMruyRWzDdu/cD5CrjfvwnpuzN0KwmanxoEm PAmyQ7aCPCoJtKtwLu3pQVBICRr9r+XE40Q5uW3A1ygbmYNK0xI91ftt/VZAuBi7dRUdkD EEayrX+PUxmQQmFQBYlkM33uXsbLqXy99ir69XXOhQHsrx9hpv79rbpNQLyfutDlFZEqjQ /DvAs0juL53uLBQ93PcErCqAvFkOkB3jzAOejhmNzI405YoZB/N//Y5VFy56sFGuMiC5Rw oOnL51R3DOmSElOZMLqb09ez5w0KQh4jYbLzSB7CfijuPEKHPxRvjc5sfCpmwg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PC8Mb2ZvyzVSw; Thu, 9 Feb 2023 07:56:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3197uhmh092896; Thu, 9 Feb 2023 07:56:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3197uh6M092895; Thu, 9 Feb 2023 07:56:43 GMT (envelope-from git) Date: Thu, 9 Feb 2023 07:56:43 GMT Message-Id: <202302090756.3197uh6M092895@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: b8c62b5a07e3 - stable/13 - linux(4): Add coredump support to i386. 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b8c62b5a07e333dd08b78361ba763994ec47a5fc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=b8c62b5a07e333dd08b78361ba763994ec47a5fc commit b8c62b5a07e333dd08b78361ba763994ec47a5fc Author: Dmitry Chagin AuthorDate: 2023-02-02 14:58:06 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-09 07:55:18 +0000 linux(4): Add coredump support to i386. MFC after: 1 week (cherry picked from commit cc1b0f7d9626bbd116429014444cbf61edf708a2) --- sys/i386/linux/linux.h | 28 ++++++++++++++++++++++++++++ sys/i386/linux/linux_machdep.c | 26 ++++++++++++++++++++++++++ sys/i386/linux/linux_sysvec.c | 9 ++++++--- sys/modules/linux/Makefile | 2 +- 4 files changed, 61 insertions(+), 4 deletions(-) diff --git a/sys/i386/linux/linux.h b/sys/i386/linux/linux.h index c651da6b5857..43bf3ca126b6 100644 --- a/sys/i386/linux/linux.h +++ b/sys/i386/linux/linux.h @@ -395,4 +395,32 @@ struct l_desc_struct { #define linux_copyout_rusage(r, u) copyout(r, u, sizeof(*r)) +/* This corresponds to 'struct user_regs_struct' in Linux. */ +struct linux_pt_regset { + l_uint ebx; + l_uint ecx; + l_uint edx; + l_uint esi; + l_uint edi; + l_uint ebp; + l_uint eax; + l_uint ds; + l_uint es; + l_uint fs; + l_uint gs; + l_uint orig_eax; + l_uint eip; + l_uint cs; + l_uint eflags; + l_uint esp; + l_uint ss; +}; + +#ifdef _KERNEL +struct reg; + +void bsd_to_linux_regset(const struct reg *b_reg, + struct linux_pt_regset *l_regset); +#endif /* _KERNEL */ + #endif /* !_I386_LINUX_H_ */ diff --git a/sys/i386/linux/linux_machdep.c b/sys/i386/linux/linux_machdep.c index dc156dbd673d..fb42c3e9df84 100644 --- a/sys/i386/linux/linux_machdep.c +++ b/sys/i386/linux/linux_machdep.c @@ -60,6 +60,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include #include @@ -675,3 +677,27 @@ linux_mq_getsetattr(struct thread *td, struct linux_mq_getsetattr_args *args) return (ENOSYS); #endif } + +void +bsd_to_linux_regset(const struct reg *b_reg, + struct linux_pt_regset *l_regset) +{ + + l_regset->ebx = b_reg->r_ebx; + l_regset->ecx = b_reg->r_ecx; + l_regset->edx = b_reg->r_edx; + l_regset->esi = b_reg->r_esi; + l_regset->edi = b_reg->r_edi; + l_regset->ebp = b_reg->r_ebp; + l_regset->eax = b_reg->r_eax; + l_regset->ds = b_reg->r_ds; + l_regset->es = b_reg->r_es; + l_regset->fs = b_reg->r_fs; + l_regset->gs = b_reg->r_gs; + l_regset->orig_eax = b_reg->r_eax; + l_regset->eip = b_reg->r_eip; + l_regset->cs = b_reg->r_cs; + l_regset->eflags = b_reg->r_eflags; + l_regset->esp = b_reg->r_esp; + l_regset->ss = b_reg->r_ss; +} diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index 6726dc2cf0fd..cff9b1c780d5 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -29,6 +29,8 @@ #include __FBSDID("$FreeBSD$"); +#define __ELF_WORD_SIZE 32 + #include #include #include @@ -65,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -803,9 +806,9 @@ struct sysentvec elf_linux_sysvec = { .sv_szsigcode = &linux_szsigcode, .sv_name = "Linux ELF32", .sv_coredump = elf32_coredump, - .sv_elf_core_osabi = ELFOSABI_FREEBSD, - .sv_elf_core_abi_vendor = FREEBSD_ABI_VENDOR, - .sv_elf_core_prepare_notes = elf32_prepare_notes, + .sv_elf_core_osabi = ELFOSABI_NONE, + .sv_elf_core_abi_vendor = LINUX_ABI_VENDOR, + .sv_elf_core_prepare_notes = __linuxN(prepare_notes), .sv_imgact_try = linux_exec_imgact_try, .sv_minsigstksz = LINUX_MINSIGSTKSZ, .sv_minuser = VM_MIN_ADDRESS, diff --git a/sys/modules/linux/Makefile b/sys/modules/linux/Makefile index 2cd7c54cd216..4e41f8e9403c 100644 --- a/sys/modules/linux/Makefile +++ b/sys/modules/linux/Makefile @@ -12,6 +12,7 @@ CFLAGS+=-DCOMPAT_FREEBSD32 -DCOMPAT_LINUX32 KMOD= linux SRCS= linux${SFX}_dummy_machdep.c \ + linux_elf32.c \ linux_event.c \ linux_file.c \ linux_fork.c \ @@ -46,7 +47,6 @@ VDSODEPS=linux_vdso_gettc_x86.inc .endif .if ${MACHINE_CPUARCH} == "amd64" SRCS+= linux${SFX}_support.s -SRCS+= linux_elf32.c .else SRCS+= linux_copyout.c .endif From nobody Thu Feb 9 07:56:44 2023 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 4PC8Md3WCDz3myLQ; Thu, 9 Feb 2023 07:56:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PC8Mc4Q3Zz44mC; Thu, 9 Feb 2023 07:56:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VBuCqBNuVDUjvwt8eIupkCeTOuiN4EvoT5pIpsiw7Q4=; b=e56Mq7AcxqEA7x6O4BS0lMbAeoeiVqtL3V/9qPFWe7f5MOQwaNcs2hbAA9aRkcEduFtz5S LDgqzpPjPY1ElquWFzfTZQ+3R3lQeZDf7yNyddmktBLRygFWc2rmvwZOzn8BwXjhGK3COv Z17z2f5gqREbEB02VitrIHYkm+aujYlR11CR3B/xyrKpx5hPafsARBdKfa/fBiqO/0vVM3 sw2qj8c2JFkmHNbZORXjO8O4k0SGdMVEle+MOCz3Vkio3QZ9espAAP55V9Iq/PXKS8hnr7 ZI8w6OQ7sgou842OW7LH6jnQm5DiV2aReP9il6eKxWgS5CZpG+bxN2KsVlU13A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VBuCqBNuVDUjvwt8eIupkCeTOuiN4EvoT5pIpsiw7Q4=; b=NV5VzJMNQHbbl3A30mcAC4MBHgaGHDTY/cefFkx9VjIRJfAHX28Pvibj2TCxOcEKi1sA8z y4NQm0xVmT080waoEp2zHNWoMVxCwWOWZAlAsoDLwa82eqO0TirWi++gorQp9os9PE1ALl olbxKdTjndnwqqGQ1Ob+8P+QnyB09gXG4lMNZ8nMHDubweG1aUCxTQorORvAdqvAwzx6VW IyRmDRPs+RweuR3L6s6RZNILqG0WzysSq1izXaB+NyUqZQWEnPvnwBV27F/BJsNMHQvQ5d 46cTa2KCFfEHmbq94HTlBYGfyFQUNBF0FBzTwATD+2Y/r5tmQF4gVbC0zZC5zw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675929404; a=rsa-sha256; cv=none; b=p2LbPswrYazh4Wd7WwPyuVy4AxalI+0GbA+fp7/Ba01alEunaM2aQYOvZXTZuy+Miq8QH9 lWiStlZiWmegdSjxn8p8PzA4cW7aCwHMXQ9wdo4RU43zbCz27nSxI7/xP9dciEBXNPW4Tq 0YeSCpakSoIAyQG7ZxvlbL5VPf+gztXhB4APlXS9hhPl5e6EWqOAoqJ5vrUNxqWs7aKcpv rfpi3xTF02EXksuzZUVKM3Zmp2ipO899tMazZhueh+k+51Puum4q7MxYOPAHmA7/136bF1 9Es1U4vBWNHDNhsDCL31bTnDrt0ZLZbcv9+l1K6+dXdOP/KJFzQjW60oJUFZog== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PC8Mc3X9qzV5R; Thu, 9 Feb 2023 07:56:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3197uiSS092923; Thu, 9 Feb 2023 07:56:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3197uiYR092922; Thu, 9 Feb 2023 07:56:44 GMT (envelope-from git) Date: Thu, 9 Feb 2023 07:56:44 GMT Message-Id: <202302090756.3197uiYR092922@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: c671998874ee - stable/13 - linux(4): Deduplicate linux_fixup_elf(). 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c671998874eeeb67be4099162cf6cb1c957db3e8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=c671998874eeeb67be4099162cf6cb1c957db3e8 commit c671998874eeeb67be4099162cf6cb1c957db3e8 Author: Dmitry Chagin AuthorDate: 2023-02-02 14:58:07 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-09 07:55:23 +0000 linux(4): Deduplicate linux_fixup_elf(). Use native routines to fixup initial process stack. On Arm64 linux_elf_fixup() is noop, as it do the stack fixup (room for argc) in the linux_copyout_strings(). MFC after: 1 week (cherry picked from commit 9e550625f867a23ea3d87a77aa3c216b79ecd790) --- sys/amd64/linux/linux_sysvec.c | 18 +----------------- sys/amd64/linux32/linux32_sysvec.c | 17 +---------------- sys/i386/linux/linux_sysvec.c | 17 +---------------- 3 files changed, 3 insertions(+), 49 deletions(-) diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index eb45fa183f84..211bd1533933 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -117,8 +117,6 @@ SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler); static int linux_copyout_strings(struct image_params *imgp, uintptr_t *stack_base); -static int linux_fixup_elf(uintptr_t *stack_base, - struct image_params *iparams); static bool linux_trans_osrel(const Elf_Note *note, int32_t *osrel); static void linux_vdso_install(const void *param); static void linux_vdso_deinstall(const void *param); @@ -269,20 +267,6 @@ linux_copyout_auxargs(struct image_params *imgp, uintptr_t base) return (error); } -static int -linux_fixup_elf(uintptr_t *stack_base, struct image_params *imgp) -{ - Elf_Addr *base; - - base = (Elf64_Addr *)*stack_base; - base--; - if (suword(base, (uint64_t)imgp->args->argc) == -1) - return (EFAULT); - - *stack_base = (uintptr_t)base; - return (0); -} - /* * Copy strings out to the new process address space, constructing new arg * and env vector tables. Return a pointer to the base so that it can be used @@ -704,7 +688,7 @@ linux_vsyscall(struct thread *td) struct sysentvec elf_linux_sysvec = { .sv_size = LINUX_SYS_MAXSYSCALL, .sv_table = linux_sysent, - .sv_fixup = linux_fixup_elf, + .sv_fixup = __elfN(freebsd_fixup), .sv_sendsig = linux_rt_sendsig, .sv_sigcode = &_binary_linux_vdso_so_o_start, .sv_szsigcode = &linux_szsigcode, diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c index 6aa171c3f5ea..432ed51cbb7e 100644 --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -118,8 +118,6 @@ extern const char *linux32_syscallnames[]; SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler); -static int linux_fixup_elf(uintptr_t *stack_base, - struct image_params *iparams); static int linux_copyout_strings(struct image_params *imgp, uintptr_t *stack_base); static void linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask); @@ -210,19 +208,6 @@ linux_copyout_auxargs(struct image_params *imgp, uintptr_t base) return (error); } -static int -linux_fixup_elf(uintptr_t *stack_base, struct image_params *imgp) -{ - Elf32_Addr *base; - - base = (Elf32_Addr *)*stack_base; - base--; - if (suword32(base, (uint32_t)imgp->args->argc) == -1) - return (EFAULT); - *stack_base = (uintptr_t)base; - return (0); -} - static void linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) { @@ -857,7 +842,7 @@ linux32_fixlimit(struct rlimit *rl, int which) struct sysentvec elf_linux_sysvec = { .sv_size = LINUX32_SYS_MAXSYSCALL, .sv_table = linux32_sysent, - .sv_fixup = linux_fixup_elf, + .sv_fixup = elf32_freebsd_fixup, .sv_sendsig = linux_sendsig, .sv_sigcode = &_binary_linux32_vdso_so_o_start, .sv_szsigcode = &linux_szsigcode, diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index cff9b1c780d5..dd924ab8a148 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -105,8 +105,6 @@ SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler); static int linux_fixup(uintptr_t *stack_base, struct image_params *iparams); -static int linux_fixup_elf(uintptr_t *stack_base, - struct image_params *iparams); static void linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask); static void linux_exec_setregs(struct thread *td, struct image_params *imgp, uintptr_t stack); @@ -203,19 +201,6 @@ linux_copyout_auxargs(struct image_params *imgp, uintptr_t base) return (error); } -static int -linux_fixup_elf(uintptr_t *stack_base, struct image_params *imgp) -{ - register_t *base; - - base = (register_t *)*stack_base; - base--; - if (suword(base, (register_t)imgp->args->argc) == -1) - return (EFAULT); - *stack_base = (uintptr_t)base; - return (0); -} - /* * Copied from kern/kern_exec.c */ @@ -800,7 +785,7 @@ INIT_SYSENTVEC(aout_sysvec, &linux_sysvec); struct sysentvec elf_linux_sysvec = { .sv_size = LINUX_SYS_MAXSYSCALL, .sv_table = linux_sysent, - .sv_fixup = linux_fixup_elf, + .sv_fixup = __elfN(freebsd_fixup), .sv_sendsig = linux_sendsig, .sv_sigcode = &_binary_linux_vdso_so_o_start, .sv_szsigcode = &linux_szsigcode, From nobody Thu Feb 9 07:56:45 2023 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 4PC8Md6LWWz3my7l; Thu, 9 Feb 2023 07:56:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PC8Md5TxSz450j; Thu, 9 Feb 2023 07:56:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T+vBVl1iWekNZNjFryCWc8FCsUWf8uMEge9k8TkIQxk=; b=Usyce3WIc343c94FL1BwUMiGKmRN4XBTnqvEE0RfnoHAa+FhtzhKlE0gX259Lzl4RNGKX8 IHnBxVP61msugp9+wJNmiSU1rcAKH550xlS0qIe8v1RTcU8j+M5YqnmlQS9rtZTZv2aI23 phuF1U1gpDUhUOknhQsfgL5CoM79/EkHRUh10GOdp1wFU+3a9Gh4qORpDAghOzPIxs7A8Y mn9yUF5NZnTG7nZKPOijgTe43Y/hIxbzTSDv2qOI0fNtBKY+WMLQKxFOgkrzia3rUy0fAi gGo+f7cYCpMuP1nEZU6Y4mQZfdjd99dSi1M7ldfoO1LigI7kH8/tXMaUIuz0hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T+vBVl1iWekNZNjFryCWc8FCsUWf8uMEge9k8TkIQxk=; b=CCRnM657p9H1/gS7pyGzUpsHAqTbX6tIp1dLX5L7bMHX5DZyuNHlOque/+qbmWF8DLmM6Y COXsgDIGe7libl4HdS62BfO8sX96pLBDoXlUBziw597YE0ZZtORlNQ/h3Fh3SAgd6eNy66 +Lkn2tP7HyvFtytEH9YBYJC/Ccd/tSkggtsQuywpqYq6UPhrlrLlYyuVVdkZ3B3mzDZmxt fMnvCzNcyZmtSD868ZvShsoPNWsaL4/lpoUo1j8bcx2i+ZVkkFqRANw6v2gcjR/Ce34jnw FhqQLSnMQxI+/z+aISoaPxmtSbeSzXTj88UW17+IdvUyvy53SOmaVOrYReVfIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675929405; a=rsa-sha256; cv=none; b=TUkLcNfx0q6ViYy4bfEKKU92oa5Y8yMbdV3hODaiHwsyqSMabkxzTnCmOqEKsvPUewWBtP OdRk4kg2zN5A5dQAoL63gzNZEfcIZCY4SpHZSMut9Tv3ni25arfjWS5WQBpnzskhEWBKNK Z0yCuEbi/VOxC6r8r1OD1y1xTJm8mNE76DaSfduQzKhWAz3rsuhdX+U91bFLgxyWDhq+Wc DrPj/Zf4km2G+jV4lhSz2TNvXK+uP+2i8LtoJA8uuV8n5iRcu9X/8IPv5/Vheq9h6NuQUj YzmzH0rbyx44/UufOcRg1CLfAgAl07sSg2NQOlbWoFM7Lol5HiF7GKpKWz4Bug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PC8Md4JslzVSx; Thu, 9 Feb 2023 07:56:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3197ujDS092947; Thu, 9 Feb 2023 07:56:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3197uj2j092946; Thu, 9 Feb 2023 07:56:45 GMT (envelope-from git) Date: Thu, 9 Feb 2023 07:56:45 GMT Message-Id: <202302090756.3197uj2j092946@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: ee61a8204380 - stable/13 - linux(4): Deduplicate linux_copyout_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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ee61a8204380979fb32a06d35d707211682fafa1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=ee61a8204380979fb32a06d35d707211682fafa1 commit ee61a8204380979fb32a06d35d707211682fafa1 Author: Dmitry Chagin AuthorDate: 2023-02-02 14:58:07 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-09 07:55:23 +0000 linux(4): Deduplicate linux_copyout_strings(). It is still present in the 32-bit Linuxulator on amd64. MFC after: 1 week (cherry picked from commit 6039e966ff276ff6bcb57f2f70e7d8ff376b24fd) --- sys/amd64/linux/linux_sysvec.c | 130 +--------------------------------- sys/arm64/linux/linux_sysvec.c | 143 +------------------------------------- sys/compat/linux/linux_elf.c | 153 +++++++++++++++++++++++++++++++++++++++++ sys/compat/linux/linux_elf.h | 1 + sys/i386/linux/linux_sysvec.c | 122 +------------------------------- 5 files changed, 158 insertions(+), 391 deletions(-) diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index 211bd1533933..45d940a42b51 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -115,8 +115,6 @@ extern const char *linux_syscallnames[]; SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler); -static int linux_copyout_strings(struct image_params *imgp, - uintptr_t *stack_base); static bool linux_trans_osrel(const Elf_Note *note, int32_t *osrel); static void linux_vdso_install(const void *param); static void linux_vdso_deinstall(const void *param); @@ -267,132 +265,6 @@ linux_copyout_auxargs(struct image_params *imgp, uintptr_t base) return (error); } -/* - * Copy strings out to the new process address space, constructing new arg - * and env vector tables. Return a pointer to the base so that it can be used - * as the initial stack pointer. - */ -static int -linux_copyout_strings(struct image_params *imgp, uintptr_t *stack_base) -{ - int argc, envc, error; - char **vectp; - char *stringp; - uintptr_t destp, ustringp; - struct ps_strings *arginfo; - char canary[LINUX_AT_RANDOM_LEN]; - size_t execpath_len; - struct proc *p; - - p = imgp->proc; - arginfo = (struct ps_strings *)PROC_PS_STRINGS(p); - destp = (uintptr_t)arginfo; - - if (imgp->execpath != NULL && imgp->auxargs != NULL) { - execpath_len = strlen(imgp->execpath) + 1; - destp -= execpath_len; - destp = rounddown2(destp, sizeof(void *)); - imgp->execpathp = (void *)destp; - error = copyout(imgp->execpath, imgp->execpathp, execpath_len); - if (error != 0) - return (error); - } - - /* Prepare the canary for SSP. */ - arc4rand(canary, sizeof(canary), 0); - destp -= roundup(sizeof(canary), sizeof(void *)); - imgp->canary = (void *)destp; - error = copyout(canary, imgp->canary, sizeof(canary)); - if (error != 0) - return (error); - - /* Allocate room for the argument and environment strings. */ - destp -= ARG_MAX - imgp->args->stringspace; - destp = rounddown2(destp, sizeof(void *)); - ustringp = destp; - - if (imgp->auxargs) { - /* - * Allocate room on the stack for the ELF auxargs - * array. It has LINUX_AT_COUNT entries. - */ - destp -= LINUX_AT_COUNT * sizeof(Elf64_Auxinfo); - destp = rounddown2(destp, sizeof(void *)); - } - - vectp = (char **)destp; - - /* - * Allocate room for the argv[] and env vectors including the - * terminating NULL pointers. - */ - vectp -= imgp->args->argc + 1 + imgp->args->envc + 1; - - /* - * Starting with 2.24, glibc depends on a 16-byte stack alignment. - * One "long argc" will be prepended later. - */ - vectp = (char **)((((uintptr_t)vectp + 8) & ~0xF) - 8); - - /* vectp also becomes our initial stack base. */ - *stack_base = (uintptr_t)vectp; - - stringp = imgp->args->begin_argv; - argc = imgp->args->argc; - envc = imgp->args->envc; - - /* Copy out strings - arguments and environment. */ - error = copyout(stringp, (void *)ustringp, - ARG_MAX - imgp->args->stringspace); - if (error != 0) - return (error); - - /* Fill in "ps_strings" struct for ps, w, etc. */ - if (suword(&arginfo->ps_argvstr, (long)(intptr_t)vectp) != 0 || - suword(&arginfo->ps_nargvstr, argc) != 0) - return (EFAULT); - - /* Fill in argument portion of vector table. */ - for (; argc > 0; --argc) { - if (suword(vectp++, ustringp) != 0) - return (EFAULT); - while (*stringp++ != 0) - ustringp++; - ustringp++; - } - - /* A null vector table pointer separates the argp's from the envp's. */ - if (suword(vectp++, 0) != 0) - return (EFAULT); - - if (suword(&arginfo->ps_envstr, (long)(intptr_t)vectp) != 0 || - suword(&arginfo->ps_nenvstr, envc) != 0) - return (EFAULT); - - /* Fill in environment portion of vector table. */ - for (; envc > 0; --envc) { - if (suword(vectp++, ustringp) != 0) - return (EFAULT); - while (*stringp++ != 0) - ustringp++; - ustringp++; - } - - /* The end of the vector table is a null pointer. */ - if (suword(vectp, 0) != 0) - return (EFAULT); - - if (imgp->auxargs) { - vectp++; - error = imgp->sysent->sv_copyout_auxargs(imgp, - (uintptr_t)vectp); - if (error != 0) - return (error); - } - - return (0); -} - /* * Reset registers to default values on exec. */ @@ -706,7 +578,7 @@ struct sysentvec elf_linux_sysvec = { .sv_psstringssz = sizeof(struct ps_strings), .sv_stackprot = VM_PROT_ALL, .sv_copyout_auxargs = linux_copyout_auxargs, - .sv_copyout_strings = linux_copyout_strings, + .sv_copyout_strings = __linuxN(copyout_strings), .sv_setregs = linux_exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, diff --git a/sys/arm64/linux/linux_sysvec.c b/sys/arm64/linux/linux_sysvec.c index bc9b0de9b095..7bf0dbca6eda 100644 --- a/sys/arm64/linux/linux_sysvec.c +++ b/sys/arm64/linux/linux_sysvec.c @@ -105,10 +105,6 @@ extern const char *linux_syscallnames[]; SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler); -static int linux_copyout_strings(struct image_params *imgp, - uintptr_t *stack_base); -static int linux_elf_fixup(uintptr_t *stack_base, - struct image_params *iparams); static bool linux_trans_osrel(const Elf_Note *note, int32_t *osrel); static void linux_vdso_install(const void *param); static void linux_vdso_deinstall(const void *param); @@ -127,7 +123,6 @@ LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); /* DTrace probes */ LIN_SDT_PROBE_DEFINE0(sysvec, linux_exec_setregs, todo); LIN_SDT_PROBE_DEFINE0(sysvec, linux_copyout_auxargs, todo); -LIN_SDT_PROBE_DEFINE0(sysvec, linux_elf_fixup, todo); LINUX_VDSO_SYM_CHAR(linux_platform); LINUX_VDSO_SYM_INTPTR(kern_timekeep_base); @@ -223,140 +218,6 @@ linux_copyout_auxargs(struct image_params *imgp, uintptr_t base) return (error); } -static int -linux_elf_fixup(uintptr_t *stack_base, struct image_params *imgp) -{ - - LIN_SDT_PROBE0(sysvec, linux_elf_fixup, todo); - - return (0); -} - -/* - * Copy strings out to the new process address space, constructing new arg - * and env vector tables. Return a pointer to the base so that it can be used - * as the initial stack pointer. - * LINUXTODO: deduplicate against other linuxulator archs - */ -static int -linux_copyout_strings(struct image_params *imgp, uintptr_t *stack_base) -{ - char **vectp; - char *stringp; - uintptr_t destp, ustringp; - struct ps_strings *arginfo; - char canary[LINUX_AT_RANDOM_LEN]; - size_t execpath_len; - struct proc *p; - int argc, envc, error; - - p = imgp->proc; - arginfo = (struct ps_strings *)PROC_PS_STRINGS(p); - destp = (uintptr_t)arginfo; - - if (imgp->execpath != NULL && imgp->auxargs != NULL) { - execpath_len = strlen(imgp->execpath) + 1; - destp -= execpath_len; - destp = rounddown2(destp, sizeof(void *)); - imgp->execpathp = (void *)destp; - error = copyout(imgp->execpath, imgp->execpathp, execpath_len); - if (error != 0) - return (error); - } - - /* Prepare the canary for SSP. */ - arc4rand(canary, sizeof(canary), 0); - destp -= roundup(sizeof(canary), sizeof(void *)); - imgp->canary = (void *)destp; - error = copyout(canary, imgp->canary, sizeof(canary)); - if (error != 0) - return (error); - - /* Allocate room for the argument and environment strings. */ - destp -= ARG_MAX - imgp->args->stringspace; - destp = rounddown2(destp, sizeof(void *)); - ustringp = destp; - - if (imgp->auxargs) { - /* - * Allocate room on the stack for the ELF auxargs - * array. It has up to LINUX_AT_COUNT entries. - */ - destp -= LINUX_AT_COUNT * sizeof(Elf64_Auxinfo); - destp = rounddown2(destp, sizeof(void *)); - } - - vectp = (char **)destp; - - /* - * Allocate room for argc and the argv[] and env vectors including the - * terminating NULL pointers. - */ - vectp -= 1 + imgp->args->argc + 1 + imgp->args->envc + 1; - vectp = (char **)STACKALIGN(vectp); - - /* vectp also becomes our initial stack base. */ - *stack_base = (uintptr_t)vectp; - - stringp = imgp->args->begin_argv; - argc = imgp->args->argc; - envc = imgp->args->envc; - - /* Copy out strings - arguments and environment. */ - error = copyout(stringp, (void *)ustringp, - ARG_MAX - imgp->args->stringspace); - if (error != 0) - return (error); - - /* Fill in "ps_strings" struct for ps, w, etc. */ - if (suword(&arginfo->ps_argvstr, (long)(intptr_t)vectp) != 0 || - suword(&arginfo->ps_nargvstr, argc) != 0) - return (EFAULT); - - if (suword(vectp++, argc) != 0) - return (EFAULT); - - /* Fill in argument portion of vector table. */ - for (; argc > 0; --argc) { - if (suword(vectp++, ustringp) != 0) - return (EFAULT); - while (*stringp++ != 0) - ustringp++; - ustringp++; - } - - /* A null vector table pointer separates the argp's from the envp's. */ - if (suword(vectp++, 0) != 0) - return (EFAULT); - - if (suword(&arginfo->ps_envstr, (long)(intptr_t)vectp) != 0 || - suword(&arginfo->ps_nenvstr, envc) != 0) - return (EFAULT); - - /* Fill in environment portion of vector table. */ - for (; envc > 0; --envc) { - if (suword(vectp++, ustringp) != 0) - return (EFAULT); - while (*stringp++ != 0) - ustringp++; - ustringp++; - } - - /* The end of the vector table is a null pointer. */ - if (suword(vectp, 0) != 0) - return (EFAULT); - - if (imgp->auxargs) { - vectp++; - error = imgp->sysent->sv_copyout_auxargs(imgp, - (uintptr_t)vectp); - if (error != 0) - return (error); - } - - return (0); -} - /* * Reset registers to default values on exec. */ @@ -552,7 +413,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) struct sysentvec elf_linux_sysvec = { .sv_size = LINUX_SYS_MAXSYSCALL, .sv_table = linux_sysent, - .sv_fixup = linux_elf_fixup, + .sv_fixup = __elfN(freebsd_fixup), .sv_sendsig = linux_rt_sendsig, .sv_sigcode = &_binary_linux_vdso_so_o_start, .sv_szsigcode = &linux_szsigcode, @@ -570,7 +431,7 @@ struct sysentvec elf_linux_sysvec = { .sv_psstringssz = sizeof(struct ps_strings), .sv_stackprot = VM_PROT_READ | VM_PROT_WRITE, .sv_copyout_auxargs = linux_copyout_auxargs, - .sv_copyout_strings = linux_copyout_strings, + .sv_copyout_strings = __linuxN(copyout_strings), .sv_setregs = linux_exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, diff --git a/sys/compat/linux/linux_elf.c b/sys/compat/linux/linux_elf.c index 1da919f02a81..3e0582e2b8c3 100644 --- a/sys/compat/linux/linux_elf.c +++ b/sys/compat/linux/linux_elf.c @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -50,6 +51,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include + +#include +#include +#include #include @@ -61,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include +#include struct l_elf_siginfo { l_int si_signo; @@ -312,3 +319,149 @@ __linuxN(note_nt_auxv)(void *arg, struct sbuf *sb, size_t *sizep) PRELE(p); } } + +/* + * Copy strings out to the new process address space, constructing new arg + * and env vector tables. Return a pointer to the base so that it can be used + * as the initial stack pointer. + */ +int +__linuxN(copyout_strings)(struct image_params *imgp, uintptr_t *stack_base) +{ + char canary[LINUX_AT_RANDOM_LEN]; + char **vectp; + char *stringp; + uintptr_t destp, ustringp; + struct ps_strings *arginfo; + struct proc *p; + size_t execpath_len; + int argc, envc; + int error; + + p = imgp->proc; + destp = PROC_PS_STRINGS(p); + arginfo = imgp->ps_strings = (void *)destp; + + /* + * Copy the image path for the rtld. + */ + if (imgp->execpath != NULL && imgp->auxargs != NULL) { + execpath_len = strlen(imgp->execpath) + 1; + destp -= execpath_len; + destp = rounddown2(destp, sizeof(void *)); + imgp->execpathp = (void *)destp; + error = copyout(imgp->execpath, imgp->execpathp, execpath_len); + if (error != 0) + return (error); + } + + /* + * Prepare the canary for SSP. + */ + arc4rand(canary, sizeof(canary), 0); + destp -= sizeof(canary); + imgp->canary = (void *)destp; + error = copyout(canary, imgp->canary, sizeof(canary)); + if (error != 0) + return (error); + imgp->canarylen = sizeof(canary); + + /* + * Allocate room for the argument and environment strings. + */ + destp -= ARG_MAX - imgp->args->stringspace; + destp = rounddown2(destp, sizeof(void *)); + ustringp = destp; + + if (imgp->auxargs) { + /* + * Allocate room on the stack for the ELF auxargs + * array. It has up to LINUX_AT_COUNT entries. + */ + destp -= LINUX_AT_COUNT * sizeof(Elf_Auxinfo); + destp = rounddown2(destp, sizeof(void *)); + } + + vectp = (char **)destp; + + /* + * Allocate room for the argv[] and env vectors including the + * terminating NULL pointers. + */ + vectp -= imgp->args->argc + 1 + imgp->args->envc + 1; + + /* + * Starting with 2.24, glibc depends on a 16-byte stack alignment. + */ + vectp = (char **)((((uintptr_t)vectp + 8) & ~0xF) - 8); + + /* + * vectp also becomes our initial stack base + */ + *stack_base = (uintptr_t)vectp; + + stringp = imgp->args->begin_argv; + argc = imgp->args->argc; + envc = imgp->args->envc; + + /* + * Copy out strings - arguments and environment. + */ + error = copyout(stringp, (void *)ustringp, + ARG_MAX - imgp->args->stringspace); + if (error != 0) + return (error); + + /* + * Fill in "ps_strings" struct for ps, w, etc. + */ + imgp->argv = vectp; + if (suword(&arginfo->ps_argvstr, (long)(intptr_t)vectp) != 0 || + suword32(&arginfo->ps_nargvstr, argc) != 0) + return (EFAULT); + + /* + * Fill in argument portion of vector table. + */ + for (; argc > 0; --argc) { + if (suword(vectp++, ustringp) != 0) + return (EFAULT); + while (*stringp++ != 0) + ustringp++; + ustringp++; + } + + /* a null vector table pointer separates the argp's from the envp's */ + if (suword(vectp++, 0) != 0) + return (EFAULT); + + imgp->envv = vectp; + if (suword(&arginfo->ps_envstr, (long)(intptr_t)vectp) != 0 || + suword32(&arginfo->ps_nenvstr, envc) != 0) + return (EFAULT); + + /* + * Fill in environment portion of vector table. + */ + for (; envc > 0; --envc) { + if (suword(vectp++, ustringp) != 0) + return (EFAULT); + while (*stringp++ != 0) + ustringp++; + ustringp++; + } + + /* end of vector table is a null pointer */ + if (suword(vectp, 0) != 0) + return (EFAULT); + + if (imgp->auxargs) { + vectp++; + error = imgp->sysent->sv_copyout_auxargs(imgp, + (uintptr_t)vectp); + if (error != 0) + return (error); + } + + return (0); +} diff --git a/sys/compat/linux/linux_elf.h b/sys/compat/linux/linux_elf.h index 18d229d8481e..e0905983070b 100644 --- a/sys/compat/linux/linux_elf.h +++ b/sys/compat/linux/linux_elf.h @@ -38,5 +38,6 @@ struct note_info_list; void __linuxN(prepare_notes)(struct thread *, struct note_info_list *, size_t *); +int __linuxN(copyout_strings)(struct image_params *, uintptr_t *); #endif diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index dd924ab8a148..dc41b9595003 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -111,8 +111,6 @@ static void linux_exec_setregs(struct thread *td, static void linux_exec_sysvec_init(void *param); static int linux_on_exec_vmspace(struct proc *p, struct image_params *imgp); -static int linux_copyout_strings(struct image_params *imgp, - uintptr_t *stack_base); static void linux_set_fork_retval(struct thread *td); static bool linux_trans_osrel(const Elf_Note *note, int32_t *osrel); static void linux_vdso_install(const void *param); @@ -201,124 +199,6 @@ linux_copyout_auxargs(struct image_params *imgp, uintptr_t base) return (error); } -/* - * Copied from kern/kern_exec.c - */ -static int -linux_copyout_strings(struct image_params *imgp, uintptr_t *stack_base) -{ - int argc, envc, error; - char **vectp; - char *stringp; - uintptr_t destp, ustringp; - struct ps_strings *arginfo; - char canary[LINUX_AT_RANDOM_LEN]; - size_t execpath_len; - struct proc *p; - - p = imgp->proc; - arginfo = (struct ps_strings *)PROC_PS_STRINGS(p); - destp = (uintptr_t)arginfo; - - if (imgp->execpath != NULL && imgp->auxargs != NULL) { - execpath_len = strlen(imgp->execpath) + 1; - destp -= execpath_len; - destp = rounddown2(destp, sizeof(void *)); - imgp->execpathp = (void *)destp; - error = copyout(imgp->execpath, imgp->execpathp, execpath_len); - if (error != 0) - return (error); - } - - /* Prepare the canary for SSP. */ - arc4rand(canary, sizeof(canary), 0); - destp -= roundup(sizeof(canary), sizeof(void *)); - imgp->canary = (void *)destp; - error = copyout(canary, imgp->canary, sizeof(canary)); - if (error != 0) - return (error); - - /* Allocate room for the argument and environment strings. */ - destp -= ARG_MAX - imgp->args->stringspace; - destp = rounddown2(destp, sizeof(void *)); - ustringp = destp; - - if (imgp->auxargs) { - /* - * Allocate room on the stack for the ELF auxargs - * array. It has LINUX_AT_COUNT entries. - */ - destp -= LINUX_AT_COUNT * sizeof(Elf32_Auxinfo); - destp = rounddown2(destp, sizeof(void *)); - } - - vectp = (char **)destp; - - /* - * Allocate room for the argv[] and env vectors including the - * terminating NULL pointers. - */ - vectp -= imgp->args->argc + 1 + imgp->args->envc + 1; - - /* vectp also becomes our initial stack base. */ - *stack_base = (uintptr_t)vectp; - - stringp = imgp->args->begin_argv; - argc = imgp->args->argc; - envc = imgp->args->envc; - - /* Copy out strings - arguments and environment. */ - error = copyout(stringp, (void *)ustringp, - ARG_MAX - imgp->args->stringspace); - if (error != 0) - return (error); - - /* Fill in "ps_strings" struct for ps, w, etc. */ - if (suword(&arginfo->ps_argvstr, (long)(intptr_t)vectp) != 0 || - suword(&arginfo->ps_nargvstr, argc) != 0) - return (EFAULT); - - /* Fill in argument portion of vector table. */ - for (; argc > 0; --argc) { - if (suword(vectp++, ustringp) != 0) - return (EFAULT); - while (*stringp++ != 0) - ustringp++; - ustringp++; - } - - /* A null vector table pointer separates the argp's from the envp's. */ - if (suword(vectp++, 0) != 0) - return (EFAULT); - - if (suword(&arginfo->ps_envstr, (long)(intptr_t)vectp) != 0 || - suword(&arginfo->ps_nenvstr, envc) != 0) - return (EFAULT); - - /* Fill in environment portion of vector table. */ - for (; envc > 0; --envc) { - if (suword(vectp++, ustringp) != 0) - return (EFAULT); - while (*stringp++ != 0) - ustringp++; - ustringp++; - } - - /* The end of the vector table is a null pointer. */ - if (suword(vectp, 0) != 0) - return (EFAULT); - - if (imgp->auxargs) { - vectp++; - error = imgp->sysent->sv_copyout_auxargs(imgp, - (uintptr_t)vectp); - if (error != 0) - return (error); - } - - return (0); -} - static void linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) { @@ -803,7 +683,7 @@ struct sysentvec elf_linux_sysvec = { .sv_psstringssz = sizeof(struct ps_strings), .sv_stackprot = VM_PROT_ALL, .sv_copyout_auxargs = linux_copyout_auxargs, - .sv_copyout_strings = linux_copyout_strings, + .sv_copyout_strings = __linuxN(copyout_strings), .sv_setregs = linux_exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, From nobody Thu Feb 9 07:56:46 2023 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 4PC8Mf6sNJz3myBK; Thu, 9 Feb 2023 07:56: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 4PC8Mf5vz4z44kX; Thu, 9 Feb 2023 07:56:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EfW3nLy4DAwQW4+uDo2dRS5vN1LFge8HkDEU3FwktJY=; b=nhGIZPD1t3B31sqjxVm697aw9SNW0yvUa4GlI6+ZkL6lQ+wWVH1L3lzKT+g3WWTUXMXCeP gv34YUqDaRZRGqvS57nr3nx0iOZrBhpk36GWYUuV7+rTt0ciIkce/3L1UCKlOznaBK22Ng kvhwOOAmgaCRseIwdRMyNZJcGIUQzYSL5euSsa0kIp7qwpRUQrlBk3JDy//EHUlN2e3xzG x/2HAq47LH1OoJKIw0H41Mi3nWMJlBZ1TE68lpy0xflSwdxjDBrmX93T82trbu8xtuu2Bs uGytbSfjuiV6I1gxkrNgWor1AFqiO4wYztBf6+IQKEocXWdT44eFBcxyEjeLiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EfW3nLy4DAwQW4+uDo2dRS5vN1LFge8HkDEU3FwktJY=; b=u8S7KeLaZePn1LvQi2/HIkn+svl6Jrd1pjeITphhQekrSSI08XDj7XSEAzrOFN6e3h5hkz NnhjYqJIw5oBno3rrrqCszopcZFXcylly2JdTSDBcuHusnpZvrJU+5XFDyNQkZMj6IQtXK kp0RbJnqWKJ9x80uZMnRooxZmAcpUI2cuWq0hj/0PjVeTdYYVuqYhHEYmbPlYLmnuJt2Jp LLE5+3A+17AmpORMI5l3XuFvg5hMzRtjbY18M6LFibPfAWfq5bva6BIKO3fnFUXnODJbth /mCy+kocKI5lvQVGZLKGFTmQot31L7XlvK3daBoK800c687kphthSJ3DFJOHnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675929406; a=rsa-sha256; cv=none; b=tz5gW5yPSDTdcZLN8PU7bRv3kFs3rE/T43yxmd2Ichzm6JuWUvIDDjOsa9dHDIlgrqSGsV 2vgVsvzTdF/sv851mAaRDiqWpDFuJel5rk6PBHLQsNaCNSLNyN0TJq8fG/vfQCf4UY2U/w 43PZbmznmovE/LRI9kWX2hFEaHDyMm1FWWPJd6e98K01eMB1J4tIapkaaNxcdDxBfi4rMZ JLAfelmuOS3tXkhDvUlyyOjFNdIZW9Z/rpBC8d3iROGO+fMZ2dfq8/8ujesMtsPnjjJ9q2 k3F4oT18EsMo7zHKpfsv3C6hZxS91Gy1rjxO2C1bp5+ilO+yCs29snQjZ103FQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PC8Mf50gZzVHh; Thu, 9 Feb 2023 07:56:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3197uk34092971; Thu, 9 Feb 2023 07:56:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3197ukiu092970; Thu, 9 Feb 2023 07:56:46 GMT (envelope-from git) Date: Thu, 9 Feb 2023 07:56:46 GMT Message-Id: <202302090756.3197ukiu092970@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 7125bd6e9f20 - stable/13 - linux(4): Deduplicate linux_trans_osrel(). 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7125bd6e9f20473b1b161499e8235843fc62ae5e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=7125bd6e9f20473b1b161499e8235843fc62ae5e commit 7125bd6e9f20473b1b161499e8235843fc62ae5e Author: Dmitry Chagin AuthorDate: 2023-02-02 14:58:07 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-09 07:55:24 +0000 linux(4): Deduplicate linux_trans_osrel(). MFC after: 1 week (cherry picked from commit 95b8603427d5759c5d6090ffaacfaf7f3b8fb926) --- sys/amd64/linux/linux_sysvec.c | 31 ++----------------------------- sys/amd64/linux32/linux32_sysvec.c | 29 +---------------------------- sys/arm64/linux/linux_sysvec.c | 22 ---------------------- sys/compat/linux/linux_elf.c | 23 +++++++++++++++++++++++ sys/compat/linux/linux_elf.h | 5 +++++ sys/i386/linux/linux_sysvec.c | 27 --------------------------- 6 files changed, 31 insertions(+), 106 deletions(-) diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index 45d940a42b51..4fe2bfb78f7f 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -115,7 +115,6 @@ extern const char *linux_syscallnames[]; SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler); -static bool linux_trans_osrel(const Elf_Note *note, int32_t *osrel); static void linux_vdso_install(const void *param); static void linux_vdso_deinstall(const void *param); static void linux_vdso_reloc(char *mapping, Elf_Addr offset); @@ -736,37 +735,11 @@ linux_vdso_reloc(char *mapping, Elf_Addr offset) } } -static char GNULINUX_ABI_VENDOR[] = "GNU"; -static int GNULINUX_ABI_DESC = 0; - -static bool -linux_trans_osrel(const Elf_Note *note, int32_t *osrel) -{ - const Elf32_Word *desc; - uintptr_t p; - - p = (uintptr_t)(note + 1); - p += roundup2(note->n_namesz, sizeof(Elf32_Addr)); - - desc = (const Elf32_Word *)p; - if (desc[0] != GNULINUX_ABI_DESC) - return (false); - - /* - * For Linux we encode osrel using the Linux convention of - * (version << 16) | (major << 8) | (minor) - * See macro in linux_mib.h - */ - *osrel = LINUX_KERNVER(desc[1], desc[2], desc[3]); - - return (true); -} - static Elf_Brandnote linux64_brandnote = { - .hdr.n_namesz = sizeof(GNULINUX_ABI_VENDOR), + .hdr.n_namesz = sizeof(GNU_ABI_VENDOR), .hdr.n_descsz = 16, .hdr.n_type = 1, - .vendor = GNULINUX_ABI_VENDOR, + .vendor = GNU_ABI_VENDOR, .flags = BN_TRANSLATE_OSREL, .trans_osrel = linux_trans_osrel }; diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c index 432ed51cbb7e..c2b54369552f 100644 --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -127,7 +127,6 @@ static void linux_exec_sysvec_init(void *param); static int linux_on_exec_vmspace(struct proc *p, struct image_params *imgp); static void linux32_fixlimit(struct rlimit *rl, int which); -static bool linux32_trans_osrel(const Elf_Note *note, int32_t *osrel); static void linux_vdso_install(const void *param); static void linux_vdso_deinstall(const void *param); static void linux_vdso_reloc(char *mapping, Elf_Addr offset); @@ -1015,39 +1014,13 @@ linux_vdso_reloc(char *mapping, Elf_Addr offset) } } -static char GNU_ABI_VENDOR[] = "GNU"; -static int GNULINUX_ABI_DESC = 0; - -static bool -linux32_trans_osrel(const Elf_Note *note, int32_t *osrel) -{ - const Elf32_Word *desc; - uintptr_t p; - - p = (uintptr_t)(note + 1); - p += roundup2(note->n_namesz, sizeof(Elf32_Addr)); - - desc = (const Elf32_Word *)p; - if (desc[0] != GNULINUX_ABI_DESC) - return (false); - - /* - * For Linux we encode osrel using the Linux convention of - * (version << 16) | (major << 8) | (minor) - * See macro in linux_mib.h - */ - *osrel = LINUX_KERNVER(desc[1], desc[2], desc[3]); - - return (true); -} - static Elf_Brandnote linux32_brandnote = { .hdr.n_namesz = sizeof(GNU_ABI_VENDOR), .hdr.n_descsz = 16, /* XXX at least 16 */ .hdr.n_type = 1, .vendor = GNU_ABI_VENDOR, .flags = BN_TRANSLATE_OSREL, - .trans_osrel = linux32_trans_osrel + .trans_osrel = linux_trans_osrel }; static Elf32_Brandinfo linux_brand = { diff --git a/sys/arm64/linux/linux_sysvec.c b/sys/arm64/linux/linux_sysvec.c index 7bf0dbca6eda..0bd8d60dcd93 100644 --- a/sys/arm64/linux/linux_sysvec.c +++ b/sys/arm64/linux/linux_sysvec.c @@ -105,7 +105,6 @@ extern const char *linux_syscallnames[]; SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler); -static bool linux_trans_osrel(const Elf_Note *note, int32_t *osrel); static void linux_vdso_install(const void *param); static void linux_vdso_deinstall(const void *param); static void linux_vdso_reloc(char *mapping, Elf_Addr offset); @@ -569,27 +568,6 @@ linux_vdso_reloc(char *mapping, Elf_Addr offset) } } -static char GNU_ABI_VENDOR[] = "GNU"; -static int GNU_ABI_LINUX = 0; - -/* LINUXTODO: deduplicate */ -static bool -linux_trans_osrel(const Elf_Note *note, int32_t *osrel) -{ - const Elf32_Word *desc; - uintptr_t p; - - p = (uintptr_t)(note + 1); - p += roundup2(note->n_namesz, sizeof(Elf32_Addr)); - - desc = (const Elf32_Word *)p; - if (desc[0] != GNU_ABI_LINUX) - return (false); - - *osrel = LINUX_KERNVER(desc[1], desc[2], desc[3]); - return (true); -} - static Elf_Brandnote linux64_brandnote = { .hdr.n_namesz = sizeof(GNU_ABI_VENDOR), .hdr.n_descsz = 16, diff --git a/sys/compat/linux/linux_elf.c b/sys/compat/linux/linux_elf.c index 3e0582e2b8c3..43df9508d470 100644 --- a/sys/compat/linux/linux_elf.c +++ b/sys/compat/linux/linux_elf.c @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include +#include #include struct l_elf_siginfo { @@ -465,3 +466,25 @@ __linuxN(copyout_strings)(struct image_params *imgp, uintptr_t *stack_base) return (0); } + +bool +linux_trans_osrel(const Elf_Note *note, int32_t *osrel) +{ + const Elf32_Word *desc; + uintptr_t p; + + p = (uintptr_t)(note + 1); + p += roundup2(note->n_namesz, sizeof(Elf32_Addr)); + + desc = (const Elf32_Word *)p; + if (desc[0] != GNU_ABI_LINUX) + return (false); + /* + * For Linux we encode osrel using the Linux convention of + * (version << 16) | (major << 8) | (minor) + * See macro in linux_mib.h + */ + *osrel = LINUX_KERNVER(desc[1], desc[2], desc[3]); + + return (true); +} diff --git a/sys/compat/linux/linux_elf.h b/sys/compat/linux/linux_elf.h index e0905983070b..87b21c4a14b2 100644 --- a/sys/compat/linux/linux_elf.h +++ b/sys/compat/linux/linux_elf.h @@ -33,11 +33,16 @@ struct note_info_list; /* Linux core notes are labeled "CORE" */ #define LINUX_ABI_VENDOR "CORE" +/* Elf notes */ +#define GNU_ABI_VENDOR "GNU" +#define GNU_ABI_LINUX 0 + /* This adds "linux32_" and "linux64_" prefixes. */ #define __linuxN(x) __CONCAT(__CONCAT(__CONCAT(linux,__ELF_WORD_SIZE),_),x) void __linuxN(prepare_notes)(struct thread *, struct note_info_list *, size_t *); int __linuxN(copyout_strings)(struct image_params *, uintptr_t *); +bool linux_trans_osrel(const Elf_Note *note, int32_t *osrel); #endif diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index dc41b9595003..39249cb25320 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -112,7 +112,6 @@ static void linux_exec_sysvec_init(void *param); static int linux_on_exec_vmspace(struct proc *p, struct image_params *imgp); static void linux_set_fork_retval(struct thread *td); -static bool linux_trans_osrel(const Elf_Note *note, int32_t *osrel); static void linux_vdso_install(const void *param); static void linux_vdso_deinstall(const void *param); static void linux_vdso_reloc(char *mapping, Elf_Addr offset); @@ -839,32 +838,6 @@ linux_vdso_reloc(char *mapping, Elf_Addr offset) } } -static char GNU_ABI_VENDOR[] = "GNU"; -static int GNULINUX_ABI_DESC = 0; - -static bool -linux_trans_osrel(const Elf_Note *note, int32_t *osrel) -{ - const Elf32_Word *desc; - uintptr_t p; - - p = (uintptr_t)(note + 1); - p += roundup2(note->n_namesz, sizeof(Elf32_Addr)); - - desc = (const Elf32_Word *)p; - if (desc[0] != GNULINUX_ABI_DESC) - return (false); - - /* - * For Linux we encode osrel using the Linux convention of - * (version << 16) | (major << 8) | (minor) - * See macro in linux_mib.h - */ - *osrel = LINUX_KERNVER(desc[1], desc[2], desc[3]); - - return (true); -} - static Elf_Brandnote linux_brandnote = { .hdr.n_namesz = sizeof(GNU_ABI_VENDOR), .hdr.n_descsz = 16, /* XXX at least 16 */ From nobody Thu Feb 9 07:56:47 2023 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 4PC8Mj1c91z3myGQ; Thu, 9 Feb 2023 07:56:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PC8Mg72sSz457w; Thu, 9 Feb 2023 07:56:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929408; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KDV0b2+KoF6bgV6VWQ6x0qSLlNQv7IyOeTB72CiiV5Y=; b=cCHrEJkqLtVwM7XEOeYaMAlj/I5+3jgJPc0iQJD537g7n6nVoyhIOG0hXBDhuQkG8A18Ii HTRUBXeT5t3itm9BdNZaYuv8a1+nzBgdYfdHQR3Nvapd55mifP8dHR2V9DI3ENOPF1zPG5 ZIBB/24owF9BW4gdqFwliQaUCw2qedCz4dybrGQbKLYEgCXZSnB4pGXrzi626eqb+ms9Pz 2ZIjP/pCyVYDjMhKFhKvgcVL4DFTkoeJPTb8MHO4aC9hkhZIcxnaCe/yrk1yGvj4ZBmqtc QdEsZnZjIWaUl6pIUZbVcQHixG7OvSicsytrKFxpPjoE6KvuaahP8kqWfd5rnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929408; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KDV0b2+KoF6bgV6VWQ6x0qSLlNQv7IyOeTB72CiiV5Y=; b=a8q3CXMWy+QazD4HAydZHO5Ee2WZho0eZfx55O019XH5A0BwWM6x1Cc2gGTcltHlSea+6j j2FEoYtxxzGOVAJtmnItovswUwH/bACS8QYpsM23s6rrkcOaXHnV27LlG/URpxq+U//miH bmQdDoOclVSJrWvWn+L3cFHr8VJm7yadB8uCgYihU6Jh3whKjvYgmOKGHUMrrpttKrR8Mn yog9dmfEQYL+HcxbLte4Ycdr7KCJ5zvK62HTi8kcLF/ZWdsoIMmUqv0HQ+ZNrXK0u0BESP RUpIqwE1XYAtYjQAE8PhP9NEnAF16aex3wdRl9uLuee0Gn/AKqI3hCkmrKRCpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675929408; a=rsa-sha256; cv=none; b=GasJ1EF+puWXKbmGcxx0/+GFnY5NVujiXUVWAkQnDQtrBpgEyCBmvawJajRETV4CWnWc3y F0MdfNfqgDCSAoAhNfhBRvZwoRvu5r3Ia3mR5dFmG2jBfw7P89XZPnIqZ+QIXC6d+2KLaf dDC+bMRQoxk/zfbCLPg8WXF/TH2fh5nuPLhZDF1oZ7Cl7Eyq8axqV7UNba4KFKuZmeaYZe 5yPaktFuRzcGZerMzY1i+XixE1bPzMIfFHXRQarIF5QYuMqOyqgBtJ3BtaQ3WwEVkUsU7/ PnwCmLwX6hqNU8+2lW1VJNXWe2OmqIO5N6lD7MevFJjtp+OGvyuX9AeDFlUlZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PC8Mg64X7zV5S; Thu, 9 Feb 2023 07:56:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3197ulDe092995; Thu, 9 Feb 2023 07:56:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3197ul9V092994; Thu, 9 Feb 2023 07:56:47 GMT (envelope-from git) Date: Thu, 9 Feb 2023 07:56:47 GMT Message-Id: <202302090756.3197ul9V092994@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 20d601714206 - stable/13 - linux(4): Preserve fpu fxsave state across signal delivery on amd64. 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 20d601714206e0da7b82706ec9ac9ca74aafd749 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=20d601714206e0da7b82706ec9ac9ca74aafd749 commit 20d601714206e0da7b82706ec9ac9ca74aafd749 Author: Dmitry Chagin AuthorDate: 2023-02-02 17:21:37 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-09 07:55:24 +0000 linux(4): Preserve fpu fxsave state across signal delivery on amd64. PR: 240768 Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D38302 MFC after: 1 week (cherry picked from commit a95cb95e12e537dbe70f9de18cc0fe98e4a5ebf5) --- sys/amd64/linux/linux_sysvec.c | 70 ++++++++++++++++++++++++++++++++++---- sys/x86/linux/linux_x86_sigframe.h | 7 ++-- 2 files changed, 68 insertions(+), 9 deletions(-) diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index 4fe2bfb78f7f..9e36f8739556 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -318,21 +318,22 @@ int linux_rt_sigreturn(struct thread *td, struct linux_rt_sigreturn_args *args) { struct proc *p; - struct l_ucontext uc; + struct l_rt_sigframe sf; struct l_sigcontext *context; struct trapframe *regs; + mcontext_t mc; unsigned long rflags; sigset_t bmask; - int error; + int error, i; ksiginfo_t ksi; regs = td->td_frame; - error = copyin((void *)regs->tf_rbx, &uc, sizeof(uc)); + error = copyin((void *)regs->tf_rbx, &sf, sizeof(sf)); if (error != 0) return (error); p = td->td_proc; - context = &uc.uc_mcontext; + context = &sf.sf_uc.uc_mcontext; rflags = context->sc_rflags; /* @@ -371,7 +372,7 @@ linux_rt_sigreturn(struct thread *td, struct linux_rt_sigreturn_args *args) return (EINVAL); } - linux_to_bsd_sigset(&uc.uc_sigmask, &bmask); + linux_to_bsd_sigset(&sf.sf_uc.uc_sigmask, &bmask); kern_sigprocmask(td, SIG_SETMASK, &bmask, NULL, 0); regs->tf_rdi = context->sc_rdi; @@ -395,6 +396,37 @@ linux_rt_sigreturn(struct thread *td, struct linux_rt_sigreturn_args *args) regs->tf_err = context->sc_err; regs->tf_rflags = rflags; + if (sf.sf_uc.uc_mcontext.sc_fpstate != NULL) { + struct savefpu *svfp = (struct savefpu *)mc.mc_fpstate; + + bzero(&mc, sizeof(mc)); + mc.mc_ownedfp = _MC_FPOWNED_FPU; + mc.mc_fpformat = _MC_FPFMT_XMM; + + svfp->sv_env.en_cw = sf.sf_fs.cwd; + svfp->sv_env.en_sw = sf.sf_fs.swd; + svfp->sv_env.en_tw = sf.sf_fs.twd; + svfp->sv_env.en_opcode = sf.sf_fs.fop; + svfp->sv_env.en_rip = sf.sf_fs.rip; + svfp->sv_env.en_rdp = sf.sf_fs.rdp; + svfp->sv_env.en_mxcsr = sf.sf_fs.mxcsr; + svfp->sv_env.en_mxcsr_mask = sf.sf_fs.mxcsr_mask; + /* FPU registers */ + for (i = 0; i < nitems(svfp->sv_fp); ++i) + bcopy(&sf.sf_fs.st[i], svfp->sv_fp[i].fp_acc.fp_bytes, + sizeof(svfp->sv_fp[i].fp_acc.fp_bytes)); + /* SSE registers */ + for (i = 0; i < nitems(svfp->sv_xmm); ++i) + bcopy(&sf.sf_fs.xmm[i], svfp->sv_xmm[i].xmm_bytes, + sizeof(svfp->sv_xmm[i].xmm_bytes)); + error = set_fpcontext(td, &mc, NULL, 0); + if (error != 0) { + uprintf("pid %d comm %s linux can't restore fpu state %d\n", + p->p_pid, p->p_comm, error); + return (error); + } + } + set_pcb_flags(td->td_pcb, PCB_FULL_IRET); return (EJUSTRETURN); } @@ -413,8 +445,10 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) struct sigacts *psp; caddr_t sp; struct trapframe *regs; + struct savefpu *svfp; + mcontext_t mc; int sig, code; - int oonstack, issiginfo; + int oonstack, issiginfo, i; td = curthread; p = td->td_proc; @@ -476,6 +510,29 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) mtx_unlock(&psp->ps_mtx); PROC_UNLOCK(p); + get_fpcontext(td, &mc, NULL, NULL); + KASSERT(mc.mc_fpformat != _MC_FPFMT_NODEV, ("fpu not present")); + svfp = (struct savefpu *)mc.mc_fpstate; + + sf.sf_fs.cwd = svfp->sv_env.en_cw; + sf.sf_fs.swd = svfp->sv_env.en_sw; + sf.sf_fs.twd = svfp->sv_env.en_tw; + sf.sf_fs.fop = svfp->sv_env.en_opcode; + sf.sf_fs.rip = svfp->sv_env.en_rip; + sf.sf_fs.rdp = svfp->sv_env.en_rdp; + sf.sf_fs.mxcsr = svfp->sv_env.en_mxcsr; + sf.sf_fs.mxcsr_mask = svfp->sv_env.en_mxcsr_mask; + /* FPU registers */ + for (i = 0; i < nitems(svfp->sv_fp); ++i) + bcopy(svfp->sv_fp[i].fp_acc.fp_bytes, &sf.sf_fs.st[i], + sizeof(svfp->sv_fp[i].fp_acc.fp_bytes)); + /* SSE registers */ + for (i = 0; i < nitems(svfp->sv_xmm); ++i) + bcopy(svfp->sv_xmm[i].xmm_bytes, &sf.sf_fs.xmm[i], + sizeof(svfp->sv_xmm[i].xmm_bytes)); + sf.sf_uc.uc_mcontext.sc_fpstate = (struct l_fpstate *)((caddr_t)sfp + + offsetof(struct l_rt_sigframe, sf_fs)); + /* Translate the signal. */ sig = bsd_to_linux_signal(sig); /* Fill in POSIX parts. */ @@ -489,6 +546,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) sigexit(td, SIGILL); } + fpstate_drop(td); /* Build the argument list for the signal handler. */ regs->tf_rdi = sig; /* arg 1 in %rdi */ regs->tf_rax = 0; diff --git a/sys/x86/linux/linux_x86_sigframe.h b/sys/x86/linux/linux_x86_sigframe.h index 75d9a104a345..74e7a36e2e71 100644 --- a/sys/x86/linux/linux_x86_sigframe.h +++ b/sys/x86/linux/linux_x86_sigframe.h @@ -138,10 +138,10 @@ struct l_fpstate { u_int64_t rdp; u_int32_t mxcsr; u_int32_t mxcsr_mask; - u_int32_t st_space[32]; - u_int32_t xmm_space[64]; + u_int8_t st[8][16]; + u_int8_t xmm[16][16]; u_int32_t reserved2[24]; -}; +} __aligned(16); struct l_sigcontext { l_ulong sc_r8; @@ -189,6 +189,7 @@ struct l_ucontext { struct l_rt_sigframe { struct l_ucontext sf_uc; struct l_siginfo sf_si; + struct l_fpstate sf_fs; }; #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ From nobody Thu Feb 9 07:56:48 2023 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 4PC8Mj5B3Jz3myTV; Thu, 9 Feb 2023 07:56:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PC8Mj1TdMz4583; Thu, 9 Feb 2023 07:56:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9rbyhyqciJ863dxRV4iIqyLXswfcZ8flt78rngL/K8U=; b=L1xn57e5n/fYoKetFrII0aGhf6LO2+JLkt7uy7oFPD85kpEQpN80Si4ZpBkZBObkZsXYJ+ XOPPzyh/HSubT1DHlAFyfd0D6y36MOJioFqWdw+WraOQTyUSIlovBoC/QqZEyXh8dBcOC9 GxMaPmed8YnqXbvCXx5LG9+n0AYRhJz9hX2rCKT6jESteClgKklbeeIxSUAhRGjChQzx8M X3Rv/DYsKUb2JDLcdATOWKQyjH5KCNwWavBojhR4im6fYjsJN9zN/WpKR45YckjvvimWPo Qd5lTq1iLGZEZC5TRag+avq5ZKXXKjop2QIM6HWjPSWNCKY8Di7WwHhsn0JHcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9rbyhyqciJ863dxRV4iIqyLXswfcZ8flt78rngL/K8U=; b=ZdA9PKowdkKDJjCPo9a6sA29/v1O1dePH5Cx/HVI02sQ+IUl5Gt/RNCd/c7oVS7DHX5IN6 40h31L5Pl+004jROZQHBhb3ozj1E9AkIjWWS1MbIYcDKWAjsIVmkj3Hxy+Rw2aKX21tdGO TWqhhPo8Dc5Ilx7bmAgkxwG9+AuPXzvZ52HDSH9/idOWo3Yi9B7wCFWzmEib/arRm3SL28 fpaSWBurjvDYRajxv7c25Jd8eUh7SeH7ZL17x/MZvs9zjHawGhbeBv8eZSJSHrfS1pYtOW CEQu2qCa0sot8f982u0RgaX32BULkPVJY1f1ZwaIFfs3MrA/9oEWXzDlZ2EzGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675929409; a=rsa-sha256; cv=none; b=g0FxBLiODQaPyEze1Dl0lq8b3/W4dcgqEg35mW+86b7W2ZZiDwkO86Jdns2wbahZCLtb2d d52p6omKtVWh1l0wWctbZ7xMvtT++ctgS4o6QIWF14izsNjiENhVlMURN5to6/DX36auFo ygA/TxfIYfkrosbiGCYJPr110wTztC1xbfBULWuz1GcgmJYA6tUR9oYl3gOXG8CFurwFA9 /oT3fN3kxpXe/Z6sguriaNgpBCcJwSZe/pomzkmhbjvwjFn30oxCNP3X8vYlTnJF8bWdx1 xFCRZPywBDGnoTrXI4N8oc+sxfxbEVFKFAXesbA67Y5oEOmPYcDLG8q0sch2zg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PC8Mh6g6nzVHj; Thu, 9 Feb 2023 07:56:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3197umUv093024; Thu, 9 Feb 2023 07:56:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3197umDM093023; Thu, 9 Feb 2023 07:56:48 GMT (envelope-from git) Date: Thu, 9 Feb 2023 07:56:48 GMT Message-Id: <202302090756.3197umDM093023@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: b69b287a0969 - stable/13 - linux(4): Microoptimize rt_sendsig() on amd64. 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b69b287a0969b9dd27a3184b2141e9a580a64535 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=b69b287a0969b9dd27a3184b2141e9a580a64535 commit b69b287a0969b9dd27a3184b2141e9a580a64535 Author: Dmitry Chagin AuthorDate: 2023-02-02 17:21:37 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-09 07:55:24 +0000 linux(4): Microoptimize rt_sendsig() on amd64. Drop proc lock earlier, before copying user stuff. Pointed out by: kib Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D38326 MFC after: 1 week (cherry picked from commit 6ad07a4b2bdf0856545ff8495a7b3396695814fa) --- sys/amd64/linux/linux_sysvec.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index 9e36f8739556..d7e33ccb8b70 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -464,16 +464,29 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) LINUX_CTR4(rt_sendsig, "%p, %d, %p, %u", catcher, sig, mask, code); - /* Save user context. */ bzero(&sf, sizeof(sf)); - bsd_to_linux_sigset(mask, &sf.sf_uc.uc_sigmask); - sf.sf_uc.uc_mcontext.sc_mask = sf.sf_uc.uc_sigmask; - sf.sf_uc.uc_stack.ss_sp = PTROUT(td->td_sigstk.ss_sp); sf.sf_uc.uc_stack.ss_size = td->td_sigstk.ss_size; sf.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK) ? ((oonstack) ? LINUX_SS_ONSTACK : 0) : LINUX_SS_DISABLE; + /* Allocate space for the signal handler context. */ + if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && + SIGISMEMBER(psp->ps_sigonstack, sig)) { + sp = (caddr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size; + } else + sp = (caddr_t)regs->tf_rsp - 128; + + mtx_unlock(&psp->ps_mtx); + PROC_UNLOCK(p); + + /* Make room, keeping the stack aligned. */ + sp -= sizeof(struct l_rt_sigframe); + sfp = (struct l_rt_sigframe *)((unsigned long)sp & ~0xFul); + + /* Save user context. */ + bsd_to_linux_sigset(mask, &sf.sf_uc.uc_sigmask); + sf.sf_uc.uc_mcontext.sc_mask = sf.sf_uc.uc_sigmask; sf.sf_uc.uc_mcontext.sc_rdi = regs->tf_rdi; sf.sf_uc.uc_mcontext.sc_rsi = regs->tf_rsi; sf.sf_uc.uc_mcontext.sc_rdx = regs->tf_rdx; @@ -497,19 +510,6 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) sf.sf_uc.uc_mcontext.sc_trapno = bsd_to_linux_trapcode(code); sf.sf_uc.uc_mcontext.sc_cr2 = (register_t)ksi->ksi_addr; - /* Allocate space for the signal handler context. */ - if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && - SIGISMEMBER(psp->ps_sigonstack, sig)) { - sp = (caddr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size; - } else - sp = (caddr_t)regs->tf_rsp - 128; - sp -= sizeof(struct l_rt_sigframe); - /* Align to 16 bytes. */ - sfp = (struct l_rt_sigframe *)((unsigned long)sp & ~0xFul); - - mtx_unlock(&psp->ps_mtx); - PROC_UNLOCK(p); - get_fpcontext(td, &mc, NULL, NULL); KASSERT(mc.mc_fpformat != _MC_FPFMT_NODEV, ("fpu not present")); svfp = (struct savefpu *)mc.mc_fpstate; From nobody Thu Feb 9 07:56:49 2023 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 4PC8Ml1JYmz3myJn; Thu, 9 Feb 2023 07:56: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 4PC8Mk1X0Vz4527; Thu, 9 Feb 2023 07:56:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zEGPoQ/f46DSzVnXtDMbNVfA2AkH2asjM2eAiprVzi4=; b=NbLLigxQKmaqbup8KL8Iu+FmV89m6HpI8KWp/6DzFgs2qTDi10ghTVVT0yred9OjIRgfhK hGbTEr1uVE9ZabORqC1prxjNkGIzva2A7wn7cu4+iIwX3aLHvt2ng5Dhtayl0ApbetxSG4 zWjKTh7cnvIA9BEp/zQzD/A5qOws2LpSJBN8YkUsqgs/XzQ2ZPH7RgxMcJU0g+a21xJ5ph VpASBfp1VvLMFFUs55wqv3vtCeIgRtEi7ZJ/zUw2ChY2M8aPbrMGiaFCxGZgMF3jKR8xg+ cAklvUVV1aVkirEztej5B3BFZx8GPMBnMIepKVW6KXHtvHs2paVqceq0PLC81g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zEGPoQ/f46DSzVnXtDMbNVfA2AkH2asjM2eAiprVzi4=; b=pxpMd2jDk5ayGoBWbbtMuIpUWvmN+FGZeTJQ3OMweYxAHAHsM0IRHRr0qKRY9sz9fiD+nX 2VdOnxPBT2JDPzuI/5qRAR81/u9Dg3st8qQFGk5gQKw++yVWKtZqN3FwAv/dkzjKY3SSo8 P6Tzc5Ra7Fr/8Ri1FC7zYZBST8mDAK+FwKxizRn6a2LXmIpG4XRZVfq2lyCDfSCivmNcp6 TmA/+u8taj2d1fGeoovkvXCUjKN82EjkfX87VlBrOMSzUHlk/wacF3pIeB3NDqw3ZQNDl2 QSdbUxYtpzN6C3Wp8EMzda2QuyNdFKOe4CNpebUXXHWl8nASIBKDi1B+Jc72aQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675929410; a=rsa-sha256; cv=none; b=Sykq8pnBXNmtWl8kdCPR8Bue1ru9EJdKyrsnR4gu+mRUqOPIsMkGTtaVUdo5UYi+32yqmW a3aeBxHGHqqAbeGQWo+RkuDRzzOUF/xLstzBrN+UcQa7t0pfzN4OwL+eV0kTejTCaxHtFk VW2r3HZtuST6CpbfoUzw1xmF3IXRIW2yjaikF1tFibkGjUpZNLn50K0o7T4tH4dJ20DCBq S4T0fqOCw515cNjEawcLzXUAQdfbW798Nvj1CKEWm1pVQSg9tXYk2zDwFfnSsiN+YgOofF /HF0PSShfxMVfMFbsDDifWCN/rlGs9L/jos6tLotfqat8QkTesM6PBWqzCb3+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 4PC8Mk0byMzVSy; Thu, 9 Feb 2023 07:56:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3197unSi093052; Thu, 9 Feb 2023 07:56:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3197unCX093051; Thu, 9 Feb 2023 07:56:49 GMT (envelope-from git) Date: Thu, 9 Feb 2023 07:56:49 GMT Message-Id: <202302090756.3197unCX093051@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: b7a55b568b69 - stable/13 - linux(4): Remove stale comment that no longer applies. 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b7a55b568b6992b9eae9e6c0ba3c321b48541a24 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=b7a55b568b6992b9eae9e6c0ba3c321b48541a24 commit b7a55b568b6992b9eae9e6c0ba3c321b48541a24 Author: Dmitry Chagin AuthorDate: 2023-02-02 17:21:37 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-09 07:55:24 +0000 linux(4): Remove stale comment that no longer applies. MFC after: 1 week (cherry picked from commit ce20c00e858f209f42d404eca597553e461e0892) --- sys/amd64/linux/linux_sysvec.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index d7e33ccb8b70..05dd618fa510 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -311,8 +311,6 @@ linux_exec_setregs(struct thread *td, struct image_params *imgp, /* * Copied from amd64/amd64/machdep.c - * - * XXX fpu state need? don't think so */ int linux_rt_sigreturn(struct thread *td, struct linux_rt_sigreturn_args *args) From nobody Thu Feb 9 07:56:51 2023 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 4PC8Ml3Xg7z3myJq; Thu, 9 Feb 2023 07:56: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 4PC8Ml2HSJz458T; Thu, 9 Feb 2023 07:56:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+rCELwPktYKs2yhaoYawgm3FxQcD14xRB3KCgv6ur6w=; b=RiOYDffe+ZReQ0XSAhxppNUiZOrY5nWsNw3Xwf5uVpNT6djiZbvw57qZs72vcc5eu/xmQw XVkqNTmsCw5gHdM1BfiMystXqodwjQmteeAlL3tg2HNSggbaLk3xuT2qjgB6Lgg4pVZ3vy PxZyRqqJY1JmSvqNKR3TrVmgz/Z34ADrubsxLVmWwLjcUHe6fW+9vnQhX9lH/j+oZlvBvS mG59dKtfvxuT7oENm9+LFdRZUkh3Z6h/FBLSDrOh0Oz5r5W9fXhUBAcgSFbqCIbh+19ycc +v/WXNjfjSleWd4iaqAZJCb5pLY3Ti/MbyLbGLlv36G+ccT+MWiKBIiMVkbDWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+rCELwPktYKs2yhaoYawgm3FxQcD14xRB3KCgv6ur6w=; b=aSXRO0YKbmmGR/lOR7NCjtbWpY1dlogvoUoljX53M35eMC6dQRzURWsmR7HZtnLJ+vX4E4 zbKP8A5eL+Qa4cnKd6mCS44anfWuFfB/wROKfogVj0by6J+EVTVuzezpM0fk1DYmwb0U8M VZbcZIhVM9uxSii6BHh4R8Zhotlpq/NalMPDPUGVrz0izi3JdaklPVWMbRa+pIb3OGXcaN LHTKRh12ug1SbdSGKZVRtCMAKXbLFDjkA8xHIqehlSk67mJKU/p4WkKUuAAgVFKaevDYcL AM5CrvkAHWOB3vKqPu4NA5KXzK9S1WbaBEajirfjtyi1hGP/OtDng9D2M/6TMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675929411; a=rsa-sha256; cv=none; b=c4m0LZ7APwv699gXwcNas4oiofyxNMakmU+jTflvXoHKAB5lvJdXU0EU0bIzk7yW7Gc1Gr ne/nRhkfhxiDuj5107DgDJcVtCa/alZLMyDtp6tQRkgxnQa51PTvGca3xiJ3++pU6qdVZ7 0oeSHfzjpgdb+fhhp8+gHAUtEhjQiBaaEjKP88ikmNS31kzS384t4BnqTfoY57+TJMOWTJ aUZa8u/KHi2ya91gVqD0Vb0DYMloPpZ4oTCP2aCspqncGEmD+NRAgN/RG83ouk6rXpK78S 8mMkmCO9n+QbD4ZK0QyquBmc4qjTew3BODEt+JDvCvMP8F5za2kkKbCshjX+1g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PC8Ml1KvvzVHk; Thu, 9 Feb 2023 07:56:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3197upG4093076; Thu, 9 Feb 2023 07:56:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3197upTA093075; Thu, 9 Feb 2023 07:56:51 GMT (envelope-from git) Date: Thu, 9 Feb 2023 07:56:51 GMT Message-Id: <202302090756.3197upTA093075@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 1233af2a1df9 - stable/13 - linux(4): Use designated initializers. 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1233af2a1df98193e0e832c7180c3177a276f6c8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=1233af2a1df98193e0e832c7180c3177a276f6c8 commit 1233af2a1df98193e0e832c7180c3177a276f6c8 Author: Dmitry Chagin AuthorDate: 2023-02-03 16:17:15 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-09 07:55:24 +0000 linux(4): Use designated initializers. MFC after: 1 week (cherry picked from commit 3e0c56a717d6af3b680463b25388c7acd7cb8844) --- sys/compat/linux/linux_ipc.c | 60 +++++++++++++++++-------------------------- sys/compat/linux/linux_misc.c | 12 ++++----- 2 files changed, 30 insertions(+), 42 deletions(-) diff --git a/sys/compat/linux/linux_ipc.c b/sys/compat/linux/linux_ipc.c index 258917e6a969..8c40d7505da5 100644 --- a/sys/compat/linux/linux_ipc.c +++ b/sys/compat/linux/linux_ipc.c @@ -546,17 +546,14 @@ linux_semtimedop(struct thread *td, struct linux_semtimedop_args *args) int linux_semget(struct thread *td, struct linux_semget_args *args) { - struct semget_args /* { - key_t key; - int nsems; - int semflg; - } */ bsd_args; + struct semget_args bsd_args = { + .key = args->key, + .nsems = args->nsems, + .semflg = args->semflg + }; if (args->nsems < 0) return (EINVAL); - bsd_args.key = args->key; - bsd_args.nsems = args->nsems; - bsd_args.semflg = args->semflg; return (sys_semget(td, &bsd_args)); } @@ -710,13 +707,11 @@ linux_msgrcv(struct thread *td, struct linux_msgrcv_args *args) int linux_msgget(struct thread *td, struct linux_msgget_args *args) { - struct msgget_args /* { - key_t key; - int msgflg; - } */ bsd_args; + struct msgget_args bsd_args = { + .key = args->key, + .msgflg = args->msgflg + }; - bsd_args.key = args->key; - bsd_args.msgflg = args->msgflg; return (sys_msgget(td, &bsd_args)); } @@ -802,41 +797,34 @@ linux_msgctl(struct thread *td, struct linux_msgctl_args *args) int linux_shmat(struct thread *td, struct linux_shmat_args *args) { - struct shmat_args /* { - int shmid; - void *shmaddr; - int shmflg; - } */ bsd_args; - - bsd_args.shmid = args->shmid; - bsd_args.shmaddr = PTRIN(args->shmaddr); - bsd_args.shmflg = args->shmflg; + struct shmat_args bsd_args = { + .shmid = args->shmid, + .shmaddr = PTRIN(args->shmaddr), + .shmflg = args->shmflg + }; + return (sys_shmat(td, &bsd_args)); } int linux_shmdt(struct thread *td, struct linux_shmdt_args *args) { - struct shmdt_args /* { - void *shmaddr; - } */ bsd_args; + struct shmdt_args bsd_args = { + .shmaddr = PTRIN(args->shmaddr) + }; - bsd_args.shmaddr = PTRIN(args->shmaddr); return (sys_shmdt(td, &bsd_args)); } int linux_shmget(struct thread *td, struct linux_shmget_args *args) { - struct shmget_args /* { - key_t key; - int size; - int shmflg; - } */ bsd_args; - - bsd_args.key = args->key; - bsd_args.size = args->size; - bsd_args.shmflg = args->shmflg; + struct shmget_args bsd_args = { + .key = args->key, + .size = args->size, + .shmflg = args->shmflg + }; + return (sys_shmget(td, &bsd_args)); } diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 036c02616de4..b6e23cafdf9f 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -1044,12 +1044,12 @@ linux_common_wait(struct thread *td, idtype_t idtype, int id, int *statusp, int linux_waitpid(struct thread *td, struct linux_waitpid_args *args) { - struct linux_wait4_args wait4_args; - - wait4_args.pid = args->pid; - wait4_args.status = args->status; - wait4_args.options = args->options; - wait4_args.rusage = NULL; + struct linux_wait4_args wait4_args = { + .pid = args->pid, + .status = args->status, + .options = args->options, + .rusage = NULL, + }; return (linux_wait4(td, &wait4_args)); } From nobody Thu Feb 9 07:56:52 2023 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 4PC8Mm4swHz3myBM; Thu, 9 Feb 2023 07:56:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PC8Mm3QJKz45HF; Thu, 9 Feb 2023 07:56:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xxfoHLlWIizCa94N74l5AGiIcQ3MF4v2gLDaPoXxje8=; b=yDdaz1MZAUH1m0M8qLP6rbz0dyaV19yPc9x1GllwqVvp9DQcjq1uMYpq5Sh3btUg+GlfwJ PctZTIUBrQ4OaYEK/WbanKziatRzOP1kLi4PbSby1k3+Ja1LwaRNo09kOO3dl7L668r5TV 5fRIXbNGi64Bd97UHPaqQ2iErRcURB3+xnmsAb7S1U+UDJg6BTn9s2VUrNwessRKSqA4R3 js95adrArVcplYuffuZUfNK1EhQabAc8Ur+kcQB0qWv85G2ko04hQfRtPQpoUvLr5KCzzh aNWV9UW/M+PCxmS/L1xHdXLreuk5+l+P02cXcdyU7FRXUv0K9Z796cwhnfE3vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xxfoHLlWIizCa94N74l5AGiIcQ3MF4v2gLDaPoXxje8=; b=JetOwoGinpTGpihkxTZ9qwJH3lMA99I+XhZeOfgh34QdSvtdELyQnUPBdzwJoaq9OAymiL wZNGvmfLBHJWjC2rKpQvuGXXMVg6vDUcQg8gHOkEm2GSkZ8U6ZeVkAsVJPMPCArXsEos0o sH0falVoF7lYvOADLG+1LTMSr5sImJmNE9h6BjAfpovATOZCX5ZsszVsCmZGXX/mQDdocJ OCKbFAqhGtlEbuYsXMM6F6QQlry5Vk07x+L+1UiEdPv1ovhMYDd/8j8JwIpMQIMadW0qch grXebVlSw6tFT83femk+f4fOjruCI2tuc62TAU52Z5bEJ8xn2lrrU60Il5GNBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675929412; a=rsa-sha256; cv=none; b=vCO/DG3fcOoTvlELg+BGGvmHKAAe885ssayp3d4p36S5WcQLGc3SY/6qkLO30G8h+hDUwo gFDhnGd7OkFpaULn6JwGNUxdAm7aBUq7IYCx0PfujjcK6tAv4EXtJEzYFz7vItb498UrIZ SHHrBTfzxp9WbEh6oUWljPn+E5CpHw6nkP4PO0qeSSjhNqHG7+oD7O1lmwklaqfxHMoi/x 3fqnSWYYikRKHwAkJ4roYNt4X+ZJnQW+NbkGF04H9OZCoMTGhgMpuMr+QDEaKa0Vsu5jzp buKInYmTak5XhjxNEdgcmo1D5fwQDLOrYyTi8VbGdcSk13PVxd0MKQZq4wMiwQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PC8Mm2PV6zV8F; Thu, 9 Feb 2023 07:56:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3197uqKg093100; Thu, 9 Feb 2023 07:56:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3197uqKG093099; Thu, 9 Feb 2023 07:56:52 GMT (envelope-from git) Date: Thu, 9 Feb 2023 07:56:52 GMT Message-Id: <202302090756.3197uqKG093099@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: f4ecf4ab9e02 - stable/13 - linux(4): Microoptimize linux_ipc code to unindent else blocks. 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f4ecf4ab9e0233d1ab55f7fb63b3f7612a650211 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=f4ecf4ab9e0233d1ab55f7fb63b3f7612a650211 commit f4ecf4ab9e0233d1ab55f7fb63b3f7612a650211 Author: Dmitry Chagin AuthorDate: 2023-02-03 16:17:34 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-09 07:55:25 +0000 linux(4): Microoptimize linux_ipc code to unindent else blocks. No functional change. MFC after: 1 week (cherry picked from commit eb08932156dc5801418924cf0bf9f167b15f7bf0) --- sys/compat/linux/linux_ipc.c | 226 ++++++++++++++++++++----------------------- 1 file changed, 103 insertions(+), 123 deletions(-) diff --git a/sys/compat/linux/linux_ipc.c b/sys/compat/linux/linux_ipc.c index 8c40d7505da5..134e353122c1 100644 --- a/sys/compat/linux/linux_ipc.c +++ b/sys/compat/linux/linux_ipc.c @@ -305,22 +305,20 @@ linux_msqid_pullup(l_int ver, struct l_msqid64_ds *linux_msqid64, caddr_t uaddr) if (ver == LINUX_IPC_64 || SV_CURPROC_FLAG(SV_LP64)) return (copyin(uaddr, linux_msqid64, sizeof(*linux_msqid64))); - else { - error = copyin(uaddr, &linux_msqid, sizeof(linux_msqid)); - if (error != 0) - return (error); - bzero(linux_msqid64, sizeof(*linux_msqid64)); + error = copyin(uaddr, &linux_msqid, sizeof(linux_msqid)); + if (error != 0) + return (error); - linux_msqid64->msg_perm.uid = linux_msqid.msg_perm.uid; - linux_msqid64->msg_perm.gid = linux_msqid.msg_perm.gid; - linux_msqid64->msg_perm.mode = linux_msqid.msg_perm.mode; - if (linux_msqid.msg_qbytes == 0) - linux_msqid64->msg_qbytes = linux_msqid.msg_lqbytes; - else - linux_msqid64->msg_qbytes = linux_msqid.msg_qbytes; - return (0); - } + bzero(linux_msqid64, sizeof(*linux_msqid64)); + linux_msqid64->msg_perm.uid = linux_msqid.msg_perm.uid; + linux_msqid64->msg_perm.gid = linux_msqid.msg_perm.gid; + linux_msqid64->msg_perm.mode = linux_msqid.msg_perm.mode; + if (linux_msqid.msg_qbytes == 0) + linux_msqid64->msg_qbytes = linux_msqid.msg_lqbytes; + else + linux_msqid64->msg_qbytes = linux_msqid.msg_qbytes; + return (0); } static int @@ -331,43 +329,40 @@ linux_msqid_pushdown(l_int ver, struct l_msqid64_ds *linux_msqid64, caddr_t uadd if (ver == LINUX_IPC_64 || SV_CURPROC_FLAG(SV_LP64)) return (copyout(linux_msqid64, uaddr, sizeof(*linux_msqid64))); - else { - bzero(&linux_msqid, sizeof(linux_msqid)); - error = linux_ipc64_perm_to_ipc_perm(&linux_msqid64->msg_perm, - &linux_msqid.msg_perm); - if (error != 0) - return (error); + bzero(&linux_msqid, sizeof(linux_msqid)); + error = linux_ipc64_perm_to_ipc_perm(&linux_msqid64->msg_perm, + &linux_msqid.msg_perm); + if (error != 0) + return (error); - linux_msqid.msg_stime = linux_msqid64->msg_stime; - linux_msqid.msg_rtime = linux_msqid64->msg_rtime; - linux_msqid.msg_ctime = linux_msqid64->msg_ctime; - - if (linux_msqid64->msg_cbytes > USHRT_MAX) - linux_msqid.msg_cbytes = USHRT_MAX; - else - linux_msqid.msg_cbytes = linux_msqid64->msg_cbytes; - linux_msqid.msg_lcbytes = linux_msqid64->msg_cbytes; - if (linux_msqid64->msg_qnum > USHRT_MAX) - linux_msqid.msg_qnum = USHRT_MAX; - else - linux_msqid.msg_qnum = linux_msqid64->msg_qnum; - if (linux_msqid64->msg_qbytes > USHRT_MAX) - linux_msqid.msg_qbytes = USHRT_MAX; - else - linux_msqid.msg_qbytes = linux_msqid64->msg_qbytes; - linux_msqid.msg_lqbytes = linux_msqid64->msg_qbytes; - linux_msqid.msg_lspid = linux_msqid64->msg_lspid; - linux_msqid.msg_lrpid = linux_msqid64->msg_lrpid; - - /* Linux does not check overflow */ - if (linux_msqid.msg_stime != linux_msqid64->msg_stime || - linux_msqid.msg_rtime != linux_msqid64->msg_rtime || - linux_msqid.msg_ctime != linux_msqid64->msg_ctime) - return (EOVERFLOW); - - return (copyout(&linux_msqid, uaddr, sizeof(linux_msqid))); - } + linux_msqid.msg_stime = linux_msqid64->msg_stime; + linux_msqid.msg_rtime = linux_msqid64->msg_rtime; + linux_msqid.msg_ctime = linux_msqid64->msg_ctime; + + if (linux_msqid64->msg_cbytes > USHRT_MAX) + linux_msqid.msg_cbytes = USHRT_MAX; + else + linux_msqid.msg_cbytes = linux_msqid64->msg_cbytes; + linux_msqid.msg_lcbytes = linux_msqid64->msg_cbytes; + if (linux_msqid64->msg_qnum > USHRT_MAX) + linux_msqid.msg_qnum = USHRT_MAX; + else + linux_msqid.msg_qnum = linux_msqid64->msg_qnum; + if (linux_msqid64->msg_qbytes > USHRT_MAX) + linux_msqid.msg_qbytes = USHRT_MAX; + else + linux_msqid.msg_qbytes = linux_msqid64->msg_qbytes; + linux_msqid.msg_lqbytes = linux_msqid64->msg_qbytes; + linux_msqid.msg_lspid = linux_msqid64->msg_lspid; + linux_msqid.msg_lrpid = linux_msqid64->msg_lrpid; + + /* Linux does not check overflow */ + if (linux_msqid.msg_stime != linux_msqid64->msg_stime || + linux_msqid.msg_rtime != linux_msqid64->msg_rtime || + linux_msqid.msg_ctime != linux_msqid64->msg_ctime) + return (EOVERFLOW); + return (copyout(&linux_msqid, uaddr, sizeof(linux_msqid))); } static int @@ -378,18 +373,15 @@ linux_semid_pullup(l_int ver, struct l_semid64_ds *linux_semid64, caddr_t uaddr) if (ver == LINUX_IPC_64 || SV_CURPROC_FLAG(SV_LP64)) return (copyin(uaddr, linux_semid64, sizeof(*linux_semid64))); - else { - error = copyin(uaddr, &linux_semid, sizeof(linux_semid)); - if (error != 0) - return (error); - - bzero(linux_semid64, sizeof(*linux_semid64)); + error = copyin(uaddr, &linux_semid, sizeof(linux_semid)); + if (error != 0) + return (error); - linux_semid64->sem_perm.uid = linux_semid.sem_perm.uid; - linux_semid64->sem_perm.gid = linux_semid.sem_perm.gid; - linux_semid64->sem_perm.mode = linux_semid.sem_perm.mode; - return (0); - } + bzero(linux_semid64, sizeof(*linux_semid64)); + linux_semid64->sem_perm.uid = linux_semid.sem_perm.uid; + linux_semid64->sem_perm.gid = linux_semid.sem_perm.gid; + linux_semid64->sem_perm.mode = linux_semid.sem_perm.mode; + return (0); } static int @@ -400,26 +392,23 @@ linux_semid_pushdown(l_int ver, struct l_semid64_ds *linux_semid64, caddr_t uadd if (ver == LINUX_IPC_64 || SV_CURPROC_FLAG(SV_LP64)) return (copyout(linux_semid64, uaddr, sizeof(*linux_semid64))); - else { - bzero(&linux_semid, sizeof(linux_semid)); + bzero(&linux_semid, sizeof(linux_semid)); error = linux_ipc64_perm_to_ipc_perm(&linux_semid64->sem_perm, - &linux_semid.sem_perm); - if (error != 0) - return (error); - - linux_semid.sem_otime = linux_semid64->sem_otime; - linux_semid.sem_ctime = linux_semid64->sem_ctime; - linux_semid.sem_nsems = linux_semid64->sem_nsems; + &linux_semid.sem_perm); + if (error != 0) + return (error); - /* Linux does not check overflow */ - if (linux_semid.sem_otime != linux_semid64->sem_otime || - linux_semid.sem_ctime != linux_semid64->sem_ctime || - linux_semid.sem_nsems != linux_semid64->sem_nsems) - return (EOVERFLOW); + linux_semid.sem_otime = linux_semid64->sem_otime; + linux_semid.sem_ctime = linux_semid64->sem_ctime; + linux_semid.sem_nsems = linux_semid64->sem_nsems; - return (copyout(&linux_semid, uaddr, sizeof(linux_semid))); - } + /* Linux does not check overflow */ + if (linux_semid.sem_otime != linux_semid64->sem_otime || + linux_semid.sem_ctime != linux_semid64->sem_ctime || + linux_semid.sem_nsems != linux_semid64->sem_nsems) + return (EOVERFLOW); + return (copyout(&linux_semid, uaddr, sizeof(linux_semid))); } static int @@ -430,18 +419,16 @@ linux_shmid_pullup(l_int ver, struct l_shmid64_ds *linux_shmid64, caddr_t uaddr) if (ver == LINUX_IPC_64 || SV_CURPROC_FLAG(SV_LP64)) return (copyin(uaddr, linux_shmid64, sizeof(*linux_shmid64))); - else { - error = copyin(uaddr, &linux_shmid, sizeof(linux_shmid)); - if (error != 0) - return (error); - bzero(linux_shmid64, sizeof(*linux_shmid64)); + error = copyin(uaddr, &linux_shmid, sizeof(linux_shmid)); + if (error != 0) + return (error); - linux_shmid64->shm_perm.uid = linux_shmid.shm_perm.uid; - linux_shmid64->shm_perm.gid = linux_shmid.shm_perm.gid; - linux_shmid64->shm_perm.mode = linux_shmid.shm_perm.mode; - return (0); - } + bzero(linux_shmid64, sizeof(*linux_shmid64)); + linux_shmid64->shm_perm.uid = linux_shmid.shm_perm.uid; + linux_shmid64->shm_perm.gid = linux_shmid.shm_perm.gid; + linux_shmid64->shm_perm.mode = linux_shmid.shm_perm.mode; + return (0); } static int @@ -452,34 +439,31 @@ linux_shmid_pushdown(l_int ver, struct l_shmid64_ds *linux_shmid64, caddr_t uadd if (ver == LINUX_IPC_64 || SV_CURPROC_FLAG(SV_LP64)) return (copyout(linux_shmid64, uaddr, sizeof(*linux_shmid64))); - else { - bzero(&linux_shmid, sizeof(linux_shmid)); - error = linux_ipc64_perm_to_ipc_perm(&linux_shmid64->shm_perm, - &linux_shmid.shm_perm); - if (error != 0) - return (error); + bzero(&linux_shmid, sizeof(linux_shmid)); + error = linux_ipc64_perm_to_ipc_perm(&linux_shmid64->shm_perm, + &linux_shmid.shm_perm); + if (error != 0) + return (error); - linux_shmid.shm_segsz = linux_shmid64->shm_segsz; - linux_shmid.shm_atime = linux_shmid64->shm_atime; - linux_shmid.shm_dtime = linux_shmid64->shm_dtime; - linux_shmid.shm_ctime = linux_shmid64->shm_ctime; - linux_shmid.shm_cpid = linux_shmid64->shm_cpid; - linux_shmid.shm_lpid = linux_shmid64->shm_lpid; - linux_shmid.shm_nattch = linux_shmid64->shm_nattch; - - /* Linux does not check overflow */ - if (linux_shmid.shm_segsz != linux_shmid64->shm_segsz || - linux_shmid.shm_atime != linux_shmid64->shm_atime || - linux_shmid.shm_dtime != linux_shmid64->shm_dtime || - linux_shmid.shm_ctime != linux_shmid64->shm_ctime || - linux_shmid.shm_cpid != linux_shmid64->shm_cpid || - linux_shmid.shm_lpid != linux_shmid64->shm_lpid || - linux_shmid.shm_nattch != linux_shmid64->shm_nattch) - return (EOVERFLOW); - - return (copyout(&linux_shmid, uaddr, sizeof(linux_shmid))); - } + linux_shmid.shm_segsz = linux_shmid64->shm_segsz; + linux_shmid.shm_atime = linux_shmid64->shm_atime; + linux_shmid.shm_dtime = linux_shmid64->shm_dtime; + linux_shmid.shm_ctime = linux_shmid64->shm_ctime; + linux_shmid.shm_cpid = linux_shmid64->shm_cpid; + linux_shmid.shm_lpid = linux_shmid64->shm_lpid; + linux_shmid.shm_nattch = linux_shmid64->shm_nattch; + + /* Linux does not check overflow */ + if (linux_shmid.shm_segsz != linux_shmid64->shm_segsz || + linux_shmid.shm_atime != linux_shmid64->shm_atime || + linux_shmid.shm_dtime != linux_shmid64->shm_dtime || + linux_shmid.shm_ctime != linux_shmid64->shm_ctime || + linux_shmid.shm_cpid != linux_shmid64->shm_cpid || + linux_shmid.shm_lpid != linux_shmid64->shm_lpid || + linux_shmid.shm_nattch != linux_shmid64->shm_nattch) + return (EOVERFLOW); + return (copyout(&linux_shmid, uaddr, sizeof(linux_shmid))); } static int @@ -491,18 +475,14 @@ linux_shminfo_pushdown(l_int ver, struct l_shminfo64 *linux_shminfo64, if (ver == LINUX_IPC_64 || SV_CURPROC_FLAG(SV_LP64)) return (copyout(linux_shminfo64, uaddr, sizeof(*linux_shminfo64))); - else { - bzero(&linux_shminfo, sizeof(linux_shminfo)); - linux_shminfo.shmmax = linux_shminfo64->shmmax; - linux_shminfo.shmmin = linux_shminfo64->shmmin; - linux_shminfo.shmmni = linux_shminfo64->shmmni; - linux_shminfo.shmseg = linux_shminfo64->shmseg; - linux_shminfo.shmall = linux_shminfo64->shmall; - - return (copyout(&linux_shminfo, uaddr, - sizeof(linux_shminfo))); - } + bzero(&linux_shminfo, sizeof(linux_shminfo)); + linux_shminfo.shmmax = linux_shminfo64->shmmax; + linux_shminfo.shmmin = linux_shminfo64->shmmin; + linux_shminfo.shmmni = linux_shminfo64->shmmni; + linux_shminfo.shmseg = linux_shminfo64->shmseg; + linux_shminfo.shmall = linux_shminfo64->shmall; + return (copyout(&linux_shminfo, uaddr, sizeof(linux_shminfo))); } #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) From nobody Thu Feb 9 07:56:53 2023 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 4PC8Mp3g5Pz3myGZ; Thu, 9 Feb 2023 07:56: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 4PC8Mn49kHz44wG; Thu, 9 Feb 2023 07:56:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929413; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yAiMqKK/kY8Etc+YQSLis8pTqaYpnOjlMSWXy/wI3bo=; b=gZqpBECAAtatKcrELd2ZKNL1ydcmhjdeJ2TpkmvDw9t9YsCt+FfI400F5Fu00O24cquy10 sF46NwxxY361cwwT+4q7+joOrZubjA0HSGKseGQJgNmF7QArUNcyo1tIAk6luPJYV1E7Fx Z1ll/Poo7i6bkfejz7tOdBHR0S/NDf97vaIiRCHmgIbn827upQapIqRTQ423tiC4A1YlKS BoINEWjdmaOxiWYz0033Ya4vRtIjD+o1vDNtk9OnrLGbHMAKuPEp4fAHBXvyMQBavRr1io xCPPyOLKiCBZ2SJ610pWK5kE6s+/T1O7/3dwh33gR7m7oIg0UHfyabFljDL8ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929413; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yAiMqKK/kY8Etc+YQSLis8pTqaYpnOjlMSWXy/wI3bo=; b=B3WuI4D7FNv/RCwVTt/sMSxY/WFRq0mJwtUyLz3zTxwCbXW5LeSZyDR6iBHXlwjsVZgy7g 1J2pptV35zM52pypqDYYBpNZjxvzDaHZXsmtuuCmKhYHKs8JuDz2u4/0JpKGq8tKx7MHPd lv41OrEbpXN+c/BAqHS8PtgcyuObvaWBTOtZVIT0rNfig/9xCd1NJd48YCkbySzkNYra44 CkAJghd5IF9C7xUPGmz7TGZD2grP2YvC4M2nesIhTxz5o093tuPOh03rgoc3jZPymQ3uX8 kzEOvaODnENgNPsayi/oc2gNnoyY7+J8D6xm6KSWC6FdmF41h4zBNiw3SdQH2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675929413; a=rsa-sha256; cv=none; b=Rhrj3ClhRrYJnj6VSyt+IG7+LtCLSMTwmMR3avet8KGoMXBl/5xhsvpWoEZmtXeD2o1VCs B60t39SVaQlHhXuKYV6DdtaUUzut09ZeY48WFfBFJHLzRopZ7u+gc93q9uyxa9P3nxzqsO LG+Wdnjd3XIZy2Ckvyg4Txac0RWTZKMB9HTAgXJ3+lh+T+i3TF3QVWA6MkQEzw8Han1pBW 17XvquUpLaFOz3vaF8VDxPOTG2/PpOXVAim1mIXFODO2Pku38lOqRqrSyA5vnOyuAIBR5w ooxO5fxo43fbQuWj2z4soRHgE3/yshRVVzid0qNXvwyoW8ZJFYxP/+aOQhktlQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PC8Mn3GXczV5T; Thu, 9 Feb 2023 07:56:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3197urk4093124; Thu, 9 Feb 2023 07:56:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3197urNT093123; Thu, 9 Feb 2023 07:56:53 GMT (envelope-from git) Date: Thu, 9 Feb 2023 07:56:53 GMT Message-Id: <202302090756.3197urNT093123@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 603cdb0f092c - stable/13 - linux(4): Attach netlink on i386. 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 603cdb0f092c741a5774e4bea7a94714d9d835ba Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=603cdb0f092c741a5774e4bea7a94714d9d835ba commit 603cdb0f092c741a5774e4bea7a94714d9d835ba Author: Dmitry Chagin AuthorDate: 2023-02-06 14:00:44 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-09 07:55:25 +0000 linux(4): Attach netlink on i386. Discussed with: melifaro MFC after: 3 days (cherry picked from commit 07db1f36848c008efb7ab6b37e199212560833ae) --- sys/i386/linux/linux_sysvec.c | 3 +++ sys/modules/linux/Makefile | 1 + 2 files changed, 4 insertions(+) diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index 39249cb25320..d8eee3f96a93 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -911,6 +911,7 @@ linux_elf_modevent(module_t mod, int type, void *data) linux_ioctl_register_handler(*lihp); linux_dev_shm_create(); linux_osd_jail_register(); + linux_netlink_register(); stclohz = (stathz ? stathz : hz); if (bootverbose) printf("Linux ELF exec handler installed\n"); @@ -931,6 +932,7 @@ linux_elf_modevent(module_t mod, int type, void *data) if (error == 0) { SET_FOREACH(lihp, linux_ioctl_handler_set) linux_ioctl_unregister_handler(*lihp); + linux_netlink_deregister(); linux_dev_shm_destroy(); linux_osd_jail_deregister(); if (bootverbose) @@ -951,4 +953,5 @@ static moduledata_t linux_elf_mod = { }; DECLARE_MODULE_TIED(linuxelf, linux_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY); +MODULE_DEPEND(linuxelf, netlink, 1, 1, 1); FEATURE(linux, "Linux 32bit support"); diff --git a/sys/modules/linux/Makefile b/sys/modules/linux/Makefile index 4e41f8e9403c..fad03e8a8ca0 100644 --- a/sys/modules/linux/Makefile +++ b/sys/modules/linux/Makefile @@ -49,6 +49,7 @@ VDSODEPS=linux_vdso_gettc_x86.inc SRCS+= linux${SFX}_support.s .else SRCS+= linux_copyout.c +SRCS+= linux_netlink.c .endif DPSRCS= assym.inc linux${SFX}_genassym.c From nobody Thu Feb 9 10:01:23 2023 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 4PCC7R5WxPz3nTHS; Thu, 9 Feb 2023 10:01: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 4PCC7R4Bxtz3CJ7; Thu, 9 Feb 2023 10:01:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675936883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h6ghMiel0uzKegbT8Se7rImi1/HGAD+jGo2d1kgXxAM=; b=WmHoYzymhGYASfVQ0Y+EcScWiKXVH6bWhxwOh0AUnMRfS4punZKV5l5o1flRWTYSofKO3d CeDvdqVxX+VDz7FFe0M85PTJVqX3/EqUMwhf0Nf93GuBkcQ75Bi6uw85fndAnVMyktmTm4 U+ZhUeXIi9BkPKSZqSNNv603A01QWeZCdeB5L17luTUgkManzHwO951ag328umerQ0h0Qn R/jdieyuwb82uALzXRk1Vsziz23ampEY91kHOcYEbP3dauo70ozY9GKiCrNtu/6BcWX5yV vM/AghzgHGo2XivMIEgjA49aG2cAuFfnS9OfM9KU1AT3bnEsMzENSG+TfWMfXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675936883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h6ghMiel0uzKegbT8Se7rImi1/HGAD+jGo2d1kgXxAM=; b=TomxYT2pWVjGDHRmbDzfHMrAAOdFW1Hmcu3oofdh+lG8yf5Tw9o/OCHLOdq2j5KHT4t3T/ vb7vxhC6udvBb5u3gjpGGOPGQ/kWcgLhk0ANhEi6C/fBGbkB7NqNoPKvZs2t15zV8EtJds 3+UTKS6pgYAEdQVSdfYFv+mc+c4Ax/DFdBBNzzRDF5at3SSIyc96FfDKnR6S/C2vz8IJfd KFq5hN74jziA580trw0qWZ+uImQGWrcemSJ0ehYYT+PJkY2YzK7OiCBAGTm56XC/Fe6k/x GgStb+JRcOYPjvLARCPi3FhcF9ttTNcpnxLDWC3vsPyJYIFUNyx796dtu+r19w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675936883; a=rsa-sha256; cv=none; b=kwcAcC5hQlUeRiki6c1RLx0AsBOMwwBrnS+300d4o6Nlj8NRHsTRxbNUI/2hkMSzuIHyDK KsK2Lh28nhtepEKN8SDs/g62fQYJ7ZTLz52rAQe0NTxSyRBN47fySAmwvUQnz9JjiQFhMs VyiTJ3k8V7LHGhqiRVoX04zced+cEhSOQ+CaC8jUgtvx2OoOb9LRNghFOx+rhpSVu+dCMg B3A+UcO2pTXKG3ufiVenPTaAXmLUYI3Wmy6YrVxYXMuG0Bv35qXGStHVhlM8S28zSFmx/0 BQdGI5MSTaP87lLioI27l/KubMbDArZvaL4MQ1wEvzYLd8dRPojt8BHAH+8FgQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCC7R1q5tzY80; Thu, 9 Feb 2023 10:01:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319A1N0D077922; Thu, 9 Feb 2023 10:01:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319A1NJU077921; Thu, 9 Feb 2023 10:01:23 GMT (envelope-from git) Date: Thu, 9 Feb 2023 10:01:23 GMT Message-Id: <202302091001.319A1NJU077921@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: da57cc1400a0 - stable/13 - Read the arm64 far early in el0 exceptions 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: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: da57cc1400a0bff21ff2dc239404a4a1d2af7539 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=da57cc1400a0bff21ff2dc239404a4a1d2af7539 commit da57cc1400a0bff21ff2dc239404a4a1d2af7539 Author: Andrew Turner AuthorDate: 2023-01-25 17:47:39 +0000 Commit: Andrew Turner CommitDate: 2023-02-09 09:53:56 +0000 Read the arm64 far early in el0 exceptions When handling userspace exceptions on arm64 we need to dereference the current thread pointer. If this is being promoted/demoted there is a small window where it will cause another exception to be hit. As this second exception will set the fault address register we will read the incorrect value in the userspace exception handler. Fix this be always reading the fault address before dereferencing the current thread pointer. Reported by: olivier@ Reviewed by: markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D38196 (cherry picked from commit f29942229d24ebb8b98f8c5d02f3c8632648007e) --- sys/arm64/arm64/exception.S | 15 +++++++++++++++ sys/arm64/arm64/trap.c | 26 +++++++------------------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/sys/arm64/arm64/exception.S b/sys/arm64/arm64/exception.S index 63fcbd2d98a7..1ee784a48e40 100644 --- a/sys/arm64/arm64/exception.S +++ b/sys/arm64/arm64/exception.S @@ -210,10 +210,25 @@ ENTRY(handle_el1h_irq) END(handle_el1h_irq) ENTRY(handle_el0_sync) + /* + * Read the fault address early. The current thread structure may + * be transiently unmapped if it is part of a memory range being + * promoted or demoted to/from a superpage. As this involves a + * break-before-make sequence there is a short period of time where + * an access will raise an exception. If this happens the fault + * address will be changed to the kernel address so a later read of + * far_el1 will give the wrong value. + * + * The earliest memory access that could trigger a fault is in a + * function called by the save_registers macro so this is the latest + * we can read the userspace value. + */ + mrs x19, far_el1 save_registers 0 ldr x0, [x18, #PC_CURTHREAD] mov x1, sp str x1, [x0, #TD_FRAME] + mov x2, x19 bl do_el0_sync do_ast restore_registers 0 diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c index e845f998633a..7d36a9c9dee1 100644 --- a/sys/arm64/arm64/trap.c +++ b/sys/arm64/arm64/trap.c @@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$"); /* Called from exception.S */ void do_el1h_sync(struct thread *, struct trapframe *); -void do_el0_sync(struct thread *, struct trapframe *); +void do_el0_sync(struct thread *, struct trapframe *, uint64_t far); void do_el0_error(struct trapframe *); void do_serror(struct trapframe *); void unhandled_exception(struct trapframe *); @@ -527,11 +527,11 @@ do_el1h_sync(struct thread *td, struct trapframe *frame) } void -do_el0_sync(struct thread *td, struct trapframe *frame) +do_el0_sync(struct thread *td, struct trapframe *frame, uint64_t far) { pcpu_bp_harden bp_harden; uint32_t exception; - uint64_t esr, far; + uint64_t esr; int dfsc; /* Check we have a sane environment when entering from userland */ @@ -541,27 +541,15 @@ do_el0_sync(struct thread *td, struct trapframe *frame) esr = frame->tf_esr; exception = ESR_ELx_EXCEPTION(esr); - switch (exception) { - case EXCP_INSN_ABORT_L: - far = READ_SPECIALREG(far_el1); - + if (exception == EXCP_INSN_ABORT_L && far > VM_MAXUSER_ADDRESS) { /* * Userspace may be trying to train the branch predictor to * attack the kernel. If we are on a CPU affected by this * call the handler to clear the branch predictor state. */ - if (far > VM_MAXUSER_ADDRESS) { - bp_harden = PCPU_GET(bp_harden); - if (bp_harden != NULL) - bp_harden(); - } - break; - case EXCP_UNKNOWN: - case EXCP_DATA_ABORT_L: - case EXCP_DATA_ABORT: - case EXCP_WATCHPT_EL0: - far = READ_SPECIALREG(far_el1); - break; + bp_harden = PCPU_GET(bp_harden); + if (bp_harden != NULL) + bp_harden(); } intr_enable(); From nobody Thu Feb 9 16:11:20 2023 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 4PCMLJ5dVhz3plLH; Thu, 9 Feb 2023 16:11: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 4PCMLJ548Jz4Hq9; Thu, 9 Feb 2023 16:11:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675959080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yTsQGFo41bRNZwddD5Jj1A3KFMnRhu1Z0gO3HnGNPto=; b=nkoLDExfBEPOO6emfFaVhWEK4CUjMuaJ6VcoLoCVfmyfJbe8P3obTXNELpW3RKfHLLkki8 7WmVkh6QWCsVqlRi8UEWIlp+1y91FTvDtiYfM4zJPXFxadDe0t1A5aP8LnrQ39XxZavyMN GVOJ1ImNZaqVDuzQYycKsgj37Zbw01ycrvjUGbZQgm8NVZSX2Rtc+LL1PpEQ8E9ml6bi5w gr1PeS7K0nDR1fnboO63J65u2YedF4ubt2l8XhCQ3ai1cEMChGCiHzH0zY791Op5OIq6uQ lCuNP4MYOGbevMKGfIGFlnKJDojSLaaL0mFiwvlDwq/BN6WDCCHqIgGlrihgLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675959080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yTsQGFo41bRNZwddD5Jj1A3KFMnRhu1Z0gO3HnGNPto=; b=W9+Q6drUH2hQeiQ8+Oe3As9jcxcIaPozznkrgv8MzKeAj6vYISxEXVGf15jgIvm2tv9hZG diJK23byNVHkiwIAO7dUHSG8QyIAFPb6M9F9ndxP5nIgS5nbgvgKnzgmLwQpyknAUqasD4 nvzIUIDmLq1WPlt9vgUAFWbp2xHVQWSvk7G9xHdThjRNYl8iQ13+KHWAWGALLq+AzDwq6K sZViYtPbEfA65FTd0OT8R8l9WUBtI5sVPaL5bsPWX/aHWLp1poY1zDfnUT00ZfB0tGQQN5 Xxlvmu+i9Tppv5/M5jrm2tXt70aUcIyc+LBZHWPXAfypYnexTzWBod3LbmBgDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675959080; a=rsa-sha256; cv=none; b=tCHdYd+XuYzvBfTzGhW8jdegTXQQDVK11MajCqqP5rhuXd23GkaUN0ubFAsWWSodcTilU+ YkOesxWmfUXdqvGbEZTgSvGCLdrWK63taG+9IJO3Pz8JCX2LHmGHv9dQzjVh88WFrOQF4t i5SgVgB84F5dpUvVxbkLFD1tCpSXdz6CzPkxFDXlN3/KOec5m3mQwbpir8Ydb3FTh5ow8I nFvCJCH5QZm6Z8FCbj+HzTnLL2pIpufmuAAGGfBBoFyrWPJ9PaA+JLgfFslSJfFjXxA/vU SRD1bcPNUM81sfegEh+IlmbIb1s/2BCnnVt5z26l8x5SY3M/MIIq3J9d8iIeQQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCMLJ46vDzjlc; Thu, 9 Feb 2023 16:11:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319GBK6L005354; Thu, 9 Feb 2023 16:11:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319GBKeI005353; Thu, 9 Feb 2023 16:11:20 GMT (envelope-from git) Date: Thu, 9 Feb 2023 16:11:20 GMT Message-Id: <202302091611.319GBKeI005353@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 7c8355d205e7 - stable/13 - tests: Add an IPv4 loopback address of 127.0.0.1/8 to the lo0 interface by default when creating VNETSs using pytest. 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: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7c8355d205e7490c61af1b0d9e20addea10cb513 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=7c8355d205e7490c61af1b0d9e20addea10cb513 commit 7c8355d205e7490c61af1b0d9e20addea10cb513 Author: Jose Luis Duran AuthorDate: 2023-01-11 14:33:58 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-09 15:44:42 +0000 tests: Add an IPv4 loopback address of 127.0.0.1/8 to the lo0 interface by default when creating VNETSs using pytest. Reviewed By: asomers Differential Revision: https://reviews.freebsd.org/D38021 (cherry picked from commit 4856aeaaed17726a1dfa5dd6c736e5b0851255b6) --- tests/atf_python/sys/net/vnet.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/atf_python/sys/net/vnet.py b/tests/atf_python/sys/net/vnet.py index aca1b53d388c..1a8efe0d9edc 100644 --- a/tests/atf_python/sys/net/vnet.py +++ b/tests/atf_python/sys/net/vnet.py @@ -92,6 +92,7 @@ class VnetInterface(object): def setup_loopback(cls, vnet_name: str): lo = VnetInterface("", "lo0") lo.set_vnet(vnet_name) + lo.setup_addr("127.0.0.1/8") lo.turn_up() @classmethod From nobody Thu Feb 9 16:11:21 2023 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 4PCMLK6Q7Kz3plNn; Thu, 9 Feb 2023 16:11: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 4PCMLK5zQkz4Ht0; Thu, 9 Feb 2023 16:11:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675959081; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gI4jUFB45Jif5EDBcCJnibUiFLpIXQsUYWSqNElyN8Q=; b=ErrUWzdZ+5BMHcy157AVV0/b6iwTL5zIJgFuc8R4dIaNqEnb3Lqptr1rTDNBGzffyrK18D J4MnBAIDNqPMQy3U0PHSpIV6XQxximQba1XoydonyHED59mVu5x3rdUQqa0od/MS8JFFff eOBZg5vf5UUzOtPv84REi0EVJ1JqyWiVDk73v+SD1m/QcBPqcFRh83hJ3STnU48pMrFsHm taFWeiyXekIqaVU/Zc+MJQ84Jd0cTdt1PtmxyWP5+HH/ygBeXWJzb3DCh0FYOistTWvTdP ckJ7u38MGWupjdSeuYG/y8pI+YCPTXTl3JCcpWMGVL0WSS8g+fXdIppsaFoYQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675959081; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gI4jUFB45Jif5EDBcCJnibUiFLpIXQsUYWSqNElyN8Q=; b=BD5cjNbY8mWN6ftnMUjL0JvJmOt3cN32Is++FSF/vlU6MY4WAihmwkRdvL//+cT+/Vv1jB VvW46EUZOR7jbP+GeKK5OZYML6UX3CbuLWobTr9MQBTQjF5zF/xqkMWFE9eyc1fb0Cr1Fq jO6sQ5d8SUxHhF4pzVv3hbptWIJbS3Mcm76R4FfORuSQrVf0IUL5Tbbj++bGZR0dv1duDz yMEPInDOaQ91BFyx9B04ZvESvb2YIiouscymL/Nz2kRsLBLp+0la9Y81mFERi7HMSI46IY LqKxmjQgqK55GuviWGtKCUn4DnsPqUq6vXN423r0EaTpXCPfve+dw/myylDWnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675959081; a=rsa-sha256; cv=none; b=HiLXP2DjbSiFmCmZL5YyrSc+dVMOcTmgHpW5S6KwDlZze3eiYcTVLV4Q0l4uyS/OJrYG9G U1bzmxiifR/phdVYXwNIU57Sz55fZ2lPTvso6Y3rU+uH9/oSYd9D2oz/Y3q7cQvWjz4p6i 56MXpEZOkuVASSztX+s/ZI1Oso3Dl9gbiRj8O+ROP3yYhHP3Q+IlwT3Iyn5Ie5D8IdLAFO S7LxadayfyeeQ815zjXoKaLcqb4mKiwisfh1iu7oY6r4VX4Pw3BOadQgY96YXOCwavey7j JzMIrjLkvNHMWVzajlYFeFCGbvO9mBnxAZ1Pw446Wwx+PJ21mduJVwgMvL1sgA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCMLK52T9zk2n; Thu, 9 Feb 2023 16:11:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319GBLpf005378; Thu, 9 Feb 2023 16:11:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319GBL0F005377; Thu, 9 Feb 2023 16:11:21 GMT (envelope-from git) Date: Thu, 9 Feb 2023 16:11:21 GMT Message-Id: <202302091611.319GBL0F005377@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 088e1247e79a - stable/13 - pytest: silence deprecation warning in the pytest atf wrapper 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: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 088e1247e79a7f07b965f32ccb1bb33a7695b366 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=088e1247e79a7f07b965f32ccb1bb33a7695b366 commit 088e1247e79a7f07b965f32ccb1bb33a7695b366 Author: Jose Luis Duran AuthorDate: 2022-12-28 15:51:18 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-09 15:45:20 +0000 pytest: silence deprecation warning in the pytest atf wrapper Convert `pytest.mark` decorator to the `pytest.hookimpl()` one, as suggested by the https://docs.pytest.org/en/latest/deprecations.html#configuring-hook-specs-impls-using-markers Differential Revision: https://reviews.freebsd.org/D37884 MFC after: 2 weeks (cherry picked from commit eaeebfcb38599c94e89bbba3e9c7aeb821c84d71) --- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 65c8bf5f0d01..b5ce5ae2286b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -51,7 +51,7 @@ def atf_vars() -> Dict[str, str]: return ATFHandler.get_atf_vars() -@pytest.mark.trylast +@pytest.hookimpl(trylast=True) def pytest_configure(config): if config.option.help: return From nobody Thu Feb 9 16:11:22 2023 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 4PCMLM2RLDz3pl9K; Thu, 9 Feb 2023 16:11:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PCMLL6dBMz4HrC; Thu, 9 Feb 2023 16:11:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675959082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qqTM5rmGfZskrQlgG78Poj7Zbu1zDhspliQir7jmFd4=; b=xG7Enm7sZsWZpgzcHVBnsnBosRbvE/E6AlNu6QioVAwj0UibC/teNxxOaSYWsff7ESfqt0 V3TZhl+vqvqJlTS08twwj06k2CrOGQCQlsdZd4DmqjD5+do0uTEtu5P4XQ8q9t2Xqp8DhM 8UrsvLt58JRgfcJJH1m31rZQQapH9GSSO5E+zOOxBBrRSOkjKmzZ0cRELYlZoKk2Tv6mR2 hjFKUE8MfeSGwRxv1ClAyKCYCOxhkrJdkBCgN7h8aeJJJjIdFr6zxaUN7ZI+znQzrZdSS5 pXbhmDo8dDBWCOUGFZadCiPmDUD9dkTAbQwebta2X+XutKMRXIhaRRsFivKckA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675959082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qqTM5rmGfZskrQlgG78Poj7Zbu1zDhspliQir7jmFd4=; b=WYGxmOlRDnb1IIQUtQJvWaRIuG+TR+ih7ANagnhVRUS3IP+gMPkNk6gHvn9C4CrcwrZZbt 1BF7GlQXTNSV1AOb1/1bNUggs8HGLSq3u0U1G8/k3rUfesNfIiwHAWETgZIhXkUC0FcxuG /OAXXxnjeY/327vhrlZykM079A68J66/nkzriYIZ4KsjymKiq1wPzyajtxg3NRPv24V5mP 9HKFHOMIwEVpqT/s6pZcuwwS/8eGloxH61rd9b0fiE6v+2hEBvYA/Wm6g/sRp0sYVEqwtI gbmZ4nm6IsHJUrFOWR6UdgEUk0yiIPgegXspppcgjf7/fyboueusMLjFUzcqJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675959082; a=rsa-sha256; cv=none; b=M2QHF9neVubFenho4B0FiM37DVu2Pf1lsSZieBklm8mNi3GQZJMKAhyx7dYtC8R3bGufvz rVJEqaRUueSyUCpg4R+Ft/vAuISL6CSKh9VyjOJz8uEw15k7SYb2X5+YZJTBH6Fy8J6h4B 8Btu1QI5OvcFFrEM3UVUuQNwVI01x/l3h/ZoCNHVc0klqxuACi/qHPJKWqUoCuVzX3QF49 MldL1JtyapHrCwH5T/6AhzvG+mxIntBgbo4BBg2sxB1HmOcR929fuRdZXNiLCp9RciDjbq Xf4Rw0fAE/ZdqHWhT5BuNMw5HghKMUE1Z7Mq6S0A1nCWpgS7C2EIYG09Mw4Cqg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCMLL5l8PzkFd; Thu, 9 Feb 2023 16:11:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319GBM9S005402; Thu, 9 Feb 2023 16:11:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319GBMlX005401; Thu, 9 Feb 2023 16:11:22 GMT (envelope-from git) Date: Thu, 9 Feb 2023 16:11:22 GMT Message-Id: <202302091611.319GBMlX005401@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: a28a4cb5e909 - stable/13 - atf_pytest_wrapper: fix pytest output truncation 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: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a28a4cb5e9090806b6a7f8912f3ddcc1dfc57217 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=a28a4cb5e9090806b6a7f8912f3ddcc1dfc57217 commit a28a4cb5e9090806b6a7f8912f3ddcc1dfc57217 Author: Jose Luis Duran AuthorDate: 2022-12-28 17:28:59 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-09 15:45:28 +0000 atf_pytest_wrapper: fix pytest output truncation Pass `-vv` to pytest in order to always get the full output. While here, enforce the modeline. Differential Revision: https://reviews.freebsd.org/D37894 MFC after: 2 weeks (cherry picked from commit 058ac3e8063366dafa634d9107642e12b038bf09) --- .../atf/atf-pytest-wrapper/atf_pytest_wrapper.cpp | 55 +++++++++++----------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/libexec/atf/atf-pytest-wrapper/atf_pytest_wrapper.cpp b/libexec/atf/atf-pytest-wrapper/atf_pytest_wrapper.cpp index 7f6e886a16d9..78b045b9775f 100644 --- a/libexec/atf/atf-pytest-wrapper/atf_pytest_wrapper.cpp +++ b/libexec/atf/atf-pytest-wrapper/atf_pytest_wrapper.cpp @@ -65,7 +65,7 @@ class Handler { // * without schebang args // atf_wrap /path/to/script -l // Running test: - // atf_wrap '-P /path' /path/to/script -r /path1 -s /path2 -vk1=v1 testname + // atf_wrap '-P /path' /path/to/script -r /path1 -s /path2 -vk1=v1 testname void Parse(int argc, char **argv) { if (flag_debug) { PrintVector("IN", ToVector(argc, argv)); @@ -89,34 +89,34 @@ class Handler { // The next argument is a script name. Copy and keep argc/argv the same // Show usage for empty args if (argc == 0) { - Usage("Must provide a test case name", true); + Usage("Must provide a test case name", true); } script_path = std::string(argv[0]); int c; while ((c = getopt(argc, argv, "lr:s:v:")) != -1) { switch (c) { - case 'l': - flag_list = true; - break; - case 's': - src_dir = std::string(optarg); - break; - case 'r': - dst_file = std::string(optarg); - break; - case 'v': - { - std::string kv = std::string(optarg); - size_t splitter = kv.find("="); - if (splitter == std::string::npos) { - Usage("Unknown variable: " + kv, true); - } - kv_map[kv.substr(0, splitter)] = kv.substr(splitter + 1); - } - break; - default: - Usage("Unknown option -" + std::string(1, static_cast(c)), true); + case 'l': + flag_list = true; + break; + case 's': + src_dir = std::string(optarg); + break; + case 'r': + dst_file = std::string(optarg); + break; + case 'v': + { + std::string kv = std::string(optarg); + size_t splitter = kv.find("="); + if (splitter == std::string::npos) { + Usage("Unknown variable: " + kv, true); + } + kv_map[kv.substr(0, splitter)] = kv.substr(splitter + 1); + } + break; + default: + Usage("Unknown option -" + std::string(1, static_cast(c)), true); } } argc -= optind; @@ -138,7 +138,8 @@ class Handler { } std::vector BuildArgs() { - std::vector args = {"pytest", "-p", "no:cacheprovider", "-s", "--atf"}; + std::vector args = {"pytest", "-vv", "-p", + "no:cacheprovider", "-s", "--atf"}; if (flag_list) { args.push_back("--co"); @@ -179,7 +180,7 @@ class Handler { // Pass ATF kv pairs as env variables to avoid dealing with // pytest parser for (auto [k, v]: kv_map) { - setenv((kAtfVar + k).c_str(), v.c_str(), 1); + setenv((kAtfVar + k).c_str(), v.c_str(), 1); } } @@ -190,7 +191,7 @@ class Handler { // allocate array with final NULL char **arr = new char*[args.size() + 1](); for (unsigned long i = 0; i < args.size(); i++) { - // work around 'char *const *' + // work around 'char *const *' arr[i] = strdup(args[i].c_str()); } return execvp(binary.c_str(), arr) == 0; @@ -204,7 +205,7 @@ class Handler { "not_found__" << std::endl; } else { std::cout << "execvp(" << kPytestName << ") failed: " << - std::strerror(errno) << std::endl; + std::strerror(errno) << std::endl; } } From nobody Thu Feb 9 16:11:23 2023 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 4PCMLN11Jvz3pl5g; Thu, 9 Feb 2023 16:11: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 4PCMLN0RQvz4J8P; Thu, 9 Feb 2023 16:11:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675959084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m8moc6Hj/jYDCTFeBMEsH6LUYjip6xh0rnQS9ba3Df8=; b=jgV4PUIpFSR6aQf26gES17+LPwwrw40kmow/WWmtUmsPNo12opscjFsapYkSPogFipkEjc 0wuKIegCV0ra7n7Fb2ePSxF+MSoyoYK5qkk1F7yPySpXCd0h1qFTRaE9B4m57mX2xlasmI dSn32GeHq9xnFVk5nLbKgkfIP3BPgWiYjT5i3yTTdzhBOgB0Hp7uAByTGmMxgztS7KxaTe csNjlbSKf5qTHqMALFKpeKkMh7kOcwxldIdWNCU+L6jZQba6it6LnFJFGO+na+klCKxizU U6iRaXW5x2enPpmWUudwVFwqYnGPEuj5ntGWWdrhXPbS1Y2hB7UmBjTh4ePVpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675959084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m8moc6Hj/jYDCTFeBMEsH6LUYjip6xh0rnQS9ba3Df8=; b=hjcTimlWxspxJd60Jamy/8Cu4gHlos+70qZUREKkL9PaJSHokD61Yurqoz+p3acouNZaWk ze7NbgGr/ULyqWv8zEwfLfgZRg+1x2h8m3w/3jbEXyabliwNEPkLL4xK6ORe6eLSbpAuFZ Qt1pacJOq7XKnsNB/BoOynor9Uir9B32j/Y+BQkh+IOzhabKhV8ZLZ+oVCOdhPECOdPMS3 C49QE/E5JhnedhW0AmiuSfos0Qslp3mYKIEpNfotSveYNVU7iUvDga7C6qOhpdJD6vx+Rv menpFBB5wr2Ep33ZT8F4btnBOEED1hzVklr5ulknMldz4FaS+pzlKRsFVW98uA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675959084; a=rsa-sha256; cv=none; b=DmL1Fhi/TbgPZVg6UPCLv5ASG8Ae0fWZfHcKoewc2d3wBFab8M47HSZFWa5gIYY+p7MXrX 0Jz03e0uFBUmN+J3UdqZD/vNy9BrSP9pYADGjj0nvb8ULTNz6ReAv5f16DT9OLQsKX5oaE 5cW7Q/YV3h9d9fgVV1AeaN+BCjD3+5BbeSi0hs/zcG2s9xm3h4NmDixgMUg6UaoP0d/2+/ vIS3BGNAFmflvMJjohvacFKBaYhjya6LrdxNtGO9SpsYbwb8G+LLRtg42P9POPKf1A2e8Q 2QayOa1U3hRTHHoqOp53MkzD8l8w0L7E9fENwzBFsUM+GGiDm6M+gjqDo8ZdZw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCMLM6dXMzk2p; Thu, 9 Feb 2023 16:11:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319GBN4m005429; Thu, 9 Feb 2023 16:11:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319GBNop005428; Thu, 9 Feb 2023 16:11:23 GMT (envelope-from git) Date: Thu, 9 Feb 2023 16:11:23 GMT Message-Id: <202302091611.319GBNop005428@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 4a35f2056381 - stable/13 - netinet6: honor blackhole/unreach routes in the non-fastforwading code. 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: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4a35f20563812b2d21784989651878e3a2d837d8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=4a35f20563812b2d21784989651878e3a2d837d8 commit 4a35f20563812b2d21784989651878e3a2d837d8 Author: Alexander V. Chernikov AuthorDate: 2023-01-22 16:57:36 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-09 15:46:09 +0000 netinet6: honor blackhole/unreach routes in the non-fastforwading code. Currently, under the conditions specified below, IPv6 ingress packet processing can ignore blackhole/reject flag on the prefix. The packet will instead be looped locally till TTL expiration and a single ICMPv6 unreachable message will be send to the source even in case of RTF_BLACKHOLE. The following conditions needs hold to make the scenario happen: * IPv6 forwarding is enabled * Packet is not fast-forwarded * Destination prefix has either RTF_BLACKHOLE or RTF_REJECT flag Fix this behavior by checking for the blackhole/reject flags in ip6_forward(). Reported by: Dmitriy Smirnov Reviewed by: ae Differential Revision: https://reviews.freebsd.org/D38164 MFC after: 3 days (cherry picked from commit 30dd227cff75bdabaac2002a2b17095f3392a485) --- sys/netinet6/ip6_forward.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c index d4306eea416f..7e4b08672726 100644 --- a/sys/netinet6/ip6_forward.c +++ b/sys/netinet6/ip6_forward.c @@ -196,6 +196,15 @@ again: goto bad; } + if (nh->nh_flags & (NHF_BLACKHOLE | NHF_REJECT)) { + IP6STAT_INC(ip6s_cantforward); + if ((nh->nh_flags & NHF_REJECT) && (mcopy != NULL)) { + icmp6_error(mcopy, ICMP6_DST_UNREACH, + ICMP6_DST_UNREACH_REJECT, 0); + } + goto bad; + } + /* * Source scope check: if a packet can't be delivered to its * destination for the reason that the destination is beyond the scope From nobody Thu Feb 9 16:11:24 2023 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 4PCMLP2WThz3plTk; Thu, 9 Feb 2023 16: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 4PCMLP1YQVz4JFN; Thu, 9 Feb 2023 16: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=1675959085; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=enTWaJ4BfUoEELQnyAP0pIs6FMeZ4pAeub6XAjwDCN8=; b=BF4CVlNYmGyJj+HHhZr4Ot4JxKwIpk9zjAFVO45m2UqlEz4kj57u4c64+0SDO+8PdWkDPy S9tqCPU7FYZe8f9sg0dQRYMyHZ5jqpBFRMv+N7j6x7yy6j4Hc/uvuycDqISyX9uYJQn5Xn M4bW0a9onjFD91GnDSWaDxU9uY8uYmQ+bC0cGbpLMdKYxMvntzSKNRMFyGTffYkwI+Xxgg 24OEDBt1iKRokcU5+tZYPtVgQM1UexmqnOjMzYgVZUzvINIJGTpEx3dgJODmOxl7khAEp1 TzQC3kWZJpKlIvmyCVgcszhYBlT0zqsdqTtsJgMBY5bhU6zEVeiQB4FGRV7rig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675959085; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=enTWaJ4BfUoEELQnyAP0pIs6FMeZ4pAeub6XAjwDCN8=; b=chYGe3oG/h6x/TG9q/XHwq2aJ+UVh5EbWxtTBIlxQYkvkLDGXB8A3RFnCulkvaEDoExN4t IgKECSZCdNGz6paDdaq9KjupRD37zFov4xxxGSAAoVa/cdkFIj2Ju4fuVZSifG0X0QGUZy 5CrZ401fFPiTXVYVG5xVXPIYgRocjBxVgwx/39T6U2FCKH+C18h+9w6n+JYOY9j56kTenn BMwQZMWua94Wq1aNUY7wF3OThoCDSr5mYw2daAErF/anOeES1a4WNa0TSNNVmcsZT+sy7P FJH+BnLVEPBBMrZFgj3apt+YJG96f41YGiGKJkWHL77CMesQWZuSBvLCt2+EVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675959085; a=rsa-sha256; cv=none; b=A8L0024tf+cIZ9qf2FwSI32R5nQcsCnjrJKEFY6ViQbj/ZB/zz21dF1ZIsCMaeztRckNNF 1/PLf3gDbY/ykfel/8Fvgi7UhgBV82NP53+PSaefdgG+D72JTsdYEQIdrBiS7n6dmLOWtL M95pYEycv7ig5tdpn28NNLvep7JX0/HqPSWrGx7TE6rEm5PHEU/YMYiztTFez/x93uhdvw mMWeXfKBNx/ZaeNQPdcvOLdoSbNr6CyC2jkmFZ4fxEzH7QQEXblety5ycl2M8CTCWCutsw +Vd1omCsqaesc9du9baHK1tDNkbdQ3xM+EmvUE6fbssLbCzymVfFgZ8FXjjkMQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCMLP0RySzk0h; Thu, 9 Feb 2023 16:11:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319GBOhm005462; Thu, 9 Feb 2023 16:11:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319GBO0v005461; Thu, 9 Feb 2023 16:11:24 GMT (envelope-from git) Date: Thu, 9 Feb 2023 16:11:24 GMT Message-Id: <202302091611.319GBO0v005461@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: b821990ce6c7 - stable/13 - pytest: add an example test fetching test directory and ATF vars. 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: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b821990ce6c7685dbd31edbc0e74d53a0fc05a9e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=b821990ce6c7685dbd31edbc0e74d53a0fc05a9e commit b821990ce6c7685dbd31edbc0e74d53a0fc05a9e Author: Alexander V. Chernikov AuthorDate: 2023-01-25 13:55:33 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-09 15:46:18 +0000 pytest: add an example test fetching test directory and ATF vars. MFC after: 2 weeks (cherry picked from commit 864ea9abfb98493a157dc17be17c428080843bdd) --- tests/examples/test_examples.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/examples/test_examples.py b/tests/examples/test_examples.py index 13fdcc420f0e..fe9ae0a72cf2 100644 --- a/tests/examples/test_examples.py +++ b/tests/examples/test_examples.py @@ -49,6 +49,16 @@ class TestExampleSimple(BaseTest): def test_two(self): pass + @pytest.mark.skip(reason="comment me to run the test") + def test_get_properties(self, request): + """Shows fetching of test src dir and ATF-set variables""" + print() + print("SRC_DIR={}".format(request.fspath.dirname)) + print("ATF VARS:") + for k, v in self.atf_vars.items(): + print(" {}: {}".format(k, v)) + print() + @pytest.mark.skip(reason="comment me to run the test") @pytest.mark.require_user("unprivileged") def test_syscall_failure(self): From nobody Thu Feb 9 16:11:26 2023 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 4PCMLQ4M4Cz3plb3; Thu, 9 Feb 2023 16: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 4PCMLQ2PKyz4JQ8; Thu, 9 Feb 2023 16: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=1675959086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6spWDoFxmIErCIrVHdK+AUGrxt/WzPiSfU3BfPVMmjE=; b=LzfxsHbDTa4xO7q/MBG5Fn9FtjwWPf3y7JWm96j4q6bMLwT96R0P/JKPABttbRMMBj9Qpn FHhLIkfIJ29bAl1fRB4qZ+y/xLyE3WmwwCb6b79VfYQa5vbSoekk/40ZNFLQIc3IJG2oSb +ojvImhL9cHIQr3HvKqJ24ukte3ZoAbUJVCfieAUvUSxyMaJel/MTNNqMSWVwsNPrbZhAf eMW7Y/uli1Vv5KQzN58QBKhzEpUV/okSqkV3u/4ToWm0Ery6Yhjj6+Fpw+vJA0TstZIfhn vYLdzdRAiGxLeD/TLmvafDrFntCOiyUur+ncEA6HKHIY3MZb/vimSWSDEH9nlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675959086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6spWDoFxmIErCIrVHdK+AUGrxt/WzPiSfU3BfPVMmjE=; b=LzGeFknGwVKpjntPIHCAR/erowhHVdqKdG8IXINnpcJvpkBVuG80Ow2SsNX5FY4gt3zgwu eNWBT6iazI/SSDFERbkf+papnBp94ttNNlTgX03CzXWcMQZqXJdF9jzODb2T4slQXXGJUX ZCgfCnJyFgvqYHE9UA1VbLJ9DOrsSA0X+oLbX3M+ZrvjxrVNz7mouMYuDAAJ8Zp1ufRa+j iwpW2BGrNI2TyZN19iYK0PtN1CfM3ZfKjDng8tQTfaFyBoA3T94pm5bYkuwo5u2r9yPB8A rsLyNiZ5U767OCDPlILyaGhfFy9IWXkzyGcjnTerKG0b8zbUocZy0iZmXGFe9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675959086; a=rsa-sha256; cv=none; b=L5MJMex2WrIwIyE+qSksHzCc2WhIczVmQXUO8KR6hwKwbXZfTRiFOKdoXzQb21Rf4/VrFZ WMQFi8BOvxyr0EP1G9dnlyFkZ8i8dyROye1isnekafDTcxSjrTH+QwbK4ur76bbCy4N/Ul 49HKeyzEeYR8nK/12lqu+nVXfZyTFOE7MSK45EwXlzNeiX4BkRJe5JscZ4PzKmqlOuRaJK wLcwtCgb6ZB8Wunj9iFtfEmKV5XoPsJr3i1lDXtyTIxriJRDTsAFAYpiiRH0XkqhX2F8ew HPUDHdthVKxCMvuFfa6NgQLUAHRbB8q3onnA0Kq7lVtf3XEs0dMEwEmnROrymQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCMLQ0zPTzk4v; Thu, 9 Feb 2023 16:11:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319GBQ5c005489; Thu, 9 Feb 2023 16:11:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319GBQPr005488; Thu, 9 Feb 2023 16:11:26 GMT (envelope-from git) Date: Thu, 9 Feb 2023 16:11:26 GMT Message-Id: <202302091611.319GBQPr005488@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 5e598a761c37 - stable/13 - pytest: delete interfaces from inside the jail. 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: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5e598a761c37dbd491579a0805968ae50ac72465 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=5e598a761c37dbd491579a0805968ae50ac72465 commit 5e598a761c37dbd491579a0805968ae50ac72465 Author: Alexander V. Chernikov AuthorDate: 2023-01-25 16:32:52 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-09 15:46:25 +0000 pytest: delete interfaces from inside the jail. This change follows the approach used in 80fc25025ffc, to minimise the impact of the delayed interface migration. MFC after: 2 weeks (cherry picked from commit 20ea7f26e41375828a390fba613b86acfe366add) --- tests/atf_python/sys/net/vnet.py | 46 ++++++++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/tests/atf_python/sys/net/vnet.py b/tests/atf_python/sys/net/vnet.py index 1a8efe0d9edc..1f61269ffe6c 100644 --- a/tests/atf_python/sys/net/vnet.py +++ b/tests/atf_python/sys/net/vnet.py @@ -1,6 +1,7 @@ #!/usr/local/bin/python3 import copy import ipaddress +import re import os import socket import sys @@ -150,6 +151,7 @@ class VnetInterface(object): class IfaceFactory(object): INTERFACES_FNAME = "created_ifaces.lst" + AUTODELETE_TYPES = ("epair", "lo", "tap", "tun") def __init__(self): self.file_name = self.INTERFACES_FNAME @@ -158,19 +160,46 @@ class IfaceFactory(object): with open(self.file_name, "a") as f: f.write(iface_name + "\n") + def _list_ifaces(self) -> List[str]: + ret: List[str] = [] + try: + with open(self.file_name, "r") as f: + for line in f: + ret.append(line.strip()) + except OSError: + pass + return ret + def create_iface(self, alias_name: str, iface_name: str) -> List[VnetInterface]: ifaces = VnetInterface.create_iface(alias_name, iface_name) for iface in ifaces: - self._register_iface(iface.name) + if not self.is_autodeleted(iface.name): + self._register_iface(iface.name) return ifaces + @staticmethod + def is_autodeleted(iface_name: str) -> bool: + iface_type = re.split(r"\d+", iface_name)[0] + return iface_type in IfaceFactory.AUTODELETE_TYPES + + def cleanup_vnet_interfaces(self, vnet_name: str) -> List[str]: + """Destroys""" + ifaces_lst = ToolsHelper.get_output( + "/usr/sbin/jexec {} ifconfig -l".format(vnet_name) + ) + for iface_name in ifaces_lst.split(): + if not self.is_autodeleted(iface_name): + if iface_name not in self._list_ifaces(): + print("Skipping interface {}:{}".format(vnet_name, iface_name)) + continue + run_cmd( + "/usr/sbin/jexec {} ifconfig {} destroy".format(vnet_name, iface_name) + ) + def cleanup(self): try: - with open(self.file_name, "r") as f: - for line in f: - run_cmd("/sbin/ifconfig {} destroy".format(line.strip())) os.unlink(self.INTERFACES_FNAME) - except Exception: + except OSError: pass @@ -260,7 +289,7 @@ class VnetFactory(object): try: jid_str = run_cmd(cmd) jid = int(jid_str) - except ValueError as e: + except ValueError: print("Jail creation failed, output: {}".format(jid_str)) raise self._register_vnet(vnet_name) @@ -276,13 +305,12 @@ class VnetFactory(object): return VnetInstance(vnet_alias, vnet_name, jid, ifaces) def cleanup(self): + iface_factory = IfaceFactory() try: with open(self.file_name) as f: for line in f: vnet_name = line.strip() - ToolsHelper.print_output( - "/usr/sbin/jexec {} ifconfig -l".format(vnet_name) - ) + iface_factory.cleanup_vnet_interfaces(vnet_name) run_cmd("/usr/sbin/jail -r {}".format(vnet_name)) os.unlink(self.JAILS_FNAME) except OSError: From nobody Thu Feb 9 16:11:27 2023 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 4PCMLR3VLHz3plRQ; Thu, 9 Feb 2023 16: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 4PCMLR2gxhz4JYb; Thu, 9 Feb 2023 16: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=1675959087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j+kpf4CG3IRc6meOmA0QA2L63lJ66cMELu31Ko4O6ek=; b=v67a34W7fTa2N1M0oW4fo5KlU6vkty9wnsnjrh9p0jlsvRMHRZfTuYiTbK6dBNpGUAJ/nO qcCdR1UhNyxP3vK3CduM81qKZSZRLx4BdF8m2xRWXe5/aPpGZ+y2yCDLwArODLXqzz9eaL jczb1F/G9ikAcqt8z8fmW6oiS/JmrjUsj/Wm3QHgEI50XNoKroGC+7A93YflVrWxKRiBFz 7Xa4uW6h2bTB6sD/2M8GP6QJczo9zHHHgJbn9wfuVycd1dMNV4G7pHb4qm8salpQOxZ+jK WvoL8TqeL1xPeBBvUpqA4Dcu7jGAfXyHUo6LKX6z24BPrNp5dZB42GWegF13qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675959087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j+kpf4CG3IRc6meOmA0QA2L63lJ66cMELu31Ko4O6ek=; b=MnYJohpp6PINDEN5bPl4T3bvnJF6LxtWPhBTDiUGVTE4rBbA11/kjUii+I629rXLnFc0zS V/WHfHnCAnJTYcYK9LAo+gDj5QmPRizoEC6HmHgFc4yb5ZZujjpVz2y8i8s1QpX/WCIlEW 356ndE24c1rb6VmLaQxrnPX7i40Aie5PGzmJdXumFq/g+mmR701Zb20GASaB93zl17e/1s XLJN167y0sDh0ZnxBA1gaYXLsDq9oEikrivqB2DaWgpZbHTSCvLQ7DKL4QFTZ+3KEIwBzG V97zGdGJAaQBCMFwk48k21pGyy7nYd4Sg2/OVscDzvDgBSbmCWBLApUX25xHeQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675959087; a=rsa-sha256; cv=none; b=X1/yX2NCLzaL1SplCRsG0Ei4SjytDW2fwmksIOwIS/SEhFZzi3PZlpBQn1L+IgSja4/zo4 D1CSMFeVi0bspX+WamzLpeAN5S3g5PP4zZkHVYmQAZ0YoEN8lWxK+5Q1A2euUyGsOz3fff Ngc6FsI+yJDPC9k1E1iors0iPR9XyKgEwsS+ionT6vd1+TB6ohnyFipFcTH5NpWUnIdHNQ 43EkGj4m5r1mJGlbbroAj8em6gUzPxL4tdGITkD14xW4Em+lVVAOIcxLxuRX0uVS3T38GT J2qSTZfMr8DFJB9RRVE6VrS8xybrr4tNGPdxIjJsohUZ9ZBDlfF5MxYvz2MNBw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCMLR1hGNzjlg; Thu, 9 Feb 2023 16:11:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319GBRhJ005513; Thu, 9 Feb 2023 16:11:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319GBRev005512; Thu, 9 Feb 2023 16:11:27 GMT (envelope-from git) Date: Thu, 9 Feb 2023 16:11:27 GMT Message-Id: <202302091611.319GBRev005512@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 6058f6cc48f5 - stable/13 - netlink: add NETLINK to GENERIC. 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: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6058f6cc48f5ec02476bf46693673bd71291a5c0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=6058f6cc48f5ec02476bf46693673bd71291a5c0 commit 6058f6cc48f5ec02476bf46693673bd71291a5c0 Author: Alexander V. Chernikov AuthorDate: 2023-01-31 14:22:11 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-09 15:52:09 +0000 netlink: add NETLINK to GENERIC. This is a followup of 692e19cf5195 (add netlink to GENERIC@amd64). Netlink is a communication protocol defined in RFC 3549. It is async, TLV-based protocol, providing 1-1 and 1-many communications between kernel and userland. Netlink is currently used in Linux kernel to modify, read and subscribe for nearly all networking states. Interface state, addresses, routes, firewall, rules, fibs, etc, are controlled via Netlink. Netlink support was added in D36002. It has got a number of improvements and first customers since then: * net/bird2 got netlink support, enabling route multipath in FreeBSD * netlink-based devd notifications are being worked on ( D37574 ). * linux(4) fully supports and depends on Netlink Enabling Netlink in GENERIC targets two goals. The first one is to provide stability for the third-party userland applications, so they can rely on the fact that netlink always exists since 14.0 and potentially 13.2. Loadable module makes life of the app delepers harder. For example, `net/bird2` can be either build with netlink or rtsock support, but not both. The second goal is to enable gradual conversion of the base userland tools to use netlink(4) interfaces. Converting tools like netstat (D36529), route, ifconfig one-by-one simplifies testing and addressing the feedback. Othewise, switching all base to use netlink at once may be too big of a leap. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D37783 (cherry picked from commit e80699a809a079c4e673940544d6ddd944e8d08e) --- sys/arm/conf/std.armv7 | 1 + sys/arm64/conf/GENERIC | 1 + sys/i386/conf/GENERIC | 1 + sys/powerpc/conf/GENERIC64 | 1 + sys/riscv/conf/GENERIC | 1 + 5 files changed, 5 insertions(+) diff --git a/sys/arm/conf/std.armv7 b/sys/arm/conf/std.armv7 index dbe863d9da92..7cc4adb5bef2 100644 --- a/sys/arm/conf/std.armv7 +++ b/sys/arm/conf/std.armv7 @@ -11,6 +11,7 @@ options INET6 # IPv6 communications protocols options TCP_HHOOK # hhook(9) framework for TCP device crypto # core crypto support options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 +options NETLINK # netlink(4) support options SCTP_SUPPORT # Allow kldload of SCTP options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support diff --git a/sys/arm64/conf/GENERIC b/sys/arm64/conf/GENERIC index f8842d672c0e..9f7a67e2079a 100644 --- a/sys/arm64/conf/GENERIC +++ b/sys/arm64/conf/GENERIC @@ -31,6 +31,7 @@ options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 +options NETLINK # netlink(4) support options ROUTE_MPATH # Multipath routing support options FIB_ALGO # Modular fib lookups options TCP_OFFLOAD # TCP offload diff --git a/sys/i386/conf/GENERIC b/sys/i386/conf/GENERIC index 0bac5ba4c846..921b099ecf17 100644 --- a/sys/i386/conf/GENERIC +++ b/sys/i386/conf/GENERIC @@ -32,6 +32,7 @@ options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 +options NETLINK # netlink(4) support options ROUTE_MPATH # Multipath routing support options TCP_HHOOK # hhook(9) framework for TCP options TCP_OFFLOAD # TCP offload diff --git a/sys/powerpc/conf/GENERIC64 b/sys/powerpc/conf/GENERIC64 index 1e7fd9759874..73d6ce5d4576 100644 --- a/sys/powerpc/conf/GENERIC64 +++ b/sys/powerpc/conf/GENERIC64 @@ -42,6 +42,7 @@ options VIMAGE # Subsystem virtualization, e.g. VNET options INET #InterNETworking options INET6 #IPv6 communications protocols options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 +options NETLINK # netlink(4) support options ROUTE_MPATH # Multipath routing support options TCP_OFFLOAD # TCP offload options TCP_BLACKBOX # Enhanced TCP event logging diff --git a/sys/riscv/conf/GENERIC b/sys/riscv/conf/GENERIC index 7d158269cde0..9c97e40f1db2 100644 --- a/sys/riscv/conf/GENERIC +++ b/sys/riscv/conf/GENERIC @@ -31,6 +31,7 @@ options INET # InterNETworking options INET6 # IPv6 communications protocols options TCP_HHOOK # hhook(9) framework for TCP options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 +options NETLINK # netlink(4) support options ROUTE_MPATH # Multipath routing support options TCP_OFFLOAD # TCP offload options TCP_BLACKBOX # Enhanced TCP event logging From nobody Thu Feb 9 16:40:35 2023 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 4PCN042F2Cz3ppGl; Thu, 9 Feb 2023 16:40: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 4PCN041kTjz4N9T; Thu, 9 Feb 2023 16:40:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675960836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QeNHEf0J57rwnS8N4Cdw+cphIk4pWd7r9Qwlp0WrU00=; b=eqFK0PZVm9YAs4Gv0py3czg3MnlXkamcAh6Q2ryiRSqUBra1LYwxv0OzknGR9m7yEPjP3g jQyI4StHrmyE/ezwDQCXaYCLMnIvstGJNM62sDSnKPqL0QF4RiUcnUX+Q2DjhZQdRfB3CS OOHERKf4XnAyaAunvBGG6S2DZjn9cXR2WTS7408Pb9VPjyS1YWdHN+ZORkgex+f5fIxkdz iqzQzz7Kgw0ZZqsMTqQ+tNTj2B7ILd1wqfdVQeH0r5xPgjVCNSox/vuLWP8ZjTNfuj+1ld ackjXxKphgkdR4ZXxDoJqHKu32mVBvy1ZlWgEuMAUGE5lX3ft/9vxHkfmi0/nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675960836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QeNHEf0J57rwnS8N4Cdw+cphIk4pWd7r9Qwlp0WrU00=; b=uCR9H3XvyG0mND8sB3rs5BNs65mnS8oRimH+1z9hP+m7DPMd5t+ePk+iYZ/MGfcEtxc9Ry 4tmRs7wGqjDV63bd1JVqJI5DKsp7MxP/LJRqM7SUrkCpraP8tFsoC/xM6ZZeA58lu4QUaj WsuQjcaeQX39uOte/fywim/YNwVJM4Q+R0cmjpwAPx0KJJ7Qpcdq0pu5Xx77vvzO2fBDeh l8oTF5i0ncI4ODI6SRg9tlkmF+pSBjd/djR1f9/MFetp0YWXwX/qyJTBqnWxAYquFSBkAw PqNiMHgr+ljeiCaYscKo9/Va5JuiFF6z+D4ZNRIFPY88CWFg41DOqBb3WZrUFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675960836; a=rsa-sha256; cv=none; b=HOqOJ0lbjFg86RI4c3BWADndACz7eajfl0+p4EO7w2rHyl2ij0iUjgKx8/eEvYDAkY4PyT 9kSJbgfA7BLHOguPMtR3sUSQ/PZR8Z37/xSIg/ZpgFSyNQMMxl+/wa10WCPn+R1N3r94Tf pgVgVdbiUB4uuQatR/MklSzUMhdQhEBRhp7HWsX2i1+WaicKWKKp0Wo7PAt6zEOXwm4U4m vWEOgAle0WSbBkwXNsskhnkNHpynlS+X2cC2Pl90rM66tRjPA+XpBiCOAVYBgszLUP0nKl /gYzhhGu5h4a8UHB/kjOszBqyXq80Wi4d8ntFcSFuriCcNp5fNrEGWR/T1AUEg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCN040hwhzkHw; Thu, 9 Feb 2023 16:40:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319GeajX047583; Thu, 9 Feb 2023 16:40:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319GeZO2047582; Thu, 9 Feb 2023 16:40:35 GMT (envelope-from git) Date: Thu, 9 Feb 2023 16:40:35 GMT Message-Id: <202302091640.319GeZO2047582@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 23d017b8d4c2 - stable/13 - netlink: add "netlink" to the list of kernel features 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: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 23d017b8d4c2a17bca15fe794dd0b2deb7e18f03 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=23d017b8d4c2a17bca15fe794dd0b2deb7e18f03 commit 23d017b8d4c2a17bca15fe794dd0b2deb7e18f03 Author: Alexander V. Chernikov AuthorDate: 2023-01-30 11:13:51 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-09 16:37:15 +0000 netlink: add "netlink" to the list of kernel features Reduce the amount of debug messages on module init/detach. MFC after: 1 week (cherry picked from commit 7fc9cfa57ccd4ee8ee71f8edfacfc26afab9cd2e) --- sys/netlink/netlink_module.c | 10 +++++----- sys/netlink/netlink_route.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/netlink/netlink_module.c b/sys/netlink/netlink_module.c index a433022b82b7..f820796a6028 100644 --- a/sys/netlink/netlink_module.c +++ b/sys/netlink/netlink_module.c @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include MALLOC_DEFINE(M_NETLINK, "netlink", "Memory used for netlink packets"); +FEATURE(netlink, "Netlink support"); #define DEBUG_MOD_NAME nl_mod #define DEBUG_MAX_LEVEL LOG_DEBUG3 @@ -156,7 +157,7 @@ netlink_register_proto(int proto, const char *proto_name, nl_handler_f handler) nl_handlers[proto].cb = handler; nl_handlers[proto].proto_name = proto_name; NL_GLOBAL_UNLOCK(); - NL_LOG(LOG_DEBUG, "Registered netlink %s(%d) handler", proto_name, proto); + NL_LOG(LOG_DEBUG2, "Registered netlink %s(%d) handler", proto_name, proto); return (true); } @@ -170,7 +171,7 @@ netlink_unregister_proto(int proto) nl_handlers[proto].cb = NULL; nl_handlers[proto].proto_name = NULL; NL_GLOBAL_UNLOCK(); - NL_LOG(LOG_DEBUG, "Unregistered netlink proto %d handler", proto); + NL_LOG(LOG_DEBUG2, "Unregistered netlink proto %d handler", proto); return (true); } @@ -203,12 +204,11 @@ netlink_modevent(module_t mod __unused, int what, void *priv __unused) switch (what) { case MOD_LOAD: - NL_LOG(LOG_DEBUG, "Loading"); - NL_LOG(LOG_NOTICE, "netlink support is in BETA stage"); + NL_LOG(LOG_DEBUG2, "Loading"); break; case MOD_UNLOAD: - NL_LOG(LOG_DEBUG, "Unload called"); + NL_LOG(LOG_DEBUG2, "Unload called"); if (can_unload()) { NL_LOG(LOG_WARNING, "unloading"); netlink_unloading = 1; diff --git a/sys/netlink/netlink_route.c b/sys/netlink/netlink_route.c index 42b0bc66666e..037fd2170c66 100644 --- a/sys/netlink/netlink_route.c +++ b/sys/netlink/netlink_route.c @@ -115,7 +115,7 @@ static struct rtbridge *nlbridge_orig_p; static void rtnl_load(void *u __unused) { - NL_LOG(LOG_NOTICE, "rtnl loading"); + NL_LOG(LOG_DEBUG2, "rtnl loading"); nlbridge_orig_p = netlink_callback_p; netlink_callback_p = &nlbridge; rtnl_neighs_init(); From nobody Thu Feb 9 16:44:37 2023 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 4PCN4j4Xhhz3pplr; Thu, 9 Feb 2023 16:44: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 4PCN4j3q38z4P0F; Thu, 9 Feb 2023 16:44:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675961077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B5mb/v0lRZ4Kx1+cgrtvDPkjYgisQ5lk2rV+ZIl0ctc=; b=gbU1WsIoMnqSVGyQAdTrD8nnEiLY9H8sJvNv6oBfqt2BYk1th0ssdVZQLwwg/SIFUJ5Ft1 4nJirc/CpAet97Ov5sNTluKr5qVg0ENuaIW/TA0tidYO/SKy3BYUpfu0t3tWAmR+fTceFm 23fU+0xsNVZL0rCt0RmttSYlsHdMimx3s4AjsFJ97A6ZcNvDHUQHHFMsOb++HmYaIpJ0T+ o3NypbePObbg+g562H6xeGLDz0Y4vtdIz34xRZ8j1s2ExEawIKLlXOY8NPOlGQsVRLIMmz I+1euFBIekRUkYM0KDMrwQO/Tf3eyR90KU0clIX0qxvpepRqf5kytH/Xfc0icw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675961077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B5mb/v0lRZ4Kx1+cgrtvDPkjYgisQ5lk2rV+ZIl0ctc=; b=ssIa3nHjILeOkNbda5igpcuxaaUkq4+rC423rI+yraoYnIIi0G45WR96C/ZUilZSO1cdSS x/gT0vQl/u+ucNEg4lWje0WFmOYOKpgpwyG8WBkrk7PsCfdLM2n07WhRXxsLJTRqtaEZHb 5gbuzHMXmbId0RJFoFu1glpBiAm4lq8Sh5WdVOa1gp5GpQZkQaY0NFufpaTTmVk/639sOY kKU/L6jsO0bEcVANarFFRlcbn/sc0c//ZDYnPLlVplW9Fry9oJ02Bwzm8PtNXbDi+ZOyoR UwGrdO/ysRcbvIkzeUwX8LzhCpGDa8IQlet1QCItr6DnYj86DNVhhkpjhkergA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675961077; a=rsa-sha256; cv=none; b=q9gBk4ivWW8Co6AaubEnSg/QAMw/1qpVZpQqodpdx6Eh4hw/ge4iGCuJP1isUYciSaJQ/0 QW6lbo2GjdRJd4Rx0ITO6r2Onhb3QANzFj5X1QyccYgi71RLlb7jsTt81Tno/YxS4MnImb uU2hFrHZuNK7LOwJgFDeF+hJNQbgBznP1VJdIIOmjo/u3o7A7VenaC0oyMiOI/H0WGfujN bXu4JsVApOtH7T8Ux4q2HQf2qwBCBDPbu74nPMoXW5Qp9+48cq+8EJR7tsBqq9gNUUsQDL 8Am0rHz0vhZbwWGdx73pl1poEkf/KlzcrsxWf+mCCwV9eux8Vb/EY0LtLJinVA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCN4j2rZxzkXm; Thu, 9 Feb 2023 16:44:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319Gib2C052437; Thu, 9 Feb 2023 16:44:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319Gib1v052436; Thu, 9 Feb 2023 16:44:37 GMT (envelope-from git) Date: Thu, 9 Feb 2023 16:44:37 GMT Message-Id: <202302091644.319Gib1v052436@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 0169daa1f2cd - stable/13 - carp: turn net.inet.carp.allow into a RW tunable 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: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0169daa1f2cd62394e7d068cbb405d64a8316bbc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=0169daa1f2cd62394e7d068cbb405d64a8316bbc commit 0169daa1f2cd62394e7d068cbb405d64a8316bbc Author: Boris Lytochkin AuthorDate: 2023-01-29 16:42:40 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-09 16:41:34 +0000 carp: turn net.inet.carp.allow into a RW tunable Currently CARP starts announcing its state when initialised, regardless of the state of the other services provided by the server. As a result, the device can become master while still loading the firewall ruleset or initialising long-starting service. This change adds the way to request delayed CARP start by setting the net.inet.carp.allow=0 in the loader.conf. Differential Revision: https://reviews.freebsd.org/D38167 MFC after: 2 weeks (cherry picked from commit ee49c5d33d93a6b10222f64a0dc16590ac2048a0) --- sys/netinet/ip_carp.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 71558be619d8..e84a85ebc11e 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -221,8 +221,8 @@ static int carp_demote_adj_sysctl(SYSCTL_HANDLER_ARGS); SYSCTL_NODE(_net_inet, IPPROTO_CARP, carp, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "CARP"); SYSCTL_PROC(_net_inet_carp, OID_AUTO, allow, - CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, - 0, 0, carp_allow_sysctl, "I", + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + &VNET_NAME(carp_allow), 0, carp_allow_sysctl, "I", "Accept incoming CARP packets"); SYSCTL_PROC(_net_inet_carp, OID_AUTO, dscp, CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, @@ -2238,6 +2238,15 @@ carp_mod_cleanup(void) sx_destroy(&carp_sx); } +static void +ipcarp_sysinit(void) +{ + + /* Load allow as tunable so to postpone carp start after module load */ + TUNABLE_INT_FETCH("net.inet.carp.allow", &V_carp_allow); +} +VNET_SYSINIT(ip_carp, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, ipcarp_sysinit, NULL); + static int carp_mod_load(void) { From nobody Thu Feb 9 16:49:05 2023 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 4PCN9s4mRwz3pqKr; Thu, 9 Feb 2023 16: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 4PCN9s4F37z4PPC; Thu, 9 Feb 2023 16: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=1675961345; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=68nUGRu1UQGtv7MXOGRFH4gXhZ5woushJkqgZxMZ+H0=; b=DGYUNnxBzC5r5yjnbp8FN9bQps0dq/XwJSufnb7jxAoMFRJ2jJ2VkL0xZwY35HBJ9v8LCt cbTQuODTykZjDxH1QkuA0U8xmIVJf0cCNH8GI3xs85zSf8y3Kndkqfe7a3V1Uy1C7ApYKF hEx+tCU1N68G5riN8ewzgKiFy8S0ZQSASmZfZJDRasLqX8gm4/z5Mjtc9bovjkrqUhAAHL WoLv/3VM+MzNYO58P9Z9FoagehpiTT4iCNh3VdSdYr3WcpcvNfsTtA5GotIjPIyMSvleun 8N+tU9tOFRr0GMmJRn2bGzuZkdTlqlAJcN0DQOnOCP5tT1td73hlqcWk+lQknw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675961345; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=68nUGRu1UQGtv7MXOGRFH4gXhZ5woushJkqgZxMZ+H0=; b=CKf0s3ustTdaZ47/7ZMSW3hJlta01CCqaJZkJ4dlO+I5IMg/FohAiNThPR0YlkaiQQNdwN 7wr2vgDk9GRSqdexhEQlA4+1kSayHk3oPfQO9yCq276YsrDNxKhjwfKELNLvhav4bQ/TYm eKfRLxCOcP5L6UX3gNsl6GQZuehUpthr6Wzi5nKdDByl7UOvoNse8N6kA/nygfPRCB26D2 X61EQX0WgmWK1xaSYGW2aW3AWOBPDVuwncYhDjpbrP0ivL29mut2I/VW+Ql/6icIni2wem eKHyvs24UG7jm3xVcqpyGvbjGQy3IB2sRejFaxv/hJdVJIu9hIPcP+jcrjIV4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675961345; a=rsa-sha256; cv=none; b=dYayiiRg0v5xGfvbPwJG46QGg8WzRrBBey0SyQrP3RjzUptCLIrC/mV82ottp0QlPaVDa+ ynK7ZmWi4ksIdmO6DCJQgi24GZqUQKGMdODlOZV0tTr3bbkmRkqhtDDkCsl+0QS/08TcxM 3zGBUFo2fn5j18XEmCzS+DLOeMa/a+z2DADrXZHmKPdYOU71JMB9RxqA8p21MtPfBZaWy+ pYfuYJeY+CNyIqRNoOxGm6OjBe6vtSW1qy8pjv/6s6sgBCtBgliuwnZ0hXBwxnuI6Pb6oN PL0+eYVcwqmhrcVcU3ybivXr6CUwY8HmNtYOY6ZcfjnVsaYMR7lWL8Lc5OoNyQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCN9s3L0Nzkbc; Thu, 9 Feb 2023 16:49:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319Gn5u8053128; Thu, 9 Feb 2023 16:49:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319Gn5g6053127; Thu, 9 Feb 2023 16:49:05 GMT (envelope-from git) Date: Thu, 9 Feb 2023 16:49:05 GMT Message-Id: <202302091649.319Gn5g6053127@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: d4be9d601d35 - stable/13 - netlink: export nextop group kernel index when dumping multipath route. 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: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d4be9d601d356e0790334d1ae039cab5ecaf0a2c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=d4be9d601d356e0790334d1ae039cab5ecaf0a2c commit d4be9d601d356e0790334d1ae039cab5ecaf0a2c Author: Alexander V. Chernikov AuthorDate: 2023-01-28 15:37:58 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-09 16:44:53 +0000 netlink: export nextop group kernel index when dumping multipath route. MFC after: 2 weeks (cherry picked from commit 95b47ba6299401b487f29a05ac859629ee7d4f0b) --- sys/netlink/route/rt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netlink/route/rt.c b/sys/netlink/route/rt.c index 07735cd9d5bc..9173f5cc58ea 100644 --- a/sys/netlink/route/rt.c +++ b/sys/netlink/route/rt.c @@ -175,6 +175,7 @@ dump_rc_nhg(struct nl_writer *nw, const struct nhgrp_object *nhg, struct rtmsg * if (uidx != 0) nlattr_add_u32(nw, NL_RTA_NH_ID, uidx); + nlattr_add_u32(nw, NL_RTA_KNH_ID, nhgrp_get_idx(nhg)); nlattr_add_u32(nw, NL_RTA_RTFLAGS, base_rtflags); int off = nlattr_add_nested(nw, NL_RTA_MULTIPATH); From nobody Thu Feb 9 16:49:06 2023 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 4PCN9t6GTXz3pqBp; Thu, 9 Feb 2023 16:49: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 4PCN9t5TRcz4PXC; Thu, 9 Feb 2023 16:49:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675961346; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2LgaNW3k6s/2xrZY2G5/G9WAHTsKJdoBkj6Ex/FTZPE=; b=tIzXPrc3PpGyWR2P/tMgL5LWiylfCVj+ehUAjMq682BwKBJhIsSOzV3MItwIz6Kc6of1uc BQBCHb5hVbLtZG1lmfqIDuDj+xSDTwsjx3GCpnLQ7jpQpCy21GQSIlJKAsxzXuHsQgclia o/TDt2DoEXBBmmo5E8uY5WoEX9qVSNyYZQToPcQY5H/64Vq2IdItrSsiT7rhfMwaIdshZR 1URpSzQTth7lR21c2aHsXnoWE+7ykbQc2QTSHBosCieDDR5fH+8bL6IWuZiuMVv/b0+2d2 /HUdRo5apUNTgBm6HFA8PEQrPOza2bNWWJvjFUK5Xil6FR/9NwJf5Et6Z7LotA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675961346; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2LgaNW3k6s/2xrZY2G5/G9WAHTsKJdoBkj6Ex/FTZPE=; b=VmEbwgDXQY/k3wixjENB1X8q1pSX+8heSib+B+XMdUSxQWUS1KsHlSTAbXdQ8+PRi9o8nY KUWi/eSc68pJY3yfVZgfgjaEqDO/hYnIkSJwvKonIHVRpVRb9gmyBZ0wRLSLG6MYaw0xSF Mns2IAYA1lYDWzqJdeMzooOP5wMLYPYVQFCDD/lB4PRaDLlguQILVCt0LVe+Ofo4o0uBU2 FPEkcn/UZwCqhb8kjv2aDHmAmZFJSWCQRhV7hOshvaUf+cNou0bmgyFponX7+leyjPXdCX rm1yEqYRZHryhiIdBiLfIx2df7a7pvZPyymCw9km7c27aQzjYE1DueSUuHditQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675961346; a=rsa-sha256; cv=none; b=wkWtRv+bzP8Pqmvz8vGlA2rC0SufNSaq3Y4gr47Tdq2Bb7JTjfRpV7NXNK0t3DainLhHGm cLQbC41KLWhjkzuzKEiDa/dhjD/7W8VzbKyc7wzE9j//VCiqVtQHkyxxMuGYTZye8Exq6j Hmjv4YkPE41yPWgASyVrpvEX86MLDiS4OKGmZqTVIFLfXzHyURQEjBhO92RIjozXtlAOGM K7BiZqrpUkHNvtJo4aK6EKVO0FUpqg2jzWdtLZUODulK3XvSSYgej2AsX/N6C6wExYr9if upQ3nAk5RPq8vLvm4T3XMCUx6oDRycj2dZIT3Hz12g2TrXNH4OronyzurdU0VA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCN9t4JDwzkXp; Thu, 9 Feb 2023 16:49:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319Gn68g053159; Thu, 9 Feb 2023 16:49:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319Gn64Y053158; Thu, 9 Feb 2023 16:49:06 GMT (envelope-from git) Date: Thu, 9 Feb 2023 16:49:06 GMT Message-Id: <202302091649.319Gn64Y053158@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 172dc4b1b96a - stable/13 - netlink: allow path weight manipulations for single-path routes. 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: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 172dc4b1b96a2fca3bd81543390cef1ea489d406 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=172dc4b1b96a2fca3bd81543390cef1ea489d406 commit 172dc4b1b96a2fca3bd81543390cef1ea489d406 Author: Alexander V. Chernikov AuthorDate: 2023-01-29 15:53:34 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-09 16:45:01 +0000 netlink: allow path weight manipulations for single-path routes. Add support for the scenario when user adds/deletes paths for a single prefix one-by-one, all with different weights. This change adds a new FreeBSD-specific RTA attribute, NL_RTA_WEIGHT. When dumping non-multipath routes, this attribute is added if the route weight is not RT_DEFAULT_WEIGHT. When adding a new route, this attribute is parsed as a relative path weight. MFC after: 2 weeks (cherry picked from commit 3ebccb20d56455f4bef1366f942680d1b60828f6) --- sys/netlink/route/route.h | 3 ++- sys/netlink/route/rt.c | 19 +++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/sys/netlink/route/route.h b/sys/netlink/route/route.h index 6e1ef6cbf0c6..b4b326b2b06b 100644 --- a/sys/netlink/route/route.h +++ b/sys/netlink/route/route.h @@ -157,8 +157,9 @@ enum rtattr_type_t { NL_RTA_FLOW = 11, /* not supported */ NL_RTA_CACHEINFO = 12, /* not supported */ NL_RTA_SESSION = 13, /* not supported / deprecated */ + NL_RTA_WEIGHT = 13, /* u32, FreeBSD specific, path weight */ NL_RTA_MP_ALGO = 14, /* not supported / deprecated */ - NL_RTA_RTFLAGS = 14, /* u32, FreeBSD specific, */ + NL_RTA_RTFLAGS = 14, /* u32, FreeBSD specific, path flags (RTF_)*/ NL_RTA_TABLE = 15, /* u32, fibnum */ NL_RTA_MARK = 16, /* not supported */ NL_RTA_MFC_STATS = 17, /* not supported */ diff --git a/sys/netlink/route/rt.c b/sys/netlink/route/rt.c index 9173f5cc58ea..48a6b0928cab 100644 --- a/sys/netlink/route/rt.c +++ b/sys/netlink/route/rt.c @@ -208,14 +208,15 @@ dump_rc_nhg(struct nl_writer *nw, const struct nhgrp_object *nhg, struct rtmsg * #endif static void -dump_rc_nhop(struct nl_writer *nw, const struct nhop_object *nh, struct rtmsg *rtm) +dump_rc_nhop(struct nl_writer *nw, const struct route_nhop_data *rnd, struct rtmsg *rtm) { #ifdef ROUTE_MPATH - if (NH_IS_NHGRP(nh)) { - dump_rc_nhg(nw, (const struct nhgrp_object *)nh, rtm); + if (NH_IS_NHGRP(rnd->rnd_nhop)) { + dump_rc_nhg(nw, rnd->rnd_nhgrp, rtm); return; } #endif + const struct nhop_object *nh = rnd->rnd_nhop; uint32_t rtflags = nhop_get_rtflags(nh); /* @@ -243,6 +244,9 @@ dump_rc_nhop(struct nl_writer *nw, const struct nhop_object *nh, struct rtmsg *r /* In any case, fill outgoing interface */ nlattr_add_u32(nw, NL_RTA_OIF, nh->nh_ifp->if_index); + + if (rnd->rnd_weight != RT_DEFAULT_WEIGHT) + nlattr_add_u32(nw, NL_RTA_WEIGHT, rnd->rnd_weight); } /* @@ -309,7 +313,7 @@ dump_px(uint32_t fibnum, const struct nlmsghdr *hdr, rtm = nlattr_restore_offset(nw, rtm_off, struct rtmsg); if (plen > 0) rtm->rtm_dst_len = plen; - dump_rc_nhop(nw, rnd->rnd_nhop, rtm); + dump_rc_nhop(nw, rnd, rtm); if (nlmsg_end(nw)) return (0); @@ -438,6 +442,7 @@ struct nl_parsed_route { uint32_t rta_table; uint32_t rta_rtflags; uint32_t rta_nh_id; + uint32_t rta_weight; uint32_t rtax_mtu; uint8_t rtm_family; uint8_t rtm_dst_len; @@ -457,6 +462,7 @@ static const struct nlattr_parser nla_p_rtmsg[] = { { .type = NL_RTA_GATEWAY, .off = _OUT(rta_gw), .cb = nlattr_get_ip }, { .type = NL_RTA_METRICS, .arg = &metrics_parser, .cb = nlattr_get_nested }, { .type = NL_RTA_MULTIPATH, .off = _OUT(rta_multipath), .cb = nlattr_get_multipath }, + { .type = NL_RTA_WEIGHT, .off = _OUT(rta_weight), .cb = nlattr_get_uint32 }, { .type = NL_RTA_RTFLAGS, .off = _OUT(rta_rtflags), .cb = nlattr_get_uint32 }, { .type = NL_RTA_TABLE, .off = _OUT(rta_table), .cb = nlattr_get_uint32 }, { .type = NL_RTA_VIA, .off = _OUT(rta_gw), .cb = nlattr_get_ipvia }, @@ -849,8 +855,9 @@ rtnl_handle_newroute(struct nlmsghdr *hdr, struct nlpcb *nlp, } } - int weight = NH_IS_NHGRP(nh) ? 0 : RT_DEFAULT_WEIGHT; - struct route_nhop_data rnd = { .rnd_nhop = nh, .rnd_weight = weight }; + if (!NH_IS_NHGRP(nh) && attrs.rta_weight == 0) + attrs.rta_weight = RT_DEFAULT_WEIGHT; + struct route_nhop_data rnd = { .rnd_nhop = nh, .rnd_weight = attrs.rta_weight }; int op_flags = get_op_flags(hdr->nlmsg_flags); error = rib_add_route_px(attrs.rta_table, attrs.rta_dst, attrs.rtm_dst_len, From nobody Thu Feb 9 16:52:23 2023 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 4PCNFg5zzGz3pqTQ; Thu, 9 Feb 2023 16:52: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 4PCNFg5XWFz4Q5t; Thu, 9 Feb 2023 16:52:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675961543; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OY/Q0id+JND2kGjLSSuNt1fBs++IML+8Zx3lVKxTp/o=; b=S+F3quxsjl/qrjd8ESOex69qPaHqeMBjSbnoo/hl5Wzre4KsZcIx8tEXrg+HZwc6eXZjyC uXcrXnUYZcC9LbYgnupbJ7lEqd46Bfy6wquw6GP9dJ+4y9jwXAr1JF6K+xGpC5RGDVIjfJ 67Di61yFr0H0oZ2DHrLsTkgt1+H1oQl1a7cD5ZjBVclde3kiBF+7WQpgHWYOS5kRF72sQv 8m3knQId8G+5jjRT9Gd9br4gP2oCzqWa7XHSiZ1G86h1eZtFjdFgGS1yu/iKLU+Y2t3rS+ Wwb6M9jpLXgLxGfNXILhlaavZUB7FJ0xgwwGy61dqXzVIwdMa7fRF2KtYX4pkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675961543; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OY/Q0id+JND2kGjLSSuNt1fBs++IML+8Zx3lVKxTp/o=; b=cFz9DXBlktcGTS+/eAH8WB2vmxfT8yEkqJQDtiesuAKApS+UPycr+XUSSw2sRw3n/dzOf2 xojfl6x8yD0A45bUrJKG1Mf2mvLeYzklfjlp1dKl5I0rRyz6QnE0OLyWiMzYBpNLdpb3ei P3yHYmtgIWDVhMX38AwJTB3CqMQc4U+uIj8zFB4U1kgrsh1DN8vP+UHoI83ENiYnsHRkFv 1Xl4vst6UsfHPlqrYo16kfuiN0d9ettgXodZweB+d4iW9tz/j0G7f1I4jnZHx8WKUMWADn yGHCkVFOdLk8+bMH9KQzfLr9VKVvehxmvfg/0XruHMyajPrBSObJaPfMKZYWsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675961543; a=rsa-sha256; cv=none; b=s4m3JY7NQYy782nWFo+yW2s/ZIOuZqhGpxbT6Y08wslP50S5vh7eFeNW3yzun2whgicnV9 FzXL83TVMxP7fx89jF/aDK08Bjtw0YzBdGPATfTa2WGYOGGoFPL1+7DXF0EOVKra2qZBlo jEkaOjw0YoHbGYF5SbjN0ewnbZI099c6FyuKX+TND/iFdpmYjejnPiiSzhBzVpgffCCx56 sAnw4q2ncsMLxPmFcSneWJlBwYSLAIWL0cshiMGUsIhaHeQwiE7zun6bvz9paD00+5kiuj EL5ANcCfjdRUOArhbIJZ9BAol5skmfE61bdoMROHJxFDe9b0hSpKX/w5w2+KQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCNFg4b9vzkn7; Thu, 9 Feb 2023 16:52:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319GqNHg066295; Thu, 9 Feb 2023 16:52:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319GqNCl066294; Thu, 9 Feb 2023 16:52:23 GMT (envelope-from git) Date: Thu, 9 Feb 2023 16:52:23 GMT Message-Id: <202302091652.319GqNCl066294@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Stefan=20E=C3=9Fer?= Subject: git: 43a04e3a0a74 - stable/13 - md5/tests: extend md5 test 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: se X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 43a04e3a0a74c609667eae382209d4ebbbcb785f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=43a04e3a0a74c609667eae382209d4ebbbcb785f commit 43a04e3a0a74c609667eae382209d4ebbbcb785f Author: Stefan Eßer AuthorDate: 2023-02-06 20:11:51 +0000 Commit: Stefan Eßer CommitDate: 2023-02-09 16:52:17 +0000 md5/tests: extend md5 test The testloop function is called with various parameters, but those were ignored in the coreutils-c-test script. This was an oversight and is fixed by passing the option to all invocations of the hash functions in this test script. Reported by: des MFC after: 3 days (cherry picked from commit d804497068c16bcb05383d7227d899f4ba59f706) --- sbin/md5/tests/coreutils-c-test.SH | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/md5/tests/coreutils-c-test.SH b/sbin/md5/tests/coreutils-c-test.SH index 5996e533c627..95018abd1f27 100644 --- a/sbin/md5/tests/coreutils-c-test.SH +++ b/sbin/md5/tests/coreutils-c-test.SH @@ -8,8 +8,8 @@ testloop () { opt=$1 while read algorithm; do - ${algorithm}sum -c %%TESTSBASE%%/sbin/md5/${algorithm}.digest || exitcode=1 - ${algorithm}sum -c %%TESTSBASE%%/sbin/md5/${algorithm}sum.digest || exitcode=1 + ${algorithm}sum $opt -c %%TESTSBASE%%/sbin/md5/${algorithm}.digest || exitcode=1 + ${algorithm}sum $opt -c %%TESTSBASE%%/sbin/md5/${algorithm}sum.digest || exitcode=1 done < %%TESTSBASE%%/sbin/md5/algorithms.txt } From nobody Thu Feb 9 18:01:56 2023 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 4PCPnx1JMxz3n1jC; Thu, 9 Feb 2023 18:01: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 4PCPnx0l6Lz3DRT; Thu, 9 Feb 2023 18:01:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675965717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KQXu6/V5l3NpThHV7Q/hQzmcRV5NmeOV158rlELg2dw=; b=C4LNy0ZwJP/M56Gz3g9z+icbNTBhU95t+9cdnohQzo8suP/fvtazgFPfYJAAttGSSeX4UR eIc+GqVvy/ng4hkULQtRPN1w61odF1BE1xqhAZzLPYAbNLfW7wKcl6n/6dDhRqKuhyhaxE q3yn5xULbTlcXUp5VXvhFWDURqA22TeRGf+V/px2lQY4UGCeyIj4tzaEJSyq1SB3vHJFAl /WLglZ1GrbrPHCkGV0eDatWUoAexIObkKWH/V2KxjZVYoTqROjq7wvkBsdMe5NBjvEMyt8 FoSy1Gln7oNn1JjxYR9IO8RBO1DWpmjEZ5gbLArlVT0GWy+kTX1PjRRL2YhMbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675965717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KQXu6/V5l3NpThHV7Q/hQzmcRV5NmeOV158rlELg2dw=; b=IZ+Zk+pjtMdGtOopngQoqeelNtWt6AZrXXPGXSOQ0W2W2tDN3QWlHtLV9IilOWnzjlpNzT PpjWqCO64NdJG7ijsMw9NUV8qVAbA2fNRvmHbyVA4yXgvVXIrD5GOoPocMNb0AcI5WNJr1 YFlor7rliykyH13t3RFS0l+35z1nwnst7KKGEEdDw4PGSXSrDAMsSh7gS3AND08HiQ3Xgu pIYkMIJv2qoQ2BfnydY7+1/wNIncK1UwodCu2mnSBx8NguDLNJ6I1S8fGN8a7iS6AyOZSI 2ZTUgShyHS7hLzrCeVMXzi7RV6q3MdamuVXESGYqXE1L/4Q/wKpFvjZVe/ZCJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675965717; a=rsa-sha256; cv=none; b=DJxYAzcRn1ULiSPaQIoB08dciIrcj+8H+yLRIz//OdXKDz4WJh3lAcvxsvRWbhOjoBH3Xt t4mLkuJpUJjk0EE0o7bpjldhRgizJu13mnNp5E1wFcX0jkPxFhAO8mxMEjkymN5hUbHlnE ViKopwfr3IGx3+dTpc2NeQnwA62HKJnURexVGLwPgDGfDg4NRQM4etDqLL1cE91IWdOmFp UL8eXtokaxu7rEuTqfAVtN72Z1x/ZcWFFnqQNjL5grAtLF+vUgGTILOpK1zQK58y2+rUyg 7v038A9bXlj4BdQ1D+bKN9ciNF9Aofv1zYb7o0768jp7O8wn1GGKEgDpQH6nJw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCPnw6vYzzmfv; Thu, 9 Feb 2023 18:01:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319I1uTp067684; Thu, 9 Feb 2023 18:01:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319I1uCi067683; Thu, 9 Feb 2023 18:01:56 GMT (envelope-from git) Date: Thu, 9 Feb 2023 18:01:56 GMT Message-Id: <202302091801.319I1uCi067683@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: adaf752192c1 - stable/13 - sockets: add MSG_TRUNC flag handling for recvfrom()/recvmsg(). 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: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: adaf752192c165b66875e81db62d274a09591d0c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=adaf752192c165b66875e81db62d274a09591d0c commit adaf752192c165b66875e81db62d274a09591d0c Author: Alexander V. Chernikov AuthorDate: 2022-07-25 19:46:40 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-09 18:01:49 +0000 sockets: add MSG_TRUNC flag handling for recvfrom()/recvmsg(). Implement Linux-variant of MSG_TRUNC input flag used in recv(), recvfrom() and recvmsg(). Posix defines MSG_TRUNC as an output flag, indicating packet/datagram truncation. Linux extended it a while (~15+ years) ago to act as input flag, resulting in returning the full packet size regarless of the input buffer size. It's a (relatively) popular pattern to do recvmsg( MSG_PEEK | MSG_TRUNC) to get the packet size, allocate the buffer and issue another call to fetch the packet. In particular, it's popular in userland netlink code, which is the primary driving factor of this change. This commit implements the MSG_TRUNC support for SOCK_DGRAM sockets (udp, unix and all soreceive_generic() users). PR: kern/176322 Reviewed by: pauamma(doc) Differential Revision: https://reviews.freebsd.org/D35909 MFC after: 1 month (cherry picked from commit be1f485d7d6bebc53b055cc165a11ada0ab5fb17) --- lib/libc/sys/recv.2 | 12 +++ sys/kern/uipc_socket.c | 13 ++- tests/sys/kern/Makefile | 1 + tests/sys/kern/socket_msg_trunc.c | 169 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 191 insertions(+), 4 deletions(-) diff --git a/lib/libc/sys/recv.2 b/lib/libc/sys/recv.2 index 46e0cf8163dd..95a9e83446a0 100644 --- a/lib/libc/sys/recv.2 +++ b/lib/libc/sys/recv.2 @@ -163,6 +163,7 @@ one or more of the values: .Bl -column ".Dv MSG_CMSG_CLOEXEC" -offset indent .It Dv MSG_OOB Ta process out-of-band data .It Dv MSG_PEEK Ta peek at incoming message +.It Dv MSG_TRUNC Ta return real packet or datagram length .It Dv MSG_WAITALL Ta wait for full request or error .It Dv MSG_DONTWAIT Ta do not block .It Dv MSG_CMSG_CLOEXEC Ta set received fds close-on-exec @@ -185,6 +186,17 @@ from the beginning of the receive queue without removing that data from the queue. Thus, a subsequent receive call will return the same data. The +.Dv MSG_TRUNC +flag causes the receive operation to return the full length of the packet +or datagram even if larger than provided buffer. The flag is supported +on SOCK_DGRAM sockets for +.Dv AF_INET +, +.Dv AF_INET6 +and +.Dv AF_UNIX +families. +The .Dv MSG_WAITALL flag requests that the operation block until the full request is satisfied. diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index ce7279357fab..f8931b653a4d 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1911,15 +1911,18 @@ soreceive_generic(struct socket *so, struct sockaddr **psa, struct uio *uio, struct mbuf *nextrecord; int moff, type = 0; ssize_t orig_resid = uio->uio_resid; + bool report_real_len = false; mp = mp0; if (psa != NULL) *psa = NULL; if (controlp != NULL) *controlp = NULL; - if (flagsp != NULL) + if (flagsp != NULL) { + report_real_len = *flagsp & MSG_TRUNC; + *flagsp &= ~MSG_TRUNC; flags = *flagsp &~ MSG_EOR; - else + } else flags = 0; if (flags & MSG_OOB) return (soreceive_rcvoob(so, uio, flags)); @@ -1993,7 +1996,7 @@ restart: error = ENOTCONN; goto release; } - if (uio->uio_resid == 0) { + if (uio->uio_resid == 0 && !report_real_len) { SOCKBUF_UNLOCK(&so->so_rcv); goto release; } @@ -2341,6 +2344,8 @@ dontblock: SOCKBUF_LOCK_ASSERT(&so->so_rcv); if (m != NULL && pr->pr_flags & PR_ATOMIC) { + if (report_real_len) + uio->uio_resid -= m_length(m, NULL) - moff; flags |= MSG_TRUNC; if ((flags & MSG_PEEK) == 0) (void) sbdroprecord_locked(&so->so_rcv); @@ -2639,7 +2644,7 @@ soreceive_dgram(struct socket *so, struct sockaddr **psa, struct uio *uio, * For any complicated cases, fall back to the full * soreceive_generic(). */ - if (mp0 != NULL || (flags & MSG_PEEK) || (flags & MSG_OOB)) + if (mp0 != NULL || (flags & (MSG_PEEK | MSG_OOB | MSG_TRUNC))) return (soreceive_generic(so, psa, uio, mp0, controlp, flagsp)); diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile index 0fda50f592a0..3f6043f19f88 100644 --- a/tests/sys/kern/Makefile +++ b/tests/sys/kern/Makefile @@ -25,6 +25,7 @@ ATF_TESTS_C+= reaper ATF_TESTS_C+= sched_affinity ATF_TESTS_C+= sigaltstack ATF_TESTS_C+= sigwait +ATF_TESTS_C+= socket_msg_trunc TEST_METADATA.sigwait+= is_exclusive="true" .if ${MACHINE_ARCH} != "i386" && ${MACHINE_ARCH:Mpowerpc*} == "" && \ ${MACHINE_CPUARCH} != "mips" diff --git a/tests/sys/kern/socket_msg_trunc.c b/tests/sys/kern/socket_msg_trunc.c new file mode 100644 index 000000000000..5041842f32b7 --- /dev/null +++ b/tests/sys/kern/socket_msg_trunc.c @@ -0,0 +1,169 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2022 Alexander V. Chernikov + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +static void +check_recvmsg(const char *test_name) +{ + int ss, cs, rc; + struct sockaddr *sa; + struct sockaddr_in sin; + struct sockaddr_in6 sin6; + struct sockaddr_un saun; + int *sizes, sizes_count; + int one = 1; + + + if (!strcmp(test_name, "udp")) { + ss = socket(PF_INET, SOCK_DGRAM, 0); + ATF_CHECK(ss >= 0); + rc = setsockopt(ss, SOL_SOCKET, SO_REUSEPORT, &one, sizeof(one)); + ATF_CHECK_EQ(0, rc); + bzero(&sin, sizeof(sin)); + sin.sin_family = AF_INET; + sin.sin_len = sizeof(sin); + sin.sin_port = htons(6666); + sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + sa = (struct sockaddr *)&sin; + rc = bind(ss, sa, sa->sa_len); + ATF_CHECK_EQ(0, rc); + + cs = socket(PF_INET, SOCK_DGRAM, 0); + ATF_CHECK(cs >= 0); + int inet_sizes[] = {80, 255, 256, 1024, 4096, 9000}; + sizes_count = sizeof(inet_sizes) / sizeof(int); + sizes = malloc(sizeof(inet_sizes)); + memcpy(sizes, inet_sizes, sizeof(inet_sizes)); + + } else if (!strcmp(test_name, "udp6")) { + ss = socket(PF_INET6, SOCK_DGRAM, 0); + ATF_CHECK(ss >= 0); + rc = setsockopt(ss, SOL_SOCKET, SO_REUSEPORT, &one, sizeof(one)); + ATF_CHECK_EQ(0, rc); + bzero(&sin6, sizeof(sin6)); + sin6.sin6_family = AF_INET6; + sin6.sin6_len = sizeof(sin6); + sin6.sin6_port = htons(6666); + const struct in6_addr in6loopback = IN6ADDR_LOOPBACK_INIT; + sin6.sin6_addr = in6loopback; + sa = (struct sockaddr *)&sin6; + rc = bind(ss, sa, sa->sa_len); + ATF_CHECK_EQ(0, rc); + + cs = socket(PF_INET6, SOCK_DGRAM, 0); + ATF_CHECK(cs >= 0); + int inet_sizes[] = {80, 255, 256, 1024, 4096, 9000}; + sizes_count = sizeof(inet_sizes) / sizeof(int); + sizes = malloc(sizeof(inet_sizes)); + memcpy(sizes, inet_sizes, sizeof(inet_sizes)); + + } else if (!strcmp(test_name, "unix")) { + const char *PATH = "/tmp/test_check_recvmsg_socket"; + ss = socket(PF_UNIX, SOCK_DGRAM, 0); + ATF_CHECK(ss >= 0); + rc = setsockopt(ss, SOL_SOCKET, SO_REUSEPORT, &one, sizeof(one)); + ATF_CHECK_EQ(0, rc); + bzero(&saun, sizeof(saun)); + saun.sun_family = AF_UNIX; + strcpy(saun.sun_path, PATH); + saun.sun_len = sizeof(saun); + sa = (struct sockaddr *)&saun; + unlink(PATH); + rc = bind(ss, sa, sa->sa_len); + ATF_CHECK_EQ(0, rc); + + cs = socket(PF_UNIX, SOCK_DGRAM, 0); + ATF_CHECK(cs >= 0); + int unix_sizes[] = {80, 255, 256, 1024, 2000}; + sizes_count = sizeof(unix_sizes) / sizeof(int); + sizes = malloc(sizeof(unix_sizes)); + memcpy(sizes, unix_sizes, sizeof(unix_sizes)); + } else + return; + + char buf[4096]; + memset(buf, 0xFF, sizeof(buf)); + for (int i = 0; i < sizes_count; i++) { + int sz = sizes[i]; + char tbuf[1]; + rc = sendto(cs, buf, sz, 0, sa, sa->sa_len); + ATF_REQUIRE_EQ(rc, sz); + + rc = recv(ss, NULL, 0, MSG_PEEK | MSG_TRUNC); + ATF_CHECK_EQ(rc, sz); + + rc = recv(ss, tbuf, sizeof(tbuf), MSG_PEEK | MSG_TRUNC); + ATF_CHECK_EQ(rc, sz); + + rc = recv(ss, tbuf, sizeof(tbuf), MSG_TRUNC); + ATF_CHECK_EQ(rc, sz); + } + + close(ss); + close(cs); +} + +ATF_TC_WITHOUT_HEAD(socket_afinet_udp_recv_trunc); +ATF_TC_BODY(socket_afinet_udp_recv_trunc, tc) +{ + check_recvmsg("udp"); +} + +ATF_TC_WITHOUT_HEAD(socket_afinet6_udp_recv_trunc); +ATF_TC_BODY(socket_afinet6_udp_recv_trunc, tc) +{ + check_recvmsg("udp6"); +} + +ATF_TC_WITHOUT_HEAD(socket_afunix_recv_trunc); +ATF_TC_BODY(socket_afunix_recv_trunc, tc) +{ + check_recvmsg("unix"); +} + + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, socket_afinet_udp_recv_trunc); + ATF_TP_ADD_TC(tp, socket_afinet6_udp_recv_trunc); + ATF_TP_ADD_TC(tp, socket_afunix_recv_trunc); + + return atf_no_error(); +} From nobody Thu Feb 9 20:17:33 2023 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 4PCSpP5s61z3nZmP; Thu, 9 Feb 2023 20:17: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 4PCSpP5CFgz3tZf; Thu, 9 Feb 2023 20:17:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675973853; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OzF6mPvbud8k3MrssRwxp3iOGYaR+2xKfgZS5cOOJK4=; b=uNWtlt6PqfvSycpKjdDLaNo+tB8OUu2vHATj84Dn/+y8d89kPJtYXZOPm0FCYa0gVhZxwD Gxh1NKePZ6e4QwIAxPT8KNwbZQsEFnHM/DZV69YbjBmgNV45CAnbh8uAtWHOCbLP4AjHyF 9ahqB38ORVkcgRDATJ2/N4ggBwJbzsNzocVtihVzck4QapGUuVNWbolrhDY8elUbPJSjzy Yt6HiXlcriejQHczW7t3xsXBqchvy1VXIIH/u/KJU1lLcbdpuRMg8nCyeJQKMcGSl5QMz8 QeXx3Suq3BzsyuHDrzqIql4nL17NKNwhupJyeEY84YRYaciNdJGtLCPi2JOlxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675973853; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OzF6mPvbud8k3MrssRwxp3iOGYaR+2xKfgZS5cOOJK4=; b=b2Q8NgGcpgESpQCouwzylP1lOFfl245H+vN8h4tfoyVw6TS7pW/Jq2oBGrOf3ijncuU9hR i5xFeD8HEav1NPL6XTEvipBi+99c69FF6HFJyxnK4T3SdTb1ebQny2+I++YPugqxJ686RA u6v5AfI+8dWoERoegyztAkAfDuPbERRQsZvykBRJDXDwRN8K5bjKiHt/D0vn5YWU7D3dKw ZPuw0AsW/aK61xOksK8IoQ4RjE8eKzOjxRY5fh0ARWeLr1Do8R1bT6oo0M/co9ywhyrpqM K041Ev6irGPDYJFcDUNFhBREeyVbjVQ18z9pD1OKRN9kJJEGGDQHm8jvL9mOVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675973853; a=rsa-sha256; cv=none; b=YPdx+9pdy9sqkJ52bDMxnAYEfRwbCXqy3r8wTGoPlbEDTBLfUM9Y05EA+CgEd/WP3QJN0R qmOmMhmsYUFt55BPdMf30lYcWJRuwvMFIg2uuHLMLC5NFogsCJtggBT/UZflJURMkGLj0n aNaYUHkEYBGBQK6BziQq8rswyUQ6HYXii3Rrhb+7BvMcUlK9/gYMovp9ADBkGfncg6483a CZJK0mx/fi2gcIUB6wrTXyXA5/Rnn+r/aFb+CPtE4/C7jndXcfmY/jany1BlVxgRCma9WS ChsXWaQjFwKZgMZBkkrWjXxF5s52AnNL842AXh3Pjk8z+lORT8UN35GVBGRFIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCSpP4Gbnzqx2; Thu, 9 Feb 2023 20:17:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319KHXWg056896; Thu, 9 Feb 2023 20:17:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319KHXfD056895; Thu, 9 Feb 2023 20:17:33 GMT (envelope-from git) Date: Thu, 9 Feb 2023 20:17:33 GMT Message-Id: <202302092017.319KHXfD056895@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Stefan=20E=C3=9Fer?= Subject: git: d9eb7677942f - stable/13 - update external URLs 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: se X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d9eb7677942f28ad2f5c3427231727f6e7813391 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=d9eb7677942f28ad2f5c3427231727f6e7813391 commit d9eb7677942f28ad2f5c3427231727f6e7813391 Author: Wolfram Schneider AuthorDate: 2022-02-05 08:19:56 +0000 Commit: Stefan Eßer CommitDate: 2023-02-09 20:17:07 +0000 update external URLs (cherry picked from commit 6981ec8bdff0f57833ab58747815e6e160eceaa2) --- sbin/md5/md5.1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sbin/md5/md5.1 b/sbin/md5/md5.1 index ddda24196d9e..899e49ba3517 100644 --- a/sbin/md5/md5.1 +++ b/sbin/md5/md5.1 @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd June 29, 2021 +.Dd Feb 5, 2022 .Dt MD5 1 .Os .Sh NAME @@ -239,10 +239,10 @@ RIPEMD-160 is part of the ISO draft standard on dedicated hash functions. .Pp Secure Hash Standard (SHS): -.Pa http://csrc.nist.gov/cryptval/shs.html . +.Pa https://www.nist.gov/publications/secure-hash-standard-shs .Pp The RIPEMD-160 page: -.Pa http://www.esat.kuleuven.ac.be/~bosselae/ripemd160.html . +.Pa https://homes.esat.kuleuven.be/~bosselae/ripemd160.html .Sh BUGS All of the utilities that end in .Sq sum From nobody Thu Feb 9 20:17:34 2023 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 4PCSpR1MmQz3nZrC; Thu, 9 Feb 2023 20:17: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 4PCSpR09Jbz3tnX; Thu, 9 Feb 2023 20:17:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675973855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wSYvO8vixZydR8MdVQMrVGPDrjNxdsVPx5CZs7Q+pSw=; b=nHYX0I5c+9OktLa7Alvd+TF1KWHKrhK3eSV3xnJJTqFq1QhQDRKKoqx6oDa+DplB4pZEHw gfOfWfKKIE5kV8BYuN4IlFYM5z6nQO4DljCF6DSjtDyLX1d2mXwiGpiXayO7H5SafGWDT/ B/wgnY3JssWKqU9tmPC7l7A+hduuUuXh3vSO7Ubh/dnsh1VsUb/9TbcRunDGFmfrGyR61C 3Y2BayhoxdfSWLM0TWy7pCpB6wcqPS51L+g9M7MZOzCY9TWMnHTyzDdugsECjeGupQNbt9 RM5X72ysGcTYtb1m6k+SVklEqr8Kd9KQjq/PTLh2Xp8PJN4yGst35JoERwNTOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675973855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wSYvO8vixZydR8MdVQMrVGPDrjNxdsVPx5CZs7Q+pSw=; b=aiPA9SQX3TOWgKDSjOZVjIcHmqJoMHAeymmCprBsxoMPnBoc9ECQc/lWUkQbamTsTt2eYk 3dYm91K4TbAXwGi2YkqIWNoQCUqnkwBkZsQz6qFEcvlzXBv/NSiAZ2vopNEHGmzkdqT1pz Hygk4W1SXEVR+0cIlY3LulNtjdKx4qm+kDgzZLVrsIgH1gfrgAv0t3fPsm7EC3slWelB0D MQTOMhjfI5xQzFc5Rd+1tqvrTeci7fqgLF1oGmy9Ka7/moJhf9pKKgxmoUr1xE/Xc+e2rS KHGEX6p/sYkAmiNIK0v7FtpPvcTzTcqDfrVRmHsUoiPeoycxbc2RTvvnTLQx2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675973855; a=rsa-sha256; cv=none; b=vSArrqCvSxqhuAdntR5JJTSdJn2Dn0juhSLA8m7lWpf1lc2xpYmzPf1xmC198Scb88xVjd md93FK03jccb5PyQX3p6kkhAnqUPaKIWNm7dIw89gHcaZG0ZJdMljQPQ3ndQKR2vyZT0ps zvwDW/uYm6ZY3mYLseI+BavzyqWYkFepq7z8FBZnMNLV+5bF9y9x7Cdn+H+6Iju8Z8E2UC 2NE6NhSIPOlUhPRysikJ7PElV1563dB3j+pnVoNyH+2LSFY4GlROW/mEEQJTogdaqCAEGK jAWrxYDBUjaWZ0kWz0eYHBMirJ/+yBm9ThygPBZW7MegTCyQ4ETOtXARugjCAA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCSpQ5FVhzqx3; Thu, 9 Feb 2023 20:17:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319KHY8c056925; Thu, 9 Feb 2023 20:17:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319KHYjj056924; Thu, 9 Feb 2023 20:17:34 GMT (envelope-from git) Date: Thu, 9 Feb 2023 20:17:34 GMT Message-Id: <202302092017.319KHYjj056924@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Stefan=20E=C3=9Fer?= Subject: git: a9c97a5ba1ec - stable/13 - sbin/md5.c: fix -q -c for BSD style versions 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: se X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a9c97a5ba1ec3fc8ed2aa802c0d085a394e8450d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=a9c97a5ba1ec3fc8ed2aa802c0d085a394e8450d commit a9c97a5ba1ec3fc8ed2aa802c0d085a394e8450d Author: Stefan Eßer AuthorDate: 2022-07-26 21:04:57 +0000 Commit: Stefan Eßer CommitDate: 2023-02-09 20:17:13 +0000 sbin/md5.c: fix -q -c for BSD style versions The BSD style commands (with names not ending in "sum") ignored the -c options and the passed digest value when invoked with -q. The man page stated that -q causes only the calculated digest to be printed, but did not consider the case of both the -q and -c being used in combination. Since there is no warning that -c will be ignored when the -q option is used, users night (and did) expect that the exit code would reflect the matching of the calculated digest and the argument passed with -c. This update implements and documents this expected behavior. PR: 265461 Reported by: Dmitrij MFC after: 2 weeks (cherry picked from commit 9f3aa538e307743b2b5048d38f87b7fd32d0c596) --- sbin/md5/md5.1 | 11 +++++++---- sbin/md5/md5.c | 2 ++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sbin/md5/md5.1 b/sbin/md5/md5.1 index 899e49ba3517..a3db48596606 100644 --- a/sbin/md5/md5.1 +++ b/sbin/md5/md5.1 @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd Feb 5, 2022 +.Dd July 26, 2022 .Dt MD5 1 .Os .Sh NAME @@ -86,6 +86,9 @@ coreutils versions of these programs. If the program was called with a name that does not end in .Nm sum , compare the digest of the file against this string. +If combined with the +.Fl q +option, the calculated digest is printed in addition to the exit status being set. .Pq Note that this option is not yet useful if multiple files are specified. .It Fl c Ar file If the program was called with a name that does end in @@ -94,7 +97,7 @@ the file passed as argument must contain digest lines generated by the same digest algorithm with or without the .Fl r option -.Pq i.e. in either classical BSD format or in GNU coreutils format . +.Pq i.e., in either classical BSD format or in GNU coreutils format . A line with the file name followed by a colon .Dq ":" and either OK or FAILED is written for each well-formed line in the digest file. @@ -164,7 +167,7 @@ d80bf36c332dc0fdc479366ec3fa44cd /etc/rc.conf .Pd The .Nm -sum -variants put 2 blank characters between hash and file name for full compatibility +variants put 2 blank characters between hash and file name for full compatibility with the coreutils versions of these commands. .Ed .Pp @@ -207,7 +210,7 @@ $ md5 -c digest /boot/loader.conf The digest file may contain any number of lines in the format generated with or without the .Fl r option -.Pq i.e. in either classical BSD format or in GNU coreutils format . +.Pq i.e., in either classical BSD format or in GNU coreutils format . If a hash value does not match the file, FAILED is printed instead of OK. .Sh SEE ALSO .Xr cksum 1 , diff --git a/sbin/md5/md5.c b/sbin/md5/md5.c index 7235e6e0a39f..97c587efd63c 100644 --- a/sbin/md5/md5.c +++ b/sbin/md5/md5.c @@ -436,6 +436,8 @@ MDOutput(const Algorithm_t *alg, char *p, char *argv[]) printf("%s: %s\n", *argv, checkfailed ? "FAILED" : "OK"); } else if (qflag || argv == NULL) { printf("%s\n", p); + if (cflag) + checkfailed = strcasecmp(checkAgainst, p) != 0; } else { if (rflag) if (gnu_emu) From nobody Thu Feb 9 20:40:40 2023 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 4PCTK50Vvhz3ndfy; Thu, 9 Feb 2023 20:40:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PCTK501trz3wmR; Thu, 9 Feb 2023 20:40:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675975241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JYEti8UwoiB/U1Yyj2cZN1O9CRXXYQMc8932Pe6Id/Y=; b=pbx428d/YuW+2Px+nFw4aSQWtjOUmRpUQwZgJNCdBZgsQFd2VSCRHhcxtheIEHVEMWCEzb ooRc3HBCFkksEHSiP1/VnfI2H0uIpJTksyBagWcm8mqXlrTmyCY5c2xFVQZqRWvg37s6OU c42ardDIM4hIFXYWhNel/3hHFv5xLiBTGbs4Zznqi7t3HvFsEKkkn1Q9leYb9PG3XAC2Z5 xFhdRLNmgbkxukBfABw1oT/Zhw+PprzVXA0ej3a2MqWuCc2Vwjr1V3qtc2wc2ojH39Vk7l 37Wbl3eTesUc3MOPomUcs6sbMZWUmga/zRHSFhrPl5d2anAJ2b/l3+eh6eRrXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675975241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JYEti8UwoiB/U1Yyj2cZN1O9CRXXYQMc8932Pe6Id/Y=; b=vdSvbyfGn2bdNVif5TVNAUP2rc2kdCVPhhffds5nMzL+Micnq0yV2dy4LPhEvl5mcYDFk9 QSJs/cIe3dr2+thKh2suSYWH9oO1jZUpg4by6RIEf/Y5vy/VcybADBWG/iYrYzUNikZk7V B8vp+1yG0yHVuHbKJWUp6KVBIpOpwzJ5EzmVgDy8rdGZjNcukW8URQmxhB5JonmEh4riHY sgSDeg/hTjYqdEGlFyoIKWtNwbjXhdt81vnDg6DTTTNQWMzpmKyGMAiX4MKuh+k4RHvfl1 0zFQQ1pTBo55bNBoX9hRjEK6nMHGNrZja5B6pNaAEUu/rmbKPioXGPaeq1lP8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675975241; a=rsa-sha256; cv=none; b=Py7dISpri255ZoaRc6yvYijgOfBQPwsQMO32220Hbxr1abXswZFNi/cdQcaxhbNbs784Mr gBZkfKgrKVeH2lNmS7rdu6G5Sev+Cqt62BbQ9S5B1VFfypTuTNk9s1W/3Dpk6606/8f7IL LlRXEShv0iHxYcUeaaItaEp0CRhIYt1lOh01dohcV6hNlc9AiSRCMySLWUUFJ1wbIKZKRu B13n1T7YIRH1zXMYfV0BEIfaA2AQwGhE7jT8dzqFasYS4zmQFf604UzUVC2S1j5l4mW1SH tTSSJa3vEgEkN93q2M9t4Y+xr+2uPqo8cMxWDbD/iO77SuWB8vKDfspTiU8ZbA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCTK46B0WzrXJ; Thu, 9 Feb 2023 20:40:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319Keesh093882; Thu, 9 Feb 2023 20:40:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319Keel2093881; Thu, 9 Feb 2023 20:40:40 GMT (envelope-from git) Date: Thu, 9 Feb 2023 20:40:40 GMT Message-Id: <202302092040.319Keel2093881@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: 1b11dd2108ca - stable/13 - df: Return non-zero status on write failure. 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: 1b11dd2108ca90a707c7f8976f409bf249509c94 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=1b11dd2108ca90a707c7f8976f409bf249509c94 commit 1b11dd2108ca90a707c7f8976f409bf249509c94 Author: Dag-Erling Smørgrav AuthorDate: 2023-01-17 13:40:05 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-02-09 20:32:56 +0000 df: Return non-zero status on write failure. While here, complete the libxo conversion and switch return value to standard constants. MFC after: 1 week Sponsored by: Klara, Inc. Differential revision: https://reviews.freebsd.org/D38097 (cherry picked from commit c968598479917f52022b86d0089a9835ddcf2799) --- bin/df/df.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bin/df/df.c b/bin/df/df.c index 627d8b1c861d..9f7588a68d4f 100644 --- a/bin/df/df.c +++ b/bin/df/df.c @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -204,7 +203,7 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; - rv = 0; + rv = EXIT_SUCCESS; if (!*argv) { /* everything (modulo -t) */ mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); @@ -226,14 +225,14 @@ main(int argc, char *argv[]) if (stat(*argv, &stbuf) < 0) { if ((mntpt = getmntpt(*argv)) == NULL) { xo_warn("%s", *argv); - rv = 1; + rv = EXIT_FAILURE; continue; } } else if (S_ISCHR(stbuf.st_mode)) { mntpt = getmntpt(*argv); if (mntpt == NULL) { xo_warnx("%s: not mounted", *argv); - rv = 1; + rv = EXIT_FAILURE; continue; } } else { @@ -246,7 +245,7 @@ main(int argc, char *argv[]) */ if (statfs(mntpt, &statfsbuf) < 0) { xo_warn("%s", mntpt); - rv = 1; + rv = EXIT_FAILURE; continue; } @@ -257,7 +256,7 @@ main(int argc, char *argv[]) * we've been given (-l, -t, etc.). */ if (checkvfsselected(statfsbuf.f_fstypename) != 0) { - rv = 1; + rv = EXIT_FAILURE; continue; } @@ -286,7 +285,8 @@ main(int argc, char *argv[]) prtstat(&totalbuf, &maxwidths); xo_close_container("storage-system-information"); - xo_finish(); + if (xo_finish() < 0) + rv = EXIT_FAILURE; exit(rv); } @@ -322,7 +322,7 @@ makevfslist(char *fslist, int *skip) if (*nextcp == ',') i++; if ((av = malloc((size_t)(i + 2) * sizeof(char *))) == NULL) { - warnx("malloc failed"); + xo_warnx("malloc failed"); return (NULL); } nextcp = fslist; From nobody Thu Feb 9 20:40:41 2023 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 4PCTK61fK6z3ndnW; Thu, 9 Feb 2023 20:40:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PCTK60vl7z3wms; Thu, 9 Feb 2023 20:40:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675975242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5tmu8LK2Kljuaw6ORxsuJgmzx+k+b5rTe8qqB1nSxYk=; b=J5rpMNH5mf2prheBJaGU3eD6Y5NsS+CqTn3y1GXwGZPT8MUar9vpNt6ss2+yiwyxhWbW1+ o9Q0mjaPdgXUxd2nSeH9xNMAj0nD+PJysUCirMdwdJ59bS2beTommgi3ZZGrZ6ZNF/jsak bawit7irX1wYwand7T5lZX3ibhXxwWrZkR9zltPh7dUcepfiAuFt9ROJa1lW/HzKthW9uH PTNiqMYVrNkQYWM8pAe8zsgzVP2vamqViN2ELWWp4imm7G123gY/radYzmLCo3KBZ1dVbu gzY9gA8XmWfeCIOeHpbUTkhhr7xokcjMPWw2KX5lMhOImw3GKMyKNajRCY6UrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675975242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5tmu8LK2Kljuaw6ORxsuJgmzx+k+b5rTe8qqB1nSxYk=; b=wckBhipT7ziRaDjS5GbLylRMghFyiD/x51PDOziB0qJ28eJo7MCSJjT/LT+C4zfrteHY56 ICSPK4y3peItb3ito3PB4dVXtUY2BiVH896aTwoESKMxwn47krrThrdVoA7gDEdjJA3urZ Re0wkgaJ2axJzJndLGHQuTvDf/r0jSCLHyHNdQaxyjn2twYdJ9zdt16PJuhtfyFcAaQT8F qHXnKP8z1zeHR8aFXS4nMfOuDgBOoOVBot0jHAU5ocKvsX0Z/oDj5Si67xtSkoI8cIXYU4 tKB3S6/rNcHvHo6QvCsSPq+6NegvqstuUl7Hu0KGi9CDjCkm+pIVE9p0umX5ag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675975242; a=rsa-sha256; cv=none; b=UP13jZ0qhTDzITi67jKGSdiz8cAbGOXHQ7D9Ywxeo3M/aaO2n5NZLLuHHDIdfjP95Gd4CE U7K9532036HTtHwyLvUIDYM1l6bzNwiJpnRDR1pmi519Krq2umkg0sdCj0DWTXO6DZxzSd zVApq5rp1geVcDVcuyuz4RphYPUvHZz0cONzyjSUblwAAiQ0U4lrFrkPSrpgwpuTZpI02n mp5NIVYD/uWvUA24LuqU2crFSsc5y4OgJ5ym6BB4ojFzyC/vGUdw+3jHs69tjQjFYyNsDI 1J3pda00EGjQzaAIQ4UlRLehWtEvv1cWznckmo1/7eEi+EktYXi5L0+OCutSrQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCTK600ymzrCy; Thu, 9 Feb 2023 20:40:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319Kefjv093912; Thu, 9 Feb 2023 20:40:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319KefsD093911; Thu, 9 Feb 2023 20:40:41 GMT (envelope-from git) Date: Thu, 9 Feb 2023 20:40:41 GMT Message-Id: <202302092040.319KefsD093911@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: 174b9fb5738d - stable/13 - find: Logic nit in man page. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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: 174b9fb5738d2da0ddef191d525bbf754db7079a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=174b9fb5738d2da0ddef191d525bbf754db7079a commit 174b9fb5738d2da0ddef191d525bbf754db7079a Author: Dag-Erling Smørgrav AuthorDate: 2023-01-24 08:53:35 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-02-09 20:32:56 +0000 find: Logic nit in man page. Arguments follow primaries, not the other way around. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D38173 (cherry picked from commit 14ebab25e1231decd80a64194e9028a9ada8d6e6) --- usr.bin/find/find.1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/find/find.1 b/usr.bin/find/find.1 index 482e48aa607d..2b9275d5aee3 100644 --- a/usr.bin/find/find.1 +++ b/usr.bin/find/find.1 @@ -31,7 +31,7 @@ .\" @(#)find.1 8.7 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd August 2, 2022 +.Dd January 23, 2023 .Dt FIND 1 .Os .Sh NAME @@ -67,7 +67,7 @@ of each file in the tree. The options are as follows: .Bl -tag -width indent .It Fl E -Interpret regular expressions followed by +Interpret regular expressions following the .Ic -regex and .Ic -iregex From nobody Thu Feb 9 20:40:42 2023 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 4PCTK74SyKz3ndhx; Thu, 9 Feb 2023 20:40:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PCTK71Wr4z3x2N; Thu, 9 Feb 2023 20:40:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675975243; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=82TA5mzASff6cWcpByUcgOcEdZynDNPRenHy9jR67Vs=; b=ZEwTqxD1HNqAdpUIWf2ug2eqnlj/eBr5hZ6ls57Q4il78ZrctgXF3z//8qG9nHTMNu7Cbf SE7fCaihUyacxtiUH5DmmU5S5x7gGrSP411UQD3U5Hk9sJxxBL+EqAuvLhdHaHKKl8IXo/ p5iYHcQDBZzJVsMoew05potN9EbuAg3ReObWF8IyyzBbEYyd/FHwFDV8cWlEynLg40iYzy sDOk4uRoxLCFww70jTKp7j2j1rgMDsNO6iuFfQghS+auTmkB+QUm4XxrKKjC8tU87LhTpG NUc7WKVxwkyQNa6MEysIOGPpec7biHCVXOg6fwJ6/RklWcc3Dpr03vMwprWTMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675975243; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=82TA5mzASff6cWcpByUcgOcEdZynDNPRenHy9jR67Vs=; b=vGsg20cLxIKO0gFRboasY6YjzogOp/eYMF66/2SW3WtcQ4SbXNMJMTc9W/bqhUIupK4urq TYpLDFVVKb0g2TV825ah+g8EQ4kfJmiXIxiD+PLRa7my3B0hDM+HaiBdbGzRBGZwSMaNBh YEjQHHtyEwKeBKTcMDHhbC/Vov3p2RPP/225Iizji3ahOH+Pokj350oaqc47MddOLTPeEk I0NKtdbVEBO2msfDhTO4Gd4+fe7tYmCFvkAKzf7Lr3qKEMSPyS45F3wOqryklzd0e9UMFK mV4A8zQFJsfeURJOtPl4qH7wnItCLwMb4TwWM12BoM4q/ic9cCUlaq7JF8YGNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675975243; a=rsa-sha256; cv=none; b=wE9JovXQZ41qToDXoPlW3OQauiFOSTrsNL8e7R80uyr2nUnKwY9R6n/pSVDxeNrToep7eF hzdM8fg3Z7kZt1ZMKx1ripTbHLh4xMFFJqhwJm9joJYQ2s/k43IWfDpZfNrE19K/dzI7PN 1e/W6/Jjlto6fH5bzY/RxLvcSUD87isuaEFDwiSLecpF4A/mNrhPoKQqXDP9ShWJHK4OMF IiTmnjYwbXue83pM01uGSnKpDb+f1JrQtxgoyOaqzUizY3+NGPaCX6jk+900AdaEzlpPy3 MB+goYrd3X97byj25aFbEdBEsaNuCfFtThlWo3lhSmTp2rEy3rIhZvQzItJGKw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCTK70dsJzrGP; Thu, 9 Feb 2023 20:40:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319KegSI093941; Thu, 9 Feb 2023 20:40:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319KegGX093940; Thu, 9 Feb 2023 20:40:42 GMT (envelope-from git) Date: Thu, 9 Feb 2023 20:40:42 GMT Message-Id: <202302092040.319KegGX093940@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: a6edc5b39209 - stable/13 - w: Complete libxo transition. 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: a6edc5b3920944ee42ba101214ada142c55f6301 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=a6edc5b3920944ee42ba101214ada142c55f6301 commit a6edc5b3920944ee42ba101214ada142c55f6301 Author: Dag-Erling Smørgrav AuthorDate: 2023-01-25 06:21:13 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-02-09 20:32:56 +0000 w: Complete libxo transition. MFC after: 1 week Sponsred by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D38172 (cherry picked from commit d90ff31ae5cd9ba073fbd6a7b2367b5209ea534e) w: Unlike err(3), xo_err(3) won't accept a null format string. MFC after: 1 week X-MFC-with: d90ff31ae5cd Sponsored by: Klara, Inc. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D38192 (cherry picked from commit 6fc1bbbf62bda2f1b5be3a4be3d36bc964490ebe) --- usr.bin/w/w.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c index b06d605438ca..5ba9f49cdd35 100644 --- a/usr.bin/w/w.c +++ b/usr.bin/w/w.c @@ -67,7 +67,6 @@ static const char sccsid[] = "@(#)w.c 8.4 (Berkeley) 4/16/94"; #include #include -#include #include #include #include @@ -189,7 +188,7 @@ main(int argc, char *argv[]) nflag += 1; break; case 'f': case 'l': case 's': case 'u': case 'w': - warnx("-%c no longer supported", ch); + xo_warnx("-%c no longer supported", ch); /* FALLTHROUGH */ case '?': default: @@ -204,7 +203,7 @@ main(int argc, char *argv[]) _res.retry = 1; /* only try once.. */ if ((kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf)) == NULL) - errx(1, "%s", errbuf); + xo_errx(1, "%s", errbuf); (void)time(&now); @@ -239,7 +238,7 @@ main(int argc, char *argv[]) continue; } if ((ep = calloc(1, sizeof(struct entry))) == NULL) - errx(1, "calloc"); + xo_errx(1, "calloc"); *nextp = ep; nextp = &ep->next; memmove(&ep->utmp, utmp, sizeof *utmp); @@ -338,7 +337,8 @@ main(int argc, char *argv[]) pr_header(&now, nusers); if (wcmd == 0) { xo_close_container("uptime-information"); - xo_finish(); + if (xo_finish() < 0) + xo_err(1, "stdout"); (void)kvm_close(kd); exit(0); } @@ -351,7 +351,7 @@ main(int argc, char *argv[]) } if ((kp = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nentries)) == NULL) - err(1, "%s", kvm_geterr(kd)); + xo_err(1, "%s", kvm_geterr(kd)); for (i = 0; i < nentries; i++, kp++) { if (kp->ki_stat == SIDL || kp->ki_stat == SZOMB || kp->ki_tdev == NODEV) @@ -397,7 +397,7 @@ main(int argc, char *argv[]) ep->args = fmt_argv(kvm_getargv(kd, ep->kp, argwidth), ep->kp->ki_comm, NULL, MAXCOMLEN); if (ep->args == NULL) - err(1, NULL); + xo_err(1, "fmt_argv"); } /* sort by idle time */ if (sortidle && ehead != NULL) { @@ -469,7 +469,8 @@ main(int argc, char *argv[]) xo_close_list("user-entry"); xo_close_container("user-table"); xo_close_container("uptime-information"); - xo_finish(); + if (xo_finish() < 0) + xo_err(1, "stdout"); (void)kvm_close(kd); exit(0); From nobody Thu Feb 9 20:40:44 2023 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 4PCTK83YrTz3ndg4; Thu, 9 Feb 2023 20:40:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PCTK82fdjz3x8G; Thu, 9 Feb 2023 20:40:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675975244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jsqh70A4DAR27DwM3yHL+aSK3pOHHiq5KtOAOZkPtMA=; b=gPmOkh1mg6AFCkfPZYDZT0zKGpAClrmBIZhLuvQGXHs9Ps11FaAhXOhCv++T/jnbyyt5fA jBZDguFxOlAPSbEy+rZcIt8MONZhKxjPrWzt1RnPuyH4x++s6dercxm3dxiTzIHsoA43La xXez3jmEbBpC9aKYxlxSJyEolUEL5ZAGcD11yu8gzMZwpc3Y/mFK90nuSPXLiTJjSHHTk/ 6LqYg1yO9KHDAxL6h4WGqkbQ+GAPrH7coc51S82471dHBKJ4XYqeZmGsQpxTyrIYyiSAbr UZf+8GSzqps/Xf8D/C+Mgw+N7B9cKZIvV6MwAbKHlW5v0IrM6KvyOQ32RWTkqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675975244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jsqh70A4DAR27DwM3yHL+aSK3pOHHiq5KtOAOZkPtMA=; b=Qx4yx9Ey4LMW5JWY47FvCCOE/L99K6lpXfWErNCk0p4BNZv7V92/AYCAe11fka1lBJQ+cb 192xu5sg6RYJNpUIAjgWBtJsKLJN64K+TonCZ6rz1iRLHJidxJyeddt2duOJjVZFXpt8TJ qExwVMkYh1/sJhrVaL1bMG+uRJAlyWs7CHiiI9LJKT7Iq6MZcosSBnGXjKPipHd16ualoi 6IImiVdOQ6dTNZCyH7jvTTkgEpjnqd4DXgf6EsLdmTpUv2BpbYiUZ/c2FiLXa6GaJAvXru bDxj29Ehf7cnfdRTxzqBl4+vUYQ4OKDUX8FRK7xU2GNM92UGbCw3Jw4pBa9tGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675975244; a=rsa-sha256; cv=none; b=i6i3Rf5m9rcBRclAAqQ41Olp+Z9MpuFDE0CvHVEBJsnDV3ahPbd+GvPvBJjUOkvzii8WUC xv09wXA39F7/I0DMmjU3AV2aVcpXEaqwN+mrzZlJM+knmcrnVV2Ud3HmknnTUwnVi3EVDV VXBLswW9TwsLCHCpRSsQd+LbJge9cLvk2Fcc+jaLtJvZ0oQ1/ABVZlxo+i8ZZEGD1F4XPu PE1UN64RzDoZKfeHaWkH3JBZRz72kBIYewu3a6PvXL2xrgOMaChJTynOz5dmtw0eGV9bHO gMjxKFb7v6UOt69nyCEynccTdv7JKA2Gld2nqbrfZKiWeSu4dQFH44ATmcZ2dg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCTK81dFTzr74; Thu, 9 Feb 2023 20:40:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319Keiv4093971; Thu, 9 Feb 2023 20:40:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319KeiaQ093970; Thu, 9 Feb 2023 20:40:44 GMT (envelope-from git) Date: Thu, 9 Feb 2023 20:40:44 GMT Message-Id: <202302092040.319KeiaQ093970@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: 54117b169fba - stable/13 - cmp: Print a summary on SIGINFO. 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: 54117b169fba3ed04e30b467d0d209ef398a9c26 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=54117b169fba3ed04e30b467d0d209ef398a9c26 commit 54117b169fba3ed04e30b467d0d209ef398a9c26 Author: Dag-Erling Smørgrav AuthorDate: 2023-01-31 00:28:47 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-02-09 20:32:56 +0000 cmp: Print a summary on SIGINFO. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D38280 (cherry picked from commit 6673a5476d029cd5b47b2eed27032211a14f52bd) cmp: Increase buffer size for non-mmap case. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: rpokala Differential Revision: https://reviews.freebsd.org/D38281 (cherry picked from commit 134841a7f3e5516a83732d40a4d42268c901a492) --- usr.bin/cmp/cmp.c | 14 ++++++++++++++ usr.bin/cmp/extern.h | 4 ++++ usr.bin/cmp/regular.c | 7 +++++++ usr.bin/cmp/special.c | 9 +++++++++ 4 files changed, 34 insertions(+) diff --git a/usr.bin/cmp/cmp.c b/usr.bin/cmp/cmp.c index 83ea7ae7eee0..82f34803fc22 100644 --- a/usr.bin/cmp/cmp.c +++ b/usr.bin/cmp/cmp.c @@ -75,6 +75,17 @@ static const struct option long_opts[] = {NULL, no_argument, NULL, 0} }; +#ifdef SIGINFO +volatile sig_atomic_t info; + +static void +siginfo(int signo) +{ + + info = signo; +} +#endif + static void usage(void); static bool @@ -240,6 +251,9 @@ main(int argc, char *argv[]) } } +#ifdef SIGINFO + (void)signal(SIGINFO, siginfo); +#endif if (special) c_special(fd1, file1, skip1, fd2, file2, skip2, limit); else { diff --git a/usr.bin/cmp/extern.h b/usr.bin/cmp/extern.h index d98daf424995..60fd15ba0939 100644 --- a/usr.bin/cmp/extern.h +++ b/usr.bin/cmp/extern.h @@ -46,3 +46,7 @@ void diffmsg(const char *, const char *, off_t, off_t, int, int); void eofmsg(const char *); extern bool bflag, lflag, sflag, xflag, zflag; + +#ifdef SIGINFO +extern volatile sig_atomic_t info; +#endif diff --git a/usr.bin/cmp/regular.c b/usr.bin/cmp/regular.c index d270aeeac396..182a303f70ed 100644 --- a/usr.bin/cmp/regular.c +++ b/usr.bin/cmp/regular.c @@ -120,6 +120,13 @@ c_regular(int fd1, const char *file1, off_t skip1, off_t len1, p2 = m2 + (skip2 - off2); for (byte = line = 1; length--; ++byte) { +#ifdef SIGINFO + if (info) { + (void)fprintf(stderr, "%s %s char %zu line %zu\n", + file1, file2, (size_t)byte, (size_t)line); + info = 0; + } +#endif if ((ch = *p1) != *p2) { if (xflag) { dfound = 1; diff --git a/usr.bin/cmp/special.c b/usr.bin/cmp/special.c index c206a317c0ef..1342f2a86270 100644 --- a/usr.bin/cmp/special.c +++ b/usr.bin/cmp/special.c @@ -65,8 +65,10 @@ c_special(int fd1, const char *file1, off_t skip1, if ((fp1 = fdopen(fd1, "r")) == NULL) err(ERR_EXIT, "%s", file1); + (void)setvbuf(fp1, NULL, _IOFBF, 65536); if ((fp2 = fdopen(fd2, "r")) == NULL) err(ERR_EXIT, "%s", file2); + (void)setvbuf(fp2, NULL, _IOFBF, 65536); dfound = 0; while (skip1--) @@ -77,6 +79,13 @@ c_special(int fd1, const char *file1, off_t skip1, goto eof; for (byte = line = 1; limit == 0 || byte <= limit; ++byte) { +#ifdef SIGINFO + if (info) { + (void)fprintf(stderr, "%s %s char %zu line %zu\n", + file1, file2, (size_t)byte, (size_t)line); + info = 0; + } +#endif ch1 = getc(fp1); ch2 = getc(fp2); if (ch1 == EOF || ch2 == EOF) From nobody Thu Feb 9 20:40:45 2023 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 4PCTK944L3z3ndd2; Thu, 9 Feb 2023 20:40:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PCTK93W3gz3x6p; Thu, 9 Feb 2023 20:40:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675975245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U/6fewWycXoFQ4mVNv/qCK+KpaNP5fhSmg02NnAf2ew=; b=D0xBR7HftG0Dzfrh3458Q6YHSlMw+0kqJgoTfSYmiryj6s/SYSWF0b9u+f/pGE7div1SFf 0O//m+L7ZupcUim+k9sxj3dB8lXFlJuP9KneNgamg3tPNGX2DWtoVmwZqRqoE07GedvYm3 alA14JfGBuRQsyyNoLdQZEqTgmv+SPomS+Nyam4IUAT7mXzq71df/DbkovTOqaex0SwjCL mh7u0yTk8GBK4PEOnLSXvL3S0SfwqfdMCONnR/gwcWrr9xsozIHlJDQLPQozjmoyD36ryI KKHHcav40Tc4b6fZ2FYg7ur5otfo2YnB9x3SKW3poPduMx5wnFjwpwNO0Ui22A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675975245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U/6fewWycXoFQ4mVNv/qCK+KpaNP5fhSmg02NnAf2ew=; b=yCEoq8C7ijEhk187NC5dj0zrBX1xfH2hcmcV+nJP+DSZIKtMZXxBOJHCsWw5YFmx2NUR3U O/6vF+2ekYBQNKKvOYaKn6fMCyTMJCrzlgkjTVbDE18udqiFgE3vmvR2lDsb5pNO5S2uKv 8zbFyQClbaylAHnHxq7X5/YwnlqbKKrRyIB3n4yvgQ+819N9Zc2O1jp+41yKhWs9gAtu4G bodMWYORQjMZDPGFbhxoxOEiFnTSPy8cg2nLa4knZnMIE7K4q1Pby5fvl13kibokqy1HDS wNNO08UQk8JNzGHqYtoqOwlpMf33uiN09N/uqifNojKhauIFgqga7tYXnzWsiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675975245; a=rsa-sha256; cv=none; b=rfW2i0H019nfTpE80Q58UnkCVfYZYwVHC4jkchkbRwrUInB89NPrMiqj+T2Ov7t2ugGU/E RsvUihSG5LTz2SHTz1VbqCfoWnwpCB8+4FAkNsv6pgLRrNC/rh3YZyAp/8Wh1mQ7HiUZZ0 vh1VgfMX/G3+B9FSwwFdyWpGxbOT0O7KkL8SC6NlIZUQhDjl2gqmukNKqZ3vL59sZW3Cnb XaVGsP6RCecGgRn0t9PtUWFlQAgEHNdo2uStysBBh409H3G7DRanni3ZRZ9Kbu8/S3yBrI ssixQM9JDoPSW+W22avBTwowHjHLlAX7HTdrBqiZU7ljfPc0haE86w6Wbddrqg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCTK92c5JzrZ6; Thu, 9 Feb 2023 20:40:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319KejGo094000; Thu, 9 Feb 2023 20:40:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319Kejtf093999; Thu, 9 Feb 2023 20:40:45 GMT (envelope-from git) Date: Thu, 9 Feb 2023 20:40:45 GMT Message-Id: <202302092040.319Kejtf093999@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: de00ef64eeb6 - stable/13 - libc: Add tests for strchrnul(3). 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: de00ef64eeb6940d5510c5f5e1ec80f8ef46e39e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=de00ef64eeb6940d5510c5f5e1ec80f8ef46e39e commit de00ef64eeb6940d5510c5f5e1ec80f8ef46e39e Author: Dag-Erling Smørgrav AuthorDate: 2023-02-01 20:06:20 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-02-09 20:32:56 +0000 libc: Add tests for strchrnul(3). MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D38286 (cherry picked from commit 606d0e4a9a862a7b4e3469a084834ca0e888afa4) --- contrib/netbsd-tests/lib/libc/string/t_strchr.c | 12 +- contrib/netbsd-tests/lib/libc/string/t_strchrnul.c | 293 +++++++++++++++++++++ lib/libc/tests/string/Makefile | 1 + 3 files changed, 300 insertions(+), 6 deletions(-) diff --git a/contrib/netbsd-tests/lib/libc/string/t_strchr.c b/contrib/netbsd-tests/lib/libc/string/t_strchr.c index 5dd9a62213ab..4bc304e71267 100644 --- a/contrib/netbsd-tests/lib/libc/string/t_strchr.c +++ b/contrib/netbsd-tests/lib/libc/string/t_strchr.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_strchr.c,v 1.2 2017/01/10 15:34:49 christos Exp $ */ +/* $NetBSD: t_strchr.c,v 1.3 2023/01/30 19:49:49 christos Exp $ */ /* * Written by J.T. Conklin @@ -247,7 +247,7 @@ ATF_TC_BODY(strchr_basic, tc) }; dl_handle = dlopen(NULL, RTLD_LAZY); - strchr_fn = dlsym(dl_handle, "test_strlen"); + strchr_fn = dlsym(dl_handle, "test_strchr"); if (!strchr_fn) strchr_fn = strchr; @@ -269,11 +269,11 @@ ATF_TC_BODY(strchr_basic, tc) /* Then for the '/' in the strings */ verify_strchr(buf + a, '/', t, a); - /* check zero extension of char arg */ - verify_strchr(buf + a, 0xffffff00 | '/', t, a); + /* check zero extension of char arg */ + verify_strchr(buf + a, 0xffffff00 | '/', t, a); - /* Replace all the '/' with 0xff */ - while ((off = slow_strchr(buf + a, '/')) != NULL) + /* Replace all the '/' with 0xff */ + while ((off = slow_strchr(buf + a, '/')) != NULL) *off = 0xff; buf[a + len] = 0xff; diff --git a/contrib/netbsd-tests/lib/libc/string/t_strchrnul.c b/contrib/netbsd-tests/lib/libc/string/t_strchrnul.c new file mode 100644 index 000000000000..62ac702523aa --- /dev/null +++ b/contrib/netbsd-tests/lib/libc/string/t_strchrnul.c @@ -0,0 +1,293 @@ +/* $NetBSD: t_strchrnul.c,v 1.1 2023/01/30 19:49:49 christos Exp $ */ + +/* + * Written by J.T. Conklin + * Public domain. + */ + +#include +#include +#include +#include +#include +#include + +static char *slow_strchrnul(char *, int); +static void verify_strchrnul(char *, int, unsigned int, unsigned int); + +char * (*volatile strchrnul_fn)(const char *, int); + +static char * +slow_strchrnul(char *buf, int ch) +{ + unsigned char c = 1; + + ch &= 0xff; + + for (; ; buf++) { + c = *buf; + if (c == ch || c == 0) + return buf; + } +} + +static void +verify_strchrnul(char *buf, int ch, unsigned int t, unsigned int a) +{ + const char *off, *ok_off; + + off = strchrnul_fn(buf, ch); + ok_off = slow_strchrnul(buf, ch); + if (off == ok_off) + return; + + fprintf(stderr, "test_strchrnul(\"%s\", %#x) gave %zd not %zd (test %d, " + "alignment %d)\n", + buf, ch, off ? off - buf : -1, ok_off ? ok_off - buf : -1, t, a); + + atf_tc_fail("Check stderr for details"); +} + +ATF_TC(strchrnul_basic); +ATF_TC_HEAD(strchrnul_basic, tc) +{ + + atf_tc_set_md_var(tc, "descr", "Test strchrnul(3) results"); +} + +ATF_TC_BODY(strchrnul_basic, tc) +{ + void *dl_handle; + char *off; + char buf[32]; + unsigned int t, a; + + const char *tab[] = { + "", + "a", + "aa", + "abc", + "abcd", + "abcde", + "abcdef", + "abcdefg", + "abcdefgh", + + "/", + "//", + "/a", + "/a/", + "/ab", + "/ab/", + "/abc", + "/abc/", + "/abcd", + "/abcd/", + "/abcde", + "/abcde/", + "/abcdef", + "/abcdef/", + "/abcdefg", + "/abcdefg/", + "/abcdefgh", + "/abcdefgh/", + + "a/", + "a//", + "a/a", + "a/a/", + "a/ab", + "a/ab/", + "a/abc", + "a/abc/", + "a/abcd", + "a/abcd/", + "a/abcde", + "a/abcde/", + "a/abcdef", + "a/abcdef/", + "a/abcdefg", + "a/abcdefg/", + "a/abcdefgh", + "a/abcdefgh/", + + "ab/", + "ab//", + "ab/a", + "ab/a/", + "ab/ab", + "ab/ab/", + "ab/abc", + "ab/abc/", + "ab/abcd", + "ab/abcd/", + "ab/abcde", + "ab/abcde/", + "ab/abcdef", + "ab/abcdef/", + "ab/abcdefg", + "ab/abcdefg/", + "ab/abcdefgh", + "ab/abcdefgh/", + + "abc/", + "abc//", + "abc/a", + "abc/a/", + "abc/ab", + "abc/ab/", + "abc/abc", + "abc/abc/", + "abc/abcd", + "abc/abcd/", + "abc/abcde", + "abc/abcde/", + "abc/abcdef", + "abc/abcdef/", + "abc/abcdefg", + "abc/abcdefg/", + "abc/abcdefgh", + "abc/abcdefgh/", + + "abcd/", + "abcd//", + "abcd/a", + "abcd/a/", + "abcd/ab", + "abcd/ab/", + "abcd/abc", + "abcd/abc/", + "abcd/abcd", + "abcd/abcd/", + "abcd/abcde", + "abcd/abcde/", + "abcd/abcdef", + "abcd/abcdef/", + "abcd/abcdefg", + "abcd/abcdefg/", + "abcd/abcdefgh", + "abcd/abcdefgh/", + + "abcde/", + "abcde//", + "abcde/a", + "abcde/a/", + "abcde/ab", + "abcde/ab/", + "abcde/abc", + "abcde/abc/", + "abcde/abcd", + "abcde/abcd/", + "abcde/abcde", + "abcde/abcde/", + "abcde/abcdef", + "abcde/abcdef/", + "abcde/abcdefg", + "abcde/abcdefg/", + "abcde/abcdefgh", + "abcde/abcdefgh/", + + "abcdef/", + "abcdef//", + "abcdef/a", + "abcdef/a/", + "abcdef/ab", + "abcdef/ab/", + "abcdef/abc", + "abcdef/abc/", + "abcdef/abcd", + "abcdef/abcd/", + "abcdef/abcde", + "abcdef/abcde/", + "abcdef/abcdef", + "abcdef/abcdef/", + "abcdef/abcdefg", + "abcdef/abcdefg/", + "abcdef/abcdefgh", + "abcdef/abcdefgh/", + + "abcdefg/", + "abcdefg//", + "abcdefg/a", + "abcdefg/a/", + "abcdefg/ab", + "abcdefg/ab/", + "abcdefg/abc", + "abcdefg/abc/", + "abcdefg/abcd", + "abcdefg/abcd/", + "abcdefg/abcde", + "abcdefg/abcde/", + "abcdefg/abcdef", + "abcdefg/abcdef/", + "abcdefg/abcdefg", + "abcdefg/abcdefg/", + "abcdefg/abcdefgh", + "abcdefg/abcdefgh/", + + "abcdefgh/", + "abcdefgh//", + "abcdefgh/a", + "abcdefgh/a/", + "abcdefgh/ab", + "abcdefgh/ab/", + "abcdefgh/abc", + "abcdefgh/abc/", + "abcdefgh/abcd", + "abcdefgh/abcd/", + "abcdefgh/abcde", + "abcdefgh/abcde/", + "abcdefgh/abcdef", + "abcdefgh/abcdef/", + "abcdefgh/abcdefg", + "abcdefgh/abcdefg/", + "abcdefgh/abcdefgh", + "abcdefgh/abcdefgh/", + }; + + dl_handle = dlopen(NULL, RTLD_LAZY); + strchrnul_fn = dlsym(dl_handle, "test_strchrnul"); + if (!strchrnul_fn) + strchrnul_fn = strchrnul; + + for (a = 3; a < 3 + sizeof(long); ++a) { + /* Put char and a \0 before the buffer */ + buf[a-1] = '/'; + buf[a-2] = '0'; + buf[a-3] = 0xff; + for (t = 0; t < (sizeof(tab) / sizeof(tab[0])); ++t) { + int len = strlen(tab[t]) + 1; + memcpy(&buf[a], tab[t], len); + + /* Put the char we are looking for after the \0 */ + buf[a + len] = '/'; + + /* Check search for NUL at end of string */ + verify_strchrnul(buf + a, 0, t, a); + + /* Then for the '/' in the strings */ + verify_strchrnul(buf + a, '/', t, a); + + /* check zero extension of char arg */ + verify_strchrnul(buf + a, 0xffffff00 | '/', t, a); + + /* Replace all the '/' with 0xff */ + while (*(off = slow_strchrnul(buf + a, '/')) != '\0') + *off = 0xff; + + buf[a + len] = 0xff; + + /* Check we can search for 0xff as well as '/' */ + verify_strchrnul(buf + a, 0xff, t, a); + } + } + (void)dlclose(dl_handle); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, strchrnul_basic); + + return atf_no_error(); +} diff --git a/lib/libc/tests/string/Makefile b/lib/libc/tests/string/Makefile index eacf7e15c27c..5d1944113a1a 100644 --- a/lib/libc/tests/string/Makefile +++ b/lib/libc/tests/string/Makefile @@ -18,6 +18,7 @@ NETBSD_ATF_TESTS_C+= memmem_test NETBSD_ATF_TESTS_C+= memset_test NETBSD_ATF_TESTS_C+= strcat_test NETBSD_ATF_TESTS_C+= strchr_test +NETBSD_ATF_TESTS_C+= strchrnul_test NETBSD_ATF_TESTS_C+= strcmp_test NETBSD_ATF_TESTS_C+= strcpy_test NETBSD_ATF_TESTS_C+= strcspn_test From nobody Thu Feb 9 20:40:46 2023 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 4PCTKB52Vbz3ndg6; Thu, 9 Feb 2023 20:40:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PCTKB4J8Gz3xLp; Thu, 9 Feb 2023 20:40:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675975246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W80C4ld8ndUBu7W9ZdziLpHIZ/sIk4B6Dgv18A7iF/A=; b=QJmIl3bhSf4OBtkQm7dxcAl0VcAZaKhdqXrMPVf6psWNEJ25kHzWtm/ODWJW5pZDjp+hSN MBGs+Q8YhDc2i3jHZ7OpICni4iWEo5ockmBckMi6Y+oiktxDVZ7hS0fZs2kgiW+NH1W92J STOThzffT9zxdCTRTYm+aSfsKBfcpkDux+ny4t3TQsN6IEvSYzkYCx9kF7FuoTRO1FXPyq ePaffi5nmkfC2YOmqPvef/LdekdHfxkhyKHgccRC8zkT4F7f6pjEM7fMi1jgQYANI6VZ8O bD43sOYahSd4IatOPj/hfRU94c52a6QA86Bb4FvqpdwT5N4MsvHmJ24GCaPqFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675975246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W80C4ld8ndUBu7W9ZdziLpHIZ/sIk4B6Dgv18A7iF/A=; b=LKefY6zBl/oTIkGfYdKIX6m9hYjdD91CksiIlfhTtp2GN+c08ZUhHxy1x3UTnFEPSdigcU /2GgpvHuB3VStiz5jUqlqkkWenh0McpEOUfUmkp7pTf8s4pJergNWP7H2PmOR3gEkQjMeW 9dsCHX92Ys0bYVwUFtLn9hi22uvn37KbbiTtlWcmUEU1pEzxnmm/R8sndHtryD+n5xn/d7 ZeReAjDuiE3DdtHRWAQNGnoLlaZu2ynoqxVa+KXCJOkZnJXt1CuGPU490OyJE/nIFds+g1 qR9umVpBn1i0S2X5NImtTe/UjD5VZnk/UairJVsIuaNheReuOtVP3OeEI/jTVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675975246; a=rsa-sha256; cv=none; b=aYfi+E86GE1TM/OoBWM1XU4iOQklymauFvVJCf9nQrhrOlMtlc2NExzoTB/5sBlMpbCO4Q SyfUVGsv7IZSU8SQGwWFNNn5F9kNZcghj9P3TQVzUvwTER8PKi5ttnBA3VChf8J5uaSto5 mgFRlF778KjpVexM0aFSJPIVLZIXjVAaS+wDe9JhnxTi6wA2VmA9uB4fTPYjcEDbxUcigK pZh7A1coD3UuHzH0R11OjUbn2NTJKncHwSe6ppyZTQkVAqFpZOJ72zNhgnZXwBRkflpDId OgWSadDI3ByVkEhoBDemxegwn7sgV0l43XbhFjOAEySUqcfe6ffaglGeeDCIBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCTKB3LWMzrXM; Thu, 9 Feb 2023 20:40:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319KekSI094033; Thu, 9 Feb 2023 20:40:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319KekJ7094032; Thu, 9 Feb 2023 20:40:46 GMT (envelope-from git) Date: Thu, 9 Feb 2023 20:40:46 GMT Message-Id: <202302092040.319KekJ7094032@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: d6d22a4530f9 - stable/13 - cp: Add tests involving sparse 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: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d6d22a4530f9c55fc7a48deaf19d2ba7047bff1a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=d6d22a4530f9c55fc7a48deaf19d2ba7047bff1a commit d6d22a4530f9c55fc7a48deaf19d2ba7047bff1a Author: Dag-Erling Smørgrav AuthorDate: 2023-02-01 20:06:24 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-02-09 20:32:56 +0000 cp: Add tests involving sparse files. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D38290 (cherry picked from commit 822fa7ae1e3e7ed277e47e6de355387e524c6ee4) cp: Simplify the common case. * The allocated buffer is only used in the fallback case, so move it there. The argument for passing it in from the caller was that if malloc(3) were to fail, we'd want it to fail before we started copying anything, but firstly, it was already not in the right place to ensure that, and secondly, malloc(3) never fails (except in very contrived circumstances, such as an unreasonable RLIMIT_AS or RLIMIT_DATA). * Remove the mmap(2) option. It is almost never beneficial, especially when the alternative is copy_file_range(2), and it adds needless complexity and indentation. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: rmacklem, mav Differential Revision: https://reviews.freebsd.org/D38291 (cherry picked from commit 6c85042afcbbf4cd0fb7e7c03226c7249081e690) cp: Minor code cleanup. * Fix includes in utils.c, cf. style(9). * Fix type mismatch: readlink(2) returns ssize_t, not int. * It is not necessary to set errno to 0 as fts_read(3) already does it. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D38369 (cherry picked from commit cb96a0ef0040fa7968245ab203ab70a7ed2d275d) cp: Adjust the sparse file tests. * The sparsity check was ineffective: it compared the apparent size in bytes to the actual size in blocks. Instead, write a tool that reliably detects sparseness. * Some of the seq commands were missing an argument. * Based on empirical evidence, 1 MB holes are not necessarily large enough to be preserved by the underlying filesystem. Increase the hole size to 16 MB. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: cracauer Differential Revision: https://reviews.freebsd.org/D38414 (cherry picked from commit 8b418c83d175fde3b1f65210509ddcf2ac248d9f) --- bin/cp/Makefile | 2 +- bin/cp/cp.c | 3 +- bin/cp/tests/Makefile | 2 + bin/cp/tests/cp_test.sh | 90 ++++++++++++++++++++++++++++++++++ bin/cp/tests/sparse.c | 73 ++++++++++++++++++++++++++++ bin/cp/utils.c | 127 +++++++++++++----------------------------------- 6 files changed, 202 insertions(+), 95 deletions(-) diff --git a/bin/cp/Makefile b/bin/cp/Makefile index 0c4c7b5eff53..a73ee5447769 100644 --- a/bin/cp/Makefile +++ b/bin/cp/Makefile @@ -6,7 +6,7 @@ PACKAGE=runtime PROG= cp SRCS= cp.c utils.c -CFLAGS+= -DVM_AND_BUFFER_CACHE_SYNCHRONIZED -D_ACL_PRIVATE +CFLAGS+= -D_ACL_PRIVATE HAS_TESTS= SUBDIR.${MK_TESTS}= tests diff --git a/bin/cp/cp.c b/bin/cp/cp.c index dbae4b535843..e38cd97f4369 100644 --- a/bin/cp/cp.c +++ b/bin/cp/cp.c @@ -311,8 +311,7 @@ copy(char *argv[], enum op type, int fts_options, struct stat *root_stat) recurse_path = NULL; if ((ftsp = fts_open(argv, fts_options, NULL)) == NULL) err(1, "fts_open"); - for (badcp = rval = 0; errno = 0, (curr = fts_read(ftsp)) != NULL; - badcp = 0) { + for (badcp = rval = 0; (curr = fts_read(ftsp)) != NULL; badcp = 0) { switch (curr->fts_info) { case FTS_NS: case FTS_DNR: diff --git a/bin/cp/tests/Makefile b/bin/cp/tests/Makefile index faad22df713a..1e480ad706d1 100644 --- a/bin/cp/tests/Makefile +++ b/bin/cp/tests/Makefile @@ -3,5 +3,7 @@ PACKAGE= tests ATF_TESTS_SH= cp_test +PROGS+= sparse +BINDIR= ${TESTSDIR} .include diff --git a/bin/cp/tests/cp_test.sh b/bin/cp/tests/cp_test.sh index 7362168d7303..559a5ecc3c00 100755 --- a/bin/cp/tests/cp_test.sh +++ b/bin/cp/tests/cp_test.sh @@ -199,6 +199,91 @@ recursive_link_Lflag_body() '(' ! -L foo-mirror/foo/baz ')' } +file_is_sparse() +{ + atf_check ${0%/*}/sparse "$1" +} + +files_are_equal() +{ + atf_check test "$(stat -f "%d %i" "$1")" != "$(stat -f "%d %i" "$2")" + atf_check cmp "$1" "$2" +} + +atf_test_case sparse_leading_hole +sparse_leading_hole_body() +{ + # A 16-megabyte hole followed by one megabyte of data + truncate -s 16M foo + seq -f%015g 65536 >>foo + file_is_sparse foo + + atf_check cp foo bar + files_are_equal foo bar + file_is_sparse bar +} + +atf_test_case sparse_multiple_holes +sparse_multiple_holes_body() +{ + # Three one-megabyte blocks of data preceded, separated, and + # followed by 16-megabyte holes + truncate -s 16M foo + seq -f%015g 65536 >>foo + truncate -s 33M foo + seq -f%015g 65536 >>foo + truncate -s 50M foo + seq -f%015g 65536 >>foo + truncate -s 67M foo + file_is_sparse foo + + atf_check cp foo bar + files_are_equal foo bar + file_is_sparse bar +} + +atf_test_case sparse_only_hole +sparse_only_hole_body() +{ + # A 16-megabyte hole + truncate -s 16M foo + file_is_sparse foo + + atf_check cp foo bar + files_are_equal foo bar + file_is_sparse bar +} + +atf_test_case sparse_to_dev +sparse_to_dev_body() +{ + # Three one-megabyte blocks of data preceded, separated, and + # followed by 16-megabyte holes + truncate -s 16M foo + seq -f%015g 65536 >>foo + truncate -s 33M foo + seq -f%015g 65536 >>foo + truncate -s 50M foo + seq -f%015g 65536 >>foo + truncate -s 67M foo + file_is_sparse foo + + atf_check -o file:foo cp foo /dev/stdout +} + +atf_test_case sparse_trailing_hole +sparse_trailing_hole_body() +{ + # One megabyte of data followed by a 16-megabyte hole + seq -f%015g 65536 >foo + truncate -s 17M foo + file_is_sparse foo + + atf_check cp foo bar + files_are_equal foo bar + file_is_sparse bar +} + atf_test_case standalone_Pflag standalone_Pflag_body() { @@ -221,5 +306,10 @@ atf_init_test_cases() atf_add_test_case recursive_link_dflt atf_add_test_case recursive_link_Hflag atf_add_test_case recursive_link_Lflag + atf_add_test_case sparse_leading_hole + atf_add_test_case sparse_multiple_holes + atf_add_test_case sparse_only_hole + atf_add_test_case sparse_to_dev + atf_add_test_case sparse_trailing_hole atf_add_test_case standalone_Pflag } diff --git a/bin/cp/tests/sparse.c b/bin/cp/tests/sparse.c new file mode 100644 index 000000000000..78957581a56c --- /dev/null +++ b/bin/cp/tests/sparse.c @@ -0,0 +1,73 @@ +/*- + * Copyright (c) 2023 Klara, Inc. + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include +#include +#include +#include +#include +#include +#include + +static bool verbose; + +/* + * Returns true if the file named by its argument is sparse, i.e. if + * seeking to SEEK_HOLE returns a different value than seeking to + * SEEK_END. + */ +static bool +sparse(const char *filename) +{ + off_t hole, end; + int fd; + + if ((fd = open(filename, O_RDONLY)) < 0 || + (hole = lseek(fd, 0, SEEK_HOLE)) < 0 || + (end = lseek(fd, 0, SEEK_END)) < 0) + err(1, "%s", filename); + close(fd); + if (end > hole) { + if (verbose) + printf("%s: hole at %zu\n", filename, (size_t)hole); + return (true); + } + return (false); +} + +static void +usage(void) +{ + + fprintf(stderr, "usage: sparse [-v] file [...]\n"); + exit(EX_USAGE); +} + +int +main(int argc, char *argv[]) +{ + int opt, rv; + + while ((opt = getopt(argc, argv, "v")) != -1) { + switch (opt) { + case 'v': + verbose = true; + break; + default: + usage(); + break; + } + } + argc -= optind; + argv += optind; + if (argc == 0) + usage(); + rv = EXIT_SUCCESS; + while (argc-- > 0) + if (!sparse(*argv++)) + rv = EXIT_FAILURE; + exit(rv); +} diff --git a/bin/cp/utils.c b/bin/cp/utils.c index 07de0495ba9e..8c1c350ff6f1 100644 --- a/bin/cp/utils.c +++ b/bin/cp/utils.c @@ -37,13 +37,9 @@ static char sccsid[] = "@(#)utils.c 8.3 (Berkeley) 4/1/94"; #include __FBSDID("$FreeBSD$"); -#include -#include #include +#include #include -#ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED -#include -#endif #include #include @@ -75,11 +71,22 @@ __FBSDID("$FreeBSD$"); #define BUFSIZE_SMALL (MAXPHYS) static ssize_t -copy_fallback(int from_fd, int to_fd, char *buf, size_t bufsize) +copy_fallback(int from_fd, int to_fd) { + static char *buf = NULL; + static size_t bufsize; ssize_t rcount, wresid, wcount = 0; char *bufp; + if (buf == NULL) { + if (sysconf(_SC_PHYS_PAGES) > PHYSPAGES_THRESHOLD) + bufsize = MIN(BUFSIZE_MAX, MAXPHYS * 8); + else + bufsize = BUFSIZE_SMALL; + buf = malloc(bufsize); + if (buf == NULL) + err(1, "Not enough memory"); + } rcount = read(from_fd, buf, bufsize); if (rcount <= 0) return (rcount); @@ -96,16 +103,10 @@ copy_fallback(int from_fd, int to_fd, char *buf, size_t bufsize) int copy_file(const FTSENT *entp, int dne) { - static char *buf = NULL; - static size_t bufsize; struct stat *fs; ssize_t wcount; off_t wtotal; int ch, checkch, from_fd, rval, to_fd; -#ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED - size_t wresid; - char *bufp, *p; -#endif int use_copy_file_range = 1; from_fd = to_fd = -1; @@ -174,89 +175,31 @@ copy_file(const FTSENT *entp, int dne) rval = 0; if (!lflag && !sflag) { - /* - * Mmap and write if less than 8M (the limit is so we don't - * totally trash memory on big files. This is really a minor - * hack, but it wins some CPU back. - * Some filesystems, such as smbnetfs, don't support mmap, - * so this is a best-effort attempt. - */ -#ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED - if (S_ISREG(fs->st_mode) && fs->st_size > 0 && - fs->st_size <= 8 * 1024 * 1024 && - (p = mmap(NULL, (size_t)fs->st_size, PROT_READ, - MAP_SHARED, from_fd, (off_t)0)) != MAP_FAILED) { - wtotal = 0; - for (bufp = p, wresid = fs->st_size; ; - bufp += wcount, wresid -= (size_t)wcount) { - wcount = write(to_fd, bufp, wresid); - if (wcount <= 0) - break; - wtotal += wcount; - if (info) { - info = 0; - (void)fprintf(stderr, - "%s -> %s %3d%%\n", - entp->fts_path, to.p_path, - cp_pct(wtotal, fs->st_size)); + wtotal = 0; + do { + if (use_copy_file_range) { + wcount = copy_file_range(from_fd, NULL, + to_fd, NULL, SSIZE_MAX, 0); + if (wcount < 0 && errno == EINVAL) { + /* Prob a non-seekable FD */ + use_copy_file_range = 0; } - if (wcount >= (ssize_t)wresid) - break; } - if (wcount != (ssize_t)wresid) { - warn("%s", to.p_path); - rval = 1; - } - /* Some systems don't unmap on close(2). */ - if (munmap(p, fs->st_size) < 0) { - warn("%s", entp->fts_path); - rval = 1; - } - } else -#endif - { - if (buf == NULL) { - /* - * Note that buf and bufsize are static. If - * malloc() fails, it will fail at the start - * and not copy only some files. - */ - if (sysconf(_SC_PHYS_PAGES) > - PHYSPAGES_THRESHOLD) - bufsize = MIN(BUFSIZE_MAX, MAXPHYS * 8); - else - bufsize = BUFSIZE_SMALL; - buf = malloc(bufsize); - if (buf == NULL) - err(1, "Not enough memory"); + if (!use_copy_file_range) { + wcount = copy_fallback(from_fd, to_fd); } - wtotal = 0; - do { - if (use_copy_file_range) { - wcount = copy_file_range(from_fd, NULL, - to_fd, NULL, SSIZE_MAX, 0); - if (wcount < 0 && errno == EINVAL) { - /* Prob a non-seekable FD */ - use_copy_file_range = 0; - } - } - if (!use_copy_file_range) { - wcount = copy_fallback(from_fd, to_fd, - buf, bufsize); - } - wtotal += wcount; - if (info) { - info = 0; - (void)fprintf(stderr, - "%s -> %s %3d%%\n", - entp->fts_path, to.p_path, - cp_pct(wtotal, fs->st_size)); - } - } while (wcount > 0); - if (wcount < 0) { - warn("%s", entp->fts_path); - rval = 1; + wtotal += wcount; + if (info) { + info = 0; + (void)fprintf(stderr, + "%s -> %s %3d%%\n", + entp->fts_path, to.p_path, + cp_pct(wtotal, fs->st_size)); } + } while (wcount > 0); + if (wcount < 0) { + warn("%s", entp->fts_path); + rval = 1; } } else if (lflag) { if (link(entp->fts_path, to.p_path)) { @@ -297,7 +240,7 @@ done: int copy_link(const FTSENT *p, int exists) { - int len; + ssize_t len; char llink[PATH_MAX]; if (exists && nflag) { From nobody Thu Feb 9 20:40:47 2023 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 4PCTKD2NWfz3ndd4; Thu, 9 Feb 2023 20:40:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PCTKC6Twcz3xDc; Thu, 9 Feb 2023 20:40:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675975247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PbxjqggXmnYu4ua/4JVxpepuYHyRybETwGOoluKPg2Q=; b=X37WwK0uiFmCRagKGlohzWfP2xYQww9n+sLj+E5hK0giG0F9xpolpenvujxZpxvL+UZdxt bnjIlYLxa64B/5ox0u4OiPDgZKfREMkiiOcc4q2mJB6rZxKnvIHEylQUYgRqzZhAsCNz2j JdCiVUYK9jq4LsB+2MmVv63YCGrXRiYiO7DB1eXxn/b+jzCBpM7f5Kpy0/X+1dfun/0eBR CuNoGxPsCsJtIuIcV2F/v2Czhsb41pozw99wOOotHsZ9X/jT6Fxttg1qTBhBbuSP2C08SG Rgj77eeTQOyXLZOsXjdeFIpazfd7fQLmBWDFfx1uZHMw8QUbBNW+fDlYKWQjig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675975247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PbxjqggXmnYu4ua/4JVxpepuYHyRybETwGOoluKPg2Q=; b=KJFToImGHUGCTw5jHi37BbuLEIP6ngVRhGRgIvEXsKDYOJQDxTixrYImT/FFb0kn4b7qZ8 xYcM4bH33rKChnjF26GstFN627s+PkxzZvw2BYgKJpYqrzSImiELVqatvt+e/x7WyjgoWy BogOan93YM8ouxm7nMsJSi2GRpim+jqK2DH7AJSDt+ONOZ1Y35/OFeA1PpibWLcO2jVCgH bcijBTz1Q3MVBbLB0WcaSkobKD7yp/57k3yVgT/5e7cNYmNcfJTNOy2C4xIbGUzBj9sV7W Q6rCBMXd0ya20gxvofYy8GdpaGba4Z8V0bWYlLSWhDBQ1vOFQeDStZxQmsgCWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675975247; a=rsa-sha256; cv=none; b=BMaSKHmSnUduuyWuAddU0ocq+dKNLJ3vPMEBqfQF0UkG43rJIf8AyIY8kFbTUilcrAuNXn XIRNBakJ2FIIf3yHIni4uAliv4/ZWbmXo+AoLlAYn8olpPtwBtRCIon+sGcs6ebhb12fiY a1O1uT2JxATaCROns2R9HqoleDb7ZrG9jqwiVquV/aZCW5JFRz9VnSuCKMRBYGHN97Cs5r thqObnmQx9K8JwuRhz7BsJNFCqYwwPXh/ga+k8Fe1/YL88D3KJ4b0efG/b2f2OEUtjS/AJ GwqjPXFxze3+jJpu49bQZrpPzHyBlBvBD/mW+BSBHVQEd35iym9pavb8VE1qTA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCTKC4ZxDzrcS; Thu, 9 Feb 2023 20:40:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319Kel86094069; Thu, 9 Feb 2023 20:40:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319KelJI094068; Thu, 9 Feb 2023 20:40:47 GMT (envelope-from git) Date: Thu, 9 Feb 2023 20:40:47 GMT Message-Id: <202302092040.319KelJI094068@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: b9e0160e0788 - stable/13 - sha512_224: Fix SHA512_224_Final() on little-endian machines. 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: b9e0160e07882ff62df7c31695e18c3197cea8b9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=b9e0160e07882ff62df7c31695e18c3197cea8b9 commit b9e0160e07882ff62df7c31695e18c3197cea8b9 Author: Sebastian Huber AuthorDate: 2023-02-06 16:57:28 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-02-09 20:32:56 +0000 sha512_224: Fix SHA512_224_Final() on little-endian machines. PR: 266863 MFC after: 1 week Reviewed by: allanjude, cperciva, des Differential Revision: https://reviews.freebsd.org/D38372 (cherry picked from commit 6680cfe8e0eec4427716ab50d73ab8231dd9ab28) --- sys/crypto/sha2/sha512c.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/crypto/sha2/sha512c.c b/sys/crypto/sha2/sha512c.c index f18a7e6fa994..4533632500f2 100644 --- a/sys/crypto/sha2/sha512c.c +++ b/sys/crypto/sha2/sha512c.c @@ -60,23 +60,26 @@ __FBSDID("$FreeBSD$"); #else /* BYTE_ORDER != BIG_ENDIAN */ /* - * Encode a length len/4 vector of (uint64_t) into a length len vector of - * (unsigned char) in big-endian form. Assumes len is a multiple of 8. + * Encode a length (len + 7) / 8 vector of (uint64_t) into a length len + * vector of (unsigned char) in big-endian form. Assumes len is a + * multiple of 4. */ -static void +static inline void be64enc_vect(unsigned char *dst, const uint64_t *src, size_t len) { size_t i; for (i = 0; i < len / 8; i++) be64enc(dst + i * 8, src[i]); + if (len % 8 == 4) + be32enc(dst + i * 8, src[i] >> 32); } /* * Decode a big-endian length len vector of (unsigned char) into a length - * len/4 vector of (uint64_t). Assumes len is a multiple of 8. + * len/8 vector of (uint64_t). Assumes len is a multiple of 8. */ -static void +static inline void be64dec_vect(uint64_t *dst, const unsigned char *src, size_t len) { size_t i; From nobody Thu Feb 9 20:40:48 2023 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 4PCTKD71QSz3ndnk; Thu, 9 Feb 2023 20:40:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PCTKD5tTLz3xV9; Thu, 9 Feb 2023 20:40:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675975248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jNX8rVSOz7XX32fbSwAxZYTo4g+mZSUDj3NBSHs8dSc=; b=Ob10gDKADXFI/Qi3zyAHAHJxxFi9UTKsv5XDDaVBZU3MhjBMFgcrhJr7alELQHg9Ym/36o o+EyxSJixhSSm/GbohaZuS3JYVPrnPKW4pWlXyyI5uQpmHE8Ba5X+nFWSPAnfq6HSoRU/U jRbhNkSTwOOHrm6u7nZcIlRADOt6RmW7TAJ2OyQxMTL7dFRmMbQe+Efapg7YU0jajFZa69 FzOTwfQ+hdLEroh/6K8X+RlXifgEeUmWNOefPnAIFR0j5UnbzqzkESJp/RnTw583fct7sp 3FONTQYiiDaoj+vWcG5MimsXewTW9s5uVs2RksOt+MXlAyLlezT7jQ+f2chntA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675975248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jNX8rVSOz7XX32fbSwAxZYTo4g+mZSUDj3NBSHs8dSc=; b=aam1YfnZxWjUrytOWf1TezWQlWZtef78pddud/kYHd38u+IqIJoHodnu0iJvy2xYS29YT7 VrKB5JBX1rBgFA7woXyAoefJLZgH5JRsjX/8eQmcaSexEAaNdxvAcxGKho1TCdkcAvPOBg r4kxJZFIvlV3+/IKOKqSMwkBGidrXyONLSCf0N05GcDiPw+2hngW1u22+ZLRSo4Tt/VhXf NSg2hcCxcapNqqbTI7AHOeai8VZDJYUBHXWhYG+H/7dqZDXNOU/bLPatozuqIsZf/x8lzu tEzlpxF4apNowE9jasWQA0pOfQyKYiP7YDBnqTOUA49R3yPPXx2yDfb1bl6dNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675975248; a=rsa-sha256; cv=none; b=SAuyqvTZJFBGBaDmHbgkAh/r/Y7T158nEj46ljk6escV6U79Kt68T3tSt/6FDP6+nNNaKj fwCD5+IuOEHGHmpdFYMGJTlltqHEUnCahzNkaa59G4tInSWzzIe9/gD9adr+O4dAK3LLLP VFKENssUV6wrpHjm9K/0BaR62pTGvBW0Gfp6RzCX9e17QooWAWbsvq70lR0wcR+DHaU213 v/R/4gHnjPHtfMeM0D2XhFiOen+r8DptGaaQi1yx+qyX4d3lAeXDUuWUjNc/H6UoKzWO7f QHKwflBMr8FIBnCAIDUeXFhioU9r8aB5E93irQALmBiPdL95BVab71vEKsjPFg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCTKD509Xzqy4; Thu, 9 Feb 2023 20:40:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319KemAA094105; Thu, 9 Feb 2023 20:40:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319Kemn5094101; Thu, 9 Feb 2023 20:40:48 GMT (envelope-from git) Date: Thu, 9 Feb 2023 20:40:48 GMT Message-Id: <202302092040.319Kemn5094101@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: e04ee7d95ef6 - stable/13 - libmd / md5: Add SHA-512/224. 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: e04ee7d95ef6191fca3c9538e14134582e7abefa Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=e04ee7d95ef6191fca3c9538e14134582e7abefa commit e04ee7d95ef6191fca3c9538e14134582e7abefa Author: Dag-Erling Smørgrav AuthorDate: 2023-02-06 16:57:36 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-02-09 20:32:56 +0000 libmd / md5: Add SHA-512/224. While there, remove .Tn from man pages. Also remove an obsolete comment about the 80386. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans, allanjude Differential Revision: https://reviews.freebsd.org/D38373 (cherry picked from commit 2768d7056727c414241ebc4b9d26e62dd5460760) --- lib/libmd/Makefile | 40 +++++++++++++++++++++--- lib/libmd/mdX.3 | 10 ++---- lib/libmd/ripemd.3 | 7 ++--- lib/libmd/sha.3 | 37 +++++----------------- lib/libmd/sha256.3 | 7 ++--- lib/libmd/sha512.3 | 54 ++++++++++++++++++++++++++------- lib/libmd/shadriver.c | 3 ++ lib/libmd/skein.3 | 3 +- sbin/md5/Makefile | 4 +++ sbin/md5/md5.1 | 21 ++++++++----- sbin/md5/md5.c | 17 ++++++++++- sbin/md5/tests/algorithms.txt | 1 + sbin/md5/tests/self-test.sha512t224.chk | 9 ++++++ sbin/md5/tests/sha512t224.digest | 8 +++++ sbin/md5/tests/sha512t224sum.digest | 8 +++++ 15 files changed, 156 insertions(+), 73 deletions(-) diff --git a/lib/libmd/Makefile b/lib/libmd/Makefile index 8d3a05279004..94f38732872c 100644 --- a/lib/libmd/Makefile +++ b/lib/libmd/Makefile @@ -13,7 +13,7 @@ SRCS= md4c.c md5c.c md4hl.c md5hl.c \ sha0c.c sha0hl.c sha1c.c sha1hl.c \ sha224hl.c sha256c.c sha256hl.c \ sha384hl.c \ - sha512c.c sha512hl.c sha512thl.c \ + sha512c.c sha512hl.c sha512t224hl.c sha512t256hl.c \ skein.c skein_block.c \ skein256hl.c skein512hl.c skein1024hl.c INCS= md4.h md5.h ripemd.h sha.h sha224.h sha256.h sha384.h sha512.h \ @@ -54,6 +54,10 @@ MLINKS+=sha512.3 SHA512_Init.3 sha512.3 SHA512_Update.3 MLINKS+=sha512.3 SHA512_Final.3 sha512.3 SHA512_End.3 MLINKS+=sha512.3 SHA512_File.3 sha512.3 SHA512_FileChunk.3 MLINKS+=sha512.3 SHA512_Data.3 +MLINKS+=sha512.3 SHA512_224_Init.3 sha512.3 SHA512_224_Update.3 +MLINKS+=sha512.3 SHA512_224_Final.3 sha512.3 SHA512_224_End.3 +MLINKS+=sha512.3 SHA512_224_File.3 sha512.3 SHA512_224_FileChunk.3 +MLINKS+=sha512.3 SHA512_224_Data.3 MLINKS+=sha512.3 SHA512_256_Init.3 sha512.3 SHA512_256_Update.3 MLINKS+=sha512.3 SHA512_256_Final.3 sha512.3 SHA512_256_End.3 MLINKS+=sha512.3 SHA512_256_File.3 sha512.3 SHA512_256_FileChunk.3 @@ -76,7 +80,9 @@ CLEANFILES+= md[245]hl.c md[245].ref md[245].3 mddriver \ sha0.ref sha0hl.c sha1.ref sha1hl.c shadriver \ sha224.ref sha256.ref sha224hl.c sha256hl.c \ sha384hl.c sha384.ref \ - sha512.ref sha512hl.c sha512t256.ref sha512thl.c \ + sha512.ref sha512hl.c \ + sha512t224.ref sha512t224hl.c \ + sha512t256.ref sha512t256hl.c \ skein256hl.c skein512hl.c skein1024hl.c \ skein256.ref skein512.ref skein1024.ref \ skeindriver @@ -184,7 +190,14 @@ sha512hl.c: mdXhl.c -e 's/SHA512__/SHA512_/g' \ ${.ALLSRC}) > ${.TARGET} -sha512thl.c: mdXhl.c +sha512t224hl.c: mdXhl.c + (echo '#define LENGTH 28'; \ + sed -e 's/mdX/sha512t/g' -e 's/MDX/SHA512_224_/g' \ + -e 's/SHA512_224__/SHA512_224_/g' \ + -e 's/SHA512_224_CTX/SHA512_CTX/g' \ + ${.ALLSRC}) > ${.TARGET} + +sha512t256hl.c: mdXhl.c (echo '#define LENGTH 32'; \ sed -e 's/mdX/sha512t/g' -e 's/MDX/SHA512_256_/g' \ -e 's/SHA512_256__/SHA512_256_/g' \ @@ -328,6 +341,21 @@ sha512.ref: @echo 'SHA-512 ("12345678901234567890123456789012345678901234567890123456789012345678901234567890") =' \ '72ec1ef1124a45b047e8b7c75a932195135bb61de24ec0d1914042246e0aec3a2354e093d76f3048b456764346900cb130d2a4fd5dd16abb5e30bcb850dee843' >> ${.TARGET} +sha512t224.ref: + echo 'SHA-512224 test suite:' > ${.TARGET} + @echo 'SHA-512224 ("") =' \ + '6ed0dd02806fa89e25de060c19d3ac86cabb87d6a0ddd05c333b84f4' >> ${.TARGET} + @echo 'SHA-512224 ("abc") =' \ + '4634270f707b6a54daae7530460842e20e37ed265ceee9a43e8924aa' >> ${.TARGET} + @echo 'SHA-512224 ("message digest") =' \ + 'ad1a4db188fe57064f4f24609d2a83cd0afb9b398eb2fcaeaae2c564' >> ${.TARGET} + @echo 'SHA-512224 ("abcdefghijklmnopqrstuvwxyz") =' \ + 'ff83148aa07ec30655c1b40aff86141c0215fe2a54f767d3f38743d8' >> ${.TARGET} + @echo 'SHA-512224 ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") =' \ + 'a8b4b9174b99ffc67d6f49be9981587b96441051e16e6dd036b140d3' >> ${.TARGET} + @echo 'SHA-512224 ("12345678901234567890123456789012345678901234567890123456789012345678901234567890") =' \ + 'ae988faaa47e401a45f704d1272d99702458fea2ddc6582827556dd2' >> ${.TARGET} + sha512t256.ref: echo 'SHA-512256 test suite:' > ${.TARGET} @echo 'SHA-512256 ("") =' \ @@ -400,7 +428,7 @@ skein1024.ref: 'cf21a613620e6c119eca31fdfaad449a8e02f95ca256c21d2a105f8e4157048f9fe1e897893ea18b64e0e37cb07d5ac947f27ba544caf7cbc1ad094e675aed77a366270f7eb7f46543bccfa61c526fd628408058ed00ed566ac35a9761d002e629c4fb0d430b2f4ad016fcc49c44d2981c4002da0eecc42144160e2eaea4855a' >> ${.TARGET} test: md4.ref md5.ref sha0.ref rmd160.ref sha1.ref sha224.ref sha256.ref sha384.ref \ - sha512.ref sha512t256.ref skein256.ref skein512.ref skein1024.ref + sha512.ref sha512t224.ref sha512t256.ref skein256.ref skein512.ref skein1024.ref @${ECHO} if any of these test fail, the code produces wrong results @${ECHO} and should NOT be used. ${CC} ${CFLAGS} ${LDFLAGS} -DMD=4 -o mddriver ${.CURDIR}/mddriver.c libmd.a @@ -432,6 +460,10 @@ test: md4.ref md5.ref sha0.ref rmd160.ref sha1.ref sha224.ref sha256.ref sha384. ${CC} ${CFLAGS} ${LDFLAGS} -DSHA=512 -o shadriver ${.CURDIR}/shadriver.c libmd.a ./shadriver | cmp sha512.ref - @${ECHO} SHA-512 passed test + ${CC} ${CFLAGS} ${LDFLAGS} -DSHA=512224 -o shadriver ${.CURDIR}/shadriver.c libmd.a + ./shadriver | cmp sha512t224.ref - + @${ECHO} SHA-512t224 passed test + -rm -f shadriver ${CC} ${CFLAGS} ${LDFLAGS} -DSHA=512256 -o shadriver ${.CURDIR}/shadriver.c libmd.a ./shadriver | cmp sha512t256.ref - @${ECHO} SHA-512t256 passed test diff --git a/lib/libmd/mdX.3 b/lib/libmd/mdX.3 index 30e6f367c662..50c0090921be 100644 --- a/lib/libmd/mdX.3 +++ b/lib/libmd/mdX.3 @@ -95,8 +95,7 @@ function is a wrapper for .Fn MDXFinal which converts the return value to a 33-character (including the terminating '\e0') -.Tn ASCII -string which represents the 128 bits in hexadecimal. +ASCII string which represents the 128 bits in hexadecimal. .Pp The .Fn MDXFile @@ -201,15 +200,12 @@ These functions appeared in .Fx 2.0 . .Sh AUTHORS The original MDX routines were developed by -.Tn RSA -Data Security, Inc., and published in the above references. +RSA Data Security, Inc., and published in the above references. This code is derived directly from these implementations by .An Poul-Henning Kamp Aq Mt phk@FreeBSD.org . .Pp Phk ristede runen. .Sh BUGS -The -.Tn MD5 -algorithm has been proven to be vulnerable to practical collision +The MD5 algorithm has been proven to be vulnerable to practical collision attacks and should not be relied upon to produce unique outputs, .Em nor should they be used as part of a cryptographic signature scheme. diff --git a/lib/libmd/ripemd.3 b/lib/libmd/ripemd.3 index d868ae12827b..cfe04ff140b7 100644 --- a/lib/libmd/ripemd.3 +++ b/lib/libmd/ripemd.3 @@ -75,8 +75,7 @@ function is a wrapper for .Fn RIPEMD160_Final which converts the return value to a 41-character (including the terminating '\e0') -.Tn ASCII -string which represents the 160 bits in hexadecimal. +ASCII string which represents the 160 bits in hexadecimal. .Pp The .Fn RIPEMD160_File @@ -156,9 +155,7 @@ These functions appeared in .Fx 4.0 . .Sh AUTHORS The core hash routines were implemented by Eric Young based on the -published -.Tn RIPEMD160 -specification. +published RIPEMD160 specification. .Sh BUGS No method is known to exist which finds two files having the same hash value, nor to find a file with a specific hash value. diff --git a/lib/libmd/sha.3 b/lib/libmd/sha.3 index 20a1e5639dde..d304644511e3 100644 --- a/lib/libmd/sha.3 +++ b/lib/libmd/sha.3 @@ -9,7 +9,7 @@ .\" From: Id: mdX.3,v 1.14 1999/02/11 20:31:49 wollman Exp .\" $FreeBSD$ .\" -.Dd May 21, 2019 +.Dd February 6, 2023 .Dt SHA 3 .Os .Sh NAME @@ -76,16 +76,9 @@ a .Dq fingerprint of the input-data, which does not disclose the actual input. .Pp -.Tn SHA -(or -.Tn SHA-0 ) -is the original Secure Hash Algorithm specified in -.Tn FIPS -160. -It was quickly proven insecure, and has been superseded by -.Tn SHA-1 . -.Tn SHA-0 -is included for compatibility purposes only. +SHA (or SHA-0) is the original Secure Hash Algorithm specified in FIPS 160. +It was quickly proven insecure, and has been superseded by SHA-1. +SHA-0 is included for compatibility purposes only. .Pp The .Fn SHA1_Init , @@ -109,8 +102,7 @@ is a wrapper for .Fn SHA1_Final which converts the return value to a 41-character (including the terminating '\e0') -.Tn ASCII -string which represents the 160 bits in hexadecimal. +ASCII string which represents the 160 bits in hexadecimal. .Pp .Fn SHA1_File calculates the digest of a file, and uses @@ -188,23 +180,8 @@ These functions appeared in .Sh AUTHORS The core hash routines were implemented by Eric Young based on the published -.Tn FIPS -standards. +FIPS standards. .Sh BUGS -The -.Tn SHA1 -algorithm has been proven to be vulnerable to practical collision +The SHA1 algorithm has been proven to be vulnerable to practical collision attacks and should not be relied upon to produce unique outputs, .Em nor should it be used as part of a new cryptographic signature scheme. -.Pp -The -.Tn IA32 -(Intel) implementation of -.Tn SHA-1 -makes heavy use of the -.Ql bswapl -instruction, which is not present on the original 80386. -Attempts to use -.Tn SHA-1 -on those processors will cause an illegal instruction trap. -(Arguably, the kernel should simply emulate this instruction.) diff --git a/lib/libmd/sha256.3 b/lib/libmd/sha256.3 index d11f2f783557..2cd9d66e7b8c 100644 --- a/lib/libmd/sha256.3 +++ b/lib/libmd/sha256.3 @@ -97,8 +97,7 @@ is a wrapper for .Fn SHA256_Final which converts the return value to a 65-character (including the terminating '\e0') -.Tn ASCII -string which represents the 256 bits in hexadecimal. +ASCII string which represents the 256 bits in hexadecimal. .Pp .Fn SHA256_File calculates the digest of a file, and uses @@ -178,9 +177,7 @@ These functions appeared in .Fx 6.0 . .Sh AUTHORS The core hash routines were implemented by Colin Percival based on -the published -.Tn FIPS 180-2 -standard. +the published FIPS 180-2 standard. .Sh BUGS No method is known to exist which finds two files having the same hash value, nor to find a file with a specific hash value. diff --git a/lib/libmd/sha512.3 b/lib/libmd/sha512.3 index 6a5ed6f887d9..196fbd4eeb79 100644 --- a/lib/libmd/sha512.3 +++ b/lib/libmd/sha512.3 @@ -9,7 +9,7 @@ .\" From: Id: mdX.3,v 1.14 1999/02/11 20:31:49 wollman Exp .\" $FreeBSD$ .\" -.Dd May 21, 2019 +.Dd February 3, 2023 .Dt SHA512 3 .Os .Sh NAME @@ -27,6 +27,13 @@ .Nm SHA384_File , .Nm SHA384_FileChunk , .Nm SHA384_Data , +.Nm SHA512_224_Init , +.Nm SHA512_224_Update , +.Nm SHA512_224_Final , +.Nm SHA512_224_End , +.Nm SHA512_224_File , +.Nm SHA512_224_FileChunk , +.Nm SHA512_224_Data .Nm SHA512_256_Init , .Nm SHA512_256_Update , .Nm SHA512_256_Final , @@ -71,6 +78,20 @@ .Fn SHA384_Data "const unsigned char *data" "unsigned int len" "char *buf" .In sha512t.h .Ft void +.Fn SHA512_224_Init "SHA512_CTX *context" +.Ft void +.Fn SHA512_224_Update "SHA512_CTX *context" "const unsigned char *data" "size_t len" +.Ft void +.Fn SHA512_224_Final "unsigned char digest[32]" "SHA512_CTX *context" +.Ft "char *" +.Fn SHA512_224_End "SHA512_CTX *context" "char *buf" +.Ft "char *" +.Fn SHA512_224_File "const char *filename" "char *buf" +.Ft "char *" +.Fn SHA512_224_FileChunk "const char *filename" "char *buf" "off_t offset" "off_t length" +.Ft "char *" +.Fn SHA512_224_Data "const unsigned char *data" "unsigned int len" "char *buf" +.Ft void .Fn SHA512_256_Init "SHA512_CTX *context" .Ft void .Fn SHA512_256_Update "SHA512_CTX *context" "const unsigned char *data" "size_t len" @@ -119,8 +140,7 @@ is a wrapper for .Fn SHA512_Final which converts the return value to a 129-character (including the terminating '\e0') -.Tn ASCII -string which represents the 512 bits in hexadecimal. +ASCII string which represents the 512 bits in hexadecimal. .Pp .Fn SHA512_File calculates the digest of a file, and uses @@ -167,29 +187,43 @@ If the argument is non-null it must point to at least 129 characters of buffer space. .Pp The -.Li SHA384_ +.Li SHA384_ , +.Li SHA512_224 , and .Li SHA512_256_ functions are identical to the .Li SHA512_ functions except they use a different initial hash value and the output is -truncated to 384 bits and 256 bits respectively. +truncated to 384, 224, and 256 bits respectively. .Pp .Fn SHA384_End is a wrapper for .Fn SHA384_Final which converts the return value to a 97-character (including the terminating '\e0') +ASCII string which represents the 384 bits in hexadecimal. +.Pp +.Fn SHA512_224_End +is a wrapper for +.Fn SHA512_Final +which converts the return value to a 57-character +(including the terminating '\e0') +ASCII string which represents the 224 bits in hexadecimal. +.Pp +.Fn SHA512_224_End +is a wrapper for +.Fn SHA512_Final +which converts the return value to a 57-character +(including the terminating '\e0') .Tn ASCII -string which represents the 384 bits in hexadecimal. +string which represents the 224 bits in hexadecimal. .Pp .Fn SHA512_256_End is a wrapper for .Fn SHA512_Final which converts the return value to a 65-character (including the terminating '\e0') -.Tn ASCII -string which represents the 256 bits in hexadecimal. +ASCII string which represents the 256 bits in hexadecimal. .Sh ERRORS The .Fn SHA512_End @@ -223,9 +257,7 @@ These functions appeared in .Fx 9.0 . .Sh AUTHORS The core hash routines were implemented by Colin Percival based on -the published -.Tn FIPS 180-2 -standard. +the published FIPS 180-2 standard. .Sh BUGS No method is known to exist which finds two files having the same hash value, nor to find a file with a specific hash value. diff --git a/lib/libmd/shadriver.c b/lib/libmd/shadriver.c index f5026eb3cc5d..3664eab9dbaa 100644 --- a/lib/libmd/shadriver.c +++ b/lib/libmd/shadriver.c @@ -51,6 +51,9 @@ __FBSDID("$FreeBSD$"); #elif SHA == 512 #undef SHA_Data #define SHA_Data SHA512_Data +#elif SHA == 512224 +#undef SHA_Data +#define SHA_Data SHA512_224_Data #elif SHA == 512256 #undef SHA_Data #define SHA_Data SHA512_256_Data diff --git a/lib/libmd/skein.3 b/lib/libmd/skein.3 index 325a1ab4874b..034a76700bdc 100644 --- a/lib/libmd/skein.3 +++ b/lib/libmd/skein.3 @@ -133,8 +133,7 @@ is a wrapper for .Fn SKEIN256_Final which converts the return value to a 33-character (including the terminating '\e0') -.Tn ASCII -string which represents the 256 bits in hexadecimal. +ASCII string which represents the 256 bits in hexadecimal. .Pp .Fn SKEIN256_File calculates the digest of a file, and uses diff --git a/sbin/md5/Makefile b/sbin/md5/Makefile index e499967d23d5..6bda75437275 100644 --- a/sbin/md5/Makefile +++ b/sbin/md5/Makefile @@ -17,6 +17,8 @@ LINKS= ${BINDIR}/md5 ${BINDIR}/md5sum \ ${BINDIR}/md5 ${BINDIR}/sha384sum \ ${BINDIR}/md5 ${BINDIR}/sha512 \ ${BINDIR}/md5 ${BINDIR}/sha512sum \ + ${BINDIR}/md5 ${BINDIR}/sha512t224 \ + ${BINDIR}/md5 ${BINDIR}/sha512t224sum \ ${BINDIR}/md5 ${BINDIR}/sha512t256 \ ${BINDIR}/md5 ${BINDIR}/sha512t256sum \ ${BINDIR}/md5 ${BINDIR}/skein256 \ @@ -39,6 +41,8 @@ MLINKS= md5.1 md5sum.1 \ md5.1 sha384sum.1 \ md5.1 sha512.1 \ md5.1 sha512sum.1 \ + md5.1 sha512t224.1 \ + md5.1 sha512t224sum.1 \ md5.1 sha512t256.1 \ md5.1 sha512t256sum.1 \ md5.1 skein256.1 \ diff --git a/sbin/md5/md5.1 b/sbin/md5/md5.1 index a3db48596606..ba654e131c3c 100644 --- a/sbin/md5/md5.1 +++ b/sbin/md5/md5.1 @@ -1,12 +1,14 @@ .\" $FreeBSD$ -.Dd July 26, 2022 +.Dd February 6, 2023 .Dt MD5 1 .Os .Sh NAME -.Nm md5 , sha1 , sha224 , sha256 , sha384 , sha512 , sha512t256 , rmd160 , -.Nm skein256 , skein512 , skein1024 , -.Nm md5sum , sha1sum , sha224sum , sha256sum , sha384sum , sha512sum , -.Nm sha512t256sum , rmd160sum , skein256sum , skein512sum , skein1024sum +.Nm md5 , sha1 , sha224 , sha256 , sha384 , +.Nm sha512 , sha512t224 , sha512t256 , +.Nm rmd160 , skein256 , skein512 , skein1024 , +.Nm md5sum , sha1sum , sha224sum , sha256sum , sha384sum , +.Nm sha512sum , sha512t224sum , sha512t256sum , +.Nm rmd160sum , skein256sum , skein512sum , skein1024sum .Nd calculate a message-digest fingerprint (checksum) for a file .Sh SYNOPSIS .Nm @@ -24,8 +26,8 @@ (All other hashes have the same options and usage.) .Sh DESCRIPTION The -.Nm md5 , sha1 , sha224 , sha256 , sha384 , sha512 , sha512t256 , rmd160 , -.Nm skein256 , skein512 , +.Nm md5 , sha1 , sha224 , sha256 , sha384 , sha512 , sha512t224 , sha512t256 , +.Nm rmd160 , skein256 , skein512 , and .Nm skein1024 utilities take as input a message of arbitrary length and produce as @@ -36,7 +38,7 @@ or of the input. The .Nm md5sum , sha1sum , sha224sum , sha256sum , sha384sum , sha512sum , -.Nm sha512t256sum , rmd160sum , skein256sum , skein512sum , +.Nm sha512t224sum , sha512t256sum , rmd160sum , skein256sum , skein512sum , and .Nm skein1024sum utilities do the same, but default to the reversed format of @@ -68,6 +70,9 @@ On 64-bit hardware, this algorithm is approximately 50% faster than SHA-256 but with the same level of security. The hashes are not interchangeable. .Pp +SHA-512t224 is identical to SHA-512t256, but with the digest truncated +to 224 bits. +.Pp It is recommended that all new applications use SHA-512 or SKEIN-512 instead of one of the other hash functions. .Pp diff --git a/sbin/md5/md5.c b/sbin/md5/md5.c index 97c587efd63c..db4cdd7da1ff 100644 --- a/sbin/md5/md5.c +++ b/sbin/md5/md5.c @@ -20,10 +20,10 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include #include + #include #include #include @@ -75,6 +75,7 @@ extern const char *SHA224_TestOutput[MDTESTCOUNT]; extern const char *SHA256_TestOutput[MDTESTCOUNT]; extern const char *SHA384_TestOutput[MDTESTCOUNT]; extern const char *SHA512_TestOutput[MDTESTCOUNT]; +extern const char *SHA512t224_TestOutput[MDTESTCOUNT]; extern const char *SHA512t256_TestOutput[MDTESTCOUNT]; extern const char *RIPEMD160_TestOutput[MDTESTCOUNT]; extern const char *SKEIN256_TestOutput[MDTESTCOUNT]; @@ -138,6 +139,9 @@ static const struct Algorithm_t Algorithm[] = { { "sha512", "SHA512", &SHA512_TestOutput, (DIGEST_Init*)&SHA512_Init, (DIGEST_Update*)&SHA512_Update, (DIGEST_End*)&SHA512_End, &SHA512_Data, &SHA512_Fd }, + { "sha512t224", "SHA512t224", &SHA512t224_TestOutput, (DIGEST_Init*)&SHA512_224_Init, + (DIGEST_Update*)&SHA512_224_Update, (DIGEST_End*)&SHA512_224_End, + &SHA512_224_Data, &SHA512_224_Fd }, { "sha512t256", "SHA512t256", &SHA512t256_TestOutput, (DIGEST_Init*)&SHA512_256_Init, (DIGEST_Update*)&SHA512_256_Update, (DIGEST_End*)&SHA512_256_End, &SHA512_256_Data, &SHA512_256_Fd }, @@ -585,6 +589,17 @@ const char *SHA512_TestOutput[MDTESTCOUNT] = { "e8a835195e039708b13d9131e025f4441dbdc521ce625f245a436dcd762f54bf5cb298d96235e6c6a304e087ec8189b9512cbdf6427737ea82793460c367b9c3" }; +const char *SHA512t224_TestOutput[MDTESTCOUNT] = { + "6ed0dd02806fa89e25de060c19d3ac86cabb87d6a0ddd05c333b84f4", + "d5cdb9ccc769a5121d4175f2bfdd13d6310e0d3d361ea75d82108327", + "4634270f707b6a54daae7530460842e20e37ed265ceee9a43e8924aa", + "ad1a4db188fe57064f4f24609d2a83cd0afb9b398eb2fcaeaae2c564", + "ff83148aa07ec30655c1b40aff86141c0215fe2a54f767d3f38743d8", + "a8b4b9174b99ffc67d6f49be9981587b96441051e16e6dd036b140d3", + "ae988faaa47e401a45f704d1272d99702458fea2ddc6582827556dd2", + "b3c3b945249b0c8c94aba76ea887bcaad5401665a1fbeb384af4d06b" +}; + const char *SHA512t256_TestOutput[MDTESTCOUNT] = { "c672b8d1ef56ed28ab87c3622c5114069bdd3ad7b8f9737498d0c01ecef0967a", "455e518824bc0601f9fb858ff5c37d417d67c2f8e0df2babe4808858aea830f8", diff --git a/sbin/md5/tests/algorithms.txt b/sbin/md5/tests/algorithms.txt index 88f0ff5b783a..304d86bd4d4c 100644 --- a/sbin/md5/tests/algorithms.txt +++ b/sbin/md5/tests/algorithms.txt @@ -5,6 +5,7 @@ sha224 sha256 sha384 sha512 +sha512t224 sha512t256 skein1024 skein256 diff --git a/sbin/md5/tests/self-test.sha512t224.chk b/sbin/md5/tests/self-test.sha512t224.chk new file mode 100644 index 000000000000..d0549199f76b --- /dev/null +++ b/sbin/md5/tests/self-test.sha512t224.chk @@ -0,0 +1,9 @@ +SHA512t224 test suite: +SHA512t224 ("") = 6ed0dd02806fa89e25de060c19d3ac86cabb87d6a0ddd05c333b84f4 - verified correct +SHA512t224 ("a") = d5cdb9ccc769a5121d4175f2bfdd13d6310e0d3d361ea75d82108327 - verified correct +SHA512t224 ("abc") = 4634270f707b6a54daae7530460842e20e37ed265ceee9a43e8924aa - verified correct +SHA512t224 ("message digest") = ad1a4db188fe57064f4f24609d2a83cd0afb9b398eb2fcaeaae2c564 - verified correct +SHA512t224 ("abcdefghijklmnopqrstuvwxyz") = ff83148aa07ec30655c1b40aff86141c0215fe2a54f767d3f38743d8 - verified correct +SHA512t224 ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") = a8b4b9174b99ffc67d6f49be9981587b96441051e16e6dd036b140d3 - verified correct +SHA512t224 ("12345678901234567890123456789012345678901234567890123456789012345678901234567890") = ae988faaa47e401a45f704d1272d99702458fea2ddc6582827556dd2 - verified correct +SHA512t224 ("MD5 has not yet (2001-09-03) been broken, but sufficient attacks have been made that its security is in some doubt") = b3c3b945249b0c8c94aba76ea887bcaad5401665a1fbeb384af4d06b - verified correct diff --git a/sbin/md5/tests/sha512t224.digest b/sbin/md5/tests/sha512t224.digest new file mode 100644 index 000000000000..34ad437ed15d --- /dev/null +++ b/sbin/md5/tests/sha512t224.digest @@ -0,0 +1,8 @@ +SHA512t224 (1.inp) = 6ed0dd02806fa89e25de060c19d3ac86cabb87d6a0ddd05c333b84f4 +SHA512t224 (2.inp) = d5cdb9ccc769a5121d4175f2bfdd13d6310e0d3d361ea75d82108327 +SHA512t224 (3.inp) = 4634270f707b6a54daae7530460842e20e37ed265ceee9a43e8924aa +SHA512t224 (4.inp) = ad1a4db188fe57064f4f24609d2a83cd0afb9b398eb2fcaeaae2c564 +SHA512t224 (5.inp) = ff83148aa07ec30655c1b40aff86141c0215fe2a54f767d3f38743d8 +SHA512t224 (6.inp) = a8b4b9174b99ffc67d6f49be9981587b96441051e16e6dd036b140d3 +SHA512t224 (7.inp) = ae988faaa47e401a45f704d1272d99702458fea2ddc6582827556dd2 +SHA512t224 (8.inp) = b3c3b945249b0c8c94aba76ea887bcaad5401665a1fbeb384af4d06b diff --git a/sbin/md5/tests/sha512t224sum.digest b/sbin/md5/tests/sha512t224sum.digest new file mode 100644 index 000000000000..36459078a7b2 --- /dev/null +++ b/sbin/md5/tests/sha512t224sum.digest @@ -0,0 +1,8 @@ +6ed0dd02806fa89e25de060c19d3ac86cabb87d6a0ddd05c333b84f4 1.inp +d5cdb9ccc769a5121d4175f2bfdd13d6310e0d3d361ea75d82108327 2.inp +4634270f707b6a54daae7530460842e20e37ed265ceee9a43e8924aa 3.inp +ad1a4db188fe57064f4f24609d2a83cd0afb9b398eb2fcaeaae2c564 4.inp +ff83148aa07ec30655c1b40aff86141c0215fe2a54f767d3f38743d8 5.inp +a8b4b9174b99ffc67d6f49be9981587b96441051e16e6dd036b140d3 6.inp +ae988faaa47e401a45f704d1272d99702458fea2ddc6582827556dd2 7.inp +b3c3b945249b0c8c94aba76ea887bcaad5401665a1fbeb384af4d06b 8.inp From nobody Thu Feb 9 20:52:25 2023 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 4PCTZd3y31z3ngSZ; Thu, 9 Feb 2023 20:52: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 4PCTZd3T9dz4285; Thu, 9 Feb 2023 20:52:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675975945; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kjBTmjjiruu4104DT3Gw+cU/bb2iSNB0Vp8mVdEHhiU=; b=sJmng2obBtbvd9O6gO2DqgqD0bPayjW4G5uaO5/0Cjm8MbTo4QCLZZu53KeeOiGCBWEOqe jvjx6pI7m2DWW0LVsiT+02cLa9eG2vW3eI52US9F/vydeu4TvDFoYm/kLKi4HhRcsB62+V u+tXZwug0lckYke2OVUgOp5eEBxe74X5hZZ5jKTBQIN5j49bcIrvUo+CS68b7daWDUF6kT cR7A0SGvuSFR0PR8ZABwOuKjDyfnpxdeU3FFk13bsXDVmzddTROiDeyDjrDmpnqTuCxUDN vCce37nxo6JdPAMyIwKzZWeQaN4ZNJ3RiRdnxZkS0Ri3SGPQxp+Yl6CJno7vcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675975945; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kjBTmjjiruu4104DT3Gw+cU/bb2iSNB0Vp8mVdEHhiU=; b=IgZ5iJyo/43QoE/Iy4ydrAcF8t3xb4i/QM+dGQcgC+JkdoVpddHcxJYggs/UaDfev+bPsC zvKlwO22tbynbCCwPIYIbuc8J8Udkot7dcQuLI8z+23FBeg/Mv6K6jl7SexLDWTyZkV/DJ DZ6SW8/+Yh79V89DRgf2jcZbT+TJKADleBOO246WYqPC6PEuRI5EXHNmlmlOZY8VKtKaGj 9R4AteTKSzqi9SP8mowtMBHjaKn7QFq6YR6pOFIlgDjvsMmuZynduk4EjSIcyc7lyz87V0 apbYaBfhYWyQE4ynDTzLFNukA8fd7Zogw7tErSwt91Q6AzDg3B2dadgQw6qa2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675975945; a=rsa-sha256; cv=none; b=RMTWOQEoTZyJJcbusJE/FWFVUIyuBFS3Ci0QnXeKWC0KK1iSkb7s4EuseLefvDPtM18BxI OIKM23GBAV0b/UP0KHTpQWqiiY9qmw/qO21i5kH3B3K5MuPKZBzGZiq1ACysJZQMvHhfnH 6gjQV8LbAAXO1IMBCFIgzUM37HlaIwJD8LbCVKvP/h8gQ/v9QrEDbw1hQGyWVUwsxxD6cF hcak/vxJQ0VcS+tXRq9vy+ZCOcl//baa50cWaABQfNSSktNiSV/+5uTGEw+WrPVAHRy+Kb miguA+l5TTSNpS+23uPA6ZAxuIRh202xRTT3LJ5Kt9sIYwQH2jh3o0vHeQPXZQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCTZd2Z1Vzs9L; Thu, 9 Feb 2023 20:52:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319KqPl1013464; Thu, 9 Feb 2023 20:52:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319KqPkW013463; Thu, 9 Feb 2023 20:52:25 GMT (envelope-from git) Date: Thu, 9 Feb 2023 20:52:25 GMT Message-Id: <202302092052.319KqPkW013463@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 2631a2599b8b - stable/13 - sockbufs: add sbreserve_locked_limit() with custom maxsockbuf limit. 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: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2631a2599b8b3b4c6f651a9bbe54454167b13bcf Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=2631a2599b8b3b4c6f651a9bbe54454167b13bcf commit 2631a2599b8b3b4c6f651a9bbe54454167b13bcf Author: Alexander V. Chernikov AuthorDate: 2022-09-27 13:52:11 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-09 20:40:58 +0000 sockbufs: add sbreserve_locked_limit() with custom maxsockbuf limit. Protocols such as netlink may need a large socket receive buffer, measured in tens of megabytes. This change allows netlink to set larger socket buffers (given the privs are in place), without requiring user to manuall bump maxsockbuf. Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D36747 (cherry picked from commit 7b660faa9e30c15d3be9b2c44c3ca046a33331f4) --- sys/kern/uipc_sockbuf.c | 22 +++++++++++++++------- sys/sys/sockbuf.h | 2 ++ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c index 80505dd4dbd2..cbfcc0e5fe95 100644 --- a/sys/kern/uipc_sockbuf.c +++ b/sys/kern/uipc_sockbuf.c @@ -64,9 +64,10 @@ void (*aio_swake)(struct socket *, struct sockbuf *); * Primitive routines for operating on socket buffers */ +#define BUF_MAX_ADJ(_sz) (((u_quad_t)(_sz)) * MCLBYTES / (MSIZE + MCLBYTES)) + u_long sb_max = SB_MAX; -u_long sb_max_adj = - (quad_t)SB_MAX * MCLBYTES / (MSIZE + MCLBYTES); /* adjusted sb_max */ +u_long sb_max_adj = BUF_MAX_ADJ(SB_MAX); static u_long sb_efficiency = 8; /* parameter for sbreserve() */ @@ -592,7 +593,7 @@ sysctl_handle_sb_max(SYSCTL_HANDLER_ARGS) if (tmp_sb_max < MSIZE + MCLBYTES) return (EINVAL); sb_max = tmp_sb_max; - sb_max_adj = (u_quad_t)sb_max * MCLBYTES / (MSIZE + MCLBYTES); + sb_max_adj = BUF_MAX_ADJ(sb_max); return (0); } @@ -601,8 +602,8 @@ sysctl_handle_sb_max(SYSCTL_HANDLER_ARGS) * become limiting if buffering efficiency is near the normal case. */ int -sbreserve_locked(struct sockbuf *sb, u_long cc, struct socket *so, - struct thread *td) +sbreserve_locked_limit(struct sockbuf *sb, u_long cc, struct socket *so, + u_long buf_max, struct thread *td) { rlim_t sbsize_limit; @@ -615,7 +616,7 @@ sbreserve_locked(struct sockbuf *sb, u_long cc, struct socket *so, * appropriate thread resource limits are available. In that case, * we don't apply a process limit. */ - if (cc > sb_max_adj) + if (cc > BUF_MAX_ADJ(buf_max)) return (0); if (td != NULL) { sbsize_limit = lim_cur(td, RLIMIT_SBSIZE); @@ -624,12 +625,19 @@ sbreserve_locked(struct sockbuf *sb, u_long cc, struct socket *so, if (!chgsbsize(so->so_cred->cr_uidinfo, &sb->sb_hiwat, cc, sbsize_limit)) return (0); - sb->sb_mbmax = min(cc * sb_efficiency, sb_max); + sb->sb_mbmax = min(cc * sb_efficiency, buf_max); if (sb->sb_lowat > sb->sb_hiwat) sb->sb_lowat = sb->sb_hiwat; return (1); } +int +sbreserve_locked(struct sockbuf *sb, u_long cc, struct socket *so, + struct thread *td) +{ + return (sbreserve_locked_limit(sb, cc, so, sb_max, td)); +} + int sbsetopt(struct socket *so, int cmd, u_long cc) { diff --git a/sys/sys/sockbuf.h b/sys/sys/sockbuf.h index a263555b3a21..57f080615bdc 100644 --- a/sys/sys/sockbuf.h +++ b/sys/sys/sockbuf.h @@ -176,6 +176,8 @@ void sbrelease_locked(struct sockbuf *sb, struct socket *so); int sbsetopt(struct socket *so, int cmd, u_long cc); int sbreserve_locked(struct sockbuf *sb, u_long cc, struct socket *so, struct thread *td); +int sbreserve_locked_limit(struct sockbuf *sb, u_long cc, struct socket *so, + u_long buf_max, struct thread *td); void sbsndptr_adv(struct sockbuf *sb, struct mbuf *mb, u_int len); struct mbuf * sbsndptr_noadv(struct sockbuf *sb, u_int off, u_int *moff); From nobody Thu Feb 9 21:19:56 2023 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 4PCVBP25Nyz3nknk; Thu, 9 Feb 2023 21:19: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 4PCVBP1drcz46YT; Thu, 9 Feb 2023 21:19:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675977597; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ckgdeqsHIfk9+tH8cp+wgxjbQrZjJQo2BFAqrRd6YO0=; b=MNIHRahd4ljpcqK2V0A2MTwUrwZ8vGpUCyAIFNTyR9TtHy8NBggzoY6MFgDP2Kx4uBEi9J /DLTSa9UeJwnHv3/BCGVYqVrobQeorOOSM5y8yZO9PwNVoiOOSeWlorhvFs+vs97Terp5t 80ERfUlm7gn5vXVFY560wwCtXQ5H2sHMXyw5rXiMpnzikVM3N+kychfg4YtI2Bf41sIXc7 f02yp5F+KDYq5Qw1sg1z+yKqpXKLR4wc8dC4n751QtM76I+9liwP4hXH7z0lr2RuMrP9W7 W+aumEoSngFxIxHPErV5FzDXAK10izPfGUF6G5fvEUhIwCSubFIHZlYBzic9QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675977597; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ckgdeqsHIfk9+tH8cp+wgxjbQrZjJQo2BFAqrRd6YO0=; b=mamhseodk+xd5G0OS86/6HxVhDUulGrzAK8Ew0Wc4M1NiF6lgEML0yuCDkyHCyh+9wnSNc 0sbaasuvv4H1Oi/g2xQ0WrqgGvdsl+fyaxNeWzU/uwu4xbEcyZ6iqEC+dVYy3SeDldNwoR XEOraluq3Mt0q1P0ihW5JfA+D6PIPIcW0rgZg7hwGUBknFPhZVQxkeIMitntfo5nhD3m8u mnf+LRFGzXajb2Gi8WjU07QcvWSrIKxJSU/95zjh3cjodYFj4QuuEYpv/rgTz5yIBkOueK pVO0qpTE+raRNZr01PkApw67Fk1IUfyJLscw4HLv3vymtQ7enrF8FYYcBLIwDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675977597; a=rsa-sha256; cv=none; b=ibjiBBtwI+vhpge4WUkXomA3tG76lWJ+ZKon6BlCkCMpvJ8eNzQYkDLAwJp7iufd95L6rg VfFeRYnADJkfSZG1vPpTATnqdtHhHaIfZEHsUWrSMSQ8DCtEyKQx4gZSxqM4xt3t9hQJjD 3W46RhIAoD6xehVZZ1UcxFlNHfnI7SKMfXmI44jxbvZJ9OueAOc+gh641FgEz7qoboWnk4 N2dyAJXu/i97ez1lEZO2vSJcBL17suGx+dX+35z8yN1E6bXf+Z/m3uEMgfWkHXP1RzhJSb c+EVsr0B4DLeuPpv3RB24dn5FTfZF3dN/YrkIyGkDu9XbNhUMwtS/CDJGHDyiA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCVBP0jpxzsYc; Thu, 9 Feb 2023 21:19:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319LJvp8043738; Thu, 9 Feb 2023 21:19:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319LJuhI043737; Thu, 9 Feb 2023 21:19:56 GMT (envelope-from git) Date: Thu, 9 Feb 2023 21:19:56 GMT Message-Id: <202302092119.319LJuhI043737@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: 9b5c751a5aef - stable/13 - sqlite3: Vendor import of sqlite3 3.40.1 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: 9b5c751a5aefd1343221721851bf50fe9f3d49b4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=9b5c751a5aefd1343221721851bf50fe9f3d49b4 commit 9b5c751a5aefd1343221721851bf50fe9f3d49b4 Author: Cy Schubert AuthorDate: 2023-01-06 17:10:14 +0000 Commit: Cy Schubert CommitDate: 2023-02-09 21:19:41 +0000 sqlite3: Vendor import of sqlite3 3.40.1 Release notes at https://www.sqlite.org/releaselog/3_40_1.html. Obtained from: https://www.sqlite.org/2022/sqlite-autoconf-3400100.tar.gz Merge commit 'c728c97f5c838c9a873516c4499e4e1a41788ce7' into main (cherry picked from commit 5ae830e9bacf120c5ab95d515814e2b815e839a6) --- contrib/sqlite3/configure | 20 ++--- contrib/sqlite3/configure.ac | 2 +- contrib/sqlite3/shell.c | 20 +++-- contrib/sqlite3/sqlite3.c | 182 +++++++++++++++++++++++++++++++++---------- contrib/sqlite3/sqlite3.h | 13 +++- contrib/sqlite3/sqlite3rc.h | 2 +- 6 files changed, 173 insertions(+), 66 deletions(-) diff --git a/contrib/sqlite3/configure b/contrib/sqlite3/configure index 1f9c2c17e787..13ff272ad2e6 100755 --- a/contrib/sqlite3/configure +++ b/contrib/sqlite3/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for sqlite 3.40.0. +# Generated by GNU Autoconf 2.71 for sqlite 3.40.1. # # Report bugs to . # @@ -621,8 +621,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.40.0' -PACKAGE_STRING='sqlite 3.40.0' +PACKAGE_VERSION='3.40.1' +PACKAGE_STRING='sqlite 3.40.1' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1367,7 +1367,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.40.0 to adapt to many kinds of systems. +\`configure' configures sqlite 3.40.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1438,7 +1438,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.40.0:";; + short | recursive ) echo "Configuration of sqlite 3.40.1:";; esac cat <<\_ACEOF @@ -1563,7 +1563,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.40.0 +sqlite configure 3.40.1 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1833,7 +1833,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.40.0, which was +It was created by sqlite $as_me 3.40.1, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3106,7 +3106,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.40.0' + VERSION='3.40.1' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -15314,7 +15314,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.40.0, which was +This file was extended by sqlite $as_me 3.40.1, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15373,7 +15373,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -sqlite config.status 3.40.0 +sqlite config.status 3.40.1 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/contrib/sqlite3/configure.ac b/contrib/sqlite3/configure.ac index aadce30bf20c..bb8a90ebafc3 100644 --- a/contrib/sqlite3/configure.ac +++ b/contrib/sqlite3/configure.ac @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.40.0, http://www.sqlite.org) +AC_INIT(sqlite, 3.40.1, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) diff --git a/contrib/sqlite3/shell.c b/contrib/sqlite3/shell.c index 6280ebf6108f..63f708c0bf74 100644 --- a/contrib/sqlite3/shell.c +++ b/contrib/sqlite3/shell.c @@ -3930,7 +3930,7 @@ static unsigned re_next_char(ReInput *p){ c = (c&0x0f)<<12 | ((p->z[p->i]&0x3f)<<6) | (p->z[p->i+1]&0x3f); p->i += 2; if( c<=0x7ff || (c>=0xd800 && c<=0xdfff) ) c = 0xfffd; - }else if( (c&0xf8)==0xf0 && p->i+3mx && (p->z[p->i]&0xc0)==0x80 + }else if( (c&0xf8)==0xf0 && p->i+2mx && (p->z[p->i]&0xc0)==0x80 && (p->z[p->i+1]&0xc0)==0x80 && (p->z[p->i+2]&0xc0)==0x80 ){ c = (c&0x07)<<18 | ((p->z[p->i]&0x3f)<<12) | ((p->z[p->i+1]&0x3f)<<6) | (p->z[p->i+2]&0x3f); @@ -4457,15 +4457,15 @@ static const char *re_compile(ReCompiled **ppRe, const char *zIn, int noCase){ ** one or more matching characters, enter those matching characters into ** zInit[]. The re_match() routine can then search ahead in the input ** string looking for the initial match without having to run the whole - ** regex engine over the string. Do not worry able trying to match + ** regex engine over the string. Do not worry about trying to match ** unicode characters beyond plane 0 - those are very rare and this is ** just an optimization. */ if( pRe->aOp[0]==RE_OP_ANYSTAR && !noCase ){ for(j=0, i=1; j<(int)sizeof(pRe->zInit)-2 && pRe->aOp[i]==RE_OP_MATCH; i++){ unsigned x = pRe->aArg[i]; - if( x<=127 ){ + if( x<=0x7f ){ pRe->zInit[j++] = (unsigned char)x; - }else if( x<=0xfff ){ + }else if( x<=0x7ff ){ pRe->zInit[j++] = (unsigned char)(0xc0 | (x>>6)); pRe->zInit[j++] = 0x80 | (x&0x3f); }else if( x<=0xffff ){ @@ -14629,6 +14629,7 @@ static void recoverFinalCleanup(sqlite3_recover *p){ p->pTblList = 0; sqlite3_finalize(p->pGetPage); p->pGetPage = 0; + sqlite3_file_control(p->dbIn, p->zDb, SQLITE_FCNTL_RESET_CACHE, 0); { #ifndef NDEBUG @@ -14927,6 +14928,7 @@ static int recoverVfsRead(sqlite3_file *pFd, void *aBuf, int nByte, i64 iOff){ ** ** + first freelist page (32-bits at offset 32) ** + size of freelist (32-bits at offset 36) + ** + the wal-mode flags (16-bits at offset 18) ** ** We also try to preserve the auto-vacuum, incr-value, user-version ** and application-id fields - all 32 bit quantities at offsets @@ -14990,7 +14992,8 @@ static int recoverVfsRead(sqlite3_file *pFd, void *aBuf, int nByte, i64 iOff){ if( p->pPage1Cache ){ p->pPage1Disk = &p->pPage1Cache[nByte]; memcpy(p->pPage1Disk, aBuf, nByte); - + aHdr[18] = a[18]; + aHdr[19] = a[19]; recoverPutU32(&aHdr[28], dbsz); recoverPutU32(&aHdr[56], enc); recoverPutU16(&aHdr[105], pgsz-nReserve); @@ -15186,6 +15189,7 @@ static void recoverStep(sqlite3_recover *p){ recoverOpenOutput(p); /* Open transactions on both the input and output databases. */ + sqlite3_file_control(p->dbIn, p->zDb, SQLITE_FCNTL_RESET_CACHE, 0); recoverExec(p, p->dbIn, "PRAGMA writable_schema = on"); recoverExec(p, p->dbIn, "BEGIN"); if( p->errCode==SQLITE_OK ) p->bCloseTransaction = 1; @@ -16275,7 +16279,7 @@ static int safeModeAuth( "zipfile", "zipfile_cds", }; - UNUSED_PARAMETER(zA2); + UNUSED_PARAMETER(zA1); UNUSED_PARAMETER(zA3); UNUSED_PARAMETER(zA4); switch( op ){ @@ -16290,7 +16294,7 @@ static int safeModeAuth( case SQLITE_FUNCTION: { int i; for(i=0; i[[SQLITE_FCNTL_CKSM_FILE]] ** Used by the cksmvfs VFS module only. +** +**
  • [[SQLITE_FCNTL_RESET_CACHE]] +** If there is currently no transaction open on the database, and the +** database is not a temp db, then this file-control purges the contents +** of the in-memory page cache. If there is an open transaction, or if +** the db is a temp-db, it is a no-op, not an error. ** */ #define SQLITE_FCNTL_LOCKSTATE 1 @@ -1540,6 +1546,7 @@ struct sqlite3_io_methods { #define SQLITE_FCNTL_CKPT_START 39 #define SQLITE_FCNTL_EXTERNAL_READER 40 #define SQLITE_FCNTL_CKSM_FILE 41 +#define SQLITE_FCNTL_RESET_CACHE 42 /* deprecated names */ #define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE @@ -15714,6 +15721,8 @@ SQLITE_PRIVATE int sqlite3BtreeCheckpoint(Btree*, int, int *, int *); SQLITE_PRIVATE int sqlite3BtreeTransferRow(BtCursor*, BtCursor*, i64); +SQLITE_PRIVATE void sqlite3BtreeClearCache(Btree*); + /* ** If we are not using shared cache, then there is no need to ** use mutexes to access the BtShared structures. So make the @@ -27290,9 +27299,13 @@ static int memsys5Roundup(int n){ if( n<=mem5.szAtom ) return mem5.szAtom; return mem5.szAtom*2; } - if( n>0x40000000 ) return 0; + if( n>0x10000000 ){ + if( n>0x40000000 ) return 0; + if( n>0x20000000 ) return 0x40000000; + return 0x20000000; + } for(iFullSz=mem5.szAtom*8; iFullSz=n ) return iFullSz/2; + if( (iFullSz/2)>=(i64)n ) return iFullSz/2; return iFullSz; } @@ -37338,6 +37351,9 @@ static int robust_open(const char *z, int f, mode_t m){ break; } if( fd>=SQLITE_MINIMUM_FILE_DESCRIPTOR ) break; + if( (f & (O_EXCL|O_CREAT))==(O_EXCL|O_CREAT) ){ + (void)osUnlink(z); + } osClose(fd); sqlite3_log(SQLITE_WARNING, "attempt to open \"%s\" as file descriptor %d", z, fd); @@ -51071,6 +51087,7 @@ static int memdbTruncate(sqlite3_file*, sqlite3_int64 size); static int memdbSync(sqlite3_file*, int flags); static int memdbFileSize(sqlite3_file*, sqlite3_int64 *pSize); static int memdbLock(sqlite3_file*, int); +static int memdbUnlock(sqlite3_file*, int); /* static int memdbCheckReservedLock(sqlite3_file*, int *pResOut);// not used */ static int memdbFileControl(sqlite3_file*, int op, void *pArg); /* static int memdbSectorSize(sqlite3_file*); // not used */ @@ -51129,7 +51146,7 @@ static const sqlite3_io_methods memdb_io_methods = { memdbSync, /* xSync */ memdbFileSize, /* xFileSize */ memdbLock, /* xLock */ - memdbLock, /* xUnlock - same as xLock in this case */ + memdbUnlock, /* xUnlock */ 0, /* memdbCheckReservedLock, */ /* xCheckReservedLock */ memdbFileControl, /* xFileControl */ 0, /* memdbSectorSize,*/ /* xSectorSize */ @@ -51330,39 +51347,81 @@ static int memdbLock(sqlite3_file *pFile, int eLock){ MemFile *pThis = (MemFile*)pFile; MemStore *p = pThis->pStore; int rc = SQLITE_OK; - if( eLock==pThis->eLock ) return SQLITE_OK; + if( eLock<=pThis->eLock ) return SQLITE_OK; memdbEnter(p); - if( eLock>SQLITE_LOCK_SHARED ){ - if( p->mFlags & SQLITE_DESERIALIZE_READONLY ){ - rc = SQLITE_READONLY; - }else if( pThis->eLock<=SQLITE_LOCK_SHARED ){ - if( p->nWrLock ){ - rc = SQLITE_BUSY; - }else{ - p->nWrLock = 1; + + assert( p->nWrLock==0 || p->nWrLock==1 ); + assert( pThis->eLock<=SQLITE_LOCK_SHARED || p->nWrLock==1 ); + assert( pThis->eLock==SQLITE_LOCK_NONE || p->nRdLock>=1 ); + + if( eLock>SQLITE_LOCK_SHARED && (p->mFlags & SQLITE_DESERIALIZE_READONLY) ){ + rc = SQLITE_READONLY; + }else{ + switch( eLock ){ + case SQLITE_LOCK_SHARED: { + assert( pThis->eLock==SQLITE_LOCK_NONE ); + if( p->nWrLock>0 ){ + rc = SQLITE_BUSY; + }else{ + p->nRdLock++; + } + break; + }; + + case SQLITE_LOCK_RESERVED: + case SQLITE_LOCK_PENDING: { + assert( pThis->eLock>=SQLITE_LOCK_SHARED ); + if( ALWAYS(pThis->eLock==SQLITE_LOCK_SHARED) ){ + if( p->nWrLock>0 ){ + rc = SQLITE_BUSY; + }else{ + p->nWrLock = 1; + } + } + break; + } + + default: { + assert( eLock==SQLITE_LOCK_EXCLUSIVE ); + assert( pThis->eLock>=SQLITE_LOCK_SHARED ); + if( p->nRdLock>1 ){ + rc = SQLITE_BUSY; + }else if( pThis->eLock==SQLITE_LOCK_SHARED ){ + p->nWrLock = 1; + } + break; } } - }else if( eLock==SQLITE_LOCK_SHARED ){ - if( pThis->eLock > SQLITE_LOCK_SHARED ){ - assert( p->nWrLock==1 ); - p->nWrLock = 0; - }else if( p->nWrLock ){ - rc = SQLITE_BUSY; - }else{ - p->nRdLock++; + } + if( rc==SQLITE_OK ) pThis->eLock = eLock; + memdbLeave(p); + return rc; +} + +/* +** Unlock an memdb-file. +*/ +static int memdbUnlock(sqlite3_file *pFile, int eLock){ + MemFile *pThis = (MemFile*)pFile; + MemStore *p = pThis->pStore; + if( eLock>=pThis->eLock ) return SQLITE_OK; + memdbEnter(p); + + assert( eLock==SQLITE_LOCK_SHARED || eLock==SQLITE_LOCK_NONE ); + if( eLock==SQLITE_LOCK_SHARED ){ + if( ALWAYS(pThis->eLock>SQLITE_LOCK_SHARED) ){ + p->nWrLock--; } }else{ - assert( eLock==SQLITE_LOCK_NONE ); if( pThis->eLock>SQLITE_LOCK_SHARED ){ - assert( p->nWrLock==1 ); - p->nWrLock = 0; + p->nWrLock--; } - assert( p->nRdLock>0 ); p->nRdLock--; } - if( rc==SQLITE_OK ) pThis->eLock = eLock; + + pThis->eLock = eLock; memdbLeave(p); - return rc; + return SQLITE_OK; } #if 0 @@ -51472,7 +51531,7 @@ static int memdbOpen( memset(pFile, 0, sizeof(*pFile)); szName = sqlite3Strlen30(zName); - if( szName>1 && zName[0]=='/' ){ + if( szName>1 && (zName[0]=='/' || zName[0]=='\\') ){ int i; #ifndef SQLITE_MUTEX_OMIT sqlite3_mutex *pVfsMutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_VFS1); @@ -51819,6 +51878,13 @@ end_deserialize: return rc; } +/* +** Return true if the VFS is the memvfs. +*/ +SQLITE_PRIVATE int sqlite3IsMemdb(const sqlite3_vfs *pVfs){ + return pVfs==&memdb_vfs; +} + /* ** This routine is called when the extension is loaded. ** Register the new VFS. @@ -79147,6 +79213,17 @@ SQLITE_PRIVATE int sqlite3BtreeIsReadonly(Btree *p){ */ SQLITE_PRIVATE int sqlite3HeaderSizeBtree(void){ return ROUND8(sizeof(MemPage)); } +/* +** If no transaction is active and the database is not a temp-db, clear +** the in-memory pager cache. +*/ +SQLITE_PRIVATE void sqlite3BtreeClearCache(Btree *p){ + BtShared *pBt = p->pBt; + if( pBt->inTransaction==TRANS_NONE ){ + sqlite3PagerClearCache(pBt->pPager); + } +} + #if !defined(SQLITE_OMIT_SHARED_CACHE) /* ** Return true if the Btree passed as the only argument is sharable. @@ -83386,7 +83463,7 @@ SQLITE_PRIVATE void sqlite3VdbeAppendP4(Vdbe *p, void *pP4, int n){ if( p->db->mallocFailed ){ freeP4(p->db, n, pP4); }else{ - assert( pP4!=0 ); + assert( pP4!=0 || n==P4_DYNAMIC ); assert( p->nOp>0 ); pOp = &p->aOp[p->nOp-1]; assert( pOp->p4type==P4_NOTUSED ); @@ -132298,7 +132375,7 @@ static const sqlite3_api_routines sqlite3Apis = { #endif sqlite3_db_name, /* Version 3.40.0 and later */ - sqlite3_value_type + sqlite3_value_encoding }; /* True if x is the directory separator character @@ -145439,7 +145516,7 @@ SQLITE_PRIVATE Trigger *sqlite3TriggerList(Parse *pParse, Table *pTab){ if( pTrig->pTabSchema==pTab->pSchema && pTrig->table && 0==sqlite3StrICmp(pTrig->table, pTab->zName) - && pTrig->pTabSchema!=pTmpSchema + && (pTrig->pTabSchema!=pTmpSchema || pTrig->bReturning) ){ pTrig->pNext = pList; pList = pTrig; @@ -155623,7 +155700,7 @@ SQLITE_PRIVATE int sqlite3WhereIsDistinct(WhereInfo *pWInfo){ ** block sorting is required. */ SQLITE_PRIVATE int sqlite3WhereIsOrdered(WhereInfo *pWInfo){ - return pWInfo->nOBSat; + return pWInfo->nOBSat<0 ? 0 : pWInfo->nOBSat; } /* @@ -174531,7 +174608,7 @@ SQLITE_API int sqlite3_overload_function( rc = sqlite3FindFunction(db, zName, nArg, SQLITE_UTF8, 0)!=0; sqlite3_mutex_leave(db->mutex); if( rc ) return SQLITE_OK; - zCopy = sqlite3_mprintf(zName); + zCopy = sqlite3_mprintf("%s", zName); if( zCopy==0 ) return SQLITE_NOMEM; return sqlite3_create_function_v2(db, zName, nArg, SQLITE_UTF8, zCopy, sqlite3InvalidFunction, 0, 0, sqlite3_free); @@ -176363,6 +176440,9 @@ SQLITE_API int sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, vo sqlite3BtreeSetPageSize(pBtree, 0, iNew, 0); } rc = SQLITE_OK; + }else if( op==SQLITE_FCNTL_RESET_CACHE ){ + sqlite3BtreeClearCache(pBtree); + rc = SQLITE_OK; }else{ int nSave = db->busyHandler.nBusy; rc = sqlite3OsFileControl(fd, op, pArg); @@ -217778,6 +217858,22 @@ static int sessionChangesetNextOne( if( p->op==SQLITE_INSERT ) p->op = SQLITE_DELETE; else if( p->op==SQLITE_DELETE ) p->op = SQLITE_INSERT; } + + /* If this is an UPDATE that is part of a changeset, then check that + ** there are no fields in the old.* record that are not (a) PK fields, + ** or (b) also present in the new.* record. + ** + ** Such records are technically corrupt, but the rebaser was at one + ** point generating them. Under most circumstances this is benign, but + ** can cause spurious SQLITE_RANGE errors when applying the changeset. */ + if( p->bPatchset==0 && p->op==SQLITE_UPDATE){ + for(i=0; inCol; i++){ + if( p->abPK[i]==0 && p->apValue[i+p->nCol]==0 ){ + sqlite3ValueFree(p->apValue[i]); + p->apValue[i] = 0; + } + } + } } return SQLITE_ROW; @@ -219974,7 +220070,7 @@ static void sessionAppendPartialUpdate( if( !pIter->abPK[i] && a1[0] ) bData = 1; memcpy(pOut, a1, n1); pOut += n1; - }else if( a2[0]!=0xFF ){ + }else if( a2[0]!=0xFF && a1[0] ){ bData = 1; memcpy(pOut, a2, n2); pOut += n2; @@ -236004,7 +236100,7 @@ static void fts5CheckTransactionState(Fts5FullTable *p, int op, int iSavepoint){ break; case FTS5_SYNC: - assert( p->ts.eState==1 ); + assert( p->ts.eState==1 || p->ts.eState==2 ); p->ts.eState = 2; break; @@ -236019,21 +236115,21 @@ static void fts5CheckTransactionState(Fts5FullTable *p, int op, int iSavepoint){ break; case FTS5_SAVEPOINT: - assert( p->ts.eState==1 ); + assert( p->ts.eState>=1 ); assert( iSavepoint>=0 ); assert( iSavepoint>=p->ts.iSavepoint ); p->ts.iSavepoint = iSavepoint; break; case FTS5_RELEASE: - assert( p->ts.eState==1 ); + assert( p->ts.eState>=1 ); assert( iSavepoint>=0 ); assert( iSavepoint<=p->ts.iSavepoint ); p->ts.iSavepoint = iSavepoint-1; break; case FTS5_ROLLBACKTO: - assert( p->ts.eState==1 ); + assert( p->ts.eState>=1 ); assert( iSavepoint>=-1 ); /* The following assert() can fail if another vtab strikes an error ** within an xSavepoint() call then SQLite calls xRollbackTo() - without @@ -237369,7 +237465,7 @@ static int fts5UpdateMethod( int rc = SQLITE_OK; /* Return code */ /* A transaction must be open when this is called. */ - assert( pTab->ts.eState==1 ); + assert( pTab->ts.eState==1 || pTab->ts.eState==2 ); assert( pVtab->zErrMsg==0 ); assert( nArg==1 || nArg==(2+pConfig->nCol+2) ); @@ -238537,7 +238633,7 @@ static void fts5SourceIdFunc( ){ assert( nArg==0 ); UNUSED_PARAM2(nArg, apUnused); - sqlite3_result_text(pCtx, "fts5: 2022-11-16 12:10:08 89c459e766ea7e9165d0beeb124708b955a4950d0f4792f457465d71b158d318", -1, SQLITE_TRANSIENT); + sqlite3_result_text(pCtx, "fts5: 2022-12-28 14:03:47 df5c253c0b3dd24916e4ec7cf77d3db5294cc9fd45ae7b9c5e82ad8197f38a24", -1, SQLITE_TRANSIENT); } /* diff --git a/contrib/sqlite3/sqlite3.h b/contrib/sqlite3/sqlite3.h index 2859cc09b4f5..24b916750c25 100644 --- a/contrib/sqlite3/sqlite3.h +++ b/contrib/sqlite3/sqlite3.h @@ -146,9 +146,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.40.0" -#define SQLITE_VERSION_NUMBER 3040000 -#define SQLITE_SOURCE_ID "2022-11-16 12:10:08 89c459e766ea7e9165d0beeb124708b955a4950d0f4792f457465d71b158d318" +#define SQLITE_VERSION "3.40.1" +#define SQLITE_VERSION_NUMBER 3040001 +#define SQLITE_SOURCE_ID "2022-12-28 14:03:47 df5c253c0b3dd24916e4ec7cf77d3db5294cc9fd45ae7b9c5e82ad8197f38a24" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -1192,6 +1192,12 @@ struct sqlite3_io_methods { ** **
  • [[SQLITE_FCNTL_CKSM_FILE]] ** Used by the cksmvfs VFS module only. +** +**
  • [[SQLITE_FCNTL_RESET_CACHE]] +** If there is currently no transaction open on the database, and the +** database is not a temp db, then this file-control purges the contents +** of the in-memory page cache. If there is an open transaction, or if +** the db is a temp-db, it is a no-op, not an error. ** */ #define SQLITE_FCNTL_LOCKSTATE 1 @@ -1234,6 +1240,7 @@ struct sqlite3_io_methods { #define SQLITE_FCNTL_CKPT_START 39 #define SQLITE_FCNTL_EXTERNAL_READER 40 #define SQLITE_FCNTL_CKSM_FILE 41 +#define SQLITE_FCNTL_RESET_CACHE 42 /* deprecated names */ #define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE diff --git a/contrib/sqlite3/sqlite3rc.h b/contrib/sqlite3/sqlite3rc.h index 713a6c653ab5..abe983cb060b 100644 --- a/contrib/sqlite3/sqlite3rc.h +++ b/contrib/sqlite3/sqlite3rc.h @@ -1,3 +1,3 @@ #ifndef SQLITE_RESOURCE_VERSION -#define SQLITE_RESOURCE_VERSION 3,40,0 +#define SQLITE_RESOURCE_VERSION 3,40,1 #endif From nobody Thu Feb 9 21:19:58 2023 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 4PCVBQ4Pv3z3nl5s; Thu, 9 Feb 2023 21:19:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PCVBQ3Rmzz46P1; Thu, 9 Feb 2023 21:19:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675977598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BSpiYi2DGfF9kNR51ypRVmc+brFM8ORwOwYNJFCMJ0k=; b=o0rpzg4vsJMwB/yKPk0ubxDryzdsLJBXXoza0pQwfHqPTfXZYqfoQd/nbqfDFgxAnKhtAK 7K4t24WjIQvg5FB6lHSEQ3I+DzcRoNmjL4HjjvJoykpvqeRcxH9T1ezNcMNhl9KLCCiPEi yfvbz7qmj1VJWSxOVrP81i/pHRjKc3dL7sPPfEVdCWgcVZ92gcwDD/uUl6TK9moQlJXzDD mfEFoJ+8oKhST30M75dHo6QAoPNVdgew5DjloXO+XnUFLk8YK2/ctoZ8iqSXLO4eb6F97n l+kAbDaGisghC/IPl6VDPm5JISaIgOFxBTyObsjtXWV/ZTLH/RH+VoHgJGgfbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675977598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BSpiYi2DGfF9kNR51ypRVmc+brFM8ORwOwYNJFCMJ0k=; b=C0u3VtVxm4MPOeAJQ3Yy++kPwvwnfL0KQ2Uo9LsjkvdkICDXd0lADcSRjiZFTYH9YBr0Tb ZWIrLH4Q292LJj6N9A5U9zOezLEKlUCR+GzQG1ltPBW+it6FrPRqUdvNZMHxJRImJEUOOp KTTVztMsckThyconverlqqKB3XNLu++VQfBJhIfLQJxFe5sVlHz1ry16pX6podfb0rJSx7 4bulkCVoF3jsS3pzwnsk47XUacLrFyZJP1oQ8WPndgLXu9zGI2061wq+WhabktFuWNRPun 9ePdfvWahQij7NbcjB0fC0N5C4P4FXahCUeGlB1JM8WG/SvI+JtC2DwFma9xsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675977598; a=rsa-sha256; cv=none; b=qxF96MkFJ2WxVw3iQ03asZapNhlBAhdrqMGC4zeOrqaZZEZVaeAr08yTuDgk8kXmrrmPOw nkMMg1TswZHO8QfeYBQ2YP5DxoYtO3rDPDd+3V1Bhy8qBQtd3Wgpa/FraKM0O+3jtY/Tmq EJomtOyn4r294rTvf8Juh3D4nTPssasDMFECO/F6FthFHW9Qm0XEisHwMhP35PEMtln/XD M4Q40gtZdcOUxusSDiH7ATaD+hUd27Ch7sYJ8HXJOUYhDiKQp3O8Wd9pdECu9aB2AUem65 wQutuVjUOvhwtVlt5R0EJ1C6yqwGF/tklOfJdqJU02hanISQALl/tsc3Px9h8A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCVBQ1tGzzsfJ; Thu, 9 Feb 2023 21:19:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319LJwGd043763; Thu, 9 Feb 2023 21:19:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319LJwp3043762; Thu, 9 Feb 2023 21:19:58 GMT (envelope-from git) Date: Thu, 9 Feb 2023 21:19:58 GMT Message-Id: <202302092119.319LJwp3043762@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: 0dbe2e4e8f85 - stable/13 - ipfilter: Correctly type ipf_pullup() 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: 0dbe2e4e8f85ce1869a87f112a4a1e8c5f8f1145 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=0dbe2e4e8f85ce1869a87f112a4a1e8c5f8f1145 commit 0dbe2e4e8f85ce1869a87f112a4a1e8c5f8f1145 Author: Cy Schubert AuthorDate: 2023-01-31 19:09:00 +0000 Commit: Cy Schubert CommitDate: 2023-02-09 21:19:41 +0000 ipfilter: Correctly type ipf_pullup() ipf_pullup() outputs a pointer to ip_t. Though returning a pointer to void does work, it is imprecise and not completely correct. (cherry picked from commit c941e8c65d9df878136dc5d51d70256d33f7769f) --- sys/netpfil/ipfilter/netinet/ip_fil.h | 2 +- sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/sys/netpfil/ipfilter/netinet/ip_fil.h b/sys/netpfil/ipfilter/netinet/ip_fil.h index 85a79eda1172..002ddfdc8348 100644 --- a/sys/netpfil/ipfilter/netinet/ip_fil.h +++ b/sys/netpfil/ipfilter/netinet/ip_fil.h @@ -1700,7 +1700,7 @@ extern int ipf_outobj(ipf_main_softc_t *, void *, void *, int); extern int ipf_outobjk(ipf_main_softc_t *, ipfobj_t *, void *); extern int ipf_outobjsz(ipf_main_softc_t *, void *, void *, int, int); -extern void *ipf_pullup(mb_t *, fr_info_t *, int); +extern ip_t *ipf_pullup(mb_t *, fr_info_t *, int); extern int ipf_resolvedest(ipf_main_softc_t *, char *, struct frdest *, int); extern int ipf_resolvefunc(ipf_main_softc_t *, void *); diff --git a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c index 57a006ed5393..fa0cdbab0ab3 100644 --- a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c +++ b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c @@ -1178,17 +1178,17 @@ mbufchainlen(struct mbuf *m0) /* We assume that 'xmin' is a pointer to a buffer that is part of the chain */ /* of buffers that starts at *fin->fin_mp. */ /* ------------------------------------------------------------------------ */ -void * +ip_t * ipf_pullup(mb_t *xmin, fr_info_t *fin, int len) { int dpoff, ipoff; mb_t *m = xmin; - char *ip; + ip_t *ip; if (m == NULL) return (NULL); - ip = (char *)fin->fin_ip; + ip = fin->fin_ip; if ((fin->fin_flx & FI_COALESCE) != 0) return (ip); @@ -1233,6 +1233,7 @@ ipf_pullup(mb_t *xmin, fr_info_t *fin, int len) #endif } else { + m = m_pullup(m, len); } if (n != NULL) @@ -1259,9 +1260,9 @@ ipf_pullup(mb_t *xmin, fr_info_t *fin, int len) m = m->m_next; } fin->fin_m = m; - ip = MTOD(m, char *) + ipoff; + ip = MTOD(m, ip_t *) + ipoff; - fin->fin_ip = (ip_t *)ip; + fin->fin_ip = ip; if (fin->fin_dp != NULL) fin->fin_dp = (char *)fin->fin_ip + dpoff; if (fin->fin_fraghdr != NULL) From nobody Thu Feb 9 21:19:59 2023 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 4PCVBR6Lkrz3nl5x; Thu, 9 Feb 2023 21:19: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 4PCVBR4sG9z46PV; Thu, 9 Feb 2023 21:19:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675977599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ts4wQC1hpaXkN0sv/Xme+m9HB6t9+z0e1Eajp/RvKyA=; b=OB+Y5NVywTaxHKFAOFv6UhBAwSMUG4z4KIMRCeHkXkuKTuUqhrztTJpW/wsCjHunanW709 H+QYuEGiJO+mUDQGxb3G1Byd2aSVwAP6nJ7zV8ROtEGG5er03QAJ0nn6OncWCJVq0nflmD 5irZ0MPzgOktAPHPMGuc05gTzMx6/iTfEKiFUaJBbOP0r7GYBEWn7iT5baSEHdeaN3Vuk3 hjEUPOnjx8Suit0MGpXFmYq8RoTzoXxoLS1VU+Lfib6YRLccEyc3v8Mi1HQGjMfQDmfVAz uJBjaikCaPDGswCu7sQoXPBr4D+ZJpWpqlFfeWu+lCfbQPTzbK3H+GcX9dnYeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675977599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ts4wQC1hpaXkN0sv/Xme+m9HB6t9+z0e1Eajp/RvKyA=; b=BKlTga5cFCwDBdcCYp0wjNsQTdHylBqU3ZY9ng9vgmz/V/dKwF/oilncIVsACQJuKVTB54 XBe3CoPjm3qHinrrbWUn2B3pOq4aSToK1iHvsiSfrQCQExGYyL6CEQWbKmcJ2I95DoEGSl +oi5oIKryVZUQLIsI5Y/jrrn3QuCfTu9gAilPMSgmUeAMhu2tqcLqO0dh5Is3E9VEszlXQ 9voN7F2qWVaiPpSFFjJEeIlVw/3DFi9I5/BPxyPJ2atoHCgj+ssK+b6gCp4l3f/DiSJgrl dJZV4Wo70EV3Wg3Xl39e1oX0Wu5LiSuA9G7v03HxzaKUaqiy92thdQrE0j0+rQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675977599; a=rsa-sha256; cv=none; b=Z+tz+ci68kKX2Wb7XTG1elhRvXlETBvwegcFnbXip0+zvFBTLZtYmfnnIuGCfXKGmOdVpd aVGsHOi2FguVGzxRG8bH14a3zWhyKXAtrnpc6NpZcZT6QTbluln3XjCcdtT3hXx+c4MWyv AQ+4uUJB0+0eB7BG41dALdrZ8+EMkCybmOk3VqupvSfqoEJxULTJGe6iWA5iaoBnOOu+tq PQDqckclCZSdIFirlBWIRDfEkNBbcqQE8npJyVvlO6O2jItS1bSNFLVM1nkdepSvdwYsYF Xcjbq5DxonMd5CmQXxIoi/jcjaZsS5Z5rfVebDEIk1aU+8v3ds6Pf8YmhXWZFQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCVBR2tMBzs1F; Thu, 9 Feb 2023 21:19:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319LJxTq043792; Thu, 9 Feb 2023 21:19:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319LJxPN043791; Thu, 9 Feb 2023 21:19:59 GMT (envelope-from git) Date: Thu, 9 Feb 2023 21:19:59 GMT Message-Id: <202302092119.319LJxPN043791@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: 1da7a8a06615 - stable/13 - ipfilter: Fix use after free on packet with broken lengths 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: 1da7a8a066150bf132b3e1a48fad009212a0010a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=1da7a8a066150bf132b3e1a48fad009212a0010a commit 1da7a8a066150bf132b3e1a48fad009212a0010a Author: Cy Schubert AuthorDate: 2023-02-02 00:49:08 +0000 Commit: Cy Schubert CommitDate: 2023-02-09 21:19:41 +0000 ipfilter: Fix use after free on packet with broken lengths Under the scenario with a packet with length of 67 bytes, a header length using the default of 20 bytes and a TCP data offset (th_off) of 48 will cause m_pullup() to fail to make sure bytes are arragned contiguously. m_pullup() will free the mbuf chain and return a null. ipfilter stores the resultant mbuf address (or the resulting NULL) in its fr_info_t structure. Unfortuntely the eroneous packet is not flagged for drop. This results in a kernel page fault at line 410 of sys/netinet/ip_fastfwd.c as it tries to use a now previously freed, by m_pullup(), mbuf. PR: 266442 Reported by: Robert Morris (cherry picked from commit 79f7745c098a766d34a4e072cdd1a06e6d0829d5) --- sys/netpfil/ipfilter/netinet/fil.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sys/netpfil/ipfilter/netinet/fil.c b/sys/netpfil/ipfilter/netinet/fil.c index 5ced528d1263..6fcfd3cea301 100644 --- a/sys/netpfil/ipfilter/netinet/fil.c +++ b/sys/netpfil/ipfilter/netinet/fil.c @@ -1113,8 +1113,10 @@ ipf_pr_pullup(fr_info_t *fin, int plen) if (M_LEN(fin->fin_m) < plen + fin->fin_ipoff) { #if defined(_KERNEL) if (ipf_pullup(fin->fin_m, fin, plen) == NULL) { - DT(ipf_pullup_fail); + DT1(ipf_pullup_fail, fr_info_t *, fin); LBUMP(ipf_stats[fin->fin_out].fr_pull[1]); + fin->fin_reason = FRB_PULLUP; + fin->fin_flx |= FI_BAD; return (-1); } LBUMP(ipf_stats[fin->fin_out].fr_pull[0]); @@ -1127,6 +1129,7 @@ ipf_pr_pullup(fr_info_t *fin, int plen) *fin->fin_mp = NULL; fin->fin_m = NULL; fin->fin_ip = NULL; + fin->fin_flx |= FI_BAD; return (-1); #endif } @@ -3180,6 +3183,14 @@ finished: SPL_X(s); + if (fin->fin_m == NULL && fin->fin_flx & FI_BAD && + fin->fin_reason == FRB_PULLUP) { + /* m_pullup() has freed the mbuf */ + LBUMP(ipf_stats[out].fr_blocked[fin->fin_reason]); + return (-1); + } + + #ifdef _KERNEL if (FR_ISPASS(pass)) return (0); From nobody Thu Feb 9 21:21:05 2023 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 4PCVCj56dgz3nkvl; Thu, 9 Feb 2023 21:21: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 4PCVCj4x0fz47xJ; Thu, 9 Feb 2023 21:21:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675977665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v9nChgnDXxezHd8Jqgw34CYW9r90tJ+ZxbDLq7wE1XY=; b=prmlDgbP1V2C4t+xyGuDo/Vb4x/l/ZYdCP7JaXPEWfWEIvfEU3eXXhcwgAOYOYqbhD/+xI 6+iVEqzKH+oPexwCw062yBQMKf1a8oxQOOkAjKAdB6pMl1rIdUJnMBBc0Km+IyOXnKCeyR XuBiFk45akQQll9rGwfyF8n8yhQcd0AmDGqpWijxJH9exk4ZU8di/vvRJ0TuWI2Y66saHZ sW0eas2LK4yN2ripmS7FRFkmWmxJpkKoFiYbFjHI3fAg2jbVVuJi38IJt1AZ+wbnTBbGJg AiI+nbG54Jvne48iGXGxPc4YpXsrK7RqnAWCAK5vxYBuMf7wkarqn96jCBwpwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675977665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v9nChgnDXxezHd8Jqgw34CYW9r90tJ+ZxbDLq7wE1XY=; b=I2uSf4AWfzgJ3qVMngwwk+GsBzhB/bee/Ak84Us6ZdA8jSY5Jp8IIXUPkkb6EIQhNxV1AZ BU35pA+Bx3NUSX64gdsG7vPIXH3vrWn+Vi4ipLdqyHpGbFJkDOmz1tKTKDSSKyNSbW9cNR fg+mBtvyI4+WBAYHUnF/74HUeGDI5mANjDwhLhwBWD1NXy0hl+q64vxHPJuTjoKJGGGCU1 zMD9D0aQQBU24ffRQR3BGec/9dN4t5JsNeIAl2c8BCdBXeLTXGJ9J2cQ7wutaWgoDCs478 ZSTV6l6FiHNcgnC+nbgDtByGkz3dzTLHVADG0skQS37Upl/x4nUwPi3MkJb0Og== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675977665; a=rsa-sha256; cv=none; b=qw5Y9wAId6QzA3sXgnfFsgbTh8suj3P1VuPT+9Y1TC8Ras9zsuSdLFOojTzAaPCbMg4k60 1PdHX6x2IOLoekanOZHdX86bJe+2Tmm+sBLE9rRKkoMXZYjwSdZdWAMPW9m2xXnmTp1d4J t7cBKt7Pc0km1KBvRTX27KP8cWTODC4ES1cxpEmwXsSy6bbtpilO7AHp3UhrLx9OQILvG7 CG0S7VqRsLzMn5HdqYgV884w+VHuYLo3ViqqrHquebIHZ0T1kvT9dC0NpPL7Kb+u9sbcbM wBM0VTmJxfYC7s0FxShc+laee2MUj+elAZkOMkMRgfjV0Ab29ye787pEhP78Wg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCVCj3zYjzsfY; Thu, 9 Feb 2023 21:21:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319LL5L4056768; Thu, 9 Feb 2023 21:21:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319LL5ui056767; Thu, 9 Feb 2023 21:21:05 GMT (envelope-from git) Date: Thu, 9 Feb 2023 21:21:05 GMT Message-Id: <202302092121.319LL5ui056767@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: f26d90ba8bcf - stable/12 - sqlite3: Vendor import of sqlite3 3.40.1 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/12 X-Git-Reftype: branch X-Git-Commit: f26d90ba8bcf599f6ed2a0914e39c01524c7eef0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=f26d90ba8bcf599f6ed2a0914e39c01524c7eef0 commit f26d90ba8bcf599f6ed2a0914e39c01524c7eef0 Author: Cy Schubert AuthorDate: 2023-01-06 17:10:14 +0000 Commit: Cy Schubert CommitDate: 2023-02-09 21:20:50 +0000 sqlite3: Vendor import of sqlite3 3.40.1 Release notes at https://www.sqlite.org/releaselog/3_40_1.html. Obtained from: https://www.sqlite.org/2022/sqlite-autoconf-3400100.tar.gz Merge commit 'c728c97f5c838c9a873516c4499e4e1a41788ce7' into main (cherry picked from commit 5ae830e9bacf120c5ab95d515814e2b815e839a6) --- contrib/sqlite3/configure | 20 ++--- contrib/sqlite3/configure.ac | 2 +- contrib/sqlite3/shell.c | 20 +++-- contrib/sqlite3/sqlite3.c | 182 +++++++++++++++++++++++++++++++++---------- contrib/sqlite3/sqlite3.h | 13 +++- contrib/sqlite3/sqlite3rc.h | 2 +- 6 files changed, 173 insertions(+), 66 deletions(-) diff --git a/contrib/sqlite3/configure b/contrib/sqlite3/configure index 1f9c2c17e787..13ff272ad2e6 100755 --- a/contrib/sqlite3/configure +++ b/contrib/sqlite3/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for sqlite 3.40.0. +# Generated by GNU Autoconf 2.71 for sqlite 3.40.1. # # Report bugs to . # @@ -621,8 +621,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.40.0' -PACKAGE_STRING='sqlite 3.40.0' +PACKAGE_VERSION='3.40.1' +PACKAGE_STRING='sqlite 3.40.1' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1367,7 +1367,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.40.0 to adapt to many kinds of systems. +\`configure' configures sqlite 3.40.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1438,7 +1438,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.40.0:";; + short | recursive ) echo "Configuration of sqlite 3.40.1:";; esac cat <<\_ACEOF @@ -1563,7 +1563,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.40.0 +sqlite configure 3.40.1 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1833,7 +1833,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.40.0, which was +It was created by sqlite $as_me 3.40.1, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3106,7 +3106,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.40.0' + VERSION='3.40.1' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -15314,7 +15314,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.40.0, which was +This file was extended by sqlite $as_me 3.40.1, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15373,7 +15373,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -sqlite config.status 3.40.0 +sqlite config.status 3.40.1 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/contrib/sqlite3/configure.ac b/contrib/sqlite3/configure.ac index aadce30bf20c..bb8a90ebafc3 100644 --- a/contrib/sqlite3/configure.ac +++ b/contrib/sqlite3/configure.ac @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.40.0, http://www.sqlite.org) +AC_INIT(sqlite, 3.40.1, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) diff --git a/contrib/sqlite3/shell.c b/contrib/sqlite3/shell.c index 6280ebf6108f..63f708c0bf74 100644 --- a/contrib/sqlite3/shell.c +++ b/contrib/sqlite3/shell.c @@ -3930,7 +3930,7 @@ static unsigned re_next_char(ReInput *p){ c = (c&0x0f)<<12 | ((p->z[p->i]&0x3f)<<6) | (p->z[p->i+1]&0x3f); p->i += 2; if( c<=0x7ff || (c>=0xd800 && c<=0xdfff) ) c = 0xfffd; - }else if( (c&0xf8)==0xf0 && p->i+3mx && (p->z[p->i]&0xc0)==0x80 + }else if( (c&0xf8)==0xf0 && p->i+2mx && (p->z[p->i]&0xc0)==0x80 && (p->z[p->i+1]&0xc0)==0x80 && (p->z[p->i+2]&0xc0)==0x80 ){ c = (c&0x07)<<18 | ((p->z[p->i]&0x3f)<<12) | ((p->z[p->i+1]&0x3f)<<6) | (p->z[p->i+2]&0x3f); @@ -4457,15 +4457,15 @@ static const char *re_compile(ReCompiled **ppRe, const char *zIn, int noCase){ ** one or more matching characters, enter those matching characters into ** zInit[]. The re_match() routine can then search ahead in the input ** string looking for the initial match without having to run the whole - ** regex engine over the string. Do not worry able trying to match + ** regex engine over the string. Do not worry about trying to match ** unicode characters beyond plane 0 - those are very rare and this is ** just an optimization. */ if( pRe->aOp[0]==RE_OP_ANYSTAR && !noCase ){ for(j=0, i=1; j<(int)sizeof(pRe->zInit)-2 && pRe->aOp[i]==RE_OP_MATCH; i++){ unsigned x = pRe->aArg[i]; - if( x<=127 ){ + if( x<=0x7f ){ pRe->zInit[j++] = (unsigned char)x; - }else if( x<=0xfff ){ + }else if( x<=0x7ff ){ pRe->zInit[j++] = (unsigned char)(0xc0 | (x>>6)); pRe->zInit[j++] = 0x80 | (x&0x3f); }else if( x<=0xffff ){ @@ -14629,6 +14629,7 @@ static void recoverFinalCleanup(sqlite3_recover *p){ p->pTblList = 0; sqlite3_finalize(p->pGetPage); p->pGetPage = 0; + sqlite3_file_control(p->dbIn, p->zDb, SQLITE_FCNTL_RESET_CACHE, 0); { #ifndef NDEBUG @@ -14927,6 +14928,7 @@ static int recoverVfsRead(sqlite3_file *pFd, void *aBuf, int nByte, i64 iOff){ ** ** + first freelist page (32-bits at offset 32) ** + size of freelist (32-bits at offset 36) + ** + the wal-mode flags (16-bits at offset 18) ** ** We also try to preserve the auto-vacuum, incr-value, user-version ** and application-id fields - all 32 bit quantities at offsets @@ -14990,7 +14992,8 @@ static int recoverVfsRead(sqlite3_file *pFd, void *aBuf, int nByte, i64 iOff){ if( p->pPage1Cache ){ p->pPage1Disk = &p->pPage1Cache[nByte]; memcpy(p->pPage1Disk, aBuf, nByte); - + aHdr[18] = a[18]; + aHdr[19] = a[19]; recoverPutU32(&aHdr[28], dbsz); recoverPutU32(&aHdr[56], enc); recoverPutU16(&aHdr[105], pgsz-nReserve); @@ -15186,6 +15189,7 @@ static void recoverStep(sqlite3_recover *p){ recoverOpenOutput(p); /* Open transactions on both the input and output databases. */ + sqlite3_file_control(p->dbIn, p->zDb, SQLITE_FCNTL_RESET_CACHE, 0); recoverExec(p, p->dbIn, "PRAGMA writable_schema = on"); recoverExec(p, p->dbIn, "BEGIN"); if( p->errCode==SQLITE_OK ) p->bCloseTransaction = 1; @@ -16275,7 +16279,7 @@ static int safeModeAuth( "zipfile", "zipfile_cds", }; - UNUSED_PARAMETER(zA2); + UNUSED_PARAMETER(zA1); UNUSED_PARAMETER(zA3); UNUSED_PARAMETER(zA4); switch( op ){ @@ -16290,7 +16294,7 @@ static int safeModeAuth( case SQLITE_FUNCTION: { int i; for(i=0; i[[SQLITE_FCNTL_CKSM_FILE]] ** Used by the cksmvfs VFS module only. +** +**
  • [[SQLITE_FCNTL_RESET_CACHE]] +** If there is currently no transaction open on the database, and the +** database is not a temp db, then this file-control purges the contents +** of the in-memory page cache. If there is an open transaction, or if +** the db is a temp-db, it is a no-op, not an error. ** */ #define SQLITE_FCNTL_LOCKSTATE 1 @@ -1540,6 +1546,7 @@ struct sqlite3_io_methods { #define SQLITE_FCNTL_CKPT_START 39 #define SQLITE_FCNTL_EXTERNAL_READER 40 #define SQLITE_FCNTL_CKSM_FILE 41 +#define SQLITE_FCNTL_RESET_CACHE 42 /* deprecated names */ #define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE @@ -15714,6 +15721,8 @@ SQLITE_PRIVATE int sqlite3BtreeCheckpoint(Btree*, int, int *, int *); SQLITE_PRIVATE int sqlite3BtreeTransferRow(BtCursor*, BtCursor*, i64); +SQLITE_PRIVATE void sqlite3BtreeClearCache(Btree*); + /* ** If we are not using shared cache, then there is no need to ** use mutexes to access the BtShared structures. So make the @@ -27290,9 +27299,13 @@ static int memsys5Roundup(int n){ if( n<=mem5.szAtom ) return mem5.szAtom; return mem5.szAtom*2; } - if( n>0x40000000 ) return 0; + if( n>0x10000000 ){ + if( n>0x40000000 ) return 0; + if( n>0x20000000 ) return 0x40000000; + return 0x20000000; + } for(iFullSz=mem5.szAtom*8; iFullSz=n ) return iFullSz/2; + if( (iFullSz/2)>=(i64)n ) return iFullSz/2; return iFullSz; } @@ -37338,6 +37351,9 @@ static int robust_open(const char *z, int f, mode_t m){ break; } if( fd>=SQLITE_MINIMUM_FILE_DESCRIPTOR ) break; + if( (f & (O_EXCL|O_CREAT))==(O_EXCL|O_CREAT) ){ + (void)osUnlink(z); + } osClose(fd); sqlite3_log(SQLITE_WARNING, "attempt to open \"%s\" as file descriptor %d", z, fd); @@ -51071,6 +51087,7 @@ static int memdbTruncate(sqlite3_file*, sqlite3_int64 size); static int memdbSync(sqlite3_file*, int flags); static int memdbFileSize(sqlite3_file*, sqlite3_int64 *pSize); static int memdbLock(sqlite3_file*, int); +static int memdbUnlock(sqlite3_file*, int); /* static int memdbCheckReservedLock(sqlite3_file*, int *pResOut);// not used */ static int memdbFileControl(sqlite3_file*, int op, void *pArg); /* static int memdbSectorSize(sqlite3_file*); // not used */ @@ -51129,7 +51146,7 @@ static const sqlite3_io_methods memdb_io_methods = { memdbSync, /* xSync */ memdbFileSize, /* xFileSize */ memdbLock, /* xLock */ - memdbLock, /* xUnlock - same as xLock in this case */ + memdbUnlock, /* xUnlock */ 0, /* memdbCheckReservedLock, */ /* xCheckReservedLock */ memdbFileControl, /* xFileControl */ 0, /* memdbSectorSize,*/ /* xSectorSize */ @@ -51330,39 +51347,81 @@ static int memdbLock(sqlite3_file *pFile, int eLock){ MemFile *pThis = (MemFile*)pFile; MemStore *p = pThis->pStore; int rc = SQLITE_OK; - if( eLock==pThis->eLock ) return SQLITE_OK; + if( eLock<=pThis->eLock ) return SQLITE_OK; memdbEnter(p); - if( eLock>SQLITE_LOCK_SHARED ){ - if( p->mFlags & SQLITE_DESERIALIZE_READONLY ){ - rc = SQLITE_READONLY; - }else if( pThis->eLock<=SQLITE_LOCK_SHARED ){ - if( p->nWrLock ){ - rc = SQLITE_BUSY; - }else{ - p->nWrLock = 1; + + assert( p->nWrLock==0 || p->nWrLock==1 ); + assert( pThis->eLock<=SQLITE_LOCK_SHARED || p->nWrLock==1 ); + assert( pThis->eLock==SQLITE_LOCK_NONE || p->nRdLock>=1 ); + + if( eLock>SQLITE_LOCK_SHARED && (p->mFlags & SQLITE_DESERIALIZE_READONLY) ){ + rc = SQLITE_READONLY; + }else{ + switch( eLock ){ + case SQLITE_LOCK_SHARED: { + assert( pThis->eLock==SQLITE_LOCK_NONE ); + if( p->nWrLock>0 ){ + rc = SQLITE_BUSY; + }else{ + p->nRdLock++; + } + break; + }; + + case SQLITE_LOCK_RESERVED: + case SQLITE_LOCK_PENDING: { + assert( pThis->eLock>=SQLITE_LOCK_SHARED ); + if( ALWAYS(pThis->eLock==SQLITE_LOCK_SHARED) ){ + if( p->nWrLock>0 ){ + rc = SQLITE_BUSY; + }else{ + p->nWrLock = 1; + } + } + break; + } + + default: { + assert( eLock==SQLITE_LOCK_EXCLUSIVE ); + assert( pThis->eLock>=SQLITE_LOCK_SHARED ); + if( p->nRdLock>1 ){ + rc = SQLITE_BUSY; + }else if( pThis->eLock==SQLITE_LOCK_SHARED ){ + p->nWrLock = 1; + } + break; } } - }else if( eLock==SQLITE_LOCK_SHARED ){ - if( pThis->eLock > SQLITE_LOCK_SHARED ){ - assert( p->nWrLock==1 ); - p->nWrLock = 0; - }else if( p->nWrLock ){ - rc = SQLITE_BUSY; - }else{ - p->nRdLock++; + } + if( rc==SQLITE_OK ) pThis->eLock = eLock; + memdbLeave(p); + return rc; +} + +/* +** Unlock an memdb-file. +*/ +static int memdbUnlock(sqlite3_file *pFile, int eLock){ + MemFile *pThis = (MemFile*)pFile; + MemStore *p = pThis->pStore; + if( eLock>=pThis->eLock ) return SQLITE_OK; + memdbEnter(p); + + assert( eLock==SQLITE_LOCK_SHARED || eLock==SQLITE_LOCK_NONE ); + if( eLock==SQLITE_LOCK_SHARED ){ + if( ALWAYS(pThis->eLock>SQLITE_LOCK_SHARED) ){ + p->nWrLock--; } }else{ - assert( eLock==SQLITE_LOCK_NONE ); if( pThis->eLock>SQLITE_LOCK_SHARED ){ - assert( p->nWrLock==1 ); - p->nWrLock = 0; + p->nWrLock--; } - assert( p->nRdLock>0 ); p->nRdLock--; } - if( rc==SQLITE_OK ) pThis->eLock = eLock; + + pThis->eLock = eLock; memdbLeave(p); - return rc; + return SQLITE_OK; } #if 0 @@ -51472,7 +51531,7 @@ static int memdbOpen( memset(pFile, 0, sizeof(*pFile)); szName = sqlite3Strlen30(zName); - if( szName>1 && zName[0]=='/' ){ + if( szName>1 && (zName[0]=='/' || zName[0]=='\\') ){ int i; #ifndef SQLITE_MUTEX_OMIT sqlite3_mutex *pVfsMutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_VFS1); @@ -51819,6 +51878,13 @@ end_deserialize: return rc; } +/* +** Return true if the VFS is the memvfs. +*/ +SQLITE_PRIVATE int sqlite3IsMemdb(const sqlite3_vfs *pVfs){ + return pVfs==&memdb_vfs; +} + /* ** This routine is called when the extension is loaded. ** Register the new VFS. @@ -79147,6 +79213,17 @@ SQLITE_PRIVATE int sqlite3BtreeIsReadonly(Btree *p){ */ SQLITE_PRIVATE int sqlite3HeaderSizeBtree(void){ return ROUND8(sizeof(MemPage)); } +/* +** If no transaction is active and the database is not a temp-db, clear +** the in-memory pager cache. +*/ +SQLITE_PRIVATE void sqlite3BtreeClearCache(Btree *p){ + BtShared *pBt = p->pBt; + if( pBt->inTransaction==TRANS_NONE ){ + sqlite3PagerClearCache(pBt->pPager); + } +} + #if !defined(SQLITE_OMIT_SHARED_CACHE) /* ** Return true if the Btree passed as the only argument is sharable. @@ -83386,7 +83463,7 @@ SQLITE_PRIVATE void sqlite3VdbeAppendP4(Vdbe *p, void *pP4, int n){ if( p->db->mallocFailed ){ freeP4(p->db, n, pP4); }else{ - assert( pP4!=0 ); + assert( pP4!=0 || n==P4_DYNAMIC ); assert( p->nOp>0 ); pOp = &p->aOp[p->nOp-1]; assert( pOp->p4type==P4_NOTUSED ); @@ -132298,7 +132375,7 @@ static const sqlite3_api_routines sqlite3Apis = { #endif sqlite3_db_name, /* Version 3.40.0 and later */ - sqlite3_value_type + sqlite3_value_encoding }; /* True if x is the directory separator character @@ -145439,7 +145516,7 @@ SQLITE_PRIVATE Trigger *sqlite3TriggerList(Parse *pParse, Table *pTab){ if( pTrig->pTabSchema==pTab->pSchema && pTrig->table && 0==sqlite3StrICmp(pTrig->table, pTab->zName) - && pTrig->pTabSchema!=pTmpSchema + && (pTrig->pTabSchema!=pTmpSchema || pTrig->bReturning) ){ pTrig->pNext = pList; pList = pTrig; @@ -155623,7 +155700,7 @@ SQLITE_PRIVATE int sqlite3WhereIsDistinct(WhereInfo *pWInfo){ ** block sorting is required. */ SQLITE_PRIVATE int sqlite3WhereIsOrdered(WhereInfo *pWInfo){ - return pWInfo->nOBSat; + return pWInfo->nOBSat<0 ? 0 : pWInfo->nOBSat; } /* @@ -174531,7 +174608,7 @@ SQLITE_API int sqlite3_overload_function( rc = sqlite3FindFunction(db, zName, nArg, SQLITE_UTF8, 0)!=0; sqlite3_mutex_leave(db->mutex); if( rc ) return SQLITE_OK; - zCopy = sqlite3_mprintf(zName); + zCopy = sqlite3_mprintf("%s", zName); if( zCopy==0 ) return SQLITE_NOMEM; return sqlite3_create_function_v2(db, zName, nArg, SQLITE_UTF8, zCopy, sqlite3InvalidFunction, 0, 0, sqlite3_free); @@ -176363,6 +176440,9 @@ SQLITE_API int sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, vo sqlite3BtreeSetPageSize(pBtree, 0, iNew, 0); } rc = SQLITE_OK; + }else if( op==SQLITE_FCNTL_RESET_CACHE ){ + sqlite3BtreeClearCache(pBtree); + rc = SQLITE_OK; }else{ int nSave = db->busyHandler.nBusy; rc = sqlite3OsFileControl(fd, op, pArg); @@ -217778,6 +217858,22 @@ static int sessionChangesetNextOne( if( p->op==SQLITE_INSERT ) p->op = SQLITE_DELETE; else if( p->op==SQLITE_DELETE ) p->op = SQLITE_INSERT; } + + /* If this is an UPDATE that is part of a changeset, then check that + ** there are no fields in the old.* record that are not (a) PK fields, + ** or (b) also present in the new.* record. + ** + ** Such records are technically corrupt, but the rebaser was at one + ** point generating them. Under most circumstances this is benign, but + ** can cause spurious SQLITE_RANGE errors when applying the changeset. */ + if( p->bPatchset==0 && p->op==SQLITE_UPDATE){ + for(i=0; inCol; i++){ + if( p->abPK[i]==0 && p->apValue[i+p->nCol]==0 ){ + sqlite3ValueFree(p->apValue[i]); + p->apValue[i] = 0; + } + } + } } return SQLITE_ROW; @@ -219974,7 +220070,7 @@ static void sessionAppendPartialUpdate( if( !pIter->abPK[i] && a1[0] ) bData = 1; memcpy(pOut, a1, n1); pOut += n1; - }else if( a2[0]!=0xFF ){ + }else if( a2[0]!=0xFF && a1[0] ){ bData = 1; memcpy(pOut, a2, n2); pOut += n2; @@ -236004,7 +236100,7 @@ static void fts5CheckTransactionState(Fts5FullTable *p, int op, int iSavepoint){ break; case FTS5_SYNC: - assert( p->ts.eState==1 ); + assert( p->ts.eState==1 || p->ts.eState==2 ); p->ts.eState = 2; break; @@ -236019,21 +236115,21 @@ static void fts5CheckTransactionState(Fts5FullTable *p, int op, int iSavepoint){ break; case FTS5_SAVEPOINT: - assert( p->ts.eState==1 ); + assert( p->ts.eState>=1 ); assert( iSavepoint>=0 ); assert( iSavepoint>=p->ts.iSavepoint ); p->ts.iSavepoint = iSavepoint; break; case FTS5_RELEASE: - assert( p->ts.eState==1 ); + assert( p->ts.eState>=1 ); assert( iSavepoint>=0 ); assert( iSavepoint<=p->ts.iSavepoint ); p->ts.iSavepoint = iSavepoint-1; break; case FTS5_ROLLBACKTO: - assert( p->ts.eState==1 ); + assert( p->ts.eState>=1 ); assert( iSavepoint>=-1 ); /* The following assert() can fail if another vtab strikes an error ** within an xSavepoint() call then SQLite calls xRollbackTo() - without @@ -237369,7 +237465,7 @@ static int fts5UpdateMethod( int rc = SQLITE_OK; /* Return code */ /* A transaction must be open when this is called. */ - assert( pTab->ts.eState==1 ); + assert( pTab->ts.eState==1 || pTab->ts.eState==2 ); assert( pVtab->zErrMsg==0 ); assert( nArg==1 || nArg==(2+pConfig->nCol+2) ); @@ -238537,7 +238633,7 @@ static void fts5SourceIdFunc( ){ assert( nArg==0 ); UNUSED_PARAM2(nArg, apUnused); - sqlite3_result_text(pCtx, "fts5: 2022-11-16 12:10:08 89c459e766ea7e9165d0beeb124708b955a4950d0f4792f457465d71b158d318", -1, SQLITE_TRANSIENT); + sqlite3_result_text(pCtx, "fts5: 2022-12-28 14:03:47 df5c253c0b3dd24916e4ec7cf77d3db5294cc9fd45ae7b9c5e82ad8197f38a24", -1, SQLITE_TRANSIENT); } /* diff --git a/contrib/sqlite3/sqlite3.h b/contrib/sqlite3/sqlite3.h index 2859cc09b4f5..24b916750c25 100644 --- a/contrib/sqlite3/sqlite3.h +++ b/contrib/sqlite3/sqlite3.h @@ -146,9 +146,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.40.0" -#define SQLITE_VERSION_NUMBER 3040000 -#define SQLITE_SOURCE_ID "2022-11-16 12:10:08 89c459e766ea7e9165d0beeb124708b955a4950d0f4792f457465d71b158d318" +#define SQLITE_VERSION "3.40.1" +#define SQLITE_VERSION_NUMBER 3040001 +#define SQLITE_SOURCE_ID "2022-12-28 14:03:47 df5c253c0b3dd24916e4ec7cf77d3db5294cc9fd45ae7b9c5e82ad8197f38a24" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -1192,6 +1192,12 @@ struct sqlite3_io_methods { ** **
  • [[SQLITE_FCNTL_CKSM_FILE]] ** Used by the cksmvfs VFS module only. +** +**
  • [[SQLITE_FCNTL_RESET_CACHE]] +** If there is currently no transaction open on the database, and the +** database is not a temp db, then this file-control purges the contents +** of the in-memory page cache. If there is an open transaction, or if +** the db is a temp-db, it is a no-op, not an error. ** */ #define SQLITE_FCNTL_LOCKSTATE 1 @@ -1234,6 +1240,7 @@ struct sqlite3_io_methods { #define SQLITE_FCNTL_CKPT_START 39 #define SQLITE_FCNTL_EXTERNAL_READER 40 #define SQLITE_FCNTL_CKSM_FILE 41 +#define SQLITE_FCNTL_RESET_CACHE 42 /* deprecated names */ #define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE diff --git a/contrib/sqlite3/sqlite3rc.h b/contrib/sqlite3/sqlite3rc.h index 713a6c653ab5..abe983cb060b 100644 --- a/contrib/sqlite3/sqlite3rc.h +++ b/contrib/sqlite3/sqlite3rc.h @@ -1,3 +1,3 @@ #ifndef SQLITE_RESOURCE_VERSION -#define SQLITE_RESOURCE_VERSION 3,40,0 +#define SQLITE_RESOURCE_VERSION 3,40,1 #endif From nobody Thu Feb 9 21:21:06 2023 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 4PCVCk70YHz3nlLg; Thu, 9 Feb 2023 21:21: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 4PCVCk6V2gz485f; Thu, 9 Feb 2023 21:21:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675977666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1wYcOVjVA/3FHUH0DDf0xgOewvdFWkxmwco6sTYMHB4=; b=IEmPmZMv1glh9xpdEgBesee7WqLXZh5dSjxpZ6T+VNoAL1PMbA0Gao0EJrJ/K71oc7PsYU HngsYO+zD1psnUJNl+gXYw9O2LS77zBQGIkKJqLhqNjt6fYKHIONQVLyaob8GoFi7LhmJ8 J9CexsxIbIY68Zk8Z9e0P+tWQQDDGv1qt3VQHWVgQuCmhUoJ3mILWSMD9C4V3vchAZF80W Kdt9wIeRfdE3f/RRs1w8RoptMFoInwSsWLl/C6F1rkz/fYtBTiIoa9wEJ8ohWqHB84e2J4 PEytHVSD2znd7jSfynaCojzDEzKaxmesb4UY5eWqWUf9DsgnoMeiNRy4AG/E0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675977666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1wYcOVjVA/3FHUH0DDf0xgOewvdFWkxmwco6sTYMHB4=; b=tLXXvVhXaQqYMelG3VZKPAgfikXVZcJO4ePU99IqbPZJDdaCnZ6I5mv0zMnsq/XJBhwRwN BQaUr96cSl/CdDGohPGvPECyHPW+8E020f/w2OJtGP6GmyS7i6m75zI5nQafnoC9T1wXgB fkvu4SbMv9Fn8r66uV0NLyc1M8PlEOevXO2e/o8/dnpLh6WFdA3BTzpauWSQajcMOX0cLv /wJu4sRmiKfX8dmemLvilanQJSzyDvJ647HBL8hudgA2ns9eVzNPOW3DqKIQJ8YkXc0CPD AvlV0Zg+MRiggIKr/cgWxd/+OrgoDllnpp2ekZvcslSG9UWmD2HIDVwI+7OcTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675977666; a=rsa-sha256; cv=none; b=e2Ua0LuMo4cf1yo+x+D1Pd4YhMBB7wkHBWSCo6Hhi8LRJ3mPsDXL7H0SzENIcKQ+Re0FmW 50FdSJd6STzPearne/JOO0v3NxqSZeN3KmteTzI2+7gJhYscnjIp28DrVtj8NBZLAXbqw+ zPe9k51aVWmd/ZgThucnfW4/5amp3Mu5GJSxjiTb4sX/EY+kNSbURFwQxxHnAOlx85bI+M u6NmOcFkxMU0rhAr9Yjk4laaU5oyth+LITfOovwSevX/LHitjDsOkgcEXv1vHk255T+all HBXmqDgQI0jjDmF8hmyD6gFhxzRDRbX779J1lPMCF8sLA2/vozlBeZH+iXGbPQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCVCk4yX7zscT; Thu, 9 Feb 2023 21:21:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319LL6VA056792; Thu, 9 Feb 2023 21:21:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319LL6Cp056791; Thu, 9 Feb 2023 21:21:06 GMT (envelope-from git) Date: Thu, 9 Feb 2023 21:21:06 GMT Message-Id: <202302092121.319LL6Cp056791@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: 272b2e191ead - stable/12 - ipfilter: Correctly type ipf_pullup() 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/12 X-Git-Reftype: branch X-Git-Commit: 272b2e191eadbd267e173e0ed4d9e19e48c97674 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=272b2e191eadbd267e173e0ed4d9e19e48c97674 commit 272b2e191eadbd267e173e0ed4d9e19e48c97674 Author: Cy Schubert AuthorDate: 2023-01-31 19:09:00 +0000 Commit: Cy Schubert CommitDate: 2023-02-09 21:20:50 +0000 ipfilter: Correctly type ipf_pullup() ipf_pullup() outputs a pointer to ip_t. Though returning a pointer to void does work, it is imprecise and not completely correct. (cherry picked from commit c941e8c65d9df878136dc5d51d70256d33f7769f) --- sys/netpfil/ipfilter/netinet/ip_fil.h | 2 +- sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/sys/netpfil/ipfilter/netinet/ip_fil.h b/sys/netpfil/ipfilter/netinet/ip_fil.h index 85a79eda1172..002ddfdc8348 100644 --- a/sys/netpfil/ipfilter/netinet/ip_fil.h +++ b/sys/netpfil/ipfilter/netinet/ip_fil.h @@ -1700,7 +1700,7 @@ extern int ipf_outobj(ipf_main_softc_t *, void *, void *, int); extern int ipf_outobjk(ipf_main_softc_t *, ipfobj_t *, void *); extern int ipf_outobjsz(ipf_main_softc_t *, void *, void *, int, int); -extern void *ipf_pullup(mb_t *, fr_info_t *, int); +extern ip_t *ipf_pullup(mb_t *, fr_info_t *, int); extern int ipf_resolvedest(ipf_main_softc_t *, char *, struct frdest *, int); extern int ipf_resolvefunc(ipf_main_softc_t *, void *); diff --git a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c index fe2b5946fab9..3e4fefa7066e 100644 --- a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c +++ b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c @@ -1183,17 +1183,17 @@ mbufchainlen(struct mbuf *m0) /* We assume that 'xmin' is a pointer to a buffer that is part of the chain */ /* of buffers that starts at *fin->fin_mp. */ /* ------------------------------------------------------------------------ */ -void * +ip_t * ipf_pullup(mb_t *xmin, fr_info_t *fin, int len) { int dpoff, ipoff; mb_t *m = xmin; - char *ip; + ip_t *ip; if (m == NULL) return (NULL); - ip = (char *)fin->fin_ip; + ip = fin->fin_ip; if ((fin->fin_flx & FI_COALESCE) != 0) return (ip); @@ -1238,6 +1238,7 @@ ipf_pullup(mb_t *xmin, fr_info_t *fin, int len) #endif } else { + m = m_pullup(m, len); } if (n != NULL) @@ -1264,9 +1265,9 @@ ipf_pullup(mb_t *xmin, fr_info_t *fin, int len) m = m->m_next; } fin->fin_m = m; - ip = MTOD(m, char *) + ipoff; + ip = MTOD(m, ip_t *) + ipoff; - fin->fin_ip = (ip_t *)ip; + fin->fin_ip = ip; if (fin->fin_dp != NULL) fin->fin_dp = (char *)fin->fin_ip + dpoff; if (fin->fin_fraghdr != NULL) From nobody Thu Feb 9 21:21:07 2023 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 4PCVCm067Nz3nl8n; Thu, 9 Feb 2023 21:21: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 4PCVCl6gYJz488G; Thu, 9 Feb 2023 21:21:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675977667; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8+kOWDT7pSwhL7Fp0aQmw61wrOKiwpprTvmIf6HXsds=; b=Vz4Bzv7Sb9CS71WMRXXQK3C68IGMR5nsVfBFA4TFeB1auEIBkacSGwrGr6xeUaSGJlHqcq EhyWD08CbI+om//hf08hICqCO8uXlwsWKlpGxXDVlOM/ITlyEHba/GB9x4yXWYzNJGd94Y TMcBYdUzw0cctGQHto4vOts1y9w7X71BXxu38GYLf90E9+/7bL7YGXAZQfE3bRD5ZmUK88 /XrTBGfcLaNgrzApWT2WOEbp2RzT6kaElWfzdIMN/U5TRSmDXqaRH/Uf1d+uh4bfMnEhg4 QbFBw8jveGgL5Avll+25HX+CwLVITU8u3Bw9ftNWMrm3GPikqLvhjSYkLkZziQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675977667; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8+kOWDT7pSwhL7Fp0aQmw61wrOKiwpprTvmIf6HXsds=; b=IO2zb70UPTGOTUQ1JzXliqoO0OyiDPoC/IU8wS6GvOJTCD3EvoEx5iDKGUlrvQfk2bCzTO L7xiodtl2BaoiJ/5tWdny557wu1Znwlrb87ckbB5wzn3TDmS81GEK1LJbr182iB1BoAOER yhIKsf03Fzns6ccgRNWfeUoCGoRCbraqhxeZn1iohbWqEZmVNjVasu4KG70yXmCXWHUTH9 8BJC1NOLOsDhkDAGXzlBWSWePXivksiBubmgQMEXmokvNmcsSVCp6L7twRhFM7yX5H4Zrb ejjKbcC4GPaHiMpUB9FGmHu1MiLla0edEYqrVHLsys3pDPiDDxOvP96ie8dX9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675977667; a=rsa-sha256; cv=none; b=ItPv80/jpK4a0PUNPtkYjpofP/rPE0TRzUh0tS6uhL0ALmGoB25+IS58mThNOOW/RJ8Rp6 6WBmN1msaeoEKer8sxqCoX7lNZaI4Or9rk83pVvUdknRIceAaZmyfIrwYakmndzmrM4Suc lqsuAE/0k6+TmiyHqQCO141MmGRo514WWv9IHLKRLj31jUhEBr6IQS4eRyasNDynhRCcb6 SO8+QC/aw2kLHFlLYtJPOkLfJmqKC5C6eM9KAHydFjxpZifFv9rTuo2tPRDpS+23xzrv5D qWEyAWugUptMAtbO2X3ISZF5wlqg2rb8rwXe89UKR3cVC1RWdbzoXLAOrT2Tew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCVCl5LWJzs1N; Thu, 9 Feb 2023 21:21:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319LL7YJ056818; Thu, 9 Feb 2023 21:21:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319LL7LI056817; Thu, 9 Feb 2023 21:21:07 GMT (envelope-from git) Date: Thu, 9 Feb 2023 21:21:07 GMT Message-Id: <202302092121.319LL7LI056817@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: 351f2f68852a - stable/12 - ipfilter: Fix use after free on packet with broken lengths 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/12 X-Git-Reftype: branch X-Git-Commit: 351f2f68852ac3e1d0ef745dc024dd745b07a34f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=351f2f68852ac3e1d0ef745dc024dd745b07a34f commit 351f2f68852ac3e1d0ef745dc024dd745b07a34f Author: Cy Schubert AuthorDate: 2023-02-02 00:49:08 +0000 Commit: Cy Schubert CommitDate: 2023-02-09 21:20:51 +0000 ipfilter: Fix use after free on packet with broken lengths Under the scenario with a packet with length of 67 bytes, a header length using the default of 20 bytes and a TCP data offset (th_off) of 48 will cause m_pullup() to fail to make sure bytes are arragned contiguously. m_pullup() will free the mbuf chain and return a null. ipfilter stores the resultant mbuf address (or the resulting NULL) in its fr_info_t structure. Unfortuntely the eroneous packet is not flagged for drop. This results in a kernel page fault at line 410 of sys/netinet/ip_fastfwd.c as it tries to use a now previously freed, by m_pullup(), mbuf. PR: 266442 Reported by: Robert Morris (cherry picked from commit 79f7745c098a766d34a4e072cdd1a06e6d0829d5) --- sys/netpfil/ipfilter/netinet/fil.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sys/netpfil/ipfilter/netinet/fil.c b/sys/netpfil/ipfilter/netinet/fil.c index 4fa90f64fb33..3cf9111340a3 100644 --- a/sys/netpfil/ipfilter/netinet/fil.c +++ b/sys/netpfil/ipfilter/netinet/fil.c @@ -1113,8 +1113,10 @@ ipf_pr_pullup(fr_info_t *fin, int plen) if (M_LEN(fin->fin_m) < plen + fin->fin_ipoff) { #if defined(_KERNEL) if (ipf_pullup(fin->fin_m, fin, plen) == NULL) { - DT(ipf_pullup_fail); + DT1(ipf_pullup_fail, fr_info_t *, fin); LBUMP(ipf_stats[fin->fin_out].fr_pull[1]); + fin->fin_reason = FRB_PULLUP; + fin->fin_flx |= FI_BAD; return (-1); } LBUMP(ipf_stats[fin->fin_out].fr_pull[0]); @@ -1127,6 +1129,7 @@ ipf_pr_pullup(fr_info_t *fin, int plen) *fin->fin_mp = NULL; fin->fin_m = NULL; fin->fin_ip = NULL; + fin->fin_flx |= FI_BAD; return (-1); #endif } @@ -3180,6 +3183,14 @@ finished: SPL_X(s); + if (fin->fin_m == NULL && fin->fin_flx & FI_BAD && + fin->fin_reason == FRB_PULLUP) { + /* m_pullup() has freed the mbuf */ + LBUMP(ipf_stats[out].fr_blocked[fin->fin_reason]); + return (-1); + } + + #ifdef _KERNEL if (FR_ISPASS(pass)) return (0); From nobody Thu Feb 9 21:35:08 2023 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 4PCVWx4LvHz3nmd0; Thu, 9 Feb 2023 21:35:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PCVWx1b6Kz4FYW; Thu, 9 Feb 2023 21:35:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675978509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PB/Gz0pFgJlsO3OUfBrsKbDX5A8WJfpaMveAWkKkmeo=; b=yDbdp+0yyLJmcG87tZ5y3mM8JC6XB1ekblb6FAkiBLuRzKX7Ssc3IfFhfBdKS7y8pnnO+b ruhZ8/PbJhQcsKy3FeGNvpmC814hh0tXSgyao0LtY9jzCHfNRXxUqWp6yJXOsQOyOeZCz7 jyc1Zay312ZxykfIyOzQGgcfJSXI85eawiqkYBfDJ51+dDZ0UC8dJUudU/lOLY1ovNemcs 9EEaOMURME8NpAzb8y8cxbyaYGiytECOL80KRcWgIq2w5hyy2k1QO7f8mxpqp19q0tRl8w JeQ/EIaVasYxYAJsXYkoDOavlY8+S44xg1lgEHidVYZwZFi6ae5D24XBUeAdrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675978509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PB/Gz0pFgJlsO3OUfBrsKbDX5A8WJfpaMveAWkKkmeo=; b=gmGFlHxgGTC/v8G2pUBS8Op/Y8pb78jHYtZHHwqspCNi2bJqvBB49EKR+a1bZ++kdvgxNV es34pqjxU6a1yiqaf3Lu5djBfVF55O4CJYCh6ceTxwJ8Lce7nXHsiXgpoBlt2UE58Vnlo6 yCrywBMj/xSIsRb28v9LWZ9JLdbpVt4ARQaBH9W9U89yqzcYzWC9eXia3Ra/hjnoX4FWL6 ABVWYIwrIqJ5+R5AudHjUFBpUIyDyske9RbrQaA4+PcSkFMcQx2p2z/V2F9tvi+tNqpBzU hWmOBuPhjiaIeIMBz2yHcnwWqf6RT4umfAa5d6D9hpc14fPqssnZv+GCIWH1bQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675978509; a=rsa-sha256; cv=none; b=slMpyWKnAzxs560Plmp9pfG1xRldlbx65i/7ncCVoRK76o+Ui6yI9OYco1cp0fR82L6bwn uXgob6fLrd2A1ELmpoR3qpi/3QzvnNTZG8qndujMxpLy3s2GIyXdY+yHi9POlktjTOQxaA JDa8u08tgTkXeiJXKTVDijyPvyRIuwOTMIOA2r+6DPSakBs2xIes+PVDiMZOd+xaAlLCbD FlBzTt9qUrvaTv7c4AmZh3StVI2VrihgTjKi3xW4A4mtQ+wPf0BZ6uIAKDyXNlodWKnUKq e9zI3s+NE2tbi6zYjPwljdEuxG8KayDDJxZ5pGUETIcKLdSo1cvdIDSJa3l+qQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCVWx0grkzt0p; Thu, 9 Feb 2023 21:35:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319LZ9Es072260; Thu, 9 Feb 2023 21:35:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319LZ8kw072259; Thu, 9 Feb 2023 21:35:08 GMT (envelope-from git) Date: Thu, 9 Feb 2023 21:35:08 GMT Message-Id: <202302092135.319LZ8kw072259@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Stefan=20E=C3=9Fer?= Subject: git: 9b7787294c58 - stable/13 - contrib/bc: update to version 6.2.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: se X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9b7787294c581d160304d5bc7450cf33421a3e19 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=9b7787294c581d160304d5bc7450cf33421a3e19 commit 9b7787294c581d160304d5bc7450cf33421a3e19 Author: Stefan Eßer AuthorDate: 2023-02-06 21:33:56 +0000 Commit: Stefan Eßer CommitDate: 2023-02-09 21:34:55 +0000 contrib/bc: update to version 6.2.4 This update contains only documentation changes (new main repository URL and changed mail address of the program author) and changes to the build system that do not affect the FreeBSD base system build. MFC after: 3 days (cherry picked from commit 4fca8e0f65a8bbbd1242c1f7d8e33b77c479f5de) --- contrib/bc/LICENSE.md | 6 +-- contrib/bc/NEWS.md | 18 ++++++++ contrib/bc/README.md | 22 ++++++---- contrib/bc/gen/bc_help.txt | 2 +- contrib/bc/gen/dc_help.txt | 2 +- contrib/bc/gen/strgen.sh | 16 ++++++- contrib/bc/include/version.h | 2 +- contrib/bc/manuals/bc/A.1 | 4 +- contrib/bc/manuals/bc/A.1.md | 4 +- contrib/bc/manuals/bc/E.1 | 4 +- contrib/bc/manuals/bc/E.1.md | 4 +- contrib/bc/manuals/bc/EH.1 | 4 +- contrib/bc/manuals/bc/EH.1.md | 4 +- contrib/bc/manuals/bc/EHN.1 | 4 +- contrib/bc/manuals/bc/EHN.1.md | 4 +- contrib/bc/manuals/bc/EN.1 | 4 +- contrib/bc/manuals/bc/EN.1.md | 4 +- contrib/bc/manuals/bc/H.1 | 4 +- contrib/bc/manuals/bc/H.1.md | 4 +- contrib/bc/manuals/bc/HN.1 | 4 +- contrib/bc/manuals/bc/HN.1.md | 4 +- contrib/bc/manuals/bc/N.1 | 4 +- contrib/bc/manuals/bc/N.1.md | 4 +- contrib/bc/manuals/bcl.3 | 4 +- contrib/bc/manuals/bcl.3.md | 4 +- contrib/bc/manuals/build.md | 2 +- contrib/bc/manuals/dc/A.1 | 4 +- contrib/bc/manuals/dc/A.1.md | 4 +- contrib/bc/manuals/dc/E.1 | 4 +- contrib/bc/manuals/dc/E.1.md | 4 +- contrib/bc/manuals/dc/EH.1 | 4 +- contrib/bc/manuals/dc/EH.1.md | 4 +- contrib/bc/manuals/dc/EHN.1 | 4 +- contrib/bc/manuals/dc/EHN.1.md | 4 +- contrib/bc/manuals/dc/EN.1 | 4 +- contrib/bc/manuals/dc/EN.1.md | 4 +- contrib/bc/manuals/dc/H.1 | 4 +- contrib/bc/manuals/dc/H.1.md | 4 +- contrib/bc/manuals/dc/HN.1 | 4 +- contrib/bc/manuals/dc/HN.1.md | 4 +- contrib/bc/manuals/dc/N.1 | 4 +- contrib/bc/manuals/dc/N.1.md | 4 +- contrib/bc/scripts/functions.sh | 82 +++++++++++++++++++++++++++++++++++ contrib/bc/scripts/locale_install.sh | 11 ++++- contrib/bc/src/data.c | 2 +- contrib/bc/tests/all.sh | 27 +++++++++++- contrib/bc/tests/bc/timeconst.sh | 18 +++++++- contrib/bc/tests/dc/scripts/easter.sh | 50 ++++++++++++++++++++- contrib/bc/tests/error.sh | 21 ++++++--- contrib/bc/tests/errors.sh | 17 +++++++- contrib/bc/tests/history.py | 2 +- contrib/bc/tests/history.sh | 18 +++++++- contrib/bc/tests/other.sh | 17 +++++++- contrib/bc/tests/read.sh | 19 ++++++-- contrib/bc/tests/script.sh | 29 +++++++++++-- contrib/bc/tests/scripts.sh | 25 ++++++++++- contrib/bc/tests/stdin.sh | 17 +++++++- contrib/bc/tests/test.sh | 23 +++++++++- usr.bin/gh-bc/Makefile | 4 +- 59 files changed, 471 insertions(+), 117 deletions(-) diff --git a/contrib/bc/LICENSE.md b/contrib/bc/LICENSE.md index 8e6b7e0b9051..b65095edc26c 100644 --- a/contrib/bc/LICENSE.md +++ b/contrib/bc/LICENSE.md @@ -1,6 +1,6 @@ # License -Copyright (c) 2018-2023 Gavin D. Howard +Copyright (c) 2018-2023 Gavin D. Howard Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -31,7 +31,7 @@ copyrights and license: Copyright (c) 2010-2014, Salvatore Sanfilippo
    Copyright (c) 2010-2013, Pieter Noordhuis
    Copyright (c) 2018 rain-1
    -Copyright (c) 2018-2023, Gavin D. Howard +Copyright (c) 2018-2023, Gavin D. Howard Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -60,7 +60,7 @@ The files `src/rand.c` and `include/rand.h` are under the following copyrights and license: Copyright (c) 2014-2017 Melissa O'Neill and PCG Project contributors -Copyright (c) 2018-2023 Gavin D. Howard +Copyright (c) 2018-2023 Gavin D. Howard Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md index 36952fdaf582..4601db456f86 100644 --- a/contrib/bc/NEWS.md +++ b/contrib/bc/NEWS.md @@ -1,5 +1,23 @@ # News +## 6.2.4 + +This is a production release that fixes a test failure that happens when +`tests/bc/scripts/timeconst.bc` doesn't exist. This should only affect +packagers. + +This bug happened because I forgot something I added in the previous release: +better error checking in tests to help packagers. Unfortunately, I was too +zealous with the error checking. + +## 6.2.3 + +This is a production release that moves `bc` to . + +That's all it does: update links. Users do ***NOT*** need to upgrade; there are +redirects that will stay in place indefinitely. This release is only for new +users. + ## 6.2.2 This is a production release that fixes a bug. diff --git a/contrib/bc/README.md b/contrib/bc/README.md index 438cab0d1694..9d395f747185 100644 --- a/contrib/bc/README.md +++ b/contrib/bc/README.md @@ -1,12 +1,12 @@ # `bc` -***WARNING: New user registration for https://git.yzena.com/ is disabled because -of spam. If you need to report a bug with `bc`, email gavin at this site minus -the `git.` part for an account, and I will create one for you. Or you can report -an issue at [GitHub][29].*** +***WARNING: New user registration for is disabled +because of spam. If you need to report a bug with `bc`, email gavin at this site +minus the `git.` part for an account, and I will create one for you. Or you can +report an issue at [GitHub][29].*** -***WARNING: This project has moved to [https://git.yzena.com/][20] for [these -reasons][21], though GitHub will remain a mirror.*** +***WARNING: This project has moved to [https://git.gavinhoward.com/][20] for +[these reasons][21], though GitHub will remain a mirror.*** This is an implementation of the [POSIX `bc` calculator][12] that implements [GNU `bc`][1] extensions, as well as the period (`.`) extension for the BSD @@ -443,6 +443,10 @@ This `bc` uses the commit message guidelines laid out in [this blog post][10]. This `bc` uses [semantic versioning][11]. +## AI-Free + +This repository is 100% AI-Free code. + ## Contents Items labeled with `(maintainer use only)` are not included in release source @@ -481,10 +485,10 @@ Folders: [10]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html [11]: http://semver.org/ [12]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html -[17]: https://git.yzena.com/gavin/vim-bc -[18]: https://git.yzena.com/gavin/bc_libs +[17]: https://git.gavinhoward.com/gavin/vim-bc +[18]: https://git.gavinhoward.com/gavin/bc_libs [19]: ./manuals/benchmarks.md -[20]: https://git.yzena.com/gavin/bc +[20]: https://git.gavinhoward.com/gavin/bc [21]: https://gavinhoward.com/2020/04/i-am-moving-away-from-github/ [22]: https://www.deepl.com/translator [23]: https://cgit.freebsd.org/src/tree/contrib/bc diff --git a/contrib/bc/gen/bc_help.txt b/contrib/bc/gen/bc_help.txt index f78ba9e71dd3..c51ba186db15 100644 --- a/contrib/bc/gen/bc_help.txt +++ b/contrib/bc/gen/bc_help.txt @@ -37,7 +37,7 @@ usage: %s [options] [file...] bc is a command-line, arbitrary-precision calculator with a Turing-complete language. For details, use `man %s` or see the online documentation at -https://git.yzena.com/gavin/bc/src/tag/%s/manuals/bc/%s.1.md. +https://git.gavinhoward.com/gavin/bc/src/tag/%s/manuals/bc/%s.1.md. This bc is compatible with both the GNU bc and the POSIX bc spec. See the GNU bc manual (https://www.gnu.org/software/bc/manual/bc.html) and bc spec diff --git a/contrib/bc/gen/dc_help.txt b/contrib/bc/gen/dc_help.txt index 8b313f8d9e07..7d9e7ec28d25 100644 --- a/contrib/bc/gen/dc_help.txt +++ b/contrib/bc/gen/dc_help.txt @@ -37,7 +37,7 @@ usage: %s [options] [file...] dc is a reverse-polish notation command-line calculator which supports unlimited precision arithmetic. For details, use `man %s` or see the online documentation -at https://git.yzena.com/gavin/bc/src/tag/%s/manuals/bc/%s.1.md. +at https://git.gavinhoward.com/gavin/bc/src/tag/%s/manuals/bc/%s.1.md. This dc is (mostly) compatible with the OpenBSD dc and the GNU dc. See the OpenBSD man page (http://man.openbsd.org/OpenBSD-current/man1/dc.1) and the GNU diff --git a/contrib/bc/gen/strgen.sh b/contrib/bc/gen/strgen.sh index 5ef66fb2d8c8..a65e221ad0b4 100755 --- a/contrib/bc/gen/strgen.sh +++ b/contrib/bc/gen/strgen.sh @@ -36,21 +36,33 @@ script="$0" scriptdir=$(dirname "$script") . "$scriptdir/../scripts/functions.sh" +# Just print the usage and exit with an error. This can receive a message to +# print. +# @param 1 A message to print. +usage() { + if [ $# -eq 1 ]; then + printf '%s\n\n' "$1" + fi + printf 'usage: %s input output exclude name [label [define [remove_tabs]]]\n' "$progname" + exit 1 +} + # See strgen.c comment on main() for what these mean. Note, however, that this # script generates a string literal, not a char array. To understand the # consequences of that, see manuals/development.md#strgenc. if [ $# -lt 3 ]; then - echo "usage: $progname input output exclude name [label [define [remove_tabs]]]" - exit 1 + usage "Not enough arguments" fi input="$1" +check_file_arg "$input" output="$2" exclude="$3" name="$4" label="$5" define="$6" remove_tabs="$7" +check_bool_arg "$remove_tabs" tmpinput=$(mktemp -t "${input##*/}_XXXXXX") diff --git a/contrib/bc/include/version.h b/contrib/bc/include/version.h index e1b72de90eef..6d8ddfea0940 100644 --- a/contrib/bc/include/version.h +++ b/contrib/bc/include/version.h @@ -37,6 +37,6 @@ #define BC_VERSION_H /// The current version. -#define VERSION 6.2.2 +#define VERSION 6.2.4 #endif // BC_VERSION_H diff --git a/contrib/bc/manuals/bc/A.1 b/contrib/bc/manuals/bc/A.1 index 629cc32c4c69..b1996a1f282e 100644 --- a/contrib/bc/manuals/bc/A.1 +++ b/contrib/bc/manuals/bc/A.1 @@ -2977,8 +2977,8 @@ Before version \f[B]6.1.0\f[R], this bc(1) had incorrect behavior for the \f[B]quit\f[R] statement. .PP No other bugs are known. -Report bugs at https://git.yzena.com/gavin/bc . +Report bugs at https://git.gavinhoward.com/gavin/bc . .SH AUTHORS .PP Gavin D. -Howard and contributors. +Howard and contributors. diff --git a/contrib/bc/manuals/bc/A.1.md b/contrib/bc/manuals/bc/A.1.md index 40cfa5fcdad6..e7b4c8212190 100644 --- a/contrib/bc/manuals/bc/A.1.md +++ b/contrib/bc/manuals/bc/A.1.md @@ -2498,8 +2498,8 @@ This bc(1) supports error messages for different locales, and thus, it supports Before version **6.1.0**, this bc(1) had incorrect behavior for the **quit** statement. -No other bugs are known. Report bugs at https://git.yzena.com/gavin/bc . +No other bugs are known. Report bugs at https://git.gavinhoward.com/gavin/bc . # AUTHORS -Gavin D. Howard and contributors. +Gavin D. Howard and contributors. diff --git a/contrib/bc/manuals/bc/E.1 b/contrib/bc/manuals/bc/E.1 index 89f95ef81cfa..fea1cecdc4c5 100644 --- a/contrib/bc/manuals/bc/E.1 +++ b/contrib/bc/manuals/bc/E.1 @@ -1810,8 +1810,8 @@ Before version \f[B]6.1.0\f[R], this bc(1) had incorrect behavior for the \f[B]quit\f[R] statement. .PP No other bugs are known. -Report bugs at https://git.yzena.com/gavin/bc . +Report bugs at https://git.gavinhoward.com/gavin/bc . .SH AUTHORS .PP Gavin D. -Howard and contributors. +Howard and contributors. diff --git a/contrib/bc/manuals/bc/E.1.md b/contrib/bc/manuals/bc/E.1.md index 30451dabd64b..3631267f2dc9 100644 --- a/contrib/bc/manuals/bc/E.1.md +++ b/contrib/bc/manuals/bc/E.1.md @@ -1506,8 +1506,8 @@ This bc(1) supports error messages for different locales, and thus, it supports Before version **6.1.0**, this bc(1) had incorrect behavior for the **quit** statement. -No other bugs are known. Report bugs at https://git.yzena.com/gavin/bc . +No other bugs are known. Report bugs at https://git.gavinhoward.com/gavin/bc . # AUTHORS -Gavin D. Howard and contributors. +Gavin D. Howard and contributors. diff --git a/contrib/bc/manuals/bc/EH.1 b/contrib/bc/manuals/bc/EH.1 index e006a5c41c84..2a36cab7f778 100644 --- a/contrib/bc/manuals/bc/EH.1 +++ b/contrib/bc/manuals/bc/EH.1 @@ -1781,8 +1781,8 @@ Before version \f[B]6.1.0\f[R], this bc(1) had incorrect behavior for the \f[B]quit\f[R] statement. .PP No other bugs are known. -Report bugs at https://git.yzena.com/gavin/bc . +Report bugs at https://git.gavinhoward.com/gavin/bc . .SH AUTHORS .PP Gavin D. -Howard and contributors. +Howard and contributors. diff --git a/contrib/bc/manuals/bc/EH.1.md b/contrib/bc/manuals/bc/EH.1.md index 28f874c36ebe..f2f49ea76944 100644 --- a/contrib/bc/manuals/bc/EH.1.md +++ b/contrib/bc/manuals/bc/EH.1.md @@ -1480,8 +1480,8 @@ This bc(1) supports error messages for different locales, and thus, it supports Before version **6.1.0**, this bc(1) had incorrect behavior for the **quit** statement. -No other bugs are known. Report bugs at https://git.yzena.com/gavin/bc . +No other bugs are known. Report bugs at https://git.gavinhoward.com/gavin/bc . # AUTHORS -Gavin D. Howard and contributors. +Gavin D. Howard and contributors. diff --git a/contrib/bc/manuals/bc/EHN.1 b/contrib/bc/manuals/bc/EHN.1 index e77148710255..75768a03c141 100644 --- a/contrib/bc/manuals/bc/EHN.1 +++ b/contrib/bc/manuals/bc/EHN.1 @@ -1774,8 +1774,8 @@ Before version \f[B]6.1.0\f[R], this bc(1) had incorrect behavior for the \f[B]quit\f[R] statement. .PP No other bugs are known. -Report bugs at https://git.yzena.com/gavin/bc . +Report bugs at https://git.gavinhoward.com/gavin/bc . .SH AUTHORS .PP Gavin D. -Howard and contributors. +Howard and contributors. diff --git a/contrib/bc/manuals/bc/EHN.1.md b/contrib/bc/manuals/bc/EHN.1.md index 09288c577a5c..a38503cc8a24 100644 --- a/contrib/bc/manuals/bc/EHN.1.md +++ b/contrib/bc/manuals/bc/EHN.1.md @@ -1472,8 +1472,8 @@ use a period (**.**) as a radix point, regardless of the value of Before version **6.1.0**, this bc(1) had incorrect behavior for the **quit** statement. -No other bugs are known. Report bugs at https://git.yzena.com/gavin/bc . +No other bugs are known. Report bugs at https://git.gavinhoward.com/gavin/bc . # AUTHORS -Gavin D. Howard and contributors. +Gavin D. Howard and contributors. diff --git a/contrib/bc/manuals/bc/EN.1 b/contrib/bc/manuals/bc/EN.1 index 99ecfd2056e2..9c0158583199 100644 --- a/contrib/bc/manuals/bc/EN.1 +++ b/contrib/bc/manuals/bc/EN.1 @@ -1803,8 +1803,8 @@ Before version \f[B]6.1.0\f[R], this bc(1) had incorrect behavior for the \f[B]quit\f[R] statement. .PP No other bugs are known. -Report bugs at https://git.yzena.com/gavin/bc . +Report bugs at https://git.gavinhoward.com/gavin/bc . .SH AUTHORS .PP Gavin D. -Howard and contributors. +Howard and contributors. diff --git a/contrib/bc/manuals/bc/EN.1.md b/contrib/bc/manuals/bc/EN.1.md index 52bacfa5df63..28b558d8b21d 100644 --- a/contrib/bc/manuals/bc/EN.1.md +++ b/contrib/bc/manuals/bc/EN.1.md @@ -1498,8 +1498,8 @@ use a period (**.**) as a radix point, regardless of the value of Before version **6.1.0**, this bc(1) had incorrect behavior for the **quit** statement. -No other bugs are known. Report bugs at https://git.yzena.com/gavin/bc . +No other bugs are known. Report bugs at https://git.gavinhoward.com/gavin/bc . # AUTHORS -Gavin D. Howard and contributors. +Gavin D. Howard and contributors. diff --git a/contrib/bc/manuals/bc/H.1 b/contrib/bc/manuals/bc/H.1 index 856d2c604dee..cbd93da0df81 100644 --- a/contrib/bc/manuals/bc/H.1 +++ b/contrib/bc/manuals/bc/H.1 @@ -2948,8 +2948,8 @@ Before version \f[B]6.1.0\f[R], this bc(1) had incorrect behavior for the \f[B]quit\f[R] statement. .PP No other bugs are known. -Report bugs at https://git.yzena.com/gavin/bc . +Report bugs at https://git.gavinhoward.com/gavin/bc . .SH AUTHORS .PP Gavin D. -Howard and contributors. +Howard and contributors. diff --git a/contrib/bc/manuals/bc/H.1.md b/contrib/bc/manuals/bc/H.1.md index 4a1278dbec86..ac35def9019f 100644 --- a/contrib/bc/manuals/bc/H.1.md +++ b/contrib/bc/manuals/bc/H.1.md @@ -2472,8 +2472,8 @@ This bc(1) supports error messages for different locales, and thus, it supports Before version **6.1.0**, this bc(1) had incorrect behavior for the **quit** statement. -No other bugs are known. Report bugs at https://git.yzena.com/gavin/bc . +No other bugs are known. Report bugs at https://git.gavinhoward.com/gavin/bc . # AUTHORS -Gavin D. Howard and contributors. +Gavin D. Howard and contributors. diff --git a/contrib/bc/manuals/bc/HN.1 b/contrib/bc/manuals/bc/HN.1 index 5356950aa68c..5893d2a7f9a9 100644 --- a/contrib/bc/manuals/bc/HN.1 +++ b/contrib/bc/manuals/bc/HN.1 @@ -2941,8 +2941,8 @@ Before version \f[B]6.1.0\f[R], this bc(1) had incorrect behavior for the \f[B]quit\f[R] statement. .PP No other bugs are known. -Report bugs at https://git.yzena.com/gavin/bc . +Report bugs at https://git.gavinhoward.com/gavin/bc . .SH AUTHORS .PP Gavin D. -Howard and contributors. +Howard and contributors. diff --git a/contrib/bc/manuals/bc/HN.1.md b/contrib/bc/manuals/bc/HN.1.md index 8dd0674512ac..82a99addd344 100644 --- a/contrib/bc/manuals/bc/HN.1.md +++ b/contrib/bc/manuals/bc/HN.1.md @@ -2464,8 +2464,8 @@ use a period (**.**) as a radix point, regardless of the value of Before version **6.1.0**, this bc(1) had incorrect behavior for the **quit** statement. -No other bugs are known. Report bugs at https://git.yzena.com/gavin/bc . +No other bugs are known. Report bugs at https://git.gavinhoward.com/gavin/bc . # AUTHORS -Gavin D. Howard and contributors. +Gavin D. Howard and contributors. diff --git a/contrib/bc/manuals/bc/N.1 b/contrib/bc/manuals/bc/N.1 index 517e403aa6ca..791f47407001 100644 --- a/contrib/bc/manuals/bc/N.1 +++ b/contrib/bc/manuals/bc/N.1 @@ -2970,8 +2970,8 @@ Before version \f[B]6.1.0\f[R], this bc(1) had incorrect behavior for the \f[B]quit\f[R] statement. .PP No other bugs are known. -Report bugs at https://git.yzena.com/gavin/bc . +Report bugs at https://git.gavinhoward.com/gavin/bc . .SH AUTHORS .PP Gavin D. -Howard and contributors. +Howard and contributors. diff --git a/contrib/bc/manuals/bc/N.1.md b/contrib/bc/manuals/bc/N.1.md index 2c85180f670f..b8339ea31a5e 100644 --- a/contrib/bc/manuals/bc/N.1.md +++ b/contrib/bc/manuals/bc/N.1.md @@ -2490,8 +2490,8 @@ use a period (**.**) as a radix point, regardless of the value of Before version **6.1.0**, this bc(1) had incorrect behavior for the **quit** statement. -No other bugs are known. Report bugs at https://git.yzena.com/gavin/bc . +No other bugs are known. Report bugs at https://git.gavinhoward.com/gavin/bc . # AUTHORS -Gavin D. Howard and contributors. +Gavin D. Howard and contributors. diff --git a/contrib/bc/manuals/bcl.3 b/contrib/bc/manuals/bcl.3 index e066103d02f4..6bebaa8f02cd 100644 --- a/contrib/bc/manuals/bcl.3 +++ b/contrib/bc/manuals/bcl.3 @@ -1446,8 +1446,8 @@ This is also true of bcl(3). .SH BUGS .PP None are known. -Report bugs at https://git.yzena.com/gavin/bc. +Report bugs at https://git.gavinhoward.com/gavin/bc. .SH AUTHORS .PP Gavin D. -Howard and contributors. +Howard and contributors. diff --git a/contrib/bc/manuals/bcl.3.md b/contrib/bc/manuals/bcl.3.md index e2d92866ddbe..6c6967b44770 100644 --- a/contrib/bc/manuals/bcl.3.md +++ b/contrib/bc/manuals/bcl.3.md @@ -1230,8 +1230,8 @@ use a period (**.**) as a radix point, regardless of the value of # BUGS -None are known. Report bugs at https://git.yzena.com/gavin/bc. +None are known. Report bugs at https://git.gavinhoward.com/gavin/bc. # AUTHORS -Gavin D. Howard and contributors. +Gavin D. Howard and contributors. diff --git a/contrib/bc/manuals/build.md b/contrib/bc/manuals/build.md index 5cec45f596b4..d9c46ae22602 100644 --- a/contrib/bc/manuals/build.md +++ b/contrib/bc/manuals/build.md @@ -40,7 +40,7 @@ accepted build options. ## Windows For releases, Windows builds of `bc`, `dc`, and `bcl` are available for download -from and GitHub. +from and GitHub. However, if you wish to build it yourself, this `bc` can be built using Visual Studio or MSBuild. diff --git a/contrib/bc/manuals/dc/A.1 b/contrib/bc/manuals/dc/A.1 index 6500bf9129e2..13ed8c4cf808 100644 --- a/contrib/bc/manuals/dc/A.1 +++ b/contrib/bc/manuals/dc/A.1 @@ -1718,8 +1718,8 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html . .SH BUGS .PP None are known. -Report bugs at https://git.yzena.com/gavin/bc . +Report bugs at https://git.gavinhoward.com/gavin/bc . .SH AUTHOR .PP Gavin D. -Howard and contributors. +Howard and contributors. diff --git a/contrib/bc/manuals/dc/A.1.md b/contrib/bc/manuals/dc/A.1.md index 4c40e38dcee8..b656650cb820 100644 --- a/contrib/bc/manuals/dc/A.1.md +++ b/contrib/bc/manuals/dc/A.1.md @@ -1517,8 +1517,8 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html . # BUGS -None are known. Report bugs at https://git.yzena.com/gavin/bc . +None are known. Report bugs at https://git.gavinhoward.com/gavin/bc . # AUTHOR -Gavin D. Howard and contributors. +Gavin D. Howard and contributors. diff --git a/contrib/bc/manuals/dc/E.1 b/contrib/bc/manuals/dc/E.1 index 7f2477f10772..3fb69dfe70da 100644 --- a/contrib/bc/manuals/dc/E.1 +++ b/contrib/bc/manuals/dc/E.1 @@ -1496,8 +1496,8 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html . .SH BUGS .PP None are known. -Report bugs at https://git.yzena.com/gavin/bc . +Report bugs at https://git.gavinhoward.com/gavin/bc . .SH AUTHOR .PP Gavin D. -Howard and contributors. +Howard and contributors. diff --git a/contrib/bc/manuals/dc/E.1.md b/contrib/bc/manuals/dc/E.1.md index 437fc645937a..0bbe97612889 100644 --- a/contrib/bc/manuals/dc/E.1.md +++ b/contrib/bc/manuals/dc/E.1.md @@ -1341,8 +1341,8 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html . # BUGS -None are known. Report bugs at https://git.yzena.com/gavin/bc . +None are known. Report bugs at https://git.gavinhoward.com/gavin/bc . # AUTHOR -Gavin D. Howard and contributors. +Gavin D. Howard and contributors. diff --git a/contrib/bc/manuals/dc/EH.1 b/contrib/bc/manuals/dc/EH.1 index ba4e67507028..da7776edd538 100644 --- a/contrib/bc/manuals/dc/EH.1 +++ b/contrib/bc/manuals/dc/EH.1 @@ -1470,8 +1470,8 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html . .SH BUGS .PP None are known. -Report bugs at https://git.yzena.com/gavin/bc . +Report bugs at https://git.gavinhoward.com/gavin/bc . .SH AUTHOR .PP Gavin D. -Howard and contributors. +Howard and contributors. diff --git a/contrib/bc/manuals/dc/EH.1.md b/contrib/bc/manuals/dc/EH.1.md index 6d1dd78985b2..0751d3f78d21 100644 --- a/contrib/bc/manuals/dc/EH.1.md +++ b/contrib/bc/manuals/dc/EH.1.md @@ -1318,8 +1318,8 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html . # BUGS -None are known. Report bugs at https://git.yzena.com/gavin/bc . +None are known. Report bugs at https://git.gavinhoward.com/gavin/bc . # AUTHOR -Gavin D. Howard and contributors. +Gavin D. Howard and contributors. diff --git a/contrib/bc/manuals/dc/EHN.1 b/contrib/bc/manuals/dc/EHN.1 index 5f454d01cc2e..10ef283ea056 100644 --- a/contrib/bc/manuals/dc/EHN.1 +++ b/contrib/bc/manuals/dc/EHN.1 @@ -1466,8 +1466,8 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html . .SH BUGS .PP None are known. -Report bugs at https://git.yzena.com/gavin/bc . +Report bugs at https://git.gavinhoward.com/gavin/bc . .SH AUTHOR .PP Gavin D. -Howard and contributors. +Howard and contributors. diff --git a/contrib/bc/manuals/dc/EHN.1.md b/contrib/bc/manuals/dc/EHN.1.md index e3786886a035..9ba7fe13e0ad 100644 --- a/contrib/bc/manuals/dc/EHN.1.md +++ b/contrib/bc/manuals/dc/EHN.1.md @@ -1313,8 +1313,8 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html . # BUGS -None are known. Report bugs at https://git.yzena.com/gavin/bc . +None are known. Report bugs at https://git.gavinhoward.com/gavin/bc . # AUTHOR -Gavin D. Howard and contributors. +Gavin D. Howard and contributors. diff --git a/contrib/bc/manuals/dc/EN.1 b/contrib/bc/manuals/dc/EN.1 index 6f08fc8d3c0c..abdcbe8c63f8 100644 --- a/contrib/bc/manuals/dc/EN.1 +++ b/contrib/bc/manuals/dc/EN.1 @@ -1492,8 +1492,8 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html . .SH BUGS .PP None are known. -Report bugs at https://git.yzena.com/gavin/bc . +Report bugs at https://git.gavinhoward.com/gavin/bc . .SH AUTHOR .PP Gavin D. -Howard and contributors. +Howard and contributors. diff --git a/contrib/bc/manuals/dc/EN.1.md b/contrib/bc/manuals/dc/EN.1.md index b97e121e2226..5c0590c53aee 100644 --- a/contrib/bc/manuals/dc/EN.1.md +++ b/contrib/bc/manuals/dc/EN.1.md @@ -1336,8 +1336,8 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html . # BUGS -None are known. Report bugs at https://git.yzena.com/gavin/bc . +None are known. Report bugs at https://git.gavinhoward.com/gavin/bc . # AUTHOR -Gavin D. Howard and contributors. +Gavin D. Howard and contributors. diff --git a/contrib/bc/manuals/dc/H.1 b/contrib/bc/manuals/dc/H.1 index cc2f156205e6..c96100e51bc5 100644 --- a/contrib/bc/manuals/dc/H.1 +++ b/contrib/bc/manuals/dc/H.1 @@ -1692,8 +1692,8 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html . .SH BUGS .PP None are known. -Report bugs at https://git.yzena.com/gavin/bc . +Report bugs at https://git.gavinhoward.com/gavin/bc . .SH AUTHOR .PP Gavin D. -Howard and contributors. +Howard and contributors. diff --git a/contrib/bc/manuals/dc/H.1.md b/contrib/bc/manuals/dc/H.1.md index b8ad29b28a85..0dddf66d700a 100644 --- a/contrib/bc/manuals/dc/H.1.md +++ b/contrib/bc/manuals/dc/H.1.md @@ -1494,8 +1494,8 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html . # BUGS -None are known. Report bugs at https://git.yzena.com/gavin/bc . +None are known. Report bugs at https://git.gavinhoward.com/gavin/bc . # AUTHOR -Gavin D. Howard and contributors. +Gavin D. Howard and contributors. diff --git a/contrib/bc/manuals/dc/HN.1 b/contrib/bc/manuals/dc/HN.1 index 8d16b10a23de..a6644ecd575b 100644 --- a/contrib/bc/manuals/dc/HN.1 +++ b/contrib/bc/manuals/dc/HN.1 @@ -1688,8 +1688,8 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html . .SH BUGS .PP None are known. -Report bugs at https://git.yzena.com/gavin/bc . +Report bugs at https://git.gavinhoward.com/gavin/bc . .SH AUTHOR .PP Gavin D. -Howard and contributors. +Howard and contributors. diff --git a/contrib/bc/manuals/dc/HN.1.md b/contrib/bc/manuals/dc/HN.1.md index d658409b8362..d39a7497d3ac 100644 --- a/contrib/bc/manuals/dc/HN.1.md +++ b/contrib/bc/manuals/dc/HN.1.md @@ -1489,8 +1489,8 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html . # BUGS -None are known. Report bugs at https://git.yzena.com/gavin/bc . +None are known. Report bugs at https://git.gavinhoward.com/gavin/bc . # AUTHOR -Gavin D. Howard and contributors. +Gavin D. Howard and contributors. diff --git a/contrib/bc/manuals/dc/N.1 b/contrib/bc/manuals/dc/N.1 index 54fbadeed09c..f9aeb1acfb6c 100644 --- a/contrib/bc/manuals/dc/N.1 +++ b/contrib/bc/manuals/dc/N.1 @@ -1714,8 +1714,8 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html . .SH BUGS .PP None are known. -Report bugs at https://git.yzena.com/gavin/bc . +Report bugs at https://git.gavinhoward.com/gavin/bc . .SH AUTHOR .PP Gavin D. -Howard and contributors. +Howard and contributors. diff --git a/contrib/bc/manuals/dc/N.1.md b/contrib/bc/manuals/dc/N.1.md index 35573c49da90..3c36661d3902 100644 --- a/contrib/bc/manuals/dc/N.1.md +++ b/contrib/bc/manuals/dc/N.1.md @@ -1512,8 +1512,8 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html . # BUGS -None are known. Report bugs at https://git.yzena.com/gavin/bc . +None are known. Report bugs at https://git.gavinhoward.com/gavin/bc . # AUTHOR -Gavin D. Howard and contributors. +Gavin D. Howard and contributors. diff --git a/contrib/bc/scripts/functions.sh b/contrib/bc/scripts/functions.sh index 98cb5cf7aae0..8ae765859e51 100755 --- a/contrib/bc/scripts/functions.sh +++ b/contrib/bc/scripts/functions.sh @@ -71,6 +71,88 @@ err_exit() { exit "$2" } +# Function for checking the "d"/"dir" argument of scripts. This function expects +# a usage() function to exist in the caller. +# @param 1 The argument to check. +check_d_arg() { + + if [ "$#" -ne 1 ]; then + printf 'Invalid number of args to check_d_arg\n' + exit 1 + fi + + _check_d_arg_arg="$1" + shift + + if [ "$_check_d_arg_arg" != "bc" ] && [ "$_check_d_arg_arg" != "dc" ]; then + _check_d_arg_msg=$(printf 'Invalid d arg: %s\nMust be either "bc" or "dc".\n\n' \ + "$_check_d_arg_arg") + usage "$_check_d_arg_msg" + fi +} + +# Function for checking the boolean arguments of scripts. This function expects +# a usage() function to exist in the caller. +# @param 1 The argument to check. +check_bool_arg() { + + if [ "$#" -ne 1 ]; then + printf 'Invalid number of args to check_bool_arg\n' + exit 1 + fi + + _check_bool_arg_arg="$1" + shift + + if [ "$_check_bool_arg_arg" != "0" ] && [ "$_check_bool_arg_arg" != "1" ]; then + _check_bool_arg_msg=$(printf 'Invalid bool arg: %s\nMust be either "0" or "1".\n\n' \ + "$_check_bool_arg_arg") + usage "$_check_bool_arg_msg" + fi +} + +# Function for checking the executable arguments of scripts. This function +# expects a usage() function to exist in the caller. +# @param 1 The argument to check. +check_exec_arg() { + + if [ "$#" -ne 1 ]; then + printf 'Invalid number of args to check_exec_arg\n' + exit 1 + fi + + _check_exec_arg_arg="$1" + shift + + if [ ! -x "$_check_exec_arg_arg" ]; then + if ! command -v "$_check_exec_arg_arg" >/dev/null 2>&1; then + _check_exec_arg_msg=$(printf 'Invalid exec arg: %s\nMust be an executable file.\n\n' \ + "$_check_exec_arg_arg") + usage "$_check_exec_arg_msg" + fi + fi +} + +# Function for checking the file arguments of scripts. This function expects a +# usage() function to exist in the caller. +# @param 1 The argument to check. +check_file_arg() { + + if [ "$#" -ne 1 ]; then + printf 'Invalid number of args to check_file_arg\n' + exit 1 + fi + + _check_file_arg_arg="$1" + shift + + if [ ! -f "$_check_file_arg_arg" ]; then + _check_file_arg_msg=$(printf 'Invalid file arg: %s\nMust be a file.\n\n' \ + "$_check_file_arg_arg") + usage "$_check_file_arg_msg" + fi +} + # Check the return code on a test and exit with a fail if it's non-zero. # @param d The calculator under test. # @param err The return code. diff --git a/contrib/bc/scripts/locale_install.sh b/contrib/bc/scripts/locale_install.sh index a2d9ccda7ade..75534a735cdb 100755 --- a/contrib/bc/scripts/locale_install.sh +++ b/contrib/bc/scripts/locale_install.sh @@ -28,6 +28,7 @@ # # Just print the usage and exit with an error. +# @param 1 A message to print. usage() { if [ $# -eq 1 ]; then printf '%s\n' "$1" @@ -189,7 +190,7 @@ while getopts "l" opt; do done -test "$#" -ge 2 || usage +test "$#" -ge 2 || usage "Must have at least two arguments" nlspath="$1" shift @@ -240,11 +241,15 @@ for file in $locales_dir/*.msg; do continue fi + printf 'Installing %s...' "$locale" + # Generate the proper location for the cat file. loc=$(gen_nlspath "$destdir/$nlspath" "$locale" "$main_exec") gencatfile "$loc" "$file" + printf 'done\n' + done # Now that we have done the non-symlinks, it's time to do the symlinks. Think @@ -275,6 +280,8 @@ for file in $locales_dir/*.msg; do # Make sure to skip non-symlinks; they are already done. if [ -L "$file" ]; then + printf 'Linking %s...' "$locale" + # This song and dance is because we want to generate relative symlinks. # They take less space, but also, they are more resilient to being # moved. @@ -294,6 +301,8 @@ for file in $locales_dir/*.msg; do # Finally, symlink to the install of the generated cat file that # corresponds to the correct msg file. ln -fs "$rel" "$loc" + + printf 'done\n' fi done diff --git a/contrib/bc/src/data.c b/contrib/bc/src/data.c index 1694bb684718..284d3de7b642 100644 --- a/contrib/bc/src/data.c +++ b/contrib/bc/src/data.c @@ -71,7 +71,7 @@ const uchar dc_sig_msg_len = (uchar) (sizeof(dc_sig_msg) - 1); /// The copyright banner. const char bc_copyright[] = "Copyright (c) 2018-2023 Gavin D. Howard and contributors\n" - "Report bugs at: https://git.yzena.com/gavin/bc\n\n" + "Report bugs at: https://git.gavinhoward.com/gavin/bc\n\n" "This is free software with ABSOLUTELY NO WARRANTY.\n"; // clang-format on diff --git a/contrib/bc/tests/all.sh b/contrib/bc/tests/all.sh index 0ef8ae6cb49b..099804777c13 100755 --- a/contrib/bc/tests/all.sh +++ b/contrib/bc/tests/all.sh @@ -32,6 +32,18 @@ testdir=$(dirname "$script") . "$testdir/../scripts/functions.sh" +# Just print the usage and exit with an error. This can receive a message to +# print. +# @param 1 A message to print. +usage() { + if [ $# -eq 1 ]; then + printf '%s\n\n' "$1" + fi + print 'usage: %s [-n] dir [run_extra_tests] [run_stack_tests] [gen_tests] [run_problematic_tests] [time_tests] [exec args...]\n' \ + "$script" + exit 1 +} + # We need to figure out if we should run stuff in parallel. pll=1 @@ -48,50 +60,63 @@ done if [ "$#" -ge 1 ]; then d="$1" shift + check_d_arg "$d" else - err_exit "usage: $script [-n] dir [run_extra_tests] [run_stack_tests] [gen_tests] [run_problematic_tests] [time_tests] [exec args...]" 1 + usage "Not enough arguments" fi if [ "$#" -lt 1 ]; then extra=1 + check_bool_arg "$extra" else extra="$1" *** 699 LINES SKIPPED *** From nobody Thu Feb 9 21:36:15 2023 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 4PCVYD0dVwz3nmd7; Thu, 9 Feb 2023 21:36: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 4PCVYD04HTz4FgM; Thu, 9 Feb 2023 21:36:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675978576; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N6mU+9Tw9fA9gFgZppR1WjgJGWbXhdwcebZoPxdrSbs=; b=arKijcg84+cstHVfBNiEJeGUVuInDTdvdwunCDMn1PrI9Fyju2oJviFU6nBA0jInUCvSoA sWIU7Jybk7iTo2/wtpLfAHfLIEMkz5DlZrTTk8PG+4TGMztLKQMP73JLcbfKe0FzfQEOMG DOkB4//ChGsWNdRIu3A8tiBWU1t/EE4AX0M2G8LxxewhyupzeCNmwQCNhbFKcIRvuFg9/V AqjGvocHYWsXScJRbWWIjYMRihk2Qev5y4H6YZyJRkIcs5T7Z07kZYnLcdAMEBWcozzkyw mwpIBUFHXToNNd/3jRU25HP0/LqkznwiaLmXFxqqz84MAhHyIFtMuWWSWpYFHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675978576; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N6mU+9Tw9fA9gFgZppR1WjgJGWbXhdwcebZoPxdrSbs=; b=b1DUZUDIuJ/qepEwtnUjZz/fMPc0KJhH3q5xZoOhrxRxcfzuow9TyDtdcbCMhAfJi+MIPq iPxrjS1agK0/znNI3SoqDxSB6Azg2Qjb/EueabB2nMPWp0KtgQzb6h9PkCpKpWZOagcvPi gPhTt2vatPGEU6lKBKHkPCA3ImETD9is+ZIuVDCqxE2t82SukvITxLvZWxpyOgoTZ6NfLb nfyIrRVQTHa/CDumODi9J2SY7I/h4Kf2fe0NiuN0976+d6xzn9agfIrlqDOKN0a2iynFob ZWxTVAy9iDM0QiFyWuVaJsPNTI06ajim3lcwVRg4EfxTkNbpWIb9+1Lih9lezg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675978576; a=rsa-sha256; cv=none; b=b8NdncdP+fiyX0Gs++Ufj0xBXEP2zdYJ5hDLTzIflWvk2UPuCUQaVXefroFpQCosikq6n7 vNWLue1Nf7KQyKPLJS3yydK1WB2IAdnDZ6Bx0eWvBglZdxhD+SwDiqPQ4v8ft7VzRTyXco Vpf3Qt3l3LGAZczhl7/uhE4GPXLOMg3m93g7DIc5C+AC9/Ju66OmdDp0KUYyTKJrl6Wh73 AVxtnMr/GhYNBy0xLUmsKgdxyj5lms0L3JBdbc7+t9BNisrRdH/g5N200xTV0SfzRFrqv8 VnLfe86R9HdL16X/wPzGdrYIpSJ6OTyYmSSlSoIDlULQMho/+NT4HgwuRPuH0A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCVYC6CR8zsjy; Thu, 9 Feb 2023 21:36:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319LaFu1072525; Thu, 9 Feb 2023 21:36:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319LaFNd072524; Thu, 9 Feb 2023 21:36:15 GMT (envelope-from git) Date: Thu, 9 Feb 2023 21:36:15 GMT Message-Id: <202302092136.319LaFNd072524@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Stefan=20E=C3=9Fer?= Subject: git: b0f694696ceb - stable/13 - Support Unicode characters in keymap dead key tables 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: se X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b0f694696ceb4eea47e8bbf070ff01d682f2742a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=b0f694696ceb4eea47e8bbf070ff01d682f2742a commit b0f694696ceb4eea47e8bbf070ff01d682f2742a Author: Stefan Eßer AuthorDate: 2023-02-06 22:48:47 +0000 Commit: Stefan Eßer CommitDate: 2023-02-09 21:35:59 +0000 Support Unicode characters in keymap dead key tables Support for Unicode characters had been added to the keyboard code, but there are keymaps that have accented characters accessed via dead key combinations, and those were still restricted to 8 bit codes. This update to kbd.c adds support for Unicode characters and compatibility code that allows a kbdcontrol command built from kbio.h without these patches to work on a new kernel. Compatibility code that allows a new kbdcontrol binary running on an old kernel to load and display the dead key map will be committed in a separate commit. Reviewed by: imp, brooks Approved by: brooks MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D38381 (cherry picked from commit 4972fb9276389fb87a790b415b1161cff395884c) --- sys/dev/adb/adb_kbd.c | 1 + sys/dev/atkbdc/atkbd.c | 1 + sys/dev/gpio/gpiokeys.c | 1 + sys/dev/hid/hkbd.c | 1 + sys/dev/hyperv/input/hv_kbd.c | 1 + sys/dev/kbd/kbd.c | 52 +++++++++++++++++++++++++++++++++++++++---- sys/dev/kbdmux/kbdmux.c | 1 + sys/dev/syscons/syscons.c | 2 ++ sys/dev/usb/input/ukbd.c | 1 + sys/dev/vkbd/vkbd.c | 1 + sys/dev/vt/vt_core.c | 2 ++ sys/sys/kbio.h | 26 ++++++++++++++++++---- 12 files changed, 82 insertions(+), 8 deletions(-) diff --git a/sys/dev/adb/adb_kbd.c b/sys/dev/adb/adb_kbd.c index d765e73ed351..69ef6271bfa2 100644 --- a/sys/dev/adb/adb_kbd.c +++ b/sys/dev/adb/adb_kbd.c @@ -800,6 +800,7 @@ static int akbd_ioctl(keyboard_t *kbd, u_long cmd, caddr_t data) case OPIO_KEYMAP: case PIO_KEYMAPENT: case PIO_DEADKEYMAP: + case OPIO_DEADKEYMAP: default: return (genkbd_commonioctl(kbd, cmd, data)); } diff --git a/sys/dev/atkbdc/atkbd.c b/sys/dev/atkbdc/atkbd.c index 2e4c8e8e940f..cfaf7749a64c 100644 --- a/sys/dev/atkbdc/atkbd.c +++ b/sys/dev/atkbdc/atkbd.c @@ -1091,6 +1091,7 @@ atkbd_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) case OPIO_KEYMAP: /* set keyboard translation table (compat) */ case PIO_KEYMAPENT: /* set keyboard translation table entry */ case PIO_DEADKEYMAP: /* set accent key translation table */ + case OPIO_DEADKEYMAP: /* set accent key translation table (compat) */ state->ks_accents = 0; /* FALLTHROUGH */ default: diff --git a/sys/dev/gpio/gpiokeys.c b/sys/dev/gpio/gpiokeys.c index 652a828b63ba..56adb94ba091 100644 --- a/sys/dev/gpio/gpiokeys.c +++ b/sys/dev/gpio/gpiokeys.c @@ -899,6 +899,7 @@ gpiokeys_ioctl_locked(keyboard_t *kbd, u_long cmd, caddr_t arg) case PIO_KEYMAPENT: /* set keyboard translation table * entry */ case PIO_DEADKEYMAP: /* set accent key translation table */ + case OPIO_DEADKEYMAP: /* set accent key translation table (compat) */ sc->sc_accents = 0; /* FALLTHROUGH */ default: diff --git a/sys/dev/hid/hkbd.c b/sys/dev/hid/hkbd.c index 7515c1e426dd..b0d82299e487 100644 --- a/sys/dev/hid/hkbd.c +++ b/sys/dev/hid/hkbd.c @@ -1640,6 +1640,7 @@ hkbd_ioctl_locked(keyboard_t *kbd, u_long cmd, caddr_t arg) case PIO_KEYMAPENT: /* set keyboard translation table * entry */ case PIO_DEADKEYMAP: /* set accent key translation table */ + case OPIO_DEADKEYMAP: /* set accent key translation table (compat) */ sc->sc_accents = 0; /* FALLTHROUGH */ default: diff --git a/sys/dev/hyperv/input/hv_kbd.c b/sys/dev/hyperv/input/hv_kbd.c index 291dfe64a803..c6bf5cbbbf14 100644 --- a/sys/dev/hyperv/input/hv_kbd.c +++ b/sys/dev/hyperv/input/hv_kbd.c @@ -667,6 +667,7 @@ hvkbd_ioctl_locked(keyboard_t *kbd, u_long cmd, caddr_t arg) case OPIO_KEYMAP: /* set keyboard translation table (compat) */ case PIO_KEYMAPENT: /* set keyboard translation table entry */ case PIO_DEADKEYMAP: /* set accent key translation table */ + case OPIO_DEADKEYMAP: /* set accent key translation table (compat) */ sc->sc_accents = 0; /* FALLTHROUGH */ default: diff --git a/sys/dev/kbd/kbd.c b/sys/dev/kbd/kbd.c index deb7672de7fa..41d6fd5666d8 100644 --- a/sys/dev/kbd/kbd.c +++ b/sys/dev/kbd/kbd.c @@ -790,6 +790,8 @@ genkbd_commonioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) { keymap_t *mapp; okeymap_t *omapp; + accentmap_t *accentmapp; + oaccentmap_t *oaccentmapp; keyarg_t *keyp; fkeyarg_t *fkeyp; int i, j; @@ -898,16 +900,58 @@ genkbd_commonioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) #endif case GIO_DEADKEYMAP: /* get accent key translation table */ - bcopy(kbd->kb_accentmap, arg, sizeof(*kbd->kb_accentmap)); + error = copyout(kbd->kb_accentmap, *(void **)arg, + sizeof(accentmap_t)); + return (error); + break; + case OGIO_DEADKEYMAP: /* get accent key translation table (compat) */ + accentmapp = kbd->kb_accentmap; + oaccentmapp = (oaccentmap_t *)arg; + oaccentmapp->n_accs = accentmapp->n_accs; + for (i = 0; i < NUM_DEADKEYS; i++) { + oaccentmapp->acc[i].accchar = + accentmapp->acc[i].accchar; + for (j = 0; j < NUM_ACCENTCHARS; j++) { + oaccentmapp->acc[i].map[j][0] = + accentmapp->acc[i].map[j][0]; + oaccentmapp->acc[i].map[j][1] = + accentmapp->acc[i].map[j][1]; + } + } break; + case PIO_DEADKEYMAP: /* set accent key translation table */ + case OPIO_DEADKEYMAP: /* set accent key translation table (compat) */ #ifndef KBD_DISABLE_KEYMAP_LOAD - error = accent_change_ok(kbd->kb_accentmap, - (accentmap_t *)arg, curthread); + accentmapp = malloc(sizeof(*accentmapp), M_TEMP, M_WAITOK); + if (cmd == OPIO_DEADKEYMAP) { + oaccentmapp = (oaccentmap_t *)arg; + accentmapp->n_accs = oaccentmapp->n_accs; + for (i = 0; i < NUM_DEADKEYS; i++) { + for (j = 0; j < NUM_ACCENTCHARS; j++) { + accentmapp->acc[i].map[j][0] = + oaccentmapp->acc[i].map[j][0]; + accentmapp->acc[i].map[j][1] = + oaccentmapp->acc[i].map[j][1]; + accentmapp->acc[i].accchar = + oaccentmapp->acc[i].accchar; + } + } + } else { + error = copyin(*(void **)arg, accentmapp, sizeof(*accentmapp)); + if (error != 0) { + free(accentmapp, M_TEMP); + return (error); + } + } + + error = accent_change_ok(kbd->kb_accentmap, accentmapp, curthread); if (error != 0) { + free(accentmapp, M_TEMP); return (error); } - bcopy(arg, kbd->kb_accentmap, sizeof(*kbd->kb_accentmap)); + bcopy(accentmapp, kbd->kb_accentmap, sizeof(*kbd->kb_accentmap)); + free(accentmapp, M_TEMP); break; #else return (ENODEV); diff --git a/sys/dev/kbdmux/kbdmux.c b/sys/dev/kbdmux/kbdmux.c index b70e956830e5..1545022bec2a 100644 --- a/sys/dev/kbdmux/kbdmux.c +++ b/sys/dev/kbdmux/kbdmux.c @@ -1243,6 +1243,7 @@ kbdmux_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) case OPIO_KEYMAP: /* set keyboard translation table (compat) */ case PIO_KEYMAPENT: /* set keyboard translation table entry */ case PIO_DEADKEYMAP: /* set accent key translation table */ + case OPIO_DEADKEYMAP: /* set accent key translation table (compat) */ KBDMUX_LOCK(state); state->ks_accents = 0; diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index 6c349668410d..c456be43d8a4 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -1598,6 +1598,8 @@ sctty_ioctl(struct tty *tp, u_long cmd, caddr_t data, struct thread *td) case OPIO_KEYMAP: /* set keyboard translation table (compat) */ case GIO_DEADKEYMAP: /* get accent key translation table */ case PIO_DEADKEYMAP: /* set accent key translation table */ + case OGIO_DEADKEYMAP: /* get accent key translation table (compat) */ + case OPIO_DEADKEYMAP: /* set accent key translation table (compat) */ case GETFKEY: /* get function key string */ case SETFKEY: /* set function key string */ error = kbdd_ioctl(sc->kbd, cmd, data); diff --git a/sys/dev/usb/input/ukbd.c b/sys/dev/usb/input/ukbd.c index 48bac46ab088..ab42f0ea1283 100644 --- a/sys/dev/usb/input/ukbd.c +++ b/sys/dev/usb/input/ukbd.c @@ -1862,6 +1862,7 @@ ukbd_ioctl_locked(keyboard_t *kbd, u_long cmd, caddr_t arg) case PIO_KEYMAPENT: /* set keyboard translation table * entry */ case PIO_DEADKEYMAP: /* set accent key translation table */ + case OPIO_DEADKEYMAP: /* set accent key translation table (compat) */ sc->sc_accents = 0; /* FALLTHROUGH */ default: diff --git a/sys/dev/vkbd/vkbd.c b/sys/dev/vkbd/vkbd.c index fdd244ec2525..27cf4549f3db 100644 --- a/sys/dev/vkbd/vkbd.c +++ b/sys/dev/vkbd/vkbd.c @@ -1207,6 +1207,7 @@ vkbd_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) case OPIO_KEYMAP: /* set keyboard translation table (compat) */ case PIO_KEYMAPENT: /* set keyboard translation table entry */ case PIO_DEADKEYMAP: /* set accent key translation table */ + case OPIO_DEADKEYMAP: /* set accent key translation table (compat) */ state->ks_accents = 0; /* FALLTHROUGH */ diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index c5347db94c86..e148fa4f8d7d 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -2403,7 +2403,9 @@ skip_thunk: case GIO_KEYMAP: case PIO_KEYMAP: case GIO_DEADKEYMAP: + case OGIO_DEADKEYMAP: case PIO_DEADKEYMAP: + case OPIO_DEADKEYMAP: case GETFKEY: case SETFKEY: case KDGKBINFO: diff --git a/sys/sys/kbio.h b/sys/sys/kbio.h index 7f17bda76c51..daef8e474816 100644 --- a/sys/sys/kbio.h +++ b/sys/sys/kbio.h @@ -199,8 +199,8 @@ typedef struct okeymap okeymap_t; #define ACC(x) ((x)+F_ACC) struct acc_t { - u_char accchar; - u_char map[NUM_ACCENTCHARS][2]; + u_int accchar; + u_int map[NUM_ACCENTCHARS][2]; }; struct accentmap { @@ -209,6 +209,19 @@ struct accentmap { }; typedef struct accentmap accentmap_t; +#ifdef _KERNEL +struct oacc_t { + u_char accchar; + u_char map[NUM_ACCENTCHARS][2]; +}; + +struct oaccentmap { + u_short n_accs; + struct oacc_t acc[NUM_DEADKEYS]; +}; +typedef struct oaccentmap oaccentmap_t; +#endif /* _KERNEL */ + struct keyarg { u_short keynum; struct keyent_t key; @@ -241,8 +254,13 @@ typedef struct fkeyarg fkeyarg_t; #define OGIO_KEYMAP _IOR('k', 6, okeymap_t) #define OPIO_KEYMAP _IOW('k', 7, okeymap_t) #endif /* _KERNEL */ -#define GIO_DEADKEYMAP _IOR('k', 8, accentmap_t) -#define PIO_DEADKEYMAP _IOW('k', 9, accentmap_t) +/* XXX: Should have accentmap_t as an argument, but that's too big for ioctl()! */ +#define GIO_DEADKEYMAP _IO('k', 8) +#define PIO_DEADKEYMAP _IO('k', 9) +#ifdef _KERNEL +#define OGIO_DEADKEYMAP _IOR('k', 8, oaccentmap_t) +#define OPIO_DEADKEYMAP _IOW('k', 9, oaccentmap_t) +#endif /* _KERNEL */ #define GIO_KEYMAPENT _IOWR('k', 10, keyarg_t) #define PIO_KEYMAPENT _IOW('k', 11, keyarg_t) From nobody Thu Feb 9 21:36:16 2023 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 4PCVYF22w4z3nmwT; Thu, 9 Feb 2023 21:36:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PCVYF1GSCz4Fjs; Thu, 9 Feb 2023 21:36:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675978577; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CX2HkGdY36L/z5Rz3+VRVMXMqQUMCRluVEuG8xEczYg=; b=IqUD7MSY6g5AfS8OxjJ3/v2fS8fxoOQJ8hqk0kMTbkJvZc8E5asxtyNxIqYwPdpaIcKTh0 xuPPDc4Eo8PvmmACyIRjfEwxHelq2xGhOVMt9u7j72T3e+CZ89Rho1YiNx/DNU3OqkPgFo jGJUftLW+oyzEuK7PP7fbj3yskF8H4RYfm+fIRbTdBCqha5i01WlrVuLLwCrn4fIY00aNK SW8DQKx9jG3rx6qPKQlKF2jTHzFeionY6SdAudBxi4jq9yAtcHRo93Gvbl1cWmcPNtOfhs 7G1RwytzfHHzrWSWCCgjywoGyHF1FhZeBCSveqVIVqXQdvKKfw+6SwHqe/LHZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675978577; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CX2HkGdY36L/z5Rz3+VRVMXMqQUMCRluVEuG8xEczYg=; b=LymiuY2upAwR/Z9lyQZjqW0VqZdJeEbOzHxuUDPWO9wGIsWL6vXWvSda9I4LHwKxcPc44Z dW+O4ijV6r/piaqpXtZCAcuBQK/eFUyFD1800aCn5VagvS99p0ezo64keLJOqx+Oxh6Da7 phsh9HYjjk0Ep6ZXGqW93GCx1FJO/r7/YBh1DSSFFTqcmIUdJlPrkrgQVtO3frsSXSLzG0 YeyiRUobGUDWlxsIrUMYsz99Brd2k3a+xDCkXfmQMNOPzUl1HMs4neoWX0R9370muqK48B /M9pZB4yW+tJb/iY2Tk5ApXkKjtiaqz5zFfAsQV1b/uJPVAvEVllaUrierlSeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675978577; a=rsa-sha256; cv=none; b=UpQb/Sdb6RERXKF0c9/zai9NKWEQWePjCYmwR/pYCU5hfmLzGG3+2p4C3ndsVXNGVUNCfN OAtnAQ8lTPP7vp/HdVbM27L0p10P4n9W1Z2t3kr9GNDa1OCCKkDu6uK/3a0eXhboGsWPu0 dy/swiY1pxqnLOLeMU3Hq358bWDDw8cO2K4AJSlkqg1t1jEmtLtkLTohw/xkRG14RTmimW LUcbcfi0oIZGBG4Vz6lsvFMLmAM23aE6TEL47f84Fhiuw6U9I1Tq1j/tvJxp4Z1PZ4YbYF gZXktnqxz+TUZRi7xQtcfWhjxveXYSvNk5I/aZ9x4iX91fIXCgETcj9cgOpY5Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCVYF00pszsk0; Thu, 9 Feb 2023 21:36:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319LaGtd072554; Thu, 9 Feb 2023 21:36:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319LaGqL072553; Thu, 9 Feb 2023 21:36:16 GMT (envelope-from git) Date: Thu, 9 Feb 2023 21:36:16 GMT Message-Id: <202302092136.319LaGqL072553@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Stefan=20E=C3=9Fer?= Subject: git: 6693d527a438 - stable/13 - usr.sbin/kbdcontrol.c: Add backwards compatibility functions 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: se X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6693d527a43863ea67384b4616257a20794e8254 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=6693d527a43863ea67384b4616257a20794e8254 commit 6693d527a43863ea67384b4616257a20794e8254 Author: Stefan Eßer AuthorDate: 2023-02-06 22:56:44 +0000 Commit: Stefan Eßer CommitDate: 2023-02-09 21:36:09 +0000 usr.sbin/kbdcontrol.c: Add backwards compatibility functions This commit allows a kbdcontrol binary built with a version of kbio.h that supports Unicode characters in dead key maps to load and display keymaps including the dead key tables on a kernel built with a previous version of kbio.h (that only supported 8 bit characters in the dead key map). This commit is meant as a temporary compatibility shim that will be reverted when it can be assumed that all relevant systems have been upgraded to a kernel that uses the updated kbio.h. MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D38388 (cherry picked from commit b92f8e5c0dccd52ea194cabe835b7af0b5e91f09) --- sys/sys/kbio.h | 8 +++---- usr.sbin/kbdcontrol/kbdcontrol.c | 49 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 48 insertions(+), 9 deletions(-) diff --git a/sys/sys/kbio.h b/sys/sys/kbio.h index daef8e474816..a129556d1ada 100644 --- a/sys/sys/kbio.h +++ b/sys/sys/kbio.h @@ -209,7 +209,7 @@ struct accentmap { }; typedef struct accentmap accentmap_t; -#ifdef _KERNEL +//#ifdef _KERNEL struct oacc_t { u_char accchar; u_char map[NUM_ACCENTCHARS][2]; @@ -220,7 +220,7 @@ struct oaccentmap { struct oacc_t acc[NUM_DEADKEYS]; }; typedef struct oaccentmap oaccentmap_t; -#endif /* _KERNEL */ +//#endif /* _KERNEL */ struct keyarg { u_short keynum; @@ -257,10 +257,10 @@ typedef struct fkeyarg fkeyarg_t; /* XXX: Should have accentmap_t as an argument, but that's too big for ioctl()! */ #define GIO_DEADKEYMAP _IO('k', 8) #define PIO_DEADKEYMAP _IO('k', 9) -#ifdef _KERNEL +//#ifdef _KERNEL #define OGIO_DEADKEYMAP _IOR('k', 8, oaccentmap_t) #define OPIO_DEADKEYMAP _IOW('k', 9, oaccentmap_t) -#endif /* _KERNEL */ +//#endif /* _KERNEL */ #define GIO_KEYMAPENT _IOWR('k', 10, keyarg_t) #define PIO_KEYMAPENT _IOW('k', 11, keyarg_t) diff --git a/usr.sbin/kbdcontrol/kbdcontrol.c b/usr.sbin/kbdcontrol/kbdcontrol.c index f4651acea840..725d62a7bfe6 100644 --- a/usr.sbin/kbdcontrol/kbdcontrol.c +++ b/usr.sbin/kbdcontrol/kbdcontrol.c @@ -818,11 +818,27 @@ add_keymap_path(const char *path) STAILQ_INSERT_TAIL(&pathlist, pe, next); } +static void +to_old_accentmap(accentmap_t *from, oaccentmap_t *to) +{ + int i, j; + + to->n_accs = from->n_accs; + for (i = 0; i < NUM_DEADKEYS; i++) { + for (j = 0; j < NUM_ACCENTCHARS; j++) { + to->acc[i].map[j][0] = from->acc[i].map[j][0]; + to->acc[i].map[j][1] = from->acc[i].map[j][1]; + to->acc[i].accchar = from->acc[i].accchar; + } + } +} + static void load_keymap(char *opt, int dumponly) { keymap_t keymap; accentmap_t accentmap; + oaccentmap_t oaccentmap; struct pathent *pe; FILE *file; int j; @@ -882,9 +898,27 @@ load_keymap(char *opt, int dumponly) } if ((accentmap.n_accs > 0) && (ioctl(0, PIO_DEADKEYMAP, &accentmap) < 0)) { - warn("setting accentmap"); - fclose(file); - return; + to_old_accentmap(&accentmap, &oaccentmap); + if (ioctl(0, OPIO_DEADKEYMAP, &oaccentmap) < 0) { + warn("setting accentmap"); + fclose(file); + return; + } + } +} + +static void +to_new_accentmap(oaccentmap_t *from, accentmap_t *to) +{ + int i, j; + + to->n_accs = from->n_accs; + for (i = 0; i < NUM_DEADKEYS; i++) { + for (j = 0; j < NUM_ACCENTCHARS; j++) { + to->acc[i].map[j][0] = from->acc[i].map[j][0]; + to->acc[i].map[j][1] = from->acc[i].map[j][1]; + to->acc[i].accchar = from->acc[i].accchar; + } } } @@ -893,12 +927,17 @@ print_keymap(void) { keymap_t keymap; accentmap_t accentmap; + oaccentmap_t oaccentmap; int i; if (ioctl(0, GIO_KEYMAP, &keymap) < 0) err(1, "getting keymap"); - if (ioctl(0, GIO_DEADKEYMAP, &accentmap) < 0) - memset(&accentmap, 0, sizeof(accentmap)); + if (ioctl(0, GIO_DEADKEYMAP, &accentmap) < 0) { + if (ioctl(0, OGIO_DEADKEYMAP, &oaccentmap) == 0) + to_new_accentmap(&oaccentmap, &accentmap); + else + memset(&accentmap, 0, sizeof(accentmap)); + } printf( "# alt\n" "# scan cntrl alt alt cntrl lock\n" From nobody Fri Feb 10 00:23:36 2023 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 4PCZGJ3pGZz3pgHV; Fri, 10 Feb 2023 00: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 4PCZGJ1Q30z3QXS; Fri, 10 Feb 2023 00: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=1675988616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r5OXI3HxwWmMIhao6kFRcpU4SNHrO9hQZbqhYGpbzT0=; b=Xr9H1zKdor9FFj4YIWh+Yk5oEwJKQ7RJUyCsjf5bU694N7tH8URoiSMUkU+SNNRe3qkdoa nVsN1Q9geYy9PMtOcatsm5iBALvlvcXJHFxYvWP34iAX6dyxfntvySXm8Rl786u6XFQf6S lRqMm9C0+g9XMusTN057VjRFdFRLxjr0OyJ6VePppA0NPLx7K+AxcO2LacMkv0rzqwlYKH p7PxKxeA32B3ZdBN/5uaDKxH7/TD1KKO0K33UtS3aieeVqz8TIO5fdG5y4hHzE8z8D61Tb Ikm0RU00cpubpsuFY9UizbDntdSnxA/uaA517GnUuZ+chret6jv9ERdrn1Glcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675988616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r5OXI3HxwWmMIhao6kFRcpU4SNHrO9hQZbqhYGpbzT0=; b=C/EX8hkjc0wwRTRaPnWhHn6SQDF4//Rv/eyN5o7/ZNf9HZdmUvoNyYz+KqAf37ycQ2b3re 9dyMtFambE1bjY4MDAm6q16eW0ibcf8aLe4lHGVl9QMkLPAgr0sWPPEiT0kpJjXu1SfuWb +tQ8e9qMXIZA/GHqbmOYP9/+sjulHq6dAiFCs1Sw47gVQO09y6ic2obRxWrDfbEEGkH5XU A2s28p83wKrubnWJtR8Pjm7TplKLelo/6oaRi735qO362aXhg/u0kEGU+RumadndS1zDCR 9Gchfl3+1nyrmfaX41QqklBUr7jUh4MigubVECiNGPSVVusvHvT5V8bRrCOcwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675988616; a=rsa-sha256; cv=none; b=c6vEvZeXiKlN9lKGLokIp79Zz8F3yygTleuxjuiYUAJcn6gFrnq1sWod4GYsVMkIERR+op PjTktpwHetxyGura4SFZR/RvzneBblV92qwH5l8L9B76M7vRXJ7rlDhXodhLmhNTmGWLkW PsCvf1aom/z6hibMqiGRK4qIuVYm0UU5jOlPQ2rQSiq1MdcGQ0tAE6hKPOIywX6udW6Cqs fuI8tcf00S3jlN652mwmanvTc6ztHijTk1Bf6NVfnZYfmb2E/BuMZ1X7y9NJJ+6v9S/jny 77W8bTop1sY/sBWTBDQMmOr6NWbJt5shdCTMJZIg28wb40iRzw1ldRbaHJnWdw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCZGJ0W6BzxQf; Fri, 10 Feb 2023 00:23:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31A0NaoV016654; Fri, 10 Feb 2023 00:23:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31A0Nahd016653; Fri, 10 Feb 2023 00:23:36 GMT (envelope-from git) Date: Fri, 10 Feb 2023 00:23:36 GMT Message-Id: <202302100023.31A0Nahd016653@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: 316cf82382e0 - stable/12 - sha512_224: Fix SHA512_224_Final() on little-endian machines. 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/12 X-Git-Reftype: branch X-Git-Commit: 316cf82382e06b7abf8724e9b7804bf6dc2aa576 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=316cf82382e06b7abf8724e9b7804bf6dc2aa576 commit 316cf82382e06b7abf8724e9b7804bf6dc2aa576 Author: Sebastian Huber AuthorDate: 2023-02-06 16:57:28 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-02-10 00:20:11 +0000 sha512_224: Fix SHA512_224_Final() on little-endian machines. PR: 266863 MFC after: 1 week Reviewed by: allanjude, cperciva, des Differential Revision: https://reviews.freebsd.org/D38372 (cherry picked from commit 6680cfe8e0eec4427716ab50d73ab8231dd9ab28) --- sys/crypto/sha2/sha512c.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/crypto/sha2/sha512c.c b/sys/crypto/sha2/sha512c.c index e0dd36120a90..d1c8ec488fe5 100644 --- a/sys/crypto/sha2/sha512c.c +++ b/sys/crypto/sha2/sha512c.c @@ -54,23 +54,26 @@ __FBSDID("$FreeBSD$"); #else /* BYTE_ORDER != BIG_ENDIAN */ /* - * Encode a length len/4 vector of (uint64_t) into a length len vector of - * (unsigned char) in big-endian form. Assumes len is a multiple of 8. + * Encode a length (len + 7) / 8 vector of (uint64_t) into a length len + * vector of (unsigned char) in big-endian form. Assumes len is a + * multiple of 4. */ -static void +static inline void be64enc_vect(unsigned char *dst, const uint64_t *src, size_t len) { size_t i; for (i = 0; i < len / 8; i++) be64enc(dst + i * 8, src[i]); + if (len % 8 == 4) + be32enc(dst + i * 8, src[i] >> 32); } /* * Decode a big-endian length len vector of (unsigned char) into a length - * len/4 vector of (uint64_t). Assumes len is a multiple of 8. + * len/8 vector of (uint64_t). Assumes len is a multiple of 8. */ -static void +static inline void be64dec_vect(uint64_t *dst, const unsigned char *src, size_t len) { size_t i; From nobody Fri Feb 10 00:39:21 2023 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 4PCZcV1tkMz3pj37; Fri, 10 Feb 2023 00:39: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 4PCZcV1JHrz3hGP; Fri, 10 Feb 2023 00:39:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675989562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=18JjwqyoH3QwuN88jE4wj9Eo7FDFAWd6TcjBdTbliso=; b=mUR2cKQ3hF5CPF2LhQYG+Od+LW8/bMh8z4DrJGS2ykkLoj4UI939OSqwYzKinFLg+wsQpw cXaNKJR4khFEIKy+Wo7IA0Q8ex9Fen5G73lVkLJ6o+c3Dmxw6/ZlCqV363SbAOQY5L74tu PQT/266LOcLpIN/gwenCcooetqJnHJbTBBKL633U14E3E9hu7mhO2E8VMfibr4Y69S7g77 JL/EZuN0fxylSMQHtRYWXx9ilwhsu+pCKkRhGRRkIiOFETYVt/EEOWxiBTLxXlVKJTnDDL aJiZInTURAg/EDXG29mTrRCgOpYZvngyv8rHWCarD1fOMSA6PL5GbkQXRAtNxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675989562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=18JjwqyoH3QwuN88jE4wj9Eo7FDFAWd6TcjBdTbliso=; b=s8FN9bC3v4VizLEDnEwUojH0zj30e2QuccJeyv/DEi9yNGt9+epmAqaWbVJuNYv2C9pCMe wTrfvL5TEbxxkgiIl3ww5nutunR4Y/VGRr4XtIphop9gGNgmWRw6aTAvulJcnrX05FKK9i RyuDdBnqzsAOORZwq/6ce7QOXWlbx+vH2Cyjd7ekVjGZRxTExw1n+6rTyO3wOmfnPg51uJ SbqjXp9UihT8ckzjWytRUYFIfkqM6WiRH5bhbMHqSHafBnbpVqHSiEoEi9XtOOxiRCS6vZ b8ZN59aV+HYRizd60BiDG07HLTMTPPgMt2iuaFrpSIu1oEu3HVNGGrMaQR469w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675989562; a=rsa-sha256; cv=none; b=VD3IdBCwPwAyOgSkfmxczPNOKmvdh9Dm3/lbq3ZBdPF8jghUdBmB5O1vIxtdCsZKVet2F0 Z8sLL0WpYsvFCC0lTRVPYp8pS0gRdRHswegaoHXHXVW+XG+cvqk2/Bt6anOoFCi6jdRUTa 9OkkwLnMYgcPca8VaTnc0WqVFUnfOqUfGloJ4tI4oOdRhi0dzP5BOd5oPxAz0bW2D8G1nc 49dQrX24mKoz6pooTz5m2LWkNQK/EKEppnR3k35prRB25AcGTD4pPwCS5pCcKBncIGpSlj q64OOUMhGe0ffC9OQOksdcPKzRFUdLrLg9kEuRQTPtPcfsmuRsxZ/cgZwkF/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 4PCZcV0KYxzy5Q; Fri, 10 Feb 2023 00:39:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31A0dLLK031587; Fri, 10 Feb 2023 00:39:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31A0dLFR031586; Fri, 10 Feb 2023 00:39:21 GMT (envelope-from git) Date: Fri, 10 Feb 2023 00:39:21 GMT Message-Id: <202302100039.31A0dLFR031586@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: da0a75e1cf07 - releng/13.2 - 13.2: create releng/13.2 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.2 X-Git-Reftype: branch X-Git-Commit: da0a75e1cf0716ee6e05b648f2a1726c67ed0363 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been created by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=da0a75e1cf0716ee6e05b648f2a1726c67ed0363 commit da0a75e1cf0716ee6e05b648f2a1726c67ed0363 Author: Colin Percival AuthorDate: 2023-02-10 00:35:56 +0000 Commit: Colin Percival CommitDate: 2023-02-10 00:37:06 +0000 13.2: create releng/13.2 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 95413592b719..34997f2c7067 100644 --- a/release/pkg_repos/release-dvd.conf +++ b/release/pkg_repos/release-dvd.conf @@ -1,6 +1,6 @@ # $FreeBSD$ 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 14315302ed2d..537f205230d8 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -54,7 +54,7 @@ TYPE="FreeBSD" REVISION="13.2" -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 4d1f940af760..35ed7dab7b5f 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1301511 /* Master, propagated to newvers */ +#define __FreeBSD_version 1302000 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Fri Feb 10 00:39:31 2023 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 4PCZcg63nBz3pj5q; Fri, 10 Feb 2023 00:39:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PCZcg5YWJz3hYN; Fri, 10 Feb 2023 00:39:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675989571; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4R+J3wBR7auf+4KamwulJT/9bEDFhs6ZKFVvP6zTX2A=; b=JCBZ1sMf8ooavXuCEK4I7bu4vuMbMz3vfLlxrgBpQeKaVoLlsgIAYm75uyBzzupc8bruKC O1OvojkRXxbQ4QGvlbUBxVPNjxnPDfjN6Bp1QffdlkBSa1tsBo40v1F/AdEStLhY2d2FDI uA635gM2Woq2mu70O2v1SLdG2w30El10crikWdB7vMEbs3b/trkHT2Pyfqasx3KeEjhiTF hDw4B5uZHcjNyY/JfQfAY8f95VR/WcvZPvtz6bUZ3EyTWqVfcf6U69G2f5CVd5a6JXfAEM iWcnstHwlCk50gNuzNBi9lGgomC7dO6o5SlOtvkdSzuoMgT09k3Fd2Hl6u24rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675989571; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4R+J3wBR7auf+4KamwulJT/9bEDFhs6ZKFVvP6zTX2A=; b=FoOlc+evlTbh2dj7bRBb94RroqwDgT8N0McGCilyHyptcXKDZnUM46IS/mmnWZQy0JiJJA c9ZKOrTSrDyjgz/cZsOYuC2TI0OYnWibUZX80+8Tv5N7+G3un6OW5JwPQINccjuNQcBwaw RmFVaQufBIaIT8Mzrm4QdYPTTJO7OnQURFvweNm5Ygzm+xvJfZT54DTLUaOgrPTY35RGp6 7WbBAOf6azWIgEN9fmYTizWaDJYhMAE8mxQU5V/MQHvklCOLtOmc7VYnckmKpTSNQ+Ci0+ q04M/pLUC2Mh3IeU+skXlwlNqvireVoW/XZcMcZuCdxxGq86BDUbIxLSljSZHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675989571; a=rsa-sha256; cv=none; b=he76fOH8Jp5DfdNChKyDQqKhu7B8aZNnIUto43hKts1IzdRnjFhniAB+lbLnFDggC3V639 PCVENOYUqpXgP4surTApf+mYE54TkQF72HNStv6qW5LBvPQnzph05pFAQElJqcCk/JKa4e 201tByiXq/nsicsYa18GdCBn8Csa+leqIVbR0IZJiy61pMzv+Az+vVluDCUh4FKX9cyE/E D36UN6poGeC/JwgnVbxqmASN49dpTzY/2mjyCdN0SAtpu4XF7U32iXHZbxJjoN2Nqn+2gN 7HM8uZ26XSKHAmsn+PE74rY3WaNgVg7+3oH7rmTK5NJsiV1GQKLlvlUqijC85w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCZcg4c3rzy5R; Fri, 10 Feb 2023 00:39:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31A0dVKA031713; Fri, 10 Feb 2023 00:39:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31A0dVPL031712; Fri, 10 Feb 2023 00:39:31 GMT (envelope-from git) Date: Fri, 10 Feb 2023 00:39:31 GMT Message-Id: <202302100039.31A0dVPL031712@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: c243de11cf7c - stable/13 - Post-13.2-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: c243de11cf7c4bb3d67bbc1655b149037e5b04f1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=c243de11cf7c4bb3d67bbc1655b149037e5b04f1 commit c243de11cf7c4bb3d67bbc1655b149037e5b04f1 Author: Colin Percival AuthorDate: 2023-02-10 00:38:08 +0000 Commit: Colin Percival CommitDate: 2023-02-10 00:38:08 +0000 Post-13.2-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 14315302ed2d..78246789ae55 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -54,7 +54,7 @@ TYPE="FreeBSD" REVISION="13.2" -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 4d1f940af760..2fa6e9df4fca 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1301511 /* Master, propagated to newvers */ +#define __FreeBSD_version 1302500 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Fri Feb 10 07:38:34 2023 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 4PClwB2lcGz3nsfP; Fri, 10 Feb 2023 07:38:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PClwB2Djnz3G4G; Fri, 10 Feb 2023 07:38:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676014714; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YjtBbGv6aQFkT34nS8uUppOuxisHkDG1arPaGr5iQ2A=; b=JhqfvaFF0mzVo5X+xrM/BncIg8tLELaVugTHc6OUInIcf0ty2AhjN5XV27y+HiPh2QLkcS 7uy6XsdeCWT3UwyALq/fYGzsrrnXXl69VTPy15e37ZxwZHc0tt5I958eVO5AVcXBZZAGnD HXQp9bp8pa1JvVI6Ks/RGbJ+uBajgxaWelS8TMu/0j0QDlIbZ2nQSFkN4LYp2Xr0ydO/GW rm7hgbNV/HhcBtef7GbuuGtggd0DNqEVwVjIkbsjSS/0QqsQJoiHNid4hpCsC2sOzxRwzS Dh3uEfCqwwwsdSXzM0B0WK+H3M4Zc9fw5dkDxkPMNXa8G1DBtEEze9ndhnxeVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676014714; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YjtBbGv6aQFkT34nS8uUppOuxisHkDG1arPaGr5iQ2A=; b=XMn4HOBXJpGAIw0KdSIY/a0tOeQirrJSPxl/S4E9mec1eWp9z5QmJlSs/VO1DA+T6z279P lCy7x0DqO9fe0wWRRaR2zqIrDhxuEV+x2msWiRDsWGDRsIc+uk3flzSwy8mQD7zLG1QC8d P+mFiqzYYozaUEi250xETmt5oXFBvalsfuvT4FOi340sM0OVIgzH+WpHp2rZJAvm6lnSpW GzpDsHzkq0qcN22pl3EUqdgWksxjLFuheO2qhvpg5ZYIWi7HJqqZdpmjXeYn9yXJYYKD6+ Lw7A3JzD9cH6nZkMeBQOkrtsznODnsbemTE5cdaiuVUkx801v8OU71DSFIh0ow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676014714; a=rsa-sha256; cv=none; b=K4VS0j+ZsNRV9YYpgyFziCJS4Z6QdbHvV+soKWmgbnn3kTqBm+QPe+Ohjcn6V0SlQQ5qUP zPcMiyvgBYwLJNcWOCTrbsSFNuwCmc7vy02EsO0j4YtHRQHoC3Y2WcxmzDtO0Qg6LKzbHc OLdtYLfBkABeozvdq2VuVbQi9H9qi65BIt7LOKABqe5h2ywcwDXkt6J+RGK3XDJWRsZIt4 8WCnK7NPLpKHtzgQSYbvKpyp8r3I/SMWeE4lOzzSXABxcNYDD+oXfHthE6z/ZqkR3Eyov4 HDRxSUjGfF4PeGCfjAqzjeY9TzTgfFiEXS5NFc225FN//WqbgJ2wmTv8OdZgxg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PClwB1Hd3z186t; Fri, 10 Feb 2023 07:38:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31A7cYDS031940; Fri, 10 Feb 2023 07:38:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31A7cYAK031939; Fri, 10 Feb 2023 07:38:34 GMT (envelope-from git) Date: Fri, 10 Feb 2023 07:38:34 GMT Message-Id: <202302100738.31A7cYAK031939@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Toomas Soome Subject: git: 4b2322bba19d - stable/13 - efiserialio: use port settings (sio->Mode) for initial setup 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: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4b2322bba19d26f91d0f1a993798c52ebf45d41b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=4b2322bba19d26f91d0f1a993798c52ebf45d41b commit 4b2322bba19d26f91d0f1a993798c52ebf45d41b Author: Toomas Soome AuthorDate: 2023-02-02 14:01:02 +0000 Commit: Toomas Soome CommitDate: 2023-02-10 07:37:49 +0000 efiserialio: use port settings (sio->Mode) for initial setup Use serial port setup done by system firmware. ARM64 Hyper-V does hung if we attempt to override the defaults, therefore we should default to use settings from firmware. Tested by: schakrabarti@microsoft.com PR: 266248 MFC after: 1 week (cherry picked from commit c243de11cf7c4bb3d67bbc1655b149037e5b04f1) --- stand/efi/loader/efiserialio.c | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/stand/efi/loader/efiserialio.c b/stand/efi/loader/efiserialio.c index 8b3f8e83e0b3..375e679d2590 100644 --- a/stand/efi/loader/efiserialio.c +++ b/stand/efi/loader/efiserialio.c @@ -40,19 +40,17 @@ static EFI_GUID serial = SERIAL_IO_PROTOCOL; #define COMC_TXWAIT 0x40000 /* transmit timeout */ -#ifndef COMSPEED -#define COMSPEED 9600 -#endif - #define PNP0501 0x501 /* 16550A-compatible COM port */ struct serial { uint64_t baudrate; - uint8_t databits; + uint32_t timeout; + uint32_t receivefifodepth; + uint32_t databits; EFI_PARITY_TYPE parity; EFI_STOP_BITS_TYPE stopbits; - uint8_t ignore_cd; /* boolean */ - uint8_t rtsdtr_off; /* boolean */ + uint32_t ignore_cd; /* boolean */ + uint32_t rtsdtr_off; /* boolean */ int ioaddr; /* index in handles array */ EFI_HANDLE currdev; /* current serial device */ EFI_HANDLE condev; /* EFI Console device */ @@ -257,18 +255,16 @@ comc_probe(struct console *sc) size_t sz; if (comc_port == NULL) { - comc_port = malloc(sizeof (struct serial)); + comc_port = calloc(1, sizeof (struct serial)); if (comc_port == NULL) return; } - comc_port->baudrate = COMSPEED; - comc_port->ioaddr = 0; /* default port */ - comc_port->databits = 8; /* 8,n,1 */ - comc_port->parity = NoParity; /* 8,n,1 */ - comc_port->stopbits = OneStopBit; /* 8,n,1 */ + /* Use defaults from firmware */ + comc_port->databits = 8; + comc_port->parity = DefaultParity; + comc_port->stopbits = DefaultStopBits; comc_port->ignore_cd = 1; /* ignore cd */ comc_port->rtsdtr_off = 0; /* rts-dtr is on */ - comc_port->sio = NULL; handle = NULL; env = getenv("efi_com_port"); @@ -292,8 +288,17 @@ comc_probe(struct console *sc) (void**)&comc_port->sio, IH, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL); - if (EFI_ERROR(status)) + if (EFI_ERROR(status)) { comc_port->sio = NULL; + } else { + comc_port->baudrate = comc_port->sio->Mode->BaudRate; + comc_port->timeout = comc_port->sio->Mode->Timeout; + comc_port->receivefifodepth = + comc_port->sio->Mode->ReceiveFifoDepth; + comc_port->databits = comc_port->sio->Mode->DataBits; + comc_port->parity = comc_port->sio->Mode->Parity; + comc_port->stopbits = comc_port->sio->Mode->StopBits; + } } if (env != NULL) @@ -494,7 +499,8 @@ comc_setup(void) return (false); status = comc_port->sio->SetAttributes(comc_port->sio, - comc_port->baudrate, 0, 0, comc_port->parity, + comc_port->baudrate, comc_port->receivefifodepth, + comc_port->timeout, comc_port->parity, comc_port->databits, comc_port->stopbits); if (EFI_ERROR(status)) return (false); From nobody Fri Feb 10 16:19:12 2023 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 4PCzSx1ZMRz3pDj3; Fri, 10 Feb 2023 16:19: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 4PCzSx15RFz4X5t; Fri, 10 Feb 2023 16:19:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676045953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9dnk+juVg06zepFqqAwcc5vMxt0OX2pRqsuf+bcjuWc=; b=iO5hIq7VNRWUEaGzLm3bTQ11u4O29xGulZNpzi4jUE8eNNsgDrNfhDHs+pGL+3lT0gQ2iy dEXqMARc+EmDfxosO309QHUehPsQdullk+JoOs/NIkd6+pt0raf8Ky3HyjiGqkGjK5M7MZ qDG7NVyXprn6eEnSt8JR55NqeHO5A3qx8khwHOgbn4LkdY1NVQeSL34DyFCVRMsTgKLQtE JnfAxDCJ49uPqhtuBD9rdIacy9G0UPPnyUIKV+p0aNaBfaDuQr/jYduXhzypfq/aRe7D+Y 6D4CM3PsZ3+NZ9z5Nq5BW31L1JzTeCeZfUu/3tlwmPu7ovMMDH+7OaFn1kd0gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676045953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9dnk+juVg06zepFqqAwcc5vMxt0OX2pRqsuf+bcjuWc=; b=wExn0uAeIPl7IwO7cu88B09n6EBL6Zis+iWlWIewWOeffE6jvUIJ4rIsYfJb/dVna5rYHc 7nqcYS0nZrOEZAYTTzlMu14kCuwoLAe8LKerg6TOi2rbm8lb/8jJaOHPCq18GHBgZiM1wy 3UIdLdu8BGyonAcdZtz+BB94vi0WmODNIjwuqi02XltOdNyVlMSWc9vDy29WIzPIbRFEy4 RJHQ3jaEOQKScV27XjFY/3nIw5MqMOMskr3BTPyQV5grQh4nE6V5eLv2G4sNmDOchOnBCM n1PlpIfdzHuM+z2AeA7VH3TH0RPzfFZX9c4xOQffdwGDPS85d/Bn25Ale7dE2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676045953; a=rsa-sha256; cv=none; b=FgcwXFvW0t/lupOe5uhM0ixugAuNwdMN95rx5Zp8rwPTQdqIWyxaG5LCaaNWNj4DOqLKdG eBQsg7pVsPpw9M3jJ96xdA153fBxB5IVTBIDDwQm20nkrvKdNmxRTTz3fsGQmF2/XbaM/Z Mdq+1VmuiGAfX+ruOK2fPNiQV77VG+OqkXHpsQOEOH5D4M4lbHJxzk2cUo5rxx0r5yOime 3071xdcF5HwvImoFYJ+cefzrnJ7xtQfktJHxSJR6HCsFsV+xdIQdvFuzIZbVSH1CHueznJ WKv/0UzE5fnXs6+3ZmsriKMcacLWhjkC5S0nB9HRK6rHbEshGtFlWbY6I+WKKw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCzSx07qtzPJX; Fri, 10 Feb 2023 16:19:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31AGJCFq073268; Fri, 10 Feb 2023 16:19:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31AGJClv073267; Fri, 10 Feb 2023 16:19:12 GMT (envelope-from git) Date: Fri, 10 Feb 2023 16:19:12 GMT Message-Id: <202302101619.31AGJClv073267@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 3a4b31e1f496 - stable/13 - Revert "netlink: allow to override sb_max for netlink sockets" 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: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3a4b31e1f49668dc4facfcfa60e6b8c8e625eff4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=3a4b31e1f49668dc4facfcfa60e6b8c8e625eff4 commit 3a4b31e1f49668dc4facfcfa60e6b8c8e625eff4 Author: Alexander V. Chernikov AuthorDate: 2023-02-10 16:05:52 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-10 16:05:52 +0000 Revert "netlink: allow to override sb_max for netlink sockets" This reverts commit 4f81fdc0886f623043767866ebe4339bd12edf18. --- sys/kern/uipc_sockbuf.c | 3 +-- sys/kern/uipc_socket.c | 10 ---------- sys/sys/sockopt.h | 1 - 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c index 277965412779..cbfcc0e5fe95 100644 --- a/sys/kern/uipc_sockbuf.c +++ b/sys/kern/uipc_sockbuf.c @@ -693,8 +693,7 @@ sbsetopt(struct socket *so, int cmd, u_long cc) if (*lowat > *hiwat) *lowat = *hiwat; } else { - u_long limit = sogetmaxbuf(so); - if (!sbreserve_locked_limit(sb, cc, so, limit, curthread)) + if (!sbreserve_locked(sb, cc, so, curthread)) error = ENOBUFS; } if (error == 0) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index fdf718de2483..f8931b653a4d 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -128,7 +128,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -2976,15 +2975,6 @@ sooptcopyin(struct sockopt *sopt, void *buf, size_t len, size_t minlen) return (0); } -u_long -sogetmaxbuf(struct socket *so) -{ - if (so->so_proto->pr_domain->dom_family != PF_NETLINK) - return (sb_max); - u_long nl_maxsockbuf = 512 * 1024 * 1024; /* 512M, XXX: init based on physmem */ - return ((priv_check(curthread, PRIV_NET_ROUTE) == 0) ? nl_maxsockbuf : sb_max); -} - /* * Kernel version of setsockopt(2). * diff --git a/sys/sys/sockopt.h b/sys/sys/sockopt.h index d01d62f21680..cb7fc3ffca27 100644 --- a/sys/sys/sockopt.h +++ b/sys/sys/sockopt.h @@ -68,6 +68,5 @@ int accept_filt_getopt(struct socket *, struct sockopt *); int accept_filt_setopt(struct socket *, struct sockopt *); int so_setsockopt(struct socket *so, int level, int optname, void *optval, size_t optlen); -u_long sogetmaxbuf(struct socket *so); #endif /* _SYS_SOCKOPT_H_ */ From nobody Fri Feb 10 16:19:14 2023 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 4PCzSy30PRz3pDp6; Fri, 10 Feb 2023 16:19: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 4PCzSy2H4bz4XH8; Fri, 10 Feb 2023 16:19:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676045954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TSfGU4PbfHmhSP5ueO919xSO85v3dC2DFymBp6Fl0zo=; b=UErHN6hsRCtGTiawydVssVVHnYTgj0+UrZif6JrKV9ZZp9hOfG7KJk+xKMOF3lQYOnFj2T KDRhvZ4HCbT7ydwvQlzrwQQV1yrc6haqDOBfyX+9fyTgbJP4lITOZnAvIDXriWw4bpV8F2 JqFmRiLDmHK7awE6+SeAZK4GA0hZ7eayr/dVM4wdd/bDaTN73aBkIIwe0jqnzgbmgmgg0a HpfeEc7AA4AyEv01mvsDnR1UGl0QpJfVEAZvquUCf3KFW2pQ9Gw6INKX+5IW79Q8RYCv38 jUFnO5N5ozwZb0+keQTHQtqq0wbZcswUr9sJVb91T0zKmhTb3DSKxUkO/hcP+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676045954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TSfGU4PbfHmhSP5ueO919xSO85v3dC2DFymBp6Fl0zo=; b=B3+5B9aEG7Shg3eotYry7GWOt9M5Mq69wpWQX9ZDVovq4oFSq+AUZOO3Lagz17qtvSiphb mVw6/rA51HlA8bLHOXDidhUWx8ZA8kmObXtMCso6nnkuy3QV9CXMi9cbFsQaLvdfGXcjfZ TfK/PjBeilo1fBDnliBZTPKGdUNn2owIu3lXQLbODKV4nkQpaq63EhU83IPkQKRa15e6M/ QYvNjAIKQ+3Bcgp6Y/mGisdpyI1/BjpYQAjMW9wVTg9BKkVok+Lz9piQNIU0m5CNAEqvCW /K7FPv8bBrkL31rsdwjIVho8vsbLGTDXcMSCsAt09+jBvAXkVablkyROnYhnSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676045954; a=rsa-sha256; cv=none; b=SSH0bi8c3q+f3sgg9ONxcXHZq79IkQnLCIgvbzsy8pbqm1pPhrj31amaAG0VdYT1EayV24 7ukLMS+FYH6PdNlvfPh/h1y2a7UX41ww8cQlHzbjaaPnZhnNZlTgqQYpf6W1k1dquPF7Uh G5M6FrEIep8E4ZpklGvNN+m4jtMCoPOELfADSzadWbVoXLfUtElZt3vdnAEvvoc/DINKas j2bOHXqZpVQmUKLqxyQUyr7nlqpxqlGIU9y4v5pRhoR+dccGMHOnPugGdHndhf4xzGK3rh 91NAxKvAdk+Iu1t55OW9mcJtNirr5Gzfq8jihRviORksZF55CbTu50J5o9mO5Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCzSy1LWQzPjc; Fri, 10 Feb 2023 16:19:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31AGJErr073292; Fri, 10 Feb 2023 16:19:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31AGJESZ073291; Fri, 10 Feb 2023 16:19:14 GMT (envelope-from git) Date: Fri, 10 Feb 2023 16:19:14 GMT Message-Id: <202302101619.31AGJESZ073291@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: c3d3f3594fdf - stable/13 - netlink: allow to override sb_max for netlink sockets. 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: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c3d3f3594fdf653392936594b75ec330af12d7fa Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=c3d3f3594fdf653392936594b75ec330af12d7fa commit c3d3f3594fdf653392936594b75ec330af12d7fa Author: Alexander V. Chernikov AuthorDate: 2023-02-10 16:07:17 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-10 16:07:22 +0000 netlink: allow to override sb_max for netlink sockets. Netlink sockets sometimes require larger buffers than other sockets. For example, full-view IPv4 dump sent via netlink may consume 50+ megabytes. The desired buffer may be bigger than the system maximum `sb_max`. FreeBSD HEAD has a mechanism for overriding protocol `setsockopt()` handler, which netlink uses to permit buffer reservations beyond `sb_max`. This behaviour is handy as it doesn't require system administrator to lift the limits for other sockets. Stable/13 lack such muchanism, so a different approach has to be used. This diff is a direct commit to stable/13 and it simply copies the logic from Netlink in -HEAD for checking if the larger buffer size should be permitted. Differential Revision: https://reviews.freebsd.org/D38472 --- sys/kern/uipc_sockbuf.c | 3 ++- sys/kern/uipc_socket.c | 10 ++++++++++ sys/sys/sockopt.h | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c index cbfcc0e5fe95..277965412779 100644 --- a/sys/kern/uipc_sockbuf.c +++ b/sys/kern/uipc_sockbuf.c @@ -693,7 +693,8 @@ sbsetopt(struct socket *so, int cmd, u_long cc) if (*lowat > *hiwat) *lowat = *hiwat; } else { - if (!sbreserve_locked(sb, cc, so, curthread)) + u_long limit = sogetmaxbuf(so); + if (!sbreserve_locked_limit(sb, cc, so, limit, curthread)) error = ENOBUFS; } if (error == 0) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index f8931b653a4d..fdf718de2483 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -128,6 +128,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -2975,6 +2976,15 @@ sooptcopyin(struct sockopt *sopt, void *buf, size_t len, size_t minlen) return (0); } +u_long +sogetmaxbuf(struct socket *so) +{ + if (so->so_proto->pr_domain->dom_family != PF_NETLINK) + return (sb_max); + u_long nl_maxsockbuf = 512 * 1024 * 1024; /* 512M, XXX: init based on physmem */ + return ((priv_check(curthread, PRIV_NET_ROUTE) == 0) ? nl_maxsockbuf : sb_max); +} + /* * Kernel version of setsockopt(2). * diff --git a/sys/sys/sockopt.h b/sys/sys/sockopt.h index cb7fc3ffca27..d01d62f21680 100644 --- a/sys/sys/sockopt.h +++ b/sys/sys/sockopt.h @@ -68,5 +68,6 @@ int accept_filt_getopt(struct socket *, struct sockopt *); int accept_filt_setopt(struct socket *, struct sockopt *); int so_setsockopt(struct socket *so, int level, int optname, void *optval, size_t optlen); +u_long sogetmaxbuf(struct socket *so); #endif /* _SYS_SOCKOPT_H_ */ From nobody Fri Feb 10 17:00:58 2023 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 4PD0P83bTdz3pKBG; Fri, 10 Feb 2023 17:01:00 +0000 (UTC) (envelope-from mike@karels.net) Received: from mail2.karels.net (mail2.karels.net [3.19.118.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "freebsd", Issuer "freebsd" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PD0P81ZpGz4lFt; Fri, 10 Feb 2023 17:01:00 +0000 (UTC) (envelope-from mike@karels.net) Authentication-Results: mx1.freebsd.org; none Received: from mail2.karels.net (localhost [IPv6:0:0:0:0:0:0:0:1]) by mail2.karels.net (8.16.1/8.16.1) with ESMTP id 31AH0wAA050136; Fri, 10 Feb 2023 11:00:58 -0600 (CST) (envelope-from mike@karels.net) Received: from [10.0.2.130] ([73.62.165.147]) by mail2.karels.net with ESMTPSA id 9Ss1LEp45mPWwwAAs/W3XQ (envelope-from ); Fri, 10 Feb 2023 11:00:58 -0600 From: Mike Karels To: "Alexander V. Chernikov" Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: Re: git: c3d3f3594fdf - stable/13 - netlink: allow to override sb_max for netlink sockets. Date: Fri, 10 Feb 2023 11:00:58 -0600 X-Mailer: MailMate (1.14r5937) Message-ID: <721D2CDA-6740-482D-BDC9-C5EFE56F7AE0@karels.net> In-Reply-To: <202302101619.31AGJESZ073291@gitrepo.freebsd.org> References: <202302101619.31AGJESZ073291@gitrepo.freebsd.org> 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 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4PD0P81ZpGz4lFt X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.16.0.0/14, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 10 Feb 2023, at 10:19, Alexander V. Chernikov wrote: > The branch stable/13 has been updated by melifaro: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Dc3d3f3594fdf653392936594= b75ec330af12d7fa > > commit c3d3f3594fdf653392936594b75ec330af12d7fa > Author: Alexander V. Chernikov > AuthorDate: 2023-02-10 16:07:17 +0000 > Commit: Alexander V. Chernikov > CommitDate: 2023-02-10 16:07:22 +0000 > > netlink: allow to override sb_max for netlink sockets. > > Netlink sockets sometimes require larger buffers than other sockets= =2E > For example, full-view IPv4 dump sent via netlink may consume 50+ m= egabytes. > The desired buffer may be bigger than the system maximum `sb_max`. > FreeBSD HEAD has a mechanism for overriding protocol `setsockopt()`= handler, > which netlink uses to permit buffer reservations beyond `sb_max`.= > This behaviour is handy as it doesn't require system administrator= to lift > the limits for other sockets. > Stable/13 lack such muchanism, so a different approach has to be us= ed. > This diff is a direct commit to stable/13 and it simply copies the = logic from > Netlink in -HEAD for checking if the larger buffer size should be = permitted. > > Differential Revision: https://reviews.freebsd.org/D38472 > --- > sys/kern/uipc_sockbuf.c | 3 ++- > sys/kern/uipc_socket.c | 10 ++++++++++ > sys/sys/sockopt.h | 1 + > 3 files changed, 13 insertions(+), 1 deletion(-) > > diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c > index cbfcc0e5fe95..277965412779 100644 > --- a/sys/kern/uipc_sockbuf.c > +++ b/sys/kern/uipc_sockbuf.c > @@ -693,7 +693,8 @@ sbsetopt(struct socket *so, int cmd, u_long cc) > if (*lowat > *hiwat) > *lowat =3D *hiwat; > } else { > - if (!sbreserve_locked(sb, cc, so, curthread)) > + u_long limit =3D sogetmaxbuf(so); Spaces instead of tabs. Mike > + if (!sbreserve_locked_limit(sb, cc, so, limit, curthread)) > error =3D ENOBUFS; > } > if (error =3D=3D 0) > diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c > index f8931b653a4d..fdf718de2483 100644 > --- a/sys/kern/uipc_socket.c > +++ b/sys/kern/uipc_socket.c > @@ -128,6 +128,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -2975,6 +2976,15 @@ sooptcopyin(struct sockopt *sopt, void *buf, siz= e_t len, size_t minlen) > return (0); > } > > +u_long > +sogetmaxbuf(struct socket *so) > +{ > + if (so->so_proto->pr_domain->dom_family !=3D PF_NETLINK) > + return (sb_max); > + u_long nl_maxsockbuf =3D 512 * 1024 * 1024; /* 512M, XXX: init based = on physmem */ > + return ((priv_check(curthread, PRIV_NET_ROUTE) =3D=3D 0) ? nl_maxsock= buf : sb_max); > +} > + > /* > * Kernel version of setsockopt(2). > * > diff --git a/sys/sys/sockopt.h b/sys/sys/sockopt.h > index cb7fc3ffca27..d01d62f21680 100644 > --- a/sys/sys/sockopt.h > +++ b/sys/sys/sockopt.h > @@ -68,5 +68,6 @@ int accept_filt_getopt(struct socket *, struct sockop= t *); > int accept_filt_setopt(struct socket *, struct sockopt *); > int so_setsockopt(struct socket *so, int level, int optname, > void *optval, size_t optlen); > +u_long sogetmaxbuf(struct socket *so); > > #endif /* _SYS_SOCKOPT_H_ */ From nobody Sat Feb 11 00:36:01 2023 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 4PDBV96Sgkz3nbvq; Sat, 11 Feb 2023 00:36: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 4PDBV95y2dz4KXR; Sat, 11 Feb 2023 00:36:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676075761; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0SrEhyOxNZAVgwjXnvmk3G2V7Q+sbd9NniRinouzf34=; b=N3S6N5vnFeArwb6qm6w7bKpcdXdMPt5gm2PF/rD3cs7f8ZaFyrTh0I+bKtljskcB28YmQu EsbndYTyNeEeaSYC7nPdbeXc0/hiR/oBx2ppYipxdgAfnIkWoTcf+Zqv9b93Oj5Ft0HgRs Dtl8cX13e0lePMA9G9ChPhWfmtY2lxMT4JHmYEGm8/SBubOaiYU6aZgkeeeQ4dyPlzMn3a Z9Nj8gzlHRacR4C4FxAaiJWiKz7dLzLwMb+bjccbaStWBWZFMiXp9t8m7rUF5al0d/hQ2x cpLMLhu7C7JdKPXZnODlAAy+eHGs0gED2sBFDoVe8sy1ucB88GfBgIsMvcDw8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676075761; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0SrEhyOxNZAVgwjXnvmk3G2V7Q+sbd9NniRinouzf34=; b=b8xGGhxCx3h4r+f3esog+G//jwtn8rnLsBn6vClbW8nXv3T4tR1Y6ju/dqYV1pbL9QiD1v hqN7v5s55Bg3+woI6G1NM+ZydX9pxM7H2x9qVqJP1ZTcerFOpZ1a+RFPgM6q+PEBRoJdRI MNJ6X8ljxIvhxzg0CSahHlZnn1hG6rpO3GxfNlQmAqbCtjCLcJejE/c4qt1eaQ+5/SB5CX xaDkCxSY976u0o36T+knCanFDfiIgNNGQKUtF4P7u+DqefxvyJywoZC9J2Adgq3UTkbf3d EIkabA1PPk2HSTWvXrQrQTV9vD1xrv/lsRCB4Q4J+2AhHu2UtOxcDqDMZEa5GQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676075761; a=rsa-sha256; cv=none; b=OM8IzoIUmOsrPBT1eR6+x0ZmZmf0suf5Mj6QrM+0zqV3+gfsQAGc9gIlcS0eT9OW1h2o2A 1S+tUJhnF5v/2U/qey4G9l6cDH0Wsl1mJ/BM/r12iQTZhYzcRB5P1wvM+Dhvy61pfgovKA y0jprcerKx/CUdf/MKehjOZiSJHRvpio/xXAxdfNJiAH/TSLpEVj6AuXcg35SG8z17oUpG I5+AVZUtArbq9dHppnyj5vhn/WhO/t527hs1wIzwwuBphTKcrd/yRIqqm/sW5MUIqIxrTQ P7XEt4y+OZ9pfTVgXP111j0btPpmIc78wKd7dYNJCytmVboA0TGDpRx7mg5juA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PDBV951ZMzfKY; Sat, 11 Feb 2023 00:36:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31B0a1aP088263; Sat, 11 Feb 2023 00:36:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31B0a1hO088262; Sat, 11 Feb 2023 00:36:01 GMT (envelope-from git) Date: Sat, 11 Feb 2023 00:36:01 GMT Message-Id: <202302110036.31B0a1hO088262@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: 51485f81b01a - stable/13 - FIOSEEKHOLE/FIOSEEKDATA: correct consistency for bmap-based implementation 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: 51485f81b01a03752ffaf530abfb570ae4593fae Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=51485f81b01a03752ffaf530abfb570ae4593fae commit 51485f81b01a03752ffaf530abfb570ae4593fae Author: Konstantin Belousov AuthorDate: 2023-02-04 01:20:19 +0000 Commit: Konstantin Belousov CommitDate: 2023-02-11 00:25:02 +0000 FIOSEEKHOLE/FIOSEEKDATA: correct consistency for bmap-based implementation PR: 269261 (cherry picked from commit 3b6056204dd80cc866b7998ef0776247ebc42ce4) --- sys/kern/vfs_vnops.c | 12 +++++++++++- sys/ufs/ufs/ufs_bmap.c | 18 ++++++++++++++++++ sys/ufs/ufs/ufs_vnops.c | 2 +- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index f4274ee38689..566b781098ad 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -2546,6 +2546,7 @@ vn_pages_remove_valid(struct vnode *vp, vm_pindex_t start, vm_pindex_t end) int vn_bmap_seekhole(struct vnode *vp, u_long cmd, off_t *off, struct ucred *cred) { + vm_object_t obj; struct vattr va; daddr_t bn, bnp; uint64_t bsize; @@ -2555,7 +2556,7 @@ vn_bmap_seekhole(struct vnode *vp, u_long cmd, off_t *off, struct ucred *cred) KASSERT(cmd == FIOSEEKHOLE || cmd == FIOSEEKDATA, ("Wrong command %lu", cmd)); - if (vn_lock(vp, LK_SHARED) != 0) + if (vn_lock(vp, LK_EXCLUSIVE) != 0) return (EBADF); if (vp->v_type != VREG) { error = ENOTTY; @@ -2569,6 +2570,15 @@ vn_bmap_seekhole(struct vnode *vp, u_long cmd, off_t *off, struct ucred *cred) error = ENXIO; goto unlock; } + + /* See the comment in ufs_bmap_seekdata(). */ + obj = vp->v_object; + if (obj != NULL) { + VM_OBJECT_WLOCK(obj); + vm_object_page_clean(obj, 0, 0, OBJPC_SYNC); + VM_OBJECT_WUNLOCK(obj); + } + bsize = vp->v_mount->mnt_stat.f_iosize; for (bn = noff / bsize; noff < va.va_size; bn++, noff += bsize - noff % bsize) { diff --git a/sys/ufs/ufs/ufs_bmap.c b/sys/ufs/ufs/ufs_bmap.c index 4ac8ca149279..acdd334f6c7b 100644 --- a/sys/ufs/ufs/ufs_bmap.c +++ b/sys/ufs/ufs/ufs_bmap.c @@ -44,12 +44,16 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include #include +#include +#include + #include #include #include @@ -348,6 +352,7 @@ ufs_bmap_seekdata(struct vnode *vp, off_t *offp) struct inode *ip; struct mount *mp; struct ufsmount *ump; + vm_object_t obj; ufs2_daddr_t bn, daddr, nextbn; uint64_t bsize; off_t numblks; @@ -364,6 +369,19 @@ ufs_bmap_seekdata(struct vnode *vp, off_t *offp) if (*offp < 0 || *offp >= ip->i_size) return (ENXIO); + /* + * We could have pages on the vnode' object queue which still + * do not have the data blocks allocated. Convert all dirty + * pages into buffer writes to ensure that we see all + * allocated data. + */ + obj = vp->v_object; + if (obj != NULL) { + VM_OBJECT_WLOCK(obj); + vm_object_page_clean(obj, 0, 0, OBJPC_SYNC); + VM_OBJECT_WUNLOCK(obj); + } + bsize = mp->mnt_stat.f_iosize; for (bn = *offp / bsize, numblks = howmany(ip->i_size, bsize); bn < numblks; bn = nextbn) { diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 57560efffbbf..1ebb3597b925 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -2971,7 +2971,7 @@ ufs_ioctl(struct vop_ioctl_args *ap) vp = ap->a_vp; switch (ap->a_command) { case FIOSEEKDATA: - error = vn_lock(vp, LK_SHARED); + error = vn_lock(vp, LK_EXCLUSIVE); if (error == 0) { error = ufs_bmap_seekdata(vp, (off_t *)ap->a_data); VOP_UNLOCK(vp);