mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: Al Viro <viro@ftp.linux.org.uk>
Cc: Eugene Teo <eteo@redhat.com>,
	lksctp-developers@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: [2.6 patch] net/sctp/socket.c: add missing sctp_spin_unlock_irqrestore
Date: Sun, 26 Nov 2006 11:19:12 +0100	[thread overview]
Message-ID: <1164536353.3147.70.camel@laptopd505.fenrus.org> (raw)
In-Reply-To: <20061126101254.GW3078@ftp.linux.org.uk>

On Sun, 2006-11-26 at 10:12 +0000, Al Viro wrote:
> 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 ;-/
> -

do your patches also remove the empty abstraction of the sctp_ prefix
around the spinlock use in sctp ?


-- 
if you want to mail me at work (you don't), use arjan (at) linux.intel.com
Test the interaction between Linux and your BIOS via http://www.linuxfirmwarekit.org


  reply	other threads:[~2006-11-26 10:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-26 10:00 Eugene Teo
2006-11-26 10:12 ` Al Viro
2006-11-26 10:19   ` Arjan van de Ven [this message]
2006-11-26 12:37   ` Eugene Teo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1164536353.3147.70.camel@laptopd505.fenrus.org \
    --to=arjan@infradead.org \
    --cc=eteo@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lksctp-developers@lists.sourceforge.net \
    --cc=viro@ftp.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®