cache'd pid recycling adds cached info to hash again causing double free on exit cleanup
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cpustat (Ubuntu) |
Fix Released
|
High
|
Colin Ian King | ||
Xenial |
Fix Released
|
High
|
Colin Ian King |
Bug Description
[XENIAL SRU]
[Impact]
Cached pid info is added to the hash table even when it's a re-used pid info causing a double free on exit cleanup. Only add pid info to hash table if it is newly allocated.
[Test Case]
Run cpustat for a long duration as follows:
cpustat 1 -T -g
..and work through a lot of processes IDs until we re-use a PID, e.g.:
stress-ng --fork 0 &
and stop cpustat with SIGINT, one hits a double free as it exits
[Regression Potential]
Minimal, the fix stops an item being added to a cache'd hash list more than once, and that is a minimal impact on the main cpustat functionality.
[Fix]
Upstream commit http://
description: | updated |
Changed in cpustat (Ubuntu Xenial): | |
status: | New → In Progress |
importance: | Undecided → High |
assignee: | nobody → Colin Ian King (colin-king) |
fix commited:
commit dc7d2fe45560c41 4645bc286a7cd63 f13b69dc6c
Author: Colin Ian King <email address hidden>
Date: Thu Oct 6 17:12:00 2016 +0100
cpustat: only add pid info to hash table if it is new (LP: #1631050)