Received: by 10.192.165.148 with SMTP id m20csp759913imm; Fri, 27 Apr 2018 07:06:58 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo3JNzl8FTC1IShBNxIv93VRdQZeaexsEz6HmvUcGqrkHv9Qt+g4i1knTwr03GhMCnXVjJF X-Received: by 2002:a63:2c12:: with SMTP id s18-v6mr2289483pgs.427.1524838018742; Fri, 27 Apr 2018 07:06:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524838018; cv=none; d=google.com; s=arc-20160816; b=onAJHcf5/sa4RbI9HfVdbenVI8UpPlavH6wnCRhlWJM+L6dRWzpXFaGQS8h0zQKACN xWPirw63Zpm8IcCZ2L9RaiTmG8rrSCtREGrWZSFujUjO0PITJs7yteCBOoEiJxYf/FNj KB77B0Up5C20jzAwjz84TJAAXaK9VsBYa21t3PCP1/tiTbHoEN0OrabZPSAItG8iv3BW 2/755XwlyIetIBqx12hqqudBk/9ZbBLVdtr9dhPzsWDYAY426j6PjszaiVrV/N8a9ImQ Uplo3uYhH92SvRigZftoPrvu9g1XYFLT9AY45YLVkKMVHYzWy8+dqymOicH+k/UX0tUs pAew== 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=/OzJop9wY36B/cL5gxNmQSqpV0PFRq3jp0du8QVUawY=; b=zQCdV0EgnrLIGGyjBBnO8fidv3O983ae+4LFc9X13DQ6FU9qnKrTkahu8jWMH0huLw QB7zmWaR2jdorwWfJ+rqgWqIBO85nKl9nLLxhvVF53dkMpc940e/vxJkKXGJI4r3Jp1p 4mSo6dI1S9CCQ17xCWT9VqyKfOuIFOGvthgmeAy5Pra4VdCXAgFiDpEQyZKa/xFsupoV GzaiDn4/mpxRAFYDhpj3dilmHRkUn2+dNjCZFY03D5C5E+3flIPTnYA8sL+diSsn84my 8A4hm1WL5v7JRVrC4nj8H2ViVCQQ1CJqgMpO5IALZXtF6XeiuatPUXsc1IVhv7qQ0lgA yo0Q== 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 70-v6si1318549ple.372.2018.04.27.07.06.44; Fri, 27 Apr 2018 07:06:58 -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 S933961AbeD0OFj (ORCPT + 99 others); Fri, 27 Apr 2018 10:05:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:51808 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933945AbeD0OFf (ORCPT ); Fri, 27 Apr 2018 10:05:35 -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 E9A2A21890; Fri, 27 Apr 2018 14:05:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E9A2A21890 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.9 73/74] s390/uprobes: implement arch_uretprobe_is_alive() Date: Fri, 27 Apr 2018 15:59:03 +0200 Message-Id: <20180427135712.969357908@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427135709.899303463@linuxfoundation.org> References: <20180427135709.899303463@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.9-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 @@ -147,6 +147,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)