[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <76596dba-efb7-eab1-bca9-60ab67823ade@suse.com>
Date: Tue, 10 Jan 2023 09:06:58 +0100
From: Juergen Gross <jgross@...e.com>
To: Roger Pau Monne <roger.pau@...rix.com>,
linux-kernel@...r.kernel.org
Cc: xen-devel@...ts.xenproject.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>,
Jan Beulich <jbeulich@...e.com>,
Stefano Stabellini <sstabellini@...nel.org>,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH v2] hvc/xen: lock console list traversal
On 30.11.22 17:36, Roger Pau Monne wrote:
> The currently lockless access to the xen console list in
> vtermno_to_xencons() is incorrect, as additions and removals from the
> list can happen anytime, and as such the traversal of the list to get
> the private console data for a given termno needs to happen with the
> lock held. Note users that modify the list already do so with the
> lock taken.
>
> Adjust current lock takers to use the _irq{save,restore} helpers,
> since the context in which vtermno_to_xencons() is called can have
> interrupts disabled. Use the _irq{save,restore} set of helpers to
> switch the current callers to disable interrupts in the locked region.
> I haven't checked if existing users could instead use the _irq
> variant, as I think it's safer to use _irq{save,restore} upfront.
>
> While there switch from using list_for_each_entry_safe to
> list_for_each_entry: the current entry cursor won't be removed as
> part of the code in the loop body, so using the _safe variant is
> pointless.
>
> Fixes: 02e19f9c7cac ('hvc_xen: implement multiconsole support')
> Signed-off-by: Roger Pau Monné <roger.pau@...rix.com>
Pushed to xen/tip.git for-linus-6.2
Juergen
Download attachment "OpenPGP_0xB0DE9DD628BF132F.asc" of type "application/pgp-keys" (3099 bytes)
Download attachment "OpenPGP_signature" of type "application/pgp-signature" (496 bytes)
Powered by blists - more mailing lists