From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757936AbYGDGl2 (ORCPT ); Fri, 4 Jul 2008 02:41:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753215AbYGDGlP (ORCPT ); Fri, 4 Jul 2008 02:41:15 -0400 Received: from wa-out-1112.google.com ([209.85.146.176]:61536 "EHLO wa-out-1112.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752968AbYGDGlN (ORCPT ); Fri, 4 Jul 2008 02:41:13 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=ZNnBEWf8mtR71Rn6u1QwXMS6VjKrob7rhSPtcHUs+z3TUkwJfUBmzHPPg3UgjCBiaS fGZ0UAmjzjNRJ0WzxUROLM60mLxy4KHnbZnbuGDBigrjqV61T6HzQJzcid5qmOykTY+8 IBCdtNIwfXf0fJFYisnWhXTpsGVmG4W4HBWA0= Message-ID: <486DC5D3.5050201@gmail.com> Date: Fri, 04 Jul 2008 15:40:19 +0900 From: Tejun Heo User-Agent: Thunderbird 2.0.0.12 (X11/20071114) MIME-Version: 1.0 To: "Eric W. Biederman" CC: Greg Kroah-Hartman , Andrew Morton , Daniel Lezcano , linux-kernel@vger.kernel.org, Al Viro , Linux Containers , Benjamin Thery , netdev@vger.kernel.org Subject: Re: [PATCH 06/15] Introduce sysfs_sd_setattr and fix sysfs_chmod References: <20080618170729.808539948@theryb.frec.bull.fr> <4869D314.5030403@gmail.com> <486A0751.9080602@gmail.com> <486AF4FA.8020805@gmail.com> <486B060C.7030607@gmail.com> <486C4515.1070007@gmail.com> <486CB051.5000507@fr.ibm.com> <486CF71F.5090405@gmail.com> In-Reply-To: X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Eric W. Biederman wrote: > Currently sysfs_chmod calls sys_setattr which in turn calls > inode_change_ok which checks to see if it is ok for the current user > space process to change tha attributes. Since sysfs_chmod_file has > only kernel mode clients denying them permission if user space is the > problem is completely inappropriate. > > Therefore factor out sysfs_sd_setattr which does not call > inode_change_ok and modify sysfs_chmod_file to call it. > > In addition setting victim_sd->s_mode explicitly in sysfs_chmod_file > is redundant so remove that as well. > > Thanks to Tejun Heo , and > Daniel Lezcano for working on this > and spotting this case. > > Signed-off-by: Eric W. Biederman Acked-by: Tejun Heo -- tejun