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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20060928070239.18FE19017C4@imap.suse.de>
Date:	Thu, 28 Sep 2006 00:02:42 -0700
From:	<gregkh@...e.de>
To:	seto.hidetoshi@...fujitsu.com, gregkh@...e.de,
	linux-kernel@...r.kernel.org, maneesh@...ibm.com
Subject: patch sysfs-remove-duplicated-dput-in-sysfs_update_file.patch added to gregkh-2.6 tree


This is a note to let you know that I've just added the patch titled

     Subject: sysfs: remove duplicated dput in sysfs_update_file

to my gregkh-2.6 tree.  Its filename is

     sysfs-remove-duplicated-dput-in-sysfs_update_file.patch

This tree can be found at 
    http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/


>From seto.hidetoshi@...fujitsu.com Wed Sep 20 00:35:46 2006
Message-ID: <4510EFD8.2050608@...fujitsu.com>
Date: Wed, 20 Sep 2006 16:38:00 +0900
From: Hidetoshi Seto <seto.hidetoshi@...fujitsu.com>
To: Greg KH <gregkh@...e.de>
Cc: Linux Kernel list <linux-kernel@...r.kernel.org>
Subject: sysfs: remove duplicated dput in sysfs_update_file

Following function can drops d_count twice against one reference
by lookup_one_len.

<SOURCE>
/**
 * sysfs_update_file - update the modified timestamp on an object attribute.
 * @kobj: object we're acting for.
 * @attr: attribute descriptor.
 */
int sysfs_update_file(struct kobject * kobj, const struct attribute * attr)
{
        struct dentry * dir = kobj->dentry;
        struct dentry * victim;
        int res = -ENOENT;

        mutex_lock(&dir->d_inode->i_mutex);
        victim = lookup_one_len(attr->name, dir, strlen(attr->name));
        if (!IS_ERR(victim)) {
                /* make sure dentry is really there */
                if (victim->d_inode &&
                    (victim->d_parent->d_inode == dir->d_inode)) {
                        victim->d_inode->i_mtime = CURRENT_TIME;
                        fsnotify_modify(victim);

                        /**
                         * Drop reference from initial sysfs_get_dentry().
                         */
                        dput(victim);
                        res = 0;
                } else
                        d_drop(victim);

                /**
                 * Drop the reference acquired from sysfs_get_dentry() above.
                 */
                dput(victim);
        }
        mutex_unlock(&dir->d_inode->i_mutex);

        return res;
}
</SOURCE>

PCI-hotplug (drivers/pci/hotplug/pci_hotplug_core.c) is only user of
this function. I confirmed that dentry of /sys/bus/pci/slots/XXX/*
have negative d_count value.

This patch removes unnecessary dput().

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@...fujitsu.com>
Acked-by: Maneesh Soni <maneesh@...ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>

---
 fs/sysfs/file.c |    5 -----
 1 file changed, 5 deletions(-)

--- gregkh-2.6.orig/fs/sysfs/file.c
+++ gregkh-2.6/fs/sysfs/file.c
@@ -497,11 +497,6 @@ int sysfs_update_file(struct kobject * k
 		    (victim->d_parent->d_inode == dir->d_inode)) {
 			victim->d_inode->i_mtime = CURRENT_TIME;
 			fsnotify_modify(victim);
-
-			/**
-			 * Drop reference from initial sysfs_get_dentry().
-			 */
-			dput(victim);
 			res = 0;
 		} else
 			d_drop(victim);


Patches currently in gregkh-2.6 which might be from seto.hidetoshi@...fujitsu.com are

driver/sysfs-remove-duplicated-dput-in-sysfs_update_file.patch
driver/sysfs-update-obsolete-comment-in-sysfs_update_file.patch
-
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