Files
SukiSU-Ultra/kernel
backslashxx a3a847a885 kernel: core_hook: screw path_umount backport, call sys_umount directly
I am repasting here what I posted on the source code originally:

/*
 * turns out path_umount backport is completely unneeded
 * we copy the trick used on strncpy_from_unsafe_user / strncpy_from_user_nofault
 * https://elixir.bootlin.com/linux/v4.4.302/source/mm/maccess.c#L184
 * basically
 *
 *     mm_segment_t old_fs = get_fs();     // remember original fs segment
 *     set_fs(USER_DS);                    // or KERNEL_DS *
 *     do_whatever_in_userspace();
 *     set_fs(old_fs);                     // restore fs segment
 *
 *  * kernel -> user, KERNEL_DS, user -> kernel, USER_DS
 *
 * so yes, we can try to straight up call a syscall from kernel space
 *
 * NOTE: on newer kernels you can use force_uaccess_begin + force_uaccess_end
 * ref: https://elixir.bootlin.com/linux/v5.10.237/source/mm/maccess.c#L250
 *
 */

path_umount backport now optional — neat trick, werks, what can I say.

Backports? Nah, we’re good.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
2025-05-24 14:27:00 +08:00
..
2024-04-27 09:55:24 +08:00
2023-04-13 10:41:49 +08:00
2023-06-16 19:53:15 +08:00
2024-04-27 09:55:24 +08:00
2024-04-27 09:55:24 +08:00
2024-04-27 09:55:24 +08:00
2023-06-16 19:53:15 +08:00
2025-05-17 18:45:01 +08:00
2023-06-16 19:53:15 +08:00
2025-02-16 19:29:58 +08:00
2023-02-02 09:04:07 +08:00
2025-05-12 19:29:25 +08:00
2024-04-27 09:55:24 +08:00