<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/fs/sysfs/bin.c, branch v3.4.83</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.4.83</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.4.83'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2010-10-22T17:16:43Z</updated>
<entry>
<title>sysfs: only access bin file vm_ops with the active lock</title>
<updated>2010-10-22T17:16:43Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@aristanetworks.com</email>
</author>
<published>2010-09-20T07:57:03Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=38f49a5132f24d29236820eb5c7dd956e47f94a3'/>
<id>urn:sha1:38f49a5132f24d29236820eb5c7dd956e47f94a3</id>
<content type='text'>
bb-&gt;vm_ops is a cached copy of the vm_ops of the underlying
sysfs bin file, which means that after sysfs_bin_remove_file
completes it is only longer valid to deference bb-&gt;vm_ops.

So move all of the tests of bb-&gt;vm_ops inside of where
we hold the sysfs active lock.

Signed-off-by: Eric W. Biederman &lt;ebiederm@aristanetworks.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>sysfs: Fail bin file mmap if vma close is implemented.</title>
<updated>2010-10-22T17:16:43Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@aristanetworks.com</email>
</author>
<published>2010-09-20T07:56:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a6849fa1f7d7d7adbeb6a696beeabfa078acf173'/>
<id>urn:sha1:a6849fa1f7d7d7adbeb6a696beeabfa078acf173</id>
<content type='text'>
It is not reasonably possible to wrap vma-&gt;close().  To correctly
wrap close would imply calling close on any vmas that remain when
sysfs_remove_bin_file is called.  Finding the proper lists walking
them getting the locking right etc, requires deep knowledge of the
mm subsystem and as such would require assistence from the mm
subsystem to implement.  That assistence does not currently exist.

Signed-off-by: Eric W. Biederman &lt;ebiederm@aristanetworks.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>sysfs: add struct file* to bin_attr callbacks</title>
<updated>2010-05-21T16:37:31Z</updated>
<author>
<name>Chris Wright</name>
<email>chrisw@sous-sol.org</email>
</author>
<published>2010-05-13T01:28:57Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2c3c8bea608866d8bd9dcf92657d57fdcac011c5'/>
<id>urn:sha1:2c3c8bea608866d8bd9dcf92657d57fdcac011c5</id>
<content type='text'>
This allows bin_attr-&gt;read,write,mmap callbacks to check file specific data
(such as inode owner) as part of any privilege validation.

Signed-off-by: Chris Wright &lt;chrisw@sous-sol.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>sysfs: Implement sysfs tagged directory support.</title>
<updated>2010-05-21T16:37:31Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2010-03-30T18:31:26Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3ff195b011d7decf501a4d55aeed312731094796'/>
<id>urn:sha1:3ff195b011d7decf501a4d55aeed312731094796</id>
<content type='text'>
The problem.  When implementing a network namespace I need to be able
to have multiple network devices with the same name.  Currently this
is a problem for /sys/class/net/*, /sys/devices/virtual/net/*, and
potentially a few other directories of the form /sys/ ... /net/*.

What this patch does is to add an additional tag field to the
sysfs dirent structure.  For directories that should show different
contents depending on the context such as /sys/class/net/, and
/sys/devices/virtual/net/ this tag field is used to specify the
context in which those directories should be visible.  Effectively
this is the same as creating multiple distinct directories with
the same name but internally to sysfs the result is nicer.

I am calling the concept of a single directory that looks like multiple
directories all at the same path in the filesystem tagged directories.

For the networking namespace the set of directories whose contents I need
to filter with tags can depend on the presence or absence of hotplug
hardware or which modules are currently loaded.  Which means I need
a simple race free way to setup those directories as tagged.

To achieve a reace free design all tagged directories are created
and managed by sysfs itself.

Users of this interface:
- define a type in the sysfs_tag_type enumeration.
- call sysfs_register_ns_types with the type and it's operations
- sysfs_exit_ns when an individual tag is no longer valid

- Implement mount_ns() which returns the ns of the calling process
  so we can attach it to a sysfs superblock.
- Implement ktype.namespace() which returns the ns of a syfs kobject.

Everything else is left up to sysfs and the driver layer.

For the network namespace mount_ns and namespace() are essentially
one line functions, and look to remain that.

Tags are currently represented a const void * pointers as that is
both generic, prevides enough information for equality comparisons,
and is trivial to create for current users, as it is just the
existing namespace pointer.

The work needed in sysfs is more extensive.  At each directory
or symlink creating I need to check if the directory it is being
created in is a tagged directory and if so generate the appropriate
tag to place on the sysfs_dirent.  Likewise at each symlink or
directory removal I need to check if the sysfs directory it is
being removed from is a tagged directory and if so figure out
which tag goes along with the name I am deleting.

Currently only directories which hold kobjects, and
symlinks are supported.  There is not enough information
in the current file attribute interfaces to give us anything
to discriminate on which makes it useless, and there are
no potential users which makes it an uninteresting problem
to solve.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Signed-off-by: Benjamin Thery &lt;benjamin.thery@bull.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>sysfs: Remove sysfs_get/put_active_two</title>
<updated>2010-03-08T01:04:51Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2010-02-11T23:18:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e72ceb8ccac5f770b3e696e09bb673dca7024b20'/>
<id>urn:sha1:e72ceb8ccac5f770b3e696e09bb673dca7024b20</id>
<content type='text'>
It turns out that holding an active reference on a directory is
pointless.  The purpose of the active references are to allows us to
block when removing sysfs entries that have custom methods so we don't
remove modules while running modular code and to keep those custom
methods from accessing data structures after the files have been
removed.  Further sysfs_remove_dir remove all elements in the
directory before removing the directory itself, so there is no chance
we will remove a directory with active children.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>Driver core: bin_attribute parameters can often be const*</title>
<updated>2009-12-23T19:23:43Z</updated>
<author>
<name>Phil Carmody</name>
<email>ext-phil.2.carmody@nokia.com</email>
</author>
<published>2009-12-18T13:34:20Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=66ecb92be9eb579df93add22d19843e7869f168e'/>
<id>urn:sha1:66ecb92be9eb579df93add22d19843e7869f168e</id>
<content type='text'>
Many struct bin_attribute descriptors are purely read-only
structures, and there's no need to change them. Therefore
make the promise not to, which will let those descriptors
be put in a ro section.

Signed-off-by: Phil Carmody &lt;ext-phil.2.carmody@nokia.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>const: mark struct vm_struct_operations</title>
<updated>2009-09-27T18:39:25Z</updated>
<author>
<name>Alexey Dobriyan</name>
<email>adobriyan@gmail.com</email>
</author>
<published>2009-09-27T18:29:37Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f0f37e2f77731b3473fa6bd5ee53255d9a9cdb40'/>
<id>urn:sha1:f0f37e2f77731b3473fa6bd5ee53255d9a9cdb40</id>
<content type='text'>
* mark struct vm_area_struct::vm_ops as const
* mark vm_ops in AGP code

But leave TTM code alone, something is fishy there with global vm_ops
being used.

Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Free the memory allocated by memdup_user() in fs/sysfs/bin.c</title>
<updated>2009-07-08T16:34:07Z</updated>
<author>
<name>Catalin Marinas</name>
<email>catalin.marinas@arm.com</email>
</author>
<published>2009-07-08T10:17:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d5ce5b40bc66880d1732461d4b47d7fc3331ed30'/>
<id>urn:sha1:d5ce5b40bc66880d1732461d4b47d7fc3331ed30</id>
<content type='text'>
Commit 1c8542c7bb replaced kmalloc() with memdup_user() in the write()
function but also dropped the kfree(temp). The memdup_user() function
allocates memory which is never freed.

Signed-off-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Cc: Parag Warudkar &lt;parag.warudkar@gmail.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>sysfs: use memdup_user()</title>
<updated>2009-04-21T03:02:50Z</updated>
<author>
<name>Li Zefan</name>
<email>lizf@cn.fujitsu.com</email>
</author>
<published>2009-04-08T07:07:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1c8542c7bb239ef02fe21477acd9cdac04c1b640'/>
<id>urn:sha1:1c8542c7bb239ef02fe21477acd9cdac04c1b640</id>
<content type='text'>
Remove open-coded memdup_user().

Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>mm: page_mkwrite change prototype to match fault: fix sysfs</title>
<updated>2009-04-01T15:59:14Z</updated>
<author>
<name>Hugh Dickins</name>
<email>hugh@veritas.com</email>
</author>
<published>2009-03-31T22:23:24Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=851a039cc547b33b8139fe6d7c2bbfb158e2724e'/>
<id>urn:sha1:851a039cc547b33b8139fe6d7c2bbfb158e2724e</id>
<content type='text'>
Fix warnings and return values in sysfs bin_page_mkwrite(), fixing
fs/sysfs/bin.c: In function `bin_page_mkwrite':
fs/sysfs/bin.c:250: warning: passing argument 2 of `bb-&gt;vm_ops-&gt;page_mkwrite' from incompatible pointer type
fs/sysfs/bin.c: At top level:
fs/sysfs/bin.c:280: warning: initialization from incompatible pointer type

Expects to have my [PATCH next] sysfs: fix some bin_vm_ops errors

Signed-off-by: Hugh Dickins &lt;hugh@veritas.com&gt;
Cc: Nick Piggin &lt;npiggin@suse.de&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@aristanetworks.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
