diff --git a/aya-obj/CHANGELOG.md b/aya-obj/CHANGELOG.md index 508e1db5..ceadbb1c 100644 --- a/aya-obj/CHANGELOG.md +++ b/aya-obj/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## 0.2.0 (2024-10-09) +## 0.2.1 (2024-11-01) ### New Features @@ -15,8 +15,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 updating to a new Aya release less of a burden. These aliases are marked as deprecated since we'll likely remove them in a later release. +### Bug Fixes + + - Fill bss maps with zeros + The loader should fill bss maps with zeros according to the size of the + ELF section. + Failure to do so yields weird verifier messages as follows: + + ``` + cannot access ptr member ops with moff 0 in struct bpf_map with off 0 size 4 + ``` + + Reference to this in the cilium/ebpf code is here [1]. + I could not find a reference in libbpf. + ### Other + - cgroup_iter_order NFPROTO* nf_inet_hooks + Adds the following to codegen: + - `bpf_cgroup_iter_order`: used in `bpf_link_info.iter.group.order` + - `NFPROTO_*`: used in `bpf_link_info.netfilter.pf` + - `nf_inet_hooks`: used in `bpf_link_info.netfilter.hooknum` + + Include `linux/netfilter.h` in `linux_wrapper.h` for `NFPROTO_*` and + `nf_inet_hooks` to generate. - revamp MapInfo be more friendly with older kernels Adds detection for whether a field is available in `MapInfo`: - For `map_type()`, we treturn new enum `MapType` instead of the integer @@ -79,9 +101,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - 19 commits contributed to the release. - - 223 days passed between releases. - - 10 commits were understood as [conventional](https://www.conventionalcommits.org). + - 25 commits contributed to the release over the course of 241 calendar days. + - 247 days passed between releases. + - 12 commits were understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' were seen in commit messages ### Commit Details @@ -91,6 +113,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - Merge pull request #1073 from dave-tucker/reloc-bug ([`b2ac9fe`](https://github.com/aya-rs/aya/commit/b2ac9fe85db6c25d0b8155a75a2df96a80a19811)) + - Fill bss maps with zeros ([`ca0c32d`](https://github.com/aya-rs/aya/commit/ca0c32d1076af81349a52235a4b6fb3937a697b3)) + - Merge pull request #1055 from aya-rs/codegen ([`59b3873`](https://github.com/aya-rs/aya/commit/59b3873a92d1eb49ca1008cb193e962fa95b3e97)) + - [codegen] Update libbpf to 80b16457cb23db4d633b17ba0305f29daa2eb307 ([`f8ad84c`](https://github.com/aya-rs/aya/commit/f8ad84c3d322d414f27375044ba694a169abfa76)) + - Cgroup_iter_order NFPROTO* nf_inet_hooks ([`366c599`](https://github.com/aya-rs/aya/commit/366c599c2083baf72c40c816da2c530dec7fd612)) + - Release aya-obj v0.2.0, aya v0.13.0, safety bump aya v0.13.0 ([`c169b72`](https://github.com/aya-rs/aya/commit/c169b727e6b8f8c2dda57f54b8c77f8b551025c6)) - Appease clippy ([`aa240ba`](https://github.com/aya-rs/aya/commit/aa240baadf99d3fea0477a9b3966789b0f4ffe57)) - Merge pull request #1007 from tyrone-wu/aya/info-api ([`15eb935`](https://github.com/aya-rs/aya/commit/15eb935bce6d41fb67189c48ce582b074544e0ed)) - Revamp MapInfo be more friendly with older kernels ([`fbb0930`](https://github.com/aya-rs/aya/commit/fbb09304a2de0d8baf7ea20c9727fcd2e4fb7f41)) @@ -112,6 +140,84 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Rename BpfSectionKind to EbpfSectionKind ([`cf3e2ca`](https://github.com/aya-rs/aya/commit/cf3e2ca677c81224368fb2838ebc5b10ee98419a))
+## 0.2.0 (2024-10-09) + + + + + + + + + +### New Features + + - Rename Bpf to Ebpf + And BpfLoader to EbpfLoader. + This also adds type aliases to preserve the use of the old names, making + updating to a new Aya release less of a burden. These aliases are marked + as deprecated since we'll likely remove them in a later release. + +### Other + + - revamp MapInfo be more friendly with older kernels + Adds detection for whether a field is available in `MapInfo`: + - For `map_type()`, we treturn new enum `MapType` instead of the integer + representation. + - For fields that can't be zero, we return `Option` type. + - For `name_as_str()`, it now uses the feature probe `bpf_name()` to + detect if field is available. + Although the feature probe checks for program name, it can also be + used for map name since they were both introduced in the same commit. + - revamp ProgramInfo be more friendly with older kernels + Purpose of this commit is to add detections for whether a field is + available in `ProgramInfo`. + - For `program_type()`, we return the new enum `ProgramType` instead of + the integer representation. + - For fields that we know cannot be zero, we return `Option` + type. + - For `name_as_str()`, it now also uses the feature probe `bpf_name()` + to detect if field is available or not. + - Two additional feature probes are added for the fields: + - `prog_info_map_ids()` probe -> `map_ids()` field + - `prog_info_gpl_compatible()` probe -> `gpl_compatible()` field + + With the `prog_info_map_ids()` probe, the previous implementation that + I had for `bpf_prog_get_info_by_fd()` is shortened to use the probe + instead of having to make 2 potential syscalls. + + The `test_loaded_at()` test is also moved into info tests since it is + better related to the info tests. + - add conversion u32 to enum type for prog, link, & attach type + Add conversion from u32 to program type, link type, and attach type. + Additionally, remove duplicate match statement for u32 conversion to + `BPF_MAP_TYPE_BLOOM_FILTER` & `BPF_MAP_TYPE_CGRP_STORAGE`. + + New error `InvalidTypeBinding` is created to represent when a + parsed/received value binding to a type is invalid. + This is used in the new conversions added here, and also replaces + `InvalidMapTypeError` in `TryFrom` for `bpf_map_type`. + - add archs powerpc64 and s390x to aya + bpfman, a project using aya, has a requirement to support powerpc64 and + s390x architectures. Adding these two architectures to aya. + - Generate new bindings + +### Test + + - adjust test to not use byte arrays + Where possible, replace the hardcoded byte arrays in the tests with the + structs they represent, then convert the structs to byte arrays. + - adjust test byte arrays for big endian + Adding support for s390x (big endian architecture) and found that some + of the unit tests have structures and files implemented as byte arrays. + They are all coded as little endian and need a bug endian version to + work properly. + +### New Features (BREAKING) + + - Rename BpfRelocationError -> EbpfRelocationError + - Rename BpfSectionKind to EbpfSectionKind + ## 0.1.0 (2024-02-28) diff --git a/aya-obj/Cargo.toml b/aya-obj/Cargo.toml index 03ccc971..bca508bf 100644 --- a/aya-obj/Cargo.toml +++ b/aya-obj/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aya-obj" -version = "0.2.0" +version = "0.2.1" description = "An eBPF object file parsing library with BTF and relocation support." keywords = ["bpf", "btf", "ebpf", "elf", "object"] readme = "README.md" diff --git a/aya/Cargo.toml b/aya/Cargo.toml index ef82d9e5..bafe5f14 100644 --- a/aya/Cargo.toml +++ b/aya/Cargo.toml @@ -15,7 +15,7 @@ edition.workspace = true [dependencies] assert_matches = { workspace = true } async-io = { workspace = true, optional = true } -aya-obj = { path = "../aya-obj", version = "^0.2.0", features = ["std"] } +aya-obj = { path = "../aya-obj", version = "^0.2.1", features = ["std"] } bitflags = { workspace = true } bytes = { workspace = true } libc = { workspace = true } diff --git a/test/integration-test/Cargo.toml b/test/integration-test/Cargo.toml index 815f650d..a481bf14 100644 --- a/test/integration-test/Cargo.toml +++ b/test/integration-test/Cargo.toml @@ -13,7 +13,7 @@ anyhow = { workspace = true, features = ["std"] } assert_matches = { workspace = true } aya = { path = "../../aya", version = "^0.13.0", default-features = false } aya-log = { path = "../../aya-log", version = "^0.2.1", default-features = false } -aya-obj = { path = "../../aya-obj", version = "^0.2.0", default-features = false } +aya-obj = { path = "../../aya-obj", version = "^0.2.1", default-features = false } env_logger = { workspace = true } epoll = { workspace = true } futures = { workspace = true, features = ["std"] }