[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <58d522f5-751a-44ff-9581-bc772c8d5c60@huaweicloud.com>
Date: Thu, 29 May 2025 23:09:47 +0800
From: Pu Lehui <pulehui@...weicloud.com>
To: Oleg Nesterov <oleg@...hat.com>, lorenzo.stoakes@...cle.com
Cc: mhiramat@...nel.org, peterz@...radead.org, akpm@...ux-foundation.org,
Liam.Howlett@...cle.com, vbabka@...e.cz, jannh@...gle.com, pfalcato@...e.de,
linux-mm@...ck.org, linux-kernel@...r.kernel.org, pulehui@...wei.com
Subject: Re: [RFC PATCH v2 1/2] mm/mremap: Fix uprobe anon page be overwritten
when expanding vma during mremap
On 2025/5/28 1:20, Oleg Nesterov wrote:
> Hi Lehui,
>
> On 05/28, Pu Lehui wrote:
>>
>> On 2025/5/27 22:23, Oleg Nesterov wrote:
>>> Well, I leave this to you / Lorenzo / David, but...
>>>
>>> On 05/27, Pu Lehui wrote:
>>>>
>>>> Fixes: 78a320542e6c ("uprobes: Change valid_vma() to demand VM_MAYEXEC rather than VM_EXEC")
>>>
>>> I don't think that commit could cause this problem.
>>
>> Hi Oleg,
>>
>> Me too! I was test that before and after commit 78a320542e6c, so call it the
>> `directly related commit`.
>
> I feel I am totally confused...
>
> but _may be_ you have used the initial reproducer which used PROT_NONE in
>
> void *addr2 = mmap(NULL, 2 * 4096, PROT_NONE, MAP_PRIVATE, fd, 0);
>
> ?
>
> If yes. I _think_ we should have the same problem with or without 78a320542e6c,
> just you need to s/PROT_NONE/PROT_EXEC/.
>
>> In fact, I think the issue was introduced in the
>> original commit 2b1444983508 ("uprobes, mm, x86: Add the ability to install
>> and remove uprobes breakpoints") # v3.5-rc1.
>
> probably yes... Damn I don't know ;)
>
> Oleg.
Hi Oleg, Lorenzo,
Upon verification, the issue was first introduced by the commit
2b1444983508 ("uprobes, mm, x86: Add the ability to install and remove
uprobes breakpoints"). Uprobe only became available for user use after
commit f3f096cfedf8 ("tracing: Provide trace events interface for
uprobes"), but at that time, the issue was obscured by another
problem—specifically, the always failure of uprobe_mmap processing for
the newly allocated new_vma during copy_vma. After commit 6dab3cc078e3
("uprobes: Remove copy_vma()->uprobe_mmap()") addressed that, the
original issue was exposed.
Therefore, I believe the Fixes tag should best reference commit
2b1444983508 ("uprobes, mm, x86: Add the ability to install and remove
uprobes breakpoints").
Powered by blists - more mailing lists