Skip to content

kernel: Allocate fake struct on heap#3081

Merged
aviraxp merged 3 commits into
mainfrom
aviraxp-patch-2
Dec 20, 2025
Merged

kernel: Allocate fake struct on heap#3081
aviraxp merged 3 commits into
mainfrom
aviraxp-patch-2

Conversation

@aviraxp

@aviraxp aviraxp commented Dec 20, 2025

Copy link
Copy Markdown
Collaborator

task_struct is 4736 bytes long.

task_struct is 4736 bytes long.
Copilot AI review requested due to automatic review settings December 20, 2025 09:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses a stack allocation issue by moving a large task_struct (4736 bytes) from stack to heap allocation in the disable_seccomp() function. This is a good practice to avoid potential stack overflow issues with such large structures.

  • Replaced stack allocation of task_struct fake with heap allocation using kmalloc
  • Added error handling for allocation failure with early return
  • Updated all references from struct member access (.) to pointer member access (->)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread kernel/app_profile.c
Comment thread kernel/app_profile.c Outdated
Comment thread kernel/app_profile.c
@aviraxp aviraxp merged commit 3d73f89 into main Dec 20, 2025
17 checks passed
@aviraxp aviraxp deleted the aviraxp-patch-2 branch December 20, 2025 11:29
larpedd pushed a commit to larpedd/KernelSU that referenced this pull request Dec 20, 2025
task_struct is typically 4000+ bytes long.
KOWX712 pushed a commit to KOWX712/KernelSU that referenced this pull request Dec 21, 2025
task_struct is typically 4000+ bytes long.
u9521 pushed a commit to u9521/KernelSU that referenced this pull request Jan 5, 2026
task_struct is typically 4000+ bytes long.
u9521 pushed a commit to u9521/KernelSU that referenced this pull request Jan 5, 2026
task_struct is typically 4000+ bytes long.
u9521 pushed a commit to u9521/KernelSU that referenced this pull request Jan 8, 2026
task_struct is typically 4000+ bytes long.
u9521 pushed a commit to u9521/KernelSU that referenced this pull request Jan 13, 2026
task_struct is typically 4000+ bytes long.
LeCmnGend pushed a commit to LeCmnGend/KernelSU that referenced this pull request Feb 23, 2026
task_struct is typically 4000+ bytes long.
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.

2 participants