Impact: There is a race between setting an inode's children's "parent watched" flag when placing the first watch on a parent, and instantiating new children of that parent: a child could miss having its flags set by set_dentry_child_flags, but then inotify_d_instantiate might still see !inotify_inode_watched.
Patch Description: The solution is to set_dentry_child_flags after adding the watch. Locking is taken care of, because both set_dentry_child_flags and inotify_d_instantiate hold dcache_lock and child->d_locks.
SRU Justification
Impact: There is a race between setting an inode's children's "parent watched" flag when placing the first watch on a parent, and instantiating new children of that parent: a child could miss having its flags set by set_dentry_ child_flags, but then inotify_ d_instantiate might still see !inotify_ inode_watched.
Patch Description: The solution is to set_dentry_ child_flags after adding the watch. Locking is taken care of, because both set_dentry_ child_flags and inotify_ d_instantiate hold dcache_lock and child->d_locks.
Patches: http:// kernel. ubuntu. com/git? p=ubuntu/ ubuntu- hardy.git; a=commit; h=ab67a74144886 e464f5b90555887 6145e711f17a, http:// kernel. ubuntu. com/git? p=ubuntu/ ubuntu- hardy.git; a=commit; h=670dcd8597ed0 aa7f68d05d38422 6bdb81b0e956
Test Case: See bug description.