[PATCH] tty: hvc: Fix data abort due to race in hvc_open

Markus Elfring Markus.Elfring at web.de
Tue Apr 28 22:48:38 AEST 2020


> Hence, serialize hvc_open and check if tty->private_data is NULL before
> proceeding ahead.

How do you think about to add the tag “Fixes” because of adjustments
for the data synchronisation?


…
> +++ b/drivers/tty/hvc/hvc_console.c
…
@@ -384,6 +394,8 @@ static int hvc_open(struct tty_struct *tty, struct file * filp)
…
> +out:
> +	mutex_unlock(&hvc_open_mutex);
>  	return rc;
>  }

I suggest to use the label “unlock” instead.

Regards,
Markus


More information about the Linuxppc-dev mailing list