Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3981837pxb; Mon, 4 Oct 2021 14:21:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzG+s97guV3SicEiql0cQIFeHfFcemgnKWHqxmD0jSAM0sZvEgmK3SPZ//R9+ZsvcCf0Fb6 X-Received: by 2002:a63:ff45:: with SMTP id s5mr10661618pgk.423.1633382493786; Mon, 04 Oct 2021 14:21:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633382493; cv=none; d=google.com; s=arc-20160816; b=nUmzjYB7m0M46gcrogUGHoNaduwHj13DKgY2iXvb94J9+j7ShdCdV/AfRJoOWTRNB1 F/sdYmU09cAbK7I90tKlCEwlyxl2+7ruTcKz/noz+U0xTNfAbHuR36WJ5ngvL5Qlj5pS GDB7H3jN73VFY5IOh9jivzTELXh/Lgl2C35IVcbpQLoCOD+iZ1nCfMMhowXXSsuLWjG2 NAvXYtdi9r7R+1ltCc8bNpW8wdwrdww5MhnckS9LxX2GBqET1hLK1RfTuI/6cf75X+wa 69p5xN4N/XrItxkWysrQ98URxX3leHeTQoiff/UjYGI/VjLz2Y0Xatyl8x6rfIqW5SHH Mz4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aTZpjjPnC2o+4YoJ9o0BUyjQn4OS/3/C08cWFQlHxbk=; b=JJu8xz5WofhmajH6N2IJZbAD8uLuu4Y6dQSBd6c/xDcSS4PzhIxyWEEbffQkdrG9Yy 26pHHQ8Ia2eg+AauESozAclUnPBKgw1UEtSxXc/hz3/YsrYA8woEbGHpG/zlnNB04FWi RVNzgklNd3BgW23KrmV0LTs60Kbj41IF8/jyPiitskIntqlNY16vBo9NvgiNdEjMkGMD h2GlkN64DAUnReR+xbAzC4/Ci9+pUWCiaLlx0X6i+aWRTKC6Gey+S1j/xJbOsgZ4zVhE rVz/hkpNAvBeiNJvY+dPlIoY4a583e3Gn0qzIsT0AIRfz1NLtkbuIcJ9A55NkHZeidof WV2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="H/mBcVTY"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f130si18873173pgc.557.2021.10.04.14.21.20; Mon, 04 Oct 2021 14:21:33 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="H/mBcVTY"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237315AbhJDNaL (ORCPT + 99 others); Mon, 4 Oct 2021 09:30:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:43146 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237330AbhJDN2V (ORCPT ); Mon, 4 Oct 2021 09:28:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A4222630EA; Mon, 4 Oct 2021 13:12:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633353159; bh=evjF71pZXxUO5ZlgpMmmFLabQvOjYSTYuLjvtUZGSYk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H/mBcVTYgNst8TrIsi7+nIHvgpg6SLSB/JnI6cuSRIH83JktjB3cXcCh34+NVEIP+ JHC/bnRjSa/mV/XEOR2UBQxLHn9P5RrKSLeADOTWvhee26q9iYfE1ACHZR1NWcXCqG 1hcVGPQ7HvFCjXZag/t/PtZY6JPl1J+4hT3Ljjrk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Al Viro , Michael Schmitz , Finn Thain , Geert Uytterhoeven , Sasha Levin Subject: [PATCH 5.14 019/172] m68k: Update ->thread.esp0 before calling syscall_trace() in ret_from_signal Date: Mon, 4 Oct 2021 14:51:09 +0200 Message-Id: <20211004125045.584297584@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211004125044.945314266@linuxfoundation.org> References: <20211004125044.945314266@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Al Viro [ Upstream commit 50e43a57334400668952f8e551c9d87d3ed2dfef ] 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 Tested-by: Michael Schmitz Reviewed-by: Michael Schmitz Tested-by: Finn Thain Link: https://lore.kernel.org/r/YP2dMWeV1LkHiOpr@zeniv-ca.linux.org.uk Signed-off-by: Geert Uytterhoeven Signed-off-by: Sasha Levin --- 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.33.0