Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Dec 2023 16:23:59 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 275915] kadmin(d): adding principal crashes in ARCFOUR_string_to_key
Message-ID:  <bug-275915-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D275915

            Bug ID: 275915
           Summary: kadmin(d): adding principal crashes in
                    ARCFOUR_string_to_key
           Product: Base System
           Version: 14.0-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: lexi.freebsd@le-fay.org

FreeBSD hemlock.eden.le-fay.org 14.0-RELEASE-p3 FreeBSD 14.0-RELEASE-p3 #5
releng/14.0-n265398-20fae1e16990: Fri Dec 15 22:12:51 GMT 2023=20=20=20=20
root@hemlock.eden.le-fay.org:/data/src/obj/data/src/releng/14.0/amd64.amd64=
/sys/HEMLOCK
amd64

kadmin -l crashes in addprinc --random-key:

# gdb /usr/bin/kadmin
GNU gdb (GDB) 13.2 [GDB v13.2 for FreeBSD]
[...]
(gdb) run -l
Starting program: /usr/bin/kadmin -l
kadmin> add --random-key host/thyme.eden.le-fay.org
Max ticket life [1 day]:unlimited
Max renewable life [1 week]:unlimited
Principal expiration time [never]:
Password expiration time [never]:
Attributes []:

Program received signal SIGSEGV, Segmentation fault.
Address not mapped to object.
0x0000000000000000 in ?? ()
(gdb) where
#0  0x0000000000000000 in ?? ()
#1  0x0000000801126e68 in ARCFOUR_string_to_key (context=3D0x80201a000,
enctype=3DKRB5_ENCTYPE_ARCFOUR_HMAC_MD5, password=3D..., salt=3D..., opaque=
=3D...,
key=3D0x802134958)
    at /data/src/releng/14.0/crypto/heimdal/lib/krb5/salt-arcfour.c:84
#2  0x0000000801127f97 in krb5_string_to_key_data_salt_opaque
(enctype=3DKRB5_ENCTYPE_ARCFOUR_HMAC_MD5, salt=3D..., opaque=3D...,
context=3D<optimized out>, password=3D...,
    key=3D<optimized out>) at
/data/src/releng/14.0/crypto/heimdal/lib/krb5/salt.c:201
#3  krb5_string_to_key_data_salt (context=3D0x80201a000,
enctype=3DKRB5_ENCTYPE_ARCFOUR_HMAC_MD5, password=3D..., salt=3D..., key=3D=
0x802134958)
    at /data/src/releng/14.0/crypto/heimdal/lib/krb5/salt.c:173
#4  0x000000080112817b in krb5_string_to_key_salt (context=3D0x80204be90,
context@entry=3D0x80201a000, enctype=3D-13001, password=3D0x0,
password@entry=3D0x7fffffffd1b0 "ys4tdErYgu",
    salt=3D..., key=3D0x4) at
/data/src/releng/14.0/crypto/heimdal/lib/krb5/salt.c:225
#5  0x00000008010a93a5 in hdb_generate_key_set_password (context=3D0x80201a=
000,
principal=3D<optimized out>, password=3Dpassword@entry=3D0x7fffffffd1b0 "ys=
4tdErYgu",
    keys=3Dkeys@entry=3D0x7fffffffceb0, num_keys=3Dnum_keys@entry=3D0x7ffff=
fffcea8) at
/data/src/releng/14.0/crypto/heimdal/lib/hdb/keys.c:381
#6  0x00000008010939fa in _kadm5_set_keys (context=3Dcontext@entry=3D0x8020=
1a140,
ent=3Dent@entry=3D0x7fffffffcef8, password=3D0x1 <error: Cannot access memo=
ry at
address 0x1>,
    password@entry=3D0x7fffffffd1b0 "ys4tdErYgu") at
/data/src/releng/14.0/crypto/heimdal/lib/kadm5/set_keys.c:51
#7  0x000000080108ea3c in kadm5_s_create_principal (server_handle=3D0x80201=
a140,
princ=3D<optimized out>, mask=3D<optimized out>, password=3D0x7fffffffd1b0
"ys4tdErYgu")
    at /data/src/releng/14.0/crypto/heimdal/lib/kadm5/create_s.c:172
#8  0x000000000102b64b in add_one_principal (name=3D<optimized out>, rand_k=
ey=3D1,
rand_password=3D0, use_defaults=3D0, password=3D0x7fffffffd1b0 "ys4tdErYgu",
key_data=3D0x0,
    max_ticket_life=3D<optimized out>, max_renewable_life=3D<optimized out>,
attributes=3D0x0, expiration=3D<optimized out>, pw_expiration=3D0x0)
    at /data/src/releng/14.0/crypto/heimdal/kadmin/ank.c:141
#9  add_new_key (opt=3Dopt@entry=3D0x7fffffffd600, argc=3Dargc@entry=3D1,
argv=3D0x802049290, argv@entry=3D0x802049280) at
/data/src/releng/14.0/crypto/heimdal/kadmin/ank.c:243
#10 0x000000000102f1ac in add_wrap (argc=3D<optimized out>, argv=3D0x802049=
280) at
kadmin-commands.c:210
#11 0x00000000010349be in sl_command (cmds=3D<optimized out>, argc=3D3,
argv=3D0x802049280) at /data/src/releng/14.0/crypto/heimdal/lib/sl/sl.c:209
#12 sl_command_loop (cmds=3Dcmds@entry=3D0x10388b0 <commands>,
prompt=3Dprompt@entry=3D0x1026cca "kadmin> ", data=3D<optimized out>)
    at /data/src/releng/14.0/crypto/heimdal/lib/sl/sl.c:328
#13 0x000000000102e896 in main (argc=3D<optimized out>, argv=3D<optimized o=
ut>) at
/data/src/releng/14.0/crypto/heimdal/kadmin/kadmin.c:275

(gdb) up
#1  0x0000000801126e68 in ARCFOUR_string_to_key (context=3D0x80201a000,
enctype=3DKRB5_ENCTYPE_ARCFOUR_HMAC_MD5, password=3D..., salt=3D..., opaque=
=3D...,
key=3D0x802134958)
    at /data/src/releng/14.0/crypto/heimdal/lib/krb5/salt-arcfour.c:84
84              EVP_DigestUpdate (m, &p, 1);

the same request in kadmin without -l causes kadmind to crash.

specifying a password instead of using --random-key also crashes.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-275915-227>