Subject: Re: [Bugme-new] [Bug 8330] New: lmc: copy_to/from_user cals while spinlock is held

From: Andrew Morton <[email-masked]>
Date: Fri, 20 Apr 2007 15:56:59 -0700

On Sun, 15 Apr 2007 14:28:42 -0700
[email-masked] wrote:

> http://bugzilla.kernel.org/show_bug.cgi?id=8330
> 
>            Summary: lmc: copy_to/from_user cals while spinlock is held
>     Kernel Version: 2.6.20
>             Status: NEW
>           Severity: normal
>              Owner: [email-masked]
>          Submitter: [email-masked]
> 
> 
> Problem Description:
> 
> the lmc_ioctl() function in drivers/net/wan/lmc/lmc_main.c calls
> copy_from/to_user() while the spinlock sc->lmc_lock is held. AFAIK this should
> not be done as copy_from/to_user() might sleep
> 

urgh.  That function is a study in "what not to do while holding a spinlock".
Including "return without having unlocked it".

It is irreparable.