From nobody Mon Nov 24 03:15:35 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dF9tv2t38z6Hw64 for ; Mon, 24 Nov 2025 03:15: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dF9tv22R5z3Srj for ; Mon, 24 Nov 2025 03:15:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763954135; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vAS5GkVZqNZdpjkw2bG06mSlUSfmA8GoHMCPuS3Dppc=; b=WySKo2mA0IBDkRKKzthfYSNZRUgwUy3/6stMboGaPbRTuHRcrRmB0lgb5R5JzsZLUmVdxm wPRMJXVoBG2HboT5LYvZ4SALTHgKGQDNXjPVTgd2afNH8Ag6xDiqEEOPH5qSr/eYT3CiI/ Eof/YbB10Rkg7AObEdLDMBD0G8nYCzowXcmHzSnUNPmtg8mha9yMQoze3ea4ldRnGfu8tV PNYQ6EuXleMmJhUSTozYj/Wo3lzedEIltAbuoMNKSlPJ6dvE+YtY7DRUXBBG1elhmWfuDW C9z05TYhfF/6nnkRzZjJnwqymF7aajpc6/Tva8S+d0HKbfrytd5egbVsE/JEpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763954135; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vAS5GkVZqNZdpjkw2bG06mSlUSfmA8GoHMCPuS3Dppc=; b=YiahHsaKMxqnPzinuYqViltnZVjC6bFShz7aFioeqWvU5d+XrqBgKJR0F0HOukb11Z0Oas 0Y4B96YUJ2nhBwGNmEurCzgWQ+V4xD0YtrMWhAMnRvt4TslEY0Hi9ovZKHH+IXye0xDMhm g0myEuZi5+e/2Mj++JFWhjz2+En3P5xZApCq3QprAkm1b2sfBjPSOA8XVWLsOtNCxRunU2 zk7CzWSpSu5V7uwgnvUrhiFt2Ytbv/Kkf9mlN4+g9JeZhoV9vIkxeGkyGBEWkjhVjEIpL+ bZpFooj93WmL1Pl7A5DjLO4FiUBE/8zW6a+y/BmiBdfM8wO3xMwmcYzQSTTvZg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763954135; a=rsa-sha256; cv=none; b=p2xWyAB/0ZGHc/sVeEJLwZz+gzJ7JTwd9TPThRmB9kVIUA4W7V3lArsNM/8R9uEYY2UyJY OAZpUh0XKxbjAgvBcw1FPQ4mu3sEtsHwAPiqp02HnR4dIzdw89NxsQyVNZ11eIqPtrQaNr 4nIZ1oAlG+UqVRYrKE8zasKS+3CAKptBgMNbQqC7PlutQNkmD4+rGfQogQfp2LoQfiW6f5 cjqli5M3pfYubIoUAte1atT1DyMJhI/GEEA4ABoSvi/Hc6wkF+SGhg/Axota/vEtsNZByN pcG4Ms8EK8m/eHBmMrdu2HEq2U8agYsKVR7Vnbz0Uml0upGikIVovIuEWEnoCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dF9tv1ZtfzwLj for ; Mon, 24 Nov 2025 03:15:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3014c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 24 Nov 2025 03:15:35 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 2eb030d1c8f1 - stable/15 - pam_krb5: Restore allow_kdc_spoof option List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 2eb030d1c8f1f307c2e0570538633d4e0822a4ff Auto-Submitted: auto-generated Date: Mon, 24 Nov 2025 03:15:35 +0000 Message-Id: <6923cdd7.3014c.55ed939f@gitrepo.freebsd.org> The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=2eb030d1c8f1f307c2e0570538633d4e0822a4ff commit 2eb030d1c8f1f307c2e0570538633d4e0822a4ff Author: Dag-Erling Smørgrav AuthorDate: 2025-11-24 02:40:29 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-11-24 02:42:30 +0000 pam_krb5: Restore allow_kdc_spoof option Not only does the new pam_krb5 module not have the same allow_kdc_spoof option that the old one had, its behavior in this matter defaults to insecure. Reimplement allow_kdc_spoof and switch the default back. Reviewed by: cy Differential Revision: https://reviews.freebsd.org/D53884 (cherry picked from commit fe5c8baf25a5b40285c3ef85b69391d591e4a76c) --- contrib/pam-krb5/docs/pam_krb5.pod | 15 +++++++++------ contrib/pam-krb5/module/auth.c | 6 ++++++ contrib/pam-krb5/module/internal.h | 3 +++ contrib/pam-krb5/module/options.c | 3 +++ 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/contrib/pam-krb5/docs/pam_krb5.pod b/contrib/pam-krb5/docs/pam_krb5.pod index 024584dfd4cd..f352af71b553 100644 --- a/contrib/pam-krb5/docs/pam_krb5.pod +++ b/contrib/pam-krb5/docs/pam_krb5.pod @@ -57,12 +57,10 @@ is vulnerable to KDC spoofing, but it requires that the system have a local key and that the PAM module be running as a user that can read the keytab file (normally F. You can point the Kerberos PAM module at a different keytab with the I option. If that keytab -cannot be read or if no keys are found in it, the default (potentially -insecure) behavior is to skip this check. If you want to instead fail -authentication if the obtained tickets cannot be checked, set -C to true in the [libdefaults] section of -F. Note that this will affect applications other than -this PAM module. +cannot be read or if no keys are found in it, the default behavior is to +fail authentication. If you want to skip this check, set the +C option to true either in the [appdefaults] section of +F or in the PAM policy. By default, whenever the user is authenticated, a basic authorization check will also be done using krb5_kuserok(). The default behavior of @@ -218,6 +216,11 @@ pam-krb5 in which that option was added with the current meaning. =over 4 +=item allow_kdc_spoof + +Allow authentication to succeed even if there is no host or service +key available in a keytab to authenticate the Kerberos KDC's ticket. + =item alt_auth_map= [3.12] This functions similarly to the I option. The diff --git a/contrib/pam-krb5/module/auth.c b/contrib/pam-krb5/module/auth.c index 065ce97b6596..46f2be791000 100644 --- a/contrib/pam-krb5/module/auth.c +++ b/contrib/pam-krb5/module/auth.c @@ -696,6 +696,12 @@ verify_creds(struct pam_args *args, krb5_creds *creds) if (cursor_valid) krb5_kt_end_seq_get(c, keytab, &cursor); } +#ifdef __FreeBSD__ + if (args->config->allow_kdc_spoof) + opts.flags &= ~KRB5_VERIFY_INIT_CREDS_OPT_AP_REQ_NOFAIL; + else + opts.flags |= KRB5_VERIFY_INIT_CREDS_OPT_AP_REQ_NOFAIL; +#endif /* __FreeBSD__ */ retval = krb5_verify_init_creds(c, creds, princ, keytab, NULL, &opts); if (retval != 0) putil_err_krb5(args, retval, "credential verification failed"); diff --git a/contrib/pam-krb5/module/internal.h b/contrib/pam-krb5/module/internal.h index f3ea30139815..c797f7a56cd3 100644 --- a/contrib/pam-krb5/module/internal.h +++ b/contrib/pam-krb5/module/internal.h @@ -62,6 +62,9 @@ struct pam_config { long minimum_uid; /* Ignore users below this UID. */ bool only_alt_auth; /* Alt principal must be used. */ bool search_k5login; /* Try password with each line of .k5login. */ +#ifdef __FreeBSD__ + bool allow_kdc_spoof;/* Allow auth even if KDC cannot be verified */ +#endif /* __FreeBSD__ */ /* Kerberos behavior. */ char *fast_ccache; /* Cache containing armor ticket. */ diff --git a/contrib/pam-krb5/module/options.c b/contrib/pam-krb5/module/options.c index 799b3a33e168..0118fb451af6 100644 --- a/contrib/pam-krb5/module/options.c +++ b/contrib/pam-krb5/module/options.c @@ -30,6 +30,9 @@ #define K(name) (#name), offsetof(struct pam_config, name) /* clang-format off */ static const struct option options[] = { +#ifdef __FreeBSD__ + { K(allow_kdc_spoof), true, BOOL (false) }, +#endif /* __FreeBSD__ */ { K(alt_auth_map), true, STRING (NULL) }, { K(anon_fast), true, BOOL (false) }, { K(banner), true, STRING ("Kerberos") }, From nobody Mon Nov 24 03:15:36 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dF9tw5cXrz6Hw45 for ; Mon, 24 Nov 2025 03:15: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dF9tw2z1bz3SxT for ; Mon, 24 Nov 2025 03:15:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763954136; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EgUoD/OgDClmCyEVCiOZnpVJ/xFvlj/xFAV2XiNCPjY=; b=koaclr1APVANTJrIza2YTzIjvOGd/j8Mn2rEBh85orIYkt4rLOHdQ5GUrBYvWKq/3y4RXz hBqqwUx+yqWkCQ0zzf5/3uM0pB7dTS64zxD0GJz4NnYcnh4Xa2L9PhW7Uhi9WA6d/pUnPx CpcjCz3WctTrufVnE/kmreJkn3fDwVdEclpA6kzK5kW4h1b9ACnCSgMrYJH7MfpbbpX1sp 1a8zaYVojxSm33NRoYVY6X8y5NFUIrakp2PpMKK9A7pemr6P1flyfq8cwsy3Y4vNJPcotT 2HHJWkbX1mSQmHSWkURJD1XjgMsBbQseg8QD6I/EBs5pwWgESbT6tcgbUZm7hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763954136; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EgUoD/OgDClmCyEVCiOZnpVJ/xFvlj/xFAV2XiNCPjY=; b=aBZKIPQi3cXsy4jUEZGVh7I+UpdYlea2YAejtQ+htopXaondjspX2cd43LKAFQr9zWacgr Ga/o8+MN/H3d/+pDSbNVQfQaki0gFF/2FSxsXQUmKXmp88A1sXRiXH9VzzjEA8wjdYkYsF BZTJchCK4khI+pQkR8808tSMGep1sh4jo67S4vPg0lz95qy7KR2k649kKaW8rXq17acRow ye0NeaCnq0Td9ezAIlZO1JC8F9ybPS2Ur/nHZGNwFlIkFJPMOQ/5Z8o1sZE/45ZCX8BCFo zm6lUi0D2z/8sqfm4hokgmcee3GQ1mpWod2vRrNZPP/Ju6z3kBk/0qVEzHIBzw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763954136; a=rsa-sha256; cv=none; b=Iu/oE8AlOCtncI+tcGFJ2A4Kz+gILOHVBR2BrqAsToNC63htpMyKs0scNLCZn4fRRftgKw xeQEpcY16CGU14HiuXr0B+GuBqELnOwQAcJckMBjbaTslXgcBDjhpfUlXzAhdpKXG+6dEC oKcAUcsxerr30V8rEUPbz2plsFptDONtjw9nWUSm/WFTRnjdEjBFmeMIwDNxddB/YChlTC 5q2AJT0sjYGj54bFG5xRqe3NLX9TK6HxLDRZSQ4GwKd3X1IvdSE/NPFO9JTDWDBNxp6OrN t3APoQEZqw+krjB6qqaNQ8RDGbv642NY1SyLCgxIUWCWuAVfoqqES0EmYQdUZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dF9tw2NRtzx9V for ; Mon, 24 Nov 2025 03:15:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2ea7a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 24 Nov 2025 03:15:36 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 4166181675d7 - stable/15 - pam_krb5: Fix manual page in MIT case List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 4166181675d79c0157ea9bd4fcaa0b5c0319d0f1 Auto-Submitted: auto-generated Date: Mon, 24 Nov 2025 03:15:36 +0000 Message-Id: <6923cdd8.2ea7a.20416632@gitrepo.freebsd.org> The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=4166181675d79c0157ea9bd4fcaa0b5c0319d0f1 commit 4166181675d79c0157ea9bd4fcaa0b5c0319d0f1 Author: Dag-Erling Smørgrav AuthorDate: 2025-11-24 02:40:37 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-11-24 03:14:27 +0000 pam_krb5: Fix manual page in MIT case * Always install the manual page as pam_krb5(8) regardless of which version we're using. * Regenerate it using pod2mdoc instead of pod2man so it doesn't claim to be part of “User Contributed Perl Documentation”. * Put the correct section number in the header and footer. * Don't cross-reference non-existent pam(7) manual page. Reviewed by: cperciva Differential Revision: https://reviews.freebsd.org/D53885 (cherry picked from commit 961b934407f09d4241cfad76a9c8833baa2650e1) --- ObsoleteFiles.inc | 3 + lib/libpam/modules/pam_krb5/Makefile | 12 +- lib/libpam/modules/pam_krb5/pam-krb5.8 | 2205 ++++++++++++++++++-------------- 3 files changed, 1281 insertions(+), 939 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 6a61bf537561..ce6319ce0d7a 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20251121: Remove duplicate pam_krb5 manual page +OLD_FILES+=usr/share/man/man8/pam-krb5.8.gz + # 20251112: Remove pccard(4) and related OLD_FILES+=share/man/man4/pccard.4.gz OLD_FILES+=share/man/man4/pcic.4.gz diff --git a/lib/libpam/modules/pam_krb5/Makefile b/lib/libpam/modules/pam_krb5/Makefile index 0c933f8f7e57..d55f2d0b5971 100644 --- a/lib/libpam/modules/pam_krb5/Makefile +++ b/lib/libpam/modules/pam_krb5/Makefile @@ -30,6 +30,7 @@ SRCDIR= ${SRCTOP}/contrib/pam-krb5 .PATH: ${SRCDIR}/module \ ${SRCDIR}/portable \ ${SRCDIR}/pam-util \ + ${SRCDIR}/docs \ ${SRCDIR} PACKAGE= kerberos @@ -57,8 +58,8 @@ SRCS= account.c \ support.c \ vector.c -MANNODEV= pam-krb5.8 -MANNODEVLINKS= pam-krb5.8 pam_krb5.8 +MANNODEV= pam_krb5.8 +MANSRC.pam_krb5.8=pam-krb5.8 CFLAGS= -I${SRCDIR} \ -I${.CURDIR} \ @@ -74,6 +75,13 @@ pam-util_options.c: .PHONY module_options.c: .PHONY cp ${SRCDIR}/module/options.c module_options.c + +.ifdef VENDOR_IMPORT +# Regenerate the manual page from the pod source after vendor import +pam-krb5.8: pam_krb5.pod + sed -e 's/pam(7)/pam.conf(5)/' <${.ALLSRC} | \ + pod2mdoc -n pam_krb5 -s 8 >${.CURDIR}/${.TARGET} +.endif .else PACKAGE= kerberos diff --git a/lib/libpam/modules/pam_krb5/pam-krb5.8 b/lib/libpam/modules/pam_krb5/pam-krb5.8 index 3413748c7850..ad4fa5c422c4 100644 --- a/lib/libpam/modules/pam_krb5/pam-krb5.8 +++ b/lib/libpam/modules/pam_krb5/pam-krb5.8 @@ -1,1025 +1,1356 @@ -.\" -*- mode: troff; coding: utf-8 -*- -.\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. -.ie n \{\ -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds C` -. ds C' -'br\} -.\" -.\" Escape single quotes in literal strings from groff's Unicode transform. -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" -.\" If the F register is >0, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.\" -.\" Avoid warning from groff about undefined register 'F'. -.de IX -.. -.nr rF 0 -.if \n(.g .if rF .nr rF 1 -.if (\n(rF:(\n(.g==0)) \{\ -. if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. if !\nF==2 \{\ -. nr % 0 -. nr F 2 -. \} -. \} -.\} -.rr rF -.\" ======================================================================== -.\" -.IX Title "PAM_KRB5 1" -.TH PAM_KRB5 1 2025-06-05 "perl v5.40.2" "User Contributed Perl Documentation" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.if n .ad l -.nh -.SH NAME -pam_krb5 \- Kerberos PAM module -.SH SYNOPSIS -.IX Header "SYNOPSIS" -.Vb 4 -\& auth sufficient pam_krb5.so minimum_uid=1000 -\& session required pam_krb5.so minimum_uid=1000 -\& account required pam_krb5.so minimum_uid=1000 -\& password sufficient pam_krb5.so minimum_uid=1000 -.Ve -.SH DESCRIPTION -.IX Header "DESCRIPTION" +.Dd November 21, 2025 +.Dt PAM_KRB5 8 +.Os +.Sh NAME +.Nm pam_krb5 +.Nd Kerberos PAM module +.Sh SYNOPSIS +.Bd -literal + auth sufficient pam_krb5.so minimum_uid=1000 + session required pam_krb5.so minimum_uid=1000 + account required pam_krb5.so minimum_uid=1000 + password sufficient pam_krb5.so minimum_uid=1000 +.Ed +.Sh DESCRIPTION The Kerberos service module for PAM, typically installed at -\&\fI/lib/security/pam_krb5.so\fR, provides functionality for the four PAM -operations: authentication, account management, session management, and -password management. \fIpam_krb5.so\fR is a shared object that is -dynamically loaded by the PAM subsystem as necessary, based on the system -PAM configuration. PAM is a system for plugging in external -authentication and session management modules so that each application -doesn't have to know the best way to check user authentication or create a -user session on that system. For details on how to configure PAM on your -system, see the PAM man page, often \fBpam\fR\|(7). -.PP +.Pa /lib/security/pam_krb5.so , +provides functionality for the four PAM operations: authentication, +account management, session management, and password management. +.Pa pam_krb5.so +is a shared object that is dynamically loaded by the PAM subsystem as +necessary, based on the system PAM configuration. +PAM is a system for plugging in external authentication and session +management modules so that each application doesn't have to know the +best way to check user authentication or create a user session on that +system. +For details on how to configure PAM on your system, see the PAM man +page, often pam.conf(5). +.Pp Here are the actions of this module when called from each group: -.IP auth 4 -.IX Item "auth" -Provides implementations of \fBpam_authenticate()\fR and \fBpam_setcred()\fR. The -former takes the username from the PAM session, prompts for the user's -password (unless configured to use an already-entered password), and then -performs a Kerberos initial authentication, storing the obtained -credentials (if successful) in a temporary ticket cache. The latter, -depending on the flags it is called with, either takes the contents of the -temporary ticket cache and writes it out to a persistent ticket cache -owned by the user or uses the temporary ticket cache to refresh an -existing user ticket cache. -.Sp +.Bl -tag -width Ds +.It auth +Provides implementations of +.Xr pam_authenticate 3 +and +.Xr pam_setcred 3 . +The former takes the username from the PAM session, prompts for the +user's password (unless configured to use an already-entered password), +and then performs a Kerberos initial authentication, storing the +obtained credentials (if successful) in a temporary ticket cache. +The latter, depending on the flags it is called with, either takes the +contents of the temporary ticket cache and writes it out to a persistent +ticket cache owned by the user or uses the temporary ticket cache to +refresh an existing user ticket cache. +.Pp Passwords as long or longer than PAM_MAX_RESP_SIZE octets (normally 512 -octets) will be rejected, since excessively long passwords can be used as -a denial of service attack. -.Sp +octets) will be rejected, since excessively long passwords can be used +as a denial of service attack. +.Pp After doing the initial authentication, the Kerberos PAM module will attempt to obtain tickets for a key in the local system keytab and then -verify those tickets. Unless this step is performed, the authentication -is vulnerable to KDC spoofing, but it requires that the system have a -local key and that the PAM module be running as a user that can read the -keytab file (normally \fI/etc/krb5.keytab\fR. You can point the Kerberos PAM -module at a different keytab with the \fIkeytab\fR option. If that keytab -cannot be read or if no keys are found in it, the default (potentially -insecure) behavior is to skip this check. If you want to instead fail -authentication if the obtained tickets cannot be checked, set -\&\f(CW\*(C`verify_ap_req_nofail\*(C'\fR to true in the [libdefaults] section of -\&\fI/etc/krb5.conf\fR. Note that this will affect applications other than -this PAM module. -.Sp +verify those tickets. +Unless this step is performed, the authentication is vulnerable to KDC +spoofing, but it requires that the system have a local key and that the +PAM module be running as a user that can read the keytab file (normally +.Pa /etc/krb5.keytab . +You can point the Kerberos PAM module at a different keytab with the +.Em keytab +option. +If that keytab cannot be read or if no keys are found in it, the default +behavior is to fail authentication. +If you want to skip this check, set the +.Qo Li allow_kdc_spoof Qc +option to true either in the [appdefaults] section of +.Pa /etc/krb5.conf +or in the PAM policy. +.Pp By default, whenever the user is authenticated, a basic authorization -check will also be done using \fBkrb5_kuserok()\fR. The default behavior of -this function is to check the user's account for a \fI.k5login\fR file and, -if one is present, ensure that the user's principal is listed in that -file. If \fI.k5login\fR is not present, the default check is to ensure that -the user's principal is in the default local realm and the user portion of -the principal matches the account name (this can be changed by configuring -a custom aname to localname mapping in \fIkrb5.conf\fR; see the Kerberos -documentation for details). This can be customized with several -configuration options; see below. -.Sp -If the username provided to PAM contains an \f(CW\*(C`@\*(C'\fR and Kerberos can, -treating the username as a principal, map it to a local account name, -\&\fBpam_authenticate()\fR will change the PAM user to that local account name. -This allows users to log in with their Kerberos principal and let Kerberos -do the mapping to an account. This can be disabled with the -\&\fIno_update_user\fR option. Be aware, however, that this facility cannot be -used with OpenSSH. OpenSSH will reject usernames that don't match local -accounts before this remapping can be done and will pass an invalid -password to the PAM module. Also be aware that several other common PAM -modules, such as pam_securetty, expect to be able to look up the user with -\&\fBgetpwnam()\fR and cannot be called before pam_krb5 when using this feature. -.Sp -When \fBpam_setcred()\fR is called to initialize a new ticket cache, the -environment variable KRB5CCNAME is set to the path to that ticket cache. -By default, the cache will be named \fI/tmp/krb5cc_UID_RANDOM\fR where UID is -the user's UID and RANDOM is six randomly-chosen letters. This can be -configured with the \fIccache\fR and \fIccache_dir\fR options. -.Sp -pam\-krb5 does not use the default ticket cache location or -\&\fIdefault_cc_name\fR in the \f(CW\*(C`[libdefaults]\*(C'\fR section of \fIkrb5.conf\fR. The -default cache location would share a cache for all sessions of the same -user, which causes confusing behavior when the user logs out of one of -multiple sessions. -.Sp -If \fBpam_setcred()\fR initializes a new ticket cache, it will also set up that -ticket cache so that it will be deleted when the PAM session is closed. -Normally, the calling program (\fBlogin\fR, \fBsshd\fR, etc.) will run the -user's shell as a sub-process, wait for it to exit, and then close the PAM -session, thereby cleaning up the user's session. -.IP session 4 -.IX Item "session" -Provides implementations of \fBpam_open_session()\fR, which is equivalent to -calling \fBpam_setcred()\fR with the PAM_ESTABLISH_CRED flag, and -\&\fBpam_close_session()\fR, which destroys the ticket cache created by -\&\fBpam_setcred()\fR. -.IP account 4 -.IX Item "account" -Provides an implementation of \fBpam_acct_mgmt()\fR. All it does is do the same -authorization check as performed by the \fBpam_authenticate()\fR implementation -described above. -.IP password 4 -.IX Item "password" -Provides an implementation of \fBpam_chauthtok()\fR, which implements password -changes. The user is prompted for their existing password (unless -configured to use an already entered one) and the PAM module then obtains -credentials for the special Kerberos principal \f(CW\*(C`kadmin/changepw\*(C'\fR. It -then prompts the user for a new password, twice to ensure that the user -entered it properly (again, unless configured to use an already entered -password), and then does a Kerberos password change. -.Sp +check will also be done using +.Xr krb5_kuserok 3 . +The default behavior of this function is to check the user's account for +a +.Pa .k5login +file and, if one is present, ensure that the user's principal is listed +in that file. +If +.Pa .k5login +is not present, the default check is to ensure that the user's principal +is in the default local realm and the user portion of the principal +matches the account name (this can be changed by configuring a custom +aname to localname mapping in +.Pa krb5.conf ; +see the Kerberos documentation for details). +This can be customized with several configuration options; see below. +.Pp +If the username provided to PAM contains an +.Qo Li @ Qc +and Kerberos can, treating the username as a principal, map it to a +local account name, +.Xr pam_authenticate 3 +will change the PAM user to that local account name. +This allows users to log in with their Kerberos principal and let +Kerberos do the mapping to an account. +This can be disabled with the +.Em no_update_user +option. +Be aware, however, that this facility cannot be used with OpenSSH. +OpenSSH will reject usernames that don't match local accounts before +this remapping can be done and will pass an invalid password to the PAM +module. +Also be aware that several other common PAM modules, such as +pam_securetty, expect to be able to look up the user with +.Xr getpwnam 3 +and cannot be called before pam_krb5 when using this feature. +.Pp +When +.Xr pam_setcred 3 +is called to initialize a new ticket cache, the environment variable +KRB5CCNAME is set to the path to that ticket cache. +By default, the cache will be named +.Pa /tmp/krb5cc_UID_RANDOM +where UID is the user's UID and RANDOM is six randomly-chosen letters. +This can be configured with the +.Em ccache +and +.Em ccache_dir +options. +.Pp +pam-krb5 does not use the default ticket cache location or +.Em default_cc_name +in the +.Qo Li [libdefaults] Qc +section of +.Pa krb5.conf . +The default cache location would share a cache for all sessions of the +same user, which causes confusing behavior when the user logs out of one +of multiple sessions. +.Pp +If +.Xr pam_setcred 3 +initializes a new ticket cache, it will also set up that ticket cache so +that it will be deleted when the PAM session is closed. +Normally, the calling program +.Pf ( Sy login , +.Sy sshd , +etc.) +will run the user's shell as a sub-process, wait for it to exit, and +then close the PAM session, thereby cleaning up the user's session. +.It session +Provides implementations of +.Xr pam_open_session 3 , +which is equivalent to calling +.Xr pam_setcred 3 +with the PAM_ESTABLISH_CRED flag, and +.Xr pam_close_session 3 , +which destroys the ticket cache created by +.Xr pam_setcred 3 . +.It account +Provides an implementation of +.Xr pam_acct_mgmt 3 . +All it does is do the same authorization check as performed by the +.Xr pam_authenticate 3 +implementation described above. +.It password +Provides an implementation of +.Xr pam_chauthtok 3 , +which implements password changes. +The user is prompted for their existing password (unless configured to +use an already entered one) and the PAM module then obtains credentials +for the special Kerberos principal +.Qo Li kadmin/changepw Qc . +It then prompts the user for a new password, twice to ensure that the +user entered it properly (again, unless configured to use an already +entered password), and then does a Kerberos password change. +.Pp Passwords as long or longer than PAM_MAX_RESP_SIZE octets (normally 512 -octets) will be rejected, since excessively long passwords can be used as -a denial of service attack. -.Sp -Unlike the normal Unix password module, this module will allow any user to -change any other user's password if they know the old password. Also, -unlike the normal Unix password module, root will always be prompted for -the old password, since root has no special status in Kerberos. (To -change passwords in Kerberos without knowing the old password, use -\&\fBkadmin\fR\|(8) instead.) -.PP +octets) will be rejected, since excessively long passwords can be used +as a denial of service attack. +.Pp +Unlike the normal Unix password module, this module will allow any user +to change any other user's password if they know the old password. +Also, unlike the normal Unix password module, root will always be +prompted for the old password, since root has no special status in +Kerberos. +(To change passwords in Kerberos without knowing the old password, use +kadmin(8) instead.) +.El +.Pp Both the account and session management calls of the Kerberos PAM module will return PAM_IGNORE if called in the context of a PAM session for a -user who did not authenticate with Kerberos (a return code of \f(CW\*(C`ignore\*(C'\fR in -the Linux PAM configuration language). -.PP +user who did not authenticate with Kerberos (a return code of +.Qo Li ignore Qc +in the Linux PAM configuration language). +.Pp Note that this module assumes the network is available in order to do a -Kerberos authentication. If the network is not available, some Kerberos -libraries have timeouts longer than the timeout imposed by the login -process. This means that using this module incautiously can make it -impossible to log on to console as root. For this reason, you should -always use the \fIignore_root\fR or \fIminimum_uid\fR options, list a local -authentication module such as \fBpam_unix\fR first with a control field of -\&\f(CW\*(C`sufficient\*(C'\fR so that the Kerberos PAM module will be skipped if local -password authentication was successful. -.PP -This is not the same PAM module as the Kerberos PAM module available from -Sourceforge, or the one included on Red Hat systems. It supports many of -the same options, has some additional options, and doesn't support some of -the options those modules do. -.SH CONFIGURATION -.IX Header "CONFIGURATION" -The Kerberos PAM module takes many options, not all of which are relevant -to every PAM group; options that are not relevant will be silently -ignored. Any of these options can be set in the PAM configuration as -arguments listed after \f(CW\*(C`pam_krb5.so\*(C'\fR. Some of the options can also be -set in the system \fIkrb5.conf\fR file; if this is possible, it will be noted -below in the option description. -.PP -To set a boolean option in the PAM configuration file, just give the name -of the option in the arguments. To set an option that takes an argument, -follow the option name with an equal sign (=) and the value, with no -separating whitespace. Whitespace in option arguments is not supported in -the PAM configuration. -.PP -To set an option for the PAM module in the system \fIkrb5.conf\fR file, put -that option in the \f(CW\*(C`[appdefaults]\*(C'\fR section. All options must be followed -by an equal sign (=) and a value, so for boolean options add \f(CW\*(C`= true\*(C'\fR. +Kerberos authentication. +If the network is not available, some Kerberos libraries have timeouts +longer than the timeout imposed by the login process. +This means that using this module incautiously can make it impossible to +log on to console as root. +For this reason, you should always use the +.Em ignore_root +or +.Em minimum_uid +options, list a local authentication module such as +.Sy pam_unix +first with a control field of +.Qo Li sufficient Qc +so that the Kerberos PAM module will be skipped if local password +authentication was successful. +.Pp +This is not the same PAM module as the Kerberos PAM module available +from Sourceforge, or the one included on Red Hat systems. +It supports many of the same options, has some additional options, and +doesn't support some of the options those modules do. +.Sh CONFIGURATION +The Kerberos PAM module takes many options, not all of which are +relevant to every PAM group; options that are not relevant will be +silently ignored. +Any of these options can be set in the PAM configuration as arguments +listed after +.Qo Li pam_krb5.so Qc . +Some of the options can also be set in the system +.Pa krb5.conf +file; if this is possible, it will be noted below in the option +description. +.Pp +To set a boolean option in the PAM configuration file, just give the +name of the option in the arguments. +To set an option that takes an argument, follow the option name with an +equal sign (=) and the value, with no separating whitespace. +Whitespace in option arguments is not supported in the PAM +configuration. +.Pp +To set an option for the PAM module in the system +.Pa krb5.conf +file, put that option in the +.Qo Li [appdefaults] Qc +section. +All options must be followed by an equal sign (=) and a value, so for +boolean options add +.Qo Li = true Qc . The Kerberos PAM module will look for options either at the top level of -the \f(CW\*(C`[appdefaults]\*(C'\fR section or in a subsection named \f(CW\*(C`pam\*(C'\fR, inside or -outside a section for the realm. For example, the following fragment of a -\&\fIkrb5.conf\fR file would set \fIforwardable\fR to true, \fIminimum_uid\fR to -1000, and set \fIignore_k5login\fR only if the realm is EXAMPLE.COM. -.PP -.Vb 8 -\& [appdefaults] -\& forwardable = true -\& pam = { -\& minimum_uid = 1000 -\& EXAMPLE.COM = { -\& ignore_k5login = true -\& } -\& } -.Ve -.PP -For more information on the syntax of \fIkrb5.conf\fR, see \fBkrb5.conf\fR\|(5). -Note that options that depend on the realm will be set only on the basis -of the default realm, either as configured in \fBkrb5.conf\fR\|(5) or as set by -the \fIrealm\fR option described below. If the user authenticates to an -account qualified with a realm, that realm will not be used when -determining which options will apply. -.PP -There is no difference to the PAM module whether options are specified at -the top level or in a \f(CW\*(C`pam\*(C'\fR section; the \f(CW\*(C`pam\*(C'\fR section is supported in -case there are options that should be set for the PAM module but not for -other applications. -.PP -If the same option is set in \fIkrb5.conf\fR and in the PAM configuration, -the latter takes precedent. Note, however, that due to the configuration -syntax, there's no way to turn off a boolean option in the PAM -configuration that was turned on in \fIkrb5.conf\fR. -.PP +the +.Qo Li [appdefaults] Qc +section or in a subsection named +.Qo Li pam Qc , +inside or outside a section for the realm. +For example, the following fragment of a +.Pa krb5.conf +file would set +.Em forwardable +to true, +.Em minimum_uid +to 1000, and set +.Em ignore_k5login +only if the realm is EXAMPLE.COM. +.Bd -literal + [appdefaults] + forwardable = true + pam = { + minimum_uid = 1000 + EXAMPLE.COM = { + ignore_k5login = true + } + } +.Ed +.Pp +For more information on the syntax of +.Pa krb5.conf , +see krb5.conf(5). Note that options that depend on the realm will be set +only on the basis of the default realm, either as configured in +krb5.conf(5) or as set by the +.Em realm +option described below. +If the user authenticates to an account qualified with a realm, that +realm will not be used when determining which options will apply. +.Pp +There is no difference to the PAM module whether options are specified +at the top level or in a +.Qo Li pam Qc +section; the +.Qo Li pam Qc +section is supported in case there are options that should be set for +the PAM module but not for other applications. +.Pp +If the same option is set in +.Pa krb5.conf +and in the PAM configuration, the latter takes precedent. +Note, however, that due to the configuration syntax, there's no way to +turn off a boolean option in the PAM configuration that was turned on in +.Pa krb5.conf . +.Pp The start of each option description is annotated with the version of -pam\-krb5 in which that option was added with the current meaning. -.SS Authorization -.IX Subsection "Authorization" -.IP alt_auth_map= 4 -.IX Item "alt_auth_map=" -[3.12] This functions similarly to the \fIsearch_k5login\fR option. The - argument is used as the authentication Kerberos principal, with -any \f(CW%s\fR in replaced with the username. If the username -contains an \f(CW\*(C`@\*(C'\fR, only the part of the username before the realm is used -to replace \f(CW%s\fR. If contains a realm, it will be used; -otherwise, the realm of the username (if any) will be appended to the -result. There is no quote removal. -.Sp +pam-krb5 in which that option was added with the current meaning. +.Ss Authorization +.Bl -tag -width Ds +.It allow_kdc_spoof +Allow authentication to succeed even if there is no host or service key +available in a keytab to authenticate the Kerberos KDC's ticket. +.It alt_auth_map= +[3.12] This functions similarly to the +.Em search_k5login +option. +The argument is used as the authentication Kerberos principal, +with any +.Qo Li %s Qc +in replaced with the username. +If the username contains an +.Qo Li @ Qc , +only the part of the username before the realm is used to replace +.Qo Li %s Qc . +If contains a realm, it will be used; otherwise, the realm of +the username (if any) will be appended to the result. +There is no quote removal. +.Pp If this option is present, the default behavior is to try this alternate principal first and then fall back to the standard behavior if it fails. The primary usage is to allow alternative principals to be used for -authentication in programs like \fBsudo\fR. Most examples will look like: -.Sp -.Vb 1 -\& alt_auth_map=%s/root -.Ve -.Sp +authentication in programs like +.Sy sudo . +Most examples will look like: +.Bd -literal + alt_auth_map=%s/root +.Ed +.Pp which attempts authentication as the root instance of the username first -and then falls back to the regular username (but see \fIforce_alt_auth\fR and -\&\fIonly_alt_auth\fR). -.Sp +and then falls back to the regular username (but see +.Em force_alt_auth +and +.Em only_alt_auth Ns ). +.Pp This option also allows a cheap way to attempt authentication in an -alternative realm first and then fall back to the primary realm. A -setting like: -.Sp -.Vb 1 -\& alt_auth_map=%s@EXAMPLE.COM -.Ve -.Sp +alternative realm first and then fall back to the primary realm. +A setting like: +.Bd -literal + alt_auth_map=%s@EXAMPLE.COM +.Ed +.Pp will attempt authentication in the EXAMPLE.COM realm first and then fall -back on the local default realm. This is more convenient than running the -module multiple times with multiple default realms set with \fIrealm\fR, but -it is very limited: only two realms can be tried, and the alternate realm -is always tried first. -.Sp -This option can be set in \f(CW\*(C`[appdefaults]\*(C'\fR in \fIkrb5.conf\fR, although -normally it doesn't make sense to do that; normally it is used in the PAM -options of configuration for specific programs. It is only applicable to -the auth and account groups. If this option is set for the auth group, be -sure to set it for the account group as well or account authorization may -fail. -.IP force_alt_auth 4 -.IX Item "force_alt_auth" -[3.12] This option is used with \fIalt_auth_map\fR and forces authentication -as the mapped principal if that principal exists in the KDC. Only if the -KDC returns principal unknown does the Kerberos PAM module fall back to -normal authentication. This can be used to force authentication with an -alternate instance. If \fIalt_auth_map\fR is not set, it has no effect. -.Sp -This option can be set in \f(CW\*(C`[appdefaults]\*(C'\fR in \fIkrb5.conf\fR and is only -applicable to the auth group. -.IP ignore_k5login 4 -.IX Item "ignore_k5login" -[2.0] Never look for a \fI.k5login\fR file in the user's home directory. -Instead, only check that the Kerberos principal maps to the local account -name. The default check is to ensure the realm matches the local realm -and the user portion of the principal matches the local account name, but -this can be customized by setting up an aname to localname mapping in -\&\fIkrb5.conf\fR. -.Sp -This option can be set in \f(CW\*(C`[appdefaults]\*(C'\fR in \fIkrb5.conf\fR and is only -applicable to the auth and account groups. -.IP ignore_root 4 -.IX Item "ignore_root" -[1.1] Do not do anything if the username is \f(CW\*(C`root\*(C'\fR. The authentication -and password calls will silently fail (allowing that status to be ignored -via a control of \f(CW\*(C`optional\*(C'\fR or \f(CW\*(C`sufficient\*(C'\fR), and the account and -session calls (including pam_setcred) will return PAM_IGNORE, telling the -PAM library to proceed as if they weren't mentioned in the PAM -configuration. This option is supported and will remain, but normally you -want to use \fIminimum_uid\fR instead. -.Sp -This option can be set in \f(CW\*(C`[appdefaults]\*(C'\fR in \fIkrb5.conf\fR. -.IP minimum_uid= 4 -.IX Item "minimum_uid=" -[2.0] Do not do anything if the authenticated account name corresponds to -a local account and that local account has a UID lower than . If +back on the local default realm. +This is more convenient than running the module multiple times with +multiple default realms set with +.Em realm , +but it is very limited: only two realms can be tried, and the alternate +realm is always tried first. +.Pp +This option can be set in +.Qo Li [appdefaults] Qc +in +.Pa krb5.conf , +although normally it doesn't make sense to do that; normally it is used +in the PAM options of configuration for specific programs. +It is only applicable to the auth and account groups. +If this option is set for the auth group, be sure to set it for the +account group as well or account authorization may fail. +.It force_alt_auth +[3.12] This option is used with +.Em alt_auth_map +and forces authentication as the mapped principal if that principal +exists in the KDC. Only if the KDC returns principal unknown does the +Kerberos PAM module fall back to normal authentication. +This can be used to force authentication with an alternate instance. +If +.Em alt_auth_map +is not set, it has no effect. +.Pp +This option can be set in +.Qo Li [appdefaults] Qc +in +.Pa krb5.conf +and is only applicable to the auth group. +.It ignore_k5login +[2.0] Never look for a +.Pa .k5login +file in the user's home directory. +Instead, only check that the Kerberos principal maps to the local +account name. +The default check is to ensure the realm matches the local realm and the +user portion of the principal matches the local account name, but this +can be customized by setting up an aname to localname mapping in +.Pa krb5.conf . +.Pp +This option can be set in +.Qo Li [appdefaults] Qc +in +.Pa krb5.conf +and is only applicable to the auth and account groups. +.It ignore_root +[1.1] Do not do anything if the username is +.Qo Li root Qc . +The authentication and password calls will silently fail (allowing that +status to be ignored via a control of +.Qo Li optional Qc +or +.Qo Li sufficient Qc Ns ), +and the account and session calls (including pam_setcred) will return +PAM_IGNORE, telling the PAM library to proceed as if they weren't +mentioned in the PAM configuration. +This option is supported and will remain, but normally you want to use +.Em minimum_uid +instead. +.Pp +This option can be set in +.Qo Li [appdefaults] Qc +in +.Pa krb5.conf . +.It minimum_uid= +[2.0] Do not do anything if the authenticated account name corresponds +to a local account and that local account has a UID lower than . If both of those conditions are true, the authentication and password calls will silently fail (allowing that status to be ignored via a control of -\&\f(CW\*(C`optional\*(C'\fR or \f(CW\*(C`sufficient\*(C'\fR), and the account and session calls -(including pam_setcred) will return PAM_IGNORE, telling the PAM library to -proceed as if they weren't mentioned in the PAM configuration. -.Sp -Using this option is highly recommended if you don't need to use Kerberos -to authenticate password logins to the root account (which isn't -recommended since Kerberos requires a network connection). It provides -some defense in depth against user principals that happen to match a -system account incorrectly authenticating as that system account. -.Sp -This option can be set in \f(CW\*(C`[appdefaults]\*(C'\fR in \fIkrb5.conf\fR. -.IP only_alt_auth 4 -.IX Item "only_alt_auth" -[3.12] This option is used with \fIalt_auth_map\fR and forces the use of the -mapped principal for authentication. It disables fallback to normal -authentication in all cases and overrides \fIsearch_k5login\fR and -\&\fIforce_alt_auth\fR. If \fIalt_auth_map\fR is not set, it has no effect and -the standard authentication behavior is used. -.Sp -This option can be set in \f(CW\*(C`[appdefaults]\*(C'\fR in \fIkrb5.conf\fR and is only -applicable to the auth group. -.IP search_k5login 4 -.IX Item "search_k5login" +.Qo Li optional Qc +or +.Qo Li sufficient Qc Ns ), +and the account and session calls (including pam_setcred) will return +PAM_IGNORE, telling the PAM library to proceed as if they weren't +mentioned in the PAM configuration. +.Pp +Using this option is highly recommended if you don't need to use +Kerberos to authenticate password logins to the root account (which +isn't recommended since Kerberos requires a network connection). +It provides some defense in depth against user principals that happen to +match a system account incorrectly authenticating as that system +account. +.Pp +This option can be set in +.Qo Li [appdefaults] Qc +in +.Pa krb5.conf . +.It only_alt_auth +[3.12] This option is used with +.Em alt_auth_map +and forces the use of the mapped principal for authentication. +It disables fallback to normal authentication in all cases and overrides +.Em search_k5login +and +.Em force_alt_auth . +If +.Em alt_auth_map +is not set, it has no effect and the standard authentication behavior is +used. +.Pp +This option can be set in +.Qo Li [appdefaults] Qc +in +.Pa krb5.conf +and is only applicable to the auth group. +.It search_k5login [2.0] Normally, the Kerberos implementation of pam_authenticate attempts -to obtain tickets for the authenticating username in the local realm. If -this option is set and the local user has a \fI.k5login\fR file in their home -directory, the module will instead open and read that \fI.k5login\fR file, -attempting to use the supplied password to authenticate as each principal -listed there in turn. If any of those authentications succeed, the user -will be successfully authenticated; otherwise, authentication will fail. -This option is useful for allowing password authentication (via console or -\&\fBsshd\fR without GSS-API support) to shared accounts. If there is no -\&\fI.k5login\fR file, the behavior is the same as normal. Using this option -requires that the user's \fI.k5login\fR file be readable at the time of -authentication. -.Sp -This option can be set in \f(CW\*(C`[appdefaults]\*(C'\fR in \fIkrb5.conf\fR and is only -applicable to the auth group. -.SS "Kerberos Behavior" -.IX Subsection "Kerberos Behavior" -.IP anon_fast 4 -.IX Item "anon_fast" +to obtain tickets for the authenticating username in the local realm. +If this option is set and the local user has a +.Pa .k5login +file in their home directory, the module will instead open and read that +.Pa .k5login +file, attempting to use the supplied password to authenticate as each +principal listed there in turn. +If any of those authentications succeed, the user will be successfully +authenticated; otherwise, authentication will fail. +This option is useful for allowing password authentication (via console +or +.Sy sshd +without GSS-API support) to shared accounts. +If there is no +.Pa .k5login +file, the behavior is the same as normal. +Using this option requires that the user's +.Pa .k5login +file be readable at the time of authentication. +.Pp +This option can be set in +.Qo Li [appdefaults] Qc +in +.Pa krb5.conf +and is only applicable to the auth group. +.El +.Ss Kerberos Behavior +.Bl -tag -width Ds +.It anon_fast [4.6] Attempt to use Flexible Authentication Secure Tunneling (FAST) by -first authenticating as the anonymous user (WELLKNOWN/ANONYMOUS) and using -its credentials as the FAST armor. This requires anonymous PKINIT be -enabled for the local realm, that PKINIT be configured on the local -system, and that the Kerberos library support FAST and anonymous PKINIT. -.Sp -FAST is a mechanism to protect Kerberos against password guessing attacks -and provide other security improvements. To work, FAST requires that a -ticket be obtained with a strong key to protect exchanges with potentially -weaker user passwords. This option uses anonymous authentication to -obtain that key and then uses it to protect the subsequent authentication. -.Sp +first authenticating as the anonymous user (WELLKNOWN/ANONYMOUS) and +using its credentials as the FAST armor. +This requires anonymous PKINIT be enabled for the local realm, that +PKINIT be configured on the local system, and that the Kerberos library +support FAST and anonymous PKINIT. +.Pp +FAST is a mechanism to protect Kerberos against password guessing +attacks and provide other security improvements. +To work, FAST requires that a ticket be obtained with a strong key to +protect exchanges with potentially weaker user passwords. +This option uses anonymous authentication to obtain that key and then +uses it to protect the subsequent authentication. +.Pp If anonymous PKINIT is not available or fails, FAST will not be used and the authentication will proceed as normal. -.Sp +.Pp To instead use an existing ticket cache for the FAST credentials, use -\&\fIfast_ccache\fR instead of this option. If both \fIfast_ccache\fR and -\&\fIanon_fast\fR are set, the ticket cache named by \fIfast_ccache\fR will be -tried first, and the Kerberos PAM module will fall back on attempting -anonymous PKINIT if that cache could not be used. -.Sp -This option can be set in \f(CW\*(C`[appdefaults]\*(C'\fR in \fIkrb5.conf\fR and is only -applicable to the auth and password groups. -.Sp -The operation is the same as if using the \fIfast_ccache\fR option, but the -cache is created and destroyed automatically. If both \fIfast_ccache\fR and -\&\fIanon_fast\fR options are used, the \fIfast_ccache\fR takes precedent and no -anonymous authentication is done. -.IP fast_ccache= 4 -.IX Item "fast_ccache=" -[4.3] The same as \fIanon_fast\fR, but use an existing Kerberos ticket cache -rather than anonymous PKINIT. This allows use of FAST with a realm that -doesn't support PKINIT or doesn't support anonymous authentication. -.Sp +.Em fast_ccache +instead of this option. +If both +.Em fast_ccache +and +.Em anon_fast +are set, the ticket cache named by +.Em fast_ccache +will be tried first, and the Kerberos PAM module will fall back on +attempting anonymous PKINIT if that cache could not be used. +.Pp +This option can be set in +.Qo Li [appdefaults] Qc +in +.Pa krb5.conf +and is only applicable to the auth and password groups. +.Pp +The operation is the same as if using the +.Em fast_ccache +option, but the cache is created and destroyed automatically. +If both *** 1391 LINES SKIPPED *** From nobody Mon Nov 24 03:15:37 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dF9ty1r5Zz6HvvT for ; Mon, 24 Nov 2025 03:15: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dF9tx3sQKz3SvD for ; Mon, 24 Nov 2025 03:15:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763954137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O6vf58jAt44EeUlZGK00+JEqB+uVIpaxvFGCQAvKiz4=; b=FAAAzah7KyT3Q+YL1QdPFb05rwEYeAymHcG11aBhHxZf7jZAOtW+DWeO9WShFn1iJEI5NT wCXaDvv8mErxNy3Esl5jhc62wG0vQ/c1H69gJrbmO4OqV1VNGGDZmPJNsst0CRzGkBjAPN msULVzOlAnttvH35m5fvJ5qqdnX1QQ+hUXyhUgXKqUX/xv9i5D/zCsMiTM2H/D9oraEYA5 yf8PLIrz2BL9MdrrV+jgXMOcYIcnInU1jga9YOCzegHuaMGo2qFXzROP5U45m2yPJtIazH JWDzGRV1+1P4121A58uoIzoHh8DI6LvvOoo0Bl5ipr5+ctbLduTGzyJIXM4dvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763954137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O6vf58jAt44EeUlZGK00+JEqB+uVIpaxvFGCQAvKiz4=; b=l2bKkm9EpImbk2bLxg3xX9PM9BnfYq6Y/U0ZrJgyrqD2FtwZyrNxYMXX3PRC1aLbFXRYPl L8TxDcwMki5qnPkm1K3qXafoF+hn3yjEKOrlyAdrIZs+rqYtLohRdDCHTmhDuF0IzqsCQr Kokn1piWj6ZsGLeeY0JqPWjbDY1XHu3a9isAZDWufPYk56b49cAhNJq+74VQCMSDpTsxMP hsXKyJydVUeCUeMHFGuQ4nn4UKIlJsaryx6KHMwFmc5cMHpSy2lo+7Qe5JltiLqRz+jXzK xBQ60r6Mk3zPZeI0uJoDVQ6EMu4KpbnG8HTtXvaTKpMBLkMroQ4BbwXHme5CSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763954137; a=rsa-sha256; cv=none; b=ElHkKQ9kgtRVQtgtHCzm2Ja/eVqP8Smy5p2GPRsd9jIBnYfpO0Te7RE+jmYblGkoCAb5DI B2Hf2MeaoXU9uQGVlmmS+JzEd9UFQR98R7C7g80YGT6oyKLB2QAC6aijLEViIEKSu9G7qe Pjua3S5oUoMu4/jGN4a4eV6uZdFUqO2KShxUy5QhRqyaBRuye42M9ce074o4Lfu0wUqbf+ hqc4Rys/hcu47b8Vj9kO9eMrJ8Q75uPn/jVIbFBBFgG65+WSjORnixoPMEDYzJ5GLSCH+M HLJdqXpsHRnxaeC8jo2JPtMrMdiGHXxw2MXEdvjm4Dq3wwuXCGk5EI/G55cBkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dF9tx3GSYzx9X for ; Mon, 24 Nov 2025 03:15:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 30c52 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 24 Nov 2025 03:15:37 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 1773d3d5d4c8 - stable/15 - ObsoleteFiles: Fix typo in recent entry List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 1773d3d5d4c8d641cd03dcfd92745d9220501a46 Auto-Submitted: auto-generated Date: Mon, 24 Nov 2025 03:15:37 +0000 Message-Id: <6923cdd9.30c52.3aa36c9d@gitrepo.freebsd.org> The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=1773d3d5d4c8d641cd03dcfd92745d9220501a46 commit 1773d3d5d4c8d641cd03dcfd92745d9220501a46 Author: Dag-Erling Smørgrav AuthorDate: 2025-11-24 03:14:39 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-11-24 03:14:39 +0000 ObsoleteFiles: Fix typo in recent entry Fixes: feb8971db4b1 ("pcic.4: Remove stale manual") --- ObsoleteFiles.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index ce6319ce0d7a..0a35f9c33f8b 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -55,8 +55,8 @@ OLD_FILES+=usr/share/man/man8/pam-krb5.8.gz # 20251112: Remove pccard(4) and related -OLD_FILES+=share/man/man4/pccard.4.gz -OLD_FILES+=share/man/man4/pcic.4.gz +OLD_FILES+=usr/share/man/man4/pccard.4.gz +OLD_FILES+=usr/share/man/man4/pcic.4.gz # 20251006: Remove libnss_tacplus.a (it never should have been installed) OLD_FILES+=usr/lib/libnss_tacplus.a From nobody Mon Nov 24 03:59:46 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dFBst4235z6HyMs for ; Mon, 24 Nov 2025 03:59: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFBst32rBz3Y36 for ; Mon, 24 Nov 2025 03:59:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763956786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xxiobMs06Gb3+ngOcayuSj3Y2WaADEHRPQnXitGuVM4=; b=jz1iVfFIDcIeGjnvW3XB4ZglYaIbE50PNCe1+aYqjTuGJ6wDvkL5IbSjpEVoKfqoMvpvBo L3f5d8CsQmy7d2qPRgliwelL0jvXk+1FwLwMtj0drwLPdXkPVvbfdHv8AFDnZdltIzhiS6 XXbsLy81O4+mq1Es4p3VvxjQi0PkMqSm66puuQDYcQAOLAe7Jcxwb/3C9hRxBu1g4J29v3 DK5ddE6N/yywZGPFjIYb0zrlHPneG/phoQhvI/udGFlFlGXk7HCfc0NpDBxztFagtwtSWH NQh+e+6ncTRRa623E31maR2QZ1Rs3yy4gtFmihNKgcGS/Wqc/OK5ZF95d5VAyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763956786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xxiobMs06Gb3+ngOcayuSj3Y2WaADEHRPQnXitGuVM4=; b=Xmx3WV2fRjTLWYRSCP+FVAE3m+M/GeD1itK78qZzPLiXdIcbwEEfQIe7zgjahOOKzbW5V4 lZCjuV5BDOyW6seSvZxaaGbxyI8eIqbmvtRe+7PhOsl7ItB5xqNb8rf7nAAXWrkSftKNRj qiGOcIKS8hjHMgHekriKtpoKtjqDn/i7XbtG/GP/WlPlzDoXgzpGi6kLldYGpEahhGpqCd B3Irl1cBxGwa/VA1SzktXU4d1TKoEIWC3x5qoHXRRRXsDFG3r97ZRc4sujkrg5k9WT3XCj PX4jjMgukpalWSAZXNrxtjVvkOO+zk3H1kWzkKGnk1iU59IokdS+SW0a6WzcqQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763956786; a=rsa-sha256; cv=none; b=aJIUyY1epQUNqanBf904IfX33likrxxMWCZUNv2pilQ0B8oBzKCIf36gZBlxivdzY0Zrhf pNXflocmx/MlfHNb0JD6c/MqoaLbHi+Nl7G1WdQLkGUFKdrTJeYHm3GX/slyhGky/kGGap AWInsBl0gmfepdDKTD0Aptwqq81ms1a5nY6xw5f4nLGXHQtX1zDqwO+bGnmzJ9KsWvh6g+ FoCGQe54CU8Xh9PAUYwALz+7txym+W6YI766JkzJrSqNuBvpidPtnJ+4ylEi7c4UQo5M8C FMHT2I49Si56XfMPHkyep5tl41z1xkTQqV+8Ik0yCvgolAhHuyWHcOho25UmNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFBst2C86zxfv for ; Mon, 24 Nov 2025 03:59:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3389a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 24 Nov 2025 03:59:46 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 383ad19726a8 - stable/15 - ntpd: Fix segfault when same IP on multiple interfaces List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 383ad19726a8778b9ed7440ea917253366c3a811 Auto-Submitted: auto-generated Date: Mon, 24 Nov 2025 03:59:46 +0000 Message-Id: <6923d832.3389a.72364595@gitrepo.freebsd.org> The branch stable/15 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=383ad19726a8778b9ed7440ea917253366c3a811 commit 383ad19726a8778b9ed7440ea917253366c3a811 Author: Cy Schubert AuthorDate: 2025-11-21 00:16:04 +0000 Commit: Cy Schubert CommitDate: 2025-11-24 03:59:36 +0000 ntpd: Fix segfault when same IP on multiple interfaces Use the protype socket to obtain the IP address for an error message. Using the resultant socket address, a NULL because create_interface() had failed, results in SIGSEGV. To reproduce this bug, ifconfig bridge100 create ifconfig bridge100 10.10.10.10/24 ifconfig bridge101 create ifconfig bridge101 10.10.10.10/24 ntpd -n PR: 291119 MFC after: 3 days (cherry picked from commit ac1f48b4a7be104d222dea60f1da946fcb345fb1) --- contrib/ntp/ntpd/ntp_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/ntp/ntpd/ntp_io.c b/contrib/ntp/ntpd/ntp_io.c index 9c4f6c1553e3..97b85ee83e36 100644 --- a/contrib/ntp/ntpd/ntp_io.c +++ b/contrib/ntp/ntpd/ntp_io.c @@ -1923,7 +1923,7 @@ update_interfaces( msyslog(LOG_ERR, "cannot bind address %s", - stoa(&ep->sin)); + stoa(&ep2->sin)); } free(ep2); } From nobody Mon Nov 24 04:00:23 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dFBtc0SLnz6Hyls for ; Mon, 24 Nov 2025 04:00: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFBtb58B6z3YYm for ; Mon, 24 Nov 2025 04:00:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763956823; h=from:from:reply-to:subject:subject: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+kLXdgcSaYM8xGagmMA7QYsCC1Zb5ean0pSxBCcZK4=; b=f/wcvYl82BnLQ6URvyV+ZLt8P2a69pTjkzN5hC26vNvP7Vyli9PNfQwqVICXmZOxrgx9k4 1JG4llmnLE+3KlgNUhUX4ZTpFFGrdjekXK28u78fbt+cuw0VpB09ldx9qeRfkWsnShqwJ6 GrHAnci05K+jJPVEgZUlnygNQE6Nx91i3ZznHIkjt1xyjACso3y3m5AJoAZyKXoGNfm+so wECI6JD0ui1WC/Q0AOYAqeVXkIrTBNOVbiigYbRC0a4+FDrHVlrq+EzaZWIxRs36DXoNLp M/sbvxMl/bGNKUKcniHE0JaKCp6kDIPVW3AL/XZQ8YMoH0mFlWYcUWcZ0Etefw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763956823; h=from:from:reply-to:subject:subject: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+kLXdgcSaYM8xGagmMA7QYsCC1Zb5ean0pSxBCcZK4=; b=aVvC+ZN9CRyRmGgDHQQfgW6jJ+eREpiwTOxJD94DDzqTo5D/CRKs1yogv0GzZwvBiz9fHT KHNo5Uq9ENxy4sjSe9y1IzaBlG3w8W+KIqpfBSXgCOYZCB8nJJ4kuRRbaKNfOO0U54ipK9 t58VUlH18+t2vhToNNFToyG7NFdfw9UF1A5ckmomKlcPg7578qUMnJ49EiTxyJHfdDhOAw ACAEmb8pLwPhryzf5Ymbxhs9LpM94F+dopuDH4ZAgoxbThOw41520AuEp/VoYGtkTSo4rY cH1fVAa1PBV9MUKCcijMV1XDhUT9dcNxJW5lCQTBmBiEZ4IKHiZs/QGWiCHcCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763956823; a=rsa-sha256; cv=none; b=ksSypVRKh3GZVWcz34wsEq1F3mlOUzB5EtETA4ItDzi8bwW9ZVbcx0taoFIaQKpOzmU7+c 1/xYJ7XBxa3i+l5TeWYh/XEMD/dI6qZGjiahOQf9ETzVAHSnp+34Y+uF1UKKscRGhghKqF p/H+nk3MtuwLxy/gBL7o1H2YRkwR8Sf0aVWkLbUocVWQJ2cvvQ63gnfdlY3aefjK32K6GP dsJkNRyuga17kItotK8neKUvnqHOiU9eHpfXQ21aqJbM8g+n7vqDs/P7Te0pYvr0r6Jb0Y sB17fn0AF7KQoZozORWqbeNncEkVH/76mAD5DnX6ErNOFuUgJdN7kFUyLtuzjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFBtb4b0hzy8y for ; Mon, 24 Nov 2025 04:00:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 338cb by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 24 Nov 2025 04:00:23 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 25587b30c30a - stable/14 - ntpd: Fix segfault when same IP on multiple interfaces List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 25587b30c30afe8219c2cd34d8e3877418a3612e Auto-Submitted: auto-generated Date: Mon, 24 Nov 2025 04:00:23 +0000 Message-Id: <6923d857.338cb.6f1ebea2@gitrepo.freebsd.org> The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=25587b30c30afe8219c2cd34d8e3877418a3612e commit 25587b30c30afe8219c2cd34d8e3877418a3612e Author: Cy Schubert AuthorDate: 2025-11-21 00:16:04 +0000 Commit: Cy Schubert CommitDate: 2025-11-24 04:00:14 +0000 ntpd: Fix segfault when same IP on multiple interfaces Use the protype socket to obtain the IP address for an error message. Using the resultant socket address, a NULL because create_interface() had failed, results in SIGSEGV. To reproduce this bug, ifconfig bridge100 create ifconfig bridge100 10.10.10.10/24 ifconfig bridge101 create ifconfig bridge101 10.10.10.10/24 ntpd -n PR: 291119 (cherry picked from commit ac1f48b4a7be104d222dea60f1da946fcb345fb1) --- contrib/ntp/ntpd/ntp_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/ntp/ntpd/ntp_io.c b/contrib/ntp/ntpd/ntp_io.c index 9c4f6c1553e3..97b85ee83e36 100644 --- a/contrib/ntp/ntpd/ntp_io.c +++ b/contrib/ntp/ntpd/ntp_io.c @@ -1923,7 +1923,7 @@ update_interfaces( msyslog(LOG_ERR, "cannot bind address %s", - stoa(&ep->sin)); + stoa(&ep2->sin)); } free(ep2); } From nobody Mon Nov 24 04:00:51 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dFBv75WBfz6Hym0 for ; Mon, 24 Nov 2025 04:00: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFBv74nfcz3Yk9 for ; Mon, 24 Nov 2025 04:00:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763956851; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vha3MCOwfmXj0uVyc5dT09OjMMASdf7/fxCPXLZ5TlA=; b=wRO/B3T/OTi4zfm5Q3OEDDoqdPP4mrxHEkS6pmkxxrZa5hmeFHMUpONG9IEUnxNqX0MzWi s0FG61NTRNkolrfbm5WyY+W8zKpU0qsFTaAv0xRlOfG10jNvJNer4RTpX72WQN+xl7r8O/ r/2/IK81SaWBVqjGTTzfLZwQVlnYjn3eHGzQWPJI9cSJdw3V7n6+EXiFVzLp8BpVaek8aA I6BkU0/0WBAMX+hlnwks6L3WCGRAXTGESCU90wWi3avyzuF/mCH+Ug58fW+MM5qjlBqbRX fvYUFo8MYCZDmSiip2mGJfGP/Y4tbr3fAFZUJj97wi5xMOF/e/hmiLdWKmhNtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763956851; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vha3MCOwfmXj0uVyc5dT09OjMMASdf7/fxCPXLZ5TlA=; b=LVSDAeasOGnSZ+f7FE1+ppbLM5yfm4M97ZPOprjiXkGhmVpciUcgzRdt08zlMtZ/EjAtzj 1qfTfpC2B0gOxh3v0tTzlfbsWphPBL4AzUP30lzSPqqHADAqGsxo0g6JQ6N0sQNrlgk82y qCB20b0Pl5BkC0rYdcvugQsZpw9XIxApe31u9JcSIWy7wJ8NkzvYzQk3T92i+kZuCVsQ+W M5LRcwAkzhUwc2qgCoPrfbs3Gfnn09s6gU2/4Y0kiL+ny+gjJJc5YUle7a4xNi9nSgKWSV 1cgwXnHos+ukHKP4A+Sc8JmmXxGkZGxdnKrvIor8a7flxSVmW5QlWL7uJb8HBQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763956851; a=rsa-sha256; cv=none; b=bNr50Q7jnCni1mpyvxf+JUOrgxZjdMfuvlPPovh/C8HGiOHw27zhyqVEOR4qiTT6SnTvU8 ALA/sc2SBRZ2Pd14Ja8/7c3cWShKVNWnyKTlRl7MZkJ6rPa0h6YKRgECK/Pr5ABEkxdqAI BMOq1xU1SM1IxK9encaVHjydsbiLBo03B6KgjVdYiE9B3NkWMX2Jicw4itRqeFrENMtYit inuCf8rnvk0oaIi6HVfN/TY+ynpx5w3CVefy/rxEWGd2s9g7zGVcJ3H60Feo5eizar8b0E l5SZ/51NNeOThXBn+qkzuu5QjIUL7D7ofoJ2rKdyKpGTA9VXsUezf5xt1ZGJfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFBv743bQzyc3 for ; Mon, 24 Nov 2025 04:00:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 35d06 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 24 Nov 2025 04:00:51 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: d9c345c9d3ca - stable/13 - ntpd: Fix segfault when same IP on multiple interfaces List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d9c345c9d3cac00d055ca748e43b308861529a01 Auto-Submitted: auto-generated Date: Mon, 24 Nov 2025 04:00:51 +0000 Message-Id: <6923d873.35d06.150cfe7e@gitrepo.freebsd.org> The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=d9c345c9d3cac00d055ca748e43b308861529a01 commit d9c345c9d3cac00d055ca748e43b308861529a01 Author: Cy Schubert AuthorDate: 2025-11-21 00:16:04 +0000 Commit: Cy Schubert CommitDate: 2025-11-24 04:00:43 +0000 ntpd: Fix segfault when same IP on multiple interfaces Use the protype socket to obtain the IP address for an error message. Using the resultant socket address, a NULL because create_interface() had failed, results in SIGSEGV. To reproduce this bug, ifconfig bridge100 create ifconfig bridge100 10.10.10.10/24 ifconfig bridge101 create ifconfig bridge101 10.10.10.10/24 ntpd -n PR: 291119 (cherry picked from commit ac1f48b4a7be104d222dea60f1da946fcb345fb1) --- contrib/ntp/ntpd/ntp_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/ntp/ntpd/ntp_io.c b/contrib/ntp/ntpd/ntp_io.c index 9c4f6c1553e3..97b85ee83e36 100644 --- a/contrib/ntp/ntpd/ntp_io.c +++ b/contrib/ntp/ntpd/ntp_io.c @@ -1923,7 +1923,7 @@ update_interfaces( msyslog(LOG_ERR, "cannot bind address %s", - stoa(&ep->sin)); + stoa(&ep2->sin)); } free(ep2); } From nobody Mon Nov 24 05:59:36 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dFFX81jnFz6J7KC for ; Mon, 24 Nov 2025 05:59: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFFX80wrhz3lvd for ; Mon, 24 Nov 2025 05:59:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763963976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zcd1MVbsWyekdz9KhAX/h0hRLgiKIKOyNNSm6ud1ltY=; b=uzyWZ7JWdo/vHCV/H8jWnn85r2a4TiGM3VXemUwly15Wt3zgDmq4j40LophBlI3vdAxKpV cRU8CdJIyf1isNaFF7cb2u3CY0xMTa3TDO8vOQpnM7h4dmAnYe3WgjdiKKZDmMoaj8rkNm eGPaUmJl/7fEdi7ouFj9XlORmDcpCgVss+pkrkz6Xyk69+fnfYXt7X/TRpfil9W+Eqdg6N +Ntz/vcsJrw8lVXhtUMXkIxVInc8SsQXmOCjXV/333xv9/dBGn5+czTNBWG2/K115mZTru TfH3SHwm8itlG+Ubhmf9o+ofOmxN81EnSw0GnBp0D1p0bZ1n7otDGCG2IywO6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763963976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zcd1MVbsWyekdz9KhAX/h0hRLgiKIKOyNNSm6ud1ltY=; b=IF/b/KEuPY4KMIVRZdspIFbaPhuApy5No8KGRs6OBNwdv+v4qTuZJNL68krPycr3mQz8eL Odl1aJgPHle0fktVdGsn2WdrywLrR54cNNmruuk9Qy1D4Jn8Vj19BjlBoTzljgGAL3ujxV p1DSswf5BPJhVAQ7MkVvIhVLJBjwiA1uCNvGKbnDzByV47m7nQ29yEoEXoICPDwane9hhf SJrnCEIfdDyfmrV94gE2IkbaFmvYMQ7Vqn2YnVS6/h2SMaLAjyLZ8tN1qpdVzVYEhRccGc 7rBhnz9YUtU+y7vcRzsoXNYKRkBHAjjQc8ehnLU0gn8QoRzd9IDplEmoP2QEoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763963976; a=rsa-sha256; cv=none; b=iGNdEkVNmRFj2gIU3S4nlCwP8Wdwup/foRdlKqft+4gdLb3rueUMyIzbslpOv/SAeWOYqZ o72ISMVETXu5SRiU0jjy5hDKZxxaPASodCZLn1rPl1luJe5SSbGyJVhnT9/F5ya5I/8gAY uIuxm9/0znjxrL6u8CuQ6y9y/pM3eFDsmMCgFJNuvLH3qDN+9zgxCCvPdoWC7Oc0aWQh/n zDZadYOkSkAaG+0XY34idrj3RTQVoNlNQ1AQKqgOidI+7i86piuC5p16AwVQaV8ypFjcfG nyUtRClU4xkdLCALy+xbxkxXZA3oH7Xvl9LpzfM3V79q6B7dLxVdOvKQcetJeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFFX80S5sz12Rk for ; Mon, 24 Nov 2025 05:59:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 21308 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 24 Nov 2025 05:59:36 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 605c437af5da - stable/15 - ypldap(8): Fix a typo in a debug message List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 605c437af5da967e257afc0a16f56bb5efd8da53 Auto-Submitted: auto-generated Date: Mon, 24 Nov 2025 05:59:36 +0000 Message-Id: <6923f448.21308.47bd1037@gitrepo.freebsd.org> The branch stable/15 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=605c437af5da967e257afc0a16f56bb5efd8da53 commit 605c437af5da967e257afc0a16f56bb5efd8da53 Author: Gordon Bergling AuthorDate: 2025-11-19 14:31:13 +0000 Commit: Gordon Bergling CommitDate: 2025-11-24 05:58:15 +0000 ypldap(8): Fix a typo in a debug message - s/unexpect/unexpected/ (cherry picked from commit 843a4ad5814fe4344b245819880d423343b2d5ab) --- usr.sbin/ypldap/ldapclient.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/ypldap/ldapclient.c b/usr.sbin/ypldap/ldapclient.c index a246a25a9605..76918de90366 100644 --- a/usr.sbin/ypldap/ldapclient.c +++ b/usr.sbin/ypldap/ldapclient.c @@ -317,7 +317,7 @@ client_dispatch_parent(int fd, short events, void *p) client_configure(env); break; default: - log_debug("client_dispatch_parent: unexpect imsg %d", + log_debug("client_dispatch_parent: unexpected imsg %d", imsg.hdr.type); break; From nobody Mon Nov 24 05:59:38 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dFFXB2wZKz6J7DQ for ; Mon, 24 Nov 2025 05:59: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFFXB1cgVz3m3p for ; Mon, 24 Nov 2025 05:59:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763963978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DbOSqKtMWZIwKggAGmvWx1iKKrWMtgsG7NFo8kfKsgY=; b=mHIUSvlSBNc/iEKRDFC15w2q5DST+PpNa2LmcuB5f6toN8Glmvyn27iN3NLGIeayTI5c/5 JRnDpJ9EuM/53ngHjH7dZQajSByKtOqIMIzpCqrtJ8d/U4wMdQ/+gTCch0ISbQej0fytmr QMBwlPRbrr9oiqWkNqW2BuVBRlf6iFo1i6LzdWpvldiGsDgelQ3nMfwdzXAsFMzlhIgStt W3IYuxyMkkdHtrdkvqpXM3S6G7S7o4BjRCd27Qa8lWDKygEYGB/Dn72uszoX+0Ss+DEt2G zJXMK5i1UFju50wFDyz+bT5J/seGKpl8SsV6jQdPN5dSGpzOTIuistTtarvCJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763963978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DbOSqKtMWZIwKggAGmvWx1iKKrWMtgsG7NFo8kfKsgY=; b=phal3joRi1uWmiSQO+Puz8oz7po14Ad8hD1I9rae0v5evE2EcRD+ipKWh2FLjU88eqLNgx JRCrtE74cKMrsk97iHIfURQH/ssNx7vzpnDn39qU1Cs7lCYtdmRgCAl2RRY7DPhSRtp8QD mNEs5F2shB+irKR2r8NYrXF2dFXWya4/i6R0hh9qoa6jKfHWLr5QcYZ1g75Yv5QPjtf20L Mxe/bObGfEN+No9NI9P881YYECwgfnNWNwSSRNyvX5oMIWJfXziSc6sx8vMC21yA44qm2A d1TkH80kXhcyXEsQUdyK6bN4IVE2Zu5rsspbMsdt43sk5t9nYIv85swafaexog== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763963978; a=rsa-sha256; cv=none; b=tHeRKfdyn7CZeVBtTqB1u3gBqbw/9qnd871CRMoS6w2FgQtVQde7F1oIZh9Ng0NBMB2ntq i7RRHSyPrv6APFqk/QD4+QW8lXQ2ib445duB6zwJBUhgBE5yvAy+6w6NLiKoNXGksSFiXw ueS8BylggDq0Tv7wP79Yk9KCmFJ/QmYZL/VKVhl1Dk/OC/yTjwgZg0cAMSTN6DATGpHTgD DrY4gmgHhV9GzZ6/8UxxsEiJ1m4zmp7DxP5cAIPL+JF/Bei5FIogObc4J5FtGdI1ve9GHj A7AH+YFTQuavMr2bDlzb/tjrX8hk5oLCleo2kcIAShmA5f9KL/KXdCHniMHHLw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFFXB18D7z11vd for ; Mon, 24 Nov 2025 05:59:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id f64b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 24 Nov 2025 05:59:38 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 29edde7fda13 - stable/15 - lpr(1): Fix a typo in a debug message List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 29edde7fda13a02c3654687fbad9d067c3bda5a2 Auto-Submitted: auto-generated Date: Mon, 24 Nov 2025 05:59:38 +0000 Message-Id: <6923f44a.f64b.44f1fec5@gitrepo.freebsd.org> The branch stable/15 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=29edde7fda13a02c3654687fbad9d067c3bda5a2 commit 29edde7fda13a02c3654687fbad9d067c3bda5a2 Author: Gordon Bergling AuthorDate: 2025-11-19 14:30:02 +0000 Commit: Gordon Bergling CommitDate: 2025-11-24 05:58:48 +0000 lpr(1): Fix a typo in a debug message - s/unexpect/unexpected/ (cherry picked from commit 66d4a37bc389bf19ebf2210b0fff762baa659c32) --- usr.sbin/lpr/lpr/lpr.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/lpr/lpr/lpr.1 b/usr.sbin/lpr/lpr/lpr.1 index 8acb9d23d9da..b73870a0f46e 100644 --- a/usr.sbin/lpr/lpr/lpr.1 +++ b/usr.sbin/lpr/lpr/lpr.1 @@ -105,7 +105,7 @@ phototypesetter commands from ancient versions of .Xr troff 1 Pq Pa ports/textproc/groff . .It Fl v The files are assumed to contain a raster image for devices like the -Benson Varian. +Benson Variant. .El .Pp These options apply to the handling of From nobody Mon Nov 24 05:59:39 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dFFXC3cTnz6J7KM for ; Mon, 24 Nov 2025 05:59:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFFXC29sTz3lw1 for ; Mon, 24 Nov 2025 05:59:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763963979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m6FIpX40XByLNNM/ftQj6SkF+df0tnUF0D/qQiZ9HH4=; b=UiE546I5lLmLYTrhhPflRWureXmOiBRqyIbEDnIYTDOlo27kHIz1sjWEMxXvF/nx9P0Uj1 kQrZNP1EYpaZaDibBSl4+07mq7cFDQO3wXnVBYZG1DQmO/zFHySZZqle5HR4MAJrUcvo3w vB6hVwZpRjn13rJ66ZuCp0tOGA80l5y/6JQLHl9ouuz6uL9xskoZNcri6w4NpHMnCzqEyH uM2/GmfYB0vyDlFRtgCa6H5iLg/ai7Q1nXuKgkR5oWLvPtE2+upafMtYhOffHVW5M2PfCm 2ZaYAtoXD+XEUix+0nqDVobWm70ZaWZS4FWClKjHkT02xocbdy0vfZsc+g9jCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763963979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m6FIpX40XByLNNM/ftQj6SkF+df0tnUF0D/qQiZ9HH4=; b=N4S88uFR69OOZ+mh3Jem7eZj1nmvfmFfx3x+JQtnKATRfrJuMdClUzvKn5Szv4BxPJcXIs 2cKkKPzG4V5BCuZR3hEHuw9DTRUOprxqAKVX11jsRlZRD+VyyvzAQxuayQPcAOdOhlUt7U nBaWVPTAvqM8ZQpQQinqRdtSrW2AhuVN5dNYurmXqUPoqmQrfz0bAjzOM8k916uNgo7AYW HLy1kQeRSR2RWX0P0qSt2ycDBAJrDqf2pE6EWc9J9s5jRvJteADgv5a6tDvIVv+UHkIR0d e27j6Q81AUezPEh/LCsSr7o9UDduBsaBK0yZflzJsqDX52x9loMTVYsDsqkFvg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763963979; a=rsa-sha256; cv=none; b=G2RCFQf+lmTRIYYlM8IQqUxJ+SSNvD99RF3J3V7dJIBBviGpCIzjhmAZsmf+rSOOnfZgMp rCA9ciXxn5GMyshcwiBSZp/NFdpxW/KD9D8+ONNvbpcqQGG7uKRujo+Q5j4mMCXiHRyjd2 HAS5KeO+9+yj1yMbgVZb0ajfjjYD6G7IDuCgCfLXcrHZcvFRwqLG/DriY7CnI+SgU00vP7 J5qhX5p9x2y1d/wvRoDwlFCJQnG/rGBJRfMp8aExx6SZsgMJCxL91r5HVOB6V4/6tDIIgd LFSrPjNPe+JMZENyDWddlkIKBrpKLyB+By3durtAW3dSQXVEK23/+EqXjuicTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFFXC1VCcz11ft for ; Mon, 24 Nov 2025 05:59:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2152c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 24 Nov 2025 05:59:39 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: e44d079dacc4 - stable/15 - isp.4: Fix a typo in the manual page List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: e44d079dacc46e5c6f5e5b0562ddb178ae761792 Auto-Submitted: auto-generated Date: Mon, 24 Nov 2025 05:59:39 +0000 Message-Id: <6923f44b.2152c.6925f09a@gitrepo.freebsd.org> The branch stable/15 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=e44d079dacc46e5c6f5e5b0562ddb178ae761792 commit e44d079dacc46e5c6f5e5b0562ddb178ae761792 Author: Gordon Bergling AuthorDate: 2025-11-21 09:14:35 +0000 Commit: Gordon Bergling CommitDate: 2025-11-24 05:59:06 +0000 isp.4: Fix a typo in the manual page - s/Chanel/Channel/ (cherry picked from commit 8158b813d90f01368b2045709feee1980a323198) --- share/man/man4/isp.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/isp.4 b/share/man/man4/isp.4 index 6fea63fdd5d5..a8f985a59d09 100644 --- a/share/man/man4/isp.4 +++ b/share/man/man4/isp.4 @@ -85,7 +85,7 @@ It may be disabled using configuration and hint options described below. .Sh HARDWARE The .Nm -driver supports the following optical Fibre Chanel adapters: +driver supports the following optical Fibre Channel adapters: .Bl -column "Qlogic 2690/2692/2694 (2684/2692)" "Speed" "PCI-X" .It Model: Ta Speed: Ta Bus: .It Qlogic QLE2874 (2814) Ta 64Gb Ta PCIe From nobody Mon Nov 24 05:59:40 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dFFXF06TMz6J78D for ; Mon, 24 Nov 2025 05:59: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFFXD2dnhz3lwJ for ; Mon, 24 Nov 2025 05:59:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763963980; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WQYmkcIslYOILc2dHrrRBOTbB1tySebrHnieATFU4s4=; b=JucsoBLdWSLnAcpl6VSD2ccS/i4ytZoGZ0VyIcV/y6hLuDQRll09tytW6sip6R5//ZI/R6 9f0t1jTqxEnus8lJpkUQJQ5OcPLX0JHnYndwIeL1yZne+c+rEk6OKSdGuWrgZiwntzXdyL EJ/V9KFUKBe8GlRzsSNJo8aMV7g/nVTL7UcSvb4vQ+yf4pbO9mBBLT0hiuEh2QHcJlz4BO DMBjx8BB88xPr06YNNx2Ro+pZHMtZgranbFm4HXYc7FTr1kQct/13u7EuYmgyBI8CAkPP4 0wdJ+R1hwN2WiQFZ2rAdD3T4a37/vapATEBIN9u56uULbtmcb77r9Ld24PxmWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763963980; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WQYmkcIslYOILc2dHrrRBOTbB1tySebrHnieATFU4s4=; b=ObTcXIS7pnKhhR6K2DHxBwQ4dUph/xFluT6Pt2S67U6dU/N5PDzId1GPDkDnSt+JtUl3oq /gU1zaIh64xwUOSg4ywLftudk6v63qpsZHpA7PFu9DMjWBbBULe4J8CiIICwYel9KpM28s xJ8WLcrS+tPkBT/91Y3CFS5EOLHphy4C/4dyitUZjaFe0ekWb5vFcJ1A0ojJnKB+JzTm/O uU3t4XGuFZEqWZFqKq+L138rBqNKh558kHUZx6G8jMeTVqTpSu+kGUw/yYi/Yaef6SOxIj um3wAd19iD6xhCyQzrku4UyZWNphy3q4tB4CmF3TlZsq2MFOYuPU0d3XcnNFuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763963980; a=rsa-sha256; cv=none; b=olN/fAvuRnae4NswW7kHnx9Z+GQItaBd+Jh5tMm3xbKydmIADMdEjFpm2q54YTeuxvhjtD SwITpRS/ybNAR3a5YonMwJ9vfMfN4OBgWDvVQvQRLzP2kiVVh06KUtxsDnMUhpcxsO4gKQ +ZdOR/8YI/0G0nTaLKPXDRQu5UCHRZ5nQBimAEk5/Ykk0ujuVLUnd/lKGxD1SbFuldZTSt iozK3oXfxNi8qr0H9FsjTZs6F0/9gqUOt+V4FExCjmSlnJ3JOGf/ZhTeN5Q55VZGGgymjx JVZCfymjxCg+tODri/hC33uEI7gHP+PQ7eeKUoZm0wSS8kwmvMNp+4twrgqcxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFFXD1sbdz11sd for ; Mon, 24 Nov 2025 05:59:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id e443 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 24 Nov 2025 05:59:40 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 7f0bb9773e27 - stable/15 - snd_dummy.4: Fix a typo in the manual page List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 7f0bb9773e27e1d6b56e3899be59444537be9400 Auto-Submitted: auto-generated Date: Mon, 24 Nov 2025 05:59:40 +0000 Message-Id: <6923f44c.e443.37e1ab7a@gitrepo.freebsd.org> The branch stable/15 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=7f0bb9773e27e1d6b56e3899be59444537be9400 commit 7f0bb9773e27e1d6b56e3899be59444537be9400 Author: Gordon Bergling AuthorDate: 2025-11-21 09:13:39 +0000 Commit: Gordon Bergling CommitDate: 2025-11-24 05:59:22 +0000 snd_dummy.4: Fix a typo in the manual page - s/devic/device/ (cherry picked from commit bb3bfc7ca87ef9b2309bfac38aa0083727b27dc6) --- share/man/man4/snd_dummy.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/snd_dummy.4 b/share/man/man4/snd_dummy.4 index 172b8ed70729..5e9d8aa5dd89 100644 --- a/share/man/man4/snd_dummy.4 +++ b/share/man/man4/snd_dummy.4 @@ -60,7 +60,7 @@ Alias to the device's .Pa /dev/dsp%d file created by .Xr sound 4 . -This makes it easy for tests to open the dummy devic when there are more +This makes it easy for tests to open the dummy device when there are more devices present in the system. .El .Sh SEE ALSO From nobody Mon Nov 24 06:00:58 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dFFYl2GCMz6J7CC for ; Mon, 24 Nov 2025 06:00: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFFYl0CgQz3nTX for ; Mon, 24 Nov 2025 06:00:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763964059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XjBILa4PdRGS6UztPbGQ9fjQ8GEp07tuw1P7cU6gpWQ=; b=VeMTKyVTpufOPi4LQs1FAFM0l1NaPNp+ACp5ZL7H/UXqoZD5HrFooRnuvD49Ja31dZE297 nGX+r2IqtZz3UtluD4/F1VctVxryEvHzLCETnonwsLwNjMNpTua62cBaptgMi+RQgIqHbH Zvw1hLvKwCboKveU2TBj4rnkDbPJzRHL7yznw9bXxM+70TMWdouM9IG8BRRQNOCBsrxh3V aPPY20ZiwekZjHjciA9i/WFj5QitrAQr6DHLRfiLmHJHTVJGFagC2TFRE4FGuJ9qauiFnv 9tvcvMsjN2jLjKmN+YMwjhTxmep3r0hBje7ABfeZ3innM4YJLD30CvqoaxywAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763964059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XjBILa4PdRGS6UztPbGQ9fjQ8GEp07tuw1P7cU6gpWQ=; b=azRg/njllrHitbMVqKF+2VWo9IGj7HvD7lpyXJHtvvE/MrKZrR534PJnojKHDbxRo6XntK cYFx9Nof9zknYAglHvUTbwzhV0u+f5wGXfYPYgZw79Asl0/Qy+jGxU8GMn8uHwkeZTT/ql MJJxNeELT7UrgALPxGMkFG6MOegvLLVKRHb7/QdIn9gXMajB1vaOhgSSpzn2XxtZrso5JW xDND9dncwmlflxYoR949VPO9wKGW37C5NrI7B8crOid/HIxTkcjk3+90sdNRAJm5imH8hT TuvbR38Nfpy9VVwCGhn1k2oQ8ZVngGSwTxOINRydFp6tPfy0ls6qbIE/Z/QX7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763964059; a=rsa-sha256; cv=none; b=VBSZyE+JalQs914/zgp7zdMaFR0ecrud9JQvMQmYV5Y8oeBKWvJmOToD7Y0n97HP+9J4/9 grRdvBRw2dUw+Bg272RC2AFusrYUZ5EuSNII23360ESIKwt6QDDS4xQbLmHM63fchuNwUS fhGFTGqKSXLlZmUfvbE2dIcIuX0z+3/BorbI36mGbG7eTxhk//V2JqCkOVz43gXbS6N1lO oyS3is2Zurd4NBeomanxVtkc9H6sERpQJ2QktBsGk6R5t+QVVokOKGfKKI6neE6+6mOGdq c1B3fZ1MqCsKDyjOrNYR8DiIEu19l0ErSF3ja+XNeifYhclRanqMOKU88NP9uQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFFYk6psjz11vq for ; Mon, 24 Nov 2025 06:00:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2250a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 24 Nov 2025 06:00:58 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: ad81800724fb - stable/14 - mpool(3): Fix a typo in statistical message List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ad81800724fb078d8a99d7db82731f5e666c69ce Auto-Submitted: auto-generated Date: Mon, 24 Nov 2025 06:00:58 +0000 Message-Id: <6923f49a.2250a.8164a9a@gitrepo.freebsd.org> The branch stable/14 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=ad81800724fb078d8a99d7db82731f5e666c69ce commit ad81800724fb078d8a99d7db82731f5e666c69ce Author: Gordon Bergling AuthorDate: 2025-11-19 14:16:33 +0000 Commit: Gordon Bergling CommitDate: 2025-11-24 06:00:11 +0000 mpool(3): Fix a typo in statistical message - s/cacheing/caching/ (cherry picked from commit d76ea20f99965e8f3b9dbfcb41ca148711d528bb) --- lib/libc/db/mpool/mpool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/db/mpool/mpool.c b/lib/libc/db/mpool/mpool.c index feeea517315c..c1b5eba2d463 100644 --- a/lib/libc/db/mpool/mpool.c +++ b/lib/libc/db/mpool/mpool.c @@ -458,7 +458,7 @@ mpool_stat(MPOOL *mp) (void)fprintf(stderr, "%lu pages in the file\n", mp->npages); (void)fprintf(stderr, - "page size %lu, cacheing %lu pages of %lu page max cache\n", + "page size %lu, caching %lu pages of %lu page max cache\n", mp->pagesize, mp->curcache, mp->maxcache); (void)fprintf(stderr, "%lu page puts, %lu page gets, %lu page new\n", mp->pageput, mp->pageget, mp->pagenew); From nobody Mon Nov 24 06:01:00 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dFFYm3l6jz6J7CF for ; Mon, 24 Nov 2025 06:01: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFFYm16TBz3nMd for ; Mon, 24 Nov 2025 06:01:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763964060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NVrZcYw+WZhGOAWb25o9FFmSf1lfXpxa/d/Tb11XDHg=; b=mgGXN6ccbDkEK0gDb2X0EgqOOLcjkd/bpO1fCnZ2ebBB3K8B67diOC6Rprm3C2Ju85ZtzV Ovk1COg4fR09qh0/ibvTk0a1SPKzCLvZkwWSM2td+Uf4oA2v9DAPPEggFtHBzM3ULcF3Ht wZ22si+wFoo33ZXL+96wA4ynPHIF2L5RQIteppLHgEP2LVheCt/sbdLUFGAs/bWGcvgLx6 LZyCnRALkB3bRMzN8KrWXhxk0LhhhESIZ8kGFYoJQCcNxNrosav00hV9oo6/yOKeLFzfFt Na0pSRzp0i0yndLq9DE4vT3FK3QojXYFtCGbB4VxjjI56dPJdVzvlZIousS59A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763964060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NVrZcYw+WZhGOAWb25o9FFmSf1lfXpxa/d/Tb11XDHg=; b=kOXQow/q7sdt1sRP/GEQMPQO66U51sDFTOfNXubYbiBaE8xUOWN68UcJoXl+sA8beocabQ pKvYvI0ihqPZTYsvhBwRfuI777N9Q3zmodsZCI4RwpDuB2cQSKg6NuhPm7LPgI8uNH9zfN g4fLW6geKHxHRFP1FyTaVFZVoYEBgO/2ZZBUWTAvv/FFHuj2K+WAam4hH59YwfarMej/U6 BRabR3QppWeUEvkTVoMKi9wQ4RcRfUbsBsAaweQJeqaR4Q/SDtwfHWjywsZZz9tYA0QHXp c/2ORC/U93rt/Tp6o38AAJ75fuOLrDaVtF49SIvd63fyIAcakYF6zebSNc3JXw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763964060; a=rsa-sha256; cv=none; b=PxqM7tz/Bp2/G9b149ev38g/MD55eoEnjWNj8Skc8ULnskMxLNcweAJgreniDccPHVBEaH dDBR+7OHVIWk1pfzTjApRGCY4evckCbt/A0MK5eLip+L+ZV03+IIFqmlpTI6XMx96yZDcz m4Igbim8F6j5nB8Rz+S6iAyeXnj9m/s6iyrBiGg3vZpORhHwx2m9LnRzuU3n+TUU543yIZ gy95qTgMwlgkMFEOy4mrnVslovKBZESAJ+S9YJfmHcbsWyLHt89exjH1v0tsKSu5DsWIs+ V0AovwPPX1jKcLF0m1W5TrhrioMwEpmVsStk1k/6n4GLGCDGmSMzRNnkbGkqJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFFYm0W35z12S6 for ; Mon, 24 Nov 2025 06:01:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id f5e1 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 24 Nov 2025 06:01:00 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 37432fae629f - stable/14 - lpr(1): Fix a typo in a debug message List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 37432fae629f566a6dc5ae416fe98de5a5367c26 Auto-Submitted: auto-generated Date: Mon, 24 Nov 2025 06:01:00 +0000 Message-Id: <6923f49c.f5e1.6a055994@gitrepo.freebsd.org> The branch stable/14 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=37432fae629f566a6dc5ae416fe98de5a5367c26 commit 37432fae629f566a6dc5ae416fe98de5a5367c26 Author: Gordon Bergling AuthorDate: 2025-11-19 14:30:02 +0000 Commit: Gordon Bergling CommitDate: 2025-11-24 06:00:23 +0000 lpr(1): Fix a typo in a debug message - s/unexpect/unexpected/ (cherry picked from commit 66d4a37bc389bf19ebf2210b0fff762baa659c32) --- usr.sbin/lpr/lpr/lpr.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/lpr/lpr/lpr.1 b/usr.sbin/lpr/lpr/lpr.1 index 8c2859aeeb6b..362fac0f8da7 100644 --- a/usr.sbin/lpr/lpr/lpr.1 +++ b/usr.sbin/lpr/lpr/lpr.1 @@ -107,7 +107,7 @@ phototypesetter commands from ancient versions of .Xr troff 1 Pq Pa ports/textproc/groff . .It Fl v The files are assumed to contain a raster image for devices like the -Benson Varian. +Benson Variant. .El .Pp These options apply to the handling of From nobody Mon Nov 24 06:01:01 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dFFYn3vD3z6J78d for ; Mon, 24 Nov 2025 06:01: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFFYn1mgwz3nmq for ; Mon, 24 Nov 2025 06:01:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763964061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0/pDZnw3o6cg+3fHHld8bL8lACLMUVHbd+scSKU2sG0=; b=gBSkuQwcjj5VU4FuRzQmzi1Z8U9ZmzFNcW7ZvrTzG56Y56XMUnUKM/6NDpRePSuITzHTTr pQ+DQFEngyS7/F8gs/Lq5jo7/D9VOL2Txd94nmH3Ksrk1R9zR9t/EjYkruvoaGpHjgOTsg 0zNpUuVragryX5hb2gw8qw5ZSKQdUGILePifF4X76b4G8/NLnUwcFMOQW5T+lPtabvCCaM 91bpkNNgrs7lbtnzfcl6nf6lb4rEXjvV9MK7kTkTKKb8wC2HmjFt5oHH/En4XIiFYF1adu RhR8uNDFNerU7BvIzdHnp2ilWek1dEBUOvOaHeukuKYkdw9FWg2LQy0+LO7nyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763964061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0/pDZnw3o6cg+3fHHld8bL8lACLMUVHbd+scSKU2sG0=; b=OebNiIXzLI4L+ZP7Jzd0w/U9rH920zi3nXlbbTpbSXGVfu8rhRWj1BNg8uE5mOPsiPpKNX hTXfXiGjiUiOsOc8w/dpq6jizm8j/WRyPbYxRLQD1V6eR5xWzOeE+cFa4cGYV62y45/hn5 01XfQa8Bv4JlIoPNAxmiNoVCTUpMCcSX3Stf6h47D4NSbHuT965V9ghIrYqkIbNJlOUuab 7Q0GQSHx763OlQxzxFFH/whTd+j12VVYfhN/abuZDMN835WMkcxV5DOP9BSkvWmiDuk1S5 XJSQZy7DHEpn3Fh1DK5dZhBCuPi43SQuGxO+hK87KVM9AyvL7SuZSiujg0sncw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763964061; a=rsa-sha256; cv=none; b=u5smggSEg06bNo40F0I+RyqVH0BeLWVy/hEaVFsNp7++TuWTrz9dQxb+pgoj9eSrxVRpZF aL6DdlKG6wl8+sTvzLF0Xzrny7yuDZRdx2iY+GZa5KpGu5HgXbYgwKGbKsnkVna1tnnT3i E84LfKtV62Uu5KIZm00/HgltF3u4cGzlx2MV+jVjPaLaiG/Fr1M4UU6qcfM38EjqdpkTvl rtB/Hja0llzgMdxBKouI20gg2WpX0oKbFCnki4TJAwcWiEAnuCSgSOkVQ1vljwVdKuceTx LJto9MAIBV41WfF5KfV7q8ZTeuI8CRj6q6sLTFwU6WWVLM1N/moAWCBDgtGehw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFFYn1HzHz12Hj for ; Mon, 24 Nov 2025 06:01:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 22217 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 24 Nov 2025 06:01:01 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: e9a7a3e810db - stable/14 - isp.4: Fix a typo in the manual page List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e9a7a3e810db7889f34e0826b5fd5083d66e9197 Auto-Submitted: auto-generated Date: Mon, 24 Nov 2025 06:01:01 +0000 Message-Id: <6923f49d.22217.529a3453@gitrepo.freebsd.org> The branch stable/14 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=e9a7a3e810db7889f34e0826b5fd5083d66e9197 commit e9a7a3e810db7889f34e0826b5fd5083d66e9197 Author: Gordon Bergling AuthorDate: 2025-11-21 09:14:35 +0000 Commit: Gordon Bergling CommitDate: 2025-11-24 06:00:35 +0000 isp.4: Fix a typo in the manual page - s/Chanel/Channel/ (cherry picked from commit 8158b813d90f01368b2045709feee1980a323198) --- share/man/man4/isp.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/isp.4 b/share/man/man4/isp.4 index 475e088aa459..c665df0d5683 100644 --- a/share/man/man4/isp.4 +++ b/share/man/man4/isp.4 @@ -85,7 +85,7 @@ It may be disabled using configuration and hint options described below. .Sh HARDWARE The .Nm -driver supports the following optical Fibre Chanel adapters: +driver supports the following optical Fibre Channel adapters: .Bl -column "Qlogic 2690/2692/2694 (2684/2692)" "Speed" "PCI-X" .It Model: Ta Speed: Ta Bus: .It Qlogic QLE2874 (2814) Ta 64Gb Ta PCIe From nobody Mon Nov 24 06:00:57 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dFFYq08X1z6J7Pp for ; Mon, 24 Nov 2025 06:01: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFFYj6Q7Qz3nMV for ; Mon, 24 Nov 2025 06:00:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763964057; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TVtZ3ci3kDA2lQMqbU3siE3U6HLMjwhgEWAKkn/8MC0=; b=SPTscso1u3ps3ZNyBExXUvOUd0Nqav+k4IH4lNkGBkavcY5OWCEAmABVU/zcbJQiCrlJLm SfwwDUIsfU3921Loccyed8jkNChOwVZ8i7OqdrpDQPfkZVveSt7+SqEZe0ZyJqDs8D+Q+h Uog9wBJSTJVtvRAMJlxn1g/w2+nrYwrBdianKptOh/hBm5h0k3XzMgEi1vbwRb87bZveK+ UIKe8H5Lw2DL55hYrxazQbjhv4bUAUCgdy19BWrSFt5HDVEiNMKSARUMYvWJHjuq+zBUhw cXRX2uXNROfvuwBIVvGVsjVdfZlKVnhjZtRC8sG84bS0Gpgikhn13nUD7hPNHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763964057; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TVtZ3ci3kDA2lQMqbU3siE3U6HLMjwhgEWAKkn/8MC0=; b=fpepbyUzjYlCkpjz481YtQ4GW/O3ul1loZq/3SGtd/w3n/DhslTa585q1JJjfif7QWam5T zS/Oy3wzat9aIdYEgDA1TRQ7dV9hIA5pJ9tI5xPoH2b7HiXLc2e6h/nn7LrW8g2AJzZxOA 7gci/odkzasP7PAer1pAjyUvqi39Oxx8ikfnRKco8mwe6skDJZHm34Wmv1T+D84md5zDJy XWAhfNmi7j9SvZRwqK6oB1DjKf18Ig4PeEBXUpeOMWIze99E/xTAh91NAZmrYRjGuOvEj6 wZpubHOe03+/7xhnkz/xHbAGMVSQsdG28eZuIHRATsQA0OoJkoWVCJDE4K+d7g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763964057; a=rsa-sha256; cv=none; b=ZklxnvLeyK7dSckaJmvXsg+mGrP2g8X3QLckh6qJaDqBMIxHFWZiR83BYOh1PNZPss79zO 7ar/j4rVaVDJbMEtiwNYmT407Ye9Gh+ksvHqZ1MJ5GqQzDh864OulEfqKwUEVzVCrVrSwW 42/lLaPdgEAefBT1RF1K4EzK9+W2XarycugRjnN9W+Bd/K2Q+GWgsKutUH8u/Jhk/7LedE oSiCU9S0kZcNyK5LpIDcCrKkexsDVY6mhrXKzQ6IgNoj7qIQo8PPja8ChHWdMczlkr1uyy u6ZEmP/s7CDDGwnYT44XHC3GjfOsWDHDrVMSMwABB0eokTmyZC3rDUPQM6uJXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFFYj61Zxz11gC for ; Mon, 24 Nov 2025 06:00:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 215e4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 24 Nov 2025 06:00:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 1780b0d53712 - stable/14 - ypldap(8): Fix a typo in a debug message List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1780b0d53712184762b01835f5a2cc34db164020 Auto-Submitted: auto-generated Date: Mon, 24 Nov 2025 06:00:57 +0000 Message-Id: <6923f499.215e4.41011b4b@gitrepo.freebsd.org> The branch stable/14 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=1780b0d53712184762b01835f5a2cc34db164020 commit 1780b0d53712184762b01835f5a2cc34db164020 Author: Gordon Bergling AuthorDate: 2025-11-19 14:31:13 +0000 Commit: Gordon Bergling CommitDate: 2025-11-24 05:59:59 +0000 ypldap(8): Fix a typo in a debug message - s/unexpect/unexpected/ (cherry picked from commit 843a4ad5814fe4344b245819880d423343b2d5ab) --- usr.sbin/ypldap/ldapclient.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/ypldap/ldapclient.c b/usr.sbin/ypldap/ldapclient.c index acd4410d939f..520bbb4d71cf 100644 --- a/usr.sbin/ypldap/ldapclient.c +++ b/usr.sbin/ypldap/ldapclient.c @@ -317,7 +317,7 @@ client_dispatch_parent(int fd, short events, void *p) client_configure(env); break; default: - log_debug("client_dispatch_parent: unexpect imsg %d", + log_debug("client_dispatch_parent: unexpected imsg %d", imsg.hdr.type); break; From nobody Mon Nov 24 06:21:50 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dFG1q0S7wz6J8bw for ; Mon, 24 Nov 2025 06:21: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFG1p3nGsz3qg2 for ; Mon, 24 Nov 2025 06:21:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763965310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QlDmPHfTSEKSNuDN27847FMo4TraK91v4+gIjz/aJxM=; b=SdDUzL5emhHiYZsgoW3Vm1Fu0DeEW193Tf/MgUUvZ/v/md3G5vsDAr6SvdOdsFM4MJ8OHI Vv5UmVoZaVhYR83Gu/8vucrfWinfHfXRomHKLHTIsnn6Vh/kgywDK6I74jd3CzDa8YxHNu OLsb6lQWKNJfGd4wlcTudEy59G95smhhasLZLh07Wsgfq478k0Gj3Uj+lzkxyPSg9NyP9u grl6gd49Zb5jvaOZAlUl3f+yl4Tn2da/Kn+dC62bg9uQPzXXGfBSVWOlgwUFSDDdPO45Gd 8M5pvl9jdql+MzYOomx0v4JYa5T9nYE4qte/A86VxSVXRhHkJo3oDfB4ZtXEPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763965310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QlDmPHfTSEKSNuDN27847FMo4TraK91v4+gIjz/aJxM=; b=so0lCYIT5glPQIJuBNnjakcoqCmo8R++Vrtv2DFqHF86745KPD0AjpRI0h2DhQnLbUh84U peG5zZhhJMOWakNwj0UXuJ+BajTMMdKMkdNiw2RttmqKrij4K+BOpRESozgooeJRJs4AhR sLGmbYtUl/ZbSwDnehAPb3xlCDP6AHbM6f+Ptq7+gCG99SLBME3Uc5ZTzxQOIGnBuCKV3e T8U35CUkQNeR3tZmlk3aZ/qqKj/GbUEQpwjfcl2eLri58E8EX7m810t1zgTsn7vOTmiS7X ifOTuAtSCvJjRg/BV99DB5kI2Gt7IZy6FbdgafRdYX24ph8gae4Fox0SzuFvzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763965310; a=rsa-sha256; cv=none; b=SAvncm9ONvhexgtEoGaAnukvFrZwYLxawcbKiv+kDEj9IvIq9Sz7mJuoLy5ZQF3A1nh4tG aUtRzm/fp205JVfFfgDQ9OQdCE/qBe1825+M72aIVNQ6B2w7dZ9N5NwOpSDyPigLLw8fes L870EXGNAw5fkp9vNrAFSFeFh6Jxq7iPuSnoFB0GV9nSHTm5FTCoUMnsHQlMrQuRReNSzs P9yVLBxBLQTsAaM2StNjdy7iAGYcTV4VUGIltWVDcN34LTk4nMTGbzuRjvhb6DE0zPvWP3 bSDPDEDiWqXa0oE5LWn46JllGyhAJwhtmtxpru/bvmmmqukSBCSNl5CF1bZFHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFG1p3Lg5z12p6 for ; Mon, 24 Nov 2025 06:21:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2376a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 24 Nov 2025 06:21:50 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 815f08560050 - stable/15 - release: Ship DVD with only emacs@nox flavour List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 815f08560050e6084fac4053dc650c9d88976fd9 Auto-Submitted: auto-generated Date: Mon, 24 Nov 2025 06:21:50 +0000 Message-Id: <6923f97e.2376a.2db7e761@gitrepo.freebsd.org> The branch stable/15 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=815f08560050e6084fac4053dc650c9d88976fd9 commit 815f08560050e6084fac4053dc650c9d88976fd9 Author: Colin Percival AuthorDate: 2025-11-23 06:03:03 +0000 Commit: Colin Percival CommitDate: 2025-11-24 06:21:38 +0000 release: Ship DVD with only emacs@nox flavour Contrary to the claim made in a previous commit, removing KDE and adding all of vim and emacs results in an image which does not fit into 4.7 GB; to be specific, it lands at 4.722 GB rather than the claimed 4.689 GB. (This descrepancy resulted from doing test DVD image builds using an out-of-date tree, and became visible when the 15.0-RC3 images were built.) Limit the emacs packages shipped on the DVD to the "nox" flavor; this brings the disk image down to 4.407 GB, aka under the 4.7 GB limit for standard DVDs. Fixes: 6cc6beb4c889 ("release: Remove KDE from dvd1.iso") MFC after: 1 day (for 15.0-RC4) (cherry picked from commit c8cf5a99f82bc52849960e689442421ad5a6d412) --- release/scripts/pkg-stage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/scripts/pkg-stage.sh b/release/scripts/pkg-stage.sh index 083b1baa3358..c575f2d32bae 100755 --- a/release/scripts/pkg-stage.sh +++ b/release/scripts/pkg-stage.sh @@ -15,7 +15,7 @@ export PORTSDIR="${PORTSDIR:-/usr/ports}" _DVD_PACKAGES=" devel/git@lite -editors/emacs +editors/emacs@nox editors/vim misc/freebsd-doc-all net/mpd5 From nobody Mon Nov 24 06:23:21 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dFG3Y6j4zz6J8r2 for ; Mon, 24 Nov 2025 06:23:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFG3Y5n13z3r7F for ; Mon, 24 Nov 2025 06:23:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763965401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lTc3WdpDkUSVEcNvUUlwKXuG5twT6NoYfeSFu27aT/A=; b=sQYkzC5EgwocB7UFq+WMpPvscAYXR5s2lRmYki53/95o76FfpxsSfZznhsuaHhOrdNAL53 k4Wkg3orSnyAT+F5Gt3YEzSP9yTRoV3j9nQrKh44RJD+wnt1g+Le2zUv3A9ak2M6e0y+pB 6n2ojC82hefpK5z+8y9cTClCB0eza/KSodTkQe3UiSkspVq9zzonETg8D3N8qhUMKKpR85 fQ0X6ma1EXqg5Y+fQYLRZi0OhZZ1r0TN233zPCYfEyOVySLqDYtZKI/sPn/82UGA990p3j iLPvck6w1o2Eqsqcm1uPQXI06/pmgC/2+9i38VglvLrb4gWwQMPKqTTearFlBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763965401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lTc3WdpDkUSVEcNvUUlwKXuG5twT6NoYfeSFu27aT/A=; b=oZd21x1tiXm4Ihs+G2Ni7MxCex7Jo+2zGzGJ9nD21kwFe/TlepqlCvcHGSLwwx7aK+EGJQ iCvZmIDbsIFko62BJdWnD6LRBe4tsjzKyFagmA9R6qGpoeiXTCLzdl0knQ8N0Rrb/qRNuv V0b8Z3LJnRLNMxq03wgSDEhFukfCB5B4uAqOvWV6QtoI6yqBja5ugUl/XRGQrWStqzQwiB LwLzqnJYTla5yoNduVLrAIGJ7DrkvEtbpjztpyvo8NdVHZuUCm0pMWqXhwP0XMjkOUZTLm EKKMHOyp77KAYgq+L9uL+Vlm3JAlYIJ1UKUSZZkxe5j0AwEuOCvKECNOJx7/4w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763965401; a=rsa-sha256; cv=none; b=eed5AV2L8H9dS12yxMiDH7VbXBleEGhZkqZjgpf3/hafALgrVdMTp8Mx07HJ8zQBTD5mSz h1pWO/azATwmYDiX0m6GoRLy1jmxfwYtXc0yZz6ptlBATMJ+PynaHF504HnDts4WbaWz/v Rd67DPDeDYFjbbyjeH4pxFILmuC4aSMUpTd6TAUlGobzxiweNerp+SVxQXL5WZQbdapbxg VBl/e7hoeC3fbp5whcVHEZDIHML1OKcdNHtstIGRxUEbXOqDW7S1KfQgpYJP9WcYJKY4mu prRK/E7QU4O3abySPw4U5VsR+IKcAcjF+hcxenlgFy1HTiCnG3/r7cPbrt1VGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFG3Y5315z134p for ; Mon, 24 Nov 2025 06:23:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2450b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 24 Nov 2025 06:23:21 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 9f43dc502cbb - releng/15.0 - release: Ship DVD with only emacs@nox flavour List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/15.0 X-Git-Reftype: branch X-Git-Commit: 9f43dc502cbbecf39d012d4c8a4546524ddded25 Auto-Submitted: auto-generated Date: Mon, 24 Nov 2025 06:23:21 +0000 Message-Id: <6923f9d9.2450b.67f83610@gitrepo.freebsd.org> The branch releng/15.0 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=9f43dc502cbbecf39d012d4c8a4546524ddded25 commit 9f43dc502cbbecf39d012d4c8a4546524ddded25 Author: Colin Percival AuthorDate: 2025-11-23 06:03:03 +0000 Commit: Colin Percival CommitDate: 2025-11-24 06:23:02 +0000 release: Ship DVD with only emacs@nox flavour Contrary to the claim made in a previous commit, removing KDE and adding all of vim and emacs results in an image which does not fit into 4.7 GB; to be specific, it lands at 4.722 GB rather than the claimed 4.689 GB. (This descrepancy resulted from doing test DVD image builds using an out-of-date tree, and became visible when the 15.0-RC3 images were built.) Limit the emacs packages shipped on the DVD to the "nox" flavor; this brings the disk image down to 4.407 GB, aka under the 4.7 GB limit for standard DVDs. Approved by: re (cperciva) Fixes: 6cc6beb4c889 ("release: Remove KDE from dvd1.iso") MFC after: 1 day (for 15.0-RC4) (cherry picked from commit c8cf5a99f82bc52849960e689442421ad5a6d412) (cherry picked from commit 815f08560050e6084fac4053dc650c9d88976fd9) --- release/scripts/pkg-stage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/scripts/pkg-stage.sh b/release/scripts/pkg-stage.sh index 083b1baa3358..c575f2d32bae 100755 --- a/release/scripts/pkg-stage.sh +++ b/release/scripts/pkg-stage.sh @@ -15,7 +15,7 @@ export PORTSDIR="${PORTSDIR:-/usr/ports}" _DVD_PACKAGES=" devel/git@lite -editors/emacs +editors/emacs@nox editors/vim misc/freebsd-doc-all net/mpd5 From nobody Mon Nov 24 06:23:22 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dFG3b2dm7z6J8wv for ; Mon, 24 Nov 2025 06:23: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFG3Z6BFlz3rFf for ; Mon, 24 Nov 2025 06:23:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763965402; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fR7pPERrrCwb1PHOX6+rqKUVEJ8e/YEBiwroby0eNT8=; b=ACEUF0yuv1dfRWx+W6KSxitV3WRTRCKHGglZZO9EzcESMn3ndCJQ2jz2tCh+ShaYYYYcsE KhEsCAbKl83yDmTH1SLtFHASBHWBi0Z+bPykPciYVdue19m+teDbqrfo4jVVnNHabSbnCN VMYxVaX9uKTu2t4vQ2TsFydyeDJMlC4w8ajyPY2TbemXpq/wTCIsl9diqK/ntDTbINfWtb +qrndRg1RJtsnO5itSz5Lg+mE77MOcvkopCR2OstEeyDUA5g1Q6rq6F2ypXg+uFRCehcUb cBj5tHtIEn7RO1QdoPrmFrLdwJOjZPXtRbvFd4BV7yEsiMfz7zE54TJzv+z1aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763965402; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fR7pPERrrCwb1PHOX6+rqKUVEJ8e/YEBiwroby0eNT8=; b=sI+KsGr05v16kUGTinstCpGUNCYxFB5ZLPtBO7F1dTM4YQuC8Md+B7V8kjn+O+1QH6essE JYVR41GT1tiLYyEEvjmMb9qU7+Obi5LIPkEkdFOlI46tsgC/C2hPqYYbLVrjMRK1BgsX21 KeuQ1d2Zq/GeNejJWw74ITC9Mf/Aj3ekazhliBI1SI7OKkjtPQ8oBOnfitlQkvfgTdTnzQ 0sAPMpEReyjLJKa9q3mXeK8+5eKQvBDjzMycm2KCs0tcPeQ0kvyLp4HzI53BI3l4+WlXlJ alx2CaDjGLDzBcNiS3VYI8yas8L0mROcit4kTCz4evBouaa6LK9NBE5lVW6bCw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763965402; a=rsa-sha256; cv=none; b=ncm7PSCk+aUdasXXtnX9FJakDoxE+rE2ppJg/ghoDgO+TbbA5cy7hKgRf6qXnVuV9RU64V 1zrM3kEg6L+0/4X5rSzC6ajGxcdjTpksvjucmvhOFSO3fjPphNbyCvtLMWDzvxqf2FxMWI 3371188UiAfLro1LnjfGNWr4R2knHBxZLv6BDncEK+WXJ86SHFrUY1ldgDkTh6LUVufgLC pf6yJCjKHiUEH9OAKUbXm+j2oD8e2lncVdO/yBzBY8j7pTJ7uS6zdgOYR0kKfC2L+fCrbd v0pNO+MlsY+HXndtjTPmJzLawxtsq/JuznDoPFpGbq74ydlLl2JqYHsw4u9Ojw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFG3Z5lJzz13Df for ; Mon, 24 Nov 2025 06:23:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2237e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 24 Nov 2025 06:23:22 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav From: Colin Percival Subject: git: 8fdafb396677 - releng/15.0 - pam_krb5: Restore allow_kdc_spoof option List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/15.0 X-Git-Reftype: branch X-Git-Commit: 8fdafb396677a616c4899b1d1de29a3aa611dfa6 Auto-Submitted: auto-generated Date: Mon, 24 Nov 2025 06:23:22 +0000 Message-Id: <6923f9da.2237e.48dfcd6f@gitrepo.freebsd.org> The branch releng/15.0 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=8fdafb396677a616c4899b1d1de29a3aa611dfa6 commit 8fdafb396677a616c4899b1d1de29a3aa611dfa6 Author: Dag-Erling Smørgrav AuthorDate: 2025-11-24 02:40:29 +0000 Commit: Colin Percival CommitDate: 2025-11-24 06:23:08 +0000 pam_krb5: Restore allow_kdc_spoof option Not only does the new pam_krb5 module not have the same allow_kdc_spoof option that the old one had, its behavior in this matter defaults to insecure. Reimplement allow_kdc_spoof and switch the default back. Approved by: re (cperciva) Reviewed by: cy Differential Revision: https://reviews.freebsd.org/D53884 (cherry picked from commit fe5c8baf25a5b40285c3ef85b69391d591e4a76c) (cherry picked from commit 2eb030d1c8f1f307c2e0570538633d4e0822a4ff) --- contrib/pam-krb5/docs/pam_krb5.pod | 15 +++++++++------ contrib/pam-krb5/module/auth.c | 6 ++++++ contrib/pam-krb5/module/internal.h | 3 +++ contrib/pam-krb5/module/options.c | 3 +++ 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/contrib/pam-krb5/docs/pam_krb5.pod b/contrib/pam-krb5/docs/pam_krb5.pod index 024584dfd4cd..f352af71b553 100644 --- a/contrib/pam-krb5/docs/pam_krb5.pod +++ b/contrib/pam-krb5/docs/pam_krb5.pod @@ -57,12 +57,10 @@ is vulnerable to KDC spoofing, but it requires that the system have a local key and that the PAM module be running as a user that can read the keytab file (normally F. You can point the Kerberos PAM module at a different keytab with the I option. If that keytab -cannot be read or if no keys are found in it, the default (potentially -insecure) behavior is to skip this check. If you want to instead fail -authentication if the obtained tickets cannot be checked, set -C to true in the [libdefaults] section of -F. Note that this will affect applications other than -this PAM module. +cannot be read or if no keys are found in it, the default behavior is to +fail authentication. If you want to skip this check, set the +C option to true either in the [appdefaults] section of +F or in the PAM policy. By default, whenever the user is authenticated, a basic authorization check will also be done using krb5_kuserok(). The default behavior of @@ -218,6 +216,11 @@ pam-krb5 in which that option was added with the current meaning. =over 4 +=item allow_kdc_spoof + +Allow authentication to succeed even if there is no host or service +key available in a keytab to authenticate the Kerberos KDC's ticket. + =item alt_auth_map= [3.12] This functions similarly to the I option. The diff --git a/contrib/pam-krb5/module/auth.c b/contrib/pam-krb5/module/auth.c index 065ce97b6596..46f2be791000 100644 --- a/contrib/pam-krb5/module/auth.c +++ b/contrib/pam-krb5/module/auth.c @@ -696,6 +696,12 @@ verify_creds(struct pam_args *args, krb5_creds *creds) if (cursor_valid) krb5_kt_end_seq_get(c, keytab, &cursor); } +#ifdef __FreeBSD__ + if (args->config->allow_kdc_spoof) + opts.flags &= ~KRB5_VERIFY_INIT_CREDS_OPT_AP_REQ_NOFAIL; + else + opts.flags |= KRB5_VERIFY_INIT_CREDS_OPT_AP_REQ_NOFAIL; +#endif /* __FreeBSD__ */ retval = krb5_verify_init_creds(c, creds, princ, keytab, NULL, &opts); if (retval != 0) putil_err_krb5(args, retval, "credential verification failed"); diff --git a/contrib/pam-krb5/module/internal.h b/contrib/pam-krb5/module/internal.h index f3ea30139815..c797f7a56cd3 100644 --- a/contrib/pam-krb5/module/internal.h +++ b/contrib/pam-krb5/module/internal.h @@ -62,6 +62,9 @@ struct pam_config { long minimum_uid; /* Ignore users below this UID. */ bool only_alt_auth; /* Alt principal must be used. */ bool search_k5login; /* Try password with each line of .k5login. */ +#ifdef __FreeBSD__ + bool allow_kdc_spoof;/* Allow auth even if KDC cannot be verified */ +#endif /* __FreeBSD__ */ /* Kerberos behavior. */ char *fast_ccache; /* Cache containing armor ticket. */ diff --git a/contrib/pam-krb5/module/options.c b/contrib/pam-krb5/module/options.c index 799b3a33e168..0118fb451af6 100644 --- a/contrib/pam-krb5/module/options.c +++ b/contrib/pam-krb5/module/options.c @@ -30,6 +30,9 @@ #define K(name) (#name), offsetof(struct pam_config, name) /* clang-format off */ static const struct option options[] = { +#ifdef __FreeBSD__ + { K(allow_kdc_spoof), true, BOOL (false) }, +#endif /* __FreeBSD__ */ { K(alt_auth_map), true, STRING (NULL) }, { K(anon_fast), true, BOOL (false) }, { K(banner), true, STRING ("Kerberos") }, From nobody Mon Nov 24 06:23:23 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dFG3c112Lz6J8wy for ; Mon, 24 Nov 2025 06:23: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFG3b6w4tz3r94 for ; Mon, 24 Nov 2025 06:23:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763965404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IhSB14yF5Y9HnOYMvAhdCbuSpyB55K54LUb7FVHlb9M=; b=XgFG0YKEGcVjONe9P/KT3p84DKmKakNxqDRiYlCU6nxuywhgFRg2y0oorKZrmwQYL4nSRU 5vlLzzbTyd6tgDGpMAycQl10E2+v+KCmX/BrWmlEDgIml34c4AgwOL5mc37zz6BpWkZIqV 3695DqFOhlGc792LZZjQuWn/j52tPrHmaC3wcTTZZxWyXzNtIfvkUJzbYFwU9FD0Wy9I6g Pgd1Z/iRcxc5WLvNMwJRRu15MN8YFRQQGB5FHgRo11LlPU3K5DwDPrVEJYeulmdRGXTYIf 58xUW7JBabMXRPnXXMKK/8PzoFS4z39FFvgOzRpWSqq18l+f8/Oafw9h3RY9jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763965404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IhSB14yF5Y9HnOYMvAhdCbuSpyB55K54LUb7FVHlb9M=; b=f5unH1YYOWPNPWwKxrN0lqqA1d/wRKEcczLhGJBJXbofsi8cISriyrvh5jtEA0EbvkXLoa K9ib858x6EHgjHgT7aWLGZIgVgtjqVvP9ugoltYC4WDhAMDPGQyiQXyTzwnXmn6XlvQNfT i1oI6bwE/+XNp/sOfMb0bcstSUONhFTiCaRk4qRr8Ut0x3rEkTglN1MfX/bREGp84imOQw NPx5k3WM/9wzVrPpj3ZYpqDbneTZnL5sF2iGDoambNIumZAPX7D0n3KEUCuOB40z0PMr2M ACM145LQGaR6zgdEJWWV2dSAZ48UfJ05vVmlo6psVTe/5xGzZne+4wXUvwVCkA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763965404; a=rsa-sha256; cv=none; b=UweidnEQ0TOddz7uDScTyt1Iwk6gljJQDgjj/L5ccBJdhUvIJ4LMMTMs17hPvtFC5N9ozp i1QeyPSGYC5h/pm5SklhfGHnToObmtAckpu2utsZJO1OMKFAM7uggAILSQ8T4LYUacY5sZ GrqHTkSxco5sM2r+DYbfCS1YKiGVoJpN6P0YcqhAqIwNH4gXKYIGhcW4EWGGkYGrp0x1vW FKYpruxrZBelvRZ6ZYiGAUgwJEVf6x5jjheWoMu1t66CTJBlPhpdu2z9iimiTmK6UcX0x0 5cMX6wPRvPzmnR9ueiqrq9TsYb5mr6NsO9sues1375t/vi855g4Ue1OYdH2kSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFG3b6Rbsz12K3 for ; Mon, 24 Nov 2025 06:23:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 243d3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 24 Nov 2025 06:23:23 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav From: Colin Percival Subject: git: bada4c39b20c - releng/15.0 - pam_krb5: Fix manual page in MIT case List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/15.0 X-Git-Reftype: branch X-Git-Commit: bada4c39b20c4378b485cff061c3b8da688e1621 Auto-Submitted: auto-generated Date: Mon, 24 Nov 2025 06:23:23 +0000 Message-Id: <6923f9db.243d3.1faf266a@gitrepo.freebsd.org> The branch releng/15.0 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=bada4c39b20c4378b485cff061c3b8da688e1621 commit bada4c39b20c4378b485cff061c3b8da688e1621 Author: Dag-Erling Smørgrav AuthorDate: 2025-11-24 02:40:37 +0000 Commit: Colin Percival CommitDate: 2025-11-24 06:23:11 +0000 pam_krb5: Fix manual page in MIT case * Always install the manual page as pam_krb5(8) regardless of which version we're using. * Regenerate it using pod2mdoc instead of pod2man so it doesn't claim to be part of “User Contributed Perl Documentation”. * Put the correct section number in the header and footer. * Don't cross-reference non-existent pam(7) manual page. Approved by: re (cperciva) Reviewed by: cperciva Differential Revision: https://reviews.freebsd.org/D53885 (cherry picked from commit 961b934407f09d4241cfad76a9c8833baa2650e1) (cherry picked from commit 4166181675d79c0157ea9bd4fcaa0b5c0319d0f1) --- ObsoleteFiles.inc | 3 + lib/libpam/modules/pam_krb5/Makefile | 12 +- lib/libpam/modules/pam_krb5/pam-krb5.8 | 2205 ++++++++++++++++++-------------- 3 files changed, 1281 insertions(+), 939 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 6cbec0879b70..2032434f5323 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20251121: Remove duplicate pam_krb5 manual page +OLD_FILES+=usr/share/man/man8/pam-krb5.8.gz + # 20251112: Remove pccard(4) and related OLD_FILES+=share/man/man4/pccard.4.gz OLD_FILES+=share/man/man4/pcic.4.gz diff --git a/lib/libpam/modules/pam_krb5/Makefile b/lib/libpam/modules/pam_krb5/Makefile index 0c933f8f7e57..d55f2d0b5971 100644 --- a/lib/libpam/modules/pam_krb5/Makefile +++ b/lib/libpam/modules/pam_krb5/Makefile @@ -30,6 +30,7 @@ SRCDIR= ${SRCTOP}/contrib/pam-krb5 .PATH: ${SRCDIR}/module \ ${SRCDIR}/portable \ ${SRCDIR}/pam-util \ + ${SRCDIR}/docs \ ${SRCDIR} PACKAGE= kerberos @@ -57,8 +58,8 @@ SRCS= account.c \ support.c \ vector.c -MANNODEV= pam-krb5.8 -MANNODEVLINKS= pam-krb5.8 pam_krb5.8 +MANNODEV= pam_krb5.8 +MANSRC.pam_krb5.8=pam-krb5.8 CFLAGS= -I${SRCDIR} \ -I${.CURDIR} \ @@ -74,6 +75,13 @@ pam-util_options.c: .PHONY module_options.c: .PHONY cp ${SRCDIR}/module/options.c module_options.c + +.ifdef VENDOR_IMPORT +# Regenerate the manual page from the pod source after vendor import +pam-krb5.8: pam_krb5.pod + sed -e 's/pam(7)/pam.conf(5)/' <${.ALLSRC} | \ + pod2mdoc -n pam_krb5 -s 8 >${.CURDIR}/${.TARGET} +.endif .else PACKAGE= kerberos diff --git a/lib/libpam/modules/pam_krb5/pam-krb5.8 b/lib/libpam/modules/pam_krb5/pam-krb5.8 index 3413748c7850..ad4fa5c422c4 100644 --- a/lib/libpam/modules/pam_krb5/pam-krb5.8 +++ b/lib/libpam/modules/pam_krb5/pam-krb5.8 @@ -1,1025 +1,1356 @@ -.\" -*- mode: troff; coding: utf-8 -*- -.\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. -.ie n \{\ -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds C` -. ds C' -'br\} -.\" -.\" Escape single quotes in literal strings from groff's Unicode transform. -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" -.\" If the F register is >0, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.\" -.\" Avoid warning from groff about undefined register 'F'. -.de IX -.. -.nr rF 0 -.if \n(.g .if rF .nr rF 1 -.if (\n(rF:(\n(.g==0)) \{\ -. if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. if !\nF==2 \{\ -. nr % 0 -. nr F 2 -. \} -. \} -.\} -.rr rF -.\" ======================================================================== -.\" -.IX Title "PAM_KRB5 1" -.TH PAM_KRB5 1 2025-06-05 "perl v5.40.2" "User Contributed Perl Documentation" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.if n .ad l -.nh -.SH NAME -pam_krb5 \- Kerberos PAM module -.SH SYNOPSIS -.IX Header "SYNOPSIS" -.Vb 4 -\& auth sufficient pam_krb5.so minimum_uid=1000 -\& session required pam_krb5.so minimum_uid=1000 -\& account required pam_krb5.so minimum_uid=1000 -\& password sufficient pam_krb5.so minimum_uid=1000 -.Ve -.SH DESCRIPTION -.IX Header "DESCRIPTION" +.Dd November 21, 2025 +.Dt PAM_KRB5 8 +.Os +.Sh NAME +.Nm pam_krb5 +.Nd Kerberos PAM module +.Sh SYNOPSIS +.Bd -literal + auth sufficient pam_krb5.so minimum_uid=1000 + session required pam_krb5.so minimum_uid=1000 + account required pam_krb5.so minimum_uid=1000 + password sufficient pam_krb5.so minimum_uid=1000 +.Ed +.Sh DESCRIPTION The Kerberos service module for PAM, typically installed at -\&\fI/lib/security/pam_krb5.so\fR, provides functionality for the four PAM -operations: authentication, account management, session management, and -password management. \fIpam_krb5.so\fR is a shared object that is -dynamically loaded by the PAM subsystem as necessary, based on the system -PAM configuration. PAM is a system for plugging in external -authentication and session management modules so that each application -doesn't have to know the best way to check user authentication or create a -user session on that system. For details on how to configure PAM on your -system, see the PAM man page, often \fBpam\fR\|(7). -.PP +.Pa /lib/security/pam_krb5.so , +provides functionality for the four PAM operations: authentication, +account management, session management, and password management. +.Pa pam_krb5.so +is a shared object that is dynamically loaded by the PAM subsystem as +necessary, based on the system PAM configuration. +PAM is a system for plugging in external authentication and session +management modules so that each application doesn't have to know the +best way to check user authentication or create a user session on that +system. +For details on how to configure PAM on your system, see the PAM man +page, often pam.conf(5). +.Pp Here are the actions of this module when called from each group: -.IP auth 4 -.IX Item "auth" -Provides implementations of \fBpam_authenticate()\fR and \fBpam_setcred()\fR. The -former takes the username from the PAM session, prompts for the user's -password (unless configured to use an already-entered password), and then -performs a Kerberos initial authentication, storing the obtained -credentials (if successful) in a temporary ticket cache. The latter, -depending on the flags it is called with, either takes the contents of the -temporary ticket cache and writes it out to a persistent ticket cache -owned by the user or uses the temporary ticket cache to refresh an -existing user ticket cache. -.Sp +.Bl -tag -width Ds +.It auth +Provides implementations of +.Xr pam_authenticate 3 +and +.Xr pam_setcred 3 . +The former takes the username from the PAM session, prompts for the +user's password (unless configured to use an already-entered password), +and then performs a Kerberos initial authentication, storing the +obtained credentials (if successful) in a temporary ticket cache. +The latter, depending on the flags it is called with, either takes the +contents of the temporary ticket cache and writes it out to a persistent +ticket cache owned by the user or uses the temporary ticket cache to +refresh an existing user ticket cache. +.Pp Passwords as long or longer than PAM_MAX_RESP_SIZE octets (normally 512 -octets) will be rejected, since excessively long passwords can be used as -a denial of service attack. -.Sp +octets) will be rejected, since excessively long passwords can be used +as a denial of service attack. +.Pp After doing the initial authentication, the Kerberos PAM module will attempt to obtain tickets for a key in the local system keytab and then -verify those tickets. Unless this step is performed, the authentication -is vulnerable to KDC spoofing, but it requires that the system have a -local key and that the PAM module be running as a user that can read the -keytab file (normally \fI/etc/krb5.keytab\fR. You can point the Kerberos PAM -module at a different keytab with the \fIkeytab\fR option. If that keytab -cannot be read or if no keys are found in it, the default (potentially -insecure) behavior is to skip this check. If you want to instead fail -authentication if the obtained tickets cannot be checked, set -\&\f(CW\*(C`verify_ap_req_nofail\*(C'\fR to true in the [libdefaults] section of -\&\fI/etc/krb5.conf\fR. Note that this will affect applications other than -this PAM module. -.Sp +verify those tickets. +Unless this step is performed, the authentication is vulnerable to KDC +spoofing, but it requires that the system have a local key and that the +PAM module be running as a user that can read the keytab file (normally +.Pa /etc/krb5.keytab . +You can point the Kerberos PAM module at a different keytab with the +.Em keytab +option. +If that keytab cannot be read or if no keys are found in it, the default +behavior is to fail authentication. +If you want to skip this check, set the +.Qo Li allow_kdc_spoof Qc +option to true either in the [appdefaults] section of +.Pa /etc/krb5.conf +or in the PAM policy. +.Pp By default, whenever the user is authenticated, a basic authorization -check will also be done using \fBkrb5_kuserok()\fR. The default behavior of -this function is to check the user's account for a \fI.k5login\fR file and, -if one is present, ensure that the user's principal is listed in that -file. If \fI.k5login\fR is not present, the default check is to ensure that -the user's principal is in the default local realm and the user portion of -the principal matches the account name (this can be changed by configuring -a custom aname to localname mapping in \fIkrb5.conf\fR; see the Kerberos -documentation for details). This can be customized with several -configuration options; see below. -.Sp -If the username provided to PAM contains an \f(CW\*(C`@\*(C'\fR and Kerberos can, -treating the username as a principal, map it to a local account name, -\&\fBpam_authenticate()\fR will change the PAM user to that local account name. -This allows users to log in with their Kerberos principal and let Kerberos -do the mapping to an account. This can be disabled with the -\&\fIno_update_user\fR option. Be aware, however, that this facility cannot be -used with OpenSSH. OpenSSH will reject usernames that don't match local -accounts before this remapping can be done and will pass an invalid -password to the PAM module. Also be aware that several other common PAM -modules, such as pam_securetty, expect to be able to look up the user with -\&\fBgetpwnam()\fR and cannot be called before pam_krb5 when using this feature. -.Sp -When \fBpam_setcred()\fR is called to initialize a new ticket cache, the -environment variable KRB5CCNAME is set to the path to that ticket cache. -By default, the cache will be named \fI/tmp/krb5cc_UID_RANDOM\fR where UID is -the user's UID and RANDOM is six randomly-chosen letters. This can be -configured with the \fIccache\fR and \fIccache_dir\fR options. -.Sp -pam\-krb5 does not use the default ticket cache location or -\&\fIdefault_cc_name\fR in the \f(CW\*(C`[libdefaults]\*(C'\fR section of \fIkrb5.conf\fR. The -default cache location would share a cache for all sessions of the same -user, which causes confusing behavior when the user logs out of one of -multiple sessions. -.Sp -If \fBpam_setcred()\fR initializes a new ticket cache, it will also set up that -ticket cache so that it will be deleted when the PAM session is closed. -Normally, the calling program (\fBlogin\fR, \fBsshd\fR, etc.) will run the -user's shell as a sub-process, wait for it to exit, and then close the PAM -session, thereby cleaning up the user's session. -.IP session 4 -.IX Item "session" -Provides implementations of \fBpam_open_session()\fR, which is equivalent to -calling \fBpam_setcred()\fR with the PAM_ESTABLISH_CRED flag, and -\&\fBpam_close_session()\fR, which destroys the ticket cache created by -\&\fBpam_setcred()\fR. -.IP account 4 -.IX Item "account" -Provides an implementation of \fBpam_acct_mgmt()\fR. All it does is do the same -authorization check as performed by the \fBpam_authenticate()\fR implementation -described above. -.IP password 4 -.IX Item "password" -Provides an implementation of \fBpam_chauthtok()\fR, which implements password -changes. The user is prompted for their existing password (unless -configured to use an already entered one) and the PAM module then obtains -credentials for the special Kerberos principal \f(CW\*(C`kadmin/changepw\*(C'\fR. It -then prompts the user for a new password, twice to ensure that the user -entered it properly (again, unless configured to use an already entered -password), and then does a Kerberos password change. -.Sp +check will also be done using +.Xr krb5_kuserok 3 . +The default behavior of this function is to check the user's account for +a +.Pa .k5login +file and, if one is present, ensure that the user's principal is listed +in that file. +If +.Pa .k5login +is not present, the default check is to ensure that the user's principal +is in the default local realm and the user portion of the principal +matches the account name (this can be changed by configuring a custom +aname to localname mapping in +.Pa krb5.conf ; +see the Kerberos documentation for details). +This can be customized with several configuration options; see below. +.Pp +If the username provided to PAM contains an +.Qo Li @ Qc +and Kerberos can, treating the username as a principal, map it to a +local account name, +.Xr pam_authenticate 3 +will change the PAM user to that local account name. +This allows users to log in with their Kerberos principal and let +Kerberos do the mapping to an account. +This can be disabled with the +.Em no_update_user +option. +Be aware, however, that this facility cannot be used with OpenSSH. +OpenSSH will reject usernames that don't match local accounts before +this remapping can be done and will pass an invalid password to the PAM +module. +Also be aware that several other common PAM modules, such as +pam_securetty, expect to be able to look up the user with +.Xr getpwnam 3 +and cannot be called before pam_krb5 when using this feature. +.Pp +When +.Xr pam_setcred 3 +is called to initialize a new ticket cache, the environment variable +KRB5CCNAME is set to the path to that ticket cache. +By default, the cache will be named +.Pa /tmp/krb5cc_UID_RANDOM +where UID is the user's UID and RANDOM is six randomly-chosen letters. +This can be configured with the +.Em ccache +and +.Em ccache_dir +options. +.Pp +pam-krb5 does not use the default ticket cache location or +.Em default_cc_name +in the +.Qo Li [libdefaults] Qc +section of +.Pa krb5.conf . +The default cache location would share a cache for all sessions of the +same user, which causes confusing behavior when the user logs out of one +of multiple sessions. +.Pp +If +.Xr pam_setcred 3 +initializes a new ticket cache, it will also set up that ticket cache so +that it will be deleted when the PAM session is closed. +Normally, the calling program +.Pf ( Sy login , +.Sy sshd , +etc.) +will run the user's shell as a sub-process, wait for it to exit, and +then close the PAM session, thereby cleaning up the user's session. +.It session +Provides implementations of +.Xr pam_open_session 3 , +which is equivalent to calling +.Xr pam_setcred 3 +with the PAM_ESTABLISH_CRED flag, and +.Xr pam_close_session 3 , +which destroys the ticket cache created by +.Xr pam_setcred 3 . +.It account +Provides an implementation of +.Xr pam_acct_mgmt 3 . +All it does is do the same authorization check as performed by the +.Xr pam_authenticate 3 +implementation described above. +.It password +Provides an implementation of +.Xr pam_chauthtok 3 , +which implements password changes. +The user is prompted for their existing password (unless configured to +use an already entered one) and the PAM module then obtains credentials +for the special Kerberos principal +.Qo Li kadmin/changepw Qc . +It then prompts the user for a new password, twice to ensure that the +user entered it properly (again, unless configured to use an already +entered password), and then does a Kerberos password change. +.Pp Passwords as long or longer than PAM_MAX_RESP_SIZE octets (normally 512 -octets) will be rejected, since excessively long passwords can be used as -a denial of service attack. -.Sp -Unlike the normal Unix password module, this module will allow any user to -change any other user's password if they know the old password. Also, -unlike the normal Unix password module, root will always be prompted for -the old password, since root has no special status in Kerberos. (To -change passwords in Kerberos without knowing the old password, use -\&\fBkadmin\fR\|(8) instead.) -.PP +octets) will be rejected, since excessively long passwords can be used +as a denial of service attack. +.Pp +Unlike the normal Unix password module, this module will allow any user +to change any other user's password if they know the old password. +Also, unlike the normal Unix password module, root will always be +prompted for the old password, since root has no special status in +Kerberos. +(To change passwords in Kerberos without knowing the old password, use +kadmin(8) instead.) +.El +.Pp Both the account and session management calls of the Kerberos PAM module will return PAM_IGNORE if called in the context of a PAM session for a -user who did not authenticate with Kerberos (a return code of \f(CW\*(C`ignore\*(C'\fR in -the Linux PAM configuration language). -.PP +user who did not authenticate with Kerberos (a return code of +.Qo Li ignore Qc +in the Linux PAM configuration language). +.Pp Note that this module assumes the network is available in order to do a -Kerberos authentication. If the network is not available, some Kerberos -libraries have timeouts longer than the timeout imposed by the login -process. This means that using this module incautiously can make it -impossible to log on to console as root. For this reason, you should -always use the \fIignore_root\fR or \fIminimum_uid\fR options, list a local -authentication module such as \fBpam_unix\fR first with a control field of -\&\f(CW\*(C`sufficient\*(C'\fR so that the Kerberos PAM module will be skipped if local -password authentication was successful. -.PP -This is not the same PAM module as the Kerberos PAM module available from -Sourceforge, or the one included on Red Hat systems. It supports many of -the same options, has some additional options, and doesn't support some of -the options those modules do. -.SH CONFIGURATION -.IX Header "CONFIGURATION" -The Kerberos PAM module takes many options, not all of which are relevant -to every PAM group; options that are not relevant will be silently -ignored. Any of these options can be set in the PAM configuration as -arguments listed after \f(CW\*(C`pam_krb5.so\*(C'\fR. Some of the options can also be -set in the system \fIkrb5.conf\fR file; if this is possible, it will be noted -below in the option description. -.PP -To set a boolean option in the PAM configuration file, just give the name -of the option in the arguments. To set an option that takes an argument, -follow the option name with an equal sign (=) and the value, with no -separating whitespace. Whitespace in option arguments is not supported in -the PAM configuration. -.PP -To set an option for the PAM module in the system \fIkrb5.conf\fR file, put -that option in the \f(CW\*(C`[appdefaults]\*(C'\fR section. All options must be followed -by an equal sign (=) and a value, so for boolean options add \f(CW\*(C`= true\*(C'\fR. +Kerberos authentication. +If the network is not available, some Kerberos libraries have timeouts +longer than the timeout imposed by the login process. +This means that using this module incautiously can make it impossible to +log on to console as root. +For this reason, you should always use the +.Em ignore_root +or +.Em minimum_uid +options, list a local authentication module such as +.Sy pam_unix +first with a control field of +.Qo Li sufficient Qc +so that the Kerberos PAM module will be skipped if local password +authentication was successful. +.Pp +This is not the same PAM module as the Kerberos PAM module available +from Sourceforge, or the one included on Red Hat systems. +It supports many of the same options, has some additional options, and +doesn't support some of the options those modules do. +.Sh CONFIGURATION +The Kerberos PAM module takes many options, not all of which are +relevant to every PAM group; options that are not relevant will be +silently ignored. +Any of these options can be set in the PAM configuration as arguments +listed after +.Qo Li pam_krb5.so Qc . +Some of the options can also be set in the system +.Pa krb5.conf +file; if this is possible, it will be noted below in the option +description. +.Pp +To set a boolean option in the PAM configuration file, just give the +name of the option in the arguments. +To set an option that takes an argument, follow the option name with an +equal sign (=) and the value, with no separating whitespace. +Whitespace in option arguments is not supported in the PAM +configuration. +.Pp +To set an option for the PAM module in the system +.Pa krb5.conf +file, put that option in the +.Qo Li [appdefaults] Qc +section. +All options must be followed by an equal sign (=) and a value, so for +boolean options add +.Qo Li = true Qc . The Kerberos PAM module will look for options either at the top level of -the \f(CW\*(C`[appdefaults]\*(C'\fR section or in a subsection named \f(CW\*(C`pam\*(C'\fR, inside or -outside a section for the realm. For example, the following fragment of a -\&\fIkrb5.conf\fR file would set \fIforwardable\fR to true, \fIminimum_uid\fR to -1000, and set \fIignore_k5login\fR only if the realm is EXAMPLE.COM. -.PP -.Vb 8 -\& [appdefaults] -\& forwardable = true -\& pam = { -\& minimum_uid = 1000 -\& EXAMPLE.COM = { -\& ignore_k5login = true -\& } -\& } -.Ve -.PP -For more information on the syntax of \fIkrb5.conf\fR, see \fBkrb5.conf\fR\|(5). -Note that options that depend on the realm will be set only on the basis -of the default realm, either as configured in \fBkrb5.conf\fR\|(5) or as set by -the \fIrealm\fR option described below. If the user authenticates to an -account qualified with a realm, that realm will not be used when -determining which options will apply. -.PP -There is no difference to the PAM module whether options are specified at -the top level or in a \f(CW\*(C`pam\*(C'\fR section; the \f(CW\*(C`pam\*(C'\fR section is supported in -case there are options that should be set for the PAM module but not for -other applications. -.PP -If the same option is set in \fIkrb5.conf\fR and in the PAM configuration, -the latter takes precedent. Note, however, that due to the configuration -syntax, there's no way to turn off a boolean option in the PAM -configuration that was turned on in \fIkrb5.conf\fR. -.PP +the +.Qo Li [appdefaults] Qc +section or in a subsection named +.Qo Li pam Qc , +inside or outside a section for the realm. +For example, the following fragment of a +.Pa krb5.conf +file would set +.Em forwardable +to true, +.Em minimum_uid +to 1000, and set +.Em ignore_k5login +only if the realm is EXAMPLE.COM. +.Bd -literal + [appdefaults] + forwardable = true + pam = { + minimum_uid = 1000 + EXAMPLE.COM = { + ignore_k5login = true + } + } +.Ed +.Pp +For more information on the syntax of +.Pa krb5.conf , +see krb5.conf(5). Note that options that depend on the realm will be set +only on the basis of the default realm, either as configured in +krb5.conf(5) or as set by the +.Em realm +option described below. +If the user authenticates to an account qualified with a realm, that +realm will not be used when determining which options will apply. +.Pp +There is no difference to the PAM module whether options are specified +at the top level or in a +.Qo Li pam Qc +section; the +.Qo Li pam Qc +section is supported in case there are options that should be set for +the PAM module but not for other applications. +.Pp +If the same option is set in +.Pa krb5.conf +and in the PAM configuration, the latter takes precedent. +Note, however, that due to the configuration syntax, there's no way to +turn off a boolean option in the PAM configuration that was turned on in +.Pa krb5.conf . +.Pp The start of each option description is annotated with the version of -pam\-krb5 in which that option was added with the current meaning. -.SS Authorization -.IX Subsection "Authorization" -.IP alt_auth_map= 4 -.IX Item "alt_auth_map=" -[3.12] This functions similarly to the \fIsearch_k5login\fR option. The - argument is used as the authentication Kerberos principal, with -any \f(CW%s\fR in replaced with the username. If the username -contains an \f(CW\*(C`@\*(C'\fR, only the part of the username before the realm is used -to replace \f(CW%s\fR. If contains a realm, it will be used; -otherwise, the realm of the username (if any) will be appended to the -result. There is no quote removal. -.Sp +pam-krb5 in which that option was added with the current meaning. +.Ss Authorization +.Bl -tag -width Ds +.It allow_kdc_spoof +Allow authentication to succeed even if there is no host or service key +available in a keytab to authenticate the Kerberos KDC's ticket. +.It alt_auth_map= +[3.12] This functions similarly to the +.Em search_k5login +option. +The argument is used as the authentication Kerberos principal, +with any +.Qo Li %s Qc +in replaced with the username. +If the username contains an +.Qo Li @ Qc , +only the part of the username before the realm is used to replace +.Qo Li %s Qc . +If contains a realm, it will be used; otherwise, the realm of +the username (if any) will be appended to the result. +There is no quote removal. +.Pp If this option is present, the default behavior is to try this alternate principal first and then fall back to the standard behavior if it fails. The primary usage is to allow alternative principals to be used for -authentication in programs like \fBsudo\fR. Most examples will look like: -.Sp -.Vb 1 -\& alt_auth_map=%s/root -.Ve -.Sp +authentication in programs like +.Sy sudo . +Most examples will look like: +.Bd -literal + alt_auth_map=%s/root +.Ed +.Pp which attempts authentication as the root instance of the username first -and then falls back to the regular username (but see \fIforce_alt_auth\fR and -\&\fIonly_alt_auth\fR). -.Sp +and then falls back to the regular username (but see +.Em force_alt_auth +and +.Em only_alt_auth Ns ). +.Pp This option also allows a cheap way to attempt authentication in an -alternative realm first and then fall back to the primary realm. A -setting like: -.Sp -.Vb 1 -\& alt_auth_map=%s@EXAMPLE.COM -.Ve -.Sp +alternative realm first and then fall back to the primary realm. +A setting like: +.Bd -literal + alt_auth_map=%s@EXAMPLE.COM +.Ed +.Pp will attempt authentication in the EXAMPLE.COM realm first and then fall -back on the local default realm. This is more convenient than running the -module multiple times with multiple default realms set with \fIrealm\fR, but -it is very limited: only two realms can be tried, and the alternate realm -is always tried first. -.Sp -This option can be set in \f(CW\*(C`[appdefaults]\*(C'\fR in \fIkrb5.conf\fR, although -normally it doesn't make sense to do that; normally it is used in the PAM -options of configuration for specific programs. It is only applicable to -the auth and account groups. If this option is set for the auth group, be -sure to set it for the account group as well or account authorization may -fail. -.IP force_alt_auth 4 -.IX Item "force_alt_auth" -[3.12] This option is used with \fIalt_auth_map\fR and forces authentication -as the mapped principal if that principal exists in the KDC. Only if the -KDC returns principal unknown does the Kerberos PAM module fall back to -normal authentication. This can be used to force authentication with an -alternate instance. If \fIalt_auth_map\fR is not set, it has no effect. -.Sp -This option can be set in \f(CW\*(C`[appdefaults]\*(C'\fR in \fIkrb5.conf\fR and is only -applicable to the auth group. -.IP ignore_k5login 4 -.IX Item "ignore_k5login" -[2.0] Never look for a \fI.k5login\fR file in the user's home directory. -Instead, only check that the Kerberos principal maps to the local account -name. The default check is to ensure the realm matches the local realm -and the user portion of the principal matches the local account name, but -this can be customized by setting up an aname to localname mapping in -\&\fIkrb5.conf\fR. -.Sp -This option can be set in \f(CW\*(C`[appdefaults]\*(C'\fR in \fIkrb5.conf\fR and is only -applicable to the auth and account groups. -.IP ignore_root 4 -.IX Item "ignore_root" -[1.1] Do not do anything if the username is \f(CW\*(C`root\*(C'\fR. The authentication -and password calls will silently fail (allowing that status to be ignored -via a control of \f(CW\*(C`optional\*(C'\fR or \f(CW\*(C`sufficient\*(C'\fR), and the account and -session calls (including pam_setcred) will return PAM_IGNORE, telling the -PAM library to proceed as if they weren't mentioned in the PAM -configuration. This option is supported and will remain, but normally you -want to use \fIminimum_uid\fR instead. -.Sp -This option can be set in \f(CW\*(C`[appdefaults]\*(C'\fR in \fIkrb5.conf\fR. -.IP minimum_uid= 4 -.IX Item "minimum_uid=" -[2.0] Do not do anything if the authenticated account name corresponds to -a local account and that local account has a UID lower than . If +back on the local default realm. +This is more convenient than running the module multiple times with +multiple default realms set with +.Em realm , +but it is very limited: only two realms can be tried, and the alternate +realm is always tried first. +.Pp +This option can be set in +.Qo Li [appdefaults] Qc +in +.Pa krb5.conf , +although normally it doesn't make sense to do that; normally it is used +in the PAM options of configuration for specific programs. +It is only applicable to the auth and account groups. +If this option is set for the auth group, be sure to set it for the +account group as well or account authorization may fail. +.It force_alt_auth +[3.12] This option is used with +.Em alt_auth_map +and forces authentication as the mapped principal if that principal +exists in the KDC. Only if the KDC returns principal unknown does the +Kerberos PAM module fall back to normal authentication. +This can be used to force authentication with an alternate instance. +If +.Em alt_auth_map +is not set, it has no effect. +.Pp +This option can be set in +.Qo Li [appdefaults] Qc +in +.Pa krb5.conf +and is only applicable to the auth group. +.It ignore_k5login +[2.0] Never look for a +.Pa .k5login +file in the user's home directory. +Instead, only check that the Kerberos principal maps to the local +account name. +The default check is to ensure the realm matches the local realm and the +user portion of the principal matches the local account name, but this +can be customized by setting up an aname to localname mapping in +.Pa krb5.conf . +.Pp +This option can be set in +.Qo Li [appdefaults] Qc +in +.Pa krb5.conf +and is only applicable to the auth and account groups. +.It ignore_root +[1.1] Do not do anything if the username is +.Qo Li root Qc . +The authentication and password calls will silently fail (allowing that +status to be ignored via a control of +.Qo Li optional Qc +or +.Qo Li sufficient Qc Ns ), +and the account and session calls (including pam_setcred) will return +PAM_IGNORE, telling the PAM library to proceed as if they weren't +mentioned in the PAM configuration. +This option is supported and will remain, but normally you want to use +.Em minimum_uid +instead. +.Pp +This option can be set in +.Qo Li [appdefaults] Qc +in +.Pa krb5.conf . +.It minimum_uid= +[2.0] Do not do anything if the authenticated account name corresponds +to a local account and that local account has a UID lower than . If both of those conditions are true, the authentication and password calls will silently fail (allowing that status to be ignored via a control of -\&\f(CW\*(C`optional\*(C'\fR or \f(CW\*(C`sufficient\*(C'\fR), and the account and session calls -(including pam_setcred) will return PAM_IGNORE, telling the PAM library to -proceed as if they weren't mentioned in the PAM configuration. -.Sp -Using this option is highly recommended if you don't need to use Kerberos -to authenticate password logins to the root account (which isn't -recommended since Kerberos requires a network connection). It provides -some defense in depth against user principals that happen to match a -system account incorrectly authenticating as that system account. -.Sp -This option can be set in \f(CW\*(C`[appdefaults]\*(C'\fR in \fIkrb5.conf\fR. -.IP only_alt_auth 4 -.IX Item "only_alt_auth" -[3.12] This option is used with \fIalt_auth_map\fR and forces the use of the -mapped principal for authentication. It disables fallback to normal -authentication in all cases and overrides \fIsearch_k5login\fR and -\&\fIforce_alt_auth\fR. If \fIalt_auth_map\fR is not set, it has no effect and -the standard authentication behavior is used. -.Sp -This option can be set in \f(CW\*(C`[appdefaults]\*(C'\fR in \fIkrb5.conf\fR and is only -applicable to the auth group. -.IP search_k5login 4 -.IX Item "search_k5login" +.Qo Li optional Qc +or +.Qo Li sufficient Qc Ns ), +and the account and session calls (including pam_setcred) will return +PAM_IGNORE, telling the PAM library to proceed as if they weren't +mentioned in the PAM configuration. +.Pp +Using this option is highly recommended if you don't need to use +Kerberos to authenticate password logins to the root account (which +isn't recommended since Kerberos requires a network connection). +It provides some defense in depth against user principals that happen to +match a system account incorrectly authenticating as that system +account. +.Pp +This option can be set in +.Qo Li [appdefaults] Qc +in +.Pa krb5.conf . +.It only_alt_auth +[3.12] This option is used with +.Em alt_auth_map +and forces the use of the mapped principal for authentication. +It disables fallback to normal authentication in all cases and overrides +.Em search_k5login +and +.Em force_alt_auth . +If +.Em alt_auth_map +is not set, it has no effect and the standard authentication behavior is +used. +.Pp +This option can be set in +.Qo Li [appdefaults] Qc +in +.Pa krb5.conf +and is only applicable to the auth group. +.It search_k5login [2.0] Normally, the Kerberos implementation of pam_authenticate attempts -to obtain tickets for the authenticating username in the local realm. If -this option is set and the local user has a \fI.k5login\fR file in their home -directory, the module will instead open and read that \fI.k5login\fR file, -attempting to use the supplied password to authenticate as each principal -listed there in turn. If any of those authentications succeed, the user -will be successfully authenticated; otherwise, authentication will fail. -This option is useful for allowing password authentication (via console or -\&\fBsshd\fR without GSS-API support) to shared accounts. If there is no -\&\fI.k5login\fR file, the behavior is the same as normal. Using this option -requires that the user's \fI.k5login\fR file be readable at the time of -authentication. -.Sp -This option can be set in \f(CW\*(C`[appdefaults]\*(C'\fR in \fIkrb5.conf\fR and is only -applicable to the auth group. -.SS "Kerberos Behavior" -.IX Subsection "Kerberos Behavior" -.IP anon_fast 4 -.IX Item "anon_fast" +to obtain tickets for the authenticating username in the local realm. +If this option is set and the local user has a +.Pa .k5login +file in their home directory, the module will instead open and read that +.Pa .k5login +file, attempting to use the supplied password to authenticate as each +principal listed there in turn. +If any of those authentications succeed, the user will be successfully +authenticated; otherwise, authentication will fail. +This option is useful for allowing password authentication (via console +or +.Sy sshd +without GSS-API support) to shared accounts. +If there is no +.Pa .k5login +file, the behavior is the same as normal. +Using this option requires that the user's +.Pa .k5login +file be readable at the time of authentication. +.Pp +This option can be set in +.Qo Li [appdefaults] Qc +in +.Pa krb5.conf +and is only applicable to the auth group. +.El +.Ss Kerberos Behavior +.Bl -tag -width Ds +.It anon_fast [4.6] Attempt to use Flexible Authentication Secure Tunneling (FAST) by -first authenticating as the anonymous user (WELLKNOWN/ANONYMOUS) and using -its credentials as the FAST armor. This requires anonymous PKINIT be -enabled for the local realm, that PKINIT be configured on the local -system, and that the Kerberos library support FAST and anonymous PKINIT. -.Sp -FAST is a mechanism to protect Kerberos against password guessing attacks -and provide other security improvements. To work, FAST requires that a -ticket be obtained with a strong key to protect exchanges with potentially -weaker user passwords. This option uses anonymous authentication to -obtain that key and then uses it to protect the subsequent authentication. -.Sp +first authenticating as the anonymous user (WELLKNOWN/ANONYMOUS) and +using its credentials as the FAST armor. +This requires anonymous PKINIT be enabled for the local realm, that +PKINIT be configured on the local system, and that the Kerberos library +support FAST and anonymous PKINIT. +.Pp +FAST is a mechanism to protect Kerberos against password guessing +attacks and provide other security improvements. +To work, FAST requires that a ticket be obtained with a strong key to +protect exchanges with potentially weaker user passwords. +This option uses anonymous authentication to obtain that key and then +uses it to protect the subsequent authentication. +.Pp If anonymous PKINIT is not available or fails, FAST will not be used and the authentication will proceed as normal. -.Sp +.Pp To instead use an existing ticket cache for the FAST credentials, use -\&\fIfast_ccache\fR instead of this option. If both \fIfast_ccache\fR and -\&\fIanon_fast\fR are set, the ticket cache named by \fIfast_ccache\fR will be -tried first, and the Kerberos PAM module will fall back on attempting -anonymous PKINIT if that cache could not be used. -.Sp -This option can be set in \f(CW\*(C`[appdefaults]\*(C'\fR in \fIkrb5.conf\fR and is only -applicable to the auth and password groups. -.Sp -The operation is the same as if using the \fIfast_ccache\fR option, but the -cache is created and destroyed automatically. If both \fIfast_ccache\fR and -\&\fIanon_fast\fR options are used, the \fIfast_ccache\fR takes precedent and no -anonymous authentication is done. -.IP fast_ccache= 4 -.IX Item "fast_ccache=" -[4.3] The same as \fIanon_fast\fR, but use an existing Kerberos ticket cache -rather than anonymous PKINIT. This allows use of FAST with a realm that -doesn't support PKINIT or doesn't support anonymous authentication. -.Sp +.Em fast_ccache +instead of this option. +If both +.Em fast_ccache +and +.Em anon_fast +are set, the ticket cache named by +.Em fast_ccache +will be tried first, and the Kerberos PAM module will fall back on +attempting anonymous PKINIT if that cache could not be used. +.Pp +This option can be set in +.Qo Li [appdefaults] Qc +in +.Pa krb5.conf +and is only applicable to the auth and password groups. +.Pp +The operation is the same as if using the *** 1394 LINES SKIPPED *** From nobody Mon Nov 24 12:25:23 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dFQ5H6WMBz6JbCD for ; Mon, 24 Nov 2025 12:25: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFQ5H5dBzz3QRF for ; Mon, 24 Nov 2025 12:25:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763987123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zlyS35OFLajw9u/itrGEP8zoKOgoceewF+QSW+hzHPw=; b=TSju6fMsgLxAgo09FoE7bgcIIUeYXHByf7yn9gc3P+/8DFAPLIC/mKR/qpcTC9mmG5tf2Z ilaVBoVikA1hOqxFk92zwBXTlWrxarBJ+Vjy13sBwRHxFckvfsg69OJcEHYCYkvoqsfNpX o7JHgpCzz+Z11Mq9FFGvR5ZKKR4s4FGTLLXGdVbL1V4xTEuphQDH5v5kOP3AOFjckAEtaF FPTBg+LKpU3dBgfCeSueFP8cjHzG3wfXK1wnIgPn/MsWiiC8AvXTb7PkVvGZUQ8E2RUHq7 zqu79j2sZQzOahMzGMuqtP6PsEsx0LH6MEbZQ1P5+Rav3iJ5jK6EmNLKJEeq5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763987123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zlyS35OFLajw9u/itrGEP8zoKOgoceewF+QSW+hzHPw=; b=IhzgPYaFBkKHS3fafel3eJdyBwniBwMypLstzgB3bNujCfxDMzOl/e7iorItCaZHwRsOeS KTSrIZX150BsGyiS7fgCLwqKiw1MT+LZgfGcA7bVhUyfIPhux4d4yS7JVmEhTO00sWG2rU o45XZKIXLEm6ecL688nJ3Jy2/Us5JgnHDzo/8kfoWE4WmwPz8VNVIH0Gx88UCcgtIUe22Z qA0MztKi0SHdSbZWFKWTDfajDBTOwu/a7BcyiZoZSYwISDPrE1qevtlrjO0D3Pz/ROhS37 A3dtbVSX28j/g/B2WscZHlFFL/ovbxeVQ7Zjd9l1ifkhZTtqo7LTniMOPypF0g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763987123; a=rsa-sha256; cv=none; b=yunvxlaG3j3G8TUO/US/igbod59gpzZJrggxYltTxnDSGEtkhtTDPhYgncs0yht57zBJlX NimXuOv6sWAD9JI4a0EDuiyJNlG+WPMUEQ44N7J2NbRBSXBAczDDy8daFVlpFsAZLqiQZO bkEYslR0rwjYn4F+E/8W4X/2VrlqR4GjrgEZvcPeavMoYoS8barKwHxvZynP79phOegVlp lnMBNwffSgsrZHlhHDS85kQxA90Bb1yXFGNe1z2ExxINcbPxYXl2z/60epsizTux4gLJex +B2c+JpqiyQ4V1ptoUgsdQwqs7Nf7P2o7qhxkNICVPzNzIHb7MoTmbKUz5pKSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFQ5H5BTsz1CsT for ; Mon, 24 Nov 2025 12:25:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id fc88 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 24 Nov 2025 12:25:23 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 4991bb6a5c45 - stable/15 - snd_hda: Patch Lenovo V15 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 4991bb6a5c45b518df9b1a265c4f6f8c17ea4493 Auto-Submitted: auto-generated Date: Mon, 24 Nov 2025 12:25:23 +0000 Message-Id: <69244eb3.fc88.15ca5dd6@gitrepo.freebsd.org> The branch stable/15 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=4991bb6a5c45b518df9b1a265c4f6f8c17ea4493 commit 4991bb6a5c45b518df9b1a265c4f6f8c17ea4493 Author: Christos Margiolis AuthorDate: 2025-11-17 16:09:18 +0000 Commit: Christos Margiolis CommitDate: 2025-11-24 12:25:19 +0000 snd_hda: Patch Lenovo V15 PR: 290496 Tested by: adrian Sponsored by: The FreeBSD Foundation MFC after: 1 week (cherry picked from commit 5f624d923db0f2fb33990948cffdc24da44deaa8) --- 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 91bb244578c7..d4267aae80f8 100644 --- a/sys/dev/sound/pci/hda/hdaa_patches.c +++ b/sys/dev/sound/pci/hda/hdaa_patches.c @@ -341,7 +341,8 @@ hdac_pin_patch(struct hdaa_widget *w) } else if (id == HDA_CODEC_ALC257 && (subid == LENOVO_L5AMD_SUBVENDOR || subid == LENOVO_L5INTEL_SUBVENDOR || - subid == LENOVO_IDEAPAD3_SUBVENDOR)) { + subid == LENOVO_IDEAPAD3_SUBVENDOR || + subid == LENOVO_V15_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 c11e6b2d6810..04b925b31fd4 100644 --- a/sys/dev/sound/pci/hda/hdac.h +++ b/sys/dev/sound/pci/hda/hdac.h @@ -389,6 +389,7 @@ #define LENOVO_3000_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x384e) #define LENOVO_IDEAPAD330_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x3808) #define LENOVO_IDEAPAD3_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x3881) +#define LENOVO_V15_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x3886) #define LENOVO_ALL_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0xffff) /* Samsung */ From nobody Mon Nov 24 17:31:26 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dFXtR07Hbz6HY38 for ; Mon, 24 Nov 2025 17:31: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFXtQ25Chz44ys for ; Mon, 24 Nov 2025 17:31:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764005486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qmexoPRHXWjAoh4tJXArQ302MK62/gzqKQHRN9MQ5mY=; b=mmsk83UDZgks/NwtT7j2U4mtmb05MQLlxu6DGVhEjRv2tpNbQ6JR7cfkGsTVNbK4DAuUa9 OUGaUW6c2KXdYMmfJepZ6ebtST+XqIe35G3kR3cf0igDE8PdMp8N01zJakIFDiUipMDw6n 4UhfcQ/C8OQA4k+9hjyJB7vBJ+vOznDVKp++TJjSspgb1vlkINoPesiaAhWh6+HfYQ2baK nrGbTSO80qanDfJAckRA5XbblXTiqtY+2LsS3BK2fVFmrACQFSCOiwetrMTHseVpi1xBDZ +fpOogyrGbgUaHlpCLRSwhWZ/ezwe3GwT47REERECe6skRPNZNJlgDTuAlfj4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764005486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qmexoPRHXWjAoh4tJXArQ302MK62/gzqKQHRN9MQ5mY=; b=azeviXGlkWoUn9r0Titt3QPpB6sMfMZc88sL5Bfk3LZtlgq5hpj/EqDpvhwkez5uOSeAzC nJ3Wt2ed73htBmluPNavD46PdJXDrXKC4z/NXaHRy6E+z0IO4Wh9fNc4O+6i9M40c4W/QF 7ulvOTZqDsEk/YHu3JH/lpcuXZwLaymZXw6o+Cax0rl6e52RmNv55zZFkL7l+WdCNSe0VU ol3imVd8k2De1X3V2/C8W74MjxaXgvaeZAkimCWHi+c05mpu/nvT4zMo5MSKpElqTp8Yo8 ZbhwbuCpiqxkjIQTX8nCeTmxShtImJuG+wM/Lkm6aZBuyZZt12K6W9w+uRtV5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764005486; a=rsa-sha256; cv=none; b=f8bDK1LJnX5Ob9SKATE5S9K1SIyZkEEFVDsENfnN2xMLc7F8IHPkPsWJAC7VOWpQQpFQ/A zX1D9PUSa7SOMTQTgakkdAsQNoI+ZF+Azv3pkizO3eTMCJs53Z9aBeaJtJvF8hMRwPYpK1 FgD/h9DmmXPyv9iezf52s20hflhupl9kRngoQGvkzqLoPgbs64pcjrikx6yML7aDvFItX9 kWnUAoh/4ELD2PJK0Ul3yvJV+1GbWBBX25k3lz/rrUHafqcxvYQJMH6IO8r+TvT2m/mRdM 1gNi4T5cdbJM0RUxC2R121lpXwwj5IoUKTl3E4aypA3UdPMQY9HEwHZ42o+4bA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFXtQ0R38z7xS for ; Mon, 24 Nov 2025 17:31:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3e9a0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 24 Nov 2025 17:31:26 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Mark Johnston From: Colin Percival Subject: git: 76883b793db8 - releng/15.0 - inotify: Work around the vput() bug directly List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/15.0 X-Git-Reftype: branch X-Git-Commit: 76883b793db8385dd98bc81ac993f73eeda6164f Auto-Submitted: auto-generated Date: Mon, 24 Nov 2025 17:31:26 +0000 Message-Id: <6924966e.3e9a0.3ec1daa2@gitrepo.freebsd.org> The branch releng/15.0 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=76883b793db8385dd98bc81ac993f73eeda6164f commit 76883b793db8385dd98bc81ac993f73eeda6164f Author: Mark Johnston AuthorDate: 2025-11-15 18:00:44 +0000 Commit: Colin Percival CommitDate: 2025-11-24 17:31:16 +0000 inotify: Work around the vput() bug directly For 15.0, apply a minimal fix which at least ensures that inotify can't trigger the latent race described in commit 99cb3dca4773 ("vnode: Rework vput() to avoid holding the vnode lock after decrementing"). Approved by: re (cperciva) Reviewed by: olce, kib MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D53774 (cherry picked from commit ebc17879f0885ca87644980f6275b9759b311eb3) (cherry picked from commit 1f6e3abf41718e8e4a309be122f0a6048e9c5772) --- sys/kern/vfs_inotify.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_inotify.c b/sys/kern/vfs_inotify.c index b265a5ff3a62..de8f99ea8d2f 100644 --- a/sys/kern/vfs_inotify.c +++ b/sys/kern/vfs_inotify.c @@ -380,7 +380,14 @@ inotify_unlink_watch_locked(struct inotify_softc *sc, struct inotify_watch *watc static void inotify_free_watch(struct inotify_watch *watch) { - vrele(watch->vp); + /* + * Formally, we don't need to lock the vnode here. However, if we + * don't, and vrele() releases the last reference, it's possible the + * vnode will be recycled while a different thread holds the vnode lock. + * Work around this bug by acquiring the lock here. + */ + (void)vn_lock(watch->vp, LK_EXCLUSIVE | LK_RETRY); + vput(watch->vp); free(watch, M_INOTIFY); } From nobody Mon Nov 24 17:42:51 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dFY7b4krDz6HYhv for ; Mon, 24 Nov 2025 17:42: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFY7b3p56z46Sr for ; Mon, 24 Nov 2025 17:42:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764006171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aXltT/d0NoDiuwDxNbTdytMBKWEQ6a5k8c3xZbtZmXU=; b=gOJAQxaQRb6N78/EO8M0/KMSXIWhjCJojSwXAWj1wQct7JXnRio9l1oXn9i3JYKCKIonuX 1xIFVun0d7RZBGO40fa+ofrQ6RIGlY/rQP8qUnUS2rGN/czPmVR6i9nMX9+wJ4IZhdRYB9 r+hVOID3/HtlhUaqh2Tt2Q5eD5IQjjFVJ2xRcpmBz01iXlL1pcGH60S93VITbA+1MN+qoq y0kA7O/RNW0OaDHnCemzNebkIvi5gSAuDRrCbvxWhGpVMGD6eTVAANoFdRPZTIZagdpZhx aoHGMKTyPUSQIFxfhkWtKFJWTtohMhUvYkts1n6bT2XCNp30bdcv/EUE1Tacog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764006171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aXltT/d0NoDiuwDxNbTdytMBKWEQ6a5k8c3xZbtZmXU=; b=Drxy1Hh5/7vfCIs7dfJaQzrOxfO1H8r84FdK9x1h2qs/+nNQmc7WovCzGouMe8RUIItr1e 2N+Y2i23QfFbuMfOBwMx4T6yIssiVH01vd13yRh8YE/QuZvVr3RjGsAsl0aR4vFfxRsiVB CYpsCZeeVAFse5XHLRtKr9PYVbVQMahOifpawXWK0bQjJrfmyqBQN89MtB37GHorxaLF+9 d7GGw5IgERqIP4fmt/Pay/+kKXaFuhg2YW1uIS1W34ZSR+Yu5+A7gHOrDrTu/0iVzUEpJQ 7FQMEPNUN5yIhNbpIju5LYioxFQR+LFbU4oHBUzlcm7M85Evf/IuM3pxHhXDyQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764006171; a=rsa-sha256; cv=none; b=o0P/jZkBTS53b92Iv8llwha/ajsXJb1RYtFwFO2ImO5D7foAQ0pXH10J3Oubwk/CYwqFCt aWjAgPp5iMOFigxd+MHwkRqL5hgKbODEFgfp7Ls4Tt5KmOt0wQ9kIEmWmnIflx/WWi9Feh ZOowgqZucU+M95rVUnNtyBfAth5N2hYMoHAhh/j2O9OqRCOVzToACNYpb8+y63TslGbJhA YD7SvSRLU3DKZaVUjyySzgyaiNHk9uIjE/bhgFs9sS+Mk+vh+6Lmjsh9TP5Ifb/2IOdvO2 y2Sn9pqRBGMjFnQ7WTo6SM22gVS5ECTsl3PKSxAspK7X3HKvRrIjO0ou7hS+aw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFY7b3PV6z8WJ for ; Mon, 24 Nov 2025 17:42:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 8b07 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 24 Nov 2025 17:42:51 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 91e2d7b9b273 - releng/15.0 - 15.0: Update to RC4 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/15.0 X-Git-Reftype: branch X-Git-Commit: 91e2d7b9b2732001909b551980bb9dfdcf80805e Auto-Submitted: auto-generated Date: Mon, 24 Nov 2025 17:42:51 +0000 Message-Id: <6924991b.8b07.59dbb944@gitrepo.freebsd.org> The branch releng/15.0 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=91e2d7b9b2732001909b551980bb9dfdcf80805e commit 91e2d7b9b2732001909b551980bb9dfdcf80805e Author: Colin Percival AuthorDate: 2025-11-24 17:42:12 +0000 Commit: Colin Percival CommitDate: 2025-11-24 17:42:12 +0000 15.0: Update to RC4 This will hopefully be the final RC build before the release. Approved by: re (implicit) --- sys/conf/newvers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index e5095a8b04bc..53749b31fb6e 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -51,7 +51,7 @@ TYPE="FreeBSD" REVISION="15.0" -BRANCH="RC3" +BRANCH="RC4" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Mon Nov 24 20:28:47 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dFcq85DKCz6HnF9 for ; Mon, 24 Nov 2025 20:28: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFcq84dQlz3WHr for ; Mon, 24 Nov 2025 20:28:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764016132; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UB2emz1KRTiWAoH8WtwCa+5Hp7N9oVyRAv4TnV9YFsQ=; b=SM2IvSdhuok9fukrWiFgxdL8Q9BGRJ5OJBzHV+OA4oNj/jQJ4k8wlc1e60h74cQm2w8e0C RGGhH4aH86y94JE1Mx999wV1V56J8B3HXB5cKPgE+zwSUqq8IFMx3NqVPmW2hYpmHbzKl4 w/Ww1eYwVpCg7dfwgxUWg2xXWUtVjhReNSElBaACs8hYAh9FPjoB+D4gop+FoP7T/tuNkM 0SMlBUtH5732/yo4mOq25uyMmiuZ7P3Yst+yBRjdLjb361gwmeOGfcfTjg7Ym26MUEM9HR P2ILW3Bi4R80InfCJagpCRCZk9kEFhT1mECZIzKfibIqpTYy2ZjRgU4A/lcFMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764016132; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UB2emz1KRTiWAoH8WtwCa+5Hp7N9oVyRAv4TnV9YFsQ=; b=tQjOPb0DaV7/h5X170vuq5OLxcaEzkNzHss3PwsEszA90QyCNfRx99DQ5g9CpnVQmqo22I I5VGOFCX/8nQG+NPPX04DEA5h1BpR8PbHnXmX9ZvUkaJGfG1Si85jPKDDG6t/hUaQxiwT8 25pVthafw5BzcmYNyeVU+neCBBH+D0RD+EtlryWBv3RC0Vt3DoNhFNpWyK8Yt65959orkl qFiLdj6xsNJj/9R9p4nrTfeBel6YvOpbqn8HvTo+Fv39M3qXLFM4TjEtQjkJcV6SWbVJiR SCpX/CddnKafkfyNFNQDF9XIqX7ftrAdHqbnrdYpDU9lGbHYts/ZEfkWsLT5yg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764016132; a=rsa-sha256; cv=none; b=heSIpSjhpbK5PUhdzVtwCtUVXzF05CRQc1xkCTiZ50w6w0pHQ57AAhxCaHJ+dSgNxrPA73 z6NoP7jEp/DuREdQr3KKJHHegUm9LtSrDtPTMS5uTu541evn/mPq684tIqHw8aTE9Pa7fo o53viF4KXw9fv9tHypCpskXCmqchNXp7oRBLA6IKiMGyk4py/s2muPFYfv46ejF/zodVSp etswN5welUc9uFGrP/BcNXqhs+ywhD/qDqMPp3NO8b9MZF9KJTW3lH5QCEBe+BOnqkXICI o0pqp6oqPxpGKbGhRAcrI5E0GdA/U58suDHL9NorC1MQEL7qE1mvGn3CzoURKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFcq848KRzTq7 for ; Mon, 24 Nov 2025 20:28:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 29a8b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 24 Nov 2025 20:28:47 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Boris Lytochkin From: Andrey V. Elsukov Subject: git: ff3c48a64fe2 - stable/15 - ipfw: fix lookup dst-ip opcode List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: ff3c48a64fe2f9c1acf531e088dfb14e31404bae Auto-Submitted: auto-generated Date: Mon, 24 Nov 2025 20:28:47 +0000 Message-Id: <6924bfff.29a8b.6dc58e0d@gitrepo.freebsd.org> The branch stable/15 has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=ff3c48a64fe2f9c1acf531e088dfb14e31404bae commit ff3c48a64fe2f9c1acf531e088dfb14e31404bae Author: Boris Lytochkin AuthorDate: 2025-11-18 10:31:56 +0000 Commit: Andrey V. Elsukov CommitDate: 2025-11-24 20:28:09 +0000 ipfw: fix lookup dst-ip opcode Opcode handling should not fall through to the LOOKUP_DSCP type. Reviewed by: melifaro Obtained from: Yandex LLC Differential Revision: https://reviews.freebsd.org/D53775 (cherry picked from commit 8012c61bef3bb19a48d8459b38b65e27d46c186c) --- sys/netpfil/ipfw/ip_fw2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/ipfw/ip_fw2.c b/sys/netpfil/ipfw/ip_fw2.c index b59d8d08bf80..2b7f38d2e9a6 100644 --- a/sys/netpfil/ipfw/ip_fw2.c +++ b/sys/netpfil/ipfw/ip_fw2.c @@ -2120,8 +2120,8 @@ do { \ pkey = &args->f_id.dst_ip6; else pkey = &args->f_id.src_ip6; - } else /* only for L3 */ - break; + } + break; case LOOKUP_DSCP: if (is_ipv4) key = ip->ip_tos >> 2; From nobody Tue Nov 25 00:43:01 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dFkSP5tmqz6H6rF for ; Tue, 25 Nov 2025 00:43: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFkSP5DpQz42Bb for ; Tue, 25 Nov 2025 00:43:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764031381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J4btw5fGfmmmqrGYSVoLqek44gv8IG6vcAhJdlmv0gs=; b=IAZfAN9Ginjijg2ZkD5QDk+dnSMzk7yux0LG1PCKkrIFav09H8zGRXXNyEGhOa0cg5euwV vtJhPPAwrLeLVyU7G1mmPisj1QGLpTYxZZ7R6SHhxWGEmycpGoJn5sJ6aZiGekRMl6kQPC JD9Mey9nBgOfDYM23OjnyvbEc1ctronUugd0+tNFOi5AuMYnQ/bWKZaBcjl85lqyzXBkDL 13yxhQ0l8An4X0ULMRo/4K0uWUKrUXUC3XIxpTZG0d5vKmF6pxC8rumvNbf0a8PpMNDlGg n3EclhkB7n6dCmUUBJ4Nbs68KZPUFZ0cfO+juaT/r7iWr3GIXHhMIQEyeUwnFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764031381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J4btw5fGfmmmqrGYSVoLqek44gv8IG6vcAhJdlmv0gs=; b=cUY68rr5KDqNguyJkGo9suBZmWXzyojnoPZo3AME4DJIdb5Jpeoe+aXG5ADRqNwqe8QjQn 52aKjttVMn/cPlxHcJeDX758ptnioiKm4hSmGO1D0qEpwn32lxjNxaku+eADvVTqSfTian I7uxutXB2qQzDJbP0kY2IS/mSy9K2cH+wKdB9Hxmh/tSOEttco3L2HMr+SF8IfDg1K+6ET dA4EVCgT+VMUVWTRXwBVY/niz5Kd/p2UJUHNKGWJPXk3Pb/LS3lYofX42zKtaIHeUApiVY I2mDPktH6d0v3IHwX9WjOA+sbrLd+KqE7v2oDnAedZxy7zxOtWVs7QKyXojXIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764031381; a=rsa-sha256; cv=none; b=gX545dOSGFUibznyIPxUL7Brwlf1/kQBPzfmBnllbt529p99n0cHiq/O7jDsrfXo6cy8OE bqPOI9xb21T6R3Z7HB20DDHJ/P1D8Gi+AAdUZPo7UTHrmz6jsy7hf0XJN6H6bsFRpnDTB6 5MidihiJ+dwKDxvqfZ4iCiO6KAgsyINOwbK27xqeqzLrR1KaDQlfLRFqlIED4pYdOxn0nG 5SIkitpvgL1t2dYsU5sIxCJP8qrvsL7qbitYaf5E9PywaL112RidQV9tzFm0q4ZyT5ZtRl 4KFd1bTe0MER0R/dx2ZdSvGcUg1UyIKaNaveN5upqB/PFQ04kFB1wIQGq781iQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFkSP4nxwzdd0 for ; Tue, 25 Nov 2025 00:43:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24f53 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 25 Nov 2025 00:43:01 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: a5adb1ca3526 - stable/15 - nuageinit: Silence luacheck warnings and fix typos List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: a5adb1ca3526e3a0139cf4305effa8ec527580f3 Auto-Submitted: auto-generated Date: Tue, 25 Nov 2025 00:43:01 +0000 Message-Id: <6924fb95.24f53.4220a51b@gitrepo.freebsd.org> The branch stable/15 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=a5adb1ca3526e3a0139cf4305effa8ec527580f3 commit a5adb1ca3526e3a0139cf4305effa8ec527580f3 Author: Jose Luis Duran AuthorDate: 2025-10-21 13:28:45 +0000 Commit: Jose Luis Duran CommitDate: 2025-11-25 00:39:15 +0000 nuageinit: Silence luacheck warnings and fix typos No functional change intended. Reviewed by: bapt, dtxdf, kevans MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D53238 (cherry picked from commit 81af04b081402d131c7e34b30c88b7c337271fad) --- libexec/nuageinit/nuage.lua | 6 ++---- libexec/nuageinit/nuageinit | 24 +++++++++++------------- libexec/nuageinit/tests/addfile.lua | 2 +- libexec/nuageinit/tests/nuageinit.sh | 2 +- 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index 3eeb2ea0b44c..2d962b540b23 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -69,7 +69,7 @@ local function errmsg(str, prepend) end local function chmod(path, mode) - local mode = tonumber(mode, 8) + mode = tonumber(mode, 8) local _, err, msg = sys_stat.chmod(path, mode) if err then errmsg("chmod(" .. path .. ", " .. mode .. ") failed: " .. msg) @@ -150,8 +150,6 @@ local function splitlines(s) end local function getgroups() - local ret = {} - local root = os.getenv("NUAGE_FAKE_ROOTDIR") local cmd = "pw " if root then @@ -579,7 +577,7 @@ local function settimezone(timezone) root = "/" end - f, _, rc = os.execute("tzsetup -s -C " .. root .. " " .. timezone) + local f, _, rc = os.execute("tzsetup -s -C " .. root .. " " .. timezone) if not f then warnmsg("Impossible to configure time zone ( rc = " .. rc .. " )") diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index f68e45701b6c..148f5b3b30cd 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -228,10 +228,10 @@ local function nameservers(interface, obj) local resolv_conf = root .. "/etc/resolv.conf" - resolv_conf_attr = lfs.attributes(resolv_conf) + local resolv_conf_attr = lfs.attributes(resolv_conf) if resolv_conf_attr == nil then - resolv_conf_handler = open_resolv_conf() + local resolv_conf_handler = open_resolv_conf() resolv_conf_handler:close() end @@ -294,10 +294,11 @@ local function match_rules(rules) -- with the matching interfaces must be returned. This changes the way we initially -- thought about our implementation, since at first we only needed one interface, -- but cloud-init performs actions on a group of matching interfaces. + local interface local interfaces = {} if rules.macaddress then local ifaces = get_ifaces_by_mac() - local interface = ifaces[rules.macaddress] + interface = ifaces[rules.macaddress] if not interface then nuage.warn("not interface matching by MAC address: " .. rules.macaddress) return @@ -347,11 +348,11 @@ local function write_files(files, defer) end end -local function write_files_not_defered(obj) +local function write_files_not_deferred(obj) write_files(obj.write_files, false) end -local function write_files_defered(obj) +local function write_files_deferred(obj) write_files(obj.write_files, true) end -- Set network configuration from user_data @@ -380,6 +381,7 @@ local function network_config(obj) extra_opts = extra_opts .. " wol" end if v.mtu then + local mtu if type(v.mtu) == "number" then mtu = tostring(v.mtu) else @@ -679,14 +681,14 @@ if line == "#cloud-config" then network_config, ssh_pwauth, runcmd, - write_files_not_defered, + write_files_not_deferred, } local post_network_calls = { packages, users, chpasswd, - write_files_defered, + write_files_deferred, } f = io.open(ni_path .. "/" .. ud) @@ -703,12 +705,8 @@ if line == "#cloud-config" then for i = 1, #calls_table do if citype == "nocloud" and calls_table[i] == network_config then - netobj = parse_network_config() - if netobj == nil then - network_config(obj) - else - network_config(netobj) - end + local netobj = parse_network_config() or obj + network_config(netobj) else calls_table[i](obj) end diff --git a/libexec/nuageinit/tests/addfile.lua b/libexec/nuageinit/tests/addfile.lua index 98d020e557c0..ea98369f1909 100644 --- a/libexec/nuageinit/tests/addfile.lua +++ b/libexec/nuageinit/tests/addfile.lua @@ -35,7 +35,7 @@ if str ~= f.content then n.err("Invalid file content") end --- the file is overwriten +-- the file is overwritten f.content = "test" str = addfile_and_getres(f) diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index 2b7c5226c97a..851f7110378a 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -890,7 +890,7 @@ EOF atf_check -o inline:"plop" cat file1 atf_check -o inline:"" cat emptyfile atf_check -o inline:"bla\n" cat file_base64 - test -f foo && atf_fail "foo creation should have been defered" + test -f foo && atf_fail "foo creation should have been deferred" atf_check -o match:"^-rwxr-xr-x.*nobody" ls -l file_base64 rm file1 emptyfile file_base64 atf_check -o empty /usr/libexec/nuageinit "${PWD}"/media/nuageinit postnet From nobody Tue Nov 25 00:43:02 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dFkSR35rPz6J5y4 for ; Tue, 25 Nov 2025 00:43: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFkSR0F1Nz42T8 for ; Tue, 25 Nov 2025 00:43:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764031383; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BchFr2j2vR+FS3BqAkT1mC505IuYvMZ9oBdhAcg2lP4=; b=WQh5rBCYVh6lxErf+FnfMeGyYIikmdg7t661YItTJGd6K9hbYBsRRMmEOE3LV8rQUuYZhM OFjmiUA7xIHCAypKZMn+3hUtpAxC29zKNLixhn5X4zrDxK+DMpDqAK4HylpC+zXwV61/pE 7x8Ugxj9xJjg70Hbd2EMy+iazjjKjfr3PN7bSSD3ElIhO8vDhrKg+5Ihz+whNBRmomR7Mm 3riR0XL+8w4UsrW2t5JpHY9sb0LXAl1HoofBkfwKnQkcOVWLK2zBDA+jo6dSC6pNmMoSGD KBr/TUPhIBrEN38rQPTC1RN+UG/N6BbQagoadSj/kOXrtv6t1fP0ILpcJGHhqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764031383; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BchFr2j2vR+FS3BqAkT1mC505IuYvMZ9oBdhAcg2lP4=; b=hGRUlU2Je0JTEyHGLMJSSeTvJQMUCm0l5Gbzd/LDhOf7DGohwx74rydtcUOnSz9p/rK6kE jLlYxRDOhZyxZx9XEddGEwEtoXAPUXRj61rY1Lu6OxbvIuHFPrHzJzzZGpaUqpnSO8CSBR LjkysO7AIYSn0YSAAWx2oofmk2BrcQl9QwqOOd/Ky/84ERSn2uVZo0xqZBOVDioRCtAo07 49LfkomSa7/D1aFj1mUb3Ka4clD45wJWqdJcI+KR6EwzcjH++bAN7sgCOELO1+rGZ7MEnf aiCxZPhB4CTicVmmXjd0mJaKfITIRokmEn1d3Na5BmUhyG0AteR7oQshzkrOkg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764031383; a=rsa-sha256; cv=none; b=e+xAQ8yym7GK1OiUzOCxTkC8b5p6jgB56NzVWkFHYkxr+SapoLBhtwqEKlUTgLZQPvqfvG dz+OhAaw7xlYrRfn3kB6k/opant5cRaa/wQveYNb9IJRdGSzE/qcIVSw3lJ6zPC+39v1qi NfW9xIu3Lsw5MYQ0H3qx71EL54ivWD2j0k2Hl9R8Mih3luqPj9CXD9yCqNfLSVrLxWo+Nz Vnb/ZjxQedu0jAeqD+l9B01ZbYnPuWw8bvMDA8EjLgVS9Z2zKrOj0fuapqhArhs325kUmu DOxI/xIj6joDUK+SFmrIOmjHyWl/2RKllfHaSVA5TvR1FeU66OTXjCRFi+Iytw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFkSQ5ZY9zfNL for ; Tue, 25 Nov 2025 00:43:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24715 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 25 Nov 2025 00:43:02 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: a7cadff8cccc - stable/15 - nuageinit: Add guards against empty user data List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: a7cadff8ccccfa3f3cde9a501a0fe9a78299d41a Auto-Submitted: auto-generated Date: Tue, 25 Nov 2025 00:43:02 +0000 Message-Id: <6924fb96.24715.16eeea8f@gitrepo.freebsd.org> The branch stable/15 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=a7cadff8ccccfa3f3cde9a501a0fe9a78299d41a commit a7cadff8ccccfa3f3cde9a501a0fe9a78299d41a Author: Jose Luis Duran AuthorDate: 2025-10-21 13:11:50 +0000 Commit: Jose Luis Duran CommitDate: 2025-11-25 00:39:37 +0000 nuageinit: Add guards against empty user data Add guards against attempting to process a user data file with an empty first line or contents. PR: 290395 Reviewed by: bapt (earlier), dtxdf, markj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D53239 (cherry picked from commit 57d25b6333523491ac7a3e869bd5d16127203eed) --- libexec/nuageinit/nuageinit | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index 148f5b3b30cd..0870d6570d0e 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -662,8 +662,16 @@ if not f then os.exit(0) end local line = f:read("*l") +if not line or #string.gsub(line, "^%s*(.-)%s*$", "%1") == 0 then + f:close() + os.exit(0) +end if citype ~= "postnet" then local content = f:read("*a") + if not content or #string.gsub(content, "^%s*(.-)%s*$", "%1") == 0 then + f:close() + os.exit(0) + end nuage.mkdir_p(root .. "/var/cache/nuageinit") local tof = assert(io.open(root .. "/var/cache/nuageinit/user_data", "w")) tof:write(line .. "\n" .. content) From nobody Tue Nov 25 00:43:21 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dFkSn6gGkz6J622 for ; Tue, 25 Nov 2025 00:43: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFkSn645Rz42jY for ; Tue, 25 Nov 2025 00:43:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764031401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p9ANSpRpu9LnJUWSdHRFQM8EVVMGd1ly5N3n4mrBihM=; b=G46rQmIxTWXKFGHj0N+68yY2Dy9/ofiWi5xSy1iBDQTIJ9gNFtupSsk/eg+uwRJNZ5lAaw NoTCFM7IeeSUXzVowXD2HEq6Chu2OA2WLAZCFyg3FzGUYHOU9qXDuDnqB5LNCERj4PDzx8 +GrUe9bCNpmhdymGYFMyelcsr72dhyvD8+ZTPQsJbhQhZPllT53Oyv/hQo1arflqEQ8dKa 2AlbyjU21xRmHTJH50ZT0gMXTAcG1djG6O/qrvaC/fNTBA7qn82iuE4Gfawg+tIFw6TCvF yaWtLXnv4WM3JlkaulX8/eEWDEZPqeWF7BWp7NOsqKBIAxnXQtc+17dL4xmigQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764031401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p9ANSpRpu9LnJUWSdHRFQM8EVVMGd1ly5N3n4mrBihM=; b=bk9eAgq1lnj/Pnbfhjw6txz6v8I+KCt2kuazXCpqXCyixoM9JlorcNeP/lDj97xKJao6So +LwOYpUQ0ljqogyhTTbJJRvEaMFA3lYiZElceA4cyQd/3lFMSRTpBsbBq/UB2riPuXNYQu 51/AgjkIwINhbHV2sO1w9oqBOurSs1dDRJ56YQZI4dvXrkj88Kcos9UZXU8YRZMLActRxv LiP6OOungZOp4EbK/fRxN2Re59FC5mc+SpPm2PhKG4fWvbcevTklQMzi1id1W8XhIpbTBI tDp/NtB62Zi9LPyn5SRwPzotbbijUsMtelr6k+aWyQuMkwaLlouEV9gHNiQESA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764031401; a=rsa-sha256; cv=none; b=RRkeSgInpzjLRvISKPZDC8PcVLK/PjkW9TiWCLENlF3dVcBVPV7MWRZt8UvWiS/5H+VT+x oJP6kFz0IPjnENkfyRFrRuK6fhvtL5zLRSxUK4s34rtlq3YA8XVyWigwoKzGP1DLDQibow HjU3/cn1WDd55BStqviRoReyhAAKs1UKnHFDQAYyUPLL0A2Yc+BimUYuCFSnUHrAD27ZHK 32+no2U5kk0LSnmmFmFHxqwFkKmHx5G1xVFnTkWjh/3tBplBEDgBuWLyNc89vtqCDz1JUl LO2tz/kfzR7glSiOv+vKA7UcgtmanRro0FPQZCHGiUv7c+m4vPyDdcxf9LILzA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFkSn5dVNzfLC for ; Tue, 25 Nov 2025 00:43:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2469b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 25 Nov 2025 00:43:21 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 9eca9724b870 - stable/14 - nuageinit: Silence luacheck warnings and fix typos List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9eca9724b8706cd185f99ed5a638fad9ce9abe1b Auto-Submitted: auto-generated Date: Tue, 25 Nov 2025 00:43:21 +0000 Message-Id: <6924fba9.2469b.2dc4e669@gitrepo.freebsd.org> The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=9eca9724b8706cd185f99ed5a638fad9ce9abe1b commit 9eca9724b8706cd185f99ed5a638fad9ce9abe1b Author: Jose Luis Duran AuthorDate: 2025-10-21 13:28:45 +0000 Commit: Jose Luis Duran CommitDate: 2025-11-25 00:42:23 +0000 nuageinit: Silence luacheck warnings and fix typos No functional change intended. Reviewed by: bapt, dtxdf, kevans MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D53238 (cherry picked from commit 81af04b081402d131c7e34b30c88b7c337271fad) --- libexec/nuageinit/nuage.lua | 6 ++---- libexec/nuageinit/nuageinit | 24 +++++++++++------------- libexec/nuageinit/tests/addfile.lua | 2 +- libexec/nuageinit/tests/nuageinit.sh | 2 +- 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index 3eeb2ea0b44c..2d962b540b23 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -69,7 +69,7 @@ local function errmsg(str, prepend) end local function chmod(path, mode) - local mode = tonumber(mode, 8) + mode = tonumber(mode, 8) local _, err, msg = sys_stat.chmod(path, mode) if err then errmsg("chmod(" .. path .. ", " .. mode .. ") failed: " .. msg) @@ -150,8 +150,6 @@ local function splitlines(s) end local function getgroups() - local ret = {} - local root = os.getenv("NUAGE_FAKE_ROOTDIR") local cmd = "pw " if root then @@ -579,7 +577,7 @@ local function settimezone(timezone) root = "/" end - f, _, rc = os.execute("tzsetup -s -C " .. root .. " " .. timezone) + local f, _, rc = os.execute("tzsetup -s -C " .. root .. " " .. timezone) if not f then warnmsg("Impossible to configure time zone ( rc = " .. rc .. " )") diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index f68e45701b6c..148f5b3b30cd 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -228,10 +228,10 @@ local function nameservers(interface, obj) local resolv_conf = root .. "/etc/resolv.conf" - resolv_conf_attr = lfs.attributes(resolv_conf) + local resolv_conf_attr = lfs.attributes(resolv_conf) if resolv_conf_attr == nil then - resolv_conf_handler = open_resolv_conf() + local resolv_conf_handler = open_resolv_conf() resolv_conf_handler:close() end @@ -294,10 +294,11 @@ local function match_rules(rules) -- with the matching interfaces must be returned. This changes the way we initially -- thought about our implementation, since at first we only needed one interface, -- but cloud-init performs actions on a group of matching interfaces. + local interface local interfaces = {} if rules.macaddress then local ifaces = get_ifaces_by_mac() - local interface = ifaces[rules.macaddress] + interface = ifaces[rules.macaddress] if not interface then nuage.warn("not interface matching by MAC address: " .. rules.macaddress) return @@ -347,11 +348,11 @@ local function write_files(files, defer) end end -local function write_files_not_defered(obj) +local function write_files_not_deferred(obj) write_files(obj.write_files, false) end -local function write_files_defered(obj) +local function write_files_deferred(obj) write_files(obj.write_files, true) end -- Set network configuration from user_data @@ -380,6 +381,7 @@ local function network_config(obj) extra_opts = extra_opts .. " wol" end if v.mtu then + local mtu if type(v.mtu) == "number" then mtu = tostring(v.mtu) else @@ -679,14 +681,14 @@ if line == "#cloud-config" then network_config, ssh_pwauth, runcmd, - write_files_not_defered, + write_files_not_deferred, } local post_network_calls = { packages, users, chpasswd, - write_files_defered, + write_files_deferred, } f = io.open(ni_path .. "/" .. ud) @@ -703,12 +705,8 @@ if line == "#cloud-config" then for i = 1, #calls_table do if citype == "nocloud" and calls_table[i] == network_config then - netobj = parse_network_config() - if netobj == nil then - network_config(obj) - else - network_config(netobj) - end + local netobj = parse_network_config() or obj + network_config(netobj) else calls_table[i](obj) end diff --git a/libexec/nuageinit/tests/addfile.lua b/libexec/nuageinit/tests/addfile.lua index 98d020e557c0..ea98369f1909 100644 --- a/libexec/nuageinit/tests/addfile.lua +++ b/libexec/nuageinit/tests/addfile.lua @@ -35,7 +35,7 @@ if str ~= f.content then n.err("Invalid file content") end --- the file is overwriten +-- the file is overwritten f.content = "test" str = addfile_and_getres(f) diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index 2b7c5226c97a..851f7110378a 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -890,7 +890,7 @@ EOF atf_check -o inline:"plop" cat file1 atf_check -o inline:"" cat emptyfile atf_check -o inline:"bla\n" cat file_base64 - test -f foo && atf_fail "foo creation should have been defered" + test -f foo && atf_fail "foo creation should have been deferred" atf_check -o match:"^-rwxr-xr-x.*nobody" ls -l file_base64 rm file1 emptyfile file_base64 atf_check -o empty /usr/libexec/nuageinit "${PWD}"/media/nuageinit postnet From nobody Tue Nov 25 00:43:22 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dFkSq1cRrz6J63c for ; Tue, 25 Nov 2025 00:43: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFkSp6PgJz42m1 for ; Tue, 25 Nov 2025 00:43:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764031402; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GTGz+pAIsWE3A3nL8OKQiKOURUwHvo2CxRTqrVbUYDM=; b=CBFxkp6JFPlLCsDS6Rs9V00RjXlgQCYzRZ+2ISLhcEmal6gVb5zx9yTWcZW4af2cILDTQd iDiN8ndjpKtzH0pn7sw73poLh+Zrxjh+BySUdG/+4De1gUL8WkHh0uLc0T9iQyJSRHT3jr yUMZTi/TY3MX/SiD08inEhcg40A4ShXAtOsGjohYRt5CFjOHz3FHRPkt+bJY7Zu++1ebI/ 7N0OXIxKxD/cm9Zm9TknQYWrBvfqzi9iyB4jzWPUqzD+bgNtWKu+/8e8Txc8pNcLTtksOB QX2eO2THyy+UyF2mQ3K+HK5NaI08379UszDFVXw/v4f53RAt2V7rLwCGX708Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764031402; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GTGz+pAIsWE3A3nL8OKQiKOURUwHvo2CxRTqrVbUYDM=; b=WfW8WDAdgKdMoNOtqVx4bbk4LWS+a6h93KqsTJWEvbHTJPkZf1mbO/4Y2dIZ1V/otTIhCl mJCmgs7q2jnNAkv8OT7KZSTztKi768dyidVryXxl8egjgECx3I4rKTbHZZ4ux+9/eE5uC6 lsUBSHvOifxNY5882LFUKX4Fy3TxnGemooPNAYEowNjkyP/Lv1TD4LjQQ2G1TKmhicT4HO uNpZCNERqX9umOuZlbISBXA1/9nPKX4X6AgGYDDcsb0x94KVJrRPyUN0myTLmhDLE4dF/N jXf2qFqF8fJ9bdHoTIp6PHWV/UUiWQdw+7PQxRzLqKXC3gY09PcfKQZIIJDkEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764031402; a=rsa-sha256; cv=none; b=eZvfAJjNa6e9qiFPTTAAIyGStidWqFY43jIBoK++GvQZEBFd+mT+lsU/sT1raloFFn2WLR PnCgplyZh71O+5fRp94JifV7OiCfV+4RZ+TnCOelxZibyozB7UWgBLPhQV+pe+bTPPjpju LuRn/fTn8yQjE11g87kw6UibkWC2BlSqU62lD9GH0bHLiSWYG6/DEO/OiSgFOax68IkLan xQsqLt4TrXybzfUU+utFG9gr1qR1xfaFVEMRx45Mw1OEGlZUYLk+HxvmJpOWRd6NsNSvEl K7wBSAXIwUZdYCzYQ+DZwTJbWIB6BD1frK994k8tE808qXY0OC6um69QH2M6kQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFkSp602GzfGN for ; Tue, 25 Nov 2025 00:43:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2556a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 25 Nov 2025 00:43:22 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 646c0a2fe646 - stable/14 - nuageinit: Add guards against empty user data List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 646c0a2fe64651dc6315ff4b0ed6ba00924ca080 Auto-Submitted: auto-generated Date: Tue, 25 Nov 2025 00:43:22 +0000 Message-Id: <6924fbaa.2556a.5442e7b8@gitrepo.freebsd.org> The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=646c0a2fe64651dc6315ff4b0ed6ba00924ca080 commit 646c0a2fe64651dc6315ff4b0ed6ba00924ca080 Author: Jose Luis Duran AuthorDate: 2025-10-21 13:11:50 +0000 Commit: Jose Luis Duran CommitDate: 2025-11-25 00:42:36 +0000 nuageinit: Add guards against empty user data Add guards against attempting to process a user data file with an empty first line or contents. PR: 290395 Reviewed by: bapt (earlier), dtxdf, markj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D53239 (cherry picked from commit 57d25b6333523491ac7a3e869bd5d16127203eed) --- libexec/nuageinit/nuageinit | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index 148f5b3b30cd..0870d6570d0e 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -662,8 +662,16 @@ if not f then os.exit(0) end local line = f:read("*l") +if not line or #string.gsub(line, "^%s*(.-)%s*$", "%1") == 0 then + f:close() + os.exit(0) +end if citype ~= "postnet" then local content = f:read("*a") + if not content or #string.gsub(content, "^%s*(.-)%s*$", "%1") == 0 then + f:close() + os.exit(0) + end nuage.mkdir_p(root .. "/var/cache/nuageinit") local tof = assert(io.open(root .. "/var/cache/nuageinit/user_data", "w")) tof:write(line .. "\n" .. content) From nobody Tue Nov 25 03:19:25 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dFnwt1ZwSz6HMZ3 for ; Tue, 25 Nov 2025 03:19: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFnws5kYKz3Tks for ; Tue, 25 Nov 2025 03:19:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764040765; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hp1I8fEhvhluYNY0o2MEYVSx3x2D6lZkDHDubqCyMdo=; b=Ig18p6oB3xUZgdTU8Ww1N4rwaLzF6wd++UpkH+Sp1u4x3+G7GoDfVK6LcRCrKxJV8Ck3hm ioTx/t5hSr7LsglreDpa13IH23JuXmYVl2nW1ErQlIXe6m4q5KcG58AxRYcUOvJdY0VoNW seGFQsxToQbslgAmGqmGBBe0LgMeSQG+s/GFE52urUUQjqcfb5zwbLroTmw1ID0njXtVgq IM+bYXYuMd89n+RuTyLyPyj84S6HHaO9nVGOkwm+GQByevuc1k3PUfmhsOzYFGmnUwZ9rH KKI7lnbiHlBxduDXtodeAnbht8MEq+v3iL0k9okeIZ7RYRknVf1F3qWyMXPJZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764040765; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hp1I8fEhvhluYNY0o2MEYVSx3x2D6lZkDHDubqCyMdo=; b=qNzfUgSITAS0Hqt5yREbeV/Sn2Qha8/5t2xM7Q5nh/8PirlneDdI8/rHvj+sJDMuDu0nLA 7/yuUA8o3F4Ts+pJ1SrIdqRwt3vM0Jg/h1Yj3eVQYd9++iTtbFvkUFrnLLNzby9kpQuQ1w uFCdPhkcF05wbrIyRryRjfZe/FbZ0foOlOg+V6oQXEtxDHem/dpjfn/e7Z//EHPgw9b+Gb dTAkYNtMumPNeEyC+UlZBqbKPEccikkiAuHxakEXOsB4+IRNaf82MbLXjXnOsfIdmdLt0u FwUexI/4Cv4m/1BLghajvzDtQ40TEvCD1J5fxAjAyDLBsz9L1gwYWA5WJFe3WQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764040765; a=rsa-sha256; cv=none; b=g0ILeqb9TvkUf4VTKTp2KZnd5mkNRqtadb06B2rg4XQep1WWOHmiVhmjlNpFSaZopQzVNq GWh9xh26yz/PtYVx+3Fn2xK/cE/7jFer3JZ0O+fwlfMjSZvxyFkUumdW16yi5Bswe8aCqr YwD0nY6W/D8Sb10zpGwgh/F8ce+1ReMnMuu0HMBYZzRRawhzO4/ie72GDJONI2CNAeBFqW yU2ROU+S5+xfz4tmg2/kM5orIs2akySz+k3R6Wl8vw4umnNJQ6Rl76vlssB+EXV+ZeoQrQ sENeQY4ph8aP3Im+s7KDA2Ipbn++SG1ynccVCvnHVABy1oi4r2jGRT649lvdDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFnws53b3zk9P for ; Tue, 25 Nov 2025 03:19:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 329c8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 25 Nov 2025 03:19:25 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Bryan Drewery From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 43b1b7cbb69b - stable/15 - sh tests: Fix racy test11.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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 43b1b7cbb69b64a0afabcfa1541cc2403e4b952f Auto-Submitted: auto-generated Date: Tue, 25 Nov 2025 03:19:25 +0000 Message-Id: <6925203d.329c8.6d6db14@gitrepo.freebsd.org> The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=43b1b7cbb69b64a0afabcfa1541cc2403e4b952f commit 43b1b7cbb69b64a0afabcfa1541cc2403e4b952f Author: Bryan Drewery AuthorDate: 2025-11-07 17:28:37 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-11-25 03:18:23 +0000 sh tests: Fix racy test11.0 This was sometimes exiting while the child fifo was created resulting in [ENOTEMPTY] from rm. The child fifo isn't needed, just sleep. PR: 290837 Fixes: e31fb97148f ("read builtin: Empty variables on timeout") MFC after: 3 days (cherry picked from commit 5d55553e160a93788372785300f5bd07c2451f93) --- bin/sh/tests/builtins/read11.0 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/sh/tests/builtins/read11.0 b/bin/sh/tests/builtins/read11.0 index c75ed9c92a83..5bae80318b15 100644 --- a/bin/sh/tests/builtins/read11.0 +++ b/bin/sh/tests/builtins/read11.0 @@ -5,8 +5,8 @@ T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX) trap 'rm -rf "$T"' 0 cd $T mkfifo fifo1 -# Open fifo1 for writing and then read block on a dummy fifo -{ mkfifo fifo2; read dummy fifo1 & +# Open fifo1 for writing +{ sleep 10; } >fifo1 & # Wait for the child to open fifo1 for writing exec 3; Tue, 25 Nov 2025 03:19: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFnwt6cwjz3Tdt for ; Tue, 25 Nov 2025 03:19:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764040767; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5eraX2N5PUNj928e/TZ3C+PRP6R0ogc3ee7ECi9RVvA=; b=OO3MZjxTiFtoX2O5+cToSE6/Q0fz8Ms4MICHnZqNiINm/CxXvWbJFWE9ZgUdqVkJozsWIe m0YjVbG+oeLwxjWiCNPPihmNfvoaisXTIGjWCSXby4TqgGkjwCHj37NnLG5Elz2GFFbvqq /yUcV5Vv0giO4hmDXSG9lyLt1TD6XPudYfrxFSjS4+HZHTlzA9HRiMfH7+sQsVnqgejvYq 9RVZKsHDURr0weDmZdMk8FBae4aFmR3bqCWIyaKuQBo3svvhrAnUkg7vq8mBQT+b5kdwbt eNJ9Gz9VV3aB+6q+zMLwJr3IoYJEm3BS1xTHnGwIxG/52webve1ZL8JOZAHfkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764040767; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5eraX2N5PUNj928e/TZ3C+PRP6R0ogc3ee7ECi9RVvA=; b=w1Mmg9PghbweoQi19CzabyG7nAuxsHYTTW/fDJC1CMkDt0odjTGNE3NSL1GkTjzB6Ie4l4 F7vxwZmz848vDR4hmiF4jjRsLDknQWUgqaPcaH96HD79OrW2kFqpLH6jTi1IH7lazl9som DfvFXV2IBlCoVGXoifuJ6TdZV74PGtNusD/Sf9EJbpxFtITnflMh7mWzJkbIG6+LdYchV6 T0p0gl8bEVvBWCsje3UEzmzWmr+ZNyTShkKmzoxVxNUSKl/a9sxs1Y37AJf+TSJ9P7uimz l/MgDvAJh9h7IF59pRDXd2HaVgNaBZ6yns+I8/4/EZMFwDLY+fZVMmEtfOKT6Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764040767; a=rsa-sha256; cv=none; b=QefNf25xkkjTesxdf3rvDR+y1e05eTjtaL8AsVSJgiQ06mpgfBdWu5ccX1kMiQo0/mdSe/ g+OALzMOzvygeWNEAHqgCu1z93mkG0Vki2ovwIBsLNq9tgTVLUyow/zngfQaS4UTAK2AWU ZKMSOE+IJRjVe+j6IpM098vw481eF42gVEYHldxq4ZrHd/eVlR8hf9h4Qs4/BjXh1bqtEJ 6RkkdzQPeMjfwyV2pgxC5oTSW9nIbiM+x2cmYd1+C8DjnCxaKgaLS0H0QSPnZMHhBo5Zkk SbY9i5lfxIcLb/Vqt6GxTzPvAiwXbq0ALhaSVkuaXGeOztUUrbxCtX8oEvBE5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFnwt5vqCzkBs for ; Tue, 25 Nov 2025 03:19:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 33dbe by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 25 Nov 2025 03:19:26 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: fb57eac42c15 - stable/15 - sh: Don't assume EINTR means SIGALRM List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: fb57eac42c1598119aa8614f3886dca0379ae816 Auto-Submitted: auto-generated Date: Tue, 25 Nov 2025 03:19:26 +0000 Message-Id: <6925203e.33dbe.3a581c57@gitrepo.freebsd.org> The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=fb57eac42c1598119aa8614f3886dca0379ae816 commit fb57eac42c1598119aa8614f3886dca0379ae816 Author: Dag-Erling Smørgrav AuthorDate: 2025-11-19 10:43:13 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-11-25 03:18:24 +0000 sh: Don't assume EINTR means SIGALRM While waiting for input in the read builtin, if select() is interrupted but there is no pending signal, we act like we timed out, and return the same status as if we had been interrupted by SIGALRM, instead of looping until we actually do time out. * Replace the single select() call with a ppoll() loop. * Improve validation of the timeout value. We now accept things like "1h30m15s", which we used to silently truncate to "1h". The flip side is that we no longer accept things like "1hour" or "5sec". * Modify the existing `read -t 0` test case to verify that read returns immediately when there is input and fails immediately when there isn't. * Add a second test case which performs the same tests with a non-zero timeout value. PR: 290844 MFC after: 1 week Fixes: c4539460e3a4 ("sh: Improve error handling in read builtin:") Reviewed by: jilles, bdrewery Differential Revision: https://reviews.freebsd.org/D53761 (cherry picked from commit 3c2643a7dbac370b7232f4e5ac15fd77b9ff396d) --- bin/sh/miscbltin.c | 83 +++++++++++++++++++++++++++++------------- bin/sh/sh.1 | 6 ++- bin/sh/tests/builtins/Makefile | 1 + bin/sh/tests/builtins/read11.0 | 19 +++++++++- bin/sh/tests/builtins/read12.0 | 32 ++++++++++++++++ 5 files changed, 112 insertions(+), 29 deletions(-) diff --git a/bin/sh/miscbltin.c b/bin/sh/miscbltin.c index 9d0280bb548a..bbf0aa5b8bde 100644 --- a/bin/sh/miscbltin.c +++ b/bin/sh/miscbltin.c @@ -40,11 +40,14 @@ #include #include #include -#include + #include +#include +#include #include #include #include +#include #include "shell.h" #include "options.h" @@ -162,17 +165,18 @@ readcmd(int argc __unused, char **argv __unused) int is_ifs; int saveall = 0; ptrdiff_t lastnonifs, lastnonifsws; - struct timeval tv; - char *tvptr; - fd_set ifds; + sigset_t set, oset; + intmax_t number, timeout; + struct timespec tnow, tend, tresid; + struct pollfd pfd; + char *endptr; ssize_t nread; int sig; struct fdctx fdctx; rflag = 0; prompt = NULL; - tv.tv_sec = -1; - tv.tv_usec = 0; + timeout = -1; while ((i = nextopt("erp:t:")) != '\0') { switch(i) { case 'p': @@ -184,22 +188,29 @@ readcmd(int argc __unused, char **argv __unused) rflag = 1; break; case 't': - tv.tv_sec = strtol(shoptarg, &tvptr, 0); - if (tvptr == shoptarg) - error("timeout value"); - switch(*tvptr) { - case 0: - case 's': - break; - case 'h': - tv.tv_sec *= 60; - /* FALLTHROUGH */ - case 'm': - tv.tv_sec *= 60; - break; - default: - error("timeout unit"); - } + timeout = 0; + do { + number = strtol(shoptarg, &endptr, 0); + if (number < 0 || endptr == shoptarg) + error("timeout value"); + switch (*endptr) { + case 's': + endptr++; + break; + case 'h': + number *= 60; + /* FALLTHROUGH */ + case 'm': + number *= 60; + endptr++; + break; + } + if (*endptr != '\0' && + !(*endptr >= '0' && *endptr <= '9')) + error("timeout unit"); + timeout += number; + shoptarg = endptr; + } while (*shoptarg != '\0'); break; } } @@ -212,13 +223,33 @@ readcmd(int argc __unused, char **argv __unused) if ((ifs = bltinlookup("IFS", 1)) == NULL) ifs = " \t\n"; - if (tv.tv_sec >= 0) { + if (timeout >= 0) { /* * Wait for something to become available. */ - FD_ZERO(&ifds); - FD_SET(0, &ifds); - status = select(1, &ifds, NULL, NULL, &tv); + pfd.fd = STDIN_FILENO; + pfd.events = POLLIN; + status = sig = 0; + sigfillset(&set); + sigprocmask(SIG_SETMASK, &set, &oset); + if (pendingsig) { + /* caught a signal already */ + status = -1; + } else if (timeout == 0) { + status = poll(&pfd, 1, 0); + } else { + clock_gettime(CLOCK_UPTIME, &tnow); + tend = tnow; + tend.tv_sec += timeout; + do { + timespecsub(&tend, &tnow, &tresid); + status = ppoll(&pfd, 1, &tresid, &oset); + if (status >= 0 || pendingsig != 0) + break; + clock_gettime(CLOCK_UPTIME, &tnow); + } while (timespeccmp(&tnow, &tend, <)); + } + sigprocmask(SIG_SETMASK, &oset, NULL); /* * If there's nothing ready, return an error. */ diff --git a/bin/sh/sh.1 b/bin/sh/sh.1 index 7ef22fa352bb..affb653cd3ae 100644 --- a/bin/sh/sh.1 +++ b/bin/sh/sh.1 @@ -31,7 +31,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 1, 2025 +.Dd November 17, 2025 .Dt SH 1 .Os .Sh NAME @@ -2544,6 +2544,10 @@ to explicitly specify seconds, minutes or hours. If none is supplied, .Ql s is assumed. +Multiple value-unit groups may be stringed together, in which case +they are added up, e.g.\& +.Ql 1h30m15s +which adds up to 5,415 seconds. .Pp The .Fl e diff --git a/bin/sh/tests/builtins/Makefile b/bin/sh/tests/builtins/Makefile index 7fdecb23c817..b3e353024969 100644 --- a/bin/sh/tests/builtins/Makefile +++ b/bin/sh/tests/builtins/Makefile @@ -143,6 +143,7 @@ ${PACKAGE}FILES+= read8.0 ${PACKAGE}FILES+= read9.0 ${PACKAGE}FILES+= read10.0 ${PACKAGE}FILES+= read11.0 +${PACKAGE}FILES+= read12.0 ${PACKAGE}FILES+= return1.0 ${PACKAGE}FILES+= return2.1 ${PACKAGE}FILES+= return3.1 diff --git a/bin/sh/tests/builtins/read11.0 b/bin/sh/tests/builtins/read11.0 index 5bae80318b15..07bd3e70644c 100644 --- a/bin/sh/tests/builtins/read11.0 +++ b/bin/sh/tests/builtins/read11.0 @@ -1,3 +1,5 @@ +# Verify that `read -t 0 v` succeeds immediately if input is available +# and fails immediately if not set -e @@ -6,12 +8,25 @@ trap 'rm -rf "$T"' 0 cd $T mkfifo fifo1 # Open fifo1 for writing -{ sleep 10; } >fifo1 & +{ echo new_value; sleep 10; } >fifo1 & # Wait for the child to open fifo1 for writing exec 3fifo1 & +# Wait for the child to open fifo1 for writing +exec 3; Tue, 25 Nov 2025 03:19: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFnwv73MKz3Tkv for ; Tue, 25 Nov 2025 03:19:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764040768; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2bU3eho0PiFpaFF9g7m5446YujN49RkgKi/XURMrGOI=; b=f87PY0vjqdYkB9LLOZCdUOnyP1tlnytvMPWH1WJpPLVNi7ksvbFV9ruxTIAYA2JlybW6WN RjsORZSsUmH6qHB7N/OKxU320cQRCxiorr/JoQ/ZlCvs69UhpB+eeCy/2UZDKmkUx7aAVC ZVI7+6dl/P32H6U5ZsTmTFhCr4Fy5NUASxHXrfYdbtJ5L5ffRen75hsN3znvbnvZl6BqY5 sz6wG3x3HmU8cGGv5xz3mxH0ADe3jQP0nzjrjhwDcgSYRGYcJrTMCbNMeH9l2qLJ2lKOP0 w4RzrOiGBoytWFdQaBwOBC3DHI2siTzwfm1VH8IIr+jHEt315jD8gdSdkEfiAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764040768; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2bU3eho0PiFpaFF9g7m5446YujN49RkgKi/XURMrGOI=; b=oDSqmcRJcEMqI93OzOp2HPFAMD5XdWOzE0U11MTqfzOvSIJCPemLppVzyPO9AVQZwYOvjg pqCORXtB+2y5nLXTUpXPotho6I6Eh4X7OTaNNaS+vr+4NANFE6lrSbWyssa65/jewkUcS/ K58N6zVQ1w9namLewTgGlXYiwOMTQ7nQNLOV0fh/usegaW7gbIsZPqCZ/QF/dbH4QZdzih w1pizNTasl86P1TE1FUWrZ2BP6XE7Td1scLhgt3kpeULMqfkJuEH9pR+5qpxsRWarVGYVx W1yscrkkSPsdVAQh/uMov+VvJLQuZ+OB7ki44ChIiIG9Hd4DS5txlKDn400vMg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764040768; a=rsa-sha256; cv=none; b=Kh6UG+TjOGcNQWhmYYNIa06zjsTedrr1VI9kbS8TDicwJHHVQmDAUe099akvtlxpQo95TU 3aWkkY6s29u0vUy2BhNEVf9zdp8KGVtcEf4pCz7lKLQKER90CbQ5jqv6O/J8/IXq/6eBus 5HiGQmpGlScjnCPb5KP13RVuMJhFm3okMJPu2vItoKuvYf2/JOe1V5YqFZMTHNR+a6Zfz9 hYoHCAfTThDI4VjOsPo67sEmCtGsXykELGsn3ik+P/JRARH2f2cztkgSEE+oKfAxt2iQC+ 60nA7yi22Y29svBBAzhyRXTzf0Mo3NmvbusBXBCqpI29pUzBGGqQBydAnJdIWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFnwv6cYzzjyL for ; Tue, 25 Nov 2025 03:19:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 330d2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 25 Nov 2025 03:19:27 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 4004f9a70c10 - stable/15 - openssh: Don't attempt to connect to unsupported addresses List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 4004f9a70c10b2e6b8e71595f731605484308e5c Auto-Submitted: auto-generated Date: Tue, 25 Nov 2025 03:19:27 +0000 Message-Id: <6925203f.330d2.539256d0@gitrepo.freebsd.org> The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=4004f9a70c10b2e6b8e71595f731605484308e5c commit 4004f9a70c10b2e6b8e71595f731605484308e5c Author: Dag-Erling Smørgrav AuthorDate: 2025-11-21 06:28:13 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-11-25 03:18:24 +0000 openssh: Don't attempt to connect to unsupported addresses When iterating over known addresses for the requested target host name, skip those that are not supported by the running kernel. MFC after: 1 week PR: 195231 Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D53588 (cherry picked from commit 5818b6ee552b302f5300934f9b8cb94881867a5f) --- crypto/openssh/FREEBSD-upgrade | 7 +++++++ crypto/openssh/sshconnect.c | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/crypto/openssh/FREEBSD-upgrade b/crypto/openssh/FREEBSD-upgrade index 98503de12ddb..815c11a8f8ca 100644 --- a/crypto/openssh/FREEBSD-upgrade +++ b/crypto/openssh/FREEBSD-upgrade @@ -181,6 +181,13 @@ skip setting DISABLE_LASTLOG which we've applied for FreeBSD, but the autoconf machinery really ought to be reworked. Reported upstream at https://lists.mindrot.org/pipermail/openssh-unix-dev/2022-May/040242.html + +11) Protocol selection + + We use the non-portable feature_present(3) API to determine which + internet protocols are supported by the kernel before trying to + connect to the target host. This avoids confusing the user with + spurious error messages. This port was brought to you by (in no particular order) DARPA, NAI diff --git a/crypto/openssh/sshconnect.c b/crypto/openssh/sshconnect.c index c86182d13673..24da9aed0007 100644 --- a/crypto/openssh/sshconnect.c +++ b/crypto/openssh/sshconnect.c @@ -458,6 +458,8 @@ ssh_connect_direct(struct ssh *ssh, const char *host, struct addrinfo *aitop, memset(ntop, 0, sizeof(ntop)); memset(strport, 0, sizeof(strport)); + int inet_supported = feature_present("inet"); + int inet6_supported = feature_present("inet6"); for (attempt = 0; attempt < connection_attempts; attempt++) { if (attempt > 0) { /* Sleep a moment before retrying. */ @@ -482,6 +484,13 @@ ssh_connect_direct(struct ssh *ssh, const char *host, struct addrinfo *aitop, errno = oerrno; continue; } + if ((ai->ai_family == AF_INET && !inet_supported) || + (ai->ai_family == AF_INET6 && !inet6_supported)) { + debug2_f("skipping address [%s]:%s: " + "unsupported address family", ntop, strport); + errno = EAFNOSUPPORT; + continue; + } if (options.address_family != AF_UNSPEC && ai->ai_family != options.address_family) { debug2_f("skipping address [%s]:%s: " From nobody Tue Nov 25 03:19:29 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dFnwy0Vvpz6HMWm for ; Tue, 25 Nov 2025 03:19: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFnwx5LFGz3TfG for ; Tue, 25 Nov 2025 03:19:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764040769; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e/AwOIaOOBFpY6b61fXPUxiwkj62KSjNT/Dr9RdIrqU=; b=gwj5JB/0t+BkCO7POZoe7s/H+8Xc6Cb5PZxjNKJLfe7BeRKz9ox1LgR5bEueUd1IJsfakX ZgjvP88hyvPf58dlHW1s6nSeGKViU1GY1R4ELvvyMNW66ZmEMNs6f0y19xoZm0Ylih/O1p D9z2lZNpOhBOk5J6jFKpM1eGnBCKGhCiwogyF0vASQ7eXBsQQYv6qfxWlgnbpQ0wiehlYd ue03sFr/Gz3ueKf8+4n3yVExiBI2DnlTmvmN0U6exDDi5DSERRZAbYRUnLFYS6dTGFOp+F P1/Qhfi5kG1sh2OWK6mSrsrQ6hpzjo0zVuoYPfTXYVDAX8NdBzfqRO3EqMXzUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764040769; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e/AwOIaOOBFpY6b61fXPUxiwkj62KSjNT/Dr9RdIrqU=; b=kG5V0pGgNemvePFWk4BrB68J7jXVr734rA7tV3omCKatNJZPa6NPePReWgY6RgQOUFgLZ4 r++50iVoi/yktk6lHuyjlkFeaJuMhYCihYTjtrfR3EqQC9xgwGRfemBbirdxS1xfau96Vi DoEOpRqOhB+EBnr6BU20UgsgEX6jrbQ341RStVwYfTZ6xjrixlrROyEPU0OvO/qbCA7hl1 gguXG3zHXjWdCS5CwE1jk98axgu2Dy+MD39p4CTjMvaQstoOBAvyvZJKky7mgJstTQ0pYr XV+OnEL4kxUwiOAsWUM5XbArGivIDJKHXeEdcAcgvVmoCbjzRfFmyFmkhJfvmQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764040769; a=rsa-sha256; cv=none; b=kcsq7GQyghoCpt0UbcR5odxxx0UhwxiTnpYf+ChRiACZ0mOPss8rFKVMPptgXcgXd69LBP 9w2+3DTB9XpGR8ySOQkobV4HR3kWlrS3PSexS6XrnEjgw+XuvUdc6fcioZqJpmZ4hBAE1+ KPAxoUyi27fTpdZNFfqCx/85ivcFNYLCT2kUCdp+cQ6H4AuPRmFkNsu5sGZESExz8CwZQA 8bqbQIHYIjzwvFC+hwEIctqOH1Qov37vW/J1N8pnY/N9yEnoV3mIYOm6PyB2fr8tkXj3wP 5gwaX3GQ6J2VuHj0FaM5/Fn08GdbRcZcFSSaEGUYgUMwIMVm3k1tIXHOotxsuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFnwx4cDGzjyM for ; Tue, 25 Nov 2025 03:19:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 33054 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 25 Nov 2025 03:19:29 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Bryan Drewery From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: e9019e777ca3 - stable/14 - sh tests: Fix racy test11.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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e9019e777ca3bbb3217df7b54590dcb075430f4e Auto-Submitted: auto-generated Date: Tue, 25 Nov 2025 03:19:29 +0000 Message-Id: <69252041.33054.574763e9@gitrepo.freebsd.org> The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=e9019e777ca3bbb3217df7b54590dcb075430f4e commit e9019e777ca3bbb3217df7b54590dcb075430f4e Author: Bryan Drewery AuthorDate: 2025-11-07 17:28:37 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-11-25 03:19:16 +0000 sh tests: Fix racy test11.0 This was sometimes exiting while the child fifo was created resulting in [ENOTEMPTY] from rm. The child fifo isn't needed, just sleep. PR: 290837 Fixes: e31fb97148f ("read builtin: Empty variables on timeout") MFC after: 3 days (cherry picked from commit 5d55553e160a93788372785300f5bd07c2451f93) --- bin/sh/tests/builtins/read11.0 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/sh/tests/builtins/read11.0 b/bin/sh/tests/builtins/read11.0 index c75ed9c92a83..5bae80318b15 100644 --- a/bin/sh/tests/builtins/read11.0 +++ b/bin/sh/tests/builtins/read11.0 @@ -5,8 +5,8 @@ T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX) trap 'rm -rf "$T"' 0 cd $T mkfifo fifo1 -# Open fifo1 for writing and then read block on a dummy fifo -{ mkfifo fifo2; read dummy fifo1 & +# Open fifo1 for writing +{ sleep 10; } >fifo1 & # Wait for the child to open fifo1 for writing exec 3; Tue, 25 Nov 2025 03:19: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFnwy5dxHz3Tsl for ; Tue, 25 Nov 2025 03:19:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764040770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YVk/QmlSmymK88ji+syBQEKlLiLKuqcK4m208Ezcryk=; b=XlFUT5dA47mNrqzX6WBCRayUmUwnhXcUBWJiaVRH9q/ziDa+N3lk8c0Dod5MOVGECG2hcX p1WHpYxrByTMAUGwD6/0o4SAajTmYZB6yPP67hGT7syqMFlVuwBbNwXJAk5WnzzjyXgwXS Bxo8FOc2CSyAMKhSF/XNTnjaqYNNZb9O/g22BiHjFmpaqmaO1Af1N57o6AdI8ye3tycJUU e3uVBw+l9awo6/TogBjQkcNkvW59rJH+bSf5tDmyf77sBZakewiKUUWrKGEVKC6Th6Xyn/ jmg2I0pjEM6AcJUvsMSIfEEtbZn0R5mqStPG6Mz3LI+4S9YQ6R3uCebIQ+luWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764040770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YVk/QmlSmymK88ji+syBQEKlLiLKuqcK4m208Ezcryk=; b=Gd9ixAbEZ5wOILMnMrVlkx1fGDUatk/3SSsRYvINb+/PwaSj3o5EAmi0qXRJs7TuJeRWOa vIDFlOTtahrM9EfBztTG3BX0AK1zKoZF1Q7fyHUtFHDZ5GOfHcLYetWNQmTQjGz3xK+lRS fKQhEwetmI5G6abY83l6jBG2WNSolx5LPlesCs165J6cfWkDcZHR5ywg49HnZjAJsH20aA EmhLElVeJEFk1iePsJiapZ2U/SSxILLsdbrf7GsRZua3BBe9O0EzPcxQHw59I0t+Q2vKwL NOw4tua5nFMDTt3+JJK2mutRA2sz5ZBjbIjpVhLH2Ht7D5LyeMRqHJBzW1F2ig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764040770; a=rsa-sha256; cv=none; b=ZHmibW/dvnYBkTD048DZcQ9Gcd7GRoBMsqbTMB2+g93CiCT3b/kLdxpVXE2bwo6TFuwhRp uwkWVm6h0G36jmsNSzdzX3LpR/9soFTQVzPewmbCeMAvxgA93c0WhRiZaqJZwsy+mX6cbQ XmzzBESdMUE3imfDN4JX54OBhEy2PDFaoMiZ3UEBAQBl6MS7FDHB8rwKOFkywgQW/MDjFT 9hjAHPfR31qmDh8KweDuzetV0UuEZdp5S5z9zj1Yfd4svqfndFr5OlhXGgLjjQwgLJduaM 8KfVCSpzqgAa//j5Hm+RNW+aDE8Ha75FDjXx/MgGXc+/WSmDvGPT9hrRPBOkPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFnwy53swzk9Q for ; Tue, 25 Nov 2025 03:19:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 33b44 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 25 Nov 2025 03:19:30 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 7f691e07efe6 - stable/14 - sh: Don't assume EINTR means SIGALRM List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7f691e07efe63ea01273833e44fd03ee00106b2b Auto-Submitted: auto-generated Date: Tue, 25 Nov 2025 03:19:30 +0000 Message-Id: <69252042.33b44.5f3748f@gitrepo.freebsd.org> The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=7f691e07efe63ea01273833e44fd03ee00106b2b commit 7f691e07efe63ea01273833e44fd03ee00106b2b Author: Dag-Erling Smørgrav AuthorDate: 2025-11-19 10:43:13 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-11-25 03:19:16 +0000 sh: Don't assume EINTR means SIGALRM While waiting for input in the read builtin, if select() is interrupted but there is no pending signal, we act like we timed out, and return the same status as if we had been interrupted by SIGALRM, instead of looping until we actually do time out. * Replace the single select() call with a ppoll() loop. * Improve validation of the timeout value. We now accept things like "1h30m15s", which we used to silently truncate to "1h". The flip side is that we no longer accept things like "1hour" or "5sec". * Modify the existing `read -t 0` test case to verify that read returns immediately when there is input and fails immediately when there isn't. * Add a second test case which performs the same tests with a non-zero timeout value. PR: 290844 MFC after: 1 week Fixes: c4539460e3a4 ("sh: Improve error handling in read builtin:") Reviewed by: jilles, bdrewery Differential Revision: https://reviews.freebsd.org/D53761 (cherry picked from commit 3c2643a7dbac370b7232f4e5ac15fd77b9ff396d) --- bin/sh/miscbltin.c | 83 +++++++++++++++++++++++++++++------------- bin/sh/sh.1 | 6 ++- bin/sh/tests/builtins/Makefile | 1 + bin/sh/tests/builtins/read11.0 | 19 +++++++++- bin/sh/tests/builtins/read12.0 | 32 ++++++++++++++++ 5 files changed, 112 insertions(+), 29 deletions(-) diff --git a/bin/sh/miscbltin.c b/bin/sh/miscbltin.c index 39b3effb99df..70b2aac58e93 100644 --- a/bin/sh/miscbltin.c +++ b/bin/sh/miscbltin.c @@ -46,11 +46,14 @@ static char sccsid[] = "@(#)miscbltin.c 8.4 (Berkeley) 5/4/95"; #include #include #include -#include + #include +#include +#include #include #include #include +#include #include "shell.h" #include "options.h" @@ -168,17 +171,18 @@ readcmd(int argc __unused, char **argv __unused) int is_ifs; int saveall = 0; ptrdiff_t lastnonifs, lastnonifsws; - struct timeval tv; - char *tvptr; - fd_set ifds; + sigset_t set, oset; + intmax_t number, timeout; + struct timespec tnow, tend, tresid; + struct pollfd pfd; + char *endptr; ssize_t nread; int sig; struct fdctx fdctx; rflag = 0; prompt = NULL; - tv.tv_sec = -1; - tv.tv_usec = 0; + timeout = -1; while ((i = nextopt("erp:t:")) != '\0') { switch(i) { case 'p': @@ -190,22 +194,29 @@ readcmd(int argc __unused, char **argv __unused) rflag = 1; break; case 't': - tv.tv_sec = strtol(shoptarg, &tvptr, 0); - if (tvptr == shoptarg) - error("timeout value"); - switch(*tvptr) { - case 0: - case 's': - break; - case 'h': - tv.tv_sec *= 60; - /* FALLTHROUGH */ - case 'm': - tv.tv_sec *= 60; - break; - default: - error("timeout unit"); - } + timeout = 0; + do { + number = strtol(shoptarg, &endptr, 0); + if (number < 0 || endptr == shoptarg) + error("timeout value"); + switch (*endptr) { + case 's': + endptr++; + break; + case 'h': + number *= 60; + /* FALLTHROUGH */ + case 'm': + number *= 60; + endptr++; + break; + } + if (*endptr != '\0' && + !(*endptr >= '0' && *endptr <= '9')) + error("timeout unit"); + timeout += number; + shoptarg = endptr; + } while (*shoptarg != '\0'); break; } } @@ -218,13 +229,33 @@ readcmd(int argc __unused, char **argv __unused) if ((ifs = bltinlookup("IFS", 1)) == NULL) ifs = " \t\n"; - if (tv.tv_sec >= 0) { + if (timeout >= 0) { /* * Wait for something to become available. */ - FD_ZERO(&ifds); - FD_SET(0, &ifds); - status = select(1, &ifds, NULL, NULL, &tv); + pfd.fd = STDIN_FILENO; + pfd.events = POLLIN; + status = sig = 0; + sigfillset(&set); + sigprocmask(SIG_SETMASK, &set, &oset); + if (pendingsig) { + /* caught a signal already */ + status = -1; + } else if (timeout == 0) { + status = poll(&pfd, 1, 0); + } else { + clock_gettime(CLOCK_UPTIME, &tnow); + tend = tnow; + tend.tv_sec += timeout; + do { + timespecsub(&tend, &tnow, &tresid); + status = ppoll(&pfd, 1, &tresid, &oset); + if (status >= 0 || pendingsig != 0) + break; + clock_gettime(CLOCK_UPTIME, &tnow); + } while (timespeccmp(&tnow, &tend, <)); + } + sigprocmask(SIG_SETMASK, &oset, NULL); /* * If there's nothing ready, return an error. */ diff --git a/bin/sh/sh.1 b/bin/sh/sh.1 index c11920e2f2a7..eb517b6938ee 100644 --- a/bin/sh/sh.1 +++ b/bin/sh/sh.1 @@ -33,7 +33,7 @@ .\" .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" -.Dd March 8, 2025 +.Dd November 17, 2025 .Dt SH 1 .Os .Sh NAME @@ -2504,6 +2504,10 @@ to explicitly specify seconds, minutes or hours. If none is supplied, .Ql s is assumed. +Multiple value-unit groups may be stringed together, in which case +they are added up, e.g.\& +.Ql 1h30m15s +which adds up to 5,415 seconds. .Pp The .Fl e diff --git a/bin/sh/tests/builtins/Makefile b/bin/sh/tests/builtins/Makefile index c3ed122791b5..56de5e57732b 100644 --- a/bin/sh/tests/builtins/Makefile +++ b/bin/sh/tests/builtins/Makefile @@ -143,6 +143,7 @@ ${PACKAGE}FILES+= read8.0 ${PACKAGE}FILES+= read9.0 ${PACKAGE}FILES+= read10.0 ${PACKAGE}FILES+= read11.0 +${PACKAGE}FILES+= read12.0 ${PACKAGE}FILES+= return1.0 ${PACKAGE}FILES+= return2.1 ${PACKAGE}FILES+= return3.1 diff --git a/bin/sh/tests/builtins/read11.0 b/bin/sh/tests/builtins/read11.0 index 5bae80318b15..07bd3e70644c 100644 --- a/bin/sh/tests/builtins/read11.0 +++ b/bin/sh/tests/builtins/read11.0 @@ -1,3 +1,5 @@ +# Verify that `read -t 0 v` succeeds immediately if input is available +# and fails immediately if not set -e @@ -6,12 +8,25 @@ trap 'rm -rf "$T"' 0 cd $T mkfifo fifo1 # Open fifo1 for writing -{ sleep 10; } >fifo1 & +{ echo new_value; sleep 10; } >fifo1 & # Wait for the child to open fifo1 for writing exec 3fifo1 & +# Wait for the child to open fifo1 for writing +exec 3; Tue, 25 Nov 2025 03:19:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFnwz6Rm6z3TcG for ; Tue, 25 Nov 2025 03:19:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764040771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q0ZuCWrN0AhgaHM82zK3SW/xAZSTzOe4IAIZPI2M2xI=; b=L0FPKXvYJFYEu/Zqz/fRZguK1JPQzxlTfg+3JnuMaNPX12MYtq8NACrP+lLeFLu89Ba6Rc 5li8m1yw+g8k0NhVI1Jh6GaLmHFx4ikmvGKwXPRLY0PfHVPHH6FROt01uSMsj0dK2gJ6rL FWRmkwzTRPr8/0OaVbJIV5Ga4zUIxWdAhjpnmOKFkALrlySvZzTWjfOtiWeSZ8TcfxuxDt 4kgyXmgkNy7nJq3c5dynOPTTXstTuWi4GA3JgbUS9X3m82DpV/PLu6aoTIU4qr6kI8q0oy ar8A/V+AGt1V/Zje2ChwiX5vgdJHNjc/qrl1g5DVDl3Cyj9CJyBj5so2NHt0vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764040771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q0ZuCWrN0AhgaHM82zK3SW/xAZSTzOe4IAIZPI2M2xI=; b=nisLoB8IXjfFRjX7BY9PBDxykrrzzY8txsS4uuuj6bVfXkve4isqp8PwSDx5FQVAXVvRma nnuwvpLZaPY/HA7hK/y804/TkpDuSTPNhb4pONMlNV9sk474j5fhQlb9bkbCsNO72aV4th PcO80tmuK8HgonsNYvlGfjv+M6CC9SkynJ6/DJpnKmQ61sNoBPaA49dG0FhQDjrVSgSlTL yZL+snzafe9+nCP41MmHC1CvVQca9dXlPtPYubcrpB4cf59Wouus/KkohDokSMd2HM45TT /gUOxH3meZPKwBwEJgXM8I6tumVVs52Ql4QEAz5cc7gVwC0OjWHPZLiQaoHZtg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764040771; a=rsa-sha256; cv=none; b=iAGDtJgkQN2Ppl8D8GZkZC+Ud7E2qZWZ70cbNj/NxzZF26/ckAyzNl6vU/PhDrgbQULen9 vGFaBXWfGsfHXi3OGUrxZFhfE0SVC5uNJNW43gO3rET+iHrEmCFiHtSqS3KPY6mUD9tzd2 X1oM/QlH8HHrx8VT/Yc4274FiZbhDQZRNqrdOeFN09QrQraGxKfZz8esRjLh6lEhcI3CrM dBOZmoW0kpf5jCJMWZDaupcUOy64G2q9j21rhEytVf4pUn+5mSWaOZpMm4NvGGD4hez0ic rMbCR421akOiBacFzQTXlhNC7MPgg9RRX0pIdn7XA/X3HypFkoIqRJHSkZGmdg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFnwz5y1fzjjL for ; Tue, 25 Nov 2025 03:19:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 33823 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 25 Nov 2025 03:19:31 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 00e4b169f409 - stable/14 - openssh: Don't attempt to connect to unsupported addresses List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 00e4b169f4090e3b4bf1454c989df82d94b7d62e Auto-Submitted: auto-generated Date: Tue, 25 Nov 2025 03:19:31 +0000 Message-Id: <69252043.33823.4e15c483@gitrepo.freebsd.org> The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=00e4b169f4090e3b4bf1454c989df82d94b7d62e commit 00e4b169f4090e3b4bf1454c989df82d94b7d62e Author: Dag-Erling Smørgrav AuthorDate: 2025-11-21 06:28:13 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-11-25 03:19:17 +0000 openssh: Don't attempt to connect to unsupported addresses When iterating over known addresses for the requested target host name, skip those that are not supported by the running kernel. MFC after: 1 week PR: 195231 Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D53588 (cherry picked from commit 5818b6ee552b302f5300934f9b8cb94881867a5f) --- crypto/openssh/FREEBSD-upgrade | 7 +++++++ crypto/openssh/sshconnect.c | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/crypto/openssh/FREEBSD-upgrade b/crypto/openssh/FREEBSD-upgrade index efea4cda77b4..d8fc986b71ca 100644 --- a/crypto/openssh/FREEBSD-upgrade +++ b/crypto/openssh/FREEBSD-upgrade @@ -177,6 +177,13 @@ skip setting DISABLE_LASTLOG which we've applied for FreeBSD, but the autoconf machinery really ought to be reworked. Reported upstream at https://lists.mindrot.org/pipermail/openssh-unix-dev/2022-May/040242.html + +11) Protocol selection + + We use the non-portable feature_present(3) API to determine which + internet protocols are supported by the kernel before trying to + connect to the target host. This avoids confusing the user with + spurious error messages. This port was brought to you by (in no particular order) DARPA, NAI diff --git a/crypto/openssh/sshconnect.c b/crypto/openssh/sshconnect.c index 7cf6b638674c..f0c080cb140b 100644 --- a/crypto/openssh/sshconnect.c +++ b/crypto/openssh/sshconnect.c @@ -458,6 +458,8 @@ ssh_connect_direct(struct ssh *ssh, const char *host, struct addrinfo *aitop, memset(ntop, 0, sizeof(ntop)); memset(strport, 0, sizeof(strport)); + int inet_supported = feature_present("inet"); + int inet6_supported = feature_present("inet6"); for (attempt = 0; attempt < connection_attempts; attempt++) { if (attempt > 0) { /* Sleep a moment before retrying. */ @@ -482,6 +484,13 @@ ssh_connect_direct(struct ssh *ssh, const char *host, struct addrinfo *aitop, errno = oerrno; continue; } + if ((ai->ai_family == AF_INET && !inet_supported) || + (ai->ai_family == AF_INET6 && !inet6_supported)) { + debug2_f("skipping address [%s]:%s: " + "unsupported address family", ntop, strport); + errno = EAFNOSUPPORT; + continue; + } if (options.address_family != AF_UNSPEC && ai->ai_family != options.address_family) { debug2_f("skipping address [%s]:%s: " From nobody Tue Nov 25 03:19:41 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dFnx93nHRz6HMq4 for ; Tue, 25 Nov 2025 03:19: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFnx918vxz3Ts6 for ; Tue, 25 Nov 2025 03:19:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764040781; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lQQXNbHATC1hoSM+V2EbGOWY3Vpx2lKwFS+J8Xr/O08=; b=xYYnseccjjq0s1z5vjwd0KOc6IVXKnO5LjC3CzE9lG5wh4s5IkGA4lUqdw2oXEvpxAnq3a z1Eh0QCEwxYhj3Ipd6E/+Hvv6zy4gEMvvgCQ7mvhdN3+j697PBeYPZspygOTCvmB6RWVdB vTozvySgXtvSvO13IFDxKwWyU4nt/4/mFm7djBLGVrr6T6P+I4vAIVZoACC6/rZlVKTwGl s9UYmXQNyqLRTGJQmFyyCdrchgbQuDwENbZmWtxfZpaNdE/dRRNg+WAoysR5QW0X6HJ91Z ZOGoh2TMo8onaZs3UJNwHwAmJ9YwVzIWohxUjv3cBJnoNYDVYusgx6erC2C0zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764040781; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lQQXNbHATC1hoSM+V2EbGOWY3Vpx2lKwFS+J8Xr/O08=; b=jca4+CiXTZCBX3TIjfqHeVgZXoM1d5Aa17+/RRlH83JqF55MIVItUSSMwKZePLV74axeKG o3j0Vmak48OBYtiB5uJdVecxycGZg66m0anjMcdd0MIXn1NZcKavSFtY1AXUHSRxl7kNbE 2CbbSysu+7vO4/Mv9JU2xN+c0fsSV8ZZclhUsj/J5viRoAew36vGGxLuTagVkXNcY/7La/ UzZE3oqgm8SOkL5pZqX90F9qGZ/FENibYE24jl4BC5TOFKLYjWqxOA25vuuFjJMk2TLDIo UwosUJM62Wgb1nMJHPoS5Q1J+0BRYah7dbNTYZzTzA7EcyOa4Hvt4UcCdcKkVQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764040781; a=rsa-sha256; cv=none; b=nle1rz63LnqyU8J7JltH7Hei72wkwJL15J/h+WkGpEjaMcxSjMwcYVBSewormc45DvXQsh BKC1Pfq8cn2csls0BV/BKOB5mLekYPxFjPw9KTGrK4Pa/HTySPElgRuwSmpYJ7bSbHdqDy bxX9CeiygjAODI/MMDL0jy8x/ffjAsn1gFnserz85CAgOfpXhtuugqGDUU5m2tkBPdGnFw pVGS1+5AAQAnrTpCl4MZvL45l21iqCCQIZPPS3D0z/uIyn6vnLw0NxjbOg0C+qLuIlgWG9 GgezJP+tWHM7MuiiiL24xA1VQww+NwFdfNzhWqlhvDLC4XmtgyBXqLA6NNu1Yg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFnx90LSXzk9S for ; Tue, 25 Nov 2025 03:19:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 329cf by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 25 Nov 2025 03:19:41 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: f6bd9b266dc4 - stable/13 - openssh: Don't attempt to connect to unsupported addresses List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f6bd9b266dc4aa342f735a7ade07061f54f7f740 Auto-Submitted: auto-generated Date: Tue, 25 Nov 2025 03:19:41 +0000 Message-Id: <6925204d.329cf.1813b80c@gitrepo.freebsd.org> The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=f6bd9b266dc4aa342f735a7ade07061f54f7f740 commit f6bd9b266dc4aa342f735a7ade07061f54f7f740 Author: Dag-Erling Smørgrav AuthorDate: 2025-11-21 06:28:13 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-11-25 03:19:35 +0000 openssh: Don't attempt to connect to unsupported addresses When iterating over known addresses for the requested target host name, skip those that are not supported by the running kernel. MFC after: 1 week PR: 195231 Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D53588 (cherry picked from commit 5818b6ee552b302f5300934f9b8cb94881867a5f) --- crypto/openssh/FREEBSD-upgrade | 6 ++++++ crypto/openssh/sshconnect.c | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/crypto/openssh/FREEBSD-upgrade b/crypto/openssh/FREEBSD-upgrade index 625677c1a5c1..3742874c0729 100644 --- a/crypto/openssh/FREEBSD-upgrade +++ b/crypto/openssh/FREEBSD-upgrade @@ -179,6 +179,12 @@ ignore HPN-related configuration options to avoid breaking existing configurations. +9) Protocol selection + + We use the non-portable feature_present(3) API to determine which + internet protocols are supported by the kernel before trying to + connect to the target host. This avoids confusing the user with + spurious error messages. This port was brought to you by (in no particular order) DARPA, NAI diff --git a/crypto/openssh/sshconnect.c b/crypto/openssh/sshconnect.c index bd4190c6e8bc..91cbd55df0d1 100644 --- a/crypto/openssh/sshconnect.c +++ b/crypto/openssh/sshconnect.c @@ -458,6 +458,8 @@ ssh_connect_direct(struct ssh *ssh, const char *host, struct addrinfo *aitop, memset(ntop, 0, sizeof(ntop)); memset(strport, 0, sizeof(strport)); + int inet_supported = feature_present("inet"); + int inet6_supported = feature_present("inet6"); for (attempt = 0; attempt < connection_attempts; attempt++) { if (attempt > 0) { /* Sleep a moment before retrying. */ @@ -482,6 +484,13 @@ ssh_connect_direct(struct ssh *ssh, const char *host, struct addrinfo *aitop, errno = oerrno; continue; } + if ((ai->ai_family == AF_INET && !inet_supported) || + (ai->ai_family == AF_INET6 && !inet6_supported)) { + debug2_f("skipping address [%s]:%s: " + "unsupported address family", ntop, strport); + errno = EAFNOSUPPORT; + continue; + } if (options.address_family != AF_UNSPEC && ai->ai_family != options.address_family) { debug2_f("skipping address [%s]:%s: " From nobody Tue Nov 25 09:49:27 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dFyZv4gzbz6HsjG for ; Tue, 25 Nov 2025 09:49: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFyZv2qy8z44pq for ; Tue, 25 Nov 2025 09:49:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764064167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lbqEGsahDfrRKZUgdW12UQic95TGqTQ2qLpxLQHOsbc=; b=n6C4rFo37AwrxHSm/1EZH8vG1hdRtzMl9n1qa+ox5pxco1KKcoTSBL/vmKLg0P7jBYiILE 9aE8zKCr4OyQq4g7oggjrOy07qdF+h4YCedAjJXH4iVHlO8zbBPg1LFAubylnlNtkGrkeP rdgLMcNM0eHXbjOyChjR2VZOswqZjhUidF3ZYqRCOX7/CaXIZIGOAXJ14eJ19kwEt+QViy SiOlQGxbNq2omJZq02N/VqmMSNgTPs/3p6hQXs5JxMuGZ9/Rz3nfKv6PcQL8VLK7YVCKUJ x59YYObP79heyJ5nKlYlDa4DeCHhAvh4KbQyja7cNVYiY0gqpeMaZnhDH4zDGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764064167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lbqEGsahDfrRKZUgdW12UQic95TGqTQ2qLpxLQHOsbc=; b=QN3MBdn22vilfiyY/ozhjof/hVsjKVFfOR1HYHpz9uKUq8pOOg2r7PDE8CV8Azowq8J/1g gKsRlivzGyUwtKp+qziUcdakUGh7cckvZyhgOOv/6r/4bhd+eZnx0orMori8Sih7G47mpy nMJSZ+diB6BgztqwAnDKBe63WE9+mvXB5pm5/YQX73S31asi+zWy679fCkJh0eC6P9QmVe ic2qCivGxqKg/44bIb2TVXC0WhYUBABIud+iv3Frbwb12mxzFJkM5C9sJn4rQQC52BiWK7 RN9aySKDLQ9cpE7xSw5HMkn+APOwomXf2KJ5yYMoHelhws6zgkgr15BszqRVwQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764064167; a=rsa-sha256; cv=none; b=kHE2RtPl6aGj9xINZDFJjXIqOBb2IDR6vEgfQ0nEihtn+QDVYWPgMi7R41hgHcj9lNSYn+ h6VbkygzY1wj/GRgTr3nB9bC4igcJLmfqGPo9Fc1W77hYxVSnUTVIsVZNtadEV3g3DrqmZ c+BKNURDy6jmNeKM7VDiXppwSyqHhtYUP1G3eRCfI1SQHzupLyx+JI8VCWGjEnXVTzhm9S ZkJlkm3sV5O7P9b+DqZypST6KpEn8VS3NLDWRpliAxC9mvjzoIdHdhqMX4zW35P461E3sb CGS41ofJvyIHl81jGbA4yO/cxU2LNVToob+PL+QbwaXWubOPhZQk21pCbxgNUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFyZv1DvFzwQS for ; Tue, 25 Nov 2025 09:49:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 33406 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 25 Nov 2025 09:49:27 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 7799b57146cd - stable/15 - if_ovpn: use IFT_TUNNEL List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 7799b57146cdb79a2fcc23ea434eb0f41efbc06e Auto-Submitted: auto-generated Date: Tue, 25 Nov 2025 09:49:27 +0000 Message-Id: <69257ba7.33406.1d38ab44@gitrepo.freebsd.org> The branch stable/15 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7799b57146cdb79a2fcc23ea434eb0f41efbc06e commit 7799b57146cdb79a2fcc23ea434eb0f41efbc06e Author: Kristof Provost AuthorDate: 2025-11-17 19:42:24 +0000 Commit: Kristof Provost CommitDate: 2025-11-25 09:39:23 +0000 if_ovpn: use IFT_TUNNEL IFT_ENC has special behaviour in pf we don't desire, and this also ensures that for all interface types there is N:1:1 correspondence between if_type:dlt:header len. Requested by: glebius MFC after: 1 week (cherry picked from commit ff9f76a206c80c263050816735d537a151ee2999) --- sys/net/if_ovpn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/if_ovpn.c b/sys/net/if_ovpn.c index fe015632f33e..8ce3491d072e 100644 --- a/sys/net/if_ovpn.c +++ b/sys/net/if_ovpn.c @@ -2689,7 +2689,7 @@ ovpn_clone_create(struct if_clone *ifc, char *name, size_t len, return (EEXIST); sc = malloc(sizeof(struct ovpn_softc), M_OVPN, M_WAITOK | M_ZERO); - sc->ifp = if_alloc(IFT_ENC); + sc->ifp = if_alloc(IFT_TUNNEL); rm_init_flags(&sc->lock, "if_ovpn_lock", RM_RECURSE); sc->refcount = 0; From nobody Tue Nov 25 09:49:27 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dFyZw0QT3z6HsgG for ; Tue, 25 Nov 2025 09:49: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFyZv58wgz44pr for ; Tue, 25 Nov 2025 09:49:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764064167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0kH6PG4WVIETglXs7Y6YSk3DX4W7c+uu2hzpf3G46zM=; b=UX8MDrd9gfUp6+3wKVuiVbDoNKgiJ25HKlJrbXFpKtTzFvS29iE8NmH2T0ESyeimZJqN7b l7Q6s49hrlSol4NEa0qD2Kay+wLDPyepKsVVGIz6DOcpLuK4jz9XPhJeHjy7+spXnCy8u1 UGibM/FY1faQHSxKlk6TVVFwmogwjVkBanbkeGDtdqjisuFXPRWzF24bse5082JECMExIY sTXVBi+wXEVqwKsknhh4SYwutE/EdI2xk7XZF41GQtAoZ6wZbwm1F7rZLnIxFUiJP8BRMB HkLrVh+73m0tC6PwgxhDJ95l+2fHvyl4onleyhJ38alnjaHrSa4TwgWFBLGC0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764064167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0kH6PG4WVIETglXs7Y6YSk3DX4W7c+uu2hzpf3G46zM=; b=CMCpyPcuMIb4z8lTuDaDNuzdZ7cbQNv3tZYPb8JV2vzb88Rgyon+ohvfslXbpdWYh3KG6/ mQ8CNR+kZPLFDPYlgRYUMlQyRo32Cnzf3V1TDZuza1bE2edPtiYCi0eNrANfIr15zsGNFu sEm8/VuDBrI0GAY0xmSD+LVDAZlezfxRThxb5ZhsV2Px6NnkW9mahmMvS8ASG1Qm4WmJDZ gH6rLs6TR+RKtkQK3yRJbB0UTeee2XsZAu1oPc9eYjEU/jWpBbDBGTQdjYhb2RRZ60zQnb Z6ES1GHY3vuAKReqIPxMWfs4bDLOkg/tu+s9yXy2VzwVR7JyJrP3R091ihlAKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764064167; a=rsa-sha256; cv=none; b=VYHWrZwV9LI8xXE0QB7Amrt5AcvS5jghCOy/0XUqaWZeXtow+zvCjZ6/jIAPjpI0GTkCBy hC8QZLeWx8C018B7JEbTjmkmsDjCgnuRphqLCGS6nQ5HYHwug3Hae8V2oIqMpoDyiyqM1P 4c5C6unzLoJgjFzLeZuUZR5zXbgF0boqro87ct4KdzNZr0p89myoikD815Q2isOrUTCa5M a0ME8LWvJsK+Wy5Sci5t2tSa4QlQoVoLfz+LW1tIlBCP7ypABun5zpLVLtf9y+coSTEtl9 M9v4UYwBwTtwkRtb+HV81GHsxhab55svMhTO1tv16x4Hg1eQx0tYWj5QtPN2ew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFyZv4R8Vzvtl for ; Tue, 25 Nov 2025 09:49:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 32f2b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 25 Nov 2025 09:49:27 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 58eacc815513 - stable/14 - if_ovpn: use IFT_TUNNEL List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 58eacc815513ceecbeb08783475e1b9375c7370a Auto-Submitted: auto-generated Date: Tue, 25 Nov 2025 09:49:27 +0000 Message-Id: <69257ba7.32f2b.3690945c@gitrepo.freebsd.org> The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=58eacc815513ceecbeb08783475e1b9375c7370a commit 58eacc815513ceecbeb08783475e1b9375c7370a Author: Kristof Provost AuthorDate: 2025-11-17 19:42:24 +0000 Commit: Kristof Provost CommitDate: 2025-11-25 09:39:08 +0000 if_ovpn: use IFT_TUNNEL IFT_ENC has special behaviour in pf we don't desire, and this also ensures that for all interface types there is N:1:1 correspondence between if_type:dlt:header len. Requested by: glebius MFC after: 1 week (cherry picked from commit ff9f76a206c80c263050816735d537a151ee2999) --- sys/net/if_ovpn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/if_ovpn.c b/sys/net/if_ovpn.c index 13e6db2764fb..631b3f4dfa26 100644 --- a/sys/net/if_ovpn.c +++ b/sys/net/if_ovpn.c @@ -2726,7 +2726,7 @@ ovpn_clone_create(struct if_clone *ifc, char *name, size_t len, return (EEXIST); sc = malloc(sizeof(struct ovpn_softc), M_OVPN, M_WAITOK | M_ZERO); - sc->ifp = if_alloc(IFT_ENC); + sc->ifp = if_alloc(IFT_TUNNEL); rm_init_flags(&sc->lock, "if_ovpn_lock", RM_RECURSE); sc->refcount = 0; From nobody Tue Nov 25 09:49:28 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dFyZw4HNpz6HsXP for ; Tue, 25 Nov 2025 09:49: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFyZw25kpz45BD for ; Tue, 25 Nov 2025 09:49:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764064168; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FCCN+Q8tYmhnzUkKEQrzjl1AiDUf6sGWY2j9eppcmxk=; b=RmRte5SekPk2D56C6/CiqPXNeXgNCnTYwxqBmTKXuCCL9Y3UWe1hZcfv3A9jOOR8spswqc 3kbUfl+1od9qZC3Y171uWGWrHsO07UsLMYz9SmMZyMcOf45EF4mL2HLbiR/PXAb4m1reM2 W9P7zNjQHJqRGHjxhy8Oi9RsnCpb46GMzFPsaasxYwEtFZm5O1mn61CuIzhE9G9nJoQSgt DtrwIffcbihi97dxFYcEPIWi2HIeX+kvfGgQTn/traxhpK+Vb5GqttyanCUeYGyeQkhbfG Xj9HFLNvnGDlEV+qkIuYyLBw/GPp92oQwF2sK9JU/k6otl1Iw1G93m6BUSyoBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764064168; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FCCN+Q8tYmhnzUkKEQrzjl1AiDUf6sGWY2j9eppcmxk=; b=T0wZcCvUbCvuxAcwTNKfOyRS80zRiEK/0U3mstrMyDc3Sh8v8kqKF838XAr4tysSP7J7d6 Pvtx4uLzFCS5wH6rQ9NHAiAsvMX5MtTE6J9UTHdudRxgISTFFutbTV6RM7rTpI9ITgoX9S j/cU3Wp9ZLpmwmngMzZWriabyzZIV5lioyz067PjAmb2ZzUYv2XWOVmGg7gVZHOsobFrUy RHtPli7l94/cVf5859YkQebAcrhS0xOCvuThHfFW3ICZAZjYovJS2au/WqMx0ulskJqNLQ 8+jVzd4SWzQVaI+3wMPmeYADNT3o7OBvJFiRewPauN4wMhPpGUWyitjEzSSCNg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764064168; a=rsa-sha256; cv=none; b=sIYdVzRIaXIv25YazpAeH6eUMLjxNPbgDN3N7dEcwWXu3j3FAKdAjQibJ/9JiTXI0AHjzp 7o0Cjrm3wt4HhRL/NlyWgEd9mvFd3JwG2Patv1J9MAWkcSGyow+pkUbmBAfrXwwCU/RSkN Dm6d4Xw7ZvxR4fL2CfxOpjWF2lwSHbnMU5cOO8+PhHgsbDs6inyqKPZShLg9Kerj1imWO1 rW8JntdQ40TW8CNMWZ58Fob+Cr9Bi9NWx4mTyuYfPhWbccqM3JGOBPpikX8SYQ7BsInEgc yiJmstLtWO1JsI/q/eAO2MXcpeSUe87pj9zuIjXyupChgo6uEl193JdTUOBo3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dFyZw1b7PzvxC for ; Tue, 25 Nov 2025 09:49:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 31a70 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 25 Nov 2025 09:49:28 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 870a7a949bf9 - stable/15 - pf: fix udp_mapping cleanup List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 870a7a949bf986e63cecc305bab90e7e8bfc0ccd Auto-Submitted: auto-generated Date: Tue, 25 Nov 2025 09:49:28 +0000 Message-Id: <69257ba8.31a70.7263aa6@gitrepo.freebsd.org> The branch stable/15 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=870a7a949bf986e63cecc305bab90e7e8bfc0ccd commit 870a7a949bf986e63cecc305bab90e7e8bfc0ccd Author: Kristof Provost AuthorDate: 2025-11-13 13:54:54 +0000 Commit: Kristof Provost CommitDate: 2025-11-25 09:39:24 +0000 pf: fix udp_mapping cleanup If we fail to obtain a new source port (pf_get_sport()) while we've created a udp_mapping (for 'endpoint independent nat') we must free the udp_mapping in pf_get_sport(). Otherwise the calling function will call pf_udp_mapping_release(). This will then attempt to remove the udp_mapping from a list it's not in, and crash. Actually free the udp_mapping in all failure cases. While here sprinkle in a few more assertions to ensure we don't forget leak udp_mappings and add a test case to provoke this problem. Reviewed by: thj MFC after: 1 week See also: https://redmine.pfsense.org/issues/16517 Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D53737 (cherry picked from commit c12013f5bb3819e64499f02ecd199a635003c7ce) --- sys/netpfil/pf/pf_lb.c | 29 ++++++++++++++++++++++------- tests/sys/netpfil/pf/nat.sh | 30 ++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 7 deletions(-) diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index bee9f4637091..c6cdc4e03f3e 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -301,9 +301,8 @@ pf_get_sport(struct pf_pdesc *pd, struct pf_krule *r, struct pf_addr *naddr, bzero(&init_addr, sizeof(init_addr)); - if (udp_mapping) { - MPASS(*udp_mapping == NULL); - } + MPASS(udp_mapping == NULL || + *udp_mapping == NULL); /* * If we are UDP and have an existing mapping we can get source port @@ -354,16 +353,22 @@ pf_get_sport(struct pf_pdesc *pd, struct pf_krule *r, struct pf_addr *naddr, if (pd->ndport == htons(ICMP_ECHO)) { low = 1; high = 65535; - } else + } else { + MPASS(udp_mapping == NULL || + *udp_mapping == NULL); return (0); /* Don't try to modify non-echo ICMP */ + } } #ifdef INET6 if (pd->proto == IPPROTO_ICMPV6) { if (pd->ndport == htons(ICMP6_ECHO_REQUEST)) { low = 1; high = 65535; - } else + } else { + MPASS(udp_mapping == NULL || + *udp_mapping == NULL); return (0); /* Don't try to modify non-echo ICMP */ + } } #endif /* INET6 */ @@ -386,6 +391,8 @@ pf_get_sport(struct pf_pdesc *pd, struct pf_krule *r, struct pf_addr *naddr, */ if (pd->proto == IPPROTO_SCTP) { key.port[sidx] = pd->nsport; + MPASS(udp_mapping == NULL || + *udp_mapping == NULL); if (!pf_find_state_all_exists(&key, dir)) { *nport = pd->nsport; return (0); @@ -400,6 +407,8 @@ pf_get_sport(struct pf_pdesc *pd, struct pf_krule *r, struct pf_addr *naddr, */ key.port[sidx] = pd->nsport; if (!pf_find_state_all_exists(&key, dir)) { + MPASS(udp_mapping == NULL || + *udp_mapping == NULL); *nport = pd->nsport; return (0); } @@ -413,6 +422,8 @@ pf_get_sport(struct pf_pdesc *pd, struct pf_krule *r, struct pf_addr *naddr, return (0); } } else { + MPASS(udp_mapping == NULL || + *udp_mapping == NULL); *nport = htons(low); return (0); } @@ -440,6 +451,8 @@ pf_get_sport(struct pf_pdesc *pd, struct pf_krule *r, struct pf_addr *naddr, key.port[sidx] = htons(tmp); if (!pf_find_state_all_exists(&key, dir)) { *nport = htons(tmp); + MPASS(udp_mapping == NULL || + *udp_mapping == NULL); return (0); } } @@ -457,6 +470,8 @@ pf_get_sport(struct pf_pdesc *pd, struct pf_krule *r, struct pf_addr *naddr, } else { key.port[sidx] = htons(tmp); if (!pf_find_state_all_exists(&key, dir)) { + MPASS(udp_mapping == NULL || + *udp_mapping == NULL); *nport = htons(tmp); return (0); } @@ -473,13 +488,13 @@ pf_get_sport(struct pf_pdesc *pd, struct pf_krule *r, struct pf_addr *naddr, */ if (pf_map_addr_sn(pd->naf, r, &pd->nsaddr, naddr, &(pd->naf), NULL, &init_addr, rpool, sn_type)) - return (1); + goto failed; break; case PF_POOL_NONE: case PF_POOL_SRCHASH: case PF_POOL_BITMASK: default: - return (1); + goto failed; } } while (! PF_AEQ(&init_addr, naddr, pd->naf) ); diff --git a/tests/sys/netpfil/pf/nat.sh b/tests/sys/netpfil/pf/nat.sh index 25cac1810349..7d5db6743424 100644 --- a/tests/sys/netpfil/pf/nat.sh +++ b/tests/sys/netpfil/pf/nat.sh @@ -257,6 +257,35 @@ endpoint_independent_compat_cleanup() rm -f server2.out } +atf_test_case "endpoint_independent_exhaust" "cleanup" +endpoint_independent_exhaust_head() +{ + atf_set descr 'Test that a client behind NAT gets the same external IP:port for different servers' + atf_set require.user root +} + +endpoint_independent_exhaust_body() +{ + endpoint_independent_setup # Sets ${epair_…} variables + + endpoint_independent_common \ + "nat on ${epair_nat}a inet from ! (${epair_nat}a) to any -> (${epair_nat}a)" \ + "nat on ${epair_nat}a inet from ! (${epair_nat}a) to any -> (${epair_nat}a) port 3000:3001 sticky-address endpoint-independent" + + # Exhaust the available nat ports + for i in $(seq 1 10); do + echo "ping" | jexec client nc -u 198.51.100.32 1234 -w 0 + echo "ping" | jexec client nc -u 198.51.100.22 1234 -w 0 + done +} + +endpoint_independent_exhaust_cleanup() +{ + pft_cleanup + rm -f server1.out + rm -f server2.out +} + atf_test_case "endpoint_independent_pass" "cleanup" endpoint_independent_pass_head() { @@ -851,6 +880,7 @@ atf_init_test_cases() atf_add_test_case "exhaust" atf_add_test_case "nested_anchor" atf_add_test_case "endpoint_independent_compat" + atf_add_test_case "endpoint_independent_exhaust" atf_add_test_case "endpoint_independent_pass" atf_add_test_case "nat6_nolinklocal" atf_add_test_case "empty_table_source_hash" From nobody Tue Nov 25 14:02:12 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dG4BX4ZbBz6JC4C for ; Tue, 25 Nov 2025 14:02:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dG4BX3b5yz3NFW for ; Tue, 25 Nov 2025 14:02:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764079332; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1cxLiYDuSmhXfYN4K0RLCPjuw+1sLfH3SpzK4lZz7aU=; b=TbNoiJX8z6IuSI7zHnJut2Pd3qkHpz076X5nngHKvPNuVQhvAZnHwSecofL/l7zTT4E/3x m32upi1lfNYbXwJVxgxdv+olaeThCnurlB+Majk9lpldWfS0Hhcy6OEAw2l86xOeFGdXE1 FlZnqEIO/+VWvPKNkvOhF4+YASZFUn9/yGk0OX/P9GwZzD5ME0WbnM/Fak2v0iFMtAQEU+ wO57uZHOxFb10354XkhWPSxtWSg30k8cADWZzAPv7IQckKsG28Avq+RGzcJnJElUH1Rpn7 J2JD3+IkN+sgsYUhvCULs0JVa5eYwJaUPIW+CFSP0gILKubUWMf9JCc04xjMUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764079332; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1cxLiYDuSmhXfYN4K0RLCPjuw+1sLfH3SpzK4lZz7aU=; b=GzjDza+uXWHr/I+C2N+FD42f58Ja81MGNl2QKt53WwCszVlqWeA3JxlYmqy5sBhncKWgY5 jEPbwgLrtyUIqh7KYrgwhN2/mbQMqtPg/ApxbzUMzla4CWFtRu4g3M14iWao11ckc91tWr GQvlbZ3HgbZblhN/K6JEPb38RkaAz5pzAPHa+mV4aXJOUa7/gwakHSo3fSTMa80ygSv/qg pXcXJ8SxtztY7iDlCS5Ed2CMfEzVNekdMjxOS5mXnC3pT/OB827xUK+gEn11VQCiy0CTHf vGoG9vUTt5dyic+mPGHuD6NlFk1bQBcgdy3HBfq7pBB6LAqtsyT0DLFGiW+oGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764079332; a=rsa-sha256; cv=none; b=J5LsML5D60LsD7Y96e6soP19ELy7F/ZNgpgoR1WQc//RMEJ1dnEZR+jhy0zZSI7SKHRo1x CVa8uS4pqGeCEbkwSDUnw2XKddIDpEJdhZOukNg/7tvFTbO71kovX5l8P/+bX+DPhKQcsY pJbT0EZQhi9Ku4vH3dnhQ4O+vRn7asefhwKiKTEOtMhgiDR/xj88MGHp0Cbtjqullk46lU sHAh+VQA6AIKsxUUgHeqEyQbTifxu/VZyIj+XVyu8jA1Z2uDdx5zCk+/ImZX+XZqvyJZnl G6lNPzsuX5JAByS7NiYgbh3GbMC7R49k47QOu1b/kQkIaKHLFCT+2PZX0wCFDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dG4BX3BSkz13xS for ; Tue, 25 Nov 2025 14:02:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2d140 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 25 Nov 2025 14:02:12 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: f8bf6f81d6c2 - stable/14 - kevent: Hold the knlist mutex when invoking f_event(NOTE_FORK) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f8bf6f81d6c2b73b065befedddac3bf29f2963de Auto-Submitted: auto-generated Date: Tue, 25 Nov 2025 14:02:12 +0000 Message-Id: <6925b6e4.2d140.4f1a4e33@gitrepo.freebsd.org> The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f8bf6f81d6c2b73b065befedddac3bf29f2963de commit f8bf6f81d6c2b73b065befedddac3bf29f2963de Author: Mark Johnston AuthorDate: 2025-11-18 14:22:04 +0000 Commit: Mark Johnston CommitDate: 2025-11-25 13:57:14 +0000 kevent: Hold the knlist mutex when invoking f_event(NOTE_FORK) In general f_event is supposed to be called with the knlist mutex held, so lock it earlier to follow this protocol. Also make sure that the update to kn_fflags is synchronized. Lock the kqueue itself earlier in the case where the knote is activated, to avoid locking and unlocking the kqueue twice. PR: 291005 Reported by: Qiu-ji Chen Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D53762 (cherry picked from commit d795c753e262b97a93dc353aa66b858e1b1969d1) --- sys/kern/kern_event.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index d1145c37e128..4aba212544f7 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -603,12 +603,20 @@ knote_fork(struct knlist *list, int pid) kev.data = kn->kn_id; /* parent */ kev.udata = kn->kn_kevent.udata;/* preserve udata */ error = kqueue_register(kq, &kev, NULL, M_NOWAIT); + + /* + * Serialize updates to the kn_kevent fields with threads + * scanning the queue. + */ + list->kl_lock(list->kl_lockarg); if (error) kn->kn_fflags |= NOTE_TRACKERR; - if (kn->kn_fop->f_event(kn, NOTE_FORK)) - KNOTE_ACTIVATE(kn, 0); - list->kl_lock(list->kl_lockarg); - KQ_LOCK(kq); + if (kn->kn_fop->f_event(kn, NOTE_FORK)) { + KQ_LOCK(kq); + KNOTE_ACTIVATE(kn, 1); + } else { + KQ_LOCK(kq); + } kn_leave_flux(kn); KQ_UNLOCK_FLUX(kq); } From nobody Tue Nov 25 14:02:28 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dG4Br4XtQz6JC8c for ; Tue, 25 Nov 2025 14:02: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dG4Br3Nn8z3NZx for ; Tue, 25 Nov 2025 14:02:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764079348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=14liq3eF8ump4gsjnQtdrWuvftj5cvnAE6cxwciJu5A=; b=uKe61f6RLTV1YsKljWYsVCBaB6LZi2m5O8Z9FV8AXwd+452dj13oyASvuNW5JGxzC8lJ+f /xDJcubzDs0avzp42MBqdqocd0D0K6w4WTQ61HB6l2SRKRGxq+WoPI4I4dpFpnpfwclTPk uQIN5w+kLawujJjXBYoyZFS3Z3H7495fZJOx5WSy5Fg0eSKLXP09KFS+ALcpPn/F+727TK Q+yr5++xeBqtlj9oYb7GlK38zWwBYYwY8TUEFy+A05Pz7dCBp2gpRSMrtQSh0Kt2wmDVM5 2G0U7AJFLp4kO36MWe3A0w4nBAJZ3CngVdVQzGErr2HkBeICtJEJ1UxgqyJKdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764079348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=14liq3eF8ump4gsjnQtdrWuvftj5cvnAE6cxwciJu5A=; b=uAGAYCB0m8FrkHxbWS02fZ2k33bY7Q8z7hEf00Omw4zxtbgPqbsVy3DIZewApNzVI5vnP9 H7sL9N3OthSe1nMzgKCH8XKttDgpIJUM78g0eQ2fNsPgVpP/P+TBiFu1YFgWlOpD44P3Qr nJh8OVFQzNxTcqv78zMPkKG+XVSsXqDDEkIFvrjWxSMWm/yQWe128kU05/8+tD5t63vOMi 45qrDS4KvWevfeLuu4rToRUkbsQ15sRsCPaf3SMsgGYgus0WAVQ5bFMqUDfZL6YwKTRd3i u8IbnjA05/hb1km4/w4cOl0efeLoYfuUg7uMo7aqJyvTUsIXP/m68PUk60ffFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764079348; a=rsa-sha256; cv=none; b=gXQRsDZMS058Y7BeX6/IYTD3X1J+l0WDv4545LYuJmECUABbmQdoNI3CZFfy3SjxTPqdZU HrY3E1Y8pfWwDaI58YMoZlQxxJ/QzcOKMQ7jxTdBVk8AzQASTkgr0afJTNkNsnSjlQFp+0 5KrEzNOMbL/E4Y+zHFCNSwyMqGn10DUm1thOmWcOSLN04oDCt9EE/a+clTwyMv+G6yxmCJ HqHuLfyYJInSq5wl07c5UJhdLV8O98kbofbSOQOHouOySgZrf+51Luru0jVeA2LdOBP67v 85Lms3RSHg/AfTa6e1I/P3dyRkZEGImtN5L4X/Dpt/Ig1jEG82pWr7TnL6KlPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dG4Br2xWyz138g for ; Tue, 25 Nov 2025 14:02:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2da45 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 25 Nov 2025 14:02:28 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 23ddcd227ab7 - stable/15 - kevent: Hold the knlist mutex when invoking f_event(NOTE_FORK) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 23ddcd227ab71b1d687f9ea298696f7d082c9cd5 Auto-Submitted: auto-generated Date: Tue, 25 Nov 2025 14:02:28 +0000 Message-Id: <6925b6f4.2da45.303f61bd@gitrepo.freebsd.org> The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=23ddcd227ab71b1d687f9ea298696f7d082c9cd5 commit 23ddcd227ab71b1d687f9ea298696f7d082c9cd5 Author: Mark Johnston AuthorDate: 2025-11-18 14:22:04 +0000 Commit: Mark Johnston CommitDate: 2025-11-25 14:02:20 +0000 kevent: Hold the knlist mutex when invoking f_event(NOTE_FORK) In general f_event is supposed to be called with the knlist mutex held, so lock it earlier to follow this protocol. Also make sure that the update to kn_fflags is synchronized. Lock the kqueue itself earlier in the case where the knote is activated, to avoid locking and unlocking the kqueue twice. PR: 291005 Reported by: Qiu-ji Chen Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D53762 (cherry picked from commit d795c753e262b97a93dc353aa66b858e1b1969d1) --- sys/kern/kern_event.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 84af7b264d08..c18bf3b12352 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -627,12 +627,20 @@ knote_fork(struct knlist *list, int pid) kev.data = kn->kn_id; /* parent */ kev.udata = kn->kn_kevent.udata;/* preserve udata */ error = kqueue_register(kq, &kev, NULL, M_NOWAIT); + + /* + * Serialize updates to the kn_kevent fields with threads + * scanning the queue. + */ + list->kl_lock(list->kl_lockarg); if (error) kn->kn_fflags |= NOTE_TRACKERR; - if (kn->kn_fop->f_event(kn, NOTE_FORK)) - KNOTE_ACTIVATE(kn, 0); - list->kl_lock(list->kl_lockarg); - KQ_LOCK(kq); + if (kn->kn_fop->f_event(kn, NOTE_FORK)) { + KQ_LOCK(kq); + KNOTE_ACTIVATE(kn, 1); + } else { + KQ_LOCK(kq); + } kn_leave_flux(kn); KQ_UNLOCK_FLUX(kq); } From nobody Tue Nov 25 21:05:16 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dGFZj1L3Cz6HnQN for ; Tue, 25 Nov 2025 21:05: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dGFZj0Bf8z3SSm for ; Tue, 25 Nov 2025 21:05:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764104717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eLNqM4qo+thwu9OXwYqac8SRLmqpOCk1l9anVd/goe0=; b=fLPLtX2f0dfDjbWCfEtyvhLohG0fvs/hwtwGjBybzLqeimKKRLmZp0p+deiJJI3//cKTt+ 0RqwJGThAnh86K0U1kpN0umLqO0ar+dHWnIwlONWq+l3H2ZQmsO90GBNdr6bxOHZOGEObC tqRkXRUjYITYweFr3p6kfMDQ6ivv2KoXHBrywrFTWzAQdJNcOMbjvZy8Nnfxlj2mk8yQDg 3hy/g/viCSlDxyLkmCNZcAIK6bQQtE/pcNNNtW7iC9RMIw0taU8IuWoE9rviOJExOk8l5m 0ZnLfRKHbDuph9WACs0gqcNDsE+pVc6gKOSVUBoD3GYGA/TpsOCzGeRqIaFt0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764104717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eLNqM4qo+thwu9OXwYqac8SRLmqpOCk1l9anVd/goe0=; b=LQm3P+YDAVf/molj+B2FqmSJL2xjf45l6aRuNU7kyr17UrsgFzEyCkfL2OcaD60aum/APQ WtQEEANj+YVMxoXUPn2Th676arIYBdwiv8UokSpO+07RDL2nh35ImxBkNsE/dP+9unHNsq 4l2EfvkuBkF9hG/7PLiCyqouiulStiQIacfLaiFWK8OuOUAO8BYPEa+m9pqzMZqdZZjC2J xlnLM+ntxj7lSs7KWwJPUlXbPlT+nxOdt53L0wZZwOWQkw5XAVaJSn/wVOgNtHszGl1c7R J4CSbV4K/xg120VlXTsWKoLPcRkleg0sVfzAFIR1oak5APm6qCumIpX51fuf3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764104717; a=rsa-sha256; cv=none; b=ieKqfrVF3rswRMv42Nsw6SJBmBpNggXyzNBdvNFhO3zmS1+JIJcfh47SRCngT0gWQ2QrGg Coy8aAkVEtBVBRx3e58zRSOBAYOQWZXlV0UsMTv8t0xnrhFGJcQAaVDYpuBOQOc3930JLZ wenuJih9FGKpF7CdMjZfHPWR+sEw7Q0tytv/ncqiE5a7XPITxLy/IdtZuM0Sn4Ul3JOOLg hU6Kbs/8r4TgvRznNBIuv7E3l99tBx1m61plw2u9hqtlVGjZ7QWN3eAyqTM412J9RjGAqR XFKlDChI/TwOF/e6KzCO0Ux9nmhMNOjF24cwbQFaK1ki1owVtdvUxxX8ArJrNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dGFZh6t0Fz2KH for ; Tue, 25 Nov 2025 21:05:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2edf5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 25 Nov 2025 21:05:16 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Minsoo Choo From: Alexander Ziaee Subject: git: 6162f863ce86 - stable/15 - jemalloc: import jemalloc 5.3.0 man page List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 6162f863ce86df854305416b058ff6b17bd0261c Auto-Submitted: auto-generated Date: Tue, 25 Nov 2025 21:05:16 +0000 Message-Id: <69261a0c.2edf5.15bb0322@gitrepo.freebsd.org> The branch stable/15 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=6162f863ce86df854305416b058ff6b17bd0261c commit 6162f863ce86df854305416b058ff6b17bd0261c Author: Minsoo Choo AuthorDate: 2025-11-17 18:45:19 +0000 Commit: Alexander Ziaee CommitDate: 2025-11-25 21:05:11 +0000 jemalloc: import jemalloc 5.3.0 man page Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1890 (cherry picked from commit bf4c7487f25d3891425a9ba54516b740a948876b) --- lib/libc/stdlib/malloc/jemalloc/jemalloc.3 | 232 ++++++++++++++++++++++------- 1 file changed, 180 insertions(+), 52 deletions(-) diff --git a/lib/libc/stdlib/malloc/jemalloc/jemalloc.3 b/lib/libc/stdlib/malloc/jemalloc/jemalloc.3 index a4ea3e1f54a9..6d905c815ef4 100644 --- a/lib/libc/stdlib/malloc/jemalloc/jemalloc.3 +++ b/lib/libc/stdlib/malloc/jemalloc/jemalloc.3 @@ -1,13 +1,13 @@ '\" t .\" Title: JEMALLOC .\" Author: Jason Evans -.\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/10/2019 +.\" Generator: DocBook XSL Stylesheets vsnapshot +.\" Date: 05/06/2022 .\" Manual: User Manual -.\" Source: jemalloc 5.2.1-0-gea6b3e973b477b8061e0076bb257dbd7f3faa756 +.\" Source: jemalloc 5.3.0-0-g54eaed1d8b56b1aa528be3bdd1877e59c56fa90c .\" Language: English .\" -.TH "JEMALLOC" "3" "11/10/2019" "jemalloc 5.2.1-0-gea6b3e973b47" "User Manual" +.TH "JEMALLOC" "3" "05/06/2022" "jemalloc 5.3.0-0-g54eaed1d8b56" "User Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -31,26 +31,13 @@ jemalloc \- general purpose memory allocation functions .SH "LIBRARY" .PP -This manual describes jemalloc 5\&.2\&.1\-0\-gea6b3e973b477b8061e0076bb257dbd7f3faa756\&. More information can be found at the +This manual describes jemalloc 5\&.3\&.0\-0\-g54eaed1d8b56b1aa528be3bdd1877e59c56fa90c\&. More information can be found at the \m[blue]\fBjemalloc website\fR\m[]\&\s-2\u[1]\d\s+2\&. -.PP -The following configuration options are enabled in libc\*(Aqs built\-in jemalloc: -\fB\-\-enable\-fill\fR, -\fB\-\-enable\-lazy\-lock\fR, -\fB\-\-enable\-stats\fR, -\fB\-\-enable\-utrace\fR, -\fB\-\-enable\-xmalloc\fR, and -\fB\-\-with\-malloc\-conf=abort_conf:false\fR\&. Additionally, -\fB\-\-enable\-debug\fR -is enabled in development versions of FreeBSD (controlled by the -\fBMK_MALLOC_PRODUCTION\fR -make variable)\&. .SH "SYNOPSIS" .sp .ft B .nf -#include -#include +#include .fi .ft .SS "Standard API" @@ -603,7 +590,7 @@ T} :T{ 8 KiB T}:T{ -[40 KiB, 48 KiB, 54 KiB, 64 KiB] +[40 KiB, 48 KiB, 56 KiB, 64 KiB] T} :T{ 16 KiB @@ -848,6 +835,11 @@ in these cases\&. This option is disabled by default unless is specified during configuration, in which case it is enabled by default\&. .RE .PP +opt\&.cache_oblivious (\fBbool\fR) r\- +.RS 4 +Enable / Disable cache\-oblivious large allocation alignment, for large requests with no alignment constraints\&. If this feature is disabled, all large allocations are page\-aligned as an implementation artifact, which can severely harm CPU cache utilization\&. However, the cache\-oblivious layout comes at the cost of one extra page per large allocation, which in the most extreme case increases physical memory usage for the 16 KiB size class to 20 KiB\&. This option is enabled by default\&. +.RE +.PP opt\&.metadata_thp (\fBconst char *\fR) r\- .RS 4 Controls whether to allow jemalloc to use transparent huge page (THP) for internal metadata (see @@ -859,6 +851,11 @@ uses no THP initially, but may begin to do so when metadata usage reaches certai \(lqdisabled\(rq\&. .RE .PP +opt\&.trust_madvise (\fBbool\fR) r\- +.RS 4 +If true, do not perform runtime check for MADV_DONTNEED, to check that it actually zeros pages\&. The default is disabled on Linux and enabled elsewhere\&. +.RE +.PP opt\&.retain (\fBbool\fR) r\- .RS 4 If true, retain unused virtual memory for later reuse rather than discarding it by calling @@ -990,6 +987,28 @@ is enabled\&. The default is \(lq\(rq\&. .RE .PP +opt\&.stats_interval (\fBint64_t\fR) r\- +.RS 4 +Average interval between statistics outputs, as measured in bytes of allocation activity\&. The actual interval may be sporadic because decentralized event counters are used to avoid synchronization bottlenecks\&. The output may be triggered on any thread, which then calls +malloc_stats_print()\&. +opt\&.stats_interval_opts +can be combined to specify output options\&. By default, interval\-triggered stats output is disabled (encoded as \-1)\&. +.RE +.PP +opt\&.stats_interval_opts (\fBconst char *\fR) r\- +.RS 4 +Options (the +\fIopts\fR +string) to pass to the +malloc_stats_print() +for interval based statistics printing (enabled through +opt\&.stats_interval)\&. See available options in +malloc_stats_print()\&. Has no effect unless +opt\&.stats_interval +is enabled\&. The default is +\(lq\(rq\&. +.RE +.PP opt\&.junk (\fBconst char *\fR) r\- [\fB\-\-enable\-fill\fR] .RS 4 Junk filling\&. If set to @@ -1046,13 +1065,13 @@ This option is disabled by default\&. opt\&.tcache (\fBbool\fR) r\- .RS 4 Thread\-specific caching (tcache) enabled/disabled\&. When there are multiple threads, each thread uses a tcache for objects up to a certain size\&. Thread\-specific caching allows many allocations to be satisfied without performing any thread synchronization, at the cost of increased memory use\&. See the -opt\&.lg_tcache_max +opt\&.tcache_max option for related tuning information\&. This option is enabled by default\&. .RE .PP -opt\&.lg_tcache_max (\fBsize_t\fR) r\- +opt\&.tcache_max (\fBsize_t\fR) r\- .RS 4 -Maximum size class (log base 2) to cache in the thread\-specific cache (tcache)\&. At a minimum, all small size classes are cached, and at a maximum all large size classes are cached\&. The default maximum is 32 KiB (2^15)\&. +Maximum size class to cache in the thread\-specific cache (tcache)\&. At a minimum, the first size class is cached; and at a maximum, size classes up to 8 MiB can be cached\&. The default maximum is 32 KiB (2^15)\&. As a convenience, this may also be set by specifying lg_tcache_max, which will be taken to be the base\-2 logarithm of the setting of tcache_max\&. .RE .PP opt\&.thp (\fBconst char *\fR) r\- @@ -1091,7 +1110,8 @@ for heap profile format documentation\&. opt\&.prof_prefix (\fBconst char *\fR) r\- [\fB\-\-enable\-prof\fR] .RS 4 Filename prefix for profile dumps\&. If the prefix is set to the empty string, no automatic dumps will occur; this is primarily useful for disabling the automatic final heap dump (which also disables leak reporting, if enabled)\&. The default prefix is -jeprof\&. +jeprof\&. This prefix value can be overridden by +prof\&.prefix\&. .RE .PP opt\&.prof_active (\fBbool\fR) r\- [\fB\-\-enable\-prof\fR] @@ -1129,7 +1149,9 @@ Average interval (log base 2) between memory profile dumps, as measured in bytes is controlled by the opt\&.prof_prefix -option\&. By default, interval\-triggered profile dumping is disabled (encoded as \-1)\&. +and +prof\&.prefix +options\&. By default, interval\-triggered profile dumping is disabled (encoded as \-1)\&. .RE .PP opt\&.prof_gdump (\fBbool\fR) r\- [\fB\-\-enable\-prof\fR] @@ -1147,7 +1169,9 @@ function to dump final memory usage to a file named according to the pattern is controlled by the opt\&.prof_prefix -option\&. Note that +and +prof\&.prefix +options\&. Note that atexit() may allocate memory during application initialization and then deadlock internally when jemalloc in turn calls atexit(), so this option is not universally usable (though the application can register its own @@ -1161,7 +1185,46 @@ Leak reporting enabled/disabled\&. If enabled, use an \fBatexit\fR(3) function to report memory leaks detected by allocation sampling\&. See the opt\&.prof -option for information on analyzing heap profile output\&. This option is disabled by default\&. +option for information on analyzing heap profile output\&. Works only when combined with +opt\&.prof_final, otherwise does nothing\&. This option is disabled by default\&. +.RE +.PP +opt\&.prof_leak_error (\fBbool\fR) r\- [\fB\-\-enable\-prof\fR] +.RS 4 +Similar to +opt\&.prof_leak, but makes the process exit with error code 1 if a memory leak is detected\&. This option supersedes +opt\&.prof_leak, meaning that if both are specified, this option takes precedence\&. When enabled, also enables +opt\&.prof_leak\&. Works only when combined with +opt\&.prof_final, otherwise does nothing\&. This option is disabled by default\&. +.RE +.PP +opt\&.zero_realloc (\fBconst char *\fR) r\- +.RS 4 +Determines the behavior of +realloc() +when passed a value of zero for the new size\&. +\(lqalloc\(rq +treats this as an allocation of size zero (and returns a non\-null result except in case of resource exhaustion)\&. +\(lqfree\(rq +treats this as a deallocation of the pointer, and returns +\fBNULL\fR +without setting +\fIerrno\fR\&. +\(lqabort\(rq +aborts the process if zero is passed\&. The default is +\(lqfree\(rq +on Linux and Windows, and +\(lqalloc\(rq +elsewhere\&. +.sp +There is considerable divergence of behaviors across implementations in handling this case\&. Many have the behavior of +\(lqfree\(rq\&. This can introduce security vulnerabilities, since a +\fBNULL\fR +return value indicates failure, and the continued validity of the passed\-in pointer (per POSIX and C11)\&. +\(lqalloc\(rq +is safe, but can cause leaks in programs that expect the common behavior\&. Programs intended to be portable and leak\-free cannot assume either behavior, and must therefore never call realloc with a size of 0\&. The +\(lqabort\(rq +option enables these testing this behavior\&. .RE .PP thread\&.arena (\fBunsigned\fR) rw @@ -1182,7 +1245,7 @@ Get a pointer to the the value that is returned by the thread\&.allocated mallctl\&. This is useful for avoiding the overhead of repeated mallctl*() -calls\&. +calls\&. Note that the underlying counter should not be modified by the application\&. .RE .PP thread\&.deallocated (\fBuint64_t\fR) r\- [\fB\-\-enable\-stats\fR] @@ -1196,7 +1259,23 @@ Get a pointer to the the value that is returned by the thread\&.deallocated mallctl\&. This is useful for avoiding the overhead of repeated mallctl*() -calls\&. +calls\&. Note that the underlying counter should not be modified by the application\&. +.RE +.PP +thread\&.peak\&.read (\fBuint64_t\fR) r\- [\fB\-\-enable\-stats\fR] +.RS 4 +Get an approximation of the maximum value of the difference between the number of bytes allocated and the number of bytes deallocated by the calling thread since the last call to +thread\&.peak\&.reset, or since the thread\*(Aqs creation if it has not called +thread\&.peak\&.reset\&. No guarantees are made about the quality of the approximation, but jemalloc currently endeavors to maintain accuracy to within one hundred kilobytes\&. +.RE +.PP +thread\&.peak\&.reset (\fBvoid\fR) \-\- [\fB\-\-enable\-stats\fR] +.RS 4 +Resets the counter for net bytes allocated in the calling thread to zero\&. This affects subsequent calls to +thread\&.peak\&.read, but not the values returned by +thread\&.allocated +or +thread\&.deallocated\&. .RE .PP thread\&.tcache\&.enabled (\fBbool\fR) rw @@ -1224,11 +1303,27 @@ Control whether sampling is currently active for the calling thread\&. This is a prof\&.active; both must be active for the calling thread to sample\&. This flag is enabled by default\&. .RE .PP +thread\&.idle (\fBvoid\fR) \-\- +.RS 4 +Hints to jemalloc that the calling thread will be idle for some nontrivial period of time (say, on the order of seconds), and that doing some cleanup operations may be beneficial\&. There are no guarantees as to what specific operations will be performed; currently this flushes the caller\*(Aqs tcache and may (according to some heuristic) purge its associated arena\&. +.sp +This is not intended to be a general\-purpose background activity mechanism, and threads should not wake up multiple times solely to call it\&. Rather, a thread waiting for a task should do a timed wait first, call +thread\&.idle +if no task appears in the timeout interval, and then do an untimed wait\&. For such a background activity mechanism, see +background_thread\&. +.RE +.PP tcache\&.create (\fBunsigned\fR) r\- .RS 4 Create an explicit thread\-specific cache (tcache) and return an identifier that can be passed to the \fBMALLOCX_TCACHE(\fR\fB\fItc\fR\fR\fB)\fR macro to explicitly use the specified cache rather than the automatically managed one that is used by default\&. Each explicit cache can be used by only one thread at a time; the application must assure that this constraint holds\&. +.sp +If the amount of space supplied for storing the thread\-specific cache identifier does not equal +sizeof(\fBunsigned\fR), no thread\-specific cache will be created, no data will be written to the space pointed by +\fIoldp\fR, and +\fI*oldlenp\fR +will be set to 0\&. .RE .PP tcache\&.flush (\fBunsigned\fR) \-w @@ -1634,6 +1729,12 @@ Maximum size supported by this large size class\&. arenas\&.create (\fBunsigned\fR, \fBextent_hooks_t *\fR) rw .RS 4 Explicitly create a new arena outside the range of automatically managed arenas, with optionally specified extent hooks, and return the new arena index\&. +.sp +If the amount of space supplied for storing the arena index does not equal +sizeof(\fBunsigned\fR), no arena will be created, no data will be written to the space pointed by +\fIoldp\fR, and +\fI*oldlenp\fR +will be set to 0\&. .RE .PP arenas\&.lookup (\fBunsigned\fR, \fBvoid*\fR) rw @@ -1666,7 +1767,16 @@ Dump a memory profile to the specified file, or if NULL is specified, to a file is controlled by the opt\&.prof_prefix -option\&. +and +prof\&.prefix +options\&. +.RE +.PP +prof\&.prefix (\fBconst char *\fR) \-w [\fB\-\-enable\-prof\fR] +.RS 4 +Set the filename prefix for profile dumps\&. See +opt\&.prof_prefix +for the default setting\&. This can be useful to differentiate profile dumps such as from forked processes\&. .RE .PP prof\&.gdump (\fBbool\fR) rw [\fB\-\-enable\-prof\fR] @@ -1676,7 +1786,9 @@ When enabled, trigger a memory profile dump every time the total virtual memory is controlled by the opt\&.prof_prefix -option\&. +and +prof\&.prefix +options\&. .RE .PP prof\&.reset (\fBsize_t\fR) \-w [\fB\-\-enable\-prof\fR] @@ -1752,6 +1864,18 @@ for details)\&. Retained memory is excluded from mapped memory statistics, e\&.g stats\&.mapped\&. .RE .PP +stats\&.zero_reallocs (\fBsize_t\fR) r\- [\fB\-\-enable\-stats\fR] +.RS 4 +Number of times that the +realloc() +was called with a non\-\fBNULL\fR +pointer argument and a +\fB0\fR +size argument\&. This is a fundamentally unsafe pattern in portable programs; see +opt\&.zero_realloc +for details\&. +.RE +.PP stats\&.background_thread\&.num_threads (\fBsize_t\fR) r\- [\fB\-\-enable\-stats\fR] .RS 4 Number of @@ -1825,6 +1949,26 @@ is one of the counters in mutex profiling counters\&. .RE .PP +stats\&.mutexes\&.prof_thds_data\&.{counter} (\fBcounter specific type\fR) r\- [\fB\-\-enable\-stats\fR] +.RS 4 +Statistics on +\fIprof\fR +threads data mutex (global scope; profiling related)\&. +{counter} +is one of the counters in +mutex profiling counters\&. +.RE +.PP +stats\&.mutexes\&.prof_dump\&.{counter} (\fBcounter specific type\fR) r\- [\fB\-\-enable\-stats\fR] +.RS 4 +Statistics on +\fIprof\fR +dumping mutex (global scope; profiling related)\&. +{counter} +is one of the counters in +mutex profiling counters\&. +.RE +.PP stats\&.mutexes\&.reset (\fBvoid\fR) \-\- [\fB\-\-enable\-stats\fR] .RS 4 Reset all mutex profile statistics, including global mutexes, arena mutexes and bin mutexes\&. @@ -2242,7 +2386,7 @@ heap_v2/524288 [\&.\&.\&.] @ 0x5f86da8 0x5f5a1dc [\&.\&.\&.] 0x29e4d4e 0xa200316 0xabb2988 [\&.\&.\&.] t*: 13: 6688 [0: 0] - t3: 12: 6496 [0: ] + t3: 12: 6496 [0: 0] t99: 1: 192 [0: 0] [\&.\&.\&.] @@ -2264,9 +2408,9 @@ to indicate descriptions of the corresponding fields\&. / : : [: ] [\&.\&.\&.] - : : [: ] + : : [: ] [\&.\&.\&.] - : : [: ] + : : [: ] [\&.\&.\&.] @ [\&.\&.\&.] [\&.\&.\&.] : : [: ] @@ -2432,7 +2576,8 @@ is not \fInewlen\fR is too large or too small\&. Alternatively, \fI*oldlenp\fR -is too large or too small; in this case as much data as possible are read despite the error\&. +is too large or too small; when it happens, except for a very few cases explicitly documented otherwise, as much data as possible are read despite the error, with the amount of data read being recorded in +\fI*oldlenp\fR\&. .RE .PP ENOENT @@ -2520,23 +2665,6 @@ functions conform to ISO/IEC 9899:1990 (\(lqISO C90\(rq)\&. The posix_memalign() function conforms to IEEE Std 1003\&.1\-2001 (\(lqPOSIX\&.1\(rq)\&. -.SH "HISTORY" -.PP -The -malloc_usable_size() -and -posix_memalign() -functions first appeared in FreeBSD 7\&.0\&. -.PP -The -aligned_alloc(), -malloc_stats_print(), and -mallctl*() -functions first appeared in FreeBSD 10\&.0\&. -.PP -The -*allocx() -functions first appeared in FreeBSD 11\&.0\&. .SH "AUTHOR" .PP \fBJason Evans\fR From nobody Tue Nov 25 22:59:08 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dGJ6472bYz6HxCZ for ; Tue, 25 Nov 2025 22:59:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dGJ646SXBz3fc8 for ; Tue, 25 Nov 2025 22:59:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764111548; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6tiTiF8ZRjO8upKhR+6txQf06UE38xxV/8u+oPVFzxo=; b=S0nF9WJejUPk9hrWChBHtqiGhwp91ojZawl5crvUZMAWn964j33Uas87reyVzeENc8+ZYi gmHZqsPumdpT7lLX1OgCvl2eaoeUZDMy8hnNx8cNFfkOSXhKQQco/RNSBDfW46eI0WvRco nAhUk7m8BtNZgtkm7A5CxfdWYcgqJEfFko58KdKLFLID21oDFu3eCWSxdneXvQtb9X771y EPmByl3gRwyimFvutwgpePjFxrg+NszavUeYbtT7v51D5uNktPmOjTanCKbDQMK/kjsPgo Pm3ktp/4cmH5MY9BmSLJTvTl+qj+Jsa4oaIPnr2GmifMbexcI/hKdZINWj/WFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764111548; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6tiTiF8ZRjO8upKhR+6txQf06UE38xxV/8u+oPVFzxo=; b=vbElJ8RbwIIQSaMg3kkCXy9SOssTroq+6ctKVeYbAkvr7P+uCYdEWa3OGNnT612HalzO/N uHKgDnQRLzNHNS5TgsIZwOwCfOV9X/io9e/tXrBFtkKqcdy5L580A3r98ZL5NdmZqXY3jt H0XbqyR+F0ttClwnxSAGsUoahwB+6CBz8MlZQbJjKeM20mnM2jBGRDaPRDy4ibwkcdF20h oMyOkjDmLu5t0f6G1sePUf6IrL1voG+MKgkuizbCfj6woMmINEd9FreuH+zUq1I7VhS3uj nrjetTqXyHChpBBcma+Dwra5N66Pcr2vE60k8pt7W/h/gP9LP0dmzUl+ExnyKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764111548; a=rsa-sha256; cv=none; b=rFpaWHJeO7OiHWQHUG0lLosQsBK754Buy5zwh3uP6NP46BYZxQBgUvNW/9ySg+Y6G3YaWh QK8Ca6b6LeT9iMwyv6AvfAACrG5d4jN+0Rd5d1Ef5WcG9Q9HxV+qSQcb9/wc27XVG5LBmQ UOz2D84PG8S73cz64cYNCxk1UYfeYF31iIJ49wsPam7BN5mtSAax9L5arp6EGMxJNicSMU z0bUnavatCOeAWRw7kSAi4/4hAQ+RiIHBZnQPPQNITa6E2jBz9vd6EKcjBb4rGJaxwKOQg E1yfNnp5o34CF+tSW2L0SGBmQ/LISBeNuEX9JB/p8/LOONERTlVPrt1zlHJ6kA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dGJ645tpDz4r7 for ; Tue, 25 Nov 2025 22:59:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3acc9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 25 Nov 2025 22:59:08 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Minsoo Choo From: Colin Percival Subject: git: cda51d06f946 - releng/15.0 - jemalloc: import jemalloc 5.3.0 man page List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/15.0 X-Git-Reftype: branch X-Git-Commit: cda51d06f946ceb4450e100058753812b932d802 Auto-Submitted: auto-generated Date: Tue, 25 Nov 2025 22:59:08 +0000 Message-Id: <692634bc.3acc9.69638760@gitrepo.freebsd.org> The branch releng/15.0 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=cda51d06f946ceb4450e100058753812b932d802 commit cda51d06f946ceb4450e100058753812b932d802 Author: Minsoo Choo AuthorDate: 2025-11-17 18:45:19 +0000 Commit: Colin Percival CommitDate: 2025-11-25 22:58:55 +0000 jemalloc: import jemalloc 5.3.0 man page Approved by: re (cperciva) Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1890 (cherry picked from commit bf4c7487f25d3891425a9ba54516b740a948876b) (cherry picked from commit 6162f863ce86df854305416b058ff6b17bd0261c) --- lib/libc/stdlib/malloc/jemalloc/jemalloc.3 | 232 ++++++++++++++++++++++------- 1 file changed, 180 insertions(+), 52 deletions(-) diff --git a/lib/libc/stdlib/malloc/jemalloc/jemalloc.3 b/lib/libc/stdlib/malloc/jemalloc/jemalloc.3 index a4ea3e1f54a9..6d905c815ef4 100644 --- a/lib/libc/stdlib/malloc/jemalloc/jemalloc.3 +++ b/lib/libc/stdlib/malloc/jemalloc/jemalloc.3 @@ -1,13 +1,13 @@ '\" t .\" Title: JEMALLOC .\" Author: Jason Evans -.\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/10/2019 +.\" Generator: DocBook XSL Stylesheets vsnapshot +.\" Date: 05/06/2022 .\" Manual: User Manual -.\" Source: jemalloc 5.2.1-0-gea6b3e973b477b8061e0076bb257dbd7f3faa756 +.\" Source: jemalloc 5.3.0-0-g54eaed1d8b56b1aa528be3bdd1877e59c56fa90c .\" Language: English .\" -.TH "JEMALLOC" "3" "11/10/2019" "jemalloc 5.2.1-0-gea6b3e973b47" "User Manual" +.TH "JEMALLOC" "3" "05/06/2022" "jemalloc 5.3.0-0-g54eaed1d8b56" "User Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -31,26 +31,13 @@ jemalloc \- general purpose memory allocation functions .SH "LIBRARY" .PP -This manual describes jemalloc 5\&.2\&.1\-0\-gea6b3e973b477b8061e0076bb257dbd7f3faa756\&. More information can be found at the +This manual describes jemalloc 5\&.3\&.0\-0\-g54eaed1d8b56b1aa528be3bdd1877e59c56fa90c\&. More information can be found at the \m[blue]\fBjemalloc website\fR\m[]\&\s-2\u[1]\d\s+2\&. -.PP -The following configuration options are enabled in libc\*(Aqs built\-in jemalloc: -\fB\-\-enable\-fill\fR, -\fB\-\-enable\-lazy\-lock\fR, -\fB\-\-enable\-stats\fR, -\fB\-\-enable\-utrace\fR, -\fB\-\-enable\-xmalloc\fR, and -\fB\-\-with\-malloc\-conf=abort_conf:false\fR\&. Additionally, -\fB\-\-enable\-debug\fR -is enabled in development versions of FreeBSD (controlled by the -\fBMK_MALLOC_PRODUCTION\fR -make variable)\&. .SH "SYNOPSIS" .sp .ft B .nf -#include -#include +#include .fi .ft .SS "Standard API" @@ -603,7 +590,7 @@ T} :T{ 8 KiB T}:T{ -[40 KiB, 48 KiB, 54 KiB, 64 KiB] +[40 KiB, 48 KiB, 56 KiB, 64 KiB] T} :T{ 16 KiB @@ -848,6 +835,11 @@ in these cases\&. This option is disabled by default unless is specified during configuration, in which case it is enabled by default\&. .RE .PP +opt\&.cache_oblivious (\fBbool\fR) r\- +.RS 4 +Enable / Disable cache\-oblivious large allocation alignment, for large requests with no alignment constraints\&. If this feature is disabled, all large allocations are page\-aligned as an implementation artifact, which can severely harm CPU cache utilization\&. However, the cache\-oblivious layout comes at the cost of one extra page per large allocation, which in the most extreme case increases physical memory usage for the 16 KiB size class to 20 KiB\&. This option is enabled by default\&. +.RE +.PP opt\&.metadata_thp (\fBconst char *\fR) r\- .RS 4 Controls whether to allow jemalloc to use transparent huge page (THP) for internal metadata (see @@ -859,6 +851,11 @@ uses no THP initially, but may begin to do so when metadata usage reaches certai \(lqdisabled\(rq\&. .RE .PP +opt\&.trust_madvise (\fBbool\fR) r\- +.RS 4 +If true, do not perform runtime check for MADV_DONTNEED, to check that it actually zeros pages\&. The default is disabled on Linux and enabled elsewhere\&. +.RE +.PP opt\&.retain (\fBbool\fR) r\- .RS 4 If true, retain unused virtual memory for later reuse rather than discarding it by calling @@ -990,6 +987,28 @@ is enabled\&. The default is \(lq\(rq\&. .RE .PP +opt\&.stats_interval (\fBint64_t\fR) r\- +.RS 4 +Average interval between statistics outputs, as measured in bytes of allocation activity\&. The actual interval may be sporadic because decentralized event counters are used to avoid synchronization bottlenecks\&. The output may be triggered on any thread, which then calls +malloc_stats_print()\&. +opt\&.stats_interval_opts +can be combined to specify output options\&. By default, interval\-triggered stats output is disabled (encoded as \-1)\&. +.RE +.PP +opt\&.stats_interval_opts (\fBconst char *\fR) r\- +.RS 4 +Options (the +\fIopts\fR +string) to pass to the +malloc_stats_print() +for interval based statistics printing (enabled through +opt\&.stats_interval)\&. See available options in +malloc_stats_print()\&. Has no effect unless +opt\&.stats_interval +is enabled\&. The default is +\(lq\(rq\&. +.RE +.PP opt\&.junk (\fBconst char *\fR) r\- [\fB\-\-enable\-fill\fR] .RS 4 Junk filling\&. If set to @@ -1046,13 +1065,13 @@ This option is disabled by default\&. opt\&.tcache (\fBbool\fR) r\- .RS 4 Thread\-specific caching (tcache) enabled/disabled\&. When there are multiple threads, each thread uses a tcache for objects up to a certain size\&. Thread\-specific caching allows many allocations to be satisfied without performing any thread synchronization, at the cost of increased memory use\&. See the -opt\&.lg_tcache_max +opt\&.tcache_max option for related tuning information\&. This option is enabled by default\&. .RE .PP -opt\&.lg_tcache_max (\fBsize_t\fR) r\- +opt\&.tcache_max (\fBsize_t\fR) r\- .RS 4 -Maximum size class (log base 2) to cache in the thread\-specific cache (tcache)\&. At a minimum, all small size classes are cached, and at a maximum all large size classes are cached\&. The default maximum is 32 KiB (2^15)\&. +Maximum size class to cache in the thread\-specific cache (tcache)\&. At a minimum, the first size class is cached; and at a maximum, size classes up to 8 MiB can be cached\&. The default maximum is 32 KiB (2^15)\&. As a convenience, this may also be set by specifying lg_tcache_max, which will be taken to be the base\-2 logarithm of the setting of tcache_max\&. .RE .PP opt\&.thp (\fBconst char *\fR) r\- @@ -1091,7 +1110,8 @@ for heap profile format documentation\&. opt\&.prof_prefix (\fBconst char *\fR) r\- [\fB\-\-enable\-prof\fR] .RS 4 Filename prefix for profile dumps\&. If the prefix is set to the empty string, no automatic dumps will occur; this is primarily useful for disabling the automatic final heap dump (which also disables leak reporting, if enabled)\&. The default prefix is -jeprof\&. +jeprof\&. This prefix value can be overridden by +prof\&.prefix\&. .RE .PP opt\&.prof_active (\fBbool\fR) r\- [\fB\-\-enable\-prof\fR] @@ -1129,7 +1149,9 @@ Average interval (log base 2) between memory profile dumps, as measured in bytes is controlled by the opt\&.prof_prefix -option\&. By default, interval\-triggered profile dumping is disabled (encoded as \-1)\&. +and +prof\&.prefix +options\&. By default, interval\-triggered profile dumping is disabled (encoded as \-1)\&. .RE .PP opt\&.prof_gdump (\fBbool\fR) r\- [\fB\-\-enable\-prof\fR] @@ -1147,7 +1169,9 @@ function to dump final memory usage to a file named according to the pattern is controlled by the opt\&.prof_prefix -option\&. Note that +and +prof\&.prefix +options\&. Note that atexit() may allocate memory during application initialization and then deadlock internally when jemalloc in turn calls atexit(), so this option is not universally usable (though the application can register its own @@ -1161,7 +1185,46 @@ Leak reporting enabled/disabled\&. If enabled, use an \fBatexit\fR(3) function to report memory leaks detected by allocation sampling\&. See the opt\&.prof -option for information on analyzing heap profile output\&. This option is disabled by default\&. +option for information on analyzing heap profile output\&. Works only when combined with +opt\&.prof_final, otherwise does nothing\&. This option is disabled by default\&. +.RE +.PP +opt\&.prof_leak_error (\fBbool\fR) r\- [\fB\-\-enable\-prof\fR] +.RS 4 +Similar to +opt\&.prof_leak, but makes the process exit with error code 1 if a memory leak is detected\&. This option supersedes +opt\&.prof_leak, meaning that if both are specified, this option takes precedence\&. When enabled, also enables +opt\&.prof_leak\&. Works only when combined with +opt\&.prof_final, otherwise does nothing\&. This option is disabled by default\&. +.RE +.PP +opt\&.zero_realloc (\fBconst char *\fR) r\- +.RS 4 +Determines the behavior of +realloc() +when passed a value of zero for the new size\&. +\(lqalloc\(rq +treats this as an allocation of size zero (and returns a non\-null result except in case of resource exhaustion)\&. +\(lqfree\(rq +treats this as a deallocation of the pointer, and returns +\fBNULL\fR +without setting +\fIerrno\fR\&. +\(lqabort\(rq +aborts the process if zero is passed\&. The default is +\(lqfree\(rq +on Linux and Windows, and +\(lqalloc\(rq +elsewhere\&. +.sp +There is considerable divergence of behaviors across implementations in handling this case\&. Many have the behavior of +\(lqfree\(rq\&. This can introduce security vulnerabilities, since a +\fBNULL\fR +return value indicates failure, and the continued validity of the passed\-in pointer (per POSIX and C11)\&. +\(lqalloc\(rq +is safe, but can cause leaks in programs that expect the common behavior\&. Programs intended to be portable and leak\-free cannot assume either behavior, and must therefore never call realloc with a size of 0\&. The +\(lqabort\(rq +option enables these testing this behavior\&. .RE .PP thread\&.arena (\fBunsigned\fR) rw @@ -1182,7 +1245,7 @@ Get a pointer to the the value that is returned by the thread\&.allocated mallctl\&. This is useful for avoiding the overhead of repeated mallctl*() -calls\&. +calls\&. Note that the underlying counter should not be modified by the application\&. .RE .PP thread\&.deallocated (\fBuint64_t\fR) r\- [\fB\-\-enable\-stats\fR] @@ -1196,7 +1259,23 @@ Get a pointer to the the value that is returned by the thread\&.deallocated mallctl\&. This is useful for avoiding the overhead of repeated mallctl*() -calls\&. +calls\&. Note that the underlying counter should not be modified by the application\&. +.RE +.PP +thread\&.peak\&.read (\fBuint64_t\fR) r\- [\fB\-\-enable\-stats\fR] +.RS 4 +Get an approximation of the maximum value of the difference between the number of bytes allocated and the number of bytes deallocated by the calling thread since the last call to +thread\&.peak\&.reset, or since the thread\*(Aqs creation if it has not called +thread\&.peak\&.reset\&. No guarantees are made about the quality of the approximation, but jemalloc currently endeavors to maintain accuracy to within one hundred kilobytes\&. +.RE +.PP +thread\&.peak\&.reset (\fBvoid\fR) \-\- [\fB\-\-enable\-stats\fR] +.RS 4 +Resets the counter for net bytes allocated in the calling thread to zero\&. This affects subsequent calls to +thread\&.peak\&.read, but not the values returned by +thread\&.allocated +or +thread\&.deallocated\&. .RE .PP thread\&.tcache\&.enabled (\fBbool\fR) rw @@ -1224,11 +1303,27 @@ Control whether sampling is currently active for the calling thread\&. This is a prof\&.active; both must be active for the calling thread to sample\&. This flag is enabled by default\&. .RE .PP +thread\&.idle (\fBvoid\fR) \-\- +.RS 4 +Hints to jemalloc that the calling thread will be idle for some nontrivial period of time (say, on the order of seconds), and that doing some cleanup operations may be beneficial\&. There are no guarantees as to what specific operations will be performed; currently this flushes the caller\*(Aqs tcache and may (according to some heuristic) purge its associated arena\&. +.sp +This is not intended to be a general\-purpose background activity mechanism, and threads should not wake up multiple times solely to call it\&. Rather, a thread waiting for a task should do a timed wait first, call +thread\&.idle +if no task appears in the timeout interval, and then do an untimed wait\&. For such a background activity mechanism, see +background_thread\&. +.RE +.PP tcache\&.create (\fBunsigned\fR) r\- .RS 4 Create an explicit thread\-specific cache (tcache) and return an identifier that can be passed to the \fBMALLOCX_TCACHE(\fR\fB\fItc\fR\fR\fB)\fR macro to explicitly use the specified cache rather than the automatically managed one that is used by default\&. Each explicit cache can be used by only one thread at a time; the application must assure that this constraint holds\&. +.sp +If the amount of space supplied for storing the thread\-specific cache identifier does not equal +sizeof(\fBunsigned\fR), no thread\-specific cache will be created, no data will be written to the space pointed by +\fIoldp\fR, and +\fI*oldlenp\fR +will be set to 0\&. .RE .PP tcache\&.flush (\fBunsigned\fR) \-w @@ -1634,6 +1729,12 @@ Maximum size supported by this large size class\&. arenas\&.create (\fBunsigned\fR, \fBextent_hooks_t *\fR) rw .RS 4 Explicitly create a new arena outside the range of automatically managed arenas, with optionally specified extent hooks, and return the new arena index\&. +.sp +If the amount of space supplied for storing the arena index does not equal +sizeof(\fBunsigned\fR), no arena will be created, no data will be written to the space pointed by +\fIoldp\fR, and +\fI*oldlenp\fR +will be set to 0\&. .RE .PP arenas\&.lookup (\fBunsigned\fR, \fBvoid*\fR) rw @@ -1666,7 +1767,16 @@ Dump a memory profile to the specified file, or if NULL is specified, to a file is controlled by the opt\&.prof_prefix -option\&. +and +prof\&.prefix +options\&. +.RE +.PP +prof\&.prefix (\fBconst char *\fR) \-w [\fB\-\-enable\-prof\fR] +.RS 4 +Set the filename prefix for profile dumps\&. See +opt\&.prof_prefix +for the default setting\&. This can be useful to differentiate profile dumps such as from forked processes\&. .RE .PP prof\&.gdump (\fBbool\fR) rw [\fB\-\-enable\-prof\fR] @@ -1676,7 +1786,9 @@ When enabled, trigger a memory profile dump every time the total virtual memory is controlled by the opt\&.prof_prefix -option\&. +and +prof\&.prefix +options\&. .RE .PP prof\&.reset (\fBsize_t\fR) \-w [\fB\-\-enable\-prof\fR] @@ -1752,6 +1864,18 @@ for details)\&. Retained memory is excluded from mapped memory statistics, e\&.g stats\&.mapped\&. .RE .PP +stats\&.zero_reallocs (\fBsize_t\fR) r\- [\fB\-\-enable\-stats\fR] +.RS 4 +Number of times that the +realloc() +was called with a non\-\fBNULL\fR +pointer argument and a +\fB0\fR +size argument\&. This is a fundamentally unsafe pattern in portable programs; see +opt\&.zero_realloc +for details\&. +.RE +.PP stats\&.background_thread\&.num_threads (\fBsize_t\fR) r\- [\fB\-\-enable\-stats\fR] .RS 4 Number of @@ -1825,6 +1949,26 @@ is one of the counters in mutex profiling counters\&. .RE .PP +stats\&.mutexes\&.prof_thds_data\&.{counter} (\fBcounter specific type\fR) r\- [\fB\-\-enable\-stats\fR] +.RS 4 +Statistics on +\fIprof\fR +threads data mutex (global scope; profiling related)\&. +{counter} +is one of the counters in +mutex profiling counters\&. +.RE +.PP +stats\&.mutexes\&.prof_dump\&.{counter} (\fBcounter specific type\fR) r\- [\fB\-\-enable\-stats\fR] +.RS 4 +Statistics on +\fIprof\fR +dumping mutex (global scope; profiling related)\&. +{counter} +is one of the counters in +mutex profiling counters\&. +.RE +.PP stats\&.mutexes\&.reset (\fBvoid\fR) \-\- [\fB\-\-enable\-stats\fR] .RS 4 Reset all mutex profile statistics, including global mutexes, arena mutexes and bin mutexes\&. @@ -2242,7 +2386,7 @@ heap_v2/524288 [\&.\&.\&.] @ 0x5f86da8 0x5f5a1dc [\&.\&.\&.] 0x29e4d4e 0xa200316 0xabb2988 [\&.\&.\&.] t*: 13: 6688 [0: 0] - t3: 12: 6496 [0: ] + t3: 12: 6496 [0: 0] t99: 1: 192 [0: 0] [\&.\&.\&.] @@ -2264,9 +2408,9 @@ to indicate descriptions of the corresponding fields\&. / : : [: ] [\&.\&.\&.] - : : [: ] + : : [: ] [\&.\&.\&.] - : : [: ] + : : [: ] [\&.\&.\&.] @ [\&.\&.\&.] [\&.\&.\&.] : : [: ] @@ -2432,7 +2576,8 @@ is not \fInewlen\fR is too large or too small\&. Alternatively, \fI*oldlenp\fR -is too large or too small; in this case as much data as possible are read despite the error\&. +is too large or too small; when it happens, except for a very few cases explicitly documented otherwise, as much data as possible are read despite the error, with the amount of data read being recorded in +\fI*oldlenp\fR\&. .RE .PP ENOENT @@ -2520,23 +2665,6 @@ functions conform to ISO/IEC 9899:1990 (\(lqISO C90\(rq)\&. The posix_memalign() function conforms to IEEE Std 1003\&.1\-2001 (\(lqPOSIX\&.1\(rq)\&. -.SH "HISTORY" -.PP -The -malloc_usable_size() -and -posix_memalign() -functions first appeared in FreeBSD 7\&.0\&. -.PP -The -aligned_alloc(), -malloc_stats_print(), and -mallctl*() -functions first appeared in FreeBSD 10\&.0\&. -.PP -The -*allocx() -functions first appeared in FreeBSD 11\&.0\&. .SH "AUTHOR" .PP \fBJason Evans\fR From nobody Tue Nov 25 22:59:09 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dGJ661SW0z6HxCd for ; Tue, 25 Nov 2025 22:59:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dGJ660M8Zz3fnc for ; Tue, 25 Nov 2025 22:59:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764111550; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3UMpMJojg2Esd7AypqqOhdo8E2DjCI1UwYtXICX0u/g=; b=VIYf18oc54l2QmNvIu/PA1ijshK/zjAGF7IKtsxrxWzmRKWYsGoyv6pPMqlHBR/zT7OwU5 J8L25sGDw1+DN/tpgh3xfxV8TaROnAegTk7WM1boIE2ToBkso66TSCJSOeX3lMUVDta7fS Lk+qAiTLWJI7A2a6njXFy2Rq2/MWur9UjxQvSYW8YEJOY9/OixbBtpyyPTayrx7w4F4Ld3 SCdwGYezeLPhHl2mUKsQHx2n/k8AzSefwVwie/jUAOMiBAQq+bPxU83EK4dEfwLJSREroI yXvMpFWU29S+O3hTPfVpXIdH21wj7zoN/cHz//jYNJpPmOrPSSrWkOHQfbOFjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764111550; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3UMpMJojg2Esd7AypqqOhdo8E2DjCI1UwYtXICX0u/g=; b=IJuV0wlUAKlJdXjkAh3YcMGpMwYPq54sLdsSp/0n/5x+huvQaohjV/z2vpViLEFCwnYfzm 3EIp6U8zlF38y6lYL4gojN2wYPvv1JznlvG63kuots0UndWT6HKAN2Qi5muE+rYv/6Lu0O o6ztNhf3G1UIPKcNVC49pB5RrfoTcD9Evauh3SzvzUlk4wCh3WuI6GOsIul2+by64a8CtR 8tWVl0HFWSxI/PYgvWzMSbu6gvMVjQKY+9a6gmyW18HkNICGqDGBVfj2fELNP5zgJ8eeUD /bnO5RdDyokxNN8mO6DyM7JZ7gNfQ/Sum4t3wTwlAzFQ0Kvx2tim1YFSdd8Mrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764111550; a=rsa-sha256; cv=none; b=Pdr1ks5RJqKsTq/zTZFKd7Id59Xie45ODS9s5IBW/Wmhh6NoQkeBCK0u3MfUy+KtxCcgyw rM2jdHZ43STj0c4ljb9NVnGWcB/H+iaedZlPCw0Ghyb0yerILouV0lJN0nnygcI9OA644w O8mDvYXJt/BbpqOjZOgkQE0scT/5bFqPNpPBzg6+NQfPeKj9D4swkQoYSFJDSbun2UI2ER Sdmu9fg2xqSRvqoDv9jMgiBhtKIAknemwH+VubrU9w4BWfKeZS9MtlS9tu83SGmMCVczBQ 7A4bmwhMKNCFekEPre0ilqRR+miVoEC9PCo7n7Ppxe+hfNzqQAH8Qk8dTEFBUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dGJ656jycz5SV for ; Tue, 25 Nov 2025 22:59:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 39af2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 25 Nov 2025 22:59:09 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Minsoo Choo From: Colin Percival Subject: git: 020e15a9012d - releng/15.0 - jemalloc: apply freebsd changes to jemalloc 5.3.0 man page List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/15.0 X-Git-Reftype: branch X-Git-Commit: 020e15a9012dd87b90b902305c5ee2a83be3f4f9 Auto-Submitted: auto-generated Date: Tue, 25 Nov 2025 22:59:09 +0000 Message-Id: <692634bd.39af2.be12f4f@gitrepo.freebsd.org> The branch releng/15.0 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=020e15a9012dd87b90b902305c5ee2a83be3f4f9 commit 020e15a9012dd87b90b902305c5ee2a83be3f4f9 Author: Minsoo Choo AuthorDate: 2025-11-17 18:48:15 +0000 Commit: Colin Percival CommitDate: 2025-11-25 22:58:58 +0000 jemalloc: apply freebsd changes to jemalloc 5.3.0 man page Approved by: re (cperciva) Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1890 (cherry picked from commit 80ec82aba9ae7286cac1a4f8000262cf2cf34d0c) (cherry picked from commit cbe0ccde6657be75c820efa37443d5e3c09b9993) --- lib/libc/stdlib/malloc/jemalloc/jemalloc.3 | 32 +++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/lib/libc/stdlib/malloc/jemalloc/jemalloc.3 b/lib/libc/stdlib/malloc/jemalloc/jemalloc.3 index 6d905c815ef4..1c99352a6ae2 100644 --- a/lib/libc/stdlib/malloc/jemalloc/jemalloc.3 +++ b/lib/libc/stdlib/malloc/jemalloc/jemalloc.3 @@ -33,11 +33,24 @@ jemalloc \- general purpose memory allocation functions .PP This manual describes jemalloc 5\&.3\&.0\-0\-g54eaed1d8b56b1aa528be3bdd1877e59c56fa90c\&. More information can be found at the \m[blue]\fBjemalloc website\fR\m[]\&\s-2\u[1]\d\s+2\&. +.PP +The following configuration options are enabled in libc\*(Aqs built\-in jemalloc: +\fB\-\-enable\-fill\fR, +\fB\-\-enable\-lazy\-lock\fR, +\fB\-\-enable\-stats\fR, +\fB\-\-enable\-utrace\fR, +\fB\-\-enable\-xmalloc\fR, and +\fB\-\-with\-malloc\-conf=abort_conf:false\fR\&. Additionally, +\fB\-\-enable\-debug\fR +is enabled in development versions of FreeBSD (controlled by the +\fBMK_MALLOC_PRODUCTION\fR +make variable)\&. .SH "SYNOPSIS" .sp .ft B .nf -#include +#include +#include .fi .ft .SS "Standard API" @@ -2665,6 +2678,23 @@ functions conform to ISO/IEC 9899:1990 (\(lqISO C90\(rq)\&. The posix_memalign() function conforms to IEEE Std 1003\&.1\-2001 (\(lqPOSIX\&.1\(rq)\&. +.SH "HISTORY" +.PP +The +malloc_usable_size() +and +posix_memalign() +functions first appeared in FreeBSD 7\&.0\&. +.PP +The +aligned_alloc(), +malloc_stats_print(), and +mallctl*() +functions first appeared in FreeBSD 10\&.0\&. +.PP +The +*allocx() +functions first appeared in FreeBSD 11\&.0\&. .SH "AUTHOR" .PP \fBJason Evans\fR From nobody Tue Nov 25 23:00:04 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dGJ7913hvz6Hx7g for ; Tue, 25 Nov 2025 23:00: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dGJ784d8mz3hDD for ; Tue, 25 Nov 2025 23:00:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764111604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/U7SfyC/KQDu7Woi7/ZGuLig5LnMSYRasKLNtiwjEZs=; b=jXda3PFVtUhvmvruzQDIvowhm8NJtCpAMU+NfNSq/XpfSSOr5Iz+GrlGwLVjWYbdLP3MjM 256gZrE5a5kfmSQGyUItpb+oJHByoqZp2yv0VMBTZjBgaWNECFcbykVqaQs3SBbL3MwX1+ Acm3xZCC8tDwcFNyVGjRtq5qWgzNeTXbd1MfhpdALyeh4g8L+yybPOqaeFMKScKTDO16Vf k4R2mQPF8LJKBJ7RlTco2/egtNCLHNAmovDeWkBJM6SScVzkw2QKzS1bAxNO6Zg1i+dKJb yEgJAD1sje+L7yU22YxY1odqPvPSQ3PGFDq4qvtwLbhzBeYjq1/QIrCKPDnxbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764111604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/U7SfyC/KQDu7Woi7/ZGuLig5LnMSYRasKLNtiwjEZs=; b=h3n2Nr57T2rLXeBCZkhf0fDwkKR3GjL6/7X4fPUlhbQ7uSNzQqeV4uTb8aM4Kd8ownlek0 zXV0XqBNnv4KeJuZQX+/ZkOPQlIZdpXU9fXNUtMNvxbHxFmSek5pqgOJyFDnI+m3r5Q9Od Qo8wTgvntCp63J3QWG9m953Qg2a4ojmGpz7M7+rHyCiaM3C2iTJRJkCqw7vbtiBZIRDeuR n0u5LS7RzFy8rE7+MYZgbFSPFpdv9/yGcYI/l+aRJtlmthI98LhurxTwSVxzJCK/OJyUX5 JqpfSJfCa7PlX1W5m0Jn/xwNy2ErhPMGisc7sbTKqOJnYxQ3+HubAj1D+B86Cg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764111604; a=rsa-sha256; cv=none; b=kwj8CfZK+2Kpp4P0jZwEOBjZnFozmluRFf3GGj1S1xkglHdJIW2K9QIYyb2s/zQ76quQR3 mAjJjxII9wzOOVFciMbVhpMCJKIC0pHdU+MREz1SdGX0XZgG+7Ws2RU1nMKKnKJ/9VvJNF /ICTcnmtkMO/GHC6U5KgJwV50Ts8Y3HFHCqJfCgI/3vbv9vQagcHcgw0eqpOovVInyx1Gh mmOyoCTxq+RUnMXhsC1Q1OrTEiGXUT5bVCpRdi/zSurclRH0m+L3o8eem7pIcI7PkPZIN9 cHBdi5cp2eTc0A128c4MH/yRw/mXj4ZviwB8PWUW9iPrEyKrDPQPwFtbfRoy9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dGJ784D22z5QR for ; Tue, 25 Nov 2025 23:00:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3c35f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 25 Nov 2025 23:00:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Chuck Silvers From: Warner Losh Subject: git: e271f9327f46 - stable/15 - nda: fix setting of unmappedio flag List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: e271f9327f46250c9043c29c86e943d53080bf2a Auto-Submitted: auto-generated Date: Tue, 25 Nov 2025 23:00:04 +0000 Message-Id: <692634f4.3c35f.1ea5bd89@gitrepo.freebsd.org> The branch stable/15 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e271f9327f46250c9043c29c86e943d53080bf2a commit e271f9327f46250c9043c29c86e943d53080bf2a Author: Chuck Silvers AuthorDate: 2025-11-25 22:30:19 +0000 Commit: Warner Losh CommitDate: 2025-11-25 22:59:13 +0000 nda: fix setting of unmappedio flag The upstream refactoring of ndaregister() to split out ndasetgeom() accidentally used an uninitialed variable to decide whether or not to set DISKFLAG_UNMAPPED_BIO. Fix this by moving that portion of ndasetgeom() back up to ndaregister(). The check for PIM_UNMAPPED is not really needed because nvme devices always have that set, so it cannot change in the other path that ndasetgeom() is now called. Reviewed by: imp Fixes: dffd882d12d2a71aca464f48209ec9ae6f393b15 Sponsored by: Netflix MFC After: 1 minute (cherry picked from commit 2b4dbad2db5766294ee97bb96228ec6826a9e7c3) --- sys/cam/nvme/nvme_da.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c index 2eb43809f4b1..d409961cea65 100644 --- a/sys/cam/nvme/nvme_da.c +++ b/sys/cam/nvme/nvme_da.c @@ -647,7 +647,6 @@ static void ndasetgeom(struct nda_softc *softc, struct cam_periph *periph) { struct disk *disk = softc->disk; - struct ccb_pathinq cpi; const struct nvme_namespace_data *nsd; const struct nvme_controller_data *cd; uint8_t flbas_fmt, lbads, vwc_present; @@ -666,10 +665,6 @@ ndasetgeom(struct nda_softc *softc, struct cam_periph *periph) vwc_present = NVMEV(NVME_CTRLR_DATA_VWC_PRESENT, cd->vwc); if (vwc_present) disk->d_flags |= DISKFLAG_CANFLUSHCACHE; - if ((cpi.hba_misc & PIM_UNMAPPED) != 0) { - disk->d_flags |= DISKFLAG_UNMAPPED_BIO; - softc->unmappedio = 1; - } } static void @@ -943,6 +938,10 @@ ndaregister(struct cam_periph *periph, void *arg) maxio = maxphys; /* for safety */ disk->d_maxsize = maxio; ndasetgeom(softc, periph); + if ((cpi.hba_misc & PIM_UNMAPPED) != 0) { + disk->d_flags |= DISKFLAG_UNMAPPED_BIO; + softc->unmappedio = 1; + } /* * d_ident and d_descr are both far bigger than the length of either From nobody Tue Nov 25 23:43:58 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dGK5p6GW8z6J0ks for ; Tue, 25 Nov 2025 23:43: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dGK5p5dGhz3nQ5 for ; Tue, 25 Nov 2025 23:43:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764114238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n293kHSytU07VRjuPquCr37Y5a8WxlvAIOMueIDVPoc=; b=eL0j0R9XQrLIZTKHH4/IqdLxCcXImhj4iszgrf/0zX2RRTJnwXwm3zOg8L7auGdR4y6ib+ vLfVrxXhHbIt3y+mvy3Yg6HhSVSXeo6RaXU1GsiO6V9+D8BWTMX0pn6xCtuqMQA4UygOPW EgHjfuJ75UzvBXHuLo3VN2TKcY+0AIjXqKs9a+zXkcBgwjKvMyhEUh2VUyN19i1hUBV+hZ KKIfA3S25hB8ExLdycMWdwCOx+nsqzkDh3Vx9Z88l/J43X2XXofXJZ1BZ2Sm83hxL/nZGp BHTkZoUwOxGqedY84PN8iUtqITAFwJczPfGvaGXQcInsI1fi2JP6RTC9pYJZYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764114238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n293kHSytU07VRjuPquCr37Y5a8WxlvAIOMueIDVPoc=; b=l8zDeBAUpAYtaT/+zed453UmnGnGm/10i+mFve/eBA15Cd40BFq7QFRrn+IDQtBhJqkS2n C6ksZ3ZQ0LzDW6+eN7xtlZefL7z8IVww0pw54AuVh2TolwKuJCH6M/xR+JI5sR5hYYJOVn gcRwoSl7Iy3coTwQcLEdBlJEiMbD60MScrmhYTm4Cr+eVvS9SYmjSWBE0uXKdtqMMW7UtI MLM/ShYW1XgO5739xL/t9z2Bx/oOV29D/NoYmJpmtj/yLLI8Gkyw7iOgNz8d0Pahs6FLf4 69CR1Z8M+rfxCIo/lrIVbNIjohDjMJQJZtCEa5w3tG2jQzddAWpugKhkwkcZjw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764114238; a=rsa-sha256; cv=none; b=wrPR72VNkQjYiYJ7wI7/P9m/iISJ2COYdimQnXoCw/wG6/e8Zzrb96wcLncD4TBadEy6ju 3AwkXhRCxI39UKsV0vMvRi1hMBLogc6rXuDim/X+KSPrCvtFzkz6nmjCw6iVRH6Tf9K3HM L5JtgslmCpe0c3F0Y9Z+80FYdKZBAhSGjrVR1hEQhghTzFvTayx+AeYV2YnVOmm300Jz0o GQtRWypZQ7KaGcJzM39ANWzpwMoGRcm8VwehIXH+IUsXULUGpsahZ2nSjA48pz9je34GaV meftYD8yRBPCcqjQK0xE9AF8jSPE6JibP044qvY8ht4x8K6oRr6d5mmEnBCCuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dGK5p53J3z5sZ for ; Tue, 25 Nov 2025 23:43:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3f258 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 25 Nov 2025 23:43:58 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Chuck Silvers From: Colin Percival Subject: git: 4f2d5bcdbf9b - releng/15.0 - nda: fix setting of unmappedio flag List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/15.0 X-Git-Reftype: branch X-Git-Commit: 4f2d5bcdbf9bb9ecdee48d47c1c33a461f3f54e4 Auto-Submitted: auto-generated Date: Tue, 25 Nov 2025 23:43:58 +0000 Message-Id: <69263f3e.3f258.6afefa46@gitrepo.freebsd.org> The branch releng/15.0 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=4f2d5bcdbf9bb9ecdee48d47c1c33a461f3f54e4 commit 4f2d5bcdbf9bb9ecdee48d47c1c33a461f3f54e4 Author: Chuck Silvers AuthorDate: 2025-11-25 22:30:19 +0000 Commit: Colin Percival CommitDate: 2025-11-25 23:41:38 +0000 nda: fix setting of unmappedio flag The upstream refactoring of ndaregister() to split out ndasetgeom() accidentally used an uninitialed variable to decide whether or not to set DISKFLAG_UNMAPPED_BIO. Fix this by moving that portion of ndasetgeom() back up to ndaregister(). The check for PIM_UNMAPPED is not really needed because nvme devices always have that set, so it cannot change in the other path that ndasetgeom() is now called. Approved by: re (cperciva) Reviewed by: cperciva, gallatin, imp Fixes: dffd882d12d2a71aca464f48209ec9ae6f393b15 Sponsored by: Netflix MFC After: 1 minute (cherry picked from commit 2b4dbad2db5766294ee97bb96228ec6826a9e7c3) (cherry picked from commit e271f9327f46250c9043c29c86e943d53080bf2a) --- sys/cam/nvme/nvme_da.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c index 2eb43809f4b1..d409961cea65 100644 --- a/sys/cam/nvme/nvme_da.c +++ b/sys/cam/nvme/nvme_da.c @@ -647,7 +647,6 @@ static void ndasetgeom(struct nda_softc *softc, struct cam_periph *periph) { struct disk *disk = softc->disk; - struct ccb_pathinq cpi; const struct nvme_namespace_data *nsd; const struct nvme_controller_data *cd; uint8_t flbas_fmt, lbads, vwc_present; @@ -666,10 +665,6 @@ ndasetgeom(struct nda_softc *softc, struct cam_periph *periph) vwc_present = NVMEV(NVME_CTRLR_DATA_VWC_PRESENT, cd->vwc); if (vwc_present) disk->d_flags |= DISKFLAG_CANFLUSHCACHE; - if ((cpi.hba_misc & PIM_UNMAPPED) != 0) { - disk->d_flags |= DISKFLAG_UNMAPPED_BIO; - softc->unmappedio = 1; - } } static void @@ -943,6 +938,10 @@ ndaregister(struct cam_periph *periph, void *arg) maxio = maxphys; /* for safety */ disk->d_maxsize = maxio; ndasetgeom(softc, periph); + if ((cpi.hba_misc & PIM_UNMAPPED) != 0) { + disk->d_flags |= DISKFLAG_UNMAPPED_BIO; + softc->unmappedio = 1; + } /* * d_ident and d_descr are both far bigger than the length of either From nobody Wed Nov 26 06:07:16 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dGTc4469Yz6HVxS for ; Wed, 26 Nov 2025 06:07: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dGTc43NKZz3X3h for ; Wed, 26 Nov 2025 06:07:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764137236; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hvHzl/E3L1RJhh6xagbbrsdbUD+15pF1wISguly7Wr8=; b=QdZm0ueFREqNLoWk+ZwLKiAbG7Dy/ejRHUGtG0zLqJd9DXFuKhcqPPkDeL4VQ2JmXzonPn qPIOS1w+9c2pK90UY5urpk3p/MVI/OYOVoGejU1gTSDvT1nLaMOMgiG40UJWgPxo8048vb gTlcegKL6TSJtkENzaDMS0V6JbvwpK9Vcrt1sApk0HGZQ2oqkHcuM8zlE2jZ1xt0K5KgVi zYP46+0bsqkZXQg2CM3+d4WYKlw3R970yjbRiuwH008Om5JqRWrEbKiZXWsE3ZX2jrT1ZC c9s0mlAnLNBcEZEapUr02415HSqI6IQr4sODAoxuk75jlixPktxJaIPi/0LA+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764137236; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hvHzl/E3L1RJhh6xagbbrsdbUD+15pF1wISguly7Wr8=; b=Cjx79OJ1XUrTGh1MmyEyiS18puDggahAFPY/Q0o3m6fh9XjJJkMz+kaJHx7eiy4ibTBlBg V2lLyrZ5PWDRZSW6Ps+o/WZfX1l5hBuvRej+RyvCmWDO0x3iy7ZpYU+WI/I5AoLGjHto2n AMKfZbNKiT5yc/Z2zVOsZrPY+Acl94gKl+nLeE0uygP9Oh0tT1iLkFdWqCMEeoqC5CZufm iejNEy8a5uzcw8HIqCC3ZebKFKKEm7dnNMHj4jn5ChxIhSDIwJqv6Cq6KLFDxkRYJ1Tgq4 fkx70RKJfywi2s5NXo47wTd1qvIsKcpUZjyNfn0FRd+ZARMc0Jt3PGW5qDaavw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764137236; a=rsa-sha256; cv=none; b=wA6Txx28mMxSjocWpuA7rF3M/eW9Evz9P5ghoM+ogLGiXjBuLo4oFbZXEsMgK/6kArL3t2 ul25qeOdRcni67foo+PxYK0r5yXrqxSpPeHsqWeZyOIojCuNRrek8EO+0/4HjsVJ/C/23C 4kCkAaZSxwcjt2Wi1lMhorWBpPzse8Qbyj8Q0JhHGDILMUxn1MKd+Dq45NetJ0qQlIK36P rQwaBYg0S4brTTb4pqZcMD5XHnKCSyqffjkc4bs1ULBfu5yQd6Z4XoVVxEqzJHI57Toal4 3tut1ExkrNKQr8MXE5R3lArtFnOvZcgHyXEcIx2a4SZqY6wG3YOIUfgIWM0juw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dGTc42fxmzb6r for ; Wed, 26 Nov 2025 06:07:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id f2d9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 26 Nov 2025 06:07:16 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: a48358d78e87 - stable/15 - Reapply "Merge commit e24f90190c77 from llvm git (by Brad Smith):" List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: a48358d78e87380c8498739bc4c82061e6c39a47 Auto-Submitted: auto-generated Date: Wed, 26 Nov 2025 06:07:16 +0000 Message-Id: <69269914.f2d9.5df9b8c1@gitrepo.freebsd.org> The branch stable/15 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=a48358d78e87380c8498739bc4c82061e6c39a47 commit a48358d78e87380c8498739bc4c82061e6c39a47 Author: Dimitry Andric AuthorDate: 2025-11-23 15:52:46 +0000 Commit: Dimitry Andric CommitDate: 2025-11-26 06:05:48 +0000 Reapply "Merge commit e24f90190c77 from llvm git (by Brad Smith):" [Driver] Enable outline atomics for FreeBSD/aarch64 (#156089) The compiler_rt helper functions have been built since 12.4, 13.1, 14 and anything newer. This reverts commit bd27bd1f51d049538cc7a0053be9d99110a53ae1. Only some people (including the release manager, unfortunately) ran into build issues with the previous iteration of this commit, because they were bootstrapping the compiler, either via the WITHOUT_SYSTEM_COMPILER src.conf(5) setting, or because the build system determined that their base system compiler was out of date. The bootstrapped compiler would then enable outline atomics and compile libgcc_s with these, but because libgcc_s is linked with -nodefaultlibs, it could not find the helper routines in libcompiler_rt.a. In contrast, people who did not bootstrap the compiler never saw any issues, because libgcc_s was built using their 'old' base system compiler, and so libgcc_s would not contain any calls to those helper routines. Fix this by ensuring that libgcc_s is linked against libcompiler_rt.a explicitly, similar to some other binaries and libraries that are built with -nodefaultlibs. Also, bump FREEBSD_CC_VERSION to ensure that everybody gets the updated compiler with outline atomics enabled. (This should have been done in the first iteration of this commit, because the error would have shown up right away then.) MFC after: 3 days (cherry picked from commit 3289bace53f31545976fec310b41fa784de75e64) --- contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h | 5 +++++ lib/clang/freebsd_cc_version.h | 2 +- lib/libgcc_s/Makefile | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h b/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h index 7ab63905ed4f..7d090ba682b3 100644 --- a/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h +++ b/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h @@ -78,6 +78,11 @@ public: void AddHIPIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override; + bool IsAArch64OutlineAtomicsDefault( + const llvm::opt::ArgList &Args) const override { + return true; + } + UnwindTableLevel getDefaultUnwindTableLevel(const llvm::opt::ArgList &Args) const override; bool isPIEDefault(const llvm::opt::ArgList &Args) const override; diff --git a/lib/clang/freebsd_cc_version.h b/lib/clang/freebsd_cc_version.h index 277744ae8624..e272ca160b84 100644 --- a/lib/clang/freebsd_cc_version.h +++ b/lib/clang/freebsd_cc_version.h @@ -1 +1 @@ -#define FREEBSD_CC_VERSION 1500000 +#define FREEBSD_CC_VERSION 1500001 diff --git a/lib/libgcc_s/Makefile b/lib/libgcc_s/Makefile index 992fc930ee9f..7e3911043843 100644 --- a/lib/libgcc_s/Makefile +++ b/lib/libgcc_s/Makefile @@ -11,7 +11,9 @@ MK_SSP= no WARNS?= 2 LDFLAGS+= -nodefaultlibs +LDFLAGS+= -Wl,-Bsymbolic LIBADD+= c +LIBADD+= compiler_rt VERSION_DEF= ${.CURDIR}/Versions.def SYMBOL_MAPS= ${.CURDIR}/Symbol.map From nobody Wed Nov 26 06:07:41 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dGTcZ1C3Dz6HWDJ for ; Wed, 26 Nov 2025 06: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dGTcZ0ZBBz3XXx for ; Wed, 26 Nov 2025 06: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=1764137262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=btQFN4Ioywax9fc7w2hPwXX57rbqwhBnQOKHg62KXi4=; b=PjmMeus795oLx34/AOJ8giZmuzyws+Ihu+WxujQyCA14ccO9Hby0qBDRyZv3iu661YidyQ +7NJY5KIHXvZRu/z4FVDfT243cAWl0W7M4YjcvTqNuQATjnFffgH4Bd4SAAgSBkvpVcbf3 5kWgldA3C2T6QrcsfiML71uaPerfrac7RoFwV9atB0tFb3Iw31TyhuVrW/a6rT9iHJct8E mxncqXlsWowAO7G1zoARk1XxQwpOmBmZ0pOKIwyNWiDBudzuMdhldqGSqEarPp4C113Tup +tmc0l7Alvh3SnUFLttRPMfS/b6UCoCoAI5t8agtWCuaLe+bE5hnelvic96bKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764137262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=btQFN4Ioywax9fc7w2hPwXX57rbqwhBnQOKHg62KXi4=; b=bhdU3o5CMON7oUwJ2cE6Of4wv391Z2G15aC9DnCCgFhqTL3Ml6taF/6n5A10OEoxiPdD/5 ioWosu6bw9jEn4yJEL+GpuKoWcPDleWvtWUTfq62oGxJ3k0gEBwfJjmoMdqaXZHKzoK/qE dqvFzUcoRWc9TErmwDw6YmdN5q4owbfi2dCO/IXpTI/D92DHVUwmBFH/a+Ufbew9bwK0fM lXB12n8lWyfrJfhr8WdY9zbBAqvtLIF3Rjl/JqeEW2tDvwUsrN8lc9i6AIKPEkyh+1AIl+ ch3uAEdPQejA0zhxbFbnHhGACeLjJUCJF9zhVLZ7NqTH+lUCRmEShYzSHjYQxw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764137262; a=rsa-sha256; cv=none; b=ytNubvJAxcAWQu0/4WQW6H6O87y/gftN+mVUGvFOWm4gLSPqxFs/yBWONMPH7iE0QWYVrs z9/Ezisc3l3d2fVGIWalcF5UZVhwl2VL6pgBFDLH7Y98a9WtC+L1//x6sl7wWXTyHq3Dtj gQRKCS/91JKrJM8rF1GiJkqvCEzFMuTSSsJP5l4u+tmuT6+dvkVAWGlYRFPYagwcH7oc/F sjLmWMIkuD3kCQlnZGwkXvSoOLqUo6JdYnBjrXbWc0PIeMiYhx5S4q7OEwNQWObOEvrpO4 hmug/D+VSlRZZi0qRI/Ffm2eE4Qy/E5q2VoRfxXqQtPPoffJQjGKtyo+BhpMww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dGTcZ07BnzZjm for ; Wed, 26 Nov 2025 06:07:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id f4f5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 26 Nov 2025 06:07:41 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: e4e5e7da092e - stable/14 - Reapply "Merge commit e24f90190c77 from llvm git (by Brad Smith):" List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e4e5e7da092eef1f0e1af70dd596a4ab9b75cb7a Auto-Submitted: auto-generated Date: Wed, 26 Nov 2025 06:07:41 +0000 Message-Id: <6926992d.f4f5.5872eeb7@gitrepo.freebsd.org> The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=e4e5e7da092eef1f0e1af70dd596a4ab9b75cb7a commit e4e5e7da092eef1f0e1af70dd596a4ab9b75cb7a Author: Dimitry Andric AuthorDate: 2025-11-23 15:52:46 +0000 Commit: Dimitry Andric CommitDate: 2025-11-26 06:06:19 +0000 Reapply "Merge commit e24f90190c77 from llvm git (by Brad Smith):" [Driver] Enable outline atomics for FreeBSD/aarch64 (#156089) The compiler_rt helper functions have been built since 12.4, 13.1, 14 and anything newer. This reverts commit bd27bd1f51d049538cc7a0053be9d99110a53ae1. Only some people (including the release manager, unfortunately) ran into build issues with the previous iteration of this commit, because they were bootstrapping the compiler, either via the WITHOUT_SYSTEM_COMPILER src.conf(5) setting, or because the build system determined that their base system compiler was out of date. The bootstrapped compiler would then enable outline atomics and compile libgcc_s with these, but because libgcc_s is linked with -nodefaultlibs, it could not find the helper routines in libcompiler_rt.a. In contrast, people who did not bootstrap the compiler never saw any issues, because libgcc_s was built using their 'old' base system compiler, and so libgcc_s would not contain any calls to those helper routines. Fix this by ensuring that libgcc_s is linked against libcompiler_rt.a explicitly, similar to some other binaries and libraries that are built with -nodefaultlibs. Also, bump FREEBSD_CC_VERSION to ensure that everybody gets the updated compiler with outline atomics enabled. (This should have been done in the first iteration of this commit, because the error would have shown up right away then.) MFC after: 3 days (cherry picked from commit 3289bace53f31545976fec310b41fa784de75e64) --- contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h | 5 +++++ lib/clang/freebsd_cc_version.h | 2 +- lib/libgcc_s/Makefile | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h b/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h index 7ab63905ed4f..7d090ba682b3 100644 --- a/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h +++ b/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h @@ -78,6 +78,11 @@ public: void AddHIPIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override; + bool IsAArch64OutlineAtomicsDefault( + const llvm::opt::ArgList &Args) const override { + return true; + } + UnwindTableLevel getDefaultUnwindTableLevel(const llvm::opt::ArgList &Args) const override; bool isPIEDefault(const llvm::opt::ArgList &Args) const override; diff --git a/lib/clang/freebsd_cc_version.h b/lib/clang/freebsd_cc_version.h index e9737b10d337..a01612cc323f 100644 --- a/lib/clang/freebsd_cc_version.h +++ b/lib/clang/freebsd_cc_version.h @@ -1 +1 @@ -#define FREEBSD_CC_VERSION 1400006 +#define FREEBSD_CC_VERSION 1400007 diff --git a/lib/libgcc_s/Makefile b/lib/libgcc_s/Makefile index fdf5a67d8045..d0b9a799af1f 100644 --- a/lib/libgcc_s/Makefile +++ b/lib/libgcc_s/Makefile @@ -12,7 +12,9 @@ MK_SSP= no WARNS?= 2 LDFLAGS+= -nodefaultlibs +LDFLAGS+= -Wl,-Bsymbolic LIBADD+= c +LIBADD+= compiler_rt VERSION_DEF= ${.CURDIR}/Versions.def SYMBOL_MAPS= ${.CURDIR}/Symbol.map From nobody Wed Nov 26 06:08:09 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dGTd51Kmrz6HWDY for ; Wed, 26 Nov 2025 06:08: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dGTd50bvWz3Xp7 for ; Wed, 26 Nov 2025 06:08:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764137289; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=htCEq8PIfRsoxJHxCsHXFPiOM9nd7f80EnucGstShOk=; b=iNpufKFWIp8zlYENTEXLcHZnQ90Li7VD8yuAMQsHAkaLNXeO/Zo8/iQYbNJE1CigZvnKNk S6obrXzRcZvKHsUaSGqowQA5zPa0uTlYdckFMTarnLVP58NGIC77rxfWPSQx+JsOHbgnrE itGBl3zC8ECqMxKki1DhUW1zy8pIQsbeDBTaCqzHjjjUAJMIxguaek4z+/zhtg6YfMPUaf TeDBco8mQHqBYOltOSI29+rZR+xVyvOYVQkCn5nGijKUprf9LmiBmfDq8DxbMUUNJpLdrJ bng1PnxhWUbyxdzo0tmsoSz8enNPSGdqbjWz8yd5b1kVjmGHVbaVR0KKi+tTNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764137289; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=htCEq8PIfRsoxJHxCsHXFPiOM9nd7f80EnucGstShOk=; b=ekZJqJkxbomruYgCOXM6TdRxhjHsqzhU6bZLAEhAxMeF6zsFkvBmd7M+IZDWLMvlghUgLd tGQU+6d2iEWwYS8MLn6jddO7tjZllhZVll/002gmAbbqpj7nVJb9xjlGv7LPQoUoz/M5se bzbLdzaOYJZlD7IUtnpT5ae/Blj8Y+whGUWglUXk1O5dnovjH2YP6QfVEw/MGOTfmpsnZx U+p5fxUEA9Cw21SPoqsAEfRo1Zf+hqJGQskJT/zGdDMDnfAgcmuEGecNvTXmDoAlsq6Ms5 apNRamGDyF66h8JZBUMqtr67VUEZQiwX/t/vaoqmXj7HVsxrK56L6k1tCzl6fw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764137289; a=rsa-sha256; cv=none; b=CTC7qPZ30tWCU/AUgh9tBWFovMv/C1yiNU7LHLMNjPEishiNiFVBAfSiQ6JirhZmWXe4Pj 3BHSreSkxCIioxshk7a0ubXzx7bs5wJuZNkNFXLhV2eb/BQxnPcSXEH11afSdM8mK3PfR9 wejuXc93hjCyL8iTFpoYx9IHVfRp06ZIQTFhFAnwxWsjCUJH42FCcS7ox9N84fFI/EFbIp ZPwz15ycqdnYpfl6WDOsHbPyP7s93zant9DCaEutl0HPfP/6wuwX8am0P6pFlv4q42JcIw Hdy2YqlOt1idfb2Ias/f1jOJ0hfr4yUaL1OmmF59nh5fKj4MTbA0GRWC2uP12g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dGTd505s5zb6w for ; Wed, 26 Nov 2025 06:08:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id f4f9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 26 Nov 2025 06:08:09 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: e0c79f13d755 - stable/13 - Reapply "Merge commit e24f90190c77 from llvm git (by Brad Smith):" List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e0c79f13d755c480ff6c3ca1f5c78ed1c04db400 Auto-Submitted: auto-generated Date: Wed, 26 Nov 2025 06:08:09 +0000 Message-Id: <69269949.f4f9.7140792c@gitrepo.freebsd.org> The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=e0c79f13d755c480ff6c3ca1f5c78ed1c04db400 commit e0c79f13d755c480ff6c3ca1f5c78ed1c04db400 Author: Dimitry Andric AuthorDate: 2025-11-23 15:52:46 +0000 Commit: Dimitry Andric CommitDate: 2025-11-26 06:06:40 +0000 Reapply "Merge commit e24f90190c77 from llvm git (by Brad Smith):" [Driver] Enable outline atomics for FreeBSD/aarch64 (#156089) The compiler_rt helper functions have been built since 12.4, 13.1, 14 and anything newer. This reverts commit bd27bd1f51d049538cc7a0053be9d99110a53ae1. Only some people (including the release manager, unfortunately) ran into build issues with the previous iteration of this commit, because they were bootstrapping the compiler, either via the WITHOUT_SYSTEM_COMPILER src.conf(5) setting, or because the build system determined that their base system compiler was out of date. The bootstrapped compiler would then enable outline atomics and compile libgcc_s with these, but because libgcc_s is linked with -nodefaultlibs, it could not find the helper routines in libcompiler_rt.a. In contrast, people who did not bootstrap the compiler never saw any issues, because libgcc_s was built using their 'old' base system compiler, and so libgcc_s would not contain any calls to those helper routines. Fix this by ensuring that libgcc_s is linked against libcompiler_rt.a explicitly, similar to some other binaries and libraries that are built with -nodefaultlibs. Also, bump FREEBSD_CC_VERSION to ensure that everybody gets the updated compiler with outline atomics enabled. (This should have been done in the first iteration of this commit, because the error would have shown up right away then.) MFC after: 3 days (cherry picked from commit 3289bace53f31545976fec310b41fa784de75e64) --- contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h | 5 +++++ lib/clang/freebsd_cc_version.h | 2 +- lib/libgcc_s/Makefile | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h b/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h index 7ab63905ed4f..7d090ba682b3 100644 --- a/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h +++ b/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h @@ -78,6 +78,11 @@ public: void AddHIPIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override; + bool IsAArch64OutlineAtomicsDefault( + const llvm::opt::ArgList &Args) const override { + return true; + } + UnwindTableLevel getDefaultUnwindTableLevel(const llvm::opt::ArgList &Args) const override; bool isPIEDefault(const llvm::opt::ArgList &Args) const override; diff --git a/lib/clang/freebsd_cc_version.h b/lib/clang/freebsd_cc_version.h index 758b8295d012..33f11e855524 100644 --- a/lib/clang/freebsd_cc_version.h +++ b/lib/clang/freebsd_cc_version.h @@ -1 +1 @@ -#define FREEBSD_CC_VERSION 1300013 +#define FREEBSD_CC_VERSION 1300014 diff --git a/lib/libgcc_s/Makefile b/lib/libgcc_s/Makefile index 62c69cec4901..ecd9c4511247 100644 --- a/lib/libgcc_s/Makefile +++ b/lib/libgcc_s/Makefile @@ -9,7 +9,9 @@ MK_SSP= no WARNS?= 2 LDFLAGS+= -nodefaultlibs +LDFLAGS+= -Wl,-Bsymbolic LIBADD+= c +LIBADD+= compiler_rt VERSION_DEF= ${.CURDIR}/Versions.def SYMBOL_MAPS= ${.CURDIR}/Symbol.map From nobody Wed Nov 26 15:35:16 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dGkCS5tq9z6JDGL for ; Wed, 26 Nov 2025 15:35: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dGkCS2zYnz3QKK for ; Wed, 26 Nov 2025 15:35:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764171316; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z3kdVt5bgzhfAQwTOn+xHHBHCkEhv5Hg19qPSEazz5k=; b=tw9CM21oW3DYJOQFWdMnjGUohmsoSwWj+akTs1iGfr+Eze4Czz0XGo/MluyLrK7GYGOejO i0qV+9kdl55UASLv9ihVmevZHBdnRLOMZzP9Mi38fKHsnFj2C0KiGC1coTmhKYs/ESjRX+ +3hsrc8deAAi74XGti4yhqWPw920IzL4GG69abcoUNceLHgSsyAzD/i/RQxHthFSa5KRyb i7dzuLmlyIx578dq4Vm5tXocYbEZZ3eO6CKtAJAMUZ3VVH53ZvGCSklybko60SnA1AmlKD dXG9FaxsS2NFyKEvjBl9Twxi1AmTMdVXHytPAriUdVWrfYvGfOuQRhfBH5ZkqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764171316; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z3kdVt5bgzhfAQwTOn+xHHBHCkEhv5Hg19qPSEazz5k=; b=aMT3bTocizUa/GF/gW4VcUaSNol4t4Ba0/JIMnTqwAsa5J3zGnHMqvyhmJSkvemSy0O0up ZXGQoLwyzMOJ+V/2rzHjomdYUAWvYz7xYxtFNrThQ290pJrVB5H1T8cHYVfz+ao58Wx4mR QVQbQqE06937eJFxnRIZoGf+lpa/sSfkFXXzelji10gUR9Bgx+nNVYK21viEN0CsifPcGm YLqs4aiDwHG0PFjHo+s7iZWrvl+uiRgFl5yDRrKzk0zpIvVdcEDMIskIcdYltXNjCxoiCf 71YE16hj6R3LPIPafx2ilJ7xzdwouCUNTX5RpspqjxXrZfYPq6n3vT/YcLThQA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764171316; a=rsa-sha256; cv=none; b=MpyzsYNmOgBlv9oY6cVGa6S2t4nekPH3gyMQwmhu3bnT9AVwJpo9FhFG+0cMUSOIF1BHi7 Wb4qaFc/4k2N0a0PjfLf69xboLMJwQNDk4DHeiLhiiqhKANJqwyHKfSHR0a7gFpknOdHg6 36a/gxiLquVdgAfe6nWlrNjXFNNFuM3M0GNVzdGhxYWCfDSSUEsGEcIRVz2g7j4Wue9UGF dnl4oE2v2WvxEcBVeptg3fjT01w2H7vuGOYV8OpFPPaoIrDx2OZvRKLtd3TVrpZSkoCUsS vabWHeL8WGcJ7UQxnWhqzRLLcRQrBKycvUvlTEywsvgmIFAsmPDkzg8q2vgiuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dGkCS1t9xzsTL for ; Wed, 26 Nov 2025 15:35:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 313ef by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 26 Nov 2025 15:35:16 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 5f2dd3dfd72d - stable/15 - local-unbound: Read a tab separated resolv.conf List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 5f2dd3dfd72da7b49d1f9a7f889437480aa6f19e Auto-Submitted: auto-generated Date: Wed, 26 Nov 2025 15:35:16 +0000 Message-Id: <69271e34.313ef.24dc7042@gitrepo.freebsd.org> The branch stable/15 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=5f2dd3dfd72da7b49d1f9a7f889437480aa6f19e commit 5f2dd3dfd72da7b49d1f9a7f889437480aa6f19e Author: Jose Luis Duran AuthorDate: 2025-11-19 01:09:58 +0000 Commit: Jose Luis Duran CommitDate: 2025-11-26 15:33:29 +0000 local-unbound: Read a tab separated resolv.conf Use [[:space:]] rather than a white space character to delimit the keys and the values in the resolv.conf file. PR: 236079 Reviewed by: des MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D53811 (cherry picked from commit 0628400590e025b7db1c0905e6ee488a24ef3f60) --- usr.sbin/unbound/setup/local-unbound-setup.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.sbin/unbound/setup/local-unbound-setup.sh b/usr.sbin/unbound/setup/local-unbound-setup.sh index 25cfef48b6f0..ec3aeb673ecc 100755 --- a/usr.sbin/unbound/setup/local-unbound-setup.sh +++ b/usr.sbin/unbound/setup/local-unbound-setup.sh @@ -118,8 +118,8 @@ set_chrootdir() { get_nameservers() { while read line ; do local bareline=${line%%\#*} - local key=${bareline%% *} - local value=${bareline#* } + local key=${bareline%%[[:space:]]*} + local value=${bareline#*[[:space:]]} case ${key} in nameserver) case ${value} in @@ -145,8 +145,8 @@ gen_resolv_conf() { local edns0=no while read line ; do local bareline=${line%%\#*} - local key=${bareline%% *} - local value=${bareline#* } + local key=${bareline%%[[:space:]]*} + local value=${bareline#*[[:space:]]} case ${key} in nameserver) case ${value} in From nobody Wed Nov 26 15:35:32 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dGkCn09yhz6JDHn for ; Wed, 26 Nov 2025 15:35: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dGkCm6bj5z3R27 for ; Wed, 26 Nov 2025 15:35:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764171332; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Cv/f7bFR+SBaSlr6xJl16C3cLddrViDZO+2dibKFrio=; b=RW+3QsD/eHwaFzBIySUiRnI1jn6Nl9+mE2yjYk3LwuZKs8PSHoLCJgJFMo1HB/QJQjiwnM VZCG6D5es9jx4TgXF3seM+3IO0/QyklQ3Rvj6vULymvy1xnvKUuBbMmd0uTtgXgbe9s7uW nDcXDQ3O0jeoF8T5q+DJQODy9QSlqaoMyY94xFx1OT3mCUcoV41RlSuSYuPehyPuaq6qVe YFLjtkzVnQWrKkhFi4kPu2qmm2OET3gDnspgbCEp/lZ4pViAHE5FcLumkXVM6MNxJzCKLu zzSJzd0hZEkCHxXidW7/5dqkP97o/UIMbIDehTmVvO/JzKUKpeR+M7APboip/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764171332; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Cv/f7bFR+SBaSlr6xJl16C3cLddrViDZO+2dibKFrio=; b=DiGYE8k97NIrAKovOcXULZL4kv1crDRXneBhkDWFac37fV4jAStkIB7d5uiaCI91gZAvIG qRrknPBnF3EV+YENuHZ22+PF/ymM3UvGz8JQXACk1xGM0JbFZeJkXM3hFGjIBLqKSGfQDI fehIKv11wALqZseXyJQhEIyu2U3+PplviB9RWyrcTYQ1gQ00EvuQbFqtiSRGpQ53I5UmgM YiEWlJlvSnxtGdjFIt2UmOvN7INH4+jcJxUnzl383dNcj38YnjN9n4kov7rUH5tw6dzjwC qgToqN7WWxMVJeRSr2/dchL/xOEZILHMZqArA8YmDAlN5Lsh7EIyABpBLv+AMQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764171332; a=rsa-sha256; cv=none; b=NRcZK1FbSHj5/bCEgcsUrn9GEKYBUF0iFqEHx04CORQNVOyg3c3OvRSRsPu8KNK0pQ6ajy ZOr2DELBhSD0UQgaUEQTU6FerqLKyG8Mquum+pIkxOcwINqDZoYtZ5MXfrIm0cORAbhlH/ t4GJiArvSJw899PvE+qmMeJ1Uj28wD8o42Ff0LCSbbTKCk8CCqZulq2JsSMLv+Jtm32SKn R+Jb6avGzYUDweboHUOe9Zw5+jMcGLv/68AI5/OJGFjs4iLTHRWfvW0l8fwKMdEWo35U75 0r8Xyn7LALhxEwgHLWJg9rV2EVke2KNTDcI2VehVc383DLhNWhpzu0KwKPtdCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dGkCm5zTwzt0r for ; Wed, 26 Nov 2025 15:35:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 313f3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 26 Nov 2025 15:35:32 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 5a2f81012ab5 - stable/14 - local-unbound: Read a tab separated resolv.conf List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5a2f81012ab56436813a6c86fb578cc3a686f078 Auto-Submitted: auto-generated Date: Wed, 26 Nov 2025 15:35:32 +0000 Message-Id: <69271e44.313f3.642e1db8@gitrepo.freebsd.org> The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=5a2f81012ab56436813a6c86fb578cc3a686f078 commit 5a2f81012ab56436813a6c86fb578cc3a686f078 Author: Jose Luis Duran AuthorDate: 2025-11-19 01:09:58 +0000 Commit: Jose Luis Duran CommitDate: 2025-11-26 15:34:40 +0000 local-unbound: Read a tab separated resolv.conf Use [[:space:]] rather than a white space character to delimit the keys and the values in the resolv.conf file. PR: 236079 Reviewed by: des MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D53811 (cherry picked from commit 0628400590e025b7db1c0905e6ee488a24ef3f60) --- usr.sbin/unbound/setup/local-unbound-setup.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.sbin/unbound/setup/local-unbound-setup.sh b/usr.sbin/unbound/setup/local-unbound-setup.sh index 90e255204135..c15ce96e1cfe 100755 --- a/usr.sbin/unbound/setup/local-unbound-setup.sh +++ b/usr.sbin/unbound/setup/local-unbound-setup.sh @@ -118,8 +118,8 @@ set_chrootdir() { get_nameservers() { while read line ; do local bareline=${line%%\#*} - local key=${bareline%% *} - local value=${bareline#* } + local key=${bareline%%[[:space:]]*} + local value=${bareline#*[[:space:]]} case ${key} in nameserver) case ${value} in @@ -145,8 +145,8 @@ gen_resolv_conf() { local edns0=no while read line ; do local bareline=${line%%\#*} - local key=${bareline%% *} - local value=${bareline#* } + local key=${bareline%%[[:space:]]*} + local value=${bareline#*[[:space:]]} case ${key} in nameserver) case ${value} in From nobody Wed Nov 26 15:35:50 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dGkD70Xy0z6JDGY for ; Wed, 26 Nov 2025 15:35: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dGkD65TLJz3RHL for ; Wed, 26 Nov 2025 15:35:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764171350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ym1A1eEnWogAO+E6YVlcLyRa8rCvqbtBzbj9QsjLkOg=; b=pYlzdNuqm4jhkLRn980/1oSZmGegCQMIC8OJdRFYRuxTpzHX7uUTOtPY85SORNisH0z4G0 9s+eJzVHgKaiT0ysWYaMIwXwqG7xUP48A7ZHhi8cW0THbjWGAV8+yRxdLZowws52LSUkau /z7D4/6gS540jyvX2+KNU1223cXo/Px8RxN6SomtFCbSYqQao+t/oC36jErnUmKp9RkcQo HyJviYx8hpT6rs70dGplKpoL2OzK1iIr0+1ga92t+AclFnYIkR45b/XZhmX58di87T8skl xRlfPqbXQze9N9Uug+MwjvtQ5RH64Km0nI9U2+yRx17oQp1UHlwttqIoguz0Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764171350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ym1A1eEnWogAO+E6YVlcLyRa8rCvqbtBzbj9QsjLkOg=; b=ZtnUX8bv2Zk+HAA49+XwMvC6LmliqpvkbNRRB0U5kAQOw09vYvfJyS/hgQSWNvxphFxUHe mLxkQnKcgaO8MrbNLyS+/Zpv8Jda0jE0uG25KSbUzR2a/gIXoDwcxO/wD1R2D3dSAY1wcu sK0YUN0ivuKSojzVyf42NvFHAT7V56l1h9oHJk/NALgmZRYSK2CXEOkkL9/Rxp5fHajFtN fzlBlIEsRGdvebWAHDOgT9qvG2sT+JRwNEkqFIdZ3XA6fFUlaQDTI/80vdIl7OV067f7vJ wxJph3KSrPVFPdDuSyY1CkGaIKLwI0jTqJP55//t4Pp0UuEe5yOckkrRoVO3SQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764171350; a=rsa-sha256; cv=none; b=vU7skDkn60kkhflK89bkllI4uB2NjDT6S3hUj1xDscS6caHXh/6eg7zqi8Yvr5jkHXqzGn vNMVRCRSHhN/7v3Qg7U8TuCLxD2dXRoDJgNwSTudw/fG7bl0saBfHF0yfdpU6ZuLulcCwP +0EduK0G6naP9mQeDXGWDAZJIyRJdbkhqGpM51u6kgNo2BJL9ZZgwr+KOUkgkY+5BisvOK E6wYQ+9JfovgIhtqHMWs5x4lQEeftZU+3i146+gd7remCjWjpvTCi460MRvNEDFh+U1GOL HVL3ZLO79sxMlKmdI6oUMLm4mWx7W82o64aGbVI5PXFiJuehNS3WuJoS8tFYwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dGkD64zYqzsTS for ; Wed, 26 Nov 2025 15:35:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 30f4e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 26 Nov 2025 15:35:50 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 111b60a2fddc - stable/13 - local-unbound: Read a tab separated resolv.conf List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 111b60a2fddca6051c6e782c4a9a4da258ed4cdf Auto-Submitted: auto-generated Date: Wed, 26 Nov 2025 15:35:50 +0000 Message-Id: <69271e56.30f4e.1ccf8b3b@gitrepo.freebsd.org> The branch stable/13 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=111b60a2fddca6051c6e782c4a9a4da258ed4cdf commit 111b60a2fddca6051c6e782c4a9a4da258ed4cdf Author: Jose Luis Duran AuthorDate: 2025-11-19 01:09:58 +0000 Commit: Jose Luis Duran CommitDate: 2025-11-26 15:34:23 +0000 local-unbound: Read a tab separated resolv.conf Use [[:space:]] rather than a white space character to delimit the keys and the values in the resolv.conf file. PR: 236079 Reviewed by: des MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D53811 (cherry picked from commit 0628400590e025b7db1c0905e6ee488a24ef3f60) --- usr.sbin/unbound/setup/local-unbound-setup.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.sbin/unbound/setup/local-unbound-setup.sh b/usr.sbin/unbound/setup/local-unbound-setup.sh index 90e255204135..c15ce96e1cfe 100755 --- a/usr.sbin/unbound/setup/local-unbound-setup.sh +++ b/usr.sbin/unbound/setup/local-unbound-setup.sh @@ -118,8 +118,8 @@ set_chrootdir() { get_nameservers() { while read line ; do local bareline=${line%%\#*} - local key=${bareline%% *} - local value=${bareline#* } + local key=${bareline%%[[:space:]]*} + local value=${bareline#*[[:space:]]} case ${key} in nameserver) case ${value} in @@ -145,8 +145,8 @@ gen_resolv_conf() { local edns0=no while read line ; do local bareline=${line%%\#*} - local key=${bareline%% *} - local value=${bareline#* } + local key=${bareline%%[[:space:]]*} + local value=${bareline#*[[:space:]]} case ${key} in nameserver) case ${value} in From nobody Wed Nov 26 16:00:04 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dGkm42qshz6JFs1 for ; Wed, 26 Nov 2025 16:00:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dGkm41X3Tz3Vf6 for ; Wed, 26 Nov 2025 16:00:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764172804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hp4Nyv2fvh4Ss1O0LkTiDpEpxkHd0eGFBna7hNZhc3o=; b=Z0jD1Yrk1SP33zNF+HgTPMZiCdlfoNq6KgqFntXbcw7Lf+nO7UXx/xKTGaiNLvFb/yZ3lK nwJuxKvIBLk08K7WclhaP/1JzCrglhL74p+I1XuQBY53O15VjEBu3ZTCfU+Vlm2kCj3bC4 0plIJk4EiVkKe0JO+jjXNlGnK9CkBlTxASfi7CH0fhE5HIWjwVVhQkP7Qi6uUeoe/Pw6ad 9/J1xXos76fFfsCNmijrC/gck8rruMzowvVPPIq1IbGBrAdfExFBUtufSRmcBQGkR9ZLK7 I+haKlbcj0A7c5TjAUbIk1Cdc+wr80WNjW09mcwJekm1V/YXbHVP6p/snAXziQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764172804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hp4Nyv2fvh4Ss1O0LkTiDpEpxkHd0eGFBna7hNZhc3o=; b=cSnB3NVIWzrUcpdTwdevjZtNOXYFcKK2aC2Kh8ug0oWO9TH/nK4vtK5RYWUFXMkWaiAzdv UPNYs4x/g4v/rp9FDIQ2K6eaxeKHrLKNSbbM21DGrRSn9y2NBg56sXTU34LvP8gyLD2MLA NJ1RGPt+Ik8WOqmXjkosKEHnrfz53RovXH6otUqgZMxM6REGLNF46Mogce8JArCaC4HduF PIEBWbfFBvMt5PLRyniN0n7ud82oElkv3TXO49PGG/Af62K9JMK9RvIPbe/K0wCKQhjZGs 0QUiFTahdrd2+7sMhE70udpBl+l2eepjkyiAIkFqNjJJa3sYZ7tP7TqBKWSg/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764172804; a=rsa-sha256; cv=none; b=ND3QOsGl2xPUXOyezAawLPWvxKGPHoybPvDXGc7YsZfK01Ujmbt/Oxu2MggmdddY9xyIXK nNCpm6OtO2nKmWbaSb++5QYy6q2v4C5J1hK6U9i464G9A4e/LNQQvTtVi3rMd6GmZtnUO6 Ri+ppyI+B/u3uAv5ma0kj01zYmzA5QvJ1wDYBaQ5hstaWCmmk6mVXCEEqglMxICUc23+hL G6zwiJ1SByYZwXG2uW6pwhyOlFfM1Q51GKXLfdHD7g4h8NgIMB6SSOzEB7MlDE8eOCa9qL Lv497LFnWS0Vnqi6Hfh/eufarkLdsQJj2bga5sQkBt96oFpx40iPOm25HVBCHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dGkm413SjztH6 for ; Wed, 26 Nov 2025 16:00:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 33c49 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 26 Nov 2025 16:00:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: b01f35a4e19d - stable/15 - Mitigate YXDOMAIN and nodata non-referral answer poisoning. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: b01f35a4e19d8e204daa37c378344772e339247b Auto-Submitted: auto-generated Date: Wed, 26 Nov 2025 16:00:04 +0000 Message-Id: <69272404.33c49.53104836@gitrepo.freebsd.org> The branch stable/15 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=b01f35a4e19d8e204daa37c378344772e339247b commit b01f35a4e19d8e204daa37c378344772e339247b Author: Gordon Tetlow AuthorDate: 2025-11-21 21:24:58 +0000 Commit: Gordon Tetlow CommitDate: 2025-11-26 15:59:35 +0000 Mitigate YXDOMAIN and nodata non-referral answer poisoning. Add a fix to apply scrubbing of unsolicited NS RRSets (and their respective address records) for YXDOMAIN and nodata non-referral answers. This prevents a malicious actor from exploiting a possible cache poison attack. Obtained from: NLnet Labs Security: FreeBSD-SA-25:10.unbound Security: CVE-2025-11411 (cherry picked from commit 2a3a6a1771148a709c2d9694c1d66c41ce8dee79) --- contrib/unbound/iterator/iter_scrub.c | 39 +++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/contrib/unbound/iterator/iter_scrub.c b/contrib/unbound/iterator/iter_scrub.c index 553d3655f0e3..8507a3fb65ac 100644 --- a/contrib/unbound/iterator/iter_scrub.c +++ b/contrib/unbound/iterator/iter_scrub.c @@ -418,12 +418,13 @@ shorten_rrset(sldns_buffer* pkt, struct rrset_parse* rrset, int count) * @param qinfo: original query. * @param region: where to allocate synthesized CNAMEs. * @param env: module env with config options. + * @param zonename: name of server zone. * @return 0 on error. */ static int scrub_normalize(sldns_buffer* pkt, struct msg_parse* msg, struct query_info* qinfo, struct regional* region, - struct module_env* env) + struct module_env* env, uint8_t* zonename) { uint8_t* sname = qinfo->qname; size_t snamelen = qinfo->qname_len; @@ -431,7 +432,8 @@ scrub_normalize(sldns_buffer* pkt, struct msg_parse* msg, int cname_length = 0; /* number of CNAMEs, or DNAMEs */ if(FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_NOERROR && - FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_NXDOMAIN) + FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_NXDOMAIN && + FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_YXDOMAIN) return 1; /* For the ANSWER section, remove all "irrelevant" records and add @@ -470,6 +472,11 @@ scrub_normalize(sldns_buffer* pkt, struct msg_parse* msg, &aliaslen, pkt)) { verbose(VERB_ALGO, "synthesized CNAME " "too long"); + if(FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_YXDOMAIN) { + prev = rrset; + rrset = rrset->rrset_all_next; + continue; + } return 0; } cname_length++; @@ -650,6 +657,29 @@ scrub_normalize(sldns_buffer* pkt, struct msg_parse* msg, "RRset:", pkt, msg, prev, &rrset); continue; } + /* Also delete promiscuous NS for other RCODEs */ + if(FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_NOERROR + && env->cfg->iter_scrub_promiscuous) { + remove_rrset("normalize: removing promiscuous " + "RRset:", pkt, msg, prev, &rrset); + continue; + } + /* Also delete promiscuous NS for NOERROR with nodata + * for authoritative answers, not for delegations. + * NOERROR with an_rrsets!=0 already handled. + * Also NOERROR and soa_in_auth already handled. + * NOERROR with an_rrsets==0, and not a referral. + * referral is (NS not the zonename, noSOA). + */ + if(FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NOERROR + && msg->an_rrsets == 0 + && !(dname_pkt_compare(pkt, rrset->dname, + zonename) != 0 && !soa_in_auth(msg)) + && env->cfg->iter_scrub_promiscuous) { + remove_rrset("normalize: removing promiscuous " + "RRset:", pkt, msg, prev, &rrset); + continue; + } if(nsset == NULL) { nsset = rrset; } else { @@ -1060,7 +1090,8 @@ scrub_message(sldns_buffer* pkt, struct msg_parse* msg, /* this is not required for basic operation but is a forgery * resistance (security) feature */ if((FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NOERROR || - FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NXDOMAIN) && + FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NXDOMAIN || + FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_YXDOMAIN) && msg->qdcount == 0) return 0; @@ -1074,7 +1105,7 @@ scrub_message(sldns_buffer* pkt, struct msg_parse* msg, } /* normalize the response, this cleans up the additional. */ - if(!scrub_normalize(pkt, msg, qinfo, region, env)) + if(!scrub_normalize(pkt, msg, qinfo, region, env, zonename)) return 0; /* delete all out-of-zone information */ if(!scrub_sanitize(pkt, msg, qinfo, zonename, env, ie, qstate)) From nobody Wed Nov 26 16:01:01 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dGknB08vQz6JFpY for ; Wed, 26 Nov 2025 16:01: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dGkn96Qcvz3WBX for ; Wed, 26 Nov 2025 16:01:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764172861; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+TOpj84N8Bb1AXhXEZstvenVr4PbhLMRpkGaT48+sEo=; b=IdUbg1aHjxLkuPZriikDq+dhz63nuFTgnJX8qUck8LcjnIHVO870gmnWnBlzHLm1SPCetA BoBhYV+zEMou2ranEptQ1nFM7HhAzOyIgt6dkQWQzMFRJasQPmPiWdPowfZ+/t3xqcDqDn 0VFRzNnfw19H5tKTt2zVz685rIm2rT/iYOtN+c11S6IRFIrGc3vO10VuMSEOoKFtL1YROm KwhhGWknI3Fs9gHBt0yRkya1TEsMc12sRfqzAgm/q+B0xnTgOm4X1fX/4vlU+9VSdIRPya olLq9ib9UXy1Wj8Ww2giBksFc6rGr6xV3wypy3t+/3pInGnYDneLrvu37libzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764172861; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+TOpj84N8Bb1AXhXEZstvenVr4PbhLMRpkGaT48+sEo=; b=XOIRMnRFHbV0TOUMhhjWPVeHw4RQmk7PgHdow8TmQn4n/li1yg2kJGOprp1Dapy94HnDzd bq6NuJuykoZvfxhvHJMrPsC2L13brsJ3ZfKyW0IgI66VLhQM5DvE62TXdHg1m/UnReWLEB 4Jfyx0cRUvEQ0sEFL5H3oKbvwMmc5TYYGkxhNKYDFdRd2R6QDf+Yde74qaworO5/EzWXjx 8aCjn2QE8TSRJrxR9tdJdLibrVj2vSDxz6Mm+9rBCIic5RE20ZI/Nl4PJfLInVS4xuO5dk 2y7xYtGDcVIeZIfAzn0mSa7VNAQ+l2emuVDzlTFxhA2yRj+4HuDSQTXsgpwRoA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764172861; a=rsa-sha256; cv=none; b=Wy8tdObWzwC7kd2jJHKyPZ6VKPjJFS4TKiIbkgWpp7+4BBnD17svTCmDRj/DMSb1wnXeEE 5bH9bDkaA4q6bAA5+G4Ps9FNvEdIWmYcMuaUsjrhlZySdTZzaKi+20+oD8ihgFd1x0+xUY xVBjWOt1q0K8oqVPx+Zpax/wA7CIR/d6/SUv2kT36f/e0gmXshK/XITNoHNInVoU5+2esG Bw1KSjYeYwtL1u46kIvG/ZJ4wfg15Qt499URL8PIp0RhSi8iyeMlaGD/w1cgOeZoZpBOC1 PVjjs9+Kr/C29gs75M+7RObuv/qrXcjMMzqHL9UGXXpVNW8oiy9shxrFkaBz/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dGkn95yTyztJL for ; Wed, 26 Nov 2025 16:01:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 33e2b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 26 Nov 2025 16:01:01 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: cd40a23fb249 - stable/14 - Mitigate YXDOMAIN and nodata non-referral answer poisoning. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cd40a23fb249bba461e38ca0c3d243a20a12eef4 Auto-Submitted: auto-generated Date: Wed, 26 Nov 2025 16:01:01 +0000 Message-Id: <6927243d.33e2b.2163aabb@gitrepo.freebsd.org> The branch stable/14 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=cd40a23fb249bba461e38ca0c3d243a20a12eef4 commit cd40a23fb249bba461e38ca0c3d243a20a12eef4 Author: Gordon Tetlow AuthorDate: 2025-11-21 21:24:58 +0000 Commit: Gordon Tetlow CommitDate: 2025-11-26 16:00:45 +0000 Mitigate YXDOMAIN and nodata non-referral answer poisoning. Add a fix to apply scrubbing of unsolicited NS RRSets (and their respective address records) for YXDOMAIN and nodata non-referral answers. This prevents a malicious actor from exploiting a possible cache poison attack. Obtained from: NLnet Labs Security: FreeBSD-SA-25:10.unbound Security: CVE-2025-11411 (cherry picked from commit 2a3a6a1771148a709c2d9694c1d66c41ce8dee79) --- contrib/unbound/iterator/iter_scrub.c | 39 +++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/contrib/unbound/iterator/iter_scrub.c b/contrib/unbound/iterator/iter_scrub.c index 553d3655f0e3..8507a3fb65ac 100644 --- a/contrib/unbound/iterator/iter_scrub.c +++ b/contrib/unbound/iterator/iter_scrub.c @@ -418,12 +418,13 @@ shorten_rrset(sldns_buffer* pkt, struct rrset_parse* rrset, int count) * @param qinfo: original query. * @param region: where to allocate synthesized CNAMEs. * @param env: module env with config options. + * @param zonename: name of server zone. * @return 0 on error. */ static int scrub_normalize(sldns_buffer* pkt, struct msg_parse* msg, struct query_info* qinfo, struct regional* region, - struct module_env* env) + struct module_env* env, uint8_t* zonename) { uint8_t* sname = qinfo->qname; size_t snamelen = qinfo->qname_len; @@ -431,7 +432,8 @@ scrub_normalize(sldns_buffer* pkt, struct msg_parse* msg, int cname_length = 0; /* number of CNAMEs, or DNAMEs */ if(FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_NOERROR && - FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_NXDOMAIN) + FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_NXDOMAIN && + FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_YXDOMAIN) return 1; /* For the ANSWER section, remove all "irrelevant" records and add @@ -470,6 +472,11 @@ scrub_normalize(sldns_buffer* pkt, struct msg_parse* msg, &aliaslen, pkt)) { verbose(VERB_ALGO, "synthesized CNAME " "too long"); + if(FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_YXDOMAIN) { + prev = rrset; + rrset = rrset->rrset_all_next; + continue; + } return 0; } cname_length++; @@ -650,6 +657,29 @@ scrub_normalize(sldns_buffer* pkt, struct msg_parse* msg, "RRset:", pkt, msg, prev, &rrset); continue; } + /* Also delete promiscuous NS for other RCODEs */ + if(FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_NOERROR + && env->cfg->iter_scrub_promiscuous) { + remove_rrset("normalize: removing promiscuous " + "RRset:", pkt, msg, prev, &rrset); + continue; + } + /* Also delete promiscuous NS for NOERROR with nodata + * for authoritative answers, not for delegations. + * NOERROR with an_rrsets!=0 already handled. + * Also NOERROR and soa_in_auth already handled. + * NOERROR with an_rrsets==0, and not a referral. + * referral is (NS not the zonename, noSOA). + */ + if(FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NOERROR + && msg->an_rrsets == 0 + && !(dname_pkt_compare(pkt, rrset->dname, + zonename) != 0 && !soa_in_auth(msg)) + && env->cfg->iter_scrub_promiscuous) { + remove_rrset("normalize: removing promiscuous " + "RRset:", pkt, msg, prev, &rrset); + continue; + } if(nsset == NULL) { nsset = rrset; } else { @@ -1060,7 +1090,8 @@ scrub_message(sldns_buffer* pkt, struct msg_parse* msg, /* this is not required for basic operation but is a forgery * resistance (security) feature */ if((FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NOERROR || - FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NXDOMAIN) && + FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NXDOMAIN || + FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_YXDOMAIN) && msg->qdcount == 0) return 0; @@ -1074,7 +1105,7 @@ scrub_message(sldns_buffer* pkt, struct msg_parse* msg, } /* normalize the response, this cleans up the additional. */ - if(!scrub_normalize(pkt, msg, qinfo, region, env)) + if(!scrub_normalize(pkt, msg, qinfo, region, env, zonename)) return 0; /* delete all out-of-zone information */ if(!scrub_sanitize(pkt, msg, qinfo, zonename, env, ie, qstate)) From nobody Wed Nov 26 16:02:40 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dGkq50xKxz6JFn1 for ; Wed, 26 Nov 2025 16:02: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dGkq46vHzz3WdM for ; Wed, 26 Nov 2025 16:02:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764172961; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cvHcrppqJhUIoI6lRqYROevFcoL77tSvcNTKN63bWL0=; b=XHSNYJqarkDgrZZemoQWWMnll9BFFaYFwVuJSr/Qd41wgn119/68Vv1ede7D4zEOufzCjQ FyFeE3sZkNywFrU4euWGPQOA0k5ZRcDLxYQrq+zZlh3AYcUuWLgOzMd0VC1QGUTRl3ya8I Be1SNuvbDziNSsfCmNQamvIou3taKbnfSbu6eFPttZ5A72pz8dlXG13PDaShMt/JG39l/K pTWLRTK8SOI+t2/f5CRuwWjOAk/yc9balQtkCDKqFyvIKOYDzEl7S6dDoXWk15TWoNlQ2r khJZYn/Usb8lbASKAR3BboqEHSh10vJDQNrPSuAIonmuK4+a283FZHnDkTOOwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764172961; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cvHcrppqJhUIoI6lRqYROevFcoL77tSvcNTKN63bWL0=; b=EHGrlpnW4KxMxiV9Vfiyuh8eGrG1/162+sooqocjaeibfJb6RAUcV+JoqIzt6DClDsbLVd gq+qHy1CXmaAXlzAxwoanpWjsH0hPfVVRzrJzUA0D54mJDPh06Q2NBEftHlaIB0Hd6CyYo TChqwEWlpxVOqdSWum11f+piLWX41N7vTE5FPGPKqbGnTTwSJAJZvM1/RXdWHj7fqr6dso 3/ox/YfH+NaqRf1u4otAy415HZEWqnUSe00Pa4/yFtXVmmCCT8i4Q1ciuShmqPNMvKnPJ5 uQCdbLekUF/uadRJUiAvURBPyNi0OOjRNrCRzuOlYW//lgnjILabP/nA5w280g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764172961; a=rsa-sha256; cv=none; b=gJn0DINfA3Xk+4qfsxBkqvn1sqCnv0fOP32g06BsgV/sQ2x3/wdQB8hJrr9YC4yqQoE6LP i+emTrpViTQtf5MgjyDmQRS2Dzufl9vUiK1wLCW2yj9iem2R2JrhAWY4Lg5+btoxXyvDpB vRlx5GnFXv+JGgGdWJ5F/XLcUYY17Rmjh3xL3DkZutx0FlG+cYg4GT0HIpd+Xx4NP//VIb C6qMLkXVRWYdbsx4Z3NEFAuwpsETCb4A94+DpJX6nu9DxM+LzOuNwAdu17q7XykDL4Fd8H QNakGHH6PWh9X1aCebiSFuFx+eSHXfcdoiE3sG3OXsnHxvH0ve2HJrJBNEh79w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dGkq46V2yztgx for ; Wed, 26 Nov 2025 16:02:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 350de by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 26 Nov 2025 16:02:40 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 2aed524b2329 - stable/13 - Mitigate YXDOMAIN and nodata non-referral answer poisoning. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2aed524b2329fd4af929c7b6ef97fcdb02391177 Auto-Submitted: auto-generated Date: Wed, 26 Nov 2025 16:02:40 +0000 Message-Id: <692724a0.350de.5b6cb4d7@gitrepo.freebsd.org> The branch stable/13 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=2aed524b2329fd4af929c7b6ef97fcdb02391177 commit 2aed524b2329fd4af929c7b6ef97fcdb02391177 Author: Gordon Tetlow AuthorDate: 2025-11-21 21:24:58 +0000 Commit: Gordon Tetlow CommitDate: 2025-11-26 16:02:20 +0000 Mitigate YXDOMAIN and nodata non-referral answer poisoning. Add a fix to apply scrubbing of unsolicited NS RRSets (and their respective address records) for YXDOMAIN and nodata non-referral answers. This prevents a malicious actor from exploiting a possible cache poison attack. Obtained from: NLnet Labs Security: FreeBSD-SA-25:10.unbound Security: CVE-2025-11411 (cherry picked from commit 2a3a6a1771148a709c2d9694c1d66c41ce8dee79) --- contrib/unbound/iterator/iter_scrub.c | 39 +++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/contrib/unbound/iterator/iter_scrub.c b/contrib/unbound/iterator/iter_scrub.c index 553d3655f0e3..8507a3fb65ac 100644 --- a/contrib/unbound/iterator/iter_scrub.c +++ b/contrib/unbound/iterator/iter_scrub.c @@ -418,12 +418,13 @@ shorten_rrset(sldns_buffer* pkt, struct rrset_parse* rrset, int count) * @param qinfo: original query. * @param region: where to allocate synthesized CNAMEs. * @param env: module env with config options. + * @param zonename: name of server zone. * @return 0 on error. */ static int scrub_normalize(sldns_buffer* pkt, struct msg_parse* msg, struct query_info* qinfo, struct regional* region, - struct module_env* env) + struct module_env* env, uint8_t* zonename) { uint8_t* sname = qinfo->qname; size_t snamelen = qinfo->qname_len; @@ -431,7 +432,8 @@ scrub_normalize(sldns_buffer* pkt, struct msg_parse* msg, int cname_length = 0; /* number of CNAMEs, or DNAMEs */ if(FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_NOERROR && - FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_NXDOMAIN) + FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_NXDOMAIN && + FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_YXDOMAIN) return 1; /* For the ANSWER section, remove all "irrelevant" records and add @@ -470,6 +472,11 @@ scrub_normalize(sldns_buffer* pkt, struct msg_parse* msg, &aliaslen, pkt)) { verbose(VERB_ALGO, "synthesized CNAME " "too long"); + if(FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_YXDOMAIN) { + prev = rrset; + rrset = rrset->rrset_all_next; + continue; + } return 0; } cname_length++; @@ -650,6 +657,29 @@ scrub_normalize(sldns_buffer* pkt, struct msg_parse* msg, "RRset:", pkt, msg, prev, &rrset); continue; } + /* Also delete promiscuous NS for other RCODEs */ + if(FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_NOERROR + && env->cfg->iter_scrub_promiscuous) { + remove_rrset("normalize: removing promiscuous " + "RRset:", pkt, msg, prev, &rrset); + continue; + } + /* Also delete promiscuous NS for NOERROR with nodata + * for authoritative answers, not for delegations. + * NOERROR with an_rrsets!=0 already handled. + * Also NOERROR and soa_in_auth already handled. + * NOERROR with an_rrsets==0, and not a referral. + * referral is (NS not the zonename, noSOA). + */ + if(FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NOERROR + && msg->an_rrsets == 0 + && !(dname_pkt_compare(pkt, rrset->dname, + zonename) != 0 && !soa_in_auth(msg)) + && env->cfg->iter_scrub_promiscuous) { + remove_rrset("normalize: removing promiscuous " + "RRset:", pkt, msg, prev, &rrset); + continue; + } if(nsset == NULL) { nsset = rrset; } else { @@ -1060,7 +1090,8 @@ scrub_message(sldns_buffer* pkt, struct msg_parse* msg, /* this is not required for basic operation but is a forgery * resistance (security) feature */ if((FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NOERROR || - FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NXDOMAIN) && + FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NXDOMAIN || + FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_YXDOMAIN) && msg->qdcount == 0) return 0; @@ -1074,7 +1105,7 @@ scrub_message(sldns_buffer* pkt, struct msg_parse* msg, } /* normalize the response, this cleans up the additional. */ - if(!scrub_normalize(pkt, msg, qinfo, region, env)) + if(!scrub_normalize(pkt, msg, qinfo, region, env, zonename)) return 0; /* delete all out-of-zone information */ if(!scrub_sanitize(pkt, msg, qinfo, zonename, env, ie, qstate)) From nobody Wed Nov 26 16:13:20 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dGl3N422Cz6JGmY for ; Wed, 26 Nov 2025 16:13: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dGl3N3Qmkz3YxD for ; Wed, 26 Nov 2025 16:13:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764173600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZOu0S/IIRPGsCmCotxlOX+QZ4ZO5GKASGYU7bC0mcFA=; b=Si2VQ/qCs0UGLOjZuM0UGiICANtTkX+oat8Uu6wY1jO07YA00HgzIRLLwwdyHcIwRx07Pv BcKNW9wyAGSWQkVtHfshuOSjufZKAIijkTzuQsM0xMJajqxT0AaUbj0v7oNdhHurx2sHjX ZveKOYhl5QXK0S1lUOg9XLZzZMIIu9nLaK31zSHIRlHvIC3q+zfjKv80a0ifu6hHzOFahx Hhr77PFzW4I4HfecH+eNAbFjL1i7jOWq4sylQ1vDaQwnzbGZM5tDMueS8HI2w5eV1ypDjF hJjIQqvtnqXTtFC86+t2ekxvM6B6k1pXD69kTmhnvFS3usH6Zm2cWolrRI5k2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764173600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZOu0S/IIRPGsCmCotxlOX+QZ4ZO5GKASGYU7bC0mcFA=; b=VyOcbhFAmNaQW2l9/+vPhAJwXSTHV7IVJaMaX3ojuJmt0wpiVoSGp8v+uUw1+u/kUxz0Fp 3rz7xTcaTMoLda8QvInPaukdhfuSxoy6AVpdtmG/l0BEYX69anlSR84YXirRmS/No+aNUe Yoj4bRsFhgO+U3hrHB/CvUfW3/5NS0eLcB3TlxK6LNGC0lvcR5Yd9oSTMPZV3u3jBQQJkk j/DqkqFb+9/HAZYvn2hu2rLe+ogKIKGvXfE4W5jbVg9uokmQ/5GNM96R1HS1nJIiiQp892 UG+g5oOENdvYa0N/s6klvjqiMRrBjzuJplv8/kncfbj9XQzxhNLq8end/9Ta4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764173600; a=rsa-sha256; cv=none; b=v58S1aGkm5Y1AurpVRiU/6XkMDyFlv1flRxZShIZwmVEpC0ISyMtn8u2cwgmBWEHqt0V9s upMbYCYcDG6Qc7E4tD6JT8txmPcXk4wGqEGr5bqo2geS8ShECencPhRzla+40fl/BjaB/7 yX2hA41CcbmOLFBOSJuW2EgUzh7sWHY7vcRdR4ZBHCy9a0zp/pL6qmXxlWOU18qwc5O1fg P+urYluIxUkohwwhrKKi9p0WPGekEnh4H+WlpeFIPhjE3IR2cxnnNb2OwcZsFltt+KxA8H aaJZBD5Bv90ib+4+X43sWZYD+zazq/M4abgqli4P9TkTzPzqAxHsNUtRDaYCeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dGl3N2xFgztSy for ; Wed, 26 Nov 2025 16:13:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 35c0c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 26 Nov 2025 16:13:20 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: dabd406d99a9 - releng/15.0 - Mitigate YXDOMAIN and nodata non-referral answer poisoning. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/15.0 X-Git-Reftype: branch X-Git-Commit: dabd406d99a92ef88f3853e6093ba17d978a47ac Auto-Submitted: auto-generated Date: Wed, 26 Nov 2025 16:13:20 +0000 Message-Id: <69272720.35c0c.4936f62@gitrepo.freebsd.org> The branch releng/15.0 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=dabd406d99a92ef88f3853e6093ba17d978a47ac commit dabd406d99a92ef88f3853e6093ba17d978a47ac Author: Gordon Tetlow AuthorDate: 2025-11-21 21:24:58 +0000 Commit: Gordon Tetlow CommitDate: 2025-11-26 16:04:39 +0000 Mitigate YXDOMAIN and nodata non-referral answer poisoning. Add a fix to apply scrubbing of unsolicited NS RRSets (and their respective address records) for YXDOMAIN and nodata non-referral answers. This prevents a malicious actor from exploiting a possible cache poison attack. Approved by: so Approved by: re (cperciva) Obtained from: NLnet Labs Security: FreeBSD-SA-25:10.unbound Security: CVE-2025-11411 --- contrib/unbound/iterator/iter_scrub.c | 39 +++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/contrib/unbound/iterator/iter_scrub.c b/contrib/unbound/iterator/iter_scrub.c index 553d3655f0e3..8507a3fb65ac 100644 --- a/contrib/unbound/iterator/iter_scrub.c +++ b/contrib/unbound/iterator/iter_scrub.c @@ -418,12 +418,13 @@ shorten_rrset(sldns_buffer* pkt, struct rrset_parse* rrset, int count) * @param qinfo: original query. * @param region: where to allocate synthesized CNAMEs. * @param env: module env with config options. + * @param zonename: name of server zone. * @return 0 on error. */ static int scrub_normalize(sldns_buffer* pkt, struct msg_parse* msg, struct query_info* qinfo, struct regional* region, - struct module_env* env) + struct module_env* env, uint8_t* zonename) { uint8_t* sname = qinfo->qname; size_t snamelen = qinfo->qname_len; @@ -431,7 +432,8 @@ scrub_normalize(sldns_buffer* pkt, struct msg_parse* msg, int cname_length = 0; /* number of CNAMEs, or DNAMEs */ if(FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_NOERROR && - FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_NXDOMAIN) + FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_NXDOMAIN && + FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_YXDOMAIN) return 1; /* For the ANSWER section, remove all "irrelevant" records and add @@ -470,6 +472,11 @@ scrub_normalize(sldns_buffer* pkt, struct msg_parse* msg, &aliaslen, pkt)) { verbose(VERB_ALGO, "synthesized CNAME " "too long"); + if(FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_YXDOMAIN) { + prev = rrset; + rrset = rrset->rrset_all_next; + continue; + } return 0; } cname_length++; @@ -650,6 +657,29 @@ scrub_normalize(sldns_buffer* pkt, struct msg_parse* msg, "RRset:", pkt, msg, prev, &rrset); continue; } + /* Also delete promiscuous NS for other RCODEs */ + if(FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_NOERROR + && env->cfg->iter_scrub_promiscuous) { + remove_rrset("normalize: removing promiscuous " + "RRset:", pkt, msg, prev, &rrset); + continue; + } + /* Also delete promiscuous NS for NOERROR with nodata + * for authoritative answers, not for delegations. + * NOERROR with an_rrsets!=0 already handled. + * Also NOERROR and soa_in_auth already handled. + * NOERROR with an_rrsets==0, and not a referral. + * referral is (NS not the zonename, noSOA). + */ + if(FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NOERROR + && msg->an_rrsets == 0 + && !(dname_pkt_compare(pkt, rrset->dname, + zonename) != 0 && !soa_in_auth(msg)) + && env->cfg->iter_scrub_promiscuous) { + remove_rrset("normalize: removing promiscuous " + "RRset:", pkt, msg, prev, &rrset); + continue; + } if(nsset == NULL) { nsset = rrset; } else { @@ -1060,7 +1090,8 @@ scrub_message(sldns_buffer* pkt, struct msg_parse* msg, /* this is not required for basic operation but is a forgery * resistance (security) feature */ if((FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NOERROR || - FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NXDOMAIN) && + FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NXDOMAIN || + FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_YXDOMAIN) && msg->qdcount == 0) return 0; @@ -1074,7 +1105,7 @@ scrub_message(sldns_buffer* pkt, struct msg_parse* msg, } /* normalize the response, this cleans up the additional. */ - if(!scrub_normalize(pkt, msg, qinfo, region, env)) + if(!scrub_normalize(pkt, msg, qinfo, region, env, zonename)) return 0; /* delete all out-of-zone information */ if(!scrub_sanitize(pkt, msg, qinfo, zonename, env, ie, qstate)) From nobody Wed Nov 26 16:13:21 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dGl3P5db3z6JGVh for ; Wed, 26 Nov 2025 16:13: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dGl3P4NBsz3Z54 for ; Wed, 26 Nov 2025 16:13:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764173601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fQrQJ5Ao3GJmbdGV7lOB2WFxLp4pbN6esw6rOT22Wac=; b=w9yi4iQuGVyDHqds6xHx80vcLPmlxuxLBVaCc581bwGwyO/naR9zNH7FUDEUI1qs5JkxnH DMNr6aEusKh8qtW8u4YOgLCKreQ2fwIVijYrpcGycX6DnaKaJcrv+3c3L1hXC7M485ckR3 TfgOknzK6Bc2RVMwFXIlaAGXWVfRb0iGNEYJe2fSsagirD7J1//q9e13FgTV9EWtnz5p4h HeoH+NlkFuzWWN4WLFeVoUqCOkrsxmEE1pU0R9MYAnnUSDfLTuR7jdP6HnwwvMCoWG9gBf BGnnJbaRTvX1djw+fZqBqg6vL2J7YJwJWdov9ttg77hqr650/B//39iqCrzdjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764173601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fQrQJ5Ao3GJmbdGV7lOB2WFxLp4pbN6esw6rOT22Wac=; b=X/Pc3HcJoReiVZtcFR+LElJSfZc4XURMBzsGFZ8cw3ZBimn9+gmd0uJDbAwevlnhn2SPXg LV9Jp0UARKqdbrzyhRgQCoIRVeps5UQ/E9jRa7zSWZBuS7Mn+VNPMBoJ055DNNxIl5JrmD ZOr9oHgcGSiMifVdnNIBhJLqzVAQNK1ePL4WTgX2sgXxrROacOTAz0ead2embe3fAVW3kI tuzRdcM8mQ48FtMrnk83rE5HVZfmJUefas6Wx4njIhh5mC/kqEheRrNLQDjv+5OyXtN4a2 rMAt/M1X/h82bgA/VNV2qxxqw+qNvr6fbXl0kHxo5Aa1UiPYVcT1KixDAzy+jw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764173601; a=rsa-sha256; cv=none; b=rQKfCd4WuQE2uJLJMltMsLty6YzXu3hWmILj2hPFjJLYTMVT/tWFkLGOc759JWTTxIS0O9 tX+1jWWMSYC5e+k7WTQ0VH56TSqsoYpkI43cyqhblvo5g5UfTzDK6b5/ZsfSusHOphoLBt IcZPrfgOiPEZ1NQBhyJHm9r8QVRG4jfODrSZFNBusxnWVclWos65l57+5IeXdg/34kG0J+ aBP331mnai+ZnkO0gWsVr8SR5FEdpWO0nxHmSNfBzmglVE+kopVlKHEp+sIAf3Mtie0fLr zpzMvYR0mM+RnP0bjn5yTQoYxm/jUjgX5r54Qttgz6nkPvuTb0eyBlLwvRzkPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dGl3P3gC4ztbn for ; Wed, 26 Nov 2025 16:13:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 35c10 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 26 Nov 2025 16:13:21 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: c7ccd5b3f879 - releng/15.0 - Add UPDATING entry and bump version number. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/15.0 X-Git-Reftype: branch X-Git-Commit: c7ccd5b3f879373100ba6ca09468e8a6a7836049 Auto-Submitted: auto-generated Date: Wed, 26 Nov 2025 16:13:21 +0000 Message-Id: <69272721.35c10.311c13ef@gitrepo.freebsd.org> The branch releng/15.0 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=c7ccd5b3f879373100ba6ca09468e8a6a7836049 commit c7ccd5b3f879373100ba6ca09468e8a6a7836049 Author: Gordon Tetlow AuthorDate: 2025-11-22 08:46:59 +0000 Commit: Gordon Tetlow CommitDate: 2025-11-26 16:12:45 +0000 Add UPDATING entry and bump version number. Approved by: so Approved by: re (cperciva) --- UPDATING | 6 ++++++ sys/conf/newvers.sh | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index e15cb2e1a17c..0db786a70646 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,12 @@ 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. +20251126: + 15.0-RC4-p1 SA-25:10.unbound + + Fix DNS cache poison through YXDOMAIN and nodata non-referral + answers. [SA-25:10.unbound] + 20251115: The FreeBSD-base repository is now defined in /etc/pkg/FreeBSD.conf, disabled by default. In -CURRENT and -STABLE this points at nightly diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 53749b31fb6e..9d9a75a22c25 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -51,7 +51,7 @@ TYPE="FreeBSD" REVISION="15.0" -BRANCH="RC4" +BRANCH="RC4-p1" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Wed Nov 26 16:13:31 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dGl3b69Vnz6JGmj for ; Wed, 26 Nov 2025 16:13: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dGl3b2ZTFz3ZF9 for ; Wed, 26 Nov 2025 16:13:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764173611; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mbwba5Cyy+767/8/YdukBquXeQMQUBRqox8vMFtDhuA=; b=eBK01cqM7PY+sLUtkUOezzGpVpLFQ7BMtFrua1x1tuMwyLoo5JCuNQTw+OxHOndXe8t3YJ lE0XZgm9HDgFnnUmf5WWMJOC3UY80fj9dhrpi6a9f23gcT5RUADZt07KaetPowYujLGCb6 1HMfSgl7FuroREvEWKe6Em24fSA6SK6dWA0nfwzILOqSS1AqTv6NJzwAvT0a4JOIpEPYQM frvXLdWIt9RQJiRCMmiWeeqMmIeMPBqD2Rl+cFGgixVBdi2WYyqdUa6HDzRb6WsAOpmSwL MFVByHQRBjhtlZPzdGSPd/KLDkJ+QyYuPA7/+j+U7JhwzuV1cMLFZ7PduHJ8Ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764173611; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mbwba5Cyy+767/8/YdukBquXeQMQUBRqox8vMFtDhuA=; b=o7ZXl/0/ej/cO5dR2UejHi+FdkMsRgPO52wkMz1zTKjZBQAS4Mo4NwKY2x4ePEbvPxhKAg cPLvMqnC6cCdoquO7PAjeSIAtAwRBY6c5tFi/lXp66tHlFxcSgJY0rOl6P5Fds8H+TfPUY zJtEk3pRiSBMOS0PJNNl6R5ehCaEpQChzQJnMT7Szjz4AO9XYnK3Tzzdsdp0QdrxBjw9IL Gl3tpfFiZiXcVQfuyqWUoEY+I1KrpjPFg9WGYuzmpt2/JnzTegBVrNp2p9Kv1VI9MtGcr9 LoHNvtZWC45xvI0cNhsDOokDaCfOXFmD31QvejD3RFUHYKRU3ct6xv65KN//sA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764173611; a=rsa-sha256; cv=none; b=GwLrKhGikVLdjQG/w2oBtqIRCZfnqRZWwnjfgtISG6JR+OZRd1rvQ4J3ciAPRD5CUnOK3d 93CD3viokQe5lymfHeTTcSuiONE8uPYLvCVikGhjqlgl46OaOdvm/RqjGEZzCWGDnemIGp M7fI5B8hm4dz1W68nNIQchuwj2DCNQlpQ5R26pQYobiqJmOubNrO1fARvXEEvyCSrCTDaq O3XIx6z3d28QDox7M5bgR4n8/03tDV1aBbGbCdv2pwv3vZ/6HWnaqLYJ1Ro3niWHu2jNmK KLKG9PJXwgyOsIiBIOPKk6GdCPqJC6aHxL9Suc8GmkFWdZerresI8IX4qqZXEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dGl3b29zNztgf for ; Wed, 26 Nov 2025 16:13:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 33df7 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 26 Nov 2025 16:13:31 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 476b20984a6f - releng/14.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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.3 X-Git-Reftype: branch X-Git-Commit: 476b20984a6fed7e966f7b790444e23700603b6b Auto-Submitted: auto-generated Date: Wed, 26 Nov 2025 16:13:31 +0000 Message-Id: <6927272b.33df7.64835120@gitrepo.freebsd.org> The branch releng/14.3 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=476b20984a6fed7e966f7b790444e23700603b6b commit 476b20984a6fed7e966f7b790444e23700603b6b Author: Gordon Tetlow AuthorDate: 2025-11-26 16:12:27 +0000 Commit: Gordon Tetlow CommitDate: 2025-11-26 16:12:27 +0000 Add UPDATING entries and bump version. Approved by: so --- UPDATING | 5 +++++ sys/conf/newvers.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 6af1b31f0b57..09b22327d84d 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,11 @@ 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. +20251126: + 14.3-RELEASE-p6 SA-25:10.unbound + + Fix cache poison in local-unbound service. [SA-25:10.unbound] + 20251022: 14.3-RELEASE-p5 SA-25:09.netinet diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 99c29d44db02..49a6dc75c455 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="14.3" -BRANCH="RELEASE-p5" +BRANCH="RELEASE-p6" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Wed Nov 26 16:13:30 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dGl3Z5DmFz6JGmg for ; Wed, 26 Nov 2025 16:13: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dGl3Z1nz9z3ZTC for ; Wed, 26 Nov 2025 16:13:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764173610; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QEvs6T9S5SXnM6a0ppPZdhZbaZXMqvfPKkd3dZoqnFI=; b=jepT5r7IP/a28v+uitMr7tLeq4BZ7pqvrR+45GqDHbcyN79+9QaTyRuDmFiHekSCl3urbE qP/1PLbklF48ner28z61L36cWtBT1Jd93FCSo/1VFhmvpSVI2HPJd0wiSge/y2KTvqwLsp aJPnbIl1ZfiqIJQ1bK3jESHHHXDeDqA8pZU0s+jMrcXwLqhLBiraJy4DyighjpP09rffOO 8p4pD56UBQjafw2WueU94xlXzI90CRv7GfhIv5mj3llxJjM8tvrhZwAEVTIXWVWsvE+PV/ WrP9DIhvJS2KI6cIXjcvbcuEvapQU4LimRrPGU6e9EiV6r/Czj2UJL0+SCdFUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764173610; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QEvs6T9S5SXnM6a0ppPZdhZbaZXMqvfPKkd3dZoqnFI=; b=UnWaq6AXr+FlFOTZTsCHvG59nZ3dkMXE6fu5MdSXArc3gZMRNFRnIKHJlncbFSmOV0K9Kf wu4TJAEzQs9RoRE6bYFFpXtz2Zhlm+4JgefxBlfAuzoEbDS1mM2ukSTek3isKAL8buMhCW uzxXjsEag++mcYEF3lpDZ4c5LezwwJ2o5jxULel3ItvRGlhFWzn7jodvSEmqnjWqdtSj1N xdZIadT2fWLuisPMf8ox5Zwj1h0XU6vOioXVcTK2ewp8PcVOmgr1LdDsbaA4Ayhv6Cg6w7 BUI+sZ7MymZoKtHX4fEMpiwdGyObShBN66iLn+61blxePvHHy6fZJ00OwnjA/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764173610; a=rsa-sha256; cv=none; b=PTRcJXkqrbYyl7qoK9HEuIViFHo5XuB3YB3AJRKwf5n49GRKMWYzYUQ/fJCRKtTUbYM9Fd sX372avkQ/EEZhimxJNugpwut56o6D9XZebsbQLye97PfF3NzjsDl1cpNbvqjUr9QNaPTc srs6QBDec8Mti4GRQBnzgY2eoKv1Bq4F1Q3C5K1U0xjvgX/t3i9jrzs1t4ON1u5cYckVaX 8plixffqJMZecVFP4pb/hFByVW8cK4OX3hL4n1p+DOQZZxJczrBEUZTwuRIAY/fYfMnzse bEkde8s+dKGq2LFazUneY9twYmZP0oDQWxJln3q917006vZwttmmgbzQYNOOTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dGl3Z1PchztyT for ; Wed, 26 Nov 2025 16:13:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 363da by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 26 Nov 2025 16:13:30 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 18c4eb2cc642 - releng/14.3 - Add a fix to scrub unsolicited NS RRSets to prevent cache poisoning. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.3 X-Git-Reftype: branch X-Git-Commit: 18c4eb2cc6425d7397f68be0830455ec2ded926e Auto-Submitted: auto-generated Date: Wed, 26 Nov 2025 16:13:30 +0000 Message-Id: <6927272a.363da.568e2bfc@gitrepo.freebsd.org> The branch releng/14.3 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=18c4eb2cc6425d7397f68be0830455ec2ded926e commit 18c4eb2cc6425d7397f68be0830455ec2ded926e Author: Gordon Tetlow AuthorDate: 2025-11-26 16:08:04 +0000 Commit: Gordon Tetlow CommitDate: 2025-11-26 16:08:04 +0000 Add a fix to scrub unsolicited NS RRSets to prevent cache poisoning. Approved by: so Obtained from: NLnet Labs Security: FreeBSD-SA-25:10.unbound Security: CVE-2025-11411 --- contrib/unbound/iterator/iter_scrub.c | 55 ++++++++++++++++++++++++++++++++--- 1 file changed, 51 insertions(+), 4 deletions(-) diff --git a/contrib/unbound/iterator/iter_scrub.c b/contrib/unbound/iterator/iter_scrub.c index 49a5f5da19c2..b02b4dc484bf 100644 --- a/contrib/unbound/iterator/iter_scrub.c +++ b/contrib/unbound/iterator/iter_scrub.c @@ -418,12 +418,13 @@ shorten_rrset(sldns_buffer* pkt, struct rrset_parse* rrset, int count) * @param qinfo: original query. * @param region: where to allocate synthesized CNAMEs. * @param env: module env with config options. + * @param zonename: name of server zone. * @return 0 on error. */ static int scrub_normalize(sldns_buffer* pkt, struct msg_parse* msg, struct query_info* qinfo, struct regional* region, - struct module_env* env) + struct module_env* env, uint8_t* zonename) { uint8_t* sname = qinfo->qname; size_t snamelen = qinfo->qname_len; @@ -431,7 +432,8 @@ scrub_normalize(sldns_buffer* pkt, struct msg_parse* msg, int cname_length = 0; /* number of CNAMEs, or DNAMEs */ if(FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_NOERROR && - FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_NXDOMAIN) + FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_NXDOMAIN && + FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_YXDOMAIN) return 1; /* For the ANSWER section, remove all "irrelevant" records and add @@ -470,6 +472,11 @@ scrub_normalize(sldns_buffer* pkt, struct msg_parse* msg, &aliaslen, pkt)) { verbose(VERB_ALGO, "synthesized CNAME " "too long"); + if(FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_YXDOMAIN) { + prev = rrset; + rrset = rrset->rrset_all_next; + continue; + } return 0; } cname_length++; @@ -634,6 +641,45 @@ scrub_normalize(sldns_buffer* pkt, struct msg_parse* msg, "RRset:", pkt, msg, prev, &rrset); continue; } + /* If the NS set is a promiscuous NS set, scrub that + * to remove potential for poisonous contents that + * affects other names in the same zone. Remove + * promiscuous NS sets in positive answers, that + * thus have records in the answer section. Nodata + * and nxdomain promiscuous NS sets have been removed + * already. Since the NS rrset is scrubbed, its + * address records are also not marked to be allowed + * and are removed later. */ + if(FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NOERROR && + msg->an_rrsets != 0 && + 1 /* env->cfg->iter_scrub_promiscuous */) { + remove_rrset("normalize: removing promiscuous " + "RRset:", pkt, msg, prev, &rrset); + continue; + } + /* Also delete promiscuous NS for other RCODEs */ + if(FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_NOERROR + && 1 /* env->cfg->iter_scrub_promiscuous */) { + remove_rrset("normalize: removing promiscuous " + "RRset:", pkt, msg, prev, &rrset); + continue; + } + /* Also delete promiscuous NS for NOERROR with nodata + * for authoritative answers, not for delegations. + * NOERROR with an_rrsets!=0 already handled. + * Also NOERROR and soa_in_auth already handled. + * NOERROR with an_rrsets==0, and not a referral. + * referral is (NS not the zonename, noSOA). + */ + if(FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NOERROR + && msg->an_rrsets == 0 + && !(dname_pkt_compare(pkt, rrset->dname, + zonename) != 0 && !soa_in_auth(msg)) + && 1 /* env->cfg->iter_scrub_promiscuous */) { + remove_rrset("normalize: removing promiscuous " + "RRset:", pkt, msg, prev, &rrset); + continue; + } if(nsset == NULL) { nsset = rrset; } else { @@ -1044,7 +1090,8 @@ scrub_message(sldns_buffer* pkt, struct msg_parse* msg, /* this is not required for basic operation but is a forgery * resistance (security) feature */ if((FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NOERROR || - FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NXDOMAIN) && + FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NXDOMAIN || + FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_YXDOMAIN) && msg->qdcount == 0) return 0; @@ -1058,7 +1105,7 @@ scrub_message(sldns_buffer* pkt, struct msg_parse* msg, } /* normalize the response, this cleans up the additional. */ - if(!scrub_normalize(pkt, msg, qinfo, region, env)) + if(!scrub_normalize(pkt, msg, qinfo, region, env, zonename)) return 0; /* delete all out-of-zone information */ if(!scrub_sanitize(pkt, msg, qinfo, zonename, env, ie, qstate)) From nobody Wed Nov 26 16:13:41 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dGl3n2zWyz6JGd6 for ; Wed, 26 Nov 2025 16:13: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dGl3n1MP3z3ZYc for ; Wed, 26 Nov 2025 16:13:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764173621; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IpZFGiMm1aLZfhmE5QLDI1eNyq2sFvNmDESMDdhdycI=; b=JgW6ff7GBFpVZx05xu4BfqPFBKfiKnv0j2Bc2bCan4gG7XkA9yKbe+2iJYQBlHUVYkiihx pISMhVHR5mW83IAREy8hwQF8wdpIYmO2OovSo/+cg5nWMAZc80mxDb+eAIZqigxXG4e82U ID57OkyBsgdeAaeIbECWtgAO9yMzVdef91CNUF8AW0/qBHP+FXYsmwk9HYmdSrTc26G4tW ExOzgvy5fv5USbUihFdk89l8jZiQ+wbTI7JPOCQ5iE66aBor/TbvA11v96o7qp0MMUKV/8 MH966h4e7JZKUUw+WNQrhPM9ELE2VNtGIlQsmQPXUJ4PonB4U5/Y4+kZLnWXyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764173621; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IpZFGiMm1aLZfhmE5QLDI1eNyq2sFvNmDESMDdhdycI=; b=Exwl05iVYbFjDo4vVuidYbd1jX9yq9VOEcMiWz1KSdSMqgrlCPJwuG2+RCRDTs7egqcFqI XaV65giBUkaV8DMvry3zbDtNDZ3heHehtrjg3MxiJgZdA+zVWemvUi3G0PGm32nfpBZDNG LI9vpF00nO9jzYZ4DscLcsRvfrrxkGrYNlUhS+nZzrwu8Svc3s39ZkNAI9NNDrwTtRKVvd ct+RNZuD82Y9FFzHiBdn04kgPvPMzp08JIVDmCsisApWeLHZ77SQcsK2uHaMTV2kRWl52O wxA+5bOX6iUbtFr6RuzxN9UfEgQBBmR3lVe27AvIsJ/g8X6xzvyUFfgIOh8bWA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764173621; a=rsa-sha256; cv=none; b=XZ65uDKApkMzXVuB5L/vRJKgz9Hvqg9fevGEF22fTS4jFRPzkCPtHPET5Lc0RVmvdIJEy4 MHiU3ySc4Gd3ePiO3I3PxhxgoCR2WMs1JL9GBpAMhygEfY4d89QOwyPJILdgYP0wxdIUYx FlmBkYNTmrGAWBGgZ9a+CAfC5DbrLm0pk/t4mq/lGEUwgU4zIoD0vTy+RxvcfrellUUoJI dRoPK6UDOBtF1UbEbR2ixMCyahATzgdFmJfKttumocheULJj1BGzi+nm1EgK9L5TkO7hso MnbVKJvTpAXA4t3S3SpDntYud0H/jckGa2yd8ZSB2V/R4xIVC0yV1q/RFaYkAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dGl3n0wCMztlG for ; Wed, 26 Nov 2025 16:13:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 33d75 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 26 Nov 2025 16:13:41 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 9b0808259a8a - releng/13.5 - Add a fix to scrub unsolicited NS RRSets to prevent cache poisoning. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.5 X-Git-Reftype: branch X-Git-Commit: 9b0808259a8a8dcd1236038378b8abe0617b0777 Auto-Submitted: auto-generated Date: Wed, 26 Nov 2025 16:13:41 +0000 Message-Id: <69272735.33d75.7ca3914c@gitrepo.freebsd.org> The branch releng/13.5 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=9b0808259a8a8dcd1236038378b8abe0617b0777 commit 9b0808259a8a8dcd1236038378b8abe0617b0777 Author: Gordon Tetlow AuthorDate: 2025-11-26 16:09:36 +0000 Commit: Gordon Tetlow CommitDate: 2025-11-26 16:09:36 +0000 Add a fix to scrub unsolicited NS RRSets to prevent cache poisoning. Approved by: so Obtained from: NLnet Labs Security: FreeBSD-SA-25:10.unbound Security: CVE-2025-11411 --- contrib/unbound/iterator/iter_scrub.c | 55 ++++++++++++++++++++++++++++++++--- 1 file changed, 51 insertions(+), 4 deletions(-) diff --git a/contrib/unbound/iterator/iter_scrub.c b/contrib/unbound/iterator/iter_scrub.c index 49a5f5da19c2..b02b4dc484bf 100644 --- a/contrib/unbound/iterator/iter_scrub.c +++ b/contrib/unbound/iterator/iter_scrub.c @@ -418,12 +418,13 @@ shorten_rrset(sldns_buffer* pkt, struct rrset_parse* rrset, int count) * @param qinfo: original query. * @param region: where to allocate synthesized CNAMEs. * @param env: module env with config options. + * @param zonename: name of server zone. * @return 0 on error. */ static int scrub_normalize(sldns_buffer* pkt, struct msg_parse* msg, struct query_info* qinfo, struct regional* region, - struct module_env* env) + struct module_env* env, uint8_t* zonename) { uint8_t* sname = qinfo->qname; size_t snamelen = qinfo->qname_len; @@ -431,7 +432,8 @@ scrub_normalize(sldns_buffer* pkt, struct msg_parse* msg, int cname_length = 0; /* number of CNAMEs, or DNAMEs */ if(FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_NOERROR && - FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_NXDOMAIN) + FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_NXDOMAIN && + FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_YXDOMAIN) return 1; /* For the ANSWER section, remove all "irrelevant" records and add @@ -470,6 +472,11 @@ scrub_normalize(sldns_buffer* pkt, struct msg_parse* msg, &aliaslen, pkt)) { verbose(VERB_ALGO, "synthesized CNAME " "too long"); + if(FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_YXDOMAIN) { + prev = rrset; + rrset = rrset->rrset_all_next; + continue; + } return 0; } cname_length++; @@ -634,6 +641,45 @@ scrub_normalize(sldns_buffer* pkt, struct msg_parse* msg, "RRset:", pkt, msg, prev, &rrset); continue; } + /* If the NS set is a promiscuous NS set, scrub that + * to remove potential for poisonous contents that + * affects other names in the same zone. Remove + * promiscuous NS sets in positive answers, that + * thus have records in the answer section. Nodata + * and nxdomain promiscuous NS sets have been removed + * already. Since the NS rrset is scrubbed, its + * address records are also not marked to be allowed + * and are removed later. */ + if(FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NOERROR && + msg->an_rrsets != 0 && + 1 /* env->cfg->iter_scrub_promiscuous */) { + remove_rrset("normalize: removing promiscuous " + "RRset:", pkt, msg, prev, &rrset); + continue; + } + /* Also delete promiscuous NS for other RCODEs */ + if(FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_NOERROR + && 1 /* env->cfg->iter_scrub_promiscuous */) { + remove_rrset("normalize: removing promiscuous " + "RRset:", pkt, msg, prev, &rrset); + continue; + } + /* Also delete promiscuous NS for NOERROR with nodata + * for authoritative answers, not for delegations. + * NOERROR with an_rrsets!=0 already handled. + * Also NOERROR and soa_in_auth already handled. + * NOERROR with an_rrsets==0, and not a referral. + * referral is (NS not the zonename, noSOA). + */ + if(FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NOERROR + && msg->an_rrsets == 0 + && !(dname_pkt_compare(pkt, rrset->dname, + zonename) != 0 && !soa_in_auth(msg)) + && 1 /* env->cfg->iter_scrub_promiscuous */) { + remove_rrset("normalize: removing promiscuous " + "RRset:", pkt, msg, prev, &rrset); + continue; + } if(nsset == NULL) { nsset = rrset; } else { @@ -1044,7 +1090,8 @@ scrub_message(sldns_buffer* pkt, struct msg_parse* msg, /* this is not required for basic operation but is a forgery * resistance (security) feature */ if((FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NOERROR || - FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NXDOMAIN) && + FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NXDOMAIN || + FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_YXDOMAIN) && msg->qdcount == 0) return 0; @@ -1058,7 +1105,7 @@ scrub_message(sldns_buffer* pkt, struct msg_parse* msg, } /* normalize the response, this cleans up the additional. */ - if(!scrub_normalize(pkt, msg, qinfo, region, env)) + if(!scrub_normalize(pkt, msg, qinfo, region, env, zonename)) return 0; /* delete all out-of-zone information */ if(!scrub_sanitize(pkt, msg, qinfo, zonename, env, ie, qstate)) From nobody Wed Nov 26 16:13:42 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dGl3p3rKZz6JGmm for ; Wed, 26 Nov 2025 16:13: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dGl3p2YSdz3ZWV for ; Wed, 26 Nov 2025 16:13:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764173622; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d6eVmxsK+pBZv3YLIa/tF/9TMIGn6dwI8ChcIZlEa/8=; b=ssCh1eECGn1OxmCIObJRSU3HYUNFoTk5tXwPZuK5HZu2kh9pBuPTHV6dQcGTExAOKqp/Ng iMo5L+U/GDB7BgBcYuf4Xjg4RHtLGPZe9+Cxtz/iTMY9BPdO8DbXrBYqsEVrPVSd+rKQ3F 2z6oisIsnizD/FuEOFkqnk7+DI6Mno1DUGomCdRvKxweqPC/oJ1HFPqV4hLSccfEGxufNQ IJEJ5uHoJU6QcX87jl+KQZTBrNnuLuLT4rQES2yEyqfwem3K/0dZzMi8m74kxvfTOliOUI GWsB8t6VVnrEdVPuLMQYJ5meBFuVYxai4Cb3pS6YogBEKzj9nu91/5bjRMKqYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764173622; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d6eVmxsK+pBZv3YLIa/tF/9TMIGn6dwI8ChcIZlEa/8=; b=GNNcAL8GCctfhIwUOg7sLNq/5eerXF/bmfMYRNiLb29KLIfdCkvHfJ4ZMGab/zGZsxKbpx Ian++/XGXblxd6VK7GLPvCeahteHKHz26b9lproHRgkGOndOn3W3K3uBA+On6zESESBCY5 UttbVPXISujzvvPbPxXruzr8qFFOgMXdVtQUAf8Ia+LOtu6AmRmAXJt2Gi6YW6CseT6Ile qs0QoW85lT7Qsw+1/UoFSkH/ZFfnm8jE+bHyMQ/pYFaKN/EP10T75xAHu9oUL95VpX0b75 kzqI8qDqw+l8hTIyFMYqTmJEWsiFSJ2mj4mIfarWpBA4HNf1I2LyMMEePqmsCQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764173622; a=rsa-sha256; cv=none; b=QQy+01SVpUw9Lb/FJLGfaHjVTvYTuZ/B4BaG4w2F9JjurmhEMm7yN3eb1Ow+qzFKA7QSwV ayx7xSkV7G6UqHrBdEvfVUoVT6UENsf8RAmNgBFb2RioicONVtv2yyXf6QMOSJhhAwBl5f 3G13I0L3Q0301XvvWepbkSOsnEJVSnIFKW6bJ00nkl1nsGBahZD006c40e294EZt60EzBS sBEz91Ci15eT4g1OQmOUceRGFOSDXLL06JBK4ouX7pEavBXJ0JvOESDLzXch1v5KaE6Scv zqVylkA9Neyj6nAofUMkhEF2MTrF4ZGaAM48W2bFsK8mrPOODc/d8MolKfse8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dGl3p1kZDztyW for ; Wed, 26 Nov 2025 16:13:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 34f6d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 26 Nov 2025 16:13:42 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 4fc17862cb50 - releng/13.5 - 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.5 X-Git-Reftype: branch X-Git-Commit: 4fc17862cb506bfe121c293500177e8447120068 Auto-Submitted: auto-generated Date: Wed, 26 Nov 2025 16:13:42 +0000 Message-Id: <69272736.34f6d.66765d59@gitrepo.freebsd.org> The branch releng/13.5 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=4fc17862cb506bfe121c293500177e8447120068 commit 4fc17862cb506bfe121c293500177e8447120068 Author: Gordon Tetlow AuthorDate: 2025-11-26 16:12:10 +0000 Commit: Gordon Tetlow CommitDate: 2025-11-26 16:12:10 +0000 Add UPDATING entries and bump version. Approved by: so --- UPDATING | 5 +++++ sys/conf/newvers.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 55c65b3afd6b..270e20be199b 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,11 @@ 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. +20251126: + 13.5-RELEASE-p7 SA-25:10.unbound + + Fix cache poison in local-unbound service. [SA-25:10.unbound] + 20251022: 13.5-RELEASE-p6 SA-25:09.netinet diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index add7f72dcaa9..a72f9f110df6 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="13.5" -BRANCH="RELEASE-p6" +BRANCH="RELEASE-p7" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Wed Nov 26 20:31:58 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dGrnv2VMDz6HNxb for ; Wed, 26 Nov 2025 20:32: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dGrnv1fZtz3RZN for ; Wed, 26 Nov 2025 20:32:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764189123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=akQekX37cypbo8O+I9ig0+4e5IGn3acotHh4jBTGRxY=; b=YChv4mkFC/cVWWrkn/GcGebE3cvcpyIa+OG8MsFiFFVaSa0n1aAIlkxkDjmKqnPO0CCMyc sH3HnRyP4+hYZWlHYQUWLL7mDBgO6nWhl2rqMlAgNK1Xv+wDCzuyeiwBNmhUd4iE0J/Lc1 EnKYzSJ8fxqR/9L7jMy7Z3Dg5sUn6rzCkw2db+4X4VIjMG/ZGuCnqXUYgobXvEicOBQRFc arK4PA6u6rYs9bx7ADDHhe1dBeoM1xTrTy9OlNbVjqsvlfH+JKXCNI0vlL7awc/XVWmPVA jLhWhQ6ptfeozobYcBlhhJAA50iTDMi25zHH/0wsQJxO5PJf/mVt66/d+VRsFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764189123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=akQekX37cypbo8O+I9ig0+4e5IGn3acotHh4jBTGRxY=; b=Mgvmxr7dcVse52EWYngXnLKM7eQIDuhDShf/MsLmhAhwmhUY0cgkazWkEvcuaTBXT+itzw d8Jk5ogMJyva86WoYVUmvXPuC0kdp2eEJdci89gZIQ28ziIDiWvGsLKuwQoxNKGwu1NBbw Q6TGjvpAQMn8purmR8Km0VMgAJuhw571mbzsBogR/bcs5LflUsA+LbpvB/o1XdsV6SBP9L iphan9Yxzcgi8Fang+Kf5mvXoWmpWNCeW6u99nvXk74g+oZMqCop6VgN0xYhD2C8v8C6I6 ZHaaMNEeW39J5rwDRIv8zsSWOn1ajPASJGoE/npqTJriO94qFvNNCyqLby+zdg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764189123; a=rsa-sha256; cv=none; b=sWLIS477lfgs1PqyPn9QXk+19CZI9KDcl+xe8rTW3BKyJWd/hPKF3c/yn7e9qU2br2sMNA QV+yLtqlCmsCazLfRbcRWFQGfA4IcV7njKoZ2K8w/dNuVz5gVfHSbRVWltrd/VxBslfuSI jZTlCaqcPkuCevL3HBE5TYYKL1StiUGi1Xl/ETSYwSEXhsrwwdhP81e5FiQSH8063rF2v9 d4BbmifTnzaE07hfbZy8DCp4WS4fudOHPXlfqKNlR1syIYijp3FEalUB+6sqOtWKQKfWoF WLTLNZLQh6G6eCItkshVgSrPI/xRvM2bZul28c+bhSB5QrfB+Iir0b3Wq1fTWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dGrnv0pnKz12Nx for ; Wed, 26 Nov 2025 20:32:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 30e89 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 26 Nov 2025 20:31:58 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: dc7503479273 - stable/15 - mdo.1: Document group-related and fine-grained control functionalities List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: dc75034792739a638edf3d7b756e7175e5a79bf7 Auto-Submitted: auto-generated Date: Wed, 26 Nov 2025 20:31:58 +0000 Message-Id: <692763be.30e89.730c648f@gitrepo.freebsd.org> The branch stable/15 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=dc75034792739a638edf3d7b756e7175e5a79bf7 commit dc75034792739a638edf3d7b756e7175e5a79bf7 Author: Olivier Certner AuthorDate: 2025-09-01 15:24:54 +0000 Commit: Olivier Certner CommitDate: 2025-11-26 20:31:23 +0000 mdo.1: Document group-related and fine-grained control functionalities This is a manual page update describing the functionality that was added to mdo(1) in commit 3ca1e69028ac ("mdo(1): Add support and shortcuts for fully specifying users and groups"). Please either refer to that commit or the new manual page's content for more information. While here: - Add to the introduction a description of process credentials and some specific vocabulary that is used throughout the page, as well as the relationship between mdo(1) and mac_do(4). - Update the HISTORY section. - Add AUTHORS and SECURITY CONSIDERATIONS sections. Reviewed by: ziaee MFC after: 1 minute Sponsored by: The FreeBSD Foundation Sponsored by: Google LLC (GSoC 2025) Co-authored-by: Kushagra Srivastava Differential Revision: https://reviews.freebsd.org/D53905 (cherry picked from commit 73dd00f2fd7de2a5d8dda8fa25ebcd7c8964ff52) --- usr.bin/mdo/mdo.1 | 269 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 245 insertions(+), 24 deletions(-) diff --git a/usr.bin/mdo/mdo.1 b/usr.bin/mdo/mdo.1 index c4586f628661..1de694c69e40 100644 --- a/usr.bin/mdo/mdo.1 +++ b/usr.bin/mdo/mdo.1 @@ -1,49 +1,270 @@ .\"- -.\" Copyright(c) 2024 Baptiste Daroussin -.\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.Dd May 26, 2025 +.\" Copyright (c) 2024 Baptiste Daroussin +.\" Copyright (c) 2025 Kushagra Srivastava +.\" Copyright (c) 2025 The FreeBSD Foundation +.\" +.\" Portions of this documentation were written by Olivier Certner +.\" at Kumacom SARL under sponsorship from the FreeBSD +.\" Foundation. +.\" +.Dd November 26, 2025 .Dt MDO 1 .Os .Sh NAME .Nm mdo -.Nd execute commands as another user +.Nd execute commands with specific credentials .Sh SYNOPSIS .Nm -.Op Fl u Ar username +.Op Fl u Ar user | Fl k .Op Fl i -.Op command Op args +.Op Fl g Ar group +.Op Fl G Ar group1,group2,... +.Op Fl s Ar groups_mod1,groups_mod2,... +.Op Fl h +.Op Fl -ruid Ar user +.Op Fl -svuid Ar user +.Op Fl -euid Ar user +.Op Fl -rgid Ar group +.Op Fl -svgid Ar group +.Op Fl -egid Ar group +.Op -- +.Op Ar command Op Ar args ... .Sh DESCRIPTION The .Nm -utility executes the specified +utility executes the passed .Ar command -as user -.Ar username . -.Pp -If no -.Ar username -is provided it defaults to the -.Va root -user. -If no +with the requested process credentials or, if no .Ar command -is specified, it will execute the shell specified as -.Va SHELL -environnement variable, falling back on -.Pa /bin/sh . +was specified, the program whose path is the value of the +.Ev SHELL +environment variable or +.Pa /bin/sh +if that variable is unset. +The calling user must either be the superuser +.Pq effective user ID of 0 +or the credentials transition from the caller's to the requested ones must be +authorized by a MAC module such as +.Xr mac_do 4 . +The target process credentials are applied atomically using +.Xr setcred 2 . .Pp +Process credentials comprise the real, effective and saved user IDs, the real, +effective and saved group IDs, hereby called the +.Dq primary +groups, and the supplementary groups as a set of group IDs. +Below, the +.Dq user +phrase implies that the real, effective and saved user IDs all have or are going +to be set to the same value. The +.Dq primary group +phrase is used similarly with respect to primary groups. +.Pp +The target process credentials have to be fully specified, either explicitly by +listing all attributes and their requested values, or indirectly by establishing +a baseline that provides a default value for each attribute, which can then be +amended by additional options. +.Pp +Possible baselines are either the full set of credentials established at login +for a specific named user, the current credentials, or the current credentials' +primary and supplementary groups which implies some user is specified +explicitly. +They are respectively established by using either option +.Fl u +with a named user argument, option +.Fl k , +or option .Fl i -option can be used to only call -.Fn setuid -and keep the group from the calling user. +in conjunction with +.Fl u +or no other options. +If no other option than +.Fl i +appears, a default of +.Fl u Cm root +is implied. +.Pp +The primary group can be set or amended with option +.Fl g , +whereas the supplementary groups can be either fully replaced with an explicit +list using option +.Fl G +or amended through set-like operations with option +.Fl s . +.Pp +Any of the individual real, effective and saved user and group IDs can be +overridden separately if desired through the options +.Fl -ruid , +.Fl -euid , +and +.Fl -svuid +for users, and +.Fl -rgid , +.Fl -egid , +and +.Fl -svgid +for groups respectively. +.Pp +The options are: +.Bl -tag -width indent +.It Fl -euid Ar user +Override the effective user. +As for +.Fl u , +.Ar user +may either be a name or a numerical ID. +.It Fl -egid Ar group +Override the effective group. +As for +.Fl g , +.Ar group +may either be a name or a numerical ID. +.It Fl G Ar group1,group2,... +Set or replace the full set of supplementary groups. +As for +.Fl g , +groups can be specified by name or numerical ID. +Groups must be separated by commas, and spaces around commas are not allowed. +.It Fl g Ar group +Set or amend the primary group. +.Ar group +may be the name of a group in the group database, else will be interpreted as +a numerical group ID. +.It Fl h +Display usage information and exit. +.It Fl i +Uses the current credentials' primary and supplementary groups as the baseline. +If no other option is present, the target user is assumed to be +.Dq root . +Otherwise, +.Fl u +or +.Fl k +must be specified. +.It Fl k +Use the current credentials as the baseline. +Incompatible with +.Fl u . +Implies +.Fl i . +.It Fl -ruid Ar user +Override the real user. +As for +.Fl u , +.Ar user +may either be a name or a numerical ID. +.It Fl -rgid Ar group +Override the real group. +As for +.Fl g , +.Ar group +may either be a name or a numerical ID. +.It Fl s Ar groups_mod1,groups_mod2,... +Incrementally modify the supplementary groups set. +The argument is a comma-separated list of directives: +.Bl -tag -width indent -compact +.It Cm @ +Reset the set to the empty set. +When present, must be the first directive. +.It Cm + Ns Ar group +Include a group. +.It Cm - Ns Ar group +Exclude a group. +.El +If +.Fl G +is also specified, +.Fl s +applies on the list installed by it. +In this case, the +.Cm @ +directive cannot be used +.Pq this limitation may be lifted in the future . +.It Fl -svuid Ar user +Override the saved user. +As for +.Fl u , +.Ar user +may either be a name or a numerical ID. +.It Fl -svgid Ar group +Override the saved group. +As for +.Fl g , +.Ar group +may either be a name or a numerical ID. +.It Fl u Ar user +Specify a target user. +If +.Ar user +is the name of some user in the user database, +this option establishes his full login credentials, as specified by the user and +group databases, as the baseline. +Else, +.Ar user +is interpreted as a numerical user ID, and that ID is used to set the target +user only. +.El +.Sh EXAMPLES +Run a command as another user: +.Bd -literal -offset indent +mdo -u alice id +.Ed +.Pp +Run with explicit primary and supplementary groups: +.Bd -literal -offset indent +mdo -u 1001 -g wheel -G staff,operator /bin/sh +.Ed +.Pp +Modify only supplementary groups for the current user: +.Bd -literal -offset indent +mdo -k -s +wheel,+operator /usr/bin/id +.Ed +.Pp +Emulate the effect of a set-user-ID bit on the process image file, assuming its +user ID is +.Dq root : +.Bd -literal -offset indent +mdo -k --euid root --svuid root id +.Ed .Sh SEE ALSO .Xr su 1 , +.Xr setcred 2 , .Xr mac_do 4 .Sh HISTORY The .Nm -command appeared in +command first appeared in .Fx 14.2 . +.Pp +Support for specifying or amending groups, group-only transitions and +fine-grained control of real, effective and saved variants of user and primary +group first appeared in +.Fx 15.0 . +.Sh AUTHORS +The +.Nm +program was originally created by +.An -nosplit +.An Baptiste Daroussin Aq Mt bapt@FreeBSD.org . +It was modified to use the +.Xr setcred 2 +system call by +.An Olivier Certner Aq Mt olce@FreeBSD.org , +who designed the group-related and fine-grained-control-of-target-credentials +functionalities and supervised +.An Kushagra Srivastava Aq Mt kushagra1403@gmail.com +to add them during Google Summer of Code 2025. +.Sh SECURITY CONSIDERATIONS +The +.Nm +program is geared to role-based scenarios. +Consequently, it does not ask for any password or request other form of +authentication before trying to establish new credentials, instead relying +solely on the requester's credentials for this purpose. +.Pp +Specific unprivileged uses may be enabled by using the +.Xr mac_do 4 +security policy. From nobody Thu Nov 27 00:33:34 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dGy8Z4DSyz6Ht31 for ; Thu, 27 Nov 2025 00:33: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dGy8Z3Wflz43k9 for ; Thu, 27 Nov 2025 00:33:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764203614; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lzQ5n1kwq+mFr6MfTAvbRzCR2Y75dR8CGx/aiwzA2y4=; b=eEXlIOE/OiJNAAEDtX2iRlMia2b1X2+UOStUBiHasQwo7hq6WY720CocsQd8Qo4lfSI4X7 hScba3nMePEkbDujbJIN2kkztjg7LR+J4EBxpm4d+UpXI0RnbBxzZRGTmJfyGgBtMSAe7j ac8SkS2ArBLBBGq0yxpkjT4/Dt5fsKaK8NNuVMAnixhPct6uDVOo0gHAYFV70A+iH7GqGr TOKmIHy8jfVJh9k+atX1WNqu32koplJLFdkhfKzuZS60+ueJsFxl975O+/h48fw3SxUg9C EJ5qEtVZw+rm5OFcsRXAskR7jKOneSOFLYPJeLoy6dl53S3HYuPyT4/UB7kbCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764203614; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lzQ5n1kwq+mFr6MfTAvbRzCR2Y75dR8CGx/aiwzA2y4=; b=yRsaqp9Y/4iCCLeOMvEW5WdYYoLMRuyoHVcsmAbuGWA1B0h33hmQdR3pe15GViGBzxdQh4 /H1bIa58qlIG2JrZKm3kgOxzD7jgqCtAB6sTtwBOD3HhmPPlZXjur1T5M1sQNO58Fb/gFg O+U2RnVhmTJxRrcIzqppVYnmxe4I8WDxPjIwwEtc4wVRnUzkoj7GBQA43hrq8ob590RINp yq2flo1r263zwa0zE05eYZ1jqdgXWgeQj3cy1IOgilHzCfQl2XUvtVKfX+xRmQ8Rwg7hS0 /m2AEn//qWaB7iS9R3dyCYr9fBQkHekTWT+2CA528g3qzRIfuY/OdZQoKiy45g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764203614; a=rsa-sha256; cv=none; b=oSMVwq4sal09Vu3jnjNzxhIOt7QNphTfXMpWc2W++eyQtvM48hsU7fkb9/fw1SBSd1PG6I jCTrY6wOX3gUrn6uGfdmdO/Ul1f08plRTAYY7ZHeDvq9RtEJ5708tOEfMZiB3ZnP7W2aW0 XIDbnkgGSvua9RwrWI4tdpAs3N/dGRc/yAnLzHaFUf743eitSx2FsPfmtsNcNlVtkHhoJZ xt+Sg0ln/kAcRjmDhr9ZBestOl+V7hErsE/U45932V6fdVqQtt6PMmVG9+iGBFZxRjQQfA 9xn1i5ov6JThsxUcvNJqrqWwBLR3cIJmnRtkvGhIWlMv2uea2v3PGzlrRWl/Cg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dGy8Z2x88z18ZX for ; Thu, 27 Nov 2025 00:33:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id f2b6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 27 Nov 2025 00:33:34 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 068b20e200fb - stable/15 - sound: Fix KASSERT panics in chn_read() and chn_write() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 068b20e200fbd9db5dbe102f9e0715c121b86494 Auto-Submitted: auto-generated Date: Thu, 27 Nov 2025 00:33:34 +0000 Message-Id: <69279c5e.f2b6.30064da5@gitrepo.freebsd.org> The branch stable/15 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=068b20e200fbd9db5dbe102f9e0715c121b86494 commit 068b20e200fbd9db5dbe102f9e0715c121b86494 Author: Christos Margiolis AuthorDate: 2025-11-20 15:23:09 +0000 Commit: Christos Margiolis CommitDate: 2025-11-27 00:33:08 +0000 sound: Fix KASSERT panics in chn_read() and chn_write() INVARIANTS kernels may trigger a KASSERT panic from sndbuf_acquire(), when fuzzing write(2) using stress2, because of a race in chn_write(). In the case of chn_write(), what sndbuf_acquire() does is extend the ready-to-read area of the buffer by a specified amount of bytes. The KASSERT in question makes sure the number of bytes we want to extend the ready area by, is less than or equal to the number of free bytes in the buffer. This makes sense, because we cannot extend the ready area to something larger than what is available (i.e., free) in the first place. What chn_write() currently does for every write is; calculate the appropriate write size, let's say X, unlock the channel, uiomove() X bytes to the channel's buffer, lock the channel, and call sndbuf_acquire() to extend the ready area by X bytes. The problem with this approach, however, is the following. Suppose an empty channel buffer with a length of 1024 bytes, and 2 threads, (A) and (B), where (B) is a higher-priority one. Suppose thread (A) wants to write 1024 bytes. It unlocks the channel and uiomove()s 1024 bytes to the channel buffer. At the same time, thread (B) picks up the lock, and because it is higher priority, it keeps dominating the lock for a few iterations. By the time thread (A) picks up the lock again, it tries to call sndbuf_acquire() with a size of 1024 bytes, which was calculated before it performed the uiomove(). In this case, there is a very high chance that the buffer will not be empty, that is, have a free area of 1024 bytes, as was the case when thread (A) started executing, and so the KASSERT will trigger a panic because the condition (bytes <= free) is not met. Another scenario that can trigger a panic is the following: suppose a buffer with a size of 4 bytes, and two threads: (A) and (B). In the first iteration, thread (A) wants to write 2 bytes, while the buffer is empty, BUT the pointer (sndbuf_getfreeptr()) is at the end (i.e., buf[3]). In the first iteration of the loop, because of the way we calculate t, we'll end up writing only 1 byte, so after sz -= t, sz will be 1, and so we'll need one more iteration in the inner loop, to write the remaining 1 byte. Now we're at the end of the first loop, thread (A) unlocks the channel, it has written 1 byte, it needs to write 1 more, and the buffer is left with 3 empty slots. Now thread (B) picks up the lock, and it wants to write 3 (or more) bytes. Eventually it writes the 3 bytes, and it leaves the buffer with 0 free slots. By the time thread (A) picks up the lock again, and continues with the second iteration of the inner loop, it will try to write the last byte, but sndbuf_acquire() will panic because there is no free space anymore. To fix this, get rid of the inner loop and calculate the write size on each iteration. Also, call sndbuf_acquire() before unlocking the channel. In the scenarios explained above, we'll end up entering the chn_sleep() case. Modify it as well, so that we do not kill the channel if we need to sleep more. Do the same for chn_read() to avoid possible similar panics from sndbuf_dispose(). Reported by: pho Tested by: christos, pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: pho, kib Differential Revision: https://reviews.freebsd.org/D53666 (cherry picked from commit 253b98f749cf93a9a682f46925c43cbbd04e1110) --- sys/dev/sound/pcm/channel.c | 70 ++++++++++++++------------------------------- 1 file changed, 22 insertions(+), 48 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index f29a819ce0ae..e92181d74e19 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -438,7 +438,7 @@ chn_write(struct pcm_channel *c, struct uio *buf) { struct snd_dbuf *bs = c->bufsoft; void *off; - int ret, timeout, sz, t, p; + int ret, timeout, sz, p; CHN_LOCKASSERT(c); @@ -446,24 +446,17 @@ chn_write(struct pcm_channel *c, struct uio *buf) timeout = chn_timeout * hz; while (ret == 0 && buf->uio_resid > 0) { + p = sndbuf_getfreeptr(bs); sz = min(buf->uio_resid, sndbuf_getfree(bs)); + sz = min(sz, bs->bufsize - p); if (sz > 0) { - /* - * The following assumes that the free space in - * the buffer can never be less around the - * unlock-uiomove-lock sequence. - */ - while (ret == 0 && sz > 0) { - p = sndbuf_getfreeptr(bs); - t = min(sz, bs->bufsize - p); - off = sndbuf_getbufofs(bs, p); - CHN_UNLOCK(c); - ret = uiomove(off, t, buf); - CHN_LOCK(c); - sz -= t; - sndbuf_acquire(bs, NULL, t); - } - ret = 0; + off = sndbuf_getbufofs(bs, p); + sndbuf_acquire(bs, NULL, sz); + CHN_UNLOCK(c); + ret = uiomove(off, sz, buf); + CHN_LOCK(c); + if (ret != 0) + break; if (CHN_STOPPED(c) && !(c->flags & CHN_F_NOTRIGGER)) { ret = chn_start(c, 0); if (ret != 0) @@ -483,13 +476,7 @@ chn_write(struct pcm_channel *c, struct uio *buf) ret = EAGAIN; } else { ret = chn_sleep(c, timeout); - if (ret == EAGAIN) { - ret = EINVAL; - c->flags |= CHN_F_DEAD; - device_printf(c->dev, "%s(): %s: " - "play interrupt timeout, channel dead\n", - __func__, c->name); - } else if (ret == ERESTART || ret == EINTR) + if (ret == ERESTART || ret == EINTR) c->flags |= CHN_F_ABORTING; } } @@ -552,7 +539,7 @@ chn_read(struct pcm_channel *c, struct uio *buf) { struct snd_dbuf *bs = c->bufsoft; void *off; - int ret, timeout, sz, t, p; + int ret, timeout, sz, p; CHN_LOCKASSERT(c); @@ -568,35 +555,22 @@ chn_read(struct pcm_channel *c, struct uio *buf) timeout = chn_timeout * hz; while (ret == 0 && buf->uio_resid > 0) { + p = sndbuf_getreadyptr(bs); sz = min(buf->uio_resid, sndbuf_getready(bs)); + sz = min(sz, bs->bufsize - p); if (sz > 0) { - /* - * The following assumes that the free space in - * the buffer can never be less around the - * unlock-uiomove-lock sequence. - */ - while (ret == 0 && sz > 0) { - p = sndbuf_getreadyptr(bs); - t = min(sz, bs->bufsize - p); - off = sndbuf_getbufofs(bs, p); - CHN_UNLOCK(c); - ret = uiomove(off, t, buf); - CHN_LOCK(c); - sz -= t; - sndbuf_dispose(bs, NULL, t); - } - ret = 0; + off = sndbuf_getbufofs(bs, p); + sndbuf_dispose(bs, NULL, sz); + CHN_UNLOCK(c); + ret = uiomove(off, sz, buf); + CHN_LOCK(c); + if (ret != 0) + break; } else if (c->flags & (CHN_F_NBIO | CHN_F_NOTRIGGER)) ret = EAGAIN; else { ret = chn_sleep(c, timeout); - if (ret == EAGAIN) { - ret = EINVAL; - c->flags |= CHN_F_DEAD; - device_printf(c->dev, "%s(): %s: " - "record interrupt timeout, channel dead\n", - __func__, c->name); - } else if (ret == ERESTART || ret == EINTR) + if (ret == ERESTART || ret == EINTR) c->flags |= CHN_F_ABORTING; } } From nobody Thu Nov 27 00:33:35 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dGy8c0L5Cz6HtCM for ; Thu, 27 Nov 2025 00:33: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dGy8b4yVfz43bb for ; Thu, 27 Nov 2025 00:33:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764203615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JlAcdzkG4N3puaqBf9k6bgMuh2xGlc66nf8jCb7qVZU=; b=qGCjGuMmzhr09GKlZAvUpz0VGJGtkOvzQ8VmaIdk99F5P+51vqcuTSgFejCQY1vr8QEAnf AOPC7bsW8AtaswH8Gxdn6qtAWqVzT6FYhFCmgJYaDGbxjWZhPB8X85bVqfsui/VlB/cYPg 4Mta1FbYVxIq6VqNtF1M/FCGGCWiQFBRX9iLtfTHWYk2WJGlKs5FSZ1ihD4IR+ok4xb8T0 U1kogaLyv7YEmcRvwf811hl6iCA/S/o/P6Kcx6EChnfDkG9g5h+myUoCP9MDT6Hah+79BL xFntZoUvamQT1pOjH/YY1uGiG3bgqwGUEBPEuGrqjJKXsIiM6/mZTWkDqbTVLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764203615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JlAcdzkG4N3puaqBf9k6bgMuh2xGlc66nf8jCb7qVZU=; b=ejFvpu+zd6pzmfXEJybFcxBexndnW8p5nYSrbd+K+pnRPuEs6QHJece/boKoxGgU3h90XE Lc6frGzn8179R8pweb8BRTczHaAa0urerZ9G6aeZMNZGe8YRGtA9jy+PlVO9fvuFZlcB2p nN0uvIBYcsSOctGSYyzKinc4VDbU8X6rULoUlQYfURwOUD3+ApLkwd+xyHN2zG0lKN/e4X SFkluv4bqJ/qy8jInwpgm/8Q4VYoVF67vu77TSbYh7LLqbpopkwjVix8zS2fiwFdkDJT2H kKLjGTbWs3BUuQlnbUVn6DEWoeQRSAtvPkvDqIdB6hI+2OyImB/EF8o7OXDXQQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764203615; a=rsa-sha256; cv=none; b=WMpriqm3wtwbMIoLM6Nznne8ZkCSV9mfE7LLaAOIkCCOtK02vFfewSpHzPbR7sbqemQVs2 r31+vRgjLpuyTXd8rxk4AuwfV7v8TQXFN4aLG06WST1Z5TrA3UUYKAb/n6f+SALjmgReE3 B/2Kg//wBW5TRDTXwMnzlNdrlfPB10cnv4/hNl01FbXBJ82ibFiolcTi6HyXD9Q4gQKY+e R34jEd9inRas5wcvcq8ewCgBLSsx59SXWlu9WBEAA7UwbVXaNbhsS3MN/dJoCSTR33pSMn lRSW8rLqMiuwqVHMFXSSObwzf6VNNEX0vv6YaPXVGY8PbED1LKEMCkmhWTFp8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dGy8b3lGHz18WR for ; Thu, 27 Nov 2025 00:33:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id f2ba by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 27 Nov 2025 00:33:35 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 3cf8333f877d - stable/15 - sound: Remove vchan_passthrough() and hw.snd.passthrough_verbose List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 3cf8333f877dce4eeeec850684508a7ffec99c95 Auto-Submitted: auto-generated Date: Thu, 27 Nov 2025 00:33:35 +0000 Message-Id: <69279c5f.f2ba.2845986a@gitrepo.freebsd.org> The branch stable/15 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=3cf8333f877dce4eeeec850684508a7ffec99c95 commit 3cf8333f877dce4eeeec850684508a7ffec99c95 Author: Christos Margiolis AuthorDate: 2025-11-20 15:24:49 +0000 Commit: Christos Margiolis CommitDate: 2025-11-27 00:33:19 +0000 sound: Remove vchan_passthrough() and hw.snd.passthrough_verbose Unused and confusing. Sponsored by: The FreeBSD Foundation MFC after: 1 week (cherry picked from commit 3612ef642f511a1bd9f759da87abeafe7d6ff110) --- sys/dev/sound/pcm/vchan.c | 18 ------------------ sys/dev/sound/pcm/vchan.h | 5 ----- 2 files changed, 23 deletions(-) diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c index b31e28d51453..dcb49e3003d0 100644 --- a/sys/dev/sound/pcm/vchan.c +++ b/sys/dev/sound/pcm/vchan.c @@ -47,13 +47,6 @@ #define FMTLIST_OFFSET 4 #define DIGFMTS_MAX 2 -#ifdef SND_DEBUG -static int snd_passthrough_verbose = 0; -SYSCTL_INT(_hw_snd, OID_AUTO, passthrough_verbose, CTLFLAG_RWTUN, - &snd_passthrough_verbose, 0, "passthrough verbosity"); - -#endif - struct vchan_info { struct pcm_channel *channel; struct pcmchan_caps caps; @@ -723,11 +716,7 @@ vchan_destroy(struct pcm_channel *c) } int -#ifdef SND_DEBUG -vchan_passthrough(struct pcm_channel *c, const char *caller) -#else vchan_sync(struct pcm_channel *c) -#endif { int ret; @@ -744,13 +733,6 @@ vchan_sync(struct pcm_channel *c) if (ret != 0) c->flags |= CHN_F_DIRTY; -#ifdef SND_DEBUG - if (snd_passthrough_verbose) { - device_printf(c->dev, "%s(%s/%s) %s() -> re-sync err=%d\n", - __func__, c->name, c->comm, caller, ret); - } -#endif - return (ret); } diff --git a/sys/dev/sound/pcm/vchan.h b/sys/dev/sound/pcm/vchan.h index 65b0218781fb..5d8057cd4b7f 100644 --- a/sys/dev/sound/pcm/vchan.h +++ b/sys/dev/sound/pcm/vchan.h @@ -39,12 +39,7 @@ extern bool snd_vchans_enable; int vchan_create(struct pcm_channel *, struct pcm_channel **); int vchan_destroy(struct pcm_channel *); -#ifdef SND_DEBUG -int vchan_passthrough(struct pcm_channel *, const char *); -#define vchan_sync(c) vchan_passthrough(c, __func__) -#else int vchan_sync(struct pcm_channel *); -#endif #define VCHAN_SYNC_REQUIRED(c) \ (((c)->flags & CHN_F_VIRTUAL) && (((c)->flags & CHN_F_DIRTY) || \ From nobody Thu Nov 27 01:56:13 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dGzzy0SFnz6J3kq for ; Thu, 27 Nov 2025 01:56: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dGzzx481Nz3CP3 for ; Thu, 27 Nov 2025 01:56:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764208573; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2/LUPwQxPRTSXmI808NpY0hb25+XMC30QCsmt/v+JaQ=; b=db+NF4DylzAMip+ztU3VPBGu+0iG4V7jWII1LHhl25BC5AQVY8i4pmBqqPRXN7UdpyWHdN WtxmzZp0VD0zNofjI4czqnrUN+kpevBDUrwJmO0MXd8xoESAdczEj6QRouwp9PH3+Od0l+ L8V4TKSfjZrJl4fwN8KQfi6tWnzcPO3OZOhrVZeFWX6rZfiybE+oBk5QE9d+s/0b0QEu5u Et32R1v1c1s2n9x/Ec+xXOmQsU7cn5uDkEbpJm4BMsgL+ukiJo8jk2upHwk5iqur1Tw7MT jY3uALyehc+DrHfStnYzHIjqGViKinAWB9q7dpscLcg15/7ab8Jj2DSB85jh6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764208573; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2/LUPwQxPRTSXmI808NpY0hb25+XMC30QCsmt/v+JaQ=; b=e6c0ykgSciqs34Oyx18+NsTgHs85FM3CLd5SaFjpkTfTYWPFgrO8G2kg9tFdygK1aDiu7L gL9G9pWMnGxzMAHe0bf8g2LTcycx8/tTyGRiR8P4rWUHwOwV6V8HuLQfh0B8rmkDsNl7US lQalgfglMMpj4QWGh0qIZO2IUfN0AwW/Pqfxy/7RRtVEVuWbJPBwm+l4iROUqnEW+DzoYv ebywFVqY+ggdjlm8zINhYmo8lAtUv2jTtUF0OCG2Pm+X+9EwTrhOz3s0RGTMhjHo1sYPwM MvCRxOj3ITuZYADdFRTdphnl8M9HdrH8RQFU+0XOh4xiNTLLmmIn3STTpztbbQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764208573; a=rsa-sha256; cv=none; b=JvWK1amknyTc5Y0sTa1mND8yrGAyGlezJb9zceeHQ4AB9RZBq2CaVQ3jLkV1n6qwkAwU2a ALl2CD9YnloiOY0rYPHiGGIYY/L9LTXb9aR5+UTc1JyyqPCz1ne7DnQBYgVgETiGfePGqU 2y5Ys1Kep5uPfMU3MMBw/K+6XLL/aPqGDilgMMLxf6vI4d1wcO8/LA2h0H6i18k8CJjo6l Etgoew1OuLJyCVdW2HqCa5M5BBrLKxpAGEnxeMOr67yppFvWvD/COcZ1XBO+HTWJp1Vzap VvP5dWqRVaJ20kdX0NBO3K2fEFrPa8VZwFVIb1pzEuHdsJFFB72QXqEfxj/MrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dGzzx2yBdz1B79 for ; Thu, 27 Nov 2025 01:56:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2951e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 27 Nov 2025 01:56:13 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 56275b7b0672 - stable/15 - bsdinstall: Ignore -p[0-9]+ in determining 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 56275b7b06726aa530c1bcab176d225d5d4b7893 Auto-Submitted: auto-generated Date: Thu, 27 Nov 2025 01:56:13 +0000 Message-Id: <6927afbd.2951e.2541247@gitrepo.freebsd.org> The branch stable/15 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=56275b7b06726aa530c1bcab176d225d5d4b7893 commit 56275b7b06726aa530c1bcab176d225d5d4b7893 Author: Colin Percival AuthorDate: 2025-11-26 03:33:22 +0000 Commit: Colin Percival CommitDate: 2025-11-27 01:56:02 +0000 bsdinstall: Ignore -p[0-9]+ in determining BRANCH The patch level is not part of the branch per se and should not be used in constructing the FreeBSD-base.conf file used by bsdinstall. MFC after: 1 day (cherry picked from commit d45816f369eb0099fd274fee23a3bf137ee794b1) --- usr.sbin/bsdinstall/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsdinstall/Makefile b/usr.sbin/bsdinstall/Makefile index 9a6b25fc5c7a..a576f2d0794e 100644 --- a/usr.sbin/bsdinstall/Makefile +++ b/usr.sbin/bsdinstall/Makefile @@ -16,7 +16,7 @@ FILESDIR= ${SHAREDIR}/bsdinstall FILES= FreeBSD-base.conf _BRANCH!= ${MAKE} -C ${SRCTOP}/release -V BRANCH -BRANCH?= ${_BRANCH} +BRANCH?= ${_BRANCH:C/-p[0-9]+$//} _REVISION!= ${MAKE} -C ${SRCTOP}/release -V REVISION REVISION?= ${_REVISION} From nobody Thu Nov 27 01:57:47 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dH01m1Szcz6J40l for ; Thu, 27 Nov 2025 01:57: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dH01m0MqBz3D43 for ; Thu, 27 Nov 2025 01:57:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764208668; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lL1idqUAVYX+AnDcxmZvyn5Sewc6Le93zGDRxhtn1Lg=; b=i6cANf/EcUhq0G23s++lKpR2V+4VVGn+CkO9BoHyj1C7oMNt/dh7JHgy2Oz1FQrY9e74jJ DtF1VOr9CODf0YDFH/QMnpSn1vv6BjMMG35XXAfTLUAuWzvV1jcFJl/WPdRW95KZxYCC4f 10duDyTfunGjqhBgOa4Ss+DuLqxpJMdex5IF6QvNof/SB8EFbBXeyQ5992QgIeqEZQk1Jq jsG+x6qgWSCnSWcESS0FouvrnTSmsNGsMnVE9ypATnD1WEAIdOJ5iVyWXQwRTFa6wgnXHq Pe0cfpxIzrqM6gxEsu3NMlD0gTOJS1ZfCI5mFniYnbpAtRO0BmUvyF45HeaQHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764208668; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lL1idqUAVYX+AnDcxmZvyn5Sewc6Le93zGDRxhtn1Lg=; b=TtZ/AV2xmAkusORK1WEBypR5cmSYBclQSu/k76MiTPq0sxTLW69LHktJjJBugJ4Yu+FIuR RSjAL5qbPAQShJ3R4eh6nzjZt2AKWi9VfrkeiODxDTfAPLuj2wjHyWxco+u1GHjKxW9Dcz RarFQaE0aKPWfJx73YLB/ntsMkO68SK9H+cYS0/yarrT2Q8vjtjHhFfcGtJGqft8W8DyiG y2vvKWeCicQOg8Uo09UX3By6x5mDvJwH3XcfqdsEYl47MxaXQ7JUQDEV1tz9Ca40LbHfko 2pp1RKEk6oECOEk9mDClTlL2jbSH1FBPw9lNg/JeTNB8MEBKT+qPQjtDEG/8mQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764208668; a=rsa-sha256; cv=none; b=eahfNS3aVhWWHHXAnfdV0EdzWptUF5DzrVQ0SpfA5kXomeJwGKpI18dgCujAsOGc0CUIR6 ccZuEN8s7TjXMnOyWNGWSQxuK17eB2y5tj9BX9X271yPy0JJFuw/RslmsoyRLBMSwKXIDZ L0jA26TeDs1RVL2QQD7inrwnoKBCSp4o1VEuGTCGUfvDeU/61L8El9DSAL598/5AhWu01p bGLQhX0fDph0A+74P7/veWQzwcEwn5VaLpjbvDb+xeGpCUhX7KuwrNRiXbEAS7rlbN3Lxg V/7CzQcc8rrhrcnS8TQ3hycm9Wjdh1lt0U2YfTfWhAEXe7Myak1aZNDQuRrLGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dH01l6tk7z1B5r for ; Thu, 27 Nov 2025 01:57:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2a801 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 27 Nov 2025 01:57:47 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: f73d78e3ff12 - releng/15.0 - bsdinstall: Ignore -p[0-9]+ in determining 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/15.0 X-Git-Reftype: branch X-Git-Commit: f73d78e3ff1295d3227849ac993d4b2e5f206d6d Auto-Submitted: auto-generated Date: Thu, 27 Nov 2025 01:57:47 +0000 Message-Id: <6927b01b.2a801.3cca8d7@gitrepo.freebsd.org> The branch releng/15.0 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=f73d78e3ff1295d3227849ac993d4b2e5f206d6d commit f73d78e3ff1295d3227849ac993d4b2e5f206d6d Author: Colin Percival AuthorDate: 2025-11-26 03:33:22 +0000 Commit: Colin Percival CommitDate: 2025-11-27 01:57:20 +0000 bsdinstall: Ignore -p[0-9]+ in determining BRANCH The patch level is not part of the branch per se and should not be used in constructing the FreeBSD-base.conf file used by bsdinstall. Approved by: re (cperciva) MFC after: 1 day (cherry picked from commit d45816f369eb0099fd274fee23a3bf137ee794b1) (cherry picked from commit 56275b7b06726aa530c1bcab176d225d5d4b7893) --- usr.sbin/bsdinstall/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsdinstall/Makefile b/usr.sbin/bsdinstall/Makefile index 9a6b25fc5c7a..a576f2d0794e 100644 --- a/usr.sbin/bsdinstall/Makefile +++ b/usr.sbin/bsdinstall/Makefile @@ -16,7 +16,7 @@ FILESDIR= ${SHAREDIR}/bsdinstall FILES= FreeBSD-base.conf _BRANCH!= ${MAKE} -C ${SRCTOP}/release -V BRANCH -BRANCH?= ${_BRANCH} +BRANCH?= ${_BRANCH:C/-p[0-9]+$//} _REVISION!= ${MAKE} -C ${SRCTOP}/release -V REVISION REVISION?= ${_REVISION} From nobody Thu Nov 27 01:57:49 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dH01n3cdTz6J3wx for ; Thu, 27 Nov 2025 01:57: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dH01n15VSz3D1h for ; Thu, 27 Nov 2025 01:57:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764208669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3MLxJfSt8FKhj2E1Lil4goAXzpjFmjqxVKlDZ1uePRs=; b=XyYocYZ6Kl9pwkiZLygEjcqHj8tR+lXkbp8NzPMUUhLxOItWOy0Rr3GSZgkHSDwdiI0k6/ ajwTztELYZWKh6zIpcSEK94mfY2TYdAUup10Jt2YZaIUaJ4xrasPPeRio3OgZvVmsneMgE xARE7zAlLHB2Ei/WYhJ0WCEvyDpkFn339mH0eqe10VcDdWVApuTK5bXmexchrTy6k2J4eC 7bBvrgumLYlXCwvqC8y3fPOl0IO5UsA4iSFe+nBzEycmE5i0dR3yqE+lAvzeB66QhuJmZk DmqL3LZCKnCy0V2JWubdnW7Lwl85BOdGM+nxVs/WXM/dtKWiNhknxr5uN9GF9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764208669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3MLxJfSt8FKhj2E1Lil4goAXzpjFmjqxVKlDZ1uePRs=; b=yzomXfhLclDZ1j67oqT0gZEu291Fw5QiPwvPAN9NwoQQkyvlB++u8TAryBFiErpGLaUNYg 2+DpvoTWUpUgnYdInvxX1WrVmjENHTX5osshNsj5fWjp803/RfDGMWZSfdtkLnOO8C9RJT anX7qTYQdOwOLi7Em1fYdcm/vWzY/OozJLbvERp+qo4wZ7enNiwYGQEOpTNRtNxobHKpUU L2GyUzc4jX3FJNeBXjat80zTm1PjuIzQ0/UlOWlwbzjfl13Fx8C55ECBTtJPIsH0xr4FJk 44SGr2wMBM2cix3db2WiFaipuC76ZtZYsFF0fFxGSYrnS5Gr6cdwIdEWdE6MeA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764208669; a=rsa-sha256; cv=none; b=kMyBMBu+j9TaG750+jRTB4o06tCVzpuRRtTr8WyHIpEApYXKsQRwW0PQw+H0fv7RwNCtZN 0yoVVZiNXZ/zxmlnPgYQEm2HpcW7Yzp+Ly4yWVTn6fKEziWs8FmYoWXikw7ocUupuK465K GS8nByBbYcT7/OC+hMWHrlExjPWJW1mCD4zqjOJPPjdiwQz9Kzn5Y1XSXJrG9ZBQCa7dXE pb0RzO6nkCLWlkdBdAAMZ1TUV7VfxQXTsNf2bQ8A0l72coWNZKxxRDvDTaoC54fImDVDaF dkQ3JntptxdEFbuYROYA/z5iW++/yhcTB6sMTTTwGI9VYeLUxLZZCCgThuZFTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dH01n0dQlz1BN8 for ; Thu, 27 Nov 2025 01:57:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 29421 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 27 Nov 2025 01:57:49 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Olivier Certner From: Colin Percival Subject: git: 20ebb6ec5ac0 - releng/15.0 - mdo.1: Document group-related and fine-grained control functionalities List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/15.0 X-Git-Reftype: branch X-Git-Commit: 20ebb6ec5ac0745fe063bd315bd953312bfcb1a2 Auto-Submitted: auto-generated Date: Thu, 27 Nov 2025 01:57:49 +0000 Message-Id: <6927b01d.29421.4c941264@gitrepo.freebsd.org> The branch releng/15.0 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=20ebb6ec5ac0745fe063bd315bd953312bfcb1a2 commit 20ebb6ec5ac0745fe063bd315bd953312bfcb1a2 Author: Olivier Certner AuthorDate: 2025-09-01 15:24:54 +0000 Commit: Colin Percival CommitDate: 2025-11-27 01:57:24 +0000 mdo.1: Document group-related and fine-grained control functionalities This is a manual page update describing the functionality that was added to mdo(1) in commit 3ca1e69028ac ("mdo(1): Add support and shortcuts for fully specifying users and groups"). Please either refer to that commit or the new manual page's content for more information. While here: - Add to the introduction a description of process credentials and some specific vocabulary that is used throughout the page, as well as the relationship between mdo(1) and mac_do(4). - Update the HISTORY section. - Add AUTHORS and SECURITY CONSIDERATIONS sections. Approved by: re (cperciva) Reviewed by: ziaee MFC after: 1 minute Sponsored by: The FreeBSD Foundation Sponsored by: Google LLC (GSoC 2025) Co-authored-by: Kushagra Srivastava Differential Revision: https://reviews.freebsd.org/D53905 (cherry picked from commit 73dd00f2fd7de2a5d8dda8fa25ebcd7c8964ff52) (cherry picked from commit dc75034792739a638edf3d7b756e7175e5a79bf7) --- usr.bin/mdo/mdo.1 | 269 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 245 insertions(+), 24 deletions(-) diff --git a/usr.bin/mdo/mdo.1 b/usr.bin/mdo/mdo.1 index c4586f628661..1de694c69e40 100644 --- a/usr.bin/mdo/mdo.1 +++ b/usr.bin/mdo/mdo.1 @@ -1,49 +1,270 @@ .\"- -.\" Copyright(c) 2024 Baptiste Daroussin -.\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.Dd May 26, 2025 +.\" Copyright (c) 2024 Baptiste Daroussin +.\" Copyright (c) 2025 Kushagra Srivastava +.\" Copyright (c) 2025 The FreeBSD Foundation +.\" +.\" Portions of this documentation were written by Olivier Certner +.\" at Kumacom SARL under sponsorship from the FreeBSD +.\" Foundation. +.\" +.Dd November 26, 2025 .Dt MDO 1 .Os .Sh NAME .Nm mdo -.Nd execute commands as another user +.Nd execute commands with specific credentials .Sh SYNOPSIS .Nm -.Op Fl u Ar username +.Op Fl u Ar user | Fl k .Op Fl i -.Op command Op args +.Op Fl g Ar group +.Op Fl G Ar group1,group2,... +.Op Fl s Ar groups_mod1,groups_mod2,... +.Op Fl h +.Op Fl -ruid Ar user +.Op Fl -svuid Ar user +.Op Fl -euid Ar user +.Op Fl -rgid Ar group +.Op Fl -svgid Ar group +.Op Fl -egid Ar group +.Op -- +.Op Ar command Op Ar args ... .Sh DESCRIPTION The .Nm -utility executes the specified +utility executes the passed .Ar command -as user -.Ar username . -.Pp -If no -.Ar username -is provided it defaults to the -.Va root -user. -If no +with the requested process credentials or, if no .Ar command -is specified, it will execute the shell specified as -.Va SHELL -environnement variable, falling back on -.Pa /bin/sh . +was specified, the program whose path is the value of the +.Ev SHELL +environment variable or +.Pa /bin/sh +if that variable is unset. +The calling user must either be the superuser +.Pq effective user ID of 0 +or the credentials transition from the caller's to the requested ones must be +authorized by a MAC module such as +.Xr mac_do 4 . +The target process credentials are applied atomically using +.Xr setcred 2 . .Pp +Process credentials comprise the real, effective and saved user IDs, the real, +effective and saved group IDs, hereby called the +.Dq primary +groups, and the supplementary groups as a set of group IDs. +Below, the +.Dq user +phrase implies that the real, effective and saved user IDs all have or are going +to be set to the same value. The +.Dq primary group +phrase is used similarly with respect to primary groups. +.Pp +The target process credentials have to be fully specified, either explicitly by +listing all attributes and their requested values, or indirectly by establishing +a baseline that provides a default value for each attribute, which can then be +amended by additional options. +.Pp +Possible baselines are either the full set of credentials established at login +for a specific named user, the current credentials, or the current credentials' +primary and supplementary groups which implies some user is specified +explicitly. +They are respectively established by using either option +.Fl u +with a named user argument, option +.Fl k , +or option .Fl i -option can be used to only call -.Fn setuid -and keep the group from the calling user. +in conjunction with +.Fl u +or no other options. +If no other option than +.Fl i +appears, a default of +.Fl u Cm root +is implied. +.Pp +The primary group can be set or amended with option +.Fl g , +whereas the supplementary groups can be either fully replaced with an explicit +list using option +.Fl G +or amended through set-like operations with option +.Fl s . +.Pp +Any of the individual real, effective and saved user and group IDs can be +overridden separately if desired through the options +.Fl -ruid , +.Fl -euid , +and +.Fl -svuid +for users, and +.Fl -rgid , +.Fl -egid , +and +.Fl -svgid +for groups respectively. +.Pp +The options are: +.Bl -tag -width indent +.It Fl -euid Ar user +Override the effective user. +As for +.Fl u , +.Ar user +may either be a name or a numerical ID. +.It Fl -egid Ar group +Override the effective group. +As for +.Fl g , +.Ar group +may either be a name or a numerical ID. +.It Fl G Ar group1,group2,... +Set or replace the full set of supplementary groups. +As for +.Fl g , +groups can be specified by name or numerical ID. +Groups must be separated by commas, and spaces around commas are not allowed. +.It Fl g Ar group +Set or amend the primary group. +.Ar group +may be the name of a group in the group database, else will be interpreted as +a numerical group ID. +.It Fl h +Display usage information and exit. +.It Fl i +Uses the current credentials' primary and supplementary groups as the baseline. +If no other option is present, the target user is assumed to be +.Dq root . +Otherwise, +.Fl u +or +.Fl k +must be specified. +.It Fl k +Use the current credentials as the baseline. +Incompatible with +.Fl u . +Implies +.Fl i . +.It Fl -ruid Ar user +Override the real user. +As for +.Fl u , +.Ar user +may either be a name or a numerical ID. +.It Fl -rgid Ar group +Override the real group. +As for +.Fl g , +.Ar group +may either be a name or a numerical ID. +.It Fl s Ar groups_mod1,groups_mod2,... +Incrementally modify the supplementary groups set. +The argument is a comma-separated list of directives: +.Bl -tag -width indent -compact +.It Cm @ +Reset the set to the empty set. +When present, must be the first directive. +.It Cm + Ns Ar group +Include a group. +.It Cm - Ns Ar group +Exclude a group. +.El +If +.Fl G +is also specified, +.Fl s +applies on the list installed by it. +In this case, the +.Cm @ +directive cannot be used +.Pq this limitation may be lifted in the future . +.It Fl -svuid Ar user +Override the saved user. +As for +.Fl u , +.Ar user +may either be a name or a numerical ID. +.It Fl -svgid Ar group +Override the saved group. +As for +.Fl g , +.Ar group +may either be a name or a numerical ID. +.It Fl u Ar user +Specify a target user. +If +.Ar user +is the name of some user in the user database, +this option establishes his full login credentials, as specified by the user and +group databases, as the baseline. +Else, +.Ar user +is interpreted as a numerical user ID, and that ID is used to set the target +user only. +.El +.Sh EXAMPLES +Run a command as another user: +.Bd -literal -offset indent +mdo -u alice id +.Ed +.Pp +Run with explicit primary and supplementary groups: +.Bd -literal -offset indent +mdo -u 1001 -g wheel -G staff,operator /bin/sh +.Ed +.Pp +Modify only supplementary groups for the current user: +.Bd -literal -offset indent +mdo -k -s +wheel,+operator /usr/bin/id +.Ed +.Pp +Emulate the effect of a set-user-ID bit on the process image file, assuming its +user ID is +.Dq root : +.Bd -literal -offset indent +mdo -k --euid root --svuid root id +.Ed .Sh SEE ALSO .Xr su 1 , +.Xr setcred 2 , .Xr mac_do 4 .Sh HISTORY The .Nm -command appeared in +command first appeared in .Fx 14.2 . +.Pp +Support for specifying or amending groups, group-only transitions and +fine-grained control of real, effective and saved variants of user and primary +group first appeared in +.Fx 15.0 . +.Sh AUTHORS +The +.Nm +program was originally created by +.An -nosplit +.An Baptiste Daroussin Aq Mt bapt@FreeBSD.org . +It was modified to use the +.Xr setcred 2 +system call by +.An Olivier Certner Aq Mt olce@FreeBSD.org , +who designed the group-related and fine-grained-control-of-target-credentials +functionalities and supervised +.An Kushagra Srivastava Aq Mt kushagra1403@gmail.com +to add them during Google Summer of Code 2025. +.Sh SECURITY CONSIDERATIONS +The +.Nm +program is geared to role-based scenarios. +Consequently, it does not ask for any password or request other form of +authentication before trying to establish new credentials, instead relying +solely on the requester's credentials for this purpose. +.Pp +Specific unprivileged uses may be enabled by using the +.Xr mac_do 4 +security policy. From nobody Thu Nov 27 15:57:22 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dHLfV3hwcz6HVjJ for ; Thu, 27 Nov 2025 15:57: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dHLfV1kK5z44Fn for ; Thu, 27 Nov 2025 15:57:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764259042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3SoUQU3eZCvIy6WhEvF2pckmHEboYBMQxjWAIKgAZwo=; b=t7yd/BvC0QDJqVoN22K9imJs6fYp5czmt30LWH8Ik4h0H+ZaUjeoeH6E7T6gFBtu+PGLhL zkqJ90xu+YiXiUFIgwSYl1T0fHA7tj3RpeYsPsoN+5w6IW/avEUdvMc0Jkr6zXU39eQP3G iwLuk+P+fie15iDILpAXwba1PFOdzWwjP8CBaIaxzn5MiDDcv9NU5Qf5N+V3qmD2KTmpDA C/hBaESblLrv7yfNlNd2AMUs86Ffka4CYRio1zmOVH0SNQF/WYv4Vldaw3SbL0iTTsEmoP 2x7K2uO6xPrAK1FGrx06lqDCJwEHfNiqhPzUD+MbVNAapVMKzlzwAVvH7bwbcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764259042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3SoUQU3eZCvIy6WhEvF2pckmHEboYBMQxjWAIKgAZwo=; b=t7AUd9lvh0jw5V+G98wWZVy1zSid9GSyPtRuLYmn6z4G8IYvg8eVWbIylgof/E+sEsLCuC 5P4hkhwU26YRMcayVM6hQ1owTqhSgqIV171XENlwcgf5a4nQugzZ0QKAJzjjgnxvueOuLF yl1i3pnHhTz0Q5RhQtj/e3hAK8/LyqXpT3pZXEMxX7nTrUWsaAvcVWEvNdERNHZcP7LGCV FTQ8hGca7lltwbY+yCb/Jv6U6zMwmELBs3nyORpACgjm7TgoesjVoU/R/2h8E6a9iIdo0Z UU77/lBVu2UOaW4hzfx1Bo2ERtV5IoOfiQpfublHSI5RiTU90yZHLuzOxP/+Pw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764259042; a=rsa-sha256; cv=none; b=iRc1iF7Agg76qItmuCDpKSbGLtFUyH8GmtqZNlt6EMTMV6WgmfRzQWMTevUTd06GzndAVS IsPmCn3bRXCHq29FtuUh0Yf7BOGvR2Kd9fvWewnLXIHBnXAEnhLJa5IlgoH5+Oaw0Er9Oe I0hvqso2wwcudPKATyfl/dp7T8CroeKadNgYjMDsWOlR2hCBT4e8te/Go/+/mw3OMzWh33 TyDntrnPWh/5fLfWxzQRrADu6bV2iqgC92k/M2ld2baN+qu8zkB1NOlci4b4tnfihHCRvF tGPwgRtJ2/7S9mDqEl6aayY73L+hwf1wRL3bU7ZtQQb7+OfP7vjL5Eq9vRRQUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dHLfV0kkSz6TB for ; Thu, 27 Nov 2025 15:57:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 35e47 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 27 Nov 2025 15:57:22 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 56114d2a68d9 - stable/15 - max_align_t: apply alignof to 'long double' for long double alignment List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 56114d2a68d9bcf86322fa6642be2af0e2fd183a Auto-Submitted: auto-generated Date: Thu, 27 Nov 2025 15:57:22 +0000 Message-Id: <692874e2.35e47.23dfdd65@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=56114d2a68d9bcf86322fa6642be2af0e2fd183a commit 56114d2a68d9bcf86322fa6642be2af0e2fd183a Author: Konstantin Belousov AuthorDate: 2025-11-19 14:51:54 +0000 Commit: Konstantin Belousov CommitDate: 2025-11-27 15:56:57 +0000 max_align_t: apply alignof to 'long double' for long double alignment (cherry picked from commit 39cad8402d19f361cb8d489a3a69ff94b643c6df) --- sys/sys/_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/_types.h b/sys/sys/_types.h index fe345b43d5eb..6b70b8dc6e32 100644 --- a/sys/sys/_types.h +++ b/sys/sys/_types.h @@ -183,7 +183,7 @@ typedef struct { __attribute__((__aligned__(__alignof__(long long)))); #ifndef _STANDALONE long double __max_align2 - __attribute__((__aligned__(__alignof__(long long)))); + __attribute__((__aligned__(__alignof__(long double)))); #endif } __max_align_t; From nobody Thu Nov 27 22:09:46 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dHVwC3xylz6JFZB for ; Thu, 27 Nov 2025 22:09: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dHVwC1GCbz3hKy for ; Thu, 27 Nov 2025 22:09:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764281387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Rb9zN/zC+z3viyIh1sEAgj6hNP63Ya3d7gNVo37Kx88=; b=nHNlYMW3EKF/A1Egn28eBbzy8u3UKjj/I/m0odHhdOAT4VT9qBpDw3lSgsupQbOLvq1AEV +/4k2TfMpwJDuLk4LTN8HRTcw9k5xxTYBoz8btjPa0lXzFdOudZBieFa8Gxn25NBgAq7uj DfBQzxn+9A9tULp3aOMlXFCDTMVh0LLX8mm4dY9+TsmLcX7IUajh5NBaKh0ySvriDyJx2F wMIcEf/v7Gjfv8nYs2kziO4hdrj1W60RZzt/8TDmniuts/7elG9hS7LJCLV+hAY2as9ew6 4TM8qBzv+d/Iyk4Uz1vkdJHSNO4qpy8qnVvqM7OjOd5933Rb6g0BJ2CJZBTYjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764281387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Rb9zN/zC+z3viyIh1sEAgj6hNP63Ya3d7gNVo37Kx88=; b=Boxl3RZAhtRLBMnK1cIUJmo94ZZ29dMLcQfZLsoJuhhQ+YbW1PRIb1KuPSevhvIWdhNA71 Zud/1h0LTP87K3fxrsL+8KegK+I/VIenVFzqNZAAMR+OOf7XNQGOX3iBADHSk1eZEN/J1K 0/g8NCNuyF7s5szuR8KJSvWxZWQcKwhJlfjE5xuJp2P4PfpNqLLV96RVo7j27Wcf7qEGTT wABZT8Qv39LjCT5zdwWfY7VWN/6QF6jLI/e81forzL3kAk2TR5EbqKiH5al5vyPehevKyl mg/Qg3pLQ+T2NUBNZlPJSLOmJjQqA1TWl42q0KVCr7THd7pSxH2dqOUh7GixeQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764281387; a=rsa-sha256; cv=none; b=B2x1N8Jl72Bos18F1i6VfvC6LVOnELLRFCfg7xKOGXbIo5jLXUU7NaHKwznMVgCfGHYCTc DJu9VnsGjtSbiZxzDZOx17t9/X/d3HZq59z2qQwm8lKcRJrWbikYKpKaxv3cNzHM5ZgIfP 6QjjecXXqM1Oq0G/V36ST8HB/SBr9Cy7uBKuKaYTNwnE+Vs/aVr5/jl2ErkU7JhwPgXimH bwFnTDu+8pyMDs5Qyl3C8mCdl11XjKiYDuvpIPIplZSdcwK56X8PJfyfOILu4xkW8K0gk5 s6XBm/iG8DxRl/50VE0EoXXnhVhUqIxEMolfWlb3zaa9BKnz4Ldh63KORgxpfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dHVwC00trzZmh for ; Thu, 27 Nov 2025 22:09:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 328eb by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 27 Nov 2025 22:09:46 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Philip Paeps Subject: git: d4e9c5ac6eab - Create tag release/13.5.0-p7 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/tags/release/13.5.0-p7 X-Git-Reftype: annotated tag X-Git-Commit: d4e9c5ac6eabed5bbf25e00edb0884e89afa4209 Auto-Submitted: auto-generated Date: Thu, 27 Nov 2025 22:09:46 +0000 Message-Id: <6928cc2a.328eb.5800cc53@gitrepo.freebsd.org> The annotated tag release/13.5.0-p7 has been created by philip: URL: https://cgit.FreeBSD.org/src/tag/?h=release/13.5.0-p7 tag release/13.5.0-p7 Tagger: Philip Paeps TaggerDate: 2025-11-27 22:07:12 +0000 Tag FreeBSD 13.5-RELEASE-p7 commit 4fc17862cb506bfe121c293500177e8447120068 Author: Gordon Tetlow AuthorDate: 2025-11-26 16:12:10 +0000 Commit: Gordon Tetlow CommitDate: 2025-11-26 16:12:10 +0000 Add UPDATING entries and bump version. Approved by: so From nobody Thu Nov 27 22:12:11 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dHVz00fmXz6JFxq for ; Thu, 27 Nov 2025 22:12:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dHVyz6Mpzz3jY0 for ; Thu, 27 Nov 2025 22:12:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764281531; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hida/O4DC3mZNjUy1UE5rdqzSjGBy56/tuTZ20gg0aM=; b=VLrwkyH/SiOuKgDYqvkqUe1z2Tx3M6Kz0G2EwLE5kOC4w91BgrXhXePjq/0PoWowd479qz Qzvej6dfTzQ5FSFUom/91F/+W91pdAewpMlL+7OGiomXxYjX8fdmhx9nXDsaajyHve7Kat Ix17+qTen22SUYD0RCmQETGCl/SqRnQrl9uKw7lcw2EMnaZ+cS5qQBWqavvxItmr6ehz/E zxze1P/YIv84GDz/oCXUT8q9dCkh2xYL1QzeA11HDFAaTVR7bbD2ONniHv1BcBU/RpbMGL YnOeyqAjxrkzX9+LJYBD1RQ1FjSveOdVUlPejSGnc8/QQIdxPtVAUINATlc1gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764281531; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hida/O4DC3mZNjUy1UE5rdqzSjGBy56/tuTZ20gg0aM=; b=HAM/2TJHXC7aDJyHDLq4prkY2wEX3hSUhpaWWOawJKeRCPBHjSt4MC668ogPE/D+wYAj4i 7m2OtrJu6tP1hEu66/tpzyGBaB4xKaAkLLA2o4lMbxk6ryf9Mo4SgOyzoZ/V6WqQkklOp3 UfgzcRqYSOtk/pqvyHELzIZxzKV6PxYVDpqKZpWPkHd8lMlodKUiyjOi20lESNKv99h4T/ AuednNXccSFWlcpsLDY9OwNDVzUMYqmF3XvZpf7pqzWCFitT3qorJFez5EXmhvpjVlBamC +5U8IGSi/sDL17VRgzXdBu3rQ1pWHaGL9Dty+YFBbHXM8D8rA7myT3Ly2c3ssQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764281531; a=rsa-sha256; cv=none; b=bIAtZ/ZAvYmaPXcbJJwvxNyKhRsvbzHLBoZX8Z7T+Xef+VLBz/m7LaCP5z+9A8rDFkljXY mrrQd45i7Qqyg2hCL6ihvI0K5UZCn0A+g/VkPEKoUbJHyteE+a4P4g1XhNpDitOX/MPScb KLyYOqkzDPWYQe97KZgW7USEv7NzCer40S1NJKuPCnaV1shcBqG7TouhAcjADvmkewlczu LmqyOpdME/l9qOGINee8XVLEvPHjr/nc+PR74Crj/M+Rhcz2/Z3QMFQ1dZ1l8J8Ida9TF2 IGEfMWQiy4BXBHrhv5NN/VPKDHm00vKQDOw9FiEW30mqOspnOX6xkiEkvUHbWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dHVyz5ddpzbMR for ; Thu, 27 Nov 2025 22:12:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 35adc by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 27 Nov 2025 22:12:11 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Philip Paeps Subject: git: d091602e3e89 - Create tag release/14.3.0-p6 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/tags/release/14.3.0-p6 X-Git-Reftype: annotated tag X-Git-Commit: d091602e3e89857013949ff86ee814d373e86c97 Auto-Submitted: auto-generated Date: Thu, 27 Nov 2025 22:12:11 +0000 Message-Id: <6928ccbb.35adc.7678d90f@gitrepo.freebsd.org> The annotated tag release/14.3.0-p6 has been created by philip: URL: https://cgit.FreeBSD.org/src/tag/?h=release/14.3.0-p6 tag release/14.3.0-p6 Tagger: Philip Paeps TaggerDate: 2025-11-27 22:09:54 +0000 Tag FreeBSD 14.3-RELEASE-p6 commit 476b20984a6fed7e966f7b790444e23700603b6b Author: Gordon Tetlow AuthorDate: 2025-11-26 16:12:27 +0000 Commit: Gordon Tetlow CommitDate: 2025-11-26 16:12:27 +0000 Add UPDATING entries and bump version. Approved by: so From nobody Thu Nov 27 22:39:22 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dHWZL2YL4z6JJpP for ; Thu, 27 Nov 2025 22: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dHWZL1wbXz3lwL for ; Thu, 27 Nov 2025 22: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=1764283162; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NG0kC+6AN/LOuvaOd5I2Sqx2EPTDAR7litRqF5g+gDQ=; b=oFh9/jQEJkQPptCwyzatqmUFbvBuQvCTSa33EKbo2w/hhJz6zPscwPgwpM0hRYGWXeOEzu 7A+D6J/W3VKzq0BmeJCe+OuUyf9WA+u6HObD8vkQoE0YQxgiErE0i2/+wQijtAq/khSSLS NE+k3aXofW24qPNCI1DCXPlv+Zl7wEub+/Lz60gvbJVC9vssdhLGzBSSY0uQUlHEeiWBhQ nTEJ5aK5PD12M9tbvVEW5LdyfBKM+odyJ3NgSJ5m4YVzIpMF3dcpdxREMZw4N8gcX90tOt tlYkHM8+4i6wohZm1lbuywDr3f9hW4xmJ8/5zCGaz6wTDCugDUe6u74F0UH1ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764283162; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NG0kC+6AN/LOuvaOd5I2Sqx2EPTDAR7litRqF5g+gDQ=; b=AOU/vD82KVZfp0uW/HMnAYqpkFrCZ/OyGu4iyJIYNSICLGttUSenNV9WEcRT6F9S4PpwNi xzecpY3wGZN0N8qyyzGHm/HdR8MKBiwQfwi6cTBnI1Hms/GtSmSsl0V+yVLOEY6FaH89sJ VhF9qLZ48U/lMqcv9EpB0/qzYnopfILfSpNhfI9bLoK2gp1wPjZqyRTezrzQmT/ksBg7pW mjXbAByaPAbVZrY55FPW4H4apsaQQ3OErOnstscGrysktz989CTgI/shxrNNZmFD03saJ9 AWR8LcP5Ot39+b+wuDGx5NRpCr4qjadQjcxEntvD+4kCk/7cFG5axUsy++l6hA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764283162; a=rsa-sha256; cv=none; b=I39dw7YAYzVrj/Z2Lmf1PMi/Cjb3qakjqn26iHganewaP3hhnIWUQvoI1QyseUyX+6djc9 +bHuAaZ99rUf9dTRiMf2nXYt256FvHE/ddFpevX1GwVmXg5UCcwobxrujxMCuio/QiEsJv dJfJChqhGxY210PCBCorn/SzEEWtLP3r3kqlYtYZCnuWFqlUzq6NZn+SC2yc0CK0mhrEr9 YWxgRWH5cXsmo9GOymx6t+ziNDR6Uzp0h2HhuVjF1kq77Tbo57n7+T8IAfZRuIQPPpwxwY uFrLX5I1xjagWNzRsqhdnFEygMcplbmWUXI3CbPlmzr8Rtp6P+Yi9oOauog7dw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dHWZL1T5gzc58 for ; Thu, 27 Nov 2025 22:39:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 365e2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 27 Nov 2025 22:39:22 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 0c87d29a54da - stable/15 - pkg: Move FreeBSD-base to pkg.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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 0c87d29a54da527b2f624cf4d2999ebeb9885f15 Auto-Submitted: auto-generated Date: Thu, 27 Nov 2025 22:39:22 +0000 Message-Id: <6928d31a.365e2.5999f94d@gitrepo.freebsd.org> The branch stable/15 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=0c87d29a54da527b2f624cf4d2999ebeb9885f15 commit 0c87d29a54da527b2f624cf4d2999ebeb9885f15 Author: Colin Percival AuthorDate: 2025-11-27 21:30:10 +0000 Commit: Colin Percival CommitDate: 2025-11-27 22:39:16 +0000 pkg: Move FreeBSD-base to pkg.freebsd.org Rather than fetching packages directly from the CDN which currently backs pkgbase.freebsd.org, requests will go to pkg.freebsd.org mirrors and be 302ed to the correct servers. This adds ~70 seconds to the process of installing or upgrading a pkgbase system; it also orphans systems with 15.0-{PRERELEASE,ALPHA*,BETA*} installed since they are expecting to see pkgbase files signed with the pkg keys, not the new pkgbase signing keys. Reviewed by: dch, philip MFC after: immediately (for 15.0-RELEASE) With hat: re Requested by: clusteradm, core Differential Revision: https://reviews.freebsd.org/D53964 (cherry picked from commit a3b0902d73901e7243103e60cf78c53cd7f566a1) --- usr.sbin/pkg/FreeBSD.conf.quarterly-release | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/pkg/FreeBSD.conf.quarterly-release b/usr.sbin/pkg/FreeBSD.conf.quarterly-release index 035d0ae976b9..47183d41dc6d 100644 --- a/usr.sbin/pkg/FreeBSD.conf.quarterly-release +++ b/usr.sbin/pkg/FreeBSD.conf.quarterly-release @@ -24,7 +24,7 @@ FreeBSD-ports-kmods: { enabled: yes } FreeBSD-base: { - url: "pkg+https://pkgbase.FreeBSD.org/${ABI}/base_release_${VERSION_MINOR}", + url: "pkg+https://pkg.FreeBSD.org/${ABI}/base_release_${VERSION_MINOR}", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkgbase-${VERSION_MAJOR}", From nobody Thu Nov 27 22:41:39 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dHWcz6lLkz6JK8Y for ; Thu, 27 Nov 2025 22:41: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dHWcz5zQdz3mfK for ; Thu, 27 Nov 2025 22:41:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764283299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lTmZhpY79B64uL2wS4eMumCZORKs5u60eo8+2fU1Nqw=; b=Q3kgYmdT3kkxz6GRcfScSxK52Xh98H6XGLQEYk8he0OZTZ2zyvQz34bIo0HHgxlfdOaQhM bJdrU7ofmlpJA2pmKcdgixwlgyf4JVcbE8hwXVr6FhKEc9NDMCcmQRWgYPpwadSnJPYKGy PgC9XHdDmwnJKPMqLcedx3XZnhEA0z7p3PmG6T7aN1sk1fgwlK14yEddtoEY08/qA1JaJg IeOKpKvtFSmKYX11Fc9bWbCNmKoZrzfMH8WLEyZ26KYMdaoQd612Yf2wxN5umCMnhfRI7+ 4ncNp3hmkWgaaiKRSa0SXSNN+7OqlcjvQSeO1I16f/aVKPwPG9YvNg1ZMEy9zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764283299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lTmZhpY79B64uL2wS4eMumCZORKs5u60eo8+2fU1Nqw=; b=hSoyY7ct27L+d0eTX88zPpYISFPpMzdwxc09jZUgG6thflUTCVioel03RQsSS+lqc5g9ve B9ukA8u73SlqzQzq/LImsgf6ZYSx9OCc/PrvXhJsH6ySfCa1Fjk8F9OKcDV+JWYtNZHQp6 rwshA4L9ULfNSYnJhJ9Uwk2DbBXFV780cTiZiGgh9OPeoy+mfL29REyeu0W0ox3ZGknn1w 7okQsgCs/qE0YfPdtbxP0LDrq9UwHnqrSYzPlLjogO9sLf63hFF2YxW6VsZvUWqGjmCpQM /HI+QiMAtx4q8A8HVcB+D3t1fiCzE8ar0I/7tvn+KPocILGF4q7y7+KG+MNVvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764283299; a=rsa-sha256; cv=none; b=Rf4yFA54QJ7VbOVPY9P5zbR19gVuVO63xnBF03A1mCcOXzdw6vSRIR7GrZbZ0cvnikCZaT pfIsUwqDxqArRHvpVaJiasD2fSyXbq5T++QwgvWW9qWIYPmfW2UhFI4IjIpWUQJvmPn3+X 6DbUclnkK2oHlJqrz4quffWd8yUTYtf0YlseAz5z0Eobzcei4q1h63zVJXhIq7jYVu5MGf gQhc0RDpiiKRAIR1Z2I00fBRcGBDMVsVxYQb7xGkLPSafLAuHVX7qEpuwXGwUmmk/kZr0U kr+kMEvZcyxeAPgpMRdarOaBvtMLchTY6z/hrFviRY7I/DPCArLEuAMKjly5Gw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dHWcz5JZHzbx7 for ; Thu, 27 Nov 2025 22:41:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 8cda by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 27 Nov 2025 22:41:39 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 463cec10a5fb - releng/15.0 - pkg: Move FreeBSD-base to pkg.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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/15.0 X-Git-Reftype: branch X-Git-Commit: 463cec10a5fba0b42db7bf699b21e569f2fd6459 Auto-Submitted: auto-generated Date: Thu, 27 Nov 2025 22:41:39 +0000 Message-Id: <6928d3a3.8cda.3204d84b@gitrepo.freebsd.org> The branch releng/15.0 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=463cec10a5fba0b42db7bf699b21e569f2fd6459 commit 463cec10a5fba0b42db7bf699b21e569f2fd6459 Author: Colin Percival AuthorDate: 2025-11-27 21:30:10 +0000 Commit: Colin Percival CommitDate: 2025-11-27 22:40:59 +0000 pkg: Move FreeBSD-base to pkg.freebsd.org Rather than fetching packages directly from the CDN which currently backs pkgbase.freebsd.org, requests will go to pkg.freebsd.org mirrors and be 302ed to the correct servers. This adds ~70 seconds to the process of installing or upgrading a pkgbase system; it also orphans systems with 15.0-{PRERELEASE,ALPHA*,BETA*} installed since they are expecting to see pkgbase files signed with the pkg keys, not the new pkgbase signing keys. Approved by: re (cperciva) Reviewed by: dch, philip MFC after: immediately (for 15.0-RELEASE) With hat: re Requested by: clusteradm, core Differential Revision: https://reviews.freebsd.org/D53964 (cherry picked from commit a3b0902d73901e7243103e60cf78c53cd7f566a1) (cherry picked from commit 0c87d29a54da527b2f624cf4d2999ebeb9885f15) --- usr.sbin/pkg/FreeBSD.conf.quarterly-release | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/pkg/FreeBSD.conf.quarterly-release b/usr.sbin/pkg/FreeBSD.conf.quarterly-release index 035d0ae976b9..47183d41dc6d 100644 --- a/usr.sbin/pkg/FreeBSD.conf.quarterly-release +++ b/usr.sbin/pkg/FreeBSD.conf.quarterly-release @@ -24,7 +24,7 @@ FreeBSD-ports-kmods: { enabled: yes } FreeBSD-base: { - url: "pkg+https://pkgbase.FreeBSD.org/${ABI}/base_release_${VERSION_MINOR}", + url: "pkg+https://pkg.FreeBSD.org/${ABI}/base_release_${VERSION_MINOR}", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkgbase-${VERSION_MAJOR}", From nobody Fri Nov 28 00:00:04 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dHYMS5nQmz6JRvM for ; Fri, 28 Nov 2025 00:00:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dHYMS5C9yz415T for ; Fri, 28 Nov 2025 00:00:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764288004; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5p9JD16QuXEAo6xtMB6UaMw4nfoU8FtoBvuxCRv3PQ8=; b=UBORIU1mwedpdMC5/PPXjj4bBu1dHKPT1UaFxG829Vwb8wfbi5stAVS9HBDG2o/VazyQ1X A1cSFeRp+pvT01FrC9IG4D4Od39KKlRK5eHMVF6zmq1d/BV8OVl0cHjazlrlDUtulBt86L J+efFz3BoxGEOcChjDhkuC2c5s/kay9gUSJdgQaovbN4gPUt1iQWQStQTykze6MXwBetVp 5VzxGMm+zryaLt9VibfiBfW8IMyGq6/Zf1Ca5V77INy+JG3P+BMvKP3Vvk5Me3S/sw56t4 7C1mDqobCwNNPo+6zXS53nlNSl2PcrxBsvbl2cHZ7kXa5Hy//tSclY2+iAaNLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764288004; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5p9JD16QuXEAo6xtMB6UaMw4nfoU8FtoBvuxCRv3PQ8=; b=qz1IWhxvX2+uOX6wPx5ZOg20Bvf88EGC6ykiWgkBquvUOvu/t74CnjByUoopgclSkgE+gX IcnTR7oVjIPOaYjOTX/GdD4g+gau3zbBLm/I7XsMQ2w/MjF1Xvx5RPdEvVMQUhKgNg0P/q kYk3TOyYw7kT/lnEu/t8KvarAYQYEyOpfs8WRKm+Y5Q25Q0bfj32cuQ/uOStHRye1glufS WNvcJje4fk9Gspkl1oOdsohpRQpgkKaTdsb+GZX5MGn922SLy3Sp2xZJX410LrC2Tfb7a5 VUTGZQ9WHwBXS8TwoyEFQ0JZ9g99MSOe1nRFDgWfgYeY8dpwp5lz4G/qvVlXmw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764288004; a=rsa-sha256; cv=none; b=ZcyARU8+5NLDtaBS77S0xSCKlZspcCHJJhhfq7O6Do9Qb+u7F/XIOlj1Kxg/gdFMk5dXV4 AsR+Um+loxaf6ddbXEzVfy07tXq25OjGFcQFFdUxifvclc3TqOQXV4HaT8JBvTg4R8vVWO aaXBA3DigK+BwQ2VpGQ5d7EQEkKGAtGuRwQrZL7RSKjT0DMUZxvSqzEY4EJ64tMpP89rTF q0wQQ/ybxIpPsqw8NwyIjdAR4O9pVb5Te9iYKXlJFX/2xGa+k5frkWpDu3zuZGEtxvpWF6 nDDZcxnULivvOW+T2tyds7OoS/qlzz3Zki3ZjLyMFnBBUDTDaADLeIQy+TkwEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dHYMS4k4Lzdvg for ; Fri, 28 Nov 2025 00:00:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id e26b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 28 Nov 2025 00:00:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 7aedc8de6446 - releng/15.0 - Update in preparation for 15.0-RELEASE List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/15.0 X-Git-Reftype: branch X-Git-Commit: 7aedc8de6446ad5a10d553b926423c689f0a3363 Auto-Submitted: auto-generated Date: Fri, 28 Nov 2025 00:00:04 +0000 Message-Id: <6928e604.e26b.2acda5a0@gitrepo.freebsd.org> The branch releng/15.0 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=7aedc8de6446ad5a10d553b926423c689f0a3363 commit 7aedc8de6446ad5a10d553b926423c689f0a3363 Author: Colin Percival AuthorDate: 2025-11-28 00:00:00 +0000 Commit: Colin Percival CommitDate: 2025-11-28 00:00:00 +0000 Update in preparation for 15.0-RELEASE - Bump BRANCH to RELEASE - Add the anticipated RELEASE announcement date - Set a static __FreeBSD_version Approved by: re (implicit) --- UPDATING | 3 +++ lib/csu/common/crtbrand.S | 2 +- sys/conf/newvers.sh | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/UPDATING b/UPDATING index 0db786a70646..c23c9a66cbaa 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,9 @@ 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. +20251202: + 15.0-RELEASE. + 20251126: 15.0-RC4-p1 SA-25:10.unbound diff --git a/lib/csu/common/crtbrand.S b/lib/csu/common/crtbrand.S index a06f72daa99d..f62736c52301 100644 --- a/lib/csu/common/crtbrand.S +++ b/lib/csu/common/crtbrand.S @@ -43,7 +43,7 @@ .4byte NT_FREEBSD_ABI_TAG 1: .asciz NOTE_FREEBSD_VENDOR 2: .p2align 2 -3: .4byte __FreeBSD_version +3: .4byte 1500068 4: .section .note.GNU-stack,"",%progbits diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 9d9a75a22c25..e48cfd747602 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -51,7 +51,7 @@ TYPE="FreeBSD" REVISION="15.0" -BRANCH="RC4-p1" +BRANCH="RELEASE" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Fri Nov 28 00:00:10 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dHYMZ36Y3z6JRqY for ; Fri, 28 Nov 2025 00:00:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dHYMZ17LGz41Qn for ; Fri, 28 Nov 2025 00:00:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764288010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0bSOXmnM5dkghEdnFdCNuz0YtEZVZlZrW65hi1IhhkI=; b=qhXARZPbD0S0sadP/r4OiNx9/R7bH8tQxJ9ZA9SvUhuizZgv/lWKfmqjD8WxaFLv5p+l7o k1XiD7p2mn/1rAD89lahOyjkuScaSd+9eiG1jFjYl9Q8n2TgYiAJKowQG6gkL8LLp/rJyM 4orXMi02G8hK7OXwnl4uhQg1r8Xl0jYxZkkmcZCxRqobZ4y+iJsR117GHrgO1API4bigMB GPlqBrBigJMT96yNBdBWZLU+xZOZje1eReFylq8ls/lBkYoXELzWkSm3udlyO0nAEZ45Yd ezNaWFyAWnE87ff+jNVCTR1BcXn2MZkyzuVbPcRbVe5Y7ohkKX9CSivfBcpxeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764288010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0bSOXmnM5dkghEdnFdCNuz0YtEZVZlZrW65hi1IhhkI=; b=rdDt5JXUUce7VVC4p4/Bi8YIqLjRGxXuYaJUQHIVrdUTv8LdZFeZdJZf6xOdCT9msXswx/ S8yjhYxR6e5Q8aT2JiCICfBJOSpOnbTG/gkv0eZ69jhpLjP5BmJsxTlx2eDD2V2L1C+WXb 8pl0dsz44seShnxhKRYmSB97dMqHwTYInmAz7/2+vlfYUJhYuIRAGQzjLykPJtmnjEWf9M 3+pbMrfI73O7vmhuTxXB48G3RevLf/ESa43N/JVGjITM9a2RfkWw28kcHpgpd+siTDWJRT XIpgQ6UxXeOVr08N2uGtnq8XZQWiAosI0c3alS3e6V1STP+Sd/fL0vTXYZEl4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764288010; a=rsa-sha256; cv=none; b=I1f3iYCCzaELvr48LqzTqU093CD9ckBQ63oRpVPzdujPgrB/KTwY/+gstWPBQ2k3SNfnFS A+rJohycmiQdXjXtESMZRz9nDtRNS+VtGZ0N810HJ/GoDoWUEeuNox+T7VpgQesxsvA3yH 7S0Z/G3FNLeOrDHU6cCZVKk99LpNpxrNNEaTTzPHsCLjqAdcwE67Boa22EKZdKN0SXfYCQ FlKuU14XebMfKq92iFGjiNcOS3o9eZ6kEHRvnFHASkEzYbvYCmaOBtRLocy0RHE7p3h6Ap G7mMPmez53wfCNeN+JhaluNo8tg3RZIo8qYh+30MNuQMHKmJmf5VLhocf5wPDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dHYMZ0WKpzfJV for ; Fri, 28 Nov 2025 00:00:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id eaf4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 28 Nov 2025 00:00:10 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 52f8c56b66b5 - Create tag release/15.0.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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/tags/release/15.0.0 X-Git-Reftype: annotated tag X-Git-Commit: 52f8c56b66b5c83be3711351b117223954092b52 Auto-Submitted: auto-generated Date: Fri, 28 Nov 2025 00:00:10 +0000 Message-Id: <6928e60a.eaf4.48ebebc2@gitrepo.freebsd.org> The annotated tag release/15.0.0 has been created by cperciva: URL: https://cgit.FreeBSD.org/src/tag/?h=release/15.0.0 tag release/15.0.0 Tagger: Colin Percival TaggerDate: 2025-11-28 00:00:00 +0000 Tag 15.0-RELEASE from 7aedc8de6446 -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEglY7hNBiDtwN+4ZBOJfy4i5lrT8FAmko3nsACgkQOJfy4i5l rT+/lw//XbB5nRuaj6ZgGgS8JVrIx1SxMzevLQ99z7nAxxMVcKHg0zdSmkwMX/FA QwbuwkPHEuTEE6RnaxHKnLuY5c2mSjZLJCYAiKoDtZgvPGsgGf73n5XYQsNQQa3k YCj0NfXh4j9wstoy9Q/OqKtyyMJ3tSp4ZwLysyKxUTiT3VhJc6qFSjU8zgeFy67v gVMl233RXG5Oj8Ioj8D2+3Km9r7kwuYrtRPy8EyWN/nViNVhjYjN5cyUq8lA5mMN 5WUZOgE29vEAQVbN+1iIWssjHfLl2/W83v4MHrlTWqTKNkIWaBBpthWRAahdpqqR xcqK1FuDzHnW/9rdKqvqfUTXr1LHIWi3L7WPNkhrYmRTJDNb2AqLP0LameJpfVv+ /h5DdJ5idyeaFpZiudtTyJyjIdzgZTcZpEYMAEkD2MmXGABcharrnyhC/ElbhdvD OCv3UwiFwx0CqzzwMg/914TmCVp9d0sl1VrvQlprNYomITroP2h1ICkUJeTVbJVL um6KeiVntIoz1XqRk+Svp1q150IaWwawrdt32S6qKFT9hKYCuqTuYdG2EebnZc4U kdF47N5POBGVT3htZzR21ikmpEVTqiF086tr89p0kIOQB8QDG1qc+LZJnvszOhxu IVsou7ZvxvcJ98OjfBXrEpCkqcKkYeZdcVV3byiMLBg3sVKY9rE= =dcEG -----END PGP SIGNATURE----- commit 7aedc8de6446ad5a10d553b926423c689f0a3363 Author: Colin Percival AuthorDate: 2025-11-28 00:00:00 +0000 Commit: Colin Percival CommitDate: 2025-11-28 00:00:00 +0000 Update in preparation for 15.0-RELEASE - Bump BRANCH to RELEASE - Add the anticipated RELEASE announcement date - Set a static __FreeBSD_version Approved by: re (implicit) From nobody Fri Nov 28 00:44:51 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dHZM767QLz6JWlK for ; Fri, 28 Nov 2025 00:44: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dHZM73TpTz45hj for ; Fri, 28 Nov 2025 00:44:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764290691; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yEaKhBjwCJLKeugK0xsYirmktfSnWEOLMOcAm6xvVgQ=; b=Vno2lOxS+DlaKm58I/wlQv4DXmz97KBCKi+gDWqXhQ9ralcbvkt5todhdPB2cYawvIMMgt prtrKzSc59E+BxgAeH4kx6uddtdoEbcmjvOz5Y687bNtfPxZh0qujhpUemfLLNNYSFXy/3 1ip2N5auS3bKJTfNfl8kLUAleMma0OL4Cmz3fd3DOOSVFfz6/qO/FGg3r3+yMc5JUpk2kV cEUur3Vj64lXJcTnRpb/gTEImXw1sjL8XU6Ds1cmyF+TdiFYKxqz/aeUUComi2TUrIpT5a RF8wAl9iEbDUGxcz/NAgqBPp6tpRnx6PgOAOk/Fa6juK4hkwjFc0wADx+C314A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764290691; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yEaKhBjwCJLKeugK0xsYirmktfSnWEOLMOcAm6xvVgQ=; b=agfDBbrkICbvu9PLcAH6WaRFY9khJe6D0s9XgGCwB7jBtHzuVK8psZpGEsggHXA5ieVM+U v7v0AsENDljc7VWh90PFBerxS6rOb6kRJBwMzHYz/Kz5g7kDuWh7uo527yL7IcYoWWZV54 dkkz46FA5g7eGzybc0195/tZoygxb+auQTjatXVSX+YLlrgdi7E1sHJjb1L5NQBOZBBq9I /4EiBAe/KgPA3Ng+kW2Z/nuMR6V+RVyDes5g6VqvI32hUK2/P6cqQh4UmFcN+0Uub9dMVc /yrt/mNcSXgk6z7EtKZJbZn9di6dzQSDsanNFp4v6eWgIf1iz8Zbv6f/rUU77A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764290691; a=rsa-sha256; cv=none; b=aauieTrUWYynEEgwMoU1DP80McyrVH+o2dHFpjfsOQ6ue8h396BX0k4rQ+bCeJ/Bd3vHXO LTwJcKnMLGwsMHR/Xe5YfdpGudQFukcNdreYk09ax9sCkw8rFyhyr5ZzToMctpGL9B66H1 LvziIw/GphFQyjhDX87Q4zzNpi6NYDaHtqHEKqNZP+GJ80+N7AUcFG3FHw/zMmyFLFxNNx 5VCpeMgoShKZdrNwYaOexENoXycECpjsz7w2uveNkyrB4D95ra4MlBeezEGDpTNsOTcYh+ SxHSSglDDxzGvwEQ4BtWY3Xx80WRenjLSwmx3cydvhq2Gah+kzne8Cv0lsNTvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dHZM72pRCzgfk for ; Fri, 28 Nov 2025 00:44:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25e4f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 28 Nov 2025 00:44:51 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 452052e82708 - stable/15 - vm_page_free_prep(): convert PG_ZERO zeroed page check to use sf_buf List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 452052e82708bf130bcd0d5a12af88abb7581a5a Auto-Submitted: auto-generated Date: Fri, 28 Nov 2025 00:44:51 +0000 Message-Id: <6928f083.25e4f.670caf11@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=452052e82708bf130bcd0d5a12af88abb7581a5a commit 452052e82708bf130bcd0d5a12af88abb7581a5a Author: Konstantin Belousov AuthorDate: 2025-11-21 08:57:17 +0000 Commit: Konstantin Belousov CommitDate: 2025-11-28 00:44:15 +0000 vm_page_free_prep(): convert PG_ZERO zeroed page check to use sf_buf (cherry picked from commit b9fc7628dbb24b55cbb8791c83bd69f73cfadf23) --- sys/vm/vm_extern.h | 3 +++ sys/vm/vm_page.c | 32 +++++++++++++++++++++++++------- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/sys/vm/vm_extern.h b/sys/vm/vm_extern.h index 1fd6518cf4ed..d0e005088745 100644 --- a/sys/vm/vm_extern.h +++ b/sys/vm/vm_extern.h @@ -164,5 +164,8 @@ vm_addr_ok(vm_paddr_t pa, vm_paddr_t size, u_long alignment, return (vm_addr_align_ok(pa, alignment) && vm_addr_bound_ok(pa, size, boundary)); } + +extern bool vm_check_pg_zero; + #endif /* _KERNEL */ #endif /* !_VM_EXTERN_H_ */ diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 16878604fa11..b39d665f9e0f 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -84,6 +84,7 @@ #include #include #include +#include #include #include #include @@ -145,6 +146,13 @@ SYSCTL_ULONG(_vm_stats_page, OID_AUTO, nofreeq_size, CTLFLAG_RD, &nofreeq_size, 0, "Size of the nofree queue"); +#ifdef INVARIANTS +bool vm_check_pg_zero = false; +SYSCTL_BOOL(_debug, OID_AUTO, vm_check_pg_zero, CTLFLAG_RWTUN, + &vm_check_pg_zero, 0, + "verify content of freed zero-filled pages"); +#endif + /* * bogus page -- for I/O to/from partially complete buffers, * or for paging into sparsely invalid regions. @@ -4050,14 +4058,24 @@ vm_page_free_prep(vm_page_t m) */ atomic_thread_fence_acq(); -#if defined(DIAGNOSTIC) && defined(PHYS_TO_DMAP) - if (PMAP_HAS_DMAP && (m->flags & PG_ZERO) != 0) { - uint64_t *p; +#ifdef INVARIANTS + if (vm_check_pg_zero && (m->flags & PG_ZERO) != 0) { + struct sf_buf *sf; + unsigned long *p; int i; - p = (uint64_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); - for (i = 0; i < PAGE_SIZE / sizeof(uint64_t); i++, p++) - KASSERT(*p == 0, ("vm_page_free_prep %p PG_ZERO %d %jx", - m, i, (uintmax_t)*p)); + + sched_pin(); + sf = sf_buf_alloc(m, SFB_CPUPRIVATE | SFB_NOWAIT); + if (sf != NULL) { + p = (unsigned long *)sf_buf_kva(sf); + for (i = 0; i < PAGE_SIZE / sizeof(*p); i++, p++) { + KASSERT(*p == 0, + ("zerocheck failed page %p PG_ZERO %d %jx", + m, i, (uintmax_t)*p)); + } + sf_buf_free(sf); + } + sched_unpin(); } #endif if ((m->oflags & VPO_UNMANAGED) == 0) { From nobody Fri Nov 28 00:44:52 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dHZM84k4Hz6JWw9 for ; Fri, 28 Nov 2025 00:44:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dHZM82zP3z45kZ for ; Fri, 28 Nov 2025 00:44:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764290692; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dzZ+I4YPX12eiF/ZnLtzMLp4X6aCOF7FezZtBRPEe0c=; b=GIvV9Z89LqAz0BoSihq51bDzrskqnJj9wQJGTn6yulghIvnGlT3Cr+PHp8oKlDd0b7cmJV I/FMD/7IH6uKZ0DFsSWs/XvanzO72//vBoA0EMouapxbmL2OrtEkYWj7ztkw3AHdRsYKK6 M2Nacquax2o08b12q9Ad9elaFBryxq8FFbycZBgfexovVPFqxlVxZgoCQYGkU2RqPkoG7o ve2q2TR1HJHP2C2JVb9fQ1YCaJ2wlqBZa0k8k66u/dVG+22Ou/L0SLNtxKSekTwZcgVWpw xF/T9IemDOMdVkt6c5HqL+BgGs2vwY/tCIv+rO646TsBUIM83UqQzTY2dsIRPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764290692; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dzZ+I4YPX12eiF/ZnLtzMLp4X6aCOF7FezZtBRPEe0c=; b=Ziy/DBh1byIUyR9xC3UszcaWkr1ULWgwwpctTGqV7lYD9ZtWFCxMiQoXSVtFS1f/7AGBJj 0dUeSI4AAsCMnv0llAez61B+WyGXBapNrBnN2vA8shOplB6HOwxzut3qxJ8uDN79omtPN4 ii52do000hJO2R0fhPDULfqD77wAOuM770Zgt5vr5Ik3o7bdhAbozIg4XlJhjEDaq4BED4 P8n1YzkhlEiuQKGZDza3ak2oLtlTOIgPf7uTcvZhOek11ON7mJ/mGpWMEczQI1rqEL1Cl6 lwiv/xDq1b/bCtVIjHeNyFRpCD7PQ2OuESzc7HWZy1HfT12pDTHh7jLf49LtkA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764290692; a=rsa-sha256; cv=none; b=PAtVsZ3J+ry7wA6LAyAnQwtyNXdjsLsVhM2a52bsMe/jxC0TX+28FM+FjkXBCUqYwlC9n9 6AinDpMa2fZRYt/r2NnM8LWnlVS4wQbBg9MTZkrNe/CZcSy/DYRV24yZQdwwzacP1gXPM0 9xP2VFDxv+u7C6fVH3UzoLtiiaSR5vPsKvRuf1cx3NkZs5Eb1F+b7Yzw7LZGYzMx/Cdvh4 b0bz3VPMsyKJ/3hGY3zkF5xVqLauuTyim8xGdUj+2Tb9kXxzKW0SfJiKsS3APuaexK4dPS 56RfiqJukyd0U7X4IzaPOtTk2moHtsA8XR0VsGIZkOaCoWsF8I/a+hypfzH37Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dHZM82Tl7zgfl for ; Fri, 28 Nov 2025 00:44:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2592b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 28 Nov 2025 00:44:52 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: be9e4c000ad6 - stable/15 - vm_fault: add a verifier that the PG_ZERO page is indeed zeroed List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: be9e4c000ad68612aef5b2d2802cb5e46b966fc6 Auto-Submitted: auto-generated Date: Fri, 28 Nov 2025 00:44:52 +0000 Message-Id: <6928f084.2592b.6fddcfc0@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=be9e4c000ad68612aef5b2d2802cb5e46b966fc6 commit be9e4c000ad68612aef5b2d2802cb5e46b966fc6 Author: Konstantin Belousov AuthorDate: 2025-11-21 08:34:51 +0000 Commit: Konstantin Belousov CommitDate: 2025-11-28 00:44:15 +0000 vm_fault: add a verifier that the PG_ZERO page is indeed zeroed (cherry picked from commit d8bfcacd12aba73188c44a157c707908e275825d) --- sys/vm/vm_fault.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index 2e150b368d71..3bf16778d987 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -85,6 +85,8 @@ #include #include #include +#include +#include #include #include #include @@ -1220,6 +1222,24 @@ vm_fault_zerofill(struct faultstate *fs) if ((fs->m->flags & PG_ZERO) == 0) { pmap_zero_page(fs->m); } else { +#ifdef INVARIANTS + if (vm_check_pg_zero) { + struct sf_buf *sf; + unsigned long *p; + int i; + + sched_pin(); + sf = sf_buf_alloc(fs->m, SFB_CPUPRIVATE); + p = (unsigned long *)sf_buf_kva(sf); + for (i = 0; i < PAGE_SIZE / sizeof(*p); i++, p++) { + KASSERT(*p == 0, + ("zerocheck failed page %p PG_ZERO %d %jx", + fs->m, i, (uintmax_t)*p)); + } + sf_buf_free(sf); + sched_unpin(); + } +#endif VM_CNT_INC(v_ozfod); } VM_CNT_INC(v_zfod); From nobody Fri Nov 28 00:44:53 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dHZM965D3z6JWnG for ; Fri, 28 Nov 2025 00:44: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dHZM93v24z45KN for ; Fri, 28 Nov 2025 00:44:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764290693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+2g8iHVvtRLtRSp7tBhxk1UZYDi7l5sWxgPTjiTJInY=; b=qDYkkratYplN+Clh34FM4n6XHHziWWDVIMBuf48Ec7gNMCslcXIOpFIPMcVCXGwXXXS1XB Tyigx12fMtGk2HRS43ekNDbu8Ggb4L6mtcIleL0z8iI4Aw0hlsMKle9eITFHC2XHKyMpid 8Mow5sH740RzpkyLvGmby3O1QEz++9bI8FMkAh4t0Fpdm61Aajv5yf1a8BHyUFAhWdmo4J QoogGwnLTL7jMWDDEJmsNcfWGihaVzbD/azQ87L+XXQloIBVvV6yoA+Vzhmt0yyjTOl7a9 I9xpgEblWM7SbqyzV2pZQptMdGTGqySYlqtRpEGkIiWxDTck11M3nuCLSmqYtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764290693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+2g8iHVvtRLtRSp7tBhxk1UZYDi7l5sWxgPTjiTJInY=; b=LgL61Klzar6U2t8KriEkuNWifxdb4vJvD56UG57pwCTed68jxlBp8JGkLD99S8HVE1ZqYd XTDwcjoJKp/mpLd4uTSeXm8zGv31aD9O8r+y9Ij7LMN/msT/jffLOupSQeHBzp3Kv5sNwP roVZDq+LejLbv7sgWB0PVWvA6KWszB/6T/BQzYD52vAeQw6dD/NkufIQC+kixVwkj8FTcN HrGnSk9UuSnBX5+5rU41/ifc8ua7h5u7WlaZ90kYf6aD20RScMQksk2JJ8/5l3xaa1lLjC zQ7VoIQUgl/VSJ52oErVrOmw4kLn5/pOIxSPbvJh7nSv14z6h5eW0HLql4xdOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764290693; a=rsa-sha256; cv=none; b=U806/dxuCTnxZnGWpGHi0qQB8ieZXHSim/hmYsiLlo0bRIgf9yfY7hCM67lxiHXcUg5IbK XbXKHdzWij4Hg3JMw5ykQd6xRZkNKYuSkN0RrEL/iR3KwEnWjWSPudZ/79TlJX/PSEOEAY MN4+6Y/WeULlVvL4+P4mYQTv/y9CTlPxSf7VRZ3jBUMFMxhnkaSotDy9jT08Yw/kviWqGM jNnv5IV9lPdEgMvhUUNNGkO2InLIRyBdz3jRlomc8RafgNh4v3/qdRH2wBTAwy1GBSe8M5 SEeqt2V6XxV0HxnT0rjpfBdtMoBihC/rlGDHaoLlw3FD9PHpQdef7OIvVRIDIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dHZM93Nw1zgPb for ; Fri, 28 Nov 2025 00:44:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 23748 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 28 Nov 2025 00:44:53 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: ff6a70efd974 - stable/15 - rtld-elf: move powerpc-specific auxv compat code into arch hook List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: ff6a70efd974fe8844f7cc40c4cea2ba2e88a45a Auto-Submitted: auto-generated Date: Fri, 28 Nov 2025 00:44:53 +0000 Message-Id: <6928f085.23748.483191f5@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ff6a70efd974fe8844f7cc40c4cea2ba2e88a45a commit ff6a70efd974fe8844f7cc40c4cea2ba2e88a45a Author: Konstantin Belousov AuthorDate: 2025-11-18 11:06:04 +0000 Commit: Konstantin Belousov CommitDate: 2025-11-28 00:44:15 +0000 rtld-elf: move powerpc-specific auxv compat code into arch hook (cherry picked from commit b2b3d2a962eb00005641546fbe672b95e5d0672a) --- libexec/rtld-elf/aarch64/rtld_machdep.h | 2 ++ libexec/rtld-elf/amd64/rtld_machdep.h | 2 ++ libexec/rtld-elf/arm/rtld_machdep.h | 2 ++ libexec/rtld-elf/i386/rtld_machdep.h | 2 ++ libexec/rtld-elf/powerpc/reloc.c | 26 ++++++++++++++++++++++++++ libexec/rtld-elf/powerpc/rtld_machdep.h | 2 ++ libexec/rtld-elf/powerpc64/reloc.c | 26 ++++++++++++++++++++++++++ libexec/rtld-elf/powerpc64/rtld_machdep.h | 2 ++ libexec/rtld-elf/riscv/rtld_machdep.h | 2 ++ libexec/rtld-elf/rtld.c | 25 +------------------------ 10 files changed, 67 insertions(+), 24 deletions(-) diff --git a/libexec/rtld-elf/aarch64/rtld_machdep.h b/libexec/rtld-elf/aarch64/rtld_machdep.h index 3cc1339fcad4..d689ae354c49 100644 --- a/libexec/rtld-elf/aarch64/rtld_machdep.h +++ b/libexec/rtld-elf/aarch64/rtld_machdep.h @@ -52,6 +52,8 @@ bool arch_digest_dynamic(struct Struct_Obj_Entry *obj, const Elf_Dyn *dynp); bool arch_digest_note(struct Struct_Obj_Entry *obj, const Elf_Note *note); +#define arch_fix_auxv(a, ai) do {} while (0) + Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const struct Struct_Obj_Entry *defobj, const struct Struct_Obj_Entry *obj, const Elf_Rel *rel); diff --git a/libexec/rtld-elf/amd64/rtld_machdep.h b/libexec/rtld-elf/amd64/rtld_machdep.h index 1797d13c847d..2ee63d566bed 100644 --- a/libexec/rtld-elf/amd64/rtld_machdep.h +++ b/libexec/rtld-elf/amd64/rtld_machdep.h @@ -47,6 +47,8 @@ Elf_Dyn *rtld_dynamic_addr(void); /* No architecture specific notes */ #define arch_digest_note(obj, note) false +#define arch_fix_auxv(a, ai) do {} while (0) + Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const struct Struct_Obj_Entry *obj, const struct Struct_Obj_Entry *refobj, const Elf_Rel *rel); diff --git a/libexec/rtld-elf/arm/rtld_machdep.h b/libexec/rtld-elf/arm/rtld_machdep.h index f59b30028a3b..88fa18a0c07a 100644 --- a/libexec/rtld-elf/arm/rtld_machdep.h +++ b/libexec/rtld-elf/arm/rtld_machdep.h @@ -47,6 +47,8 @@ struct Struct_Obj_Entry; /* No architecture specific notes */ #define arch_digest_note(obj, note) false +#define arch_fix_auxv(a, ai) do {} while (0) + Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const struct Struct_Obj_Entry *defobj, const struct Struct_Obj_Entry *obj, const Elf_Rel *rel); diff --git a/libexec/rtld-elf/i386/rtld_machdep.h b/libexec/rtld-elf/i386/rtld_machdep.h index 581f1dfb002d..079991f913d6 100644 --- a/libexec/rtld-elf/i386/rtld_machdep.h +++ b/libexec/rtld-elf/i386/rtld_machdep.h @@ -60,6 +60,8 @@ Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, #define call_init_pointer(obj, target) \ (((InitArrFunc)(target))(main_argc, main_argv, environ)) +#define arch_fix_auxv(a, ai) do {} while (0) + extern uint32_t cpu_feature; extern uint32_t cpu_feature2; extern uint32_t cpu_stdext_feature; diff --git a/libexec/rtld-elf/powerpc/reloc.c b/libexec/rtld-elf/powerpc/reloc.c index 8932c2c21278..a38cadfe76ba 100644 --- a/libexec/rtld-elf/powerpc/reloc.c +++ b/libexec/rtld-elf/powerpc/reloc.c @@ -840,3 +840,29 @@ __tls_get_addr(tls_index* ti) return (tls_get_addr_common(_tcb_get(), ti->ti_module, ti->ti_offset + TLS_DTV_OFFSET)); } + +void +arch_fix_auxv(Elf_Auxinfo *aux, Elf_Auxinfo *aux_info[]) +{ + Elf_Auxinfo *aux; + bool old_auxv_format; + + old_auxv_format = true; + for (auxp = aux; auxp->a_type != AT_NULL; auxp++) { + if (auxp->a_type == 23) /* AT_STACKPROT */ + return; + } + + /* Remap from old-style auxv numbers. */ + aux_info[23] = aux_info[21]; /* AT_STACKPROT */ + aux_info[21] = aux_info[19]; /* AT_PAGESIZESLEN */ + aux_info[19] = aux_info[17]; /* AT_NCPUS */ + aux_info[17] = aux_info[15]; /* AT_CANARYLEN */ + aux_info[15] = aux_info[13]; /* AT_EXECPATH */ + aux_info[13] = NULL; /* AT_GID */ + + aux_info[20] = aux_info[18]; /* AT_PAGESIZES */ + aux_info[18] = aux_info[16]; /* AT_OSRELDATE */ + aux_info[16] = aux_info[14]; /* AT_CANARY */ + aux_info[14] = NULL; /* AT_EGID */ +} diff --git a/libexec/rtld-elf/powerpc/rtld_machdep.h b/libexec/rtld-elf/powerpc/rtld_machdep.h index ec470f238991..de6a894ac1f5 100644 --- a/libexec/rtld-elf/powerpc/rtld_machdep.h +++ b/libexec/rtld-elf/powerpc/rtld_machdep.h @@ -46,6 +46,8 @@ bool arch_digest_dynamic(struct Struct_Obj_Entry *, const Elf_Dyn *); /* No architecture specific notes */ #define arch_digest_note(obj, note) false +void arch_fix_auxv(Elf_Auxinfo *aux, Elf_Auxinfo *aux_info[]); + Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const struct Struct_Obj_Entry *defobj, const struct Struct_Obj_Entry *obj, const Elf_Rel *rel); diff --git a/libexec/rtld-elf/powerpc64/reloc.c b/libexec/rtld-elf/powerpc64/reloc.c index 9ea14f63b5c7..29c52d8fc19f 100644 --- a/libexec/rtld-elf/powerpc64/reloc.c +++ b/libexec/rtld-elf/powerpc64/reloc.c @@ -737,3 +737,29 @@ __tls_get_addr(tls_index* ti) return (tls_get_addr_common(_tcb_get(), ti->ti_module, ti->ti_offset + TLS_DTV_OFFSET)); } + +void +arch_fix_auxv(Elf_Auxinfo *aux, Elf_Auxinfo *aux_info[]) +{ + Elf_Auxinfo *aux; + bool old_auxv_format; + + old_auxv_format = true; + for (auxp = aux; auxp->a_type != AT_NULL; auxp++) { + if (auxp->a_type == 23) /* AT_STACKPROT */ + return; + } + + /* Remap from old-style auxv numbers. */ + aux_info[23] = aux_info[21]; /* AT_STACKPROT */ + aux_info[21] = aux_info[19]; /* AT_PAGESIZESLEN */ + aux_info[19] = aux_info[17]; /* AT_NCPUS */ + aux_info[17] = aux_info[15]; /* AT_CANARYLEN */ + aux_info[15] = aux_info[13]; /* AT_EXECPATH */ + aux_info[13] = NULL; /* AT_GID */ + + aux_info[20] = aux_info[18]; /* AT_PAGESIZES */ + aux_info[18] = aux_info[16]; /* AT_OSRELDATE */ + aux_info[16] = aux_info[14]; /* AT_CANARY */ + aux_info[14] = NULL; /* AT_EGID */ +} diff --git a/libexec/rtld-elf/powerpc64/rtld_machdep.h b/libexec/rtld-elf/powerpc64/rtld_machdep.h index d628e776bae9..06eb6d884101 100644 --- a/libexec/rtld-elf/powerpc64/rtld_machdep.h +++ b/libexec/rtld-elf/powerpc64/rtld_machdep.h @@ -46,6 +46,8 @@ bool arch_digest_dynamic(struct Struct_Obj_Entry *, const Elf_Dyn *); /* No architecture specific notes */ #define arch_digest_note(obj, note) false +void arch_fix_auxv(Elf_Auxinfo *aux, Elf_Auxinfo *aux_info[]); + Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const struct Struct_Obj_Entry *defobj, const struct Struct_Obj_Entry *obj, const Elf_Rel *rel); diff --git a/libexec/rtld-elf/riscv/rtld_machdep.h b/libexec/rtld-elf/riscv/rtld_machdep.h index c6600b583612..1f4fe2e928fe 100644 --- a/libexec/rtld-elf/riscv/rtld_machdep.h +++ b/libexec/rtld-elf/riscv/rtld_machdep.h @@ -60,6 +60,8 @@ uint64_t set_gp(struct Struct_Obj_Entry *obj); /* No architecture specific notes */ #define arch_digest_note(obj, note) false +#define arch_fix_auxv(a, ai) do {} while (0) + Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const struct Struct_Obj_Entry *defobj, const struct Struct_Obj_Entry *obj, const Elf_Rel *rel); diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index d27af520c21d..bdfff7361e96 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -521,9 +521,6 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) char buf[MAXPATHLEN]; int argc, fd, i, mib[4], old_osrel, osrel, phnum, rtld_argc; size_t sz; -#ifdef __powerpc__ - int old_auxv_format = 1; -#endif bool dir_enable, dir_ignore, direct_exec, explicit_fd, search_in_path; /* @@ -549,28 +546,8 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) for (auxp = aux; auxp->a_type != AT_NULL; auxp++) { if (auxp->a_type < AT_COUNT) aux_info[auxp->a_type] = auxp; -#ifdef __powerpc__ - if (auxp->a_type == 23) /* AT_STACKPROT */ - old_auxv_format = 0; -#endif - } - -#ifdef __powerpc__ - if (old_auxv_format) { - /* Remap from old-style auxv numbers. */ - aux_info[23] = aux_info[21]; /* AT_STACKPROT */ - aux_info[21] = aux_info[19]; /* AT_PAGESIZESLEN */ - aux_info[19] = aux_info[17]; /* AT_NCPUS */ - aux_info[17] = aux_info[15]; /* AT_CANARYLEN */ - aux_info[15] = aux_info[13]; /* AT_EXECPATH */ - aux_info[13] = NULL; /* AT_GID */ - - aux_info[20] = aux_info[18]; /* AT_PAGESIZES */ - aux_info[18] = aux_info[16]; /* AT_OSRELDATE */ - aux_info[16] = aux_info[14]; /* AT_CANARY */ - aux_info[14] = NULL; /* AT_EGID */ } -#endif + arch_fix_auxv(aux, aux_info); /* Initialize and relocate ourselves. */ assert(aux_info[AT_BASE] != NULL); From nobody Fri Nov 28 00:44:54 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dHZMB5wZQz6JWqX for ; Fri, 28 Nov 2025 00:44: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dHZMB4CB0z45KZ for ; Fri, 28 Nov 2025 00:44:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764290694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TUq7TM0PUIr7m9ABSpHwM0LZ/m66ZUwNC4fskikyuOA=; b=KtFC+H/JQhN1NeaBO7VOIvTawkPSyZgg6OERtifnfRY1xYG2YN1Hap+/nxGLvupg/aCxbg 2Hcw+gzaSqD4iu2ULSSvPxqkwsGM/woP0PKGmwRqMcmPjmgb+v6eZ1qKNijXSKIXMVyNHW ZKuzN5aIr7iR84RKm4oyRzq6GcRYmrxfTr5wlyL/0CzawHE/dTB0sknJIH1cs993dH0xjL yM2GQVGAO6YUJBAg0CZkpKMst6uIzIUut2JjD4giW8OA5vhR8zoP8NubIMXIbKTTF/U0A+ 2PMCRYCi4/OJNAJzuNstV2tkon4SJNhGjconN62u71C92jmKBdN+epq/zoW7Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764290694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TUq7TM0PUIr7m9ABSpHwM0LZ/m66ZUwNC4fskikyuOA=; b=yetMyVkKfP4LPppCen6eVC9TOgJGMbGJlH2aPaRKgO7HZ83nR5BOySnyQGNbq+8vgUu/1t mruVLOeQ1/75UbgglpCBAhBmYJZoRDJneIaOEqqy9aUx8kLtoN9qeSFO+A+k7QU90up4I7 +x35tYL8k4jTLoz8jyhbLGOQmNObBN+f/BUYN4JEdmNSVRkHxCCnmloIB+gc42XTvuYZZI 8XuA/1yF1N5PRBM5NIlK/iFynvv/wtOyQpaw9rUkmDddBtstT7wmbe56ctrSIVw7ME1CDW cICtTwstDOnkAoTMTrCRNZTYde3KHFTJmGS6pIUv/73Si7UmOSpheYzyh6Nndg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764290694; a=rsa-sha256; cv=none; b=U/MKw3UkCGWGkrQn6IxJ5yqg8aSCyLEPsL+UtSjLKqkRdoZlhsWZqrbZyE+YM6Jq885BZ6 41xdKJrw2WYdNm4Lnjs9p4tuQ/2iW0DGbdKlESg+pSgYxNyGbS/Bmlsm6yzYRDKvfXmIg5 yEaQYhpF1c7qLw4oX2DMZYpuSJ6catBmFVccACC9sJXCPGjA3oKc/yXMr9QHcnve6bx8CG evLhav5YlnBFUVaSRsfCqiLd+GVyg2YckVIHAg4MnctfEP9mEyHFaQhrLtMXPkqKbkxTnL Pn1YeaQdYm4nD2RN91rJJKV43KPIi9lWb+e5N28xSXEj0l/XlQ9JGwQl2VKoAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dHZMB3j74zgPd for ; Fri, 28 Nov 2025 00:44:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 23b76 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 28 Nov 2025 00:44:54 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: b903f27e171b - stable/15 - rtld: fix powerpc build List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: b903f27e171b120f2396de1074549e0f917156b5 Auto-Submitted: auto-generated Date: Fri, 28 Nov 2025 00:44:54 +0000 Message-Id: <6928f086.23b76.54493994@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b903f27e171b120f2396de1074549e0f917156b5 commit b903f27e171b120f2396de1074549e0f917156b5 Author: Konstantin Belousov AuthorDate: 2025-11-24 08:44:52 +0000 Commit: Konstantin Belousov CommitDate: 2025-11-28 00:44:15 +0000 rtld: fix powerpc build (cherry picked from commit 0628c252bd161ccdd1228a3b8aefeb471044ca04) --- libexec/rtld-elf/powerpc/reloc.c | 4 +--- libexec/rtld-elf/powerpc64/reloc.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/libexec/rtld-elf/powerpc/reloc.c b/libexec/rtld-elf/powerpc/reloc.c index a38cadfe76ba..c160028cea6d 100644 --- a/libexec/rtld-elf/powerpc/reloc.c +++ b/libexec/rtld-elf/powerpc/reloc.c @@ -844,10 +844,8 @@ __tls_get_addr(tls_index* ti) void arch_fix_auxv(Elf_Auxinfo *aux, Elf_Auxinfo *aux_info[]) { - Elf_Auxinfo *aux; - bool old_auxv_format; + Elf_Auxinfo *auxp; - old_auxv_format = true; for (auxp = aux; auxp->a_type != AT_NULL; auxp++) { if (auxp->a_type == 23) /* AT_STACKPROT */ return; diff --git a/libexec/rtld-elf/powerpc64/reloc.c b/libexec/rtld-elf/powerpc64/reloc.c index 29c52d8fc19f..4a4107aef861 100644 --- a/libexec/rtld-elf/powerpc64/reloc.c +++ b/libexec/rtld-elf/powerpc64/reloc.c @@ -741,10 +741,8 @@ __tls_get_addr(tls_index* ti) void arch_fix_auxv(Elf_Auxinfo *aux, Elf_Auxinfo *aux_info[]) { - Elf_Auxinfo *aux; - bool old_auxv_format; + Elf_Auxinfo *auxp; - old_auxv_format = true; for (auxp = aux; auxp->a_type != AT_NULL; auxp++) { if (auxp->a_type == 23) /* AT_STACKPROT */ return; From nobody Fri Nov 28 14:35:28 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dHwnX5hGlz6HZgS for ; Fri, 28 Nov 2025 14:35: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dHwnX33Lgz3sTr for ; Fri, 28 Nov 2025 14:35:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764340528; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/TrSwgmTfVou5qiMufO1Y4wwAo+hnKyevNXLF1DJpp4=; b=UuRGii2R4wqRpBBMbtJzG4ldGZ9cW3Ocj6isHpAz9942SmotJmsTI6fPLvEi4xHQEpiB1Y HruogMdscPiT80bV91paoQLmUPE3ualHMUNh07pbDejYzwub8gpg3Lihlzp8Bq+kKLkv6C tEAjKj7t7sBkpQVj3qWeqOVNoW+eX440wMqETxSSH96gNnXPkLgEv4Lkf8C7dk3dte/QVp zRMsRwv5e2+7Ug66G9Uq+4S0mVBC8CegqlmNa9X42wyH3Ls62zkf7UHgguwZ0pPXqQoqJi A0IRCLsEnvLfyEWSjiZ9Nar26X2tzaIMlz44uUnRZZz9FaQDm6WV0ni18ZDPpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764340528; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/TrSwgmTfVou5qiMufO1Y4wwAo+hnKyevNXLF1DJpp4=; b=X7uhBP4dyqeHbDbY7op9erIuSSLlodeY07qX2FympRsgDVUtL2x1VS+bra6GOn4V/FVwS8 qarER+eek0ZHON1ZHSNGSHDRcnt5dNfTIAcGqcMxXif8Axc+orjnCsc6RzRfmBH8IZEq4g Lu58XnOlONFr2lWSDjf4TPkzXKv1Df1CubgGQQJO/kEQ1HfpmrsB/c+eCRrwWqmS0rRANh YHl/SDSEOVNwiLcFRyz9d1NzjRZIYCjzbBdi5kdZfjtYKz2ua9a9+SQPa605ZSUpJZaDE1 Qi57Cau9pYpXIg9UxM0vKawbT//UCyJufHghg5oni1l55DvtlqcwLIX/lW1/AA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764340528; a=rsa-sha256; cv=none; b=nl9Fk1P7qdMI0kvHS8kFsURjYQJ1O7j5u9mlsRkGADmjgH9NEkd1iYh2KumvEBbYH/Ydhi BjKHX+xSIxjIpvc9aF7BL5gewGP065+QD3vLGhqWyJ7aHmZRLr2zWIzNrr7Xm5VZy9tphj eprtv0xFB1FzwUWyDjHUjOR6fXYacGrYfbvNHn7c8mh+AGdOq4FzGlnwKbvk92xdjTscq/ jHWUjKMaY+rk+4NDwe5/0XXUuAa61FOWBb8r09viE4TZuf0bORi87ncOn85KDKt6rL/vRo pNCX0cLg20u0x9N4vMaeRd5Z/IlAl2p9cizY7RlhiYLb8rX13Hs8jsbhIxMRMg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dHwnX2fjsz15kb for ; Fri, 28 Nov 2025 14:35:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2a6e8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 28 Nov 2025 14:35:28 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: efb513fc19c8 - stable/15 - sound: Clean up midi/ includes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: efb513fc19c80e814bc04b018492b2235cade928 Auto-Submitted: auto-generated Date: Fri, 28 Nov 2025 14:35:28 +0000 Message-Id: <6929b330.2a6e8.2310b424@gitrepo.freebsd.org> The branch stable/15 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=efb513fc19c80e814bc04b018492b2235cade928 commit efb513fc19c80e814bc04b018492b2235cade928 Author: Christos Margiolis AuthorDate: 2025-11-21 16:14:18 +0000 Commit: Christos Margiolis CommitDate: 2025-11-28 14:34:41 +0000 sound: Clean up midi/ includes Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D53841 (cherry picked from commit 4e8eb778803a8bffd0faa507ae2662725363cae5) --- sys/dev/sound/midi/midi.c | 23 +++++++++-------------- sys/dev/sound/midi/mpu401.c | 11 ++--------- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/sys/dev/sound/midi/midi.c b/sys/dev/sound/midi/midi.c index b39288675ea6..e14a28557406 100644 --- a/sys/dev/sound/midi/midi.c +++ b/sys/dev/sound/midi/midi.c @@ -32,34 +32,29 @@ #include #include -#include +#include +#include #include +#include #include +#include #include -#include -#include -#include +#include +#include #include -#include -#include #include -#include -#include -#include +#include #include -#include -#include -#include -#include #ifdef HAVE_KERNEL_OPTION_HEADERS #include "opt_snd.h" #endif #include +#include + #include "mpu_if.h" -#include MALLOC_DEFINE(M_MIDI, "midi buffers", "Midi data allocation area"); #define MIDI_NAMELEN 16 diff --git a/sys/dev/sound/midi/mpu401.c b/sys/dev/sound/midi/mpu401.c index af3149ec8180..7d3edb6323ef 100644 --- a/sys/dev/sound/midi/mpu401.c +++ b/sys/dev/sound/midi/mpu401.c @@ -27,17 +27,10 @@ */ #include -#include -#include -#include -#include -#include -#include -#include #include +#include +#include #include -#include -#include /* to get driver_intr_t */ #ifdef HAVE_KERNEL_OPTION_HEADERS #include "opt_snd.h" From nobody Fri Nov 28 14:35:29 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dHwnY6cwhz6HZmP for ; Fri, 28 Nov 2025 14:35: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dHwnY3vTFz3sTs for ; Fri, 28 Nov 2025 14:35:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764340529; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2H9kCFQJNR+maWyk48g0ekdqwjmWxEbJ3ecuTUPqISE=; b=vGPLMfduVivWGPoRhvIUUVfDE0QxcsJh0STEDW442OoH3tVAsX5ueTqI2TFKrm8On5UkWO HsJAB6RwzAlDIxkY8fTSqlccsq12G74U26gg51cp6H9y4gx8xHJFr7PigIKIXo45nIKmF2 thiKKFnTerS652Cm5R2acKh8eKEoOyOdmodBgr7fySJAVsmAsPKGED8dnBCElqNRa2BKvJ U2w42UQMeYi+Xp2B5Scl63+zd5/QDBkpC9Z9Iw3mwUSAehij+gBar/ndK/JGZyp3ewggP6 B3MCCdF2x7ilRV/Yw4T8AU97RbfrestqJtOdnYLtKT2KWSEwj6n2IHzmuktRdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764340529; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2H9kCFQJNR+maWyk48g0ekdqwjmWxEbJ3ecuTUPqISE=; b=ZQ2yoXrRkJMvQA/FrnmvVvXuvlcLtlcpUHwSNI1w90XrbnAaHGZ0nVvuO7gUdgRMHuiQhu vuWqR8F0WQ+NNtfL+aDgN39c2dFGaSwSiEJWjCXXJbv+3P7906/7KLSh7YzwVex0+tDtJi yj03DkYzuEZHc9nsAK9WWGi9C0wAwHH60XnvlqfWrhZel5Wb0q/GjJTJtoUKXjbYwFqEwx IIBY/BvUjnbNncqxd+QIsH685HGebAlF5gCocVhtKKfVj17KOcONwo0msZPkEl5f47l6io dPMIIlw6SY2eTX251xt0JmNSToCG3rywNiojWG14/BOQRFHkegbWk3bTwbKQbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764340529; a=rsa-sha256; cv=none; b=xcXP/Zkkf4TTiKQk3LfLV/PhjhMQCLpXHKsp/qGfiHTSzRkw8hkD2dCi680q3B+8BEZA2N lj8OenkPa0cNjp8Hredk3VoEwQMBkX5VH4//cg5KtohdlQ8uHWQk34cOq+qy93kOCrCC/v MWtXzCyjCmDImVbcnx6rsLaMc2lzZs4eywGtTCY2WX5klGT8ktZGb3QnxydvyV2maVuoGh H0rkSi9NnDlzRfybmNe4adI0V7NOJN7cuEe+rKnciGZXLX1ig+ImvW05TCVpvp1vbQ6/hx tI4W9Hxw3mfXGamnIWWqbT3q2IibSIi6X8qiuLgZArXLeZIzktttKyOUFPXo4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dHwnY3Rysz15YZ for ; Fri, 28 Nov 2025 14:35:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 28f78 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 28 Nov 2025 14:35:29 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 839da868a5f9 - stable/15 - sound: Merge PCM_ALIVE() with PCM_REGISTERED() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 839da868a5f9eb8bddd20d44f1cd0f293c5685cd Auto-Submitted: auto-generated Date: Fri, 28 Nov 2025 14:35:29 +0000 Message-Id: <6929b331.28f78.6d1edb6d@gitrepo.freebsd.org> The branch stable/15 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=839da868a5f9eb8bddd20d44f1cd0f293c5685cd commit 839da868a5f9eb8bddd20d44f1cd0f293c5685cd Author: Christos Margiolis AuthorDate: 2025-11-21 16:14:24 +0000 Commit: Christos Margiolis CommitDate: 2025-11-28 14:34:41 +0000 sound: Merge PCM_ALIVE() with PCM_REGISTERED() PCM_ALIVE() is used only in pcm_unregister(), but it does not hurt to use PCM_REGISTERED(), which uses PCM_ALIVE() internally. In fact, it's more robust this way. Sponsored by: The FreeBSD Foundation MFC after: 1 week (cherry picked from commit 3107b952f534813846e4f58afdb57624a81618d8) --- sys/dev/sound/pcm/sound.c | 2 +- sys/dev/sound/pcm/sound.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index cb510d526fa8..60236eb4c69c 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -467,7 +467,7 @@ pcm_unregister(device_t dev) d = device_get_softc(dev); - if (!PCM_ALIVE(d)) { + if (!PCM_REGISTERED(d)) { device_printf(dev, "unregister: device not configured\n"); return (0); } diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index 8542a96ccb14..c03ac2c8ee58 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -133,8 +133,8 @@ struct snd_mixer; "\015PVCHANS" \ "\016RVCHANS" -#define PCM_ALIVE(x) ((x) != NULL && (x)->lock != NULL) -#define PCM_REGISTERED(x) (PCM_ALIVE(x) && ((x)->flags & SD_F_REGISTERED)) +#define PCM_REGISTERED(x) \ + ((x) != NULL && (x)->lock != NULL && ((x)->flags & SD_F_REGISTERED)) #define PCM_MAXCHANS 10000 #define PCM_CHANCOUNT(d) \ From nobody Fri Nov 28 14:35:30 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dHwnb05Xsz6HZmS for ; Fri, 28 Nov 2025 14:35: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dHwnZ551Lz3srD for ; Fri, 28 Nov 2025 14:35:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764340530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TR6S1696fLtnQGO/RgqJbMfbHq744UbbMDNClpkT6is=; b=mJc2tkwhpMTiJOAulYyigQwkTS4oxHEyf7CIEkac+d8qjyPmN0pjMinmJdeVy3egwxTKvg RrMQohO0fHfya+6x8DpwwKlOScG629Gw0w/cF2a3/seXPOq1hG5GDIZq6K8cbxKLOwEWLA rYN3cKX+qoYceeIsZimYoU0VAkRtpssxNBs6oMoI6BPsL9SJVfKuKnEj+1Vn7HadLd1a0d kZFVch9ptvMxUglqjLsCfrQnrRbcqPquKgeWOqeUGodNwlQ8TJKUd3Djfr7aljx4gvwcbN UHWILm8crs3NL90ugFksIlR9S0/2fu53vRwTfu6w1teofEjzWCuKYabJFwyGMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764340530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TR6S1696fLtnQGO/RgqJbMfbHq744UbbMDNClpkT6is=; b=so/jG0p91N4oOB0IzdvjuP3GEVtOD2wp0aNZ4xNaS5kEUkizkKIBVEuKunvHPjHUApD7Y/ 9wbJKybAM3hatBNF9JpiDDrGu1vGFYBzbjRg+so51JeTg3vCK3FLBkG16u0WenfBesWoeA JOyHPlILsmEHfJaNW9tb7YxEMUyssg66mGLMDhrKfLVo0KeqI5nZ6h6klFpf3LwnIUG/oj /CAjFg27eDDSluRo4OX9/Aa08xBOrhV+5mKB7oCIl8lUtpIZXZnBT7TmQxZv3A9WNYjX0m qp60mpT/nzyAaZ4+KvjfDUCrfY75mOBwMaIuXI1GylvVuDHPdOnZbe88UbQRFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764340530; a=rsa-sha256; cv=none; b=J4qphhTeMUGxetDBbe0rRN/iVfOQh9e297E5YfOjAT+r9SHDtdMLamJvZuJjm226TAayZA LsoScL2N95s+vyjogPR+ALl84WvxDoPi7gYO5icf9D+VAEB7P6xnDUAwBP8qy9zl15Sb8y P1H6CQdlmnRexkCSQzWUCvtMtA9F+tkUHQVM85W8ExOnUMI9RhP+BNHUWzGjP5/O0YGpl7 xRqsjRQLyr8FgoMVfAFOlR4YIHhe67QdfwNTfWelVJP/IiF/hcVfht57o67k5/qbJH6IK6 J8nKtEfOAMpgBHmDYN0zmBd/B8PSeEDwoKun39a7fBi9EYLNmJZiiqVpdHwVSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dHwnZ4dN1z15sM for ; Fri, 28 Nov 2025 14:35:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 28db3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 28 Nov 2025 14:35:30 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 47bb49b54098 - stable/15 - sound: Retire snd_mtx* wrappers List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 47bb49b540983dafe61e25cab7b165e97a234769 Auto-Submitted: auto-generated Date: Fri, 28 Nov 2025 14:35:30 +0000 Message-Id: <6929b332.28db3.22c08492@gitrepo.freebsd.org> The branch stable/15 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=47bb49b540983dafe61e25cab7b165e97a234769 commit 47bb49b540983dafe61e25cab7b165e97a234769 Author: Christos Margiolis AuthorDate: 2025-11-21 16:14:33 +0000 Commit: Christos Margiolis CommitDate: 2025-11-28 14:34:49 +0000 sound: Retire snd_mtx* wrappers Do not create mutexes with snd_mtxcreate(). It doesn't provide any value, plus it first allocates the mutex with malloc(9). Allocate mutexes in the stack and use mtx_* functions directly instead of the snd_mtx* wrappers. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D53855 (cherry picked from commit 9d18115ca0ab0ef3f34173d4e2bdabec916d0b60) (cherry picked from commit 120f8a4c2ae8a011827d83b098ecf70c791f794b) --- sys/arm/allwinner/a10_codec.c | 10 ++-- sys/arm/freescale/imx/imx6_ssi.c | 24 ++++---- sys/arm/freescale/vybrid/vf_sai.c | 24 ++++---- sys/dev/sound/dummy.c | 29 +++++----- sys/dev/sound/pci/als4000.c | 50 ++++++++--------- sys/dev/sound/pci/atiixp.c | 18 +++--- sys/dev/sound/pci/cmi.c | 54 +++++++++--------- sys/dev/sound/pci/emu10k1.c | 57 +++++++++---------- sys/dev/sound/pci/emu10kx-pcm.c | 47 ++++++++-------- sys/dev/sound/pci/envy24.c | 68 +++++++++++------------ sys/dev/sound/pci/envy24ht.c | 69 ++++++++++++----------- sys/dev/sound/pci/es137x.c | 16 +++--- sys/dev/sound/pci/hda/hdaa.c | 6 +- sys/dev/sound/pci/hda/hdac.c | 15 ++--- sys/dev/sound/pci/hda/hdac_private.h | 2 +- sys/dev/sound/pci/hda/hdacc.c | 6 +- sys/dev/sound/pci/hdsp-pcm.c | 28 +++++----- sys/dev/sound/pci/hdsp.c | 35 ++++++------ sys/dev/sound/pci/hdsp.h | 2 +- sys/dev/sound/pci/hdspe-pcm.c | 28 +++++----- sys/dev/sound/pci/hdspe.c | 35 ++++++------ sys/dev/sound/pci/hdspe.h | 2 +- sys/dev/sound/pci/ich.c | 16 +++--- sys/dev/sound/pci/maestro3.c | 17 +++--- sys/dev/sound/pci/solo.c | 18 +++--- sys/dev/sound/pci/spicds.c | 34 ++++++------ sys/dev/sound/pci/t4dwave.c | 29 +++++----- sys/dev/sound/pci/via8233.c | 101 +++++++++++++++++---------------- sys/dev/sound/pci/via82c686.c | 36 ++++++------ sys/dev/sound/pcm/ac97.c | 52 ++++++++--------- sys/dev/sound/pcm/channel.c | 16 +++--- sys/dev/sound/pcm/channel.h | 14 ++--- sys/dev/sound/pcm/dsp.c | 4 +- sys/dev/sound/pcm/mixer.c | 105 +++++++++++++++++------------------ sys/dev/sound/pcm/sound.c | 33 +---------- sys/dev/sound/pcm/sound.h | 24 +++----- sys/dev/sound/usb/uaudio.c | 2 +- 37 files changed, 537 insertions(+), 589 deletions(-) diff --git a/sys/arm/allwinner/a10_codec.c b/sys/arm/allwinner/a10_codec.c index 0a4ba7aa31b2..d3920eddc1f1 100644 --- a/sys/arm/allwinner/a10_codec.c +++ b/sys/arm/allwinner/a10_codec.c @@ -159,7 +159,7 @@ struct a10codec_chinfo { struct a10codec_info { device_t dev; struct resource *res[2]; - struct mtx *lock; + struct mtx lock; bus_dma_tag_t dmat; unsigned dmasize; void *ih; @@ -949,7 +949,7 @@ a10codec_chan_trigger(kobj_t obj, void *data, int go) if (!PCMTRIG_COMMON(go)) return (0); - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); switch (go) { case PCMTRIG_START: ch->run = 1; @@ -964,7 +964,7 @@ a10codec_chan_trigger(kobj_t obj, void *data, int go) default: break; } - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return (0); } @@ -1075,7 +1075,7 @@ a10codec_attach(device_t dev) sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK | M_ZERO); sc->cfg = (void *)ofw_bus_search_compatible(dev, compat_data)->ocd_data; sc->dev = dev; - sc->lock = snd_mtxcreate(device_get_nameunit(dev), "a10codec softc"); + mtx_init(&sc->lock, device_get_nameunit(dev), "a10codec_softc", MTX_DEF); if (bus_alloc_resources(dev, a10codec_spec, sc->res)) { device_printf(dev, "cannot allocate resources for device\n"); @@ -1180,7 +1180,7 @@ a10codec_attach(device_t dev) fail: bus_release_resources(dev, a10codec_spec, sc->res); - snd_mtxfree(sc->lock); + mtx_destroy(&sc->lock); free(sc, M_DEVBUF); return (ENXIO); diff --git a/sys/arm/freescale/imx/imx6_ssi.c b/sys/arm/freescale/imx/imx6_ssi.c index 5a0e671f15a2..f4ef955761b4 100644 --- a/sys/arm/freescale/imx/imx6_ssi.c +++ b/sys/arm/freescale/imx/imx6_ssi.c @@ -173,7 +173,7 @@ struct sc_info { bus_space_tag_t bst; bus_space_handle_t bsh; device_t dev; - struct mtx *lock; + struct mtx lock; void *ih; int pos; int dma_size; @@ -242,10 +242,10 @@ ssimixer_init(struct snd_mixer *m) mask = SOUND_MASK_PCM; mask |= SOUND_MASK_VOLUME; - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); pcm_setflags(scp->dev, pcm_getflags(scp->dev) | SD_F_SOFTPCMVOL); mix_setdevs(m, mask); - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return (0); } @@ -290,14 +290,14 @@ ssichan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, scp = (struct sc_pcminfo *)devinfo; sc = scp->sc; - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); ch = &scp->chan[0]; ch->dir = dir; ch->run = 0; ch->buffer = b; ch->channel = c; ch->parent = scp; - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); if (sndbuf_setup(ch->buffer, sc->buf_base, sc->dma_size) != 0) { device_printf(scp->dev, "Can't setup sndbuf.\n"); @@ -318,9 +318,9 @@ ssichan_free(kobj_t obj, void *data) device_printf(scp->dev, "ssichan_free()\n"); #endif - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); /* TODO: free channel buffer */ - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return (0); } @@ -565,7 +565,7 @@ ssichan_trigger(kobj_t obj, void *data, int go) scp = ch->parent; sc = scp->sc; - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); switch (go) { case PCMTRIG_START: @@ -590,7 +590,7 @@ ssichan_trigger(kobj_t obj, void *data, int go) break; } - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return (0); } @@ -736,11 +736,7 @@ ssi_attach(device_t dev) sc->pos = 0; sc->conf = malloc(sizeof(struct sdma_conf), M_DEVBUF, M_WAITOK | M_ZERO); - sc->lock = snd_mtxcreate(device_get_nameunit(dev), "ssi softc"); - if (sc->lock == NULL) { - device_printf(dev, "Can't create mtx\n"); - return (ENXIO); - } + mtx_init(&sc->lock, device_get_nameunit(dev), "ssi softc", MTX_DEF); if (bus_alloc_resources(dev, ssi_spec, sc->res)) { device_printf(dev, "could not allocate resources\n"); diff --git a/sys/arm/freescale/vybrid/vf_sai.c b/sys/arm/freescale/vybrid/vf_sai.c index 9c0125768fee..d3a3ab93fe80 100644 --- a/sys/arm/freescale/vybrid/vf_sai.c +++ b/sys/arm/freescale/vybrid/vf_sai.c @@ -138,7 +138,7 @@ struct sc_info { bus_space_tag_t bst; bus_space_handle_t bsh; device_t dev; - struct mtx *lock; + struct mtx lock; uint32_t speed; uint32_t period; void *ih; @@ -206,10 +206,10 @@ saimixer_init(struct snd_mixer *m) mask = SOUND_MASK_PCM; - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); pcm_setflags(scp->dev, pcm_getflags(scp->dev) | SD_F_SOFTPCMVOL); mix_setdevs(m, mask); - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return (0); } @@ -252,14 +252,14 @@ saichan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, scp = (struct sc_pcminfo *)devinfo; sc = scp->sc; - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); ch = &scp->chan[0]; ch->dir = dir; ch->run = 0; ch->buffer = b; ch->channel = c; ch->parent = scp; - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); if (sndbuf_setup(ch->buffer, sc->buf_base, sc->dma_size) != 0) { device_printf(scp->dev, "Can't setup sndbuf.\n"); @@ -280,9 +280,9 @@ saichan_free(kobj_t obj, void *data) device_printf(scp->dev, "saichan_free()\n"); #endif - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); /* TODO: free channel buffer */ - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return (0); } @@ -513,7 +513,7 @@ saichan_trigger(kobj_t obj, void *data, int go) struct sc_pcminfo *scp = ch->parent; struct sc_info *sc = scp->sc; - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); switch (go) { case PCMTRIG_START: @@ -532,7 +532,7 @@ saichan_trigger(kobj_t obj, void *data, int go) break; } - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return (0); } @@ -691,11 +691,7 @@ sai_attach(device_t dev) sc->sr = &rate_map[0]; sc->pos = 0; - sc->lock = snd_mtxcreate(device_get_nameunit(dev), "sai softc"); - if (sc->lock == NULL) { - device_printf(dev, "Cant create mtx\n"); - return (ENXIO); - } + mtx_init(&sc->lock, device_get_nameunit(dev), "sai softc", MTX_DEF); if (bus_alloc_resources(dev, sai_spec, sc->res)) { device_printf(dev, "could not allocate resources\n"); diff --git a/sys/dev/sound/dummy.c b/sys/dev/sound/dummy.c index 0a2717ec418c..74ca1d0c924c 100644 --- a/sys/dev/sound/dummy.c +++ b/sys/dev/sound/dummy.c @@ -64,7 +64,7 @@ struct dummy_softc { int chnum; struct dummy_chan chans[DUMMY_NCHAN]; struct callout callout; - struct mtx *lock; + struct mtx lock; bool stopped; }; @@ -74,7 +74,7 @@ dummy_active(struct dummy_softc *sc) struct dummy_chan *ch; int i; - snd_mtxassert(sc->lock); + mtx_assert(&sc->lock, MA_OWNED); for (i = 0; i < sc->chnum; i++) { ch = &sc->chans[i]; @@ -109,9 +109,9 @@ dummy_chan_io(void *arg) ch->ptr %= ch->buf->bufsize; } else sndbuf_fillsilence(ch->buf); - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); chn_intr(ch->chan); - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); } if (!sc->stopped) callout_schedule(&sc->callout, 1); @@ -141,7 +141,7 @@ dummy_chan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, sc = devinfo; - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); ch = &sc->chans[sc->chnum++]; ch->sc = sc; @@ -150,7 +150,7 @@ dummy_chan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, ch->buf = b; ch->caps = &sc->caps; - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); bufsz = pcm_getbuffersize(sc->dev, 2048, 2048, 65536); buf = malloc(bufsz, M_DEVBUF, M_WAITOK | M_ZERO); @@ -199,10 +199,10 @@ dummy_chan_trigger(kobj_t obj, void *data, int go) struct dummy_chan *ch = data; struct dummy_softc *sc = ch->sc; - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); if (sc->stopped) { - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return (0); } @@ -222,7 +222,7 @@ dummy_chan_trigger(kobj_t obj, void *data, int go) break; } - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return (0); } @@ -320,8 +320,9 @@ dummy_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; - sc->lock = snd_mtxcreate(device_get_nameunit(dev), "snd_dummy softc"); - callout_init_mtx(&sc->callout, sc->lock, 0); + mtx_init(&sc->lock, device_get_nameunit(dev), "snd_dummy softc", + MTX_DEF); + callout_init_mtx(&sc->callout, &sc->lock, 0); sc->cap_fmts[0] = SND_FORMAT(AFMT_S32_LE, 2, 0); sc->cap_fmts[1] = SND_FORMAT(AFMT_S24_LE, 2, 0); @@ -362,12 +363,12 @@ dummy_detach(device_t dev) struct dummy_softc *sc = device_get_softc(dev); int err; - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); sc->stopped = true; - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); callout_drain(&sc->callout); err = pcm_unregister(dev); - snd_mtxfree(sc->lock); + mtx_destroy(&sc->lock); return (err); } diff --git a/sys/dev/sound/pci/als4000.c b/sys/dev/sound/pci/als4000.c index a8c3303af74f..aea7cc6d3a64 100644 --- a/sys/dev/sound/pci/als4000.c +++ b/sys/dev/sound/pci/als4000.c @@ -79,7 +79,7 @@ struct sc_info { struct resource *reg, *irq; int regid, irqid; void *ih; - struct mtx *lock; + struct mtx lock; unsigned int bufsz; struct sc_chinfo pch, rch; @@ -208,7 +208,7 @@ alschan_init(kobj_t obj, void *devinfo, struct sc_info *sc = devinfo; struct sc_chinfo *ch; - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); if (dir == PCMDIR_PLAY) { ch = &sc->pch; ch->gcr_fifo_status = ALS_GCR_FIFO0_STATUS; @@ -223,7 +223,7 @@ alschan_init(kobj_t obj, void *devinfo, ch->format = SND_FORMAT(AFMT_U8, 1, 0); ch->speed = 8000; ch->buffer = b; - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); if (sndbuf_alloc(ch->buffer, sc->parent_dmat, 0, sc->bufsz) != 0) return NULL; @@ -278,9 +278,9 @@ alschan_getptr(kobj_t obj, void *data) struct sc_info *sc = ch->parent; int32_t pos, sz; - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); pos = als_gcr_rd(ch->parent, ch->gcr_fifo_status) & 0xffff; - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); sz = ch->buffer->bufsize; return (2 * sz - pos - 1) % sz; } @@ -397,7 +397,7 @@ alspchan_trigger(kobj_t obj, void *data, int go) if (!PCMTRIG_COMMON(go)) return 0; - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); switch(go) { case PCMTRIG_START: als_playback_start(ch); @@ -409,7 +409,7 @@ alspchan_trigger(kobj_t obj, void *data, int go) default: break; } - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return 0; } @@ -493,7 +493,7 @@ alsrchan_trigger(kobj_t obj, void *data, int go) struct sc_chinfo *ch = data; struct sc_info *sc = ch->parent; - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); switch(go) { case PCMTRIG_START: als_capture_start(ch); @@ -503,7 +503,7 @@ alsrchan_trigger(kobj_t obj, void *data, int go) als_capture_stop(ch); break; } - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return 0; } @@ -637,19 +637,19 @@ als_intr(void *p) struct sc_info *sc = (struct sc_info *)p; u_int8_t intr, sb_status; - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); intr = als_intr_rd(sc); if (intr & 0x80) { - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); chn_intr(sc->pch.channel); - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); } if (intr & 0x40) { - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); chn_intr(sc->rch.channel); - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); } /* ACK interrupt in PCI core */ @@ -667,7 +667,7 @@ als_intr(void *p) if (sb_status & ALS_IRQ_CR1E) als_ack_read(sc, ALS_CR1E_ACK_PORT); - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return; } @@ -749,10 +749,7 @@ als_resource_free(device_t dev, struct sc_info *sc) bus_dma_tag_destroy(sc->parent_dmat); sc->parent_dmat = 0; } - if (sc->lock) { - snd_mtxfree(sc->lock); - sc->lock = NULL; - } + mtx_destroy(&sc->lock); } static int @@ -808,7 +805,8 @@ als_pci_attach(device_t dev) char status[SND_STATUSLEN]; sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK | M_ZERO); - sc->lock = snd_mtxcreate(device_get_nameunit(dev), "snd_als4000 softc"); + mtx_init(&sc->lock, device_get_nameunit(dev), "snd_als4000 softc", + MTX_DEF); sc->dev = dev; pci_enable_busmaster(dev); @@ -882,11 +880,11 @@ als_pci_suspend(device_t dev) { struct sc_info *sc = pcm_getdevinfo(dev); - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); sc->pch.dma_was_active = als_playback_stop(&sc->pch); sc->rch.dma_was_active = als_capture_stop(&sc->rch); als_uninit(sc); - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return 0; } @@ -895,16 +893,16 @@ als_pci_resume(device_t dev) { struct sc_info *sc = pcm_getdevinfo(dev); - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); if (als_init(sc) != 0) { device_printf(dev, "unable to reinitialize the card\n"); - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return ENXIO; } if (mixer_reinit(dev) != 0) { device_printf(dev, "unable to reinitialize the mixer\n"); - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return ENXIO; } @@ -915,7 +913,7 @@ als_pci_resume(device_t dev) if (sc->rch.dma_was_active) { als_capture_start(&sc->rch); } - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return 0; } diff --git a/sys/dev/sound/pci/atiixp.c b/sys/dev/sound/pci/atiixp.c index 30f061fd9388..12906ecc6253 100644 --- a/sys/dev/sound/pci/atiixp.c +++ b/sys/dev/sound/pci/atiixp.c @@ -129,7 +129,7 @@ struct atiixp_info { uint32_t blkcnt; int registered_channels; - struct mtx *lock; + struct mtx lock; struct callout poll_timer; int poll_ticks, polling; }; @@ -139,9 +139,9 @@ struct atiixp_info { #define atiixp_wr(_sc, _reg, _val) \ bus_space_write_4((_sc)->st, (_sc)->sh, _reg, _val) -#define atiixp_lock(_sc) snd_mtxlock((_sc)->lock) -#define atiixp_unlock(_sc) snd_mtxunlock((_sc)->lock) -#define atiixp_assert(_sc) snd_mtxassert((_sc)->lock) +#define atiixp_lock(_sc) mtx_lock(&(_sc)->lock) +#define atiixp_unlock(_sc) mtx_unlock(&(_sc)->lock) +#define atiixp_assert(_sc) mtx_assert(&(_sc)->lock, MA_OWNED) static uint32_t atiixp_fmt_32bit[] = { SND_FORMAT(AFMT_S16_LE, 2, 0), @@ -1019,7 +1019,7 @@ atiixp_chip_post_init(void *arg) if (sc->codec_not_ready_bits == 0) { /* wait for the interrupts to happen */ do { - msleep(sc, sc->lock, PWAIT, "ixpslp", max(hz / 10, 1)); + msleep(sc, &sc->lock, PWAIT, "ixpslp", max(hz / 10, 1)); if (sc->codec_not_ready_bits != 0) break; } while (--timeout); @@ -1157,10 +1157,7 @@ atiixp_release_resource(struct atiixp_info *sc) bus_dma_tag_destroy(sc->sgd_dmat); sc->sgd_dmat = NULL; } - if (sc->lock) { - snd_mtxfree(sc->lock); - sc->lock = NULL; - } + mtx_destroy(&sc->lock); free(sc, M_DEVBUF); } @@ -1190,7 +1187,8 @@ atiixp_pci_attach(device_t dev) int i; sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK | M_ZERO); - sc->lock = snd_mtxcreate(device_get_nameunit(dev), "snd_atiixp softc"); + mtx_init(&sc->lock, device_get_nameunit(dev), "snd_atiixp softc", + MTX_DEF); sc->dev = dev; callout_init(&sc->poll_timer, 1); diff --git a/sys/dev/sound/pci/cmi.c b/sys/dev/sound/pci/cmi.c index 28427d449c8d..99925d236c08 100644 --- a/sys/dev/sound/pci/cmi.c +++ b/sys/dev/sound/pci/cmi.c @@ -116,7 +116,7 @@ struct sc_info { struct resource *reg, *irq; int regid, irqid; void *ih; - struct mtx *lock; + struct mtx lock; int spdif_enabled; unsigned int bufsz; @@ -361,13 +361,13 @@ cmichan_init(kobj_t obj, void *devinfo, } ch->dir = dir; - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); if (ch->dir == PCMDIR_PLAY) { cmi_dma_prog(sc, ch, CMPCI_REG_DMA0_BASE); } else { cmi_dma_prog(sc, ch, CMPCI_REG_DMA1_BASE); } - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return ch; } @@ -394,7 +394,7 @@ cmichan_setformat(kobj_t obj, void *data, u_int32_t format) f |= CMPCI_REG_FORMAT_MONO; } - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); if (ch->dir == PCMDIR_PLAY) { cmi_partial_wr4(ch->parent, CMPCI_REG_CHANNEL_FORMAT, @@ -408,7 +408,7 @@ cmichan_setformat(kobj_t obj, void *data, u_int32_t format) CMPCI_REG_CH1_FORMAT_MASK, f); } - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); ch->fmt = format; return 0; @@ -422,7 +422,7 @@ cmichan_setspeed(kobj_t obj, void *data, u_int32_t speed) u_int32_t r, rsp __unused; r = cmpci_rate_to_regvalue(speed); - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); if (ch->dir == PCMDIR_PLAY) { if (speed < 44100) { /* disable if req before rate change */ @@ -450,7 +450,7 @@ cmichan_setspeed(kobj_t obj, void *data, u_int32_t speed) rsp >>= CMPCI_REG_ADC_FS_SHIFT; rsp &= CMPCI_REG_ADC_FS_MASK; } - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); ch->spd = cmpci_regvalue_to_rate(r); DEB(printf("cmichan_setspeed (%s) %d -> %d (%d)\n", @@ -484,7 +484,7 @@ cmichan_trigger(kobj_t obj, void *data, int go) if (!PCMTRIG_COMMON(go)) return 0; - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); if (ch->dir == PCMDIR_PLAY) { switch(go) { case PCMTRIG_START: @@ -506,7 +506,7 @@ cmichan_trigger(kobj_t obj, void *data, int go) break; } } - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return 0; } @@ -517,13 +517,13 @@ cmichan_getptr(kobj_t obj, void *data) struct sc_info *sc = ch->parent; u_int32_t physptr, bufptr, sz; - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); if (ch->dir == PCMDIR_PLAY) { physptr = cmi_rd(sc, CMPCI_REG_DMA0_BASE, 4); } else { physptr = cmi_rd(sc, CMPCI_REG_DMA1_BASE, 4); } - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); sz = ch->buffer->bufsize; bufptr = (physptr - ch->phys_buf + sz - ch->bps) % sz; @@ -538,7 +538,7 @@ cmi_intr(void *data) u_int32_t intrstat; u_int32_t toclear; - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); intrstat = cmi_rd(sc, CMPCI_REG_INTR_STATUS, 4); if ((intrstat & CMPCI_REG_ANY_INTR) != 0) { toclear = 0; @@ -554,7 +554,7 @@ cmi_intr(void *data) if (toclear) { cmi_clr4(sc, CMPCI_REG_INTR_CTRL, toclear); - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); /* Signal interrupts to channel */ if (intrstat & CMPCI_REG_CH0_INTR) { @@ -565,14 +565,14 @@ cmi_intr(void *data) chn_intr(sc->rch.channel); } - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); cmi_set4(sc, CMPCI_REG_INTR_CTRL, toclear); } } if(sc->mpu_intr) { (sc->mpu_intr)(sc->mpu); } - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return; } @@ -799,10 +799,10 @@ cmi_muninit(struct mpu401 *arg, void *cookie) { struct sc_info *sc = cookie; - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); sc->mpu_intr = NULL; sc->mpu = NULL; - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return 0; } @@ -933,7 +933,8 @@ cmi_attach(device_t dev) char status[SND_STATUSLEN]; sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK | M_ZERO); - sc->lock = snd_mtxcreate(device_get_nameunit(dev), "snd_cmi softc"); + mtx_init(&sc->lock, device_get_nameunit(dev), "snd_cmi softc", + MTX_DEF); pci_enable_busmaster(dev); sc->dev = dev; @@ -1007,8 +1008,7 @@ cmi_attach(device_t dev) bus_release_resource(dev, SYS_RES_IRQ, sc->irqid, sc->irq); if (sc->reg) bus_release_resource(dev, SYS_RES_IOPORT, sc->regid, sc->reg); - if (sc->lock) - snd_mtxfree(sc->lock); + mtx_destroy(&sc->lock); if (sc) free(sc, M_DEVBUF); @@ -1037,7 +1037,7 @@ cmi_detach(device_t dev) if (sc->mpu_reg) bus_release_resource(dev, SYS_RES_IOPORT, sc->mpu_regid, sc->mpu_reg); - snd_mtxfree(sc->lock); + mtx_destroy(&sc->lock); free(sc, M_DEVBUF); return 0; @@ -1048,11 +1048,11 @@ cmi_suspend(device_t dev) { struct sc_info *sc = pcm_getdevinfo(dev); - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); sc->pch.dma_was_active = cmi_ch0_stop(sc, &sc->pch); sc->rch.dma_was_active = cmi_ch1_stop(sc, &sc->rch); cmi_power(sc, 3); - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return 0; } @@ -1061,17 +1061,17 @@ cmi_resume(device_t dev) { struct sc_info *sc = pcm_getdevinfo(dev); - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); cmi_power(sc, 0); if (cmi_init(sc) != 0) { device_printf(dev, "unable to reinitialize the card\n"); - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return ENXIO; } if (mixer_reinit(dev) == -1) { device_printf(dev, "unable to reinitialize the mixer\n"); - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return ENXIO; } @@ -1086,7 +1086,7 @@ cmi_resume(device_t dev) cmichan_setformat(NULL, &sc->rch, sc->rch.fmt); cmi_ch1_start(sc, &sc->rch); } - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return 0; } diff --git a/sys/dev/sound/pci/emu10k1.c b/sys/dev/sound/pci/emu10k1.c index a85031977f4b..da2ddc99f5a1 100644 --- a/sys/dev/sound/pci/emu10k1.c +++ b/sys/dev/sound/pci/emu10k1.c @@ -218,7 +218,7 @@ struct sc_info { struct resource *reg, *irq; void *ih; - struct mtx *lock; + struct mtx lock; unsigned int bufsz; int timer, timerinterval; @@ -820,10 +820,10 @@ emupchan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, ch->blksz = sc->bufsz / 2; ch->fmt = SND_FORMAT(AFMT_U8, 1, 0); ch->spd = 8000; - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); ch->master = emu_valloc(sc); ch->slave = emu_valloc(sc); - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); r = (emu_vinit(sc, ch->master, ch->slave, sc->bufsz, ch->buffer)) ? NULL : ch; @@ -837,9 +837,9 @@ emupchan_free(kobj_t obj, void *data) struct sc_info *sc = ch->parent; int r; - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); r = emu_memfree(sc, ch->buffer->buf); - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return r; } @@ -869,9 +869,9 @@ emupchan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize) struct sc_info *sc = ch->parent; ch->blksz = blocksize; - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); emu_settimer(sc); - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return blocksize; } @@ -884,7 +884,7 @@ emupchan_trigger(kobj_t obj, void *data, int go) if (!PCMTRIG_COMMON(go)) return 0; - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); if (go == PCMTRIG_START) { emu_vsetup(ch); emu_vwrite(sc, ch->master); @@ -901,7 +901,7 @@ emupchan_trigger(kobj_t obj, void *data, int go) } ch->run = (go == PCMTRIG_START) ? 1 : 0; emu_vtrigger(sc, ch->master, ch->run); - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return 0; } @@ -912,9 +912,9 @@ emupchan_getptr(kobj_t obj, void *data) struct sc_info *sc = ch->parent; int r; - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); r = emu_vpos(sc, ch->master); - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return r; } @@ -984,10 +984,10 @@ emurchan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, if (sndbuf_alloc(ch->buffer, sc->parent_dmat, 0, sc->bufsz) != 0) return NULL; else { - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); emu_wrptr(sc, 0, ch->basereg, ch->buffer->buf_addr); emu_wrptr(sc, 0, ch->sizereg, 0); /* off */ - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return ch; } } @@ -1027,9 +1027,9 @@ emurchan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize) struct sc_info *sc = ch->parent; ch->blksz = blocksize; - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); emu_settimer(sc); - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return blocksize; } @@ -1069,7 +1069,7 @@ emurchan_trigger(kobj_t obj, void *data, int go) sz = EMU_RECBS_BUFSIZE_4096; } - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); switch(go) { case PCMTRIG_START: ch->run = 1; @@ -1111,7 +1111,7 @@ emurchan_trigger(kobj_t obj, void *data, int go) default: break; } - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return 0; } @@ -1123,9 +1123,9 @@ emurchan_getptr(kobj_t obj, void *data) struct sc_info *sc = ch->parent; int r; - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); r = emu_rdptr(sc, 0, ch->idxreg) & 0x0000ffff; - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); return r; } @@ -1171,9 +1171,9 @@ emu_muninit(struct mpu401 *arg, void *cookie) { struct sc_info *sc = cookie; - snd_mtxlock(sc->lock); + mtx_lock(&sc->lock); sc->mpu_intr = NULL; - snd_mtxunlock(sc->lock); + mtx_unlock(&sc->lock); *** 3084 LINES SKIPPED *** From nobody Fri Nov 28 14:35:31 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dHwnc14H2z6HZdv for ; Fri, 28 Nov 2025 14:35:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dHwnb61zTz3skB for ; Fri, 28 Nov 2025 14:35:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764340531; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cpN/l+XKNFMcLUQAWHih1HruIsi60PugloXGJq6Of/U=; b=fXmZFIYL2bT3A/mViTzCwzjHjwWPacroUW3d2lNLB5GN9ZgP77LgfRnvDC6QaLLV7/cqtA 2uGH0olceHJU64GLHiHMPnFjM0e4iVhO2iseLtxnQSp9uwqtXqBnPjmsJ3cK/GM9qnK/oU /NLqPcq/Oee4p7JZCNGlhtrPpbi0ob6D9ZzLWX+hW6jpoVHD+QicGzyPY8nBc9JCBVTOXi bpPlzz+XsimFfWxqNC7JkqMqkPTwns2+2Gj5wISclygZdBc992ot8XgyK7wPuDABbdKa+c qHUu8pmrEAy+Sv+AcUwwB8aes4AvweEVn0S2Eb70VDAZ7M/m1/5JOaN77kiGOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764340531; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cpN/l+XKNFMcLUQAWHih1HruIsi60PugloXGJq6Of/U=; b=YUigsNme6hvkV9dIm42THgVpyxUpM26EiMSGnWCNvOLh4f2N2vFgpzO3M4CogQ/ESGbJuW dQvLqO8e6rjtTvJCvce+0fgAV/sfGRtrbRDxwAFbFmQrYDid5K1xxL44WkJLTKPqqOSHRY ZYkGKcERIJHzDucvTLQec9AG5jNSK9NY4LGTAR6UIkplqVS9ew3lSfV0gZS7mPyASUHqX5 Jh0OgHtql4Ru0XOxHAHnFEiEcgZzMoDfG7NkQ2ghxxnciI1D4WBeHsal2tpmw0WMvNIxps nLTW+86MMQLo1j1rKaWJTCl5QnVQ2BgCkncJLp0xZzc+PRUAeriz1dkGBGtaAw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764340531; a=rsa-sha256; cv=none; b=IqK9rjN64L06nYPs6sN5Da5jJlTYuIOEexLLIZEZflnce8awXnjnQI2OpuHZcdqv/+2Grz lhzf/rTf5d4ywYEEf48pWTQIHs+R9nB5n3YjD3RGP6bfyCuR0JZMMzKXAxprTcKmdEhNlI 6h2J/e+W2hNEXKgVy2ghgQgMWhc66P/RbgmCTbLoOBNQfKikSeWVSlVsaeoqE7snIN4tXM 8GiVXjyh6LWBWZfwEsC/3DVUDnntJNG5EiG/n9lp3XuKh1MjYhRlZ1gFNG6k3UO63qU9xR Xj8SFtsZIlq5iMaBA1BaodBFSRZP8Uajs8/IdTm+1Vik3vM5EXIZ89u0F2KTVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dHwnb5Pdwz15JG for ; Fri, 28 Nov 2025 14:35:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2a4fb by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 28 Nov 2025 14:35:31 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Nicolas Provost From: Christos Margiolis Subject: git: b1e9512cba83 - stable/15 - sound: Fix revents in midi_poll() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: b1e9512cba837df02879427a77bc3acdc1658dfc Auto-Submitted: auto-generated Date: Fri, 28 Nov 2025 14:35:31 +0000 Message-Id: <6929b333.2a4fb.67996735@gitrepo.freebsd.org> The branch stable/15 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=b1e9512cba837df02879427a77bc3acdc1658dfc commit b1e9512cba837df02879427a77bc3acdc1658dfc Author: Nicolas Provost AuthorDate: 2025-11-24 13:35:08 +0000 Commit: Christos Margiolis CommitDate: 2025-11-28 14:35:00 +0000 sound: Fix revents in midi_poll() Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: christos Pull Request: https://github.com/freebsd/freebsd-src/pull/1887 (cherry picked from commit 8f8b8e4af91d4e158caf6ba4b728482311bfc7c3) --- sys/dev/sound/midi/midi.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/sys/dev/sound/midi/midi.c b/sys/dev/sound/midi/midi.c index e14a28557406..cca7b93abf5f 100644 --- a/sys/dev/sound/midi/midi.c +++ b/sys/dev/sound/midi/midi.c @@ -658,21 +658,19 @@ midi_poll(struct cdev *i_dev, int events, struct thread *td) mtx_lock(&m->lock); mtx_lock(&m->qlock); - if (events & (POLLIN | POLLRDNORM)) + if (events & (POLLIN | POLLRDNORM)) { if (!MIDIQ_EMPTY(m->inq)) - events |= events & (POLLIN | POLLRDNORM); - - if (events & (POLLOUT | POLLWRNORM)) - if (MIDIQ_AVAIL(m->outq) < m->hiwat) - events |= events & (POLLOUT | POLLWRNORM); - - if (revents == 0) { - if (events & (POLLIN | POLLRDNORM)) + revents |= events & (POLLIN | POLLRDNORM); + else selrecord(td, &m->rsel); - - if (events & (POLLOUT | POLLWRNORM)) + } + if (events & (POLLOUT | POLLWRNORM)) { + if (MIDIQ_AVAIL(m->outq) < m->hiwat) + revents |= events & (POLLOUT | POLLWRNORM); + else selrecord(td, &m->wsel); } + mtx_unlock(&m->lock); mtx_unlock(&m->qlock); From nobody Fri Nov 28 14:35:32 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dHwnd2Frlz6HZbS for ; Fri, 28 Nov 2025 14:35: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dHwnc6xktz3sNy for ; Fri, 28 Nov 2025 14:35:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764340533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bqv9Jqe1pWJ5+574IxKH1tWKniRMLcREF3dpqi3eMpI=; b=rw6F6boSDsFApj223Hz5c+miw2+g02dn22vI3zCtT19TXA8wmnXZYZEiAaU0GBam6+znqB 0NR+hQqJehq8FzeAotun+m98TopXzuP6bAdzO41S73dvh5EdFKMhTh3MrWMrWHO6LSMp0n fVIyxGo+6aVY0V0rbhg0quNfbsmUVTZgbYoKgwvpRQSbMKTQvj8rLFryC3iVmdXJSffWBl Dh1uCXkcd4pPOczsUAkYiuTujmjLoWzrfRr9jTLhneOt0t5MwxdMfHN8vJe4VF8K3aXLVu xgKXJKXao/NOzt53cWoNY/QylNXNRF1qV4QJHGW3n16p5ot8gY3/bBLgWim4vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764340533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bqv9Jqe1pWJ5+574IxKH1tWKniRMLcREF3dpqi3eMpI=; b=rkS4DI7tYvuVCrpcFyCps1ofTw5lnpfv6G//2HT/hhvwg6Lm4s4TZ+hUpYv6QL95qW54TG ccwQOUAAaTqYtVqnq6luMqxRqa7kS6VXgLZPuD8CY+rSlgSYTFmRJ7aH5ni9iQorCP7p/t TJXXDO+WvRIrIB5Iynco72G7uUZrcSSi01hbAvGthj4k+Oid0zljFOby0jTksFo1NGD2cp L2uf23ZM7pSLxSX4auJuPAL3o4LqUoEfKfdip16BKmGvCvRjCyWQ4GQOGKMQksss4f9CFy JxPnT8+oq7s0UiZb9VB7g1J4fI+Lrr30kUtC/zm7oPeKgbTSKQu0vNQXBRFa7g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764340533; a=rsa-sha256; cv=none; b=xkKHfXpR0j8gJ/+5QQXaWMKw1uoL05WzroOEbYfPF+dIev3GIoE6CoKF0pdjs6Q/zE6mge yPK/YNy+dbWKLJ8zNkq72UU4Lrz+zfGODGZNo2zn8Pw1JP2q/L3BID2qlp1EYwNBWceT3d EeO8GjbEnctbJ6/mXxUdaCuNTo5cXweDSX9qhOZAPpZR7xv6LyPEoB+1bSEXsMi3cw5oUy o2KysOhlF6sAIck/I1Hw0QkqZwpuoO+TCxYZsp6yyHxhN9NDfElOSGqsUjhyhzWw5wnapL QAJ8w6L4oNthUSnkw0Jm7m1Gw5pBA69F5oMAYThIC+zLwC0TrV2xy8aEhGzw9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dHwnc6DmDz15Pd for ; Fri, 28 Nov 2025 14:35:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2a528 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 28 Nov 2025 14:35:32 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Goran=?utf-8?Q? Meki=C4=87?= From: Christos Margiolis Subject: git: 7587270512d1 - stable/15 - sound examples: Fix buffer mapping/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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 7587270512d12f13d2d225dc893ec85bfb6501a7 Auto-Submitted: auto-generated Date: Fri, 28 Nov 2025 14:35:32 +0000 Message-Id: <6929b334.2a528.3774ff06@gitrepo.freebsd.org> The branch stable/15 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=7587270512d12f13d2d225dc893ec85bfb6501a7 commit 7587270512d12f13d2d225dc893ec85bfb6501a7 Author: Goran Mekić AuthorDate: 2025-11-26 19:33:05 +0000 Commit: Christos Margiolis CommitDate: 2025-11-28 14:35:00 +0000 sound examples: Fix buffer mapping/allocation The buffer in struct config should be allocated or mmap'ed. The code without this patch allocates the buffer unconditionally, even for mmap configs. MFC after: 1 week Reviewed by: christos Differential Revision: https://reviews.freebsd.org/D53939 (cherry picked from commit ebf1d98d60725feccd726ef8e4fa518661f9eae0) --- share/examples/sound/oss.h | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/share/examples/sound/oss.h b/share/examples/sound/oss.h index 437c6d69d454..e1ba4165810f 100644 --- a/share/examples/sound/oss.h +++ b/share/examples/sound/oss.h @@ -25,6 +25,7 @@ * SUCH DAMAGE. */ +#include #include #include @@ -84,7 +85,7 @@ static void oss_init(struct config *config) { unsigned long request = SNDCTL_DSP_GETOSPACE; - int tmp = 0; + int tmp = 0, prot = 0; if ((config->fd = open(config->device, config->mode)) < 0) err(1, "Error opening the device %s", config->device); @@ -194,7 +195,6 @@ oss_init(struct config *config) } config->sample_count = config->buffer_info.bytes / config->sample_size; config->chsamples = config->sample_count / config->audio_info.max_channels; - config->buf = malloc(config->buffer_info.bytes); printf("bytes: %d, fragments: %d, fragsize: %d, fragstotal: %d, " "samples: %d\n", @@ -202,21 +202,36 @@ oss_init(struct config *config) config->buffer_info.fragsize, config->buffer_info.fragstotal, config->sample_count); - /* Set the trigger */ + /* Set trigger direction and mmap protection */ switch (config->mode & O_ACCMODE) { case O_RDONLY: tmp = PCM_ENABLE_INPUT; + prot = PROT_READ; break; case O_WRONLY: tmp = PCM_ENABLE_OUTPUT; + prot = PROT_WRITE; break; case O_RDWR: tmp = PCM_ENABLE_INPUT | PCM_ENABLE_OUTPUT; + prot = PROT_READ | PROT_WRITE; break; default: errx(1, "Invalid mode %d", config->mode); break; } + + /* Map or allocate the buffer */ + if (config->mmap) { + config->buf = mmap(NULL, config->buffer_info.bytes, prot, MAP_SHARED, config->fd, 0); + if (config->buf == MAP_FAILED) + err(1, "Memory map failed"); + } else { + if ((config->buf = malloc(config->buffer_info.bytes)) == NULL) + err(1, "Allocating buffer failed"); + } + + /* Set the trigger */ if (ioctl(config->fd, SNDCTL_DSP_SETTRIGGER, &tmp) < 0) err(1, "Failed to set trigger"); } From nobody Fri Nov 28 20:37:12 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dJ4pw3fXZz6JF8R for ; Fri, 28 Nov 2025 20:37:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dJ4pw2lGgz3YrM for ; Fri, 28 Nov 2025 20:37:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764362232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1041ihqDZRthqOCSmMoXoKZQVrkCD+/5jig4Rp8Nhls=; b=UBmYkyoGd8WdDQbxREqyaMBkfH9Qa7rHI5HzMSB2gwLfWZ+kfOT6/FLF/MryAbkTBSJSNJ N8GouBlgDoUrcR6qhUDDk7wEtI6ZPTllFqNlvE49FYNaK375aw/tR/zKcR/Io+Jr7ITkWK zrXJY9Trve+EURQzT57NsmbLb4tehJJID25kRaou1Ft5QkNwQpSmObmDUuMhPeZO2pRpk8 7Kz1bcsratbdNF8zVEQLSJnz785LOLgn5jjgg3ZShuP7GU04US1MpHlXQ3GW+Usfpymeod 2YWqoXY8knqi1bzD419eVGFTFDxrS+8gihT9gc91FRvG3y3Nl1BGu/A7+0gfrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764362232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1041ihqDZRthqOCSmMoXoKZQVrkCD+/5jig4Rp8Nhls=; b=fd+XKULgMWT6Evlj3FJrx/ZBNho+jLiW0jixMXCGmbC+K3GA6V0C073p1rJLCK7e7ZJucW s9KxDoZ1NDkGe0Thjvyv0PdXOA0/UmIukYc0zMlbtrRQNa/wjKaOlcZUa1tZa3g2zNIJ+E uTx2Hw0CY7/F6gfYoAJeM9RH8HHGdT+c0aQF5wTdAeTX5jnZwQbfi4+UtCl3WCCNtknnvI 59HPT6+yp8ekiWoNOQcCLz27JkqvMsaab+qztG4LzYMfY95vnqHYSlA3baehASxckkEi/+ VeVzyrdrYbeaJuHt5g6uOzVnIqc1pbMW1BUEB5kwPJpAX2u1ZkML7CWDahUJVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764362232; a=rsa-sha256; cv=none; b=muJNuk2mEzfgmTNTmPwgujjARsZeOA9k1KQG6yzu/Q73eylBDvUv5fjJl5VLSyMBR0nbBj qp9p653NRz3vjFE+2oxFTO39LGuDeeJOcQPBj8BT5WTwUjZcWBWDmOFeRdfzkxgU2lq5R3 ePixrqcuWO5UTagcrlra+ZM241jVZDYz3fE1irjGzA/pDjTSAKH6CIPGW/4fba6thp98XY 7amADH6eOrTLuaE/IFOjjApRcPkFEbUQYvntva9rRELzHfqYp3I2dii6XtbifC8QhRuXh8 1bNYVnBrs9//g+QxEO2mpbuhBALrvSbmColaWshDH3ojglVv0nFwxakKeKEQ1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dJ4pw2LBsz2Wd for ; Fri, 28 Nov 2025 20:37:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2da36 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 28 Nov 2025 20:37:12 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 6da01ce6d36f - stable/15 - pf: fix another endpoint-independent crash List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 6da01ce6d36f6b0cc781894d49bff93bf0d9c881 Auto-Submitted: auto-generated Date: Fri, 28 Nov 2025 20:37:12 +0000 Message-Id: <692a07f8.2da36.834a69b@gitrepo.freebsd.org> The branch stable/15 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6da01ce6d36f6b0cc781894d49bff93bf0d9c881 commit 6da01ce6d36f6b0cc781894d49bff93bf0d9c881 Author: Kristof Provost AuthorDate: 2025-11-21 09:03:36 +0000 Commit: Kristof Provost CommitDate: 2025-11-28 20:33:47 +0000 pf: fix another endpoint-independent crash In c12013f5bb38 we fixed udp_mapping cleanup issues in pf_get_sport(), but missed the static-port case (i.e. low == 0 && high == 0). We could still exit pf_get_sport() without either inserting the udp_mapping or freeing it. Address this and add a test case to provoke the problem. Reviewed by: thj MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D53856 (cherry picked from commit 7dedc3c21436bb5a1220f8901992d2772a163f78) --- sys/netpfil/pf/pf_lb.c | 16 ++++++++++++---- tests/sys/netpfil/pf/nat.sh | 30 ++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index c6cdc4e03f3e..beffdcd017b4 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -407,10 +407,18 @@ pf_get_sport(struct pf_pdesc *pd, struct pf_krule *r, struct pf_addr *naddr, */ key.port[sidx] = pd->nsport; if (!pf_find_state_all_exists(&key, dir)) { - MPASS(udp_mapping == NULL || - *udp_mapping == NULL); - *nport = pd->nsport; - return (0); + if (udp_mapping && *udp_mapping != NULL) { + (*udp_mapping)->endpoints[1].port = pd->nsport; + if (pf_udp_mapping_insert(*udp_mapping) == 0) { + *nport = pd->nsport; + return (0); + } + } else { + MPASS(udp_mapping == NULL || + *udp_mapping == NULL); + *nport = pd->nsport; + return (0); + } } } else if (low == high) { key.port[sidx] = htons(low); diff --git a/tests/sys/netpfil/pf/nat.sh b/tests/sys/netpfil/pf/nat.sh index 7d5db6743424..71af0f31d174 100644 --- a/tests/sys/netpfil/pf/nat.sh +++ b/tests/sys/netpfil/pf/nat.sh @@ -286,6 +286,35 @@ endpoint_independent_exhaust_cleanup() rm -f server2.out } +atf_test_case "endpoint_independent_static_port" "cleanup" +endpoint_independent_static_port_head() +{ + atf_set descr 'Test that a client behind NAT gets the same external IP:port for different servers, with static-port' + atf_set require.user root +} + +endpoint_independent_static_port_body() +{ + endpoint_independent_setup # Sets ${epair_…} variables + + endpoint_independent_common \ + "nat on ${epair_nat}a inet from ! (${epair_nat}a) to any -> (${epair_nat}a)" \ + "nat on ${epair_nat}a inet from ! (${epair_nat}a) to any -> (${epair_nat}a) static-port sticky-address endpoint-independent" + + # Exhaust the available nat ports + for i in $(seq 1 10); do + echo "ping" | jexec client nc -u 198.51.100.32 1234 -w 0 + echo "ping" | jexec client nc -u 198.51.100.22 1234 -w 0 + done +} + +endpoint_independent_static_port_cleanup() +{ + pft_cleanup + rm -f server1.out + rm -f server2.out +} + atf_test_case "endpoint_independent_pass" "cleanup" endpoint_independent_pass_head() { @@ -881,6 +910,7 @@ atf_init_test_cases() atf_add_test_case "nested_anchor" atf_add_test_case "endpoint_independent_compat" atf_add_test_case "endpoint_independent_exhaust" + atf_add_test_case "endpoint_independent_static_port" atf_add_test_case "endpoint_independent_pass" atf_add_test_case "nat6_nolinklocal" atf_add_test_case "empty_table_source_hash" From nobody Fri Nov 28 20:58:23 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dJ5HT2VNVz6JH7v for ; Fri, 28 Nov 2025 20:58: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dJ5HT14sbz3cLM for ; Fri, 28 Nov 2025 20:58:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764363509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RvZrJRQHPEPA3WDhaJDEGt8bkDgq5Eo9TAaUDs0iXaE=; b=Au8TiUZhUUWQ6CKBgbF6knARQmORjBmxwLZkYIOHcu0LxdBCBnpa+WBd3ECcCMQxRO7co5 cUU+vbYcyinRm/mVQhCkH8r38IvG1Y3yWcV8gOw0uvxqjI/jMvkNLA8Hb1V2/uNF5721O6 ejg+v1gWhGHNhTQuYJjSVnXdNrdsDw1nOANha7b8oBkAbhR6WPcp94TzvQbycmS4o/KcVK eOb/kGH1Q+KXGTpovqaa57y+3uCHMFCiw0M7GO9z38llBaxwxPYELKcqRMw/kZY4PDhjl2 fnJbm3xc63dUeYIGZF6EXH1j7O1svmlznVSWcLN3Bo3orNJllgqnrButuwfm6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764363509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RvZrJRQHPEPA3WDhaJDEGt8bkDgq5Eo9TAaUDs0iXaE=; b=Y2YErO8jQr3CA8VsVwMlehZns940byfDI5QXN2Z0GFpqTFZ3OAdzUmP2EMOMNoyMhwWTq8 dWr8eOyDJmjFLLs6hUMm6szPKX8JHRgzqa1OFo78HXgEyaxM94G6BepjHlWHsS8cM987Kf 6Jv5Y85uWlopVVvtFCBmU6QkSWDhrU9J0EiFJ1BWwO1nqA2LNJ9OTOrfkCBicSVKGNbih0 9iOgtKwFRBne6UdF3IWmcnI5NqdvpKfL8qryUxzokxu2s/bXDs0j32/RiNxNOxsTmbqNk/ 7j4asHChA1JLmkjL9NxRPLoV61p3+2DwiE2U8gJfF08z3iYgD0du77iphOmBXQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764363509; a=rsa-sha256; cv=none; b=pyBUD6a8NiqJL0gsKgmkppfZstvVlu3j91t6SBA9mWvJ1h4+BPR4IS4kdtVWn/mjrxqYdB 6dtfXZdlPfS3HfepbdmoepA3YBz7Gi5qua5tyiYnOw8JP32dJSxNtRkSifbM6Yto/pyWPt eSEJ1BNpneTHFIdskK0UyhiY4mtKNl56XjtRAdnRn6jCxb2y7vPDejL0yX10Kdwp8pHrLJ XQYX1yNMMacosCS733dI+2rYzazkPSFjA0Dd5uKtcCnNDG7Z3k/yN+ECd/AJqB1Vv3z4DU 8iyD6bX86hDCuipN72mxmHxomy4li2ta11nefAwIQY3XCkonryzfdrlbkVC6eQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dJ5HS4RSfz3F0 for ; Fri, 28 Nov 2025 20:58:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 30da7 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 28 Nov 2025 20:58:23 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Krzysztof Galazka Subject: git: 18e83edd1378 - stable/15 - igb(4): Fix VLAN support on VFs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kgalazka X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 18e83edd13786718b8c2528b540c91c36275f234 Auto-Submitted: auto-generated Date: Fri, 28 Nov 2025 20:58:23 +0000 Message-Id: <692a0cef.30da7.67d50b8a@gitrepo.freebsd.org> The branch stable/15 has been updated by kgalazka: URL: https://cgit.FreeBSD.org/src/commit/?id=18e83edd13786718b8c2528b540c91c36275f234 commit 18e83edd13786718b8c2528b540c91c36275f234 Author: Krzysztof Galazka AuthorDate: 2025-11-17 15:30:26 +0000 Commit: Krzysztof Galazka CommitDate: 2025-11-28 20:57:44 +0000 igb(4): Fix VLAN support on VFs Virtual Functions are considered untrusted and have no control over VLAN filtering configuration in HW. To allow using VLANs on VF intreface driver has to assume that VLAN HW Filtering is always enabled and pass requests for adding or removing VLAN tags to Physical Function driver using Mailbox API. Signed-off-by: Krzysztof Galazka Approved by: kbowling (mentor) Reviewed by: erj (previous version) Tested by: gowtham.kumar.ks_intel.com Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D53245 (cherry picked from commit 1839526b7315cae62efbd2d1493e6243439effcb) --- sys/dev/e1000/if_em.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 168648c8c5ea..465e019029d9 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -4023,7 +4023,15 @@ em_if_vlan_register(if_ctx_t ctx, u16 vtag) bit = vtag & 0x1F; sc->shadow_vfta[index] |= (1 << bit); ++sc->num_vlans; - em_if_vlan_filter_write(sc); + if (!sc->vf_ifp) + em_if_vlan_filter_write(sc); + else + /* + * Physical funtion may reject registering VLAN + * but we have no way to inform the stack + * about that. + */ + e1000_vfta_set_vf(&sc->hw, vtag, true); } static void @@ -4036,7 +4044,10 @@ em_if_vlan_unregister(if_ctx_t ctx, u16 vtag) bit = vtag & 0x1F; sc->shadow_vfta[index] &= ~(1 << bit); --sc->num_vlans; - em_if_vlan_filter_write(sc); + if (!sc->vf_ifp) + em_if_vlan_filter_write(sc); + else + e1000_vfta_set_vf(&sc->hw, vtag, false); } static bool @@ -4094,22 +4105,15 @@ em_if_vlan_filter_write(struct e1000_softc *sc) { struct e1000_hw *hw = &sc->hw; - if (sc->vf_ifp) - return; + KASSERT(!sc->vf_ifp, ("VLAN filter write on VF\n")); /* Disable interrupts for lem(4) devices during the filter change */ if (hw->mac.type < em_mac_min) em_if_intr_disable(sc->ctx); for (int i = 0; i < EM_VFTA_SIZE; i++) - if (sc->shadow_vfta[i] != 0) { - /* XXXKB: incomplete VF support, we returned above */ - if (sc->vf_ifp) - e1000_vfta_set_vf(hw, sc->shadow_vfta[i], - true); - else - e1000_write_vfta(hw, i, sc->shadow_vfta[i]); - } + if (sc->shadow_vfta[i] != 0) + e1000_write_vfta(hw, i, sc->shadow_vfta[i]); /* Re-enable interrupts for lem-class devices */ if (hw->mac.type < em_mac_min) @@ -4124,8 +4128,10 @@ em_setup_vlan_hw_support(if_ctx_t ctx) if_t ifp = iflib_get_ifp(ctx); u32 reg; - /* XXXKB: Return early if we are a VF until VF decap and filter - * management is ready and tested. + /* + * Only PFs have control over VLAN HW filtering + * configuration. VFs have to act as if it's always + * enabled. */ if (sc->vf_ifp) return; From nobody Fri Nov 28 20:59:38 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dJ5Jq0HT7z6JGvb for ; Fri, 28 Nov 2025 20:59:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dJ5Jp6kMYz3cTX for ; Fri, 28 Nov 2025 20:59:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764363579; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZhSkBlnNgVIgh3oxaIwjVHZdoyEU1K/2d8lYMZLIJ2w=; b=QO1kSCaULnhaNUptuYZzd27DzTshbZDwy1djPtMSZAZYunedJq42l4yeloW5OESx+3s6uP KNOeGna3VCw7qJdKXADHqaTFmCOrK8rWtPla6G3LTOBTtWCVF0j0os5+aKbMGl8ckfZJm5 THGN5ecQjKm43oiuhWRMsu5e3Tnw2npFawroVG5jxpuhw5xn8WZKTWMtCoqcV3Iux1Kew1 yPs5zp7ZkM5XbnPSxalCVY7uKsz2ksUOG85cEmGOs+bvmVhF7HLnZFpqtrCD+ByYICOpJW o7cVt4B7ZRNJ0OkIs6qHofRFMnVnKDYVuUPWKY2Fxp+8zW8rO9OEnZZQ1zLANw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764363579; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZhSkBlnNgVIgh3oxaIwjVHZdoyEU1K/2d8lYMZLIJ2w=; b=hUPkKBDW0zx/Cg/eHhl/D3cV6DvwpAamaL/PsHjYI7n8j5Ou3ikBwQri9GEDRcjEoytX8M TbULojOtVau08n9+8xgZBVxyWDxFAeXydtTOdc0d06J5wUHwYlWvz6tye1Y6bpQ53oUSR1 EuJpA+4TWfcTDTK4WhHF5JU3McY7a8+SgCnOkprnaslOT0j/Q1lsNk+c8H6vsmgFXrv6CU 2qne7+hSFpLuGg+udaFBFc5pDN+XOU2ddsfEwFOXHJuuSuISabNkWOdnvCXklsrUWpXU3F G+oL3J0/JBxgU9JS5HGlYB8gtrG05vUk5sXVvOExCk34j7uaQZmeD71+t5bpjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764363579; a=rsa-sha256; cv=none; b=JMHqqWwDbfBxrynJCygVlDkUnkLzALh9A1Tr36ONV2XPOxWVjthRGSZu0vrbXwtdCuV1VY VkL7hWMhRtNsYrgu1pEonPvtGBBFZmPgEVK0MkCztFQr3UyR/B1/vYvWA/Y+Wein+fFl5S 6WRUTLOI+ijA/EzAC1u6lbat7BAI4rMeA7B5R84CIWkG34W/Tz6/GRYMgjedN/nunM0K8B yXuufm5AA0OsbykTT+9T5KTIvj7mJr+mpTDws8E9NdGvJFunC7ixzwVbl1ed/GTcegjTLT D6qfOVVhgRX3QDaDKjInWD+OhYRt+FYx8DGlveP1iz1jCkZwvDGFUX+08eYy+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dJ5Jp613Wz39J for ; Fri, 28 Nov 2025 20:59:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 30a8f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 28 Nov 2025 20:59:38 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Krzysztof Galazka Subject: git: 40a6ada9e614 - stable/14 - igb(4): Fix VLAN support on VFs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kgalazka X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 40a6ada9e614c1a6fd93e4164f7de416af1a23b2 Auto-Submitted: auto-generated Date: Fri, 28 Nov 2025 20:59:38 +0000 Message-Id: <692a0d3a.30a8f.3f503b03@gitrepo.freebsd.org> The branch stable/14 has been updated by kgalazka: URL: https://cgit.FreeBSD.org/src/commit/?id=40a6ada9e614c1a6fd93e4164f7de416af1a23b2 commit 40a6ada9e614c1a6fd93e4164f7de416af1a23b2 Author: Krzysztof Galazka AuthorDate: 2025-11-17 15:30:26 +0000 Commit: Krzysztof Galazka CommitDate: 2025-11-28 20:59:24 +0000 igb(4): Fix VLAN support on VFs Virtual Functions are considered untrusted and have no control over VLAN filtering configuration in HW. To allow using VLANs on VF intreface driver has to assume that VLAN HW Filtering is always enabled and pass requests for adding or removing VLAN tags to Physical Function driver using Mailbox API. Signed-off-by: Krzysztof Galazka Approved by: kbowling (mentor) Reviewed by: erj (previous version) Tested by: gowtham.kumar.ks_intel.com Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D53245 (cherry picked from commit 1839526b7315cae62efbd2d1493e6243439effcb) --- sys/dev/e1000/if_em.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 9040949b36c7..ce4269728903 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -4048,7 +4048,15 @@ em_if_vlan_register(if_ctx_t ctx, u16 vtag) bit = vtag & 0x1F; sc->shadow_vfta[index] |= (1 << bit); ++sc->num_vlans; - em_if_vlan_filter_write(sc); + if (!sc->vf_ifp) + em_if_vlan_filter_write(sc); + else + /* + * Physical funtion may reject registering VLAN + * but we have no way to inform the stack + * about that. + */ + e1000_vfta_set_vf(&sc->hw, vtag, true); } static void @@ -4061,7 +4069,10 @@ em_if_vlan_unregister(if_ctx_t ctx, u16 vtag) bit = vtag & 0x1F; sc->shadow_vfta[index] &= ~(1 << bit); --sc->num_vlans; - em_if_vlan_filter_write(sc); + if (!sc->vf_ifp) + em_if_vlan_filter_write(sc); + else + e1000_vfta_set_vf(&sc->hw, vtag, false); } static bool @@ -4119,22 +4130,15 @@ em_if_vlan_filter_write(struct e1000_softc *sc) { struct e1000_hw *hw = &sc->hw; - if (sc->vf_ifp) - return; + KASSERT(!sc->vf_ifp, ("VLAN filter write on VF\n")); /* Disable interrupts for lem(4) devices during the filter change */ if (hw->mac.type < em_mac_min) em_if_intr_disable(sc->ctx); for (int i = 0; i < EM_VFTA_SIZE; i++) - if (sc->shadow_vfta[i] != 0) { - /* XXXKB: incomplete VF support, we returned above */ - if (sc->vf_ifp) - e1000_vfta_set_vf(hw, sc->shadow_vfta[i], - true); - else - e1000_write_vfta(hw, i, sc->shadow_vfta[i]); - } + if (sc->shadow_vfta[i] != 0) + e1000_write_vfta(hw, i, sc->shadow_vfta[i]); /* Re-enable interrupts for lem-class devices */ if (hw->mac.type < em_mac_min) @@ -4149,8 +4153,10 @@ em_setup_vlan_hw_support(if_ctx_t ctx) if_t ifp = iflib_get_ifp(ctx); u32 reg; - /* XXXKB: Return early if we are a VF until VF decap and filter - * management is ready and tested. + /* + * Only PFs have control over VLAN HW filtering + * configuration. VFs have to act as if it's always + * enabled. */ if (sc->vf_ifp) return; From nobody Fri Nov 28 21:15:44 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dJ5gP4k2Mz6JJxS for ; Fri, 28 Nov 2025 21:15: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dJ5gP11g0z3db1 for ; Fri, 28 Nov 2025 21:15:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764364545; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xxx4waLUKlxraWTymFwXpcJYEdwfW4NT0cePu6tatEg=; b=lgnrfSKdcM8vqfiUe5SBZOc7u/eFpcmKOCOy2VXu//4kBdjDHQPNbso5OLfmtdsCsGDG7C S+0q656qJLygo5wkhWk0rTOSH0Sw4Ap6YH1FiY8zIfSEaISGvdsVbfIrDqe4eYbDKxPjdS /0MVSRfUciDrjcRdKvwB7FZEVJpH6oW7aLzPnSoZWvSfaNMi6nmySTSfJ5+qwryiTv7p3e qWs1BZXpByg9xhc3nIfODR6JCY6hJ+qLEy8k3aAZUIuG/ZdzifxOmPzVMuLvQU4RMmwNhv fJtnCyCK2TPurj5hEy8HXsc0uZqjSUs1TZ9s3lS5X4yb49byJk3AyPRHj+XBCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764364545; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xxx4waLUKlxraWTymFwXpcJYEdwfW4NT0cePu6tatEg=; b=FD8zARYfRIMod7MDhIxHd2okSaoPdgDwajWH7Rb7hzQX3aDa7KuaOvvE5VcQq85d80Uw6Y ClkpaPAmA8JGkT057g8vtDJbg3d0qY2f2fAvNcLIY+RHsgqdEGi9pBxlFuMztiE7/H8j/2 oo/8hfL0FBscWOOW1Pe0VcUdKuzCrD7bN9id3tlQbn43erByftexnHkrN0J9bCw17IZj6s exmkXKGBO4571GtZe0/dI4z5Hf+LLTdN9ayLVV8PwYWimbz5deXcxV1h8p80w8CIc90zfx 4OBu7IXj3ZD5YBl+khoJFTLMS5e/JMMkLFJ3l5BIkFh46fZdZSrdbvam8ejiIw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764364545; a=rsa-sha256; cv=none; b=eRi7Pp7dtibZYbKzKdFNevfdjkfR+NtCbddcOVES/MtagiVnm5zdIy5/VZp9/cJ1jrQoQy ZowhNvjJd/7/FjCOESAQyehxgxgYgo5DpZHIoB7FMTxlFN+4FWwXjy5WSAAIll4jdfp4Z8 LehW0CbdtUw5GAplP3SlY81EvJk0MFzNbTuyDBpq0bB4+zfxYhP8AAi2AvlMrFOMMle299 LgpVmmUZ5HwW6+sKuq0QF8gZyCDD//Rhwa6c7cUuUxkx6oCRkQfSAcNRyi78Ah0tfF7uvc ZFhZJ+2/1wlv097EzOO7IIsf1XRQAa4anYEzco7K4z/xCqoFWmvzp5YcHDOA8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dJ5gN6tDMz3nC for ; Fri, 28 Nov 2025 21:15:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 331fc by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 28 Nov 2025 21:15:44 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Bhosale, Yogesh From: Krzysztof Galazka Subject: git: 0224c9f6d0f3 - stable/15 - ix(4): Add support for debug dump for E610 adapters List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kgalazka X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 0224c9f6d0f3454cc6ffc82d2f6079f5924ac9d6 Auto-Submitted: auto-generated Date: Fri, 28 Nov 2025 21:15:44 +0000 Message-Id: <692a1100.331fc.d29ab49@gitrepo.freebsd.org> The branch stable/15 has been updated by kgalazka: URL: https://cgit.FreeBSD.org/src/commit/?id=0224c9f6d0f3454cc6ffc82d2f6079f5924ac9d6 commit 0224c9f6d0f3454cc6ffc82d2f6079f5924ac9d6 Author: Bhosale, Yogesh AuthorDate: 2025-10-10 09:39:16 +0000 Commit: Krzysztof Galazka CommitDate: 2025-11-28 21:08:55 +0000 ix(4): Add support for debug dump for E610 adapters This is part 2 of the support for the new Intel Ethernet E610 family of devices. Intel E610 Ethernet Controller devices feature a debug dump capability that allows you to capture runtime register values directly from the hardware, with assistance from the firmware. These registers are organized into clusters based on their function, enabling targeted debugging. This information is consolidated into a single dump file, facilitating the debugging of complex issues encountered in the field. The debug dump provides a snapshot of the device's current hardware configuration, including switch tables, transmit scheduler tables, and other relevant data. It captures the state of specified clusters and serves as a stateless snapshot of the entire device. This update introduces ioctl and sysctl support for the debug dump feature. Signed-off-by: Yogesh Bhosale yogesh.bhosale@intel.com Co-developed-by: Krzysztof Galazka krzysztof.galazka@intel.com Approved by: kbowling (mentor), erj (mentor) Tested by: gowtham.kumar.ks_intel.com Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D50934 (cherry picked from commit 2170400142b99c0eb604403b74ebd88c05dd7ed4) --- sys/dev/ixgbe/if_ix.c | 521 +++++++++++++++++++++++++++++++++++++++++ sys/dev/ixgbe/ixgbe.h | 52 ++++ sys/dev/ixgbe/ixgbe_features.h | 1 + 3 files changed, 574 insertions(+) diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index 5c4ca585c323..7f234ce45dbd 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -192,6 +192,8 @@ static int ixgbe_if_i2c_req(if_ctx_t, struct ifi2creq *); static bool ixgbe_if_needs_restart(if_ctx_t, enum iflib_restart_event); int ixgbe_intr(void *); +static int ixgbe_if_priv_ioctl(if_ctx_t ctx, u_long command, caddr_t data); + /************************************************************************ * Function prototypes ************************************************************************/ @@ -239,6 +241,13 @@ static void ixgbe_setup_vlan_hw_support(if_ctx_t); static void ixgbe_config_gpie(struct ixgbe_softc *); static void ixgbe_config_delay_values(struct ixgbe_softc *); +static void ixgbe_add_debug_sysctls(struct ixgbe_softc *sc); +static void ixgbe_add_debug_dump_sysctls(struct ixgbe_softc *sc); +static int ixgbe_debug_dump_ioctl(struct ixgbe_softc *sc, struct ifdrv *ifd); +static u8 ixgbe_debug_dump_print_cluster(struct ixgbe_softc *sc, + struct sbuf *sbuf, u8 cluster_id); +static int ixgbe_nvm_access_ioctl(struct ixgbe_softc *sc, struct ifdrv *ifd); + /* Sysctl handlers */ static int ixgbe_sysctl_flowcntl(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_advertise(SYSCTL_HANDLER_ARGS); @@ -260,6 +269,9 @@ static int ixgbe_sysctl_wol_enable(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_wufc(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_tso_tcp_flags_mask(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_debug_dump_set_clusters(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_dump_debug_dump(SYSCTL_HANDLER_ARGS); + /* Deferred interrupt tasklets */ static void ixgbe_handle_msf(void *); static void ixgbe_handle_mod(void *); @@ -330,6 +342,7 @@ static device_method_t ixgbe_if_methods[] = { DEVMETHOD(ifdi_get_counter, ixgbe_if_get_counter), DEVMETHOD(ifdi_i2c_req, ixgbe_if_i2c_req), DEVMETHOD(ifdi_needs_restart, ixgbe_if_needs_restart), + DEVMETHOD(ifdi_priv_ioctl, ixgbe_if_priv_ioctl), #ifdef PCI_IOV DEVMETHOD(ifdi_iov_init, ixgbe_if_iov_init), DEVMETHOD(ifdi_iov_uninit, ixgbe_if_iov_uninit), @@ -1015,6 +1028,8 @@ ixgbe_if_attach_pre(if_ctx_t ctx) if (hw->mac.type == ixgbe_mac_E610) ixgbe_init_aci(hw); + sc->do_debug_dump = false; + if (hw->mac.ops.fw_recovery_mode && hw->mac.ops.fw_recovery_mode(hw)) { device_printf(dev, @@ -1396,6 +1411,248 @@ ixgbe_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) } } +/************************************************************************ + * ixgbe_if_priv_ioctl - Ioctl handler for driver + * + * Handler for custom driver specific ioctls + * + * return 0 on success, positive on failure + ************************************************************************/ +static int +ixgbe_if_priv_ioctl(if_ctx_t ctx, u_long command, caddr_t data) +{ + struct ixgbe_softc *sc = iflib_get_softc(ctx); + struct ifdrv *ifd; + device_t dev = sc->dev; + + /* Make sure the command type is valid */ + switch (command) { + case SIOCSDRVSPEC: + case SIOCGDRVSPEC: + /* Accepted commands */ + break; + case SIOCGPRIVATE_0: + /* + * Although we do not support this ioctl command, it's expected + * that iflib will forward it to the IFDI_PRIV_IOCTL handler. + * Do not print a message in this case. + */ + return (ENOTSUP); + default: + /* + * If we get a different command for this function, it's + * definitely unexpected, so log a message indicating what + * command we got for debugging purposes. + */ + device_printf(dev, + "%s: unexpected ioctl command %08lx\n", + __func__, command); + return (EINVAL); + } + + ifd = (struct ifdrv *)data; + + switch (ifd->ifd_cmd) { + case IXGBE_NVM_ACCESS: + IOCTL_DEBUGOUT("ioctl: NVM ACCESS"); + return (ixgbe_nvm_access_ioctl(sc, ifd)); + case IXGBE_DEBUG_DUMP: + IOCTL_DEBUGOUT("ioctl: DEBUG DUMP"); + return (ixgbe_debug_dump_ioctl(sc, ifd)); + default: + IOCTL_DEBUGOUT1( + "ioctl: UNKNOWN SIOC(S|G)DRVSPEC (0x%X) command\n", + (int)ifd->ifd_cmd); + return (EINVAL); + } + + return (0); +} + +/************************************************************************ + * ixgbe_nvm_access_ioctl + * + * Handles an NVM access ioctl request + ************************************************************************/ +static int +ixgbe_nvm_access_ioctl(struct ixgbe_softc *sc, struct ifdrv *ifd) +{ + struct ixgbe_nvm_access_data *data; + struct ixgbe_nvm_access_cmd *cmd; + struct ixgbe_hw *hw = &sc->hw; + size_t ifd_len = ifd->ifd_len; + size_t malloc_len; + device_t dev = sc->dev; + u8 *nvm_buffer; + s32 error = 0; + + /* + * ifioctl forwards SIOCxDRVSPEC to iflib without conducting + * a privilege check. Subsequently, iflib passes the ioctl to the driver + * without verifying privileges. To prevent non-privileged threads from + * accessing this interface, perform a privilege check at this point. + */ + error = priv_check(curthread, PRIV_DRIVER); + if (error) + return (error); + + if (ifd_len < sizeof(*cmd)) { + device_printf(dev, + "%s: ifdrv length is too small. Got %zu, " + "but expected %zu\n", + __func__, ifd_len, sizeof(*cmd)); + return (EINVAL); + } + + if (ifd->ifd_data == NULL) { + device_printf(dev, "%s: No ifd data buffer.\n", + __func__); + return (EINVAL); + } + + malloc_len = max(ifd_len, sizeof(*data) + sizeof(*cmd)); + + nvm_buffer = (u8 *)malloc(malloc_len, M_IXGBE, M_ZERO | M_NOWAIT); + if (!nvm_buffer) + return (ENOMEM); + + /* Copy the NVM access command and data in from user space */ + error = copyin(ifd->ifd_data, nvm_buffer, ifd_len); + if (error) { + device_printf(dev, "%s: Failed to copy data in, error: %d\n", + __func__, error); + goto cleanup_free_nvm_buffer; + } + + /* + * The NVM command structure is immediately followed by data which + * varies in size based on the command. + */ + cmd = (struct ixgbe_nvm_access_cmd *)nvm_buffer; + data = (struct ixgbe_nvm_access_data *) + (nvm_buffer + sizeof(struct ixgbe_nvm_access_cmd)); + + /* Handle the NVM access request */ + error = ixgbe_handle_nvm_access(hw, cmd, data); + if (error) { + device_printf(dev, "%s: NVM access request failed, error %d\n", + __func__, error); + } + + /* Copy the possibly modified contents of the handled request out */ + error = copyout(nvm_buffer, ifd->ifd_data, ifd_len); + if (error) { + device_printf(dev, "%s: Copying response back to " + "user space failed, error %d\n", + __func__, error); + goto cleanup_free_nvm_buffer; + } + +cleanup_free_nvm_buffer: + free(nvm_buffer, M_IXGBE); + return (error); +} + +/************************************************************************ + * ixgbe_debug_dump_ioctl + * + * Makes debug dump of internal FW/HW data. + ************************************************************************/ +static int +ixgbe_debug_dump_ioctl(struct ixgbe_softc *sc, struct ifdrv *ifd) +{ + struct ixgbe_debug_dump_cmd *dd_cmd; + struct ixgbe_hw *hw = &sc->hw; + size_t ifd_len = ifd->ifd_len; + device_t dev = sc->dev; + s32 error = 0; + + if (!(sc->feat_en & IXGBE_FEATURE_DBG_DUMP)) + return (ENODEV); + + /* Data returned from ACI command */ + u16 ret_buf_size = 0; + u16 ret_next_cluster = 0; + u16 ret_next_table = 0; + u32 ret_next_index = 0; + + /* + * ifioctl forwards SIOCxDRVSPEC to iflib without conducting + * a privilege check. Subsequently, iflib passes the ioctl to the driver + * without verifying privileges. To prevent non-privileged threads from + * accessing this interface, perform a privilege check at this point. + */ + error = priv_check(curthread, PRIV_DRIVER); + if (error) + return (error); + + if (ifd_len < sizeof(*dd_cmd)) { + device_printf(dev, + "%s: ifdrv length is too small. Got %zu, " + "but expected %zu\n", + __func__, ifd_len, sizeof(*dd_cmd)); + return (EINVAL); + } + + if (ifd->ifd_data == NULL) { + device_printf(dev, "%s: No ifd data buffer.\n", + __func__); + return (EINVAL); + } + + dd_cmd = (struct ixgbe_debug_dump_cmd *)malloc(ifd_len, M_IXGBE, + M_NOWAIT | M_ZERO); + if (!dd_cmd) { + error = -ENOMEM; + goto out; + } + /* copy data from userspace */ + error = copyin(ifd->ifd_data, dd_cmd, ifd_len); + if (error) { + device_printf(dev, "%s: Failed to copy data in, error: %d\n", + __func__, error); + goto out; + } + + /* ACI command requires buf_size arg to be grater than 0 */ + if (dd_cmd->data_size == 0) { + device_printf(dev, "%s: data_size must be greater than 0\n", + __func__); + error = EINVAL; + goto out; + } + + /* Zero the data buffer memory space */ + memset(dd_cmd->data, 0, ifd_len - sizeof(*dd_cmd)); + + error = ixgbe_aci_get_internal_data(hw, dd_cmd->cluster_id, + dd_cmd->table_id, dd_cmd->offset, dd_cmd->data, dd_cmd->data_size, + &ret_buf_size, &ret_next_cluster, &ret_next_table, &ret_next_index); + if (error) { + device_printf(dev, + "%s: Failed to get internal FW/HW data, error: %d\n", + __func__, error); + goto out; + } + + dd_cmd->cluster_id = ret_next_cluster; + dd_cmd->table_id = ret_next_table; + dd_cmd->offset = ret_next_index; + dd_cmd->data_size = ret_buf_size; + + error = copyout(dd_cmd, ifd->ifd_data, ifd->ifd_len); + if (error) { + device_printf(dev, + "%s: Failed to copy data out, error: %d\n", + __func__, error); + } + +out: + free(dd_cmd, M_IXGBE); + + return (error); +} + /************************************************************************ * ixgbe_add_media_types ************************************************************************/ @@ -2884,6 +3141,264 @@ ixgbe_sysctl_interrupt_rate_handler(SYSCTL_HANDLER_ARGS) return (0); } /* ixgbe_sysctl_interrupt_rate_handler */ +/************************************************************************ + * ixgbe_debug_dump_print_cluster + ************************************************************************/ +static u8 +ixgbe_debug_dump_print_cluster(struct ixgbe_softc *sc, struct sbuf *sbuf, + u8 cluster_id) +{ + u16 data_buf_size = IXGBE_ACI_MAX_BUFFER_SIZE; + device_t dev = sc->dev; + struct ixgbe_hw *hw = &sc->hw; + const u8 reserved_buf[8] = {}; + int max_aci_calls = 1000; + int error, counter = 0; + u8 *data_buf; + + /* Input parameters / loop variables */ + u16 table_id = 0; + u32 offset = 0; + + /* Data returned from ACI command */ + u16 ret_buf_size = 0; + u16 ret_next_cluster = 0; + u16 ret_next_table = 0; + u32 ret_next_index = 0; + + data_buf = (u8 *)malloc(data_buf_size, M_IXGBE, M_NOWAIT | M_ZERO); + if (!data_buf) + return (0); + + DEBUGOUT2("%s: dumping cluster id (relative) %d\n", + __func__, cluster_id); + + do { + DEBUGOUT3("table_id 0x%04x offset 0x%08x buf_size %d\n", + table_id, offset, data_buf_size); + + error = ixgbe_aci_get_internal_data(hw, cluster_id, table_id, + offset, data_buf, data_buf_size, &ret_buf_size, + &ret_next_cluster, &ret_next_table, &ret_next_index); + if (error) { + device_printf(dev, + "%s: Failed to get internal FW/HW data, error: %d, " + "last aci status: %d\n", + __func__, error, hw->aci.last_status); + break; + } + + DEBUGOUT3("ret_table_id 0x%04x ret_offset 0x%08x " + "ret_buf_size %d\n", + ret_next_table, ret_next_index, ret_buf_size); + + /* Print cluster id */ + u32 print_cluster_id = (u32)cluster_id; + sbuf_bcat(sbuf, &print_cluster_id, sizeof(print_cluster_id)); + /* Print table id */ + u32 print_table_id = (u32)table_id; + sbuf_bcat(sbuf, &print_table_id, sizeof(print_table_id)); + /* Print table length */ + u32 print_table_length = (u32)ret_buf_size; + sbuf_bcat(sbuf, &print_table_length, + sizeof(print_table_length)); + /* Print current offset */ + u32 print_curr_offset = offset; + sbuf_bcat(sbuf, &print_curr_offset, sizeof(print_curr_offset)); + /* Print reserved bytes */ + sbuf_bcat(sbuf, reserved_buf, sizeof(reserved_buf)); + /* Print data */ + sbuf_bcat(sbuf, data_buf, ret_buf_size); + + /* Prepare for the next loop spin */ + memset(data_buf, 0, data_buf_size); + + bool last_index = (ret_next_index == 0xffffffff); + bool last_table = ((ret_next_table == 0xff || + ret_next_table == 0xffff) && + last_index); + + if (last_table) { + /* End of the cluster */ + DEBUGOUT1("End of the cluster ID %d\n", cluster_id); + break; + } else if (last_index) { + /* End of the table */ + table_id = ret_next_table; + offset = 0; + } else { + /* More data left in the table */ + offset = ret_next_index; + } + } while (++counter < max_aci_calls); + + if (counter >= max_aci_calls) + device_printf(dev, "Exceeded nr of ACI calls for cluster %d\n", + cluster_id); + + free(data_buf, M_IXGBE); + + return (++cluster_id); +} /* ixgbe_print_debug_dump_cluster */ + +/************************************************************************ + * ixgbe_sysctl_debug_dump_set_clusters + * + * Sets the cluster to dump from FW when Debug Dump requested. + ************************************************************************/ +static int +ixgbe_sysctl_debug_dump_set_clusters(SYSCTL_HANDLER_ARGS) +{ + struct ixgbe_softc *sc = (struct ixgbe_softc *)arg1; + u32 clusters = sc->debug_dump_cluster_mask; + device_t dev = sc->dev; + int error; + + error = sysctl_handle_32(oidp, &clusters, 0, req); + if ((error) || !req->newptr) + return (error); + + if (clusters & ~(IXGBE_DBG_DUMP_VALID_CLUSTERS_MASK)) { + device_printf(dev, + "%s: Unrecognized parameter: %u\n", + __func__, clusters); + sc->debug_dump_cluster_mask = + IXGBE_ACI_DBG_DUMP_CLUSTER_ID_INVALID; + return (EINVAL); + } + + sc->debug_dump_cluster_mask = clusters; + + return (0); +} /* ixgbe_sysctl_debug_dump_set_clusters */ + +/************************************************************************ + * ixgbe_sysctl_dump_debug_dump + ************************************************************************/ +static int +ixgbe_sysctl_dump_debug_dump(SYSCTL_HANDLER_ARGS) +{ + struct ixgbe_softc *sc = (struct ixgbe_softc *)arg1; + device_t dev = sc->dev; + struct sbuf *sbuf; + int error = 0; + + UNREFERENCED_PARAMETER(arg2); + + if (!sc->do_debug_dump) { + if (req->oldptr == NULL && req->newptr == NULL) { + error = SYSCTL_OUT(req, 0, 0); + return (error); + } + + char input_buf[2] = ""; + error = sysctl_handle_string(oidp, input_buf, + sizeof(input_buf), req); + if ((error) || (req->newptr == NULL)) + return (error); + + if (input_buf[0] == '1') { + if (sc->debug_dump_cluster_mask == + IXGBE_ACI_DBG_DUMP_CLUSTER_ID_INVALID) { + device_printf(dev, + "Debug Dump failed because an invalid " + "cluster was specified.\n"); + return (EINVAL); + } + + sc->do_debug_dump = true; + return (0); + } + + return (EINVAL); + } + + /* Caller just wants the upper bound for size */ + if (req->oldptr == NULL && req->newptr == NULL) { + size_t est_output_len = IXGBE_DBG_DUMP_BASE_SIZE; + if (sc->debug_dump_cluster_mask & 0x2) + est_output_len += IXGBE_DBG_DUMP_BASE_SIZE; + error = SYSCTL_OUT(req, 0, est_output_len); + return (error); + } + + sbuf = sbuf_new_for_sysctl(NULL, NULL, 128, req); + sbuf_clear_flags(sbuf, SBUF_INCLUDENUL); + + DEBUGOUT("FW Debug Dump running...\n"); + + if (sc->debug_dump_cluster_mask) { + for (u8 id = 0; id <= IXGBE_ACI_DBG_DUMP_CLUSTER_ID_MAX; id++) { + if (sc->debug_dump_cluster_mask & BIT(id)) { + DEBUGOUT1("Dumping cluster ID %u...\n", id); + ixgbe_debug_dump_print_cluster(sc, sbuf, id); + } + } + } else { + u8 next_cluster_id = 0; + do { + DEBUGOUT1("Dumping cluster ID %u...\n", + next_cluster_id); + next_cluster_id = ixgbe_debug_dump_print_cluster(sc, + sbuf, next_cluster_id); + } while (next_cluster_id != 0 && + next_cluster_id <= IXGBE_ACI_DBG_DUMP_CLUSTER_ID_MAX); + } + + sbuf_finish(sbuf); + sbuf_delete(sbuf); + + sc->do_debug_dump = false; + + return (error); +} /* ixgbe_sysctl_dump_debug_dump */ + +/************************************************************************ + * ixgbe_add_debug_dump_sysctls + ************************************************************************/ +static void +ixgbe_add_debug_dump_sysctls(struct ixgbe_softc *sc) +{ + struct sysctl_oid_list *debug_list, *dump_list; + struct sysctl_oid *dump_node; + struct sysctl_ctx_list *ctx; + device_t dev = sc->dev; + + ctx = device_get_sysctl_ctx(dev); + debug_list = SYSCTL_CHILDREN(sc->debug_sysctls); + + dump_node = SYSCTL_ADD_NODE(ctx, debug_list, OID_AUTO, "dump", + CTLFLAG_RD, NULL, "Internal FW/HW Dump"); + dump_list = SYSCTL_CHILDREN(dump_node); + + SYSCTL_ADD_PROC(ctx, dump_list, OID_AUTO, "clusters", + CTLTYPE_U32 | CTLFLAG_RW, sc, 0, + ixgbe_sysctl_debug_dump_set_clusters, "SU", + IXGBE_SYSCTL_DESC_DEBUG_DUMP_SET_CLUSTER); + + SYSCTL_ADD_PROC(ctx, dump_list, OID_AUTO, "dump", + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0, + ixgbe_sysctl_dump_debug_dump, "", + IXGBE_SYSCTL_DESC_DUMP_DEBUG_DUMP); +} /* ixgbe_add_debug_dump_sysctls */ + +static void +ixgbe_add_debug_sysctls(struct ixgbe_softc *sc) +{ + struct sysctl_oid_list *ctx_list; + struct sysctl_ctx_list *ctx; + device_t dev = sc->dev; + + ctx = device_get_sysctl_ctx(dev); + ctx_list = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); + + sc->debug_sysctls = SYSCTL_ADD_NODE(ctx, ctx_list, OID_AUTO, "debug", + CTLFLAG_RD, NULL, "Debug Sysctls"); + + if (sc->feat_en & IXGBE_FEATURE_DBG_DUMP) + ixgbe_add_debug_dump_sysctls(sc); +} /* ixgbe_add_debug_sysctls */ + /************************************************************************ * ixgbe_add_device_sysctls ************************************************************************/ @@ -2994,6 +3509,8 @@ ixgbe_add_device_sysctls(if_ctx_t ctx) CTLTYPE_INT | CTLFLAG_RW, sc, 0, ixgbe_sysctl_eee_state, "I", "EEE Power Save State"); } + + ixgbe_add_debug_sysctls(sc); } /* ixgbe_add_device_sysctls */ /************************************************************************ @@ -5184,6 +5701,7 @@ ixgbe_init_device_features(struct ixgbe_softc *sc) break; case ixgbe_mac_E610: sc->feat_cap |= IXGBE_FEATURE_RECOVERY_MODE; + sc->feat_cap |= IXGBE_FEATURE_DBG_DUMP; break; default: break; @@ -5205,6 +5723,9 @@ ixgbe_init_device_features(struct ixgbe_softc *sc) /* Recovery mode */ if (sc->feat_cap & IXGBE_FEATURE_RECOVERY_MODE) sc->feat_en |= IXGBE_FEATURE_RECOVERY_MODE; + /* FW Debug Dump */ + if (sc->feat_cap & IXGBE_FEATURE_DBG_DUMP) + sc->feat_en |= IXGBE_FEATURE_DBG_DUMP; /* Enabled via global sysctl... */ /* Flow Director */ diff --git a/sys/dev/ixgbe/ixgbe.h b/sys/dev/ixgbe/ixgbe.h index 844064bf8543..624b71acabea 100644 --- a/sys/dev/ixgbe/ixgbe.h +++ b/sys/dev/ixgbe/ixgbe.h @@ -46,6 +46,7 @@ #include #include #include +#include #include #include @@ -475,6 +476,20 @@ struct ixgbe_softc { u32 feat_cap; u32 feat_en; u16 lse_mask; + + struct sysctl_oid *debug_sysctls; + u32 debug_dump_cluster_mask; + bool do_debug_dump; +}; + +struct ixgbe_debug_dump_cmd { + u32 offset; /* offset to read/write from table, in bytes */ + u8 cluster_id; /* also used to get next cluster id */ + u16 table_id; + u16 data_size; /* size of data field, in bytes */ + u16 reserved1; + u32 reserved2; + u8 data[]; }; /* Precision Time Sync (IEEE 1588) defines */ @@ -499,6 +514,43 @@ struct ixgbe_softc { #define IXGBE_PHY_CURRENT_TEMP 0xC820 #define IXGBE_PHY_OVERTEMP_STATUS 0xC830 +/** + * The ioctl command number used by NVM update for accessing the driver for + * NVM access commands. + */ +#define IXGBE_NVM_ACCESS \ + (((((((('E' << 4) + '1') << 4) + 'K') << 4) + 'G') << 4) | 5) + +/* + * The ioctl command number used by a userspace tool for accessing the driver + * for getting debug dump data from the firmware. + */ +#define IXGBE_DEBUG_DUMP \ + (((((((('E' << 4) + '1') << 4) + 'K') << 4) + 'G') << 4) | 6) + +/* Debug Dump related definitions */ +#define IXGBE_ACI_DBG_DUMP_CLUSTER_ID_INVALID 0xFFFFFF +#define IXGBE_ACI_DBG_DUMP_CLUSTER_ID_BASE 50 +#define IXGBE_ACI_DBG_DUMP_CLUSTER_ID_MAX 1 + +#define IXGBE_DBG_DUMP_VALID_CLUSTERS_MASK 0x3 +#define IXGBE_DBG_DUMP_BASE_SIZE (2 * 1024 * 1024) + +#define IXGBE_SYSCTL_DESC_DEBUG_DUMP_SET_CLUSTER \ +"\nSelect clusters to dump with \"dump\" sysctl" \ +"\nFlags:" \ +"\n\t 0x1 - Link" \ +"\n\t 0x2 - Full CSR Space, excluding RCW registers" \ +"\n\t" \ +"\nUse \"sysctl -x\" to view flags properly." + +#define IXGBE_SYSCTL_DESC_DUMP_DEBUG_DUMP \ +"\nWrite 1 to output a FW debug dump containing the clusters " \ +"specified by the \"clusters\" sysctl" \ +"\nThe \"-b\" flag must be used in order to dump this data " \ +"as binary data because" \ +"\nthis data is opaque and not a string." + /* Sysctl help messages; displayed with sysctl -d */ #define IXGBE_SYSCTL_DESC_ADV_SPEED \ "\nControl advertised link speed using these flags:\n" \ diff --git a/sys/dev/ixgbe/ixgbe_features.h b/sys/dev/ixgbe/ixgbe_features.h index 0cef334a185f..bee9040319d8 100644 --- a/sys/dev/ixgbe/ixgbe_features.h +++ b/sys/dev/ixgbe/ixgbe_features.h @@ -57,6 +57,7 @@ #define IXGBE_FEATURE_LEGACY_IRQ (u32)(1 << 12) #define IXGBE_FEATURE_NEEDS_CTXD (u32)(1 << 13) #define IXGBE_FEATURE_RECOVERY_MODE (u32)(1 << 15) +#define IXGBE_FEATURE_DBG_DUMP (u32)(1 << 16) /* Check for OS support. Undefine features if not included in the OS */ #ifndef PCI_IOV From nobody Fri Nov 28 21:15:46 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dJ5gQ6ClPz6JJxs for ; Fri, 28 Nov 2025 21:15: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dJ5gQ2dm8z3dxh for ; Fri, 28 Nov 2025 21:15:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764364546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PYOrsqMreEmH/WPaWaolH7xI9S6M7Q8vRqo+btoCQoU=; b=N1tzUPDUP0HkN074PRjpWeqa4rixYTHG8hv+0A5n3BpMimfOFYSRbl/FistO+mHpl6Sk0e 53vq/xGs63u/E3Ot4IakIHMlGpLHJ2L0BnW1VhCy57W83DSIlFkVc4svDBm+NWeCBXANnf 6crIbUrnl1o2n1BXDoRRafGucZ0uq5ejwZ1n6YZRC95GmVUdyGYzCJPxmxkrJnIe+dDgFN X4CafxJjJNJqgv4Y8Ug6/2hpv4gmt9e3sGeIGMiZ4GRoJRCcnHphoLW/oIseKFu5fWW+cx ztGDJt0HfXZhYx52bPBVc4B6u5XwHg7sD9BRWfuDk/tUfwjrjg+AtuRpoXMccw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764364546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PYOrsqMreEmH/WPaWaolH7xI9S6M7Q8vRqo+btoCQoU=; b=qJDniXCBwwZeMxWmw3so18p2eZXN7Bn32W6+MKV+ppfXp+buKoqNiTItBoqJOyS80fE6ur rnC6LfINH8wy4G6wu27fnEq9PNIiAFgNDvxNoTPQ4BBZ9CZIACZLUVqCnloeMW4yyfVxkL lzJSR8UxONMY4QSLQeBJt3b5LR2ZTmyR44/zFcBB9bO3aUNderiUeuMg1JqzpPbFH4l8Mm 5wFpHUB5wnrLP1ucv6k7JsDqI5GAUZTkfbWhQWS9QIyLJw5AzrU/AiqQhOJXVZxWgLE7uL //fHwlLuKRPPNdvwxh6m14CGa1idW6/4tdFNdmIGh8LI4b43OQWmLgGhfitcmg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764364546; a=rsa-sha256; cv=none; b=bC4wr+JEPwvSd8YqH2NrcqBctU3tfH4o8u4tN6hf8O0T/7dvjnPqEfs+P7osueICrTS9MW PLvxjp7jsBqXknBqaYhr1m8W4ODFxDq9W0tKCYM2GyOEPH4nISsAR6Ua+9xu1Y9BjmLaM+ XWow1HGN1moOBpwZV4LJFvjpiHdzcpunCUjSGsUEyZNkqE/bvFhUKvTXpPq1jBRDmOfn/L /JhGKJ0Lc2zhQbUfnAdF0L8pFEeK++bavUlDiN3EFGwvksrRWHanF4PNV7Y/DR+bEW961M +nlBQnAQyW8/hoOBe3kqMR7UlDk186dGfz/R6OLLMTQT+45pCRMvxnarXQ3J0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dJ5gQ0305z3ht for ; Fri, 28 Nov 2025 21:15:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 32dcb by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 28 Nov 2025 21:15:46 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Yogesh Bhosale From: Krzysztof Galazka Subject: git: 283162be308e - stable/15 - ix.4: Document E610 debug dump List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kgalazka X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 283162be308e05f6a55c0a76f2f89891aea5f754 Auto-Submitted: auto-generated Date: Fri, 28 Nov 2025 21:15:46 +0000 Message-Id: <692a1102.32dcb.7a8568a7@gitrepo.freebsd.org> The branch stable/15 has been updated by kgalazka: URL: https://cgit.FreeBSD.org/src/commit/?id=283162be308e05f6a55c0a76f2f89891aea5f754 commit 283162be308e05f6a55c0a76f2f89891aea5f754 Author: Yogesh Bhosale AuthorDate: 2025-11-10 18:03:54 +0000 Commit: Krzysztof Galazka CommitDate: 2025-11-28 21:14:10 +0000 ix.4: Document E610 debug dump Explain how to collect E610 device debug dump data with sysctl for troubleshooting with Intel Customer Support. Fixes: 2170400142b9 (Add support for debug dump) Reviewed by: bcr, erj (previous version), ziaee Signed-off-by: Yogesh Bhosale Differential Revision: https://reviews.freebsd.org/D52990 (cherry picked from commit 8225ed665eea69b3df3ea57009cf8fe61863c1fc) --- share/man/man4/ix.4 | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/share/man/man4/ix.4 b/share/man/man4/ix.4 index e6f4276e1a77..09af85f5c4a7 100644 --- a/share/man/man4/ix.4 +++ b/share/man/man4/ix.4 @@ -132,6 +132,35 @@ Enable Adaptive Interrupt Moderation (AIM). Vary the interrupt rate over time based on the traffic for that interrupt vector. .El +.Sh SYSCTL VARIABLES +The +.Nm +driver supports the following +.Xr sysctl 8 +variables: +.Bl -tag -width "dev.ix.?.debug.dump.clusters" +.It Va dev.ix.?.debug.dump.clusters +Specify a bitmask to select firmware event clusters +to be included in the debug dump. +Possible values include: +.Pp +.Bl -tag -compact +.It 0 +All clusters excluding Manageability Transactions +.It 0x1 +Link cluster +.It 0x2 +Full CSR Space excluding RCW registers +.El +.Pp +This feature is only supported on E610 devices. +.It Va dev.ix.?.debug.dump.dump +Specify 1 to generate a per-device debugging snapshot. +Output must be redirected to a file +and decoded by Intel Customer Support. +.Pp +This feature is only supported on E610. +.El .Sh DIAGNOSTICS .Bl -diag .It "ix%d: Unable to allocate bus resource: memory" From nobody Fri Nov 28 21:21:14 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dJ5nk6CK5z6JKKd for ; Fri, 28 Nov 2025 21:21: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dJ5nk4pH8z3fml for ; Fri, 28 Nov 2025 21:21:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764364874; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vek54AdnOz9wh2Ve3gZaOJbIjEmXJ9WskYzBicE1zN0=; b=IXUMuKGTwb6oWc6yPWCHpo1hsebK7WsPQKC/2j2W8ecfUQflcKTIUmCvUQlPM9B14M7Ep6 /Oo67/coGXDOoqzwuFot88cPoQhxxgBUZQlzM6vB4KBocoUKDkaUCse7XxJ3O+mQqu+z4v +irm0+KKeNoZijzm7MsRH1SCq4v79JJydNTZCWIquFEYi0Uqfi6luagHtsyPsF/iEhcwRS lvOQ8+xDRE9Gaxyz/nzvvjqY8bpal43+vAimmobfClxTi7kJ9VNCbAeA0+j38Gnp+GZML0 5aOV37r1RSxerNAZj2QNt/37SGc0DMfXyyxVBHrisQ+6f180f4oDmhyzSLzLig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764364874; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vek54AdnOz9wh2Ve3gZaOJbIjEmXJ9WskYzBicE1zN0=; b=bCVFcHLVmVYd4nDH1mexrJaBlVciPbeigO0h/LQsuuxenwgJafX5p+loYD9/MietXinL6/ parlEgouhZ8uSK3dvG2haow6vqsXaBetfi4I2s3HDcu8zw6ghY9DPJ7H/ks63QcZ7DHCzb IJNXStLVcD9Zn3LNk7QuWH8S5UP4gD/2716I9pBjKJhDpxRh0aUFhNLGZlDwnsEo7ols4z m7x/XlorfpX8Asnk/n7Spp0taiY3sklWhts9XkaOhE/E13l2KcwXDwIScdBn9IEBrd4Gcc RgUhMFoU7ZjbWxQUtvRbQ30s+IV9RvtU5krmvDVMS98OwbD5WGh+Qzy6GlcSuw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764364874; a=rsa-sha256; cv=none; b=qvmeE71pRjhA+rzgswgiF64GQdXc/FsJIn3P5nydbrA9f1dmXyZyxYZZuVr0qgSAytZPw+ cn3gsP686HWOGRSVFQLzJTarumOBcJFgzby1rXZ4oTr3lfm9B26bBWhBX9m5QgGUqLWQ9W f6x8cI3ZvWpfS4F+J3dgD/8DOi4HhkOFBp1Hs04Nc4A+ECSmv0kVIVKt8zsTzMGZjSy/BE zpa23TjyXyNrSGbBSwrZx0Yf9gsWAzIDA63Nh6/JJ/mzOYkqc5a3vDLAKxa6KGs0EZiRIn Gu6kXtuB1nf5IrkkQQPDaytJyBOc3djtfqKsiOTXI9VfA0dl44hwvRUnmGVPHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dJ5nk3wXpz3nN for ; Fri, 28 Nov 2025 21:21:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 32df5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 28 Nov 2025 21:21:14 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Bhosale, Yogesh From: Krzysztof Galazka Subject: git: d6a05d332394 - stable/14 - ix(4): Add support for debug dump for E610 adapters List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kgalazka X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d6a05d33239403065463b12375045f9245a0eb3c Auto-Submitted: auto-generated Date: Fri, 28 Nov 2025 21:21:14 +0000 Message-Id: <692a124a.32df5.6e3b9aaf@gitrepo.freebsd.org> The branch stable/14 has been updated by kgalazka: URL: https://cgit.FreeBSD.org/src/commit/?id=d6a05d33239403065463b12375045f9245a0eb3c commit d6a05d33239403065463b12375045f9245a0eb3c Author: Bhosale, Yogesh AuthorDate: 2025-10-10 09:39:16 +0000 Commit: Krzysztof Galazka CommitDate: 2025-11-28 21:16:35 +0000 ix(4): Add support for debug dump for E610 adapters This is part 2 of the support for the new Intel Ethernet E610 family of devices. Intel E610 Ethernet Controller devices feature a debug dump capability that allows you to capture runtime register values directly from the hardware, with assistance from the firmware. These registers are organized into clusters based on their function, enabling targeted debugging. This information is consolidated into a single dump file, facilitating the debugging of complex issues encountered in the field. The debug dump provides a snapshot of the device's current hardware configuration, including switch tables, transmit scheduler tables, and other relevant data. It captures the state of specified clusters and serves as a stateless snapshot of the entire device. This update introduces ioctl and sysctl support for the debug dump feature. Signed-off-by: Yogesh Bhosale yogesh.bhosale@intel.com Co-developed-by: Krzysztof Galazka krzysztof.galazka@intel.com Approved by: kbowling (mentor), erj (mentor) Tested by: gowtham.kumar.ks_intel.com Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D50934 (cherry picked from commit 2170400142b99c0eb604403b74ebd88c05dd7ed4) --- sys/dev/ixgbe/if_ix.c | 521 +++++++++++++++++++++++++++++++++++++++++ sys/dev/ixgbe/ixgbe.h | 52 ++++ sys/dev/ixgbe/ixgbe_features.h | 1 + 3 files changed, 574 insertions(+) diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index 5c4ca585c323..7f234ce45dbd 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -192,6 +192,8 @@ static int ixgbe_if_i2c_req(if_ctx_t, struct ifi2creq *); static bool ixgbe_if_needs_restart(if_ctx_t, enum iflib_restart_event); int ixgbe_intr(void *); +static int ixgbe_if_priv_ioctl(if_ctx_t ctx, u_long command, caddr_t data); + /************************************************************************ * Function prototypes ************************************************************************/ @@ -239,6 +241,13 @@ static void ixgbe_setup_vlan_hw_support(if_ctx_t); static void ixgbe_config_gpie(struct ixgbe_softc *); static void ixgbe_config_delay_values(struct ixgbe_softc *); +static void ixgbe_add_debug_sysctls(struct ixgbe_softc *sc); +static void ixgbe_add_debug_dump_sysctls(struct ixgbe_softc *sc); +static int ixgbe_debug_dump_ioctl(struct ixgbe_softc *sc, struct ifdrv *ifd); +static u8 ixgbe_debug_dump_print_cluster(struct ixgbe_softc *sc, + struct sbuf *sbuf, u8 cluster_id); +static int ixgbe_nvm_access_ioctl(struct ixgbe_softc *sc, struct ifdrv *ifd); + /* Sysctl handlers */ static int ixgbe_sysctl_flowcntl(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_advertise(SYSCTL_HANDLER_ARGS); @@ -260,6 +269,9 @@ static int ixgbe_sysctl_wol_enable(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_wufc(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_tso_tcp_flags_mask(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_debug_dump_set_clusters(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_dump_debug_dump(SYSCTL_HANDLER_ARGS); + /* Deferred interrupt tasklets */ static void ixgbe_handle_msf(void *); static void ixgbe_handle_mod(void *); @@ -330,6 +342,7 @@ static device_method_t ixgbe_if_methods[] = { DEVMETHOD(ifdi_get_counter, ixgbe_if_get_counter), DEVMETHOD(ifdi_i2c_req, ixgbe_if_i2c_req), DEVMETHOD(ifdi_needs_restart, ixgbe_if_needs_restart), + DEVMETHOD(ifdi_priv_ioctl, ixgbe_if_priv_ioctl), #ifdef PCI_IOV DEVMETHOD(ifdi_iov_init, ixgbe_if_iov_init), DEVMETHOD(ifdi_iov_uninit, ixgbe_if_iov_uninit), @@ -1015,6 +1028,8 @@ ixgbe_if_attach_pre(if_ctx_t ctx) if (hw->mac.type == ixgbe_mac_E610) ixgbe_init_aci(hw); + sc->do_debug_dump = false; + if (hw->mac.ops.fw_recovery_mode && hw->mac.ops.fw_recovery_mode(hw)) { device_printf(dev, @@ -1396,6 +1411,248 @@ ixgbe_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) } } +/************************************************************************ + * ixgbe_if_priv_ioctl - Ioctl handler for driver + * + * Handler for custom driver specific ioctls + * + * return 0 on success, positive on failure + ************************************************************************/ +static int +ixgbe_if_priv_ioctl(if_ctx_t ctx, u_long command, caddr_t data) +{ + struct ixgbe_softc *sc = iflib_get_softc(ctx); + struct ifdrv *ifd; + device_t dev = sc->dev; + + /* Make sure the command type is valid */ + switch (command) { + case SIOCSDRVSPEC: + case SIOCGDRVSPEC: + /* Accepted commands */ + break; + case SIOCGPRIVATE_0: + /* + * Although we do not support this ioctl command, it's expected + * that iflib will forward it to the IFDI_PRIV_IOCTL handler. + * Do not print a message in this case. + */ + return (ENOTSUP); + default: + /* + * If we get a different command for this function, it's + * definitely unexpected, so log a message indicating what + * command we got for debugging purposes. + */ + device_printf(dev, + "%s: unexpected ioctl command %08lx\n", + __func__, command); + return (EINVAL); + } + + ifd = (struct ifdrv *)data; + + switch (ifd->ifd_cmd) { + case IXGBE_NVM_ACCESS: + IOCTL_DEBUGOUT("ioctl: NVM ACCESS"); + return (ixgbe_nvm_access_ioctl(sc, ifd)); + case IXGBE_DEBUG_DUMP: + IOCTL_DEBUGOUT("ioctl: DEBUG DUMP"); + return (ixgbe_debug_dump_ioctl(sc, ifd)); + default: + IOCTL_DEBUGOUT1( + "ioctl: UNKNOWN SIOC(S|G)DRVSPEC (0x%X) command\n", + (int)ifd->ifd_cmd); + return (EINVAL); + } + + return (0); +} + +/************************************************************************ + * ixgbe_nvm_access_ioctl + * + * Handles an NVM access ioctl request + ************************************************************************/ +static int +ixgbe_nvm_access_ioctl(struct ixgbe_softc *sc, struct ifdrv *ifd) +{ + struct ixgbe_nvm_access_data *data; + struct ixgbe_nvm_access_cmd *cmd; + struct ixgbe_hw *hw = &sc->hw; + size_t ifd_len = ifd->ifd_len; + size_t malloc_len; + device_t dev = sc->dev; + u8 *nvm_buffer; + s32 error = 0; + + /* + * ifioctl forwards SIOCxDRVSPEC to iflib without conducting + * a privilege check. Subsequently, iflib passes the ioctl to the driver + * without verifying privileges. To prevent non-privileged threads from + * accessing this interface, perform a privilege check at this point. + */ + error = priv_check(curthread, PRIV_DRIVER); + if (error) + return (error); + + if (ifd_len < sizeof(*cmd)) { + device_printf(dev, + "%s: ifdrv length is too small. Got %zu, " + "but expected %zu\n", + __func__, ifd_len, sizeof(*cmd)); + return (EINVAL); + } + + if (ifd->ifd_data == NULL) { + device_printf(dev, "%s: No ifd data buffer.\n", + __func__); + return (EINVAL); + } + + malloc_len = max(ifd_len, sizeof(*data) + sizeof(*cmd)); + + nvm_buffer = (u8 *)malloc(malloc_len, M_IXGBE, M_ZERO | M_NOWAIT); + if (!nvm_buffer) + return (ENOMEM); + + /* Copy the NVM access command and data in from user space */ + error = copyin(ifd->ifd_data, nvm_buffer, ifd_len); + if (error) { + device_printf(dev, "%s: Failed to copy data in, error: %d\n", + __func__, error); + goto cleanup_free_nvm_buffer; + } + + /* + * The NVM command structure is immediately followed by data which + * varies in size based on the command. + */ + cmd = (struct ixgbe_nvm_access_cmd *)nvm_buffer; + data = (struct ixgbe_nvm_access_data *) + (nvm_buffer + sizeof(struct ixgbe_nvm_access_cmd)); + + /* Handle the NVM access request */ + error = ixgbe_handle_nvm_access(hw, cmd, data); + if (error) { + device_printf(dev, "%s: NVM access request failed, error %d\n", + __func__, error); + } + + /* Copy the possibly modified contents of the handled request out */ + error = copyout(nvm_buffer, ifd->ifd_data, ifd_len); + if (error) { + device_printf(dev, "%s: Copying response back to " + "user space failed, error %d\n", + __func__, error); + goto cleanup_free_nvm_buffer; + } + +cleanup_free_nvm_buffer: + free(nvm_buffer, M_IXGBE); + return (error); +} + +/************************************************************************ + * ixgbe_debug_dump_ioctl + * + * Makes debug dump of internal FW/HW data. + ************************************************************************/ +static int +ixgbe_debug_dump_ioctl(struct ixgbe_softc *sc, struct ifdrv *ifd) +{ + struct ixgbe_debug_dump_cmd *dd_cmd; + struct ixgbe_hw *hw = &sc->hw; + size_t ifd_len = ifd->ifd_len; + device_t dev = sc->dev; + s32 error = 0; + + if (!(sc->feat_en & IXGBE_FEATURE_DBG_DUMP)) + return (ENODEV); + + /* Data returned from ACI command */ + u16 ret_buf_size = 0; + u16 ret_next_cluster = 0; + u16 ret_next_table = 0; + u32 ret_next_index = 0; + + /* + * ifioctl forwards SIOCxDRVSPEC to iflib without conducting + * a privilege check. Subsequently, iflib passes the ioctl to the driver + * without verifying privileges. To prevent non-privileged threads from + * accessing this interface, perform a privilege check at this point. + */ + error = priv_check(curthread, PRIV_DRIVER); + if (error) + return (error); + + if (ifd_len < sizeof(*dd_cmd)) { + device_printf(dev, + "%s: ifdrv length is too small. Got %zu, " + "but expected %zu\n", + __func__, ifd_len, sizeof(*dd_cmd)); + return (EINVAL); + } + + if (ifd->ifd_data == NULL) { + device_printf(dev, "%s: No ifd data buffer.\n", + __func__); + return (EINVAL); + } + + dd_cmd = (struct ixgbe_debug_dump_cmd *)malloc(ifd_len, M_IXGBE, + M_NOWAIT | M_ZERO); + if (!dd_cmd) { + error = -ENOMEM; + goto out; + } + /* copy data from userspace */ + error = copyin(ifd->ifd_data, dd_cmd, ifd_len); + if (error) { + device_printf(dev, "%s: Failed to copy data in, error: %d\n", + __func__, error); + goto out; + } + + /* ACI command requires buf_size arg to be grater than 0 */ + if (dd_cmd->data_size == 0) { + device_printf(dev, "%s: data_size must be greater than 0\n", + __func__); + error = EINVAL; + goto out; + } + + /* Zero the data buffer memory space */ + memset(dd_cmd->data, 0, ifd_len - sizeof(*dd_cmd)); + + error = ixgbe_aci_get_internal_data(hw, dd_cmd->cluster_id, + dd_cmd->table_id, dd_cmd->offset, dd_cmd->data, dd_cmd->data_size, + &ret_buf_size, &ret_next_cluster, &ret_next_table, &ret_next_index); + if (error) { + device_printf(dev, + "%s: Failed to get internal FW/HW data, error: %d\n", + __func__, error); + goto out; + } + + dd_cmd->cluster_id = ret_next_cluster; + dd_cmd->table_id = ret_next_table; + dd_cmd->offset = ret_next_index; + dd_cmd->data_size = ret_buf_size; + + error = copyout(dd_cmd, ifd->ifd_data, ifd->ifd_len); + if (error) { + device_printf(dev, + "%s: Failed to copy data out, error: %d\n", + __func__, error); + } + +out: + free(dd_cmd, M_IXGBE); + + return (error); +} + /************************************************************************ * ixgbe_add_media_types ************************************************************************/ @@ -2884,6 +3141,264 @@ ixgbe_sysctl_interrupt_rate_handler(SYSCTL_HANDLER_ARGS) return (0); } /* ixgbe_sysctl_interrupt_rate_handler */ +/************************************************************************ + * ixgbe_debug_dump_print_cluster + ************************************************************************/ +static u8 +ixgbe_debug_dump_print_cluster(struct ixgbe_softc *sc, struct sbuf *sbuf, + u8 cluster_id) +{ + u16 data_buf_size = IXGBE_ACI_MAX_BUFFER_SIZE; + device_t dev = sc->dev; + struct ixgbe_hw *hw = &sc->hw; + const u8 reserved_buf[8] = {}; + int max_aci_calls = 1000; + int error, counter = 0; + u8 *data_buf; + + /* Input parameters / loop variables */ + u16 table_id = 0; + u32 offset = 0; + + /* Data returned from ACI command */ + u16 ret_buf_size = 0; + u16 ret_next_cluster = 0; + u16 ret_next_table = 0; + u32 ret_next_index = 0; + + data_buf = (u8 *)malloc(data_buf_size, M_IXGBE, M_NOWAIT | M_ZERO); + if (!data_buf) + return (0); + + DEBUGOUT2("%s: dumping cluster id (relative) %d\n", + __func__, cluster_id); + + do { + DEBUGOUT3("table_id 0x%04x offset 0x%08x buf_size %d\n", + table_id, offset, data_buf_size); + + error = ixgbe_aci_get_internal_data(hw, cluster_id, table_id, + offset, data_buf, data_buf_size, &ret_buf_size, + &ret_next_cluster, &ret_next_table, &ret_next_index); + if (error) { + device_printf(dev, + "%s: Failed to get internal FW/HW data, error: %d, " + "last aci status: %d\n", + __func__, error, hw->aci.last_status); + break; + } + + DEBUGOUT3("ret_table_id 0x%04x ret_offset 0x%08x " + "ret_buf_size %d\n", + ret_next_table, ret_next_index, ret_buf_size); + + /* Print cluster id */ + u32 print_cluster_id = (u32)cluster_id; + sbuf_bcat(sbuf, &print_cluster_id, sizeof(print_cluster_id)); + /* Print table id */ + u32 print_table_id = (u32)table_id; + sbuf_bcat(sbuf, &print_table_id, sizeof(print_table_id)); + /* Print table length */ + u32 print_table_length = (u32)ret_buf_size; + sbuf_bcat(sbuf, &print_table_length, + sizeof(print_table_length)); + /* Print current offset */ + u32 print_curr_offset = offset; + sbuf_bcat(sbuf, &print_curr_offset, sizeof(print_curr_offset)); + /* Print reserved bytes */ + sbuf_bcat(sbuf, reserved_buf, sizeof(reserved_buf)); + /* Print data */ + sbuf_bcat(sbuf, data_buf, ret_buf_size); + + /* Prepare for the next loop spin */ + memset(data_buf, 0, data_buf_size); + + bool last_index = (ret_next_index == 0xffffffff); + bool last_table = ((ret_next_table == 0xff || + ret_next_table == 0xffff) && + last_index); + + if (last_table) { + /* End of the cluster */ + DEBUGOUT1("End of the cluster ID %d\n", cluster_id); + break; + } else if (last_index) { + /* End of the table */ + table_id = ret_next_table; + offset = 0; + } else { + /* More data left in the table */ + offset = ret_next_index; + } + } while (++counter < max_aci_calls); + + if (counter >= max_aci_calls) + device_printf(dev, "Exceeded nr of ACI calls for cluster %d\n", + cluster_id); + + free(data_buf, M_IXGBE); + + return (++cluster_id); +} /* ixgbe_print_debug_dump_cluster */ + +/************************************************************************ + * ixgbe_sysctl_debug_dump_set_clusters + * + * Sets the cluster to dump from FW when Debug Dump requested. + ************************************************************************/ +static int +ixgbe_sysctl_debug_dump_set_clusters(SYSCTL_HANDLER_ARGS) +{ + struct ixgbe_softc *sc = (struct ixgbe_softc *)arg1; + u32 clusters = sc->debug_dump_cluster_mask; + device_t dev = sc->dev; + int error; + + error = sysctl_handle_32(oidp, &clusters, 0, req); + if ((error) || !req->newptr) + return (error); + + if (clusters & ~(IXGBE_DBG_DUMP_VALID_CLUSTERS_MASK)) { + device_printf(dev, + "%s: Unrecognized parameter: %u\n", + __func__, clusters); + sc->debug_dump_cluster_mask = + IXGBE_ACI_DBG_DUMP_CLUSTER_ID_INVALID; + return (EINVAL); + } + + sc->debug_dump_cluster_mask = clusters; + + return (0); +} /* ixgbe_sysctl_debug_dump_set_clusters */ + +/************************************************************************ + * ixgbe_sysctl_dump_debug_dump + ************************************************************************/ +static int +ixgbe_sysctl_dump_debug_dump(SYSCTL_HANDLER_ARGS) +{ + struct ixgbe_softc *sc = (struct ixgbe_softc *)arg1; + device_t dev = sc->dev; + struct sbuf *sbuf; + int error = 0; + + UNREFERENCED_PARAMETER(arg2); + + if (!sc->do_debug_dump) { + if (req->oldptr == NULL && req->newptr == NULL) { + error = SYSCTL_OUT(req, 0, 0); + return (error); + } + + char input_buf[2] = ""; + error = sysctl_handle_string(oidp, input_buf, + sizeof(input_buf), req); + if ((error) || (req->newptr == NULL)) + return (error); + + if (input_buf[0] == '1') { + if (sc->debug_dump_cluster_mask == + IXGBE_ACI_DBG_DUMP_CLUSTER_ID_INVALID) { + device_printf(dev, + "Debug Dump failed because an invalid " + "cluster was specified.\n"); + return (EINVAL); + } + + sc->do_debug_dump = true; + return (0); + } + + return (EINVAL); + } + + /* Caller just wants the upper bound for size */ + if (req->oldptr == NULL && req->newptr == NULL) { + size_t est_output_len = IXGBE_DBG_DUMP_BASE_SIZE; + if (sc->debug_dump_cluster_mask & 0x2) + est_output_len += IXGBE_DBG_DUMP_BASE_SIZE; + error = SYSCTL_OUT(req, 0, est_output_len); + return (error); + } + + sbuf = sbuf_new_for_sysctl(NULL, NULL, 128, req); + sbuf_clear_flags(sbuf, SBUF_INCLUDENUL); + + DEBUGOUT("FW Debug Dump running...\n"); + + if (sc->debug_dump_cluster_mask) { + for (u8 id = 0; id <= IXGBE_ACI_DBG_DUMP_CLUSTER_ID_MAX; id++) { + if (sc->debug_dump_cluster_mask & BIT(id)) { + DEBUGOUT1("Dumping cluster ID %u...\n", id); + ixgbe_debug_dump_print_cluster(sc, sbuf, id); + } + } + } else { + u8 next_cluster_id = 0; + do { + DEBUGOUT1("Dumping cluster ID %u...\n", + next_cluster_id); + next_cluster_id = ixgbe_debug_dump_print_cluster(sc, + sbuf, next_cluster_id); + } while (next_cluster_id != 0 && + next_cluster_id <= IXGBE_ACI_DBG_DUMP_CLUSTER_ID_MAX); + } + + sbuf_finish(sbuf); + sbuf_delete(sbuf); + + sc->do_debug_dump = false; + + return (error); +} /* ixgbe_sysctl_dump_debug_dump */ + +/************************************************************************ + * ixgbe_add_debug_dump_sysctls + ************************************************************************/ +static void +ixgbe_add_debug_dump_sysctls(struct ixgbe_softc *sc) +{ + struct sysctl_oid_list *debug_list, *dump_list; + struct sysctl_oid *dump_node; + struct sysctl_ctx_list *ctx; + device_t dev = sc->dev; + + ctx = device_get_sysctl_ctx(dev); + debug_list = SYSCTL_CHILDREN(sc->debug_sysctls); + + dump_node = SYSCTL_ADD_NODE(ctx, debug_list, OID_AUTO, "dump", + CTLFLAG_RD, NULL, "Internal FW/HW Dump"); + dump_list = SYSCTL_CHILDREN(dump_node); + + SYSCTL_ADD_PROC(ctx, dump_list, OID_AUTO, "clusters", + CTLTYPE_U32 | CTLFLAG_RW, sc, 0, + ixgbe_sysctl_debug_dump_set_clusters, "SU", + IXGBE_SYSCTL_DESC_DEBUG_DUMP_SET_CLUSTER); + + SYSCTL_ADD_PROC(ctx, dump_list, OID_AUTO, "dump", + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0, + ixgbe_sysctl_dump_debug_dump, "", + IXGBE_SYSCTL_DESC_DUMP_DEBUG_DUMP); +} /* ixgbe_add_debug_dump_sysctls */ + +static void +ixgbe_add_debug_sysctls(struct ixgbe_softc *sc) +{ + struct sysctl_oid_list *ctx_list; + struct sysctl_ctx_list *ctx; + device_t dev = sc->dev; + + ctx = device_get_sysctl_ctx(dev); + ctx_list = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); + + sc->debug_sysctls = SYSCTL_ADD_NODE(ctx, ctx_list, OID_AUTO, "debug", + CTLFLAG_RD, NULL, "Debug Sysctls"); + + if (sc->feat_en & IXGBE_FEATURE_DBG_DUMP) + ixgbe_add_debug_dump_sysctls(sc); +} /* ixgbe_add_debug_sysctls */ + /************************************************************************ * ixgbe_add_device_sysctls ************************************************************************/ @@ -2994,6 +3509,8 @@ ixgbe_add_device_sysctls(if_ctx_t ctx) CTLTYPE_INT | CTLFLAG_RW, sc, 0, ixgbe_sysctl_eee_state, "I", "EEE Power Save State"); } + + ixgbe_add_debug_sysctls(sc); } /* ixgbe_add_device_sysctls */ /************************************************************************ @@ -5184,6 +5701,7 @@ ixgbe_init_device_features(struct ixgbe_softc *sc) break; case ixgbe_mac_E610: sc->feat_cap |= IXGBE_FEATURE_RECOVERY_MODE; + sc->feat_cap |= IXGBE_FEATURE_DBG_DUMP; break; default: break; @@ -5205,6 +5723,9 @@ ixgbe_init_device_features(struct ixgbe_softc *sc) /* Recovery mode */ if (sc->feat_cap & IXGBE_FEATURE_RECOVERY_MODE) sc->feat_en |= IXGBE_FEATURE_RECOVERY_MODE; + /* FW Debug Dump */ + if (sc->feat_cap & IXGBE_FEATURE_DBG_DUMP) + sc->feat_en |= IXGBE_FEATURE_DBG_DUMP; /* Enabled via global sysctl... */ /* Flow Director */ diff --git a/sys/dev/ixgbe/ixgbe.h b/sys/dev/ixgbe/ixgbe.h index 844064bf8543..624b71acabea 100644 --- a/sys/dev/ixgbe/ixgbe.h +++ b/sys/dev/ixgbe/ixgbe.h @@ -46,6 +46,7 @@ #include #include #include +#include #include #include @@ -475,6 +476,20 @@ struct ixgbe_softc { u32 feat_cap; u32 feat_en; u16 lse_mask; + + struct sysctl_oid *debug_sysctls; + u32 debug_dump_cluster_mask; + bool do_debug_dump; +}; + +struct ixgbe_debug_dump_cmd { + u32 offset; /* offset to read/write from table, in bytes */ + u8 cluster_id; /* also used to get next cluster id */ + u16 table_id; + u16 data_size; /* size of data field, in bytes */ + u16 reserved1; + u32 reserved2; + u8 data[]; }; /* Precision Time Sync (IEEE 1588) defines */ @@ -499,6 +514,43 @@ struct ixgbe_softc { #define IXGBE_PHY_CURRENT_TEMP 0xC820 #define IXGBE_PHY_OVERTEMP_STATUS 0xC830 +/** + * The ioctl command number used by NVM update for accessing the driver for + * NVM access commands. + */ +#define IXGBE_NVM_ACCESS \ + (((((((('E' << 4) + '1') << 4) + 'K') << 4) + 'G') << 4) | 5) + +/* + * The ioctl command number used by a userspace tool for accessing the driver + * for getting debug dump data from the firmware. + */ +#define IXGBE_DEBUG_DUMP \ + (((((((('E' << 4) + '1') << 4) + 'K') << 4) + 'G') << 4) | 6) + +/* Debug Dump related definitions */ +#define IXGBE_ACI_DBG_DUMP_CLUSTER_ID_INVALID 0xFFFFFF +#define IXGBE_ACI_DBG_DUMP_CLUSTER_ID_BASE 50 +#define IXGBE_ACI_DBG_DUMP_CLUSTER_ID_MAX 1 + +#define IXGBE_DBG_DUMP_VALID_CLUSTERS_MASK 0x3 +#define IXGBE_DBG_DUMP_BASE_SIZE (2 * 1024 * 1024) + +#define IXGBE_SYSCTL_DESC_DEBUG_DUMP_SET_CLUSTER \ +"\nSelect clusters to dump with \"dump\" sysctl" \ +"\nFlags:" \ +"\n\t 0x1 - Link" \ +"\n\t 0x2 - Full CSR Space, excluding RCW registers" \ +"\n\t" \ +"\nUse \"sysctl -x\" to view flags properly." + +#define IXGBE_SYSCTL_DESC_DUMP_DEBUG_DUMP \ +"\nWrite 1 to output a FW debug dump containing the clusters " \ +"specified by the \"clusters\" sysctl" \ +"\nThe \"-b\" flag must be used in order to dump this data " \ +"as binary data because" \ +"\nthis data is opaque and not a string." + /* Sysctl help messages; displayed with sysctl -d */ #define IXGBE_SYSCTL_DESC_ADV_SPEED \ "\nControl advertised link speed using these flags:\n" \ diff --git a/sys/dev/ixgbe/ixgbe_features.h b/sys/dev/ixgbe/ixgbe_features.h index 0cef334a185f..bee9040319d8 100644 --- a/sys/dev/ixgbe/ixgbe_features.h +++ b/sys/dev/ixgbe/ixgbe_features.h @@ -57,6 +57,7 @@ #define IXGBE_FEATURE_LEGACY_IRQ (u32)(1 << 12) #define IXGBE_FEATURE_NEEDS_CTXD (u32)(1 << 13) #define IXGBE_FEATURE_RECOVERY_MODE (u32)(1 << 15) +#define IXGBE_FEATURE_DBG_DUMP (u32)(1 << 16) /* Check for OS support. Undefine features if not included in the OS */ #ifndef PCI_IOV From nobody Fri Nov 28 21:21:15 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dJ5nl6ZFSz6JKKg for ; Fri, 28 Nov 2025 21:21: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dJ5nl5G4gz3ffG for ; Fri, 28 Nov 2025 21:21:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764364875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5UtuCqCVByWPumoN3uuyZIbRQceSW7sUECEMcNYXsk4=; b=jYgZ1fmin/iu5pMf4/c7poUYBkIHRMB9PII4dSltkt070M/Bxezse4gZJsIP97K1LPDfzo bDFsmcuieIH/Uc4dr/uqgj6Aok5lUMKcefwUjIjH5mFBw7tArd6WkaxUJrMTjyTlYykEAh wP7YmlXg0Xzmb0kV9MuWyN5WLuEKQBXjRyflZoaYmuGSNuARoHWOVr+gkWFbxv9TpoBHDE u0goShoLt68ALQESxlL0E/I9oDspJM+XUaXHPB8NaMWBGV6xf6wOsItSLFfjvm2Utlpn3Q Mu4YZMe5ZixvU6ZpCoHsW9h2e2sXRVLDPwkFCLL6JkQDR9ekzBkXtoLnIR+2uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764364875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5UtuCqCVByWPumoN3uuyZIbRQceSW7sUECEMcNYXsk4=; b=UWlbok7e/PWGNDJaBopW7ytIdKVuK1Pp4WJ4TfVKyzC9Zdex6yBcSsBZmk9uaDdrA9UdrD 9SFHnKwWxeDEXzpERzZ8Nq2QLBUppbDS2a57lf2wsY8zQXCZxm301K+XihMtzVmdFWzFWN HaPLWbKJerbn0UYaGj22G0CgT5bBAtb7naHs3HLU4wBniEhOJBKni1MDeZgVLq6O/CLGBa 2imO01jKTEGGGSV1UZ8h8wl1LUt7FJSLOTwBnH/VJrHHKUJVuWHqx0KPLmZKch01gPzd8v 1CSZDs2iqzJeLuAbiI2jduhcoc0pYt5xSBAM+SfTxZdOD2VsgUiiKYjjjdrspQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764364875; a=rsa-sha256; cv=none; b=BdpcqQS1PuYZ37I3zRZsK36no6ob5wrxGbpdBjGLkffzDkQcrih9yJ7+pTHJBD3Oer9nFx /g4DpJkgwfedTTXYf8BR2HdKwNqMcagqt8C99+qKqgXHUqiZcnz6Cw4dr5Df6a70mq3wpu 4wSV7i9wJH1kiBMK55E4dIAqvTMSNbddAGDA08BAJJNKmA+8TLkHUDBGgDuGTnARcoTKIP 1QuiagxI9er0IyXMuiYsUkSs27UbQktDedk+bIApctgxlaTx5Jx4aLY0xaG9tr8H/SqoYB 5xNEWM/rsv0fJahR2As5y6k2G84J2GNrpx3RUUyzLWQJoN3UgYJO/LyVE5N0+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dJ5nl4ccsz42J for ; Fri, 28 Nov 2025 21:21:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 33e75 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 28 Nov 2025 21:21:15 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Yogesh Bhosale From: Krzysztof Galazka Subject: git: e7da904b73ab - stable/14 - ix.4: Add E610 to HARDWARE section List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kgalazka X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e7da904b73abb8f3e2f1eb52ad7015ca731feff8 Auto-Submitted: auto-generated Date: Fri, 28 Nov 2025 21:21:15 +0000 Message-Id: <692a124b.33e75.23ce7dba@gitrepo.freebsd.org> The branch stable/14 has been updated by kgalazka: URL: https://cgit.FreeBSD.org/src/commit/?id=e7da904b73abb8f3e2f1eb52ad7015ca731feff8 commit e7da904b73abb8f3e2f1eb52ad7015ca731feff8 Author: Yogesh Bhosale AuthorDate: 2025-11-10 19:23:46 +0000 Commit: Krzysztof Galazka CommitDate: 2025-11-28 21:20:11 +0000 ix.4: Add E610 to HARDWARE section Reviewed by: ziaee Fixes: dea5f973d0c8 (new Intel Ethernet E610 family) Differential Revision: https://reviews.freebsd.org/D52990 (cherry picked from commit abd53b16c03f77c12bb8b77d9e2e4cf392745361) --- share/man/man4/ix.4 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/man/man4/ix.4 b/share/man/man4/ix.4 index 418b6e1188ab..e6f4276e1a77 100644 --- a/share/man/man4/ix.4 +++ b/share/man/man4/ix.4 @@ -29,7 +29,7 @@ .\" .\" * Other names and brands may be claimed as the property of others. .\" -.Dd October 26, 2024 +.Dd November 10, 2025 .Dt IX 4 .Os .Sh NAME @@ -78,6 +78,8 @@ including: .Pp .Bl -bullet -compact .It +Intel(R) Ethernet E610 +.It Intel(R) Ethernet X553 .It Intel(R) Ethernet X552 From nobody Fri Nov 28 21:21:16 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dJ5nn1XFfz6JKMg for ; Fri, 28 Nov 2025 21:21:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dJ5nn0581z3fYt for ; Fri, 28 Nov 2025 21:21:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764364877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QLTg92poj23VCvWbrHtqOvLuphLrd5wjVOhxM2Qw47c=; b=vjWKunxXsVzejwC1sk7qtIK+Lr2/dH0978zUcVdXvw8fnFAB+4Aq7yW0EOXIBQHnOrbHPW WxehBEhZkd4me5CwXa2WvBfBihfiylYOEaFx1XWcokNP3MLmpJQihd+7IQyhLRxvrYnox2 B4nrZp+AN/o+Q5qJ54zJZh+if5vEMJgBzUVDfafnRN7REPTcyNEkAZ7Ae4HTTthC1Q5AQx Ffvsv75kq4Is21l8KFATVyVIYuF6qCt8FqhqF2GI2ZtiDGawjoZz++T4hZtpYndQCCvpPG wTxVoE/knZOOmqlSkt75tkdWBAudYOLVV2M8kt5e3TGcXETshbJK90q/0jrhzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764364877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QLTg92poj23VCvWbrHtqOvLuphLrd5wjVOhxM2Qw47c=; b=oG2q9u1P34CO+qGB/IiN/5XGiATPRH/n+ZIzM7jBflr+V9t7E561bxm0OtJ0ys10+v87S3 ms4KfszwJPMsCRHOf4B99tN3F0he59QOQJyL5lsVTSQhqPmRt4dhwc6Ejom/nCDhkH0f0E 6yky8PDoTSjScHfe3YK/3L7NE7DIoCJ8slnUBGbSlSWrWPiSm39BmwkxNX2Rla+vivHvv7 xMNGcyjgGnmi8qBTihmAFJWACSB8G7OBBmEXBqoXjzj9oLaaVOaIdkOd7uHp717aQRuNwY vW8R9Q1fRDQyWBypTOaisoSWGGC67wmsqvuvMhsqRgFal6L0Z37s18GZeGBrVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764364877; a=rsa-sha256; cv=none; b=tUcOr76xvBjBEqK8jmcz1LVwY9caxcCcnbMueHciaspkM56Mms35HrFh05YpZgzdh10a7f 5eDcnmH7iLuslL4Olu6Sc3o8UOGIP75h0vA8/1+eH3wOAv0j6eCV/6x6WPiyrk7ANoowAQ dlnCL0Pqgq04UHw7ThRu/D0dLsbJhwtph3Y87Y+dN2fGMiJFBzUtljkecX4+u7yrzEPOm5 vtWG0KdBrR6Nn3i/PkpBeFLhJfZmt365++3sDmGDQFK2NfXabgb/1t7MB6KCLrizbkP9fC PK2j6ufnSUZLvIb7gsvYL6h9k+mYBDvE/AwphROLYWxtjWjeDqjoTK1lxfwKXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dJ5nm5LrYz3jC for ; Fri, 28 Nov 2025 21:21:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 31b39 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 28 Nov 2025 21:21:16 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Yogesh Bhosale From: Krzysztof Galazka Subject: git: f28019f570cc - stable/14 - ix.4: Document E610 debug dump List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kgalazka X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f28019f570cc1bbfe0f0597dc2f46cfd9438359a Auto-Submitted: auto-generated Date: Fri, 28 Nov 2025 21:21:16 +0000 Message-Id: <692a124c.31b39.3866ef66@gitrepo.freebsd.org> The branch stable/14 has been updated by kgalazka: URL: https://cgit.FreeBSD.org/src/commit/?id=f28019f570cc1bbfe0f0597dc2f46cfd9438359a commit f28019f570cc1bbfe0f0597dc2f46cfd9438359a Author: Yogesh Bhosale AuthorDate: 2025-11-10 18:03:54 +0000 Commit: Krzysztof Galazka CommitDate: 2025-11-28 21:20:34 +0000 ix.4: Document E610 debug dump Explain how to collect E610 device debug dump data with sysctl for troubleshooting with Intel Customer Support. Fixes: 2170400142b9 (Add support for debug dump) Reviewed by: bcr, erj (previous version), ziaee Signed-off-by: Yogesh Bhosale Differential Revision: https://reviews.freebsd.org/D52990 (cherry picked from commit 8225ed665eea69b3df3ea57009cf8fe61863c1fc) --- share/man/man4/ix.4 | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/share/man/man4/ix.4 b/share/man/man4/ix.4 index e6f4276e1a77..09af85f5c4a7 100644 --- a/share/man/man4/ix.4 +++ b/share/man/man4/ix.4 @@ -132,6 +132,35 @@ Enable Adaptive Interrupt Moderation (AIM). Vary the interrupt rate over time based on the traffic for that interrupt vector. .El +.Sh SYSCTL VARIABLES +The +.Nm +driver supports the following +.Xr sysctl 8 +variables: +.Bl -tag -width "dev.ix.?.debug.dump.clusters" +.It Va dev.ix.?.debug.dump.clusters +Specify a bitmask to select firmware event clusters +to be included in the debug dump. +Possible values include: +.Pp +.Bl -tag -compact +.It 0 +All clusters excluding Manageability Transactions +.It 0x1 +Link cluster +.It 0x2 +Full CSR Space excluding RCW registers +.El +.Pp +This feature is only supported on E610 devices. +.It Va dev.ix.?.debug.dump.dump +Specify 1 to generate a per-device debugging snapshot. +Output must be redirected to a file +and decoded by Intel Customer Support. +.Pp +This feature is only supported on E610. +.El .Sh DIAGNOSTICS .Bl -diag .It "ix%d: Unable to allocate bus resource: memory" From nobody Sat Nov 29 00:35:42 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dJB6C4V9pz6HxT1 for ; Sat, 29 Nov 2025 00:35: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dJB662Lkqz40Lc for ; Sat, 29 Nov 2025 00:35:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764376542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xO+m2PwEbLpsC/7ryMeQvBbSvQnI23DxQhb7YV/aEWY=; b=i7KERvZOl9j5/PmyvcnNh10j6GEPsUfAm5WJw5D3yA+QJ3YBLcnGqEEjlTWj3Op/Yc+3pb In+fMQpigLwA4cwx7leq9Uk8FoA7KLXEhl4zy2g5nD08vaE4lHXWFeChVBhWmndB0NceHK ynQkTDnHgrbOK3OumshvQWEYXkEMLv2nR9bGN82T68ByLO6pFhHokCY7VEVHl8hLuXUz6A 9QEcY7jnwNfb/QMzNJsw81SDQIhzqBBmFoqFmcKqjWXCxGV7dikDyqFM5k59AdL5WITuYF TdWYkfl0g2pNa+HWipJ4KNbtPPaT5uPGGi2D6s8MHxG0bhgkjwOvIXKoRkT82w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764376542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xO+m2PwEbLpsC/7ryMeQvBbSvQnI23DxQhb7YV/aEWY=; b=NX3MvBqg1Kyjhh99/k7XvegoNQoVGnnQYguMFfEXPwr0ZcRL0LceZIRjdg60DOipIoWuxM Plkzh7fTY863co/t2sTSckvU7xuiwFrbwo97rIvtI194EfaHFLevD4q7h/ZGf+cwzLGqfX oamdd6W75jrMMRlw1jpdu7nkYnQeeU2CNC5fQLne546Z4mj9MLehbf4rdj608VgDe1jd29 o4KZebwT73mCOIxzdoLxwd1uQ8D2qUigKn9uJ+qtH5EanXxldNWsaWdX9eR1zfmw1Fl8NS O5kKRR5w4ewa8K4My8oSSn9qg70DikiMdNObZPjqr+XbhMRfGyAkFzVtJZALxw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764376542; a=rsa-sha256; cv=none; b=U2clyVh2oiWvfOpg5nnSwAJsChvBNRtaHHtQJ+Y1OJ+Kfiegspe7w81gjK4z3gy9aYvs4u 4zaANcUKyoMYevPrBj57Kb9ewzmXUSU+20M3vQXM9nkNAHhx2hmM3phQdiDaRPmZgfhRHY KTVmdDe6nxiFVDdaLaZ99inA1+/Bz8kUXt0YWPJJJR3SDxkEbVUtwIVr37a1bw2QaxLici Sp3OU9Xd5jRLlmWv0k0aPzrFPmL0RBIAKIhCz6OU30YrNTJcHx3aByy7UYtQ1mh5vinWD0 FTv4ifn3tzWKGDEW88bvf+lMp7+iRoVW+b7uejVW/AIHWNs225wse9P2gVKZXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dJB661tc9z98t for ; Sat, 29 Nov 2025 00:35:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id ce53 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 29 Nov 2025 00:35:42 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 6bda3655b827 - stable/15 - beep: Sort usage and man page options List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 6bda3655b8272aa9fd1301df3346aca4d5b0d39c Auto-Submitted: auto-generated Date: Sat, 29 Nov 2025 00:35:42 +0000 Message-Id: <692a3fde.ce53.1d0b82fa@gitrepo.freebsd.org> The branch stable/15 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=6bda3655b8272aa9fd1301df3346aca4d5b0d39c commit 6bda3655b8272aa9fd1301df3346aca4d5b0d39c Author: Jose Luis Duran AuthorDate: 2025-11-19 15:59:25 +0000 Commit: Jose Luis Duran CommitDate: 2025-11-29 00:30:21 +0000 beep: Sort usage and man page options Sort usage and man page options, mention possible minimum and maximum values, fix punctuation marks, and cleanup the man page. PR: 291092 Reviewed by: pauamma_gundo.com, christos MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D53827 (cherry picked from commit 55d98b024f25403f60efe04f90a391014b6bc388) --- usr.bin/beep/beep.1 | 55 ++++++++++++++++++++++++++++------------------------- usr.bin/beep/beep.c | 19 +++++++++--------- 2 files changed, 39 insertions(+), 35 deletions(-) diff --git a/usr.bin/beep/beep.1 b/usr.bin/beep/beep.1 index 732f2ae261cd..a13d220a7882 100644 --- a/usr.bin/beep/beep.1 +++ b/usr.bin/beep/beep.1 @@ -21,53 +21,55 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd November 4, 2021 -.Dt beep 1 +.Dd November 19, 2025 +.Dt BEEP 1 .Os .Sh NAME .Nm beep .Nd play a beep sound .Sh SYNOPSIS .Nm -.Op Fl F Ar frequency +.Op Fl Bh .Op Fl D Ar duration_ms -.Op Fl r Ar sample_rate_hz +.Op Fl F Ar frequency_hz .Op Fl d Ar oss_device .Op Fl g Ar gain -.Op Fl B -.Op Fl h +.Op Fl r Ar sample_rate_hz .Sh DESCRIPTION The .Nm -utility is used to playback a beep on the soundcard. +utility is used to play a beep on the sound card. .Pp The options are as follows: -.Bl -tag -width "-f device" -.It Fl F -Sets the center frequency of the beep in Hz. -The default is 440 Hz . -.It Fl D -Sets the duration of the beep in milliseconds. -The default is 150 ms . -.It Fl d -Sets the soundcard to use. -The default is /dev/dsp . -.It Fl r -Sets the soundcard samplerate in Hz. -The default is 48000 Hz. -.It Fl g -Sets the waveform gain, between 0 and 100 inclusively. -The default is 75. +.Bl -tag -width "-r sample_rate_hz" .It Fl B Runs the .Nm utility in the background. +.It Fl D Ar duration_ms +Sets the duration of the beep in milliseconds, +between 50\~ms and 2000\~ms inclusively. +The default is 150\~ms. +.It Fl F Ar frequency_hz +Sets the center frequency of the beep in Hz. +The default is 440\~Hz. +.It Fl d Ar oss_device +Sets the OSS device to use. +The default is +.Pa /dev/dsp . +.It Fl g Ar gain +Sets the waveform gain, between 0 and 100 inclusively. +The default is 75. .It Fl h Display summary of options. +.It Fl r Ar sample_rate_hz +Sets the sound card sample rate in Hz, +between 8000\~Hz and 48000\~Hz inclusively. +The default is 48000\~Hz. .El .Sh EXAMPLES -.Pp -Playback default beep sound using /dev/dsp . +Play default beep sound on +.Pa /dev/dsp : .Bl -tag -width Ds -offset indent .It $ beep .El @@ -77,6 +79,7 @@ Playback default beep sound using /dev/dsp . .Sh HISTORY The .Nm -utility first appeared in FreeBSD 14.0. +utility first appeared in +.Fx 14.0 . .Sh AUTHORS .An Hans Petter Selasky Aq Mt hselasky@FreeBSD.org diff --git a/usr.bin/beep/beep.c b/usr.bin/beep/beep.c index 9d274770ad75..d16ad5b699c3 100644 --- a/usr.bin/beep/beep.c +++ b/usr.bin/beep/beep.c @@ -133,20 +133,21 @@ wave_function_16(float phase, float power) static void usage(void) { - fprintf(stderr, "Usage: %s [parameters]\n" - "\t" "-F \n" + fprintf(stderr, "Usage: %s [-Bh] [-D duration_ms] [-F frequency_hz] " + "[-d oss_device] [-g gain] [-r sample_rate_hz]\n" + "\t" "-B Run in background\n" "\t" "-D \n" - "\t" "-r \n" - "\t" "-d \n" + "\t" "-F \n" + "\t" "-d \n" "\t" "-g \n" - "\t" "-B Run in background\n" - "\t" "-h Show usage\n", + "\t" "-h Show usage\n" + "\t" "-r \n", getprogname(), - DEFAULT_HZ, DURATION_MIN, DURATION_MAX, DURATION_DEF, - SAMPLE_RATE_MIN, SAMPLE_RATE_MAX, SAMPLE_RATE_DEF, + DEFAULT_HZ, DEFAULT_DEVICE, - GAIN_MIN, GAIN_MAX, GAIN_DEF); + GAIN_MIN, GAIN_MAX, GAIN_DEF, + SAMPLE_RATE_MIN, SAMPLE_RATE_MAX, SAMPLE_RATE_DEF); exit(1); } From nobody Sat Nov 29 00:36:00 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dJB6T1016z6HxKv for ; Sat, 29 Nov 2025 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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dJB6S5lC8z40nc for ; Sat, 29 Nov 2025 00:36:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764376560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PJyAMGx1Dg0NiQeJQIf1+IQfe0RdOkVsy4izjRBK5VQ=; b=shQwtcjmYWxv+zF/5O2ljKTyRX0dcsq4YD3xUmRZCkTMgbBkzKPW91F29tHCK+asXV53Lr LPHxK1uYI8e6zvObQG7zhayOAXo/ykSoLzXFho54Mx2QdOVGZWuB9e5anApERRKWOIEF3D fIItTTi6Ni+IifTAaQmr93Lw93aX1tMdW+g8Yl9r0NSb1i221Ik0ScCSZ7n414A+MRsyku pHEo2cpxqElJ2tO04AR8ByBKDKRNRkg0vGe4eBj9pWeG59xR4eeRQCAbVD2WPvshqMQmia /jdR32gc0+gm6jMu4hfXeb4pwtMusaNg6QqJnBo4M9UYL5G5Dm60A5SkQjnxZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764376560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PJyAMGx1Dg0NiQeJQIf1+IQfe0RdOkVsy4izjRBK5VQ=; b=iSOSlVfx9Siqum10xct0p3go3APA01OwHnwvQjpMIC6c89zAZ3nBrJfRLNPqleVE0suz5+ hZq39rKyC9rmPSLN+xu7KeBtjtSnhXdJ914ggOlgMw04aUQDfC6PVSMRTCq1s3ffetH2Pr T7zr6Lukqrpwg9Pr+d5Xh7oH6V8LHLzHZqbJDaulfMHIK6oj8PJr1+mxWlxGOrTSZa8HGL gO4UPaoyZ2+IP4gKJ9lXTJ0dkq+htemvuOxxX+Cv0xff2OquXRbIFDI+DeyZ1ifEuJPbx2 7uA/T99jIDnvBrBXYajqELA5whHq/f9LjF2a4TZdaaXu+THh2suDmPT+ri9z/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764376560; a=rsa-sha256; cv=none; b=D2GVvkXr1DmSB1xm5YLTu0ebBdAg0wq4r9YIQJnm1l2W2x70mjHsV1I12/0y9FgYB1M3BX V6EpHTwbAsVN//C5u2Tf65CWSyr3BqzJT5blpCQ9n8jusgBPll4N3TypgESRX2CsMX7qXd U4i76GVMt0TU5nMIh1g86cYl+N0LBq0iqpxpIS1vd9GOdMwCNnHerQSJES4hcW61JpDGtm A85fUFZSvW3QMZETvJpVF5gnNqEcomZzBhhtwrDwCW7T1jAp3HZ2fxm6x4PlRkmpOZkUNi ixGAURBJYndCrt7ka4XOoULFCKF4EWqB4DTNYFzeBNlBEWJ8R+8b2NHNUxINsw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dJB6S5BkWz8m8 for ; Sat, 29 Nov 2025 00:36:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id ddaf by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 29 Nov 2025 00:36:00 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 4c10ec9bd43f - stable/14 - beep: Sort usage and man page options List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4c10ec9bd43feb86394dc2dc1c16f1c15d4b0285 Auto-Submitted: auto-generated Date: Sat, 29 Nov 2025 00:36:00 +0000 Message-Id: <692a3ff0.ddaf.7a52ab76@gitrepo.freebsd.org> The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=4c10ec9bd43feb86394dc2dc1c16f1c15d4b0285 commit 4c10ec9bd43feb86394dc2dc1c16f1c15d4b0285 Author: Jose Luis Duran AuthorDate: 2025-11-19 15:59:25 +0000 Commit: Jose Luis Duran CommitDate: 2025-11-29 00:31:57 +0000 beep: Sort usage and man page options Sort usage and man page options, mention possible minimum and maximum values, fix punctuation marks, and cleanup the man page. PR: 291092 Reviewed by: pauamma_gundo.com, christos MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D53827 (cherry picked from commit 55d98b024f25403f60efe04f90a391014b6bc388) --- usr.bin/beep/beep.1 | 55 ++++++++++++++++++++++++++++------------------------- usr.bin/beep/beep.c | 19 +++++++++--------- 2 files changed, 39 insertions(+), 35 deletions(-) diff --git a/usr.bin/beep/beep.1 b/usr.bin/beep/beep.1 index 732f2ae261cd..a13d220a7882 100644 --- a/usr.bin/beep/beep.1 +++ b/usr.bin/beep/beep.1 @@ -21,53 +21,55 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd November 4, 2021 -.Dt beep 1 +.Dd November 19, 2025 +.Dt BEEP 1 .Os .Sh NAME .Nm beep .Nd play a beep sound .Sh SYNOPSIS .Nm -.Op Fl F Ar frequency +.Op Fl Bh .Op Fl D Ar duration_ms -.Op Fl r Ar sample_rate_hz +.Op Fl F Ar frequency_hz .Op Fl d Ar oss_device .Op Fl g Ar gain -.Op Fl B -.Op Fl h +.Op Fl r Ar sample_rate_hz .Sh DESCRIPTION The .Nm -utility is used to playback a beep on the soundcard. +utility is used to play a beep on the sound card. .Pp The options are as follows: -.Bl -tag -width "-f device" -.It Fl F -Sets the center frequency of the beep in Hz. -The default is 440 Hz . -.It Fl D -Sets the duration of the beep in milliseconds. -The default is 150 ms . -.It Fl d -Sets the soundcard to use. -The default is /dev/dsp . -.It Fl r -Sets the soundcard samplerate in Hz. -The default is 48000 Hz. -.It Fl g -Sets the waveform gain, between 0 and 100 inclusively. -The default is 75. +.Bl -tag -width "-r sample_rate_hz" .It Fl B Runs the .Nm utility in the background. +.It Fl D Ar duration_ms +Sets the duration of the beep in milliseconds, +between 50\~ms and 2000\~ms inclusively. +The default is 150\~ms. +.It Fl F Ar frequency_hz +Sets the center frequency of the beep in Hz. +The default is 440\~Hz. +.It Fl d Ar oss_device +Sets the OSS device to use. +The default is +.Pa /dev/dsp . +.It Fl g Ar gain +Sets the waveform gain, between 0 and 100 inclusively. +The default is 75. .It Fl h Display summary of options. +.It Fl r Ar sample_rate_hz +Sets the sound card sample rate in Hz, +between 8000\~Hz and 48000\~Hz inclusively. +The default is 48000\~Hz. .El .Sh EXAMPLES -.Pp -Playback default beep sound using /dev/dsp . +Play default beep sound on +.Pa /dev/dsp : .Bl -tag -width Ds -offset indent .It $ beep .El @@ -77,6 +79,7 @@ Playback default beep sound using /dev/dsp . .Sh HISTORY The .Nm -utility first appeared in FreeBSD 14.0. +utility first appeared in +.Fx 14.0 . .Sh AUTHORS .An Hans Petter Selasky Aq Mt hselasky@FreeBSD.org diff --git a/usr.bin/beep/beep.c b/usr.bin/beep/beep.c index 9d274770ad75..d16ad5b699c3 100644 --- a/usr.bin/beep/beep.c +++ b/usr.bin/beep/beep.c @@ -133,20 +133,21 @@ wave_function_16(float phase, float power) static void usage(void) { - fprintf(stderr, "Usage: %s [parameters]\n" - "\t" "-F \n" + fprintf(stderr, "Usage: %s [-Bh] [-D duration_ms] [-F frequency_hz] " + "[-d oss_device] [-g gain] [-r sample_rate_hz]\n" + "\t" "-B Run in background\n" "\t" "-D \n" - "\t" "-r \n" - "\t" "-d \n" + "\t" "-F \n" + "\t" "-d \n" "\t" "-g \n" - "\t" "-B Run in background\n" - "\t" "-h Show usage\n", + "\t" "-h Show usage\n" + "\t" "-r \n", getprogname(), - DEFAULT_HZ, DURATION_MIN, DURATION_MAX, DURATION_DEF, - SAMPLE_RATE_MIN, SAMPLE_RATE_MAX, SAMPLE_RATE_DEF, + DEFAULT_HZ, DEFAULT_DEVICE, - GAIN_MIN, GAIN_MAX, GAIN_DEF); + GAIN_MIN, GAIN_MAX, GAIN_DEF, + SAMPLE_RATE_MIN, SAMPLE_RATE_MAX, SAMPLE_RATE_DEF); exit(1); } From nobody Sat Nov 29 00:36:18 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dJB6w14v9z6Hxw2 for ; Sat, 29 Nov 2025 00:36: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dJB6v5RxYz41Hj for ; Sat, 29 Nov 2025 00:36:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764376583; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SK7WT4O+4nRWUq/DJjiNaujLEi2q6lRPAldQXtxgzbE=; b=eMnGQX/pozExwsGbULADtnRZrtE6YsCuHK+FJ9nh7uf3XucFlnViDyBmELUzAuFeA5wnve 4dOn73RjHfPSNdbSicvPTYshcKuAML1Z9hZXVaxb1YclC0RJAPz7OoWi7CbRBHyhnEBsyi STmprYXBFZzMQ/AIAb36SivaXTCu7yZuFzZafbb6M3YZwhs0GKx9vSq9i2EdE9RaziRsvS LYe4LPK+He1JzSMhusBtXAP6v4R2CGeljhCpXTPFCfvqVz3O9qNq28ezq4fnw5COl67ht/ 226kREIc6LXT2d0pfWomJ/UyyEDp7kypWp0cn4ogkKQdjhaeKRPj6R9HGfuyCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764376583; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SK7WT4O+4nRWUq/DJjiNaujLEi2q6lRPAldQXtxgzbE=; b=W42ZRKPFrwW662GYELovBDeJT/tUzC+Wuy2Pbx0arHQgm/VO/0zvE7P7vbNW9BIeGH2lMg Psle7noumpZhes/840Zcj5c5/u1vK4IR5e9q2H8b47WMiI9lkYr4Ccu86LTZ8XxyPMCE6G j9G4h08Y6R/ZN9mDy5rijyuIzJgy8dP28b98uShzSiQIfRV5+fDANR51d8UKCL5bMuU09v PzrC3lCSsCwDZpvhb7Ull9sjDaCm4NwyZOqIZgDNiptEZSrCj2LjLhdzQ/9ms/DLLjN/B5 C6UaVzJNGtP5O8Bx3cmIBjbOUf02R1yYlOQaJmy77NAcSFxEipN9Fe/l+OTI6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764376583; a=rsa-sha256; cv=none; b=hcm3QU4xCvHgPvGtsGGG2tY79O15Mnl7lvSqfRteivEenby8wcphwXSlL1mfbUioNHqMAU 2TABVLXTWk7bFvdYW/vkk/OceGAFem/QCezglUs9EpPglgMrhJjc7uBqsyp0nd0qwwJu02 /SfPK1vT8slHmPZpmuolrqw8Np+9ZyPozXTPD9TRjGw4n140KXVCRD607K33dAsop8GpKq rFlQBDnFVhaaZ+p1mompm/LrT9uepOjBoWSY+SS4pb311Fl/k5Pa5UePlhAl86CJI2s5EF o8tDEt7lwztRqlB1u/Qj0mY/9nBUSNc6+JYywCKn+hRckl7MtENdFNctjjfb7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dJB6v5131z8dF for ; Sat, 29 Nov 2025 00:36:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id df93 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 29 Nov 2025 00:36:18 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 8d338f99f8b1 - stable/13 - beep: Sort usage and man page options List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8d338f99f8b1dc16d2175721c48201fce117fe43 Auto-Submitted: auto-generated Date: Sat, 29 Nov 2025 00:36:18 +0000 Message-Id: <692a4002.df93.2c462457@gitrepo.freebsd.org> The branch stable/13 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=8d338f99f8b1dc16d2175721c48201fce117fe43 commit 8d338f99f8b1dc16d2175721c48201fce117fe43 Author: Jose Luis Duran AuthorDate: 2025-11-19 15:59:25 +0000 Commit: Jose Luis Duran CommitDate: 2025-11-29 00:32:36 +0000 beep: Sort usage and man page options Sort usage and man page options, mention possible minimum and maximum values, fix punctuation marks, and cleanup the man page. PR: 291092 Reviewed by: pauamma_gundo.com, christos MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D53827 (cherry picked from commit 55d98b024f25403f60efe04f90a391014b6bc388) --- usr.bin/beep/beep.1 | 55 ++++++++++++++++++++++++++++------------------------- usr.bin/beep/beep.c | 19 +++++++++--------- 2 files changed, 39 insertions(+), 35 deletions(-) diff --git a/usr.bin/beep/beep.1 b/usr.bin/beep/beep.1 index 29988c5b271d..d00ee73795aa 100644 --- a/usr.bin/beep/beep.1 +++ b/usr.bin/beep/beep.1 @@ -21,53 +21,55 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd November 4, 2021 -.Dt beep 1 +.Dd November 19, 2025 +.Dt BEEP 1 .Os .Sh NAME .Nm beep .Nd play a beep sound .Sh SYNOPSIS .Nm -.Op Fl F Ar frequency +.Op Fl Bh .Op Fl D Ar duration_ms -.Op Fl r Ar sample_rate_hz +.Op Fl F Ar frequency_hz .Op Fl d Ar oss_device .Op Fl g Ar gain -.Op Fl B -.Op Fl h +.Op Fl r Ar sample_rate_hz .Sh DESCRIPTION The .Nm -utility is used to playback a beep on the soundcard. +utility is used to play a beep on the sound card. .Pp The options are as follows: -.Bl -tag -width "-f device" -.It Fl F -Sets the center frequency of the beep in Hz. -The default is 440 Hz . -.It Fl D -Sets the duration of the beep in milliseconds. -The default is 150 ms . -.It Fl d -Sets the soundcard to use. -The default is /dev/dsp . -.It Fl r -Sets the soundcard samplerate in Hz. -The default is 48000 Hz. -.It Fl g -Sets the waveform gain, between 0 and 100 inclusively. -The default is 75. +.Bl -tag -width "-r sample_rate_hz" .It Fl B Runs the .Nm utility in the background. +.It Fl D Ar duration_ms +Sets the duration of the beep in milliseconds, +between 50\~ms and 2000\~ms inclusively. +The default is 150\~ms. +.It Fl F Ar frequency_hz +Sets the center frequency of the beep in Hz. +The default is 440\~Hz. +.It Fl d Ar oss_device +Sets the OSS device to use. +The default is +.Pa /dev/dsp . +.It Fl g Ar gain +Sets the waveform gain, between 0 and 100 inclusively. +The default is 75. .It Fl h Display summary of options. +.It Fl r Ar sample_rate_hz +Sets the sound card sample rate in Hz, +between 8000\~Hz and 48000\~Hz inclusively. +The default is 48000\~Hz. .El .Sh EXAMPLES -.Pp -Playback default beep sound using /dev/dsp . +Play default beep sound on +.Pa /dev/dsp : .Bl -tag -width Ds -offset indent .It $ beep .El @@ -77,6 +79,7 @@ Playback default beep sound using /dev/dsp . .Sh HISTORY The .Nm -utility first appeared in FreeBSD 14.0. +utility first appeared in +.Fx 14.0 . .Sh AUTHORS .An Hans Petter Selasky Aq Mt hselasky@FreeBSD.org diff --git a/usr.bin/beep/beep.c b/usr.bin/beep/beep.c index 2696bacfacf4..5b219b4fd406 100644 --- a/usr.bin/beep/beep.c +++ b/usr.bin/beep/beep.c @@ -132,20 +132,21 @@ wave_function_16(float phase, float power) static void usage(void) { - fprintf(stderr, "Usage: %s [parameters]\n" - "\t" "-F \n" + fprintf(stderr, "Usage: %s [-Bh] [-D duration_ms] [-F frequency_hz] " + "[-d oss_device] [-g gain] [-r sample_rate_hz]\n" + "\t" "-B Run in background\n" "\t" "-D \n" - "\t" "-r \n" - "\t" "-d \n" + "\t" "-F \n" + "\t" "-d \n" "\t" "-g \n" - "\t" "-B Run in background\n" - "\t" "-h Show usage\n", + "\t" "-h Show usage\n" + "\t" "-r \n", getprogname(), - DEFAULT_HZ, DURATION_MIN, DURATION_MAX, DURATION_DEF, - SAMPLE_RATE_MIN, SAMPLE_RATE_MAX, SAMPLE_RATE_DEF, + DEFAULT_HZ, DEFAULT_DEVICE, - GAIN_MIN, GAIN_MAX, GAIN_DEF); + GAIN_MIN, GAIN_MAX, GAIN_DEF, + SAMPLE_RATE_MIN, SAMPLE_RATE_MAX, SAMPLE_RATE_DEF); exit(1); } From nobody Sun Nov 30 01:45:45 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dJqcV0cJXz6Jf1N for ; Sun, 30 Nov 2025 01:45: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dJqcT6xnhz3mRG for ; Sun, 30 Nov 2025 01:45:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467146; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TqmrKaKEhly3SII9ORvv0OpWrR3r2eCKpDuDh6G3XjY=; b=fwrWfFIUmc3C5oYOtICVrUTriBygszDiN72VPGme5hG8Lj1VpZRtA71s+U+4jlyKZXnxKO wcIGra3E/v1DGCO9+8INISAZSMLFGdTMGehwgoaK+9smJmgS1RTzMoWxfnSj19BfGNZX0H xdIHDpQn78S8iHPTjyO87IJqt6s6TPC8YqVvBZZMG1LDzNDAIscz1dCkDEACj3mulSt4UA d0zZYSagZ7r+bL9eMtHU9i3w8k8IHz6qu/EBkbe0GTziyKQ7nR7bE0GiO+zxOrGEj7THgK DpRg8v0VRmMRgHYvnonNulmQyy8bqd6iTIxZfUZUTz61pfvFQ+lMMwLh2vX3gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467146; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TqmrKaKEhly3SII9ORvv0OpWrR3r2eCKpDuDh6G3XjY=; b=iN2RRlkYNHSi9R5etql79mjsabg5wObc7FWt8CYF+iPmpMmL5/d68abdrzBl8+awvsNG2N 4fTXvu1iOfqQIrl8/yUryf+LRG8+QSG4wUjEEoYTWD+15WT3oXStI8PvCndP+JzvoSiYTm L58nl4fuWcliDxEgkRQ5psFRCUVK3VkyTqbKGYIbQSgi/yeZeGDgDl/3Y8mp8AyKg5biSA aNHXelt/f+bc5JivpqnXatq/1IDc+3fOY7d872MxDTVUQISK7tTDbZTILMG1e71xbQd449 BIVU8Sz2DE1OXaxwB3U5zjTxagdM4w1unB9EutYDVI2uPI0V3AU7IPwnJiVbXw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764467146; a=rsa-sha256; cv=none; b=jGPxvwmDBFUm4pvFwT0ts5IHkr6nw/Fp5OJ0nVBHx882pHpiFyK8GF8eb7pzToWYfeLyPd ouWaMhn3qyoHgiIUJaHv4zjbA+I0wfB7Y+CVqomv8JLODsON3NSZ5AzmZhiSL6HN9AX5Ir 2O19Zh9Wp2el1Rre0BSWRuLjYZZlIlGRYV22IqJHPxaZifoXn/PKQjGLag5a1f75QbNf24 MUuut0lCsaCKLKs2yZMZ/VLQ8Gt6cQg2yuflPcLokF5Bnf9gX/6RFrLmp9MJnqtVOjYo+h tDyjkmAXkU9jPnYtRGNlup6CnyEdYSmqr1gPigEpRahUXQH5AJrmdcIOBly18w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dJqcT6RDtzR0 for ; Sun, 30 Nov 2025 01:45:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 29cae by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 30 Nov 2025 01:45:45 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Strahinja =?utf-8?Q?Stani=C5=A1?==?utf-8?Q?i=C4=87?= From: Robert Clausecker Subject: git: 8a02704131b8 - stable/15 - libc: scalar strrchr() in RISC-V assembly List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 8a02704131b84826f4a327097361199d9762a471 Auto-Submitted: auto-generated Date: Sun, 30 Nov 2025 01:45:45 +0000 Message-Id: <692ba1c9.29cae.10676243@gitrepo.freebsd.org> The branch stable/15 has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=8a02704131b84826f4a327097361199d9762a471 commit 8a02704131b84826f4a327097361199d9762a471 Author: Strahinja Stanišić AuthorDate: 2024-10-24 16:18:07 +0000 Commit: Robert Clausecker CommitDate: 2025-11-30 00:43:05 +0000 libc: scalar strrchr() in RISC-V assembly Implements strrchr in RISC-V assembly, leading to the following improvements (performance measured on SiFive HF105-001) os: FreeBSD arch: riscv │ strrchr_baseline │ strrchr_scalar │ │ sec/op │ sec/op vs base │ Short 837.2µ ± 1% 574.6µ ± 1% -31.37% (p=0.000 n=20+21) Mid 639.7µ ± 0% 269.7µ ± 0% -57.84% (p=0.000 n=20+21) Long 589.1µ ± 0% 176.7µ ± 0% -70.01% (p=0.000 n=20+21) geomean 680.8µ 301.4µ -55.73% │ strrchr_baseline │ strrchr_scalar │ │ MiB/s │ MiB/s vs base │ Short 149.3 ± 1% 217.6 ± 1% +45.71% (p=0.000 n=20+21) Mid 195.4 ± 0% 463.6 ± 0% +137.22% (p=0.000 n=20+21) Long 212.2 ± 0% 707.4 ± 0% +233.40% (p=0.000 n=20+21) geomean 183.6 414.7 +125.88% MFC after: 1 month MFC to: stable/15 Approved by: mhorne, markj (mentor) Sponsored by: Google LLC (GSoC 2024) Differential Revision: https://reviews.freebsd.org/D47275 (cherry picked from commit df21a004be237a1dccd03c7b47254625eea62fa9) --- lib/libc/riscv/string/Makefile.inc | 2 + lib/libc/riscv/string/strrchr.S | 124 +++++++++++++++++++++++++++++++++++++ 2 files changed, 126 insertions(+) diff --git a/lib/libc/riscv/string/Makefile.inc b/lib/libc/riscv/string/Makefile.inc new file mode 100644 index 000000000000..a9cf8bf52481 --- /dev/null +++ b/lib/libc/riscv/string/Makefile.inc @@ -0,0 +1,2 @@ +MDSRCS+= \ + strrchr.S diff --git a/lib/libc/riscv/string/strrchr.S b/lib/libc/riscv/string/strrchr.S new file mode 100644 index 000000000000..51f34ca21fac --- /dev/null +++ b/lib/libc/riscv/string/strrchr.S @@ -0,0 +1,124 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Strahinja Stanisic + */ + +#include + +/* + * a0 - const char *s + * a1 - int c + */ +ENTRY(strrchr) + /* + * a0 - const char *ptr_align + * a1 - temporary + * a2 - temporary + * a3 - temporary + * a4 - temporary + * a5 - const char[8] cccccccc + * a6 - const uint64_t *save_align + * a7 - const uint64_t save_iter + * t0 - const uintr64_t REP8_0X01 + * t1 - const uintr64_t REP8_0X80 + */ + + /* + * save_align = 0 + * save_iter = 0xFFFFFFFFFFFFFF00 + * REP8_0X01 = 0x0101010101010101 + * cccccccc = (char)c * REP8_0X01 + * REP8_0X80 = (REP8_0X80 << 7) << ((str % 8) * 8) + * ptr_align = str - str % 8 + */ + li t0, 0x01010101 + li a6, 0 + slli a2, a0, 3 + slli t1, t0, 32 + li a7, 0xFFFFFFFFFFFFFF00 + or t0, t0, t1 + andi a1, a1, 0xFF + slli t1, t0, 7 + andi a0, a0, ~0b111 + mul a5, a1, t0 + sll t1, t1, a2 + +.Lloop: /* do { */ + ld a1, 0(a0) /* a1 -> data = *ptr_align */ + not a3, a1 /* a3 -> nhz = ~data */ + xor a2, a1, a5 /* a2 -> iter = data ^ cccccccc */ + sub a1, a1, t0 /* a1 -> hz = data - REP8_0X01 */ + not a4, a2 /* a4 -> nhc = ~iter */ + and a1, a1, a3 /* hz = hz & nhz */ + sub a3, a2, t0 /* a3 -> hc = iter - REP8_0X01 */ + and a1, a1, t1 /* hz = hz & REP8_0X80 */ + and a3, a3, a4 /* hc = hc & nhc */ + addi a4, a1, -1 /* a4 -> mask_end = hz - 1 */ + and a3, a3, t1 /* hc = hc & REP8_0X80 */ + xor a4, a4, a1 /* mask_end = mask_end ^ hz */ + addi a0, a0, 8 /* ptr_align = ptr_align + 8 */ + and a3, a3, a4 /* hc = hc & mask_end */ + slli t1, t0, 7 /* REP8_0X80 = REP8_0X01 << 7 */ + not a4, a4 /* mask_end = ~mask_end */ + + beqz a3, .Lskip_save /* if(!hc) goto skip_save */ + or a2, a2, a4 /* iter = iter | mask_end */ + addi a6, a0, -8 /* save_align = ptr_align - 8 */ + mv a7, a2 /* save_iter = iter */ + +.Lskip_save: + beqz a1, .Lloop /* } while(!hz) */ + +.Lfind_char: + /* + * a1 -> iter = save_iter + * a2 -> mask_iter = 0xFF00000000000000 + * a3 -> match_off = 7 + */ + li a2, 0xFF + mv a1, a7 + slli a2, a2, 56 + li a3, 7 + + and a0, a1, a2 + srli a2, a2, 8 + beqz a0, .Lret + + addi a3, a3, -1 + and a0, a1, a2 + srli a2, a2, 8 + beqz a0, .Lret + + addi a3, a3, -1 + and a0, a1, a2 + srli a2, a2, 8 + beqz a0, .Lret + + addi a3, a3, -1 + and a0, a1, a2 + srli a2, a2, 8 + beqz a0, .Lret + + addi a3, a3, -1 + and a0, a1, a2 + srli a2, a2, 8 + beqz a0, .Lret + + addi a3, a3, -1 + and a0, a1, a2 + srli a2, a2, 8 + beqz a0, .Lret + + addi a3, a3, -1 + and a0, a1, a2 + srli a2, a2, 8 + beqz a0, .Lret + + addi a3, a3, -1 + +.Lret: + /* return save_align + match_offset */ + add a0, a6, a3 + ret +END(strrchr) From nobody Sun Nov 30 01:45:47 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dJqcW33cMz6Jf5q for ; Sun, 30 Nov 2025 01:45: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dJqcW1T9Qz3mCy for ; Sun, 30 Nov 2025 01:45:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467147; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VDvgoLQWGh52213p7OIkrU3jjUfkYfc2BoawSZRP1O0=; b=nzp0PfbD3bFsbop5oUPpA+7MShkUluzY7DJm/OrOq3qY1ctIQnCDUDR0nJFdTu2Kc0Luu2 Y44+H4XdDLPbBiR3bILYSmpVsdEhBjo0gGCbK8nmYa5BWeUfqnh/dVMWSqxUnoodM3TJ7H SpSWnycRhSLh6+5zoAt87qxvUL9w+XWvJ9QpAP4Mh99vgwCgiKz9+6zRsQRunaNaicxGMi 2btn444798yMtBjuCDs81752m3jGT7Kjhg1GgYpRo7NbXkyJpZfKrYeaH4PaaJUKN3GKg4 w/AxTvuoRrewKoL6YJPxMJLiGShv6PySq+jDlTNrhQKws7BVG3WndevEBPlHJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467147; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VDvgoLQWGh52213p7OIkrU3jjUfkYfc2BoawSZRP1O0=; b=sHLkIP2joW+kXgimVC02iTstSMW9TxGR164uowNZEoIS7nhQfEJ0LTgJ2B6y4YX216hda/ S8f6pto/v0Y0gau1QCBoRF7t0ky9+qMR0Iu+2rJYPlwj91k/dCH9Zc3cYvnHMLkSELIv04 xEtIDFYBZVQ9lUsESs5W/X6KTTFqJEdl5aAtQwRKW7V2Ojt6ZzzG9x9IfW3LXfG3OKmRVn e9GnzMtp6dyJtsSSQIiYa+Uzs01NIgJ27RyIEB4HGcuWFxSTK6UnZccpleg3nfdUiRlDX2 KsnR1CWLUPLqqkKrNbYVEZ3gnLLF/xtEaakGzmFPYjSb3Z28NqqSPHX4qcswWw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764467147; a=rsa-sha256; cv=none; b=U5+k8nHZQJXmOIAH4dNOT8WdStY9xBCgaajLiULqeFbnIanC0xqQGZvXWSpjqY5iFZBdh2 a3RZ0o9XGxjUIf6/f3LRx5RVKRpZW/GY4CxDmXB5EL4oVmqiw9CyJxx5yc74SpsYL7IwOW b2LfVsFr31o7DsEu1sx7unwwiNA5jZcgumXHFNJiS2Iq1XxUqlCa/RyNZWkf10RS7Ma8en qpjhEItfhsdBT7hlBDlkVg9EW4X+OjnTI5zGOEgJ0xC1/iDxXUOxFVB5Nq69ZZxIdEzr+B MyfKNK52RdwANWGdhozo0viyfETpZxUFtf10lc+sezZW1hoW/TonvwVObjE/LA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dJqcW0BhTz9D for ; Sun, 30 Nov 2025 01:45:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 29cb3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 30 Nov 2025 01:45:47 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Strahinja =?utf-8?Q?Stani=C5=A1?==?utf-8?Q?i=C4=87?= From: Robert Clausecker Subject: git: 09d15e9bc256 - stable/15 - simd.7: add scalar strrchr() for RISC-V to manpage List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 09d15e9bc256b38d0c8c0d1200ab35a0ad541b77 Auto-Submitted: auto-generated Date: Sun, 30 Nov 2025 01:45:47 +0000 Message-Id: <692ba1cb.29cb3.6b3433bd@gitrepo.freebsd.org> The branch stable/15 has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=09d15e9bc256b38d0c8c0d1200ab35a0ad541b77 commit 09d15e9bc256b38d0c8c0d1200ab35a0ad541b77 Author: Strahinja Stanišić AuthorDate: 2024-10-24 16:29:04 +0000 Commit: Robert Clausecker CommitDate: 2025-11-30 00:43:05 +0000 simd.7: add scalar strrchr() for RISC-V to manpage MFC after: 1 month MFC to: stable/15 Approved by: mhorne, markj (mentor) Sponsored by: Google LLC (GSoC 2024) Differential Revision: https://reviews.freebsd.org/D47275 (cherry picked from commit 63ff982b17ee398c7808be323d8fd37819a5863c) --- lib/libc/riscv/string/strrchr.S | 3 +++ share/man/man7/simd.7 | 15 +++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/libc/riscv/string/strrchr.S b/lib/libc/riscv/string/strrchr.S index 51f34ca21fac..e922a692e77f 100644 --- a/lib/libc/riscv/string/strrchr.S +++ b/lib/libc/riscv/string/strrchr.S @@ -6,6 +6,9 @@ #include + .weak rindex + .set rindex, strrchr + /* * a0 - const char *s * a1 - int c diff --git a/share/man/man7/simd.7 b/share/man/man7/simd.7 index d5092348d9b3..92cbbdee25a4 100644 --- a/share/man/man7/simd.7 +++ b/share/man/man7/simd.7 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE . -.Dd November 18, 2024 +.Dd October 8, 2025 .Dt SIMD 7 .Os .Sh NAME @@ -50,7 +50,7 @@ can be used to override this mechanism. .Pp Enhanced functions are present for the following architectures: .Bl -column FUNCTION_________ aarch64_ arm_ amd64_ i386_ ppc64_ -offset indent -.It Em FUNCTION Ta Em AARCH64 Ta Em ARM Ta Em AMD64 Ta Em I386 Ta Em PPC64 +.It Em FUNCTION Ta Em AARCH64 Ta Em ARM Ta Em AMD64 Ta Em I386 Ta Em PPC64 Ta Em RISC-V .It bcmp Ta A Ta Ta S1 Ta S .It bcopy Ta A Ta S Ta S Ta S Ta SV .It bzero Ta A Ta S Ta S Ta S @@ -65,7 +65,7 @@ Enhanced functions are present for the following architectures: .It memmove Ta A Ta S Ta S Ta S Ta SV .It memrchr Ta A Ta Ta S1 .It memset Ta A Ta S Ta S Ta S -.It rindex Ta A Ta Ta S1 Ta S +.It rindex Ta A Ta Ta S1 Ta S Ta Ta S .It stpcpy Ta A Ta Ta S1 .It stpncpy Ta Ta Ta S1 .It strcat Ta A Ta Ta S1 Ta S @@ -81,7 +81,7 @@ Enhanced functions are present for the following architectures: .It strncmp Ta A Ta S Ta S1 Ta S .It strncpy Ta Ta Ta S1 Ta Ta S2 .It strnlen Ta A Ta Ta S1 -.It strrchr Ta A Ta Ta S1 Ta S +.It strrchr Ta A Ta Ta S1 Ta S Ta Ta S .It strpbrk Ta S Ta Ta S2 .It strsep Ta S Ta Ta S2 .It strspn Ta S Ta Ta S2 @@ -207,10 +207,13 @@ for .Fx 11.0 for .Cm aarch64 , -and .Fx 12.0 for -.Cm powerpc64 . +.Cm powerpc64 , +and +.Fx 16.0 +for +.Cm riscv64 . SIMD-enhanced functions were first added with .Fx 13.0 for From nobody Sun Nov 30 01:45:48 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dJqcX4SWHz6Jdg6 for ; Sun, 30 Nov 2025 01:45: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dJqcX1yqjz3mBJ for ; Sun, 30 Nov 2025 01:45:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=llD3Ij8ZdLqI3C81mdaivnoQT4c16twBnLOWCY9CwiU=; b=Bt/DNabcoykTy5dxwl7MTL8qu/hTN9hCqXzfk5ih4p5D7L2SX/5GPkkyk2gl2bnAOD0MKk G0jiTl13f5olsnhz46KXTiF7IOvrtnZrYgztL9ed2T/LOJgWi4uxcNXmEHIkFybjX49qNn Q32f1KFrNYC/TZI7S1p9yNeC33py3pSthmxfieDN5fAUPYDMnpnDnJ4krB1DImv7zKLv3V s1g7eTlaVZwv4ILd+4l1amU5zJKOO58N0LA1v2Usb+JeOdSAVuYqIsggdiw7JnMl0uOzYv zIAASjNWXtjIktBAApJqNSycy7yVJ+TrgPmI2m8VSb9+AgCAlcCfjmZSXNRxeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=llD3Ij8ZdLqI3C81mdaivnoQT4c16twBnLOWCY9CwiU=; b=mmESXLkqz33RiYKRuQILmRZgyO8MzAx05KnJSAbWYRNxLL8RePEUT2ZcGpMO+tJEaeCVjS CitR+ujpFNY3BfSNYte8LBqCqAcoKljt5r1dvEVpcHeP60nBEPDBAiuz86F/6GAK2KE9cP 5plYfadm6t9/OD1+ef8PGKuJaigAEWlmi5XKP2JdM+4ry2S12BzjjsGdf6KhKtJkZGIiB6 T18oQ0Aaay5Z4S0oeOET+Vel821yLkyIpVRMsnYiSpdzGjABFo2XiQxM1kz6F3G+5DLnIC G68HARsxQjgmvtKEEJg+w0V0Li3e6wtMKZI0BopNwHJJDfj1qfbOfaJRGYKOYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764467148; a=rsa-sha256; cv=none; b=KwIlF7w5YyeCCSX5dc7pfda0KrGVmQG0DHt8Ns1bfNQxpgIUB8UEpzxqFsILq44TKhVeYq oJMzbIGNutJN2nPFANuuVIK48lEQJfswTNd92COa70e1TCRffIJNY4Y8rNKdCPx4Jfh2hq HVxLZJQP34muZekv5ljoJAI+hPmGL7n34/o11dI35IfhsG45dtzGxqQuULdiNuD3t/dBHb Blp38akYoG0f8fzGT7huBclRWz/h+G5gk12wbyxrwGVbHYQkhvXpL8y4mOx5lNQ6Lb+/tu WUeNOmCfXUBJImOB0mlQ6e0jeqsKx7CQ4fjnOrnyQac+X6MMFR2vIjCTOdC2XQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dJqcX12wHz1CT6 for ; Sun, 30 Nov 2025 01:45:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 29374 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 30 Nov 2025 01:45:48 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Strahinja =?utf-8?Q?Stani=C5=A1?==?utf-8?Q?i=C4=87?= From: Robert Clausecker Subject: git: 514677bd33fb - stable/15 - libc: scalar memchr() in RISC-V assembly List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 514677bd33fb8f9d99d0f4f51be0efb4bcd86583 Auto-Submitted: auto-generated Date: Sun, 30 Nov 2025 01:45:48 +0000 Message-Id: <692ba1cc.29374.13d96c2b@gitrepo.freebsd.org> The branch stable/15 has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=514677bd33fb8f9d99d0f4f51be0efb4bcd86583 commit 514677bd33fb8f9d99d0f4f51be0efb4bcd86583 Author: Strahinja Stanišić AuthorDate: 2024-07-17 11:19:52 +0000 Commit: Robert Clausecker CommitDate: 2025-11-30 00:43:05 +0000 libc: scalar memchr() in RISC-V assembly Added an optimized memchr() implementation in RISC-V assembly and updated the relevant manpage. │ memchr_baseline │ memchr_scalar │ │ sec/op │ sec/op vs base │ Short 636.6µ ± 1% 495.9µ ± 1% -22.10% (p=0.000 n=20) Mid 279.7µ ± 1% 224.1µ ± 1% -19.87% (p=0.000 n=20) Long 138.8µ ± 0% 124.9µ ± 0% -10.00% (p=0.000 n=20) geomean 291.3µ 240.3µ -17.48% │ memchr_baseline │ memchr_scalar │ │ B/s │ B/s vs base │ Short 187.3Mi ± 1% 240.4Mi ± 1% +28.37% (p=0.000 n=20) Mid 426.2Mi ± 1% 531.9Mi ± 1% +24.79% (p=0.000 n=20) Long 859.0Mi ± 0% 954.4Mi ± 0% +11.11% (p=0.000 n=20) geomean 409.3Mi 496.0Mi +21.19% MFC after: 1 month MFC to: stable/15 Approved by: mhorne, markj (mentor) Reviewed by: fuz Sponsored by: Google LLC (GSoC 2024) Differential Revision: https://reviews.freebsd.org/D46023 (cherry picked from commit 563efdd3bd5d5f94e356444bb64fd66e13dda5e1) --- lib/libc/riscv/string/Makefile.inc | 1 + lib/libc/riscv/string/memchr.S | 188 +++++++++++++++++++++++++++++++++++++ 2 files changed, 189 insertions(+) diff --git a/lib/libc/riscv/string/Makefile.inc b/lib/libc/riscv/string/Makefile.inc index a9cf8bf52481..cdbc19d286fc 100644 --- a/lib/libc/riscv/string/Makefile.inc +++ b/lib/libc/riscv/string/Makefile.inc @@ -1,2 +1,3 @@ MDSRCS+= \ + memchr.S \ strrchr.S diff --git a/lib/libc/riscv/string/memchr.S b/lib/libc/riscv/string/memchr.S new file mode 100644 index 000000000000..e6e04bfae96a --- /dev/null +++ b/lib/libc/riscv/string/memchr.S @@ -0,0 +1,188 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Strahinja Stanisic + */ + +#include + +/* + * a0 - const void *b + * a1 - int c + * a2 - size_t len + */ +ENTRY(memchr) + /* + * a0 - const char *ptr + * a1 - char cccccccc[8] + * a2 - char iter[8] + * a3 - uint8_t *end + * a4 - uint64_t *end_align + * a5 - uint64_t *end_unroll + */ + + beqz a2, .Lno_match + + /* c = (uint8_t) c */ + andi a1, a1, 0xFF + + /* + * t0 = 0x0101010101010101 + * t1 = 0x8080808080808080 + * t2 = b << 3 + * cccccccc = (uint8_t)c * t0 + * end = b + len; + * ptr = b & ~0b111 + */ + add a3, a0, a2 + li t0, 0x01010101 + sltu t2, a0, a3 + slli t1, t0, 32 + neg t2, t2 + or t0, t0, t1 + and a3, a3, t2 + slli t1, t0, 7 + slli t2, a0, 3 + and a0, a0, ~0b111 + mul a1, t0, a1 + + ld a2, (a0) + + /* + * mask_start = REP8_0x01 ^ (REP8_0x01 << t2) + * iter = iter ^ cccccccc + * iter = iter | mask_start + */ + sll t2, t0, t2 + xor a2, a2, a1 + xor t2, t2, t0 + or a2, a2, t2 + + /* has_zero(iter) + * end_align = (end + 7) & ~0b111; + */ + addi a4, a3, 7 + not t2, a2 + sub a2, a2, t0 + and t2, t2, t1 + andi a4, a4, ~0b111 + and a2, a2, t2 + + /* ptr = ptr + 8 */ + addi a0, a0, 8 + + bnez a2, .Lfind_zero + + /* if(ptr == end_align) */ + beq a0, a4, .Lno_match + + /* end_unroll = end_align & ~0b1111 */ + andi a5, a4, ~0b1111 + + /* + * Instead of branching to check if `ptr` is 16-byte aligned: + * - Probe the next 8 bytes for `c` + * - Align `ptr` down to the nearest 16-byte boundary + * + * If `ptr` was already 16-byte aligned, those 8 bytes will be + * checked again inside the unrolled loop. + * + * This removes an unpredictable branch and improves performance. + */ + + ld a2, (a0) + xor a2, a2, a1 + + not t2, a2 + sub a2, a2, t0 + and t2, t2, t1 + and a2, a2, t2 + + addi a0, a0, 8 + + bnez a2, .Lfind_zero + + andi a0, a0, ~0b1111 + + /* while(ptr != end_unroll) */ + beq a0, a5, .Lskip_loop +.Lloop: + ld a2, (a0) + ld t3, 8(a0) + + xor a2, a2, a1 + xor t3, t3, a1 + + not t2, a2 + not t4, t3 + sub a2, a2, t0 + sub t3, t3, t0 + and t2, t2, t1 + and t4, t4, t1 + and a2, a2, t2 + and t3, t3, t4 + + addi a0, a0, 8 + + bnez a2, .Lfind_zero + + /* move into iter for find_zero */ + mv a2, t3 + + addi a0, a0, 8 + + bnez a2, .Lfind_zero + + bne a0, a5, .Lloop +.Lskip_loop: + + /* there might be one 8byte left */ + beq a0, a4, .Lno_match + + ld a2, (a0) + xor a2, a2, a1 + + not t2, a2 + sub a2, a2, t0 + and t2, t2, t1 + and a2, a2, t2 + + addi a0, a0, 8 + + beqz a2, .Lno_match + +.Lfind_zero: + /* + * ptr = ptr - 8 + * t1 = 0x0001020304050607 + * iter = iter & (-iter) + * iter = iter >> 7 + * iter = iter * t1 + * iter = iter >> 56 + */ + li t1, 0x10203000 + neg t0, a2 + slli t1, t1, 4 + and a2, a2, t0 + addi t1, t1, 0x405 + srli a2, a2, 7 + slli t1, t1, 16 + addi a0, a0, -8 + addi t1, t1, 0x607 + mul a2, a2, t1 + srli a2, a2, 56 + + /* left = end - ptr */ + sub t0, a3, a0 + + /* return iter < left ? ptr + iter : NULL */ + sltu t1, a2, t0 + neg t1, t1 + add a0, a0, a2 + and a0, a0, t1 + ret + +.Lno_match: + li a0, 0 + ret +END(memchr) From nobody Sun Nov 30 01:45:49 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dJqcY4cKXz6JfB9 for ; Sun, 30 Nov 2025 01:45: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dJqcY2LKHz3mX3 for ; Sun, 30 Nov 2025 01:45:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HMTlLc471Fapyj6KF6X4xA6g5AGJSE6nGVBQlsepcRc=; b=hrMXiWw6Ege+M67BpyhOvPkv5fand30CwL83xDOyenpCJY/hR3wfrtX9Tt6Gfrmn2hp+t3 qu+u0JPWVTlO9Xw3m4Ah4epRIR08fD0ynbY7TclITK34iktOGGpRy9ztHbAu+7ptcMTe5H iayn4/QpR826ZSxhjEdQE85NAihj9amlmyMKhcILGnpxbzZ1+y8mth892n6xKrRhykkca2 sr0Y11Uc8eYsXeXiEf29bD6kIC7aS0mHS8PR8oEw8h0gkQmP7d0RQWxj5LSsSdkElUzRac OgeB6EVvaAdpWqoygVxEPT+Xu+6qHBghTZBGByxbgLlS3qf5Gs6TheI02RD/3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HMTlLc471Fapyj6KF6X4xA6g5AGJSE6nGVBQlsepcRc=; b=fqA0Xy/Hbd9KWjpPr7FgBRk63sXEsZ6lXW2ZolPTVZyQzUajsMBbp2Nk3rKU9O2aiE/ErH nVM1B2Yc29MtJW8URp5VKDa6FAYW0WKhHV+nr4L91gKZL5hUmx7DYXPs3oomXqLAG+dilO qT8HV+t8+fUirsMAViVbZ7g53KVmLs4X3UmPZQ83CcdXTpBzUVASh/sAz8xA8djrQNVkXW SBnfZfPPA5Xl4OCHds73fgFjMYNkpjlp/8s3qo3QsDG8APGqZquAdHxVKvBH7LhYfZdtER ROWvoHpyww1uPqLT7U4Yy3DOMfI5sjgI+mOvFJ39gb13DTQ+LqxU0gAxHzPEGw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764467149; a=rsa-sha256; cv=none; b=xJEpDKDSTMm2Yt7uI23BQT1328VcFmRYJgZo9OnNgeTEYwm+kzKoSVRiRgKEhuT4ztNOp9 cY+YipXNj2B+N0alEXb7HWF0Dkz1a8vg9ZAtuMLe1U5EUmr92onzi8dkq7QCTj2gzVLtoE mnEehWkrWOUinpTOtgzbGXI+9apLY7lFuHizP1kx0CXUU9V3Da2KUjOyrqSS4FeRH4t952 j1gkQPNtjv00FNRCYWE0KrhqtR00FBHUK71AmXsy+xS43qxJ6AabD5RyNls92v/pDRc4Pw uJJuwKXbevBDMKUrE5kw/S5sbbOKcx7/bAI43TGLytlLSnWYz04/4YYwksQc8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dJqcY1wpzzR1 for ; Sun, 30 Nov 2025 01:45:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2877d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 30 Nov 2025 01:45:49 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Strahinja =?utf-8?Q?Stani=C5=A1?==?utf-8?Q?i=C4=87?= From: Robert Clausecker Subject: git: 8c9581a829be - stable/15 - simd.7: add scalar memchr() for RISC-V to manpage List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 8c9581a829be8989b8ce65ef6f0067279b31bf2d Auto-Submitted: auto-generated Date: Sun, 30 Nov 2025 01:45:49 +0000 Message-Id: <692ba1cd.2877d.4211481d@gitrepo.freebsd.org> The branch stable/15 has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=8c9581a829be8989b8ce65ef6f0067279b31bf2d commit 8c9581a829be8989b8ce65ef6f0067279b31bf2d Author: Strahinja Stanišić AuthorDate: 2024-07-18 17:57:51 +0000 Commit: Robert Clausecker CommitDate: 2025-11-30 00:43:05 +0000 simd.7: add scalar memchr() for RISC-V to manpage MFC after: 1 month MFC to: stable/15 Approved by: mhorne, markj (mentor) Sponsored by: Google LLC (GSoC 2024) Differential Revision: https://reviews.freebsd.org/D46023 (cherry picked from commit d2c23f5953a823e01f0c6418b0f98c119f145e20) --- share/man/man7/simd.7 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man7/simd.7 b/share/man/man7/simd.7 index 92cbbdee25a4..31a4e3b0844f 100644 --- a/share/man/man7/simd.7 +++ b/share/man/man7/simd.7 @@ -58,7 +58,7 @@ Enhanced functions are present for the following architectures: .It index Ta A Ta Ta S1 .It ldiv Ta Ta Ta S Ta S .It lldiv Ta Ta Ta S -.It memchr Ta A Ta Ta S1 +.It memchr Ta A Ta Ta S1 Ta Ta Ta S .It memcmp Ta A Ta S Ta S1 Ta S .It memccpy Ta A Ta Ta S1 .It memcpy Ta A Ta S Ta S Ta S Ta SV From nobody Sun Nov 30 01:45:50 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dJqcZ5Jbwz6Jdy5 for ; Sun, 30 Nov 2025 01:45: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dJqcZ3NLhz3mLq for ; Sun, 30 Nov 2025 01:45:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467150; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sZwB2Zxrz1V4nlDMvRnzU0/CvR4CfO5lOU1vgY09YFE=; b=Bidg+Jz38C/ZS3dZ2ighUW1LvMmTtmjEYDwyD+iLnV73YaP53Jbu7JfabwX2332daplUR4 JaYeqZORtaIrnLn+47Pn0ItJZ9uD/mxVY/4hy7vQg/fmIf02SRYJeBRnRhOgNZPEp06KLr JD2pBYH0c3udJBPesvQwSOHQXdLI6GGlViPcEC/K1e7wDm503wKa0mW1zTET+0UkhvW/Wh BVnN5Zm3SJv/KgV+gamFdEpZb8EQ+WVmrimD3ft3YTRYQIh4eNnSkWCpUPbUO+K22L1p/t /SVzoqX5RHSbVNnYUpTq43FyX2bGqNAJ7HAYTY5vlDyRWMIvUuf1BTOC3ddiEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467150; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sZwB2Zxrz1V4nlDMvRnzU0/CvR4CfO5lOU1vgY09YFE=; b=bkFAHb4qgdf7x8VWqc2s+j4fNK0UCSm6D4UQG/gGxG2r8DDlePZanT5gLFim8ksPtDEHj0 W6btESY8smyjfEuloWWrpQRgUrzuQj+CM2r//so2ShVUnBvY3Lshhr5O3SY62CcBKaTrPx 51ENJ+GCBqwS3ISxW87o+LJREUEm9rhXjubHtxvLmCeOTp+6I5Oy0yUyj6IMPzydXNY1EB PVbE17TdlJrCy7Z8qPZ9N0210Zi/+UiXJXlCOaSimmkL0GYtzWv7J2/bm/NJbH0+AEMvia KMdA9rCT7XLFBTesQj5GTDxosxAGtoDQX+TQ3KVAav1vznYJlsnAayfNjQkpyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764467150; a=rsa-sha256; cv=none; b=cC1GBUE4fBOgg4cm1jPqb7OPNAjKjDx3z4IkRED9wFahiCvjeOy+trz9cHEN5FshLIijrG y3itYvV6zQbj0QioEMFJsvFJUvFzythRMlgzbyD/Pn+lXgGNoCB6vsPIpyF4xdRm2mYk2j qefBG9YzEYNxqk/wsYq3RzAIylX54lHbsMp1ovTrxOpxoias/KdO+B7WeV6gjXOJhKPRd7 SZPJOFQiJzlehDtrUT9nrxqqZ9JgtA7Nk09nZOhaXN/v7TzbL7PzkBFDWFuM21x0WPrAqB zYkqdHgqwUGZepyF8r5Ble5yCdzFeT9HYVKASYKcdPODQpXJd4YwfssSctpX/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dJqcZ2nTLz1CpT for ; Sun, 30 Nov 2025 01:45:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 28660 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 30 Nov 2025 01:45:50 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Strahinja =?utf-8?Q?Stani=C5=A1?==?utf-8?Q?i=C4=87?= From: Robert Clausecker Subject: git: 2d205cdb41e3 - stable/15 - libc: scalar memset() in RISC-V assembly List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 2d205cdb41e375ab5fcdab9233439aec75eeebd6 Auto-Submitted: auto-generated Date: Sun, 30 Nov 2025 01:45:50 +0000 Message-Id: <692ba1ce.28660.7af4e31b@gitrepo.freebsd.org> The branch stable/15 has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=2d205cdb41e375ab5fcdab9233439aec75eeebd6 commit 2d205cdb41e375ab5fcdab9233439aec75eeebd6 Author: Strahinja Stanišić AuthorDate: 2024-06-21 15:43:45 +0000 Commit: Robert Clausecker CommitDate: 2025-11-30 00:43:05 +0000 libc: scalar memset() in RISC-V assembly Adds scalar implementation of memset for RISC-V and updates the relevant manpage os: FreeBSD arch: riscv │ ./results/memset/memset_baseline │ ./results/memset/memset_scalar │ │ sec/op │ sec/op vs base │ 40 527.5µ ± 1% 479.4µ ± 1% -9.12% (p=0.000 n=20) 168 254.5µ ± 1% 216.7µ ± 1% -14.86% (p=0.000 n=20) 2k 169.5µ ± 1% 128.4µ ± 0% -24.24% (p=0.000 n=20) 256k 161.2µ ± 1% 118.6µ ± 1% -26.42% (p=0.000 n=20) 16m 56.58m ± 0% 53.91m ± 0% -4.72% (p=0.000 n=20) geomean 730.2µ 611.2µ -16.29% │ ./results/memset/memset_baseline │ ./results/memset/memset_scalar │ │ B/s │ B/s vs base │ 40 452.0Mi ± 1% 497.3Mi ± 1% +10.04% (p=0.000 n=20) 168 936.9Mi ± 1% 1100.4Mi ± 1% +17.45% (p=0.000 n=20) 2k 1.373Gi ± 1% 1.813Gi ± 0% +32.00% (p=0.000 n=20) 256k 1.444Gi ± 1% 1.962Gi ± 1% +35.91% (p=0.000 n=20) 16m 269.7Mi ± 0% 283.1Mi ± 0% +4.96% (p=0.000 n=20) geomean 750.1Mi 896.1Mi +19.47% MFC after: 1 month MFC to: stable/15 Approved by: mhorne, markj (mentor) Reviewed by: fuz Sponsored by: Google LLC (GSoc 2024) Differential Revision: https://reviews.freebsd.org/D45730 (cherry picked from commit 40a958d5850ddda6d863558c8b31572f700d53ca) --- lib/libc/riscv/string/Makefile.inc | 1 + lib/libc/riscv/string/memset.S | 95 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) diff --git a/lib/libc/riscv/string/Makefile.inc b/lib/libc/riscv/string/Makefile.inc index cdbc19d286fc..44aeb65bf1f7 100644 --- a/lib/libc/riscv/string/Makefile.inc +++ b/lib/libc/riscv/string/Makefile.inc @@ -1,3 +1,4 @@ MDSRCS+= \ memchr.S \ + memset.S \ strrchr.S diff --git a/lib/libc/riscv/string/memset.S b/lib/libc/riscv/string/memset.S new file mode 100644 index 000000000000..ca435dfdd5c1 --- /dev/null +++ b/lib/libc/riscv/string/memset.S @@ -0,0 +1,95 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Strahinja Stanisic + */ + +#include + +/* + * register a0 - void *dest + * register a1 - int c + * register a2 - size_t len + */ +ENTRY(memset) + andi a1, a1, 0xFF + + sltiu t1, a2, 8 + mv t0, a0 + bnez t1, .Lend + + li t1, 0x0101010101010101 + mul a1, a1, t1 + + andi t1, a0, 0b111 + andi t0, a0, ~0b111 + + beqz t1, .Lloop_store_64 + + la t2, .Lduff_start + slli t3, t1, 2 + add t2, t2, t3 + jr -4(t2) +.Lduff_start: + sb a1, 1(t0) + sb a1, 2(t0) + sb a1, 3(t0) + sb a1, 4(t0) + sb a1, 5(t0) + sb a1, 6(t0) + sb a1, 7(t0) + + /* a3 = a3 -(8-a) <=> a3 = a3 + (a-8) */ + addi t1, t1, -8 + add a2, a2, t1 + addi t0, t0, 8 + +.Lloop_store_64: + slti t1, a2, 64 + bnez t1, .Lstore_rest + sd a1, 0(t0) + sd a1, 8(t0) + sd a1, 16(t0) + sd a1, 24(t0) + sd a1, 32(t0) + sd a1, 40(t0) + sd a1, 48(t0) + sd a1, 56(t0) + addi a2, a2, -64 + addi t0, t0, 64 + j .Lloop_store_64 + +.Lstore_rest: + la t2, .Lduff_rest + andi t3, a2, ~0b111 + srli t4, t3, 1 + sub t2, t2, t4 + jr t2 + sd a1, 56(t0) + sd a1, 48(t0) + sd a1, 40(t0) + sd a1, 32(t0) + sd a1, 24(t0) + sd a1, 16(t0) + sd a1, 8(t0) + sd a1, 0(t0) +.Lduff_rest: + add t0, t0, t3 + sub a2, a2, t3 + +.Lend: + slli a2, a2, 2 + la t2, .Lduff_end + sub t2, t2, a2 + jr t2 + sb a1, 6(t0) + sb a1, 5(t0) + sb a1, 4(t0) + sb a1, 3(t0) + sb a1, 2(t0) + sb a1, 1(t0) + sb a1, (t0) +.Lduff_end: + ret +END(memset) + From nobody Sun Nov 30 01:45:51 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dJqcb6KyZz6Jf5v for ; Sun, 30 Nov 2025 01:45: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dJqcb4Khhz3mH2 for ; Sun, 30 Nov 2025 01:45:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467151; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oLcNKkSNQW7226Rg6/sDJ6SDABwfqs5/0JdRAlrO2tc=; b=ZTCaQqlSMWK2dHtS3pa7RE4E3DWxGRVunnJCBaS5hs0PQNiiPAHnoGVCBYyxVNVRiBhHh3 t/cL9QrHsCnXnFz1SNN0AkNkHJ3UXJbljQe+v+/5OlxxUQ/8MNrp6wSL7ZHkg9U/hq3l1I WfCqzA2NmsjpSAOHncV4WTNmGO5UTm0uA42cfBAxOhJBv6Oz3RKxUDjM/iRIMWzsabsmPV g364I8bfr/MoXB4SSWq7DZhK9cP87h3VKUdzNVRZ/HUSTaoVOVXvWTr9SDdGyEOXXHaK/5 x+abjI/rgma2awjp29uv5bSwPCuMhbB0PKXiAN51E7epzAfN0rhcsuZasxjHZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467151; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oLcNKkSNQW7226Rg6/sDJ6SDABwfqs5/0JdRAlrO2tc=; b=D6wjFu0gln7QogIAKwrsfIwvvDfHMy3f7nKoskk2sLNqoF8UMN8mFW2ktNYDRlwMUwjiI4 ykn0HuKhcvwi5n1lisM2GtjpChhwz2KVVLof80RERviI/dDq5QCBBBIGbrO1Za70gbdZW5 SWPl8Yls2ovOII5WjerB8d4lryJK71vEigiPeOKLT9nfZJZ6QLmxKLuOajiTn7IBnMOHTu tupSkuCPIx8dMVfjFaO0dM1R6x/WDoWGET57V4PmpahdjHt80l+vzWh97Mcg2MSUylK/BJ CqI2Y6YkBnJTVnvZXVS0rRmNotYwX+kt7O705BZlYCyFLIUuxugVh3VyfR4RhQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764467151; a=rsa-sha256; cv=none; b=ymwfSguVMenNdOwNkayzg9aBQRFngmSfXDdziXEijZWRAEKRrxtiweC/IBVcNe58wlaCjX 82Nvvz0vxWedBd2xatl13IPjKdTfSCYhRrQ1H7fcgrIumlcO5N+ydpJqde5GuOmGL1gbCS Vtp7Mpe06+XMJaj8PK099i66jtKsYyMwp4VO3pzmhGS9Two4FNVuMHfcwuq3f/GXXpbUjD HHvrtLF1LTrwVkgvDgStr+lr3WxIfW6gZxL9Pf+25swnE0JTBHIZCqf1B+x2U8RsByEaH7 CB+9ydsVMk76hEGsoARSICeQ/Ltg11FOEbsK8BL1gPK1uk0WFZlJyXNhZhpTbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dJqcb3gwmzPy for ; Sun, 30 Nov 2025 01:45:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2a971 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 30 Nov 2025 01:45:51 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Strahinja =?utf-8?Q?Stani=C5=A1?==?utf-8?Q?i=C4=87?= From: Robert Clausecker Subject: git: 62fa1d20fec7 - stable/15 - simd.7: add scalar memset() for RISC-V to manpage List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 62fa1d20fec709772664d64fb5585d09d451f1b3 Auto-Submitted: auto-generated Date: Sun, 30 Nov 2025 01:45:51 +0000 Message-Id: <692ba1cf.2a971.1713d6ea@gitrepo.freebsd.org> The branch stable/15 has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=62fa1d20fec709772664d64fb5585d09d451f1b3 commit 62fa1d20fec709772664d64fb5585d09d451f1b3 Author: Strahinja Stanišić AuthorDate: 2024-06-24 17:07:06 +0000 Commit: Robert Clausecker CommitDate: 2025-11-30 00:43:05 +0000 simd.7: add scalar memset() for RISC-V to manpage MFC after: 1 month MFC to: stable/15 Approved by: mhorne, markj (mentor) Reviewed by: fuz Sponsored by: Google LLC (GSoC 2024) Differential Revision: https://reviews.freebsd.org/D45730 (cherry picked from commit 164156058e723c0d9b2bb68054543963f40f1159) --- share/man/man7/simd.7 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man7/simd.7 b/share/man/man7/simd.7 index 31a4e3b0844f..565b4fa7ea2f 100644 --- a/share/man/man7/simd.7 +++ b/share/man/man7/simd.7 @@ -64,7 +64,7 @@ Enhanced functions are present for the following architectures: .It memcpy Ta A Ta S Ta S Ta S Ta SV .It memmove Ta A Ta S Ta S Ta S Ta SV .It memrchr Ta A Ta Ta S1 -.It memset Ta A Ta S Ta S Ta S +.It memset Ta A Ta S Ta S Ta S Ta Ta S .It rindex Ta A Ta Ta S1 Ta S Ta Ta S .It stpcpy Ta A Ta Ta S1 .It stpncpy Ta Ta Ta S1 From nobody Sun Nov 30 01:45:53 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dJqcf0d3dz6JfBL for ; Sun, 30 Nov 2025 01:45: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dJqcd6DLWz3mSN for ; Sun, 30 Nov 2025 01:45:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467153; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4YsktO0T1C1cQy1SEX29aojqo9IFr8JTHVUPMvwYF/w=; b=fiCGqBOPQ80ETQwQ8LwVkBm/3348r3uba8qQ22eYQy7aJP1hJctlwTCd0Lx8z1UIP06XiE djyTLDyTIoaccr6epYb8ToleE8SA2G0mUj3yC+IZnrbMb7qbughQ3SWva8EPdwxVGzjekn i3cEoXtbOEGtroreyn0ln75MnqEAfSexou6IxZ0JOD3lCp0QszyhoRQjUPJr7n2a5vQfPR Bi17cJDuAnSDvTsOYoW89bYkDFQQx86e+mwdygbpwGoPT4caCDfgVfLDMewGBOJ/hoWA6x u1bvXGt+hVLhkJYblRakB++8yj3VjFXf//gtQXLe0iGPcJ349ipGaNebWw1ZoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467153; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4YsktO0T1C1cQy1SEX29aojqo9IFr8JTHVUPMvwYF/w=; b=mWSUEDTJOhaDY6v4ZJNGdGOR6vUZr2VrXx7D4PnLco1piA0BdnveWIkzctmEenUBL3exQd y+tBVt86LTA/S1Jw6arG9uqCDu7vqCx/SuhBlVQgrPyjNpfVvLVgJyWg71pK8aS4ZlbMfl Ifx92iF8oc+udisrrAII1DRLw3kfV0cz3IB/W4bCOFztgx8N06HfVrtb2yRIj5Gb+zzStH uqmr7jFbQa4DyJs8OL6tZzU6UicbSs3eyKyXDlmCvL/qBsSwnHm2Fjq5AkLUsIEL0M9GPo 2oiIGvusqaafIqzD++VCAgQK1JTAdGEe53erh/y2ae1JyQOr9Zb1WCA5ZDdHPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764467153; a=rsa-sha256; cv=none; b=O723ONMfRiUvzQz2rSpOZF7MVnNxWgemlFoIjfvCNRftif7IUzOD/bpCAdHRO+jZ6ENV+p AVnFPr5cV9l6pLSv+sYBrMvUi4Atyns2m9Aq76mM+JXVJhe8E4zYKBPFDM0wRG+KAWYekB sWj8yA1QpXr5jzCJ3htUD9siYlt78KTSzAZEDPz6miuLqqJTmvCWA8X+vob4v7UXdwfa95 P9l3I+25im4+L03jqbbWgJDSlDPwSrFp3gyDaK/Rw6dgW4Ou/bFtU+JknTfNwbYMpdc4Jc BU/faK7rvG1/XyntUtHI1B9VDPo/SC98PfLQqd0vVoIjqVyBrrmUqw2e1eCmAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dJqcd54N3zT9 for ; Sun, 30 Nov 2025 01:45:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 28f29 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 30 Nov 2025 01:45:53 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Strahinja =?utf-8?Q?Stani=C5=A1?==?utf-8?Q?i=C4=87?= From: Robert Clausecker Subject: git: 6eed64ce1f6b - stable/15 - simd.7: add scalar strlen() for RISC-V to manpage List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 6eed64ce1f6b5c88d734c3f6bb68d4775fc39b55 Auto-Submitted: auto-generated Date: Sun, 30 Nov 2025 01:45:53 +0000 Message-Id: <692ba1d1.28f29.337dac95@gitrepo.freebsd.org> The branch stable/15 has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=6eed64ce1f6b5c88d734c3f6bb68d4775fc39b55 commit 6eed64ce1f6b5c88d734c3f6bb68d4775fc39b55 Author: Strahinja Stanišić AuthorDate: 2024-06-21 23:43:51 +0000 Commit: Robert Clausecker CommitDate: 2025-11-30 00:43:05 +0000 simd.7: add scalar strlen() for RISC-V to manpage MFC after: 1 month MFC to: stable/15 Approved by: mhorne, markj (mentor) Reviewed by: fuz Sponsored by: Google LLC (GSoC 2024) Differential Revision: https://reviews.freebsd.org/D45693 (cherry picked from commit 07b1d5a37741f5d4de69117a03ef757edff29032) --- share/man/man7/simd.7 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man7/simd.7 b/share/man/man7/simd.7 index 565b4fa7ea2f..5978d4b6655e 100644 --- a/share/man/man7/simd.7 +++ b/share/man/man7/simd.7 @@ -76,7 +76,7 @@ Enhanced functions are present for the following architectures: .It strcspn Ta S Ta Ta S2 .It strlcat Ta A Ta Ta S1 .It strlcpy Ta A Ta Ta S1 -.It strlen Ta A Ta S Ta S1 +.It strlen Ta A Ta S Ta S1 Ta Ta Ta S .It strncat Ta A Ta Ta S1 .It strncmp Ta A Ta S Ta S1 Ta S .It strncpy Ta Ta Ta S1 Ta Ta S2 From nobody Sun Nov 30 01:45:54 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dJqcg0Sn8z6JdgS for ; Sun, 30 Nov 2025 01:45: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dJqcf6SRMz3mSh for ; Sun, 30 Nov 2025 01:45:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467154; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vYG4mzq/vu99Qi0CqG5JRZDkTZXK3KUpN6md8ROSU3E=; b=YCbabuy38YrjMilcduePMSPX8ToAPbVCN9lSjs3OD+GaCpgrTjzrZjrXu2iAc52xBs9MFv oTs9CLkXMZS1R5xFiy6Syn9IyqkoZ2cMpWMiKQzhlDkYpQzMrk4L/1E8AfnPA5Zbe0jErc ipHqa7W/siwfuNj04SY9hGWaaIRAaKLowH7/NzHnGHG5XFZlj4DE39URcM7Z+b6aty8af5 FqQZMQ1tK4NzPbmhppjOPL5yrWzegz74LJWhInZLPDFV9sw9LO9XJ8Rf5Nz3fQaicBm4Km tmZHKXl5RMGdD2h5LgXPi+nn3Hur3avcRtIxalk+Gw8ccFcqE5NWncdQDafCxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467154; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vYG4mzq/vu99Qi0CqG5JRZDkTZXK3KUpN6md8ROSU3E=; b=h1CdWDhDkEcioLnZ4SXSbJmdm9e3p17yN9Ke5mMSb/CGtWodrFykODdkUAg2J0eZqLALOZ 00ROtVgPB6K2ln9OzXX+cxvlbaDep0Zz9v18GGoMqhMvXtONppdWSq4lj62C/OE1KkJf0C nJBsjqCxITqyyCJpzA6QQYqutqz0zdtpX2QYVd9zPZnefmDycQMB1q5eNUiDx1jnmhBTvH PYfKzc1eQMEX+KI5eiIIuNzUCIAJ8iUexnWmjXNEnhgTOBHKchCWhX7LNyMPIOlp4oDcSA +1KlJTt5h0poIfWIY5P/IKKbSUpTo0DsKmVb1vdGqkKWB3CW/LKHBieD5UR0kQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764467154; a=rsa-sha256; cv=none; b=ReZH/kXOcVBk2xjvlsNld28E5jtxEpq80I69HndxuyGC6rauKR17LM32cwu0DoKgmzYXpy A8XE5pqsCS0hh4ZGKCxuPvK/zOZwfv2HT5BOX6Wj+zNr84lg7+igG1BKa6FLneAu+i0X8D hAmrqF/qBse5ktlc3l0Pnob2hH5aKDqfSVjHoi9nFo3efvT3Ijem7xXs/dHPila0CZiwqI ++EVC1mbwNjXo/lPbVZ219K0dm2iKmd2jHOWBB3BCmY7Tf3VOrNRnONUj2lEwo51mHWI3B lCmIal8fDzhOnmvb187J927pS1gsLR/ml4v2DKQm6yoF6rx5qAY7ES73XnvFZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dJqcf5wRdzR5 for ; Sun, 30 Nov 2025 01:45:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2a52c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 30 Nov 2025 01:45:54 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Strahinja =?utf-8?Q?Stani=C5=A1?==?utf-8?Q?i=C4=87?= From: Robert Clausecker Subject: git: a86afcd3f33c - stable/15 - libc: scalar memcpy() in RISC-V assembly List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: a86afcd3f33c4b9a7879faa421367bb8a4423002 Auto-Submitted: auto-generated Date: Sun, 30 Nov 2025 01:45:54 +0000 Message-Id: <692ba1d2.2a52c.657d441c@gitrepo.freebsd.org> The branch stable/15 has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=a86afcd3f33c4b9a7879faa421367bb8a4423002 commit a86afcd3f33c4b9a7879faa421367bb8a4423002 Author: Strahinja Stanišić AuthorDate: 2024-07-24 23:33:30 +0000 Commit: Robert Clausecker CommitDate: 2025-11-30 00:43:05 +0000 libc: scalar memcpy() in RISC-V assembly Optimized assembly implementation of memcpy() for the RISC-V architecture. The implementation has two paths: - An aligned path - (dst - src) % 8 = 0, runs faster - An unaligned path - (dst - src) % 8 != 0, runs slower os: FreeBSD arch: riscv │ memcpy_baseline │ memcpy_scalar │ │ sec/op │ sec/op vs base │ 64Align8 851.6µ ± 1% 488.9µ ± 1% -42.59% (p=0.000 n=12) 4kAlign8 681.5µ ± 1% 255.1µ ± 2% -62.57% (p=0.000 n=12) 256kAlign8 273.0µ ± 2% 230.7µ ± 2% -15.50% (p=0.000 n=12) 16mAlign8 98.07m ± 0% 95.29m ± 0% -2.84% (p=0.000 n=12) 64UAlign 887.5µ ± 1% 531.6µ ± 1% -40.10% (p=0.000 n=12) 4kUAlign 725.6µ ± 1% 262.2µ ± 1% -63.87% (p=0.000 n=12) 256kUAlign 844.1µ ± 2% 322.8µ ± 0% -61.76% (p=0.000 n=12) 16mUAlign 134.9m ± 0% 101.2m ± 0% -24.97% (p=0.000 n=20) geomean 2.410m 1.371m -43.12% │ memcpy_baseline │ memcpy_scalar │ │ MiB/s │ MiB/s vs base │ 64Align8 293.6 ± 1% 511.3 ± 1% +74.18% (p=0.000 n=12) 4kAlign8 366.8 ± 1% 980.0 ± 2% +167.15% (p=0.000 n=12) 256kAlign8 915.8 ± 2% 1083.7 ± 2% +18.34% (p=0.000 n=12) 16mAlign8 163.1 ± 0% 167.9 ± 0% +2.92% (p=0.000 n=12) 64UAlign 281.7 ± 1% 470.3 ± 1% +66.94% (p=0.000 n=12) 4kUAlign 344.5 ± 1% 953.6 ± 1% +176.77% (p=0.000 n=12) 256kUAlign 296.2 ± 2% 774.5 ± 0% +161.49% (p=0.000 n=12) 16mUAlign 118.6 ± 0% 158.1 ± 0% +33.28% (p=0.000 n=20) geomean 293.4 515.8 +75.81% MFC after: 1 month MFC to: stable/15 Approved by: mhorne, markj (mentor) Reviewed by: fuz Sponsored by: Google LLC (GSoC 2024) Differential Revision: https://reviews.freebsd.org/D46139 (cherry picked from commit 25fdd86a4c92b5bdab82db289f3bcd57756778e7) --- lib/libc/riscv/string/Makefile.inc | 1 + lib/libc/riscv/string/memcpy.S | 217 +++++++++++++++++++++++++++++++++++++ 2 files changed, 218 insertions(+) diff --git a/lib/libc/riscv/string/Makefile.inc b/lib/libc/riscv/string/Makefile.inc index 5853ea114277..ebea8d1d3412 100644 --- a/lib/libc/riscv/string/Makefile.inc +++ b/lib/libc/riscv/string/Makefile.inc @@ -1,5 +1,6 @@ MDSRCS+= \ memchr.S \ + memcpy.S \ memset.S \ strlen.S \ strrchr.S diff --git a/lib/libc/riscv/string/memcpy.S b/lib/libc/riscv/string/memcpy.S new file mode 100644 index 000000000000..7536514df777 --- /dev/null +++ b/lib/libc/riscv/string/memcpy.S @@ -0,0 +1,217 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Strahinja Stanisic + */ + +#include + +/* + * a0 - void* dst + * a1 - const void* src + * a2 - size_t len + */ +ENTRY(memcpy) + beqz a2, .Lreturn + + /* diff = (dstv - srcv) & 0b111 */ + sub t0, a0, a1 + andi t0, t0, 0b111 + + sltiu t1, a2, 8 + + /* we never change a0, because memcpy returns the original dst */ + mv a3, a0 + + /* len < 8 */ + bnez t1, .Lend + + /* t1 = (-dst) & 0b111 */ + neg t1, a0 + andi t1, t1, 0b111 + + sub a2, a2, t1 + + la t2, .Lduff_start + slli t3, t1, 3 + sub t2, t2, t3 + jr t2 + lb t3, 6(a1) + sb t3, 6(a3) + lb t3, 5(a1) + sb t3, 5(a3) + lb t3, 4(a1) + sb t3, 4(a3) + lb t3, 3(a1) + sb t3, 3(a3) + lb t3, 2(a1) + sb t3, 2(a3) + lb t3, 1(a1) + sb t3, 1(a3) + lb t3, 0(a1) + sb t3, 0(a3) +.Lduff_start: + + add a1, a1, t1 + add a3, a3, t1 + + beqz a2, .Lreturn + + beqz t0, .Lmemcpy8 + + /* + * a4 - size_t right_shift + * a5 - size_t left_shift + * a6 - size_t whole (number of dword stores) + */ + + /* right_shift = (src % 0b111) * 8; */ + andi a4, a1, 0b111 + slli a4, a4, 3 + + /* left_shift = 64 - right_shift */ + neg a5, a4 + + /* whole = len / 8 */ + srli a6, a2, 3 + + /* len = len % 8 */ + andi a2, a2, 0b111 + + /* t0 - uint64_t* ptr */ + + /* ptr = src & ~0b111 */ + andi t0, a1, ~0b111 + + /* src += whole * 8 */ + slli t1, a6, 3 + add a1, a1, t1 + + /* + * t1 - uint64_t low + * t2 - uint64_t high + */ + + /* low = *ptr++ */ + ld t1, (t0) + addi t0, t0, 8 + + /* low >>= right_shift */ + srl t1, t1, a4 + + beqz a6, .Llmain_skip +.Llmain: + /* high = *ptr++ */ + ld t2, (t0) + addi t0, t0, 8 + + /* whole-- */ + addi a6, a6, -1 + + /* temp = (high << left_shift) | low */ + sll t3, t2, a5 + or t3, t3, t1 + + /* low = high >> right_shift */ + srl t1, t2, a4 + + /* *dst++ = temp */ + sd t3, (a3) + addi a3, a3, 8 + + bnez a6, .Llmain + +.Llmain_skip: + +.Lend: + la t1, .Lduff_end + slli t2, a2, 3 + sub t1, t1, t2 + jr t1 + lb t2, 6(a1) + sb t2, 6(a3) + lb t2, 5(a1) + sb t2, 5(a3) + lb t2, 4(a1) + sb t2, 4(a3) + lb t2, 3(a1) + sb t2, 3(a3) + lb t2, 2(a1) + sb t2, 2(a3) + lb t2, 1(a1) + sb t2, 1(a3) + lb t2, 0(a1) + sb t2, 0(a3) +.Lduff_end: + +.Lreturn: + ret + +/* exectued when dst - src is multiple of 8 + * a0 - void* dst + * a1 - const void* src + * a2 - size_t len + */ +.Lmemcpy8: + + beqz a2, .Lreturn + + slti t0, a2, 128 + bnez t0, .Llmain8_64_skip + + /* a4 - uint64_t* end_unroll */ + + /* end_unroll = dst + len / 64 * 64 */ + andi t0, a2, ~0b111111 + add a4, a3, t0 + + /* len = len % 64 */ + andi a2, a2, 0b111111 + +.Llmain8_64: + ld t0, 0(a1) + ld t1, 8(a1) + ld t2, 16(a1) + ld t3, 24(a1) + sd t0, 0(a3) + sd t1, 8(a3) + sd t2, 16(a3) + sd t3, 24(a3) + ld t0, 32(a1) + ld t1, 40(a1) + ld t2, 48(a1) + ld t3, 56(a1) + sd t0, 32(a3) + sd t1, 40(a3) + sd t2, 48(a3) + sd t3, 56(a3) + addi a3, a3, 64 + addi a1, a1, 64 + bne a3, a4, .Llmain8_64 +.Llmain8_64_skip: + + beqz a2, .Lreturn + + /* a4 - uint64_t* end_align */ + + /* end_align = (dst + len) & ~0b111 */ + add a4, a3, a2 + andi a4, a4, ~0b111 + + /* len = len % 8 */ + andi a2, a2, 0b111 + + beq a3, a4, .Llmain8_skip +.Llmain8: + ld t0, (a1) + sd t0, (a3) + addi a3, a3, 8 + addi a1, a1, 8 + bne a3, a4, .Llmain8 +.Llmain8_skip: + + la t1, .Lduff_end + slli t2, a2, 3 + sub t1, t1, t2 + jr t1 +END(memcpy) From nobody Sun Nov 30 01:45:55 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dJqch2g6Mz6JfDV for ; Sun, 30 Nov 2025 01:45: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dJqch0LXdz3mQY for ; Sun, 30 Nov 2025 01:45:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cZnbT1NKQDAGSgNNfqAjnTwcpOjAS4/L63cPvqDPBTE=; b=Mi9qr6zy51zWx84DmbodMtEFs3FhiHawhMZeGFXvHHphFhBzFTAiM8RFmyKX0v8ZbGVf8m 7SzO57mWhpaSgGCr/yVmgG8t1tl3DQ0RdFdgAnQ0/e2Rq69hH92UOkNXIhlDeD2QSqRjeC 737KvTfR7lDmbBn9Xq2INvpJc8Wqg6605G3TpD/eQniD0TXtAIVTuhtglNwT0qe/NAcuHF 6/Cc7H46pO8XD7RYmSb5eAkF/esk0SKFKjib7vdA4KO4H7rMw0CG6/e3mgfFo994iHB24H xG/h/Y+225mE9mTl5njsIWSDSZEGnpKhE+CmosFtDj5kvX8j3YInRbyLG5qlqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cZnbT1NKQDAGSgNNfqAjnTwcpOjAS4/L63cPvqDPBTE=; b=eUXlFB2UIj52X4Bie3SaB4fkcf/Nr7xYcEzxsH3053y4ClcaoHZ7NJdNnmn78Gpcv7u8Zu 1susSPsaYvA1+X6OUEb2kLTmFSSO/wUJWQKBGXXuIPgr0jaDLsA0R0LInAnNBgIL3cPD84 El+knG0f6M8vhdpm8Z01a/npZrZP04N2rErio7C1Hwfq0GcvCM+pqH5oHkx/sRS/toAaUP u466dZ5+nv3oKOD5apqdvFkzjwibXtaCsfmtHU1M2P/aC44BuAUqnehsIGG09+u0FNm7hp 73qct2E+CnZrgSMT6tS1tFjb4FyqNpOnnTBdsq+QDZwbmP5bRRhygCyki+vjYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764467156; a=rsa-sha256; cv=none; b=XNEggcJk3uG3PBi99v+iXXkQlpaJVw7gL32+OWa7iLg3pLRrXxPurbAO0iyKA/w8cB6Z18 hjfE0Zr3qTP1+rdLjgO/KuiKUfUsjPwNwCBC3sQnL/ZVskuh8OMxEqmmi78LnYuDW0n5y+ nv/Uv2TEbM1Jkz+MQ/hzEn3u56+kZKzj9hM3HbReCEzZD8gfMfhP6rYZCgqjbyq/W9a3Nh t8VtDMun4KTwBgMrnQFqSvBcWfBnw72cMi891te4A8GAIOgZcCzBo7EjIo1bbY+T5AJ8F/ Q6LNSBpbbHHA3uKLx41res7RmIjNW34ymVa+0k3O355XW0S725ZTn7Qd/R02sg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dJqcg6nXsz1CWK for ; Sun, 30 Nov 2025 01:45:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2a4b9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 30 Nov 2025 01:45:55 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Strahinja =?utf-8?Q?Stani=C5=A1?==?utf-8?Q?i=C4=87?= From: Robert Clausecker Subject: git: bb2cbe8c53f8 - stable/15 - simd.7: add scalar memcpy() for RISC-V to manpage List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: bb2cbe8c53f8cf8229823afca284c4c5ba853764 Auto-Submitted: auto-generated Date: Sun, 30 Nov 2025 01:45:55 +0000 Message-Id: <692ba1d3.2a4b9.596dbb73@gitrepo.freebsd.org> The branch stable/15 has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=bb2cbe8c53f8cf8229823afca284c4c5ba853764 commit bb2cbe8c53f8cf8229823afca284c4c5ba853764 Author: Strahinja Stanišić AuthorDate: 2024-07-24 23:36:09 +0000 Commit: Robert Clausecker CommitDate: 2025-11-30 00:43:06 +0000 simd.7: add scalar memcpy() for RISC-V to manpage MFC after: 1 month MFC to: stable/15 Approved by: mhorne, markj (mentor) Reviewed by: fuz Sponsored by: Google LLC (GSoC 2024) Differential Revision: https://reviews.freebsd.org/D46139 (cherry picked from commit c80dfcb37261e5e8575d41801e64a39b7db6f4f8) --- share/man/man7/simd.7 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man7/simd.7 b/share/man/man7/simd.7 index 5978d4b6655e..c09ed0edb960 100644 --- a/share/man/man7/simd.7 +++ b/share/man/man7/simd.7 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE . -.Dd October 8, 2025 +.Dd October 16, 2025 .Dt SIMD 7 .Os .Sh NAME @@ -61,7 +61,7 @@ Enhanced functions are present for the following architectures: .It memchr Ta A Ta Ta S1 Ta Ta Ta S .It memcmp Ta A Ta S Ta S1 Ta S .It memccpy Ta A Ta Ta S1 -.It memcpy Ta A Ta S Ta S Ta S Ta SV +.It memcpy Ta A Ta S Ta S Ta S Ta SV Ta S .It memmove Ta A Ta S Ta S Ta S Ta SV .It memrchr Ta A Ta Ta S1 .It memset Ta A Ta S Ta S Ta S Ta Ta S From nobody Sun Nov 30 01:45:57 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dJqcj53HYz6Jf3t for ; Sun, 30 Nov 2025 01:45: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dJqcj1RtTz3mgs for ; Sun, 30 Nov 2025 01:45:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=myjDDQrjoPDjCqW9makz+ShAJ6/2B9RwoOGvw8i6cK4=; b=YZI2Fxvuh9eJ35yjsjfkejBEYvMDXKZ39xmjT66kor1j9l+baq1tIitKyrm9SdilFNurhv qikXEO6fJAMF+n+J+Ih3bWpKk/BcI9hcJ3wNNUlA+48dEEa/u8Z1FUxrH2EhFOeuGGhdd9 IxkVeYWiBQOrmG3Oa4iTxkMQz987bdzKu2yAl6iJIo1i6V3kD2f/K8NLtoC9R/dqPeDElm kbVQlLU4x5RWpkFPc2w2KrwmIgomIlTpkRWoJHdqwn6AiQzdggUf4cSFKCkeEAZ9fvbw/V MVKd6kXicJvXd18cB0Artw+NUlfvO4WZpAO70wbOkVwfuCBIMUyfsjOrXFyQZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=myjDDQrjoPDjCqW9makz+ShAJ6/2B9RwoOGvw8i6cK4=; b=EWJblZrmhtFAX6IvIyKvPbwB2DMG1O0cYQtvPars0bKOHxIfcByi+Z/FwFcZm4np+/zvGW nlSwVHCiXjEXBB9qtpbVfuLwPqh7XUwchGEUszpxfR/33HU5dT0C3yRnicUzVgCxxc9An5 Zv4zJrkaMv+6xY4YhmGrNFDXjkyIWNfL+3GdYqsR2OPjF25CHuRCm64Y6hoLvis02N9ZVr ny9fQ8bRTxqoEgPzwLCbo43VgfeLjPP1JQPjRdylbM4pgJ7ZVa/tnYjX6zyrEB2SjmXqzT HiOVzIWRF6ztZ/pTx2QGYu70pnXxpKzx6yDQrA8Mmy23thkPuLL7j+oNJt6I4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764467157; a=rsa-sha256; cv=none; b=Dq9HbPe04R1BXhu7k11eIus/w9psp0xxn+pFfDeCiBT36gyiQ+UhkzWfQ2M5aGfMun3/hH YS5iNqEIjQK8YUn08+Ydt49+ds/fuaQCmWEU8MalRRjgp5NxGOj3Rso0j4vy6B0OKwJirE /27Gb2kT4Nd8wEEG98asZp2x04vxJDYgXFQdjsYDY9Lx8gcn7TU0oKsN/YTibvcFdOEJ/B KxRPJjNWTDw/05a6PRWMzua2dqlxjvkOiErGyyT/mfEnyBUmTEgbR4GcFuR5nylCrog2KY L+VxisxqZWEer2h0US2oHe/xRtqv0ZKJFSHKWuM29zESj9LX6T/ggwfVzdprSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dJqcj0XX3zR7 for ; Sun, 30 Nov 2025 01:45:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2975f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 30 Nov 2025 01:45:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Strahinja =?utf-8?Q?Stani=C5=A1?==?utf-8?Q?i=C4=87?= From: Robert Clausecker Subject: git: 3f0dda7c5928 - stable/15 - libc: scalar strnlen() in RISC-V assembly List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 3f0dda7c59280fe05b57fe695022053cd8b7d5f1 Auto-Submitted: auto-generated Date: Sun, 30 Nov 2025 01:45:57 +0000 Message-Id: <692ba1d5.2975f.6532a362@gitrepo.freebsd.org> The branch stable/15 has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=3f0dda7c59280fe05b57fe695022053cd8b7d5f1 commit 3f0dda7c59280fe05b57fe695022053cd8b7d5f1 Author: Strahinja Stanišić AuthorDate: 2024-08-04 15:12:00 +0000 Commit: Robert Clausecker CommitDate: 2025-11-30 00:43:06 +0000 libc: scalar strnlen() in RISC-V assembly Optimized implementation of strnlen() in RISC-V assembly Performance was measured using strperf on a HiFive Unmatched (SiFive HF105-001) board. os: FreeBSD arch: riscv │ strnlen_baseline │ strnlen_scalar │ │ sec/op │ sec/op vs base │ Short 787.0µ ± 0% 430.9µ ± 1% -45.24% (p=0.000 n=20) Mid 621.6µ ± 0% 195.1µ ± 1% -68.61% (p=0.000 n=20) Long 569.4µ ± 1% 100.6µ ± 0% -82.34% (p=0.000 n=20) geomean 653.1µ 203.7µ -68.81% │ strnlen_baseline │ strnlen_scalar │ │ MiB/s │ MiB/s vs base │ Short 158.8 ± 0% 290.1 ± 1% +82.62% (p=0.000 n=20) Mid 201.1 ± 0% 640.6 ± 1% +218.59% (p=0.000 n=20) Long 219.5 ± 1% 1242.9 ± 0% +466.19% (p=0.000 n=20) geomean 191.4 613.5 +220.57% MFC after: 1 month MFC to: stable/15 Approved by: mhorne, markj (mentor) Reviewed by: fuz, Jari Sihvola Sponsored by: Google LLC (GSoC 2024) Differential Revision: https://reviews.freebsd.org/D46230 (cherry picked from commit 5a52f0704435b089199201be0029e0d7c9ef2fce) --- lib/libc/riscv/string/Makefile.inc | 1 + lib/libc/riscv/string/strnlen.S | 143 +++++++++++++++++++++++++++++++++++++ 2 files changed, 144 insertions(+) diff --git a/lib/libc/riscv/string/Makefile.inc b/lib/libc/riscv/string/Makefile.inc index ebea8d1d3412..4b97490a5494 100644 --- a/lib/libc/riscv/string/Makefile.inc +++ b/lib/libc/riscv/string/Makefile.inc @@ -3,4 +3,5 @@ MDSRCS+= \ memcpy.S \ memset.S \ strlen.S \ + strnlen.S \ strrchr.S diff --git a/lib/libc/riscv/string/strnlen.S b/lib/libc/riscv/string/strnlen.S new file mode 100644 index 000000000000..c0fd959548ff --- /dev/null +++ b/lib/libc/riscv/string/strnlen.S @@ -0,0 +1,143 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Strahinja Stanisic + */ + +#include + +/* + * a0 - const char *s + * a1 - size_t maxlen; + */ +ENTRY(strnlen) + /* + * a0 - const char *s; + * a1 - size_t maxlen; + * a2 - uint64_t *ptr; + * a3 - char iter[8]; + * a4 - uint64_t *end_align; + * a5 - uint64_t *end_unroll; + */ + + beqz a1, .Lnot_found + + /* ptr = s & ~0b111 */ + /* t0 = 0x0101010101010101 */ + /* t1 = 0x8080808080808080 */ + /* end_align = (s + maxlen + 7) & ~0b111 */ + /* mask_start = t0 >> ((-s.value) << 3) */ + add a4, a0, a1 + li t0, 0x01010101 + addi a4, a4, 7 + slli t1, t0, 32 + neg t2, a0 + andi a4, a4, ~0b111 + or t0, t0, t1 + slli t2, t2, 3 + andi a2, a0, ~0b111 + slli t1, t0, 7 + srl t2, t0, t2 + + /* if pointer is aligned skip to loop */ + beq a0, a2, .Lskip_start + + /* iter = *ptr */ + ld a3, (a2) + + /* iter = iter | mask_start */ + or a3, a3, t2 + + /* has_zero */ + not t2, a3 + sub a3, a3, t0 + and t2, t2, t1 + and a3, a3, t2 + + addi a2, a2, 8 + bnez a3, .Lfind_zero + +.Lskip_start: + /* end_unroll */ + sub t2, a4, a2 + andi t2, t2, ~0b1111 + add a5, a2, t2 + + /* while (ptr != end_unroll) */ + beq a2, a5, .Lskip_loop +.Lloop: + ld a3, (a2) + ld a6, 8(a2) + + /* has_zero */ + not t2, a3 + not t3, a6 + sub a3, a3, t0 + sub a6, a6, t0 + and t2, t2, t1 + and t3, t3, t1 + and a3, a3, t2 + and a6, a6, t3 + + addi a2, a2, 8 + bnez a3, .Lfind_zero + + mv a3, a6 + + addi a2, a2, 8 + bnez a3, .Lfind_zero + + bne a2, a5, .Lloop + +.Lskip_loop: + + beq a2, a4, .Lnot_found + + ld a3, (a2) + + /* has_zero */ + not t2, a3 + sub a3, a3, t0 + and t2, t2, t1 + and a3, a3, t2 + + + addi a2, a2, 8 + beqz a3, .Lnot_found + +.Lfind_zero: + + /* move ptr back */ + addi a2, a2, -8 + + /* isolate lowest set bit */ + neg t0, a3 + and a3, a3, t0 + + li t0, 0x0001020304050607 + srli a3, a3, 7 + + /* lowest set bit is 2^(8*k) + * multiplying by it shifts the idx array in t0 by k bytes to the left */ + mul a3, a3, t0 + + /* highest byte contains idx of first zero */ + srli a3, a3, 56 + + /* zero_idx */ + sub a2, a2, a0 + add a2, a2, a3 + + /* min(zero_idx, maxlen) */ + sub a2, a2, a1 + srai t1, a2, 63 + and a2, a2, t1 + add a0, a1, a2 + + ret + +.Lnot_found: + mv a0, a1 + ret + +END(strnlen) From nobody Sun Nov 30 01:45:59 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dJqcl5sCJz6Jdgg for ; Sun, 30 Nov 2025 01:45: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dJqcl2hcBz3mWW for ; Sun, 30 Nov 2025 01:45:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6diB2hHvaOOPB2XdMHY2fvgdHJI0CpUp65t8XUPG97k=; b=etwQI1hYi3/87OExW4SUW3LjkqnPmsjk/kJ4VXyOaHhM3QdtcoYqamfwe3pT3uHDk3/RNu ij2F1MRSTrSZRAEWuOyOJZMFt1vHLaDPBmcclyDPItvLaDu705xu4Zw2TjhYe5wnVMEpux SH0UNyFX7N1RgV2y7/IIMmVd+BfRh1YEwCOnpuHci2hw6TEeXU4T0ZOgpGRzwrhWB7l7EL Rx0a0tk5mJKBA3jSb0dFUJOlsXKe0cJE/H7WFTH1KQDE+pvdkiKsx6kKJrds08bAafHSQn NmeheUu48TxZa9iAMy4jhwGMUKEMeZsbuneDXWr9s4eI44/gjGxZ5XqsukGGWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6diB2hHvaOOPB2XdMHY2fvgdHJI0CpUp65t8XUPG97k=; b=F6DcMFqfMP0Kwp+l6+EBDTXkM4lI9pbDNXq2sWdkOCEiVvBlWkI9CIw6fQEUhgoHtaN7jL eZQeXQPR5q/iDSIZ0o3co+KAh4AExNm0/xsJpqBN1+qjTAA0FZvHqm2qWMtuu9I2sF+JgU JecpWIda8efVWzXnweShRDmQrONMxPb9UfZ16NwwK9OhsMCwP044FHLtdZRT0qxfo8o/gS ATkaMln4tUEs2z2mkHtbMxXSAPJ2pKvjJy06BlkA++1xU6+4UOJcDMZ5yArvao70Jltnhp OizoLKzh7EkBNKUmXZRgnFtwmHPcC3/yeMXzRYsG2ckiD9DtC5EI1/qQjkiUDA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764467159; a=rsa-sha256; cv=none; b=HuOD237z6qj1L1Pm4a3zmfgkE9XrNUTulPNK5zSs5JmVbw63IUtYelIa5N+Ru78YXHE/6k 1LP9fC8l9Aqa9CwbJgD30ayVw3OSdchDjWZASoH/vARji+o+WbCQPs3zha0Q9EF/GKPvrw 8QdIKAYY8EHCWqfQNzmt/h72+MPZAckQSTgNNvvv1AEWOteHmlxo7QMs8xdFqAz/TeXlJa U8dHdfqqxsv1gbL2xvJshsjot5kndu1QFJ7Qg49tzd13Xd1haLzA/SDYrvugUgjjpOlRlc 7LxM0JOOGmn7JwGWdNssp9tudX5Xm2Aqa3DZkDORlDEzTLPJvHwBmxjP9kbSyA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dJqcl2HzNz9Q for ; Sun, 30 Nov 2025 01:45:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 28665 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 30 Nov 2025 01:45:59 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Strahinja =?utf-8?Q?Stani=C5=A1?==?utf-8?Q?i=C4=87?= From: Robert Clausecker Subject: git: f56c68448d42 - stable/15 - libc: scalar strchrnul() in RISC-V assembly List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: f56c68448d429687a81ce4d97b16e7b9d7c57808 Auto-Submitted: auto-generated Date: Sun, 30 Nov 2025 01:45:59 +0000 Message-Id: <692ba1d7.28665.9efa142@gitrepo.freebsd.org> The branch stable/15 has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=f56c68448d429687a81ce4d97b16e7b9d7c57808 commit f56c68448d429687a81ce4d97b16e7b9d7c57808 Author: Strahinja Stanišić AuthorDate: 2024-07-19 17:58:04 +0000 Commit: Robert Clausecker CommitDate: 2025-11-30 00:43:06 +0000 libc: scalar strchrnul() in RISC-V assembly Scalar implementation of strchrnul() in RISC-V assembly and changes to the corresponding manpage. Performance was benchmarked on a HiFive Unmatched (SiFive HF105-001) board using: https://github.com/clausecker/strperf os: FreeBSD arch: riscv │ strchrnul_baseline │ strchrnul_scalar │ │ sec/op │ sec/op vs base │ Short 680.2µ ± 5% 435.3µ ± 0% -36.01% (p=0.000 n=20) Mid 314.7µ ± 3% 221.4µ ± 0% -29.63% (p=0.000 n=20) Long 152.3µ ± 0% 138.5µ ± 0% -9.08% (p=0.000 n=20) geomean 319.5µ 237.2µ -25.75% │ strchrnul_baseline │ strchrnul_scalar │ │ MiB/s │ MiB/s vs base │ Short 183.8 ± 5% 287.2 ± 0% +56.27% (p=0.000 n=20) Mid 397.3 ± 3% 564.6 ± 0% +42.12% (p=0.000 n=20) Long 820.5 ± 0% 902.5 ± 0% +9.99% (p=0.000 n=20) geomean 391.3 527.0 +34.68% MFC after: 1 month MFC to: stable/15 Approved by: markj (mentor) Reviewed by: fuz Sponsored by: Google LLC (GSoC 2024) Differential Revision: https://reviews.freebsd.org/D46047 (cherry picked from commit 08af0bbc9c7d71bbaadb31ad31f8492f40537c5c) --- lib/libc/riscv/string/Makefile.inc | 1 + lib/libc/riscv/string/strchrnul.S | 116 +++++++++++++++++++++++++++++++++++++ 2 files changed, 117 insertions(+) diff --git a/lib/libc/riscv/string/Makefile.inc b/lib/libc/riscv/string/Makefile.inc index 4b97490a5494..719f22f6077f 100644 --- a/lib/libc/riscv/string/Makefile.inc +++ b/lib/libc/riscv/string/Makefile.inc @@ -4,4 +4,5 @@ MDSRCS+= \ memset.S \ strlen.S \ strnlen.S \ + strchrnul.S \ strrchr.S diff --git a/lib/libc/riscv/string/strchrnul.S b/lib/libc/riscv/string/strchrnul.S new file mode 100644 index 000000000000..8abba71c4199 --- /dev/null +++ b/lib/libc/riscv/string/strchrnul.S @@ -0,0 +1,116 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Strahinja Stanisic + */ + +#include + + .weak strchrnul + .set strchrnul, __strchrnul + +/* + * a0 - const char *str + * a1 - int c; + */ +ENTRY(__strchrnul) + /* + * a0 - const char *ptr; + * a1 - char cccccccc[8]; + * a2 - char iter[8]; + * a3 - char mask_end + */ + + /* int to char */ + andi a1, a1, 0xFF + + /* t0 = 0x0101010101010101 */ + li t0, 0x01010101 + slli t1, t0, 32 + or t0, t0, t1 + + /* t1 = 0x8080808080808080 */ + slli t1, t0, 7 + + /* spread char across bytes */ + mul a1, a1, t0 + + /* align_offset */ + andi t2, a0, 0b111 + + /* align pointer */ + andi a0, a0, ~0b111 + + /* if pointer is aligned skip to loop */ + beqz t2, .Lloop + + ld a2, (a0) + + /* mask_start calculation */ + slli t2, t2, 3 + neg t2, t2 + srl t2, t0, t2 + + /* fill bytes before start with non-zero */ + or a3, a2, t2 + + xor a2, a2, a1 + or a2, a2, t2 + + /* has_zero for \0 */ + not t3, a3 + not t2, a2 + sub a3, a3, t0 + sub a2, a2, t0 + and a3, a3, t3 + and a2, a2, t2 + and a3, a3, t1 + and a2, a2, t1 + + + /* if \0 or c was found, exit */ + or a2, a2, a3 + addi a0, a0, 8 + bnez a2, .Lfind_char + + +.Lloop: + ld a2, (a0) + + /* has_zero for both \0 or c */ + xor a3, a2, a1 + + not t2, a2 + not t3, a3 + sub a2, a2, t0 + sub a3, a3, t0 + and a2, a2, t2 + and a3, a3, t3 + and a2, a2, t1 + and a3, a3, t1 + + /* if \0 or c was found, exit */ + or a2, a2, a3 + addi a0, a0, 8 + beqz a2, .Lloop + +.Lfind_char: + addi a0, a0, -8 + + /* isolate lowest set bit */ + neg t0, a2 + and a2, a2, t0 + + li t0, 0x0001020304050607 + srli a2, a2, 7 + + /* lowest set bit is 2^(8*k) + * multiplying by it shifts the idx array in t0 by k bytes to the left */ + mul a2, a2, t0 + + /* highest byte contains idx of first zero */ + srli a2, a2, 56 + + add a0, a0, a2 + ret +END(__strchrnul) From nobody Sun Nov 30 01:45:58 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dJqck572gz6JfBS for ; Sun, 30 Nov 2025 01:45: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dJqck1wqwz3mbp for ; Sun, 30 Nov 2025 01:45:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467158; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WVFFuec1dYkOq/CRQLpq2ddcvhGyDo3wEn6nsBJ+zTw=; b=dB8mvSMrt/H9/e8bHPFEZMNz4vP/BrKxYtSV6H9UjV+M+Lh/jg2xo6pVywH6rT+gOwh/dF DlxfjzpOXEyCos9hQE7sNz6BD4f3I5lG1nafcCN3LjQ8dkQcaKsvwzJAlL/WaL4op8rgd/ XSfVK6Of0yGIuc/fF3udFV+nxAjAunr3dro7+JgPqgJGaeaCG5PQHi/fLrgLj5SXhdT48V LXrxhQ8wSCl23dn5PcUz/XwCJADOQXmn+vShD/y2zGQq8M+as2umIR7vrrqfGo9IUp/bkK YmW7fSwms2mLS3823lwSipycy1RtbVjnnK8COBda7ad+/lT/jinqxLHAuivftw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467158; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WVFFuec1dYkOq/CRQLpq2ddcvhGyDo3wEn6nsBJ+zTw=; b=Cbmp074JdunuDkmzXnnZGaa9a8hKcaB9KKsr3oV0aDf1dninaMhqfTb0he+V+a8dUOaVr9 Qiisl3SUojQq37+EglqGEvE/33gK8mo8JltMTRd3POsTsjB82nNBvXEPNEU5TnnOYFcxM6 VzEvmHOIs44/fLBrN1c6hPawc1kZ2Z5YEud/MS0vCIWH1W54wmI81cvncKhTDZ0AHC1Nv3 EE02SkfF3c+IQ9Sq72z7h452lqjvUTTOh1FWWyQqGBiOAcFGlTbyVVfb5mDSqD+/RgETDG su5+EbIKbrIM/uZfarYmodpg2ljwKxU7MY7u8wAS6vXH43/8jammQybs9/0ymA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764467158; a=rsa-sha256; cv=none; b=nVXIO+8kQ78WFSxCm/en4KNwtMHnimOiJWK2ZjOhkvOkgcPAJdokWzKd0inFMCMHRtqntu UUtgxySJtgbTfWT/hZpFW7nJWNGijOs09fv2LBgwJ+FR1I29XnfYArlObpvbtXMy03wmV0 a//IhM6pJAd1h7J9CtCxXCSZaBqpIKiqU4HaKgPj0UkjULQbxaxIJGNkcoOKMz3+dUeaQT opAEQFQ8xUDIpIEhZ0FOsQncLdcbqa73bthNCBYf8ALDLtiAHxRPIsoyhzztRyu14M80Oh 7taDwGzwiWjzO1ejvP3FaA7j75/elpryyvPxYBoRjQeUHEW6FYM4+4MDtFWlRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dJqck1QDqzQ1 for ; Sun, 30 Nov 2025 01:45:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2a976 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 30 Nov 2025 01:45:58 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Strahinja =?utf-8?Q?Stani=C5=A1?==?utf-8?Q?i=C4=87?= From: Robert Clausecker Subject: git: b06836f6231c - stable/15 - simd.7: add scalar strnlen() for RISC-V to manpage List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: b06836f6231cf6f3c09fa0b7940ea27f5b645166 Auto-Submitted: auto-generated Date: Sun, 30 Nov 2025 01:45:58 +0000 Message-Id: <692ba1d6.2a976.7efdfb97@gitrepo.freebsd.org> The branch stable/15 has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=b06836f6231cf6f3c09fa0b7940ea27f5b645166 commit b06836f6231cf6f3c09fa0b7940ea27f5b645166 Author: Strahinja Stanišić AuthorDate: 2024-08-05 13:51:09 +0000 Commit: Robert Clausecker CommitDate: 2025-11-30 00:43:06 +0000 simd.7: add scalar strnlen() for RISC-V to manpage MFC after: 1 month MFC to: stable/15 Approved by: mhorne, markj (mentor) Reviewed by: fuz, Jari Sihvola Sponsored by: Google LLC (GSoC 2024) Differential Revision: https://reviews.freebsd.org/D46230 (cherry picked from commit 474a80d3ff8516df5c379fa7f8e563cecb032060) --- share/man/man7/simd.7 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man7/simd.7 b/share/man/man7/simd.7 index c09ed0edb960..6695a137da77 100644 --- a/share/man/man7/simd.7 +++ b/share/man/man7/simd.7 @@ -80,7 +80,7 @@ Enhanced functions are present for the following architectures: .It strncat Ta A Ta Ta S1 .It strncmp Ta A Ta S Ta S1 Ta S .It strncpy Ta Ta Ta S1 Ta Ta S2 -.It strnlen Ta A Ta Ta S1 +.It strnlen Ta A Ta Ta S1 Ta Ta Ta S .It strrchr Ta A Ta Ta S1 Ta S Ta Ta S .It strpbrk Ta S Ta Ta S2 .It strsep Ta S Ta Ta S2 From nobody Sun Nov 30 01:46:00 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dJqcm6J5fz6Jf1v for ; Sun, 30 Nov 2025 01:46: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dJqcm3rfWz3mkH for ; Sun, 30 Nov 2025 01:46:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZClRHxKs7ulnk6rPqEqNvkqdq7Ue5eN4WFYiAUOGUyQ=; b=cwNBx/3C69EH1Ei02wWIv+ii1r9XNUTu5wpaxZWsQcgeXQUUnB9sS6rkzLXLPs4SvMJNP3 j/3itsonFPR4u39GEdpFffubXt74jW5w2+pzsMAPbYQ+WorMA5DtABl3/8Ou/Nph2hJczD QZ3q1sZs3hxlvw2q2u87SPVKflSqToSbgj+NXlvbiCOo4GMiLpYN1l0We1fKo4umrMSFQJ FW2fixPyAnDNmwp1CRVMTgpsL4mFvLqW7I86gLXSuU+yV/xe8uguM+PdXaQePkWQ7+YHnb fO5X5G+kCMIbYuW6KQ6eLJqUQJbWQ9oa6hmKyGFjJF+r0aaXH0ahDusDqSyXBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZClRHxKs7ulnk6rPqEqNvkqdq7Ue5eN4WFYiAUOGUyQ=; b=W/FxCvaPAd8Gv0x9Mpc+ZgYndWyfv6SQoebMq7XpPEpSzUMiDz8xnXf1brzHuBjGZI+s7r mzK+QqdaF9B18dptCSYSIKQaSVJ+des5zr5i1pzrqwGLVAZ0hX6UrEBPxGW7n18EFMIwZD BWBGq9VfNkaUvUYVHOvgj+JlFZS/gswJbwpp4+EMcLkE5bAO4ont9DUfi9ckyuX8NZbPNY CjsmaPrr9ZKQxiXYS9F4lueftnp9FiaYjtIY/ig0O9G6zI2GAHrnI/U1CLHJi41EVnNatl Zrm4qGGUKzXUsJXirU5WE/xU57R1Y72YwOqKtnvNSl/Gvuzoeq7myvArehtJ1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764467160; a=rsa-sha256; cv=none; b=bAnbzI4ZXs0QafJjxtyqi8KeT/+TVIJQIRKYcS2kUF/H4F8XcXVu6geeK9pbRkGj4ZF6E8 GDNavJva/i94Td35HFXsfBj3n7BqrTx08gze9jPtpSPrO/Dhgfrdq0rtP/X4heNCOPVAZx GbhAEpdzqcLpY6m9zPOHMXB3iXh9qVh8jk+SB5ehGYtzVxB6UzsKN7njMZOBDf43Qdn18A 0lt5cD/+XwJoViku3LnzXnEUDC8oGoV3V00B8zrU/Kq/hBNPVdhqVKfSi94B/kFfB6238W w96w4Tkv3voe71dMakJerQe2xA2sZlfG1vKkZOYGZay2ni9HXMdHxobjyCb/PQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dJqcm39L1z1CpY for ; Sun, 30 Nov 2025 01:46:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 29e85 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 30 Nov 2025 01:46:00 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Strahinja =?utf-8?Q?Stani=C5=A1?==?utf-8?Q?i=C4=87?= From: Robert Clausecker Subject: git: 4e63278f7b7f - stable/15 - simd.7: add scalar strchrnul() for RISC-V to manpage List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 4e63278f7b7f5b5cd326cf53c34fdee3abed1021 Auto-Submitted: auto-generated Date: Sun, 30 Nov 2025 01:46:00 +0000 Message-Id: <692ba1d8.29e85.67a278ae@gitrepo.freebsd.org> The branch stable/15 has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=4e63278f7b7f5b5cd326cf53c34fdee3abed1021 commit 4e63278f7b7f5b5cd326cf53c34fdee3abed1021 Author: Strahinja Stanišić AuthorDate: 2024-07-19 18:01:51 +0000 Commit: Robert Clausecker CommitDate: 2025-11-30 00:43:06 +0000 simd.7: add scalar strchrnul() for RISC-V to manpage index() and strchr() are implemented by calling strchrnul(), so they also get to be marked as platform-specific. MFC after: 1 month MFC to: stable/15 Approved by: markj (mentor) Reviewed by: fuz Sponsored by: Google LLC (GSoC 2024) Differential Revision: https://reviews.freebsd.org/D46047 (cherry picked from commit 39fef5b9fa943f301776e0b0bf406cedd7c29af2) --- share/man/man7/simd.7 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/share/man/man7/simd.7 b/share/man/man7/simd.7 index 6695a137da77..449ca4274287 100644 --- a/share/man/man7/simd.7 +++ b/share/man/man7/simd.7 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE . -.Dd October 16, 2025 +.Dd October 21, 2025 .Dt SIMD 7 .Os .Sh NAME @@ -55,7 +55,7 @@ Enhanced functions are present for the following architectures: .It bcopy Ta A Ta S Ta S Ta S Ta SV .It bzero Ta A Ta S Ta S Ta S .It div Ta Ta Ta S Ta S -.It index Ta A Ta Ta S1 +.It index Ta A Ta Ta S1 Ta Ta S .It ldiv Ta Ta Ta S Ta S .It lldiv Ta Ta Ta S .It memchr Ta A Ta Ta S1 Ta Ta Ta S @@ -69,8 +69,8 @@ Enhanced functions are present for the following architectures: .It stpcpy Ta A Ta Ta S1 .It stpncpy Ta Ta Ta S1 .It strcat Ta A Ta Ta S1 Ta S -.It strchr Ta A Ta Ta S1 Ta S -.It strchrnul Ta A Ta Ta S1 +.It strchr Ta A Ta Ta S1 Ta S Ta Ta S +.It strchrnul Ta A Ta Ta S1 Ta Ta Ta S .It strcmp Ta A Ta S Ta S1 Ta S .It strcpy Ta A Ta Ta S1 Ta S Ta S2 .It strcspn Ta S Ta Ta S2 From nobody Sun Nov 30 01:46:02 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dJqcq0snHz6JfDm for ; Sun, 30 Nov 2025 01:46:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dJqcp5l7Nz3mcp for ; Sun, 30 Nov 2025 01:46:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467162; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gTmIi53JpZBRlIWIVZbxYCxzf/HKG8xw+qnELkFOkgE=; b=Xw675SQAGFofJNVSBvQe43rluNda0yUx2zBrSUnkYP0FOC1HSfNnM8YNDifPHR2bFxmF7P YiTqp+IUiLDvqxL0YGKG4rPh4Zt5ftJRbb16HIbyQQGB6bDBn89TFnPr/1V0baGi7nEOyT WN2INRwWoIlo9rNUJuLNmAp07alJPloxdL50EHCJviUq3k7lmZtKhNuL/4s1tdr5WQGoVJ HVGIeKQrDIqhclDM49tizl4jMS1hi4WKsUxJAn1Oo7GyhZYj47MNLOzBc/Ndq1vNbU4O6a IngLPYcQUAeDjIpTCpAN9KgKa/u7zFIsrjRoUH11fT7Or/N9XcFpjvxkSyQf8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467162; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gTmIi53JpZBRlIWIVZbxYCxzf/HKG8xw+qnELkFOkgE=; b=rb7m29Ldjwk0ccly1920wUhOa+11mE4Jc+SE659/1hgGhWNj17Klxoab3spBfrZyZcHUiC BOhrG7n25/KhBYU/4nE7irTgJokD3EIEjPy5/mebFgeGVXTF5XyN6f1VWe+Z8bZYSNmGbH tukQdL+S4owQK3wlrZrQHSQyJh3osacTCADOtLWCd8azidrLUS/IcKFnawEnQzu3RhyOBR T5ro5IrVHFIJ75Yn8vmAGkh2gI8t+kUw/K80mrnyeV5N18UWqthG5lZlcUp50bBIk4eRGw Yg5bRQwUbtXo9y2dz1v3nAhS4Y9UnDmx7eKmGC6rTapaDfuYhwZdglSBSyOBpw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764467162; a=rsa-sha256; cv=none; b=ePxF5yHs6nhC1bSh1yXtFehDmhfcuTsQusSM+0QakHztn1EfrR5W1wv8udw06+3urt+pZg S4J8Yqk9Uvr7VkiKH78U2LPR31MzrkN2yBDWOYtPbi9LXRexE6s4RH+HDmpSnxm+ezrnjZ 07FXR/gzt6mzxieBlNmGC+nSgaw+DQCkD0v1s5JGr2b1cqPuMxViT42IcQiP8b/uDPMKDE C4w/a0D6EKWytFVJpJEfh/lWtfcFs3NC0riLcywwjX9JoLVZamhjyZoRdcUR8M2Hex+d+5 HNjwSW16HjbOxc2dYS7/SPiJZfCOzLRmfacf9zeTK5s/q0ekhwzk2JTsIgcfLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dJqcp5864z1CWP for ; Sun, 30 Nov 2025 01:46:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2866a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 30 Nov 2025 01:46:02 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Robert Clausecker Subject: git: 65f6088d1775 - stable/15 - simd.7: document bcopy() and bzero() as accelerated on riscv64 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 65f6088d177525306751e3e03f9089aef0d82d6a Auto-Submitted: auto-generated Date: Sun, 30 Nov 2025 01:46:02 +0000 Message-Id: <692ba1da.2866a.1b820bb0@gitrepo.freebsd.org> The branch stable/15 has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=65f6088d177525306751e3e03f9089aef0d82d6a commit 65f6088d177525306751e3e03f9089aef0d82d6a Author: Robert Clausecker AuthorDate: 2025-10-21 18:58:16 +0000 Commit: Robert Clausecker CommitDate: 2025-11-30 00:43:06 +0000 simd.7: document bcopy() and bzero() as accelerated on riscv64 Event: Google Summer of Code 2024 MFC after: 1 month MFC to: stable/15 Approved by: markj (mentor) Differential Revision: https://reviews.freebsd.org/D53248 (cherry picked from commit d6870bb941fe235e0031f8bfb53fbd120ff859f9) --- share/man/man7/simd.7 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man7/simd.7 b/share/man/man7/simd.7 index 449ca4274287..3343508df504 100644 --- a/share/man/man7/simd.7 +++ b/share/man/man7/simd.7 @@ -52,8 +52,8 @@ Enhanced functions are present for the following architectures: .Bl -column FUNCTION_________ aarch64_ arm_ amd64_ i386_ ppc64_ -offset indent .It Em FUNCTION Ta Em AARCH64 Ta Em ARM Ta Em AMD64 Ta Em I386 Ta Em PPC64 Ta Em RISC-V .It bcmp Ta A Ta Ta S1 Ta S -.It bcopy Ta A Ta S Ta S Ta S Ta SV -.It bzero Ta A Ta S Ta S Ta S +.It bcopy Ta A Ta S Ta S Ta S Ta SV Ta S +.It bzero Ta A Ta S Ta S Ta S Ta Ta S .It div Ta Ta Ta S Ta S .It index Ta A Ta Ta S1 Ta Ta S .It ldiv Ta Ta Ta S Ta S From nobody Sun Nov 30 01:46:01 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dJqcp2ng2z6JfDh for ; Sun, 30 Nov 2025 01:46: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dJqcn4VXxz3mcl for ; Sun, 30 Nov 2025 01:46:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467161; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KwrzZZlEb8CdRz8ycd07o9QNMvpA0CukNdCIXt3+8Co=; b=s1bzPZs2FML8RpAUPyn5l0u1JgQrQnU0YGm6V7r2YJ/uxRThuMyW8jEmrzeNIrIzIK4/3n j3QksHSRnvuEkzKQ2rJy5TyTHRqOJEbIP846JjZMX3GO7MDGDz/mnCqZmKOpC0qBuJIAKU yGbbR/SQPf8h61iMA7PCRTMlOtlyPk2q1APcc6kZ1UteDg0fnoN2P2MeJuago9ncSPRaW7 peWU4+iRa9xc497+2Nindmgf1TayID0mN+dPvjqIw8/Ux0x5SG0KNPlGnmjLDJ2yvranQi FfxuGfctpJqbMzJzlSzFocuiYVnLy58tWmQKkwxMgKu6HL1GtkNCgXFTiuHLyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467161; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KwrzZZlEb8CdRz8ycd07o9QNMvpA0CukNdCIXt3+8Co=; b=cA5FvLBhoPpovBljuT+bZTsDOSbKd6tJiAEIjsaHpUBcutHClmPOjHpRiFPs2jQ54qoJLy 3066zA02pQSRmXoucJ+r7ITSZu+Rct9qu0ElHOaMYWSwuWCy2XhUm98QDOgXfXtGqaqsIT FTpyOMq0pachWYQH0t/BzGj3LaVA0fDPpZwu82sr1PVlCgDxscs26AW43AcWXqh1HCdbX7 n3bQe73jC0IzuMqxIo91R67j+XNM/GeCKpg8HxhCJ+3/vhxWlnygil5HVWvMbQrg0fJNjF xhhMKi+Fpml0KNkR/GOftno/BSGWnZS97cBYSx4zBjxQNlCCUfqA4vLvC4A7+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764467161; a=rsa-sha256; cv=none; b=onyN/QsG8lrCFjJn14Tvo2fHZMXYuzmgqOku1HZ+14x72hYFq1SE55v5vnxLsmoPM1fg/V aEcWCxjw3qd+oZJL+iA5fsTDq0tVeiyXkU3tygPqaHXgnNlPzvJMpJEss1MjYGGdnlzhO3 dFL6VAfdgHj5UKxGXI9F4JGs1+pD40noJNXp0vl3EEvKOTqq0pr+h97+qaFyJFXRSkPzAR KeIAv2esWF7DaqyW3C4nw0SHWnsoV30+htzFMk+kpANVppjPPi5gAVaY3AiNcWG0Pnciw2 FNBKQvl0ReJpqe0OVauXexV+3PJHhPR4gc/H6A1aY253ujlEx0LbUSjVxBEfYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dJqcn40hPz9R for ; Sun, 30 Nov 2025 01:46:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 29572 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 30 Nov 2025 01:46:01 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Robert Clausecker Subject: git: be97631f198f - stable/15 - libc/riscv64: implement bcopy() and bzero() through memcpy() and memset() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: be97631f198fd2fb94f6ab10c144f0292bc731bc Auto-Submitted: auto-generated Date: Sun, 30 Nov 2025 01:46:01 +0000 Message-Id: <692ba1d9.29572.13c9d595@gitrepo.freebsd.org> The branch stable/15 has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=be97631f198fd2fb94f6ab10c144f0292bc731bc commit be97631f198fd2fb94f6ab10c144f0292bc731bc Author: Robert Clausecker AuthorDate: 2025-10-21 18:55:41 +0000 Commit: Robert Clausecker CommitDate: 2025-11-30 00:43:06 +0000 libc/riscv64: implement bcopy() and bzero() through memcpy() and memset() This picks up the accelerated string functions written by strajabot@. Event: Google Summer of Code 2024 MFC after: 1 month MFC to: stable/15 See also: 79e01e7e643c9337d8d6046b6db7df674475a099 Approved by: markj (mentor) Differential Revision: https://reviews.freebsd.org/D53248 (cherry picked from commit b5dbf3de561189140c73f915bd50c28ea69a1e19) --- lib/libc/riscv/string/Makefile.inc | 2 ++ lib/libc/riscv/string/bcopy.c | 14 ++++++++++++++ lib/libc/riscv/string/bzero.c | 14 ++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/lib/libc/riscv/string/Makefile.inc b/lib/libc/riscv/string/Makefile.inc index 719f22f6077f..6dae6b2cb62d 100644 --- a/lib/libc/riscv/string/Makefile.inc +++ b/lib/libc/riscv/string/Makefile.inc @@ -1,4 +1,6 @@ MDSRCS+= \ + bcopy.c \ + bzero.c \ memchr.S \ memcpy.S \ memset.S \ diff --git a/lib/libc/riscv/string/bcopy.c b/lib/libc/riscv/string/bcopy.c new file mode 100644 index 000000000000..0dee529fb9df --- /dev/null +++ b/lib/libc/riscv/string/bcopy.c @@ -0,0 +1,14 @@ +/*- + * Public domain. + */ + +#include + +#undef bcopy /* _FORTIFY_SOURCE */ + +void +bcopy(const void *src, void *dst, size_t len) +{ + + memmove(dst, src, len); +} diff --git a/lib/libc/riscv/string/bzero.c b/lib/libc/riscv/string/bzero.c new file mode 100644 index 000000000000..d82f3061865b --- /dev/null +++ b/lib/libc/riscv/string/bzero.c @@ -0,0 +1,14 @@ +/*- + * Public domain. + */ + +#include + +#undef bzero /* _FORTIFY_SOURCE */ + +void +bzero(void *b, size_t len) +{ + + memset(b, 0, len); +} From nobody Sun Nov 30 01:46:03 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dJqcr2tq4z6Jf4M for ; Sun, 30 Nov 2025 01:46:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dJqcr08R2z3mhx for ; Sun, 30 Nov 2025 01:46:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MmoH+Yt72ixVezcuOvCEnIKGDLJ/om1hCSogaI2cJYk=; b=lbpSMJiLVeFBko3q0IY/psHCb6tuFRGtN9XYVIe4EqjAlBMrQbuk0B2Frwm98Eqnu1MlEX YPkWcugW//4oXmmg1EC47zCOWCI1eFXLLi2ZEbyR97mZ8WK2nxp4oa/r3pDcrXWWyvFpkK xsvFbFjm9OdP+RnaxK3jgoau5h2XzzBs7rj8QB6IS4hLC3MQ7MXPvFrFj/DGTXzTrbIodd 6n/bWLowVfwfQzBP5gl9dHneAvqKQWJFgqJeU8TeJe9Qw7/6pWWm6DdL/iqfNQjcHQcovV NiQ6ffcvw3DsGCeAg6w7Jb9DKxKkbQIGIibPISQYZJG010doZ31cvAW4xxUVbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764467164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MmoH+Yt72ixVezcuOvCEnIKGDLJ/om1hCSogaI2cJYk=; b=mjaiCGqcDj7Tu+CiHxDiIFmZyAo7p5sujHoHrBzXHc5KGL8G0GLibkyQhsN2sIM7bpo+bn n9swFfvvr2syKkpdXDlqqIyj0AsY89TZFTQYj7W2L654tTfHpsfe3K+ImICHtb4y62S4mJ B8trA71Vl2yD3g+FkiMxLzbvmRTdvZcz3HsM2AZNVN2d1vyoZJ9+P+RjeLv3wK+8DogA6+ 2D0YZ12DMmuKkMVT5j2u+jfW+65uyrQTKDvquTDTa6lxtApRG0UfckPM/j75BQnRuimjBj tBAVFN8waL0dtS5z9kJG4ke+7A+fPYrw7Dw1cTLGiN095slGfHY6hlGYIGui8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764467164; a=rsa-sha256; cv=none; b=TP0z+U9ZNuKbd1uF97iXJqz65/ufGGPnI1Rp9Ts4OqLX1zsBjJ3hee3oRq13n3u2gdeIPI +pqilWiDVk+5BRBJNdLO1kM700O67EI/zpSg8tTgCzxnvzSZn76eXz3DzJtN2MLlRcPjLx HS41jGaXdz+9EV0vq8csDQ9iddWbtfTEHju3mHrQDOlm6PmE8P0pKAkM7tnuIt5qRz7wvm YLRoQKN6ufCrIHNbZyPJo++2sjLTz3zXzLB8zekv7cx+EqjF9AOm/w4AV2TbM1lDfihejj QpvPpKGjThpWDYpKeBGq9VpNf/wIIEifNLCam92Ox6Z4vbWHLOQ37ayQHisXkA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dJqcq5rd3zQ4 for ; Sun, 30 Nov 2025 01:46:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 29032 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 30 Nov 2025 01:46:03 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Robert Clausecker Subject: git: 136905676ef1 - stable/15 - depend-cleanup.sh: clean up after riscv64 enhanced string function patch set List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 136905676ef116d161ae3955ad378f2ae090519f Auto-Submitted: auto-generated Date: Sun, 30 Nov 2025 01:46:03 +0000 Message-Id: <692ba1db.29032.d34af5a@gitrepo.freebsd.org> The branch stable/15 has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=136905676ef116d161ae3955ad378f2ae090519f commit 136905676ef116d161ae3955ad378f2ae090519f Author: Robert Clausecker AuthorDate: 2025-10-30 18:57:23 +0000 Commit: Robert Clausecker CommitDate: 2025-11-30 00:43:06 +0000 depend-cleanup.sh: clean up after riscv64 enhanced string function patch set This ensures an incremental build succeeds after import of D47275, D46023, D45730, D45693, D46139, D46230, D46047, and D53248. Approved by: markj (mentor) MFC after: 1 month MFC to: stable/15 Differential Revision: https://reviews.freebsd.org/D53485 (cherry picked from commit d59e924d2969ce2c8bec0fc4500989865fbece75) --- tools/build/depend-cleanup.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tools/build/depend-cleanup.sh b/tools/build/depend-cleanup.sh index aa01db6ccc37..d751118a79a2 100755 --- a/tools/build/depend-cleanup.sh +++ b/tools/build/depend-cleanup.sh @@ -476,3 +476,30 @@ if [ -f "$OBJTOP"/usr.sbin/moused/moused ]; then echo "Removing old moused binary" run rm -fv "$OBJTOP"/usr.sbin/moused/moused fi + +if [ ${MACHINE} = riscv ]; then + # 20251031 df21a004be23 libc: scalar strrchr() in RISC-V assembly + clean_dep lib/libc strrchr c + + # 20251031 563efdd3bd5d libc: scalar memchr() in RISC-V assembly + clean_dep lib/libc memchr c + + # 20251031 40a958d5850d libc: scalar memset() in RISC-V assembly + clean_dep lib/libc memset c + + # 20251031 e09c1583eddd libc: scalar strlen() in RISC-V assembly + clean_dep lib/libc strlen c + + # 20251031 25fdd86a4c92 libc: scalar memcpy() in RISC-V assembly + clean_dep lib/libc memcpy c + + # 20251031 5a52f0704435 libc: scalar strnlen() in RISC-V assembly + clean_dep lib/libc strnlen c + + # 20251031 08af0bbc9c7d libc: scalar strchrnul() in RISC-V assembly + clean_dep lib/libc strchrnul c + + # 20251031 b5dbf3de5611 libc/riscv64: implement bcopy() and bzero() through memcpy() and memset() + clean_dep lib/libc bcopy c "libc.string.bcopy.c" + clean_dep lib/libc bzero c "libc.string.bzero.c" +fi From nobody Sun Nov 30 10:30:49 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dK3GK5Xx4z6J7ck for ; Sun, 30 Nov 2025 10:30:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dK3GK2c2zz3fPb for ; Sun, 30 Nov 2025 10:30:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764498649; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wj9J7HoU7463q9XkfhzSHvLgaAxjA3mkOerTthM2NXo=; b=cS1DPO0AjgZ0qcm/srIQls6AaS3wnbY3pzwx118GrjdwnYxJVLLvYzEahN0PhLhMF1y5wL IeE4BOcBSKKKFdwTARlWWqkln8wUdEy6KcGyr+5jtQI+RuUICZZ87EpEa3ekQJbCuGyNfs knrCbuGYP5dxkzYysCCVTzAkP2NeCFaYUZmhEsDP1bBl2Ffis8EUW8YFOka4qKkVJ5kQQa XSMY5K1kOOfPXhMSIso6FU/RhG6LG/tW6q7UvO/w6FK4loI7IiZI51wkh/9Eu9zB5/Y28n IwQtWb6lL9uZIegvXgMyxNHkt4yGwQa4IDqkUGR1qVB/vW6pt+al6uvrmob2yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764498649; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wj9J7HoU7463q9XkfhzSHvLgaAxjA3mkOerTthM2NXo=; b=IF6q4Sma/9UmhXpB0uewzdAnOTYpHbD4oviUJc2V1fhlpOeS4qbFSg3wG6QbOHlsiEuzzQ WZv/YGwRLG3qNWkMySmJPGcQJvzDRKUygnnkn7Q7iIq4tN34+uxuJxQCzHqVOWUtLshoyZ wD2e9GlMwOIPSAMI+avWKIX8OM89bfldc52+KFhmVEJPg0mhbML5LJml80mmJRKZXIq1Cq KQrZ7rTWepUkE9shsuznNXXN3bsiTc32QG+rkTMVjPGizyApSnKzJ+q2T00XWFt5kaO89T /m+tOswf4jAn0OnRogQq+N+8P+KwoG2ojLUlrQobjIUZK9191iQqO3CEEaZXHg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764498649; a=rsa-sha256; cv=none; b=koyWGL9fGuR7QjmJDOdEhOWSbvS1cLkOVo81bRnnH218icpe7pkpZnrqX/gJeTuT5PIFhF KDxHwDZQu+ji3SJxU2rqT17eCGnqmqil6Sj9VR/zw1/DspYU6DDWGcBNKg6pGUwlo4zNAG zdF8LIV915CnMdCVLh33O6nahX34Lkogms5BAED+CtBwgFfbLK/AAUIUuZXYVfcnIvw1zi KoHsQ7TsGu1AgTgWyQnS53DU7x4KgcpYEArYJvpDhMFt2ED45AEg0EZAVqtVi1C4ifK4L9 uZI4RVw68prVJG2ugv86QuHJa+meXHLX8P4J6dDYpFEZKHGVQWBsfEwVvt7b7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dK3GK25zzzX17 for ; Sun, 30 Nov 2025 10:30:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 8482 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 30 Nov 2025 10:30:49 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 7d8effcf65fe - stable/15 - pf: handle divert packets List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 7d8effcf65fe598417924e0b314570b893b626c0 Auto-Submitted: auto-generated Date: Sun, 30 Nov 2025 10:30:49 +0000 Message-Id: <692c1cd9.8482.3e4056af@gitrepo.freebsd.org> The branch stable/15 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7d8effcf65fe598417924e0b314570b893b626c0 commit 7d8effcf65fe598417924e0b314570b893b626c0 Author: Kristof Provost AuthorDate: 2025-11-15 13:44:54 +0000 Commit: Kristof Provost CommitDate: 2025-11-30 10:27:27 +0000 pf: handle divert packets In a divert setup pf_test_state() may return PF_PASS, but not set the state pointer. We didn't handle that, and as a result crashed immediately afterwards trying to dereference that NULL state pointer. Add a test case to provoke the problem. PR: 260867 MFC after: 2 weeks Submitted by: Phil Budne Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 66f2f1c83247f05a3a599d7e88c7e7efbedd16b5) --- sys/netpfil/pf/pf.c | 20 ++++++++++-------- tests/sys/netpfil/pf/divert-to.sh | 43 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 8 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index af0629397ea0..fa6dd41cecee 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -11020,10 +11020,12 @@ pf_test(sa_family_t af, int dir, int pflags, struct ifnet *ifp, struct mbuf **m0 break; action = pf_test_state(&s, &pd, &reason); if (action == PF_PASS || action == PF_AFRT) { - if (V_pfsync_update_state_ptr != NULL) - V_pfsync_update_state_ptr(s); - r = s->rule; - a = s->anchor; + if (s != NULL) { + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); + r = s->rule; + a = s->anchor; + } } else if (s == NULL) { /* Validate remote SYN|ACK, re-create original SYN if * valid. */ @@ -11072,10 +11074,12 @@ pf_test(sa_family_t af, int dir, int pflags, struct ifnet *ifp, struct mbuf **m0 default: action = pf_test_state(&s, &pd, &reason); if (action == PF_PASS || action == PF_AFRT) { - if (V_pfsync_update_state_ptr != NULL) - V_pfsync_update_state_ptr(s); - r = s->rule; - a = s->anchor; + if (s != NULL) { + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); + r = s->rule; + a = s->anchor; + } } else if (s == NULL) { action = pf_test_rule(&r, &s, &pd, &a, &ruleset, &reason, inp, &match_rules); diff --git a/tests/sys/netpfil/pf/divert-to.sh b/tests/sys/netpfil/pf/divert-to.sh index ae44cd5d51af..153136199311 100644 --- a/tests/sys/netpfil/pf/divert-to.sh +++ b/tests/sys/netpfil/pf/divert-to.sh @@ -372,6 +372,47 @@ in_dn_in_div_in_out_div_out_dn_out_cleanup() pft_cleanup } +atf_test_case "pr260867" "cleanup" +pr260867_head() +{ + atf_set descr 'Test for the loop reported in PR260867' + atf_set require.user root +} + +pr260867_body() +{ + pft_init + divert_init + + epair=$(vnet_mkepair) + + ifconfig ${epair}a 192.0.2.1/24 up + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b 192.0.2.2/24 up + + # Sanity check + atf_check -s exit:0 -o ignore ping -c3 192.0.2.2 + + jexec alcatraz /usr/sbin/inetd -p ${PWD}/inetd-echo.pid $(atf_get_srcdir)/echo_inetd.conf + jexec alcatraz $(atf_get_srcdir)/../common/divapp 1001 divert-back & + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "pass in on ${epair}b proto tcp from any to port 7 divert-to 0.0.0.0 port 1001" + + reply=$(echo "foo" | nc -N 192.0.2.2 7) + if ["${reply}" != "foo" ]; + then + atf_fail "Did not receive echo reply" + fi +} + +pr260867_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "in_div" @@ -383,4 +424,6 @@ atf_init_test_cases() atf_add_test_case "in_div_in_fwd_out_div_out" atf_add_test_case "in_dn_in_div_in_out_div_out_dn_out" + + atf_add_test_case "pr260867" } From nobody Sun Nov 30 10:30:53 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dK3GP4klMz6J7RY for ; Sun, 30 Nov 2025 10:30: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dK3GP30cYz3fXH for ; Sun, 30 Nov 2025 10:30:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764498653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9D4COp3mrSjPT8fsKno0oQa/kc92C0Y0K/qdr57WzUw=; b=Ml+0lur2yJWfe1BFm1HkpelLEYsCw/Ay9+dP4M9Gekdhv7US48dU4UJLcqWK2lv8fzg1DG 9+6u6m69CLhKFAyusjUXmG+aE7Ye2FcQyzGKGEMZhH+86lGU7o6LCNY0WOWaUuRiphsv6+ PUt7ytcUurumzhhj58Mi179PKmG9YJVncAYwUSBgQZlKPjplfsw3lGEdUNpxXt86WrAJQq sODeifBd9lctPMEOtoQSrnC3UeHROAsntFBjB6GKi7JJMVV2O/T8hrTr9iVIJbZqaBb++H 4n9uZewmJbSz+hqY2sOAYKzFEw61hVdxWrgJF9DO40qDjSQ/6FKMZ6unRWhpqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764498653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9D4COp3mrSjPT8fsKno0oQa/kc92C0Y0K/qdr57WzUw=; b=P1hbcnIKZ1mqF07JRHExDnXcDGgVtLmwBZyl92Ey/skFJZL3HeUCRUAbu5pc33i4Sljb63 t6r33yh41BqjD6JUKK3LnXahK28a5WG1mEqX+hUATFRfYMm/dJgwcCPVp6y2YTRqiWX/0k JfJrMxhBS3Ll28Awz6ha2YJiVxrUtgFAfUA6h3PRLLrInWqbG2abFvoh5+cRIRCuwSJmng 2iuw5QOl9o4MX+iZ6ccz46mG+VftHNB8jn4UWpVmsOJOKDiwGVrzKw8smAMjmJrdQ+/huE zP76/8N6l6pSXhY5Z1KDL5zqQeI5jWR/fQgkHFdSwqAk85m57YXl8f19tj1/XQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764498653; a=rsa-sha256; cv=none; b=GYq6e1lHBjUmhyk6gQQ7FspNT6JIxYYyIMqCvn0hm548l3cy/kp6LzY01ge8Fqq1Dm9T+X esyHsWEXKsYAIG6vzTbLWbMb4EMGY+ZRTl3RUXLJ0P5T9JIsvwuyRGGGpnsvtVjjCGfEMw HFRy+L3Hjti2cnK9WICkByoGRu0ajnZM5uF6TT/0nXpJk7LgMBjIrhAmL3soG+1wUZ/dw8 wPyQ7f2da5Nl0P99dTCdx9KoKp7ogvdlCrOadN4UK3qLtfytbPmHwrUCyLDbA7H8mfNjUf rOYXwsN9I2K5doCJ+4jYGYerPvpy0Gr7V+giV3LHhcOcI4BUOl4b7pgmZ1ubmA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dK3GP2WBpzXPK for ; Sun, 30 Nov 2025 10:30:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 36c69 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 30 Nov 2025 10:30:53 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: a009793a5e5f - stable/14 - pf: handle divert packets List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a009793a5e5fad0b42cb0a158dcbccd5eff40d9f Auto-Submitted: auto-generated Date: Sun, 30 Nov 2025 10:30:53 +0000 Message-Id: <692c1cdd.36c69.3cf5cd41@gitrepo.freebsd.org> The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a009793a5e5fad0b42cb0a158dcbccd5eff40d9f commit a009793a5e5fad0b42cb0a158dcbccd5eff40d9f Author: Kristof Provost AuthorDate: 2025-11-15 13:44:54 +0000 Commit: Kristof Provost CommitDate: 2025-11-30 10:26:28 +0000 pf: handle divert packets In a divert setup pf_test_state() may return PF_PASS, but not set the state pointer. We didn't handle that, and as a result crashed immediately afterwards trying to dereference that NULL state pointer. Add a test case to provoke the problem. PR: 260867 MFC after: 2 weeks Submitted by: Phil Budne Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 66f2f1c83247f05a3a599d7e88c7e7efbedd16b5) --- sys/netpfil/pf/pf.c | 20 +++++++++++------- tests/sys/netpfil/pf/divert-to.sh | 44 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 54 insertions(+), 10 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index f067c2b6bdf4..44d72d228104 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -8558,10 +8558,12 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, goto done; action = pf_test_state_tcp(&s, kif, m, off, h, &pd, &reason); if (action == PF_PASS) { - if (V_pfsync_update_state_ptr != NULL) - V_pfsync_update_state_ptr(s); - r = s->rule.ptr; - a = s->anchor.ptr; + if (s != NULL) { + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); + r = s->rule.ptr; + a = s->anchor.ptr; + } } else if (s == NULL) { /* Validate remote SYN|ACK, re-create original SYN if * valid. */ @@ -8621,10 +8623,12 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, } action = pf_test_state_udp(&s, kif, m, off, h, &pd); if (action == PF_PASS) { - if (V_pfsync_update_state_ptr != NULL) - V_pfsync_update_state_ptr(s); - r = s->rule.ptr; - a = s->anchor.ptr; + if (s != NULL) { + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); + r = s->rule.ptr; + a = s->anchor.ptr; + } } else if (s == NULL) action = pf_test_rule(&r, &s, kif, m, off, &pd, &a, &ruleset, inp); diff --git a/tests/sys/netpfil/pf/divert-to.sh b/tests/sys/netpfil/pf/divert-to.sh index 965464b35810..8c76ffd35bfe 100644 --- a/tests/sys/netpfil/pf/divert-to.sh +++ b/tests/sys/netpfil/pf/divert-to.sh @@ -509,6 +509,47 @@ ipfwon_in_dn_in_div_in_out_dn_out_div_out_cleanup() pft_cleanup } +atf_test_case "pr260867" "cleanup" +pr260867_head() +{ + atf_set descr 'Test for the loop reported in PR260867' + atf_set require.user root +} + +pr260867_body() +{ + pft_init + divert_init + + epair=$(vnet_mkepair) + + ifconfig ${epair}a 192.0.2.1/24 up + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b 192.0.2.2/24 up + + # Sanity check + atf_check -s exit:0 -o ignore ping -c3 192.0.2.2 + + jexec alcatraz /usr/sbin/inetd -p ${PWD}/inetd-echo.pid $(atf_get_srcdir)/echo_inetd.conf + jexec alcatraz $(atf_get_srcdir)/../common/divapp 1001 divert-back & + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "pass in on ${epair}b proto tcp from any to port 7 divert-to 0.0.0.0 port 1001" + + reply=$(echo "foo" | nc -N 192.0.2.2 7) + if ["${reply}" != "foo" ]; + then + atf_fail "Did not receive echo reply" + fi +} + +pr260867_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "ipfwoff_in_div" @@ -524,6 +565,5 @@ atf_init_test_cases() atf_add_test_case "ipfwoff_in_div_in_fwd_out_div_out" atf_add_test_case "ipfwon_in_div_in_fwd_out_div_out" - atf_add_test_case "ipfwoff_in_dn_in_div_in_out_dn_out_div_out" - atf_add_test_case "ipfwon_in_dn_in_div_in_out_dn_out_div_out" + atf_add_test_case "pr260867" } From nobody Sun Nov 30 10:30:58 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dK3GW6RC1z6J7lM for ; Sun, 30 Nov 2025 10:30:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dK3GV6DJNz3fbb for ; Sun, 30 Nov 2025 10:30:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764498658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oNLo3FATt3yJQRUMVHjPIdRZ2UnvFEErTPJCGi7Fd3g=; b=ngfCFqQrCY9VFtBoR7RctgrMDQUe4FXlCYHbokYnarAwcyrjAzfGDq92SiGCpCDcfxV/ZY UlwFXJYmpd2PvYsyp4rayo8kT6JvRLrEpPR/tNfcLc5NipngSUKTioAti/1zjSXSIBRRYn DovD0+6EXQY/BodHXq2a1iv2/N53samgPZGJDTEkfylaFX/G82WFw561H7VLlgnL8RdsnU F7HERgceqrHi/6GIodJIKqPHOVeFzyKva1f7bHNwjae0Ebm4NRYgxgD7XuMGE0Zz6GnEu9 vXgZEOVTaWTpFBB/jXkWG8fozMJdlXc13BLSv3n74TKNTC5lHfoRHvYDUIDVWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764498658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oNLo3FATt3yJQRUMVHjPIdRZ2UnvFEErTPJCGi7Fd3g=; b=HokooNXcQuUTWp9Z8O4eI3QFEomQy0Yk9tbiopMDuYiE+0ZAXXiCW6J9Fgdr00WF45YVQB 7sdPkbKSzDPyj221DAtxd5K+5ivDSNJjUxsK2CTbCnzwI+0eSPiWyjg7IQ4/ex84H3XyzC e4I4UJeSVKTxNLuR0Nqc/URsFZheNGyGGma12vM5IQnf6vAoxc94X+0lA0akrh5dEtl2qU Gj1L/6Syp0K3GHilSANcr1BytAgtZ3b8O1PB0BQLADI03cBWWwELoQV5DyAVUp5SsEm+bi qffeecB7IA+ZZQDo+fOrXozYf1ycTVD2IsEUclG/KYhFod1b9h34PgH+BtSiLA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764498658; a=rsa-sha256; cv=none; b=MGxeI0C8kGoUVxXCVPcQs7Sqvpor3taV4nDrERhHgHTjDapS2qcRUbEs3YNRequRlBSnZX 7nQ9N7mVDZGozlJppkJpt73SR0UwEVPe/2gnV7NaZHM/IArfP470w/y3pCXOyra4vNCHTN th5rQ/uz/5Ntdcq3oEwnAKL87tVBfQGjy20vGHdZBrP4gZ01xoZmmXsmYDlA2l+MUuzuUF j1nqs26uyPbuCzNCEiUGUE7dTtxgQ4bFus38hhygbxWb6FLYZqHKWm65dZMV9XYZ1gxeYc 71HhqSa9DyvJFciO4Rc2JCUuqqqLkZsxl0Vv/OniDSF+P1btsi7WEgrebPEuDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dK3GV3vDzzXPY for ; Sun, 30 Nov 2025 10:30:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 356fc by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 30 Nov 2025 10:30:58 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 81385f622037 - stable/13 - pf: handle divert packets List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 81385f622037a5b78fd4f8046163367fa607d37a Auto-Submitted: auto-generated Date: Sun, 30 Nov 2025 10:30:58 +0000 Message-Id: <692c1ce2.356fc.63801cce@gitrepo.freebsd.org> The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=81385f622037a5b78fd4f8046163367fa607d37a commit 81385f622037a5b78fd4f8046163367fa607d37a Author: Kristof Provost AuthorDate: 2025-11-15 13:44:54 +0000 Commit: Kristof Provost CommitDate: 2025-11-29 20:02:00 +0000 pf: handle divert packets In a divert setup pf_test_state() may return PF_PASS, but not set the state pointer. We didn't handle that, and as a result crashed immediately afterwards trying to dereference that NULL state pointer. Add a test case to provoke the problem. PR: 260867 MFC after: 2 weeks Submitted by: Phil Budne Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 66f2f1c83247f05a3a599d7e88c7e7efbedd16b5) --- sys/netpfil/pf/pf.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 298793e6228e..16ce78560e2d 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -7552,11 +7552,13 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb * action = pf_test_state_tcp(&s, dir, kif, m, off, h, &pd, &reason); if (action == PF_PASS) { - if (V_pfsync_update_state_ptr != NULL) - V_pfsync_update_state_ptr(s); - r = s->rule.ptr; - a = s->anchor.ptr; - log = s->log; + if (s != NULL) { + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); + r = s->rule.ptr; + a = s->anchor.ptr; + log = s->log; + } } else if (s == NULL) { /* Validate remote SYN|ACK, re-create original SYN if * valid. */ @@ -7612,11 +7614,13 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb * } action = pf_test_state_udp(&s, dir, kif, m, off, h, &pd); if (action == PF_PASS) { - if (V_pfsync_update_state_ptr != NULL) - V_pfsync_update_state_ptr(s); - r = s->rule.ptr; - a = s->anchor.ptr; - log = s->log; + if (s != NULL) { + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); + r = s->rule.ptr; + a = s->anchor.ptr; + log = s->log; + } } else if (s == NULL) action = pf_test_rule(&r, &s, dir, kif, m, off, &pd, &a, &ruleset, inp);