]> git.baikalelectronics.ru Git - kernel.git/commit
net/ieee802154: fix uninit value bug in dgram_sendmsg
authorHaimin Zhang <tcs.kernel@gmail.com>
Thu, 8 Sep 2022 12:19:27 +0000 (20:19 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Sep 2022 09:53:55 +0000 (10:53 +0100)
commit891afbcca1ec42e32780d4a40465c15f0a7ce8b9
tree5e0afc128cd6579f1a78ffeb7f9d02df3eeb1637
parenteb267aee4ee38aefa0f7eb5a7aa108d27aae408f
net/ieee802154: fix uninit value bug in dgram_sendmsg

There is uninit value bug in dgram_sendmsg function in
net/ieee802154/socket.c when the length of valid data pointed by the
msg->msg_name isn't verified.

We introducing a helper function ieee802154_sockaddr_check_size to
check namelen. First we check there is addr_type in ieee802154_addr_sa.
Then, we check namelen according to addr_type.

Also fixed in raw_bind, dgram_bind, dgram_connect.

Signed-off-by: Haimin Zhang <tcs_kernel@tencent.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/ieee802154_netdev.h
net/ieee802154/socket.c