Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1399360
| From | Colin King <colin.king@canonical.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] arm64: do not enforce strict 16 byte alignment to stack pointer |
| Date | 2016-05-11 19:00 +0200 |
| Message-ID | <rxFEl-3D1-5@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
From: Colin Ian King <colin.king@canonical.com>
copy_thread should not be enforcing 16 byte aligment and returning
-EINVAL. Other architectures trap misaligned stack access with SIGBUS
so arm64 should follow this convention, so remove the strict enforcement
check.
For example, currently clone(2) fails with -EINVAL when passing
a misaligned stack and this gives little clue to what is wrong. Instead,
it is arguable that a SIGBUS on the fist access to a misaligned stack
allows one to figure out that it is a misaligned stack issue rather
than trying to figure out why an unconventional (and undocumented)
-EINVAL is being returned.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
arch/arm64/kernel/process.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
index 5655f756..8414971 100644
--- a/arch/arm64/kernel/process.c
+++ b/arch/arm64/kernel/process.c
@@ -258,9 +258,6 @@ int copy_thread(unsigned long clone_flags, unsigned long stack_start,
if (stack_start) {
if (is_compat_thread(task_thread_info(p)))
childregs->compat_sp = stack_start;
- /* 16-byte aligned stack mandatory on AArch64 */
- else if (stack_start & 15)
- return -EINVAL;
else
childregs->sp = stack_start;
}
--
2.8.1
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] arm64: do not enforce strict 16 byte alignment to stack pointer Colin King <colin.king@canonical.com> - 2016-05-11 19:00 +0200
Re: [PATCH] arm64: do not enforce strict 16 byte alignment to stack pointer Catalin Marinas <catalin.marinas@arm.com> - 2016-05-12 11:30 +0200
Re: [PATCH] arm64: do not enforce strict 16 byte alignment to stack pointer Will Deacon <will.deacon@arm.com> - 2016-05-12 12:20 +0200
csiph-web