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]
Date:	Tue, 15 Apr 2008 22:17:07 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Thiago Galesi <thiagogalesi@...il.com>
Cc:	linux-kernel@...r.kernel.org,
	linux-fbdev-devel@...ts.sourceforge.net
Subject: Re: [Linux-fbdev-devel] [PATCH] fb: Remove use of lock_kernel /
 unlock_kernel in fbmem

On Sun, 13 Apr 2008 11:50:07 -0300 Thiago Galesi <thiagogalesi@...il.com> wrote:

> This patch removes lock_kernel(), unlock_kernel() usage in fbmem.c and replaces it with a mutex

It isn't that simple, alas.

vfs_ioctl() runs lock_kernel() prior to calling fb_ioctl(), so the
lock_kernel()s in fb_compat_ioctl() are actually providing exclusion against
fb_ioctl().  Your patch would break that.

A suitable fix might be to do

__fb_ioctl(...)
{
	<copy fb_ioctl() into here>
}

fb_ioctl(...)
{
	mutex_lock(&info->hwlock);
	__fb_ioctl(...);
	mutex_unlock(&info->hwlock);
}

and then change fb_compat_ioctl() to call __fb_ioctl().  All the other
callers of fb_ioctl() would need to be reviewed - see if they need to take
the mutex then call __fb_ioctl(), or they might be OK as they are, calling
fb_ioctl().

Then we can switch fb_fops over to

	.ioctl	= NULL,
	.unlocked_ioctl = fb_ioctl,


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