Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
5b54ef84
Commit
5b54ef84
authored
Feb 16, 2019
by
vvb2060
Committed by
John Wu
Feb 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip same mount namespace
parent
c08b0d49
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
proc_monitor.cpp
native/jni/magiskhide/proc_monitor.cpp
+6
-6
No files found.
native/jni/magiskhide/proc_monitor.cpp
View file @
5b54ef84
...
@@ -59,9 +59,6 @@ static inline void lazy_unmount(const char* mountpoint) {
...
@@ -59,9 +59,6 @@ static inline void lazy_unmount(const char* mountpoint) {
LOGD
(
"hide_daemon: Unmounted (%s)
\n
"
,
mountpoint
);
LOGD
(
"hide_daemon: Unmounted (%s)
\n
"
,
mountpoint
);
}
}
/* APK monitoring doesn't seem to require checking namespace
* separation from PPID. Preserve this function just in case */
#if 0
static
inline
int
parse_ppid
(
const
int
pid
)
{
static
inline
int
parse_ppid
(
const
int
pid
)
{
char
path
[
32
];
char
path
[
32
];
int
ppid
;
int
ppid
;
...
@@ -77,7 +74,6 @@ static inline int parse_ppid(const int pid) {
...
@@ -77,7 +74,6 @@ static inline int parse_ppid(const int pid) {
return
ppid
;
return
ppid
;
}
}
#endif
static
bool
is_snet
(
const
int
pid
)
{
static
bool
is_snet
(
const
int
pid
)
{
char
path
[
32
];
char
path
[
32
];
...
@@ -144,11 +140,15 @@ static bool process_pid(int pid) {
...
@@ -144,11 +140,15 @@ static bool process_pid(int pid) {
if
(
pid
<=
1000
)
if
(
pid
<=
1000
)
return
true
;
return
true
;
struct
stat
ns
;
struct
stat
ns
,
pns
;
int
ppid
=
parse_ppid
(
pid
);
int
uid
=
get_uid
(
pid
);
int
uid
=
get_uid
(
pid
);
if
(
hide_uid
.
count
(
uid
))
{
if
(
hide_uid
.
count
(
uid
))
{
// Make sure we can read mount namespace
// Make sure we can read mount namespace
if
(
read_ns
(
pid
,
&
ns
))
if
(
read_ns
(
pid
,
&
ns
)
||
read_ns
(
ppid
,
&
pns
))
return
true
;
// mount namespace is not separated, we only unmount once
if
(
ns
.
st_dev
==
pns
.
st_dev
&&
ns
.
st_ino
==
pns
.
st_ino
)
return
true
;
return
true
;
// Check if it's a process we haven't already hijacked
// Check if it's a process we haven't already hijacked
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment