scaffold: aports overlay, build script, CI workflow, README
Kernel aport forked from pmaports 7.1.2-r0, repointed at milos-linux combined-stable with the tested FP6 config (+EFI_ZBOOT for packaging); imsd + nftables aports from the pending pmaports submission. build.sh carries TODO(validate) markers - not yet run end-to-end. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
commit
de2e819a16
26 changed files with 9095 additions and 0 deletions
|
|
@ -0,0 +1,91 @@
|
|||
From d648a5fd7f95d961126605d59da5ad007c265bda Mon Sep 17 00:00:00 2001
|
||||
From: Aelin Reidel <aelin@mainlining.org>
|
||||
Date: Wed, 17 Jun 2026 00:38:17 +0200
|
||||
Subject: [PATCH] resolve_btfids: preserve tag and parameter names when
|
||||
processing implicit args
|
||||
|
||||
process_kfunc_with_implicit_args() obtains parameter names through
|
||||
btf__name_by_offset() and passes them to btf__add_func_param() while
|
||||
constructing a new function prototype. Tag names are processed in a
|
||||
similar fashion.
|
||||
|
||||
The returned name pointer references memory owned by the BTF object.
|
||||
btf__add_func_param(), btf__add_decl_tag(), etc. modify the same BTF and
|
||||
may grow its internal storage, invalidating previously returned string
|
||||
pointers.
|
||||
|
||||
This can result in btf__add_func_param(), btf__add_decl_tag(), etc.
|
||||
dereferencing a stale pointer when copying the string, leading to crashes
|
||||
in strset__add_str().
|
||||
|
||||
Duplicate the parameter name before calling btf__add_func_param() so it
|
||||
remains valid across BTF updates.
|
||||
|
||||
Fixes: 9d199965990c ("resolve_btfids: Support for KF_IMPLICIT_ARGS")
|
||||
Cc: stable@vger.kernel.org
|
||||
Signed-off-by: Aelin Reidel <aelin@mainlining.org>
|
||||
---
|
||||
tools/bpf/resolve_btfids/main.c | 20 +++++++++++++++-----
|
||||
1 file changed, 15 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/tools/bpf/resolve_btfids/main.c b/tools/bpf/resolve_btfids/main.c
|
||||
index f8a91fa7584f..94b89e9c942e 100644
|
||||
--- a/tools/bpf/resolve_btfids/main.c
|
||||
+++ b/tools/bpf/resolve_btfids/main.c
|
||||
@@ -1113,6 +1113,7 @@ static int process_kfunc_with_implicit_args(struct btf2btf_context *ctx, struct
|
||||
{
|
||||
s32 idx, new_proto_id, new_func_id, proto_id;
|
||||
const char *param_name, *tag_name;
|
||||
+ char *tmp_param_name, *tmp_tag_name;
|
||||
const struct btf_param *params;
|
||||
enum btf_func_linkage linkage;
|
||||
char tmp_name[KSYM_NAME_LEN];
|
||||
@@ -1163,18 +1164,22 @@ static int process_kfunc_with_implicit_args(struct btf2btf_context *ctx, struct
|
||||
if (strcmp(tag_name, "bpf_kfunc") == 0)
|
||||
continue;
|
||||
|
||||
+ tmp_tag_name = strdup(tag_name);
|
||||
idx = btf_decl_tag(t)->component_idx;
|
||||
|
||||
if (btf_kflag(t))
|
||||
- err = btf__add_decl_attr(btf, tag_name, new_func_id, idx);
|
||||
+ err = btf__add_decl_attr(btf, tmp_tag_name, new_func_id, idx);
|
||||
else
|
||||
- err = btf__add_decl_tag(btf, tag_name, new_func_id, idx);
|
||||
+ err = btf__add_decl_tag(btf, tmp_tag_name, new_func_id, idx);
|
||||
|
||||
if (err < 0) {
|
||||
pr_err("ERROR: resolve_btfids: failed to add decl tag %s for %s\n",
|
||||
- tag_name, tmp_name);
|
||||
+ tmp_tag_name, tmp_name);
|
||||
+ free(tmp_tag_name);
|
||||
return -EINVAL;
|
||||
}
|
||||
+
|
||||
+ free(tmp_tag_name);
|
||||
}
|
||||
|
||||
add_new_proto:
|
||||
@@ -1193,12 +1198,17 @@ static int process_kfunc_with_implicit_args(struct btf2btf_context *ctx, struct
|
||||
if (is_kf_implicit_arg(btf, ¶ms[i]))
|
||||
break;
|
||||
param_name = btf__name_by_offset(btf, params[i].name_off);
|
||||
- err = btf__add_func_param(btf, param_name, params[i].type);
|
||||
+ tmp_param_name = strdup(param_name);
|
||||
+ if (!tmp_param_name)
|
||||
+ return -ENOMEM;
|
||||
+ err = btf__add_func_param(btf, tmp_param_name, params[i].type);
|
||||
if (err < 0) {
|
||||
pr_err("ERROR: resolve_btfids: failed to add param %s for %s\n",
|
||||
- param_name, kfunc->name);
|
||||
+ tmp_param_name, kfunc->name);
|
||||
+ free(tmp_param_name);
|
||||
return err;
|
||||
}
|
||||
+ free(tmp_param_name);
|
||||
t = (struct btf_type *)btf__type_by_id(btf, proto_id);
|
||||
}
|
||||
|
||||
--
|
||||
2.54.0
|
||||
|
||||
90
aports/device/linux-postmarketos-qcom-milos/APKBUILD
Normal file
90
aports/device/linux-postmarketos-qcom-milos/APKBUILD
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
# Fork of pmaports device/testing/linux-postmarketos-qcom-milos (7.1.2-r0),
|
||||
# overlaid via pmbootstrap so it shadows the upstream aport. Differences:
|
||||
# source is the Catcrafts combined-stable branch (upstream v7.1.2-milos tag +
|
||||
# the FP6 bring-up carries), and the config is the exact one the development
|
||||
# FP6 runs, plus CONFIG_EFI_ZBOOT for the packaging below.
|
||||
maintainer="Jorijn van der Graaf <jorijnvdgraaf@catcrafts.net>"
|
||||
_flavor="postmarketos-qcom-milos"
|
||||
pkgname=linux-$_flavor
|
||||
pkgver=7.1.2
|
||||
# always sorts above the upstream aport (r0..r99)
|
||||
pkgrel=100
|
||||
pkgdesc="Milos mainline kernel + Catcrafts FP6 bring-up carries (combined-stable)"
|
||||
arch="aarch64"
|
||||
_carch="arm64"
|
||||
url="https://forgejo.catcrafts.net/Catcrafts/milos-linux"
|
||||
license="GPL-2.0-only"
|
||||
options="!strip !check !tracedeps
|
||||
pmb:cross-native
|
||||
pmb:kconfigcheck-community
|
||||
pmb:kconfigcheck-uefi
|
||||
"
|
||||
makedepends="
|
||||
bison
|
||||
clang
|
||||
elfutils-dev
|
||||
findutils
|
||||
flex
|
||||
installkernel
|
||||
linux-headers
|
||||
lld
|
||||
llvm
|
||||
openssl-dev
|
||||
pahole
|
||||
perl
|
||||
python3
|
||||
zstd
|
||||
"
|
||||
|
||||
_config="config-$_flavor.$arch"
|
||||
# Pinned by CI: the instance has source archives disabled, so the tarball is
|
||||
# generated with git-archive (prefix milos-linux/) from combined-stable and
|
||||
# placed next to this APKBUILD before `pmbootstrap checksum` runs. See
|
||||
# build.sh at the repository root.
|
||||
_commit="REPLACED_BY_CI"
|
||||
|
||||
source="
|
||||
milos-linux-$_commit.tar.gz
|
||||
0001-resolve_btfids-preserve-tag-and-parameter-names-when.patch
|
||||
$_config
|
||||
"
|
||||
builddir="$srcdir/milos-linux"
|
||||
|
||||
prepare() {
|
||||
default_prepare
|
||||
cp "$srcdir/config-$_flavor.$arch" .config
|
||||
}
|
||||
|
||||
build() {
|
||||
unset LDFLAGS
|
||||
make ARCH="$_carch" LLVM=1 \
|
||||
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-$_flavor"
|
||||
}
|
||||
|
||||
package() {
|
||||
# ZBOOT EFI decompressor for EFI booting
|
||||
install -Dm644 "$builddir/arch/$_carch/boot/vmlinuz.efi" \
|
||||
"$pkgdir/boot/linux.efi"
|
||||
|
||||
# Old GZIP'd kernel image for boot.img compatibility
|
||||
install -Dm644 "$builddir/arch/$_carch/boot/vmlinuz" \
|
||||
"$pkgdir/boot/vmlinuz"
|
||||
|
||||
make modules_install dtbs_install \
|
||||
ARCH="$_carch" \
|
||||
LLVM=1 \
|
||||
INSTALL_PATH="$pkgdir"/boot/ \
|
||||
INSTALL_MOD_PATH="$pkgdir"/usr \
|
||||
INSTALL_MOD_STRIP=1 \
|
||||
INSTALL_DTBS_PATH="$pkgdir"/boot/dtbs
|
||||
rm -f "$pkgdir"/lib/modules/*/build "$pkgdir"/lib/modules/*/source
|
||||
|
||||
install -D "$builddir"/include/config/kernel.release \
|
||||
"$pkgdir"/usr/share/kernel/$_flavor/kernel.release
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
REPLACED_BY_CI milos-linux-REPLACED_BY_CI.tar.gz
|
||||
4e705e038a91466a86fc5317b0028c2220aa1e7a4807e5d86db2f9ac815a927c59666a8f21ed50c4632147d3ce183d8042378a76f95341dbcd3db1047faf39e3 0001-resolve_btfids-preserve-tag-and-parameter-names-when.patch
|
||||
REPLACED_BY_CI config-postmarketos-qcom-milos.aarch64
|
||||
"
|
||||
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue