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:	Fri, 02 Oct 2009 11:12:24 +0200
From:	Sven-Thorsten Dietrich <sdietrich@...ell.com>
To:	LKML <linux-kernel@...r.kernel.org>
Cc:	linux-rt-users <linux-rt-users@...r.kernel.org>
Subject: [PATCH][UHCI-DEBUG] Don't kmalloc with BKL held

Subject: Don't kmalloc with BKL held.
From: Sven-Thorsten Dietrich <sdietrich@...e.de>

I'm eyeballing this file for complete removal of lock_kernel but 
at first glance, we definitely don't need BKL to kmalloc(). 

Signed-off-by: Sven-Thorsten Dietrich <sdietrich@...e.de>


diff --git a/drivers/usb/host/uhci-debug.c b/drivers/usb/host/uhci-debug.c
index e52b954..325d508 100644
--- a/drivers/usb/host/uhci-debug.c
+++ b/drivers/usb/host/uhci-debug.c
@@ -497,7 +497,6 @@ static int uhci_debug_open(struct inode *inode, struct file *file)
 	int ret = -ENOMEM;
 	unsigned long flags;
 
-	lock_kernel();
 	up = kmalloc(sizeof(*up), GFP_KERNEL);
 	if (!up)
 		goto out;
@@ -509,6 +508,8 @@ static int uhci_debug_open(struct inode *inode, struct file *file)
 	}
 
 	up->size = 0;
+
+	lock_kernel();
 	spin_lock_irqsave(&uhci->lock, flags);
 	if (uhci->is_initialized)
 		up->size = uhci_sprint_schedule(uhci, up->data, MAX_OUTPUT);


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