From patchwork Fri Sep 29 16:49:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zorro Lang X-Patchwork-Id: 9978459 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 F0B4860329 for ; Fri, 29 Sep 2017 16:49:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D71D429883 for ; Fri, 29 Sep 2017 16:49:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C96732988B; Fri, 29 Sep 2017 16:49:31 +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 74F3929883 for ; Fri, 29 Sep 2017 16:49:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752113AbdI2Qta (ORCPT ); Fri, 29 Sep 2017 12:49:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37982 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752108AbdI2Qta (ORCPT ); Fri, 29 Sep 2017 12:49:30 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7E67CC058EBD for ; Fri, 29 Sep 2017 16:49:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7E67CC058EBD Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.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 943276060C for ; Fri, 29 Sep 2017 16:49:29 +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:49:25 +0800 Message-Id: <20170929164925.18562-1-zlang@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 29 Sep 2017 16:49:30 +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 --- Sorry I made a wrong V2, this's the right one. 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..c2d172fe 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 child_stack[STACK_SIZE] __attribute__((aligned)); int main(int argc, char *argv[])