Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp280565pxb; Wed, 13 Jan 2021 03:33:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJxrktfiLI5a66tpjNZc18hmwbyoHGHZQx1SYTr5Apagz6bi5QmxBpsGrSYS+foWnGM2QOVF X-Received: by 2002:aa7:d75a:: with SMTP id a26mr1378504eds.230.1610537618157; Wed, 13 Jan 2021 03:33:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610537618; cv=none; d=google.com; s=arc-20160816; b=fwl5BevHejCHC17NtZ8kie/ICSnIAuB+AVMnjwD0D4uRULtCR2By2v2EVwMPI440za woivkIppWikTuh+Ygyyg9VyocAFpl/HBn43hNVbDZj+9VDcxt6tBhM91xAq+4sehrdHR iv8gneqNtKuef/nUqVJoVB8kFLaopLACZpEIXDsw3iqCJFJu0QrIofLxySQAqBYLSc7o HTZDpfTANrfKlXhuXMGEVp5SIjhKpZZGo0C+GAshZPboYCpAIqWym7kr/qFTvJH+evVY Oui/DHyqaXmadQT9UodRhjqf4zOpiPnGI8UT9hCL8LO7PgYhjUMqCQb6h25GV2oGneH4 OHYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=OCX73pgik8atVM/ulADfQ/xfN2q/ybM9ReTRfL4mJ9Y=; b=uE2Ao2C3DJawtxVxvfu4E7tfC1aJ9IvU/JVZ84dZZbi/zIuMh+QINEpdSG6PC0LV/C Ws+FqTr6ounWLCpeJCtGwmq/hTIyW4tOr+tWf98xCCOKdxbDITGoLIGyRA4n9buRBX7z kkThkXbTLV12BRyt7oIPAaDzbTMY8f9KIoq+d9ULsgozvhRXa+pCl3j6DflT6CZ7SWKp i0NgunJvMyun1OxX6FJX6SIJs7tWnUJFr6Xytx50t5FpQwvz0J0tzwpcADwV90IMngwI rftoK95aw+sdozLweEeWOdCaSOjz4IJUKn/UDBHM++xyS0s3dcWk6TIZMTuEWVqkZfZy rpig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u26si861185edo.164.2021.01.13.03.33.14; Wed, 13 Jan 2021 03:33:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727403AbhAMLbD (ORCPT + 99 others); Wed, 13 Jan 2021 06:31:03 -0500 Received: from verein.lst.de ([213.95.11.211]:59643 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727194AbhAMLbC (ORCPT ); Wed, 13 Jan 2021 06:31:02 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id 0514168AFE; Wed, 13 Jan 2021 12:30:18 +0100 (CET) Date: Wed, 13 Jan 2021 12:30:17 +0100 From: Christoph Hellwig To: Martin Radev Cc: konrad.wilk@oracle.com, hch@lst.de, m.szyprowski@samsung.com, robin.murphy@arm.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, joro@8bytes.org, kirill.shutemov@linux.intel.com, thomas.lendacky@amd.com, robert.buhren@sect.tu-berlin.de, file@sect.tu-berlin.de, mathias.morbitzer@aisec.fraunhofer.de, virtualization@lists.linux-foundation.org, kvm@vger.kernel.org Subject: Re: [PATCH] swiotlb: Validate bounce size in the sync/unmap path Message-ID: <20210113113017.GA28106@lst.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 12, 2021 at 04:07:29PM +0100, Martin Radev wrote: > The size of the buffer being bounced is not checked if it happens > to be larger than the size of the mapped buffer. Because the size > can be controlled by a device, as it's the case with virtio devices, > this can lead to memory corruption. > I'm really worried about all these hodge podge hacks for not trusted hypervisors in the I/O stack. Instead of trying to harden protocols that are fundamentally not designed for this, how about instead coming up with a new paravirtualized I/O interface that is specifically designed for use with an untrusted hypervisor from the start?