WSL2-Linux-Kernel/net/core
Xin Long 8ac106aade rtnetlink: call validate_linkmsg in rtnl_create_link
[ Upstream commit b0ad3c1790 ]

validate_linkmsg() was introduced by commit 1840bb13c2 ("[RTNL]:
Validate hardware and broadcast address attribute for RTM_NEWLINK")
to validate tb[IFLA_ADDRESS/BROADCAST] for existing links. The same
check should also be done for newly created links.

This patch adds validate_linkmsg() call in rtnl_create_link(), to
avoid the invalid address set when creating some devices like:

  # ip link add dummy0 type dummy
  # ip link add link dummy0 name mac0 address 01:02 type macsec

Fixes: 0e06877c6f ("[RTNETLINK]: rtnl_link: allow specifying initial device address")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-06-09 10:32:19 +02:00
..
Makefile of: net: move of_net under net/ 2022-03-08 19:12:41 +01:00
bpf_sk_storage.c net: Fix data-races around sysctl_optmem_max. 2022-08-31 17:16:43 +02:00
datagram.c net: datagram: fix data-races in datagram_poll() 2023-05-24 17:36:42 +01:00
datagram.h
dev.c net: Catch invalid index in XPS mapping 2023-05-24 17:36:45 +01:00
dev_addr_lists.c
dev_ioctl.c
devlink.c devlink: Fix use-after-free after a failed reload 2022-08-25 11:40:06 +02:00
drop_monitor.c net: skb: introduce kfree_skb_reason() 2022-07-29 17:25:15 +02:00
dst.c
dst_cache.c wireguard: device: reset peer src endpoint when netns exits 2021-12-08 09:04:46 +01:00
failover.c
fib_notifier.c
fib_rules.c ipv6: fix memory leak in fib6_rule_suppress 2021-12-08 09:04:43 +01:00
filter.c bpf: bpf_fib_lookup should not return neigh in NUD_FAILED state 2023-03-03 11:45:53 +01:00
flow_dissector.c netfilter: conntrack: Fix data-races around ct mark 2022-12-02 17:41:04 +01:00
flow_offload.c netfilter: nf_tables: bail out early if hardware offload is not supported 2022-06-14 18:36:17 +02:00
gen_estimator.c
gen_stats.c
gro_cells.c net: Fix data-races around netdev_max_backlog. 2022-08-31 17:16:42 +02:00
hwbm.c
link_watch.c net: Write lock dev_base_lock without disabling bottom halves. 2022-06-29 09:03:22 +02:00
lwt_bpf.c bpf, lwt: Fix crash when using bpf_skb_set_tunnel_key() from bpf_xmit lwt hook 2022-05-09 09:14:35 +02:00
lwtunnel.c lwtunnel: Validate RTA_ENCAP_TYPE attribute length 2022-01-11 15:35:14 +01:00
neighbour.c neigh: make sure used and confirmed times are valid 2023-03-03 11:45:52 +01:00
net-procfs.c net-procfs: show net devices bound packet types 2022-02-01 17:27:08 +01:00
net-sysfs.c net: fix data-race in dev_isalive() 2022-06-29 09:03:22 +02:00
net-sysfs.h
net-traces.c
net_namespace.c net: fix UaF in netns ops registration error path 2023-02-01 08:27:26 +01:00
netclassid_cgroup.c
netevent.c
netpoll.c net: don't let netpoll invoke NAPI if in xmit context 2023-04-13 16:48:18 +02:00
netprio_cgroup.c
of_net.c of: net: move of_net under net/ 2022-03-08 19:12:41 +01:00
page_pool.c page_pool: fix inconsistency for page_pool_ring_[un]lock() 2023-06-05 09:21:22 +02:00
pktgen.c
ptp_classifier.c
request_sock.c
rtnetlink.c rtnetlink: call validate_linkmsg in rtnl_create_link 2023-06-09 10:32:19 +02:00
scm.c scm: add user copy checks to put_cmsg() 2023-03-10 09:39:51 +01:00
secure_seq.c tcp: Fix data-races around sysctl knobs related to SYN option. 2022-07-29 17:25:22 +02:00
selftests.c
skbuff.c net: fix skb leak in __skb_tstamp_tx() 2023-05-30 13:55:31 +01:00
skmsg.c bpf, sockmap: Fix missing BPF_F_INGRESS flag when using apply_bytes 2022-12-31 13:14:14 +01:00
sock.c udp6: Fix race condition in udp6_sendmsg & connect 2023-06-09 10:32:18 +02:00
sock_destructor.h
sock_diag.c
sock_map.c bpf, sockmap: Revert buggy deadlock fix in the sockhash and sockmap 2023-05-11 23:00:29 +09:00
sock_reuseport.c soreuseport: Fix socket selection for SO_INCOMING_CPU. 2022-12-31 13:14:07 +01:00
stream.c net: deal with most data-races in sk_wait_event() 2023-05-24 17:36:42 +01:00
sysctl_net_core.c net: Fix data-races around weight_p and dev_weight_[rt]x_bias. 2022-08-31 17:16:42 +02:00
timestamping.c
tso.c
utils.c
xdp.c xdp: xdp_mem_allocator can be NULL in trace_mem_connect(). 2023-06-05 09:21:23 +02:00