Re: [PATCHv4 02/14] uprobe: Add support for session consumer

Oleg Nesterov
2024-09-17T12:22:29Z

On 09/17, Jiri Olsa wrote:
>
> static void handler_chain(struct uprobe *uprobe, struct pt_regs *regs)
...
> + if (!ignore && !ZERO_OR_NULL_PTR(ri)) {
> + /*
> + * The push_idx value has the final number of return consumers,
> + * and ri->consumers_cnt has number of allocated consumers.
> + */
> + ri->consumers_cnt = push_idx;
> + prepare_uretprobe(uprobe, regs, ri);
> + }

This looks wrong. ri is not kfreed if ignore == true.

But see my previous email, if we change this code as I tried to suggest
the problem goes away and handler_chain() doesn't need "bool ignore".

Oleg.