Skip to content

chore: drop unused image files and the perl build dependency, restrict /dev/crypto - #690

Merged
JanZachmann merged 2 commits into
omnect:mainfrom
JanZachmann:cve-followup/drop-unused-image-parts-main
Aug 21, 2026
Merged

chore: drop unused image files and the perl build dependency, restrict /dev/crypto#690
JanZachmann merged 2 commits into
omnect:mainfrom
JanZachmann:cve-followup/drop-unused-image-parts-main

Conversation

@JanZachmann

@JanZachmann JanZachmann commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • openssl bbappend: delete c_rehash and ${libdir}/ssl-3/misc
  • nss bbappend: restrict FILES:${PN} to the libraries, the config and shlibsign, and move the rest of ${bindir} into a new nss-tools package that no image installs
  • omnect-os-distro.conf: RDEPENDS:nspr-dev:remove = "perl"
  • cryptodev-udev: new file-only recipe shipping 10-cryptodev.rules, which gives /dev/crypto mode 0600; installed on tauril2 through the machine include. The module itself stays in the image.

Reason

omnect-os-distro.conf already drops openssl-misc and nss-smime from PACKAGES to keep perl out of the image, but PACKAGES:remove only removes the package - the files move into the respective main package and still ship, as perl scripts in an image without a perl interpreter.

nss is the bigger case: the recipe has FILES:${PN} = "... ${bindir} ...", so 49 tools ship (certutil, pk12util, selfserv, tstclnt, ssltap, signtool, the test binaries, ...) although nothing in the image references any of them - networkmanager pulls nss in for the libraries only. Restricting the package and collecting the tools in nss-tools keeps them buildable for a debug image and takes them out of the release image, including smime, so no single-file removals are needed there. shlibsign stays in the main package because the nss postinst calls it, and that postinst can end up running on first boot. openssl keeps the file removal: upstream splits those two paths into openssl-misc and the main package claims them only because the distro drops that package.

perl itself shows up in the image SBOM although no perl file is in the image: the SBOM is written per built recipe, and the only recipe pulling target perl into the build is nspr (RDEPENDS:${PN}-dev += "perl", nspr comes in via networkmanager -> nss -> nspr). Dev packages are never installed, so dropping that dependency changes nothing in the image while taking perl out of the build and out of the SBOM - four high/critical findings less to moderate per release.

On tauril2 the imx BSP installs the cryptodev module, it is loaded at boot, and the driver creates /dev/crypto world read/write, while upstream has no fix for CVE-2026-28529 (use-after-free in get_userbuf(), local privilege escalation). The module stays available for applications; the udev rule takes away the world read/write default, and its low number lets a customer rule override the mode.

No other BSP ships cryptodev, and no script, unit or binary in the 6.0.2 images references the removed files or /dev/crypto.

…t /dev/crypto

## Summary

- **openssl** bbappend: delete `c_rehash` and `${libdir}/ssl-3/misc`
- **nss** bbappend: restrict `FILES:${PN}` to the libraries, the config
and `shlibsign`, and move the rest of `${bindir}` into a new `nss-tools`
package that no image installs
- **omnect-os-distro.conf**: `RDEPENDS:nspr-dev:remove = "perl"`
- **cryptodev-udev**: new file-only recipe shipping
`10-cryptodev.rules`, which gives `/dev/crypto` mode `0600`; installed
on tauril2 through the machine include. The module itself stays in the
image.

## Reason

`omnect-os-distro.conf` already drops `openssl-misc` and `nss-smime`
from `PACKAGES` to keep perl out of the image, but `PACKAGES:remove`
only removes the package - the files move into the respective main
package and still ship, as perl scripts in an image without a perl
interpreter.

nss is the bigger case: the recipe has `FILES:${PN} = "... ${bindir}
..."`, so **49 tools** ship (`certutil`, `pk12util`, `selfserv`,
`tstclnt`, `ssltap`, `signtool`, the test binaries, ...) although
nothing in the image references any of them - networkmanager pulls nss
in for the libraries only. Restricting the package and collecting the
tools in `nss-tools` keeps them buildable for a debug image and takes
them out of the release image, including `smime`, so no single-file
removals are needed there. `shlibsign` stays in the main package because
the nss postinst calls it, and that postinst can end up running on first
boot. openssl keeps the file removal: upstream splits those two paths
into `openssl-misc` and the main package claims them only because the
distro drops that package.

perl itself shows up in the image SBOM although no perl file is in the
image: the SBOM is written per built recipe, and the only recipe pulling
target perl into the build is nspr (`RDEPENDS:${PN}-dev += "perl"`, nspr
comes in via `networkmanager -> nss -> nspr`). Dev packages are never
installed, so dropping that dependency changes nothing in the image
while taking perl out of the build and out of the SBOM - four
high/critical findings less to moderate per release.

On tauril2 the imx BSP installs the cryptodev module, it is loaded at
boot, and the driver creates `/dev/crypto` world read/write, while
upstream has no fix for CVE-2026-28529 (use-after-free in
`get_userbuf()`, local privilege escalation). The module stays available
for applications; the udev rule takes away the world read/write default,
and its low number lets a customer rule override the mode.

No other BSP ships cryptodev, and no script, unit or binary in the 6.0.2
images references the removed files or `/dev/crypto`.

---------

Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
Comment thread conf/machine/include/phytec-imx8mm.inc
@JanZachmann
JanZachmann requested a review from mlilien August 21, 2026 09:40
Two reviewers asked whether shlibsign lands in nss and nss-tools. It does not -
populate_packages() claims each path for the first matching package in PACKAGES
order - but the file did not say so.

Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
Comment on lines +6 to +12
FILES:${PN}:class-target = " \
${sysconfdir} \
${bindir}/shlibsign \
${libdir}/lib*.chk \
${libdir}/lib*.so \
"
FILES:${PN}-tools = "${bindir}"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, and this is the same question you raised on #688 - answer repeated here so this PR stands on its own. Checked in this release's oe-core (meta/lib/oe/package.py), not from memory:

  • populate_packages() walks PACKAGES in order with one global seen list and does if file in seen: continue before claiming a path. First matching package wins; no later package can take the same path.
  • nss comes before nss-tools (the bbappend uses PACKAGES:append), so ${bindir}/shlibsign is claimed by nss.
  • When nss-tools is processed, files_from_filevars() expands the directory entry to its children (if cpath.isdir(f): files += [os.path.join(f, x) for x in os.listdir(f)]). ./usr/bin itself is already in seen (it was created while packaging shlibsign) and is skipped, shlibsign is skipped for the same reason, and the remaining binaries go to nss-tools.
  • So no file is in both packages, and no installed path stays unpackaged either - hence no installed-vs-shipped.
  • The /usr/bin directory node exists in both packages; mkdir_recurse() creates it per package. Shared directories are not a conflict for ipk/rpm, only identical files would be.
  • The recipe already relies on the same rule in the other direction: FILES:${PN}-smime = "${bindir}/smime" next to FILES:${PN} = "... ${bindir} ...", with nss-smime prepended.

One correction on the count: FILES:${PN} has a single ${bindir} entry (shlibsign); the other three entries are ${sysconfdir} and the two ${libdir}/lib* globs.

Since the line has now prompted the question twice, 1ee9be3 writes the rule into the file:

# PACKAGES order decides who claims a file first: nss takes shlibsign, nss-tools
# the rest of bindir. No file ends up in both.
FILES:${PN}-tools = "${bindir}"

The only alternative that removes the implicit ordering would be listing all ~49 tool names in FILES:${PN}-tools and putting that package before ${PN} (the upstream nss-smime pattern). I would not do that for 49 names, but say so if you disagree.

Limitation unchanged: this is from reading the packaging code, not from a build - CI still has to show the split and that no QA warning appears.

@mlilien your approval was on 86113fc7 and main requires approval of the last push, so the comment commit above invalidated it - re-requesting.

@JanZachmann
JanZachmann requested a review from mlilien August 21, 2026 10:57
@JanZachmann
JanZachmann merged commit 2f4491f into omnect:main Aug 21, 2026
3 checks passed
JanZachmann added a commit that referenced this pull request Aug 21, 2026
## Summary

New `nspr` bbappend that deletes `${libdir}/nspr/tests/runtests.pl` for
target builds.

## Reason

#690 broke the build. `RDEPENDS:nspr-dev:remove = "perl"` takes perl out
of the build graph, but `nspr-dev` still ships a perl script, so the
`file-rdeps` QA check fails:

```
ERROR: nspr-4.38.2-r0 do_package_qa: QA Issue: /usr/lib/nspr/tests/runtests.pl contained in package nspr-dev requires /usr/bin/perl, but no providers found in RDEPENDS:nspr-dev? [file-rdeps]
ERROR: nspr-4.38.2-r0 do_package_qa: Fatal QA errors were found, failing task.
```

The recipe installs that script itself (`install -m 0755
${S}/pr/tests/runtests.pl ${D}${libdir}/nspr/tests`) and packages it
through the `${libdir}/nspr/tests/*` glob in `FILES:${PN}-dev`. It only
drives the nspr test binaries, which no image runs, and the recipe
already deletes `compile-et.pl` from `${bindir}` for exactly the same
reason. Deleting this one file is therefore the honest fix; the
alternative, `INSANE_SKIP:nspr-dev += "file-rdeps"`, would only silence
a check that is telling the truth.

This is a build-machine-independent failure: it is `nspr:do_package_qa`,
so it hits every build whose graph contains nspr. From the same trigger
(wrynose/dev/gateway-devel, build 6):

- `rpi4-omnect-lab` failed at 13:44 - the first build to reach that task
- `genericx86-64` hit the identical error while still running
- `dehndetect` passed: nspr does not appear once in its build log, so
that image does not pull it in
- `tauril2` build 6 errored for an unrelated reason (no nspr in its
log); 6.1 is running
- `rpi4` was still before that task at the time of writing

If CI still fails on nspr after this, the fallback is to revert the
`RDEPENDS:nspr-dev:remove` line from #690 and accept perl in the build
and the SBOM again.

Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants