Skip to content

kernel: Synchronize with upstream (https://github.com/tiann/KernelSU/commits/main/)#1171

Merged
rifsxd merged 7 commits into
KernelSU-Next:devfrom
pershoot:dev1
Mar 15, 2026
Merged

kernel: Synchronize with upstream (https://github.com/tiann/KernelSU/commits/main/)#1171
rifsxd merged 7 commits into
KernelSU-Next:devfrom
pershoot:dev1

Conversation

@pershoot

Copy link
Copy Markdown
Collaborator

feat: add late-load mode support (tiann/KernelSU#3258)

Author: weishu <twsxtd@gmail.com>
Date:   Wed Mar 11 13:06:32 2026 +0800

Co-authored-by: Ylarod <me@ylarod.cn>
Co-authored-by: Wang Han <416810799@qq.com>

kernel: enforcing selinux at late-load mode

Author: Ylarod <me@ylarod.cn>
Date:   Wed Mar 11 18:42:01 2026 +0800

kernel: sepolicy: use GFP_KERNEL (tiann/KernelSU#3271)

Author: 5ec1cff <56485584+5ec1cff@users.noreply.github.com>
Date:   Thu Mar 12 13:43:20 2026 +0800

Now that all sepolicy functions are called from a normal context, we can stop using GFP_ATOMIC.

kernel: upgrade ddk, use ddk-min (tiann/KernelSU#3280)

Author: 5ec1cff <56485584+5ec1cff@users.noreply.github.com>
Date:   Fri Mar 13 13:01:36 2026 +0800
  • Validate __versions section in check_symbol to ensure lkm can be force loaded on some kernel.

kernel: Fix RLIMIT_NPROC leak on root escape (tiann/KernelSU#3286)

Author: 5ec1cff <56485584+5ec1cff@users.noreply.github.com>
Date:   Sat Mar 14 19:45:08 2026 +0800

After escape_to_root, cred->uid changes, but cred->user and cred->ucounts remain unchanged. Because cred->user does not change, commit_creds() does not decrement the ucounts associated with the original UID.

When execve is executed afterwards, cred->user still does not change, but cred->ucounts changes. This happens because cred->uid is now different from cred->ucounts->uid. However, since cred->user is still unchanged, commit_creds() still does not decrement the original ucounts. After this point, it can never be decremented anymore, because exit will only decrease the ucounts of the new UID.

Since the original UID’s ucounts increases every time su is executed, it will eventually exceed the limit until it reaches the rlimit threshold.

This fixes tiann/KernelSU#3214.

Update KSU config to require EXT4_FS (tiann/KernelSU#3266)

Author: Shadichy <60534636+shadichy@users.noreply.github.com>
Date:   Sun Mar 15 06:53:57 2026 +0700

Signed-off-by: shadichy <shadichy@blisslabs.org>

Add dependency on EXT4_FS for KernelSU support for ext4_unregister_sysfs.

ksud: refine boot-patch (tiann/KernelSU#3281)

Author: 5ec1cff <56485584+5ec1cff@users.noreply.github.com>
Date:   Sun Mar 15 11:45:04 2026 +0800
  • Save output image when source is partition and --flash is not specified
  • Add --out for boot-restore, write output file if both --flash and --out/--out-name is specified

tiann and others added 7 commits March 15, 2026 03:09
Co-authored-by: Ylarod <me@ylarod.cn>
Co-authored-by: Wang Han <416810799@qq.com>
Now that all sepolicy functions are called from a normal context, we can
stop using GFP_ATOMIC.
- Validate `__versions` section in check_symbol to ensure lkm can be
force loaded on some kernel.
After `escape_to_root`, `cred->uid` changes, but `cred->user` and
`cred->ucounts` remain unchanged. Because `cred->user` does not change,
`commit_creds()` does not decrement the `ucounts` associated with the
original UID.

When `execve` is executed afterwards, `cred->user` still does not
change, but `cred->ucounts` changes. This happens because `cred->uid` is
now different from `cred->ucounts->uid`. However, since `cred->user` is
still unchanged, `commit_creds()` still does not decrement the original
`ucounts`. After this point, it can never be decremented anymore,
because `exit` will only decrease the `ucounts` of the new UID.

Since the original UID’s `ucounts` increases every time `su` is
executed, it will eventually exceed the limit until it reaches the
`rlimit` threshold.

This fixes tiann/KernelSU#3214.
Add dependency on EXT4_FS for KernelSU support for
`ext4_unregister_sysfs`.

Signed-off-by: shadichy <shadichy@blisslabs.org>
- Save output image when source is partition and `--flash` is not
specified
- Add `--out` for boot-restore, write output file if both `--flash` and
`--out/--out-name` is specified
@pershoot

Copy link
Copy Markdown
Collaborator Author

Note: This excludes Magica. However, late load is in place for that work.

@rifsxd rifsxd merged commit 2c901a9 into KernelSU-Next:dev Mar 15, 2026
18 of 19 checks passed
@pershoot pershoot deleted the dev1 branch March 15, 2026 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NPROC count is not properly de-refcounted after exec

6 participants