Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759927AbZFXOXJ (ORCPT ); Wed, 24 Jun 2009 10:23:09 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752795AbZFXOXD (ORCPT ); Wed, 24 Jun 2009 10:23:03 -0400 Received: from tundra.namei.org ([65.99.196.166]:53157 "EHLO tundra.namei.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752456AbZFXOXB (ORCPT ); Wed, 24 Jun 2009 10:23:01 -0400 Date: Thu, 25 Jun 2009 00:21:57 +1000 (EST) From: James Morris To: "Serge E. Hallyn" cc: Oleg Nesterov , Andrew Morton , Christoph Hellwig , Ingo Molnar , Chris Wright , Roland McGrath , linux-kernel@vger.kernel.org, Al Viro , linux-security-module@vger.kernel.org Subject: Re: [PATCH 1/1] mm_for_maps: simplify, use ptrace_may_access() In-Reply-To: <20090624030627.GA6459@us.ibm.com> Message-ID: References: <20090507085742.GB3036@sequoia.sous-sol.org> <20090507090459.GE19133@elte.hu> <20090507092009.GC3036@sequoia.sous-sol.org> <20090507102015.GB8901@elte.hu> <20090623141451.GA8133@redhat.com> <20090623174918.GA24430@infradead.org> <20090623192451.GA27853@redhat.com> <20090623192532.GB27853@redhat.com> <20090624030627.GA6459@us.ibm.com> User-Agent: Alpine 2.00 (LRH 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1222 Lines: 37 On Tue, 23 Jun 2009, Serge E. Hallyn wrote: > Quoting Oleg Nesterov (oleg@redhat.com): > > It would be nice to kill __ptrace_may_access(). It requires task_lock(), > > but this lock is only needed to read mm->flags in the middle. > > > > Convert mm_for_maps() to use ptrace_may_access(), this also simplifies > > the code a little bit. > > > > Also, we do not need to take ->mmap_sem in advance. In fact I think > > mm_for_maps() should not play with ->mmap_sem at all, the caller should > > take this lock. > > Yeah I think that makes sense. > > > With or without this patch, without ->cred_guard_mutex held we can race > > with exec() and get the new ->mm but check old creds. > > > > Signed-off-by: Oleg Nesterov > > reasoning on the security check also makes sense. > > Reviewed-by: Serge Hallyn Applied to git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6#next -- James Morris -- 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/