shm/security: Pass kern_ipc_perm not shmid_kernel into the shm security hooks

All of the implementations of security hooks that take shmid_kernel only
access shm_perm the struct kern_ipc_perm member.  This means the
dependencies of the shm security hooks can be simplified by passing
the kern_ipc_perm member of shmid_kernel..

Making this change will allow struct shmid_kernel to become private to ipc/shm.c.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
This commit is contained in:
Eric W. Biederman 2018-03-22 21:08:27 -05:00
parent aefad9593e
commit 7191adff2a
6 changed files with 52 additions and 56 deletions

View file

@ -1585,11 +1585,11 @@ union security_list_options {
struct task_struct *target, long type,
int mode);
int (*shm_alloc_security)(struct shmid_kernel *shp);
void (*shm_free_security)(struct shmid_kernel *shp);
int (*shm_associate)(struct shmid_kernel *shp, int shmflg);
int (*shm_shmctl)(struct shmid_kernel *shp, int cmd);
int (*shm_shmat)(struct shmid_kernel *shp, char __user *shmaddr,
int (*shm_alloc_security)(struct kern_ipc_perm *shp);
void (*shm_free_security)(struct kern_ipc_perm *shp);
int (*shm_associate)(struct kern_ipc_perm *shp, int shmflg);
int (*shm_shmctl)(struct kern_ipc_perm *shp, int cmd);
int (*shm_shmat)(struct kern_ipc_perm *shp, char __user *shmaddr,
int shmflg);
int (*sem_alloc_security)(struct kern_ipc_perm *sma);