aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Balbi <[email protected]>2025-11-07 10:43:32 -0800
committerFelipe Balbi <[email protected]>2025-11-07 10:51:04 -0800
commit812f3c840f4d505e285d1ddce6b0981dd745e344 (patch)
tree4425cdc41b4dd59c5e8dbbfdef3b8e10cad28063
parente75066820ad320495ca70570641c90d75247b19b (diff)
Reintroduce necessary files
Signed-off-by: Felipe Balbi <[email protected]>
-rw-r--r--.github/DOCS.md23
-rw-r--r--.github/codecov.yml21
-rw-r--r--.github/dependabot.yml19
-rw-r--r--.github/workflows/cargo-vet-pr-comment.yml137
-rw-r--r--.github/workflows/cargo-vet.yml53
-rw-r--r--.github/workflows/check.yml205
-rw-r--r--.github/workflows/nostd.yml43
-rw-r--r--.github/workflows/rolling.yml68
-rw-r--r--CODE_OF_CONDUCT.md132
-rw-r--r--CONTRIBUTING.md48
-rw-r--r--LICENSE (renamed from License.txt)0
-rw-r--r--README.md (renamed from README.txt)44
-rw-r--r--SECURITY.md66
-rw-r--r--deny.toml241
-rw-r--r--supply-chain/README.md149
-rw-r--r--supply-chain/audits.toml38
-rw-r--r--supply-chain/config.toml226
-rw-r--r--supply-chain/imports.lock472
18 files changed, 1971 insertions, 14 deletions
diff --git a/.github/DOCS.md b/.github/DOCS.md
new file mode 100644
index 000000000..e932784c7
--- /dev/null
+++ b/.github/DOCS.md
@@ -0,0 +1,23 @@
1# Github config and workflows
2
3In this folder there is configuration for codecoverage, dependabot, and ci
4workflows that check the library more deeply than the default configurations.
5
6This folder can be or was merged using a --allow-unrelated-histories merge
7strategy from <https://github.com/jonhoo/rust-ci-conf/> which provides a
8reasonably sensible base for writing your own ci on. By using this strategy
9the history of the CI repo is included in your repo, and future updates to
10the CI can be merged later.
11
12To perform this merge run:
13
14```shell
15git remote add ci https://github.com/jonhoo/rust-ci-conf.git
16git fetch ci
17git merge --allow-unrelated-histories ci/main
18```
19
20An overview of the files in this project is available at:
21<https://www.youtube.com/watch?v=xUH-4y92jPg&t=491s>, which contains some
22rationale for decisions and runs through an example of solving minimal version
23and OpenSSL issues.
diff --git a/.github/codecov.yml b/.github/codecov.yml
new file mode 100644
index 000000000..cd5ce8fc1
--- /dev/null
+++ b/.github/codecov.yml
@@ -0,0 +1,21 @@
1# ref: https://docs.codecov.com/docs/codecovyml-reference
2coverage:
3 # Hold ourselves to a high bar
4 range: 85..100
5 round: down
6 precision: 1
7 status:
8 # ref: https://docs.codecov.com/docs/commit-status
9 project:
10 default:
11 # Avoid false negatives
12 threshold: 1%
13
14# Test files aren't important for coverage
15ignore:
16 - "tests"
17
18# Make comments less noisy
19comment:
20 layout: "files"
21 require_changes: true
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 000000000..d0f091e7b
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,19 @@
1version: 2
2updates:
3 - package-ecosystem: github-actions
4 directory: /
5 schedule:
6 interval: daily
7 - package-ecosystem: cargo
8 directory: /
9 schedule:
10 interval: daily
11 ignore:
12 - dependency-name: "*"
13 # patch and minor updates don't matter for libraries as consumers of this library build
14 # with their own lockfile, rather than the version specified in this library's lockfile
15 # remove this ignore rule if your package has binaries to ensure that the binaries are
16 # built with the exact set of dependencies and those are up to date.
17 update-types:
18 - "version-update:semver-patch"
19 - "version-update:semver-minor"
diff --git a/.github/workflows/cargo-vet-pr-comment.yml b/.github/workflows/cargo-vet-pr-comment.yml
new file mode 100644
index 000000000..dd8ef37a6
--- /dev/null
+++ b/.github/workflows/cargo-vet-pr-comment.yml
@@ -0,0 +1,137 @@
1# This workflow triggers after cargo-vet workflow has run.
2# It adds a comment to the PR with the results of the cargo vet run.
3# It first adds a comment if the cargo vet run fails,
4# and updates the comment if the cargo vet run succeeds after having failed at least once.
5
6name: Cargo vet PR comment
7
8on:
9 workflow_run:
10 workflows: [cargo-vet]
11 types:
12 - completed
13
14permissions:
15 contents: read
16 pull-requests: write
17
18concurrency:
19 group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
20 cancel-in-progress: true
21
22jobs:
23
24 find-pr-comment:
25 # This job runs when the cargo-vet job fails or succeeds
26 # It will download the artifact from the failed job and post a comment on the PR
27 runs-on: ubuntu-latest
28 outputs:
29 comment-id: ${{ steps.get-comment-id.outputs.comment-id }}
30 pr-number: ${{ steps.get-pr-number.outputs.pr_number }}
31 if: github.event.workflow_run.event == 'pull_request'
32 steps:
33 - name: 'Download artifact'
34 uses: actions/download-artifact@v4
35 with:
36 github-token: ${{ secrets.GITHUB_TOKEN }}
37 name: pr
38 path: pr/
39 run-id: ${{ github.event.workflow_run.id }}
40
41 - name: 'Get PR number'
42 id: get-pr-number
43 run: echo "pr_number=$(cat ./pr/NR)" >> $GITHUB_OUTPUT
44
45 - name: 'Find existing comment'
46 id: find-comment
47 uses: peter-evans/find-comment@v3
48 with:
49 issue-number: ${{ steps.get-pr-number.outputs.pr_number }}
50 comment-author: 'github-actions[bot]'
51 body-includes: 'comment-tag: [cargo-vet]'
52
53 - name: 'Get comment ID'
54 id: get-comment-id
55 if: ${{ steps.find-comment.outputs.comment-id != '' }}
56 run: echo "comment-id=${{ steps.find-comment.outputs.comment-id }}" >> $GITHUB_OUTPUT
57
58 post-comment-failure:
59 # This job runs when the cargo-vet job fails
60 # It will download the artifact from the failed job and post a comment on the PR
61 runs-on: ubuntu-latest
62 needs: find-pr-comment
63 if: github.event.workflow_run.conclusion == 'failure'
64 steps:
65 - name: 'Comment on PR - Failure'
66 uses: peter-evans/create-or-update-comment@v4
67 with:
68 comment-id: ${{ needs.find-pr-comment.outputs.comment-id }}
69 issue-number: ${{ needs.find-pr-comment.outputs.pr-number }}
70 body: |
71 # Cargo Vet Audit Failed
72
73 `cargo vet` has failed in this PR. Please run `cargo vet --locked` locally to check for new or updated unvetted dependencies.
74 Details about the vetting process can be found in [supply-chain/README.md](../blob/main/supply-chain/README.md)
75
76 ## If the unvetted dependencies are not needed
77 Please modify Cargo.toml file to avoid including the dependencies.
78
79 ## If the unvetted dependencies are needed
80 Post a new comment with the questionnaire below to the PR to help the auditors vet the dependencies.
81 After the auditors have vetted the dependencies, the PR will need to be rebased to pick up the new audits and pass this check.
82
83 ### Copy and paste the questionnaire as a new comment and provide your answers:
84
85 **1. What crates (with version) need to be audited?**
86
87 **2. How many of the crates are version updates vs new dependencies?**
88
89 **3. To confirm none of the already included crates serve your needs, please provide a brief description of the purpose of the new crates.**
90
91 **4. Any extra notes to the auditors to help with their audits.**
92
93 <!--
94 This comment is auto-generated by the cargo-vet workflow.
95 Please do not edit it directly.
96
97 comment-tag: [cargo-vet]
98 -->
99 edit-mode: replace
100
101 - name: 'Label PR'
102 uses: actions/github-script@v7
103 with:
104 script: |
105 github.rest.issues.addLabels({
106 issue_number: ${{ needs.find-pr-comment.outputs.pr-number }},
107 owner: context.repo.owner,
108 repo: context.repo.repo,
109 labels: ['cargo vet']
110 })
111
112 post-comment-success:
113 # This job runs when the cargo-vet job succeeds
114 # It will update the comment on the PR with a success message
115 runs-on: ubuntu-latest
116 needs: find-pr-comment
117 if: github.event.workflow_run.conclusion == 'success'
118 steps:
119 - name: 'Comment on PR - Success'
120 # Only update the comment if it exists
121 # This is to avoid creating a new comment if the cargo-vet job has never failed before
122 if: ${{ needs.find-pr-comment.outputs.comment-id }}
123 uses: peter-evans/create-or-update-comment@v4
124 with:
125 comment-id: ${{ needs.find-pr-comment.outputs.comment-id }}
126 issue-number: ${{ needs.find-pr-comment.outputs.pr-number }}
127 body: |
128 # Cargo Vet Audit Passed
129 `cargo vet` has passed in this PR. No new unvetted dependencies were found.
130
131 <!--
132 This comment is auto-generated by the cargo-vet workflow.
133 Please do not edit it directly.
134
135 comment-tag: [cargo-vet]
136 -->
137 edit-mode: replace \ No newline at end of file
diff --git a/.github/workflows/cargo-vet.yml b/.github/workflows/cargo-vet.yml
new file mode 100644
index 000000000..864c138e9
--- /dev/null
+++ b/.github/workflows/cargo-vet.yml
@@ -0,0 +1,53 @@
1# This workflow runs whenever a PR is opened or updated. It runs cargo vet to check for unvetted dependencies in the Cargo.lock file.
2permissions:
3 contents: read
4on:
5 pull_request:
6
7concurrency:
8 group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
9 cancel-in-progress: true
10
11name: cargo-vet
12jobs:
13 vet:
14 # cargo-vet checks for unvetted dependencies in the Cargo.lock file
15 # This is to ensure that new dependencies are vetted before they are added to the project
16 name: vet-dependencies
17 runs-on: ubuntu-latest
18 env:
19 CARGO_VET_VERSION: 0.10.1
20
21 steps:
22 - uses: actions/checkout@v4
23 with:
24 submodules: true
25
26 - uses: actions/cache@v4
27 with:
28 path: ${{ runner.tool_cache }}/cargo-vet
29 key: cargo-vet-bin-${{ env.CARGO_VET_VERSION }}
30
31 - name: Add the tool cache directory to the search path
32 run: echo "${{ runner.tool_cache }}/cargo-vet/bin" >> $GITHUB_PATH
33
34 - name: Ensure that the tool cache is populated with the cargo-vet binary
35 run: cargo install --root ${{ runner.tool_cache }}/cargo-vet --version ${{ env.CARGO_VET_VERSION }} cargo-vet
36
37 - name: Invoke cargo-vet
38 run: cargo vet --locked
39
40 - name: Save PR number
41 # PR number is saved as an artifact so it can be used to determine the PR to comment on by the vet-pr-comment workflow
42 # vet-pr-comment workflow is triggered by the workflow_run event so it runs in the context of the base branch and not the PR branch
43 if: ${{ failure() }} || ${{ success() }}
44 run: |
45 mkdir -p ./pr
46 echo ${{ github.event.number }} > ./pr/NR
47 - uses: actions/upload-artifact@v4
48 # Need to upload the artifact in both success and failure cases so comment can be updated in either case
49 if: ${{ failure() }} || ${{ success() }}
50 with:
51 name: pr
52 path: pr/
53 overwrite: true \ No newline at end of file
diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml
new file mode 100644
index 000000000..1a09a1492
--- /dev/null
+++ b/.github/workflows/check.yml
@@ -0,0 +1,205 @@
1# This workflow runs whenever a PR is opened or updated, or a commit is pushed to main. It runs
2# several checks:
3# - fmt: checks that the code is formatted according to rustfmt
4# - clippy: checks that the code does not contain any clippy warnings
5# - doc: checks that the code can be documented without errors
6# - hack: check combinations of feature flags
7# - msrv: check that the msrv specified in the crate is correct
8permissions:
9 contents: read
10
11# This configuration allows maintainers of this repo to create a branch and pull request based on
12# the new branch. Restricting the push trigger to the main branch ensures that the PR only gets
13# built once.
14on:
15
16 push:
17 branches: [main, main-nextgen]
18 pull_request:
19
20# If new code is pushed to a PR branch, then cancel in progress workflows for that PR. Ensures that
21# we don't waste CI time, and returns results quicker https://github.com/jonhoo/rust-ci-conf/pull/5
22concurrency:
23 group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
24 cancel-in-progress: true
25
26name: check
27
28jobs:
29
30 fmt:
31 runs-on: ubuntu-latest
32 name: nightly / fmt
33
34 strategy:
35 fail-fast: false
36 matrix:
37 workdir: [ ".", "examples/rt633", "examples/rt685s-evk",]
38
39 steps:
40 - uses: actions/checkout@v4
41 with:
42 submodules: true
43
44 - name: Install nightly
45 uses: dtolnay/rust-toolchain@nightly
46 with:
47 components: rustfmt
48
49 - name: cargo fmt --check
50 run: cargo fmt --check
51 working-directory: ${{ matrix.workdir }}
52
53 clippy-examples:
54 runs-on: ubuntu-latest
55 name: ${{ matrix.toolchain }} / clippy
56
57 permissions:
58 contents: read
59 checks: write
60
61 strategy:
62 fail-fast: false
63 matrix:
64 # Get early warning of new lints which are regularly introduced in beta channels.
65 toolchain: [stable]
66 workdir: ["examples"]
67
68 steps:
69 - uses: actions/checkout@v4
70 with:
71 submodules: true
72
73 - name: Install ${{ matrix.toolchain }}
74 uses: dtolnay/rust-toolchain@master
75 with:
76 toolchain: ${{ matrix.toolchain }}
77 components: clippy
78
79 - name: cargo clippy
80 working-directory: ${{ matrix.workdir }}
81 run: |
82 cargo clippy --locked -- -Dwarnings -D clippy::suspicious -D clippy::correctness -D clippy::perf -D clippy::style
83
84 # Enable once we have a released crate
85 # semver:
86 # runs-on: ubuntu-latest
87 # name: semver
88 # steps:
89 # - uses: actions/checkout@v4
90 # with:
91 # submodules: true
92 # - name: Install stable
93 # uses: dtolnay/rust-toolchain@stable
94 # with:
95 # components: rustfmt
96 # - name: cargo-semver-checks
97 # uses: obi1kenobi/cargo-semver-checks-action@v2
98
99 doc:
100 # run docs generation on nightly rather than stable. This enables features like
101 # https://doc.rust-lang.org/beta/unstable-book/language-features/doc-cfg.html which allows an
102 # API be documented as only available in some specific platforms.
103 runs-on: ubuntu-latest
104 name: nightly / doc
105
106 steps:
107 - uses: actions/checkout@v4
108 with:
109 submodules: true
110
111 - name: Install nightly
112 uses: dtolnay/rust-toolchain@nightly
113
114 - name: cargo doc
115 run: |
116 cargo doc --no-deps --all-features --locked
117 env:
118 RUSTDOCFLAGS: --cfg docsrs
119
120 hack:
121 # cargo-hack checks combinations of feature flags to ensure that features are all additive
122 # which is required for feature unification
123 runs-on: ubuntu-latest
124 name: ubuntu / stable / features
125
126 strategy:
127 fail-fast: false
128
129 steps:
130 - uses: actions/checkout@v4
131 with:
132 submodules: true
133
134 - name: Install stable
135 uses: dtolnay/rust-toolchain@stable
136 with:
137 toolchain: stable
138 components: clippy
139
140 - name: rustup target add thumbv8m.main-none-eabihf
141 run: rustup target add thumbv8m.main-none-eabihf
142
143 - name: cargo hack
144 run: cargo hack --feature-powerset check
145
146 deny:
147 # cargo-deny checks licenses, advisories, sources, and bans for
148 # our dependencies.
149 runs-on: ubuntu-latest
150 name: ubuntu / stable / deny
151
152 steps:
153 - uses: actions/checkout@v4
154 with:
155 submodules: true
156
157 - name: Install stable
158 uses: dtolnay/rust-toolchain@stable
159
160 - name: cargo install cargo-deny
161 uses: EmbarkStudios/cargo-deny-action@v2
162 with:
163 log-level: warn
164 manifest-path: ./Cargo.toml
165 command: check
166 arguments: --all-features --locked
167
168 msrv:
169 # check that we can build using the minimal rust version that is specified by this crate
170 runs-on: ubuntu-latest
171 # we use a matrix here just because env can't be used in job names
172 # https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability
173 strategy:
174 fail-fast: false
175 matrix:
176 msrv: ["1.90"] # We're relying on namespaced-features, which
177 # was released in 1.60
178 #
179 # We also depend on `fixed' which requires rust
180 # 1.71
181 #
182 # Additionally, we depend on embedded-hal-async
183 # which requires 1.75
184 #
185 # embassy-time requires 1.79 due to
186 # collapse_debuginfo
187 #
188 # embassy upstream switched to rust 1.85
189 #
190 # unsigned_is_multiple_of requires 1.90, else we get clippy warnings
191
192 name: ubuntu / ${{ matrix.msrv }}
193 steps:
194 - uses: actions/checkout@v4
195 with:
196 submodules: true
197
198 - name: Install ${{ matrix.msrv }}
199 uses: dtolnay/rust-toolchain@master
200 with:
201 toolchain: ${{ matrix.msrv }}
202
203 - name: cargo +${{ matrix.msrv }} check
204 run: |
205 cargo check --all-features --locked
diff --git a/.github/workflows/nostd.yml b/.github/workflows/nostd.yml
new file mode 100644
index 000000000..92460bd0f
--- /dev/null
+++ b/.github/workflows/nostd.yml
@@ -0,0 +1,43 @@
1# This workflow checks whether the library is able to run without the std library (e.g., embedded).
2# This entire file should be removed if this crate does not support no-std. See check.yml for
3# information about how the concurrency cancellation and workflow triggering works
4permissions:
5 contents: read
6
7on:
8 push:
9 branches: [main, main-nextgen]
10 pull_request:
11
12concurrency:
13 group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
14 cancel-in-progress: true
15
16name: no-std
17
18jobs:
19 nostd:
20 runs-on: ubuntu-latest
21 name: ${{ matrix.target }}
22
23 strategy:
24 matrix:
25 target: [thumbv8m.main-none-eabihf]
26
27 steps:
28 - uses: actions/checkout@v4
29 with:
30 submodules: true
31
32 - name: Install stable
33 uses: dtolnay/rust-toolchain@stable
34
35 - name: rustup target add ${{ matrix.target }}
36 run: rustup target add ${{ matrix.target }}
37
38 - name: Show variable
39 run: echo ${{ env.TOKEN }}
40
41 - name: cargo check
42 run: |
43 cargo check --target ${{ matrix.target }} --all-features --locked
diff --git a/.github/workflows/rolling.yml b/.github/workflows/rolling.yml
new file mode 100644
index 000000000..f572954f9
--- /dev/null
+++ b/.github/workflows/rolling.yml
@@ -0,0 +1,68 @@
1# This workflow runs every morning at midnight. It will run cargo hack
2# and a build with msrv. If any dependency breaks our crate, we will
3# know ASAP.
4#
5# - check: build with all features
6# - msrv: check that the msrv specified in the crate is correct
7permissions:
8 contents: read
9
10on:
11 schedule:
12 - cron: '0 0 * * *'
13
14name: rolling
15jobs:
16
17 check:
18 runs-on: ubuntu-latest
19 name: ubuntu / stable / features
20 strategy:
21 fail-fast: false
22 steps:
23 - uses: actions/checkout@v4
24 with:
25 submodules: true
26 - name: Install stable
27 uses: dtolnay/rust-toolchain@stable
28 - name: cargo install cargo-hack
29 uses: taiki-e/install-action@cargo-hack
30 - name: cargo check
31 run: |
32 cargo update
33 cargo check --all-features check
34
35 msrv:
36 runs-on: ubuntu-latest
37 strategy:
38 fail-fast: false
39 matrix:
40 msrv: ["1.85"] # We're relying on namespaced-features, which
41 # was released in 1.60
42 #
43 # We also depend on `fixed' which requires rust
44 # 1.71
45 #
46 # Additionally, we depend on embedded-hal-async
47 # which requires 1.75
48 #
49 # embassy-time requires 1.79 due to
50 # collapse_debuginfo
51 #
52 # embassy upstream switched to rust 1.83
53 #
54 # embedded-services (storage bus) dependency
55 # requires 1.85
56 name: ubuntu / ${{ matrix.msrv }} (${{ matrix.commit }})
57 steps:
58 - uses: actions/checkout@v4
59 with:
60 submodules: true
61 - name: Install ${{ matrix.msrv }}
62 uses: dtolnay/rust-toolchain@master
63 with:
64 toolchain: ${{ matrix.msrv }}
65 - name: cargo +${{ matrix.msrv }} check
66 run: |
67 cargo update
68 cargo check --all-features check
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 000000000..54a673e04
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,132 @@
1# Contributor Covenant Code of Conduct
2
3## Our Pledge
4
5We as members, contributors, and leaders pledge to make participation in our
6community a harassment-free experience for everyone, regardless of age, body
7size, visible or invisible disability, ethnicity, sex characteristics, gender
8identity and expression, level of experience, education, socio-economic status,
9nationality, personal appearance, race, caste, color, religion, or sexual
10identity and orientation.
11
12We pledge to act and interact in ways that contribute to an open, welcoming,
13diverse, inclusive, and healthy community.
14
15## Our Standards
16
17Examples of behavior that contributes to a positive environment for our
18community include:
19
20* Demonstrating empathy and kindness toward other people
21* Being respectful of differing opinions, viewpoints, and experiences
22* Giving and gracefully accepting constructive feedback
23* Accepting responsibility and apologizing to those affected by our mistakes,
24 and learning from the experience
25* Focusing on what is best not just for us as individuals, but for the overall
26 community
27
28Examples of unacceptable behavior include:
29
30* The use of sexualized language or imagery, and sexual attention or advances of
31 any kind
32* Trolling, insulting or derogatory comments, and personal or political attacks
33* Public or private harassment
34* Publishing others' private information, such as a physical or email address,
35 without their explicit permission
36* Other conduct which could reasonably be considered inappropriate in a
37 professional setting
38
39## Enforcement Responsibilities
40
41Community leaders are responsible for clarifying and enforcing our standards of
42acceptable behavior and will take appropriate and fair corrective action in
43response to any behavior that they deem inappropriate, threatening, offensive,
44or harmful.
45
46Community leaders have the right and responsibility to remove, edit, or reject
47comments, commits, code, wiki edits, issues, and other contributions that are
48not aligned to this Code of Conduct, and will communicate reasons for moderation
49decisions when appropriate.
50
51## Scope
52
53This Code of Conduct applies within all community spaces, and also applies when
54an individual is officially representing the community in public spaces.
55Examples of representing our community include using an official e-mail address,
56posting via an official social media account, or acting as an appointed
57representative at an online or offline event.
58
59## Enforcement
60
61Instances of abusive, harassing, or otherwise unacceptable behavior may be
62reported to the community leaders responsible for enforcement at
63[email protected].
64All complaints will be reviewed and investigated promptly and fairly.
65
66All community leaders are obligated to respect the privacy and security of the
67reporter of any incident.
68
69## Enforcement Guidelines
70
71Community leaders will follow these Community Impact Guidelines in determining
72the consequences for any action they deem in violation of this Code of Conduct:
73
74### 1. Correction
75
76**Community Impact**: Use of inappropriate language or other behavior deemed
77unprofessional or unwelcome in the community.
78
79**Consequence**: A private, written warning from community leaders, providing
80clarity around the nature of the violation and an explanation of why the
81behavior was inappropriate. A public apology may be requested.
82
83### 2. Warning
84
85**Community Impact**: A violation through a single incident or series of
86actions.
87
88**Consequence**: A warning with consequences for continued behavior. No
89interaction with the people involved, including unsolicited interaction with
90those enforcing the Code of Conduct, for a specified period of time. This
91includes avoiding interactions in community spaces as well as external channels
92like social media. Violating these terms may lead to a temporary or permanent
93ban.
94
95### 3. Temporary Ban
96
97**Community Impact**: A serious violation of community standards, including
98sustained inappropriate behavior.
99
100**Consequence**: A temporary ban from any sort of interaction or public
101communication with the community for a specified period of time. No public or
102private interaction with the people involved, including unsolicited interaction
103with those enforcing the Code of Conduct, is allowed during this period.
104Violating these terms may lead to a permanent ban.
105
106### 4. Permanent Ban
107
108**Community Impact**: Demonstrating a pattern of violation of community
109standards, including sustained inappropriate behavior, harassment of an
110individual, or aggression toward or disparagement of classes of individuals.
111
112**Consequence**: A permanent ban from any sort of public interaction within the
113community.
114
115## Attribution
116
117This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118version 2.1, available at
119[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
121Community Impact Guidelines were inspired by
122[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123
124For answers to common questions about this code of conduct, see the FAQ at
125[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126[https://www.contributor-covenant.org/translations][translations].
127
128[homepage]: https://www.contributor-covenant.org
129[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130[Mozilla CoC]: https://github.com/mozilla/diversity
131[FAQ]: https://www.contributor-covenant.org/faq
132[translations]: https://www.contributor-covenant.org/translations
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 000000000..7c8289a58
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,48 @@
1# Contributing to Open Device Partnership
2
3The Open Device Partnership project welcomes your suggestions and contributions! Before opening your first issue or pull request, please review our
4[Code of Conduct](CODE_OF_CONDUCT.md) to understand how our community interacts in an inclusive and respectful manner.
5
6## Contribution Licensing
7
8Most of our code is distributed under the terms of the [MIT license](LICENSE), and when you contribute code that you wrote to our repositories,
9you agree that you are contributing under those same terms. In addition, by submitting your contributions you are indicating that
10you have the right to submit those contributions under those terms.
11
12## Other Contribution Information
13
14If you wish to contribute code or documentation authored by others, or using the terms of any other license, please indicate that clearly in your
15pull request so that the project team can discuss the situation with you.
16
17# Contribution Guideline
18
19* For any new HAL driver added, please add corresponding test in the examples
20* Format the code with `cargo fmt`. Or better yet, enable format on save in your IDE for rust source files.
21* Use meaningful commit messages. See [this blogpost](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
22
23# PR Etiquette
24
25* Create a draft PR first
26* Make sure that your branch has `.github` folder and all the code linting/sanity check workflows are passing in your draft PR before sending it out to code reviewers.
27
28# Careful Use of `Unsafe`
29
30Working with embedded, using of `unsafe` is a necessity. However, please wrap unsafe code with safe interfaces to prevent `unsafe` keyword being sprinkled everywhere.
31
32# RFC Draft PR
33
34If you want feedback on your design or HAL driver early, please create a draft PR with title prefix `RFC:`.
35
36# Branch Naming Scheme
37
38For now, we're not using forks. Eventually a personal fork will be required for any PRs to limit the amount of people with merge access to the main branch. Until that happens, please use meaningful branch names like this `user_alias/feature` and avoid sending PRs from branches containing prefixes such as "wip", "test", etc. Prior to sending a PR, please rename the branch.
39
40# Clean Commit History
41
42We disabled squashing of commit and would like to maintain a clean commit history. So please reorganize your commits with the following items:
43 * Each commit builds successfully without warning from `rustc` or `clippy`
44 * Miscellaneous commits to fix typos + formatting are squashed
45
46# Regressions
47
48When reporting a regression, please ensure that you use `git bisect` to find the first offending commit, as that will help us finding the culprit a lot faster.
diff --git a/License.txt b/LICENSE
index 479657c89..479657c89 100644
--- a/License.txt
+++ b/LICENSE
diff --git a/README.txt b/README.md
index ae80ca8ef..8a93b5f4a 100644
--- a/README.txt
+++ b/README.md
@@ -1,6 +1,8 @@
1# Embassy MCXA276 HAL 1# Embassy MCXA276 HAL
2 2
3A Hardware Abstraction Layer (HAL) for the NXP MCXA276 microcontroller using the Embassy async framework. This HAL provides safe, idiomatic Rust interfaces for GPIO, UART, and OSTIMER peripherals. 3A Hardware Abstraction Layer (HAL) for the NXP MCXA276 microcontroller
4using the Embassy async framework. This HAL provides safe, idiomatic
5Rust interfaces for GPIO, UART, and OSTIMER peripherals.
4 6
5## Prerequisites 7## Prerequisites
6 8
@@ -36,8 +38,6 @@ cargo install probe-rs --features cli
36- Install a serial terminal (e.g., Tera Term): https://ttssh2.osdn.jp/ 38- Install a serial terminal (e.g., Tera Term): https://ttssh2.osdn.jp/
37- USB drivers: Windows 10/11 usually picks up the board as a USB CDC device automatically (COM port) 39- USB drivers: Windows 10/11 usually picks up the board as a USB CDC device automatically (COM port)
38 40
39
40
41### Hardware Requirements 41### Hardware Requirements
42 42
43- NXP FRDM-MCXA276 development board 43- NXP FRDM-MCXA276 development board
@@ -108,10 +108,12 @@ PROBE=1fc9:0143:H3AYDQVQMTROB cargo run --features "lpuart2 ostimer0" --example
108# RTC example 108# RTC example
109PROBE=1fc9:0143:H3AYDQVQMTROB cargo run --features "lpuart2 rtc0" --example rtc_alarm 109PROBE=1fc9:0143:H3AYDQVQMTROB cargo run --features "lpuart2 rtc0" --example rtc_alarm
110``` 110```
111
111**Note:** All examples run from RAM, not flash memory. They are loaded directly into RAM for faster development iteration. 112**Note:** All examples run from RAM, not flash memory. They are loaded directly into RAM for faster development iteration.
112 113
113**Important:** After pressing the RESET button on the board, the first `cargo run` attempt may fail with a connection error. This is expected - simply run the command again and it will work. The run.sh script now properly sets the Vector Table Offset Register (VTOR) to point to the RAM-based vector table, ensuring the correct stack pointer and reset vector are used. 114**Important:** After pressing the RESET button on the board, the first `cargo run` attempt may fail with a connection error. This is expected - simply run the command again and it will work. The run.sh script now properly sets the Vector Table Offset Register (VTOR) to point to the RAM-based vector table, ensuring the correct stack pointer and reset vector are used.
114 115
116```console
115smw016108@smw016108:~/Downloads/nxp/rust/uart/embassy-mcxa276$ PROBE=1fc9:0143:H3AYDQVQMTROB cargo run --release --features "gpio ostimer0" --example blink 117smw016108@smw016108:~/Downloads/nxp/rust/uart/embassy-mcxa276$ PROBE=1fc9:0143:H3AYDQVQMTROB cargo run --release --features "gpio ostimer0" --example blink
116 Finished `release` profile [optimized + debuginfo] target(s) in 0.07s 118 Finished `release` profile [optimized + debuginfo] target(s) in 0.07s
117 Running `/home/smw016108/Downloads/nxp/rust/uart/embassy-mcxa276/./run.sh target/thumbv8m.main-none-eabihf/release/examples/blink` 119 Running `/home/smw016108/Downloads/nxp/rust/uart/embassy-mcxa276/./run.sh target/thumbv8m.main-none-eabihf/release/examples/blink`
@@ -128,6 +130,7 @@ probe-rs gdb server failed to connect to target. Log:
128smw016108@smw016108:~/Downloads/nxp/rust/uart/embassy-mcxa276$ PROBE=1fc9:0143:H3AYDQVQMTROB cargo run --release --features "gpio ostimer0" --example blink 130smw016108@smw016108:~/Downloads/nxp/rust/uart/embassy-mcxa276$ PROBE=1fc9:0143:H3AYDQVQMTROB cargo run --release --features "gpio ostimer0" --example blink
129 Finished `release` profile [optimized + debuginfo] target(s) in 0.02s 131 Finished `release` profile [optimized + debuginfo] target(s) in 0.02s
130 Running `/home/smw016108/Downloads/nxp/rust/uart/embassy-mcxa276/./run.sh target/thumbv8m.main-none-eabihf/release/examples/blink` 132 Running `/home/smw016108/Downloads/nxp/rust/uart/embassy-mcxa276/./run.sh target/thumbv8m.main-none-eabihf/release/examples/blink`
133```
131 134
132### Additional UART Examples 135### Additional UART Examples
133 136
@@ -150,6 +153,7 @@ Configures ADC1 channel A8 (pin P1_10) and prints conversion values to UART2 per
150#### `adc_interrupt` 153#### `adc_interrupt`
151Triggers a conversion and signals completion via ADC1 interrupt, printing a notification on UART2. 154Triggers a conversion and signals completion via ADC1 interrupt, printing a notification on UART2.
152 155
156```console
1530x20002040 in ?? () 1570x20002040 in ?? ()
154Supported Commands: 158Supported Commands:
155 159
@@ -163,8 +167,11 @@ Loading section .Reset, size 0x58 lma 0x20000ba4
163Loading section .rodata, size 0x28 lma 0x20000bfc 167Loading section .rodata, size 0x28 lma 0x20000bfc
164Start address 0x20000ba4, load size 3106 168Start address 0x20000ba4, load size 3106
165Transfer rate: 13 KB/sec, 776 bytes/write. 169Transfer rate: 13 KB/sec, 776 bytes/write.
170```
166 171
167then I see the LED blinking. I press CTRL+C to exit. It will show me ^C 172then I see the LED blinking. I press CTRL+C to exit. It will show me ^C
173
174```console
168Program received signal SIGINT, Interrupt. 175Program received signal SIGINT, Interrupt.
1690x20000880 in embassy_executor::arch::thread::Executor::run<blink::__cortex_m_rt_main::{closure_env#0}> (self=0x200027e8, init=...) at /home/smw016108/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/embassy-executor-0.9.1/src/arch/cortex_m.rs:106 1760x20000880 in embassy_executor::arch::thread::Executor::run<blink::__cortex_m_rt_main::{closure_env#0}> (self=0x200027e8, init=...) at /home/smw016108/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/embassy-executor-0.9.1/src/arch/cortex_m.rs:106
170106 asm!("wfe"); 177106 asm!("wfe");
@@ -204,8 +211,11 @@ Loading section .Reset, size 0x58 lma 0x2000244c
204Loading section .rodata, size 0x6dc lma 0x200024a4 211Loading section .rodata, size 0x6dc lma 0x200024a4
205Start address 0x2000244c, load size 11134 212Start address 0x2000244c, load size 11134
206Transfer rate: 16 KB/sec, 1855 bytes/write. 213Transfer rate: 16 KB/sec, 1855 bytes/write.
214```
207 215
208I can see in the console 216I can see in the console
217
218```console
209OSTIMER Alarm Example 219OSTIMER Alarm Example
210Scheduling alarm for 2 seconds... 220Scheduling alarm for 2 seconds...
211Alarm scheduled successfully 221Alarm scheduled successfully
@@ -215,9 +225,11 @@ Alarm scheduled. Waiting 1 second then canceling...
215Alarm canceled 225Alarm canceled
216Alarm was successfully canceled 226Alarm was successfully canceled
217Example complete 227Example complete
228```
218 229
219then I press CTRL+C to stop running 230then I press CTRL+C to stop running
220 231
232```console
221^C 233^C
222Program received signal SIGINT, Interrupt. 234Program received signal SIGINT, Interrupt.
2230x20000e64 in embassy_executor::arch::thread::Executor::run<ostimer_alarm::__cortex_m_rt_main::{closure_env#0}> (self=0x200027e8, init=...) at /home/smw016108/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/embassy-executor-0.9.1/src/arch/cortex_m.rs:106 2350x20000e64 in embassy_executor::arch::thread::Executor::run<ostimer_alarm::__cortex_m_rt_main::{closure_env#0}> (self=0x200027e8, init=...) at /home/smw016108/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/embassy-executor-0.9.1/src/arch/cortex_m.rs:106
@@ -225,7 +237,7 @@ Program received signal SIGINT, Interrupt.
225[Inferior 1 (process 1) detached] 237[Inferior 1 (process 1) detached]
226Program loaded and started (no reset) 238Program loaded and started (no reset)
227smw016108@smw016108:~/Downloads/nxp/rust/uart/embassy-mcxa276$ 239smw016108@smw016108:~/Downloads/nxp/rust/uart/embassy-mcxa276$
228 240```
229 241
230### Windows: Running examples (RAM, no RTT/defmt) 242### Windows: Running examples (RAM, no RTT/defmt)
231 243
@@ -233,22 +245,27 @@ Important: On Windows, do not use `cargo run` because `.cargo/config.toml` sets
233 245
2341) Find your probe and COM port 2461) Find your probe and COM port
235- List probes: 247- List probes:
236 ```powershell 248
249 ```console
237 probe-rs list 250 probe-rs list
238 ``` 251 ```
239- If multiple probes are attached, set the specific one (replace with your ID): 252- If multiple probes are attached, set the specific one (replace with your ID):
240 ```powershell 253
254 ```console
241 $env:PROBE_RS_PROBE = "1366:0101:000600110607" 255 $env:PROBE_RS_PROBE = "1366:0101:000600110607"
242 ``` 256 ```
257
243- Check Windows Device Manager → Ports (COM & LPT) for the board’s COM port. 258- Check Windows Device Manager → Ports (COM & LPT) for the board’s COM port.
244 259
2452) Build the example 2602) Build the example
246```powershell 261
262```console
247cargo build --example hello --features "lpuart2" 263cargo build --example hello --features "lpuart2"
248``` 264```
249 265
2503) Run from RAM with probe-rs 2663) Run from RAM with probe-rs
251```powershell 267
268```console
252probe-rs run --chip MCXA276 --protocol swd --speed 1000 target/thumbv8m.main-none-eabihf/debug/examples/hello 269probe-rs run --chip MCXA276 --protocol swd --speed 1000 target/thumbv8m.main-none-eabihf/debug/examples/hello
253``` 270```
254You will see a short probe-rs warning like "unknown variant, try to set watch point"; it’s harmless. 271You will see a short probe-rs warning like "unknown variant, try to set watch point"; it’s harmless.
@@ -268,8 +285,9 @@ Notes
268- If the first attempt after a reset fails to connect, just run the command again. 285- If the first attempt after a reset fails to connect, just run the command again.
269- UART2 pins: TX=P2_2, RX=P2_3 (ALT3), 115200 8N1. 286- UART2 pins: TX=P2_2, RX=P2_3 (ALT3), 115200 8N1.
270 287
271Quick commands for other examples (PowerShell) 288Quick commands for other examples:
272```powershell 289
290```console
273# Build 291# Build
274cargo build --example blink --features "gpio ostimer0" 292cargo build --example blink --features "gpio ostimer0"
275cargo build --example lpuart_polling --features "lpuart2 ostimer0" 293cargo build --example lpuart_polling --features "lpuart2 ostimer0"
@@ -303,7 +321,7 @@ How I tested on Windows
303 321
304To build without running: 322To build without running:
305 323
306```bash 324```console
307cargo build --features "gpio ostimer0" --example blink 325cargo build --features "gpio ostimer0" --example blink
308cargo build --features "lpuart2 ostimer0" --example hello 326cargo build --features "lpuart2 ostimer0" --example hello
309cargo build --features "lpuart2 ostimer0" --example ostimer_alarm 327cargo build --features "lpuart2 ostimer0" --example ostimer_alarm
@@ -311,7 +329,6 @@ cargo build --features "lpuart2 rtc0" --example rtc_alarm
311# etc. 329# etc.
312``` 330```
313 331
314
315## Development Notes 332## Development Notes
316 333
317### Critical Fix: MCXA276 Interrupt Vector Table 334### Critical Fix: MCXA276 Interrupt Vector Table
@@ -340,7 +357,6 @@ Update (SVD 25.06.00, mcxa-pac a9dd33): No manual PAC edits are required anymore
340 357
341Using `#[inline(always)]` can cause the Rust compiler to generate incorrect assembly, leading to register corruption or unexpected behavior. For example, in tight polling loops like those in the OSTIMER driver, this attribute may result in invalid instructions that zero registers (e.g., `movs r1, r0` causing r1=0), triggering hardfaults. 358Using `#[inline(always)]` can cause the Rust compiler to generate incorrect assembly, leading to register corruption or unexpected behavior. For example, in tight polling loops like those in the OSTIMER driver, this attribute may result in invalid instructions that zero registers (e.g., `movs r1, r0` causing r1=0), triggering hardfaults.
342 359
343
344## License 360## License
345 361
346This project is licensed under MIT OR Apache-2.0. \ No newline at end of file 362This project is licensed under MIT OR Apache-2.0.
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 000000000..5357b8824
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,66 @@
1# Vulnerability Disclosure and Embargo Policy
2
3The Open Device Partnership project welcomes the responsible disclosure of vulnerabilities.
4
5## Initial Contact
6
7All security bugs in Open Device Partnership should be reported to the security team.
8To do so, please reach out in the form of a
9[Github Security Advisory](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities).
10
11You will be invited to join this private area to discuss specifics. Doing so
12allows us to start with a high level of confidentiality and relax it if the
13issue is less critical, moving to work on the fix in the open.
14
15Your initial contact will be acknowledged within 48 hours, and you’ll receive
16a more detailed response within 96 hours indicating the next steps in handling
17your report.
18
19After the initial reply to your report, the security team will endeavor to
20keep you informed of the progress being made towards a fix and full
21announcement. As recommended by
22[RFPolicy](https://dl.packetstormsecurity.net/papers/general/rfpolicy-2.0.txt),
23these updates will be sent at least every five working days.
24
25## Disclosure Policy
26
27The Open Device Partnership project has a 5 step disclosure process.
28
291. Contact is established, a private channel created, and the security report
30 is received and is assigned a primary handler. This person will coordinate
31 the fix and release process.
322. The problem is confirmed and a list of all affected versions is determined.
33 If an embargo is needed (see below), details of the embargo are decided.
343. Code is audited to find any potential similar problems.
354. Fixes are prepared for all releases which are still under maintenance. In
36 case of embargo, these fixes are not committed to the public repository but
37 rather held in a private fork pending the announcement.
385. The changes are pushed to the public repository and new builds are deployed.
39
40This process can take some time, especially when coordination is required
41with maintainers of other projects. Every effort will be made to handle the bug
42in as timely a manner as possible, however it is important that we follow the
43release process above to ensure that the disclosure is handled in a consistent
44manner.
45
46## Embargoes
47
48While the Open Device Partnership project aims to follow the highest standards of
49transparency and openness, handling some security issues may pose such an
50immediate threat to various stakeholders and require coordination between
51various actors that it cannot be made immediately public.
52
53In this case, security issues will fall under an embargo.
54
55An embargo can be called for in various cases:
56
57- when disclosing the issue without simultaneously providing a mitigation
58 would seriously endanger users,
59- when producing a fix requires coordinating between multiple actors (such as
60 upstream or downstream/dependency projects), or simply
61- when proper analysis of the issue and its ramifications demands time.
62
63If we determine that an issue you report requires an embargo, we will discuss
64this with you and try to find a reasonable expiry date (aka “embargo
65completion date”), as well as who should be included in the list of
66need-to-know people.
diff --git a/deny.toml b/deny.toml
new file mode 100644
index 000000000..7097f2f55
--- /dev/null
+++ b/deny.toml
@@ -0,0 +1,241 @@
1# This template contains all of the possible sections and their default values
2
3# Note that all fields that take a lint level have these possible values:
4# * deny - An error will be produced and the check will fail
5# * warn - A warning will be produced, but the check will not fail
6# * allow - No warning or error will be produced, though in some cases a note
7# will be
8
9# The values provided in this template are the default values that will be used
10# when any section or field is not specified in your own configuration
11
12# Root options
13
14# The graph table configures how the dependency graph is constructed and thus
15# which crates the checks are performed against
16[graph]
17# If 1 or more target triples (and optionally, target_features) are specified,
18# only the specified targets will be checked when running `cargo deny check`.
19# This means, if a particular package is only ever used as a target specific
20# dependency, such as, for example, the `nix` crate only being used via the
21# `target_family = "unix"` configuration, that only having windows targets in
22# this list would mean the nix crate, as well as any of its exclusive
23# dependencies not shared by any other crates, would be ignored, as the target
24# list here is effectively saying which targets you are building for.
25targets = [
26 # The triple can be any string, but only the target triples built in to
27 # rustc (as of 1.40) can be checked against actual config expressions
28 #"x86_64-unknown-linux-musl",
29 # You can also specify which target_features you promise are enabled for a
30 # particular target. target_features are currently not validated against
31 # the actual valid features supported by the target architecture.
32 #{ triple = "wasm32-unknown-unknown", features = ["atomics"] },
33]
34# When creating the dependency graph used as the source of truth when checks are
35# executed, this field can be used to prune crates from the graph, removing them
36# from the view of cargo-deny. This is an extremely heavy hammer, as if a crate
37# is pruned from the graph, all of its dependencies will also be pruned unless
38# they are connected to another crate in the graph that hasn't been pruned,
39# so it should be used with care. The identifiers are [Package ID Specifications]
40# (https://doc.rust-lang.org/cargo/reference/pkgid-spec.html)
41#exclude = []
42# If true, metadata will be collected with `--all-features`. Note that this can't
43# be toggled off if true, if you want to conditionally enable `--all-features` it
44# is recommended to pass `--all-features` on the cmd line instead
45all-features = false
46# If true, metadata will be collected with `--no-default-features`. The same
47# caveat with `all-features` applies
48no-default-features = false
49# If set, these feature will be enabled when collecting metadata. If `--features`
50# is specified on the cmd line they will take precedence over this option.
51#features = []
52
53# The output table provides options for how/if diagnostics are outputted
54[output]
55# When outputting inclusion graphs in diagnostics that include features, this
56# option can be used to specify the depth at which feature edges will be added.
57# This option is included since the graphs can be quite large and the addition
58# of features from the crate(s) to all of the graph roots can be far too verbose.
59# This option can be overridden via `--feature-depth` on the cmd line
60feature-depth = 1
61
62# This section is considered when running `cargo deny check advisories`
63# More documentation for the advisories section can be found here:
64# https://embarkstudios.github.io/cargo-deny/checks/advisories/cfg.html
65[advisories]
66# The path where the advisory databases are cloned/fetched into
67#db-path = "$CARGO_HOME/advisory-dbs"
68# The url(s) of the advisory databases to use
69#db-urls = ["https://github.com/rustsec/advisory-db"]
70# A list of advisory IDs to ignore. Note that ignored advisories will still
71# output a note when they are encountered.
72ignore = [
73 #"RUSTSEC-0000-0000",
74 #{ id = "RUSTSEC-0000-0000", reason = "you can specify a reason the advisory is ignored" },
75 #"[email protected]", # you can also ignore yanked crate versions if you wish
76 #{ crate = "[email protected]", reason = "you can specify why you are ignoring the yanked crate" },
77 # { id = "RUSTSEC-2024-0370", reason = "proc-macro-error is unmaintained, no safe upgrade available, need upstream dependencies to migrate away from it." },
78 { id = "RUSTSEC-2024-0436", reason = "there are no suitable replacements for paste right now; paste has been archived as read-only. It only affects compile time concatenation in macros. We will allow it for now" },
79 # { id = "RUSTSEC-2023-0089", reason = "this is a deprecation warning for a dependency of a dependency. https://github.com/jamesmunns/postcard/issues/223 tracks fixing the dependency; until that's resolved, we can accept the deprecated code as it has no known vulnerabilities."}
80]
81# If this is true, then cargo deny will use the git executable to fetch advisory database.
82# If this is false, then it uses a built-in git library.
83# Setting this to true can be helpful if you have special authentication requirements that cargo-deny does not support.
84# See Git Authentication for more information about setting up git authentication.
85#git-fetch-with-cli = true
86
87# This section is considered when running `cargo deny check licenses`
88# More documentation for the licenses section can be found here:
89# https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html
90[licenses]
91# List of explicitly allowed licenses
92# See https://spdx.org/licenses/ for list of possible licenses
93# [possible values: any SPDX 3.11 short identifier (+ optional exception)].
94allow = [
95 "MIT",
96 "Apache-2.0",
97
98 # unicode-ident 1.0.14 switched from Unicode-DFS-2016 to Unicode-3.0 license.
99 "Unicode-3.0",
100 #"Apache-2.0 WITH LLVM-exception",
101]
102# The confidence threshold for detecting a license from license text.
103# The higher the value, the more closely the license text must be to the
104# canonical license text of a valid SPDX license file.
105# [possible values: any between 0.0 and 1.0].
106confidence-threshold = 0.8
107# Allow 1 or more licenses on a per-crate basis, so that particular licenses
108# aren't accepted for every possible crate as with the normal allow list
109exceptions = [
110 # Each entry is the crate and version constraint, and its specific allow
111 # list
112 #{ allow = ["Zlib"], crate = "adler32" },
113]
114
115# Some crates don't have (easily) machine readable licensing information,
116# adding a clarification entry for it allows you to manually specify the
117# licensing information
118#[[licenses.clarify]]
119# The package spec the clarification applies to
120#crate = "ring"
121# The SPDX expression for the license requirements of the crate
122#expression = "MIT AND ISC AND OpenSSL"
123# One or more files in the crate's source used as the "source of truth" for
124# the license expression. If the contents match, the clarification will be used
125# when running the license check, otherwise the clarification will be ignored
126# and the crate will be checked normally, which may produce warnings or errors
127# depending on the rest of your configuration
128#license-files = [
129# Each entry is a crate relative path, and the (opaque) hash of its contents
130#{ path = "LICENSE", hash = 0xbd0eed23 }
131#]
132
133[licenses.private]
134# If true, ignores workspace crates that aren't published, or are only
135# published to private registries.
136# To see how to mark a crate as unpublished (to the official registry),
137# visit https://doc.rust-lang.org/cargo/reference/manifest.html#the-publish-field.
138ignore = false
139# One or more private registries that you might publish crates to, if a crate
140# is only published to private registries, and ignore is true, the crate will
141# not have its license(s) checked
142registries = [
143 #"https://sekretz.com/registry
144]
145
146# This section is considered when running `cargo deny check bans`.
147# More documentation about the 'bans' section can be found here:
148# https://embarkstudios.github.io/cargo-deny/checks/bans/cfg.html
149[bans]
150# Lint level for when multiple versions of the same crate are detected
151multiple-versions = "warn"
152# Lint level for when a crate version requirement is `*`
153wildcards = "allow"
154# The graph highlighting used when creating dotgraphs for crates
155# with multiple versions
156# * lowest-version - The path to the lowest versioned duplicate is highlighted
157# * simplest-path - The path to the version with the fewest edges is highlighted
158# * all - Both lowest-version and simplest-path are used
159highlight = "all"
160# The default lint level for `default` features for crates that are members of
161# the workspace that is being checked. This can be overridden by allowing/denying
162# `default` on a crate-by-crate basis if desired.
163workspace-default-features = "allow"
164# The default lint level for `default` features for external crates that are not
165# members of the workspace. This can be overridden by allowing/denying `default`
166# on a crate-by-crate basis if desired.
167external-default-features = "allow"
168# List of crates that are allowed. Use with care!
169allow = [
170 #"[email protected]",
171 #{ crate = "[email protected]", reason = "you can specify a reason it is allowed" },
172]
173# List of crates to deny
174deny = [
175 #"[email protected]",
176 #{ crate = "[email protected]", reason = "you can specify a reason it is banned" },
177 # Wrapper crates can optionally be specified to allow the crate when it
178 # is a direct dependency of the otherwise banned crate
179 #{ crate = "[email protected]", wrappers = ["this-crate-directly-depends-on-ansi_term"] },
180]
181
182# List of features to allow/deny
183# Each entry the name of a crate and a version range. If version is
184# not specified, all versions will be matched.
185#[[bans.features]]
186#crate = "reqwest"
187# Features to not allow
188#deny = ["json"]
189# Features to allow
190#allow = [
191# "rustls",
192# "__rustls",
193# "__tls",
194# "hyper-rustls",
195# "rustls",
196# "rustls-pemfile",
197# "rustls-tls-webpki-roots",
198# "tokio-rustls",
199# "webpki-roots",
200#]
201# If true, the allowed features must exactly match the enabled feature set. If
202# this is set there is no point setting `deny`
203#exact = true
204
205# Certain crates/versions that will be skipped when doing duplicate detection.
206skip = [
207 #"[email protected]",
208 #{ crate = "[email protected]", reason = "you can specify a reason why it can't be updated/removed" },
209]
210# Similarly to `skip` allows you to skip certain crates during duplicate
211# detection. Unlike skip, it also includes the entire tree of transitive
212# dependencies starting at the specified crate, up to a certain depth, which is
213# by default infinite.
214skip-tree = [
215 #"[email protected]", # will be skipped along with _all_ of its direct and transitive dependencies
216 #{ crate = "[email protected]", depth = 20 },
217]
218
219# This section is considered when running `cargo deny check sources`.
220# More documentation about the 'sources' section can be found here:
221# https://embarkstudios.github.io/cargo-deny/checks/sources/cfg.html
222[sources]
223# Lint level for what to happen when a crate from a crate registry that is not
224# in the allow list is encountered
225unknown-registry = "warn"
226# Lint level for what to happen when a crate from a git repository that is not
227# in the allow list is encountered
228unknown-git = "warn"
229# List of URLs for allowed crate registries. Defaults to the crates.io index
230# if not specified. If it is specified but empty, no registries are allowed.
231allow-registry = ["https://github.com/rust-lang/crates.io-index"]
232# List of URLs for allowed Git repositories
233allow-git = []
234
235[sources.allow-org]
236# github.com organizations to allow git sources for
237github = ["OpenDevicePartnership"]
238# gitlab.com organizations to allow git sources for
239gitlab = []
240# bitbucket.org organizations to allow git sources for
241bitbucket = []
diff --git a/supply-chain/README.md b/supply-chain/README.md
new file mode 100644
index 000000000..12f8777b0
--- /dev/null
+++ b/supply-chain/README.md
@@ -0,0 +1,149 @@
1# Working with cargo vet
2
3## Introduction
4
5`cargo vet` is a tool to help ensure that third-party Rust dependencies have been audited by a trusted entity.
6It matches all dependencies against a set of audits conducted by the authors of the project or entities they trust.
7To learn more, visit [mozilla/cargo-vet](https://github.com/mozilla/cargo-vet)
8
9---
10
11## Adding a new dependency
12
13When updating or adding a new dependency, we need to ensure it's audited before being merged into main.
14For our repositories, we have designated experts who are responsible for vetting any new dependencies being added to their repository.
15_It is the shared responsibility of the developer creating the PR and the auditors to conduct a successful audit._
16Follow the process below to ensure compliance:
17
18### For Developers
191. **Respond to `cargo vet` failures**:
20 - If your PR fails the `cargo vet` step, the cargo-vet workflow will add a comment to the PR with a template questionnaire
21 - Copy the questionnaire, fill it out and paste it as a new comment on the PR. This greatly helps the auditors get some context of the changes requiring the new dependencies
22
232. **Engage with auditors**:
24 - Respond to any questions that the auditors might have regarding the need of any new dependencies
25
263. **Rebase and verify**:
27 - At their discretion, auditors will check in their audits into either [rust-crate-audits](https://github.com/OpenDevicePartnership/rust-crate-audits) or into the same repository
28 - Once the new audits have been merged, rebase your branch on main and verify it passes `cargo vet`
29 ```bash
30 git fetch upstream
31 git rebase upstream/main
32 cargo vet
33 ```
34
354. **Update PR**:
36 - If the audits were checked into rust-crate-audits, they will show up in _imports.lock_ on running `cargo vet`. In this case add the updated _imports.lock_ to your PR
37 - If the audits were checked into the same repository, they will be present in _audits.toml_ after rebase and you can simply force push to your PR after rebase
38 ```bash
39 git push -f
40 ```
41
425. **Check PR status**:
43 - The existing PR comment from the previous failure will be updated with a success message once the check passes
44
45### For Auditors
46
471. **Review the questionnaire**:
48 - Check the filled questionnaire on the PR once the developer responds to the `cargo vet` failure
49 - Respond to the developer comment in case more information is needed
50
512. **Audit new dependencies**:
52 - Inspect the `cargo vet` failures using your preferred method
53 - Use [gh pr checkout](https://cli.github.com/manual/gh_pr_checkout) to checkout the PR and run `cargo vet --locked`
54 - Use [Github Pull Requests for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github) to checkout the PR and run `cargo vet --locked`
55 - For more suggestions: [Checking out pull requests locally](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally)
56
573. **Follow `cargo vet` recommendations**:
58 - Follow the recommendations of the `cargo vet` command output, either `cargo vet diff` for version update or `cargo vet inspect` for new dependencies
59
604. **Record audits**:
61 - Use `cargo vet certify` to add new audits to _audits.toml_
62 - Verify all dependencies pass using `cargo vet`
63
645. **Decide audit location**:
65 - **Shared audits**: New audits should ideally be shared across ODP repositories to reduce the overhead of multiple audits for the same dependencies. To facilitate this, it's recommended to cut and paste the new audits and submit as a separate PR to the _audits.toml_ in [rust-crate-audits](https://github.com/OpenDevicePartnership/rust-crate-audits)
66 - If due to business reasons, the audits are not to be shared across repositories, copy the updated _audits.toml_ to a new branch off main in the same repository and submit the PR to update the audits
67
686. **Communicate successful audit**:
69 - Communicate to the PR developer via a PR comment so they can update the PR and get `cargo vet` to pass
70
71---
72
73## Audit criteria
74`cargo vet` comes pre-equipped with two built-in criteria but supports adding new criteria to suit our needs.
75As defined [here](https://mozilla.github.io/cargo-vet/built-in-criteria.html), the default criteria are:
76
77- **safe-to-run**
78 This crate can be compiled, run, and tested on a local workstation or in
79 controlled automation without surprising consequences, such as:
80 * Reading or writing data from sensitive or unrelated parts of the filesystem.
81 * Installing software or reconfiguring the device.
82 * Connecting to untrusted network endpoints.
83 * Misuse of system resources (e.g. cryptocurrency mining).
84
85- **safe-to-deploy**
86 This crate will not introduce a serious security vulnerability to production
87 software exposed to untrusted input.
88
89 Auditors are not required to perform a full logic review of the entire crate.
90 Rather, they must review enough to fully reason about the behavior of all unsafe
91 blocks and usage of powerful imports. For any reasonable usage of the crate in
92 real-world software, an attacker must not be able to manipulate the runtime
93 behavior of these sections in an exploitable or surprising way.
94
95 Ideally, all unsafe code is fully sound, and ambient capabilities (e.g.
96 filesystem access) are hardened against manipulation and consistent with the
97 advertised behavior of the crate. However, some discretion is permitted. In such
98 cases, the nature of the discretion should be recorded in the `notes` field of
99 the audit record.
100
101 For crates which generate deployed code (e.g. build dependencies or procedural
102 macros), reasonable usage of the crate should output code which meets the above
103 criteria.
104
105 **Note: `safe-to-deploy` implies `safe-to-run`**
106
107---
108
109## Conducting an audit
110
111When performing an audit for a new or updated dependency, auditors may consider the following criteria to ensure the safety, reliability, and suitability of the crate for use in our projects:
112
113- **Security**:
114 - Review the crate for known vulnerabilities or security advisories.
115 - Check for unsafe code usage and ensure it is justified and well-documented.
116 - Evaluate the crate’s history of security issues and responsiveness to reported problems.
117
118- **Maintenance and Activity**:
119 - Assess the frequency of updates and the responsiveness of maintainers to issues and pull requests.
120 - Prefer crates that are actively maintained and have a healthy contributor base.
121
122- **License Compliance**:
123 - Verify that the crate’s license is compatible with our project’s licensing requirements.
124
125- **Community Trust and Adoption**:
126 - Consider the crate’s adoption in the wider Rust ecosystem.
127 - Prefer crates that are widely used and trusted by the community.
128
129- **Functionality and Suitability**:
130 - Confirm that the crate provides the required functionality without unnecessary features or bloat.
131 - Evaluate whether the crate’s API is stable and unlikely to introduce breaking changes unexpectedly.
132
133- **Audit Trail**:
134 - Record the audit decision, including any concerns, mitigations, or recommendations for future updates.
135 - If exemptions are granted, document the justification and any follow-up actions required.
136
137---
138
139## Tips for using `cargo vet`:
140
141- **Update _imports.lock_**:
142 - Import trusted third party audits to reduce the number of new audits to be performed. Running `cargo vet` without `--locked` fetches new imports and updates _imports.lock_ with any audits that are helpful for our project.
143
144- **Add exemptions**:
145 - If an audit cannot be performed for some dependency due to time sensitivity or business justified reasons, use `cargo vet add-exemption <PACKAGE> <VERSION>` to add the dependency to exemptions in _config.toml_
146 - To add all remaining audits to exemptions at once, use `cargo vet regenerate exemptions`
147
148- **Prune unnecessary entries**:
149 - Remove unnecessary exemptions and imports using `cargo vet prune` \ No newline at end of file
diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml
new file mode 100644
index 000000000..1c3d54760
--- /dev/null
+++ b/supply-chain/audits.toml
@@ -0,0 +1,38 @@
1
2# cargo-vet audits file
3
4[[audits.autocfg]]
5who = "Felipe Balbi <[email protected]>"
6criteria = "safe-to-deploy"
7version = "1.5.0"
8
9[[audits.darling_core]]
10who = "Felipe Balbi <[email protected]>"
11criteria = "safe-to-deploy"
12version = "0.20.11"
13
14[[audits.defmt-rtt]]
15who = "Felipe Balbi <[email protected]>"
16criteria = "safe-to-deploy"
17version = "1.0.0"
18notes = "defmt-rtt is used for all our logging purposes. Version 1.0.0 merely stabilizes what was already available previously."
19
20[[audits.embassy-executor-timer-queue]]
21who = "Felipe Balbi <[email protected]>"
22criteria = "safe-to-deploy"
23version = "0.1.0"
24
25[[audits.embassy-executor-timer-queue]]
26who = "Felipe Balbi <[email protected]>"
27criteria = "safe-to-deploy"
28version = "0.1.0"
29
30[[audits.embassy-time-queue-utils]]
31who = "Felipe Balbi <[email protected]>"
32criteria = "safe-to-deploy"
33version = "0.3.0"
34
35[[audits.static_cell]]
36who = "jerrysxie <[email protected]>"
37criteria = "safe-to-run"
38delta = "2.1.0 -> 2.1.1"
diff --git a/supply-chain/config.toml b/supply-chain/config.toml
new file mode 100644
index 000000000..501bd91d7
--- /dev/null
+++ b/supply-chain/config.toml
@@ -0,0 +1,226 @@
1
2# cargo-vet config file
3
4[cargo-vet]
5version = "0.10"
6
7[imports.OpenDevicePartnership]
8url = "https://raw.githubusercontent.com/OpenDevicePartnership/rust-crate-audits/main/audits.toml"
9
10[imports.google]
11url = "https://raw.githubusercontent.com/google/rust-crate-audits/main/audits.toml"
12
13[imports.mozilla]
14url = "https://raw.githubusercontent.com/mozilla/supply-chain/main/audits.toml"
15
16[[exemptions.az]]
17version = "1.2.1"
18criteria = "safe-to-deploy"
19
20[[exemptions.bare-metal]]
21version = "0.2.5"
22criteria = "safe-to-deploy"
23
24[[exemptions.bitfield]]
25version = "0.13.2"
26criteria = "safe-to-deploy"
27
28[[exemptions.bitfield]]
29version = "0.15.0"
30criteria = "safe-to-deploy"
31
32[[exemptions.chrono]]
33version = "0.4.40"
34criteria = "safe-to-deploy"
35
36[[exemptions.cortex-m]]
37version = "0.7.7"
38criteria = "safe-to-deploy"
39
40[[exemptions.cortex-m-rt]]
41version = "0.7.5"
42criteria = "safe-to-deploy"
43
44[[exemptions.cortex-m-rt-macros]]
45version = "0.7.5"
46criteria = "safe-to-deploy"
47
48[[exemptions.critical-section]]
49version = "1.2.0"
50criteria = "safe-to-deploy"
51
52[[exemptions.darling]]
53version = "0.20.11"
54criteria = "safe-to-run"
55
56[[exemptions.darling_macro]]
57version = "0.20.11"
58criteria = "safe-to-run"
59
60[[exemptions.defmt]]
61version = "1.0.1"
62criteria = "safe-to-deploy"
63
64[[exemptions.defmt-macros]]
65version = "1.0.1"
66criteria = "safe-to-deploy"
67
68[[exemptions.defmt-parser]]
69version = "1.0.0"
70criteria = "safe-to-deploy"
71
72[[exemptions.embassy-embedded-hal]]
73version = "0.5.0"
74criteria = "safe-to-deploy"
75
76[[exemptions.embassy-executor]]
77version = "0.9.0"
78criteria = "safe-to-run"
79
80[[exemptions.embassy-executor-macros]]
81version = "0.7.0"
82criteria = "safe-to-run"
83
84[[exemptions.embassy-futures]]
85version = "0.1.2"
86criteria = "safe-to-deploy"
87
88[[exemptions.embassy-hal-internal]]
89version = "0.3.0"
90criteria = "safe-to-deploy"
91
92[[exemptions.embassy-sync]]
93version = "0.7.2"
94criteria = "safe-to-deploy"
95
96[[exemptions.embassy-time]]
97version = "0.5.0"
98criteria = "safe-to-deploy"
99
100[[exemptions.embassy-time-driver]]
101version = "0.2.1"
102criteria = "safe-to-deploy"
103
104[[exemptions.embedded-hal]]
105version = "0.2.7"
106criteria = "safe-to-deploy"
107
108[[exemptions.embedded-hal]]
109version = "1.0.0"
110criteria = "safe-to-deploy"
111
112[[exemptions.embedded-hal-async]]
113version = "1.0.0"
114criteria = "safe-to-deploy"
115
116[[exemptions.embedded-hal-nb]]
117version = "1.0.0"
118criteria = "safe-to-deploy"
119
120[[exemptions.embedded-io]]
121version = "0.6.1"
122criteria = "safe-to-deploy"
123
124[[exemptions.embedded-io-async]]
125version = "0.6.1"
126criteria = "safe-to-deploy"
127
128[[exemptions.embedded-storage]]
129version = "0.3.1"
130criteria = "safe-to-deploy"
131
132[[exemptions.embedded-storage-async]]
133version = "0.4.1"
134criteria = "safe-to-deploy"
135
136[[exemptions.fixed]]
137version = "1.29.0"
138criteria = "safe-to-deploy"
139
140[[exemptions.futures-core]]
141version = "0.3.31"
142criteria = "safe-to-deploy"
143
144[[exemptions.futures-sink]]
145version = "0.3.31"
146criteria = "safe-to-deploy"
147
148[[exemptions.hash32]]
149version = "0.3.1"
150criteria = "safe-to-deploy"
151
152[[exemptions.heapless]]
153version = "0.8.0"
154criteria = "safe-to-deploy"
155
156[[exemptions.ident_case]]
157version = "1.0.1"
158criteria = "safe-to-run"
159
160[[exemptions.itertools]]
161version = "0.11.0"
162criteria = "safe-to-deploy"
163
164[[exemptions.log]]
165version = "0.4.27"
166criteria = "safe-to-deploy"
167
168[[exemptions.mimxrt600-fcb]]
169version = "0.2.1"
170criteria = "safe-to-deploy"
171
172[[exemptions.paste]]
173version = "1.0.15"
174criteria = "safe-to-deploy"
175
176[[exemptions.portable-atomic]]
177version = "1.11.0"
178criteria = "safe-to-run"
179
180[[exemptions.proc-macro-error-attr2]]
181version = "2.0.0"
182criteria = "safe-to-deploy"
183
184[[exemptions.proc-macro-error2]]
185version = "2.0.1"
186criteria = "safe-to-deploy"
187
188[[exemptions.rustc_version]]
189version = "0.2.3"
190criteria = "safe-to-deploy"
191
192[[exemptions.semver]]
193version = "0.9.0"
194criteria = "safe-to-deploy"
195
196[[exemptions.semver-parser]]
197version = "0.7.0"
198criteria = "safe-to-deploy"
199
200[[exemptions.static_cell]]
201version = "2.1.0"
202criteria = "safe-to-run"
203
204[[exemptions.syn]]
205version = "2.0.100"
206criteria = "safe-to-deploy"
207
208[[exemptions.thiserror]]
209version = "2.0.12"
210criteria = "safe-to-deploy"
211
212[[exemptions.thiserror-impl]]
213version = "2.0.12"
214criteria = "safe-to-deploy"
215
216[[exemptions.typenum]]
217version = "1.18.0"
218criteria = "safe-to-deploy"
219
220[[exemptions.vcell]]
221version = "0.1.3"
222criteria = "safe-to-deploy"
223
224[[exemptions.volatile-register]]
225version = "0.2.2"
226criteria = "safe-to-deploy"
diff --git a/supply-chain/imports.lock b/supply-chain/imports.lock
new file mode 100644
index 000000000..3f541e59f
--- /dev/null
+++ b/supply-chain/imports.lock
@@ -0,0 +1,472 @@
1
2# cargo-vet imports lock
3
4[audits.OpenDevicePartnership.audits]
5
6[[audits.google.audits.autocfg]]
7who = "Manish Goregaokar <[email protected]>"
8criteria = "safe-to-deploy"
9version = "1.4.0"
10notes = "Contains no unsafe"
11aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
12
13[[audits.google.audits.bitflags]]
14who = "Lukasz Anforowicz <[email protected]>"
15criteria = "safe-to-deploy"
16version = "1.3.2"
17notes = """
18Security review of earlier versions of the crate can be found at
19(Google-internal, sorry): go/image-crate-chromium-security-review
20
21The crate exposes a function marked as `unsafe`, but doesn't use any
22`unsafe` blocks (except for tests of the single `unsafe` function). I
23think this justifies marking this crate as `ub-risk-1`.
24
25Additional review comments can be found at https://crrev.com/c/4723145/31
26"""
27aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
28
29[[audits.google.audits.bytemuck]]
30who = "Lukasz Anforowicz <[email protected]>"
31criteria = "safe-to-deploy"
32version = "1.16.3"
33notes = """
34Review notes from the original audit (of 1.14.3) may be found in
35https://crrev.com/c/5362675. Note that this audit has initially missed UB risk
36that was fixed in 1.16.2 - see https://github.com/Lokathor/bytemuck/pull/258.
37Because of this, the original audit has been edited to certify version `1.16.3`
38instead (see also https://crrev.com/c/5771867).
39"""
40aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
41
42[[audits.google.audits.bytemuck]]
43who = "Lukasz Anforowicz <[email protected]>"
44criteria = "safe-to-deploy"
45delta = "1.16.3 -> 1.17.1"
46notes = "Unsafe review comments can be found in https://crrev.com/c/5813463"
47aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
48
49[[audits.google.audits.bytemuck]]
50who = "Adrian Taylor <[email protected]>"
51criteria = "safe-to-deploy"
52delta = "1.17.1 -> 1.18.0"
53notes = "No code changes - just altering feature flag arrangements"
54aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
55
56[[audits.google.audits.bytemuck]]
57who = "Adrian Taylor <[email protected]>"
58criteria = "safe-to-deploy"
59delta = "1.18.0 -> 1.19.0"
60notes = "No code changes - just comment changes and adding the track_caller attribute."
61aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
62
63[[audits.google.audits.bytemuck]]
64who = "Lukasz Anforowicz <[email protected]>"
65criteria = "safe-to-deploy"
66delta = "1.19.0 -> 1.20.0"
67notes = "`unsafe` review can be found at https://crrev.com/c/6096767"
68aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
69
70[[audits.google.audits.bytemuck]]
71who = "Adrian Taylor <[email protected]>"
72criteria = "safe-to-deploy"
73delta = "1.20.0 -> 1.21.0"
74notes = "Unsafe review at https://chromium-review.googlesource.com/c/chromium/src/+/6111154/"
75aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
76
77[[audits.google.audits.bytemuck]]
78who = "Daniel Cheng <[email protected]>"
79criteria = "safe-to-deploy"
80delta = "1.21.0 -> 1.22.0"
81notes = """
82This adds new instances of unsafe, but the uses are justified:
83- BoxBytes is essentially a Box<[u8], which is Send + Sync, so also marking BoxBytes as Send + Sync is justified.
84- core::num::Saturating<T> meets the criteria for Zeroable + Pod, so marking it as such is justified.
85
86See https://crrev.com/c/6321863 for more audit notes.
87"""
88aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
89
90[[audits.google.audits.byteorder]]
91who = "danakj <[email protected]>"
92criteria = "safe-to-deploy"
93version = "1.5.0"
94notes = "Unsafe review in https://crrev.com/c/5838022"
95aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
96
97[[audits.google.audits.cfg-if]]
98who = "George Burgess IV <[email protected]>"
99criteria = "safe-to-deploy"
100version = "1.0.0"
101aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT"
102
103[[audits.google.audits.either]]
104who = "Manish Goregaokar <[email protected]>"
105criteria = "safe-to-deploy"
106version = "1.13.0"
107notes = "Unsafe code pertaining to wrapping Pin APIs. Mostly passes invariants down."
108aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
109
110[[audits.google.audits.either]]
111who = "Daniel Cheng <[email protected]>"
112criteria = "safe-to-deploy"
113delta = "1.13.0 -> 1.14.0"
114notes = """
115Inheriting ub-risk-1 from the baseline review of 1.13.0. While the delta has some diffs in unsafe code, they are either:
116- migrating code to use helper macros
117- migrating match patterns to take advantage of default bindings mode from RFC 2005
118Either way, the result is code that does exactly the same thing and does not change the risk of UB.
119
120See https://crrev.com/c/6323164 for more audit details.
121"""
122aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
123
124[[audits.google.audits.either]]
125who = "Lukasz Anforowicz <[email protected]>"
126criteria = "safe-to-deploy"
127delta = "1.14.0 -> 1.15.0"
128notes = "The delta in `lib.rs` only tweaks doc comments and `#[cfg(feature = \"std\")]`."
129aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
130
131[[audits.google.audits.nb]]
132who = "George Burgess IV <[email protected]>"
133criteria = "safe-to-deploy"
134version = "1.0.0"
135aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT"
136
137[[audits.google.audits.nb]]
138who = "George Burgess IV <[email protected]>"
139criteria = "safe-to-deploy"
140delta = "1.0.0 -> 0.1.3"
141aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT"
142
143[[audits.google.audits.nb]]
144who = "George Burgess IV <[email protected]>"
145criteria = "safe-to-deploy"
146delta = "1.0.0 -> 1.1.0"
147aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT"
148
149[[audits.google.audits.num-traits]]
150who = "Manish Goregaokar <[email protected]>"
151criteria = "safe-to-deploy"
152version = "0.2.19"
153notes = "Contains a single line of float-to-int unsafe with decent safety comments"
154aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
155
156[[audits.google.audits.proc-macro2]]
157who = "Lukasz Anforowicz <[email protected]>"
158criteria = "safe-to-deploy"
159version = "1.0.78"
160notes = """
161Grepped for \"crypt\", \"cipher\", \"fs\", \"net\" - there were no hits
162(except for a benign \"fs\" hit in a doc comment)
163
164Notes from the `unsafe` review can be found in https://crrev.com/c/5385745.
165"""
166aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
167
168[[audits.google.audits.proc-macro2]]
169who = "Adrian Taylor <[email protected]>"
170criteria = "safe-to-deploy"
171delta = "1.0.78 -> 1.0.79"
172aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
173
174[[audits.google.audits.proc-macro2]]
175who = "Adrian Taylor <[email protected]>"
176criteria = "safe-to-deploy"
177delta = "1.0.79 -> 1.0.80"
178aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
179
180[[audits.google.audits.proc-macro2]]
181who = "Dustin J. Mitchell <[email protected]>"
182criteria = "safe-to-deploy"
183delta = "1.0.80 -> 1.0.81"
184notes = "Comment changes only"
185aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
186
187[[audits.google.audits.proc-macro2]]
188who = "danakj <[email protected]>"
189criteria = "safe-to-deploy"
190delta = "1.0.81 -> 1.0.82"
191aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
192
193[[audits.google.audits.proc-macro2]]
194who = "Dustin J. Mitchell <[email protected]>"
195criteria = "safe-to-deploy"
196delta = "1.0.82 -> 1.0.83"
197notes = "Substantive change is replacing String with Box<str>, saving memory."
198aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
199
200[[audits.google.audits.proc-macro2]]
201who = "Lukasz Anforowicz <[email protected]>"
202criteria = "safe-to-deploy"
203delta = "1.0.83 -> 1.0.84"
204notes = "Only doc comment changes in `src/lib.rs`."
205aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
206
207[[audits.google.audits.proc-macro2]]
208who = "[email protected]"
209criteria = "safe-to-deploy"
210delta = "1.0.84 -> 1.0.85"
211notes = "Test-only changes."
212aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
213
214[[audits.google.audits.proc-macro2]]
215who = "Lukasz Anforowicz <[email protected]>"
216criteria = "safe-to-deploy"
217delta = "1.0.85 -> 1.0.86"
218notes = """
219Comment-only changes in `build.rs`.
220Reordering of `Cargo.toml` entries.
221Just bumping up the version number in `lib.rs`.
222Config-related changes in `test_size.rs`.
223"""
224aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
225
226[[audits.google.audits.proc-macro2]]
227who = "danakj <[email protected]>"
228criteria = "safe-to-deploy"
229delta = "1.0.86 -> 1.0.87"
230notes = "No new unsafe interactions."
231aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
232
233[[audits.google.audits.proc-macro2]]
234who = "Liza Burakova <[email protected]"
235criteria = "safe-to-deploy"
236delta = "1.0.87 -> 1.0.89"
237notes = """
238Biggest change is adding error handling in build.rs.
239Some config related changes in wrapper.rs.
240"""
241aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
242
243[[audits.google.audits.proc-macro2]]
244who = "Lukasz Anforowicz <[email protected]>"
245criteria = "safe-to-deploy"
246delta = "1.0.89 -> 1.0.92"
247notes = """
248I looked at the delta and the previous discussion at
249https://chromium-review.googlesource.com/c/chromium/src/+/5385745/3#message-a8e2813129fa3779dab15acede408ee26d67b7f3
250and the changes look okay to me (including the `unsafe fn from_str_unchecked`
251changes in `wrapper.rs`).
252"""
253aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
254
255[[audits.google.audits.proc-macro2]]
256who = "Lukasz Anforowicz <[email protected]>"
257criteria = "safe-to-deploy"
258delta = "1.0.92 -> 1.0.93"
259notes = "No `unsafe`-related changes."
260aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
261
262[[audits.google.audits.proc-macro2]]
263who = "Daniel Cheng <[email protected]>"
264criteria = "safe-to-deploy"
265delta = "1.0.93 -> 1.0.94"
266notes = "Minor doc changes and clippy lint adjustments+fixes."
267aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
268
269[[audits.google.audits.quote]]
270who = "Lukasz Anforowicz <[email protected]>"
271criteria = "safe-to-deploy"
272version = "1.0.35"
273notes = """
274Grepped for \"unsafe\", \"crypt\", \"cipher\", \"fs\", \"net\" - there were no hits
275(except for benign \"net\" hit in tests and \"fs\" hit in README.md)
276"""
277aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
278
279[[audits.google.audits.quote]]
280who = "Adrian Taylor <[email protected]>"
281criteria = "safe-to-deploy"
282delta = "1.0.35 -> 1.0.36"
283aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
284
285[[audits.google.audits.quote]]
286who = "Lukasz Anforowicz <[email protected]>"
287criteria = "safe-to-deploy"
288delta = "1.0.36 -> 1.0.37"
289notes = """
290The delta just 1) inlines/expands `impl ToTokens` that used to be handled via
291`primitive!` macro and 2) adds `impl ToTokens` for `CStr` and `CString`.
292"""
293aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
294
295[[audits.google.audits.quote]]
296who = "Dustin J. Mitchell <[email protected]>"
297criteria = "safe-to-deploy"
298delta = "1.0.37 -> 1.0.38"
299notes = "Still no unsafe"
300aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
301
302[[audits.google.audits.quote]]
303who = "Daniel Cheng <[email protected]>"
304criteria = "safe-to-deploy"
305delta = "1.0.38 -> 1.0.39"
306notes = "Only minor changes for clippy lints and documentation."
307aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
308
309[[audits.google.audits.quote]]
310who = "Lukasz Anforowicz <[email protected]>"
311criteria = "safe-to-deploy"
312delta = "1.0.39 -> 1.0.40"
313notes = """
314The delta is just a simplification of how `tokens.extend(...)` call is made.
315Still no `unsafe` anywhere.
316"""
317aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
318
319[[audits.google.audits.rand_core]]
320who = "Lukasz Anforowicz <[email protected]>"
321criteria = "safe-to-deploy"
322version = "0.6.4"
323notes = """
324For more detailed unsafe review notes please see https://crrev.com/c/6362797
325"""
326aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
327
328[[audits.google.audits.stable_deref_trait]]
329who = "Manish Goregaokar <[email protected]>"
330criteria = "safe-to-deploy"
331version = "1.2.0"
332notes = "Purely a trait, crates using this should be carefully vetted since self-referential stuff can be super tricky around various unsafe rust edges."
333aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
334
335[[audits.google.audits.strsim]]
336who = "[email protected]"
337criteria = "safe-to-deploy"
338version = "0.10.0"
339notes = """
340Reviewed in https://crrev.com/c/5171063
341
342Previously reviewed during security review and the audit is grandparented in.
343"""
344aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
345
346[[audits.google.audits.unicode-ident]]
347who = "Lukasz Anforowicz <[email protected]>"
348criteria = "safe-to-deploy"
349version = "1.0.12"
350notes = '''
351I grepped for \"crypt\", \"cipher\", \"fs\", \"net\" - there were no hits.
352
353All two functions from the public API of this crate use `unsafe` to avoid bound
354checks for an array access. Cross-module analysis shows that the offsets can
355be statically proven to be within array bounds. More details can be found in
356the unsafe review CL at https://crrev.com/c/5350386.
357
358This crate has been added to Chromium in https://crrev.com/c/3891618.
359'''
360aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
361
362[[audits.google.audits.unicode-ident]]
363who = "Dustin J. Mitchell <[email protected]>"
364criteria = "safe-to-deploy"
365delta = "1.0.12 -> 1.0.13"
366notes = "Lots of table updates, and tables are assumed correct with unsafe `.get_unchecked()`, so ub-risk-2 is appropriate"
367aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
368
369[[audits.google.audits.unicode-ident]]
370who = "Lukasz Anforowicz <[email protected]>"
371criteria = "safe-to-deploy"
372delta = "1.0.13 -> 1.0.14"
373notes = "Minimal delta in `.rs` files: new test assertions + doc changes."
374aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
375
376[[audits.google.audits.unicode-ident]]
377who = "Adrian Taylor <[email protected]>"
378criteria = "safe-to-deploy"
379delta = "1.0.14 -> 1.0.15"
380notes = "No changes relevant to any of these criteria."
381aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
382
383[[audits.google.audits.unicode-ident]]
384who = "Liza Burakova <[email protected]>"
385criteria = "safe-to-deploy"
386delta = "1.0.15 -> 1.0.16"
387aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
388
389[[audits.google.audits.unicode-ident]]
390who = "Daniel Cheng <[email protected]>"
391criteria = "safe-to-deploy"
392delta = "1.0.16 -> 1.0.18"
393notes = "Only minor comment and documentation updates."
394aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
395
396[[audits.google.audits.void]]
397who = "George Burgess IV <[email protected]>"
398criteria = "safe-to-deploy"
399version = "1.0.2"
400aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT"
401
402[[audits.mozilla.audits.crunchy]]
403who = "Erich Gubler <[email protected]>"
404criteria = "safe-to-deploy"
405version = "0.2.3"
406aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
407
408[[audits.mozilla.audits.document-features]]
409who = "Erich Gubler <[email protected]>"
410criteria = "safe-to-deploy"
411version = "0.2.8"
412aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
413
414[[audits.mozilla.audits.document-features]]
415who = "Erich Gubler <[email protected]>"
416criteria = "safe-to-deploy"
417delta = "0.2.8 -> 0.2.9"
418aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
419
420[[audits.mozilla.audits.document-features]]
421who = "Erich Gubler <[email protected]>"
422criteria = "safe-to-deploy"
423delta = "0.2.9 -> 0.2.10"
424aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
425
426[[audits.mozilla.audits.document-features]]
427who = "Teodor Tanasoaia <[email protected]>"
428criteria = "safe-to-deploy"
429delta = "0.2.10 -> 0.2.11"
430aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
431
432[[audits.mozilla.audits.fnv]]
433who = "Bobby Holley <[email protected]>"
434criteria = "safe-to-deploy"
435version = "1.0.7"
436notes = "Simple hasher implementation with no unsafe code."
437aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
438
439[[audits.mozilla.audits.half]]
440who = "John M. Schanck <[email protected]>"
441criteria = "safe-to-deploy"
442version = "1.8.2"
443notes = """
444This crate contains unsafe code for bitwise casts to/from binary16 floating-point
445format. I've reviewed these and found no issues. There are no uses of ambient
446capabilities.
447"""
448aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
449
450[[audits.mozilla.audits.half]]
451who = "Erich Gubler <[email protected]>"
452criteria = "safe-to-deploy"
453delta = "1.8.2 -> 1.8.3"
454aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
455
456[[audits.mozilla.audits.half]]
457who = "Erich Gubler <[email protected]>"
458criteria = "safe-to-deploy"
459delta = "1.8.3 -> 2.5.0"
460aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
461
462[[audits.mozilla.audits.litrs]]
463who = "Erich Gubler <[email protected]>"
464criteria = "safe-to-deploy"
465version = "0.4.1"
466aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
467
468[[audits.mozilla.audits.strsim]]
469who = "Ben Dean-Kawamura <[email protected]>"
470criteria = "safe-to-deploy"
471delta = "0.10.0 -> 0.11.1"
472aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"