[lkml]   [2010]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] inotify: Don't leak user struct on inotify release
The inotify_new_group receives a get_uid-ed user_struct and saves the
reference on group->inotify_data.user. The problem is that the free_uid
is never called on it.

Issue seem to be introduced by 63c882a0 (inotify: reimplement inotify
using fsnotify) after 2.6.30 (so stable is in Cc)

Signed-off-by: Pavel Emelyanov <>


diff --git a/fs/notify/inotify/inotify_fsnotify.c b/fs/notify/inotify/inotify_fsnotify.c
index 1afb0a1..e27960c 100644
--- a/fs/notify/inotify/inotify_fsnotify.c
+++ b/fs/notify/inotify/inotify_fsnotify.c
@@ -28,6 +28,7 @@
#include <linux/path.h> /* struct path */
#include <linux/slab.h> /* kmem_* */
#include <linux/types.h>
+#include <linux/sched.h>

#include "inotify.h"

@@ -146,6 +147,7 @@ static void inotify_free_group_priv(struct fsnotify_group *group)
idr_for_each(&group->inotify_data.idr, idr_callback, group);
+ free_uid(group->inotify_data.user);

void inotify_free_event_priv(struct fsnotify_event_private_data *fsn_event_priv)

 \ /
  Last update: 2010-03-11 11:43    [W:0.016 / U:35.844 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site