Linux filesystem development
 help / color / mirror / Atom feed
From: Zakaria ElQotbi <zakaria.elqotbi@redbend.com>
To: <miklos@szeredi.hu>
Cc: <linux-fsdevel@vger.kernel.org>
Subject: [PATCH] overlayfs: copyup security inode field
Date: Wed, 19 Mar 2014 16:20:07 +0100	[thread overview]
Message-ID: <20140319152007.GF7642@w-fr-zakariae> (raw)

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


             reply	other threads:[~2014-03-19 15:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-19 15:20 Zakaria ElQotbi [this message]
2014-03-20  5:17 ` [PATCH] overlayfs: copyup security inode field 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140319152007.GF7642@w-fr-zakariae \
    --to=zakaria.elqotbi@redbend.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox