From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753045AbbIHWL0 (ORCPT ); Tue, 8 Sep 2015 18:11:26 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:57178 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751674AbbIHWLY (ORCPT ); Tue, 8 Sep 2015 18:11:24 -0400 Date: Tue, 8 Sep 2015 15:11:23 -0700 From: Greg KH To: Dmitry Vyukov Cc: peter@hurleysoftware.com, jslaby@suse.com, linux-kernel@vger.kernel.org, jslaby@suse.cz, andreyknvl@google.com, kcc@google.com, glider@google.com, paulmck@linux.vnet.ibm.com, hboehm@google.com Subject: Re: [PATCH] tty: fix data race in tty_buffer_flush Message-ID: <20150908221123.GA22446@kroah.com> References: <1441628781-73974-1-git-send-email-dvyukov@google.com> <1441716506-110551-1-git-send-email-dvyukov@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1441716506-110551-1-git-send-email-dvyukov@google.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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