From nobody Mon Apr 6 09:11:36 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1EA4C224D6 for ; Sun, 22 Mar 2026 01:46:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774144002; cv=none; b=jH3IU616pmQNsKQnLHrMOo1IIoLGOAQj4ZrmBAuBWTYgsHi+3RQvuzZuPtNGup69o0PcD5imtDJfsd5emY3mIjx3ByPmzBFOZV5w0u0GkvGPLVS/a1vx6hD7OdmRw6KySMsJajV6tyZimtrn3EADsyZJADWH/5qSaR7ZmAxQIi4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774144002; c=relaxed/simple; bh=5XtvBRZ5WcY4SFxsc684Dl7uyLUy40m3Ja+3E2/7gk8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ac81b/YHDKog3jJyV6wfbUfO7NLbH54yOnrb7ILks7xsirkmePk2Kb5/REXVg/xh4jfCe8u3dt/yPg4mGQQ+W0G/7LsE/vJ5pu6DXbyiAtJms4Sr6gOC1cIiipCU9/Q1hicKt87sQk7eK8gbwN9u4TbBSY6UmDDT46Zicc4UUZ0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=LTSEPCvt; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="LTSEPCvt" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1774143998; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w4tVWoFxNEqGP2RabjVuO1zRJPVAO5j1EBDaSU+m4ww=; b=LTSEPCvtqF+x7kCJ2m3gsP4Lcw8KtasaqXLnNAZEyeTEnxxTwuJSes4AAh47DGOq38Fj/B VDuZrms7i+CgjxTfyEBT8vXEZh8YmdCxmpcnRRyRFAOzSInSqn3cKQbK1N5G7mH9zBLKM1 u40Qni1aL7UCP/d7pemfodQx/KIhQwc= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-96-pUr0syoTNAK6SNdXzFqqtA-1; Sat, 21 Mar 2026 21:46:34 -0400 X-MC-Unique: pUr0syoTNAK6SNdXzFqqtA-1 X-Mimecast-MFC-AGG-ID: pUr0syoTNAK6SNdXzFqqtA_1774143992 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 42639195608B; Sun, 22 Mar 2026 01:46:32 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.72.112.22]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 294EA300019F; Sun, 22 Mar 2026 01:46:20 +0000 (UTC) From: Pingfan Liu To: kexec@lists.infradead.org Cc: Pingfan Liu , "David S. Miller" , Alexei Starovoitov , Daniel Borkmann , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , Jeremy Linton , Catalin Marinas , Will Deacon , Ard Biesheuvel , Simon Horman , Gerd Hoffmann , Vitaly Kuznetsov , Philipp Rudo , Viktor Malik , Jan Hendrik Farr , Baoquan He , Dave Young , Andrew Morton , bpf@vger.kernel.org, systemd-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCHv7 09/13] kexec_file: Integrate bpf light skeleton to load image with bpf-prog Date: Sun, 22 Mar 2026 09:43:58 +0800 Message-ID: <20260322014402.8815-10-piliu@redhat.com> In-Reply-To: <20260322014402.8815-1-piliu@redhat.com> References: <20260322014402.8815-1-piliu@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Content-Type: text/plain; charset="utf-8" All kexec PE bpf prog should align with the interface exposed by the light skeleton four maps: struct bpf_map_desc ringbuf_1; struct bpf_map_desc ringbuf_2; struct bpf_map_desc ringbuf_3; struct bpf_map_desc ringbuf_4; four sections: struct bpf_map_desc rodata; struct bpf_map_desc data; struct bpf_map_desc rodata_str1_1; struct bpf_map_desc bss; one prog: SEC("fentry.s/kexec_image_parser_anchor") With the above presumption, the integration consists of two parts: -1. Call API exposed by light skeleton from kexec -2. The opts_insn[] and opts_data[] are bpf-prog dependent and can be extracted and passed in from the user space. In the kexec_file_load design, a PE file has a .bpf section, which data content is a ELF, and the ELF contains opts_insn[] opts_data[]. As a bonus, BPF bytecode can be placed under the protection of the entire PE signature. (Note, since opts_insn[] contains the information of the ringbuf size, the bpf-prog writer can change its proper size according to the kernel image size without modifying the kernel code) Signed-off-by: Pingfan Liu Cc: Alexei Starovoitov Cc: Baoquan He Cc: Dave Young Cc: Andrew Morton Cc: Philipp Rudo Cc: bpf@vger.kernel.org To: kexec@lists.infradead.org --- kernel/Makefile | 1 + kernel/kexec_bpf/Makefile | 8 + kernel/kexec_bpf/kexec_pe_parser_bpf.lskel.h | 249 +------------------ kernel/kexec_bpf_loader.c | 93 ++++++- 4 files changed, 105 insertions(+), 246 deletions(-) diff --git a/kernel/Makefile b/kernel/Makefile index 9e17ad2a44b6f..caa9b3642ae8c 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -145,6 +145,7 @@ obj-$(CONFIG_SYSCTL_KUNIT_TEST) +=3D sysctl-test.o =20 CFLAGS_kstack_erase.o +=3D $(DISABLE_KSTACK_ERASE) CFLAGS_kstack_erase.o +=3D $(call cc-option,-mgeneral-regs-only) +CFLAGS_kexec_bpf_loader.o +=3D -I$(srctree)/tools/lib obj-$(CONFIG_KSTACK_ERASE) +=3D kstack_erase.o KASAN_SANITIZE_kstack_erase.o :=3D n KCSAN_SANITIZE_kstack_erase.o :=3D n diff --git a/kernel/kexec_bpf/Makefile b/kernel/kexec_bpf/Makefile index 45d45cc0855a3..88e92eb910f64 100644 --- a/kernel/kexec_bpf/Makefile +++ b/kernel/kexec_bpf/Makefile @@ -39,6 +39,14 @@ clean: kexec_pe_parser_bpf.lskel.h: $(OUTPUT)/kexec_pe_parser_bpf.o | $(BPFTOOL) $(call msg,GEN-SKEL,$@) $(Q)$(BPFTOOL) gen skeleton -L $< > $@ + @# The following sed commands make opts_data[] and opts_insn[] visible in= a file instead of only in a function. + @# And it removes the bytecode + $(Q) sed -i '/static const char opts_data\[\].*=3D/,/";$$/d' $@ + $(Q) sed -i '/static const char opts_insn\[\].*=3D/,/";$$/d' $@ + $(Q) sed -i \ + -e 's/opts\.data_sz =3D sizeof(opts_data) - 1;/opts.data_sz =3D opts_dat= a_sz;/' \ + -e 's/opts\.insns_sz =3D sizeof(opts_insn) - 1;/opts.insns_sz =3D opts_i= nsn_sz;/' $@ + $(Q) sed -i '7i static char *opts_data, *opts_insn;\nstatic unsigned int = opts_data_sz, opts_insn_sz;' $@ =20 $(OUTPUT)/vmlinux.h: $(VMLINUX) $(DEFAULT_BPFTOOL) $(BPFOBJ) | $(OUTPUT) @$(BPFTOOL) btf dump file $(VMLINUX) format c > $(OUTPUT)/vmlinux.h diff --git a/kernel/kexec_bpf/kexec_pe_parser_bpf.lskel.h b/kernel/kexec_bp= f/kexec_pe_parser_bpf.lskel.h index 22fd77a872fc0..00e54301c394a 100644 --- a/kernel/kexec_bpf/kexec_pe_parser_bpf.lskel.h +++ b/kernel/kexec_bpf/kexec_pe_parser_bpf.lskel.h @@ -4,6 +4,8 @@ #define __KEXEC_PE_PARSER_BPF_SKEL_H__ =20 #include +static char *opts_data, *opts_insn; +static unsigned int opts_data_sz, opts_insn_sz; =20 struct kexec_pe_parser_bpf { struct bpf_loader_ctx ctx; @@ -87,253 +89,10 @@ kexec_pe_parser_bpf__load(struct kexec_pe_parser_bpf *= skel) { struct bpf_load_and_run_opts opts =3D {}; int err; - static const char opts_data[] __attribute__((__aligned__(8))) =3D "\ -\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0= \0\0\ -\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0= \0\0\ -\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0= \0\0\ -\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0= \0\0\ -\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0= \0\0\ -\0\0\0\0\0\0\0\0\0\0\0\0\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70\ -\x01\0\0\x01\0\0\x0f\x04\0\0\0\x15\0\0\0\0\0\0\0\x04\0\0\0\0\x69\x6e\x74\0= \x5f\ -\x5f\x41\x52\x52\x41\x59\x5f\x53\x49\x5a\x45\x5f\x54\x59\x50\x45\x5f\x5f\0= \x74\ -\x79\x70\x65\0\x6d\x61\x78\x5f\x65\x6e\x74\x72\x69\x65\x73\0\x72\x69\x6e\x= 67\ -\x62\x75\x66\x5f\x31\0\x72\x69\x6e\x67\x62\x75\x66\x5f\x32\0\x72\x69\x6e\x= 67\ -\x62\x75\x66\x5f\x33\0\x72\x69\x6e\x67\x62\x75\x66\x5f\x34\0\x75\x6e\x73\x= 69\ -\x67\x6e\x65\x64\x20\x6c\x6f\x6e\x67\x20\x6c\x6f\x6e\x67\0\x63\x74\x78\0\x= 70\ -\x61\x72\x73\x65\x5f\x70\x65\0\x66\x65\x6e\x74\x72\x79\x2e\x73\x2f\x6b\x65= \x78\ -\x65\x63\x5f\x69\x6d\x61\x67\x65\x5f\x70\x61\x72\x73\x65\x72\x5f\x61\x6e\x= 63\ -\x68\x6f\x72\0\x2f\x68\x6f\x6d\x65\x2f\x6c\x69\x6e\x75\x78\x2f\x6b\x65\x72= \x6e\ -\x65\x6c\x2f\x6b\x65\x78\x65\x63\x5f\x62\x70\x66\x2f\x6b\x65\x78\x65\x63\x= 5f\ -\x70\x65\x5f\x70\x61\x72\x73\x65\x72\x5f\x62\x70\x66\x2e\x63\0\x5f\x5f\x61= \x74\ -\x74\x72\x69\x62\x75\x74\x65\x5f\x5f\x28\x28\x75\x73\x65\x64\x29\x29\x20\x= 69\ -\x6e\x74\x20\x42\x50\x46\x5f\x50\x52\x4f\x47\x28\x70\x61\x72\x73\x65\x5f\x= 70\ -\x65\x2c\x20\x73\x74\x72\x75\x63\x74\x20\x6b\x65\x78\x65\x63\x5f\x63\x6f\x= 6e\ -\x74\x65\x78\x74\x20\x2a\x63\x6f\x6e\x74\x65\x78\x74\x2c\0\x63\x68\x61\x72= \0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\0\ -\0\0\x10\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x6b\x65\x78\x65\x63\x5f\x= 70\ -\x65\x2e\x62\x73\x73\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x1f\0\0\0\0\0\0\0\0\0= \0\0\ -\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0= \0\0\ -\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x47\x50\x4c\0\0\0\0\0\xb4\0\0\0= \0\0\ -\0\0\x95\0\0\0\0\0\0\0\0\0\0\0\x12\0\0\0\0\0\0\0\x95\0\0\0\xc8\0\0\0\x1b\x= 20\0\ -\0\x1a\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0= \0\0\ -\0\0\0\0\0\0\0\0\x10\0\0\0\x70\x61\x72\x73\x65\x5f\x70\x65\0\0\0\0\0\0\0\0= \0\0\ -\0\0\x18\0\0\0\0\0\0\0\x08\0\0\0\0\0\0\0\0\0\0\0\x01\0\0\0\x10\0\0\0\0\0\0= \0\0\ -\0\0\0\x01\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0= \x10\ -\0\0\0\0\0\0\0\x6b\x65\x78\x65\x63\x5f\x69\x6d\x61\x67\x65\x5f\x70\x61\x72= \x73\ -\x65\x72\x5f\x61\x6e\x63\x68\x6f\x72\0\0\0\0\0\0\0"; - static const char opts_insn[] __attribute__((__aligned__(8))) =3D "\ -\xbf\x16\0\0\0\0\0\0\xbf\xa1\0\0\0\0\0\0\x07\x01\0\0\x78\xff\xff\xff\xb7\x= 02\0\ -\0\x88\0\0\0\xb7\x03\0\0\0\0\0\0\x85\0\0\0\x71\0\0\0\x05\0\x3b\0\0\0\0\0\x= 61\ -\xa1\x78\xff\0\0\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x61\x10\0\0\0\0\0\0\x63\x06\x38\0\0\0\0\0\x18\x61\0\0\0\0\0\0\0\0\0\0\x0c= \0\0\ -\0\x61\x10\0\0\0\0\0\0\x63\x06\x48\0\0\0\0\0\x18\x61\0\0\0\0\0\0\0\0\0\0\x= 10\0\ -\0\0\x61\x10\0\0\0\0\0\0\x63\x06\x58\0\0\0\0\0\x18\x61\0\0\0\0\0\0\0\0\0\0= \x14\ -\0\0\0\x61\x10\0\0\0\0\0\0\x63\x06\x68\0\0\0\0\0\x18\x61\0\0\0\0\0\0\0\0\0= \0\ -\x18\0\0\0\x61\x10\0\0\0\0\0\0\x63\x06\x78\0\0\0\0\0\x18\x61\0\0\0\0\0\0\0= \0\0\ -\0\x1c\0\0\0\x61\x10\0\0\0\0\0\0\x63\x06\x88\0\0\0\0\0\xb7\0\0\0\0\0\0\0\x= 95\0\ -\0\0\0\0\0\0"; opts.ctx =3D (struct bpf_loader_ctx *)skel; - opts.data_sz =3D sizeof(opts_data) - 1; + opts.data_sz =3D opts_data_sz; opts.data =3D (void *)opts_data; - opts.insns_sz =3D sizeof(opts_insn) - 1; + opts.insns_sz =3D opts_insn_sz; opts.insns =3D (void *)opts_insn; =20 err =3D bpf_load_and_run(&opts); diff --git a/kernel/kexec_bpf_loader.c b/kernel/kexec_bpf_loader.c index 7f7884411e2c7..430f6c3970b61 100644 --- a/kernel/kexec_bpf_loader.c +++ b/kernel/kexec_bpf_loader.c @@ -24,14 +24,105 @@ #include #include "kexec_internal.h" =20 +#include "kexec_bpf/kexec_pe_parser_bpf.lskel.h" + +static struct kexec_pe_parser_bpf *pe_parser; + +static void *get_symbol_from_elf(const char *elf_data, size_t elf_size, + const char *symbol_name, + unsigned int *symbol_size) +{ + Elf_Ehdr *ehdr =3D (Elf_Ehdr *)elf_data; + Elf_Shdr *shdr, *dst_shdr; + const Elf_Sym *sym; + void *symbol_data; + + /* Check minimum size for ELF header */ + if (elf_size < sizeof(Elf_Ehdr)) { + pr_err("ELF file too small\n"); + return NULL; + } + + if (memcmp(ehdr->e_ident, ELFMAG, SELFMAG) !=3D 0) { + pr_err("Not a valid ELF file\n"); + return NULL; + } + + /* Check section header table bounds */ + if (ehdr->e_shoff > elf_size || + ehdr->e_shoff + (ehdr->e_shnum * sizeof(Elf_Shdr)) > elf_size) { + pr_err("Section header table out of bounds\n"); + return NULL; + } + + sym =3D elf_find_symbol(ehdr, symbol_name); + if (!sym) + return NULL; + + /* Check symbol section index */ + if (sym->st_shndx >=3D ehdr->e_shnum) { + pr_err("Symbol section index out of bounds\n"); + return NULL; + } + + shdr =3D (struct elf_shdr *)(elf_data + ehdr->e_shoff); + dst_shdr =3D &shdr[sym->st_shndx]; + + /* Check section data bounds */ + if (dst_shdr->sh_offset > elf_size || + dst_shdr->sh_offset + dst_shdr->sh_size > elf_size || + sym->st_value > dst_shdr->sh_size) { + pr_err("Symbol data out of bounds\n"); + return NULL; + } + + symbol_data =3D (void *)(elf_data + dst_shdr->sh_offset + sym->st_value); + + if (symbol_size) + *symbol_size =3D sym->st_size; + + return symbol_data; +} + /* Load a ELF */ static int arm_bpf_prog(char *bpf_elf, unsigned long sz) { - return -1; + opts_data =3D get_symbol_from_elf(bpf_elf, sz, "opts_data", &opts_data_sz= ); + opts_insn =3D get_symbol_from_elf(bpf_elf, sz, "opts_insn", &opts_insn_sz= ); + if (!opts_data || !opts_insn) { + pr_err("Cannot get symbol from ELF: opts_data=3D%px, opts_insn=3D%px\n", + opts_data, opts_insn); + return -1; + } + + if (opts_data_sz < 1 || opts_insn_sz < 1) { + pr_err("Symbol size too small (opts_data_sz=3D%u, opts_insn_sz=3D%u)\n", + opts_data_sz, opts_insn_sz); + return -1; + } + /* + * When light skeleton generates opts_data[] and opts_insn[], it appends a + * NULL terminator at the end of string + */ + opts_data_sz =3D opts_data_sz - 1; + opts_insn_sz =3D opts_insn_sz - 1; + + pe_parser =3D kexec_pe_parser_bpf__open_and_load(); + if (!pe_parser) { + pr_info("Can not open and load bpf parser\n"); + return -1; + } + kexec_pe_parser_bpf__attach(pe_parser); + + return 0; } =20 static void disarm_bpf_prog(void) { + kexec_pe_parser_bpf__destroy(pe_parser); + pe_parser =3D NULL; + opts_data =3D NULL; + opts_insn =3D NULL; } =20 #define MAX_PARSING_BUF_NUM 16 --=20 2.49.0