The sem_* hooks were changed in the commit "sem/security: Pass kern_ipc_perm not sem_array into the sem security hooks" (aefad9593ec5). The type of the argument sma was changed from sem_array to kern_ipc_perm. This patch updates the documentation for the hooks accordingly.
Unified · Split
| @@ -1190,34 +1190,34 @@ · 1189 unmodified lines | ||
| 1190 | 1190 | * Security hooks for System V Semaphores |
| 1191 | 1191 | * |
| 1192 | 1192 | * @sem_alloc_security: |
| 1193 | − * Allocate and attach a security structure to the sma->sem_perm.security | |
| 1194 | − * field. The security field is initialized to NULL when the structure is | |
| 1193 | + * Allocate and attach a security structure to the @perm->security | |
| 1194 | + * field. The security field is initialized to NULL when the structure is | |
| 1195 | 1195 | * first created. |
| 1196 | − * @sma contains the semaphore structure | |
| 1196 | + * @perm contains the IPC permissions of the semaphore. | |
| 1197 | 1197 | * Return 0 if operation was successful and permission is granted. |
| 1198 | 1198 | * @sem_free_security: |
| 1199 | − * deallocate security struct for this semaphore | |
| 1200 | − * @sma contains the semaphore structure. | |
| 1199 | + * Deallocate security structure @perm->security for the semaphore. | |
| 1200 | + * @perm contains the IPC permissions of the semaphore. | |
| 1201 | 1201 | * @sem_associate: |
| 1202 | 1202 | * Check permission when a semaphore is requested through the semget |
| 1203 | − * system call. This hook is only called when returning the semaphore | |
| 1203 | + * system call. This hook is only called when returning the semaphore | |
| 1204 | 1204 | * identifier for an existing semaphore, not when a new one must be |
| 1205 | 1205 | * created. |
| 1206 | − * @sma contains the semaphore structure. | |
| 1206 | + * @perm contains the IPC permissions of the semaphore. | |
| 1207 | 1207 | * @semflg contains the operation control flags. |
| 1208 | 1208 | * Return 0 if permission is granted. |
| 1209 | 1209 | * @sem_semctl: |
| 1210 | 1210 | * Check permission when a semaphore operation specified by @cmd is to be |
| 1211 | − * performed on the semaphore @sma. The @sma may be NULL, e.g. for | |
| 1211 | + * performed on the semaphore. The @perm may be NULL, e.g. for | |
| 1212 | 1212 | * IPC_INFO or SEM_INFO. |
| 1213 | − * @sma contains the semaphore structure. May be NULL. | |
| 1213 | + * @perm contains the IPC permissions of the semaphore. May be NULL. | |
| 1214 | 1214 | * @cmd contains the operation to be performed. |
| 1215 | 1215 | * Return 0 if permission is granted. |
| 1216 | 1216 | * @sem_semop: |
| 1217 | 1217 | * Check permissions before performing operations on members of the |
| 1218 | − * semaphore set @sma. If the @alter flag is nonzero, the semaphore set | |
| 1218 | + * semaphore set. If the @alter flag is nonzero, the semaphore set | |
| 1219 | 1219 | * may be modified. |
| 1220 | − * @sma contains the semaphore structure. | |
| 1220 | + * @perm contains the IPC permissions of the semaphore. | |
| 1221 | 1221 | * @sops contains the operations to perform. |
| 1222 | 1222 | * @nsops contains the number of operations to perform. |
| 1223 | 1223 | * @alter contains the flag indicating whether changes are to be made. |
| @@ -1654,11 +1654,11 @@ union security_list_options { · 430 unmodified lines | ||
| 1654 | 1654 | int (*shm_shmat)(struct kern_ipc_perm *shp, char __user *shmaddr, |
| 1655 | 1655 | int shmflg); |
| 1656 | 1656 | |
| 1657 | − int (*sem_alloc_security)(struct kern_ipc_perm *sma); | |
| 1658 | − void (*sem_free_security)(struct kern_ipc_perm *sma); | |
| 1659 | − int (*sem_associate)(struct kern_ipc_perm *sma, int semflg); | |
| 1660 | − int (*sem_semctl)(struct kern_ipc_perm *sma, int cmd); | |
| 1661 | − int (*sem_semop)(struct kern_ipc_perm *sma, struct sembuf *sops, | |
| 1657 | + int (*sem_alloc_security)(struct kern_ipc_perm *perm); | |
| 1658 | + void (*sem_free_security)(struct kern_ipc_perm *perm); | |
| 1659 | + int (*sem_associate)(struct kern_ipc_perm *perm, int semflg); | |
| 1660 | + int (*sem_semctl)(struct kern_ipc_perm *perm, int cmd); | |
| 1661 | + int (*sem_semop)(struct kern_ipc_perm *perm, struct sembuf *sops, | |
| 1662 | 1662 | unsigned nsops, int alter); |
| 1663 | 1663 | |
| 1664 | 1664 | int (*netlink_send)(struct sock *sk, struct sk_buff *skb); |