Bug 13997

Summary: [jail] [patch] RLIMIT_NPROC works unadequately for jails
Product: Base System Reporter: abb <abb>
Component: kernAssignee: Robert Watson <rwatson>
Status: Closed FIXED    
Severity: Affects Only Me CC: eugen
Priority: Normal    
Version: 4.0-CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description abb 1999-09-27 17:20:01 UTC
 The fork() syscall checks RLIMIT_NPROC resource limit using system-wide
 table `uihashtbl'. So limitation on number of running processes will work
 unadequately if processes run in different jails but have equal uids.

Fix: Create private `uihashtbl' for each jail.
How-To-Repeat: 
 Run two shells with equal uids (not root) in different jails with
 RLIMIT_NPROC set to 5. Invoke 3 subshells in one jail. Now it is
 impossible to run any subprocess in shell in another jail because
 fork fails.
Comment 1 Sheldon Hearn freebsd_committer freebsd_triage 1999-09-27 17:25:27 UTC
Responsible Changed
From-To: freebsd-bugs->phk

Over to Mr Jail. 
Comment 2 Poul-Henning Kamp freebsd_committer freebsd_triage 2001-11-16 23:02:12 UTC
Responsible Changed
From-To: phk->rwatson

I think Rwatson is better suited to judge this one.
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2005-10-24 02:53:55 UTC
State Changed
From-To: open->suspended

Mark as 'suspended' since this does not seem as though it is being 
actively worked on.
Comment 4 Eugene Grosbein freebsd_committer freebsd_triage 2017-08-09 18:02:13 UTC
It seems this was reopened by error.