mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
net: check the length of the socket address passed to connect(2)
check the length of the socket address passed to connect(2). Check the length of the socket address passed to connect(2). If the length is invalid, -EINVAL will be returned. Signed-off-by: Changli Gao <[email protected]> ---- net/bluetooth/l2cap.c | 3 ++- net/bluetooth/rfcomm/sock.c | 3 ++- net/bluetooth/sco.c | 3 ++- net/can/bcm.c | 3 +++ net/ieee802154/af_ieee802154.c | 3 +++ net/ipv4/af_inet.c | 5 +++++ net/netlink/af_netlink.c | 3 +++ 7 files changed, 20 insertions(+), 3 deletions(-) Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
a1d6f3f655
commit
6503d96168
7 changed files with 20 additions and 3 deletions
|
|
@ -683,6 +683,9 @@ static int netlink_connect(struct socket *sock, struct sockaddr *addr,
|
|||
struct netlink_sock *nlk = nlk_sk(sk);
|
||||
struct sockaddr_nl *nladdr = (struct sockaddr_nl *)addr;
|
||||
|
||||
if (alen < sizeof(addr->sa_family))
|
||||
return -EINVAL;
|
||||
|
||||
if (addr->sa_family == AF_UNSPEC) {
|
||||
sk->sk_state = NETLINK_UNCONNECTED;
|
||||
nlk->dst_pid = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue