From patchwork Fri Mar 18 09:58:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 64050 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp955443lbc; Fri, 18 Mar 2016 03:06:26 -0700 (PDT) X-Received: by 10.67.4.69 with SMTP id cc5mr22330931pad.11.1458295586097; Fri, 18 Mar 2016 03:06:26 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id tj5si634658pab.33.2016.03.18.03.06.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Mar 2016 03:06:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1agrB3-0001md-Rn; Fri, 18 Mar 2016 09:58:41 +0000 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1agrB0-0001fq-Al for linux-arm-kernel@lists.infradead.org; Fri, 18 Mar 2016 09:58:39 +0000 Received: by mail-wm0-x235.google.com with SMTP id l68so29303825wml.1 for ; Fri, 18 Mar 2016 02:58:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=/fEgnXz5ZAA60VwiFVosXMf9lchS+uKSoazKxOGxMQM=; b=QXRy5VJodQSZ96/QGmra9jwzo404Gmv4IubH4JM3Y9ifz9TTYqPEnVFf1aUf4fWY8o NDg604We8+jyVp5r6I5N7Bp/KAt7VpeZdlazw3VPjIZS5XMGm61hqwqq4laDkWo00QQt Zh2fKDdCeOhzCMseqAaNIy7JkFKJl/uLj5ncY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=/fEgnXz5ZAA60VwiFVosXMf9lchS+uKSoazKxOGxMQM=; b=MsxBVbvTVJKz6tRLN55zI0CFkQMSgf/LPFhk6Zykabbf3V8pmKMzeW3YP1CRcDSGYR 9fUAonknXmvwM52wshgCbu08eFRozW4J1Hs77znJt9a+1LKYSwn9CSZQSUxce0n6GYb4 gTXuxexX8o01ldtxriQnk/Xc4Q+n/5P+XH8qSTC1i2O2o3j12RjA3ti5ajmFgwOk/mK8 pg+fSTXYylIN7c4doi/sB8N46VX67knghqdaqF9HcvSVS8Bla62DZyDXj+7yKJhbqFXJ fCC5FQkT6+B4LwAuFxegF72pAhYrvsa4kJQgVFNNyQYrgeodXfL01NDF/y0fLsoXZlyr fwWQ== X-Gm-Message-State: AD7BkJJuRolTdng1IG0cgZoyY2rdUFMJ9kbDQcTnM+1RuzrySeo2+t6Sc+yg+TEgzzjaed4n X-Received: by 10.194.227.1 with SMTP id rw1mr14671869wjc.62.1458295096318; Fri, 18 Mar 2016 02:58:16 -0700 (PDT) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id i1sm11436927wjs.45.2016.03.18.02.58.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Mar 2016 02:58:15 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will.deacon@arm.com Subject: [PATCH] arm64/kernel: fix incorrect EL0 check in inv_entry macro Date: Fri, 18 Mar 2016 10:58:09 +0100 Message-Id: <1458295089-24447-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160318_025838_665559_6C3807F5 X-CRM114-Status: GOOD ( 11.67 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:235 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org The implementation of macro inv_entry refers to its 'el' argument without the required leading backslash, which results in an undefined symbol 'el' to be passed into the kernel_entry macro rather than the index of the exception level as intended. This undefined symbol strangely enough does not result in build failures, although it is visible in vmlinux: $ nm -n vmlinux |head U el 0000000000000000 A _kernel_flags_le_hi32 0000000000000000 A _kernel_offset_le_hi32 0000000000000000 A _kernel_size_le_hi32 000000000000000a A _kernel_flags_le_lo32 ..... However, it does result in incorrect code being generated for invalid exceptions taken from EL0, since the argument check in kernel_entry assumes EL1 if its argument does not equal '0'. Signed-off-by: Ard Biesheuvel --- arch/arm64/kernel/entry.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.5.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index 1f7f5a2b61bf..12e8d2bcb3f9 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -277,7 +277,7 @@ END(vectors) * Invalid mode handlers */ .macro inv_entry, el, reason, regsize = 64 - kernel_entry el, \regsize + kernel_entry \el, \regsize mov x0, sp mov x1, #\reason mrs x2, esr_el1