From owner-cvs-all@FreeBSD.ORG Sun Feb 13 16:49:47 2005 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2D92116A4CE; Sun, 13 Feb 2005 16:49:47 +0000 (GMT) Received: from www.portaone.com (web.portaone.com [195.70.151.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5059043D1F; Sun, 13 Feb 2005 16:49:46 +0000 (GMT) (envelope-from sobomax@portaone.com) Received: from [192.168.1.26] (SIRIUS-ats227-UTC.ukrtel.net [195.5.25.154]) (authenticated bits=0) by www.portaone.com (8.12.11/8.12.11) with ESMTP id j1DGng52082939 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 13 Feb 2005 17:49:43 +0100 (CET) (envelope-from sobomax@portaone.com) Message-ID: <420F851E.2090108@portaone.com> Date: Sun, 13 Feb 2005 18:49:34 +0200 From: Maxim Sobolev Organization: Porta Software Ltd User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Robert Watson References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/685/Wed Jan 26 10:08:24 2005 clamav-milter version 0.80j on www.portaone.com X-Virus-Status: Clean cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern kern_prot.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2005 16:49:47 -0000 Robert Watson wrote: > On Fri, 11 Feb 2005, Maxim Sobolev wrote: > > >>>Bypassing the SIGTHR checks for setuid processes, just seems like a bad >>>idea -- that's precisely the sort of internal process functionality that >>>shouldn't be exposed to potentially malicious attackers. Maybe what's >>>needed is some new logic that says it's OK for SIGTHR to be used between >>>processes if they have the same process linux thread leader? >> >>Isn't SIGTHR(32) just ignored by any usual process out there? So that it >>should't create any new problems, unless process actualy knowingly uses >>this signal in which case it should know what it does. Am I missing >>something? > > > Signals are used in four kinds of ways: > > - Notification of exceptional error conditions in thread instruction flow, > such as divide by zero, floating point problems, illegal > instruction, page fault, etc. > - Notification of thread/process events for the management of process > state, such as asynchronous signals for I/O, timers, pipe errors, thread > events. > - Notification of system conditions and events, such as exceeding CPU > quotas, death of child process, tty state changes, etc. > - Inter-process communication, such as SIGQUIT, SIGUSR1, and so on. > > In general, the first two categories of signals are ones that programs > have semantic expectations for -- they're signals they may catch in order > to perform error processing, instruction cleanup, user space paging, > wakeups, I/O callbacks, etc. And they're ones where you typically don't > want them getting delivered in ways that violate program assumptions, as > it can result in security vulnerabilities. I.e., it's a odd property of > the UNIX signal semantics that they can be delivered from other processes, > and they're often handled poorly. The additional protection is provided > so that in the event that the implementation of handling the signals is > poor when the "signals should never be generated", we try to avoid > privilege escalation. SIGTHR is definitely in this category -- if you > have a threaded setuid app, you don't want external unprivileged > applications messing with its thread state, right? This is the theory > under which the other signals are also blocked for setuid processes: you > don't want attacking processes to frob the I/O state, and so on. I see. I've just committed a change which solves this problem by allowing emulation layers to bypass FreeBSD-specific security checks during signal delivery. This makes sense since emulation layers can have different meanings for signals and/or different security restrictions. -Maxim