linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] overlayfs: copyup security inode field
@ 2014-03-19 15:20 Zakaria ElQotbi
  2014-03-20  5:17 ` J. R. Okajima
  0 siblings, 1 reply; 5+ messages in thread
From: Zakaria ElQotbi @ 2014-03-19 15:20 UTC (permalink / raw)
  To: miklos; +Cc: linux-fsdevel

SELinux (and maybe other security frameworks) relies on inode->i_security field
to perform audit of security contexts.

I think this field must be the same as the underlying filesystem, instead of
creating new fresh one at ovl_new_inode() which give an UNLABELED sid.

The issue rised when certain process (for instance Zygote) fails to perform
some actions (for instance getxattr) on Android using SEAndroid and overlyafs
with empty uppdir mounted on /system, but it succeeds in case there is not
overlayfs.

Signed-off-by: Zakaria ElQotbi <zakaria.elqotbi@redbend.com>
---
 fs/overlayfs/overlayfs.h |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h
index 3495a55..d28023a 100644
--- a/fs/overlayfs/overlayfs.h
+++ b/fs/overlayfs/overlayfs.h
@@ -60,6 +60,9 @@ static inline void ovl_copyattr(struct inode *from, struct inode *to)
 {
 	to->i_uid = from->i_uid;
 	to->i_gid = from->i_gid;
+#ifdef CONFIG_SECURITY
+	to->i_security = from->i_security;
+#endif
 }
 
 /* dir.c */
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-04-09 17:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-19 15:20 [PATCH] overlayfs: copyup security inode field Zakaria ElQotbi
2014-03-20  5:17 ` J. R. Okajima
2014-03-26 19:00   ` Zakaria ElQotbi
2014-03-27  4:58     ` J. R. Okajima
2014-04-09 17:14       ` Zakaria ElQotbi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).