Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754844AbcJGFzJ (ORCPT ); Fri, 7 Oct 2016 01:55:09 -0400 Received: from mail-db5eur01on0135.outbound.protection.outlook.com ([104.47.2.135]:18880 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750974AbcJGFzH (ORCPT ); Fri, 7 Oct 2016 01:55:07 -0400 X-Greylist: delayed 22505 seconds by postgrey-1.27 at vger.kernel.org; Fri, 07 Oct 2016 01:55:06 EDT Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=avagin@virtuozzo.com; Date: Thu, 6 Oct 2016 10:51:47 -0700 From: Andrei Vagin To: "Eric W. Biederman" CC: , , , Serge Hallyn , Kees Cook Subject: Re: [PATCH 0/2 v2] userns: show current values of user namespace counters Message-ID: <20161006175146.GA25935@outlook.office365.com> References: <1471291822-539-1-git-send-email-avagin@openvz.org> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Disposition: inline In-Reply-To: <1471291822-539-1-git-send-email-avagin@openvz.org> User-Agent: Mutt/1.7.0 (2016-08-17) X-Originating-IP: [162.246.95.100] X-ClientProxiedBy: YTXPR01CA0076.CANPRD01.PROD.OUTLOOK.COM (10.165.216.44) To VI1PR0801MB1983.eurprd08.prod.outlook.com (10.173.74.16) X-MS-Office365-Filtering-Correlation-Id: 568227af-aec8-4d34-362f-08d3ee117ad3 X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB1983;2:o6MPvx9KimVlj1ixk1lI446bwbx7WDmmqfRrDozAZsbRZusmU/K43uTH5tRkS4hz0mpr4RCWO2iig6AfcLJEtPVBjP3Loah1qitQfeLyHBphXWai3cel6S2N/YKC3/SQ9VMxGctPStXary4tUCfAco6O6ukMKd4J2x05fqyjbkZE/E+PeCqAPIuv4v+roW3l;3:WTCBY43H0jKGbTDfJFymoQq1qPFLCV1bjxLHcgXe+i6+El1/cKi0+/MlLwIPSil13kTCiEGJFefbAKoK9ypbrxz7fcZXH7vHIf8kjVWdE17+utIZA03QoAQqKQwfnFGM X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0801MB1983; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB1983;25:f+43BysqKkh4W6hYQNZJMpG3mVKjb6CSLN40CU+N+8B2OKKG+9P7g4AYPXer33w11X49+qmZnerOgLTEbJUSUH0f0yYNtRIQQLqcWJvaWTaX31cMOlYeARs1g8qQGLDUK2Zd8W5T2ZeesmWOIa93qX/Lqz/tZJGpFzWpW3x/GxFPa+UyicnpKjDr4MAukRXhFp27pZIkx+cp5Z4SzdnTKk/ohuUwIPu0zVs0RIqO3GrmqFwc+uATXqX98HfJOeL3ni3fM/cUWHYngrGFJhHmETZrNtFAnK56XU8m/iCCpTdsOawhmhKm2s9OqvCnfMt1YoXstT8/SGBpjJHF4R1csv++cXkjgNIJDbcyaOEfYXqqaXWDBFc825guYCdNDTV/dqb/1QVD+jHCdtKOPk6YyQ+x0LDXPm3WGkIYPCAhfIHMqGAnuOMX+4aksUOJjWd2SEaof7SYH8Nz/uv3RjZ8HW/s+NvOW+PVYkQshdf32MJBz+MVyk4V++PjqNKRXuVDE9bGYmUuRiLpMSCEMtJhobafL7nXPFVUiFsenUwEhaJkXVC4pBOJGv8fViDwrwqv2EeXOLblxpwItfrwLaX+FwUf67t+fuKaFxkqqULWSa6HkT68FxlvGFJI1yY1xxDqZATfy1TSct1KTjm70R2YdQI/w6tod2lC5KgJpUDs5kyeeN/hG3iA5VBJoVgLyejNlehVKEalnJUH10ZGO1il55aLwdR/73UTDjYwHfSNotblUJGXJSxSDrgQ5IS0xo9enMzhuQtJhyYFb+O18cl6SwPYSv0Wa3auS7BBFUp4VM1xkIdb4D1WcScE0XwU6Q3P8sQISMU195wTkfCgQn11/QFH8BGJoN+tgFnqNXMcTK+oxXYNojX1nSqPnjEVocobwpCfhaV1EIXYECsqjS1ASw== X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB1983;31:JDz5aVG8XxRWVXHfOJjBROk/uhRz8Vtdq3na3//N4un1JQZmKzF+wIhIQWz6vjV2f0CEjlBXaY5YxJMUlqTpx+gqW0wB7MWPk+KZrX4eqm6uzr66aXZzKuuXKbJ1kVwteUW5yB/wnIVAj90wLMjsrmN749/iltH90R/CoqyYVe7HQMDkIZYBQIPj1IfaTKB5XK6nAP6xF9kic6yqf4ZcDpg0MZOdhcr1QB0VgNvvO9Ljv+XMr+RG3usvK3S1HVhm;4:p34Y6dFDhF4fwbamMInSqXKVYNZAOOG0u2thRcSQPFS6cs6Fma7pDMS/7Ox2K0+KyEdISeFjko2fVXw0G1wNfcxkdCU+QpH1hzi86QzoD37+mRvwDNZVag+Oep6ZtSD1rzrHeHGMYezXB8Gsoc7WtEE/IqdO2QpANLsRrtvft88jh39M5Icz14RYd+xSjCHwzrt6OHoB+6WvpTebH11pHj+ChDKLQ7LP69xDZw/9GTU1ZynFMXIxhczkPOQQgKNIM+6cNp+4em6jQ4+qiIkKurwTwIc+6r/Ix36Fk+j4EZ1MFJeyZQfqFhKJdXw4dHuZl9cGGgAk0W37XHCQxXp8ohaCbIQvRyA8xRMdZX0h1zlCu2keypvnwOs6yjdAVoAWOETBmPVHsYrLN8IDwOQ6QhaMmFCOYpB1HA6IoDErzSRAm5BLxSCXHgZeOoAKbwqrrNw0aDvOZpWQplJ4fZffQVHSJUFdf2vJgj5GunVwg77gvgdIFQMMDzGsZHIyaTix X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(84791874153150)(198206253151910); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6043046)(6042046);SRVR:VI1PR0801MB1983;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0801MB1983; X-Forefront-PRVS: 00872B689F X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(7916002)(189002)(76104003)(199003)(24454002)(101416001)(8676002)(81166006)(81156014)(305945005)(7846002)(2950100002)(23686003)(9686002)(86362001)(68736007)(66066001)(189998001)(42186005)(50466002)(83506001)(92566002)(6916009)(5660300001)(110136003)(69596002)(6666003)(1076002)(7736002)(33656002)(4001350100001)(53416004)(76176999)(50986999)(2906002)(586003)(3846002)(97736004)(54356999)(106356001)(4326007)(77096005)(6116002)(19580395003)(105586002)(15975445007)(19580405001)(47776003)(7099028)(18370500001)(26326002);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR0801MB1983;H:outlook.office365.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?koi8-r?Q?1;VI1PR0801MB1983;23:jGP0rcrk2iwu6zMe2aLIgPZwuJg/kWCHAFY+vs1Jp?= =?koi8-r?Q?XZf9wAzQG7qFWIMp7LX/cE0LYnBTE1UeoEclyHF12gT+6ky7rCjhMH+lkYJxDY?= =?koi8-r?Q?T/Jrd7Hdya20TTppe76kMZXN1VocNzbannxdq01BU3DbRS5R2mPfFUAjWQbKgX?= =?koi8-r?Q?l20zrbOG6PrVBDlFxPhC0JuqaPCp8JBoY9K2srvoumTQFLWyVs0XbsGnpI1ziU?= =?koi8-r?Q?Z2dAqXIoeaKDe/5JsvYMS286RkBDIb+aPpw81M7XhdyBJSA8tkmJYIm7GXTWsC?= =?koi8-r?Q?OnZQw4u1uyyLklPzf088wcTxYFnA+KCF2nLCfQlpVlhMMz/iqPSUJQXg0634F3?= =?koi8-r?Q?vOC6J0qUnvFpnskIACyVO6dILA/NCWEpxJbxYMezP0IT6A+d2YQd5eonV1ca7+?= =?koi8-r?Q?RDoA+KcKdZlrR6dg9xTKgg1Rmmhgeek1OjCuhYr/t8Bda+hmL27Z8yBjI6/bSf?= =?koi8-r?Q?2T/fJHl+P2e2+mIulNxUTgV8D28Ew2XmPsrg8jbDiCw21pra/ccFCitkmv4c4s?= =?koi8-r?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23:stNnRPQDq8JQTh+2FRHccJXwBlUrnWvPnsEwFEx8TfW58NBehjTBrE4zdcELkr35XBkrBLrkxlWAmwambxG5pcHY/aU38I2gzwK/mlln2gEi2Fhm3//TxjOyA2tQ+pOF6eqVmVTiCpdBycFQ86f2NFm3TMDtJsxqaL7NF+vmRk15JFMZ3LA3QFcGcuiLOBPt X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2016 17:52:01.7076 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1983 X-OriginatorOrg: virtuozzo.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2227 Lines: 62 Hello Eric, What do you think about this series? It should be useful to know current usage for user counters. Thanks, Andrei On Mon, Aug 15, 2016 at 01:10:20PM -0700, Andrei Vagin wrote: > Recently Eric added user namespace counters. User namespace counters is > a feature that allows to limit the number of various kernel objects a > user can create. These limits are set via /proc/sys/user/ sysctls on a > per user namespace basis and are applicable to all users in that > namespace. > > User namespace counters are not in the upstream tree yet, > you can find them in Eric's tree: > https://git.kernel.org/cgit/linux/kernel/git/ebiederm/user-namespace.git/log/?h=for-testing > > This patch adds /proc//userns_counts files to provide current usage > of user namespace counters. > > > cat /proc/813/userns_counts > user_namespaces 101000 1 > pid_namespaces 101000 1 > ipc_namespaces 101000 4 > net_namespaces 101000 2 > mnt_namespaces 101000 5 > mnt_namespaces 100000 1 > > The meanings of the columns are as follows, from left to right: > > Name Object name > UID User ID > Usage Current usage > > The full documentation is in the second patch. > > v2: - describe this file in Documentation/filesystems/proc.txt > - move and rename into /proc//userns_counts > > Cc: Serge Hallyn > Cc: Kees Cook > Cc: "Eric W. Biederman" > Signed-off-by: Andrei Vagin > > Andrei Vagin (1): > kernel: show current values of user namespace counters > > Kirill Kolyshkin (1): > Documentation: describe /proc//userns_counts > > Documentation/filesystems/proc.txt | 30 +++++++++++ > fs/proc/array.c | 55 ++++++++++++++++++++ > fs/proc/base.c | 1 + > fs/proc/internal.h | 1 + > include/linux/user_namespace.h | 8 +++ > kernel/ucount.c | 102 +++++++++++++++++++++++++++++++++++++ > 6 files changed, 197 insertions(+) > > -- > 2.5.5