Bug 841284 - __pmDecodeInstance vulnerabilities
__pmDecodeInstance vulnerabilities
Product: Fedora
Classification: Fedora
Component: pcp (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Mark Goodwin
Fedora Extras Quality Assurance
: Security
Depends On:
Blocks: 840765 CVE-2012-3418
  Show dependency treegraph
Reported: 2012-07-18 10:57 EDT by Florian Weimer
Modified: 2012-08-20 00:00 EDT (History)
4 users (show)

See Also:
Fixed In Version: pcp-3.6.5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-08-20 00:00:35 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Resolve issues in decoding PCP instance PDUs (2.22 KB, patch)
2012-07-27 02:30 EDT, Nathan Scott
no flags Details | Diff
Updated patch to address PCP instance PDU decoding issues (2.03 KB, patch)
2012-07-28 21:14 EDT, Nathan Scott
no flags Details | Diff

  None (edit)
Description Florian Weimer 2012-07-18 10:57:06 EDT
__pmDecodeInstance does not check the numinst and namelen values against the length of the PDU.  As a result, an application which decodes crafted PDU_INSTANCE packets can crash.  namelen values of 0xFFFFFFFF result in the allocation of a heap object which is too small, but this is probably not exploitable for code execution (this assessment is subject to the usual caveats)
Comment 2 Nathan Scott 2012-07-27 02:30:53 EDT
Created attachment 600701 [details]
Resolve issues in decoding PCP instance PDUs
Comment 3 Florian Weimer 2012-07-27 10:34:48 EDT
(In reply to comment #2)
> Created attachment 600701 [details]

	if (sizeof(instlist_t) - sizeof(sizeof(ip->name)) > (size_t)(pdu_end - (char *)ip)) {

There's a duplicated sizeof.

	if (ip->namelen < 0 || ip->namelen >= rp->hdr.len || ip->namelen + 1 >= INT_MAX) {

ip->namelen + 1 >= INT_MAX is always false.   If you move the next check before the malloc, you only need the ip->namelen < 0 part.  The ip->namelen >= rp->hdr.len check is implicit in the check against the remaining PDU length.
Comment 4 Nathan Scott 2012-07-28 21:14:45 EDT
Created attachment 600962 [details]
Updated patch to address PCP instance PDU decoding issues

Incorporate Florian's review comments.
Thanks Florian!
Comment 5 Florian Weimer 2012-07-30 08:16:47 EDT
I think this is okay, thanks.
Comment 6 Huzaifa S. Sidhpurwala 2012-08-16 00:07:13 EDT
Upstream patch:


This issue has been addressed in pcp-3.6.5

Note You need to log in before you can comment on or make changes to this bug.