summaryrefslogtreecommitdiffstats
path: root/net/qrtr
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-04-20 12:21:30 +0200
committerDavid S. Miller <davem@davemloft.net>2017-04-21 21:19:27 +0200
commit6f60f438108c66988c944894e5f673ab5d04fbc1 (patch)
treed1e7d20c0fb58fd57e45270fa68917091c1e942f /net/qrtr
parentbpf: Fix values type used in test_maps (diff)
downloadlinux-6f60f438108c66988c944894e5f673ab5d04fbc1.tar.xz
linux-6f60f438108c66988c944894e5f673ab5d04fbc1.zip
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 ae5ac175b2be..9da7368b0140 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);
}