From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 54725 invoked by alias); 25 Aug 2019 22:38:39 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 54717 invoked by uid 89); 25 Aug 2019 22:38:38 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_1,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=temporarily, fair, our X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 25 Aug 2019 22:38:37 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5F6CE307D91E; Sun, 25 Aug 2019 22:38:36 +0000 (UTC) Received: from localhost (unused-10-15-17-196.yyz.redhat.com [10.15.17.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id 329B6600C4; Sun, 25 Aug 2019 22:38:36 +0000 (UTC) From: Sergio Durigan Junior To: Eli Zaretskii Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Improve ptrace-error detection on Linux targets References: <20190819032918.3536-1-sergiodj@redhat.com> <835zmtmdhk.fsf@gnu.org> Date: Sun, 25 Aug 2019 22:38:00 -0000 In-Reply-To: <835zmtmdhk.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 19 Aug 2019 17:33:27 +0300") Message-ID: <878srg50r8.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2019-08/txt/msg00572.txt.bz2 On Monday, August 19 2019, Eli Zaretskii wrote: >> From: Sergio Durigan Junior >> Cc: Sergio Durigan Junior >> Date: Sun, 18 Aug 2019 23:29:18 -0400 >> >> +@node Linux kernel @code{ptrace} restrictions > > @-commands in node names are best avoided (here and elsewhere in your > patch). Fixed. >> +The @code{ptrace} system call is used by @value{GDBN} to, among other >> +things, attach to a new or existing inferior in order to start >> +debugging it. > > This sentence should mention Linux, otherwise it's too general. I thought mentioning Linux in the title would be enough. I've modified the sentence to read like this: The @code{ptrace} system call is used by @value{GDBN} on Linux to, among other things... >> +we will expand on how this malfunction can manifest, and how to modify > ^^^^^^^^ > "manifest itself" Fixed. > Also, I see no description of how these problems manifest themselves. > I suggest to show the respective error messages, and also index them, > so that interested readers could find this material quickly. As per our recent discussions in the thread, I changed the patch to actively try to determine the cause of the ptrace failure, and print descriptive messages for each scenario. When it isn't able to detect the root cause, it will print the generic message pointing the user to our documentation. Given this change in the original behaviour, I'm probably going to rewrite this sentence so that it's more clear about what should be expected. >> +@cindex selinux, deny_ptrace > > I suggest to add a @cindex entry for deny_ptrace itself, or maybe > switch the order: > > @cindex deny_ptrace, SELinux Fair enough, I'll add a separate entry for deny_ptrace. >> +If you see anything other than @code{0}, @value{GDBN} can be affected >> +by it. You can temporarily disable the feature by doing: >> + >> +@smallexample >> +# sysctl kernel.yama.ptrace_scope=0 >> +kernel.yama.ptrace_scope = 0 >> +@end smallexample > > I'm guessing this should be done as root, right? If so, I think we > should mention that. Yes, this command should be run as root. I thought that just using "#" vs. "$" in the prompt would suffice, but you're right, I should be more explicit. I'll send a v2 with the fixes soon. Thanks, -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/