Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/775850/?format=api
{ "id": 775850, "url": "http://patchwork.ozlabs.org/api/patches/775850/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20170614154400.17377-1-naveen.n.rao@linux.vnet.ibm.com/", "project": { "id": 2, "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api", "name": "Linux PPC development", "link_name": "linuxppc-dev", "list_id": "linuxppc-dev.lists.ozlabs.org", "list_email": "linuxppc-dev@lists.ozlabs.org", "web_url": "https://github.com/linuxppc/wiki/wiki", "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git", "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/", "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/", "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}" }, "msgid": "<20170614154400.17377-1-naveen.n.rao@linux.vnet.ibm.com>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20170614154400.17377-1-naveen.n.rao@linux.vnet.ibm.com/", "date": "2017-06-14T15:44:00", "name": "powerpc/uprobes: Implement arch_uretprobe_is_alive()", "commit_ref": "2dea1d9c38e481051fa0e62807e518c5768e62dd", "pull_url": null, "state": "accepted", "archived": false, "hash": "30474e2b644a0c8138eadaee17db030ac35d8544", "submitter": { "id": 15185, "url": "http://patchwork.ozlabs.org/api/people/15185/?format=api", "name": "Naveen N. Rao", "email": "naveen.n.rao@linux.vnet.ibm.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20170614154400.17377-1-naveen.n.rao@linux.vnet.ibm.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/775850/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/775850/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>", "X-Original-To": [ "patchwork-incoming@ozlabs.org", "linuxppc-dev@lists.ozlabs.org" ], "Delivered-To": [ "patchwork-incoming@ozlabs.org", "linuxppc-dev@lists.ozlabs.org" ], "Received": [ "from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3wnrYz6WK7z9s76\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 15 Jun 2017 01:45:27 +1000 (AEST)", "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3wnrYz5frRzDqPQ\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 15 Jun 2017 01:45:27 +1000 (AEST)", "from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com\n\t[148.163.156.1])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3wnrXq4YbnzDqKy\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tThu, 15 Jun 2017 01:44:27 +1000 (AEST)", "from pps.filterd (m0098410.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id\n\tv5EFhwtT125132\n\tfor <linuxppc-dev@lists.ozlabs.org>; Wed, 14 Jun 2017 11:44:25 -0400", "from e23smtp01.au.ibm.com (e23smtp01.au.ibm.com [202.81.31.143])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2b37xy0976-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <linuxppc-dev@lists.ozlabs.org>; Wed, 14 Jun 2017 11:44:24 -0400", "from localhost\n\tby e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <linuxppc-dev@lists.ozlabs.org> from\n\t<naveen.n.rao@linux.vnet.ibm.com>; Thu, 15 Jun 2017 01:44:22 +1000", "from d23relay09.au.ibm.com (202.81.31.228)\n\tby e23smtp01.au.ibm.com (202.81.31.207) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tThu, 15 Jun 2017 01:44:20 +1000", "from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139])\n\tby d23relay09.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n\tv5EFiKVa3801454\n\tfor <linuxppc-dev@lists.ozlabs.org>; Thu, 15 Jun 2017 01:44:20 +1000", "from d23av04.au.ibm.com (localhost [127.0.0.1])\n\tby d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id\n\tv5EFiHMX017204\n\tfor <linuxppc-dev@lists.ozlabs.org>; Thu, 15 Jun 2017 01:44:18 +1000", "from naverao1-tp.ibm.com ([9.124.217.117])\n\tby d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id\n\tv5EFiEQb017132; Thu, 15 Jun 2017 01:44:15 +1000" ], "From": "\"Naveen N. Rao\" <naveen.n.rao@linux.vnet.ibm.com>", "To": "Michael Ellerman <mpe@ellerman.id.au>", "Subject": "[PATCH] powerpc/uprobes: Implement arch_uretprobe_is_alive()", "Date": "Wed, 14 Jun 2017 21:14:00 +0530", "X-Mailer": "git-send-email 2.12.2", "X-TM-AS-MML": "disable", "x-cbid": "17061415-1617-0000-0000-000001E59807", "X-IBM-AV-DETECTION": "SAVI=unused REMOTE=unused XFE=unused", "x-cbparentid": "17061415-1618-0000-0000-0000482BFF84", "Message-Id": "<20170614154400.17377-1-naveen.n.rao@linux.vnet.ibm.com>", "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-06-14_03:, , signatures=0", "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=3\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000\n\tdefinitions=main-1706140265", "X-BeenThere": "linuxppc-dev@lists.ozlabs.org", "X-Mailman-Version": "2.1.23", "Precedence": "list", "List-Id": "Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>", "List-Unsubscribe": "<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>", "List-Archive": "<http://lists.ozlabs.org/pipermail/linuxppc-dev/>", "List-Post": "<mailto:linuxppc-dev@lists.ozlabs.org>", "List-Help": "<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>", "List-Subscribe": "<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>", "Cc": "linuxppc-dev@lists.ozlabs.org,\n\tSrikar Dronamraju <srikar@linux.vnet.ibm.com>, zsun@redhat.com,\n\tGustavo Luiz Duarte <gduarte@redhat.com>", "Errors-To": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org", "Sender": "\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>" }, "content": "This helper is used to detect if a uprobe'd function has returned\nthrough a setjmp/longjmp, rather than branching to the LR that was\nupdated previously by us. This fixes a SIGSEGV that gets generated when\nprograms use setjmp/longjmp with uretprobes.\n\nWe use the arm64 model (arch/arm64/kernel/probes/uprobes.c:\narch_uretprobe_is_alive()) for detecting when stack frames have been\nremoved from under us.\n\nReference:\nhttps://marc.info/?l=linux-kernel&m=143748610330073\ncommit 7b868e4802a86 (\"uprobes/x86: Reimplement arch_uretprobe_is_alive()\")\ncommit db087ef69a2b1 (\"uprobes/x86: Make arch_uretprobe_is_alive(RP_CHECK_CALL) more\nclever\")\n\nTested with the test program from:\nhttps://sourceware.org/git/gitweb.cgi?p=systemtap.git;a=blob;f=testsuite/systemtap.base/bz5274.c;hb=HEAD\n\nAnd this script:\n $ cat test.sh\n #!/bin/bash\n\n perf probe -x ./bz5274 -a bz5274_main_return=main%return\n perf probe -x ./bz5274 -a bz5274_funca_return=funca%return\n perf probe -x ./bz5274 -a bz5274_funcb_return=funcb%return\n perf probe -x ./bz5274 -a bz5274_funcc_return=funcc%return\n perf probe -x ./bz5274 -a bz5274_funcd_return=funcd%return\n\n perf record -e 'probe_bz5274:*' -aR ./bz5274\n\nReported-by: Gustavo Luiz Duarte <gduarte@redhat.com>\nReported-by: zsun@redhat.com\nSigned-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>\n---\n arch/powerpc/kernel/uprobes.c | 9 +++++++++\n 1 file changed, 9 insertions(+)", "diff": "diff --git a/arch/powerpc/kernel/uprobes.c b/arch/powerpc/kernel/uprobes.c\nindex 003b20964ea0..5d105b8eeece 100644\n--- a/arch/powerpc/kernel/uprobes.c\n+++ b/arch/powerpc/kernel/uprobes.c\n@@ -205,3 +205,12 @@ arch_uretprobe_hijack_return_addr(unsigned long trampoline_vaddr, struct pt_regs\n \n \treturn orig_ret_vaddr;\n }\n+\n+bool arch_uretprobe_is_alive(struct return_instance *ret, enum rp_check ctx,\n+\t\t\t\tstruct pt_regs *regs)\n+{\n+\tif (ctx == RP_CHECK_CHAIN_CALL)\n+\t\treturn regs->gpr[1] <= ret->stack;\n+\telse\n+\t\treturn regs->gpr[1] < ret->stack;\n+}\n", "prefixes": [] }