Repository navigation
Expand file tree
/
Copy pathfix_task_mmu.patch
More file actions
62 lines (60 loc) · 1.79 KB
/
Copy pathfix_task_mmu.patch
File metadata and controls
62 lines (60 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
--- fs/proc/task_mmu.c
+++ fs/proc/task_mmu.c
@@ -309,11 +309,48 @@
const char *name = NULL;
struct dentry *dentry;
+#ifdef CONFIG_KSU_SUSFS_OPEN_REDIRECT
+ char *spoofed_redirected_name = NULL;
+#endif // #ifdef CONFIG_KSU_SUSFS_OPEN_REDIRECT
+
if (file) {
struct inode *inode = file_inode(vma->vm_file);
+
+#ifdef CONFIG_KSU_SUSFS_OPEN_REDIRECT
+ if (SUSFS_IS_INODE_OPEN_REDIRECT(inode)) {
+ if (!susfs_open_redirect_spoof_show_map_vma(inode, &ino, &dev, spoofed_redirected_name)) {
+ pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT;
+ goto orig_flow;
+ }
+ }
+#endif // #ifdef CONFIG_KSU_SUSFS_OPEN_REDIRECT
+#ifdef CONFIG_KSU_SUSFS_SUS_MAP
+ if (SUSFS_IS_INODE_SUS_MAP(inode)) {
+ seq_setwidth(m, 25 + sizeof(void *) * 6 - 1);
+ seq_put_hex_ll(m, NULL, vma->vm_start, 8);
+ seq_put_hex_ll(m, "-", vma->vm_end, 8);
+ seq_putc(m, ' ');
+ seq_putc(m, '-');
+ seq_putc(m, '-');
+ seq_putc(m, '-');
+ seq_putc(m, 'p');
+ seq_put_hex_ll(m, " ", pgoff, 8);
+ seq_put_hex_ll(m, " ", MAJOR(dev), 2);
+ seq_put_hex_ll(m, ":", MINOR(dev), 2);
+ seq_put_decimal_ull(m, " ", ino);
+ seq_putc(m, ' ');
+ goto done;
+ }
+#endif // #ifdef CONFIG_KSU_SUSFS_SUS_MAP
+
dev = inode->i_sb->s_dev;
ino = inode->i_ino;
pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT;
+
+#ifdef CONFIG_KSU_SUSFS_SUS_KSTAT
+ susfs_sus_kstat_spoof_show_map_vma(inode, &dev, &ino);
+#endif // #ifdef CONFIG_KSU_SUSFS_SUS_KSTAT
+
dentry = file->f_path.dentry;
if (dentry) {
const char *path = (const char *)dentry->d_name.name;
@@ -333,6 +370,10 @@
}
}
+#ifdef CONFIG_KSU_SUSFS_OPEN_REDIRECT
+orig_flow:
+#endif // #ifdef CONFIG_KSU_SUSFS_OPEN_REDIRECT
+
start = vma->vm_start;
end = VMA_PAD_START(vma);
show_vma_header_prefix(m, start, end, flags, pgoff, dev, ino);