Skip to content

Commit

Permalink
macsec: fix netlink attribute validation
Browse files Browse the repository at this point in the history
macsec_validate_attr should check IFLA_MACSEC_REPLAY_PROTECT (not
IFLA_MACSEC_PROTECT) to verify that the replay protection and replay
window arguments are correct.

Fixes: c09440f ("macsec: introduce IEEE 802.1AE driver")
Signed-off-by: Sabrina Dubroca <[email protected]>
Acked-by: Hannes Frederic Sowa <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
qsn authored and davem330 committed Apr 24, 2016
1 parent 7481648 commit 4b1fb93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/macsec.c
Original file line number Diff line number Diff line change
Expand Up @@ -3147,8 +3147,8 @@ static int macsec_validate_attr(struct nlattr *tb[], struct nlattr *data[])
nla_get_u8(data[IFLA_MACSEC_VALIDATION]) > MACSEC_VALIDATE_MAX)
return -EINVAL;

if ((data[IFLA_MACSEC_PROTECT] &&
nla_get_u8(data[IFLA_MACSEC_PROTECT])) &&
if ((data[IFLA_MACSEC_REPLAY_PROTECT] &&
nla_get_u8(data[IFLA_MACSEC_REPLAY_PROTECT])) &&
!data[IFLA_MACSEC_WINDOW])
return -EINVAL;

Expand Down

0 comments on commit 4b1fb93

Please sign in to comment.