From nobody Thu Nov 24 18:29:58 2022 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NJ63q44G3z4hqbr for ; Thu, 24 Nov 2022 18:29:59 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NJ63q0PRDz3mkQ for ; Thu, 24 Nov 2022 18:29:59 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669314599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GYglHh2cIIaTgQbqBrFMjGipNYQc7km3NM99qOMtido=; b=CBvJw2ncNgvDpKZ5wyPH4RY8w8vBmdNfKdJfUEIKTupRIyXojJef3syyiJ2IiuuSlz844J f27wp/cfJP2PM6pbqVxc9dZXvUtA+CUt5cGuiegaQxW72T6AGNQce5+rWq2rm37r01cGCv ZJLNnpeRoWR5YYisoJkvW8L7DA2eWLA3qCLQiAViEUNExzHzk+dEy2xbWdqTWKhR/xbf0N kesl9a4EVIdQcFckwtGMdZQLqoUmV+UTvCgS6TYvHqIYKn5HECtYv2B0NTGkrfxfC/wRhk pKIaH56zeLMGik9q7GV0w/0NFBqXxYv7S72gDcR5aZt4VpxD40zRGfxdTXSbYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1669314599; a=rsa-sha256; cv=none; b=Swoi/IUWWUDwCciNDr3gaLEQ6k3YBeMchHLy8+mxI2eE1FyQ3ZWGKv8bIwuoijiUhttw26 d6GXxyoARwO1f5iHAP1iuwJjngJ4TPFrc+WM90dN4W4gXtudlkJ6Xlh08XWFpMqu54Tms/ 5Ozb66wBo+lA0ms3PaRXzV+FNXGU18gKFMPzsJEXSBITAMO19WU65qSgX3QxyqQzZWc9Xw uvLS5iIwyRY/01uzjsV15yAbfAua2GbzITRIyq72Ehg1r3VCZAZ/TZlPOiNYoON4suG2Bj SSr5O3TxD830v3txxXE+L6qay8YczCD+1QpsYvAssWV2Kzjfkhfpn6g53F4U2A== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NJ63p66Vlz1B9T for ; Thu, 24 Nov 2022 18:29:58 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 2AOITwhm028067 for ; Thu, 24 Nov 2022 18:29:58 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 2AOITwrB028066 for bugs@FreeBSD.org; Thu, 24 Nov 2022 18:29:58 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 267972] kadmind can use uninitialized ent.tl_data...tl_data_contents and tl_data_length Date: Thu, 24 Nov 2022 18:29:58 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: rtm@lcs.mit.edu X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.mimetype attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D267972 Bug ID: 267972 Summary: kadmind can use uninitialized ent.tl_data...tl_data_contents and tl_data_length Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: rtm@lcs.mit.edu Attachment #238312 text/plain mime type: Created attachment 238312 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D238312&action= =3Dedit crash kadmind with a short kadm_modify message If a client kadm_modify message ends unexpectedly early during KADM5_TL_DATA, krb5_ret_data() can return (due to error) before setting data->size of data->length. But the call from kadm5_ret_tl_data() doesn't check for an error, and the surrounding call from ret_principal_ent() for KADM5_TL_DATA doesn't check for an error either. So list elements in ent.tl_data (princ->tl_data) may contain uninitialized junk. I've attached a demo. It expects to be run with tickets. Maybe some previous bugs have to be fixed in order for kadmind to get as far as this one. # cc kadmind16a.c -lkrb5 # ./a.out A backtrace from kadmin: #0 memset (xdst=3D0x17e4ffb480, c=3D0, len=3D18446744073709541600) #1 0x00000017d6b6bff2 in kadm5_free_principal_ent ( server_handle=3D, princ=3D0x17d5c2f420) at /usr/rtm/symbsd/src/crypto/heimdal/lib/kadm5/free.c:73 #2 0x0000001754e3c340 in kadmind_dispatch (kadm_handlep=3D0x17e4fd44c0,=20 initial=3D0, in=3D, out=3D0x17d5c2f5f8) at /usr/rtm/symbsd/src/crypto/heimdal/kadmin/server.c:161 #3 0x0000001754e3bf9e in v5_loop (contextp=3D,=20 ac=3D, initial=3D, kadm_handlep=3D,=20 fd=3D) at /usr/rtm/symbsd/src/crypto/heimdal/kadmin/server.c:459 #4 0x0000001754e3be72 in handle_v5 (contextp=3D0x17e4f8ee10,=20 keytab=3D, fd=3D) at /usr/rtm/symbsd/src/crypto/heimdal/kadmin/server.c:551 #5 0x0000001754e3bd7a in kadmind_loop (contextp=3D0x17e4f8ee10,=20 keytab=3D0x17e4fad330, sock=3D) at /usr/rtm/symbsd/src/crypto/heimdal/kadmin/server.c:579 #6 0x0000001754e3ccb2 in main (argc=3D, argv=3D) at /usr/rtm/symbsd/src/crypto/heimdal/kadmin/kadmind.c:202 --=20 You are receiving this mail because: You are the assignee for the bug.=