From: David Miller Subject: Re: [Bugme-new] [Bug 8342] New: sctp_getsockopt_local_addrs_old() calls copy_to_user() while a spinlock is held Date: Wed, 25 Apr 2007 21:54:05 -0700 (PDT) Message-ID: <20070425.215405.110014911.davem@davemloft.net> References: <200704162134.l3GLYMuF004745@fire-2.osdl.org> <20070420143500.cdac0fab.akpm@linux-foundation.org> <462CF047.3050809@hp.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: akpm@linux-foundation.org, netdev@vger.kernel.org, bugme-daemon@bugzilla.kernel.org, matthias.kaehlcke@gmail.com, lksctp-developers@lists.sourceforge.net To: vladislav.yasevich@hp.com Return-path: Received: from 74-93-104-97-Washington.hfc.comcastbusiness.net ([74.93.104.97]:41168 "EHLO sunset.davemloft.net" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1754421AbXDZEx6 (ORCPT ); Thu, 26 Apr 2007 00:53:58 -0400 In-Reply-To: <462CF047.3050809@hp.com> Sender: netdev-owner@vger.kernel.org List-Id: netdev.vger.kernel.org From: Vlad Yasevich Date: Mon, 23 Apr 2007 13:43:35 -0400 > [PATCH] [SCTP] Fix sctp_getsockopt_local_addrs_old() to use local storage > > sctp_getsockopt_local_addrs_old() in net/sctp/socket.c calls copy_to_user() > while the spinlock addr_lock is held. this should not be done as copy_to_user() > might sleep. the call to sctp_copy_laddrs_to_user() while holding the lock is > also problematic as it calls copy_to_user() > > Signed-off-by: Vlad Yasevich As Andrew Morton just noticed and fixed in -mm, you're passing in int pointers to arguments that should be size_t pointers, specifically for some of the calls to sctp_copy_laddrs(). Please fix this, and please start testing builds on 64-bit platforms (even if via cross compile) so that you can catch these as the warnings generated by the compiler on this one were obvious.