eventstat: sometimes detection of a kernel thread is wrong

Bug #1226787 reported by Colin Ian King
6
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

Revision history for this message
Colin Ian King (colin-king) wrote :
Changed in eventstat (Ubuntu):
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Colin King (colin-king)
Changed in eventstat (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package eventstat - 0.01.27-1

---------------
eventstat (0.01.27-1) unstable; urgency=low

  * Makefile: bump version
  * eventstat: fix kernel thread detection issue (LP: #1226787)

 -- Colin King <email address hidden> Thu, 19 Sep 2013 16:05:06 +0100

Changed in eventstat (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.