From owner-freebsd-questions@freebsd.org Mon Aug 10 18:41:45 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 958543AC1EB for ; Mon, 10 Aug 2020 18:41:45 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.134]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BQPvD3dXtz4gFm for ; Mon, 10 Aug 2020 18:41:44 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([178.5.236.89]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPA (Nemesis) id 1MiJEc-1kbUl0482Q-00fQCv; Mon, 10 Aug 2020 20:41:41 +0200 Date: Mon, 10 Aug 2020 20:41:40 +0200 From: Polytropon To: "Ronald F. Guilmette" Cc: freebsd-questions@freebsd.org Subject: Re: GDB no workie? Permission problem? Message-Id: <20200810204140.62390ec3.freebsd@edvax.de> In-Reply-To: <62605.1597078863@segfault.tristatelogic.com> References: <62605.1597078863@segfault.tristatelogic.com> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:ShhMrYaUx3C6Qo9iVnMvHbA1XDckqI/FxP3s9BXxxzPECSUYV9A e356osK2g8+vG6/mc1250NNzjDla184e7oeiqJHXNdFlU1KunusMdg54ujwGhROlQaNmJIq C0RkcOtYcW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m X-Spamd-Bar: +++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@edvax.de has no SPF policy when checking 212.227.126.134) smtp.mailfrom=freebsd@edvax.de X-Spamd-Result: default: False [3.89 / 15.00]; HAS_REPLYTO(0.00)[freebsd@edvax.de]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; HAS_ORG_HEADER(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; RECEIVED_SPAMHAUS_PBL(0.00)[178.5.236.89:received]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; SUBJECT_ENDS_QUESTION(1.00)[]; ARC_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.10)[0.104]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[edvax.de]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.05)[0.054]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.33)[0.328]; MID_CONTAINS_FROM(1.00)[]; RCVD_IN_DNSWL_NONE(0.00)[212.227.126.134:from]; R_SPF_NA(0.00)[no SPF record]; RWL_MAILSPIKE_POSSIBLE(0.00)[212.227.126.134:from]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Aug 2020 18:41:45 -0000 On Mon, 10 Aug 2020 10:01:03 -0700, Ronald F. Guilmette wrote: > Just ran gdb, which I haven't done for awhile, to find a small > bug in one of my own C programs. > > Set two breakpoints successfully and then tried to r(un) the > program to be debugged. (This was all being done under my > own personal non-priviliged account.) > > Immediately got something very unexpected: > > warning: Could not trace the inferior process. > Error: > warning: ptrace: Operation not permitted > During startup program exited with code 127. > > I su'd to root and tried again, and of course now it works. > > So, um, what the hay? What goes on here? > > I seem to vaguely recall some "security" options being presented > at system install time, and I do believe one of these had to do > with ptrace. So I guess that I must have made the Wrong Choice > with respect to that one. OK. Fine. Now how do I fix that misake > on my part, short of re-installing the whole bloody system? Yes, that seems to be the case here. At installation stage, certain options would have been set in the relevant configuraiton files, but there's noting requiring a re-installation - you can undo those changes with a simple text editor. :-) Check the following files: /boot/loader.conf /etc/sysctl.conf <--- probably this one /etc/rc.conf I'm sure you'll find something related to security restrictions, such as those: security.bsd.unprivileged_read_msgbuf=0 security.bsd.unprivileged_proc_debug=0 security.bsd.see_other_uids=0 As suggested by Yasuhiro Kimura, there are several settings that could have been applied. See the following file to find their names and settings: /usr/libexec/bsdinstall/hardening You can use sysctl interactively, or just edit the files and reboot the system so they take effect. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...