@@ -50,7 +50,7 @@ static void warn_setuid_and_fcaps_mixed(const char *fname)
50
50
/**
51
51
* cap_capable - Determine whether a task has a particular effective capability
52
52
* @cred: The credentials to use
53
- * @ns : The user namespace in which we need the capability
53
+ * @targ_ns : The user namespace in which we need the capability
54
54
* @cap: The capability to check for
55
55
* @opts: Bitmask of options defined in include/linux/security.h
56
56
*
@@ -289,7 +289,7 @@ int cap_capset(struct cred *new,
289
289
* affects the security markings on that inode, and if it is, should
290
290
* inode_killpriv() be invoked or the change rejected.
291
291
*
292
- * Returns 1 if security.capability has a value, meaning inode_killpriv()
292
+ * Return: 1 if security.capability has a value, meaning inode_killpriv()
293
293
* is required, 0 otherwise, meaning inode_killpriv() is not required.
294
294
*/
295
295
int cap_inode_need_killpriv (struct dentry * dentry )
@@ -307,7 +307,7 @@ int cap_inode_need_killpriv(struct dentry *dentry)
307
307
*
308
308
* Erase the privilege-enhancing security markings on an inode.
309
309
*
310
- * Returns 0 if successful, -ve on error.
310
+ * Return: 0 if successful, -ve on error.
311
311
*/
312
312
int cap_inode_killpriv (struct dentry * dentry )
313
313
{
@@ -490,7 +490,7 @@ static bool validheader(size_t size, const struct vfs_cap_data *cap)
490
490
* User requested a write of security.capability. If needed, update the
491
491
* xattr to change from v2 to v3, or to fixup the v3 rootid.
492
492
*
493
- * If all is ok, we return the new size, on error return < 0.
493
+ * Return: On success, return the new size; on error, return < 0.
494
494
*/
495
495
int cap_convert_nscap (struct dentry * dentry , const void * * ivalue , size_t size )
496
496
{
@@ -822,7 +822,9 @@ static inline bool nonroot_raised_pE(struct cred *new, const struct cred *old,
822
822
*
823
823
* Set up the proposed credentials for a new execution context being
824
824
* constructed by execve(). The proposed creds in @bprm->cred is altered,
825
- * which won't take effect immediately. Returns 0 if successful, -ve on error.
825
+ * which won't take effect immediately.
826
+ *
827
+ * Return: 0 if successful, -ve on error.
826
828
*/
827
829
int cap_bprm_creds_from_file (struct linux_binprm * bprm , struct file * file )
828
830
{
@@ -1049,7 +1051,9 @@ static inline void cap_emulate_setxuid(struct cred *new, const struct cred *old)
1049
1051
* @flags: Indications of what has changed
1050
1052
*
1051
1053
* Fix up the results of setuid() call before the credential changes are
1052
- * actually applied, returning 0 to grant the changes, -ve to deny them.
1054
+ * actually applied.
1055
+ *
1056
+ * Return: 0 to grant the changes, -ve to deny them.
1053
1057
*/
1054
1058
int cap_task_fix_setuid (struct cred * new , const struct cred * old , int flags )
1055
1059
{
@@ -1119,33 +1123,39 @@ static int cap_safe_nice(struct task_struct *p)
1119
1123
* @p: The task to affect
1120
1124
*
1121
1125
* Detemine if the requested scheduler policy change is permitted for the
1122
- * specified task, returning 0 if permission is granted, -ve if denied.
1126
+ * specified task.
1127
+ *
1128
+ * Return: 0 if permission is granted, -ve if denied.
1123
1129
*/
1124
1130
int cap_task_setscheduler (struct task_struct * p )
1125
1131
{
1126
1132
return cap_safe_nice (p );
1127
1133
}
1128
1134
1129
1135
/**
1130
- * cap_task_ioprio - Detemine if I/O priority change is permitted
1136
+ * cap_task_setioprio - Detemine if I/O priority change is permitted
1131
1137
* @p: The task to affect
1132
1138
* @ioprio: The I/O priority to set
1133
1139
*
1134
1140
* Detemine if the requested I/O priority change is permitted for the specified
1135
- * task, returning 0 if permission is granted, -ve if denied.
1141
+ * task.
1142
+ *
1143
+ * Return: 0 if permission is granted, -ve if denied.
1136
1144
*/
1137
1145
int cap_task_setioprio (struct task_struct * p , int ioprio )
1138
1146
{
1139
1147
return cap_safe_nice (p );
1140
1148
}
1141
1149
1142
1150
/**
1143
- * cap_task_ioprio - Detemine if task priority change is permitted
1151
+ * cap_task_setnice - Detemine if task priority change is permitted
1144
1152
* @p: The task to affect
1145
1153
* @nice: The nice value to set
1146
1154
*
1147
1155
* Detemine if the requested task priority change is permitted for the
1148
- * specified task, returning 0 if permission is granted, -ve if denied.
1156
+ * specified task.
1157
+ *
1158
+ * Return: 0 if permission is granted, -ve if denied.
1149
1159
*/
1150
1160
int cap_task_setnice (struct task_struct * p , int nice )
1151
1161
{
@@ -1175,12 +1185,15 @@ static int cap_prctl_drop(unsigned long cap)
1175
1185
/**
1176
1186
* cap_task_prctl - Implement process control functions for this security module
1177
1187
* @option: The process control function requested
1178
- * @arg2, @arg3, @arg4, @arg5: The argument data for this function
1188
+ * @arg2: The argument data for this function
1189
+ * @arg3: The argument data for this function
1190
+ * @arg4: The argument data for this function
1191
+ * @arg5: The argument data for this function
1179
1192
*
1180
1193
* Allow process control functions (sys_prctl()) to alter capabilities; may
1181
1194
* also deny access to other functions not otherwise implemented here.
1182
1195
*
1183
- * Returns 0 or +ve on success, -ENOSYS if this function is not implemented
1196
+ * Return: 0 or +ve on success, -ENOSYS if this function is not implemented
1184
1197
* here, other -ve on error. If -ENOSYS is returned, sys_prctl() and other LSM
1185
1198
* modules will consider performing the function.
1186
1199
*/
@@ -1315,7 +1328,9 @@ int cap_task_prctl(int option, unsigned long arg2, unsigned long arg3,
1315
1328
* @pages: The size of the mapping
1316
1329
*
1317
1330
* Determine whether the allocation of a new virtual mapping by the current
1318
- * task is permitted, returning 1 if permission is granted, 0 if not.
1331
+ * task is permitted.
1332
+ *
1333
+ * Return: 1 if permission is granted, 0 if not.
1319
1334
*/
1320
1335
int cap_vm_enough_memory (struct mm_struct * mm , long pages )
1321
1336
{
@@ -1328,14 +1343,15 @@ int cap_vm_enough_memory(struct mm_struct *mm, long pages)
1328
1343
return cap_sys_admin ;
1329
1344
}
1330
1345
1331
- /*
1346
+ /**
1332
1347
* cap_mmap_addr - check if able to map given addr
1333
1348
* @addr: address attempting to be mapped
1334
1349
*
1335
1350
* If the process is attempting to map memory below dac_mmap_min_addr they need
1336
1351
* CAP_SYS_RAWIO. The other parameters to this function are unused by the
1337
- * capability security module. Returns 0 if this mapping should be allowed
1338
- * -EPERM if not.
1352
+ * capability security module.
1353
+ *
1354
+ * Return: 0 if this mapping should be allowed or -EPERM if not.
1339
1355
*/
1340
1356
int cap_mmap_addr (unsigned long addr )
1341
1357
{
0 commit comments