arrow zhang | 17 Sep 14:55 2010
Picon

[HELP] Oops when insmod iptable_filter

Here has a difficult problem for me, would like anyone give some advice

On a mips r3000 cpu, here has a kernel crash when doing the insmod
iptable_filter,
The phenomenon is same as https://dev.openwrt.org/ticket/6129

1, the FW is at openwrt versoin r23057
2, the crash occurs if insmod automatically by preinit
3, but not has crash if insmod within "failsafe mode"

4, the crash address is random in the "iptable_filter_init" progress,
seems the symbol or page address invalidate
    and sometime may crash at any other modules, (e.g.
iptable_mangle/raw, but iptable_filter module is crash every time)

5, refer from the "crash log" "Cause : 00000008", maybe is a TLB
issue, but I have no idea about the debug direction
   I have try something as these
   * check the irq routine
   * double check file arch/mips/mm/c-r3k.c
   * double check file arch/mips/mm/tlb-r3k.c
   * try to remove the patch :
target/linux/generic/patches-2.6.35/027-mips_module_reloc.patch
   * try to remove the patch :
target/linux/generic/patches-2.6.35/028-module_exports.patch
   * try to remove the patch :
target/linux/generic/patches-2.6.35/202-mips_mem_functions_performance.patch
but all can not fix this bug

next is the crash log (some printk added at sys_init_module)
(Continue reading)

arrow zhang | 21 Sep 15:04 2010
Picon

Re: [HELP] Oops when insmod iptable_filter

On Fri, Sep 17, 2010 at 8:55 PM, arrow zhang <arrow.ebd <at> gmail.com> wrote:
> Here has a difficult problem for me, would like anyone give some advice
>
> On a mips r3000 cpu, here has a kernel crash when doing the insmod
> iptable_filter,
> The phenomenon is same as https://dev.openwrt.org/ticket/6129
>
> 1, the FW is at openwrt versoin r23057
> 2, the crash occurs if insmod automatically by preinit
> 3, but not has crash if insmod within "failsafe mode"
----

good news:

1, work fine if start "init" without "env, like this:
    exec $pi_init_cmd 2>&0
2, test patch:
{{{
diff --git a/package/base-files/files/lib/preinit/99_10_run_init
b/package/base-files/files/lib/preinit/99_10_run_init
index fef3a50..7db1e72 100644
--- a/package/base-files/files/lib/preinit/99_10_run_init
+++ b/package/base-files/files/lib/preinit/99_10_run_init
 <at>  <at>  -6,9 +6,11  <at>  <at>  run_init() {
     preinit_echo "- init -"
     preinit_ip_deconfig
     if [ "$pi_init_suppress_stderr" = "y" ]; then
-	exec env - PATH=$pi_init_path $pi_init_env $pi_init_cmd 2>&0
+	#exec env - PATH=$pi_init_path $pi_init_env $pi_init_cmd 2>&0
+	exec $pi_init_cmd 2>&0
(Continue reading)

Ralf Baechle | 21 Sep 15:33 2010

Re: [HELP] Oops when insmod iptable_filter

On Fri, Sep 17, 2010 at 08:55:43PM +0800, arrow zhang wrote:

> Here has a difficult problem for me, would like anyone give some advice
> 
> On a mips r3000 cpu, here has a kernel crash when doing the insmod
> iptable_filter,

Are you sure you really have an R3000?  That's an very old processor
released in 1988.

> The phenomenon is same as https://dev.openwrt.org/ticket/6129
> 
> 1, the FW is at openwrt versoin r23057
> 2, the crash occurs if insmod automatically by preinit
> 3, but not has crash if insmod within "failsafe mode"
> 
> 4, the crash address is random in the "iptable_filter_init" progress,
> seems the symbol or page address invalidate
>     and sometime may crash at any other modules, (e.g.
> iptable_mangle/raw, but iptable_filter module is crash every time)
> 
> 5, refer from the "crash log" "Cause : 00000008", maybe is a TLB
> issue, but I have no idea about the debug direction

That could be a fairly generic sympthom for dereferencing a bad pointer.

>    I have try something as these
>    * check the irq routine
>    * double check file arch/mips/mm/c-r3k.c
>    * double check file arch/mips/mm/tlb-r3k.c
(Continue reading)

arrow zhang | 21 Sep 16:03 2010
Picon

Re: [HELP] Oops when insmod iptable_filter

On Tue, Sep 21, 2010 at 9:33 PM, Ralf Baechle <ralf <at> linux-mips.org> wrote:
> Are you sure you really have an R3000?  That's an very old processor
> released in 1988.

yes, cpuinfo refer to https://forum.openwrt.org/viewtopic.php?id=26405
as this:
{{{
# cat /proc/cpuinfo
system type             : RTL8672
processor               : 0
cpu model               : R3000 V0.0
BogoMIPS                : 398.95
wait instruction        : no
microsecond timers      : no
tlb_entries             : 32
extra interrupt vector  : no
hardware watchpoint     : no
ASEs implemented        :
VCED exceptions         : not available
VCEI exceptions         : not available
}}}

>> $28   : 81a86000 81a87e30 7fbef508 81a6e024
>> Hi    : 00000000
>> Lo    : 000000c7
>> epc   : 81a6e030 __this_module+0x3fea0/0x3ff00 [iptable_filter]
>>     Not tainted
>> ra    : 81a6e024 __this_module+0x3fe94/0x3ff00 [iptable_filter]
>
> The big difference between your issue and the old issue in openwrt is that
(Continue reading)


Gmane