kexec_stack is misaligned
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- c, linux
- Domain
- operating-systems
Research direction
Start with the kexec_stack declaration in a/p/kexec/core_64.c and inspect how __init_task_data expands for powerpc, including the referenced commit. Rebuild the kernel and check .build/System.map; done means kexec_stack is 16384-byte aligned without breaking the kexec path.
Written by the indexing model from the issue text.
Description
There is code in a/p/kexec/core_64.c:
/*
* kexec thread structure and stack.
*
* We need to make sure that this is 16384-byte aligned due to the
* way process stacks are handled. It also must be statically allocated
* or allocated as part of the kimage, because everything else may be
* overwritten when we copy the kexec image. We piggyback on the
* "init_task" linker section here to statically allocate a stack.
*
* We could use a smaller stack if we don't care about anything using
* current, but that audit has not been performed.
*/
static union thread_union kexec_stack __init_task_data =
{ };
But since commit torvalds/linux@d11ed3ab3166a2bfad60681aebf3e13e1c3408a9 the __init_task_data macro has expanded to nothing on powerpc, because CONFIG_ARCH_TASK_STRUCT_ON_STACK is not set.
That means kexec_stack is not 16K aligned:
$ grep kexec_stack .build/System.map
c000000002a86800 b kexec_stack
In practice it probably doesn't matter, and no one has reported any breakage.
With modern kernels the only thing that's found by doing arithmetic on the stack pointer is pt_regs, via current_pt_regs(). That tends to only get used in ptrace and exec and so on, so is probably not called during the kexec sequence.
However it's still possible that bugs could be lurking due to the misaligned stack, so it should be properly aligned.
- Dominant language
- No language data
- Stars
- 14
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from linuxppc/issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
riscv/riscv-unified-db#2909 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
PixarAnimationStudios/OpenUSD#4383 ·
Maintainers usually reply within 1 day
-
nixos/rog-control-center: autoStart fails to build with asusctl 6.5.0 due to renamed .desktop fileOpen0.kind: bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
NixOS/nixpkgs#597200 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Cisco-Talos/clamav#1957 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 2 days