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:.remove file hook fn to remove loaded policy

Proto:static ssize_t profile_remove(struct file *f, const char __user *buf, size_t size, loff_t *pos)

Type:ssize_t

Parameter:

TypeParameterName
struct file *f
const char __user *buf
size_tsize
loff_t *pos
511  ns = aa_get_ns - increment references count on @ns*@ns: namespace to increment reference count of (MAYBE NULL)* Returns: pointer to @ns, if @ns is NULL returns NULL* Requires: @ns must be held with valid refcount when called
513  label = gin_current_label_crit_section - current's confining label and update it* Returns: up to date confining label or the ns unconfined label (NOT NULL)* Not safe to call inside locks* The returned reference must be put with end_current_label_crit_section()*
517  error = aa_may_manage_policy(label, ns, AA_MAY_REMOVE_POLICY)
518  If error Then Go to out
525  data = 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:
527  error = PTR_ERR(data)
528  If Not IS_ERR(data) Then
529  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).[size] = 0
530  error = aa_remove_profiles - remove profile(s) from the system*@policy_ns: namespace the remove is being done from*@subj: label attempting to remove policy*@fqname: name of the profile or namespace to remove (NOT NULL)*@size: size of the name* Remove a profile or
531  aa_put_loaddata(data)
533  out :
534  d_label_crit_section - put a reference found with begin_current_label..*@label: label reference to put* Should only be used with a reference obtained with* begin_current_label_crit_section and never used in situations where the* task cred may be updated
535  aa_put_ns - decrement refcount on @ns*@ns: namespace to put reference of* Decrement reference count of @ns and if no longer in use free it
536  Return error