Re: [PATCH] tty: fix data race in tty_buffer_flush

From: Greg KH
Date: Tue Sep 08 2015 - 18:11:50 EST


On Tue, Sep 08, 2015 at 02:48:26PM +0200, Dmitry Vyukov wrote:
> tty_buffer_flush frees not acquired buffers.
> As the result, for example, read of b->size in tty_buffer_free
> can return garbage value which will lead to a huge buffer
> hanging in the freelist. This is just the benignest
> manifestation of freeing of a not acquired object.
> If the object is passed to kfree, heap can be corrupted.
>
> Acquire visibility over the buffer before freeing it.
>
> The data race was found with KernelThreadSanitizer (KTSAN).
>
> Signed-off-by: Dmitry Vyukov <dvyukov@xxxxxxxxxx>
> ---
> drivers/tty/tty_buffer.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)

What changed from the last version? Why should I take this one and not
the other? What order do these go in?

Please please please version your patches, and number them in a series
so that I know what to apply, and in what order, and what changed
between versions. Please read Documentation/SubmittingPatches for all
the details about this.

I've now dropped all of your patches from my queue, please resend them
all properly.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/