Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756109AbaLHSfz (ORCPT ); Mon, 8 Dec 2014 13:35:55 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:59242 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750980AbaLHSfy (ORCPT ); Mon, 8 Dec 2014 13:35:54 -0500 Date: Mon, 8 Dec 2014 18:35:42 +0000 From: Al Viro To: Linus Torvalds Cc: "Kirill A. Shutemov" , Linux Kernel Mailing List , linux-fsdevel , Network Development Subject: Re: [RFC][PATCHES] iov_iter.c rewrite Message-ID: <20141208183539.GF22149@ZenIV.linux.org.uk> References: <20141204202011.GO29748@ZenIV.linux.org.uk> <20141208164650.GB29028@node.dhcp.inet.fi> <20141208181401.GD22149@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 On Mon, Dec 08, 2014 at 10:23:26AM -0800, Linus Torvalds wrote: > Did this actually use to work? Or is it an issue of "the new iov_iter > is so generic that something that used to just return an error now > 'works' and triggers the problem"? Looks like it failed with EINVAL. Which might very well be the sane reaction - if we run into a vmalloc/module address, act as if we failed to get that page and exit the loop. > > What's the sane way to grab struct page * for a vmalloc'ed address? > > So "vmalloc_to_page()" should work. > > However, it's actually fundamentally racy unless you can guarantee > that the vmalloc()'ed area in question is stable (so you had better > have done that allocation yourself, and be in control of the freeing, > rather than "we look up random vmalloc'ed addresses). If vfree(buffer) races with kernel_read() into buffer, we are so badly fucked that stability of pointers to pages is the least of our concerns... > In general, it's really a horrible thing to use, and tends to be a big > red sign that "somebody misdesigned this badly" More like "nobody has thought of that case", at a guess, but then I hadn't been involved in finit_module() design - I don't even remember the discussions around it. That would be what, something circa 3.7? -- 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/