OpenCloudOS-Kernel/net/batman-adv
Sven Eckelmann f22e08932c batman-adv: Fix internal interface indices types
batman-adv uses internal indices for each enabled and active interface.
It is currently used by the B.A.T.M.A.N. IV algorithm to identifify the
correct position in the ogm_cnt bitmaps.

The type for the number of enabled interfaces (which defines the next
interface index) was set to char. This type can be (depending on the
architecture) either signed (limiting batman-adv to 127 active slave
interfaces) or unsigned (limiting batman-adv to 255 active slave
interfaces).

This limit was not correctly checked when an interface was enabled and thus
an overflow happened. This was only catched on systems with the signed char
type when the B.A.T.M.A.N. IV code tried to resize its counter arrays with
a negative size.

The if_num interface index was only a s16 and therefore significantly
smaller than the ifindex (int) used by the code net code.

Both &batadv_hard_iface->if_num and &batadv_priv->num_ifaces must be
(unsigned) int to support the same number of slave interfaces as the net
core code. And the interface activation code must check the number of
active slave interfaces to avoid integer overflows.

Fixes: c6c8fea297 ("net: Add batman-adv meshing protocol")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
2018-02-25 20:19:34 +01:00
..
Kconfig batman-adv: Add license header to Kconfig 2017-12-15 17:24:08 +01:00
Makefile batman-adv: Add SPDX license identifier above copyright header 2017-12-15 17:22:45 +01:00
bat_algo.c batman-adv: Add kernel-doc to externally visible functions 2017-12-15 17:29:24 +01:00
bat_algo.h batman-adv: Add SPDX license identifier above copyright header 2017-12-15 17:22:45 +01:00
bat_iv_ogm.c batman-adv: Fix internal interface indices types 2018-02-25 20:19:34 +01:00
bat_iv_ogm.h batman-adv: Add SPDX license identifier above copyright header 2017-12-15 17:22:45 +01:00
bat_v.c batman-adv: Ignore invalid batadv_v_gw during netlink send 2018-02-25 20:11:11 +01:00
bat_v.h batman-adv: Add SPDX license identifier above copyright header 2017-12-15 17:22:45 +01:00
bat_v_elp.c batman-adv: Convert packet.h to uapi header 2017-12-21 15:35:53 -05:00
bat_v_elp.h batman-adv: Add SPDX license identifier above copyright header 2017-12-15 17:22:45 +01:00
bat_v_ogm.c batman-adv: Convert packet.h to uapi header 2017-12-21 15:35:53 -05:00
bat_v_ogm.h batman-adv: Add SPDX license identifier above copyright header 2017-12-15 17:22:45 +01:00
bitarray.c batman-adv: Use parentheses in function kernel-doc 2017-12-15 17:29:20 +01:00
bitarray.h batman-adv: Add kernel-doc to functions in headers 2017-12-15 17:29:23 +01:00
bridge_loop_avoidance.c batman-adv: Fix netlink dumping of BLA backbones 2018-02-25 20:11:59 +01:00
bridge_loop_avoidance.h batman-adv: Use parentheses in function kernel-doc 2017-12-15 17:29:20 +01:00
debugfs.c batman-adv: Add kernel-doc to externally visible functions 2017-12-15 17:29:24 +01:00
debugfs.h batman-adv: Add SPDX license identifier above copyright header 2017-12-15 17:22:45 +01:00
distributed-arp-table.c batman-adv: Use parentheses in function kernel-doc 2017-12-15 17:29:20 +01:00
distributed-arp-table.h batman-adv: Convert packet.h to uapi header 2017-12-21 15:35:53 -05:00
fragmentation.c batman-adv: invalidate checksum on fragment reassembly 2018-02-25 20:00:44 +01:00
fragmentation.h batman-adv: Use parentheses in function kernel-doc 2017-12-15 17:29:20 +01:00
gateway_client.c batman-adv: Convert packet.h to uapi header 2017-12-21 15:35:53 -05:00
gateway_client.h batman-adv: Add SPDX license identifier above copyright header 2017-12-15 17:22:45 +01:00
gateway_common.c batman-adv: Convert packet.h to uapi header 2017-12-21 15:35:53 -05:00
gateway_common.h batman-adv: Use inline kernel-doc for enum/struct 2017-12-15 17:29:20 +01:00
hard-interface.c batman-adv: Fix internal interface indices types 2018-02-25 20:19:34 +01:00
hard-interface.h batman-adv: Add kernel-doc to functions in headers 2017-12-15 17:29:23 +01:00
hash.c batman-adv: Add kernel-doc to externally visible functions 2017-12-15 17:29:24 +01:00
hash.h batman-adv: Add kernel-doc to functions in headers 2017-12-15 17:29:23 +01:00
icmp_socket.c vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
icmp_socket.h batman-adv: Add SPDX license identifier above copyright header 2017-12-15 17:22:45 +01:00
log.c vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
log.h batman-adv: Add kernel-doc to functions in headers 2017-12-15 17:29:23 +01:00
main.c batman-adv: Convert packet.h to uapi header 2017-12-21 15:35:53 -05:00
main.h batman-adv: Convert packet.h to uapi header 2017-12-21 15:35:53 -05:00
multicast.c batman-adv: Convert packet.h to uapi header 2017-12-21 15:35:53 -05:00
multicast.h batman-adv: Use inline kernel-doc for enum/struct 2017-12-15 17:29:20 +01:00
netlink.c batman-adv: Convert packet.h to uapi header 2017-12-21 15:35:53 -05:00
netlink.h batman-adv: Add SPDX license identifier above copyright header 2017-12-15 17:22:45 +01:00
network-coding.c batman-adv: Convert packet.h to uapi header 2017-12-21 15:35:53 -05:00
network-coding.h batman-adv: Add SPDX license identifier above copyright header 2017-12-15 17:22:45 +01:00
originator.c batman-adv: Fix internal interface indices types 2018-02-25 20:19:34 +01:00
originator.h batman-adv: Fix internal interface indices types 2018-02-25 20:19:34 +01:00
routing.c batman-adv: Convert packet.h to uapi header 2017-12-21 15:35:53 -05:00
routing.h batman-adv: Add SPDX license identifier above copyright header 2017-12-15 17:22:45 +01:00
send.c batman-adv: Add kernel-doc to externally visible functions 2017-12-15 17:29:24 +01:00
send.h batman-adv: Convert packet.h to uapi header 2017-12-21 15:35:53 -05:00
soft-interface.c batman-adv: fix packet checksum in receive path 2018-02-25 20:00:44 +01:00
soft-interface.h batman-adv: Add SPDX license identifier above copyright header 2017-12-15 17:22:45 +01:00
sysfs.c batman-adv: Convert packet.h to uapi header 2017-12-21 15:35:53 -05:00
sysfs.h batman-adv: Add kernel-doc to structs in headers 2017-12-15 17:29:22 +01:00
tp_meter.c batman-adv: Convert packet.h to uapi header 2017-12-21 15:35:53 -05:00
tp_meter.h batman-adv: Add SPDX license identifier above copyright header 2017-12-15 17:22:45 +01:00
translation-table.c batman-adv: Convert packet.h to uapi header 2017-12-21 15:35:53 -05:00
translation-table.h batman-adv: Add SPDX license identifier above copyright header 2017-12-15 17:22:45 +01:00
tvlv.c batman-adv: Convert packet.h to uapi header 2017-12-21 15:35:53 -05:00
tvlv.h batman-adv: Add SPDX license identifier above copyright header 2017-12-15 17:22:45 +01:00
types.h batman-adv: Fix internal interface indices types 2018-02-25 20:19:34 +01:00