Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1115222rwi; Wed, 19 Oct 2022 06:57:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5SNMOG+ui5ePegaQdAJhkyeR9Fwef7z2lN+Q3Gd3XI4Ku3oMhH+b+VjrSDmKqlfF0/71ou X-Received: by 2002:a17:902:e5c3:b0:185:5100:26f3 with SMTP id u3-20020a170902e5c300b00185510026f3mr8826190plf.73.1666187844415; Wed, 19 Oct 2022 06:57:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666187844; cv=none; d=google.com; s=arc-20160816; b=edOTrxKd5wDNRVpS+ETiCzyki+jFwleOllNUgrkVaHmi1OCwXRHMi83aZPU2R3o7xt iqhX4i3vP5R9OAfQxjnPAIN6mp7MsKXGbQw56Ip/kpvg7LphUQclWFrufPCYaIcxaxAx LOveRJf9JSfGD769GblG1em1FxxdCLqESPkXKLZ1aabEQYxeadP0LOYKLClfBSvlqK+9 tN3n5rjRIurVTzdkb2Cwm0F5l+CD+k3CdspSAn6So9/6AEWZes+VNHbD0zAPv8yvBC1C +deGJMyx7fxQyGptFV4NfzVnxn1HycbCaj2CskXfq9m7X8UaAc7BNnADgitkQOZyFUe5 ahKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=mYDYplk2o92XVc5iI2vqKkMxDaQ//GWKK3Bb5PgIlDQ=; b=bDGrR7exRUkaQ2yYRXjt3zOEABWBdmlOiO7TnVPuV2bx8aAGzgrkbq52jWSC5eg/4J nyN4Y9zFNGuEoCsS5xYFHlMzB+zqWrH01p/qr5Xn5mGw+gm2aRQV73+rFfaWXOEQM7S8 lRIG4VFJqqotod5slx8fb2U0QHctmVKzU5H9gh3a86E3yRbyqyYPxYLBCH8nIE2A8SD/ Q4DBdYmfr41KDqZxamoXjAdmHxZ28GjjledgdvSw6PW0ffP8fimSnJkMz5dp+itI35Pa Ek37n4tbQrQnC9J/df+9B4zWPtaKfrxuhznSq/VC+9ln+HzZ9xS1n/3arHwbGgLerXxg DT6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gnOGPipM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q21-20020a17090ad39500b002006b213af9si40212pju.32.2022.10.19.06.57.11; Wed, 19 Oct 2022 06:57:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gnOGPipM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233654AbiJSNuI (ORCPT + 99 others); Wed, 19 Oct 2022 09:50:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233645AbiJSNsm (ORCPT ); Wed, 19 Oct 2022 09:48:42 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D4B21C8D5D; Wed, 19 Oct 2022 06:32:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 5BBD6CE20F0; Wed, 19 Oct 2022 13:32:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0EA2C433D7; Wed, 19 Oct 2022 13:32:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666186343; bh=wgaCgIIQv6GL6KJIOFePc+gBrTKmB+z9ZIHuM3k0ifI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gnOGPipMSWDY3/Gk4UFGA+GUjpCTWJ/wH3w6Nl8iTKLPjDVt3LS5JAi07fYcmKU+f DHJto78dkbY66u2AUdGwY7al5P+g+YORjXOArsNAAAXIs5d8qZ7w/HthI7m+kWwNKJ Kjlcm4o3YKS3vCvahN3koioZqTeahxHJRo0xECgBHGivwXJXSbjl90EWWqWsGPLWY/ 0sUpGvSml0a6UPyufDNyed9/90YMTsMqSdFGelX1azZJPSTelGFwTfmSpFpt+kpWwL QrQ1pJiikXCH9Cw2ma6xqe3jSdZ2sqjz10GyUiiRfZUb3RBwsRB2mjtpoJWfqC7+0w 9UDB/9rw8trEw== Date: Wed, 19 Oct 2022 19:02:19 +0530 From: Vinod Koul To: Fenghua Yu Cc: Arjan Van De Ven , Dave Hansen , Dave Jiang , Lu Baolu , Jacob Pan , dmaengine@vger.kernel.org, linux-kernel , stable@vger.kernel.org Subject: Re: [PATCH v2] dmaengine: idxd: Do not enable user type Work Queue without Shared Virtual Addressing Message-ID: References: <20221014222541.3912195-1-fenghua.yu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221014222541.3912195-1-fenghua.yu@intel.com> X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14-10-22, 15:25, Fenghua Yu wrote: > When the idxd_user_drv driver is bound to a Work Queue (WQ) device > without IOMMU or with IOMMU Passthrough without Shared Virtual > Addressing (SVA), the application gains direct access to physical > memory via the device by programming physical address to a submitted > descriptor. This allows direct userspace read and write access to > arbitrary physical memory. This is inconsistent with the security > goals of a good kernel API. > > Unlike vfio_pci driver, the IDXD char device driver does not provide any > ways to pin user pages and translate the address from user VA to IOVA or > PA without IOMMU SVA. Therefore the application has no way to instruct the > device to perform DMA function. This makes the char device not usable for > normal application usage. > > Since user type WQ without SVA cannot be used for normal application usage > and presents the security issue, bind idxd_user_drv driver and enable user > type WQ only when SVA is enabled (i.e. user PASID is enabled). Applied, thanks -- ~Vinod