Home
last modified time | relevance | path

Searched refs:prctl (Results 1 – 25 of 179) sorted by relevance

12345678

/linux/Documentation/userspace-api/
H A Dspec_ctrl.rst16 :manpage:`prctl(2)`.
18 There are two prctl options which are related to this:
28 which is selected with arg2 of prctl(2). The return value uses bits 0-3 with
42 subsequent prctl(..., PR_SPEC_ENABLE) will fail.
50 available. If not set, prctl(PR_SET_SPECULATION_CTRL) for the speculation
59 is selected by arg2 of :manpage:`prctl(2)` per task. arg3 is used to hand
68 EINVAL The prctl is not implemented by the architecture or unused
69 prctl(2) arguments are not 0.
85 is not possible via prctl, because of the system's boot configuration.
100 * prctl(PR_GET_SPECULATION_CTRL, PR_SPEC_STORE_BYPASS, 0, 0, 0);
[all …]
/linux/tools/testing/selftests/arm64/gcs/
H A Dgcs-locking.c46 ret = prctl(PR_LOCK_SHADOW_STACK_STATUS, ULONG_MAX, 0, 0, 0); in TEST()
110 ret = prctl(PR_GET_SHADOW_STACK_STATUS, &mode, 0, 0, 0); in TEST_F()
114 ret = prctl(PR_LOCK_SHADOW_STACK_STATUS, variant->mode, 0, 0, 0); in TEST_F()
129 ret = prctl(PR_LOCK_SHADOW_STACK_STATUS, variant->mode, 0, 0, 0); in TEST_F()
136 ret = prctl(PR_GET_SHADOW_STACK_STATUS, &mode, 0, 0, 0); in TEST_F()
153 ret = prctl(PR_GET_SHADOW_STACK_STATUS, &mode, 0, 0, 0); in TEST_F()
157 ret = prctl(PR_LOCK_SHADOW_STACK_STATUS, variant->mode, 0, 0, 0); in TEST_F()
164 ret = prctl(PR_GET_SHADOW_STACK_STATUS, &mode, 0, 0, 0); in TEST_F()
172 ret = prctl(PR_GET_SHADOW_STACK_STATUS, &mode, 0, 0, 0); in TEST_F()
187 ret = prctl(PR_GET_SHADOW_STACK_STATUS, &mode, 0, 0, 0); in main()
/linux/tools/testing/selftests/seccomp/
H A Dseccomp_bpf.c362 ret = prctl(PR_SET_SECCOMP, SECCOMP_MODE_STRICT, NULL, NULL, NULL); in TEST()
373 ret = prctl(PR_SET_SECCOMP, SECCOMP_MODE_STRICT, NULL, NULL, NULL); in TEST_SIGNAL()
389 ret = prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0); in TEST()
400 ret = prctl(PR_SET_NO_NEW_PRIVS, 1, NULL, 0, 0); in TEST()
404 ret = prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, NULL, NULL, NULL); in TEST()
424 ret = prctl(PR_GET_NO_NEW_PRIVS, 0, NULL, 0, 0); in TEST()
429 ret = prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &prog, 0, 0); in TEST()
459 ret = prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0); in TEST()
466 ret = prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &prog, 0, 0); in TEST()
473 ret = prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &prog, 0, 0); in TEST()
[all …]
H A Dseccomp_benchmark.c220 ret = prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0); in main()
224 ret = prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &bitmap_prog); in main()
231 ret = prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &bitmap_prog); in main()
238 ret = prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &prog); in main()
245 ret = prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &bitmap_prog); in main()
/linux/tools/testing/selftests/mm/
H A Dmdwe_test.c25 EXPECT_LT(prctl(PR_SET_MDWE, PR_MDWE_NO_INHERIT, 0L, 0L, 7L), 0); in TEST()
28 EXPECT_LT(prctl(PR_SET_MDWE, 7L, 0L, 0L, 0L), 0); in TEST()
30 EXPECT_LT(prctl(PR_SET_MDWE, 0L, 7L, 0L, 0L), 0); in TEST()
32 EXPECT_LT(prctl(PR_SET_MDWE, 0L, 0L, 7L, 0L), 0); in TEST()
34 EXPECT_LT(prctl(PR_SET_MDWE, 0L, 0L, 0L, 7L), 0); in TEST()
37 EXPECT_LT(prctl(PR_GET_MDWE, 7L, 0L, 0L, 0L), 0); in TEST()
39 EXPECT_LT(prctl(PR_GET_MDWE, 0L, 7L, 0L, 0L), 0); in TEST()
41 EXPECT_LT(prctl(PR_GET_MDWE, 0L, 0L, 7L, 0L), 0); in TEST()
43 EXPECT_LT(prctl(PR_GET_MDWE, 0L, 0L, 0L, 7L), 0); in TEST()
111 EXPECT_EQ(prctl(PR_SET_MDWE, variant->first_flags, 0L, 0L, 0L), 0); in TEST_F()
[all …]
H A Dksm_functional_tests.c117 ret = prctl(PR_SET_MEMORY_MERGE, 1, 0, 0, 0); in __mmap_and_merge_range()
384 ret = prctl(PR_SET_MEMORY_MERGE, 1, 0, 0, 0); in test_prctl()
393 ret = prctl(PR_GET_MEMORY_MERGE, 0, 0, 0, 0); in test_prctl()
402 ret = prctl(PR_SET_MEMORY_MERGE, 0, 0, 0, 0); in test_prctl()
408 ret = prctl(PR_GET_MEMORY_MERGE, 0, 0, 0, 0); in test_prctl()
426 if (prctl(PR_GET_MEMORY_MERGE, 0, 0, 0, 0) != 1) in test_child_ksm()
461 ret = prctl(PR_SET_MEMORY_MERGE, 1, 0, 0, 0); in test_prctl_fork()
490 if (prctl(PR_SET_MEMORY_MERGE, 0, 0, 0, 0)) { in test_prctl_fork()
548 ret = prctl(PR_SET_MEMORY_MERGE, 1, 0, 0, 0); in test_prctl_fork_exec()
585 if (prctl(PR_SET_MEMORY_MERGE, 0, 0, 0, 0)) { in test_prctl_fork_exec()
[all …]
H A Dprctl_thp_disable.c79 ASSERT_EQ(prctl(PR_GET_THP_DISABLE, NULL, NULL, NULL, NULL), 1); in prctl_thp_disable_completely_test()
91 ASSERT_EQ(prctl(PR_SET_THP_DISABLE, 0, NULL, NULL, NULL), 0); in prctl_thp_disable_completely_test()
140 if (prctl(PR_SET_THP_DISABLE, 1, NULL, NULL, NULL)) in FIXTURE_SETUP()
186 ASSERT_EQ(prctl(PR_GET_THP_DISABLE, NULL, NULL, NULL, NULL), 3); in prctl_thp_disable_except_madvise_test()
199 ASSERT_EQ(prctl(PR_SET_THP_DISABLE, 0, NULL, NULL, NULL), 0); in prctl_thp_disable_except_madvise_test()
248 if (prctl(PR_SET_THP_DISABLE, 1, PR_THP_DISABLE_EXCEPT_ADVISED, NULL, NULL)) in FIXTURE_SETUP()
/linux/tools/testing/selftests/powerpc/dexcr/
H A Ddexcr.h35 unsigned long prctl; /* 'which' value for get/set prctl */ member
44 .prctl = PR_PPC_DEXCR_SBHE,
51 .prctl = PR_PPC_DEXCR_IBRTPD,
58 .prctl = PR_PPC_DEXCR_SRAPD,
65 .prctl = PR_PPC_DEXCR_NPHIE,
72 .prctl = -1,
H A Dchdexcr.c38 if (aspect->prctl == -1) in help()
48 if (aspects[i].prctl != -1 && !strcmp(aspects[i].opt, opt)) in opt_to_aspect()
84 err = pr_set_dexcr(aspect->prctl, ctrl); in apply_option()
/linux/tools/testing/selftests/riscv/vector/
H A Dvstate_prctl.c18 rc = prctl(PR_RISCV_V_SET_CONTROL, provided); in test_and_compare_child()
42 rc = prctl(PR_RISCV_V_GET_CONTROL); in TEST()
56 rc = prctl(PR_RISCV_V_SET_CONTROL, PR_RISCV_V_VSTATE_CTRL_ON); in TEST()
72 rc = prctl(PR_RISCV_V_SET_CONTROL, flag); in TEST()
85 rc = prctl(PR_RISCV_V_SET_CONTROL, flag); in TEST()
215 rc = prctl(PR_RISCV_V_SET_CONTROL, 0xff0); in TEST()
228 rc = prctl(PR_RISCV_V_SET_CONTROL, 0x3); in TEST()
241 rc = prctl(PR_RISCV_V_SET_CONTROL, 0xc); in TEST()
/linux/tools/testing/selftests/exec/
H A Dcheck-exec.c65 err = prctl(PR_SET_SECUREBITS, secbits); in test_secbits_set()
350 EXPECT_EQ(0, prctl(PR_GET_SECUREBITS)); in FIXTURE_SETUP()
377 unsigned int secbits = prctl(PR_GET_SECUREBITS); in TEST_F()
381 EXPECT_EQ(secbits, prctl(PR_GET_SECUREBITS)); in TEST_F()
382 CHILD(EXPECT_EQ(secbits, prctl(PR_GET_SECUREBITS))); in TEST_F()
386 EXPECT_EQ(secbits, prctl(PR_GET_SECUREBITS)); in TEST_F()
387 CHILD(EXPECT_EQ(secbits, prctl(PR_GET_SECUREBITS))); in TEST_F()
391 EXPECT_EQ(secbits, prctl(PR_GET_SECUREBITS)); in TEST_F()
392 CHILD(EXPECT_EQ(secbits, prctl(PR_GET_SECUREBITS))); in TEST_F()
397 unsigned int secbits = prctl(PR_GET_SECUREBITS); in TEST_F()
[all …]
/linux/tools/testing/selftests/prctl/
H A Ddisable-tsc-test.c49 if ( prctl(PR_GET_TSC, &tsc_val) == -1) in sigsegv_cb()
55 if ( prctl(PR_SET_TSC, PR_TSC_ENABLE) == -1) in sigsegv_cb()
71 if ( prctl(PR_GET_TSC, &tsc_val) == -1) in main()
79 if ( prctl(PR_SET_TSC, PR_TSC_ENABLE) == -1) in main()
86 if ( prctl(PR_SET_TSC, PR_TSC_SIGSEGV) == -1) in main()
H A Dset-process-name.c21 res = prctl(PR_SET_NAME, name, NULL, NULL, NULL); in set_name()
33 res = prctl(PR_GET_NAME, name, NULL, NULL, NULL); in check_is_name_correct()
46 res = prctl(PR_GET_NAME, name, NULL, NULL, NULL); in check_null_pointer()
72 int res = prctl(PR_GET_NAME, name, NULL, NULL, NULL); in check_name()
H A Ddisable-tsc-on-off-stress-test.c50 if (prctl(PR_SET_TSC, PR_TSC_ENABLE) < 0) in sigsegv_cb()
72 if (prctl(PR_SET_TSC, PR_TSC_SIGSEGV) < 0) in task()
/linux/tools/testing/selftests/syscall_user_dispatch/
H A Dsud_test.c74 ret = prctl(PR_SET_SYSCALL_USER_DISPATCH, PR_SYS_DISPATCH_EXCLUSIVE_ON, 0, 0, &sel); in TEST_SIGNAL()
92 EXPECT_EQ(0, prctl(PR_SET_SYSCALL_USER_DISPATCH, op, off, size, sel)); in prctl_valid()
99 EXPECT_EQ(-1, prctl(PR_SET_SYSCALL_USER_DISPATCH, op, off, size, sel)); in prctl_invalid()
224 ret = prctl(PR_SET_SYSCALL_USER_DISPATCH, PR_SYS_DISPATCH_EXCLUSIVE_ON, 0, 0, &glob_sel); in TEST()
280 ret = prctl(PR_SET_SYSCALL_USER_DISPATCH, PR_SYS_DISPATCH_EXCLUSIVE_ON, 0, 0, &glob_sel); in TEST_SIGNAL()
304 ret = prctl(PR_SET_SYSCALL_USER_DISPATCH, PR_SYS_DISPATCH_EXCLUSIVE_ON, 0, 0, &sel); in TEST()
312 ret = prctl(PR_SET_SYSCALL_USER_DISPATCH, PR_SYS_DISPATCH_OFF, 0, 0, 0); in TEST()
336 ret = prctl(PR_SET_SYSCALL_USER_DISPATCH, PR_SYS_DISPATCH_EXCLUSIVE_ON, 0, -1L, &sel); in TEST()
355 EXPECT_EQ(0, prctl(PR_SET_SYSCALL_USER_DISPATCH, op, off, size, &glob_sel)); in test_range()
/linux/tools/testing/selftests/capabilities/
H A Dtest_execve.c93 if (prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0) != 0) in create_and_enter_ns()
279 …if (prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_RAISE, CAP_NET_BIND_SERVICE, 0, 0, 0) != -1 || errno != E… in do_tests()
296 if (prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_RAISE, CAP_NET_RAW, 0, 0, 0) != -1 || errno != EPERM) { in do_tests()
307 if (prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_RAISE, CAP_NET_BIND_SERVICE, 0, 0, 0) != 0) { in do_tests()
314 if (prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_IS_SET, CAP_NET_BIND_SERVICE, 0, 0, 0) != 1) { in do_tests()
319 if (prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_CLEAR_ALL, 0, 0, 0, 0) != 0) in do_tests()
323 if (prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_IS_SET, CAP_NET_BIND_SERVICE, 0, 0, 0) != 0) { in do_tests()
329 if (prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_RAISE, CAP_NET_BIND_SERVICE, 0, 0, 0) != 0) in do_tests()
337 if (prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_IS_SET, CAP_NET_BIND_SERVICE, 0, 0, 0) != 0) { in do_tests()
357 if (prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_RAISE, CAP_NET_BIND_SERVICE, 0, 0, 0) != 0) in do_tests()
/linux/tools/testing/selftests/arm64/fp/
H A Dvec-syscfg.c316 ret = prctl(data->prctl_get); in prctl_get()
341 ret = prctl(data->prctl_set, cur_vl); in prctl_set_same()
365 ret = prctl(data->prctl_set, data->min_vl); in prctl_set()
386 ret = prctl(data->prctl_set, data->max_vl); in prctl_set()
401 ret = prctl(data->prctl_get); in prctl_set()
428 ret = prctl(data->prctl_set, data->min_vl); in prctl_set_no_child()
466 ret = prctl(data->prctl_set, data->min_vl | PR_SVE_VL_INHERIT); in prctl_set_for_child()
475 ret = prctl(data->prctl_get); in prctl_set_for_child()
522 ret = prctl(data->prctl_set, data->max_vl); in prctl_set_onexec()
531 ret = prctl(data->prctl_set, data->min_vl | PR_SVE_SET_VL_ONEXEC); in prctl_set_onexec()
[all …]
/linux/Documentation/arch/riscv/
H A Dcmodx.rst54 or use the ``PR_RISCV_SET_ICACHE_FLUSH_CTX`` prctl() and emit fence.i in
55 userspace. The syscall performs a one-off icache flushing operation. The prctl
61 when the memory map being used by a hart changes. If the prctl() context caused
64 syscall inside of the prctl() context.
66 prctl() Interface
69 Call prctl() with ``PR_RISCV_SET_ICACHE_FLUSH_CTX`` as the first argument. The
86 #include <sys/prctl.h>
96 // Call prctl before first fence.i is called inside modify_instruction
97 prctl(PR_RISCV_SET_ICACHE_FLUSH_CTX, PR_RISCV_CTX_SW_FENCEI_ON, PR_RISCV_SCOPE_PER_PROCESS);
99 // Call prctl after final fence.i is called in process
[all …]
H A Dzicfilp.rst76 4. prctl() enabling
84 * prctl(PR_SET_INDIR_BR_LP_STATUS, unsigned long arg)
88 task. The dynamic loader can issue this :c:macro:`prctl` once it has
92 issue this prctl with arg1 set to 0 (i.e. :c:macro:`PR_INDIR_BR_LP_ENABLE`
95 * prctl(PR_GET_INDIR_BR_LP_STATUS, unsigned long * arg)
100 * prctl(PR_LOCK_INDIR_BR_LP_STATUS, unsigned long arg)
106 use this prctl to lock the current settings.
/linux/tools/testing/selftests/landlock/
H A Dtsync_test.c39 ASSERT_EQ(0, prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)); in TEST()
52 *nnp = prctl(PR_GET_NO_NEW_PRIVS, 0, 0, 0, 0); in store_no_new_privs()
76 ASSERT_EQ(0, prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)); in TEST()
100 ASSERT_EQ(0, prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)); in TEST()
147 ASSERT_EQ(0, prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)); in TEST()
218 ASSERT_EQ(0, prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)); in TEST()
/linux/Documentation/arch/powerpc/
H A Ddexcr.rst39 prctl section in Configuration
44 :manpage:`prctl(2)` commands. These calls have the form::
46 prctl(PR_PPC_GET_DEXCR, unsigned long which, 0, 0, 0);
47 prctl(PR_PPC_SET_DEXCR, unsigned long which, unsigned long ctrl, 0, 0);
56 * - ``prctl()`` which
80 * - ``prctl()`` ctrl
107 ``PR_PPC_SET_DEXCR`` prctl.
112 prctl(PR_PPC_SET_DEXCR, PR_PPC_DEXCR_IBRTPD, PR_PPC_DEXCR_CTRL_SET, 0, 0);
124 :manpage:`execve(2)`. The PR_PPC_SET_DEXCR prctl() can control both of these
165 - This aspect cannot be modified with prctl() (check for the
/linux/Documentation/translations/zh_CN/userspace-api/
H A Dseccomp_filter.rst45 添加了一个额外的seccomp模式,它可以使用和严格seccomp相同的 prctl(2) 调用来启用。
55 prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, prog);
63 在调用之前,进程必须调用 ``prctl(PR_SET_NO_NEW_PRIVS, 1)`` 或者在它的
68 另外,如果 ``prctl(2)`` 被安装的过滤器所允许,就可以叠加额外的过滤器。这会增
/linux/tools/perf/trace/beauty/
H A Dprctl_option.sh8 grep -E $regex ${beauty_uapi_linux_dir}/prctl.h | grep -v PR_SET_PTRACER | \
15 grep -E $regex ${beauty_uapi_linux_dir}/prctl.h | \
/linux/Documentation/admin-guide/LSM/
H A DYama.rst30 For a solution, some applications use ``prctl(PR_SET_DUMPABLE, ...)`` to
39 ``prctl(PR_SET_PTRACER, pid, ...)`` can be used. An inferior can declare which
45 restrictions, it can call ``prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY, ...)``
55 ``prctl(PR_SET_DUMPABLE...)`` already). Similarly, ``PTRACE_TRACEME`` is
63 inferior can call ``prctl(PR_SET_PTRACER, debugger, ...)`` to declare
/linux/tools/testing/selftests/riscv/abi/
H A Dpointer_masking.c47 ret = prctl(PR_SET_TAGGED_ADDR_CTRL, request << PR_PMLEN_SHIFT, 0, 0, 0); in test_pmlen()
51 ret = prctl(PR_GET_TAGGED_ADDR_CTRL, 0, 0, 0, 0); in test_pmlen()
83 ret = prctl(PR_SET_TAGGED_ADDR_CTRL, arg, 0, 0, 0); in set_tagged_addr_ctrl()
85 ret = prctl(PR_GET_TAGGED_ADDR_CTRL, 0, 0, 0, 0); in set_tagged_addr_ctrl()

12345678