Orangepi R1 Openwrt SPI Flash boot | kmod-br-netfilter & bridged interfaces causes Kernel Panic

Hi i have installed sysupgrade image from repository => https://github.com/melsem/openwrt-19.07.2-spi/ to Orangepi r1's SPI Flash successfully
but i want to install kmod-br-netfilter to filter traffic between bridged interfaces
when i installed that kmod package without enabling bridge interface from /etc/config/network there is no problem
but when I activated "option type 'bridge' from network config below
it goes to kernel panic.
Any help would be appreciated.

root@orangepi-r1:/# cat /proc/version 
Linux version 4.14.171 (sem@RV508) (gcc version 7.5.0 (OpenWrt GCC 7.5.0 r10947-65030d81f3)) #0 SMP PREEMPT Thu Feb 27 21:05:12 2020


root@orangepi-r1:/# uname -a
Linux orangepi-r1 4.14.171 #0 SMP PREEMPT Thu Feb 27 21:05:12 2020 armv7l GNU/Linux

/etc/config/network >>

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd95:4824:4633::/48'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth0'
        option proto 'dhcp'

config interface 'wan'
        option ifname 'eth1'
        option proto 'dhcp'
        
config interface 'wan'
        option ifname 'eth1'
        option proto 'dhcp'

config interface 'wan6'
        option ifname 'eth1'
        option proto 'dhcpv6'

root@orangepi-r1:/# opkg install kmod-br-netfilter
Installing kmod-br-netfilter (4.14.171-1) to root...
Downloading http://downloads.openwrt.org/releases/19.07.2/targets/sunxi/cortexa7/packages/kmod-br-netfilter_4.14.171-1_arm_cortex-a7_neon-vfpv4.ipk
Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-br-netfilter:
 *      kernel (= 4.14.171-1-9801ec2dfc48e8fb2cc10a339283e7b0)
 * opkg_install_cmd: Cannot install package kmod-br-netfilter.
root@orangepi-r1:/# 

## I builded and installed the package myself  due to kernel incompliance
root@orangepi-r1:~# opkg install kmod-br-netfilter_4.14.171-1_arm_cortex-a7_neon-vfpv4.ipk 
Installing kmod-br-netfilter (4.14.171-1) to root...
Configuring kmod-br-netfilter.



    6.805073] dwmac-sun8i 1c30000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
[    6.813666] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[    7.850091] mount_root: loading kmods from internal overlay
[    7.886383] kmodloader: loading kernel modules from //etc/modules-boot.d/*
[    7.895851] kmodloader: done loading kernel modules from //etc/modules-boot.d/*
[    8.407365] jffs2: notice: (805) jffs2_build_xattr_subsystem: complete building xattr subsystem, 14 of xdatum (2 unchecked, 12 orphan) and 29 of xref (12 dead, 0 orphan) found.
[    8.424072] block: attempting to load /tmp/jffs_cfg/upper/etc/config/fstab
[    8.445308] block: extroot: not configured
[    8.537731] jffs2: notice: (803) jffs2_build_xattr_subsystem: complete building xattr subsystem, 14 of xdatum (2 unchecked, 12 orphan) and 29 of xref (12 dead, 0 orphan) found.
[    8.558277] mount_root: loading kmods from internal overlay
[    8.600326] kmodloader: loading kernel modules from /tmp/overlay/upper/etc/modules-boot.d/*
[    8.613107] kmodloader: done loading kernel modules from /tmp/overlay/upper/etc/modules-boot.d/*
[    8.953676] block: attempting to load /tmp/jffs_cfg/upper/etc/config/fstab
[    8.969367] block: extroot: not configured
[    9.055750] mount_root: switching to jffs2 overlay
[    9.093107] overlayfs: upper fs does not support tmpfile.
[    9.109928] urandom-seed: Seeding with /etc/urandom.seed
[    9.182332] procd: - early -
[    9.185420] procd: - watchdog -
Failed to connect to ubus
Failed to connect to ubus
[    9.851748] procd: - watchdog -
[    9.855220] procd: - ubus -
[   10.001074] procd: - init -
Please press Enter to activate this console.
[   10.450156] kmodloader: loading kernel modules from /etc/modules.d/*
[   10.458378] urngd: v1.0.2 started.
[   10.462391] ntfs: driver 2.1.32 [Flags: R/O MODULE].
[   10.475940] tun: Universal TUN/TAP device driver, 1.6
[   10.488038] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   10.498193] Netfilter messages via NETLINK v0.30.
[   10.504330] ip_set: protocol 6
[   10.525348] Loading modules backported from Linux version v4.19.98-0-gd183c8e2647a
[   10.532962] Backport generated by backports.git v4.19.98-1-0-g8204eb99
[   10.748537] i2c /dev entries driver
[   10.760310] Linux video capture interface: v2.00
[   10.769948] hidraw: raw HID events driver (C) Jiri Kosina
[   10.784372] Mirror/redirect action on
[   10.795517] u32 classifier
[   10.798253]     input device check on
[   10.801932]     Actions configured
[   10.813289] GACT probability on
[   10.820049] Simple TC action Loaded
[   10.842021] nf_conntrack version 0.5.0 (4096 buckets, 16384 max)
[   10.853257] fuse init (API version 7.26)
[   10.861764] IR NEC protocol handler initialized
[   10.885201] Bridge firewalling registered
[   10.890547] usbcore: registered new interface driver cdc_acm
[   10.896285] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[   10.905905] usbcore: registered new interface driver cdc_wdm
[   10.916561] hso: drivers/net/usb/hso.c: Option Wireless
[   10.922070] usbcore: registered new interface driver hso
[   10.931194] ip_tables: (C) 2000-2006 Netfilter Core Team
[   10.956965] usbcore: registered new interface driver mt7601u
[   11.007940] usbcore: registered new interface driver r8152
[   11.022738] usbcore: registered new interface driver rt73usb
[   11.032491] usbcore: registered new interface driver rtl8xxxu
[   11.052086] usbcore: registered new interface driver ums-alauda
[   11.058919] usbcore: registered new interface driver ums-cypress
[   11.065993] usbcore: registered new interface driver ums-datafab
[   11.072978] usbcore: registered new interface driver ums-freecom
[   11.080127] usbcore: registered new interface driver ums-isd200
[   11.087122] usbcore: registered new interface driver ums-jumpshot
[   11.094040] usbcore: registered new interface driver ums-karma
[   11.100949] usbcore: registered new interface driver ums-sddr09
[   11.108073] usbcore: registered new interface driver ums-sddr55
[   11.115208] usbcore: registered new interface driver ums-usbat
[   11.123227] usbcore: registered new interface driver usbhid
[   11.128979] usbhid: USB HID core driver
[   11.139036] usbcore: registered new interface driver usbserial
[   11.145170] usbcore: registered new interface driver usbserial_generic
[   11.151845] usbserial: USB Serial support registered for generic
[   11.163447] Driver for 1-wire Dallas network protocol.
[   11.201629] xt_time: kernel timezone is -0000ice number 2 using ehci-platform
[   11.214511] usbcore: registered new interface driver ath9k_htc
[   11.222289] usbcore: registered new interface driver cdc_ether
[   11.231318] usbcore: registered new interface driver cdc_ncm
[   11.242278] usbcore: registered new interface driver dm9601
[   11.249449] usbcore: registered new interface driver huawei_cdc_ncm
[   11.264594] usbcore: registered new interface driver pl2303
[   11.270424] usbserial: USB Serial support registered for pl2303
[   11.280026] PPP generic driver version 2.4.2
[   11.286351] NET: Registered protocol family 24
[   11.292399] usbcore: registered new interface driver qmi_wwan
[   11.300246] usbcore: registered new interface driver rndis_host
[   11.315810] usbcore: registered new interface driver rt2800usb
[   11.330416] usbcore: registered new interface driver rtl8192cu
[   11.337648] usbcore: registered new interface driver sierra
[   11.343374] usbserial: USB Serial support registered for Sierra USB modem
[   11.352076] usbcore: rgistered new interface driver sierra_net
[   11.361486] usbcore: registered new interface driver snd-usb-audio
[   11.369431] usbcore: registered new interface driver sr9700
[   11.377355] thermal thermal_zone0: filed to read out thermal zone (-110)
[   11.392032] usbcore: registered new interface driver uvcvideo
[   11.397898] USB Video Class driver (1.1.1)
[   11.405699] usbcore: registered new interface driver cdc_mbim
[   11.412655] usbcore: registered new interface driver ipw
[   11.418313] usbserial: USB Serial support registered for IPWireless converter
[   11.426953] usbcore: registered new interface driver option
[   11.432725] usbserial: USB Serial support registered for GSM modem (1-port)
[   11.443870] usbcore: registered new interface driver qcserial
[   11.449914] usbserial: USB Serial support registered for Qualcomm USB modem
[   11.457270] kmodloader: done loading kernel modles from /etc/modules.d/*
[   11.466640] r8152 3-1:1.0 eth1: v1.09.9
[   15.920061] Unable to handle kernel paging request at virtual address ffff914c
[   15.927705] pgd = cefbd040
[   15.930438] [ffff914c] *pgd=80000040007003, *pmd=4fffd003, *pte=00000000
[   15.937488] Internal error: Oops: 207 [#1] PREEMPT SMP ARM
[   15.942998] Modules linked in: qcserial pppoe ppp_async option ipw cdc_mbim w1_therm w1_gpio uvcvideo usb_wwan sun8i_ths sun4i_gpadc_iio sr9700 snd_usb_audio sierra_net sierra rtl8192cu rtl8192c_common rtl_usb rt2800usb rt2800lib rndis_host qmi_wwan pppox ppp_generic pl2303 nf_conntrack_ipv6 mmc_spi iptable_nat ipt_REJECT ipt_MASQUERADE huawei_cdc_ncm dm9601 cpufreq_dt cdc_ncm cdc_ether ath9k_htc ath9k_common xt_time xt_tcpudp xt_tcpmss xt_statistic xt_state xt_recent xt_nat xt_multiport xt_mark xt_mac xt_limit xt_length xt_hl xt_helper xt_ecn xt_dscp xt_conntrack xt_connmark xt_connlimit xt_connbytes xt_comment xt_TCPMSS xt_REDIRECT xt_LOG xt_HL xt_FLOWOFFLOAD xt_DSCP xt_CT xt_CLASSIFY wire videobuf2_v4l2 usbserial usbnet usbhid ums_usbat ums_sddr55 ums_sddr09 ums_karma ums_jumpshot ums_isd200 ums_freecom
[   16.014595]  ums_datafab ums_cypress ums_alauda thermal_sys snd_usbmidi_lib slhc rtlwifi rtl8xxxu rtc_ds1307 rt73usb rt2x00usb rt2x00lib rotary_encoder regmap_i2c r8152 pwm_sun4i of_mmc_spi nf_reject_ipv4 nf_nat_redirect nf_nat_masquerade_ipv4 nf_conntrack_ipv4 nf_nat_ipv4 nf_nat nf_log_ipv4 nf_flow_table_hw nf_flow_table nf_defrag_ipv6 nf_defrag_ipv4 nf_conntrack_rtcache mt7601u mac80211 iptable_raw iptable_mangle iptable_filter ipt_ECN ip_tables i2c_mv64xxx hso hid_generic crc7 crc_itu_t crc_ccitt cdc_wdm cdc_acm br_netfilter ath9k_hw ath sunxi_cir ir_nec_decoder rc_core fuse sch_cake nf_conntrack sch_teql sch_sfq sch_red sch_prio sch_pie sch_multiq sch_gred sch_fq sch_dsmark sch_codel em_text em_nbyte em_meta em_cmp act_simple act_police act_pedit act_ipt act_gact act_csum libcrc32c sch_tbf sch_ingress
[   16.086171]  sch_htb sch_hfsc em_u32 cls_u32 cls_tcindex cls_route cls_matchall cls_fw cls_flow cls_basic act_skbedit act_mirred sun8i_codec_analog videobuf2_vmalloc videobuf2_memops videobuf2_core sun4i_codec hid v4l2_common videodev evdev i2c_gpio i2c_algo_bit i2c_dev i2c_core 8189es cfg80211 compat rtc_sunxi xt_set ip_set_list_set ip_set_hash_netportnet ip_set_hash_netport ip_set_hash_netnet ip_set_hash_netiface ip_set_hash_net ip_set_hash_mac ip_set_hash_ipportnet ip_set_hash_ipportip ip_set_hash_ipport ip_set_hash_ipmark ip_set_hash_ip ip_set_bitmap_port ip_set_bitmap_ipmac ip_set_bitmap_ip ip_set nfnetlink nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables ip6t_REJECT x_tables nf_reject_ipv6 ifb tun snd_rawmidi snd_seq_device snd_pcm_oss snd_mixer_oss snd_hwdep ntfs nls_utf8
[   16.157146]  dma_shared_buffer gpio_keys
[   16.161095] CPU: 3 PID: 2447 Comm: netifd Not tainted 4.14.171 #0
[   16.167189] Hardware name: Allwinner sun8i Family
[   16.171897] task: cf32de80 task.stack: cdce4000
[   16.176493] PC is at brnf_device_event+0x60/0x20c [br_netfilter]
[   16.182515] LR is at brnf_device_event+0x5c/0x20c [br_netfilter]
[   16.188522] pc : [<bf59b340>]    lr : [<bf59b33c>]    psr: 20000013
[   16.194790] sp : cdce5e50  ip : cf32de80  fp : 00000000
[   16.200016] r10: 00000000  r9 : 00000000  r8 : 00000005
[   16.205242] r7 : cdce5e90  r6 : 00000000  r5 : 0000000e  r4 : c0c50c80
[   16.211770] r3 : ffff9114  r2 : cf32de80  r1 : 00000005  r0 : 00000001
[   16.218300] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
[   16.225437] Control: 30c5387d  Table: 4efbd040  DAC: b8d65a60
[   16.231185] Process netifd (pid: 2447, stack limit = 0xcdce4210)
[   16.237192] Stack: (0xcdce5e50 to 0xcdce6000)
[   16.241554] 5e40:                                     bf66b000 ffffffea 00000000 c02568e8
[   16.249737] 5e60: ce83b000 c0c50c80 00000000 ce83b010 10000001 c0256a20 00000000 c0c50c80
[   16.257919] 5e80: 00000000 c06474a0 ce83b000 c030c3e4 ce83b000 00000000 00000001 ce83b000
[   16.266102] 5ea0: 000089a0 c0c50c80 b6ef6a48 b6ef6a48 cdce4000 00000036 0003dcf8 c0647594
[   16.274285] 5ec0: ce83b000 c071610c 00000001 00000001 00000010 c0c03c54 000089a0 c0717bf0
[   16.282467] 5ee0: 00000000 c036b24c 00000001 6c2d7262 00006e61 00000000 00000000 00040eab
[   16.290649] 5f00: 00000008 000089a0 b6ef6a48 c0c966d0 000089a0 b6ef6a48 cdce4000 c0627ab4
[   16.298832] 5f20: b6ef6a48 cf60ac20 ceccad80 c0325db0 cdca9000 be849af4 00000000 cf60ad80
[   16.307014] 5f40: 00000129 c0222864 cdce4000 00000129 be849b40 c0628ce0 00000000 00000000
[   16.315196] 5f60: 00000000 00000024 cdce5eac 0000000c ceccad80 ceccad80 0000008 000089a0
[   16.323379] 5f80: b6ef6a48 cdce4000 00000036 c0325e54 b6ef6b58 b6ef6a48 b6ef6a10 00000036
[   16.331562] 5fa0: c0222864 c0222660 b6ef6b58 b6ef6a48 00000008 000089a0 b6ef6a48 be849ae8
[   16.339744] 5fc0: b6ef6b58 b6ef6a48 b6ef6a10 00000036 be849c08 b6f724a0 b6f72614 0003dcf8
[   16.347926] 5fe0: 0003cd54 be849ad0 00023e74 b6f24f0c 60000010 00000008 00000000 00000000
[   16.356212] [<bf59b340>] (brnf_device_event [br_netfilter]) from [<c02568e8>] (notifier_call_chain+0x2c/0x6c)
[   16.366140] [<c02568e8>] (notifier_call_chain) from [<c0256a20>] (raw_notifier_call_chain+0x18/0x20)
[   16.375282] [<c0256a20>] (raw_notifier_call_chain) from [<c06474a0>] (register_netdevice+0x52c/0x60c)
[   16.384509] [<c06474a0>] (register_netdevice) from [<c0647594>] (register_netdev+0x14/0x24)
[   16.392869] [<c0647594>] (register_netdev) from [<c071610c>] (br_add_bridge+0x40/0x64)
[   16.400795] [<c071610c>] (br_add_bridge) from [<c0717bf0>] (br_ioctl_deviceless_stub+0x260/0x2fc)
[   16.409679] [<c0717bf0>] (br_ioctl_deviceless_stub) from [<c0627ab4>] (sock_ioctl+0x160/0x2c8)
[   16.418301] [<c0627ab4>] (sock_ioctl) from [<c0325db0>] (do_vfs_ioctl+0x750/0x7c0)
[   16.425879] [<c0325db0>] (do_vfs_ioctl) from [<c0325e54>] (SyS_ioctl+0x34/0x58)
[   16.433197] [<c0325e54>] (SyS_ioctl) from [<c0222660>] (ret_fast_syscall+0x0/0x4c)
[   16.440775] Code: e34c40c5 e5935004 eb339fb4 e5943adc (e7935105) 
[   16.450331] ---[ end trace 1391b07b372e00d3 ]---
[   16.455031] Kernel panic - not syncing: Fatal exception
[   16.460303] CPU2: stopping
[   16.463030] CPU: 2 PID: 2654 Comm: sh Tainted: G      D         4.14.171 #0
[   16.469992] Hardware name: Allwinner sun8i Family
[   16.474725] [<c0228f74>] (unwind_backtrace) from [<c0225790>] (show_stack+0x10/0x14)
[   16.482482] [<c0225790>] (show_stack) from [<c07303a0>] (dump_stack+0x94/0xa8)
[   16.489717] [<c07303a0>] (dump_stack) from [<c0227db8>] (handle_IPI+0xdc/0x17c)
[   16.497036] [<c0227db8>] (handle_IPI) from [<c0201530>] (gic_handle_irq+0x8c/0x90)
[   16.504614] [<c0201530>] (gic_handle_irq) from [<c0226338>] (__irq_svc+0x58/0x8c)
[   16.512098] Exception stack(0xcdff5e30 to 0xcdff5e78)
[   16.517153] 5e20:                                     c0c07d1c 00000003 cdff6000 c02029c4
[   16.525335] 5e40: cdff6000 fffffffe 00000000 cdff6000 00000003 00000011 00000000 00000000
[   16.533516] 5e60: 00000000 cdff5e80 c02568e8 c0202b28 60000013 ffffffff
[   16.540138] [<c0226338>] (__irq_svc) from [<c0202b28>] (vfp_notifier+0x164/0x198)
[   16.547631] [<c0202b28>] (vfp_notifier) from [<c02568e8>] (notifier_call_chain+0x2c/0x6c)
[   16.555817] [<c02568e8>] (notifier_call_chain) from [<c0256b1c>] (atomic_notifier_call_chain+0x34/0x48)
[   16.565218] [<c0256b1c>] (atomic_notifier_call_chain) from [<c0223394>] (copy_thread+0xbc/0xc8)
[   16.573925] [<c0223394>] (copy_thread) from [<c02389f0>] (copy_process.part.2+0xd3c/0x14c4)
[   16.582285] [<c02389f0>] (copy_process.part.2) from [<c02392d4>] (_do_fork+0xbc/0x348)
[   16.590208] [<c02392d4>] (_do_fork) from [<c02395d8>] (sys_fork+0x24/0x2c)
[   16.597088] [<c02395d8>] (sys_fork) from [<c0222660>] (ret_fast_syscall+0x0/0x4c)
[   16.604575] CPU0: stopping
[   16.607293] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G      D         4.14.171 #0
[   16.614604] Hardware name: Allwinner sun8i Family
[   16.619319] [<c0228f74>] (unwind_backtrace) from [<c0225790>] (show_stack+0x10/0x14)
[   16.627071] [<c0225790>] (show_stack) from [<c07303a0>] (dump_stack+0x94/0xa8)
[   16.634303] [<c07303a0>] (dump_stack) from [<c0227db8>] (handle_IPI+0xdc/0x17c)
[   16.641621] [<c0227db8>] (handle_IPI) from [<c0201530>] (gic_handle_irq+0x8c/0x90)
[   16.649199] [<c0201530>] (gic_handle_irq) from [<c0226338>] (__irq_svc+0x58/0x8c)
[   16.656683] Exception stack(0xc0c01f48 to 0xc0c01f90)
[   16.661738] 1f40:                   00000000 000f7798 0f335000 c022f000 ffffe000 c0c03cc4
[   16.669921] 1f60: c0c03c78 ffffffff c0c5d240 00000001 cffe7c40 c0a32a28 c0c01f90 c0c01f98
[   16.678102] 1f80: c0223028 c022302c 60000013 ffffffff
[   16.683160] [<c0226338>] (__irq_svc) from [<c022302c>] (arch_cpu_idle+0x34/0x38)
[   16.690566] [<c022302c>] (arch_cpu_idle) from [<c026eff4>] (do_idle+0xb0/0x124)
[   16.697883] [<c026eff4>] (do_idle) from [<c026f2e4>] (cpu_startup_entry+0x18/0x1c)
[   16.705462] [<c026f2e4>] (cpu_startup_entry) from [<c0a00ca8>] (start_kernel+0x3ac/0x3b8)
[   16.713645] CPU1: stopping
[   16.716362] CPU: 1 PID: 0 Comm: swapper/1 Tainted: G      D         4.14.171 #0
[   16.723672] Hardware name: Allwinner sun8i Family
[   16.728385] [<c0228f74>] (unwind_backtrace) from [<c0225790>] (show_stack+0x10/0x14)
[   16.736138] [<c0225790>] (show_stack) from [<c07303a0>] (dump_stack+0x94/0xa8)
[   16.743370] [<c07303a0>] (dump_stack) from [<c0227db8>] (handle_IPI+0xdc/0x17c)
[   16.750687] [<c0227db8>] (handle_IPI) from [<c0201530>] (gic_handle_irq+0x8c/0x90)
[   16.758264] [<c0201530>] (gic_handle_irq) from [<c0226338>] (__irq_svc+0x58/0x8c)
[   16.765749] Exception stack(0xcf86bf88 to 0xcf86bfd0)
[   16.770805] bf80:                   00000000 0000c0b4 0f344000 c022f000 ffffe000 c0c03cc4
[   16.778988] bfa0: c0c03c78 c0c5d688 40007000 410fc075 00000000 00000000 cf86bfd0 cf86bfd8
[   16.787168] bfc0: c0223028 c022302c 60000013 ffffffff
[   16.792226] [<c0226338>] (__irq_svc) from [<c022302c>] (arch_cpu_idle+0x34/0x38)
[   16.799630] [<c022302c>] (arch_cpu_idle) from [<c026eff4>] (do_idle+0xb0/0x124)
[   16.806948] [<c026eff4>] (do_idle) from [<c026f2e4>] (cpu_startup_entry+0x18/0x1c)
[   16.814525] [<c026f2e4>] (cpu_startup_entry) from [<4020180c>] (0x4020180c)
[   16.821496] Rebooting in 3 seconds..

Likely caused by incompatible builds of kernel and modules: The sysupgrade was custom built and the br-netfilter modules from official build. Try use your own build of br-netfilter instead of the one from downloads.openwrt.org

2 Likes

Thank you for your advice, but i also compiled that package myself and i used my own compiled package this SPI flash boot supported custom build's kernel version is 4.14.171-535eed4f80504ac42a471e66815b485e so that i cannot installed via openwrt's repository shown above.

Sorry, missed that comment in the dump.

Is it possible that the br_netfilter was enabled, built, installed only later after the sysupgrade image was made? In other words, are they product of the same build

Something is wrong in brnf_device_event of br_netfilter module. Likely the issue could be triggered on first creation of bridge device, e.g. ip link add br0 type bridge

1 Like

No problem,
Yes they are product of same build
I used make menuconfig
and make -j 8
you are right , issue triggered on creation of bridged interfaces device

config interface 'lan'
        option type 'bridge'
        option ifname 'eth0 eth1'
        option proto 'dhcp'

service restart network
then Kernel Panic..

It's a small func. Adding a few printk statements in the brnf_device_event func should pinpoint cause of the oops. I am being curious :slight_smile:

How can i add that statements i have no experience editing package functions. Could you please help me more

Here is an example

  1. Change to the linux build directory, mine with x86/64 is at build_dir/target-x86_64_musl/linux-x86_64/linux-5.4.85
  2. Edit brnf_device_event function in net/bridge/br_netfilter_hooks.c. Below is an example
--- net/bridge/br_netfilter_hooks.c.orig	2020-12-23 18:54:11.271933952 +0800
+++ net/bridge/br_netfilter_hooks.c	2020-12-23 18:55:15.283885707 +0800
@@ -965,17 +965,22 @@ static int brnf_device_event(struct noti
 	struct net *net;
 	int ret;
 
+	printk(KERN_NOTICE "## 1\n");
 	if (event != NETDEV_REGISTER || !(dev->priv_flags & IFF_EBRIDGE))
 		return NOTIFY_DONE;
 
 	ASSERT_RTNL();
 
+	printk(KERN_NOTICE "## 2\n");
 	net = dev_net(dev);
 	brnet = net_generic(net, brnf_net_id);
+	printk(KERN_NOTICE "## 3\n");
 	if (brnet->enabled)
 		return NOTIFY_OK;
 
+	printk(KERN_NOTICE "## 4\n");
 	ret = nf_register_net_hooks(net, br_nf_ops, ARRAY_SIZE(br_nf_ops));
+	printk(KERN_NOTICE "## 5\n");
 	if (ret)
 		return NOTIFY_BAD;
 
  1. Recompile with make target/linux/compile V=s. You should see the file got recompiled. At the linux build dir, you should find newly built net/bridge/br_netfilter.ko
  2. Transfer that file to your box. rmmod existing module and insmod the newly built one
  3. Trigger the issue and examine the dmesg content

Thank you @yousong
Here is what i did. When i tried to rmmod br_netfilter but no luck it goes to kernel panic again .
Then i removed kmod-br-netfilter after that
I tried to install compiled packgage modprobe br_netfilter.ko
unfortunately it returned this: failed to find a module named br_netfilter
here is the dump..

## I stopped firewall to obtain SSH access
root@orangepi-r1:~# /etc/init.d/firewall stop
Warning: Unable to locate ipset utility, disabling ipset support
Warning: Section @zone[0] (lan) cannot resolve device of network 'lan'
Warning: Section @zone[1] (wan) cannot resolve device of network 'wan6'
Warning: Section @zone[0] (lan) has no device, network, subnet or extra options
 * Flushing IPv4 filter table
 * Flushing IPv4 nat table
 * Flushing IPv4 mangle table
 * Flushing conntrack table ...
root@orangepi-r1:~# ls
kmod-br-netfilter_4.14.171-1_arm_cortex-a7_neon-vfpv4.ipk
root@orangepi-r1:~# opkg install kmod-br-netfilter_4.14.171-1_arm_cortex-a7_neon
-vfpv4.ipk 
Installing kmod-br-netfilter (4.14.171-1) to root...
Configuring kmod-br-netfilter.
[13685.356909] kmodloader: loading kernel modules from /etc/modules.d/*
[13685.365879] Bridge firewalling registered
[13685.370038] kmodloader: done loading kernel modules from /etc/modules.d/*
root@orangepi-r1:~# rmmod br_netfilter

*****
*****
[  151.581347] Control: 30c5387d  Table: 4f02c400  DAC: b8d45a60
[  151.587093] Process rmmod (pid: 1570, stack limit = 0xce8ac210)
[  151.593013] Stack: (0xce8adf10 to 0xce8ae000)
[  151.597373] df00:                                     c0c50080 ce8adf30 bf074124 c0637924
[  151.605557] df20: bf074124 bf074124 b6f2ed00 c0637aec c0c500a8 c0c500a8 c0c50788 c0637b54
[  151.613740] df40: bf074108 bf074180 b6f2ed00 bf072f94 c0c03c54 c02a58b0 6e5f7262 69667465
[  151.621922] df60: 7265746c 00000000 00000000 cf01e82c cf9aef00 cf01e3c0 00000000 c0253e34
[  151.630105] df80: ffffe000 c0222864 ce8adfb0 00000006 00222864 00040eab b6f86c48 1fbe3c7e
[  151.638287] dfa0: bef83ea4 c0222660 b6f86c48 1fbe3c7e b6f2ed00 00000000 00000000 00000000
[  151.646470] dfc0: b6f86c48 1fbe3c7e bef83ea4 00000081 00000001 00000000 00000020 00000000
[  151.654653] dfe0: bef83dbc bef83da0 00010fbc b6f5dbe8 a0000010 b6f2ed00 00000000 00000000
[  151.662876] unwind: Index not found bf072f34
[  151.667154] Code: e1a05000 e5934004 eb4840b7 e59536b8 (e7934104) 
[  151.673302] ---[ end trace 72506bd92e4ff9b9 ]---
[  151.677951] Kernel panic - not syncing: Fatal exception
[  151.683185] CPU1: stopping
[  151.685903] CPU: 1 PID: 0 Comm: swapper/1 Tainted: G      D         4.14.171 #0
[  151.693213] Hardware name: Allwinner sun8i Family
[  151.697939] [<c0228f74>] (unwind_backtrace) from [<c0225790>] (show_stack+0x10/0x14)
[  151.705694] [<c0225790>] (show_stack) from [<c06f0ac0>] (dump_stack+0x94/0xa8)
[  151.712928] [<c06f0ac0>] (dump_stack) from [<c0227db8>] (handle_IPI+0xdc/0x17c)
[  151.720248] [<c0227db8>] (handle_IPI) from [<c0201530>] (gic_handle_irq+0x8c/0x90)
[  151.727826] [<c0201530>] (gic_handle_irq) from [<c0226338>] (__irq_svc+0x58/0x8c)
[  151.735311] Exception stack(0xcf86bf88 to 0xcf86bfd0)
[  151.740367] bf80:                   00000000 0000b394 0f347000 c022f000 ffffe000 c0c03cc4
[  151.748549] bfa0: c0c03c78 c0c5b508 40007000 410fc075 00000000 00000000 cf86bfd0 cf86bfd8
[  151.756729] bfc0: c0223028 c022302c 60000013 ffffffff
[  151.761789] [<c0226338>] (__irq_svc) from [<c022302c>] (arch_cpu_idle+0x34/0x38)
[  151.769195] [<c022302c>] (arch_cpu_idle) from [<c026eff4>] (do_idle+0xb0/0x124)
[  151.776514] [<c026eff4>] (do_idle) from [<c026f2e4>] (cpu_startup_entry+0x18/0x1c)
[  151.784091] [<c026f2e4>] (cpu_startup_entry) from [<4020180c>] (0x4020180c)
[  151.791055] CPU0: stopping
[  151.793772] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G      D         4.14.171 #0
[  151.801082] Hardware name: Allwinner sun8i Family
[  151.805797] [<c0228f74>] (unwind_backtrace) from [<c0225790>] (show_stack+0x10/0x14)
[  151.813548] [<c0225790>] (show_stack) from [<c06f0ac0>] (dump_stack+0x94/0xa8)
[  151.820780] [<c06f0ac0>] (dump_stack) from [<c0227db8>] (handle_IPI+0xdc/0x17c)
[  151.828096] [<c0227db8>] (handle_IPI) from [<c0201530>] (gic_handle_irq+0x8c/0x90)
[  151.835673] [<c0201530>] (gic_handle_irq) from [<c0226338>] (__irq_svc+0x58/0x8c)
[  151.843158] Exception stack(0xc0c01f48 to 0xc0c01f90)
[  151.848213] 1f40:                   00000000 0007000c 0f338000 c022f000 ffffe000 c0c03cc4
[  151.856397] 1f60: c0c03c78 ffffffff c0c5b0c0 00000001 cffe7c40 c0a2fa28 c0c01f90 c0c01f98
[  151.864577] 1f80: c0223028 c022302c 60000013 ffffffff
[  151.869636] [<c0226338>] (__irq_svc) from [<c022302c>] (arch_cpu_idle+0x34/0x38)
[  151.877040] [<c022302c>] (arch_cpu_idle) from [<c026eff4>] (do_idle+0xb0/0x124)
[  151.884356] [<c026eff4>] (do_idle) from [<c026f2e4>] (cpu_startup_entry+0x18/0x1c)
[  151.891937] [<c026f2e4>] (cpu_startup_entry) from [<c0a00ca8>] (start_kernel+0x3ac/0x3b8)
[  151.900119] CPU2: stopping
[  151.902836] CPU: 2 PID: 0 Comm: swapper/2 Tainted: G      D         4.14.171 #0
[  151.910146] Hardware name: Allwinner sun8i Family
[  151.914859] [<c0228f74>] (unwind_backtrace) from [<c0225790>] (show_stack+0x10/0x14)
[  151.922610] [<c0225790>] (show_stack) from [<c06f0ac0>] (dump_stack+0x94/0xa8)
[  151.929841] [<c06f0ac0>] (dump_stack) from [<c0227db8>] (handle_IPI+0xdc/0x17c)
[  151.937157] [<c0227db8>] (handle_IPI) from [<c0201530>] (gic_handle_irq+0x8c/0x90)
[  151.944734] [<c0201530>] (gi
*****
*****

root@orangepi-r1:~# opkg remove kmod-br-netfilter
root@orangepi-r1:~# Removing package kmod-br-netfilter from root...

root@orangepi-r1:~# restart
root@orangepi-r1:~# ls
br_netfilter.ko
kmod-br-netfilter_4.14.171-1_arm_cortex-a7_neon-vfpv4.ipk
root@orangepi-r1:~# modprobe br_netfilter.ko 
failed to find a module named br_netfilter



No idea why rmmod caused the panic.

But modprobe probably only searches standard locations, current working directory ignored. You may need to try insmod ./br_netfilter.ko

Here is what i have done:

root@orangepi-r1:~# insmod ./br_netfilter.ko 
[ 1089.871282] ## 1
[ 1089.873157] ## 1
[ 1089.874999] ## 1
[ 1089.876839] ## 1
[ 1089.878725] ## 1
[ 1089.880602] Bridge firewalling registered

root@orangepi-r1:~# vi /etc/config/network
config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

#config interface 'lan'
#        option type 'bridge'
#        option ifname 'eth0 eth1'
#        option proto 'static'

config interface 'wan'
        option ifname 'eth0'
        option proto 'dhcp'
        
root@orangepi-r1:~# vi /etc/config/network
config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth0 eth1'
        option proto 'static'

config interface 'wan'
        option ifname 'eth0'
        option proto 'dhcp'

root@orangepi-r1:~# service network restart

[  266.527776] ## 1
[  266.529936] ## 1
[  266.567571] ## 1
[  266.574567] ## 1
[  268.266578] ## 1
[  268.269116] ## 1
[  268.271030] ## 2
[  268.272906] Unable to handle kernel NULL pointer dereference at virtual address 0000001c
[  268.281079] pgd = ce9545c0
[  268.283839] [0000001c] *pgd=4eb94003, *pmd=4ee82003, *pte=00000000
[  268.290084] Internal error: Oops: 207 [#1] PREEMPT SMP ARM
[  268.295604] Modules linked in: br_netfilter pppoe ppp_async sun8i_ths sun4i_gpadc_iio pppox ppp_generic mmc_spi iptable_nat iptable_mangle iptable_filter ipt_REJECT ipt_MASQUERADE ip_tables cpufreq_dt xt_time xt_tcpudp xt_state xt_nat xt_multiport xt_mark xt_mac xt_limit xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT xt_LOG xt_FLOWOFFLOAD x_tables usbnet usbhid thermal_sys slhc r8152 of_mmc_spi nf_reject_ipv4 nf_nat_redirect nf_nat_masquerade_ipv4 nf_conntrack_ipv4 nf_nat_ipv4 nf_nat nf_log_ipv4 nf_log_common nf_flow_table_hw nf_flow_table nf_defrag_ipv4 nf_conntrack_rtcache nf_conntrack hid_generic crc7 crc_itu_t crc_ccitt hid evdev rtc_sunxi gpio_beeper snd_rawmidi snd_seq_device snd_pcm_oss snd_mixer_oss snd_hwdep gpio_button_hotplug
[  268.360938] CPU: 0 PID: 1936 Comm: netifd Not tainted 4.14.171 #0
[  268.367040] Hardware name: Allwinner sun8i Family
[  268.371747] task: ce922f40 task.stack: ce45a000
[  268.376291] PC is at brnf_device_event+0x7c/0xf8 [br_netfilter]
[  268.382215] LR is at brnf_device_event+0x78/0xf8 [br_netfilter]
[  268.388135] pc : [<bf25035c>]    lr : [<bf250358>]    psr: 60000013
[  268.394402] sp : ce45be50  ip : 00000007  fp : 00000000
[  268.399628] r10: 00000000  r9 : 00000000  r8 : 00000005
[  268.404855] r7 : ce45be90  r6 : 00000000  r5 : 00000007  r4 : c0c50080
[  268.411382] r3 : 00000000  r2 : ce922f40  r1 : 00000000  r0 : 00000004
[  268.417912] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[  268.425049] Control: 30c5387d  Table: 4e9545c0  DAC: fffffffd
[  268.430796] Process netifd (pid: 1936, stack limit = 0xce45a210)
[  268.436804] Stack: (0xce45be50 to 0xce45c000)
[  268.441164] be40:                                     00000000 ffffffec 00000000 c02568e8
[  268.449347] be60: cfb03000 c0c50080 00000000 cfb03010 10000001 c0256a20 00000000 c0c50080
[  268.457530] be80: 00000000 c0645b80 cfb03000 c030c38c cfb03000 00000000 00000001 cfb03000
[  268.465713] bea0: 000089a0 c0c50080 b6e9c5f8 b6e9c5f8 ce45a000 00000036 0003dcf8 c0645c74
[  268.473896] bec0: cfb03000 c06d7c84 00000001 00000001 00000010 c0c03c54 000089a0 c06d970c
[  268.482077] bee0: 00000000 ce45bf08 ce45bf80 6c2d7262 00006e61 00000000 00000000 00040eab
[  268.490260] bf00: cf837d3c 000089a0 b6e9c5f8 c0c944e0 000089a0 b6e9c5f8 ce45a000 c06267d0
[  268.498443] bf20: b6e9c5f8 cf6ac020 ce8be000 c03257fc cfb03000 bebc8bdc 00000000 cf6ac600
[  268.506626] bf40: 00000129 c0222864 ce45a000 00000129 bebc8c28 c06279fc 00000000 00000000
[  268.514809] bf60: 00000000 cf8fd540 cf8fd540 bebc8b48 ce8be000 ce8be000 00000008 000089a0
[  268.522992] bf80: b6e9c5f8 ce45a000 00000036 c03258a0 b6e9c708 b6e9c5f8 b6e9c5c0 00000036
[  268.531174] bfa0: c0222864 c0222660 b6e9c708 b6e9c5f8 00000008 000089a0 b6e9c5f8 bebc8ae8
[  268.539357] bfc0: b6e9c708 b6e9c5f8 b6e9c5c0 00000036 bebc8c08 b6f18d80 b6e9cf24 0003dcf8
[  268.547540] bfe0: 0003cd54 bebc8ad0 00023e74 b6ecaf0c 60000010 00000008 00000000 00000000
[  268.555778] [<bf25035c>] (brnf_device_event [br_netfilter]) from [<c02568e8>] (notifier_call_chain+0x2c/0x6c)
[  268.565702] [<c02568e8>] (notifier_call_chain) from [<c0256a20>] (raw_notifier_call_chain+0x18/0x20)
[  268.574847] [<c0256a20>] (raw_notifier_call_chain) from [<c0645b80>] (register_netdevice+0x52c/0x60c)
[  268.584077] [<c0645b80>] (register_netdevice) from [<c0645c74>] (register_netdev+0x14/0x24)
[  268.592441] [<c0645c74>] (register_netdev) from [<c06d7c84>] (br_add_bridge+0x40/0x64)
[  268.600367] [<c06d7c84>] (br_add_bridge) from [<c06d970c>] (br_ioctl_deviceless_stub+0x260/0x2fc)
[  268.609249] [<c06d970c>] (br_ioctl_deviceless_stub) from [<c06267d0>] (sock_ioctl+0x160/0x2c8)
[  268.617869] [<c06267d0>] (sock_ioctl) from [<c03257fc>] (do_vfs_ioctl+0x750/0x7c0)
[  268.625446] [<c03257fc>] (do_vfs_ioctl) from [<c03258a0>] (SyS_ioctl+0x34/0x58)
[  268.632765] [<c03258a0>] (SyS_ioctl) from [<c0222660>] (ret_fast_syscall+0x0/0x4c)
[  268.640343] Code: e34b3f25 e5935004 eb40cbad e59436b8 (e7935105) 
[  268.646571] ---[ end trace fab466625ac69a77 ]---
[  268.651217] Kernel panic - not syncing: Fatal exception
[  268.656453] CPU1: stopping
[  268.659172] CPU: 1 PID: 0 Comm: swapper/1 Tainted: G      D         4.14.171 #0
[  268.666482] Hardware name: Allwinner sun8i Family
[  268.671203] [<c0228f74>] (unwind_backtrace) from [<c0225790>] (show_stack+0x10/0x14)
[  268.678958] [<c0225790>] (show_stack) from [<c06f0ac0>] (dump_stack+0x94/0xa8)
[  268.686191] [<c06f0ac0>] (dump_stack) from [<c0227db8>] (handle_IPI+0xdc/0x17c)
[  268.693510] [<c0227db8>] (handle_IPI) from [<c0201530>] (gic_handle_irq+0x8c/0x90)
[  268.701088] [<c0201530>] (gic_handle_irq) from [<c0226338>] (__irq_svc+0x58/0x8c)
[  268.708573] Exception stack(0xcf86bf88 to 0xcf86bfd0)
[  268.713629] bf80:                   00000000 0000f284 0f347000 c022f000 ffffe000 c0c03cc4
[  268.721812] bfa0: c0c03c78 c0c5b508 40007000 410fc075 00000000 00000000 cf86bfd0 cf86bfd8
[  268.729992] bfc0: c0223028 c022302c 60000013 ffffffff
[  268.735051] [<c0226338>] (__irq_svc) from [<c022302c>] (arch_cpu_idle+0x34/0x38)
[  268.742457] [<c022302c>] (arch_cpu_idle) from [<c026eff4>] (do_idle+0xb0/0x124)
[  268.749776] [<c026eff4>] (do_idle) from [<c026f2e4>] (cpu_startup_entry+0x18/0x1c)
[  268.757354] [<c026f2e4>] (cpu_startup_entry) from [<4020180c>] (0x4020180c)
[  268.764319] CPU3: stopping
[  268.767037] CPU: 3 PID: 0 Comm: swapper/3 Tainted: G      D         4.14.171 #0
[  268.774347] Hardware name: Allwinner sun8i Family
[  268.779060] [<c0228f74>] (unwind_backtrace) from [<c0225790>] (show_stack+0x10/0x14)
[  268.786812] [<c0225790>] (show_stack) from [<c06f0ac0>] (dump_stack+0x94/0xa8)
[  268.794042] [<c06f0ac0>] (dump_stack) from [<c0227db8>] (handle_IPI+0xdc/0x17c)
[  268.801359] [<c0227db8>] (handle_IPI) from [<c0201530>] (gic_handle_irq+0x8c/0x90)
[  268.808936] [<c0201530>] (gic_handle_irq) from [<c0226338>] (__irq_svc+0x58/0x8c)
[  268.816420] Exception stack(0xcf86ff88 to 0xcf86ffd0)
[  268.821477] ff80:                   00000000 00008adc 0f365000 c022f000 ffffe000 c0c03cc4
[  268.829660] ffa0: c0c03c78 c0c5b508 40007000 410fc075 00000000 00000000 cf86ffd0 cf86ffd8
[  268.837841] ffc0: c0223028 c022302c 60000013 ffffffff
[  268.842899] [<c0226338>] (__irq_svc) from [<c022302c>] (arch_cpu_idle+0x34/0x38)
[  268.850303] [<c022302c>] (arch_cpu_idle) from [<c026eff4>] (do_idle+0xb0/0x124)
[  268.857619] [<c026eff4>] (do_idle) from [<c026f2e4>] (cpu_startup_entry+0x18/0x1c)
[  268.865195] [<c026f2e4>] (cpu_startup_entry) from [<4020180c>] (0x4020180c)
[  268.872159] CPU2: stopping
[  268.874876] CPU: 2 PID: 0 Comm: swapper/2 Tainted: G      D         4.14.171 #0
[  268.882187] Hardware name: Allwinner sun8i Family
[  268.886900] [<c0228f74>] (unwind_backtrace) from [<c0225790>] (show_stack+0x10/0x14)
[  268.894653] [<c0225790>] (show_stack) from [<c06f0ac0>] (dump_stack+0x94/0xa8)
[  268.901884] [<c06f0ac0>] (dump_stack) from [<c0227db8>] (handle_IPI+0xdc/0x17c)
[  268.909202] [<c0227db8>] (handle_IPI) from [<c0201530>] (gic_handle_irq+0x8c/0x90)
[  268.916779] [<c0201530>] (gic_handle_irq) from [<c0226338>] (__irq_svc+0x58/0x8c)
[  268.924265] Exception stack(0xcf86df88 to 0xcf86dfd0)
[  268.929320] df80:                   00000000 0000deb4 0f356000 c022f000 ffffe000 c0c03cc4
[  268.937504] dfa0: c0c03c78 c0c5b508 40007000 410fc075 00000000 00000000 cf86dfd0 cf86dfd8
[  268.945684] dfc0: c0223028 c022302c 60000013 ffffffff
[  268.950743] [<c0226338>] (__irq_svc) from [<c022302c>] (arch_cpu_idle+0x34/0x38)
[  268.958146] [<c022302c>] (arch_cpu_idle) from [<c026eff4>] (do_idle+0xb0/0x124)
[  268.965462] [<c026eff4>] (do_idle) from [<c026f2e4>] (cpu_startup_entry+0x18/0x1c)
[  268.973038] [<c026f2e4>] (cpu_startup_entry) from [<4020180c>] (0x4020180c)
[  268.980007] Rebooting in 3 seconds..

Well, a good start. Now we know it's one of the two lines between 2 and 3, or their descendents :slight_smile: More prints should reveal more.

but , there is no debug associated with ## 3 and later so what should i do now :slightly_smiling_face:
all prints are like shown above.

Add more printks before ##3 to find out which pointer is invalid.

If the above is too cumbersome to continue, I would suggest a clean build with kmod-br-netfilter builtin in the image. I got the feeling that likely one way or another the issue was caused by inconsistencies between kernel and kmod

1 Like

Thank you @yousong
i added more printks like this

struct net *net;
	int ret;
	printk(KERN_NOTICE "## 1\n");
	if (event != NETDEV_REGISTER || !(dev->priv_flags & IFF_EBRIDGE))
	printk(KERN_NOTICE "## 1.1\n");
		return NOTIFY_DONE;

	ASSERT_RTNL();
	
	printk(KERN_NOTICE "## 2\n");
	net = dev_net(dev);
	printk(KERN_NOTICE "## 2.1\n");
	brnet = net_generic(net, brnf_net_id);
	printk(KERN_NOTICE "## 3\n");
	if (brnet->enabled)
		return NOTIFY_OK;
	printk(KERN_NOTICE "## 4\n");
	ret = nf_register_net_hooks(net, br_nf_ops, ARRAY_SIZE(br_nf_ops));
	printk(KERN_NOTICE "## 5\n");
	if (ret)
		return NOTIFY_BAD;

a weird thing happened for this time you can see from the shown below dumps . I installed new br_netfilter.ko and activated bridged interfaces but no kernel panic occured. After that when i give an ip to bridge it causes kernel panic i didn't understand what happening here. :thinking: so i will try to clean build. Do you mean should I compile that kmod package within sysupgrade image ? i will try

root@alfa:/home/alfa# cat < /dev/ttyUSB0 
[  293.860177] ## 1
[  293.862052] ## 1.1
[  293.864294] ## 1
[  293.866166] ## 1.1
[  293.904706] ## 1
[  293.906587] ## 1.1
[  293.913516] ## 1
[  293.915403] ## 1.1
[  295.607015] ## 1
[  295.608888] ## 1.1
[  295.611536] ## 1
[  295.615157] ## 1
[  295.617020] ## 1.1
[  295.619773] Generic PHY 0.1:01: attached PHY driver [Generic PHY] (mii_bus:phy_addr=0.1:01, irq=POLL)
[  295.631069] dwmac-sun8i 1c30000.ethernet eth0: No MAC Management Counters available
[  295.638995] dwmac-sun8i 1c30000.ethernet eth0: PTP not supported by HW
[  295.646001] ## 1
[  295.647978] ## 1.1
[  295.650528] br-lan: port 1(eth0) entered blocking state
[  295.656095] br-lan: port 1(eth0) entered disabled state
[  295.661397] ## 1
[  295.663473] ## 1.1
[  295.665677] ## 1
[  295.667546] ## 1.1
[  295.669696] ## 1
[  295.671568] ## 1.1
[  295.674127] device eth0 entered promiscuous mode
[  295.678902] ## 1
[  295.680776] ## 1.1
[  295.683212] ## 1
[  295.685084] ## 1.1
[  295.687909] ## 1
[  295.689776] ## 1.1
[  295.691851] ## 1
[  295.694047] ## 1.1
[  295.696203] ## 1
[  295.698066] ## 1.1
[  295.703993] ## 1
[  295.705864] ## 1.1
[  295.74693] ## 1
[  295.748775] ## 1.1
[  295.751646] br-lan: port 2(eth1) entered blocking state
[  295.757148] br-lan: port 2(eth1) entered disabled state
[  295.762683] ## 1
[  295.764544] ## 1.1
[  295.766694] ## 1
[  295.768539] ## 1.1
[  295.770630] ## 1
[  295.772711] ## 1.1
[  295.774749] device eth1 entered promiscuous mode
[  295.779439] ## 1
[  295.781291] ## 1.1
[  295.784149] ## 1
[  295.785998] ## 1.1
[  295.788262] ## 1
[  295.790109] ## 1.1
[  297.752846] dwmac-sun8i 1c30000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
[  297.761439] br-lan: port 1(eth0) entered blocking state
[  297.766710] br-lan: port 1(eth0) entered forwarding state
[  297.773913] ## 1
[  297.775785] ## 1.1
[  297.778116] ## 1
[  297.779966] ## 1.1

root@orangepi-r1:~# ifconfig
br-lan    Link encap:Ethernet  HWaddr 02:42:BF:69:B8:EA  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:224 errors:0 dropped:1 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:22867 (22.3 KiB)  TX bytes:0 (0.0 B)

eth0      Link encap:Ethernet  HWaddr 02:42:BF:69:B8:EA  
          UP BROAT RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:870 errors:0 dropped:0 overruns:0 frame:0
          TX packets:284 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:193465 (188.9 KiB)  TX bytes:50202 (49.0 KiB)
          Interrupt:32 

eth1      Link encap:Ethernet  HWaddr C0:74:2B:FF:B7:91  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:96 errors:0 dropped:0 overruns:0 frame:0
          TX packets:96 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:7872 (7.6 KiB)  TX bytes:7872 (7.6 KiB)

root@orangepi-r1:~# lsmod | grep br_netfilter
br_netfilter           20480  0 

root@orangepi-r1:~# ifconfig br-lan inet 192.168.253.55

root@orangepi-r1:~# [  612.784432] Unable to handle kernel NULL pointer dereference at virtual address 0000002f
[  612.792567] pgd = c0003000
[  612.795295] [0000002f] *pgd=80000040004003, *pmd=00000000
[  612.800714] Internal error: Oops: 207 [#1] PREEMPT SMP ARM
[  612.806201] Modules linked in: br_netfilter pppoe ppp_async sun8i_ths sun4i_gpadc_iio pppox ppp_generic mmc_spi iptable_nat iptable_mangle iptable_filter ipt_REJECT ipt_MASQUERADE ip_tables cpufreq_dt xt_time xt_tcpudp xt_state xt_nat xt_multiport xt_mark xt_mac xt_limitxt_conntrack xt_comment xt_TCPMSS xt_REDIRECT xt_LOG xt_FLOWOFFLOAD x_tables usbnet usbhid thermal_sys slhc r8152 of_mmc_spi nf_reject_ipv4 nf_nat_redirect nf_nat_masquerade_ipv4 nf_conntrack_ipv4 nf_nat_ipv4 nf_nat nf_log_ipv4 nf_log_common nf_flow_table_hw nf_flow_table nf_defrag_ipv4 nf_conntrack_rtcache nf_conntrack hid_generic crc7 crc_itu_t crc_ccitt hid evdev rtc_sunxi gpio_beeper snd_rawmidi snd_seq_device snd_pcm_oss snd_mixer_oss snd_hwdep gpio_button_hotplug
[  612.871472] CPU: 2 PID: 0 Comm: swapper/2 Not tainted 4.14.171 #0
[  612.877565] Hardware name: Allwinner sun8i Family
[  612.882270] task: cf843f00 task.stack: cf86c000
[  612.886814] PC is at br_nf_dev_xmit+0x10/0x88 [br_netfilter]
[  612.892482] LR is at br_dev_xmit+0x48/0x25c
[  612.896667] pc : [<bf250214>]    lr : [<c06d4aa4>]    psr: 20000113
[  612.902934] sp : cf86daf0  ip : c0a52ea8  fp : c0c02d00
[  612.908161] r10: c0c04ed0  r9 : c0c04ac8  r8 : cee13a00
[  612.913387] r7 : 0f356000  r6 : cf90d000  r5 : c0a52ea8  r4 : 0000002a
[  612.919915] r3 : bf250204  r2 : cf843f00  r1 : cf90d000  r0 : ced7b0c0
[  612.926444] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
[  612.933580] Control: 30c5387d  Table: 4f9cbc80  DAC: 82178e12
[  612.939326] Process swapper/2 (pid: 0, stack limit = 0xcf86c210)
[  612.945334] Stack: (0xcf86daf0 to 0xcf86e000)
[  612.949697] dae0:                                     ced7b0c0 c0a52ea8 cf90d000 c06d4aa4
[  612.957880] db00: cf90d000 c0641ea0 cf86db3f 00000000 00000000 ced7b0c0 00000000 cf90d000
[  612.966062] db20: 00000000 cee13a00 c0c04ac8 c064239c cee13700 cf86db70 00000806 ced7b0c0
[  612.974245] db40: c0a4b738 00000002 cf90d000 cee13a00 cf90d000 0000002a cee13700 c0642968
[  612.982427] db60: cef71508 0000001c 00000000 cf93d080 fffffff4 00000000 cf900 cf93d080
[  612.990610] db80: 10fda8c0 37fda8c0 cee13700 cefd0800 c0c03c54 00000000 cf90d000 cf93d080
[  612.998793] dba0: 10fda8c0 37fda8c0 cee13700 c06a90ac 37fda8c0 00000000 cef71508 00000000
[  613.006975] dbc0: cf93d080 00000000 c0a4bdc0 c025aef8 00000002 cefd0830 cfd9f6c0 00007a93
[  613.015158] dbe0: 00000000 00000000 cefd0830 00040eab ceee0900 cefd0800 ced7bb40 ceee0900
[  613.023340] dc00: 00000001 cefd081c 00000001 cf90d000 01080020 c064ceb8 cefd0800 cefd0814
[  613.031523] dc20: ceee0900 c064ff90 cefd0800 ceee0900 00000000 cf90d000 00000000 ceee09ac
[  613.039706] dc40: cf90d000 c065007c 00000000 00000000 cf90d000 cefd0800 cf90d000 ceee0900
[  613.047888] dc60: cf90d000 00000000 ceee09ac c067d440 00000000 10fda8c0 00000001 ceee0900
[  613.056071] dc80: 00000001 c0c50080 cf90d000 00000000 ceee09ac c067dfa0 00000001 00000004
[  613.064253] dca0: ce896902 00000000 cf90d000 00000000 c0c50080 c067d520 ceee0900 00000001
[  613.072436] dcc0: c0c50080 cf90d000 00000008 c067abac cecf0140 ceb8807c ceee0900 00000002
[  613.080618] dce0: cf90d002 cf90d000 cf90d000 00000000 c0c50080 c067a844 00000001 ceee0900
[  613.088801] dd00: 00000001 cf90d000 cf90d000 c0679ce8 00000000 00000000 00000002 cf90d000
[  613.096984] dd20: 00000000 00000000 c0c50080 c06795e0 c0c0601c ceee0900 c0679a74 c0641190
[  613.105167] dd40: 00000000 00000000 01080020 ceee0900 0000011b 00000000 000003ea c0261800
[  613.113349] dd60: 00000000 cf831840 00000001 00000000 00001000 c0c04ac8 ceee0900 cede8042
[  613.121532] dd80: 00000000 cf90d540 00000000 cf069200 01080020 c06433b0 00000001 cf86dda0
[  613.129714] dda0: cf069200 ceee0900 cf069200 ceee0900 cf069200 cede8042 00000000 c06d8a78
[  613.137896] ddc0: 00000000 00000001 00000000 00000000 00000000 00000002 cf831840 c0c03d44
[  613.146079] dde0: 00000d80 00000002 00000000 ceee0900 00000003 cf86de3c cede8042 00000042
[  613.154261] de00: cede8000 cf069200 01080020 c06d8d38 cf86de3c c06d8ac0 ceee0900 00000001
[  613.162444] de20: c0c04ac8 c0c04ed0 cf1ba000 c0640e80 00000002 00000000 c0c50080 ceee0900
[  613.170626] de40: 00000000 00000000 cfd9b4f4 00000000 00000000 00000020 00000000 00000002
[  613.178809] de60: cf86de60 ceee0900 cfda2730 00000001 00000000 cfda2688 00000040 cfda272c
[  613.186992] de80: 0f356000 c0641480 cfda2730 00000001 00000040 00007a30 c0c02d00 0000012c
[  613.195174] dea0: cf86dec0 c0643784 cfda2680 c0a4c680 c0c50cac c0c04ac8 c084179c c0845078
[  613.203357] dec0: cf86dec0 cf86dec0 cf86dec8 cf86dec8 0000008e 00000000 00000003 c0c0208c
[  613.211539] dee0: c0c02080 40000003 ffffe000 00000101 c0c02080 c0201618 00000000 00000000
[  613.219722] df00: cfda0a10 c0a454c8 c0c5bbc0 0000000a 00007a30 c0c02d00 c070e04c 00200042
[  613.227905] df20: 00000000 c0a4b994 cf86df88 00000000 00000002 cf86df88 d0803000 00000000
[  613.236087] df40: 00000000 c023f0a0 c0a4b994 c0227d80 c0c03f08 c0c13124 d080200c d0802000
[  613.244270] df60: cf86df88 c0201530 c022302c 60000013 ffffffff cf86dfbc 40007000 cf86c000
[  613.252453] df80: 00000000 c0226338 00000000 00012ab4 0f356000 c022f000 ffffe000 c0c03cc4
[  613.260635] dfa0: c0c03c78 c0c5b508 40007000 410fc075 00000000 00000000 cf86dfd0 cf86dfd8
[  613.268818] dfc0: c0223028 c022302c 60000013 ffffffff ffffe000 00000000 ffffe000 c026eff4
[  613.277000] dfe0: 00000085 00000000 30c0387d c026f2e4 4f82b780 4020180c 00000000 00000000
[  613.285233] [<bf250214>] (br_nf_dev_xmit [br_netfilter]) from [<c06d4aa4>] (br_dev_xmit+0x48/0x25c)
[  613.294295] [<c06d4aa4>] (br_dev_xmit) from [<c064239c>] (dev_hard_start_xmit+0x80/0x104)
[  613.302482] [<c064239c>] (dev_hard_start_xmit) from [<c0642968>] (__dev_queue_xmit+0x454/0x5a0)
[  613.311192] [<c0642968>] (__dev_queue_xmit) from [<c06a90ac>] (arp_solicit+0x1dc/0x1f8)
[  613.319205] [<c06a90ac>] (arp_solicit) from [<c064ceb8>] (neigh_probe+0x5c/0x84)
[  613.326610] [<c064ceb8>] (neigh_probe) from [<c064ff90>] (__neigh_event_send+0x250/0x2e8)
[  613.334795] [<c064ff90>] (__neigh_event_send) from [<c065007c>] (neigh_resolve_output+0x54/0x180)
[  613.343676] [<c065007c>] (neigh_resolve_output) from [<c067d440>] (ip_finish_output2+0x2b0/0x314)
[  613.352557] [<c067d440>] (ip_finish_output2) from [<c067dfa0>] (ip_output+0xac/0xbc)
[  613.360308] [<c067dfa0>] (ip_output) from [<c067abac>] (ip_forward+0x324/0x3a4)
[  613.367625] [<c067abac>] (ip_forward) from [<c0679ce8>] (ip_rcv+0x274/0x294)
[  613.37469] [<c0679ce8>] (ip_rcv) from [<c0641190>] (__netif_receive_skb_core+0x818/0x9e4)
[  613.382952] [<c0641190>] (__netif_receive_skb_core) from [<c06433b0>] (netif_receive_skb_internal+0x11c/0x134)
[  613.392959] [<c06433b0>] (netif_receive_skb_internal) from [<c06d8a78>] (br_handle_frame_finish+0x458/0x4a0)
[  613.402791] [<c06d8a78>] (br_handle_frame_finish) from [<c06d8d38>] (br_handle_frame+0x278/0x2a0)
[  613.411669] [<c06d8d38>] (br_handle_frame) from [<c0640e80>] (__netif_receive_skb_core+0x508/0x9e4)
[  613.420721] [<c0640e80>] (__netif_receive_skb_core) from [<c0641480>] (process_backlog+0xa4/0x13c)
[  613.429687] [<c0641480>] (process_backlog) from [<c0643784>] (net_rx_action+0x138/0x2fc)
[  613.437787] [<c0643784>] (net_rx_action) from [<c0201618>] (__do_softirq+0xe0/0x240)
[  613.445544] [<c0201618>] (__do_softirq) from [<c023f0a0>] (irq_exit+0xd4/0x138)
[  613.452868] [<c023f0a0>] (irq_exit) from [<c0227d80>] (handle_IPI+0xa4/0x17c)
[  613.460010] [<c0227d80>] (handle_IPI) from [<c0201530>] (gic_handle_irq+0x8c/0x90)
[  613.467587] [<c0201530>] (gic_handle_i) from [<c0226338>] (__irq_svc+0x58/0x8c)
[  613.475072] Exception stack(0xcf86df88 to 0xcf86dfd0)
[  613.480128] df80:                   00000000 00012ab4 0f356000 c022f000 ffffe000 c0c03cc4
[  613.488310] dfa0: c0c03c78 c0c5b508 40007000 410fc075 00000000 00000000 cf86dfd0 cf86dfd8
[  613.496490] dfc0: c0223028 c022302c 60000013 ffffffff
[  613.501550] [<c0226338>] (__irq_svc) from [<c022302c>] (arch_cpu_idle+0x34/0x38)
[  613.508956] [<c022302c>] (arch_cpu_idle) from [<c026eff4>] (do_ide+0xb0/0x124)
[  613.516274] [<c026eff4>] (do_idle) from [<c026f2e4>] (cpu_startup_entry+0x18/0x1c)
[  613.523850] [<c026f2e4>] (cpu_startup_entry) from [<4020180c>] (0x4020180c)
[  613.530817] Code: e92d4070 e5904054 e3540000 0a000019 (e5d43005) 
[  613.536940] ---[ end trace b6a1f8de6ab1f5f0 ]---
[  613.541568] Kernel panic - not syncing: Fatal exception in interrupt
[  613.547929] CPU3: stopping
[  613.550648] CPU: 3 PID: 0 Comm: swapper/3 Tainted: G      D         4.14.171 #0
[  613.557959] Hardware name: Allwinner sun8i Family
[  613.562677] [<c0228f74>] (unwind_backtrace) from [<c0225790>] (show_stack+0x10/0x14)
[  613.570432] [<c025790>] (show_stack) from [<c06f0ac0>] (dump_stack+0x94/0xa8)
[  613.584981] [<c0227db8>] (handle_IPI) from [<c0201530>] (gic_handle_irq+0x8c/0x90)
[  613.592557] [<c0201530>] (gic_handle_irq) from [<c0226338>] (__irq_svc+0x58/0x8c)
[  613.600042] Exception stack(0xcf86ff88 to 0xcf86ffd0)
[  613.605098] ff80:                   00000000 00016664 0f365000 c022f000 ffffe000 c0c03cc4
[  613.613281] ffa0: c0c03c78 c0c5b508 40007000 410fc075 00000000 00000000 cf86ffd0 cf86ffd8
[  613.621462] ffc0: c0223028 c022302c 60000013 ffffffff
[  613.626520] [<c0226338>] (__irq_svc) from [<c022302c>] (arch_cpu_idle+0x34/0x38)
[  613.633924] [<c022302c>] (arch_cpu_idle) from [<c026eff4>] (do_idle+0xb0/0x124)
[  613.641241] [<c026eff4>] (do_idle) from [<c026f2e4>] (cpu_startup_entry+0x18/0x1c)
[  613.648816] [<c026f2e4>] (cpu_startup_entry) from [<4020180c>] (0x402080c)
[  613.655780] CPU0: stopping
[  613.658497] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G      D         4.14.171 #0
[  613.665808] Hardware name: Allwinner sun8i Family
[  613.670521] [<c0228f74>] (unwind_backtrace) from [<c0225790>] (show_stack+0x10/0x14)
[  613.678272] [<c0225790>] (show_stack) from [<c06f0ac0>] (dump_stack+0x94/0xa8)
[  613.685502] [<c06f0ac0>] (dump_stack) from [<c0227db8>] (handle_IPI+0xdc/0x17c)
[  613.692820] [<c0227db8>] (handle_IPI) from [<c0201530>] (gic_handle_irq+0x8c/0x90)
[  613.700396] [<c0201530>] (gic_handle_irq) from [<c0226338>] (__irq_svc+0x58/0x8c)
[  613.707881] Exception stack(0xc0c01f48 to 0xc0c01f90)
[  613.712937] 1f40:                   00000000 000b0924 0f338000 c022f000 ffffe000 c0c03cc4
[  613.721120] 1f60: c0c03c78 ffffffff c0c5b0c0 00000001 cffe7c40 c0a2fa28 c0c01f90 c0c01f98
[  613.729301] 1f80: c0223028 c022302c 60000013 ffffffff
[  613.734359] [<c0226338>] (__irq_svc) from [<c022302c>] (arch_cpu_idle+0x34/0x38)
[  613.741763] [<c022302c>] (arch_cpu_idle) from [<c026eff4>] (do_idle+0xb0/0x124)
[  613.749080] [<c026eff4>] (do_idle) from [<c026f2e4>] (cpu_startup_entry+0x18/0x1c)
[  613.756660] [<c026f2e4>] (cpu_startup_entry) from [<c0a00ca8>] (start_kernel+0x3ac/0x3b8)
[  613.764841] CPU1: stopping
[  613.767559] CPU: 1 PID: 0 Comm: swapper/1 Tainted: G      D         4.14.171 #0
[  613.774870] Hardware name: Allwinner sun8i Family
[  613.779582] [<c0228f74>] (unwind_backtrace) from [<c0225790>] (show_stack+0x10/0x14)
[  613.787334] [<c0225790>] (show_stack) from [<c06f0ac0>] (dump_stack+0x94/0xa8)
[  613.794564] [<c06f0ac0>] (dump_stack) from [<c0227db8>] (handle_IPI+0xdc/0x17c)
[  613.801881] [<c0227db8>] (handle_IPI) from [<c0201530>] (gic_handle_irq+0x8c/0x90)
[  613.809458] [<c0201530>] (gic_handle_irq) from [<c0226338>] (__irq_svc+0x58/0x8c)
[  613.816943] Exception stack(0xcf86bf88 to 0xcf86bfd0)
[  613.821999] bf80:                   00000000 0001adf0 0f347000 c022f000 ffffe000 c0c03cc4
[  613.830182] bfa0: c0c03c78 c0c5b508 40007000 410fc075 00000000 00000000 cf86bfd0 cf86bfd8
[  613.838363] bfc0: c0223028 c022302c 60000013 ffffffff
[  613.843422] [<c0226338>] (__irq_svc) from [<c022302c>] (arch_cpu_idle+0x34/0x38)
[  613.850825] [<c022302c>] (arch_cpu_idle) from [<c026eff4>] (do_idle+0xb0/0x124)
[  613.858142] [<c026eff4>] (do_idle) from [<c026f2e4>] (cpu_startup_entry+0x18/0x1c)
[  613.865717] [<c026f2e4>] (cpu_startup_entry) from [<4020180c>] (0x4020180c)
[  613.872685] Rebooting in 3 seconds..

That will cause the function to return early with NOTIFY_DONE. "if" statement without curly braces only attracts the first statement that follows. So it should be something like the following

if (event ...) {
  printk(1.1);
  return ...;
}

@yousong thank you for all
i have solved the problem
i followed your advice and made clean build and select packages above from menuconfig
then there is no kernel panic when i activate the bridge now it takes IP from dhcp and no Kernel Panic
I am going to try filtering traffic between two bridges interfaces then i can see stability..
i am very appreciated to you i learned a lot of things like debugging :slightly_smiling_face: :slightly_smiling_face:

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.