Bug 17878

Summary: Jail user can change priority of outside processes
Product: Base System Reporter: sam <sam>
Component: kernAssignee: Robert Watson <rwatson>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 5.0-CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description sam 2000-04-09 14:40:00 UTC
	A user (such as root) in a jail is able to use setpriority() (e.g.,
	through the renice command) to lower the priority level (increase
	the nice value) of a process which lives outside.

Fix: The following patch should correct this. However, I wonder if
	functions such as pfind() should not take another argument which
	would be the curproc value when applicable. It would require changing
	all the pfind() calls in the kernel, but would add an extra
	security. Of course, processes iterators would still have to be
	modified to honor the jail.

	Also, note that real-time priorities may suffer from the same problem.
How-To-Repeat: 
	From within the jail, try

	# renice 5 PID

	where PID is a regular process which lives out of the jail (and thus
	cannot be seen using ps from within the jail).
Comment 1 Ollivier Robert freebsd_committer freebsd_triage 2000-04-11 10:13:57 UTC
Responsible Changed
From-To: freebsd-bugs->phk

jail is Poul-Henning's baby. 
Comment 2 Robert Watson freebsd_committer freebsd_triage 2000-06-04 05:29:10 UTC
Responsible Changed
From-To: phk->rwatson

Applied a patch for this and another jail issue with IPv6.  The applied 
patch is a little bit different -- please check that it meets your needs 
and let me know if/if not so I can close the PR, or apply further changes. 
Thanks!
Comment 3 Robert Watson freebsd_committer freebsd_triage 2000-06-05 19:21:07 UTC
State Changed
From-To: open->closed


Committed changes appear to work correctly in test environments.  Closing 
PR but it can be reopened if there are any further problems.