Linux-2.2 - NAT routes can cause kernel panic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi there,

A linux-2.2(.16) kernel with NAT routing enabled can easily be "paniced".

Assume that we have an ethernet interface eth0 with address 172.17.1.1/16, and that no default gateway exists.
Now insert a NAT route:
# ip route add nat 172.17.1.254 via 1.1.1.1
And add a default gateway:
# ip route add default via 172.17.1.254

If there is some activity on the network, the kernel will probably soon panic (I know that this is a braindead combination of things, but it seems to me that panic is a bit drastic reaction).

What happens is, that due to the NAT route, the default route will not be associated with a device.
Sooner or later we will hit "out_dev = FIB_RES_DEV(res)->ip_ptr" in ip_route_input_slow(skb,...,dev) with a res that does not refer to a device (=>panic).

I have not been able to pinpoint the exact origin of trouble, as there are a few things that are not clear to me:
Should a NAT rule map to a device (the kernel does not accept e.g. "ip route add nat ... dev eth0")?
Should a res e.g. after fib_lookup(&key,&res) always contain a valid device reference?

Any suggestions/comments?

Regards,
Kim Woelders
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux