Skip to content

Commit

Permalink
wifi: mt76: testmode: add nla_policy for MT76_TM_ATTR_TX_LENGTH
Browse files Browse the repository at this point in the history
It seems that the nla_policy in mt76_tm_policy is missed for attribute
MT76_TM_ATTR_TX_LENGTH. This patch adds the correct description to make
sure the

  u32 val = nla_get_u32(tb[MT76_TM_ATTR_TX_LENGTH]);

in function mt76_testmode_cmd() is safe and will not result in
out-of-attribute read.

Fixes: f0efa86 ("mt76: add API for testmode support")
Signed-off-by: Lin Ma <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
  • Loading branch information
f0rm2l1n authored and nbd168 committed Jul 26, 2023
1 parent fc80731 commit 74f12d5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/wireless/mediatek/mt76/testmode.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const struct nla_policy mt76_tm_policy[NUM_MT76_TM_ATTRS] = {
[MT76_TM_ATTR_RESET] = { .type = NLA_FLAG },
[MT76_TM_ATTR_STATE] = { .type = NLA_U8 },
[MT76_TM_ATTR_TX_COUNT] = { .type = NLA_U32 },
[MT76_TM_ATTR_TX_LENGTH] = { .type = NLA_U32 },
[MT76_TM_ATTR_TX_RATE_MODE] = { .type = NLA_U8 },
[MT76_TM_ATTR_TX_RATE_NSS] = { .type = NLA_U8 },
[MT76_TM_ATTR_TX_RATE_IDX] = { .type = NLA_U8 },
Expand Down

0 comments on commit 74f12d5

Please sign in to comment.