From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756007Ab2CLPTY (ORCPT ); Mon, 12 Mar 2012 11:19:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:30375 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752673Ab2CLPTW (ORCPT ); Mon, 12 Mar 2012 11:19:22 -0400 Date: Mon, 12 Mar 2012 15:34:00 +0100 From: Oleg Nesterov To: Djalal Harouni Cc: linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com, Andrew Morton , Linus Torvalds , Al Viro , Alexey Dobriyan , "Eric W. Biederman" , Vasiliy Kulikov , Kees Cook , Solar Designer , WANG Cong , James Morris , linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org, Alan Cox , Greg KH , Ingo Molnar , Stephen Wilson , "Jason A. Donenfeld" Subject: Re: [PATCH 1/9] exec: add a global execve counter Message-ID: <20120312143400.GA23113@redhat.com> References: <1331421919-15499-1-git-send-email-tixxdz@opendz.org> <1331421919-15499-2-git-send-email-tixxdz@opendz.org> <20120311172512.GA2729@redhat.com> <20120311233615.GD10787@dztty> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120311233615.GD10787@dztty> 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 03/12, Djalal Harouni wrote: > > On Sun, Mar 11, 2012 at 06:25:12PM +0100, Oleg Nesterov wrote: > > > > Well, I don't think it is right to add this counter into task_struct. > > > > It should be per-process, signal_struct makes more sense. Or may be > > mm_struct. > Some /proc//{syscall,stack,...} do not operate on mm_struct so why we > should add the: "acquire a reference to mm, get exec_id and mmput". This could be simpler, just read the counter under task_lock(). And unless I misread the next patches syscall/stack can use current->mm lockless. OK, nevermind. > For the signal_struct currently I don't know, from a comment it seems that > signal_struct can be shared! Yes, it is shared, and that is why it makes sense for the per-process data. All threads in the thread group (process) have the same ->signal. And unlike ->mm, ->signal survives after exec. Oleg.