mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH master] virtio: implement remove callbacks
Date: Sat, 2 Oct 2021 11:16:46 +0200	[thread overview]
Message-ID: <20211002091646.GD28453@pengutronix.de> (raw)
In-Reply-To: <20210916093458.21102-1-a.fatoum@pengutronix.de>

On Thu, Sep 16, 2021 at 11:34:58AM +0200, Ahmad Fatoum wrote:
> virtio parent device drivers (e.g. PCI and MMIO) create child devices
> and free them on remove. The virtio drivers for the child devices (e.g.
> block and console) however don't unregister with their respective
> subsystems in the remove callbacks. So these subsystems may have stale
> pointers pointing at removed devices. This is especially problematic for
> the console driver, because the virtio console device_d will be removed,
> but the console itself remains registered leading to a use-after-free
> as soon as printf is invoked for the previously active console.
> 
> This leads to a crash when typing reset in
> 
>   https://www.barebox.org/jsbarebox/?graphic=0
> 
> Fix this for all virtio drivers.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  drivers/block/virtio_blk.c      |  6 ++++++
>  drivers/hw_random/core.c        | 12 ++++++++++++
>  drivers/hw_random/virtio-rng.c  |  6 ++++++
>  drivers/input/virtio_input.c    |  5 +++--
>  drivers/serial/virtio_console.c | 14 ++++++++++++++
>  include/linux/hw_random.h       |  2 ++
>  6 files changed, 43 insertions(+), 2 deletions(-)

Applied, thanks

Sascha


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


      reply	other threads:[~2021-10-02  9:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-16  9:34 Ahmad Fatoum
2021-10-02  9:16 ` Sascha Hauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211002091646.GD28453@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox