From owner-svn-src-all@FreeBSD.ORG Fri Sep 20 17:14:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5B8D257F; Fri, 20 Sep 2013 17:14:48 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-we0-x22e.google.com (mail-we0-x22e.google.com [IPv6:2a00:1450:400c:c03::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8192F245D; Fri, 20 Sep 2013 17:14:47 +0000 (UTC) Received: by mail-we0-f174.google.com with SMTP id q58so779862wes.5 for ; Fri, 20 Sep 2013 10:14:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=QLnog2SRKXV8M5uwbKl8o7/6Wj6b8PDi6Q6j4I401jU=; b=uJsHNvGH6V1u+eYChwGb7CfJab8wm+37JtYAC7BLO6OG3naYIPPSMSdUaU9At101co /AMjcDr5lR9KV+L4DwbL6ZwvDarLTSCGbcwqvPWcNOc+QYmQFg6BMS9HKXlF1ouEXZwl A0hJbTOYrg5U8CcMWDjPn6YhKVvBnHgU0LBS4/IFUKLtiIbcDwa0IHH22ab0NEAbcn3/ qURfcezKlQxzq40Wx/g3cG0q2DVwoJ7KGeqTTZ4q9WNopXBbypsCY7jcEK024TFWGQ4J xSEvHbYMNNsba8ev1LqtfH5oBxUnpd74jleMtpaI2DlN5STzH9RNYEGiKpu6NMC2Hvpx 54aA== MIME-Version: 1.0 X-Received: by 10.180.98.105 with SMTP id eh9mr3599461wib.56.1379697285845; Fri, 20 Sep 2013 10:14:45 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.216.62.5 with HTTP; Fri, 20 Sep 2013 10:14:45 -0700 (PDT) In-Reply-To: <201309201605.r8KG59qQ063892@svn.freebsd.org> References: <201309201605.r8KG59qQ063892@svn.freebsd.org> Date: Fri, 20 Sep 2013 21:14:45 +0400 X-Google-Sender-Auth: YuR0OXPJP6enOI3ByoZcNGdVShc Message-ID: Subject: Re: svn commit: r255731 - head/usr.bin/protect From: Sergey Kandaurov To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Sep 2013 17:14:48 -0000 On 20 September 2013 20:05, John Baldwin wrote: > Author: jhb > Date: Fri Sep 20 16:05:09 2013 > New Revision: 255731 > URL: http://svnweb.freebsd.org/changeset/base/255731 > > Log: > Correct stale comments. > > Approved by: re (joel) > > Modified: > head/usr.bin/protect/protect.1 > > Modified: head/usr.bin/protect/protect.1 > ============================================================================== > --- head/usr.bin/protect/protect.1 Fri Sep 20 15:57:50 2013 (r255730) > +++ head/usr.bin/protect/protect.1 Fri Sep 20 16:05:09 2013 (r255731) > @@ -83,9 +83,7 @@ Remove protection from all current and f > .Pp > .Dl "protect -cdi -p 1" > .Sh SEE ALSO > -.Xr pprotect 2 > +.Xr procctl 2 > .Sh BUGS > If you protect a runaway process that allocates all memory the system will > deadlock. > -.Pp > -Inheritance of the protected state is not yet implemented. I wanted to report you about this stale sentence, but after looking at the change once more now I think it is still relevant. + if (p1->p_flag2 & P2_INHERIT_PROTECTED) { + p2->p_flag |= P_PROTECTED; + p2->p_flag2 |= P2_INHERIT_PROTECTED; + } + The protected state is not really inherited in terms that it is rather explicitly conditionally enabled. Consider the following process state: p1->p_flag != P_PROTECTED p1->p_flag2 == P2_INHERIT_PROTECTED Ok, this is not an option currently because protect_setchild() resets both flags on PPROT_CLEAR. Anyway the following looks more sane to me: if (p1->p_flag2 & P2_INHERIT_PROTECTED) { p2->p_flag |= p1->p_flag & P_PROTECTED; p2->p_flag2 |= P2_INHERIT_PROTECTED; } -- wbr, pluknet