Skip to content

Commit 54a13f9

Browse files
committed
/proc/pid/maps: fake jit-zygote-cache flags
7lpb3c said so that he won't say anything but actually said something
1 parent ea7585f commit 54a13f9

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

fs/proc/task_mmu.c

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,23 @@ static void show_vma_header_prefix(struct seq_file *m,
351351
extern void susfs_sus_ino_for_show_map_vma(unsigned long ino, dev_t *out_dev, unsigned long *out_ino);
352352
#endif
353353

354+
static void show_vma_header_prefix_fake(struct seq_file *m,
355+
unsigned long start, unsigned long end,
356+
vm_flags_t flags, unsigned long long pgoff,
357+
dev_t dev, unsigned long ino)
358+
{
359+
seq_setwidth(m, 25 + sizeof(void *) * 6 - 1);
360+
seq_printf(m, "%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu ",
361+
start,
362+
end,
363+
flags & VM_READ ? 'r' : '-',
364+
flags & VM_WRITE ? 'w' : '-',
365+
flags & VM_EXEC ? '-' : '-',
366+
flags & VM_MAYSHARE ? 's' : 'p',
367+
pgoff,
368+
MAJOR(dev), MINOR(dev), ino);
369+
}
370+
354371
static void
355372
show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid)
356373
{
@@ -388,14 +405,20 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid)
388405
name = "/dev/ashmem (deleted)";
389406
goto done;
390407
}
408+
if (strstr(path, "jit-zygote-cache")) {
409+
start = vma->vm_start;
410+
end = vma->vm_end;
411+
show_vma_header_prefix_fake(m, start, end, flags, pgoff, dev, ino);
412+
goto bypass;
413+
}
391414
}
392415
}
393416

394417
/* We don't show the stack guard page in /proc/maps */
395418
start = vma->vm_start;
396419
end = vma->vm_end;
397420
show_vma_header_prefix(m, start, end, flags, pgoff, dev, ino);
398-
421+
bypass:
399422
/*
400423
* Print the dentry name for named mappings, and a
401424
* special [heap] marker for the heap:

0 commit comments

Comments
 (0)