From: Lino Sanfilippo <LinoSanfilippo@gmx.de>
To: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Cc: Vasily Novikov <vasily.novikov@kaspersky.com>,
Eric Paris <eparis@redhat.com>,
Tvrtko Ursulin <tvrtko.ursulin@sophos.com>,
"malware-list@dmesg.printk.net" <malware-list@dmesg.printk.net>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>
Subject: Re: [malware-list] A few concerns about fanotify implementation ([PATCH] inside).
Date: Mon, 6 Jun 2011 13:17:00 +0200 [thread overview]
Message-ID: <20110606111700.GC25313@lsanfilippo.unix.rd.tt.avira.com> (raw)
In-Reply-To: <20110606102754.GA25313@lsanfilippo.unix.rd.tt.avira.com>
On Mon, Jun 06, 2011 at 12:27:54PM +0200, Lino Sanfilippo wrote:
> The applied patch should handle this correctly.
Should but doesnt, since access permission handling might not be
enabled.
So here is an improved version:
Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
---
fs/notify/fanotify/fanotify_user.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
index 9fde1c0..527fbb0 100644
--- a/fs/notify/fanotify/fanotify_user.c
+++ b/fs/notify/fanotify/fanotify_user.c
@@ -306,8 +306,15 @@ static unsigned int fanotify_poll(struct file *file, poll_table *wait)
poll_wait(file, &group->notification_waitq, wait);
mutex_lock(&group->notification_mutex);
if (!fsnotify_notify_queue_is_empty(group))
- ret = POLLIN | POLLRDNORM;
+ ret |= POLLIN | POLLRDNORM;
mutex_unlock(&group->notification_mutex);
+#ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS
+ poll_wait(file, &group->fanotify_data.access_waitq, wait);
+ mutex_lock(&group->fanotify_data.access_mutex);
+ if (!list_empty(&group->fanotify_data.access_list))
+ ret |= POLLOUT | POLLWRNORM;
+ mutex_unlock(&group->fanotify_data.access_mutex);
+#endif
return ret;
}
--
1.5.6.5
prev parent reply other threads:[~2011-06-06 11:18 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-26 12:13 A few concerns about fanotify implementation Vasily Novikov
2010-10-26 12:58 ` [malware-list] " Tvrtko Ursulin
2010-10-26 13:58 ` Vasily Novikov
2010-10-26 14:22 ` Tvrtko Ursulin
[not found] ` <201010261522.34157.tvrtko.ursulin-j34lQMj1tz/QT0dZR+AlfA@public.gmane.org>
2010-10-26 14:58 ` Eric Paris
2010-10-27 8:54 ` [malware-list] " Vasily Novikov
2010-10-27 15:58 ` Eric Paris
[not found] ` <1288195134.2655.202.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2011-06-03 9:43 ` Vasily Novikov
[not found] ` <4DE8ACAD.2080003-BkmlMuIjteXqlBn2x/YWAg@public.gmane.org>
2011-06-06 9:02 ` Douglas Leeder
2011-06-06 9:19 ` [malware-list] " Vasily Novikov
[not found] ` <4DEC9B86.6060506-BkmlMuIjteXqlBn2x/YWAg@public.gmane.org>
2011-06-06 13:43 ` Eric Paris
2011-06-06 14:42 ` [malware-list] " Vasily Novikov
[not found] ` <4DECE76E.4060507-BkmlMuIjteXqlBn2x/YWAg@public.gmane.org>
2011-06-06 15:53 ` Eric Paris
2011-06-07 12:35 ` [malware-list] " Vasily Novikov
[not found] ` <C511438CDC161C41B3C47B91D99ABA8D37B4B42114-u5UUZ0l8pcxUerCGrXd8jcc3qqyFMPEu@public.gmane.org>
2011-06-06 9:42 ` Vasily Novikov
2011-06-06 10:27 ` [malware-list] " Lino Sanfilippo
2011-06-06 11:17 ` Lino Sanfilippo [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110606111700.GC25313@lsanfilippo.unix.rd.tt.avira.com \
--to=linosanfilippo@gmx.de \
--cc=eparis@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=malware-list@dmesg.printk.net \
--cc=tvrtko.ursulin@sophos.com \
--cc=vasily.novikov@kaspersky.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).