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-next>] [day] [month] [year] [list]
Date:	Thu, 21 Aug 2008 19:31:48 +0900
From:	Kenji Kaneshige <kaneshige.kenji@...fujitsu.com>
To:	Greg KH <gregkh@...e.de>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: [PATCH] Fix possible kobject reference counter leak in kobject_rename()

Hi,

I found a possible kobject reference counter leak problem in
kobject_rename(). The following patch will fix it.

Thanks,
Kenji Kaneshige


Fix possible kobject reference counter leak in kobject_rename().

If kobject_rename() failed because of name collision, we must call
kobject_put() for specified kobject before return.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@...fujitsu.com>

---
 lib/kobject.c |    1 +
 1 file changed, 1 insertion(+)

Index: linux-2.6.27-rc4/lib/kobject.c
===================================================================
--- linux-2.6.27-rc4.orig/lib/kobject.c
+++ linux-2.6.27-rc4/lib/kobject.c
@@ -411,6 +411,7 @@ int kobject_rename(struct kobject *kobj,
 			       "to '%s' as '%s' is already in existence.\n",
 			       kobject_name(kobj), new_name, new_name);
 			kobject_put(temp_kobj);
+			kobject_put(kobj);
 			return -EINVAL;
 		}
 	}

--
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