First, thanks to Eugene and Adar for reporting and investigation.
I have had some time now to debug this and I found the reason for the bug. 
Obviously something went wrong during 
the port of the patch series mentioned above from mainline to ubuntu kernel:
There is the function fsnotify_destroy() which is never called in ubuntu. But 
this function ensures
that all pending events are flushed and thereby ref counts on a fsnotify group 
held by those events are released.
So what has to be done is call fsnotify_destroy in inotify_release(). Otherwise 
there will always be references held to
the inotify group and the group will never get destroyed - which sooner or 
later results in a number of alive groups that
exceeds the allowed max number. 
The same flaw can be found in the fanotify code. I will attach a patch that 
should fix the ref counts for both inotify and fanotify.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1101666

Title:
  inotify fd leak

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1101666/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to