<feed xmlns='http://www.w3.org/2005/Atom'>
<title>BMC/Intel-BMC/linux.git/fs/f2fs/xattr.c, branch dev</title>
<subtitle>Intel OpenBMC Linux kernel source tree (mirror)</subtitle>
<id>https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev</id>
<link rel='self' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/'/>
<updated>2015-05-28T22:41:48+00:00</updated>
<entry>
<title>f2fs crypto: add encryption policy and password salt support</title>
<updated>2015-05-28T22:41:48+00:00</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk@kernel.org</email>
</author>
<published>2015-04-20T22:19:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=f424f664f0e8949361d268e2e91c7acc8cf63eb2'/>
<id>urn:sha1:f424f664f0e8949361d268e2e91c7acc8cf63eb2</id>
<content type='text'>
This patch adds encryption policy and password salt support through ioctl
implementation.

It adds three ioctls:
 F2FS_IOC_SET_ENCRYPTION_POLICY,
 F2FS_IOC_GET_ENCRYPTION_POLICY,
 F2FS_IOC_GET_ENCRYPTION_PWSALT, which use xattr operations.

Note that, these definition and codes are taken from ext4 crypto support.
For f2fs, xattr operations and on-disk flags for superblock and inode were
changed.

Signed-off-by: Michael Halcrow &lt;mhalcrow@google.com&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Signed-off-by: Ildar Muslukhov &lt;muslukhovi@gmail.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs</title>
<updated>2015-04-27T00:22:07+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2015-04-26T22:48:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=9ec3a646fe09970f801ab15e0f1694060b9f19af'/>
<id>urn:sha1:9ec3a646fe09970f801ab15e0f1694060b9f19af</id>
<content type='text'>
Pull fourth vfs update from Al Viro:
 "d_inode() annotations from David Howells (sat in for-next since before
  the beginning of merge window) + four assorted fixes"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  RCU pathwalk breakage when running into a symlink overmounting something
  fix I_DIO_WAKEUP definition
  direct-io: only inc/dec inode-&gt;i_dio_count for file systems
  fs/9p: fix readdir()
  VFS: assorted d_backing_inode() annotations
  VFS: fs/inode.c helpers: d_inode() annotations
  VFS: fs/cachefiles: d_backing_inode() annotations
  VFS: fs library helpers: d_inode() annotations
  VFS: assorted weird filesystems: d_inode() annotations
  VFS: normal filesystems (and lustre): d_inode() annotations
  VFS: security/: d_inode() annotations
  VFS: security/: d_backing_inode() annotations
  VFS: net/: d_inode() annotations
  VFS: net/unix: d_backing_inode() annotations
  VFS: kernel/: d_inode() annotations
  VFS: audit: d_backing_inode() annotations
  VFS: Fix up some -&gt;d_inode accesses in the chelsio driver
  VFS: Cachefiles should perform fs modifications on the top layer only
  VFS: AF_UNIX sockets should call mknod on the top layer only
</content>
</entry>
<entry>
<title>VFS: normal filesystems (and lustre): d_inode() annotations</title>
<updated>2015-04-15T19:06:57+00:00</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2015-03-17T22:25:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=2b0143b5c986be1ce8408b3aadc4709e0a94429d'/>
<id>urn:sha1:2b0143b5c986be1ce8408b3aadc4709e0a94429d</id>
<content type='text'>
that's the bulk of filesystem drivers dealing with inodes of their own

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>f2fs: persist system.advise into on-disk inode</title>
<updated>2015-04-10T22:08:54+00:00</updated>
<author>
<name>Chao Yu</name>
<email>chao2.yu@samsung.com</email>
</author>
<published>2015-03-23T02:37:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=30c62fdb25cc0c55fa442245f7aaab074d2e701a'/>
<id>urn:sha1:30c62fdb25cc0c55fa442245f7aaab074d2e701a</id>
<content type='text'>
This patch fixes to dirty inode for persisting i_advise of f2fs inode info into
on-disk inode if user sets system.advise through setxattr. Otherwise the new
value will be lost.

Signed-off-by: Chao Yu &lt;chao2.yu@samsung.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: avoid NULL pointer dereference in f2fs_xattr_advise_get</title>
<updated>2015-04-10T22:08:53+00:00</updated>
<author>
<name>Chao Yu</name>
<email>chao2.yu@samsung.com</email>
</author>
<published>2015-03-23T02:36:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=84e97c2767f9ed711718b47b8722ddd137f1dfe9'/>
<id>urn:sha1:84e97c2767f9ed711718b47b8722ddd137f1dfe9</id>
<content type='text'>
We will encounter oops by executing below command.
getfattr -n system.advise /mnt/f2fs/file
Killed

message log:
BUG: unable to handle kernel NULL pointer dereference at   (null)
IP: [&lt;f8b54d69&gt;] f2fs_xattr_advise_get+0x29/0x40 [f2fs]
*pdpt = 00000000319b7001 *pde = 0000000000000000
Oops: 0002 [#1] SMP
Modules linked in: f2fs(O) snd_intel8x0 snd_ac97_codec ac97_bus snd_pcm snd_seq_midi snd_seq_midi_event snd_rawmidi snd_seq joydev
snd_seq_device snd_timer bnep snd rfcomm microcode bluetooth soundcore i2c_piix4 mac_hid serio_raw parport_pc ppdev lp parport
binfmt_misc hid_generic psmouse usbhid hid e1000 [last unloaded: f2fs]
CPU: 3 PID: 3134 Comm: getfattr Tainted: G           O    4.0.0-rc1 #6
Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
task: f3a71b60 ti: f19a6000 task.ti: f19a6000
EIP: 0060:[&lt;f8b54d69&gt;] EFLAGS: 00010246 CPU: 3
EIP is at f2fs_xattr_advise_get+0x29/0x40 [f2fs]
EAX: 00000000 EBX: f19a7e71 ECX: 00000000 EDX: f8b5b467
ESI: 00000000 EDI: f2008570 EBP: f19a7e14 ESP: f19a7e08
 DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
CR0: 80050033 CR2: 00000000 CR3: 319b8000 CR4: 000007f0
Stack:
 f8b5a634 c0cbb580 00000000 f19a7e34 c1193850 00000000 00000007 f19a7e71
 f19a7e64 c0cbb580 c1193810 f19a7e50 c1193c00 00000000 00000000 00000000
 c0cbb580 00000000 f19a7f70 c1194097 00000000 00000000 00000000 74737973
Call Trace:
 [&lt;c1193850&gt;] generic_getxattr+0x40/0x50
 [&lt;c1193810&gt;] ? xattr_resolve_name+0x80/0x80
 [&lt;c1193c00&gt;] vfs_getxattr+0x70/0xa0
 [&lt;c1194097&gt;] getxattr+0x87/0x190
 [&lt;c11801d7&gt;] ? path_lookupat+0x57/0x5f0
 [&lt;c11819d2&gt;] ? putname+0x32/0x50
 [&lt;c116653a&gt;] ? kmem_cache_alloc+0x2a/0x130
 [&lt;c11819d2&gt;] ? putname+0x32/0x50
 [&lt;c11819d2&gt;] ? putname+0x32/0x50
 [&lt;c11819d2&gt;] ? putname+0x32/0x50
 [&lt;c11827f9&gt;] ? user_path_at_empty+0x49/0x70
 [&lt;c118283f&gt;] ? user_path_at+0x1f/0x30
 [&lt;c11941e7&gt;] path_getxattr+0x47/0x80
 [&lt;c11948e7&gt;] SyS_getxattr+0x27/0x30
 [&lt;c163f748&gt;] sysenter_do_call+0x12/0x12
Code: 66 90 55 89 e5 57 56 53 66 66 66 66 90 8b 78 20 89 d3 ba 67 b4 b5 f8 89 d8 89 ce e8 42 7c 7b c8 85 c0 75 16 0f b6 87 44 01 00
00 &lt;88&gt; 06 b8 01 00 00 00 5b 5e 5f 5d c3 8d 76 00 b8 ea ff ff ff eb
EIP: [&lt;f8b54d69&gt;] f2fs_xattr_advise_get+0x29/0x40 [f2fs] SS:ESP 0068:f19a7e08
CR2: 0000000000000000
---[ end trace 860260654f1f416a ]---

The reason is that in getfattr there are two steps which is indicated by strace info:
1) try to lookup and get size of specified xattr.
2) get value of the extented attribute.

strace info:
getxattr("/mnt/f2fs/file", "system.advise", 0x0, 0) = 1
getxattr("/mnt/f2fs/file", "system.advise", "\x00", 256) = 1

For the first step, getfattr may pass a NULL pointer in @value and zero in @size
as parameters for -&gt;getxattr, but we access this @value pointer directly without
checking whether the pointer is valid or not in f2fs_xattr_advise_get, so the
oops occurs.

This patch fixes this issue by verifying @value pointer before using.

Signed-off-by: Chao Yu &lt;chao2.yu@samsung.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: avoid deadlock on init_inode_metadata</title>
<updated>2014-11-04T00:07:33+00:00</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk@kernel.org</email>
</author>
<published>2014-10-14T02:42:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=bce8d1120707c06088928b2ee52a58703d74ac29'/>
<id>urn:sha1:bce8d1120707c06088928b2ee52a58703d74ac29</id>
<content type='text'>
Previously, init_inode_metadata does not hold any parent directory's inode
page. So, f2fs_init_acl can grab its parent inode page without any problem.
But, when we use inline_dentry, that page is grabbed during f2fs_add_link,
so that we can fall into deadlock condition like below.

INFO: task mknod:11006 blocked for more than 120 seconds.
      Tainted: G           OE  3.17.0-rc1+ #13
"echo 0 &gt; /proc/sys/kernel/hung_task_timeout_secs" disables this message.
mknod           D ffff88003fc94580     0 11006  11004 0x00000000
 ffff880007717b10 0000000000000002 ffff88003c323220 ffff880007717fd8
 0000000000014580 0000000000014580 ffff88003daecb30 ffff88003c323220
 ffff88003fc94e80 ffff88003ffbb4e8 ffff880007717ba0 0000000000000002
Call Trace:
 [&lt;ffffffff8173dc40&gt;] ? bit_wait+0x50/0x50
 [&lt;ffffffff8173d4cd&gt;] io_schedule+0x9d/0x130
 [&lt;ffffffff8173dc6c&gt;] bit_wait_io+0x2c/0x50
 [&lt;ffffffff8173da3b&gt;] __wait_on_bit_lock+0x4b/0xb0
 [&lt;ffffffff811640a7&gt;] __lock_page+0x67/0x70
 [&lt;ffffffff810acf50&gt;] ? autoremove_wake_function+0x40/0x40
 [&lt;ffffffff811652cc&gt;] pagecache_get_page+0x14c/0x1e0
 [&lt;ffffffffa029afa9&gt;] get_node_page+0x59/0x130 [f2fs]
 [&lt;ffffffffa02a63ad&gt;] read_all_xattrs+0x24d/0x430 [f2fs]
 [&lt;ffffffffa02a6ca2&gt;] f2fs_getxattr+0x52/0xe0 [f2fs]
 [&lt;ffffffffa02a7481&gt;] f2fs_get_acl+0x41/0x2d0 [f2fs]
 [&lt;ffffffff8122d847&gt;] get_acl+0x47/0x70
 [&lt;ffffffff8122db5a&gt;] posix_acl_create+0x5a/0x150
 [&lt;ffffffffa02a7759&gt;] f2fs_init_acl+0x29/0xcb [f2fs]
 [&lt;ffffffffa0286a8d&gt;] init_inode_metadata+0x5d/0x340 [f2fs]
 [&lt;ffffffffa029253a&gt;] f2fs_add_inline_entry+0x12a/0x2e0 [f2fs]
 [&lt;ffffffffa0286ea5&gt;] __f2fs_add_link+0x45/0x4a0 [f2fs]
 [&lt;ffffffffa028b5b6&gt;] ? f2fs_new_inode+0x146/0x220 [f2fs]
 [&lt;ffffffffa028b816&gt;] f2fs_mknod+0x86/0xf0 [f2fs]
 [&lt;ffffffff811e3ec1&gt;] vfs_mknod+0xe1/0x160
 [&lt;ffffffff811e4b26&gt;] SyS_mknod+0x1f6/0x200
 [&lt;ffffffff81741d7f&gt;] tracesys+0xe1/0xe6

Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: need fsck.f2fs when f2fs_bug_on is triggered</title>
<updated>2014-09-09T20:15:02+00:00</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk@kernel.org</email>
</author>
<published>2014-09-02T22:52:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=9850cf4a8908886370b1f15aacf83d291f098c72'/>
<id>urn:sha1:9850cf4a8908886370b1f15aacf83d291f098c72</id>
<content type='text'>
If any f2fs_bug_on is triggered, fsck.f2fs is needed.

Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: introduce F2FS_I_SB, F2FS_M_SB, and F2FS_P_SB</title>
<updated>2014-09-04T00:37:13+00:00</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk@kernel.org</email>
</author>
<published>2014-09-02T22:31:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=4081363fbe84a7ebac6d3339dd2775df45d856d0'/>
<id>urn:sha1:4081363fbe84a7ebac6d3339dd2775df45d856d0</id>
<content type='text'>
This patch adds three inline functions to clean up dirty casting codes.

Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: fix typo</title>
<updated>2014-08-19T17:01:33+00:00</updated>
<author>
<name>arter97</name>
<email>qkrwngud825@gmail.com</email>
</author>
<published>2014-08-06T14:22:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=e1c42045203071c4634b89e696037357810d3083'/>
<id>urn:sha1:e1c42045203071c4634b89e696037357810d3083</id>
<content type='text'>
Fix typo and some grammatical errors.

The words "filesystem" and "readahead" are being used without the space treewide.

Signed-off-by: Park Ju Hyung &lt;qkrwngud825@gmail.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: fix recursive lock by f2fs_setxattr</title>
<updated>2014-06-02T13:13:16+00:00</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk@kernel.org</email>
</author>
<published>2014-06-01T14:24:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=d631abdac9d541d282a1461b5aeae70aa3866e9f'/>
<id>urn:sha1:d631abdac9d541d282a1461b5aeae70aa3866e9f</id>
<content type='text'>
This patch should resolve the following recursive lock.

[&lt;ffffffff8135a9c3&gt;] call_rwsem_down_write_failed+0x13/0x20
[&lt;ffffffffa01749dc&gt;] f2fs_setxattr+0x5c/0xa0 [f2fs]
[&lt;ffffffffa0174c99&gt;] __f2fs_set_acl+0x1b9/0x340 [f2fs]
[&lt;ffffffffa017515a&gt;] f2fs_init_acl+0x4a/0xcb [f2fs]
[&lt;ffffffffa0159abe&gt;] __f2fs_add_link+0x26e/0x780 [f2fs]
[&lt;ffffffffa015d4d8&gt;] f2fs_mkdir+0xb8/0x150 [f2fs]
[&lt;ffffffff811cebd7&gt;] vfs_mkdir+0xb7/0x160
[&lt;ffffffff811cf89b&gt;] SyS_mkdir+0xab/0xe0
[&lt;ffffffff817244bf&gt;] tracesys+0xe1/0xe6
[&lt;ffffffffffffffff&gt;] 0xffffffffffffffff

The call path indicates:
- f2fs_add_link
   : down_write(&amp;fi-&gt;i_sem);

 - init_inode_metadata
   - f2fs_init_acl
     - __f2fs_set_acl
       - f2fs_setxattr
         : down_write(&amp;fi-&gt;i_sem);

Here we should not call f2fs_setxattr, but __f2fs_setxattr.
But __f2fs_setxattr is a static function in xattr.c, so that I found the other
generic approach to use f2fs_setxattr.

In f2fs_setxattr, the page pointer is only given from init_inode_metadata.
So, this patch adds this condition to avoid this in f2fs_setxattr.

Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
</feed>
