diff options
| author | Yufan Chen <ericterminal@gmail.com> | 2026-03-24 23:30:22 +0800 |
|---|---|---|
| committer | Dominique Martinet <asmadeus@codewreck.org> | 2026-04-16 02:57:01 +0000 |
| commit | 72cb9ee4f6d80962df17c9763b14e62e28fd85a2 (patch) | |
| tree | e86afc753616a048a8031492a1d34ac247a58489 /include/linux | |
| parent | 890d56964c62dfbe228b30b157811088cf64f9f1 (diff) | |
9p/trans_xen: make cleanup idempotent after dataring alloc errors
xen_9pfs_front_alloc_dataring() tears down resources on failure but
leaves ring fields stale. If xen_9pfs_front_init() later jumps to the
common error path, xen_9pfs_front_free() may touch the same resources
again, causing duplicate/invalid gnttab_end_foreign_access() calls and
potentially dereferencing a freed intf pointer.
Initialize dataring sentinels before allocation, gate teardown on those
sentinels, and clear ref/intf/data/irq immediately after each release.
This keeps cleanup idempotent for partially initialized rings and
prevents repeated teardown during init failure handling.
Signed-off-by: Yufan Chen <ericterminal@gmail.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Message-ID: <20260324153023.86853-2-ericterminal@gmail.com>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
