From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754034AbdJaXqk (ORCPT ); Tue, 31 Oct 2017 19:46:40 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:43407 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753990AbdJaXqj (ORCPT ); Tue, 31 Oct 2017 19:46:39 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: Christian Brauner Cc: linux-kernel@vger.kernel.org, serge@hallyn.com, tycho@tycho.ws, Linux Containers References: <20171024220441.10235-1-christian.brauner@ubuntu.com> <20171024220441.10235-2-christian.brauner@ubuntu.com> Date: Tue, 31 Oct 2017 18:46:32 -0500 In-Reply-To: <20171024220441.10235-2-christian.brauner@ubuntu.com> (Christian Brauner's message of "Wed, 25 Oct 2017 00:04:41 +0200") Message-ID: <871sliubhj.fsf_-_@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1e9gEu-0005Zy-GW;;;mid=<871sliubhj.fsf_-_@xmission.com>;;;hst=in02.mta.xmission.com;;;ip=174.19.78.123;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX19uhYGOuczE97FD4pg+bb0Sx55WJ90LNSU= X-SA-Exim-Connect-IP: 174.19.78.123 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.0 TVD_RCVD_IP Message was received from an IP address * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.4263] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa01 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa01 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: *;Christian Brauner X-Spam-Relay-Country: X-Spam-Timing: total 373 ms - load_scoreonly_sql: 0.06 (0.0%), signal_user_changed: 2.9 (0.8%), b_tie_ro: 1.94 (0.5%), parse: 1.18 (0.3%), extract_message_metadata: 3.8 (1.0%), get_uri_detail_list: 1.20 (0.3%), tests_pri_-1000: 6 (1.7%), tests_pri_-950: 2.2 (0.6%), tests_pri_-900: 1.62 (0.4%), tests_pri_-400: 24 (6.4%), check_bayes: 22 (5.9%), b_tokenize: 8 (2.1%), b_tok_get_all: 6 (1.5%), b_comp_prob: 3.3 (0.9%), b_tok_touch_all: 2.2 (0.6%), b_finish: 0.86 (0.2%), tests_pri_0: 301 (80.9%), check_dkim_signature: 0.83 (0.2%), check_dkim_adsp: 4.4 (1.2%), tests_pri_500: 7 (2.0%), rewrite_mail: 0.00 (0.0%) Subject: [PATCH 0/5] userns: bump idmap limits, fixes & tweaks X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Christian I have looked through your code and I have found one real issue and of things I want to twak The real issue is reading nr_extents multiple times when reading a map. That can introduce races that will allow walking past the end of the array, if the first read is 0 but the second read is > 5. I have also found a couple of tweaks that look like they are worth implementing. As all of these are very small and very straight forward I have tested these and applied them all to my for-next branch Eric W. Biederman (5): userns: Don't special case a count of 0 userns: Simplify the user and group mapping functions userns: Don't read extents twice in m_start userns: Make map_id_down a wrapper for map_id_range_down userns: Simplify insert_extent kernel/user_namespace.c | 159 ++++++++++++++++-------------------------------- 1 file changed, 51 insertions(+), 108 deletions(-)