HID: logitech-hidpp: Add support for newer Bluetooth keyboards
Subsystems (26)
Sasha Levin
maintainerPATCH 1/1 KVM: VMX: introduce module parameter to disable CET
In reply to Sasha LevinFrom: Paolo Bonzini <[email protected]>
[ Upstream commit 2d5d3fc593c9b7e41bee86175d7b9e11f470072e ]
There have been reports of host hangs caused by CET virtualization. Until these are analyzed further, introduce a module parameter that makes it possible to easily disable it.
---
LLM Generated explanations, may be completely bogus:
## Phase 1: Commit Message Forensics
Step 1.1 Record: subsystem KVM: VMX; action verb introduce; summary:
add a VMX module parameter to disable CET virtualization.
Step 1.2 Record: tags present:
- Link: https://lore.kernel.org/all/85548beb-1486-40f9-beb4- [email protected]/
- Cc: David Riley <[email protected]>
- Signed-off-by: Paolo Bonzini <[email protected]>
- No Fixes: tag.
- No Reported-by: or Tested-by: tag in the commit itself.
Step 1.3 Record: the commit says CET virtualization has caused host hangs, and the parameter is a mitigation while the reports are analyzed. The linked report describes Windows Server 2026 with VBS/HVCI on an Intel Xeon Gold 6426Y hanging in early boot with watchdog hard/soft lockups on the host. The root cause is not identified in the commit or linked report.
Step 1.4 Record: this is a real bug workaround, not a hidden resource/lifetime fix. It does not fix the underlying CET bug by default; it gives affected administrators a supported way to disable the problematic VMX CET virtualization path.
## Phase 2: Diff Analysis
Step 2.1 Record: files changed:
- arch/x86/kvm/vmx/capabilities.h: +1 extern declaration.
- arch/x86/kvm/vmx/vmx.c: +15/-2.
- Total: 2 files, 16 insertions, 2 deletions.
- Functions modified: vmx_set_constant_host_state(), vmx_get_initial_vmentry_ctrl(), vmx_get_initial_vmexit_ctrl(), vmx_set_cpu_caps(), vmx_hardware_setup().
- Scope: small, VMX-only, surgical change.
Step 2.2 Record:
- New global enable_cet defaults to true and is exposed via module_param_named(cet, enable_cet, bool, 0444).
- vmx_set_constant_host_state() used raw hardware support via cpu_has_load_cet_ctrl(); after the patch it uses enable_cet, so disabling CET also avoids programming host CET VMCS fields.
- vmx_get_initial_vmentry_ctrl() and vmx_get_initial_vmexit_ctrl() now clear CET load controls when disabled.
- vmx_set_cpu_caps() now hides guest SHSTK/IBT when enable_cet is false.
- vmx_hardware_setup() clears enable_cet if hardware lacks CET VM- entry support, preserving the old hardware-gating behavior.
Step 2.3 Record: bug category is operational workaround for severe KVM host hang. Mechanism: disable advertising and using VMX CET virtualization state through one read-mostly knob; no locking, refcounting, memory safety, or endian change.
Step 2.4 Record: fix quality is good for a mitigation. It is small and internally consistent. Regression risk is low because default behavior remains enabled, and disabled behavior only applies when the administrator opts out. Main concern: it adds a new module parameter, which is normally disfavored for stable, but here it is an opt-out for a verified host lockup regression.
## Phase 3: Git History Investigation
Step 3.1 Record: blame shows the CET-specific host VMCS state came from 584ba3ffb984 (KVM: VMX: Set host constant supervisor states to VMCS fields), and guest CET advertising came from e140467bbdaf (`KVM: x86:
Enable CET virtualization for VMX and advertise to userspace). git describe --contains` places both in the v6.18 development window.
Step 3.2 Record: no Fixes: tag is present, so there was no tagged introducing commit to follow. The relevant introducing commits were identified by blame and subject search instead.
Step 3.3 Record: recent file history shows CET virtualization and later KVM VMX changes in the same area, but this candidate is standalone. No prerequisite beyond existing VMX CET virtualization support was found.
Step 3.4 Record: Paolo Bonzini authored and committed this patch. MAINTAINERS lists Paolo as maintainer for both KERNEL VIRTUAL MACHINE (KVM) and KERNEL VIRTUAL MACHINE FOR X86 (KVM/x86).
Step 3.5 Record: dependencies are the CET virtualization infrastructure, especially VM_ENTRY_LOAD_CET_STATE, VM_EXIT_LOAD_CET_STATE, and cpu_has_load_cet_ctrl(). Those exist in local pending-6.18, pending-6.19, and pending-7.0. The patch applies cleanly to all three tested branches.
## Phase 4: Mailing List And External Research
Step 4.1 Record: b4 dig -c 2d5d3fc593c9... found the submission at https://patch.msgid.link/[email protected]. b4 dig -a showed a standalone v1 patch and also associated it with the MBEC/GMET series thread referenced by the bug report. No formal v2 was found.
Step 4.2 Record: b4 dig -w showed the original recipients: Paolo Bonzini, [email protected], [email protected], and David Riley. Sean Christopherson replied in review; MAINTAINERS confirms Sean is a KVM/x86 maintainer.
Step 4.3 Record: the linked report from David Riley documents Intel host hard/soft lockups and guest boot hangs with Windows Server 2026, VBS/HVCI, and -cpu host,level=30,+vmx-mbec. The same report says disabling cet-ss and cet-ibt in QEMU let the Intel guest boot.
Step 4.4 Record: review feedback from Sean objected to an initial vmcs12.c hunk because cpu_has_vmcs12_field() checks raw CPU support, not enabled KVM policy. Paolo agreed to remove that hunk, and the committed diff no longer modifies vmcs12.c.
Step 4.5 Record: web search did not find stable-list discussion for this specific patch or bug. Lore WebFetch was blocked by Anubis, but b4 successfully retrieved the relevant patch and bug-report messages.
## Phase 5: Code Semantic Analysis
Step 5.1 Record: modified functions: vmx_set_constant_host_state(), vmx_get_initial_vmentry_ctrl(), vmx_get_initial_vmexit_ctrl(), vmx_set_cpu_caps(), vmx_hardware_setup().
Step 5.2 Record: callers:
- vmx_set_constant_host_state() is called from VMCS initialization in vmx.c and from nested VMCS02 constant-state setup in nested.c.
- vmx_get_initial_vmentry_ctrl() and vmx_get_initial_vmexit_ctrl() are used during VMCS initialization.
- vmx_set_cpu_caps() is called from vmx_hardware_setup().
- vmx_hardware_setup() is called from vt_hardware_setup() in arch/x86/kvm/vmx/main.c.
Step 5.3 Record: key callees include vmcs_writel(), vm_exit_controls_set(), vm_entry_controls_set(), kvm_cpu_cap_clear(), and cpu_has_load_cet_ctrl(). These show the patch affects VMCS setup and guest CPUID exposure.
Step 5.4 Record: the affected path is reachable through KVM module setup and VM/vCPU creation, then guest execution. The linked report confirms practical reachability via QEMU launching a Windows guest.
Step 5.5 Record: similar patterns exist for other VMX feature toggles such as enable_ept, enable_vpid, enable_pml, and enable_unrestricted_guest, so the implementation follows existing VMX module-parameter style.
## Phase 6: Stable Tree Analysis
Step 6.1 Record: CET virtualization support was introduced for v6.18-era kernels. Local pending-6.18, pending-6.19, and pending-7.0 all contain the relevant CET code and lack enable_cet.
Step 6.2 Record: exact upstream diff applies cleanly to temporary worktrees for pending-6.18, pending-6.19, and pending-7.0. Backport difficulty is clean apply for those tested trees.
Step 6.3 Record: local history search found no separate fix for “host hangs caused by CET virtualization” or the Windows Server 2026 report. No replacement fix was identified.
## Phase 7: Subsystem And Maintainer Context
Step 7.1 Record: subsystem is KVM/x86 VMX, criticality IMPORTANT to CORE for hosts running Intel KVM virtualization. Failure affects host stability, not only guest functionality.
Step 7.2 Record: KVM/x86 VMX is highly active in this tree. CET virtualization was a recent large feature, introduced around v6.18, so this is a mitigation for a recent virtualization regression surface.
## Phase 8: Impact And Risk Assessment
Step 8.1 Record: affected users are Intel KVM hosts exposing CET virtualization to guests. The verified report involves Windows Server 2026 with VBS/HVCI and QEMU CPU settings exposing CET/MBEC.
Step 8.2 Record: trigger conditions verified from the report: booting the Windows guest with CET and MBEC exposed. Unprivileged local triggerability was not verified; this appears to require VM launch/configuration control.
Step 8.3 Record: failure mode is severe: guest hang plus host watchdog hard lockup and soft lockup. Severity: CRITICAL.
Step 8.4 Record: benefit is high for affected stable users because it gives a practical mitigation for host lockups. Risk is low-medium: small VMX-only patch and default behavior unchanged, but it does add a new module parameter.
## Phase 9: Final Synthesis
Step 9.1 Record:
- Evidence for backporting: verified host hard/soft lockups; small contained VMX-only patch; authored by KVM maintainer; reviewed on KVM list with maintainer feedback incorporated; applies cleanly to affected local stable branches; default behavior unchanged.
- Evidence against backporting: it is a workaround, not a root-cause fix; it adds a new module parameter, which stable normally treats cautiously; users must opt in to the mitigation by disabling CET.
- Unresolved: exact root cause of the CET hang is not identified; no stable-list discussion was found.
Step 9.2 Stable rules:
1. Obviously correct and tested? Mostly yes: simple gating of existing CET controls; mailing-list review fixed an inconsistency. No explicit Tested-by on this patch.
2. Fixes a real bug affecting users? Yes: linked report shows host lockups and guest hangs.
3. Important issue? Yes: host hard/soft lockups are critical.
4. Small and contained? Yes: 2 files, 16 insertions, 2 deletions.
5. No new features or APIs? Concern: it adds a module parameter. Mitigating factor: default behavior is unchanged and the parameter is an opt-out for a serious regression.
6. Can apply to stable trees? Yes for tested pending-6.18, pending-6.19, and pending-7.0.
Step 9.3 Record: no automatic exception category like device ID or hardware quirk. The closest category is a conservative operational workaround for broken hardware/feature behavior.
Step 9.4 Decision: backport to stable trees that already contain VMX CET virtualization, especially v6.18 and newer. Despite the module parameter concern, the benefit of giving stable users a low-risk escape hatch from verified host lockups outweighs the risk, and the default behavior is unchanged.
## Verification
- [Phase 1] Parsed git show --format=fuller --stat --patch 2d5d3fc593c9...: confirmed subject, body, tags, author, and exact diff.
- [Phase 2] Diff analysis: confirmed 2 files, 16 insertions, 2 deletions, VMX-only gating of CET controls and CPUID exposure.
- [Phase 3] git blame around changed areas: identified CET code from 584ba3ffb984 and e140467bbdaf.
- [Phase 3] git describe --contains: confirmed CET support is v6.18-era and candidate is v7.1-rc4-era.
- [Phase 3] MAINTAINERS search: confirmed Paolo Bonzini and Sean Christopherson are KVM/x86 maintainers.
- [Phase 4] b4 dig -c: found patch submission at [email protected].
- [Phase 4] b4 dig -a: found standalone v1 and related MBEC/GMET series context.
- [Phase 4] b4 dig -w: confirmed KVM and LKML recipients plus David Riley.
- [Phase 4] b4 mbox: confirmed Sean’s review concern and Paolo’s agreement to remove the vmcs12.c hunk; committed patch matches that resolution.
- [Phase 4] b4 mbox --single-message: retrieved David Riley’s bug report with Intel host lockups and guest hangs.
- [Phase 5] rg caller search: traced modified functions to VMX hardware setup, VMCS initialization, and nested VMCS02 setup.
- [Phase 6] git grep on pending-6.18, pending-6.19, and pending-7.0: confirmed CET code exists and enable_cet does not.
- [Phase 6] Temporary worktree git apply --check: exact patch applies cleanly to pending-6.18, pending-6.19, and pending-7.0.
- [Phase 8] Failure mode verified from bug report: watchdog hard lockup and soft lockup on host, plus guest early boot hang.
- UNVERIFIED: underlying root cause of the CET virtualization hang remains unknown.
- UNVERIFIED: no exhaustive stable-list archive proof beyond web search; no stable-specific discussion was found.
**YES**
arch/x86/kvm/vmx/capabilities.h | 1 + arch/x86/kvm/vmx/vmx.c | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-)
arch/x86/kvm/vmx/capabilities.h +1 -0
@@ -14,6 +14,7 @@ extern bool __read_mostly flexpriority_enabled;extern bool __read_mostly enable_ept;extern bool __read_mostly enable_unrestricted_guest;extern bool __read_mostly enable_ept_ad_bits; +extern bool __read_mostly enable_cet;extern bool __read_mostly enable_pml;extern int __read_mostly pt_mode;
arch/x86/kvm/vmx/vmx.c +15 -2
@@ -107,6 +107,9 @@ module_param_named(unrestricted_guest,bool __read_mostly enable_ept_ad_bits =1 ;module_param_named (eptad, enable_ept_ad_bits, bool,0444 ); +bool __read_mostly enable_cet =1 ; +module_param_named (cet, enable_cet, bool,0444 ); +static bool __read_mostly emulate_invalid_guest_state = true;module_param (emulate_invalid_guest_state, bool,0444 );
@@ -4585,7 +4588,7 @@ void vmx_set_constant_host_state(struct vcpu_vmx *vmx)* SSP is reloaded from IA32_PL3_SSP. Check SDM Vol.2A/B Chapter * 3 and 4 for details. */ -if (cpu_has_load_cet_ctrl ()) { +if (enable_cet) {vmcs_writel (HOST_S_CET , kvm_host.s_cet);vmcs_writel (HOST_SSP ,0 );vmcs_writel (HOST_INTR_SSP_TABLE ,0 );
@@ -4641,6 +4644,10 @@ static u32 vmx_get_initial_vmentry_ctrl(void)if (vmx_pt_mode_is_system ()) vmentry_ctrl &= ~(VM_ENTRY_PT_CONCEAL_PIP |VM_ENTRY_LOAD_IA32_RTIT_CTL ); + +if (!enable_cet) + vmentry_ctrl &= ~VM_ENTRY_LOAD_CET_STATE ; +/* * IA32e mode, and loading of EFER and PERF_GLOBAL_CTRL are toggled dynamically. */
@@ -4655,6 +4662,9 @@ static u32 vmx_get_initial_vmexit_ctrl(void) {u32 vmexit_ctrl = vmcs_config.vmexit_ctrl; +if (!enable_cet) + vmexit_ctrl &= ~VM_EXIT_LOAD_CET_STATE ; +/* * Not used by KVM and never set in vmcs01 or vmcs02, but emulated for * nested virtualization and thus allowed to be set in vmcs12.
@@ -8240,7 +8250,7 @@ static __init void vmx_set_cpu_caps(void)* VMX_BASIC[bit56] == 0, inject #CP at VMX entry with error code * fails, so disable CET in this case too. */ -if (!cpu_has_load_cet_ctrl () || !enable_unrestricted_guest || +if (!enable_cet || !enable_unrestricted_guest || !cpu_has_vmx_basic_no_hw_errcode_cc ()) {kvm_cpu_cap_clear (X86_FEATURE_SHSTK );kvm_cpu_cap_clear (X86_FEATURE_IBT );
@@ -8721,6 +8731,9 @@ __init int vmx_hardware_setup(void) !cpu_has_vmx_invept_global()) enable_ept =0 ; +if (!cpu_has_load_cet_ctrl ()) + enable_cet =0 ; +/* NX support is required for shadow paging. */ if (!enable_ept && !boot_cpu_has (X86_FEATURE_NX )) {pr_err_ratelimited ("NX (Execute Disable) not supported\n" );
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 iommu/amd: Use maximum Event log buffer size when SNP is enabled on Family 0x19
In reply to Sasha LevinFrom: Vasant Hegde <[email protected]>
[ Upstream commit 58c0ac6125d89bf6ec65a521eaeb52a0e8e20a9f ]
Due to CVE-2023-20585, the Event log buffer must use the maximum supported size (512K) on Milan/Genoa (Family 0x19) systems when SNP is enabled, to mitigate a potential security vulnerability. All other systems continue to use the default Event log buffer size (8K).
Apply the errata fix by making the following changes:
* Introduce new global variable (amd_iommu_evtlog_size) to have event log buffer size. Adjust variable size for family 0x19.
* Since 'iommu_snp_enable()' must be called after the core IOMMU subsystem is initialized, it cannot be moved to the early init stage. The SNP errata must also be applied after the 'iommu_snp_enable()' check. Therefore, 'alloc_event_buffer()' and 'iommu_enable_event_buffer()' are now called in the IOMMU_ENABLED state, after the errata is applied.
* Adjust alloc_event_buffer() and iommu_enable_event_buffer() to handle all IOMMU instances.
* Also rename EVT_* macros to make it more readable.
---
LLM Generated explanations, may be completely bogus:
## Conclusion
This commit should be backported to stable trees that carry AMD IOMMU SNP host support. It is a security mitigation for CVE-2023-20585, scoped to AMD Family 0x19 systems with SNP enabled, and it keeps all other systems on the existing 8K event log size.
The patch is not feature enablement in the stable sense; it is a hardware erratum/security workaround. The main concern is backport
mechanics: it applies cleanly to stable/linux-7.0.y, but failed a direct apply check on 6.12.y, 6.18.y, and 6.19.y, so those need backport adjustment. For Genoa, the companion PPR-log patch should also be considered for the full series mitigation.
## Phase Walkthrough
Phase 1 Record:
- Subject subsystem/action: iommu/amd, action is “Use maximum”, intent is to use a 512K AMD IOMMU event log buffer for SNP on Family 0x19.
- Tags: Link to AMD-SB-3016, Cc to AMD/IOMMU maintainers, Signed- off-by Vasant Hegde, Tested-by Dheeraj Kumar Srivastava, Signed- off-by Joerg Roedel. No Fixes: tag.
- Body: describes CVE-2023-20585, requiring max supported event log buffer size on Milan/Genoa with SNP enabled; all other systems remain at 8K.
- Hidden bug fix: yes. This is phrased partly as buffer sizing/refactoring, but the purpose is a CVE security mitigation.
Phase 2 Record:
- Files changed: drivers/iommu/amd/amd_iommu.h, amd_iommu_types.h, init.c, iommu.c; fetched commit stat is 86 insertions, 38 deletions.
- Functions modified/added: alloc_event_buffer, iommu_enable_event_buffer, remap_event_buffer, early_enable_iommu, early_enable_iommus, amd_iommu_resume, new amd_iommu_apply_erratum_snp, state_next, amd_iommu_snp_disable, iommu_poll_events.
- Code flow: event buffer allocation/enable moves from early per-IOMMU setup to after iommu_snp_enable(), allowing the erratum decision to set 512K before allocation/programming. Polling and SNP shutdown now use the variable size.
- Bug category: hardware security erratum/workaround.
- Fix quality: contained to AMD IOMMU event-log handling. Regression risk is medium-low because init ordering changes, but it is subsystem- contained, tested, and keeps non-SNP/non-Family-0x19 behavior at 8K.
Phase 3 Record:
- Blame/history: fixed 8K event buffer logic is long-standing; SNP integration relevant to the erratum is present from the v6.9 era and later. 6.12.y, 6.18.y, 6.19.y, and 7.0.y contain the integrated SNP enable commit checked locally; 5.15.y, 6.1.y, and 6.6.y do not.
- Fixes: tag: none, so no direct original-bug commit to follow.
- Related file history: companion commit 1f44aab79bac3 does the same for the PPR log. Patch 2 depends conceptually/codewise on patch 1; patch 1 stands on its own for the event log.
- Author context: Vasant Hegde has multiple recent AMD IOMMU fixes in the fetched IOMMU fixes branch; Joerg Roedel committed the patch.
- Dependencies: no semantic dependency on the NUMA log-buffer allocation commit, but older stable branches have context differences requiring backport edits.
Phase 4 Record:
- b4 dig -c 58c0ac6125d89: found the original lore submission at http s://patch.msgid.link/[email protected].
- b4 dig -a: only v1 found.
- b4 dig -w: original recipients included [email protected], Joerg Roedel, Will Deacon, Robin Murphy, Suravee Suthikulpanit, and Borislav Petkov.
- Lore thread: Dheeraj Kumar Srivastava replied Tested-by; Joerg Roedel replied “Applied to fixes”.
- AMD bulletin: AMD-SB-3016 confirms potential SNP guest integrity loss from an IOMMU host buffer out-of-bounds condition and says OS updates are required along with firmware.
Phase 5 Record:
- Callers: event interrupt path uses amd_iommu_int_thread_evtlog() -> amd_iommu_handle_irq() -> iommu_poll_events(). Interrupt setup is via AMD IOMMU MSI/INTCAPXT setup in init.c.
- Callees: allocation uses iommu_alloc_4k_pages(), which handles SNP 4K page setup; enable writes MMIO_EVT_BUF_OFFSET, head/tail registers, and CONTROL_EVT_LOG_EN.
- Reachability: reachable on AMD IOMMU systems through hardware event interrupts and SNP init/shutdown paths, not through a direct userspace syscall.
- Similar pattern: companion PPR log patch in the same series mirrors the variable-size/max-buffer handling.
Phase 6 Record:
- Stable code existence: 6.12.y, 6.18.y, 6.19.y, and 7.0.y have the relevant AMD IOMMU SNP/event-log code. 5.15.y, 6.1.y, and 6.6.y lack the integrated SNP enable commit I checked; 6.6.y has an exported old SNP enable function but no in-tree caller was found.
- Backport difficulty: clean on 7.0.y; direct apply failed on 6.12.y, 6.18.y, and 6.19.y, so those need manual backporting.
- Related stable discussion: no stable-list-specific discussion for this CVE/patch was found by lei.
Phase 7 Record:
- Subsystem: AMD IOMMU driver under drivers/iommu/amd.
- Criticality: important platform/virtualization security code, affecting AMD EPYC SNP hosts rather than all systems.
- Activity: actively maintained; recent AMD IOMMU fixes and the maintainer-applied fixes branch confirm ongoing subsystem work.
Phase 8 Record:
- Affected users: AMD Family 0x19 Milan/Genoa systems with SNP enabled.
- Trigger/security conditions: AMD bulletin describes a privileged attacker with a compromised hypervisor triggering an out-of-bounds condition without RMP checks.
- Failure severity: security integrity impact for confidential SNP guests; AMD rates it Medium, but stable rules treat CVE/security mitigations as strong candidates.
- Benefit/risk: high benefit for affected SNP hosts; medium-low regression risk due to contained but non-trivial init-order and buffer-size changes.
Phase 9 Record:
- Evidence for: CVE/security mitigation, AMD bulletin requires OS update, tested-by, maintainer applied to fixes, scoped to AMD IOMMU, default behavior preserved for unaffected systems.
- Evidence against/concerns: patch is larger than a trivial one-liner, moves event buffer allocation/enable timing, and needs backport adjustments for several stable branches. Genoa full mitigation also needs the PPR companion patch.
- Stable rules: fixes a real security issue; important; no new userspace API; contained to one driver; tested; applies cleanly to 7.0.y and can be backported with adjustments elsewhere.
- Exception category: hardware erratum/security workaround.
## Verification
- [Phase 1] Parsed fetched commit 58c0ac6125d89: confirmed subject, tags, Tested-by, no Fixes:, and AMD-SB-3016 link.
- [Phase 2] Inspected diff/stat from fetched commit: 4 AMD IOMMU files, 86 insertions, 38 deletions.
- [Phase 3] Ran git blame on event allocation, enable, SNP init, and polling paths; confirmed relevant code history.
- [Phase 3] Checked stable branch ancestry: 6.12.y+ contain integrated SNP enable; 5.15.y, 6.1.y, 6.6.y do not.
- [Phase 4] Ran b4 dig -c 58c0ac6125d89, -a, and -w; found one v1 submission, maintainers/recipients, and lore URL.
- [Phase 4] Fetched lore thread; confirmed Tested-by reply and maintainer “Applied to fixes”.
- [Phase 4] Fetched AMD bulletin; confirmed CVE impact and OS update requirement.
- [Phase 5] Traced event interrupt call path with source search/read:
amd_iommu_int_thread_evtlog() to iommu_poll_events().
- [Phase 6] Ran apply checks: clean on stable/linux-7.0.y; failed direct apply on 6.12.y, 6.18.y, and 6.19.y.
- UNVERIFIED: I did not build-test the backport or test on AMD Family 0x19 SNP hardware.
**YES**
drivers/iommu/amd/amd_iommu.h | 2 + drivers/iommu/amd/amd_iommu_types.h | 10 ++- drivers/iommu/amd/init.c | 110 +++++++++++++++++++--------- drivers/iommu/amd/iommu.c | 2 +- 4 files changed, 86 insertions(+), 38 deletions(-)
drivers/iommu/amd/amd_iommu.h +2 -0
@@ -11,6 +11,8 @@#include "amd_iommu_types.h" +extern int amd_iommu_evtlog_size; +irqreturn_t amd_iommu_int_thread (int irq,void *data);irqreturn_t amd_iommu_int_thread_evtlog (int irq,void *data);irqreturn_t amd_iommu_int_thread_pprlog (int irq,void *data);
drivers/iommu/amd/amd_iommu_types.h +7 -3
@@ -15,6 +15,7 @@#include <linux/mutex.h> #include <linux/msi.h> #include <linux/list.h> +#include <linux/sizes.h> #include <linux/spinlock.h> #include <linux/pci.h> #include <linux/iommufd.h>
@@ -141,7 +142,6 @@#define MMIO_STATUS_GALOG_INT_MASK BIT(10)/* event logging constants */ -#define EVENT_ENTRY_SIZE 0x10#define EVENT_TYPE_SHIFT 28#define EVENT_TYPE_MASK 0xf#define EVENT_TYPE_ILL_DEV 0x1
@@ -259,8 +259,12 @@#define MMIO_CMD_BUFFER_TAIL (x) FIELD_GET(MMIO_CMD_TAIL_MASK, (x))/* constants for event buffer handling */ -#define EVT_BUFFER_SIZE 8192/* 512 entries */ -#define EVT_LEN_MASK (0x9ULL << 56) +#define EVTLOG_ENTRY_SIZE 0x10 +#define EVTLOG_SIZE_SHIFT 56 +#define EVTLOG_SIZE_DEF SZ_8K/* 512 entries */ +#define EVTLOG_LEN_MASK_DEF (0x9ULL << EVTLOG_SIZE_SHIFT) +#define EVTLOG_SIZE_MAX SZ_512K/* 32K entries */ +#define EVTLOG_LEN_MASK_MAX (0xFULL << EVTLOG_SIZE_SHIFT)/* Constants for PPR Log handling */ #define PPR_LOG_ENTRIES 512
drivers/iommu/amd/init.c +76 -34
191 lines not on this page · raw message
drivers/iommu/amd/iommu.c +1 -1
@@ -1009,7 +1009,7 @@ static void iommu_poll_events(struct amd_iommu *iommu)iommu_print_event (iommu, iommu->evt_buf + head);/* Update head pointer of hardware ring-buffer */ - head = (head +EVENT_ENTRY_SIZE ) %EVT_BUFFER_SIZE ; + head = (head +EVTLOG_ENTRY_SIZE ) % amd_iommu_evtlog_size;writel (head, iommu->mmio_base +MMIO_EVT_HEAD_OFFSET ); }
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 ALSA: usb-audio: add clock quirk for Motu 1248
In reply to Sasha LevinFrom: Nicola Lunghi <[email protected]>
[ Upstream commit 320e55722ca466a7d40dd69e1aea982cb6189006 ]
The Motu 1248 (and probably other older Motu AVB interfaces) take more than 2 seconds to switch clock. During the clock switching process the device return that the clock is not valid. This is similar to what already implemented for the Microbook II interface. Add the Motu 1248 usb id to the existing Motu quirk.
---
LLM Generated explanations, may be completely bogus:
## Phase Walkthrough
Phase 1:
- Record 1.1: Subsystem ALSA: usb-audio; action verb add; intent is to add Motu 1248 USB ID 07fd:0005 to an existing clock-validity delay quirk.
- Record 1.2: Tags: Signed-off-by: Nicola Lunghi, `Link:
https://patch.msgid.link/[email protected]`,
Signed-off-by: Takashi Iwai. No Fixes:, Reported-by:, Tested- by:, Reviewed-by:, or Cc: stable.
- Record 1.3: Commit body describes Motu 1248 returning clock-invalid for more than 2 seconds while switching clock, causing the existing ALSA clock validation to fail too early. No kernel-version range given.
- Record 1.4: This is a hardware quirk fix, not a hidden memory/synchronization bug.
Phase 2:
- Record 2.1: One file changed: sound/usb/clock.c, +11/-4. Modified
function: uac_clock_source_is_valid_quirk(). Single-file surgical hardware quirk.
- Record 2.2: Before: the 5-second retry loop applied only to USB_ID(0x07fd, 0x0004). After: the same loop also applies to USB_ID(0x07fd, 0x0005), with comments expanded.
- Record 2.3: Bug category is hardware workaround/device quirk.
Mechanism: ALSA rechecks clock validity up to 50 times with msleep(100) instead of failing on the initial transient invalid response.
- Record 2.4: Fix quality is high: it reuses existing code and only widens the device match. Regression risk is very low and limited to MOTU product ID 0x0005.
Phase 3:
- Record 3.1: git blame shows the existing MOTU retry quirk was introduced by 2edb84e3047b9 in 2020. Later nearby changes came from clock refactoring and multi-control-interface support, but the retry logic remains the same.
- Record 3.2: No Fixes: tag, so no introducing commit to follow.
- Record 3.3: Recent sound/usb/clock.c history shows related clock fixes/refactors, but this patch is standalone and only changes the device match.
- Record 3.4: Author has prior usb-audio quirk commits in local history; Takashi Iwai applied the patch and is the ALSA maintainer/committer for this area.
- Record 3.5: No functional dependencies found. The patch applies cleanly to checked pending stable branches.
Phase 4:
- Record 4.1: b4 dig -c 320e55722ca46 found the original submission at the patch.msgid.link URL. b4 dig -a showed only v1; no newer revision found.
- Record 4.2: b4 dig -w showed Nicola Lunghi, Jaroslav Kysela, Takashi Iwai, linux-sound, linux-kernel, and linux-usb were included.
- Record 4.3: b4 mbox showed Takashi replied “Applied now. Thanks.” No objections or review concerns appeared in the two-message thread. WebFetch of lore was blocked by Anubis.
- Record 4.4: No multi-patch series or related required patches found.
- Record 4.5: Stable-list web search was blocked by Anubis; no stable- specific discussion was found through the available local/b4 data.
Phase 5:
- Record 5.1: Key function: uac_clock_source_is_valid_quirk().
- Record 5.2: Call path verified: uac_clock_source_is_valid() calls the quirk when the device reports invalid clock; __uac_clock_find_source() and set_sample_rate_v2v3() call clock validation; setup is reached from format parsing, stream setup, endpoint preparation, and sample-rate initialization.
- Record 5.3: Key callees are snd_usb_ctl_msg(), snd_usb_find_ctrl_interface(), snd_usb_find_clock_source(), and msleep(100).
- Record 5.4: Reachability is real for users of affected USB audio devices during sample-rate/clock setup and PCM endpoint preparation.
- Record 5.5: Similar existing pattern is the MicroBook IIc quirk for the same vendor and same delayed clock-validity behavior.
Phase 6:
- Record 6.1: The existing quirk code exists in checked pending stable branches pending-5.4, pending-5.10, pending-5.15, pending-6.1, pending-6.6, pending-6.12, and pending-7.0.
- Record 6.2: Backport difficulty is clean: git apply --check succeeded on all those pending branches.
- Record 6.3: No alternative Motu 1248 fix was found in local stable/current history.
Phase 7:
- Record 7.1: Subsystem is ALSA USB audio driver. Criticality: IMPORTANT for users of affected MOTU hardware, not core-wide.
- Record 7.2: Subsystem is active; recent history contains multiple usb- audio fixes and quirks.
Phase 8:
- Record 8.1: Affected users are driver/hardware-specific: Motu 1248 and likely related older MOTU AVB/hybrid devices with product ID 0x0005.
- Record 8.2: Trigger is changing sample rate or clock source, or validation during device/audio setup. Unprivileged trigger depends on local audio-device permissions; I did not verify distro policy.
- Record 8.3: Failure mode is ALSA failing clock validation early, returning errors such as -ENXIO from the code path and preventing successful audio setup. Severity: MEDIUM for the kernel generally, HIGH for affected hardware usability.
- Record 8.4: Benefit is high for affected hardware; risk is very low because this only enables an existing quirk for one USB product ID.
Phase 9:
- Record 9.1: Evidence for backporting: real hardware quirk, existing stable-accepted mechanism, small single-file change, maintainer- applied, cleanly applies to stable branches, external CCRMA documentation corroborates MOTU 1248 Linux sample-rate failures that succeed after waiting. Evidence against: no crash/security/data- corruption, no explicit stable tag, and no direct reporter/tested-by tag.
- Record 9.2: Stable rules: obviously correct yes; fixes real user- visible hardware failure yes; important enough under hardware-quirk exception yes; small/contained yes; no new API/features yes; applies cleanly yes.
- Record 9.3: Exception category: hardware quirk/workaround for broken device timing behavior.
- Record 9.4: Decision: backport. This is exactly the kind of low-risk device-specific quirk stable trees routinely take.
## Verification
- Phase 1: Parsed commit 320e55722ca46 with git show --format=fuller; verified tags and message.
- Phase 2: Verified diff with git show --find-renames and --numstat:
sound/usb/clock.c, +11/-4.
- Phase 3: Ran git blame -L 179,240 -- sound/usb/clock.c; identified existing quirk origin 2edb84e3047b9.
- Phase 3: Checked recent file history with git log --oneline -20 -- sound/usb/clock.c.
- Phase 4: Ran b4 dig -c 320e55722ca46, -a, and -w; confirmed v1 patch, recipients, and lore URL.
- Phase 4: Ran b4 mbox; confirmed Takashi’s “Applied now” reply and no objections in the fetched thread.
- Phase 5: Used rg and file reads to trace callers through clock.c, format.c, endpoint.c, stream.c, and quirks.c.
- Phase 6: Checked quirk presence in pending stable branches and verified git apply --check cleanly on pending-5.4, pending-5.10, pending-5.15, pending-6.1, pending-6.6, pending-6.12, and pending-7.0.
- Phase 8: Used WebFetch of CCRMA MOTU 1248 documentation; it reports Linux output/sample-rate attempts may fail initially and succeed after 5-10 seconds.
- UNVERIFIED: Exact USB ID mapping for every model listed in the new comment beyond the commit’s own statement.
**YES**
sound/usb/clock.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
sound/usb/clock.c +11 -4
@@ -208,11 +208,18 @@ static bool uac_clock_source_is_valid_quirk(struct snd_usb_audio *chip, }/* -* MOTU MicroBook IIc -* Sample rate changes takes more than 2 seconds for this device. Clock -* validity request returns false during that period. +* Quirk for older MOTU AVB / hybrid interfaces +* +* These devices take more than 2 seconds to switch sample rate or +* clock source. During this period the clock validity request +* returns false, causing ALSA to fail prematurely. +* +* Affected models (all use vendor 0x07fd): +* - MicroBook IIc → 0x0004 +* - 1248, 624, 8A, UltraLite AVB, 8M, 16A, ... → 0x0005 */ -if (chip->usb_id ==USB_ID (0x07fd ,0x0004 )) { +if (chip->usb_id ==USB_ID (0x07fd ,0x0004 ) ||/* MicroBook IIc */ + chip->usb_id ==USB_ID (0x07fd ,0x0005 )) {/* 1248 / 624 / 8A / UltraLite AVB / ... */ count =0 ;while ((!ret) && (count <50 )) {
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 workqueue: Release PENDING in __queue_work() drain/destroy reject path
In reply to Sasha LevinFrom: Breno Leitao <[email protected]>
[ Upstream commit a7488f089bdfa87c4fef1744d4dca9f4f8b46f8b ]
The caller of __queue_work() owns WORK_STRUCT_PENDING, won via test_and_set_bit() in queue_work_on()/__queue_delayed_work(). The state machine documented above __queue_work() requires that owner to either hand the token to a pwq (insert_work() -> set_work_pwq()), hand it to a timer, or release it via set_work_pool_and_clear_pending(). try_to_grab_pending() relies on this: when it observes "PENDING && off-queue" it busy-loops, trusting the current owner to make progress.
The (__WQ_DESTROYING | __WQ_DRAINING) early-return path violates that contract. It WARN_ONCE()s and bare-returns, leaving work->data with PENDING set, WORK_STRUCT_PWQ clear, and work->entry empty.
The path is reachable without explicit API abuse: queue_delayed_work() arms a timer with PENDING set; if drain_workqueue() runs while the timer is still pending, delayed_work_timer_fn() -> __queue_work() in softirq context hits the WARN, current is not a wq worker so is_chained_work() is false, and the work is silently dropped with PENDING leaked.
Mirror what clear_pending_if_disabled() already does on its analogous reject path: unpack the off-queue data and call set_work_pool_and_clear_pending() to release the token before returning.
I was able to reproduce this by queueing several slow works on a max_active=1 wq, arm a delayed_work whose timer fires while drain_workqueue() is blocked, then call cancel_delayed_work_sync(). Without this patch the cancel livelocks at 100% CPU; with it the cancel returns immediately.
---
LLM Generated explanations, may be completely bogus:
## Phase Walkthrough
### Phase 1: Commit Message Forensics
Record 1.1: Subsystem workqueue; action verb Release; intent: clear WORK_STRUCT_PENDING when __queue_work() rejects work during drain/destroy.
Record 1.2: Commit tags: Signed-off-by: Breno Leitao <[email protected]> and Signed-off-by: Tejun Heo <[email protected]>. No committed Fixes:, Reported-by:, Tested-by:, Reviewed-by:, Acked-by:, Link:, or Cc: [email protected].
Record 1.3: The body describes a real state-machine bug:__queue_work() may return from the __WQ_DESTROYING | __WQ_DRAINING reject path with PENDING still set while the work is off-queue. try_to_grab_pending() then sees PENDING && off-queue and busy- retries. The verified failure mode is cancel_delayed_work_sync() livelocking at 100% CPU after a delayed timer fires during drain_workqueue().
Record 1.4: This is not a hidden cleanup; it is an explicit correctness fix for a leaked pending token causing livelock.
### Phase 2: Diff Analysis
Record 2.1: One file changed: kernel/workqueue.c, 12 insertions. One function changed: __queue_work(). Scope: single-file surgical core workqueue fix.
Record 2.2: Before: reject path warned and returned directly. After:
reject path unpacks off-queue work data and calls set_work_pool_and_clear_pending() before returning.
Record 2.3: Bug category: workqueue state-machine/token leak with a race between delayed-work timer execution and draining/destroying a workqueue. Mechanism: queued delayed work owns PENDING; timer callback enters __queue_work(); reject path drops the work but did not release PENDING.
Record 2.4: Fix quality is high. It mirrors the existing clear_pending_if_disabled() pattern in the same file and does not add an API or change normal queueing behavior. Regression risk is low; the change is limited to an already-rejecting path.
### Phase 3: Git History
Record 3.1: git blame shows the PENDING/off-queue busy-loop contract comment came from 8930caba3dbd; the drain reject mechanism is rooted in 9c5a2ba70251 (v3.1), and the destroy-side diagnostic flag came from 33e3f0a3358b (v6.3). The bare reject return traces back to e41e704bc4f4 (v2.6.36-rc4 era).
Record 3.2: No committed Fixes: tag. I inspected the patch-thread note suggesting e41e704bc4f4; that commit added the “warn and ignore” dying-workqueue behavior.
Record 3.3: Recent kernel/workqueue.c history shows nearby independent workqueue fixes and diagnostics; this patch is standalone, not a multi- patch series dependency.
Record 3.4: Breno Leitao has multiple recent workqueue commits in origin/master; Tejun Heo, the workqueue maintainer, committed this patch.
Record 3.5: Dependencies: conceptually standalone. Exact patch applies cleanly to v6.18.32, v6.19.14, v7.0, and v7.0.9; older trees need small backport adjustment because helper APIs and warning text differ.
### Phase 4: Mailing List / External Research
Record 4.1: b4 dig -c a7488f089bdfa found the original thread: `https:
//patch.msgid.link/20260507-workqueue_pending-v1-1- [email protected]`. Series revisions: v1 only.
Record 4.2: Original recipients included Breno Leitao, Tejun Heo, Lai Jiangshan, [email protected], [email protected], and kernel- [email protected]. Tejun replied that it was applied to wq/for-7.1-fixes.
Record 4.3: No external bug report or syzbot link in this commit. The bug report evidence is the author’s concrete reproducer in the commit/thread.
Record 4.4: No related patch series found; b4 reports a single-patch v1.
Record 4.5: Web search found no stable-specific discussion for this exact patch. Lore WebFetch was blocked by Anubis, but b4 successfully fetched the mbox.
### Phase 5: Code Semantic Analysis
Record 5.1: Modified function: __queue_work().
Record 5.2: Callers verified in kernel/workqueue.c: queue_work_on(), queue_work_node(), delayed_work_timer_fn(), zero-delay __queue_delayed_work(), rcu_work_rcufn(), and requeue paths. The relevant caller is delayed_work_timer_fn().
Record 5.3: Key callees: is_chained_work(), work_offqd_unpack(), set_work_pool_and_clear_pending(), and, on non-reject paths, pool selection plus insert_work().
Record 5.4: Verified call chain: queue_delayed_work_on() sets PENDING; __queue_delayed_work() arms the timer; delayed_work_timer_fn() calls __queue_work(); drain_workqueue() sets __WQ_DRAINING; cancel_delayed_work_sync() reaches try_to_grab_pending() through work_grab_pending() and can spin on -EAGAIN. Direct unprivileged trigger was not verified.
Record 5.5: Similar in-tree pattern verified:clear_pending_if_disabled() already unpacks off-queue data and clears pending in an analogous reject path.
### Phase 6: Stable Tree Analysis
Record 6.1: The buggy drain reject path exists in checked tags from v5.4, v5.10, v5.15, v6.1, v6.6, v6.12, v6.18, v6.19, and v7.0. Drain behavior dates back to v3.1.
Record 6.2: Backport difficulty: clean for v6.18+ and v7.0; minor manual backport for v6.12; more adjustment for v6.6 and older because work_offqd_unpack()/flags helpers differ or are absent.
Record 6.3: I found no exact related fix already present by subject in checked stable branches.
### Phase 7: Subsystem Context
Record 7.1: Subsystem is core workqueue infrastructure. Criticality:
CORE, because workqueues are used throughout drivers, filesystems, networking, storage, GPU, and core kernel code.
Record 7.2: Workqueue is actively maintained, with recent commits by Breno Leitao and Tejun Heo, but the affected state machine is mature and present across long-lived stable lines.
### Phase 8: Impact / Risk
Record 8.1: Affected population: broad kernel users, but trigger- specific to users of delayed work on workqueues being drained or destroyed.
Record 8.2: Trigger: delayed-work timer fires while drain_workqueue() or destroy-time draining is active, followed by cancellation/grab of that delayed work. Commonness is workload dependent; direct unprivileged reachability was not verified.
Record 8.3: Failure mode: livelock at 100% CPU in cancel_delayed_work_sync(). Severity: HIGH, potentially CRITICAL for teardown/suspend/remove paths that must complete.
Record 8.4: Benefit high: prevents a real hang/livelock in core infrastructure. Risk low: 12-line change, reject path only, mirrors existing cleanup logic.
### Phase 9: Final Synthesis
Record 9.1: Evidence for backporting: real reproduced livelock, core subsystem, broad stable-tree presence, small fix, maintainer-applied, no new API. Evidence against: exact patch does not cleanly apply to older stable trees and lacks independent Tested-by; older trees need careful helper-specific backports. Unresolved: no independent bug report found, no direct unprivileged trigger verified.
Record 9.2: Stable rules: obviously correct and self-tested: yes; fixes real bug: yes; important issue: yes, livelock/hang; small and contained:
yes, one function and 12 lines; no new features/APIs: yes; applies to
stable: clean for newer stable, minor/manual for older.
Record 9.3: No exception category applies; this is a core bug fix, not a device ID, quirk, DT, build, or documentation change.
Record 9.4: Decision: backport. The technical merit is strong: this fixes a verified workqueue livelock with a small, localized, maintainer- accepted change.
## Verification
- Phase 1: Parsed git show --format=fuller for a7488f089bdfa; confirmed tags and commit body.
- Phase 2: Inspected the diff; confirmed only kernel/workqueue.c changed with 12 insertions in __queue_work().
- Phase 3: Used git blame, git show, git describe --contains, and path-limited git log; confirmed historical origins and stable version presence.
- Phase 4: Used b4 dig -c, -a, -w, and mbox fetch; confirmed v1 patch and Tejun’s apply reply. WebFetch to lore was blocked.
- Phase 5: Used rg and ReadFile to trace callers/callees and the delayed-work/cancel path.
- Phase 6: Checked specific stable tags and ran patch apply checks in temporary worktrees; confirmed clean apply for v6.18+ and backport needs for older trees.
- Phase 7: Verified subsystem path and recent workqueue history.
- Phase 8: Verified failure mode from commit body and matching code path; unprivileged trigger remains unverified.
**YES**
kernel/workqueue.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
kernel/workqueue.c +12 -0
@@ -2281,6 +2281,18 @@ static void __queue_work(int cpu, struct workqueue_struct *wq,if (unlikely (wq->flags & (__WQ_DESTROYING | __WQ_DRAINING) &&WARN_ONCE (!is_chained_work (wq),"workqueue: cannot queue %ps on wq %s\n" , work->func, wq->name))) { +struct work_offq_data offqd; + +/* +* State on entry: PENDING is set, work is off-queue (no +* insert_work() has run). +* +* Returning without clearing PENDING would leave the work +* in a weird state (PENDING=1, PWQ=0, entry empty) +*/ +work_offqd_unpack (&offqd, *work_data_bits (work)); +set_work_pool_and_clear_pending (work, offqd.pool_id, +work_offqd_pack_flags (&offqd));return ; }rcu_read_lock ();
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 ASoC: sdw_utils: avoid the SDCA companion function not supported failure
In reply to Sasha LevinFrom: Derek Fang <[email protected]>
[ Upstream commit 56d5a9eaf60af5c824a33a83e1468aa143627a62 ]
Treat the companion amp as generic AMP until full support for companion amp is added.
---
LLM Generated explanations, may be completely bogus:
## Phase 1: Commit Message Forensics
Step 1.1 Record: subsystem ASoC: sdw_utils; action verb avoid; claimed intent is to avoid SDCA companion amp being treated as unsupported.
Step 1.2 Record: tags present:
- Signed-off-by: Derek Fang <[email protected]>
- Reviewed-by: Charles Keepax <[email protected]>
- Signed-off-by: Bard Liao <[email protected]>
- `Link: https://patch.msgid.link/20260430121043.552241-1-yung-
[email protected]`
- Signed-off-by: Mark Brown <[email protected]>
No Fixes:, Reported-by:, Tested-by:, Acked-by:, or `Cc:
[email protected]` tags were present.
Step 1.3 Record: the body says companion amps should be treated as generic amps until full companion-amp support exists. The user-visible symptom implied by the subject and code is an SDCA companion amp being classified as unsupported. No stack trace, crash, version statement, or bug report is included.
Step 1.4 Record: this is a hidden bug fix. The verb “avoid” plus the one-line mapping change fixes incorrect handling of a valid SDCA function type that was already accepted elsewhere in the SDCA code.
## Phase 2: Diff Analysis
Step 2.1 Record: one file changed, sound/soc/sdw_utils/soc_sdw_utils.c, one line added. Modified
function: asoc_sdw_get_dai_type(). Scope: single-file surgical logic fix.
Step 2.2 Record: before the patch, SDCA_FUNCTION_TYPE_COMPANION_AMP fell through to default and returned -EINVAL. After the patch, it returns SOC_SDW_DAI_TYPE_AMP, like smart and simple amp function types. This affects SDCA endpoint detection and SOF SoundWire endpoint construction paths that call asoc_sdw_get_dai_type().
Step 2.3 Record: bug category is logic/correctness plus hardware compatibility. The broken mechanism is that a valid SDCA companion amp function type was known to SDCA parsing code but not known to the SDW DAI-type mapper, so amp endpoint matching could fail.
Step 2.4 Record: the fix is obviously small and locally correct:
“companion amp” is mapped into the existing amp class. Regression risk is very low; the only behavior change is for devices reporting SDCA_FUNCTION_TYPE_COMPANION_AMP.
## Phase 3: Git History Investigation
Step 3.1 Record: git blame on the pre-fix switch shows asoc_sdw_get_dai_type() and its default -EINVAL mapping came from 4f8ef33dd44a3d (“ASoC: soc_sdw_utils: skip the endpoint that doesn't present”), first contained from v6.16. The actual companion-amp exposure came later from f5cb3ee251b4f (“ASoC: SDCA: Add companion amp Function”), first contained from v6.19.
Step 3.2 Record: no Fixes: tag is present, so no tag target exists to follow. The likely prerequisite/regression source was verified separately as f5cb3ee251b4f, which added SDCA_FUNCTION_TYPE_COMPANION_AMP to include/sound/sdca_function.h and sound/soc/sdca/sdca_functions.c.
Step 3.3 Record: recent history for soc_sdw_utils.c shows active SDCA/SoundWire endpoint work. Related commits include 506cbe36a2ac7b exporting asoc_sdw_get_dai_type(), f5cb3ee251b4f adding the companion amp function type, and later SDCA/sdw_utils fixes. This patch is standalone except that it only applies meaningfully to trees already containing the companion-amp enum.
Step 3.4 Record: Derek Fang has multiple Realtek ASoC codec commits, including the RT1017 SDCA amplifier driver. Bard Liao has many SDW/SOF/ASoC commits in this area and is listed as an SDCA reviewer in MAINTAINERS.
Step 3.5 Record: dependency identified:SDCA_FUNCTION_TYPE_COMPANION_AMP must exist. It is present in v6.19 and v7.0, absent in v6.18. The patch should not be applied to older trees unless that enum support is also present.
## Phase 4: Mailing List And External Research
Step 4.1 Record: b4 dig -c 56d5a9eaf60a matched the original patch by exact patch-id at the supplied patch link. b4 dig -a found only v1 of a single-patch series. No newer revision was found.
Step 4.2 Record: b4 dig -w showed the original recipients included Bard Liao, Mark Brown, Takashi Iwai, [email protected], Intel/Realtek audio contributors, and Derek Fang. The patch carries Reviewed-by: Charles Keepax, who is listed as an SDCA maintainer.
Step 4.3 Record: no bug-report link or Reported-by tag exists. Web/lore fetches for the search pages were blocked by Anubis, but b4 successfully fetched the actual thread. No syzbot or user bug report was found.
Step 4.4 Record: b4 dig -a shows this is not part of a multi-patch series. Local related-patch search found f5cb3ee251b4f as the companion-amp type addition, which is the important dependency/context.
Step 4.5 Record: no stable-specific discussion was found in local stable tag history or web search. No reviewer stable nomination was found in the fetched thread.
## Phase 5: Code Semantic Analysis
Step 5.1 Record: modified function: asoc_sdw_get_dai_type().
Step 5.2 Record: callers found:
- is_sdca_endpoint_present() in sound/soc/sdw_utils/soc_sdw_utils.c, used while parsing SoundWire endpoints for ASoC machine drivers.
- is_endpoint_present() in sound/soc/sof/intel/hda.c, present in v7.0 and later, used while building default SoundWire machine descriptions from detected peripherals.
Step 5.3 Record: key callees/side effects: is_sdca_endpoint_present() gets a SoundWire device by name, checks slave->sdca_data, loops over firmware-provided SDCA functions, and skips endpoints if no matching DAI type is found. The SOF HDA path similarly checks sdw_device->sdca_data.function[] before adding endpoints.
Step 5.4 Record: reachability is verified through machine-driver setup
paths: Intel sof_sdw, AMD ACP SDW SOF, and AMD ACP SDW legacy machine drivers call asoc_sdw_parse_sdw_endpoints(). The HDA default machine path calls find_acpi_adr_device() during SoundWire machine selection. This is boot/probe-time hardware enumeration, not an unprivileged syscall path.
Step 5.5 Record: similar pattern search found SDCA_FUNCTION_TYPE_COMPANION_AMP handled in the SDCA name parser but missing from the DAI-type mapper before this patch. No other asoc_sdw_get_dai_type() companion mapping existed before the fix.
## Phase 6: Stable Tree Analysis
Step 6.1 Record: v6.18 has asoc_sdw_get_dai_type() but no SDCA_FUNCTION_TYPE_COMPANION_AMP. v6.19 and v7.0 contain the companion enum/name support but lack this mapper case. v7.1-rc3 contains the fix. Therefore the affected stable trees are v6.19.y and v7.0.y, not older trees lacking f5cb3ee251b4f.
Step 6.2 Record: git apply --check of the target patch succeeded on the current checkout, which is v7.0.5. The v6.19 helper context around SDCA_FUNCTION_TYPE_SIMPLE_AMP matches the same missing-case pattern, so expected v6.19 backport difficulty is clean or trivial.
Step 6.3 Record: local stable history checks for v6.19.y and v7.0.y found no existing stable commit with this subject. v7.1-rc3 contains 56d5a9eaf60a.
## Phase 7: Subsystem And Maintainer Context
Step 7.1 Record: subsystem is ASoC SoundWire/SDCA audio support. Criticality is driver/platform-specific, important for affected SoundWire laptop/audio hardware but not universal core kernel code.
Step 7.2 Record: subsystem activity is high; recent history shows many SDCA and sdw_utils changes across v6.19 to v7.1. This is a newer, actively evolving area, which reinforces the dependency check.
## Phase 8: Impact And Risk Assessment
Step 8.1 Record: affected users are systems with SoundWire SDCA devices reporting companion amp functions, especially Intel/AMD SoundWire laptop audio configurations using these helper paths.
Step 8.2 Record: trigger condition is hardware/firmware enumeration where slave->sdca_data.function[i].type is SDCA_FUNCTION_TYPE_COMPANION_AMP. It happens during boot/probe/machine selection, not from unprivileged userspace.
Step 8.3 Record: failure mode is endpoint/DAI detection failure: the companion amp can be treated as unsupported and skipped or not included in generated SoundWire endpoint data. Severity is medium for the general kernel, high for affected hardware because it can break audio amp availability.
Step 8.4 Record: benefit is high for affected hardware and low-risk globally. Risk is very low: one added switch case, no new API, no locking, no memory lifetime changes, and no behavior change for other function types.
## Phase 9: Final Synthesis
Step 9.1 Record: evidence for backporting:
- Fixes real incorrect handling of an already-defined SDCA companion amp type.
- Prevents affected SoundWire audio endpoints from being classified unsupported.
- One-line, single-function, single-file change.
- Reviewed by Charles Keepax; applied by Mark Brown; relevant maintainers/lists were included.
- Applies to stable trees that already contain f5cb3ee251b4f, verified for v6.19/v7.0 presence.
Evidence against backporting:
- No crash, data corruption, security issue, syzbot report, or explicit stable tag.
- It is hardware/functionality enablement rather than a core reliability fix.
- It must not be applied to trees without SDCA_FUNCTION_TYPE_COMPANION_AMP.
Unresolved questions:
- No external user bug report was found, so exact affected product count is unverified.
- I did not run a full v6.19 worktree apply test, but verified matching context and dependency presence.
Step 9.2 Stable rules:
1. Obviously correct and tested? Yes for correctness by code inspection; no explicit Tested-by on this patch.
2. Fixes a real bug? Yes, incorrect mapping of a valid SDCA companion amp function.
3. Important issue? Yes for affected hardware audio functionality, though not crash/security.
4. Small and contained? Yes, one line in one function.
5. No new feature/API? Yes, it uses an existing enum and existing DAI type.
6. Can apply to stable? Yes for v7.0.5 verified; expected trivial for v6.19.y; not applicable to older trees lacking the enum.
Step 9.3 Exception category: closest category is hardware compatibility/workaround for existing SoundWire SDCA audio support. It is not a new driver or new userspace API.
Step 9.4 Decision: backport to stable trees that already include f5cb3ee251b4f (SDCA_FUNCTION_TYPE_COMPANION_AMP), notably v6.19.y and v7.0.y. Do not backport to older trees unless that prerequisite is intentionally present.
## Verification
- [Phase 1] Parsed commit 56d5a9eaf60a with git show; confirmed subject, body, tags, and one-file/one-line patch.
- [Phase 2] Inspected diff; confirmed only asoc_sdw_get_dai_type() adds SDCA_FUNCTION_TYPE_COMPANION_AMP to the amp cases.
- [Phase 3] git blame 56d5a9eaf60a^ showed the mapper switch came from 4f8ef33dd44a3d; git show f5cb3ee251b4f confirmed companion amp enum/name support was added later.
- [Phase 3] git tag --contains f5cb3ee... showed companion amp support starts at v6.19; git grep confirmed absent in v6.18 and present in v6.19/v7.0.
- [Phase 4] b4 dig -c 56d5a9eaf60a found the original patch thread; b4 dig -a showed only v1; b4 dig -w showed original recipients.
- [Phase 4] Fetched the mbox with b4; confirmed Mark Brown applied it to sound.git for-7.1 and no NAK/objection appeared in the fetched thread.
- [Phase 5] rg found callers in is_sdca_endpoint_present() and SOF HDA is_endpoint_present(); file reads verified endpoint filtering behavior.
- [Phase 6] git grep across v6.18/v6.19/v7.0/v7.1-rc3 verified where the enum and fix exist.
- [Phase 6] git apply --check verified the patch applies cleanly to current v7.0.5.
- [Phase 7] MAINTAINERS verified Mark Brown as ASoC maintainer and Charles Keepax/Bard Liao as SDCA maintainer/reviewer contacts.
- [Phase 8] Failure mode was verified from code paths that skip endpoints when no matching DAI type is found.
- UNVERIFIED: exact real-world affected laptop/device count; no public bug report was found.
**YES**
sound/soc/sdw_utils/soc_sdw_utils.c | 1 + 1 file changed, 1 insertion(+)
sound/soc/sdw_utils/soc_sdw_utils.c +1 -0
@@ -1400,6 +1400,7 @@ int asoc_sdw_get_dai_type(u32 type)switch (type) {case SDCA_FUNCTION_TYPE_SMART_AMP :case SDCA_FUNCTION_TYPE_SIMPLE_AMP : +case SDCA_FUNCTION_TYPE_COMPANION_AMP :return SOC_SDW_DAI_TYPE_AMP ;case SDCA_FUNCTION_TYPE_SMART_MIC :case SDCA_FUNCTION_TYPE_SIMPLE_MIC :
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 Documentation: security-bugs: do not systematically Cc the security team
In reply to Sasha LevinFrom: Willy Tarreau <[email protected]>
[ Upstream commit aed3c3346765e4317bb2ec6ff872e1c952e128ab ]
With the increase of automated reports, the security team is dealing with way more messages than really needed. The reporting process works well with most teams so there is no need to systematically involve the security team in reports.
Let's suggest to keep it for small lists of recipients and new reporters only. This should continue to cover the risk of lost messages while reducing the volume from prolific reporters.
Message-ID: <[email protected]>
---
LLM Generated explanations, may be completely bogus:
## Phase 1: Commit Message Forensics
Record 1.1: Subsystem Documentation/process/security-bugs; action verb do not; intent is to update security bug reporting instructions so reporters do not always Cc the security team.
Record 1.2: Tags present: Cc: Greg KH <[email protected]>, Cc: Leon Romanovsky <[email protected]>, Reviewed-by: Leon Romanovsky <[email protected]>, Reviewed-by: Greg Kroah-Hartman <[email protected]>, Signed-off-by: Willy Tarreau <[email protected]>, Signed-off-by: Jonathan Corbet <[email protected]>, Message-ID: <[email protected]>. No Fixes:, no Reported-by:, no Tested-by:, no Cc: stable.
Record 1.3: The body describes a process/documentation problem:
increased automated reports create more mail to the security team than needed. Symptom is excess security-team involvement, not a kernel runtime crash or data corruption. No affected kernel versions are named.
Record 1.4: This is not a hidden code bug fix. It is an explicit documentation/process update that corrects now-overbroad guidance.
## Phase 2: Diff Analysis
Record 2.1: One file changed: Documentation/process/security-bugs.rst, 9 insertions and 1 deletion in the submitted patch. No functions are modified. Scope is single-file documentation-only.
Record 2.2: Before: reports “must” be sent to maintainers with the security team in Cc. After: reports still go to maintainers, but security-team Cc is mandatory only for two-or-fewer recipients, advised for early reports or specific help, and no longer necessary for comfortable reporters sending to large teams.
Record 2.3: Bug category is documentation/process correctness. No resource leak, race, memory safety, refcount, initialization, endian, or hardware quirk mechanism exists.
Record 2.4: Fix quality is high for its scope: small, reviewed, documentation-only, no runtime behavior. Regression risk is limited to possibly changing reporter behavior; no kernel runtime regression is possible from the diff itself.
## Phase 3: Git History Investigation
Record 3.1: git blame shows the replaced sentence was introduced by a72b832a482372 (“Documentation: explain how to find maintainers addresses for security reports”), first contained by v7.0-rc7~8^2~2.
Record 3.2: No Fixes: tag is present, so there is no Fixes target to follow.
Record 3.3: Recent history of Documentation/process/security-bugs.rst shows a series of security-reporting documentation updates by Willy Tarreau, including contact/process clarifications and typo fixes. This patch is standalone at the diff level but part of a three-patch documentation series.
Record 3.4: The author has multiple recent commits in Documentation/process/security-bugs.rst. Maintainer lookup identifies Security Officers <[email protected]> and Jonathan Corbet <[email protected]> for this file.
Record 3.5: No code dependencies or functions exist. The exact patch depends on the newer rewritten security-bugs document layout present in 7.0.y; older stable branches do not contain a72b832a482372.
## Phase 4: Mailing List And External Research
Record 4.1: b4 dig -c could not be used because no candidate commit SHA was available locally or in the prompt, and local master, docs- next, and all-next searches did not find the commit object. Using the supplied Message-ID, b4 am found the original submission at https://patch.msgid.link/[email protected].
Record 4.2: b4 am and the mbox show v3 of a 3-patch series, 33 thread messages, sent to Greg KH, Leon Romanovsky, Jonathan Corbet, Shuah Khan, [email protected], [email protected], linux- [email protected], and [email protected].
Record 4.3: No bug report link, syzbot report, Bugzilla report, or user crash report exists. Lore WebFetch was blocked by Anubis, but b4 successfully fetched the mbox.
Record 4.4: Series context: patch 1/3 is this Cc guidance change; patch 2/3 adds security-bug/threat-model documentation; patch 3/3 clarifies AI-assisted reports. Cover letter says v2 reworded the “when to Cc” part based on Greg’s feedback; v3 included wording/structure feedback and added reviews.
Record 4.5: I found no stable-specific discussion or stable nomination in the fetched thread. Jonathan Corbet said he applied the series to docs-fixes after short linux-next exposure.
## Phase 5: Code Semantic Analysis
Record 5.1: No functions modified; documentation only.
Record 5.2: No callers; affected audience is readers of Documentation/process/security-bugs.rst.
Record 5.3: No callees or side effects.
Record 5.4: Reachability is not runtime reachability. The path is “reporter reads stable-tree documentation and follows reporting instructions.”
Record 5.5: rg found the old mandatory-Cc sentence only in Documentation/process/security-bugs.rst; related security-team references remain elsewhere in the same document.
## Phase 6: Cross-Referencing And Stable Tree Analysis Record 6.1: a72b832a482372 is an ancestor of stable/linux-7.0.y but not of local stable/linux-5.15.y, stable/linux-6.1.y, stable/linux-6.6.y, stable/linux-6.12.y, stable/linux-6.18.y, or stable/linux-6.19.y. So this exact buggy/obsolete sentence is confirmed in 7.0.y; older local stable trees have older document layouts.
Record 6.2: b4 reports the series base applies cleanly to the current tree, which is stable/linux-7.0.y. Older stable trees would need a different documentation backport if maintainers wanted equivalent guidance there.
Record 6.3: No related stable fix for this exact wording was found in local history.
## Phase 7: Subsystem And Maintainer Context
Record 7.1: Subsystem is documentation/process, specifically security bug reporting. Criticality is process-important, not runtime core/driver/filesystem criticality.
Record 7.2: The file has active recent development, with several 2025-2026 security-reporting documentation updates.
## Phase 8: Impact And Risk Assessment
Record 8.1: Affected population is documentation readers: security bug reporters, maintainers, and the kernel security team. No running kernel users are directly affected.
Record 8.2: Trigger is following the stable tree’s security-bug reporting documentation. This can be done by any reporter, but it is not a syscall or kernel execution path.
Record 8.3: Failure mode severity is low for runtime stability, but medium for security-process efficiency: the old wording can unnecessarily add the private security team to large-team reports.
Record 8.4: Benefit is moderate for keeping security reporting guidance current and reducing unnecessary private-list traffic. Risk is very low because the patch is documentation-only and reviewed.
## Phase 9: Final Synthesis
Record 9.1: Evidence for backporting: documentation-only; zero runtime regression risk; corrects overbroad/obsolete reporting guidance; reviewed by Leon Romanovsky and Greg Kroah-Hartman; applied by documentation maintainer Jonathan Corbet; relevant to security reporting workflow; clean for 7.0.y.
Evidence against: it does not fix a kernel runtime bug, crash, security vulnerability, corruption, or deadlock; older stable trees do not contain the exact rewritten section, so this exact patch is mainly applicable to 7.0.y.
Unresolved: I could not run b4 dig -c without a commit SHA, and WebFetch of lore was blocked by Anubis. The b4 Message-ID fetch supplied the needed thread content.
Record 9.2: Stable rules: obviously correct and reviewed: yes. Fixes real user-visible runtime bug: no. Important crash/security/corruption/deadlock: no. Small and contained: yes, one documentation file. No new feature/API: yes. Applies to stable: yes for 7.0.y; older branches need separate handling.
Record 9.3: Exception category: documentation fix/update. This is the reason it qualifies despite not being a runtime bug.
Record 9.4: Decision: backport where the affected documentation exists, especially 7.0.y. The runtime benefit is nonexistent, but the risk is also nonexistent, and stable policy exceptions allow documentation fixes that correct obsolete guidance.
## Verification
- Phase 1: Parsed supplied commit tags and b4 patch headers; confirmed no Fixes:, Reported-by:, Tested-by, or Cc: stable.
- Phase 2: Read supplied diff and b4 patch; confirmed one documentation file, 9 insertions/1 deletion, no code.
- Phase 3: Ran git blame -L 148,152 -- Documentation/process/security- bugs.rst; old sentence introduced by a72b832a482372.
- Phase 3: Ran git describe --contains a72b832a482372; first contained around v7.0-rc7~8^2~2.
- Phase 3: Ran file and author history commands; confirmed recent related docs updates by Willy Tarreau.
- Phase 4: Local git log searches on current history, master, docs- next, and all-next did not find the candidate commit object.
- Phase 4: b4 am -o /tmp/security-bugs-b4 [email protected] found a v3 3-patch series, 33 messages, and reported clean apply to current tree.
- Phase 4: b4 mbox saved the thread mbox; rg found no stable nomination or NAK for this patch.
- Phase 4: WebFetch of lore URLs was blocked by Anubis; not used for the final decision.
- Phase 5: rg over Documentation confirmed the exact mandatory-Cc sentence appears in Documentation/process/security-bugs.rst.
- Phase 6: git merge-base --is-ancestor a72b832a482372 stable/linux-7.0.y returned true; checks for 5.15.y, 6.1.y, 6.6.y, 6.12.y, 6.18.y, and 6.19.y returned false.
- Phase 7: ./scripts/get_maintainer.pl identified Security Officers and Jonathan Corbet for the file; MAINTAINERS confirms DOCUMENTATION PROCESS, SECURITY CONTACT, and STABLE BRANCH entries.
- Phase 8: Failure mode verified from commit text and diff only:
documentation/process burden, not runtime failure.
**YES**
Documentation/process/security-bugs.rst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
Documentation/process/security-bugs.rst +9 -1
@@ -148,7 +148,15 @@ run additional tests. Reports where the reporter does not respond promptly or cannot effectively discuss their findings may be abandoned if the communication does not quickly improve. -The report must be sent to maintainers, with the security team in ``Cc:``. +The report must be sent to maintainers. If there are two or fewer +recipients in your message, you must also always Cc: the Linux kernel +security team who will ensure the message is delivered to the proper +people, and will be able to assist small maintainer teams with processes +they may not be familiar with. For larger teams, Cc: the Linux kernel +security team for your first few reports or when seeking specific help, +such as when resending a message which got no response within a week. +Once you have become comfortable with the process for a few reports, it is +no longer necessary to Cc: the security list when sending to large teams. The Linux kernel security team can be contacted by email at <[email protected]>. This is a private list of security officers who will help verify the bug report and assist developers working on a fix.
Signature · 1 line
2.53.0
Jonathan Corbet
maintainerRe: [PATCH AUTOSEL 7.0] Documentation: security-bugs: do not systematically Cc the security team
Quoted 8 lines · Sasha Levin
From: Willy Tarreau <[email protected]>
[ Upstream commit
aed3c3346765e4317bb2ec6ff872e1c952e128ab]With the increase of automated reports, the security team is dealing with way more messages than really needed. The reporting process works well with most teams so there is no need to systematically involve the security team in reports.
You'll want, at a minimum, f2e65e4e5b4b4b9ecf43f03c3fdbe8c9a8a43a9e to go with this, or you'll add a broken reference with this commit.
Thanks,
jon
Sasha Levin
maintainerPATCH 1/1 io_uring/fdinfo: translate SqThread PID through caller's pid_ns
In reply to Sasha LevinFrom: Maoyi Xie <[email protected]>
[ Upstream commit 3799c2570982577551023ae035f5a786cf39a76e ]
SQPOLL stores current->pid (init_pid_ns view) in sqd->task_pid at thread creation. fdinfo prints it raw via seq_printf("SqThread:\t%d\n", sq_pid). A reader inside a non-initial pid_ns sees the host PID, not the kthread's PID in the reader's own pid_ns.
The SQPOLL kthread is created with CLONE_THREAD and no CLONE_NEW*, so it lives in the submitter's pid_ns. An unprivileged user_ns + pid_ns submitter can read fdinfo and learn the host PID of a kthread whose in-namespace PID is different.
Reproducer (mainline 7.0, KASAN): unshare CLONE_NEWUSER | CLONE_NEWPID | CLONE_NEWNS, mount a private /proc, then have a grandchild that is pid 1 in the new pid_ns open an io_uring ring with IORING_SETUP_SQPOLL. /proc/self/task lists {1, 2}; the SQPOLL kthread is pid 2. Before: fdinfo prints SqThread = <host pid>. After: SqThread = 2.
Use task_pid_nr_ns() against the proc inode's pid_ns to compute sq_pid, instead of reading the stored sq->task_pid (which holds the init_pid_ns view). pidfd_show_fdinfo() in kernel/pid.c follows the same pattern.
---
LLM Generated explanations, may be completely bogus:
## Phase Walkthrough
Phase 1, commit message forensics:
- Record 1.1: subsystem io_uring/fdinfo; action verb translate; intent is to report SqThread in the proc fdinfo reader’s PID namespace.
- Record 1.2: tags are Signed-off-by: Maoyi Xie <[email protected]>, `Link: https://patch.msgid.link/2026051008411
[email protected], and Signed-off-by: Jens Axboe <[email protected]>. No Fixes:, Reported-by:, Tested-by:, Reviewed-by:, Acked-by:, or Cc: stable`.
- Record 1.3: the bug is a namespace information leak: SqThread reports the init-namespace/host PID to a reader inside a non-initial PID namespace. The message includes a concrete reproducer using unprivileged user/pid/mount namespaces and an SQPOLL ring.
- Record 1.4: this is not hidden cleanup; it is an explicit namespace correctness and information disclosure fix.
Phase 2, diff analysis:
- Record 2.1: one file, io_uring/fdinfo.c, with 2 insertions and 1 deletion in __io_uring_show_fdinfo(). Scope is a single-function surgical fix.
- Record 2.2: before, fdinfo used stored sq->task_pid; after, it computes sq_pid = task_pid_nr_ns(tsk, proc_pid_ns(file_inode(m->file)->i_sb)).
- Record 2.3: bug category is logic/security namespace translation. The broken value was a raw task PID; the fix translates the live SQPOLL task into the proc fdinfo file’s PID namespace.
- Record 2.4: fix quality is high: minimal, uses existing helpers, keeps the existing task lifetime protection, and follows the verified pidfd_show_fdinfo() pattern. Regression risk is very low; host/init namespace output remains equivalent.
Phase 3, git history:
- Record 3.1: blame shows the current sq_pid = sq->task_pid line last touched by 606559dc4fa36a, while the semantic change to store/print sq->task_pid came from a0d45c3f596be, first contained around v6.7-rc2.
- Record 3.2: no Fixes: tag is present, so there was no tagged introducing commit to follow.
- Record 3.3: recent io_uring/fdinfo.c history includes multiple fdinfo correctness fixes, including SQPOLL lifetime/UAF fixes and SQE display fixes. No prerequisite series was found for this patch.
- Record 3.4: local history shows no other Maoyi Xie commits under io_uring; Jens Axboe is the listed IO_URING maintainer and committed/applied the patch.
- Record 3.5: dependencies task_pid_nr_ns() and proc_pid_ns() exist in relevant stable branches checked. The patch applies cleanly to p-6.12, p-6.18, p-6.19, and p-7.0.
Phase 4, mailing list research:
- Record 4.1: b4 dig -c 3799c2570982577551023ae035f5a786cf39a76e found the lore thread at the supplied patch.msgid link. b4 dig -a found only v1.
- Record 4.2: original recipients included Jens Axboe, Pavel Begunkov, [email protected], and [email protected].
- Record 4.3: no separate bug-report link or reporter tag was present; the bug evidence is the commit’s reproducer.
- Record 4.4: no multi-patch series or related required patches were found by b4.
- Record 4.5: no stable-specific discussion was verified. WebFetch hit Anubis protection; web search did not produce usable stable discussion for this exact patch.
Phase 5, semantic analysis:
- Record 5.1: modified function is __io_uring_show_fdinfo().
- Record 5.2: caller chain is /proc/*/fdinfo read in fs/proc/fd.c -> file->f_op->show_fdinfo() -> io_uring_show_fdinfo() -> __io_uring_show_fdinfo().
- Record 5.3: relevant callees are rcu_dereference(), get_task_struct(), io_sq_cpu_usec(), task_pid_nr_ns(), proc_pid_ns(), and seq_printf().
- Record 5.4: reachable from userspace by creating an IORING_SETUP_SQPOLL ring and reading /proc/self/fdinfo/<fd>. Current code has global io_uring_allowed() gating, but no SQPOLL- specific capability check was found in the flag validation path.
- Record 5.5: similar verified pattern exists in pidfd_show_fdinfo(), which derives the namespace from file_inode(m->file)->i_sb.
Phase 6, stable tree analysis:
- Record 6.1: p-6.12, p-6.18, p-6.19, and p-7.0 contain the exact sq->task_pid fdinfo pattern. p-6.6 also contains sq->task_pid; p-6.1 uses task_pid_nr(sq->thread), which also returns tsk->pid in the checked header. p-5.10 and p-5.15 did not show SqThread fdinfo matches in checked paths.
- Record 6.2: exact patch applies cleanly to p-6.12+ branches checked. Older p-6.1/p-6.6 need backport adjustment due code shape differences.
- Record 6.3: no existing stable fix for this specific namespace translation was found in checked stable branch code.
Phase 7, subsystem context:
- Record 7.1: subsystem is io_uring, an important syscall-facing kernel I/O subsystem; affected surface is SQPOLL fdinfo, not the core I/O data path.
- Record 7.2: file history shows active fdinfo development and recent fixes. Maintainer metadata verifies Jens Axboe as IO_URING maintainer.
Phase 8, impact and risk:
- Record 8.1: affected users are container/pid-namespace users who create SQPOLL io_uring rings and read proc fdinfo.
- Record 8.2: trigger is straightforward where io_uring is allowed:
create SQPOLL in non-init pid namespace and read fdinfo. It is not timing-dependent.
- Record 8.3: failure mode is host PID information disclosure and pid namespace isolation violation. Severity is medium security/correctness, not crash/corruption.
- Record 8.4: benefit is meaningful for namespace isolation; risk is very low due a 3-line localized proc-output fix.
Phase 9, synthesis:
- Record 9.1: evidence for backporting: real reproducer, unprivileged namespace information leak, tiny fix, maintainer-applied, uses established proc namespace helper pattern, clean applies to multiple stable branches. Evidence against: no crash/data corruption; older stable branches need adapted backports.
- Record 9.2: stable rules: obviously correct yes; fixes real user- visible bug yes; important enough as security/isolation info leak yes; small and contained yes; no new feature/API yes; applies cleanly to checked p-6.12+, with older-tree rework as noted.
- Record 9.3: no automatic exception category applies.
- Record 9.4: decision is to backport.
## Verification
- Phase 1: git show --format=fuller --patch 3799c2570982577551023ae035f5a786cf39a76e verified the commit message, trailers, and 3-line diff.
- Phase 2: local io_uring/fdinfo.c read verified the pre-patch sq->task_pid fdinfo output and task reference context.
- Phase 3: git blame, git show a0d45c3f596be, git describe --contains, and file logs verified history and first-release context.
- Phase 4: b4 dig -c, b4 dig -a, b4 dig -w, and b4 mbox verified the lore thread, v1-only submission, recipients, and Jens “Applied, thanks” reply with commit 3799c257....
- Phase 5: reads of fs/proc/fd.c, io_uring/io_uring.c, io_uring/sqpoll.c, kernel/fork.c, include/linux/pid.h, kernel/pid.c, and fs/pidfs.c verified reachability, helper semantics, SQPOLL creation flags, and the pidfd fdinfo pattern.
- Phase 6: checked p-6.1, p-6.6, p-6.12, p-6.18, p-6.19, p-7.0, and stable/linux-7.0.y code; worktree git apply --check verified clean application to p-6.12, p-6.18, p-6.19, and p-7.0.
- Unverified: no kernel build or runtime reproducer was run; stable-list discussion could not be verified because direct lore WebFetch was blocked and search found no usable exact stable thread.
This is stable material: it fixes a concrete namespace information leak with a tiny, conventional, low-risk change.
**YES**
io_uring/fdinfo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
io_uring/fdinfo.c +2 -1
@@ -190,8 +190,9 @@ static void __io_uring_show_fdinfo(struct io_ring_ctx *ctx, struct seq_file *m)get_task_struct (tsk);rcu_read_unlock (); usec =io_sq_cpu_usec (tsk); + sq_pid =task_pid_nr_ns (tsk, +proc_pid_ns (file_inode (m->file)->i_sb));put_task_struct (tsk); - sq_pid = sq->task_pid; sq_cpu = sq->sq_cpu; sq_total_time = usec; sq_work_time = sq->work_time;
Signature · 1 line
2.53.0