Re: [PATCH 1/2] fsnotify: fix NULL dereference in send_to_group()

From: Csaba Henk
Date: Sat Aug 28 2010 - 17:50:46 EST


On Sun, Aug 29, 2010 at 2:49 AM, Eric Paris <eparis@xxxxxxxxxx> wrote:
> This should be fixed in the pull request I sent to Linus last night.
> Sorry you had to track it down as well.  There are a number of other bug
> fixes in my tree
>
> http://git.infradead.org/users/eparis/notify.git

Oh yeah, my bad, I did check that tree before getting into this... but
only the master branch, not for-linus.

> There might still be some code duplication which something like 2/2
> could clean up but your patch does apply to my devel tree and it has a
> logic flaw.  In the case we have both a vfsmount and an inode mark we
> need to test:
>
> event_mask & vmark->mask & ~vmark->ignored_mask & ~imark->ignored mask.
>
> You would only ever test one or the other, not both together like that.

Indeed my code implements that behavior. I took care to pass the
test_mask by reference to check_mark_mask(), where upon the first
invocation it's reduced with ~imark->ignored mask, so for the second
invocation with the vmark we make test as the above expression.

If you are OK with the clean-up, I can readjust it to apply.

Csaba
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/