Commit Graph

1718 Commits (2e0bc82078f16ebe453a8efc344c2b27f6710d3e)
 

Author SHA1 Message Date
martinsoees 2e0bc82078 Review comments
- Removed 'ignore_map_by_type' since 'ignore_map_by_name' makes more sense
2 months ago
martinsoees 7b9f1d26d1 Review comments
- Removed 'ignore_map_by_type' since 'ignore_map_by_name' makes more sense
2 months ago
martinsoees d9cd8de7fc Properly cfg gate std and non-std 3 months ago
martinsoees b05ab1599d Applied cargo fmt to fix formatting 3 months ago
martinsoees c3084fd6a7 removed newline at end of file 3 months ago
martinsoees ad2dc1b7f0 Fixed doc test 3 months ago
martinsoees 0e35566479 indentation 3 months ago
martinsoees b49c3001f1 Added integration tests for ignoring maps by type and by name 3 months ago
martinsoees aad4ad4fd3 Changed name to 'ignore_map_by_type' and created a similar function that does the same by name. Fixed renaming and added the new 3rd argument to relocate_maps() for rbpf test case 3 months ago
martinsoees c725b9d69e All tests are passing now 3 months ago
martinsoees 5276a91846 Remove println import, added code comments and re-added patch_map_data (removed by mistake) 3 months ago
martinsoees 3525560c4a Added documentation to 3 months ago
martinsoees 74f5acf419 Ignore relocation of maps that should be ignored.
This makes it possible to have bytecode with unsupported map types such as BPF_MAP_TYPE_RINGBUF on a target kernel that doesn't have that map type
3 months ago
dependabot[bot] bf20a8c892
Merge pull request #965 from aya-rs/dependabot/cargo/cargo-crates-f36f6a6c13 4 months ago
dependabot[bot] 37777a0d5a
build(deps): update public-api requirement in the cargo-crates group
Updates the requirements on [public-api](https://github.com/Enselic/cargo-public-api) to permit the latest version.

Updates `public-api` to 0.33.1
- [Release notes](https://github.com/Enselic/cargo-public-api/releases)
- [Changelog](https://github.com/Enselic/cargo-public-api/blob/main/rustdoc-json/CHANGELOG.md)
- [Commits](https://github.com/Enselic/cargo-public-api/compare/public-api-v0.33.1...public-api-v0.33.1)

---
updated-dependencies:
- dependency-name: public-api
  dependency-type: direct:production
  dependency-group: cargo-crates
...

Signed-off-by: dependabot[bot] <support@github.com>
4 months ago
Tamir Duberstein 781914f058 Don't deny unused_qualifications
Nightly added stuff to the prelude.
4 months ago
tyrone-wu 5e13283f59 fix: fix rustdocs-args ordering in taplo to -D warnings
This fixes the current rustdoc build error by correcting the ordering of
`rustdoc-args` to `-D warnings`. Additionally, this also removes the
`recorder_arrays` field (defaults to false) so that the order is not
modified, which is what caused the error in the first place.
4 months ago
dependabot[bot] 0ec87f6e4f
Merge pull request #955 from aya-rs/dependabot/cargo/cargo-crates-d36358862b 4 months ago
dependabot[bot] dd92b41a59
build(deps): bump the cargo-crates group with 2 updates
Updates the requirements on [nix](https://github.com/nix-rust/nix) and [object](https://github.com/gimli-rs/object) to permit the latest version.

Updates `nix` to 0.28.0
- [Changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/compare/v0.28.0...v0.28.0)

Updates `object` to 0.35.0
- [Changelog](https://github.com/gimli-rs/object/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gimli-rs/object/compare/0.35.0...0.35.0)

---
updated-dependencies:
- dependency-name: nix
  dependency-type: direct:production
  dependency-group: cargo-crates
- dependency-name: object
  dependency-type: direct:production
  dependency-group: cargo-crates
...

Signed-off-by: dependabot[bot] <support@github.com>
4 months ago
Tamir Duberstein 4e843a3523 Remove deny(pointer_structural_match)
```
warning: lint `pointer_structural_match` has been removed: converted into hard error, see RFC #3535 <https://rust-lang.github.io/rfcs/3535-constants-in-patterns.html> for more information
  --> aya/src/lib.rs:57:5
   |
57 |     pointer_structural_match,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(renamed_and_removed_lints)]` on by default
```
4 months ago
Tamir Duberstein 683cedfe48 Appease clippy
warning: doc list item missing indentation
  --> test/integration-test/build.rs:20:5
   |
20 | /// prevent their use for the time being.
   |     ^
   |
   = help: if this is supposed to be its own paragraph, add a blank line
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
   = note: `#[warn(clippy::doc_lazy_continuation)]` on by default
help: indent this line
   |
20 | ///   prevent their use for the time being.
   |     ++
4 months ago
Tamir Duberstein 3808ad5520 Reduce dependabot toil 4 months ago
Alessandro Decina bde4b5f86b
Merge pull request #938 from swananan/enhance_urpobe_symbol_lookup
aya: add symbol lookup in associated debug files
4 months ago
Alessandro Decina c7898c596f Fix clippy 4 months ago
swananan 462514ed4c aya: adjust symbol lookup tests for object crate alignment requirements
The object::File::parse API requires parameter to be aligned with 8 bytes.
Adjusted the Vec in the tests with miri to meet this requirement.
4 months ago
Alessandro Decina a2c8fcab4e aya: bless API changes
The equivalent crate has a blanket implementation smh. We don't depend
on it directly it's pulled in by the object crate.
5 months ago
dependabot[bot] 040e47c28b
Merge pull request #924 from aya-rs/dependabot/github_actions/production-dependencies-e915e9eb26 5 months ago
dependabot[bot] 5d0cefce8a
Merge pull request #930 from aya-rs/dependabot/cargo/production-dependencies-9eca24263e 5 months ago
swananan e6e1bfeb58 aya: add symbol lookup in associated debug files
This change enhances the logic for symbol lookup in uprobe or uretprobe.
If the symbol is not found in the original binary, the search continues
in the debug file associated through the debuglink section. Before
searching the symbol table, it compares the build IDs of the two files.
The symbol lookup will only be terminated if both build IDs exist and do
not match. This modification does not affect the existing symbol lookup
logic.

Refs: #936
5 months ago
dependabot[bot] e34e8536d4
build(deps): bump DavidAnson/markdownlint-cli2-action
Bumps the production-dependencies group with 1 update: [DavidAnson/markdownlint-cli2-action](https://github.com/davidanson/markdownlint-cli2-action).


Updates `DavidAnson/markdownlint-cli2-action` from 15 to 16
- [Release notes](https://github.com/davidanson/markdownlint-cli2-action/releases)
- [Commits](https://github.com/davidanson/markdownlint-cli2-action/compare/v15...v16)

---
updated-dependencies:
- dependency-name: DavidAnson/markdownlint-cli2-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: production-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
5 months ago
dependabot[bot] dc9ed22aeb
build(deps): update object requirement
Updates the requirements on [object](https://github.com/gimli-rs/object) to permit the latest version.

Updates `object` to 0.34.0
- [Changelog](https://github.com/gimli-rs/object/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gimli-rs/object/compare/0.34.0...0.34.0)

---
updated-dependencies:
- dependency-name: object
  dependency-type: direct:production
  dependency-group: production-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
5 months ago
Tamir Duberstein e4f9ed8d79 Allowlist expected cfgs
See https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg.
5 months ago
Tamir Duberstein b603c665a9 Deny warnings 5 months ago
Alessandro Decina d0e9b95aa5
Merge pull request #928 from seanyoung/io-error
Expose io_error in SyscallError
5 months ago
Tamir Duberstein a11b61ebfd s/MiriSafeFd/MockableFd/
The need for this type isn't specific to Miri; it is necessary on
toolchains containing https://github.com/rust-lang/rust/pull/124210 - it
just so happens that today this is nightly only, and so is Miri.
5 months ago
Tamir Duberstein cb6d3bd75d Remove miri ignores
These only warn now:

```
test maps::hash_map::hash_map::tests::test_iter ... warning: integer-to-pointer cast
   --> aya/src/maps/hash_map/hash_map.rs:304:15
    |
304 |         match unsafe { attr.__bindgen_anon_2.key } as *const T {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ integer-to-pointer cast
    |
    = help: This program is using integer-to-pointer casts or (equivalently) `ptr::with_exposed_provenance`,
    = help: which means that Miri might miss pointer bugs in this program.
    = help: See https://doc.rust-lang.org/nightly/std/ptr/fn.with_exposed_provenance.html for more details on that operation.
    = help: To ensure that Miri does not miss bugs in your program, use Strict Provenance APIs (https://doc.rust-lang.org/nightly/std/ptr/index.html#strict-provenance, https://crates.io/crates/sptr) instead.
    = help: You can then pass the `-Zmiri-strict-provenance` flag to Miri, to ensure you are not relying on `with_exposed_provenance` semantics.
    = help: Alternatively, the `-Zmiri-permissive-provenance` flag disables this warning.
    = note: BACKTRACE on thread `maps::hash_map:`:
    = note: inside `maps::hash_map::hash_map::tests::bpf_key::<i32>` at aya/src/maps/hash_map/hash_map.rs:304:15: 304:63
```
5 months ago
Tamir Duberstein 35962a4794 Document miri skip reasons 5 months ago
Tamir Duberstein 7a7d16885a Avoid crashing under Miri
See https://github.com/rust-lang/rust/pull/124210.
5 months ago
Tamir Duberstein 7e1666fb83 Deduplicate test helpers 5 months ago
Tamir Duberstein 58e154e1bc Reduce duplication 5 months ago
Alessandro Decina e5d107dd50
Merge pull request #900 from catalin-h/log_init_from_program_id
aya-log: allow re-attach and read previously created logs
5 months ago
Alessandro Decina 8830c0bc20 docs(aya-log): reword rustdocs a bit 5 months ago
Alessandro Decina 60abea54ce chore(aya-log): bless API 5 months ago
Catalin Horghidan e66f9540c9 aya-log: allow re-attach and read previously created logs
This feature is useful if someone wants to view the log contents
of a program that is already running. For e.g. a pinned program
or an XDP program attached to a net interface.
5 months ago
Alessandro Decina fc2eb70163 chore(ci): remove macos workaround now that LLVM18 is in brew 5 months ago
Alessandro Decina f089a37626 chore(ci): fix bpf-linker link failure on macos
Force bpf-linker to always be rebuilt/relinked. Before this change we
were always installing latest llvm from brew, but not always rebuilding
bpf-linker, which could lead to:

Run cargo install bpf-linker --git https://github.com/aya-rs/bpf-linker.git --rev 821f92990074cb7e950e25129dcd55e20424cede --no-default-features
    Updating git repository `https://github.com/aya-rs/bpf-linker.git`
     Ignored package `bpf-linker v0.9.10 (https://github.com/aya-rs/bpf-linker.git?rev=821f92990074cb7e950e25129dcd55e20424cede#821f9299)` is already installed, use --force to override

And then:

warning: integration-test@0.1.0: error: linking with `bpf-linker` failed: signal: 6 (SIGABRT)
warning: integration-test@0.1.0:   = note: dyld[17642]: Library not loaded: '/usr/local/opt/z3/lib/libz3.4.12.dylib'
warning: integration-test@0.1.0:             Referenced from: '/Users/runner/.cargo/bin/bpf-linker'
5 months ago
tyrone-wu 1cf3d3c222 public-api: added new api for RetProbeContext 5 months ago
tyrone-wu 6988dac159 test/integration-ebpf: added integration tests for kretprobe & uretprobe
Added integration test methods for kretprobe and uretprobe with their
appropriate contexts.
5 months ago
tyrone-wu b84ede10b9 aya-ebpf/macros: separate probe to probe ctx & retprobe to retprobe ctx
Added logic in expand function in both kprobe.rs and uprobe.rs for valid
macros. Now, kprobe & uprobe proc macros only accept ProbeContext, and
kretprobe & uretprobe only accept RetProbeContext.

Ref: #700
5 months ago
tyrone-wu 2d38b23b99 aya-ebpf/programs: moved ret from ProbeContext into new RetProbeContext
Created retprobe.rs to hold RetProbeContext and moved the ret from
ProbeContext in probe.rs into RetProbeContext. Now, only kprobe (which
uses ProbeContext) can access args, and kretprobe (which uses
RetProbeContext) can access ret.

Fixes: #700
5 months ago