Function report |
Source Code:fs\binfmt_misc.c |
Create Date:2022-07-28 20:27:41 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:This registers a new binary format, it recognises the syntax* ':name:type:offset:magic:mask:interpreter:flags'* where the ':' is the IFS, that can be chosen with the first char
Proto:static Node *create_entry(const char __user *buffer, size_t count)
Type:Node
Parameter:
| Type | Parameter | Name |
|---|---|---|
| const char __user * | buffer | |
| size_t | count |
| 332 | If count < 11 || count > Max length of the register string Then Go to out |
| 337 | e = Allocation memory |
| 344 | If copy_from_user(buf, buffer, count) Then Go to efault |
| 356 | p = strchr - Find the first occurrence of the character c in the string s.*@s: the string to be searched*@c: the character to search for |
| 359 | p++ = '\0' |
| 360 | If Not name[0] || Not strcmp(name, ".") || Not strcmp(name, "..") || strchr - Find the first occurrence of the character c in the string s.*@s: the string to be searched*@c: the character to search for Then Go to einval |
| 370 | Case ++ == 'E' |
| 374 | Case ++ == 'M' |
| 375 | pr_debug("register: type: M (magic)\n") |
| 376 | type, status, etc. = 1 << Enabled | 1 << Magic |
| 377 | Break |
| 378 | Default |
| 379 | Go to einval |
| 389 | s = strchr - Find the first occurrence of the character c in the string s.*@s: the string to be searched*@c: the character to search for |
| 392 | s = '\0' |
| 395 | If r != 0 || offset of magic < 0 Then Go to einval |
| 401 | pr_debug("register: offset: %#x\n", offset of magic ) |
| 404 | magic or filename extension = p |
| 408 | If Not magic or filename extension [0] Then Go to einval |
| 416 | mask, NULL for exact match = p |
| 420 | If Not mask, NULL for exact match [0] Then |
| 421 | mask, NULL for exact match = NULL |
| 422 | pr_debug("register: mask[raw]: none\n") |
| 435 | If mask, NULL for exact match && string_unescape_inplace( mask, NULL for exact match , UNESCAPE_HEX) != size of magic/mask Then Go to einval |
| 438 | If size of magic/mask > sizeof(linux_binprm->buf) || sizeof(linux_binprm->buf) - size of magic/mask < offset of magic Then Go to einval |
| 441 | pr_debug("register: magic/mask length: %i\n", size of magic/mask ) |
| 442 | If USE_DEBUG Then |
| 447 | If mask, NULL for exact match Then |
| 449 | masked = Allocation memory |
| 455 | If masked Then |
| 456 | When i < size of magic/mask cycle masked[i] = magic or filename extension [i] & mask, NULL for exact match [i] |
| 466 | Else |
| 470 | p = strchr - Find the first occurrence of the character c in the string s.*@s: the string to be searched*@c: the character to search for |
| 473 | p++ = '\0' |
| 476 | magic or filename extension = p |
| 477 | p = strchr - Find the first occurrence of the character c in the string s.*@s: the string to be searched*@c: the character to search for |
| 480 | p++ = '\0' |
| 481 | If Not magic or filename extension [0] || strchr - Find the first occurrence of the character c in the string s.*@s: the string to be searched*@c: the character to search for Then Go to einval |
| 483 | pr_debug("register: extension: {%s}\n", magic or filename extension ) |
| 486 | p = strchr - Find the first occurrence of the character c in the string s.*@s: the string to be searched*@c: the character to search for |
| 489 | p++ = '\0' |
| 493 | filename of interpreter = p |
| 494 | p = strchr - Find the first occurrence of the character c in the string s.*@s: the string to be searched*@c: the character to search for |
| 497 | p++ = '\0' |
| 498 | If Not filename of interpreter [0] Then Go to einval |
| 500 | pr_debug("register: interpreter: {%s}\n", filename of interpreter ) |
| 503 | p = check_special_flags(p, e) |
| 509 | Return e |
| 511 | out : |
| 514 | efault : |
| 517 | einval : |
| Name | Describe |
|---|---|
| bm_register_write | /register |
| 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 |