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: <8bd0f97a0805191707k597e4f48i9c54488777fdd91b@mail.gmail.com>
Date:	Mon, 19 May 2008 20:07:59 -0400
From:	"Mike Frysinger" <vapier.adi@...il.com>
To:	"Arnd Bergmann" <arnd@...db.de>
Cc:	"Jonathan Corbet" <corbet@....net>,
	"Linus Torvalds" <torvalds@...ux-foundation.org>,
	"Ingo Molnar" <mingo@...e.hu>,
	"Andrew Morton" <akpm@...ux-foundation.org>,
	"Peter Zijlstra" <a.p.zijlstra@...llo.nl>,
	"Thomas Gleixner" <tglx@...utronix.de>,
	"Alan Cox" <alan@...rguk.ukuu.org.uk>,
	"Alexander Viro" <viro@....linux.org.uk>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3, RFC] misc char dev BKL pushdown

On Mon, May 19, 2008 at 7:26 PM, Arnd Bergmann wrote:
> The Big Kernel Lock has been pushed down from chardev_open
> to misc_open, this change moves it to the individual misc
> driver open functions.
>
> As before, the change was purely mechanical, most drivers
> should actually not need the BKL. In particular, we still
> hold the misc_mtx() while calling the open() function
> The patch should probably be split into one changeset
> per driver.
>
> --- linux-2.6.orig/arch/blackfin/mach-bf561/coreb.c
> +++ linux-2.6/arch/blackfin/mach-bf561/coreb.c
> @@ -32,6 +32,7 @@
>  #include <linux/device.h>
>  #include <linux/ioport.h>
>  #include <linux/module.h>
> +#include <linux/smp_lock.h>
>  #include <linux/uaccess.h>
>  #include <linux/fs.h>
>  #include <asm/dma.h>
> @@ -196,6 +197,7 @@ static loff_t coreb_lseek(struct file *f
>
>  static int coreb_open(struct inode *inode, struct file *file)
>  {
> +       lock_kernel();
>        spin_lock_irq(&coreb_lock);
>
>        if (coreb_status & COREB_IS_OPEN)
> @@ -204,10 +206,12 @@ static int coreb_open(struct inode *inod
>        coreb_status |= COREB_IS_OPEN;
>
>        spin_unlock_irq(&coreb_lock);
> +       unlock_kernel();
>        return 0;
>
>  out_busy:
>        spin_unlock_irq(&coreb_lock);
> +       unlock_kernel();
>        return -EBUSY;
>  }

this open func already has a spinlock protecting it.  doesnt that mean
we dont need the bkl in it ?
-mike
--
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