linux-hardened/net/batman-adv
Sven Eckelmann d285f52cc0 batman-adv: Fix integer overflow in batadv_iv_ogm_calc_tq
The undefined behavior sanatizer detected an signed integer overflow in a
setup with near perfect link quality

    UBSAN: Undefined behaviour in net/batman-adv/bat_iv_ogm.c:1246:25
    signed integer overflow:
    8713350 * 255 cannot be represented in type 'int'

The problems happens because the calculation of mixed unsigned and signed
integers resulted in an integer multiplication.

      batadv_ogm_packet::tq (u8 255)
    * tq_own (u8 255)
    * tq_asym_penalty (int 134; max 255)
    * tq_iface_penalty (int 255; max 255)

The tq_iface_penalty, tq_asym_penalty and inv_asym_penalty can just be
changed to unsigned int because they are not expected to become negative.

Fixes: c039876892 ("batman-adv: add WiFi penalty")
Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
2016-05-18 11:49:42 +08:00
..
bat_algo.h batman-adv: OGMv2 - add basic infrastructure 2016-02-29 16:05:31 +08:00
bat_iv_ogm.c batman-adv: Fix integer overflow in batadv_iv_ogm_calc_tq 2016-05-18 11:49:42 +08:00
bat_v.c batman-adv: make sure ELP/OGM orig MAC is updated on address change 2016-05-18 11:49:41 +08:00
bat_v_elp.c batman-adv: ELP - send unicast ELP packets for throughput sampling 2016-02-29 16:25:07 +08:00
bat_v_elp.h batman-adv: ELP - compute the metric based on the estimated throughput 2016-02-29 16:25:06 +08:00
bat_v_ogm.c batman-adv: Check hard_iface refcnt before calling function 2016-05-10 18:28:29 +08:00
bat_v_ogm.h batman-adv: OGMv2 - implement originators logic 2016-02-29 16:05:31 +08:00
bitarray.c batman-adv: Use bool as return type for boolean functions 2016-05-10 18:28:54 +08:00
bitarray.h batman-adv: Use bool as return type for boolean functions 2016-05-10 18:28:54 +08:00
bridge_loop_avoidance.c batman-adv: Use bool as return type for boolean functions 2016-05-10 18:28:54 +08:00
bridge_loop_avoidance.h batman-adv: Use bool as return type for boolean functions 2016-05-10 18:28:54 +08:00
debugfs.c batman-adv: Use bool as return type for boolean functions 2016-05-10 18:28:54 +08:00
debugfs.h batman-adv: update copyright years for 2016 2016-02-02 12:55:10 +08:00
distributed-arp-table.c batman-adv: Use bool as return type for boolean functions 2016-05-10 18:28:54 +08:00
distributed-arp-table.h batman-adv: update copyright years for 2016 2016-02-02 12:55:10 +08:00
fragmentation.c batman-adv: Fix checkpatch warning about 'unsigned' type 2016-05-04 02:22:03 +08:00
fragmentation.h batman-adv: update copyright years for 2016 2016-02-02 12:55:10 +08:00
gateway_client.c batman-adv: Use kref_get for batadv_gw_node_add 2016-05-10 18:28:29 +08:00
gateway_client.h batman-adv: update copyright years for 2016 2016-02-02 12:55:10 +08:00
gateway_common.c batman-adv: add throughput override attribute to hard_ifaces 2016-02-29 16:05:32 +08:00
gateway_common.h batman-adv: add throughput override attribute to hard_ifaces 2016-02-29 16:05:32 +08:00
hard-interface.c batman-adv: Use bool as return type for boolean functions 2016-05-10 18:28:54 +08:00
hard-interface.h batman-adv: Create batman soft interfaces within correct netns. 2016-05-10 18:26:44 +08:00
hash.c batman-adv: update copyright years for 2016 2016-02-02 12:55:10 +08:00
hash.h batman-adv: Use bool as return type for boolean functions 2016-05-10 18:28:54 +08:00
icmp_socket.c batman-adv: fix wrong names in kerneldoc 2016-05-04 02:22:03 +08:00
icmp_socket.h batman-adv: update copyright years for 2016 2016-02-02 12:55:10 +08:00
Kconfig batman-adv: clarify CFG80211 dependency 2016-03-02 13:45:47 -05:00
main.c batman-adv: Use kref_get for batadv_tvlv_container_get 2016-05-10 18:28:29 +08:00
main.h batman-adv: Use bool as return type for boolean functions 2016-05-10 18:28:54 +08:00
Makefile batman-adv: OGMv2 - add basic infrastructure 2016-02-29 16:05:31 +08:00
multicast.c batman-adv: fix wrong names in kerneldoc 2016-05-04 02:22:03 +08:00
multicast.h batman-adv: update copyright years for 2016 2016-02-02 12:55:10 +08:00
network-coding.c batman-adv: use batadv_compare_eth when possible 2016-05-10 18:28:54 +08:00
network-coding.h batman-adv: update copyright years for 2016 2016-02-02 12:55:10 +08:00
originator.c batman-adv: Use bool as return type for boolean functions 2016-05-10 18:28:54 +08:00
originator.h batman-adv: Use bool as return type for boolean functions 2016-05-10 18:28:54 +08:00
packet.h batman-adv: add detection for complex bridge loops 2016-05-10 18:26:45 +08:00
routing.c batman-adv: fix skb deref after free 2016-05-18 11:49:38 +08:00
routing.h batman-adv: Use bool as return type for boolean functions 2016-05-10 18:28:54 +08:00
send.c batman-adv: Check hard_iface refcnt before calling function 2016-05-10 18:28:29 +08:00
send.h batman-adv: keep track of when unicast packets are sent 2016-02-29 16:05:32 +08:00
soft-interface.c batman-adv: replace ethertype variable with ETH_P_BATMAN for readability 2016-05-10 18:28:54 +08:00
soft-interface.h batman-adv: Use bool as return type for boolean functions 2016-05-10 18:28:54 +08:00
sysfs.c batman-adv: add detection for complex bridge loops 2016-05-10 18:26:45 +08:00
sysfs.h batman-adv: update copyright years for 2016 2016-02-02 12:55:10 +08:00
translation-table.c batman-adv: Use bool as return type for boolean functions 2016-05-10 18:28:54 +08:00
translation-table.h batman-adv: update copyright years for 2016 2016-02-02 12:55:10 +08:00
types.h batman-adv: add detection for complex bridge loops 2016-05-10 18:26:45 +08:00