I also had this issue on my sx763 lantiq based board:

https://dev.openwrt.org/ticket/9440

With symbol table I got this oops:

Unhandled kernel unaligned access[#1]:
... bla bla bla (to keep it short) ...
Call Trace:
[<80cb8968>] nf_nat_setup_info+0x2e0/0x6e8 [nf_nat]
[<80d1e158>] masquerade_tg+0xc0/0xe8 [ipt_MASQUERADE]
[<80c646a8>] ipt_do_table+0x3e0/0x484 [ip_tables]
[<80dee0c0>] nf_nat_rule_find+0x28/0x9c [iptable_nat]
[<80dee290>] nf_nat_fn+0x120/0x1a0 [iptable_nat]
[<801baa34>] nf_iterate+0x8c/0xfc
[<801bab34>] nf_hook_slow+0x90/0x17c
[<801c76c8>] ip_output+0xd8/0x104
[<8019a224>] __netif_receive_skb+0x4d4/0x578
[<80210128>] br_handle_frame+0x280/0x2b8
[<80199f9c>] __netif_receive_skb+0x24c/0x578
[<8019a370>] process_backlog+0xa8/0x188
[<8019a778>] net_rx_action+0x8c/0x1b8
[<800215f0>] __do_softirq+0xa8/0x154
[<800217f0>] do_softirq+0x48/0x68
[<800031c0>] plat_irq_dispatch+0xf4/0x164
[<800059ec>] ret_from_irq+0x0/0x4
[<80005be0>] r4k_wait+0x20/0x40
[<80007690>] cpu_idle+0x28/0x4c
[<802a58d0>] start_kernel+0x35c/0x378

It's easy to reproduce with nmap:

# nmap -sT -p 1-10000 -T insane -Pn -n some.public.ip.address/24

After some time I discovered that the issue is in this lines:

% sed -n '320,326p' linux-2.6.39.4/net/ipv4/netfilter/nf_nat_core.c
                spin_lock_bh(&nf_nat_lock);
                /* nf_conntrack_alter_reply might re-allocate exntension aera */
                nat = nfct_nat(ct);
                nat->ct = ct;
                hlist_add_head_rcu(&nat->bysource,
                                   &net->ipv4.nat_bysource[srchash]);
                spin_unlock_bh(&nf_nat_lock);

Long story short - enable CONFIG_PREEMPT to have functional spin locks:

http://www.kernel.org/pub/linux/kernel/people/rusty/kernel-locking/x109.html

Also in linux-2.6.39.4/kernel/Kconfig.preempt you will see for
CONFIG_PREEMPT:

        Select this if you are building a kernel for a desktop or
        embedded system with latency requirements in the milliseconds
        range

Because of that I made changes to all kernel config files.

Signed-off-by: Luka Perkov < openwrt ->-to->- lukaperkov.net >
---

Index: target/linux/generic/config-2.6.30
===================================================================
--- target/linux/generic/config-2.6.30  (revision 28148)
+++ target/linux/generic/config-2.6.30  (working copy)
@@ -1683,8 +1683,8 @@
 # CONFIG_PPP_MPPE is not set
 CONFIG_PPP_MULTILINK=y
 # CONFIG_PPP_SYNC_TTY is not set
-# CONFIG_PREEMPT is not set
-CONFIG_PREEMPT_NONE=y
+CONFIG_PREEMPT=y
+# CONFIG_PREEMPT_NONE is not set
 # CONFIG_PREEMPT_RCU is not set
 # CONFIG_PREEMPT_RCU_TRACE is not set
 # CONFIG_PREEMPT_VOLUNTARY is not set
Index: target/linux/generic/config-2.6.31
===================================================================
--- target/linux/generic/config-2.6.31  (revision 28148)
+++ target/linux/generic/config-2.6.31  (working copy)
@@ -1684,8 +1684,8 @@
 CONFIG_PPP_MULTILINK=y
 # CONFIG_PPP_SYNC_TTY is not set
 # CONFIG_PPS is not set
-# CONFIG_PREEMPT is not set
-CONFIG_PREEMPT_NONE=y
+CONFIG_PREEMPT=y
+# CONFIG_PREEMPT_NONE is not set
 # CONFIG_PREEMPT_RCU is not set
 # CONFIG_PREEMPT_RCU_TRACE is not set
 # CONFIG_PREEMPT_VOLUNTARY is not set
Index: target/linux/generic/config-2.6.32
===================================================================
--- target/linux/generic/config-2.6.32  (revision 28148)
+++ target/linux/generic/config-2.6.32  (working copy)
@@ -1776,8 +1776,8 @@
 CONFIG_PPP_MULTILINK=y
 # CONFIG_PPP_SYNC_TTY is not set
 # CONFIG_PPS is not set
-# CONFIG_PREEMPT is not set
-CONFIG_PREEMPT_NONE=y
+CONFIG_PREEMPT=y
+# CONFIG_PREEMPT_NONE is not set
 # CONFIG_PREEMPT_RCU is not set
 # CONFIG_PREEMPT_RCU_TRACE is not set
 # CONFIG_PREEMPT_VOLUNTARY is not set
Index: target/linux/generic/config-2.6.36
===================================================================
--- target/linux/generic/config-2.6.36  (revision 28148)
+++ target/linux/generic/config-2.6.36  (working copy)
@@ -1824,8 +1824,8 @@
 CONFIG_PPP_MULTILINK=y
 # CONFIG_PPP_SYNC_TTY is not set
 # CONFIG_PPS is not set
-# CONFIG_PREEMPT is not set
-CONFIG_PREEMPT_NONE=y
+CONFIG_PREEMPT=y
+# CONFIG_PREEMPT_NONE is not set
 # CONFIG_PREEMPT_VOLUNTARY is not set
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_PRINTK=y
Index: target/linux/generic/config-2.6.37
===================================================================
--- target/linux/generic/config-2.6.37  (revision 28148)
+++ target/linux/generic/config-2.6.37  (working copy)
@@ -1859,8 +1859,8 @@
 # CONFIG_PPP_SYNC_TTY is not set
 # CONFIG_PPS is not set
 # CONFIG_PPTP is not set
-# CONFIG_PREEMPT is not set
-CONFIG_PREEMPT_NONE=y
+CONFIG_PREEMPT=y
+# CONFIG_PREEMPT_NONE is not set
 # CONFIG_PREEMPT_VOLUNTARY is not set
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_PRINTK=y
Index: target/linux/generic/config-2.6.38
===================================================================
--- target/linux/generic/config-2.6.38  (revision 28148)
+++ target/linux/generic/config-2.6.38  (working copy)
@@ -1891,8 +1891,8 @@
 # CONFIG_PPP_SYNC_TTY is not set
 # CONFIG_PPS is not set
 # CONFIG_PPTP is not set
-# CONFIG_PREEMPT is not set
-CONFIG_PREEMPT_NONE=y
+CONFIG_PREEMPT=y
+# CONFIG_PREEMPT_NONE is not set
 # CONFIG_PREEMPT_VOLUNTARY is not set
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_PRINTK=y
Index: target/linux/generic/config-2.6.39
===================================================================
--- target/linux/generic/config-2.6.39  (revision 28148)
+++ target/linux/generic/config-2.6.39  (working copy)
@@ -1929,8 +1929,8 @@
 # CONFIG_PPP_SYNC_TTY is not set
 # CONFIG_PPS is not set
 # CONFIG_PPTP is not set
-# CONFIG_PREEMPT is not set
-CONFIG_PREEMPT_NONE=y
+CONFIG_PREEMPT=y
+# CONFIG_PREEMPT_NONE is not set
 # CONFIG_PREEMPT_VOLUNTARY is not set
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_PRINTK=y
Index: target/linux/generic/config-3.0
===================================================================
--- target/linux/generic/config-3.0     (revision 28148)
+++ target/linux/generic/config-3.0     (working copy)
@@ -1920,8 +1920,8 @@
 # CONFIG_PPP_SYNC_TTY is not set
 # CONFIG_PPS is not set
 # CONFIG_PPTP is not set
-# CONFIG_PREEMPT is not set
-CONFIG_PREEMPT_NONE=y
+CONFIG_PREEMPT=y
+# CONFIG_PREEMPT_NONE is not set
 # CONFIG_PREEMPT_VOLUNTARY is not set
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_PRINTK=y
Index: target/linux/generic/config-3.1
===================================================================
--- target/linux/generic/config-3.1     (revision 28148)
+++ target/linux/generic/config-3.1     (working copy)
@@ -1931,8 +1931,8 @@
 # CONFIG_PPP_SYNC_TTY is not set
 # CONFIG_PPS is not set
 # CONFIG_PPTP is not set
-# CONFIG_PREEMPT is not set
-CONFIG_PREEMPT_NONE=y
+CONFIG_PREEMPT=y
+# CONFIG_PREEMPT_NONE is not set
 # CONFIG_PREEMPT_VOLUNTARY is not set
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_PRINTK=y
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to