linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* ext4, f2fs: fscrypt_has_permitted_context() check in file open
@ 2016-09-22 12:24 Richard Weinberger
  2016-09-22 13:44 ` Theodore Ts'o
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Weinberger @ 2016-09-22 12:24 UTC (permalink / raw)
  To: Theodore Ts'o, Jaegeuk Kim
  Cc: linux-ext4, linux-f2fs-devel, linux-fsdevel,
	linux-kernel@vger.kernel.org

Hi!

Both ext4 and f2fs check in the file open code the context of the parent directory too:

ext4:
        if (ext4_encrypted_inode(d_inode(dir)) &&
                        !fscrypt_has_permitted_context(d_inode(dir), inode)) {
                ext4_warning(inode->i_sb,
                             "Inconsistent encryption contexts: %lu/%lu",
                             (unsigned long) d_inode(dir)->i_ino,
                             (unsigned long) inode->i_ino);
                dput(dir);
                return -EPERM;
        }

f2fs:
        if (f2fs_encrypted_inode(d_inode(dir)) &&
                        !fscrypt_has_permitted_context(d_inode(dir), inode)) {
                dput(dir);
                return -EPERM;
        }

Why do we need this check? AFAIK this situation can never happen unless due to
a bug in the filesystem code.

Thanks,
//richard

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

end of thread, other threads:[~2016-09-22 16:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-22 12:24 ext4, f2fs: fscrypt_has_permitted_context() check in file open Richard Weinberger
2016-09-22 13:44 ` Theodore Ts'o
2016-09-22 14:21   ` Richard Weinberger
2016-09-22 15:59     ` Theodore Ts'o

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).