Skip to content

Commit

Permalink
kernel/core_hook.c: try umount /system/etc/hosts
Browse files Browse the repository at this point in the history
Modding hosts file is a common thing to have on rooted android devices.
But this is easy to detect, either by reading the file, checking modified time and checking its filesize.
Unmounting it as needed for non-root processes solves this issue.

kernel: try umount /system/etc/hosts
tiann#1494
  • Loading branch information
backslashxx committed Mar 23, 2024
1 parent f57d351 commit ab53ccd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kernel/core_hook.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,9 @@ int ksu_handle_setuid(struct cred *new, const struct cred *old)
try_umount("/debug_ramdisk", false, MNT_DETACH);
try_umount("/sbin", false, MNT_DETACH);

// try umount /system/etc/hosts (hosts module)
try_umount("/system/etc/hosts", false, MNT_DETACH);

return 0;
}

Expand Down

0 comments on commit ab53ccd

Please sign in to comment.