Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2981544imu; Mon, 19 Nov 2018 08:57:21 -0800 (PST) X-Google-Smtp-Source: AJdET5ezezzypR36dsiiQ8olU/PjdLNpOj1pSPgO2C+jrOt95Q8hhGlD69xlnundkEFIiOhSdOYp X-Received: by 2002:a17:902:9004:: with SMTP id a4-v6mr22860344plp.334.1542646641142; Mon, 19 Nov 2018 08:57:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542646641; cv=none; d=google.com; s=arc-20160816; b=ASgkaab+51Pcu6JhR7pnygCM9LmaAnilaHi9UY5EPSwgFMwVL7l59HpkAlrogkqSPf THgxGjmWmd7qOSmB5k+TvoVderaP5IzRQO2ilLPst/jxbb6uTm+PC4mzaSXzIWZEYtFV JG1IxibwerktjQiKE3Vb1cLJkIoCjKDwVbH3kpZFkG5iu/xbjcJzMMSLMcrlBGzWzPGd kBrZtIxCRu6dRlF9sAjftSFTnPl9KV4mNhYfv4+GUdjeLZeAfJcMHiQjx+W4P+Jn+JN8 XZHA2UE7oi0yMLBg8cthdBvoP8df24elJcdiRELpemExlzkODdX1WeVMRAQoFTzHNv9l +6bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=D6zfpIvMjxe52NM/GT3Ae3rFW3MI2TpY8WdWqvtrX8Y=; b=oCm+EWpZWKpln1OlUR3wVLoGQ7uYvScAp0th9pKF11+pR36iKvz7s3SuQDPezTOcKB vNvKNn4vEMDXxUZjkENRvJeopBq9YM073HHamoYMBPmllSIaWAy3GkfFixFEwRETP45J Evy5Q6hEf6BTOS0YmnPLMz5zIf/062zo7jJ6ZC66Zzk6R9SU4icpYNmlJco/JID3FuY6 RRhEb24uXj+p52leDU5ofbelJW6mW8cXSahS/+0q/oQh2UgNBvApVtp3KdJz93rxPBB+ c3QMtqg0O7GUJol183jhRCzTEsa0lxcNCGXwheLa7bGd446wUlEbsRVjB8TtnRWP/7ML nmCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QzMniWC8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w1-v6si44596530plk.317.2018.11.19.08.57.06; Mon, 19 Nov 2018 08:57:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QzMniWC8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404074AbeKTDT1 (ORCPT + 99 others); Mon, 19 Nov 2018 22:19:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:58576 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404054AbeKTDTZ (ORCPT ); Mon, 19 Nov 2018 22:19:25 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 027BF2145D; Mon, 19 Nov 2018 16:55:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542646511; bh=+TpIQx88guG7x9NcYYLbe+LVW/OMDjcocbgQGvmHY4s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QzMniWC8+XZnNl0NsVNBJIA16eOyv4+kuCEqkeTT8LA02ZSay9kr+Avxc1QHie4cF 3dJJRItVFe5Lh2xWVUeYgcYPvCZO1HvrIVzg7LkVcP+EJjXAjBlgeHZhFeDJi8PgfL a4JjrnxtZx6SpE0MzzGYATxclaTIjz23Rm3NYD4s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Max Filippov Subject: [PATCH 4.9 32/83] xtensa: make sure bFLT stack is 16 byte aligned Date: Mon, 19 Nov 2018 17:28:58 +0100 Message-Id: <20181119162618.850232392@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181119162612.046511542@linuxfoundation.org> References: <20181119162612.046511542@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Max Filippov commit 0773495b1f5f1c5e23551843f87b5ff37e7af8f7 upstream. Xtensa ABI requires stack alignment to be at least 16. In noMMU configuration ARCH_SLAB_MINALIGN is used to align stack. Make it at least 16. This fixes the following runtime error in noMMU configuration, caused by interaction between insufficiently aligned stack and alloca function, that results in corruption of on-stack variable in the libc function glob: Caught unhandled exception in 'sh' (pid = 47, pc = 0x02d05d65) - should not happen EXCCAUSE is 15 Cc: stable@vger.kernel.org Signed-off-by: Max Filippov Signed-off-by: Greg Kroah-Hartman --- arch/xtensa/include/asm/processor.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/arch/xtensa/include/asm/processor.h +++ b/arch/xtensa/include/asm/processor.h @@ -24,7 +24,11 @@ # error Linux requires the Xtensa Windowed Registers Option. #endif -#define ARCH_SLAB_MINALIGN XCHAL_DATA_WIDTH +/* Xtensa ABI requires stack alignment to be at least 16 */ + +#define STACK_ALIGN (XCHAL_DATA_WIDTH > 16 ? XCHAL_DATA_WIDTH : 16) + +#define ARCH_SLAB_MINALIGN STACK_ALIGN /* * User space process size: 1 GB.