Received: by 10.192.165.148 with SMTP id m20csp764456imm; Fri, 27 Apr 2018 07:10:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrTVHiNwzycNLZjUIR7GZdaoeYEXqxXui7ajGBzZMhbLlhL1cA1dBXnhSYkOtFGksyWGiAe X-Received: by 10.98.12.21 with SMTP id u21mr1603760pfi.218.1524838246497; Fri, 27 Apr 2018 07:10:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524838246; cv=none; d=google.com; s=arc-20160816; b=VMRNTC0f/dM7+PpeSx4VItLvIizOE3iagPVTBYNGGTWl8VafpWjB+KqXwOYtkkFwAK DL+TMhlWqGRPKnxXWJWY5yM7UtPq78U1W7LamzgArkW432Vp0FqChiBmgrWeocXPnsCW qbX0+vwe9MroKgpTEV0TbNP06yjZsszgkOi5zeqpJfAS/8hLKGzXq8AjHDnnvRv1gbPR gjljUlXWt/Edg9oNB9hpi1Poo15rKdLHhhE1TF6sVuRvVlusXO3dTagogxvj2+WQt1dP 71U242Gx3JIgMhdAkYd8qhxj4Vjcw0jaFTXoo4bNuHbTrwpX6EHOCSJ/WdGYCX0YaKl4 ++NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dmarc-filter :arc-authentication-results; bh=tA+VxDMUqqLTVn/qxkpG+f7qeAACcZRJSPamu9Ta65M=; b=IvtsUZIdmQ1gkY3AwGR8CH4r0rUA5IXg6iMd3wEXuDR+4ZxHRleM5qXJ6U8z/b54jE tPFP11WWYylMGDXuQoVIdLnDg3e95drdeshGrpPyVAZoV3As4lFOCeOTqoOHXvjFBqAc ELH0okO1T9JhPeDUToUSPohu/1X7ApJK0QG5DKwxeUBO9IuRsycQiKFgNg5Ryvstbbdr lDbtWyBt2S3XGpzkreLVHWDzAynwKjDJWxQ+mRItTPmCQQL0Tk+6imS0sQ2XVZ18EtUu WVXzQCteheX9VcnfTJ3U77HQNalvMCbHYwsAM2yaNrFlUdk8JZMGkNG19Vyd6HekUpX0 xXQQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33-v6si1329799plu.385.2018.04.27.07.10.32; Fri, 27 Apr 2018 07:10:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934678AbeD0OJ2 (ORCPT + 99 others); Fri, 27 Apr 2018 10:09:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:54782 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934654AbeD0OJZ (ORCPT ); Fri, 27 Apr 2018 10:09:25 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 12B6C21864; Fri, 27 Apr 2018 14:09:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 12B6C21864 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ziqian SUN , Heiko Carstens , Martin Schwidefsky Subject: [PATCH 4.14 79/80] s390/uprobes: implement arch_uretprobe_is_alive() Date: Fri, 27 Apr 2018 15:59:12 +0200 Message-Id: <20180427135737.036266984@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427135732.928644313@linuxfoundation.org> References: <20180427135732.928644313@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Heiko Carstens commit 783c3b53b9506db3e05daacfe34e0287eebb09d8 upstream. Implement s390 specific arch_uretprobe_is_alive() to avoid SIGSEGVs observed with uretprobes in combination with setjmp/longjmp. See commit 2dea1d9c38e4 ("powerpc/uprobes: Implement arch_uretprobe_is_alive()") for more details. With this implemented all test cases referenced in the above commit pass. Reported-by: Ziqian SUN Cc: # v4.3+ Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky Signed-off-by: Greg Kroah-Hartman --- arch/s390/kernel/uprobes.c | 9 +++++++++ 1 file changed, 9 insertions(+) --- a/arch/s390/kernel/uprobes.c +++ b/arch/s390/kernel/uprobes.c @@ -150,6 +150,15 @@ unsigned long arch_uretprobe_hijack_retu return orig; } +bool arch_uretprobe_is_alive(struct return_instance *ret, enum rp_check ctx, + struct pt_regs *regs) +{ + if (ctx == RP_CHECK_CHAIN_CALL) + return user_stack_pointer(regs) <= ret->stack; + else + return user_stack_pointer(regs) < ret->stack; +} + /* Instruction Emulation */ static void adjust_psw_addr(psw_t *psw, unsigned long len)