KernelSU icon indicating copy to clipboard operation
KernelSU copied to clipboard

non-GKI Custom kernel build-in KernelSU won't work.

Open Coconutat opened this issue 1 year ago • 10 comments

Please check before submitting an issue

  • [X] I have searched the issues and haven't found anything relevant
  • [X] I will upload bugreport file in KernelSU Manager - Settings - Report log
  • [ ] I know how to reproduce the issue which may not be specific to my device

Describe the bug

I build a non-GKI Custom kernel with KernelSU. The tag v0.9.2(11682) is working. But when I upstream ksu to 11708,The manager is unable to recognize KSU.

Has KernelSU given up support for the old kernel(non-GKI)?

To Reproduce

Build Kernel with integrate KernelSU for non GKI kernel.
Add KernelSU source code to my kernel source tree(Use tag or main branch).

Expected behavior

Hope new version ksu worked.Or just not drop it too soon.

Screenshots

No response

Logs

Logs: 11708:KernelSU_bugreport_2024-03-25_18_50.tar.gz

11682:KernelSU_bugreport_2024-03-25_19_32.tar.gz

Device info

Device:Huawei Mate 10 Pro OS Version:EMUI 10 (Android 10) Kernel Version:4.14.116

Additional context

No response

Coconutat avatar Mar 25 '24 11:03 Coconutat

which commit broke it?

tiann avatar Mar 25 '24 11:03 tiann

which commit broke it?

Sorry I don’t konw.If I know it,I will tell you before I open issuse.Sorry for that.

Coconutat avatar Mar 25 '24 11:03 Coconutat

which commit broke it?

I only know it after 0.9.2.I was build kernel yesterday for test.But KSU won’t work.At first, I thought there was a problem with my kernel, until I downgraded the KSU code to 0.9.2.

Coconutat avatar Mar 25 '24 11:03 Coconutat

which commit broke it?

I will go find the KSU kernel that I previously stored,I find the 11685 is work.

Coconutat avatar Mar 25 '24 13:03 Coconutat

ls -alZ /data/app

tiann avatar Mar 25 '24 14:03 tiann

ls -alZ /data/app

HWBLA:/ # ls -alZ /data/app
total 181
drwxrwx--x 57 system system u:object_r:apk_data_file:s0    8192 2024-03-25 19:25 .
drwxrwx--x 66 system system u:object_r:system_data_file:s0 4096 2024-03-25 22:10 ..
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 15:23 bin.mt.plus.canary-UtcsL89M3x7gxtGgQGtSMg==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-23 13:42 branislav667.wallhaven-9S0eGJ-TVQbkoGjp4jvXDQ==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 15:58 com.android.chrome-XsA-n5oGnu3JCfTAyGPxAg==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 16:01 com.android.vending-NJNB4FBqIlP5U38dEMn56A==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 22:04 com.coolapk.market-TOSGC6u8trdT-mJ6p6HUbg==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 16:12 com.digibites.accubattery-16LqgPrDjMqWAvkw4qDu_g==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-23 12:49 com.finalwire.aida64-q7jdA0Sr2rsoIRDEOKMzGA==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-24 21:47 com.franco.kernel-v3xAd1lUoJwhzp63QciMnA==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-23 12:49 com.futuremark.dmandroid.application-slcBii5bIiaxaMVwcH5Azw==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 16:04 com.google.android.apps.docs-uLkBvyFMnicOnD4fWDv_PA==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 16:04 com.google.android.apps.maps-nDItpErF1yU7Z9SahTUATA==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 16:06 com.google.android.apps.photos-LPOGO2Q3IT90VNjWfen7lg==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 16:03 com.google.android.apps.tachyon-qcbuujkhkcrtJmNtGkE1kw==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 16:02 com.google.android.gm-VWpkuXupiMsfB_SnZwuJhA==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 15:48 com.google.android.gms-rcmoVzL5BS2ErEUNMqKCgg==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-24 11:14 com.google.android.googlequicksearchbox-HdG_iS-Nlks9o7iVKmw3RA==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 15:13 com.google.android.inputmethod.latin-aXzBKWTyatbKSFQ1QGldvg==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 16:01 com.google.android.marvin.talkback-h6u_xc7Vobt7bGU-YbnUEQ==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 16:04 com.google.android.music-fN5rmOU8Rve-uwJuCapO9A==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 16:05 com.google.android.partnersetup-iR8KBRfVITdnFxTkUJUOHw==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 15:14 com.google.android.play.games-DP5D0fJWKu8PCd4CJfPIzg==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 16:07 com.google.android.projection.gearhead-wYBZkQX-ATAp5kT-oz4LDQ==
drwxrwxr-x  3 system system u:object_r:apk_data_file:s0    3488 2024-03-22 15:47 com.google.android.trichromelibrary_626111933-Zw6AZAIoXifZYZnUmQmhQQ==
drwxrwxr-x  3 system system u:object_r:apk_data_file:s0    3488 2024-03-22 15:58 com.google.android.trichromelibrary_626112033-Nco4NHY-Zk0rVl03PI_7xg==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 16:05 com.google.android.tts-lIeLkhaconMNlhTTp8MSDQ==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 16:06 com.google.android.videos-BEwEBV8wWar1VPG9ZryHYA==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 15:47 com.google.android.webview-_o6tmy9eWSbrC9dFP2bIkg==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 15:57 com.google.android.youtube-qOwcQt3BrU8J_-sjA1tQXg==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 16:04 com.hicloud.android.clone-8po6yoXOZU4I1mBbUuDE-g==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 15:44 com.huawei.android.hsf-7KolfZAx16ehlqsaUxunDg==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-23 13:11 com.huawei.android.thememanager-zDXuG5k2tx1vEnfiJyy5tg==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-23 21:28 com.huawei.android.totemweather-TcghOryM_KtMTdNLipVN_g==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 22:02 com.huawei.appmarket-OPW91TvQt0zKu_gOavuHOQ==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-23 12:59 com.huawei.compass-WsH4xQM4xS01s0zVgY4lrg==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 15:43 com.huawei.hwid-fHvhm2BAfnG9_ojyvzjftA==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-23 13:15 com.huawei.ucdlockscreen-zQz2cJhkI3VHbXrqBqLP_w==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 16:01 com.hyperbeard.odyssey-9JXGZxaxd2AqhS6itKPNdA==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 16:00 com.hyperbeard.tsuki2-06xzJ_K_LnWvQYxVaD_HYQ==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 22:05 com.liuzh.deviceinfo-cU2qyK4HUf1vcu12UyNsUw==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 16:05 com.microsoft.translator-WiH6A7atH4ddSChogSxqUg==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-23 14:59 com.nasoft.socmark-rH9mQYhqV81agHc0n_fupA==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 22:13 com.netease.cloudmusic-H_3ftco_hIBRtwOPIdrNJg==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 16:10 com.oomqf-epF03NdM7Zqm8HNj5W-B_Q==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-23 15:01 com.primatelabs.geekbench6-e5sBcGhi0Jy1iwzxFTnReQ==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 15:59 com.touchtype.swiftkey-CoxddAmx0CDrqxRPfy1ycw==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-24 11:13 flar2.devcheck-wOzbpb9eSbPnOKvFOEdfHg==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 15:13 mark.via.gp-M67XqDmbSb5A9IfWASlGWg==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-25 17:20 me.weishu.kernelsu-60D31oMRW7jzLhVYarFTEA==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 15:24 moe.nb4a-qAZn2XrWDj5QFnROWinz6A==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 15:53 net.kairosoft.android.apart_en-Z5NdBdrqEeU_FUuRjVp8VQ==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-24 11:18 net.kairosoft.android.gamedev3en-vGsa2b-uyK18rahT7MbFNQ==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-24 11:16 net.kairosoft.android.mujindx-tp2VlX1aHA2ReHc_hlrZRA==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-24 11:17 net.kairosoft.android.piratedx-JZpfG9BR-kmCQlr0MiJ5Jg==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-22 15:25 ru.tctagmqj.desyegxem-9XO761PLEkwGJSknnCS2WA==
drwxrwxr-x  4 system system u:object_r:apk_data_file:s0    3488 2024-03-23 21:38 xyz.chenzyadb.cu_toolbox-HiEm6hQjP9aVAlqB6jvA4w==

Coconutat avatar Mar 25 '24 14:03 Coconutat

please send logs under /data/adb/ksu/log

If manager can't work, the bugreport is 0kb

tiann avatar Mar 25 '24 14:03 tiann

please send logs under /data/adb/ksu/log

If manager can't work, the bugreport is 0kb

This is old version log (0.9.2). log.zip

Up to 11708 veriosn I will send you tomorrow.

Coconutat avatar Mar 25 '24 14:03 Coconutat

I'm also having the same problem, the workaround is to downgrade the kernelsu manager, it shows that it doesn't work, but it shows that there is root authorization, so it's a manager error ResizedImage_2024-03-25_23-56-51_1186.png

YumeYuka avatar Mar 25 '24 15:03 YumeYuka

I'm also having the same problem, the workaround is to downgrade the kernelsu manager, it shows that it doesn't work, but it shows that there is root authorization, so it's a manager error ResizedImage_2024-03-25_23-56-51_1186.png

OK,I will try it.

Coconutat avatar Mar 26 '24 03:03 Coconutat

please send logs under /data/adb/ksu/log

If manager can't work, the bugreport is 0kb 11708 logs: KernelSU_bugreport_2024-03-26_11_28.tar.gz logs-11708.zip


I downgrade the manager to 0.9.0.It's worked.

Coconutat avatar Mar 26 '24 03:03 Coconutat

please send logs under /data/adb/ksu/log

If manager can't work, the bugreport is 0kb

Manager version 11709,kenrelsu version 11709. still not have ksu. Here is logs: logs-11709.zip I install Magisk for pull logs and install Kernel.EMUI 10 not allow flash non official img via fastboot and not allow disable vbmeta.

Coconutat avatar Mar 26 '24 04:03 Coconutat

The manager not working doesn't mean that the su is not working, maybe you can use su directy in adb shell

tiann avatar Mar 26 '24 04:03 tiann

The manager not working doesn't mean that the su is not working, maybe you can use su directy in adb shell

No,I can’t.When I reboot the KSU Manager will lose all saved SU authorizations.Right Now I don’t know why.I think is huawei Overlay_FS had been modify.

Coconutat avatar Mar 26 '24 04:03 Coconutat

The manager not working doesn't mean that the su is not working, maybe you can use su directy in adb shell

I noticed something strange .allowlist cannot save authorized apps. I tried to change its permissions to 777, and there was no problem. (I know it's not safe, but I tried it and it's feasible.)But after Reboot is still empty.

Coconutat avatar Mar 26 '24 04:03 Coconutat

https://github.com/tiann/KernelSU/issues/943#issuecomment-1715816409

tiann avatar Mar 26 '24 05:03 tiann

#943 (comment)

Thanks.I fixed it.Now I upload the only ksu's logs. logs_11709_KSU.zip And I don't know why.Manager still don't have KSU,But now the su is still have.The kernel seems to be unable to properly decrypt data encryption. After booting up, it shows that the data partition is decrypted after unlocking, but even if it is unlocked, it is not decrypted. And it will cause a later restart.

Coconutat avatar Mar 26 '24 07:03 Coconutat

Similar issue on 4.9, 11682 Manager is not working on KSU 11708 (prior to 11708 it worked) Manager 0.9.1 and newer fails, 0.9 works

Both however KSU root still works, based on what is in allowlist, su is being granted, however the manager displays "Unsupported"

If you install 0.9.0 > update to 0.9.2 > KSU will work just fine > the next time you reboot the manager will display error

ksu_4.9_unsupported.zip

Calls : https://github.com/ananjaser1211/Apollo/commit/007d52685a86f3516ba2c6a21315a529d5dbcf36 Script : https://github.com/ananjaser1211/Apollo/commit/8cef4d0170a7990b037d064d42f1c83608b3b98e

Kprobes is disabled, path_umount not backported/tested yet

ananjaser1211 avatar Mar 26 '24 08:03 ananjaser1211

I have a 4.14 device, it works well. I think this issue only exists on 4.9

tiann avatar Mar 26 '24 09:03 tiann

You can add some logs here and here to see what happened.

tiann avatar Mar 26 '24 09:03 tiann

I have a 4.14 device, it works well. I think this issue only exists on 4.9

Maybe,But My device use kernel is 4.14.116.Maybe Huawei not upstream with Google.

Coconutat avatar Mar 26 '24 09:03 Coconutat

Similar issue on 4.9, 11682 Manager is not working on KSU 11708 (prior to 11708 it worked) Manager 0.9.1 and newer fails, 0.9 works

Both however KSU root still works, based on what is in allowlist, su is being granted, however the manager displays "Unsupported"

If you install 0.9.0 > update to 0.9.2 > KSU will work just fine > the next time you reboot the manager will display error

ksu_4.9_unsupported.zip

Calls : ananjaser1211/Apollo@007d526 Script : ananjaser1211/Apollo@8cef4d0

Kprobes is disabled, path_umount not backported/tested yet

same problem here (with 4.9 backport) ananjaser1211 https://github.com/tiann/KernelSU/issues/1528#issuecomment-2018509700

oh btw, do you have root detected problem? https://github.com/tiann/KernelSU/issues/1528

xxjoe2 avatar Mar 26 '24 12:03 xxjoe2

You can add some logs here and here to see what happened.

Okay,I add some log info like this:

FILLDIR_RETURN_TYPE my_actor(struct dir_context *ctx, const char *name,
			     int namelen, loff_t off, u64 ino,
			     unsigned int d_type)
{
	struct my_dir_context *my_ctx =
		container_of(ctx, struct my_dir_context, ctx);
	struct file *file;
	char *dirpath;

	if (!my_ctx) {
		pr_err("Invalid context\n");
		return FILLDIR_ACTOR_STOP;
	}
	pr_info("my_actor: Processing directory entry: %.*s\n", namelen, name); // Adding log here
	if (my_ctx->stop && *my_ctx->stop) {
		pr_info("my_actor: Actor is stopped, stopping traversal\n");
		return FILLDIR_ACTOR_STOP;
	}

	if (!strncmp(name, "..", namelen) || !strncmp(name, ".", namelen)) {
		pr_info("my_actor: Skipping directory entry: %.*s\n", namelen, name); // Adding log here
		return FILLDIR_ACTOR_CONTINUE; // Skip "." and ".."
	}

	dirpath = kmalloc(PATH_MAX, GFP_KERNEL);
	if (!dirpath) {
		pr_err("Failed to allocate memory for directory path\n");
		return FILLDIR_ACTOR_STOP; // Failed to obtain directory path
	}
	snprintf(dirpath, PATH_MAX, "%s/%.*s", my_ctx->parent_dir, namelen,
		 name);

	if (d_type == DT_DIR && my_ctx->depth > 0 &&
	    (my_ctx->stop && !*my_ctx->stop)) {
		pr_info("my_actor: Entering directory: %s\n", dirpath); // Adding log here
		struct my_dir_context sub_ctx = { .ctx.actor = my_actor,
						  .parent_dir = dirpath,
						  .private_data =
							  my_ctx->private_data,
						  .depth = my_ctx->depth - 1,
						  .stop = my_ctx->stop };
		file = ksu_filp_open_compat(dirpath, O_RDONLY, 0);
		if (IS_ERR(file)) {
			pr_err("Failed to open directory: %s, err: %ld\n",
			       dirpath, PTR_ERR(file));
			kfree(dirpath);
			return FILLDIR_ACTOR_STOP;
		}

		iterate_dir(file, &sub_ctx.ctx);
		filp_close(file, NULL);
	} else {
		if ((strlen(name) == strlen("base.apk")) &&
		    (strncmp(name, "base.apk", strlen("base.apk")) == 0)) {
			bool is_manager = is_manager_apk(dirpath);
			pr_info("Found base.apk at path: %s, is_manager: %d\n",
				dirpath, is_manager);
			if (is_manager) {
				pr_info("Crowning manager for directory: %s\n", dirpath);
				crown_manager(dirpath, my_ctx->private_data);
				*my_ctx->stop = 1;
			}
		}
		kfree(dirpath);
	}

Then,here is log: log_11709_tracker.zip

Coconutat avatar Mar 27 '24 04:03 Coconutat

Maybe you should try the latest source, it fixed something

tiann avatar Mar 27 '24 04:03 tiann

Maybe you should try the latest source, it fixed something

sure,I will try it.

Coconutat avatar Mar 27 '24 05:03 Coconutat

Maybe you should try the latest source, it fixed something

Some unexpected questions. Unable to enter the system and enter Huawei emergency system mode after restarting several times. Cannot connect via adb mode. So I can't extract the log. I tried KernelSU's safe mode, but it didn't work. Apparently it's a kernel issue.

Coconutat avatar Mar 27 '24 05:03 Coconutat

try this one: https://github.com/tiann/KernelSU/commit/5f7d4b609ffd7b94968e51e5c46e0ec1df4fa91d

tiann avatar Mar 27 '24 05:03 tiann

try this one: 5f7d4b6

The su permissions have disappeared. Logs cannot be obtained. I had fixed su save authorized apps error.

Coconutat avatar Mar 27 '24 06:03 Coconutat

try this one: 5f7d4b6 logs_14_30.zip These logs were obtained after I refreshed Magisk and restored the default kernel. It is the log of the last KSU kernel. Compiled with the latest KSU source code. Hope it's useful.

Coconutat avatar Mar 27 '24 06:03 Coconutat