Skip to content

Commit

Permalink
net: fixes for skb_send_sock
Browse files Browse the repository at this point in the history
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: 306b13e ("proto_ops: Add locked held versions of sendmsg and sendpage")
Signed-off-by: John Fastabend <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
jrfastab authored and davem330 committed Aug 16, 2017
1 parent 45f91bd commit db5980d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion net/core/skbuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
kv.iov_base = skb->data + offset;
kv.iov_len = len;
kv.iov_len = slen;
memset(&msg, 0, sizeof(msg));

ret = kernel_sendmsg_locked(sk, &msg, &kv, 1, slen);
Expand Down
2 changes: 1 addition & 1 deletion net/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ int kernel_sendmsg_locked(struct sock *sk, struct msghdr *msg,
struct socket *sock = sk->sk_socket;

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);

Expand Down

0 comments on commit db5980d

Please sign in to comment.