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, 27 Jan 2009 12:52:55 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Andrea Righi <righi.andrea@...il.com>
Cc:	hannes@...xchg.org, davej@...hat.com, rjw@...k.pl,
	hannes@...urebad.de, krzysztof.h1@...pl, harvey.harrison@...il.com,
	stefanr@...6.in-berlin.de, linux-kernel@...r.kernel.org,
	righi.andrea@...il.com
Subject: Re: [PATCH] fbmem: copy_from/to_user() with mutex held (v3)

On Tue, 20 Jan 2009 10:27:56 +0100
Andrea Righi <righi.andrea@...il.com> wrote:

> Avoid to call copy_from/to_user() with fb_info->lock mutex held in fbmem
> ioctl().
> 
> fb_mmap() is called under mm->mmap_sem (A) held, that also acquires
> fb_info->lock (B); fb_ioctl() takes fb_info->lock (B) and does
> copy_from/to_user() that might acquire mm->mmap_sem (A), causing a
> deadlock.
> 
> NOTE: it doesn't push down the fb_info->lock in each own driver's
> fb_ioctl(), so there're still potential deadlocks somewhere.
> 

Looks good to me.

> ...
>
>  static long fb_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
> -__acquires(&info->lock)
> -__releases(&info->lock)

Should the __acquires/__releases annotation be relocated to
do_fb_ioctl()?  I've never actually got down and understood those
things.


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