Skip to content

Commit a2ae4cc

Browse files
committed
inotify: stop kernel memory leak on file creation failure
If inotify_init is unable to allocate a new file for the new inotify group we leak the new group. This patch drops the reference on the group on file allocation failure. Reported-by: Vegard Nossum <vegard.nossum@gmail.com> cc: stable@kernel.org Signed-off-by: Eric Paris <eparis@redhat.com>
1 parent 09e5f14 commit a2ae4cc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/notify/inotify/inotify_user.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,7 @@ SYSCALL_DEFINE1(inotify_init1, int, flags)
752752
if (ret >= 0)
753753
return ret;
754754

755+
fsnotify_put_group(group);
755756
atomic_dec(&user->inotify_devs);
756757
out_free_uid:
757758
free_uid(user);

0 commit comments

Comments
 (0)