Skip to contentSkip to conversation

arp: fix seq_file handling bug

PATCH In review Arnaldo Carvalho de Melo 2 participants 3 messages Nov 30, 2002 – Dec 2, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arp: fix seq_file handling bug

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.

===================================================================

[email protected], 2002-11-30 13:30:49-02:00, [email protected]
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(-)
net/ipv4/arp.c +1 -1
diff -Nru a/net/ipv4/arp.c b/net/ipv4/arp.c
@@ -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*+<!%UG;8B@QHD*[8AV$( M*.IL$99$C:25>=?OZ.\I&D:(%BQ+P-J"Q9WKU[]\A[\%/XX-6,ZE:9$_A M)^-\,5.F0^7U("-EVJBTM'%I#&TL:M/BXM7YHD,_CZ.,T<Z%]*J&:TK9B)* M;E?\H<=B=OG#CQ]^_OZ2L?4:7M>RV^)[]+!>,V_L()O*G4E?-Z:+O)6=:]%/ M-<?;T#'F/*9O)DX3GN6CR'EZ.BI1"2%3@16/TV6>LD#_[#[M>RA"Q!D7(LOB M,1-IG+W(")*!AXOA%@D'$12)+Q(5W,>%YS#@Z#PG8Y9Z_@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#M8LPO%-L:"A%9N MM8)NWY9HGQ^SPJ;I*/(FMY4[=(3EO/0X?ZG=5=^AWM;0&4\208G4BP=:H_)V MXM8M0LT/: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;<G2.TT#9@-+"A4A5DCH+<30O<-I6!HF"!"4:)Q M%.<3[*E#D-T!S$0HD(G8.="]SV)V\7$2V?Q??ACCDK.7C]Q^HKS0_9NZ%PB M=7<$5MERC/-,K$9,EDE*:JM8X6:59P^/VT-00B1<9E/\S%/LRR;S.73N,<= MYDLHLEK59XWS486_W:#__C!#<2J6G-B->4*F,UF-./W,:?)'G49\=9JO3O,_ M=)KC8+Z#N;V>'G*.BWLS^@7>\T;$RPP$>_O/>Z8W</+DLQOQ[!D,\.3N^7W\
9HZ)J5#NW;]=EG*]4OERQOP'A\EZ(`PD`````
`
end

#1 lore raw

From: Arnaldo Carvalho de Melo <[email protected]>
Date: Sat, 30 Nov 2002 13:36:00 -0200

Please pull from:

bk://kernel.bkbits.net/acme/net-2.5

Pulled, thanks.

Now there is just this outstanding changeset. Now I have
some time to devote to fixing /proc/net/tcp seq_file handling.

Please let me know once you have this fixed, as it is holding up my net merges :-)

#2 lore raw

Em Sun, Dec 01, 2002 at 11:41:28PM -0800, David S. Miller escreveu:

Quoted 7 lines

From: Arnaldo Carvalho de Melo <[email protected]>

Now there is just this outstanding changeset. Now I have
some time to devote to fixing /proc/net/tcp seq_file handling.

Please let me know once you have this fixed, as it is holding up my net merges :-)

I'll do, I was quite busy with Real Life(tm), but I'm back trying to reproduce this one here at home, but failed to do so, I telnetted to another machine and the ESTABLISHED connection was correctly shown, so I'll be testing on a busier machine at the office, not on vmware.

- Arnaldo