<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/sysfs, branch v3.17</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v3.17</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.17'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2014-05-27T21:33:17Z</updated>
<entry>
<title>kernfs: move the last knowledge of sysfs out from kernfs</title>
<updated>2014-05-27T21:33:17Z</updated>
<author>
<name>Jianyu Zhan</name>
<email>nasa4836@gmail.com</email>
</author>
<published>2014-04-26T07:40:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=26fc9cd200ec839e0b3095e05ae018f27314e7aa'/>
<id>urn:sha1:26fc9cd200ec839e0b3095e05ae018f27314e7aa</id>
<content type='text'>
There is still one residue of sysfs remaining: the sb_magic
SYSFS_MAGIC. However this should be kernfs user specific,
so this patch moves it out. Kerrnfs user should specify their
magic number while mouting.

Signed-off-by: Jianyu Zhan &lt;nasa4836@gmail.com&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>sysfs: fix attribute_group bin file path on removal</title>
<updated>2014-05-27T21:33:17Z</updated>
<author>
<name>Robert ABEL</name>
<email>rabel@cit-ec.uni-bielefeld.de</email>
</author>
<published>2014-05-05T13:17:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9f70a40128a4ddceffb6d21dd490f6ab4bc34c97'/>
<id>urn:sha1:9f70a40128a4ddceffb6d21dd490f6ab4bc34c97</id>
<content type='text'>
Cody Schafer already fixed binary file creation for attribute groups, see [1].
This patch makes the appropriate changes for binary file removal
of attribute groups.
[1]: http://lkml.org/lkml/2014/2/27/832

Signed-off-by: Robert ABEL &lt;rabel@cit-ec.uni-bielefeld.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>sysfs: make sure read buffer is zeroed</title>
<updated>2014-05-20T01:15:53Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2014-05-19T19:52:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f5c16f29bf5e57ba4051fc7785ba7f035f798c71'/>
<id>urn:sha1:f5c16f29bf5e57ba4051fc7785ba7f035f798c71</id>
<content type='text'>
13c589d5b0ac ("sysfs: use seq_file when reading regular files")
switched sysfs from custom read implementation to seq_file to enable
later transition to kernfs.  After the change, the buffer passed to
-&gt;show() is acquired through seq_get_buf(); unfortunately, this
introduces a subtle behavior change.  Before the commit, the buffer
passed to -&gt;show() was always zero as it was allocated using
get_zeroed_page().  Because seq_file doesn't clear buffers on
allocation and neither does seq_get_buf(), after the commit, depending
on the behavior of -&gt;show(), we may end up exposing uninitialized data
to userland thus possibly altering userland visible behavior and
leaking information.

Fix it by explicitly clearing the buffer.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reported-by: Ron &lt;ron@debian.org&gt;
Fixes: 13c589d5b0ac ("sysfs: use seq_file when reading regular files")
Cc: stable &lt;stable@vger.kernel.org&gt; # 3.13+
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>kernfs, sysfs, cgroup: restrict extra perm check on open to sysfs</title>
<updated>2014-05-13T11:21:40Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2014-05-12T17:56:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=555724a831b4a146e7bdf16ecc989cda032b076d'/>
<id>urn:sha1:555724a831b4a146e7bdf16ecc989cda032b076d</id>
<content type='text'>
The kernfs open method - kernfs_fop_open() - inherited extra
permission checks from sysfs.  While the vfs layer allows ignoring the
read/write permissions checks if the issuer has CAP_DAC_OVERRIDE,
sysfs explicitly denied open regardless of the cap if the file doesn't
have any of the UGO perms of the requested access or doesn't implement
the requested operation.  It can be debated whether this was a good
idea or not but the behavior is too subtle and dangerous to change at
this point.

After cgroup got converted to kernfs, this extra perm check also got
applied to cgroup breaking libcgroup which opens write-only files with
O_RDWR as root.  This patch gates the extra open permission check with
a new flag KERNFS_ROOT_EXTRA_OPEN_PERM_CHECK and enables it for sysfs.
For sysfs, nothing changes.  For cgroup, root now can perform any
operation regardless of the permissions as it was before kernfs
conversion.  Note that kernfs still fails unimplemented operations
with -EINVAL.

While at it, add comments explaining KERNFS_ROOT flags.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reported-by: Andrey Wagin &lt;avagin@gmail.com&gt;
Tested-by: Andrey Wagin &lt;avagin@gmail.com&gt;
Cc: Li Zefan &lt;lizefan@huawei.com&gt;
References: http://lkml.kernel.org/g/CANaxB-xUm3rJ-Cbp72q-rQJO5mZe1qK6qXsQM=vh0U8upJ44+A@mail.gmail.com
Fixes: 2bd59d48ebfb ("cgroup: convert to kernfs")
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>sysfs, driver-core: remove unused {sysfs|device}_schedule_callback_owner()</title>
<updated>2014-04-16T18:56:33Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2014-01-10T13:57:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=33ac1257ff0dee2e9c7f009b1c1914b7990217b2'/>
<id>urn:sha1:33ac1257ff0dee2e9c7f009b1c1914b7990217b2</id>
<content type='text'>
All device_schedule_callback_owner() users are converted to use
device_remove_file_self().  Remove now unused
{sysfs|device}_schedule_callback_owner().

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Revert "sysfs, driver-core: remove unused {sysfs|device}_schedule_callback_owner()"</title>
<updated>2014-03-26T03:54:57Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2014-03-26T03:54:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=72099304eeb316c4b00df3ae83efe4375729bd78'/>
<id>urn:sha1:72099304eeb316c4b00df3ae83efe4375729bd78</id>
<content type='text'>
This reverts commit d1ba277e79889085a2faec3b68b91ce89c63f888.

As reported by Stephen, this patch breaks linux-next as a ppc patch
suddenly (after 2 years) started using this old api call.  So revert it
for now, it will go away in 3.15-rc2 when we can change the PPC call to
the new api.

Reported-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Stewart Smith &lt;stewart@linux.vnet.ibm.com&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge 3.14-rc5 into driver-core-next</title>
<updated>2014-03-03T04:09:08Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2014-03-03T04:09:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=13df7977431e3b906a23bb75f29e0f40a8d73f87'/>
<id>urn:sha1:13df7977431e3b906a23bb75f29e0f40a8d73f87</id>
<content type='text'>
We want the fixes in here.
</content>
</entry>
<entry>
<title>sysfs: fix namespace refcnt leak</title>
<updated>2014-02-25T15:37:52Z</updated>
<author>
<name>Li Zefan</name>
<email>lizefan@huawei.com</email>
</author>
<published>2014-02-25T11:28:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fed95bab8d29b928fcf6225be72d37ded452e8a2'/>
<id>urn:sha1:fed95bab8d29b928fcf6225be72d37ded452e8a2</id>
<content type='text'>
As mount() and kill_sb() is not a one-to-one match, we shoudn't get
ns refcnt unconditionally in sysfs_mount(), and instead we should
get the refcnt only when kernfs_mount() allocated a new superblock.

v2:
- Changed the name of the new argument, suggested by Tejun.
- Made the argument optional, suggested by Tejun.

v3:
- Make the new argument as second-to-last arg, suggested by Tejun.

Signed-off-by: Li Zefan &lt;lizefan@huawei.com&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
 ---
 fs/kernfs/mount.c      | 8 +++++++-
 fs/sysfs/mount.c       | 5 +++--
 include/linux/kernfs.h | 9 +++++----
 3 files changed, 15 insertions(+), 7 deletions(-)
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>sysfs: create bin_attributes under the requested group</title>
<updated>2014-02-15T20:14:55Z</updated>
<author>
<name>Cody P Schafer</name>
<email>cody@linux.vnet.ibm.com</email>
</author>
<published>2014-02-14T22:02:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=aabaf4c2050d21d39fe11eec889c508e84d6a328'/>
<id>urn:sha1:aabaf4c2050d21d39fe11eec889c508e84d6a328</id>
<content type='text'>
bin_attributes created/updated in create_files() (such as those listed
via (struct device).attribute_groups) were not placed under the
specified group, and instead appeared in the base kobj directory.

Fix this by making bin_attributes use creating code similar to normal
attributes.

A quick grep shows that no one is using bin_attrs in a named attribute
group yet, so we can do this without breaking anything in usespace.

Note that I do not add is_visible() support to
bin_attributes, though that could be done as well.

Signed-off-by: Cody P Schafer &lt;cody@linux.vnet.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>kernfs: add CONFIG_KERNFS</title>
<updated>2014-02-08T00:08:57Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2014-02-03T19:09:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ba341d55a420ab4fdd1a53fd395fd59bd65de880'/>
<id>urn:sha1:ba341d55a420ab4fdd1a53fd395fd59bd65de880</id>
<content type='text'>
As sysfs was kernfs's only user, kernfs has been piggybacking on
CONFIG_SYSFS; however, kernfs is scheduled to grow a new user very
soon.  Introduce a separate config option CONFIG_KERNFS which is to be
selected by kernfs users.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
