Commit a7cf4145 authored by Eric Paris's avatar Eric Paris Committed by Al Viro
Browse files

anon_inode: set S_IFREG on the anon_inode

anon_inode_mkinode() sets inode->i_mode = S_IRUSR | S_IWUSR;  This means
that (inode->i_mode & S_IFMT) == 0.  This trips up some SELinux code that
needs to determine if a given inode is a regular file, a directory, etc.
The easiest solution is to just make sure that the anon_inode also sets
Signed-off-by: default avatarEric Paris <>
Signed-off-by: default avatarAl Viro <>
parent b7bb0a12
...@@ -205,7 +205,7 @@ static struct inode *anon_inode_mkinode(void) ...@@ -205,7 +205,7 @@ static struct inode *anon_inode_mkinode(void)
* that it already _is_ on the dirty list. * that it already _is_ on the dirty list.
*/ */
inode->i_state = I_DIRTY; inode->i_state = I_DIRTY;
inode->i_mode = S_IRUSR | S_IWUSR; inode->i_mode = S_IFREG | S_IRUSR | S_IWUSR;
inode->i_uid = current_fsuid(); inode->i_uid = current_fsuid();
inode->i_gid = current_fsgid(); inode->i_gid = current_fsgid();
inode->i_flags |= S_PRIVATE; inode->i_flags |= S_PRIVATE;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment