mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
Using the struct buffered data pointer of the current processed request for temporary data allocations has a major drawback: the used area (and with that the temporary data) is freed only after the response of the request has been written to the ring page or has been read via the socket. This can happen much later in case a guest isn't reading its responses fast enough. As the temporary data can be safely freed after creating the response, add a temporary context for that purpose and use that for allocating the temporary memory, as it was already the case before commitcc06124648("xenstore: add small default data buffer to internal struct"). Some sub-functions need to gain the "const" attribute for the talloc context. This is XSA-416 / CVE-2022-42319. Fixes:cc06124648("xenstore: add small default data buffer to internal struct") Signed-off-by: Juergen Gross <jgross@suse.com> Reviewed-by: Julien Grall <jgrall@amazon.com> (cherry picked from commit2a587de219)