From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753496AbbG1SCW (ORCPT ); Tue, 28 Jul 2015 14:02:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46798 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752635AbbG1SCV (ORCPT ); Tue, 28 Jul 2015 14:02:21 -0400 Message-ID: <55B7C3AA.8070608@redhat.com> Date: Tue, 28 Jul 2015 14:02:18 -0400 From: Rik van Riel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Kees Cook , "Eric W. Biederman" CC: Oleg Nesterov , David Howells , linux-kernel@vger.kernel.org, Andrew Morton , Peter Zijlstra , Ingo Molnar , "Kirill A. Shutemov" , Vladimir Davydov , Ricky Zhou , Julien Tinnes Subject: Re: [PATCH] user_ns: use correct check for single-threadedness References: <20150728171500.GA2871@www.outflux.net> In-Reply-To: <20150728171500.GA2871@www.outflux.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/28/2015 01:15 PM, Kees Cook wrote: > From: Ricky Zhou > > Checking mm_users > 1 does not mean a process is multithreaded. For > example, reading /proc/PID/maps temporarily increments mm_users, allowing > other processes to (accidentally) interfere with unshare() calls. > > This fixes observed failures of unshare(CLONE_NEWUSER) incorrectly > returning EINVAL if another processes happened to be simultaneously > reading the maps file. > > Signed-off-by: Ricky Zhou > Signed-off-by: Kees Cook > Cc: stable@vger.kernel.org Reviewed-by: Rik van Riel