Browse Source

fix(susfs-patches): strip NULL 4th arg from set_nameidata calls on 5.10 kernels

The SUSFS patch for 5.10 (android12-5.10, android13-5.10) adds calls like
set_nameidata(nd, old_dfd, fake_filename, NULL), but these kernels only
have the 3-parameter signature (struct nameidata *p, int dfd, struct filename *name).
The 4th root parameter was added in 5.15.

Post-patch fix strips the trailing NULL argument so it matches the 5.10 API.
TheWildJames 1 tháng trước cách đây
mục cha
commit
56014a86d0
1 tập tin đã thay đổi với 10 bổ sung0 xóa
  1. 10 0
      .github/actions/susfs-patches/action.yml

+ 10 - 0
.github/actions/susfs-patches/action.yml

@@ -162,3 +162,13 @@ runs:
           sed -i '/#include <linux\/pkeys.h>/a #include <linux/page_size_compat.h>' fs/proc/task_mmu.c
           echo "Added page_size_compat.h include to fs/proc/task_mmu.c"
         fi
+
+        # Fix set_nameidata() calls for 5.10 kernels.
+        # The SUSFS patch adds set_nameidata(nd, old_dfd, fake_filename, NULL) with 4 args,
+        # but 5.10 kernels only have 3-param set_nameidata(p, dfd, name) — no root param.
+        if [[ "${{ inputs.version }}" == "android12-5.10" || "${{ inputs.version }}" == "android13-5.10" ]]; then
+          if grep -q 'set_nameidata(nd, old_dfd, fake_filename, NULL)' fs/namei.c; then
+            echo "Fixing set_nameidata calls for 5.10 (4-arg -> 3-arg)"
+            sed -i 's/set_nameidata(nd, old_dfd, fake_filename, NULL)/set_nameidata(nd, old_dfd, fake_filename)/g' fs/namei.c
+          fi
+        fi