Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751615AbaANUC0 (ORCPT ); Tue, 14 Jan 2014 15:02:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:22750 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751472AbaANUCX (ORCPT ); Tue, 14 Jan 2014 15:02:23 -0500 Date: Tue, 14 Jan 2014 21:02:40 +0100 From: Oleg Nesterov To: Will Drewry Cc: linux-kernel@vger.kernel.org, nschichan@freebox.fr, keescook@chromium.org, james.l.morris@oracle.com, akpm@linux-foundation.org, holt@sgi.com, viro@zeniv.linux.org.uk Subject: Re: [PATCH 2/2] sys, seccomp: add PR_SECCOMP_EXT and SECCOMP_EXT_ACT_TSYNC Message-ID: <20140114200240.GA801@redhat.com> References: <1389645028-17157-1-git-send-email-wad@chromium.org> <1389645028-17157-2-git-send-email-wad@chromium.org> <20140114192118.GA31411@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140114192118.GA31411@redhat.com> 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 01/14, Oleg Nesterov wrote: > > > + get_seccomp_filter(caller); > > + /* > > + * Drop the task reference to the shared ancestor since > > + * current's path will hold a reference. (This also > > + * allows a put before the assignment.) > > + */ > > + put_seccomp_filter(thread); > > + thread->seccomp.filter = caller->seccomp.filter; > > As I said, I do not understand this patch yet, but this looks suspicious. > > Why we can't race with this thread doing clone(CLONE_THREAD) ? We do > not the the new thread yet, but its ->seccomp can be already copied > by copy_process(), no? And it seems that this can obviously race with seccomp_attach_filter() called by this "thread". Oleg. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/