aboutsummaryrefslogtreecommitdiff
path: root/fs/nilfs2/page.c
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2011-04-05 17:20:50 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-04-05 15:27:14 -0700
commitd0de4dc584ec6aa3b26fffea320a8457827768fc (patch)
tree6895419a694ba323c6b18cdb6aa2714892b6f481 /fs/nilfs2/page.c
parent623dda65b6f71e6474f3f156dbed2acf6ff43584 (diff)
inotify: fix double free/corruption of stuct user
On an error path in inotify_init1 a normal user can trigger a double free of struct user. This is a regression introduced by a2ae4cc9a16e ("inotify: stop kernel memory leak on file creation failure"). We fix this by making sure that if a group exists the user reference is dropped when the group is cleaned up. We should not explictly drop the reference on error and also drop the reference when the group is cleaned up. The new lifetime rules are that an inotify group lives from inotify_new_group to the last fsnotify_put_group. Since the struct user and inotify_devs are directly tied to this lifetime they are only changed/updated in those two locations. We get rid of all special casing of struct user or user->inotify_devs. Signed-off-by: Eric Paris <eparis@redhat.com> Cc: stable@kernel.org (2.6.37 and up) Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/nilfs2/page.c')
0 files changed, 0 insertions, 0 deletions