diff options
163 files changed, 1764 insertions, 923 deletions
diff --git a/crypto/crypto_user_base.c b/crypto/crypto_user_base.c index f25d3f32c9c2..e48da3b75c71 100644 --- a/crypto/crypto_user_base.c +++ b/crypto/crypto_user_base.c | |||
| @@ -465,8 +465,8 @@ static int crypto_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 465 | return err; | 465 | return err; |
| 466 | } | 466 | } |
| 467 | 467 | ||
| 468 | err = nlmsg_parse(nlh, crypto_msg_min[type], attrs, CRYPTOCFGA_MAX, | 468 | err = nlmsg_parse_deprecated(nlh, crypto_msg_min[type], attrs, |
| 469 | crypto_policy, extack); | 469 | CRYPTOCFGA_MAX, crypto_policy, extack); |
| 470 | if (err < 0) | 470 | if (err < 0) |
| 471 | return err; | 471 | return err; |
| 472 | 472 | ||
diff --git a/drivers/block/drbd/drbd_nla.c b/drivers/block/drbd/drbd_nla.c index 8e261cb5198b..6a09b0b98018 100644 --- a/drivers/block/drbd/drbd_nla.c +++ b/drivers/block/drbd/drbd_nla.c | |||
| @@ -35,7 +35,8 @@ int drbd_nla_parse_nested(struct nlattr *tb[], int maxtype, struct nlattr *nla, | |||
| 35 | 35 | ||
| 36 | err = drbd_nla_check_mandatory(maxtype, nla); | 36 | err = drbd_nla_check_mandatory(maxtype, nla); |
| 37 | if (!err) | 37 | if (!err) |
| 38 | err = nla_parse_nested(tb, maxtype, nla, policy, NULL); | 38 | err = nla_parse_nested_deprecated(tb, maxtype, nla, policy, |
| 39 | NULL); | ||
| 39 | 40 | ||
| 40 | return err; | 41 | return err; |
| 41 | } | 42 | } |
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index cd27f236431d..6c2dd268e603 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c | |||
| @@ -1797,8 +1797,10 @@ again: | |||
| 1797 | ret = -EINVAL; | 1797 | ret = -EINVAL; |
| 1798 | goto out; | 1798 | goto out; |
| 1799 | } | 1799 | } |
| 1800 | ret = nla_parse_nested(socks, NBD_SOCK_MAX, attr, | 1800 | ret = nla_parse_nested_deprecated(socks, NBD_SOCK_MAX, |
| 1801 | nbd_sock_policy, info->extack); | 1801 | attr, |
| 1802 | nbd_sock_policy, | ||
| 1803 | info->extack); | ||
| 1802 | if (ret != 0) { | 1804 | if (ret != 0) { |
| 1803 | printk(KERN_ERR "nbd: error processing sock list\n"); | 1805 | printk(KERN_ERR "nbd: error processing sock list\n"); |
| 1804 | ret = -EINVAL; | 1806 | ret = -EINVAL; |
| @@ -1968,8 +1970,10 @@ static int nbd_genl_reconfigure(struct sk_buff *skb, struct genl_info *info) | |||
| 1968 | ret = -EINVAL; | 1970 | ret = -EINVAL; |
| 1969 | goto out; | 1971 | goto out; |
| 1970 | } | 1972 | } |
| 1971 | ret = nla_parse_nested(socks, NBD_SOCK_MAX, attr, | 1973 | ret = nla_parse_nested_deprecated(socks, NBD_SOCK_MAX, |
| 1972 | nbd_sock_policy, info->extack); | 1974 | attr, |
| 1975 | nbd_sock_policy, | ||
| 1976 | info->extack); | ||
| 1973 | if (ret != 0) { | 1977 | if (ret != 0) { |
| 1974 | printk(KERN_ERR "nbd: error processing sock list\n"); | 1978 | printk(KERN_ERR "nbd: error processing sock list\n"); |
| 1975 | ret = -EINVAL; | 1979 | ret = -EINVAL; |
| @@ -1999,18 +2003,22 @@ out: | |||
| 1999 | static const struct genl_ops nbd_connect_genl_ops[] = { | 2003 | static const struct genl_ops nbd_connect_genl_ops[] = { |
| 2000 | { | 2004 | { |
| 2001 | .cmd = NBD_CMD_CONNECT, | 2005 | .cmd = NBD_CMD_CONNECT, |
| 2006 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2002 | .doit = nbd_genl_connect, | 2007 | .doit = nbd_genl_connect, |
| 2003 | }, | 2008 | }, |
| 2004 | { | 2009 | { |
| 2005 | .cmd = NBD_CMD_DISCONNECT, | 2010 | .cmd = NBD_CMD_DISCONNECT, |
| 2011 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2006 | .doit = nbd_genl_disconnect, | 2012 | .doit = nbd_genl_disconnect, |
| 2007 | }, | 2013 | }, |
| 2008 | { | 2014 | { |
| 2009 | .cmd = NBD_CMD_RECONFIGURE, | 2015 | .cmd = NBD_CMD_RECONFIGURE, |
| 2016 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2010 | .doit = nbd_genl_reconfigure, | 2017 | .doit = nbd_genl_reconfigure, |
| 2011 | }, | 2018 | }, |
| 2012 | { | 2019 | { |
| 2013 | .cmd = NBD_CMD_STATUS, | 2020 | .cmd = NBD_CMD_STATUS, |
| 2021 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2014 | .doit = nbd_genl_status, | 2022 | .doit = nbd_genl_status, |
| 2015 | }, | 2023 | }, |
| 2016 | }; | 2024 | }; |
diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c index f5ecb660fe7d..744b6ec0acb0 100644 --- a/drivers/infiniband/core/addr.c +++ b/drivers/infiniband/core/addr.c | |||
| @@ -86,8 +86,8 @@ static inline bool ib_nl_is_good_ip_resp(const struct nlmsghdr *nlh) | |||
| 86 | if (nlh->nlmsg_flags & RDMA_NL_LS_F_ERR) | 86 | if (nlh->nlmsg_flags & RDMA_NL_LS_F_ERR) |
| 87 | return false; | 87 | return false; |
| 88 | 88 | ||
| 89 | ret = nla_parse(tb, LS_NLA_TYPE_MAX - 1, nlmsg_data(nlh), | 89 | ret = nla_parse_deprecated(tb, LS_NLA_TYPE_MAX - 1, nlmsg_data(nlh), |
| 90 | nlmsg_len(nlh), ib_nl_addr_policy, NULL); | 90 | nlmsg_len(nlh), ib_nl_addr_policy, NULL); |
| 91 | if (ret) | 91 | if (ret) |
| 92 | return false; | 92 | return false; |
| 93 | 93 | ||
diff --git a/drivers/infiniband/core/iwpm_util.c b/drivers/infiniband/core/iwpm_util.c index a5d2a20ee697..41929bb83739 100644 --- a/drivers/infiniband/core/iwpm_util.c +++ b/drivers/infiniband/core/iwpm_util.c | |||
| @@ -506,14 +506,14 @@ int iwpm_parse_nlmsg(struct netlink_callback *cb, int policy_max, | |||
| 506 | int ret; | 506 | int ret; |
| 507 | const char *err_str = ""; | 507 | const char *err_str = ""; |
| 508 | 508 | ||
| 509 | ret = nlmsg_validate(cb->nlh, nlh_len, policy_max - 1, nlmsg_policy, | 509 | ret = nlmsg_validate_deprecated(cb->nlh, nlh_len, policy_max - 1, |
| 510 | NULL); | 510 | nlmsg_policy, NULL); |
| 511 | if (ret) { | 511 | if (ret) { |
| 512 | err_str = "Invalid attribute"; | 512 | err_str = "Invalid attribute"; |
| 513 | goto parse_nlmsg_error; | 513 | goto parse_nlmsg_error; |
| 514 | } | 514 | } |
| 515 | ret = nlmsg_parse(cb->nlh, nlh_len, nltb, policy_max - 1, | 515 | ret = nlmsg_parse_deprecated(cb->nlh, nlh_len, nltb, policy_max - 1, |
| 516 | nlmsg_policy, NULL); | 516 | nlmsg_policy, NULL); |
| 517 | if (ret) { | 517 | if (ret) { |
| 518 | err_str = "Unable to parse the nlmsg"; | 518 | err_str = "Unable to parse the nlmsg"; |
| 519 | goto parse_nlmsg_error; | 519 | goto parse_nlmsg_error; |
diff --git a/drivers/infiniband/core/nldev.c b/drivers/infiniband/core/nldev.c index ad189a29cc67..85324012bf07 100644 --- a/drivers/infiniband/core/nldev.c +++ b/drivers/infiniband/core/nldev.c | |||
| @@ -608,8 +608,8 @@ static int nldev_get_doit(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 608 | u32 index; | 608 | u32 index; |
| 609 | int err; | 609 | int err; |
| 610 | 610 | ||
| 611 | err = nlmsg_parse(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1, | 611 | err = nlmsg_parse_deprecated(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1, |
| 612 | nldev_policy, extack); | 612 | nldev_policy, extack); |
| 613 | if (err || !tb[RDMA_NLDEV_ATTR_DEV_INDEX]) | 613 | if (err || !tb[RDMA_NLDEV_ATTR_DEV_INDEX]) |
| 614 | return -EINVAL; | 614 | return -EINVAL; |
| 615 | 615 | ||
| @@ -653,8 +653,8 @@ static int nldev_set_doit(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 653 | u32 index; | 653 | u32 index; |
| 654 | int err; | 654 | int err; |
| 655 | 655 | ||
| 656 | err = nlmsg_parse(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1, nldev_policy, | 656 | err = nlmsg_parse_deprecated(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1, |
| 657 | extack); | 657 | nldev_policy, extack); |
| 658 | if (err || !tb[RDMA_NLDEV_ATTR_DEV_INDEX]) | 658 | if (err || !tb[RDMA_NLDEV_ATTR_DEV_INDEX]) |
| 659 | return -EINVAL; | 659 | return -EINVAL; |
| 660 | 660 | ||
| @@ -722,8 +722,8 @@ static int nldev_port_get_doit(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 722 | u32 port; | 722 | u32 port; |
| 723 | int err; | 723 | int err; |
| 724 | 724 | ||
| 725 | err = nlmsg_parse(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1, | 725 | err = nlmsg_parse_deprecated(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1, |
| 726 | nldev_policy, extack); | 726 | nldev_policy, extack); |
| 727 | if (err || | 727 | if (err || |
| 728 | !tb[RDMA_NLDEV_ATTR_DEV_INDEX] || | 728 | !tb[RDMA_NLDEV_ATTR_DEV_INDEX] || |
| 729 | !tb[RDMA_NLDEV_ATTR_PORT_INDEX]) | 729 | !tb[RDMA_NLDEV_ATTR_PORT_INDEX]) |
| @@ -778,8 +778,8 @@ static int nldev_port_get_dumpit(struct sk_buff *skb, | |||
| 778 | int err; | 778 | int err; |
| 779 | unsigned int p; | 779 | unsigned int p; |
| 780 | 780 | ||
| 781 | err = nlmsg_parse(cb->nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1, | 781 | err = nlmsg_parse_deprecated(cb->nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1, |
| 782 | nldev_policy, NULL); | 782 | nldev_policy, NULL); |
| 783 | if (err || !tb[RDMA_NLDEV_ATTR_DEV_INDEX]) | 783 | if (err || !tb[RDMA_NLDEV_ATTR_DEV_INDEX]) |
| 784 | return -EINVAL; | 784 | return -EINVAL; |
| 785 | 785 | ||
| @@ -833,8 +833,8 @@ static int nldev_res_get_doit(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 833 | u32 index; | 833 | u32 index; |
| 834 | int ret; | 834 | int ret; |
| 835 | 835 | ||
| 836 | ret = nlmsg_parse(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1, | 836 | ret = nlmsg_parse_deprecated(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1, |
| 837 | nldev_policy, extack); | 837 | nldev_policy, extack); |
| 838 | if (ret || !tb[RDMA_NLDEV_ATTR_DEV_INDEX]) | 838 | if (ret || !tb[RDMA_NLDEV_ATTR_DEV_INDEX]) |
| 839 | return -EINVAL; | 839 | return -EINVAL; |
| 840 | 840 | ||
| @@ -982,8 +982,8 @@ static int res_get_common_doit(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 982 | struct sk_buff *msg; | 982 | struct sk_buff *msg; |
| 983 | int ret; | 983 | int ret; |
| 984 | 984 | ||
| 985 | ret = nlmsg_parse(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1, | 985 | ret = nlmsg_parse_deprecated(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1, |
| 986 | nldev_policy, extack); | 986 | nldev_policy, extack); |
| 987 | if (ret || !tb[RDMA_NLDEV_ATTR_DEV_INDEX] || !fe->id || !tb[fe->id]) | 987 | if (ret || !tb[RDMA_NLDEV_ATTR_DEV_INDEX] || !fe->id || !tb[fe->id]) |
| 988 | return -EINVAL; | 988 | return -EINVAL; |
| 989 | 989 | ||
| @@ -1071,8 +1071,8 @@ static int res_get_common_dumpit(struct sk_buff *skb, | |||
| 1071 | u32 index, port = 0; | 1071 | u32 index, port = 0; |
| 1072 | bool filled = false; | 1072 | bool filled = false; |
| 1073 | 1073 | ||
| 1074 | err = nlmsg_parse(cb->nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1, | 1074 | err = nlmsg_parse_deprecated(cb->nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1, |
| 1075 | nldev_policy, NULL); | 1075 | nldev_policy, NULL); |
| 1076 | /* | 1076 | /* |
| 1077 | * Right now, we are expecting the device index to get res information, | 1077 | * Right now, we are expecting the device index to get res information, |
| 1078 | * but it is possible to extend this code to return all devices in | 1078 | * 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, | |||
| 1250 | char type[IFNAMSIZ]; | 1250 | char type[IFNAMSIZ]; |
| 1251 | int err; | 1251 | int err; |
| 1252 | 1252 | ||
| 1253 | err = nlmsg_parse(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1, | 1253 | err = nlmsg_parse_deprecated(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1, |
| 1254 | nldev_policy, extack); | 1254 | nldev_policy, extack); |
| 1255 | if (err || !tb[RDMA_NLDEV_ATTR_DEV_NAME] || | 1255 | if (err || !tb[RDMA_NLDEV_ATTR_DEV_NAME] || |
| 1256 | !tb[RDMA_NLDEV_ATTR_LINK_TYPE] || !tb[RDMA_NLDEV_ATTR_NDEV_NAME]) | 1256 | !tb[RDMA_NLDEV_ATTR_LINK_TYPE] || !tb[RDMA_NLDEV_ATTR_NDEV_NAME]) |
| 1257 | return -EINVAL; | 1257 | return -EINVAL; |
| @@ -1294,8 +1294,8 @@ static int nldev_dellink(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 1294 | u32 index; | 1294 | u32 index; |
| 1295 | int err; | 1295 | int err; |
| 1296 | 1296 | ||
| 1297 | err = nlmsg_parse(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1, | 1297 | err = nlmsg_parse_deprecated(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1, |
| 1298 | nldev_policy, extack); | 1298 | nldev_policy, extack); |
| 1299 | if (err || !tb[RDMA_NLDEV_ATTR_DEV_INDEX]) | 1299 | if (err || !tb[RDMA_NLDEV_ATTR_DEV_INDEX]) |
| 1300 | return -EINVAL; | 1300 | return -EINVAL; |
| 1301 | 1301 | ||
diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c index 7925e45ea88a..bb534959abf0 100644 --- a/drivers/infiniband/core/sa_query.c +++ b/drivers/infiniband/core/sa_query.c | |||
| @@ -1028,8 +1028,8 @@ int ib_nl_handle_set_timeout(struct sk_buff *skb, | |||
| 1028 | !(NETLINK_CB(skb).sk)) | 1028 | !(NETLINK_CB(skb).sk)) |
| 1029 | return -EPERM; | 1029 | return -EPERM; |
| 1030 | 1030 | ||
| 1031 | ret = nla_parse(tb, LS_NLA_TYPE_MAX - 1, nlmsg_data(nlh), | 1031 | ret = nla_parse_deprecated(tb, LS_NLA_TYPE_MAX - 1, nlmsg_data(nlh), |
| 1032 | nlmsg_len(nlh), ib_nl_policy, NULL); | 1032 | nlmsg_len(nlh), ib_nl_policy, NULL); |
| 1033 | attr = (const struct nlattr *)tb[LS_NLA_TYPE_TIMEOUT]; | 1033 | attr = (const struct nlattr *)tb[LS_NLA_TYPE_TIMEOUT]; |
| 1034 | if (ret || !attr) | 1034 | if (ret || !attr) |
| 1035 | goto settimeout_out; | 1035 | goto settimeout_out; |
| @@ -1080,8 +1080,8 @@ static inline int ib_nl_is_good_resolve_resp(const struct nlmsghdr *nlh) | |||
| 1080 | if (nlh->nlmsg_flags & RDMA_NL_LS_F_ERR) | 1080 | if (nlh->nlmsg_flags & RDMA_NL_LS_F_ERR) |
| 1081 | return 0; | 1081 | return 0; |
| 1082 | 1082 | ||
| 1083 | ret = nla_parse(tb, LS_NLA_TYPE_MAX - 1, nlmsg_data(nlh), | 1083 | ret = nla_parse_deprecated(tb, LS_NLA_TYPE_MAX - 1, nlmsg_data(nlh), |
| 1084 | nlmsg_len(nlh), ib_nl_policy, NULL); | 1084 | nlmsg_len(nlh), ib_nl_policy, NULL); |
| 1085 | if (ret) | 1085 | if (ret) |
| 1086 | return 0; | 1086 | return 0; |
| 1087 | 1087 | ||
diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index c06e31747288..eaf4311b4004 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c | |||
| @@ -1270,16 +1270,19 @@ static const struct nla_policy gtp_genl_policy[GTPA_MAX + 1] = { | |||
| 1270 | static const struct genl_ops gtp_genl_ops[] = { | 1270 | static const struct genl_ops gtp_genl_ops[] = { |
| 1271 | { | 1271 | { |
| 1272 | .cmd = GTP_CMD_NEWPDP, | 1272 | .cmd = GTP_CMD_NEWPDP, |
| 1273 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1273 | .doit = gtp_genl_new_pdp, | 1274 | .doit = gtp_genl_new_pdp, |
| 1274 | .flags = GENL_ADMIN_PERM, | 1275 | .flags = GENL_ADMIN_PERM, |
| 1275 | }, | 1276 | }, |
| 1276 | { | 1277 | { |
| 1277 | .cmd = GTP_CMD_DELPDP, | 1278 | .cmd = GTP_CMD_DELPDP, |
| 1279 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1278 | .doit = gtp_genl_del_pdp, | 1280 | .doit = gtp_genl_del_pdp, |
| 1279 | .flags = GENL_ADMIN_PERM, | 1281 | .flags = GENL_ADMIN_PERM, |
| 1280 | }, | 1282 | }, |
| 1281 | { | 1283 | { |
| 1282 | .cmd = GTP_CMD_GETPDP, | 1284 | .cmd = GTP_CMD_GETPDP, |
| 1285 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1283 | .doit = gtp_genl_get_pdp, | 1286 | .doit = gtp_genl_get_pdp, |
| 1284 | .dumpit = gtp_genl_dump_pdp, | 1287 | .dumpit = gtp_genl_dump_pdp, |
| 1285 | .flags = GENL_ADMIN_PERM, | 1288 | .flags = GENL_ADMIN_PERM, |
diff --git a/drivers/net/ieee802154/mac802154_hwsim.c b/drivers/net/ieee802154/mac802154_hwsim.c index 80ca300aba04..b187ae1a6bd6 100644 --- a/drivers/net/ieee802154/mac802154_hwsim.c +++ b/drivers/net/ieee802154/mac802154_hwsim.c | |||
| @@ -430,9 +430,7 @@ static int hwsim_new_edge_nl(struct sk_buff *msg, struct genl_info *info) | |||
| 430 | !info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE]) | 430 | !info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE]) |
| 431 | return -EINVAL; | 431 | return -EINVAL; |
| 432 | 432 | ||
| 433 | if (nla_parse_nested(edge_attrs, MAC802154_HWSIM_EDGE_ATTR_MAX, | 433 | if (nla_parse_nested_deprecated(edge_attrs, MAC802154_HWSIM_EDGE_ATTR_MAX, info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE], hwsim_edge_policy, NULL)) |
| 434 | info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE], | ||
| 435 | hwsim_edge_policy, NULL)) | ||
| 436 | return -EINVAL; | 434 | return -EINVAL; |
| 437 | 435 | ||
| 438 | if (!edge_attrs[MAC802154_HWSIM_EDGE_ATTR_ENDPOINT_ID]) | 436 | 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) | |||
| 494 | !info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE]) | 492 | !info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE]) |
| 495 | return -EINVAL; | 493 | return -EINVAL; |
| 496 | 494 | ||
| 497 | if (nla_parse_nested(edge_attrs, MAC802154_HWSIM_EDGE_ATTR_MAX, | 495 | if (nla_parse_nested_deprecated(edge_attrs, MAC802154_HWSIM_EDGE_ATTR_MAX, info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE], hwsim_edge_policy, NULL)) |
| 498 | info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE], | ||
| 499 | hwsim_edge_policy, NULL)) | ||
| 500 | return -EINVAL; | 496 | return -EINVAL; |
| 501 | 497 | ||
| 502 | if (!edge_attrs[MAC802154_HWSIM_EDGE_ATTR_ENDPOINT_ID]) | 498 | 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) | |||
| 544 | !info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE]) | 540 | !info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE]) |
| 545 | return -EINVAL; | 541 | return -EINVAL; |
| 546 | 542 | ||
| 547 | if (nla_parse_nested(edge_attrs, MAC802154_HWSIM_EDGE_ATTR_MAX, | 543 | if (nla_parse_nested_deprecated(edge_attrs, MAC802154_HWSIM_EDGE_ATTR_MAX, info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE], hwsim_edge_policy, NULL)) |
| 548 | info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE], | ||
| 549 | hwsim_edge_policy, NULL)) | ||
| 550 | return -EINVAL; | 544 | return -EINVAL; |
| 551 | 545 | ||
| 552 | if (!edge_attrs[MAC802154_HWSIM_EDGE_ATTR_ENDPOINT_ID] && | 546 | if (!edge_attrs[MAC802154_HWSIM_EDGE_ATTR_ENDPOINT_ID] && |
| @@ -600,31 +594,37 @@ static const struct nla_policy hwsim_genl_policy[MAC802154_HWSIM_ATTR_MAX + 1] = | |||
| 600 | static const struct genl_ops hwsim_nl_ops[] = { | 594 | static const struct genl_ops hwsim_nl_ops[] = { |
| 601 | { | 595 | { |
| 602 | .cmd = MAC802154_HWSIM_CMD_NEW_RADIO, | 596 | .cmd = MAC802154_HWSIM_CMD_NEW_RADIO, |
| 597 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 603 | .doit = hwsim_new_radio_nl, | 598 | .doit = hwsim_new_radio_nl, |
| 604 | .flags = GENL_UNS_ADMIN_PERM, | 599 | .flags = GENL_UNS_ADMIN_PERM, |
| 605 | }, | 600 | }, |
| 606 | { | 601 | { |
| 607 | .cmd = MAC802154_HWSIM_CMD_DEL_RADIO, | 602 | .cmd = MAC802154_HWSIM_CMD_DEL_RADIO, |
| 603 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 608 | .doit = hwsim_del_radio_nl, | 604 | .doit = hwsim_del_radio_nl, |
| 609 | .flags = GENL_UNS_ADMIN_PERM, | 605 | .flags = GENL_UNS_ADMIN_PERM, |
| 610 | }, | 606 | }, |
| 611 | { | 607 | { |
| 612 | .cmd = MAC802154_HWSIM_CMD_GET_RADIO, | 608 | .cmd = MAC802154_HWSIM_CMD_GET_RADIO, |
| 609 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 613 | .doit = hwsim_get_radio_nl, | 610 | .doit = hwsim_get_radio_nl, |
| 614 | .dumpit = hwsim_dump_radio_nl, | 611 | .dumpit = hwsim_dump_radio_nl, |
| 615 | }, | 612 | }, |
| 616 | { | 613 | { |
| 617 | .cmd = MAC802154_HWSIM_CMD_NEW_EDGE, | 614 | .cmd = MAC802154_HWSIM_CMD_NEW_EDGE, |
| 615 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 618 | .doit = hwsim_new_edge_nl, | 616 | .doit = hwsim_new_edge_nl, |
| 619 | .flags = GENL_UNS_ADMIN_PERM, | 617 | .flags = GENL_UNS_ADMIN_PERM, |
| 620 | }, | 618 | }, |
| 621 | { | 619 | { |
| 622 | .cmd = MAC802154_HWSIM_CMD_DEL_EDGE, | 620 | .cmd = MAC802154_HWSIM_CMD_DEL_EDGE, |
| 621 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 623 | .doit = hwsim_del_edge_nl, | 622 | .doit = hwsim_del_edge_nl, |
| 624 | .flags = GENL_UNS_ADMIN_PERM, | 623 | .flags = GENL_UNS_ADMIN_PERM, |
| 625 | }, | 624 | }, |
| 626 | { | 625 | { |
| 627 | .cmd = MAC802154_HWSIM_CMD_SET_EDGE, | 626 | .cmd = MAC802154_HWSIM_CMD_SET_EDGE, |
| 627 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 628 | .doit = hwsim_set_edge_lqi, | 628 | .doit = hwsim_set_edge_lqi, |
| 629 | .flags = GENL_UNS_ADMIN_PERM, | 629 | .flags = GENL_UNS_ADMIN_PERM, |
| 630 | }, | 630 | }, |
diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c index 8dedb9a9781e..009b2902c9d3 100644 --- a/drivers/net/macsec.c +++ b/drivers/net/macsec.c | |||
| @@ -1611,9 +1611,7 @@ static int parse_sa_config(struct nlattr **attrs, struct nlattr **tb_sa) | |||
| 1611 | if (!attrs[MACSEC_ATTR_SA_CONFIG]) | 1611 | if (!attrs[MACSEC_ATTR_SA_CONFIG]) |
| 1612 | return -EINVAL; | 1612 | return -EINVAL; |
| 1613 | 1613 | ||
| 1614 | if (nla_parse_nested(tb_sa, MACSEC_SA_ATTR_MAX, | 1614 | if (nla_parse_nested_deprecated(tb_sa, MACSEC_SA_ATTR_MAX, attrs[MACSEC_ATTR_SA_CONFIG], macsec_genl_sa_policy, NULL)) |
| 1615 | attrs[MACSEC_ATTR_SA_CONFIG], | ||
| 1616 | macsec_genl_sa_policy, NULL)) | ||
| 1617 | return -EINVAL; | 1615 | return -EINVAL; |
| 1618 | 1616 | ||
| 1619 | return 0; | 1617 | return 0; |
| @@ -1624,9 +1622,7 @@ static int parse_rxsc_config(struct nlattr **attrs, struct nlattr **tb_rxsc) | |||
| 1624 | if (!attrs[MACSEC_ATTR_RXSC_CONFIG]) | 1622 | if (!attrs[MACSEC_ATTR_RXSC_CONFIG]) |
| 1625 | return -EINVAL; | 1623 | return -EINVAL; |
| 1626 | 1624 | ||
| 1627 | if (nla_parse_nested(tb_rxsc, MACSEC_RXSC_ATTR_MAX, | 1625 | if (nla_parse_nested_deprecated(tb_rxsc, MACSEC_RXSC_ATTR_MAX, attrs[MACSEC_ATTR_RXSC_CONFIG], macsec_genl_rxsc_policy, NULL)) |
| 1628 | attrs[MACSEC_ATTR_RXSC_CONFIG], | ||
| 1629 | macsec_genl_rxsc_policy, NULL)) | ||
| 1630 | return -EINVAL; | 1626 | return -EINVAL; |
| 1631 | 1627 | ||
| 1632 | return 0; | 1628 | return 0; |
| @@ -2641,50 +2637,60 @@ done: | |||
| 2641 | static const struct genl_ops macsec_genl_ops[] = { | 2637 | static const struct genl_ops macsec_genl_ops[] = { |
| 2642 | { | 2638 | { |
| 2643 | .cmd = MACSEC_CMD_GET_TXSC, | 2639 | .cmd = MACSEC_CMD_GET_TXSC, |
| 2640 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2644 | .dumpit = macsec_dump_txsc, | 2641 | .dumpit = macsec_dump_txsc, |
| 2645 | }, | 2642 | }, |
| 2646 | { | 2643 | { |
| 2647 | .cmd = MACSEC_CMD_ADD_RXSC, | 2644 | .cmd = MACSEC_CMD_ADD_RXSC, |
| 2645 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2648 | .doit = macsec_add_rxsc, | 2646 | .doit = macsec_add_rxsc, |
| 2649 | .flags = GENL_ADMIN_PERM, | 2647 | .flags = GENL_ADMIN_PERM, |
| 2650 | }, | 2648 | }, |
| 2651 | { | 2649 | { |
| 2652 | .cmd = MACSEC_CMD_DEL_RXSC, | 2650 | .cmd = MACSEC_CMD_DEL_RXSC, |
| 2651 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2653 | .doit = macsec_del_rxsc, | 2652 | .doit = macsec_del_rxsc, |
| 2654 | .flags = GENL_ADMIN_PERM, | 2653 | .flags = GENL_ADMIN_PERM, |
| 2655 | }, | 2654 | }, |
| 2656 | { | 2655 | { |
| 2657 | .cmd = MACSEC_CMD_UPD_RXSC, | 2656 | .cmd = MACSEC_CMD_UPD_RXSC, |
| 2657 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2658 | .doit = macsec_upd_rxsc, | 2658 | .doit = macsec_upd_rxsc, |
| 2659 | .flags = GENL_ADMIN_PERM, | 2659 | .flags = GENL_ADMIN_PERM, |
| 2660 | }, | 2660 | }, |
| 2661 | { | 2661 | { |
| 2662 | .cmd = MACSEC_CMD_ADD_TXSA, | 2662 | .cmd = MACSEC_CMD_ADD_TXSA, |
| 2663 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2663 | .doit = macsec_add_txsa, | 2664 | .doit = macsec_add_txsa, |
| 2664 | .flags = GENL_ADMIN_PERM, | 2665 | .flags = GENL_ADMIN_PERM, |
| 2665 | }, | 2666 | }, |
| 2666 | { | 2667 | { |
| 2667 | .cmd = MACSEC_CMD_DEL_TXSA, | 2668 | .cmd = MACSEC_CMD_DEL_TXSA, |
| 2669 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2668 | .doit = macsec_del_txsa, | 2670 | .doit = macsec_del_txsa, |
| 2669 | .flags = GENL_ADMIN_PERM, | 2671 | .flags = GENL_ADMIN_PERM, |
| 2670 | }, | 2672 | }, |
| 2671 | { | 2673 | { |
| 2672 | .cmd = MACSEC_CMD_UPD_TXSA, | 2674 | .cmd = MACSEC_CMD_UPD_TXSA, |
| 2675 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2673 | .doit = macsec_upd_txsa, | 2676 | .doit = macsec_upd_txsa, |
| 2674 | .flags = GENL_ADMIN_PERM, | 2677 | .flags = GENL_ADMIN_PERM, |
| 2675 | }, | 2678 | }, |
| 2676 | { | 2679 | { |
| 2677 | .cmd = MACSEC_CMD_ADD_RXSA, | 2680 | .cmd = MACSEC_CMD_ADD_RXSA, |
| 2681 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2678 | .doit = macsec_add_rxsa, | 2682 | .doit = macsec_add_rxsa, |
| 2679 | .flags = GENL_ADMIN_PERM, | 2683 | .flags = GENL_ADMIN_PERM, |
| 2680 | }, | 2684 | }, |
| 2681 | { | 2685 | { |
| 2682 | .cmd = MACSEC_CMD_DEL_RXSA, | 2686 | .cmd = MACSEC_CMD_DEL_RXSA, |
| 2687 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2683 | .doit = macsec_del_rxsa, | 2688 | .doit = macsec_del_rxsa, |
| 2684 | .flags = GENL_ADMIN_PERM, | 2689 | .flags = GENL_ADMIN_PERM, |
| 2685 | }, | 2690 | }, |
| 2686 | { | 2691 | { |
| 2687 | .cmd = MACSEC_CMD_UPD_RXSA, | 2692 | .cmd = MACSEC_CMD_UPD_RXSA, |
| 2693 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2688 | .doit = macsec_upd_rxsa, | 2694 | .doit = macsec_upd_rxsa, |
| 2689 | .flags = GENL_ADMIN_PERM, | 2695 | .flags = GENL_ADMIN_PERM, |
| 2690 | }, | 2696 | }, |
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index 6306897c147f..2106045b3e16 100644 --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c | |||
| @@ -2510,9 +2510,11 @@ static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info) | |||
| 2510 | err = -EINVAL; | 2510 | err = -EINVAL; |
| 2511 | goto team_put; | 2511 | goto team_put; |
| 2512 | } | 2512 | } |
| 2513 | err = nla_parse_nested(opt_attrs, TEAM_ATTR_OPTION_MAX, | 2513 | err = nla_parse_nested_deprecated(opt_attrs, |
| 2514 | nl_option, team_nl_option_policy, | 2514 | TEAM_ATTR_OPTION_MAX, |
| 2515 | info->extack); | 2515 | nl_option, |
| 2516 | team_nl_option_policy, | ||
| 2517 | info->extack); | ||
| 2516 | if (err) | 2518 | if (err) |
| 2517 | goto team_put; | 2519 | goto team_put; |
| 2518 | if (!opt_attrs[TEAM_ATTR_OPTION_NAME] || | 2520 | if (!opt_attrs[TEAM_ATTR_OPTION_NAME] || |
| @@ -2755,20 +2757,24 @@ static int team_nl_cmd_port_list_get(struct sk_buff *skb, | |||
| 2755 | static const struct genl_ops team_nl_ops[] = { | 2757 | static const struct genl_ops team_nl_ops[] = { |
| 2756 | { | 2758 | { |
| 2757 | .cmd = TEAM_CMD_NOOP, | 2759 | .cmd = TEAM_CMD_NOOP, |
| 2760 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2758 | .doit = team_nl_cmd_noop, | 2761 | .doit = team_nl_cmd_noop, |
| 2759 | }, | 2762 | }, |
| 2760 | { | 2763 | { |
| 2761 | .cmd = TEAM_CMD_OPTIONS_SET, | 2764 | .cmd = TEAM_CMD_OPTIONS_SET, |
| 2765 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2762 | .doit = team_nl_cmd_options_set, | 2766 | .doit = team_nl_cmd_options_set, |
| 2763 | .flags = GENL_ADMIN_PERM, | 2767 | .flags = GENL_ADMIN_PERM, |
| 2764 | }, | 2768 | }, |
| 2765 | { | 2769 | { |
| 2766 | .cmd = TEAM_CMD_OPTIONS_GET, | 2770 | .cmd = TEAM_CMD_OPTIONS_GET, |
| 2771 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2767 | .doit = team_nl_cmd_options_get, | 2772 | .doit = team_nl_cmd_options_get, |
| 2768 | .flags = GENL_ADMIN_PERM, | 2773 | .flags = GENL_ADMIN_PERM, |
| 2769 | }, | 2774 | }, |
| 2770 | { | 2775 | { |
| 2771 | .cmd = TEAM_CMD_PORT_LIST_GET, | 2776 | .cmd = TEAM_CMD_PORT_LIST_GET, |
| 2777 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2772 | .doit = team_nl_cmd_port_list_get, | 2778 | .doit = team_nl_cmd_port_list_get, |
| 2773 | .flags = GENL_ADMIN_PERM, | 2779 | .flags = GENL_ADMIN_PERM, |
| 2774 | }, | 2780 | }, |
diff --git a/drivers/net/wireless/ath/ath10k/testmode.c b/drivers/net/wireless/ath/ath10k/testmode.c index 6433ff10d80e..a29cfb9c72c2 100644 --- a/drivers/net/wireless/ath/ath10k/testmode.c +++ b/drivers/net/wireless/ath/ath10k/testmode.c | |||
| @@ -416,8 +416,8 @@ int ath10k_tm_cmd(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
| 416 | struct nlattr *tb[ATH10K_TM_ATTR_MAX + 1]; | 416 | struct nlattr *tb[ATH10K_TM_ATTR_MAX + 1]; |
| 417 | int ret; | 417 | int ret; |
| 418 | 418 | ||
| 419 | ret = nla_parse(tb, ATH10K_TM_ATTR_MAX, data, len, ath10k_tm_policy, | 419 | ret = nla_parse_deprecated(tb, ATH10K_TM_ATTR_MAX, data, len, |
| 420 | NULL); | 420 | ath10k_tm_policy, NULL); |
| 421 | if (ret) | 421 | if (ret) |
| 422 | return ret; | 422 | return ret; |
| 423 | 423 | ||
diff --git a/drivers/net/wireless/ath/ath6kl/testmode.c b/drivers/net/wireless/ath/ath6kl/testmode.c index d8dcacda9add..f3906dbe5495 100644 --- a/drivers/net/wireless/ath/ath6kl/testmode.c +++ b/drivers/net/wireless/ath/ath6kl/testmode.c | |||
| @@ -74,8 +74,8 @@ int ath6kl_tm_cmd(struct wiphy *wiphy, struct wireless_dev *wdev, | |||
| 74 | int err, buf_len; | 74 | int err, buf_len; |
| 75 | void *buf; | 75 | void *buf; |
| 76 | 76 | ||
| 77 | err = nla_parse(tb, ATH6KL_TM_ATTR_MAX, data, len, ath6kl_tm_policy, | 77 | err = nla_parse_deprecated(tb, ATH6KL_TM_ATTR_MAX, data, len, |
| 78 | NULL); | 78 | ath6kl_tm_policy, NULL); |
| 79 | if (err) | 79 | if (err) |
| 80 | return err; | 80 | return err; |
| 81 | 81 | ||
diff --git a/drivers/net/wireless/ath/wcn36xx/testmode.c b/drivers/net/wireless/ath/wcn36xx/testmode.c index 51a038022c8b..7ae14b4d2d0e 100644 --- a/drivers/net/wireless/ath/wcn36xx/testmode.c +++ b/drivers/net/wireless/ath/wcn36xx/testmode.c | |||
| @@ -132,8 +132,8 @@ int wcn36xx_tm_cmd(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
| 132 | unsigned short attr; | 132 | unsigned short attr; |
| 133 | 133 | ||
| 134 | wcn36xx_dbg_dump(WCN36XX_DBG_TESTMODE_DUMP, "Data:", data, len); | 134 | wcn36xx_dbg_dump(WCN36XX_DBG_TESTMODE_DUMP, "Data:", data, len); |
| 135 | ret = nla_parse(tb, WCN36XX_TM_ATTR_MAX, data, len, | 135 | ret = nla_parse_deprecated(tb, WCN36XX_TM_ATTR_MAX, data, len, |
| 136 | wcn36xx_tm_policy, NULL); | 136 | wcn36xx_tm_policy, NULL); |
| 137 | if (ret) | 137 | if (ret) |
| 138 | return ret; | 138 | return ret; |
| 139 | 139 | ||
diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c index cac18e61474e..9a67ad2a589c 100644 --- a/drivers/net/wireless/ath/wil6210/cfg80211.c +++ b/drivers/net/wireless/ath/wil6210/cfg80211.c | |||
| @@ -2620,8 +2620,8 @@ static int wil_rf_sector_get_cfg(struct wiphy *wiphy, | |||
| 2620 | if (!test_bit(WMI_FW_CAPABILITY_RF_SECTORS, wil->fw_capabilities)) | 2620 | if (!test_bit(WMI_FW_CAPABILITY_RF_SECTORS, wil->fw_capabilities)) |
| 2621 | return -EOPNOTSUPP; | 2621 | return -EOPNOTSUPP; |
| 2622 | 2622 | ||
| 2623 | rc = nla_parse(tb, QCA_ATTR_DMG_RF_SECTOR_MAX, data, data_len, | 2623 | rc = nla_parse_deprecated(tb, QCA_ATTR_DMG_RF_SECTOR_MAX, data, |
| 2624 | wil_rf_sector_policy, NULL); | 2624 | data_len, wil_rf_sector_policy, NULL); |
| 2625 | if (rc) { | 2625 | if (rc) { |
| 2626 | wil_err(wil, "Invalid rf sector ATTR\n"); | 2626 | wil_err(wil, "Invalid rf sector ATTR\n"); |
| 2627 | return rc; | 2627 | return rc; |
| @@ -2740,8 +2740,8 @@ static int wil_rf_sector_set_cfg(struct wiphy *wiphy, | |||
| 2740 | if (!test_bit(WMI_FW_CAPABILITY_RF_SECTORS, wil->fw_capabilities)) | 2740 | if (!test_bit(WMI_FW_CAPABILITY_RF_SECTORS, wil->fw_capabilities)) |
| 2741 | return -EOPNOTSUPP; | 2741 | return -EOPNOTSUPP; |
| 2742 | 2742 | ||
| 2743 | rc = nla_parse(tb, QCA_ATTR_DMG_RF_SECTOR_MAX, data, data_len, | 2743 | rc = nla_parse_deprecated(tb, QCA_ATTR_DMG_RF_SECTOR_MAX, data, |
| 2744 | wil_rf_sector_policy, NULL); | 2744 | data_len, wil_rf_sector_policy, NULL); |
| 2745 | if (rc) { | 2745 | if (rc) { |
| 2746 | wil_err(wil, "Invalid rf sector ATTR\n"); | 2746 | wil_err(wil, "Invalid rf sector ATTR\n"); |
| 2747 | return rc; | 2747 | return rc; |
| @@ -2773,9 +2773,11 @@ static int wil_rf_sector_set_cfg(struct wiphy *wiphy, | |||
| 2773 | cmd.sector_type = sector_type; | 2773 | cmd.sector_type = sector_type; |
| 2774 | nla_for_each_nested(nl_cfg, tb[QCA_ATTR_DMG_RF_SECTOR_CFG], | 2774 | nla_for_each_nested(nl_cfg, tb[QCA_ATTR_DMG_RF_SECTOR_CFG], |
| 2775 | tmp) { | 2775 | tmp) { |
| 2776 | rc = nla_parse_nested(tb2, QCA_ATTR_DMG_RF_SECTOR_CFG_MAX, | 2776 | rc = nla_parse_nested_deprecated(tb2, |
| 2777 | nl_cfg, wil_rf_sector_cfg_policy, | 2777 | QCA_ATTR_DMG_RF_SECTOR_CFG_MAX, |
| 2778 | NULL); | 2778 | nl_cfg, |
| 2779 | wil_rf_sector_cfg_policy, | ||
| 2780 | NULL); | ||
| 2779 | if (rc) { | 2781 | if (rc) { |
| 2780 | wil_err(wil, "invalid sector cfg\n"); | 2782 | wil_err(wil, "invalid sector cfg\n"); |
| 2781 | return -EINVAL; | 2783 | return -EINVAL; |
| @@ -2847,8 +2849,8 @@ static int wil_rf_sector_get_selected(struct wiphy *wiphy, | |||
| 2847 | if (!test_bit(WMI_FW_CAPABILITY_RF_SECTORS, wil->fw_capabilities)) | 2849 | if (!test_bit(WMI_FW_CAPABILITY_RF_SECTORS, wil->fw_capabilities)) |
| 2848 | return -EOPNOTSUPP; | 2850 | return -EOPNOTSUPP; |
| 2849 | 2851 | ||
| 2850 | rc = nla_parse(tb, QCA_ATTR_DMG_RF_SECTOR_MAX, data, data_len, | 2852 | rc = nla_parse_deprecated(tb, QCA_ATTR_DMG_RF_SECTOR_MAX, data, |
| 2851 | wil_rf_sector_policy, NULL); | 2853 | data_len, wil_rf_sector_policy, NULL); |
| 2852 | if (rc) { | 2854 | if (rc) { |
| 2853 | wil_err(wil, "Invalid rf sector ATTR\n"); | 2855 | wil_err(wil, "Invalid rf sector ATTR\n"); |
| 2854 | return rc; | 2856 | return rc; |
| @@ -2955,8 +2957,8 @@ static int wil_rf_sector_set_selected(struct wiphy *wiphy, | |||
| 2955 | if (!test_bit(WMI_FW_CAPABILITY_RF_SECTORS, wil->fw_capabilities)) | 2957 | if (!test_bit(WMI_FW_CAPABILITY_RF_SECTORS, wil->fw_capabilities)) |
| 2956 | return -EOPNOTSUPP; | 2958 | return -EOPNOTSUPP; |
| 2957 | 2959 | ||
| 2958 | rc = nla_parse(tb, QCA_ATTR_DMG_RF_SECTOR_MAX, data, data_len, | 2960 | rc = nla_parse_deprecated(tb, QCA_ATTR_DMG_RF_SECTOR_MAX, data, |
| 2959 | wil_rf_sector_policy, NULL); | 2961 | data_len, wil_rf_sector_policy, NULL); |
| 2960 | if (rc) { | 2962 | if (rc) { |
| 2961 | wil_err(wil, "Invalid rf sector ATTR\n"); | 2963 | wil_err(wil, "Invalid rf sector ATTR\n"); |
| 2962 | return rc; | 2964 | return rc; |
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index d4c7f08f08e3..5c52469288be 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | |||
| @@ -4465,8 +4465,8 @@ static int __iwl_mvm_mac_testmode_cmd(struct iwl_mvm *mvm, | |||
| 4465 | int err; | 4465 | int err; |
| 4466 | u32 noa_duration; | 4466 | u32 noa_duration; |
| 4467 | 4467 | ||
| 4468 | err = nla_parse(tb, IWL_MVM_TM_ATTR_MAX, data, len, iwl_mvm_tm_policy, | 4468 | err = nla_parse_deprecated(tb, IWL_MVM_TM_ATTR_MAX, data, len, |
| 4469 | NULL); | 4469 | iwl_mvm_tm_policy, NULL); |
| 4470 | if (err) | 4470 | if (err) |
| 4471 | return err; | 4471 | return err; |
| 4472 | 4472 | ||
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index 4c2145ba87a0..0dcb511f44e2 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c | |||
| @@ -409,8 +409,8 @@ static int mac80211_hwsim_vendor_cmd_test(struct wiphy *wiphy, | |||
| 409 | int err; | 409 | int err; |
| 410 | u32 val; | 410 | u32 val; |
| 411 | 411 | ||
| 412 | err = nla_parse(tb, QCA_WLAN_VENDOR_ATTR_MAX, data, data_len, | 412 | err = nla_parse_deprecated(tb, QCA_WLAN_VENDOR_ATTR_MAX, data, |
| 413 | hwsim_vendor_test_policy, NULL); | 413 | data_len, hwsim_vendor_test_policy, NULL); |
| 414 | if (err) | 414 | if (err) |
| 415 | return err; | 415 | return err; |
| 416 | if (!tb[QCA_WLAN_VENDOR_ATTR_TEST]) | 416 | if (!tb[QCA_WLAN_VENDOR_ATTR_TEST]) |
| @@ -1936,8 +1936,8 @@ static int mac80211_hwsim_testmode_cmd(struct ieee80211_hw *hw, | |||
| 1936 | struct sk_buff *skb; | 1936 | struct sk_buff *skb; |
| 1937 | int err, ps; | 1937 | int err, ps; |
| 1938 | 1938 | ||
| 1939 | err = nla_parse(tb, HWSIM_TM_ATTR_MAX, data, len, | 1939 | err = nla_parse_deprecated(tb, HWSIM_TM_ATTR_MAX, data, len, |
| 1940 | hwsim_testmode_policy, NULL); | 1940 | hwsim_testmode_policy, NULL); |
| 1941 | if (err) | 1941 | if (err) |
| 1942 | return err; | 1942 | return err; |
| 1943 | 1943 | ||
| @@ -3637,29 +3637,35 @@ done: | |||
| 3637 | static const struct genl_ops hwsim_ops[] = { | 3637 | static const struct genl_ops hwsim_ops[] = { |
| 3638 | { | 3638 | { |
| 3639 | .cmd = HWSIM_CMD_REGISTER, | 3639 | .cmd = HWSIM_CMD_REGISTER, |
| 3640 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 3640 | .doit = hwsim_register_received_nl, | 3641 | .doit = hwsim_register_received_nl, |
| 3641 | .flags = GENL_UNS_ADMIN_PERM, | 3642 | .flags = GENL_UNS_ADMIN_PERM, |
| 3642 | }, | 3643 | }, |
| 3643 | { | 3644 | { |
| 3644 | .cmd = HWSIM_CMD_FRAME, | 3645 | .cmd = HWSIM_CMD_FRAME, |
| 3646 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 3645 | .doit = hwsim_cloned_frame_received_nl, | 3647 | .doit = hwsim_cloned_frame_received_nl, |
| 3646 | }, | 3648 | }, |
| 3647 | { | 3649 | { |
| 3648 | .cmd = HWSIM_CMD_TX_INFO_FRAME, | 3650 | .cmd = HWSIM_CMD_TX_INFO_FRAME, |
| 3651 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 3649 | .doit = hwsim_tx_info_frame_received_nl, | 3652 | .doit = hwsim_tx_info_frame_received_nl, |
| 3650 | }, | 3653 | }, |
| 3651 | { | 3654 | { |
| 3652 | .cmd = HWSIM_CMD_NEW_RADIO, | 3655 | .cmd = HWSIM_CMD_NEW_RADIO, |
| 3656 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 3653 | .doit = hwsim_new_radio_nl, | 3657 | .doit = hwsim_new_radio_nl, |
| 3654 | .flags = GENL_UNS_ADMIN_PERM, | 3658 | .flags = GENL_UNS_ADMIN_PERM, |
| 3655 | }, | 3659 | }, |
| 3656 | { | 3660 | { |
| 3657 | .cmd = HWSIM_CMD_DEL_RADIO, | 3661 | .cmd = HWSIM_CMD_DEL_RADIO, |
| 3662 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 3658 | .doit = hwsim_del_radio_nl, | 3663 | .doit = hwsim_del_radio_nl, |
| 3659 | .flags = GENL_UNS_ADMIN_PERM, | 3664 | .flags = GENL_UNS_ADMIN_PERM, |
| 3660 | }, | 3665 | }, |
| 3661 | { | 3666 | { |
| 3662 | .cmd = HWSIM_CMD_GET_RADIO, | 3667 | .cmd = HWSIM_CMD_GET_RADIO, |
| 3668 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 3663 | .doit = hwsim_get_radio_nl, | 3669 | .doit = hwsim_get_radio_nl, |
| 3664 | .dumpit = hwsim_dump_radio_nl, | 3670 | .dumpit = hwsim_dump_radio_nl, |
| 3665 | }, | 3671 | }, |
diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c index e582d9b3e50c..e11a4bb67172 100644 --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c | |||
| @@ -4059,8 +4059,8 @@ static int mwifiex_tm_cmd(struct wiphy *wiphy, struct wireless_dev *wdev, | |||
| 4059 | if (!priv) | 4059 | if (!priv) |
| 4060 | return -EINVAL; | 4060 | return -EINVAL; |
| 4061 | 4061 | ||
| 4062 | err = nla_parse(tb, MWIFIEX_TM_ATTR_MAX, data, len, mwifiex_tm_policy, | 4062 | err = nla_parse_deprecated(tb, MWIFIEX_TM_ATTR_MAX, data, len, |
| 4063 | NULL); | 4063 | mwifiex_tm_policy, NULL); |
| 4064 | if (err) | 4064 | if (err) |
| 4065 | return err; | 4065 | return err; |
| 4066 | 4066 | ||
diff --git a/drivers/net/wireless/ti/wlcore/testmode.c b/drivers/net/wireless/ti/wlcore/testmode.c index dcb2c8b0feb6..affefaaea1ea 100644 --- a/drivers/net/wireless/ti/wlcore/testmode.c +++ b/drivers/net/wireless/ti/wlcore/testmode.c | |||
| @@ -372,8 +372,8 @@ int wl1271_tm_cmd(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
| 372 | u32 nla_cmd; | 372 | u32 nla_cmd; |
| 373 | int err; | 373 | int err; |
| 374 | 374 | ||
| 375 | err = nla_parse(tb, WL1271_TM_ATTR_MAX, data, len, wl1271_tm_policy, | 375 | err = nla_parse_deprecated(tb, WL1271_TM_ATTR_MAX, data, len, |
| 376 | NULL); | 376 | wl1271_tm_policy, NULL); |
| 377 | if (err) | 377 | if (err) |
| 378 | return err; | 378 | return err; |
| 379 | 379 | ||
diff --git a/drivers/net/wireless/ti/wlcore/vendor_cmd.c b/drivers/net/wireless/ti/wlcore/vendor_cmd.c index 7f34ec077ee5..75756fb8e7b0 100644 --- a/drivers/net/wireless/ti/wlcore/vendor_cmd.c +++ b/drivers/net/wireless/ti/wlcore/vendor_cmd.c | |||
| @@ -41,8 +41,8 @@ wlcore_vendor_cmd_smart_config_start(struct wiphy *wiphy, | |||
| 41 | if (!data) | 41 | if (!data) |
| 42 | return -EINVAL; | 42 | return -EINVAL; |
| 43 | 43 | ||
| 44 | ret = nla_parse(tb, MAX_WLCORE_VENDOR_ATTR, data, data_len, | 44 | ret = nla_parse_deprecated(tb, MAX_WLCORE_VENDOR_ATTR, data, data_len, |
| 45 | wlcore_vendor_attr_policy, NULL); | 45 | wlcore_vendor_attr_policy, NULL); |
| 46 | if (ret) | 46 | if (ret) |
| 47 | return ret; | 47 | return ret; |
| 48 | 48 | ||
| @@ -122,8 +122,8 @@ wlcore_vendor_cmd_smart_config_set_group_key(struct wiphy *wiphy, | |||
| 122 | if (!data) | 122 | if (!data) |
| 123 | return -EINVAL; | 123 | return -EINVAL; |
| 124 | 124 | ||
| 125 | ret = nla_parse(tb, MAX_WLCORE_VENDOR_ATTR, data, data_len, | 125 | ret = nla_parse_deprecated(tb, MAX_WLCORE_VENDOR_ATTR, data, data_len, |
| 126 | wlcore_vendor_attr_policy, NULL); | 126 | wlcore_vendor_attr_policy, NULL); |
| 127 | if (ret) | 127 | if (ret) |
| 128 | return ret; | 128 | return ret; |
| 129 | 129 | ||
diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index 481d371c4b01..40b29ca5a98d 100644 --- a/drivers/target/target_core_user.c +++ b/drivers/target/target_core_user.c | |||
| @@ -441,21 +441,25 @@ static int tcmu_genl_set_features(struct sk_buff *skb, struct genl_info *info) | |||
| 441 | static const struct genl_ops tcmu_genl_ops[] = { | 441 | static const struct genl_ops tcmu_genl_ops[] = { |
| 442 | { | 442 | { |
| 443 | .cmd = TCMU_CMD_SET_FEATURES, | 443 | .cmd = TCMU_CMD_SET_FEATURES, |
| 444 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 444 | .flags = GENL_ADMIN_PERM, | 445 | .flags = GENL_ADMIN_PERM, |
| 445 | .doit = tcmu_genl_set_features, | 446 | .doit = tcmu_genl_set_features, |
| 446 | }, | 447 | }, |
| 447 | { | 448 | { |
| 448 | .cmd = TCMU_CMD_ADDED_DEVICE_DONE, | 449 | .cmd = TCMU_CMD_ADDED_DEVICE_DONE, |
| 450 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 449 | .flags = GENL_ADMIN_PERM, | 451 | .flags = GENL_ADMIN_PERM, |
| 450 | .doit = tcmu_genl_add_dev_done, | 452 | .doit = tcmu_genl_add_dev_done, |
| 451 | }, | 453 | }, |
| 452 | { | 454 | { |
| 453 | .cmd = TCMU_CMD_REMOVED_DEVICE_DONE, | 455 | .cmd = TCMU_CMD_REMOVED_DEVICE_DONE, |
| 456 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 454 | .flags = GENL_ADMIN_PERM, | 457 | .flags = GENL_ADMIN_PERM, |
| 455 | .doit = tcmu_genl_rm_dev_done, | 458 | .doit = tcmu_genl_rm_dev_done, |
| 456 | }, | 459 | }, |
| 457 | { | 460 | { |
| 458 | .cmd = TCMU_CMD_RECONFIG_DEVICE_DONE, | 461 | .cmd = TCMU_CMD_RECONFIG_DEVICE_DONE, |
| 462 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 459 | .flags = GENL_ADMIN_PERM, | 463 | .flags = GENL_ADMIN_PERM, |
| 460 | .doit = tcmu_genl_reconfig_dev_done, | 464 | .doit = tcmu_genl_reconfig_dev_done, |
| 461 | }, | 465 | }, |
diff --git a/fs/dlm/netlink.c b/fs/dlm/netlink.c index 43a96c330570..d8e27defa89f 100644 --- a/fs/dlm/netlink.c +++ b/fs/dlm/netlink.c | |||
| @@ -68,6 +68,7 @@ static int user_cmd(struct sk_buff *skb, struct genl_info *info) | |||
| 68 | static const struct genl_ops dlm_nl_ops[] = { | 68 | static const struct genl_ops dlm_nl_ops[] = { |
| 69 | { | 69 | { |
| 70 | .cmd = DLM_CMD_HELLO, | 70 | .cmd = DLM_CMD_HELLO, |
| 71 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 71 | .doit = user_cmd, | 72 | .doit = user_cmd, |
| 72 | }, | 73 | }, |
| 73 | }; | 74 | }; |
diff --git a/include/net/genetlink.h b/include/net/genetlink.h index 6850c7b1a3a6..9292f1c588b7 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h | |||
| @@ -121,6 +121,12 @@ static inline int genl_err_attr(struct genl_info *info, int err, | |||
| 121 | return err; | 121 | return err; |
| 122 | } | 122 | } |
| 123 | 123 | ||
| 124 | enum genl_validate_flags { | ||
| 125 | GENL_DONT_VALIDATE_STRICT = BIT(0), | ||
| 126 | GENL_DONT_VALIDATE_DUMP = BIT(1), | ||
| 127 | GENL_DONT_VALIDATE_DUMP_STRICT = BIT(2), | ||
| 128 | }; | ||
| 129 | |||
| 124 | /** | 130 | /** |
| 125 | * struct genl_ops - generic netlink operations | 131 | * struct genl_ops - generic netlink operations |
| 126 | * @cmd: command identifier | 132 | * @cmd: command identifier |
| @@ -141,6 +147,7 @@ struct genl_ops { | |||
| 141 | u8 cmd; | 147 | u8 cmd; |
| 142 | u8 internal_flags; | 148 | u8 internal_flags; |
| 143 | u8 flags; | 149 | u8 flags; |
| 150 | u8 validate; | ||
| 144 | }; | 151 | }; |
| 145 | 152 | ||
| 146 | int genl_register_family(struct genl_family *family); | 153 | int genl_register_family(struct genl_family *family); |
| @@ -165,6 +172,25 @@ static inline struct nlmsghdr *genlmsg_nlhdr(void *user_hdr) | |||
| 165 | } | 172 | } |
| 166 | 173 | ||
| 167 | /** | 174 | /** |
| 175 | * genlmsg_parse_deprecated - parse attributes of a genetlink message | ||
| 176 | * @nlh: netlink message header | ||
| 177 | * @family: genetlink message family | ||
| 178 | * @tb: destination array with maxtype+1 elements | ||
| 179 | * @maxtype: maximum attribute type to be expected | ||
| 180 | * @policy: validation policy | ||
| 181 | * @extack: extended ACK report struct | ||
| 182 | */ | ||
| 183 | static inline int genlmsg_parse_deprecated(const struct nlmsghdr *nlh, | ||
| 184 | const struct genl_family *family, | ||
| 185 | struct nlattr *tb[], int maxtype, | ||
| 186 | const struct nla_policy *policy, | ||
| 187 | struct netlink_ext_ack *extack) | ||
| 188 | { | ||
| 189 | return __nlmsg_parse(nlh, family->hdrsize + GENL_HDRLEN, tb, maxtype, | ||
| 190 | policy, NL_VALIDATE_LIBERAL, extack); | ||
| 191 | } | ||
| 192 | |||
| 193 | /** | ||
| 168 | * genlmsg_parse - parse attributes of a genetlink message | 194 | * genlmsg_parse - parse attributes of a genetlink message |
| 169 | * @nlh: netlink message header | 195 | * @nlh: netlink message header |
| 170 | * @family: genetlink message family | 196 | * @family: genetlink message family |
| @@ -179,8 +205,8 @@ static inline int genlmsg_parse(const struct nlmsghdr *nlh, | |||
| 179 | const struct nla_policy *policy, | 205 | const struct nla_policy *policy, |
| 180 | struct netlink_ext_ack *extack) | 206 | struct netlink_ext_ack *extack) |
| 181 | { | 207 | { |
| 182 | return nlmsg_parse(nlh, family->hdrsize + GENL_HDRLEN, tb, maxtype, | 208 | return __nlmsg_parse(nlh, family->hdrsize + GENL_HDRLEN, tb, maxtype, |
| 183 | policy, extack); | 209 | policy, NL_VALIDATE_STRICT, extack); |
| 184 | } | 210 | } |
| 185 | 211 | ||
| 186 | /** | 212 | /** |
diff --git a/include/net/netlink.h b/include/net/netlink.h index 1f18b47f41b4..679f649748d4 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h | |||
| @@ -183,6 +183,7 @@ enum { | |||
| 183 | NLA_REJECT, | 183 | NLA_REJECT, |
| 184 | NLA_EXACT_LEN, | 184 | NLA_EXACT_LEN, |
| 185 | NLA_EXACT_LEN_WARN, | 185 | NLA_EXACT_LEN_WARN, |
| 186 | NLA_MIN_LEN, | ||
| 186 | __NLA_TYPE_MAX, | 187 | __NLA_TYPE_MAX, |
| 187 | }; | 188 | }; |
| 188 | 189 | ||
| @@ -212,6 +213,7 @@ enum nla_policy_validation { | |||
| 212 | * NLA_NUL_STRING Maximum length of string (excluding NUL) | 213 | * NLA_NUL_STRING Maximum length of string (excluding NUL) |
| 213 | * NLA_FLAG Unused | 214 | * NLA_FLAG Unused |
| 214 | * NLA_BINARY Maximum length of attribute payload | 215 | * NLA_BINARY Maximum length of attribute payload |
| 216 | * NLA_MIN_LEN Minimum length of attribute payload | ||
| 215 | * NLA_NESTED, | 217 | * NLA_NESTED, |
| 216 | * NLA_NESTED_ARRAY Length verification is done by checking len of | 218 | * NLA_NESTED_ARRAY Length verification is done by checking len of |
| 217 | * nested header (or empty); len field is used if | 219 | * nested header (or empty); len field is used if |
| @@ -230,6 +232,7 @@ enum nla_policy_validation { | |||
| 230 | * it is rejected. | 232 | * it is rejected. |
| 231 | * NLA_EXACT_LEN_WARN Attribute should have exactly this length, a warning | 233 | * NLA_EXACT_LEN_WARN Attribute should have exactly this length, a warning |
| 232 | * is logged if it is longer, shorter is rejected. | 234 | * is logged if it is longer, shorter is rejected. |
| 235 | * NLA_MIN_LEN Minimum length of attribute payload | ||
| 233 | * All other Minimum length of attribute payload | 236 | * All other Minimum length of attribute payload |
| 234 | * | 237 | * |
| 235 | * Meaning of `validation_data' field: | 238 | * Meaning of `validation_data' field: |
| @@ -281,7 +284,7 @@ enum nla_policy_validation { | |||
| 281 | * static const struct nla_policy my_policy[ATTR_MAX+1] = { | 284 | * static const struct nla_policy my_policy[ATTR_MAX+1] = { |
| 282 | * [ATTR_FOO] = { .type = NLA_U16 }, | 285 | * [ATTR_FOO] = { .type = NLA_U16 }, |
| 283 | * [ATTR_BAR] = { .type = NLA_STRING, .len = BARSIZ }, | 286 | * [ATTR_BAR] = { .type = NLA_STRING, .len = BARSIZ }, |
| 284 | * [ATTR_BAZ] = { .len = sizeof(struct mystruct) }, | 287 | * [ATTR_BAZ] = { .type = NLA_EXACT_LEN, .len = sizeof(struct mystruct) }, |
| 285 | * [ATTR_GOO] = { .type = NLA_BITFIELD32, .validation_data = &myvalidflags }, | 288 | * [ATTR_GOO] = { .type = NLA_BITFIELD32, .validation_data = &myvalidflags }, |
| 286 | * }; | 289 | * }; |
| 287 | */ | 290 | */ |
| @@ -296,12 +299,31 @@ struct nla_policy { | |||
| 296 | }; | 299 | }; |
| 297 | int (*validate)(const struct nlattr *attr, | 300 | int (*validate)(const struct nlattr *attr, |
| 298 | struct netlink_ext_ack *extack); | 301 | struct netlink_ext_ack *extack); |
| 302 | /* This entry is special, and used for the attribute at index 0 | ||
| 303 | * only, and specifies special data about the policy, namely it | ||
| 304 | * specifies the "boundary type" where strict length validation | ||
| 305 | * starts for any attribute types >= this value, also, strict | ||
| 306 | * nesting validation starts here. | ||
| 307 | * | ||
| 308 | * Additionally, it means that NLA_UNSPEC is actually NLA_REJECT | ||
| 309 | * for any types >= this, so need to use NLA_MIN_LEN to get the | ||
| 310 | * previous pure { .len = xyz } behaviour. The advantage of this | ||
| 311 | * is that types not specified in the policy will be rejected. | ||
| 312 | * | ||
| 313 | * For completely new families it should be set to 1 so that the | ||
| 314 | * validation is enforced for all attributes. For existing ones | ||
| 315 | * it should be set at least when new attributes are added to | ||
| 316 | * the enum used by the policy, and be set to the new value that | ||
| 317 | * was added to enforce strict validation from thereon. | ||
| 318 | */ | ||
| 319 | u16 strict_start_type; | ||
| 299 | }; | 320 | }; |
| 300 | }; | 321 | }; |
| 301 | 322 | ||
| 302 | #define NLA_POLICY_EXACT_LEN(_len) { .type = NLA_EXACT_LEN, .len = _len } | 323 | #define NLA_POLICY_EXACT_LEN(_len) { .type = NLA_EXACT_LEN, .len = _len } |
| 303 | #define NLA_POLICY_EXACT_LEN_WARN(_len) { .type = NLA_EXACT_LEN_WARN, \ | 324 | #define NLA_POLICY_EXACT_LEN_WARN(_len) { .type = NLA_EXACT_LEN_WARN, \ |
| 304 | .len = _len } | 325 | .len = _len } |
| 326 | #define NLA_POLICY_MIN_LEN(_len) { .type = NLA_MIN_LEN, .len = _len } | ||
| 305 | 327 | ||
| 306 | #define NLA_POLICY_ETH_ADDR NLA_POLICY_EXACT_LEN(ETH_ALEN) | 328 | #define NLA_POLICY_ETH_ADDR NLA_POLICY_EXACT_LEN(ETH_ALEN) |
| 307 | #define NLA_POLICY_ETH_ADDR_COMPAT NLA_POLICY_EXACT_LEN_WARN(ETH_ALEN) | 329 | #define NLA_POLICY_ETH_ADDR_COMPAT NLA_POLICY_EXACT_LEN_WARN(ETH_ALEN) |
| @@ -365,21 +387,48 @@ struct nl_info { | |||
| 365 | bool skip_notify; | 387 | bool skip_notify; |
| 366 | }; | 388 | }; |
| 367 | 389 | ||
| 390 | /** | ||
| 391 | * enum netlink_validation - netlink message/attribute validation levels | ||
| 392 | * @NL_VALIDATE_LIBERAL: Old-style "be liberal" validation, not caring about | ||
| 393 | * extra data at the end of the message, attributes being longer than | ||
| 394 | * they should be, or unknown attributes being present. | ||
| 395 | * @NL_VALIDATE_TRAILING: Reject junk data encountered after attribute parsing. | ||
| 396 | * @NL_VALIDATE_MAXTYPE: Reject attributes > max type; Together with _TRAILING | ||
| 397 | * this is equivalent to the old nla_parse_strict()/nlmsg_parse_strict(). | ||
| 398 | * @NL_VALIDATE_UNSPEC: Reject attributes with NLA_UNSPEC in the policy. | ||
| 399 | * This can safely be set by the kernel when the given policy has no | ||
| 400 | * NLA_UNSPEC anymore, and can thus be used to ensure policy entries | ||
| 401 | * are enforced going forward. | ||
| 402 | * @NL_VALIDATE_STRICT_ATTRS: strict attribute policy parsing (e.g. | ||
| 403 | * U8, U16, U32 must have exact size, etc.) | ||
| 404 | */ | ||
| 405 | enum netlink_validation { | ||
| 406 | NL_VALIDATE_LIBERAL = 0, | ||
| 407 | NL_VALIDATE_TRAILING = BIT(0), | ||
| 408 | NL_VALIDATE_MAXTYPE = BIT(1), | ||
| 409 | NL_VALIDATE_UNSPEC = BIT(2), | ||
| 410 | NL_VALIDATE_STRICT_ATTRS = BIT(3), | ||
| 411 | }; | ||
| 412 | |||
| 413 | #define NL_VALIDATE_DEPRECATED_STRICT (NL_VALIDATE_TRAILING |\ | ||
| 414 | NL_VALIDATE_MAXTYPE) | ||
| 415 | #define NL_VALIDATE_STRICT (NL_VALIDATE_TRAILING |\ | ||
| 416 | NL_VALIDATE_MAXTYPE |\ | ||
| 417 | NL_VALIDATE_UNSPEC |\ | ||
| 418 | NL_VALIDATE_STRICT_ATTRS) | ||
| 419 | |||
| 368 | int netlink_rcv_skb(struct sk_buff *skb, | 420 | int netlink_rcv_skb(struct sk_buff *skb, |
| 369 | int (*cb)(struct sk_buff *, struct nlmsghdr *, | 421 | int (*cb)(struct sk_buff *, struct nlmsghdr *, |
| 370 | struct netlink_ext_ack *)); | 422 | struct netlink_ext_ack *)); |
| 371 | int nlmsg_notify(struct sock *sk, struct sk_buff *skb, u32 portid, | 423 | int nlmsg_notify(struct sock *sk, struct sk_buff *skb, u32 portid, |
| 372 | unsigned int group, int report, gfp_t flags); | 424 | unsigned int group, int report, gfp_t flags); |
| 373 | 425 | ||
| 374 | int nla_validate(const struct nlattr *head, int len, int maxtype, | 426 | int __nla_validate(const struct nlattr *head, int len, int maxtype, |
| 375 | const struct nla_policy *policy, | 427 | const struct nla_policy *policy, unsigned int validate, |
| 376 | struct netlink_ext_ack *extack); | 428 | struct netlink_ext_ack *extack); |
| 377 | int nla_parse(struct nlattr **tb, int maxtype, const struct nlattr *head, | 429 | int __nla_parse(struct nlattr **tb, int maxtype, const struct nlattr *head, |
| 378 | int len, const struct nla_policy *policy, | 430 | int len, const struct nla_policy *policy, unsigned int validate, |
| 379 | struct netlink_ext_ack *extack); | 431 | struct netlink_ext_ack *extack); |
| 380 | int nla_parse_strict(struct nlattr **tb, int maxtype, const struct nlattr *head, | ||
| 381 | int len, const struct nla_policy *policy, | ||
| 382 | struct netlink_ext_ack *extack); | ||
| 383 | int nla_policy_len(const struct nla_policy *, int); | 432 | int nla_policy_len(const struct nla_policy *, int); |
| 384 | struct nlattr *nla_find(const struct nlattr *head, int len, int attrtype); | 433 | struct nlattr *nla_find(const struct nlattr *head, int len, int attrtype); |
| 385 | size_t nla_strlcpy(char *dst, const struct nlattr *nla, size_t dstsize); | 434 | size_t nla_strlcpy(char *dst, const struct nlattr *nla, size_t dstsize); |
| @@ -508,42 +557,167 @@ nlmsg_next(const struct nlmsghdr *nlh, int *remaining) | |||
| 508 | } | 557 | } |
| 509 | 558 | ||
| 510 | /** | 559 | /** |
| 511 | * nlmsg_parse - parse attributes of a netlink message | 560 | * nla_parse - Parse a stream of attributes into a tb buffer |
| 561 | * @tb: destination array with maxtype+1 elements | ||
| 562 | * @maxtype: maximum attribute type to be expected | ||
| 563 | * @head: head of attribute stream | ||
| 564 | * @len: length of attribute stream | ||
| 565 | * @policy: validation policy | ||
| 566 | * @extack: extended ACK pointer | ||
| 567 | * | ||
| 568 | * Parses a stream of attributes and stores a pointer to each attribute in | ||
| 569 | * the tb array accessible via the attribute type. Attributes with a type | ||
| 570 | * exceeding maxtype will be rejected, policy must be specified, attributes | ||
| 571 | * will be validated in the strictest way possible. | ||
| 572 | * | ||
| 573 | * Returns 0 on success or a negative error code. | ||
| 574 | */ | ||
| 575 | static inline int nla_parse(struct nlattr **tb, int maxtype, | ||
| 576 | const struct nlattr *head, int len, | ||
| 577 | const struct nla_policy *policy, | ||
| 578 | struct netlink_ext_ack *extack) | ||
| 579 | { | ||
| 580 | return __nla_parse(tb, maxtype, head, len, policy, | ||
| 581 | NL_VALIDATE_STRICT, extack); | ||
| 582 | } | ||
| 583 | |||
| 584 | /** | ||
| 585 | * nla_parse_deprecated - Parse a stream of attributes into a tb buffer | ||
| 586 | * @tb: destination array with maxtype+1 elements | ||
| 587 | * @maxtype: maximum attribute type to be expected | ||
| 588 | * @head: head of attribute stream | ||
| 589 | * @len: length of attribute stream | ||
| 590 | * @policy: validation policy | ||
| 591 | * @extack: extended ACK pointer | ||
| 592 | * | ||
| 593 | * Parses a stream of attributes and stores a pointer to each attribute in | ||
| 594 | * the tb array accessible via the attribute type. Attributes with a type | ||
| 595 | * exceeding maxtype will be ignored and attributes from the policy are not | ||
| 596 | * always strictly validated (only for new attributes). | ||
| 597 | * | ||
| 598 | * Returns 0 on success or a negative error code. | ||
| 599 | */ | ||
| 600 | static inline int nla_parse_deprecated(struct nlattr **tb, int maxtype, | ||
| 601 | const struct nlattr *head, int len, | ||
| 602 | const struct nla_policy *policy, | ||
| 603 | struct netlink_ext_ack *extack) | ||
| 604 | { | ||
| 605 | return __nla_parse(tb, maxtype, head, len, policy, | ||
| 606 | NL_VALIDATE_LIBERAL, extack); | ||
| 607 | } | ||
| 608 | |||
| 609 | /** | ||
| 610 | * nla_parse_deprecated_strict - Parse a stream of attributes into a tb buffer | ||
| 611 | * @tb: destination array with maxtype+1 elements | ||
| 612 | * @maxtype: maximum attribute type to be expected | ||
| 613 | * @head: head of attribute stream | ||
| 614 | * @len: length of attribute stream | ||
| 615 | * @policy: validation policy | ||
| 616 | * @extack: extended ACK pointer | ||
| 617 | * | ||
| 618 | * Parses a stream of attributes and stores a pointer to each attribute in | ||
| 619 | * the tb array accessible via the attribute type. Attributes with a type | ||
| 620 | * exceeding maxtype will be rejected as well as trailing data, but the | ||
| 621 | * policy is not completely strictly validated (only for new attributes). | ||
| 622 | * | ||
| 623 | * Returns 0 on success or a negative error code. | ||
| 624 | */ | ||
| 625 | static inline int nla_parse_deprecated_strict(struct nlattr **tb, int maxtype, | ||
| 626 | const struct nlattr *head, | ||
| 627 | int len, | ||
| 628 | const struct nla_policy *policy, | ||
| 629 | struct netlink_ext_ack *extack) | ||
| 630 | { | ||
| 631 | return __nla_parse(tb, maxtype, head, len, policy, | ||
| 632 | NL_VALIDATE_DEPRECATED_STRICT, extack); | ||
| 633 | } | ||
| 634 | |||
| 635 | /** | ||
| 636 | * __nlmsg_parse - parse attributes of a netlink message | ||
| 512 | * @nlh: netlink message header | 637 | * @nlh: netlink message header |
| 513 | * @hdrlen: length of family specific header | 638 | * @hdrlen: length of family specific header |
| 514 | * @tb: destination array with maxtype+1 elements | 639 | * @tb: destination array with maxtype+1 elements |
| 515 | * @maxtype: maximum attribute type to be expected | 640 | * @maxtype: maximum attribute type to be expected |
| 516 | * @policy: validation policy | 641 | * @policy: validation policy |
| 642 | * @validate: validation strictness | ||
| 517 | * @extack: extended ACK report struct | 643 | * @extack: extended ACK report struct |
| 518 | * | 644 | * |
| 519 | * See nla_parse() | 645 | * See nla_parse() |
| 520 | */ | 646 | */ |
| 521 | static inline int nlmsg_parse(const struct nlmsghdr *nlh, int hdrlen, | 647 | static inline int __nlmsg_parse(const struct nlmsghdr *nlh, int hdrlen, |
| 522 | struct nlattr *tb[], int maxtype, | 648 | struct nlattr *tb[], int maxtype, |
| 523 | const struct nla_policy *policy, | 649 | const struct nla_policy *policy, |
| 524 | struct netlink_ext_ack *extack) | 650 | unsigned int validate, |
| 651 | struct netlink_ext_ack *extack) | ||
| 525 | { | 652 | { |
| 526 | if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) { | 653 | if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) { |
| 527 | NL_SET_ERR_MSG(extack, "Invalid header length"); | 654 | NL_SET_ERR_MSG(extack, "Invalid header length"); |
| 528 | return -EINVAL; | 655 | return -EINVAL; |
| 529 | } | 656 | } |
| 530 | 657 | ||
| 531 | return nla_parse(tb, maxtype, nlmsg_attrdata(nlh, hdrlen), | 658 | return __nla_parse(tb, maxtype, nlmsg_attrdata(nlh, hdrlen), |
| 532 | nlmsg_attrlen(nlh, hdrlen), policy, extack); | 659 | nlmsg_attrlen(nlh, hdrlen), policy, validate, |
| 660 | extack); | ||
| 533 | } | 661 | } |
| 534 | 662 | ||
| 535 | static inline int nlmsg_parse_strict(const struct nlmsghdr *nlh, int hdrlen, | 663 | /** |
| 536 | struct nlattr *tb[], int maxtype, | 664 | * nlmsg_parse - parse attributes of a netlink message |
| 537 | const struct nla_policy *policy, | 665 | * @nlh: netlink message header |
| 538 | struct netlink_ext_ack *extack) | 666 | * @hdrlen: length of family specific header |
| 667 | * @tb: destination array with maxtype+1 elements | ||
| 668 | * @maxtype: maximum attribute type to be expected | ||
| 669 | * @validate: validation strictness | ||
| 670 | * @extack: extended ACK report struct | ||
| 671 | * | ||
| 672 | * See nla_parse() | ||
| 673 | */ | ||
| 674 | static inline int nlmsg_parse(const struct nlmsghdr *nlh, int hdrlen, | ||
| 675 | struct nlattr *tb[], int maxtype, | ||
| 676 | const struct nla_policy *policy, | ||
| 677 | struct netlink_ext_ack *extack) | ||
| 539 | { | 678 | { |
| 540 | if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) { | 679 | return __nla_parse(tb, maxtype, nlmsg_attrdata(nlh, hdrlen), |
| 541 | NL_SET_ERR_MSG(extack, "Invalid header length"); | 680 | nlmsg_attrlen(nlh, hdrlen), policy, |
| 542 | return -EINVAL; | 681 | NL_VALIDATE_STRICT, extack); |
| 543 | } | 682 | } |
| 544 | 683 | ||
| 545 | return nla_parse_strict(tb, maxtype, nlmsg_attrdata(nlh, hdrlen), | 684 | /** |
| 546 | nlmsg_attrlen(nlh, hdrlen), policy, extack); | 685 | * nlmsg_parse_deprecated - parse attributes of a netlink message |
| 686 | * @nlh: netlink message header | ||
| 687 | * @hdrlen: length of family specific header | ||
| 688 | * @tb: destination array with maxtype+1 elements | ||
| 689 | * @maxtype: maximum attribute type to be expected | ||
| 690 | * @extack: extended ACK report struct | ||
| 691 | * | ||
| 692 | * See nla_parse_deprecated() | ||
| 693 | */ | ||
| 694 | static inline int nlmsg_parse_deprecated(const struct nlmsghdr *nlh, int hdrlen, | ||
| 695 | struct nlattr *tb[], int maxtype, | ||
| 696 | const struct nla_policy *policy, | ||
| 697 | struct netlink_ext_ack *extack) | ||
| 698 | { | ||
| 699 | return __nlmsg_parse(nlh, hdrlen, tb, maxtype, policy, | ||
| 700 | NL_VALIDATE_LIBERAL, extack); | ||
| 701 | } | ||
| 702 | |||
| 703 | /** | ||
| 704 | * nlmsg_parse_deprecated_strict - parse attributes of a netlink message | ||
| 705 | * @nlh: netlink message header | ||
| 706 | * @hdrlen: length of family specific header | ||
| 707 | * @tb: destination array with maxtype+1 elements | ||
| 708 | * @maxtype: maximum attribute type to be expected | ||
| 709 | * @extack: extended ACK report struct | ||
| 710 | * | ||
| 711 | * See nla_parse_deprecated_strict() | ||
| 712 | */ | ||
| 713 | static inline int | ||
| 714 | nlmsg_parse_deprecated_strict(const struct nlmsghdr *nlh, int hdrlen, | ||
| 715 | struct nlattr *tb[], int maxtype, | ||
| 716 | const struct nla_policy *policy, | ||
| 717 | struct netlink_ext_ack *extack) | ||
| 718 | { | ||
| 719 | return __nlmsg_parse(nlh, hdrlen, tb, maxtype, policy, | ||
| 720 | NL_VALIDATE_DEPRECATED_STRICT, extack); | ||
| 547 | } | 721 | } |
| 548 | 722 | ||
| 549 | /** | 723 | /** |
| @@ -562,26 +736,75 @@ static inline struct nlattr *nlmsg_find_attr(const struct nlmsghdr *nlh, | |||
| 562 | } | 736 | } |
| 563 | 737 | ||
| 564 | /** | 738 | /** |
| 565 | * nlmsg_validate - validate a netlink message including attributes | 739 | * nla_validate_deprecated - Validate a stream of attributes |
| 740 | * @head: head of attribute stream | ||
| 741 | * @len: length of attribute stream | ||
| 742 | * @maxtype: maximum attribute type to be expected | ||
| 743 | * @policy: validation policy | ||
| 744 | * @validate: validation strictness | ||
| 745 | * @extack: extended ACK report struct | ||
| 746 | * | ||
| 747 | * Validates all attributes in the specified attribute stream against the | ||
| 748 | * specified policy. Validation is done in liberal mode. | ||
| 749 | * See documenation of struct nla_policy for more details. | ||
| 750 | * | ||
| 751 | * Returns 0 on success or a negative error code. | ||
| 752 | */ | ||
| 753 | static inline int nla_validate_deprecated(const struct nlattr *head, int len, | ||
| 754 | int maxtype, | ||
| 755 | const struct nla_policy *policy, | ||
| 756 | struct netlink_ext_ack *extack) | ||
| 757 | { | ||
| 758 | return __nla_validate(head, len, maxtype, policy, NL_VALIDATE_LIBERAL, | ||
| 759 | extack); | ||
| 760 | } | ||
| 761 | |||
| 762 | /** | ||
| 763 | * nla_validate - Validate a stream of attributes | ||
| 764 | * @head: head of attribute stream | ||
| 765 | * @len: length of attribute stream | ||
| 766 | * @maxtype: maximum attribute type to be expected | ||
| 767 | * @policy: validation policy | ||
| 768 | * @validate: validation strictness | ||
| 769 | * @extack: extended ACK report struct | ||
| 770 | * | ||
| 771 | * Validates all attributes in the specified attribute stream against the | ||
| 772 | * specified policy. Validation is done in strict mode. | ||
| 773 | * See documenation of struct nla_policy for more details. | ||
| 774 | * | ||
| 775 | * Returns 0 on success or a negative error code. | ||
| 776 | */ | ||
| 777 | static inline int nla_validate(const struct nlattr *head, int len, int maxtype, | ||
| 778 | const struct nla_policy *policy, | ||
| 779 | struct netlink_ext_ack *extack) | ||
| 780 | { | ||
| 781 | return __nla_validate(head, len, maxtype, policy, NL_VALIDATE_STRICT, | ||
| 782 | extack); | ||
| 783 | } | ||
| 784 | |||
| 785 | /** | ||
| 786 | * nlmsg_validate_deprecated - validate a netlink message including attributes | ||
| 566 | * @nlh: netlinket message header | 787 | * @nlh: netlinket message header |
| 567 | * @hdrlen: length of familiy specific header | 788 | * @hdrlen: length of familiy specific header |
| 568 | * @maxtype: maximum attribute type to be expected | 789 | * @maxtype: maximum attribute type to be expected |
| 569 | * @policy: validation policy | 790 | * @policy: validation policy |
| 570 | * @extack: extended ACK report struct | 791 | * @extack: extended ACK report struct |
| 571 | */ | 792 | */ |
| 572 | static inline int nlmsg_validate(const struct nlmsghdr *nlh, | 793 | static inline int nlmsg_validate_deprecated(const struct nlmsghdr *nlh, |
| 573 | int hdrlen, int maxtype, | 794 | int hdrlen, int maxtype, |
| 574 | const struct nla_policy *policy, | 795 | const struct nla_policy *policy, |
| 575 | struct netlink_ext_ack *extack) | 796 | struct netlink_ext_ack *extack) |
| 576 | { | 797 | { |
| 577 | if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) | 798 | if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) |
| 578 | return -EINVAL; | 799 | return -EINVAL; |
| 579 | 800 | ||
| 580 | return nla_validate(nlmsg_attrdata(nlh, hdrlen), | 801 | return __nla_validate(nlmsg_attrdata(nlh, hdrlen), |
| 581 | nlmsg_attrlen(nlh, hdrlen), maxtype, policy, | 802 | nlmsg_attrlen(nlh, hdrlen), maxtype, |
| 582 | extack); | 803 | policy, NL_VALIDATE_LIBERAL, extack); |
| 583 | } | 804 | } |
| 584 | 805 | ||
| 806 | |||
| 807 | |||
| 585 | /** | 808 | /** |
| 586 | * nlmsg_report - need to report back to application? | 809 | * nlmsg_report - need to report back to application? |
| 587 | * @nlh: netlink message header | 810 | * @nlh: netlink message header |
| @@ -909,8 +1132,27 @@ static inline int nla_parse_nested(struct nlattr *tb[], int maxtype, | |||
| 909 | const struct nla_policy *policy, | 1132 | const struct nla_policy *policy, |
| 910 | struct netlink_ext_ack *extack) | 1133 | struct netlink_ext_ack *extack) |
| 911 | { | 1134 | { |
| 912 | return nla_parse(tb, maxtype, nla_data(nla), nla_len(nla), policy, | 1135 | return __nla_parse(tb, maxtype, nla_data(nla), nla_len(nla), policy, |
| 913 | extack); | 1136 | NL_VALIDATE_STRICT, extack); |
| 1137 | } | ||
| 1138 | |||
| 1139 | /** | ||
| 1140 | * nla_parse_nested_deprecated - parse nested attributes | ||
| 1141 | * @tb: destination array with maxtype+1 elements | ||
| 1142 | * @maxtype: maximum attribute type to be expected | ||
| 1143 | * @nla: attribute containing the nested attributes | ||
| 1144 | * @policy: validation policy | ||
| 1145 | * @extack: extended ACK report struct | ||
| 1146 | * | ||
| 1147 | * See nla_parse_deprecated() | ||
| 1148 | */ | ||
| 1149 | static inline int nla_parse_nested_deprecated(struct nlattr *tb[], int maxtype, | ||
| 1150 | const struct nlattr *nla, | ||
| 1151 | const struct nla_policy *policy, | ||
| 1152 | struct netlink_ext_ack *extack) | ||
| 1153 | { | ||
| 1154 | return __nla_parse(tb, maxtype, nla_data(nla), nla_len(nla), policy, | ||
| 1155 | NL_VALIDATE_LIBERAL, extack); | ||
| 914 | } | 1156 | } |
| 915 | 1157 | ||
| 916 | /** | 1158 | /** |
| @@ -1485,6 +1727,7 @@ static inline void nla_nest_cancel(struct sk_buff *skb, struct nlattr *start) | |||
| 1485 | * @start: container attribute | 1727 | * @start: container attribute |
| 1486 | * @maxtype: maximum attribute type to be expected | 1728 | * @maxtype: maximum attribute type to be expected |
| 1487 | * @policy: validation policy | 1729 | * @policy: validation policy |
| 1730 | * @validate: validation strictness | ||
| 1488 | * @extack: extended ACK report struct | 1731 | * @extack: extended ACK report struct |
| 1489 | * | 1732 | * |
| 1490 | * Validates all attributes in the nested attribute stream against the | 1733 | * Validates all attributes in the nested attribute stream against the |
| @@ -1493,12 +1736,22 @@ static inline void nla_nest_cancel(struct sk_buff *skb, struct nlattr *start) | |||
| 1493 | * | 1736 | * |
| 1494 | * Returns 0 on success or a negative error code. | 1737 | * Returns 0 on success or a negative error code. |
| 1495 | */ | 1738 | */ |
| 1496 | static inline int nla_validate_nested(const struct nlattr *start, int maxtype, | 1739 | static inline int __nla_validate_nested(const struct nlattr *start, int maxtype, |
| 1497 | const struct nla_policy *policy, | 1740 | const struct nla_policy *policy, |
| 1498 | struct netlink_ext_ack *extack) | 1741 | unsigned int validate, |
| 1742 | struct netlink_ext_ack *extack) | ||
| 1743 | { | ||
| 1744 | return __nla_validate(nla_data(start), nla_len(start), maxtype, policy, | ||
| 1745 | validate, extack); | ||
| 1746 | } | ||
| 1747 | |||
| 1748 | static inline int | ||
| 1749 | nla_validate_nested_deprecated(const struct nlattr *start, int maxtype, | ||
| 1750 | const struct nla_policy *policy, | ||
| 1751 | struct netlink_ext_ack *extack) | ||
| 1499 | { | 1752 | { |
| 1500 | return nla_validate(nla_data(start), nla_len(start), maxtype, policy, | 1753 | return __nla_validate_nested(start, maxtype, policy, |
| 1501 | extack); | 1754 | NL_VALIDATE_LIBERAL, extack); |
| 1502 | } | 1755 | } |
| 1503 | 1756 | ||
| 1504 | /** | 1757 | /** |
diff --git a/kernel/taskstats.c b/kernel/taskstats.c index ef4f9cd980fd..5f852b8f59f7 100644 --- a/kernel/taskstats.c +++ b/kernel/taskstats.c | |||
| @@ -649,12 +649,14 @@ err: | |||
| 649 | static const struct genl_ops taskstats_ops[] = { | 649 | static const struct genl_ops taskstats_ops[] = { |
| 650 | { | 650 | { |
| 651 | .cmd = TASKSTATS_CMD_GET, | 651 | .cmd = TASKSTATS_CMD_GET, |
| 652 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 652 | .doit = taskstats_user_cmd, | 653 | .doit = taskstats_user_cmd, |
| 653 | /* policy enforced later */ | 654 | /* policy enforced later */ |
| 654 | .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_HASPOL, | 655 | .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_HASPOL, |
| 655 | }, | 656 | }, |
| 656 | { | 657 | { |
| 657 | .cmd = CGROUPSTATS_CMD_GET, | 658 | .cmd = CGROUPSTATS_CMD_GET, |
| 659 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 658 | .doit = cgroupstats_user_cmd, | 660 | .doit = cgroupstats_user_cmd, |
| 659 | /* policy enforced later */ | 661 | /* policy enforced later */ |
| 660 | .flags = GENL_CMD_CAP_HASPOL, | 662 | .flags = GENL_CMD_CAP_HASPOL, |
| @@ -677,8 +679,9 @@ static int taskstats_pre_doit(const struct genl_ops *ops, struct sk_buff *skb, | |||
| 677 | return -EINVAL; | 679 | return -EINVAL; |
| 678 | } | 680 | } |
| 679 | 681 | ||
| 680 | return nlmsg_validate(info->nlhdr, GENL_HDRLEN, TASKSTATS_CMD_ATTR_MAX, | 682 | return nlmsg_validate_deprecated(info->nlhdr, GENL_HDRLEN, |
| 681 | policy, info->extack); | 683 | TASKSTATS_CMD_ATTR_MAX, policy, |
| 684 | info->extack); | ||
| 682 | } | 685 | } |
| 683 | 686 | ||
| 684 | static struct genl_family family __ro_after_init = { | 687 | static struct genl_family family __ro_after_init = { |
diff --git a/lib/nlattr.c b/lib/nlattr.c index d26de6156b97..29f6336e2422 100644 --- a/lib/nlattr.c +++ b/lib/nlattr.c | |||
| @@ -69,7 +69,8 @@ static int validate_nla_bitfield32(const struct nlattr *nla, | |||
| 69 | 69 | ||
| 70 | static int nla_validate_array(const struct nlattr *head, int len, int maxtype, | 70 | static int nla_validate_array(const struct nlattr *head, int len, int maxtype, |
| 71 | const struct nla_policy *policy, | 71 | const struct nla_policy *policy, |
| 72 | struct netlink_ext_ack *extack) | 72 | struct netlink_ext_ack *extack, |
| 73 | unsigned int validate) | ||
| 73 | { | 74 | { |
| 74 | const struct nlattr *entry; | 75 | const struct nlattr *entry; |
| 75 | int rem; | 76 | int rem; |
| @@ -86,8 +87,8 @@ static int nla_validate_array(const struct nlattr *head, int len, int maxtype, | |||
| 86 | return -ERANGE; | 87 | return -ERANGE; |
| 87 | } | 88 | } |
| 88 | 89 | ||
| 89 | ret = nla_validate(nla_data(entry), nla_len(entry), | 90 | ret = __nla_validate(nla_data(entry), nla_len(entry), |
| 90 | maxtype, policy, extack); | 91 | maxtype, policy, validate, extack); |
| 91 | if (ret < 0) | 92 | if (ret < 0) |
| 92 | return ret; | 93 | return ret; |
| 93 | } | 94 | } |
| @@ -154,13 +155,17 @@ static int nla_validate_int_range(const struct nla_policy *pt, | |||
| 154 | } | 155 | } |
| 155 | 156 | ||
| 156 | static int validate_nla(const struct nlattr *nla, int maxtype, | 157 | static int validate_nla(const struct nlattr *nla, int maxtype, |
| 157 | const struct nla_policy *policy, | 158 | const struct nla_policy *policy, unsigned int validate, |
| 158 | struct netlink_ext_ack *extack) | 159 | struct netlink_ext_ack *extack) |
| 159 | { | 160 | { |
| 161 | u16 strict_start_type = policy[0].strict_start_type; | ||
| 160 | const struct nla_policy *pt; | 162 | const struct nla_policy *pt; |
| 161 | int minlen = 0, attrlen = nla_len(nla), type = nla_type(nla); | 163 | int minlen = 0, attrlen = nla_len(nla), type = nla_type(nla); |
| 162 | int err = -ERANGE; | 164 | int err = -ERANGE; |
| 163 | 165 | ||
| 166 | if (strict_start_type && type >= strict_start_type) | ||
| 167 | validate |= NL_VALIDATE_STRICT; | ||
| 168 | |||
| 164 | if (type <= 0 || type > maxtype) | 169 | if (type <= 0 || type > maxtype) |
| 165 | return 0; | 170 | return 0; |
| 166 | 171 | ||
| @@ -172,6 +177,11 @@ static int validate_nla(const struct nlattr *nla, int maxtype, | |||
| 172 | (pt->type == NLA_EXACT_LEN_WARN && attrlen != pt->len)) { | 177 | (pt->type == NLA_EXACT_LEN_WARN && attrlen != pt->len)) { |
| 173 | pr_warn_ratelimited("netlink: '%s': attribute type %d has an invalid length.\n", | 178 | pr_warn_ratelimited("netlink: '%s': attribute type %d has an invalid length.\n", |
| 174 | current->comm, type); | 179 | current->comm, type); |
| 180 | if (validate & NL_VALIDATE_STRICT_ATTRS) { | ||
| 181 | NL_SET_ERR_MSG_ATTR(extack, nla, | ||
| 182 | "invalid attribute length"); | ||
| 183 | return -EINVAL; | ||
| 184 | } | ||
| 175 | } | 185 | } |
| 176 | 186 | ||
| 177 | switch (pt->type) { | 187 | switch (pt->type) { |
| @@ -244,8 +254,9 @@ static int validate_nla(const struct nlattr *nla, int maxtype, | |||
| 244 | if (attrlen < NLA_HDRLEN) | 254 | if (attrlen < NLA_HDRLEN) |
| 245 | goto out_err; | 255 | goto out_err; |
| 246 | if (pt->validation_data) { | 256 | if (pt->validation_data) { |
| 247 | err = nla_validate(nla_data(nla), nla_len(nla), pt->len, | 257 | err = __nla_validate(nla_data(nla), nla_len(nla), pt->len, |
| 248 | pt->validation_data, extack); | 258 | pt->validation_data, validate, |
| 259 | extack); | ||
| 249 | if (err < 0) { | 260 | if (err < 0) { |
| 250 | /* | 261 | /* |
| 251 | * return directly to preserve the inner | 262 | * return directly to preserve the inner |
| @@ -268,7 +279,7 @@ static int validate_nla(const struct nlattr *nla, int maxtype, | |||
| 268 | 279 | ||
| 269 | err = nla_validate_array(nla_data(nla), nla_len(nla), | 280 | err = nla_validate_array(nla_data(nla), nla_len(nla), |
| 270 | pt->len, pt->validation_data, | 281 | pt->len, pt->validation_data, |
| 271 | extack); | 282 | extack, validate); |
| 272 | if (err < 0) { | 283 | if (err < 0) { |
| 273 | /* | 284 | /* |
| 274 | * return directly to preserve the inner | 285 | * return directly to preserve the inner |
| @@ -278,10 +289,23 @@ static int validate_nla(const struct nlattr *nla, int maxtype, | |||
| 278 | } | 289 | } |
| 279 | } | 290 | } |
| 280 | break; | 291 | break; |
| 292 | |||
| 293 | case NLA_UNSPEC: | ||
| 294 | if (validate & NL_VALIDATE_UNSPEC) { | ||
| 295 | NL_SET_ERR_MSG_ATTR(extack, nla, | ||
| 296 | "Unsupported attribute"); | ||
| 297 | return -EINVAL; | ||
| 298 | } | ||
| 299 | /* fall through */ | ||
| 300 | case NLA_MIN_LEN: | ||
| 301 | if (attrlen < pt->len) | ||
| 302 | goto out_err; | ||
| 303 | break; | ||
| 304 | |||
| 281 | default: | 305 | default: |
| 282 | if (pt->len) | 306 | if (pt->len) |
| 283 | minlen = pt->len; | 307 | minlen = pt->len; |
| 284 | else if (pt->type != NLA_UNSPEC) | 308 | else |
| 285 | minlen = nla_attr_minlen[pt->type]; | 309 | minlen = nla_attr_minlen[pt->type]; |
| 286 | 310 | ||
| 287 | if (attrlen < minlen) | 311 | if (attrlen < minlen) |
| @@ -315,37 +339,75 @@ out_err: | |||
| 315 | return err; | 339 | return err; |
| 316 | } | 340 | } |
| 317 | 341 | ||
| 342 | static int __nla_validate_parse(const struct nlattr *head, int len, int maxtype, | ||
| 343 | const struct nla_policy *policy, | ||
| 344 | unsigned int validate, | ||
| 345 | struct netlink_ext_ack *extack, | ||
| 346 | struct nlattr **tb) | ||
| 347 | { | ||
| 348 | const struct nlattr *nla; | ||
| 349 | int rem; | ||
| 350 | |||
| 351 | if (tb) | ||
| 352 | memset(tb, 0, sizeof(struct nlattr *) * (maxtype + 1)); | ||
| 353 | |||
| 354 | nla_for_each_attr(nla, head, len, rem) { | ||
| 355 | u16 type = nla_type(nla); | ||
| 356 | |||
| 357 | if (type == 0 || type > maxtype) { | ||
| 358 | if (validate & NL_VALIDATE_MAXTYPE) { | ||
| 359 | NL_SET_ERR_MSG(extack, "Unknown attribute type"); | ||
| 360 | return -EINVAL; | ||
| 361 | } | ||
| 362 | continue; | ||
| 363 | } | ||
| 364 | if (policy) { | ||
| 365 | int err = validate_nla(nla, maxtype, policy, | ||
| 366 | validate, extack); | ||
| 367 | |||
| 368 | if (err < 0) | ||
| 369 | return err; | ||
| 370 | } | ||
| 371 | |||
| 372 | if (tb) | ||
| 373 | tb[type] = (struct nlattr *)nla; | ||
| 374 | } | ||
| 375 | |||
| 376 | if (unlikely(rem > 0)) { | ||
| 377 | pr_warn_ratelimited("netlink: %d bytes leftover after parsing attributes in process `%s'.\n", | ||
| 378 | rem, current->comm); | ||
| 379 | NL_SET_ERR_MSG(extack, "bytes leftover after parsing attributes"); | ||
| 380 | if (validate & NL_VALIDATE_TRAILING) | ||
| 381 | return -EINVAL; | ||
| 382 | } | ||
| 383 | |||
| 384 | return 0; | ||
| 385 | } | ||
| 386 | |||
| 318 | /** | 387 | /** |
| 319 | * nla_validate - Validate a stream of attributes | 388 | * __nla_validate - Validate a stream of attributes |
| 320 | * @head: head of attribute stream | 389 | * @head: head of attribute stream |
| 321 | * @len: length of attribute stream | 390 | * @len: length of attribute stream |
| 322 | * @maxtype: maximum attribute type to be expected | 391 | * @maxtype: maximum attribute type to be expected |
| 323 | * @policy: validation policy | 392 | * @policy: validation policy |
| 393 | * @validate: validation strictness | ||
| 324 | * @extack: extended ACK report struct | 394 | * @extack: extended ACK report struct |
| 325 | * | 395 | * |
| 326 | * Validates all attributes in the specified attribute stream against the | 396 | * Validates all attributes in the specified attribute stream against the |
| 327 | * specified policy. Attributes with a type exceeding maxtype will be | 397 | * specified policy. Validation depends on the validate flags passed, see |
| 328 | * ignored. See documenation of struct nla_policy for more details. | 398 | * &enum netlink_validation for more details on that. |
| 399 | * See documenation of struct nla_policy for more details. | ||
| 329 | * | 400 | * |
| 330 | * Returns 0 on success or a negative error code. | 401 | * Returns 0 on success or a negative error code. |
| 331 | */ | 402 | */ |
| 332 | int nla_validate(const struct nlattr *head, int len, int maxtype, | 403 | int __nla_validate(const struct nlattr *head, int len, int maxtype, |
| 333 | const struct nla_policy *policy, | 404 | const struct nla_policy *policy, unsigned int validate, |
| 334 | struct netlink_ext_ack *extack) | 405 | struct netlink_ext_ack *extack) |
| 335 | { | 406 | { |
| 336 | const struct nlattr *nla; | 407 | return __nla_validate_parse(head, len, maxtype, policy, validate, |
| 337 | int rem; | 408 | extack, NULL); |
| 338 | |||
| 339 | nla_for_each_attr(nla, head, len, rem) { | ||
| 340 | int err = validate_nla(nla, maxtype, policy, extack); | ||
| 341 | |||
| 342 | if (err < 0) | ||
| 343 | return err; | ||
| 344 | } | ||
| 345 | |||
| 346 | return 0; | ||
| 347 | } | 409 | } |
| 348 | EXPORT_SYMBOL(nla_validate); | 410 | EXPORT_SYMBOL(__nla_validate); |
| 349 | 411 | ||
| 350 | /** | 412 | /** |
| 351 | * nla_policy_len - Determin the max. length of a policy | 413 | * nla_policy_len - Determin the max. length of a policy |
| @@ -377,76 +439,30 @@ nla_policy_len(const struct nla_policy *p, int n) | |||
| 377 | EXPORT_SYMBOL(nla_policy_len); | 439 | EXPORT_SYMBOL(nla_policy_len); |
| 378 | 440 | ||
| 379 | /** | 441 | /** |
| 380 | * nla_parse - Parse a stream of attributes into a tb buffer | 442 | * __nla_parse - Parse a stream of attributes into a tb buffer |
| 381 | * @tb: destination array with maxtype+1 elements | 443 | * @tb: destination array with maxtype+1 elements |
| 382 | * @maxtype: maximum attribute type to be expected | 444 | * @maxtype: maximum attribute type to be expected |
| 383 | * @head: head of attribute stream | 445 | * @head: head of attribute stream |
| 384 | * @len: length of attribute stream | 446 | * @len: length of attribute stream |
| 385 | * @policy: validation policy | 447 | * @policy: validation policy |
| 448 | * @validate: validation strictness | ||
| 449 | * @extack: extended ACK pointer | ||
| 386 | * | 450 | * |
| 387 | * Parses a stream of attributes and stores a pointer to each attribute in | 451 | * Parses a stream of attributes and stores a pointer to each attribute in |
| 388 | * the tb array accessible via the attribute type. Attributes with a type | 452 | * the tb array accessible via the attribute type. |
| 389 | * exceeding maxtype will be silently ignored for backwards compatibility | 453 | * Validation is controlled by the @validate parameter. |
| 390 | * reasons. policy may be set to NULL if no validation is required. | ||
| 391 | * | 454 | * |
| 392 | * Returns 0 on success or a negative error code. | 455 | * Returns 0 on success or a negative error code. |
| 393 | */ | 456 | */ |
| 394 | static int __nla_parse(struct nlattr **tb, int maxtype, | 457 | int __nla_parse(struct nlattr **tb, int maxtype, |
| 395 | const struct nlattr *head, int len, | 458 | const struct nlattr *head, int len, |
| 396 | bool strict, const struct nla_policy *policy, | 459 | const struct nla_policy *policy, unsigned int validate, |
| 397 | struct netlink_ext_ack *extack) | 460 | struct netlink_ext_ack *extack) |
| 398 | { | ||
| 399 | const struct nlattr *nla; | ||
| 400 | int rem; | ||
| 401 | |||
| 402 | memset(tb, 0, sizeof(struct nlattr *) * (maxtype + 1)); | ||
| 403 | |||
| 404 | nla_for_each_attr(nla, head, len, rem) { | ||
| 405 | u16 type = nla_type(nla); | ||
| 406 | |||
| 407 | if (type == 0 || type > maxtype) { | ||
| 408 | if (strict) { | ||
| 409 | NL_SET_ERR_MSG(extack, "Unknown attribute type"); | ||
| 410 | return -EINVAL; | ||
| 411 | } | ||
| 412 | continue; | ||
| 413 | } | ||
| 414 | if (policy) { | ||
| 415 | int err = validate_nla(nla, maxtype, policy, extack); | ||
| 416 | |||
| 417 | if (err < 0) | ||
| 418 | return err; | ||
| 419 | } | ||
| 420 | |||
| 421 | tb[type] = (struct nlattr *)nla; | ||
| 422 | } | ||
| 423 | |||
| 424 | if (unlikely(rem > 0)) { | ||
| 425 | pr_warn_ratelimited("netlink: %d bytes leftover after parsing attributes in process `%s'.\n", | ||
| 426 | rem, current->comm); | ||
| 427 | NL_SET_ERR_MSG(extack, "bytes leftover after parsing attributes"); | ||
| 428 | if (strict) | ||
| 429 | return -EINVAL; | ||
| 430 | } | ||
| 431 | |||
| 432 | return 0; | ||
| 433 | } | ||
| 434 | |||
| 435 | int nla_parse(struct nlattr **tb, int maxtype, const struct nlattr *head, | ||
| 436 | int len, const struct nla_policy *policy, | ||
| 437 | struct netlink_ext_ack *extack) | ||
| 438 | { | ||
| 439 | return __nla_parse(tb, maxtype, head, len, false, policy, extack); | ||
| 440 | } | ||
| 441 | EXPORT_SYMBOL(nla_parse); | ||
| 442 | |||
| 443 | int nla_parse_strict(struct nlattr **tb, int maxtype, const struct nlattr *head, | ||
| 444 | int len, const struct nla_policy *policy, | ||
| 445 | struct netlink_ext_ack *extack) | ||
| 446 | { | 461 | { |
| 447 | return __nla_parse(tb, maxtype, head, len, true, policy, extack); | 462 | return __nla_validate_parse(head, len, maxtype, policy, validate, |
| 463 | extack, tb); | ||
| 448 | } | 464 | } |
| 449 | EXPORT_SYMBOL(nla_parse_strict); | 465 | EXPORT_SYMBOL(__nla_parse); |
| 450 | 466 | ||
| 451 | /** | 467 | /** |
| 452 | * nla_find - Find a specific attribute in a stream of attributes | 468 | * nla_find - Find a specific attribute in a stream of attributes |
diff --git a/net/8021q/vlan_netlink.c b/net/8021q/vlan_netlink.c index ab4921e7797b..24eebbc92364 100644 --- a/net/8021q/vlan_netlink.c +++ b/net/8021q/vlan_netlink.c | |||
| @@ -35,8 +35,8 @@ static inline int vlan_validate_qos_map(struct nlattr *attr) | |||
| 35 | { | 35 | { |
| 36 | if (!attr) | 36 | if (!attr) |
| 37 | return 0; | 37 | return 0; |
| 38 | return nla_validate_nested(attr, IFLA_VLAN_QOS_MAX, vlan_map_policy, | 38 | return nla_validate_nested_deprecated(attr, IFLA_VLAN_QOS_MAX, |
| 39 | NULL); | 39 | vlan_map_policy, NULL); |
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | static int vlan_validate(struct nlattr *tb[], struct nlattr *data[], | 42 | static int vlan_validate(struct nlattr *tb[], struct nlattr *data[], |
diff --git a/net/batman-adv/netlink.c b/net/batman-adv/netlink.c index e7907308b331..a67720fad46c 100644 --- a/net/batman-adv/netlink.c +++ b/net/batman-adv/netlink.c | |||
| @@ -1343,29 +1343,34 @@ static void batadv_post_doit(const struct genl_ops *ops, struct sk_buff *skb, | |||
| 1343 | static const struct genl_ops batadv_netlink_ops[] = { | 1343 | static const struct genl_ops batadv_netlink_ops[] = { |
| 1344 | { | 1344 | { |
| 1345 | .cmd = BATADV_CMD_GET_MESH, | 1345 | .cmd = BATADV_CMD_GET_MESH, |
| 1346 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1346 | /* can be retrieved by unprivileged users */ | 1347 | /* can be retrieved by unprivileged users */ |
| 1347 | .doit = batadv_netlink_get_mesh, | 1348 | .doit = batadv_netlink_get_mesh, |
| 1348 | .internal_flags = BATADV_FLAG_NEED_MESH, | 1349 | .internal_flags = BATADV_FLAG_NEED_MESH, |
| 1349 | }, | 1350 | }, |
| 1350 | { | 1351 | { |
| 1351 | .cmd = BATADV_CMD_TP_METER, | 1352 | .cmd = BATADV_CMD_TP_METER, |
| 1353 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1352 | .flags = GENL_ADMIN_PERM, | 1354 | .flags = GENL_ADMIN_PERM, |
| 1353 | .doit = batadv_netlink_tp_meter_start, | 1355 | .doit = batadv_netlink_tp_meter_start, |
| 1354 | .internal_flags = BATADV_FLAG_NEED_MESH, | 1356 | .internal_flags = BATADV_FLAG_NEED_MESH, |
| 1355 | }, | 1357 | }, |
| 1356 | { | 1358 | { |
| 1357 | .cmd = BATADV_CMD_TP_METER_CANCEL, | 1359 | .cmd = BATADV_CMD_TP_METER_CANCEL, |
| 1360 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1358 | .flags = GENL_ADMIN_PERM, | 1361 | .flags = GENL_ADMIN_PERM, |
| 1359 | .doit = batadv_netlink_tp_meter_cancel, | 1362 | .doit = batadv_netlink_tp_meter_cancel, |
| 1360 | .internal_flags = BATADV_FLAG_NEED_MESH, | 1363 | .internal_flags = BATADV_FLAG_NEED_MESH, |
| 1361 | }, | 1364 | }, |
| 1362 | { | 1365 | { |
| 1363 | .cmd = BATADV_CMD_GET_ROUTING_ALGOS, | 1366 | .cmd = BATADV_CMD_GET_ROUTING_ALGOS, |
| 1367 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1364 | .flags = GENL_ADMIN_PERM, | 1368 | .flags = GENL_ADMIN_PERM, |
| 1365 | .dumpit = batadv_algo_dump, | 1369 | .dumpit = batadv_algo_dump, |
| 1366 | }, | 1370 | }, |
| 1367 | { | 1371 | { |
| 1368 | .cmd = BATADV_CMD_GET_HARDIF, | 1372 | .cmd = BATADV_CMD_GET_HARDIF, |
| 1373 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1369 | /* can be retrieved by unprivileged users */ | 1374 | /* can be retrieved by unprivileged users */ |
| 1370 | .dumpit = batadv_netlink_dump_hardif, | 1375 | .dumpit = batadv_netlink_dump_hardif, |
| 1371 | .doit = batadv_netlink_get_hardif, | 1376 | .doit = batadv_netlink_get_hardif, |
| @@ -1374,57 +1379,68 @@ static const struct genl_ops batadv_netlink_ops[] = { | |||
| 1374 | }, | 1379 | }, |
| 1375 | { | 1380 | { |
| 1376 | .cmd = BATADV_CMD_GET_TRANSTABLE_LOCAL, | 1381 | .cmd = BATADV_CMD_GET_TRANSTABLE_LOCAL, |
| 1382 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1377 | .flags = GENL_ADMIN_PERM, | 1383 | .flags = GENL_ADMIN_PERM, |
| 1378 | .dumpit = batadv_tt_local_dump, | 1384 | .dumpit = batadv_tt_local_dump, |
| 1379 | }, | 1385 | }, |
| 1380 | { | 1386 | { |
| 1381 | .cmd = BATADV_CMD_GET_TRANSTABLE_GLOBAL, | 1387 | .cmd = BATADV_CMD_GET_TRANSTABLE_GLOBAL, |
| 1388 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1382 | .flags = GENL_ADMIN_PERM, | 1389 | .flags = GENL_ADMIN_PERM, |
| 1383 | .dumpit = batadv_tt_global_dump, | 1390 | .dumpit = batadv_tt_global_dump, |
| 1384 | }, | 1391 | }, |
| 1385 | { | 1392 | { |
| 1386 | .cmd = BATADV_CMD_GET_ORIGINATORS, | 1393 | .cmd = BATADV_CMD_GET_ORIGINATORS, |
| 1394 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1387 | .flags = GENL_ADMIN_PERM, | 1395 | .flags = GENL_ADMIN_PERM, |
| 1388 | .dumpit = batadv_orig_dump, | 1396 | .dumpit = batadv_orig_dump, |
| 1389 | }, | 1397 | }, |
| 1390 | { | 1398 | { |
| 1391 | .cmd = BATADV_CMD_GET_NEIGHBORS, | 1399 | .cmd = BATADV_CMD_GET_NEIGHBORS, |
| 1400 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1392 | .flags = GENL_ADMIN_PERM, | 1401 | .flags = GENL_ADMIN_PERM, |
| 1393 | .dumpit = batadv_hardif_neigh_dump, | 1402 | .dumpit = batadv_hardif_neigh_dump, |
| 1394 | }, | 1403 | }, |
| 1395 | { | 1404 | { |
| 1396 | .cmd = BATADV_CMD_GET_GATEWAYS, | 1405 | .cmd = BATADV_CMD_GET_GATEWAYS, |
| 1406 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1397 | .flags = GENL_ADMIN_PERM, | 1407 | .flags = GENL_ADMIN_PERM, |
| 1398 | .dumpit = batadv_gw_dump, | 1408 | .dumpit = batadv_gw_dump, |
| 1399 | }, | 1409 | }, |
| 1400 | { | 1410 | { |
| 1401 | .cmd = BATADV_CMD_GET_BLA_CLAIM, | 1411 | .cmd = BATADV_CMD_GET_BLA_CLAIM, |
| 1412 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1402 | .flags = GENL_ADMIN_PERM, | 1413 | .flags = GENL_ADMIN_PERM, |
| 1403 | .dumpit = batadv_bla_claim_dump, | 1414 | .dumpit = batadv_bla_claim_dump, |
| 1404 | }, | 1415 | }, |
| 1405 | { | 1416 | { |
| 1406 | .cmd = BATADV_CMD_GET_BLA_BACKBONE, | 1417 | .cmd = BATADV_CMD_GET_BLA_BACKBONE, |
| 1418 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1407 | .flags = GENL_ADMIN_PERM, | 1419 | .flags = GENL_ADMIN_PERM, |
| 1408 | .dumpit = batadv_bla_backbone_dump, | 1420 | .dumpit = batadv_bla_backbone_dump, |
| 1409 | }, | 1421 | }, |
| 1410 | { | 1422 | { |
| 1411 | .cmd = BATADV_CMD_GET_DAT_CACHE, | 1423 | .cmd = BATADV_CMD_GET_DAT_CACHE, |
| 1424 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1412 | .flags = GENL_ADMIN_PERM, | 1425 | .flags = GENL_ADMIN_PERM, |
| 1413 | .dumpit = batadv_dat_cache_dump, | 1426 | .dumpit = batadv_dat_cache_dump, |
| 1414 | }, | 1427 | }, |
| 1415 | { | 1428 | { |
| 1416 | .cmd = BATADV_CMD_GET_MCAST_FLAGS, | 1429 | .cmd = BATADV_CMD_GET_MCAST_FLAGS, |
| 1430 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1417 | .flags = GENL_ADMIN_PERM, | 1431 | .flags = GENL_ADMIN_PERM, |
| 1418 | .dumpit = batadv_mcast_flags_dump, | 1432 | .dumpit = batadv_mcast_flags_dump, |
| 1419 | }, | 1433 | }, |
| 1420 | { | 1434 | { |
| 1421 | .cmd = BATADV_CMD_SET_MESH, | 1435 | .cmd = BATADV_CMD_SET_MESH, |
| 1436 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1422 | .flags = GENL_ADMIN_PERM, | 1437 | .flags = GENL_ADMIN_PERM, |
| 1423 | .doit = batadv_netlink_set_mesh, | 1438 | .doit = batadv_netlink_set_mesh, |
| 1424 | .internal_flags = BATADV_FLAG_NEED_MESH, | 1439 | .internal_flags = BATADV_FLAG_NEED_MESH, |
| 1425 | }, | 1440 | }, |
| 1426 | { | 1441 | { |
| 1427 | .cmd = BATADV_CMD_SET_HARDIF, | 1442 | .cmd = BATADV_CMD_SET_HARDIF, |
| 1443 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1428 | .flags = GENL_ADMIN_PERM, | 1444 | .flags = GENL_ADMIN_PERM, |
| 1429 | .doit = batadv_netlink_set_hardif, | 1445 | .doit = batadv_netlink_set_hardif, |
| 1430 | .internal_flags = BATADV_FLAG_NEED_MESH | | 1446 | .internal_flags = BATADV_FLAG_NEED_MESH | |
| @@ -1432,6 +1448,7 @@ static const struct genl_ops batadv_netlink_ops[] = { | |||
| 1432 | }, | 1448 | }, |
| 1433 | { | 1449 | { |
| 1434 | .cmd = BATADV_CMD_GET_VLAN, | 1450 | .cmd = BATADV_CMD_GET_VLAN, |
| 1451 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1435 | /* can be retrieved by unprivileged users */ | 1452 | /* can be retrieved by unprivileged users */ |
| 1436 | .doit = batadv_netlink_get_vlan, | 1453 | .doit = batadv_netlink_get_vlan, |
| 1437 | .internal_flags = BATADV_FLAG_NEED_MESH | | 1454 | .internal_flags = BATADV_FLAG_NEED_MESH | |
| @@ -1439,6 +1456,7 @@ static const struct genl_ops batadv_netlink_ops[] = { | |||
| 1439 | }, | 1456 | }, |
| 1440 | { | 1457 | { |
| 1441 | .cmd = BATADV_CMD_SET_VLAN, | 1458 | .cmd = BATADV_CMD_SET_VLAN, |
| 1459 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1442 | .flags = GENL_ADMIN_PERM, | 1460 | .flags = GENL_ADMIN_PERM, |
| 1443 | .doit = batadv_netlink_set_vlan, | 1461 | .doit = batadv_netlink_set_vlan, |
| 1444 | .internal_flags = BATADV_FLAG_NEED_MESH | | 1462 | .internal_flags = BATADV_FLAG_NEED_MESH | |
diff --git a/net/bridge/br_mdb.c b/net/bridge/br_mdb.c index 3619c1a12a77..bf6acd34234d 100644 --- a/net/bridge/br_mdb.c +++ b/net/bridge/br_mdb.c | |||
| @@ -530,8 +530,8 @@ static int br_mdb_parse(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 530 | struct net_device *dev; | 530 | struct net_device *dev; |
| 531 | int err; | 531 | int err; |
| 532 | 532 | ||
| 533 | err = nlmsg_parse(nlh, sizeof(*bpm), tb, MDBA_SET_ENTRY_MAX, NULL, | 533 | err = nlmsg_parse_deprecated(nlh, sizeof(*bpm), tb, |
| 534 | NULL); | 534 | MDBA_SET_ENTRY_MAX, NULL, NULL); |
| 535 | if (err < 0) | 535 | if (err < 0) |
| 536 | return err; | 536 | return err; |
| 537 | 537 | ||
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c index 348ddb6d09bb..a5acad29cd4f 100644 --- a/net/bridge/br_netlink.c +++ b/net/bridge/br_netlink.c | |||
| @@ -880,8 +880,10 @@ int br_setlink(struct net_device *dev, struct nlmsghdr *nlh, u16 flags, | |||
| 880 | 880 | ||
| 881 | if (p && protinfo) { | 881 | if (p && protinfo) { |
| 882 | if (protinfo->nla_type & NLA_F_NESTED) { | 882 | if (protinfo->nla_type & NLA_F_NESTED) { |
| 883 | err = nla_parse_nested(tb, IFLA_BRPORT_MAX, protinfo, | 883 | err = nla_parse_nested_deprecated(tb, IFLA_BRPORT_MAX, |
| 884 | br_port_policy, NULL); | 884 | protinfo, |
| 885 | br_port_policy, | ||
| 886 | NULL); | ||
| 885 | if (err) | 887 | if (err) |
| 886 | return err; | 888 | return err; |
| 887 | 889 | ||
diff --git a/net/bridge/br_netlink_tunnel.c b/net/bridge/br_netlink_tunnel.c index 787e140dc4b5..34629d558709 100644 --- a/net/bridge/br_netlink_tunnel.c +++ b/net/bridge/br_netlink_tunnel.c | |||
| @@ -230,8 +230,8 @@ int br_parse_vlan_tunnel_info(struct nlattr *attr, | |||
| 230 | 230 | ||
| 231 | memset(tinfo, 0, sizeof(*tinfo)); | 231 | memset(tinfo, 0, sizeof(*tinfo)); |
| 232 | 232 | ||
| 233 | err = nla_parse_nested(tb, IFLA_BRIDGE_VLAN_TUNNEL_MAX, attr, | 233 | err = nla_parse_nested_deprecated(tb, IFLA_BRIDGE_VLAN_TUNNEL_MAX, |
| 234 | vlan_tunnel_policy, NULL); | 234 | attr, vlan_tunnel_policy, NULL); |
| 235 | if (err < 0) | 235 | if (err < 0) |
| 236 | return err; | 236 | return err; |
| 237 | 237 | ||
diff --git a/net/can/gw.c b/net/can/gw.c index 53859346dc9a..5275ddf580bc 100644 --- a/net/can/gw.c +++ b/net/can/gw.c | |||
| @@ -662,8 +662,8 @@ static int cgw_parse_attr(struct nlmsghdr *nlh, struct cf_mod *mod, | |||
| 662 | /* initialize modification & checksum data space */ | 662 | /* initialize modification & checksum data space */ |
| 663 | memset(mod, 0, sizeof(*mod)); | 663 | memset(mod, 0, sizeof(*mod)); |
| 664 | 664 | ||
| 665 | err = nlmsg_parse(nlh, sizeof(struct rtcanmsg), tb, CGW_MAX, | 665 | err = nlmsg_parse_deprecated(nlh, sizeof(struct rtcanmsg), tb, |
| 666 | cgw_policy, NULL); | 666 | CGW_MAX, cgw_policy, NULL); |
| 667 | if (err < 0) | 667 | if (err < 0) |
| 668 | return err; | 668 | return err; |
| 669 | 669 | ||
diff --git a/net/core/devlink.c b/net/core/devlink.c index b94f326f5f06..4e28d04c0165 100644 --- a/net/core/devlink.c +++ b/net/core/devlink.c | |||
| @@ -3674,9 +3674,10 @@ static int devlink_nl_cmd_region_read_dumpit(struct sk_buff *skb, | |||
| 3674 | if (!attrs) | 3674 | if (!attrs) |
| 3675 | return -ENOMEM; | 3675 | return -ENOMEM; |
| 3676 | 3676 | ||
| 3677 | err = nlmsg_parse(cb->nlh, GENL_HDRLEN + devlink_nl_family.hdrsize, | 3677 | err = nlmsg_parse_deprecated(cb->nlh, |
| 3678 | attrs, DEVLINK_ATTR_MAX, devlink_nl_family.policy, | 3678 | GENL_HDRLEN + devlink_nl_family.hdrsize, |
| 3679 | cb->extack); | 3679 | attrs, DEVLINK_ATTR_MAX, |
| 3680 | devlink_nl_family.policy, cb->extack); | ||
| 3680 | if (err) | 3681 | if (err) |
| 3681 | goto out_free; | 3682 | goto out_free; |
| 3682 | 3683 | ||
| @@ -4947,6 +4948,7 @@ static const struct nla_policy devlink_nl_policy[DEVLINK_ATTR_MAX + 1] = { | |||
| 4947 | static const struct genl_ops devlink_nl_ops[] = { | 4948 | static const struct genl_ops devlink_nl_ops[] = { |
| 4948 | { | 4949 | { |
| 4949 | .cmd = DEVLINK_CMD_GET, | 4950 | .cmd = DEVLINK_CMD_GET, |
| 4951 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 4950 | .doit = devlink_nl_cmd_get_doit, | 4952 | .doit = devlink_nl_cmd_get_doit, |
| 4951 | .dumpit = devlink_nl_cmd_get_dumpit, | 4953 | .dumpit = devlink_nl_cmd_get_dumpit, |
| 4952 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, | 4954 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, |
| @@ -4954,6 +4956,7 @@ static const struct genl_ops devlink_nl_ops[] = { | |||
| 4954 | }, | 4956 | }, |
| 4955 | { | 4957 | { |
| 4956 | .cmd = DEVLINK_CMD_PORT_GET, | 4958 | .cmd = DEVLINK_CMD_PORT_GET, |
| 4959 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 4957 | .doit = devlink_nl_cmd_port_get_doit, | 4960 | .doit = devlink_nl_cmd_port_get_doit, |
| 4958 | .dumpit = devlink_nl_cmd_port_get_dumpit, | 4961 | .dumpit = devlink_nl_cmd_port_get_dumpit, |
| 4959 | .internal_flags = DEVLINK_NL_FLAG_NEED_PORT, | 4962 | .internal_flags = DEVLINK_NL_FLAG_NEED_PORT, |
| @@ -4961,12 +4964,14 @@ static const struct genl_ops devlink_nl_ops[] = { | |||
| 4961 | }, | 4964 | }, |
| 4962 | { | 4965 | { |
| 4963 | .cmd = DEVLINK_CMD_PORT_SET, | 4966 | .cmd = DEVLINK_CMD_PORT_SET, |
| 4967 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 4964 | .doit = devlink_nl_cmd_port_set_doit, | 4968 | .doit = devlink_nl_cmd_port_set_doit, |
| 4965 | .flags = GENL_ADMIN_PERM, | 4969 | .flags = GENL_ADMIN_PERM, |
| 4966 | .internal_flags = DEVLINK_NL_FLAG_NEED_PORT, | 4970 | .internal_flags = DEVLINK_NL_FLAG_NEED_PORT, |
| 4967 | }, | 4971 | }, |
| 4968 | { | 4972 | { |
| 4969 | .cmd = DEVLINK_CMD_PORT_SPLIT, | 4973 | .cmd = DEVLINK_CMD_PORT_SPLIT, |
| 4974 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 4970 | .doit = devlink_nl_cmd_port_split_doit, | 4975 | .doit = devlink_nl_cmd_port_split_doit, |
| 4971 | .flags = GENL_ADMIN_PERM, | 4976 | .flags = GENL_ADMIN_PERM, |
| 4972 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK | | 4977 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK | |
| @@ -4974,6 +4979,7 @@ static const struct genl_ops devlink_nl_ops[] = { | |||
| 4974 | }, | 4979 | }, |
| 4975 | { | 4980 | { |
| 4976 | .cmd = DEVLINK_CMD_PORT_UNSPLIT, | 4981 | .cmd = DEVLINK_CMD_PORT_UNSPLIT, |
| 4982 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 4977 | .doit = devlink_nl_cmd_port_unsplit_doit, | 4983 | .doit = devlink_nl_cmd_port_unsplit_doit, |
| 4978 | .flags = GENL_ADMIN_PERM, | 4984 | .flags = GENL_ADMIN_PERM, |
| 4979 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK | | 4985 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK | |
| @@ -4981,6 +4987,7 @@ static const struct genl_ops devlink_nl_ops[] = { | |||
| 4981 | }, | 4987 | }, |
| 4982 | { | 4988 | { |
| 4983 | .cmd = DEVLINK_CMD_SB_GET, | 4989 | .cmd = DEVLINK_CMD_SB_GET, |
| 4990 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 4984 | .doit = devlink_nl_cmd_sb_get_doit, | 4991 | .doit = devlink_nl_cmd_sb_get_doit, |
| 4985 | .dumpit = devlink_nl_cmd_sb_get_dumpit, | 4992 | .dumpit = devlink_nl_cmd_sb_get_dumpit, |
| 4986 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK | | 4993 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK | |
| @@ -4989,6 +4996,7 @@ static const struct genl_ops devlink_nl_ops[] = { | |||
| 4989 | }, | 4996 | }, |
| 4990 | { | 4997 | { |
| 4991 | .cmd = DEVLINK_CMD_SB_POOL_GET, | 4998 | .cmd = DEVLINK_CMD_SB_POOL_GET, |
| 4999 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 4992 | .doit = devlink_nl_cmd_sb_pool_get_doit, | 5000 | .doit = devlink_nl_cmd_sb_pool_get_doit, |
| 4993 | .dumpit = devlink_nl_cmd_sb_pool_get_dumpit, | 5001 | .dumpit = devlink_nl_cmd_sb_pool_get_dumpit, |
| 4994 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK | | 5002 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK | |
| @@ -4997,6 +5005,7 @@ static const struct genl_ops devlink_nl_ops[] = { | |||
| 4997 | }, | 5005 | }, |
| 4998 | { | 5006 | { |
| 4999 | .cmd = DEVLINK_CMD_SB_POOL_SET, | 5007 | .cmd = DEVLINK_CMD_SB_POOL_SET, |
| 5008 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 5000 | .doit = devlink_nl_cmd_sb_pool_set_doit, | 5009 | .doit = devlink_nl_cmd_sb_pool_set_doit, |
| 5001 | .flags = GENL_ADMIN_PERM, | 5010 | .flags = GENL_ADMIN_PERM, |
| 5002 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK | | 5011 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK | |
| @@ -5004,6 +5013,7 @@ static const struct genl_ops devlink_nl_ops[] = { | |||
| 5004 | }, | 5013 | }, |
| 5005 | { | 5014 | { |
| 5006 | .cmd = DEVLINK_CMD_SB_PORT_POOL_GET, | 5015 | .cmd = DEVLINK_CMD_SB_PORT_POOL_GET, |
| 5016 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 5007 | .doit = devlink_nl_cmd_sb_port_pool_get_doit, | 5017 | .doit = devlink_nl_cmd_sb_port_pool_get_doit, |
| 5008 | .dumpit = devlink_nl_cmd_sb_port_pool_get_dumpit, | 5018 | .dumpit = devlink_nl_cmd_sb_port_pool_get_dumpit, |
| 5009 | .internal_flags = DEVLINK_NL_FLAG_NEED_PORT | | 5019 | .internal_flags = DEVLINK_NL_FLAG_NEED_PORT | |
| @@ -5012,6 +5022,7 @@ static const struct genl_ops devlink_nl_ops[] = { | |||
| 5012 | }, | 5022 | }, |
| 5013 | { | 5023 | { |
| 5014 | .cmd = DEVLINK_CMD_SB_PORT_POOL_SET, | 5024 | .cmd = DEVLINK_CMD_SB_PORT_POOL_SET, |
| 5025 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 5015 | .doit = devlink_nl_cmd_sb_port_pool_set_doit, | 5026 | .doit = devlink_nl_cmd_sb_port_pool_set_doit, |
| 5016 | .flags = GENL_ADMIN_PERM, | 5027 | .flags = GENL_ADMIN_PERM, |
| 5017 | .internal_flags = DEVLINK_NL_FLAG_NEED_PORT | | 5028 | .internal_flags = DEVLINK_NL_FLAG_NEED_PORT | |
| @@ -5019,6 +5030,7 @@ static const struct genl_ops devlink_nl_ops[] = { | |||
| 5019 | }, | 5030 | }, |
| 5020 | { | 5031 | { |
| 5021 | .cmd = DEVLINK_CMD_SB_TC_POOL_BIND_GET, | 5032 | .cmd = DEVLINK_CMD_SB_TC_POOL_BIND_GET, |
| 5033 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 5022 | .doit = devlink_nl_cmd_sb_tc_pool_bind_get_doit, | 5034 | .doit = devlink_nl_cmd_sb_tc_pool_bind_get_doit, |
| 5023 | .dumpit = devlink_nl_cmd_sb_tc_pool_bind_get_dumpit, | 5035 | .dumpit = devlink_nl_cmd_sb_tc_pool_bind_get_dumpit, |
| 5024 | .internal_flags = DEVLINK_NL_FLAG_NEED_PORT | | 5036 | .internal_flags = DEVLINK_NL_FLAG_NEED_PORT | |
| @@ -5027,6 +5039,7 @@ static const struct genl_ops devlink_nl_ops[] = { | |||
| 5027 | }, | 5039 | }, |
| 5028 | { | 5040 | { |
| 5029 | .cmd = DEVLINK_CMD_SB_TC_POOL_BIND_SET, | 5041 | .cmd = DEVLINK_CMD_SB_TC_POOL_BIND_SET, |
| 5042 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 5030 | .doit = devlink_nl_cmd_sb_tc_pool_bind_set_doit, | 5043 | .doit = devlink_nl_cmd_sb_tc_pool_bind_set_doit, |
| 5031 | .flags = GENL_ADMIN_PERM, | 5044 | .flags = GENL_ADMIN_PERM, |
| 5032 | .internal_flags = DEVLINK_NL_FLAG_NEED_PORT | | 5045 | .internal_flags = DEVLINK_NL_FLAG_NEED_PORT | |
| @@ -5034,6 +5047,7 @@ static const struct genl_ops devlink_nl_ops[] = { | |||
| 5034 | }, | 5047 | }, |
| 5035 | { | 5048 | { |
| 5036 | .cmd = DEVLINK_CMD_SB_OCC_SNAPSHOT, | 5049 | .cmd = DEVLINK_CMD_SB_OCC_SNAPSHOT, |
| 5050 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 5037 | .doit = devlink_nl_cmd_sb_occ_snapshot_doit, | 5051 | .doit = devlink_nl_cmd_sb_occ_snapshot_doit, |
| 5038 | .flags = GENL_ADMIN_PERM, | 5052 | .flags = GENL_ADMIN_PERM, |
| 5039 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK | | 5053 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK | |
| @@ -5041,6 +5055,7 @@ static const struct genl_ops devlink_nl_ops[] = { | |||
| 5041 | }, | 5055 | }, |
| 5042 | { | 5056 | { |
| 5043 | .cmd = DEVLINK_CMD_SB_OCC_MAX_CLEAR, | 5057 | .cmd = DEVLINK_CMD_SB_OCC_MAX_CLEAR, |
| 5058 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 5044 | .doit = devlink_nl_cmd_sb_occ_max_clear_doit, | 5059 | .doit = devlink_nl_cmd_sb_occ_max_clear_doit, |
| 5045 | .flags = GENL_ADMIN_PERM, | 5060 | .flags = GENL_ADMIN_PERM, |
| 5046 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK | | 5061 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK | |
| @@ -5048,12 +5063,14 @@ static const struct genl_ops devlink_nl_ops[] = { | |||
| 5048 | }, | 5063 | }, |
| 5049 | { | 5064 | { |
| 5050 | .cmd = DEVLINK_CMD_ESWITCH_GET, | 5065 | .cmd = DEVLINK_CMD_ESWITCH_GET, |
| 5066 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 5051 | .doit = devlink_nl_cmd_eswitch_get_doit, | 5067 | .doit = devlink_nl_cmd_eswitch_get_doit, |
| 5052 | .flags = GENL_ADMIN_PERM, | 5068 | .flags = GENL_ADMIN_PERM, |
| 5053 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, | 5069 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, |
| 5054 | }, | 5070 | }, |
| 5055 | { | 5071 | { |
| 5056 | .cmd = DEVLINK_CMD_ESWITCH_SET, | 5072 | .cmd = DEVLINK_CMD_ESWITCH_SET, |
| 5073 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 5057 | .doit = devlink_nl_cmd_eswitch_set_doit, | 5074 | .doit = devlink_nl_cmd_eswitch_set_doit, |
| 5058 | .flags = GENL_ADMIN_PERM, | 5075 | .flags = GENL_ADMIN_PERM, |
| 5059 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK | | 5076 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK | |
| @@ -5061,42 +5078,49 @@ static const struct genl_ops devlink_nl_ops[] = { | |||
| 5061 | }, | 5078 | }, |
| 5062 | { | 5079 | { |
| 5063 | .cmd = DEVLINK_CMD_DPIPE_TABLE_GET, | 5080 | .cmd = DEVLINK_CMD_DPIPE_TABLE_GET, |
| 5081 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 5064 | .doit = devlink_nl_cmd_dpipe_table_get, | 5082 | .doit = devlink_nl_cmd_dpipe_table_get, |
| 5065 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, | 5083 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, |
| 5066 | /* can be retrieved by unprivileged users */ | 5084 | /* can be retrieved by unprivileged users */ |
| 5067 | }, | 5085 | }, |
| 5068 | { | 5086 | { |
| 5069 | .cmd = DEVLINK_CMD_DPIPE_ENTRIES_GET, | 5087 | .cmd = DEVLINK_CMD_DPIPE_ENTRIES_GET, |
| 5088 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 5070 | .doit = devlink_nl_cmd_dpipe_entries_get, | 5089 | .doit = devlink_nl_cmd_dpipe_entries_get, |
| 5071 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, | 5090 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, |
| 5072 | /* can be retrieved by unprivileged users */ | 5091 | /* can be retrieved by unprivileged users */ |
| 5073 | }, | 5092 | }, |
| 5074 | { | 5093 | { |
| 5075 | .cmd = DEVLINK_CMD_DPIPE_HEADERS_GET, | 5094 | .cmd = DEVLINK_CMD_DPIPE_HEADERS_GET, |
| 5095 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 5076 | .doit = devlink_nl_cmd_dpipe_headers_get, | 5096 | .doit = devlink_nl_cmd_dpipe_headers_get, |
| 5077 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, | 5097 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, |
| 5078 | /* can be retrieved by unprivileged users */ | 5098 | /* can be retrieved by unprivileged users */ |
| 5079 | }, | 5099 | }, |
| 5080 | { | 5100 | { |
| 5081 | .cmd = DEVLINK_CMD_DPIPE_TABLE_COUNTERS_SET, | 5101 | .cmd = DEVLINK_CMD_DPIPE_TABLE_COUNTERS_SET, |
| 5102 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 5082 | .doit = devlink_nl_cmd_dpipe_table_counters_set, | 5103 | .doit = devlink_nl_cmd_dpipe_table_counters_set, |
| 5083 | .flags = GENL_ADMIN_PERM, | 5104 | .flags = GENL_ADMIN_PERM, |
| 5084 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, | 5105 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, |
| 5085 | }, | 5106 | }, |
| 5086 | { | 5107 | { |
| 5087 | .cmd = DEVLINK_CMD_RESOURCE_SET, | 5108 | .cmd = DEVLINK_CMD_RESOURCE_SET, |
| 5109 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 5088 | .doit = devlink_nl_cmd_resource_set, | 5110 | .doit = devlink_nl_cmd_resource_set, |
| 5089 | .flags = GENL_ADMIN_PERM, | 5111 | .flags = GENL_ADMIN_PERM, |
| 5090 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, | 5112 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, |
| 5091 | }, | 5113 | }, |
| 5092 | { | 5114 | { |
| 5093 | .cmd = DEVLINK_CMD_RESOURCE_DUMP, | 5115 | .cmd = DEVLINK_CMD_RESOURCE_DUMP, |
| 5116 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 5094 | .doit = devlink_nl_cmd_resource_dump, | 5117 | .doit = devlink_nl_cmd_resource_dump, |
| 5095 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, | 5118 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, |
| 5096 | /* can be retrieved by unprivileged users */ | 5119 | /* can be retrieved by unprivileged users */ |
| 5097 | }, | 5120 | }, |
| 5098 | { | 5121 | { |
| 5099 | .cmd = DEVLINK_CMD_RELOAD, | 5122 | .cmd = DEVLINK_CMD_RELOAD, |
| 5123 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 5100 | .doit = devlink_nl_cmd_reload, | 5124 | .doit = devlink_nl_cmd_reload, |
| 5101 | .flags = GENL_ADMIN_PERM, | 5125 | .flags = GENL_ADMIN_PERM, |
| 5102 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK | | 5126 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK | |
| @@ -5104,6 +5128,7 @@ static const struct genl_ops devlink_nl_ops[] = { | |||
| 5104 | }, | 5128 | }, |
| 5105 | { | 5129 | { |
| 5106 | .cmd = DEVLINK_CMD_PARAM_GET, | 5130 | .cmd = DEVLINK_CMD_PARAM_GET, |
| 5131 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 5107 | .doit = devlink_nl_cmd_param_get_doit, | 5132 | .doit = devlink_nl_cmd_param_get_doit, |
| 5108 | .dumpit = devlink_nl_cmd_param_get_dumpit, | 5133 | .dumpit = devlink_nl_cmd_param_get_dumpit, |
| 5109 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, | 5134 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, |
| @@ -5111,12 +5136,14 @@ static const struct genl_ops devlink_nl_ops[] = { | |||
| 5111 | }, | 5136 | }, |
| 5112 | { | 5137 | { |
| 5113 | .cmd = DEVLINK_CMD_PARAM_SET, | 5138 | .cmd = DEVLINK_CMD_PARAM_SET, |
| 5139 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 5114 | .doit = devlink_nl_cmd_param_set_doit, | 5140 | .doit = devlink_nl_cmd_param_set_doit, |
| 5115 | .flags = GENL_ADMIN_PERM, | 5141 | .flags = GENL_ADMIN_PERM, |
| 5116 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, | 5142 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, |
| 5117 | }, | 5143 | }, |
| 5118 | { | 5144 | { |
| 5119 | .cmd = DEVLINK_CMD_PORT_PARAM_GET, | 5145 | .cmd = DEVLINK_CMD_PORT_PARAM_GET, |
| 5146 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 5120 | .doit = devlink_nl_cmd_port_param_get_doit, | 5147 | .doit = devlink_nl_cmd_port_param_get_doit, |
| 5121 | .dumpit = devlink_nl_cmd_port_param_get_dumpit, | 5148 | .dumpit = devlink_nl_cmd_port_param_get_dumpit, |
| 5122 | .internal_flags = DEVLINK_NL_FLAG_NEED_PORT, | 5149 | .internal_flags = DEVLINK_NL_FLAG_NEED_PORT, |
| @@ -5124,12 +5151,14 @@ static const struct genl_ops devlink_nl_ops[] = { | |||
| 5124 | }, | 5151 | }, |
| 5125 | { | 5152 | { |
| 5126 | .cmd = DEVLINK_CMD_PORT_PARAM_SET, | 5153 | .cmd = DEVLINK_CMD_PORT_PARAM_SET, |
| 5154 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 5127 | .doit = devlink_nl_cmd_port_param_set_doit, | 5155 | .doit = devlink_nl_cmd_port_param_set_doit, |
| 5128 | .flags = GENL_ADMIN_PERM, | 5156 | .flags = GENL_ADMIN_PERM, |
| 5129 | .internal_flags = DEVLINK_NL_FLAG_NEED_PORT, | 5157 | .internal_flags = DEVLINK_NL_FLAG_NEED_PORT, |
| 5130 | }, | 5158 | }, |
| 5131 | { | 5159 | { |
| 5132 | .cmd = DEVLINK_CMD_REGION_GET, | 5160 | .cmd = DEVLINK_CMD_REGION_GET, |
| 5161 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 5133 | .doit = devlink_nl_cmd_region_get_doit, | 5162 | .doit = devlink_nl_cmd_region_get_doit, |
| 5134 | .dumpit = devlink_nl_cmd_region_get_dumpit, | 5163 | .dumpit = devlink_nl_cmd_region_get_dumpit, |
| 5135 | .flags = GENL_ADMIN_PERM, | 5164 | .flags = GENL_ADMIN_PERM, |
| @@ -5137,18 +5166,21 @@ static const struct genl_ops devlink_nl_ops[] = { | |||
| 5137 | }, | 5166 | }, |
| 5138 | { | 5167 | { |
| 5139 | .cmd = DEVLINK_CMD_REGION_DEL, | 5168 | .cmd = DEVLINK_CMD_REGION_DEL, |
| 5169 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 5140 | .doit = devlink_nl_cmd_region_del, | 5170 | .doit = devlink_nl_cmd_region_del, |
| 5141 | .flags = GENL_ADMIN_PERM, | 5171 | .flags = GENL_ADMIN_PERM, |
| 5142 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, | 5172 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, |
| 5143 | }, | 5173 | }, |
| 5144 | { | 5174 | { |
| 5145 | .cmd = DEVLINK_CMD_REGION_READ, | 5175 | .cmd = DEVLINK_CMD_REGION_READ, |
| 5176 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 5146 | .dumpit = devlink_nl_cmd_region_read_dumpit, | 5177 | .dumpit = devlink_nl_cmd_region_read_dumpit, |
| 5147 | .flags = GENL_ADMIN_PERM, | 5178 | .flags = GENL_ADMIN_PERM, |
| 5148 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, | 5179 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, |
| 5149 | }, | 5180 | }, |
| 5150 | { | 5181 | { |
| 5151 | .cmd = DEVLINK_CMD_INFO_GET, | 5182 | .cmd = DEVLINK_CMD_INFO_GET, |
| 5183 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 5152 | .doit = devlink_nl_cmd_info_get_doit, | 5184 | .doit = devlink_nl_cmd_info_get_doit, |
| 5153 | .dumpit = devlink_nl_cmd_info_get_dumpit, | 5185 | .dumpit = devlink_nl_cmd_info_get_dumpit, |
| 5154 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, | 5186 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, |
| @@ -5156,6 +5188,7 @@ static const struct genl_ops devlink_nl_ops[] = { | |||
| 5156 | }, | 5188 | }, |
| 5157 | { | 5189 | { |
| 5158 | .cmd = DEVLINK_CMD_HEALTH_REPORTER_GET, | 5190 | .cmd = DEVLINK_CMD_HEALTH_REPORTER_GET, |
| 5191 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 5159 | .doit = devlink_nl_cmd_health_reporter_get_doit, | 5192 | .doit = devlink_nl_cmd_health_reporter_get_doit, |
| 5160 | .dumpit = devlink_nl_cmd_health_reporter_get_dumpit, | 5193 | .dumpit = devlink_nl_cmd_health_reporter_get_dumpit, |
| 5161 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, | 5194 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, |
| @@ -5163,24 +5196,28 @@ static const struct genl_ops devlink_nl_ops[] = { | |||
| 5163 | }, | 5196 | }, |
| 5164 | { | 5197 | { |
| 5165 | .cmd = DEVLINK_CMD_HEALTH_REPORTER_SET, | 5198 | .cmd = DEVLINK_CMD_HEALTH_REPORTER_SET, |
| 5199 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 5166 | .doit = devlink_nl_cmd_health_reporter_set_doit, | 5200 | .doit = devlink_nl_cmd_health_reporter_set_doit, |
| 5167 | .flags = GENL_ADMIN_PERM, | 5201 | .flags = GENL_ADMIN_PERM, |
| 5168 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, | 5202 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, |
| 5169 | }, | 5203 | }, |
| 5170 | { | 5204 | { |
| 5171 | .cmd = DEVLINK_CMD_HEALTH_REPORTER_RECOVER, | 5205 | .cmd = DEVLINK_CMD_HEALTH_REPORTER_RECOVER, |
| 5206 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 5172 | .doit = devlink_nl_cmd_health_reporter_recover_doit, | 5207 | .doit = devlink_nl_cmd_health_reporter_recover_doit, |
| 5173 | .flags = GENL_ADMIN_PERM, | 5208 | .flags = GENL_ADMIN_PERM, |
| 5174 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, | 5209 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, |
| 5175 | }, | 5210 | }, |
| 5176 | { | 5211 | { |
| 5177 | .cmd = DEVLINK_CMD_HEALTH_REPORTER_DIAGNOSE, | 5212 | .cmd = DEVLINK_CMD_HEALTH_REPORTER_DIAGNOSE, |
| 5213 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 5178 | .doit = devlink_nl_cmd_health_reporter_diagnose_doit, | 5214 | .doit = devlink_nl_cmd_health_reporter_diagnose_doit, |
| 5179 | .flags = GENL_ADMIN_PERM, | 5215 | .flags = GENL_ADMIN_PERM, |
| 5180 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, | 5216 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, |
| 5181 | }, | 5217 | }, |
| 5182 | { | 5218 | { |
| 5183 | .cmd = DEVLINK_CMD_HEALTH_REPORTER_DUMP_GET, | 5219 | .cmd = DEVLINK_CMD_HEALTH_REPORTER_DUMP_GET, |
| 5220 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 5184 | .doit = devlink_nl_cmd_health_reporter_dump_get_doit, | 5221 | .doit = devlink_nl_cmd_health_reporter_dump_get_doit, |
| 5185 | .flags = GENL_ADMIN_PERM, | 5222 | .flags = GENL_ADMIN_PERM, |
| 5186 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK | | 5223 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK | |
| @@ -5188,6 +5225,7 @@ static const struct genl_ops devlink_nl_ops[] = { | |||
| 5188 | }, | 5225 | }, |
| 5189 | { | 5226 | { |
| 5190 | .cmd = DEVLINK_CMD_HEALTH_REPORTER_DUMP_CLEAR, | 5227 | .cmd = DEVLINK_CMD_HEALTH_REPORTER_DUMP_CLEAR, |
| 5228 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 5191 | .doit = devlink_nl_cmd_health_reporter_dump_clear_doit, | 5229 | .doit = devlink_nl_cmd_health_reporter_dump_clear_doit, |
| 5192 | .flags = GENL_ADMIN_PERM, | 5230 | .flags = GENL_ADMIN_PERM, |
| 5193 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK | | 5231 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK | |
| @@ -5195,6 +5233,7 @@ static const struct genl_ops devlink_nl_ops[] = { | |||
| 5195 | }, | 5233 | }, |
| 5196 | { | 5234 | { |
| 5197 | .cmd = DEVLINK_CMD_FLASH_UPDATE, | 5235 | .cmd = DEVLINK_CMD_FLASH_UPDATE, |
| 5236 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 5198 | .doit = devlink_nl_cmd_flash_update, | 5237 | .doit = devlink_nl_cmd_flash_update, |
| 5199 | .flags = GENL_ADMIN_PERM, | 5238 | .flags = GENL_ADMIN_PERM, |
| 5200 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, | 5239 | .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK, |
diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c index c7785efeea57..d4ce0542acfa 100644 --- a/net/core/drop_monitor.c +++ b/net/core/drop_monitor.c | |||
| @@ -355,14 +355,17 @@ out: | |||
| 355 | static const struct genl_ops dropmon_ops[] = { | 355 | static const struct genl_ops dropmon_ops[] = { |
| 356 | { | 356 | { |
| 357 | .cmd = NET_DM_CMD_CONFIG, | 357 | .cmd = NET_DM_CMD_CONFIG, |
| 358 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 358 | .doit = net_dm_cmd_config, | 359 | .doit = net_dm_cmd_config, |
| 359 | }, | 360 | }, |
| 360 | { | 361 | { |
| 361 | .cmd = NET_DM_CMD_START, | 362 | .cmd = NET_DM_CMD_START, |
| 363 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 362 | .doit = net_dm_cmd_trace, | 364 | .doit = net_dm_cmd_trace, |
| 363 | }, | 365 | }, |
| 364 | { | 366 | { |
| 365 | .cmd = NET_DM_CMD_STOP, | 367 | .cmd = NET_DM_CMD_STOP, |
| 368 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 366 | .doit = net_dm_cmd_trace, | 369 | .doit = net_dm_cmd_trace, |
| 367 | }, | 370 | }, |
| 368 | }; | 371 | }; |
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c index ffbb827723a2..18f8dd8329ed 100644 --- a/net/core/fib_rules.c +++ b/net/core/fib_rules.c | |||
| @@ -746,7 +746,8 @@ int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 746 | goto errout; | 746 | goto errout; |
| 747 | } | 747 | } |
| 748 | 748 | ||
| 749 | err = nlmsg_parse(nlh, sizeof(*frh), tb, FRA_MAX, ops->policy, extack); | 749 | err = nlmsg_parse_deprecated(nlh, sizeof(*frh), tb, FRA_MAX, |
| 750 | ops->policy, extack); | ||
| 750 | if (err < 0) { | 751 | if (err < 0) { |
| 751 | NL_SET_ERR_MSG(extack, "Error parsing msg"); | 752 | NL_SET_ERR_MSG(extack, "Error parsing msg"); |
| 752 | goto errout; | 753 | goto errout; |
| @@ -853,7 +854,8 @@ int fib_nl_delrule(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 853 | goto errout; | 854 | goto errout; |
| 854 | } | 855 | } |
| 855 | 856 | ||
| 856 | err = nlmsg_parse(nlh, sizeof(*frh), tb, FRA_MAX, ops->policy, extack); | 857 | err = nlmsg_parse_deprecated(nlh, sizeof(*frh), tb, FRA_MAX, |
| 858 | ops->policy, extack); | ||
| 857 | if (err < 0) { | 859 | if (err < 0) { |
| 858 | NL_SET_ERR_MSG(extack, "Error parsing msg"); | 860 | NL_SET_ERR_MSG(extack, "Error parsing msg"); |
| 859 | goto errout; | 861 | goto errout; |
diff --git a/net/core/lwt_bpf.c b/net/core/lwt_bpf.c index bbdfc8db1960..1c94f529f4a1 100644 --- a/net/core/lwt_bpf.c +++ b/net/core/lwt_bpf.c | |||
| @@ -343,8 +343,8 @@ static int bpf_parse_prog(struct nlattr *attr, struct bpf_lwt_prog *prog, | |||
| 343 | int ret; | 343 | int ret; |
| 344 | u32 fd; | 344 | u32 fd; |
| 345 | 345 | ||
| 346 | ret = nla_parse_nested(tb, LWT_BPF_PROG_MAX, attr, bpf_prog_policy, | 346 | ret = nla_parse_nested_deprecated(tb, LWT_BPF_PROG_MAX, attr, |
| 347 | NULL); | 347 | bpf_prog_policy, NULL); |
| 348 | if (ret < 0) | 348 | if (ret < 0) |
| 349 | return ret; | 349 | return ret; |
| 350 | 350 | ||
| @@ -385,7 +385,8 @@ static int bpf_build_state(struct nlattr *nla, | |||
| 385 | if (family != AF_INET && family != AF_INET6) | 385 | if (family != AF_INET && family != AF_INET6) |
| 386 | return -EAFNOSUPPORT; | 386 | return -EAFNOSUPPORT; |
| 387 | 387 | ||
| 388 | ret = nla_parse_nested(tb, LWT_BPF_MAX, nla, bpf_nl_policy, extack); | 388 | ret = nla_parse_nested_deprecated(tb, LWT_BPF_MAX, nla, bpf_nl_policy, |
| 389 | extack); | ||
| 389 | if (ret < 0) | 390 | if (ret < 0) |
| 390 | return ret; | 391 | return ret; |
| 391 | 392 | ||
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index efd0b53d9ca4..e73bfc63e473 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
| @@ -1862,7 +1862,8 @@ static int neigh_add(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 1862 | int err; | 1862 | int err; |
| 1863 | 1863 | ||
| 1864 | ASSERT_RTNL(); | 1864 | ASSERT_RTNL(); |
| 1865 | err = nlmsg_parse(nlh, sizeof(*ndm), tb, NDA_MAX, nda_policy, extack); | 1865 | err = nlmsg_parse_deprecated(nlh, sizeof(*ndm), tb, NDA_MAX, |
| 1866 | nda_policy, extack); | ||
| 1866 | if (err < 0) | 1867 | if (err < 0) |
| 1867 | goto out; | 1868 | goto out; |
| 1868 | 1869 | ||
| @@ -2181,8 +2182,8 @@ static int neightbl_set(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 2181 | bool found = false; | 2182 | bool found = false; |
| 2182 | int err, tidx; | 2183 | int err, tidx; |
| 2183 | 2184 | ||
| 2184 | err = nlmsg_parse(nlh, sizeof(*ndtmsg), tb, NDTA_MAX, | 2185 | err = nlmsg_parse_deprecated(nlh, sizeof(*ndtmsg), tb, NDTA_MAX, |
| 2185 | nl_neightbl_policy, extack); | 2186 | nl_neightbl_policy, extack); |
| 2186 | if (err < 0) | 2187 | if (err < 0) |
| 2187 | goto errout; | 2188 | goto errout; |
| 2188 | 2189 | ||
| @@ -2219,8 +2220,9 @@ static int neightbl_set(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 2219 | struct neigh_parms *p; | 2220 | struct neigh_parms *p; |
| 2220 | int i, ifindex = 0; | 2221 | int i, ifindex = 0; |
| 2221 | 2222 | ||
| 2222 | err = nla_parse_nested(tbp, NDTPA_MAX, tb[NDTA_PARMS], | 2223 | err = nla_parse_nested_deprecated(tbp, NDTPA_MAX, |
| 2223 | nl_ntbl_parm_policy, extack); | 2224 | tb[NDTA_PARMS], |
| 2225 | nl_ntbl_parm_policy, extack); | ||
| 2224 | if (err < 0) | 2226 | if (err < 0) |
| 2225 | goto errout_tbl_lock; | 2227 | goto errout_tbl_lock; |
| 2226 | 2228 | ||
| @@ -2660,11 +2662,12 @@ static int neigh_valid_dump_req(const struct nlmsghdr *nlh, | |||
| 2660 | return -EINVAL; | 2662 | return -EINVAL; |
| 2661 | } | 2663 | } |
| 2662 | 2664 | ||
| 2663 | err = nlmsg_parse_strict(nlh, sizeof(struct ndmsg), tb, NDA_MAX, | 2665 | err = nlmsg_parse_deprecated_strict(nlh, sizeof(struct ndmsg), |
| 2664 | nda_policy, extack); | 2666 | tb, NDA_MAX, nda_policy, |
| 2667 | extack); | ||
| 2665 | } else { | 2668 | } else { |
| 2666 | err = nlmsg_parse(nlh, sizeof(struct ndmsg), tb, NDA_MAX, | 2669 | err = nlmsg_parse_deprecated(nlh, sizeof(struct ndmsg), tb, |
| 2667 | nda_policy, extack); | 2670 | NDA_MAX, nda_policy, extack); |
| 2668 | } | 2671 | } |
| 2669 | if (err < 0) | 2672 | if (err < 0) |
| 2670 | return err; | 2673 | return err; |
| @@ -2764,8 +2767,8 @@ static int neigh_valid_get_req(const struct nlmsghdr *nlh, | |||
| 2764 | return -EINVAL; | 2767 | return -EINVAL; |
| 2765 | } | 2768 | } |
| 2766 | 2769 | ||
| 2767 | err = nlmsg_parse_strict(nlh, sizeof(struct ndmsg), tb, NDA_MAX, | 2770 | err = nlmsg_parse_deprecated_strict(nlh, sizeof(struct ndmsg), tb, |
| 2768 | nda_policy, extack); | 2771 | NDA_MAX, nda_policy, extack); |
| 2769 | if (err < 0) | 2772 | if (err < 0) |
| 2770 | return err; | 2773 | return err; |
| 2771 | 2774 | ||
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index ebb5b6d21a13..711b161505ac 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c | |||
| @@ -682,8 +682,8 @@ static int rtnl_net_newid(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 682 | struct net *peer; | 682 | struct net *peer; |
| 683 | int nsid, err; | 683 | int nsid, err; |
| 684 | 684 | ||
| 685 | err = nlmsg_parse(nlh, sizeof(struct rtgenmsg), tb, NETNSA_MAX, | 685 | err = nlmsg_parse_deprecated(nlh, sizeof(struct rtgenmsg), tb, |
| 686 | rtnl_net_policy, extack); | 686 | NETNSA_MAX, rtnl_net_policy, extack); |
| 687 | if (err < 0) | 687 | if (err < 0) |
| 688 | return err; | 688 | return err; |
| 689 | if (!tb[NETNSA_NSID]) { | 689 | if (!tb[NETNSA_NSID]) { |
| @@ -787,11 +787,13 @@ static int rtnl_net_valid_getid_req(struct sk_buff *skb, | |||
| 787 | int i, err; | 787 | int i, err; |
| 788 | 788 | ||
| 789 | if (!netlink_strict_get_check(skb)) | 789 | if (!netlink_strict_get_check(skb)) |
| 790 | return nlmsg_parse(nlh, sizeof(struct rtgenmsg), tb, NETNSA_MAX, | 790 | return nlmsg_parse_deprecated(nlh, sizeof(struct rtgenmsg), |
| 791 | rtnl_net_policy, extack); | 791 | tb, NETNSA_MAX, rtnl_net_policy, |
| 792 | extack); | ||
| 792 | 793 | ||
| 793 | err = nlmsg_parse_strict(nlh, sizeof(struct rtgenmsg), tb, NETNSA_MAX, | 794 | err = nlmsg_parse_deprecated_strict(nlh, sizeof(struct rtgenmsg), tb, |
| 794 | rtnl_net_policy, extack); | 795 | NETNSA_MAX, rtnl_net_policy, |
| 796 | extack); | ||
| 795 | if (err) | 797 | if (err) |
| 796 | return err; | 798 | return err; |
| 797 | 799 | ||
| @@ -929,8 +931,9 @@ static int rtnl_valid_dump_net_req(const struct nlmsghdr *nlh, struct sock *sk, | |||
| 929 | struct nlattr *tb[NETNSA_MAX + 1]; | 931 | struct nlattr *tb[NETNSA_MAX + 1]; |
| 930 | int err, i; | 932 | int err, i; |
| 931 | 933 | ||
| 932 | err = nlmsg_parse_strict(nlh, sizeof(struct rtgenmsg), tb, NETNSA_MAX, | 934 | err = nlmsg_parse_deprecated_strict(nlh, sizeof(struct rtgenmsg), tb, |
| 933 | rtnl_net_policy, extack); | 935 | NETNSA_MAX, rtnl_net_policy, |
| 936 | extack); | ||
| 934 | if (err < 0) | 937 | if (err < 0) |
| 935 | return err; | 938 | return err; |
| 936 | 939 | ||
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 8ad44b299e72..2bd12afb9297 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
| @@ -1797,8 +1797,7 @@ static const struct rtnl_link_ops *linkinfo_to_kind_ops(const struct nlattr *nla | |||
| 1797 | const struct rtnl_link_ops *ops = NULL; | 1797 | const struct rtnl_link_ops *ops = NULL; |
| 1798 | struct nlattr *linfo[IFLA_INFO_MAX + 1]; | 1798 | struct nlattr *linfo[IFLA_INFO_MAX + 1]; |
| 1799 | 1799 | ||
| 1800 | if (nla_parse_nested(linfo, IFLA_INFO_MAX, nla, | 1800 | if (nla_parse_nested_deprecated(linfo, IFLA_INFO_MAX, nla, ifla_info_policy, NULL) < 0) |
| 1801 | ifla_info_policy, NULL) < 0) | ||
| 1802 | return NULL; | 1801 | return NULL; |
| 1803 | 1802 | ||
| 1804 | if (linfo[IFLA_INFO_KIND]) { | 1803 | if (linfo[IFLA_INFO_KIND]) { |
| @@ -1897,8 +1896,9 @@ static int rtnl_valid_dump_ifinfo_req(const struct nlmsghdr *nlh, | |||
| 1897 | return -EINVAL; | 1896 | return -EINVAL; |
| 1898 | } | 1897 | } |
| 1899 | 1898 | ||
| 1900 | return nlmsg_parse_strict(nlh, sizeof(*ifm), tb, IFLA_MAX, | 1899 | return nlmsg_parse_deprecated_strict(nlh, sizeof(*ifm), tb, |
| 1901 | ifla_policy, extack); | 1900 | IFLA_MAX, ifla_policy, |
| 1901 | extack); | ||
| 1902 | } | 1902 | } |
| 1903 | 1903 | ||
| 1904 | /* A hack to preserve kernel<->userspace interface. | 1904 | /* A hack to preserve kernel<->userspace interface. |
| @@ -1911,7 +1911,8 @@ static int rtnl_valid_dump_ifinfo_req(const struct nlmsghdr *nlh, | |||
| 1911 | hdrlen = nlmsg_len(nlh) < sizeof(struct ifinfomsg) ? | 1911 | hdrlen = nlmsg_len(nlh) < sizeof(struct ifinfomsg) ? |
| 1912 | sizeof(struct rtgenmsg) : sizeof(struct ifinfomsg); | 1912 | sizeof(struct rtgenmsg) : sizeof(struct ifinfomsg); |
| 1913 | 1913 | ||
| 1914 | return nlmsg_parse(nlh, hdrlen, tb, IFLA_MAX, ifla_policy, extack); | 1914 | return nlmsg_parse_deprecated(nlh, hdrlen, tb, IFLA_MAX, ifla_policy, |
| 1915 | extack); | ||
| 1915 | } | 1916 | } |
| 1916 | 1917 | ||
| 1917 | static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb) | 1918 | static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb) |
| @@ -2019,7 +2020,8 @@ out_err: | |||
| 2019 | int rtnl_nla_parse_ifla(struct nlattr **tb, const struct nlattr *head, int len, | 2020 | int rtnl_nla_parse_ifla(struct nlattr **tb, const struct nlattr *head, int len, |
| 2020 | struct netlink_ext_ack *exterr) | 2021 | struct netlink_ext_ack *exterr) |
| 2021 | { | 2022 | { |
| 2022 | return nla_parse(tb, IFLA_MAX, head, len, ifla_policy, exterr); | 2023 | return nla_parse_deprecated(tb, IFLA_MAX, head, len, ifla_policy, |
| 2024 | exterr); | ||
| 2023 | } | 2025 | } |
| 2024 | EXPORT_SYMBOL(rtnl_nla_parse_ifla); | 2026 | EXPORT_SYMBOL(rtnl_nla_parse_ifla); |
| 2025 | 2027 | ||
| @@ -2564,8 +2566,10 @@ static int do_setlink(const struct sk_buff *skb, | |||
| 2564 | err = -EINVAL; | 2566 | err = -EINVAL; |
| 2565 | goto errout; | 2567 | goto errout; |
| 2566 | } | 2568 | } |
| 2567 | err = nla_parse_nested(vfinfo, IFLA_VF_MAX, attr, | 2569 | err = nla_parse_nested_deprecated(vfinfo, IFLA_VF_MAX, |
| 2568 | ifla_vf_policy, NULL); | 2570 | attr, |
| 2571 | ifla_vf_policy, | ||
| 2572 | NULL); | ||
| 2569 | if (err < 0) | 2573 | if (err < 0) |
| 2570 | goto errout; | 2574 | goto errout; |
| 2571 | err = do_setvfinfo(dev, vfinfo); | 2575 | err = do_setvfinfo(dev, vfinfo); |
| @@ -2592,8 +2596,10 @@ static int do_setlink(const struct sk_buff *skb, | |||
| 2592 | err = -EINVAL; | 2596 | err = -EINVAL; |
| 2593 | goto errout; | 2597 | goto errout; |
| 2594 | } | 2598 | } |
| 2595 | err = nla_parse_nested(port, IFLA_PORT_MAX, attr, | 2599 | err = nla_parse_nested_deprecated(port, IFLA_PORT_MAX, |
| 2596 | ifla_port_policy, NULL); | 2600 | attr, |
| 2601 | ifla_port_policy, | ||
| 2602 | NULL); | ||
| 2597 | if (err < 0) | 2603 | if (err < 0) |
| 2598 | goto errout; | 2604 | goto errout; |
| 2599 | if (!port[IFLA_PORT_VF]) { | 2605 | if (!port[IFLA_PORT_VF]) { |
| @@ -2612,9 +2618,9 @@ static int do_setlink(const struct sk_buff *skb, | |||
| 2612 | if (tb[IFLA_PORT_SELF]) { | 2618 | if (tb[IFLA_PORT_SELF]) { |
| 2613 | struct nlattr *port[IFLA_PORT_MAX+1]; | 2619 | struct nlattr *port[IFLA_PORT_MAX+1]; |
| 2614 | 2620 | ||
| 2615 | err = nla_parse_nested(port, IFLA_PORT_MAX, | 2621 | err = nla_parse_nested_deprecated(port, IFLA_PORT_MAX, |
| 2616 | tb[IFLA_PORT_SELF], ifla_port_policy, | 2622 | tb[IFLA_PORT_SELF], |
| 2617 | NULL); | 2623 | ifla_port_policy, NULL); |
| 2618 | if (err < 0) | 2624 | if (err < 0) |
| 2619 | goto errout; | 2625 | goto errout; |
| 2620 | 2626 | ||
| @@ -2661,8 +2667,9 @@ static int do_setlink(const struct sk_buff *skb, | |||
| 2661 | struct nlattr *xdp[IFLA_XDP_MAX + 1]; | 2667 | struct nlattr *xdp[IFLA_XDP_MAX + 1]; |
| 2662 | u32 xdp_flags = 0; | 2668 | u32 xdp_flags = 0; |
| 2663 | 2669 | ||
| 2664 | err = nla_parse_nested(xdp, IFLA_XDP_MAX, tb[IFLA_XDP], | 2670 | err = nla_parse_nested_deprecated(xdp, IFLA_XDP_MAX, |
| 2665 | ifla_xdp_policy, NULL); | 2671 | tb[IFLA_XDP], |
| 2672 | ifla_xdp_policy, NULL); | ||
| 2666 | if (err < 0) | 2673 | if (err < 0) |
| 2667 | goto errout; | 2674 | goto errout; |
| 2668 | 2675 | ||
| @@ -2716,8 +2723,8 @@ static int rtnl_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 2716 | struct nlattr *tb[IFLA_MAX+1]; | 2723 | struct nlattr *tb[IFLA_MAX+1]; |
| 2717 | char ifname[IFNAMSIZ]; | 2724 | char ifname[IFNAMSIZ]; |
| 2718 | 2725 | ||
| 2719 | err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy, | 2726 | err = nlmsg_parse_deprecated(nlh, sizeof(*ifm), tb, IFLA_MAX, |
| 2720 | extack); | 2727 | ifla_policy, extack); |
| 2721 | if (err < 0) | 2728 | if (err < 0) |
| 2722 | goto errout; | 2729 | goto errout; |
| 2723 | 2730 | ||
| @@ -2813,7 +2820,8 @@ static int rtnl_dellink(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 2813 | int err; | 2820 | int err; |
| 2814 | int netnsid = -1; | 2821 | int netnsid = -1; |
| 2815 | 2822 | ||
| 2816 | err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy, extack); | 2823 | err = nlmsg_parse_deprecated(nlh, sizeof(*ifm), tb, IFLA_MAX, |
| 2824 | ifla_policy, extack); | ||
| 2817 | if (err < 0) | 2825 | if (err < 0) |
| 2818 | return err; | 2826 | return err; |
| 2819 | 2827 | ||
| @@ -2990,7 +2998,8 @@ static int __rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 2990 | #ifdef CONFIG_MODULES | 2998 | #ifdef CONFIG_MODULES |
| 2991 | replay: | 2999 | replay: |
| 2992 | #endif | 3000 | #endif |
| 2993 | err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy, extack); | 3001 | err = nlmsg_parse_deprecated(nlh, sizeof(*ifm), tb, IFLA_MAX, |
| 3002 | ifla_policy, extack); | ||
| 2994 | if (err < 0) | 3003 | if (err < 0) |
| 2995 | return err; | 3004 | return err; |
| 2996 | 3005 | ||
| @@ -3024,9 +3033,9 @@ replay: | |||
| 3024 | return err; | 3033 | return err; |
| 3025 | 3034 | ||
| 3026 | if (tb[IFLA_LINKINFO]) { | 3035 | if (tb[IFLA_LINKINFO]) { |
| 3027 | err = nla_parse_nested(linkinfo, IFLA_INFO_MAX, | 3036 | err = nla_parse_nested_deprecated(linkinfo, IFLA_INFO_MAX, |
| 3028 | tb[IFLA_LINKINFO], ifla_info_policy, | 3037 | tb[IFLA_LINKINFO], |
| 3029 | NULL); | 3038 | ifla_info_policy, NULL); |
| 3030 | if (err < 0) | 3039 | if (err < 0) |
| 3031 | return err; | 3040 | return err; |
| 3032 | } else | 3041 | } else |
| @@ -3046,9 +3055,9 @@ replay: | |||
| 3046 | return -EINVAL; | 3055 | return -EINVAL; |
| 3047 | 3056 | ||
| 3048 | if (ops->maxtype && linkinfo[IFLA_INFO_DATA]) { | 3057 | if (ops->maxtype && linkinfo[IFLA_INFO_DATA]) { |
| 3049 | err = nla_parse_nested(attr, ops->maxtype, | 3058 | err = nla_parse_nested_deprecated(attr, ops->maxtype, |
| 3050 | linkinfo[IFLA_INFO_DATA], | 3059 | linkinfo[IFLA_INFO_DATA], |
| 3051 | ops->policy, extack); | 3060 | ops->policy, extack); |
| 3052 | if (err < 0) | 3061 | if (err < 0) |
| 3053 | return err; | 3062 | return err; |
| 3054 | data = attr; | 3063 | data = attr; |
| @@ -3067,9 +3076,11 @@ replay: | |||
| 3067 | 3076 | ||
| 3068 | if (m_ops->slave_maxtype && | 3077 | if (m_ops->slave_maxtype && |
| 3069 | linkinfo[IFLA_INFO_SLAVE_DATA]) { | 3078 | linkinfo[IFLA_INFO_SLAVE_DATA]) { |
| 3070 | err = nla_parse_nested(slave_attr, m_ops->slave_maxtype, | 3079 | err = nla_parse_nested_deprecated(slave_attr, |
| 3071 | linkinfo[IFLA_INFO_SLAVE_DATA], | 3080 | m_ops->slave_maxtype, |
| 3072 | m_ops->slave_policy, extack); | 3081 | linkinfo[IFLA_INFO_SLAVE_DATA], |
| 3082 | m_ops->slave_policy, | ||
| 3083 | extack); | ||
| 3073 | if (err < 0) | 3084 | if (err < 0) |
| 3074 | return err; | 3085 | return err; |
| 3075 | slave_data = slave_attr; | 3086 | slave_data = slave_attr; |
| @@ -3250,8 +3261,8 @@ static int rtnl_valid_getlink_req(struct sk_buff *skb, | |||
| 3250 | } | 3261 | } |
| 3251 | 3262 | ||
| 3252 | if (!netlink_strict_get_check(skb)) | 3263 | if (!netlink_strict_get_check(skb)) |
| 3253 | return nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy, | 3264 | return nlmsg_parse_deprecated(nlh, sizeof(*ifm), tb, IFLA_MAX, |
| 3254 | extack); | 3265 | ifla_policy, extack); |
| 3255 | 3266 | ||
| 3256 | ifm = nlmsg_data(nlh); | 3267 | ifm = nlmsg_data(nlh); |
| 3257 | if (ifm->__ifi_pad || ifm->ifi_type || ifm->ifi_flags || | 3268 | if (ifm->__ifi_pad || ifm->ifi_type || ifm->ifi_flags || |
| @@ -3260,8 +3271,8 @@ static int rtnl_valid_getlink_req(struct sk_buff *skb, | |||
| 3260 | return -EINVAL; | 3271 | return -EINVAL; |
| 3261 | } | 3272 | } |
| 3262 | 3273 | ||
| 3263 | err = nlmsg_parse_strict(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy, | 3274 | err = nlmsg_parse_deprecated_strict(nlh, sizeof(*ifm), tb, IFLA_MAX, |
| 3264 | extack); | 3275 | ifla_policy, extack); |
| 3265 | if (err) | 3276 | if (err) |
| 3266 | return err; | 3277 | return err; |
| 3267 | 3278 | ||
| @@ -3366,7 +3377,7 @@ static u16 rtnl_calcit(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
| 3366 | hdrlen = nlmsg_len(nlh) < sizeof(struct ifinfomsg) ? | 3377 | hdrlen = nlmsg_len(nlh) < sizeof(struct ifinfomsg) ? |
| 3367 | sizeof(struct rtgenmsg) : sizeof(struct ifinfomsg); | 3378 | sizeof(struct rtgenmsg) : sizeof(struct ifinfomsg); |
| 3368 | 3379 | ||
| 3369 | if (nlmsg_parse(nlh, hdrlen, tb, IFLA_MAX, ifla_policy, NULL) >= 0) { | 3380 | if (nlmsg_parse_deprecated(nlh, hdrlen, tb, IFLA_MAX, ifla_policy, NULL) >= 0) { |
| 3370 | if (tb[IFLA_EXT_MASK]) | 3381 | if (tb[IFLA_EXT_MASK]) |
| 3371 | ext_filter_mask = nla_get_u32(tb[IFLA_EXT_MASK]); | 3382 | ext_filter_mask = nla_get_u32(tb[IFLA_EXT_MASK]); |
| 3372 | } | 3383 | } |
| @@ -3639,7 +3650,8 @@ static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 3639 | u16 vid; | 3650 | u16 vid; |
| 3640 | int err; | 3651 | int err; |
| 3641 | 3652 | ||
| 3642 | err = nlmsg_parse(nlh, sizeof(*ndm), tb, NDA_MAX, NULL, extack); | 3653 | err = nlmsg_parse_deprecated(nlh, sizeof(*ndm), tb, NDA_MAX, NULL, |
| 3654 | extack); | ||
| 3643 | if (err < 0) | 3655 | if (err < 0) |
| 3644 | return err; | 3656 | return err; |
| 3645 | 3657 | ||
| @@ -3749,7 +3761,8 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 3749 | if (!netlink_capable(skb, CAP_NET_ADMIN)) | 3761 | if (!netlink_capable(skb, CAP_NET_ADMIN)) |
| 3750 | return -EPERM; | 3762 | return -EPERM; |
| 3751 | 3763 | ||
| 3752 | err = nlmsg_parse(nlh, sizeof(*ndm), tb, NDA_MAX, NULL, extack); | 3764 | err = nlmsg_parse_deprecated(nlh, sizeof(*ndm), tb, NDA_MAX, NULL, |
| 3765 | extack); | ||
| 3753 | if (err < 0) | 3766 | if (err < 0) |
| 3754 | return err; | 3767 | return err; |
| 3755 | 3768 | ||
| @@ -3898,8 +3911,8 @@ static int valid_fdb_dump_strict(const struct nlmsghdr *nlh, | |||
| 3898 | return -EINVAL; | 3911 | return -EINVAL; |
| 3899 | } | 3912 | } |
| 3900 | 3913 | ||
| 3901 | err = nlmsg_parse_strict(nlh, sizeof(struct ndmsg), tb, NDA_MAX, | 3914 | err = nlmsg_parse_deprecated_strict(nlh, sizeof(struct ndmsg), tb, |
| 3902 | NULL, extack); | 3915 | NDA_MAX, NULL, extack); |
| 3903 | if (err < 0) | 3916 | if (err < 0) |
| 3904 | return err; | 3917 | return err; |
| 3905 | 3918 | ||
| @@ -3951,8 +3964,9 @@ static int valid_fdb_dump_legacy(const struct nlmsghdr *nlh, | |||
| 3951 | nla_attr_size(sizeof(u32)))) { | 3964 | nla_attr_size(sizeof(u32)))) { |
| 3952 | struct ifinfomsg *ifm; | 3965 | struct ifinfomsg *ifm; |
| 3953 | 3966 | ||
| 3954 | err = nlmsg_parse(nlh, sizeof(struct ifinfomsg), tb, IFLA_MAX, | 3967 | err = nlmsg_parse_deprecated(nlh, sizeof(struct ifinfomsg), |
| 3955 | ifla_policy, extack); | 3968 | tb, IFLA_MAX, ifla_policy, |
| 3969 | extack); | ||
| 3956 | if (err < 0) { | 3970 | if (err < 0) { |
| 3957 | return -EINVAL; | 3971 | return -EINVAL; |
| 3958 | } else if (err == 0) { | 3972 | } else if (err == 0) { |
| @@ -4091,8 +4105,8 @@ static int valid_fdb_get_strict(const struct nlmsghdr *nlh, | |||
| 4091 | return -EINVAL; | 4105 | return -EINVAL; |
| 4092 | } | 4106 | } |
| 4093 | 4107 | ||
| 4094 | err = nlmsg_parse_strict(nlh, sizeof(struct ndmsg), tb, NDA_MAX, | 4108 | err = nlmsg_parse_deprecated_strict(nlh, sizeof(struct ndmsg), tb, |
| 4095 | nda_policy, extack); | 4109 | NDA_MAX, nda_policy, extack); |
| 4096 | if (err < 0) | 4110 | if (err < 0) |
| 4097 | return err; | 4111 | return err; |
| 4098 | 4112 | ||
| @@ -4354,11 +4368,14 @@ static int valid_bridge_getlink_req(const struct nlmsghdr *nlh, | |||
| 4354 | return -EINVAL; | 4368 | return -EINVAL; |
| 4355 | } | 4369 | } |
| 4356 | 4370 | ||
| 4357 | err = nlmsg_parse_strict(nlh, sizeof(struct ifinfomsg), tb, | 4371 | err = nlmsg_parse_deprecated_strict(nlh, |
| 4358 | IFLA_MAX, ifla_policy, extack); | 4372 | sizeof(struct ifinfomsg), |
| 4373 | tb, IFLA_MAX, ifla_policy, | ||
| 4374 | extack); | ||
| 4359 | } else { | 4375 | } else { |
| 4360 | err = nlmsg_parse(nlh, sizeof(struct ifinfomsg), tb, | 4376 | err = nlmsg_parse_deprecated(nlh, sizeof(struct ifinfomsg), |
| 4361 | IFLA_MAX, ifla_policy, extack); | 4377 | tb, IFLA_MAX, ifla_policy, |
| 4378 | extack); | ||
| 4362 | } | 4379 | } |
| 4363 | if (err < 0) | 4380 | if (err < 0) |
| 4364 | return err; | 4381 | return err; |
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c index 3fd3aa7348bd..ceff9d22deea 100644 --- a/net/dcb/dcbnl.c +++ b/net/dcb/dcbnl.c | |||
| @@ -241,8 +241,9 @@ static int dcbnl_getpfccfg(struct net_device *netdev, struct nlmsghdr *nlh, | |||
| 241 | if (!netdev->dcbnl_ops->getpfccfg) | 241 | if (!netdev->dcbnl_ops->getpfccfg) |
| 242 | return -EOPNOTSUPP; | 242 | return -EOPNOTSUPP; |
| 243 | 243 | ||
| 244 | ret = nla_parse_nested(data, DCB_PFC_UP_ATTR_MAX, | 244 | ret = nla_parse_nested_deprecated(data, DCB_PFC_UP_ATTR_MAX, |
| 245 | tb[DCB_ATTR_PFC_CFG], dcbnl_pfc_up_nest, NULL); | 245 | tb[DCB_ATTR_PFC_CFG], |
| 246 | dcbnl_pfc_up_nest, NULL); | ||
| 246 | if (ret) | 247 | if (ret) |
| 247 | return ret; | 248 | return ret; |
| 248 | 249 | ||
| @@ -299,8 +300,9 @@ static int dcbnl_getcap(struct net_device *netdev, struct nlmsghdr *nlh, | |||
| 299 | if (!netdev->dcbnl_ops->getcap) | 300 | if (!netdev->dcbnl_ops->getcap) |
| 300 | return -EOPNOTSUPP; | 301 | return -EOPNOTSUPP; |
| 301 | 302 | ||
| 302 | ret = nla_parse_nested(data, DCB_CAP_ATTR_MAX, tb[DCB_ATTR_CAP], | 303 | ret = nla_parse_nested_deprecated(data, DCB_CAP_ATTR_MAX, |
| 303 | dcbnl_cap_nest, NULL); | 304 | tb[DCB_ATTR_CAP], dcbnl_cap_nest, |
| 305 | NULL); | ||
| 304 | if (ret) | 306 | if (ret) |
| 305 | return ret; | 307 | return ret; |
| 306 | 308 | ||
| @@ -343,8 +345,9 @@ static int dcbnl_getnumtcs(struct net_device *netdev, struct nlmsghdr *nlh, | |||
| 343 | if (!netdev->dcbnl_ops->getnumtcs) | 345 | if (!netdev->dcbnl_ops->getnumtcs) |
| 344 | return -EOPNOTSUPP; | 346 | return -EOPNOTSUPP; |
| 345 | 347 | ||
| 346 | ret = nla_parse_nested(data, DCB_NUMTCS_ATTR_MAX, tb[DCB_ATTR_NUMTCS], | 348 | ret = nla_parse_nested_deprecated(data, DCB_NUMTCS_ATTR_MAX, |
| 347 | dcbnl_numtcs_nest, NULL); | 349 | tb[DCB_ATTR_NUMTCS], |
| 350 | dcbnl_numtcs_nest, NULL); | ||
| 348 | if (ret) | 351 | if (ret) |
| 349 | return ret; | 352 | return ret; |
| 350 | 353 | ||
| @@ -388,8 +391,9 @@ static int dcbnl_setnumtcs(struct net_device *netdev, struct nlmsghdr *nlh, | |||
| 388 | if (!netdev->dcbnl_ops->setnumtcs) | 391 | if (!netdev->dcbnl_ops->setnumtcs) |
| 389 | return -EOPNOTSUPP; | 392 | return -EOPNOTSUPP; |
| 390 | 393 | ||
| 391 | ret = nla_parse_nested(data, DCB_NUMTCS_ATTR_MAX, tb[DCB_ATTR_NUMTCS], | 394 | ret = nla_parse_nested_deprecated(data, DCB_NUMTCS_ATTR_MAX, |
| 392 | dcbnl_numtcs_nest, NULL); | 395 | tb[DCB_ATTR_NUMTCS], |
| 396 | dcbnl_numtcs_nest, NULL); | ||
| 393 | if (ret) | 397 | if (ret) |
| 394 | return ret; | 398 | return ret; |
| 395 | 399 | ||
| @@ -447,8 +451,9 @@ static int dcbnl_getapp(struct net_device *netdev, struct nlmsghdr *nlh, | |||
| 447 | if (!tb[DCB_ATTR_APP]) | 451 | if (!tb[DCB_ATTR_APP]) |
| 448 | return -EINVAL; | 452 | return -EINVAL; |
| 449 | 453 | ||
| 450 | ret = nla_parse_nested(app_tb, DCB_APP_ATTR_MAX, tb[DCB_ATTR_APP], | 454 | ret = nla_parse_nested_deprecated(app_tb, DCB_APP_ATTR_MAX, |
| 451 | dcbnl_app_nest, NULL); | 455 | tb[DCB_ATTR_APP], dcbnl_app_nest, |
| 456 | NULL); | ||
| 452 | if (ret) | 457 | if (ret) |
| 453 | return ret; | 458 | return ret; |
| 454 | 459 | ||
| @@ -515,8 +520,9 @@ static int dcbnl_setapp(struct net_device *netdev, struct nlmsghdr *nlh, | |||
| 515 | if (!tb[DCB_ATTR_APP]) | 520 | if (!tb[DCB_ATTR_APP]) |
| 516 | return -EINVAL; | 521 | return -EINVAL; |
| 517 | 522 | ||
| 518 | ret = nla_parse_nested(app_tb, DCB_APP_ATTR_MAX, tb[DCB_ATTR_APP], | 523 | ret = nla_parse_nested_deprecated(app_tb, DCB_APP_ATTR_MAX, |
| 519 | dcbnl_app_nest, NULL); | 524 | tb[DCB_ATTR_APP], dcbnl_app_nest, |
| 525 | NULL); | ||
| 520 | if (ret) | 526 | if (ret) |
| 521 | return ret; | 527 | return ret; |
| 522 | 528 | ||
| @@ -573,8 +579,9 @@ static int __dcbnl_pg_getcfg(struct net_device *netdev, struct nlmsghdr *nlh, | |||
| 573 | !netdev->dcbnl_ops->getpgbwgcfgrx) | 579 | !netdev->dcbnl_ops->getpgbwgcfgrx) |
| 574 | return -EOPNOTSUPP; | 580 | return -EOPNOTSUPP; |
| 575 | 581 | ||
| 576 | ret = nla_parse_nested(pg_tb, DCB_PG_ATTR_MAX, tb[DCB_ATTR_PG_CFG], | 582 | ret = nla_parse_nested_deprecated(pg_tb, DCB_PG_ATTR_MAX, |
| 577 | dcbnl_pg_nest, NULL); | 583 | tb[DCB_ATTR_PG_CFG], dcbnl_pg_nest, |
| 584 | NULL); | ||
| 578 | if (ret) | 585 | if (ret) |
| 579 | return ret; | 586 | return ret; |
| 580 | 587 | ||
| @@ -593,8 +600,9 @@ static int __dcbnl_pg_getcfg(struct net_device *netdev, struct nlmsghdr *nlh, | |||
| 593 | data = pg_tb[DCB_PG_ATTR_TC_ALL]; | 600 | data = pg_tb[DCB_PG_ATTR_TC_ALL]; |
| 594 | else | 601 | else |
| 595 | data = pg_tb[i]; | 602 | data = pg_tb[i]; |
| 596 | ret = nla_parse_nested(param_tb, DCB_TC_ATTR_PARAM_MAX, data, | 603 | ret = nla_parse_nested_deprecated(param_tb, |
| 597 | dcbnl_tc_param_nest, NULL); | 604 | DCB_TC_ATTR_PARAM_MAX, data, |
| 605 | dcbnl_tc_param_nest, NULL); | ||
| 598 | if (ret) | 606 | if (ret) |
| 599 | goto err_pg; | 607 | goto err_pg; |
| 600 | 608 | ||
| @@ -730,8 +738,9 @@ static int dcbnl_setpfccfg(struct net_device *netdev, struct nlmsghdr *nlh, | |||
| 730 | if (!netdev->dcbnl_ops->setpfccfg) | 738 | if (!netdev->dcbnl_ops->setpfccfg) |
| 731 | return -EOPNOTSUPP; | 739 | return -EOPNOTSUPP; |
| 732 | 740 | ||
| 733 | ret = nla_parse_nested(data, DCB_PFC_UP_ATTR_MAX, | 741 | ret = nla_parse_nested_deprecated(data, DCB_PFC_UP_ATTR_MAX, |
| 734 | tb[DCB_ATTR_PFC_CFG], dcbnl_pfc_up_nest, NULL); | 742 | tb[DCB_ATTR_PFC_CFG], |
| 743 | dcbnl_pfc_up_nest, NULL); | ||
| 735 | if (ret) | 744 | if (ret) |
| 736 | return ret; | 745 | return ret; |
| 737 | 746 | ||
| @@ -786,8 +795,9 @@ static int __dcbnl_pg_setcfg(struct net_device *netdev, struct nlmsghdr *nlh, | |||
| 786 | !netdev->dcbnl_ops->setpgbwgcfgrx) | 795 | !netdev->dcbnl_ops->setpgbwgcfgrx) |
| 787 | return -EOPNOTSUPP; | 796 | return -EOPNOTSUPP; |
| 788 | 797 | ||
| 789 | ret = nla_parse_nested(pg_tb, DCB_PG_ATTR_MAX, tb[DCB_ATTR_PG_CFG], | 798 | ret = nla_parse_nested_deprecated(pg_tb, DCB_PG_ATTR_MAX, |
| 790 | dcbnl_pg_nest, NULL); | 799 | tb[DCB_ATTR_PG_CFG], dcbnl_pg_nest, |
| 800 | NULL); | ||
| 791 | if (ret) | 801 | if (ret) |
| 792 | return ret; | 802 | return ret; |
| 793 | 803 | ||
| @@ -795,8 +805,10 @@ static int __dcbnl_pg_setcfg(struct net_device *netdev, struct nlmsghdr *nlh, | |||
| 795 | if (!pg_tb[i]) | 805 | if (!pg_tb[i]) |
| 796 | continue; | 806 | continue; |
| 797 | 807 | ||
| 798 | ret = nla_parse_nested(param_tb, DCB_TC_ATTR_PARAM_MAX, | 808 | ret = nla_parse_nested_deprecated(param_tb, |
| 799 | pg_tb[i], dcbnl_tc_param_nest, NULL); | 809 | DCB_TC_ATTR_PARAM_MAX, |
| 810 | pg_tb[i], | ||
| 811 | dcbnl_tc_param_nest, NULL); | ||
| 800 | if (ret) | 812 | if (ret) |
| 801 | return ret; | 813 | return ret; |
| 802 | 814 | ||
| @@ -884,8 +896,9 @@ static int dcbnl_bcn_getcfg(struct net_device *netdev, struct nlmsghdr *nlh, | |||
| 884 | !netdev->dcbnl_ops->getbcncfg) | 896 | !netdev->dcbnl_ops->getbcncfg) |
| 885 | return -EOPNOTSUPP; | 897 | return -EOPNOTSUPP; |
| 886 | 898 | ||
| 887 | ret = nla_parse_nested(bcn_tb, DCB_BCN_ATTR_MAX, tb[DCB_ATTR_BCN], | 899 | ret = nla_parse_nested_deprecated(bcn_tb, DCB_BCN_ATTR_MAX, |
| 888 | dcbnl_bcn_nest, NULL); | 900 | tb[DCB_ATTR_BCN], dcbnl_bcn_nest, |
| 901 | NULL); | ||
| 889 | if (ret) | 902 | if (ret) |
| 890 | return ret; | 903 | return ret; |
| 891 | 904 | ||
| @@ -943,8 +956,9 @@ static int dcbnl_bcn_setcfg(struct net_device *netdev, struct nlmsghdr *nlh, | |||
| 943 | !netdev->dcbnl_ops->setbcnrp) | 956 | !netdev->dcbnl_ops->setbcnrp) |
| 944 | return -EOPNOTSUPP; | 957 | return -EOPNOTSUPP; |
| 945 | 958 | ||
| 946 | ret = nla_parse_nested(data, DCB_BCN_ATTR_MAX, tb[DCB_ATTR_BCN], | 959 | ret = nla_parse_nested_deprecated(data, DCB_BCN_ATTR_MAX, |
| 947 | dcbnl_pfc_up_nest, NULL); | 960 | tb[DCB_ATTR_BCN], dcbnl_pfc_up_nest, |
| 961 | NULL); | ||
| 948 | if (ret) | 962 | if (ret) |
| 949 | return ret; | 963 | return ret; |
| 950 | 964 | ||
| @@ -1431,8 +1445,9 @@ static int dcbnl_ieee_set(struct net_device *netdev, struct nlmsghdr *nlh, | |||
| 1431 | if (!tb[DCB_ATTR_IEEE]) | 1445 | if (!tb[DCB_ATTR_IEEE]) |
| 1432 | return -EINVAL; | 1446 | return -EINVAL; |
| 1433 | 1447 | ||
| 1434 | err = nla_parse_nested(ieee, DCB_ATTR_IEEE_MAX, tb[DCB_ATTR_IEEE], | 1448 | err = nla_parse_nested_deprecated(ieee, DCB_ATTR_IEEE_MAX, |
| 1435 | dcbnl_ieee_policy, NULL); | 1449 | tb[DCB_ATTR_IEEE], |
| 1450 | dcbnl_ieee_policy, NULL); | ||
| 1436 | if (err) | 1451 | if (err) |
| 1437 | return err; | 1452 | return err; |
| 1438 | 1453 | ||
| @@ -1531,8 +1546,9 @@ static int dcbnl_ieee_del(struct net_device *netdev, struct nlmsghdr *nlh, | |||
| 1531 | if (!tb[DCB_ATTR_IEEE]) | 1546 | if (!tb[DCB_ATTR_IEEE]) |
| 1532 | return -EINVAL; | 1547 | return -EINVAL; |
| 1533 | 1548 | ||
| 1534 | err = nla_parse_nested(ieee, DCB_ATTR_IEEE_MAX, tb[DCB_ATTR_IEEE], | 1549 | err = nla_parse_nested_deprecated(ieee, DCB_ATTR_IEEE_MAX, |
| 1535 | dcbnl_ieee_policy, NULL); | 1550 | tb[DCB_ATTR_IEEE], |
| 1551 | dcbnl_ieee_policy, NULL); | ||
| 1536 | if (err) | 1552 | if (err) |
| 1537 | return err; | 1553 | return err; |
| 1538 | 1554 | ||
| @@ -1604,8 +1620,9 @@ static int dcbnl_getfeatcfg(struct net_device *netdev, struct nlmsghdr *nlh, | |||
| 1604 | if (!tb[DCB_ATTR_FEATCFG]) | 1620 | if (!tb[DCB_ATTR_FEATCFG]) |
| 1605 | return -EINVAL; | 1621 | return -EINVAL; |
| 1606 | 1622 | ||
| 1607 | ret = nla_parse_nested(data, DCB_FEATCFG_ATTR_MAX, | 1623 | ret = nla_parse_nested_deprecated(data, DCB_FEATCFG_ATTR_MAX, |
| 1608 | tb[DCB_ATTR_FEATCFG], dcbnl_featcfg_nest, NULL); | 1624 | tb[DCB_ATTR_FEATCFG], |
| 1625 | dcbnl_featcfg_nest, NULL); | ||
| 1609 | if (ret) | 1626 | if (ret) |
| 1610 | return ret; | 1627 | return ret; |
| 1611 | 1628 | ||
| @@ -1648,8 +1665,9 @@ static int dcbnl_setfeatcfg(struct net_device *netdev, struct nlmsghdr *nlh, | |||
| 1648 | if (!tb[DCB_ATTR_FEATCFG]) | 1665 | if (!tb[DCB_ATTR_FEATCFG]) |
| 1649 | return -EINVAL; | 1666 | return -EINVAL; |
| 1650 | 1667 | ||
| 1651 | ret = nla_parse_nested(data, DCB_FEATCFG_ATTR_MAX, | 1668 | ret = nla_parse_nested_deprecated(data, DCB_FEATCFG_ATTR_MAX, |
| 1652 | tb[DCB_ATTR_FEATCFG], dcbnl_featcfg_nest, NULL); | 1669 | tb[DCB_ATTR_FEATCFG], |
| 1670 | dcbnl_featcfg_nest, NULL); | ||
| 1653 | 1671 | ||
| 1654 | if (ret) | 1672 | if (ret) |
| 1655 | goto err; | 1673 | goto err; |
| @@ -1738,8 +1756,8 @@ static int dcb_doit(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 1738 | if ((nlh->nlmsg_type == RTM_SETDCB) && !netlink_capable(skb, CAP_NET_ADMIN)) | 1756 | if ((nlh->nlmsg_type == RTM_SETDCB) && !netlink_capable(skb, CAP_NET_ADMIN)) |
| 1739 | return -EPERM; | 1757 | return -EPERM; |
| 1740 | 1758 | ||
| 1741 | ret = nlmsg_parse(nlh, sizeof(*dcb), tb, DCB_ATTR_MAX, | 1759 | ret = nlmsg_parse_deprecated(nlh, sizeof(*dcb), tb, DCB_ATTR_MAX, |
| 1742 | dcbnl_rtnl_policy, extack); | 1760 | dcbnl_rtnl_policy, extack); |
| 1743 | if (ret < 0) | 1761 | if (ret < 0) |
| 1744 | return ret; | 1762 | return ret; |
| 1745 | 1763 | ||
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c index 0962f9201baa..cca7ae712995 100644 --- a/net/decnet/dn_dev.c +++ b/net/decnet/dn_dev.c | |||
| @@ -583,8 +583,8 @@ static int dn_nl_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 583 | if (!net_eq(net, &init_net)) | 583 | if (!net_eq(net, &init_net)) |
| 584 | goto errout; | 584 | goto errout; |
| 585 | 585 | ||
| 586 | err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, dn_ifa_policy, | 586 | err = nlmsg_parse_deprecated(nlh, sizeof(*ifm), tb, IFA_MAX, |
| 587 | extack); | 587 | dn_ifa_policy, extack); |
| 588 | if (err < 0) | 588 | if (err < 0) |
| 589 | goto errout; | 589 | goto errout; |
| 590 | 590 | ||
| @@ -629,8 +629,8 @@ static int dn_nl_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 629 | if (!net_eq(net, &init_net)) | 629 | if (!net_eq(net, &init_net)) |
| 630 | return -EINVAL; | 630 | return -EINVAL; |
| 631 | 631 | ||
| 632 | err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, dn_ifa_policy, | 632 | err = nlmsg_parse_deprecated(nlh, sizeof(*ifm), tb, IFA_MAX, |
| 633 | extack); | 633 | dn_ifa_policy, extack); |
| 634 | if (err < 0) | 634 | if (err < 0) |
| 635 | return err; | 635 | return err; |
| 636 | 636 | ||
diff --git a/net/decnet/dn_fib.c b/net/decnet/dn_fib.c index 7e47ffdd1412..77fbf8e9df4b 100644 --- a/net/decnet/dn_fib.c +++ b/net/decnet/dn_fib.c | |||
| @@ -517,8 +517,8 @@ static int dn_fib_rtm_delroute(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 517 | if (!net_eq(net, &init_net)) | 517 | if (!net_eq(net, &init_net)) |
| 518 | return -EINVAL; | 518 | return -EINVAL; |
| 519 | 519 | ||
| 520 | err = nlmsg_parse(nlh, sizeof(*r), attrs, RTA_MAX, rtm_dn_policy, | 520 | err = nlmsg_parse_deprecated(nlh, sizeof(*r), attrs, RTA_MAX, |
| 521 | extack); | 521 | rtm_dn_policy, extack); |
| 522 | if (err < 0) | 522 | if (err < 0) |
| 523 | return err; | 523 | return err; |
| 524 | 524 | ||
| @@ -544,8 +544,8 @@ static int dn_fib_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 544 | if (!net_eq(net, &init_net)) | 544 | if (!net_eq(net, &init_net)) |
| 545 | return -EINVAL; | 545 | return -EINVAL; |
| 546 | 546 | ||
| 547 | err = nlmsg_parse(nlh, sizeof(*r), attrs, RTA_MAX, rtm_dn_policy, | 547 | err = nlmsg_parse_deprecated(nlh, sizeof(*r), attrs, RTA_MAX, |
| 548 | extack); | 548 | rtm_dn_policy, extack); |
| 549 | if (err < 0) | 549 | if (err < 0) |
| 550 | return err; | 550 | return err; |
| 551 | 551 | ||
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c index 950613ee7881..664584763c36 100644 --- a/net/decnet/dn_route.c +++ b/net/decnet/dn_route.c | |||
| @@ -1651,8 +1651,8 @@ static int dn_cache_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, | |||
| 1651 | if (!net_eq(net, &init_net)) | 1651 | if (!net_eq(net, &init_net)) |
| 1652 | return -EINVAL; | 1652 | return -EINVAL; |
| 1653 | 1653 | ||
| 1654 | err = nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, rtm_dn_policy, | 1654 | err = nlmsg_parse_deprecated(nlh, sizeof(*rtm), tb, RTA_MAX, |
| 1655 | extack); | 1655 | rtm_dn_policy, extack); |
| 1656 | if (err < 0) | 1656 | if (err < 0) |
| 1657 | return err; | 1657 | return err; |
| 1658 | 1658 | ||
diff --git a/net/hsr/hsr_netlink.c b/net/hsr/hsr_netlink.c index c2d5a368d6d8..8f8337f893ba 100644 --- a/net/hsr/hsr_netlink.c +++ b/net/hsr/hsr_netlink.c | |||
| @@ -437,12 +437,14 @@ fail: | |||
| 437 | static const struct genl_ops hsr_ops[] = { | 437 | static const struct genl_ops hsr_ops[] = { |
| 438 | { | 438 | { |
| 439 | .cmd = HSR_C_GET_NODE_STATUS, | 439 | .cmd = HSR_C_GET_NODE_STATUS, |
| 440 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 440 | .flags = 0, | 441 | .flags = 0, |
| 441 | .doit = hsr_get_node_status, | 442 | .doit = hsr_get_node_status, |
| 442 | .dumpit = NULL, | 443 | .dumpit = NULL, |
| 443 | }, | 444 | }, |
| 444 | { | 445 | { |
| 445 | .cmd = HSR_C_GET_NODE_LIST, | 446 | .cmd = HSR_C_GET_NODE_LIST, |
| 447 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 446 | .flags = 0, | 448 | .flags = 0, |
| 447 | .doit = hsr_get_node_list, | 449 | .doit = hsr_get_node_list, |
| 448 | .dumpit = NULL, | 450 | .dumpit = NULL, |
diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c index 1a002eb85096..e4c4174f9efb 100644 --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c | |||
| @@ -247,9 +247,11 @@ nl802154_prepare_wpan_dev_dump(struct sk_buff *skb, | |||
| 247 | rtnl_lock(); | 247 | rtnl_lock(); |
| 248 | 248 | ||
| 249 | if (!cb->args[0]) { | 249 | if (!cb->args[0]) { |
| 250 | err = nlmsg_parse(cb->nlh, GENL_HDRLEN + nl802154_fam.hdrsize, | 250 | err = nlmsg_parse_deprecated(cb->nlh, |
| 251 | genl_family_attrbuf(&nl802154_fam), | 251 | GENL_HDRLEN + nl802154_fam.hdrsize, |
| 252 | nl802154_fam.maxattr, nl802154_policy, NULL); | 252 | genl_family_attrbuf(&nl802154_fam), |
| 253 | nl802154_fam.maxattr, | ||
| 254 | nl802154_policy, NULL); | ||
| 253 | if (err) | 255 | if (err) |
| 254 | goto out_unlock; | 256 | goto out_unlock; |
| 255 | 257 | ||
| @@ -562,8 +564,10 @@ static int nl802154_dump_wpan_phy_parse(struct sk_buff *skb, | |||
| 562 | struct nl802154_dump_wpan_phy_state *state) | 564 | struct nl802154_dump_wpan_phy_state *state) |
| 563 | { | 565 | { |
| 564 | struct nlattr **tb = genl_family_attrbuf(&nl802154_fam); | 566 | struct nlattr **tb = genl_family_attrbuf(&nl802154_fam); |
| 565 | int ret = nlmsg_parse(cb->nlh, GENL_HDRLEN + nl802154_fam.hdrsize, tb, | 567 | int ret = nlmsg_parse_deprecated(cb->nlh, |
| 566 | nl802154_fam.maxattr, nl802154_policy, NULL); | 568 | GENL_HDRLEN + nl802154_fam.hdrsize, |
| 569 | tb, nl802154_fam.maxattr, | ||
| 570 | nl802154_policy, NULL); | ||
| 567 | 571 | ||
| 568 | /* TODO check if we can handle error here, | 572 | /* TODO check if we can handle error here, |
| 569 | * we have no backward compatibility | 573 | * we have no backward compatibility |
| @@ -1308,8 +1312,7 @@ ieee802154_llsec_parse_dev_addr(struct nlattr *nla, | |||
| 1308 | { | 1312 | { |
| 1309 | struct nlattr *attrs[NL802154_DEV_ADDR_ATTR_MAX + 1]; | 1313 | struct nlattr *attrs[NL802154_DEV_ADDR_ATTR_MAX + 1]; |
| 1310 | 1314 | ||
| 1311 | if (!nla || nla_parse_nested(attrs, NL802154_DEV_ADDR_ATTR_MAX, nla, | 1315 | if (!nla || nla_parse_nested_deprecated(attrs, NL802154_DEV_ADDR_ATTR_MAX, nla, nl802154_dev_addr_policy, NULL)) |
| 1312 | nl802154_dev_addr_policy, NULL)) | ||
| 1313 | return -EINVAL; | 1316 | return -EINVAL; |
| 1314 | 1317 | ||
| 1315 | if (!attrs[NL802154_DEV_ADDR_ATTR_PAN_ID] || | 1318 | if (!attrs[NL802154_DEV_ADDR_ATTR_PAN_ID] || |
| @@ -1348,8 +1351,7 @@ ieee802154_llsec_parse_key_id(struct nlattr *nla, | |||
| 1348 | { | 1351 | { |
| 1349 | struct nlattr *attrs[NL802154_KEY_ID_ATTR_MAX + 1]; | 1352 | struct nlattr *attrs[NL802154_KEY_ID_ATTR_MAX + 1]; |
| 1350 | 1353 | ||
| 1351 | if (!nla || nla_parse_nested(attrs, NL802154_KEY_ID_ATTR_MAX, nla, | 1354 | if (!nla || nla_parse_nested_deprecated(attrs, NL802154_KEY_ID_ATTR_MAX, nla, nl802154_key_id_policy, NULL)) |
| 1352 | nl802154_key_id_policy, NULL)) | ||
| 1353 | return -EINVAL; | 1355 | return -EINVAL; |
| 1354 | 1356 | ||
| 1355 | if (!attrs[NL802154_KEY_ID_ATTR_MODE]) | 1357 | if (!attrs[NL802154_KEY_ID_ATTR_MODE]) |
| @@ -1564,9 +1566,7 @@ static int nl802154_add_llsec_key(struct sk_buff *skb, struct genl_info *info) | |||
| 1564 | struct ieee802154_llsec_key_id id = { }; | 1566 | struct ieee802154_llsec_key_id id = { }; |
| 1565 | u32 commands[NL802154_CMD_FRAME_NR_IDS / 32] = { }; | 1567 | u32 commands[NL802154_CMD_FRAME_NR_IDS / 32] = { }; |
| 1566 | 1568 | ||
| 1567 | if (nla_parse_nested(attrs, NL802154_KEY_ATTR_MAX, | 1569 | if (nla_parse_nested_deprecated(attrs, NL802154_KEY_ATTR_MAX, info->attrs[NL802154_ATTR_SEC_KEY], nl802154_key_policy, info->extack)) |
| 1568 | info->attrs[NL802154_ATTR_SEC_KEY], | ||
| 1569 | nl802154_key_policy, info->extack)) | ||
| 1570 | return -EINVAL; | 1570 | return -EINVAL; |
| 1571 | 1571 | ||
| 1572 | if (!attrs[NL802154_KEY_ATTR_USAGE_FRAMES] || | 1572 | if (!attrs[NL802154_KEY_ATTR_USAGE_FRAMES] || |
| @@ -1614,9 +1614,7 @@ static int nl802154_del_llsec_key(struct sk_buff *skb, struct genl_info *info) | |||
| 1614 | struct nlattr *attrs[NL802154_KEY_ATTR_MAX + 1]; | 1614 | struct nlattr *attrs[NL802154_KEY_ATTR_MAX + 1]; |
| 1615 | struct ieee802154_llsec_key_id id; | 1615 | struct ieee802154_llsec_key_id id; |
| 1616 | 1616 | ||
| 1617 | if (nla_parse_nested(attrs, NL802154_KEY_ATTR_MAX, | 1617 | if (nla_parse_nested_deprecated(attrs, NL802154_KEY_ATTR_MAX, info->attrs[NL802154_ATTR_SEC_KEY], nl802154_key_policy, info->extack)) |
| 1618 | info->attrs[NL802154_ATTR_SEC_KEY], | ||
| 1619 | nl802154_key_policy, info->extack)) | ||
| 1620 | return -EINVAL; | 1618 | return -EINVAL; |
| 1621 | 1619 | ||
| 1622 | if (ieee802154_llsec_parse_key_id(attrs[NL802154_KEY_ATTR_ID], &id) < 0) | 1620 | if (ieee802154_llsec_parse_key_id(attrs[NL802154_KEY_ATTR_ID], &id) < 0) |
| @@ -1730,8 +1728,7 @@ ieee802154_llsec_parse_device(struct nlattr *nla, | |||
| 1730 | { | 1728 | { |
| 1731 | struct nlattr *attrs[NL802154_DEV_ATTR_MAX + 1]; | 1729 | struct nlattr *attrs[NL802154_DEV_ATTR_MAX + 1]; |
| 1732 | 1730 | ||
| 1733 | if (!nla || nla_parse_nested(attrs, NL802154_DEV_ATTR_MAX, | 1731 | if (!nla || nla_parse_nested_deprecated(attrs, NL802154_DEV_ATTR_MAX, nla, nl802154_dev_policy, NULL)) |
| 1734 | nla, nl802154_dev_policy, NULL)) | ||
| 1735 | return -EINVAL; | 1732 | return -EINVAL; |
| 1736 | 1733 | ||
| 1737 | memset(dev, 0, sizeof(*dev)); | 1734 | memset(dev, 0, sizeof(*dev)); |
| @@ -1782,9 +1779,7 @@ static int nl802154_del_llsec_dev(struct sk_buff *skb, struct genl_info *info) | |||
| 1782 | struct nlattr *attrs[NL802154_DEV_ATTR_MAX + 1]; | 1779 | struct nlattr *attrs[NL802154_DEV_ATTR_MAX + 1]; |
| 1783 | __le64 extended_addr; | 1780 | __le64 extended_addr; |
| 1784 | 1781 | ||
| 1785 | if (nla_parse_nested(attrs, NL802154_DEV_ATTR_MAX, | 1782 | if (nla_parse_nested_deprecated(attrs, NL802154_DEV_ATTR_MAX, info->attrs[NL802154_ATTR_SEC_DEVICE], nl802154_dev_policy, info->extack)) |
| 1786 | info->attrs[NL802154_ATTR_SEC_DEVICE], | ||
| 1787 | nl802154_dev_policy, info->extack)) | ||
| 1788 | return -EINVAL; | 1783 | return -EINVAL; |
| 1789 | 1784 | ||
| 1790 | if (!attrs[NL802154_DEV_ATTR_EXTENDED_ADDR]) | 1785 | if (!attrs[NL802154_DEV_ATTR_EXTENDED_ADDR]) |
| @@ -1910,9 +1905,7 @@ static int nl802154_add_llsec_devkey(struct sk_buff *skb, struct genl_info *info | |||
| 1910 | __le64 extended_addr; | 1905 | __le64 extended_addr; |
| 1911 | 1906 | ||
| 1912 | if (!info->attrs[NL802154_ATTR_SEC_DEVKEY] || | 1907 | if (!info->attrs[NL802154_ATTR_SEC_DEVKEY] || |
| 1913 | nla_parse_nested(attrs, NL802154_DEVKEY_ATTR_MAX, | 1908 | nla_parse_nested_deprecated(attrs, NL802154_DEVKEY_ATTR_MAX, info->attrs[NL802154_ATTR_SEC_DEVKEY], nl802154_devkey_policy, info->extack) < 0) |
| 1914 | info->attrs[NL802154_ATTR_SEC_DEVKEY], | ||
| 1915 | nl802154_devkey_policy, info->extack) < 0) | ||
| 1916 | return -EINVAL; | 1909 | return -EINVAL; |
| 1917 | 1910 | ||
| 1918 | if (!attrs[NL802154_DEVKEY_ATTR_FRAME_COUNTER] || | 1911 | if (!attrs[NL802154_DEVKEY_ATTR_FRAME_COUNTER] || |
| @@ -1942,9 +1935,7 @@ static int nl802154_del_llsec_devkey(struct sk_buff *skb, struct genl_info *info | |||
| 1942 | struct ieee802154_llsec_device_key key; | 1935 | struct ieee802154_llsec_device_key key; |
| 1943 | __le64 extended_addr; | 1936 | __le64 extended_addr; |
| 1944 | 1937 | ||
| 1945 | if (nla_parse_nested(attrs, NL802154_DEVKEY_ATTR_MAX, | 1938 | if (nla_parse_nested_deprecated(attrs, NL802154_DEVKEY_ATTR_MAX, info->attrs[NL802154_ATTR_SEC_DEVKEY], nl802154_devkey_policy, info->extack)) |
| 1946 | info->attrs[NL802154_ATTR_SEC_DEVKEY], | ||
| 1947 | nl802154_devkey_policy, info->extack)) | ||
| 1948 | return -EINVAL; | 1939 | return -EINVAL; |
| 1949 | 1940 | ||
| 1950 | if (!attrs[NL802154_DEVKEY_ATTR_EXTENDED_ADDR]) | 1941 | if (!attrs[NL802154_DEVKEY_ATTR_EXTENDED_ADDR]) |
| @@ -2064,8 +2055,7 @@ llsec_parse_seclevel(struct nlattr *nla, struct ieee802154_llsec_seclevel *sl) | |||
| 2064 | { | 2055 | { |
| 2065 | struct nlattr *attrs[NL802154_SECLEVEL_ATTR_MAX + 1]; | 2056 | struct nlattr *attrs[NL802154_SECLEVEL_ATTR_MAX + 1]; |
| 2066 | 2057 | ||
| 2067 | if (!nla || nla_parse_nested(attrs, NL802154_SECLEVEL_ATTR_MAX, | 2058 | if (!nla || nla_parse_nested_deprecated(attrs, NL802154_SECLEVEL_ATTR_MAX, nla, nl802154_seclevel_policy, NULL)) |
| 2068 | nla, nl802154_seclevel_policy, NULL)) | ||
| 2069 | return -EINVAL; | 2059 | return -EINVAL; |
| 2070 | 2060 | ||
| 2071 | memset(sl, 0, sizeof(*sl)); | 2061 | memset(sl, 0, sizeof(*sl)); |
| @@ -2219,6 +2209,7 @@ static void nl802154_post_doit(const struct genl_ops *ops, struct sk_buff *skb, | |||
| 2219 | static const struct genl_ops nl802154_ops[] = { | 2209 | static const struct genl_ops nl802154_ops[] = { |
| 2220 | { | 2210 | { |
| 2221 | .cmd = NL802154_CMD_GET_WPAN_PHY, | 2211 | .cmd = NL802154_CMD_GET_WPAN_PHY, |
| 2212 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2222 | .doit = nl802154_get_wpan_phy, | 2213 | .doit = nl802154_get_wpan_phy, |
| 2223 | .dumpit = nl802154_dump_wpan_phy, | 2214 | .dumpit = nl802154_dump_wpan_phy, |
| 2224 | .done = nl802154_dump_wpan_phy_done, | 2215 | .done = nl802154_dump_wpan_phy_done, |
| @@ -2228,6 +2219,7 @@ static const struct genl_ops nl802154_ops[] = { | |||
| 2228 | }, | 2219 | }, |
| 2229 | { | 2220 | { |
| 2230 | .cmd = NL802154_CMD_GET_INTERFACE, | 2221 | .cmd = NL802154_CMD_GET_INTERFACE, |
| 2222 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2231 | .doit = nl802154_get_interface, | 2223 | .doit = nl802154_get_interface, |
| 2232 | .dumpit = nl802154_dump_interface, | 2224 | .dumpit = nl802154_dump_interface, |
| 2233 | /* can be retrieved by unprivileged users */ | 2225 | /* can be retrieved by unprivileged users */ |
| @@ -2236,6 +2228,7 @@ static const struct genl_ops nl802154_ops[] = { | |||
| 2236 | }, | 2228 | }, |
| 2237 | { | 2229 | { |
| 2238 | .cmd = NL802154_CMD_NEW_INTERFACE, | 2230 | .cmd = NL802154_CMD_NEW_INTERFACE, |
| 2231 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2239 | .doit = nl802154_new_interface, | 2232 | .doit = nl802154_new_interface, |
| 2240 | .flags = GENL_ADMIN_PERM, | 2233 | .flags = GENL_ADMIN_PERM, |
| 2241 | .internal_flags = NL802154_FLAG_NEED_WPAN_PHY | | 2234 | .internal_flags = NL802154_FLAG_NEED_WPAN_PHY | |
| @@ -2243,6 +2236,7 @@ static const struct genl_ops nl802154_ops[] = { | |||
| 2243 | }, | 2236 | }, |
| 2244 | { | 2237 | { |
| 2245 | .cmd = NL802154_CMD_DEL_INTERFACE, | 2238 | .cmd = NL802154_CMD_DEL_INTERFACE, |
| 2239 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2246 | .doit = nl802154_del_interface, | 2240 | .doit = nl802154_del_interface, |
| 2247 | .flags = GENL_ADMIN_PERM, | 2241 | .flags = GENL_ADMIN_PERM, |
| 2248 | .internal_flags = NL802154_FLAG_NEED_WPAN_DEV | | 2242 | .internal_flags = NL802154_FLAG_NEED_WPAN_DEV | |
| @@ -2250,6 +2244,7 @@ static const struct genl_ops nl802154_ops[] = { | |||
| 2250 | }, | 2244 | }, |
| 2251 | { | 2245 | { |
| 2252 | .cmd = NL802154_CMD_SET_CHANNEL, | 2246 | .cmd = NL802154_CMD_SET_CHANNEL, |
| 2247 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2253 | .doit = nl802154_set_channel, | 2248 | .doit = nl802154_set_channel, |
| 2254 | .flags = GENL_ADMIN_PERM, | 2249 | .flags = GENL_ADMIN_PERM, |
| 2255 | .internal_flags = NL802154_FLAG_NEED_WPAN_PHY | | 2250 | .internal_flags = NL802154_FLAG_NEED_WPAN_PHY | |
| @@ -2257,6 +2252,7 @@ static const struct genl_ops nl802154_ops[] = { | |||
| 2257 | }, | 2252 | }, |
| 2258 | { | 2253 | { |
| 2259 | .cmd = NL802154_CMD_SET_CCA_MODE, | 2254 | .cmd = NL802154_CMD_SET_CCA_MODE, |
| 2255 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2260 | .doit = nl802154_set_cca_mode, | 2256 | .doit = nl802154_set_cca_mode, |
| 2261 | .flags = GENL_ADMIN_PERM, | 2257 | .flags = GENL_ADMIN_PERM, |
| 2262 | .internal_flags = NL802154_FLAG_NEED_WPAN_PHY | | 2258 | .internal_flags = NL802154_FLAG_NEED_WPAN_PHY | |
| @@ -2264,6 +2260,7 @@ static const struct genl_ops nl802154_ops[] = { | |||
| 2264 | }, | 2260 | }, |
| 2265 | { | 2261 | { |
| 2266 | .cmd = NL802154_CMD_SET_CCA_ED_LEVEL, | 2262 | .cmd = NL802154_CMD_SET_CCA_ED_LEVEL, |
| 2263 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2267 | .doit = nl802154_set_cca_ed_level, | 2264 | .doit = nl802154_set_cca_ed_level, |
| 2268 | .flags = GENL_ADMIN_PERM, | 2265 | .flags = GENL_ADMIN_PERM, |
| 2269 | .internal_flags = NL802154_FLAG_NEED_WPAN_PHY | | 2266 | .internal_flags = NL802154_FLAG_NEED_WPAN_PHY | |
| @@ -2271,6 +2268,7 @@ static const struct genl_ops nl802154_ops[] = { | |||
| 2271 | }, | 2268 | }, |
| 2272 | { | 2269 | { |
| 2273 | .cmd = NL802154_CMD_SET_TX_POWER, | 2270 | .cmd = NL802154_CMD_SET_TX_POWER, |
| 2271 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2274 | .doit = nl802154_set_tx_power, | 2272 | .doit = nl802154_set_tx_power, |
| 2275 | .flags = GENL_ADMIN_PERM, | 2273 | .flags = GENL_ADMIN_PERM, |
| 2276 | .internal_flags = NL802154_FLAG_NEED_WPAN_PHY | | 2274 | .internal_flags = NL802154_FLAG_NEED_WPAN_PHY | |
| @@ -2278,6 +2276,7 @@ static const struct genl_ops nl802154_ops[] = { | |||
| 2278 | }, | 2276 | }, |
| 2279 | { | 2277 | { |
| 2280 | .cmd = NL802154_CMD_SET_WPAN_PHY_NETNS, | 2278 | .cmd = NL802154_CMD_SET_WPAN_PHY_NETNS, |
| 2279 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2281 | .doit = nl802154_wpan_phy_netns, | 2280 | .doit = nl802154_wpan_phy_netns, |
| 2282 | .flags = GENL_ADMIN_PERM, | 2281 | .flags = GENL_ADMIN_PERM, |
| 2283 | .internal_flags = NL802154_FLAG_NEED_WPAN_PHY | | 2282 | .internal_flags = NL802154_FLAG_NEED_WPAN_PHY | |
| @@ -2285,6 +2284,7 @@ static const struct genl_ops nl802154_ops[] = { | |||
| 2285 | }, | 2284 | }, |
| 2286 | { | 2285 | { |
| 2287 | .cmd = NL802154_CMD_SET_PAN_ID, | 2286 | .cmd = NL802154_CMD_SET_PAN_ID, |
| 2287 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2288 | .doit = nl802154_set_pan_id, | 2288 | .doit = nl802154_set_pan_id, |
| 2289 | .flags = GENL_ADMIN_PERM, | 2289 | .flags = GENL_ADMIN_PERM, |
| 2290 | .internal_flags = NL802154_FLAG_NEED_NETDEV | | 2290 | .internal_flags = NL802154_FLAG_NEED_NETDEV | |
| @@ -2292,6 +2292,7 @@ static const struct genl_ops nl802154_ops[] = { | |||
| 2292 | }, | 2292 | }, |
| 2293 | { | 2293 | { |
| 2294 | .cmd = NL802154_CMD_SET_SHORT_ADDR, | 2294 | .cmd = NL802154_CMD_SET_SHORT_ADDR, |
| 2295 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2295 | .doit = nl802154_set_short_addr, | 2296 | .doit = nl802154_set_short_addr, |
| 2296 | .flags = GENL_ADMIN_PERM, | 2297 | .flags = GENL_ADMIN_PERM, |
| 2297 | .internal_flags = NL802154_FLAG_NEED_NETDEV | | 2298 | .internal_flags = NL802154_FLAG_NEED_NETDEV | |
| @@ -2299,6 +2300,7 @@ static const struct genl_ops nl802154_ops[] = { | |||
| 2299 | }, | 2300 | }, |
| 2300 | { | 2301 | { |
| 2301 | .cmd = NL802154_CMD_SET_BACKOFF_EXPONENT, | 2302 | .cmd = NL802154_CMD_SET_BACKOFF_EXPONENT, |
| 2303 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2302 | .doit = nl802154_set_backoff_exponent, | 2304 | .doit = nl802154_set_backoff_exponent, |
| 2303 | .flags = GENL_ADMIN_PERM, | 2305 | .flags = GENL_ADMIN_PERM, |
| 2304 | .internal_flags = NL802154_FLAG_NEED_NETDEV | | 2306 | .internal_flags = NL802154_FLAG_NEED_NETDEV | |
| @@ -2306,6 +2308,7 @@ static const struct genl_ops nl802154_ops[] = { | |||
| 2306 | }, | 2308 | }, |
| 2307 | { | 2309 | { |
| 2308 | .cmd = NL802154_CMD_SET_MAX_CSMA_BACKOFFS, | 2310 | .cmd = NL802154_CMD_SET_MAX_CSMA_BACKOFFS, |
| 2311 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2309 | .doit = nl802154_set_max_csma_backoffs, | 2312 | .doit = nl802154_set_max_csma_backoffs, |
| 2310 | .flags = GENL_ADMIN_PERM, | 2313 | .flags = GENL_ADMIN_PERM, |
| 2311 | .internal_flags = NL802154_FLAG_NEED_NETDEV | | 2314 | .internal_flags = NL802154_FLAG_NEED_NETDEV | |
| @@ -2313,6 +2316,7 @@ static const struct genl_ops nl802154_ops[] = { | |||
| 2313 | }, | 2316 | }, |
| 2314 | { | 2317 | { |
| 2315 | .cmd = NL802154_CMD_SET_MAX_FRAME_RETRIES, | 2318 | .cmd = NL802154_CMD_SET_MAX_FRAME_RETRIES, |
| 2319 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2316 | .doit = nl802154_set_max_frame_retries, | 2320 | .doit = nl802154_set_max_frame_retries, |
| 2317 | .flags = GENL_ADMIN_PERM, | 2321 | .flags = GENL_ADMIN_PERM, |
| 2318 | .internal_flags = NL802154_FLAG_NEED_NETDEV | | 2322 | .internal_flags = NL802154_FLAG_NEED_NETDEV | |
| @@ -2320,6 +2324,7 @@ static const struct genl_ops nl802154_ops[] = { | |||
| 2320 | }, | 2324 | }, |
| 2321 | { | 2325 | { |
| 2322 | .cmd = NL802154_CMD_SET_LBT_MODE, | 2326 | .cmd = NL802154_CMD_SET_LBT_MODE, |
| 2327 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2323 | .doit = nl802154_set_lbt_mode, | 2328 | .doit = nl802154_set_lbt_mode, |
| 2324 | .flags = GENL_ADMIN_PERM, | 2329 | .flags = GENL_ADMIN_PERM, |
| 2325 | .internal_flags = NL802154_FLAG_NEED_NETDEV | | 2330 | .internal_flags = NL802154_FLAG_NEED_NETDEV | |
| @@ -2327,6 +2332,7 @@ static const struct genl_ops nl802154_ops[] = { | |||
| 2327 | }, | 2332 | }, |
| 2328 | { | 2333 | { |
| 2329 | .cmd = NL802154_CMD_SET_ACKREQ_DEFAULT, | 2334 | .cmd = NL802154_CMD_SET_ACKREQ_DEFAULT, |
| 2335 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2330 | .doit = nl802154_set_ackreq_default, | 2336 | .doit = nl802154_set_ackreq_default, |
| 2331 | .flags = GENL_ADMIN_PERM, | 2337 | .flags = GENL_ADMIN_PERM, |
| 2332 | .internal_flags = NL802154_FLAG_NEED_NETDEV | | 2338 | .internal_flags = NL802154_FLAG_NEED_NETDEV | |
| @@ -2335,6 +2341,7 @@ static const struct genl_ops nl802154_ops[] = { | |||
| 2335 | #ifdef CONFIG_IEEE802154_NL802154_EXPERIMENTAL | 2341 | #ifdef CONFIG_IEEE802154_NL802154_EXPERIMENTAL |
| 2336 | { | 2342 | { |
| 2337 | .cmd = NL802154_CMD_SET_SEC_PARAMS, | 2343 | .cmd = NL802154_CMD_SET_SEC_PARAMS, |
| 2344 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2338 | .doit = nl802154_set_llsec_params, | 2345 | .doit = nl802154_set_llsec_params, |
| 2339 | .flags = GENL_ADMIN_PERM, | 2346 | .flags = GENL_ADMIN_PERM, |
| 2340 | .internal_flags = NL802154_FLAG_NEED_NETDEV | | 2347 | .internal_flags = NL802154_FLAG_NEED_NETDEV | |
| @@ -2342,6 +2349,7 @@ static const struct genl_ops nl802154_ops[] = { | |||
| 2342 | }, | 2349 | }, |
| 2343 | { | 2350 | { |
| 2344 | .cmd = NL802154_CMD_GET_SEC_KEY, | 2351 | .cmd = NL802154_CMD_GET_SEC_KEY, |
| 2352 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2345 | /* TODO .doit by matching key id? */ | 2353 | /* TODO .doit by matching key id? */ |
| 2346 | .dumpit = nl802154_dump_llsec_key, | 2354 | .dumpit = nl802154_dump_llsec_key, |
| 2347 | .flags = GENL_ADMIN_PERM, | 2355 | .flags = GENL_ADMIN_PERM, |
| @@ -2350,6 +2358,7 @@ static const struct genl_ops nl802154_ops[] = { | |||
| 2350 | }, | 2358 | }, |
| 2351 | { | 2359 | { |
| 2352 | .cmd = NL802154_CMD_NEW_SEC_KEY, | 2360 | .cmd = NL802154_CMD_NEW_SEC_KEY, |
| 2361 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2353 | .doit = nl802154_add_llsec_key, | 2362 | .doit = nl802154_add_llsec_key, |
| 2354 | .flags = GENL_ADMIN_PERM, | 2363 | .flags = GENL_ADMIN_PERM, |
| 2355 | .internal_flags = NL802154_FLAG_NEED_NETDEV | | 2364 | .internal_flags = NL802154_FLAG_NEED_NETDEV | |
| @@ -2357,6 +2366,7 @@ static const struct genl_ops nl802154_ops[] = { | |||
| 2357 | }, | 2366 | }, |
| 2358 | { | 2367 | { |
| 2359 | .cmd = NL802154_CMD_DEL_SEC_KEY, | 2368 | .cmd = NL802154_CMD_DEL_SEC_KEY, |
| 2369 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2360 | .doit = nl802154_del_llsec_key, | 2370 | .doit = nl802154_del_llsec_key, |
| 2361 | .flags = GENL_ADMIN_PERM, | 2371 | .flags = GENL_ADMIN_PERM, |
| 2362 | .internal_flags = NL802154_FLAG_NEED_NETDEV | | 2372 | .internal_flags = NL802154_FLAG_NEED_NETDEV | |
| @@ -2365,6 +2375,7 @@ static const struct genl_ops nl802154_ops[] = { | |||
| 2365 | /* TODO unique identifier must short+pan OR extended_addr */ | 2375 | /* TODO unique identifier must short+pan OR extended_addr */ |
| 2366 | { | 2376 | { |
| 2367 | .cmd = NL802154_CMD_GET_SEC_DEV, | 2377 | .cmd = NL802154_CMD_GET_SEC_DEV, |
| 2378 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2368 | /* TODO .doit by matching extended_addr? */ | 2379 | /* TODO .doit by matching extended_addr? */ |
| 2369 | .dumpit = nl802154_dump_llsec_dev, | 2380 | .dumpit = nl802154_dump_llsec_dev, |
| 2370 | .flags = GENL_ADMIN_PERM, | 2381 | .flags = GENL_ADMIN_PERM, |
| @@ -2373,6 +2384,7 @@ static const struct genl_ops nl802154_ops[] = { | |||
| 2373 | }, | 2384 | }, |
| 2374 | { | 2385 | { |
| 2375 | .cmd = NL802154_CMD_NEW_SEC_DEV, | 2386 | .cmd = NL802154_CMD_NEW_SEC_DEV, |
| 2387 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2376 | .doit = nl802154_add_llsec_dev, | 2388 | .doit = nl802154_add_llsec_dev, |
| 2377 | .flags = GENL_ADMIN_PERM, | 2389 | .flags = GENL_ADMIN_PERM, |
| 2378 | .internal_flags = NL802154_FLAG_NEED_NETDEV | | 2390 | .internal_flags = NL802154_FLAG_NEED_NETDEV | |
| @@ -2380,6 +2392,7 @@ static const struct genl_ops nl802154_ops[] = { | |||
| 2380 | }, | 2392 | }, |
| 2381 | { | 2393 | { |
| 2382 | .cmd = NL802154_CMD_DEL_SEC_DEV, | 2394 | .cmd = NL802154_CMD_DEL_SEC_DEV, |
| 2395 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2383 | .doit = nl802154_del_llsec_dev, | 2396 | .doit = nl802154_del_llsec_dev, |
| 2384 | .flags = GENL_ADMIN_PERM, | 2397 | .flags = GENL_ADMIN_PERM, |
| 2385 | .internal_flags = NL802154_FLAG_NEED_NETDEV | | 2398 | .internal_flags = NL802154_FLAG_NEED_NETDEV | |
| @@ -2388,6 +2401,7 @@ static const struct genl_ops nl802154_ops[] = { | |||
| 2388 | /* TODO remove complete devkey, put it as nested? */ | 2401 | /* TODO remove complete devkey, put it as nested? */ |
| 2389 | { | 2402 | { |
| 2390 | .cmd = NL802154_CMD_GET_SEC_DEVKEY, | 2403 | .cmd = NL802154_CMD_GET_SEC_DEVKEY, |
| 2404 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2391 | /* TODO doit by matching ??? */ | 2405 | /* TODO doit by matching ??? */ |
| 2392 | .dumpit = nl802154_dump_llsec_devkey, | 2406 | .dumpit = nl802154_dump_llsec_devkey, |
| 2393 | .flags = GENL_ADMIN_PERM, | 2407 | .flags = GENL_ADMIN_PERM, |
| @@ -2396,6 +2410,7 @@ static const struct genl_ops nl802154_ops[] = { | |||
| 2396 | }, | 2410 | }, |
| 2397 | { | 2411 | { |
| 2398 | .cmd = NL802154_CMD_NEW_SEC_DEVKEY, | 2412 | .cmd = NL802154_CMD_NEW_SEC_DEVKEY, |
| 2413 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2399 | .doit = nl802154_add_llsec_devkey, | 2414 | .doit = nl802154_add_llsec_devkey, |
| 2400 | .flags = GENL_ADMIN_PERM, | 2415 | .flags = GENL_ADMIN_PERM, |
| 2401 | .internal_flags = NL802154_FLAG_NEED_NETDEV | | 2416 | .internal_flags = NL802154_FLAG_NEED_NETDEV | |
| @@ -2403,6 +2418,7 @@ static const struct genl_ops nl802154_ops[] = { | |||
| 2403 | }, | 2418 | }, |
| 2404 | { | 2419 | { |
| 2405 | .cmd = NL802154_CMD_DEL_SEC_DEVKEY, | 2420 | .cmd = NL802154_CMD_DEL_SEC_DEVKEY, |
| 2421 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2406 | .doit = nl802154_del_llsec_devkey, | 2422 | .doit = nl802154_del_llsec_devkey, |
| 2407 | .flags = GENL_ADMIN_PERM, | 2423 | .flags = GENL_ADMIN_PERM, |
| 2408 | .internal_flags = NL802154_FLAG_NEED_NETDEV | | 2424 | .internal_flags = NL802154_FLAG_NEED_NETDEV | |
| @@ -2410,6 +2426,7 @@ static const struct genl_ops nl802154_ops[] = { | |||
| 2410 | }, | 2426 | }, |
| 2411 | { | 2427 | { |
| 2412 | .cmd = NL802154_CMD_GET_SEC_LEVEL, | 2428 | .cmd = NL802154_CMD_GET_SEC_LEVEL, |
| 2429 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2413 | /* TODO .doit by matching frame_type? */ | 2430 | /* TODO .doit by matching frame_type? */ |
| 2414 | .dumpit = nl802154_dump_llsec_seclevel, | 2431 | .dumpit = nl802154_dump_llsec_seclevel, |
| 2415 | .flags = GENL_ADMIN_PERM, | 2432 | .flags = GENL_ADMIN_PERM, |
| @@ -2418,6 +2435,7 @@ static const struct genl_ops nl802154_ops[] = { | |||
| 2418 | }, | 2435 | }, |
| 2419 | { | 2436 | { |
| 2420 | .cmd = NL802154_CMD_NEW_SEC_LEVEL, | 2437 | .cmd = NL802154_CMD_NEW_SEC_LEVEL, |
| 2438 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2421 | .doit = nl802154_add_llsec_seclevel, | 2439 | .doit = nl802154_add_llsec_seclevel, |
| 2422 | .flags = GENL_ADMIN_PERM, | 2440 | .flags = GENL_ADMIN_PERM, |
| 2423 | .internal_flags = NL802154_FLAG_NEED_NETDEV | | 2441 | .internal_flags = NL802154_FLAG_NEED_NETDEV | |
| @@ -2425,6 +2443,7 @@ static const struct genl_ops nl802154_ops[] = { | |||
| 2425 | }, | 2443 | }, |
| 2426 | { | 2444 | { |
| 2427 | .cmd = NL802154_CMD_DEL_SEC_LEVEL, | 2445 | .cmd = NL802154_CMD_DEL_SEC_LEVEL, |
| 2446 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2428 | /* TODO match frame_type only? */ | 2447 | /* TODO match frame_type only? */ |
| 2429 | .doit = nl802154_del_llsec_seclevel, | 2448 | .doit = nl802154_del_llsec_seclevel, |
| 2430 | .flags = GENL_ADMIN_PERM, | 2449 | .flags = GENL_ADMIN_PERM, |
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index eb514f312e6f..701c5d113a34 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
| @@ -621,8 +621,8 @@ static int inet_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 621 | 621 | ||
| 622 | ASSERT_RTNL(); | 622 | ASSERT_RTNL(); |
| 623 | 623 | ||
| 624 | err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, ifa_ipv4_policy, | 624 | err = nlmsg_parse_deprecated(nlh, sizeof(*ifm), tb, IFA_MAX, |
| 625 | extack); | 625 | ifa_ipv4_policy, extack); |
| 626 | if (err < 0) | 626 | if (err < 0) |
| 627 | goto errout; | 627 | goto errout; |
| 628 | 628 | ||
| @@ -793,8 +793,8 @@ static struct in_ifaddr *rtm_to_ifaddr(struct net *net, struct nlmsghdr *nlh, | |||
| 793 | struct in_device *in_dev; | 793 | struct in_device *in_dev; |
| 794 | int err; | 794 | int err; |
| 795 | 795 | ||
| 796 | err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, ifa_ipv4_policy, | 796 | err = nlmsg_parse_deprecated(nlh, sizeof(*ifm), tb, IFA_MAX, |
| 797 | extack); | 797 | ifa_ipv4_policy, extack); |
| 798 | if (err < 0) | 798 | if (err < 0) |
| 799 | goto errout; | 799 | goto errout; |
| 800 | 800 | ||
| @@ -1689,8 +1689,8 @@ static int inet_valid_dump_ifaddr_req(const struct nlmsghdr *nlh, | |||
| 1689 | fillargs->flags |= NLM_F_DUMP_FILTERED; | 1689 | fillargs->flags |= NLM_F_DUMP_FILTERED; |
| 1690 | } | 1690 | } |
| 1691 | 1691 | ||
| 1692 | err = nlmsg_parse_strict(nlh, sizeof(*ifm), tb, IFA_MAX, | 1692 | err = nlmsg_parse_deprecated_strict(nlh, sizeof(*ifm), tb, IFA_MAX, |
| 1693 | ifa_ipv4_policy, extack); | 1693 | ifa_ipv4_policy, extack); |
| 1694 | if (err < 0) | 1694 | if (err < 0) |
| 1695 | return err; | 1695 | return err; |
| 1696 | 1696 | ||
| @@ -1906,7 +1906,8 @@ static int inet_validate_link_af(const struct net_device *dev, | |||
| 1906 | if (dev && !__in_dev_get_rcu(dev)) | 1906 | if (dev && !__in_dev_get_rcu(dev)) |
| 1907 | return -EAFNOSUPPORT; | 1907 | return -EAFNOSUPPORT; |
| 1908 | 1908 | ||
| 1909 | err = nla_parse_nested(tb, IFLA_INET_MAX, nla, inet_af_policy, NULL); | 1909 | err = nla_parse_nested_deprecated(tb, IFLA_INET_MAX, nla, |
| 1910 | inet_af_policy, NULL); | ||
| 1910 | if (err < 0) | 1911 | if (err < 0) |
| 1911 | return err; | 1912 | return err; |
| 1912 | 1913 | ||
| @@ -1934,7 +1935,7 @@ static int inet_set_link_af(struct net_device *dev, const struct nlattr *nla) | |||
| 1934 | if (!in_dev) | 1935 | if (!in_dev) |
| 1935 | return -EAFNOSUPPORT; | 1936 | return -EAFNOSUPPORT; |
| 1936 | 1937 | ||
| 1937 | if (nla_parse_nested(tb, IFLA_INET_MAX, nla, NULL, NULL) < 0) | 1938 | if (nla_parse_nested_deprecated(tb, IFLA_INET_MAX, nla, NULL, NULL) < 0) |
| 1938 | BUG(); | 1939 | BUG(); |
| 1939 | 1940 | ||
| 1940 | if (tb[IFLA_INET_CONF]) { | 1941 | if (tb[IFLA_INET_CONF]) { |
| @@ -2076,11 +2077,13 @@ static int inet_netconf_valid_get_req(struct sk_buff *skb, | |||
| 2076 | } | 2077 | } |
| 2077 | 2078 | ||
| 2078 | if (!netlink_strict_get_check(skb)) | 2079 | if (!netlink_strict_get_check(skb)) |
| 2079 | return nlmsg_parse(nlh, sizeof(struct netconfmsg), tb, | 2080 | return nlmsg_parse_deprecated(nlh, sizeof(struct netconfmsg), |
| 2080 | NETCONFA_MAX, devconf_ipv4_policy, extack); | 2081 | tb, NETCONFA_MAX, |
| 2082 | devconf_ipv4_policy, extack); | ||
| 2081 | 2083 | ||
| 2082 | err = nlmsg_parse_strict(nlh, sizeof(struct netconfmsg), tb, | 2084 | err = nlmsg_parse_deprecated_strict(nlh, sizeof(struct netconfmsg), |
| 2083 | NETCONFA_MAX, devconf_ipv4_policy, extack); | 2085 | tb, NETCONFA_MAX, |
| 2086 | devconf_ipv4_policy, extack); | ||
| 2084 | if (err) | 2087 | if (err) |
| 2085 | return err; | 2088 | return err; |
| 2086 | 2089 | ||
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index d4b63f94f7be..b298255f6fdb 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c | |||
| @@ -718,8 +718,8 @@ static int rtm_to_fib_config(struct net *net, struct sk_buff *skb, | |||
| 718 | int err, remaining; | 718 | int err, remaining; |
| 719 | struct rtmsg *rtm; | 719 | struct rtmsg *rtm; |
| 720 | 720 | ||
| 721 | err = nlmsg_validate(nlh, sizeof(*rtm), RTA_MAX, rtm_ipv4_policy, | 721 | err = nlmsg_validate_deprecated(nlh, sizeof(*rtm), RTA_MAX, |
| 722 | extack); | 722 | rtm_ipv4_policy, extack); |
| 723 | if (err < 0) | 723 | if (err < 0) |
| 724 | goto errout; | 724 | goto errout; |
| 725 | 725 | ||
| @@ -896,8 +896,8 @@ int ip_valid_fib_dump_req(struct net *net, const struct nlmsghdr *nlh, | |||
| 896 | filter->rt_type = rtm->rtm_type; | 896 | filter->rt_type = rtm->rtm_type; |
| 897 | filter->table_id = rtm->rtm_table; | 897 | filter->table_id = rtm->rtm_table; |
| 898 | 898 | ||
| 899 | err = nlmsg_parse_strict(nlh, sizeof(*rtm), tb, RTA_MAX, | 899 | err = nlmsg_parse_deprecated_strict(nlh, sizeof(*rtm), tb, RTA_MAX, |
| 900 | rtm_ipv4_policy, extack); | 900 | rtm_ipv4_policy, extack); |
| 901 | if (err < 0) | 901 | if (err < 0) |
| 902 | return err; | 902 | return err; |
| 903 | 903 | ||
diff --git a/net/ipv4/fou.c b/net/ipv4/fou.c index 1ca1586a7e46..ca95051317ed 100644 --- a/net/ipv4/fou.c +++ b/net/ipv4/fou.c | |||
| @@ -913,16 +913,19 @@ static int fou_nl_dump(struct sk_buff *skb, struct netlink_callback *cb) | |||
| 913 | static const struct genl_ops fou_nl_ops[] = { | 913 | static const struct genl_ops fou_nl_ops[] = { |
| 914 | { | 914 | { |
| 915 | .cmd = FOU_CMD_ADD, | 915 | .cmd = FOU_CMD_ADD, |
| 916 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 916 | .doit = fou_nl_cmd_add_port, | 917 | .doit = fou_nl_cmd_add_port, |
| 917 | .flags = GENL_ADMIN_PERM, | 918 | .flags = GENL_ADMIN_PERM, |
| 918 | }, | 919 | }, |
| 919 | { | 920 | { |
| 920 | .cmd = FOU_CMD_DEL, | 921 | .cmd = FOU_CMD_DEL, |
| 922 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 921 | .doit = fou_nl_cmd_rm_port, | 923 | .doit = fou_nl_cmd_rm_port, |
| 922 | .flags = GENL_ADMIN_PERM, | 924 | .flags = GENL_ADMIN_PERM, |
| 923 | }, | 925 | }, |
| 924 | { | 926 | { |
| 925 | .cmd = FOU_CMD_GET, | 927 | .cmd = FOU_CMD_GET, |
| 928 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 926 | .doit = fou_nl_cmd_get_port, | 929 | .doit = fou_nl_cmd_get_port, |
| 927 | .dumpit = fou_nl_dump, | 930 | .dumpit = fou_nl_dump, |
| 928 | }, | 931 | }, |
diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c index c3f3d28d1087..30c1c264bdfc 100644 --- a/net/ipv4/ip_tunnel_core.c +++ b/net/ipv4/ip_tunnel_core.c | |||
| @@ -239,8 +239,8 @@ static int ip_tun_build_state(struct nlattr *attr, | |||
| 239 | struct nlattr *tb[LWTUNNEL_IP_MAX + 1]; | 239 | struct nlattr *tb[LWTUNNEL_IP_MAX + 1]; |
| 240 | int err; | 240 | int err; |
| 241 | 241 | ||
| 242 | err = nla_parse_nested(tb, LWTUNNEL_IP_MAX, attr, ip_tun_policy, | 242 | err = nla_parse_nested_deprecated(tb, LWTUNNEL_IP_MAX, attr, |
| 243 | extack); | 243 | ip_tun_policy, extack); |
| 244 | if (err < 0) | 244 | if (err < 0) |
| 245 | return err; | 245 | return err; |
| 246 | 246 | ||
| @@ -356,8 +356,8 @@ static int ip6_tun_build_state(struct nlattr *attr, | |||
| 356 | struct nlattr *tb[LWTUNNEL_IP6_MAX + 1]; | 356 | struct nlattr *tb[LWTUNNEL_IP6_MAX + 1]; |
| 357 | int err; | 357 | int err; |
| 358 | 358 | ||
| 359 | err = nla_parse_nested(tb, LWTUNNEL_IP6_MAX, attr, ip6_tun_policy, | 359 | err = nla_parse_nested_deprecated(tb, LWTUNNEL_IP6_MAX, attr, |
| 360 | extack); | 360 | ip6_tun_policy, extack); |
| 361 | if (err < 0) | 361 | if (err < 0) |
| 362 | return err; | 362 | return err; |
| 363 | 363 | ||
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index 1322573b8228..2c61e10a60e3 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
| @@ -2498,8 +2498,8 @@ static int ipmr_rtm_valid_getroute_req(struct sk_buff *skb, | |||
| 2498 | } | 2498 | } |
| 2499 | 2499 | ||
| 2500 | if (!netlink_strict_get_check(skb)) | 2500 | if (!netlink_strict_get_check(skb)) |
| 2501 | return nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, | 2501 | return nlmsg_parse_deprecated(nlh, sizeof(*rtm), tb, RTA_MAX, |
| 2502 | rtm_ipv4_policy, extack); | 2502 | rtm_ipv4_policy, extack); |
| 2503 | 2503 | ||
| 2504 | rtm = nlmsg_data(nlh); | 2504 | rtm = nlmsg_data(nlh); |
| 2505 | if ((rtm->rtm_src_len && rtm->rtm_src_len != 32) || | 2505 | if ((rtm->rtm_src_len && rtm->rtm_src_len != 32) || |
| @@ -2510,8 +2510,8 @@ static int ipmr_rtm_valid_getroute_req(struct sk_buff *skb, | |||
| 2510 | return -EINVAL; | 2510 | return -EINVAL; |
| 2511 | } | 2511 | } |
| 2512 | 2512 | ||
| 2513 | err = nlmsg_parse_strict(nlh, sizeof(*rtm), tb, RTA_MAX, | 2513 | err = nlmsg_parse_deprecated_strict(nlh, sizeof(*rtm), tb, RTA_MAX, |
| 2514 | rtm_ipv4_policy, extack); | 2514 | rtm_ipv4_policy, extack); |
| 2515 | if (err) | 2515 | if (err) |
| 2516 | return err; | 2516 | return err; |
| 2517 | 2517 | ||
| @@ -2674,8 +2674,8 @@ static int rtm_to_ipmr_mfcc(struct net *net, struct nlmsghdr *nlh, | |||
| 2674 | struct rtmsg *rtm; | 2674 | struct rtmsg *rtm; |
| 2675 | int ret, rem; | 2675 | int ret, rem; |
| 2676 | 2676 | ||
| 2677 | ret = nlmsg_validate(nlh, sizeof(*rtm), RTA_MAX, rtm_ipmr_policy, | 2677 | ret = nlmsg_validate_deprecated(nlh, sizeof(*rtm), RTA_MAX, |
| 2678 | extack); | 2678 | rtm_ipmr_policy, extack); |
| 2679 | if (ret < 0) | 2679 | if (ret < 0) |
| 2680 | goto out; | 2680 | goto out; |
| 2681 | rtm = nlmsg_data(nlh); | 2681 | rtm = nlmsg_data(nlh); |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 4950adeb05c0..795aed6e4720 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
| @@ -2877,8 +2877,8 @@ static int inet_rtm_valid_getroute_req(struct sk_buff *skb, | |||
| 2877 | } | 2877 | } |
| 2878 | 2878 | ||
| 2879 | if (!netlink_strict_get_check(skb)) | 2879 | if (!netlink_strict_get_check(skb)) |
| 2880 | return nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, | 2880 | return nlmsg_parse_deprecated(nlh, sizeof(*rtm), tb, RTA_MAX, |
| 2881 | rtm_ipv4_policy, extack); | 2881 | rtm_ipv4_policy, extack); |
| 2882 | 2882 | ||
| 2883 | rtm = nlmsg_data(nlh); | 2883 | rtm = nlmsg_data(nlh); |
| 2884 | if ((rtm->rtm_src_len && rtm->rtm_src_len != 32) || | 2884 | if ((rtm->rtm_src_len && rtm->rtm_src_len != 32) || |
| @@ -2896,8 +2896,8 @@ static int inet_rtm_valid_getroute_req(struct sk_buff *skb, | |||
| 2896 | return -EINVAL; | 2896 | return -EINVAL; |
| 2897 | } | 2897 | } |
| 2898 | 2898 | ||
| 2899 | err = nlmsg_parse_strict(nlh, sizeof(*rtm), tb, RTA_MAX, | 2899 | err = nlmsg_parse_deprecated_strict(nlh, sizeof(*rtm), tb, RTA_MAX, |
| 2900 | rtm_ipv4_policy, extack); | 2900 | rtm_ipv4_policy, extack); |
| 2901 | if (err) | 2901 | if (err) |
| 2902 | return err; | 2902 | return err; |
| 2903 | 2903 | ||
diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c index 9a08bfb0672c..f262f2cace29 100644 --- a/net/ipv4/tcp_metrics.c +++ b/net/ipv4/tcp_metrics.c | |||
| @@ -951,11 +951,13 @@ static int tcp_metrics_nl_cmd_del(struct sk_buff *skb, struct genl_info *info) | |||
| 951 | static const struct genl_ops tcp_metrics_nl_ops[] = { | 951 | static const struct genl_ops tcp_metrics_nl_ops[] = { |
| 952 | { | 952 | { |
| 953 | .cmd = TCP_METRICS_CMD_GET, | 953 | .cmd = TCP_METRICS_CMD_GET, |
| 954 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 954 | .doit = tcp_metrics_nl_cmd_get, | 955 | .doit = tcp_metrics_nl_cmd_get, |
| 955 | .dumpit = tcp_metrics_nl_dump, | 956 | .dumpit = tcp_metrics_nl_dump, |
| 956 | }, | 957 | }, |
| 957 | { | 958 | { |
| 958 | .cmd = TCP_METRICS_CMD_DEL, | 959 | .cmd = TCP_METRICS_CMD_DEL, |
| 960 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 959 | .doit = tcp_metrics_nl_cmd_del, | 961 | .doit = tcp_metrics_nl_cmd_del, |
| 960 | .flags = GENL_ADMIN_PERM, | 962 | .flags = GENL_ADMIN_PERM, |
| 961 | }, | 963 | }, |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 01f081aa718c..f96d1de79509 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
| @@ -611,11 +611,13 @@ static int inet6_netconf_valid_get_req(struct sk_buff *skb, | |||
| 611 | } | 611 | } |
| 612 | 612 | ||
| 613 | if (!netlink_strict_get_check(skb)) | 613 | if (!netlink_strict_get_check(skb)) |
| 614 | return nlmsg_parse(nlh, sizeof(struct netconfmsg), tb, | 614 | return nlmsg_parse_deprecated(nlh, sizeof(struct netconfmsg), |
| 615 | NETCONFA_MAX, devconf_ipv6_policy, extack); | 615 | tb, NETCONFA_MAX, |
| 616 | devconf_ipv6_policy, extack); | ||
| 616 | 617 | ||
| 617 | err = nlmsg_parse_strict(nlh, sizeof(struct netconfmsg), tb, | 618 | err = nlmsg_parse_deprecated_strict(nlh, sizeof(struct netconfmsg), |
| 618 | NETCONFA_MAX, devconf_ipv6_policy, extack); | 619 | tb, NETCONFA_MAX, |
| 620 | devconf_ipv6_policy, extack); | ||
| 619 | if (err) | 621 | if (err) |
| 620 | return err; | 622 | return err; |
| 621 | 623 | ||
| @@ -4565,8 +4567,8 @@ inet6_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 4565 | u32 ifa_flags; | 4567 | u32 ifa_flags; |
| 4566 | int err; | 4568 | int err; |
| 4567 | 4569 | ||
| 4568 | err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, ifa_ipv6_policy, | 4570 | err = nlmsg_parse_deprecated(nlh, sizeof(*ifm), tb, IFA_MAX, |
| 4569 | extack); | 4571 | ifa_ipv6_policy, extack); |
| 4570 | if (err < 0) | 4572 | if (err < 0) |
| 4571 | return err; | 4573 | return err; |
| 4572 | 4574 | ||
| @@ -4729,8 +4731,8 @@ inet6_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 4729 | struct ifa6_config cfg; | 4731 | struct ifa6_config cfg; |
| 4730 | int err; | 4732 | int err; |
| 4731 | 4733 | ||
| 4732 | err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, ifa_ipv6_policy, | 4734 | err = nlmsg_parse_deprecated(nlh, sizeof(*ifm), tb, IFA_MAX, |
| 4733 | extack); | 4735 | ifa_ipv6_policy, extack); |
| 4734 | if (err < 0) | 4736 | if (err < 0) |
| 4735 | return err; | 4737 | return err; |
| 4736 | 4738 | ||
| @@ -5086,8 +5088,8 @@ static int inet6_valid_dump_ifaddr_req(const struct nlmsghdr *nlh, | |||
| 5086 | fillargs->flags |= NLM_F_DUMP_FILTERED; | 5088 | fillargs->flags |= NLM_F_DUMP_FILTERED; |
| 5087 | } | 5089 | } |
| 5088 | 5090 | ||
| 5089 | err = nlmsg_parse_strict(nlh, sizeof(*ifm), tb, IFA_MAX, | 5091 | err = nlmsg_parse_deprecated_strict(nlh, sizeof(*ifm), tb, IFA_MAX, |
| 5090 | ifa_ipv6_policy, extack); | 5092 | ifa_ipv6_policy, extack); |
| 5091 | if (err < 0) | 5093 | if (err < 0) |
| 5092 | return err; | 5094 | return err; |
| 5093 | 5095 | ||
| @@ -5237,11 +5239,11 @@ static int inet6_rtm_valid_getaddr_req(struct sk_buff *skb, | |||
| 5237 | } | 5239 | } |
| 5238 | 5240 | ||
| 5239 | if (!netlink_strict_get_check(skb)) | 5241 | if (!netlink_strict_get_check(skb)) |
| 5240 | return nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, | 5242 | return nlmsg_parse_deprecated(nlh, sizeof(*ifm), tb, IFA_MAX, |
| 5241 | ifa_ipv6_policy, extack); | 5243 | ifa_ipv6_policy, extack); |
| 5242 | 5244 | ||
| 5243 | err = nlmsg_parse_strict(nlh, sizeof(*ifm), tb, IFA_MAX, | 5245 | err = nlmsg_parse_deprecated_strict(nlh, sizeof(*ifm), tb, IFA_MAX, |
| 5244 | ifa_ipv6_policy, extack); | 5246 | ifa_ipv6_policy, extack); |
| 5245 | if (err) | 5247 | if (err) |
| 5246 | return err; | 5248 | return err; |
| 5247 | 5249 | ||
| @@ -5667,8 +5669,8 @@ static int inet6_validate_link_af(const struct net_device *dev, | |||
| 5667 | if (dev && !__in6_dev_get(dev)) | 5669 | if (dev && !__in6_dev_get(dev)) |
| 5668 | return -EAFNOSUPPORT; | 5670 | return -EAFNOSUPPORT; |
| 5669 | 5671 | ||
| 5670 | return nla_parse_nested(tb, IFLA_INET6_MAX, nla, inet6_af_policy, | 5672 | return nla_parse_nested_deprecated(tb, IFLA_INET6_MAX, nla, |
| 5671 | NULL); | 5673 | inet6_af_policy, NULL); |
| 5672 | } | 5674 | } |
| 5673 | 5675 | ||
| 5674 | static int check_addr_gen_mode(int mode) | 5676 | static int check_addr_gen_mode(int mode) |
| @@ -5700,7 +5702,7 @@ static int inet6_set_link_af(struct net_device *dev, const struct nlattr *nla) | |||
| 5700 | if (!idev) | 5702 | if (!idev) |
| 5701 | return -EAFNOSUPPORT; | 5703 | return -EAFNOSUPPORT; |
| 5702 | 5704 | ||
| 5703 | if (nla_parse_nested(tb, IFLA_INET6_MAX, nla, NULL, NULL) < 0) | 5705 | if (nla_parse_nested_deprecated(tb, IFLA_INET6_MAX, nla, NULL, NULL) < 0) |
| 5704 | BUG(); | 5706 | BUG(); |
| 5705 | 5707 | ||
| 5706 | if (tb[IFLA_INET6_TOKEN]) { | 5708 | if (tb[IFLA_INET6_TOKEN]) { |
diff --git a/net/ipv6/addrlabel.c b/net/ipv6/addrlabel.c index 1766325423b5..642fc6ac13d2 100644 --- a/net/ipv6/addrlabel.c +++ b/net/ipv6/addrlabel.c | |||
| @@ -383,8 +383,8 @@ static int ip6addrlbl_newdel(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 383 | u32 label; | 383 | u32 label; |
| 384 | int err = 0; | 384 | int err = 0; |
| 385 | 385 | ||
| 386 | err = nlmsg_parse(nlh, sizeof(*ifal), tb, IFAL_MAX, ifal_policy, | 386 | err = nlmsg_parse_deprecated(nlh, sizeof(*ifal), tb, IFAL_MAX, |
| 387 | extack); | 387 | ifal_policy, extack); |
| 388 | if (err < 0) | 388 | if (err < 0) |
| 389 | return err; | 389 | return err; |
| 390 | 390 | ||
| @@ -537,8 +537,8 @@ static int ip6addrlbl_valid_get_req(struct sk_buff *skb, | |||
| 537 | } | 537 | } |
| 538 | 538 | ||
| 539 | if (!netlink_strict_get_check(skb)) | 539 | if (!netlink_strict_get_check(skb)) |
| 540 | return nlmsg_parse(nlh, sizeof(*ifal), tb, IFAL_MAX, | 540 | return nlmsg_parse_deprecated(nlh, sizeof(*ifal), tb, |
| 541 | ifal_policy, extack); | 541 | IFAL_MAX, ifal_policy, extack); |
| 542 | 542 | ||
| 543 | ifal = nlmsg_data(nlh); | 543 | ifal = nlmsg_data(nlh); |
| 544 | if (ifal->__ifal_reserved || ifal->ifal_flags || ifal->ifal_seq) { | 544 | if (ifal->__ifal_reserved || ifal->ifal_flags || ifal->ifal_seq) { |
| @@ -546,8 +546,8 @@ static int ip6addrlbl_valid_get_req(struct sk_buff *skb, | |||
| 546 | return -EINVAL; | 546 | return -EINVAL; |
| 547 | } | 547 | } |
| 548 | 548 | ||
| 549 | err = nlmsg_parse_strict(nlh, sizeof(*ifal), tb, IFAL_MAX, | 549 | err = nlmsg_parse_deprecated_strict(nlh, sizeof(*ifal), tb, IFAL_MAX, |
| 550 | ifal_policy, extack); | 550 | ifal_policy, extack); |
| 551 | if (err) | 551 | if (err) |
| 552 | return err; | 552 | return err; |
| 553 | 553 | ||
diff --git a/net/ipv6/ila/ila_lwt.c b/net/ipv6/ila/ila_lwt.c index 3d56a2fb6f86..422dcc691f71 100644 --- a/net/ipv6/ila/ila_lwt.c +++ b/net/ipv6/ila/ila_lwt.c | |||
| @@ -146,7 +146,8 @@ static int ila_build_state(struct nlattr *nla, | |||
| 146 | if (family != AF_INET6) | 146 | if (family != AF_INET6) |
| 147 | return -EINVAL; | 147 | return -EINVAL; |
| 148 | 148 | ||
| 149 | ret = nla_parse_nested(tb, ILA_ATTR_MAX, nla, ila_nl_policy, extack); | 149 | ret = nla_parse_nested_deprecated(tb, ILA_ATTR_MAX, nla, |
| 150 | ila_nl_policy, extack); | ||
| 150 | if (ret < 0) | 151 | if (ret < 0) |
| 151 | return ret; | 152 | return ret; |
| 152 | 153 | ||
diff --git a/net/ipv6/ila/ila_main.c b/net/ipv6/ila/ila_main.c index 8d31a5066d0c..257d2b681246 100644 --- a/net/ipv6/ila/ila_main.c +++ b/net/ipv6/ila/ila_main.c | |||
| @@ -16,21 +16,25 @@ static const struct nla_policy ila_nl_policy[ILA_ATTR_MAX + 1] = { | |||
| 16 | static const struct genl_ops ila_nl_ops[] = { | 16 | static const struct genl_ops ila_nl_ops[] = { |
| 17 | { | 17 | { |
| 18 | .cmd = ILA_CMD_ADD, | 18 | .cmd = ILA_CMD_ADD, |
| 19 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 19 | .doit = ila_xlat_nl_cmd_add_mapping, | 20 | .doit = ila_xlat_nl_cmd_add_mapping, |
| 20 | .flags = GENL_ADMIN_PERM, | 21 | .flags = GENL_ADMIN_PERM, |
| 21 | }, | 22 | }, |
| 22 | { | 23 | { |
| 23 | .cmd = ILA_CMD_DEL, | 24 | .cmd = ILA_CMD_DEL, |
| 25 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 24 | .doit = ila_xlat_nl_cmd_del_mapping, | 26 | .doit = ila_xlat_nl_cmd_del_mapping, |
| 25 | .flags = GENL_ADMIN_PERM, | 27 | .flags = GENL_ADMIN_PERM, |
| 26 | }, | 28 | }, |
| 27 | { | 29 | { |
| 28 | .cmd = ILA_CMD_FLUSH, | 30 | .cmd = ILA_CMD_FLUSH, |
| 31 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 29 | .doit = ila_xlat_nl_cmd_flush, | 32 | .doit = ila_xlat_nl_cmd_flush, |
| 30 | .flags = GENL_ADMIN_PERM, | 33 | .flags = GENL_ADMIN_PERM, |
| 31 | }, | 34 | }, |
| 32 | { | 35 | { |
| 33 | .cmd = ILA_CMD_GET, | 36 | .cmd = ILA_CMD_GET, |
| 37 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 34 | .doit = ila_xlat_nl_cmd_get_mapping, | 38 | .doit = ila_xlat_nl_cmd_get_mapping, |
| 35 | .start = ila_xlat_nl_dump_start, | 39 | .start = ila_xlat_nl_dump_start, |
| 36 | .dumpit = ila_xlat_nl_dump, | 40 | .dumpit = ila_xlat_nl_dump, |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index e2b47f47de92..b18e85cd7587 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
| @@ -4239,8 +4239,8 @@ static int rtm_to_fib6_config(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 4239 | unsigned int pref; | 4239 | unsigned int pref; |
| 4240 | int err; | 4240 | int err; |
| 4241 | 4241 | ||
| 4242 | err = nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, rtm_ipv6_policy, | 4242 | err = nlmsg_parse_deprecated(nlh, sizeof(*rtm), tb, RTA_MAX, |
| 4243 | extack); | 4243 | rtm_ipv6_policy, extack); |
| 4244 | if (err < 0) | 4244 | if (err < 0) |
| 4245 | goto errout; | 4245 | goto errout; |
| 4246 | 4246 | ||
| @@ -4886,8 +4886,8 @@ static int inet6_rtm_valid_getroute_req(struct sk_buff *skb, | |||
| 4886 | } | 4886 | } |
| 4887 | 4887 | ||
| 4888 | if (!netlink_strict_get_check(skb)) | 4888 | if (!netlink_strict_get_check(skb)) |
| 4889 | return nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, | 4889 | return nlmsg_parse_deprecated(nlh, sizeof(*rtm), tb, RTA_MAX, |
| 4890 | rtm_ipv6_policy, extack); | 4890 | rtm_ipv6_policy, extack); |
| 4891 | 4891 | ||
| 4892 | rtm = nlmsg_data(nlh); | 4892 | rtm = nlmsg_data(nlh); |
| 4893 | if ((rtm->rtm_src_len && rtm->rtm_src_len != 128) || | 4893 | if ((rtm->rtm_src_len && rtm->rtm_src_len != 128) || |
| @@ -4903,8 +4903,8 @@ static int inet6_rtm_valid_getroute_req(struct sk_buff *skb, | |||
| 4903 | return -EINVAL; | 4903 | return -EINVAL; |
| 4904 | } | 4904 | } |
| 4905 | 4905 | ||
| 4906 | err = nlmsg_parse_strict(nlh, sizeof(*rtm), tb, RTA_MAX, | 4906 | err = nlmsg_parse_deprecated_strict(nlh, sizeof(*rtm), tb, RTA_MAX, |
| 4907 | rtm_ipv6_policy, extack); | 4907 | rtm_ipv6_policy, extack); |
| 4908 | if (err) | 4908 | if (err) |
| 4909 | return err; | 4909 | return err; |
| 4910 | 4910 | ||
diff --git a/net/ipv6/seg6.c b/net/ipv6/seg6.c index ceff773471e7..0c5479ef9b38 100644 --- a/net/ipv6/seg6.c +++ b/net/ipv6/seg6.c | |||
| @@ -398,11 +398,13 @@ static struct pernet_operations ip6_segments_ops = { | |||
| 398 | static const struct genl_ops seg6_genl_ops[] = { | 398 | static const struct genl_ops seg6_genl_ops[] = { |
| 399 | { | 399 | { |
| 400 | .cmd = SEG6_CMD_SETHMAC, | 400 | .cmd = SEG6_CMD_SETHMAC, |
| 401 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 401 | .doit = seg6_genl_sethmac, | 402 | .doit = seg6_genl_sethmac, |
| 402 | .flags = GENL_ADMIN_PERM, | 403 | .flags = GENL_ADMIN_PERM, |
| 403 | }, | 404 | }, |
| 404 | { | 405 | { |
| 405 | .cmd = SEG6_CMD_DUMPHMAC, | 406 | .cmd = SEG6_CMD_DUMPHMAC, |
| 407 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 406 | .start = seg6_genl_dumphmac_start, | 408 | .start = seg6_genl_dumphmac_start, |
| 407 | .dumpit = seg6_genl_dumphmac, | 409 | .dumpit = seg6_genl_dumphmac, |
| 408 | .done = seg6_genl_dumphmac_done, | 410 | .done = seg6_genl_dumphmac_done, |
| @@ -410,11 +412,13 @@ static const struct genl_ops seg6_genl_ops[] = { | |||
| 410 | }, | 412 | }, |
| 411 | { | 413 | { |
| 412 | .cmd = SEG6_CMD_SET_TUNSRC, | 414 | .cmd = SEG6_CMD_SET_TUNSRC, |
| 415 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 413 | .doit = seg6_genl_set_tunsrc, | 416 | .doit = seg6_genl_set_tunsrc, |
| 414 | .flags = GENL_ADMIN_PERM, | 417 | .flags = GENL_ADMIN_PERM, |
| 415 | }, | 418 | }, |
| 416 | { | 419 | { |
| 417 | .cmd = SEG6_CMD_GET_TUNSRC, | 420 | .cmd = SEG6_CMD_GET_TUNSRC, |
| 421 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 418 | .doit = seg6_genl_get_tunsrc, | 422 | .doit = seg6_genl_get_tunsrc, |
| 419 | .flags = GENL_ADMIN_PERM, | 423 | .flags = GENL_ADMIN_PERM, |
| 420 | }, | 424 | }, |
diff --git a/net/ipv6/seg6_iptunnel.c b/net/ipv6/seg6_iptunnel.c index ee5403cbe655..7a525fda8978 100644 --- a/net/ipv6/seg6_iptunnel.c +++ b/net/ipv6/seg6_iptunnel.c | |||
| @@ -396,8 +396,8 @@ static int seg6_build_state(struct nlattr *nla, | |||
| 396 | if (family != AF_INET && family != AF_INET6) | 396 | if (family != AF_INET && family != AF_INET6) |
| 397 | return -EINVAL; | 397 | return -EINVAL; |
| 398 | 398 | ||
| 399 | err = nla_parse_nested(tb, SEG6_IPTUNNEL_MAX, nla, | 399 | err = nla_parse_nested_deprecated(tb, SEG6_IPTUNNEL_MAX, nla, |
| 400 | seg6_iptunnel_policy, extack); | 400 | seg6_iptunnel_policy, extack); |
| 401 | 401 | ||
| 402 | if (err < 0) | 402 | if (err < 0) |
| 403 | return err; | 403 | return err; |
diff --git a/net/ipv6/seg6_local.c b/net/ipv6/seg6_local.c index 67005ac71341..78155fdb8c36 100644 --- a/net/ipv6/seg6_local.c +++ b/net/ipv6/seg6_local.c | |||
| @@ -823,8 +823,9 @@ static int parse_nla_bpf(struct nlattr **attrs, struct seg6_local_lwt *slwt) | |||
| 823 | int ret; | 823 | int ret; |
| 824 | u32 fd; | 824 | u32 fd; |
| 825 | 825 | ||
| 826 | ret = nla_parse_nested(tb, SEG6_LOCAL_BPF_PROG_MAX, | 826 | ret = nla_parse_nested_deprecated(tb, SEG6_LOCAL_BPF_PROG_MAX, |
| 827 | attrs[SEG6_LOCAL_BPF], bpf_prog_policy, NULL); | 827 | attrs[SEG6_LOCAL_BPF], |
| 828 | bpf_prog_policy, NULL); | ||
| 828 | if (ret < 0) | 829 | if (ret < 0) |
| 829 | return ret; | 830 | return ret; |
| 830 | 831 | ||
| @@ -959,8 +960,8 @@ static int seg6_local_build_state(struct nlattr *nla, unsigned int family, | |||
| 959 | if (family != AF_INET6) | 960 | if (family != AF_INET6) |
| 960 | return -EINVAL; | 961 | return -EINVAL; |
| 961 | 962 | ||
| 962 | err = nla_parse_nested(tb, SEG6_LOCAL_MAX, nla, seg6_local_policy, | 963 | err = nla_parse_nested_deprecated(tb, SEG6_LOCAL_MAX, nla, |
| 963 | extack); | 964 | seg6_local_policy, extack); |
| 964 | 965 | ||
| 965 | if (err < 0) | 966 | if (err < 0) |
| 966 | return err; | 967 | return err; |
diff --git a/net/l2tp/l2tp_netlink.c b/net/l2tp/l2tp_netlink.c index c31b50cc48d9..6acc7f869b0c 100644 --- a/net/l2tp/l2tp_netlink.c +++ b/net/l2tp/l2tp_netlink.c | |||
| @@ -915,47 +915,56 @@ static const struct nla_policy l2tp_nl_policy[L2TP_ATTR_MAX + 1] = { | |||
| 915 | static const struct genl_ops l2tp_nl_ops[] = { | 915 | static const struct genl_ops l2tp_nl_ops[] = { |
| 916 | { | 916 | { |
| 917 | .cmd = L2TP_CMD_NOOP, | 917 | .cmd = L2TP_CMD_NOOP, |
| 918 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 918 | .doit = l2tp_nl_cmd_noop, | 919 | .doit = l2tp_nl_cmd_noop, |
| 919 | /* can be retrieved by unprivileged users */ | 920 | /* can be retrieved by unprivileged users */ |
| 920 | }, | 921 | }, |
| 921 | { | 922 | { |
| 922 | .cmd = L2TP_CMD_TUNNEL_CREATE, | 923 | .cmd = L2TP_CMD_TUNNEL_CREATE, |
| 924 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 923 | .doit = l2tp_nl_cmd_tunnel_create, | 925 | .doit = l2tp_nl_cmd_tunnel_create, |
| 924 | .flags = GENL_ADMIN_PERM, | 926 | .flags = GENL_ADMIN_PERM, |
| 925 | }, | 927 | }, |
| 926 | { | 928 | { |
| 927 | .cmd = L2TP_CMD_TUNNEL_DELETE, | 929 | .cmd = L2TP_CMD_TUNNEL_DELETE, |
| 930 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 928 | .doit = l2tp_nl_cmd_tunnel_delete, | 931 | .doit = l2tp_nl_cmd_tunnel_delete, |
| 929 | .flags = GENL_ADMIN_PERM, | 932 | .flags = GENL_ADMIN_PERM, |
| 930 | }, | 933 | }, |
| 931 | { | 934 | { |
| 932 | .cmd = L2TP_CMD_TUNNEL_MODIFY, | 935 | .cmd = L2TP_CMD_TUNNEL_MODIFY, |
| 936 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 933 | .doit = l2tp_nl_cmd_tunnel_modify, | 937 | .doit = l2tp_nl_cmd_tunnel_modify, |
| 934 | .flags = GENL_ADMIN_PERM, | 938 | .flags = GENL_ADMIN_PERM, |
| 935 | }, | 939 | }, |
| 936 | { | 940 | { |
| 937 | .cmd = L2TP_CMD_TUNNEL_GET, | 941 | .cmd = L2TP_CMD_TUNNEL_GET, |
| 942 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 938 | .doit = l2tp_nl_cmd_tunnel_get, | 943 | .doit = l2tp_nl_cmd_tunnel_get, |
| 939 | .dumpit = l2tp_nl_cmd_tunnel_dump, | 944 | .dumpit = l2tp_nl_cmd_tunnel_dump, |
| 940 | .flags = GENL_ADMIN_PERM, | 945 | .flags = GENL_ADMIN_PERM, |
| 941 | }, | 946 | }, |
| 942 | { | 947 | { |
| 943 | .cmd = L2TP_CMD_SESSION_CREATE, | 948 | .cmd = L2TP_CMD_SESSION_CREATE, |
| 949 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 944 | .doit = l2tp_nl_cmd_session_create, | 950 | .doit = l2tp_nl_cmd_session_create, |
| 945 | .flags = GENL_ADMIN_PERM, | 951 | .flags = GENL_ADMIN_PERM, |
| 946 | }, | 952 | }, |
| 947 | { | 953 | { |
| 948 | .cmd = L2TP_CMD_SESSION_DELETE, | 954 | .cmd = L2TP_CMD_SESSION_DELETE, |
| 955 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 949 | .doit = l2tp_nl_cmd_session_delete, | 956 | .doit = l2tp_nl_cmd_session_delete, |
| 950 | .flags = GENL_ADMIN_PERM, | 957 | .flags = GENL_ADMIN_PERM, |
| 951 | }, | 958 | }, |
| 952 | { | 959 | { |
| 953 | .cmd = L2TP_CMD_SESSION_MODIFY, | 960 | .cmd = L2TP_CMD_SESSION_MODIFY, |
| 961 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 954 | .doit = l2tp_nl_cmd_session_modify, | 962 | .doit = l2tp_nl_cmd_session_modify, |
| 955 | .flags = GENL_ADMIN_PERM, | 963 | .flags = GENL_ADMIN_PERM, |
| 956 | }, | 964 | }, |
| 957 | { | 965 | { |
| 958 | .cmd = L2TP_CMD_SESSION_GET, | 966 | .cmd = L2TP_CMD_SESSION_GET, |
| 967 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 959 | .doit = l2tp_nl_cmd_session_get, | 968 | .doit = l2tp_nl_cmd_session_get, |
| 960 | .dumpit = l2tp_nl_cmd_session_dump, | 969 | .dumpit = l2tp_nl_cmd_session_dump, |
| 961 | .flags = GENL_ADMIN_PERM, | 970 | .flags = GENL_ADMIN_PERM, |
diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c index 01f8a4f97872..baa098291fb0 100644 --- a/net/mpls/af_mpls.c +++ b/net/mpls/af_mpls.c | |||
| @@ -1223,11 +1223,13 @@ static int mpls_netconf_valid_get_req(struct sk_buff *skb, | |||
| 1223 | } | 1223 | } |
| 1224 | 1224 | ||
| 1225 | if (!netlink_strict_get_check(skb)) | 1225 | if (!netlink_strict_get_check(skb)) |
| 1226 | return nlmsg_parse(nlh, sizeof(struct netconfmsg), tb, | 1226 | return nlmsg_parse_deprecated(nlh, sizeof(struct netconfmsg), |
| 1227 | NETCONFA_MAX, devconf_mpls_policy, extack); | 1227 | tb, NETCONFA_MAX, |
| 1228 | devconf_mpls_policy, extack); | ||
| 1228 | 1229 | ||
| 1229 | err = nlmsg_parse_strict(nlh, sizeof(struct netconfmsg), tb, | 1230 | err = nlmsg_parse_deprecated_strict(nlh, sizeof(struct netconfmsg), |
| 1230 | NETCONFA_MAX, devconf_mpls_policy, extack); | 1231 | tb, NETCONFA_MAX, |
| 1232 | devconf_mpls_policy, extack); | ||
| 1231 | if (err) | 1233 | if (err) |
| 1232 | return err; | 1234 | return err; |
| 1233 | 1235 | ||
| @@ -1788,8 +1790,8 @@ static int rtm_to_route_config(struct sk_buff *skb, | |||
| 1788 | int index; | 1790 | int index; |
| 1789 | int err; | 1791 | int err; |
| 1790 | 1792 | ||
| 1791 | err = nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, rtm_mpls_policy, | 1793 | err = nlmsg_parse_deprecated(nlh, sizeof(*rtm), tb, RTA_MAX, |
| 1792 | extack); | 1794 | rtm_mpls_policy, extack); |
| 1793 | if (err < 0) | 1795 | if (err < 0) |
| 1794 | goto errout; | 1796 | goto errout; |
| 1795 | 1797 | ||
| @@ -2106,8 +2108,8 @@ static int mpls_valid_fib_dump_req(struct net *net, const struct nlmsghdr *nlh, | |||
| 2106 | cb->answer_flags = NLM_F_DUMP_FILTERED; | 2108 | cb->answer_flags = NLM_F_DUMP_FILTERED; |
| 2107 | } | 2109 | } |
| 2108 | 2110 | ||
| 2109 | err = nlmsg_parse_strict(nlh, sizeof(*rtm), tb, RTA_MAX, | 2111 | err = nlmsg_parse_deprecated_strict(nlh, sizeof(*rtm), tb, RTA_MAX, |
| 2110 | rtm_mpls_policy, extack); | 2112 | rtm_mpls_policy, extack); |
| 2111 | if (err < 0) | 2113 | if (err < 0) |
| 2112 | return err; | 2114 | return err; |
| 2113 | 2115 | ||
| @@ -2290,8 +2292,8 @@ static int mpls_valid_getroute_req(struct sk_buff *skb, | |||
| 2290 | } | 2292 | } |
| 2291 | 2293 | ||
| 2292 | if (!netlink_strict_get_check(skb)) | 2294 | if (!netlink_strict_get_check(skb)) |
| 2293 | return nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, | 2295 | return nlmsg_parse_deprecated(nlh, sizeof(*rtm), tb, RTA_MAX, |
| 2294 | rtm_mpls_policy, extack); | 2296 | rtm_mpls_policy, extack); |
| 2295 | 2297 | ||
| 2296 | rtm = nlmsg_data(nlh); | 2298 | rtm = nlmsg_data(nlh); |
| 2297 | if ((rtm->rtm_dst_len && rtm->rtm_dst_len != 20) || | 2299 | if ((rtm->rtm_dst_len && rtm->rtm_dst_len != 20) || |
| @@ -2306,8 +2308,8 @@ static int mpls_valid_getroute_req(struct sk_buff *skb, | |||
| 2306 | return -EINVAL; | 2308 | return -EINVAL; |
| 2307 | } | 2309 | } |
| 2308 | 2310 | ||
| 2309 | err = nlmsg_parse_strict(nlh, sizeof(*rtm), tb, RTA_MAX, | 2311 | err = nlmsg_parse_deprecated_strict(nlh, sizeof(*rtm), tb, RTA_MAX, |
| 2310 | rtm_mpls_policy, extack); | 2312 | rtm_mpls_policy, extack); |
| 2311 | if (err) | 2313 | if (err) |
| 2312 | return err; | 2314 | return err; |
| 2313 | 2315 | ||
diff --git a/net/mpls/mpls_iptunnel.c b/net/mpls/mpls_iptunnel.c index 2619c2fbea93..951b52d5835b 100644 --- a/net/mpls/mpls_iptunnel.c +++ b/net/mpls/mpls_iptunnel.c | |||
| @@ -178,8 +178,8 @@ static int mpls_build_state(struct nlattr *nla, | |||
| 178 | u8 n_labels; | 178 | u8 n_labels; |
| 179 | int ret; | 179 | int ret; |
| 180 | 180 | ||
| 181 | ret = nla_parse_nested(tb, MPLS_IPTUNNEL_MAX, nla, | 181 | ret = nla_parse_nested_deprecated(tb, MPLS_IPTUNNEL_MAX, nla, |
| 182 | mpls_iptunnel_policy, extack); | 182 | mpls_iptunnel_policy, extack); |
| 183 | if (ret < 0) | 183 | if (ret < 0) |
| 184 | return ret; | 184 | return ret; |
| 185 | 185 | ||
diff --git a/net/ncsi/ncsi-netlink.c b/net/ncsi/ncsi-netlink.c index 672ed56b5ef0..7fc4feddafa3 100644 --- a/net/ncsi/ncsi-netlink.c +++ b/net/ncsi/ncsi-netlink.c | |||
| @@ -220,8 +220,8 @@ static int ncsi_pkg_info_all_nl(struct sk_buff *skb, | |||
| 220 | void *hdr; | 220 | void *hdr; |
| 221 | int rc; | 221 | int rc; |
| 222 | 222 | ||
| 223 | rc = genlmsg_parse(cb->nlh, &ncsi_genl_family, attrs, NCSI_ATTR_MAX, | 223 | rc = genlmsg_parse_deprecated(cb->nlh, &ncsi_genl_family, attrs, NCSI_ATTR_MAX, |
| 224 | ncsi_genl_policy, NULL); | 224 | ncsi_genl_policy, NULL); |
| 225 | if (rc) | 225 | if (rc) |
| 226 | return rc; | 226 | return rc; |
| 227 | 227 | ||
| @@ -723,32 +723,38 @@ static int ncsi_set_channel_mask_nl(struct sk_buff *msg, | |||
| 723 | static const struct genl_ops ncsi_ops[] = { | 723 | static const struct genl_ops ncsi_ops[] = { |
| 724 | { | 724 | { |
| 725 | .cmd = NCSI_CMD_PKG_INFO, | 725 | .cmd = NCSI_CMD_PKG_INFO, |
| 726 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 726 | .doit = ncsi_pkg_info_nl, | 727 | .doit = ncsi_pkg_info_nl, |
| 727 | .dumpit = ncsi_pkg_info_all_nl, | 728 | .dumpit = ncsi_pkg_info_all_nl, |
| 728 | .flags = 0, | 729 | .flags = 0, |
| 729 | }, | 730 | }, |
| 730 | { | 731 | { |
| 731 | .cmd = NCSI_CMD_SET_INTERFACE, | 732 | .cmd = NCSI_CMD_SET_INTERFACE, |
| 733 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 732 | .doit = ncsi_set_interface_nl, | 734 | .doit = ncsi_set_interface_nl, |
| 733 | .flags = GENL_ADMIN_PERM, | 735 | .flags = GENL_ADMIN_PERM, |
| 734 | }, | 736 | }, |
| 735 | { | 737 | { |
| 736 | .cmd = NCSI_CMD_CLEAR_INTERFACE, | 738 | .cmd = NCSI_CMD_CLEAR_INTERFACE, |
| 739 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 737 | .doit = ncsi_clear_interface_nl, | 740 | .doit = ncsi_clear_interface_nl, |
| 738 | .flags = GENL_ADMIN_PERM, | 741 | .flags = GENL_ADMIN_PERM, |
| 739 | }, | 742 | }, |
| 740 | { | 743 | { |
| 741 | .cmd = NCSI_CMD_SEND_CMD, | 744 | .cmd = NCSI_CMD_SEND_CMD, |
| 745 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 742 | .doit = ncsi_send_cmd_nl, | 746 | .doit = ncsi_send_cmd_nl, |
| 743 | .flags = GENL_ADMIN_PERM, | 747 | .flags = GENL_ADMIN_PERM, |
| 744 | }, | 748 | }, |
| 745 | { | 749 | { |
| 746 | .cmd = NCSI_CMD_SET_PACKAGE_MASK, | 750 | .cmd = NCSI_CMD_SET_PACKAGE_MASK, |
| 751 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 747 | .doit = ncsi_set_package_mask_nl, | 752 | .doit = ncsi_set_package_mask_nl, |
| 748 | .flags = GENL_ADMIN_PERM, | 753 | .flags = GENL_ADMIN_PERM, |
| 749 | }, | 754 | }, |
| 750 | { | 755 | { |
| 751 | .cmd = NCSI_CMD_SET_CHANNEL_MASK, | 756 | .cmd = NCSI_CMD_SET_CHANNEL_MASK, |
| 757 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 752 | .doit = ncsi_set_channel_mask_nl, | 758 | .doit = ncsi_set_channel_mask_nl, |
| 753 | .flags = GENL_ADMIN_PERM, | 759 | .flags = GENL_ADMIN_PERM, |
| 754 | }, | 760 | }, |
diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c index 45a257695bef..3f4a4936f63c 100644 --- a/net/netfilter/ipset/ip_set_core.c +++ b/net/netfilter/ipset/ip_set_core.c | |||
| @@ -299,8 +299,7 @@ ip_set_get_ipaddr4(struct nlattr *nla, __be32 *ipaddr) | |||
| 299 | 299 | ||
| 300 | if (unlikely(!flag_nested(nla))) | 300 | if (unlikely(!flag_nested(nla))) |
| 301 | return -IPSET_ERR_PROTOCOL; | 301 | return -IPSET_ERR_PROTOCOL; |
| 302 | if (nla_parse_nested(tb, IPSET_ATTR_IPADDR_MAX, nla, | 302 | if (nla_parse_nested_deprecated(tb, IPSET_ATTR_IPADDR_MAX, nla, ipaddr_policy, NULL)) |
| 303 | ipaddr_policy, NULL)) | ||
| 304 | return -IPSET_ERR_PROTOCOL; | 303 | return -IPSET_ERR_PROTOCOL; |
| 305 | if (unlikely(!ip_set_attr_netorder(tb, IPSET_ATTR_IPADDR_IPV4))) | 304 | if (unlikely(!ip_set_attr_netorder(tb, IPSET_ATTR_IPADDR_IPV4))) |
| 306 | return -IPSET_ERR_PROTOCOL; | 305 | return -IPSET_ERR_PROTOCOL; |
| @@ -318,8 +317,7 @@ ip_set_get_ipaddr6(struct nlattr *nla, union nf_inet_addr *ipaddr) | |||
| 318 | if (unlikely(!flag_nested(nla))) | 317 | if (unlikely(!flag_nested(nla))) |
| 319 | return -IPSET_ERR_PROTOCOL; | 318 | return -IPSET_ERR_PROTOCOL; |
| 320 | 319 | ||
| 321 | if (nla_parse_nested(tb, IPSET_ATTR_IPADDR_MAX, nla, | 320 | if (nla_parse_nested_deprecated(tb, IPSET_ATTR_IPADDR_MAX, nla, ipaddr_policy, NULL)) |
| 322 | ipaddr_policy, NULL)) | ||
| 323 | return -IPSET_ERR_PROTOCOL; | 321 | return -IPSET_ERR_PROTOCOL; |
| 324 | if (unlikely(!ip_set_attr_netorder(tb, IPSET_ATTR_IPADDR_IPV6))) | 322 | if (unlikely(!ip_set_attr_netorder(tb, IPSET_ATTR_IPADDR_IPV6))) |
| 325 | return -IPSET_ERR_PROTOCOL; | 323 | return -IPSET_ERR_PROTOCOL; |
| @@ -939,8 +937,7 @@ static int ip_set_create(struct net *net, struct sock *ctnl, | |||
| 939 | 937 | ||
| 940 | /* Without holding any locks, create private part. */ | 938 | /* Without holding any locks, create private part. */ |
| 941 | if (attr[IPSET_ATTR_DATA] && | 939 | if (attr[IPSET_ATTR_DATA] && |
| 942 | nla_parse_nested(tb, IPSET_ATTR_CREATE_MAX, attr[IPSET_ATTR_DATA], | 940 | nla_parse_nested_deprecated(tb, IPSET_ATTR_CREATE_MAX, attr[IPSET_ATTR_DATA], set->type->create_policy, NULL)) { |
| 943 | set->type->create_policy, NULL)) { | ||
| 944 | ret = -IPSET_ERR_PROTOCOL; | 941 | ret = -IPSET_ERR_PROTOCOL; |
| 945 | goto put_out; | 942 | goto put_out; |
| 946 | } | 943 | } |
| @@ -1298,8 +1295,9 @@ dump_init(struct netlink_callback *cb, struct ip_set_net *inst) | |||
| 1298 | ip_set_id_t index; | 1295 | ip_set_id_t index; |
| 1299 | 1296 | ||
| 1300 | /* Second pass, so parser can't fail */ | 1297 | /* Second pass, so parser can't fail */ |
| 1301 | nla_parse(cda, IPSET_ATTR_CMD_MAX, attr, nlh->nlmsg_len - min_len, | 1298 | nla_parse_deprecated(cda, IPSET_ATTR_CMD_MAX, attr, |
| 1302 | ip_set_setname_policy, NULL); | 1299 | nlh->nlmsg_len - min_len, ip_set_setname_policy, |
| 1300 | NULL); | ||
| 1303 | 1301 | ||
| 1304 | cb->args[IPSET_CB_PROTO] = nla_get_u8(cda[IPSET_ATTR_PROTOCOL]); | 1302 | cb->args[IPSET_CB_PROTO] = nla_get_u8(cda[IPSET_ATTR_PROTOCOL]); |
| 1305 | if (cda[IPSET_ATTR_SETNAME]) { | 1303 | if (cda[IPSET_ATTR_SETNAME]) { |
| @@ -1546,8 +1544,9 @@ call_ad(struct sock *ctnl, struct sk_buff *skb, struct ip_set *set, | |||
| 1546 | memcpy(&errmsg->msg, nlh, nlh->nlmsg_len); | 1544 | memcpy(&errmsg->msg, nlh, nlh->nlmsg_len); |
| 1547 | cmdattr = (void *)&errmsg->msg + min_len; | 1545 | cmdattr = (void *)&errmsg->msg + min_len; |
| 1548 | 1546 | ||
| 1549 | nla_parse(cda, IPSET_ATTR_CMD_MAX, cmdattr, | 1547 | nla_parse_deprecated(cda, IPSET_ATTR_CMD_MAX, cmdattr, |
| 1550 | nlh->nlmsg_len - min_len, ip_set_adt_policy, NULL); | 1548 | nlh->nlmsg_len - min_len, |
| 1549 | ip_set_adt_policy, NULL); | ||
| 1551 | 1550 | ||
| 1552 | errline = nla_data(cda[IPSET_ATTR_LINENO]); | 1551 | errline = nla_data(cda[IPSET_ATTR_LINENO]); |
| 1553 | 1552 | ||
| @@ -1592,9 +1591,7 @@ static int ip_set_uadd(struct net *net, struct sock *ctnl, struct sk_buff *skb, | |||
| 1592 | 1591 | ||
| 1593 | use_lineno = !!attr[IPSET_ATTR_LINENO]; | 1592 | use_lineno = !!attr[IPSET_ATTR_LINENO]; |
| 1594 | if (attr[IPSET_ATTR_DATA]) { | 1593 | if (attr[IPSET_ATTR_DATA]) { |
| 1595 | if (nla_parse_nested(tb, IPSET_ATTR_ADT_MAX, | 1594 | if (nla_parse_nested_deprecated(tb, IPSET_ATTR_ADT_MAX, attr[IPSET_ATTR_DATA], set->type->adt_policy, NULL)) |
| 1596 | attr[IPSET_ATTR_DATA], | ||
| 1597 | set->type->adt_policy, NULL)) | ||
| 1598 | return -IPSET_ERR_PROTOCOL; | 1595 | return -IPSET_ERR_PROTOCOL; |
| 1599 | ret = call_ad(ctnl, skb, set, tb, IPSET_ADD, flags, | 1596 | ret = call_ad(ctnl, skb, set, tb, IPSET_ADD, flags, |
| 1600 | use_lineno); | 1597 | use_lineno); |
| @@ -1605,8 +1602,7 @@ static int ip_set_uadd(struct net *net, struct sock *ctnl, struct sk_buff *skb, | |||
| 1605 | memset(tb, 0, sizeof(tb)); | 1602 | memset(tb, 0, sizeof(tb)); |
| 1606 | if (nla_type(nla) != IPSET_ATTR_DATA || | 1603 | if (nla_type(nla) != IPSET_ATTR_DATA || |
| 1607 | !flag_nested(nla) || | 1604 | !flag_nested(nla) || |
| 1608 | nla_parse_nested(tb, IPSET_ATTR_ADT_MAX, nla, | 1605 | nla_parse_nested_deprecated(tb, IPSET_ATTR_ADT_MAX, nla, set->type->adt_policy, NULL)) |
| 1609 | set->type->adt_policy, NULL)) | ||
| 1610 | return -IPSET_ERR_PROTOCOL; | 1606 | return -IPSET_ERR_PROTOCOL; |
| 1611 | ret = call_ad(ctnl, skb, set, tb, IPSET_ADD, | 1607 | ret = call_ad(ctnl, skb, set, tb, IPSET_ADD, |
| 1612 | flags, use_lineno); | 1608 | flags, use_lineno); |
| @@ -1647,9 +1643,7 @@ static int ip_set_udel(struct net *net, struct sock *ctnl, struct sk_buff *skb, | |||
| 1647 | 1643 | ||
| 1648 | use_lineno = !!attr[IPSET_ATTR_LINENO]; | 1644 | use_lineno = !!attr[IPSET_ATTR_LINENO]; |
| 1649 | if (attr[IPSET_ATTR_DATA]) { | 1645 | if (attr[IPSET_ATTR_DATA]) { |
| 1650 | if (nla_parse_nested(tb, IPSET_ATTR_ADT_MAX, | 1646 | if (nla_parse_nested_deprecated(tb, IPSET_ATTR_ADT_MAX, attr[IPSET_ATTR_DATA], set->type->adt_policy, NULL)) |
| 1651 | attr[IPSET_ATTR_DATA], | ||
| 1652 | set->type->adt_policy, NULL)) | ||
| 1653 | return -IPSET_ERR_PROTOCOL; | 1647 | return -IPSET_ERR_PROTOCOL; |
| 1654 | ret = call_ad(ctnl, skb, set, tb, IPSET_DEL, flags, | 1648 | ret = call_ad(ctnl, skb, set, tb, IPSET_DEL, flags, |
| 1655 | use_lineno); | 1649 | use_lineno); |
| @@ -1660,8 +1654,7 @@ static int ip_set_udel(struct net *net, struct sock *ctnl, struct sk_buff *skb, | |||
| 1660 | memset(tb, 0, sizeof(*tb)); | 1654 | memset(tb, 0, sizeof(*tb)); |
| 1661 | if (nla_type(nla) != IPSET_ATTR_DATA || | 1655 | if (nla_type(nla) != IPSET_ATTR_DATA || |
| 1662 | !flag_nested(nla) || | 1656 | !flag_nested(nla) || |
| 1663 | nla_parse_nested(tb, IPSET_ATTR_ADT_MAX, nla, | 1657 | nla_parse_nested_deprecated(tb, IPSET_ATTR_ADT_MAX, nla, set->type->adt_policy, NULL)) |
| 1664 | set->type->adt_policy, NULL)) | ||
| 1665 | return -IPSET_ERR_PROTOCOL; | 1658 | return -IPSET_ERR_PROTOCOL; |
| 1666 | ret = call_ad(ctnl, skb, set, tb, IPSET_DEL, | 1659 | ret = call_ad(ctnl, skb, set, tb, IPSET_DEL, |
| 1667 | flags, use_lineno); | 1660 | flags, use_lineno); |
| @@ -1692,8 +1685,7 @@ static int ip_set_utest(struct net *net, struct sock *ctnl, struct sk_buff *skb, | |||
| 1692 | if (!set) | 1685 | if (!set) |
| 1693 | return -ENOENT; | 1686 | return -ENOENT; |
| 1694 | 1687 | ||
| 1695 | if (nla_parse_nested(tb, IPSET_ATTR_ADT_MAX, attr[IPSET_ATTR_DATA], | 1688 | if (nla_parse_nested_deprecated(tb, IPSET_ATTR_ADT_MAX, attr[IPSET_ATTR_DATA], set->type->adt_policy, NULL)) |
| 1696 | set->type->adt_policy, NULL)) | ||
| 1697 | return -IPSET_ERR_PROTOCOL; | 1689 | return -IPSET_ERR_PROTOCOL; |
| 1698 | 1690 | ||
| 1699 | rcu_read_lock_bh(); | 1691 | rcu_read_lock_bh(); |
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c index 39892e5d38a2..0e887159425c 100644 --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c | |||
| @@ -3116,8 +3116,7 @@ static int ip_vs_genl_parse_service(struct netns_ipvs *ipvs, | |||
| 3116 | 3116 | ||
| 3117 | /* Parse mandatory identifying service fields first */ | 3117 | /* Parse mandatory identifying service fields first */ |
| 3118 | if (nla == NULL || | 3118 | if (nla == NULL || |
| 3119 | nla_parse_nested(attrs, IPVS_SVC_ATTR_MAX, nla, | 3119 | nla_parse_nested_deprecated(attrs, IPVS_SVC_ATTR_MAX, nla, ip_vs_svc_policy, NULL)) |
| 3120 | ip_vs_svc_policy, NULL)) | ||
| 3121 | return -EINVAL; | 3120 | return -EINVAL; |
| 3122 | 3121 | ||
| 3123 | nla_af = attrs[IPVS_SVC_ATTR_AF]; | 3122 | nla_af = attrs[IPVS_SVC_ATTR_AF]; |
| @@ -3279,8 +3278,7 @@ static int ip_vs_genl_dump_dests(struct sk_buff *skb, | |||
| 3279 | mutex_lock(&__ip_vs_mutex); | 3278 | mutex_lock(&__ip_vs_mutex); |
| 3280 | 3279 | ||
| 3281 | /* Try to find the service for which to dump destinations */ | 3280 | /* Try to find the service for which to dump destinations */ |
| 3282 | if (nlmsg_parse(cb->nlh, GENL_HDRLEN, attrs, IPVS_CMD_ATTR_MAX, | 3281 | if (nlmsg_parse_deprecated(cb->nlh, GENL_HDRLEN, attrs, IPVS_CMD_ATTR_MAX, ip_vs_cmd_policy, cb->extack)) |
| 3283 | ip_vs_cmd_policy, cb->extack)) | ||
| 3284 | goto out_err; | 3282 | goto out_err; |
| 3285 | 3283 | ||
| 3286 | 3284 | ||
| @@ -3316,8 +3314,7 @@ static int ip_vs_genl_parse_dest(struct ip_vs_dest_user_kern *udest, | |||
| 3316 | 3314 | ||
| 3317 | /* Parse mandatory identifying destination fields first */ | 3315 | /* Parse mandatory identifying destination fields first */ |
| 3318 | if (nla == NULL || | 3316 | if (nla == NULL || |
| 3319 | nla_parse_nested(attrs, IPVS_DEST_ATTR_MAX, nla, | 3317 | nla_parse_nested_deprecated(attrs, IPVS_DEST_ATTR_MAX, nla, ip_vs_dest_policy, NULL)) |
| 3320 | ip_vs_dest_policy, NULL)) | ||
| 3321 | return -EINVAL; | 3318 | return -EINVAL; |
| 3322 | 3319 | ||
| 3323 | nla_addr = attrs[IPVS_DEST_ATTR_ADDR]; | 3320 | nla_addr = attrs[IPVS_DEST_ATTR_ADDR]; |
| @@ -3561,9 +3558,7 @@ static int ip_vs_genl_set_daemon(struct sk_buff *skb, struct genl_info *info) | |||
| 3561 | struct nlattr *daemon_attrs[IPVS_DAEMON_ATTR_MAX + 1]; | 3558 | struct nlattr *daemon_attrs[IPVS_DAEMON_ATTR_MAX + 1]; |
| 3562 | 3559 | ||
| 3563 | if (!info->attrs[IPVS_CMD_ATTR_DAEMON] || | 3560 | if (!info->attrs[IPVS_CMD_ATTR_DAEMON] || |
| 3564 | nla_parse_nested(daemon_attrs, IPVS_DAEMON_ATTR_MAX, | 3561 | nla_parse_nested_deprecated(daemon_attrs, IPVS_DAEMON_ATTR_MAX, info->attrs[IPVS_CMD_ATTR_DAEMON], ip_vs_daemon_policy, info->extack)) |
| 3565 | info->attrs[IPVS_CMD_ATTR_DAEMON], | ||
| 3566 | ip_vs_daemon_policy, info->extack)) | ||
| 3567 | goto out; | 3562 | goto out; |
| 3568 | 3563 | ||
| 3569 | if (cmd == IPVS_CMD_NEW_DAEMON) | 3564 | if (cmd == IPVS_CMD_NEW_DAEMON) |
| @@ -3807,82 +3802,98 @@ out: | |||
| 3807 | static const struct genl_ops ip_vs_genl_ops[] = { | 3802 | static const struct genl_ops ip_vs_genl_ops[] = { |
| 3808 | { | 3803 | { |
| 3809 | .cmd = IPVS_CMD_NEW_SERVICE, | 3804 | .cmd = IPVS_CMD_NEW_SERVICE, |
| 3805 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 3810 | .flags = GENL_ADMIN_PERM, | 3806 | .flags = GENL_ADMIN_PERM, |
| 3811 | .doit = ip_vs_genl_set_cmd, | 3807 | .doit = ip_vs_genl_set_cmd, |
| 3812 | }, | 3808 | }, |
| 3813 | { | 3809 | { |
| 3814 | .cmd = IPVS_CMD_SET_SERVICE, | 3810 | .cmd = IPVS_CMD_SET_SERVICE, |
| 3811 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 3815 | .flags = GENL_ADMIN_PERM, | 3812 | .flags = GENL_ADMIN_PERM, |
| 3816 | .doit = ip_vs_genl_set_cmd, | 3813 | .doit = ip_vs_genl_set_cmd, |
| 3817 | }, | 3814 | }, |
| 3818 | { | 3815 | { |
| 3819 | .cmd = IPVS_CMD_DEL_SERVICE, | 3816 | .cmd = IPVS_CMD_DEL_SERVICE, |
| 3817 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 3820 | .flags = GENL_ADMIN_PERM, | 3818 | .flags = GENL_ADMIN_PERM, |
| 3821 | .doit = ip_vs_genl_set_cmd, | 3819 | .doit = ip_vs_genl_set_cmd, |
| 3822 | }, | 3820 | }, |
| 3823 | { | 3821 | { |
| 3824 | .cmd = IPVS_CMD_GET_SERVICE, | 3822 | .cmd = IPVS_CMD_GET_SERVICE, |
| 3823 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 3825 | .flags = GENL_ADMIN_PERM, | 3824 | .flags = GENL_ADMIN_PERM, |
| 3826 | .doit = ip_vs_genl_get_cmd, | 3825 | .doit = ip_vs_genl_get_cmd, |
| 3827 | .dumpit = ip_vs_genl_dump_services, | 3826 | .dumpit = ip_vs_genl_dump_services, |
| 3828 | }, | 3827 | }, |
| 3829 | { | 3828 | { |
| 3830 | .cmd = IPVS_CMD_NEW_DEST, | 3829 | .cmd = IPVS_CMD_NEW_DEST, |
| 3830 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 3831 | .flags = GENL_ADMIN_PERM, | 3831 | .flags = GENL_ADMIN_PERM, |
| 3832 | .doit = ip_vs_genl_set_cmd, | 3832 | .doit = ip_vs_genl_set_cmd, |
| 3833 | }, | 3833 | }, |
| 3834 | { | 3834 | { |
| 3835 | .cmd = IPVS_CMD_SET_DEST, | 3835 | .cmd = IPVS_CMD_SET_DEST, |
| 3836 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 3836 | .flags = GENL_ADMIN_PERM, | 3837 | .flags = GENL_ADMIN_PERM, |
| 3837 | .doit = ip_vs_genl_set_cmd, | 3838 | .doit = ip_vs_genl_set_cmd, |
| 3838 | }, | 3839 | }, |
| 3839 | { | 3840 | { |
| 3840 | .cmd = IPVS_CMD_DEL_DEST, | 3841 | .cmd = IPVS_CMD_DEL_DEST, |
| 3842 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 3841 | .flags = GENL_ADMIN_PERM, | 3843 | .flags = GENL_ADMIN_PERM, |
| 3842 | .doit = ip_vs_genl_set_cmd, | 3844 | .doit = ip_vs_genl_set_cmd, |
| 3843 | }, | 3845 | }, |
| 3844 | { | 3846 | { |
| 3845 | .cmd = IPVS_CMD_GET_DEST, | 3847 | .cmd = IPVS_CMD_GET_DEST, |
| 3848 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 3846 | .flags = GENL_ADMIN_PERM, | 3849 | .flags = GENL_ADMIN_PERM, |
| 3847 | .dumpit = ip_vs_genl_dump_dests, | 3850 | .dumpit = ip_vs_genl_dump_dests, |
| 3848 | }, | 3851 | }, |
| 3849 | { | 3852 | { |
| 3850 | .cmd = IPVS_CMD_NEW_DAEMON, | 3853 | .cmd = IPVS_CMD_NEW_DAEMON, |
| 3854 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 3851 | .flags = GENL_ADMIN_PERM, | 3855 | .flags = GENL_ADMIN_PERM, |
| 3852 | .doit = ip_vs_genl_set_daemon, | 3856 | .doit = ip_vs_genl_set_daemon, |
| 3853 | }, | 3857 | }, |
| 3854 | { | 3858 | { |
| 3855 | .cmd = IPVS_CMD_DEL_DAEMON, | 3859 | .cmd = IPVS_CMD_DEL_DAEMON, |
| 3860 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 3856 | .flags = GENL_ADMIN_PERM, | 3861 | .flags = GENL_ADMIN_PERM, |
| 3857 | .doit = ip_vs_genl_set_daemon, | 3862 | .doit = ip_vs_genl_set_daemon, |
| 3858 | }, | 3863 | }, |
| 3859 | { | 3864 | { |
| 3860 | .cmd = IPVS_CMD_GET_DAEMON, | 3865 | .cmd = IPVS_CMD_GET_DAEMON, |
| 3866 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 3861 | .flags = GENL_ADMIN_PERM, | 3867 | .flags = GENL_ADMIN_PERM, |
| 3862 | .dumpit = ip_vs_genl_dump_daemons, | 3868 | .dumpit = ip_vs_genl_dump_daemons, |
| 3863 | }, | 3869 | }, |
| 3864 | { | 3870 | { |
| 3865 | .cmd = IPVS_CMD_SET_CONFIG, | 3871 | .cmd = IPVS_CMD_SET_CONFIG, |
| 3872 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 3866 | .flags = GENL_ADMIN_PERM, | 3873 | .flags = GENL_ADMIN_PERM, |
| 3867 | .doit = ip_vs_genl_set_cmd, | 3874 | .doit = ip_vs_genl_set_cmd, |
| 3868 | }, | 3875 | }, |
| 3869 | { | 3876 | { |
| 3870 | .cmd = IPVS_CMD_GET_CONFIG, | 3877 | .cmd = IPVS_CMD_GET_CONFIG, |
| 3878 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 3871 | .flags = GENL_ADMIN_PERM, | 3879 | .flags = GENL_ADMIN_PERM, |
| 3872 | .doit = ip_vs_genl_get_cmd, | 3880 | .doit = ip_vs_genl_get_cmd, |
| 3873 | }, | 3881 | }, |
| 3874 | { | 3882 | { |
| 3875 | .cmd = IPVS_CMD_GET_INFO, | 3883 | .cmd = IPVS_CMD_GET_INFO, |
| 3884 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 3876 | .flags = GENL_ADMIN_PERM, | 3885 | .flags = GENL_ADMIN_PERM, |
| 3877 | .doit = ip_vs_genl_get_cmd, | 3886 | .doit = ip_vs_genl_get_cmd, |
| 3878 | }, | 3887 | }, |
| 3879 | { | 3888 | { |
| 3880 | .cmd = IPVS_CMD_ZERO, | 3889 | .cmd = IPVS_CMD_ZERO, |
| 3890 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 3881 | .flags = GENL_ADMIN_PERM, | 3891 | .flags = GENL_ADMIN_PERM, |
| 3882 | .doit = ip_vs_genl_set_cmd, | 3892 | .doit = ip_vs_genl_set_cmd, |
| 3883 | }, | 3893 | }, |
| 3884 | { | 3894 | { |
| 3885 | .cmd = IPVS_CMD_FLUSH, | 3895 | .cmd = IPVS_CMD_FLUSH, |
| 3896 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 3886 | .flags = GENL_ADMIN_PERM, | 3897 | .flags = GENL_ADMIN_PERM, |
| 3887 | .doit = ip_vs_genl_set_cmd, | 3898 | .doit = ip_vs_genl_set_cmd, |
| 3888 | }, | 3899 | }, |
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index 148b99a15b21..8dcc064d518d 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c | |||
| @@ -1020,12 +1020,12 @@ static int ctnetlink_parse_tuple_ip(struct nlattr *attr, | |||
| 1020 | struct nlattr *tb[CTA_IP_MAX+1]; | 1020 | struct nlattr *tb[CTA_IP_MAX+1]; |
| 1021 | int ret = 0; | 1021 | int ret = 0; |
| 1022 | 1022 | ||
| 1023 | ret = nla_parse_nested(tb, CTA_IP_MAX, attr, NULL, NULL); | 1023 | ret = nla_parse_nested_deprecated(tb, CTA_IP_MAX, attr, NULL, NULL); |
| 1024 | if (ret < 0) | 1024 | if (ret < 0) |
| 1025 | return ret; | 1025 | return ret; |
| 1026 | 1026 | ||
| 1027 | ret = nla_validate_nested(attr, CTA_IP_MAX, | 1027 | ret = nla_validate_nested_deprecated(attr, CTA_IP_MAX, |
| 1028 | cta_ip_nla_policy, NULL); | 1028 | cta_ip_nla_policy, NULL); |
| 1029 | if (ret) | 1029 | if (ret) |
| 1030 | return ret; | 1030 | return ret; |
| 1031 | 1031 | ||
| @@ -1052,8 +1052,8 @@ static int ctnetlink_parse_tuple_proto(struct nlattr *attr, | |||
| 1052 | struct nlattr *tb[CTA_PROTO_MAX+1]; | 1052 | struct nlattr *tb[CTA_PROTO_MAX+1]; |
| 1053 | int ret = 0; | 1053 | int ret = 0; |
| 1054 | 1054 | ||
| 1055 | ret = nla_parse_nested(tb, CTA_PROTO_MAX, attr, proto_nla_policy, | 1055 | ret = nla_parse_nested_deprecated(tb, CTA_PROTO_MAX, attr, |
| 1056 | NULL); | 1056 | proto_nla_policy, NULL); |
| 1057 | if (ret < 0) | 1057 | if (ret < 0) |
| 1058 | return ret; | 1058 | return ret; |
| 1059 | 1059 | ||
| @@ -1065,8 +1065,9 @@ static int ctnetlink_parse_tuple_proto(struct nlattr *attr, | |||
| 1065 | l4proto = nf_ct_l4proto_find(tuple->dst.protonum); | 1065 | l4proto = nf_ct_l4proto_find(tuple->dst.protonum); |
| 1066 | 1066 | ||
| 1067 | if (likely(l4proto->nlattr_to_tuple)) { | 1067 | if (likely(l4proto->nlattr_to_tuple)) { |
| 1068 | ret = nla_validate_nested(attr, CTA_PROTO_MAX, | 1068 | ret = nla_validate_nested_deprecated(attr, CTA_PROTO_MAX, |
| 1069 | l4proto->nla_policy, NULL); | 1069 | l4proto->nla_policy, |
| 1070 | NULL); | ||
| 1070 | if (ret == 0) | 1071 | if (ret == 0) |
| 1071 | ret = l4proto->nlattr_to_tuple(tb, tuple); | 1072 | ret = l4proto->nlattr_to_tuple(tb, tuple); |
| 1072 | } | 1073 | } |
| @@ -1129,8 +1130,8 @@ ctnetlink_parse_tuple(const struct nlattr * const cda[], | |||
| 1129 | 1130 | ||
| 1130 | memset(tuple, 0, sizeof(*tuple)); | 1131 | memset(tuple, 0, sizeof(*tuple)); |
| 1131 | 1132 | ||
| 1132 | err = nla_parse_nested(tb, CTA_TUPLE_MAX, cda[type], tuple_nla_policy, | 1133 | err = nla_parse_nested_deprecated(tb, CTA_TUPLE_MAX, cda[type], |
| 1133 | NULL); | 1134 | tuple_nla_policy, NULL); |
| 1134 | if (err < 0) | 1135 | if (err < 0) |
| 1135 | return err; | 1136 | return err; |
| 1136 | 1137 | ||
| @@ -1180,7 +1181,8 @@ static int ctnetlink_parse_help(const struct nlattr *attr, char **helper_name, | |||
| 1180 | int err; | 1181 | int err; |
| 1181 | struct nlattr *tb[CTA_HELP_MAX+1]; | 1182 | struct nlattr *tb[CTA_HELP_MAX+1]; |
| 1182 | 1183 | ||
| 1183 | err = nla_parse_nested(tb, CTA_HELP_MAX, attr, help_nla_policy, NULL); | 1184 | err = nla_parse_nested_deprecated(tb, CTA_HELP_MAX, attr, |
| 1185 | help_nla_policy, NULL); | ||
| 1184 | if (err < 0) | 1186 | if (err < 0) |
| 1185 | return err; | 1187 | return err; |
| 1186 | 1188 | ||
| @@ -1721,8 +1723,8 @@ static int ctnetlink_change_protoinfo(struct nf_conn *ct, | |||
| 1721 | struct nlattr *tb[CTA_PROTOINFO_MAX+1]; | 1723 | struct nlattr *tb[CTA_PROTOINFO_MAX+1]; |
| 1722 | int err = 0; | 1724 | int err = 0; |
| 1723 | 1725 | ||
| 1724 | err = nla_parse_nested(tb, CTA_PROTOINFO_MAX, attr, protoinfo_policy, | 1726 | err = nla_parse_nested_deprecated(tb, CTA_PROTOINFO_MAX, attr, |
| 1725 | NULL); | 1727 | protoinfo_policy, NULL); |
| 1726 | if (err < 0) | 1728 | if (err < 0) |
| 1727 | return err; | 1729 | return err; |
| 1728 | 1730 | ||
| @@ -1745,7 +1747,8 @@ static int change_seq_adj(struct nf_ct_seqadj *seq, | |||
| 1745 | int err; | 1747 | int err; |
| 1746 | struct nlattr *cda[CTA_SEQADJ_MAX+1]; | 1748 | struct nlattr *cda[CTA_SEQADJ_MAX+1]; |
| 1747 | 1749 | ||
| 1748 | err = nla_parse_nested(cda, CTA_SEQADJ_MAX, attr, seqadj_policy, NULL); | 1750 | err = nla_parse_nested_deprecated(cda, CTA_SEQADJ_MAX, attr, |
| 1751 | seqadj_policy, NULL); | ||
| 1749 | if (err < 0) | 1752 | if (err < 0) |
| 1750 | return err; | 1753 | return err; |
| 1751 | 1754 | ||
| @@ -1822,8 +1825,9 @@ static int ctnetlink_change_synproxy(struct nf_conn *ct, | |||
| 1822 | if (!synproxy) | 1825 | if (!synproxy) |
| 1823 | return 0; | 1826 | return 0; |
| 1824 | 1827 | ||
| 1825 | err = nla_parse_nested(tb, CTA_SYNPROXY_MAX, cda[CTA_SYNPROXY], | 1828 | err = nla_parse_nested_deprecated(tb, CTA_SYNPROXY_MAX, |
| 1826 | synproxy_policy, NULL); | 1829 | cda[CTA_SYNPROXY], synproxy_policy, |
| 1830 | NULL); | ||
| 1827 | if (err < 0) | 1831 | if (err < 0) |
| 1828 | return err; | 1832 | return err; |
| 1829 | 1833 | ||
| @@ -2553,7 +2557,8 @@ ctnetlink_glue_parse(const struct nlattr *attr, struct nf_conn *ct) | |||
| 2553 | struct nlattr *cda[CTA_MAX+1]; | 2557 | struct nlattr *cda[CTA_MAX+1]; |
| 2554 | int ret; | 2558 | int ret; |
| 2555 | 2559 | ||
| 2556 | ret = nla_parse_nested(cda, CTA_MAX, attr, ct_nla_policy, NULL); | 2560 | ret = nla_parse_nested_deprecated(cda, CTA_MAX, attr, ct_nla_policy, |
| 2561 | NULL); | ||
| 2557 | if (ret < 0) | 2562 | if (ret < 0) |
| 2558 | return ret; | 2563 | return ret; |
| 2559 | 2564 | ||
| @@ -2586,8 +2591,8 @@ ctnetlink_glue_attach_expect(const struct nlattr *attr, struct nf_conn *ct, | |||
| 2586 | struct nf_conntrack_expect *exp; | 2591 | struct nf_conntrack_expect *exp; |
| 2587 | int err; | 2592 | int err; |
| 2588 | 2593 | ||
| 2589 | err = nla_parse_nested(cda, CTA_EXPECT_MAX, attr, exp_nla_policy, | 2594 | err = nla_parse_nested_deprecated(cda, CTA_EXPECT_MAX, attr, |
| 2590 | NULL); | 2595 | exp_nla_policy, NULL); |
| 2591 | if (err < 0) | 2596 | if (err < 0) |
| 2592 | return err; | 2597 | return err; |
| 2593 | 2598 | ||
| @@ -3209,8 +3214,8 @@ ctnetlink_parse_expect_nat(const struct nlattr *attr, | |||
| 3209 | struct nf_conntrack_tuple nat_tuple = {}; | 3214 | struct nf_conntrack_tuple nat_tuple = {}; |
| 3210 | int err; | 3215 | int err; |
| 3211 | 3216 | ||
| 3212 | err = nla_parse_nested(tb, CTA_EXPECT_NAT_MAX, attr, | 3217 | err = nla_parse_nested_deprecated(tb, CTA_EXPECT_NAT_MAX, attr, |
| 3213 | exp_nat_nla_policy, NULL); | 3218 | exp_nat_nla_policy, NULL); |
| 3214 | if (err < 0) | 3219 | if (err < 0) |
| 3215 | return err; | 3220 | return err; |
| 3216 | 3221 | ||
diff --git a/net/netfilter/nf_conntrack_proto_dccp.c b/net/netfilter/nf_conntrack_proto_dccp.c index a4deddebec0a..7491aa4c3566 100644 --- a/net/netfilter/nf_conntrack_proto_dccp.c +++ b/net/netfilter/nf_conntrack_proto_dccp.c | |||
| @@ -639,8 +639,8 @@ static int nlattr_to_dccp(struct nlattr *cda[], struct nf_conn *ct) | |||
| 639 | if (!attr) | 639 | if (!attr) |
| 640 | return 0; | 640 | return 0; |
| 641 | 641 | ||
| 642 | err = nla_parse_nested(tb, CTA_PROTOINFO_DCCP_MAX, attr, | 642 | err = nla_parse_nested_deprecated(tb, CTA_PROTOINFO_DCCP_MAX, attr, |
| 643 | dccp_nla_policy, NULL); | 643 | dccp_nla_policy, NULL); |
| 644 | if (err < 0) | 644 | if (err < 0) |
| 645 | return err; | 645 | return err; |
| 646 | 646 | ||
diff --git a/net/netfilter/nf_conntrack_proto_sctp.c b/net/netfilter/nf_conntrack_proto_sctp.c index 8cf36b684400..5b8dde266412 100644 --- a/net/netfilter/nf_conntrack_proto_sctp.c +++ b/net/netfilter/nf_conntrack_proto_sctp.c | |||
| @@ -563,8 +563,8 @@ static int nlattr_to_sctp(struct nlattr *cda[], struct nf_conn *ct) | |||
| 563 | if (!attr) | 563 | if (!attr) |
| 564 | return 0; | 564 | return 0; |
| 565 | 565 | ||
| 566 | err = nla_parse_nested(tb, CTA_PROTOINFO_SCTP_MAX, attr, | 566 | err = nla_parse_nested_deprecated(tb, CTA_PROTOINFO_SCTP_MAX, attr, |
| 567 | sctp_nla_policy, NULL); | 567 | sctp_nla_policy, NULL); |
| 568 | if (err < 0) | 568 | if (err < 0) |
| 569 | return err; | 569 | return err; |
| 570 | 570 | ||
diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c index ec6c3618333d..7ba01d8ee165 100644 --- a/net/netfilter/nf_conntrack_proto_tcp.c +++ b/net/netfilter/nf_conntrack_proto_tcp.c | |||
| @@ -1248,8 +1248,8 @@ static int nlattr_to_tcp(struct nlattr *cda[], struct nf_conn *ct) | |||
| 1248 | if (!pattr) | 1248 | if (!pattr) |
| 1249 | return 0; | 1249 | return 0; |
| 1250 | 1250 | ||
| 1251 | err = nla_parse_nested(tb, CTA_PROTOINFO_TCP_MAX, pattr, | 1251 | err = nla_parse_nested_deprecated(tb, CTA_PROTOINFO_TCP_MAX, pattr, |
| 1252 | tcp_nla_policy, NULL); | 1252 | tcp_nla_policy, NULL); |
| 1253 | if (err < 0) | 1253 | if (err < 0) |
| 1254 | return err; | 1254 | return err; |
| 1255 | 1255 | ||
diff --git a/net/netfilter/nf_nat_core.c b/net/netfilter/nf_nat_core.c index 715e3d4d761b..cd94481e6c07 100644 --- a/net/netfilter/nf_nat_core.c +++ b/net/netfilter/nf_nat_core.c | |||
| @@ -890,8 +890,8 @@ static int nfnetlink_parse_nat_proto(struct nlattr *attr, | |||
| 890 | struct nlattr *tb[CTA_PROTONAT_MAX+1]; | 890 | struct nlattr *tb[CTA_PROTONAT_MAX+1]; |
| 891 | int err; | 891 | int err; |
| 892 | 892 | ||
| 893 | err = nla_parse_nested(tb, CTA_PROTONAT_MAX, attr, | 893 | err = nla_parse_nested_deprecated(tb, CTA_PROTONAT_MAX, attr, |
| 894 | protonat_nla_policy, NULL); | 894 | protonat_nla_policy, NULL); |
| 895 | if (err < 0) | 895 | if (err < 0) |
| 896 | return err; | 896 | return err; |
| 897 | 897 | ||
| @@ -949,7 +949,8 @@ nfnetlink_parse_nat(const struct nlattr *nat, | |||
| 949 | 949 | ||
| 950 | memset(range, 0, sizeof(*range)); | 950 | memset(range, 0, sizeof(*range)); |
| 951 | 951 | ||
| 952 | err = nla_parse_nested(tb, CTA_NAT_MAX, nat, nat_nla_policy, NULL); | 952 | err = nla_parse_nested_deprecated(tb, CTA_NAT_MAX, nat, |
| 953 | nat_nla_policy, NULL); | ||
| 953 | if (err < 0) | 954 | if (err < 0) |
| 954 | return err; | 955 | return err; |
| 955 | 956 | ||
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 2b79c250ecb4..d98416e83d4e 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c | |||
| @@ -1420,8 +1420,8 @@ static struct nft_stats __percpu *nft_stats_alloc(const struct nlattr *attr) | |||
| 1420 | struct nft_stats *stats; | 1420 | struct nft_stats *stats; |
| 1421 | int err; | 1421 | int err; |
| 1422 | 1422 | ||
| 1423 | err = nla_parse_nested(tb, NFTA_COUNTER_MAX, attr, nft_counter_policy, | 1423 | err = nla_parse_nested_deprecated(tb, NFTA_COUNTER_MAX, attr, |
| 1424 | NULL); | 1424 | nft_counter_policy, NULL); |
| 1425 | if (err < 0) | 1425 | if (err < 0) |
| 1426 | return ERR_PTR(err); | 1426 | return ERR_PTR(err); |
| 1427 | 1427 | ||
| @@ -1525,8 +1525,9 @@ static int nft_chain_parse_hook(struct net *net, | |||
| 1525 | lockdep_assert_held(&net->nft.commit_mutex); | 1525 | lockdep_assert_held(&net->nft.commit_mutex); |
| 1526 | lockdep_nfnl_nft_mutex_not_held(); | 1526 | lockdep_nfnl_nft_mutex_not_held(); |
| 1527 | 1527 | ||
| 1528 | err = nla_parse_nested(ha, NFTA_HOOK_MAX, nla[NFTA_CHAIN_HOOK], | 1528 | err = nla_parse_nested_deprecated(ha, NFTA_HOOK_MAX, |
| 1529 | nft_hook_policy, NULL); | 1529 | nla[NFTA_CHAIN_HOOK], |
| 1530 | nft_hook_policy, NULL); | ||
| 1530 | if (err < 0) | 1531 | if (err < 0) |
| 1531 | return err; | 1532 | return err; |
| 1532 | 1533 | ||
| @@ -2105,7 +2106,8 @@ static int nf_tables_expr_parse(const struct nft_ctx *ctx, | |||
| 2105 | struct nlattr *tb[NFTA_EXPR_MAX + 1]; | 2106 | struct nlattr *tb[NFTA_EXPR_MAX + 1]; |
| 2106 | int err; | 2107 | int err; |
| 2107 | 2108 | ||
| 2108 | err = nla_parse_nested(tb, NFTA_EXPR_MAX, nla, nft_expr_policy, NULL); | 2109 | err = nla_parse_nested_deprecated(tb, NFTA_EXPR_MAX, nla, |
| 2110 | nft_expr_policy, NULL); | ||
| 2109 | if (err < 0) | 2111 | if (err < 0) |
| 2110 | return err; | 2112 | return err; |
| 2111 | 2113 | ||
| @@ -2114,8 +2116,9 @@ static int nf_tables_expr_parse(const struct nft_ctx *ctx, | |||
| 2114 | return PTR_ERR(type); | 2116 | return PTR_ERR(type); |
| 2115 | 2117 | ||
| 2116 | if (tb[NFTA_EXPR_DATA]) { | 2118 | if (tb[NFTA_EXPR_DATA]) { |
| 2117 | err = nla_parse_nested(info->tb, type->maxattr, | 2119 | err = nla_parse_nested_deprecated(info->tb, type->maxattr, |
| 2118 | tb[NFTA_EXPR_DATA], type->policy, NULL); | 2120 | tb[NFTA_EXPR_DATA], |
| 2121 | type->policy, NULL); | ||
| 2119 | if (err < 0) | 2122 | if (err < 0) |
| 2120 | goto err1; | 2123 | goto err1; |
| 2121 | } else | 2124 | } else |
| @@ -3443,8 +3446,8 @@ static int nf_tables_set_desc_parse(struct nft_set_desc *desc, | |||
| 3443 | struct nlattr *da[NFTA_SET_DESC_MAX + 1]; | 3446 | struct nlattr *da[NFTA_SET_DESC_MAX + 1]; |
| 3444 | int err; | 3447 | int err; |
| 3445 | 3448 | ||
| 3446 | err = nla_parse_nested(da, NFTA_SET_DESC_MAX, nla, | 3449 | err = nla_parse_nested_deprecated(da, NFTA_SET_DESC_MAX, nla, |
| 3447 | nft_set_desc_policy, NULL); | 3450 | nft_set_desc_policy, NULL); |
| 3448 | if (err < 0) | 3451 | if (err < 0) |
| 3449 | return err; | 3452 | return err; |
| 3450 | 3453 | ||
| @@ -4170,8 +4173,8 @@ static int nft_get_set_elem(struct nft_ctx *ctx, struct nft_set *set, | |||
| 4170 | void *priv; | 4173 | void *priv; |
| 4171 | int err; | 4174 | int err; |
| 4172 | 4175 | ||
| 4173 | err = nla_parse_nested(nla, NFTA_SET_ELEM_MAX, attr, | 4176 | err = nla_parse_nested_deprecated(nla, NFTA_SET_ELEM_MAX, attr, |
| 4174 | nft_set_elem_policy, NULL); | 4177 | nft_set_elem_policy, NULL); |
| 4175 | if (err < 0) | 4178 | if (err < 0) |
| 4176 | return err; | 4179 | return err; |
| 4177 | 4180 | ||
| @@ -4402,8 +4405,8 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set, | |||
| 4402 | u8 ulen; | 4405 | u8 ulen; |
| 4403 | int err; | 4406 | int err; |
| 4404 | 4407 | ||
| 4405 | err = nla_parse_nested(nla, NFTA_SET_ELEM_MAX, attr, | 4408 | err = nla_parse_nested_deprecated(nla, NFTA_SET_ELEM_MAX, attr, |
| 4406 | nft_set_elem_policy, NULL); | 4409 | nft_set_elem_policy, NULL); |
| 4407 | if (err < 0) | 4410 | if (err < 0) |
| 4408 | return err; | 4411 | return err; |
| 4409 | 4412 | ||
| @@ -4696,8 +4699,8 @@ static int nft_del_setelem(struct nft_ctx *ctx, struct nft_set *set, | |||
| 4696 | void *priv; | 4699 | void *priv; |
| 4697 | int err; | 4700 | int err; |
| 4698 | 4701 | ||
| 4699 | err = nla_parse_nested(nla, NFTA_SET_ELEM_MAX, attr, | 4702 | err = nla_parse_nested_deprecated(nla, NFTA_SET_ELEM_MAX, attr, |
| 4700 | nft_set_elem_policy, NULL); | 4703 | nft_set_elem_policy, NULL); |
| 4701 | if (err < 0) | 4704 | if (err < 0) |
| 4702 | goto err1; | 4705 | goto err1; |
| 4703 | 4706 | ||
| @@ -4971,8 +4974,8 @@ static struct nft_object *nft_obj_init(const struct nft_ctx *ctx, | |||
| 4971 | goto err1; | 4974 | goto err1; |
| 4972 | 4975 | ||
| 4973 | if (attr) { | 4976 | if (attr) { |
| 4974 | err = nla_parse_nested(tb, type->maxattr, attr, type->policy, | 4977 | err = nla_parse_nested_deprecated(tb, type->maxattr, attr, |
| 4975 | NULL); | 4978 | type->policy, NULL); |
| 4976 | if (err < 0) | 4979 | if (err < 0) |
| 4977 | goto err2; | 4980 | goto err2; |
| 4978 | } else { | 4981 | } else { |
| @@ -5548,8 +5551,8 @@ static int nf_tables_flowtable_parse_hook(const struct nft_ctx *ctx, | |||
| 5548 | int hooknum, priority; | 5551 | int hooknum, priority; |
| 5549 | int err, n = 0, i; | 5552 | int err, n = 0, i; |
| 5550 | 5553 | ||
| 5551 | err = nla_parse_nested(tb, NFTA_FLOWTABLE_HOOK_MAX, attr, | 5554 | err = nla_parse_nested_deprecated(tb, NFTA_FLOWTABLE_HOOK_MAX, attr, |
| 5552 | nft_flowtable_hook_policy, NULL); | 5555 | nft_flowtable_hook_policy, NULL); |
| 5553 | if (err < 0) | 5556 | if (err < 0) |
| 5554 | return err; | 5557 | return err; |
| 5555 | 5558 | ||
| @@ -7206,8 +7209,8 @@ static int nft_verdict_init(const struct nft_ctx *ctx, struct nft_data *data, | |||
| 7206 | struct nft_chain *chain; | 7209 | struct nft_chain *chain; |
| 7207 | int err; | 7210 | int err; |
| 7208 | 7211 | ||
| 7209 | err = nla_parse_nested(tb, NFTA_VERDICT_MAX, nla, nft_verdict_policy, | 7212 | err = nla_parse_nested_deprecated(tb, NFTA_VERDICT_MAX, nla, |
| 7210 | NULL); | 7213 | nft_verdict_policy, NULL); |
| 7211 | if (err < 0) | 7214 | if (err < 0) |
| 7212 | return err; | 7215 | return err; |
| 7213 | 7216 | ||
| @@ -7337,7 +7340,8 @@ int nft_data_init(const struct nft_ctx *ctx, | |||
| 7337 | struct nlattr *tb[NFTA_DATA_MAX + 1]; | 7340 | struct nlattr *tb[NFTA_DATA_MAX + 1]; |
| 7338 | int err; | 7341 | int err; |
| 7339 | 7342 | ||
| 7340 | err = nla_parse_nested(tb, NFTA_DATA_MAX, nla, nft_data_policy, NULL); | 7343 | err = nla_parse_nested_deprecated(tb, NFTA_DATA_MAX, nla, |
| 7344 | nft_data_policy, NULL); | ||
| 7341 | if (err < 0) | 7345 | if (err < 0) |
| 7342 | return err; | 7346 | return err; |
| 7343 | 7347 | ||
diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c index 916913454624..92077d459109 100644 --- a/net/netfilter/nfnetlink.c +++ b/net/netfilter/nfnetlink.c | |||
| @@ -206,8 +206,9 @@ replay: | |||
| 206 | return -ENOMEM; | 206 | return -ENOMEM; |
| 207 | } | 207 | } |
| 208 | 208 | ||
| 209 | err = nla_parse(cda, ss->cb[cb_id].attr_count, attr, attrlen, | 209 | err = nla_parse_deprecated(cda, ss->cb[cb_id].attr_count, |
| 210 | ss->cb[cb_id].policy, extack); | 210 | attr, attrlen, |
| 211 | ss->cb[cb_id].policy, extack); | ||
| 211 | if (err < 0) { | 212 | if (err < 0) { |
| 212 | rcu_read_unlock(); | 213 | rcu_read_unlock(); |
| 213 | return err; | 214 | return err; |
| @@ -421,8 +422,10 @@ replay: | |||
| 421 | goto ack; | 422 | goto ack; |
| 422 | } | 423 | } |
| 423 | 424 | ||
| 424 | err = nla_parse(cda, ss->cb[cb_id].attr_count, attr, | 425 | err = nla_parse_deprecated(cda, |
| 425 | attrlen, ss->cb[cb_id].policy, NULL); | 426 | ss->cb[cb_id].attr_count, |
| 427 | attr, attrlen, | ||
| 428 | ss->cb[cb_id].policy, NULL); | ||
| 426 | if (err < 0) | 429 | if (err < 0) |
| 427 | goto ack; | 430 | goto ack; |
| 428 | 431 | ||
| @@ -520,8 +523,8 @@ static void nfnetlink_rcv_skb_batch(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
| 520 | if (skb->len < NLMSG_HDRLEN + sizeof(struct nfgenmsg)) | 523 | if (skb->len < NLMSG_HDRLEN + sizeof(struct nfgenmsg)) |
| 521 | return; | 524 | return; |
| 522 | 525 | ||
| 523 | err = nla_parse(cda, NFNL_BATCH_MAX, attr, attrlen, nfnl_batch_policy, | 526 | err = nla_parse_deprecated(cda, NFNL_BATCH_MAX, attr, attrlen, |
| 524 | NULL); | 527 | nfnl_batch_policy, NULL); |
| 525 | if (err < 0) { | 528 | if (err < 0) { |
| 526 | netlink_ack(skb, nlh, err, NULL); | 529 | netlink_ack(skb, nlh, err, NULL); |
| 527 | return; | 530 | return; |
diff --git a/net/netfilter/nfnetlink_acct.c b/net/netfilter/nfnetlink_acct.c index 8fa8bf7c48e6..02c877432d71 100644 --- a/net/netfilter/nfnetlink_acct.c +++ b/net/netfilter/nfnetlink_acct.c | |||
| @@ -248,8 +248,8 @@ static int nfnl_acct_start(struct netlink_callback *cb) | |||
| 248 | if (!attr) | 248 | if (!attr) |
| 249 | return 0; | 249 | return 0; |
| 250 | 250 | ||
| 251 | err = nla_parse_nested(tb, NFACCT_FILTER_MAX, attr, filter_policy, | 251 | err = nla_parse_nested_deprecated(tb, NFACCT_FILTER_MAX, attr, |
| 252 | NULL); | 252 | filter_policy, NULL); |
| 253 | if (err < 0) | 253 | if (err < 0) |
| 254 | return err; | 254 | return err; |
| 255 | 255 | ||
diff --git a/net/netfilter/nfnetlink_cthelper.c b/net/netfilter/nfnetlink_cthelper.c index 74c9794d28d6..17eb473a626b 100644 --- a/net/netfilter/nfnetlink_cthelper.c +++ b/net/netfilter/nfnetlink_cthelper.c | |||
| @@ -78,8 +78,8 @@ nfnl_cthelper_parse_tuple(struct nf_conntrack_tuple *tuple, | |||
| 78 | int err; | 78 | int err; |
| 79 | struct nlattr *tb[NFCTH_TUPLE_MAX+1]; | 79 | struct nlattr *tb[NFCTH_TUPLE_MAX+1]; |
| 80 | 80 | ||
| 81 | err = nla_parse_nested(tb, NFCTH_TUPLE_MAX, attr, | 81 | err = nla_parse_nested_deprecated(tb, NFCTH_TUPLE_MAX, attr, |
| 82 | nfnl_cthelper_tuple_pol, NULL); | 82 | nfnl_cthelper_tuple_pol, NULL); |
| 83 | if (err < 0) | 83 | if (err < 0) |
| 84 | return err; | 84 | return err; |
| 85 | 85 | ||
| @@ -139,8 +139,8 @@ nfnl_cthelper_expect_policy(struct nf_conntrack_expect_policy *expect_policy, | |||
| 139 | int err; | 139 | int err; |
| 140 | struct nlattr *tb[NFCTH_POLICY_MAX+1]; | 140 | struct nlattr *tb[NFCTH_POLICY_MAX+1]; |
| 141 | 141 | ||
| 142 | err = nla_parse_nested(tb, NFCTH_POLICY_MAX, attr, | 142 | err = nla_parse_nested_deprecated(tb, NFCTH_POLICY_MAX, attr, |
| 143 | nfnl_cthelper_expect_pol, NULL); | 143 | nfnl_cthelper_expect_pol, NULL); |
| 144 | if (err < 0) | 144 | if (err < 0) |
| 145 | return err; | 145 | return err; |
| 146 | 146 | ||
| @@ -176,8 +176,9 @@ nfnl_cthelper_parse_expect_policy(struct nf_conntrack_helper *helper, | |||
| 176 | struct nlattr *tb[NFCTH_POLICY_SET_MAX+1]; | 176 | struct nlattr *tb[NFCTH_POLICY_SET_MAX+1]; |
| 177 | unsigned int class_max; | 177 | unsigned int class_max; |
| 178 | 178 | ||
| 179 | ret = nla_parse_nested(tb, NFCTH_POLICY_SET_MAX, attr, | 179 | ret = nla_parse_nested_deprecated(tb, NFCTH_POLICY_SET_MAX, attr, |
| 180 | nfnl_cthelper_expect_policy_set, NULL); | 180 | nfnl_cthelper_expect_policy_set, |
| 181 | NULL); | ||
| 181 | if (ret < 0) | 182 | if (ret < 0) |
| 182 | return ret; | 183 | return ret; |
| 183 | 184 | ||
| @@ -289,8 +290,8 @@ nfnl_cthelper_update_policy_one(const struct nf_conntrack_expect_policy *policy, | |||
| 289 | struct nlattr *tb[NFCTH_POLICY_MAX + 1]; | 290 | struct nlattr *tb[NFCTH_POLICY_MAX + 1]; |
| 290 | int err; | 291 | int err; |
| 291 | 292 | ||
| 292 | err = nla_parse_nested(tb, NFCTH_POLICY_MAX, attr, | 293 | err = nla_parse_nested_deprecated(tb, NFCTH_POLICY_MAX, attr, |
| 293 | nfnl_cthelper_expect_pol, NULL); | 294 | nfnl_cthelper_expect_pol, NULL); |
| 294 | if (err < 0) | 295 | if (err < 0) |
| 295 | return err; | 296 | return err; |
| 296 | 297 | ||
| @@ -361,8 +362,9 @@ static int nfnl_cthelper_update_policy(struct nf_conntrack_helper *helper, | |||
| 361 | unsigned int class_max; | 362 | unsigned int class_max; |
| 362 | int err; | 363 | int err; |
| 363 | 364 | ||
| 364 | err = nla_parse_nested(tb, NFCTH_POLICY_SET_MAX, attr, | 365 | err = nla_parse_nested_deprecated(tb, NFCTH_POLICY_SET_MAX, attr, |
| 365 | nfnl_cthelper_expect_policy_set, NULL); | 366 | nfnl_cthelper_expect_policy_set, |
| 367 | NULL); | ||
| 366 | if (err < 0) | 368 | if (err < 0) |
| 367 | return err; | 369 | return err; |
| 368 | 370 | ||
diff --git a/net/netfilter/nfnetlink_cttimeout.c b/net/netfilter/nfnetlink_cttimeout.c index 572cb42e1ee1..427b411c5739 100644 --- a/net/netfilter/nfnetlink_cttimeout.c +++ b/net/netfilter/nfnetlink_cttimeout.c | |||
| @@ -59,8 +59,11 @@ ctnl_timeout_parse_policy(void *timeout, | |||
| 59 | if (!tb) | 59 | if (!tb) |
| 60 | return -ENOMEM; | 60 | return -ENOMEM; |
| 61 | 61 | ||
| 62 | ret = nla_parse_nested(tb, l4proto->ctnl_timeout.nlattr_max, attr, | 62 | ret = nla_parse_nested_deprecated(tb, |
| 63 | l4proto->ctnl_timeout.nla_policy, NULL); | 63 | l4proto->ctnl_timeout.nlattr_max, |
| 64 | attr, | ||
| 65 | l4proto->ctnl_timeout.nla_policy, | ||
| 66 | NULL); | ||
| 64 | if (ret < 0) | 67 | if (ret < 0) |
| 65 | goto err; | 68 | goto err; |
| 66 | 69 | ||
diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c index be7d53943e2d..27dac47b29c2 100644 --- a/net/netfilter/nfnetlink_queue.c +++ b/net/netfilter/nfnetlink_queue.c | |||
| @@ -1139,8 +1139,9 @@ static int nfqa_parse_bridge(struct nf_queue_entry *entry, | |||
| 1139 | struct nlattr *tb[NFQA_VLAN_MAX + 1]; | 1139 | struct nlattr *tb[NFQA_VLAN_MAX + 1]; |
| 1140 | int err; | 1140 | int err; |
| 1141 | 1141 | ||
| 1142 | err = nla_parse_nested(tb, NFQA_VLAN_MAX, nfqa[NFQA_VLAN], | 1142 | err = nla_parse_nested_deprecated(tb, NFQA_VLAN_MAX, |
| 1143 | nfqa_vlan_policy, NULL); | 1143 | nfqa[NFQA_VLAN], |
| 1144 | nfqa_vlan_policy, NULL); | ||
| 1144 | if (err < 0) | 1145 | if (err < 0) |
| 1145 | return err; | 1146 | return err; |
| 1146 | 1147 | ||
diff --git a/net/netfilter/nft_compat.c b/net/netfilter/nft_compat.c index 469f9da5073b..276f1f2d6de1 100644 --- a/net/netfilter/nft_compat.c +++ b/net/netfilter/nft_compat.c | |||
| @@ -198,8 +198,8 @@ static int nft_parse_compat(const struct nlattr *attr, u16 *proto, bool *inv) | |||
| 198 | u32 flags; | 198 | u32 flags; |
| 199 | int err; | 199 | int err; |
| 200 | 200 | ||
| 201 | err = nla_parse_nested(tb, NFTA_RULE_COMPAT_MAX, attr, | 201 | err = nla_parse_nested_deprecated(tb, NFTA_RULE_COMPAT_MAX, attr, |
| 202 | nft_rule_compat_policy, NULL); | 202 | nft_rule_compat_policy, NULL); |
| 203 | if (err < 0) | 203 | if (err < 0) |
| 204 | return err; | 204 | return err; |
| 205 | 205 | ||
diff --git a/net/netfilter/nft_ct.c b/net/netfilter/nft_ct.c index 1738ef6dcb56..b422b74bfe08 100644 --- a/net/netfilter/nft_ct.c +++ b/net/netfilter/nft_ct.c | |||
| @@ -797,9 +797,11 @@ nft_ct_timeout_parse_policy(void *timeouts, | |||
| 797 | if (!tb) | 797 | if (!tb) |
| 798 | return -ENOMEM; | 798 | return -ENOMEM; |
| 799 | 799 | ||
| 800 | ret = nla_parse_nested(tb, l4proto->ctnl_timeout.nlattr_max, | 800 | ret = nla_parse_nested_deprecated(tb, |
| 801 | attr, l4proto->ctnl_timeout.nla_policy, | 801 | l4proto->ctnl_timeout.nlattr_max, |
| 802 | NULL); | 802 | attr, |
| 803 | l4proto->ctnl_timeout.nla_policy, | ||
| 804 | NULL); | ||
| 803 | if (ret < 0) | 805 | if (ret < 0) |
| 804 | goto err; | 806 | goto err; |
| 805 | 807 | ||
diff --git a/net/netfilter/nft_tunnel.c b/net/netfilter/nft_tunnel.c index 66b52d015763..3d4c2ae605a8 100644 --- a/net/netfilter/nft_tunnel.c +++ b/net/netfilter/nft_tunnel.c | |||
| @@ -166,8 +166,8 @@ static int nft_tunnel_obj_ip_init(const struct nft_ctx *ctx, | |||
| 166 | struct nlattr *tb[NFTA_TUNNEL_KEY_IP_MAX + 1]; | 166 | struct nlattr *tb[NFTA_TUNNEL_KEY_IP_MAX + 1]; |
| 167 | int err; | 167 | int err; |
| 168 | 168 | ||
| 169 | err = nla_parse_nested(tb, NFTA_TUNNEL_KEY_IP_MAX, attr, | 169 | err = nla_parse_nested_deprecated(tb, NFTA_TUNNEL_KEY_IP_MAX, attr, |
| 170 | nft_tunnel_ip_policy, NULL); | 170 | nft_tunnel_ip_policy, NULL); |
| 171 | if (err < 0) | 171 | if (err < 0) |
| 172 | return err; | 172 | return err; |
| 173 | 173 | ||
| @@ -195,8 +195,8 @@ static int nft_tunnel_obj_ip6_init(const struct nft_ctx *ctx, | |||
| 195 | struct nlattr *tb[NFTA_TUNNEL_KEY_IP6_MAX + 1]; | 195 | struct nlattr *tb[NFTA_TUNNEL_KEY_IP6_MAX + 1]; |
| 196 | int err; | 196 | int err; |
| 197 | 197 | ||
| 198 | err = nla_parse_nested(tb, NFTA_TUNNEL_KEY_IP6_MAX, attr, | 198 | err = nla_parse_nested_deprecated(tb, NFTA_TUNNEL_KEY_IP6_MAX, attr, |
| 199 | nft_tunnel_ip6_policy, NULL); | 199 | nft_tunnel_ip6_policy, NULL); |
| 200 | if (err < 0) | 200 | if (err < 0) |
| 201 | return err; | 201 | return err; |
| 202 | 202 | ||
| @@ -231,8 +231,8 @@ static int nft_tunnel_obj_vxlan_init(const struct nlattr *attr, | |||
| 231 | struct nlattr *tb[NFTA_TUNNEL_KEY_VXLAN_MAX + 1]; | 231 | struct nlattr *tb[NFTA_TUNNEL_KEY_VXLAN_MAX + 1]; |
| 232 | int err; | 232 | int err; |
| 233 | 233 | ||
| 234 | err = nla_parse_nested(tb, NFTA_TUNNEL_KEY_VXLAN_MAX, attr, | 234 | err = nla_parse_nested_deprecated(tb, NFTA_TUNNEL_KEY_VXLAN_MAX, attr, |
| 235 | nft_tunnel_opts_vxlan_policy, NULL); | 235 | nft_tunnel_opts_vxlan_policy, NULL); |
| 236 | if (err < 0) | 236 | if (err < 0) |
| 237 | return err; | 237 | return err; |
| 238 | 238 | ||
| @@ -260,8 +260,9 @@ static int nft_tunnel_obj_erspan_init(const struct nlattr *attr, | |||
| 260 | uint8_t hwid, dir; | 260 | uint8_t hwid, dir; |
| 261 | int err, version; | 261 | int err, version; |
| 262 | 262 | ||
| 263 | err = nla_parse_nested(tb, NFTA_TUNNEL_KEY_ERSPAN_MAX, attr, | 263 | err = nla_parse_nested_deprecated(tb, NFTA_TUNNEL_KEY_ERSPAN_MAX, |
| 264 | nft_tunnel_opts_erspan_policy, NULL); | 264 | attr, nft_tunnel_opts_erspan_policy, |
| 265 | NULL); | ||
| 265 | if (err < 0) | 266 | if (err < 0) |
| 266 | return err; | 267 | return err; |
| 267 | 268 | ||
| @@ -309,8 +310,8 @@ static int nft_tunnel_obj_opts_init(const struct nft_ctx *ctx, | |||
| 309 | struct nlattr *tb[NFTA_TUNNEL_KEY_OPTS_MAX + 1]; | 310 | struct nlattr *tb[NFTA_TUNNEL_KEY_OPTS_MAX + 1]; |
| 310 | int err; | 311 | int err; |
| 311 | 312 | ||
| 312 | err = nla_parse_nested(tb, NFTA_TUNNEL_KEY_OPTS_MAX, attr, | 313 | err = nla_parse_nested_deprecated(tb, NFTA_TUNNEL_KEY_OPTS_MAX, attr, |
| 313 | nft_tunnel_opts_policy, NULL); | 314 | nft_tunnel_opts_policy, NULL); |
| 314 | if (err < 0) | 315 | if (err < 0) |
| 315 | return err; | 316 | return err; |
| 316 | 317 | ||
diff --git a/net/netlabel/netlabel_calipso.c b/net/netlabel/netlabel_calipso.c index 80184513b2b2..1de87172885d 100644 --- a/net/netlabel/netlabel_calipso.c +++ b/net/netlabel/netlabel_calipso.c | |||
| @@ -321,24 +321,28 @@ static int netlbl_calipso_remove(struct sk_buff *skb, struct genl_info *info) | |||
| 321 | static const struct genl_ops netlbl_calipso_ops[] = { | 321 | static const struct genl_ops netlbl_calipso_ops[] = { |
| 322 | { | 322 | { |
| 323 | .cmd = NLBL_CALIPSO_C_ADD, | 323 | .cmd = NLBL_CALIPSO_C_ADD, |
| 324 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 324 | .flags = GENL_ADMIN_PERM, | 325 | .flags = GENL_ADMIN_PERM, |
| 325 | .doit = netlbl_calipso_add, | 326 | .doit = netlbl_calipso_add, |
| 326 | .dumpit = NULL, | 327 | .dumpit = NULL, |
| 327 | }, | 328 | }, |
| 328 | { | 329 | { |
| 329 | .cmd = NLBL_CALIPSO_C_REMOVE, | 330 | .cmd = NLBL_CALIPSO_C_REMOVE, |
| 331 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 330 | .flags = GENL_ADMIN_PERM, | 332 | .flags = GENL_ADMIN_PERM, |
| 331 | .doit = netlbl_calipso_remove, | 333 | .doit = netlbl_calipso_remove, |
| 332 | .dumpit = NULL, | 334 | .dumpit = NULL, |
| 333 | }, | 335 | }, |
| 334 | { | 336 | { |
| 335 | .cmd = NLBL_CALIPSO_C_LIST, | 337 | .cmd = NLBL_CALIPSO_C_LIST, |
| 338 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 336 | .flags = 0, | 339 | .flags = 0, |
| 337 | .doit = netlbl_calipso_list, | 340 | .doit = netlbl_calipso_list, |
| 338 | .dumpit = NULL, | 341 | .dumpit = NULL, |
| 339 | }, | 342 | }, |
| 340 | { | 343 | { |
| 341 | .cmd = NLBL_CALIPSO_C_LISTALL, | 344 | .cmd = NLBL_CALIPSO_C_LISTALL, |
| 345 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 342 | .flags = 0, | 346 | .flags = 0, |
| 343 | .doit = NULL, | 347 | .doit = NULL, |
| 344 | .dumpit = netlbl_calipso_listall, | 348 | .dumpit = netlbl_calipso_listall, |
diff --git a/net/netlabel/netlabel_cipso_v4.c b/net/netlabel/netlabel_cipso_v4.c index c9775658fb98..5d1121981d0b 100644 --- a/net/netlabel/netlabel_cipso_v4.c +++ b/net/netlabel/netlabel_cipso_v4.c | |||
| @@ -99,9 +99,10 @@ static int netlbl_cipsov4_add_common(struct genl_info *info, | |||
| 99 | 99 | ||
| 100 | doi_def->doi = nla_get_u32(info->attrs[NLBL_CIPSOV4_A_DOI]); | 100 | doi_def->doi = nla_get_u32(info->attrs[NLBL_CIPSOV4_A_DOI]); |
| 101 | 101 | ||
| 102 | if (nla_validate_nested(info->attrs[NLBL_CIPSOV4_A_TAGLST], | 102 | if (nla_validate_nested_deprecated(info->attrs[NLBL_CIPSOV4_A_TAGLST], |
| 103 | NLBL_CIPSOV4_A_MAX, | 103 | NLBL_CIPSOV4_A_MAX, |
| 104 | netlbl_cipsov4_genl_policy, NULL) != 0) | 104 | netlbl_cipsov4_genl_policy, |
| 105 | NULL) != 0) | ||
| 105 | return -EINVAL; | 106 | return -EINVAL; |
| 106 | 107 | ||
| 107 | nla_for_each_nested(nla, info->attrs[NLBL_CIPSOV4_A_TAGLST], nla_rem) | 108 | nla_for_each_nested(nla, info->attrs[NLBL_CIPSOV4_A_TAGLST], nla_rem) |
| @@ -146,9 +147,10 @@ static int netlbl_cipsov4_add_std(struct genl_info *info, | |||
| 146 | !info->attrs[NLBL_CIPSOV4_A_MLSLVLLST]) | 147 | !info->attrs[NLBL_CIPSOV4_A_MLSLVLLST]) |
| 147 | return -EINVAL; | 148 | return -EINVAL; |
| 148 | 149 | ||
| 149 | if (nla_validate_nested(info->attrs[NLBL_CIPSOV4_A_MLSLVLLST], | 150 | if (nla_validate_nested_deprecated(info->attrs[NLBL_CIPSOV4_A_MLSLVLLST], |
| 150 | NLBL_CIPSOV4_A_MAX, | 151 | NLBL_CIPSOV4_A_MAX, |
| 151 | netlbl_cipsov4_genl_policy, NULL) != 0) | 152 | netlbl_cipsov4_genl_policy, |
| 153 | NULL) != 0) | ||
| 152 | return -EINVAL; | 154 | return -EINVAL; |
| 153 | 155 | ||
| 154 | doi_def = kmalloc(sizeof(*doi_def), GFP_KERNEL); | 156 | doi_def = kmalloc(sizeof(*doi_def), GFP_KERNEL); |
| @@ -170,9 +172,10 @@ static int netlbl_cipsov4_add_std(struct genl_info *info, | |||
| 170 | info->attrs[NLBL_CIPSOV4_A_MLSLVLLST], | 172 | info->attrs[NLBL_CIPSOV4_A_MLSLVLLST], |
| 171 | nla_a_rem) | 173 | nla_a_rem) |
| 172 | if (nla_type(nla_a) == NLBL_CIPSOV4_A_MLSLVL) { | 174 | if (nla_type(nla_a) == NLBL_CIPSOV4_A_MLSLVL) { |
| 173 | if (nla_validate_nested(nla_a, NLBL_CIPSOV4_A_MAX, | 175 | if (nla_validate_nested_deprecated(nla_a, |
| 174 | netlbl_cipsov4_genl_policy, | 176 | NLBL_CIPSOV4_A_MAX, |
| 175 | NULL) != 0) | 177 | netlbl_cipsov4_genl_policy, |
| 178 | NULL) != 0) | ||
| 176 | goto add_std_failure; | 179 | goto add_std_failure; |
| 177 | nla_for_each_nested(nla_b, nla_a, nla_b_rem) | 180 | nla_for_each_nested(nla_b, nla_a, nla_b_rem) |
| 178 | switch (nla_type(nla_b)) { | 181 | switch (nla_type(nla_b)) { |
| @@ -234,19 +237,20 @@ static int netlbl_cipsov4_add_std(struct genl_info *info, | |||
| 234 | } | 237 | } |
| 235 | 238 | ||
| 236 | if (info->attrs[NLBL_CIPSOV4_A_MLSCATLST]) { | 239 | if (info->attrs[NLBL_CIPSOV4_A_MLSCATLST]) { |
| 237 | if (nla_validate_nested(info->attrs[NLBL_CIPSOV4_A_MLSCATLST], | 240 | if (nla_validate_nested_deprecated(info->attrs[NLBL_CIPSOV4_A_MLSCATLST], |
| 238 | NLBL_CIPSOV4_A_MAX, | 241 | NLBL_CIPSOV4_A_MAX, |
| 239 | netlbl_cipsov4_genl_policy, NULL) != 0) | 242 | netlbl_cipsov4_genl_policy, |
| 243 | NULL) != 0) | ||
| 240 | goto add_std_failure; | 244 | goto add_std_failure; |
| 241 | 245 | ||
| 242 | nla_for_each_nested(nla_a, | 246 | nla_for_each_nested(nla_a, |
| 243 | info->attrs[NLBL_CIPSOV4_A_MLSCATLST], | 247 | info->attrs[NLBL_CIPSOV4_A_MLSCATLST], |
| 244 | nla_a_rem) | 248 | nla_a_rem) |
| 245 | if (nla_type(nla_a) == NLBL_CIPSOV4_A_MLSCAT) { | 249 | if (nla_type(nla_a) == NLBL_CIPSOV4_A_MLSCAT) { |
| 246 | if (nla_validate_nested(nla_a, | 250 | if (nla_validate_nested_deprecated(nla_a, |
| 247 | NLBL_CIPSOV4_A_MAX, | 251 | NLBL_CIPSOV4_A_MAX, |
| 248 | netlbl_cipsov4_genl_policy, | 252 | netlbl_cipsov4_genl_policy, |
| 249 | NULL) != 0) | 253 | NULL) != 0) |
| 250 | goto add_std_failure; | 254 | goto add_std_failure; |
| 251 | nla_for_each_nested(nla_b, nla_a, nla_b_rem) | 255 | nla_for_each_nested(nla_b, nla_a, nla_b_rem) |
| 252 | switch (nla_type(nla_b)) { | 256 | switch (nla_type(nla_b)) { |
| @@ -737,24 +741,28 @@ static int netlbl_cipsov4_remove(struct sk_buff *skb, struct genl_info *info) | |||
| 737 | static const struct genl_ops netlbl_cipsov4_ops[] = { | 741 | static const struct genl_ops netlbl_cipsov4_ops[] = { |
| 738 | { | 742 | { |
| 739 | .cmd = NLBL_CIPSOV4_C_ADD, | 743 | .cmd = NLBL_CIPSOV4_C_ADD, |
| 744 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 740 | .flags = GENL_ADMIN_PERM, | 745 | .flags = GENL_ADMIN_PERM, |
| 741 | .doit = netlbl_cipsov4_add, | 746 | .doit = netlbl_cipsov4_add, |
| 742 | .dumpit = NULL, | 747 | .dumpit = NULL, |
| 743 | }, | 748 | }, |
| 744 | { | 749 | { |
| 745 | .cmd = NLBL_CIPSOV4_C_REMOVE, | 750 | .cmd = NLBL_CIPSOV4_C_REMOVE, |
| 751 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 746 | .flags = GENL_ADMIN_PERM, | 752 | .flags = GENL_ADMIN_PERM, |
| 747 | .doit = netlbl_cipsov4_remove, | 753 | .doit = netlbl_cipsov4_remove, |
| 748 | .dumpit = NULL, | 754 | .dumpit = NULL, |
| 749 | }, | 755 | }, |
| 750 | { | 756 | { |
| 751 | .cmd = NLBL_CIPSOV4_C_LIST, | 757 | .cmd = NLBL_CIPSOV4_C_LIST, |
| 758 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 752 | .flags = 0, | 759 | .flags = 0, |
| 753 | .doit = netlbl_cipsov4_list, | 760 | .doit = netlbl_cipsov4_list, |
| 754 | .dumpit = NULL, | 761 | .dumpit = NULL, |
| 755 | }, | 762 | }, |
| 756 | { | 763 | { |
| 757 | .cmd = NLBL_CIPSOV4_C_LISTALL, | 764 | .cmd = NLBL_CIPSOV4_C_LISTALL, |
| 765 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 758 | .flags = 0, | 766 | .flags = 0, |
| 759 | .doit = NULL, | 767 | .doit = NULL, |
| 760 | .dumpit = netlbl_cipsov4_listall, | 768 | .dumpit = netlbl_cipsov4_listall, |
diff --git a/net/netlabel/netlabel_mgmt.c b/net/netlabel/netlabel_mgmt.c index c6c8a101f2ff..cae04f207782 100644 --- a/net/netlabel/netlabel_mgmt.c +++ b/net/netlabel/netlabel_mgmt.c | |||
| @@ -774,48 +774,56 @@ version_failure: | |||
| 774 | static const struct genl_ops netlbl_mgmt_genl_ops[] = { | 774 | static const struct genl_ops netlbl_mgmt_genl_ops[] = { |
| 775 | { | 775 | { |
| 776 | .cmd = NLBL_MGMT_C_ADD, | 776 | .cmd = NLBL_MGMT_C_ADD, |
| 777 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 777 | .flags = GENL_ADMIN_PERM, | 778 | .flags = GENL_ADMIN_PERM, |
| 778 | .doit = netlbl_mgmt_add, | 779 | .doit = netlbl_mgmt_add, |
| 779 | .dumpit = NULL, | 780 | .dumpit = NULL, |
| 780 | }, | 781 | }, |
| 781 | { | 782 | { |
| 782 | .cmd = NLBL_MGMT_C_REMOVE, | 783 | .cmd = NLBL_MGMT_C_REMOVE, |
| 784 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 783 | .flags = GENL_ADMIN_PERM, | 785 | .flags = GENL_ADMIN_PERM, |
| 784 | .doit = netlbl_mgmt_remove, | 786 | .doit = netlbl_mgmt_remove, |
| 785 | .dumpit = NULL, | 787 | .dumpit = NULL, |
| 786 | }, | 788 | }, |
| 787 | { | 789 | { |
| 788 | .cmd = NLBL_MGMT_C_LISTALL, | 790 | .cmd = NLBL_MGMT_C_LISTALL, |
| 791 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 789 | .flags = 0, | 792 | .flags = 0, |
| 790 | .doit = NULL, | 793 | .doit = NULL, |
| 791 | .dumpit = netlbl_mgmt_listall, | 794 | .dumpit = netlbl_mgmt_listall, |
| 792 | }, | 795 | }, |
| 793 | { | 796 | { |
| 794 | .cmd = NLBL_MGMT_C_ADDDEF, | 797 | .cmd = NLBL_MGMT_C_ADDDEF, |
| 798 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 795 | .flags = GENL_ADMIN_PERM, | 799 | .flags = GENL_ADMIN_PERM, |
| 796 | .doit = netlbl_mgmt_adddef, | 800 | .doit = netlbl_mgmt_adddef, |
| 797 | .dumpit = NULL, | 801 | .dumpit = NULL, |
| 798 | }, | 802 | }, |
| 799 | { | 803 | { |
| 800 | .cmd = NLBL_MGMT_C_REMOVEDEF, | 804 | .cmd = NLBL_MGMT_C_REMOVEDEF, |
| 805 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 801 | .flags = GENL_ADMIN_PERM, | 806 | .flags = GENL_ADMIN_PERM, |
| 802 | .doit = netlbl_mgmt_removedef, | 807 | .doit = netlbl_mgmt_removedef, |
| 803 | .dumpit = NULL, | 808 | .dumpit = NULL, |
| 804 | }, | 809 | }, |
| 805 | { | 810 | { |
| 806 | .cmd = NLBL_MGMT_C_LISTDEF, | 811 | .cmd = NLBL_MGMT_C_LISTDEF, |
| 812 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 807 | .flags = 0, | 813 | .flags = 0, |
| 808 | .doit = netlbl_mgmt_listdef, | 814 | .doit = netlbl_mgmt_listdef, |
| 809 | .dumpit = NULL, | 815 | .dumpit = NULL, |
| 810 | }, | 816 | }, |
| 811 | { | 817 | { |
| 812 | .cmd = NLBL_MGMT_C_PROTOCOLS, | 818 | .cmd = NLBL_MGMT_C_PROTOCOLS, |
| 819 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 813 | .flags = 0, | 820 | .flags = 0, |
| 814 | .doit = NULL, | 821 | .doit = NULL, |
| 815 | .dumpit = netlbl_mgmt_protocols, | 822 | .dumpit = netlbl_mgmt_protocols, |
| 816 | }, | 823 | }, |
| 817 | { | 824 | { |
| 818 | .cmd = NLBL_MGMT_C_VERSION, | 825 | .cmd = NLBL_MGMT_C_VERSION, |
| 826 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 819 | .flags = 0, | 827 | .flags = 0, |
| 820 | .doit = netlbl_mgmt_version, | 828 | .doit = netlbl_mgmt_version, |
| 821 | .dumpit = NULL, | 829 | .dumpit = NULL, |
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c index 6b1b6c2b5141..b87dd34e1835 100644 --- a/net/netlabel/netlabel_unlabeled.c +++ b/net/netlabel/netlabel_unlabeled.c | |||
| @@ -1317,48 +1317,56 @@ unlabel_staticlistdef_return: | |||
| 1317 | static const struct genl_ops netlbl_unlabel_genl_ops[] = { | 1317 | static const struct genl_ops netlbl_unlabel_genl_ops[] = { |
| 1318 | { | 1318 | { |
| 1319 | .cmd = NLBL_UNLABEL_C_STATICADD, | 1319 | .cmd = NLBL_UNLABEL_C_STATICADD, |
| 1320 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1320 | .flags = GENL_ADMIN_PERM, | 1321 | .flags = GENL_ADMIN_PERM, |
| 1321 | .doit = netlbl_unlabel_staticadd, | 1322 | .doit = netlbl_unlabel_staticadd, |
| 1322 | .dumpit = NULL, | 1323 | .dumpit = NULL, |
| 1323 | }, | 1324 | }, |
| 1324 | { | 1325 | { |
| 1325 | .cmd = NLBL_UNLABEL_C_STATICREMOVE, | 1326 | .cmd = NLBL_UNLABEL_C_STATICREMOVE, |
| 1327 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1326 | .flags = GENL_ADMIN_PERM, | 1328 | .flags = GENL_ADMIN_PERM, |
| 1327 | .doit = netlbl_unlabel_staticremove, | 1329 | .doit = netlbl_unlabel_staticremove, |
| 1328 | .dumpit = NULL, | 1330 | .dumpit = NULL, |
| 1329 | }, | 1331 | }, |
| 1330 | { | 1332 | { |
| 1331 | .cmd = NLBL_UNLABEL_C_STATICLIST, | 1333 | .cmd = NLBL_UNLABEL_C_STATICLIST, |
| 1334 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1332 | .flags = 0, | 1335 | .flags = 0, |
| 1333 | .doit = NULL, | 1336 | .doit = NULL, |
| 1334 | .dumpit = netlbl_unlabel_staticlist, | 1337 | .dumpit = netlbl_unlabel_staticlist, |
| 1335 | }, | 1338 | }, |
| 1336 | { | 1339 | { |
| 1337 | .cmd = NLBL_UNLABEL_C_STATICADDDEF, | 1340 | .cmd = NLBL_UNLABEL_C_STATICADDDEF, |
| 1341 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1338 | .flags = GENL_ADMIN_PERM, | 1342 | .flags = GENL_ADMIN_PERM, |
| 1339 | .doit = netlbl_unlabel_staticadddef, | 1343 | .doit = netlbl_unlabel_staticadddef, |
| 1340 | .dumpit = NULL, | 1344 | .dumpit = NULL, |
| 1341 | }, | 1345 | }, |
| 1342 | { | 1346 | { |
| 1343 | .cmd = NLBL_UNLABEL_C_STATICREMOVEDEF, | 1347 | .cmd = NLBL_UNLABEL_C_STATICREMOVEDEF, |
| 1348 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1344 | .flags = GENL_ADMIN_PERM, | 1349 | .flags = GENL_ADMIN_PERM, |
| 1345 | .doit = netlbl_unlabel_staticremovedef, | 1350 | .doit = netlbl_unlabel_staticremovedef, |
| 1346 | .dumpit = NULL, | 1351 | .dumpit = NULL, |
| 1347 | }, | 1352 | }, |
| 1348 | { | 1353 | { |
| 1349 | .cmd = NLBL_UNLABEL_C_STATICLISTDEF, | 1354 | .cmd = NLBL_UNLABEL_C_STATICLISTDEF, |
| 1355 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1350 | .flags = 0, | 1356 | .flags = 0, |
| 1351 | .doit = NULL, | 1357 | .doit = NULL, |
| 1352 | .dumpit = netlbl_unlabel_staticlistdef, | 1358 | .dumpit = netlbl_unlabel_staticlistdef, |
| 1353 | }, | 1359 | }, |
| 1354 | { | 1360 | { |
| 1355 | .cmd = NLBL_UNLABEL_C_ACCEPT, | 1361 | .cmd = NLBL_UNLABEL_C_ACCEPT, |
| 1362 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1356 | .flags = GENL_ADMIN_PERM, | 1363 | .flags = GENL_ADMIN_PERM, |
| 1357 | .doit = netlbl_unlabel_accept, | 1364 | .doit = netlbl_unlabel_accept, |
| 1358 | .dumpit = NULL, | 1365 | .dumpit = NULL, |
| 1359 | }, | 1366 | }, |
| 1360 | { | 1367 | { |
| 1361 | .cmd = NLBL_UNLABEL_C_LIST, | 1368 | .cmd = NLBL_UNLABEL_C_LIST, |
| 1369 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1362 | .flags = 0, | 1370 | .flags = 0, |
| 1363 | .doit = netlbl_unlabel_list, | 1371 | .doit = netlbl_unlabel_list, |
| 1364 | .dumpit = NULL, | 1372 | .dumpit = NULL, |
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c index 83e876591f6c..72668759cd2b 100644 --- a/net/netlink/genetlink.c +++ b/net/netlink/genetlink.c | |||
| @@ -536,6 +536,24 @@ static int genl_family_rcv_msg(const struct genl_family *family, | |||
| 536 | if (ops->dumpit == NULL) | 536 | if (ops->dumpit == NULL) |
| 537 | return -EOPNOTSUPP; | 537 | return -EOPNOTSUPP; |
| 538 | 538 | ||
| 539 | if (!(ops->validate & GENL_DONT_VALIDATE_DUMP)) { | ||
| 540 | unsigned int validate = NL_VALIDATE_STRICT; | ||
| 541 | int hdrlen = GENL_HDRLEN + family->hdrsize; | ||
| 542 | |||
| 543 | if (ops->validate & GENL_DONT_VALIDATE_DUMP_STRICT) | ||
| 544 | validate = NL_VALIDATE_LIBERAL; | ||
| 545 | |||
| 546 | if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) | ||
| 547 | return -EINVAL; | ||
| 548 | |||
| 549 | rc = __nla_validate(nlmsg_attrdata(nlh, hdrlen), | ||
| 550 | nlmsg_attrlen(nlh, hdrlen), | ||
| 551 | family->maxattr, family->policy, | ||
| 552 | validate, extack); | ||
| 553 | if (rc) | ||
| 554 | return rc; | ||
| 555 | } | ||
| 556 | |||
| 539 | if (!family->parallel_ops) { | 557 | if (!family->parallel_ops) { |
| 540 | struct netlink_dump_control c = { | 558 | struct netlink_dump_control c = { |
| 541 | .module = family->module, | 559 | .module = family->module, |
| @@ -577,8 +595,13 @@ static int genl_family_rcv_msg(const struct genl_family *family, | |||
| 577 | attrbuf = family->attrbuf; | 595 | attrbuf = family->attrbuf; |
| 578 | 596 | ||
| 579 | if (attrbuf) { | 597 | if (attrbuf) { |
| 580 | err = nlmsg_parse(nlh, hdrlen, attrbuf, family->maxattr, | 598 | enum netlink_validation validate = NL_VALIDATE_STRICT; |
| 581 | family->policy, extack); | 599 | |
| 600 | if (ops->validate & GENL_DONT_VALIDATE_STRICT) | ||
| 601 | validate = NL_VALIDATE_LIBERAL; | ||
| 602 | |||
| 603 | err = __nlmsg_parse(nlh, hdrlen, attrbuf, family->maxattr, | ||
| 604 | family->policy, validate, extack); | ||
| 582 | if (err < 0) | 605 | if (err < 0) |
| 583 | goto out; | 606 | goto out; |
| 584 | } | 607 | } |
| @@ -938,6 +961,7 @@ static int genl_ctrl_event(int event, const struct genl_family *family, | |||
| 938 | static const struct genl_ops genl_ctrl_ops[] = { | 961 | static const struct genl_ops genl_ctrl_ops[] = { |
| 939 | { | 962 | { |
| 940 | .cmd = CTRL_CMD_GETFAMILY, | 963 | .cmd = CTRL_CMD_GETFAMILY, |
| 964 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 941 | .doit = ctrl_getfamily, | 965 | .doit = ctrl_getfamily, |
| 942 | .dumpit = ctrl_dumpfamily, | 966 | .dumpit = ctrl_dumpfamily, |
| 943 | }, | 967 | }, |
diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c index f91ce7c82746..04a8e47674ec 100644 --- a/net/nfc/netlink.c +++ b/net/nfc/netlink.c | |||
| @@ -119,9 +119,10 @@ static struct nfc_dev *__get_device_from_cb(struct netlink_callback *cb) | |||
| 119 | int rc; | 119 | int rc; |
| 120 | u32 idx; | 120 | u32 idx; |
| 121 | 121 | ||
| 122 | rc = nlmsg_parse(cb->nlh, GENL_HDRLEN + nfc_genl_family.hdrsize, | 122 | rc = nlmsg_parse_deprecated(cb->nlh, |
| 123 | attrbuf, nfc_genl_family.maxattr, nfc_genl_policy, | 123 | GENL_HDRLEN + nfc_genl_family.hdrsize, |
| 124 | NULL); | 124 | attrbuf, nfc_genl_family.maxattr, |
| 125 | nfc_genl_policy, NULL); | ||
| 125 | if (rc < 0) | 126 | if (rc < 0) |
| 126 | return ERR_PTR(rc); | 127 | return ERR_PTR(rc); |
| 127 | 128 | ||
| @@ -1177,8 +1178,9 @@ static int nfc_genl_llc_sdreq(struct sk_buff *skb, struct genl_info *info) | |||
| 1177 | tlvs_len = 0; | 1178 | tlvs_len = 0; |
| 1178 | 1179 | ||
| 1179 | nla_for_each_nested(attr, info->attrs[NFC_ATTR_LLC_SDP], rem) { | 1180 | nla_for_each_nested(attr, info->attrs[NFC_ATTR_LLC_SDP], rem) { |
| 1180 | rc = nla_parse_nested(sdp_attrs, NFC_SDP_ATTR_MAX, attr, | 1181 | rc = nla_parse_nested_deprecated(sdp_attrs, NFC_SDP_ATTR_MAX, |
| 1181 | nfc_sdp_genl_policy, info->extack); | 1182 | attr, nfc_sdp_genl_policy, |
| 1183 | info->extack); | ||
| 1182 | 1184 | ||
| 1183 | if (rc != 0) { | 1185 | if (rc != 0) { |
| 1184 | rc = -EINVAL; | 1186 | rc = -EINVAL; |
| @@ -1667,82 +1669,101 @@ EXPORT_SYMBOL(nfc_vendor_cmd_reply); | |||
| 1667 | static const struct genl_ops nfc_genl_ops[] = { | 1669 | static const struct genl_ops nfc_genl_ops[] = { |
| 1668 | { | 1670 | { |
| 1669 | .cmd = NFC_CMD_GET_DEVICE, | 1671 | .cmd = NFC_CMD_GET_DEVICE, |
| 1672 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1670 | .doit = nfc_genl_get_device, | 1673 | .doit = nfc_genl_get_device, |
| 1671 | .dumpit = nfc_genl_dump_devices, | 1674 | .dumpit = nfc_genl_dump_devices, |
| 1672 | .done = nfc_genl_dump_devices_done, | 1675 | .done = nfc_genl_dump_devices_done, |
| 1673 | }, | 1676 | }, |
| 1674 | { | 1677 | { |
| 1675 | .cmd = NFC_CMD_DEV_UP, | 1678 | .cmd = NFC_CMD_DEV_UP, |
| 1679 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1676 | .doit = nfc_genl_dev_up, | 1680 | .doit = nfc_genl_dev_up, |
| 1677 | }, | 1681 | }, |
| 1678 | { | 1682 | { |
| 1679 | .cmd = NFC_CMD_DEV_DOWN, | 1683 | .cmd = NFC_CMD_DEV_DOWN, |
| 1684 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1680 | .doit = nfc_genl_dev_down, | 1685 | .doit = nfc_genl_dev_down, |
| 1681 | }, | 1686 | }, |
| 1682 | { | 1687 | { |
| 1683 | .cmd = NFC_CMD_START_POLL, | 1688 | .cmd = NFC_CMD_START_POLL, |
| 1689 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1684 | .doit = nfc_genl_start_poll, | 1690 | .doit = nfc_genl_start_poll, |
| 1685 | }, | 1691 | }, |
| 1686 | { | 1692 | { |
| 1687 | .cmd = NFC_CMD_STOP_POLL, | 1693 | .cmd = NFC_CMD_STOP_POLL, |
| 1694 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1688 | .doit = nfc_genl_stop_poll, | 1695 | .doit = nfc_genl_stop_poll, |
| 1689 | }, | 1696 | }, |
| 1690 | { | 1697 | { |
| 1691 | .cmd = NFC_CMD_DEP_LINK_UP, | 1698 | .cmd = NFC_CMD_DEP_LINK_UP, |
| 1699 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1692 | .doit = nfc_genl_dep_link_up, | 1700 | .doit = nfc_genl_dep_link_up, |
| 1693 | }, | 1701 | }, |
| 1694 | { | 1702 | { |
| 1695 | .cmd = NFC_CMD_DEP_LINK_DOWN, | 1703 | .cmd = NFC_CMD_DEP_LINK_DOWN, |
| 1704 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1696 | .doit = nfc_genl_dep_link_down, | 1705 | .doit = nfc_genl_dep_link_down, |
| 1697 | }, | 1706 | }, |
| 1698 | { | 1707 | { |
| 1699 | .cmd = NFC_CMD_GET_TARGET, | 1708 | .cmd = NFC_CMD_GET_TARGET, |
| 1709 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1700 | .dumpit = nfc_genl_dump_targets, | 1710 | .dumpit = nfc_genl_dump_targets, |
| 1701 | .done = nfc_genl_dump_targets_done, | 1711 | .done = nfc_genl_dump_targets_done, |
| 1702 | }, | 1712 | }, |
| 1703 | { | 1713 | { |
| 1704 | .cmd = NFC_CMD_LLC_GET_PARAMS, | 1714 | .cmd = NFC_CMD_LLC_GET_PARAMS, |
| 1715 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1705 | .doit = nfc_genl_llc_get_params, | 1716 | .doit = nfc_genl_llc_get_params, |
| 1706 | }, | 1717 | }, |
| 1707 | { | 1718 | { |
| 1708 | .cmd = NFC_CMD_LLC_SET_PARAMS, | 1719 | .cmd = NFC_CMD_LLC_SET_PARAMS, |
| 1720 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1709 | .doit = nfc_genl_llc_set_params, | 1721 | .doit = nfc_genl_llc_set_params, |
| 1710 | }, | 1722 | }, |
| 1711 | { | 1723 | { |
| 1712 | .cmd = NFC_CMD_LLC_SDREQ, | 1724 | .cmd = NFC_CMD_LLC_SDREQ, |
| 1725 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1713 | .doit = nfc_genl_llc_sdreq, | 1726 | .doit = nfc_genl_llc_sdreq, |
| 1714 | }, | 1727 | }, |
| 1715 | { | 1728 | { |
| 1716 | .cmd = NFC_CMD_FW_DOWNLOAD, | 1729 | .cmd = NFC_CMD_FW_DOWNLOAD, |
| 1730 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1717 | .doit = nfc_genl_fw_download, | 1731 | .doit = nfc_genl_fw_download, |
| 1718 | }, | 1732 | }, |
| 1719 | { | 1733 | { |
| 1720 | .cmd = NFC_CMD_ENABLE_SE, | 1734 | .cmd = NFC_CMD_ENABLE_SE, |
| 1735 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1721 | .doit = nfc_genl_enable_se, | 1736 | .doit = nfc_genl_enable_se, |
| 1722 | }, | 1737 | }, |
| 1723 | { | 1738 | { |
| 1724 | .cmd = NFC_CMD_DISABLE_SE, | 1739 | .cmd = NFC_CMD_DISABLE_SE, |
| 1740 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1725 | .doit = nfc_genl_disable_se, | 1741 | .doit = nfc_genl_disable_se, |
| 1726 | }, | 1742 | }, |
| 1727 | { | 1743 | { |
| 1728 | .cmd = NFC_CMD_GET_SE, | 1744 | .cmd = NFC_CMD_GET_SE, |
| 1745 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1729 | .dumpit = nfc_genl_dump_ses, | 1746 | .dumpit = nfc_genl_dump_ses, |
| 1730 | .done = nfc_genl_dump_ses_done, | 1747 | .done = nfc_genl_dump_ses_done, |
| 1731 | }, | 1748 | }, |
| 1732 | { | 1749 | { |
| 1733 | .cmd = NFC_CMD_SE_IO, | 1750 | .cmd = NFC_CMD_SE_IO, |
| 1751 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1734 | .doit = nfc_genl_se_io, | 1752 | .doit = nfc_genl_se_io, |
| 1735 | }, | 1753 | }, |
| 1736 | { | 1754 | { |
| 1737 | .cmd = NFC_CMD_ACTIVATE_TARGET, | 1755 | .cmd = NFC_CMD_ACTIVATE_TARGET, |
| 1756 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1738 | .doit = nfc_genl_activate_target, | 1757 | .doit = nfc_genl_activate_target, |
| 1739 | }, | 1758 | }, |
| 1740 | { | 1759 | { |
| 1741 | .cmd = NFC_CMD_VENDOR, | 1760 | .cmd = NFC_CMD_VENDOR, |
| 1761 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1742 | .doit = nfc_genl_vendor_cmd, | 1762 | .doit = nfc_genl_vendor_cmd, |
| 1743 | }, | 1763 | }, |
| 1744 | { | 1764 | { |
| 1745 | .cmd = NFC_CMD_DEACTIVATE_TARGET, | 1765 | .cmd = NFC_CMD_DEACTIVATE_TARGET, |
| 1766 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1746 | .doit = nfc_genl_deactivate_target, | 1767 | .doit = nfc_genl_deactivate_target, |
| 1747 | }, | 1768 | }, |
| 1748 | }; | 1769 | }; |
diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c index ff8baf810bb3..bded32144619 100644 --- a/net/openvswitch/conntrack.c +++ b/net/openvswitch/conntrack.c | |||
| @@ -2186,16 +2186,19 @@ exit_err: | |||
| 2186 | 2186 | ||
| 2187 | static struct genl_ops ct_limit_genl_ops[] = { | 2187 | static struct genl_ops ct_limit_genl_ops[] = { |
| 2188 | { .cmd = OVS_CT_LIMIT_CMD_SET, | 2188 | { .cmd = OVS_CT_LIMIT_CMD_SET, |
| 2189 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2189 | .flags = GENL_ADMIN_PERM, /* Requires CAP_NET_ADMIN | 2190 | .flags = GENL_ADMIN_PERM, /* Requires CAP_NET_ADMIN |
| 2190 | * privilege. */ | 2191 | * privilege. */ |
| 2191 | .doit = ovs_ct_limit_cmd_set, | 2192 | .doit = ovs_ct_limit_cmd_set, |
| 2192 | }, | 2193 | }, |
| 2193 | { .cmd = OVS_CT_LIMIT_CMD_DEL, | 2194 | { .cmd = OVS_CT_LIMIT_CMD_DEL, |
| 2195 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2194 | .flags = GENL_ADMIN_PERM, /* Requires CAP_NET_ADMIN | 2196 | .flags = GENL_ADMIN_PERM, /* Requires CAP_NET_ADMIN |
| 2195 | * privilege. */ | 2197 | * privilege. */ |
| 2196 | .doit = ovs_ct_limit_cmd_del, | 2198 | .doit = ovs_ct_limit_cmd_del, |
| 2197 | }, | 2199 | }, |
| 2198 | { .cmd = OVS_CT_LIMIT_CMD_GET, | 2200 | { .cmd = OVS_CT_LIMIT_CMD_GET, |
| 2201 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2199 | .flags = 0, /* OK for unprivileged users. */ | 2202 | .flags = 0, /* OK for unprivileged users. */ |
| 2200 | .doit = ovs_ct_limit_cmd_get, | 2203 | .doit = ovs_ct_limit_cmd_get, |
| 2201 | }, | 2204 | }, |
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index 356677c3a0c2..b95015c7e999 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c | |||
| @@ -639,6 +639,7 @@ static const struct nla_policy packet_policy[OVS_PACKET_ATTR_MAX + 1] = { | |||
| 639 | 639 | ||
| 640 | static const struct genl_ops dp_packet_genl_ops[] = { | 640 | static const struct genl_ops dp_packet_genl_ops[] = { |
| 641 | { .cmd = OVS_PACKET_CMD_EXECUTE, | 641 | { .cmd = OVS_PACKET_CMD_EXECUTE, |
| 642 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 642 | .flags = GENL_UNS_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */ | 643 | .flags = GENL_UNS_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */ |
| 643 | .doit = ovs_packet_cmd_execute | 644 | .doit = ovs_packet_cmd_execute |
| 644 | } | 645 | } |
| @@ -1375,8 +1376,8 @@ static int ovs_flow_cmd_dump(struct sk_buff *skb, struct netlink_callback *cb) | |||
| 1375 | u32 ufid_flags; | 1376 | u32 ufid_flags; |
| 1376 | int err; | 1377 | int err; |
| 1377 | 1378 | ||
| 1378 | err = genlmsg_parse(cb->nlh, &dp_flow_genl_family, a, | 1379 | err = genlmsg_parse_deprecated(cb->nlh, &dp_flow_genl_family, a, |
| 1379 | OVS_FLOW_ATTR_MAX, flow_policy, NULL); | 1380 | OVS_FLOW_ATTR_MAX, flow_policy, NULL); |
| 1380 | if (err) | 1381 | if (err) |
| 1381 | return err; | 1382 | return err; |
| 1382 | ufid_flags = ovs_nla_get_ufid_flags(a[OVS_FLOW_ATTR_UFID_FLAGS]); | 1383 | ufid_flags = ovs_nla_get_ufid_flags(a[OVS_FLOW_ATTR_UFID_FLAGS]); |
| @@ -1424,19 +1425,23 @@ static const struct nla_policy flow_policy[OVS_FLOW_ATTR_MAX + 1] = { | |||
| 1424 | 1425 | ||
| 1425 | static const struct genl_ops dp_flow_genl_ops[] = { | 1426 | static const struct genl_ops dp_flow_genl_ops[] = { |
| 1426 | { .cmd = OVS_FLOW_CMD_NEW, | 1427 | { .cmd = OVS_FLOW_CMD_NEW, |
| 1428 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1427 | .flags = GENL_UNS_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */ | 1429 | .flags = GENL_UNS_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */ |
| 1428 | .doit = ovs_flow_cmd_new | 1430 | .doit = ovs_flow_cmd_new |
| 1429 | }, | 1431 | }, |
| 1430 | { .cmd = OVS_FLOW_CMD_DEL, | 1432 | { .cmd = OVS_FLOW_CMD_DEL, |
| 1433 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1431 | .flags = GENL_UNS_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */ | 1434 | .flags = GENL_UNS_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */ |
| 1432 | .doit = ovs_flow_cmd_del | 1435 | .doit = ovs_flow_cmd_del |
| 1433 | }, | 1436 | }, |
| 1434 | { .cmd = OVS_FLOW_CMD_GET, | 1437 | { .cmd = OVS_FLOW_CMD_GET, |
| 1438 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1435 | .flags = 0, /* OK for unprivileged users. */ | 1439 | .flags = 0, /* OK for unprivileged users. */ |
| 1436 | .doit = ovs_flow_cmd_get, | 1440 | .doit = ovs_flow_cmd_get, |
| 1437 | .dumpit = ovs_flow_cmd_dump | 1441 | .dumpit = ovs_flow_cmd_dump |
| 1438 | }, | 1442 | }, |
| 1439 | { .cmd = OVS_FLOW_CMD_SET, | 1443 | { .cmd = OVS_FLOW_CMD_SET, |
| 1444 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1440 | .flags = GENL_UNS_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */ | 1445 | .flags = GENL_UNS_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */ |
| 1441 | .doit = ovs_flow_cmd_set, | 1446 | .doit = ovs_flow_cmd_set, |
| 1442 | }, | 1447 | }, |
| @@ -1814,19 +1819,23 @@ static const struct nla_policy datapath_policy[OVS_DP_ATTR_MAX + 1] = { | |||
| 1814 | 1819 | ||
| 1815 | static const struct genl_ops dp_datapath_genl_ops[] = { | 1820 | static const struct genl_ops dp_datapath_genl_ops[] = { |
| 1816 | { .cmd = OVS_DP_CMD_NEW, | 1821 | { .cmd = OVS_DP_CMD_NEW, |
| 1822 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1817 | .flags = GENL_UNS_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */ | 1823 | .flags = GENL_UNS_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */ |
| 1818 | .doit = ovs_dp_cmd_new | 1824 | .doit = ovs_dp_cmd_new |
| 1819 | }, | 1825 | }, |
| 1820 | { .cmd = OVS_DP_CMD_DEL, | 1826 | { .cmd = OVS_DP_CMD_DEL, |
| 1827 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1821 | .flags = GENL_UNS_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */ | 1828 | .flags = GENL_UNS_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */ |
| 1822 | .doit = ovs_dp_cmd_del | 1829 | .doit = ovs_dp_cmd_del |
| 1823 | }, | 1830 | }, |
| 1824 | { .cmd = OVS_DP_CMD_GET, | 1831 | { .cmd = OVS_DP_CMD_GET, |
| 1832 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1825 | .flags = 0, /* OK for unprivileged users. */ | 1833 | .flags = 0, /* OK for unprivileged users. */ |
| 1826 | .doit = ovs_dp_cmd_get, | 1834 | .doit = ovs_dp_cmd_get, |
| 1827 | .dumpit = ovs_dp_cmd_dump | 1835 | .dumpit = ovs_dp_cmd_dump |
| 1828 | }, | 1836 | }, |
| 1829 | { .cmd = OVS_DP_CMD_SET, | 1837 | { .cmd = OVS_DP_CMD_SET, |
| 1838 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1830 | .flags = GENL_UNS_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */ | 1839 | .flags = GENL_UNS_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */ |
| 1831 | .doit = ovs_dp_cmd_set, | 1840 | .doit = ovs_dp_cmd_set, |
| 1832 | }, | 1841 | }, |
| @@ -2254,19 +2263,23 @@ static const struct nla_policy vport_policy[OVS_VPORT_ATTR_MAX + 1] = { | |||
| 2254 | 2263 | ||
| 2255 | static const struct genl_ops dp_vport_genl_ops[] = { | 2264 | static const struct genl_ops dp_vport_genl_ops[] = { |
| 2256 | { .cmd = OVS_VPORT_CMD_NEW, | 2265 | { .cmd = OVS_VPORT_CMD_NEW, |
| 2266 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2257 | .flags = GENL_UNS_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */ | 2267 | .flags = GENL_UNS_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */ |
| 2258 | .doit = ovs_vport_cmd_new | 2268 | .doit = ovs_vport_cmd_new |
| 2259 | }, | 2269 | }, |
| 2260 | { .cmd = OVS_VPORT_CMD_DEL, | 2270 | { .cmd = OVS_VPORT_CMD_DEL, |
| 2271 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2261 | .flags = GENL_UNS_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */ | 2272 | .flags = GENL_UNS_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */ |
| 2262 | .doit = ovs_vport_cmd_del | 2273 | .doit = ovs_vport_cmd_del |
| 2263 | }, | 2274 | }, |
| 2264 | { .cmd = OVS_VPORT_CMD_GET, | 2275 | { .cmd = OVS_VPORT_CMD_GET, |
| 2276 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2265 | .flags = 0, /* OK for unprivileged users. */ | 2277 | .flags = 0, /* OK for unprivileged users. */ |
| 2266 | .doit = ovs_vport_cmd_get, | 2278 | .doit = ovs_vport_cmd_get, |
| 2267 | .dumpit = ovs_vport_cmd_dump | 2279 | .dumpit = ovs_vport_cmd_dump |
| 2268 | }, | 2280 | }, |
| 2269 | { .cmd = OVS_VPORT_CMD_SET, | 2281 | { .cmd = OVS_VPORT_CMD_SET, |
| 2282 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 2270 | .flags = GENL_UNS_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */ | 2283 | .flags = GENL_UNS_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */ |
| 2271 | .doit = ovs_vport_cmd_set, | 2284 | .doit = ovs_vport_cmd_set, |
| 2272 | }, | 2285 | }, |
diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c index 2427b672107a..54eb80dd2dc6 100644 --- a/net/openvswitch/flow_netlink.c +++ b/net/openvswitch/flow_netlink.c | |||
| @@ -2854,8 +2854,8 @@ static int validate_userspace(const struct nlattr *attr) | |||
| 2854 | struct nlattr *a[OVS_USERSPACE_ATTR_MAX + 1]; | 2854 | struct nlattr *a[OVS_USERSPACE_ATTR_MAX + 1]; |
| 2855 | int error; | 2855 | int error; |
| 2856 | 2856 | ||
| 2857 | error = nla_parse_nested(a, OVS_USERSPACE_ATTR_MAX, attr, | 2857 | error = nla_parse_nested_deprecated(a, OVS_USERSPACE_ATTR_MAX, attr, |
| 2858 | userspace_policy, NULL); | 2858 | userspace_policy, NULL); |
| 2859 | if (error) | 2859 | if (error) |
| 2860 | return error; | 2860 | return error; |
| 2861 | 2861 | ||
| @@ -2885,8 +2885,9 @@ static int validate_and_copy_check_pkt_len(struct net *net, | |||
| 2885 | int nested_acts_start; | 2885 | int nested_acts_start; |
| 2886 | int start, err; | 2886 | int start, err; |
| 2887 | 2887 | ||
| 2888 | err = nla_parse_strict(a, OVS_CHECK_PKT_LEN_ATTR_MAX, nla_data(attr), | 2888 | err = nla_parse_deprecated_strict(a, OVS_CHECK_PKT_LEN_ATTR_MAX, |
| 2889 | nla_len(attr), cpl_policy, NULL); | 2889 | nla_data(attr), nla_len(attr), |
| 2890 | cpl_policy, NULL); | ||
| 2890 | if (err) | 2891 | if (err) |
| 2891 | return err; | 2892 | return err; |
| 2892 | 2893 | ||
diff --git a/net/openvswitch/meter.c b/net/openvswitch/meter.c index fdc8be7fd8f3..bb67238f0340 100644 --- a/net/openvswitch/meter.c +++ b/net/openvswitch/meter.c | |||
| @@ -227,9 +227,9 @@ static struct dp_meter *dp_meter_create(struct nlattr **a) | |||
| 227 | struct nlattr *attr[OVS_BAND_ATTR_MAX + 1]; | 227 | struct nlattr *attr[OVS_BAND_ATTR_MAX + 1]; |
| 228 | u32 band_max_delta_t; | 228 | u32 band_max_delta_t; |
| 229 | 229 | ||
| 230 | err = nla_parse((struct nlattr **)&attr, OVS_BAND_ATTR_MAX, | 230 | err = nla_parse_deprecated((struct nlattr **)&attr, |
| 231 | nla_data(nla), nla_len(nla), band_policy, | 231 | OVS_BAND_ATTR_MAX, nla_data(nla), |
| 232 | NULL); | 232 | nla_len(nla), band_policy, NULL); |
| 233 | if (err) | 233 | if (err) |
| 234 | goto exit_free_meter; | 234 | goto exit_free_meter; |
| 235 | 235 | ||
| @@ -526,20 +526,24 @@ bool ovs_meter_execute(struct datapath *dp, struct sk_buff *skb, | |||
| 526 | 526 | ||
| 527 | static struct genl_ops dp_meter_genl_ops[] = { | 527 | static struct genl_ops dp_meter_genl_ops[] = { |
| 528 | { .cmd = OVS_METER_CMD_FEATURES, | 528 | { .cmd = OVS_METER_CMD_FEATURES, |
| 529 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 529 | .flags = 0, /* OK for unprivileged users. */ | 530 | .flags = 0, /* OK for unprivileged users. */ |
| 530 | .doit = ovs_meter_cmd_features | 531 | .doit = ovs_meter_cmd_features |
| 531 | }, | 532 | }, |
| 532 | { .cmd = OVS_METER_CMD_SET, | 533 | { .cmd = OVS_METER_CMD_SET, |
| 534 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 533 | .flags = GENL_ADMIN_PERM, /* Requires CAP_NET_ADMIN | 535 | .flags = GENL_ADMIN_PERM, /* Requires CAP_NET_ADMIN |
| 534 | * privilege. | 536 | * privilege. |
| 535 | */ | 537 | */ |
| 536 | .doit = ovs_meter_cmd_set, | 538 | .doit = ovs_meter_cmd_set, |
| 537 | }, | 539 | }, |
| 538 | { .cmd = OVS_METER_CMD_GET, | 540 | { .cmd = OVS_METER_CMD_GET, |
| 541 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 539 | .flags = 0, /* OK for unprivileged users. */ | 542 | .flags = 0, /* OK for unprivileged users. */ |
| 540 | .doit = ovs_meter_cmd_get, | 543 | .doit = ovs_meter_cmd_get, |
| 541 | }, | 544 | }, |
| 542 | { .cmd = OVS_METER_CMD_DEL, | 545 | { .cmd = OVS_METER_CMD_DEL, |
| 546 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 543 | .flags = GENL_ADMIN_PERM, /* Requires CAP_NET_ADMIN | 547 | .flags = GENL_ADMIN_PERM, /* Requires CAP_NET_ADMIN |
| 544 | * privilege. | 548 | * privilege. |
| 545 | */ | 549 | */ |
diff --git a/net/openvswitch/vport-vxlan.c b/net/openvswitch/vport-vxlan.c index 54965ff8cc66..f3c54871f9e1 100644 --- a/net/openvswitch/vport-vxlan.c +++ b/net/openvswitch/vport-vxlan.c | |||
| @@ -70,8 +70,8 @@ static int vxlan_configure_exts(struct vport *vport, struct nlattr *attr, | |||
| 70 | if (nla_len(attr) < sizeof(struct nlattr)) | 70 | if (nla_len(attr) < sizeof(struct nlattr)) |
| 71 | return -EINVAL; | 71 | return -EINVAL; |
| 72 | 72 | ||
| 73 | err = nla_parse_nested(exts, OVS_VXLAN_EXT_MAX, attr, exts_policy, | 73 | err = nla_parse_nested_deprecated(exts, OVS_VXLAN_EXT_MAX, attr, |
| 74 | NULL); | 74 | exts_policy, NULL); |
| 75 | if (err < 0) | 75 | if (err < 0) |
| 76 | return err; | 76 | return err; |
| 77 | 77 | ||
diff --git a/net/phonet/pn_netlink.c b/net/phonet/pn_netlink.c index 871eaf2cb85e..be92d936b5d5 100644 --- a/net/phonet/pn_netlink.c +++ b/net/phonet/pn_netlink.c | |||
| @@ -79,8 +79,8 @@ static int addr_doit(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 79 | 79 | ||
| 80 | ASSERT_RTNL(); | 80 | ASSERT_RTNL(); |
| 81 | 81 | ||
| 82 | err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, ifa_phonet_policy, | 82 | err = nlmsg_parse_deprecated(nlh, sizeof(*ifm), tb, IFA_MAX, |
| 83 | extack); | 83 | ifa_phonet_policy, extack); |
| 84 | if (err < 0) | 84 | if (err < 0) |
| 85 | return err; | 85 | return err; |
| 86 | 86 | ||
| @@ -246,8 +246,8 @@ static int route_doit(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 246 | 246 | ||
| 247 | ASSERT_RTNL(); | 247 | ASSERT_RTNL(); |
| 248 | 248 | ||
| 249 | err = nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, rtm_phonet_policy, | 249 | err = nlmsg_parse_deprecated(nlh, sizeof(*rtm), tb, RTA_MAX, |
| 250 | extack); | 250 | rtm_phonet_policy, extack); |
| 251 | if (err < 0) | 251 | if (err < 0) |
| 252 | return err; | 252 | return err; |
| 253 | 253 | ||
diff --git a/net/psample/psample.c b/net/psample/psample.c index 64f95624f219..a107b2405668 100644 --- a/net/psample/psample.c +++ b/net/psample/psample.c | |||
| @@ -100,6 +100,7 @@ static int psample_nl_cmd_get_group_dumpit(struct sk_buff *msg, | |||
| 100 | static const struct genl_ops psample_nl_ops[] = { | 100 | static const struct genl_ops psample_nl_ops[] = { |
| 101 | { | 101 | { |
| 102 | .cmd = PSAMPLE_CMD_GET_GROUP, | 102 | .cmd = PSAMPLE_CMD_GET_GROUP, |
| 103 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 103 | .dumpit = psample_nl_cmd_get_group_dumpit, | 104 | .dumpit = psample_nl_cmd_get_group_dumpit, |
| 104 | /* can be retrieved by unprivileged users */ | 105 | /* can be retrieved by unprivileged users */ |
| 105 | } | 106 | } |
diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c index 7c5e8292cc0a..dd0e97f4f6c0 100644 --- a/net/qrtr/qrtr.c +++ b/net/qrtr/qrtr.c | |||
| @@ -1091,7 +1091,8 @@ static int qrtr_addr_doit(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 1091 | 1091 | ||
| 1092 | ASSERT_RTNL(); | 1092 | ASSERT_RTNL(); |
| 1093 | 1093 | ||
| 1094 | rc = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, qrtr_policy, extack); | 1094 | rc = nlmsg_parse_deprecated(nlh, sizeof(*ifm), tb, IFA_MAX, |
| 1095 | qrtr_policy, extack); | ||
| 1095 | if (rc < 0) | 1096 | if (rc < 0) |
| 1096 | return rc; | 1097 | return rc; |
| 1097 | 1098 | ||
diff --git a/net/sched/act_api.c b/net/sched/act_api.c index 641ad7575f24..683fcc00da49 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c | |||
| @@ -849,7 +849,8 @@ struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp, | |||
| 849 | int err; | 849 | int err; |
| 850 | 850 | ||
| 851 | if (name == NULL) { | 851 | if (name == NULL) { |
| 852 | err = nla_parse_nested(tb, TCA_ACT_MAX, nla, NULL, extack); | 852 | err = nla_parse_nested_deprecated(tb, TCA_ACT_MAX, nla, NULL, |
| 853 | extack); | ||
| 853 | if (err < 0) | 854 | if (err < 0) |
| 854 | goto err_out; | 855 | goto err_out; |
| 855 | err = -EINVAL; | 856 | err = -EINVAL; |
| @@ -964,7 +965,8 @@ int tcf_action_init(struct net *net, struct tcf_proto *tp, struct nlattr *nla, | |||
| 964 | int err; | 965 | int err; |
| 965 | int i; | 966 | int i; |
| 966 | 967 | ||
| 967 | err = nla_parse_nested(tb, TCA_ACT_MAX_PRIO, nla, NULL, extack); | 968 | err = nla_parse_nested_deprecated(tb, TCA_ACT_MAX_PRIO, nla, NULL, |
| 969 | extack); | ||
| 968 | if (err < 0) | 970 | if (err < 0) |
| 969 | return err; | 971 | return err; |
| 970 | 972 | ||
| @@ -1099,7 +1101,7 @@ static struct tc_action *tcf_action_get_1(struct net *net, struct nlattr *nla, | |||
| 1099 | int index; | 1101 | int index; |
| 1100 | int err; | 1102 | int err; |
| 1101 | 1103 | ||
| 1102 | err = nla_parse_nested(tb, TCA_ACT_MAX, nla, NULL, extack); | 1104 | err = nla_parse_nested_deprecated(tb, TCA_ACT_MAX, nla, NULL, extack); |
| 1103 | if (err < 0) | 1105 | if (err < 0) |
| 1104 | goto err_out; | 1106 | goto err_out; |
| 1105 | 1107 | ||
| @@ -1153,7 +1155,7 @@ static int tca_action_flush(struct net *net, struct nlattr *nla, | |||
| 1153 | 1155 | ||
| 1154 | b = skb_tail_pointer(skb); | 1156 | b = skb_tail_pointer(skb); |
| 1155 | 1157 | ||
| 1156 | err = nla_parse_nested(tb, TCA_ACT_MAX, nla, NULL, extack); | 1158 | err = nla_parse_nested_deprecated(tb, TCA_ACT_MAX, nla, NULL, extack); |
| 1157 | if (err < 0) | 1159 | if (err < 0) |
| 1158 | goto err_out; | 1160 | goto err_out; |
| 1159 | 1161 | ||
| @@ -1282,7 +1284,8 @@ tca_action_gd(struct net *net, struct nlattr *nla, struct nlmsghdr *n, | |||
| 1282 | size_t attr_size = 0; | 1284 | size_t attr_size = 0; |
| 1283 | struct tc_action *actions[TCA_ACT_MAX_PRIO] = {}; | 1285 | struct tc_action *actions[TCA_ACT_MAX_PRIO] = {}; |
| 1284 | 1286 | ||
| 1285 | ret = nla_parse_nested(tb, TCA_ACT_MAX_PRIO, nla, NULL, extack); | 1287 | ret = nla_parse_nested_deprecated(tb, TCA_ACT_MAX_PRIO, nla, NULL, |
| 1288 | extack); | ||
| 1286 | if (ret < 0) | 1289 | if (ret < 0) |
| 1287 | return ret; | 1290 | return ret; |
| 1288 | 1291 | ||
| @@ -1384,8 +1387,8 @@ static int tc_ctl_action(struct sk_buff *skb, struct nlmsghdr *n, | |||
| 1384 | !netlink_capable(skb, CAP_NET_ADMIN)) | 1387 | !netlink_capable(skb, CAP_NET_ADMIN)) |
| 1385 | return -EPERM; | 1388 | return -EPERM; |
| 1386 | 1389 | ||
| 1387 | ret = nlmsg_parse(n, sizeof(struct tcamsg), tca, TCA_ROOT_MAX, NULL, | 1390 | ret = nlmsg_parse_deprecated(n, sizeof(struct tcamsg), tca, |
| 1388 | extack); | 1391 | TCA_ROOT_MAX, NULL, extack); |
| 1389 | if (ret < 0) | 1392 | if (ret < 0) |
| 1390 | return ret; | 1393 | return ret; |
| 1391 | 1394 | ||
| @@ -1436,13 +1439,12 @@ static struct nlattr *find_dump_kind(struct nlattr **nla) | |||
| 1436 | if (tb1 == NULL) | 1439 | if (tb1 == NULL) |
| 1437 | return NULL; | 1440 | return NULL; |
| 1438 | 1441 | ||
| 1439 | if (nla_parse(tb, TCA_ACT_MAX_PRIO, nla_data(tb1), | 1442 | if (nla_parse_deprecated(tb, TCA_ACT_MAX_PRIO, nla_data(tb1), NLMSG_ALIGN(nla_len(tb1)), NULL, NULL) < 0) |
| 1440 | NLMSG_ALIGN(nla_len(tb1)), NULL, NULL) < 0) | ||
| 1441 | return NULL; | 1443 | return NULL; |
| 1442 | 1444 | ||
| 1443 | if (tb[1] == NULL) | 1445 | if (tb[1] == NULL) |
| 1444 | return NULL; | 1446 | return NULL; |
| 1445 | if (nla_parse_nested(tb2, TCA_ACT_MAX, tb[1], NULL, NULL) < 0) | 1447 | if (nla_parse_nested_deprecated(tb2, TCA_ACT_MAX, tb[1], NULL, NULL) < 0) |
| 1446 | return NULL; | 1448 | return NULL; |
| 1447 | kind = tb2[TCA_ACT_KIND]; | 1449 | kind = tb2[TCA_ACT_KIND]; |
| 1448 | 1450 | ||
| @@ -1466,8 +1468,8 @@ static int tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb) | |||
| 1466 | u32 msecs_since = 0; | 1468 | u32 msecs_since = 0; |
| 1467 | u32 act_count = 0; | 1469 | u32 act_count = 0; |
| 1468 | 1470 | ||
| 1469 | ret = nlmsg_parse(cb->nlh, sizeof(struct tcamsg), tb, TCA_ROOT_MAX, | 1471 | ret = nlmsg_parse_deprecated(cb->nlh, sizeof(struct tcamsg), tb, |
| 1470 | tcaa_policy, cb->extack); | 1472 | TCA_ROOT_MAX, tcaa_policy, cb->extack); |
| 1471 | if (ret < 0) | 1473 | if (ret < 0) |
| 1472 | return ret; | 1474 | return ret; |
| 1473 | 1475 | ||
diff --git a/net/sched/act_bpf.c b/net/sched/act_bpf.c index 3841156aa09f..a0c77faca04b 100644 --- a/net/sched/act_bpf.c +++ b/net/sched/act_bpf.c | |||
| @@ -293,7 +293,8 @@ static int tcf_bpf_init(struct net *net, struct nlattr *nla, | |||
| 293 | if (!nla) | 293 | if (!nla) |
| 294 | return -EINVAL; | 294 | return -EINVAL; |
| 295 | 295 | ||
| 296 | ret = nla_parse_nested(tb, TCA_ACT_BPF_MAX, nla, act_bpf_policy, NULL); | 296 | ret = nla_parse_nested_deprecated(tb, TCA_ACT_BPF_MAX, nla, |
| 297 | act_bpf_policy, NULL); | ||
| 297 | if (ret < 0) | 298 | if (ret < 0) |
| 298 | return ret; | 299 | return ret; |
| 299 | 300 | ||
diff --git a/net/sched/act_connmark.c b/net/sched/act_connmark.c index 32ae0cd6e31c..8838575cd536 100644 --- a/net/sched/act_connmark.c +++ b/net/sched/act_connmark.c | |||
| @@ -111,8 +111,8 @@ static int tcf_connmark_init(struct net *net, struct nlattr *nla, | |||
| 111 | if (!nla) | 111 | if (!nla) |
| 112 | return -EINVAL; | 112 | return -EINVAL; |
| 113 | 113 | ||
| 114 | ret = nla_parse_nested(tb, TCA_CONNMARK_MAX, nla, connmark_policy, | 114 | ret = nla_parse_nested_deprecated(tb, TCA_CONNMARK_MAX, nla, |
| 115 | NULL); | 115 | connmark_policy, NULL); |
| 116 | if (ret < 0) | 116 | if (ret < 0) |
| 117 | return ret; | 117 | return ret; |
| 118 | 118 | ||
diff --git a/net/sched/act_csum.c b/net/sched/act_csum.c index 0c77e7bdf6d5..14bb525e355e 100644 --- a/net/sched/act_csum.c +++ b/net/sched/act_csum.c | |||
| @@ -61,7 +61,8 @@ static int tcf_csum_init(struct net *net, struct nlattr *nla, | |||
| 61 | if (nla == NULL) | 61 | if (nla == NULL) |
| 62 | return -EINVAL; | 62 | return -EINVAL; |
| 63 | 63 | ||
| 64 | err = nla_parse_nested(tb, TCA_CSUM_MAX, nla, csum_policy, NULL); | 64 | err = nla_parse_nested_deprecated(tb, TCA_CSUM_MAX, nla, csum_policy, |
| 65 | NULL); | ||
| 65 | if (err < 0) | 66 | if (err < 0) |
| 66 | return err; | 67 | return err; |
| 67 | 68 | ||
diff --git a/net/sched/act_gact.c b/net/sched/act_gact.c index e540e31069d7..75492b07f324 100644 --- a/net/sched/act_gact.c +++ b/net/sched/act_gact.c | |||
| @@ -74,7 +74,8 @@ static int tcf_gact_init(struct net *net, struct nlattr *nla, | |||
| 74 | if (nla == NULL) | 74 | if (nla == NULL) |
| 75 | return -EINVAL; | 75 | return -EINVAL; |
| 76 | 76 | ||
| 77 | err = nla_parse_nested(tb, TCA_GACT_MAX, nla, gact_policy, NULL); | 77 | err = nla_parse_nested_deprecated(tb, TCA_GACT_MAX, nla, gact_policy, |
| 78 | NULL); | ||
| 78 | if (err < 0) | 79 | if (err < 0) |
| 79 | return err; | 80 | return err; |
| 80 | 81 | ||
diff --git a/net/sched/act_ife.c b/net/sched/act_ife.c index 7a87ce2e5a76..12489f60a979 100644 --- a/net/sched/act_ife.c +++ b/net/sched/act_ife.c | |||
| @@ -486,7 +486,8 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla, | |||
| 486 | int ret = 0; | 486 | int ret = 0; |
| 487 | int err; | 487 | int err; |
| 488 | 488 | ||
| 489 | err = nla_parse_nested(tb, TCA_IFE_MAX, nla, ife_policy, NULL); | 489 | err = nla_parse_nested_deprecated(tb, TCA_IFE_MAX, nla, ife_policy, |
| 490 | NULL); | ||
| 490 | if (err < 0) | 491 | if (err < 0) |
| 491 | return err; | 492 | return err; |
| 492 | 493 | ||
| @@ -567,8 +568,9 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla, | |||
| 567 | INIT_LIST_HEAD(&ife->metalist); | 568 | INIT_LIST_HEAD(&ife->metalist); |
| 568 | 569 | ||
| 569 | if (tb[TCA_IFE_METALST]) { | 570 | if (tb[TCA_IFE_METALST]) { |
| 570 | err = nla_parse_nested(tb2, IFE_META_MAX, tb[TCA_IFE_METALST], | 571 | err = nla_parse_nested_deprecated(tb2, IFE_META_MAX, |
| 571 | NULL, NULL); | 572 | tb[TCA_IFE_METALST], NULL, |
| 573 | NULL); | ||
| 572 | if (err) | 574 | if (err) |
| 573 | goto metadata_parse_err; | 575 | goto metadata_parse_err; |
| 574 | err = populate_metalist(ife, tb2, exists, rtnl_held); | 576 | err = populate_metalist(ife, tb2, exists, rtnl_held); |
diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c index 04a0b5c61194..ae6e28ab1cd7 100644 --- a/net/sched/act_ipt.c +++ b/net/sched/act_ipt.c | |||
| @@ -113,7 +113,8 @@ static int __tcf_ipt_init(struct net *net, unsigned int id, struct nlattr *nla, | |||
| 113 | if (nla == NULL) | 113 | if (nla == NULL) |
| 114 | return -EINVAL; | 114 | return -EINVAL; |
| 115 | 115 | ||
| 116 | err = nla_parse_nested(tb, TCA_IPT_MAX, nla, ipt_policy, NULL); | 116 | err = nla_parse_nested_deprecated(tb, TCA_IPT_MAX, nla, ipt_policy, |
| 117 | NULL); | ||
| 117 | if (err < 0) | 118 | if (err < 0) |
| 118 | return err; | 119 | return err; |
| 119 | 120 | ||
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c index 17cc6bd4c57c..c329390342f4 100644 --- a/net/sched/act_mirred.c +++ b/net/sched/act_mirred.c | |||
| @@ -111,7 +111,8 @@ static int tcf_mirred_init(struct net *net, struct nlattr *nla, | |||
| 111 | NL_SET_ERR_MSG_MOD(extack, "Mirred requires attributes to be passed"); | 111 | NL_SET_ERR_MSG_MOD(extack, "Mirred requires attributes to be passed"); |
| 112 | return -EINVAL; | 112 | return -EINVAL; |
| 113 | } | 113 | } |
| 114 | ret = nla_parse_nested(tb, TCA_MIRRED_MAX, nla, mirred_policy, extack); | 114 | ret = nla_parse_nested_deprecated(tb, TCA_MIRRED_MAX, nla, |
| 115 | mirred_policy, extack); | ||
| 115 | if (ret < 0) | 116 | if (ret < 0) |
| 116 | return ret; | 117 | return ret; |
| 117 | if (!tb[TCA_MIRRED_PARMS]) { | 118 | if (!tb[TCA_MIRRED_PARMS]) { |
diff --git a/net/sched/act_nat.c b/net/sched/act_nat.c index e91bb8eb81ec..51bd1ba02380 100644 --- a/net/sched/act_nat.c +++ b/net/sched/act_nat.c | |||
| @@ -52,7 +52,8 @@ static int tcf_nat_init(struct net *net, struct nlattr *nla, struct nlattr *est, | |||
| 52 | if (nla == NULL) | 52 | if (nla == NULL) |
| 53 | return -EINVAL; | 53 | return -EINVAL; |
| 54 | 54 | ||
| 55 | err = nla_parse_nested(tb, TCA_NAT_MAX, nla, nat_policy, NULL); | 55 | err = nla_parse_nested_deprecated(tb, TCA_NAT_MAX, nla, nat_policy, |
| 56 | NULL); | ||
| 56 | if (err < 0) | 57 | if (err < 0) |
| 57 | return err; | 58 | return err; |
| 58 | 59 | ||
diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c index ce4b54fa7834..d790c02b9c6c 100644 --- a/net/sched/act_pedit.c +++ b/net/sched/act_pedit.c | |||
| @@ -70,8 +70,9 @@ static struct tcf_pedit_key_ex *tcf_pedit_keys_ex_parse(struct nlattr *nla, | |||
| 70 | goto err_out; | 70 | goto err_out; |
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | err = nla_parse_nested(tb, TCA_PEDIT_KEY_EX_MAX, ka, | 73 | err = nla_parse_nested_deprecated(tb, TCA_PEDIT_KEY_EX_MAX, |
| 74 | pedit_key_ex_policy, NULL); | 74 | ka, pedit_key_ex_policy, |
| 75 | NULL); | ||
| 75 | if (err) | 76 | if (err) |
| 76 | goto err_out; | 77 | goto err_out; |
| 77 | 78 | ||
| @@ -158,7 +159,8 @@ static int tcf_pedit_init(struct net *net, struct nlattr *nla, | |||
| 158 | return -EINVAL; | 159 | return -EINVAL; |
| 159 | } | 160 | } |
| 160 | 161 | ||
| 161 | err = nla_parse_nested(tb, TCA_PEDIT_MAX, nla, pedit_policy, NULL); | 162 | err = nla_parse_nested_deprecated(tb, TCA_PEDIT_MAX, nla, |
| 163 | pedit_policy, NULL); | ||
| 162 | if (err < 0) | 164 | if (err < 0) |
| 163 | return err; | 165 | return err; |
| 164 | 166 | ||
diff --git a/net/sched/act_police.c b/net/sched/act_police.c index 2b8581f6ab51..b48e40c69ad0 100644 --- a/net/sched/act_police.c +++ b/net/sched/act_police.c | |||
| @@ -100,7 +100,8 @@ static int tcf_police_init(struct net *net, struct nlattr *nla, | |||
| 100 | if (nla == NULL) | 100 | if (nla == NULL) |
| 101 | return -EINVAL; | 101 | return -EINVAL; |
| 102 | 102 | ||
| 103 | err = nla_parse_nested(tb, TCA_POLICE_MAX, nla, police_policy, NULL); | 103 | err = nla_parse_nested_deprecated(tb, TCA_POLICE_MAX, nla, |
| 104 | police_policy, NULL); | ||
| 104 | if (err < 0) | 105 | if (err < 0) |
| 105 | return err; | 106 | return err; |
| 106 | 107 | ||
diff --git a/net/sched/act_sample.c b/net/sched/act_sample.c index 0f82d50ea232..b2faa43c1ac7 100644 --- a/net/sched/act_sample.c +++ b/net/sched/act_sample.c | |||
| @@ -53,7 +53,8 @@ static int tcf_sample_init(struct net *net, struct nlattr *nla, | |||
| 53 | 53 | ||
| 54 | if (!nla) | 54 | if (!nla) |
| 55 | return -EINVAL; | 55 | return -EINVAL; |
| 56 | ret = nla_parse_nested(tb, TCA_SAMPLE_MAX, nla, sample_policy, NULL); | 56 | ret = nla_parse_nested_deprecated(tb, TCA_SAMPLE_MAX, nla, |
| 57 | sample_policy, NULL); | ||
| 57 | if (ret < 0) | 58 | if (ret < 0) |
| 58 | return ret; | 59 | return ret; |
| 59 | if (!tb[TCA_SAMPLE_PARMS] || !tb[TCA_SAMPLE_RATE] || | 60 | if (!tb[TCA_SAMPLE_PARMS] || !tb[TCA_SAMPLE_RATE] || |
diff --git a/net/sched/act_simple.c b/net/sched/act_simple.c index 23c8ca5615e5..ead480e6014c 100644 --- a/net/sched/act_simple.c +++ b/net/sched/act_simple.c | |||
| @@ -104,7 +104,8 @@ static int tcf_simp_init(struct net *net, struct nlattr *nla, | |||
| 104 | if (nla == NULL) | 104 | if (nla == NULL) |
| 105 | return -EINVAL; | 105 | return -EINVAL; |
| 106 | 106 | ||
| 107 | err = nla_parse_nested(tb, TCA_DEF_MAX, nla, simple_policy, NULL); | 107 | err = nla_parse_nested_deprecated(tb, TCA_DEF_MAX, nla, simple_policy, |
| 108 | NULL); | ||
| 108 | if (err < 0) | 109 | if (err < 0) |
| 109 | return err; | 110 | return err; |
| 110 | 111 | ||
diff --git a/net/sched/act_skbedit.c b/net/sched/act_skbedit.c index 7e1d261a31d2..7ec159b95364 100644 --- a/net/sched/act_skbedit.c +++ b/net/sched/act_skbedit.c | |||
| @@ -114,7 +114,8 @@ static int tcf_skbedit_init(struct net *net, struct nlattr *nla, | |||
| 114 | if (nla == NULL) | 114 | if (nla == NULL) |
| 115 | return -EINVAL; | 115 | return -EINVAL; |
| 116 | 116 | ||
| 117 | err = nla_parse_nested(tb, TCA_SKBEDIT_MAX, nla, skbedit_policy, NULL); | 117 | err = nla_parse_nested_deprecated(tb, TCA_SKBEDIT_MAX, nla, |
| 118 | skbedit_policy, NULL); | ||
| 118 | if (err < 0) | 119 | if (err < 0) |
| 119 | return err; | 120 | return err; |
| 120 | 121 | ||
diff --git a/net/sched/act_skbmod.c b/net/sched/act_skbmod.c index 1d4c324d0a42..186ef98c828f 100644 --- a/net/sched/act_skbmod.c +++ b/net/sched/act_skbmod.c | |||
| @@ -102,7 +102,8 @@ static int tcf_skbmod_init(struct net *net, struct nlattr *nla, | |||
| 102 | if (!nla) | 102 | if (!nla) |
| 103 | return -EINVAL; | 103 | return -EINVAL; |
| 104 | 104 | ||
| 105 | err = nla_parse_nested(tb, TCA_SKBMOD_MAX, nla, skbmod_policy, NULL); | 105 | err = nla_parse_nested_deprecated(tb, TCA_SKBMOD_MAX, nla, |
| 106 | skbmod_policy, NULL); | ||
| 106 | if (err < 0) | 107 | if (err < 0) |
| 107 | return err; | 108 | return err; |
| 108 | 109 | ||
diff --git a/net/sched/act_tunnel_key.c b/net/sched/act_tunnel_key.c index 45c0c253c7e8..6a9070511ee8 100644 --- a/net/sched/act_tunnel_key.c +++ b/net/sched/act_tunnel_key.c | |||
| @@ -76,8 +76,9 @@ tunnel_key_copy_geneve_opt(const struct nlattr *nla, void *dst, int dst_len, | |||
| 76 | int err, data_len, opt_len; | 76 | int err, data_len, opt_len; |
| 77 | u8 *data; | 77 | u8 *data; |
| 78 | 78 | ||
| 79 | err = nla_parse_nested(tb, TCA_TUNNEL_KEY_ENC_OPT_GENEVE_MAX, | 79 | err = nla_parse_nested_deprecated(tb, |
| 80 | nla, geneve_opt_policy, extack); | 80 | TCA_TUNNEL_KEY_ENC_OPT_GENEVE_MAX, |
| 81 | nla, geneve_opt_policy, extack); | ||
| 81 | if (err < 0) | 82 | if (err < 0) |
| 82 | return err; | 83 | return err; |
| 83 | 84 | ||
| @@ -125,8 +126,8 @@ static int tunnel_key_copy_opts(const struct nlattr *nla, u8 *dst, | |||
| 125 | int err, rem, opt_len, len = nla_len(nla), opts_len = 0; | 126 | int err, rem, opt_len, len = nla_len(nla), opts_len = 0; |
| 126 | const struct nlattr *attr, *head = nla_data(nla); | 127 | const struct nlattr *attr, *head = nla_data(nla); |
| 127 | 128 | ||
| 128 | err = nla_validate(head, len, TCA_TUNNEL_KEY_ENC_OPTS_MAX, | 129 | err = nla_validate_deprecated(head, len, TCA_TUNNEL_KEY_ENC_OPTS_MAX, |
| 129 | enc_opts_policy, extack); | 130 | enc_opts_policy, extack); |
| 130 | if (err) | 131 | if (err) |
| 131 | return err; | 132 | return err; |
| 132 | 133 | ||
| @@ -235,8 +236,8 @@ static int tunnel_key_init(struct net *net, struct nlattr *nla, | |||
| 235 | return -EINVAL; | 236 | return -EINVAL; |
| 236 | } | 237 | } |
| 237 | 238 | ||
| 238 | err = nla_parse_nested(tb, TCA_TUNNEL_KEY_MAX, nla, tunnel_key_policy, | 239 | err = nla_parse_nested_deprecated(tb, TCA_TUNNEL_KEY_MAX, nla, |
| 239 | extack); | 240 | tunnel_key_policy, extack); |
| 240 | if (err < 0) { | 241 | if (err < 0) { |
| 241 | NL_SET_ERR_MSG(extack, "Failed to parse nested tunnel key attributes"); | 242 | NL_SET_ERR_MSG(extack, "Failed to parse nested tunnel key attributes"); |
| 242 | return err; | 243 | return err; |
diff --git a/net/sched/act_vlan.c b/net/sched/act_vlan.c index 0f40d0a74423..39bd9fa3e455 100644 --- a/net/sched/act_vlan.c +++ b/net/sched/act_vlan.c | |||
| @@ -124,7 +124,8 @@ static int tcf_vlan_init(struct net *net, struct nlattr *nla, | |||
| 124 | if (!nla) | 124 | if (!nla) |
| 125 | return -EINVAL; | 125 | return -EINVAL; |
| 126 | 126 | ||
| 127 | err = nla_parse_nested(tb, TCA_VLAN_MAX, nla, vlan_policy, NULL); | 127 | err = nla_parse_nested_deprecated(tb, TCA_VLAN_MAX, nla, vlan_policy, |
| 128 | NULL); | ||
| 128 | if (err < 0) | 129 | if (err < 0) |
| 129 | return err; | 130 | return err; |
| 130 | 131 | ||
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index 78de717afddf..263c2ec082c9 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c | |||
| @@ -2006,7 +2006,8 @@ static int tc_new_tfilter(struct sk_buff *skb, struct nlmsghdr *n, | |||
| 2006 | replay: | 2006 | replay: |
| 2007 | tp_created = 0; | 2007 | tp_created = 0; |
| 2008 | 2008 | ||
| 2009 | err = nlmsg_parse(n, sizeof(*t), tca, TCA_MAX, rtm_tca_policy, extack); | 2009 | err = nlmsg_parse_deprecated(n, sizeof(*t), tca, TCA_MAX, |
| 2010 | rtm_tca_policy, extack); | ||
| 2010 | if (err < 0) | 2011 | if (err < 0) |
| 2011 | return err; | 2012 | return err; |
| 2012 | 2013 | ||
| @@ -2217,7 +2218,8 @@ static int tc_del_tfilter(struct sk_buff *skb, struct nlmsghdr *n, | |||
| 2217 | if (!netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN)) | 2218 | if (!netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN)) |
| 2218 | return -EPERM; | 2219 | return -EPERM; |
| 2219 | 2220 | ||
| 2220 | err = nlmsg_parse(n, sizeof(*t), tca, TCA_MAX, rtm_tca_policy, extack); | 2221 | err = nlmsg_parse_deprecated(n, sizeof(*t), tca, TCA_MAX, |
| 2222 | rtm_tca_policy, extack); | ||
| 2221 | if (err < 0) | 2223 | if (err < 0) |
| 2222 | return err; | 2224 | return err; |
| 2223 | 2225 | ||
| @@ -2366,7 +2368,8 @@ static int tc_get_tfilter(struct sk_buff *skb, struct nlmsghdr *n, | |||
| 2366 | int err; | 2368 | int err; |
| 2367 | bool rtnl_held = false; | 2369 | bool rtnl_held = false; |
| 2368 | 2370 | ||
| 2369 | err = nlmsg_parse(n, sizeof(*t), tca, TCA_MAX, rtm_tca_policy, extack); | 2371 | err = nlmsg_parse_deprecated(n, sizeof(*t), tca, TCA_MAX, |
| 2372 | rtm_tca_policy, extack); | ||
| 2370 | if (err < 0) | 2373 | if (err < 0) |
| 2371 | return err; | 2374 | return err; |
| 2372 | 2375 | ||
| @@ -2558,8 +2561,8 @@ static int tc_dump_tfilter(struct sk_buff *skb, struct netlink_callback *cb) | |||
| 2558 | if (nlmsg_len(cb->nlh) < sizeof(*tcm)) | 2561 | if (nlmsg_len(cb->nlh) < sizeof(*tcm)) |
| 2559 | return skb->len; | 2562 | return skb->len; |
| 2560 | 2563 | ||
| 2561 | err = nlmsg_parse(cb->nlh, sizeof(*tcm), tca, TCA_MAX, NULL, | 2564 | err = nlmsg_parse_deprecated(cb->nlh, sizeof(*tcm), tca, TCA_MAX, |
| 2562 | cb->extack); | 2565 | NULL, cb->extack); |
| 2563 | if (err) | 2566 | if (err) |
| 2564 | return err; | 2567 | return err; |
| 2565 | 2568 | ||
| @@ -2806,7 +2809,8 @@ static int tc_ctl_chain(struct sk_buff *skb, struct nlmsghdr *n, | |||
| 2806 | return -EPERM; | 2809 | return -EPERM; |
| 2807 | 2810 | ||
| 2808 | replay: | 2811 | replay: |
| 2809 | err = nlmsg_parse(n, sizeof(*t), tca, TCA_MAX, rtm_tca_policy, extack); | 2812 | err = nlmsg_parse_deprecated(n, sizeof(*t), tca, TCA_MAX, |
| 2813 | rtm_tca_policy, extack); | ||
| 2810 | if (err < 0) | 2814 | if (err < 0) |
| 2811 | return err; | 2815 | return err; |
| 2812 | 2816 | ||
| @@ -2937,8 +2941,8 @@ static int tc_dump_chain(struct sk_buff *skb, struct netlink_callback *cb) | |||
| 2937 | if (nlmsg_len(cb->nlh) < sizeof(*tcm)) | 2941 | if (nlmsg_len(cb->nlh) < sizeof(*tcm)) |
| 2938 | return skb->len; | 2942 | return skb->len; |
| 2939 | 2943 | ||
| 2940 | err = nlmsg_parse(cb->nlh, sizeof(*tcm), tca, TCA_MAX, rtm_tca_policy, | 2944 | err = nlmsg_parse_deprecated(cb->nlh, sizeof(*tcm), tca, TCA_MAX, |
| 2941 | cb->extack); | 2945 | rtm_tca_policy, cb->extack); |
| 2942 | if (err) | 2946 | if (err) |
| 2943 | return err; | 2947 | return err; |
| 2944 | 2948 | ||
diff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c index dd5fdb62c6df..923863f3b0d8 100644 --- a/net/sched/cls_basic.c +++ b/net/sched/cls_basic.c | |||
| @@ -185,8 +185,8 @@ static int basic_change(struct net *net, struct sk_buff *in_skb, | |||
| 185 | if (tca[TCA_OPTIONS] == NULL) | 185 | if (tca[TCA_OPTIONS] == NULL) |
| 186 | return -EINVAL; | 186 | return -EINVAL; |
| 187 | 187 | ||
| 188 | err = nla_parse_nested(tb, TCA_BASIC_MAX, tca[TCA_OPTIONS], | 188 | err = nla_parse_nested_deprecated(tb, TCA_BASIC_MAX, tca[TCA_OPTIONS], |
| 189 | basic_policy, NULL); | 189 | basic_policy, NULL); |
| 190 | if (err < 0) | 190 | if (err < 0) |
| 191 | return err; | 191 | return err; |
| 192 | 192 | ||
diff --git a/net/sched/cls_bpf.c b/net/sched/cls_bpf.c index 6fd569c5a036..9bcf499cce0c 100644 --- a/net/sched/cls_bpf.c +++ b/net/sched/cls_bpf.c | |||
| @@ -468,8 +468,8 @@ static int cls_bpf_change(struct net *net, struct sk_buff *in_skb, | |||
| 468 | if (tca[TCA_OPTIONS] == NULL) | 468 | if (tca[TCA_OPTIONS] == NULL) |
| 469 | return -EINVAL; | 469 | return -EINVAL; |
| 470 | 470 | ||
| 471 | ret = nla_parse_nested(tb, TCA_BPF_MAX, tca[TCA_OPTIONS], bpf_policy, | 471 | ret = nla_parse_nested_deprecated(tb, TCA_BPF_MAX, tca[TCA_OPTIONS], |
| 472 | NULL); | 472 | bpf_policy, NULL); |
| 473 | if (ret < 0) | 473 | if (ret < 0) |
| 474 | return ret; | 474 | return ret; |
| 475 | 475 | ||
diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c index b680dd684282..037d128c2851 100644 --- a/net/sched/cls_cgroup.c +++ b/net/sched/cls_cgroup.c | |||
| @@ -104,8 +104,9 @@ static int cls_cgroup_change(struct net *net, struct sk_buff *in_skb, | |||
| 104 | goto errout; | 104 | goto errout; |
| 105 | new->handle = handle; | 105 | new->handle = handle; |
| 106 | new->tp = tp; | 106 | new->tp = tp; |
| 107 | err = nla_parse_nested(tb, TCA_CGROUP_MAX, tca[TCA_OPTIONS], | 107 | err = nla_parse_nested_deprecated(tb, TCA_CGROUP_MAX, |
| 108 | cgroup_policy, NULL); | 108 | tca[TCA_OPTIONS], cgroup_policy, |
| 109 | NULL); | ||
| 109 | if (err < 0) | 110 | if (err < 0) |
| 110 | goto errout; | 111 | goto errout; |
| 111 | 112 | ||
diff --git a/net/sched/cls_flow.c b/net/sched/cls_flow.c index cb29fe7d5ed3..7bb79ec5b176 100644 --- a/net/sched/cls_flow.c +++ b/net/sched/cls_flow.c | |||
| @@ -408,7 +408,8 @@ static int flow_change(struct net *net, struct sk_buff *in_skb, | |||
| 408 | if (opt == NULL) | 408 | if (opt == NULL) |
| 409 | return -EINVAL; | 409 | return -EINVAL; |
| 410 | 410 | ||
| 411 | err = nla_parse_nested(tb, TCA_FLOW_MAX, opt, flow_policy, NULL); | 411 | err = nla_parse_nested_deprecated(tb, TCA_FLOW_MAX, opt, flow_policy, |
| 412 | NULL); | ||
| 412 | if (err < 0) | 413 | if (err < 0) |
| 413 | return err; | 414 | return err; |
| 414 | 415 | ||
diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c index 8d4f7a672f14..f6685fc53119 100644 --- a/net/sched/cls_flower.c +++ b/net/sched/cls_flower.c | |||
| @@ -884,8 +884,9 @@ static int fl_set_geneve_opt(const struct nlattr *nla, struct fl_flow_key *key, | |||
| 884 | return -EINVAL; | 884 | return -EINVAL; |
| 885 | } | 885 | } |
| 886 | 886 | ||
| 887 | err = nla_parse_nested(tb, TCA_FLOWER_KEY_ENC_OPT_GENEVE_MAX, | 887 | err = nla_parse_nested_deprecated(tb, |
| 888 | nla, geneve_opt_policy, extack); | 888 | TCA_FLOWER_KEY_ENC_OPT_GENEVE_MAX, |
| 889 | nla, geneve_opt_policy, extack); | ||
| 889 | if (err < 0) | 890 | if (err < 0) |
| 890 | return err; | 891 | return err; |
| 891 | 892 | ||
| @@ -947,18 +948,18 @@ static int fl_set_enc_opt(struct nlattr **tb, struct fl_flow_key *key, | |||
| 947 | const struct nlattr *nla_enc_key, *nla_opt_key, *nla_opt_msk = NULL; | 948 | const struct nlattr *nla_enc_key, *nla_opt_key, *nla_opt_msk = NULL; |
| 948 | int err, option_len, key_depth, msk_depth = 0; | 949 | int err, option_len, key_depth, msk_depth = 0; |
| 949 | 950 | ||
| 950 | err = nla_validate_nested(tb[TCA_FLOWER_KEY_ENC_OPTS], | 951 | err = nla_validate_nested_deprecated(tb[TCA_FLOWER_KEY_ENC_OPTS], |
| 951 | TCA_FLOWER_KEY_ENC_OPTS_MAX, | 952 | TCA_FLOWER_KEY_ENC_OPTS_MAX, |
| 952 | enc_opts_policy, extack); | 953 | enc_opts_policy, extack); |
| 953 | if (err) | 954 | if (err) |
| 954 | return err; | 955 | return err; |
| 955 | 956 | ||
| 956 | nla_enc_key = nla_data(tb[TCA_FLOWER_KEY_ENC_OPTS]); | 957 | nla_enc_key = nla_data(tb[TCA_FLOWER_KEY_ENC_OPTS]); |
| 957 | 958 | ||
| 958 | if (tb[TCA_FLOWER_KEY_ENC_OPTS_MASK]) { | 959 | if (tb[TCA_FLOWER_KEY_ENC_OPTS_MASK]) { |
| 959 | err = nla_validate_nested(tb[TCA_FLOWER_KEY_ENC_OPTS_MASK], | 960 | err = nla_validate_nested_deprecated(tb[TCA_FLOWER_KEY_ENC_OPTS_MASK], |
| 960 | TCA_FLOWER_KEY_ENC_OPTS_MAX, | 961 | TCA_FLOWER_KEY_ENC_OPTS_MAX, |
| 961 | enc_opts_policy, extack); | 962 | enc_opts_policy, extack); |
| 962 | if (err) | 963 | if (err) |
| 963 | return err; | 964 | return err; |
| 964 | 965 | ||
| @@ -1513,8 +1514,8 @@ static int fl_change(struct net *net, struct sk_buff *in_skb, | |||
| 1513 | goto errout_mask_alloc; | 1514 | goto errout_mask_alloc; |
| 1514 | } | 1515 | } |
| 1515 | 1516 | ||
| 1516 | err = nla_parse_nested(tb, TCA_FLOWER_MAX, tca[TCA_OPTIONS], | 1517 | err = nla_parse_nested_deprecated(tb, TCA_FLOWER_MAX, |
| 1517 | fl_policy, NULL); | 1518 | tca[TCA_OPTIONS], fl_policy, NULL); |
| 1518 | if (err < 0) | 1519 | if (err < 0) |
| 1519 | goto errout_tb; | 1520 | goto errout_tb; |
| 1520 | 1521 | ||
| @@ -1852,8 +1853,8 @@ static void *fl_tmplt_create(struct net *net, struct tcf_chain *chain, | |||
| 1852 | tb = kcalloc(TCA_FLOWER_MAX + 1, sizeof(struct nlattr *), GFP_KERNEL); | 1853 | tb = kcalloc(TCA_FLOWER_MAX + 1, sizeof(struct nlattr *), GFP_KERNEL); |
| 1853 | if (!tb) | 1854 | if (!tb) |
| 1854 | return ERR_PTR(-ENOBUFS); | 1855 | return ERR_PTR(-ENOBUFS); |
| 1855 | err = nla_parse_nested(tb, TCA_FLOWER_MAX, tca[TCA_OPTIONS], | 1856 | err = nla_parse_nested_deprecated(tb, TCA_FLOWER_MAX, |
| 1856 | fl_policy, NULL); | 1857 | tca[TCA_OPTIONS], fl_policy, NULL); |
| 1857 | if (err) | 1858 | if (err) |
| 1858 | goto errout_tb; | 1859 | goto errout_tb; |
| 1859 | 1860 | ||
diff --git a/net/sched/cls_fw.c b/net/sched/cls_fw.c index 3fcc1d51b9d7..1d0b39c3932f 100644 --- a/net/sched/cls_fw.c +++ b/net/sched/cls_fw.c | |||
| @@ -263,7 +263,8 @@ static int fw_change(struct net *net, struct sk_buff *in_skb, | |||
| 263 | if (!opt) | 263 | if (!opt) |
| 264 | return handle ? -EINVAL : 0; /* Succeed if it is old method. */ | 264 | return handle ? -EINVAL : 0; /* Succeed if it is old method. */ |
| 265 | 265 | ||
| 266 | err = nla_parse_nested(tb, TCA_FW_MAX, opt, fw_policy, NULL); | 266 | err = nla_parse_nested_deprecated(tb, TCA_FW_MAX, opt, fw_policy, |
| 267 | NULL); | ||
| 267 | if (err < 0) | 268 | if (err < 0) |
| 268 | return err; | 269 | return err; |
| 269 | 270 | ||
diff --git a/net/sched/cls_matchall.c b/net/sched/cls_matchall.c index d54fa8e11b9e..46982b4ea70a 100644 --- a/net/sched/cls_matchall.c +++ b/net/sched/cls_matchall.c | |||
| @@ -181,8 +181,8 @@ static int mall_change(struct net *net, struct sk_buff *in_skb, | |||
| 181 | if (head) | 181 | if (head) |
| 182 | return -EEXIST; | 182 | return -EEXIST; |
| 183 | 183 | ||
| 184 | err = nla_parse_nested(tb, TCA_MATCHALL_MAX, tca[TCA_OPTIONS], | 184 | err = nla_parse_nested_deprecated(tb, TCA_MATCHALL_MAX, |
| 185 | mall_policy, NULL); | 185 | tca[TCA_OPTIONS], mall_policy, NULL); |
| 186 | if (err < 0) | 186 | if (err < 0) |
| 187 | return err; | 187 | return err; |
| 188 | 188 | ||
diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c index b3b9b151a61d..eeff5bbfb912 100644 --- a/net/sched/cls_route.c +++ b/net/sched/cls_route.c | |||
| @@ -484,7 +484,8 @@ static int route4_change(struct net *net, struct sk_buff *in_skb, | |||
| 484 | if (opt == NULL) | 484 | if (opt == NULL) |
| 485 | return handle ? -EINVAL : 0; | 485 | return handle ? -EINVAL : 0; |
| 486 | 486 | ||
| 487 | err = nla_parse_nested(tb, TCA_ROUTE4_MAX, opt, route4_policy, NULL); | 487 | err = nla_parse_nested_deprecated(tb, TCA_ROUTE4_MAX, opt, |
| 488 | route4_policy, NULL); | ||
| 488 | if (err < 0) | 489 | if (err < 0) |
| 489 | return err; | 490 | return err; |
| 490 | 491 | ||
diff --git a/net/sched/cls_rsvp.h b/net/sched/cls_rsvp.h index fa059cf934a6..a4688bb92f43 100644 --- a/net/sched/cls_rsvp.h +++ b/net/sched/cls_rsvp.h | |||
| @@ -497,7 +497,8 @@ static int rsvp_change(struct net *net, struct sk_buff *in_skb, | |||
| 497 | if (opt == NULL) | 497 | if (opt == NULL) |
| 498 | return handle ? -EINVAL : 0; | 498 | return handle ? -EINVAL : 0; |
| 499 | 499 | ||
| 500 | err = nla_parse_nested(tb, TCA_RSVP_MAX, opt, rsvp_policy, NULL); | 500 | err = nla_parse_nested_deprecated(tb, TCA_RSVP_MAX, opt, rsvp_policy, |
| 501 | NULL); | ||
| 501 | if (err < 0) | 502 | if (err < 0) |
| 502 | return err; | 503 | return err; |
| 503 | 504 | ||
diff --git a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c index 1a2e7d5a8776..9f4f4203c388 100644 --- a/net/sched/cls_tcindex.c +++ b/net/sched/cls_tcindex.c | |||
| @@ -510,7 +510,8 @@ tcindex_change(struct net *net, struct sk_buff *in_skb, | |||
| 510 | if (!opt) | 510 | if (!opt) |
| 511 | return 0; | 511 | return 0; |
| 512 | 512 | ||
| 513 | err = nla_parse_nested(tb, TCA_TCINDEX_MAX, opt, tcindex_policy, NULL); | 513 | err = nla_parse_nested_deprecated(tb, TCA_TCINDEX_MAX, opt, |
| 514 | tcindex_policy, NULL); | ||
| 514 | if (err < 0) | 515 | if (err < 0) |
| 515 | return err; | 516 | return err; |
| 516 | 517 | ||
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 499477058b2d..04e9ef088535 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c | |||
| @@ -884,7 +884,8 @@ static int u32_change(struct net *net, struct sk_buff *in_skb, | |||
| 884 | } | 884 | } |
| 885 | } | 885 | } |
| 886 | 886 | ||
| 887 | err = nla_parse_nested(tb, TCA_U32_MAX, opt, u32_policy, extack); | 887 | err = nla_parse_nested_deprecated(tb, TCA_U32_MAX, opt, u32_policy, |
| 888 | extack); | ||
| 888 | if (err < 0) | 889 | if (err < 0) |
| 889 | return err; | 890 | return err; |
| 890 | 891 | ||
diff --git a/net/sched/em_ipt.c b/net/sched/em_ipt.c index a5f34e930eff..60c26b8294b5 100644 --- a/net/sched/em_ipt.c +++ b/net/sched/em_ipt.c | |||
| @@ -120,8 +120,8 @@ static int em_ipt_change(struct net *net, void *data, int data_len, | |||
| 120 | struct xt_match *match; | 120 | struct xt_match *match; |
| 121 | int mdata_len, ret; | 121 | int mdata_len, ret; |
| 122 | 122 | ||
| 123 | ret = nla_parse(tb, TCA_EM_IPT_MAX, data, data_len, em_ipt_policy, | 123 | ret = nla_parse_deprecated(tb, TCA_EM_IPT_MAX, data, data_len, |
| 124 | NULL); | 124 | em_ipt_policy, NULL); |
| 125 | if (ret < 0) | 125 | if (ret < 0) |
| 126 | return ret; | 126 | return ret; |
| 127 | 127 | ||
diff --git a/net/sched/em_meta.c b/net/sched/em_meta.c index d6e97115500b..28dfa8f2a4ea 100644 --- a/net/sched/em_meta.c +++ b/net/sched/em_meta.c | |||
| @@ -912,7 +912,8 @@ static int em_meta_change(struct net *net, void *data, int len, | |||
| 912 | struct tcf_meta_hdr *hdr; | 912 | struct tcf_meta_hdr *hdr; |
| 913 | struct meta_match *meta = NULL; | 913 | struct meta_match *meta = NULL; |
| 914 | 914 | ||
| 915 | err = nla_parse(tb, TCA_EM_META_MAX, data, len, meta_policy, NULL); | 915 | err = nla_parse_deprecated(tb, TCA_EM_META_MAX, data, len, |
| 916 | meta_policy, NULL); | ||
| 916 | if (err < 0) | 917 | if (err < 0) |
| 917 | goto errout; | 918 | goto errout; |
| 918 | 919 | ||
diff --git a/net/sched/ematch.c b/net/sched/ematch.c index 6f2d6a761dbe..7b86c2a44746 100644 --- a/net/sched/ematch.c +++ b/net/sched/ematch.c | |||
| @@ -314,7 +314,8 @@ int tcf_em_tree_validate(struct tcf_proto *tp, struct nlattr *nla, | |||
| 314 | if (!nla) | 314 | if (!nla) |
| 315 | return 0; | 315 | return 0; |
| 316 | 316 | ||
| 317 | err = nla_parse_nested(tb, TCA_EMATCH_TREE_MAX, nla, em_policy, NULL); | 317 | err = nla_parse_nested_deprecated(tb, TCA_EMATCH_TREE_MAX, nla, |
| 318 | em_policy, NULL); | ||
| 318 | if (err < 0) | 319 | if (err < 0) |
| 319 | goto errout; | 320 | goto errout; |
| 320 | 321 | ||
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 6c81b22d214f..607e84d67c33 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c | |||
| @@ -479,7 +479,8 @@ static struct qdisc_size_table *qdisc_get_stab(struct nlattr *opt, | |||
| 479 | u16 *tab = NULL; | 479 | u16 *tab = NULL; |
| 480 | int err; | 480 | int err; |
| 481 | 481 | ||
| 482 | err = nla_parse_nested(tb, TCA_STAB_MAX, opt, stab_policy, extack); | 482 | err = nla_parse_nested_deprecated(tb, TCA_STAB_MAX, opt, stab_policy, |
| 483 | extack); | ||
| 483 | if (err < 0) | 484 | if (err < 0) |
| 484 | return ERR_PTR(err); | 485 | return ERR_PTR(err); |
| 485 | if (!tb[TCA_STAB_BASE]) { | 486 | if (!tb[TCA_STAB_BASE]) { |
| @@ -1423,8 +1424,8 @@ static int tc_get_qdisc(struct sk_buff *skb, struct nlmsghdr *n, | |||
| 1423 | !netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN)) | 1424 | !netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN)) |
| 1424 | return -EPERM; | 1425 | return -EPERM; |
| 1425 | 1426 | ||
| 1426 | err = nlmsg_parse(n, sizeof(*tcm), tca, TCA_MAX, rtm_tca_policy, | 1427 | err = nlmsg_parse_deprecated(n, sizeof(*tcm), tca, TCA_MAX, |
| 1427 | extack); | 1428 | rtm_tca_policy, extack); |
| 1428 | if (err < 0) | 1429 | if (err < 0) |
| 1429 | return err; | 1430 | return err; |
| 1430 | 1431 | ||
| @@ -1508,8 +1509,8 @@ static int tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n, | |||
| 1508 | 1509 | ||
| 1509 | replay: | 1510 | replay: |
| 1510 | /* Reinit, just in case something touches this. */ | 1511 | /* Reinit, just in case something touches this. */ |
| 1511 | err = nlmsg_parse(n, sizeof(*tcm), tca, TCA_MAX, rtm_tca_policy, | 1512 | err = nlmsg_parse_deprecated(n, sizeof(*tcm), tca, TCA_MAX, |
| 1512 | extack); | 1513 | rtm_tca_policy, extack); |
| 1513 | if (err < 0) | 1514 | if (err < 0) |
| 1514 | return err; | 1515 | return err; |
| 1515 | 1516 | ||
| @@ -1743,8 +1744,8 @@ static int tc_dump_qdisc(struct sk_buff *skb, struct netlink_callback *cb) | |||
| 1743 | idx = 0; | 1744 | idx = 0; |
| 1744 | ASSERT_RTNL(); | 1745 | ASSERT_RTNL(); |
| 1745 | 1746 | ||
| 1746 | err = nlmsg_parse(nlh, sizeof(struct tcmsg), tca, TCA_MAX, | 1747 | err = nlmsg_parse_deprecated(nlh, sizeof(struct tcmsg), tca, TCA_MAX, |
| 1747 | rtm_tca_policy, cb->extack); | 1748 | rtm_tca_policy, cb->extack); |
| 1748 | if (err < 0) | 1749 | if (err < 0) |
| 1749 | return err; | 1750 | return err; |
| 1750 | 1751 | ||
| @@ -1972,8 +1973,8 @@ static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n, | |||
| 1972 | !netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN)) | 1973 | !netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN)) |
| 1973 | return -EPERM; | 1974 | return -EPERM; |
| 1974 | 1975 | ||
| 1975 | err = nlmsg_parse(n, sizeof(*tcm), tca, TCA_MAX, rtm_tca_policy, | 1976 | err = nlmsg_parse_deprecated(n, sizeof(*tcm), tca, TCA_MAX, |
| 1976 | extack); | 1977 | rtm_tca_policy, extack); |
| 1977 | if (err < 0) | 1978 | if (err < 0) |
| 1978 | return err; | 1979 | return err; |
| 1979 | 1980 | ||
diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c index c36aa57eb4af..ae506c7906cd 100644 --- a/net/sched/sch_atm.c +++ b/net/sched/sch_atm.c | |||
| @@ -223,7 +223,8 @@ static int atm_tc_change(struct Qdisc *sch, u32 classid, u32 parent, | |||
| 223 | if (opt == NULL) | 223 | if (opt == NULL) |
| 224 | return -EINVAL; | 224 | return -EINVAL; |
| 225 | 225 | ||
| 226 | error = nla_parse_nested(tb, TCA_ATM_MAX, opt, atm_policy, NULL); | 226 | error = nla_parse_nested_deprecated(tb, TCA_ATM_MAX, opt, atm_policy, |
| 227 | NULL); | ||
| 227 | if (error < 0) | 228 | if (error < 0) |
| 228 | return error; | 229 | return error; |
| 229 | 230 | ||
diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c index 50db72fe44de..53a80bc6b13a 100644 --- a/net/sched/sch_cake.c +++ b/net/sched/sch_cake.c | |||
| @@ -2531,7 +2531,8 @@ static int cake_change(struct Qdisc *sch, struct nlattr *opt, | |||
| 2531 | if (!opt) | 2531 | if (!opt) |
| 2532 | return -EINVAL; | 2532 | return -EINVAL; |
| 2533 | 2533 | ||
| 2534 | err = nla_parse_nested(tb, TCA_CAKE_MAX, opt, cake_policy, extack); | 2534 | err = nla_parse_nested_deprecated(tb, TCA_CAKE_MAX, opt, cake_policy, |
| 2535 | extack); | ||
| 2535 | if (err < 0) | 2536 | if (err < 0) |
| 2536 | return err; | 2537 | return err; |
| 2537 | 2538 | ||
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c index 243bce4b888b..ba4b33b74dd8 100644 --- a/net/sched/sch_cbq.c +++ b/net/sched/sch_cbq.c | |||
| @@ -1149,7 +1149,8 @@ static int cbq_init(struct Qdisc *sch, struct nlattr *opt, | |||
| 1149 | return -EINVAL; | 1149 | return -EINVAL; |
| 1150 | } | 1150 | } |
| 1151 | 1151 | ||
| 1152 | err = nla_parse_nested(tb, TCA_CBQ_MAX, opt, cbq_policy, extack); | 1152 | err = nla_parse_nested_deprecated(tb, TCA_CBQ_MAX, opt, cbq_policy, |
| 1153 | extack); | ||
| 1153 | if (err < 0) | 1154 | if (err < 0) |
| 1154 | return err; | 1155 | return err; |
| 1155 | 1156 | ||
| @@ -1473,7 +1474,8 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct nlattr **t | |||
| 1473 | return -EINVAL; | 1474 | return -EINVAL; |
| 1474 | } | 1475 | } |
| 1475 | 1476 | ||
| 1476 | err = nla_parse_nested(tb, TCA_CBQ_MAX, opt, cbq_policy, extack); | 1477 | err = nla_parse_nested_deprecated(tb, TCA_CBQ_MAX, opt, cbq_policy, |
| 1478 | extack); | ||
| 1477 | if (err < 0) | 1479 | if (err < 0) |
| 1478 | return err; | 1480 | return err; |
| 1479 | 1481 | ||
diff --git a/net/sched/sch_cbs.c b/net/sched/sch_cbs.c index adffc6d68c06..8077c846f5bf 100644 --- a/net/sched/sch_cbs.c +++ b/net/sched/sch_cbs.c | |||
| @@ -358,7 +358,8 @@ static int cbs_change(struct Qdisc *sch, struct nlattr *opt, | |||
| 358 | struct tc_cbs_qopt *qopt; | 358 | struct tc_cbs_qopt *qopt; |
| 359 | int err; | 359 | int err; |
| 360 | 360 | ||
| 361 | err = nla_parse_nested(tb, TCA_CBS_MAX, opt, cbs_policy, extack); | 361 | err = nla_parse_nested_deprecated(tb, TCA_CBS_MAX, opt, cbs_policy, |
| 362 | extack); | ||
| 362 | if (err < 0) | 363 | if (err < 0) |
| 363 | return err; | 364 | return err; |
| 364 | 365 | ||
diff --git a/net/sched/sch_choke.c b/net/sched/sch_choke.c index eda21dc94bde..370dbcf49e8b 100644 --- a/net/sched/sch_choke.c +++ b/net/sched/sch_choke.c | |||
| @@ -358,7 +358,8 @@ static int choke_change(struct Qdisc *sch, struct nlattr *opt, | |||
| 358 | if (opt == NULL) | 358 | if (opt == NULL) |
| 359 | return -EINVAL; | 359 | return -EINVAL; |
| 360 | 360 | ||
| 361 | err = nla_parse_nested(tb, TCA_CHOKE_MAX, opt, choke_policy, NULL); | 361 | err = nla_parse_nested_deprecated(tb, TCA_CHOKE_MAX, opt, |
| 362 | choke_policy, NULL); | ||
| 362 | if (err < 0) | 363 | if (err < 0) |
| 363 | return err; | 364 | return err; |
| 364 | 365 | ||
diff --git a/net/sched/sch_codel.c b/net/sched/sch_codel.c index 60ac4e61ce3a..25ef172c23df 100644 --- a/net/sched/sch_codel.c +++ b/net/sched/sch_codel.c | |||
| @@ -141,7 +141,8 @@ static int codel_change(struct Qdisc *sch, struct nlattr *opt, | |||
| 141 | if (!opt) | 141 | if (!opt) |
| 142 | return -EINVAL; | 142 | return -EINVAL; |
| 143 | 143 | ||
| 144 | err = nla_parse_nested(tb, TCA_CODEL_MAX, opt, codel_policy, NULL); | 144 | err = nla_parse_nested_deprecated(tb, TCA_CODEL_MAX, opt, |
| 145 | codel_policy, NULL); | ||
| 145 | if (err < 0) | 146 | if (err < 0) |
| 146 | return err; | 147 | return err; |
| 147 | 148 | ||
diff --git a/net/sched/sch_drr.c b/net/sched/sch_drr.c index 022db73fd5a9..ffcd6654c39d 100644 --- a/net/sched/sch_drr.c +++ b/net/sched/sch_drr.c | |||
| @@ -70,7 +70,8 @@ static int drr_change_class(struct Qdisc *sch, u32 classid, u32 parentid, | |||
| 70 | return -EINVAL; | 70 | return -EINVAL; |
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | err = nla_parse_nested(tb, TCA_DRR_MAX, opt, drr_policy, extack); | 73 | err = nla_parse_nested_deprecated(tb, TCA_DRR_MAX, opt, drr_policy, |
| 74 | extack); | ||
| 74 | if (err < 0) | 75 | if (err < 0) |
| 75 | return err; | 76 | return err; |
| 76 | 77 | ||
diff --git a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c index cdf744e710f1..3deeb06eaecf 100644 --- a/net/sched/sch_dsmark.c +++ b/net/sched/sch_dsmark.c | |||
| @@ -132,7 +132,8 @@ static int dsmark_change(struct Qdisc *sch, u32 classid, u32 parent, | |||
| 132 | if (!opt) | 132 | if (!opt) |
| 133 | goto errout; | 133 | goto errout; |
| 134 | 134 | ||
| 135 | err = nla_parse_nested(tb, TCA_DSMARK_MAX, opt, dsmark_policy, NULL); | 135 | err = nla_parse_nested_deprecated(tb, TCA_DSMARK_MAX, opt, |
| 136 | dsmark_policy, NULL); | ||
| 136 | if (err < 0) | 137 | if (err < 0) |
| 137 | goto errout; | 138 | goto errout; |
| 138 | 139 | ||
| @@ -353,7 +354,8 @@ static int dsmark_init(struct Qdisc *sch, struct nlattr *opt, | |||
| 353 | if (err) | 354 | if (err) |
| 354 | return err; | 355 | return err; |
| 355 | 356 | ||
| 356 | err = nla_parse_nested(tb, TCA_DSMARK_MAX, opt, dsmark_policy, NULL); | 357 | err = nla_parse_nested_deprecated(tb, TCA_DSMARK_MAX, opt, |
| 358 | dsmark_policy, NULL); | ||
| 357 | if (err < 0) | 359 | if (err < 0) |
| 358 | goto errout; | 360 | goto errout; |
| 359 | 361 | ||
diff --git a/net/sched/sch_etf.c b/net/sched/sch_etf.c index 67107caa287c..db0c2ba1d156 100644 --- a/net/sched/sch_etf.c +++ b/net/sched/sch_etf.c | |||
| @@ -351,7 +351,8 @@ static int etf_init(struct Qdisc *sch, struct nlattr *opt, | |||
| 351 | return -EINVAL; | 351 | return -EINVAL; |
| 352 | } | 352 | } |
| 353 | 353 | ||
| 354 | err = nla_parse_nested(tb, TCA_ETF_MAX, opt, etf_policy, extack); | 354 | err = nla_parse_nested_deprecated(tb, TCA_ETF_MAX, opt, etf_policy, |
| 355 | extack); | ||
| 355 | if (err < 0) | 356 | if (err < 0) |
| 356 | return err; | 357 | return err; |
| 357 | 358 | ||
diff --git a/net/sched/sch_fq.c b/net/sched/sch_fq.c index 5ca370e78d3a..d107c74767cd 100644 --- a/net/sched/sch_fq.c +++ b/net/sched/sch_fq.c | |||
| @@ -684,7 +684,8 @@ static int fq_change(struct Qdisc *sch, struct nlattr *opt, | |||
| 684 | if (!opt) | 684 | if (!opt) |
| 685 | return -EINVAL; | 685 | return -EINVAL; |
| 686 | 686 | ||
| 687 | err = nla_parse_nested(tb, TCA_FQ_MAX, opt, fq_policy, NULL); | 687 | err = nla_parse_nested_deprecated(tb, TCA_FQ_MAX, opt, fq_policy, |
| 688 | NULL); | ||
| 688 | if (err < 0) | 689 | if (err < 0) |
| 689 | return err; | 690 | return err; |
| 690 | 691 | ||
diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c index 825a933b019a..08d85370b97c 100644 --- a/net/sched/sch_fq_codel.c +++ b/net/sched/sch_fq_codel.c | |||
| @@ -387,8 +387,8 @@ static int fq_codel_change(struct Qdisc *sch, struct nlattr *opt, | |||
| 387 | if (!opt) | 387 | if (!opt) |
| 388 | return -EINVAL; | 388 | return -EINVAL; |
| 389 | 389 | ||
| 390 | err = nla_parse_nested(tb, TCA_FQ_CODEL_MAX, opt, fq_codel_policy, | 390 | err = nla_parse_nested_deprecated(tb, TCA_FQ_CODEL_MAX, opt, |
| 391 | NULL); | 391 | fq_codel_policy, NULL); |
| 392 | if (err < 0) | 392 | if (err < 0) |
| 393 | return err; | 393 | return err; |
| 394 | if (tb[TCA_FQ_CODEL_FLOWS]) { | 394 | if (tb[TCA_FQ_CODEL_FLOWS]) { |
diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c index 9bfa15e12d23..dfa657da100f 100644 --- a/net/sched/sch_gred.c +++ b/net/sched/sch_gred.c | |||
| @@ -538,7 +538,8 @@ static void gred_vq_apply(struct gred_sched *table, const struct nlattr *entry) | |||
| 538 | struct nlattr *tb[TCA_GRED_VQ_MAX + 1]; | 538 | struct nlattr *tb[TCA_GRED_VQ_MAX + 1]; |
| 539 | u32 dp; | 539 | u32 dp; |
| 540 | 540 | ||
| 541 | nla_parse_nested(tb, TCA_GRED_VQ_MAX, entry, gred_vq_policy, NULL); | 541 | nla_parse_nested_deprecated(tb, TCA_GRED_VQ_MAX, entry, |
| 542 | gred_vq_policy, NULL); | ||
| 542 | 543 | ||
| 543 | dp = nla_get_u32(tb[TCA_GRED_VQ_DP]); | 544 | dp = nla_get_u32(tb[TCA_GRED_VQ_DP]); |
| 544 | 545 | ||
| @@ -568,8 +569,8 @@ static int gred_vq_validate(struct gred_sched *table, u32 cdp, | |||
| 568 | int err; | 569 | int err; |
| 569 | u32 dp; | 570 | u32 dp; |
| 570 | 571 | ||
| 571 | err = nla_parse_nested(tb, TCA_GRED_VQ_MAX, entry, gred_vq_policy, | 572 | err = nla_parse_nested_deprecated(tb, TCA_GRED_VQ_MAX, entry, |
| 572 | extack); | 573 | gred_vq_policy, extack); |
| 573 | if (err < 0) | 574 | if (err < 0) |
| 574 | return err; | 575 | return err; |
| 575 | 576 | ||
| @@ -610,8 +611,8 @@ static int gred_vqs_validate(struct gred_sched *table, u32 cdp, | |||
| 610 | const struct nlattr *attr; | 611 | const struct nlattr *attr; |
| 611 | int rem, err; | 612 | int rem, err; |
| 612 | 613 | ||
| 613 | err = nla_validate_nested(vqs, TCA_GRED_VQ_ENTRY_MAX, | 614 | err = nla_validate_nested_deprecated(vqs, TCA_GRED_VQ_ENTRY_MAX, |
| 614 | gred_vqe_policy, extack); | 615 | gred_vqe_policy, extack); |
| 615 | if (err < 0) | 616 | if (err < 0) |
| 616 | return err; | 617 | return err; |
| 617 | 618 | ||
| @@ -650,7 +651,8 @@ static int gred_change(struct Qdisc *sch, struct nlattr *opt, | |||
| 650 | if (opt == NULL) | 651 | if (opt == NULL) |
| 651 | return -EINVAL; | 652 | return -EINVAL; |
| 652 | 653 | ||
| 653 | err = nla_parse_nested(tb, TCA_GRED_MAX, opt, gred_policy, extack); | 654 | err = nla_parse_nested_deprecated(tb, TCA_GRED_MAX, opt, gred_policy, |
| 655 | extack); | ||
| 654 | if (err < 0) | 656 | if (err < 0) |
| 655 | return err; | 657 | return err; |
| 656 | 658 | ||
| @@ -737,7 +739,8 @@ static int gred_init(struct Qdisc *sch, struct nlattr *opt, | |||
| 737 | if (!opt) | 739 | if (!opt) |
| 738 | return -EINVAL; | 740 | return -EINVAL; |
| 739 | 741 | ||
| 740 | err = nla_parse_nested(tb, TCA_GRED_MAX, opt, gred_policy, extack); | 742 | err = nla_parse_nested_deprecated(tb, TCA_GRED_MAX, opt, gred_policy, |
| 743 | extack); | ||
| 741 | if (err < 0) | 744 | if (err < 0) |
| 742 | return err; | 745 | return err; |
| 743 | 746 | ||
diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c index 97d2fb91c39f..433f2190960f 100644 --- a/net/sched/sch_hfsc.c +++ b/net/sched/sch_hfsc.c | |||
| @@ -926,7 +926,8 @@ hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid, | |||
| 926 | if (opt == NULL) | 926 | if (opt == NULL) |
| 927 | return -EINVAL; | 927 | return -EINVAL; |
| 928 | 928 | ||
| 929 | err = nla_parse_nested(tb, TCA_HFSC_MAX, opt, hfsc_policy, NULL); | 929 | err = nla_parse_nested_deprecated(tb, TCA_HFSC_MAX, opt, hfsc_policy, |
| 930 | NULL); | ||
| 930 | if (err < 0) | 931 | if (err < 0) |
| 931 | return err; | 932 | return err; |
| 932 | 933 | ||
diff --git a/net/sched/sch_hhf.c b/net/sched/sch_hhf.c index 43bc159c4f7c..a28e09b1609c 100644 --- a/net/sched/sch_hhf.c +++ b/net/sched/sch_hhf.c | |||
| @@ -518,7 +518,8 @@ static int hhf_change(struct Qdisc *sch, struct nlattr *opt, | |||
| 518 | if (!opt) | 518 | if (!opt) |
| 519 | return -EINVAL; | 519 | return -EINVAL; |
| 520 | 520 | ||
| 521 | err = nla_parse_nested(tb, TCA_HHF_MAX, opt, hhf_policy, NULL); | 521 | err = nla_parse_nested_deprecated(tb, TCA_HHF_MAX, opt, hhf_policy, |
| 522 | NULL); | ||
| 522 | if (err < 0) | 523 | if (err < 0) |
| 523 | return err; | 524 | return err; |
| 524 | 525 | ||
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index 64010aec5437..d27d9bc9d010 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c | |||
| @@ -1012,7 +1012,8 @@ static int htb_init(struct Qdisc *sch, struct nlattr *opt, | |||
| 1012 | if (err) | 1012 | if (err) |
| 1013 | return err; | 1013 | return err; |
| 1014 | 1014 | ||
| 1015 | err = nla_parse_nested(tb, TCA_HTB_MAX, opt, htb_policy, NULL); | 1015 | err = nla_parse_nested_deprecated(tb, TCA_HTB_MAX, opt, htb_policy, |
| 1016 | NULL); | ||
| 1016 | if (err < 0) | 1017 | if (err < 0) |
| 1017 | return err; | 1018 | return err; |
| 1018 | 1019 | ||
| @@ -1310,7 +1311,8 @@ static int htb_change_class(struct Qdisc *sch, u32 classid, | |||
| 1310 | if (!opt) | 1311 | if (!opt) |
| 1311 | goto failure; | 1312 | goto failure; |
| 1312 | 1313 | ||
| 1313 | err = nla_parse_nested(tb, TCA_HTB_MAX, opt, htb_policy, NULL); | 1314 | err = nla_parse_nested_deprecated(tb, TCA_HTB_MAX, opt, htb_policy, |
| 1315 | NULL); | ||
| 1314 | if (err < 0) | 1316 | if (err < 0) |
| 1315 | goto failure; | 1317 | goto failure; |
| 1316 | 1318 | ||
diff --git a/net/sched/sch_mqprio.c b/net/sched/sch_mqprio.c index 7afefed72d35..d05086dc3866 100644 --- a/net/sched/sch_mqprio.c +++ b/net/sched/sch_mqprio.c | |||
| @@ -125,8 +125,9 @@ static int parse_attr(struct nlattr *tb[], int maxtype, struct nlattr *nla, | |||
| 125 | int nested_len = nla_len(nla) - NLA_ALIGN(len); | 125 | int nested_len = nla_len(nla) - NLA_ALIGN(len); |
| 126 | 126 | ||
| 127 | if (nested_len >= nla_attr_size(0)) | 127 | if (nested_len >= nla_attr_size(0)) |
| 128 | return nla_parse(tb, maxtype, nla_data(nla) + NLA_ALIGN(len), | 128 | return nla_parse_deprecated(tb, maxtype, |
| 129 | nested_len, policy, NULL); | 129 | nla_data(nla) + NLA_ALIGN(len), |
| 130 | nested_len, policy, NULL); | ||
| 130 | 131 | ||
| 131 | memset(tb, 0, sizeof(struct nlattr *) * (maxtype + 1)); | 132 | memset(tb, 0, sizeof(struct nlattr *) * (maxtype + 1)); |
| 132 | return 0; | 133 | return 0; |
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index 0242c0d4a2d0..78aa76b0da2e 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c | |||
| @@ -935,8 +935,9 @@ static int parse_attr(struct nlattr *tb[], int maxtype, struct nlattr *nla, | |||
| 935 | } | 935 | } |
| 936 | 936 | ||
| 937 | if (nested_len >= nla_attr_size(0)) | 937 | if (nested_len >= nla_attr_size(0)) |
| 938 | return nla_parse(tb, maxtype, nla_data(nla) + NLA_ALIGN(len), | 938 | return nla_parse_deprecated(tb, maxtype, |
| 939 | nested_len, policy, NULL); | 939 | nla_data(nla) + NLA_ALIGN(len), |
| 940 | nested_len, policy, NULL); | ||
| 940 | 941 | ||
| 941 | memset(tb, 0, sizeof(struct nlattr *) * (maxtype + 1)); | 942 | memset(tb, 0, sizeof(struct nlattr *) * (maxtype + 1)); |
| 942 | return 0; | 943 | return 0; |
diff --git a/net/sched/sch_pie.c b/net/sched/sch_pie.c index 9bf41f4a2312..8fa129d3943e 100644 --- a/net/sched/sch_pie.c +++ b/net/sched/sch_pie.c | |||
| @@ -216,7 +216,8 @@ static int pie_change(struct Qdisc *sch, struct nlattr *opt, | |||
| 216 | if (!opt) | 216 | if (!opt) |
| 217 | return -EINVAL; | 217 | return -EINVAL; |
| 218 | 218 | ||
| 219 | err = nla_parse_nested(tb, TCA_PIE_MAX, opt, pie_policy, NULL); | 219 | err = nla_parse_nested_deprecated(tb, TCA_PIE_MAX, opt, pie_policy, |
| 220 | NULL); | ||
| 220 | if (err < 0) | 221 | if (err < 0) |
| 221 | return err; | 222 | return err; |
| 222 | 223 | ||
diff --git a/net/sched/sch_qfq.c b/net/sched/sch_qfq.c index bab2d4026e8b..3f9e8b425ac6 100644 --- a/net/sched/sch_qfq.c +++ b/net/sched/sch_qfq.c | |||
| @@ -410,8 +410,8 @@ static int qfq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, | |||
| 410 | return -EINVAL; | 410 | return -EINVAL; |
| 411 | } | 411 | } |
| 412 | 412 | ||
| 413 | err = nla_parse_nested(tb, TCA_QFQ_MAX, tca[TCA_OPTIONS], qfq_policy, | 413 | err = nla_parse_nested_deprecated(tb, TCA_QFQ_MAX, tca[TCA_OPTIONS], |
| 414 | NULL); | 414 | qfq_policy, NULL); |
| 415 | if (err < 0) | 415 | if (err < 0) |
| 416 | return err; | 416 | return err; |
| 417 | 417 | ||
diff --git a/net/sched/sch_red.c b/net/sched/sch_red.c index b9f34e057e87..1e68a13bb66b 100644 --- a/net/sched/sch_red.c +++ b/net/sched/sch_red.c | |||
| @@ -205,7 +205,8 @@ static int red_change(struct Qdisc *sch, struct nlattr *opt, | |||
| 205 | if (opt == NULL) | 205 | if (opt == NULL) |
| 206 | return -EINVAL; | 206 | return -EINVAL; |
| 207 | 207 | ||
| 208 | err = nla_parse_nested(tb, TCA_RED_MAX, opt, red_policy, NULL); | 208 | err = nla_parse_nested_deprecated(tb, TCA_RED_MAX, opt, red_policy, |
| 209 | NULL); | ||
| 209 | if (err < 0) | 210 | if (err < 0) |
| 210 | return err; | 211 | return err; |
| 211 | 212 | ||
diff --git a/net/sched/sch_sfb.c b/net/sched/sch_sfb.c index f54b00a431a3..b245d6a2068d 100644 --- a/net/sched/sch_sfb.c +++ b/net/sched/sch_sfb.c | |||
| @@ -499,7 +499,8 @@ static int sfb_change(struct Qdisc *sch, struct nlattr *opt, | |||
| 499 | int err; | 499 | int err; |
| 500 | 500 | ||
| 501 | if (opt) { | 501 | if (opt) { |
| 502 | err = nla_parse_nested(tb, TCA_SFB_MAX, opt, sfb_policy, NULL); | 502 | err = nla_parse_nested_deprecated(tb, TCA_SFB_MAX, opt, |
| 503 | sfb_policy, NULL); | ||
| 503 | if (err < 0) | 504 | if (err < 0) |
| 504 | return -EINVAL; | 505 | return -EINVAL; |
| 505 | 506 | ||
diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c index e016ee07dd1f..09563c245473 100644 --- a/net/sched/sch_taprio.c +++ b/net/sched/sch_taprio.c | |||
| @@ -310,8 +310,8 @@ static int parse_sched_entry(struct nlattr *n, struct sched_entry *entry, | |||
| 310 | struct nlattr *tb[TCA_TAPRIO_SCHED_ENTRY_MAX + 1] = { }; | 310 | struct nlattr *tb[TCA_TAPRIO_SCHED_ENTRY_MAX + 1] = { }; |
| 311 | int err; | 311 | int err; |
| 312 | 312 | ||
| 313 | err = nla_parse_nested(tb, TCA_TAPRIO_SCHED_ENTRY_MAX, n, | 313 | err = nla_parse_nested_deprecated(tb, TCA_TAPRIO_SCHED_ENTRY_MAX, n, |
| 314 | entry_policy, NULL); | 314 | entry_policy, NULL); |
| 315 | if (err < 0) { | 315 | if (err < 0) { |
| 316 | NL_SET_ERR_MSG(extack, "Could not parse nested entry"); | 316 | NL_SET_ERR_MSG(extack, "Could not parse nested entry"); |
| 317 | return -EINVAL; | 317 | return -EINVAL; |
| @@ -334,8 +334,8 @@ static int parse_sched_single_entry(struct nlattr *n, | |||
| 334 | u32 index; | 334 | u32 index; |
| 335 | int err; | 335 | int err; |
| 336 | 336 | ||
| 337 | err = nla_parse_nested(tb_list, TCA_TAPRIO_SCHED_MAX, | 337 | err = nla_parse_nested_deprecated(tb_list, TCA_TAPRIO_SCHED_MAX, n, |
| 338 | n, entry_list_policy, NULL); | 338 | entry_list_policy, NULL); |
| 339 | if (err < 0) { | 339 | if (err < 0) { |
| 340 | NL_SET_ERR_MSG(extack, "Could not parse nested entry"); | 340 | NL_SET_ERR_MSG(extack, "Could not parse nested entry"); |
| 341 | return -EINVAL; | 341 | return -EINVAL; |
| @@ -346,9 +346,10 @@ static int parse_sched_single_entry(struct nlattr *n, | |||
| 346 | return -EINVAL; | 346 | return -EINVAL; |
| 347 | } | 347 | } |
| 348 | 348 | ||
| 349 | err = nla_parse_nested(tb_entry, TCA_TAPRIO_SCHED_ENTRY_MAX, | 349 | err = nla_parse_nested_deprecated(tb_entry, |
| 350 | tb_list[TCA_TAPRIO_SCHED_ENTRY], | 350 | TCA_TAPRIO_SCHED_ENTRY_MAX, |
| 351 | entry_policy, NULL); | 351 | tb_list[TCA_TAPRIO_SCHED_ENTRY], |
| 352 | entry_policy, NULL); | ||
| 352 | if (err < 0) { | 353 | if (err < 0) { |
| 353 | NL_SET_ERR_MSG(extack, "Could not parse nested entry"); | 354 | NL_SET_ERR_MSG(extack, "Could not parse nested entry"); |
| 354 | return -EINVAL; | 355 | return -EINVAL; |
| @@ -644,8 +645,8 @@ static int taprio_change(struct Qdisc *sch, struct nlattr *opt, | |||
| 644 | int i, err, size; | 645 | int i, err, size; |
| 645 | ktime_t start; | 646 | ktime_t start; |
| 646 | 647 | ||
| 647 | err = nla_parse_nested(tb, TCA_TAPRIO_ATTR_MAX, opt, | 648 | err = nla_parse_nested_deprecated(tb, TCA_TAPRIO_ATTR_MAX, opt, |
| 648 | taprio_policy, extack); | 649 | taprio_policy, extack); |
| 649 | if (err < 0) | 650 | if (err < 0) |
| 650 | return err; | 651 | return err; |
| 651 | 652 | ||
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c index 3ae5a29eeab3..c09c0d855846 100644 --- a/net/sched/sch_tbf.c +++ b/net/sched/sch_tbf.c | |||
| @@ -308,7 +308,8 @@ static int tbf_change(struct Qdisc *sch, struct nlattr *opt, | |||
| 308 | s64 buffer, mtu; | 308 | s64 buffer, mtu; |
| 309 | u64 rate64 = 0, prate64 = 0; | 309 | u64 rate64 = 0, prate64 = 0; |
| 310 | 310 | ||
| 311 | err = nla_parse_nested(tb, TCA_TBF_MAX, opt, tbf_policy, NULL); | 311 | err = nla_parse_nested_deprecated(tb, TCA_TBF_MAX, opt, tbf_policy, |
| 312 | NULL); | ||
| 312 | if (err < 0) | 313 | if (err < 0) |
| 313 | return err; | 314 | return err; |
| 314 | 315 | ||
diff --git a/net/smc/smc_pnet.c b/net/smc/smc_pnet.c index 9f5d8f36f2d7..bab2da8cf17a 100644 --- a/net/smc/smc_pnet.c +++ b/net/smc/smc_pnet.c | |||
| @@ -612,6 +612,7 @@ static int smc_pnet_flush(struct sk_buff *skb, struct genl_info *info) | |||
| 612 | static const struct genl_ops smc_pnet_ops[] = { | 612 | static const struct genl_ops smc_pnet_ops[] = { |
| 613 | { | 613 | { |
| 614 | .cmd = SMC_PNETID_GET, | 614 | .cmd = SMC_PNETID_GET, |
| 615 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 615 | .flags = GENL_ADMIN_PERM, | 616 | .flags = GENL_ADMIN_PERM, |
| 616 | .doit = smc_pnet_get, | 617 | .doit = smc_pnet_get, |
| 617 | .dumpit = smc_pnet_dump, | 618 | .dumpit = smc_pnet_dump, |
| @@ -619,16 +620,19 @@ static const struct genl_ops smc_pnet_ops[] = { | |||
| 619 | }, | 620 | }, |
| 620 | { | 621 | { |
| 621 | .cmd = SMC_PNETID_ADD, | 622 | .cmd = SMC_PNETID_ADD, |
| 623 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 622 | .flags = GENL_ADMIN_PERM, | 624 | .flags = GENL_ADMIN_PERM, |
| 623 | .doit = smc_pnet_add | 625 | .doit = smc_pnet_add |
| 624 | }, | 626 | }, |
| 625 | { | 627 | { |
| 626 | .cmd = SMC_PNETID_DEL, | 628 | .cmd = SMC_PNETID_DEL, |
| 629 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 627 | .flags = GENL_ADMIN_PERM, | 630 | .flags = GENL_ADMIN_PERM, |
| 628 | .doit = smc_pnet_del | 631 | .doit = smc_pnet_del |
| 629 | }, | 632 | }, |
| 630 | { | 633 | { |
| 631 | .cmd = SMC_PNETID_FLUSH, | 634 | .cmd = SMC_PNETID_FLUSH, |
| 635 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 632 | .flags = GENL_ADMIN_PERM, | 636 | .flags = GENL_ADMIN_PERM, |
| 633 | .doit = smc_pnet_flush | 637 | .doit = smc_pnet_flush |
| 634 | } | 638 | } |
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index fd8e4e83f5e0..2bed6589f41e 100644 --- a/net/tipc/bearer.c +++ b/net/tipc/bearer.c | |||
| @@ -776,9 +776,9 @@ int tipc_nl_bearer_get(struct sk_buff *skb, struct genl_info *info) | |||
| 776 | if (!info->attrs[TIPC_NLA_BEARER]) | 776 | if (!info->attrs[TIPC_NLA_BEARER]) |
| 777 | return -EINVAL; | 777 | return -EINVAL; |
| 778 | 778 | ||
| 779 | err = nla_parse_nested(attrs, TIPC_NLA_BEARER_MAX, | 779 | err = nla_parse_nested_deprecated(attrs, TIPC_NLA_BEARER_MAX, |
| 780 | info->attrs[TIPC_NLA_BEARER], | 780 | info->attrs[TIPC_NLA_BEARER], |
| 781 | tipc_nl_bearer_policy, info->extack); | 781 | tipc_nl_bearer_policy, info->extack); |
| 782 | if (err) | 782 | if (err) |
| 783 | return err; | 783 | return err; |
| 784 | 784 | ||
| @@ -825,9 +825,9 @@ int __tipc_nl_bearer_disable(struct sk_buff *skb, struct genl_info *info) | |||
| 825 | if (!info->attrs[TIPC_NLA_BEARER]) | 825 | if (!info->attrs[TIPC_NLA_BEARER]) |
| 826 | return -EINVAL; | 826 | return -EINVAL; |
| 827 | 827 | ||
| 828 | err = nla_parse_nested(attrs, TIPC_NLA_BEARER_MAX, | 828 | err = nla_parse_nested_deprecated(attrs, TIPC_NLA_BEARER_MAX, |
| 829 | info->attrs[TIPC_NLA_BEARER], | 829 | info->attrs[TIPC_NLA_BEARER], |
| 830 | tipc_nl_bearer_policy, info->extack); | 830 | tipc_nl_bearer_policy, info->extack); |
| 831 | if (err) | 831 | if (err) |
| 832 | return err; | 832 | return err; |
| 833 | 833 | ||
| @@ -870,9 +870,9 @@ int __tipc_nl_bearer_enable(struct sk_buff *skb, struct genl_info *info) | |||
| 870 | if (!info->attrs[TIPC_NLA_BEARER]) | 870 | if (!info->attrs[TIPC_NLA_BEARER]) |
| 871 | return -EINVAL; | 871 | return -EINVAL; |
| 872 | 872 | ||
| 873 | err = nla_parse_nested(attrs, TIPC_NLA_BEARER_MAX, | 873 | err = nla_parse_nested_deprecated(attrs, TIPC_NLA_BEARER_MAX, |
| 874 | info->attrs[TIPC_NLA_BEARER], | 874 | info->attrs[TIPC_NLA_BEARER], |
| 875 | tipc_nl_bearer_policy, info->extack); | 875 | tipc_nl_bearer_policy, info->extack); |
| 876 | if (err) | 876 | if (err) |
| 877 | return err; | 877 | return err; |
| 878 | 878 | ||
| @@ -921,9 +921,9 @@ int tipc_nl_bearer_add(struct sk_buff *skb, struct genl_info *info) | |||
| 921 | if (!info->attrs[TIPC_NLA_BEARER]) | 921 | if (!info->attrs[TIPC_NLA_BEARER]) |
| 922 | return -EINVAL; | 922 | return -EINVAL; |
| 923 | 923 | ||
| 924 | err = nla_parse_nested(attrs, TIPC_NLA_BEARER_MAX, | 924 | err = nla_parse_nested_deprecated(attrs, TIPC_NLA_BEARER_MAX, |
| 925 | info->attrs[TIPC_NLA_BEARER], | 925 | info->attrs[TIPC_NLA_BEARER], |
| 926 | tipc_nl_bearer_policy, info->extack); | 926 | tipc_nl_bearer_policy, info->extack); |
| 927 | if (err) | 927 | if (err) |
| 928 | return err; | 928 | return err; |
| 929 | 929 | ||
| @@ -964,9 +964,9 @@ int __tipc_nl_bearer_set(struct sk_buff *skb, struct genl_info *info) | |||
| 964 | if (!info->attrs[TIPC_NLA_BEARER]) | 964 | if (!info->attrs[TIPC_NLA_BEARER]) |
| 965 | return -EINVAL; | 965 | return -EINVAL; |
| 966 | 966 | ||
| 967 | err = nla_parse_nested(attrs, TIPC_NLA_BEARER_MAX, | 967 | err = nla_parse_nested_deprecated(attrs, TIPC_NLA_BEARER_MAX, |
| 968 | info->attrs[TIPC_NLA_BEARER], | 968 | info->attrs[TIPC_NLA_BEARER], |
| 969 | tipc_nl_bearer_policy, info->extack); | 969 | tipc_nl_bearer_policy, info->extack); |
| 970 | if (err) | 970 | if (err) |
| 971 | return err; | 971 | return err; |
| 972 | 972 | ||
| @@ -1107,9 +1107,9 @@ int tipc_nl_media_get(struct sk_buff *skb, struct genl_info *info) | |||
| 1107 | if (!info->attrs[TIPC_NLA_MEDIA]) | 1107 | if (!info->attrs[TIPC_NLA_MEDIA]) |
| 1108 | return -EINVAL; | 1108 | return -EINVAL; |
| 1109 | 1109 | ||
| 1110 | err = nla_parse_nested(attrs, TIPC_NLA_MEDIA_MAX, | 1110 | err = nla_parse_nested_deprecated(attrs, TIPC_NLA_MEDIA_MAX, |
| 1111 | info->attrs[TIPC_NLA_MEDIA], | 1111 | info->attrs[TIPC_NLA_MEDIA], |
| 1112 | tipc_nl_media_policy, info->extack); | 1112 | tipc_nl_media_policy, info->extack); |
| 1113 | if (err) | 1113 | if (err) |
| 1114 | return err; | 1114 | return err; |
| 1115 | 1115 | ||
| @@ -1155,9 +1155,9 @@ int __tipc_nl_media_set(struct sk_buff *skb, struct genl_info *info) | |||
| 1155 | if (!info->attrs[TIPC_NLA_MEDIA]) | 1155 | if (!info->attrs[TIPC_NLA_MEDIA]) |
| 1156 | return -EINVAL; | 1156 | return -EINVAL; |
| 1157 | 1157 | ||
| 1158 | err = nla_parse_nested(attrs, TIPC_NLA_MEDIA_MAX, | 1158 | err = nla_parse_nested_deprecated(attrs, TIPC_NLA_MEDIA_MAX, |
| 1159 | info->attrs[TIPC_NLA_MEDIA], | 1159 | info->attrs[TIPC_NLA_MEDIA], |
| 1160 | tipc_nl_media_policy, info->extack); | 1160 | tipc_nl_media_policy, info->extack); |
| 1161 | 1161 | ||
| 1162 | if (!attrs[TIPC_NLA_MEDIA_NAME]) | 1162 | if (!attrs[TIPC_NLA_MEDIA_NAME]) |
| 1163 | return -EINVAL; | 1163 | return -EINVAL; |
diff --git a/net/tipc/link.c b/net/tipc/link.c index 0327c8ff8d48..1c514b64a0a9 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c | |||
| @@ -2148,8 +2148,8 @@ int tipc_nl_parse_link_prop(struct nlattr *prop, struct nlattr *props[]) | |||
| 2148 | { | 2148 | { |
| 2149 | int err; | 2149 | int err; |
| 2150 | 2150 | ||
| 2151 | err = nla_parse_nested(props, TIPC_NLA_PROP_MAX, prop, | 2151 | err = nla_parse_nested_deprecated(props, TIPC_NLA_PROP_MAX, prop, |
| 2152 | tipc_nl_prop_policy, NULL); | 2152 | tipc_nl_prop_policy, NULL); |
| 2153 | if (err) | 2153 | if (err) |
| 2154 | return err; | 2154 | return err; |
| 2155 | 2155 | ||
diff --git a/net/tipc/net.c b/net/tipc/net.c index 0bba4e6b005c..85707c185360 100644 --- a/net/tipc/net.c +++ b/net/tipc/net.c | |||
| @@ -245,9 +245,9 @@ int __tipc_nl_net_set(struct sk_buff *skb, struct genl_info *info) | |||
| 245 | if (!info->attrs[TIPC_NLA_NET]) | 245 | if (!info->attrs[TIPC_NLA_NET]) |
| 246 | return -EINVAL; | 246 | return -EINVAL; |
| 247 | 247 | ||
| 248 | err = nla_parse_nested(attrs, TIPC_NLA_NET_MAX, | 248 | err = nla_parse_nested_deprecated(attrs, TIPC_NLA_NET_MAX, |
| 249 | info->attrs[TIPC_NLA_NET], tipc_nl_net_policy, | 249 | info->attrs[TIPC_NLA_NET], |
| 250 | info->extack); | 250 | tipc_nl_net_policy, info->extack); |
| 251 | 251 | ||
| 252 | if (err) | 252 | if (err) |
| 253 | return err; | 253 | return err; |
diff --git a/net/tipc/netlink.c b/net/tipc/netlink.c index 2d178df0a89f..99bd166bccec 100644 --- a/net/tipc/netlink.c +++ b/net/tipc/netlink.c | |||
| @@ -143,93 +143,114 @@ const struct nla_policy tipc_nl_udp_policy[TIPC_NLA_UDP_MAX + 1] = { | |||
| 143 | static const struct genl_ops tipc_genl_v2_ops[] = { | 143 | static const struct genl_ops tipc_genl_v2_ops[] = { |
| 144 | { | 144 | { |
| 145 | .cmd = TIPC_NL_BEARER_DISABLE, | 145 | .cmd = TIPC_NL_BEARER_DISABLE, |
| 146 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 146 | .doit = tipc_nl_bearer_disable, | 147 | .doit = tipc_nl_bearer_disable, |
| 147 | }, | 148 | }, |
| 148 | { | 149 | { |
| 149 | .cmd = TIPC_NL_BEARER_ENABLE, | 150 | .cmd = TIPC_NL_BEARER_ENABLE, |
| 151 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 150 | .doit = tipc_nl_bearer_enable, | 152 | .doit = tipc_nl_bearer_enable, |
| 151 | }, | 153 | }, |
| 152 | { | 154 | { |
| 153 | .cmd = TIPC_NL_BEARER_GET, | 155 | .cmd = TIPC_NL_BEARER_GET, |
| 156 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 154 | .doit = tipc_nl_bearer_get, | 157 | .doit = tipc_nl_bearer_get, |
| 155 | .dumpit = tipc_nl_bearer_dump, | 158 | .dumpit = tipc_nl_bearer_dump, |
| 156 | }, | 159 | }, |
| 157 | { | 160 | { |
| 158 | .cmd = TIPC_NL_BEARER_ADD, | 161 | .cmd = TIPC_NL_BEARER_ADD, |
| 162 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 159 | .doit = tipc_nl_bearer_add, | 163 | .doit = tipc_nl_bearer_add, |
| 160 | }, | 164 | }, |
| 161 | { | 165 | { |
| 162 | .cmd = TIPC_NL_BEARER_SET, | 166 | .cmd = TIPC_NL_BEARER_SET, |
| 167 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 163 | .doit = tipc_nl_bearer_set, | 168 | .doit = tipc_nl_bearer_set, |
| 164 | }, | 169 | }, |
| 165 | { | 170 | { |
| 166 | .cmd = TIPC_NL_SOCK_GET, | 171 | .cmd = TIPC_NL_SOCK_GET, |
| 172 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 167 | .start = tipc_dump_start, | 173 | .start = tipc_dump_start, |
| 168 | .dumpit = tipc_nl_sk_dump, | 174 | .dumpit = tipc_nl_sk_dump, |
| 169 | .done = tipc_dump_done, | 175 | .done = tipc_dump_done, |
| 170 | }, | 176 | }, |
| 171 | { | 177 | { |
| 172 | .cmd = TIPC_NL_PUBL_GET, | 178 | .cmd = TIPC_NL_PUBL_GET, |
| 179 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 173 | .dumpit = tipc_nl_publ_dump, | 180 | .dumpit = tipc_nl_publ_dump, |
| 174 | }, | 181 | }, |
| 175 | { | 182 | { |
| 176 | .cmd = TIPC_NL_LINK_GET, | 183 | .cmd = TIPC_NL_LINK_GET, |
| 184 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 177 | .doit = tipc_nl_node_get_link, | 185 | .doit = tipc_nl_node_get_link, |
| 178 | .dumpit = tipc_nl_node_dump_link, | 186 | .dumpit = tipc_nl_node_dump_link, |
| 179 | }, | 187 | }, |
| 180 | { | 188 | { |
| 181 | .cmd = TIPC_NL_LINK_SET, | 189 | .cmd = TIPC_NL_LINK_SET, |
| 190 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 182 | .doit = tipc_nl_node_set_link, | 191 | .doit = tipc_nl_node_set_link, |
| 183 | }, | 192 | }, |
| 184 | { | 193 | { |
| 185 | .cmd = TIPC_NL_LINK_RESET_STATS, | 194 | .cmd = TIPC_NL_LINK_RESET_STATS, |
| 195 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 186 | .doit = tipc_nl_node_reset_link_stats, | 196 | .doit = tipc_nl_node_reset_link_stats, |
| 187 | }, | 197 | }, |
| 188 | { | 198 | { |
| 189 | .cmd = TIPC_NL_MEDIA_GET, | 199 | .cmd = TIPC_NL_MEDIA_GET, |
| 200 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 190 | .doit = tipc_nl_media_get, | 201 | .doit = tipc_nl_media_get, |
| 191 | .dumpit = tipc_nl_media_dump, | 202 | .dumpit = tipc_nl_media_dump, |
| 192 | }, | 203 | }, |
| 193 | { | 204 | { |
| 194 | .cmd = TIPC_NL_MEDIA_SET, | 205 | .cmd = TIPC_NL_MEDIA_SET, |
| 206 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 195 | .doit = tipc_nl_media_set, | 207 | .doit = tipc_nl_media_set, |
| 196 | }, | 208 | }, |
| 197 | { | 209 | { |
| 198 | .cmd = TIPC_NL_NODE_GET, | 210 | .cmd = TIPC_NL_NODE_GET, |
| 211 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 199 | .dumpit = tipc_nl_node_dump, | 212 | .dumpit = tipc_nl_node_dump, |
| 200 | }, | 213 | }, |
| 201 | { | 214 | { |
| 202 | .cmd = TIPC_NL_NET_GET, | 215 | .cmd = TIPC_NL_NET_GET, |
| 216 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 203 | .dumpit = tipc_nl_net_dump, | 217 | .dumpit = tipc_nl_net_dump, |
| 204 | }, | 218 | }, |
| 205 | { | 219 | { |
| 206 | .cmd = TIPC_NL_NET_SET, | 220 | .cmd = TIPC_NL_NET_SET, |
| 221 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 207 | .doit = tipc_nl_net_set, | 222 | .doit = tipc_nl_net_set, |
| 208 | }, | 223 | }, |
| 209 | { | 224 | { |
| 210 | .cmd = TIPC_NL_NAME_TABLE_GET, | 225 | .cmd = TIPC_NL_NAME_TABLE_GET, |
| 226 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 211 | .dumpit = tipc_nl_name_table_dump, | 227 | .dumpit = tipc_nl_name_table_dump, |
| 212 | }, | 228 | }, |
| 213 | { | 229 | { |
| 214 | .cmd = TIPC_NL_MON_SET, | 230 | .cmd = TIPC_NL_MON_SET, |
| 231 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 215 | .doit = tipc_nl_node_set_monitor, | 232 | .doit = tipc_nl_node_set_monitor, |
| 216 | }, | 233 | }, |
| 217 | { | 234 | { |
| 218 | .cmd = TIPC_NL_MON_GET, | 235 | .cmd = TIPC_NL_MON_GET, |
| 236 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 219 | .doit = tipc_nl_node_get_monitor, | 237 | .doit = tipc_nl_node_get_monitor, |
| 220 | .dumpit = tipc_nl_node_dump_monitor, | 238 | .dumpit = tipc_nl_node_dump_monitor, |
| 221 | }, | 239 | }, |
| 222 | { | 240 | { |
| 223 | .cmd = TIPC_NL_MON_PEER_GET, | 241 | .cmd = TIPC_NL_MON_PEER_GET, |
| 242 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 224 | .dumpit = tipc_nl_node_dump_monitor_peer, | 243 | .dumpit = tipc_nl_node_dump_monitor_peer, |
| 225 | }, | 244 | }, |
| 226 | { | 245 | { |
| 227 | .cmd = TIPC_NL_PEER_REMOVE, | 246 | .cmd = TIPC_NL_PEER_REMOVE, |
| 247 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 228 | .doit = tipc_nl_peer_rm, | 248 | .doit = tipc_nl_peer_rm, |
| 229 | }, | 249 | }, |
| 230 | #ifdef CONFIG_TIPC_MEDIA_UDP | 250 | #ifdef CONFIG_TIPC_MEDIA_UDP |
| 231 | { | 251 | { |
| 232 | .cmd = TIPC_NL_UDP_GET_REMOTEIP, | 252 | .cmd = TIPC_NL_UDP_GET_REMOTEIP, |
| 253 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 233 | .dumpit = tipc_udp_nl_dump_remoteip, | 254 | .dumpit = tipc_udp_nl_dump_remoteip, |
| 234 | }, | 255 | }, |
| 235 | #endif | 256 | #endif |
| @@ -255,8 +276,8 @@ int tipc_nlmsg_parse(const struct nlmsghdr *nlh, struct nlattr ***attr) | |||
| 255 | if (!*attr) | 276 | if (!*attr) |
| 256 | return -EOPNOTSUPP; | 277 | return -EOPNOTSUPP; |
| 257 | 278 | ||
| 258 | return nlmsg_parse(nlh, GENL_HDRLEN, *attr, maxattr, tipc_nl_policy, | 279 | return nlmsg_parse_deprecated(nlh, GENL_HDRLEN, *attr, maxattr, |
| 259 | NULL); | 280 | tipc_nl_policy, NULL); |
| 260 | } | 281 | } |
| 261 | 282 | ||
| 262 | int __init tipc_netlink_start(void) | 283 | int __init tipc_netlink_start(void) |
diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c index 36fe2dbb6d87..c6a04c09d075 100644 --- a/net/tipc/netlink_compat.c +++ b/net/tipc/netlink_compat.c | |||
| @@ -328,9 +328,9 @@ static int __tipc_nl_compat_doit(struct tipc_nl_compat_cmd_doit *cmd, | |||
| 328 | if (err) | 328 | if (err) |
| 329 | goto doit_out; | 329 | goto doit_out; |
| 330 | 330 | ||
| 331 | err = nla_parse(attrbuf, tipc_genl_family.maxattr, | 331 | err = nla_parse_deprecated(attrbuf, tipc_genl_family.maxattr, |
| 332 | (const struct nlattr *)trans_buf->data, | 332 | (const struct nlattr *)trans_buf->data, |
| 333 | trans_buf->len, NULL, NULL); | 333 | trans_buf->len, NULL, NULL); |
| 334 | if (err) | 334 | if (err) |
| 335 | goto doit_out; | 335 | goto doit_out; |
| 336 | 336 | ||
| @@ -378,8 +378,8 @@ static int tipc_nl_compat_bearer_dump(struct tipc_nl_compat_msg *msg, | |||
| 378 | if (!attrs[TIPC_NLA_BEARER]) | 378 | if (!attrs[TIPC_NLA_BEARER]) |
| 379 | return -EINVAL; | 379 | return -EINVAL; |
| 380 | 380 | ||
| 381 | err = nla_parse_nested(bearer, TIPC_NLA_BEARER_MAX, | 381 | err = nla_parse_nested_deprecated(bearer, TIPC_NLA_BEARER_MAX, |
| 382 | attrs[TIPC_NLA_BEARER], NULL, NULL); | 382 | attrs[TIPC_NLA_BEARER], NULL, NULL); |
| 383 | if (err) | 383 | if (err) |
| 384 | return err; | 384 | return err; |
| 385 | 385 | ||
| @@ -514,24 +514,26 @@ static int tipc_nl_compat_link_stat_dump(struct tipc_nl_compat_msg *msg, | |||
| 514 | if (!attrs[TIPC_NLA_LINK]) | 514 | if (!attrs[TIPC_NLA_LINK]) |
| 515 | return -EINVAL; | 515 | return -EINVAL; |
| 516 | 516 | ||
| 517 | err = nla_parse_nested(link, TIPC_NLA_LINK_MAX, attrs[TIPC_NLA_LINK], | 517 | err = nla_parse_nested_deprecated(link, TIPC_NLA_LINK_MAX, |
| 518 | NULL, NULL); | 518 | attrs[TIPC_NLA_LINK], NULL, NULL); |
| 519 | if (err) | 519 | if (err) |
| 520 | return err; | 520 | return err; |
| 521 | 521 | ||
| 522 | if (!link[TIPC_NLA_LINK_PROP]) | 522 | if (!link[TIPC_NLA_LINK_PROP]) |
| 523 | return -EINVAL; | 523 | return -EINVAL; |
| 524 | 524 | ||
| 525 | err = nla_parse_nested(prop, TIPC_NLA_PROP_MAX, | 525 | err = nla_parse_nested_deprecated(prop, TIPC_NLA_PROP_MAX, |
| 526 | link[TIPC_NLA_LINK_PROP], NULL, NULL); | 526 | link[TIPC_NLA_LINK_PROP], NULL, |
| 527 | NULL); | ||
| 527 | if (err) | 528 | if (err) |
| 528 | return err; | 529 | return err; |
| 529 | 530 | ||
| 530 | if (!link[TIPC_NLA_LINK_STATS]) | 531 | if (!link[TIPC_NLA_LINK_STATS]) |
| 531 | return -EINVAL; | 532 | return -EINVAL; |
| 532 | 533 | ||
| 533 | err = nla_parse_nested(stats, TIPC_NLA_STATS_MAX, | 534 | err = nla_parse_nested_deprecated(stats, TIPC_NLA_STATS_MAX, |
| 534 | link[TIPC_NLA_LINK_STATS], NULL, NULL); | 535 | link[TIPC_NLA_LINK_STATS], NULL, |
| 536 | NULL); | ||
| 535 | if (err) | 537 | if (err) |
| 536 | return err; | 538 | return err; |
| 537 | 539 | ||
| @@ -645,8 +647,8 @@ static int tipc_nl_compat_link_dump(struct tipc_nl_compat_msg *msg, | |||
| 645 | if (!attrs[TIPC_NLA_LINK]) | 647 | if (!attrs[TIPC_NLA_LINK]) |
| 646 | return -EINVAL; | 648 | return -EINVAL; |
| 647 | 649 | ||
| 648 | err = nla_parse_nested(link, TIPC_NLA_LINK_MAX, attrs[TIPC_NLA_LINK], | 650 | err = nla_parse_nested_deprecated(link, TIPC_NLA_LINK_MAX, |
| 649 | NULL, NULL); | 651 | attrs[TIPC_NLA_LINK], NULL, NULL); |
| 650 | if (err) | 652 | if (err) |
| 651 | return err; | 653 | return err; |
| 652 | 654 | ||
| @@ -869,16 +871,18 @@ static int tipc_nl_compat_name_table_dump(struct tipc_nl_compat_msg *msg, | |||
| 869 | if (!attrs[TIPC_NLA_NAME_TABLE]) | 871 | if (!attrs[TIPC_NLA_NAME_TABLE]) |
| 870 | return -EINVAL; | 872 | return -EINVAL; |
| 871 | 873 | ||
| 872 | err = nla_parse_nested(nt, TIPC_NLA_NAME_TABLE_MAX, | 874 | err = nla_parse_nested_deprecated(nt, TIPC_NLA_NAME_TABLE_MAX, |
| 873 | attrs[TIPC_NLA_NAME_TABLE], NULL, NULL); | 875 | attrs[TIPC_NLA_NAME_TABLE], NULL, |
| 876 | NULL); | ||
| 874 | if (err) | 877 | if (err) |
| 875 | return err; | 878 | return err; |
| 876 | 879 | ||
| 877 | if (!nt[TIPC_NLA_NAME_TABLE_PUBL]) | 880 | if (!nt[TIPC_NLA_NAME_TABLE_PUBL]) |
| 878 | return -EINVAL; | 881 | return -EINVAL; |
| 879 | 882 | ||
| 880 | err = nla_parse_nested(publ, TIPC_NLA_PUBL_MAX, | 883 | err = nla_parse_nested_deprecated(publ, TIPC_NLA_PUBL_MAX, |
| 881 | nt[TIPC_NLA_NAME_TABLE_PUBL], NULL, NULL); | 884 | nt[TIPC_NLA_NAME_TABLE_PUBL], NULL, |
| 885 | NULL); | ||
| 882 | if (err) | 886 | if (err) |
| 883 | return err; | 887 | return err; |
| 884 | 888 | ||
| @@ -937,8 +941,8 @@ static int __tipc_nl_compat_publ_dump(struct tipc_nl_compat_msg *msg, | |||
| 937 | if (!attrs[TIPC_NLA_PUBL]) | 941 | if (!attrs[TIPC_NLA_PUBL]) |
| 938 | return -EINVAL; | 942 | return -EINVAL; |
| 939 | 943 | ||
| 940 | err = nla_parse_nested(publ, TIPC_NLA_PUBL_MAX, attrs[TIPC_NLA_PUBL], | 944 | err = nla_parse_nested_deprecated(publ, TIPC_NLA_PUBL_MAX, |
| 941 | NULL, NULL); | 945 | attrs[TIPC_NLA_PUBL], NULL, NULL); |
| 942 | if (err) | 946 | if (err) |
| 943 | return err; | 947 | return err; |
| 944 | 948 | ||
| @@ -1007,8 +1011,8 @@ static int tipc_nl_compat_sk_dump(struct tipc_nl_compat_msg *msg, | |||
| 1007 | if (!attrs[TIPC_NLA_SOCK]) | 1011 | if (!attrs[TIPC_NLA_SOCK]) |
| 1008 | return -EINVAL; | 1012 | return -EINVAL; |
| 1009 | 1013 | ||
| 1010 | err = nla_parse_nested(sock, TIPC_NLA_SOCK_MAX, attrs[TIPC_NLA_SOCK], | 1014 | err = nla_parse_nested_deprecated(sock, TIPC_NLA_SOCK_MAX, |
| 1011 | NULL, NULL); | 1015 | attrs[TIPC_NLA_SOCK], NULL, NULL); |
| 1012 | if (err) | 1016 | if (err) |
| 1013 | return err; | 1017 | return err; |
| 1014 | 1018 | ||
| @@ -1019,8 +1023,9 @@ static int tipc_nl_compat_sk_dump(struct tipc_nl_compat_msg *msg, | |||
| 1019 | u32 node; | 1023 | u32 node; |
| 1020 | struct nlattr *con[TIPC_NLA_CON_MAX + 1]; | 1024 | struct nlattr *con[TIPC_NLA_CON_MAX + 1]; |
| 1021 | 1025 | ||
| 1022 | err = nla_parse_nested(con, TIPC_NLA_CON_MAX, | 1026 | err = nla_parse_nested_deprecated(con, TIPC_NLA_CON_MAX, |
| 1023 | sock[TIPC_NLA_SOCK_CON], NULL, NULL); | 1027 | sock[TIPC_NLA_SOCK_CON], |
| 1028 | NULL, NULL); | ||
| 1024 | 1029 | ||
| 1025 | if (err) | 1030 | if (err) |
| 1026 | return err; | 1031 | return err; |
| @@ -1059,8 +1064,8 @@ static int tipc_nl_compat_media_dump(struct tipc_nl_compat_msg *msg, | |||
| 1059 | if (!attrs[TIPC_NLA_MEDIA]) | 1064 | if (!attrs[TIPC_NLA_MEDIA]) |
| 1060 | return -EINVAL; | 1065 | return -EINVAL; |
| 1061 | 1066 | ||
| 1062 | err = nla_parse_nested(media, TIPC_NLA_MEDIA_MAX, | 1067 | err = nla_parse_nested_deprecated(media, TIPC_NLA_MEDIA_MAX, |
| 1063 | attrs[TIPC_NLA_MEDIA], NULL, NULL); | 1068 | attrs[TIPC_NLA_MEDIA], NULL, NULL); |
| 1064 | if (err) | 1069 | if (err) |
| 1065 | return err; | 1070 | return err; |
| 1066 | 1071 | ||
| @@ -1079,8 +1084,8 @@ static int tipc_nl_compat_node_dump(struct tipc_nl_compat_msg *msg, | |||
| 1079 | if (!attrs[TIPC_NLA_NODE]) | 1084 | if (!attrs[TIPC_NLA_NODE]) |
| 1080 | return -EINVAL; | 1085 | return -EINVAL; |
| 1081 | 1086 | ||
| 1082 | err = nla_parse_nested(node, TIPC_NLA_NODE_MAX, attrs[TIPC_NLA_NODE], | 1087 | err = nla_parse_nested_deprecated(node, TIPC_NLA_NODE_MAX, |
| 1083 | NULL, NULL); | 1088 | attrs[TIPC_NLA_NODE], NULL, NULL); |
| 1084 | if (err) | 1089 | if (err) |
| 1085 | return err; | 1090 | return err; |
| 1086 | 1091 | ||
| @@ -1126,8 +1131,8 @@ static int tipc_nl_compat_net_dump(struct tipc_nl_compat_msg *msg, | |||
| 1126 | if (!attrs[TIPC_NLA_NET]) | 1131 | if (!attrs[TIPC_NLA_NET]) |
| 1127 | return -EINVAL; | 1132 | return -EINVAL; |
| 1128 | 1133 | ||
| 1129 | err = nla_parse_nested(net, TIPC_NLA_NET_MAX, attrs[TIPC_NLA_NET], | 1134 | err = nla_parse_nested_deprecated(net, TIPC_NLA_NET_MAX, |
| 1130 | NULL, NULL); | 1135 | attrs[TIPC_NLA_NET], NULL, NULL); |
| 1131 | if (err) | 1136 | if (err) |
| 1132 | return err; | 1137 | return err; |
| 1133 | 1138 | ||
| @@ -1300,6 +1305,7 @@ send: | |||
| 1300 | static const struct genl_ops tipc_genl_compat_ops[] = { | 1305 | static const struct genl_ops tipc_genl_compat_ops[] = { |
| 1301 | { | 1306 | { |
| 1302 | .cmd = TIPC_GENL_CMD, | 1307 | .cmd = TIPC_GENL_CMD, |
| 1308 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 1303 | .doit = tipc_nl_compat_recv, | 1309 | .doit = tipc_nl_compat_recv, |
| 1304 | }, | 1310 | }, |
| 1305 | }; | 1311 | }; |
diff --git a/net/tipc/node.c b/net/tipc/node.c index 3777254a508f..0eb1bf850219 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c | |||
| @@ -1885,9 +1885,9 @@ int tipc_nl_peer_rm(struct sk_buff *skb, struct genl_info *info) | |||
| 1885 | if (!info->attrs[TIPC_NLA_NET]) | 1885 | if (!info->attrs[TIPC_NLA_NET]) |
| 1886 | return -EINVAL; | 1886 | return -EINVAL; |
| 1887 | 1887 | ||
| 1888 | err = nla_parse_nested(attrs, TIPC_NLA_NET_MAX, | 1888 | err = nla_parse_nested_deprecated(attrs, TIPC_NLA_NET_MAX, |
| 1889 | info->attrs[TIPC_NLA_NET], tipc_nl_net_policy, | 1889 | info->attrs[TIPC_NLA_NET], |
| 1890 | info->extack); | 1890 | tipc_nl_net_policy, info->extack); |
| 1891 | if (err) | 1891 | if (err) |
| 1892 | return err; | 1892 | return err; |
| 1893 | 1893 | ||
| @@ -2043,9 +2043,9 @@ int tipc_nl_node_set_link(struct sk_buff *skb, struct genl_info *info) | |||
| 2043 | if (!info->attrs[TIPC_NLA_LINK]) | 2043 | if (!info->attrs[TIPC_NLA_LINK]) |
| 2044 | return -EINVAL; | 2044 | return -EINVAL; |
| 2045 | 2045 | ||
| 2046 | err = nla_parse_nested(attrs, TIPC_NLA_LINK_MAX, | 2046 | err = nla_parse_nested_deprecated(attrs, TIPC_NLA_LINK_MAX, |
| 2047 | info->attrs[TIPC_NLA_LINK], | 2047 | info->attrs[TIPC_NLA_LINK], |
| 2048 | tipc_nl_link_policy, info->extack); | 2048 | tipc_nl_link_policy, info->extack); |
| 2049 | if (err) | 2049 | if (err) |
| 2050 | return err; | 2050 | return err; |
| 2051 | 2051 | ||
| @@ -2119,9 +2119,9 @@ int tipc_nl_node_get_link(struct sk_buff *skb, struct genl_info *info) | |||
| 2119 | if (!info->attrs[TIPC_NLA_LINK]) | 2119 | if (!info->attrs[TIPC_NLA_LINK]) |
| 2120 | return -EINVAL; | 2120 | return -EINVAL; |
| 2121 | 2121 | ||
| 2122 | err = nla_parse_nested(attrs, TIPC_NLA_LINK_MAX, | 2122 | err = nla_parse_nested_deprecated(attrs, TIPC_NLA_LINK_MAX, |
| 2123 | info->attrs[TIPC_NLA_LINK], | 2123 | info->attrs[TIPC_NLA_LINK], |
| 2124 | tipc_nl_link_policy, info->extack); | 2124 | tipc_nl_link_policy, info->extack); |
| 2125 | if (err) | 2125 | if (err) |
| 2126 | return err; | 2126 | return err; |
| 2127 | 2127 | ||
| @@ -2184,9 +2184,9 @@ int tipc_nl_node_reset_link_stats(struct sk_buff *skb, struct genl_info *info) | |||
| 2184 | if (!info->attrs[TIPC_NLA_LINK]) | 2184 | if (!info->attrs[TIPC_NLA_LINK]) |
| 2185 | return -EINVAL; | 2185 | return -EINVAL; |
| 2186 | 2186 | ||
| 2187 | err = nla_parse_nested(attrs, TIPC_NLA_LINK_MAX, | 2187 | err = nla_parse_nested_deprecated(attrs, TIPC_NLA_LINK_MAX, |
| 2188 | info->attrs[TIPC_NLA_LINK], | 2188 | info->attrs[TIPC_NLA_LINK], |
| 2189 | tipc_nl_link_policy, info->extack); | 2189 | tipc_nl_link_policy, info->extack); |
| 2190 | if (err) | 2190 | if (err) |
| 2191 | return err; | 2191 | return err; |
| 2192 | 2192 | ||
| @@ -2324,9 +2324,10 @@ int tipc_nl_node_set_monitor(struct sk_buff *skb, struct genl_info *info) | |||
| 2324 | if (!info->attrs[TIPC_NLA_MON]) | 2324 | if (!info->attrs[TIPC_NLA_MON]) |
| 2325 | return -EINVAL; | 2325 | return -EINVAL; |
| 2326 | 2326 | ||
| 2327 | err = nla_parse_nested(attrs, TIPC_NLA_MON_MAX, | 2327 | err = nla_parse_nested_deprecated(attrs, TIPC_NLA_MON_MAX, |
| 2328 | info->attrs[TIPC_NLA_MON], | 2328 | info->attrs[TIPC_NLA_MON], |
| 2329 | tipc_nl_monitor_policy, info->extack); | 2329 | tipc_nl_monitor_policy, |
| 2330 | info->extack); | ||
| 2330 | if (err) | 2331 | if (err) |
| 2331 | return err; | 2332 | return err; |
| 2332 | 2333 | ||
| @@ -2444,9 +2445,10 @@ int tipc_nl_node_dump_monitor_peer(struct sk_buff *skb, | |||
| 2444 | if (!attrs[TIPC_NLA_MON]) | 2445 | if (!attrs[TIPC_NLA_MON]) |
| 2445 | return -EINVAL; | 2446 | return -EINVAL; |
| 2446 | 2447 | ||
| 2447 | err = nla_parse_nested(mon, TIPC_NLA_MON_MAX, | 2448 | err = nla_parse_nested_deprecated(mon, TIPC_NLA_MON_MAX, |
| 2448 | attrs[TIPC_NLA_MON], | 2449 | attrs[TIPC_NLA_MON], |
| 2449 | tipc_nl_monitor_policy, NULL); | 2450 | tipc_nl_monitor_policy, |
| 2451 | NULL); | ||
| 2450 | if (err) | 2452 | if (err) |
| 2451 | return err; | 2453 | return err; |
| 2452 | 2454 | ||
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 7918f4763fdc..145e4decb0c9 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c | |||
| @@ -3599,9 +3599,9 @@ int tipc_nl_publ_dump(struct sk_buff *skb, struct netlink_callback *cb) | |||
| 3599 | if (!attrs[TIPC_NLA_SOCK]) | 3599 | if (!attrs[TIPC_NLA_SOCK]) |
| 3600 | return -EINVAL; | 3600 | return -EINVAL; |
| 3601 | 3601 | ||
| 3602 | err = nla_parse_nested(sock, TIPC_NLA_SOCK_MAX, | 3602 | err = nla_parse_nested_deprecated(sock, TIPC_NLA_SOCK_MAX, |
| 3603 | attrs[TIPC_NLA_SOCK], | 3603 | attrs[TIPC_NLA_SOCK], |
| 3604 | tipc_nl_sock_policy, NULL); | 3604 | tipc_nl_sock_policy, NULL); |
| 3605 | if (err) | 3605 | if (err) |
| 3606 | return err; | 3606 | return err; |
| 3607 | 3607 | ||
diff --git a/net/tipc/udp_media.c b/net/tipc/udp_media.c index 24d7c79598bb..7fc02d84c4f1 100644 --- a/net/tipc/udp_media.c +++ b/net/tipc/udp_media.c | |||
| @@ -447,9 +447,9 @@ int tipc_udp_nl_dump_remoteip(struct sk_buff *skb, struct netlink_callback *cb) | |||
| 447 | if (!attrs[TIPC_NLA_BEARER]) | 447 | if (!attrs[TIPC_NLA_BEARER]) |
| 448 | return -EINVAL; | 448 | return -EINVAL; |
| 449 | 449 | ||
| 450 | err = nla_parse_nested(battrs, TIPC_NLA_BEARER_MAX, | 450 | err = nla_parse_nested_deprecated(battrs, TIPC_NLA_BEARER_MAX, |
| 451 | attrs[TIPC_NLA_BEARER], | 451 | attrs[TIPC_NLA_BEARER], |
| 452 | tipc_nl_bearer_policy, NULL); | 452 | tipc_nl_bearer_policy, NULL); |
| 453 | if (err) | 453 | if (err) |
| 454 | return err; | 454 | return err; |
| 455 | 455 | ||
| @@ -601,8 +601,7 @@ int tipc_udp_nl_bearer_add(struct tipc_bearer *b, struct nlattr *attr) | |||
| 601 | struct nlattr *opts[TIPC_NLA_UDP_MAX + 1]; | 601 | struct nlattr *opts[TIPC_NLA_UDP_MAX + 1]; |
| 602 | struct udp_media_addr *dst; | 602 | struct udp_media_addr *dst; |
| 603 | 603 | ||
| 604 | if (nla_parse_nested(opts, TIPC_NLA_UDP_MAX, attr, | 604 | if (nla_parse_nested_deprecated(opts, TIPC_NLA_UDP_MAX, attr, tipc_nl_udp_policy, NULL)) |
| 605 | tipc_nl_udp_policy, NULL)) | ||
| 606 | return -EINVAL; | 605 | return -EINVAL; |
| 607 | 606 | ||
| 608 | if (!opts[TIPC_NLA_UDP_REMOTE]) | 607 | if (!opts[TIPC_NLA_UDP_REMOTE]) |
| @@ -655,9 +654,7 @@ static int tipc_udp_enable(struct net *net, struct tipc_bearer *b, | |||
| 655 | if (!attrs[TIPC_NLA_BEARER_UDP_OPTS]) | 654 | if (!attrs[TIPC_NLA_BEARER_UDP_OPTS]) |
| 656 | goto err; | 655 | goto err; |
| 657 | 656 | ||
| 658 | if (nla_parse_nested(opts, TIPC_NLA_UDP_MAX, | 657 | if (nla_parse_nested_deprecated(opts, TIPC_NLA_UDP_MAX, attrs[TIPC_NLA_BEARER_UDP_OPTS], tipc_nl_udp_policy, NULL)) |
| 659 | attrs[TIPC_NLA_BEARER_UDP_OPTS], | ||
| 660 | tipc_nl_udp_policy, NULL)) | ||
| 661 | goto err; | 658 | goto err; |
| 662 | 659 | ||
| 663 | if (!opts[TIPC_NLA_UDP_LOCAL] || !opts[TIPC_NLA_UDP_REMOTE]) { | 660 | if (!opts[TIPC_NLA_UDP_LOCAL] || !opts[TIPC_NLA_UDP_REMOTE]) { |
diff --git a/net/wimax/stack.c b/net/wimax/stack.c index b7f571e55448..4969de672886 100644 --- a/net/wimax/stack.c +++ b/net/wimax/stack.c | |||
| @@ -419,21 +419,25 @@ static const struct nla_policy wimax_gnl_policy[WIMAX_GNL_ATTR_MAX + 1] = { | |||
| 419 | static const struct genl_ops wimax_gnl_ops[] = { | 419 | static const struct genl_ops wimax_gnl_ops[] = { |
| 420 | { | 420 | { |
| 421 | .cmd = WIMAX_GNL_OP_MSG_FROM_USER, | 421 | .cmd = WIMAX_GNL_OP_MSG_FROM_USER, |
| 422 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 422 | .flags = GENL_ADMIN_PERM, | 423 | .flags = GENL_ADMIN_PERM, |
| 423 | .doit = wimax_gnl_doit_msg_from_user, | 424 | .doit = wimax_gnl_doit_msg_from_user, |
| 424 | }, | 425 | }, |
| 425 | { | 426 | { |
| 426 | .cmd = WIMAX_GNL_OP_RESET, | 427 | .cmd = WIMAX_GNL_OP_RESET, |
| 428 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 427 | .flags = GENL_ADMIN_PERM, | 429 | .flags = GENL_ADMIN_PERM, |
| 428 | .doit = wimax_gnl_doit_reset, | 430 | .doit = wimax_gnl_doit_reset, |
| 429 | }, | 431 | }, |
| 430 | { | 432 | { |
| 431 | .cmd = WIMAX_GNL_OP_RFKILL, | 433 | .cmd = WIMAX_GNL_OP_RFKILL, |
| 434 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 432 | .flags = GENL_ADMIN_PERM, | 435 | .flags = GENL_ADMIN_PERM, |
| 433 | .doit = wimax_gnl_doit_rfkill, | 436 | .doit = wimax_gnl_doit_rfkill, |
| 434 | }, | 437 | }, |
| 435 | { | 438 | { |
| 436 | .cmd = WIMAX_GNL_OP_STATE_GET, | 439 | .cmd = WIMAX_GNL_OP_STATE_GET, |
| 440 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 437 | .flags = GENL_ADMIN_PERM, | 441 | .flags = GENL_ADMIN_PERM, |
| 438 | .doit = wimax_gnl_doit_state_get, | 442 | .doit = wimax_gnl_doit_state_get, |
| 439 | }, | 443 | }, |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 0bcd5ea4b4f2..fffe4b371e23 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
| @@ -703,9 +703,11 @@ int nl80211_prepare_wdev_dump(struct netlink_callback *cb, | |||
| 703 | int err; | 703 | int err; |
| 704 | 704 | ||
| 705 | if (!cb->args[0]) { | 705 | if (!cb->args[0]) { |
| 706 | err = nlmsg_parse(cb->nlh, GENL_HDRLEN + nl80211_fam.hdrsize, | 706 | err = nlmsg_parse_deprecated(cb->nlh, |
| 707 | genl_family_attrbuf(&nl80211_fam), | 707 | GENL_HDRLEN + nl80211_fam.hdrsize, |
| 708 | nl80211_fam.maxattr, nl80211_policy, NULL); | 708 | genl_family_attrbuf(&nl80211_fam), |
| 709 | nl80211_fam.maxattr, | ||
| 710 | nl80211_policy, NULL); | ||
| 709 | if (err) | 711 | if (err) |
| 710 | return err; | 712 | return err; |
| 711 | 713 | ||
| @@ -925,8 +927,9 @@ static int nl80211_parse_key_new(struct genl_info *info, struct nlattr *key, | |||
| 925 | struct key_parse *k) | 927 | struct key_parse *k) |
| 926 | { | 928 | { |
| 927 | struct nlattr *tb[NL80211_KEY_MAX + 1]; | 929 | struct nlattr *tb[NL80211_KEY_MAX + 1]; |
| 928 | int err = nla_parse_nested(tb, NL80211_KEY_MAX, key, | 930 | int err = nla_parse_nested_deprecated(tb, NL80211_KEY_MAX, key, |
| 929 | nl80211_key_policy, info->extack); | 931 | nl80211_key_policy, |
| 932 | info->extack); | ||
| 930 | if (err) | 933 | if (err) |
| 931 | return err; | 934 | return err; |
| 932 | 935 | ||
| @@ -962,10 +965,11 @@ static int nl80211_parse_key_new(struct genl_info *info, struct nlattr *key, | |||
| 962 | if (tb[NL80211_KEY_DEFAULT_TYPES]) { | 965 | if (tb[NL80211_KEY_DEFAULT_TYPES]) { |
| 963 | struct nlattr *kdt[NUM_NL80211_KEY_DEFAULT_TYPES]; | 966 | struct nlattr *kdt[NUM_NL80211_KEY_DEFAULT_TYPES]; |
| 964 | 967 | ||
| 965 | err = nla_parse_nested(kdt, NUM_NL80211_KEY_DEFAULT_TYPES - 1, | 968 | err = nla_parse_nested_deprecated(kdt, |
| 966 | tb[NL80211_KEY_DEFAULT_TYPES], | 969 | NUM_NL80211_KEY_DEFAULT_TYPES - 1, |
| 967 | nl80211_key_default_policy, | 970 | tb[NL80211_KEY_DEFAULT_TYPES], |
| 968 | info->extack); | 971 | nl80211_key_default_policy, |
| 972 | info->extack); | ||
| 969 | if (err) | 973 | if (err) |
| 970 | return err; | 974 | return err; |
| 971 | 975 | ||
| @@ -1012,11 +1016,11 @@ static int nl80211_parse_key_old(struct genl_info *info, struct key_parse *k) | |||
| 1012 | 1016 | ||
| 1013 | if (info->attrs[NL80211_ATTR_KEY_DEFAULT_TYPES]) { | 1017 | if (info->attrs[NL80211_ATTR_KEY_DEFAULT_TYPES]) { |
| 1014 | struct nlattr *kdt[NUM_NL80211_KEY_DEFAULT_TYPES]; | 1018 | struct nlattr *kdt[NUM_NL80211_KEY_DEFAULT_TYPES]; |
| 1015 | int err = nla_parse_nested(kdt, | 1019 | int err = nla_parse_nested_deprecated(kdt, |
| 1016 | NUM_NL80211_KEY_DEFAULT_TYPES - 1, | 1020 | NUM_NL80211_KEY_DEFAULT_TYPES - 1, |
| 1017 | info->attrs[NL80211_ATTR_KEY_DEFAULT_TYPES], | 1021 | info->attrs[NL80211_ATTR_KEY_DEFAULT_TYPES], |
| 1018 | nl80211_key_default_policy, | 1022 | nl80211_key_default_policy, |
| 1019 | info->extack); | 1023 | info->extack); |
| 1020 | if (err) | 1024 | if (err) |
| 1021 | return err; | 1025 | return err; |
| 1022 | 1026 | ||
| @@ -2317,8 +2321,10 @@ static int nl80211_dump_wiphy_parse(struct sk_buff *skb, | |||
| 2317 | struct nl80211_dump_wiphy_state *state) | 2321 | struct nl80211_dump_wiphy_state *state) |
| 2318 | { | 2322 | { |
| 2319 | struct nlattr **tb = genl_family_attrbuf(&nl80211_fam); | 2323 | struct nlattr **tb = genl_family_attrbuf(&nl80211_fam); |
| 2320 | int ret = nlmsg_parse(cb->nlh, GENL_HDRLEN + nl80211_fam.hdrsize, tb, | 2324 | int ret = nlmsg_parse_deprecated(cb->nlh, |
| 2321 | nl80211_fam.maxattr, nl80211_policy, NULL); | 2325 | GENL_HDRLEN + nl80211_fam.hdrsize, |
| 2326 | tb, nl80211_fam.maxattr, | ||
| 2327 | nl80211_policy, NULL); | ||
| 2322 | /* ignore parse errors for backward compatibility */ | 2328 | /* ignore parse errors for backward compatibility */ |
| 2323 | if (ret) | 2329 | if (ret) |
| 2324 | return 0; | 2330 | return 0; |
| @@ -2761,10 +2767,11 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info) | |||
| 2761 | nla_for_each_nested(nl_txq_params, | 2767 | nla_for_each_nested(nl_txq_params, |
| 2762 | info->attrs[NL80211_ATTR_WIPHY_TXQ_PARAMS], | 2768 | info->attrs[NL80211_ATTR_WIPHY_TXQ_PARAMS], |
| 2763 | rem_txq_params) { | 2769 | rem_txq_params) { |
| 2764 | result = nla_parse_nested(tb, NL80211_TXQ_ATTR_MAX, | 2770 | result = nla_parse_nested_deprecated(tb, |
| 2765 | nl_txq_params, | 2771 | NL80211_TXQ_ATTR_MAX, |
| 2766 | txq_params_policy, | 2772 | nl_txq_params, |
| 2767 | info->extack); | 2773 | txq_params_policy, |
| 2774 | info->extack); | ||
| 2768 | if (result) | 2775 | if (result) |
| 2769 | return result; | 2776 | return result; |
| 2770 | result = parse_txq_params(tb, &txq_params); | 2777 | result = parse_txq_params(tb, &txq_params); |
| @@ -3221,8 +3228,7 @@ static int parse_monitor_flags(struct nlattr *nla, u32 *mntrflags) | |||
| 3221 | if (!nla) | 3228 | if (!nla) |
| 3222 | return -EINVAL; | 3229 | return -EINVAL; |
| 3223 | 3230 | ||
| 3224 | if (nla_parse_nested(flags, NL80211_MNTR_FLAG_MAX, nla, | 3231 | if (nla_parse_nested_deprecated(flags, NL80211_MNTR_FLAG_MAX, nla, mntr_flags_policy, NULL)) |
| 3225 | mntr_flags_policy, NULL)) | ||
| 3226 | return -EINVAL; | 3232 | return -EINVAL; |
| 3227 | 3233 | ||
| 3228 | for (flag = 1; flag <= NL80211_MNTR_FLAG_MAX; flag++) | 3234 | for (flag = 1; flag <= NL80211_MNTR_FLAG_MAX; flag++) |
| @@ -4101,8 +4107,10 @@ static int nl80211_parse_tx_bitrate_mask(struct genl_info *info, | |||
| 4101 | sband = rdev->wiphy.bands[band]; | 4107 | sband = rdev->wiphy.bands[band]; |
| 4102 | if (sband == NULL) | 4108 | if (sband == NULL) |
| 4103 | return -EINVAL; | 4109 | return -EINVAL; |
| 4104 | err = nla_parse_nested(tb, NL80211_TXRATE_MAX, tx_rates, | 4110 | err = nla_parse_nested_deprecated(tb, NL80211_TXRATE_MAX, |
| 4105 | nl80211_txattr_policy, info->extack); | 4111 | tx_rates, |
| 4112 | nl80211_txattr_policy, | ||
| 4113 | info->extack); | ||
| 4106 | if (err) | 4114 | if (err) |
| 4107 | return err; | 4115 | return err; |
| 4108 | if (tb[NL80211_TXRATE_LEGACY]) { | 4116 | if (tb[NL80211_TXRATE_LEGACY]) { |
| @@ -4270,9 +4278,10 @@ static int nl80211_parse_beacon(struct cfg80211_registered_device *rdev, | |||
| 4270 | if (attrs[NL80211_ATTR_FTM_RESPONDER]) { | 4278 | if (attrs[NL80211_ATTR_FTM_RESPONDER]) { |
| 4271 | struct nlattr *tb[NL80211_FTM_RESP_ATTR_MAX + 1]; | 4279 | struct nlattr *tb[NL80211_FTM_RESP_ATTR_MAX + 1]; |
| 4272 | 4280 | ||
| 4273 | err = nla_parse_nested(tb, NL80211_FTM_RESP_ATTR_MAX, | 4281 | err = nla_parse_nested_deprecated(tb, |
| 4274 | attrs[NL80211_ATTR_FTM_RESPONDER], | 4282 | NL80211_FTM_RESP_ATTR_MAX, |
| 4275 | NULL, NULL); | 4283 | attrs[NL80211_ATTR_FTM_RESPONDER], |
| 4284 | NULL, NULL); | ||
| 4276 | if (err) | 4285 | if (err) |
| 4277 | return err; | 4286 | return err; |
| 4278 | 4287 | ||
| @@ -4680,8 +4689,7 @@ static int parse_station_flags(struct genl_info *info, | |||
| 4680 | if (!nla) | 4689 | if (!nla) |
| 4681 | return 0; | 4690 | return 0; |
| 4682 | 4691 | ||
| 4683 | if (nla_parse_nested(flags, NL80211_STA_FLAG_MAX, nla, | 4692 | if (nla_parse_nested_deprecated(flags, NL80211_STA_FLAG_MAX, nla, sta_flags_policy, info->extack)) |
| 4684 | sta_flags_policy, info->extack)) | ||
| 4685 | return -EINVAL; | 4693 | return -EINVAL; |
| 4686 | 4694 | ||
| 4687 | /* | 4695 | /* |
| @@ -5350,8 +5358,9 @@ static int nl80211_parse_sta_wme(struct genl_info *info, | |||
| 5350 | return 0; | 5358 | return 0; |
| 5351 | 5359 | ||
| 5352 | nla = info->attrs[NL80211_ATTR_STA_WME]; | 5360 | nla = info->attrs[NL80211_ATTR_STA_WME]; |
| 5353 | err = nla_parse_nested(tb, NL80211_STA_WME_MAX, nla, | 5361 | err = nla_parse_nested_deprecated(tb, NL80211_STA_WME_MAX, nla, |
| 5354 | nl80211_sta_wme_policy, info->extack); | 5362 | nl80211_sta_wme_policy, |
| 5363 | info->extack); | ||
| 5355 | if (err) | 5364 | if (err) |
| 5356 | return err; | 5365 | return err; |
| 5357 | 5366 | ||
| @@ -6491,9 +6500,7 @@ do { \ | |||
| 6491 | 6500 | ||
| 6492 | if (!info->attrs[NL80211_ATTR_MESH_CONFIG]) | 6501 | if (!info->attrs[NL80211_ATTR_MESH_CONFIG]) |
| 6493 | return -EINVAL; | 6502 | return -EINVAL; |
| 6494 | if (nla_parse_nested(tb, NL80211_MESHCONF_ATTR_MAX, | 6503 | if (nla_parse_nested_deprecated(tb, NL80211_MESHCONF_ATTR_MAX, info->attrs[NL80211_ATTR_MESH_CONFIG], nl80211_meshconf_params_policy, info->extack)) |
| 6495 | info->attrs[NL80211_ATTR_MESH_CONFIG], | ||
| 6496 | nl80211_meshconf_params_policy, info->extack)) | ||
| 6497 | return -EINVAL; | 6504 | return -EINVAL; |
| 6498 | 6505 | ||
| 6499 | /* This makes sure that there aren't more than 32 mesh config | 6506 | /* This makes sure that there aren't more than 32 mesh config |
| @@ -6626,9 +6633,7 @@ static int nl80211_parse_mesh_setup(struct genl_info *info, | |||
| 6626 | 6633 | ||
| 6627 | if (!info->attrs[NL80211_ATTR_MESH_SETUP]) | 6634 | if (!info->attrs[NL80211_ATTR_MESH_SETUP]) |
| 6628 | return -EINVAL; | 6635 | return -EINVAL; |
| 6629 | if (nla_parse_nested(tb, NL80211_MESH_SETUP_ATTR_MAX, | 6636 | if (nla_parse_nested_deprecated(tb, NL80211_MESH_SETUP_ATTR_MAX, info->attrs[NL80211_ATTR_MESH_SETUP], nl80211_mesh_setup_params_policy, info->extack)) |
| 6630 | info->attrs[NL80211_ATTR_MESH_SETUP], | ||
| 6631 | nl80211_mesh_setup_params_policy, info->extack)) | ||
| 6632 | return -EINVAL; | 6637 | return -EINVAL; |
| 6633 | 6638 | ||
| 6634 | if (tb[NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC]) | 6639 | if (tb[NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC]) |
| @@ -7012,9 +7017,9 @@ static int nl80211_set_reg(struct sk_buff *skb, struct genl_info *info) | |||
| 7012 | 7017 | ||
| 7013 | nla_for_each_nested(nl_reg_rule, info->attrs[NL80211_ATTR_REG_RULES], | 7018 | nla_for_each_nested(nl_reg_rule, info->attrs[NL80211_ATTR_REG_RULES], |
| 7014 | rem_reg_rules) { | 7019 | rem_reg_rules) { |
| 7015 | r = nla_parse_nested(tb, NL80211_REG_RULE_ATTR_MAX, | 7020 | r = nla_parse_nested_deprecated(tb, NL80211_REG_RULE_ATTR_MAX, |
| 7016 | nl_reg_rule, reg_rule_policy, | 7021 | nl_reg_rule, reg_rule_policy, |
| 7017 | info->extack); | 7022 | info->extack); |
| 7018 | if (r) | 7023 | if (r) |
| 7019 | goto bad_reg; | 7024 | goto bad_reg; |
| 7020 | r = parse_reg_rule(tb, &rd->reg_rules[rule_idx]); | 7025 | r = parse_reg_rule(tb, &rd->reg_rules[rule_idx]); |
| @@ -7085,8 +7090,9 @@ static int parse_bss_select(struct nlattr *nla, struct wiphy *wiphy, | |||
| 7085 | if (!nla_ok(nest, nla_len(nest))) | 7090 | if (!nla_ok(nest, nla_len(nest))) |
| 7086 | return -EINVAL; | 7091 | return -EINVAL; |
| 7087 | 7092 | ||
| 7088 | err = nla_parse_nested(attr, NL80211_BSS_SELECT_ATTR_MAX, nest, | 7093 | err = nla_parse_nested_deprecated(attr, NL80211_BSS_SELECT_ATTR_MAX, |
| 7089 | nl80211_bss_select_policy, NULL); | 7094 | nest, nl80211_bss_select_policy, |
| 7095 | NULL); | ||
| 7090 | if (err) | 7096 | if (err) |
| 7091 | return err; | 7097 | return err; |
| 7092 | 7098 | ||
| @@ -7579,8 +7585,10 @@ nl80211_parse_sched_scan_plans(struct wiphy *wiphy, int n_plans, | |||
| 7579 | if (WARN_ON(i >= n_plans)) | 7585 | if (WARN_ON(i >= n_plans)) |
| 7580 | return -EINVAL; | 7586 | return -EINVAL; |
| 7581 | 7587 | ||
| 7582 | err = nla_parse_nested(plan, NL80211_SCHED_SCAN_PLAN_MAX, | 7588 | err = nla_parse_nested_deprecated(plan, |
| 7583 | attr, nl80211_plan_policy, NULL); | 7589 | NL80211_SCHED_SCAN_PLAN_MAX, |
| 7590 | attr, nl80211_plan_policy, | ||
| 7591 | NULL); | ||
| 7584 | if (err) | 7592 | if (err) |
| 7585 | return err; | 7593 | return err; |
| 7586 | 7594 | ||
| @@ -7701,10 +7709,11 @@ nl80211_parse_sched_scan(struct wiphy *wiphy, struct wireless_dev *wdev, | |||
| 7701 | tmp) { | 7709 | tmp) { |
| 7702 | struct nlattr *rssi; | 7710 | struct nlattr *rssi; |
| 7703 | 7711 | ||
| 7704 | err = nla_parse_nested(tb, | 7712 | err = nla_parse_nested_deprecated(tb, |
| 7705 | NL80211_SCHED_SCAN_MATCH_ATTR_MAX, | 7713 | NL80211_SCHED_SCAN_MATCH_ATTR_MAX, |
| 7706 | attr, nl80211_match_policy, | 7714 | attr, |
| 7707 | NULL); | 7715 | nl80211_match_policy, |
| 7716 | NULL); | ||
| 7708 | if (err) | 7717 | if (err) |
| 7709 | return ERR_PTR(err); | 7718 | return ERR_PTR(err); |
| 7710 | 7719 | ||
| @@ -7888,10 +7897,11 @@ nl80211_parse_sched_scan(struct wiphy *wiphy, struct wireless_dev *wdev, | |||
| 7888 | tmp) { | 7897 | tmp) { |
| 7889 | struct nlattr *ssid, *bssid, *rssi; | 7898 | struct nlattr *ssid, *bssid, *rssi; |
| 7890 | 7899 | ||
| 7891 | err = nla_parse_nested(tb, | 7900 | err = nla_parse_nested_deprecated(tb, |
| 7892 | NL80211_SCHED_SCAN_MATCH_ATTR_MAX, | 7901 | NL80211_SCHED_SCAN_MATCH_ATTR_MAX, |
| 7893 | attr, nl80211_match_policy, | 7902 | attr, |
| 7894 | NULL); | 7903 | nl80211_match_policy, |
| 7904 | NULL); | ||
| 7895 | if (err) | 7905 | if (err) |
| 7896 | goto out_free; | 7906 | goto out_free; |
| 7897 | ssid = tb[NL80211_SCHED_SCAN_MATCH_ATTR_SSID]; | 7907 | ssid = tb[NL80211_SCHED_SCAN_MATCH_ATTR_SSID]; |
| @@ -8275,9 +8285,9 @@ static int nl80211_channel_switch(struct sk_buff *skb, struct genl_info *info) | |||
| 8275 | if (err) | 8285 | if (err) |
| 8276 | return err; | 8286 | return err; |
| 8277 | 8287 | ||
| 8278 | err = nla_parse_nested(csa_attrs, NL80211_ATTR_MAX, | 8288 | err = nla_parse_nested_deprecated(csa_attrs, NL80211_ATTR_MAX, |
| 8279 | info->attrs[NL80211_ATTR_CSA_IES], | 8289 | info->attrs[NL80211_ATTR_CSA_IES], |
| 8280 | nl80211_policy, info->extack); | 8290 | nl80211_policy, info->extack); |
| 8281 | if (err) | 8291 | if (err) |
| 8282 | return err; | 8292 | return err; |
| 8283 | 8293 | ||
| @@ -9552,9 +9562,10 @@ static int nl80211_testmode_dump(struct sk_buff *skb, | |||
| 9552 | } else { | 9562 | } else { |
| 9553 | struct nlattr **attrbuf = genl_family_attrbuf(&nl80211_fam); | 9563 | struct nlattr **attrbuf = genl_family_attrbuf(&nl80211_fam); |
| 9554 | 9564 | ||
| 9555 | err = nlmsg_parse(cb->nlh, GENL_HDRLEN + nl80211_fam.hdrsize, | 9565 | err = nlmsg_parse_deprecated(cb->nlh, |
| 9556 | attrbuf, nl80211_fam.maxattr, | 9566 | GENL_HDRLEN + nl80211_fam.hdrsize, |
| 9557 | nl80211_policy, NULL); | 9567 | attrbuf, nl80211_fam.maxattr, |
| 9568 | nl80211_policy, NULL); | ||
| 9558 | if (err) | 9569 | if (err) |
| 9559 | goto out_err; | 9570 | goto out_err; |
| 9560 | 9571 | ||
| @@ -10678,8 +10689,9 @@ static int nl80211_set_cqm(struct sk_buff *skb, struct genl_info *info) | |||
| 10678 | if (!cqm) | 10689 | if (!cqm) |
| 10679 | return -EINVAL; | 10690 | return -EINVAL; |
| 10680 | 10691 | ||
| 10681 | err = nla_parse_nested(attrs, NL80211_ATTR_CQM_MAX, cqm, | 10692 | err = nla_parse_nested_deprecated(attrs, NL80211_ATTR_CQM_MAX, cqm, |
| 10682 | nl80211_attr_cqm_policy, info->extack); | 10693 | nl80211_attr_cqm_policy, |
| 10694 | info->extack); | ||
| 10683 | if (err) | 10695 | if (err) |
| 10684 | return err; | 10696 | return err; |
| 10685 | 10697 | ||
| @@ -11117,8 +11129,8 @@ static int nl80211_parse_wowlan_tcp(struct cfg80211_registered_device *rdev, | |||
| 11117 | if (!rdev->wiphy.wowlan->tcp) | 11129 | if (!rdev->wiphy.wowlan->tcp) |
| 11118 | return -EINVAL; | 11130 | return -EINVAL; |
| 11119 | 11131 | ||
| 11120 | err = nla_parse_nested(tb, MAX_NL80211_WOWLAN_TCP, attr, | 11132 | err = nla_parse_nested_deprecated(tb, MAX_NL80211_WOWLAN_TCP, attr, |
| 11121 | nl80211_wowlan_tcp_policy, NULL); | 11133 | nl80211_wowlan_tcp_policy, NULL); |
| 11122 | if (err) | 11134 | if (err) |
| 11123 | return err; | 11135 | return err; |
| 11124 | 11136 | ||
| @@ -11263,8 +11275,8 @@ static int nl80211_parse_wowlan_nd(struct cfg80211_registered_device *rdev, | |||
| 11263 | goto out; | 11275 | goto out; |
| 11264 | } | 11276 | } |
| 11265 | 11277 | ||
| 11266 | err = nla_parse_nested(tb, NL80211_ATTR_MAX, attr, nl80211_policy, | 11278 | err = nla_parse_nested_deprecated(tb, NL80211_ATTR_MAX, attr, |
| 11267 | NULL); | 11279 | nl80211_policy, NULL); |
| 11268 | if (err) | 11280 | if (err) |
| 11269 | goto out; | 11281 | goto out; |
| 11270 | 11282 | ||
| @@ -11299,9 +11311,9 @@ static int nl80211_set_wowlan(struct sk_buff *skb, struct genl_info *info) | |||
| 11299 | goto set_wakeup; | 11311 | goto set_wakeup; |
| 11300 | } | 11312 | } |
| 11301 | 11313 | ||
| 11302 | err = nla_parse_nested(tb, MAX_NL80211_WOWLAN_TRIG, | 11314 | err = nla_parse_nested_deprecated(tb, MAX_NL80211_WOWLAN_TRIG, |
| 11303 | info->attrs[NL80211_ATTR_WOWLAN_TRIGGERS], | 11315 | info->attrs[NL80211_ATTR_WOWLAN_TRIGGERS], |
| 11304 | nl80211_wowlan_policy, info->extack); | 11316 | nl80211_wowlan_policy, info->extack); |
| 11305 | if (err) | 11317 | if (err) |
| 11306 | return err; | 11318 | return err; |
| 11307 | 11319 | ||
| @@ -11383,9 +11395,11 @@ static int nl80211_set_wowlan(struct sk_buff *skb, struct genl_info *info) | |||
| 11383 | rem) { | 11395 | rem) { |
| 11384 | u8 *mask_pat; | 11396 | u8 *mask_pat; |
| 11385 | 11397 | ||
| 11386 | err = nla_parse_nested(pat_tb, MAX_NL80211_PKTPAT, pat, | 11398 | err = nla_parse_nested_deprecated(pat_tb, |
| 11387 | nl80211_packet_pattern_policy, | 11399 | MAX_NL80211_PKTPAT, |
| 11388 | info->extack); | 11400 | pat, |
| 11401 | nl80211_packet_pattern_policy, | ||
| 11402 | info->extack); | ||
| 11389 | if (err) | 11403 | if (err) |
| 11390 | goto error; | 11404 | goto error; |
| 11391 | 11405 | ||
| @@ -11598,8 +11612,8 @@ static int nl80211_parse_coalesce_rule(struct cfg80211_registered_device *rdev, | |||
| 11598 | int rem, pat_len, mask_len, pkt_offset, n_patterns = 0; | 11612 | int rem, pat_len, mask_len, pkt_offset, n_patterns = 0; |
| 11599 | struct nlattr *pat_tb[NUM_NL80211_PKTPAT]; | 11613 | struct nlattr *pat_tb[NUM_NL80211_PKTPAT]; |
| 11600 | 11614 | ||
| 11601 | err = nla_parse_nested(tb, NL80211_ATTR_COALESCE_RULE_MAX, rule, | 11615 | err = nla_parse_nested_deprecated(tb, NL80211_ATTR_COALESCE_RULE_MAX, |
| 11602 | nl80211_coalesce_policy, NULL); | 11616 | rule, nl80211_coalesce_policy, NULL); |
| 11603 | if (err) | 11617 | if (err) |
| 11604 | return err; | 11618 | return err; |
| 11605 | 11619 | ||
| @@ -11634,8 +11648,10 @@ static int nl80211_parse_coalesce_rule(struct cfg80211_registered_device *rdev, | |||
| 11634 | rem) { | 11648 | rem) { |
| 11635 | u8 *mask_pat; | 11649 | u8 *mask_pat; |
| 11636 | 11650 | ||
| 11637 | err = nla_parse_nested(pat_tb, MAX_NL80211_PKTPAT, pat, | 11651 | err = nla_parse_nested_deprecated(pat_tb, MAX_NL80211_PKTPAT, |
| 11638 | nl80211_packet_pattern_policy, NULL); | 11652 | pat, |
| 11653 | nl80211_packet_pattern_policy, | ||
| 11654 | NULL); | ||
| 11639 | if (err) | 11655 | if (err) |
| 11640 | return err; | 11656 | return err; |
| 11641 | 11657 | ||
| @@ -11757,9 +11773,9 @@ static int nl80211_set_rekey_data(struct sk_buff *skb, struct genl_info *info) | |||
| 11757 | if (!info->attrs[NL80211_ATTR_REKEY_DATA]) | 11773 | if (!info->attrs[NL80211_ATTR_REKEY_DATA]) |
| 11758 | return -EINVAL; | 11774 | return -EINVAL; |
| 11759 | 11775 | ||
| 11760 | err = nla_parse_nested(tb, MAX_NL80211_REKEY_DATA, | 11776 | err = nla_parse_nested_deprecated(tb, MAX_NL80211_REKEY_DATA, |
| 11761 | info->attrs[NL80211_ATTR_REKEY_DATA], | 11777 | info->attrs[NL80211_ATTR_REKEY_DATA], |
| 11762 | nl80211_rekey_policy, info->extack); | 11778 | nl80211_rekey_policy, info->extack); |
| 11763 | if (err) | 11779 | if (err) |
| 11764 | return err; | 11780 | return err; |
| 11765 | 11781 | ||
| @@ -12071,9 +12087,10 @@ static int nl80211_nan_add_func(struct sk_buff *skb, | |||
| 12071 | if (!info->attrs[NL80211_ATTR_NAN_FUNC]) | 12087 | if (!info->attrs[NL80211_ATTR_NAN_FUNC]) |
| 12072 | return -EINVAL; | 12088 | return -EINVAL; |
| 12073 | 12089 | ||
| 12074 | err = nla_parse_nested(tb, NL80211_NAN_FUNC_ATTR_MAX, | 12090 | err = nla_parse_nested_deprecated(tb, NL80211_NAN_FUNC_ATTR_MAX, |
| 12075 | info->attrs[NL80211_ATTR_NAN_FUNC], | 12091 | info->attrs[NL80211_ATTR_NAN_FUNC], |
| 12076 | nl80211_nan_func_policy, info->extack); | 12092 | nl80211_nan_func_policy, |
| 12093 | info->extack); | ||
| 12077 | if (err) | 12094 | if (err) |
| 12078 | return err; | 12095 | return err; |
| 12079 | 12096 | ||
| @@ -12169,9 +12186,11 @@ static int nl80211_nan_add_func(struct sk_buff *skb, | |||
| 12169 | if (tb[NL80211_NAN_FUNC_SRF]) { | 12186 | if (tb[NL80211_NAN_FUNC_SRF]) { |
| 12170 | struct nlattr *srf_tb[NUM_NL80211_NAN_SRF_ATTR]; | 12187 | struct nlattr *srf_tb[NUM_NL80211_NAN_SRF_ATTR]; |
| 12171 | 12188 | ||
| 12172 | err = nla_parse_nested(srf_tb, NL80211_NAN_SRF_ATTR_MAX, | 12189 | err = nla_parse_nested_deprecated(srf_tb, |
| 12173 | tb[NL80211_NAN_FUNC_SRF], | 12190 | NL80211_NAN_SRF_ATTR_MAX, |
| 12174 | nl80211_nan_srf_policy, info->extack); | 12191 | tb[NL80211_NAN_FUNC_SRF], |
| 12192 | nl80211_nan_srf_policy, | ||
| 12193 | info->extack); | ||
| 12175 | if (err) | 12194 | if (err) |
| 12176 | goto out; | 12195 | goto out; |
| 12177 | 12196 | ||
| @@ -12704,8 +12723,10 @@ static int nl80211_prepare_vendor_dump(struct sk_buff *skb, | |||
| 12704 | return 0; | 12723 | return 0; |
| 12705 | } | 12724 | } |
| 12706 | 12725 | ||
| 12707 | err = nlmsg_parse(cb->nlh, GENL_HDRLEN + nl80211_fam.hdrsize, attrbuf, | 12726 | err = nlmsg_parse_deprecated(cb->nlh, |
| 12708 | nl80211_fam.maxattr, nl80211_policy, NULL); | 12727 | GENL_HDRLEN + nl80211_fam.hdrsize, |
| 12728 | attrbuf, nl80211_fam.maxattr, | ||
| 12729 | nl80211_policy, NULL); | ||
| 12709 | if (err) | 12730 | if (err) |
| 12710 | return err; | 12731 | return err; |
| 12711 | 12732 | ||
| @@ -13570,6 +13591,7 @@ static void nl80211_post_doit(const struct genl_ops *ops, struct sk_buff *skb, | |||
| 13570 | static const struct genl_ops nl80211_ops[] = { | 13591 | static const struct genl_ops nl80211_ops[] = { |
| 13571 | { | 13592 | { |
| 13572 | .cmd = NL80211_CMD_GET_WIPHY, | 13593 | .cmd = NL80211_CMD_GET_WIPHY, |
| 13594 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13573 | .doit = nl80211_get_wiphy, | 13595 | .doit = nl80211_get_wiphy, |
| 13574 | .dumpit = nl80211_dump_wiphy, | 13596 | .dumpit = nl80211_dump_wiphy, |
| 13575 | .done = nl80211_dump_wiphy_done, | 13597 | .done = nl80211_dump_wiphy_done, |
| @@ -13579,12 +13601,14 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13579 | }, | 13601 | }, |
| 13580 | { | 13602 | { |
| 13581 | .cmd = NL80211_CMD_SET_WIPHY, | 13603 | .cmd = NL80211_CMD_SET_WIPHY, |
| 13604 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13582 | .doit = nl80211_set_wiphy, | 13605 | .doit = nl80211_set_wiphy, |
| 13583 | .flags = GENL_UNS_ADMIN_PERM, | 13606 | .flags = GENL_UNS_ADMIN_PERM, |
| 13584 | .internal_flags = NL80211_FLAG_NEED_RTNL, | 13607 | .internal_flags = NL80211_FLAG_NEED_RTNL, |
| 13585 | }, | 13608 | }, |
| 13586 | { | 13609 | { |
| 13587 | .cmd = NL80211_CMD_GET_INTERFACE, | 13610 | .cmd = NL80211_CMD_GET_INTERFACE, |
| 13611 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13588 | .doit = nl80211_get_interface, | 13612 | .doit = nl80211_get_interface, |
| 13589 | .dumpit = nl80211_dump_interface, | 13613 | .dumpit = nl80211_dump_interface, |
| 13590 | /* can be retrieved by unprivileged users */ | 13614 | /* can be retrieved by unprivileged users */ |
| @@ -13593,6 +13617,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13593 | }, | 13617 | }, |
| 13594 | { | 13618 | { |
| 13595 | .cmd = NL80211_CMD_SET_INTERFACE, | 13619 | .cmd = NL80211_CMD_SET_INTERFACE, |
| 13620 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13596 | .doit = nl80211_set_interface, | 13621 | .doit = nl80211_set_interface, |
| 13597 | .flags = GENL_UNS_ADMIN_PERM, | 13622 | .flags = GENL_UNS_ADMIN_PERM, |
| 13598 | .internal_flags = NL80211_FLAG_NEED_NETDEV | | 13623 | .internal_flags = NL80211_FLAG_NEED_NETDEV | |
| @@ -13600,6 +13625,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13600 | }, | 13625 | }, |
| 13601 | { | 13626 | { |
| 13602 | .cmd = NL80211_CMD_NEW_INTERFACE, | 13627 | .cmd = NL80211_CMD_NEW_INTERFACE, |
| 13628 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13603 | .doit = nl80211_new_interface, | 13629 | .doit = nl80211_new_interface, |
| 13604 | .flags = GENL_UNS_ADMIN_PERM, | 13630 | .flags = GENL_UNS_ADMIN_PERM, |
| 13605 | .internal_flags = NL80211_FLAG_NEED_WIPHY | | 13631 | .internal_flags = NL80211_FLAG_NEED_WIPHY | |
| @@ -13607,6 +13633,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13607 | }, | 13633 | }, |
| 13608 | { | 13634 | { |
| 13609 | .cmd = NL80211_CMD_DEL_INTERFACE, | 13635 | .cmd = NL80211_CMD_DEL_INTERFACE, |
| 13636 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13610 | .doit = nl80211_del_interface, | 13637 | .doit = nl80211_del_interface, |
| 13611 | .flags = GENL_UNS_ADMIN_PERM, | 13638 | .flags = GENL_UNS_ADMIN_PERM, |
| 13612 | .internal_flags = NL80211_FLAG_NEED_WDEV | | 13639 | .internal_flags = NL80211_FLAG_NEED_WDEV | |
| @@ -13614,6 +13641,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13614 | }, | 13641 | }, |
| 13615 | { | 13642 | { |
| 13616 | .cmd = NL80211_CMD_GET_KEY, | 13643 | .cmd = NL80211_CMD_GET_KEY, |
| 13644 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13617 | .doit = nl80211_get_key, | 13645 | .doit = nl80211_get_key, |
| 13618 | .flags = GENL_UNS_ADMIN_PERM, | 13646 | .flags = GENL_UNS_ADMIN_PERM, |
| 13619 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 13647 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -13621,6 +13649,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13621 | }, | 13649 | }, |
| 13622 | { | 13650 | { |
| 13623 | .cmd = NL80211_CMD_SET_KEY, | 13651 | .cmd = NL80211_CMD_SET_KEY, |
| 13652 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13624 | .doit = nl80211_set_key, | 13653 | .doit = nl80211_set_key, |
| 13625 | .flags = GENL_UNS_ADMIN_PERM, | 13654 | .flags = GENL_UNS_ADMIN_PERM, |
| 13626 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 13655 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -13629,6 +13658,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13629 | }, | 13658 | }, |
| 13630 | { | 13659 | { |
| 13631 | .cmd = NL80211_CMD_NEW_KEY, | 13660 | .cmd = NL80211_CMD_NEW_KEY, |
| 13661 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13632 | .doit = nl80211_new_key, | 13662 | .doit = nl80211_new_key, |
| 13633 | .flags = GENL_UNS_ADMIN_PERM, | 13663 | .flags = GENL_UNS_ADMIN_PERM, |
| 13634 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 13664 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -13637,6 +13667,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13637 | }, | 13667 | }, |
| 13638 | { | 13668 | { |
| 13639 | .cmd = NL80211_CMD_DEL_KEY, | 13669 | .cmd = NL80211_CMD_DEL_KEY, |
| 13670 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13640 | .doit = nl80211_del_key, | 13671 | .doit = nl80211_del_key, |
| 13641 | .flags = GENL_UNS_ADMIN_PERM, | 13672 | .flags = GENL_UNS_ADMIN_PERM, |
| 13642 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 13673 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -13644,6 +13675,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13644 | }, | 13675 | }, |
| 13645 | { | 13676 | { |
| 13646 | .cmd = NL80211_CMD_SET_BEACON, | 13677 | .cmd = NL80211_CMD_SET_BEACON, |
| 13678 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13647 | .flags = GENL_UNS_ADMIN_PERM, | 13679 | .flags = GENL_UNS_ADMIN_PERM, |
| 13648 | .doit = nl80211_set_beacon, | 13680 | .doit = nl80211_set_beacon, |
| 13649 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 13681 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -13651,6 +13683,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13651 | }, | 13683 | }, |
| 13652 | { | 13684 | { |
| 13653 | .cmd = NL80211_CMD_START_AP, | 13685 | .cmd = NL80211_CMD_START_AP, |
| 13686 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13654 | .flags = GENL_UNS_ADMIN_PERM, | 13687 | .flags = GENL_UNS_ADMIN_PERM, |
| 13655 | .doit = nl80211_start_ap, | 13688 | .doit = nl80211_start_ap, |
| 13656 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 13689 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -13658,6 +13691,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13658 | }, | 13691 | }, |
| 13659 | { | 13692 | { |
| 13660 | .cmd = NL80211_CMD_STOP_AP, | 13693 | .cmd = NL80211_CMD_STOP_AP, |
| 13694 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13661 | .flags = GENL_UNS_ADMIN_PERM, | 13695 | .flags = GENL_UNS_ADMIN_PERM, |
| 13662 | .doit = nl80211_stop_ap, | 13696 | .doit = nl80211_stop_ap, |
| 13663 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 13697 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -13665,6 +13699,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13665 | }, | 13699 | }, |
| 13666 | { | 13700 | { |
| 13667 | .cmd = NL80211_CMD_GET_STATION, | 13701 | .cmd = NL80211_CMD_GET_STATION, |
| 13702 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13668 | .doit = nl80211_get_station, | 13703 | .doit = nl80211_get_station, |
| 13669 | .dumpit = nl80211_dump_station, | 13704 | .dumpit = nl80211_dump_station, |
| 13670 | .internal_flags = NL80211_FLAG_NEED_NETDEV | | 13705 | .internal_flags = NL80211_FLAG_NEED_NETDEV | |
| @@ -13672,6 +13707,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13672 | }, | 13707 | }, |
| 13673 | { | 13708 | { |
| 13674 | .cmd = NL80211_CMD_SET_STATION, | 13709 | .cmd = NL80211_CMD_SET_STATION, |
| 13710 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13675 | .doit = nl80211_set_station, | 13711 | .doit = nl80211_set_station, |
| 13676 | .flags = GENL_UNS_ADMIN_PERM, | 13712 | .flags = GENL_UNS_ADMIN_PERM, |
| 13677 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 13713 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -13679,6 +13715,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13679 | }, | 13715 | }, |
| 13680 | { | 13716 | { |
| 13681 | .cmd = NL80211_CMD_NEW_STATION, | 13717 | .cmd = NL80211_CMD_NEW_STATION, |
| 13718 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13682 | .doit = nl80211_new_station, | 13719 | .doit = nl80211_new_station, |
| 13683 | .flags = GENL_UNS_ADMIN_PERM, | 13720 | .flags = GENL_UNS_ADMIN_PERM, |
| 13684 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 13721 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -13686,6 +13723,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13686 | }, | 13723 | }, |
| 13687 | { | 13724 | { |
| 13688 | .cmd = NL80211_CMD_DEL_STATION, | 13725 | .cmd = NL80211_CMD_DEL_STATION, |
| 13726 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13689 | .doit = nl80211_del_station, | 13727 | .doit = nl80211_del_station, |
| 13690 | .flags = GENL_UNS_ADMIN_PERM, | 13728 | .flags = GENL_UNS_ADMIN_PERM, |
| 13691 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 13729 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -13693,6 +13731,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13693 | }, | 13731 | }, |
| 13694 | { | 13732 | { |
| 13695 | .cmd = NL80211_CMD_GET_MPATH, | 13733 | .cmd = NL80211_CMD_GET_MPATH, |
| 13734 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13696 | .doit = nl80211_get_mpath, | 13735 | .doit = nl80211_get_mpath, |
| 13697 | .dumpit = nl80211_dump_mpath, | 13736 | .dumpit = nl80211_dump_mpath, |
| 13698 | .flags = GENL_UNS_ADMIN_PERM, | 13737 | .flags = GENL_UNS_ADMIN_PERM, |
| @@ -13701,6 +13740,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13701 | }, | 13740 | }, |
| 13702 | { | 13741 | { |
| 13703 | .cmd = NL80211_CMD_GET_MPP, | 13742 | .cmd = NL80211_CMD_GET_MPP, |
| 13743 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13704 | .doit = nl80211_get_mpp, | 13744 | .doit = nl80211_get_mpp, |
| 13705 | .dumpit = nl80211_dump_mpp, | 13745 | .dumpit = nl80211_dump_mpp, |
| 13706 | .flags = GENL_UNS_ADMIN_PERM, | 13746 | .flags = GENL_UNS_ADMIN_PERM, |
| @@ -13709,6 +13749,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13709 | }, | 13749 | }, |
| 13710 | { | 13750 | { |
| 13711 | .cmd = NL80211_CMD_SET_MPATH, | 13751 | .cmd = NL80211_CMD_SET_MPATH, |
| 13752 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13712 | .doit = nl80211_set_mpath, | 13753 | .doit = nl80211_set_mpath, |
| 13713 | .flags = GENL_UNS_ADMIN_PERM, | 13754 | .flags = GENL_UNS_ADMIN_PERM, |
| 13714 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 13755 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -13716,6 +13757,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13716 | }, | 13757 | }, |
| 13717 | { | 13758 | { |
| 13718 | .cmd = NL80211_CMD_NEW_MPATH, | 13759 | .cmd = NL80211_CMD_NEW_MPATH, |
| 13760 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13719 | .doit = nl80211_new_mpath, | 13761 | .doit = nl80211_new_mpath, |
| 13720 | .flags = GENL_UNS_ADMIN_PERM, | 13762 | .flags = GENL_UNS_ADMIN_PERM, |
| 13721 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 13763 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -13723,6 +13765,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13723 | }, | 13765 | }, |
| 13724 | { | 13766 | { |
| 13725 | .cmd = NL80211_CMD_DEL_MPATH, | 13767 | .cmd = NL80211_CMD_DEL_MPATH, |
| 13768 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13726 | .doit = nl80211_del_mpath, | 13769 | .doit = nl80211_del_mpath, |
| 13727 | .flags = GENL_UNS_ADMIN_PERM, | 13770 | .flags = GENL_UNS_ADMIN_PERM, |
| 13728 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 13771 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -13730,6 +13773,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13730 | }, | 13773 | }, |
| 13731 | { | 13774 | { |
| 13732 | .cmd = NL80211_CMD_SET_BSS, | 13775 | .cmd = NL80211_CMD_SET_BSS, |
| 13776 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13733 | .doit = nl80211_set_bss, | 13777 | .doit = nl80211_set_bss, |
| 13734 | .flags = GENL_UNS_ADMIN_PERM, | 13778 | .flags = GENL_UNS_ADMIN_PERM, |
| 13735 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 13779 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -13737,6 +13781,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13737 | }, | 13781 | }, |
| 13738 | { | 13782 | { |
| 13739 | .cmd = NL80211_CMD_GET_REG, | 13783 | .cmd = NL80211_CMD_GET_REG, |
| 13784 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13740 | .doit = nl80211_get_reg_do, | 13785 | .doit = nl80211_get_reg_do, |
| 13741 | .dumpit = nl80211_get_reg_dump, | 13786 | .dumpit = nl80211_get_reg_dump, |
| 13742 | .internal_flags = NL80211_FLAG_NEED_RTNL, | 13787 | .internal_flags = NL80211_FLAG_NEED_RTNL, |
| @@ -13745,6 +13790,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13745 | #ifdef CONFIG_CFG80211_CRDA_SUPPORT | 13790 | #ifdef CONFIG_CFG80211_CRDA_SUPPORT |
| 13746 | { | 13791 | { |
| 13747 | .cmd = NL80211_CMD_SET_REG, | 13792 | .cmd = NL80211_CMD_SET_REG, |
| 13793 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13748 | .doit = nl80211_set_reg, | 13794 | .doit = nl80211_set_reg, |
| 13749 | .flags = GENL_ADMIN_PERM, | 13795 | .flags = GENL_ADMIN_PERM, |
| 13750 | .internal_flags = NL80211_FLAG_NEED_RTNL, | 13796 | .internal_flags = NL80211_FLAG_NEED_RTNL, |
| @@ -13752,16 +13798,19 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13752 | #endif | 13798 | #endif |
| 13753 | { | 13799 | { |
| 13754 | .cmd = NL80211_CMD_REQ_SET_REG, | 13800 | .cmd = NL80211_CMD_REQ_SET_REG, |
| 13801 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13755 | .doit = nl80211_req_set_reg, | 13802 | .doit = nl80211_req_set_reg, |
| 13756 | .flags = GENL_ADMIN_PERM, | 13803 | .flags = GENL_ADMIN_PERM, |
| 13757 | }, | 13804 | }, |
| 13758 | { | 13805 | { |
| 13759 | .cmd = NL80211_CMD_RELOAD_REGDB, | 13806 | .cmd = NL80211_CMD_RELOAD_REGDB, |
| 13807 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13760 | .doit = nl80211_reload_regdb, | 13808 | .doit = nl80211_reload_regdb, |
| 13761 | .flags = GENL_ADMIN_PERM, | 13809 | .flags = GENL_ADMIN_PERM, |
| 13762 | }, | 13810 | }, |
| 13763 | { | 13811 | { |
| 13764 | .cmd = NL80211_CMD_GET_MESH_CONFIG, | 13812 | .cmd = NL80211_CMD_GET_MESH_CONFIG, |
| 13813 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13765 | .doit = nl80211_get_mesh_config, | 13814 | .doit = nl80211_get_mesh_config, |
| 13766 | /* can be retrieved by unprivileged users */ | 13815 | /* can be retrieved by unprivileged users */ |
| 13767 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 13816 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -13769,6 +13818,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13769 | }, | 13818 | }, |
| 13770 | { | 13819 | { |
| 13771 | .cmd = NL80211_CMD_SET_MESH_CONFIG, | 13820 | .cmd = NL80211_CMD_SET_MESH_CONFIG, |
| 13821 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13772 | .doit = nl80211_update_mesh_config, | 13822 | .doit = nl80211_update_mesh_config, |
| 13773 | .flags = GENL_UNS_ADMIN_PERM, | 13823 | .flags = GENL_UNS_ADMIN_PERM, |
| 13774 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 13824 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -13776,6 +13826,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13776 | }, | 13826 | }, |
| 13777 | { | 13827 | { |
| 13778 | .cmd = NL80211_CMD_TRIGGER_SCAN, | 13828 | .cmd = NL80211_CMD_TRIGGER_SCAN, |
| 13829 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13779 | .doit = nl80211_trigger_scan, | 13830 | .doit = nl80211_trigger_scan, |
| 13780 | .flags = GENL_UNS_ADMIN_PERM, | 13831 | .flags = GENL_UNS_ADMIN_PERM, |
| 13781 | .internal_flags = NL80211_FLAG_NEED_WDEV_UP | | 13832 | .internal_flags = NL80211_FLAG_NEED_WDEV_UP | |
| @@ -13783,6 +13834,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13783 | }, | 13834 | }, |
| 13784 | { | 13835 | { |
| 13785 | .cmd = NL80211_CMD_ABORT_SCAN, | 13836 | .cmd = NL80211_CMD_ABORT_SCAN, |
| 13837 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13786 | .doit = nl80211_abort_scan, | 13838 | .doit = nl80211_abort_scan, |
| 13787 | .flags = GENL_UNS_ADMIN_PERM, | 13839 | .flags = GENL_UNS_ADMIN_PERM, |
| 13788 | .internal_flags = NL80211_FLAG_NEED_WDEV_UP | | 13840 | .internal_flags = NL80211_FLAG_NEED_WDEV_UP | |
| @@ -13790,10 +13842,12 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13790 | }, | 13842 | }, |
| 13791 | { | 13843 | { |
| 13792 | .cmd = NL80211_CMD_GET_SCAN, | 13844 | .cmd = NL80211_CMD_GET_SCAN, |
| 13845 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13793 | .dumpit = nl80211_dump_scan, | 13846 | .dumpit = nl80211_dump_scan, |
| 13794 | }, | 13847 | }, |
| 13795 | { | 13848 | { |
| 13796 | .cmd = NL80211_CMD_START_SCHED_SCAN, | 13849 | .cmd = NL80211_CMD_START_SCHED_SCAN, |
| 13850 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13797 | .doit = nl80211_start_sched_scan, | 13851 | .doit = nl80211_start_sched_scan, |
| 13798 | .flags = GENL_UNS_ADMIN_PERM, | 13852 | .flags = GENL_UNS_ADMIN_PERM, |
| 13799 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 13853 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -13801,6 +13855,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13801 | }, | 13855 | }, |
| 13802 | { | 13856 | { |
| 13803 | .cmd = NL80211_CMD_STOP_SCHED_SCAN, | 13857 | .cmd = NL80211_CMD_STOP_SCHED_SCAN, |
| 13858 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13804 | .doit = nl80211_stop_sched_scan, | 13859 | .doit = nl80211_stop_sched_scan, |
| 13805 | .flags = GENL_UNS_ADMIN_PERM, | 13860 | .flags = GENL_UNS_ADMIN_PERM, |
| 13806 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 13861 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -13808,6 +13863,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13808 | }, | 13863 | }, |
| 13809 | { | 13864 | { |
| 13810 | .cmd = NL80211_CMD_AUTHENTICATE, | 13865 | .cmd = NL80211_CMD_AUTHENTICATE, |
| 13866 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13811 | .doit = nl80211_authenticate, | 13867 | .doit = nl80211_authenticate, |
| 13812 | .flags = GENL_UNS_ADMIN_PERM, | 13868 | .flags = GENL_UNS_ADMIN_PERM, |
| 13813 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 13869 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -13816,6 +13872,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13816 | }, | 13872 | }, |
| 13817 | { | 13873 | { |
| 13818 | .cmd = NL80211_CMD_ASSOCIATE, | 13874 | .cmd = NL80211_CMD_ASSOCIATE, |
| 13875 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13819 | .doit = nl80211_associate, | 13876 | .doit = nl80211_associate, |
| 13820 | .flags = GENL_UNS_ADMIN_PERM, | 13877 | .flags = GENL_UNS_ADMIN_PERM, |
| 13821 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 13878 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -13824,6 +13881,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13824 | }, | 13881 | }, |
| 13825 | { | 13882 | { |
| 13826 | .cmd = NL80211_CMD_DEAUTHENTICATE, | 13883 | .cmd = NL80211_CMD_DEAUTHENTICATE, |
| 13884 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13827 | .doit = nl80211_deauthenticate, | 13885 | .doit = nl80211_deauthenticate, |
| 13828 | .flags = GENL_UNS_ADMIN_PERM, | 13886 | .flags = GENL_UNS_ADMIN_PERM, |
| 13829 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 13887 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -13831,6 +13889,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13831 | }, | 13889 | }, |
| 13832 | { | 13890 | { |
| 13833 | .cmd = NL80211_CMD_DISASSOCIATE, | 13891 | .cmd = NL80211_CMD_DISASSOCIATE, |
| 13892 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13834 | .doit = nl80211_disassociate, | 13893 | .doit = nl80211_disassociate, |
| 13835 | .flags = GENL_UNS_ADMIN_PERM, | 13894 | .flags = GENL_UNS_ADMIN_PERM, |
| 13836 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 13895 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -13838,6 +13897,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13838 | }, | 13897 | }, |
| 13839 | { | 13898 | { |
| 13840 | .cmd = NL80211_CMD_JOIN_IBSS, | 13899 | .cmd = NL80211_CMD_JOIN_IBSS, |
| 13900 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13841 | .doit = nl80211_join_ibss, | 13901 | .doit = nl80211_join_ibss, |
| 13842 | .flags = GENL_UNS_ADMIN_PERM, | 13902 | .flags = GENL_UNS_ADMIN_PERM, |
| 13843 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 13903 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -13845,6 +13905,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13845 | }, | 13905 | }, |
| 13846 | { | 13906 | { |
| 13847 | .cmd = NL80211_CMD_LEAVE_IBSS, | 13907 | .cmd = NL80211_CMD_LEAVE_IBSS, |
| 13908 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13848 | .doit = nl80211_leave_ibss, | 13909 | .doit = nl80211_leave_ibss, |
| 13849 | .flags = GENL_UNS_ADMIN_PERM, | 13910 | .flags = GENL_UNS_ADMIN_PERM, |
| 13850 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 13911 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -13853,6 +13914,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13853 | #ifdef CONFIG_NL80211_TESTMODE | 13914 | #ifdef CONFIG_NL80211_TESTMODE |
| 13854 | { | 13915 | { |
| 13855 | .cmd = NL80211_CMD_TESTMODE, | 13916 | .cmd = NL80211_CMD_TESTMODE, |
| 13917 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13856 | .doit = nl80211_testmode_do, | 13918 | .doit = nl80211_testmode_do, |
| 13857 | .dumpit = nl80211_testmode_dump, | 13919 | .dumpit = nl80211_testmode_dump, |
| 13858 | .flags = GENL_UNS_ADMIN_PERM, | 13920 | .flags = GENL_UNS_ADMIN_PERM, |
| @@ -13862,6 +13924,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13862 | #endif | 13924 | #endif |
| 13863 | { | 13925 | { |
| 13864 | .cmd = NL80211_CMD_CONNECT, | 13926 | .cmd = NL80211_CMD_CONNECT, |
| 13927 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13865 | .doit = nl80211_connect, | 13928 | .doit = nl80211_connect, |
| 13866 | .flags = GENL_UNS_ADMIN_PERM, | 13929 | .flags = GENL_UNS_ADMIN_PERM, |
| 13867 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 13930 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -13870,6 +13933,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13870 | }, | 13933 | }, |
| 13871 | { | 13934 | { |
| 13872 | .cmd = NL80211_CMD_UPDATE_CONNECT_PARAMS, | 13935 | .cmd = NL80211_CMD_UPDATE_CONNECT_PARAMS, |
| 13936 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13873 | .doit = nl80211_update_connect_params, | 13937 | .doit = nl80211_update_connect_params, |
| 13874 | .flags = GENL_ADMIN_PERM, | 13938 | .flags = GENL_ADMIN_PERM, |
| 13875 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 13939 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -13878,6 +13942,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13878 | }, | 13942 | }, |
| 13879 | { | 13943 | { |
| 13880 | .cmd = NL80211_CMD_DISCONNECT, | 13944 | .cmd = NL80211_CMD_DISCONNECT, |
| 13945 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13881 | .doit = nl80211_disconnect, | 13946 | .doit = nl80211_disconnect, |
| 13882 | .flags = GENL_UNS_ADMIN_PERM, | 13947 | .flags = GENL_UNS_ADMIN_PERM, |
| 13883 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 13948 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -13885,6 +13950,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13885 | }, | 13950 | }, |
| 13886 | { | 13951 | { |
| 13887 | .cmd = NL80211_CMD_SET_WIPHY_NETNS, | 13952 | .cmd = NL80211_CMD_SET_WIPHY_NETNS, |
| 13953 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13888 | .doit = nl80211_wiphy_netns, | 13954 | .doit = nl80211_wiphy_netns, |
| 13889 | .flags = GENL_UNS_ADMIN_PERM, | 13955 | .flags = GENL_UNS_ADMIN_PERM, |
| 13890 | .internal_flags = NL80211_FLAG_NEED_WIPHY | | 13956 | .internal_flags = NL80211_FLAG_NEED_WIPHY | |
| @@ -13892,10 +13958,12 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13892 | }, | 13958 | }, |
| 13893 | { | 13959 | { |
| 13894 | .cmd = NL80211_CMD_GET_SURVEY, | 13960 | .cmd = NL80211_CMD_GET_SURVEY, |
| 13961 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13895 | .dumpit = nl80211_dump_survey, | 13962 | .dumpit = nl80211_dump_survey, |
| 13896 | }, | 13963 | }, |
| 13897 | { | 13964 | { |
| 13898 | .cmd = NL80211_CMD_SET_PMKSA, | 13965 | .cmd = NL80211_CMD_SET_PMKSA, |
| 13966 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13899 | .doit = nl80211_setdel_pmksa, | 13967 | .doit = nl80211_setdel_pmksa, |
| 13900 | .flags = GENL_UNS_ADMIN_PERM, | 13968 | .flags = GENL_UNS_ADMIN_PERM, |
| 13901 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 13969 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -13904,6 +13972,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13904 | }, | 13972 | }, |
| 13905 | { | 13973 | { |
| 13906 | .cmd = NL80211_CMD_DEL_PMKSA, | 13974 | .cmd = NL80211_CMD_DEL_PMKSA, |
| 13975 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13907 | .doit = nl80211_setdel_pmksa, | 13976 | .doit = nl80211_setdel_pmksa, |
| 13908 | .flags = GENL_UNS_ADMIN_PERM, | 13977 | .flags = GENL_UNS_ADMIN_PERM, |
| 13909 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 13978 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -13911,6 +13980,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13911 | }, | 13980 | }, |
| 13912 | { | 13981 | { |
| 13913 | .cmd = NL80211_CMD_FLUSH_PMKSA, | 13982 | .cmd = NL80211_CMD_FLUSH_PMKSA, |
| 13983 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13914 | .doit = nl80211_flush_pmksa, | 13984 | .doit = nl80211_flush_pmksa, |
| 13915 | .flags = GENL_UNS_ADMIN_PERM, | 13985 | .flags = GENL_UNS_ADMIN_PERM, |
| 13916 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 13986 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -13918,6 +13988,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13918 | }, | 13988 | }, |
| 13919 | { | 13989 | { |
| 13920 | .cmd = NL80211_CMD_REMAIN_ON_CHANNEL, | 13990 | .cmd = NL80211_CMD_REMAIN_ON_CHANNEL, |
| 13991 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13921 | .doit = nl80211_remain_on_channel, | 13992 | .doit = nl80211_remain_on_channel, |
| 13922 | .flags = GENL_UNS_ADMIN_PERM, | 13993 | .flags = GENL_UNS_ADMIN_PERM, |
| 13923 | .internal_flags = NL80211_FLAG_NEED_WDEV_UP | | 13994 | .internal_flags = NL80211_FLAG_NEED_WDEV_UP | |
| @@ -13925,6 +13996,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13925 | }, | 13996 | }, |
| 13926 | { | 13997 | { |
| 13927 | .cmd = NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL, | 13998 | .cmd = NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL, |
| 13999 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13928 | .doit = nl80211_cancel_remain_on_channel, | 14000 | .doit = nl80211_cancel_remain_on_channel, |
| 13929 | .flags = GENL_UNS_ADMIN_PERM, | 14001 | .flags = GENL_UNS_ADMIN_PERM, |
| 13930 | .internal_flags = NL80211_FLAG_NEED_WDEV_UP | | 14002 | .internal_flags = NL80211_FLAG_NEED_WDEV_UP | |
| @@ -13932,6 +14004,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13932 | }, | 14004 | }, |
| 13933 | { | 14005 | { |
| 13934 | .cmd = NL80211_CMD_SET_TX_BITRATE_MASK, | 14006 | .cmd = NL80211_CMD_SET_TX_BITRATE_MASK, |
| 14007 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13935 | .doit = nl80211_set_tx_bitrate_mask, | 14008 | .doit = nl80211_set_tx_bitrate_mask, |
| 13936 | .flags = GENL_UNS_ADMIN_PERM, | 14009 | .flags = GENL_UNS_ADMIN_PERM, |
| 13937 | .internal_flags = NL80211_FLAG_NEED_NETDEV | | 14010 | .internal_flags = NL80211_FLAG_NEED_NETDEV | |
| @@ -13939,6 +14012,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13939 | }, | 14012 | }, |
| 13940 | { | 14013 | { |
| 13941 | .cmd = NL80211_CMD_REGISTER_FRAME, | 14014 | .cmd = NL80211_CMD_REGISTER_FRAME, |
| 14015 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13942 | .doit = nl80211_register_mgmt, | 14016 | .doit = nl80211_register_mgmt, |
| 13943 | .flags = GENL_UNS_ADMIN_PERM, | 14017 | .flags = GENL_UNS_ADMIN_PERM, |
| 13944 | .internal_flags = NL80211_FLAG_NEED_WDEV | | 14018 | .internal_flags = NL80211_FLAG_NEED_WDEV | |
| @@ -13946,6 +14020,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13946 | }, | 14020 | }, |
| 13947 | { | 14021 | { |
| 13948 | .cmd = NL80211_CMD_FRAME, | 14022 | .cmd = NL80211_CMD_FRAME, |
| 14023 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13949 | .doit = nl80211_tx_mgmt, | 14024 | .doit = nl80211_tx_mgmt, |
| 13950 | .flags = GENL_UNS_ADMIN_PERM, | 14025 | .flags = GENL_UNS_ADMIN_PERM, |
| 13951 | .internal_flags = NL80211_FLAG_NEED_WDEV_UP | | 14026 | .internal_flags = NL80211_FLAG_NEED_WDEV_UP | |
| @@ -13953,6 +14028,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13953 | }, | 14028 | }, |
| 13954 | { | 14029 | { |
| 13955 | .cmd = NL80211_CMD_FRAME_WAIT_CANCEL, | 14030 | .cmd = NL80211_CMD_FRAME_WAIT_CANCEL, |
| 14031 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13956 | .doit = nl80211_tx_mgmt_cancel_wait, | 14032 | .doit = nl80211_tx_mgmt_cancel_wait, |
| 13957 | .flags = GENL_UNS_ADMIN_PERM, | 14033 | .flags = GENL_UNS_ADMIN_PERM, |
| 13958 | .internal_flags = NL80211_FLAG_NEED_WDEV_UP | | 14034 | .internal_flags = NL80211_FLAG_NEED_WDEV_UP | |
| @@ -13960,6 +14036,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13960 | }, | 14036 | }, |
| 13961 | { | 14037 | { |
| 13962 | .cmd = NL80211_CMD_SET_POWER_SAVE, | 14038 | .cmd = NL80211_CMD_SET_POWER_SAVE, |
| 14039 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13963 | .doit = nl80211_set_power_save, | 14040 | .doit = nl80211_set_power_save, |
| 13964 | .flags = GENL_UNS_ADMIN_PERM, | 14041 | .flags = GENL_UNS_ADMIN_PERM, |
| 13965 | .internal_flags = NL80211_FLAG_NEED_NETDEV | | 14042 | .internal_flags = NL80211_FLAG_NEED_NETDEV | |
| @@ -13967,6 +14044,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13967 | }, | 14044 | }, |
| 13968 | { | 14045 | { |
| 13969 | .cmd = NL80211_CMD_GET_POWER_SAVE, | 14046 | .cmd = NL80211_CMD_GET_POWER_SAVE, |
| 14047 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13970 | .doit = nl80211_get_power_save, | 14048 | .doit = nl80211_get_power_save, |
| 13971 | /* can be retrieved by unprivileged users */ | 14049 | /* can be retrieved by unprivileged users */ |
| 13972 | .internal_flags = NL80211_FLAG_NEED_NETDEV | | 14050 | .internal_flags = NL80211_FLAG_NEED_NETDEV | |
| @@ -13974,6 +14052,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13974 | }, | 14052 | }, |
| 13975 | { | 14053 | { |
| 13976 | .cmd = NL80211_CMD_SET_CQM, | 14054 | .cmd = NL80211_CMD_SET_CQM, |
| 14055 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13977 | .doit = nl80211_set_cqm, | 14056 | .doit = nl80211_set_cqm, |
| 13978 | .flags = GENL_UNS_ADMIN_PERM, | 14057 | .flags = GENL_UNS_ADMIN_PERM, |
| 13979 | .internal_flags = NL80211_FLAG_NEED_NETDEV | | 14058 | .internal_flags = NL80211_FLAG_NEED_NETDEV | |
| @@ -13981,6 +14060,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13981 | }, | 14060 | }, |
| 13982 | { | 14061 | { |
| 13983 | .cmd = NL80211_CMD_SET_CHANNEL, | 14062 | .cmd = NL80211_CMD_SET_CHANNEL, |
| 14063 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13984 | .doit = nl80211_set_channel, | 14064 | .doit = nl80211_set_channel, |
| 13985 | .flags = GENL_UNS_ADMIN_PERM, | 14065 | .flags = GENL_UNS_ADMIN_PERM, |
| 13986 | .internal_flags = NL80211_FLAG_NEED_NETDEV | | 14066 | .internal_flags = NL80211_FLAG_NEED_NETDEV | |
| @@ -13988,6 +14068,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13988 | }, | 14068 | }, |
| 13989 | { | 14069 | { |
| 13990 | .cmd = NL80211_CMD_SET_WDS_PEER, | 14070 | .cmd = NL80211_CMD_SET_WDS_PEER, |
| 14071 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13991 | .doit = nl80211_set_wds_peer, | 14072 | .doit = nl80211_set_wds_peer, |
| 13992 | .flags = GENL_UNS_ADMIN_PERM, | 14073 | .flags = GENL_UNS_ADMIN_PERM, |
| 13993 | .internal_flags = NL80211_FLAG_NEED_NETDEV | | 14074 | .internal_flags = NL80211_FLAG_NEED_NETDEV | |
| @@ -13995,6 +14076,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 13995 | }, | 14076 | }, |
| 13996 | { | 14077 | { |
| 13997 | .cmd = NL80211_CMD_JOIN_MESH, | 14078 | .cmd = NL80211_CMD_JOIN_MESH, |
| 14079 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 13998 | .doit = nl80211_join_mesh, | 14080 | .doit = nl80211_join_mesh, |
| 13999 | .flags = GENL_UNS_ADMIN_PERM, | 14081 | .flags = GENL_UNS_ADMIN_PERM, |
| 14000 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 14082 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -14002,6 +14084,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14002 | }, | 14084 | }, |
| 14003 | { | 14085 | { |
| 14004 | .cmd = NL80211_CMD_LEAVE_MESH, | 14086 | .cmd = NL80211_CMD_LEAVE_MESH, |
| 14087 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14005 | .doit = nl80211_leave_mesh, | 14088 | .doit = nl80211_leave_mesh, |
| 14006 | .flags = GENL_UNS_ADMIN_PERM, | 14089 | .flags = GENL_UNS_ADMIN_PERM, |
| 14007 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 14090 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -14009,6 +14092,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14009 | }, | 14092 | }, |
| 14010 | { | 14093 | { |
| 14011 | .cmd = NL80211_CMD_JOIN_OCB, | 14094 | .cmd = NL80211_CMD_JOIN_OCB, |
| 14095 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14012 | .doit = nl80211_join_ocb, | 14096 | .doit = nl80211_join_ocb, |
| 14013 | .flags = GENL_UNS_ADMIN_PERM, | 14097 | .flags = GENL_UNS_ADMIN_PERM, |
| 14014 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 14098 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -14016,6 +14100,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14016 | }, | 14100 | }, |
| 14017 | { | 14101 | { |
| 14018 | .cmd = NL80211_CMD_LEAVE_OCB, | 14102 | .cmd = NL80211_CMD_LEAVE_OCB, |
| 14103 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14019 | .doit = nl80211_leave_ocb, | 14104 | .doit = nl80211_leave_ocb, |
| 14020 | .flags = GENL_UNS_ADMIN_PERM, | 14105 | .flags = GENL_UNS_ADMIN_PERM, |
| 14021 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 14106 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -14024,6 +14109,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14024 | #ifdef CONFIG_PM | 14109 | #ifdef CONFIG_PM |
| 14025 | { | 14110 | { |
| 14026 | .cmd = NL80211_CMD_GET_WOWLAN, | 14111 | .cmd = NL80211_CMD_GET_WOWLAN, |
| 14112 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14027 | .doit = nl80211_get_wowlan, | 14113 | .doit = nl80211_get_wowlan, |
| 14028 | /* can be retrieved by unprivileged users */ | 14114 | /* can be retrieved by unprivileged users */ |
| 14029 | .internal_flags = NL80211_FLAG_NEED_WIPHY | | 14115 | .internal_flags = NL80211_FLAG_NEED_WIPHY | |
| @@ -14031,6 +14117,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14031 | }, | 14117 | }, |
| 14032 | { | 14118 | { |
| 14033 | .cmd = NL80211_CMD_SET_WOWLAN, | 14119 | .cmd = NL80211_CMD_SET_WOWLAN, |
| 14120 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14034 | .doit = nl80211_set_wowlan, | 14121 | .doit = nl80211_set_wowlan, |
| 14035 | .flags = GENL_UNS_ADMIN_PERM, | 14122 | .flags = GENL_UNS_ADMIN_PERM, |
| 14036 | .internal_flags = NL80211_FLAG_NEED_WIPHY | | 14123 | .internal_flags = NL80211_FLAG_NEED_WIPHY | |
| @@ -14039,6 +14126,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14039 | #endif | 14126 | #endif |
| 14040 | { | 14127 | { |
| 14041 | .cmd = NL80211_CMD_SET_REKEY_OFFLOAD, | 14128 | .cmd = NL80211_CMD_SET_REKEY_OFFLOAD, |
| 14129 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14042 | .doit = nl80211_set_rekey_data, | 14130 | .doit = nl80211_set_rekey_data, |
| 14043 | .flags = GENL_UNS_ADMIN_PERM, | 14131 | .flags = GENL_UNS_ADMIN_PERM, |
| 14044 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 14132 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -14047,6 +14135,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14047 | }, | 14135 | }, |
| 14048 | { | 14136 | { |
| 14049 | .cmd = NL80211_CMD_TDLS_MGMT, | 14137 | .cmd = NL80211_CMD_TDLS_MGMT, |
| 14138 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14050 | .doit = nl80211_tdls_mgmt, | 14139 | .doit = nl80211_tdls_mgmt, |
| 14051 | .flags = GENL_UNS_ADMIN_PERM, | 14140 | .flags = GENL_UNS_ADMIN_PERM, |
| 14052 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 14141 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -14054,6 +14143,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14054 | }, | 14143 | }, |
| 14055 | { | 14144 | { |
| 14056 | .cmd = NL80211_CMD_TDLS_OPER, | 14145 | .cmd = NL80211_CMD_TDLS_OPER, |
| 14146 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14057 | .doit = nl80211_tdls_oper, | 14147 | .doit = nl80211_tdls_oper, |
| 14058 | .flags = GENL_UNS_ADMIN_PERM, | 14148 | .flags = GENL_UNS_ADMIN_PERM, |
| 14059 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 14149 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -14061,6 +14151,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14061 | }, | 14151 | }, |
| 14062 | { | 14152 | { |
| 14063 | .cmd = NL80211_CMD_UNEXPECTED_FRAME, | 14153 | .cmd = NL80211_CMD_UNEXPECTED_FRAME, |
| 14154 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14064 | .doit = nl80211_register_unexpected_frame, | 14155 | .doit = nl80211_register_unexpected_frame, |
| 14065 | .flags = GENL_UNS_ADMIN_PERM, | 14156 | .flags = GENL_UNS_ADMIN_PERM, |
| 14066 | .internal_flags = NL80211_FLAG_NEED_NETDEV | | 14157 | .internal_flags = NL80211_FLAG_NEED_NETDEV | |
| @@ -14068,6 +14159,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14068 | }, | 14159 | }, |
| 14069 | { | 14160 | { |
| 14070 | .cmd = NL80211_CMD_PROBE_CLIENT, | 14161 | .cmd = NL80211_CMD_PROBE_CLIENT, |
| 14162 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14071 | .doit = nl80211_probe_client, | 14163 | .doit = nl80211_probe_client, |
| 14072 | .flags = GENL_UNS_ADMIN_PERM, | 14164 | .flags = GENL_UNS_ADMIN_PERM, |
| 14073 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 14165 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -14075,6 +14167,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14075 | }, | 14167 | }, |
| 14076 | { | 14168 | { |
| 14077 | .cmd = NL80211_CMD_REGISTER_BEACONS, | 14169 | .cmd = NL80211_CMD_REGISTER_BEACONS, |
| 14170 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14078 | .doit = nl80211_register_beacons, | 14171 | .doit = nl80211_register_beacons, |
| 14079 | .flags = GENL_UNS_ADMIN_PERM, | 14172 | .flags = GENL_UNS_ADMIN_PERM, |
| 14080 | .internal_flags = NL80211_FLAG_NEED_WIPHY | | 14173 | .internal_flags = NL80211_FLAG_NEED_WIPHY | |
| @@ -14082,6 +14175,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14082 | }, | 14175 | }, |
| 14083 | { | 14176 | { |
| 14084 | .cmd = NL80211_CMD_SET_NOACK_MAP, | 14177 | .cmd = NL80211_CMD_SET_NOACK_MAP, |
| 14178 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14085 | .doit = nl80211_set_noack_map, | 14179 | .doit = nl80211_set_noack_map, |
| 14086 | .flags = GENL_UNS_ADMIN_PERM, | 14180 | .flags = GENL_UNS_ADMIN_PERM, |
| 14087 | .internal_flags = NL80211_FLAG_NEED_NETDEV | | 14181 | .internal_flags = NL80211_FLAG_NEED_NETDEV | |
| @@ -14089,6 +14183,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14089 | }, | 14183 | }, |
| 14090 | { | 14184 | { |
| 14091 | .cmd = NL80211_CMD_START_P2P_DEVICE, | 14185 | .cmd = NL80211_CMD_START_P2P_DEVICE, |
| 14186 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14092 | .doit = nl80211_start_p2p_device, | 14187 | .doit = nl80211_start_p2p_device, |
| 14093 | .flags = GENL_UNS_ADMIN_PERM, | 14188 | .flags = GENL_UNS_ADMIN_PERM, |
| 14094 | .internal_flags = NL80211_FLAG_NEED_WDEV | | 14189 | .internal_flags = NL80211_FLAG_NEED_WDEV | |
| @@ -14096,6 +14191,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14096 | }, | 14191 | }, |
| 14097 | { | 14192 | { |
| 14098 | .cmd = NL80211_CMD_STOP_P2P_DEVICE, | 14193 | .cmd = NL80211_CMD_STOP_P2P_DEVICE, |
| 14194 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14099 | .doit = nl80211_stop_p2p_device, | 14195 | .doit = nl80211_stop_p2p_device, |
| 14100 | .flags = GENL_UNS_ADMIN_PERM, | 14196 | .flags = GENL_UNS_ADMIN_PERM, |
| 14101 | .internal_flags = NL80211_FLAG_NEED_WDEV_UP | | 14197 | .internal_flags = NL80211_FLAG_NEED_WDEV_UP | |
| @@ -14103,6 +14199,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14103 | }, | 14199 | }, |
| 14104 | { | 14200 | { |
| 14105 | .cmd = NL80211_CMD_START_NAN, | 14201 | .cmd = NL80211_CMD_START_NAN, |
| 14202 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14106 | .doit = nl80211_start_nan, | 14203 | .doit = nl80211_start_nan, |
| 14107 | .flags = GENL_ADMIN_PERM, | 14204 | .flags = GENL_ADMIN_PERM, |
| 14108 | .internal_flags = NL80211_FLAG_NEED_WDEV | | 14205 | .internal_flags = NL80211_FLAG_NEED_WDEV | |
| @@ -14110,6 +14207,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14110 | }, | 14207 | }, |
| 14111 | { | 14208 | { |
| 14112 | .cmd = NL80211_CMD_STOP_NAN, | 14209 | .cmd = NL80211_CMD_STOP_NAN, |
| 14210 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14113 | .doit = nl80211_stop_nan, | 14211 | .doit = nl80211_stop_nan, |
| 14114 | .flags = GENL_ADMIN_PERM, | 14212 | .flags = GENL_ADMIN_PERM, |
| 14115 | .internal_flags = NL80211_FLAG_NEED_WDEV_UP | | 14213 | .internal_flags = NL80211_FLAG_NEED_WDEV_UP | |
| @@ -14117,6 +14215,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14117 | }, | 14215 | }, |
| 14118 | { | 14216 | { |
| 14119 | .cmd = NL80211_CMD_ADD_NAN_FUNCTION, | 14217 | .cmd = NL80211_CMD_ADD_NAN_FUNCTION, |
| 14218 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14120 | .doit = nl80211_nan_add_func, | 14219 | .doit = nl80211_nan_add_func, |
| 14121 | .flags = GENL_ADMIN_PERM, | 14220 | .flags = GENL_ADMIN_PERM, |
| 14122 | .internal_flags = NL80211_FLAG_NEED_WDEV_UP | | 14221 | .internal_flags = NL80211_FLAG_NEED_WDEV_UP | |
| @@ -14124,6 +14223,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14124 | }, | 14223 | }, |
| 14125 | { | 14224 | { |
| 14126 | .cmd = NL80211_CMD_DEL_NAN_FUNCTION, | 14225 | .cmd = NL80211_CMD_DEL_NAN_FUNCTION, |
| 14226 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14127 | .doit = nl80211_nan_del_func, | 14227 | .doit = nl80211_nan_del_func, |
| 14128 | .flags = GENL_ADMIN_PERM, | 14228 | .flags = GENL_ADMIN_PERM, |
| 14129 | .internal_flags = NL80211_FLAG_NEED_WDEV_UP | | 14229 | .internal_flags = NL80211_FLAG_NEED_WDEV_UP | |
| @@ -14131,6 +14231,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14131 | }, | 14231 | }, |
| 14132 | { | 14232 | { |
| 14133 | .cmd = NL80211_CMD_CHANGE_NAN_CONFIG, | 14233 | .cmd = NL80211_CMD_CHANGE_NAN_CONFIG, |
| 14234 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14134 | .doit = nl80211_nan_change_config, | 14235 | .doit = nl80211_nan_change_config, |
| 14135 | .flags = GENL_ADMIN_PERM, | 14236 | .flags = GENL_ADMIN_PERM, |
| 14136 | .internal_flags = NL80211_FLAG_NEED_WDEV_UP | | 14237 | .internal_flags = NL80211_FLAG_NEED_WDEV_UP | |
| @@ -14138,6 +14239,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14138 | }, | 14239 | }, |
| 14139 | { | 14240 | { |
| 14140 | .cmd = NL80211_CMD_SET_MCAST_RATE, | 14241 | .cmd = NL80211_CMD_SET_MCAST_RATE, |
| 14242 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14141 | .doit = nl80211_set_mcast_rate, | 14243 | .doit = nl80211_set_mcast_rate, |
| 14142 | .flags = GENL_UNS_ADMIN_PERM, | 14244 | .flags = GENL_UNS_ADMIN_PERM, |
| 14143 | .internal_flags = NL80211_FLAG_NEED_NETDEV | | 14245 | .internal_flags = NL80211_FLAG_NEED_NETDEV | |
| @@ -14145,6 +14247,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14145 | }, | 14247 | }, |
| 14146 | { | 14248 | { |
| 14147 | .cmd = NL80211_CMD_SET_MAC_ACL, | 14249 | .cmd = NL80211_CMD_SET_MAC_ACL, |
| 14250 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14148 | .doit = nl80211_set_mac_acl, | 14251 | .doit = nl80211_set_mac_acl, |
| 14149 | .flags = GENL_UNS_ADMIN_PERM, | 14252 | .flags = GENL_UNS_ADMIN_PERM, |
| 14150 | .internal_flags = NL80211_FLAG_NEED_NETDEV | | 14253 | .internal_flags = NL80211_FLAG_NEED_NETDEV | |
| @@ -14152,6 +14255,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14152 | }, | 14255 | }, |
| 14153 | { | 14256 | { |
| 14154 | .cmd = NL80211_CMD_RADAR_DETECT, | 14257 | .cmd = NL80211_CMD_RADAR_DETECT, |
| 14258 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14155 | .doit = nl80211_start_radar_detection, | 14259 | .doit = nl80211_start_radar_detection, |
| 14156 | .flags = GENL_UNS_ADMIN_PERM, | 14260 | .flags = GENL_UNS_ADMIN_PERM, |
| 14157 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 14261 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -14159,10 +14263,12 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14159 | }, | 14263 | }, |
| 14160 | { | 14264 | { |
| 14161 | .cmd = NL80211_CMD_GET_PROTOCOL_FEATURES, | 14265 | .cmd = NL80211_CMD_GET_PROTOCOL_FEATURES, |
| 14266 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14162 | .doit = nl80211_get_protocol_features, | 14267 | .doit = nl80211_get_protocol_features, |
| 14163 | }, | 14268 | }, |
| 14164 | { | 14269 | { |
| 14165 | .cmd = NL80211_CMD_UPDATE_FT_IES, | 14270 | .cmd = NL80211_CMD_UPDATE_FT_IES, |
| 14271 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14166 | .doit = nl80211_update_ft_ies, | 14272 | .doit = nl80211_update_ft_ies, |
| 14167 | .flags = GENL_UNS_ADMIN_PERM, | 14273 | .flags = GENL_UNS_ADMIN_PERM, |
| 14168 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 14274 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -14170,6 +14276,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14170 | }, | 14276 | }, |
| 14171 | { | 14277 | { |
| 14172 | .cmd = NL80211_CMD_CRIT_PROTOCOL_START, | 14278 | .cmd = NL80211_CMD_CRIT_PROTOCOL_START, |
| 14279 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14173 | .doit = nl80211_crit_protocol_start, | 14280 | .doit = nl80211_crit_protocol_start, |
| 14174 | .flags = GENL_UNS_ADMIN_PERM, | 14281 | .flags = GENL_UNS_ADMIN_PERM, |
| 14175 | .internal_flags = NL80211_FLAG_NEED_WDEV_UP | | 14282 | .internal_flags = NL80211_FLAG_NEED_WDEV_UP | |
| @@ -14177,6 +14284,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14177 | }, | 14284 | }, |
| 14178 | { | 14285 | { |
| 14179 | .cmd = NL80211_CMD_CRIT_PROTOCOL_STOP, | 14286 | .cmd = NL80211_CMD_CRIT_PROTOCOL_STOP, |
| 14287 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14180 | .doit = nl80211_crit_protocol_stop, | 14288 | .doit = nl80211_crit_protocol_stop, |
| 14181 | .flags = GENL_UNS_ADMIN_PERM, | 14289 | .flags = GENL_UNS_ADMIN_PERM, |
| 14182 | .internal_flags = NL80211_FLAG_NEED_WDEV_UP | | 14290 | .internal_flags = NL80211_FLAG_NEED_WDEV_UP | |
| @@ -14184,12 +14292,14 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14184 | }, | 14292 | }, |
| 14185 | { | 14293 | { |
| 14186 | .cmd = NL80211_CMD_GET_COALESCE, | 14294 | .cmd = NL80211_CMD_GET_COALESCE, |
| 14295 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14187 | .doit = nl80211_get_coalesce, | 14296 | .doit = nl80211_get_coalesce, |
| 14188 | .internal_flags = NL80211_FLAG_NEED_WIPHY | | 14297 | .internal_flags = NL80211_FLAG_NEED_WIPHY | |
| 14189 | NL80211_FLAG_NEED_RTNL, | 14298 | NL80211_FLAG_NEED_RTNL, |
| 14190 | }, | 14299 | }, |
| 14191 | { | 14300 | { |
| 14192 | .cmd = NL80211_CMD_SET_COALESCE, | 14301 | .cmd = NL80211_CMD_SET_COALESCE, |
| 14302 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14193 | .doit = nl80211_set_coalesce, | 14303 | .doit = nl80211_set_coalesce, |
| 14194 | .flags = GENL_UNS_ADMIN_PERM, | 14304 | .flags = GENL_UNS_ADMIN_PERM, |
| 14195 | .internal_flags = NL80211_FLAG_NEED_WIPHY | | 14305 | .internal_flags = NL80211_FLAG_NEED_WIPHY | |
| @@ -14197,6 +14307,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14197 | }, | 14307 | }, |
| 14198 | { | 14308 | { |
| 14199 | .cmd = NL80211_CMD_CHANNEL_SWITCH, | 14309 | .cmd = NL80211_CMD_CHANNEL_SWITCH, |
| 14310 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14200 | .doit = nl80211_channel_switch, | 14311 | .doit = nl80211_channel_switch, |
| 14201 | .flags = GENL_UNS_ADMIN_PERM, | 14312 | .flags = GENL_UNS_ADMIN_PERM, |
| 14202 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 14313 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -14204,6 +14315,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14204 | }, | 14315 | }, |
| 14205 | { | 14316 | { |
| 14206 | .cmd = NL80211_CMD_VENDOR, | 14317 | .cmd = NL80211_CMD_VENDOR, |
| 14318 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14207 | .doit = nl80211_vendor_cmd, | 14319 | .doit = nl80211_vendor_cmd, |
| 14208 | .dumpit = nl80211_vendor_cmd_dump, | 14320 | .dumpit = nl80211_vendor_cmd_dump, |
| 14209 | .flags = GENL_UNS_ADMIN_PERM, | 14321 | .flags = GENL_UNS_ADMIN_PERM, |
| @@ -14213,6 +14325,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14213 | }, | 14325 | }, |
| 14214 | { | 14326 | { |
| 14215 | .cmd = NL80211_CMD_SET_QOS_MAP, | 14327 | .cmd = NL80211_CMD_SET_QOS_MAP, |
| 14328 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14216 | .doit = nl80211_set_qos_map, | 14329 | .doit = nl80211_set_qos_map, |
| 14217 | .flags = GENL_UNS_ADMIN_PERM, | 14330 | .flags = GENL_UNS_ADMIN_PERM, |
| 14218 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 14331 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -14220,6 +14333,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14220 | }, | 14333 | }, |
| 14221 | { | 14334 | { |
| 14222 | .cmd = NL80211_CMD_ADD_TX_TS, | 14335 | .cmd = NL80211_CMD_ADD_TX_TS, |
| 14336 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14223 | .doit = nl80211_add_tx_ts, | 14337 | .doit = nl80211_add_tx_ts, |
| 14224 | .flags = GENL_UNS_ADMIN_PERM, | 14338 | .flags = GENL_UNS_ADMIN_PERM, |
| 14225 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 14339 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -14227,6 +14341,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14227 | }, | 14341 | }, |
| 14228 | { | 14342 | { |
| 14229 | .cmd = NL80211_CMD_DEL_TX_TS, | 14343 | .cmd = NL80211_CMD_DEL_TX_TS, |
| 14344 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14230 | .doit = nl80211_del_tx_ts, | 14345 | .doit = nl80211_del_tx_ts, |
| 14231 | .flags = GENL_UNS_ADMIN_PERM, | 14346 | .flags = GENL_UNS_ADMIN_PERM, |
| 14232 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 14347 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -14234,6 +14349,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14234 | }, | 14349 | }, |
| 14235 | { | 14350 | { |
| 14236 | .cmd = NL80211_CMD_TDLS_CHANNEL_SWITCH, | 14351 | .cmd = NL80211_CMD_TDLS_CHANNEL_SWITCH, |
| 14352 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14237 | .doit = nl80211_tdls_channel_switch, | 14353 | .doit = nl80211_tdls_channel_switch, |
| 14238 | .flags = GENL_UNS_ADMIN_PERM, | 14354 | .flags = GENL_UNS_ADMIN_PERM, |
| 14239 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 14355 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -14241,6 +14357,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14241 | }, | 14357 | }, |
| 14242 | { | 14358 | { |
| 14243 | .cmd = NL80211_CMD_TDLS_CANCEL_CHANNEL_SWITCH, | 14359 | .cmd = NL80211_CMD_TDLS_CANCEL_CHANNEL_SWITCH, |
| 14360 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14244 | .doit = nl80211_tdls_cancel_channel_switch, | 14361 | .doit = nl80211_tdls_cancel_channel_switch, |
| 14245 | .flags = GENL_UNS_ADMIN_PERM, | 14362 | .flags = GENL_UNS_ADMIN_PERM, |
| 14246 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 14363 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -14248,6 +14365,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14248 | }, | 14365 | }, |
| 14249 | { | 14366 | { |
| 14250 | .cmd = NL80211_CMD_SET_MULTICAST_TO_UNICAST, | 14367 | .cmd = NL80211_CMD_SET_MULTICAST_TO_UNICAST, |
| 14368 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14251 | .doit = nl80211_set_multicast_to_unicast, | 14369 | .doit = nl80211_set_multicast_to_unicast, |
| 14252 | .flags = GENL_UNS_ADMIN_PERM, | 14370 | .flags = GENL_UNS_ADMIN_PERM, |
| 14253 | .internal_flags = NL80211_FLAG_NEED_NETDEV | | 14371 | .internal_flags = NL80211_FLAG_NEED_NETDEV | |
| @@ -14255,6 +14373,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14255 | }, | 14373 | }, |
| 14256 | { | 14374 | { |
| 14257 | .cmd = NL80211_CMD_SET_PMK, | 14375 | .cmd = NL80211_CMD_SET_PMK, |
| 14376 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14258 | .doit = nl80211_set_pmk, | 14377 | .doit = nl80211_set_pmk, |
| 14259 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 14378 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| 14260 | NL80211_FLAG_NEED_RTNL | | 14379 | NL80211_FLAG_NEED_RTNL | |
| @@ -14262,12 +14381,14 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14262 | }, | 14381 | }, |
| 14263 | { | 14382 | { |
| 14264 | .cmd = NL80211_CMD_DEL_PMK, | 14383 | .cmd = NL80211_CMD_DEL_PMK, |
| 14384 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14265 | .doit = nl80211_del_pmk, | 14385 | .doit = nl80211_del_pmk, |
| 14266 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 14386 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| 14267 | NL80211_FLAG_NEED_RTNL, | 14387 | NL80211_FLAG_NEED_RTNL, |
| 14268 | }, | 14388 | }, |
| 14269 | { | 14389 | { |
| 14270 | .cmd = NL80211_CMD_EXTERNAL_AUTH, | 14390 | .cmd = NL80211_CMD_EXTERNAL_AUTH, |
| 14391 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14271 | .doit = nl80211_external_auth, | 14392 | .doit = nl80211_external_auth, |
| 14272 | .flags = GENL_ADMIN_PERM, | 14393 | .flags = GENL_ADMIN_PERM, |
| 14273 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 14394 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -14275,6 +14396,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14275 | }, | 14396 | }, |
| 14276 | { | 14397 | { |
| 14277 | .cmd = NL80211_CMD_CONTROL_PORT_FRAME, | 14398 | .cmd = NL80211_CMD_CONTROL_PORT_FRAME, |
| 14399 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14278 | .doit = nl80211_tx_control_port, | 14400 | .doit = nl80211_tx_control_port, |
| 14279 | .flags = GENL_UNS_ADMIN_PERM, | 14401 | .flags = GENL_UNS_ADMIN_PERM, |
| 14280 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 14402 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
| @@ -14282,12 +14404,14 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14282 | }, | 14404 | }, |
| 14283 | { | 14405 | { |
| 14284 | .cmd = NL80211_CMD_GET_FTM_RESPONDER_STATS, | 14406 | .cmd = NL80211_CMD_GET_FTM_RESPONDER_STATS, |
| 14407 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14285 | .doit = nl80211_get_ftm_responder_stats, | 14408 | .doit = nl80211_get_ftm_responder_stats, |
| 14286 | .internal_flags = NL80211_FLAG_NEED_NETDEV | | 14409 | .internal_flags = NL80211_FLAG_NEED_NETDEV | |
| 14287 | NL80211_FLAG_NEED_RTNL, | 14410 | NL80211_FLAG_NEED_RTNL, |
| 14288 | }, | 14411 | }, |
| 14289 | { | 14412 | { |
| 14290 | .cmd = NL80211_CMD_PEER_MEASUREMENT_START, | 14413 | .cmd = NL80211_CMD_PEER_MEASUREMENT_START, |
| 14414 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14291 | .doit = nl80211_pmsr_start, | 14415 | .doit = nl80211_pmsr_start, |
| 14292 | .flags = GENL_UNS_ADMIN_PERM, | 14416 | .flags = GENL_UNS_ADMIN_PERM, |
| 14293 | .internal_flags = NL80211_FLAG_NEED_WDEV_UP | | 14417 | .internal_flags = NL80211_FLAG_NEED_WDEV_UP | |
| @@ -14295,6 +14419,7 @@ static const struct genl_ops nl80211_ops[] = { | |||
| 14295 | }, | 14419 | }, |
| 14296 | { | 14420 | { |
| 14297 | .cmd = NL80211_CMD_NOTIFY_RADAR, | 14421 | .cmd = NL80211_CMD_NOTIFY_RADAR, |
| 14422 | .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, | ||
| 14298 | .doit = nl80211_notify_radar_detection, | 14423 | .doit = nl80211_notify_radar_detection, |
| 14299 | .flags = GENL_UNS_ADMIN_PERM, | 14424 | .flags = GENL_UNS_ADMIN_PERM, |
| 14300 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 14425 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |
diff --git a/net/wireless/pmsr.c b/net/wireless/pmsr.c index 5c80bccc8b3c..1b190475359a 100644 --- a/net/wireless/pmsr.c +++ b/net/wireless/pmsr.c | |||
| @@ -25,7 +25,8 @@ static int pmsr_parse_ftm(struct cfg80211_registered_device *rdev, | |||
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | /* no validation needed - was already done via nested policy */ | 27 | /* no validation needed - was already done via nested policy */ |
| 28 | nla_parse_nested(tb, NL80211_PMSR_FTM_REQ_ATTR_MAX, ftmreq, NULL, NULL); | 28 | nla_parse_nested_deprecated(tb, NL80211_PMSR_FTM_REQ_ATTR_MAX, ftmreq, |
| 29 | NULL, NULL); | ||
| 29 | 30 | ||
| 30 | if (tb[NL80211_PMSR_FTM_REQ_ATTR_PREAMBLE]) | 31 | if (tb[NL80211_PMSR_FTM_REQ_ATTR_PREAMBLE]) |
| 31 | preamble = nla_get_u32(tb[NL80211_PMSR_FTM_REQ_ATTR_PREAMBLE]); | 32 | preamble = nla_get_u32(tb[NL80211_PMSR_FTM_REQ_ATTR_PREAMBLE]); |
| @@ -139,7 +140,8 @@ static int pmsr_parse_peer(struct cfg80211_registered_device *rdev, | |||
| 139 | int err, rem; | 140 | int err, rem; |
| 140 | 141 | ||
| 141 | /* no validation needed - was already done via nested policy */ | 142 | /* no validation needed - was already done via nested policy */ |
| 142 | nla_parse_nested(tb, NL80211_PMSR_PEER_ATTR_MAX, peer, NULL, NULL); | 143 | nla_parse_nested_deprecated(tb, NL80211_PMSR_PEER_ATTR_MAX, peer, |
| 144 | NULL, NULL); | ||
| 143 | 145 | ||
| 144 | if (!tb[NL80211_PMSR_PEER_ATTR_ADDR] || | 146 | if (!tb[NL80211_PMSR_PEER_ATTR_ADDR] || |
| 145 | !tb[NL80211_PMSR_PEER_ATTR_CHAN] || | 147 | !tb[NL80211_PMSR_PEER_ATTR_CHAN] || |
| @@ -154,9 +156,9 @@ static int pmsr_parse_peer(struct cfg80211_registered_device *rdev, | |||
| 154 | /* reuse info->attrs */ | 156 | /* reuse info->attrs */ |
| 155 | memset(info->attrs, 0, sizeof(*info->attrs) * (NL80211_ATTR_MAX + 1)); | 157 | memset(info->attrs, 0, sizeof(*info->attrs) * (NL80211_ATTR_MAX + 1)); |
| 156 | /* need to validate here, we don't want to have validation recursion */ | 158 | /* need to validate here, we don't want to have validation recursion */ |
| 157 | err = nla_parse_nested(info->attrs, NL80211_ATTR_MAX, | 159 | err = nla_parse_nested_deprecated(info->attrs, NL80211_ATTR_MAX, |
| 158 | tb[NL80211_PMSR_PEER_ATTR_CHAN], | 160 | tb[NL80211_PMSR_PEER_ATTR_CHAN], |
| 159 | nl80211_policy, info->extack); | 161 | nl80211_policy, info->extack); |
| 160 | if (err) | 162 | if (err) |
| 161 | return err; | 163 | return err; |
| 162 | 164 | ||
| @@ -165,9 +167,9 @@ static int pmsr_parse_peer(struct cfg80211_registered_device *rdev, | |||
| 165 | return err; | 167 | return err; |
| 166 | 168 | ||
| 167 | /* no validation needed - was already done via nested policy */ | 169 | /* no validation needed - was already done via nested policy */ |
| 168 | nla_parse_nested(req, NL80211_PMSR_REQ_ATTR_MAX, | 170 | nla_parse_nested_deprecated(req, NL80211_PMSR_REQ_ATTR_MAX, |
| 169 | tb[NL80211_PMSR_PEER_ATTR_REQ], | 171 | tb[NL80211_PMSR_PEER_ATTR_REQ], NULL, |
| 170 | NULL, NULL); | 172 | NULL); |
| 171 | 173 | ||
| 172 | if (!req[NL80211_PMSR_REQ_ATTR_DATA]) { | 174 | if (!req[NL80211_PMSR_REQ_ATTR_DATA]) { |
| 173 | NL_SET_ERR_MSG_ATTR(info->extack, | 175 | NL_SET_ERR_MSG_ATTR(info->extack, |
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index a131f9ff979e..d7cb16f0df5b 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
| @@ -1006,8 +1006,8 @@ static int xfrm_dump_sa(struct sk_buff *skb, struct netlink_callback *cb) | |||
| 1006 | u8 proto = 0; | 1006 | u8 proto = 0; |
| 1007 | int err; | 1007 | int err; |
| 1008 | 1008 | ||
| 1009 | err = nlmsg_parse(cb->nlh, 0, attrs, XFRMA_MAX, xfrma_policy, | 1009 | err = nlmsg_parse_deprecated(cb->nlh, 0, attrs, XFRMA_MAX, |
| 1010 | cb->extack); | 1010 | xfrma_policy, cb->extack); |
| 1011 | if (err < 0) | 1011 | if (err < 0) |
| 1012 | return err; | 1012 | return err; |
| 1013 | 1013 | ||
| @@ -2656,9 +2656,9 @@ static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 2656 | } | 2656 | } |
| 2657 | } | 2657 | } |
| 2658 | 2658 | ||
| 2659 | err = nlmsg_parse(nlh, xfrm_msg_min[type], attrs, | 2659 | err = nlmsg_parse_deprecated(nlh, xfrm_msg_min[type], attrs, |
| 2660 | link->nla_max ? : XFRMA_MAX, | 2660 | link->nla_max ? : XFRMA_MAX, |
| 2661 | link->nla_pol ? : xfrma_policy, extack); | 2661 | link->nla_pol ? : xfrma_policy, extack); |
| 2662 | if (err < 0) | 2662 | if (err < 0) |
| 2663 | return err; | 2663 | return err; |
| 2664 | 2664 | ||
