From nobody Tue Nov 29 17:07:05 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 4NM7zt42vHz4jJ5x for ; Tue, 29 Nov 2022 17:07:06 +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 4NM7zs6KJRz4VnS for ; Tue, 29 Nov 2022 17:07:05 +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=1669741625; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CxhkrMICDdzrYZyLsOn+hof7Npr3QdO5OQjEWeWRFv0=; b=DrFFu4QLL3mkk9nvgLg23S0wF52139wexjEOmG2MhXygLXlqvaBJ4ZKhc32FN6F9Phyd6a UpdeaozvxYg0xbpzkv4LrXG83JvM99Js9Udj+GQQGdmR5HIEdW8O3D49K9/6c0PV2dh8SS S0ldy8P6U0T5hmHIR6FbyJ3tgJepmYB0JA23aSsx51Nsws3qBtGElcopWGbxtm5X1mLavo L/hVPE6kA/yqUk8ImBbN82uW5mHFIErP8BkXuHtsZwkwYbJi/Hqh8uDG7S1fHvhlx738tc GvWdAwAaLIZuQlt3iPE4uNjWiMQiU58wWVYclsN5ZM8BpThKO3z4YM7L+++DeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1669741625; a=rsa-sha256; cv=none; b=vW5d3krh+nBfNMDNCAQdhl9fdykzY/pC5ICtI7U6IZr95HSsIP2Vwzoh6C3dLAhRCvdbTu 1y3VXzoQYpIiwi0fx/ovsah5Wn8qlK8voUIDuAWtcIBMpOjA6P4n7GckIYxeNzzzqZfcb2 hm7I1h4XrVcZlADZV8jZ7TEUaH4DzJhHqgxoJCzjN72Vu+cxEcq9QgCwcfkko1lGNDHIpW mxMIFPyx2x7YU2i67aaCzoW4j6+MSD5hyXDojauUITKSk/fInQB8lPjbltxBHisnRuH2zp UBLRW2jCVvGIn/qhyoXGWOEFG5h12Va49SVhIkaOxWoaDg57HedhKkbzF035ng== 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 4NM7zs5HfhzPxT for ; Tue, 29 Nov 2022 17:07:05 +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 2ATH75GQ052934 for ; Tue, 29 Nov 2022 17:07:05 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 2ATH75tL052933 for bugs@FreeBSD.org; Tue, 29 Nov 2022 17:07:05 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 268062] zero-length client request causes kadmind to use pointers in freed memory Date: Tue, 29 Nov 2022 17:07:05 +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=3D268062 Bug ID: 268062 Summary: zero-length client request causes kadmind to use pointers in freed memory 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 #238427 text/plain mime type: Created attachment 238427 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D238427&action= =3Dedit send a zero-length request to kadmind that causes it to use pointers from f= reed memory If a client send kadmind a zero-length message, kadmind_dispatch() sees the error: ret =3D krb5_ret_int32(sp, &cmd); if (ret) { krb5_storage_free(sp); goto fail; } but then calls through a pointer from the freed sp: fail: ...; krb5_storage_seek(sp, 0, SEEK_SET); KRB5_LIB_FUNCTION off_t KRB5_LIB_CALL krb5_storage_seek(krb5_storage *sp, off_t offset, int whence) { return (*sp->seek)(sp, offset, whence); } I've attached a demo; valgrind or a debugging malloc are required to reliably see the error: # cc kadmind18b.c -lkrb5 # ./a.out This is with source from git from this morning (Nov 29). --=20 You are receiving this mail because: You are the assignee for the bug.=