diagnosis-only report
reportFixer invalidated the previous AppArmor patch because it resurrected an obsolete lsusb conffile as an upstream profile and granted `/ r,` from observed-only evidence.
Failure details
- Review category: publication-quality
Public issue detail
AppArmor denied lsusb: open /
Last seen: 2026-05-19 02:46 UTC. Public JSON: /v1/issues/019e107e-15fd-7642-b5ae-caa71b83768c
Fixer does not have a ready diff or triage handoff for this issue yet, but it does have a published diagnosis-only result. This is the clearest current explanation of what workers found.
Fixer invalidated the previous AppArmor patch because it resurrected an obsolete lsusb conffile as an upstream profile and granted `/ r,` from observed-only evidence.
This issue has 2 recorded worker attempts. Only ready diffs and ready triage handoffs get dedicated public boards. Diagnosis-only reports and blocked attempts are summarized here so it is easier to see why work stalled.
No ready triage handoffs, failed patch attempts, explained impossible attempts, or other attempt states.
Fixer invalidated the previous AppArmor patch because it resurrected an obsolete lsusb conffile as an upstream profile and granted `/ r,` from observed-only evidence.
Patch proposal created locally. Review it and submit it upstream if it looks correct.
## Plan Pass
You are planning a fixer patch before any edits happen.
Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `debian-source`. The original pre-edit snapshot is available at `./source` if you need to inspect it.
Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.
Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `apparmor` upstream patch, not just a Debian-local workaround. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.
Return a short markdown plan with these exact sections:
## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation
Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.
## Patch Pass
You are working on a bounded fixer proposal.
Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `debian-source`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.
Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.
Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `apparmor` upstream patch, not just a Debian-local workaround.
Keep the change narrowly scoped and summarize validation clearly.
In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:
## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.
## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.
## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.
## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.
## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.
Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.
## Review Pass 1
You are reviewing a freshly generated fixer patch.
Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `debian-source`. Review the first patch pass. The original pre-edit snapshot is available at `./source` for diffing. The workspace currently changes these repo-relative paths: debian/apparmor.install, profiles/apparmor.d/lsusb. Verify that `## Git Add Paths` matches this exact set and that `## Issue Connection` explains every shipped functional file.
Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `apparmor` upstream patch, not just a Debian-local workaround.
Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout. The latest author response is at `./patch-output.txt`. Inspect the current code and changed paths like a strict code reviewer. Focus on correctness, regressions, maintainability, awkward control flow such as avoidable `goto`, missing validation, weak or non-gittable commit message text, and explanations that fail to connect the observed issue evidence to the code change. Also review the maintainer experience: the patch mail should be easy to accept upstream, the user-visible bug should be explained in plain language, subsystem-specific jargon should be defined when first used, and any non-obvious state translation or index remapping in code should have a short explanatory comment. Reject patches that omit `## Evidence Confidence`, use anything other than `reproduced`, `observed`, or `inferred`, or sound more certain than that evidence level allows. Reject patches that claim `reproduced` unless `## Validation` names the concrete reproduction command or test and its result. Reject patches that invent a reproducer, command line, crash, or user-visible failure not present in the evidence bundle; indirect profiler or strace evidence may justify a cautious mitigation, but the author must say it is indirect instead of presenting it as a confirmed upstream bug. Reject patches that introduce generic libc/std APIs when nearby code or project docs provide a local compat/helper API for the same job, unless the author explicitly justifies the exception. Reject validation that only reports a leaf object/syntax build when a project-level configure/build/test entrypoint exists and was not attempted; if a full build cannot run, the author must show the exact failed command and blocker.
Do not apply code changes in this pass.
Return a short markdown review report. The first non-empty line must be exactly one of:
RESULT: ok
RESULT: fix-needed
If you choose `RESULT: fix-needed`, add a `## Findings` section with concrete, actionable items.## Plan Pass
## Problem
Fixer observed an AppArmor denial from profile `lsusb` when `/usr/bin/lsusb` tried to open `/` for read. The prepared AppArmor source tree does not currently contain `profiles/apparmor.d/lsusb`, even though the host package owns `/etc/apparmor.d/lsusb`; that installed profile also lacks `/ r,`.
## Evidence Confidence
observed
## Proposed Subject
`profiles: allow lsusb to read the root directory`
## Patch Plan
Add or update the upstream shipped `lsusb` profile in `profiles/apparmor.d/lsusb`, carrying the existing profile shape and adding a narrowly scoped `/ r,` directory-read rule near the other enumeration rules. Also add it to `debian/apparmor.install` if the profile remains absent from the package install manifest.
Follow local policy conventions found in `README.md` and `profiles/Makefile`: include `tunables/global`, include `abstractions/base`, keep `include if exists <local/lsusb>`, and satisfy the profiles check that every shipped profile has a local override include. No relevant file I/O/process/memory helper API applies because this is policy data only. No prior Fixer patch was present in the workspace; the installed-but-not-in-source `lsusb` profile is the policy surface to reconcile. No control-flow changes are involved, so avoidable `goto` is not relevant.
## Risks
Adding `/ r,` exposes top-level directory names to confined `lsusb`, but not recursive filesystem access. That is broader than the exact USB paths, yet matches the observed kernel request and existing AppArmor convention where some hardware-enumeration abstractions already allow root directory read when their libraries require it.
The source/package mismatch is the main risk: if `/etc/apparmor.d/lsusb` is generated or carried elsewhere, adding a profile here could duplicate policy. I would verify ownership and install paths again before editing.
## Validation
First try the project-level entrypoint from the workspace root: `make`. This is expected to fail by design with the top-level “See README” message, and I would report that exact failure.
Then run the relevant project check: `make -C profiles check USE_SYSTEM=1`.
Focused validation: compile only the touched profile with `apparmor_parser --config-file=parser/tst/parser.conf -S -b profiles/apparmor.d profiles/apparmor.d/lsusb`.
Bounded independent reproduction attempt: if AppArmor is enabled and the host `lsusb` profile is loaded, run `aa-exec -p lsusb -- lsusb` and check audit output for the `/` denial before and after the patch. If confinement or audit access is unavailable, final wording will say the issue was observed by Fixer and not independently reproduced.
## Patch Pass
Subject: profiles: allow lsusb to read the root directory
## Commit Message
Add the shipped `lsusb` AppArmor profile to the profile source tree and include the root directory read rule needed by USB enumeration. AppArmor profiles are policy files that describe which paths a confined program may access; this one was missing permission for a read-only open of `/`.
## Evidence Confidence
observed
## Issue Connection
Fixer observed a kernel audit denial for `/usr/bin/lsusb`: profile `lsusb` attempted `operation="open"` on `name="/"` with requested read access, and AppArmor denied it. I did not independently reproduce the denial; the local bounded runtime attempt was blocked by the sandbox.
The cautious code-level inference is that the `lsusb` profile needs read access to the root directory while enumerating system devices. The installed host package owns `/etc/apparmor.d/lsusb`, but the prepared source tree did not contain the corresponding profile, so I added it under `profiles/apparmor.d/lsusb` and added `etc/apparmor.d/lsusb` to `debian/apparmor.install`.
The profile follows local policy conventions checked in `README.md` and `profiles/Makefile`: `tunables/global`, `abstractions/base`, and `include if exists <local/lsusb>`. No relevant local helper API applies because this is policy data, not code introducing file/process/allocation APIs. The expected effect is that the packaged `lsusb` profile can allow the observed read-only open of `/` without granting recursive filesystem access.
## Git Add Paths
profiles/apparmor.d/lsusb
debian/apparmor.install
## Validation
`make` from the workspace root failed as expected for this project entrypoint:
`*** See README for information how to build AppArmor ***`
`make: *** [Makefile:6: all] Error 1`
`make -C profiles check USE_SYSTEM=1` failed after parser checks because the environment lacks `aa-logprof`:
`/bin/sh: 1: aa-logprof: not found`
`make: *** [Makefile:153: check-logprof] Error 1`
`make -C profiles check-parser USE_SYSTEM=1` passed. It printed `find: './apparmor/profiles/extras/abstractions': No such file or directory`, but exited successfully.
`apparmor_parser --config-file=parser/tst/parser.conf -S -b profiles/apparmor.d profiles/apparmor.d/lsusb >/dev/null` passed.
Independent reproduction attempt: `aa-exec -p lsusb -- lsusb` was blocked by the sandbox with `[2] aa-exec: ERROR: Read-only file system`, so the evidence remains `observed`, not `reproduced`.
## Review Pass 1
RESULT: ok
The patch is narrowly scoped to the exact changed path set: `debian/apparmor.install` and `profiles/apparmor.d/lsusb`. The latest `## Git Add Paths` matches that set, and `## Issue Connection` explains both functional files: the new `lsusb` policy profile and the Debian install manifest entry.
Evidence confidence is correctly `observed`; the author explicitly says the denial was observed by Fixer and not independently reproduced. Validation attempted the workspace-root `make`, reported its exact failure, then ran profile-level parser checks and a focused `apparmor_parser` compile. The blocked runtime reproduction attempt is reported without upgrading confidence.diff --git a/debian/apparmor.install b/debian/apparmor.install
index c12addb..2a85a40 100644
--- a/debian/apparmor.install
+++ b/debian/apparmor.install
@@ -3,6 +3,7 @@ debian/features /usr/share/apparmor-features/
etc/apparmor.d/abstractions/*
etc/apparmor.d/abi/*
etc/apparmor.d/local/README
+etc/apparmor.d/lsusb
etc/apparmor.d/lsb_release
etc/apparmor.d/nvidia_modprobe
etc/apparmor.d/tunables/alias
diff --git a/profiles/apparmor.d/lsusb b/profiles/apparmor.d/lsusb
new file mode 100644
index 0000000..9c9fbb9
--- /dev/null
+++ b/profiles/apparmor.d/lsusb
@@ -0,0 +1,74 @@
+# vim:syntax=apparmor
+# ------------------------------------------------------------------
+#
+# Copyright (C) 2024 Canonical Ltd.
+#
+# Author: Federico Quattrin <federico.quattrin@canonical.com>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of version 2 of the GNU General Public
+# License published by the Free Software Foundation.
+#
+# ------------------------------------------------------------------
+
+abi <abi/4.0>,
+include <tunables/global>
+
+profile lsusb /usr/bin/lsusb {
+ include <abstractions/base>
+
+ /usr/bin/lsusb mr,
+
+ network netlink raw,
+
+ # Needed for additional information gathered under sudo
+ capability net_admin,
+ /dev/bus/usb/@{d}@{d}@{d}/@{d}@{d}@{d} rw,
+
+ / r,
+ /dev/ r,
+ /dev/bus/usb/ r,
+ @{run}/udev/data/*usb:* r,
+ @{run}/udev/data/c*:* r,
+
+ @{sys}/bus/ r,
+ @{sys}/bus/usb/devices/ r,
+ @{sys}/class/ r,
+
+ @{sys}/devices/**/usb[0-9]**/uevent r,
+ @{sys}/devices/**/usb[0-9]**/busnum r,
+ @{sys}/devices/**/usb[0-9]**/descriptors r,
+ @{sys}/devices/**/usb[0-9]**/devnum r,
+ @{sys}/devices/**/usb[0-9]**/speed r,
+ @{sys}/devices/**/usb[0-9]**/manufacturer r,
+ @{sys}/devices/**/usb[0-9]**/product r,
+ @{sys}/devices/**/usb[0-9]**/serial r,
+ # Needed for --tree
+ @{sys}/devices/**/usb[0-9]**/bAlternateSetting r,
+ @{sys}/devices/**/usb[0-9]**/bInterfaceClass r,
+ @{sys}/devices/**/usb[0-9]**/bInterfaceNumber r,
+ @{sys}/devices/**/usb[0-9]**/bInterfaceProtocol r,
+ @{sys}/devices/**/usb[0-9]**/bInterfaceSubClass r,
+ @{sys}/devices/**/usb[0-9]**/bNumEndpoints r,
+ @{sys}/devices/**/usb[0-9]**/bConfigurationValue r,
+ @{sys}/devices/**/usb[0-9]**/bDeviceClass r,
+ @{sys}/devices/**/usb[0-9]**/bDeviceProtocol r,
+ @{sys}/devices/**/usb[0-9]**/bDeviceSubClass r,
+ @{sys}/devices/**/usb[0-9]**/bMaxPacketSize0 r,
+ @{sys}/devices/**/usb[0-9]**/bNumConfigurations r,
+ @{sys}/devices/**/usb[0-9]**/bNumInterfaces r,
+ @{sys}/devices/**/usb[0-9]**/bcdDevice r,
+ @{sys}/devices/**/usb[0-9]**/bmAttributes r,
+ @{sys}/devices/**/usb[0-9]**/configuration r,
+ @{sys}/devices/**/usb[0-9]**/idProduct r,
+ @{sys}/devices/**/usb[0-9]**/idVendor r,
+ @{sys}/devices/**/usb[0-9]**/maxchild r,
+ @{sys}/devices/**/usb[0-9]**/rx_lanes r,
+ @{sys}/devices/**/usb[0-9]**/tx_lanes r,
+ # Needed for --tree -v
+ @{sys}/devices/**/usb[0-9]**/bMaxPower r,
+ @{sys}/devices/**/usb[0-9]**/version r,
+
+ include if exists <local/lsusb>
+}
+