summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorRoger Pau Monne <roger.pau@citrix.com>2022-11-30 16:09:11 +0100
committerJuergen Gross <jgross@suse.com>2023-03-22 16:59:39 +0100
commit6214894f49a967c749ee6c07cb00f9cede748df4 (patch)
tree448962ff9f1a7bd87dc746e6bdfd23de765b8516 /arch
parent7ad2c39860dc0ca01d2152232224d2124e160fe3 (diff)
hvc/xen: prevent concurrent accesses to the shared ring
The hvc machinery registers both a console and a tty device based on the hv ops provided by the specific implementation. Those two interfaces however have different locks, and there's no single locks that's shared between the tty and the console implementations, hence the driver needs to protect itself against concurrent accesses. Otherwise concurrent calls using the split interfaces are likely to corrupt the ring indexes, leaving the console unusable. Introduce a lock to xencons_info to serialize accesses to the shared ring. This is only required when using the shared memory console, concurrent accesses to the hypercall based console implementation are not an issue. Note the conditional logic in domU_read_console() is slightly modified so the notify_daemon() call can be done outside of the locked region: it's an hypercall and there's no need for it to be done with the lock held. Fixes: b536b4b96230 ('xen: use the hvc console infrastructure for Xen console') Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Reviewed-by: Juergen Gross <jgross@suse.com> Link: https://lore.kernel.org/r/20221130150919.13935-1-roger.pau@citrix.com Signed-off-by: Juergen Gross <jgross@suse.com>
Diffstat (limited to 'arch')
0 files changed, 0 insertions, 0 deletions