Michael noticed that userns limit for number of time namespaces is missing. Furthermore, time namespace introduced UCOUNT_TIME_NAMESPACES, but didn't introduce an array member in user_table[]. It would make array's initialisation OOB write, but by luck the user_table array has an excessive empty member (all accesses to the array are limited with UCOUNT_COUNTS - so it silently reuses the last free member. Fixes user-visible regression: max_inotify_instances by reason of the missing UCOUNT_ENTRY() has limited max number of namespaces instead of the number of inotify instances.
Unified · Split
| @@ -65,6 +65,12 @@ max_pid_namespaces · 64 unmodified lines | ||
| 65 | 65 | The maximum number of pid namespaces that any user in the current |
| 66 | 66 | user namespace may create. |
| 67 | 67 | |
| 68 | +max_time_namespaces | |
| 69 | +=================== | |
| 70 | + | |
| 71 | + The maximum number of time namespaces that any user in the current | |
| 72 | + user namespace may create. | |
| 73 | + | |
| 68 | 74 | max_user_namespaces |
| 69 | 75 | =================== |
| 70 | 76 | |
| @@ -69,6 +69,7 @@ static struct ctl_table user_table[] = { · 68 unmodified lines | ||
| 69 | 69 | UCOUNT_ENTRY("max_net_namespaces"), |
| 70 | 70 | UCOUNT_ENTRY("max_mnt_namespaces"), |
| 71 | 71 | UCOUNT_ENTRY("max_cgroup_namespaces"), |
| 72 | + UCOUNT_ENTRY("max_time_namespaces"), | |
| 72 | 73 | #ifdef CONFIG_INOTIFY_USER |
| 73 | 74 | UCOUNT_ENTRY("max_inotify_instances"), |
| 74 | 75 | UCOUNT_ENTRY("max_inotify_watches"), |