]> git.baikalelectronics.ru Git - kernel.git/commit
bonding: prevent out of bound accesses
authorEric Dumazet <edumazet@google.com>
Thu, 30 Jun 2016 14:13:41 +0000 (16:13 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 Jul 2016 10:06:09 +0000 (06:06 -0400)
commit8c69e6911b70de6f95fbb233ca769ab9d9fc7f86
tree827bdb6430626891773dcd950e609e3e14743854
parentdea51988f957a4920dc9afa42ce151dc9f4c5bf8
bonding: prevent out of bound accesses

ether_addr_equal_64bits() requires some care about its arguments,
namely that 8 bytes might be read, even if last 2 byte values are not
used.

KASan detected a violation with null_mac_addr and lacpdu_mcast_addr
in bond_3ad.c

Same problem with mac_bcast[] and mac_v6_allmcast[] in bond_alb.c :
Although the 8-byte alignment was there, KASan would detect out
of bound accesses.

Fixes: 8024604f2f8c ("bonding: use ether_addr_equal_unaligned for bond addr compare")
Fixes: 9f10a4a15e26 ("bonding: Verify RX LACPDU has proper dest mac-addr")
Fixes: a451a7b6760d ("bonding: use compare_ether_addr_64bits() in ALB")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Acked-by: Dmitry Vyukov <dvyukov@google.com>
Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Acked-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_3ad.c
drivers/net/bonding/bond_alb.c
include/net/bonding.h