Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix various issues with pool management / access #125

Merged
merged 1 commit into from
Mar 13, 2018
Merged

Conversation

hlef
Copy link
Contributor

@hlef hlef commented Mar 12, 2018

Constants are usually retrieved from the constant pool without verifying that the pool actually contains them, which may lead to various heap buffer overflow issues.

In this PR we add a counter keeping track of how many elements the pool contains, and checks making sure that whenever the pool is accessed, the constant in present in the pool (constant position < pool counter).

Also, do not return "" when a pointer is excepted (it should be legal to free this return value).

This PR fixes #112 (CVE-2018-7875), fixes #120 (CVE-2018-7871), fixes #117 (CVE-2018-7870), fixes #114 (CVE-2018-7872), fixes #122, fixes #113 (CVE-2018-7868), fixes #123.

Lots of non trivial stuff here, careful review would be really helpful.

Constants are usually retrieved from the constant pool without verifying
that the pool actually contains them, which may lead to various heap
buffer overflow issues.

In this patch we add a counter keeping track of how many elements the pool
contains, and checks making sure that whenever the pool is accessed, the
constant in present in the pool (constant position < pool counter).

Also, do not return "" when a pointer is excepted (it should be legal to free
this return value).

This patch fixes libming#112 (CVE-2018-7875), fixes libming#120 (CVE-2018-7871),
fixes libming#117 (CVE-2018-7870), fixes libming#114 (CVE-2018-7872), fixes libming#122,
fixes libming#113 (CVE-2018-7868), fixes libming#123.
@strk strk merged commit 3a000c7 into libming:master Mar 13, 2018
strk added a commit that referenced this pull request Mar 13, 2018
Fix various issues with pool management / access
@strk
Copy link
Member

strk commented Mar 13, 2018

Thanks, always great contributions !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment