From nobody Fri Aug 25 19:00:48 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RXTmx1RNBz4qg3G; Fri, 25 Aug 2023 19:00:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RXTmx0v3Yz3PHM; Fri, 25 Aug 2023 19:00:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692990049; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=koRMs4Biqki9bpHlHeT+HXR0zhq6k9k8/HEjsj2IjTo=; b=B5GYILUh0yloGTJlX9rhRe/fG6VODSSNdkyEJMXAeyigNsBKfV3ny03UDqAELWawTubHi0 lFy5nQ0DwQjKeHTh4yI8QuU/DhFM57AOJdUiXFmakF4sGG2KXMbi92sV7wOE4KNo6kXNeZ J1WxBF/DBnESY7+VXvP0P912DzrC52WEkbCLxZ5apqwtyEuxeoB+54mU6lZNvQLwdIyUk0 6JNcQ9+sDZkibzwN26h5c4mttrK5jAnuaWRMoFro4HY9d2mkzXegQGEv7LY6vme0H7APDm dFXXsgUrkDNO9yPhWNpnq3MzIcTQl9NXv534Fy7xg1jLneKNOMUP9w0qoO19OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692990049; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=koRMs4Biqki9bpHlHeT+HXR0zhq6k9k8/HEjsj2IjTo=; b=u2Oi3/L93ZjpoZEnY9JRMZqmx1N0/IDosCff1Lgmytrxhj3HH+abBnWJJWqydFEju0XD+k rsQr7qKx+tB1SYyhZv61Svv+cMn8/7phQnMaaRkVgeZTdSMYYOAj/HOaL+xojnoT3rKGk6 szbdBaR0teoK8hhYjTFq6Qzcm7Tr6xOani+Y6kf0hY0qkOAhs3CUpcJ8JO06/xe2tswk7M ljLG4gKvFmAMxJdYU9Uqf++WHTedPryG//dldJBWCtcMQKszl2wluIo2wIOKl3MBAnYokH vM7Ys92koYsOUCWA+BLwiuY1XYRTEHlCPLm3Ea+bBJizJt6WEWzLIcohOmJaHg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692990049; a=rsa-sha256; cv=none; b=iN/Ff2A48VXnrPDwaB72L6o8mjAfgAcptvKmLGLfEd9EeaOKv7SIm/DgCEWUVYCMaY1QuU LQhytSxPXCPfR+djaMxpVrQKcvARqlIeDlmmJgOTMQHBUWIRFVtqtKevNC15IXRBb3KUX3 FxwF3+8o/AwuOil2ba7VcOueign+rDs9Xy7NXfWQDqJJXCqNN9UR2Xlcgowhgy4u2+ckSX CoAklXQDvwrpXmTEhCmxp+5XUDoe7c/mwSyH0EWA55tFXwIf+YDzjTmpQSW+bDLNsJwNOj aiyG30Tjh5DwK4BaBxOb08WJBCedjAVZ4UpsZyFjKDsrpnfkX3OCkdO2rm0v9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RXTmw73bCz1Jjk; Fri, 25 Aug 2023 19:00:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37PJ0me6042677; Fri, 25 Aug 2023 19:00:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37PJ0mBx042674; Fri, 25 Aug 2023 19:00:48 GMT (envelope-from git) Date: Fri, 25 Aug 2023 19:00:48 GMT Message-Id: <202308251900.37PJ0mBx042674@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 247e8662d2c0 - main - arm unwind: Reject unaligned stack pointers List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 247e8662d2c080c27937ec4d62e80b2358e8c74f Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=247e8662d2c080c27937ec4d62e80b2358e8c74f commit 247e8662d2c080c27937ec4d62e80b2358e8c74f Author: John Baldwin AuthorDate: 2023-08-25 19:00:37 +0000 Commit: John Baldwin CommitDate: 2023-08-25 19:00:37 +0000 arm unwind: Reject unaligned stack pointers Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D41533 --- sys/arm/arm/unwind.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/arm/arm/unwind.c b/sys/arm/arm/unwind.c index cdc9ef225ee7..591bae3dfc26 100644 --- a/sys/arm/arm/unwind.c +++ b/sys/arm/arm/unwind.c @@ -398,6 +398,9 @@ unwind_exec_insn(struct unwind_state *state) if (mask == 0) return 1; + if (!__is_aligned(vsp, sizeof(register_t))) + return 1; + /* Update SP */ update_vsp = 1; @@ -430,6 +433,9 @@ unwind_exec_insn(struct unwind_state *state) /* Read how many registers to load */ count = insn & INSN_POP_COUNT_MASK; + if (!__is_aligned(vsp, sizeof(register_t))) + return 1; + /* Update sp */ update_vsp = 1; @@ -460,6 +466,9 @@ unwind_exec_insn(struct unwind_state *state) if (mask == 0 || (mask & 0xf0) != 0) return 1; + if (!__is_aligned(vsp, sizeof(register_t))) + return 1; + /* Update SP */ update_vsp = 1;