Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031764AbbKFCTL (ORCPT ); Thu, 5 Nov 2015 21:19:11 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:41568 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031709AbbKFCTI (ORCPT ); Thu, 5 Nov 2015 21:19:08 -0500 Date: Fri, 6 Nov 2015 02:19:00 +0000 From: Al Viro To: Sasha Levin Cc: Andrey Ryabinin , willy@linux.intel.com, Chuck Ebbert , linux-fsdevel , LKML , Jens Axboe , Linus Torvalds , Dan Williams Subject: Re: fs: out of bounds on stack in iov_iter_advance Message-ID: <20151106021858.GU22011@ZenIV.linux.org.uk> References: <55CB5484.6080000@oracle.com> <20150815161338.4ea210ff@as> <55D1A6D4.3080605@gmail.com> <20150819054650.GD18890@ZenIV.linux.org.uk> <55FB75D0.7060403@oracle.com> <560C5469.5010704@oracle.com> <20151106013402.GT22011@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151106013402.GT22011@ZenIV.linux.org.uk> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1519 Lines: 42 On Fri, Nov 06, 2015 at 01:34:02AM +0000, Al Viro wrote: > Could you try to reproduce it with this: > > dax_io(): don't let non-error value escape via retval instead of EFAULT > > Signed-off-by: Al Viro > --- > diff --git a/fs/dax.c b/fs/dax.c > index a86d3cc..7b653e9 100644 > --- a/fs/dax.c > +++ b/fs/dax.c > @@ -169,8 +169,10 @@ static ssize_t dax_io(struct inode *inode, struct iov_iter *iter, > else > len = iov_iter_zero(max - pos, iter); > > - if (!len) > + if (!len) { > + retval = -EFAULT; > break; > + } > > pos += len; > addr += len; > PS: "block, dax: fix lifetime of in-kernel dax mappings with dax_map_atomic()" Dan Williams had posted a while ago does change the things a bit, but AFAICS only in turning "return a bogus positive value" into "return an uninitialized value"; if applying that one after it, s/retval/rc/ in the above. And whether it fixes the bug Sasha had been able to trigger, the bug is real and needs fixing - it's been there since 4.0 when fs/dax.c went into the tree. How are we going to handle that one? I can put it into mainline pull request via vfs.git, with Cc: stable, but if e.g. Jens prefers to take it via the block tree, I'll be glad to leave it for him to deal with. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/