Skip to content

Commit 3cf2993

Browse files
Tetsuo HandaJames Morris
authored andcommitted
LSM: Remove security_task_create() hook.
Since commit a79be23 ("selinux: Use task_alloc hook rather than task_create hook") changed to use task_alloc hook, task_create hook is no longer used. Signed-off-by: Tetsuo Handa <[email protected]> Signed-off-by: James Morris <[email protected]>
1 parent c4758fa commit 3cf2993

File tree

4 files changed

+0
-22
lines changed

4 files changed

+0
-22
lines changed

include/linux/lsm_hooks.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -529,11 +529,6 @@
529529
*
530530
* Security hooks for task operations.
531531
*
532-
* @task_create:
533-
* Check permission before creating a child process. See the clone(2)
534-
* manual page for definitions of the @clone_flags.
535-
* @clone_flags contains the flags indicating what should be shared.
536-
* Return 0 if permission is granted.
537532
* @task_alloc:
538533
* @task task being allocated.
539534
* @clone_flags contains the flags indicating what should be shared.
@@ -1509,7 +1504,6 @@ union security_list_options {
15091504
int (*file_receive)(struct file *file);
15101505
int (*file_open)(struct file *file, const struct cred *cred);
15111506

1512-
int (*task_create)(unsigned long clone_flags);
15131507
int (*task_alloc)(struct task_struct *task, unsigned long clone_flags);
15141508
void (*task_free)(struct task_struct *task);
15151509
int (*cred_alloc_blank)(struct cred *cred, gfp_t gfp);
@@ -1784,7 +1778,6 @@ struct security_hook_heads {
17841778
struct list_head file_send_sigiotask;
17851779
struct list_head file_receive;
17861780
struct list_head file_open;
1787-
struct list_head task_create;
17881781
struct list_head task_alloc;
17891782
struct list_head task_free;
17901783
struct list_head cred_alloc_blank;

include/linux/security.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@ int security_file_send_sigiotask(struct task_struct *tsk,
318318
struct fown_struct *fown, int sig);
319319
int security_file_receive(struct file *file);
320320
int security_file_open(struct file *file, const struct cred *cred);
321-
int security_task_create(unsigned long clone_flags);
322321
int security_task_alloc(struct task_struct *task, unsigned long clone_flags);
323322
void security_task_free(struct task_struct *task);
324323
int security_cred_alloc_blank(struct cred *cred, gfp_t gfp);
@@ -885,11 +884,6 @@ static inline int security_file_open(struct file *file,
885884
return 0;
886885
}
887886

888-
static inline int security_task_create(unsigned long clone_flags)
889-
{
890-
return 0;
891-
}
892-
893887
static inline int security_task_alloc(struct task_struct *task,
894888
unsigned long clone_flags)
895889
{

kernel/fork.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,10 +1568,6 @@ static __latent_entropy struct task_struct *copy_process(
15681568
return ERR_PTR(-EINVAL);
15691569
}
15701570

1571-
retval = security_task_create(clone_flags);
1572-
if (retval)
1573-
goto fork_out;
1574-
15751571
retval = -ENOMEM;
15761572
p = dup_task_struct(current, node);
15771573
if (!p)

security/security.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -979,11 +979,6 @@ int security_file_open(struct file *file, const struct cred *cred)
979979
return fsnotify_perm(file, MAY_OPEN);
980980
}
981981

982-
int security_task_create(unsigned long clone_flags)
983-
{
984-
return call_int_hook(task_create, 0, clone_flags);
985-
}
986-
987982
int security_task_alloc(struct task_struct *task, unsigned long clone_flags)
988983
{
989984
return call_int_hook(task_alloc, 0, task, clone_flags);

0 commit comments

Comments
 (0)