Skip to contentSkip to conversation

2.6.23-rc1: ipv4_get_l4proto: Frag of proto 17

DISCUSSION Indan Zupancic 4 participants 14 messages Jul 24, 2007 – Jul 26, 2007 1 message not in the archive netfilter

lore
Share & tools
lore
#0 lore raw

Hello,

After reading the "Never happen" comment in the code, I thought it wasn't too silly to mention that it apparently does happen. Never saw the message before, hence this mail. This happened on a machine doing SNAT for another pc, so conntrack may be involved.

The three errors happen within 1.5 seconds of each other:

[17834.377955] ipv4_get_l4proto: Frag of proto 17
[17835.358985] ipv4_get_l4proto: Frag of proto 17
[17835.872457] ipv4_get_l4proto: Frag of proto 17

As this seems to be an incident, I've no idea how to debug it, nor whether it's worth debugging. If this can be caused by a peer sending a bad packet I'd ignore this report.

If this is serious enough to be reported, perhaps it should be a BUG?

Greetings,

Indan

P.S. Netfilter's bugzilla gives an error when the search function is used.

#1 lore raw
Quoted 13 lines · Indan Zupancic

Hello,

After reading the "Never happen" comment in the code, I thought it wasn't too silly to mention that it apparently does happen. Never saw the message before, hence this mail. This happened on a machine doing SNAT for another pc, so conntrack may be involved.

The three errors happen within 1.5 seconds of each other:

[17834.377955] ipv4_get_l4proto: Frag of proto 17
[17835.358985] ipv4_get_l4proto: Frag of proto 17
[17835.872457] ipv4_get_l4proto: Frag of proto 17
Quoted 5 lines

As this seems to be an incident, I've no idea how to debug it, nor whether it's worth debugging. If this can be caused by a peer sending a bad packet I'd ignore this report.

If this is serious enough to be reported, perhaps it should be a BUG?

It should not be serious, the packets are simply dropped.

Did it perhaps happen directly after nf_conntrack_ipv4 module load? Otherwise I think it might happen on loopback if you manually send to large packets or possibly with NOTRACK. Any chance you're doing anything of that?

#2 lore raw
Quoted 14 lines · Patrick McHardy
Quoted 13 lines · Indan Zupancic

Hello,

After reading the "Never happen" comment in the code, I thought it wasn't too silly to mention that it apparently does happen. Never saw the message before, hence this mail. This happened on a machine doing SNAT for another pc, so conntrack may be involved.

The three errors happen within 1.5 seconds of each other:

[17834.377955] ipv4_get_l4proto: Frag of proto 17
[17835.358985] ipv4_get_l4proto: Frag of proto 17
[17835.872457] ipv4_get_l4proto: Frag of proto 17
Quoted 7 lines
Quoted 5 lines

As this seems to be an incident, I've no idea how to debug it, nor whether it's worth debugging. If this can be caused by a peer sending a bad packet I'd ignore this report.

If this is serious enough to be reported, perhaps it should be a BUG?

It should not be serious, the packets are simply dropped.

I meant serious in the sense of there being a bug in the code or not. If it indicates a bug then it might be better to make it a BUG or something else which gives more feedback to make it easier to track down. Right now it's not clear where the packet came from and goes to.

Quoted 1 line

Did it perhaps happen directly after nf_conntrack_ipv4 module load?

No, it was loaded for at least a few hours.

Quoted 3 lines

Otherwise I think it might happen on loopback if you manually send to large packets or possibly with NOTRACK. Any chance you're doing anything of that?

No idea what NOTRACK is, I've quite simple iptables rules and didn't do anything fancy at the time, so I don't think so.

As far as I can remember I was just browsing at the time, at least doing nothing that causes much UDP activity, DNS only. That said, I do run dnsmasq locally, so there is some loopback UDP activity, and it's also the DNS server for the SNATed host. Fair chance that there was more UDP activity from that host though (Quake3).

If it happens again I'll add extra debugging stuff and hope that it'll happen again. Currently it seems it's too vague to debug.

Greetings,

Indan

#3 lore raw
Quoted 23 lines · Indan Zupancic
Quoted 21 lines · Patrick McHardy
Quoted 18 lines · Indan Zupancic

Hello,

After reading the "Never happen" comment in the code, I thought it wasn't too silly to mention that it apparently does happen. Never saw the message before, hence this mail. This happened on a machine doing SNAT for another pc, so conntrack may be involved.

The three errors happen within 1.5 seconds of each other:

[17834.377955] ipv4_get_l4proto: Frag of proto 17
[17835.358985] ipv4_get_l4proto: Frag of proto 17
[17835.872457] ipv4_get_l4proto: Frag of proto 17

As this seems to be an incident, I've no idea how to debug it, nor whether it's worth debugging. If this can be caused by a peer sending a bad packet I'd ignore this report.

If this is serious enough to be reported, perhaps it should be a BUG?

Quoted 7 lines
Quoted 1 line

It should not be serious, the packets are simply dropped.

I meant serious in the sense of there being a bug in the code or not. If it indicates a bug then it might be better to make it a BUG or something else which gives more feedback to make it easier to track down. Right now it's not clear where the packet came from and goes to.

There is only one possible path, crashing peoples machines won't help :) It does indicate a bug, but not a serious one.

Quoted 14 lines
Quoted 1 line

Did it perhaps happen directly after nf_conntrack_ipv4 module load?

No, it was loaded for at least a few hours.

Quoted 3 lines

Otherwise I think it might happen on loopback if you manually send to large packets or possibly with NOTRACK. Any chance you're doing anything of that?

No idea what NOTRACK is, I've quite simple iptables rules and didn't do anything fancy at the time, so I don't think so.

Quoted 8 lines

As far as I can remember I was just browsing at the time, at least doing nothing that causes much UDP activity, DNS only. That said, I do run dnsmasq locally, so there is some loopback UDP activity, and it's also the DNS server for the SNATed host. Fair chance that there was more UDP activity from that host though (Quake3).

If it happens again I'll add extra debugging stuff and hope that it'll happen again. Currently it seems it's too vague to debug.

Thanks. One more question: are you running nfs?

#4 lore raw
Quoted 27 lines · Patrick McHardy
Quoted 26 lines · Indan Zupancic
Quoted 22 lines · Patrick McHardy
Quoted 13 lines · Indan Zupancic

Hello,

After reading the "Never happen" comment in the code, I thought it wasn't too silly to mention that it apparently does happen. Never saw the message before, hence this mail. This happened on a machine doing SNAT for another pc, so conntrack may be involved.

The three errors happen within 1.5 seconds of each other:

[17834.377955] ipv4_get_l4proto: Frag of proto 17
[17835.358985] ipv4_get_l4proto: Frag of proto 17
[17835.872457] ipv4_get_l4proto: Frag of proto 17
Quoted 5 lines

As this seems to be an incident, I've no idea how to debug it, nor whether it's worth debugging. If this can be caused by a peer sending a bad packet I'd ignore this report.

If this is serious enough to be reported, perhaps it should be a BUG?

It should not be serious, the packets are simply dropped.

Quoted 8 lines
Quoted 4 lines

I meant serious in the sense of there being a bug in the code or not. If it indicates a bug then it might be better to make it a BUG or something else which gives more feedback to make it easier to track down. Right now it's not clear where the packet came from and goes to.

There is only one possible path, crashing peoples machines won't help :) It does indicate a bug, but not a serious one.

Ah, yes, I just wanted the stacktrace, not the panic too. ;-)

Perhaps there's only one codepath, but there are multiple ones for the packet, and knowing which packets caused it seems the first step to finding a test case to reproduce the problem.

Quoted 20 lines
Quoted 20 lines
Quoted 1 line

Did it perhaps happen directly after nf_conntrack_ipv4 module load?

No, it was loaded for at least a few hours.

Quoted 3 lines

Otherwise I think it might happen on loopback if you manually send to large packets or possibly with NOTRACK. Any chance you're doing anything of that?

No idea what NOTRACK is, I've quite simple iptables rules and didn't do anything fancy at the time, so I don't think so.

As far as I can remember I was just browsing at the time, at least doing nothing that causes much UDP activity, DNS only. That said, I do run dnsmasq locally, so there is some loopback UDP activity, and it's also the DNS server for the SNATed host. Fair chance that there was more UDP activity from that host though (Quake3).

Quoted 5 lines
Quoted 2 lines

If it happens again I'll add extra debugging stuff and hope that it'll happen again. Currently it seems it's too vague to debug.

Thanks. One more question: are you running nfs?

Yes, but only for the host, I'm not using it locally. And it's v3, so should be using TCP. (rpc.mountd --no-nfs-version 1 --no-nfs-version 2.)

Regards,

Indan

#5 lore raw
Quoted 4 lines · Indan Zupancic
Quoted 1 line

Thanks. One more question: are you running nfs?

Yes, but only for the host, I'm not using it locally. And it's v3, so should be using TCP. (rpc.mountd --no-nfs-version 1 --no-nfs-version 2.)

I think it still uses UDP as default unless you specify tcp as a mount option.

/Martin

#6 lore raw
Quoted 9 lines · Martin Josefsson
Quoted 4 lines · Indan Zupancic
Quoted 1 line

Thanks. One more question: are you running nfs?

Yes, but only for the host, I'm not using it locally. And it's v3, so should be using TCP. (rpc.mountd --no-nfs-version 1 --no-nfs-version 2.)

I think it still uses UDP as default unless you specify tcp as a mount option.

You're probably right, and think it the host isn't using the tcp option.

But I asked, and at the time the errors popped up NFS wasn't mounted.

Greetings,

Indan

#7 lore raw

From: "Indan Zupancic" <[email protected]>
Date: Wed, 25 Jul 2007 19:41:45 +0200 (CEST)

Quoted 8 lines · Martin Josefsson
Quoted 7 lines · Indan Zupancic
Quoted 5 lines
Quoted 2 lines

Thanks. One more question: are you running nfs?

Yes, but only for the host, I'm not using it locally. And it's v3, so should be using TCP. (rpc.mountd --no-nfs-version 1 --no-nfs-version 2.)

Quoted 6 lines
Quoted 2 lines

I think it still uses UDP as default unless you specify tcp as a mount option.

You're probably right, and think it the host isn't using the tcp option.

But I asked, and at the time the errors popped up NFS wasn't mounted.

I have one more question. Does that node receive ICMP error including fragmented packet in its body ? I made ICMP error handling call ipv4_get_l4proto in 2.6.23 tree.

-- Yasuyuki Kozakai

A message that is not in the archive (sent off-list or not yet received): [email protected]

#9 lore raw
Quoted 14 lines · Yasuyuki KOZAKAI

From: "Indan Zupancic" <[email protected]>
Date: Wed, 25 Jul 2007 19:41:45 +0200 (CEST)

Quoted 11 lines · Martin Josefsson
Quoted 9 lines · Indan Zupancic
Quoted 5 lines
Quoted 2 lines

Thanks. One more question: are you running nfs?

Yes, but only for the host, I'm not using it locally. And it's v3, so should be using TCP. (rpc.mountd --no-nfs-version 1 --no-nfs-version 2.)

I think it still uses UDP as default unless you specify tcp as a mount option.

Quoted 7 lines
Quoted 3 lines

You're probably right, and think it the host isn't using the tcp option.

But I asked, and at the time the errors popped up NFS wasn't mounted.

I have one more question. Does that node receive ICMP error including fragmented packet in its body ? I made ICMP error handling call ipv4_get_l4proto in 2.6.23 tree.

I don't know, how can I check that?

Greetings,

Indan

#10 lore raw
Quoted 5 lines · Indan Zupancic
Quoted 3 lines · Yasuyuki KOZAKAI

I have one more question. Does that node receive ICMP error including fragmented packet in its body ? I made ICMP error handling call ipv4_get_l4proto in 2.6.23 tree.

Good point, I initially missed that this affects the current -rc.

Quoted 1 line

I don't know, how can I check that?

iptables -t raw -I PREROUTING \
	-m icmp --icmp-type destination-unreachable -j LOG

should log the packets.

#11 lore raw
Quoted 10 lines · Patrick McHardy
Quoted 5 lines · Indan Zupancic
Quoted 3 lines · Yasuyuki KOZAKAI

I have one more question. Does that node receive ICMP error including fragmented packet in its body ? I made ICMP error handling call ipv4_get_l4proto in 2.6.23 tree.

Good point, I initially missed that this affects the current -rc.

Quoted 7 lines
Quoted 1 line

I don't know, how can I check that?

iptables -t raw -I PREROUTING \
	-m icmp --icmp-type destination-unreachable -j LOG

should log the packets.

So with this when I get a Frag of proto it should also log an ICMP error?

Considering that the errors happened with a near exact 1 second interval and a 0.5s interval I think it's highly likely that it were retry packets to an unreachable host. But why is the proto UDP and not ICMP?

Greetings,

Indan

#12 lore raw
Quoted 9 lines · Indan Zupancic
Quoted 4 lines · Patrick McHardy
iptables -t raw -I PREROUTING \
	-m icmp --icmp-type destination-unreachable -j LOG

should log the packets.

So with this when I get a Frag of proto it should also log an ICMP error?

Exactly.

Quoted 3 lines

Considering that the errors happened with a near exact 1 second interval and a 0.5s interval I think it's highly likely that it were retry packets to an unreachable host. But why is the proto UDP and not ICMP?

Its the inner packet that is parsed by nf_ct_get_tuplepr.

#13 lore raw
Quoted 12 lines · Patrick McHardy
Quoted 9 lines · Indan Zupancic
Quoted 4 lines · Patrick McHardy
iptables -t raw -I PREROUTING \
	-m icmp --icmp-type destination-unreachable -j LOG

should log the packets.

So with this when I get a Frag of proto it should also log an ICMP error?

Quoted 9 lines

Exactly.

Quoted 3 lines

Considering that the errors happened with a near exact 1 second interval and a 0.5s interval I think it's highly likely that it were retry packets to an unreachable host. But why is the proto UDP and not ICMP?

Its the inner packet that is parsed by nf_ct_get_tuplepr.

Reading the comment in icmp.c iph->frag_off & htons(IP_OFFSET) being true means that it's a fragment, but not the first one.

So what's happening is that the host sends a big UDP packet, it gets fragmentated, but never reaches its destination. ICMP error packets are generated. Conntrack drops the latter ones thanks to the check in ipv4_get_l4proto.

So the question is whether those latter ICMP packets should be forwarded or not. If not, the code is fine and the warning message could be removed. If they should, then it might be hard for the current conntrack code know where to send the packet, as the UDP header is missing.

Greetings,

Indan

#14 lore raw
Quoted 9 lines · Indan Zupancic

Reading the comment in icmp.c iph->frag_off & htons(IP_OFFSET) being true means that it's a fragment, but not the first one.

So what's happening is that the host sends a big UDP packet, it gets fragmentated, but never reaches its destination. ICMP error packets are generated. Conntrack drops the latter ones thanks to the check in ipv4_get_l4proto.

Quoted 4 lines

So the question is whether those latter ICMP packets should be forwarded or not. If not, the code is fine and the warning message could be removed. If they should, then it might be hard for the current conntrack code know where to send the packet, as the UDP header is missing.

Yes, we can't associate them with the original connection. We should catch this case in ICMP tracking though I think instead of removing the message.