From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hugh Dickins Subject: [PATCH 4/4] Annotate struct fs_struct's usage count restriction Date: Sat, 28 Mar 2009 23:23:01 +0000 (GMT) Message-ID: References: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: Linus Torvalds , Andrew Morton , Joe Malicki , Michael Itz , Kenneth Baker , Chris Wright , David Howells , Alexey Dobriyan , Oleg Nesterov , Greg Kroah-Hartman , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: Al Viro Return-path: Received: from extu-mxob-1.symantec.com ([216.10.194.28]:60666 "EHLO extu-mxob-1.symantec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752937AbZC1XYd (ORCPT ); Sat, 28 Mar 2009 19:24:33 -0400 In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: From: David Howells Annotate struct fs_struct's usage count to indicate the restrictions upon it. It may not be incremented, except by clone(CLONE_FS), as this affects the check in check_unsafe_exec() in fs/exec.c. Signed-off-by: David Howells Signed-off-by: Hugh Dickins Cc: stable@kernel.org --- include/linux/fs_struct.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- 2.6.29/include/linux/fs_struct.h 2009-03-23 23:12:14.000000000 +0000 +++ linux/include/linux/fs_struct.h 2009-03-28 18:06:02.000000000 +0000 @@ -4,7 +4,10 @@ #include struct fs_struct { - atomic_t count; + atomic_t count; /* This usage count is used by check_unsafe_exec() for + * security checking purposes - therefore it may not be + * incremented, except by clone(CLONE_FS). + */ rwlock_t lock; int umask; struct path root, pwd;