Skip to content

Commit

Permalink
net: qrtr: potential use after free in qrtr_sendmsg()
Browse files Browse the repository at this point in the history
If skb_pad() fails then it frees the skb so we should check for errors.

Fixes: bdabad3 ("net: Add Qualcomm IPC router")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dan Carpenter authored and David S. Miller committed Apr 21, 2017
1 parent 89087c4 commit 6f60f43
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/qrtr/qrtr.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,9 @@ static int qrtr_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
}

if (plen != len) {
skb_pad(skb, plen - len);
rc = skb_pad(skb, plen - len);
if (rc)
goto out_node;
skb_put(skb, plen - len);
}

Expand Down

0 comments on commit 6f60f43

Please sign in to comment.