Hi all, I'm sorry for my poor English.
I am a member of Kondara Project, we are providing a Linux
distribution. I found bugs of the linux kernel version 2.2.14 through
our bug tracking system.
- What happen?
When you enable promiscuous mode using the tcpdump command
provided by us, the ifconfig command displays wrong status. We noticed
that this problem caused by the linux kernel.
- Description
We are providing ipv6-enabled tcpdump tool. This tcpdump(libpcap)
calls setsockopt() to enter promiscuous mode as below:
/* snip */
mr.mr_type = promisc ? PACKET_MR_PROMISC : PACKET_MR_ALLMULTI;
if (setsockopt(p->fd, SOL_PACKET, PACKET_ADD_MEMBERSHIP,
(char *)&mr, sizeof(mr)) < 0) {
this setsockopt() call is handled in linux-2.2.14:
/* snip */
packet_dev_mc() net/packet/packet.c:892
dev_set_promiscuity() net/core/dev.c:1353
In the meanwhile, the original tcpdump calls ioctl() to enter
promiscuous mode as below:
/* snip */
ifr.ifr_flags |= IFF_PROMISC;
if (ioctl(p->fd, SIOCSIFFLAGS, &ifr) < 0 ) {
this ioctl() call is handled in linux-2.2.14:
/* snip */
dev_change_flags() net/core/dev.c:1396
dev_set_promiscuity() net/core/dev.c:1353
Thus, the dev_set_promiscuity() may be called by packet_dev_mc()
and dev_change_flags(), but the dev_change_flags() looks like
forgetting the existence of packet_dev_mc().
Concretely, the variable dev->gflags (which is concerned with
promiscuity settings) is changed on the out of dev_set_promiscuity(),
but then this variable is ignored in packet_dev_mc().
I checked kernel version 2.2.14, 2.2.15pre20, and 2.3.99pre6, but
this problem is not fixed yet.
- How to reproduce the bug
1. build tpcdump with ipv6 patch:
RPM packages:
http://www.kondara.org/rpm2html/TByName.html
tcpdump-3.4a6+ipv6-16k6.*.rpm
SRPM package:
http://www.kondara.org/ftplist.html
tcpdump-3.4a6+ipv6-16k6.nosrc.rpm
(it requires some sources)
Original Sources:
http://www.inner.net/pub/ipv6/tcpdump-3.4a6.tar.gz
http://www.inner.net/pub/ipv6/tcpdump-3.4a6+ipv6-1.diff.gz
http://www.inner.net/pub/ipv6/libpcap-0.4a6.tar.gz
http://www.inner.net/pub/ipv6/libpcap-0.4a6+ipv6-1.diff.gz
2. run tcpdump command; this means that the interface becomes
promiscuous mode.
3. run ifconfig command to check the interface's status.
"PROMISC" is NOT displayed...
- Patch
The followed patch is made for linux-2.2.15pre20. But it is
available for linux-2.2.14 and linux-2.3.99pre6 too.
- Check my patch, please!
Check my patch, please!
Thanks.
---- cut here ---- cut here ---- cut here ---- cut here ----
begin 644 linux-2.2.15pre20-promisc.patch.gz
M'XL("%>4"CD``VQI;G5X+3(N,BXQ-7!R93(P+7!R;VUI<V,N<&%T8V@`K9-O
M;YI0%,9?PZ<XR1*#!>2/4*V.3>.T,[&ZM'8O>\/P8F^&8+FP;)G=9]^]@`K:
M:9OL%>%RSG/._3T/JJI"0,+TIVHVS(9AKV-LZEJ($\V+8JPM\(^&)YBZKFNZ
MI9DMT(U.T^S8IF`T#%&6Y3<TMT&W.WJ[8U^Q9DOL]4`UFK:M7(&</0T+>CT1
MA#2D9!GB!=#'*$X@"A;(#]PE!0>8HOHA>^F*P$KW[[!Q8#P:H2^WLYOQW:`K
MJ@+Q09*RBG4<K0CU4I+\`MD!$GIU<!S0ZZ(LRGD=.\N/8+,YU?:>U]3A-QM>
MGEYSX$]EO%Q\+FNP5O[AF4V%;.I>X&%W2ZZ];5[FX@\'5X-WQ%]@'P:SZ6A\
MC:;#.1KU[^:WL_OYD.]5E:Z5>HO%!681*T"^2Y,X2A.,HF\T<;T`4UGN%LZT
M+A5#Y]:T#<6X_`_6]">3F_O)?%SUQ@V"51HDY"W&'/6<<>5P\HO<=]1WZB6_
MY%?Y5;%K/S1?"JT\E*Z#R%UPG7JN#,\<%@D3S@]YCVZXQ+FNQ*Q)O>R<>!@N
MV%.!'?]BY<PIRS25-C/*:C:55NZ3$$8)\0F.D<=NPW5)*-4*U[,W!5AL/@V_
MHL'G_O1ZJ$"^$Q3)E/);EE)8/\R1RH+&]L[\`>F%J'UD.T&'+<BQGPRT_$HI
M?<>2X@25?BTIH\.CP"LXTYQ,LR!CF5LR`!5S@%"(\5.*:<*H,FK@TN\D7$)*
MP0WSDQBO6=C988/W7VAG$&VE3S':UYR%M(_1OR@=B54Q;>-\S.@O>F&VY?P%
"````
`
end
---- cut here ---- cut here ---- cut here ---- cut here ----
--
Tatsuo Sekine:
[EMAIL PROTECTED] (private) ISOTERNET ASSOCIATION JAPAN
[EMAIL PROTECTED] (business) System Design & Research Inst. Co.,Ltd.
[EMAIL PROTECTED] (Kondara MNU/Linux) Kondara Project
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]