real SetProcessClass and SetThreadPriority support

Robert Shearman rob at codeweavers.com
Fri Apr 8 13:29:56 CDT 2005


Robert Reif wrote:

> Robert Shearman wrote:
>
>> Robert Reif wrote:
>>
>>> Are there any plans or is anyone working on mapping Windows
>>> SetProcessClass and SetThreadPriority support to linux process
>>> priorities on kernels that support CAP_SYS_NICE?
>>
>>
>> Mapping Win32 thread priority levels to Linux nice levels is fairly 
>> trivial, but convincing kernel developers to allow unprivileged 
>> user-space programs to control thread priorities is the big problem. 
>> The last time a discussion like this came up, we (Wine developers and 
>> Cedega developers) requested a way of changing a thread's relative 
>> priority within a process (without affecting the overall CPU time the 
>> process gets). This should be a good compromise between meeting 
>> applications' needs and preventing unprivileged applications from 
>> freezing the computer. AFAIK, this hasn't been implemented yet.
>
>
> wineserver would need to be a setuid program but it could set 
> CAP_SYS_NICE at startup and immediately reduce it's privileges back to 
> normal.


There are a number of problems:
1. I don't think that will work yet as the server process needs to have 
the same user ID as the client processes.
2. setuid binaries make sysadmins nervous and would require a security 
audit by us. Yes, they don't need to make it setuid, but then the people 
who do could run their programs as root anyway.
3. setuid programs are a nasty hack that work around limitation in the 
granularity of security in the kernel.
4. This approach won't generalize for other apps on the system that 
might want to control the relative priority of their threads, such as 
MPlayer.

Rob



More information about the wine-devel mailing list