Function report |
Source Code:security\selinux\hooks.c |
Create Date:2022-07-28 18:54:52 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:inode_doinit_with_dentry
Proto:static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dentry)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct inode * | inode | |
struct dentry * | opt_dentry |
1433 | struct superblock_security_struct * sbsec = NULL |
1434 | isec = selinux_inode(inode) |
1435 | sid = 0 |
1438 | rc = 0 |
1440 | If initialization flag == initialized Then Return 0 |
1444 | If initialization flag == initialized Then Go to out_unlock |
1447 | If security class of this object == SECCLASS_FILE Then security class of this object = inode_mode_to_security_class(i_mode) |
1450 | sbsec = s_security |
1451 | If Not ( which mount options were specified & Non-mount related flags ) Then |
1458 | spin_unlock( & isec_lock) |
1459 | Go to out_unlock |
1463 | task_sid = SID of creating task |
1464 | sid = SID of this object |
1465 | initialization flag = LABEL_PENDING |
1466 | spin_unlock( & lock) |
1469 | Case labeling behavior == use native label support |
1470 | Break |
1471 | Case labeling behavior == use xattr |
1473 | sid = default SID for labeling |
1474 | Break |
1478 | If opt_dentry Then |
1481 | Else |
1489 | If Not dentry Then dentry = d_find_any_alias(inode) |
1492 | If Not dentry Then |
1502 | Go to out |
1505 | rc = inode_doinit_use_xattr(inode, dentry, default SID for labeling , & sid) |
1510 | Break |
1511 | Case labeling behavior == use task SIDs, e.g. pipefs/sockfs |
1514 | Case labeling behavior == use transition SIDs, e.g. devpts/tmpfs |
1516 | sid = SID of file system superblock |
1519 | rc = security_transition_sid( & selinux_state, task_sid, sid, sclass, NULL, & sid) |
1523 | Break |
1524 | Case labeling behavior == use mountpoint labeling |
1526 | Break |
1527 | Default |
1529 | sid = SID of file system superblock |
1531 | If which mount options were specified & SE_SBGENFS && Not S_ISLNK(i_mode) Then |
1534 | If opt_dentry Then |
1538 | Else |
1544 | If Not dentry Then dentry = d_find_any_alias(inode) |
1558 | rc = selinux_genfs_get_sid(dentry, sclass, which mount options were specified , & sid) |
1560 | If rc Then |
1565 | If which mount options were specified & SE_SBGENFS_XATTR && i_opflags & IOP_XATTR Then |
1569 | If rc Then |
1576 | Break |
1579 | out : |
1581 | If initialization flag == LABEL_PENDING Then |
1591 | out_unlock : |
1592 | spin_unlock( & lock) |
1593 | Return rc |
Name | Describe |
---|---|
__inode_security_revalidate | Try reloading inode security labels that have been marked as invalid. The*@may_sleep parameter indicates when sleeping and thus reloading labels is* allowed; when set to false, returns -ECHILD when the label is* invalid |
inode_doinit | |
sb_finish_set_opts | |
selinux_d_instantiate |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |