macsec: restrict to ethernet devices
authorWillem de Bruijn <willemb@google.com>
Sun, 22 Mar 2020 17:51:13 +0000 (13:51 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Apr 2020 09:01:32 +0000 (11:01 +0200)
commit6e75284e2480b7307f6d9d3cedb721704b6d44f9
treedf6256d4d1e920d8249297bab857464b0419e36f
parent51db2db8fe68d33de177180f5c32e70c51574200
macsec: restrict to ethernet devices

[ Upstream commit b06d072ccc4b1acd0147b17914b7ad1caa1818bb ]

Only attach macsec to ethernet devices.

Syzbot was able to trigger a KMSAN warning in macsec_handle_frame
by attaching to a phonet device.

Macvlan has a similar check in macvlan_port_create.

v1->v2
  - fix commit message typo

Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/macsec.c