| Function report | 
| Source Code: kernel\audit.c | Create Date:2022-07-28 11:23:16 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:audit_receive_msg
Proto:static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| struct sk_buff * | skb | |
| struct nlmsghdr * | nlh | 
| 1178 | msg_type = Message content | 
| 1180 | char * ctx = NULL | 
| 1187 | seq = Sequence number | 
| 1192 | Case msg_type == Get status | 
| 1199 | pid of auditd process = auditd_pid_vnr - Return the auditd PID relative to the namespace* Description:* Returns the PID in relation to the namespace, 0 on failure. | 
| 1201 | waiting messages limit = Number of outstanding audit_buffers allowed.* When set to zero, this means unlimited. | 
| 1203 | messages waiting in queue = skb_queue_len - get queue length*@list_: list to measure* Return the length of an &sk_buff queue. | 
| 1207 | Break | 
| 1209 | Case msg_type == Set status (enable/disable/auditd) | 
| 1213 | No 3D Now!( & s, data, min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(size_t, size of s , data_len)) | 
| 1214 | If Bit mask for valid entries & Mask values Then | 
| 1215 | err = audit_set_enabled( 1 = enabled, 0 = disabled ) | 
| 1219 | If Bit mask for valid entries & AUDIT_STATUS_FAILURE Then | 
| 1220 | err = audit_set_failure( Failure-to-log action ) | 
| 1224 | If Bit mask for valid entries & AUDIT_STATUS_PID Then | 
| 1231 | new_pid = pid of auditd process | 
| 1233 | req_pid = task_tgid(current process) | 
| 1241 | audit_replace(req_pid) | 
| 1243 | auditd_pid = auditd_pid_vnr - Return the auditd PID relative to the namespace* Description:* Returns the PID in relation to the namespace, 0 on failure. | 
| 1244 | If auditd_pid Then | 
| 1246 | If new_pid Then | 
| 1247 | audit_log_config_change("audit_pid", new_pid, auditd_pid, 0) | 
| 1249 | Return -EEXIST | 
| 1252 | If pid_vnr(req_pid) != auditd_pid Then | 
| 1253 | audit_log_config_change("audit_pid", new_pid, auditd_pid, 0) | 
| 1255 | Return -EACCES | 
| 1259 | If new_pid Then | 
| 1264 | If audit_enabled != AUDIT_OFF Then audit_log_config_change("audit_pid", new_pid, auditd_pid, err ? 0 : 1) | 
| 1273 | wake_up_interruptible( & kauditd_wait) | 
| 1274 | Else | 
| 1275 | If audit_enabled != AUDIT_OFF Then audit_log_config_change("audit_pid", new_pid, auditd_pid, 1) | 
| 1284 | If Bit mask for valid entries & AUDIT_STATUS_RATE_LIMIT Then | 
| 1289 | If Bit mask for valid entries & AUDIT_STATUS_BACKLOG_LIMIT Then | 
| 1290 | err = audit_set_backlog_limit( waiting messages limit ) | 
| 1294 | If Bit mask for valid entries & AUDIT_STATUS_BACKLOG_WAIT_TIME Then | 
| 1295 | If size of s > Length of message including header Then Return -EINVAL | 
| 1297 | If message queue wait timeout > 10 * AUDIT_BACKLOG_WAIT_TIME Then Return -EINVAL | 
| 1303 | If Bit mask for valid entries == AUDIT_STATUS_LOST Then | 
| 1306 | audit_log_config_change("lost", 0, lost, 1) | 
| 1307 | Return lost | 
| 1309 | Break | 
| 1311 | Case msg_type == Get which features are enabled | 
| 1316 | Case msg_type == Turn an audit feature on or off | 
| 1317 | If data_len < sizeof(structaudit_features) Then Return -EINVAL | 
| 1319 | err = audit_set_feature(data) | 
| 1322 | Break | 
| 1323 | Case msg_type == Message from userspace -- deprecated | 
| 1325 | Case msg_type == More user space messages ...AUDIT_LAST_USER_MSG2 | 
| 1326 | If Not audit_enabled && msg_type != We filter this differently Then Return 0 | 
| 1330 | If err == 1 Then | 
| 1333 | err = 0 | 
| 1334 | If msg_type == Non-ICANON TTY input meaning Then | 
| 1335 | err = tty_audit_push() | 
| 1336 | If err Then Break | 
| 1339 | audit_log_user_recv_msg( & ab, msg_type) | 
| 1340 | If msg_type != Non-ICANON TTY input meaning Then | 
| 1346 | Else | 
| 1354 | Break | 
| 1355 | Case msg_type == Add syscall filtering rule | 
| 1356 | Case msg_type == Delete syscall filtering rule | 
| 1357 | If data_len < sizeof(structaudit_rule_data) Then Return -EINVAL | 
| 1359 | If audit_enabled == AUDIT_LOCKED Then | 
| 1367 | Return -EPERM | 
| 1370 | Break | 
| 1371 | Case msg_type == List syscall filtering rules | 
| 1372 | err = audit_list_rules_send - list the audit rules*@request_skb: skb of request we are replying to (used to target the reply)*@seq: netlink audit message sequence (serial) number | 
| 1373 | Break | 
| 1374 | Case msg_type == Trim junk from watched tree | 
| 1375 | audit_trim_trees() | 
| 1380 | Break | 
| 1381 | Case msg_type == Append to watched tree | 
| 1390 | No 3D Now!(sizes, bufp, 2 * sizeof(u32)) | 
| 1393 | old = audit_unpack_string( & bufp, & msglen, sizes[0]) | 
| 1398 | new = audit_unpack_string( & bufp, & msglen, sizes[1]) | 
| 1405 | err = audit_tag_tree(old, new) | 
| 1417 | Break | 
| 1419 | Case msg_type == Get info about sender of signal to auditd | 
| 1420 | len = 0 | 
| 1421 | If audit_sig_sid Then | 
| 1422 | err = security_secid_to_secctx(audit_sig_sid, & ctx, & len) | 
| 1426 | sig_data = Allocation memory | 
| 1427 | If Not sig_data Then | 
| 1428 | If audit_sig_sid Then security_release_secctx(ctx, len) | 
| 1430 | Return -ENOMEM | 
| 1433 | pid = audit_sig_pid | 
| 1434 | If audit_sig_sid Then | 
| 1435 | No 3D Now!(ctx, ctx, len) | 
| 1436 | security_release_secctx(ctx, len) | 
| 1441 | Break | 
| 1442 | Case msg_type == Get TTY auditing status | 
| 1448 | 1 = enabled, 0 = disabled = Not Not (t & AUDIT_TTY_LOG_PASSWD) | 
| 1451 | Break | 
| 1453 | Case msg_type == Set TTY auditing status | 
| 1460 | No 3D Now!( & s, data, min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(size_t, size of s , data_len)) | 
| 1462 | If 1 = enabled, 0 = disabled != 0 && 1 = enabled, 0 = disabled != 1 || 1 = enabled, 0 = disabled != 0 && 1 = enabled, 0 = disabled != 1 Then err = -EINVAL | 
| 1468 | Else | 
| 1473 | 1 = enabled, 0 = disabled = Not Not (t & AUDIT_TTY_LOG_PASSWD) | 
| 1482 | Break | 
| 1484 | Default | 
| Name | Describe | 
|---|---|
| audit_receive | audit_receive - receive messages from a netlink control socket*@skb: the message buffer* Parse the provided skb and deal with any messages that may be present,* malformed skbs are discarded. | 
| 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 |