Commit 6f8288c2 authored by Tetsuo Handa's avatar Tetsuo Handa Committed by Greg Kroah-Hartman

mISDN: Check address length before reading address family

[ Upstream commit 238ffdc4 ]

KMSAN will complain if valid address length passed to bind() is shorter
than sizeof("struct sockaddr_mISDN"->family) bytes.
Signed-off-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 00853c94
......@@ -712,10 +712,10 @@ base_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_len)
struct sock *sk = sock->sk;
int err = 0;
if (!maddr || maddr->family != AF_ISDN)
if (addr_len < sizeof(struct sockaddr_mISDN))
return -EINVAL;
if (addr_len < sizeof(struct sockaddr_mISDN))
if (!maddr || maddr->family != AF_ISDN)
return -EINVAL;
lock_sock(sk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment