Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932466AbbFQPNG (ORCPT ); Wed, 17 Jun 2015 11:13:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33038 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753443AbbFQPNB (ORCPT ); Wed, 17 Jun 2015 11:13:01 -0400 Date: Wed, 17 Jun 2015 17:12:57 +0200 From: Igor Mammedov To: "Michael S. Tsirkin" Cc: Paolo Bonzini , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: Re: [PATCH 3/5] vhost: support upto 509 memory regions Message-ID: <20150617171257.11fe405d@nial.brq.redhat.com> In-Reply-To: <20150617163028-mutt-send-email-mst@redhat.com> References: <20150617092910-mutt-send-email-mst@redhat.com> <20150617105421.71751f44@nial.brq.redhat.com> <20150617110711-mutt-send-email-mst@redhat.com> <20150617123742.5c3fec30@nial.brq.redhat.com> <20150617123842-mutt-send-email-mst@redhat.com> <20150617134803.5a03d04e@nial.brq.redhat.com> <20150617134848-mutt-send-email-mst@redhat.com> <20150617142339.6e6deb12@nial.brq.redhat.com> <20150617151030-mutt-send-email-mst@redhat.com> <5581742C.9060100@redhat.com> <20150617163028-mutt-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1304 Lines: 33 On Wed, 17 Jun 2015 16:32:02 +0200 "Michael S. Tsirkin" wrote: > On Wed, Jun 17, 2015 at 03:20:44PM +0200, Paolo Bonzini wrote: > > > > > > On 17/06/2015 15:13, Michael S. Tsirkin wrote: > > > > > Considering userspace can be malicious, I guess yes. > > > > I don't think it's a valid concern in this case, > > > > setting limit back from 509 to 64 will not help here in any way, > > > > userspace still can create as many vhost instances as it needs > > > > to consume memory it desires. > > > > > > Not really since vhost char device isn't world-accessible. > > > It's typically opened by a priveledged tool, the fd is > > > then passed to an unpriveledged userspace, or permissions dropped. > > > > Then what's the concern anyway? > > > > Paolo > > Each fd now ties up 16K of kernel memory. It didn't use to, so > priveledged tool could safely give the unpriveledged userspace > a ton of these fds. if privileged tool gives out unlimited amount of fds then it doesn't matter whether fd ties 4K or 16K, host still could be DoSed. -- 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/