Lines Matching defs:inode

181 static int smk_bu_inode(struct inode *inode, int mode, int rc)
184 struct inode_smack *isp = smack_inode(inode);
188 pr_info("Smack Unconfined Corruption: inode=(%s %ld) %s\n",
189 inode->i_sb->s_id, inode->i_ino, current->comm);
201 pr_info("Smack %s: (%s %s %s) inode=(%s %ld) %s\n", smk_bu_mess[rc],
203 inode->i_sb->s_id, inode->i_ino, current->comm);
207 #define smk_bu_inode(inode, mode, RC) (RC)
215 struct inode *inode = file_inode(file);
216 struct inode_smack *isp = smack_inode(inode);
220 pr_info("Smack Unconfined Corruption: inode=(%s %ld) %s\n",
221 inode->i_sb->s_id, inode->i_ino, current->comm);
230 sskp->smk_known, smk_of_inode(inode)->smk_known, acc,
231 inode->i_sb->s_id, inode->i_ino, file,
245 struct inode *inode = file_inode(file);
246 struct inode_smack *isp = smack_inode(inode);
250 pr_info("Smack Unconfined Corruption: inode=(%s %ld) %s\n",
251 inode->i_sb->s_id, inode->i_ino, current->comm);
260 sskp->smk_known, smk_of_inode(inode)->smk_known, acc,
261 inode->i_sb->s_id, inode->i_ino, file,
272 * @ip: a pointer to the inode
278 static struct smack_known *smk_fetch(const char *name, struct inode *ip,
306 * init_inode_smack - initialize an inode security blob
307 * @inode: inode to extract the info from
311 static void init_inode_smack(struct inode *inode, struct smack_known *skp)
313 struct inode_smack *isp = smack_inode(inode);
774 struct inode *inode = d_backing_inode(root);
784 if (inode->i_security == NULL) {
785 int rc = lsm_inode_alloc(inode);
853 * Initialize the root inode.
855 init_inode_smack(inode, sp->smk_root);
858 isp = smack_inode(inode);
898 struct inode *inode = file_inode(bprm->file);
904 isp = smack_inode(inode);
908 sbsp = inode->i_sb->s_security;
947 * smack_inode_alloc_security - allocate an inode blob
948 * @inode: the inode in need of a blob
952 static int smack_inode_alloc_security(struct inode *inode)
956 init_inode_smack(inode, skp);
961 * smack_inode_init_security - copy out the smack from an inode
962 * @inode: the newly created inode
971 static int smack_inode_init_security(struct inode *inode, struct inode *dir,
976 struct inode_smack *issp = smack_inode(inode);
978 struct smack_known *isp = smk_of_inode(inode);
1001 * Mark the inode as changed.
1009 * inode label was already set correctly in
1035 static int smack_inode_link(struct dentry *old_dentry, struct inode *dir,
1060 * smack_inode_unlink - Smack check on inode deletion
1067 static int smack_inode_unlink(struct inode *dir, struct dentry *dentry)
1069 struct inode *ip = d_backing_inode(dentry);
1101 static int smack_inode_rmdir(struct inode *dir, struct dentry *dentry)
1139 static int smack_inode_rename(struct inode *old_inode,
1141 struct inode *new_inode,
1166 * @inode: the inode in question
1173 static int smack_inode_permission(struct inode *inode, int mask)
1175 struct superblock_smack *sbsp = inode->i_sb->s_security;
1188 if (smk_of_inode(inode) != sbsp->smk_root)
1196 smk_ad_setfield_u_fs_inode(&ad, inode);
1197 rc = smk_curacc(smk_of_inode(inode), mask, &ad);
1198 rc = smk_bu_inode(inode, mask, rc);
1236 struct inode *inode = d_backing_inode(path->dentry);
1241 rc = smk_curacc(smk_of_inode(inode), MAY_READ, &ad);
1242 rc = smk_bu_inode(inode, MAY_READ, rc);
1320 * Set the pointer in the inode blob to the entry found
1431 * @inode: the object
1438 static int smack_inode_getsecurity(struct inode *inode,
1445 struct inode *ip = (struct inode *)inode;
1452 isp = smk_of_inode(inode);
1454 ispp = smack_inode(inode);
1498 * @inode: the object
1502 static int smack_inode_listsecurity(struct inode *inode, char *buffer,
1514 * smack_inode_getsecid - Extract inode's security id
1515 * @inode: inode to extract the info from
1518 static void smack_inode_getsecid(struct inode *inode, u32 *secid)
1520 struct smack_known *skp = smk_of_inode(inode);
1575 struct inode *inode = file_inode(file);
1577 if (unlikely(IS_PRIVATE(inode)))
1584 rc = smk_curacc(smk_of_inode(inode), MAY_WRITE, &ad);
1589 rc = smk_curacc(smk_of_inode(inode), MAY_READ, &ad);
1607 struct inode *inode = file_inode(file);
1609 if (unlikely(IS_PRIVATE(inode)))
1614 rc = smk_curacc(smk_of_inode(inode), MAY_LOCK, &ad);
1636 struct inode *inode = file_inode(file);
1638 if (unlikely(IS_PRIVATE(inode)))
1648 rc = smk_curacc(smk_of_inode(inode), MAY_LOCK, &ad);
1655 rc = smk_curacc(smk_of_inode(inode), MAY_WRITE, &ad);
1845 struct inode *inode = file_inode(file);
1850 if (unlikely(IS_PRIVATE(inode)))
1856 if (inode->i_sb->s_magic == SOCKFS_MAGIC) {
1857 sock = SOCKET_I(inode);
1882 rc = smk_curacc(smk_of_inode(inode), may, &ad);
1901 struct inode *inode = file_inode(file);
1907 rc = smk_tskacc(tsp, smk_of_inode(inode), MAY_READ, &ad);
2035 * @inode: points to the inode to use as a reference
2038 * as the objective context of the specified inode
2041 struct inode *inode)
2043 struct inode_smack *isp = smack_inode(inode);
2233 * smack_task_to_inode - copy task smack into the inode blob
2235 * @inode: inode to copy to
2237 * Sets the smack pointer in the inode security blob
2239 static void smack_task_to_inode(struct task_struct *p, struct inode *inode)
2241 struct inode_smack *isp = smack_inode(inode);
2702 * @inode: the object
2712 static int smack_inode_setsecurity(struct inode *inode, const char *name,
2716 struct inode_smack *nsp = smack_inode(inode);
2736 if (inode->i_sb->s_magic != SOCKFS_MAGIC)
2739 sock = SOCKET_I(inode);
3283 * smack_d_instantiate - Make sure the blob is correct on an inode
3284 * @opt_dentry: dentry where inode will be attached
3285 * @inode: the object
3287 * Set the inode's security blob if it hasn't been done already.
3289 static void smack_d_instantiate(struct dentry *opt_dentry, struct inode *inode)
3302 if (inode == NULL)
3305 isp = smack_inode(inode);
3308 * If the inode is already instantiated
3314 sbp = inode->i_sb;
3323 * If this is the root inode the superblock
3422 if (S_ISSOCK(inode->i_mode)) {
3432 if (!(inode->i_opflags & IOP_XATTR))
3438 skp = smk_fetch(XATTR_NAME_SMACK, inode, dp);
3445 if (S_ISDIR(inode->i_mode)) {
3448 * transmuted when the inode was initialized
3450 * and mark the inode.
3453 * directory mark the inode.
3457 rc = __vfs_setxattr(dp, inode,
3462 rc = __vfs_getxattr(dp, inode,
3475 skp = smk_fetch(XATTR_NAME_SMACKEXEC, inode, dp);
3481 skp = smk_fetch(XATTR_NAME_SMACKMMAP, inode, dp);
4628 static int smack_inode_notifysecctx(struct inode *inode, void *ctx, u32 ctxlen)
4630 return smack_inode_setsecurity(inode, XATTR_SMACK_SUFFIX, ctx, ctxlen, 0);
4638 static int smack_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen)
4640 struct smack_known *skp = smk_of_inode(inode);
4664 * Get label from overlay inode and set it in create_sid