<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/overlayfs/dir.c, branch linux-4.8.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.8.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.8.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2016-10-28T07:45:23Z</updated>
<entry>
<title>ovl: Fix info leak in ovl_lookup_temp()</title>
<updated>2016-10-28T07:45:23Z</updated>
<author>
<name>Richard Weinberger</name>
</author>
<published>2016-09-16T09:45:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=05cc17e076ea335385db7ac2896c4f3db46ccd15'/>
<id>urn:sha1:05cc17e076ea335385db7ac2896c4f3db46ccd15</id>
<content type='text'>
commit 6a45b3628ce4dcf7498b39c87d475bab6e2a9b24 upstream.

The function uses the memory address of a struct dentry as unique id.
While the address-based directory entry is only visible to root it is IMHO
still worth fixing since the temporary name does not have to be a kernel
address.  It can be any unique number.  Replace it by an atomic integer
which is allowed to wrap around.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Fixes: e9be9d5e76e3 ("overlay filesystem")
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ovl: Switch to generic_getxattr</title>
<updated>2016-09-01T09:12:00Z</updated>
<author>
<name>Andreas Gruenbacher</name>
</author>
<published>2016-08-22T15:52:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0eb45fc3bb7a2cf9c9c93d9e95986a841e5f4625'/>
<id>urn:sha1:0eb45fc3bb7a2cf9c9c93d9e95986a841e5f4625</id>
<content type='text'>
Now that overlayfs has xattr handlers for iop-&gt;{set,remove}xattr, use
those same handlers for iop-&gt;getxattr as well.

Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: Switch to generic_removexattr</title>
<updated>2016-09-01T09:12:00Z</updated>
<author>
<name>Andreas Gruenbacher</name>
</author>
<published>2016-08-22T15:22:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0e585ccc13b3edbb187fb4f1b7cc9397f17d64a9'/>
<id>urn:sha1:0e585ccc13b3edbb187fb4f1b7cc9397f17d64a9</id>
<content type='text'>
Commit d837a49bd57f ("ovl: fix POSIX ACL setting") switches from
iop-&gt;setxattr from ovl_setxattr to generic_setxattr, so switch from
ovl_removexattr to generic_removexattr as well.  As far as permission
checking goes, the same rules should apply in either case.

While doing that, rename ovl_setxattr to ovl_xattr_set to indicate that
this is not an iop-&gt;setxattr implementation and remove the unused inode
argument.

Move ovl_other_xattr_set above ovl_own_xattr_set so that they match the
order of handlers in ovl_xattr_handlers.

Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
Fixes: d837a49bd57f ("ovl: fix POSIX ACL setting")
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: handle umask and posix_acl_default correctly on creation</title>
<updated>2016-09-01T09:11:59Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2016-09-01T09:11:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=38b256973ea90fc7c2b7e1b734fa0e8b83538d50'/>
<id>urn:sha1:38b256973ea90fc7c2b7e1b734fa0e8b83538d50</id>
<content type='text'>
Setting MS_POSIXACL in sb-&gt;s_flags has the side effect of passing mode to
create functions without masking against umask.

Another problem when creating over a whiteout is that the default posix acl
is not inherited from the parent dir (because the real parent dir at the
time of creation is the work directory).

Fix these problems by:

 a) If upper fs does not have MS_POSIXACL, then mask mode with umask.

 b) If creating over a whiteout, call posix_acl_create() to get the
 inherited acls.  After creation (but before moving to the final
 destination) set these acls on the created file.  posix_acl_create() also
 updates the file creation mode as appropriate.

Fixes: 39a25b2b3762 ("ovl: define -&gt;get_acl() for overlay inodes")
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: simplify empty checking</title>
<updated>2016-07-29T10:05:25Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2016-07-29T10:05:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=30c17ebfb2a11468fe825de19afa3934ee98bfd2'/>
<id>urn:sha1:30c17ebfb2a11468fe825de19afa3934ee98bfd2</id>
<content type='text'>
The empty checking logic is duplicated in ovl_check_empty_and_clear() and
ovl_remove_and_whiteout(), except the condition for clearing whiteouts is
different:

ovl_check_empty_and_clear() checked for being upper

ovl_remove_and_whiteout() checked for merge OR lower

Move the intersection of those checks (upper AND merge) into
ovl_check_empty_and_clear() and simplify ovl_remove_and_whiteout().

Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: clear nlink on rmdir</title>
<updated>2016-07-29T10:05:24Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2016-07-29T10:05:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dbc816d05ddcfb189af8784d04fc84c812db3747'/>
<id>urn:sha1:dbc816d05ddcfb189af8784d04fc84c812db3747</id>
<content type='text'>
To make delete notification work on fa/inotify.

Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: fix POSIX ACL setting</title>
<updated>2016-07-29T10:05:24Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2016-07-29T10:05:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d837a49bd57f1ec2f6411efa829fecc34002b110'/>
<id>urn:sha1:d837a49bd57f1ec2f6411efa829fecc34002b110</id>
<content type='text'>
Setting POSIX ACL needs special handling:

1) Some permission checks are done by -&gt;setxattr() which now uses mounter's
creds ("ovl: do operations on underlying file system in mounter's
context").  These permission checks need to be done with current cred as
well.

2) Setting ACL can fail for various reasons.  We do not need to copy up in
these cases.

In the mean time switch to using generic_setxattr.

[Arnd Bergmann] Fix link error without POSIX ACL. posix_acl_from_xattr()
doesn't have a 'static inline' implementation when CONFIG_FS_POSIX_ACL is
disabled, and I could not come up with an obvious way to do it.

This instead avoids the link error by defining two sets of ACL operations
and letting the compiler drop one of the two at compile time depending
on CONFIG_FS_POSIX_ACL. This avoids all references to the ACL code,
also leading to smaller code.

Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: share inode for hard link</title>
<updated>2016-07-29T10:05:24Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2016-07-29T10:05:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=51f7e52dc943468c6929fa0a82d4afac3c8e9636'/>
<id>urn:sha1:51f7e52dc943468c6929fa0a82d4afac3c8e9636</id>
<content type='text'>
Inode attributes are copied up to overlay inode (uid, gid, mode, atime,
mtime, ctime) so generic code using these fields works correcty.  If a hard
link is created in overlayfs separate inodes are allocated for each link.
If chmod/chown/etc. is performed on one of the links then the inode
belonging to the other ones won't be updated.

This patch attempts to fix this by sharing inodes for hard links.

Use inode hash (with real inode pointer as a key) to make sure overlay
inodes are shared for hard links on upper.  Hard links on lower are still
split (which is not user observable until the copy-up happens, see
Documentation/filesystems/overlayfs.txt under "Non-standard behavior").

The inode is only inserted in the hash if it is non-directoy and upper.

Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: store real inode pointer in -&gt;i_private</title>
<updated>2016-07-29T10:05:24Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2016-07-29T10:05:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=39b681f8026c170a73972517269efc830db0d7ce'/>
<id>urn:sha1:39b681f8026c170a73972517269efc830db0d7ce</id>
<content type='text'>
To get from overlay inode to real inode we currently use 'struct
ovl_entry', which has lifetime connected to overlay dentry.  This is okay,
since each overlay dentry had a new overlay inode allocated.

Following patch will break that assumption, so need to leave out ovl_entry.
This patch stores the real inode directly in i_private, with the lowest bit
used to indicate whether the inode is upper or lower.

Lifetime rules remain, using ovl_inode_real() must only be done while
caller holds ref on overlay dentry (and hence on real dentry), or within
RCU protected regions.

Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: update atime on upper</title>
<updated>2016-07-29T10:05:23Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2016-07-29T10:05:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d719e8f268fa4f9944b24b60814da9017dfb7787'/>
<id>urn:sha1:d719e8f268fa4f9944b24b60814da9017dfb7787</id>
<content type='text'>
Fix atime update logic in overlayfs.

This patch adds an i_op-&gt;update_time() handler to overlayfs inodes.  This
forwards atime updates to the upper layer only.  No atime updates are done
on lower layers.

Remove implicit atime updates to underlying files and directories with
O_NOATIME.  Remove explicit atime update in ovl_readlink().

Clear atime related mnt flags from cloned upper mount.  This means atime
updates are controlled purely by overlayfs mount options.

Reported-by: Konstantin Khlebnikov &lt;koct9i@gmail.com&gt; 
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
</feed>
