Project

General

Profile

Actions

Bug #325

closed

Batman-adv module crashing kernel after setting throughput_override parameter

Added by Kirill Lukonin about 7 years ago. Updated about 6 years ago.

Status:
Rejected
Priority:
Urgent
Target version:
-
Start date:
02/17/2017
Due date:
02/20/2017
% Done:

0%

Estimated time:
12.00 h

Description

Batman module crashes when echoing to sysfs throughput_override file

For example, sysfs parameter is
/sys/class/net/mesh0/batman_adv/throughput_override

echo 0 > /sys/class/net/mesh0/batman_adv/throughput_override - nothing happens. File stays default (0.0 MBit)

echo 1 > /sys/class/net/mesh0/batman_adv/throughput_override - nothing happens. File stays default (0.0 MBit)

echo 10 > /sys/class/net/mesh0/batman_adv/throughput_override - nothing happens. File stays default (0.0 MBit)

echo 100 > /sys/class/net/mesh0/batman_adv/throughput_override - Kernel crashes.

Value can be from 0 to 99 to make it normal, but if it is more than 99 or it is a string, kernel crashes.

Actions #1

Updated by Sven Eckelmann about 7 years ago

  • Status changed from New to Feedback
  • Assignee changed from batman-adv developers to Kirill Lukonin

Just tried it and I can't reproduce it. This is what I did:

$ uname -srvmpio
Linux 4.9.0-1-amd64 #1 SMP Debian 4.9.2-2 (2017-01-12) x86_64 unknown unknown GNU/Linux
$ gcc --version
gcc (Debian 6.3.0-5) 6.3.0 20170124
$ git describe 
v2016.5-17-g61bbb9
$ make CONFIG_BATMAN_ADV_BATMAN_V=y
$ sudo modprobe bridge
$ sudo modprobe libcrc32c
$ sudo insmod build/net/batman-adv/batman-adv.ko
$ sudo sh -c 'echo BATMAN_V > /sys/module/batman_adv/parameters/routing_algo'
$ sudo sh -c 'echo 100 > /sys/class/net/enp0s31f6/batman_adv/throughput_override'
$ sudo sh -c 'echo stringystring > /sys/class/net/enp0s31f6/batman_adv/throughput_override'
$ sudo dmesg|tail
[15098.806772] batman_adv: B.A.T.M.A.N. advanced 2016.5-17-g61bbb9a (compatibility version 15) loaded
[15230.159871] batman_adv: bat0: Adding interface: enp0s31f6
[15230.159880] batman_adv: bat0: The MTU of interface enp0s31f6 is too small (1500) to handle the transport of batman-adv packets. Packets going over this interface will be fragmented on layer2 which could impact the performance. Setting the MTU to 1532 would solve the problem.
[15230.159895] batman_adv: bat0: Interface activated: enp0s31f6
[15264.623886] batman_adv: enp0s31f6: throughput_override: Changing from: 0.0 MBit to: 0.1 MBit
[15297.575130] batman_adv: enp0s31f6: Invalid throughput speed for throughput_override: stringystring

Can you please explain how I can reproduce it. The current instructions from you don't seem to be enough.

Actions #2

Updated by Kirill Lukonin about 7 years ago

Sven Eckelmann wrote:

Just tried it and I can't reproduce it. This is what I did:

[...]

Can you please explain how I can reproduce it. The current instructions from you don't seem to be enough.

Please try to reproduce it with LEDE kernel 4.4.42.

LEDE distro is

DISTRIB_ID='LEDE'
DISTRIB_RELEASE='SNAPSHOT'
DISTRIB_REVISION='r3157-2ef3810'
DISTRIB_CODENAME='reboot'
DISTRIB_TARGET='ar71xx/generic'
DISTRIB_ARCH='mips_24kc'
DISTRIB_DESCRIPTION='LEDE Reboot SNAPSHOT r3157-2ef3810'

Actions #3

Updated by Sven Eckelmann about 7 years ago

Just did it on an OM5P-ACv2 with LEDE 17.01-rc:

root@lede:/# modinfo batman-adv
module:         /lib/modules/4.4.42/batman-adv.ko
alias:          net-pf-16-proto-16-family-batadv
alias:          rtnl-link-batadv
version:        2016.5
description:    B.A.T.M.A.N. advanced
author:         Marek Lindner <mareklindner@neomailbox.ch>, Simon Wunderlich <sw@simonwunderlich.de>
license:        GPL
depends:        libcrc32c,crc16
root@lede:/# echo BATMAN_V > /sys/module/batman_adv/parameters/routing_algo
root@lede:/# batctl if add eth0
root@lede:/# echo 100 > /sys/class/net/eth0/batman_adv/throughput_override
root@lede:/# echo stringystring > /sys/class/net/eth0/batman_adv/throughput_override
root@lede:/# dmesg|tail
[   95.462312] batman_adv: bat0: Interface activated: eth0
[   95.556394] 8021q: adding VLAN 0 to HW filter on device bat0
[  103.575532] batman_adv: bat0: Interface deactivated: eth0
[  103.581066] batman_adv: bat0: Removing interface: eth0
[  131.313908] batman_adv: bat0: Adding interface: eth0
[  131.319010] batman_adv: bat0: The MTU of interface eth0 is too small (1500) to handle the transport of batman-adv packets. Packets going over this interface will be fragmented on layer2 which could impact the performance. Setting the MTU to 1532 would solve the problem.
[  131.343265] batman_adv: bat0: Interface activated: eth0
[  131.449751] 8021q: adding VLAN 0 to HW filter on device bat0
[  159.156106] batman_adv: eth0: throughput_override: Changing from: 0.0 MBit to: 0.1 MBit
[  181.683486] batman_adv: eth0: Invalid throughput speed for throughput_override: stringystring

root@lede:/# iw phy phy1 interface add mesh0 type ibss
root@lede:/# ip link set up dev mesh0
root@lede:/# iw dev mesh0 ibss join foobarland 2412
root@lede:/# batctl if add mesh0
root@lede:/# echo 100 > /sys/class/net/mesh0/batman_adv/throughput_override
root@lede:/# echo stringystring > /sys/class/net/mesh0/batman_adv/throughput_override
root@lede:/# dmesg|tail
[  486.051379] mesh0: Trigger new scan to find an IBSS to join
[  486.748138] mesh0: Creating new IBSS network, BSSID e2:10:dc:81:2f:ff
[  486.778907] IPv6: ADDRCONF(NETDEV_CHANGE): mesh0: link becomes ready
[  509.147694] batman_adv: bat0: Adding interface: mesh0
[  509.152838] batman_adv: bat0: The MTU of interface mesh0 is too small (1500) to handle the transport of batman-adv packets. Packets going over this interface will be fragmented on layer2 which could impact the performance. Setting the MTU to 1532 would solve the problem.
[  509.177219] batman_adv: bat0: Interface activated: mesh0
[  516.785439] mesh0: No active IBSS STAs - trying to scan for other IBSS networks with same SSID (merge)
[  523.951626] batman_adv: mesh0: throughput_override: Changing from: 0.0 MBit to: 0.1 MBit
[  543.481081] batman_adv: mesh0: Invalid throughput speed for throughput_override: stringystring
[  547.505999] mesh0: No active IBSS STAs - trying to scan for other IBSS networks with same SSID (merge)

So no crash happened for me

Actions #4

Updated by Sven Eckelmann about 7 years ago

Repeated the same steps again with current LEDE master

$ ./scripts/diffconfig.sh 
CONFIG_TARGET_ar71xx=y
CONFIG_TARGET_ar71xx_generic=y
CONFIG_TARGET_ar71xx_generic_DEVICE_OM5PAC=y
# CONFIG_FEED_luci is not set
# CONFIG_FEED_packages is not set
# CONFIG_FEED_routing is not set
# CONFIG_FEED_telephony is not set
CONFIG_KMOD_BATMAN_ADV_BATMAN_V=y
CONFIG_KMOD_BATMAN_ADV_BLA=y
CONFIG_KMOD_BATMAN_ADV_DAT=y
CONFIG_KMOD_BATMAN_ADV_DEBUGFS=y
CONFIG_KMOD_BATMAN_ADV_MCAST=y
CONFIG_PACKAGE_ALFRED_VIS=y
CONFIG_PACKAGE_alfred=y
CONFIG_PACKAGE_batctl=y
CONFIG_PACKAGE_kmod-batman-adv=y
CONFIG_PACKAGE_kmod-crypto-crc32c=y
CONFIG_PACKAGE_kmod-crypto-hash=y
CONFIG_PACKAGE_kmod-lib-crc16=y
CONFIG_PACKAGE_kmod-lib-crc32c=y
CONFIG_PACKAGE_kmod-nls-base=y
CONFIG_PACKAGE_kmod-usb-core=y
CONFIG_PACKAGE_kmod-usb2=y
CONFIG_PACKAGE_librt=
$ git describe
reboot-3519-g27040dbf89
$ git -C feeds/routing rev-parse HEAD
f15b8246fabbf042cf520b40876247e654396a54
root@LEDE:/# cat /etc/openwrt_release 
DISTRIB_ID='LEDE'
DISTRIB_RELEASE='SNAPSHOT'
DISTRIB_REVISION='r3519-27040dbf89'
DISTRIB_CODENAME='reboot'
DISTRIB_TARGET='ar71xx/generic'
DISTRIB_ARCH='mips_24kc'
DISTRIB_DESCRIPTION='LEDE Reboot SNAPSHOT r3519-27040dbf89'
DISTRIB_TAINTS='no-all'
root@LEDE:/# modinfo batman-adv
module:         /lib/modules/4.4.49/batman-adv.ko
alias:          net-pf-16-proto-16-family-batadv
alias:          rtnl-link-batadv
version:        2016.5
description:    B.A.T.M.A.N. advanced
author:         Marek Lindner <mareklindner@neomailbox.ch>, Simon Wunderlich <sw@simonwunderlich.de>
license:        GPL
depends:        libcrc32c,crc16
root@lede:/# echo BATMAN_V > /sys/module/batman_adv/parameters/routing_algo
root@lede:/# batctl if add eth0
root@lede:/# echo 100 > /sys/class/net/eth0/batman_adv/throughput_override
root@lede:/# echo stringystring > /sys/class/net/eth0/batman_adv/throughput_override
root@lede:/# dmesg|tail
[   43.076680] done.
[   43.078678] jffs2: notice: (975) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[   70.056721] random: nonblocking pool is initialized
[   76.983307] device eth0 left promiscuous mode
[   76.987852] br-lan: port 1(eth0) entered disabled state
[   77.007025] batman_adv: bat0: Adding interface: eth0
[   77.012078] batman_adv: bat0: The MTU of interface eth0 is too small (1500) to handle the transport of batman-adv packets. Packets going over this interface will be fragmented on layer2 which could impact the performance. Setting the MTU to 1532 would solve the problem.
[   77.036363] batman_adv: bat0: Interface activated: eth0
[   81.022029] batman_adv: eth0: throughput_override: Changing from: 0.0 MBit to: 0.1 MBit
[   86.349553] batman_adv: eth0: Invalid throughput speed for throughput_override: stringystring

root@lede:/# iw phy phy1 interface add mesh0 type ibss
root@lede:/# ip link set up dev mesh0
root@lede:/# iw dev mesh0 ibss join foobarland 2412
root@lede:/# batctl if add mesh0
root@lede:/# echo 100 > /sys/class/net/mesh0/batman_adv/throughput_override
root@lede:/# echo stringystring > /sys/class/net/mesh0/batman_adv/throughput_override
root@lede:/# dmesg|tail
[  154.022117] IPv6: ADDRCONF(NETDEV_UP): mesh0: link is not ready
[  158.947145] mesh0: Trigger new scan to find an IBSS to join
[  160.743327] batman_adv: bat0: Adding interface: mesh0
[  160.748511] batman_adv: bat0: The MTU of interface mesh0 is too small (1500) to handle the transport of batman-adv packets. Packets going over this interface will be fragmented on layer2 which could impact the performance. Setting the MTU to 1532 would solve the problem.
[  160.772863] batman_adv: bat0: Interface activated: mesh0
[  161.711919] mesh0: Trigger new scan to find an IBSS to join
[  163.964707] mesh0: Creating new IBSS network, BSSID 6e:ee:83:1f:ff:77
[  163.995248] IPv6: ADDRCONF(NETDEV_CHANGE): mesh0: link becomes ready
[  164.443552] batman_adv: mesh0: throughput_override: Changing from: 0.0 MBit to: 0.1 MBit
[  171.010890] batman_adv: mesh0: Invalid throughput speed for throughput_override: stringystring

The crash was unfortunately also not reproducible this way.

Actions #5

Updated by Sven Eckelmann about 7 years ago

Just in case somebody thinks that I don't have a second node in my test: I am using a OM2P (only connected via mesh0). And the OM5P-ACv2 is also connected via ethernet connected to a Laptop. Here is the "batctl o" output after setting bat0 up on all three devices:

root@LEDE:/# batctl o
[B.A.T.M.A.N. adv 2016.5, MainIF/MAC: eth0/ac:86:74:01:b5:48 (bat0/7e:ae:57:48:85:14 BATMAN_V)]
   Originator        last-seen ( throughput)  Nexthop           [outgoingIF]
 * ac:86:74:61:6c:20    0.960s (        0.1)  ac:86:74:61:6c:22 [     mesh0]
root@LEDE:/# batctl n
[B.A.T.M.A.N. adv 2016.5, MainIF/MAC: eth0/ac:86:74:61:6c:20 (bat0/02:b2:6c:a3:6d:1f BATMAN_V)]
IF             Neighbor              last-seen
50:7b:9d:ce:26:83    0.410s (        0.1) [      eth0]
ac:86:74:01:b5:4a    0.300s (        0.1) [     mesh0]
$ sudo batctl o
[B.A.T.M.A.N. adv 2016.5-17-g61bbb9a, MainIF/MAC: enp0s31f6/50:7b:9d:ce:26:83 (bat0/12:ff:74:98:00:5c BATMAN_V)]
   Originator        last-seen ( throughput)  Nexthop           [outgoingIF]
 * ac:86:74:61:6c:20    0.820s (        0.1)  ac:86:74:61:6c:20 [ enp0s31f6]
Actions #6

Updated by Kirill Lukonin about 7 years ago

Sven Eckelmann wrote:

Just in case somebody thinks that I don't have a second node in my test: I am using a OM2P (only connected via mesh0). And the OM5P-ACv2 is also connected via ethernet connected to a Laptop. Here is the "batctl o" output after setting bat0 up on all three devices:

[...]

[...]

[...]

Thank you very much.

I don't know really what is it.
I'll try to debug through netconsole, but for now looks like it's not a bug of batman.

Actions #7

Updated by Sven Eckelmann about 6 years ago

  • Status changed from Feedback to Rejected

Closing it because reporter is MIA and we cannot reproduce it.

Actions

Also available in: Atom PDF