Received: by 10.192.165.148 with SMTP id m20csp777847imm; Fri, 27 Apr 2018 07:22:41 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrqkQ3AeKHs6/Jg6SZYDj5AFze4TmKsU2x07jA6SJIlC1ts4nDAOBJzHbfLHg3VSB4A7/n6 X-Received: by 2002:a63:b406:: with SMTP id s6-v6mr2389958pgf.334.1524838961603; Fri, 27 Apr 2018 07:22:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524838961; cv=none; d=google.com; s=arc-20160816; b=sH7Vvbq99ccH5ZdL0lmV+uZ2ZKNJE6FeseDPWK+8REKhx0TWCv/wDaMMjIPTHHO10A eqhclMLdJvJPTTGcoq9M5rVyoGm1pNdF2jcqA0GO0/TfFQHAB59xSKMBWnFZ79V7YICk vjwZXlq6c2cuFMpBRj7h7Vqz4F7XFax2jIVzKPmb2IH8OjJYNRH8GPPVL4+qMQjD35Rb 6InIARN2eX2pLhFNZR6J35ZI/Aj+jgqkqxo+2LukSER3d/WTRXYeSROyPTffBS1tq2LE GY8n4UcdmnrmINwKL9g9d/Uv1C902cPf7nuoPRASZkhupJZ19Sp7YhhRNkUHKg6ukWaM IKYw== 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=kLd3886W12Cvg6HU2d7msQpv+cBYGI0xQWO4VMl7Isc=; b=kdSOvSjxX/6Dp7PJNfXxPp9/kl6ua21xJ7N2V6QRc1xOiZVO642eanx1B0jaws8bD8 AjqKzYjrb3u0vBB2s7Bjyakn9C3pLwZIebiMqo/tITSS+6AslqDBjHAQNoq7sy/esAe+ Vl8tWUhU9KtrvufjLiiFImxVhDvkc4TsdJEhqbHD5V/j4YigyUUUW02b5lk6+GYbj+ft //fDkDY5gf4Xg8DxZlkWtDYiMCXPTCuJB0gIMHYkhuAIH4OiL3es0DE7mR0JdttleAAS StK0h6Twny1XomPgZrui4fmjPqv89yWdRV8UF9ECAiIGmkoT934FDBp1uem0I+Un9zYd UczA== 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 m68si1344707pfm.0.2018.04.27.07.22.27; Fri, 27 Apr 2018 07:22:41 -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 S935340AbeD0OUv (ORCPT + 99 others); Fri, 27 Apr 2018 10:20:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:57212 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935241AbeD0OMp (ORCPT ); Fri, 27 Apr 2018 10:12:45 -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 2D73821897; Fri, 27 Apr 2018 14:12:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2D73821897 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.16 78/81] s390/uprobes: implement arch_uretprobe_is_alive() Date: Fri, 27 Apr 2018 15:59:20 +0200 Message-Id: <20180427135747.777727904@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427135743.216853156@linuxfoundation.org> References: <20180427135743.216853156@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.16-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)