security.c (d8c6e8543294428426578d74dc7aaf121e762d58) security.c (3ec30113264a7bcd389f51d1738e42da0f41bb5a)
1/*
2 * Security plug functions
3 *
4 * Copyright (C) 2001 WireX Communications, Inc <chris@wirex.com>
5 * Copyright (C) 2001-2002 Greg Kroah-Hartman <greg@kroah.com>
6 * Copyright (C) 2001 Networks Associates Technology, Inc <ssmalley@nai.com>
7 * Copyright (C) 2016 Mellanox Technologies
8 *

--- 991 unchanged lines hidden (view full) ---

1000 return call_int_hook(cred_prepare, 0, new, old, gfp);
1001}
1002
1003void security_transfer_creds(struct cred *new, const struct cred *old)
1004{
1005 call_void_hook(cred_transfer, new, old);
1006}
1007
1/*
2 * Security plug functions
3 *
4 * Copyright (C) 2001 WireX Communications, Inc <chris@wirex.com>
5 * Copyright (C) 2001-2002 Greg Kroah-Hartman <greg@kroah.com>
6 * Copyright (C) 2001 Networks Associates Technology, Inc <ssmalley@nai.com>
7 * Copyright (C) 2016 Mellanox Technologies
8 *

--- 991 unchanged lines hidden (view full) ---

1000 return call_int_hook(cred_prepare, 0, new, old, gfp);
1001}
1002
1003void security_transfer_creds(struct cred *new, const struct cred *old)
1004{
1005 call_void_hook(cred_transfer, new, old);
1006}
1007
1008void security_cred_getsecid(const struct cred *c, u32 *secid)
1009{
1010 *secid = 0;
1011 call_void_hook(cred_getsecid, c, secid);
1012}
1013EXPORT_SYMBOL(security_cred_getsecid);
1014
1008int security_kernel_act_as(struct cred *new, u32 secid)
1009{
1010 return call_int_hook(kernel_act_as, 0, new, secid);
1011}
1012
1013int security_kernel_create_files_as(struct cred *new, struct inode *inode)
1014{
1015 return call_int_hook(kernel_create_files_as, 0, new, inode);

--- 93 unchanged lines hidden (view full) ---

1109}
1110
1111int security_task_movememory(struct task_struct *p)
1112{
1113 return call_int_hook(task_movememory, 0, p);
1114}
1115
1116int security_task_kill(struct task_struct *p, struct siginfo *info,
1015int security_kernel_act_as(struct cred *new, u32 secid)
1016{
1017 return call_int_hook(kernel_act_as, 0, new, secid);
1018}
1019
1020int security_kernel_create_files_as(struct cred *new, struct inode *inode)
1021{
1022 return call_int_hook(kernel_create_files_as, 0, new, inode);

--- 93 unchanged lines hidden (view full) ---

1116}
1117
1118int security_task_movememory(struct task_struct *p)
1119{
1120 return call_int_hook(task_movememory, 0, p);
1121}
1122
1123int security_task_kill(struct task_struct *p, struct siginfo *info,
1117 int sig, u32 secid)
1124 int sig, const struct cred *cred)
1118{
1125{
1119 return call_int_hook(task_kill, 0, p, info, sig, secid);
1126 return call_int_hook(task_kill, 0, p, info, sig, cred);
1120}
1121
1122int security_task_prctl(int option, unsigned long arg2, unsigned long arg3,
1123 unsigned long arg4, unsigned long arg5)
1124{
1125 int thisrc;
1126 int rc = -ENOSYS;
1127 struct security_hook_list *hp;

--- 30 unchanged lines hidden (view full) ---

1158 return call_int_hook(msg_msg_alloc_security, 0, msg);
1159}
1160
1161void security_msg_msg_free(struct msg_msg *msg)
1162{
1163 call_void_hook(msg_msg_free_security, msg);
1164}
1165
1127}
1128
1129int security_task_prctl(int option, unsigned long arg2, unsigned long arg3,
1130 unsigned long arg4, unsigned long arg5)
1131{
1132 int thisrc;
1133 int rc = -ENOSYS;
1134 struct security_hook_list *hp;

--- 30 unchanged lines hidden (view full) ---

1165 return call_int_hook(msg_msg_alloc_security, 0, msg);
1166}
1167
1168void security_msg_msg_free(struct msg_msg *msg)
1169{
1170 call_void_hook(msg_msg_free_security, msg);
1171}
1172
1166int security_msg_queue_alloc(struct kern_ipc_perm *msq)
1173int security_msg_queue_alloc(struct msg_queue *msq)
1167{
1168 return call_int_hook(msg_queue_alloc_security, 0, msq);
1169}
1170
1174{
1175 return call_int_hook(msg_queue_alloc_security, 0, msq);
1176}
1177
1171void security_msg_queue_free(struct kern_ipc_perm *msq)
1178void security_msg_queue_free(struct msg_queue *msq)
1172{
1173 call_void_hook(msg_queue_free_security, msq);
1174}
1175
1179{
1180 call_void_hook(msg_queue_free_security, msq);
1181}
1182
1176int security_msg_queue_associate(struct kern_ipc_perm *msq, int msqflg)
1183int security_msg_queue_associate(struct msg_queue *msq, int msqflg)
1177{
1178 return call_int_hook(msg_queue_associate, 0, msq, msqflg);
1179}
1180
1184{
1185 return call_int_hook(msg_queue_associate, 0, msq, msqflg);
1186}
1187
1181int security_msg_queue_msgctl(struct kern_ipc_perm *msq, int cmd)
1188int security_msg_queue_msgctl(struct msg_queue *msq, int cmd)
1182{
1183 return call_int_hook(msg_queue_msgctl, 0, msq, cmd);
1184}
1185
1189{
1190 return call_int_hook(msg_queue_msgctl, 0, msq, cmd);
1191}
1192
1186int security_msg_queue_msgsnd(struct kern_ipc_perm *msq,
1193int security_msg_queue_msgsnd(struct msg_queue *msq,
1187 struct msg_msg *msg, int msqflg)
1188{
1189 return call_int_hook(msg_queue_msgsnd, 0, msq, msg, msqflg);
1190}
1191
1194 struct msg_msg *msg, int msqflg)
1195{
1196 return call_int_hook(msg_queue_msgsnd, 0, msq, msg, msqflg);
1197}
1198
1192int security_msg_queue_msgrcv(struct kern_ipc_perm *msq, struct msg_msg *msg,
1199int security_msg_queue_msgrcv(struct msg_queue *msq, struct msg_msg *msg,
1193 struct task_struct *target, long type, int mode)
1194{
1195 return call_int_hook(msg_queue_msgrcv, 0, msq, msg, target, type, mode);
1196}
1197
1200 struct task_struct *target, long type, int mode)
1201{
1202 return call_int_hook(msg_queue_msgrcv, 0, msq, msg, target, type, mode);
1203}
1204
1198int security_shm_alloc(struct kern_ipc_perm *shp)
1205int security_shm_alloc(struct shmid_kernel *shp)
1199{
1200 return call_int_hook(shm_alloc_security, 0, shp);
1201}
1202
1206{
1207 return call_int_hook(shm_alloc_security, 0, shp);
1208}
1209
1203void security_shm_free(struct kern_ipc_perm *shp)
1210void security_shm_free(struct shmid_kernel *shp)
1204{
1205 call_void_hook(shm_free_security, shp);
1206}
1207
1211{
1212 call_void_hook(shm_free_security, shp);
1213}
1214
1208int security_shm_associate(struct kern_ipc_perm *shp, int shmflg)
1215int security_shm_associate(struct shmid_kernel *shp, int shmflg)
1209{
1210 return call_int_hook(shm_associate, 0, shp, shmflg);
1211}
1212
1216{
1217 return call_int_hook(shm_associate, 0, shp, shmflg);
1218}
1219
1213int security_shm_shmctl(struct kern_ipc_perm *shp, int cmd)
1220int security_shm_shmctl(struct shmid_kernel *shp, int cmd)
1214{
1215 return call_int_hook(shm_shmctl, 0, shp, cmd);
1216}
1217
1221{
1222 return call_int_hook(shm_shmctl, 0, shp, cmd);
1223}
1224
1218int security_shm_shmat(struct kern_ipc_perm *shp, char __user *shmaddr, int shmflg)
1225int security_shm_shmat(struct shmid_kernel *shp, char __user *shmaddr, int shmflg)
1219{
1220 return call_int_hook(shm_shmat, 0, shp, shmaddr, shmflg);
1221}
1222
1226{
1227 return call_int_hook(shm_shmat, 0, shp, shmaddr, shmflg);
1228}
1229
1223int security_sem_alloc(struct kern_ipc_perm *sma)
1230int security_sem_alloc(struct sem_array *sma)
1224{
1225 return call_int_hook(sem_alloc_security, 0, sma);
1226}
1227
1231{
1232 return call_int_hook(sem_alloc_security, 0, sma);
1233}
1234
1228void security_sem_free(struct kern_ipc_perm *sma)
1235void security_sem_free(struct sem_array *sma)
1229{
1230 call_void_hook(sem_free_security, sma);
1231}
1232
1236{
1237 call_void_hook(sem_free_security, sma);
1238}
1239
1233int security_sem_associate(struct kern_ipc_perm *sma, int semflg)
1240int security_sem_associate(struct sem_array *sma, int semflg)
1234{
1235 return call_int_hook(sem_associate, 0, sma, semflg);
1236}
1237
1241{
1242 return call_int_hook(sem_associate, 0, sma, semflg);
1243}
1244
1238int security_sem_semctl(struct kern_ipc_perm *sma, int cmd)
1245int security_sem_semctl(struct sem_array *sma, int cmd)
1239{
1240 return call_int_hook(sem_semctl, 0, sma, cmd);
1241}
1242
1246{
1247 return call_int_hook(sem_semctl, 0, sma, cmd);
1248}
1249
1243int security_sem_semop(struct kern_ipc_perm *sma, struct sembuf *sops,
1250int security_sem_semop(struct sem_array *sma, struct sembuf *sops,
1244 unsigned nsops, int alter)
1245{
1246 return call_int_hook(sem_semop, 0, sma, sops, nsops, alter);
1247}
1248
1249void security_d_instantiate(struct dentry *dentry, struct inode *inode)
1250{
1251 if (unlikely(inode && IS_PRIVATE(inode)))

--- 486 unchanged lines hidden ---
1251 unsigned nsops, int alter)
1252{
1253 return call_int_hook(sem_semop, 0, sma, sops, nsops, alter);
1254}
1255
1256void security_d_instantiate(struct dentry *dentry, struct inode *inode)
1257{
1258 if (unlikely(inode && IS_PRIVATE(inode)))

--- 486 unchanged lines hidden ---