lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181112124049.GA2408@kroah.com>
Date:   Mon, 12 Nov 2018 04:40:49 -0800
From:   Greg Kroah-Hartman <greg@...ah.com>
To:     wahahab <wahahab11@...il.com>
Cc:     Dan Carpenter <dan.carpenter@...cle.com>,
        Joel Fernandes <joel@...lfernandes.org>,
        devel@...verdev.osuosl.org, Todd Kjos <tkjos@...roid.com>,
        ghartman@...gle.com, astrachan@...gle.com,
        linux-kernel@...r.kernel.org,
        Arve Hjønnevåg <arve@...roid.com>,
        Martijn Coenen <maco@...roid.com>
Subject: Re: [PATCH v3] driver-staging: vsoc.c: Add sysfs support for
 examining the permissions of regions.

On Mon, Nov 12, 2018 at 04:49:30PM +0800, wahahab wrote:
> 
> > On 10 Nov 2018, at 1:15 AM, Dan Carpenter <dan.carpenter@...cle.com <mailto:dan.carpenter@...cle.com>> wrote:
> > 
> > On Wed, Nov 07, 2018 at 10:30:43AM +0800, Jerry Lin wrote:
> >> Add a attribute called permissions under vsoc device node for examining
> >> current granted permissions in vsoc_device.
> >> 
> >> This file will display permissions in following format:
> >>  begin_offset  end_offset  owner_offset  owned_value
> >>            %x          %x            %x           %x
> >> 
> > 
> > (I'm not totally an expert on sysfs rules).
> > 
> > Sysfs are supposed to be one value per file, so instead of doing this
> > you would create a directory with four files like
> > vsoc_device/begin_offset vsoc_device/end_offset etc.  And each would
> > just hae a %x output.
> 
> Thanks for your advice. I have started with this approach.
> 
> But when I trying to create this kind of sysfs hierarchy. I encountered the difficulties of file organizing.
> 
> My current thought is to create a folder under the device node called permissions and user can examine
> permission though file path like vsoc_device/permissions/permission1/begin_offset. But there comes a
> problem that it seems hard to determine the correct index of permission to make folder name unique.
> 
> The solution I come up with is to use memory address of permission node to be the index of permission.
> So the path will be something like vsoc_device/permissions/0x4d23f/begin_offset.
> Is this OK for sysfs?

Ick, that is messy.  What exactly are you trying to export and why use
sysfs?  Is this just debugging information?  Who is going to use this
data?

If it is just for debugging, use debugfs, that is what it is there for.
If you use sysfs, you then have to support your new api for a very long
time, as you can not break userspace reliance on it.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ