From nobody Wed Oct 11 19:06:27 2023 X-Original-To: dev-commits-src-all@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 4S5Mgm1gSfz4wYvg; Wed, 11 Oct 2023 19:06:28 +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 4S5Mgm0ynjz4bc0; Wed, 11 Oct 2023 19:06:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697051188; 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=Kzcrn39eD0z7mdex5k15+pXfmfFzl1CZcnR3/gmwyRI=; b=PV17q+f+nHI3OzW9rO6Y1A4WSeoEmVx/oeASbdpybuY1OTr3YFanm5g0t2+8BEfjiaZMdz k3Z2SZyePRuA9HeVJiw0G6ELv5SfhQD0/94JByE40ZwVkI7l7/Q3VhSV+d8/Pu195PEKOW v9kLsLUr8peD+z28MrdDKiJArz8ZOVIg9fQtOotFiEgFlqfZtvmCCZttxLMPZLvorB3V+b zdX62tA4RvfSWSTCxol/jh6q3l3VPyGUrP/uEVwQHfdnz2ghvLhA+ug11ceFPVfUQipP35 wsEw3gFcH/cqKC25aC+qyAJIwq3sQ9SrGxtyPexaObi1+ssVLE1bPqwQdH2Bzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697051188; a=rsa-sha256; cv=none; b=MuGqxG86fQDfLKY/Azc6txrtNGv0I6gvNoITg1fWmr6CnTZA6VD1iPmUaWB+T03LQ691D7 qZSzjR+iGcaLF/wx4I07RCTg6odftg2hqz/d2aXPpbEb0AxqqsI8j7xYbd/oHa5+HHG0id VZTS9vlTxBKqoRq/MHzi1NZ1CQDObd7kpCRToAxNJl1XFmHEVHaeJug+Hvm7QfwbQNji79 ltbJwLqPKSaLxa3dZC5jGiU479kak9L6q3DQYbnzAsdbetDtZh3Ae2M5bT/M2L/IYdPoLs Hwqe6whqcKGuWK1ht2Lg0bsf4esqBj89tmx3wqNIsjKjKxE3vROgBlggUQM+Lg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697051188; 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=Kzcrn39eD0z7mdex5k15+pXfmfFzl1CZcnR3/gmwyRI=; b=gZnVZvyJc215C7AQctrA7OtikSo3XN32/suhqEsliG0s/tbWJ9b2GmlkXOTyocUngUJ9Io 5d8qWL5TtX3dKTn9Vy7SLnOYcl/OqWqRjHNlkbBJjmE49w7hc5gkiBN/2qf3yFerpD31S/ iCzI/OZwvgWlhSutnOqkUg3lhDlLrB/+UNz8l16PQ9hFL0oZrTEXVjM8KzYiN7TyriVhzg 1ij8EBfcxCE6kIgNFxxNxgHbYrdEtPelsoNqEQQ81EJzGwO98eUfW5QCAxCu9hyZM8kce+ Omtn+Ikk7699/SIgk5tEzHGZgyi3Z+Wtwd4c0J3zLi6+LKn/NVc6uYTI+dbxEg== 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 4S5Mgl6y9CzYjH; Wed, 11 Oct 2023 19:06:27 +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 39BJ6RoU058807; Wed, 11 Oct 2023 19:06:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39BJ6RoE058804; Wed, 11 Oct 2023 19:06:27 GMT (envelope-from git) Date: Wed, 11 Oct 2023 19:06:27 GMT Message-Id: <202310111906.39BJ6RoE058804@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 0b76796abdc8 - stable/13 - arm unwind: Reject unaligned stack pointers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 0b76796abdc865f5cb275f229569fe3259434d4c Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0b76796abdc865f5cb275f229569fe3259434d4c commit 0b76796abdc865f5cb275f229569fe3259434d4c Author: John Baldwin AuthorDate: 2023-08-25 19:00:37 +0000 Commit: John Baldwin CommitDate: 2023-10-11 15:09:52 +0000 arm unwind: Reject unaligned stack pointers Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D41533 (cherry picked from commit 247e8662d2c080c27937ec4d62e80b2358e8c74f) --- 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;