Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1221776

Re: [PATCH] inotify: actually check for invalid bits in sys_inotify_add_watch()

From Josh Boyer <jwboyer@fedoraproject.org>
Newsgroups linux.kernel
Subject Re: [PATCH] inotify: actually check for invalid bits in sys_inotify_add_watch()
Date 2015-09-10 00:40 +0200
Message-ID <q6Wc1-89H-7@gated-at.bofh.it> (permalink)
References <pH7FL-ic-9@gated-at.bofh.it> <q6VJ0-7BX-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Sep 9, 2015 at 5:59 PM, Dave Hansen <dave@sr71.net> wrote:
> On 06/30/2015 10:36 AM, Dave Hansen wrote:
>> From: Dave Hansen <dave.hansen@linux.intel.com>
>>
>> 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.
>>
>> Add the actual check which was intended.  Retain the existing
>> check because it actually does something useful: ensure that some
>> 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'.
>
> Did anybody have any comments on this patch?  Who picks up inotify patches?

Theoretically the people you have CC'd pick them up.  However it seems
for quite some time Andrew has been shepherding them along.

josh

>>  b/fs/notify/inotify/inotify_user.c |    3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff -puN fs/notify/inotify/inotify_user.c~inotify-EINVAL-on-invalid-bit fs/notify/inotify/inotify_user.c
>> --- a/fs/notify/inotify/inotify_user.c~inotify-EINVAL-on-invalid-bit  2015-06-26 13:33:30.277219285 -0700
>> +++ b/fs/notify/inotify/inotify_user.c        2015-06-26 13:35:19.026122033 -0700
>> @@ -707,6 +707,9 @@ SYSCALL_DEFINE3(inotify_add_watch, int,
>>       unsigned flags = 0;
>>
>>       /* don't allow invalid bits: we don't want flags set */
>> +     if (unlikely(mask & ~ALL_INOTIFY_BITS))
>> +             return -EINVAL;
>> +     /* require at least one valid bit set in the mask */
>>       if (unlikely(!(mask & ALL_INOTIFY_BITS)))
>>               return -EINVAL;
>>
>> _
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe stable" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] inotify: actually check for invalid bits in  sys_inotify_add_watch() Dave Hansen <dave@sr71.net> - 2015-09-10 00:10 +0200
  Re: [PATCH] inotify: actually check for invalid bits in sys_inotify_add_watch() Josh Boyer <jwboyer@fedoraproject.org> - 2015-09-10 00:40 +0200
  Re: [PATCH] inotify: actually check for invalid bits in  sys_inotify_add_watch() Eric Paris <eparis@redhat.com> - 2015-09-10 01:20 +0200
    Re: [PATCH] inotify: actually check for invalid bits in  sys_inotify_add_watch() Dave Hansen <dave@sr71.net> - 2015-09-10 01:40 +0200
      Re: [PATCH] inotify: actually check for invalid bits in  sys_inotify_add_watch() Andrew Morton <akpm@linux-foundation.org> - 2015-09-10 22:50 +0200
        Re: [PATCH] inotify: actually check for invalid bits in sys_inotify_add_watch() Andrey Wagin <avagin@gmail.com> - 2015-09-21 13:30 +0200

csiph-web