File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
drivers/net/ethernet/rocker Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -3712,6 +3712,9 @@ static int rocker_port_bridge_setlink(struct net_device *dev,
3712
3712
if (afspec ) {
3713
3713
attr = nla_find_nested (afspec , IFLA_BRIDGE_MODE );
3714
3714
if (attr ) {
3715
+ if (nla_len (attr ) < sizeof (mode ))
3716
+ return - EINVAL ;
3717
+
3715
3718
mode = nla_get_u16 (attr );
3716
3719
if (mode != BRIDGE_MODE_SWDEV )
3717
3720
return - EINVAL ;
@@ -3721,6 +3724,9 @@ static int rocker_port_bridge_setlink(struct net_device *dev,
3721
3724
if (protinfo ) {
3722
3725
attr = nla_find_nested (protinfo , IFLA_BRPORT_LEARNING );
3723
3726
if (attr ) {
3727
+ if (nla_len (attr ) < sizeof (u8 ))
3728
+ return - EINVAL ;
3729
+
3724
3730
if (nla_get_u8 (attr ))
3725
3731
rocker_port -> brport_flags |= BR_LEARNING ;
3726
3732
else
@@ -3731,6 +3737,9 @@ static int rocker_port_bridge_setlink(struct net_device *dev,
3731
3737
}
3732
3738
attr = nla_find_nested (protinfo , IFLA_BRPORT_LEARNING_SYNC );
3733
3739
if (attr ) {
3740
+ if (nla_len (attr ) < sizeof (u8 ))
3741
+ return - EINVAL ;
3742
+
3734
3743
if (nla_get_u8 (attr ))
3735
3744
rocker_port -> brport_flags |= BR_LEARNING_SYNC ;
3736
3745
else
You can’t perform that action at this time.
0 commit comments