linux-hardened/net/batman-adv
Sven Eckelmann 1c2bcc766b batman-adv: Keep fragments equally sized
The batman-adv fragmentation packets have the design problem that they
cannot be refragmented and cannot handle padding by the underlying link.
The latter often leads to problems when networks are incorrectly configured
and don't use a common MTU.

The sender could for example fragment a 1271 byte frame (plus external
ethernet header (14) and batadv unicast header (10)) to fit in a 1280 bytes
large MTU of the underlying link (max. 1294 byte frames). This would create
a 1294 bytes large frame (fragment 2) and a 55 bytes large frame
(fragment 1). The extra 54 bytes are the fragment header (20) added to each
fragment and the external ethernet header (14) for the second fragment.

Let us assume that the next hop is then not able to transport 1294 bytes to
its next hop. The 1294 byte large frame will be dropped but the 55 bytes
large fragment will still be forwarded to its destination.

Or let us assume that the underlying hardware requires that each frame has
a minimum size (e.g. 60 bytes). Then it will pad the 55 bytes frame to 60
bytes. The receiver of the 60 bytes frame will no longer be able to
correctly assemble the two frames together because it is not aware that 5
bytes of the 60 bytes frame are padding and don't belong to the reassembled
frame.

This can partly be avoided by splitting frames more equally. In this
example, the 675 and 674 bytes large fragment frames could both potentially
reach its destination without being too large or too small.

Reported-by: Martin Weinelt <martin@darmstadt.freifunk.net>
Fixes: ee75ed8887 ("batman-adv: Fragment and send skbs larger than mtu")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Acked-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
2017-03-04 17:31:57 +01:00
..
bat_algo.c batman-adv: Allow to disable debugfs support 2016-08-09 07:54:54 +02:00
bat_algo.h batman-adv: netlink: add routing_algo query 2016-08-09 07:54:36 +02:00
bat_iv_ogm.c batman-adv: fix rare race conditions on interface removal 2016-11-08 19:02:39 +01:00
bat_iv_ogm.h batman-adv: Fix bat_(iv|v) function declaration header 2016-06-30 10:29:43 +02:00
bat_v.c batman-adv: Use proper name for gateway list head 2016-10-19 08:37:53 +02:00
bat_v.h batman-adv: Fix bat_(iv|v) function declaration header 2016-06-30 10:29:43 +02:00
bat_v_elp.c batman-adv: retrieve B.A.T.M.A.N. V WiFi neighbor stats from real interface 2016-11-08 19:02:38 +01:00
bat_v_elp.h batman-adv: Keep includes ordered by filename 2016-06-30 10:29:43 +02:00
bat_v_ogm.c batman-adv: Consume skb in receive handlers 2016-11-08 19:02:34 +01:00
bat_v_ogm.h batman-adv: Include main.h in bat_v_ogm.h 2016-06-30 10:29:43 +02:00
bitarray.c batman-adv: Consolidate logging related functions 2016-06-30 10:29:43 +02: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: Allow to disable debugfs support 2016-08-09 07:54:54 +02:00
bridge_loop_avoidance.h batman-adv: add backbone table netlink support 2016-08-09 07:54:43 +02:00
debugfs.c batman-adv: Use octal permissions instead of macros 2016-10-19 08:37:53 +02:00
debugfs.h treewide: remove redundant #include <linux/kconfig.h> 2016-10-11 15:06:33 -07:00
distributed-arp-table.c batman-adv: Add wrapper for ARP reply creation 2016-10-30 11:11:33 +01:00
distributed-arp-table.h batman-adv: update copyright years for 2016 2016-02-02 12:55:10 +08:00
fragmentation.c batman-adv: Keep fragments equally sized 2017-03-04 17:31:57 +01:00
fragmentation.h batman-adv: Use proper name for fragments list head 2016-10-19 08:37:52 +02:00
gateway_client.c batman-adv: Use proper name for gateway list head 2016-10-19 08:37:53 +02:00
gateway_client.h batman-adv: netlink: add gateway table queries 2016-08-09 07:54:40 +02:00
gateway_common.c batman-adv: make GW election code protocol specific 2016-08-09 07:54:29 +02:00
gateway_common.h batman-adv: add throughput override attribute to hard_ifaces 2016-02-29 16:05:32 +08:00
hard-interface.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-11-22 13:27:16 -05:00
hard-interface.h batman-adv: retrieve B.A.T.M.A.N. V WiFi neighbor stats from real interface 2016-11-08 19:02:38 +01:00
hash.c batman-adv: update copyright years for 2016 2016-02-02 12:55:10 +08:00
hash.h batman-adv: Remove unused function batadv_hash_delete 2016-10-17 16:28:45 +02:00
icmp_socket.c batman-adv: Use octal permissions instead of macros 2016-10-19 08:37:53 +02:00
icmp_socket.h batman-adv: Allow to disable debugfs support 2016-08-09 07:54:54 +02:00
Kconfig batman-adv: Allow selecting BATMAN V if CFG80211 is not built 2016-10-17 16:28:48 +02:00
log.c batman-adv: Use octal permissions instead of macros 2016-10-19 08:37:53 +02:00
log.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-10-30 12:42:58 -04:00
main.c batman-adv: Add module alias for batadv netlink family 2016-11-08 19:02:39 +01:00
main.h batman-adv: Use own timer for multicast TT and TVLV updates 2016-10-30 11:11:35 +01:00
Makefile batman-adv: Allow to disable debugfs support 2016-08-09 07:54:54 +02:00
multicast.c batman-adv: Use own timer for multicast TT and TVLV updates 2016-10-30 11:11:35 +01:00
multicast.h batman-adv: Use own timer for multicast TT and TVLV updates 2016-10-30 11:11:35 +01:00
netlink.c batman-adv: Mark batadv_netlink_ops as const 2016-10-30 11:11:32 +01:00
netlink.h batman-adv: netlink: add translation table query 2016-08-09 07:54:37 +02:00
network-coding.c batman-adv: Consume skb in receive handlers 2016-11-08 19:02:34 +01:00
network-coding.h batman-adv: update copyright years for 2016 2016-02-02 12:55:10 +08:00
originator.c This feature and cleanup patchset includes the following changes: 2016-11-09 22:15:28 -05:00
originator.h batman-adv: netlink: add originator and neighbor table queries 2016-08-09 07:54:38 +02:00
packet.h batman-adv: Avoid precedence issues in macros 2016-10-19 08:37:54 +02:00
routing.c batman-adv: Reject unicast packet with zero/mcast dst address 2016-11-08 19:02:36 +01: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: fix rare race conditions on interface removal 2016-11-08 19:02:39 +01:00
send.h batman-adv: fix rare race conditions on interface removal 2016-11-08 19:02:39 +01:00
soft-interface.c batman-adv: Count all non-success TX packets as dropped 2016-10-30 11:11:36 +01: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: Use octal permissions instead of macros 2016-10-19 08:37:53 +02:00
sysfs.h batman-adv: update copyright years for 2016 2016-02-02 12:55:10 +08:00
tp_meter.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-11-22 13:27:16 -05:00
tp_meter.h batman-adv: throughput meter implementation 2016-07-04 12:37:18 +02:00
translation-table.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-12-06 21:33:19 -05:00
translation-table.h batman-adv: netlink: add translation table query 2016-08-09 07:54:37 +02:00
tvlv.c batman-adv: Consume skb in batadv_send_skb_to_orig 2016-10-30 11:11:37 +01:00
tvlv.h batman-adv: split tvlv into a separate file 2016-06-30 10:29:43 +02:00
types.h batman-adv: fix rare race conditions on interface removal 2016-11-08 19:02:39 +01:00