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]
Date:	Fri, 10 Nov 2006 11:18:44 -0500 (EST)
From:	Alan Stern <stern@...land.harvard.edu>
To:	Andrew Morton <akpm@...l.org>
cc:	Kernel development list <linux-kernel@...r.kernel.org>
Subject: [PATCH] EHCI: fix memory pool name allocation

This patch (as802) changes the poolname allocation for the shadow
budget in ehci-mem.c.  The name needs to be allocated dynamically, not
on the stack, because the memory management system continues to use it
after registration.

Also included are a couple of minor whitespace fixups (tabs instead of
spaces).

Signed-off-by: Alan Stern <stern@...land.harvard.edu>

---

Andrew:

This patch has been submitted to Greg, but it's tied in with other changes 
to ehci-hcd and so it might not get accepted for a while.  However it does 
fix a real bug in the current -mm kernel; I think you should apply it.

Alan Stern


Index: usb-2.6/drivers/usb/host/ehci.h
===================================================================
--- usb-2.6.orig/drivers/usb/host/ehci.h
+++ usb-2.6/drivers/usb/host/ehci.h
@@ -71,8 +71,9 @@ struct ehci_hcd {			/* one per controlle
 	int			next_uframe;	/* scan periodic, start here */
 	unsigned		periodic_sched;	/* periodic activity count */
 
-        kmem_cache_t            *budget_pool;   /* Pool for shadow budget */
-        struct ehci_shadow_budget **budget;     /* pointer to the shadow budget
+	char			poolname[20];	/* Shadow budget pool name */
+	kmem_cache_t		*budget_pool;	/* Pool for shadow budget */
+	struct ehci_shadow_budget **budget;	/* pointer to the shadow budget
 						   of bandwidth placeholders */
 
 	struct ehci_fstn        *periodic_restore_fstn;
Index: usb-2.6/drivers/usb/host/ehci-mem.c
===================================================================
--- usb-2.6.orig/drivers/usb/host/ehci-mem.c
+++ usb-2.6/drivers/usb/host/ehci-mem.c
@@ -293,17 +293,11 @@ static int ehci_mem_init (struct ehci_hc
 	        goto fail;
 	}
 
-	{
-		char poolname[20];
-
-		snprintf(poolname,20,"ehci_budget_%d",
-			 ehci_to_hcd(ehci)->self.busnum);
-
-		ehci->budget_pool =
-			kmem_cache_create (poolname,
-					   sizeof(struct ehci_shadow_budget),
-					   0,0,NULL,NULL);
-	}
+	snprintf(ehci->poolname, sizeof(ehci->poolname), "ehci-budget-%d",
+			ehci_to_hcd(ehci)->self.busnum);
+	ehci->budget_pool = kmem_cache_create(ehci->poolname,
+			sizeof(struct ehci_shadow_budget),
+			0, 0, NULL, NULL);
 	if (!ehci->budget_pool)
 		goto fail;
 

-
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