Skip to content

Aarch64 spinlock null dereference#68

Merged
FlareCoding merged 1 commit intopr/rtc-time-supportfrom
cursor/aarch64-spinlock-null-dereference-034e
Mar 4, 2026
Merged

Aarch64 spinlock null dereference#68
FlareCoding merged 1 commit intopr/rtc-time-supportfrom
cursor/aarch64-spinlock-null-dereference-034e

Conversation

@FlareCoding
Copy link
Owner

Fix AArch64 kernel panic during sys_proc_wait by correcting EL1 stack handling during context switches.

The AArch64 trap/scheduler stack handoff was incomplete, leading to kernel stack corruption when a task yielded while in-kernel (e.g., during sync::wait). This resulted in a null pointer dereference when the task resumed and attempted to reacquire a spinlock, as the lock's address was corrupted. The fix ensures the EL1 stack pointer (sp_el1) is properly saved and restored across context switches for all exception levels, preventing stack frame corruption.


Open in Web Open in Cursor 

Co-authored-by: Albert Slepak <FlareCoding@users.noreply.github.com>
@cursor
Copy link

cursor bot commented Mar 4, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@FlareCoding FlareCoding marked this pull request as ready for review March 4, 2026 23:22
@FlareCoding FlareCoding merged commit b1c748d into pr/rtc-time-support Mar 4, 2026
15 checks passed
@FlareCoding FlareCoding deleted the cursor/aarch64-spinlock-null-dereference-034e branch March 4, 2026 23:30
FlareCoding added a commit that referenced this pull request Mar 4, 2026
)

* feat(kernel): added improved time management as well as RTC support

* Fix AArch64 trap stack handoff across task switches (#68)

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Albert Slepak <FlareCoding@users.noreply.github.com>

* bugbot fixes

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Albert Slepak <FlareCoding@users.noreply.github.com>
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