diff options
author | Dave Hansen <dave.hansen@linux.intel.com> | 2015-11-06 03:43:46 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-11-06 04:34:48 +0100 |
commit | d30e2c05a1a231452c273e74851d6b70d516f7f2 (patch) | |
tree | 54a5064389f61024aec000c0dec047fa90d1e594 /fs/coda/coda_fs_i.h | |
parent | inotify: hide internal kernel bits from fdinfo (diff) | |
download | linux-d30e2c05a1a231452c273e74851d6b70d516f7f2.tar.xz linux-d30e2c05a1a231452c273e74851d6b70d516f7f2.zip |
inotify: actually check for invalid bits in sys_inotify_add_watch()
The comment here says that it is checking for invalid bits. But, the mask
is *actually* checking to ensure that _any_ valid bit is set, which is
quite different.
Without this check, an unexpected bit could get set on an inotify object.
Since these bits are also interpreted by the fsnotify/dnotify code, there
is the potential for an object to be mishandled inside the kernel. For
instance, can we be sure that setting the dnotify flag FS_DN_RENAME on an
inotify watch is harmless?
Add the actual check which was intended. Retain the existing inotify bits
are being added to the watch. Plus, this is existing behavior which would
be nice to preserve.
I did a quick sniff test that inotify functions and that my
'inotify-tools' package passes 'make check'.
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: John McCutchan <john@johnmccutchan.com>
Cc: Robert Love <rlove@rlove.org>
Cc: Eric Paris <eparis@parisplace.org>
Cc: Josh Boyer <jwboyer@fedoraproject.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/coda/coda_fs_i.h')
0 files changed, 0 insertions, 0 deletions