Authentication-Results: name.execsw.org; dkim=pass (1024-bit key) header.d=netbsd.org header.i=@netbsd.org header.b=0ukE089o; dkim=fail reason="signature verification failed" (1024-bit key) header.d=netbsd.org header.i=@netbsd.org header.b=MOIFpPFq Received: by mail.netbsd.org (Postfix, from userid 605) id 24FA484F43; Thu, 18 Apr 2024 18:17:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netbsd.org; s=20240131; t=1713464228; bh=eVujJjIcHu9TcRy+bkqa58sT1pL1Lp557UEGhwYzCnY=; h=Date:From:Subject:To:List-Id:Reply-To:List-Unsubscribe; b=0ukE089oGCT2HY4HayIxyxzIfi+2FUD85oEtj60we123D7UVpYnFBsTafSAEVseRo /2GgU19n2tT6wj5AvbKuAZPxffQwf/7dZoHYvJR/qQDPRyt6f1jqk4yBrUw/ZoGq4n J6+37XMW5LCnFqNTtIyAB4Rm8DIEn/5dN/TqGZB8= Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 0D4A484F40 for ; Thu, 18 Apr 2024 18:17:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Authentication-Results: mail.netbsd.org (amavisd-new); dkim=pass (1024-bit key) header.d=netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id y5L-XEC_xs1K for ; Thu, 18 Apr 2024 18:17:06 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id 5DB8F84CE2 for ; Thu, 18 Apr 2024 18:17:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netbsd.org; s=20240131; t=1713464226; bh=eVujJjIcHu9TcRy+bkqa58sT1pL1Lp557UEGhwYzCnY=; h=Date:From:Subject:To:Reply-To; b=MOIFpPFqMnBNwtzV2xNACNg4mDeLEptt81es+tUtXkqva1p7920YSITpWfedwcUn8 xtqLWVoUyaz2r6tVzJpWUBenQKDSgj/Ebwm6dNMcdxhrInzkmIzYlOgC26aR9wShLb bad8/pCSRermC9kLtUJMXdR80twhn54YufzIkFNg= Received: by cvs.NetBSD.org (Postfix, from userid 500) id 52353FA2C; Thu, 18 Apr 2024 18:17:06 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Thu, 18 Apr 2024 18:17:06 +0000 From: "Martin Husemann" Subject: CVS commit: [netbsd-10] src/sys/arch/aarch64/aarch64 To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20240418181706.52353FA2C@cvs.NetBSD.org> Sender: source-changes-owner@NetBSD.org List-Id: Precedence: bulk Reply-To: source-changes-d@NetBSD.org Mail-Reply-To: "Martin Husemann" Mail-Followup-To: source-changes-d@NetBSD.org List-Unsubscribe: Module Name: src Committed By: martin Date: Thu Apr 18 18:17:06 UTC 2024 Modified Files: src/sys/arch/aarch64/aarch64 [netbsd-10]: cpu_machdep.c sig_machdep.c Log Message: Pull up following revision(s) (requested by skrll in ticket #667): sys/arch/aarch64/aarch64/sig_machdep.c: revision 1.9 sys/arch/aarch64/aarch64/cpu_machdep.c: revision 1.15 kern/58149: aarch64: Cannot return from a signal handler if SP was misaligned when the signal arrived Apply the kernel diff from the PR 1. sendsig_siginfo() previously assumed that user SP was always aligned to 16 bytes and could call signal handlers with SP misaligned. This is a wrong assumption because aarch64 demands that SP is aligned *only while* it's being used to access memory. Now it properly aligns it before pusing anything on the stack. 2. cpu_mcontext_validate() used to check if _REG_SP was aligned and considered the ucontext invalid otherwise. This meant if a signal was sent to a process whose SP was misaligned, the signal handler would fail to return because the ucontext passed from the kernel was an invalid one. Now setcontext(2) doesn't complain about misaligned SP. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.13.4.1 src/sys/arch/aarch64/aarch64/cpu_machdep.c cvs rdiff -u -r1.8 -r1.8.4.1 src/sys/arch/aarch64/aarch64/sig_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.