@@ -149,6 +149,8 @@ struct uprobes_state {
extern bool arch_uprobe_ignore(struct arch_uprobe *aup, struct pt_regs *regs);
extern void arch_uprobe_copy_ixol(struct page *page, unsigned long vaddr,
void *src, unsigned long len);
+extern bool vma_has_uprobes(struct vm_area_struct *vma, unsigned long start,
+ unsigned long end);
#else /* !CONFIG_UPROBES */
struct uprobes_state {
};
@@ -203,5 +205,10 @@ static inline void uprobe_copy_process(struct task_struct *t, unsigned long flag
static inline void uprobe_clear_state(struct mm_struct *mm)
{
}
+static inline bool vma_has_uprobes(struct vm_area_struct *vma, unsigned long start,
+ unsigned long end)
+{
+ return false;
+}
#endif /* !CONFIG_UPROBES */
#endif /* _LINUX_UPROBES_H */
@@ -1095,7 +1095,7 @@ int uprobe_mmap(struct vm_area_struct *vma)
return 0;
}
-static bool
+bool
vma_has_uprobes(struct vm_area_struct *vma, unsigned long start, unsigned long end)
{
loff_t min, max;
vma_has_uprobes() will be used in the following patch to check if a vma could be unmapped with holding read mmap_sem, but it is static. So, make it non-static to use outside uprobe. Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Yang Shi <yang.shi@linux.alibaba.com> --- include/linux/uprobes.h | 7 +++++++ kernel/events/uprobes.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-)