lkml.org 
[lkml]   [2003]   [Oct]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: irda weirdness
On Mon, 6 Oct 2003, Patrick McHardy wrote:

> Not sure about this but I think the problem might lie in ircomm_tty_write:
>
> spin_lock_irqsave(&self->spinlock, flags);
> ...
> /* Copy data */
> if (from_user)
> copy_from_user(skb_put(skb,size), buf+len, size);
> else
> memcpy(skb_put(skb,size), buf+len, size);
> ...
> spin_unlock_irqrestore(&self->spinlock, flags);
>
> asm/uaccess.h:498 is might_sleep() in copy_from_user() in my tree so this
> might be it. No fix though, I just noticed this bug some time ago and
> completly forgot about it until now.

Good catch, that's definitedly a bug and probably at least one trigger in
Mikko's case.

Jean, I'm not familiar with ircomm so I'm not sure how to fix this. Do you
know what the spinlock is expected to protect here? If it's only to avoid
self->tx_skb getting changed below us I think it might be sufficient to
drop the spinlock during copy_from_user?

Martin

-
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:49    [W:0.081 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site