Function report | 
Source Code:security\selinux\hooks.c | 
Create Date:2022-07-28 19:02:28 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:selinux_setprocattr
Proto:static int selinux_setprocattr(const char *name, void *value, size_t size)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| const char * | name | |
| void * | value | |
| size_t | size | 
| 6336 | mysid = get the subjective security ID of the current task , sid = 0 | 
| 6343 | If Not strcmp(name, "exec") Then error = avc_has_perm - Check permissions and perform any appropriate auditing | 
| 6347 | Else if Not strcmp(name, "fscreate") Then error = avc_has_perm - Check permissions and perform any appropriate auditing | 
| 6351 | Else if Not strcmp(name, "keycreate") Then error = avc_has_perm - Check permissions and perform any appropriate auditing | 
| 6355 | Else if Not strcmp(name, "sockcreate") Then error = avc_has_perm - Check permissions and perform any appropriate auditing | 
| 6359 | Else if Not strcmp(name, "current") Then error = avc_has_perm - Check permissions and perform any appropriate auditing | 
| 6374 | error = security_context_to_sid( & selinux_state, value, size, & sid, GFP_KERNEL) | 
| 6377 | If Not has_cap_mac_admin(true) Then | 
| 6383 | If str[size - 1] == '\0' Then audit_size = size - 1 | 
| 6385 | Else audit_size = size | 
| 6387 | ab = audit_log_start - obtain an audit buffer*@ctx: audit_context (may be NULL)*@gfp_mask: type of allocation*@type: audit message type* Returns audit_buffer pointer on success or NULL on error | 
| 6394 | Return error | 
| 6396 | error = security_context_to_sid_force( & selinux_state, value, size, & sid) | 
| 6404 | new = prepare_creds - Prepare a new set of credentials for modification* Prepare a new set of task credentials for modification | 
| 6414 | tsec = selinux_cred(new) | 
| 6418 | fscreate SID = sid | 
| 6428 | fscreate SID = sid | 
| 6431 | If sid == 0 Then Go to abort_change | 
| 6437 | error = security_bounded_transition( & selinux_state, current SID , sid) | 
| 6439 | If error Then Go to abort_change | 
| 6447 | If error Then Go to abort_change | 
| 6452 | ptsid = prm security operations | 
| 6453 | If ptsid != 0 Then | 
| 6457 | If error Then Go to abort_change | 
| 6461 | current SID = sid | 
| 6462 | Else | 
| 6464 | Go to abort_change | 
| 6468 | Return size | 
| 6470 | abort_change : | 
| 6472 | Return error | 
| 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  |