[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e1d01068-238c-4fe3-98ce-5c44753b321f@redhat.com>
Date: Tue, 13 May 2025 18:56:59 +0200
From: David Hildenbrand <david@...hat.com>
To: Oleg Nesterov <oleg@...hat.com>, Jiri Olsa <jolsa@...nel.org>
Cc: Masami Hiramatsu <mhiramat@...nel.org>,
Peter Zijlstra <peterz@...radead.org>, Andrii Nakryiko <andrii@...nel.org>,
linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org
Subject: Re: [PATCH mm-stable] uprobes: Revert ref_ctr_offset in
uprobe_unregister error path
On 13.05.25 17:46, Oleg Nesterov wrote:
> On 05/13, Jiri Olsa wrote:
>>
>> --- a/kernel/events/uprobes.c
>> +++ b/kernel/events/uprobes.c
>> @@ -581,8 +581,8 @@ int uprobe_write_opcode(struct arch_uprobe *auprobe, struct vm_area_struct *vma,
>>
>> out:
>> /* Revert back reference counter if instruction update failed. */
>> - if (ret < 0 && is_register && ref_ctr_updated)
>> - update_ref_ctr(uprobe, mm, -1);
>> + if (ret < 0 && ref_ctr_updated)
>> + update_ref_ctr(uprobe, mm, is_register ? -1 : 1);
>
> Acked-by: Oleg Nesterov <oleg@...hat.com>
>
> And just in case, I agree this has nothing to do with the recent changes from David.
BTW, I stumbled over this when doing the rework.
Back then, I was wondering if this is to handle the case where
un-registering effectively fails because someone MADV_DONTNEED'ed the page.
But, we only perform the update_ref_ctr() after verify_opcode(), so that
does not apply.
With proper Fixes:
Acked-by: David Hildenbrand <david@...hat.com>
--
Cheers,
David / dhildenb
Powered by blists - more mailing lists