函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\syscall.c Create Date:2022-07-27 14:05:32
Last Modify:2022-05-19 18:06:12 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:map_lookup_and_delete_elem

函数原型:static int map_lookup_and_delete_elem(union bpf_attr *attr)

返回类型:int

参数:

类型参数名称
union bpf_attr *attr
1185  __userukey等于u64_to_user_ptr(key)
1186  __useruvalue等于u64_to_user_ptr(value)
1187  ufd等于 anonymous struct used by BPF_MAP_*_ELEM commands
1194  如果helper macro to check that unused fields 'union bpf_attr' are zero (BPF_MAP_LOOKUP_AND_DELETE_ELEM)则返回:负EINVAL
1197  f等于fdget(ufd)
1198  map等于 error is returned, fd is released.* On success caller should complete fd access with matching fdput()
1199  如果是错误则返回:错误
1201  如果非map_get_sys_perms(map, f)按位与Has write method(s) 的值则
1202  err等于负EPERM
1203  转到:err_put
1206  key等于__bpf_copy_key(ukey, key_size)
1207  如果是错误
1208  err等于错误
1209  转到:err_put
1212  value_size等于value_size
1214  err等于负ENOMEM
1215  value等于开辟内存
1216  如果非value则转到:free_key
1219  如果map_type恒等于BPF_MAP_TYPE_QUEUEmap_type恒等于BPF_MAP_TYPE_STACK
1221  err等于map_pop_elem(map, value)
1222  否则
1223  err等于负Operation is not supported
1226  如果err则转到:free_value
1229  如果copy_to_user(uvalue, value, value_size)不等于0则转到:free_value
1232  err等于0
1234  free_value :
1235  kfree(value)
1236  free_key :
1237  kfree(key)
1238  err_put :
1239  fdput(f)
1240  返回:err