Commit Graph

2249 Commits

Author SHA1 Message Date
npes87184
312466aaf8 Prevent setting zero over than bound
The &cmd will return a pointer which point to a pointer of cmdline.
It is a memory address which is usually 8 bytes in 64 bits machine.

However, the struct cmdline is 4 bytes. This will cause setting zero
beyond the bound.

Below is a simple example to show the differentiation:

struct cmdline {
        char skip_initramfs;
        char slot[3];
};

static void parse_cmdline(struct cmdline *cmd)
{
        printf("%lu\n", sizeof(*cmd)); /* 4 */
        printf("%lu\n", sizeof(&cmd)); /* 8 */
}

int main()
{
        struct cmdline cmd;
        parse_cmdline(&cmd);
        return 0;
}

This patch prevents this.

Signed-off-by: npes87184 <npes87184@gmail.com>
2018-06-19 14:22:11 -07:00
John Wu
c0ca99f4b4 Make sure APK exists before signing AVB 1.0
Check all possible APK locations before actually running the verification
2018-06-19 14:19:38 -07:00
XiNGRZ
196f15d240 Fix survival script for AVB 1.0 signed boot image 2018-06-19 14:19:38 -07:00
topjohnwu
bfddef2671 Bump Magisk Manager 2018-06-20 04:55:34 +08:00
topjohnwu
44395e8ff0 Fix root loss issue when MagiskHide is enabled
In previous implementations, proc_monitor checks whether the mount namespace of an app is actually separated from zygote using a list generated at startup.
However, for some unknown reason, some devices (e.g. Samsung) has multiple zygote servers running in the background.
This means that app processes spawned from the unlisted zygotes are not checked whether the separation is done or not, causing MagiskHide unmount stuffs in the namespace of zygote, and since zygote is the "mother" of all apps, all apps will no longer have root access.

Since I'm not sure of the reason why multiple zygotes exists, so instead of checking the namespace against a list, compare the current namespace against the parent process's namespace.
This will make sure the namespace is NOT the same as the parent process, which is supposed to be the zygote server.
2018-06-20 04:55:34 +08:00
topjohnwu
4ff39f8817 Update to libsu 1.2.0 2018-06-20 04:48:56 +08:00
linar10
1df41003ec Update strings.xml 2018-06-20 04:48:56 +08:00
linar10
1f39ee41ad Create strings.xml 2018-06-20 04:48:56 +08:00
Rom
42d8b1ecb9 Update French translation 2018-06-20 04:48:56 +08:00
dark-basic #DarkBasic BasicHD
a4da7b33e6 Create Strings.xml ver. Stub 2018-06-20 04:48:56 +08:00
Oliver Cervera
e4ee9e9095 Create Stub for Italian (it) 2018-06-20 04:48:56 +08:00
topjohnwu
835ece5469 Update default flag logic, fix S9/S9+ DTB patches 2018-06-18 01:40:56 +08:00
topjohnwu
77430a282f Support new util_functions.sh 2018-06-18 01:40:42 +08:00
topjohnwu
d93fc67a75 Improve detecting device status 2018-06-17 17:59:24 +08:00
topjohnwu
838f3cc01e Simplify hiding conditions 2018-06-17 05:16:52 +08:00
topjohnwu
4d5841332a Change to applet name to prevent showing magisk.bin 2018-06-17 01:47:55 +08:00
topjohnwu
9b41976252 Preserve last log 2018-06-17 01:38:58 +08:00
topjohnwu
d08fd0561a Remove invincible mode 2018-06-17 01:28:29 +08:00
topjohnwu
30e459252c Update daemon 2018-06-17 01:26:38 +08:00
topjohnwu
a6958ac139 Fix adbd on GSIs 2018-06-17 01:25:27 +08:00
topjohnwu
d7d76f54cc Install stub APK when needed 2018-06-14 05:09:54 +08:00
topjohnwu
e6c1dd532d Re-implement duplicate Magisk Manager logic
Starting from the next Magisk release, it will no longer prefer the package name com.topjohnwu.magisk over a hidden manager; it will always be aware whether the hidden manager exists, so when a package named com.topjohnwu.magisk is installed alongside with the hidden manager, com.topjohnwu.magisk will not have root access by default.
This will prevent malware from using the package name com.topjohnwu.magisk to gain root access when a user is using a hidden manager.
To support this new behavior, several changes has to be done:
- Never grant com.topjohnwu.magisk in Magisk Manager (if it IS the actual manager, MagiskSU will grant it by default)
- While hidden, remove com.topjohnwu.magisk if exists
- Restore Magisk Manager (unhide) has to be done with root
- Upgrading Magisk Manager should preserve package name (implemented in a949641)
2018-06-14 04:30:24 +08:00
topjohnwu
970a2e87b3 Bundle in stub APK into magiskinit 2018-06-14 02:54:38 +08:00
topjohnwu
cabaae8403 MagiskSU improvements 2018-06-14 02:54:33 +08:00
topjohnwu
d1f301e059 Improve stub manager 2018-06-14 02:31:31 +08:00
topjohnwu
79eb5b2ed2 Rename entry 2018-06-14 01:44:16 +08:00
topjohnwu
f0533fca70 Simplify su_info cache
The previous implementation is great if multiple different requesters call su rapidly in a very short period of time, however in the real world this is nearly impossible to happen. This comes with quite a big overhead, since it requires two lists and also an everlasting background thread to constantly maintain the lists.

The new implementation will spawn a collector thread for each cache miss, and the thread will terminate itself once the data is invalidated.
2018-06-13 23:04:57 +08:00
topjohnwu
08e98eeb15 Fail fast when possible 2018-06-13 18:14:23 +08:00
topjohnwu
f2064a84ed Move database logic outside of MagiskSU 2018-06-13 04:34:05 +08:00
topjohnwu
b2f719989d Move database logic outside of MagiskSU 2018-06-13 04:33:32 +08:00
topjohnwu
1e812c40ce Finally fix magisk icons 2018-06-12 19:26:34 +08:00
topjohnwu
a949641342 Preserve hidden when upgrade 2018-06-12 05:32:35 +08:00
topjohnwu
6db27c7758 Allow file constructed JarMap getOutputStream 2018-06-12 02:57:46 +08:00
topjohnwu
c231e88a5d Small tweak in setting up magisk DB 2018-06-12 00:04:36 +08:00
topjohnwu
3f83919e09 Fix bootloops when flashing Magisk after data wipe on FBE devices 2018-06-11 02:26:18 +08:00
topjohnwu
72a5b83544 Support patching dtb placed in extra section (S9/S9+) 2018-06-10 20:36:18 +08:00
topjohnwu
d2e8ecc646 Fix error return code when patching dtb 2018-06-10 20:36:18 +08:00
topjohnwu
30eb4074cb Update binary dump method 2018-06-10 16:55:00 +08:00
topjohnwu
79c71509f6 Add NoUIActivity 2018-06-10 14:51:37 +08:00
topjohnwu
5dab580cfc Move translation to correct location 2018-06-10 11:56:23 +08:00
Jason A. Donenfeld
9929e7d8e8 Remove update file on boot
It's not important to check the return value of unlink(2) or even verify
that the file exists. If this code is running, it means the system has
rebooted, and thus the update file, if any, should be removed so that
MagiskManager doesn't keep displaying the same message. We also handle
this before we handle "disable" so that disabled modules don't keep
requesting a reboot to update.
2018-06-10 03:02:56 +08:00
Alexandre Boeglin
f6ee252572 magiskboot: Check dtb header content to avoid false positives 2018-06-10 03:02:13 +08:00
topjohnwu
90d218ebc8 Update SafetyNet extension implementation 2018-06-10 02:35:03 +08:00
topjohnwu
499a157946 Update snet extension 2018-06-10 00:43:01 +08:00
topjohnwu
c5a7ab2415 Move runWithPermission method 2018-06-09 17:14:24 +08:00
Fatih Fırıncı
3dd5a6f378 Create strings.xml 2018-06-09 15:49:37 +08:00
Jonas Schubert
7be26a0677 Added german strings for stub 2018-06-09 15:49:24 +08:00
vvb2060
c183fdd3ca add zh-rCN translation 2018-06-09 15:49:06 +08:00
Rom
baa439457e Minor French translation update 2018-06-09 15:48:58 +08:00
Albert I
4dbcd54b72 Initial stub app translation to Indonesian
Signed-off-by: Albert I <krascgq@outlook.co.id>
2018-06-09 15:48:42 +08:00