From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754657AbbI3Val (ORCPT ); Wed, 30 Sep 2015 17:30:41 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:32442 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752734AbbI3Vai (ORCPT ); Wed, 30 Sep 2015 17:30:38 -0400 Message-ID: <560C5469.5010704@oracle.com> Date: Wed, 30 Sep 2015 17:30:17 -0400 From: Sasha Levin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Al Viro , Andrey Ryabinin , willy@linux.intel.com CC: Chuck Ebbert , linux-fsdevel , LKML Subject: Re: fs: out of bounds on stack in iov_iter_advance References: <55CB5484.6080000@oracle.com> <20150815161338.4ea210ff@as> <55D1A6D4.3080605@gmail.com> <20150819054650.GD18890@ZenIV.linux.org.uk> <55FB75D0.7060403@oracle.com> In-Reply-To: <55FB75D0.7060403@oracle.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/17/2015 10:24 PM, Sasha Levin wrote: > On 08/19/2015 01:46 AM, Al Viro wrote: >>> or mapping->a_ops->direct_IO() returned more >>>> than 'count'. >> Was there DAX involved? ->direct_IO() in there is blkdev_direct_IO(), >> which takes rather different paths in those cases... >> > > So I've traced this all the way back to dax_io(). I can trigger this with: > > diff --git a/fs/dax.c b/fs/dax.c > index 93bf2f9..2cdb8a5 100644 > --- a/fs/dax.c > +++ b/fs/dax.c > @@ -178,6 +178,7 @@ static ssize_t dax_io(struct inode *inode, struct iov_iter *iter, > if (need_wmb) > wmb_pmem(); > > + WARN_ON((pos == start) && (pos - start > iov_iter_count(iter))); > return (pos == start) ? retval : pos - start; > } > > So it seems that iter gets moved twice here: once in dax_io(), and once again > back at generic_file_read_iter(). > > I don't see how it ever worked. Am I missing something? Ping? Thanks, Sasha