WARNING: 'embeded' may be misspelled - perhaps 'embedded'? #16: file, e.g. a vmlinuz.efi embeded in UKI's .linux section. ^^^^^^^ WARNING: please write a help paragraph that fully describes the config symbol with at least 4 lines #61: FILE: kernel/Kconfig.kexec:50: +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? #85: new file mode 100644 WARNING: Use #include instead of #108: FILE: kernel/kexec_pe_image.c:19: +#include CHECK: Please don't use multiple blank lines #112: FILE: kernel/kexec_pe_image.c:23: + + WARNING: line length of 86 exceeds 80 columns #135: FILE: kernel/kexec_pe_image.c:46: + struct parsed_phase *phase = kzalloc(sizeof(struct parsed_phase), GFP_KERNEL); CHECK: Alignment should match open parenthesis #179: FILE: kernel/kexec_pe_image.c:90: +static int get_pe_section(char *file_buf, const char *sect_name, + char **sect_start, unsigned long *sect_sz) WARNING: line length of 93 exceeds 80 columns #191: FILE: kernel/kexec_pe_image.c:102: + opt_hdr = (struct pe32plus_opt_hdr *)(file_buf + mz->peaddr + sizeof(struct pe_hdr)); WARNING: line length of 85 exceeds 80 columns #192: FILE: kernel/kexec_pe_image.c:103: + sect_hdr = (struct section_header *)((char *)opt_hdr + pe_hdr->opt_hdr_size); WARNING: line length of 82 exceeds 80 columns #230: FILE: kernel/kexec_pe_image.c:141: + * If five arguments are not enough, considering parse_zboot(struct pt_regs *regs) WARNING: line length of 87 exceeds 80 columns #234: FILE: kernel/kexec_pe_image.c:145: +__attribute__((used, optimize("O0"))) void bpf_handle_pefile(char *image, int image_sz, WARNING: Prefer __used over __attribute__((used)) #234: FILE: kernel/kexec_pe_image.c:145: +__attribute__((used, optimize("O0"))) void bpf_handle_pefile(char *image, int image_sz, CHECK: Alignment should match open parenthesis #235: FILE: kernel/kexec_pe_image.c:146: +__attribute__((used, optimize("O0"))) void bpf_handle_pefile(char *image, int image_sz, + char *initrd, int initrd_sz, char *cmdline) WARNING: Prefer __used over __attribute__((used)) #239: FILE: kernel/kexec_pe_image.c:150: +__attribute__((used, optimize("O0"))) void bpf_post_handle_pefile(void) WARNING: line length of 85 exceeds 80 columns #248: FILE: kernel/kexec_pe_image.c:159: +static int prepare_nested_pe(char **kernel, unsigned long *kernel_len, char **initrd, CHECK: Alignment should match open parenthesis #249: FILE: kernel/kexec_pe_image.c:160: +static int prepare_nested_pe(char **kernel, unsigned long *kernel_len, char **initrd, + unsigned long *initrd_len, char **cmdline) CHECK: Alignment should match open parenthesis #274: FILE: kernel/kexec_pe_image.c:185: +static void *pe_image_load(struct kimage *image, + char *kernel, unsigned long kernel_len, ERROR: space required before the open parenthesis '(' #294: FILE: kernel/kexec_pe_image.c:205: + while(is_valid_format(linux_start, linux_sz) && CHECK: Blank lines aren't necessary after an open brace '{' #296: FILE: kernel/kexec_pe_image.c:207: + pe_has_bpf_section(linux_start, linux_sz)) { + WARNING: line length of 81 exceeds 80 columns #311: FILE: kernel/kexec_pe_image.c:222: + bpf_handle_pefile(linux_start, linux_sz, initrd_start, initrd_sz, CHECK: Alignment should match open parenthesis #312: FILE: kernel/kexec_pe_image.c:223: + bpf_handle_pefile(linux_start, linux_sz, initrd_start, initrd_sz, + cmdline_start); CHECK: Alignment should match open parenthesis #315: FILE: kernel/kexec_pe_image.c:226: + prepare_nested_pe(&linux_start, &linux_sz, &initrd_start, + &initrd_sz, &cmdline_start); CHECK: Comparison to NULL could be written "initrd" #328: FILE: kernel/kexec_pe_image.c:239: + if (initrd != NULL && cmdline != NULL && parsed_kernel != NULL) CHECK: Comparison to NULL could be written "cmdline" #328: FILE: kernel/kexec_pe_image.c:239: + if (initrd != NULL && cmdline != NULL && parsed_kernel != NULL) CHECK: Comparison to NULL could be written "parsed_kernel" #328: FILE: kernel/kexec_pe_image.c:239: + if (initrd != NULL && cmdline != NULL && parsed_kernel != NULL) CHECK: Blank lines aren't necessary before a close brace '}' #346: FILE: kernel/kexec_pe_image.c:257: + + } CHECK: Comparison to NULL could be written "!initrd" #348: FILE: kernel/kexec_pe_image.c:259: + if (initrd == NULL || cmdline == NULL || parsed_kernel == NULL) { CHECK: Comparison to NULL could be written "!cmdline" #348: FILE: kernel/kexec_pe_image.c:259: + if (initrd == NULL || cmdline == NULL || parsed_kernel == NULL) { CHECK: Comparison to NULL could be written "!parsed_kernel" #348: FILE: kernel/kexec_pe_image.c:259: + if (initrd == NULL || cmdline == NULL || parsed_kernel == NULL) { CHECK: Comparison to NULL could be written "!parsed_kernel" #352: FILE: kernel/kexec_pe_image.c:263: + if (parsed_kernel == NULL) { WARNING: Prefer strscpy over strcpy - see: https://github.com/KSPP/linux/issues/88 #353: FILE: kernel/kexec_pe_image.c:264: + strcpy(c, "kernel "); CHECK: Comparison to NULL could be written "!initrd" #356: FILE: kernel/kexec_pe_image.c:267: + if (initrd == NULL) { WARNING: Prefer strscpy over strcpy - see: https://github.com/KSPP/linux/issues/88 #357: FILE: kernel/kexec_pe_image.c:268: + strcpy(c, "initrd "); CHECK: Comparison to NULL could be written "!cmdline" #360: FILE: kernel/kexec_pe_image.c:271: + if (cmdline == NULL) { WARNING: Prefer strscpy over strcpy - see: https://github.com/KSPP/linux/issues/88 #361: FILE: kernel/kexec_pe_image.c:272: + strcpy(c, "cmdline "); total: 1 errors, 16 warnings, 18 checks, 366 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 134e219a7b58 ("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.