| /linux/arch/powerpc/kernel/ptrace/ |
| H A D | ptrace-adv.c | 74 int ptrace_get_debugreg(struct task_struct *child, unsigned long addr, in ptrace_get_debugreg() argument 80 return put_user(child->thread.debug.dac1, datalp); in ptrace_get_debugreg() 140 static long set_instruction_bp(struct task_struct *child, in set_instruction_bp() argument 144 int slot1_in_use = ((child->thread.debug.dbcr0 & DBCR0_IAC1) != 0); in set_instruction_bp() 145 int slot2_in_use = ((child->thread.debug.dbcr0 & DBCR0_IAC2) != 0); in set_instruction_bp() 146 int slot3_in_use = ((child->thread.debug.dbcr0 & DBCR0_IAC3) != 0); in set_instruction_bp() 147 int slot4_in_use = ((child->thread.debug.dbcr0 & DBCR0_IAC4) != 0); in set_instruction_bp() 149 if (dbcr_iac_range(child) & DBCR_IAC12MODE) in set_instruction_bp() 151 if (dbcr_iac_range(child) & DBCR_IAC34MODE) in set_instruction_bp() 165 child->thread.debug.iac1 = bp_info->addr; in set_instruction_bp() [all …]
|
| H A D | ptrace32.c | 38 long compat_arch_ptrace(struct task_struct *child, compat_long_t request, in compat_arch_ptrace() argument 67 copied = ptrace_access_vm(child, (u64)addrOthers, &tmp, in compat_arch_ptrace() 87 ret = ptrace_get_reg(child, index, &tmp); in compat_arch_ptrace() 91 flush_fp_to_thread(child); in compat_arch_ptrace() 97 tmp = ((unsigned int *)child->thread.fp_state.fpr) in compat_arch_ptrace() 136 flush_fp_to_thread(child); in compat_arch_ptrace() 138 tmp = child->thread.fp_state.fpr[numReg - PT_FPR0][0]; in compat_arch_ptrace() 141 ret = ptrace_get_reg(child, numReg, &tmp2); in compat_arch_ptrace() 170 if (ptrace_access_vm(child, (u64)addrOthers, &tmp, in compat_arch_ptrace() 189 ret = ptrace_put_reg(child, index, data); in compat_arch_ptrace() [all …]
|
| H A D | ptrace.c | 31 void ptrace_disable(struct task_struct *child) in ptrace_disable() argument 34 user_disable_single_step(child); in ptrace_disable() 37 long arch_ptrace(struct task_struct *child, long request, in arch_ptrace() argument 52 if ((addr & (sizeof(long) - 1)) || !child->thread.regs) in arch_ptrace() 56 ret = ptrace_get_reg(child, (int) index, &tmp); in arch_ptrace() 58 ret = ptrace_get_fpr(child, index, &tmp); in arch_ptrace() 73 if ((addr & (sizeof(long) - 1)) || !child->thread.regs) in arch_ptrace() 77 ret = ptrace_put_reg(child, index, data); in arch_ptrace() 79 ret = ptrace_put_fpr(child, index, data); in arch_ptrace() 100 return ppc_set_hwdebug(child, &bp_info); in arch_ptrace() [all …]
|
| H A D | ptrace-fpu.c | 9 int ptrace_get_fpr(struct task_struct *child, int index, unsigned long *data) in ptrace_get_fpr() argument 19 flush_fp_to_thread(child); in ptrace_get_fpr() 23 *data = ((u32 *)child->thread.fp_state.fpr)[fpidx]; in ptrace_get_fpr() 25 memcpy(data, &child->thread.TS_FPR(fpidx), sizeof(long)); in ptrace_get_fpr() 27 *data = child->thread.fp_state.fpscr; in ptrace_get_fpr() 35 int ptrace_put_fpr(struct task_struct *child, int index, unsigned long data) in ptrace_put_fpr() argument 45 flush_fp_to_thread(child); in ptrace_put_fpr() 49 ((u32 *)child->thread.fp_state.fpr)[fpidx] = data; in ptrace_put_fpr() 51 memcpy(&child->thread.TS_FPR(fpidx), &data, sizeof(long)); in ptrace_put_fpr() 53 child->thread.fp_state.fpscr = data; in ptrace_put_fpr()
|
| /linux/arch/x86/kernel/ |
| H A D | step.c | 14 unsigned long convert_ip_to_linear(struct task_struct *child, struct pt_regs *regs) in convert_ip_to_linear() argument 38 mutex_lock(&child->mm->context.lock); in convert_ip_to_linear() 39 if (unlikely(!child->mm->context.ldt || in convert_ip_to_linear() 40 seg >= child->mm->context.ldt->nr_entries)) in convert_ip_to_linear() 43 desc = &child->mm->context.ldt->entries[seg]; in convert_ip_to_linear() 51 mutex_unlock(&child->mm->context.lock); in convert_ip_to_linear() 58 static int is_setting_trap_flag(struct task_struct *child, struct pt_regs *regs) in is_setting_trap_flag() argument 62 unsigned long addr = convert_ip_to_linear(child, regs); in is_setting_trap_flag() 64 copied = access_process_vm(child, addr, opcode, sizeof(opcode), in is_setting_trap_flag() 113 static int enable_single_step(struct task_struct *child) in enable_single_step() argument [all …]
|
| H A D | ptrace.c | 374 static int putreg(struct task_struct *child, in putreg() argument 384 return set_segment_reg(child, offset, value); in putreg() 387 return set_flags(child, value); in putreg() 393 x86_fsbase_write_task(child, value); in putreg() 398 x86_gsbase_write_task(child, value); in putreg() 403 *pt_regs_access(task_pt_regs(child), offset) = value; in putreg() 718 void ptrace_disable(struct task_struct *child) in ptrace_disable() argument 720 user_disable_single_step(child); in ptrace_disable() 730 long arch_ptrace(struct task_struct *child, long request, in arch_ptrace() argument 755 tmp = getreg(child, addr); in arch_ptrace() [all …]
|
| /linux/tools/testing/selftests/arm64/fp/ |
| H A D | fp-stress.c | 63 static void child_start(struct child_data *child, const char *program) in child_start() argument 73 child->pid = fork(); in child_start() 74 if (child->pid == -1) in child_start() 78 if (!child->pid) { in child_start() 130 child->stdout = pipefd[0]; in child_start() 131 child->output = NULL; in child_start() 132 child->exited = false; in child_start() 133 child->output_seen = false; in child_start() 136 ev.data.ptr = child; in child_start() 138 ret = epoll_ctl(epoll_fd, EPOLL_CTL_ADD, child->stdout, &ev); in child_start() [all …]
|
| H A D | sve-ptrace.c | 178 static void read_fails(pid_t child, const struct vec_type *type) in read_fails() argument 184 ret = get_sve(child, type, (void **)&new_sve, &new_sve_size); in read_fails() 193 static void write_fails(pid_t child, const struct vec_type *type) in write_fails() argument 203 ret = set_sve(child, type, &sve); in write_fails() 210 static void ptrace_set_get_inherit(pid_t child, const struct vec_type *type) in ptrace_set_get_inherit() argument 222 ret = set_sve(child, type, &sve); in ptrace_set_get_inherit() 233 if (!get_sve(child, type, (void **)&new_sve, &new_sve_size)) { in ptrace_set_get_inherit() 244 ret = set_sve(child, type, &sve); in ptrace_set_get_inherit() 251 if (!get_sve(child, type, (void **)&new_sve, &new_sve_size)) { in ptrace_set_get_inherit() 264 static void ptrace_set_get_vl(pid_t child, const struct vec_type *type, in ptrace_set_get_vl() argument [all …]
|
| H A D | zt-ptrace.c | 121 static void ptrace_za_disabled_read_zt(pid_t child) in ptrace_za_disabled_read_zt() argument 133 ret = set_za(child, &za); in ptrace_za_disabled_read_zt() 140 ret = get_zt(child, zt); in ptrace_za_disabled_read_zt() 157 static void ptrace_set_get_zt(pid_t child) in ptrace_set_get_zt() argument 166 ret = set_zt(child, zt_in); in ptrace_set_get_zt() 172 ret = get_zt(child, zt_out); in ptrace_set_get_zt() 190 static void ptrace_enable_za_via_zt(pid_t child) in ptrace_enable_za_via_zt() argument 205 ret = set_za(child, &za_in); in ptrace_enable_za_via_zt() 213 ret = set_zt(child, zt); in ptrace_enable_za_via_zt() 222 if (get_za(child, (void **)&za_out, &za_out_size)) { in ptrace_enable_za_via_zt() [all …]
|
| /linux/tools/testing/selftests/arm64/gcs/ |
| H A D | gcs-stress.c | 59 static void start_thread(struct child_data *child, int id) in start_thread() argument 69 child->pid = fork(); in start_thread() 70 if (child->pid == -1) in start_thread() 74 if (!child->pid) { in start_thread() 127 child->stdout = pipefd[0]; in start_thread() 128 child->output = NULL; in start_thread() 129 child->exited = false; in start_thread() 130 child->output_seen = false; in start_thread() 133 ev.data.ptr = child; in start_thread() 135 ret = asprintf(&child->name, "Thread-%d", id); in start_thread() [all …]
|
| /linux/tools/testing/selftests/powerpc/ptrace/ |
| H A D | ptrace.h | 64 int start_trace(pid_t child) in start_trace() argument 68 ret = ptrace(PTRACE_ATTACH, child, NULL, NULL); in start_trace() 73 ret = waitpid(child, NULL, 0); in start_trace() 74 if (ret != child) { in start_trace() 81 int stop_trace(pid_t child) in stop_trace() argument 85 ret = ptrace(PTRACE_DETACH, child, NULL, NULL); in stop_trace() 93 int cont_trace(pid_t child) in cont_trace() argument 97 ret = ptrace(PTRACE_CONT, child, NULL, NULL); in cont_trace() 105 int ptrace_read_regs(pid_t child, unsigned long type, unsigned long regs[], in ptrace_read_regs() argument 111 FAIL_IF(start_trace(child)); in ptrace_read_regs() [all …]
|
| /linux/arch/mips/kernel/ |
| H A D | ptrace32.c | 43 long compat_arch_ptrace(struct task_struct *child, compat_long_t request, in compat_arch_ptrace() argument 73 copied = ptrace_access_vm(child, (u64)addrOthers, &tmp, in compat_arch_ptrace() 86 regs = task_pt_regs(child); in compat_arch_ptrace() 97 if (!tsk_used_math(child)) { in compat_arch_ptrace() 102 fregs = get_fpu_regs(child); in compat_arch_ptrace() 103 if (test_tsk_thread_flag(child, TIF_32BIT_FPREGS)) { in compat_arch_ptrace() 117 tmp = child->thread.fpu.fcr31; in compat_arch_ptrace() 147 dregs = __get_dsp_regs(child); in compat_arch_ptrace() 157 tmp = child->thread.dsp.dspcontrol; in compat_arch_ptrace() 186 if (ptrace_access_vm(child, (u64)addrOthers, &data, in compat_arch_ptrace() [all …]
|
| /linux/tools/perf/arch/x86/tests/ |
| H A D | bp-modify.c | 32 int child = fork(); in spawn_child() local 34 if (child == 0) { in spawn_child() 52 return child; in spawn_child() 61 pid_t child; in bp_modify1() local 65 child = spawn_child(); in bp_modify1() 67 waitpid(child, &status, 0); in bp_modify1() 81 if (ptrace(PTRACE_POKEUSER, child, in bp_modify1() 87 if (ptrace(PTRACE_POKEUSER, child, in bp_modify1() 93 if (ptrace(PTRACE_POKEUSER, child, in bp_modify1() 99 if (ptrace(PTRACE_CONT, child, NULL, NULL)) { in bp_modify1() [all …]
|
| /linux/tools/testing/selftests/bpf/prog_tests/ |
| H A D | uprobe_multi_test.c | 49 struct child { 51 int c2p[2]; /* child -> parent channel */ 58 static void release_child(struct child *child) in release_child() 62 if (!child) in release_child() 64 close(child->go[1]); in release_child() 65 close(child->go[0]); in release_child() 66 if (child->thread) { in release_child() 67 pthread_join(child->thread, NULL); in release_child() 68 child in release_child() 48 struct child { global() struct 50 c2pchild global() argument 57 release_child(struct child * child) release_child() argument 75 kick_child(struct child * child) kick_child() argument 88 struct child *child = arg; child_func() local 106 spawn_child_flag(struct child * child,bool clone_vm) spawn_child_flag() argument 131 spawn_child(struct child * child) spawn_child() argument 138 struct child *child = ctx; child_thread() local 162 spawn_thread(struct child * child) spawn_thread() argument 196 uprobe_multi_test_run(struct uprobe_multi * skel,struct child * child) uprobe_multi_test_run() argument 270 __test_attach_api(const char * binary,const char * pattern,struct bpf_uprobe_multi_opts * opts,struct child * child) __test_attach_api() argument 334 static struct child child; test_attach_api() local 663 __test_link_api(struct child * child) __test_link_api() argument 742 static struct child child; test_link_api() local 1077 struct child child[TASKS] = {}; run_pid_filter() local [all...] |
| /linux/arch/x86/um/ |
| H A D | ptrace_32.c | 52 int putreg(struct task_struct *child, int regno, unsigned long value) in putreg() 68 UPT_SYSCALL_NR(&child->thread.regs.regs) = value; in putreg() 92 child->thread.regs.regs.gp[HOST_EFLAGS] |= value; in putreg() 97 child->thread.regs.regs.gp[reg_offsets[regno]] = value; in putreg() 101 int poke_user(struct task_struct *child, long addr, long data) in poke_user() 107 return putreg(child, addr, data); in poke_user() 114 child->thread.arch.debugregs[addr] = data; in poke_user() 120 unsigned long getreg(struct task_struct *child, int regno) in getreg() 149 return mask & child->thread.regs.regs.gp[reg_offsets[regno]]; in getreg() 153 int peek_user(struct task_struct *child, lon in peek_user() 51 putreg(struct task_struct * child,int regno,unsigned long value) putreg() argument 100 poke_user(struct task_struct * child,long addr,long data) poke_user() argument 119 getreg(struct task_struct * child,int regno) getreg() argument 152 peek_user(struct task_struct * child,long addr,long data) peek_user() argument 172 subarch_ptrace(struct task_struct * child,long request,unsigned long addr,unsigned long data) subarch_ptrace() argument [all...] |
| H A D | ptrace_64.c | 55 int putreg(struct task_struct *child, int regno, unsigned long value) in putreg() argument 79 UPT_SYSCALL_NR(&child->thread.regs.regs) = value; in putreg() 101 child->thread.regs.regs.gp[HOST_EFLAGS] |= value; in putreg() 108 child->thread.regs.regs.gp[reg_offsets[regno >> 3]] = value; in putreg() 112 int poke_user(struct task_struct *child, long addr, long data) in poke_user() argument 118 return putreg(child, addr, data); in poke_user() 125 child->thread.arch.debugregs[addr] = data; in poke_user() 131 unsigned long getreg(struct task_struct *child, int regno) in getreg() argument 169 return mask & child->thread.regs.regs.gp[reg_offsets[regno >> 3]]; in getreg() 172 int peek_user(struct task_struct *child, long addr, long data) in peek_user() argument [all …]
|
| /linux/tools/testing/selftests/ptrace/ |
| H A D | peeksiginfo.c | 44 static int check_error_paths(pid_t child) in check_error_paths() argument 73 ret = sys_ptrace(PTRACE_PEEKSIGINFO, child, &arg, addr_rw); in check_error_paths() 83 ret = sys_ptrace(PTRACE_PEEKSIGINFO, child, &arg, in check_error_paths() 91 ret = sys_ptrace(PTRACE_PEEKSIGINFO, child, &arg, addr_ro); in check_error_paths() 105 int check_direct_path(pid_t child, int shared, int nr) in check_direct_path() argument 122 ret = sys_ptrace(PTRACE_PEEKSIGINFO, child, &arg, siginfo); in check_direct_path() 157 pid_t child; in main() local 163 child = fork(); in main() 164 if (child == -1) { in main() 167 } else if (child == 0) { in main() [all …]
|
| /linux/tools/testing/selftests/arm64/abi/ |
| H A D | ptrace.c | 32 static void test_tpidr(pid_t child) in test_tpidr() argument 45 ret = ptrace(PTRACE_GETREGSET, child, NT_ARM_TLS, &read_iov); in test_tpidr() 51 ret = ptrace(PTRACE_SETREGSET, child, NT_ARM_TLS, &write_iov); in test_tpidr() 55 ret = ptrace(PTRACE_GETREGSET, child, NT_ARM_TLS, &read_iov); in test_tpidr() 61 ret = ptrace(PTRACE_GETREGSET, child, NT_ARM_TLS, &read_iov); in test_tpidr() 82 ret = ptrace(PTRACE_SETREGSET, child, NT_ARM_TLS, &write_iov); in test_tpidr() 90 ret = ptrace(PTRACE_GETREGSET, child, NT_ARM_TLS, &read_iov); in test_tpidr() 112 ret = ptrace(PTRACE_SETREGSET, child, NT_ARM_TLS, &write_iov); in test_tpidr() 117 ret = ptrace(PTRACE_GETREGSET, child, NT_ARM_TLS, in test_tpidr() 135 static void test_hw_debug(pid_t child, int type, const char *type_name) in test_hw_debug() argument [all …]
|
| /linux/tools/testing/selftests/cgroup/ |
| H A D | test_core.c | 287 char *grandparent = NULL, *parent = NULL, *child = NULL; in test_cgcore_invalid_domain() local 294 child = cg_name(root, "cg_test_grandparent/cg_test_parent/cg_test_child"); in test_cgcore_invalid_domain() 295 if (!parent || !child || !grandparent) in test_cgcore_invalid_domain() 304 if (cg_create(child)) in test_cgcore_invalid_domain() 310 if (cg_read_strcmp(child, "cgroup.type", "domain invalid\n")) in test_cgcore_invalid_domain() 313 if (!cg_enter_current(child)) in test_cgcore_invalid_domain() 319 if (!clone_into_cgroup_run_wait(child)) in test_cgcore_invalid_domain() 333 if (child) in test_cgcore_invalid_domain() 334 cg_destroy(child); in test_cgcore_invalid_domain() 339 free(child); in test_cgcore_invalid_domain() [all …]
|
| /linux/tools/testing/selftests/riscv/vector/ |
| H A D | vstate_ptrace.c | 50 static void do_parent(pid_t child) in do_parent() argument 56 while (waitpid(child, &status, 0)) { in do_parent() 72 if (do_ptrace(PTRACE_GETREGSET, child, NT_RISCV_VECTOR, size, data)) in do_parent() 83 if (do_ptrace(PTRACE_GETREGSET, child, NT_RISCV_VECTOR, size, data)) in do_parent() 89 if (do_ptrace(PTRACE_SETREGSET, child, NT_RISCV_VECTOR, size, data)) in do_parent() 97 if (do_ptrace(PTRACE_GETREGSET, child, NT_PRSTATUS, size, data)) in do_parent() 101 if (do_ptrace(PTRACE_SETREGSET, child, NT_PRSTATUS, size, data)) in do_parent() 105 ptrace(PTRACE_CONT, child, NULL, NULL); in do_parent() 114 pid_t child; in main() local 124 child = fork(); in main() [all …]
|
| /linux/tools/testing/selftests/x86/ |
| H A D | int_signal.c | 142 static void wait_for_child(pid_t child, int *status) in wait_for_child() argument 147 ret = waitpid(child, status, 0); in wait_for_child() 149 if (ret != child) in wait_for_child() 154 static bool resume_to(pid_t child, int *status, int request, int sig, in resume_to() argument 159 if (ptrace(request, child, 0, 0)) in resume_to() 161 wait_for_child(child, status); in resume_to() 171 if (ptrace(PTRACE_GETREGS, child, 0, ®s)) in resume_to() 181 static bool set_ip(pid_t child, const void *ip, bool tf) in set_ip() argument 185 if (ptrace(PTRACE_GETREGS, child, 0, ®s)) in set_ip() 190 return !ptrace(PTRACE_SETREGS, child, 0, ®s); in set_ip() [all …]
|
| /linux/drivers/scsi/libsas/ |
| H A D | sas_expander.c | 749 struct domain_device *child, in sas_ex_get_linkrate() argument 756 child->pathways = 0; in sas_ex_get_linkrate() 767 if (sas_phy_match_dev_addr(child, phy)) { in sas_ex_get_linkrate() 768 child->min_linkrate = min(parent->min_linkrate, in sas_ex_get_linkrate() 770 child->max_linkrate = max(parent->max_linkrate, in sas_ex_get_linkrate() 772 child->pathways++; in sas_ex_get_linkrate() 776 child->linkrate = min(parent_phy->linkrate, child->max_linkrate); in sas_ex_get_linkrate() 777 child->pathways = min(child->pathways, parent->pathways); in sas_ex_get_linkrate() 781 struct domain_device *child, int phy_id) in sas_ex_add_dev() argument 786 child->dev_type = SAS_END_DEVICE; in sas_ex_add_dev() [all …]
|
| /linux/drivers/pci/pwrctrl/ |
| H A D | core.c | 199 for_each_available_child_of_node_scoped(np, child) in pci_pwrctrl_power_off_device() 200 pci_pwrctrl_power_off_device(child); in pci_pwrctrl_power_off_device() 233 for_each_available_child_of_node_scoped(np, child) in pci_pwrctrl_power_off_devices() 234 pci_pwrctrl_power_off_device(child); in pci_pwrctrl_power_off_devices() 257 for_each_available_child_of_node_scoped(np, child) { in pci_pwrctrl_power_on_device() 258 ret = pci_pwrctrl_power_on_device(child); in pci_pwrctrl_power_on_device() 300 struct device_node *child = NULL; in pci_pwrctrl_power_on_devices() local 303 for_each_available_child_of_node(np, child) { in pci_pwrctrl_power_on_devices() 304 ret = pci_pwrctrl_power_on_device(child); in pci_pwrctrl_power_on_devices() 313 if (tmp == child) in pci_pwrctrl_power_on_devices() [all …]
|
| /linux/tools/testing/selftests/landlock/ |
| H A D | ptrace_test.c | 96 * Test multiple tracing combinations between a parent process P1 and a child 113 /* Test PTRACE_TRACEME and PTRACE_ATTACH for parent and child. */ in TEST_F() local 116 pid_t child, parent; in TEST_F() 132 * can_read_child is true if a parent process can read its child in TEST_F() 134 * isolated from the child with a dedicated Landlock domain. in TEST_F() 139 * can_trace_child is true if a parent process can trace its child in TEST_F() 141 * - The parent process is not isolated from the child with a dedicated in TEST_F() 149 * can_read_parent is true if a child process can read its parent in TEST_F() 150 * process, which is only the case when the child process is not in TEST_F() 156 * can_trace_parent is true if a child proces in TEST_F() 335 pid_t child; TEST_F() local [all...] |
| /linux/tools/testing/selftests/perf_events/ |
| H A D | watermark_signal.c | 46 pid_t child = -1; in TEST() local 64 child = fork(); in TEST() 65 EXPECT_GE(child, 0); in TEST() 66 if (child == 0) in TEST() 68 else if (child < 0) { in TEST() 73 if (waitpid(child, &child_status, WSTOPPED) != child || in TEST() 76 "failed to synchronize with child errno=%d status=%x\n", in TEST() 82 fd = syscall(__NR_perf_event_open, &attr, child, -1, -1, in TEST() 115 if (kill(child, SIGCON in TEST() [all...] |