From nobody Fri Jun 09 18:16:17 2023 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 4Qd8R65QXKz4c2My for ; Fri, 9 Jun 2023 18:16:18 +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 4Qd8R635Ggz41xY for ; Fri, 9 Jun 2023 18:16:18 +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=1686334578; 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=YmzRuSA10HcpytBMMFIbvmcVpsgyLVriZgvwPijjKyY=; b=m1MtNg7ORQCw9KilM1cAI6Fu289+QdLdZNbpIISHcufiYJM7lrCMKqkuIKO85Sa4h3s1XJ wXGkRvqvyunEkJPWZqbOoOQUjB2s4QNadqx50lbVFh1SizsFZ4+pTGy5idVAuLM9WO+p+S O9fIij9rJFTrGKkkV6lb+wqGAeUadLMvtxNgxp1Gvjir6/w2RvRNJqFfAi97XKnQfi5nGd SmbFloIxqJb7HjvnNE3YDLD43Hppuz/X7sAbsyPDx/PZBrP2uY7MWsjQgdrwCZJtKinBt/ +ptnbx/jB5/pQSS2bl0TZ83pMdf2TW2c4WG/gAGiCqCOGVCFDDkqiJtHRUJh9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686334578; a=rsa-sha256; cv=none; b=R/6uLXBrChcyecPfmNreRdqoRbSjD0J0Bi91AMl/PGsuE6F9OZVtnrwGuAgUVRFcLSKTW1 /fU5Ynmco6iSqtF+hinld9cR4OfbvIzc6C5/u3d8+8BehUqV0jf5oAfVdUa9t2ASNIHMAB 7lV7zj/p4gB/DJnUZabAJFX/tp6OMtnsDgbSxpIP6QKp3QlgeBsp3scuqBMt0lTE5AnDB1 Oe7tjk1etaausjTD+8jWozZbSV5TSFWZiN9eAdzyyhXR2FIdOf7ehRkt9dF6OD8mM7N7CM ER5FbgyerNZKHxyNXsmAruE+680Ql4/pcuftXGr4XI5G5OiTRAWRe6NAi/KGdA== 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 4Qd8R622CFzlQp for ; Fri, 9 Jun 2023 18:16:18 +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 359IGIHs003181 for ; Fri, 9 Jun 2023 18:16:18 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 359IGImZ003180 for bugs@FreeBSD.org; Fri, 9 Jun 2023 18:16:18 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 271924] short pred1 compressed packet can cause ppp to write off the end of a buffer Date: Fri, 09 Jun 2023 18:16:17 +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=3D271924 Bug ID: 271924 Summary: short pred1 compressed packet can cause ppp to write off the end of a buffer 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 #242704 text/plain mime type: Created attachment 242704 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D242704&action= =3Dedit crash ppp by sending a short pred1 compressed packet If the sender has negotiated ppp pred1 compression, then sending this too-short compressed HDLC frame: 7e fd ff 4f cc 7e causes ppp's Pred1Input() to pass a negative length to decompress(), which (since decompress() only checks for equality with zero) is effectively a huge length. The negative length comes from this subtraction in Pred1Input(): olen =3D m_length(bp); ...; len1 =3D decompress(state, cp, pp, olen - 4); With the above input frame, the mbuf at this point has a length of 3. A backtrace from the attached demo ppp27a.c: #0 0x000009cc8c70aff0 in decompress (state=3D0x9d4b663c700,=20 source=3D0x9d4b66f28e9 "",=20 dest=3D0x9d4b6787000 ,=20 len=3D-1025456) at /usr/src/usr.sbin/ppp/pred.c:119 #1 Pred1Input (v=3D0x9d4b663c700, ccp=3D0x9d4b65d5340, proto=3D0x9d4ad6d2f= 1e,=20 bp=3D0x9d4b65f8300) at /usr/src/usr.sbin/ppp/pred.c:238 #2 0x000009cc8c6dda10 in ccp_LayerPull (b=3D, l=3D,=20 bp=3D0x9d4b65f8300, proto=3D0x9d4ad6d2f1e) at /usr/src/usr.sbin/ppp/ccp= .c:765 #3 0x000009cc8c6feff4 in link_PullPacket (l=3D0x9d4b65d4600,=20 buf=3D, len=3D,=20 b=3D0x9cc8c7254b0 ) at /usr/src/usr.sbin/ppp/link= .c:315 #4 0x000009cc8c6d8e25 in bundle_DescriptorRead (d=3D,=20 bundle=3D0x9cc8c7254b0 , fdset=3D0x9d4b65ff140) at /usr/src/usr.sbin/ppp/bundle.c:546 #5 0x000009cc8c702704 in DoLoop (bundle=3D0x9cc8c7254b0 ) at /usr/src/usr.sbin/ppp/main.c:661 #6 main (argc=3D3, argv=3D) at /usr/src/usr.sbin/ppp/main.c= :535 --=20 You are receiving this mail because: You are the assignee for the bug.=