From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 28 Jun 2013 14:54:08 +0100 From: Al Viro To: Joakim Tjernlund Subject: Re: [PATCH 1/2] UBIFS: prepare to fix a horrid bug Message-ID: <20130628135408.GG4165@ZenIV.linux.org.uk> References: <1372418115-16713-1-git-send-email-dedekind1@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Cc: Linux FS Maling List , linux-mtd , MTD Maling List , Artem Bityutskiy List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Fri, Jun 28, 2013 at 02:27:58PM +0200, Joakim Tjernlund wrote: > > So here we introduce a local variable 'pos', read 'file->f_pose' once at > very > > the beginning, and then stick to 'pos'. The result of this is that when > > 'ubifs_dir_llseek()' changes 'file->f_pos' while we are in the middle of > > 'ubifs_readdir()', the latter "wins". > > Ouch, I hope JFFS2 doesn't have the same bug? FWIW, this class of bugs (f_pos races, *not* kfree-under-us) is dealt with by switch to saner API - see commits in linux-next marked [readdir] From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH 1/2] UBIFS: prepare to fix a horrid bug Date: Fri, 28 Jun 2013 14:54:08 +0100 Message-ID: <20130628135408.GG4165@ZenIV.linux.org.uk> References: <1372418115-16713-1-git-send-email-dedekind1@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Artem Bityutskiy , Linux FS Maling List , MTD Maling List , linux-mtd To: Joakim Tjernlund Return-path: Received: from zeniv.linux.org.uk ([195.92.253.2]:55402 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751262Ab3F1NyK (ORCPT ); Fri, 28 Jun 2013 09:54:10 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, Jun 28, 2013 at 02:27:58PM +0200, Joakim Tjernlund wrote: > > So here we introduce a local variable 'pos', read 'file->f_pose' once at > very > > the beginning, and then stick to 'pos'. The result of this is that when > > 'ubifs_dir_llseek()' changes 'file->f_pos' while we are in the middle of > > 'ubifs_readdir()', the latter "wins". > > Ouch, I hope JFFS2 doesn't have the same bug? FWIW, this class of bugs (f_pos races, *not* kfree-under-us) is dealt with by switch to saner API - see commits in linux-next marked [readdir]