Skip to contentSkip to conversation

serious problem with 2.4.24 combined with KVM switch (fwd)

Cybr.rdsw Ian Latter 2 participants 2 messages Feb 6, 2004 netfilter

lore
Share & tools
lore

Ian Latter

author
#0 lore raw

Hello Oliver,

For tftp broadcasts to be in use, I'd assume that this is a network
bootstrapping scenario - where the TFTP RRQ is broadcast, and where multiple servers are permitted to respond (TFTP DATA/ACK)

Is it possible that the Netfilter expectation is being satisfied by one
response (server sending back a TFTP DATA), then being satisfied again, by another?

You said below;

Quoted 9 lines

The problem occurs when:
- a client broadcasts a tftp request, with source IP 192.168.160.255
- server in the same physical network, but logical network 192.168.10.0/24 replies
- the reply is routed through the gateway (which has an alias IP 192.168.160.1 netmask /24 on the same physical network, if this is relevant)
- gateway blocks with REJECT. This message ist still in the logs, but soon after that the kernel panics.

While it shouldn't crash (regardless), it should also not be activating
the helper and REJECTing. Is it possible the the REJECT log entry is
on an INPUT rule, while the helper is being triggered on a PREROUTING rule, due to the architecture of the network you've described (or vice versa)?

Regards,

----- Original Message -----

Quoted 3 lines

From: "Oliver Kurth" <[email protected]>
To: "Harald Welte" <[email protected]>
Subject: Re: [Cybr.rdsw] [Cy.rdsw] serious problem with 2.4.24 combined with KVM

switch (fwd)

Quoted 109 lines

Date: Wed, 04 Feb 2004 15:05:53 +0100

Quoted 20 lines · Harald Welte
Quoted 6 lines · Oliver Kurth

Hi Harald,

Quoted 2 lines
Quoted 2 lines

We are having a problem with 2.4.24 on cyclades germany, the box (firewall) is crashing in the netfilter code.

Anything new about that problem? Do you need more information?

sorry, I lost that issue because I'm extremely overloaded at the moment.

It seems like it crashes in the following piece of code (from ip_conntrack_core.c)

        /* If the expectation is dying, then this is a looser. */
        if (expected
            && expected->expectant->helper->timeout
            && !del_timer(&expected->timeout))
                expected = NULL;
Quoted 4 lines

To be more precise, it cannot dereference helper->timeout, since helper is NULL. I am extremely puzzled how you would end up with a conntrack expectation (which can only be caused by a helper) that has not assigned a helper.

I looked over the code, and could not find anything either, but I am not familar with it at all.

Quoted 2 lines

Could you please tell me, which conntrack and/or NAT helpers you were using on that machine?

The problem occurs when:
- a client broadcasts a tftp request, with source IP 192.168.160.255
- server in the same physical network, but logical network 192.168.10.0/24 replies
- the reply is routed through the gateway (which has an alias IP 192.168.160.1 netmask /24 on the same physical network, if this is relevant)
- gateway blocks with REJECT. This message ist still in the logs, but soon after that the kernel panics.

So, if a helper is causing the problem, it is probably the tftp helper. It may also be related to the problem that the client IP is ending with ..255, which is the broadcast address for the gateway on that network.

I can send the firewall rules to you in a private mail, if you need it.

This is an ecxcerpt of .config:

#
# IP: Netfilter Configuration
#
CONFIG_IP_NF_CONNTRACK=y
CONFIG_IP_NF_FTP=y
CONFIG_IP_NF_AMANDA=y
CONFIG_IP_NF_TFTP=y
CONFIG_IP_NF_IRC=y
# CONFIG_IP_NF_QUEUE is not set
CONFIG_IP_NF_IPTABLES=y
CONFIG_IP_NF_MATCH_LIMIT=y
CONFIG_IP_NF_MATCH_MAC=y
CONFIG_IP_NF_MATCH_PKTTYPE=y
CONFIG_IP_NF_MATCH_MARK=y
CONFIG_IP_NF_MATCH_MULTIPORT=y
CONFIG_IP_NF_MATCH_TOS=y
CONFIG_IP_NF_MATCH_RECENT=y
CONFIG_IP_NF_MATCH_ECN=y
CONFIG_IP_NF_MATCH_DSCP=y
CONFIG_IP_NF_MATCH_AH_ESP=y
CONFIG_IP_NF_MATCH_LENGTH=y
CONFIG_IP_NF_MATCH_TTL=y
CONFIG_IP_NF_MATCH_TCPMSS=y
CONFIG_IP_NF_MATCH_HELPER=y
CONFIG_IP_NF_MATCH_STATE=y
CONFIG_IP_NF_MATCH_CONNTRACK=y
# CONFIG_IP_NF_MATCH_UNCLEAN is not set
# CONFIG_IP_NF_MATCH_OWNER is not set
CONFIG_IP_NF_FILTER=y
CONFIG_IP_NF_TARGET_REJECT=y
# CONFIG_IP_NF_TARGET_MIRROR is not set
CONFIG_IP_NF_NAT=y
CONFIG_IP_NF_NAT_NEEDED=y
CONFIG_IP_NF_TARGET_MASQUERADE=y
CONFIG_IP_NF_TARGET_REDIRECT=y
CONFIG_IP_NF_NAT_AMANDA=y
# CONFIG_IP_NF_NAT_LOCAL is not set
# CONFIG_IP_NF_NAT_SNMP_BASIC is not set
CONFIG_IP_NF_NAT_IRC=y
CONFIG_IP_NF_NAT_FTP=y
CONFIG_IP_NF_NAT_TFTP=y
CONFIG_IP_NF_MANGLE=y
CONFIG_IP_NF_TARGET_TOS=y
CONFIG_IP_NF_TARGET_ECN=y
CONFIG_IP_NF_TARGET_DSCP=y
CONFIG_IP_NF_TARGET_MARK=y
CONFIG_IP_NF_TARGET_LOG=y
CONFIG_IP_NF_TARGET_ULOG=y
CONFIG_IP_NF_TARGET_TCPMSS=y
# CONFIG_IP_NF_ARPTABLES is not set

Quoted 6 lines

We haven't had something like this before.

As a workaround, you could add an additional check into that piece of code. At least it won't oops anymore, although it is still unclear how you end up with this kind of situation.

Quoted 16 lines
Quoted 5 lines

if (expected

    && expected->expectant->helper
    && expected->expectant->helper->timeout
    && !del_timer(&expected->timeout))
        expected = NULL;

Greetings,
Oliver

Signature · 4 lines
Cyclades GmbH                       -              Everywhere with Linux
Oliver Kurth                                               Cyclades GmbH
Research & Development                                        Rennweg 33
Fon/Fax: +49 (0) 8122 90999-34/-33                        D-85435 Erding

--
Ian Latter
Internet and Networking Security Officer
Macquarie University

Meet me at the Australian Unix and open systems
User Group (AUUG) Security Symposium; 2004
http://www.auug.org.au/events/2004/security/

#1 lore raw
Quoted 5 lines · Ian Latter

Hello Oliver,

For tftp broadcasts to be in use, I'd assume that this is a network
bootstrapping scenario - where the TFTP RRQ is broadcast, and where multiple servers are permitted to respond (TFTP DATA/ACK)

Right.

Quoted 3 lines

Is it possible that the Netfilter expectation is being satisfied by one
response (server sending back a TFTP DATA), then being satisfied again, by another?

Yes, this is possible. We have more than one tftp server here. Though in a test scenario we switched off all but one (and the gateway crashed), but maybe we missed one.

Quoted 13 lines

You said below;

Quoted 9 lines

The problem occurs when:
- a client broadcasts a tftp request, with source IP 192.168.160.255
- server in the same physical network, but logical network 192.168.10.0/24 replies
- the reply is routed through the gateway (which has an alias IP 192.168.160.1 netmask /24 on the same physical network, if this is relevant)
- gateway blocks with REJECT. This message ist still in the logs, but soon after that the kernel panics.

Quoted 5 lines

While it shouldn't crash (regardless), it should also not be activating
the helper and REJECTing. Is it possible the the REJECT log entry is
on an INPUT rule, while the helper is being triggered on a PREROUTING rule, due to the architecture of the network you've described (or vice versa)?

The REJECT is in an INPUT rule. But I do not think that a PREROUTING rule is involved. I just looked at the rules, and PREROUTING is only done for other physical networks.

Greetings,
Oliver

Quoted 140 lines

----- Original Message -----

Quoted 3 lines

From: "Oliver Kurth" <[email protected]>
To: "Harald Welte" <[email protected]>
Subject: Re: [Cybr.rdsw] [Cy.rdsw] serious problem with 2.4.24 combined with KVM

switch (fwd)

Quoted 109 lines

Date: Wed, 04 Feb 2004 15:05:53 +0100

Quoted 20 lines · Harald Welte
Quoted 6 lines · Oliver Kurth

Hi Harald,

Quoted 2 lines
Quoted 2 lines

We are having a problem with 2.4.24 on cyclades germany, the box (firewall) is crashing in the netfilter code.

Anything new about that problem? Do you need more information?

sorry, I lost that issue because I'm extremely overloaded at the moment.

It seems like it crashes in the following piece of code (from ip_conntrack_core.c)

        /* If the expectation is dying, then this is a looser. */
        if (expected
            && expected->expectant->helper->timeout
            && !del_timer(&expected->timeout))
                expected = NULL;
Quoted 4 lines

To be more precise, it cannot dereference helper->timeout, since helper is NULL. I am extremely puzzled how you would end up with a conntrack expectation (which can only be caused by a helper) that has not assigned a helper.

I looked over the code, and could not find anything either, but I am not familar with it at all.

Quoted 2 lines

Could you please tell me, which conntrack and/or NAT helpers you were using on that machine?

The problem occurs when:
- a client broadcasts a tftp request, with source IP 192.168.160.255
- server in the same physical network, but logical network 192.168.10.0/24 replies
- the reply is routed through the gateway (which has an alias IP 192.168.160.1 netmask /24 on the same physical network, if this is relevant)
- gateway blocks with REJECT. This message ist still in the logs, but soon after that the kernel panics.

So, if a helper is causing the problem, it is probably the tftp helper. It may also be related to the problem that the client IP is ending with ..255, which is the broadcast address for the gateway on that network.

I can send the firewall rules to you in a private mail, if you need it.

This is an ecxcerpt of .config:

#
# IP: Netfilter Configuration
#
CONFIG_IP_NF_CONNTRACK=y
CONFIG_IP_NF_FTP=y
CONFIG_IP_NF_AMANDA=y
CONFIG_IP_NF_TFTP=y
CONFIG_IP_NF_IRC=y
# CONFIG_IP_NF_QUEUE is not set
CONFIG_IP_NF_IPTABLES=y
CONFIG_IP_NF_MATCH_LIMIT=y
CONFIG_IP_NF_MATCH_MAC=y
CONFIG_IP_NF_MATCH_PKTTYPE=y
CONFIG_IP_NF_MATCH_MARK=y
CONFIG_IP_NF_MATCH_MULTIPORT=y
CONFIG_IP_NF_MATCH_TOS=y
CONFIG_IP_NF_MATCH_RECENT=y
CONFIG_IP_NF_MATCH_ECN=y
CONFIG_IP_NF_MATCH_DSCP=y
CONFIG_IP_NF_MATCH_AH_ESP=y
CONFIG_IP_NF_MATCH_LENGTH=y
CONFIG_IP_NF_MATCH_TTL=y
CONFIG_IP_NF_MATCH_TCPMSS=y
CONFIG_IP_NF_MATCH_HELPER=y
CONFIG_IP_NF_MATCH_STATE=y
CONFIG_IP_NF_MATCH_CONNTRACK=y
# CONFIG_IP_NF_MATCH_UNCLEAN is not set
# CONFIG_IP_NF_MATCH_OWNER is not set
CONFIG_IP_NF_FILTER=y
CONFIG_IP_NF_TARGET_REJECT=y
# CONFIG_IP_NF_TARGET_MIRROR is not set
CONFIG_IP_NF_NAT=y
CONFIG_IP_NF_NAT_NEEDED=y
CONFIG_IP_NF_TARGET_MASQUERADE=y
CONFIG_IP_NF_TARGET_REDIRECT=y
CONFIG_IP_NF_NAT_AMANDA=y
# CONFIG_IP_NF_NAT_LOCAL is not set
# CONFIG_IP_NF_NAT_SNMP_BASIC is not set
CONFIG_IP_NF_NAT_IRC=y
CONFIG_IP_NF_NAT_FTP=y
CONFIG_IP_NF_NAT_TFTP=y
CONFIG_IP_NF_MANGLE=y
CONFIG_IP_NF_TARGET_TOS=y
CONFIG_IP_NF_TARGET_ECN=y
CONFIG_IP_NF_TARGET_DSCP=y
CONFIG_IP_NF_TARGET_MARK=y
CONFIG_IP_NF_TARGET_LOG=y
CONFIG_IP_NF_TARGET_ULOG=y
CONFIG_IP_NF_TARGET_TCPMSS=y
# CONFIG_IP_NF_ARPTABLES is not set

Quoted 6 lines

We haven't had something like this before.

As a workaround, you could add an additional check into that piece of code. At least it won't oops anymore, although it is still unclear how you end up with this kind of situation.

Quoted 16 lines
Quoted 5 lines

if (expected

    && expected->expectant->helper
    && expected->expectant->helper->timeout
    && !del_timer(&expected->timeout))
        expected = NULL;

Greetings,
Oliver

Signature · 4 lines
Cyclades GmbH                       -              Everywhere with Linux
Oliver Kurth                                               Cyclades GmbH
Research & Development                                        Rennweg 33
Fon/Fax: +49 (0) 8122 90999-34/-33                        D-85435 Erding

--
Ian Latter
Internet and Networking Security Officer
Macquarie University

Meet me at the Australian Unix and open systems
User Group (AUUG) Security Symposium; 2004
http://www.auug.org.au/events/2004/security/

Signature · 4 lines
Cyclades GmbH                       -              Everywhere with Linux
Oliver Kurth                                               Cyclades GmbH
Research & Development                                        Rennweg 33
Fon/Fax: +49 (0) 8122 90999-34/-33                        D-85435 Erding