|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [BUG] Potential double-free in Xen dt-overlay attach/remove error path
On 2026-04-10 08:31, Jan Beulich wrote: On 09.04.2026 23:28, Gyujeong Jin wrote:Hello Team, I was advised to report this issue in this way because dt-overlay is currently experimental and not security supported.I would like to report a potential memory safety issue in Xen related tothe Device Tree overlay handling logic. ------------------------------ Problem Description A double-free / use-after-free condition may occur in the dt-overlay handling path when an overlay attachment fails and the same overlay is later removed.The issue arises because rangeset objects are freed on the failure path ofhandle_attach_overlay_nodes(), but the corresponding pointers are notcleared. Subsequently, handle_remove_overlay_nodes() may operate on thesestale pointers, leading to a second free. Affected Component - Xen ARM - Device Tree overlay subsystem - File: xen/common/device-tree/dt-overlay.c Relevant functions: - handle_attach_overlay_nodes() - handle_remove_overlay_nodes() Impact This issue may lead to: - Double-free of rangeset structures - Use-after-free when accessing stale pointers - Potential hypervisor crash (DoS) - Possible memory corruption depending on allocator behaviorGiven that this occurs in the hypervisor context, the impact could extendbeyond a simple crash under certain conditions. Root CauseThe issue originates from inconsistent memory management between the attachfailure path and the remove path.In handle_attach_overlay_nodes(), the failure path frees rangeset objects: Is it by any chance enabled in *-allcode analyses? I don't see such reports for unreachable code on ARM64. -- Nicola Vetrini, B.Sc. Software Engineer BUGSENG (https://bugseng.com) LinkedIn: https://www.linkedin.com/in/nicola-vetrini-a42471253
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |