From patchwork Fri Sep 29 16:37:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zorro Lang X-Patchwork-Id: 9978395 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BE61B60311 for ; Fri, 29 Sep 2017 16:37:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B176129842 for ; Fri, 29 Sep 2017 16:37:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A662729882; Fri, 29 Sep 2017 16:37:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 351F629842 for ; Fri, 29 Sep 2017 16:37:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752093AbdI2Qhe (ORCPT ); Fri, 29 Sep 2017 12:37:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38784 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751899AbdI2Qhe (ORCPT ); Fri, 29 Sep 2017 12:37:34 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 70893C04AC52 for ; Fri, 29 Sep 2017 16:37:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 70893C04AC52 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=zlang@redhat.com Received: from localhost.localdomain.com (ovpn-12-44.pek2.redhat.com [10.72.12.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8CF2118621 for ; Fri, 29 Sep 2017 16:37:33 +0000 (UTC) From: Zorro Lang To: fstests@vger.kernel.org Subject: [PATCH v2] src/nsexec: fix stack pointer alignment exception Date: Sat, 30 Sep 2017 00:37:28 +0800 Message-Id: <20170929163728.17859-1-zlang@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 29 Sep 2017 16:37:34 +0000 (UTC) Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When test g/317 or g/318 on ARM server, we got a kernel exception: kernel: nsexec[8203]: SP Alignment exception: pc=00000000004010a0 sp=00000000005200e8 nsexec gives an unaligned child stack address to clone() system call sometimes. For making sure it's always aligned, use "__attribute__((aligned))" extension of GCC (Thanks this suggestion from Eric sandeen). Signed-off-by: Zorro Lang --- V2 move the "__attribute__((aligned))" after array name, for following common "__attribute__" usage. Thanks, Zorro src/nsexec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nsexec.c b/src/nsexec.c index f033b1a4..205dd081 100644 --- a/src/nsexec.c +++ b/src/nsexec.c @@ -138,7 +138,8 @@ childFunc(void *arg) #define STACK_SIZE (1024 * 1024) -static char child_stack[STACK_SIZE]; /* Space for child's stack */ +/* Space for child's stack */ +static char __attribute__((aligned)) child_stack[STACK_SIZE]; int main(int argc, char *argv[])