Loading include/linux/capability.h +4 −0 Original line number Diff line number Diff line Loading @@ -251,6 +251,10 @@ extern bool privileged_wrt_inode_uidgid(struct user_namespace *ns, const struct extern bool capable_wrt_inode_uidgid(const struct inode *inode, int cap); extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap); extern bool ptracer_capable(struct task_struct *tsk, struct user_namespace *ns); static inline bool perfmon_capable(void) { return capable(CAP_PERFMON) || capable(CAP_SYS_ADMIN); } /* audit system wants to get cap info from files as well */ extern int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data *cpu_caps); Loading include/uapi/linux/capability.h +7 −1 Original line number Diff line number Diff line Loading @@ -367,8 +367,14 @@ struct vfs_ns_cap_data { #define CAP_AUDIT_READ 37 /* * Allow system performance and observability privileged operations * using perf_events, i915_perf and other kernel subsystems */ #define CAP_PERFMON 38 #define CAP_LAST_CAP CAP_AUDIT_READ #define CAP_LAST_CAP CAP_PERFMON #define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP) Loading security/selinux/include/classmap.h +2 −2 Original line number Diff line number Diff line Loading @@ -27,9 +27,9 @@ "audit_control", "setfcap" #define COMMON_CAP2_PERMS "mac_override", "mac_admin", "syslog", \ "wake_alarm", "block_suspend", "audit_read" "wake_alarm", "block_suspend", "audit_read", "perfmon" #if CAP_LAST_CAP > CAP_AUDIT_READ #if CAP_LAST_CAP > CAP_PERFMON #error New capability defined, please update COMMON_CAP2_PERMS. #endif Loading tools/perf/builtin-stat.c +4 −1 Original line number Diff line number Diff line Loading @@ -686,8 +686,11 @@ static int __run_perf_stat(int argc, const char **argv, int run_idx) break; } } if (child_pid != -1) if (child_pid != -1) { if (timeout) kill(child_pid, SIGTERM); wait4(child_pid, &status, 0, &stat_config.ru_data); } if (workload_exec_errno) { const char *emsg = str_error_r(workload_exec_errno, msg, sizeof(msg)); Loading tools/perf/util/annotate.c +20 −0 Original line number Diff line number Diff line Loading @@ -1821,6 +1821,24 @@ static int symbol__disassemble_bpf(struct symbol *sym __maybe_unused, } #endif // defined(HAVE_LIBBFD_SUPPORT) && defined(HAVE_LIBBPF_SUPPORT) static int symbol__disassemble_bpf_image(struct symbol *sym, struct annotate_args *args) { struct annotation *notes = symbol__annotation(sym); struct disasm_line *dl; args->offset = -1; args->line = strdup("to be implemented"); args->line_nr = 0; dl = disasm_line__new(args); if (dl) annotation_line__add(&dl->al, ¬es->src->source); free(args->line); return 0; } /* * Possibly create a new version of line with tabs expanded. Returns the * existing or new line, storage is updated if a new line is allocated. If Loading Loading @@ -1920,6 +1938,8 @@ static int symbol__disassemble(struct symbol *sym, struct annotate_args *args) if (dso->binary_type == DSO_BINARY_TYPE__BPF_PROG_INFO) { return symbol__disassemble_bpf(sym, args); } else if (dso->binary_type == DSO_BINARY_TYPE__BPF_IMAGE) { return symbol__disassemble_bpf_image(sym, args); } else if (dso__is_kcore(dso)) { kce.kcore_filename = symfs_filename; kce.addr = map__rip_2objdump(map, sym->start); Loading Loading
include/linux/capability.h +4 −0 Original line number Diff line number Diff line Loading @@ -251,6 +251,10 @@ extern bool privileged_wrt_inode_uidgid(struct user_namespace *ns, const struct extern bool capable_wrt_inode_uidgid(const struct inode *inode, int cap); extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap); extern bool ptracer_capable(struct task_struct *tsk, struct user_namespace *ns); static inline bool perfmon_capable(void) { return capable(CAP_PERFMON) || capable(CAP_SYS_ADMIN); } /* audit system wants to get cap info from files as well */ extern int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data *cpu_caps); Loading
include/uapi/linux/capability.h +7 −1 Original line number Diff line number Diff line Loading @@ -367,8 +367,14 @@ struct vfs_ns_cap_data { #define CAP_AUDIT_READ 37 /* * Allow system performance and observability privileged operations * using perf_events, i915_perf and other kernel subsystems */ #define CAP_PERFMON 38 #define CAP_LAST_CAP CAP_AUDIT_READ #define CAP_LAST_CAP CAP_PERFMON #define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP) Loading
security/selinux/include/classmap.h +2 −2 Original line number Diff line number Diff line Loading @@ -27,9 +27,9 @@ "audit_control", "setfcap" #define COMMON_CAP2_PERMS "mac_override", "mac_admin", "syslog", \ "wake_alarm", "block_suspend", "audit_read" "wake_alarm", "block_suspend", "audit_read", "perfmon" #if CAP_LAST_CAP > CAP_AUDIT_READ #if CAP_LAST_CAP > CAP_PERFMON #error New capability defined, please update COMMON_CAP2_PERMS. #endif Loading
tools/perf/builtin-stat.c +4 −1 Original line number Diff line number Diff line Loading @@ -686,8 +686,11 @@ static int __run_perf_stat(int argc, const char **argv, int run_idx) break; } } if (child_pid != -1) if (child_pid != -1) { if (timeout) kill(child_pid, SIGTERM); wait4(child_pid, &status, 0, &stat_config.ru_data); } if (workload_exec_errno) { const char *emsg = str_error_r(workload_exec_errno, msg, sizeof(msg)); Loading
tools/perf/util/annotate.c +20 −0 Original line number Diff line number Diff line Loading @@ -1821,6 +1821,24 @@ static int symbol__disassemble_bpf(struct symbol *sym __maybe_unused, } #endif // defined(HAVE_LIBBFD_SUPPORT) && defined(HAVE_LIBBPF_SUPPORT) static int symbol__disassemble_bpf_image(struct symbol *sym, struct annotate_args *args) { struct annotation *notes = symbol__annotation(sym); struct disasm_line *dl; args->offset = -1; args->line = strdup("to be implemented"); args->line_nr = 0; dl = disasm_line__new(args); if (dl) annotation_line__add(&dl->al, ¬es->src->source); free(args->line); return 0; } /* * Possibly create a new version of line with tabs expanded. Returns the * existing or new line, storage is updated if a new line is allocated. If Loading Loading @@ -1920,6 +1938,8 @@ static int symbol__disassemble(struct symbol *sym, struct annotate_args *args) if (dso->binary_type == DSO_BINARY_TYPE__BPF_PROG_INFO) { return symbol__disassemble_bpf(sym, args); } else if (dso->binary_type == DSO_BINARY_TYPE__BPF_IMAGE) { return symbol__disassemble_bpf_image(sym, args); } else if (dso__is_kcore(dso)) { kce.kcore_filename = symfs_filename; kce.addr = map__rip_2objdump(map, sym->start); Loading