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

thread_stats.malloced_by_size[class_id] overflow in asan_allocator.cc #397

Closed
ramosian-glider opened this issue Sep 1, 2015 · 4 comments

Comments

@ramosian-glider
Copy link
Member

Originally reported on Google Code with ID 397

What version of the product are you using? On what operating system?

Clang 3.7, x86_64-unknown-linux-gnu

Please provide any additional information below.

Performing static analysis for ASan via Coverity Prevent tool, I've noticed, that thread_stats.malloced_by_size[class_id]
from can be overflowed in Allocate function from asan_allocator.cc.

Here:

$ cat lib/asan/asan_allocator.cc
....................................
  uptr class_id =
      Min(kNumberOfSizeClasses, SizeClassMap::ClassID(needed_size));
  thread_stats.malloced_by_size[class_id]++;

If class_id == kNumberOfSizeClasses == 255, than we access thread_stats.malloced_by_size[255]
and overflow thread_stats.malloced_by_size array.

Reported by chefMax7 on 2015-06-26 18:21:11

@ramosian-glider
Copy link
Member Author

Reported by samsonov@google.com on 2015-06-26 18:31:09

  • Status changed: Accepted

@ramosian-glider
Copy link
Member Author

Should be fixed in r240816, thanks for the report!

Reported by samsonov@google.com on 2015-06-26 19:18:19

  • Status changed: Fixed

@ramosian-glider
Copy link
Member Author

Thank you, Alexey.

Reported by chefMax7 on 2015-06-26 19:47:03

@ramosian-glider
Copy link
Member Author

Adding Project:AddressSanitizer as part of GitHub migration.

Reported by ramosian.glider on 2015-07-30 09:14:09

  • Labels added: ProjectAddressSanitizer

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

No branches or pull requests

1 participant