Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\apparmor\apparmorfs.c Create Date:2022-07-28 19:49:56
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:aa_simple_write_to_buffer - common routine for getting policy from user*@userbuf: user buffer to copy data from (NOT NULL)*@alloc_size: size of user buffer (REQUIRES: @alloc_size >= @copy_size)*@copy_size: size of data to copy from user buffer*@pos:

Proto:static struct aa_loaddata *aa_simple_write_to_buffer(const char __user *userbuf, size_t alloc_size, size_t copy_size, loff_t *pos)

Type:struct aa_loaddata

Parameter:

TypeParameterName
const char __user *userbuf
size_talloc_size
size_tcopy_size
loff_t *pos
423  AA_BUG(copy_size > alloc_size)
425  If pos != 0 Then Return ERR_PTR( - ESPIPE)
430  data = aa_loaddata_alloc(alloc_size)
431  If IS_ERR(data) Then Return data
434  he original size of the payload = copy_size
435  If copy_from_user(Pointer to payload. If @compressed_size > 0, then this is the* compressed version of the payload, else it is the uncompressed* version (with the size indicated by @size)., userbuf, copy_size) Then
436  kvfree() - Free memory.*@addr: Pointer to allocated memory.* kvfree frees memory allocated by any of vmalloc(), kmalloc() or kvmalloc().* It is slightly more efficient to use kfree() or vfree() if you are certain* that you know which one to use.
437  Return ERR_PTR( - EFAULT)
440  Return data
Caller
NameDescribe
policy_update
profile_remove.remove file hook fn to remove loaded policy