Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp2939759pxv; Sun, 25 Jul 2021 10:38:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCyp2WLpuq+UqkDmpL5r6ZCPA0YNlO1IOXuls4fiSuWwL9HyWa8pcLTkJpriH8MbbLnAdG X-Received: by 2002:a05:6638:1646:: with SMTP id a6mr12925244jat.1.1627234694075; Sun, 25 Jul 2021 10:38:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627234694; cv=none; d=google.com; s=arc-20160816; b=AW6eHz9V3DzyfgBPp/cTXfVaIudQIoXfUYMJ0/FerN9Xnq/M2goHaWm+4SHERfQueG z6S5X5jl+Msz/syK9LR1m6hXFEmC6/42bmVBBEGPXGcVBIRjn9DCR7T2apUuVWi9GPEs +lylSAjI8GAD1JEmff962/cWINPazZZkyPZN+g3VIcO8jxm8hdAYv+v4WonVBxV2yA5y aWgx473Rh2dUfSj4VK6Ve+fiS+Kd8ZdXnba087OuWeToeiyjFYxE5jTWj2R+QUoCoI3Y Q0AXpNTbBIX3Y488WxkqMIXipraicWaoD+Jt36Gz6AxEt7JD3lOI2dsRwCF1noaRCXIG 5jbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=EalBs9GjDHaVUH392HcNFVHwuBx8m8gbskMU3JYtFKg=; b=N6Q5kTsLnwtjMDUB5kLA1ZP3r0kd/A/jay6VNAEenE8XORelqfG75NwOX3jJB3Lw8X iws1YNyOuwRvN5t/nvLUHuLiXriX893/3ofvoo4VlSKCf1Vqm9EETN/dscrFKUmOyg8b 1MOhi73qaX8XIK68uuxzAODx0injVNJ0ZXY24B0wF+j4hmhIXf5mFCQMR7DSR4OUEMwZ ITsD/bAzJzPfnkFu4JFNOHDGj1CiWnVGJ1OFvZhiyB/XCE+MG5DlSbWo8L/F3p1CcMBT mGIqFT2XgCSwQDuq8ZmsR4cs5OTLPgGpl/4kSpWt6TAWlpAaoIIJptjRgJLA2C3Gq4Ye pGJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l23si39232063jaf.47.2021.07.25.10.38.02; Sun, 25 Jul 2021 10:38:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230482AbhGYQlZ (ORCPT + 99 others); Sun, 25 Jul 2021 12:41:25 -0400 Received: from zeniv-ca.linux.org.uk ([142.44.231.140]:46060 "EHLO zeniv-ca.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229545AbhGYQlY (ORCPT ); Sun, 25 Jul 2021 12:41:24 -0400 Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m7hmz-003rwk-Eu; Sun, 25 Jul 2021 17:19:45 +0000 Date: Sun, 25 Jul 2021 17:19:45 +0000 From: Al Viro To: linux-m68k@lists.linux-m68k.org Cc: Geert Uytterhoeven , Greg Ungerer , linux-kernel@vger.kernel.org Subject: [PATCH 2/3] m68k: update ->thread.esp0 before calling syscall_trace() in ret_from_signal Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We get there when sigreturn has performed obscene acts on kernel stack; in particular, the location of pt_regs has shifted. We are about to call syscall_trace(), which might stop for tracer. If that happens, we'd better have task_pt_regs() returning correct result... Fucked-up-by: Al Viro Fixes: bd6f56a75bb2 ("m68k: Missing syscall_trace() on sigreturn") Signed-off-by: Al Viro --- arch/m68k/kernel/entry.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S index 9dd76fbb7c6b..ff9e842cec0f 100644 --- a/arch/m68k/kernel/entry.S +++ b/arch/m68k/kernel/entry.S @@ -186,6 +186,8 @@ ENTRY(ret_from_signal) movel %curptr@(TASK_STACK),%a1 tstb %a1@(TINFO_FLAGS+2) jge 1f + lea %sp@(SWITCH_STACK_SIZE),%a1 + movel %a1,%curptr@(TASK_THREAD+THREAD_ESP0) jbsr syscall_trace 1: RESTORE_SWITCH_STACK addql #4,%sp -- 2.11.0