All of lore.kernel.org
 help / color / mirror / Atom feed
* moe infos...
@ 2005-11-15  0:39 Bernd Zeimetz
  2005-11-15  0:46 ` Bernd Zeimetz
  2005-11-15 16:15 ` BUG: iptables -j does not work for chains with a length >=28 (was moe infos...) Bernd Zeimetz
  0 siblings, 2 replies; 5+ messages in thread
From: Bernd Zeimetz @ 2005-11-15  0:39 UTC (permalink / raw)
  To: netfilter-devel; +Cc: 327007

Hi,

I've run into this bug today, which is allready listed as 327007 on 
bugs.debian.org

0 think:~# iptables -N 123456789012345678901234567
0 think:~# iptables -A FORWARD -j 123456789012345678901234567
0 think:~# iptables -N 1234567890123456789012345678
0 think:~# iptables -A FORWARD -j 1234567890123456789012345678
0 think:~# iptables -N 12345678901234567890123456789
0 think:~# iptables -A FORWARD -j 12345678901234567890123456789
0 think:~# iptables -N 12345678901234567890abcdefg
0 think:~# iptables -A FORWARD -j 12345678901234567890abcdefg
0 think:~# iptables -N 12345678901234567890abcdefgh
0 think:~# iptables -A FORWARD -j 12345678901234567890abcdefgh
0 think:~# iptables -N 12345678901234567890abcdefghi
0 think:~# iptables -A FORWARD -j 12345678901234567890abcdefghi
0 think:~# iptables -N 12345678901234567890abcdefghij
0 think:~# iptables -A FORWARD -j 12345678901234567890abcdefghij
1 think:~# iptables -N 1234567890123456789zabcdefghij
0 think:~# iptables -A FORWARD -j 1234567890123456789zabcdefghij
iptables: No chain/target/match by that name
0 think:~# iptables -N abcde678901234567890abcdefghij
0 think:~# iptables -A FORWARD -j abcde678901234567890abcdefghij
iptables: No chain/target/match by that name
1 think:~# iptables -N abcdesdasdasdfafasfaabcdefghij
0 think:~# iptables -A FORWARD -j abcdesdasdasdfafasfaabcdefghij
iptables: No chain/target/match by that name
1 think:~# iptables -N 0bcdesdasdasdfafasfaabcdefghij
0 think:~# iptables -A FORWARD -j 0bcdesdasdasdfafasfaabcdefghij
iptables: No chain/target/match by that name
1 think:~# iptables -N 0bcdesdasdasdfafasfaabcdefghi
0 think:~# iptables -A FORWARD -j 0bcdesdasdasdfafasfaabcdefghi
iptables: No chain/target/match by that name
1 think:~# iptables -N 0bcdesdasdasdfafasfaabcdefgh
0 think:~# iptables -A FORWARD -j 0bcdesdasdasdfafasfaabcdefgh


As you can see the bug does not happen for chains
- with a length <=28
- with a name containing only numbers
- with a name beginning with numbers and having less than ~11 letters at the 
end.

The interesting part comes now:

iptables -N 123456789012345678yzabcdefgh
and this works:
iptables -A FORWARD -j 123456789012345678yzabcdefghij

The bug takes place during the call of
set_revision(target->t->u.user.name, target->revision); // iptables.c:2397

(which is in the part starting with
              /* If they didn't specify a target, or it's a chain
                   name, use standard. */
                if (!target
                    && (strlen(jumpto) == 0
                        || iptc_is_chain(jumpto, *handle))) 
-- just to make sure you'll find the right one)


Obviously the problem  is in this function:
static void set_revision(char *name, u_int8_t revision)
{
        /* Old kernel sources don't have ".revision" field,
           but we stole a byte from name. */
        name[IPT_FUNCTION_MAXNAMELEN - 2] = '\0';
        name[IPT_FUNCTION_MAXNAMELEN - 1] = revision;
}

As a workaround a return 0; on top of set_revision works, but I'm not sure if 
this opens other bugs because I have no clue what this function is (was!?) 
for - and to speak the truth - I'm too lazy to work myself trough the whole 
code to understand what it does ;)

Hope somebody can fix that :)


Best regards!


Bernd Zeimetz

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-11-17 12:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-15  0:39 moe infos Bernd Zeimetz
2005-11-15  0:46 ` Bernd Zeimetz
2005-11-15 16:15 ` BUG: iptables -j does not work for chains with a length >=28 (was moe infos...) Bernd Zeimetz
2005-11-15 17:46   ` Bug#327007: " Pablo Neira
2005-11-17 12:50     ` Harald Welte

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.