Subject: Re: [PATCH net] net: sched: fix use-after-free in tc_new_tfilter()

From: Vlad Buslov <[email-masked]>
Date: Mon, 31 Jan 2022 21:36:23 +0200

On Mon 31 Jan 2022 at 21:31, Eric Dumazet <[email-masked]> wrote:
> On Mon, Jan 31, 2022 at 11:28 AM Vlad Buslov <[email-masked]> wrote:
>>
>> Yeah, but I also didn't get how the "chain" variable can get reused in
>> that other function (tcf_new_tfilter()). It seems to always be
>> unconditionally assigned with return value of tcf_chain_get().
>>
>
> This is why I removed the chain=NULL initialization which is not needed.
>
> The potential issue about replay was really about @q variable.

Got it. Initially it wasn't clear because I got the impression from
commit message that reuse of both variables can lead to use-after-free:
"we need to make sure @q and @chain local variables are cleared again,
or risk use-after-free".