Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/kdump/kdump.c
| Show First 20 Lines • Show All 2,119 Lines • ▼ Show 20 Lines | #endif | ||||
| return; | return; | ||||
| invalid: | invalid: | ||||
| printf("invalid record\n"); | printf("invalid record\n"); | ||||
| } | } | ||||
| void | void | ||||
| ktrcapfail(struct ktr_cap_fail *ktr) | ktrcapfail(struct ktr_cap_fail *ktr) | ||||
| { | { | ||||
| union ktr_cap_data *kcd = &ktr->cap_data; | |||||
markj: Missing newline after a local variable definition. | |||||
| switch (ktr->cap_type) { | switch (ktr->cap_type) { | ||||
| case CAPFAIL_NOTCAPABLE: | case CAPFAIL_NOTCAPABLE: | ||||
| /* operation on fd with insufficient capabilities */ | /* operation on fd with insufficient capabilities */ | ||||
| printf("operation requires "); | printf("operation requires "); | ||||
| sysdecode_cap_rights(stdout, &ktr->cap_needed); | sysdecode_cap_rights(stdout, &kcd->cap_needed); | ||||
| printf(", descriptor holds "); | printf(", descriptor holds "); | ||||
| sysdecode_cap_rights(stdout, &ktr->cap_held); | sysdecode_cap_rights(stdout, &kcd->cap_held); | ||||
| break; | break; | ||||
| case CAPFAIL_INCREASE: | case CAPFAIL_INCREASE: | ||||
| /* requested more capabilities than fd already has */ | /* requested more capabilities than fd already has */ | ||||
| printf("attempt to increase capabilities from "); | printf("attempt to increase capabilities from "); | ||||
| sysdecode_cap_rights(stdout, &ktr->cap_held); | sysdecode_cap_rights(stdout, &kcd->cap_held); | ||||
| printf(" to "); | printf(" to "); | ||||
| sysdecode_cap_rights(stdout, &ktr->cap_needed); | sysdecode_cap_rights(stdout, &kcd->cap_needed); | ||||
| break; | break; | ||||
| case CAPFAIL_SYSCALL: | case CAPFAIL_SYSCALL: | ||||
| /* called restricted syscall */ | /* called restricted syscall */ | ||||
| printf("disallowed system call"); | printf("system call not allowed: "); | ||||
| syscallname(ktr->cap_code, ktr->cap_svflags); | |||||
| if (syscallabi(ktr->cap_svflags) == SYSDECODE_ABI_FREEBSD) { | |||||
| switch (ktr->cap_code) { | |||||
| case SYS_sysarch: | |||||
| printf(", op: "); | |||||
| print_integer_arg(sysdecode_sysarch_number, | |||||
| kcd->cap_int); | |||||
| break; | break; | ||||
| case CAPFAIL_LOOKUP: | case SYS_fcntl: | ||||
| /* absolute or AT_FDCWD path, ".." path, etc. */ | printf(", cmd: "); | ||||
| printf("restricted VFS lookup"); | print_integer_arg(sysdecode_fcntl_cmd, | ||||
| kcd->cap_int); | |||||
| break; | break; | ||||
| default: | } | ||||
| printf("unknown capability failure: "); | } | ||||
| sysdecode_cap_rights(stdout, &ktr->cap_needed); | |||||
| printf(" "); | |||||
| sysdecode_cap_rights(stdout, &ktr->cap_held); | |||||
| break; | break; | ||||
| case CAPFAIL_SIGNAL: | |||||
| /* sent signal to proc other than self */ | |||||
| syscallname(ktr->cap_code, ktr->cap_svflags); | |||||
| printf(": signal delivery not allowed: "); | |||||
| print_integer_arg(sysdecode_signal, kcd->cap_int); | |||||
| break; | |||||
| case CAPFAIL_PROTO: | |||||
| /* created socket with restricted protocol */ | |||||
| syscallname(ktr->cap_code, ktr->cap_svflags); | |||||
| printf(": protocol not allowed: "); | |||||
| print_integer_arg(sysdecode_ipproto, kcd->cap_int); | |||||
| break; | |||||
| case CAPFAIL_SOCKADDR: | |||||
| /* unable to look up address */ | |||||
| syscallname(ktr->cap_code, ktr->cap_svflags); | |||||
| printf(": restricted address lookup: "); | |||||
| ktrsockaddr(&kcd->cap_sockaddr); | |||||
| return; | |||||
| case CAPFAIL_NAMEI: | |||||
| /* absolute or AT_FDCWD path, ".." path, etc. */ | |||||
| syscallname(ktr->cap_code, ktr->cap_svflags); | |||||
| printf(": restricted VFS lookup: %s\n", kcd->cap_path); | |||||
| return; | |||||
| case CAPFAIL_CPUSET: | |||||
| /* modification of an external cpuset */ | |||||
| syscallname(ktr->cap_code, ktr->cap_svflags); | |||||
| printf(": restricted cpuset operation\n"); | |||||
| return; | |||||
| default: | |||||
| syscallname(ktr->cap_code, ktr->cap_svflags); | |||||
| printf(": unknown capability failure\n"); | |||||
| return; | |||||
| } | } | ||||
| printf("\n"); | printf("\n"); | ||||
| } | } | ||||
| void | void | ||||
| ktrfault(struct ktr_fault *ktr) | ktrfault(struct ktr_fault *ktr) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 174 Lines • Show Last 20 Lines | |||||
Missing newline after a local variable definition.