Re: [2.6 patch] net/sctp/socket.c: add missing sctp_spin_unlock_irqrestore

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Nov 26, 2006 at 06:00:53PM +0800, Eugene Teo wrote:
> This patch adds a missing sctp_spin_unlock_irqrestore when returning
> from "if(space_left<addrlen)" condition.
>                 if (copy_to_user(*to, &temp, addrlen)) {
> -                       sctp_spin_unlock_irqrestore(&sctp_local_addr_lock,
> -                                                   flags);
> -                       return -EFAULT;
> +                       err = -EFAULT;
> +                       goto unlock;

> +       sctp_spin_unlock_irqrestore(&sctp_local_addr_lock, flags);
> +       return err;
>  }

You do realize that it's obviously still badly broken, don't you?
copy_to_user() under a spinlock is a recipe for deadlock, especially
if you've got interrupts disabled...

I have a beginning of locking fixes in that shitpile, but it's incomplete
and bloody painful ;-/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux