Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:moyo_mount_permission - Check permission for mount() operation.*@dev_name: Name of device file. Maybe NULL.*@path: Pointer to "struct path".*@type: Name of filesystem type. Maybe NULL.*@flags: Mount options.*@data_page: Optional data. Maybe NULL.

Proto:int tomoyo_mount_permission(const char *dev_name, const struct path *path, const char *type, unsigned long flags, void *data_page)

Type:int

Parameter:

TypeParameterName
const char *dev_name
const struct path *path
const char *type
unsigned longflags
void *data_page
199  If tomoyo_init_request_info( & r, NULL, TOMOYO_MAC_FILE_MOUNT) == TOMOYO_CONFIG_DISABLED Then Return 0
202  If (flags & MS_MGC_MSK) == Old magic mount flag and mask Then flags &= ~MS_MGC_MSK
204  If flags & Alter flags of a mounted FS Then
205  type = String table for special mount operations. [mount -o remount /dir ]
206  flags &= ~Alter flags of a mounted FS
207  Else if flags & MS_BIND Then
208  type = String table for special mount operations. [mount --bind /source /dest ]
209  flags &= ~MS_BIND
210  Else if flags & change to shared Then
211  If flags & ( change to private | change to slave | change to unbindable ) Then Return -EINVAL
213  type = String table for special mount operations. [mount --make-shared /dir ]
214  flags &= ~change to shared
215  Else if flags & change to private Then
216  If flags & ( change to shared | change to slave | change to unbindable ) Then Return -EINVAL
218  type = String table for special mount operations. [mount --make-private /dir ]
219  flags &= ~change to private
220  Else if flags & change to slave Then
221  If flags & ( change to shared | change to private | change to unbindable ) Then Return -EINVAL
223  type = String table for special mount operations. [mount --make-slave /dir ]
224  flags &= ~change to slave
225  Else if flags & change to unbindable Then
226  If flags & ( change to shared | change to private | change to slave ) Then Return -EINVAL
228  type = String table for special mount operations. [mount --make-unbindable /dir ]
229  flags &= ~change to unbindable
230  Else if flags & MS_MOVE Then
231  type = String table for special mount operations. [mount --move /old /new ]
232  flags &= ~MS_MOVE
234  If Not type Then type = "<NULL>"
236  idx = moyo_read_lock - Take lock for protecting policy.* Returns index number for tomoyo_read_unlock().
237  error = moyo_mount_acl - Check permission for mount() operation.*@r: Pointer to "struct tomoyo_request_info".*@dev_name: Name of device file. Maybe NULL.*@dir: Pointer to "struct path".*@type: Name of filesystem type.*@flags: Mount options.
238  moyo_read_unlock - Release lock for protecting policy.*@idx: Index number returned by tomoyo_read_lock().* Returns nothing.
239  Return error
Caller
NameDescribe
tomoyo_sb_mountmoyo_sb_mount - Target for security_sb_mount().*@dev_name: Name of device file. Maybe NULL.*@path: Pointer to "struct path".*@type: Name of filesystem type. Maybe NULL.*@flags: Mount options.*@data: Optional data. Maybe NULL.