Heimdal was finally replaced with MIT Kerberos [1], but the release notes do not mention that the symbol tables in the shared objects do not match to MIT Kerberos from ports. There have been now two PRs (linked). The release notes or some other document (errata notes?) should describe that it does not make 1:1 to MIT Kerberos from ports and whether the Heimdal symbols version will disappear in 16 and base will be identically logically to ports. This has been somewhat noted https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291565#c2, but the source is not publically availale and totally opaque to users, for ports committers like me as well. This needs to be addressed in a user-friendly fashion. [1] https://www.freebsd.org/releases/15.0R/relnotes/
A simple script to dump symbols without address offsets: #!/bin/sh # Dump dynamic symbol names only for .so symlinks from the krb5 package listing BASE="/usr/local" # change to /usr on FreeBSD base system OUTDIR="./krb5-symbols" mkdir -p "$OUTDIR" # Only the .so symlinks from the krb5 package manifest SO_LINKS=" lib/libcom_err.so lib/libgssapi_krb5.so lib/libgssrpc.so lib/libk5crypto.so lib/libkadm5clnt.so lib/libkadm5clnt_mit.so lib/libkadm5srv.so lib/libkadm5srv_mit.so lib/libkdb5.so lib/libkrad.so lib/libkrb5.so lib/libkrb5support.so lib/libverto.so lib/krb5/plugins/kdb/db2.so lib/krb5/plugins/preauth/otp.so lib/krb5/plugins/preauth/pkinit.so lib/krb5/plugins/preauth/spake.so lib/krb5/plugins/preauth/test.so lib/krb5/plugins/tls/k5tls.so " for relpath in $SO_LINKS; do link="$BASE/$relpath" if [ -L "$link" ]; then target=$(readlink -f "$link") fname=$(basename "$link") outfile="$OUTDIR/${fname}.symbols.txt" echo "Listing symbols for $link -> $target" if command -v nm >/dev/null 2>&1; then # nm: print only symbol names (-D for dynamic, --format=posix for easy parsing) nm -D --format=posix "$target" | awk '{print $1}' | sort -u > "$outfile" else # objdump: print only symbol names (field 7 usually holds the name) objdump -T "$target" | awk '{print $7}' | grep -v '^$' | sort -u > "$outfile" fi fi done echo "Done. Symbol name listings in $OUTDIR"
The commit that changed the symbol DSO names are 4680e7fcc70a998765bb9ce602b080d8efb114bc and 5f8493bbf479922ee027e2ee7dc733f29f66dd6d. The changes were requested by kib@ and jhb@. I understand this issue and I also understand why they requested I change the symbol DSO names. But we cannot do both. If you want to change them back, please submit a review with jhb and kib as reviewers. Add me as a subscriber.
(In reply to Cy Schubert from comment #2) I think this first needs some documentation in the release notes. Second, we at least for CURRENT have the original upstream symbol tables and mark this as transitional. The change can be announced and justified. The commit should at least document where it libc API is broken. This is a third-party product.
Eh, this has nothing to do with those commits, both of which were ultimately reverted. Reading the other report, it is not a case of symbols having different versions, but of symbols just not existing at all (e.g. krb5_xfree). Michael, it would be helpful if you could just add an attachment with the list of missing symbols.
(In reply to John Baldwin from comment #4) I will do. What I cannot tell is wether the different symbol versions make a difference from a client perspective by not corresponding to the original ones in MIT Kerberos.
Created attachment 266298 [details] Symbol differences without DSO versioning Attached is a list of symbols that should be added. Symbol versioning has been stripped from the list.
I haven't finished comparing version.maps with lib*.exports but so far this is the only difference. My method used: In src/crypto/krb5/src/lib/kdb, sort libkdb5.exports > /tmp/b in src/krb5/lib/kdb, awk '$0 ~ /^ / {print $1}' version.map | sed 's/;//' | sort > a mv /tmp/b . slippy$ diff a b 1d0 < global: 29a29 > krb5_db_load_module slippy$ This is the only difference so far. I will report other differences when all are completed.
libkrb5 is missing these symbols. diff a b 111,112c111 < global: < global: --- > et_prof_error_table 118a118 > initialize_prof_error_table 632a633,660 > profile_abandon > profile_add_relation > profile_clear_relation > profile_flush > profile_flush_to_buffer > profile_flush_to_file > profile_free_buffer > profile_free_list > profile_get_boolean > profile_get_integer > profile_get_relation_names > profile_get_string > profile_get_subsection_names > profile_get_values > profile_init > profile_init_flags > profile_init_path > profile_init_vtable > profile_iterator > profile_iterator_create > profile_iterator_free > profile_release > profile_release_string > profile_rename_section > profile_ser_externalize > profile_ser_internalize > profile_ser_size > profile_update_relation
And there are no other differences.
Created attachment 266300 [details] Symbols to add to base krb5. Can you try this patch, please? It adds one symbol to libkdb, one et symbol and a bunch of profile symbols to libkrb5.
(In reply to Cy Schubert from comment #7) You should use the data from the built lib to get the list of the exported/versioned symbols. Version file is not reliable, there are other ways to export. Something like the following is a way to get the list of versioned symbols: readelf --dyn-syms <libname> | sed 1,3d | awk '$7 != "UND" {print $8}' | sed 's/@@/@/'
(In reply to Konstantin Belousov from comment #11) Yeah. This will have to be an evening job, not off the side of my desk during the daytime.
The reason for the difference between the port and base is quite significant. The port does not use OpenSSL for its crypto: src/include/autoconf.h 25:/* #undef CRYPTO_OPENSSL */ Whereas base does: /usr/src/krb5/include/autoconf.h 25:#define CRYPTO_OPENSSL 1 The reason for this was that OpenSSH is linked to OpenSSL (libcrypto.so.35). When MIT uses its own crypt functions apps like ssh and sshd will fail to link because of conflicting symbols in OpenSSL and MIT (when using its internal crypto). I have an update to the port (the 122 version for now, locally) to optionally link against OpenSSL. This will address part of the problem. I will look at the other aspect to this problem tomorrow.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=1ba82bcd4c306a061092ee86a7a1cebb6fc77555 commit 1ba82bcd4c306a061092ee86a7a1cebb6fc77555 Author: Cy Schubert <cy@FreeBSD.org> AuthorDate: 2025-12-18 15:44:13 +0000 Commit: Cy Schubert <cy@FreeBSD.org> CommitDate: 2025-12-19 00:18:16 +0000 security/krb5*: Add CRYPTO radio button Base MIT KRB5 is linked against OpenSSL to supply its crypto. This was done to avoid symbol conflicts within ssh (i.e. a buildworld failure). This now causes the port and base inconsistencies. Add a crypto option to allow the user to select either builtin or openssl crypto. PR: 291695 security/krb5-121/Makefile | 9 +++++++-- security/krb5-122/Makefile | 9 +++++++-- security/krb5-devel/Makefile | 9 +++++++-- 3 files changed, 21 insertions(+), 6 deletions(-)
After building the port against openssl and comparing the symbols, I find no different symbols. As outlined before, base MIT KRB5 is built using OpenSSL so that ssh/sshd will build (without symbols in KRB5 that conflict with symbols in OpenSSL). I just committed a patch to three of the four MIT KRB5 ports (the oldest port expires at the end of the year) that adds an OPENSSL option. It's not default at the moment but I think it should become default.
(In reply to Cy Schubert from comment #15) Looking at your list again, many of those symbols are not crypto symbols. I will try a different approach.
Created attachment 266384 [details] libkrb5profile must be an INTERNALLIB to fix this bug. Please see https://reviews.freebsd.org/D54323 for the patch fixing this bug. First, we must compare base with the port linked against openssl and without ldap. Base currently has libkrb5profile in a shared library. The patch moves those functions to the various "consumer" libraries as the port does.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=1876de606eb876b7a97beccfe6fcc89e60a72a25 commit 1876de606eb876b7a97beccfe6fcc89e60a72a25 Author: Cy Schubert <cy@FreeBSD.org> AuthorDate: 2025-12-18 00:50:44 +0000 Commit: Cy Schubert <cy@FreeBSD.org> CommitDate: 2026-01-20 13:41:02 +0000 krb5: Expose missing symbols Add symbols found in the port but not in base. This requires replacing a shared libkrb5profile.so with libkrb5profile.a (with -fPIC so it can be used by shared libraries). We do this by making libkrb5profile INTERNALLIB. Base currently has libkrb5profile in a shared library. The patch moves those functions to the various "consumer" libraries as the port does. Symbols that should be in the other libraries are in libkrb5profile.so. This is causing some ports issues. PR: 291695 Reported by: michaelo, markj, Chris Inacio <inacio@andrew.cmu.edu> Tested by: michaelo Fixes: ae07a5805b19 Reviewed by: michaelo (previous version) MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D54323 ObsoleteFiles.inc | 4 + krb5/lib/apputils/Makefile | 1 + krb5/lib/crypto/Makefile | 3 +- krb5/lib/crypto/version.map | 59 ++ krb5/lib/gssapi/Makefile | 3 +- krb5/lib/gssapi/version.map | 308 ++++++++ krb5/lib/kadm5clnt/Makefile | 3 +- krb5/lib/kadm5clnt/version.map | 36 + krb5/lib/kadm5srv/Makefile | 3 +- krb5/lib/kadm5srv/version.map | 29 + krb5/lib/kadmin_common/Makefile | 1 + krb5/lib/kdb/Makefile | 3 +- krb5/lib/kdb/version.map | 27 + krb5/lib/kprop_util/Makefile | 1 + krb5/lib/krad/Makefile | 1 + krb5/lib/krad/version.map | 11 + krb5/lib/krb5/Makefile | 5 +- krb5/lib/krb5/version.map | 1196 ++++++++++++++++++++++++++++++ krb5/lib/rpc/Makefile | 1 + krb5/lib/rpc/version.map | 28 + krb5/libexec/kadmind/Makefile | 3 +- krb5/libexec/kdc/Makefile | 1 + krb5/libexec/kprop/Makefile | 3 +- krb5/libexec/kpropd/Makefile | 3 +- krb5/libexec/kproplog/Makefile | 3 +- krb5/plugins/audit/Makefile | 1 + krb5/plugins/k5tls/Makefile | 3 +- krb5/plugins/kdb/db2/Makefile | 3 +- krb5/plugins/kdb/db2/version.map | 148 ++++ krb5/plugins/preauth/otp/Makefile | 3 +- krb5/plugins/preauth/otp/version.map | 3 + krb5/plugins/preauth/pkinit/Makefile | 3 +- krb5/plugins/preauth/pkinit/version.map | 128 ++++ krb5/plugins/preauth/spake/Makefile | 3 +- krb5/plugins/preauth/spake/version.map | 22 + krb5/plugins/preauth/test/Makefile | 3 +- krb5/plugins/preauth/test/version.map | 2 + krb5/usr.bin/gss-client/Makefile | 3 +- krb5/usr.bin/kadmin/Makefile | 3 +- krb5/usr.bin/kdestroy/Makefile | 3 +- krb5/usr.bin/kinit/Makefile | 3 +- krb5/usr.bin/klist/Makefile | 3 +- krb5/usr.bin/kpasswd/Makefile | 3 +- krb5/usr.bin/ksu/Makefile | 1 + krb5/usr.bin/kswitch/Makefile | 3 +- krb5/usr.bin/ktutil/Makefile | 3 +- krb5/usr.bin/kvno/Makefile | 3 +- krb5/usr.bin/sclient/Makefile | 3 +- krb5/usr.bin/sim_client/Makefile | 3 +- krb5/usr.sbin/gss-server/Makefile | 3 +- krb5/usr.sbin/kadmin.local/Makefile | 3 +- krb5/usr.sbin/kdb5_util/Makefile | 3 +- krb5/usr.sbin/sim_server/Makefile | 3 +- krb5/usr.sbin/sserver/Makefile | 3 +- krb5/util/et/version.map | 2 + krb5/util/profile/Makefile | 4 +- krb5/util/profile/version.map (gone) | 74 -- krb5/util/support/version.map | 5 + krb5/util/verto/version.map | 7 + lib/libpam/modules/pam_krb5/Makefile | 1 + lib/libpam/modules/pam_ksu/Makefile | 1 + share/mk/src.libnames.mk | 2 +- tools/build/depend-cleanup.sh | 9 + tools/build/mk/OptionalObsoleteFiles.inc | 2 - 64 files changed, 2103 insertions(+), 111 deletions(-)
Cy, can you cherry-pick and close this issue?
(In reply to Michael Osipov from comment #19) Feb 9 is MFC day.
(In reply to Cy Schubert from comment #20) What did I miss: CommitDate: 2026-01-20? Two weeks have happed..
(In reply to Michael Osipov from comment #21) I prefer not to split them up.
A commit in branch stable/15 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=25a9a3987fa22b3935ce011ca4c891bf197db12d commit 25a9a3987fa22b3935ce011ca4c891bf197db12d Author: Cy Schubert <cy@FreeBSD.org> AuthorDate: 2025-12-18 00:50:44 +0000 Commit: Cy Schubert <cy@FreeBSD.org> CommitDate: 2026-02-09 13:41:56 +0000 krb5: Expose missing symbols Add symbols found in the port but not in base. This requires replacing a shared libkrb5profile.so with libkrb5profile.a (with -fPIC so it can be used by shared libraries). We do this by making libkrb5profile INTERNALLIB. Base currently has libkrb5profile in a shared library. The patch moves those functions to the various "consumer" libraries as the port does. Symbols that should be in the other libraries are in libkrb5profile.so. This is causing some ports issues. PR: 291695 Reported by: michaelo, markj, Chris Inacio <inacio@andrew.cmu.edu> Tested by: michaelo Fixes: ae07a5805b19 Reviewed by: michaelo (previous version) Differential revision: https://reviews.freebsd.org/D54323 (cherry picked from commit 1876de606eb876b7a97beccfe6fcc89e60a72a25) ObsoleteFiles.inc | 4 + krb5/lib/apputils/Makefile | 1 + krb5/lib/crypto/Makefile | 3 +- krb5/lib/crypto/version.map | 59 ++ krb5/lib/gssapi/Makefile | 3 +- krb5/lib/gssapi/version.map | 308 ++++++++ krb5/lib/kadm5clnt/Makefile | 3 +- krb5/lib/kadm5clnt/version.map | 36 + krb5/lib/kadm5srv/Makefile | 3 +- krb5/lib/kadm5srv/version.map | 29 + krb5/lib/kadmin_common/Makefile | 1 + krb5/lib/kdb/Makefile | 3 +- krb5/lib/kdb/version.map | 27 + krb5/lib/kprop_util/Makefile | 1 + krb5/lib/krad/Makefile | 1 + krb5/lib/krad/version.map | 11 + krb5/lib/krb5/Makefile | 5 +- krb5/lib/krb5/version.map | 1196 ++++++++++++++++++++++++++++++ krb5/lib/rpc/Makefile | 1 + krb5/lib/rpc/version.map | 28 + krb5/libexec/kadmind/Makefile | 3 +- krb5/libexec/kdc/Makefile | 1 + krb5/libexec/kprop/Makefile | 3 +- krb5/libexec/kpropd/Makefile | 3 +- krb5/libexec/kproplog/Makefile | 3 +- krb5/plugins/audit/Makefile | 1 + krb5/plugins/k5tls/Makefile | 3 +- krb5/plugins/kdb/db2/Makefile | 3 +- krb5/plugins/kdb/db2/version.map | 148 ++++ krb5/plugins/preauth/otp/Makefile | 3 +- krb5/plugins/preauth/otp/version.map | 3 + krb5/plugins/preauth/pkinit/Makefile | 3 +- krb5/plugins/preauth/pkinit/version.map | 128 ++++ krb5/plugins/preauth/spake/Makefile | 3 +- krb5/plugins/preauth/spake/version.map | 22 + krb5/plugins/preauth/test/Makefile | 3 +- krb5/plugins/preauth/test/version.map | 2 + krb5/usr.bin/gss-client/Makefile | 3 +- krb5/usr.bin/kadmin/Makefile | 3 +- krb5/usr.bin/kdestroy/Makefile | 3 +- krb5/usr.bin/kinit/Makefile | 3 +- krb5/usr.bin/klist/Makefile | 3 +- krb5/usr.bin/kpasswd/Makefile | 3 +- krb5/usr.bin/ksu/Makefile | 1 + krb5/usr.bin/kswitch/Makefile | 3 +- krb5/usr.bin/ktutil/Makefile | 3 +- krb5/usr.bin/kvno/Makefile | 3 +- krb5/usr.bin/sclient/Makefile | 3 +- krb5/usr.bin/sim_client/Makefile | 3 +- krb5/usr.sbin/gss-server/Makefile | 3 +- krb5/usr.sbin/kadmin.local/Makefile | 3 +- krb5/usr.sbin/kdb5_util/Makefile | 3 +- krb5/usr.sbin/sim_server/Makefile | 3 +- krb5/usr.sbin/sserver/Makefile | 3 +- krb5/util/et/version.map | 2 + krb5/util/profile/Makefile | 4 +- krb5/util/profile/version.map (gone) | 74 -- krb5/util/support/version.map | 5 + krb5/util/verto/version.map | 7 + lib/libpam/modules/pam_krb5/Makefile | 1 + lib/libpam/modules/pam_ksu/Makefile | 1 + share/mk/src.libnames.mk | 2 +- tools/build/depend-cleanup.sh | 9 + tools/build/mk/OptionalObsoleteFiles.inc | 2 - 64 files changed, 2103 insertions(+), 111 deletions(-)
(In reply to commit-hook from comment #23) When does this become available for those on 15.0-RELEASE?
(In reply to Dan Langille from comment #24) Please request this from re@ or so@.
MFCed.
(In reply to Cy Schubert from comment #25) Fine point. Thank you. We'll test it locally on -STABLE before submitting that request.