[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iKqOj6Zxt38WDyXZvFSi6oBQpXFoYwZYh7Uqk27evVybg@mail.gmail.com>
Date: Fri, 20 Jan 2023 13:40:23 +0100
From: Eric Dumazet <edumazet@...gle.com>
To: Jesper Dangaard Brouer <brouer@...hat.com>
Cc: netdev@...r.kernel.org, Jakub Kicinski <kuba@...nel.org>,
"David S. Miller" <davem@...emloft.net>, pabeni@...hat.com,
syzbot+c8a2e66e37eee553c4fd@...kaller.appspotmail.com
Subject: Re: [PATCH net-next V2] net: fix kfree_skb_list use of skb_mark_not_on_list
On Fri, Jan 20, 2023 at 11:34 AM Jesper Dangaard Brouer
<brouer@...hat.com> wrote:
>
> A bug was introduced by commit eedade12f4cb ("net: kfree_skb_list use
> kmem_cache_free_bulk"). It unconditionally unlinked the SKB list via
> invoking skb_mark_not_on_list().
>
> In this patch we choose to remove the skb_mark_not_on_list() call as it
> isn't necessary. It would be possible and correct to call
> skb_mark_not_on_list() only when __kfree_skb_reason() returns true,
> meaning the SKB is ready to be free'ed, as it calls/check skb_unref().
>
> This fix is needed as kfree_skb_list() is also invoked on skb_shared_info
> frag_list (skb_drop_fraglist() calling kfree_skb_list()). A frag_list can
> have SKBs with elevated refcnt due to cloning via skb_clone_fraglist(),
> which takes a reference on all SKBs in the list. This implies the
> invariant that all SKBs in the list must have the same refcnt, when using
> kfree_skb_list().
>
> Reported-by: syzbot+c8a2e66e37eee553c4fd@...kaller.appspotmail.com
> Reported-and-tested-by: syzbot+c8a2e66e37eee553c4fd@...kaller.appspotmail.com
> Fixes: eedade12f4cb ("net: kfree_skb_list use kmem_cache_free_bulk")
> Signed-off-by: Jesper Dangaard Brouer <brouer@...hat.com>
Reviewed-by: Eric Dumazet <edumazet@...gle.com>
Powered by blists - more mailing lists