fixes for ktls
Subsystems (5)
John Fastabend
maintainercover fixes for ktls
Couple fixes for TLS and BPF interactions.
John Fastabend (2):
net: tls, update curr on splice as well
bpf: sockmap, updating the sg structure should also update curr
net/core/filter.c | 19 +++++++++++++++++++ net/tls/tls_sw.c | 2 ++ 2 files changed, 21 insertions(+)
Signature · 1 line
2.33.0
John Fastabend
maintainerPATCH 1/2 net: tls, update curr on splice as well
The curr pointer must also be updated on the splice similar to how we do this for other copy types.
--- net/tls/tls_sw.c | 2 ++ 1 file changed, 2 insertions(+)
net/tls/tls_sw.c +2 -0
@@ -952,6 +952,8 @@ static int tls_sw_sendmsg_splice(struct sock *sk, struct msghdr *msg, }sk_msg_page_add (msg_pl, page, part, off); + msg_pl->sg.copybreak =0 ; + msg_pl->sg.curr = msg_pl->sg.end;sk_mem_charge (sk, part); *copied += part; try_to_copy -= part;
Signature · 1 line
2.33.0
John Fastabend
maintainerPATCH 2/2 bpf: sockmap, updating the sg structure should also update curr
In reply to John FastabendCurr pointer should be updated when the sg structure is shifted.
--- net/core/filter.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
net/core/filter.c +19 -0
@@ -2602,6 +2602,22 @@ BPF_CALL_2(bpf_msg_cork_bytes, struct sk_msg *, msg, u32, bytes)return 0 ; } +static void sk_msg_reset_curr (struct sk_msg *msg) +{ +u32 i = msg->sg.start; +u32 len =0 ; + +do { + len +=sk_msg_elem (msg, i)->length; +sk_msg_iter_var_next (i); +if (len >= msg->sg.size) +break ; + }while (i != msg->sg.end); + + msg->sg.curr = i; + msg->sg.copybreak =0 ; +} +static const struct bpf_func_proto bpf_msg_cork_bytes_proto = { .func = bpf_msg_cork_bytes, .gpl_only = false,
@@ -2721,6 +2737,7 @@ BPF_CALL_4(bpf_msg_pull_data, struct sk_msg *, msg, u32, start, msg->sg.end - shift + NR_MSG_FRAG_IDS : msg->sg.end - shift; out: +sk_msg_reset_curr (msg); msg->data =sg_virt (&msg->sg.data[first_sge]) + start - offset; msg->data_end = msg->data + bytes;return 0 ;
@@ -2857,6 +2874,7 @@ BPF_CALL_4(bpf_msg_push_data, struct sk_msg *, msg, u32, start, msg->sg.data[new] = rsge; } +sk_msg_reset_curr (msg);sk_msg_compute_data_pointers (msg);return 0 ; }
@@ -3025,6 +3043,7 @@ BPF_CALL_4(bpf_msg_pop_data, struct sk_msg *, msg, u32, start,sk_mem_uncharge (msg->sk, len - pop); msg->sg.size -= (len - pop); +sk_msg_reset_curr (msg);sk_msg_compute_data_pointers (msg);return 0 ; }
Signature · 1 line
2.33.0
John Fastabend
maintainerRE: [PATCH net 1/2] net: tls, update curr on splice as well
In reply to John FastabendQuoted 6 lines · John Fastabend
The curr pointer must also be updated on the splice similar to how we do this for other copy types.
Fixes d829e9c4112b ("tls: convert to generic sk_msg interface")Signed-off-by John Fastabend <[email protected]>---
This series was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Wed, 6 Dec 2023 15:27:04 -0800 you wrote:
Couple fixes for TLS and BPF interactions.
John Fastabend (2):
net: tls, update curr on splice as well
bpf: sockmap, updating the sg structure should also update currnet/core/filter.c | 19 +++++++++++++++++++ net/tls/tls_sw.c | 2 ++ 2 files changed, 21 insertions(+)
Here is the summary with links:
- [net,1/2] net: tls, update curr on splice as well
https://git.kernel.org/netdev/net/c/c5a595000e26
- [net,2/2] bpf: sockmap, updating the sg structure should also update curr
https://git.kernel.org/netdev/net/c/bb9aefde5bba
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html