From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:49328 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750842AbeDVJBO (ORCPT ); Sun, 22 Apr 2018 05:01:14 -0400 Date: Sun, 22 Apr 2018 11:01:08 +0200 From: Greg Kroah-Hartman To: Nathan Chancellor Cc: stable@vger.kernel.org, Jan Kara , Theodore Ts'o Subject: Re: [PATCH 4.4 1/2] ext4: fix crashes in dioread_nolock mode Message-ID: <20180422090108.GA17189@kroah.com> References: <20180422081132.23277-1-natechancellor@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180422081132.23277-1-natechancellor@gmail.com> Sender: stable-owner@vger.kernel.org List-ID: On Sun, Apr 22, 2018 at 01:11:31AM -0700, Nathan Chancellor wrote: > From: Jan Kara > > commit 74dae4278546b897eb81784fdfcce872ddd8b2b8 upstream. > > Competing overwrite DIO in dioread_nolock mode will just overwrite > pointer to io_end in the inode. This may result in data corruption or > extent conversion happening from IO completion interrupt because we > don't properly set buffer_defer_completion() when unlocked DIO races > with locked DIO to unwritten extent. > > Since unlocked DIO doesn't need io_end for anything, just avoid > allocating it and corrupting pointer from inode for locked DIO. > A cleaner fix would be to avoid these games with io_end pointer from the > inode but that requires more intrusive changes so we leave that for > later. > > Cc: stable@vger.kernel.org > Signed-off-by: Jan Kara > Signed-off-by: Theodore Ts'o > Signed-off-by: Nathan Chancellor > --- > fs/ext4/inode.c | 40 ++++++++++++++++++++-------------------- > 1 file changed, 20 insertions(+), 20 deletions(-) > Both patches now queued up, thanks! greg k-h