提交 f83beff2 编写于 作者: T Tetsuo Handa 提交者: Greg Kroah-Hartman

mISDN: Check address length before reading address family

[ Upstream commit 238ffdc49ef98b15819cfd5e3fb23194e3ea3d39 ]

KMSAN will complain if valid address length passed to bind() is shorter
than sizeof("struct sockaddr_mISDN"->family) bytes.
Signed-off-by: NTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NSasha Levin <sashal@kernel.org>
上级 e4525c9d
......@@ -711,10 +711,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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册