WARNING: please write a help paragraph that fully describes the config symbol with at least 4 lines #60: FILE: kernel/Kconfig.kexec:49: +config KEXEC_PE_IMAGE + bool "Enable parsing UEFI PE file through kexec file based system call" + depends on KEXEC_FILE + depends on DEBUG_INFO_BTF && BPF_SYSCALL + help + This option makes the kexec_file_load() syscall cooperates with bpf-prog + to parse PE format file + WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #84: new file mode 100644 CHECK: Please don't use multiple blank lines #112: FILE: kernel/kexec_pe_image.c:24: + + CHECK: Alignment should match open parenthesis #166: FILE: kernel/kexec_pe_image.c:78: +static int pe_get_section(const char *file_buf, const char *sect_name, + char **sect_start, unsigned long *sect_sz) WARNING: line length of 93 exceeds 80 columns #178: FILE: kernel/kexec_pe_image.c:90: + opt_hdr = (struct pe32plus_opt_hdr *)(file_buf + mz->peaddr + sizeof(struct pe_hdr)); WARNING: line length of 85 exceeds 80 columns #179: FILE: kernel/kexec_pe_image.c:91: + sect_hdr = (struct section_header *)((char *)opt_hdr + pe_hdr->opt_hdr_size); WARNING: externs should be avoided in .c files #225: FILE: kernel/kexec_pe_image.c:137: +void bpf_handle_pefile(struct kexec_context *context); WARNING: externs should be avoided in .c files #226: FILE: kernel/kexec_pe_image.c:138: +void bpf_post_handle_pefile(struct kexec_context *context); CHECK: Please don't use multiple blank lines #228: FILE: kernel/kexec_pe_image.c:140: + + WARNING: line length of 91 exceeds 80 columns #232: FILE: kernel/kexec_pe_image.c:144: +__attribute__((used, optimize("O0"))) void bpf_handle_pefile(struct kexec_context *context) WARNING: Prefer __used over __attribute__((used)) #232: FILE: kernel/kexec_pe_image.c:144: +__attribute__((used, optimize("O0"))) void bpf_handle_pefile(struct kexec_context *context) WARNING: line length of 86 exceeds 80 columns #235: FILE: kernel/kexec_pe_image.c:147: + * To prevent linker from Identical Code Folding (ICF) with bpf_handle_pefile, WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst #238: FILE: kernel/kexec_pe_image.c:150: + volatile int dummy = 0; WARNING: line length of 96 exceeds 80 columns #243: FILE: kernel/kexec_pe_image.c:155: +__attribute__((used, optimize("O0"))) void bpf_post_handle_pefile(struct kexec_context *context) WARNING: Prefer __used over __attribute__((used)) #243: FILE: kernel/kexec_pe_image.c:155: +__attribute__((used, optimize("O0"))) void bpf_post_handle_pefile(struct kexec_context *context) WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst #245: FILE: kernel/kexec_pe_image.c:157: + volatile int dummy = 0; WARNING: line length of 85 exceeds 80 columns #255: FILE: kernel/kexec_pe_image.c:167: +static int prepare_nested_pe(char **kernel, unsigned long *kernel_len, char **initrd, CHECK: Alignment should match open parenthesis #256: FILE: kernel/kexec_pe_image.c:168: +static int prepare_nested_pe(char **kernel, unsigned long *kernel_len, char **initrd, + unsigned long *initrd_len, char **cmdline) WARNING: braces {} are not necessary for single statement blocks #278: FILE: kernel/kexec_pe_image.c:190: + if (!!res->r) { + *cmdline = res->r->buf; + } CHECK: Alignment should match open parenthesis #286: FILE: kernel/kexec_pe_image.c:198: +static void *pe_image_load(struct kimage *image, + char *kernel, unsigned long kernel_len, WARNING: line length of 87 exceeds 80 columns #308: FILE: kernel/kexec_pe_image.c:220: + pe_get_section((const char *)linux_start, ".bpf", &bpf_start, &bpf_sz); CHECK: Alignment should match open parenthesis #332: FILE: kernel/kexec_pe_image.c:244: + prepare_nested_pe(&linux_start, &linux_sz, &initrd_start, + &initrd_sz, &cmdline_start); CHECK: Comparison to NULL could be written "!kernel" #376: FILE: kernel/kexec_pe_image.c:288: + if (kernel == NULL || initrd == NULL || cmdline == NULL) { CHECK: Comparison to NULL could be written "!initrd" #376: FILE: kernel/kexec_pe_image.c:288: + if (kernel == NULL || initrd == NULL || cmdline == NULL) { CHECK: Comparison to NULL could be written "!cmdline" #376: FILE: kernel/kexec_pe_image.c:288: + if (kernel == NULL || initrd == NULL || cmdline == NULL) { CHECK: Comparison to NULL could be written "!kernel" #380: FILE: kernel/kexec_pe_image.c:292: + if (kernel == NULL) { WARNING: Prefer strscpy over strcpy - see: https://github.com/KSPP/linux/issues/88 #381: FILE: kernel/kexec_pe_image.c:293: + strcpy(c, "kernel "); CHECK: Comparison to NULL could be written "!initrd" #384: FILE: kernel/kexec_pe_image.c:296: + if (initrd == NULL) { WARNING: Prefer strscpy over strcpy - see: https://github.com/KSPP/linux/issues/88 #385: FILE: kernel/kexec_pe_image.c:297: + strcpy(c, "initrd "); CHECK: Comparison to NULL could be written "!cmdline" #388: FILE: kernel/kexec_pe_image.c:300: + if (cmdline == NULL) { WARNING: Prefer strscpy over strcpy - see: https://github.com/KSPP/linux/issues/88 #389: FILE: kernel/kexec_pe_image.c:301: + strcpy(c, "cmdline "); total: 0 errors, 19 warnings, 12 checks, 376 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. Commit 918b9207a317 ("kexec: Introduce kexec_pe_image to parse and load PE file") has style problems, please review. NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT BAD_REPORTED_BY_LINK CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. total: 0 errors, 19 warnings, 12 checks, 376 lines checked