Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sat, 30 Nov 2002 10:29:52 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sat, 30 Nov 2002 10:29:52 -0500 Received: from orion.netbank.com.br ([200.203.199.90]:56077 "EHLO orion.netbank.com.br") by vger.kernel.org with ESMTP id ; Sat, 30 Nov 2002 10:29:51 -0500 Date: Sat, 30 Nov 2002 13:36:00 -0200 From: Arnaldo Carvalho de Melo To: "David S. Miller" Cc: Serge Kuznetsov , Linux Kernel Mailing List Subject: [PATCH] arp: fix seq_file handling bug Message-ID: <20021130153600.GF30931@conectiva.com.br> Mail-Followup-To: Arnaldo Carvalho de Melo , "David S. Miller" , Serge Kuznetsov , Linux Kernel Mailing List Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-Url: http://advogato.org/person/acme Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2995 Lines: 82 Hi David, Please pull from: bk://kernel.bkbits.net/acme/net-2.5 Now there is just this outstanding changeset. Now I have some time to devote to fixing /proc/net/tcp seq_file handling. - Arnaldo You can import this changeset into BK by piping this whole message to: '| bk receive [path to repository]' or apply the patch as usual. =================================================================== ChangeSet@1.864, 2002-11-30 13:30:49-02:00, acme@conectiva.com.br o arp: fix seq_file handling bug When midnigth commander viewer is invoked it first opens the file, read 4 bytes (probably looking for a magic number), reading only 4 bytes makes state->is_pneigh not to be set neither the lock is taken, because only the header is being produced (v = (void *)1), so when arp_seq_stop is called the lock is dropped without having being taken: b00m Thanks to Serge Kuznetsov for reporting this to me. Other seq_file code may have this problem, but by using mc viewer in all of /proc/net I haven't been able to reproduce this problem with any other file. arp.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -Nru a/net/ipv4/arp.c b/net/ipv4/arp.c --- a/net/ipv4/arp.c Sat Nov 30 13:31:52 2002 +++ b/net/ipv4/arp.c Sat Nov 30 13:31:52 2002 @@ -1282,7 +1282,7 @@ { struct arp_iter_state* state = seq->private; - if (!state->is_pneigh) + if (!state->is_pneigh && v != (void *)1) read_unlock_bh(&arp_tbl.lock); } =================================================================== This BitKeeper patch contains the following changesets: 1.864 ## Wrapped with gzip_uu ## begin 664 bkpatch432 M'XL(`.G9Z#T``^U6[V_;-A#];/X55Q3HTJV62?V*+=`?OZ.\I&D:(%BQ+P-J"Q9`WKU[]\A[\%/XX-`6,ZE:9$_A M)^-\,5.F0^7U("-EVJBTM'%I#&TL:M/BXM7YHD,_CZ.,TRV^)[]+!>,V_L()O*G4E?-Z:+O)6=:]%/ M-LD#_[#[M>RA"Q!D7(LOB M,1-IG+`W(")*!AXOA%@D'$12)+Q(5W,>%YS#@Z#PG8`Y9Z_@OVW@-5-@0-J^ M@(W^$QS^<;71#0+!5(WNME#NMQ1"SZ\U=M#JJM-;7P/5:BD$+0P:K^FE'>AN M,#NL0'O"LLZ#Z;%SX&N$@/D"+,J*D%(H#QX=G/36E+)L#M`8LPO%-L:"A%9N MM8)NWY9HGQ^SPJ;I*/(FMY4[=(3EO/0X?ZG=5=^AWM;0&4\208G4BP=:H_)V MXM`8M0LT/:5V+RA"R;W#"9:`0D1-E8ZME!@J$K]JKZBCDP'6]&-T!=\^%\3) M&;@.>I!P5T$SYTT?\@A(R::AE+L5*VOZGM:NB8S9>Q)WF*2=BDQT"B@Y;X]" M_T+:[UQHXCW:+<+Y_B^Z]LX,DSP6>V/]E%CK*:K%"-Y-7=Z<7F!A*B21#J$6 M'D.#V@VVU#E1*`^P=P&E5;