From: David Hildenbrand <david@redhat.com>
To: Oleg Nesterov <oleg@redhat.com>, Jiri Olsa <jolsa@kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Andrii Nakryiko <andrii@kernel.org>,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH mm-stable] uprobes: Revert ref_ctr_offset in uprobe_unregister error path
Date: Tue, 13 May 2025 18:56:59 +0200 [thread overview]
Message-ID: <e1d01068-238c-4fe3-98ce-5c44753b321f@redhat.com> (raw)
In-Reply-To: <aCNpbPuY6FI1Aiyx@redhat.com>
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@redhat.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@redhat.com>
--
Cheers,
David / dhildenb
prev parent reply other threads:[~2025-05-13 16:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-13 12:21 [PATCH mm-stable] uprobes: Revert ref_ctr_offset in uprobe_unregister error path Jiri Olsa
2025-05-13 13:16 ` David Hildenbrand
2025-05-13 13:17 ` David Hildenbrand
2025-05-13 13:48 ` Jiri Olsa
2025-05-13 15:46 ` Oleg Nesterov
2025-05-13 16:56 ` David Hildenbrand [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e1d01068-238c-4fe3-98ce-5c44753b321f@redhat.com \
--to=david@redhat.com \
--cc=andrii@kernel.org \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox