Skip to content

Commit 343b4b4

Browse files
committed
Merge tag 'perf_urgent_for_v6.18_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Borislav Petkov: - Make sure perf reporting works correctly in setups using overlayfs or FUSE - Move the uprobe optimization to a better location logically * tag 'perf_urgent_for_v6.18_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/core: Fix MMAP2 event device with backing files perf/core: Fix MMAP event path names with backing files perf/core: Fix address filter match with backing files uprobe: Move arch_uprobe_optimize right after handlers execution
2 parents c7864ee + fa4f4ba commit 343b4b4

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

kernel/events/core.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9403,7 +9403,7 @@ static void perf_event_mmap_event(struct perf_mmap_event *mmap_event)
94039403
flags |= MAP_HUGETLB;
94049404

94059405
if (file) {
9406-
struct inode *inode;
9406+
const struct inode *inode;
94079407
dev_t dev;
94089408

94099409
buf = kmalloc(PATH_MAX, GFP_KERNEL);
@@ -9416,12 +9416,12 @@ static void perf_event_mmap_event(struct perf_mmap_event *mmap_event)
94169416
* need to add enough zero bytes after the string to handle
94179417
* the 64bit alignment we do later.
94189418
*/
9419-
name = file_path(file, buf, PATH_MAX - sizeof(u64));
9419+
name = d_path(file_user_path(file), buf, PATH_MAX - sizeof(u64));
94209420
if (IS_ERR(name)) {
94219421
name = "//toolong";
94229422
goto cpy_name;
94239423
}
9424-
inode = file_inode(vma->vm_file);
9424+
inode = file_user_inode(vma->vm_file);
94259425
dev = inode->i_sb->s_dev;
94269426
ino = inode->i_ino;
94279427
gen = inode->i_generation;
@@ -9492,7 +9492,7 @@ static bool perf_addr_filter_match(struct perf_addr_filter *filter,
94929492
if (!filter->path.dentry)
94939493
return false;
94949494

9495-
if (d_inode(filter->path.dentry) != file_inode(file))
9495+
if (d_inode(filter->path.dentry) != file_user_inode(file))
94969496
return false;
94979497

94989498
if (filter->offset > offset + size)

kernel/events/uprobes.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2765,16 +2765,16 @@ static void handle_swbp(struct pt_regs *regs)
27652765

27662766
handler_chain(uprobe, regs);
27672767

2768+
/* Try to optimize after first hit. */
2769+
arch_uprobe_optimize(&uprobe->arch, bp_vaddr);
2770+
27682771
/*
27692772
* If user decided to take execution elsewhere, it makes little sense
27702773
* to execute the original instruction, so let's skip it.
27712774
*/
27722775
if (instruction_pointer(regs) != bp_vaddr)
27732776
goto out;
27742777

2775-
/* Try to optimize after first hit. */
2776-
arch_uprobe_optimize(&uprobe->arch, bp_vaddr);
2777-
27782778
if (arch_uprobe_skip_sstep(&uprobe->arch, regs))
27792779
goto out;
27802780

0 commit comments

Comments
 (0)