Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 225741 - kernel 2.6.24-gentoo-r8 / Panics on DNAT to closed port 21
Summary: kernel 2.6.24-gentoo-r8 / Panics on DNAT to closed port 21
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: High critical (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-10 13:13 UTC by Aurélien Guillaume
Modified: 2008-08-20 17:10 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Kernel config for my x86_64 server (config-2.6.24-r8,40.05 KB, text/plain)
2008-06-10 13:14 UTC, Aurélien Guillaume
Details
The relevant firewall rules on the server (relevant_firewall.txt,1.71 KB, text/plain)
2008-06-10 13:20 UTC, Aurélien Guillaume
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aurélien Guillaume 2008-06-10 13:13:58 UTC
I have a Gentoo-based server with 2.6.24-gentoo-r8 kernel, firewalled.

For a test-setup, i needed a DNAT rule in NAT PREROUTING chain to duplicate a port (my FTP server does not listen on localhost):
  DNAT       tcp  --  *      *       0.0.0.0/0            <server_ip>        tcp dpt:60002 to:<server_ip>:21 

On the other side, simply doing a:
 nc <server_ip> 60002

provokes a kernel panic on the server (or it seems to, as it is not mirrored by netconsole, alas. If someone has access to x86_64 hardware and kernel...).

Precisions:
- this only happens if the DNAT port is 21. When using another port, there's no problem. Perhaps a netfilter ftp helper problem ?
- This did not happen with 2.6.22-gentoo-r8 kernel on x86_64.
- This happens with 2.6.24-gentoo-r4 and 2.6.24-gentoo-r8 kernel on x86_64.
- Altough the setup is not exactly the same on my test box, this does not seems to happen on x86 with 2.6.24-gentoo-r4.

Can someone confirm the problem on x86_64 or x86 ?

I'll attach my .config to the bug report, along with the firewall rules i have in use.

Reproducible: Always

Steps to Reproduce:
1. Set up a DNAT rule: iptables -t nat -A PREROUTING -p tcp --dport 60002 -j DNAT --to <external_ip>:21
2. From another host, connect to <external_ip>:60002.
3. Enjoy the kernel panic.

Actual Results:  
Either have my connection refused if there's no server running on port 21, or connection accepted.

Expected Results:  
Seems to have panic'd, altough i have no trace of it (neither with netconsole).
Comment 1 Aurélien Guillaume 2008-06-10 13:14:31 UTC
Created attachment 156235 [details]
Kernel config for my x86_64 server
Comment 2 Aurélien Guillaume 2008-06-10 13:20:52 UTC
Created attachment 156237 [details]
The relevant firewall rules on the server

Replace SERVER_IP by the external IP of the box you are testing.
Comment 3 Aurélien Guillaume 2008-06-10 18:08:58 UTC
(In reply to comment #0)
> I have a Gentoo-based server with 2.6.24-gentoo-r8 kernel, firewalled.
> 
> For a test-setup, i needed a DNAT rule in NAT PREROUTING chain to duplicate a
> port (my FTP server does not listen on localhost):
>   DNAT       tcp  --  *      *       0.0.0.0/0            <server_ip>       
> tcp dpt:60002 to:<server_ip>:21 
> 
> On the other side, simply doing a:
>  nc <server_ip> 60002
> 
> provokes a kernel panic on the server (or it seems to, as it is not mirrored by
> netconsole, alas. If someone has access to x86_64 hardware and kernel...).
> 
> Precisions:
> - this only happens if the DNAT port is 21. When using another port, there's no
> problem. Perhaps a netfilter ftp helper problem ?
> - This did not happen with 2.6.22-gentoo-r8 kernel on x86_64.
> - This happens with 2.6.24-gentoo-r4 and 2.6.24-gentoo-r8 kernel on x86_64.
> - Altough the setup is not exactly the same on my test box, this does not seems
> to happen on x86 with 2.6.24-gentoo-r4.
> 
> Can someone confirm the problem on x86_64 or x86 ?
> 
> I'll attach my .config to the bug report, along with the firewall rules i have
> in use.
> 
> Reproducible: Always
> 
> Steps to Reproduce:
> 1. Set up a DNAT rule: iptables -t nat -A PREROUTING -p tcp --dport 60002 -j
> DNAT --to <external_ip>:21
> 2. From another host, connect to <external_ip>:60002.
> 3. Enjoy the kernel panic.
> 
> Actual Results:  
> Either have my connection refused if there's no server running on port 21, or
> connection accepted.
> 
> Expected Results:  
> Seems to have panic'd, altough i have no trace of it (neither with netconsole).
> 

Woops: forgot to add an essential point:
You must NOT have something listening on the port 21 for the panic to occur immediately.

In fact, I found the bug when doing simultaneous connections to the FTP server, so i imagine that if you have several simultaneous connections, this also occurs.
Comment 4 Daniel Drake (RETIRED) gentoo-dev 2008-06-29 16:25:45 UTC
I don't have the environment to reproduce it here. Is there any way you can get the trace? Can you test on a newer kernel such as 2.6.25 or 2.6.26-rc?
Comment 5 Aurélien Guillaume 2008-06-30 07:00:35 UTC
(In reply to comment #4)
> I don't have the environment to reproduce it here. Is there any way you can get
> the trace? Can you test on a newer kernel such as 2.6.25 or 2.6.26-rc?
> 

I will try to do that as soon as possible, as soon as i get access to a local server with x86_64 system, since i cannot get anything via netconsole. That may take a few days, though.

Thanks for your reply.
Comment 6 Mike Pagano gentoo-dev 2008-08-20 17:10:43 UTC
Please feel free to reopen when you've had a chance to test. Thanks.