net: fixes for skb_send_sock

A couple fixes to new skb_send_sock infrastructure. However, no users
currently exist for this code (adding user in next handful of patches)
so it should not be possible to trigger a panic with existing in-kernel
code.

Fixes: 306b13eb3c ("proto_ops: Add locked held versions of sendmsg and sendpage")
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
John Fastabend 2017-08-15 22:31:34 -07:00 committed by David S. Miller
parent 45f91bdcd5
commit db5980d804
2 changed files with 2 additions and 2 deletions

View File

@ -2285,7 +2285,7 @@ int skb_send_sock_locked(struct sock *sk, struct sk_buff *skb, int offset,
slen = min_t(int, len, skb_headlen(skb) - offset); slen = min_t(int, len, skb_headlen(skb) - offset);
kv.iov_base = skb->data + offset; kv.iov_base = skb->data + offset;
kv.iov_len = len; kv.iov_len = slen;
memset(&msg, 0, sizeof(msg)); memset(&msg, 0, sizeof(msg));
ret = kernel_sendmsg_locked(sk, &msg, &kv, 1, slen); ret = kernel_sendmsg_locked(sk, &msg, &kv, 1, slen);

View File

@ -658,7 +658,7 @@ int kernel_sendmsg_locked(struct sock *sk, struct msghdr *msg,
struct socket *sock = sk->sk_socket; struct socket *sock = sk->sk_socket;
if (!sock->ops->sendmsg_locked) if (!sock->ops->sendmsg_locked)
sock_no_sendmsg_locked(sk, msg, size); return sock_no_sendmsg_locked(sk, msg, size);
iov_iter_kvec(&msg->msg_iter, WRITE | ITER_KVEC, vec, num, size); iov_iter_kvec(&msg->msg_iter, WRITE | ITER_KVEC, vec, num, size);