Modify hardcode to SECCOMP_MODE_FILTER
Subsystems (3)
PATCH 1/1 Modify hardcode to SECCOMP_MODE_FILTER
From: zhuling <[email protected]>
bpf/seccomp: modify hardcode 2 to SECCOMP_MODE_FILTER
while the hardcode 2 has been define in seccomp_bpf.c, we should use
the definitions(SECCOMP_MODE_FILTER) instead of hardcode 2.
Signed-off-by zhuling <[email protected]>
--- samples/bpf/tracex5_user.c | 2 +- samples/seccomp/dropper.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
samples/bpf/tracex5_user.c +1 -1
@@ -28,7 +28,7 @@ static void install_accept_all_seccomp(void) .len = (unsigned short)(sizeof(filter)/sizeof(filter[0])), .filter = filter, }; -if (prctl (PR_SET_SECCOMP ,2 , &prog)) +if (prctl (PR_SET_SECCOMP ,SECCOMP_MODE_FILTER , &prog))perror ("prctl" ); }
samples/seccomp/dropper.c +1 -1
@@ -46,7 +46,7 @@ static int install_filter(int nr, int arch, int error)perror ("prctl(NO_NEW_PRIVS)" );return 1 ; } -if (prctl (PR_SET_SECCOMP ,2 , &prog)) { +if (prctl (PR_SET_SECCOMP ,SECCOMP_MODE_FILTER , &prog)) {perror ("prctl(PR_SET_SECCOMP)" );return 1 ; }
--
2.9.5