From: Greg KH <gregkh@linuxfoundation.org>
To: Jia-Ju Bai <baijiaju1990@gmail.com>
Cc: jslaby@suse.com, linux-serial@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [BUG] tty: serial: mxs-auart: possible concurrency use-after-free bugs in mxs_auart_dma_exit_channel()
Date: Mon, 7 Jan 2019 09:52:24 +0100 [thread overview]
Message-ID: <20190107085224.GA26384@kroah.com> (raw)
In-Reply-To: <8da85649-f539-9c36-a97e-3582844e82fb@gmail.com>
On Mon, Jan 07, 2019 at 04:47:43PM +0800, Jia-Ju Bai wrote:
> The driver functions mxs_auart_settermios(), dma_rx_callback() and dma_tx_callback() can be concurrently executed.
>
> In Linux 4.19:
>
> mxs_auart_settermios
> mxs_auart_dma_exit
> mxs_auart_dma_exit_channel
> line 918: kfree(s->tx_dma_buf);
> line 919: kfree(s->rx_dma_buf);
>
> dma_rx_callback
> line 862: tty_insert_flip_string(port, s->rx_dma_buf, count);
> mxs_auart_dma_prep_rx
> line 890: sg_init_one(sgl, s->rx_dma_buf, UART_XMIT_SIZE);
>
> dma_tx_callback
> mxs_auart_tx_chars
> line 590: void *buffer = s->tx_dma_buf;
> mxs_auart_dma_tx
> line 566: sg_init_one(sgl, s->tx_dma_buf, size);
>
> Thus, possible concurrency use-after-free bugs may occur.
>
> These possible bugs are found by a static analysis tool written by myself and my manual code review.
Care to send a patch to fix up this issue?
thanks,
greg k-h
next parent reply other threads:[~2019-01-07 8:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <8da85649-f539-9c36-a97e-3582844e82fb@gmail.com>
2019-01-07 8:52 ` Greg KH [this message]
2019-01-07 9:03 ` [BUG] tty: serial: mxs-auart: possible concurrency use-after-free bugs in mxs_auart_dma_exit_channel() Jia-Ju Bai
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=20190107085224.GA26384@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=baijiaju1990@gmail.com \
--cc=jslaby@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.