Răsfoiți Sursa

fix(action): add Android 13 5.10 SUSFS fixes for sublevel checks and mask handling

Co-authored-by: Copilot <copilot@github.com>
TheWildJames 4 luni în urmă
părinte
comite
e773b3bd54
1 a modificat fișierele cu 13 adăugiri și 1 ștergeri
  1. 13 1
      .github/actions/susfs/action.yml

+ 13 - 1
.github/actions/susfs/action.yml

@@ -106,6 +106,13 @@ runs:
             perl -i -pe 's/\bmask,\s*mark->ignored_mask\)/inotify_mark_user_mask(mark)/g' fs/notify/fdinfo.c
           fi
         fi
+        if [ "${{ inputs.kernel_version }}" = "5.10" ] && [ "${{ inputs.android_version }}" = "android13" ]; then
+          echo "Applying Android 13 5.10 SUSFS fixes"
+          if [ "${{ inputs.sublevel }}" -le "117" ]; then
+            sed -i '/^\s*\/\*/,/^\s*u32 mask = mark->mask & IN_ALL_EVENTS;$/d' fs/notify/fdinfo.c
+            perl -i -pe 's/\bmask,\s*mark->ignored_mask\)/inotify_mark_user_mask(mark)/g' fs/notify/fdinfo.c
+          fi
+        fi
         if [ "${{ inputs.kernel_version }}" = "5.15" ] && [ "${{ inputs.android_version }}" = "android13" ]; then
           echo "Applying Android 13 5.15 SUSFS fixes"
           if grep -q '^size_t this_len = min_t(size_t, count, PAGE_SIZE);$' fs/proc/base.c; then
@@ -166,7 +173,12 @@ runs:
             perl -i -pe 's/\binotify_mark_user_mask\(mark\)/mask, mark->ignored_mask)/g' fs/notify/fdinfo.c
           fi
         fi
-        
+        if [ "${{ inputs.kernel_version }}" = "5.10" ] && [ "${{ inputs.android_version }}" = "android13" ]; then
+          if [ "${{ inputs.sublevel }}" -le "117" ]; then
+            perl -i -pe 's/^(\s*if \(inode\) \{)/$1\n        \/\*\n         * IN_ALL_EVENTS represents all of the mask bits\n         * that we expose to userspace.  There is at\n         * least one bit (FS_EVENT_ON_CHILD) which is\n         * used only internally to the kernel.\n         *\/\n        u32 mask = mark->mask & IN_ALL_EVENTS;/m' fs/notify/fdinfo.c
+            perl -i -pe 's/\binotify_mark_user_mask\(mark\)/mask, mark->ignored_mask)/g' fs/notify/fdinfo.c
+          fi
+        fi
         if [ "${{ inputs.kernel_version }}" = "5.15" ] && [ "${{ inputs.android_version }}" = "android13" ]; then
           sed -i '/#include <linux\/mnt_idmapping.h>$/d' fs/namespace.c
           sed -i '/#include <linux\/mnt_idmapping.h>$/d' fs/open.c