Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422982AbbD2MKf (ORCPT ); Wed, 29 Apr 2015 08:10:35 -0400 Received: from mail-ob0-f169.google.com ([209.85.214.169]:34331 "EHLO mail-ob0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422762AbbD2MKd (ORCPT ); Wed, 29 Apr 2015 08:10:33 -0400 MIME-Version: 1.0 Date: Wed, 29 Apr 2015 17:40:33 +0530 Message-ID: Subject: Re: [PATCH 9/9] sysfs: disallow world-writable files. From: Gobinda Maji To: rusty@rustcorp.com.au Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1116 Lines: 28 Hi Rusty, I have a small doubt about the permission restriction (User perms >= group perms >= other perms) in VERIFY_OCTAL_PERMISSIONS(). Please Note that permission field of User, Group or Other consists of three bits. LSB is EXECUTE permission, MSB is READ permission and the middle bit is WRITE permission. Say for example, permission value is "0431". Here User has only READ permission whereas Group has both WRITE and EXECUTE permission and Other has EXECUTE permission. I guess, it is not good to give Group the WRITE permission whereas User itself has no WRITE permission. May be, it's better to check those three permissions bit wise rather than as a whole. I already had posted my query at: http://thread.gmane.org/gmane.linux.kernel/1667095/focus=1737833 But could get any reply. Please rethink about my point and let me know your opinion. Thanks, Gobinda -- 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/