[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAPhsuW5YoX=5HVYWFNaBHOeM+opfA6waqMMCwLQy2YS_+2k6ng@mail.gmail.com>
Date: Tue, 14 Aug 2018 09:35:35 -0700
From: Song Liu <liu.song.a23@...il.com>
To: Ravi Bangoria <ravi.bangoria@...ux.ibm.com>
Cc: Oleg Nesterov <oleg@...hat.com>,
Srikar Dronamraju <srikar@...ux.vnet.ibm.com>,
Steven Rostedt <rostedt@...dmis.org>, mhiramat@...nel.org,
Peter Zijlstra <peterz@...radead.org>, mingo@...hat.com,
acme@...nel.org, alexander.shishkin@...ux.intel.com,
jolsa@...hat.com, namhyung@...nel.org,
open list <linux-kernel@...r.kernel.org>,
ananth@...ux.vnet.ibm.com,
Alexis Berlemont <alexis.berlemont@...il.com>,
naveen.n.rao@...ux.vnet.ibm.com,
linux-arm-kernel@...ts.infradead.org, linux-mips@...ux-mips.org,
linux@...linux.org.uk, ralf@...ux-mips.org, paul.burton@...s.com
Subject: Re: [PATCH v8 3/6] Uprobes: Support SDT markers having reference
count (semaphore)
On Mon, Aug 13, 2018 at 9:37 PM, Ravi Bangoria
<ravi.bangoria@...ux.ibm.com> wrote:
> Hi Song,
>
> On 08/13/2018 10:42 PM, Song Liu wrote:
>> On Mon, Aug 13, 2018 at 6:17 AM, Oleg Nesterov <oleg@...hat.com> wrote:
>>> On 08/13, Ravi Bangoria wrote:
>>>>
>>>>> But damn, process creation (exec) is trivial. We could add a new uprobe_exec()
>>>>> hook and avoid delayed_uprobe_install() in uprobe_mmap().
>>>>
>>>> I'm sorry. I didn't get this.
>>>
>>> Sorry for confusion...
>>>
>>> I meant, if only exec*( could race with _register(), we could add another uprobe
>>> hook which updates all (delayed) counters before return to user-mode.
>>>
>>>>> Afaics, the really problematic case is dlopen() which can race with _register()
>>>>> too, right?
>>>>
>>>> dlopen() should internally use mmap() right? So what is the problem here? Can
>>>> you please elaborate.
>>>
>>> What I tried to say is that we can't avoid uprobe_mmap()->delayed_uprobe_install()
>>> because dlopen() can race with _register() too, just like exec.
>>>
>>> Oleg.
>>>
>>
>> How about we do delayed_uprobe_install() per file? Say we keep a list
>> of delayed_uprobe
>> in load_elf_binary(). Then we can install delayed_uprobe after loading
>> all sections of the
>> file.
>
> I'm not sure if I totally understood the idea. But how this approach can
> solve dlopen() race with _register()?
>
> Rather, making delayed_uprobe_list an mm field seems simple and effective
> idea to me. The only overhead will be list_empty(mm->delayed_list) check.
>
> Please let me know if I misunderstood you.
>
> Thanks,
> Ravi
I misunderstood the problem here. I guess mm->delayed_list is the
easiest solution of the race condition.
Thanks,
Song
Powered by blists - more mailing lists