Re: [PATCH v3 net-next 1/5] proto_ops: Fixes to adding locked version of sendmsg/page

2017-08-08 Thread John Fastabend
On 08/07/2017 10:28 AM, Tom Herbert wrote:
> Fixes for two issues pointed out by John Fastabend.
> 
> Fixes: 306b13eb3cf9515a ("proto_ops: Add locked held versions of sendmsg and 
> sendpage")
> Reported-by: John Fastabend 
> Signed-off-by: Tom Herbert 
> ---

This is the same patch as the one in my RFC series so its an ack from me.

Acked-by: John Fastabend 


[PATCH v3 net-next 1/5] proto_ops: Fixes to adding locked version of sendmsg/page

2017-08-07 Thread Tom Herbert
Fixes for two issues pointed out by John Fastabend.

Fixes: 306b13eb3cf9515a ("proto_ops: Add locked held versions of sendmsg and 
sendpage")
Reported-by: John Fastabend 
Signed-off-by: Tom Herbert 
---
 net/core/skbuff.c | 2 +-
 net/socket.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 42b62c716a33..e3bac9f74789 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -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);
diff --git a/net/socket.c b/net/socket.c
index b332d1e8e4e4..c729625eb5d3 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -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);
 
-- 
2.11.0