Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751547AbaKIVTQ (ORCPT ); Sun, 9 Nov 2014 16:19:16 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:55262 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751221AbaKIVTO (ORCPT ); Sun, 9 Nov 2014 16:19:14 -0500 Date: Sun, 9 Nov 2014 21:19:08 +0000 From: Al Viro To: David Miller Cc: herbert@gondor.apana.org.au, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bcrl@kvack.org, "Michael S. Tsirkin" Subject: Re: [PATCH 1/4] inet: Add skb_copy_datagram_iter Message-ID: <20141109211908.GF7996@ZenIV.linux.org.uk> References: <20141105210745.GT7996@ZenIV.linux.org.uk> <20141105.165719.835728206041332333.davem@davemloft.net> <20141106032533.GU7996@ZenIV.linux.org.uk> <20141107.164859.951682597018909290.davem@redhat.com> <20141107221114.GB7996@ZenIV.linux.org.uk> <20141107234253.GE7996@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141107234253.GE7996@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 [Michael Cc'd] On Fri, Nov 07, 2014 at 11:42:53PM +0000, Al Viro wrote: > I'll finish RTFS drivers/vhost and if it turns out to be OK I'll post the > series moving those checks to the moment of copying iovec from userland, > so that kernel-side we could always rely on ->msg_iov elements having been > verified. Two questions: 1) does sparc64 access_ok() need to differ for 32bit and 64bit tasks? AFAICS, x86 and ppc just check that address is OK for 64bit process - if a 32bit process passes the kernel an address that would be valid for 64bit process, but not for 32bit one, we just get a pagefault in __copy_from_user() and friends. No kernel objects are going to have a virtual address in that range, so access_ok() doesn't bother preventing such access attempts there... 2) shouldn't vhost_dev_cleanup() stop the worker thread before doing anything else? AFAICS, we do parts of vhost_dev teardown while the thread is still running; granted, we keep dev->mm pinned down until after it stops (or we would be _really_ screwed), but is it safe to do all those fput()s, etc. while it's still running? Michael? -- 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/