lkml.org 
[lkml]   [2002]   [Feb]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] 2.4.18 Eicon ISDN driver fix.
From
Date
On Tue, 2002-02-26 at 20:54, Dave Jones wrote:
> On Tue, Feb 26, 2002 at 08:26:18PM +0100, petter wahlman wrote:
> > +++ linux-2.4.18-pw/drivers/isdn/eicon/eicon_mod.c Mon Feb 25
>
> > - if (user)
> > + if (user) {
> > + spin_unlock_irqrestore(&eicon_lock,
> > flags);
> > copy_to_user(p, skb->data, cnt);
> > + spin_lock_irqsave(&eicon_lock, flags);
> > + }
>
> What happens if something else adds/removes to card->statq, or
> frees the skb after you drop the lock? I'm not familiar with
> this code, but from a quick look, it looks like this introduces
> a race no ?
>

Yes, it will introduce a new race.
I did not actually intend to send this unfinished patch, but fscked up
:)
Anyway, calling copy_to_user while holding a spinlock is defiantly a bad
idea.


> --
> | Dave Jones. http://www.codemonkey.org.uk
> | SuSE Labs
>

Petter Wahlman.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:24    [W:0.100 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site