From owner-svn-src-head@FreeBSD.ORG Tue Feb 28 06:34:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E93D106564A; Tue, 28 Feb 2012 06:34:24 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id 18E398FC12; Tue, 28 Feb 2012 06:34:23 +0000 (UTC) Received: from julian-mac.elischer.org (c-67-180-24-15.hsd1.ca.comcast.net [67.180.24.15]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id q1S6YLPa098788 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 27 Feb 2012 22:34:23 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <4F4C7571.7010407@freebsd.org> Date: Mon, 27 Feb 2012 22:34:25 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.27) Gecko/20120216 Thunderbird/3.1.19 MIME-Version: 1.0 To: Konstantin Belousov References: <201202261425.q1QEPm9g069102@svn.freebsd.org> <20120227082811.GC1363@garage.freebsd.pl> <864nucd5jc.fsf@in138.ua3> <20120227092951.GB55074@deviant.kiev.zoral.com.ua> In-Reply-To: <20120227092951.GB55074@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Mikolaj Golub , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek Subject: Re: svn commit: r232181 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 06:34:24 -0000 On 2/27/12 1:29 AM, Konstantin Belousov wrote: > On Mon, Feb 27, 2012 at 10:49:59AM +0200, Mikolaj Golub wrote: >> On Mon, 27 Feb 2012 09:28:11 +0100 Pawel Jakub Dawidek wrote: >> >> PJD> On Sun, Feb 26, 2012 at 02:25:48PM +0000, Mikolaj Golub wrote: >> >> Author: trociny >> >> Date: Sun Feb 26 14:25:48 2012 >> >> New Revision: 232181 >> >> URL: http://svn.freebsd.org/changeset/base/232181 >> >> >> >> Log: >> >> Add sysctl to retrieve or set umask of another process. >> >> PJD> "set umask of another process"? This seems... weird. What's the purpose >> PJD> of this change? >> >> When we were discussing this with Kostik and Robert, and I asked if it could >> be useful to have the sysctl rw, Kostik described a real situation when he had >> had to change umask of another process: umask had not been set properly on an >> aplication start but it could not be restarted until the end of the day. >> Kostik was able to fix it using gdb but having an easier way looked useful. > kgdb, not gdb. > > It is indeed possible to write a ptrace-based utility that inject a code > payload that would change umask. Since this is very risky but indeed possible, > having the straighforward kernel facility is justified. Why not have a sysctl to change a process' uid, cwd, memory limits, etc. etc. I don't think this belongs in the kernel by default. It's not exactl a call for backout but It's teh next thing short of that. a call for "do you REALLY think we need this particular specific case catered for?" Julian > Patch puts the same restrictions on the caller as ptrace().