lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20101210174733.GC32555@lsanfilippo.unix.rd.tt.avira.com>
Date:	Fri, 10 Dec 2010 18:47:33 +0100
From:	Lino Sanfilippo <LinoSanfilippo@....de>
To:	eparis@...hat.com
Cc:	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject:  [PATCH 2/2] fanotify: remove obsolete check for overflow event in
	create_fd()


In create_fd() we check if mount and dentry of the passed event are NULL.
This cant happen any more since we dont call this function for the overflow
event any longer. So we can remove this check.

Signed-off-by: Lino Sanfilippo <LinoSanfilippo@....de>
---
 fs/notify/fanotify/fanotify_user.c |   35 +++++++++++++++--------------------
 1 files changed, 15 insertions(+), 20 deletions(-)

diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
index e108960..0dce0d4 100644
--- a/fs/notify/fanotify/fanotify_user.c
+++ b/fs/notify/fanotify/fanotify_user.c
@@ -82,28 +82,23 @@ static int create_fd(struct fsnotify_group *group, struct fsnotify_event *event)
 	 */
 	dentry = dget(event->path.dentry);
 	mnt = mntget(event->path.mnt);
-	/* it's possible this event was an overflow event.  in that case dentry and mnt
-	 * are NULL;  That's fine, just don't call dentry open */
-	if (dentry && mnt) {
-		flags = group->fanotify_data.f_flags;
+
+	flags = group->fanotify_data.f_flags;
+	new_file = dentry_open(dentry, mnt, flags, current_cred());
+	/*
+	 * Attempt fallback to read-only access if writable was not possible
+	 * in order to at least provide something to the listener.
+	 */
+	if (IS_ERR(new_file) && group->fanotify_data.readonly_fallback) {
+		/* dentry_open() put our refs, so get them again... */
+		dentry = dget(event->path.dentry);
+		mnt = mntget(event->path.mnt);
+
+		flags &= ~O_ACCMODE;
+		flags |= O_RDONLY;
 		new_file = dentry_open(dentry, mnt, flags, current_cred());
-		/*
-		 * Attempt fallback to read-only access if writable was not possible
-		 * in order to at least provide something to the listener.
-		 */
-		if (IS_ERR(new_file) && group->fanotify_data.readonly_fallback) {
-			/* dentry_open() put our refs, so get them again... */
-			dentry = dget(event->path.dentry);
-			mnt = mntget(event->path.mnt);
-
-			flags &= ~O_ACCMODE;
-			flags |= O_RDONLY;
-			new_file = dentry_open(dentry, mnt, flags,
-					       current_cred());
-		}
-	} else {
-		new_file = ERR_PTR(-EOVERFLOW);
 	}
+
 	if (IS_ERR(new_file)) {
 		/*
 		 * we still send an event even if we can't open the file.  this
-- 
1.5.6.5

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ