[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADpXja_PYfwBcigR-D9m7bsJg-fnPN921YeOrJJzYZTM3PftjQ@mail.gmail.com>
Date: Mon, 12 Oct 2020 13:10:05 +0300
From: Aleksandr Nogikh <a.nogikh@...il.com>
To: Johannes Berg <johannes@...solutions.net>
Cc: davem@...emloft.net, kuba@...nel.org,
Eric Dumazet <edumazet@...gle.com>,
Andrey Konovalov <andreyknvl@...gle.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
Marco Elver <elver@...gle.com>, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org, linux-wireless@...r.kernel.org,
nogikh@...gle.com
Subject: Re: [PATCH 1/2] net: store KCOV remote handle in sk_buff
On Mon, 12 Oct 2020 at 10:12, Johannes Berg <johannes@...solutions.net> wrote:
[...]
> > @@ -233,6 +233,7 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask,
> > skb->end = skb->tail + size;
> > skb->mac_header = (typeof(skb->mac_header))~0U;
> > skb->transport_header = (typeof(skb->transport_header))~0U;
> > + skb_set_kcov_handle(skb, kcov_common_handle());
>
> Btw, you're only setting this here. It seems to me it would make sense
> to copy it when the skb is copied, rather than then having it set to the
> kcov handle of the (interrupted) task that was copying the skb?
>
> johannes
>
The field is added to the part of sk_buff that is between
headers_start and headers_end, therefore skb_copy will copy the field
to the newly created buffer. So in the case of copying it will be
initialized, and then overwritten. Probably, it's not the most
efficient way, but it seems to be the same for some other
fields that are initialized in __alloc_skb.
Powered by blists - more mailing lists