Skip to content

Commit 8cb0817

Browse files
jmberg-inteldavem330
authored andcommitted
netlink: make validation more configurable for future strictness
We currently have two levels of strict validation: 1) liberal (default) - undefined (type >= max) & NLA_UNSPEC attributes accepted - attribute length >= expected accepted - garbage at end of message accepted 2) strict (opt-in) - NLA_UNSPEC attributes accepted - attribute length >= expected accepted Split out parsing strictness into four different options: * TRAILING - check that there's no trailing data after parsing attributes (in message or nested) * MAXTYPE - reject attrs > max known type * UNSPEC - reject attributes with NLA_UNSPEC policy entries * STRICT_ATTRS - strictly validate attribute size The default for future things should be *everything*. The current *_strict() is a combination of TRAILING and MAXTYPE, and is renamed to _deprecated_strict(). The current regular parsing has none of this, and is renamed to *_parse_deprecated(). Additionally it allows us to selectively set one of the new flags even on old policies. Notably, the UNSPEC flag could be useful in this case, since it can be arranged (by filling in the policy) to not be an incompatible userspace ABI change, but would then going forward prevent forgetting attribute entries. Similar can apply to the POLICY flag. We end up with the following renames: * nla_parse -> nla_parse_deprecated * nla_parse_strict -> nla_parse_deprecated_strict * nlmsg_parse -> nlmsg_parse_deprecated * nlmsg_parse_strict -> nlmsg_parse_deprecated_strict * nla_parse_nested -> nla_parse_nested_deprecated * nla_validate_nested -> nla_validate_nested_deprecated Using spatch, of course: @@ expression TB, MAX, HEAD, LEN, POL, EXT; @@ -nla_parse(TB, MAX, HEAD, LEN, POL, EXT) +nla_parse_deprecated(TB, MAX, HEAD, LEN, POL, EXT) @@ expression NLH, HDRLEN, TB, MAX, POL, EXT; @@ -nlmsg_parse(NLH, HDRLEN, TB, MAX, POL, EXT) +nlmsg_parse_deprecated(NLH, HDRLEN, TB, MAX, POL, EXT) @@ expression NLH, HDRLEN, TB, MAX, POL, EXT; @@ -nlmsg_parse_strict(NLH, HDRLEN, TB, MAX, POL, EXT) +nlmsg_parse_deprecated_strict(NLH, HDRLEN, TB, MAX, POL, EXT) @@ expression TB, MAX, NLA, POL, EXT; @@ -nla_parse_nested(TB, MAX, NLA, POL, EXT) +nla_parse_nested_deprecated(TB, MAX, NLA, POL, EXT) @@ expression START, MAX, POL, EXT; @@ -nla_validate_nested(START, MAX, POL, EXT) +nla_validate_nested_deprecated(START, MAX, POL, EXT) @@ expression NLH, HDRLEN, MAX, POL, EXT; @@ -nlmsg_validate(NLH, HDRLEN, MAX, POL, EXT) +nlmsg_validate_deprecated(NLH, HDRLEN, MAX, POL, EXT) For this patch, don't actually add the strict, non-renamed versions yet so that it breaks compile if I get it wrong. Also, while at it, make nla_validate and nla_parse go down to a common __nla_validate_parse() function to avoid code duplication. Ultimately, this allows us to have very strict validation for every new caller of nla_parse()/nlmsg_parse() etc as re-introduced in the next patch, while existing things will continue to work as is. In effect then, this adds fully strict validation for any new command. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6f455f5 commit 8cb0817

File tree

145 files changed

+1233
-933
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+1233
-933
lines changed

crypto/crypto_user_base.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,8 @@ static int crypto_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh,
465465
return err;
466466
}
467467

468-
err = nlmsg_parse(nlh, crypto_msg_min[type], attrs, CRYPTOCFGA_MAX,
469-
crypto_policy, extack);
468+
err = nlmsg_parse_deprecated(nlh, crypto_msg_min[type], attrs,
469+
CRYPTOCFGA_MAX, crypto_policy, extack);
470470
if (err < 0)
471471
return err;
472472

drivers/block/drbd/drbd_nla.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ int drbd_nla_parse_nested(struct nlattr *tb[], int maxtype, struct nlattr *nla,
3535

3636
err = drbd_nla_check_mandatory(maxtype, nla);
3737
if (!err)
38-
err = nla_parse_nested(tb, maxtype, nla, policy, NULL);
38+
err = nla_parse_nested_deprecated(tb, maxtype, nla, policy,
39+
NULL);
3940

4041
return err;
4142
}

drivers/block/nbd.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1797,8 +1797,10 @@ static int nbd_genl_connect(struct sk_buff *skb, struct genl_info *info)
17971797
ret = -EINVAL;
17981798
goto out;
17991799
}
1800-
ret = nla_parse_nested(socks, NBD_SOCK_MAX, attr,
1801-
nbd_sock_policy, info->extack);
1800+
ret = nla_parse_nested_deprecated(socks, NBD_SOCK_MAX,
1801+
attr,
1802+
nbd_sock_policy,
1803+
info->extack);
18021804
if (ret != 0) {
18031805
printk(KERN_ERR "nbd: error processing sock list\n");
18041806
ret = -EINVAL;
@@ -1968,8 +1970,10 @@ static int nbd_genl_reconfigure(struct sk_buff *skb, struct genl_info *info)
19681970
ret = -EINVAL;
19691971
goto out;
19701972
}
1971-
ret = nla_parse_nested(socks, NBD_SOCK_MAX, attr,
1972-
nbd_sock_policy, info->extack);
1973+
ret = nla_parse_nested_deprecated(socks, NBD_SOCK_MAX,
1974+
attr,
1975+
nbd_sock_policy,
1976+
info->extack);
19731977
if (ret != 0) {
19741978
printk(KERN_ERR "nbd: error processing sock list\n");
19751979
ret = -EINVAL;

drivers/infiniband/core/addr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ static inline bool ib_nl_is_good_ip_resp(const struct nlmsghdr *nlh)
8686
if (nlh->nlmsg_flags & RDMA_NL_LS_F_ERR)
8787
return false;
8888

89-
ret = nla_parse(tb, LS_NLA_TYPE_MAX - 1, nlmsg_data(nlh),
90-
nlmsg_len(nlh), ib_nl_addr_policy, NULL);
89+
ret = nla_parse_deprecated(tb, LS_NLA_TYPE_MAX - 1, nlmsg_data(nlh),
90+
nlmsg_len(nlh), ib_nl_addr_policy, NULL);
9191
if (ret)
9292
return false;
9393

drivers/infiniband/core/iwpm_util.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -506,14 +506,14 @@ int iwpm_parse_nlmsg(struct netlink_callback *cb, int policy_max,
506506
int ret;
507507
const char *err_str = "";
508508

509-
ret = nlmsg_validate(cb->nlh, nlh_len, policy_max - 1, nlmsg_policy,
510-
NULL);
509+
ret = nlmsg_validate_deprecated(cb->nlh, nlh_len, policy_max - 1,
510+
nlmsg_policy, NULL);
511511
if (ret) {
512512
err_str = "Invalid attribute";
513513
goto parse_nlmsg_error;
514514
}
515-
ret = nlmsg_parse(cb->nlh, nlh_len, nltb, policy_max - 1,
516-
nlmsg_policy, NULL);
515+
ret = nlmsg_parse_deprecated(cb->nlh, nlh_len, nltb, policy_max - 1,
516+
nlmsg_policy, NULL);
517517
if (ret) {
518518
err_str = "Unable to parse the nlmsg";
519519
goto parse_nlmsg_error;

drivers/infiniband/core/nldev.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -608,8 +608,8 @@ static int nldev_get_doit(struct sk_buff *skb, struct nlmsghdr *nlh,
608608
u32 index;
609609
int err;
610610

611-
err = nlmsg_parse(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
612-
nldev_policy, extack);
611+
err = nlmsg_parse_deprecated(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
612+
nldev_policy, extack);
613613
if (err || !tb[RDMA_NLDEV_ATTR_DEV_INDEX])
614614
return -EINVAL;
615615

@@ -653,8 +653,8 @@ static int nldev_set_doit(struct sk_buff *skb, struct nlmsghdr *nlh,
653653
u32 index;
654654
int err;
655655

656-
err = nlmsg_parse(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1, nldev_policy,
657-
extack);
656+
err = nlmsg_parse_deprecated(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
657+
nldev_policy, extack);
658658
if (err || !tb[RDMA_NLDEV_ATTR_DEV_INDEX])
659659
return -EINVAL;
660660

@@ -722,8 +722,8 @@ static int nldev_port_get_doit(struct sk_buff *skb, struct nlmsghdr *nlh,
722722
u32 port;
723723
int err;
724724

725-
err = nlmsg_parse(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
726-
nldev_policy, extack);
725+
err = nlmsg_parse_deprecated(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
726+
nldev_policy, extack);
727727
if (err ||
728728
!tb[RDMA_NLDEV_ATTR_DEV_INDEX] ||
729729
!tb[RDMA_NLDEV_ATTR_PORT_INDEX])
@@ -778,8 +778,8 @@ static int nldev_port_get_dumpit(struct sk_buff *skb,
778778
int err;
779779
unsigned int p;
780780

781-
err = nlmsg_parse(cb->nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
782-
nldev_policy, NULL);
781+
err = nlmsg_parse_deprecated(cb->nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
782+
nldev_policy, NULL);
783783
if (err || !tb[RDMA_NLDEV_ATTR_DEV_INDEX])
784784
return -EINVAL;
785785

@@ -833,8 +833,8 @@ static int nldev_res_get_doit(struct sk_buff *skb, struct nlmsghdr *nlh,
833833
u32 index;
834834
int ret;
835835

836-
ret = nlmsg_parse(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
837-
nldev_policy, extack);
836+
ret = nlmsg_parse_deprecated(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
837+
nldev_policy, extack);
838838
if (ret || !tb[RDMA_NLDEV_ATTR_DEV_INDEX])
839839
return -EINVAL;
840840

@@ -982,8 +982,8 @@ static int res_get_common_doit(struct sk_buff *skb, struct nlmsghdr *nlh,
982982
struct sk_buff *msg;
983983
int ret;
984984

985-
ret = nlmsg_parse(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
986-
nldev_policy, extack);
985+
ret = nlmsg_parse_deprecated(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
986+
nldev_policy, extack);
987987
if (ret || !tb[RDMA_NLDEV_ATTR_DEV_INDEX] || !fe->id || !tb[fe->id])
988988
return -EINVAL;
989989

@@ -1071,8 +1071,8 @@ static int res_get_common_dumpit(struct sk_buff *skb,
10711071
u32 index, port = 0;
10721072
bool filled = false;
10731073

1074-
err = nlmsg_parse(cb->nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
1075-
nldev_policy, NULL);
1074+
err = nlmsg_parse_deprecated(cb->nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
1075+
nldev_policy, NULL);
10761076
/*
10771077
* Right now, we are expecting the device index to get res information,
10781078
* but it is possible to extend this code to return all devices in
@@ -1250,8 +1250,8 @@ static int nldev_newlink(struct sk_buff *skb, struct nlmsghdr *nlh,
12501250
char type[IFNAMSIZ];
12511251
int err;
12521252

1253-
err = nlmsg_parse(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
1254-
nldev_policy, extack);
1253+
err = nlmsg_parse_deprecated(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
1254+
nldev_policy, extack);
12551255
if (err || !tb[RDMA_NLDEV_ATTR_DEV_NAME] ||
12561256
!tb[RDMA_NLDEV_ATTR_LINK_TYPE] || !tb[RDMA_NLDEV_ATTR_NDEV_NAME])
12571257
return -EINVAL;
@@ -1294,8 +1294,8 @@ static int nldev_dellink(struct sk_buff *skb, struct nlmsghdr *nlh,
12941294
u32 index;
12951295
int err;
12961296

1297-
err = nlmsg_parse(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
1298-
nldev_policy, extack);
1297+
err = nlmsg_parse_deprecated(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
1298+
nldev_policy, extack);
12991299
if (err || !tb[RDMA_NLDEV_ATTR_DEV_INDEX])
13001300
return -EINVAL;
13011301

drivers/infiniband/core/sa_query.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,8 +1028,8 @@ int ib_nl_handle_set_timeout(struct sk_buff *skb,
10281028
!(NETLINK_CB(skb).sk))
10291029
return -EPERM;
10301030

1031-
ret = nla_parse(tb, LS_NLA_TYPE_MAX - 1, nlmsg_data(nlh),
1032-
nlmsg_len(nlh), ib_nl_policy, NULL);
1031+
ret = nla_parse_deprecated(tb, LS_NLA_TYPE_MAX - 1, nlmsg_data(nlh),
1032+
nlmsg_len(nlh), ib_nl_policy, NULL);
10331033
attr = (const struct nlattr *)tb[LS_NLA_TYPE_TIMEOUT];
10341034
if (ret || !attr)
10351035
goto settimeout_out;
@@ -1080,8 +1080,8 @@ static inline int ib_nl_is_good_resolve_resp(const struct nlmsghdr *nlh)
10801080
if (nlh->nlmsg_flags & RDMA_NL_LS_F_ERR)
10811081
return 0;
10821082

1083-
ret = nla_parse(tb, LS_NLA_TYPE_MAX - 1, nlmsg_data(nlh),
1084-
nlmsg_len(nlh), ib_nl_policy, NULL);
1083+
ret = nla_parse_deprecated(tb, LS_NLA_TYPE_MAX - 1, nlmsg_data(nlh),
1084+
nlmsg_len(nlh), ib_nl_policy, NULL);
10851085
if (ret)
10861086
return 0;
10871087

drivers/net/ieee802154/mac802154_hwsim.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -430,9 +430,7 @@ static int hwsim_new_edge_nl(struct sk_buff *msg, struct genl_info *info)
430430
!info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE])
431431
return -EINVAL;
432432

433-
if (nla_parse_nested(edge_attrs, MAC802154_HWSIM_EDGE_ATTR_MAX,
434-
info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE],
435-
hwsim_edge_policy, NULL))
433+
if (nla_parse_nested_deprecated(edge_attrs, MAC802154_HWSIM_EDGE_ATTR_MAX, info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE], hwsim_edge_policy, NULL))
436434
return -EINVAL;
437435

438436
if (!edge_attrs[MAC802154_HWSIM_EDGE_ATTR_ENDPOINT_ID])
@@ -494,9 +492,7 @@ static int hwsim_del_edge_nl(struct sk_buff *msg, struct genl_info *info)
494492
!info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE])
495493
return -EINVAL;
496494

497-
if (nla_parse_nested(edge_attrs, MAC802154_HWSIM_EDGE_ATTR_MAX,
498-
info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE],
499-
hwsim_edge_policy, NULL))
495+
if (nla_parse_nested_deprecated(edge_attrs, MAC802154_HWSIM_EDGE_ATTR_MAX, info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE], hwsim_edge_policy, NULL))
500496
return -EINVAL;
501497

502498
if (!edge_attrs[MAC802154_HWSIM_EDGE_ATTR_ENDPOINT_ID])
@@ -544,9 +540,7 @@ static int hwsim_set_edge_lqi(struct sk_buff *msg, struct genl_info *info)
544540
!info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE])
545541
return -EINVAL;
546542

547-
if (nla_parse_nested(edge_attrs, MAC802154_HWSIM_EDGE_ATTR_MAX,
548-
info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE],
549-
hwsim_edge_policy, NULL))
543+
if (nla_parse_nested_deprecated(edge_attrs, MAC802154_HWSIM_EDGE_ATTR_MAX, info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE], hwsim_edge_policy, NULL))
550544
return -EINVAL;
551545

552546
if (!edge_attrs[MAC802154_HWSIM_EDGE_ATTR_ENDPOINT_ID] &&

drivers/net/macsec.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,9 +1611,7 @@ static int parse_sa_config(struct nlattr **attrs, struct nlattr **tb_sa)
16111611
if (!attrs[MACSEC_ATTR_SA_CONFIG])
16121612
return -EINVAL;
16131613

1614-
if (nla_parse_nested(tb_sa, MACSEC_SA_ATTR_MAX,
1615-
attrs[MACSEC_ATTR_SA_CONFIG],
1616-
macsec_genl_sa_policy, NULL))
1614+
if (nla_parse_nested_deprecated(tb_sa, MACSEC_SA_ATTR_MAX, attrs[MACSEC_ATTR_SA_CONFIG], macsec_genl_sa_policy, NULL))
16171615
return -EINVAL;
16181616

16191617
return 0;
@@ -1624,9 +1622,7 @@ static int parse_rxsc_config(struct nlattr **attrs, struct nlattr **tb_rxsc)
16241622
if (!attrs[MACSEC_ATTR_RXSC_CONFIG])
16251623
return -EINVAL;
16261624

1627-
if (nla_parse_nested(tb_rxsc, MACSEC_RXSC_ATTR_MAX,
1628-
attrs[MACSEC_ATTR_RXSC_CONFIG],
1629-
macsec_genl_rxsc_policy, NULL))
1625+
if (nla_parse_nested_deprecated(tb_rxsc, MACSEC_RXSC_ATTR_MAX, attrs[MACSEC_ATTR_RXSC_CONFIG], macsec_genl_rxsc_policy, NULL))
16301626
return -EINVAL;
16311627

16321628
return 0;

drivers/net/team/team.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2510,9 +2510,11 @@ static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info)
25102510
err = -EINVAL;
25112511
goto team_put;
25122512
}
2513-
err = nla_parse_nested(opt_attrs, TEAM_ATTR_OPTION_MAX,
2514-
nl_option, team_nl_option_policy,
2515-
info->extack);
2513+
err = nla_parse_nested_deprecated(opt_attrs,
2514+
TEAM_ATTR_OPTION_MAX,
2515+
nl_option,
2516+
team_nl_option_policy,
2517+
info->extack);
25162518
if (err)
25172519
goto team_put;
25182520
if (!opt_attrs[TEAM_ATTR_OPTION_NAME] ||

drivers/net/wireless/ath/ath10k/testmode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,8 @@ int ath10k_tm_cmd(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
416416
struct nlattr *tb[ATH10K_TM_ATTR_MAX + 1];
417417
int ret;
418418

419-
ret = nla_parse(tb, ATH10K_TM_ATTR_MAX, data, len, ath10k_tm_policy,
420-
NULL);
419+
ret = nla_parse_deprecated(tb, ATH10K_TM_ATTR_MAX, data, len,
420+
ath10k_tm_policy, NULL);
421421
if (ret)
422422
return ret;
423423

drivers/net/wireless/ath/ath6kl/testmode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ int ath6kl_tm_cmd(struct wiphy *wiphy, struct wireless_dev *wdev,
7474
int err, buf_len;
7575
void *buf;
7676

77-
err = nla_parse(tb, ATH6KL_TM_ATTR_MAX, data, len, ath6kl_tm_policy,
78-
NULL);
77+
err = nla_parse_deprecated(tb, ATH6KL_TM_ATTR_MAX, data, len,
78+
ath6kl_tm_policy, NULL);
7979
if (err)
8080
return err;
8181

drivers/net/wireless/ath/wcn36xx/testmode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ int wcn36xx_tm_cmd(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
132132
unsigned short attr;
133133

134134
wcn36xx_dbg_dump(WCN36XX_DBG_TESTMODE_DUMP, "Data:", data, len);
135-
ret = nla_parse(tb, WCN36XX_TM_ATTR_MAX, data, len,
136-
wcn36xx_tm_policy, NULL);
135+
ret = nla_parse_deprecated(tb, WCN36XX_TM_ATTR_MAX, data, len,
136+
wcn36xx_tm_policy, NULL);
137137
if (ret)
138138
return ret;
139139

drivers/net/wireless/ath/wil6210/cfg80211.c

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2620,8 +2620,8 @@ static int wil_rf_sector_get_cfg(struct wiphy *wiphy,
26202620
if (!test_bit(WMI_FW_CAPABILITY_RF_SECTORS, wil->fw_capabilities))
26212621
return -EOPNOTSUPP;
26222622

2623-
rc = nla_parse(tb, QCA_ATTR_DMG_RF_SECTOR_MAX, data, data_len,
2624-
wil_rf_sector_policy, NULL);
2623+
rc = nla_parse_deprecated(tb, QCA_ATTR_DMG_RF_SECTOR_MAX, data,
2624+
data_len, wil_rf_sector_policy, NULL);
26252625
if (rc) {
26262626
wil_err(wil, "Invalid rf sector ATTR\n");
26272627
return rc;
@@ -2740,8 +2740,8 @@ static int wil_rf_sector_set_cfg(struct wiphy *wiphy,
27402740
if (!test_bit(WMI_FW_CAPABILITY_RF_SECTORS, wil->fw_capabilities))
27412741
return -EOPNOTSUPP;
27422742

2743-
rc = nla_parse(tb, QCA_ATTR_DMG_RF_SECTOR_MAX, data, data_len,
2744-
wil_rf_sector_policy, NULL);
2743+
rc = nla_parse_deprecated(tb, QCA_ATTR_DMG_RF_SECTOR_MAX, data,
2744+
data_len, wil_rf_sector_policy, NULL);
27452745
if (rc) {
27462746
wil_err(wil, "Invalid rf sector ATTR\n");
27472747
return rc;
@@ -2773,9 +2773,11 @@ static int wil_rf_sector_set_cfg(struct wiphy *wiphy,
27732773
cmd.sector_type = sector_type;
27742774
nla_for_each_nested(nl_cfg, tb[QCA_ATTR_DMG_RF_SECTOR_CFG],
27752775
tmp) {
2776-
rc = nla_parse_nested(tb2, QCA_ATTR_DMG_RF_SECTOR_CFG_MAX,
2777-
nl_cfg, wil_rf_sector_cfg_policy,
2778-
NULL);
2776+
rc = nla_parse_nested_deprecated(tb2,
2777+
QCA_ATTR_DMG_RF_SECTOR_CFG_MAX,
2778+
nl_cfg,
2779+
wil_rf_sector_cfg_policy,
2780+
NULL);
27792781
if (rc) {
27802782
wil_err(wil, "invalid sector cfg\n");
27812783
return -EINVAL;
@@ -2847,8 +2849,8 @@ static int wil_rf_sector_get_selected(struct wiphy *wiphy,
28472849
if (!test_bit(WMI_FW_CAPABILITY_RF_SECTORS, wil->fw_capabilities))
28482850
return -EOPNOTSUPP;
28492851

2850-
rc = nla_parse(tb, QCA_ATTR_DMG_RF_SECTOR_MAX, data, data_len,
2851-
wil_rf_sector_policy, NULL);
2852+
rc = nla_parse_deprecated(tb, QCA_ATTR_DMG_RF_SECTOR_MAX, data,
2853+
data_len, wil_rf_sector_policy, NULL);
28522854
if (rc) {
28532855
wil_err(wil, "Invalid rf sector ATTR\n");
28542856
return rc;
@@ -2955,8 +2957,8 @@ static int wil_rf_sector_set_selected(struct wiphy *wiphy,
29552957
if (!test_bit(WMI_FW_CAPABILITY_RF_SECTORS, wil->fw_capabilities))
29562958
return -EOPNOTSUPP;
29572959

2958-
rc = nla_parse(tb, QCA_ATTR_DMG_RF_SECTOR_MAX, data, data_len,
2959-
wil_rf_sector_policy, NULL);
2960+
rc = nla_parse_deprecated(tb, QCA_ATTR_DMG_RF_SECTOR_MAX, data,
2961+
data_len, wil_rf_sector_policy, NULL);
29602962
if (rc) {
29612963
wil_err(wil, "Invalid rf sector ATTR\n");
29622964
return rc;

drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4465,8 +4465,8 @@ static int __iwl_mvm_mac_testmode_cmd(struct iwl_mvm *mvm,
44654465
int err;
44664466
u32 noa_duration;
44674467

4468-
err = nla_parse(tb, IWL_MVM_TM_ATTR_MAX, data, len, iwl_mvm_tm_policy,
4469-
NULL);
4468+
err = nla_parse_deprecated(tb, IWL_MVM_TM_ATTR_MAX, data, len,
4469+
iwl_mvm_tm_policy, NULL);
44704470
if (err)
44714471
return err;
44724472

drivers/net/wireless/mac80211_hwsim.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,8 @@ static int mac80211_hwsim_vendor_cmd_test(struct wiphy *wiphy,
409409
int err;
410410
u32 val;
411411

412-
err = nla_parse(tb, QCA_WLAN_VENDOR_ATTR_MAX, data, data_len,
413-
hwsim_vendor_test_policy, NULL);
412+
err = nla_parse_deprecated(tb, QCA_WLAN_VENDOR_ATTR_MAX, data,
413+
data_len, hwsim_vendor_test_policy, NULL);
414414
if (err)
415415
return err;
416416
if (!tb[QCA_WLAN_VENDOR_ATTR_TEST])
@@ -1936,8 +1936,8 @@ static int mac80211_hwsim_testmode_cmd(struct ieee80211_hw *hw,
19361936
struct sk_buff *skb;
19371937
int err, ps;
19381938

1939-
err = nla_parse(tb, HWSIM_TM_ATTR_MAX, data, len,
1940-
hwsim_testmode_policy, NULL);
1939+
err = nla_parse_deprecated(tb, HWSIM_TM_ATTR_MAX, data, len,
1940+
hwsim_testmode_policy, NULL);
19411941
if (err)
19421942
return err;
19431943

0 commit comments

Comments
 (0)