summaryrefslogtreecommitdiffstats
path: root/net/llc
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>2019-04-12 19:55:14 +0900
committerDavid S. Miller <davem@davemloft.net>2019-04-12 10:25:03 -0700
commitc68e747d0a98f44a4e49071940a692fa83630e47 (patch)
treeaf5b48598d2420d3389c044b8d61b6fc3e1c2067 /net/llc
parentbd7d46ddca06f1fadd68ceb99bc6e6f808ab50f2 (diff)
downloadblackbird-op-linux-c68e747d0a98f44a4e49071940a692fa83630e47.tar.gz
blackbird-op-linux-c68e747d0a98f44a4e49071940a692fa83630e47.zip
llc: Check address length before reading address field
KMSAN will complain if valid address length passed to bind() is shorter than sizeof(struct sockaddr_llc) bytes. Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/llc')
-rw-r--r--net/llc/af_llc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c
index b99e73a7e7e0..2017b7d780f5 100644
--- a/net/llc/af_llc.c
+++ b/net/llc/af_llc.c
@@ -320,14 +320,13 @@ static int llc_ui_bind(struct socket *sock, struct sockaddr *uaddr, int addrlen)
struct llc_sap *sap;
int rc = -EINVAL;
- dprintk("%s: binding %02X\n", __func__, addr->sllc_sap);
-
lock_sock(sk);
if (unlikely(!sock_flag(sk, SOCK_ZAPPED) || addrlen != sizeof(*addr)))
goto out;
rc = -EAFNOSUPPORT;
if (unlikely(addr->sllc_family != AF_LLC))
goto out;
+ dprintk("%s: binding %02X\n", __func__, addr->sllc_sap);
rc = -ENODEV;
rcu_read_lock();
if (sk->sk_bound_dev_if) {
OpenPOWER on IntegriCloud