From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751836AbcEKQ5R (ORCPT ); Wed, 11 May 2016 12:57:17 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:51768 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751528AbcEKQ5P (ORCPT ); Wed, 11 May 2016 12:57:15 -0400 From: Colin King To: Catalin Marinas , Will Deacon , AKASHI Takahiro , Lorenzo Pieralisi , Andrew Morton , Janet Liu , Jiri Slaby , Jisheng Zhang , James Morse , Mark Rutland , linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH] arm64: do not enforce strict 16 byte alignment to stack pointer Date: Wed, 11 May 2016 17:56:54 +0100 Message-Id: <1462985814-16146-1-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 2.8.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King 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 --- 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