Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1707741/?format=api
{ "id": 1707741, "url": "http://patchwork.ozlabs.org/api/patches/1707741/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-um/patch/20221122100759.208290-6-benjamin@sipsolutions.net/", "project": { "id": 60, "url": "http://patchwork.ozlabs.org/api/projects/60/?format=api", "name": "User-mode Linux Development", "link_name": "linux-um", "list_id": "linux-um.lists.infradead.org", "list_email": "linux-um@lists.infradead.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20221122100759.208290-6-benjamin@sipsolutions.net>", "list_archive_url": null, "date": "2022-11-22T10:07:36", "name": "[v2,05/28] um: Make errors to stop ptraced child fatal during startup", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": false, "hash": "5b5e1ac252bcaf489360a97be66cd12f7ab81cda", "submitter": { "id": 67525, "url": "http://patchwork.ozlabs.org/api/people/67525/?format=api", "name": "Benjamin Berg", "email": "benjamin@sipsolutions.net" }, "delegate": { "id": 54851, "url": "http://patchwork.ozlabs.org/api/users/54851/?format=api", "username": "rw", "first_name": "Richard", "last_name": "Weinberger", "email": "richard@nod.at" }, "mbox": "http://patchwork.ozlabs.org/project/linux-um/patch/20221122100759.208290-6-benjamin@sipsolutions.net/mbox/", "series": [ { "id": 329466, "url": "http://patchwork.ozlabs.org/api/series/329466/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-um/list/?series=329466", "date": "2022-11-22T10:07:37", "name": "Implement SECCOMP based userland", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/329466/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1707741/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1707741/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n spf=none (no SPF record) smtp.mailfrom=lists.infradead.org\n (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org;\n envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n receiver=<UNKNOWN>)", "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=lists.infradead.org header.i=@lists.infradead.org\n header.a=rsa-sha256 header.s=bombadil.20210309 header.b=IQIk/D4t;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n secure) header.d=sipsolutions.net header.i=@sipsolutions.net\n header.a=rsa-sha256 header.s=mail header.b=jh1a9b6V;\n\tdkim-atps=neutral" ], "Received": [ "from bombadil.infradead.org (bombadil.infradead.org\n [IPv6:2607:7c80:54:3::133])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4NGg5Q1h5Bz23np\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 22 Nov 2022 21:11:21 +1100 (AEDT)", "from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux))\n\tid 1oxQFC-007fqP-8W; Tue, 22 Nov 2022 10:11:10 +0000", "from s3.sipsolutions.net ([2a01:4f8:191:4433::2]\n helo=sipsolutions.net)\n\tby bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux))\n\tid 1oxQF0-007ff0-E8\n\tfor linux-um@lists.infradead.org; Tue, 22 Nov 2022 10:11:03 +0000", "by sipsolutions.net with esmtpsa\n (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)\n\t(Exim 4.96)\n\t(envelope-from <benjamin@sipsolutions.net>)\n\tid 1oxQEn-006IGn-0r;\n\tTue, 22 Nov 2022 11:10:45 +0100" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20210309; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:\n\tMessage-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=oG0dCKqMXOFjGjCZP/wcBXJfKkS0zqIRQwrgkmvt+PI=; b=IQIk/D4tgqdTcp\n\tgFCa6l9bHd4yWa+esgt6DxO2TnD3o1oqg7erj4NpRpACMTMoQyP2KJZ1h8G90vHNgwStfPmZWiSZ6\n\tMED4ucNK8y8hG82S22V4IZhoWe5kQmFdlgTJ59ujHDPKj1ao1uthF5mDouuLtzQiOclre2wWmqK8B\n\t50J2f8GKWRq0MP8Jl66sTD8tyA0Kc8Oz5RzbdXVCs5AiWAbEQqjxTczlpKy5tD3+IxHfGmPWHCtU7\n\tvNiYbZ5o/OFSUU30Mux5pkncuNadkz2Gb49vXpC3L8sNKarNIXeRfbwLaj1W3IwFwwHh0CGSXZzWh\n\tvVpLf22Wfjhavdw2fA5Q==;", "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version:\n\tReferences:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Content-Type:Sender\n\t:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To:\n\tResent-Cc:Resent-Message-ID; bh=Tf+OtFyVX64LUnXkiI23V6ewhmeW6dbdRWL6ZKcORDw=;\n\tt=1669111858; x=1670321458; b=jh1a9b6V4Kd4vJD/s1Idm5kGQUMiQHf/eHCXLq/OG8KfFCI\n\tmbOZ1VFE5du9nssrVn/hMtxRz+Jtu4OVGhDGALpjRkflWw6CXMaBFutQoE9d70dDpoAeZw85aQMcD\n\tuHCeVw5Md8HSSmEabOYYjnDvL52TWR1nFYGq+yUtRoBdQCNFMoBuq8xVoCMVl6yEzu9gOYCnXM0mj\n\tdzA2IAnyMh9q52X29yqUwWNPnldNKdGLhJjfXjUJHixfNhbDSRh+13kCHUvqIBDGLuQKVv9V7BNqE\n\tLcFleMEf8reBUv9SnFxm6x2Kv96eaqLufV52v0z9uR55VxWtbO7iw8t7BPJs2Tzg==;" ], "From": "benjamin@sipsolutions.net", "To": "linux-um@lists.infradead.org", "Cc": "Benjamin Berg <benjamin@sipsolutions.net>", "Subject": "[PATCH v2 05/28] um: Make errors to stop ptraced child fatal during\n startup", "Date": "Tue, 22 Nov 2022 11:07:36 +0100", "Message-Id": "<20221122100759.208290-6-benjamin@sipsolutions.net>", "X-Mailer": "git-send-email 2.38.1", "In-Reply-To": "<20221122100759.208290-1-benjamin@sipsolutions.net>", "References": "<20221122100759.208290-1-benjamin@sipsolutions.net>", "MIME-Version": "1.0", "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ", "X-CRM114-CacheID": "sfid-20221122_021058_849497_F18DA8A1 ", "X-CRM114-Status": "GOOD ( 14.31 )", "X-Spam-Score": "-0.2 (/)", "X-Spam-Report": "Spam detection software,\n running on the system \"bombadil.infradead.org\",\n has NOT identified this incoming email as spam. The original\n message has been attached to this so you can view it or label\n similar future email. If you have any questions, see\n the administrator of that system for details.\n Content preview: From: Benjamin Berg <benjamin@sipsolutions.net> For the\n detection\n code to check whether SYSEMU_SINGLESTEP works correctly we needed some\n error\n cases while stopping to be non-fatal. However,\n at this point stop_ptraced_child\n must always succeed, and [...]\n Content analysis details: (-0.2 points, 5.0 required)\n pts rule name description\n ---- ----------------------\n --------------------------------------------------\n -0.0 SPF_PASS SPF: sender matches SPF record\n -0.0 SPF_HELO_PASS SPF: HELO matches SPF record\n -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n author's domain\n -0.1 DKIM_VALID Message has at least one valid DKIM or DK\n signature\n 0.1 DKIM_SIGNED Message has a DKIM or DK signature,\n not necessarily\n valid\n -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from\n envelope-from domain", "X-BeenThere": "linux-um@lists.infradead.org", "X-Mailman-Version": "2.1.34", "Precedence": "list", "List-Id": "<linux-um.lists.infradead.org>", "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/linux-um>,\n <mailto:linux-um-request@lists.infradead.org?subject=unsubscribe>", "List-Archive": "<http://lists.infradead.org/pipermail/linux-um/>", "List-Post": "<mailto:linux-um@lists.infradead.org>", "List-Help": "<mailto:linux-um-request@lists.infradead.org?subject=help>", "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/linux-um>,\n <mailto:linux-um-request@lists.infradead.org?subject=subscribe>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Sender": "\"linux-um\" <linux-um-bounces@lists.infradead.org>", "Errors-To": "linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org" }, "content": "From: Benjamin Berg <benjamin@sipsolutions.net>\n\nFor the detection code to check whether SYSEMU_SINGLESTEP works\ncorrectly we needed some error cases while stopping to be non-fatal.\nHowever, at this point stop_ptraced_child must always succeed, and we\ncan therefore simplify it slightly to exit immediately on error.\n\nSigned-off-by: Benjamin Berg <benjamin@sipsolutions.net>\n---\n arch/um/os-Linux/start_up.c | 41 +++++++++++--------------------------\n 1 file changed, 12 insertions(+), 29 deletions(-)", "diff": "diff --git a/arch/um/os-Linux/start_up.c b/arch/um/os-Linux/start_up.c\nindex 561c08e0cc9c..8b0e98ab842c 100644\n--- a/arch/um/os-Linux/start_up.c\n+++ b/arch/um/os-Linux/start_up.c\n@@ -112,35 +112,20 @@ static int start_ptraced_child(void)\n \treturn pid;\n }\n \n-/* When testing for SYSEMU support, if it is one of the broken versions, we\n- * must just avoid using sysemu, not panic, but only if SYSEMU features are\n- * broken.\n- * So only for SYSEMU features we test mustpanic, while normal host features\n- * must work anyway!\n- */\n-static int stop_ptraced_child(int pid, int exitcode, int mustexit)\n+static void stop_ptraced_child(int pid, int exitcode)\n {\n-\tint status, n, ret = 0;\n+\tint status, n;\n+\n+\tif (ptrace(PTRACE_CONT, pid, 0, 0) < 0)\n+\t\tfatal_perror(\"stop_ptraced_child : ptrace failed\");\n \n-\tif (ptrace(PTRACE_CONT, pid, 0, 0) < 0) {\n-\t\tperror(\"stop_ptraced_child : ptrace failed\");\n-\t\treturn -1;\n-\t}\n \tCATCH_EINTR(n = waitpid(pid, &status, 0));\n \tif (!WIFEXITED(status) || (WEXITSTATUS(status) != exitcode)) {\n \t\tint exit_with = WEXITSTATUS(status);\n-\t\tif (exit_with == 2)\n-\t\t\tnon_fatal(\"check_ptrace : child exited with status 2. \"\n-\t\t\t\t \"\\nDisabling SYSEMU support.\\n\");\n-\t\tnon_fatal(\"check_ptrace : child exited with exitcode %d, while \"\n-\t\t\t \"expecting %d; status 0x%x\\n\", exit_with,\n-\t\t\t exitcode, status);\n-\t\tif (mustexit)\n-\t\t\texit(1);\n-\t\tret = -1;\n+\t\tfatal(\"stop_ptraced_child : child exited with exitcode %d, \"\n+\t\t \"while expecting %d; status 0x%x\\n\", exit_with,\n+\t\t exitcode, status);\n \t}\n-\n-\treturn ret;\n }\n \n static void __init check_sysemu(void)\n@@ -185,16 +170,14 @@ static void __init check_sysemu(void)\n \t\t\tgoto fail;\n \t\t}\n \t}\n-\tif (stop_ptraced_child(pid, 0, 0) < 0)\n-\t\tgoto fail_stopped;\n+\tstop_ptraced_child(pid, 0);\n \n \tos_info(\"OK\\n\");\n \n \treturn;\n \n fail:\n-\tstop_ptraced_child(pid, 1, 0);\n-fail_stopped:\n+\tstop_ptraced_child(pid, 1);\n \tfatal(\"missing\\n\");\n }\n \n@@ -233,7 +216,7 @@ static void __init check_ptrace(void)\n \t\t\tbreak;\n \t\t}\n \t}\n-\tstop_ptraced_child(pid, 0, 1);\n+\tstop_ptraced_child(pid, 0);\n \tos_info(\"OK\\n\");\n \tcheck_sysemu();\n }\n@@ -312,7 +295,7 @@ void __init os_early_checks(void)\n \tpid = start_ptraced_child();\n \tif (init_pid_registers(pid))\n \t\tfatal(\"Failed to initialize default registers\");\n-\tstop_ptraced_child(pid, 1, 1);\n+\tstop_ptraced_child(pid, 1);\n }\n \n int __init parse_iomem(char *str, int *add)\n", "prefixes": [ "v2", "05/28" ] }