From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755014AbbHLOmn (ORCPT ); Wed, 12 Aug 2015 10:42:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38453 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752588AbbHLOmm (ORCPT ); Wed, 12 Aug 2015 10:42:42 -0400 Date: Wed, 12 Aug 2015 16:40:25 +0200 From: Oleg Nesterov To: "Eric W. Biederman" Cc: "Kirill A. Shutemov" , Andrew Morton , Kees Cook , David Howells , linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , "Kirill A. Shutemov" , Rik van Riel , Vladimir Davydov , Ricky Zhou , Julien Tinnes Subject: Re: [PATCH] user_ns: use correct check for single-threadedness Message-ID: <20150812144025.GA11979@redhat.com> References: <20150728171500.GA2871@www.outflux.net> <20150728143504.5aa996ba5955522a19c2d5f1@linux-foundation.org> <20150728221111.GA23391@node.dhcp.inet.fi> <20150805172356.GA20490@redhat.com> <87wpx9sjhq.fsf@x220.int.ebiederm.org> <87614tr2jd.fsf@x220.int.ebiederm.org> <20150806130629.GA4728@redhat.com> <20150806134426.GA6843@redhat.com> <87egj9cnk3.fsf@x220.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87egj9cnk3.fsf@x220.int.ebiederm.org> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/11, Eric W. Biederman wrote: > > Oleg Nesterov writes: > > >> Then why we can't simply check thread_group_empty() == T ? Why should we > >> worry about CLONE_SIGHAND at all? > > > > The same for clone() actually... I forgot why we decided to check > > CLONE_SIGHAND, iirc I suggested CLONE_THREAD initially then we switched > > to CLONE_SIGHAND "just in case", to make it as strict as possible. > > I do agree that making the test be for CLONE_THREAD is safe, makes > sense, and is less confusing than what we have now.x Good, > > How about the patch below? > > > > (note that the "or parent" part of the comment is wrong in any case). > > It was correct. Yes, I know, > You failed to removed it when you removed CLONE_PARENT > from that test. Cough... it was you ;) 1f7f4dde5c945f41a7abc2285be43d918029ecc5 "fork: Allow CLONE_PARENT after setns(CLONE_NEWPID)". Oleg.