The function interate_dir() interfaces with the security layer.
For some kernel versions on platforms that use app armour it
expects f_cred to be set. Currently osd-ldiskfs open codes the
creation of struct file so it is missing a cred. Fix this by
setting f_cred to the default current_cred().
Test-Parameters: testlist=sanity-lfsck serverdistro=sles12sp3
Change-Id: I38487e8ae99a0f70d6e430935b7d19523d414b4b
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/37184
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Li Dongyang <dongyangli@ddn.com>
filp->f_mapping = inode->i_mapping;
filp->f_op = fops;
filp->private_data = NULL;
filp->f_mapping = inode->i_mapping;
filp->f_op = fops;
filp->private_data = NULL;
+ filp->f_cred = current_cred();
set_file_inode(filp, inode);
rc = osd_security_file_alloc(filp);
if (rc)
set_file_inode(filp, inode);
rc = osd_security_file_alloc(filp);
if (rc)
down_read(&obj->oo_ext_idx_sem);
}
down_read(&obj->oo_ext_idx_sem);
}
+ filp->f_cred = current_cred();
rc = osd_security_file_alloc(filp);
if (rc)
RETURN(rc);
rc = osd_security_file_alloc(filp);
if (rc)
RETURN(rc);
filp->f_mapping = inode->i_mapping;
filp->f_op = fops;
filp->private_data = NULL;
filp->f_mapping = inode->i_mapping;
filp->f_op = fops;
filp->private_data = NULL;
+ filp->f_cred = current_cred();
set_file_inode(filp, inode);
rc = osd_security_file_alloc(filp);
if (rc)
set_file_inode(filp, inode);
rc = osd_security_file_alloc(filp);
if (rc)