aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/block/drbd/drbd_nl.c8
-rw-r--r--drivers/block/nbd.c4
-rw-r--r--drivers/infiniband/core/nldev.c9
-rw-r--r--drivers/infiniband/hw/cxgb4/restrack.c8
-rw-r--r--drivers/net/bonding/bond_netlink.c8
-rw-r--r--drivers/net/ieee802154/mac802154_hwsim.c6
-rw-r--r--drivers/net/macsec.c27
-rw-r--r--drivers/net/macvlan.c2
-rw-r--r--drivers/net/team/team.c8
-rw-r--r--drivers/net/wireless/ath/wil6210/cfg80211.c4
-rw-r--r--include/linux/netfilter/ipset/ip_set.h11
-rw-r--r--include/net/netlink.h26
-rw-r--r--kernel/taskstats.c2
-rw-r--r--net/8021q/vlan_netlink.c4
-rw-r--r--net/bridge/br_mdb.c17
-rw-r--r--net/bridge/br_netlink.c8
-rw-r--r--net/bridge/br_netlink_tunnel.c2
-rw-r--r--net/core/devlink.c78
-rw-r--r--net/core/lwt_bpf.c2
-rw-r--r--net/core/lwtunnel.c2
-rw-r--r--net/core/neighbour.c2
-rw-r--r--net/core/rtnetlink.c48
-rw-r--r--net/dcb/dcbnl.c40
-rw-r--r--net/decnet/dn_table.c3
-rw-r--r--net/ieee802154/nl802154.c34
-rw-r--r--net/ipv4/fib_semantics.c2
-rw-r--r--net/ipv4/ipmr.c6
-rw-r--r--net/ipv4/ipmr_base.c2
-rw-r--r--net/ipv4/tcp_metrics.c2
-rw-r--r--net/ipv6/addrconf.c2
-rw-r--r--net/ipv6/route.c2
-rw-r--r--net/ipv6/seg6_local.c2
-rw-r--r--net/l2tp/l2tp_netlink.c4
-rw-r--r--net/mpls/af_mpls.c2
-rw-r--r--net/ncsi/ncsi-netlink.c12
-rw-r--r--net/netfilter/ipset/ip_set_bitmap_gen.h14
-rw-r--r--net/netfilter/ipset/ip_set_hash_gen.h14
-rw-r--r--net/netfilter/ipset/ip_set_list_set.c14
-rw-r--r--net/netfilter/ipvs/ip_vs_ctl.c10
-rw-r--r--net/netfilter/nf_conntrack_netlink.c40
-rw-r--r--net/netfilter/nf_conntrack_proto_dccp.c2
-rw-r--r--net/netfilter/nf_conntrack_proto_sctp.c2
-rw-r--r--net/netfilter/nf_conntrack_proto_tcp.c2
-rw-r--r--net/netfilter/nf_tables_api.c29
-rw-r--r--net/netfilter/nfnetlink_cthelper.c7
-rw-r--r--net/netfilter/nfnetlink_cttimeout.c4
-rw-r--r--net/netfilter/nfnetlink_queue.c2
-rw-r--r--net/netfilter/nft_ct.c2
-rw-r--r--net/netfilter/nft_tunnel.c6
-rw-r--r--net/netlabel/netlabel_cipso_v4.c14
-rw-r--r--net/netlabel/netlabel_mgmt.c8
-rw-r--r--net/netlink/genetlink.c12
-rw-r--r--net/nfc/netlink.c4
-rw-r--r--net/openvswitch/conntrack.c6
-rw-r--r--net/openvswitch/datapath.c7
-rw-r--r--net/openvswitch/flow_netlink.c33
-rw-r--r--net/openvswitch/meter.c8
-rw-r--r--net/openvswitch/vport-vxlan.c2
-rw-r--r--net/openvswitch/vport.c2
-rw-r--r--net/packet/diag.c2
-rw-r--r--net/sched/act_api.c14
-rw-r--r--net/sched/act_ife.c2
-rw-r--r--net/sched/act_pedit.c5
-rw-r--r--net/sched/act_tunnel_key.c4
-rw-r--r--net/sched/cls_api.c4
-rw-r--r--net/sched/cls_basic.c2
-rw-r--r--net/sched/cls_bpf.c2
-rw-r--r--net/sched/cls_cgroup.c2
-rw-r--r--net/sched/cls_flow.c2
-rw-r--r--net/sched/cls_flower.c8
-rw-r--r--net/sched/cls_fw.c2
-rw-r--r--net/sched/cls_matchall.c2
-rw-r--r--net/sched/cls_route.c2
-rw-r--r--net/sched/cls_rsvp.h2
-rw-r--r--net/sched/cls_tcindex.c2
-rw-r--r--net/sched/cls_u32.c2
-rw-r--r--net/sched/ematch.c4
-rw-r--r--net/sched/sch_api.c2
-rw-r--r--net/sched/sch_atm.c2
-rw-r--r--net/sched/sch_cake.c10
-rw-r--r--net/sched/sch_cbq.c4
-rw-r--r--net/sched/sch_cbs.c2
-rw-r--r--net/sched/sch_choke.c2
-rw-r--r--net/sched/sch_codel.c2
-rw-r--r--net/sched/sch_drr.c2
-rw-r--r--net/sched/sch_dsmark.c4
-rw-r--r--net/sched/sch_etf.c2
-rw-r--r--net/sched/sch_fq.c2
-rw-r--r--net/sched/sch_fq_codel.c2
-rw-r--r--net/sched/sch_gred.c8
-rw-r--r--net/sched/sch_hfsc.c2
-rw-r--r--net/sched/sch_hhf.c2
-rw-r--r--net/sched/sch_htb.c4
-rw-r--r--net/sched/sch_ingress.c2
-rw-r--r--net/sched/sch_mqprio.c4
-rw-r--r--net/sched/sch_netem.c2
-rw-r--r--net/sched/sch_pie.c2
-rw-r--r--net/sched/sch_qfq.c2
-rw-r--r--net/sched/sch_red.c2
-rw-r--r--net/sched/sch_sfb.c2
-rw-r--r--net/sched/sch_taprio.c7
-rw-r--r--net/sched/sch_tbf.c2
-rw-r--r--net/tipc/bearer.c8
-rw-r--r--net/tipc/group.c2
-rw-r--r--net/tipc/link.c12
-rw-r--r--net/tipc/monitor.c4
-rw-r--r--net/tipc/name_table.c4
-rw-r--r--net/tipc/net.c2
-rw-r--r--net/tipc/netlink_compat.c24
-rw-r--r--net/tipc/node.c4
-rw-r--r--net/tipc/socket.c10
-rw-r--r--net/tipc/udp_media.c2
-rw-r--r--net/wireless/nl80211.c192
-rw-r--r--net/wireless/pmsr.c12
114 files changed, 565 insertions, 494 deletions
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index f2471172a961..1cb5a0b85fd9 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -114,7 +114,7 @@ static int drbd_msg_put_info(struct sk_buff *skb, const char *info)
114 if (!info || !info[0]) 114 if (!info || !info[0])
115 return 0; 115 return 0;
116 116
117 nla = nla_nest_start(skb, DRBD_NLA_CFG_REPLY); 117 nla = nla_nest_start_noflag(skb, DRBD_NLA_CFG_REPLY);
118 if (!nla) 118 if (!nla)
119 return err; 119 return err;
120 120
@@ -135,7 +135,7 @@ static int drbd_msg_sprintf_info(struct sk_buff *skb, const char *fmt, ...)
135 int err = -EMSGSIZE; 135 int err = -EMSGSIZE;
136 int len; 136 int len;
137 137
138 nla = nla_nest_start(skb, DRBD_NLA_CFG_REPLY); 138 nla = nla_nest_start_noflag(skb, DRBD_NLA_CFG_REPLY);
139 if (!nla) 139 if (!nla)
140 return err; 140 return err;
141 141
@@ -3269,7 +3269,7 @@ static int nla_put_drbd_cfg_context(struct sk_buff *skb,
3269 struct drbd_device *device) 3269 struct drbd_device *device)
3270{ 3270{
3271 struct nlattr *nla; 3271 struct nlattr *nla;
3272 nla = nla_nest_start(skb, DRBD_NLA_CFG_CONTEXT); 3272 nla = nla_nest_start_noflag(skb, DRBD_NLA_CFG_CONTEXT);
3273 if (!nla) 3273 if (!nla)
3274 goto nla_put_failure; 3274 goto nla_put_failure;
3275 if (device && 3275 if (device &&
@@ -3837,7 +3837,7 @@ static int nla_put_status_info(struct sk_buff *skb, struct drbd_device *device,
3837 if (err) 3837 if (err)
3838 goto nla_put_failure; 3838 goto nla_put_failure;
3839 3839
3840 nla = nla_nest_start(skb, DRBD_NLA_STATE_INFO); 3840 nla = nla_nest_start_noflag(skb, DRBD_NLA_STATE_INFO);
3841 if (!nla) 3841 if (!nla)
3842 goto nla_put_failure; 3842 goto nla_put_failure;
3843 if (nla_put_u32(skb, T_sib_reason, sib ? sib->sib_reason : SIB_GET_STATUS_REPLY) || 3843 if (nla_put_u32(skb, T_sib_reason, sib ? sib->sib_reason : SIB_GET_STATUS_REPLY) ||
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 92b8aafb8bb4..cd27f236431d 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -2047,7 +2047,7 @@ static int populate_nbd_status(struct nbd_device *nbd, struct sk_buff *reply)
2047 */ 2047 */
2048 if (refcount_read(&nbd->config_refs)) 2048 if (refcount_read(&nbd->config_refs))
2049 connected = 1; 2049 connected = 1;
2050 dev_opt = nla_nest_start(reply, NBD_DEVICE_ITEM); 2050 dev_opt = nla_nest_start_noflag(reply, NBD_DEVICE_ITEM);
2051 if (!dev_opt) 2051 if (!dev_opt)
2052 return -EMSGSIZE; 2052 return -EMSGSIZE;
2053 ret = nla_put_u32(reply, NBD_DEVICE_INDEX, nbd->index); 2053 ret = nla_put_u32(reply, NBD_DEVICE_INDEX, nbd->index);
@@ -2095,7 +2095,7 @@ static int nbd_genl_status(struct sk_buff *skb, struct genl_info *info)
2095 goto out; 2095 goto out;
2096 } 2096 }
2097 2097
2098 dev_list = nla_nest_start(reply, NBD_ATTR_DEVICE_LIST); 2098 dev_list = nla_nest_start_noflag(reply, NBD_ATTR_DEVICE_LIST);
2099 if (index == -1) { 2099 if (index == -1) {
2100 ret = idr_for_each(&nbd_index_idr, &status_cb, reply); 2100 ret = idr_for_each(&nbd_index_idr, &status_cb, reply);
2101 if (ret) { 2101 if (ret) {
diff --git a/drivers/infiniband/core/nldev.c b/drivers/infiniband/core/nldev.c
index 11ed58d3fce5..ad189a29cc67 100644
--- a/drivers/infiniband/core/nldev.c
+++ b/drivers/infiniband/core/nldev.c
@@ -292,7 +292,8 @@ static int fill_res_info_entry(struct sk_buff *msg,
292{ 292{
293 struct nlattr *entry_attr; 293 struct nlattr *entry_attr;
294 294
295 entry_attr = nla_nest_start(msg, RDMA_NLDEV_ATTR_RES_SUMMARY_ENTRY); 295 entry_attr = nla_nest_start_noflag(msg,
296 RDMA_NLDEV_ATTR_RES_SUMMARY_ENTRY);
296 if (!entry_attr) 297 if (!entry_attr)
297 return -EMSGSIZE; 298 return -EMSGSIZE;
298 299
@@ -327,7 +328,7 @@ static int fill_res_info(struct sk_buff *msg, struct ib_device *device)
327 if (fill_nldev_handle(msg, device)) 328 if (fill_nldev_handle(msg, device))
328 return -EMSGSIZE; 329 return -EMSGSIZE;
329 330
330 table_attr = nla_nest_start(msg, RDMA_NLDEV_ATTR_RES_SUMMARY); 331 table_attr = nla_nest_start_noflag(msg, RDMA_NLDEV_ATTR_RES_SUMMARY);
331 if (!table_attr) 332 if (!table_attr)
332 return -EMSGSIZE; 333 return -EMSGSIZE;
333 334
@@ -1108,7 +1109,7 @@ static int res_get_common_dumpit(struct sk_buff *skb,
1108 goto err; 1109 goto err;
1109 } 1110 }
1110 1111
1111 table_attr = nla_nest_start(skb, fe->nldev_attr); 1112 table_attr = nla_nest_start_noflag(skb, fe->nldev_attr);
1112 if (!table_attr) { 1113 if (!table_attr) {
1113 ret = -EMSGSIZE; 1114 ret = -EMSGSIZE;
1114 goto err; 1115 goto err;
@@ -1134,7 +1135,7 @@ static int res_get_common_dumpit(struct sk_buff *skb,
1134 1135
1135 filled = true; 1136 filled = true;
1136 1137
1137 entry_attr = nla_nest_start(skb, fe->entry); 1138 entry_attr = nla_nest_start_noflag(skb, fe->entry);
1138 if (!entry_attr) { 1139 if (!entry_attr) {
1139 ret = -EMSGSIZE; 1140 ret = -EMSGSIZE;
1140 rdma_restrack_put(res); 1141 rdma_restrack_put(res);
diff --git a/drivers/infiniband/hw/cxgb4/restrack.c b/drivers/infiniband/hw/cxgb4/restrack.c
index 9a7520ee41e0..f82d46ed969d 100644
--- a/drivers/infiniband/hw/cxgb4/restrack.c
+++ b/drivers/infiniband/hw/cxgb4/restrack.c
@@ -149,7 +149,7 @@ static int fill_res_qp_entry(struct sk_buff *msg,
149 if (qhp->ucontext) 149 if (qhp->ucontext)
150 return 0; 150 return 0;
151 151
152 table_attr = nla_nest_start(msg, RDMA_NLDEV_ATTR_DRIVER); 152 table_attr = nla_nest_start_noflag(msg, RDMA_NLDEV_ATTR_DRIVER);
153 if (!table_attr) 153 if (!table_attr)
154 goto err; 154 goto err;
155 155
@@ -216,7 +216,7 @@ static int fill_res_ep_entry(struct sk_buff *msg,
216 if (!uep) 216 if (!uep)
217 return 0; 217 return 0;
218 218
219 table_attr = nla_nest_start(msg, RDMA_NLDEV_ATTR_DRIVER); 219 table_attr = nla_nest_start_noflag(msg, RDMA_NLDEV_ATTR_DRIVER);
220 if (!table_attr) 220 if (!table_attr)
221 goto err_free_uep; 221 goto err_free_uep;
222 222
@@ -387,7 +387,7 @@ static int fill_res_cq_entry(struct sk_buff *msg,
387 if (ibcq->uobject) 387 if (ibcq->uobject)
388 return 0; 388 return 0;
389 389
390 table_attr = nla_nest_start(msg, RDMA_NLDEV_ATTR_DRIVER); 390 table_attr = nla_nest_start_noflag(msg, RDMA_NLDEV_ATTR_DRIVER);
391 if (!table_attr) 391 if (!table_attr)
392 goto err; 392 goto err;
393 393
@@ -447,7 +447,7 @@ static int fill_res_mr_entry(struct sk_buff *msg,
447 if (!stag) 447 if (!stag)
448 return 0; 448 return 0;
449 449
450 table_attr = nla_nest_start(msg, RDMA_NLDEV_ATTR_DRIVER); 450 table_attr = nla_nest_start_noflag(msg, RDMA_NLDEV_ATTR_DRIVER);
451 if (!table_attr) 451 if (!table_attr)
452 goto err; 452 goto err;
453 453
diff --git a/drivers/net/bonding/bond_netlink.c b/drivers/net/bonding/bond_netlink.c
index b286f591242e..022044b59d6a 100644
--- a/drivers/net/bonding/bond_netlink.c
+++ b/drivers/net/bonding/bond_netlink.c
@@ -546,7 +546,7 @@ static int bond_fill_info(struct sk_buff *skb,
546 if (nla_put_u32(skb, IFLA_BOND_ARP_INTERVAL, bond->params.arp_interval)) 546 if (nla_put_u32(skb, IFLA_BOND_ARP_INTERVAL, bond->params.arp_interval))
547 goto nla_put_failure; 547 goto nla_put_failure;
548 548
549 targets = nla_nest_start(skb, IFLA_BOND_ARP_IP_TARGET); 549 targets = nla_nest_start_noflag(skb, IFLA_BOND_ARP_IP_TARGET);
550 if (!targets) 550 if (!targets)
551 goto nla_put_failure; 551 goto nla_put_failure;
552 552
@@ -644,7 +644,7 @@ static int bond_fill_info(struct sk_buff *skb,
644 if (!bond_3ad_get_active_agg_info(bond, &info)) { 644 if (!bond_3ad_get_active_agg_info(bond, &info)) {
645 struct nlattr *nest; 645 struct nlattr *nest;
646 646
647 nest = nla_nest_start(skb, IFLA_BOND_AD_INFO); 647 nest = nla_nest_start_noflag(skb, IFLA_BOND_AD_INFO);
648 if (!nest) 648 if (!nest)
649 goto nla_put_failure; 649 goto nla_put_failure;
650 650
@@ -711,7 +711,7 @@ static int bond_fill_linkxstats(struct sk_buff *skb,
711 return -EINVAL; 711 return -EINVAL;
712 } 712 }
713 713
714 nest = nla_nest_start(skb, LINK_XSTATS_TYPE_BOND); 714 nest = nla_nest_start_noflag(skb, LINK_XSTATS_TYPE_BOND);
715 if (!nest) 715 if (!nest)
716 return -EMSGSIZE; 716 return -EMSGSIZE;
717 if (BOND_MODE(bond) == BOND_MODE_8023AD) { 717 if (BOND_MODE(bond) == BOND_MODE_8023AD) {
@@ -722,7 +722,7 @@ static int bond_fill_linkxstats(struct sk_buff *skb,
722 else 722 else
723 stats = &BOND_AD_INFO(bond).stats; 723 stats = &BOND_AD_INFO(bond).stats;
724 724
725 nest2 = nla_nest_start(skb, BOND_XSTATS_3AD); 725 nest2 = nla_nest_start_noflag(skb, BOND_XSTATS_3AD);
726 if (!nest2) { 726 if (!nest2) {
727 nla_nest_end(skb, nest); 727 nla_nest_end(skb, nest);
728 return -EMSGSIZE; 728 return -EMSGSIZE;
diff --git a/drivers/net/ieee802154/mac802154_hwsim.c b/drivers/net/ieee802154/mac802154_hwsim.c
index 707285953750..80ca300aba04 100644
--- a/drivers/net/ieee802154/mac802154_hwsim.c
+++ b/drivers/net/ieee802154/mac802154_hwsim.c
@@ -227,14 +227,16 @@ static int append_radio_msg(struct sk_buff *skb, struct hwsim_phy *phy)
227 return 0; 227 return 0;
228 } 228 }
229 229
230 nl_edges = nla_nest_start(skb, MAC802154_HWSIM_ATTR_RADIO_EDGES); 230 nl_edges = nla_nest_start_noflag(skb,
231 MAC802154_HWSIM_ATTR_RADIO_EDGES);
231 if (!nl_edges) { 232 if (!nl_edges) {
232 rcu_read_unlock(); 233 rcu_read_unlock();
233 return -ENOBUFS; 234 return -ENOBUFS;
234 } 235 }
235 236
236 list_for_each_entry_rcu(e, &phy->edges, list) { 237 list_for_each_entry_rcu(e, &phy->edges, list) {
237 nl_edge = nla_nest_start(skb, MAC802154_HWSIM_ATTR_RADIO_EDGE); 238 nl_edge = nla_nest_start_noflag(skb,
239 MAC802154_HWSIM_ATTR_RADIO_EDGE);
238 if (!nl_edge) { 240 if (!nl_edge) {
239 rcu_read_unlock(); 241 rcu_read_unlock();
240 nla_nest_cancel(skb, nl_edges); 242 nla_nest_cancel(skb, nl_edges);
diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c
index 263bfafdb004..8dedb9a9781e 100644
--- a/drivers/net/macsec.c
+++ b/drivers/net/macsec.c
@@ -2365,7 +2365,8 @@ copy_secy_stats(struct sk_buff *skb, struct pcpu_secy_stats __percpu *pstats)
2365static int nla_put_secy(struct macsec_secy *secy, struct sk_buff *skb) 2365static int nla_put_secy(struct macsec_secy *secy, struct sk_buff *skb)
2366{ 2366{
2367 struct macsec_tx_sc *tx_sc = &secy->tx_sc; 2367 struct macsec_tx_sc *tx_sc = &secy->tx_sc;
2368 struct nlattr *secy_nest = nla_nest_start(skb, MACSEC_ATTR_SECY); 2368 struct nlattr *secy_nest = nla_nest_start_noflag(skb,
2369 MACSEC_ATTR_SECY);
2369 u64 csid; 2370 u64 csid;
2370 2371
2371 if (!secy_nest) 2372 if (!secy_nest)
@@ -2435,7 +2436,7 @@ dump_secy(struct macsec_secy *secy, struct net_device *dev,
2435 if (nla_put_secy(secy, skb)) 2436 if (nla_put_secy(secy, skb))
2436 goto nla_put_failure; 2437 goto nla_put_failure;
2437 2438
2438 attr = nla_nest_start(skb, MACSEC_ATTR_TXSC_STATS); 2439 attr = nla_nest_start_noflag(skb, MACSEC_ATTR_TXSC_STATS);
2439 if (!attr) 2440 if (!attr)
2440 goto nla_put_failure; 2441 goto nla_put_failure;
2441 if (copy_tx_sc_stats(skb, tx_sc->stats)) { 2442 if (copy_tx_sc_stats(skb, tx_sc->stats)) {
@@ -2444,7 +2445,7 @@ dump_secy(struct macsec_secy *secy, struct net_device *dev,
2444 } 2445 }
2445 nla_nest_end(skb, attr); 2446 nla_nest_end(skb, attr);
2446 2447
2447 attr = nla_nest_start(skb, MACSEC_ATTR_SECY_STATS); 2448 attr = nla_nest_start_noflag(skb, MACSEC_ATTR_SECY_STATS);
2448 if (!attr) 2449 if (!attr)
2449 goto nla_put_failure; 2450 goto nla_put_failure;
2450 if (copy_secy_stats(skb, macsec_priv(dev)->stats)) { 2451 if (copy_secy_stats(skb, macsec_priv(dev)->stats)) {
@@ -2453,7 +2454,7 @@ dump_secy(struct macsec_secy *secy, struct net_device *dev,
2453 } 2454 }
2454 nla_nest_end(skb, attr); 2455 nla_nest_end(skb, attr);
2455 2456
2456 txsa_list = nla_nest_start(skb, MACSEC_ATTR_TXSA_LIST); 2457 txsa_list = nla_nest_start_noflag(skb, MACSEC_ATTR_TXSA_LIST);
2457 if (!txsa_list) 2458 if (!txsa_list)
2458 goto nla_put_failure; 2459 goto nla_put_failure;
2459 for (i = 0, j = 1; i < MACSEC_NUM_AN; i++) { 2460 for (i = 0, j = 1; i < MACSEC_NUM_AN; i++) {
@@ -2463,7 +2464,7 @@ dump_secy(struct macsec_secy *secy, struct net_device *dev,
2463 if (!tx_sa) 2464 if (!tx_sa)
2464 continue; 2465 continue;
2465 2466
2466 txsa_nest = nla_nest_start(skb, j++); 2467 txsa_nest = nla_nest_start_noflag(skb, j++);
2467 if (!txsa_nest) { 2468 if (!txsa_nest) {
2468 nla_nest_cancel(skb, txsa_list); 2469 nla_nest_cancel(skb, txsa_list);
2469 goto nla_put_failure; 2470 goto nla_put_failure;
@@ -2478,7 +2479,7 @@ dump_secy(struct macsec_secy *secy, struct net_device *dev,
2478 goto nla_put_failure; 2479 goto nla_put_failure;
2479 } 2480 }
2480 2481
2481 attr = nla_nest_start(skb, MACSEC_SA_ATTR_STATS); 2482 attr = nla_nest_start_noflag(skb, MACSEC_SA_ATTR_STATS);
2482 if (!attr) { 2483 if (!attr) {
2483 nla_nest_cancel(skb, txsa_nest); 2484 nla_nest_cancel(skb, txsa_nest);
2484 nla_nest_cancel(skb, txsa_list); 2485 nla_nest_cancel(skb, txsa_list);
@@ -2496,7 +2497,7 @@ dump_secy(struct macsec_secy *secy, struct net_device *dev,
2496 } 2497 }
2497 nla_nest_end(skb, txsa_list); 2498 nla_nest_end(skb, txsa_list);
2498 2499
2499 rxsc_list = nla_nest_start(skb, MACSEC_ATTR_RXSC_LIST); 2500 rxsc_list = nla_nest_start_noflag(skb, MACSEC_ATTR_RXSC_LIST);
2500 if (!rxsc_list) 2501 if (!rxsc_list)
2501 goto nla_put_failure; 2502 goto nla_put_failure;
2502 2503
@@ -2504,7 +2505,7 @@ dump_secy(struct macsec_secy *secy, struct net_device *dev,
2504 for_each_rxsc_rtnl(secy, rx_sc) { 2505 for_each_rxsc_rtnl(secy, rx_sc) {
2505 int k; 2506 int k;
2506 struct nlattr *rxsa_list; 2507 struct nlattr *rxsa_list;
2507 struct nlattr *rxsc_nest = nla_nest_start(skb, j++); 2508 struct nlattr *rxsc_nest = nla_nest_start_noflag(skb, j++);
2508 2509
2509 if (!rxsc_nest) { 2510 if (!rxsc_nest) {
2510 nla_nest_cancel(skb, rxsc_list); 2511 nla_nest_cancel(skb, rxsc_list);
@@ -2519,7 +2520,7 @@ dump_secy(struct macsec_secy *secy, struct net_device *dev,
2519 goto nla_put_failure; 2520 goto nla_put_failure;
2520 } 2521 }
2521 2522
2522 attr = nla_nest_start(skb, MACSEC_RXSC_ATTR_STATS); 2523 attr = nla_nest_start_noflag(skb, MACSEC_RXSC_ATTR_STATS);
2523 if (!attr) { 2524 if (!attr) {
2524 nla_nest_cancel(skb, rxsc_nest); 2525 nla_nest_cancel(skb, rxsc_nest);
2525 nla_nest_cancel(skb, rxsc_list); 2526 nla_nest_cancel(skb, rxsc_list);
@@ -2533,7 +2534,8 @@ dump_secy(struct macsec_secy *secy, struct net_device *dev,
2533 } 2534 }
2534 nla_nest_end(skb, attr); 2535 nla_nest_end(skb, attr);
2535 2536
2536 rxsa_list = nla_nest_start(skb, MACSEC_RXSC_ATTR_SA_LIST); 2537 rxsa_list = nla_nest_start_noflag(skb,
2538 MACSEC_RXSC_ATTR_SA_LIST);
2537 if (!rxsa_list) { 2539 if (!rxsa_list) {
2538 nla_nest_cancel(skb, rxsc_nest); 2540 nla_nest_cancel(skb, rxsc_nest);
2539 nla_nest_cancel(skb, rxsc_list); 2541 nla_nest_cancel(skb, rxsc_list);
@@ -2547,7 +2549,7 @@ dump_secy(struct macsec_secy *secy, struct net_device *dev,
2547 if (!rx_sa) 2549 if (!rx_sa)
2548 continue; 2550 continue;
2549 2551
2550 rxsa_nest = nla_nest_start(skb, k++); 2552 rxsa_nest = nla_nest_start_noflag(skb, k++);
2551 if (!rxsa_nest) { 2553 if (!rxsa_nest) {
2552 nla_nest_cancel(skb, rxsa_list); 2554 nla_nest_cancel(skb, rxsa_list);
2553 nla_nest_cancel(skb, rxsc_nest); 2555 nla_nest_cancel(skb, rxsc_nest);
@@ -2555,7 +2557,8 @@ dump_secy(struct macsec_secy *secy, struct net_device *dev,
2555 goto nla_put_failure; 2557 goto nla_put_failure;
2556 } 2558 }
2557 2559
2558 attr = nla_nest_start(skb, MACSEC_SA_ATTR_STATS); 2560 attr = nla_nest_start_noflag(skb,
2561 MACSEC_SA_ATTR_STATS);
2559 if (!attr) { 2562 if (!attr) {
2560 nla_nest_cancel(skb, rxsa_list); 2563 nla_nest_cancel(skb, rxsa_list);
2561 nla_nest_cancel(skb, rxsc_nest); 2564 nla_nest_cancel(skb, rxsc_nest);
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 4a6be8fab884..b395423b19bc 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -1624,7 +1624,7 @@ static int macvlan_fill_info(struct sk_buff *skb,
1624 if (nla_put_u32(skb, IFLA_MACVLAN_MACADDR_COUNT, vlan->macaddr_count)) 1624 if (nla_put_u32(skb, IFLA_MACVLAN_MACADDR_COUNT, vlan->macaddr_count))
1625 goto nla_put_failure; 1625 goto nla_put_failure;
1626 if (vlan->macaddr_count > 0) { 1626 if (vlan->macaddr_count > 0) {
1627 nest = nla_nest_start(skb, IFLA_MACVLAN_MACADDR_DATA); 1627 nest = nla_nest_start_noflag(skb, IFLA_MACVLAN_MACADDR_DATA);
1628 if (nest == NULL) 1628 if (nest == NULL)
1629 goto nla_put_failure; 1629 goto nla_put_failure;
1630 1630
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index eb4711bfc52a..6306897c147f 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -2290,7 +2290,7 @@ static int team_nl_fill_one_option_get(struct sk_buff *skb, struct team *team,
2290 if (err) 2290 if (err)
2291 return err; 2291 return err;
2292 2292
2293 option_item = nla_nest_start(skb, TEAM_ATTR_ITEM_OPTION); 2293 option_item = nla_nest_start_noflag(skb, TEAM_ATTR_ITEM_OPTION);
2294 if (!option_item) 2294 if (!option_item)
2295 return -EMSGSIZE; 2295 return -EMSGSIZE;
2296 2296
@@ -2404,7 +2404,7 @@ start_again:
2404 2404
2405 if (nla_put_u32(skb, TEAM_ATTR_TEAM_IFINDEX, team->dev->ifindex)) 2405 if (nla_put_u32(skb, TEAM_ATTR_TEAM_IFINDEX, team->dev->ifindex))
2406 goto nla_put_failure; 2406 goto nla_put_failure;
2407 option_list = nla_nest_start(skb, TEAM_ATTR_LIST_OPTION); 2407 option_list = nla_nest_start_noflag(skb, TEAM_ATTR_LIST_OPTION);
2408 if (!option_list) 2408 if (!option_list)
2409 goto nla_put_failure; 2409 goto nla_put_failure;
2410 2410
@@ -2626,7 +2626,7 @@ static int team_nl_fill_one_port_get(struct sk_buff *skb,
2626{ 2626{
2627 struct nlattr *port_item; 2627 struct nlattr *port_item;
2628 2628
2629 port_item = nla_nest_start(skb, TEAM_ATTR_ITEM_PORT); 2629 port_item = nla_nest_start_noflag(skb, TEAM_ATTR_ITEM_PORT);
2630 if (!port_item) 2630 if (!port_item)
2631 goto nest_cancel; 2631 goto nest_cancel;
2632 if (nla_put_u32(skb, TEAM_ATTR_PORT_IFINDEX, port->dev->ifindex)) 2632 if (nla_put_u32(skb, TEAM_ATTR_PORT_IFINDEX, port->dev->ifindex))
@@ -2681,7 +2681,7 @@ start_again:
2681 2681
2682 if (nla_put_u32(skb, TEAM_ATTR_TEAM_IFINDEX, team->dev->ifindex)) 2682 if (nla_put_u32(skb, TEAM_ATTR_TEAM_IFINDEX, team->dev->ifindex))
2683 goto nla_put_failure; 2683 goto nla_put_failure;
2684 port_list = nla_nest_start(skb, TEAM_ATTR_LIST_PORT); 2684 port_list = nla_nest_start_noflag(skb, TEAM_ATTR_LIST_PORT);
2685 if (!port_list) 2685 if (!port_list)
2686 goto nla_put_failure; 2686 goto nla_put_failure;
2687 2687
diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c
index a1e226652b4a..cac18e61474e 100644
--- a/drivers/net/wireless/ath/wil6210/cfg80211.c
+++ b/drivers/net/wireless/ath/wil6210/cfg80211.c
@@ -2679,13 +2679,13 @@ static int wil_rf_sector_get_cfg(struct wiphy *wiphy,
2679 QCA_ATTR_PAD)) 2679 QCA_ATTR_PAD))
2680 goto nla_put_failure; 2680 goto nla_put_failure;
2681 2681
2682 nl_cfgs = nla_nest_start(msg, QCA_ATTR_DMG_RF_SECTOR_CFG); 2682 nl_cfgs = nla_nest_start_noflag(msg, QCA_ATTR_DMG_RF_SECTOR_CFG);
2683 if (!nl_cfgs) 2683 if (!nl_cfgs)
2684 goto nla_put_failure; 2684 goto nla_put_failure;
2685 for (i = 0; i < WMI_MAX_RF_MODULES_NUM; i++) { 2685 for (i = 0; i < WMI_MAX_RF_MODULES_NUM; i++) {
2686 if (!(rf_modules_vec & BIT(i))) 2686 if (!(rf_modules_vec & BIT(i)))
2687 continue; 2687 continue;
2688 nl_cfg = nla_nest_start(msg, i); 2688 nl_cfg = nla_nest_start_noflag(msg, i);
2689 if (!nl_cfg) 2689 if (!nl_cfg)
2690 goto nla_put_failure; 2690 goto nla_put_failure;
2691 si = &reply.evt.sectors_info[i]; 2691 si = &reply.evt.sectors_info[i];
diff --git a/include/linux/netfilter/ipset/ip_set.h b/include/linux/netfilter/ipset/ip_set.h
index f2e1e6b13ca4..e499d170f12d 100644
--- a/include/linux/netfilter/ipset/ip_set.h
+++ b/include/linux/netfilter/ipset/ip_set.h
@@ -401,33 +401,30 @@ ip_set_get_h16(const struct nlattr *attr)
401 return ntohs(nla_get_be16(attr)); 401 return ntohs(nla_get_be16(attr));
402} 402}
403 403
404#define ipset_nest_start(skb, attr) nla_nest_start(skb, attr | NLA_F_NESTED)
405#define ipset_nest_end(skb, start) nla_nest_end(skb, start)
406
407static inline int nla_put_ipaddr4(struct sk_buff *skb, int type, __be32 ipaddr) 404static inline int nla_put_ipaddr4(struct sk_buff *skb, int type, __be32 ipaddr)
408{ 405{
409 struct nlattr *__nested = ipset_nest_start(skb, type); 406 struct nlattr *__nested = nla_nest_start(skb, type);
410 int ret; 407 int ret;
411 408
412 if (!__nested) 409 if (!__nested)
413 return -EMSGSIZE; 410 return -EMSGSIZE;
414 ret = nla_put_in_addr(skb, IPSET_ATTR_IPADDR_IPV4, ipaddr); 411 ret = nla_put_in_addr(skb, IPSET_ATTR_IPADDR_IPV4, ipaddr);
415 if (!ret) 412 if (!ret)
416 ipset_nest_end(skb, __nested); 413 nla_nest_end(skb, __nested);
417 return ret; 414 return ret;
418} 415}
419 416
420static inline int nla_put_ipaddr6(struct sk_buff *skb, int type, 417static inline int nla_put_ipaddr6(struct sk_buff *skb, int type,
421 const struct in6_addr *ipaddrptr) 418 const struct in6_addr *ipaddrptr)
422{ 419{
423 struct nlattr *__nested = ipset_nest_start(skb, type); 420 struct nlattr *__nested = nla_nest_start(skb, type);
424 int ret; 421 int ret;
425 422
426 if (!__nested) 423 if (!__nested)
427 return -EMSGSIZE; 424 return -EMSGSIZE;
428 ret = nla_put_in6_addr(skb, IPSET_ATTR_IPADDR_IPV6, ipaddrptr); 425 ret = nla_put_in6_addr(skb, IPSET_ATTR_IPADDR_IPV6, ipaddrptr);
429 if (!ret) 426 if (!ret)
430 ipset_nest_end(skb, __nested); 427 nla_nest_end(skb, __nested);
431 return ret; 428 return ret;
432} 429}
433 430
diff --git a/include/net/netlink.h b/include/net/netlink.h
index 23f27b0b3cef..1f18b47f41b4 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -1415,13 +1415,18 @@ static inline void *nla_memdup(const struct nlattr *src, gfp_t gfp)
1415} 1415}
1416 1416
1417/** 1417/**
1418 * nla_nest_start - Start a new level of nested attributes 1418 * nla_nest_start_noflag - Start a new level of nested attributes
1419 * @skb: socket buffer to add attributes to 1419 * @skb: socket buffer to add attributes to
1420 * @attrtype: attribute type of container 1420 * @attrtype: attribute type of container
1421 * 1421 *
1422 * Returns the container attribute 1422 * This function exists for backward compatibility to use in APIs which never
1423 * marked their nest attributes with NLA_F_NESTED flag. New APIs should use
1424 * nla_nest_start() which sets the flag.
1425 *
1426 * Returns the container attribute or NULL on error
1423 */ 1427 */
1424static inline struct nlattr *nla_nest_start(struct sk_buff *skb, int attrtype) 1428static inline struct nlattr *nla_nest_start_noflag(struct sk_buff *skb,
1429 int attrtype)
1425{ 1430{
1426 struct nlattr *start = (struct nlattr *)skb_tail_pointer(skb); 1431 struct nlattr *start = (struct nlattr *)skb_tail_pointer(skb);
1427 1432
@@ -1432,6 +1437,21 @@ static inline struct nlattr *nla_nest_start(struct sk_buff *skb, int attrtype)
1432} 1437}
1433 1438
1434/** 1439/**
1440 * nla_nest_start - Start a new level of nested attributes, with NLA_F_NESTED
1441 * @skb: socket buffer to add attributes to
1442 * @attrtype: attribute type of container
1443 *
1444 * Unlike nla_nest_start_noflag(), mark the nest attribute with NLA_F_NESTED
1445 * flag. This is the preferred function to use in new code.
1446 *
1447 * Returns the container attribute or NULL on error
1448 */
1449static inline struct nlattr *nla_nest_start(struct sk_buff *skb, int attrtype)
1450{
1451 return nla_nest_start_noflag(skb, attrtype | NLA_F_NESTED);
1452}
1453
1454/**
1435 * nla_nest_end - Finalize nesting of attributes 1455 * nla_nest_end - Finalize nesting of attributes
1436 * @skb: socket buffer the attributes are stored in 1456 * @skb: socket buffer the attributes are stored in
1437 * @start: container attribute 1457 * @start: container attribute
diff --git a/kernel/taskstats.c b/kernel/taskstats.c
index 1b942a7caf26..ef4f9cd980fd 100644
--- a/kernel/taskstats.c
+++ b/kernel/taskstats.c
@@ -375,7 +375,7 @@ static struct taskstats *mk_reply(struct sk_buff *skb, int type, u32 pid)
375 ? TASKSTATS_TYPE_AGGR_PID 375 ? TASKSTATS_TYPE_AGGR_PID
376 : TASKSTATS_TYPE_AGGR_TGID; 376 : TASKSTATS_TYPE_AGGR_TGID;
377 377
378 na = nla_nest_start(skb, aggr); 378 na = nla_nest_start_noflag(skb, aggr);
379 if (!na) 379 if (!na)
380 goto err; 380 goto err;
381 381
diff --git a/net/8021q/vlan_netlink.c b/net/8021q/vlan_netlink.c
index a624dccf68fd..ab4921e7797b 100644
--- a/net/8021q/vlan_netlink.c
+++ b/net/8021q/vlan_netlink.c
@@ -227,7 +227,7 @@ static int vlan_fill_info(struct sk_buff *skb, const struct net_device *dev)
227 goto nla_put_failure; 227 goto nla_put_failure;
228 } 228 }
229 if (vlan->nr_ingress_mappings) { 229 if (vlan->nr_ingress_mappings) {
230 nest = nla_nest_start(skb, IFLA_VLAN_INGRESS_QOS); 230 nest = nla_nest_start_noflag(skb, IFLA_VLAN_INGRESS_QOS);
231 if (nest == NULL) 231 if (nest == NULL)
232 goto nla_put_failure; 232 goto nla_put_failure;
233 233
@@ -245,7 +245,7 @@ static int vlan_fill_info(struct sk_buff *skb, const struct net_device *dev)
245 } 245 }
246 246
247 if (vlan->nr_egress_mappings) { 247 if (vlan->nr_egress_mappings) {
248 nest = nla_nest_start(skb, IFLA_VLAN_EGRESS_QOS); 248 nest = nla_nest_start_noflag(skb, IFLA_VLAN_EGRESS_QOS);
249 if (nest == NULL) 249 if (nest == NULL)
250 goto nla_put_failure; 250 goto nla_put_failure;
251 251
diff --git a/net/bridge/br_mdb.c b/net/bridge/br_mdb.c
index f69c8d91dc81..3619c1a12a77 100644
--- a/net/bridge/br_mdb.c
+++ b/net/bridge/br_mdb.c
@@ -26,14 +26,14 @@ static int br_rports_fill_info(struct sk_buff *skb, struct netlink_callback *cb,
26 if (!br->multicast_router || hlist_empty(&br->router_list)) 26 if (!br->multicast_router || hlist_empty(&br->router_list))
27 return 0; 27 return 0;
28 28
29 nest = nla_nest_start(skb, MDBA_ROUTER); 29 nest = nla_nest_start_noflag(skb, MDBA_ROUTER);
30 if (nest == NULL) 30 if (nest == NULL)
31 return -EMSGSIZE; 31 return -EMSGSIZE;
32 32
33 hlist_for_each_entry_rcu(p, &br->router_list, rlist) { 33 hlist_for_each_entry_rcu(p, &br->router_list, rlist) {
34 if (!p) 34 if (!p)
35 continue; 35 continue;
36 port_nest = nla_nest_start(skb, MDBA_ROUTER_PORT); 36 port_nest = nla_nest_start_noflag(skb, MDBA_ROUTER_PORT);
37 if (!port_nest) 37 if (!port_nest)
38 goto fail; 38 goto fail;
39 if (nla_put_nohdr(skb, sizeof(u32), &p->dev->ifindex) || 39 if (nla_put_nohdr(skb, sizeof(u32), &p->dev->ifindex) ||
@@ -86,7 +86,7 @@ static int br_mdb_fill_info(struct sk_buff *skb, struct netlink_callback *cb,
86 if (!br_opt_get(br, BROPT_MULTICAST_ENABLED)) 86 if (!br_opt_get(br, BROPT_MULTICAST_ENABLED))
87 return 0; 87 return 0;
88 88
89 nest = nla_nest_start(skb, MDBA_MDB); 89 nest = nla_nest_start_noflag(skb, MDBA_MDB);
90 if (nest == NULL) 90 if (nest == NULL)
91 return -EMSGSIZE; 91 return -EMSGSIZE;
92 92
@@ -98,7 +98,7 @@ static int br_mdb_fill_info(struct sk_buff *skb, struct netlink_callback *cb,
98 if (idx < s_idx) 98 if (idx < s_idx)
99 goto skip; 99 goto skip;
100 100
101 nest2 = nla_nest_start(skb, MDBA_MDB_ENTRY); 101 nest2 = nla_nest_start_noflag(skb, MDBA_MDB_ENTRY);
102 if (!nest2) { 102 if (!nest2) {
103 err = -EMSGSIZE; 103 err = -EMSGSIZE;
104 break; 104 break;
@@ -124,7 +124,8 @@ static int br_mdb_fill_info(struct sk_buff *skb, struct netlink_callback *cb,
124 e.addr.u.ip6 = p->addr.u.ip6; 124 e.addr.u.ip6 = p->addr.u.ip6;
125#endif 125#endif
126 e.addr.proto = p->addr.proto; 126 e.addr.proto = p->addr.proto;
127 nest_ent = nla_nest_start(skb, MDBA_MDB_ENTRY_INFO); 127 nest_ent = nla_nest_start_noflag(skb,
128 MDBA_MDB_ENTRY_INFO);
128 if (!nest_ent) { 129 if (!nest_ent) {
129 nla_nest_cancel(skb, nest2); 130 nla_nest_cancel(skb, nest2);
130 err = -EMSGSIZE; 131 err = -EMSGSIZE;
@@ -248,10 +249,10 @@ static int nlmsg_populate_mdb_fill(struct sk_buff *skb,
248 memset(bpm, 0, sizeof(*bpm)); 249 memset(bpm, 0, sizeof(*bpm));
249 bpm->family = AF_BRIDGE; 250 bpm->family = AF_BRIDGE;
250 bpm->ifindex = dev->ifindex; 251 bpm->ifindex = dev->ifindex;
251 nest = nla_nest_start(skb, MDBA_MDB); 252 nest = nla_nest_start_noflag(skb, MDBA_MDB);
252 if (nest == NULL) 253 if (nest == NULL)
253 goto cancel; 254 goto cancel;
254 nest2 = nla_nest_start(skb, MDBA_MDB_ENTRY); 255 nest2 = nla_nest_start_noflag(skb, MDBA_MDB_ENTRY);
255 if (nest2 == NULL) 256 if (nest2 == NULL)
256 goto end; 257 goto end;
257 258
@@ -444,7 +445,7 @@ static int nlmsg_populate_rtr_fill(struct sk_buff *skb,
444 memset(bpm, 0, sizeof(*bpm)); 445 memset(bpm, 0, sizeof(*bpm));
445 bpm->family = AF_BRIDGE; 446 bpm->family = AF_BRIDGE;
446 bpm->ifindex = dev->ifindex; 447 bpm->ifindex = dev->ifindex;
447 nest = nla_nest_start(skb, MDBA_ROUTER); 448 nest = nla_nest_start_noflag(skb, MDBA_ROUTER);
448 if (!nest) 449 if (!nest)
449 goto cancel; 450 goto cancel;
450 451
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 8dfcc2d285d8..348ddb6d09bb 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -413,9 +413,9 @@ static int br_fill_ifinfo(struct sk_buff *skb,
413 goto nla_put_failure; 413 goto nla_put_failure;
414 414
415 if (event == RTM_NEWLINK && port) { 415 if (event == RTM_NEWLINK && port) {
416 struct nlattr *nest 416 struct nlattr *nest;
417 = nla_nest_start(skb, IFLA_PROTINFO | NLA_F_NESTED);
418 417
418 nest = nla_nest_start(skb, IFLA_PROTINFO);
419 if (nest == NULL || br_port_fill_attrs(skb, port) < 0) 419 if (nest == NULL || br_port_fill_attrs(skb, port) < 0)
420 goto nla_put_failure; 420 goto nla_put_failure;
421 nla_nest_end(skb, nest); 421 nla_nest_end(skb, nest);
@@ -439,7 +439,7 @@ static int br_fill_ifinfo(struct sk_buff *skb,
439 rcu_read_unlock(); 439 rcu_read_unlock();
440 goto done; 440 goto done;
441 } 441 }
442 af = nla_nest_start(skb, IFLA_AF_SPEC); 442 af = nla_nest_start_noflag(skb, IFLA_AF_SPEC);
443 if (!af) { 443 if (!af) {
444 rcu_read_unlock(); 444 rcu_read_unlock();
445 goto nla_put_failure; 445 goto nla_put_failure;
@@ -1569,7 +1569,7 @@ static int br_fill_linkxstats(struct sk_buff *skb,
1569 return -EINVAL; 1569 return -EINVAL;
1570 } 1570 }
1571 1571
1572 nest = nla_nest_start(skb, LINK_XSTATS_TYPE_BRIDGE); 1572 nest = nla_nest_start_noflag(skb, LINK_XSTATS_TYPE_BRIDGE);
1573 if (!nest) 1573 if (!nest)
1574 return -EMSGSIZE; 1574 return -EMSGSIZE;
1575 1575
diff --git a/net/bridge/br_netlink_tunnel.c b/net/bridge/br_netlink_tunnel.c
index da8cb99fd259..787e140dc4b5 100644
--- a/net/bridge/br_netlink_tunnel.c
+++ b/net/bridge/br_netlink_tunnel.c
@@ -97,7 +97,7 @@ static int br_fill_vlan_tinfo(struct sk_buff *skb, u16 vid,
97 __be32 tid = tunnel_id_to_key32(tunnel_id); 97 __be32 tid = tunnel_id_to_key32(tunnel_id);
98 struct nlattr *tmap; 98 struct nlattr *tmap;
99 99
100 tmap = nla_nest_start(skb, IFLA_BRIDGE_VLAN_TUNNEL_INFO); 100 tmap = nla_nest_start_noflag(skb, IFLA_BRIDGE_VLAN_TUNNEL_INFO);
101 if (!tmap) 101 if (!tmap)
102 return -EMSGSIZE; 102 return -EMSGSIZE;
103 if (nla_put_u32(skb, IFLA_BRIDGE_VLAN_TUNNEL_ID, 103 if (nla_put_u32(skb, IFLA_BRIDGE_VLAN_TUNNEL_ID,
diff --git a/net/core/devlink.c b/net/core/devlink.c
index 7b91605e75d6..b94f326f5f06 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -1671,7 +1671,7 @@ int devlink_dpipe_match_put(struct sk_buff *skb,
1671 struct devlink_dpipe_field *field = &header->fields[match->field_id]; 1671 struct devlink_dpipe_field *field = &header->fields[match->field_id];
1672 struct nlattr *match_attr; 1672 struct nlattr *match_attr;
1673 1673
1674 match_attr = nla_nest_start(skb, DEVLINK_ATTR_DPIPE_MATCH); 1674 match_attr = nla_nest_start_noflag(skb, DEVLINK_ATTR_DPIPE_MATCH);
1675 if (!match_attr) 1675 if (!match_attr)
1676 return -EMSGSIZE; 1676 return -EMSGSIZE;
1677 1677
@@ -1696,7 +1696,8 @@ static int devlink_dpipe_matches_put(struct devlink_dpipe_table *table,
1696{ 1696{
1697 struct nlattr *matches_attr; 1697 struct nlattr *matches_attr;
1698 1698
1699 matches_attr = nla_nest_start(skb, DEVLINK_ATTR_DPIPE_TABLE_MATCHES); 1699 matches_attr = nla_nest_start_noflag(skb,
1700 DEVLINK_ATTR_DPIPE_TABLE_MATCHES);
1700 if (!matches_attr) 1701 if (!matches_attr)
1701 return -EMSGSIZE; 1702 return -EMSGSIZE;
1702 1703
@@ -1718,7 +1719,7 @@ int devlink_dpipe_action_put(struct sk_buff *skb,
1718 struct devlink_dpipe_field *field = &header->fields[action->field_id]; 1719 struct devlink_dpipe_field *field = &header->fields[action->field_id];
1719 struct nlattr *action_attr; 1720 struct nlattr *action_attr;
1720 1721
1721 action_attr = nla_nest_start(skb, DEVLINK_ATTR_DPIPE_ACTION); 1722 action_attr = nla_nest_start_noflag(skb, DEVLINK_ATTR_DPIPE_ACTION);
1722 if (!action_attr) 1723 if (!action_attr)
1723 return -EMSGSIZE; 1724 return -EMSGSIZE;
1724 1725
@@ -1743,7 +1744,8 @@ static int devlink_dpipe_actions_put(struct devlink_dpipe_table *table,
1743{ 1744{
1744 struct nlattr *actions_attr; 1745 struct nlattr *actions_attr;
1745 1746
1746 actions_attr = nla_nest_start(skb, DEVLINK_ATTR_DPIPE_TABLE_ACTIONS); 1747 actions_attr = nla_nest_start_noflag(skb,
1748 DEVLINK_ATTR_DPIPE_TABLE_ACTIONS);
1747 if (!actions_attr) 1749 if (!actions_attr)
1748 return -EMSGSIZE; 1750 return -EMSGSIZE;
1749 1751
@@ -1765,7 +1767,7 @@ static int devlink_dpipe_table_put(struct sk_buff *skb,
1765 u64 table_size; 1767 u64 table_size;
1766 1768
1767 table_size = table->table_ops->size_get(table->priv); 1769 table_size = table->table_ops->size_get(table->priv);
1768 table_attr = nla_nest_start(skb, DEVLINK_ATTR_DPIPE_TABLE); 1770 table_attr = nla_nest_start_noflag(skb, DEVLINK_ATTR_DPIPE_TABLE);
1769 if (!table_attr) 1771 if (!table_attr)
1770 return -EMSGSIZE; 1772 return -EMSGSIZE;
1771 1773
@@ -1845,7 +1847,7 @@ start_again:
1845 1847
1846 if (devlink_nl_put_handle(skb, devlink)) 1848 if (devlink_nl_put_handle(skb, devlink))
1847 goto nla_put_failure; 1849 goto nla_put_failure;
1848 tables_attr = nla_nest_start(skb, DEVLINK_ATTR_DPIPE_TABLES); 1850 tables_attr = nla_nest_start_noflag(skb, DEVLINK_ATTR_DPIPE_TABLES);
1849 if (!tables_attr) 1851 if (!tables_attr)
1850 goto nla_put_failure; 1852 goto nla_put_failure;
1851 1853
@@ -1946,8 +1948,8 @@ static int devlink_dpipe_action_values_put(struct sk_buff *skb,
1946 int err; 1948 int err;
1947 1949
1948 for (i = 0; i < values_count; i++) { 1950 for (i = 0; i < values_count; i++) {
1949 action_attr = nla_nest_start(skb, 1951 action_attr = nla_nest_start_noflag(skb,
1950 DEVLINK_ATTR_DPIPE_ACTION_VALUE); 1952 DEVLINK_ATTR_DPIPE_ACTION_VALUE);
1951 if (!action_attr) 1953 if (!action_attr)
1952 return -EMSGSIZE; 1954 return -EMSGSIZE;
1953 err = devlink_dpipe_action_value_put(skb, &values[i]); 1955 err = devlink_dpipe_action_value_put(skb, &values[i]);
@@ -1983,8 +1985,8 @@ static int devlink_dpipe_match_values_put(struct sk_buff *skb,
1983 int err; 1985 int err;
1984 1986
1985 for (i = 0; i < values_count; i++) { 1987 for (i = 0; i < values_count; i++) {
1986 match_attr = nla_nest_start(skb, 1988 match_attr = nla_nest_start_noflag(skb,
1987 DEVLINK_ATTR_DPIPE_MATCH_VALUE); 1989 DEVLINK_ATTR_DPIPE_MATCH_VALUE);
1988 if (!match_attr) 1990 if (!match_attr)
1989 return -EMSGSIZE; 1991 return -EMSGSIZE;
1990 err = devlink_dpipe_match_value_put(skb, &values[i]); 1992 err = devlink_dpipe_match_value_put(skb, &values[i]);
@@ -2005,7 +2007,7 @@ static int devlink_dpipe_entry_put(struct sk_buff *skb,
2005 struct nlattr *entry_attr, *matches_attr, *actions_attr; 2007 struct nlattr *entry_attr, *matches_attr, *actions_attr;
2006 int err; 2008 int err;
2007 2009
2008 entry_attr = nla_nest_start(skb, DEVLINK_ATTR_DPIPE_ENTRY); 2010 entry_attr = nla_nest_start_noflag(skb, DEVLINK_ATTR_DPIPE_ENTRY);
2009 if (!entry_attr) 2011 if (!entry_attr)
2010 return -EMSGSIZE; 2012 return -EMSGSIZE;
2011 2013
@@ -2017,8 +2019,8 @@ static int devlink_dpipe_entry_put(struct sk_buff *skb,
2017 entry->counter, DEVLINK_ATTR_PAD)) 2019 entry->counter, DEVLINK_ATTR_PAD))
2018 goto nla_put_failure; 2020 goto nla_put_failure;
2019 2021
2020 matches_attr = nla_nest_start(skb, 2022 matches_attr = nla_nest_start_noflag(skb,
2021 DEVLINK_ATTR_DPIPE_ENTRY_MATCH_VALUES); 2023 DEVLINK_ATTR_DPIPE_ENTRY_MATCH_VALUES);
2022 if (!matches_attr) 2024 if (!matches_attr)
2023 goto nla_put_failure; 2025 goto nla_put_failure;
2024 2026
@@ -2030,8 +2032,8 @@ static int devlink_dpipe_entry_put(struct sk_buff *skb,
2030 } 2032 }
2031 nla_nest_end(skb, matches_attr); 2033 nla_nest_end(skb, matches_attr);
2032 2034
2033 actions_attr = nla_nest_start(skb, 2035 actions_attr = nla_nest_start_noflag(skb,
2034 DEVLINK_ATTR_DPIPE_ENTRY_ACTION_VALUES); 2036 DEVLINK_ATTR_DPIPE_ENTRY_ACTION_VALUES);
2035 if (!actions_attr) 2037 if (!actions_attr)
2036 goto nla_put_failure; 2038 goto nla_put_failure;
2037 2039
@@ -2088,8 +2090,8 @@ int devlink_dpipe_entry_ctx_prepare(struct devlink_dpipe_dump_ctx *dump_ctx)
2088 devlink = dump_ctx->info->user_ptr[0]; 2090 devlink = dump_ctx->info->user_ptr[0];
2089 if (devlink_nl_put_handle(dump_ctx->skb, devlink)) 2091 if (devlink_nl_put_handle(dump_ctx->skb, devlink))
2090 goto nla_put_failure; 2092 goto nla_put_failure;
2091 dump_ctx->nest = nla_nest_start(dump_ctx->skb, 2093 dump_ctx->nest = nla_nest_start_noflag(dump_ctx->skb,
2092 DEVLINK_ATTR_DPIPE_ENTRIES); 2094 DEVLINK_ATTR_DPIPE_ENTRIES);
2093 if (!dump_ctx->nest) 2095 if (!dump_ctx->nest)
2094 goto nla_put_failure; 2096 goto nla_put_failure;
2095 return 0; 2097 return 0;
@@ -2199,7 +2201,8 @@ static int devlink_dpipe_fields_put(struct sk_buff *skb,
2199 2201
2200 for (i = 0; i < header->fields_count; i++) { 2202 for (i = 0; i < header->fields_count; i++) {
2201 field = &header->fields[i]; 2203 field = &header->fields[i];
2202 field_attr = nla_nest_start(skb, DEVLINK_ATTR_DPIPE_FIELD); 2204 field_attr = nla_nest_start_noflag(skb,
2205 DEVLINK_ATTR_DPIPE_FIELD);
2203 if (!field_attr) 2206 if (!field_attr)
2204 return -EMSGSIZE; 2207 return -EMSGSIZE;
2205 if (nla_put_string(skb, DEVLINK_ATTR_DPIPE_FIELD_NAME, field->name) || 2208 if (nla_put_string(skb, DEVLINK_ATTR_DPIPE_FIELD_NAME, field->name) ||
@@ -2222,7 +2225,7 @@ static int devlink_dpipe_header_put(struct sk_buff *skb,
2222 struct nlattr *fields_attr, *header_attr; 2225 struct nlattr *fields_attr, *header_attr;
2223 int err; 2226 int err;
2224 2227
2225 header_attr = nla_nest_start(skb, DEVLINK_ATTR_DPIPE_HEADER); 2228 header_attr = nla_nest_start_noflag(skb, DEVLINK_ATTR_DPIPE_HEADER);
2226 if (!header_attr) 2229 if (!header_attr)
2227 return -EMSGSIZE; 2230 return -EMSGSIZE;
2228 2231
@@ -2231,7 +2234,8 @@ static int devlink_dpipe_header_put(struct sk_buff *skb,
2231 nla_put_u8(skb, DEVLINK_ATTR_DPIPE_HEADER_GLOBAL, header->global)) 2234 nla_put_u8(skb, DEVLINK_ATTR_DPIPE_HEADER_GLOBAL, header->global))
2232 goto nla_put_failure; 2235 goto nla_put_failure;
2233 2236
2234 fields_attr = nla_nest_start(skb, DEVLINK_ATTR_DPIPE_HEADER_FIELDS); 2237 fields_attr = nla_nest_start_noflag(skb,
2238 DEVLINK_ATTR_DPIPE_HEADER_FIELDS);
2235 if (!fields_attr) 2239 if (!fields_attr)
2236 goto nla_put_failure; 2240 goto nla_put_failure;
2237 2241
@@ -2278,7 +2282,7 @@ start_again:
2278 2282
2279 if (devlink_nl_put_handle(skb, devlink)) 2283 if (devlink_nl_put_handle(skb, devlink))
2280 goto nla_put_failure; 2284 goto nla_put_failure;
2281 headers_attr = nla_nest_start(skb, DEVLINK_ATTR_DPIPE_HEADERS); 2285 headers_attr = nla_nest_start_noflag(skb, DEVLINK_ATTR_DPIPE_HEADERS);
2282 if (!headers_attr) 2286 if (!headers_attr)
2283 goto nla_put_failure; 2287 goto nla_put_failure;
2284 2288
@@ -2502,7 +2506,7 @@ static int devlink_resource_put(struct devlink *devlink, struct sk_buff *skb,
2502 struct nlattr *child_resource_attr; 2506 struct nlattr *child_resource_attr;
2503 struct nlattr *resource_attr; 2507 struct nlattr *resource_attr;
2504 2508
2505 resource_attr = nla_nest_start(skb, DEVLINK_ATTR_RESOURCE); 2509 resource_attr = nla_nest_start_noflag(skb, DEVLINK_ATTR_RESOURCE);
2506 if (!resource_attr) 2510 if (!resource_attr)
2507 return -EMSGSIZE; 2511 return -EMSGSIZE;
2508 2512
@@ -2526,7 +2530,8 @@ static int devlink_resource_put(struct devlink *devlink, struct sk_buff *skb,
2526 resource->size_valid)) 2530 resource->size_valid))
2527 goto nla_put_failure; 2531 goto nla_put_failure;
2528 2532
2529 child_resource_attr = nla_nest_start(skb, DEVLINK_ATTR_RESOURCE_LIST); 2533 child_resource_attr = nla_nest_start_noflag(skb,
2534 DEVLINK_ATTR_RESOURCE_LIST);
2530 if (!child_resource_attr) 2535 if (!child_resource_attr)
2531 goto nla_put_failure; 2536 goto nla_put_failure;
2532 2537
@@ -2577,7 +2582,8 @@ start_again:
2577 if (devlink_nl_put_handle(skb, devlink)) 2582 if (devlink_nl_put_handle(skb, devlink))
2578 goto nla_put_failure; 2583 goto nla_put_failure;
2579 2584
2580 resources_attr = nla_nest_start(skb, DEVLINK_ATTR_RESOURCE_LIST); 2585 resources_attr = nla_nest_start_noflag(skb,
2586 DEVLINK_ATTR_RESOURCE_LIST);
2581 if (!resources_attr) 2587 if (!resources_attr)
2582 goto nla_put_failure; 2588 goto nla_put_failure;
2583 2589
@@ -2831,7 +2837,8 @@ devlink_nl_param_value_fill_one(struct sk_buff *msg,
2831{ 2837{
2832 struct nlattr *param_value_attr; 2838 struct nlattr *param_value_attr;
2833 2839
2834 param_value_attr = nla_nest_start(msg, DEVLINK_ATTR_PARAM_VALUE); 2840 param_value_attr = nla_nest_start_noflag(msg,
2841 DEVLINK_ATTR_PARAM_VALUE);
2835 if (!param_value_attr) 2842 if (!param_value_attr)
2836 goto nla_put_failure; 2843 goto nla_put_failure;
2837 2844
@@ -2922,7 +2929,7 @@ static int devlink_nl_param_fill(struct sk_buff *msg, struct devlink *devlink,
2922 if (nla_put_u32(msg, DEVLINK_ATTR_PORT_INDEX, port_index)) 2929 if (nla_put_u32(msg, DEVLINK_ATTR_PORT_INDEX, port_index))
2923 goto genlmsg_cancel; 2930 goto genlmsg_cancel;
2924 2931
2925 param_attr = nla_nest_start(msg, DEVLINK_ATTR_PARAM); 2932 param_attr = nla_nest_start_noflag(msg, DEVLINK_ATTR_PARAM);
2926 if (!param_attr) 2933 if (!param_attr)
2927 goto genlmsg_cancel; 2934 goto genlmsg_cancel;
2928 if (nla_put_string(msg, DEVLINK_ATTR_PARAM_NAME, param->name)) 2935 if (nla_put_string(msg, DEVLINK_ATTR_PARAM_NAME, param->name))
@@ -2936,7 +2943,8 @@ static int devlink_nl_param_fill(struct sk_buff *msg, struct devlink *devlink,
2936 if (nla_put_u8(msg, DEVLINK_ATTR_PARAM_TYPE, nla_type)) 2943 if (nla_put_u8(msg, DEVLINK_ATTR_PARAM_TYPE, nla_type))
2937 goto param_nest_cancel; 2944 goto param_nest_cancel;
2938 2945
2939 param_values_list = nla_nest_start(msg, DEVLINK_ATTR_PARAM_VALUES_LIST); 2946 param_values_list = nla_nest_start_noflag(msg,
2947 DEVLINK_ATTR_PARAM_VALUES_LIST);
2940 if (!param_values_list) 2948 if (!param_values_list)
2941 goto param_nest_cancel; 2949 goto param_nest_cancel;
2942 2950
@@ -3336,7 +3344,7 @@ static int devlink_nl_region_snapshot_id_put(struct sk_buff *msg,
3336 struct nlattr *snap_attr; 3344 struct nlattr *snap_attr;
3337 int err; 3345 int err;
3338 3346
3339 snap_attr = nla_nest_start(msg, DEVLINK_ATTR_REGION_SNAPSHOT); 3347 snap_attr = nla_nest_start_noflag(msg, DEVLINK_ATTR_REGION_SNAPSHOT);
3340 if (!snap_attr) 3348 if (!snap_attr)
3341 return -EINVAL; 3349 return -EINVAL;
3342 3350
@@ -3360,7 +3368,8 @@ static int devlink_nl_region_snapshots_id_put(struct sk_buff *msg,
3360 struct nlattr *snapshots_attr; 3368 struct nlattr *snapshots_attr;
3361 int err; 3369 int err;
3362 3370
3363 snapshots_attr = nla_nest_start(msg, DEVLINK_ATTR_REGION_SNAPSHOTS); 3371 snapshots_attr = nla_nest_start_noflag(msg,
3372 DEVLINK_ATTR_REGION_SNAPSHOTS);
3364 if (!snapshots_attr) 3373 if (!snapshots_attr)
3365 return -EINVAL; 3374 return -EINVAL;
3366 3375
@@ -3576,7 +3585,7 @@ static int devlink_nl_cmd_region_read_chunk_fill(struct sk_buff *msg,
3576 struct nlattr *chunk_attr; 3585 struct nlattr *chunk_attr;
3577 int err; 3586 int err;
3578 3587
3579 chunk_attr = nla_nest_start(msg, DEVLINK_ATTR_REGION_CHUNK); 3588 chunk_attr = nla_nest_start_noflag(msg, DEVLINK_ATTR_REGION_CHUNK);
3580 if (!chunk_attr) 3589 if (!chunk_attr)
3581 return -EINVAL; 3590 return -EINVAL;
3582 3591
@@ -3709,7 +3718,7 @@ static int devlink_nl_cmd_region_read_dumpit(struct sk_buff *skb,
3709 if (err) 3718 if (err)
3710 goto nla_put_failure; 3719 goto nla_put_failure;
3711 3720
3712 chunks_attr = nla_nest_start(skb, DEVLINK_ATTR_REGION_CHUNKS); 3721 chunks_attr = nla_nest_start_noflag(skb, DEVLINK_ATTR_REGION_CHUNKS);
3713 if (!chunks_attr) { 3722 if (!chunks_attr) {
3714 err = -EMSGSIZE; 3723 err = -EMSGSIZE;
3715 goto nla_put_failure; 3724 goto nla_put_failure;
@@ -3785,7 +3794,7 @@ static int devlink_info_version_put(struct devlink_info_req *req, int attr,
3785 struct nlattr *nest; 3794 struct nlattr *nest;
3786 int err; 3795 int err;
3787 3796
3788 nest = nla_nest_start(req->msg, attr); 3797 nest = nla_nest_start_noflag(req->msg, attr);
3789 if (!nest) 3798 if (!nest)
3790 return -EMSGSIZE; 3799 return -EMSGSIZE;
3791 3800
@@ -4313,7 +4322,7 @@ devlink_fmsg_prepare_skb(struct devlink_fmsg *fmsg, struct sk_buff *skb,
4313 int i = 0; 4322 int i = 0;
4314 int err; 4323 int err;
4315 4324
4316 fmsg_nlattr = nla_nest_start(skb, DEVLINK_ATTR_FMSG); 4325 fmsg_nlattr = nla_nest_start_noflag(skb, DEVLINK_ATTR_FMSG);
4317 if (!fmsg_nlattr) 4326 if (!fmsg_nlattr)
4318 return -EMSGSIZE; 4327 return -EMSGSIZE;
4319 4328
@@ -4665,7 +4674,8 @@ devlink_nl_health_reporter_fill(struct sk_buff *msg,
4665 if (devlink_nl_put_handle(msg, devlink)) 4674 if (devlink_nl_put_handle(msg, devlink))
4666 goto genlmsg_cancel; 4675 goto genlmsg_cancel;
4667 4676
4668 reporter_attr = nla_nest_start(msg, DEVLINK_ATTR_HEALTH_REPORTER); 4677 reporter_attr = nla_nest_start_noflag(msg,
4678 DEVLINK_ATTR_HEALTH_REPORTER);
4669 if (!reporter_attr) 4679 if (!reporter_attr)
4670 goto genlmsg_cancel; 4680 goto genlmsg_cancel;
4671 if (nla_put_string(msg, DEVLINK_ATTR_HEALTH_REPORTER_NAME, 4681 if (nla_put_string(msg, DEVLINK_ATTR_HEALTH_REPORTER_NAME,
diff --git a/net/core/lwt_bpf.c b/net/core/lwt_bpf.c
index 3c5c24a5d9f5..bbdfc8db1960 100644
--- a/net/core/lwt_bpf.c
+++ b/net/core/lwt_bpf.c
@@ -453,7 +453,7 @@ static int bpf_fill_lwt_prog(struct sk_buff *skb, int attr,
453 if (!prog->prog) 453 if (!prog->prog)
454 return 0; 454 return 0;
455 455
456 nest = nla_nest_start(skb, attr); 456 nest = nla_nest_start_noflag(skb, attr);
457 if (!nest) 457 if (!nest)
458 return -EMSGSIZE; 458 return -EMSGSIZE;
459 459
diff --git a/net/core/lwtunnel.c b/net/core/lwtunnel.c
index 94749e0e2cfd..69e249fbc02f 100644
--- a/net/core/lwtunnel.c
+++ b/net/core/lwtunnel.c
@@ -237,7 +237,7 @@ int lwtunnel_fill_encap(struct sk_buff *skb, struct lwtunnel_state *lwtstate,
237 lwtstate->type > LWTUNNEL_ENCAP_MAX) 237 lwtstate->type > LWTUNNEL_ENCAP_MAX)
238 return 0; 238 return 0;
239 239
240 nest = nla_nest_start(skb, encap_attr); 240 nest = nla_nest_start_noflag(skb, encap_attr);
241 if (!nest) 241 if (!nest)
242 return -EMSGSIZE; 242 return -EMSGSIZE;
243 243
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 997cfa8f99ba..efd0b53d9ca4 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1979,7 +1979,7 @@ static int neightbl_fill_parms(struct sk_buff *skb, struct neigh_parms *parms)
1979{ 1979{
1980 struct nlattr *nest; 1980 struct nlattr *nest;
1981 1981
1982 nest = nla_nest_start(skb, NDTA_PARMS); 1982 nest = nla_nest_start_noflag(skb, NDTA_PARMS);
1983 if (nest == NULL) 1983 if (nest == NULL)
1984 return -ENOBUFS; 1984 return -ENOBUFS;
1985 1985
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 5fa5bf3e9945..8ad44b299e72 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -634,7 +634,7 @@ static int rtnl_link_slave_info_fill(struct sk_buff *skb,
634 if (nla_put_string(skb, IFLA_INFO_SLAVE_KIND, ops->kind) < 0) 634 if (nla_put_string(skb, IFLA_INFO_SLAVE_KIND, ops->kind) < 0)
635 return -EMSGSIZE; 635 return -EMSGSIZE;
636 if (ops->fill_slave_info) { 636 if (ops->fill_slave_info) {
637 slave_data = nla_nest_start(skb, IFLA_INFO_SLAVE_DATA); 637 slave_data = nla_nest_start_noflag(skb, IFLA_INFO_SLAVE_DATA);
638 if (!slave_data) 638 if (!slave_data)
639 return -EMSGSIZE; 639 return -EMSGSIZE;
640 err = ops->fill_slave_info(skb, master_dev, dev); 640 err = ops->fill_slave_info(skb, master_dev, dev);
@@ -666,7 +666,7 @@ static int rtnl_link_info_fill(struct sk_buff *skb,
666 return err; 666 return err;
667 } 667 }
668 if (ops->fill_info) { 668 if (ops->fill_info) {
669 data = nla_nest_start(skb, IFLA_INFO_DATA); 669 data = nla_nest_start_noflag(skb, IFLA_INFO_DATA);
670 if (data == NULL) 670 if (data == NULL)
671 return -EMSGSIZE; 671 return -EMSGSIZE;
672 err = ops->fill_info(skb, dev); 672 err = ops->fill_info(skb, dev);
@@ -686,7 +686,7 @@ static int rtnl_link_fill(struct sk_buff *skb, const struct net_device *dev)
686 struct nlattr *linkinfo; 686 struct nlattr *linkinfo;
687 int err = -EMSGSIZE; 687 int err = -EMSGSIZE;
688 688
689 linkinfo = nla_nest_start(skb, IFLA_LINKINFO); 689 linkinfo = nla_nest_start_noflag(skb, IFLA_LINKINFO);
690 if (linkinfo == NULL) 690 if (linkinfo == NULL)
691 goto out; 691 goto out;
692 692
@@ -755,7 +755,7 @@ int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics)
755 struct nlattr *mx; 755 struct nlattr *mx;
756 int i, valid = 0; 756 int i, valid = 0;
757 757
758 mx = nla_nest_start(skb, RTA_METRICS); 758 mx = nla_nest_start_noflag(skb, RTA_METRICS);
759 if (mx == NULL) 759 if (mx == NULL)
760 return -ENOBUFS; 760 return -ENOBUFS;
761 761
@@ -1036,12 +1036,12 @@ static int rtnl_vf_ports_fill(struct sk_buff *skb, struct net_device *dev)
1036 int vf; 1036 int vf;
1037 int err; 1037 int err;
1038 1038
1039 vf_ports = nla_nest_start(skb, IFLA_VF_PORTS); 1039 vf_ports = nla_nest_start_noflag(skb, IFLA_VF_PORTS);
1040 if (!vf_ports) 1040 if (!vf_ports)
1041 return -EMSGSIZE; 1041 return -EMSGSIZE;
1042 1042
1043 for (vf = 0; vf < dev_num_vf(dev->dev.parent); vf++) { 1043 for (vf = 0; vf < dev_num_vf(dev->dev.parent); vf++) {
1044 vf_port = nla_nest_start(skb, IFLA_VF_PORT); 1044 vf_port = nla_nest_start_noflag(skb, IFLA_VF_PORT);
1045 if (!vf_port) 1045 if (!vf_port)
1046 goto nla_put_failure; 1046 goto nla_put_failure;
1047 if (nla_put_u32(skb, IFLA_PORT_VF, vf)) 1047 if (nla_put_u32(skb, IFLA_PORT_VF, vf))
@@ -1070,7 +1070,7 @@ static int rtnl_port_self_fill(struct sk_buff *skb, struct net_device *dev)
1070 struct nlattr *port_self; 1070 struct nlattr *port_self;
1071 int err; 1071 int err;
1072 1072
1073 port_self = nla_nest_start(skb, IFLA_PORT_SELF); 1073 port_self = nla_nest_start_noflag(skb, IFLA_PORT_SELF);
1074 if (!port_self) 1074 if (!port_self)
1075 return -EMSGSIZE; 1075 return -EMSGSIZE;
1076 1076
@@ -1247,7 +1247,7 @@ static noinline_for_stack int rtnl_fill_vfinfo(struct sk_buff *skb,
1247 vf_linkstate.link_state = ivi.linkstate; 1247 vf_linkstate.link_state = ivi.linkstate;
1248 vf_rss_query_en.setting = ivi.rss_query_en; 1248 vf_rss_query_en.setting = ivi.rss_query_en;
1249 vf_trust.setting = ivi.trusted; 1249 vf_trust.setting = ivi.trusted;
1250 vf = nla_nest_start(skb, IFLA_VF_INFO); 1250 vf = nla_nest_start_noflag(skb, IFLA_VF_INFO);
1251 if (!vf) 1251 if (!vf)
1252 goto nla_put_vfinfo_failure; 1252 goto nla_put_vfinfo_failure;
1253 if (nla_put(skb, IFLA_VF_MAC, sizeof(vf_mac), &vf_mac) || 1253 if (nla_put(skb, IFLA_VF_MAC, sizeof(vf_mac), &vf_mac) ||
@@ -1266,7 +1266,7 @@ static noinline_for_stack int rtnl_fill_vfinfo(struct sk_buff *skb,
1266 nla_put(skb, IFLA_VF_TRUST, 1266 nla_put(skb, IFLA_VF_TRUST,
1267 sizeof(vf_trust), &vf_trust)) 1267 sizeof(vf_trust), &vf_trust))
1268 goto nla_put_vf_failure; 1268 goto nla_put_vf_failure;
1269 vfvlanlist = nla_nest_start(skb, IFLA_VF_VLAN_LIST); 1269 vfvlanlist = nla_nest_start_noflag(skb, IFLA_VF_VLAN_LIST);
1270 if (!vfvlanlist) 1270 if (!vfvlanlist)
1271 goto nla_put_vf_failure; 1271 goto nla_put_vf_failure;
1272 if (nla_put(skb, IFLA_VF_VLAN_INFO, sizeof(vf_vlan_info), 1272 if (nla_put(skb, IFLA_VF_VLAN_INFO, sizeof(vf_vlan_info),
@@ -1279,7 +1279,7 @@ static noinline_for_stack int rtnl_fill_vfinfo(struct sk_buff *skb,
1279 if (dev->netdev_ops->ndo_get_vf_stats) 1279 if (dev->netdev_ops->ndo_get_vf_stats)
1280 dev->netdev_ops->ndo_get_vf_stats(dev, vfs_num, 1280 dev->netdev_ops->ndo_get_vf_stats(dev, vfs_num,
1281 &vf_stats); 1281 &vf_stats);
1282 vfstats = nla_nest_start(skb, IFLA_VF_STATS); 1282 vfstats = nla_nest_start_noflag(skb, IFLA_VF_STATS);
1283 if (!vfstats) 1283 if (!vfstats)
1284 goto nla_put_vf_failure; 1284 goto nla_put_vf_failure;
1285 if (nla_put_u64_64bit(skb, IFLA_VF_STATS_RX_PACKETS, 1285 if (nla_put_u64_64bit(skb, IFLA_VF_STATS_RX_PACKETS,
@@ -1329,7 +1329,7 @@ static noinline_for_stack int rtnl_fill_vf(struct sk_buff *skb,
1329 if (!dev->netdev_ops->ndo_get_vf_config) 1329 if (!dev->netdev_ops->ndo_get_vf_config)
1330 return 0; 1330 return 0;
1331 1331
1332 vfinfo = nla_nest_start(skb, IFLA_VFINFO_LIST); 1332 vfinfo = nla_nest_start_noflag(skb, IFLA_VFINFO_LIST);
1333 if (!vfinfo) 1333 if (!vfinfo)
1334 return -EMSGSIZE; 1334 return -EMSGSIZE;
1335 1335
@@ -1414,7 +1414,7 @@ static int rtnl_xdp_fill(struct sk_buff *skb, struct net_device *dev)
1414 int err; 1414 int err;
1415 u8 mode; 1415 u8 mode;
1416 1416
1417 xdp = nla_nest_start(skb, IFLA_XDP); 1417 xdp = nla_nest_start_noflag(skb, IFLA_XDP);
1418 if (!xdp) 1418 if (!xdp)
1419 return -EMSGSIZE; 1419 return -EMSGSIZE;
1420 1420
@@ -1541,7 +1541,7 @@ static int rtnl_fill_link_af(struct sk_buff *skb,
1541 const struct rtnl_af_ops *af_ops; 1541 const struct rtnl_af_ops *af_ops;
1542 struct nlattr *af_spec; 1542 struct nlattr *af_spec;
1543 1543
1544 af_spec = nla_nest_start(skb, IFLA_AF_SPEC); 1544 af_spec = nla_nest_start_noflag(skb, IFLA_AF_SPEC);
1545 if (!af_spec) 1545 if (!af_spec)
1546 return -EMSGSIZE; 1546 return -EMSGSIZE;
1547 1547
@@ -1552,7 +1552,7 @@ static int rtnl_fill_link_af(struct sk_buff *skb,
1552 if (!af_ops->fill_link_af) 1552 if (!af_ops->fill_link_af)
1553 continue; 1553 continue;
1554 1554
1555 af = nla_nest_start(skb, af_ops->family); 1555 af = nla_nest_start_noflag(skb, af_ops->family);
1556 if (!af) 1556 if (!af)
1557 return -EMSGSIZE; 1557 return -EMSGSIZE;
1558 1558
@@ -4273,7 +4273,7 @@ int ndo_dflt_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
4273 nla_put_u32(skb, IFLA_LINK, dev_get_iflink(dev)))) 4273 nla_put_u32(skb, IFLA_LINK, dev_get_iflink(dev))))
4274 goto nla_put_failure; 4274 goto nla_put_failure;
4275 4275
4276 br_afspec = nla_nest_start(skb, IFLA_AF_SPEC); 4276 br_afspec = nla_nest_start_noflag(skb, IFLA_AF_SPEC);
4277 if (!br_afspec) 4277 if (!br_afspec)
4278 goto nla_put_failure; 4278 goto nla_put_failure;
4279 4279
@@ -4297,7 +4297,7 @@ int ndo_dflt_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
4297 } 4297 }
4298 nla_nest_end(skb, br_afspec); 4298 nla_nest_end(skb, br_afspec);
4299 4299
4300 protinfo = nla_nest_start(skb, IFLA_PROTINFO | NLA_F_NESTED); 4300 protinfo = nla_nest_start(skb, IFLA_PROTINFO);
4301 if (!protinfo) 4301 if (!protinfo)
4302 goto nla_put_failure; 4302 goto nla_put_failure;
4303 4303
@@ -4776,8 +4776,8 @@ static int rtnl_fill_statsinfo(struct sk_buff *skb, struct net_device *dev,
4776 4776
4777 if (ops && ops->fill_linkxstats) { 4777 if (ops && ops->fill_linkxstats) {
4778 *idxattr = IFLA_STATS_LINK_XSTATS; 4778 *idxattr = IFLA_STATS_LINK_XSTATS;
4779 attr = nla_nest_start(skb, 4779 attr = nla_nest_start_noflag(skb,
4780 IFLA_STATS_LINK_XSTATS); 4780 IFLA_STATS_LINK_XSTATS);
4781 if (!attr) 4781 if (!attr)
4782 goto nla_put_failure; 4782 goto nla_put_failure;
4783 4783
@@ -4799,8 +4799,8 @@ static int rtnl_fill_statsinfo(struct sk_buff *skb, struct net_device *dev,
4799 ops = master->rtnl_link_ops; 4799 ops = master->rtnl_link_ops;
4800 if (ops && ops->fill_linkxstats) { 4800 if (ops && ops->fill_linkxstats) {
4801 *idxattr = IFLA_STATS_LINK_XSTATS_SLAVE; 4801 *idxattr = IFLA_STATS_LINK_XSTATS_SLAVE;
4802 attr = nla_nest_start(skb, 4802 attr = nla_nest_start_noflag(skb,
4803 IFLA_STATS_LINK_XSTATS_SLAVE); 4803 IFLA_STATS_LINK_XSTATS_SLAVE);
4804 if (!attr) 4804 if (!attr)
4805 goto nla_put_failure; 4805 goto nla_put_failure;
4806 4806
@@ -4815,7 +4815,8 @@ static int rtnl_fill_statsinfo(struct sk_buff *skb, struct net_device *dev,
4815 if (stats_attr_valid(filter_mask, IFLA_STATS_LINK_OFFLOAD_XSTATS, 4815 if (stats_attr_valid(filter_mask, IFLA_STATS_LINK_OFFLOAD_XSTATS,
4816 *idxattr)) { 4816 *idxattr)) {
4817 *idxattr = IFLA_STATS_LINK_OFFLOAD_XSTATS; 4817 *idxattr = IFLA_STATS_LINK_OFFLOAD_XSTATS;
4818 attr = nla_nest_start(skb, IFLA_STATS_LINK_OFFLOAD_XSTATS); 4818 attr = nla_nest_start_noflag(skb,
4819 IFLA_STATS_LINK_OFFLOAD_XSTATS);
4819 if (!attr) 4820 if (!attr)
4820 goto nla_put_failure; 4821 goto nla_put_failure;
4821 4822
@@ -4834,7 +4835,7 @@ static int rtnl_fill_statsinfo(struct sk_buff *skb, struct net_device *dev,
4834 struct rtnl_af_ops *af_ops; 4835 struct rtnl_af_ops *af_ops;
4835 4836
4836 *idxattr = IFLA_STATS_AF_SPEC; 4837 *idxattr = IFLA_STATS_AF_SPEC;
4837 attr = nla_nest_start(skb, IFLA_STATS_AF_SPEC); 4838 attr = nla_nest_start_noflag(skb, IFLA_STATS_AF_SPEC);
4838 if (!attr) 4839 if (!attr)
4839 goto nla_put_failure; 4840 goto nla_put_failure;
4840 4841
@@ -4844,7 +4845,8 @@ static int rtnl_fill_statsinfo(struct sk_buff *skb, struct net_device *dev,
4844 struct nlattr *af; 4845 struct nlattr *af;
4845 int err; 4846 int err;
4846 4847
4847 af = nla_nest_start(skb, af_ops->family); 4848 af = nla_nest_start_noflag(skb,
4849 af_ops->family);
4848 if (!af) { 4850 if (!af) {
4849 rcu_read_unlock(); 4851 rcu_read_unlock();
4850 goto nla_put_failure; 4852 goto nla_put_failure;
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index a556cd708885..3fd3aa7348bd 100644
--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -246,7 +246,7 @@ static int dcbnl_getpfccfg(struct net_device *netdev, struct nlmsghdr *nlh,
246 if (ret) 246 if (ret)
247 return ret; 247 return ret;
248 248
249 nest = nla_nest_start(skb, DCB_ATTR_PFC_CFG); 249 nest = nla_nest_start_noflag(skb, DCB_ATTR_PFC_CFG);
250 if (!nest) 250 if (!nest)
251 return -EMSGSIZE; 251 return -EMSGSIZE;
252 252
@@ -304,7 +304,7 @@ static int dcbnl_getcap(struct net_device *netdev, struct nlmsghdr *nlh,
304 if (ret) 304 if (ret)
305 return ret; 305 return ret;
306 306
307 nest = nla_nest_start(skb, DCB_ATTR_CAP); 307 nest = nla_nest_start_noflag(skb, DCB_ATTR_CAP);
308 if (!nest) 308 if (!nest)
309 return -EMSGSIZE; 309 return -EMSGSIZE;
310 310
@@ -348,7 +348,7 @@ static int dcbnl_getnumtcs(struct net_device *netdev, struct nlmsghdr *nlh,
348 if (ret) 348 if (ret)
349 return ret; 349 return ret;
350 350
351 nest = nla_nest_start(skb, DCB_ATTR_NUMTCS); 351 nest = nla_nest_start_noflag(skb, DCB_ATTR_NUMTCS);
352 if (!nest) 352 if (!nest)
353 return -EMSGSIZE; 353 return -EMSGSIZE;
354 354
@@ -479,7 +479,7 @@ static int dcbnl_getapp(struct net_device *netdev, struct nlmsghdr *nlh,
479 up = dcb_getapp(netdev, &app); 479 up = dcb_getapp(netdev, &app);
480 } 480 }
481 481
482 app_nest = nla_nest_start(skb, DCB_ATTR_APP); 482 app_nest = nla_nest_start_noflag(skb, DCB_ATTR_APP);
483 if (!app_nest) 483 if (!app_nest)
484 return -EMSGSIZE; 484 return -EMSGSIZE;
485 485
@@ -578,7 +578,7 @@ static int __dcbnl_pg_getcfg(struct net_device *netdev, struct nlmsghdr *nlh,
578 if (ret) 578 if (ret)
579 return ret; 579 return ret;
580 580
581 pg_nest = nla_nest_start(skb, DCB_ATTR_PG_CFG); 581 pg_nest = nla_nest_start_noflag(skb, DCB_ATTR_PG_CFG);
582 if (!pg_nest) 582 if (!pg_nest)
583 return -EMSGSIZE; 583 return -EMSGSIZE;
584 584
@@ -598,7 +598,7 @@ static int __dcbnl_pg_getcfg(struct net_device *netdev, struct nlmsghdr *nlh,
598 if (ret) 598 if (ret)
599 goto err_pg; 599 goto err_pg;
600 600
601 param_nest = nla_nest_start(skb, i); 601 param_nest = nla_nest_start_noflag(skb, i);
602 if (!param_nest) 602 if (!param_nest)
603 goto err_pg; 603 goto err_pg;
604 604
@@ -889,7 +889,7 @@ static int dcbnl_bcn_getcfg(struct net_device *netdev, struct nlmsghdr *nlh,
889 if (ret) 889 if (ret)
890 return ret; 890 return ret;
891 891
892 bcn_nest = nla_nest_start(skb, DCB_ATTR_BCN); 892 bcn_nest = nla_nest_start_noflag(skb, DCB_ATTR_BCN);
893 if (!bcn_nest) 893 if (!bcn_nest)
894 return -EMSGSIZE; 894 return -EMSGSIZE;
895 895
@@ -1002,7 +1002,7 @@ static int dcbnl_build_peer_app(struct net_device *netdev, struct sk_buff* skb,
1002 */ 1002 */
1003 err = -EMSGSIZE; 1003 err = -EMSGSIZE;
1004 1004
1005 app = nla_nest_start(skb, app_nested_type); 1005 app = nla_nest_start_noflag(skb, app_nested_type);
1006 if (!app) 1006 if (!app)
1007 goto nla_put_failure; 1007 goto nla_put_failure;
1008 1008
@@ -1036,7 +1036,7 @@ static int dcbnl_ieee_fill(struct sk_buff *skb, struct net_device *netdev)
1036 if (nla_put_string(skb, DCB_ATTR_IFNAME, netdev->name)) 1036 if (nla_put_string(skb, DCB_ATTR_IFNAME, netdev->name))
1037 return -EMSGSIZE; 1037 return -EMSGSIZE;
1038 1038
1039 ieee = nla_nest_start(skb, DCB_ATTR_IEEE); 1039 ieee = nla_nest_start_noflag(skb, DCB_ATTR_IEEE);
1040 if (!ieee) 1040 if (!ieee)
1041 return -EMSGSIZE; 1041 return -EMSGSIZE;
1042 1042
@@ -1106,7 +1106,7 @@ static int dcbnl_ieee_fill(struct sk_buff *skb, struct net_device *netdev)
1106 return -EMSGSIZE; 1106 return -EMSGSIZE;
1107 } 1107 }
1108 1108
1109 app = nla_nest_start(skb, DCB_ATTR_IEEE_APP_TABLE); 1109 app = nla_nest_start_noflag(skb, DCB_ATTR_IEEE_APP_TABLE);
1110 if (!app) 1110 if (!app)
1111 return -EMSGSIZE; 1111 return -EMSGSIZE;
1112 1112
@@ -1174,13 +1174,13 @@ static int dcbnl_cee_pg_fill(struct sk_buff *skb, struct net_device *dev,
1174 u8 pgid, up_map, prio, tc_pct; 1174 u8 pgid, up_map, prio, tc_pct;
1175 const struct dcbnl_rtnl_ops *ops = dev->dcbnl_ops; 1175 const struct dcbnl_rtnl_ops *ops = dev->dcbnl_ops;
1176 int i = dir ? DCB_ATTR_CEE_TX_PG : DCB_ATTR_CEE_RX_PG; 1176 int i = dir ? DCB_ATTR_CEE_TX_PG : DCB_ATTR_CEE_RX_PG;
1177 struct nlattr *pg = nla_nest_start(skb, i); 1177 struct nlattr *pg = nla_nest_start_noflag(skb, i);
1178 1178
1179 if (!pg) 1179 if (!pg)
1180 return -EMSGSIZE; 1180 return -EMSGSIZE;
1181 1181
1182 for (i = DCB_PG_ATTR_TC_0; i <= DCB_PG_ATTR_TC_7; i++) { 1182 for (i = DCB_PG_ATTR_TC_0; i <= DCB_PG_ATTR_TC_7; i++) {
1183 struct nlattr *tc_nest = nla_nest_start(skb, i); 1183 struct nlattr *tc_nest = nla_nest_start_noflag(skb, i);
1184 1184
1185 if (!tc_nest) 1185 if (!tc_nest)
1186 return -EMSGSIZE; 1186 return -EMSGSIZE;
@@ -1231,7 +1231,7 @@ static int dcbnl_cee_fill(struct sk_buff *skb, struct net_device *netdev)
1231 1231
1232 if (nla_put_string(skb, DCB_ATTR_IFNAME, netdev->name)) 1232 if (nla_put_string(skb, DCB_ATTR_IFNAME, netdev->name))
1233 goto nla_put_failure; 1233 goto nla_put_failure;
1234 cee = nla_nest_start(skb, DCB_ATTR_CEE); 1234 cee = nla_nest_start_noflag(skb, DCB_ATTR_CEE);
1235 if (!cee) 1235 if (!cee)
1236 goto nla_put_failure; 1236 goto nla_put_failure;
1237 1237
@@ -1250,7 +1250,8 @@ static int dcbnl_cee_fill(struct sk_buff *skb, struct net_device *netdev)
1250 1250
1251 /* local pfc */ 1251 /* local pfc */
1252 if (ops->getpfccfg) { 1252 if (ops->getpfccfg) {
1253 struct nlattr *pfc_nest = nla_nest_start(skb, DCB_ATTR_CEE_PFC); 1253 struct nlattr *pfc_nest = nla_nest_start_noflag(skb,
1254 DCB_ATTR_CEE_PFC);
1254 1255
1255 if (!pfc_nest) 1256 if (!pfc_nest)
1256 goto nla_put_failure; 1257 goto nla_put_failure;
@@ -1265,14 +1266,14 @@ static int dcbnl_cee_fill(struct sk_buff *skb, struct net_device *netdev)
1265 1266
1266 /* local app */ 1267 /* local app */
1267 spin_lock_bh(&dcb_lock); 1268 spin_lock_bh(&dcb_lock);
1268 app = nla_nest_start(skb, DCB_ATTR_CEE_APP_TABLE); 1269 app = nla_nest_start_noflag(skb, DCB_ATTR_CEE_APP_TABLE);
1269 if (!app) 1270 if (!app)
1270 goto dcb_unlock; 1271 goto dcb_unlock;
1271 1272
1272 list_for_each_entry(itr, &dcb_app_list, list) { 1273 list_for_each_entry(itr, &dcb_app_list, list) {
1273 if (itr->ifindex == netdev->ifindex) { 1274 if (itr->ifindex == netdev->ifindex) {
1274 struct nlattr *app_nest = nla_nest_start(skb, 1275 struct nlattr *app_nest = nla_nest_start_noflag(skb,
1275 DCB_ATTR_APP); 1276 DCB_ATTR_APP);
1276 if (!app_nest) 1277 if (!app_nest)
1277 goto dcb_unlock; 1278 goto dcb_unlock;
1278 1279
@@ -1305,7 +1306,8 @@ static int dcbnl_cee_fill(struct sk_buff *skb, struct net_device *netdev)
1305 1306
1306 /* features flags */ 1307 /* features flags */
1307 if (ops->getfeatcfg) { 1308 if (ops->getfeatcfg) {
1308 struct nlattr *feat = nla_nest_start(skb, DCB_ATTR_CEE_FEAT); 1309 struct nlattr *feat = nla_nest_start_noflag(skb,
1310 DCB_ATTR_CEE_FEAT);
1309 if (!feat) 1311 if (!feat)
1310 goto nla_put_failure; 1312 goto nla_put_failure;
1311 1313
@@ -1607,7 +1609,7 @@ static int dcbnl_getfeatcfg(struct net_device *netdev, struct nlmsghdr *nlh,
1607 if (ret) 1609 if (ret)
1608 return ret; 1610 return ret;
1609 1611
1610 nest = nla_nest_start(skb, DCB_ATTR_FEATCFG); 1612 nest = nla_nest_start_noflag(skb, DCB_ATTR_FEATCFG);
1611 if (!nest) 1613 if (!nest)
1612 return -EMSGSIZE; 1614 return -EMSGSIZE;
1613 1615
diff --git a/net/decnet/dn_table.c b/net/decnet/dn_table.c
index f0710b5d037d..33fefb0aebca 100644
--- a/net/decnet/dn_table.c
+++ b/net/decnet/dn_table.c
@@ -348,7 +348,8 @@ static int dn_fib_dump_info(struct sk_buff *skb, u32 portid, u32 seq, int event,
348 struct rtnexthop *nhp; 348 struct rtnexthop *nhp;
349 struct nlattr *mp_head; 349 struct nlattr *mp_head;
350 350
351 if (!(mp_head = nla_nest_start(skb, RTA_MULTIPATH))) 351 mp_head = nla_nest_start_noflag(skb, RTA_MULTIPATH);
352 if (!mp_head)
352 goto errout; 353 goto errout;
353 354
354 for_nexthops(fi) { 355 for_nexthops(fi) {
diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c
index 308370cfd668..1a002eb85096 100644
--- a/net/ieee802154/nl802154.c
+++ b/net/ieee802154/nl802154.c
@@ -312,7 +312,7 @@ static inline void *nl802154hdr_put(struct sk_buff *skb, u32 portid, u32 seq,
312static int 312static int
313nl802154_put_flags(struct sk_buff *msg, int attr, u32 mask) 313nl802154_put_flags(struct sk_buff *msg, int attr, u32 mask)
314{ 314{
315 struct nlattr *nl_flags = nla_nest_start(msg, attr); 315 struct nlattr *nl_flags = nla_nest_start_noflag(msg, attr);
316 int i; 316 int i;
317 317
318 if (!nl_flags) 318 if (!nl_flags)
@@ -338,7 +338,7 @@ nl802154_send_wpan_phy_channels(struct cfg802154_registered_device *rdev,
338 struct nlattr *nl_page; 338 struct nlattr *nl_page;
339 unsigned long page; 339 unsigned long page;
340 340
341 nl_page = nla_nest_start(msg, NL802154_ATTR_CHANNELS_SUPPORTED); 341 nl_page = nla_nest_start_noflag(msg, NL802154_ATTR_CHANNELS_SUPPORTED);
342 if (!nl_page) 342 if (!nl_page)
343 return -ENOBUFS; 343 return -ENOBUFS;
344 344
@@ -360,11 +360,11 @@ nl802154_put_capabilities(struct sk_buff *msg,
360 struct nlattr *nl_caps, *nl_channels; 360 struct nlattr *nl_caps, *nl_channels;
361 int i; 361 int i;
362 362
363 nl_caps = nla_nest_start(msg, NL802154_ATTR_WPAN_PHY_CAPS); 363 nl_caps = nla_nest_start_noflag(msg, NL802154_ATTR_WPAN_PHY_CAPS);
364 if (!nl_caps) 364 if (!nl_caps)
365 return -ENOBUFS; 365 return -ENOBUFS;
366 366
367 nl_channels = nla_nest_start(msg, NL802154_CAP_ATTR_CHANNELS); 367 nl_channels = nla_nest_start_noflag(msg, NL802154_CAP_ATTR_CHANNELS);
368 if (!nl_channels) 368 if (!nl_channels)
369 return -ENOBUFS; 369 return -ENOBUFS;
370 370
@@ -380,8 +380,8 @@ nl802154_put_capabilities(struct sk_buff *msg,
380 if (rdev->wpan_phy.flags & WPAN_PHY_FLAG_CCA_ED_LEVEL) { 380 if (rdev->wpan_phy.flags & WPAN_PHY_FLAG_CCA_ED_LEVEL) {
381 struct nlattr *nl_ed_lvls; 381 struct nlattr *nl_ed_lvls;
382 382
383 nl_ed_lvls = nla_nest_start(msg, 383 nl_ed_lvls = nla_nest_start_noflag(msg,
384 NL802154_CAP_ATTR_CCA_ED_LEVELS); 384 NL802154_CAP_ATTR_CCA_ED_LEVELS);
385 if (!nl_ed_lvls) 385 if (!nl_ed_lvls)
386 return -ENOBUFS; 386 return -ENOBUFS;
387 387
@@ -396,7 +396,8 @@ nl802154_put_capabilities(struct sk_buff *msg,
396 if (rdev->wpan_phy.flags & WPAN_PHY_FLAG_TXPOWER) { 396 if (rdev->wpan_phy.flags & WPAN_PHY_FLAG_TXPOWER) {
397 struct nlattr *nl_tx_pwrs; 397 struct nlattr *nl_tx_pwrs;
398 398
399 nl_tx_pwrs = nla_nest_start(msg, NL802154_CAP_ATTR_TX_POWERS); 399 nl_tx_pwrs = nla_nest_start_noflag(msg,
400 NL802154_CAP_ATTR_TX_POWERS);
400 if (!nl_tx_pwrs) 401 if (!nl_tx_pwrs)
401 return -ENOBUFS; 402 return -ENOBUFS;
402 403
@@ -504,7 +505,7 @@ static int nl802154_send_wpan_phy(struct cfg802154_registered_device *rdev,
504 if (nl802154_put_capabilities(msg, rdev)) 505 if (nl802154_put_capabilities(msg, rdev))
505 goto nla_put_failure; 506 goto nla_put_failure;
506 507
507 nl_cmds = nla_nest_start(msg, NL802154_ATTR_SUPPORTED_COMMANDS); 508 nl_cmds = nla_nest_start_noflag(msg, NL802154_ATTR_SUPPORTED_COMMANDS);
508 if (!nl_cmds) 509 if (!nl_cmds)
509 goto nla_put_failure; 510 goto nla_put_failure;
510 511
@@ -693,7 +694,8 @@ ieee802154_llsec_send_key_id(struct sk_buff *msg,
693 694
694 switch (desc->mode) { 695 switch (desc->mode) {
695 case NL802154_KEY_ID_MODE_IMPLICIT: 696 case NL802154_KEY_ID_MODE_IMPLICIT:
696 nl_dev_addr = nla_nest_start(msg, NL802154_KEY_ID_ATTR_IMPLICIT); 697 nl_dev_addr = nla_nest_start_noflag(msg,
698 NL802154_KEY_ID_ATTR_IMPLICIT);
697 if (!nl_dev_addr) 699 if (!nl_dev_addr)
698 return -ENOBUFS; 700 return -ENOBUFS;
699 701
@@ -768,7 +770,7 @@ static int nl802154_get_llsec_params(struct sk_buff *msg,
768 params.frame_counter)) 770 params.frame_counter))
769 return -ENOBUFS; 771 return -ENOBUFS;
770 772
771 nl_key_id = nla_nest_start(msg, NL802154_ATTR_SEC_OUT_KEY_ID); 773 nl_key_id = nla_nest_start_noflag(msg, NL802154_ATTR_SEC_OUT_KEY_ID);
772 if (!nl_key_id) 774 if (!nl_key_id)
773 return -ENOBUFS; 775 return -ENOBUFS;
774 776
@@ -1455,11 +1457,11 @@ static int nl802154_send_key(struct sk_buff *msg, u32 cmd, u32 portid,
1455 if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex)) 1457 if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex))
1456 goto nla_put_failure; 1458 goto nla_put_failure;
1457 1459
1458 nl_key = nla_nest_start(msg, NL802154_ATTR_SEC_KEY); 1460 nl_key = nla_nest_start_noflag(msg, NL802154_ATTR_SEC_KEY);
1459 if (!nl_key) 1461 if (!nl_key)
1460 goto nla_put_failure; 1462 goto nla_put_failure;
1461 1463
1462 nl_key_id = nla_nest_start(msg, NL802154_KEY_ATTR_ID); 1464 nl_key_id = nla_nest_start_noflag(msg, NL802154_KEY_ATTR_ID);
1463 if (!nl_key_id) 1465 if (!nl_key_id)
1464 goto nla_put_failure; 1466 goto nla_put_failure;
1465 1467
@@ -1639,7 +1641,7 @@ static int nl802154_send_device(struct sk_buff *msg, u32 cmd, u32 portid,
1639 if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex)) 1641 if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex))
1640 goto nla_put_failure; 1642 goto nla_put_failure;
1641 1643
1642 nl_device = nla_nest_start(msg, NL802154_ATTR_SEC_DEVICE); 1644 nl_device = nla_nest_start_noflag(msg, NL802154_ATTR_SEC_DEVICE);
1643 if (!nl_device) 1645 if (!nl_device)
1644 goto nla_put_failure; 1646 goto nla_put_failure;
1645 1647
@@ -1808,7 +1810,7 @@ static int nl802154_send_devkey(struct sk_buff *msg, u32 cmd, u32 portid,
1808 if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex)) 1810 if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex))
1809 goto nla_put_failure; 1811 goto nla_put_failure;
1810 1812
1811 nl_devkey = nla_nest_start(msg, NL802154_ATTR_SEC_DEVKEY); 1813 nl_devkey = nla_nest_start_noflag(msg, NL802154_ATTR_SEC_DEVKEY);
1812 if (!nl_devkey) 1814 if (!nl_devkey)
1813 goto nla_put_failure; 1815 goto nla_put_failure;
1814 1816
@@ -1818,7 +1820,7 @@ static int nl802154_send_devkey(struct sk_buff *msg, u32 cmd, u32 portid,
1818 devkey->frame_counter)) 1820 devkey->frame_counter))
1819 goto nla_put_failure; 1821 goto nla_put_failure;
1820 1822
1821 nl_key_id = nla_nest_start(msg, NL802154_DEVKEY_ATTR_ID); 1823 nl_key_id = nla_nest_start_noflag(msg, NL802154_DEVKEY_ATTR_ID);
1822 if (!nl_key_id) 1824 if (!nl_key_id)
1823 goto nla_put_failure; 1825 goto nla_put_failure;
1824 1826
@@ -1976,7 +1978,7 @@ static int nl802154_send_seclevel(struct sk_buff *msg, u32 cmd, u32 portid,
1976 if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex)) 1978 if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex))
1977 goto nla_put_failure; 1979 goto nla_put_failure;
1978 1980
1979 nl_seclevel = nla_nest_start(msg, NL802154_ATTR_SEC_LEVEL); 1981 nl_seclevel = nla_nest_start_noflag(msg, NL802154_ATTR_SEC_LEVEL);
1980 if (!nl_seclevel) 1982 if (!nl_seclevel)
1981 goto nla_put_failure; 1983 goto nla_put_failure;
1982 1984
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index 4336f1ec8ab0..71c2165a2ce3 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -1550,7 +1550,7 @@ static int fib_add_multipath(struct sk_buff *skb, struct fib_info *fi)
1550{ 1550{
1551 struct nlattr *mp; 1551 struct nlattr *mp;
1552 1552
1553 mp = nla_nest_start(skb, RTA_MULTIPATH); 1553 mp = nla_nest_start_noflag(skb, RTA_MULTIPATH);
1554 if (!mp) 1554 if (!mp)
1555 goto nla_put_failure; 1555 goto nla_put_failure;
1556 1556
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index a8eb97777c0a..1322573b8228 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -2783,7 +2783,7 @@ static bool ipmr_fill_vif(struct mr_table *mrt, u32 vifid, struct sk_buff *skb)
2783 return true; 2783 return true;
2784 2784
2785 vif = &mrt->vif_table[vifid]; 2785 vif = &mrt->vif_table[vifid];
2786 vif_nest = nla_nest_start(skb, IPMRA_VIF); 2786 vif_nest = nla_nest_start_noflag(skb, IPMRA_VIF);
2787 if (!vif_nest) 2787 if (!vif_nest)
2788 return false; 2788 return false;
2789 if (nla_put_u32(skb, IPMRA_VIFA_IFINDEX, vif->dev->ifindex) || 2789 if (nla_put_u32(skb, IPMRA_VIFA_IFINDEX, vif->dev->ifindex) ||
@@ -2867,7 +2867,7 @@ static int ipmr_rtm_dumplink(struct sk_buff *skb, struct netlink_callback *cb)
2867 memset(hdr, 0, sizeof(*hdr)); 2867 memset(hdr, 0, sizeof(*hdr));
2868 hdr->ifi_family = RTNL_FAMILY_IPMR; 2868 hdr->ifi_family = RTNL_FAMILY_IPMR;
2869 2869
2870 af = nla_nest_start(skb, IFLA_AF_SPEC); 2870 af = nla_nest_start_noflag(skb, IFLA_AF_SPEC);
2871 if (!af) { 2871 if (!af) {
2872 nlmsg_cancel(skb, nlh); 2872 nlmsg_cancel(skb, nlh);
2873 goto out; 2873 goto out;
@@ -2878,7 +2878,7 @@ static int ipmr_rtm_dumplink(struct sk_buff *skb, struct netlink_callback *cb)
2878 goto out; 2878 goto out;
2879 } 2879 }
2880 2880
2881 vifs = nla_nest_start(skb, IPMRA_TABLE_VIFS); 2881 vifs = nla_nest_start_noflag(skb, IPMRA_TABLE_VIFS);
2882 if (!vifs) { 2882 if (!vifs) {
2883 nla_nest_end(skb, af); 2883 nla_nest_end(skb, af);
2884 nlmsg_end(skb, nlh); 2884 nlmsg_end(skb, nlh);
diff --git a/net/ipv4/ipmr_base.c b/net/ipv4/ipmr_base.c
index 3e614cc824f7..278834d4babc 100644
--- a/net/ipv4/ipmr_base.c
+++ b/net/ipv4/ipmr_base.c
@@ -228,7 +228,7 @@ int mr_fill_mroute(struct mr_table *mrt, struct sk_buff *skb,
228 if (c->mfc_flags & MFC_OFFLOAD) 228 if (c->mfc_flags & MFC_OFFLOAD)
229 rtm->rtm_flags |= RTNH_F_OFFLOAD; 229 rtm->rtm_flags |= RTNH_F_OFFLOAD;
230 230
231 mp_attr = nla_nest_start(skb, RTA_MULTIPATH); 231 mp_attr = nla_nest_start_noflag(skb, RTA_MULTIPATH);
232 if (!mp_attr) 232 if (!mp_attr)
233 return -EMSGSIZE; 233 return -EMSGSIZE;
234 234
diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c
index 4ccec4c705f7..9a08bfb0672c 100644
--- a/net/ipv4/tcp_metrics.c
+++ b/net/ipv4/tcp_metrics.c
@@ -658,7 +658,7 @@ static int tcp_metrics_fill_info(struct sk_buff *msg,
658 { 658 {
659 int n = 0; 659 int n = 0;
660 660
661 nest = nla_nest_start(msg, TCP_METRICS_ATTR_VALS); 661 nest = nla_nest_start_noflag(msg, TCP_METRICS_ATTR_VALS);
662 if (!nest) 662 if (!nest)
663 goto nla_put_failure; 663 goto nla_put_failure;
664 for (i = 0; i < TCP_METRIC_MAX_KERNEL + 1; i++) { 664 for (i = 0; i < TCP_METRIC_MAX_KERNEL + 1; i++) {
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 340a0f06f974..01f081aa718c 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -5752,7 +5752,7 @@ static int inet6_fill_ifinfo(struct sk_buff *skb, struct inet6_dev *idev,
5752 nla_put_u8(skb, IFLA_OPERSTATE, 5752 nla_put_u8(skb, IFLA_OPERSTATE,
5753 netif_running(dev) ? dev->operstate : IF_OPER_DOWN)) 5753 netif_running(dev) ? dev->operstate : IF_OPER_DOWN))
5754 goto nla_put_failure; 5754 goto nla_put_failure;
5755 protoinfo = nla_nest_start(skb, IFLA_PROTINFO); 5755 protoinfo = nla_nest_start_noflag(skb, IFLA_PROTINFO);
5756 if (!protoinfo) 5756 if (!protoinfo)
5757 goto nla_put_failure; 5757 goto nla_put_failure;
5758 5758
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 9c0127a44f9f..e2b47f47de92 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -4777,7 +4777,7 @@ static int rt6_fill_node(struct net *net, struct sk_buff *skb,
4777 struct fib6_info *sibling, *next_sibling; 4777 struct fib6_info *sibling, *next_sibling;
4778 struct nlattr *mp; 4778 struct nlattr *mp;
4779 4779
4780 mp = nla_nest_start(skb, RTA_MULTIPATH); 4780 mp = nla_nest_start_noflag(skb, RTA_MULTIPATH);
4781 if (!mp) 4781 if (!mp)
4782 goto nla_put_failure; 4782 goto nla_put_failure;
4783 4783
diff --git a/net/ipv6/seg6_local.c b/net/ipv6/seg6_local.c
index 60325dbfe88b..67005ac71341 100644
--- a/net/ipv6/seg6_local.c
+++ b/net/ipv6/seg6_local.c
@@ -853,7 +853,7 @@ static int put_nla_bpf(struct sk_buff *skb, struct seg6_local_lwt *slwt)
853 if (!slwt->bpf.prog) 853 if (!slwt->bpf.prog)
854 return 0; 854 return 0;
855 855
856 nest = nla_nest_start(skb, SEG6_LOCAL_BPF); 856 nest = nla_nest_start_noflag(skb, SEG6_LOCAL_BPF);
857 if (!nest) 857 if (!nest)
858 return -EMSGSIZE; 858 return -EMSGSIZE;
859 859
diff --git a/net/l2tp/l2tp_netlink.c b/net/l2tp/l2tp_netlink.c
index 77595fcc9f75..c31b50cc48d9 100644
--- a/net/l2tp/l2tp_netlink.c
+++ b/net/l2tp/l2tp_netlink.c
@@ -345,7 +345,7 @@ static int l2tp_nl_tunnel_send(struct sk_buff *skb, u32 portid, u32 seq, int fla
345 nla_put_u16(skb, L2TP_ATTR_ENCAP_TYPE, tunnel->encap)) 345 nla_put_u16(skb, L2TP_ATTR_ENCAP_TYPE, tunnel->encap))
346 goto nla_put_failure; 346 goto nla_put_failure;
347 347
348 nest = nla_nest_start(skb, L2TP_ATTR_STATS); 348 nest = nla_nest_start_noflag(skb, L2TP_ATTR_STATS);
349 if (nest == NULL) 349 if (nest == NULL)
350 goto nla_put_failure; 350 goto nla_put_failure;
351 351
@@ -742,7 +742,7 @@ static int l2tp_nl_session_send(struct sk_buff *skb, u32 portid, u32 seq, int fl
742 session->reorder_timeout, L2TP_ATTR_PAD))) 742 session->reorder_timeout, L2TP_ATTR_PAD)))
743 goto nla_put_failure; 743 goto nla_put_failure;
744 744
745 nest = nla_nest_start(skb, L2TP_ATTR_STATS); 745 nest = nla_nest_start_noflag(skb, L2TP_ATTR_STATS);
746 if (nest == NULL) 746 if (nest == NULL)
747 goto nla_put_failure; 747 goto nla_put_failure;
748 748
diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c
index e321a5fafb87..01f8a4f97872 100644
--- a/net/mpls/af_mpls.c
+++ b/net/mpls/af_mpls.c
@@ -2017,7 +2017,7 @@ static int mpls_dump_route(struct sk_buff *skb, u32 portid, u32 seq, int event,
2017 u8 linkdown = 0; 2017 u8 linkdown = 0;
2018 u8 dead = 0; 2018 u8 dead = 0;
2019 2019
2020 mp = nla_nest_start(skb, RTA_MULTIPATH); 2020 mp = nla_nest_start_noflag(skb, RTA_MULTIPATH);
2021 if (!mp) 2021 if (!mp)
2022 goto nla_put_failure; 2022 goto nla_put_failure;
2023 2023
diff --git a/net/ncsi/ncsi-netlink.c b/net/ncsi/ncsi-netlink.c
index 367b2f6513e0..672ed56b5ef0 100644
--- a/net/ncsi/ncsi-netlink.c
+++ b/net/ncsi/ncsi-netlink.c
@@ -79,7 +79,7 @@ static int ncsi_write_channel_info(struct sk_buff *skb,
79 nla_put_u32(skb, NCSI_CHANNEL_ATTR_VERSION_MINOR, nc->version.alpha2); 79 nla_put_u32(skb, NCSI_CHANNEL_ATTR_VERSION_MINOR, nc->version.alpha2);
80 nla_put_string(skb, NCSI_CHANNEL_ATTR_VERSION_STR, nc->version.fw_name); 80 nla_put_string(skb, NCSI_CHANNEL_ATTR_VERSION_STR, nc->version.fw_name);
81 81
82 vid_nest = nla_nest_start(skb, NCSI_CHANNEL_ATTR_VLAN_LIST); 82 vid_nest = nla_nest_start_noflag(skb, NCSI_CHANNEL_ATTR_VLAN_LIST);
83 if (!vid_nest) 83 if (!vid_nest)
84 return -ENOMEM; 84 return -ENOMEM;
85 ncf = &nc->vlan_filter; 85 ncf = &nc->vlan_filter;
@@ -113,19 +113,19 @@ static int ncsi_write_package_info(struct sk_buff *skb,
113 NCSI_FOR_EACH_PACKAGE(ndp, np) { 113 NCSI_FOR_EACH_PACKAGE(ndp, np) {
114 if (np->id != id) 114 if (np->id != id)
115 continue; 115 continue;
116 pnest = nla_nest_start(skb, NCSI_PKG_ATTR); 116 pnest = nla_nest_start_noflag(skb, NCSI_PKG_ATTR);
117 if (!pnest) 117 if (!pnest)
118 return -ENOMEM; 118 return -ENOMEM;
119 nla_put_u32(skb, NCSI_PKG_ATTR_ID, np->id); 119 nla_put_u32(skb, NCSI_PKG_ATTR_ID, np->id);
120 if ((0x1 << np->id) == ndp->package_whitelist) 120 if ((0x1 << np->id) == ndp->package_whitelist)
121 nla_put_flag(skb, NCSI_PKG_ATTR_FORCED); 121 nla_put_flag(skb, NCSI_PKG_ATTR_FORCED);
122 cnest = nla_nest_start(skb, NCSI_PKG_ATTR_CHANNEL_LIST); 122 cnest = nla_nest_start_noflag(skb, NCSI_PKG_ATTR_CHANNEL_LIST);
123 if (!cnest) { 123 if (!cnest) {
124 nla_nest_cancel(skb, pnest); 124 nla_nest_cancel(skb, pnest);
125 return -ENOMEM; 125 return -ENOMEM;
126 } 126 }
127 NCSI_FOR_EACH_CHANNEL(np, nc) { 127 NCSI_FOR_EACH_CHANNEL(np, nc) {
128 nest = nla_nest_start(skb, NCSI_CHANNEL_ATTR); 128 nest = nla_nest_start_noflag(skb, NCSI_CHANNEL_ATTR);
129 if (!nest) { 129 if (!nest) {
130 nla_nest_cancel(skb, cnest); 130 nla_nest_cancel(skb, cnest);
131 nla_nest_cancel(skb, pnest); 131 nla_nest_cancel(skb, pnest);
@@ -187,7 +187,7 @@ static int ncsi_pkg_info_nl(struct sk_buff *msg, struct genl_info *info)
187 187
188 package_id = nla_get_u32(info->attrs[NCSI_ATTR_PACKAGE_ID]); 188 package_id = nla_get_u32(info->attrs[NCSI_ATTR_PACKAGE_ID]);
189 189
190 attr = nla_nest_start(skb, NCSI_ATTR_PACKAGE_LIST); 190 attr = nla_nest_start_noflag(skb, NCSI_ATTR_PACKAGE_LIST);
191 if (!attr) { 191 if (!attr) {
192 kfree_skb(skb); 192 kfree_skb(skb);
193 return -EMSGSIZE; 193 return -EMSGSIZE;
@@ -250,7 +250,7 @@ static int ncsi_pkg_info_all_nl(struct sk_buff *skb,
250 goto err; 250 goto err;
251 } 251 }
252 252
253 attr = nla_nest_start(skb, NCSI_ATTR_PACKAGE_LIST); 253 attr = nla_nest_start_noflag(skb, NCSI_ATTR_PACKAGE_LIST);
254 if (!attr) { 254 if (!attr) {
255 rc = -EMSGSIZE; 255 rc = -EMSGSIZE;
256 goto err; 256 goto err;
diff --git a/net/netfilter/ipset/ip_set_bitmap_gen.h b/net/netfilter/ipset/ip_set_bitmap_gen.h
index 257ca393e6f2..38ef2ea838cb 100644
--- a/net/netfilter/ipset/ip_set_bitmap_gen.h
+++ b/net/netfilter/ipset/ip_set_bitmap_gen.h
@@ -99,7 +99,7 @@ mtype_head(struct ip_set *set, struct sk_buff *skb)
99 struct nlattr *nested; 99 struct nlattr *nested;
100 size_t memsize = mtype_memsize(map, set->dsize) + set->ext_size; 100 size_t memsize = mtype_memsize(map, set->dsize) + set->ext_size;
101 101
102 nested = ipset_nest_start(skb, IPSET_ATTR_DATA); 102 nested = nla_nest_start(skb, IPSET_ATTR_DATA);
103 if (!nested) 103 if (!nested)
104 goto nla_put_failure; 104 goto nla_put_failure;
105 if (mtype_do_head(skb, map) || 105 if (mtype_do_head(skb, map) ||
@@ -109,7 +109,7 @@ mtype_head(struct ip_set *set, struct sk_buff *skb)
109 goto nla_put_failure; 109 goto nla_put_failure;
110 if (unlikely(ip_set_put_flags(skb, set))) 110 if (unlikely(ip_set_put_flags(skb, set)))
111 goto nla_put_failure; 111 goto nla_put_failure;
112 ipset_nest_end(skb, nested); 112 nla_nest_end(skb, nested);
113 113
114 return 0; 114 return 0;
115nla_put_failure: 115nla_put_failure:
@@ -213,7 +213,7 @@ mtype_list(const struct ip_set *set,
213 u32 id, first = cb->args[IPSET_CB_ARG0]; 213 u32 id, first = cb->args[IPSET_CB_ARG0];
214 int ret = 0; 214 int ret = 0;
215 215
216 adt = ipset_nest_start(skb, IPSET_ATTR_ADT); 216 adt = nla_nest_start(skb, IPSET_ATTR_ADT);
217 if (!adt) 217 if (!adt)
218 return -EMSGSIZE; 218 return -EMSGSIZE;
219 /* Extensions may be replaced */ 219 /* Extensions may be replaced */
@@ -230,7 +230,7 @@ mtype_list(const struct ip_set *set,
230#endif 230#endif
231 ip_set_timeout_expired(ext_timeout(x, set)))) 231 ip_set_timeout_expired(ext_timeout(x, set))))
232 continue; 232 continue;
233 nested = ipset_nest_start(skb, IPSET_ATTR_DATA); 233 nested = nla_nest_start(skb, IPSET_ATTR_DATA);
234 if (!nested) { 234 if (!nested) {
235 if (id == first) { 235 if (id == first) {
236 nla_nest_cancel(skb, adt); 236 nla_nest_cancel(skb, adt);
@@ -244,9 +244,9 @@ mtype_list(const struct ip_set *set,
244 goto nla_put_failure; 244 goto nla_put_failure;
245 if (ip_set_put_extensions(skb, set, x, mtype_is_filled(x))) 245 if (ip_set_put_extensions(skb, set, x, mtype_is_filled(x)))
246 goto nla_put_failure; 246 goto nla_put_failure;
247 ipset_nest_end(skb, nested); 247 nla_nest_end(skb, nested);
248 } 248 }
249 ipset_nest_end(skb, adt); 249 nla_nest_end(skb, adt);
250 250
251 /* Set listing finished */ 251 /* Set listing finished */
252 cb->args[IPSET_CB_ARG0] = 0; 252 cb->args[IPSET_CB_ARG0] = 0;
@@ -259,7 +259,7 @@ nla_put_failure:
259 cb->args[IPSET_CB_ARG0] = 0; 259 cb->args[IPSET_CB_ARG0] = 0;
260 ret = -EMSGSIZE; 260 ret = -EMSGSIZE;
261 } 261 }
262 ipset_nest_end(skb, adt); 262 nla_nest_end(skb, adt);
263out: 263out:
264 rcu_read_unlock(); 264 rcu_read_unlock();
265 return ret; 265 return ret;
diff --git a/net/netfilter/ipset/ip_set_hash_gen.h b/net/netfilter/ipset/ip_set_hash_gen.h
index 2c9609929c71..01d51f775f12 100644
--- a/net/netfilter/ipset/ip_set_hash_gen.h
+++ b/net/netfilter/ipset/ip_set_hash_gen.h
@@ -1057,7 +1057,7 @@ mtype_head(struct ip_set *set, struct sk_buff *skb)
1057 htable_bits = t->htable_bits; 1057 htable_bits = t->htable_bits;
1058 rcu_read_unlock_bh(); 1058 rcu_read_unlock_bh();
1059 1059
1060 nested = ipset_nest_start(skb, IPSET_ATTR_DATA); 1060 nested = nla_nest_start(skb, IPSET_ATTR_DATA);
1061 if (!nested) 1061 if (!nested)
1062 goto nla_put_failure; 1062 goto nla_put_failure;
1063 if (nla_put_net32(skb, IPSET_ATTR_HASHSIZE, 1063 if (nla_put_net32(skb, IPSET_ATTR_HASHSIZE,
@@ -1079,7 +1079,7 @@ mtype_head(struct ip_set *set, struct sk_buff *skb)
1079 goto nla_put_failure; 1079 goto nla_put_failure;
1080 if (unlikely(ip_set_put_flags(skb, set))) 1080 if (unlikely(ip_set_put_flags(skb, set)))
1081 goto nla_put_failure; 1081 goto nla_put_failure;
1082 ipset_nest_end(skb, nested); 1082 nla_nest_end(skb, nested);
1083 1083
1084 return 0; 1084 return 0;
1085nla_put_failure: 1085nla_put_failure:
@@ -1124,7 +1124,7 @@ mtype_list(const struct ip_set *set,
1124 void *incomplete; 1124 void *incomplete;
1125 int i, ret = 0; 1125 int i, ret = 0;
1126 1126
1127 atd = ipset_nest_start(skb, IPSET_ATTR_ADT); 1127 atd = nla_nest_start(skb, IPSET_ATTR_ADT);
1128 if (!atd) 1128 if (!atd)
1129 return -EMSGSIZE; 1129 return -EMSGSIZE;
1130 1130
@@ -1150,7 +1150,7 @@ mtype_list(const struct ip_set *set,
1150 continue; 1150 continue;
1151 pr_debug("list hash %lu hbucket %p i %u, data %p\n", 1151 pr_debug("list hash %lu hbucket %p i %u, data %p\n",
1152 cb->args[IPSET_CB_ARG0], n, i, e); 1152 cb->args[IPSET_CB_ARG0], n, i, e);
1153 nested = ipset_nest_start(skb, IPSET_ATTR_DATA); 1153 nested = nla_nest_start(skb, IPSET_ATTR_DATA);
1154 if (!nested) { 1154 if (!nested) {
1155 if (cb->args[IPSET_CB_ARG0] == first) { 1155 if (cb->args[IPSET_CB_ARG0] == first) {
1156 nla_nest_cancel(skb, atd); 1156 nla_nest_cancel(skb, atd);
@@ -1163,10 +1163,10 @@ mtype_list(const struct ip_set *set,
1163 goto nla_put_failure; 1163 goto nla_put_failure;
1164 if (ip_set_put_extensions(skb, set, e, true)) 1164 if (ip_set_put_extensions(skb, set, e, true))
1165 goto nla_put_failure; 1165 goto nla_put_failure;
1166 ipset_nest_end(skb, nested); 1166 nla_nest_end(skb, nested);
1167 } 1167 }
1168 } 1168 }
1169 ipset_nest_end(skb, atd); 1169 nla_nest_end(skb, atd);
1170 /* Set listing finished */ 1170 /* Set listing finished */
1171 cb->args[IPSET_CB_ARG0] = 0; 1171 cb->args[IPSET_CB_ARG0] = 0;
1172 1172
@@ -1180,7 +1180,7 @@ nla_put_failure:
1180 cb->args[IPSET_CB_ARG0] = 0; 1180 cb->args[IPSET_CB_ARG0] = 0;
1181 ret = -EMSGSIZE; 1181 ret = -EMSGSIZE;
1182 } else { 1182 } else {
1183 ipset_nest_end(skb, atd); 1183 nla_nest_end(skb, atd);
1184 } 1184 }
1185out: 1185out:
1186 rcu_read_unlock(); 1186 rcu_read_unlock();
diff --git a/net/netfilter/ipset/ip_set_list_set.c b/net/netfilter/ipset/ip_set_list_set.c
index 8da228da53ae..4f894165cdcd 100644
--- a/net/netfilter/ipset/ip_set_list_set.c
+++ b/net/netfilter/ipset/ip_set_list_set.c
@@ -466,7 +466,7 @@ list_set_head(struct ip_set *set, struct sk_buff *skb)
466 struct nlattr *nested; 466 struct nlattr *nested;
467 size_t memsize = list_set_memsize(map, set->dsize) + set->ext_size; 467 size_t memsize = list_set_memsize(map, set->dsize) + set->ext_size;
468 468
469 nested = ipset_nest_start(skb, IPSET_ATTR_DATA); 469 nested = nla_nest_start(skb, IPSET_ATTR_DATA);
470 if (!nested) 470 if (!nested)
471 goto nla_put_failure; 471 goto nla_put_failure;
472 if (nla_put_net32(skb, IPSET_ATTR_SIZE, htonl(map->size)) || 472 if (nla_put_net32(skb, IPSET_ATTR_SIZE, htonl(map->size)) ||
@@ -476,7 +476,7 @@ list_set_head(struct ip_set *set, struct sk_buff *skb)
476 goto nla_put_failure; 476 goto nla_put_failure;
477 if (unlikely(ip_set_put_flags(skb, set))) 477 if (unlikely(ip_set_put_flags(skb, set)))
478 goto nla_put_failure; 478 goto nla_put_failure;
479 ipset_nest_end(skb, nested); 479 nla_nest_end(skb, nested);
480 480
481 return 0; 481 return 0;
482nla_put_failure: 482nla_put_failure:
@@ -494,7 +494,7 @@ list_set_list(const struct ip_set *set,
494 struct set_elem *e; 494 struct set_elem *e;
495 int ret = 0; 495 int ret = 0;
496 496
497 atd = ipset_nest_start(skb, IPSET_ATTR_ADT); 497 atd = nla_nest_start(skb, IPSET_ATTR_ADT);
498 if (!atd) 498 if (!atd)
499 return -EMSGSIZE; 499 return -EMSGSIZE;
500 500
@@ -506,7 +506,7 @@ list_set_list(const struct ip_set *set,
506 i++; 506 i++;
507 continue; 507 continue;
508 } 508 }
509 nested = ipset_nest_start(skb, IPSET_ATTR_DATA); 509 nested = nla_nest_start(skb, IPSET_ATTR_DATA);
510 if (!nested) 510 if (!nested)
511 goto nla_put_failure; 511 goto nla_put_failure;
512 ip_set_name_byindex(map->net, e->id, name); 512 ip_set_name_byindex(map->net, e->id, name);
@@ -514,11 +514,11 @@ list_set_list(const struct ip_set *set,
514 goto nla_put_failure; 514 goto nla_put_failure;
515 if (ip_set_put_extensions(skb, set, e, true)) 515 if (ip_set_put_extensions(skb, set, e, true))
516 goto nla_put_failure; 516 goto nla_put_failure;
517 ipset_nest_end(skb, nested); 517 nla_nest_end(skb, nested);
518 i++; 518 i++;
519 } 519 }
520 520
521 ipset_nest_end(skb, atd); 521 nla_nest_end(skb, atd);
522 /* Set listing finished */ 522 /* Set listing finished */
523 cb->args[IPSET_CB_ARG0] = 0; 523 cb->args[IPSET_CB_ARG0] = 0;
524 goto out; 524 goto out;
@@ -531,7 +531,7 @@ nla_put_failure:
531 ret = -EMSGSIZE; 531 ret = -EMSGSIZE;
532 } else { 532 } else {
533 cb->args[IPSET_CB_ARG0] = i; 533 cb->args[IPSET_CB_ARG0] = i;
534 ipset_nest_end(skb, atd); 534 nla_nest_end(skb, atd);
535 } 535 }
536out: 536out:
537 rcu_read_unlock(); 537 rcu_read_unlock();
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index ab119a7540db..39892e5d38a2 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -2916,7 +2916,7 @@ static const struct nla_policy ip_vs_dest_policy[IPVS_DEST_ATTR_MAX + 1] = {
2916static int ip_vs_genl_fill_stats(struct sk_buff *skb, int container_type, 2916static int ip_vs_genl_fill_stats(struct sk_buff *skb, int container_type,
2917 struct ip_vs_kstats *kstats) 2917 struct ip_vs_kstats *kstats)
2918{ 2918{
2919 struct nlattr *nl_stats = nla_nest_start(skb, container_type); 2919 struct nlattr *nl_stats = nla_nest_start_noflag(skb, container_type);
2920 2920
2921 if (!nl_stats) 2921 if (!nl_stats)
2922 return -EMSGSIZE; 2922 return -EMSGSIZE;
@@ -2946,7 +2946,7 @@ nla_put_failure:
2946static int ip_vs_genl_fill_stats64(struct sk_buff *skb, int container_type, 2946static int ip_vs_genl_fill_stats64(struct sk_buff *skb, int container_type,
2947 struct ip_vs_kstats *kstats) 2947 struct ip_vs_kstats *kstats)
2948{ 2948{
2949 struct nlattr *nl_stats = nla_nest_start(skb, container_type); 2949 struct nlattr *nl_stats = nla_nest_start_noflag(skb, container_type);
2950 2950
2951 if (!nl_stats) 2951 if (!nl_stats)
2952 return -EMSGSIZE; 2952 return -EMSGSIZE;
@@ -2992,7 +2992,7 @@ static int ip_vs_genl_fill_service(struct sk_buff *skb,
2992 struct ip_vs_kstats kstats; 2992 struct ip_vs_kstats kstats;
2993 char *sched_name; 2993 char *sched_name;
2994 2994
2995 nl_service = nla_nest_start(skb, IPVS_CMD_ATTR_SERVICE); 2995 nl_service = nla_nest_start_noflag(skb, IPVS_CMD_ATTR_SERVICE);
2996 if (!nl_service) 2996 if (!nl_service)
2997 return -EMSGSIZE; 2997 return -EMSGSIZE;
2998 2998
@@ -3203,7 +3203,7 @@ static int ip_vs_genl_fill_dest(struct sk_buff *skb, struct ip_vs_dest *dest)
3203 struct nlattr *nl_dest; 3203 struct nlattr *nl_dest;
3204 struct ip_vs_kstats kstats; 3204 struct ip_vs_kstats kstats;
3205 3205
3206 nl_dest = nla_nest_start(skb, IPVS_CMD_ATTR_DEST); 3206 nl_dest = nla_nest_start_noflag(skb, IPVS_CMD_ATTR_DEST);
3207 if (!nl_dest) 3207 if (!nl_dest)
3208 return -EMSGSIZE; 3208 return -EMSGSIZE;
3209 3209
@@ -3373,7 +3373,7 @@ static int ip_vs_genl_fill_daemon(struct sk_buff *skb, __u32 state,
3373{ 3373{
3374 struct nlattr *nl_daemon; 3374 struct nlattr *nl_daemon;
3375 3375
3376 nl_daemon = nla_nest_start(skb, IPVS_CMD_ATTR_DAEMON); 3376 nl_daemon = nla_nest_start_noflag(skb, IPVS_CMD_ATTR_DAEMON);
3377 if (!nl_daemon) 3377 if (!nl_daemon)
3378 return -EMSGSIZE; 3378 return -EMSGSIZE;
3379 3379
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
index d547a777192f..148b99a15b21 100644
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -63,7 +63,7 @@ static int ctnetlink_dump_tuples_proto(struct sk_buff *skb,
63 int ret = 0; 63 int ret = 0;
64 struct nlattr *nest_parms; 64 struct nlattr *nest_parms;
65 65
66 nest_parms = nla_nest_start(skb, CTA_TUPLE_PROTO | NLA_F_NESTED); 66 nest_parms = nla_nest_start(skb, CTA_TUPLE_PROTO);
67 if (!nest_parms) 67 if (!nest_parms)
68 goto nla_put_failure; 68 goto nla_put_failure;
69 if (nla_put_u8(skb, CTA_PROTO_NUM, tuple->dst.protonum)) 69 if (nla_put_u8(skb, CTA_PROTO_NUM, tuple->dst.protonum))
@@ -104,7 +104,7 @@ static int ctnetlink_dump_tuples_ip(struct sk_buff *skb,
104 int ret = 0; 104 int ret = 0;
105 struct nlattr *nest_parms; 105 struct nlattr *nest_parms;
106 106
107 nest_parms = nla_nest_start(skb, CTA_TUPLE_IP | NLA_F_NESTED); 107 nest_parms = nla_nest_start(skb, CTA_TUPLE_IP);
108 if (!nest_parms) 108 if (!nest_parms)
109 goto nla_put_failure; 109 goto nla_put_failure;
110 110
@@ -187,7 +187,7 @@ static int ctnetlink_dump_protoinfo(struct sk_buff *skb, struct nf_conn *ct)
187 if (!l4proto->to_nlattr) 187 if (!l4proto->to_nlattr)
188 return 0; 188 return 0;
189 189
190 nest_proto = nla_nest_start(skb, CTA_PROTOINFO | NLA_F_NESTED); 190 nest_proto = nla_nest_start(skb, CTA_PROTOINFO);
191 if (!nest_proto) 191 if (!nest_proto)
192 goto nla_put_failure; 192 goto nla_put_failure;
193 193
@@ -215,7 +215,7 @@ static int ctnetlink_dump_helpinfo(struct sk_buff *skb,
215 if (!helper) 215 if (!helper)
216 goto out; 216 goto out;
217 217
218 nest_helper = nla_nest_start(skb, CTA_HELP | NLA_F_NESTED); 218 nest_helper = nla_nest_start(skb, CTA_HELP);
219 if (!nest_helper) 219 if (!nest_helper)
220 goto nla_put_failure; 220 goto nla_put_failure;
221 if (nla_put_string(skb, CTA_HELP_NAME, helper->name)) 221 if (nla_put_string(skb, CTA_HELP_NAME, helper->name))
@@ -249,7 +249,7 @@ dump_counters(struct sk_buff *skb, struct nf_conn_acct *acct,
249 bytes = atomic64_read(&counter[dir].bytes); 249 bytes = atomic64_read(&counter[dir].bytes);
250 } 250 }
251 251
252 nest_count = nla_nest_start(skb, attr | NLA_F_NESTED); 252 nest_count = nla_nest_start(skb, attr);
253 if (!nest_count) 253 if (!nest_count)
254 goto nla_put_failure; 254 goto nla_put_failure;
255 255
@@ -293,7 +293,7 @@ ctnetlink_dump_timestamp(struct sk_buff *skb, const struct nf_conn *ct)
293 if (!tstamp) 293 if (!tstamp)
294 return 0; 294 return 0;
295 295
296 nest_count = nla_nest_start(skb, CTA_TIMESTAMP | NLA_F_NESTED); 296 nest_count = nla_nest_start(skb, CTA_TIMESTAMP);
297 if (!nest_count) 297 if (!nest_count)
298 goto nla_put_failure; 298 goto nla_put_failure;
299 299
@@ -337,7 +337,7 @@ static int ctnetlink_dump_secctx(struct sk_buff *skb, const struct nf_conn *ct)
337 return 0; 337 return 0;
338 338
339 ret = -1; 339 ret = -1;
340 nest_secctx = nla_nest_start(skb, CTA_SECCTX | NLA_F_NESTED); 340 nest_secctx = nla_nest_start(skb, CTA_SECCTX);
341 if (!nest_secctx) 341 if (!nest_secctx)
342 goto nla_put_failure; 342 goto nla_put_failure;
343 343
@@ -397,7 +397,7 @@ static int ctnetlink_dump_master(struct sk_buff *skb, const struct nf_conn *ct)
397 if (!(ct->status & IPS_EXPECTED)) 397 if (!(ct->status & IPS_EXPECTED))
398 return 0; 398 return 0;
399 399
400 nest_parms = nla_nest_start(skb, CTA_TUPLE_MASTER | NLA_F_NESTED); 400 nest_parms = nla_nest_start(skb, CTA_TUPLE_MASTER);
401 if (!nest_parms) 401 if (!nest_parms)
402 goto nla_put_failure; 402 goto nla_put_failure;
403 if (ctnetlink_dump_tuples(skb, master_tuple(ct)) < 0) 403 if (ctnetlink_dump_tuples(skb, master_tuple(ct)) < 0)
@@ -415,7 +415,7 @@ dump_ct_seq_adj(struct sk_buff *skb, const struct nf_ct_seqadj *seq, int type)
415{ 415{
416 struct nlattr *nest_parms; 416 struct nlattr *nest_parms;
417 417
418 nest_parms = nla_nest_start(skb, type | NLA_F_NESTED); 418 nest_parms = nla_nest_start(skb, type);
419 if (!nest_parms) 419 if (!nest_parms)
420 goto nla_put_failure; 420 goto nla_put_failure;
421 421
@@ -467,7 +467,7 @@ static int ctnetlink_dump_ct_synproxy(struct sk_buff *skb, struct nf_conn *ct)
467 if (!synproxy) 467 if (!synproxy)
468 return 0; 468 return 0;
469 469
470 nest_parms = nla_nest_start(skb, CTA_SYNPROXY | NLA_F_NESTED); 470 nest_parms = nla_nest_start(skb, CTA_SYNPROXY);
471 if (!nest_parms) 471 if (!nest_parms)
472 goto nla_put_failure; 472 goto nla_put_failure;
473 473
@@ -528,7 +528,7 @@ ctnetlink_fill_info(struct sk_buff *skb, u32 portid, u32 seq, u32 type,
528 528
529 zone = nf_ct_zone(ct); 529 zone = nf_ct_zone(ct);
530 530
531 nest_parms = nla_nest_start(skb, CTA_TUPLE_ORIG | NLA_F_NESTED); 531 nest_parms = nla_nest_start(skb, CTA_TUPLE_ORIG);
532 if (!nest_parms) 532 if (!nest_parms)
533 goto nla_put_failure; 533 goto nla_put_failure;
534 if (ctnetlink_dump_tuples(skb, nf_ct_tuple(ct, IP_CT_DIR_ORIGINAL)) < 0) 534 if (ctnetlink_dump_tuples(skb, nf_ct_tuple(ct, IP_CT_DIR_ORIGINAL)) < 0)
@@ -538,7 +538,7 @@ ctnetlink_fill_info(struct sk_buff *skb, u32 portid, u32 seq, u32 type,
538 goto nla_put_failure; 538 goto nla_put_failure;
539 nla_nest_end(skb, nest_parms); 539 nla_nest_end(skb, nest_parms);
540 540
541 nest_parms = nla_nest_start(skb, CTA_TUPLE_REPLY | NLA_F_NESTED); 541 nest_parms = nla_nest_start(skb, CTA_TUPLE_REPLY);
542 if (!nest_parms) 542 if (!nest_parms)
543 goto nla_put_failure; 543 goto nla_put_failure;
544 if (ctnetlink_dump_tuples(skb, nf_ct_tuple(ct, IP_CT_DIR_REPLY)) < 0) 544 if (ctnetlink_dump_tuples(skb, nf_ct_tuple(ct, IP_CT_DIR_REPLY)) < 0)
@@ -720,7 +720,7 @@ ctnetlink_conntrack_event(unsigned int events, struct nf_ct_event *item)
720 720
721 zone = nf_ct_zone(ct); 721 zone = nf_ct_zone(ct);
722 722
723 nest_parms = nla_nest_start(skb, CTA_TUPLE_ORIG | NLA_F_NESTED); 723 nest_parms = nla_nest_start(skb, CTA_TUPLE_ORIG);
724 if (!nest_parms) 724 if (!nest_parms)
725 goto nla_put_failure; 725 goto nla_put_failure;
726 if (ctnetlink_dump_tuples(skb, nf_ct_tuple(ct, IP_CT_DIR_ORIGINAL)) < 0) 726 if (ctnetlink_dump_tuples(skb, nf_ct_tuple(ct, IP_CT_DIR_ORIGINAL)) < 0)
@@ -730,7 +730,7 @@ ctnetlink_conntrack_event(unsigned int events, struct nf_ct_event *item)
730 goto nla_put_failure; 730 goto nla_put_failure;
731 nla_nest_end(skb, nest_parms); 731 nla_nest_end(skb, nest_parms);
732 732
733 nest_parms = nla_nest_start(skb, CTA_TUPLE_REPLY | NLA_F_NESTED); 733 nest_parms = nla_nest_start(skb, CTA_TUPLE_REPLY);
734 if (!nest_parms) 734 if (!nest_parms)
735 goto nla_put_failure; 735 goto nla_put_failure;
736 if (ctnetlink_dump_tuples(skb, nf_ct_tuple(ct, IP_CT_DIR_REPLY)) < 0) 736 if (ctnetlink_dump_tuples(skb, nf_ct_tuple(ct, IP_CT_DIR_REPLY)) < 0)
@@ -2400,7 +2400,7 @@ static int __ctnetlink_glue_build(struct sk_buff *skb, struct nf_conn *ct)
2400 2400
2401 zone = nf_ct_zone(ct); 2401 zone = nf_ct_zone(ct);
2402 2402
2403 nest_parms = nla_nest_start(skb, CTA_TUPLE_ORIG | NLA_F_NESTED); 2403 nest_parms = nla_nest_start(skb, CTA_TUPLE_ORIG);
2404 if (!nest_parms) 2404 if (!nest_parms)
2405 goto nla_put_failure; 2405 goto nla_put_failure;
2406 if (ctnetlink_dump_tuples(skb, nf_ct_tuple(ct, IP_CT_DIR_ORIGINAL)) < 0) 2406 if (ctnetlink_dump_tuples(skb, nf_ct_tuple(ct, IP_CT_DIR_ORIGINAL)) < 0)
@@ -2410,7 +2410,7 @@ static int __ctnetlink_glue_build(struct sk_buff *skb, struct nf_conn *ct)
2410 goto nla_put_failure; 2410 goto nla_put_failure;
2411 nla_nest_end(skb, nest_parms); 2411 nla_nest_end(skb, nest_parms);
2412 2412
2413 nest_parms = nla_nest_start(skb, CTA_TUPLE_REPLY | NLA_F_NESTED); 2413 nest_parms = nla_nest_start(skb, CTA_TUPLE_REPLY);
2414 if (!nest_parms) 2414 if (!nest_parms)
2415 goto nla_put_failure; 2415 goto nla_put_failure;
2416 if (ctnetlink_dump_tuples(skb, nf_ct_tuple(ct, IP_CT_DIR_REPLY)) < 0) 2416 if (ctnetlink_dump_tuples(skb, nf_ct_tuple(ct, IP_CT_DIR_REPLY)) < 0)
@@ -2472,7 +2472,7 @@ ctnetlink_glue_build(struct sk_buff *skb, struct nf_conn *ct,
2472{ 2472{
2473 struct nlattr *nest_parms; 2473 struct nlattr *nest_parms;
2474 2474
2475 nest_parms = nla_nest_start(skb, ct_attr | NLA_F_NESTED); 2475 nest_parms = nla_nest_start(skb, ct_attr);
2476 if (!nest_parms) 2476 if (!nest_parms)
2477 goto nla_put_failure; 2477 goto nla_put_failure;
2478 2478
@@ -2644,7 +2644,7 @@ static int ctnetlink_exp_dump_tuple(struct sk_buff *skb,
2644{ 2644{
2645 struct nlattr *nest_parms; 2645 struct nlattr *nest_parms;
2646 2646
2647 nest_parms = nla_nest_start(skb, type | NLA_F_NESTED); 2647 nest_parms = nla_nest_start(skb, type);
2648 if (!nest_parms) 2648 if (!nest_parms)
2649 goto nla_put_failure; 2649 goto nla_put_failure;
2650 if (ctnetlink_dump_tuples(skb, tuple) < 0) 2650 if (ctnetlink_dump_tuples(skb, tuple) < 0)
@@ -2671,7 +2671,7 @@ static int ctnetlink_exp_dump_mask(struct sk_buff *skb,
2671 m.src.u.all = mask->src.u.all; 2671 m.src.u.all = mask->src.u.all;
2672 m.dst.protonum = tuple->dst.protonum; 2672 m.dst.protonum = tuple->dst.protonum;
2673 2673
2674 nest_parms = nla_nest_start(skb, CTA_EXPECT_MASK | NLA_F_NESTED); 2674 nest_parms = nla_nest_start(skb, CTA_EXPECT_MASK);
2675 if (!nest_parms) 2675 if (!nest_parms)
2676 goto nla_put_failure; 2676 goto nla_put_failure;
2677 2677
@@ -2743,7 +2743,7 @@ ctnetlink_exp_dump_expect(struct sk_buff *skb,
2743#if IS_ENABLED(CONFIG_NF_NAT) 2743#if IS_ENABLED(CONFIG_NF_NAT)
2744 if (!nf_inet_addr_cmp(&exp->saved_addr, &any_addr) || 2744 if (!nf_inet_addr_cmp(&exp->saved_addr, &any_addr) ||
2745 exp->saved_proto.all) { 2745 exp->saved_proto.all) {
2746 nest_parms = nla_nest_start(skb, CTA_EXPECT_NAT | NLA_F_NESTED); 2746 nest_parms = nla_nest_start(skb, CTA_EXPECT_NAT);
2747 if (!nest_parms) 2747 if (!nest_parms)
2748 goto nla_put_failure; 2748 goto nla_put_failure;
2749 2749
diff --git a/net/netfilter/nf_conntrack_proto_dccp.c b/net/netfilter/nf_conntrack_proto_dccp.c
index 6fca80587505..a4deddebec0a 100644
--- a/net/netfilter/nf_conntrack_proto_dccp.c
+++ b/net/netfilter/nf_conntrack_proto_dccp.c
@@ -598,7 +598,7 @@ static int dccp_to_nlattr(struct sk_buff *skb, struct nlattr *nla,
598 struct nlattr *nest_parms; 598 struct nlattr *nest_parms;
599 599
600 spin_lock_bh(&ct->lock); 600 spin_lock_bh(&ct->lock);
601 nest_parms = nla_nest_start(skb, CTA_PROTOINFO_DCCP | NLA_F_NESTED); 601 nest_parms = nla_nest_start(skb, CTA_PROTOINFO_DCCP);
602 if (!nest_parms) 602 if (!nest_parms)
603 goto nla_put_failure; 603 goto nla_put_failure;
604 if (nla_put_u8(skb, CTA_PROTOINFO_DCCP_STATE, ct->proto.dccp.state) || 604 if (nla_put_u8(skb, CTA_PROTOINFO_DCCP_STATE, ct->proto.dccp.state) ||
diff --git a/net/netfilter/nf_conntrack_proto_sctp.c b/net/netfilter/nf_conntrack_proto_sctp.c
index a7818101ad80..8cf36b684400 100644
--- a/net/netfilter/nf_conntrack_proto_sctp.c
+++ b/net/netfilter/nf_conntrack_proto_sctp.c
@@ -520,7 +520,7 @@ static int sctp_to_nlattr(struct sk_buff *skb, struct nlattr *nla,
520 struct nlattr *nest_parms; 520 struct nlattr *nest_parms;
521 521
522 spin_lock_bh(&ct->lock); 522 spin_lock_bh(&ct->lock);
523 nest_parms = nla_nest_start(skb, CTA_PROTOINFO_SCTP | NLA_F_NESTED); 523 nest_parms = nla_nest_start(skb, CTA_PROTOINFO_SCTP);
524 if (!nest_parms) 524 if (!nest_parms)
525 goto nla_put_failure; 525 goto nla_put_failure;
526 526
diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c
index a06875a466a4..ec6c3618333d 100644
--- a/net/netfilter/nf_conntrack_proto_tcp.c
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
@@ -1192,7 +1192,7 @@ static int tcp_to_nlattr(struct sk_buff *skb, struct nlattr *nla,
1192 struct nf_ct_tcp_flags tmp = {}; 1192 struct nf_ct_tcp_flags tmp = {};
1193 1193
1194 spin_lock_bh(&ct->lock); 1194 spin_lock_bh(&ct->lock);
1195 nest_parms = nla_nest_start(skb, CTA_PROTOINFO_TCP | NLA_F_NESTED); 1195 nest_parms = nla_nest_start(skb, CTA_PROTOINFO_TCP);
1196 if (!nest_parms) 1196 if (!nest_parms)
1197 goto nla_put_failure; 1197 goto nla_put_failure;
1198 1198
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 9d888dc6be38..2b79c250ecb4 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -1200,7 +1200,7 @@ static int nft_dump_stats(struct sk_buff *skb, struct nft_stats __percpu *stats)
1200 total.pkts += pkts; 1200 total.pkts += pkts;
1201 total.bytes += bytes; 1201 total.bytes += bytes;
1202 } 1202 }
1203 nest = nla_nest_start(skb, NFTA_CHAIN_COUNTERS); 1203 nest = nla_nest_start_noflag(skb, NFTA_CHAIN_COUNTERS);
1204 if (nest == NULL) 1204 if (nest == NULL)
1205 goto nla_put_failure; 1205 goto nla_put_failure;
1206 1206
@@ -1248,7 +1248,7 @@ static int nf_tables_fill_chain_info(struct sk_buff *skb, struct net *net,
1248 const struct nf_hook_ops *ops = &basechain->ops; 1248 const struct nf_hook_ops *ops = &basechain->ops;
1249 struct nlattr *nest; 1249 struct nlattr *nest;
1250 1250
1251 nest = nla_nest_start(skb, NFTA_CHAIN_HOOK); 1251 nest = nla_nest_start_noflag(skb, NFTA_CHAIN_HOOK);
1252 if (nest == NULL) 1252 if (nest == NULL)
1253 goto nla_put_failure; 1253 goto nla_put_failure;
1254 if (nla_put_be32(skb, NFTA_HOOK_HOOKNUM, htonl(ops->hooknum))) 1254 if (nla_put_be32(skb, NFTA_HOOK_HOOKNUM, htonl(ops->hooknum)))
@@ -2059,7 +2059,8 @@ static int nf_tables_fill_expr_info(struct sk_buff *skb,
2059 goto nla_put_failure; 2059 goto nla_put_failure;
2060 2060
2061 if (expr->ops->dump) { 2061 if (expr->ops->dump) {
2062 struct nlattr *data = nla_nest_start(skb, NFTA_EXPR_DATA); 2062 struct nlattr *data = nla_nest_start_noflag(skb,
2063 NFTA_EXPR_DATA);
2063 if (data == NULL) 2064 if (data == NULL)
2064 goto nla_put_failure; 2065 goto nla_put_failure;
2065 if (expr->ops->dump(skb, expr) < 0) 2066 if (expr->ops->dump(skb, expr) < 0)
@@ -2078,7 +2079,7 @@ int nft_expr_dump(struct sk_buff *skb, unsigned int attr,
2078{ 2079{
2079 struct nlattr *nest; 2080 struct nlattr *nest;
2080 2081
2081 nest = nla_nest_start(skb, attr); 2082 nest = nla_nest_start_noflag(skb, attr);
2082 if (!nest) 2083 if (!nest)
2083 goto nla_put_failure; 2084 goto nla_put_failure;
2084 if (nf_tables_fill_expr_info(skb, expr) < 0) 2085 if (nf_tables_fill_expr_info(skb, expr) < 0)
@@ -2289,7 +2290,7 @@ static int nf_tables_fill_rule_info(struct sk_buff *skb, struct net *net,
2289 goto nla_put_failure; 2290 goto nla_put_failure;
2290 } 2291 }
2291 2292
2292 list = nla_nest_start(skb, NFTA_RULE_EXPRESSIONS); 2293 list = nla_nest_start_noflag(skb, NFTA_RULE_EXPRESSIONS);
2293 if (list == NULL) 2294 if (list == NULL)
2294 goto nla_put_failure; 2295 goto nla_put_failure;
2295 nft_rule_for_each_expr(expr, next, rule) { 2296 nft_rule_for_each_expr(expr, next, rule) {
@@ -3258,7 +3259,7 @@ static int nf_tables_fill_set(struct sk_buff *skb, const struct nft_ctx *ctx,
3258 if (nla_put(skb, NFTA_SET_USERDATA, set->udlen, set->udata)) 3259 if (nla_put(skb, NFTA_SET_USERDATA, set->udlen, set->udata))
3259 goto nla_put_failure; 3260 goto nla_put_failure;
3260 3261
3261 desc = nla_nest_start(skb, NFTA_SET_DESC); 3262 desc = nla_nest_start_noflag(skb, NFTA_SET_DESC);
3262 if (desc == NULL) 3263 if (desc == NULL)
3263 goto nla_put_failure; 3264 goto nla_put_failure;
3264 if (set->size && 3265 if (set->size &&
@@ -3908,7 +3909,7 @@ static int nf_tables_fill_setelem(struct sk_buff *skb,
3908 unsigned char *b = skb_tail_pointer(skb); 3909 unsigned char *b = skb_tail_pointer(skb);
3909 struct nlattr *nest; 3910 struct nlattr *nest;
3910 3911
3911 nest = nla_nest_start(skb, NFTA_LIST_ELEM); 3912 nest = nla_nest_start_noflag(skb, NFTA_LIST_ELEM);
3912 if (nest == NULL) 3913 if (nest == NULL)
3913 goto nla_put_failure; 3914 goto nla_put_failure;
3914 3915
@@ -4052,7 +4053,7 @@ static int nf_tables_dump_set(struct sk_buff *skb, struct netlink_callback *cb)
4052 if (nla_put_string(skb, NFTA_SET_ELEM_LIST_SET, set->name)) 4053 if (nla_put_string(skb, NFTA_SET_ELEM_LIST_SET, set->name))
4053 goto nla_put_failure; 4054 goto nla_put_failure;
4054 4055
4055 nest = nla_nest_start(skb, NFTA_SET_ELEM_LIST_ELEMENTS); 4056 nest = nla_nest_start_noflag(skb, NFTA_SET_ELEM_LIST_ELEMENTS);
4056 if (nest == NULL) 4057 if (nest == NULL)
4057 goto nla_put_failure; 4058 goto nla_put_failure;
4058 4059
@@ -4124,7 +4125,7 @@ static int nf_tables_fill_setelem_info(struct sk_buff *skb,
4124 if (nla_put_string(skb, NFTA_SET_NAME, set->name)) 4125 if (nla_put_string(skb, NFTA_SET_NAME, set->name))
4125 goto nla_put_failure; 4126 goto nla_put_failure;
4126 4127
4127 nest = nla_nest_start(skb, NFTA_SET_ELEM_LIST_ELEMENTS); 4128 nest = nla_nest_start_noflag(skb, NFTA_SET_ELEM_LIST_ELEMENTS);
4128 if (nest == NULL) 4129 if (nest == NULL)
4129 goto nla_put_failure; 4130 goto nla_put_failure;
4130 4131
@@ -5014,7 +5015,7 @@ static int nft_object_dump(struct sk_buff *skb, unsigned int attr,
5014{ 5015{
5015 struct nlattr *nest; 5016 struct nlattr *nest;
5016 5017
5017 nest = nla_nest_start(skb, attr); 5018 nest = nla_nest_start_noflag(skb, attr);
5018 if (!nest) 5019 if (!nest)
5019 goto nla_put_failure; 5020 goto nla_put_failure;
5020 if (obj->ops->dump(skb, obj, reset) < 0) 5021 if (obj->ops->dump(skb, obj, reset) < 0)
@@ -5831,14 +5832,14 @@ static int nf_tables_fill_flowtable_info(struct sk_buff *skb, struct net *net,
5831 NFTA_FLOWTABLE_PAD)) 5832 NFTA_FLOWTABLE_PAD))
5832 goto nla_put_failure; 5833 goto nla_put_failure;
5833 5834
5834 nest = nla_nest_start(skb, NFTA_FLOWTABLE_HOOK); 5835 nest = nla_nest_start_noflag(skb, NFTA_FLOWTABLE_HOOK);
5835 if (!nest) 5836 if (!nest)
5836 goto nla_put_failure; 5837 goto nla_put_failure;
5837 if (nla_put_be32(skb, NFTA_FLOWTABLE_HOOK_NUM, htonl(flowtable->hooknum)) || 5838 if (nla_put_be32(skb, NFTA_FLOWTABLE_HOOK_NUM, htonl(flowtable->hooknum)) ||
5838 nla_put_be32(skb, NFTA_FLOWTABLE_HOOK_PRIORITY, htonl(flowtable->priority))) 5839 nla_put_be32(skb, NFTA_FLOWTABLE_HOOK_PRIORITY, htonl(flowtable->priority)))
5839 goto nla_put_failure; 5840 goto nla_put_failure;
5840 5841
5841 nest_devs = nla_nest_start(skb, NFTA_FLOWTABLE_HOOK_DEVS); 5842 nest_devs = nla_nest_start_noflag(skb, NFTA_FLOWTABLE_HOOK_DEVS);
5842 if (!nest_devs) 5843 if (!nest_devs)
5843 goto nla_put_failure; 5844 goto nla_put_failure;
5844 5845
@@ -7264,7 +7265,7 @@ int nft_verdict_dump(struct sk_buff *skb, int type, const struct nft_verdict *v)
7264{ 7265{
7265 struct nlattr *nest; 7266 struct nlattr *nest;
7266 7267
7267 nest = nla_nest_start(skb, type); 7268 nest = nla_nest_start_noflag(skb, type);
7268 if (!nest) 7269 if (!nest)
7269 goto nla_put_failure; 7270 goto nla_put_failure;
7270 7271
@@ -7377,7 +7378,7 @@ int nft_data_dump(struct sk_buff *skb, int attr, const struct nft_data *data,
7377 struct nlattr *nest; 7378 struct nlattr *nest;
7378 int err; 7379 int err;
7379 7380
7380 nest = nla_nest_start(skb, attr); 7381 nest = nla_nest_start_noflag(skb, attr);
7381 if (nest == NULL) 7382 if (nest == NULL)
7382 return -1; 7383 return -1;
7383 7384
diff --git a/net/netfilter/nfnetlink_cthelper.c b/net/netfilter/nfnetlink_cthelper.c
index e5d27b2e4eba..74c9794d28d6 100644
--- a/net/netfilter/nfnetlink_cthelper.c
+++ b/net/netfilter/nfnetlink_cthelper.c
@@ -462,7 +462,7 @@ nfnl_cthelper_dump_tuple(struct sk_buff *skb,
462{ 462{
463 struct nlattr *nest_parms; 463 struct nlattr *nest_parms;
464 464
465 nest_parms = nla_nest_start(skb, NFCTH_TUPLE | NLA_F_NESTED); 465 nest_parms = nla_nest_start(skb, NFCTH_TUPLE);
466 if (nest_parms == NULL) 466 if (nest_parms == NULL)
467 goto nla_put_failure; 467 goto nla_put_failure;
468 468
@@ -487,7 +487,7 @@ nfnl_cthelper_dump_policy(struct sk_buff *skb,
487 int i; 487 int i;
488 struct nlattr *nest_parms1, *nest_parms2; 488 struct nlattr *nest_parms1, *nest_parms2;
489 489
490 nest_parms1 = nla_nest_start(skb, NFCTH_POLICY | NLA_F_NESTED); 490 nest_parms1 = nla_nest_start(skb, NFCTH_POLICY);
491 if (nest_parms1 == NULL) 491 if (nest_parms1 == NULL)
492 goto nla_put_failure; 492 goto nla_put_failure;
493 493
@@ -496,8 +496,7 @@ nfnl_cthelper_dump_policy(struct sk_buff *skb,
496 goto nla_put_failure; 496 goto nla_put_failure;
497 497
498 for (i = 0; i < helper->expect_class_max + 1; i++) { 498 for (i = 0; i < helper->expect_class_max + 1; i++) {
499 nest_parms2 = nla_nest_start(skb, 499 nest_parms2 = nla_nest_start(skb, (NFCTH_POLICY_SET + i));
500 (NFCTH_POLICY_SET+i) | NLA_F_NESTED);
501 if (nest_parms2 == NULL) 500 if (nest_parms2 == NULL)
502 goto nla_put_failure; 501 goto nla_put_failure;
503 502
diff --git a/net/netfilter/nfnetlink_cttimeout.c b/net/netfilter/nfnetlink_cttimeout.c
index c69b11ca5aad..572cb42e1ee1 100644
--- a/net/netfilter/nfnetlink_cttimeout.c
+++ b/net/netfilter/nfnetlink_cttimeout.c
@@ -184,7 +184,7 @@ ctnl_timeout_fill_info(struct sk_buff *skb, u32 portid, u32 seq, u32 type,
184 htonl(refcount_read(&timeout->refcnt)))) 184 htonl(refcount_read(&timeout->refcnt))))
185 goto nla_put_failure; 185 goto nla_put_failure;
186 186
187 nest_parms = nla_nest_start(skb, CTA_TIMEOUT_DATA | NLA_F_NESTED); 187 nest_parms = nla_nest_start(skb, CTA_TIMEOUT_DATA);
188 if (!nest_parms) 188 if (!nest_parms)
189 goto nla_put_failure; 189 goto nla_put_failure;
190 190
@@ -401,7 +401,7 @@ cttimeout_default_fill_info(struct net *net, struct sk_buff *skb, u32 portid,
401 nla_put_u8(skb, CTA_TIMEOUT_L4PROTO, l4proto->l4proto)) 401 nla_put_u8(skb, CTA_TIMEOUT_L4PROTO, l4proto->l4proto))
402 goto nla_put_failure; 402 goto nla_put_failure;
403 403
404 nest_parms = nla_nest_start(skb, CTA_TIMEOUT_DATA | NLA_F_NESTED); 404 nest_parms = nla_nest_start(skb, CTA_TIMEOUT_DATA);
405 if (!nest_parms) 405 if (!nest_parms)
406 goto nla_put_failure; 406 goto nla_put_failure;
407 407
diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c
index e057b2961d31..be7d53943e2d 100644
--- a/net/netfilter/nfnetlink_queue.c
+++ b/net/netfilter/nfnetlink_queue.c
@@ -351,7 +351,7 @@ static int nfqnl_put_bridge(struct nf_queue_entry *entry, struct sk_buff *skb)
351 if (skb_vlan_tag_present(entskb)) { 351 if (skb_vlan_tag_present(entskb)) {
352 struct nlattr *nest; 352 struct nlattr *nest;
353 353
354 nest = nla_nest_start(skb, NFQA_VLAN | NLA_F_NESTED); 354 nest = nla_nest_start(skb, NFQA_VLAN);
355 if (!nest) 355 if (!nest)
356 goto nla_put_failure; 356 goto nla_put_failure;
357 357
diff --git a/net/netfilter/nft_ct.c b/net/netfilter/nft_ct.c
index 7b717fad6cdc..1738ef6dcb56 100644
--- a/net/netfilter/nft_ct.c
+++ b/net/netfilter/nft_ct.c
@@ -928,7 +928,7 @@ static int nft_ct_timeout_obj_dump(struct sk_buff *skb,
928 nla_put_be16(skb, NFTA_CT_TIMEOUT_L3PROTO, htons(timeout->l3num))) 928 nla_put_be16(skb, NFTA_CT_TIMEOUT_L3PROTO, htons(timeout->l3num)))
929 return -1; 929 return -1;
930 930
931 nest_params = nla_nest_start(skb, NFTA_CT_TIMEOUT_DATA | NLA_F_NESTED); 931 nest_params = nla_nest_start(skb, NFTA_CT_TIMEOUT_DATA);
932 if (!nest_params) 932 if (!nest_params)
933 return -1; 933 return -1;
934 934
diff --git a/net/netfilter/nft_tunnel.c b/net/netfilter/nft_tunnel.c
index b113fcac94e1..66b52d015763 100644
--- a/net/netfilter/nft_tunnel.c
+++ b/net/netfilter/nft_tunnel.c
@@ -437,7 +437,7 @@ static int nft_tunnel_ip_dump(struct sk_buff *skb, struct ip_tunnel_info *info)
437 struct nlattr *nest; 437 struct nlattr *nest;
438 438
439 if (info->mode & IP_TUNNEL_INFO_IPV6) { 439 if (info->mode & IP_TUNNEL_INFO_IPV6) {
440 nest = nla_nest_start(skb, NFTA_TUNNEL_KEY_IP6); 440 nest = nla_nest_start_noflag(skb, NFTA_TUNNEL_KEY_IP6);
441 if (!nest) 441 if (!nest)
442 return -1; 442 return -1;
443 443
@@ -448,7 +448,7 @@ static int nft_tunnel_ip_dump(struct sk_buff *skb, struct ip_tunnel_info *info)
448 448
449 nla_nest_end(skb, nest); 449 nla_nest_end(skb, nest);
450 } else { 450 } else {
451 nest = nla_nest_start(skb, NFTA_TUNNEL_KEY_IP); 451 nest = nla_nest_start_noflag(skb, NFTA_TUNNEL_KEY_IP);
452 if (!nest) 452 if (!nest)
453 return -1; 453 return -1;
454 454
@@ -468,7 +468,7 @@ static int nft_tunnel_opts_dump(struct sk_buff *skb,
468 struct nft_tunnel_opts *opts = &priv->opts; 468 struct nft_tunnel_opts *opts = &priv->opts;
469 struct nlattr *nest; 469 struct nlattr *nest;
470 470
471 nest = nla_nest_start(skb, NFTA_TUNNEL_KEY_OPTS); 471 nest = nla_nest_start_noflag(skb, NFTA_TUNNEL_KEY_OPTS);
472 if (!nest) 472 if (!nest)
473 return -1; 473 return -1;
474 474
diff --git a/net/netlabel/netlabel_cipso_v4.c b/net/netlabel/netlabel_cipso_v4.c
index ba7800f94ccc..c9775658fb98 100644
--- a/net/netlabel/netlabel_cipso_v4.c
+++ b/net/netlabel/netlabel_cipso_v4.c
@@ -498,7 +498,7 @@ list_start:
498 if (ret_val != 0) 498 if (ret_val != 0)
499 goto list_failure_lock; 499 goto list_failure_lock;
500 500
501 nla_a = nla_nest_start(ans_skb, NLBL_CIPSOV4_A_TAGLST); 501 nla_a = nla_nest_start_noflag(ans_skb, NLBL_CIPSOV4_A_TAGLST);
502 if (nla_a == NULL) { 502 if (nla_a == NULL) {
503 ret_val = -ENOMEM; 503 ret_val = -ENOMEM;
504 goto list_failure_lock; 504 goto list_failure_lock;
@@ -517,7 +517,8 @@ list_start:
517 517
518 switch (doi_def->type) { 518 switch (doi_def->type) {
519 case CIPSO_V4_MAP_TRANS: 519 case CIPSO_V4_MAP_TRANS:
520 nla_a = nla_nest_start(ans_skb, NLBL_CIPSOV4_A_MLSLVLLST); 520 nla_a = nla_nest_start_noflag(ans_skb,
521 NLBL_CIPSOV4_A_MLSLVLLST);
521 if (nla_a == NULL) { 522 if (nla_a == NULL) {
522 ret_val = -ENOMEM; 523 ret_val = -ENOMEM;
523 goto list_failure_lock; 524 goto list_failure_lock;
@@ -529,7 +530,8 @@ list_start:
529 CIPSO_V4_INV_LVL) 530 CIPSO_V4_INV_LVL)
530 continue; 531 continue;
531 532
532 nla_b = nla_nest_start(ans_skb, NLBL_CIPSOV4_A_MLSLVL); 533 nla_b = nla_nest_start_noflag(ans_skb,
534 NLBL_CIPSOV4_A_MLSLVL);
533 if (nla_b == NULL) { 535 if (nla_b == NULL) {
534 ret_val = -ENOMEM; 536 ret_val = -ENOMEM;
535 goto list_retry; 537 goto list_retry;
@@ -548,7 +550,8 @@ list_start:
548 } 550 }
549 nla_nest_end(ans_skb, nla_a); 551 nla_nest_end(ans_skb, nla_a);
550 552
551 nla_a = nla_nest_start(ans_skb, NLBL_CIPSOV4_A_MLSCATLST); 553 nla_a = nla_nest_start_noflag(ans_skb,
554 NLBL_CIPSOV4_A_MLSCATLST);
552 if (nla_a == NULL) { 555 if (nla_a == NULL) {
553 ret_val = -ENOMEM; 556 ret_val = -ENOMEM;
554 goto list_retry; 557 goto list_retry;
@@ -560,7 +563,8 @@ list_start:
560 CIPSO_V4_INV_CAT) 563 CIPSO_V4_INV_CAT)
561 continue; 564 continue;
562 565
563 nla_b = nla_nest_start(ans_skb, NLBL_CIPSOV4_A_MLSCAT); 566 nla_b = nla_nest_start_noflag(ans_skb,
567 NLBL_CIPSOV4_A_MLSCAT);
564 if (nla_b == NULL) { 568 if (nla_b == NULL) {
565 ret_val = -ENOMEM; 569 ret_val = -ENOMEM;
566 goto list_retry; 570 goto list_retry;
diff --git a/net/netlabel/netlabel_mgmt.c b/net/netlabel/netlabel_mgmt.c
index a16eacfb2236..c6c8a101f2ff 100644
--- a/net/netlabel/netlabel_mgmt.c
+++ b/net/netlabel/netlabel_mgmt.c
@@ -315,7 +315,7 @@ static int netlbl_mgmt_listentry(struct sk_buff *skb,
315 315
316 switch (entry->def.type) { 316 switch (entry->def.type) {
317 case NETLBL_NLTYPE_ADDRSELECT: 317 case NETLBL_NLTYPE_ADDRSELECT:
318 nla_a = nla_nest_start(skb, NLBL_MGMT_A_SELECTORLIST); 318 nla_a = nla_nest_start_noflag(skb, NLBL_MGMT_A_SELECTORLIST);
319 if (nla_a == NULL) 319 if (nla_a == NULL)
320 return -ENOMEM; 320 return -ENOMEM;
321 321
@@ -323,7 +323,8 @@ static int netlbl_mgmt_listentry(struct sk_buff *skb,
323 struct netlbl_domaddr4_map *map4; 323 struct netlbl_domaddr4_map *map4;
324 struct in_addr addr_struct; 324 struct in_addr addr_struct;
325 325
326 nla_b = nla_nest_start(skb, NLBL_MGMT_A_ADDRSELECTOR); 326 nla_b = nla_nest_start_noflag(skb,
327 NLBL_MGMT_A_ADDRSELECTOR);
327 if (nla_b == NULL) 328 if (nla_b == NULL)
328 return -ENOMEM; 329 return -ENOMEM;
329 330
@@ -357,7 +358,8 @@ static int netlbl_mgmt_listentry(struct sk_buff *skb,
357 netlbl_af6list_foreach_rcu(iter6, &entry->def.addrsel->list6) { 358 netlbl_af6list_foreach_rcu(iter6, &entry->def.addrsel->list6) {
358 struct netlbl_domaddr6_map *map6; 359 struct netlbl_domaddr6_map *map6;
359 360
360 nla_b = nla_nest_start(skb, NLBL_MGMT_A_ADDRSELECTOR); 361 nla_b = nla_nest_start_noflag(skb,
362 NLBL_MGMT_A_ADDRSELECTOR);
361 if (nla_b == NULL) 363 if (nla_b == NULL)
362 return -ENOMEM; 364 return -ENOMEM;
363 365
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index 288456090710..83e876591f6c 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -665,7 +665,7 @@ static int ctrl_fill_info(const struct genl_family *family, u32 portid, u32 seq,
665 struct nlattr *nla_ops; 665 struct nlattr *nla_ops;
666 int i; 666 int i;
667 667
668 nla_ops = nla_nest_start(skb, CTRL_ATTR_OPS); 668 nla_ops = nla_nest_start_noflag(skb, CTRL_ATTR_OPS);
669 if (nla_ops == NULL) 669 if (nla_ops == NULL)
670 goto nla_put_failure; 670 goto nla_put_failure;
671 671
@@ -681,7 +681,7 @@ static int ctrl_fill_info(const struct genl_family *family, u32 portid, u32 seq,
681 if (family->policy) 681 if (family->policy)
682 op_flags |= GENL_CMD_CAP_HASPOL; 682 op_flags |= GENL_CMD_CAP_HASPOL;
683 683
684 nest = nla_nest_start(skb, i + 1); 684 nest = nla_nest_start_noflag(skb, i + 1);
685 if (nest == NULL) 685 if (nest == NULL)
686 goto nla_put_failure; 686 goto nla_put_failure;
687 687
@@ -699,7 +699,7 @@ static int ctrl_fill_info(const struct genl_family *family, u32 portid, u32 seq,
699 struct nlattr *nla_grps; 699 struct nlattr *nla_grps;
700 int i; 700 int i;
701 701
702 nla_grps = nla_nest_start(skb, CTRL_ATTR_MCAST_GROUPS); 702 nla_grps = nla_nest_start_noflag(skb, CTRL_ATTR_MCAST_GROUPS);
703 if (nla_grps == NULL) 703 if (nla_grps == NULL)
704 goto nla_put_failure; 704 goto nla_put_failure;
705 705
@@ -709,7 +709,7 @@ static int ctrl_fill_info(const struct genl_family *family, u32 portid, u32 seq,
709 709
710 grp = &family->mcgrps[i]; 710 grp = &family->mcgrps[i];
711 711
712 nest = nla_nest_start(skb, i + 1); 712 nest = nla_nest_start_noflag(skb, i + 1);
713 if (nest == NULL) 713 if (nest == NULL)
714 goto nla_put_failure; 714 goto nla_put_failure;
715 715
@@ -749,11 +749,11 @@ static int ctrl_fill_mcgrp_info(const struct genl_family *family,
749 nla_put_u16(skb, CTRL_ATTR_FAMILY_ID, family->id)) 749 nla_put_u16(skb, CTRL_ATTR_FAMILY_ID, family->id))
750 goto nla_put_failure; 750 goto nla_put_failure;
751 751
752 nla_grps = nla_nest_start(skb, CTRL_ATTR_MCAST_GROUPS); 752 nla_grps = nla_nest_start_noflag(skb, CTRL_ATTR_MCAST_GROUPS);
753 if (nla_grps == NULL) 753 if (nla_grps == NULL)
754 goto nla_put_failure; 754 goto nla_put_failure;
755 755
756 nest = nla_nest_start(skb, 1); 756 nest = nla_nest_start_noflag(skb, 1);
757 if (nest == NULL) 757 if (nest == NULL)
758 goto nla_put_failure; 758 goto nla_put_failure;
759 759
diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c
index 4d9f3ac8d562..f91ce7c82746 100644
--- a/net/nfc/netlink.c
+++ b/net/nfc/netlink.c
@@ -392,7 +392,7 @@ int nfc_genl_llc_send_sdres(struct nfc_dev *dev, struct hlist_head *sdres_list)
392 if (nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx)) 392 if (nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx))
393 goto nla_put_failure; 393 goto nla_put_failure;
394 394
395 sdp_attr = nla_nest_start(msg, NFC_ATTR_LLC_SDP); 395 sdp_attr = nla_nest_start_noflag(msg, NFC_ATTR_LLC_SDP);
396 if (sdp_attr == NULL) { 396 if (sdp_attr == NULL) {
397 rc = -ENOMEM; 397 rc = -ENOMEM;
398 goto nla_put_failure; 398 goto nla_put_failure;
@@ -402,7 +402,7 @@ int nfc_genl_llc_send_sdres(struct nfc_dev *dev, struct hlist_head *sdres_list)
402 hlist_for_each_entry_safe(sdres, n, sdres_list, node) { 402 hlist_for_each_entry_safe(sdres, n, sdres_list, node) {
403 pr_debug("uri: %s, sap: %d\n", sdres->uri, sdres->sap); 403 pr_debug("uri: %s, sap: %d\n", sdres->uri, sdres->sap);
404 404
405 uri_attr = nla_nest_start(msg, i++); 405 uri_attr = nla_nest_start_noflag(msg, i++);
406 if (uri_attr == NULL) { 406 if (uri_attr == NULL) {
407 rc = -ENOMEM; 407 rc = -ENOMEM;
408 goto nla_put_failure; 408 goto nla_put_failure;
diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c
index 626629944450..ff8baf810bb3 100644
--- a/net/openvswitch/conntrack.c
+++ b/net/openvswitch/conntrack.c
@@ -1683,7 +1683,7 @@ static bool ovs_ct_nat_to_attr(const struct ovs_conntrack_info *info,
1683{ 1683{
1684 struct nlattr *start; 1684 struct nlattr *start;
1685 1685
1686 start = nla_nest_start(skb, OVS_CT_ATTR_NAT); 1686 start = nla_nest_start_noflag(skb, OVS_CT_ATTR_NAT);
1687 if (!start) 1687 if (!start)
1688 return false; 1688 return false;
1689 1689
@@ -1750,7 +1750,7 @@ int ovs_ct_action_to_attr(const struct ovs_conntrack_info *ct_info,
1750{ 1750{
1751 struct nlattr *start; 1751 struct nlattr *start;
1752 1752
1753 start = nla_nest_start(skb, OVS_ACTION_ATTR_CT); 1753 start = nla_nest_start_noflag(skb, OVS_ACTION_ATTR_CT);
1754 if (!start) 1754 if (!start)
1755 return -EMSGSIZE; 1755 return -EMSGSIZE;
1756 1756
@@ -2160,7 +2160,7 @@ static int ovs_ct_limit_cmd_get(struct sk_buff *skb, struct genl_info *info)
2160 if (IS_ERR(reply)) 2160 if (IS_ERR(reply))
2161 return PTR_ERR(reply); 2161 return PTR_ERR(reply);
2162 2162
2163 nla_reply = nla_nest_start(reply, OVS_CT_LIMIT_ATTR_ZONE_LIMIT); 2163 nla_reply = nla_nest_start_noflag(reply, OVS_CT_LIMIT_ATTR_ZONE_LIMIT);
2164 2164
2165 if (a[OVS_CT_LIMIT_ATTR_ZONE_LIMIT]) { 2165 if (a[OVS_CT_LIMIT_ATTR_ZONE_LIMIT]) {
2166 err = ovs_ct_limit_get_zone_limit( 2166 err = ovs_ct_limit_get_zone_limit(
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index a64d3eb1f9a9..356677c3a0c2 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -463,7 +463,8 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
463 nla_data(upcall_info->userdata)); 463 nla_data(upcall_info->userdata));
464 464
465 if (upcall_info->egress_tun_info) { 465 if (upcall_info->egress_tun_info) {
466 nla = nla_nest_start(user_skb, OVS_PACKET_ATTR_EGRESS_TUN_KEY); 466 nla = nla_nest_start_noflag(user_skb,
467 OVS_PACKET_ATTR_EGRESS_TUN_KEY);
467 if (!nla) { 468 if (!nla) {
468 err = -EMSGSIZE; 469 err = -EMSGSIZE;
469 goto out; 470 goto out;
@@ -475,7 +476,7 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
475 } 476 }
476 477
477 if (upcall_info->actions_len) { 478 if (upcall_info->actions_len) {
478 nla = nla_nest_start(user_skb, OVS_PACKET_ATTR_ACTIONS); 479 nla = nla_nest_start_noflag(user_skb, OVS_PACKET_ATTR_ACTIONS);
479 if (!nla) { 480 if (!nla) {
480 err = -EMSGSIZE; 481 err = -EMSGSIZE;
481 goto out; 482 goto out;
@@ -776,7 +777,7 @@ static int ovs_flow_cmd_fill_actions(const struct sw_flow *flow,
776 * This can only fail for dump operations because the skb is always 777 * This can only fail for dump operations because the skb is always
777 * properly sized for single flows. 778 * properly sized for single flows.
778 */ 779 */
779 start = nla_nest_start(skb, OVS_FLOW_ATTR_ACTIONS); 780 start = nla_nest_start_noflag(skb, OVS_FLOW_ATTR_ACTIONS);
780 if (start) { 781 if (start) {
781 const struct sw_flow_actions *sf_acts; 782 const struct sw_flow_actions *sf_acts;
782 783
diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c
index 3563acd5f92e..2427b672107a 100644
--- a/net/openvswitch/flow_netlink.c
+++ b/net/openvswitch/flow_netlink.c
@@ -856,7 +856,7 @@ static int vxlan_opt_to_nlattr(struct sk_buff *skb,
856 const struct vxlan_metadata *opts = tun_opts; 856 const struct vxlan_metadata *opts = tun_opts;
857 struct nlattr *nla; 857 struct nlattr *nla;
858 858
859 nla = nla_nest_start(skb, OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS); 859 nla = nla_nest_start_noflag(skb, OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS);
860 if (!nla) 860 if (!nla)
861 return -EMSGSIZE; 861 return -EMSGSIZE;
862 862
@@ -948,7 +948,7 @@ static int ip_tun_to_nlattr(struct sk_buff *skb,
948 struct nlattr *nla; 948 struct nlattr *nla;
949 int err; 949 int err;
950 950
951 nla = nla_nest_start(skb, OVS_KEY_ATTR_TUNNEL); 951 nla = nla_nest_start_noflag(skb, OVS_KEY_ATTR_TUNNEL);
952 if (!nla) 952 if (!nla)
953 return -EMSGSIZE; 953 return -EMSGSIZE;
954 954
@@ -1957,7 +1957,7 @@ static int nsh_key_to_nlattr(const struct ovs_key_nsh *nsh, bool is_mask,
1957{ 1957{
1958 struct nlattr *start; 1958 struct nlattr *start;
1959 1959
1960 start = nla_nest_start(skb, OVS_KEY_ATTR_NSH); 1960 start = nla_nest_start_noflag(skb, OVS_KEY_ATTR_NSH);
1961 if (!start) 1961 if (!start)
1962 return -EMSGSIZE; 1962 return -EMSGSIZE;
1963 1963
@@ -2040,14 +2040,15 @@ static int __ovs_nla_put_key(const struct sw_flow_key *swkey,
2040 if (swkey->eth.vlan.tci || eth_type_vlan(swkey->eth.type)) { 2040 if (swkey->eth.vlan.tci || eth_type_vlan(swkey->eth.type)) {
2041 if (ovs_nla_put_vlan(skb, &output->eth.vlan, is_mask)) 2041 if (ovs_nla_put_vlan(skb, &output->eth.vlan, is_mask))
2042 goto nla_put_failure; 2042 goto nla_put_failure;
2043 encap = nla_nest_start(skb, OVS_KEY_ATTR_ENCAP); 2043 encap = nla_nest_start_noflag(skb, OVS_KEY_ATTR_ENCAP);
2044 if (!swkey->eth.vlan.tci) 2044 if (!swkey->eth.vlan.tci)
2045 goto unencap; 2045 goto unencap;
2046 2046
2047 if (swkey->eth.cvlan.tci || eth_type_vlan(swkey->eth.type)) { 2047 if (swkey->eth.cvlan.tci || eth_type_vlan(swkey->eth.type)) {
2048 if (ovs_nla_put_vlan(skb, &output->eth.cvlan, is_mask)) 2048 if (ovs_nla_put_vlan(skb, &output->eth.cvlan, is_mask))
2049 goto nla_put_failure; 2049 goto nla_put_failure;
2050 in_encap = nla_nest_start(skb, OVS_KEY_ATTR_ENCAP); 2050 in_encap = nla_nest_start_noflag(skb,
2051 OVS_KEY_ATTR_ENCAP);
2051 if (!swkey->eth.cvlan.tci) 2052 if (!swkey->eth.cvlan.tci)
2052 goto unencap; 2053 goto unencap;
2053 } 2054 }
@@ -2226,7 +2227,7 @@ int ovs_nla_put_key(const struct sw_flow_key *swkey,
2226 int err; 2227 int err;
2227 struct nlattr *nla; 2228 struct nlattr *nla;
2228 2229
2229 nla = nla_nest_start(skb, attr); 2230 nla = nla_nest_start_noflag(skb, attr);
2230 if (!nla) 2231 if (!nla)
2231 return -EMSGSIZE; 2232 return -EMSGSIZE;
2232 err = __ovs_nla_put_key(swkey, output, is_mask, skb); 2233 err = __ovs_nla_put_key(swkey, output, is_mask, skb);
@@ -3252,7 +3253,7 @@ static int sample_action_to_attr(const struct nlattr *attr,
3252 const struct sample_arg *arg; 3253 const struct sample_arg *arg;
3253 struct nlattr *actions; 3254 struct nlattr *actions;
3254 3255
3255 start = nla_nest_start(skb, OVS_ACTION_ATTR_SAMPLE); 3256 start = nla_nest_start_noflag(skb, OVS_ACTION_ATTR_SAMPLE);
3256 if (!start) 3257 if (!start)
3257 return -EMSGSIZE; 3258 return -EMSGSIZE;
3258 3259
@@ -3265,7 +3266,7 @@ static int sample_action_to_attr(const struct nlattr *attr,
3265 goto out; 3266 goto out;
3266 } 3267 }
3267 3268
3268 ac_start = nla_nest_start(skb, OVS_SAMPLE_ATTR_ACTIONS); 3269 ac_start = nla_nest_start_noflag(skb, OVS_SAMPLE_ATTR_ACTIONS);
3269 if (!ac_start) { 3270 if (!ac_start) {
3270 err = -EMSGSIZE; 3271 err = -EMSGSIZE;
3271 goto out; 3272 goto out;
@@ -3291,7 +3292,7 @@ static int clone_action_to_attr(const struct nlattr *attr,
3291 struct nlattr *start; 3292 struct nlattr *start;
3292 int err = 0, rem = nla_len(attr); 3293 int err = 0, rem = nla_len(attr);
3293 3294
3294 start = nla_nest_start(skb, OVS_ACTION_ATTR_CLONE); 3295 start = nla_nest_start_noflag(skb, OVS_ACTION_ATTR_CLONE);
3295 if (!start) 3296 if (!start)
3296 return -EMSGSIZE; 3297 return -EMSGSIZE;
3297 3298
@@ -3313,7 +3314,7 @@ static int check_pkt_len_action_to_attr(const struct nlattr *attr,
3313 const struct nlattr *a, *cpl_arg; 3314 const struct nlattr *a, *cpl_arg;
3314 int err = 0, rem = nla_len(attr); 3315 int err = 0, rem = nla_len(attr);
3315 3316
3316 start = nla_nest_start(skb, OVS_ACTION_ATTR_CHECK_PKT_LEN); 3317 start = nla_nest_start_noflag(skb, OVS_ACTION_ATTR_CHECK_PKT_LEN);
3317 if (!start) 3318 if (!start)
3318 return -EMSGSIZE; 3319 return -EMSGSIZE;
3319 3320
@@ -3332,8 +3333,8 @@ static int check_pkt_len_action_to_attr(const struct nlattr *attr,
3332 * 'OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_LESS_EQUAL'. 3333 * 'OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_LESS_EQUAL'.
3333 */ 3334 */
3334 a = nla_next(cpl_arg, &rem); 3335 a = nla_next(cpl_arg, &rem);
3335 ac_start = nla_nest_start(skb, 3336 ac_start = nla_nest_start_noflag(skb,
3336 OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_LESS_EQUAL); 3337 OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_LESS_EQUAL);
3337 if (!ac_start) { 3338 if (!ac_start) {
3338 err = -EMSGSIZE; 3339 err = -EMSGSIZE;
3339 goto out; 3340 goto out;
@@ -3351,8 +3352,8 @@ static int check_pkt_len_action_to_attr(const struct nlattr *attr,
3351 * OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_GREATER. 3352 * OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_GREATER.
3352 */ 3353 */
3353 a = nla_next(a, &rem); 3354 a = nla_next(a, &rem);
3354 ac_start = nla_nest_start(skb, 3355 ac_start = nla_nest_start_noflag(skb,
3355 OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_GREATER); 3356 OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_GREATER);
3356 if (!ac_start) { 3357 if (!ac_start) {
3357 err = -EMSGSIZE; 3358 err = -EMSGSIZE;
3358 goto out; 3359 goto out;
@@ -3386,7 +3387,7 @@ static int set_action_to_attr(const struct nlattr *a, struct sk_buff *skb)
3386 struct ovs_tunnel_info *ovs_tun = nla_data(ovs_key); 3387 struct ovs_tunnel_info *ovs_tun = nla_data(ovs_key);
3387 struct ip_tunnel_info *tun_info = &ovs_tun->tun_dst->u.tun_info; 3388 struct ip_tunnel_info *tun_info = &ovs_tun->tun_dst->u.tun_info;
3388 3389
3389 start = nla_nest_start(skb, OVS_ACTION_ATTR_SET); 3390 start = nla_nest_start_noflag(skb, OVS_ACTION_ATTR_SET);
3390 if (!start) 3391 if (!start)
3391 return -EMSGSIZE; 3392 return -EMSGSIZE;
3392 3393
@@ -3418,7 +3419,7 @@ static int masked_set_action_to_set_action_attr(const struct nlattr *a,
3418 /* Revert the conversion we did from a non-masked set action to 3419 /* Revert the conversion we did from a non-masked set action to
3419 * masked set action. 3420 * masked set action.
3420 */ 3421 */
3421 nla = nla_nest_start(skb, OVS_ACTION_ATTR_SET); 3422 nla = nla_nest_start_noflag(skb, OVS_ACTION_ATTR_SET);
3422 if (!nla) 3423 if (!nla)
3423 return -EMSGSIZE; 3424 return -EMSGSIZE;
3424 3425
diff --git a/net/openvswitch/meter.c b/net/openvswitch/meter.c
index 0be3d097ae01..fdc8be7fd8f3 100644
--- a/net/openvswitch/meter.c
+++ b/net/openvswitch/meter.c
@@ -127,7 +127,7 @@ static int ovs_meter_cmd_reply_stats(struct sk_buff *reply, u32 meter_id,
127 OVS_METER_ATTR_PAD)) 127 OVS_METER_ATTR_PAD))
128 goto error; 128 goto error;
129 129
130 nla = nla_nest_start(reply, OVS_METER_ATTR_BANDS); 130 nla = nla_nest_start_noflag(reply, OVS_METER_ATTR_BANDS);
131 if (!nla) 131 if (!nla)
132 goto error; 132 goto error;
133 133
@@ -136,7 +136,7 @@ static int ovs_meter_cmd_reply_stats(struct sk_buff *reply, u32 meter_id,
136 for (i = 0; i < meter->n_bands; ++i, ++band) { 136 for (i = 0; i < meter->n_bands; ++i, ++band) {
137 struct nlattr *band_nla; 137 struct nlattr *band_nla;
138 138
139 band_nla = nla_nest_start(reply, OVS_BAND_ATTR_UNSPEC); 139 band_nla = nla_nest_start_noflag(reply, OVS_BAND_ATTR_UNSPEC);
140 if (!band_nla || nla_put(reply, OVS_BAND_ATTR_STATS, 140 if (!band_nla || nla_put(reply, OVS_BAND_ATTR_STATS,
141 sizeof(struct ovs_flow_stats), 141 sizeof(struct ovs_flow_stats),
142 &band->stats)) 142 &band->stats))
@@ -166,11 +166,11 @@ static int ovs_meter_cmd_features(struct sk_buff *skb, struct genl_info *info)
166 nla_put_u32(reply, OVS_METER_ATTR_MAX_BANDS, DP_MAX_BANDS)) 166 nla_put_u32(reply, OVS_METER_ATTR_MAX_BANDS, DP_MAX_BANDS))
167 goto nla_put_failure; 167 goto nla_put_failure;
168 168
169 nla = nla_nest_start(reply, OVS_METER_ATTR_BANDS); 169 nla = nla_nest_start_noflag(reply, OVS_METER_ATTR_BANDS);
170 if (!nla) 170 if (!nla)
171 goto nla_put_failure; 171 goto nla_put_failure;
172 172
173 band_nla = nla_nest_start(reply, OVS_BAND_ATTR_UNSPEC); 173 band_nla = nla_nest_start_noflag(reply, OVS_BAND_ATTR_UNSPEC);
174 if (!band_nla) 174 if (!band_nla)
175 goto nla_put_failure; 175 goto nla_put_failure;
176 /* Currently only DROP band type is supported. */ 176 /* Currently only DROP band type is supported. */
diff --git a/net/openvswitch/vport-vxlan.c b/net/openvswitch/vport-vxlan.c
index 8f16f11f7ad3..54965ff8cc66 100644
--- a/net/openvswitch/vport-vxlan.c
+++ b/net/openvswitch/vport-vxlan.c
@@ -43,7 +43,7 @@ static int vxlan_get_options(const struct vport *vport, struct sk_buff *skb)
43 if (vxlan->cfg.flags & VXLAN_F_GBP) { 43 if (vxlan->cfg.flags & VXLAN_F_GBP) {
44 struct nlattr *exts; 44 struct nlattr *exts;
45 45
46 exts = nla_nest_start(skb, OVS_TUNNEL_ATTR_EXTENSION); 46 exts = nla_nest_start_noflag(skb, OVS_TUNNEL_ATTR_EXTENSION);
47 if (!exts) 47 if (!exts)
48 return -EMSGSIZE; 48 return -EMSGSIZE;
49 49
diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c
index 19f6765566e7..258ce3b7b452 100644
--- a/net/openvswitch/vport.c
+++ b/net/openvswitch/vport.c
@@ -319,7 +319,7 @@ int ovs_vport_get_options(const struct vport *vport, struct sk_buff *skb)
319 if (!vport->ops->get_options) 319 if (!vport->ops->get_options)
320 return 0; 320 return 0;
321 321
322 nla = nla_nest_start(skb, OVS_VPORT_ATTR_OPTIONS); 322 nla = nla_nest_start_noflag(skb, OVS_VPORT_ATTR_OPTIONS);
323 if (!nla) 323 if (!nla)
324 return -EMSGSIZE; 324 return -EMSGSIZE;
325 325
diff --git a/net/packet/diag.c b/net/packet/diag.c
index 7ef1c881ae74..98abfd8644a4 100644
--- a/net/packet/diag.c
+++ b/net/packet/diag.c
@@ -39,7 +39,7 @@ static int pdiag_put_mclist(const struct packet_sock *po, struct sk_buff *nlskb)
39 struct nlattr *mca; 39 struct nlattr *mca;
40 struct packet_mclist *ml; 40 struct packet_mclist *ml;
41 41
42 mca = nla_nest_start(nlskb, PACKET_DIAG_MCLIST); 42 mca = nla_nest_start_noflag(nlskb, PACKET_DIAG_MCLIST);
43 if (!mca) 43 if (!mca)
44 return -EMSGSIZE; 44 return -EMSGSIZE;
45 45
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 5a87e271d35a..641ad7575f24 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -242,7 +242,7 @@ static int tcf_dump_walker(struct tcf_idrinfo *idrinfo, struct sk_buff *skb,
242 (unsigned long)p->tcfa_tm.lastuse)) 242 (unsigned long)p->tcfa_tm.lastuse))
243 continue; 243 continue;
244 244
245 nest = nla_nest_start(skb, n_i); 245 nest = nla_nest_start_noflag(skb, n_i);
246 if (!nest) { 246 if (!nest) {
247 index--; 247 index--;
248 goto nla_put_failure; 248 goto nla_put_failure;
@@ -299,7 +299,7 @@ static int tcf_del_walker(struct tcf_idrinfo *idrinfo, struct sk_buff *skb,
299 struct tc_action *p; 299 struct tc_action *p;
300 unsigned long id = 1; 300 unsigned long id = 1;
301 301
302 nest = nla_nest_start(skb, 0); 302 nest = nla_nest_start_noflag(skb, 0);
303 if (nest == NULL) 303 if (nest == NULL)
304 goto nla_put_failure; 304 goto nla_put_failure;
305 if (nla_put_string(skb, TCA_KIND, ops->kind)) 305 if (nla_put_string(skb, TCA_KIND, ops->kind))
@@ -776,7 +776,7 @@ tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
776 } 776 }
777 rcu_read_unlock(); 777 rcu_read_unlock();
778 778
779 nest = nla_nest_start(skb, TCA_OPTIONS); 779 nest = nla_nest_start_noflag(skb, TCA_OPTIONS);
780 if (nest == NULL) 780 if (nest == NULL)
781 goto nla_put_failure; 781 goto nla_put_failure;
782 err = tcf_action_dump_old(skb, a, bind, ref); 782 err = tcf_action_dump_old(skb, a, bind, ref);
@@ -800,7 +800,7 @@ int tcf_action_dump(struct sk_buff *skb, struct tc_action *actions[],
800 800
801 for (i = 0; i < TCA_ACT_MAX_PRIO && actions[i]; i++) { 801 for (i = 0; i < TCA_ACT_MAX_PRIO && actions[i]; i++) {
802 a = actions[i]; 802 a = actions[i];
803 nest = nla_nest_start(skb, a->order); 803 nest = nla_nest_start_noflag(skb, a->order);
804 if (nest == NULL) 804 if (nest == NULL)
805 goto nla_put_failure; 805 goto nla_put_failure;
806 err = tcf_action_dump_1(skb, a, bind, ref); 806 err = tcf_action_dump_1(skb, a, bind, ref);
@@ -1052,7 +1052,7 @@ static int tca_get_fill(struct sk_buff *skb, struct tc_action *actions[],
1052 t->tca__pad1 = 0; 1052 t->tca__pad1 = 0;
1053 t->tca__pad2 = 0; 1053 t->tca__pad2 = 0;
1054 1054
1055 nest = nla_nest_start(skb, TCA_ACT_TAB); 1055 nest = nla_nest_start_noflag(skb, TCA_ACT_TAB);
1056 if (!nest) 1056 if (!nest)
1057 goto out_nlmsg_trim; 1057 goto out_nlmsg_trim;
1058 1058
@@ -1176,7 +1176,7 @@ static int tca_action_flush(struct net *net, struct nlattr *nla,
1176 t->tca__pad1 = 0; 1176 t->tca__pad1 = 0;
1177 t->tca__pad2 = 0; 1177 t->tca__pad2 = 0;
1178 1178
1179 nest = nla_nest_start(skb, TCA_ACT_TAB); 1179 nest = nla_nest_start_noflag(skb, TCA_ACT_TAB);
1180 if (!nest) { 1180 if (!nest) {
1181 NL_SET_ERR_MSG(extack, "Failed to add new netlink message"); 1181 NL_SET_ERR_MSG(extack, "Failed to add new netlink message");
1182 goto out_module_put; 1182 goto out_module_put;
@@ -1508,7 +1508,7 @@ static int tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb)
1508 if (!count_attr) 1508 if (!count_attr)
1509 goto out_module_put; 1509 goto out_module_put;
1510 1510
1511 nest = nla_nest_start(skb, TCA_ACT_TAB); 1511 nest = nla_nest_start_noflag(skb, TCA_ACT_TAB);
1512 if (nest == NULL) 1512 if (nest == NULL)
1513 goto out_module_put; 1513 goto out_module_put;
1514 1514
diff --git a/net/sched/act_ife.c b/net/sched/act_ife.c
index 31c6ffb6abe7..7a87ce2e5a76 100644
--- a/net/sched/act_ife.c
+++ b/net/sched/act_ife.c
@@ -387,7 +387,7 @@ static int dump_metalist(struct sk_buff *skb, struct tcf_ife_info *ife)
387 if (list_empty(&ife->metalist)) 387 if (list_empty(&ife->metalist))
388 return 0; 388 return 0;
389 389
390 nest = nla_nest_start(skb, TCA_IFE_METALST); 390 nest = nla_nest_start_noflag(skb, TCA_IFE_METALST);
391 if (!nest) 391 if (!nest)
392 goto out_nlmsg_trim; 392 goto out_nlmsg_trim;
393 393
diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c
index 287793abfaf9..ce4b54fa7834 100644
--- a/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -108,14 +108,15 @@ err_out:
108static int tcf_pedit_key_ex_dump(struct sk_buff *skb, 108static int tcf_pedit_key_ex_dump(struct sk_buff *skb,
109 struct tcf_pedit_key_ex *keys_ex, int n) 109 struct tcf_pedit_key_ex *keys_ex, int n)
110{ 110{
111 struct nlattr *keys_start = nla_nest_start(skb, TCA_PEDIT_KEYS_EX); 111 struct nlattr *keys_start = nla_nest_start_noflag(skb,
112 TCA_PEDIT_KEYS_EX);
112 113
113 if (!keys_start) 114 if (!keys_start)
114 goto nla_failure; 115 goto nla_failure;
115 for (; n > 0; n--) { 116 for (; n > 0; n--) {
116 struct nlattr *key_start; 117 struct nlattr *key_start;
117 118
118 key_start = nla_nest_start(skb, TCA_PEDIT_KEY_EX); 119 key_start = nla_nest_start_noflag(skb, TCA_PEDIT_KEY_EX);
119 if (!key_start) 120 if (!key_start)
120 goto nla_failure; 121 goto nla_failure;
121 122
diff --git a/net/sched/act_tunnel_key.c b/net/sched/act_tunnel_key.c
index d5aaf90a3971..45c0c253c7e8 100644
--- a/net/sched/act_tunnel_key.c
+++ b/net/sched/act_tunnel_key.c
@@ -426,7 +426,7 @@ static int tunnel_key_geneve_opts_dump(struct sk_buff *skb,
426 u8 *src = (u8 *)(info + 1); 426 u8 *src = (u8 *)(info + 1);
427 struct nlattr *start; 427 struct nlattr *start;
428 428
429 start = nla_nest_start(skb, TCA_TUNNEL_KEY_ENC_OPTS_GENEVE); 429 start = nla_nest_start_noflag(skb, TCA_TUNNEL_KEY_ENC_OPTS_GENEVE);
430 if (!start) 430 if (!start)
431 return -EMSGSIZE; 431 return -EMSGSIZE;
432 432
@@ -460,7 +460,7 @@ static int tunnel_key_opts_dump(struct sk_buff *skb,
460 if (!info->options_len) 460 if (!info->options_len)
461 return 0; 461 return 0;
462 462
463 start = nla_nest_start(skb, TCA_TUNNEL_KEY_ENC_OPTS); 463 start = nla_nest_start_noflag(skb, TCA_TUNNEL_KEY_ENC_OPTS);
464 if (!start) 464 if (!start)
465 return -EMSGSIZE; 465 return -EMSGSIZE;
466 466
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 9115f053883f..78de717afddf 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -3111,7 +3111,7 @@ int tcf_exts_dump(struct sk_buff *skb, struct tcf_exts *exts)
3111 * tc data even if iproute2 was newer - jhs 3111 * tc data even if iproute2 was newer - jhs
3112 */ 3112 */
3113 if (exts->type != TCA_OLD_COMPAT) { 3113 if (exts->type != TCA_OLD_COMPAT) {
3114 nest = nla_nest_start(skb, exts->action); 3114 nest = nla_nest_start_noflag(skb, exts->action);
3115 if (nest == NULL) 3115 if (nest == NULL)
3116 goto nla_put_failure; 3116 goto nla_put_failure;
3117 3117
@@ -3120,7 +3120,7 @@ int tcf_exts_dump(struct sk_buff *skb, struct tcf_exts *exts)
3120 nla_nest_end(skb, nest); 3120 nla_nest_end(skb, nest);
3121 } else if (exts->police) { 3121 } else if (exts->police) {
3122 struct tc_action *act = tcf_exts_first_act(exts); 3122 struct tc_action *act = tcf_exts_first_act(exts);
3123 nest = nla_nest_start(skb, exts->police); 3123 nest = nla_nest_start_noflag(skb, exts->police);
3124 if (nest == NULL || !act) 3124 if (nest == NULL || !act)
3125 goto nla_put_failure; 3125 goto nla_put_failure;
3126 if (tcf_action_dump_old(skb, act, 0, 0) < 0) 3126 if (tcf_action_dump_old(skb, act, 0, 0) < 0)
diff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c
index 687b0af67878..dd5fdb62c6df 100644
--- a/net/sched/cls_basic.c
+++ b/net/sched/cls_basic.c
@@ -288,7 +288,7 @@ static int basic_dump(struct net *net, struct tcf_proto *tp, void *fh,
288 288
289 t->tcm_handle = f->handle; 289 t->tcm_handle = f->handle;
290 290
291 nest = nla_nest_start(skb, TCA_OPTIONS); 291 nest = nla_nest_start_noflag(skb, TCA_OPTIONS);
292 if (nest == NULL) 292 if (nest == NULL)
293 goto nla_put_failure; 293 goto nla_put_failure;
294 294
diff --git a/net/sched/cls_bpf.c b/net/sched/cls_bpf.c
index b4ac58039cb1..6fd569c5a036 100644
--- a/net/sched/cls_bpf.c
+++ b/net/sched/cls_bpf.c
@@ -591,7 +591,7 @@ static int cls_bpf_dump(struct net *net, struct tcf_proto *tp, void *fh,
591 591
592 cls_bpf_offload_update_stats(tp, prog); 592 cls_bpf_offload_update_stats(tp, prog);
593 593
594 nest = nla_nest_start(skb, TCA_OPTIONS); 594 nest = nla_nest_start_noflag(skb, TCA_OPTIONS);
595 if (nest == NULL) 595 if (nest == NULL)
596 goto nla_put_failure; 596 goto nla_put_failure;
597 597
diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c
index 4c1567854f95..b680dd684282 100644
--- a/net/sched/cls_cgroup.c
+++ b/net/sched/cls_cgroup.c
@@ -176,7 +176,7 @@ static int cls_cgroup_dump(struct net *net, struct tcf_proto *tp, void *fh,
176 176
177 t->tcm_handle = head->handle; 177 t->tcm_handle = head->handle;
178 178
179 nest = nla_nest_start(skb, TCA_OPTIONS); 179 nest = nla_nest_start_noflag(skb, TCA_OPTIONS);
180 if (nest == NULL) 180 if (nest == NULL)
181 goto nla_put_failure; 181 goto nla_put_failure;
182 182
diff --git a/net/sched/cls_flow.c b/net/sched/cls_flow.c
index eece1ee26930..cb29fe7d5ed3 100644
--- a/net/sched/cls_flow.c
+++ b/net/sched/cls_flow.c
@@ -629,7 +629,7 @@ static int flow_dump(struct net *net, struct tcf_proto *tp, void *fh,
629 629
630 t->tcm_handle = f->handle; 630 t->tcm_handle = f->handle;
631 631
632 nest = nla_nest_start(skb, TCA_OPTIONS); 632 nest = nla_nest_start_noflag(skb, TCA_OPTIONS);
633 if (nest == NULL) 633 if (nest == NULL)
634 goto nla_put_failure; 634 goto nla_put_failure;
635 635
diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c
index 0d8968803e98..8d4f7a672f14 100644
--- a/net/sched/cls_flower.c
+++ b/net/sched/cls_flower.c
@@ -2051,7 +2051,7 @@ static int fl_dump_key_geneve_opt(struct sk_buff *skb,
2051 struct nlattr *nest; 2051 struct nlattr *nest;
2052 int opt_off = 0; 2052 int opt_off = 0;
2053 2053
2054 nest = nla_nest_start(skb, TCA_FLOWER_KEY_ENC_OPTS_GENEVE); 2054 nest = nla_nest_start_noflag(skb, TCA_FLOWER_KEY_ENC_OPTS_GENEVE);
2055 if (!nest) 2055 if (!nest)
2056 goto nla_put_failure; 2056 goto nla_put_failure;
2057 2057
@@ -2087,7 +2087,7 @@ static int fl_dump_key_options(struct sk_buff *skb, int enc_opt_type,
2087 if (!enc_opts->len) 2087 if (!enc_opts->len)
2088 return 0; 2088 return 0;
2089 2089
2090 nest = nla_nest_start(skb, enc_opt_type); 2090 nest = nla_nest_start_noflag(skb, enc_opt_type);
2091 if (!nest) 2091 if (!nest)
2092 goto nla_put_failure; 2092 goto nla_put_failure;
2093 2093
@@ -2333,7 +2333,7 @@ static int fl_dump(struct net *net, struct tcf_proto *tp, void *fh,
2333 2333
2334 t->tcm_handle = f->handle; 2334 t->tcm_handle = f->handle;
2335 2335
2336 nest = nla_nest_start(skb, TCA_OPTIONS); 2336 nest = nla_nest_start_noflag(skb, TCA_OPTIONS);
2337 if (!nest) 2337 if (!nest)
2338 goto nla_put_failure; 2338 goto nla_put_failure;
2339 2339
@@ -2384,7 +2384,7 @@ static int fl_tmplt_dump(struct sk_buff *skb, struct net *net, void *tmplt_priv)
2384 struct fl_flow_key *key, *mask; 2384 struct fl_flow_key *key, *mask;
2385 struct nlattr *nest; 2385 struct nlattr *nest;
2386 2386
2387 nest = nla_nest_start(skb, TCA_OPTIONS); 2387 nest = nla_nest_start_noflag(skb, TCA_OPTIONS);
2388 if (!nest) 2388 if (!nest)
2389 goto nla_put_failure; 2389 goto nla_put_failure;
2390 2390
diff --git a/net/sched/cls_fw.c b/net/sched/cls_fw.c
index ad036b00427d..3fcc1d51b9d7 100644
--- a/net/sched/cls_fw.c
+++ b/net/sched/cls_fw.c
@@ -402,7 +402,7 @@ static int fw_dump(struct net *net, struct tcf_proto *tp, void *fh,
402 if (!f->res.classid && !tcf_exts_has_actions(&f->exts)) 402 if (!f->res.classid && !tcf_exts_has_actions(&f->exts))
403 return skb->len; 403 return skb->len;
404 404
405 nest = nla_nest_start(skb, TCA_OPTIONS); 405 nest = nla_nest_start_noflag(skb, TCA_OPTIONS);
406 if (nest == NULL) 406 if (nest == NULL)
407 goto nla_put_failure; 407 goto nla_put_failure;
408 408
diff --git a/net/sched/cls_matchall.c b/net/sched/cls_matchall.c
index a13bc351a414..d54fa8e11b9e 100644
--- a/net/sched/cls_matchall.c
+++ b/net/sched/cls_matchall.c
@@ -303,7 +303,7 @@ static int mall_dump(struct net *net, struct tcf_proto *tp, void *fh,
303 303
304 t->tcm_handle = head->handle; 304 t->tcm_handle = head->handle;
305 305
306 nest = nla_nest_start(skb, TCA_OPTIONS); 306 nest = nla_nest_start_noflag(skb, TCA_OPTIONS);
307 if (!nest) 307 if (!nest)
308 goto nla_put_failure; 308 goto nla_put_failure;
309 309
diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c
index f006af23b64a..b3b9b151a61d 100644
--- a/net/sched/cls_route.c
+++ b/net/sched/cls_route.c
@@ -607,7 +607,7 @@ static int route4_dump(struct net *net, struct tcf_proto *tp, void *fh,
607 607
608 t->tcm_handle = f->handle; 608 t->tcm_handle = f->handle;
609 609
610 nest = nla_nest_start(skb, TCA_OPTIONS); 610 nest = nla_nest_start_noflag(skb, TCA_OPTIONS);
611 if (nest == NULL) 611 if (nest == NULL)
612 goto nla_put_failure; 612 goto nla_put_failure;
613 613
diff --git a/net/sched/cls_rsvp.h b/net/sched/cls_rsvp.h
index 0719a21d9c41..fa059cf934a6 100644
--- a/net/sched/cls_rsvp.h
+++ b/net/sched/cls_rsvp.h
@@ -706,7 +706,7 @@ static int rsvp_dump(struct net *net, struct tcf_proto *tp, void *fh,
706 706
707 t->tcm_handle = f->handle; 707 t->tcm_handle = f->handle;
708 708
709 nest = nla_nest_start(skb, TCA_OPTIONS); 709 nest = nla_nest_start_noflag(skb, TCA_OPTIONS);
710 if (nest == NULL) 710 if (nest == NULL)
711 goto nla_put_failure; 711 goto nla_put_failure;
712 712
diff --git a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c
index 24e0a62a65cc..1a2e7d5a8776 100644
--- a/net/sched/cls_tcindex.c
+++ b/net/sched/cls_tcindex.c
@@ -601,7 +601,7 @@ static int tcindex_dump(struct net *net, struct tcf_proto *tp, void *fh,
601 tp, fh, skb, t, p, r); 601 tp, fh, skb, t, p, r);
602 pr_debug("p->perfect %p p->h %p\n", p->perfect, p->h); 602 pr_debug("p->perfect %p p->h %p\n", p->perfect, p->h);
603 603
604 nest = nla_nest_start(skb, TCA_OPTIONS); 604 nest = nla_nest_start_noflag(skb, TCA_OPTIONS);
605 if (nest == NULL) 605 if (nest == NULL)
606 goto nla_put_failure; 606 goto nla_put_failure;
607 607
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
index 48e76a3acf8a..499477058b2d 100644
--- a/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -1294,7 +1294,7 @@ static int u32_dump(struct net *net, struct tcf_proto *tp, void *fh,
1294 1294
1295 t->tcm_handle = n->handle; 1295 t->tcm_handle = n->handle;
1296 1296
1297 nest = nla_nest_start(skb, TCA_OPTIONS); 1297 nest = nla_nest_start_noflag(skb, TCA_OPTIONS);
1298 if (nest == NULL) 1298 if (nest == NULL)
1299 goto nla_put_failure; 1299 goto nla_put_failure;
1300 1300
diff --git a/net/sched/ematch.c b/net/sched/ematch.c
index 1331a4c2d8ff..6f2d6a761dbe 100644
--- a/net/sched/ematch.c
+++ b/net/sched/ematch.c
@@ -440,14 +440,14 @@ int tcf_em_tree_dump(struct sk_buff *skb, struct tcf_ematch_tree *tree, int tlv)
440 struct nlattr *top_start; 440 struct nlattr *top_start;
441 struct nlattr *list_start; 441 struct nlattr *list_start;
442 442
443 top_start = nla_nest_start(skb, tlv); 443 top_start = nla_nest_start_noflag(skb, tlv);
444 if (top_start == NULL) 444 if (top_start == NULL)
445 goto nla_put_failure; 445 goto nla_put_failure;
446 446
447 if (nla_put(skb, TCA_EMATCH_TREE_HDR, sizeof(tree->hdr), &tree->hdr)) 447 if (nla_put(skb, TCA_EMATCH_TREE_HDR, sizeof(tree->hdr), &tree->hdr))
448 goto nla_put_failure; 448 goto nla_put_failure;
449 449
450 list_start = nla_nest_start(skb, TCA_EMATCH_TREE_LIST); 450 list_start = nla_nest_start_noflag(skb, TCA_EMATCH_TREE_LIST);
451 if (list_start == NULL) 451 if (list_start == NULL)
452 goto nla_put_failure; 452 goto nla_put_failure;
453 453
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index c126b9f78d6e..6c81b22d214f 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -542,7 +542,7 @@ static int qdisc_dump_stab(struct sk_buff *skb, struct qdisc_size_table *stab)
542{ 542{
543 struct nlattr *nest; 543 struct nlattr *nest;
544 544
545 nest = nla_nest_start(skb, TCA_STAB); 545 nest = nla_nest_start_noflag(skb, TCA_STAB);
546 if (nest == NULL) 546 if (nest == NULL)
547 goto nla_put_failure; 547 goto nla_put_failure;
548 if (nla_put(skb, TCA_STAB_BASE, sizeof(stab->szopts), &stab->szopts)) 548 if (nla_put(skb, TCA_STAB_BASE, sizeof(stab->szopts), &stab->szopts))
diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c
index d714d3747bcb..c36aa57eb4af 100644
--- a/net/sched/sch_atm.c
+++ b/net/sched/sch_atm.c
@@ -609,7 +609,7 @@ static int atm_tc_dump_class(struct Qdisc *sch, unsigned long cl,
609 tcm->tcm_handle = flow->common.classid; 609 tcm->tcm_handle = flow->common.classid;
610 tcm->tcm_info = flow->q->handle; 610 tcm->tcm_info = flow->q->handle;
611 611
612 nest = nla_nest_start(skb, TCA_OPTIONS); 612 nest = nla_nest_start_noflag(skb, TCA_OPTIONS);
613 if (nest == NULL) 613 if (nest == NULL)
614 goto nla_put_failure; 614 goto nla_put_failure;
615 615
diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c
index 259d97bc2abd..50db72fe44de 100644
--- a/net/sched/sch_cake.c
+++ b/net/sched/sch_cake.c
@@ -2735,7 +2735,7 @@ static int cake_dump(struct Qdisc *sch, struct sk_buff *skb)
2735 struct cake_sched_data *q = qdisc_priv(sch); 2735 struct cake_sched_data *q = qdisc_priv(sch);
2736 struct nlattr *opts; 2736 struct nlattr *opts;
2737 2737
2738 opts = nla_nest_start(skb, TCA_OPTIONS); 2738 opts = nla_nest_start_noflag(skb, TCA_OPTIONS);
2739 if (!opts) 2739 if (!opts)
2740 goto nla_put_failure; 2740 goto nla_put_failure;
2741 2741
@@ -2806,7 +2806,7 @@ nla_put_failure:
2806 2806
2807static int cake_dump_stats(struct Qdisc *sch, struct gnet_dump *d) 2807static int cake_dump_stats(struct Qdisc *sch, struct gnet_dump *d)
2808{ 2808{
2809 struct nlattr *stats = nla_nest_start(d->skb, TCA_STATS_APP); 2809 struct nlattr *stats = nla_nest_start_noflag(d->skb, TCA_STATS_APP);
2810 struct cake_sched_data *q = qdisc_priv(sch); 2810 struct cake_sched_data *q = qdisc_priv(sch);
2811 struct nlattr *tstats, *ts; 2811 struct nlattr *tstats, *ts;
2812 int i; 2812 int i;
@@ -2836,7 +2836,7 @@ static int cake_dump_stats(struct Qdisc *sch, struct gnet_dump *d)
2836#undef PUT_STAT_U32 2836#undef PUT_STAT_U32
2837#undef PUT_STAT_U64 2837#undef PUT_STAT_U64
2838 2838
2839 tstats = nla_nest_start(d->skb, TCA_CAKE_STATS_TIN_STATS); 2839 tstats = nla_nest_start_noflag(d->skb, TCA_CAKE_STATS_TIN_STATS);
2840 if (!tstats) 2840 if (!tstats)
2841 goto nla_put_failure; 2841 goto nla_put_failure;
2842 2842
@@ -2853,7 +2853,7 @@ static int cake_dump_stats(struct Qdisc *sch, struct gnet_dump *d)
2853 for (i = 0; i < q->tin_cnt; i++) { 2853 for (i = 0; i < q->tin_cnt; i++) {
2854 struct cake_tin_data *b = &q->tins[q->tin_order[i]]; 2854 struct cake_tin_data *b = &q->tins[q->tin_order[i]];
2855 2855
2856 ts = nla_nest_start(d->skb, i + 1); 2856 ts = nla_nest_start_noflag(d->skb, i + 1);
2857 if (!ts) 2857 if (!ts)
2858 goto nla_put_failure; 2858 goto nla_put_failure;
2859 2859
@@ -2973,7 +2973,7 @@ static int cake_dump_class_stats(struct Qdisc *sch, unsigned long cl,
2973 if (flow) { 2973 if (flow) {
2974 ktime_t now = ktime_get(); 2974 ktime_t now = ktime_get();
2975 2975
2976 stats = nla_nest_start(d->skb, TCA_STATS_APP); 2976 stats = nla_nest_start_noflag(d->skb, TCA_STATS_APP);
2977 if (!stats) 2977 if (!stats)
2978 return -1; 2978 return -1;
2979 2979
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
index 114b9048ea7e..243bce4b888b 100644
--- a/net/sched/sch_cbq.c
+++ b/net/sched/sch_cbq.c
@@ -1305,7 +1305,7 @@ static int cbq_dump(struct Qdisc *sch, struct sk_buff *skb)
1305 struct cbq_sched_data *q = qdisc_priv(sch); 1305 struct cbq_sched_data *q = qdisc_priv(sch);
1306 struct nlattr *nest; 1306 struct nlattr *nest;
1307 1307
1308 nest = nla_nest_start(skb, TCA_OPTIONS); 1308 nest = nla_nest_start_noflag(skb, TCA_OPTIONS);
1309 if (nest == NULL) 1309 if (nest == NULL)
1310 goto nla_put_failure; 1310 goto nla_put_failure;
1311 if (cbq_dump_attr(skb, &q->link) < 0) 1311 if (cbq_dump_attr(skb, &q->link) < 0)
@@ -1340,7 +1340,7 @@ cbq_dump_class(struct Qdisc *sch, unsigned long arg,
1340 tcm->tcm_handle = cl->common.classid; 1340 tcm->tcm_handle = cl->common.classid;
1341 tcm->tcm_info = cl->q->handle; 1341 tcm->tcm_info = cl->q->handle;
1342 1342
1343 nest = nla_nest_start(skb, TCA_OPTIONS); 1343 nest = nla_nest_start_noflag(skb, TCA_OPTIONS);
1344 if (nest == NULL) 1344 if (nest == NULL)
1345 goto nla_put_failure; 1345 goto nla_put_failure;
1346 if (cbq_dump_attr(skb, cl) < 0) 1346 if (cbq_dump_attr(skb, cl) < 0)
diff --git a/net/sched/sch_cbs.c b/net/sched/sch_cbs.c
index f68fd7a0e038..adffc6d68c06 100644
--- a/net/sched/sch_cbs.c
+++ b/net/sched/sch_cbs.c
@@ -449,7 +449,7 @@ static int cbs_dump(struct Qdisc *sch, struct sk_buff *skb)
449 struct tc_cbs_qopt opt = { }; 449 struct tc_cbs_qopt opt = { };
450 struct nlattr *nest; 450 struct nlattr *nest;
451 451
452 nest = nla_nest_start(skb, TCA_OPTIONS); 452 nest = nla_nest_start_noflag(skb, TCA_OPTIONS);
453 if (!nest) 453 if (!nest)
454 goto nla_put_failure; 454 goto nla_put_failure;
455 455
diff --git a/net/sched/sch_choke.c b/net/sched/sch_choke.c
index eafc0d17d174..eda21dc94bde 100644
--- a/net/sched/sch_choke.c
+++ b/net/sched/sch_choke.c
@@ -452,7 +452,7 @@ static int choke_dump(struct Qdisc *sch, struct sk_buff *skb)
452 .Scell_log = q->parms.Scell_log, 452 .Scell_log = q->parms.Scell_log,
453 }; 453 };
454 454
455 opts = nla_nest_start(skb, TCA_OPTIONS); 455 opts = nla_nest_start_noflag(skb, TCA_OPTIONS);
456 if (opts == NULL) 456 if (opts == NULL)
457 goto nla_put_failure; 457 goto nla_put_failure;
458 458
diff --git a/net/sched/sch_codel.c b/net/sched/sch_codel.c
index 17cd81f84b5d..60ac4e61ce3a 100644
--- a/net/sched/sch_codel.c
+++ b/net/sched/sch_codel.c
@@ -217,7 +217,7 @@ static int codel_dump(struct Qdisc *sch, struct sk_buff *skb)
217 struct codel_sched_data *q = qdisc_priv(sch); 217 struct codel_sched_data *q = qdisc_priv(sch);
218 struct nlattr *opts; 218 struct nlattr *opts;
219 219
220 opts = nla_nest_start(skb, TCA_OPTIONS); 220 opts = nla_nest_start_noflag(skb, TCA_OPTIONS);
221 if (opts == NULL) 221 if (opts == NULL)
222 goto nla_put_failure; 222 goto nla_put_failure;
223 223
diff --git a/net/sched/sch_drr.c b/net/sched/sch_drr.c
index 430df9a55ec4..022db73fd5a9 100644
--- a/net/sched/sch_drr.c
+++ b/net/sched/sch_drr.c
@@ -244,7 +244,7 @@ static int drr_dump_class(struct Qdisc *sch, unsigned long arg,
244 tcm->tcm_handle = cl->common.classid; 244 tcm->tcm_handle = cl->common.classid;
245 tcm->tcm_info = cl->qdisc->handle; 245 tcm->tcm_info = cl->qdisc->handle;
246 246
247 nest = nla_nest_start(skb, TCA_OPTIONS); 247 nest = nla_nest_start_noflag(skb, TCA_OPTIONS);
248 if (nest == NULL) 248 if (nest == NULL)
249 goto nla_put_failure; 249 goto nla_put_failure;
250 if (nla_put_u32(skb, TCA_DRR_QUANTUM, cl->quantum)) 250 if (nla_put_u32(skb, TCA_DRR_QUANTUM, cl->quantum))
diff --git a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c
index 42471464ded3..cdf744e710f1 100644
--- a/net/sched/sch_dsmark.c
+++ b/net/sched/sch_dsmark.c
@@ -432,7 +432,7 @@ static int dsmark_dump_class(struct Qdisc *sch, unsigned long cl,
432 tcm->tcm_handle = TC_H_MAKE(TC_H_MAJ(sch->handle), cl - 1); 432 tcm->tcm_handle = TC_H_MAKE(TC_H_MAJ(sch->handle), cl - 1);
433 tcm->tcm_info = p->q->handle; 433 tcm->tcm_info = p->q->handle;
434 434
435 opts = nla_nest_start(skb, TCA_OPTIONS); 435 opts = nla_nest_start_noflag(skb, TCA_OPTIONS);
436 if (opts == NULL) 436 if (opts == NULL)
437 goto nla_put_failure; 437 goto nla_put_failure;
438 if (nla_put_u8(skb, TCA_DSMARK_MASK, p->mv[cl - 1].mask) || 438 if (nla_put_u8(skb, TCA_DSMARK_MASK, p->mv[cl - 1].mask) ||
@@ -451,7 +451,7 @@ static int dsmark_dump(struct Qdisc *sch, struct sk_buff *skb)
451 struct dsmark_qdisc_data *p = qdisc_priv(sch); 451 struct dsmark_qdisc_data *p = qdisc_priv(sch);
452 struct nlattr *opts = NULL; 452 struct nlattr *opts = NULL;
453 453
454 opts = nla_nest_start(skb, TCA_OPTIONS); 454 opts = nla_nest_start_noflag(skb, TCA_OPTIONS);
455 if (opts == NULL) 455 if (opts == NULL)
456 goto nla_put_failure; 456 goto nla_put_failure;
457 if (nla_put_u16(skb, TCA_DSMARK_INDICES, p->indices)) 457 if (nla_put_u16(skb, TCA_DSMARK_INDICES, p->indices))
diff --git a/net/sched/sch_etf.c b/net/sched/sch_etf.c
index 1150f22983df..67107caa287c 100644
--- a/net/sched/sch_etf.c
+++ b/net/sched/sch_etf.c
@@ -460,7 +460,7 @@ static int etf_dump(struct Qdisc *sch, struct sk_buff *skb)
460 struct tc_etf_qopt opt = { }; 460 struct tc_etf_qopt opt = { };
461 struct nlattr *nest; 461 struct nlattr *nest;
462 462
463 nest = nla_nest_start(skb, TCA_OPTIONS); 463 nest = nla_nest_start_noflag(skb, TCA_OPTIONS);
464 if (!nest) 464 if (!nest)
465 goto nla_put_failure; 465 goto nla_put_failure;
466 466
diff --git a/net/sched/sch_fq.c b/net/sched/sch_fq.c
index 1a662f2bb7bb..5ca370e78d3a 100644
--- a/net/sched/sch_fq.c
+++ b/net/sched/sch_fq.c
@@ -823,7 +823,7 @@ static int fq_dump(struct Qdisc *sch, struct sk_buff *skb)
823 u64 ce_threshold = q->ce_threshold; 823 u64 ce_threshold = q->ce_threshold;
824 struct nlattr *opts; 824 struct nlattr *opts;
825 825
826 opts = nla_nest_start(skb, TCA_OPTIONS); 826 opts = nla_nest_start_noflag(skb, TCA_OPTIONS);
827 if (opts == NULL) 827 if (opts == NULL)
828 goto nla_put_failure; 828 goto nla_put_failure;
829 829
diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c
index cd04d40c30b6..825a933b019a 100644
--- a/net/sched/sch_fq_codel.c
+++ b/net/sched/sch_fq_codel.c
@@ -527,7 +527,7 @@ static int fq_codel_dump(struct Qdisc *sch, struct sk_buff *skb)
527 struct fq_codel_sched_data *q = qdisc_priv(sch); 527 struct fq_codel_sched_data *q = qdisc_priv(sch);
528 struct nlattr *opts; 528 struct nlattr *opts;
529 529
530 opts = nla_nest_start(skb, TCA_OPTIONS); 530 opts = nla_nest_start_noflag(skb, TCA_OPTIONS);
531 if (opts == NULL) 531 if (opts == NULL)
532 goto nla_put_failure; 532 goto nla_put_failure;
533 533
diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c
index 234afbf9115b..9bfa15e12d23 100644
--- a/net/sched/sch_gred.c
+++ b/net/sched/sch_gred.c
@@ -772,7 +772,7 @@ static int gred_dump(struct Qdisc *sch, struct sk_buff *skb)
772 if (gred_offload_dump_stats(sch)) 772 if (gred_offload_dump_stats(sch))
773 goto nla_put_failure; 773 goto nla_put_failure;
774 774
775 opts = nla_nest_start(skb, TCA_OPTIONS); 775 opts = nla_nest_start_noflag(skb, TCA_OPTIONS);
776 if (opts == NULL) 776 if (opts == NULL)
777 goto nla_put_failure; 777 goto nla_put_failure;
778 if (nla_put(skb, TCA_GRED_DPS, sizeof(sopt), &sopt)) 778 if (nla_put(skb, TCA_GRED_DPS, sizeof(sopt), &sopt))
@@ -790,7 +790,7 @@ static int gred_dump(struct Qdisc *sch, struct sk_buff *skb)
790 goto nla_put_failure; 790 goto nla_put_failure;
791 791
792 /* Old style all-in-one dump of VQs */ 792 /* Old style all-in-one dump of VQs */
793 parms = nla_nest_start(skb, TCA_GRED_PARMS); 793 parms = nla_nest_start_noflag(skb, TCA_GRED_PARMS);
794 if (parms == NULL) 794 if (parms == NULL)
795 goto nla_put_failure; 795 goto nla_put_failure;
796 796
@@ -841,7 +841,7 @@ append_opt:
841 nla_nest_end(skb, parms); 841 nla_nest_end(skb, parms);
842 842
843 /* Dump the VQs again, in more structured way */ 843 /* Dump the VQs again, in more structured way */
844 vqs = nla_nest_start(skb, TCA_GRED_VQ_LIST); 844 vqs = nla_nest_start_noflag(skb, TCA_GRED_VQ_LIST);
845 if (!vqs) 845 if (!vqs)
846 goto nla_put_failure; 846 goto nla_put_failure;
847 847
@@ -852,7 +852,7 @@ append_opt:
852 if (!q) 852 if (!q)
853 continue; 853 continue;
854 854
855 vq = nla_nest_start(skb, TCA_GRED_VQ_ENTRY); 855 vq = nla_nest_start_noflag(skb, TCA_GRED_VQ_ENTRY);
856 if (!vq) 856 if (!vq)
857 goto nla_put_failure; 857 goto nla_put_failure;
858 858
diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c
index d2ab463f22ae..97d2fb91c39f 100644
--- a/net/sched/sch_hfsc.c
+++ b/net/sched/sch_hfsc.c
@@ -1300,7 +1300,7 @@ hfsc_dump_class(struct Qdisc *sch, unsigned long arg, struct sk_buff *skb,
1300 if (cl->level == 0) 1300 if (cl->level == 0)
1301 tcm->tcm_info = cl->qdisc->handle; 1301 tcm->tcm_info = cl->qdisc->handle;
1302 1302
1303 nest = nla_nest_start(skb, TCA_OPTIONS); 1303 nest = nla_nest_start_noflag(skb, TCA_OPTIONS);
1304 if (nest == NULL) 1304 if (nest == NULL)
1305 goto nla_put_failure; 1305 goto nla_put_failure;
1306 if (hfsc_dump_curves(skb, cl) < 0) 1306 if (hfsc_dump_curves(skb, cl) < 0)
diff --git a/net/sched/sch_hhf.c b/net/sched/sch_hhf.c
index 9d6a47697406..43bc159c4f7c 100644
--- a/net/sched/sch_hhf.c
+++ b/net/sched/sch_hhf.c
@@ -654,7 +654,7 @@ static int hhf_dump(struct Qdisc *sch, struct sk_buff *skb)
654 struct hhf_sched_data *q = qdisc_priv(sch); 654 struct hhf_sched_data *q = qdisc_priv(sch);
655 struct nlattr *opts; 655 struct nlattr *opts;
656 656
657 opts = nla_nest_start(skb, TCA_OPTIONS); 657 opts = nla_nest_start_noflag(skb, TCA_OPTIONS);
658 if (opts == NULL) 658 if (opts == NULL)
659 goto nla_put_failure; 659 goto nla_put_failure;
660 660
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 2f9883b196e8..64010aec5437 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -1057,7 +1057,7 @@ static int htb_dump(struct Qdisc *sch, struct sk_buff *skb)
1057 gopt.defcls = q->defcls; 1057 gopt.defcls = q->defcls;
1058 gopt.debug = 0; 1058 gopt.debug = 0;
1059 1059
1060 nest = nla_nest_start(skb, TCA_OPTIONS); 1060 nest = nla_nest_start_noflag(skb, TCA_OPTIONS);
1061 if (nest == NULL) 1061 if (nest == NULL)
1062 goto nla_put_failure; 1062 goto nla_put_failure;
1063 if (nla_put(skb, TCA_HTB_INIT, sizeof(gopt), &gopt) || 1063 if (nla_put(skb, TCA_HTB_INIT, sizeof(gopt), &gopt) ||
@@ -1086,7 +1086,7 @@ static int htb_dump_class(struct Qdisc *sch, unsigned long arg,
1086 if (!cl->level && cl->leaf.q) 1086 if (!cl->level && cl->leaf.q)
1087 tcm->tcm_info = cl->leaf.q->handle; 1087 tcm->tcm_info = cl->leaf.q->handle;
1088 1088
1089 nest = nla_nest_start(skb, TCA_OPTIONS); 1089 nest = nla_nest_start_noflag(skb, TCA_OPTIONS);
1090 if (nest == NULL) 1090 if (nest == NULL)
1091 goto nla_put_failure; 1091 goto nla_put_failure;
1092 1092
diff --git a/net/sched/sch_ingress.c b/net/sched/sch_ingress.c
index ce3f55259d0d..0bac926b46c7 100644
--- a/net/sched/sch_ingress.c
+++ b/net/sched/sch_ingress.c
@@ -106,7 +106,7 @@ static int ingress_dump(struct Qdisc *sch, struct sk_buff *skb)
106{ 106{
107 struct nlattr *nest; 107 struct nlattr *nest;
108 108
109 nest = nla_nest_start(skb, TCA_OPTIONS); 109 nest = nla_nest_start_noflag(skb, TCA_OPTIONS);
110 if (nest == NULL) 110 if (nest == NULL)
111 goto nla_put_failure; 111 goto nla_put_failure;
112 112
diff --git a/net/sched/sch_mqprio.c b/net/sched/sch_mqprio.c
index ea0dc112b38d..7afefed72d35 100644
--- a/net/sched/sch_mqprio.c
+++ b/net/sched/sch_mqprio.c
@@ -349,7 +349,7 @@ static int dump_rates(struct mqprio_sched *priv,
349 int i; 349 int i;
350 350
351 if (priv->flags & TC_MQPRIO_F_MIN_RATE) { 351 if (priv->flags & TC_MQPRIO_F_MIN_RATE) {
352 nest = nla_nest_start(skb, TCA_MQPRIO_MIN_RATE64); 352 nest = nla_nest_start_noflag(skb, TCA_MQPRIO_MIN_RATE64);
353 if (!nest) 353 if (!nest)
354 goto nla_put_failure; 354 goto nla_put_failure;
355 355
@@ -363,7 +363,7 @@ static int dump_rates(struct mqprio_sched *priv,
363 } 363 }
364 364
365 if (priv->flags & TC_MQPRIO_F_MAX_RATE) { 365 if (priv->flags & TC_MQPRIO_F_MAX_RATE) {
366 nest = nla_nest_start(skb, TCA_MQPRIO_MAX_RATE64); 366 nest = nla_nest_start_noflag(skb, TCA_MQPRIO_MAX_RATE64);
367 if (!nest) 367 if (!nest)
368 goto nla_put_failure; 368 goto nla_put_failure;
369 369
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index cc9d8133afcd..0242c0d4a2d0 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -1079,7 +1079,7 @@ static int dump_loss_model(const struct netem_sched_data *q,
1079{ 1079{
1080 struct nlattr *nest; 1080 struct nlattr *nest;
1081 1081
1082 nest = nla_nest_start(skb, TCA_NETEM_LOSS); 1082 nest = nla_nest_start_noflag(skb, TCA_NETEM_LOSS);
1083 if (nest == NULL) 1083 if (nest == NULL)
1084 goto nla_put_failure; 1084 goto nla_put_failure;
1085 1085
diff --git a/net/sched/sch_pie.c b/net/sched/sch_pie.c
index 1cc0c7b74aa3..9bf41f4a2312 100644
--- a/net/sched/sch_pie.c
+++ b/net/sched/sch_pie.c
@@ -491,7 +491,7 @@ static int pie_dump(struct Qdisc *sch, struct sk_buff *skb)
491 struct pie_sched_data *q = qdisc_priv(sch); 491 struct pie_sched_data *q = qdisc_priv(sch);
492 struct nlattr *opts; 492 struct nlattr *opts;
493 493
494 opts = nla_nest_start(skb, TCA_OPTIONS); 494 opts = nla_nest_start_noflag(skb, TCA_OPTIONS);
495 if (!opts) 495 if (!opts)
496 goto nla_put_failure; 496 goto nla_put_failure;
497 497
diff --git a/net/sched/sch_qfq.c b/net/sched/sch_qfq.c
index 1589364b54da..bab2d4026e8b 100644
--- a/net/sched/sch_qfq.c
+++ b/net/sched/sch_qfq.c
@@ -619,7 +619,7 @@ static int qfq_dump_class(struct Qdisc *sch, unsigned long arg,
619 tcm->tcm_handle = cl->common.classid; 619 tcm->tcm_handle = cl->common.classid;
620 tcm->tcm_info = cl->qdisc->handle; 620 tcm->tcm_info = cl->qdisc->handle;
621 621
622 nest = nla_nest_start(skb, TCA_OPTIONS); 622 nest = nla_nest_start_noflag(skb, TCA_OPTIONS);
623 if (nest == NULL) 623 if (nest == NULL)
624 goto nla_put_failure; 624 goto nla_put_failure;
625 if (nla_put_u32(skb, TCA_QFQ_WEIGHT, cl->agg->class_weight) || 625 if (nla_put_u32(skb, TCA_QFQ_WEIGHT, cl->agg->class_weight) ||
diff --git a/net/sched/sch_red.c b/net/sched/sch_red.c
index 4e8c0abf6194..b9f34e057e87 100644
--- a/net/sched/sch_red.c
+++ b/net/sched/sch_red.c
@@ -318,7 +318,7 @@ static int red_dump(struct Qdisc *sch, struct sk_buff *skb)
318 if (err) 318 if (err)
319 goto nla_put_failure; 319 goto nla_put_failure;
320 320
321 opts = nla_nest_start(skb, TCA_OPTIONS); 321 opts = nla_nest_start_noflag(skb, TCA_OPTIONS);
322 if (opts == NULL) 322 if (opts == NULL)
323 goto nla_put_failure; 323 goto nla_put_failure;
324 if (nla_put(skb, TCA_RED_PARMS, sizeof(opt), &opt) || 324 if (nla_put(skb, TCA_RED_PARMS, sizeof(opt), &opt) ||
diff --git a/net/sched/sch_sfb.c b/net/sched/sch_sfb.c
index 2419fdb75966..f54b00a431a3 100644
--- a/net/sched/sch_sfb.c
+++ b/net/sched/sch_sfb.c
@@ -580,7 +580,7 @@ static int sfb_dump(struct Qdisc *sch, struct sk_buff *skb)
580 }; 580 };
581 581
582 sch->qstats.backlog = q->qdisc->qstats.backlog; 582 sch->qstats.backlog = q->qdisc->qstats.backlog;
583 opts = nla_nest_start(skb, TCA_OPTIONS); 583 opts = nla_nest_start_noflag(skb, TCA_OPTIONS);
584 if (opts == NULL) 584 if (opts == NULL)
585 goto nla_put_failure; 585 goto nla_put_failure;
586 if (nla_put(skb, TCA_SFB_PARMS, sizeof(opt), &opt)) 586 if (nla_put(skb, TCA_SFB_PARMS, sizeof(opt), &opt))
diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c
index df848a36b222..e016ee07dd1f 100644
--- a/net/sched/sch_taprio.c
+++ b/net/sched/sch_taprio.c
@@ -841,7 +841,7 @@ static int dump_entry(struct sk_buff *msg,
841{ 841{
842 struct nlattr *item; 842 struct nlattr *item;
843 843
844 item = nla_nest_start(msg, TCA_TAPRIO_SCHED_ENTRY); 844 item = nla_nest_start_noflag(msg, TCA_TAPRIO_SCHED_ENTRY);
845 if (!item) 845 if (!item)
846 return -ENOSPC; 846 return -ENOSPC;
847 847
@@ -883,7 +883,7 @@ static int taprio_dump(struct Qdisc *sch, struct sk_buff *skb)
883 opt.offset[i] = dev->tc_to_txq[i].offset; 883 opt.offset[i] = dev->tc_to_txq[i].offset;
884 } 884 }
885 885
886 nest = nla_nest_start(skb, TCA_OPTIONS); 886 nest = nla_nest_start_noflag(skb, TCA_OPTIONS);
887 if (!nest) 887 if (!nest)
888 return -ENOSPC; 888 return -ENOSPC;
889 889
@@ -897,7 +897,8 @@ static int taprio_dump(struct Qdisc *sch, struct sk_buff *skb)
897 if (nla_put_s32(skb, TCA_TAPRIO_ATTR_SCHED_CLOCKID, q->clockid)) 897 if (nla_put_s32(skb, TCA_TAPRIO_ATTR_SCHED_CLOCKID, q->clockid))
898 goto options_error; 898 goto options_error;
899 899
900 entry_list = nla_nest_start(skb, TCA_TAPRIO_ATTR_SCHED_ENTRY_LIST); 900 entry_list = nla_nest_start_noflag(skb,
901 TCA_TAPRIO_ATTR_SCHED_ENTRY_LIST);
901 if (!entry_list) 902 if (!entry_list)
902 goto options_error; 903 goto options_error;
903 904
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c
index f71578dbb9e3..3ae5a29eeab3 100644
--- a/net/sched/sch_tbf.c
+++ b/net/sched/sch_tbf.c
@@ -448,7 +448,7 @@ static int tbf_dump(struct Qdisc *sch, struct sk_buff *skb)
448 struct tc_tbf_qopt opt; 448 struct tc_tbf_qopt opt;
449 449
450 sch->qstats.backlog = q->qdisc->qstats.backlog; 450 sch->qstats.backlog = q->qdisc->qstats.backlog;
451 nest = nla_nest_start(skb, TCA_OPTIONS); 451 nest = nla_nest_start_noflag(skb, TCA_OPTIONS);
452 if (nest == NULL) 452 if (nest == NULL)
453 goto nla_put_failure; 453 goto nla_put_failure;
454 454
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
index d27f30a9a01d..fd8e4e83f5e0 100644
--- a/net/tipc/bearer.c
+++ b/net/tipc/bearer.c
@@ -687,14 +687,14 @@ static int __tipc_nl_add_bearer(struct tipc_nl_msg *msg,
687 if (!hdr) 687 if (!hdr)
688 return -EMSGSIZE; 688 return -EMSGSIZE;
689 689
690 attrs = nla_nest_start(msg->skb, TIPC_NLA_BEARER); 690 attrs = nla_nest_start_noflag(msg->skb, TIPC_NLA_BEARER);
691 if (!attrs) 691 if (!attrs)
692 goto msg_full; 692 goto msg_full;
693 693
694 if (nla_put_string(msg->skb, TIPC_NLA_BEARER_NAME, bearer->name)) 694 if (nla_put_string(msg->skb, TIPC_NLA_BEARER_NAME, bearer->name))
695 goto attr_msg_full; 695 goto attr_msg_full;
696 696
697 prop = nla_nest_start(msg->skb, TIPC_NLA_BEARER_PROP); 697 prop = nla_nest_start_noflag(msg->skb, TIPC_NLA_BEARER_PROP);
698 if (!prop) 698 if (!prop)
699 goto prop_msg_full; 699 goto prop_msg_full;
700 if (nla_put_u32(msg->skb, TIPC_NLA_PROP_PRIO, bearer->priority)) 700 if (nla_put_u32(msg->skb, TIPC_NLA_PROP_PRIO, bearer->priority))
@@ -1033,14 +1033,14 @@ static int __tipc_nl_add_media(struct tipc_nl_msg *msg,
1033 if (!hdr) 1033 if (!hdr)
1034 return -EMSGSIZE; 1034 return -EMSGSIZE;
1035 1035
1036 attrs = nla_nest_start(msg->skb, TIPC_NLA_MEDIA); 1036 attrs = nla_nest_start_noflag(msg->skb, TIPC_NLA_MEDIA);
1037 if (!attrs) 1037 if (!attrs)
1038 goto msg_full; 1038 goto msg_full;
1039 1039
1040 if (nla_put_string(msg->skb, TIPC_NLA_MEDIA_NAME, media->name)) 1040 if (nla_put_string(msg->skb, TIPC_NLA_MEDIA_NAME, media->name))
1041 goto attr_msg_full; 1041 goto attr_msg_full;
1042 1042
1043 prop = nla_nest_start(msg->skb, TIPC_NLA_MEDIA_PROP); 1043 prop = nla_nest_start_noflag(msg->skb, TIPC_NLA_MEDIA_PROP);
1044 if (!prop) 1044 if (!prop)
1045 goto prop_msg_full; 1045 goto prop_msg_full;
1046 if (nla_put_u32(msg->skb, TIPC_NLA_PROP_PRIO, media->priority)) 1046 if (nla_put_u32(msg->skb, TIPC_NLA_PROP_PRIO, media->priority))
diff --git a/net/tipc/group.c b/net/tipc/group.c
index 63f39201e41e..992be6113676 100644
--- a/net/tipc/group.c
+++ b/net/tipc/group.c
@@ -917,7 +917,7 @@ void tipc_group_member_evt(struct tipc_group *grp,
917 917
918int tipc_group_fill_sock_diag(struct tipc_group *grp, struct sk_buff *skb) 918int tipc_group_fill_sock_diag(struct tipc_group *grp, struct sk_buff *skb)
919{ 919{
920 struct nlattr *group = nla_nest_start(skb, TIPC_NLA_SOCK_GROUP); 920 struct nlattr *group = nla_nest_start_noflag(skb, TIPC_NLA_SOCK_GROUP);
921 921
922 if (!group) 922 if (!group)
923 return -EMSGSIZE; 923 return -EMSGSIZE;
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 6053489c8063..0327c8ff8d48 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -2228,7 +2228,7 @@ static int __tipc_nl_add_stats(struct sk_buff *skb, struct tipc_stats *s)
2228 (s->accu_queue_sz / s->queue_sz_counts) : 0} 2228 (s->accu_queue_sz / s->queue_sz_counts) : 0}
2229 }; 2229 };
2230 2230
2231 stats = nla_nest_start(skb, TIPC_NLA_LINK_STATS); 2231 stats = nla_nest_start_noflag(skb, TIPC_NLA_LINK_STATS);
2232 if (!stats) 2232 if (!stats)
2233 return -EMSGSIZE; 2233 return -EMSGSIZE;
2234 2234
@@ -2260,7 +2260,7 @@ int __tipc_nl_add_link(struct net *net, struct tipc_nl_msg *msg,
2260 if (!hdr) 2260 if (!hdr)
2261 return -EMSGSIZE; 2261 return -EMSGSIZE;
2262 2262
2263 attrs = nla_nest_start(msg->skb, TIPC_NLA_LINK); 2263 attrs = nla_nest_start_noflag(msg->skb, TIPC_NLA_LINK);
2264 if (!attrs) 2264 if (!attrs)
2265 goto msg_full; 2265 goto msg_full;
2266 2266
@@ -2282,7 +2282,7 @@ int __tipc_nl_add_link(struct net *net, struct tipc_nl_msg *msg,
2282 if (nla_put_flag(msg->skb, TIPC_NLA_LINK_ACTIVE)) 2282 if (nla_put_flag(msg->skb, TIPC_NLA_LINK_ACTIVE))
2283 goto attr_msg_full; 2283 goto attr_msg_full;
2284 2284
2285 prop = nla_nest_start(msg->skb, TIPC_NLA_LINK_PROP); 2285 prop = nla_nest_start_noflag(msg->skb, TIPC_NLA_LINK_PROP);
2286 if (!prop) 2286 if (!prop)
2287 goto attr_msg_full; 2287 goto attr_msg_full;
2288 if (nla_put_u32(msg->skb, TIPC_NLA_PROP_PRIO, link->priority)) 2288 if (nla_put_u32(msg->skb, TIPC_NLA_PROP_PRIO, link->priority))
@@ -2349,7 +2349,7 @@ static int __tipc_nl_add_bc_link_stat(struct sk_buff *skb,
2349 (stats->accu_queue_sz / stats->queue_sz_counts) : 0} 2349 (stats->accu_queue_sz / stats->queue_sz_counts) : 0}
2350 }; 2350 };
2351 2351
2352 nest = nla_nest_start(skb, TIPC_NLA_LINK_STATS); 2352 nest = nla_nest_start_noflag(skb, TIPC_NLA_LINK_STATS);
2353 if (!nest) 2353 if (!nest)
2354 return -EMSGSIZE; 2354 return -EMSGSIZE;
2355 2355
@@ -2389,7 +2389,7 @@ int tipc_nl_add_bc_link(struct net *net, struct tipc_nl_msg *msg)
2389 return -EMSGSIZE; 2389 return -EMSGSIZE;
2390 } 2390 }
2391 2391
2392 attrs = nla_nest_start(msg->skb, TIPC_NLA_LINK); 2392 attrs = nla_nest_start_noflag(msg->skb, TIPC_NLA_LINK);
2393 if (!attrs) 2393 if (!attrs)
2394 goto msg_full; 2394 goto msg_full;
2395 2395
@@ -2406,7 +2406,7 @@ int tipc_nl_add_bc_link(struct net *net, struct tipc_nl_msg *msg)
2406 if (nla_put_u32(msg->skb, TIPC_NLA_LINK_TX, 0)) 2406 if (nla_put_u32(msg->skb, TIPC_NLA_LINK_TX, 0))
2407 goto attr_msg_full; 2407 goto attr_msg_full;
2408 2408
2409 prop = nla_nest_start(msg->skb, TIPC_NLA_LINK_PROP); 2409 prop = nla_nest_start_noflag(msg->skb, TIPC_NLA_LINK_PROP);
2410 if (!prop) 2410 if (!prop)
2411 goto attr_msg_full; 2411 goto attr_msg_full;
2412 if (nla_put_u32(msg->skb, TIPC_NLA_PROP_WIN, bcl->window)) 2412 if (nla_put_u32(msg->skb, TIPC_NLA_PROP_WIN, bcl->window))
diff --git a/net/tipc/monitor.c b/net/tipc/monitor.c
index 67f69389ec17..6a6eae88442f 100644
--- a/net/tipc/monitor.c
+++ b/net/tipc/monitor.c
@@ -696,7 +696,7 @@ static int __tipc_nl_add_monitor_peer(struct tipc_peer *peer,
696 if (!hdr) 696 if (!hdr)
697 return -EMSGSIZE; 697 return -EMSGSIZE;
698 698
699 attrs = nla_nest_start(msg->skb, TIPC_NLA_MON_PEER); 699 attrs = nla_nest_start_noflag(msg->skb, TIPC_NLA_MON_PEER);
700 if (!attrs) 700 if (!attrs)
701 goto msg_full; 701 goto msg_full;
702 702
@@ -785,7 +785,7 @@ int __tipc_nl_add_monitor(struct net *net, struct tipc_nl_msg *msg,
785 if (!hdr) 785 if (!hdr)
786 return -EMSGSIZE; 786 return -EMSGSIZE;
787 787
788 attrs = nla_nest_start(msg->skb, TIPC_NLA_MON); 788 attrs = nla_nest_start_noflag(msg->skb, TIPC_NLA_MON);
789 if (!attrs) 789 if (!attrs)
790 goto msg_full; 790 goto msg_full;
791 791
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c
index 89993afe0fbd..66a65c2cdb23 100644
--- a/net/tipc/name_table.c
+++ b/net/tipc/name_table.c
@@ -829,11 +829,11 @@ static int __tipc_nl_add_nametable_publ(struct tipc_nl_msg *msg,
829 if (!hdr) 829 if (!hdr)
830 return -EMSGSIZE; 830 return -EMSGSIZE;
831 831
832 attrs = nla_nest_start(msg->skb, TIPC_NLA_NAME_TABLE); 832 attrs = nla_nest_start_noflag(msg->skb, TIPC_NLA_NAME_TABLE);
833 if (!attrs) 833 if (!attrs)
834 goto msg_full; 834 goto msg_full;
835 835
836 b = nla_nest_start(msg->skb, TIPC_NLA_NAME_TABLE_PUBL); 836 b = nla_nest_start_noflag(msg->skb, TIPC_NLA_NAME_TABLE_PUBL);
837 if (!b) 837 if (!b)
838 goto attr_msg_full; 838 goto attr_msg_full;
839 839
diff --git a/net/tipc/net.c b/net/tipc/net.c
index 7ce1e86b024f..0bba4e6b005c 100644
--- a/net/tipc/net.c
+++ b/net/tipc/net.c
@@ -187,7 +187,7 @@ static int __tipc_nl_add_net(struct net *net, struct tipc_nl_msg *msg)
187 if (!hdr) 187 if (!hdr)
188 return -EMSGSIZE; 188 return -EMSGSIZE;
189 189
190 attrs = nla_nest_start(msg->skb, TIPC_NLA_NET); 190 attrs = nla_nest_start_noflag(msg->skb, TIPC_NLA_NET);
191 if (!attrs) 191 if (!attrs)
192 goto msg_full; 192 goto msg_full;
193 193
diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c
index 340a6e7c43a7..36fe2dbb6d87 100644
--- a/net/tipc/netlink_compat.c
+++ b/net/tipc/netlink_compat.c
@@ -399,7 +399,7 @@ static int tipc_nl_compat_bearer_enable(struct tipc_nl_compat_cmd_doit *cmd,
399 399
400 b = (struct tipc_bearer_config *)TLV_DATA(msg->req); 400 b = (struct tipc_bearer_config *)TLV_DATA(msg->req);
401 401
402 bearer = nla_nest_start(skb, TIPC_NLA_BEARER); 402 bearer = nla_nest_start_noflag(skb, TIPC_NLA_BEARER);
403 if (!bearer) 403 if (!bearer)
404 return -EMSGSIZE; 404 return -EMSGSIZE;
405 405
@@ -419,7 +419,7 @@ static int tipc_nl_compat_bearer_enable(struct tipc_nl_compat_cmd_doit *cmd,
419 return -EMSGSIZE; 419 return -EMSGSIZE;
420 420
421 if (ntohl(b->priority) <= TIPC_MAX_LINK_PRI) { 421 if (ntohl(b->priority) <= TIPC_MAX_LINK_PRI) {
422 prop = nla_nest_start(skb, TIPC_NLA_BEARER_PROP); 422 prop = nla_nest_start_noflag(skb, TIPC_NLA_BEARER_PROP);
423 if (!prop) 423 if (!prop)
424 return -EMSGSIZE; 424 return -EMSGSIZE;
425 if (nla_put_u32(skb, TIPC_NLA_PROP_PRIO, ntohl(b->priority))) 425 if (nla_put_u32(skb, TIPC_NLA_PROP_PRIO, ntohl(b->priority)))
@@ -441,7 +441,7 @@ static int tipc_nl_compat_bearer_disable(struct tipc_nl_compat_cmd_doit *cmd,
441 441
442 name = (char *)TLV_DATA(msg->req); 442 name = (char *)TLV_DATA(msg->req);
443 443
444 bearer = nla_nest_start(skb, TIPC_NLA_BEARER); 444 bearer = nla_nest_start_noflag(skb, TIPC_NLA_BEARER);
445 if (!bearer) 445 if (!bearer)
446 return -EMSGSIZE; 446 return -EMSGSIZE;
447 447
@@ -685,7 +685,7 @@ static int tipc_nl_compat_media_set(struct sk_buff *skb,
685 685
686 lc = (struct tipc_link_config *)TLV_DATA(msg->req); 686 lc = (struct tipc_link_config *)TLV_DATA(msg->req);
687 687
688 media = nla_nest_start(skb, TIPC_NLA_MEDIA); 688 media = nla_nest_start_noflag(skb, TIPC_NLA_MEDIA);
689 if (!media) 689 if (!media)
690 return -EMSGSIZE; 690 return -EMSGSIZE;
691 691
@@ -696,7 +696,7 @@ static int tipc_nl_compat_media_set(struct sk_buff *skb,
696 if (nla_put_string(skb, TIPC_NLA_MEDIA_NAME, lc->name)) 696 if (nla_put_string(skb, TIPC_NLA_MEDIA_NAME, lc->name))
697 return -EMSGSIZE; 697 return -EMSGSIZE;
698 698
699 prop = nla_nest_start(skb, TIPC_NLA_MEDIA_PROP); 699 prop = nla_nest_start_noflag(skb, TIPC_NLA_MEDIA_PROP);
700 if (!prop) 700 if (!prop)
701 return -EMSGSIZE; 701 return -EMSGSIZE;
702 702
@@ -717,7 +717,7 @@ static int tipc_nl_compat_bearer_set(struct sk_buff *skb,
717 717
718 lc = (struct tipc_link_config *)TLV_DATA(msg->req); 718 lc = (struct tipc_link_config *)TLV_DATA(msg->req);
719 719
720 bearer = nla_nest_start(skb, TIPC_NLA_BEARER); 720 bearer = nla_nest_start_noflag(skb, TIPC_NLA_BEARER);
721 if (!bearer) 721 if (!bearer)
722 return -EMSGSIZE; 722 return -EMSGSIZE;
723 723
@@ -728,7 +728,7 @@ static int tipc_nl_compat_bearer_set(struct sk_buff *skb,
728 if (nla_put_string(skb, TIPC_NLA_BEARER_NAME, lc->name)) 728 if (nla_put_string(skb, TIPC_NLA_BEARER_NAME, lc->name))
729 return -EMSGSIZE; 729 return -EMSGSIZE;
730 730
731 prop = nla_nest_start(skb, TIPC_NLA_BEARER_PROP); 731 prop = nla_nest_start_noflag(skb, TIPC_NLA_BEARER_PROP);
732 if (!prop) 732 if (!prop)
733 return -EMSGSIZE; 733 return -EMSGSIZE;
734 734
@@ -748,14 +748,14 @@ static int __tipc_nl_compat_link_set(struct sk_buff *skb,
748 748
749 lc = (struct tipc_link_config *)TLV_DATA(msg->req); 749 lc = (struct tipc_link_config *)TLV_DATA(msg->req);
750 750
751 link = nla_nest_start(skb, TIPC_NLA_LINK); 751 link = nla_nest_start_noflag(skb, TIPC_NLA_LINK);
752 if (!link) 752 if (!link)
753 return -EMSGSIZE; 753 return -EMSGSIZE;
754 754
755 if (nla_put_string(skb, TIPC_NLA_LINK_NAME, lc->name)) 755 if (nla_put_string(skb, TIPC_NLA_LINK_NAME, lc->name))
756 return -EMSGSIZE; 756 return -EMSGSIZE;
757 757
758 prop = nla_nest_start(skb, TIPC_NLA_LINK_PROP); 758 prop = nla_nest_start_noflag(skb, TIPC_NLA_LINK_PROP);
759 if (!prop) 759 if (!prop)
760 return -EMSGSIZE; 760 return -EMSGSIZE;
761 761
@@ -811,7 +811,7 @@ static int tipc_nl_compat_link_reset_stats(struct tipc_nl_compat_cmd_doit *cmd,
811 811
812 name = (char *)TLV_DATA(msg->req); 812 name = (char *)TLV_DATA(msg->req);
813 813
814 link = nla_nest_start(skb, TIPC_NLA_LINK); 814 link = nla_nest_start_noflag(skb, TIPC_NLA_LINK);
815 if (!link) 815 if (!link)
816 return -EMSGSIZE; 816 return -EMSGSIZE;
817 817
@@ -973,7 +973,7 @@ static int tipc_nl_compat_publ_dump(struct tipc_nl_compat_msg *msg, u32 sock)
973 return -EMSGSIZE; 973 return -EMSGSIZE;
974 } 974 }
975 975
976 nest = nla_nest_start(args, TIPC_NLA_SOCK); 976 nest = nla_nest_start_noflag(args, TIPC_NLA_SOCK);
977 if (!nest) { 977 if (!nest) {
978 kfree_skb(args); 978 kfree_skb(args);
979 return -EMSGSIZE; 979 return -EMSGSIZE;
@@ -1100,7 +1100,7 @@ static int tipc_nl_compat_net_set(struct tipc_nl_compat_cmd_doit *cmd,
1100 1100
1101 val = ntohl(*(__be32 *)TLV_DATA(msg->req)); 1101 val = ntohl(*(__be32 *)TLV_DATA(msg->req));
1102 1102
1103 net = nla_nest_start(skb, TIPC_NLA_NET); 1103 net = nla_nest_start_noflag(skb, TIPC_NLA_NET);
1104 if (!net) 1104 if (!net)
1105 return -EMSGSIZE; 1105 return -EMSGSIZE;
1106 1106
diff --git a/net/tipc/node.c b/net/tipc/node.c
index 7478e2d4ec02..3777254a508f 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -1359,7 +1359,7 @@ static int __tipc_nl_add_node(struct tipc_nl_msg *msg, struct tipc_node *node)
1359 if (!hdr) 1359 if (!hdr)
1360 return -EMSGSIZE; 1360 return -EMSGSIZE;
1361 1361
1362 attrs = nla_nest_start(msg->skb, TIPC_NLA_NODE); 1362 attrs = nla_nest_start_noflag(msg->skb, TIPC_NLA_NODE);
1363 if (!attrs) 1363 if (!attrs)
1364 goto msg_full; 1364 goto msg_full;
1365 1365
@@ -2353,7 +2353,7 @@ static int __tipc_nl_add_monitor_prop(struct net *net, struct tipc_nl_msg *msg)
2353 if (!hdr) 2353 if (!hdr)
2354 return -EMSGSIZE; 2354 return -EMSGSIZE;
2355 2355
2356 attrs = nla_nest_start(msg->skb, TIPC_NLA_MON); 2356 attrs = nla_nest_start_noflag(msg->skb, TIPC_NLA_MON);
2357 if (!attrs) 2357 if (!attrs)
2358 goto msg_full; 2358 goto msg_full;
2359 2359
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 1385207a301f..7918f4763fdc 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -3273,7 +3273,7 @@ static int __tipc_nl_add_sk_con(struct sk_buff *skb, struct tipc_sock *tsk)
3273 peer_node = tsk_peer_node(tsk); 3273 peer_node = tsk_peer_node(tsk);
3274 peer_port = tsk_peer_port(tsk); 3274 peer_port = tsk_peer_port(tsk);
3275 3275
3276 nest = nla_nest_start(skb, TIPC_NLA_SOCK_CON); 3276 nest = nla_nest_start_noflag(skb, TIPC_NLA_SOCK_CON);
3277 if (!nest) 3277 if (!nest)
3278 return -EMSGSIZE; 3278 return -EMSGSIZE;
3279 3279
@@ -3332,7 +3332,7 @@ static int __tipc_nl_add_sk(struct sk_buff *skb, struct netlink_callback *cb,
3332 if (!hdr) 3332 if (!hdr)
3333 goto msg_cancel; 3333 goto msg_cancel;
3334 3334
3335 attrs = nla_nest_start(skb, TIPC_NLA_SOCK); 3335 attrs = nla_nest_start_noflag(skb, TIPC_NLA_SOCK);
3336 if (!attrs) 3336 if (!attrs)
3337 goto genlmsg_cancel; 3337 goto genlmsg_cancel;
3338 3338
@@ -3437,7 +3437,7 @@ int tipc_sk_fill_sock_diag(struct sk_buff *skb, struct netlink_callback *cb,
3437 if (!(sk_filter_state & (1 << sk->sk_state))) 3437 if (!(sk_filter_state & (1 << sk->sk_state)))
3438 return 0; 3438 return 0;
3439 3439
3440 attrs = nla_nest_start(skb, TIPC_NLA_SOCK); 3440 attrs = nla_nest_start_noflag(skb, TIPC_NLA_SOCK);
3441 if (!attrs) 3441 if (!attrs)
3442 goto msg_cancel; 3442 goto msg_cancel;
3443 3443
@@ -3455,7 +3455,7 @@ int tipc_sk_fill_sock_diag(struct sk_buff *skb, struct netlink_callback *cb,
3455 TIPC_NLA_SOCK_PAD)) 3455 TIPC_NLA_SOCK_PAD))
3456 goto attr_msg_cancel; 3456 goto attr_msg_cancel;
3457 3457
3458 stat = nla_nest_start(skb, TIPC_NLA_SOCK_STAT); 3458 stat = nla_nest_start_noflag(skb, TIPC_NLA_SOCK_STAT);
3459 if (!stat) 3459 if (!stat)
3460 goto attr_msg_cancel; 3460 goto attr_msg_cancel;
3461 3461
@@ -3512,7 +3512,7 @@ static int __tipc_nl_add_sk_publ(struct sk_buff *skb,
3512 if (!hdr) 3512 if (!hdr)
3513 goto msg_cancel; 3513 goto msg_cancel;
3514 3514
3515 attrs = nla_nest_start(skb, TIPC_NLA_PUBL); 3515 attrs = nla_nest_start_noflag(skb, TIPC_NLA_PUBL);
3516 if (!attrs) 3516 if (!attrs)
3517 goto genlmsg_cancel; 3517 goto genlmsg_cancel;
3518 3518
diff --git a/net/tipc/udp_media.c b/net/tipc/udp_media.c
index 0884a1b8ad12..24d7c79598bb 100644
--- a/net/tipc/udp_media.c
+++ b/net/tipc/udp_media.c
@@ -523,7 +523,7 @@ int tipc_udp_nl_add_bearer_data(struct tipc_nl_msg *msg, struct tipc_bearer *b)
523 if (!ub) 523 if (!ub)
524 return -ENODEV; 524 return -ENODEV;
525 525
526 nest = nla_nest_start(msg->skb, TIPC_NLA_BEARER_UDP_OPTS); 526 nest = nla_nest_start_noflag(msg->skb, TIPC_NLA_BEARER_UDP_OPTS);
527 if (!nest) 527 if (!nest)
528 goto msg_full; 528 goto msg_full;
529 529
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index e74d21f4108a..0bcd5ea4b4f2 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -755,13 +755,13 @@ static int nl80211_msg_put_wmm_rules(struct sk_buff *msg,
755{ 755{
756 int j; 756 int j;
757 struct nlattr *nl_wmm_rules = 757 struct nlattr *nl_wmm_rules =
758 nla_nest_start(msg, NL80211_FREQUENCY_ATTR_WMM); 758 nla_nest_start_noflag(msg, NL80211_FREQUENCY_ATTR_WMM);
759 759
760 if (!nl_wmm_rules) 760 if (!nl_wmm_rules)
761 goto nla_put_failure; 761 goto nla_put_failure;
762 762
763 for (j = 0; j < IEEE80211_NUM_ACS; j++) { 763 for (j = 0; j < IEEE80211_NUM_ACS; j++) {
764 struct nlattr *nl_wmm_rule = nla_nest_start(msg, j); 764 struct nlattr *nl_wmm_rule = nla_nest_start_noflag(msg, j);
765 765
766 if (!nl_wmm_rule) 766 if (!nl_wmm_rule)
767 goto nla_put_failure; 767 goto nla_put_failure;
@@ -890,7 +890,7 @@ static bool nl80211_put_txq_stats(struct sk_buff *msg,
890 return false; \ 890 return false; \
891 } while (0) 891 } while (0)
892 892
893 txqattr = nla_nest_start(msg, attrtype); 893 txqattr = nla_nest_start_noflag(msg, attrtype);
894 if (!txqattr) 894 if (!txqattr)
895 return false; 895 return false;
896 896
@@ -1205,7 +1205,7 @@ static struct ieee80211_channel *nl80211_get_valid_chan(struct wiphy *wiphy,
1205 1205
1206static int nl80211_put_iftypes(struct sk_buff *msg, u32 attr, u16 ifmodes) 1206static int nl80211_put_iftypes(struct sk_buff *msg, u32 attr, u16 ifmodes)
1207{ 1207{
1208 struct nlattr *nl_modes = nla_nest_start(msg, attr); 1208 struct nlattr *nl_modes = nla_nest_start_noflag(msg, attr);
1209 int i; 1209 int i;
1210 1210
1211 if (!nl_modes) 1211 if (!nl_modes)
@@ -1233,8 +1233,8 @@ static int nl80211_put_iface_combinations(struct wiphy *wiphy,
1233 struct nlattr *nl_combis; 1233 struct nlattr *nl_combis;
1234 int i, j; 1234 int i, j;
1235 1235
1236 nl_combis = nla_nest_start(msg, 1236 nl_combis = nla_nest_start_noflag(msg,
1237 NL80211_ATTR_INTERFACE_COMBINATIONS); 1237 NL80211_ATTR_INTERFACE_COMBINATIONS);
1238 if (!nl_combis) 1238 if (!nl_combis)
1239 goto nla_put_failure; 1239 goto nla_put_failure;
1240 1240
@@ -1244,18 +1244,19 @@ static int nl80211_put_iface_combinations(struct wiphy *wiphy,
1244 1244
1245 c = &wiphy->iface_combinations[i]; 1245 c = &wiphy->iface_combinations[i];
1246 1246
1247 nl_combi = nla_nest_start(msg, i + 1); 1247 nl_combi = nla_nest_start_noflag(msg, i + 1);
1248 if (!nl_combi) 1248 if (!nl_combi)
1249 goto nla_put_failure; 1249 goto nla_put_failure;
1250 1250
1251 nl_limits = nla_nest_start(msg, NL80211_IFACE_COMB_LIMITS); 1251 nl_limits = nla_nest_start_noflag(msg,
1252 NL80211_IFACE_COMB_LIMITS);
1252 if (!nl_limits) 1253 if (!nl_limits)
1253 goto nla_put_failure; 1254 goto nla_put_failure;
1254 1255
1255 for (j = 0; j < c->n_limits; j++) { 1256 for (j = 0; j < c->n_limits; j++) {
1256 struct nlattr *nl_limit; 1257 struct nlattr *nl_limit;
1257 1258
1258 nl_limit = nla_nest_start(msg, j + 1); 1259 nl_limit = nla_nest_start_noflag(msg, j + 1);
1259 if (!nl_limit) 1260 if (!nl_limit)
1260 goto nla_put_failure; 1261 goto nla_put_failure;
1261 if (nla_put_u32(msg, NL80211_IFACE_LIMIT_MAX, 1262 if (nla_put_u32(msg, NL80211_IFACE_LIMIT_MAX,
@@ -1308,7 +1309,8 @@ static int nl80211_send_wowlan_tcp_caps(struct cfg80211_registered_device *rdev,
1308 if (!tcp) 1309 if (!tcp)
1309 return 0; 1310 return 0;
1310 1311
1311 nl_tcp = nla_nest_start(msg, NL80211_WOWLAN_TRIG_TCP_CONNECTION); 1312 nl_tcp = nla_nest_start_noflag(msg,
1313 NL80211_WOWLAN_TRIG_TCP_CONNECTION);
1312 if (!nl_tcp) 1314 if (!nl_tcp)
1313 return -ENOBUFS; 1315 return -ENOBUFS;
1314 1316
@@ -1348,7 +1350,8 @@ static int nl80211_send_wowlan(struct sk_buff *msg,
1348 if (!rdev->wiphy.wowlan) 1350 if (!rdev->wiphy.wowlan)
1349 return 0; 1351 return 0;
1350 1352
1351 nl_wowlan = nla_nest_start(msg, NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED); 1353 nl_wowlan = nla_nest_start_noflag(msg,
1354 NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED);
1352 if (!nl_wowlan) 1355 if (!nl_wowlan)
1353 return -ENOBUFS; 1356 return -ENOBUFS;
1354 1357
@@ -1477,7 +1480,8 @@ static int nl80211_send_band_rateinfo(struct sk_buff *msg,
1477 1480
1478 if (sband->n_iftype_data) { 1481 if (sband->n_iftype_data) {
1479 struct nlattr *nl_iftype_data = 1482 struct nlattr *nl_iftype_data =
1480 nla_nest_start(msg, NL80211_BAND_ATTR_IFTYPE_DATA); 1483 nla_nest_start_noflag(msg,
1484 NL80211_BAND_ATTR_IFTYPE_DATA);
1481 int err; 1485 int err;
1482 1486
1483 if (!nl_iftype_data) 1487 if (!nl_iftype_data)
@@ -1486,7 +1490,7 @@ static int nl80211_send_band_rateinfo(struct sk_buff *msg,
1486 for (i = 0; i < sband->n_iftype_data; i++) { 1490 for (i = 0; i < sband->n_iftype_data; i++) {
1487 struct nlattr *iftdata; 1491 struct nlattr *iftdata;
1488 1492
1489 iftdata = nla_nest_start(msg, i + 1); 1493 iftdata = nla_nest_start_noflag(msg, i + 1);
1490 if (!iftdata) 1494 if (!iftdata)
1491 return -ENOBUFS; 1495 return -ENOBUFS;
1492 1496
@@ -1502,12 +1506,12 @@ static int nl80211_send_band_rateinfo(struct sk_buff *msg,
1502 } 1506 }
1503 1507
1504 /* add bitrates */ 1508 /* add bitrates */
1505 nl_rates = nla_nest_start(msg, NL80211_BAND_ATTR_RATES); 1509 nl_rates = nla_nest_start_noflag(msg, NL80211_BAND_ATTR_RATES);
1506 if (!nl_rates) 1510 if (!nl_rates)
1507 return -ENOBUFS; 1511 return -ENOBUFS;
1508 1512
1509 for (i = 0; i < sband->n_bitrates; i++) { 1513 for (i = 0; i < sband->n_bitrates; i++) {
1510 nl_rate = nla_nest_start(msg, i); 1514 nl_rate = nla_nest_start_noflag(msg, i);
1511 if (!nl_rate) 1515 if (!nl_rate)
1512 return -ENOBUFS; 1516 return -ENOBUFS;
1513 1517
@@ -1540,12 +1544,12 @@ nl80211_send_mgmt_stypes(struct sk_buff *msg,
1540 if (!mgmt_stypes) 1544 if (!mgmt_stypes)
1541 return 0; 1545 return 0;
1542 1546
1543 nl_ifs = nla_nest_start(msg, NL80211_ATTR_TX_FRAME_TYPES); 1547 nl_ifs = nla_nest_start_noflag(msg, NL80211_ATTR_TX_FRAME_TYPES);
1544 if (!nl_ifs) 1548 if (!nl_ifs)
1545 return -ENOBUFS; 1549 return -ENOBUFS;
1546 1550
1547 for (ift = 0; ift < NUM_NL80211_IFTYPES; ift++) { 1551 for (ift = 0; ift < NUM_NL80211_IFTYPES; ift++) {
1548 nl_ftypes = nla_nest_start(msg, ift); 1552 nl_ftypes = nla_nest_start_noflag(msg, ift);
1549 if (!nl_ftypes) 1553 if (!nl_ftypes)
1550 return -ENOBUFS; 1554 return -ENOBUFS;
1551 i = 0; 1555 i = 0;
@@ -1563,12 +1567,12 @@ nl80211_send_mgmt_stypes(struct sk_buff *msg,
1563 1567
1564 nla_nest_end(msg, nl_ifs); 1568 nla_nest_end(msg, nl_ifs);
1565 1569
1566 nl_ifs = nla_nest_start(msg, NL80211_ATTR_RX_FRAME_TYPES); 1570 nl_ifs = nla_nest_start_noflag(msg, NL80211_ATTR_RX_FRAME_TYPES);
1567 if (!nl_ifs) 1571 if (!nl_ifs)
1568 return -ENOBUFS; 1572 return -ENOBUFS;
1569 1573
1570 for (ift = 0; ift < NUM_NL80211_IFTYPES; ift++) { 1574 for (ift = 0; ift < NUM_NL80211_IFTYPES; ift++) {
1571 nl_ftypes = nla_nest_start(msg, ift); 1575 nl_ftypes = nla_nest_start_noflag(msg, ift);
1572 if (!nl_ftypes) 1576 if (!nl_ftypes)
1573 return -ENOBUFS; 1577 return -ENOBUFS;
1574 i = 0; 1578 i = 0;
@@ -1686,7 +1690,7 @@ nl80211_send_pmsr_ftm_capa(const struct cfg80211_pmsr_capabilities *cap,
1686 if (!cap->ftm.supported) 1690 if (!cap->ftm.supported)
1687 return 0; 1691 return 0;
1688 1692
1689 ftm = nla_nest_start(msg, NL80211_PMSR_TYPE_FTM); 1693 ftm = nla_nest_start_noflag(msg, NL80211_PMSR_TYPE_FTM);
1690 if (!ftm) 1694 if (!ftm)
1691 return -ENOBUFS; 1695 return -ENOBUFS;
1692 1696
@@ -1734,7 +1738,7 @@ static int nl80211_send_pmsr_capa(struct cfg80211_registered_device *rdev,
1734 * will genlmsg_cancel() if we fail 1738 * will genlmsg_cancel() if we fail
1735 */ 1739 */
1736 1740
1737 pmsr = nla_nest_start(msg, NL80211_ATTR_PEER_MEASUREMENTS); 1741 pmsr = nla_nest_start_noflag(msg, NL80211_ATTR_PEER_MEASUREMENTS);
1738 if (!pmsr) 1742 if (!pmsr)
1739 return -ENOBUFS; 1743 return -ENOBUFS;
1740 1744
@@ -1749,7 +1753,7 @@ static int nl80211_send_pmsr_capa(struct cfg80211_registered_device *rdev,
1749 nla_put_flag(msg, NL80211_PMSR_ATTR_RANDOMIZE_MAC_ADDR)) 1753 nla_put_flag(msg, NL80211_PMSR_ATTR_RANDOMIZE_MAC_ADDR))
1750 return -ENOBUFS; 1754 return -ENOBUFS;
1751 1755
1752 caps = nla_nest_start(msg, NL80211_PMSR_ATTR_TYPE_CAPA); 1756 caps = nla_nest_start_noflag(msg, NL80211_PMSR_ATTR_TYPE_CAPA);
1753 if (!caps) 1757 if (!caps)
1754 return -ENOBUFS; 1758 return -ENOBUFS;
1755 1759
@@ -1910,7 +1914,8 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
1910 break; 1914 break;
1911 /* fall through */ 1915 /* fall through */
1912 case 3: 1916 case 3:
1913 nl_bands = nla_nest_start(msg, NL80211_ATTR_WIPHY_BANDS); 1917 nl_bands = nla_nest_start_noflag(msg,
1918 NL80211_ATTR_WIPHY_BANDS);
1914 if (!nl_bands) 1919 if (!nl_bands)
1915 goto nla_put_failure; 1920 goto nla_put_failure;
1916 1921
@@ -1923,7 +1928,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
1923 if (!sband) 1928 if (!sband)
1924 continue; 1929 continue;
1925 1930
1926 nl_band = nla_nest_start(msg, band); 1931 nl_band = nla_nest_start_noflag(msg, band);
1927 if (!nl_band) 1932 if (!nl_band)
1928 goto nla_put_failure; 1933 goto nla_put_failure;
1929 1934
@@ -1937,15 +1942,16 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
1937 /* fall through */ 1942 /* fall through */
1938 default: 1943 default:
1939 /* add frequencies */ 1944 /* add frequencies */
1940 nl_freqs = nla_nest_start( 1945 nl_freqs = nla_nest_start_noflag(msg,
1941 msg, NL80211_BAND_ATTR_FREQS); 1946 NL80211_BAND_ATTR_FREQS);
1942 if (!nl_freqs) 1947 if (!nl_freqs)
1943 goto nla_put_failure; 1948 goto nla_put_failure;
1944 1949
1945 for (i = state->chan_start - 1; 1950 for (i = state->chan_start - 1;
1946 i < sband->n_channels; 1951 i < sband->n_channels;
1947 i++) { 1952 i++) {
1948 nl_freq = nla_nest_start(msg, i); 1953 nl_freq = nla_nest_start_noflag(msg,
1954 i);
1949 if (!nl_freq) 1955 if (!nl_freq)
1950 goto nla_put_failure; 1956 goto nla_put_failure;
1951 1957
@@ -1990,7 +1996,8 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
1990 break; 1996 break;
1991 /* fall through */ 1997 /* fall through */
1992 case 4: 1998 case 4:
1993 nl_cmds = nla_nest_start(msg, NL80211_ATTR_SUPPORTED_COMMANDS); 1999 nl_cmds = nla_nest_start_noflag(msg,
2000 NL80211_ATTR_SUPPORTED_COMMANDS);
1994 if (!nl_cmds) 2001 if (!nl_cmds)
1995 goto nla_put_failure; 2002 goto nla_put_failure;
1996 2003
@@ -2138,7 +2145,8 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
2138 const struct nl80211_vendor_cmd_info *info; 2145 const struct nl80211_vendor_cmd_info *info;
2139 struct nlattr *nested; 2146 struct nlattr *nested;
2140 2147
2141 nested = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA); 2148 nested = nla_nest_start_noflag(msg,
2149 NL80211_ATTR_VENDOR_DATA);
2142 if (!nested) 2150 if (!nested)
2143 goto nla_put_failure; 2151 goto nla_put_failure;
2144 2152
@@ -2154,8 +2162,8 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
2154 const struct nl80211_vendor_cmd_info *info; 2162 const struct nl80211_vendor_cmd_info *info;
2155 struct nlattr *nested; 2163 struct nlattr *nested;
2156 2164
2157 nested = nla_nest_start(msg, 2165 nested = nla_nest_start_noflag(msg,
2158 NL80211_ATTR_VENDOR_EVENTS); 2166 NL80211_ATTR_VENDOR_EVENTS);
2159 if (!nested) 2167 if (!nested)
2160 goto nla_put_failure; 2168 goto nla_put_failure;
2161 2169
@@ -2192,7 +2200,8 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
2192 struct nlattr *nested; 2200 struct nlattr *nested;
2193 u32 bss_select_support = rdev->wiphy.bss_select_support; 2201 u32 bss_select_support = rdev->wiphy.bss_select_support;
2194 2202
2195 nested = nla_nest_start(msg, NL80211_ATTR_BSS_SELECT); 2203 nested = nla_nest_start_noflag(msg,
2204 NL80211_ATTR_BSS_SELECT);
2196 if (!nested) 2205 if (!nested)
2197 goto nla_put_failure; 2206 goto nla_put_failure;
2198 2207
@@ -2214,8 +2223,8 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
2214 rdev->wiphy.iftype_ext_capab) { 2223 rdev->wiphy.iftype_ext_capab) {
2215 struct nlattr *nested_ext_capab, *nested; 2224 struct nlattr *nested_ext_capab, *nested;
2216 2225
2217 nested = nla_nest_start(msg, 2226 nested = nla_nest_start_noflag(msg,
2218 NL80211_ATTR_IFTYPE_EXT_CAPA); 2227 NL80211_ATTR_IFTYPE_EXT_CAPA);
2219 if (!nested) 2228 if (!nested)
2220 goto nla_put_failure; 2229 goto nla_put_failure;
2221 2230
@@ -2225,7 +2234,8 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
2225 2234
2226 capab = &rdev->wiphy.iftype_ext_capab[i]; 2235 capab = &rdev->wiphy.iftype_ext_capab[i];
2227 2236
2228 nested_ext_capab = nla_nest_start(msg, i); 2237 nested_ext_capab = nla_nest_start_noflag(msg,
2238 i);
2229 if (!nested_ext_capab || 2239 if (!nested_ext_capab ||
2230 nla_put_u32(msg, NL80211_ATTR_IFTYPE, 2240 nla_put_u32(msg, NL80211_ATTR_IFTYPE,
2231 capab->iftype) || 2241 capab->iftype) ||
@@ -3539,7 +3549,7 @@ static void get_key_callback(void *c, struct key_params *params)
3539 params->cipher))) 3549 params->cipher)))
3540 goto nla_put_failure; 3550 goto nla_put_failure;
3541 3551
3542 key = nla_nest_start(cookie->msg, NL80211_ATTR_KEY); 3552 key = nla_nest_start_noflag(cookie->msg, NL80211_ATTR_KEY);
3543 if (!key) 3553 if (!key)
3544 goto nla_put_failure; 3554 goto nla_put_failure;
3545 3555
@@ -4723,7 +4733,7 @@ bool nl80211_put_sta_rate(struct sk_buff *msg, struct rate_info *info, int attr)
4723 u16 bitrate_compat; 4733 u16 bitrate_compat;
4724 enum nl80211_rate_info rate_flg; 4734 enum nl80211_rate_info rate_flg;
4725 4735
4726 rate = nla_nest_start(msg, attr); 4736 rate = nla_nest_start_noflag(msg, attr);
4727 if (!rate) 4737 if (!rate)
4728 return false; 4738 return false;
4729 4739
@@ -4810,7 +4820,7 @@ static bool nl80211_put_signal(struct sk_buff *msg, u8 mask, s8 *signal,
4810 if (!mask) 4820 if (!mask)
4811 return true; 4821 return true;
4812 4822
4813 attr = nla_nest_start(msg, id); 4823 attr = nla_nest_start_noflag(msg, id);
4814 if (!attr) 4824 if (!attr)
4815 return false; 4825 return false;
4816 4826
@@ -4845,7 +4855,7 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid,
4845 nla_put_u32(msg, NL80211_ATTR_GENERATION, sinfo->generation)) 4855 nla_put_u32(msg, NL80211_ATTR_GENERATION, sinfo->generation))
4846 goto nla_put_failure; 4856 goto nla_put_failure;
4847 4857
4848 sinfoattr = nla_nest_start(msg, NL80211_ATTR_STA_INFO); 4858 sinfoattr = nla_nest_start_noflag(msg, NL80211_ATTR_STA_INFO);
4849 if (!sinfoattr) 4859 if (!sinfoattr)
4850 goto nla_put_failure; 4860 goto nla_put_failure;
4851 4861
@@ -4934,7 +4944,8 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid,
4934 PUT_SINFO(CONNECTED_TO_GATE, connected_to_gate, u8); 4944 PUT_SINFO(CONNECTED_TO_GATE, connected_to_gate, u8);
4935 4945
4936 if (sinfo->filled & BIT_ULL(NL80211_STA_INFO_BSS_PARAM)) { 4946 if (sinfo->filled & BIT_ULL(NL80211_STA_INFO_BSS_PARAM)) {
4937 bss_param = nla_nest_start(msg, NL80211_STA_INFO_BSS_PARAM); 4947 bss_param = nla_nest_start_noflag(msg,
4948 NL80211_STA_INFO_BSS_PARAM);
4938 if (!bss_param) 4949 if (!bss_param)
4939 goto nla_put_failure; 4950 goto nla_put_failure;
4940 4951
@@ -4977,7 +4988,8 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid,
4977 struct nlattr *tidsattr; 4988 struct nlattr *tidsattr;
4978 int tid; 4989 int tid;
4979 4990
4980 tidsattr = nla_nest_start(msg, NL80211_STA_INFO_TID_STATS); 4991 tidsattr = nla_nest_start_noflag(msg,
4992 NL80211_STA_INFO_TID_STATS);
4981 if (!tidsattr) 4993 if (!tidsattr)
4982 goto nla_put_failure; 4994 goto nla_put_failure;
4983 4995
@@ -4990,7 +5002,7 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid,
4990 if (!tidstats->filled) 5002 if (!tidstats->filled)
4991 continue; 5003 continue;
4992 5004
4993 tidattr = nla_nest_start(msg, tid + 1); 5005 tidattr = nla_nest_start_noflag(msg, tid + 1);
4994 if (!tidattr) 5006 if (!tidattr)
4995 goto nla_put_failure; 5007 goto nla_put_failure;
4996 5008
@@ -5875,7 +5887,7 @@ static int nl80211_send_mpath(struct sk_buff *msg, u32 portid, u32 seq,
5875 nla_put_u32(msg, NL80211_ATTR_GENERATION, pinfo->generation)) 5887 nla_put_u32(msg, NL80211_ATTR_GENERATION, pinfo->generation))
5876 goto nla_put_failure; 5888 goto nla_put_failure;
5877 5889
5878 pinfoattr = nla_nest_start(msg, NL80211_ATTR_MPATH_INFO); 5890 pinfoattr = nla_nest_start_noflag(msg, NL80211_ATTR_MPATH_INFO);
5879 if (!pinfoattr) 5891 if (!pinfoattr)
5880 goto nla_put_failure; 5892 goto nla_put_failure;
5881 if ((pinfo->filled & MPATH_INFO_FRAME_QLEN) && 5893 if ((pinfo->filled & MPATH_INFO_FRAME_QLEN) &&
@@ -6326,7 +6338,7 @@ static int nl80211_get_mesh_config(struct sk_buff *skb,
6326 NL80211_CMD_GET_MESH_CONFIG); 6338 NL80211_CMD_GET_MESH_CONFIG);
6327 if (!hdr) 6339 if (!hdr)
6328 goto out; 6340 goto out;
6329 pinfoattr = nla_nest_start(msg, NL80211_ATTR_MESH_CONFIG); 6341 pinfoattr = nla_nest_start_noflag(msg, NL80211_ATTR_MESH_CONFIG);
6330 if (!pinfoattr) 6342 if (!pinfoattr)
6331 goto nla_put_failure; 6343 goto nla_put_failure;
6332 if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || 6344 if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) ||
@@ -6705,7 +6717,7 @@ static int nl80211_put_regdom(const struct ieee80211_regdomain *regdom,
6705 nla_put_u8(msg, NL80211_ATTR_DFS_REGION, regdom->dfs_region))) 6717 nla_put_u8(msg, NL80211_ATTR_DFS_REGION, regdom->dfs_region)))
6706 goto nla_put_failure; 6718 goto nla_put_failure;
6707 6719
6708 nl_reg_rules = nla_nest_start(msg, NL80211_ATTR_REG_RULES); 6720 nl_reg_rules = nla_nest_start_noflag(msg, NL80211_ATTR_REG_RULES);
6709 if (!nl_reg_rules) 6721 if (!nl_reg_rules)
6710 goto nla_put_failure; 6722 goto nla_put_failure;
6711 6723
@@ -6720,7 +6732,7 @@ static int nl80211_put_regdom(const struct ieee80211_regdomain *regdom,
6720 freq_range = &reg_rule->freq_range; 6732 freq_range = &reg_rule->freq_range;
6721 power_rule = &reg_rule->power_rule; 6733 power_rule = &reg_rule->power_rule;
6722 6734
6723 nl_reg_rule = nla_nest_start(msg, i); 6735 nl_reg_rule = nla_nest_start_noflag(msg, i);
6724 if (!nl_reg_rule) 6736 if (!nl_reg_rule)
6725 goto nla_put_failure; 6737 goto nla_put_failure;
6726 6738
@@ -8389,7 +8401,7 @@ static int nl80211_send_bss(struct sk_buff *msg, struct netlink_callback *cb,
8389 NL80211_ATTR_PAD)) 8401 NL80211_ATTR_PAD))
8390 goto nla_put_failure; 8402 goto nla_put_failure;
8391 8403
8392 bss = nla_nest_start(msg, NL80211_ATTR_BSS); 8404 bss = nla_nest_start_noflag(msg, NL80211_ATTR_BSS);
8393 if (!bss) 8405 if (!bss)
8394 goto nla_put_failure; 8406 goto nla_put_failure;
8395 if ((!is_zero_ether_addr(res->bssid) && 8407 if ((!is_zero_ether_addr(res->bssid) &&
@@ -8566,7 +8578,7 @@ static int nl80211_send_survey(struct sk_buff *msg, u32 portid, u32 seq,
8566 if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex)) 8578 if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex))
8567 goto nla_put_failure; 8579 goto nla_put_failure;
8568 8580
8569 infoattr = nla_nest_start(msg, NL80211_ATTR_SURVEY_INFO); 8581 infoattr = nla_nest_start_noflag(msg, NL80211_ATTR_SURVEY_INFO);
8570 if (!infoattr) 8582 if (!infoattr)
8571 goto nla_put_failure; 8583 goto nla_put_failure;
8572 8584
@@ -9407,7 +9419,7 @@ __cfg80211_alloc_vendor_skb(struct cfg80211_registered_device *rdev,
9407 goto nla_put_failure; 9419 goto nla_put_failure;
9408 } 9420 }
9409 9421
9410 data = nla_nest_start(skb, attr); 9422 data = nla_nest_start_noflag(skb, attr);
9411 if (!data) 9423 if (!data)
9412 goto nla_put_failure; 9424 goto nla_put_failure;
9413 9425
@@ -9581,7 +9593,7 @@ static int nl80211_testmode_dump(struct sk_buff *skb,
9581 break; 9593 break;
9582 } 9594 }
9583 9595
9584 tmdata = nla_nest_start(skb, NL80211_ATTR_TESTDATA); 9596 tmdata = nla_nest_start_noflag(skb, NL80211_ATTR_TESTDATA);
9585 if (!tmdata) { 9597 if (!tmdata) {
9586 genlmsg_cancel(skb, hdr); 9598 genlmsg_cancel(skb, hdr);
9587 break; 9599 break;
@@ -10859,12 +10871,12 @@ static int nl80211_send_wowlan_patterns(struct sk_buff *msg,
10859 if (!wowlan->n_patterns) 10871 if (!wowlan->n_patterns)
10860 return 0; 10872 return 0;
10861 10873
10862 nl_pats = nla_nest_start(msg, NL80211_WOWLAN_TRIG_PKT_PATTERN); 10874 nl_pats = nla_nest_start_noflag(msg, NL80211_WOWLAN_TRIG_PKT_PATTERN);
10863 if (!nl_pats) 10875 if (!nl_pats)
10864 return -ENOBUFS; 10876 return -ENOBUFS;
10865 10877
10866 for (i = 0; i < wowlan->n_patterns; i++) { 10878 for (i = 0; i < wowlan->n_patterns; i++) {
10867 nl_pat = nla_nest_start(msg, i + 1); 10879 nl_pat = nla_nest_start_noflag(msg, i + 1);
10868 if (!nl_pat) 10880 if (!nl_pat)
10869 return -ENOBUFS; 10881 return -ENOBUFS;
10870 pat_len = wowlan->patterns[i].pattern_len; 10882 pat_len = wowlan->patterns[i].pattern_len;
@@ -10890,7 +10902,8 @@ static int nl80211_send_wowlan_tcp(struct sk_buff *msg,
10890 if (!tcp) 10902 if (!tcp)
10891 return 0; 10903 return 0;
10892 10904
10893 nl_tcp = nla_nest_start(msg, NL80211_WOWLAN_TRIG_TCP_CONNECTION); 10905 nl_tcp = nla_nest_start_noflag(msg,
10906 NL80211_WOWLAN_TRIG_TCP_CONNECTION);
10894 if (!nl_tcp) 10907 if (!nl_tcp)
10895 return -ENOBUFS; 10908 return -ENOBUFS;
10896 10909
@@ -10934,7 +10947,7 @@ static int nl80211_send_wowlan_nd(struct sk_buff *msg,
10934 if (!req) 10947 if (!req)
10935 return 0; 10948 return 0;
10936 10949
10937 nd = nla_nest_start(msg, NL80211_WOWLAN_TRIG_NET_DETECT); 10950 nd = nla_nest_start_noflag(msg, NL80211_WOWLAN_TRIG_NET_DETECT);
10938 if (!nd) 10951 if (!nd)
10939 return -ENOBUFS; 10952 return -ENOBUFS;
10940 10953
@@ -10960,7 +10973,7 @@ static int nl80211_send_wowlan_nd(struct sk_buff *msg,
10960 return -ENOBUFS; 10973 return -ENOBUFS;
10961 } 10974 }
10962 10975
10963 freqs = nla_nest_start(msg, NL80211_ATTR_SCAN_FREQUENCIES); 10976 freqs = nla_nest_start_noflag(msg, NL80211_ATTR_SCAN_FREQUENCIES);
10964 if (!freqs) 10977 if (!freqs)
10965 return -ENOBUFS; 10978 return -ENOBUFS;
10966 10979
@@ -10972,12 +10985,13 @@ static int nl80211_send_wowlan_nd(struct sk_buff *msg,
10972 nla_nest_end(msg, freqs); 10985 nla_nest_end(msg, freqs);
10973 10986
10974 if (req->n_match_sets) { 10987 if (req->n_match_sets) {
10975 matches = nla_nest_start(msg, NL80211_ATTR_SCHED_SCAN_MATCH); 10988 matches = nla_nest_start_noflag(msg,
10989 NL80211_ATTR_SCHED_SCAN_MATCH);
10976 if (!matches) 10990 if (!matches)
10977 return -ENOBUFS; 10991 return -ENOBUFS;
10978 10992
10979 for (i = 0; i < req->n_match_sets; i++) { 10993 for (i = 0; i < req->n_match_sets; i++) {
10980 match = nla_nest_start(msg, i); 10994 match = nla_nest_start_noflag(msg, i);
10981 if (!match) 10995 if (!match)
10982 return -ENOBUFS; 10996 return -ENOBUFS;
10983 10997
@@ -10990,12 +11004,12 @@ static int nl80211_send_wowlan_nd(struct sk_buff *msg,
10990 nla_nest_end(msg, matches); 11004 nla_nest_end(msg, matches);
10991 } 11005 }
10992 11006
10993 scan_plans = nla_nest_start(msg, NL80211_ATTR_SCHED_SCAN_PLANS); 11007 scan_plans = nla_nest_start_noflag(msg, NL80211_ATTR_SCHED_SCAN_PLANS);
10994 if (!scan_plans) 11008 if (!scan_plans)
10995 return -ENOBUFS; 11009 return -ENOBUFS;
10996 11010
10997 for (i = 0; i < req->n_scan_plans; i++) { 11011 for (i = 0; i < req->n_scan_plans; i++) {
10998 scan_plan = nla_nest_start(msg, i + 1); 11012 scan_plan = nla_nest_start_noflag(msg, i + 1);
10999 if (!scan_plan) 11013 if (!scan_plan)
11000 return -ENOBUFS; 11014 return -ENOBUFS;
11001 11015
@@ -11044,7 +11058,8 @@ static int nl80211_get_wowlan(struct sk_buff *skb, struct genl_info *info)
11044 if (rdev->wiphy.wowlan_config) { 11058 if (rdev->wiphy.wowlan_config) {
11045 struct nlattr *nl_wowlan; 11059 struct nlattr *nl_wowlan;
11046 11060
11047 nl_wowlan = nla_nest_start(msg, NL80211_ATTR_WOWLAN_TRIGGERS); 11061 nl_wowlan = nla_nest_start_noflag(msg,
11062 NL80211_ATTR_WOWLAN_TRIGGERS);
11048 if (!nl_wowlan) 11063 if (!nl_wowlan)
11049 goto nla_put_failure; 11064 goto nla_put_failure;
11050 11065
@@ -11478,12 +11493,12 @@ static int nl80211_send_coalesce_rules(struct sk_buff *msg,
11478 if (!rdev->coalesce->n_rules) 11493 if (!rdev->coalesce->n_rules)
11479 return 0; 11494 return 0;
11480 11495
11481 nl_rules = nla_nest_start(msg, NL80211_ATTR_COALESCE_RULE); 11496 nl_rules = nla_nest_start_noflag(msg, NL80211_ATTR_COALESCE_RULE);
11482 if (!nl_rules) 11497 if (!nl_rules)
11483 return -ENOBUFS; 11498 return -ENOBUFS;
11484 11499
11485 for (i = 0; i < rdev->coalesce->n_rules; i++) { 11500 for (i = 0; i < rdev->coalesce->n_rules; i++) {
11486 nl_rule = nla_nest_start(msg, i + 1); 11501 nl_rule = nla_nest_start_noflag(msg, i + 1);
11487 if (!nl_rule) 11502 if (!nl_rule)
11488 return -ENOBUFS; 11503 return -ENOBUFS;
11489 11504
@@ -11496,13 +11511,13 @@ static int nl80211_send_coalesce_rules(struct sk_buff *msg,
11496 rule->condition)) 11511 rule->condition))
11497 return -ENOBUFS; 11512 return -ENOBUFS;
11498 11513
11499 nl_pats = nla_nest_start(msg, 11514 nl_pats = nla_nest_start_noflag(msg,
11500 NL80211_ATTR_COALESCE_RULE_PKT_PATTERN); 11515 NL80211_ATTR_COALESCE_RULE_PKT_PATTERN);
11501 if (!nl_pats) 11516 if (!nl_pats)
11502 return -ENOBUFS; 11517 return -ENOBUFS;
11503 11518
11504 for (j = 0; j < rule->n_patterns; j++) { 11519 for (j = 0; j < rule->n_patterns; j++) {
11505 nl_pat = nla_nest_start(msg, j + 1); 11520 nl_pat = nla_nest_start_noflag(msg, j + 1);
11506 if (!nl_pat) 11521 if (!nl_pat)
11507 return -ENOBUFS; 11522 return -ENOBUFS;
11508 pat_len = rule->patterns[j].pattern_len; 11523 pat_len = rule->patterns[j].pattern_len;
@@ -12254,7 +12269,7 @@ out:
12254 NL80211_ATTR_PAD)) 12269 NL80211_ATTR_PAD))
12255 goto nla_put_failure; 12270 goto nla_put_failure;
12256 12271
12257 func_attr = nla_nest_start(msg, NL80211_ATTR_NAN_FUNC); 12272 func_attr = nla_nest_start_noflag(msg, NL80211_ATTR_NAN_FUNC);
12258 if (!func_attr) 12273 if (!func_attr)
12259 goto nla_put_failure; 12274 goto nla_put_failure;
12260 12275
@@ -12371,11 +12386,12 @@ void cfg80211_nan_match(struct wireless_dev *wdev,
12371 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, match->addr)) 12386 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, match->addr))
12372 goto nla_put_failure; 12387 goto nla_put_failure;
12373 12388
12374 match_attr = nla_nest_start(msg, NL80211_ATTR_NAN_MATCH); 12389 match_attr = nla_nest_start_noflag(msg, NL80211_ATTR_NAN_MATCH);
12375 if (!match_attr) 12390 if (!match_attr)
12376 goto nla_put_failure; 12391 goto nla_put_failure;
12377 12392
12378 local_func_attr = nla_nest_start(msg, NL80211_NAN_MATCH_FUNC_LOCAL); 12393 local_func_attr = nla_nest_start_noflag(msg,
12394 NL80211_NAN_MATCH_FUNC_LOCAL);
12379 if (!local_func_attr) 12395 if (!local_func_attr)
12380 goto nla_put_failure; 12396 goto nla_put_failure;
12381 12397
@@ -12384,7 +12400,8 @@ void cfg80211_nan_match(struct wireless_dev *wdev,
12384 12400
12385 nla_nest_end(msg, local_func_attr); 12401 nla_nest_end(msg, local_func_attr);
12386 12402
12387 peer_func_attr = nla_nest_start(msg, NL80211_NAN_MATCH_FUNC_PEER); 12403 peer_func_attr = nla_nest_start_noflag(msg,
12404 NL80211_NAN_MATCH_FUNC_PEER);
12388 if (!peer_func_attr) 12405 if (!peer_func_attr)
12389 goto nla_put_failure; 12406 goto nla_put_failure;
12390 12407
@@ -12450,7 +12467,7 @@ void cfg80211_nan_func_terminated(struct wireless_dev *wdev,
12450 NL80211_ATTR_PAD)) 12467 NL80211_ATTR_PAD))
12451 goto nla_put_failure; 12468 goto nla_put_failure;
12452 12469
12453 func_attr = nla_nest_start(msg, NL80211_ATTR_NAN_FUNC); 12470 func_attr = nla_nest_start_noflag(msg, NL80211_ATTR_NAN_FUNC);
12454 if (!func_attr) 12471 if (!func_attr)
12455 goto nla_put_failure; 12472 goto nla_put_failure;
12456 12473
@@ -12799,7 +12816,8 @@ static int nl80211_vendor_cmd_dump(struct sk_buff *skb,
12799 break; 12816 break;
12800 } 12817 }
12801 12818
12802 vendor_data = nla_nest_start(skb, NL80211_ATTR_VENDOR_DATA); 12819 vendor_data = nla_nest_start_noflag(skb,
12820 NL80211_ATTR_VENDOR_DATA);
12803 if (!vendor_data) { 12821 if (!vendor_data) {
12804 genlmsg_cancel(skb, hdr); 12822 genlmsg_cancel(skb, hdr);
12805 break; 12823 break;
@@ -13343,7 +13361,8 @@ static int nl80211_get_ftm_responder_stats(struct sk_buff *skb,
13343 if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex)) 13361 if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex))
13344 goto nla_put_failure; 13362 goto nla_put_failure;
13345 13363
13346 ftm_stats_attr = nla_nest_start(msg, NL80211_ATTR_FTM_RESPONDER_STATS); 13364 ftm_stats_attr = nla_nest_start_noflag(msg,
13365 NL80211_ATTR_FTM_RESPONDER_STATS);
13347 if (!ftm_stats_attr) 13366 if (!ftm_stats_attr)
13348 goto nla_put_failure; 13367 goto nla_put_failure;
13349 13368
@@ -14366,7 +14385,7 @@ static int nl80211_add_scan_req(struct sk_buff *msg,
14366 if (WARN_ON(!req)) 14385 if (WARN_ON(!req))
14367 return 0; 14386 return 0;
14368 14387
14369 nest = nla_nest_start(msg, NL80211_ATTR_SCAN_SSIDS); 14388 nest = nla_nest_start_noflag(msg, NL80211_ATTR_SCAN_SSIDS);
14370 if (!nest) 14389 if (!nest)
14371 goto nla_put_failure; 14390 goto nla_put_failure;
14372 for (i = 0; i < req->n_ssids; i++) { 14391 for (i = 0; i < req->n_ssids; i++) {
@@ -14375,7 +14394,7 @@ static int nl80211_add_scan_req(struct sk_buff *msg,
14375 } 14394 }
14376 nla_nest_end(msg, nest); 14395 nla_nest_end(msg, nest);
14377 14396
14378 nest = nla_nest_start(msg, NL80211_ATTR_SCAN_FREQUENCIES); 14397 nest = nla_nest_start_noflag(msg, NL80211_ATTR_SCAN_FREQUENCIES);
14379 if (!nest) 14398 if (!nest)
14380 goto nla_put_failure; 14399 goto nla_put_failure;
14381 for (i = 0; i < req->n_channels; i++) { 14400 for (i = 0; i < req->n_channels; i++) {
@@ -14637,7 +14656,7 @@ static void nl80211_send_mlme_event(struct cfg80211_registered_device *rdev,
14637 14656
14638 if (uapsd_queues >= 0) { 14657 if (uapsd_queues >= 0) {
14639 struct nlattr *nla_wmm = 14658 struct nlattr *nla_wmm =
14640 nla_nest_start(msg, NL80211_ATTR_STA_WME); 14659 nla_nest_start_noflag(msg, NL80211_ATTR_STA_WME);
14641 if (!nla_wmm) 14660 if (!nla_wmm)
14642 goto nla_put_failure; 14661 goto nla_put_failure;
14643 14662
@@ -15078,7 +15097,7 @@ void nl80211_send_beacon_hint_event(struct wiphy *wiphy,
15078 goto nla_put_failure; 15097 goto nla_put_failure;
15079 15098
15080 /* Before */ 15099 /* Before */
15081 nl_freq = nla_nest_start(msg, NL80211_ATTR_FREQ_BEFORE); 15100 nl_freq = nla_nest_start_noflag(msg, NL80211_ATTR_FREQ_BEFORE);
15082 if (!nl_freq) 15101 if (!nl_freq)
15083 goto nla_put_failure; 15102 goto nla_put_failure;
15084 15103
@@ -15087,7 +15106,7 @@ void nl80211_send_beacon_hint_event(struct wiphy *wiphy,
15087 nla_nest_end(msg, nl_freq); 15106 nla_nest_end(msg, nl_freq);
15088 15107
15089 /* After */ 15108 /* After */
15090 nl_freq = nla_nest_start(msg, NL80211_ATTR_FREQ_AFTER); 15109 nl_freq = nla_nest_start_noflag(msg, NL80211_ATTR_FREQ_AFTER);
15091 if (!nl_freq) 15110 if (!nl_freq)
15092 goto nla_put_failure; 15111 goto nla_put_failure;
15093 15112
@@ -15521,7 +15540,7 @@ static struct sk_buff *cfg80211_prepare_cqm(struct net_device *dev,
15521 if (mac && nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, mac)) 15540 if (mac && nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, mac))
15522 goto nla_put_failure; 15541 goto nla_put_failure;
15523 15542
15524 cb[1] = nla_nest_start(msg, NL80211_ATTR_CQM); 15543 cb[1] = nla_nest_start_noflag(msg, NL80211_ATTR_CQM);
15525 if (!cb[1]) 15544 if (!cb[1])
15526 goto nla_put_failure; 15545 goto nla_put_failure;
15527 15546
@@ -15682,7 +15701,7 @@ static void nl80211_gtk_rekey_notify(struct cfg80211_registered_device *rdev,
15682 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, bssid)) 15701 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, bssid))
15683 goto nla_put_failure; 15702 goto nla_put_failure;
15684 15703
15685 rekey_attr = nla_nest_start(msg, NL80211_ATTR_REKEY_DATA); 15704 rekey_attr = nla_nest_start_noflag(msg, NL80211_ATTR_REKEY_DATA);
15686 if (!rekey_attr) 15705 if (!rekey_attr)
15687 goto nla_put_failure; 15706 goto nla_put_failure;
15688 15707
@@ -15737,7 +15756,7 @@ nl80211_pmksa_candidate_notify(struct cfg80211_registered_device *rdev,
15737 nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex)) 15756 nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex))
15738 goto nla_put_failure; 15757 goto nla_put_failure;
15739 15758
15740 attr = nla_nest_start(msg, NL80211_ATTR_PMKSA_CANDIDATE); 15759 attr = nla_nest_start_noflag(msg, NL80211_ATTR_PMKSA_CANDIDATE);
15741 if (!attr) 15760 if (!attr)
15742 goto nla_put_failure; 15761 goto nla_put_failure;
15743 15762
@@ -16047,15 +16066,15 @@ static int cfg80211_net_detect_results(struct sk_buff *msg,
16047 struct nlattr *nl_results, *nl_match, *nl_freqs; 16066 struct nlattr *nl_results, *nl_match, *nl_freqs;
16048 int i, j; 16067 int i, j;
16049 16068
16050 nl_results = nla_nest_start( 16069 nl_results = nla_nest_start_noflag(msg,
16051 msg, NL80211_WOWLAN_TRIG_NET_DETECT_RESULTS); 16070 NL80211_WOWLAN_TRIG_NET_DETECT_RESULTS);
16052 if (!nl_results) 16071 if (!nl_results)
16053 return -EMSGSIZE; 16072 return -EMSGSIZE;
16054 16073
16055 for (i = 0; i < nd->n_matches; i++) { 16074 for (i = 0; i < nd->n_matches; i++) {
16056 struct cfg80211_wowlan_nd_match *match = nd->matches[i]; 16075 struct cfg80211_wowlan_nd_match *match = nd->matches[i];
16057 16076
16058 nl_match = nla_nest_start(msg, i); 16077 nl_match = nla_nest_start_noflag(msg, i);
16059 if (!nl_match) 16078 if (!nl_match)
16060 break; 16079 break;
16061 16080
@@ -16073,8 +16092,8 @@ static int cfg80211_net_detect_results(struct sk_buff *msg,
16073 } 16092 }
16074 16093
16075 if (match->n_channels) { 16094 if (match->n_channels) {
16076 nl_freqs = nla_nest_start( 16095 nl_freqs = nla_nest_start_noflag(msg,
16077 msg, NL80211_ATTR_SCAN_FREQUENCIES); 16096 NL80211_ATTR_SCAN_FREQUENCIES);
16078 if (!nl_freqs) { 16097 if (!nl_freqs) {
16079 nla_nest_cancel(msg, nl_match); 16098 nla_nest_cancel(msg, nl_match);
16080 goto out; 16099 goto out;
@@ -16133,7 +16152,8 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev,
16133 if (wakeup) { 16152 if (wakeup) {
16134 struct nlattr *reasons; 16153 struct nlattr *reasons;
16135 16154
16136 reasons = nla_nest_start(msg, NL80211_ATTR_WOWLAN_TRIGGERS); 16155 reasons = nla_nest_start_noflag(msg,
16156 NL80211_ATTR_WOWLAN_TRIGGERS);
16137 if (!reasons) 16157 if (!reasons)
16138 goto free_msg; 16158 goto free_msg;
16139 16159
diff --git a/net/wireless/pmsr.c b/net/wireless/pmsr.c
index 5e2ab01d325c..5c80bccc8b3c 100644
--- a/net/wireless/pmsr.c
+++ b/net/wireless/pmsr.c
@@ -420,22 +420,22 @@ static int nl80211_pmsr_send_result(struct sk_buff *msg,
420{ 420{
421 struct nlattr *pmsr, *peers, *peer, *resp, *data, *typedata; 421 struct nlattr *pmsr, *peers, *peer, *resp, *data, *typedata;
422 422
423 pmsr = nla_nest_start(msg, NL80211_ATTR_PEER_MEASUREMENTS); 423 pmsr = nla_nest_start_noflag(msg, NL80211_ATTR_PEER_MEASUREMENTS);
424 if (!pmsr) 424 if (!pmsr)
425 goto error; 425 goto error;
426 426
427 peers = nla_nest_start(msg, NL80211_PMSR_ATTR_PEERS); 427 peers = nla_nest_start_noflag(msg, NL80211_PMSR_ATTR_PEERS);
428 if (!peers) 428 if (!peers)
429 goto error; 429 goto error;
430 430
431 peer = nla_nest_start(msg, 1); 431 peer = nla_nest_start_noflag(msg, 1);
432 if (!peer) 432 if (!peer)
433 goto error; 433 goto error;
434 434
435 if (nla_put(msg, NL80211_PMSR_PEER_ATTR_ADDR, ETH_ALEN, res->addr)) 435 if (nla_put(msg, NL80211_PMSR_PEER_ATTR_ADDR, ETH_ALEN, res->addr))
436 goto error; 436 goto error;
437 437
438 resp = nla_nest_start(msg, NL80211_PMSR_PEER_ATTR_RESP); 438 resp = nla_nest_start_noflag(msg, NL80211_PMSR_PEER_ATTR_RESP);
439 if (!resp) 439 if (!resp)
440 goto error; 440 goto error;
441 441
@@ -452,11 +452,11 @@ static int nl80211_pmsr_send_result(struct sk_buff *msg,
452 if (res->final && nla_put_flag(msg, NL80211_PMSR_RESP_ATTR_FINAL)) 452 if (res->final && nla_put_flag(msg, NL80211_PMSR_RESP_ATTR_FINAL))
453 goto error; 453 goto error;
454 454
455 data = nla_nest_start(msg, NL80211_PMSR_RESP_ATTR_DATA); 455 data = nla_nest_start_noflag(msg, NL80211_PMSR_RESP_ATTR_DATA);
456 if (!data) 456 if (!data)
457 goto error; 457 goto error;
458 458
459 typedata = nla_nest_start(msg, res->type); 459 typedata = nla_nest_start_noflag(msg, res->type);
460 if (!typedata) 460 if (!typedata)
461 goto error; 461 goto error;
462 462