Skip to content

Commit e3e37fe

Browse files
committed
landlock: Rename "ptrace" files to "task"
ptrace.[ch] are currently only used for the ptrace LSM hooks but their scope will expand with IPCs and audit support. Rename ptrace.[ch] to task.[ch], which better reflect their content. Similarly, rename landlock_add_ptrace_hooks() to landlock_add_task_hooks(). Keep header files for now. Cc: Günther Noack <[email protected]> Cc: Paul Moore <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mickaël Salaün <[email protected]>
1 parent 088e2ef commit e3e37fe

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

security/landlock/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
obj-$(CONFIG_SECURITY_LANDLOCK) := landlock.o
22

33
landlock-y := setup.o syscalls.o object.o ruleset.o \
4-
cred.o ptrace.o fs.o
4+
cred.o task.o fs.o
55

66
landlock-$(CONFIG_INET) += net.o

security/landlock/setup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
#include "cred.h"
1515
#include "fs.h"
1616
#include "net.h"
17-
#include "ptrace.h"
1817
#include "setup.h"
18+
#include "task.h"
1919

2020
bool landlock_initialized __ro_after_init = false;
2121

@@ -34,7 +34,7 @@ const struct lsm_id landlock_lsmid = {
3434
static int __init landlock_init(void)
3535
{
3636
landlock_add_cred_hooks();
37-
landlock_add_ptrace_hooks();
37+
landlock_add_task_hooks();
3838
landlock_add_fs_hooks();
3939
landlock_add_net_hooks();
4040
landlock_initialized = true;

security/landlock/ptrace.c renamed to security/landlock/task.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
#include "common.h"
1818
#include "cred.h"
19-
#include "ptrace.h"
2019
#include "ruleset.h"
2120
#include "setup.h"
21+
#include "task.h"
2222

2323
/**
2424
* domain_scope_le - Checks domain ordering for scoped ptrace
@@ -113,7 +113,7 @@ static struct security_hook_list landlock_hooks[] __ro_after_init = {
113113
LSM_HOOK_INIT(ptrace_traceme, hook_ptrace_traceme),
114114
};
115115

116-
__init void landlock_add_ptrace_hooks(void)
116+
__init void landlock_add_task_hooks(void)
117117
{
118118
security_add_hooks(landlock_hooks, ARRAY_SIZE(landlock_hooks),
119119
&landlock_lsmid);

security/landlock/ptrace.h renamed to security/landlock/task.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
* Copyright © 2019 ANSSI
77
*/
88

9-
#ifndef _SECURITY_LANDLOCK_PTRACE_H
10-
#define _SECURITY_LANDLOCK_PTRACE_H
9+
#ifndef _SECURITY_LANDLOCK_TASK_H
10+
#define _SECURITY_LANDLOCK_TASK_H
1111

12-
__init void landlock_add_ptrace_hooks(void);
12+
__init void landlock_add_task_hooks(void);
1313

14-
#endif /* _SECURITY_LANDLOCK_PTRACE_H */
14+
#endif /* _SECURITY_LANDLOCK_TASK_H */

0 commit comments

Comments
 (0)