summaryrefslogtreecommitdiffstats
path: root/net/qrtr
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-04-20 13:21:30 +0300
committerDavid S. Miller <davem@davemloft.net>2017-04-21 15:19:27 -0400
commit6f60f438108c66988c944894e5f673ab5d04fbc1 (patch)
treed1e7d20c0fb58fd57e45270fa68917091c1e942f /net/qrtr
parent89087c456fb5cb5e534edf1c30568a8baae4c906 (diff)
downloadop-kernel-dev-6f60f438108c66988c944894e5f673ab5d04fbc1.zip
op-kernel-dev-6f60f438108c66988c944894e5f673ab5d04fbc1.tar.gz
net: qrtr: potential use after free in qrtr_sendmsg()
If skb_pad() fails then it frees the skb so we should check for errors. Fixes: bdabad3e363d ("net: Add Qualcomm IPC router") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/qrtr')
-rw-r--r--net/qrtr/qrtr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c
index ae5ac17..9da7368 100644
--- a/net/qrtr/qrtr.c
+++ b/net/qrtr/qrtr.c
@@ -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);
}
OpenPOWER on IntegriCloud