[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7815A35E-6506-477D-8E57-3960F7C1FE62@fb.com>
Date: Tue, 22 May 2018 21:56:18 +0000
From: Song Liu <songliubraving@...com>
To: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
CC: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Kernel Team <Kernel-team@...com>,
Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH 2/2] perf/core: fix bad use of igrab in
kernel/event/core.c
> On Apr 18, 2018, at 11:17 PM, Alexander Shishkin <alexander.shishkin@...ux.intel.com> wrote:
>
> On Tue, Apr 17, 2018 at 11:29:07PM -0700, Song Liu wrote:
>> As Miklos reported and suggested:
>>
>> This pattern repeats two times in trace_uprobe.c and in
>> kernel/events/core.c as well:
>>
>> ret = kern_path(filename, LOOKUP_FOLLOW, &path);
>> if (ret)
>> goto fail_address_parse;
>>
>> inode = igrab(d_inode(path.dentry));
>> path_put(&path);
>>
>> And it's wrong. You can only hold a reference to the inode if you
>> have an active ref to the superblock as well (which is normally
>> through path.mnt) or holding s_umount.
>
> Oops. I must have snatched it from the uprobe code without thinking.
>
>> This way unmounting the containing filesystem while the tracepoint is
>> active will give you the "VFS: Busy inodes after unmount..." message
>> and a crash when the inode is finally put.
>>
>> Solution: store path instead of inode.
>>
>> This patch fixes the issue in kernel/event/core.c.
>>
>> NOTE: Based on my understanding, perf_addr_filter only supports intel_pt.
>
> Coresight too, but that's probably even further away from what you have.
>
>> However, my test system doesn't support address filtering (or I made a
>> mistake?). Therefore, I have NOT tested this patch.
>
> Check /sys/devices/intel_pt/caps/num_address_ranges, if it's non-zero,
> it's supported.
>
>> Could someone please help test it?
>
> Yes:
>
> Reviewed-and-tested-by: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
>
> The subject line needs a little love to be more like other perf commits, but
> other than that, looks good.
>
> Thanks!
Did this patch ever make into tip/perf/XX trees? If not, what shall I do
to move it ahead?
Thanks,
Song
Powered by blists - more mailing lists