Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/build-ksu-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,27 @@ jobs:
echo "No 70_ patch needed"
fi

WILDFIX="$GITHUB_WORKSPACE/$VERSION_DIR/KernelSU-Next/patches/wildkernels"
if [ -d "$WILDFIX" ]; then
echo "Applying WildKernels SUSFS fix patches..."
for P in \
fix_Makefile.patch \
fix_ksu_c.patch \
fix_ksud_c.patch \
fix_supercalls_c.patch \
fix_sucompat_c.patch \
fix_kernel_umount_c.patch \
fix_rules_c.patch; do
Comment on lines +230 to +237

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Use the actual WildKernels patch filenames here.

Lines 232-237 look for fix_ksu_c.patch, fix_ksud_c.patch, fix_supercalls_c.patch, etc., but this PR adds fix_ksu.c.patch, fix_ksud.c.patch, fix_supercalls.c.patch, fix_sucompat.c.patch, fix_kernel_umount.c.patch, and fix_rules.c.patch. As written, only fix_Makefile.patch will match; the rest are silently skipped, so CI never applies most of the SUSFS fixes.

Proposed fix
         for P in \
           fix_Makefile.patch \
-          fix_ksu_c.patch \
-          fix_ksud_c.patch \
-          fix_supercalls_c.patch \
-          fix_sucompat_c.patch \
-          fix_kernel_umount_c.patch \
-          fix_rules_c.patch; do
+          fix_ksu.c.patch \
+          fix_ksud.c.patch \
+          fix_supercalls.c.patch \
+          fix_sucompat.c.patch \
+          fix_kernel_umount.c.patch \
+          fix_rules.c.patch; do
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
for P in \
fix_Makefile.patch \
fix_ksu_c.patch \
fix_ksud_c.patch \
fix_supercalls_c.patch \
fix_sucompat_c.patch \
fix_kernel_umount_c.patch \
fix_rules_c.patch; do
for P in \
fix_Makefile.patch \
fix_ksu.c.patch \
fix_ksud.c.patch \
fix_supercalls.c.patch \
fix_sucompat.c.patch \
fix_kernel_umount.c.patch \
fix_rules.c.patch; do
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/build-ksu-next.yml around lines 230 - 237, The
patch-application loop in the workflow is using outdated WildKernels filenames,
so most SUSFS fixes are skipped. Update the filename list in the build step that
iterates over P to match the actual added patch files (the ones with .c.patch in
their names) so the apply logic can find and process every patch, not just
fix_Makefile.patch.

if [ -f "$WILDFIX/$P" ]; then
echo " → $P"
patch -p1 --no-backup-if-mismatch < "$WILDFIX/$P" || \
echo "::warning::WildKernels patch $P had issues"
fi
done
else
echo "No WildKernels patches directory found — skipping"
fi

- name: Apply ZeroMount Patch
if: inputs.add_zeromount && inputs.add_susfs
working-directory: ${{ env.KERNEL_ROOT }}/common
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,7 @@ new file mode 100644
+#include <linux/path.h>
+#include <linux/susfs_def.h>
+
+#define SUSFS_VERSION "v2.0.0"
+#define SUSFS_VERSION "v2.1.0"
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0)
+#define SUSFS_VARIANT "NON-GKI"
+#else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
diff '--color=auto' -ruN post-upstream/fs/Kconfig work-50/fs/Kconfig
--- post-upstream/fs/Kconfig 2026-03-07 16:32:21.906120792 +0100
+++ work-50/fs/Kconfig 2026-03-07 16:47:56.973232698 +0100
@@ -387,4 +387,34 @@
@@ -387,4 +387,58 @@
config IO_WQ
bool

Expand Down Expand Up @@ -34,6 +34,30 @@ diff '--color=auto' -ruN post-upstream/fs/Kconfig work-50/fs/Kconfig
+ help
+ Fixes upstream SUSFS concurrency and error-handling bugs.
+ Disable to match exact upstream behavior.
+
+config KSU_SUSFS_AUTO_ADD_SUS_KSU_DEFAULT_MOUNT
+ bool "Auto-add KSU default mounts to sus_mount"
+ depends on KSU_SUSFS_SUS_MOUNT
+ default y
+ help
+ Automatically adds KernelSU default bind mounts to the
+ sus_mount list so they are hidden without manual configuration.
+
+config KSU_SUSFS_AUTO_ADD_SUS_BIND_MOUNT
+ bool "Auto-add module bind mounts to sus_mount"
+ depends on KSU_SUSFS_SUS_MOUNT
+ default y
+ help
+ Automatically adds module bind mounts to the sus_mount list
+ so they are hidden without manual configuration.
+
+config KSU_SUSFS_UID_GATED_HIDING
+ bool "UID-gated hiding (v2.1.0+)"
+ depends on KSU_SUSFS
+ default y
+ help
+ Gates sus_path and sus_mount hiding behind a per-UID allowlist.
+ Requires susfs v2.1.0 or newer kernel patches.
Comment on lines +54 to +60

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

CONFIG_KSU_SUSFS_UID_GATED_HIDING is a dead switch right now.

This symbol is added here and enabled in android14-6.1/defconfig.fragment, but none of the provided hide predicates actually check it. In the same patch, susfs_is_inode_sus_path() and the proc/mount hide paths still run unconditionally once the process is marked umounted, so toggling this option will not change runtime behavior.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@android14-6.1/KernelSU-Next/patches/51_enhanced_susfs-android14-6.1.patch`
around lines 54 - 60, CONFIG_KSU_SUSFS_UID_GATED_HIDING is currently unused, so
make the hiding logic respect it. Update the relevant susfs hide predicates,
especially susfs_is_inode_sus_path() and the proc/mount hide paths, to check
this Kconfig symbol before applying UID-gated hiding behavior. If the option is
disabled, the existing sus_path/sus_mount hiding should be bypassed; if enabled,
preserve the current allowlist-based gating so the symbol actually changes
runtime behavior.

+
endmenu
diff '--color=auto' -ruN post-upstream/fs/namei.c work-50/fs/namei.c
Expand Down Expand Up @@ -1956,7 +1980,7 @@ diff '--color=auto' -ruN post-upstream/include/linux/susfs.h work-50/include/lin

+struct super_block;
+
#define SUSFS_VERSION "v2.0.0"
#define SUSFS_VERSION "v2.1.0"
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0)
#define SUSFS_VARIANT "NON-GKI"
@@ -54,7 +56,7 @@
Expand Down Expand Up @@ -2010,7 +2034,7 @@ diff '--color=auto' -ruN post-upstream/include/linux/susfs.h work-50/include/lin
#endif

/* spoof_uname */
@@ -217,6 +240,13 @@
@@ -242,7 +263,14 @@

void susfs_start_sdcard_monitor_fn(void);

Expand All @@ -2024,6 +2048,8 @@ diff '--color=auto' -ruN post-upstream/include/linux/susfs.h work-50/include/lin
/* susfs_init */
void susfs_init(void);

-#endif
+#endif // #ifndef KSU_SUSFS_H
diff '--color=auto' -ruN post-upstream/include/linux/susfs_def.h work-50/include/linux/susfs_def.h
--- post-upstream/include/linux/susfs_def.h 2026-03-07 16:32:28.738199507 +0100
+++ work-50/include/linux/susfs_def.h 2026-03-07 16:40:08.359700772 +0100
Expand Down
3 changes: 3 additions & 0 deletions android14-6.1/defconfig.fragment
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ CONFIG_KSU_SUSFS_HIDE_KSU_SUSFS_SYMBOLS=y
CONFIG_KSU_SUSFS_UNICODE_FILTER=y
CONFIG_KSU_SUSFS_AUTO_ADD_SUS_KSU_DEFAULT_MOUNT=y
CONFIG_KSU_SUSFS_AUTO_ADD_SUS_BIND_MOUNT=y
CONFIG_KSU_SUSFS_UID_GATED_HIDING=y
CONFIG_KSU_SUSFS_HIDDEN_NAME=y
CONFIG_KSU_SUSFS_HARDENED=y

# [zram]
CONFIG_ZSMALLOC=y
Expand Down