函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:include\linux\slab.h Create Date:2022-07-27 06:59:04
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:开辟内存

函数原型:static __always_inline void *kmalloc(size_t size, gfp_t flags)

返回类型:void

参数:

类型参数名称
size_tsize
gfp_tflags
544  如果__builtin_constant_p(size)则
548  如果size大于Maximum size for which we actually use a slab cache 则返回:kmalloc_large(size, flags)
561  返回:开辟内存
调用者
名称描述
kobject_renamekobject_rename() - Change the name of an object
kobject_move移动对象
alloc_ldt_structThe caller must call finalize_ldt_struct on the result. LDT starts zeroed.
do_open
build_socket_tables
kdump_buf_page_init
kmalloc_parameter
__kthread_create_on_node
call_modprobe
groups_alloc
psi_trigger_create
lock_torture_stats_printPrint torture statistics
stress_reorder_work
stress
pm_vt_switch_requiredpm_vt_switch_required - indicate VT switch at suspend requirements*@dev: device*@required: if true, caller needs VT switch at suspend/resume time* The different console drivers may or may not require VT switches across* suspend/resume, depending on how
__register_nosave_regiongister_nosave_region - Register a region of unsaveable memory.* Register a range of page frames the contents of which should not be saved* during hibernation (to be used in the early initialization code).
save_image_lzosave_image_lzo - Save the suspend image data compressed with LZO.*@handle: Swap map handle to use for saving the image.*@snapshot: Image to read data from.*@nr_to_write: Number of pages to save.
load_image_lzoload_image_lzo - Load compressed image data and decompress them with LZO.*@handle: Swap map handle to use for loading data.*@snapshot: Image to copy uncompressed data into.*@nr_to_read: Number of pages to load.
devkmsg_write
devkmsg_open
syslog_print
syslog_print_all
rcu_torture_timerRCU torture reader from timer handler. Dereferences rcu_torture_current,* incrementing the corresponding element of the pipeline array. The* counter in the element should never be greater than 1, otherwise, the* RCU implementation is broken.
rcu_torture_fwd_prog_crCarry out call_rcu() forward-progress testing.
rcu_perf_writerRCU perf writer kthread. Repeatedly does a grace period.
dma_common_contiguous_remapRemaps an allocated contiguous region into another vm_area.* Cannot be used in non-sleeping contexts
copy_module_elfPersist Elf information about a module. Copy the Elf header,* section header table, section string table, and symtab section* index from info to mod->klp_info.
do_init_moduleThis is where the real work happens.* Keep it uninlined to provide a reliable breakpoint target, e.g. for the gdb* helper command 'lx-symbols'.
cgroup_show_path
proc_cgroup_showproc_cgroup_show()* - Print task's cgroup paths into seq_file, one line for each hierarchy* - Used for /proc//cgroup.
cgroup1_release_agentNotify userspace when a cgroup is released, by running the* configured release agent with the name of the cgroup (path* relative to the root of cgroup file system) as the argument
current_css_set_cg_links_read
audit_send_replyaudit_send_reply - send an audit reply message via netlink*@request_skb: skb of request we are replying to (used to target the reply)*@seq: sequence number*@type: audit message type*@done: done (last) flag*@multi: multi-part message flag*@payload: payload
audit_receive_msg
audit_log_d_pathThis is a helper-function to print the escaped d_path
audit_unpack_stringUnpack a filter field's string representation from user-space* buffer.
audit_krule_to_dataTranslate kernel rule representation to struct audit_rule_data.
audit_list_rules_sendaudit_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
audit_log_execve_info
audit_log_proctitle
__audit_sockaddr__audit_sockaddr - record audit data for sys_bind, sys_connect, sys_sendto*@len: data length in user space*@a: data address in kernel space* Returns 0 for success or NULL context or < 0 on error.
__audit_log_bprm_fcaps__audit_log_bprm_fcaps - store information about a loading bprm and relevant fcaps*@bprm: pointer to the bprm being processed*@new: the proposed new credentials*@old: the old credentials* Simply check if the proc already has the caps given by the file and
alloc_tree
kcov_remote_add
__get_insn_slot__get_insn_slot() - Find a slot on an executable page for an instruction.* We allocate an executable page if there's no room on existing ones.
kprobe_add_ksym_blacklist
fei_write
kdb_strdupkdb_strdup - kdb equivalent of strdup, for disasm code.* Inputs:* str The string to duplicate.* type Flags to kmalloc for the new string.* Returns:* Address of the new string, NULL if storage could not be allocated.* Remarks:* This is not in lib/string
parse
allocate_probes
tracepoint_module_coming
ring_buffer_read_prepareg_buffer_read_prepare - Prepare for a non consuming read of the buffer*@buffer: The ring buffer to read from*@cpu: The cpu buffer to iterate over*@flags: gfp flags to use for memory allocation* This performs the initial preparations necessary to iterate
trace_pid_write
trace_parser_get_initrace_parser_get_init - gets the buffer for trace parser
register_tracergister_tracer - register a tracer with the ftrace system.*@type: the plugin for the tracer* Register a new plugin tracer.
trace_create_savedcmd
tracing_cpumask_read
tracing_resize_saved_cmdlines
tracing_stats_read
trace_parse_run_command
early_trace_init
hold_module_trace_bprintk_format
event_filter_read
subsystem_filter_read
show_header
create_new_subsystem
event_subsystem_dir
set_syscall_print_fmt
append_filter_err
set_synth_event_print_fmt
traceprobe_parse_probe_arg_bodyString length checking wrapper
traceprobe_set_print_fmt
trace_probe_add_file
map_lookup_elem
map_update_elem
map_get_next_key
map_lookup_and_delete_elem
copy_verifier_state
prog_array_map_poke_track
__cgroup_bpf_attach__cgroup_bpf_attach() - Attach the program to a cgroup, and* propagate the change to descendants*@cgrp: The cgroup which descendants to traverse*@prog: A program to attach*@type: Type of attach operation*@flags: Option flags
perf_event_mmap_event
build_map_info
__create_xol_area
dup_utask
prepare_uretprobe
torture_shuffle_task_registerRegister a task to be shuffled. If there is no memory, just splat* and don't bother registering.
find_link
dir_add
unpack_to_rootfs
identify_ramdisk_imageThis routine tries to find a RAM disk image to load, and returns the* number of blocks to read for a non-compressed image, 0 if the image* is a compressed image, and -1 if an image with the right magic* numbers could not be found
rd_load_image
mempool_kmallocA commonly used alloc and free fn that kmalloc/kfrees the amount of memory* specified by pool_data
__vmalloc
process_vm_rw_coreprocess_vm_rw_core - core of reading/writing pages from task specified*@pid: PID of process to read/write from/to*@iter: where to copy to/from locally*@rvec: iovec array specifying where to copy to/from in the other process*@riovcnt: size of rvec
memblock_double_array
add_swap_extentAdd a block range (and the corresponding page range) into this swapdev's* extent tree.* This function rather assumes that it is called in ascending page order.
pool_alloc_page
region_chgExamine the existing reserve map and determine how many* huge pages in the specified range [f, t) are NOT currently* represented. This routine is called before a subsequent* call to region_add that will actually modify the reserve
region_delDelete the specified range [f, t) from the reserve map. If the* t parameter is LONG_MAX, this indicates that ALL regions after f* should be deleted. Locate the regions which intersect [f, t)* and either trim, delete or split the existing regions.
resv_map_alloc
hugetlb_hstate_alloc_pages
memory_stat_format
__mem_cgroup_usage_register_event
mem_cgroup_oom_register_event
add_to_killSchedule a process for later kill.* Uses GFP_ATOMIC allocations to avoid potential recursions in the VM.
kmemleak_test_initSome very simple testing. This function needs to be extended for* proper testing.
print_page_owner
zpool_create_poolzpool_create_pool() - Create a new zpool*@type: The type of the zpool to create (e.g. zbud, zsmalloc)*@name: The name of the zpool (e.g. zram0, zswap)*@gfp: The GFP flags to use when allocating the pool.*@ops: The optional ops callback.
__zs_cpu_up
ipc_init_proc_interfacepc_init_proc_interface - create a proc interface for sysipc types using a seq_file interface.*@path: Path in procfs*@header: Banner to be printed at the beginning of the file.*@ids: ipc id table to iterate.*@show: show routine.
alloc_msg
msg_insertAuxiliary functions to manipulate messages' list
do_mq_timedsend
do_mq_timedreceive
bio_alloc_bioset_alloc_bioset - allocate a bio for I/O*@gfp_mask: the GFP_* mask given to the slab allocator*@nr_iovecs: number of iovecs to pre-allocate*@bs: the bio_set to allocate from
bio_alloc_map_data
blk_mq_elv_switch_noneCache the elevator_type in qe pair list and switch the* io scheduler to 'none'
blk_stat_alloc_callback
blk_alloc_queue_stats
register_blkdevgister_blkdev - register a new block device*@major: the requested major device number [1..BLKDEV_MAJOR_MAX-1]. If*@major = 0, try to allocate any unused major number.*@name: the name of the new block device as a zero terminated string
disk_seqf_startrator
alloc_pvdalloc_pvd(): reads physical volume descriptor*@state*@lba* Description: Returns pvd on success, NULL on error.* Allocates space for pvd and fill it with disk blocks at @lba* Notes: remember to free pvd when you're done!
alloc_lvnalloc_lvn(): reads logical volume names*@state*@lba* Description: Returns lvn on success, NULL on error.* Allocates space for lvn and fill it with disk blocks at @lba* Notes: remember to free lvn when you're done!
ldm_validate_privheadsldm_validate_privheads - Compare the primary privhead with its backups*@state: Partition check state including device holding the LDM Database*@ph1: Memory struct to fill with ph contents* Read and compare all three privheads from disk
ldm_ldmdb_addldm_ldmdb_add - Adds a raw VBLK entry to the ldmdb database*@data: Raw VBLK to add to the database*@len: Size of the raw VBLK*@ldb: Cache of the database structures* The VBLKs are sorted into categories. Partitions are also sorted by offset.* N
ldm_frag_addldm_frag_add - Add a VBLK fragment to a list*@data: Raw fragment to be added to the list*@size: Size of the raw fragment*@frags: Linked list of VBLK fragments* Fragmented VBLKs may not be consecutive in the database, so they are placed
ldm_partitionldm_partition - Find out whether a device is a dynamic disk and handle it*@state: Partition check state including device holding the LDM Database* This determines whether the device @bdev is a dynamic disk and if so creates
ibm_partitionThis is the main function, called by check.c
alloc_read_gpt_entriesalloc_read_gpt_entries(): reads partition entries from disk*@state: disk parsed partitions*@gpt: GPT header* Description: Returns ptes on success, NULL on error
alloc_read_gpt_headeralloc_read_gpt_header(): Allocates GPT header, reads into it from disk*@state: disk parsed partitions*@lba: the Logical Block Address of the partition table* Description: returns GPT header on success, NULL on error. Allocates
bio_integrity_alloc_integrity_alloc - Allocate integrity payload and attach it to bio*@bio: bio to attach integrity metadata to*@gfp_mask: Memory allocation mask*@nr_vecs: Number of integrity metadata scatter-gather elements* Description: This function prepares a bio for
bio_integrity_prep_integrity_prep - Prepare bio for integrity I/O*@bio: bio to prepare* Description: Checks if the bio already has an integrity payload attached.* If it does, the payload has been generated by another kernel subsystem,* and we just pass it through
init_opal_dev
key_user_lookupGet the key quota record for a user, allocating a new record if one doesn't* already exist.
keyctl_update_keyUpdate a key's data payload from the given data.* The key must grant the caller Write permission and the key type must support* updating for this to work. A negative key can be positively instantiated* with this call.* If successful, 0 will be returned
user_preparsePreparse a user defined key payload
kdf_alloc
keyctl_dh_compute_kdf
__keyctl_dh_compute
keyctl_pkey_e_d_sEncrypt/decrypt/sign* Encrypt data, decrypt data or sign data using a public key
big_key_preparsePreparse a big key
init_sdesc
tpm_sealHave the TPM seal(encrypt) the trusted key, possibly based on* Platform Configuration Registers (PCRs). AUTH1 for sealing key.
trusted_instantiaterusted_instantiate - create a new trusted key* Unseal an existing trusted blob or, for a new key, get a* random key, then seal and create a trusted key-type key,* adding it to the specified keyring.* On success, return 0. Otherwise return errno.
trusted_updaterusted_update - reseal an existing key with new PCR values
datablob_formatdatablob_format - format as an ascii string, before copying to userspace
derived_key_decrypt
encrypted_instantiaterypted_instantiate - instantiate an encrypted key* Decrypt an existing encrypted datablob or create a new encrypted key* based on a kernel random number.* On success, return 0. Otherwise return errno.
encrypted_updaterypted_update - update the master key description* Change the master key description for an existing encrypted key.* The next read will return an encrypted datablob using the new* master key description.* On success, return 0. Otherwise return errno.
cap_inode_getsecuritygetsecurity: We are called for security
cap_convert_nscapUser requested a write of security.capability. If needed, update the* xattr to change from v2 to v3, or to fixup the v3 rootid.* If all is ok, we return the new size, on error return < 0.
avc_add_callbackavc_add_callback - Register a callback for security events.*@callback: callback function*@events: security events* Register a callback function for events in the set @events.* Returns %0 on success or -%ENOMEM if insufficient memory
inode_doinit_use_xattr
selinux_kernfs_init_securitykernfs node operations
selinux_xfrm_alloc_userAllocates a xfrm_sec_state and populates it using the supplied security* xfrm_user_sec_ctx context.
selinux_xfrm_state_alloc_acquireLSM hook implementation that allocates a xfrm_sec_state and populates based* on a secid.
smk_cipso_doismk_cipso_doi - initialize the CIPSO domain
tomoyo_print_headermoyo_print_header - Get header line of audit log.*@r: Pointer to "struct tomoyo_request_info".* Returns string representation.* This function uses kmalloc(), so caller must kfree() if this function* didn't return NULL.
tomoyo_add_entrymoyo_add_entry - Add an ACL to current thread's domain. Used by learning mode.*@domain: Pointer to "struct tomoyo_domain_info".*@header: Lines containing ACL.* Returns nothing.
tomoyo_realpath_from_pathmoyo_realpath_from_path - Returns realpath(3) of the given pathname but ignores chroot'ed root
gen_symlink_name
__aafs_profile_mkdirRequires: @profile->ns->lock held
aa_str_alloc
aa_new_null_profileaa_new_null_profile - create or find a null-X learning profile*@parent: profile that caused this profile to be created (NOT NULL)*@hat: true if the null- learning profile is a hat*@base: name to base the null profile off of*@gfp: type of allocation
aa_getprocattraa_getprocattr - Return the profile information for @profile*@profile: the profile to print profile info about (NOT NULL)*@string: Returns - string containing the profile info (NOT NULL)* Returns: length of @string on success else error on failure*
apparmor_setprocattr
aa_get_buffer
alloc_buffers
aa_label_asxprintaa_label_asxprint - allocate a string buffer and print label into it*@strp: Returns - the allocated buffer with the label name
report_accessdefers execution because cmdline access can sleep
yama_ptracer_addyama_ptracer_add - add/replace an exception for this tracer/tracee pair*@tracer: the task_struct of the process doing the ptrace*@tracee: the task_struct of the process to be ptraced* Each tracee can have, at most, one tracer registered. Each time this
verify_ruleset
handle_policy_update
get_cert_listGet a certificate list blob from the named EFI variable.
uefi_blacklist_hashBlacklist a hash.
get_cert_listGet a certificate list blob from the named secure variable.
ima_add_digest_entryma_add_template_entry helper function:* - Add template entry to the measurement list and hash table, for* all entries except those carried across kexec.* (Called with ima_extend_list_mutex held.)
ima_lsm_copy_rule
init_desc
emergency_remount
emergency_thaw_allmergency_thaw_all -- forcibly thaw every frozen filesystem* Used for emergency unfreeze of all filesystems via SysRq
getname_kernel
do_sys_poll
__d_alloc__d_alloc - allocate a dcache entry*@sb: filesystem it will belong to*@name: qstr of the name* Allocates a dentry. It returns %NULL if there is insufficient memory* available. On a success the dentry is returned. The name passed in is
alloc_fdtable
get_mountpoint
copy_mount_options
single_open
simple_xattr_allocAllocate new xattr and copy in the value; but leave the name to callers.
simple_attr_opensimple_attr_open is called by an actual attribute open file operation* to set the attribute specific access operations.
emergency_sync
legacy_parse_paramAdd a parameter to a legacy config. We build up a comma-separated list of* options.
end_buffer_async_read_ioI/O completion handler for block_read_full_page() - pages* which come unlocked at the end of I/O.
inotify_handle_event
inotify_new_group
fanotify_encode_fid
do_signalfd4
do_eventfd
dup_userfaultfd
io_ring_ctx_alloc
io_alloc_async_ctx
fscrypt_fname_alloc_bufferscrypt_fname_alloc_buffer - allocate a buffer for presented filenames* Allocate a buffer that is large enough to hold any decrypted or encoded* filename (null-terminated), for the given maximum encrypted filename length
fscrypt_setup_filenamescrypt_setup_filename() - prepare to search a possibly encrypted directory*@dir: the directory that will be searched*@iname: the user-provided filename being searched for*@lookup: 1 if we're allowed to proceed without the key because it's* ->lookup() or
__fscrypt_encrypt_symlink
setup_v1_file_key_derivedv1 policy, !DIRECT_KEY: derive the file's encryption key
build_merkle_treeBuild the Merkle tree for the given inode using the given parameters, and* return the root hash in @root_hash.* The tree is written to a filesystem-specific location as determined by the* ->write_merkle_tree_block() method
fsverity_prepare_hash_statesverity_prepare_hash_state() - precompute the initial hash state*@alg: hash algorithm*@salt: a salt which is to be prepended to all data to be hashed*@salt_size: salt size in bytes, possibly 0* Return: NULL if the salt is empty, otherwise the kmalloc()'ed
ensure_verity_infoEnsure the inode has an ->i_verity_info
create_entryThis 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
load_elf_phdrsload_elf_phdrs() - load ELF program headers*@elf_ex: ELF header of the binary whose program headers should be loaded*@elf_file: the opened ELF binary file* Loads ELF program headers from the binary file elf_file, which has the ELF
load_elf_binary
elf_fdpic_fetch_phdrsad the program headers table into memory
load_elf_fdpic_binaryload an fdpic binary into various bits of memory
posix_acl_allocAllocate a new ACL with the specified number of entries.
cn_print_exe_file
do_sys_name_to_handle
handle_to_path
iomap_page_create
iomap_dio_rwmap_dio_rw() always completes O_[D]SYNC writes regardless of whether the IO* is being issued as AIO or not. This allows us to optimise pure data writes* to use REQ_FUA rather than requiring generic_write_sync() to issue a* REQ_FLUSH post write
v2_read_file_infoRead information header from quota file
getdqbuf
do_lookup_dcookieAnd here is where the userspace process can look up the cookie value* to retrieve the path.
dcookie_init
dcookie_register
ahash_request_allocahash_request_alloc() - allocate request data structure*@tfm: cipher handle to be registered with the request*@gfp: memory allocation flag that is handed to kmalloc by the API call.* Allocate the request data structure that must be used with the ahash
kmalloc_array分配数组内存
kzalloc分配内存并置零
acpi_os_allocateThe irqs_disabled() check is for resume from RAM.* Interrupts are off during resume, just like they are for boot.* However, boot has (system_state != SYSTEM_RUNNING)* to quiet __might_sleep() in kmalloc() and resume does not.
kpp_request_allockpp_request_alloc() - allocates kpp request*@tfm: KPP tfm handle allocated with crypto_alloc_kpp()*@gfp: allocation flags* Return: allocated handle in case of success or NULL in case of an error.