Hello,

On Friday 02 September 2011 00:55:54 Luka Perkov wrote:
> 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.htm
> l
> 
> 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 >

I am not opposed to enabling CONFIG_PREEMPT on a global basis, but I am afraid 
this might reveal new locking problems that we have not had so far. At least 
trunk should be the place where to experiment this.
-- 
Florian
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to