Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760517AbXLPH5D (ORCPT ); Sun, 16 Dec 2007 02:57:03 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754696AbXLPH4v (ORCPT ); Sun, 16 Dec 2007 02:56:51 -0500 Received: from smtp2.linux-foundation.org ([207.189.120.14]:47944 "EHLO smtp2.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754164AbXLPH4u (ORCPT ); Sun, 16 Dec 2007 02:56:50 -0500 Date: Sat, 15 Dec 2007 23:56:04 -0800 From: Andrew Morton To: "Miles Lane" Cc: Herbert Xu , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: Fw: [PACKET]: Fix /proc/net/packet crash due to bogus private pointer Message-Id: <20071215235604.1a3f970a.akpm@linux-foundation.org> In-Reply-To: References: <20071215203637.179878aa.akpm@linux-foundation.org> X-Mailer: Sylpheed 2.4.1 (GTK+ 2.8.17; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3306 Lines: 83 On Sun, 16 Dec 2007 01:37:01 -0500 "Miles Lane" wrote: > argh, please don't use linux-net. It's basically dead afaik. Suitable ccs restored. > > On Sun, Dec 16, 2007 at 11:07:07AM +0800, Herbert Xu wrote: > > > > > > I suspect namespace borkage. But just because you pin-pointed > > > my patch I'll try to track it down :) > > > > Surprise surprise. The namespace seq patch missed two spots in > > AF_PACKET. > > > > [PACKET]: Fix /proc/net/packet crash due to bogus private pointer > > > > The seq_open_net patch changed the meaning of seq->private. > > Unfortunately it missed two spots in AF_PACKET, which still > > used the old way of dereferencing seq->private, thus causing > > weird and wonderful crashes when reading /proc/net/packet. > > > > This patch fixes them. > > > > Signed-off-by: Herbert Xu > > > > diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c > > index 485af56..43e49f4 100644 > > --- a/net/packet/af_packet.c > > +++ b/net/packet/af_packet.c > > @@ -1878,7 +1878,7 @@ static void *packet_seq_start(struct seq_file *seq, loff_t *pos) > > > > static void *packet_seq_next(struct seq_file *seq, void *v, loff_t *pos) > > { > > - struct net *net = seq->private; > > + struct net *net = seq_file_net(seq); > > ++*pos; > > return (v == SEQ_START_TOKEN) > > ? sk_head(&net->packet.sklist) > > @@ -1887,7 +1887,7 @@ static void *packet_seq_next(struct seq_file *seq, void *v, loff_t *pos) > > > > static void packet_seq_stop(struct seq_file *seq, void *v) > > { > > - struct net *net = seq->private; > > + struct net *net = seq_file_net(seq); > > read_unlock(&net->packet.sklist_lock); > > } > > > > ... > > > Hmm. I tried compiling again with this patch applied and lockdep > turned back on, and got the following (I will try again with lockdep > turned back off): > > Dec 15 13:44:39 syntropy kernel: process `cat' is using deprecated > sysctl (syscall) net.ipv6.neigh.default.retrans_time; Use > net.ipv6.neigh.default.retrans_time_ms instead. > Dec 15 13:44:39 syntropy kernel: > Dec 15 13:44:39 syntropy kernel: ===================================== > Dec 15 13:44:39 syntropy kernel: [ BUG: bad unlock balance detected! ] > Dec 15 13:44:39 syntropy kernel: ------------------------------------- > Dec 15 13:44:39 syntropy kernel: cat/4819 is trying to release lock > (kkkkkkkȦ) at: > Dec 15 13:44:39 syntropy kernel: [packet_seq_stop+0xe/0x10] > packet_seq_stop+0xe/0x10 > Dec 15 13:44:39 syntropy kernel: but there are no more locks to release! > Dec 15 13:44:39 syntropy kernel: > Dec 15 13:44:39 syntropy kernel: other info that might help us debug this: > Dec 15 13:44:39 syntropy kernel: 2 locks held by cat/4819: > Dec 15 13:44:39 syntropy kernel: #0: (&p->lock){--..}, at: > [crypto_algapi:seq_read+0x25/0x191c1] seq_read+0x25/0x26f So your kernel is still feeding garbage into lockdep. Are you really really sure that kernel had Herbert's patch applied? -- 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/