From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754292AbZEFX2l (ORCPT ); Wed, 6 May 2009 19:28:41 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752196AbZEFX2d (ORCPT ); Wed, 6 May 2009 19:28:33 -0400 Received: from sous-sol.org ([216.99.217.87]:59244 "EHLO sequoia.sous-sol.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751733AbZEFX2c (ORCPT ); Wed, 6 May 2009 19:28:32 -0400 Date: Wed, 6 May 2009 16:27:03 -0700 From: Chris Wright To: Oleg Nesterov Cc: Chris Wright , Andrew Morton , Roland McGrath , linux-kernel@vger.kernel.org, James Morris Subject: Re: [PATCH 3/3] ptrace: do not use task_lock() for attach Message-ID: <20090506232703.GA3036@sequoia.sous-sol.org> References: <20090505224729.GA965@redhat.com> <20090506224650.GZ3036@sequoia.sous-sol.org> <20090506231332.GA3756@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090506231332.GA3756@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 * Oleg Nesterov (oleg@redhat.com) wrote: > But this can happen without this change too? > > - cpu2 takes task_lock(), tracehook_tracer_task() returns NULL because > we are not traced yet. > > - cpu1 does ptrace_attach() and succeds, because cpu2 didn't update sid > yet > > - cpu2 continues, it doesn't check avc_has_perm() (tracer == 0) and > updates sid. > > No? Yes. > Shouldn't selinux_setprocattr() take ->cred_exec_mutex, like we do in > selinux_bprm_set_creds() path? I was looking at the same, seems like it to me. James? thanks, -chris > > Oleg.