Re: [PATCH net] net/tls: fix sk_msg trim on fallback to copy mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 31 Oct 2019 15:24:44 -0700, Jakub Kicinski wrote:
> diff --git a/net/core/skmsg.c b/net/core/skmsg.c
> index cf390e0aa73d..c2b0f9cb589c 100644
> --- a/net/core/skmsg.c
> +++ b/net/core/skmsg.c
> @@ -261,25 +261,29 @@ void sk_msg_trim(struct sock *sk, struct sk_msg *msg, int len)
>         msg->sg.size = len;
>         while (msg->sg.data[i].length &&
>                trim >= msg->sg.data[i].length) {
> +               bool move_curr = msg->sg.curr == i;
> +
>                 trim -= msg->sg.data[i].length;
>                 sk_msg_free_elem(sk, msg, i, true);
>                 sk_msg_iter_var_prev(i);
> +               if (move_curr) {
> +                       msg->sg.curr = i;
> +                       msg->sg.copybreak = msg->sg.data[i].length;
> +               }
>                 if (!trim)
>                         goto out;
>         }

Thinking about this in between builds that is clearly nonsensical,
sorry. But I'd feel a little better if we merged a full fix instead of
just fixing the simple case for now :( Maybe I can produce a working
patch based on your description..



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux