From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756243AbdIHPD1 convert rfc822-to-8bit (ORCPT ); Fri, 8 Sep 2017 11:03:27 -0400 Received: from smtp-out6.electric.net ([192.162.217.182]:57532 "EHLO smtp-out6.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750842AbdIHPDZ (ORCPT ); Fri, 8 Sep 2017 11:03:25 -0400 From: David Laight To: "'Vivien Didelot'" , Greg Kroah-Hartman CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "kernel@savoirfairelinux.com" , "David S. Miller" , Florian Fainelli , Andrew Lunn , Egil Hjelmeland , John Crispin , Woojung Huh , Sean Wang , Nikita Yushchenko , Chris Healy Subject: RE: [PATCH net-next v2 02/10] net: dsa: debugfs: add tree Thread-Topic: [PATCH net-next v2 02/10] net: dsa: debugfs: add tree Thread-Index: AQHTKLNYd4qu2EQuz0+ayl6nngAvPaKrFYGA Date: Fri, 8 Sep 2017 15:03:16 +0000 Message-ID: <063D6719AE5E284EB5DD2968C1650D6DD00716ED@AcuExch.aculab.com> References: <20170828191748.19492-1-vivien.didelot@savoirfairelinux.com> <20170828191748.19492-3-vivien.didelot@savoirfairelinux.com> <87k21944rq.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me> In-Reply-To: <87k21944rq.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.202.99.200] Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Outbound-IP: 156.67.243.126 X-Env-From: David.Laight@ACULAB.COM X-Proto: esmtps X-Revdns: X-HELO: AcuExch.aculab.com X-TLS: TLSv1:AES128-SHA:128 X-Authenticated_ID: X-PolicySMART: 3396946, 3397078 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vivien Didelot > Sent: 08 September 2017 15:57 ... > > > Also more important, you will notice what seems to be a bug to me: > > > I can read or write a file even if I didn't mask the corresponding mode > > > hence the double check in dsa_debugfs_show and dsa_debugfs_write. > > > > The mode can be changed by userspace, you shouldn't ever need to check > > it in any debugfs calls, right? > > Correct. But this happens even if the file mode isn't changed by > userspace in the meantime, which seemed weird to me. e.g. echo > redirected to a -r--r--r-- debugfs entry will call dsa_debugfs_write. root will be able to write using 'root' permissions, regardless of the directory entry. David