<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/fs/ubifs/xattr.c, branch docs-4.16</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=docs-4.16</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=docs-4.16'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2017-10-18T23:52:36+00:00</updated>
<entry>
<title>fs, fscrypt: add an S_ENCRYPTED inode flag</title>
<updated>2017-10-18T23:52:36+00:00</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2017-10-09T19:15:35+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=2ee6a576be56427209d370d8a511d49340c84139'/>
<id>urn:sha1:2ee6a576be56427209d370d8a511d49340c84139</id>
<content type='text'>
Introduce a flag S_ENCRYPTED which can be set in -&gt;i_flags to indicate
that the inode is encrypted using the fscrypt (fs/crypto/) mechanism.

Checking this flag will give the same information that
inode-&gt;i_sb-&gt;s_cop-&gt;is_encrypted(inode) currently does, but will be more
efficient.  This will be useful for adding higher-level helper functions
for filesystems to use.  For example we'll be able to replace this:

	if (ext4_encrypted_inode(inode)) {
		ret = fscrypt_get_encryption_info(inode);
		if (ret)
			return ret;
		if (!fscrypt_has_encryption_key(inode))
			return -ENOKEY;
	}

with this:

	ret = fscrypt_require_key(inode);
	if (ret)
		return ret;

... since we'll be able to retain the fast path for unencrypted files as
a single flag check, using an inline function.  This wasn't possible
before because we'd have had to frequently call through the
-&gt;i_sb-&gt;s_cop-&gt;is_encrypted function pointer, even when the encryption
support was disabled or not being used.

Note: we don't define S_ENCRYPTED to 0 if CONFIG_FS_ENCRYPTION is
disabled because we want to continue to return an error if an encrypted
file is accessed without encryption support, rather than pretending that
it is unencrypted.

Reviewed-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Acked-by: Dave Chinner &lt;dchinner@redhat.com&gt;
Signed-off-by: Eric Biggers &lt;ebiggers@google.com&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ubifs: Massage assert in ubifs_xattr_set() wrt. init_xattrs</title>
<updated>2017-07-14T20:50:54+00:00</updated>
<author>
<name>Xiaolei Li</name>
<email>xiaolei.li@mediatek.com</email>
</author>
<published>2017-06-23T02:37:23+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=d8db5b1ca9d4c57e49893d0f78e6d5ce81450cc8'/>
<id>urn:sha1:d8db5b1ca9d4c57e49893d0f78e6d5ce81450cc8</id>
<content type='text'>
The inode is not locked in init_xattrs when creating a new inode.

Without this patch, there will occurs assert when booting or creating
a new file, if the kernel config CONFIG_SECURITY_SMACK is enabled.

Log likes:

UBIFS assert failed in ubifs_xattr_set at 298 (pid 1156)
CPU: 1 PID: 1156 Comm: ldconfig Tainted: G S 4.12.0-rc1-207440-g1e70b02 #2
Hardware name: MediaTek MT2712 evaluation board (DT)
Call trace:
[&lt;ffff000008088538&gt;] dump_backtrace+0x0/0x238
[&lt;ffff000008088834&gt;] show_stack+0x14/0x20
[&lt;ffff0000083d98d4&gt;] dump_stack+0x9c/0xc0
[&lt;ffff00000835d524&gt;] ubifs_xattr_set+0x374/0x5e0
[&lt;ffff00000835d7ec&gt;] init_xattrs+0x5c/0xb8
[&lt;ffff000008385788&gt;] security_inode_init_security+0x110/0x190
[&lt;ffff00000835e058&gt;] ubifs_init_security+0x30/0x68
[&lt;ffff00000833ada0&gt;] ubifs_mkdir+0x100/0x200
[&lt;ffff00000820669c&gt;] vfs_mkdir+0x11c/0x1b8
[&lt;ffff00000820b73c&gt;] SyS_mkdirat+0x74/0xd0
[&lt;ffff000008082f8c&gt;] __sys_trace_return+0x0/0x4

Signed-off-by: Xiaolei Li &lt;xiaolei.li@mediatek.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>ubifs: Correctly evict xattr inodes</title>
<updated>2017-07-14T20:49:04+00:00</updated>
<author>
<name>Richard Weinberger</name>
<email>richard@nod.at</email>
</author>
<published>2017-05-16T22:20:27+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=272eda8298dc82eb411ece82bbb2c62911087b24'/>
<id>urn:sha1:272eda8298dc82eb411ece82bbb2c62911087b24</id>
<content type='text'>
UBIFS handles extended attributes just like files, as consequence of
that, they also have inodes.
Therefore UBIFS does all the inode machinery also for xattrs. Since new
inodes have i_nlink of 1, a file or xattr inode will be evicted
if i_nlink goes down to 0 after an unlink. UBIFS assumes this model also
for xattrs, which is not correct.
One can create a file "foo" with xattr "user.test". By reading
"user.test" an inode will be created, and by deleting "user.test" it
will get evicted later. The assumption breaks if the file "foo", which
hosts the xattrs, will be removed. VFS nor UBIFS does not remove each
xattr via ubifs_xattr_remove(), it just removes the host inode from
the TNC and all underlying xattr nodes too and the inode will remain
in the cache and wastes memory.

To solve this problem, remove xattr inodes from the VFS inode cache in
ubifs_xattr_remove() to make sure that they get evicted.

Fixes: 1e51764a3c2ac05a ("UBIFS: add new flash file system")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>Merge tag 'upstream-4.12-rc1' of git://git.infradead.org/linux-ubifs</title>
<updated>2017-05-13T17:23:12+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2017-05-13T17:23:12+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=b53c4d5eb7cda86f7bf495f52116ae43bdc9cf23'/>
<id>urn:sha1:b53c4d5eb7cda86f7bf495f52116ae43bdc9cf23</id>
<content type='text'>
Pull UBI/UBIFS updates from Richard Weinberger:

 - new config option CONFIG_UBIFS_FS_SECURITY

 - minor improvements

 - random fixes

* tag 'upstream-4.12-rc1' of git://git.infradead.org/linux-ubifs:
  ubi: Add debugfs file for tracking PEB state
  ubifs: Fix a typo in comment of ioctl2ubifs &amp; ubifs2ioctl
  ubifs: Remove unnecessary assignment
  ubifs: Fix cut and paste error on sb type comparisons
  ubi: fastmap: Fix slab corruption
  ubifs: Add CONFIG_UBIFS_FS_SECURITY to disable/enable security labels
  ubi: Make mtd parameter readable
  ubi: Fix section mismatch
</content>
</entry>
<entry>
<title>fs: ubifs: replace CURRENT_TIME_SEC with current_time</title>
<updated>2017-05-09T00:15:15+00:00</updated>
<author>
<name>Deepa Dinamani</name>
<email>deepa.kernel@gmail.com</email>
</author>
<published>2017-05-08T22:59:25+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=607a11ad947794d0f4f2c0f73c654876d1abb9b1'/>
<id>urn:sha1:607a11ad947794d0f4f2c0f73c654876d1abb9b1</id>
<content type='text'>
CURRENT_TIME_SEC is not y2038 safe.  current_time() will be transitioned
to use 64 bit time along with vfs in a separate patch.  There is no plan
to transition CURRENT_TIME_SEC to use y2038 safe time interfaces.

current_time() returns timestamps according to the granularities set in
the inode's super_block.  The granularity check to call
current_fs_time() or CURRENT_TIME_SEC is not required.

Use current_time() directly to update inode timestamp.  Use
timespec_trunc during file system creation, before the first inode is
created.

Link: http://lkml.kernel.org/r/1491613030-11599-9-git-send-email-deepa.kernel@gmail.com
Signed-off-by: Deepa Dinamani &lt;deepa.kernel@gmail.com&gt;
Reviewed-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Richard Weinberger &lt;richard@nod.at&gt;
Cc: Artem Bityutskiy &lt;dedekind1@gmail.com&gt;
Cc: Adrian Hunter &lt;adrian.hunter@intel.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>
<entry>
<title>ubifs: Add CONFIG_UBIFS_FS_SECURITY to disable/enable security labels</title>
<updated>2017-05-08T18:48:23+00:00</updated>
<author>
<name>Hyunchul Lee</name>
<email>cheol.lee@lge.com</email>
</author>
<published>2017-03-03T07:44:03+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=8326c1eec2449f0e868f7b19a5fa7bfa0386ab48'/>
<id>urn:sha1:8326c1eec2449f0e868f7b19a5fa7bfa0386ab48</id>
<content type='text'>
When write syscall is called, every time security label is searched to
determine that file's privileges should be changed.
If LSM(Linux Security Model) is not used, this is useless.

So introduce CONFIG_UBIFS_SECURITY to disable security labels. it's default
value is "y".

Signed-off-by: Hyunchul Lee &lt;cheol.lee@lge.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>ubifs: Implement encrypted filenames</title>
<updated>2016-12-12T22:07:38+00:00</updated>
<author>
<name>Richard Weinberger</name>
<email>richard@nod.at</email>
</author>
<published>2016-11-11T21:50:29+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=f4f61d2cc6d8789a52245a4733b3e5643be154f3'/>
<id>urn:sha1:f4f61d2cc6d8789a52245a4733b3e5643be154f3</id>
<content type='text'>
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: David Gstir &lt;david@sigma-star.at&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>ubifs: Massage assert in ubifs_xattr_set() wrt. fscrypto</title>
<updated>2016-12-12T22:07:38+00:00</updated>
<author>
<name>Richard Weinberger</name>
<email>richard@nod.at</email>
</author>
<published>2016-09-29T18:11:03+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=700eada82a349f0aeadd43ce4b182b32e4adc5b5'/>
<id>urn:sha1:700eada82a349f0aeadd43ce4b182b32e4adc5b5</id>
<content type='text'>
When we're creating a new inode in UBIFS the inode is not
yet exposed and fscrypto calls ubifs_xattr_set() without
holding the inode mutex. This is okay but ubifs_xattr_set()
has to know about this.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>ubifs: Massage ubifs_listxattr() for encryption context</title>
<updated>2016-12-12T22:07:38+00:00</updated>
<author>
<name>Richard Weinberger</name>
<email>richard@nod.at</email>
</author>
<published>2016-09-21T10:21:29+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=43b113fea2d427e17e7663494fc70c4e93e83d5e'/>
<id>urn:sha1:43b113fea2d427e17e7663494fc70c4e93e83d5e</id>
<content type='text'>
We have to make sure that we don't expose our internal
crypto context to userspace.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>ubifs: Add skeleton for fscrypto</title>
<updated>2016-12-12T22:07:38+00:00</updated>
<author>
<name>Richard Weinberger</name>
<email>richard@nod.at</email>
</author>
<published>2016-10-20T14:47:56+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=d475a507457b5cafa428871a473d0dcc828c5f68'/>
<id>urn:sha1:d475a507457b5cafa428871a473d0dcc828c5f68</id>
<content type='text'>
This is the first building block to provide file level
encryption on UBIFS.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
</feed>
