Lines Matching full:to

18  *	Due to this file being licensed under the GPL there is controversy over
19 * whether this permits you to write a module that #includes this file
40 * @bprm->cred->security to be what commit_creds needs to install for the
43 * The hook must set @bprm->secureexec to 1 if AT_SECURE should be set to
48 * If @file is setpcap, suid, sgid or otherwise marked to change
49 * privilege upon exec, update @bprm->cred to reflect that change.
52 * be derived from a script that the binary will need to reopen, which
56 * The hook must set @bprm->secureexec to 1 if AT_SECURE should be set to
58 * The hook must add to @bprm->per_clear any personality flags that
71 * Prepare to install the new security attributes of a process being
73 * pointed to by @current->cred and the information set in @bprm->cred by
74 * the bprm_creds_for_exec hook. @bprm points to the linux_binprm
75 * structure. This hook is a good place to perform state changes on the
76 * process such as closing open file descriptors to which access will no
82 * have, by this point, been set to @current->cred. @bprm points to the
83 * linux_binprm structure. This hook is a good place to perform state
91 * Allocate and attach a security structure to sc->security. This pointer
92 * is initialised to NULL by the caller.
96 * Userspace provided a parameter to configure a superblock. The LSM may
98 * should return 0; otherwise it should return -ENOPARAM to pass it on to
106 * Allocate and attach a security structure to the sb->s_security field.
107 * The s_security field is initialized to NULL when the structure is
109 * @sb contains the super_block structure to be modified.
112 * Release objects tied to a superblock (e.g. inodes).
116 * @sb contains the super_block structure to be modified.
140 * Allow mount option data to be copied prior to parsing by the filesystem,
143 * This also allows the original mount data to be stripped of security-
144 * specific options to avoid having to make filesystems aware of them.
146 * @copy copied data which will be passed to the security module.
156 * are being made to those options.
177 * @sb the superblock to set security mount options for
180 * Copy all security options from a given superblock to another
181 * @oldsb old superblock which contain information to clone
189 * @from_path indicates the mount that is going to be moved.
194 * @dentry dentry to use in calculating the context.
195 * @mode mode used to determine resource type.
196 * @name name of the last path component used to create file
197 * @xattr_name pointer to place the pointer to security xattr name.
198 * Caller does not have to free the resulting pointer. Its
199 * a pointer to static string.
200 * @ctx pointer to place the pointer to the resulting context in.
201 * @ctxlen point to place the length of the resulting context.
207 * @dentry dentry to use in calculating the context.
208 * @mode mode used to determine resource type.
209 * @name name of the last path component used to create file
211 * @new creds to modify
217 * Allocate and attach a security structure to @inode->i_security. The
218 * i_security field is initialized to NULL when the inode structure is
224 * Deallocate the inode security structure and set @inode->i_security to
227 * Obtain the security attribute name suffix and value to set on a newly
232 * is expected to allocate the name and value via kmalloc, with the caller
235 * not wish to put a security attribute on this particular inode,
236 * then it should return -EOPNOTSUPP to skip this processing.
240 * @name will be set to the allocated name suffix (e.g. selinux).
241 * @value will be set to the allocated attribute value.
242 * @len will be set to the length of the value.
256 * Check permission to create a regular file.
258 * @dentry contains the dentry structure for the file to be created.
259 * @mode contains the file mode of the file to be created.
262 * Check permission before creating a new hard link to a file.
264 * link to the file.
270 * Check permission before creating a new hard link to a file.
272 * to the file.
278 * Check the permission to remove a hard link to a file.
280 * @dentry contains the dentry structure for file to be unlinked.
283 * Check the permission to remove a hard link to a file.
285 * @dentry contains the dentry structure for file to be unlinked.
288 * Check the permission to create a symbolic link to a file.
295 * Check the permission to create a symbolic link to a file.
302 * Check permissions to create a new directory in the existing directory
305 * to be created.
310 * Check permissions to create a new directory in the existing directory
313 * to be created.
318 * Check the permission to remove a directory.
320 * to be removed.
321 * @dentry contains the dentry structure of directory to be removed.
324 * Check the permission to remove a directory.
325 * @dir contains the path structure of parent of the directory to be
327 * @dentry contains the dentry structure of directory to be removed.
345 * @dev contains the undecoded device number. Use new_decode_dev() to get
349 * Check for permission to rename a file or directory.
356 * Check for permission to rename a file or directory.
364 * Check for permission to change a mode of the file @path. The new
366 * @path contains the path structure of the file to change the mode.
371 * Check for permission to change owner/group of a file or directory.
377 * Check for permission to change root directory.
384 * Check the permission to read the symbolic link.
388 * Check permission to follow a symbolic link when looking up a pathname.
395 * existing Linux permission function, so a security module can use it to
400 * @inode contains the inode structure to check.
405 * call to notify_change is performed from several locations, whenever
442 * has been removed. @alloc is used to specify of the call should return a
455 * is specified by @buffer_size. @buffer may be NULL to request
461 * Return <0 on error to abort the inode change operation.
462 * Return 0 if inode_killpriv does not need to be called.
463 * Return >0 if inode_killpriv does need to be called.
473 * @inode contains a pointer to the inode.
474 * @secid contains a pointer to the location where result will be saved.
475 * In case of failure, @secid will be set to zero.
477 * A file is about to be copied up from lower layer to upper layer of
479 * and modify as need be and return new creds. Caller will switch to
480 * new creds temporarily to create new file and release newly allocated
483 * @new pointer to pointer to return newly allocated creds.
487 * up from a lower layer to the union/overlay layer.
489 * Returns 0 to accept the xattr, 1 to discard the xattr, -EOPNOTSUPP if
491 * to abort the copy up. Note that the caller is responsible for reading
498 * Write (set) attribute @name to @value, size @size if allowed.
514 * module can use this hook to perform additional checking on these
515 * operations, e.g. to revalidate permissions on use to support privilege
520 * Caveat: Although this hook can be used to revalidate permissions for
529 * Allocate and attach a security structure to the file->f_security field.
530 * The security field is initialized to NULL when the structure is first
532 * @file contains the file structure to secure.
539 * @cmd contains the operation to perform.
553 * @file contains the file structure for file to map (may be NULL).
560 * @vma contains the memory region to modify.
568 * @cmd contains the posix-translated lock operation to perform
578 * @cmd contains the operation to be performed.
584 * @file contains the file structure to update.
587 * Check permission for the file owner @fown to send SIGIO or SIGURG to the
597 * This hook allows security modules to control the ability of a process
598 * to receive an open file descriptor via socket IPC.
614 * @task task about to be freed.
618 * @cred points to the credentials.
620 * Only allocate sufficient memory and attach to @cred such that
623 * @cred points to the credentials.
626 * @new points to the new credentials.
627 * @old points to the original credentials.
631 * @new points to the new credentials.
632 * @old points to the original credentials.
633 * Transfer data from original creds to new creds
637 * In case of failure, @secid will be set to zero.
639 * Set the credentials for a kernel service to act as (subjective context).
640 * @new points to the credentials to be modified.
641 * @secid specifies the security ID to be set
645 * Set the file creation context in a set of credentials to be the same as
647 * @new points to the credentials to be modified.
648 * @inode points to the inode to use as a reference.
652 * Ability to trigger the kernel to automatically upcall to userspace for
653 * userspace to load a kernel module with the given name.
663 * @buf pointer to buffer containing the data contents.
669 * @contents set to true.
672 * @file contains the file structure pointing to the file being read
679 * @file contains the file structure pointing to the file being read
681 * @buf pointer to buffer containing the file contents.
685 * @contents set to true.
692 * should be made to this rather than to @current->cred.
701 * should be made to this rather than to @current->cred.
709 * should be made to this rather than to @current->cred.
714 * process @p to @pgid.
731 * In case of failure, @secid will be set to zero.
735 * In case of failure, @secid will be set to zero.
738 * Check permission before setting the nice value of @p to @nice.
743 * Check permission before setting the ioprio value of @p to @ioprio.
754 * @cred points to the cred structure for the current task.
755 * @tcred points to the cred structure for the target task.
761 * for @resource to @new_rlim. The old resource limit values can
763 * @p points to the task_struct for the target task's group leader.
782 * Check permission before sending signal @sig to @p. @info can be NULL,
783 * the constant 1, or a pointer to a kernel_siginfo structure. If @info is 1 or
802 * Return -ENOSYS if no-one wanted to handle this op, any other value to
803 * cause prctl() to return immediately with that value.
810 * Check permission prior to creating a new user namespace.
811 * @cred points to prepared creds.
820 * netlink_skb_parms structure. Also may be used to provide fine
825 * is allowed to be transmitted.
837 * Check permissions before connecting or sending datagrams from @sock to
844 * Linux provides an alternative to the conventional file name space for Unix
845 * domain sockets. Whereas binding and connecting to sockets in the file name
847 * and permission hooks in inode_security_ops), binding and connecting to
850 * using only the socket layer hooks, since we need to know the actual target
856 * Check permissions prior to creating a new socket.
860 * @kern set to 1 if a kernel socket.
863 * This hook allows a module to update or allocate a per-socket security
864 * structure. Note that the security field was not added directly to the
867 * allocate and attach security information to
868 * SOCK_INODE(sock)->i_security. This hook may be used to update the
875 * @kern set to 1 if a kernel socket.
883 * performed and the socket @sock is bound to the address specified in the
886 * @address contains the address to bind to.
891 * attempts to connect socket @sock to a remote address, @address.
903 * socket, @newsock, has been created and some information copied to it,
909 * Check permission before transmitting a message to another socket.
911 * @msg contains the message to be transmitted.
935 * @level contains the protocol level to retrieve option from.
936 * @optname contains the name of option to retrieve.
942 * @level contains the protocol level to set options for.
943 * @optname contains the name of the option to set.
960 * This hook allows the security module to provide peer socket security
961 * state for unix or connected tcp sockets to userspace via getsockopt
965 * @optval userspace memory where the security state is to be copied.
968 * @len as input is the maximum length to copy to userspace provided
973 * This hook allows the security module to provide peer socket security
974 * state for udp sockets on a per-packet basis to userspace via
981 * @secid pointer to store the secid of the packet.
984 * Allocate and attach a security structure to the sk->sk_security field,
985 * which is used to copy security attributes between local stream sockets.
991 * Retrieve the LSM-specific secid for the sock to enable caching
994 * Sets the socket's isec sid to the sock's sid.
996 * Sets the openreq's sid to socket's sid with MLS portion taken
999 * Sets the new child socket's sid to the openreq sid.
1001 * Sets the connection's peersid to the secmark on skb.
1003 * check if the process should be allowed to relabel packets to
1006 * tells the LSM to increment the number of secmark labeling rules loaded
1008 * tells the LSM to decrement the number of secmark labeling rules loaded
1010 * Sets the flow's sid to the openreq sid.
1012 * This hook allows a module to allocate a security structure for a TUN
1014 * @security pointer to a security structure pointer.
1017 * This hook allows a module to free the security structure for a TUN
1019 * @security pointer to the TUN device's security structure
1021 * Check permissions prior to creating a new TUN device.
1023 * Check permissions prior to attaching to a TUN device queue.
1024 * @security pointer to the TUN device's security structure.
1026 * This hook can be used by the module to update any security state
1029 * @security pointer to the TUN device's security structure.
1031 * This hook can be used by the module to update any security state
1033 * @security pointer to the TUN devices's security structure.
1038 * Passes the @asoc and @chunk->skb of the association INIT packet to
1040 * @asoc pointer to sctp association structure.
1041 * @skb pointer to skbuff of association packet.
1049 * @sk pointer to sock structure.
1050 * @optname name of the option to validate.
1058 * @asoc pointer to current sctp association structure.
1059 * @sk pointer to current sock structure.
1060 * @newsk pointer to new sock structure.
1063 * to the security module.
1064 * @asoc pointer to sctp association structure.
1065 * @skb pointer to skbuff of association packet.
1070 * Check permission to access a pkey when modifing a QP.
1072 * @pkey the pkey to be accessed.
1073 * @sec pointer to a security structure.
1075 * Check permissions to send and receive SMPs on a end port.
1078 * @sec pointer to a security structure.
1081 * @sec pointer to a security structure pointer.
1085 * @sec contains the security structure to be freed.
1090 * @ctxp is a pointer to the xfrm_sec_ctx being added to Security Policy
1094 * Allocate a security structure to the xp->security field; the security
1095 * field is initialized to NULL when the xfrm_policy is allocated.
1096 * Return 0 if operation was successful (memory to allocate, legal context)
1097 * @gfp is to specify the context for the allocation
1103 * Return 0 if operation was successful (memory to allocate).
1111 * @x contains the xfrm_state being added to the Security Association
1115 * Allocate a security structure to the x->security field; the security
1116 * field is initialized to NULL when the xfrm_state is allocated. Set the
1117 * context to correspond to sec_ctx. Return 0 if operation was successful
1118 * (memory to allocate, legal context).
1120 * @x contains the xfrm_state being added to the Security Association
1123 * @secid contains the secid from which to take the mls portion of the
1125 * Allocate a security structure to the x->security field; the security
1126 * field is initialized to NULL when the xfrm_state is allocated. Set the
1127 * context to correspond to secid. Return 0 if operation was successful
1128 * (memory to allocate, legal context).
1138 * @fl_secid contains the flow security label that is used to authorize
1139 * access to the policy xp.
1147 * @x contains the state to match.
1148 * @xp contains the policy to check for a match.
1149 * @flic contains the flowi_common struct to check for a match.
1152 * @skb points to skb to decode.
1153 * @secid points to the flow key secid to set.
1162 * @key points to the key.
1167 * @key points to the key.
1170 * See whether a specific operational right is granted to a process on a
1172 * @key_ref refers to the key (key pointer + possession attribute bit).
1173 * @cred points to the credentials to provide the context against which to
1178 * Get a textual representation of the security context attached to a key
1182 * @key points to the key to be queried.
1183 * @_buffer points to a pointer that should be set to point to the
1192 * Check permissions for access to IPC
1199 * @secid contains a pointer to the location where result will be saved.
1200 * In case of failure, @secid will be set to zero.
1205 * Allocate and attach a security structure to the msg->security field.
1206 * The security field is initialized to NULL when the structure is first
1208 * @msg contains the message structure to be modified.
1212 * @msg contains the message structure to be modified.
1217 * Allocate and attach a security structure to the
1218 * @perm->security field. The security field is initialized to
1235 * is to be performed on the message queue with permissions @perm.
1238 * @cmd contains the operation to be performed.
1244 * @msg contains the message to be enqueued.
1249 * queue. The @target task structure contains a pointer to the
1250 * process that will be receiving the message (not equal to the current
1262 * Allocate and attach a security structure to the @perm->security
1263 * field. The security field is initialized to NULL when the structure is
1280 * @cmd is to be performed on the shared memory region with permissions @perm.
1283 * @cmd contains the operation to be performed.
1286 * Check permissions prior to allowing the shmat system call to attach the
1287 * shared memory segment with permissions @perm to the data segment of the
1290 * @shmaddr contains the address to attach memory region to.
1297 * Allocate and attach a security structure to the @perm->security
1298 * field. The security field is initialized to NULL when the structure is
1314 * Check permission when a semaphore operation specified by @cmd is to be
1318 * @cmd contains the operation to be performed.
1325 * @sops contains the operations to perform.
1326 * @nsops contains the number of operations to perform.
1327 * @alter contains the flag indicating whether changes are to be made.
1331 * Check whether @mgr is allowed to be the binder context manager.
1335 * Check whether @from is allowed to invoke a binder transaction call
1336 * to @to.
1338 * @to contains the struct cred for the receiving process.
1340 * Check whether @from is allowed to transfer a binder reference to @to.
1342 * @to contains the struct cred for the receiving process.
1344 * Check whether @from is allowed to transfer @file to @to.
1347 * @to contains the struct cred for the receiving process.
1350 * Check permission before allowing the current process to trace the
1352 * Security modules may also want to perform a process tracing check
1361 * Check that the @parent process has sufficient permission to trace the
1362 * current process before allowing the current process to present itself
1363 * to the @parent process for tracing.
1368 * the @target process. The hook may also perform permission checking to
1369 * determine if the current process is allowed to see the capability sets
1388 * @cred contains the credentials to use.
1399 * logging to the console.
1404 * Check permission to change the system time.
1412 * @mm contains the mm struct it is being added to.
1420 * @name full extended attribute name to check against
1424 * Convert secid to security context. If secdata is NULL the length of
1426 * This does mean that the length could change between calls to check the
1434 * Convert security context to secid.
1435 * @secid contains the pointer to the generated security ID.
1450 * @rulestr contains the context where the rule will be applied to.
1451 * @lsmrule contains a pointer to receive the result.
1456 * Specifies whether given @krule contains any fields related to
1465 * @field contains the field which relates to current LSM.
1467 * @lrule points to the audit rule that will be checked against.
1483 * this hook to initialize the security context in its incore inode to the
1485 * file's attributes to the client.
1487 * @inode we wish to set the security context of.
1488 * @ctx contains the string which we wish to set in the inode.
1494 * fs code as needed (via __vfs_setxattr_noperm) to update any backing
1496 * this hook to change the security context in its incore inode and on the
1497 * backing filesystem to a value provided by the client on a SETATTR
1500 * @dentry contains the inode we wish to set the security context of.
1501 * @ctx contains the string which we wish to set in the inode.
1507 * @inode we wish to get the security context of.
1508 * @ctx is a pointer in which to place the allocated security context.
1509 * @ctxlen points to the place to put the length of @ctx.
1514 * Check to see if a watch notification can be posted to a particular
1521 * Check to see if a process is allowed to watch for event notifications
1523 * @key: The key to watch.
1531 * rules to check the specific cmd they need.
1537 * @map: bpf map that we want to access
1544 * @prog: bpf prog that userspace want to use.
1581 * to override it's credentials with @new.
1583 * @new: the new creds to use
1586 * Check whether the current task is allowed to spawn a io_uring polling
1590 * Check whether the file_operations uring_cmd is allowed to run.
1682 * Assuring the safety of deleting a security module is up to
1684 * module's hook list in a particular way, refusing to disable
1690 * disabling their module is a good idea needs to be at least as
1703 /* Currently required to handle SELinux runtime hook disable. */