eventstat: sometimes detection of a kernel thread is wrong
Bug #1226787 reported by
Colin Ian King
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
eventstat (Ubuntu) |
Fix Released
|
Medium
|
Colin Ian King |
Bug Description
eventstat checks to see if a process is a kernel thread by checking /proc/$pid/exe - however, sometimes processes die before we can open /proc/$pid/exe and it defaults to assuming the exe was not found and hence it was a kernel thread rather than that it was a normal userland process.
Instead, it should open /proc/$pid and if does not exist, assume it was a short lived process (which is more likely). If this opens OK, then it should check if /proc/$pid/exe exists or not. To avoid TOUTOC (time of check, time of use) races, use openat on /proc/pid
Related branches
Changed in eventstat (Ubuntu): | |
status: | In Progress → Fix Committed |
To post a comment you must log in.
Fix committed, http:// kernel. ubuntu. com/git? p=cking/ eventstat. git;a=commit; h=8165e5ee6c254 28f779e8f0be1c5 9a504bb6490e