From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E843CC48BCF for ; Wed, 9 Jun 2021 09:11:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D1293610E6 for ; Wed, 9 Jun 2021 09:11:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237943AbhFIJNW (ORCPT ); Wed, 9 Jun 2021 05:13:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:54999 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237915AbhFIJNR (ORCPT ); Wed, 9 Jun 2021 05:13:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623229883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2ePZh2khRcBN5AJHEyhbtv31/bRFlPEJ4/4U8Xk0wMo=; b=M64qtcSJImQzhtgTOmErCPSUCVfDA27WQrMDsZFqi8D0nAbtoGdzbaTxmU2rm/6IvUdur8 97wew9Q8uthhuJD3tN6uKK1eQumK/V2vxZ2P3dcpb+9mysRpkusFhUZ4m8MkTrcRWDmj4i WSpc2d9NP+6z2ZkajbUKi+AkS6m/jUU= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-212-J4ffaF7ROjW3kSYrLgFNBQ-1; Wed, 09 Jun 2021 05:11:22 -0400 X-MC-Unique: J4ffaF7ROjW3kSYrLgFNBQ-1 Received: by mail-wr1-f69.google.com with SMTP id h104-20020adf90710000b029010de8455a3aso10494581wrh.12 for ; Wed, 09 Jun 2021 02:11:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=2ePZh2khRcBN5AJHEyhbtv31/bRFlPEJ4/4U8Xk0wMo=; b=SgCss/LSXDIhGAyNcC2f6Ao9h+VgeP79OwWszb9GN2QV3bEfcRLWKfioKaK6wZZsRh NXXfYEWLIqy4deRMEgPh8YItg6E880Tas63iJgQ6qSjaI2gsNBvJ/EC5+ORN6fjbLpAb Ee7YoHAW5RdjQOChjhwMlFAKk2soLXiMZbbgyLeF0glcrkOU+cxwxLoNWA/3+9lmiNMX vyDJ1SdYOjvm/uVAhYy40QXjDcdrlwJSRoa3rN3SuuItYPSrHPdBFizCsIJxQ0ZlxBz3 UXVOjeNc+m+B1vWzsO/77LcVymx6s3A0BFr82JLdXVPkWGtRSpKE/rMQDayOO7hVWszo 5R5Q== X-Gm-Message-State: AOAM531fOarEuI3GwPyXPPsjtaG+QTt+LEXcsLBF+MZN+/sYldPo6qOK wIM5LrJKrRX+agSB0t+4PFu5G2xDvX/VeNi033J2tWzgdz2ZpE0RmLEk/Sem3+z2xDXtsLXV4Ey kmJXPmt5sYYRaRaCiB8bIeBJR X-Received: by 2002:adf:e507:: with SMTP id j7mr26371298wrm.178.1623229880818; Wed, 09 Jun 2021 02:11:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBSu8Kim/TFLMDmfSnepx2bA9qkajHoLuNSdNG99iK42XOJ0rk/n+XjBkjpM8nPppmmP/+6g== X-Received: by 2002:adf:e507:: with SMTP id j7mr26371253wrm.178.1623229880319; Wed, 09 Jun 2021 02:11:20 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id z3sm24335841wrl.13.2021.06.09.02.11.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Jun 2021 02:11:19 -0700 (PDT) Subject: Re: [RFC] /dev/ioasid uAPI proposal To: "Enrico Weigelt, metux IT consult" , Jason Gunthorpe , Alex Williamson Cc: "Tian, Kevin" , Jean-Philippe Brucker , "Jiang, Dave" , "Raj, Ashok" , "kvm@vger.kernel.org" , Jonathan Corbet , Robin Murphy , LKML , "iommu@lists.linux-foundation.org" , David Gibson , Kirti Wankhede , David Woodhouse , Jason Wang References: <30e5c597-b31c-56de-c75e-950c91947d8f@redhat.com> <20210604160336.GA414156@nvidia.com> <2c62b5c7-582a-c710-0436-4ac5e8fd8b39@redhat.com> <20210604172207.GT1002214@nvidia.com> <2d1ad075-bec6-bfb9-ce71-ed873795e973@redhat.com> <20210607175926.GJ1002214@nvidia.com> <20210608131547.GE1002214@nvidia.com> <89d30977-119c-49f3-3bf6-d3f7104e07d8@redhat.com> <20210608124700.7b9aa5a6.alex.williamson@redhat.com> <20210608190022.GM1002214@nvidia.com> From: Paolo Bonzini Message-ID: <671efe89-2430-04fa-5f31-f52589276f01@redhat.com> Date: Wed, 9 Jun 2021 11:11:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/06/21 10:51, Enrico Weigelt, metux IT consult wrote: > On 08.06.21 21:00, Jason Gunthorpe wrote: > >> Eg I can do open() on a file and I get to keep that FD. I get to keep >> that FD even if someone later does chmod() on that file so I can't >> open it again. >> >> There are lots of examples where a one time access control check >> provides continuing access to a resource. I feel the ongoing proof is >> the rarity in Unix.. 'revoke' is an uncommon concept in Unix.. > > Yes, it's even possible that somebody w/ privileges opens an fd and > hands it over to somebody unprivileged (eg. via unix socket). This is > a very basic unix concept. If some (already opened) fd now suddenly > behaves differently based on the current caller, that would be a break > with traditional unix semantics. That's already more or less meaningless for both KVM and VFIO, since they are tied to an mm. Paolo From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_RED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 203B3C47095 for ; Wed, 9 Jun 2021 09:11:29 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BE10461285 for ; Wed, 9 Jun 2021 09:11:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BE10461285 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 8B68C608B9; Wed, 9 Jun 2021 09:11:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UU8NXKGgt1Az; Wed, 9 Jun 2021 09:11:27 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTPS id 6AA1D6082B; Wed, 9 Jun 2021 09:11:27 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3227EC000E; Wed, 9 Jun 2021 09:11:27 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 374DDC000B for ; Wed, 9 Jun 2021 09:11:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 1844E40169 for ; Wed, 9 Jun 2021 09:11:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp2.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=redhat.com Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id clU5YpK0xHj9 for ; Wed, 9 Jun 2021 09:11:24 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp2.osuosl.org (Postfix) with ESMTPS id B54D7400D4 for ; Wed, 9 Jun 2021 09:11:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623229883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2ePZh2khRcBN5AJHEyhbtv31/bRFlPEJ4/4U8Xk0wMo=; b=M64qtcSJImQzhtgTOmErCPSUCVfDA27WQrMDsZFqi8D0nAbtoGdzbaTxmU2rm/6IvUdur8 97wew9Q8uthhuJD3tN6uKK1eQumK/V2vxZ2P3dcpb+9mysRpkusFhUZ4m8MkTrcRWDmj4i WSpc2d9NP+6z2ZkajbUKi+AkS6m/jUU= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-344-OFh-Ss3kPOezyuaw1mei1g-1; Wed, 09 Jun 2021 05:11:22 -0400 X-MC-Unique: OFh-Ss3kPOezyuaw1mei1g-1 Received: by mail-wm1-f71.google.com with SMTP id z62-20020a1c65410000b0290179bd585ef9so710273wmb.7 for ; Wed, 09 Jun 2021 02:11:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=2ePZh2khRcBN5AJHEyhbtv31/bRFlPEJ4/4U8Xk0wMo=; b=NYffQhlq65uTsyyQ7HlLWU7jMcH50FAAewj7Fbw/C9LObcNl0RxXHOP2pdzQ4wrv+v gYIapfML1eg4bVsJpBfh/umwwWo9L0dlaNzbPjEvKWsUY/l/fvayMJG7iEgtD+7t7BEa SfLRYHzRIUQlveGjurbbfYtrCtNGiaNjbcmAeT4PXsc6h3mSklIjMDP5/tps+E6v8yoU 5MVsw9oOYoRKPV5HMM9HZrM+r1bRuzZXJ7cU3iOV9XZz8q68ByIM+a/dBQ71q2GCsEGt FKEGOWl76xbm1CQd7CrP1uWr4N+9zV6rq8OLZ3ynETI05ZJ2O4ZG/LmjlG63dzt02alL LjAA== X-Gm-Message-State: AOAM533R2g1A2IO4Eb8erk7OPTgtpOVBStswRnWmbF5WegR2FbBVFJPK H9GmrZpT/MpnncnvieqL3/LgMCeDlJgJhWcygUMayfAJF1FFuNoM0NZOyWxRKRCUSVnlmWCs7XD iaOvvLEIl+8i8dj7PWUDhjKz6OGAxBA== X-Received: by 2002:adf:e507:: with SMTP id j7mr26371289wrm.178.1623229880817; Wed, 09 Jun 2021 02:11:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBSu8Kim/TFLMDmfSnepx2bA9qkajHoLuNSdNG99iK42XOJ0rk/n+XjBkjpM8nPppmmP/+6g== X-Received: by 2002:adf:e507:: with SMTP id j7mr26371253wrm.178.1623229880319; Wed, 09 Jun 2021 02:11:20 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id z3sm24335841wrl.13.2021.06.09.02.11.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Jun 2021 02:11:19 -0700 (PDT) Subject: Re: [RFC] /dev/ioasid uAPI proposal To: "Enrico Weigelt, metux IT consult" , Jason Gunthorpe , Alex Williamson References: <30e5c597-b31c-56de-c75e-950c91947d8f@redhat.com> <20210604160336.GA414156@nvidia.com> <2c62b5c7-582a-c710-0436-4ac5e8fd8b39@redhat.com> <20210604172207.GT1002214@nvidia.com> <2d1ad075-bec6-bfb9-ce71-ed873795e973@redhat.com> <20210607175926.GJ1002214@nvidia.com> <20210608131547.GE1002214@nvidia.com> <89d30977-119c-49f3-3bf6-d3f7104e07d8@redhat.com> <20210608124700.7b9aa5a6.alex.williamson@redhat.com> <20210608190022.GM1002214@nvidia.com> From: Paolo Bonzini Message-ID: <671efe89-2430-04fa-5f31-f52589276f01@redhat.com> Date: Wed, 9 Jun 2021 11:11:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Cc: Jean-Philippe Brucker , "Tian, Kevin" , "Jiang, Dave" , "Raj, Ashok" , "kvm@vger.kernel.org" , Jonathan Corbet , David Woodhouse , Jason Wang , LKML , Kirti Wankhede , "iommu@lists.linux-foundation.org" , Robin Murphy , David Gibson X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On 09/06/21 10:51, Enrico Weigelt, metux IT consult wrote: > On 08.06.21 21:00, Jason Gunthorpe wrote: > >> Eg I can do open() on a file and I get to keep that FD. I get to keep >> that FD even if someone later does chmod() on that file so I can't >> open it again. >> >> There are lots of examples where a one time access control check >> provides continuing access to a resource. I feel the ongoing proof is >> the rarity in Unix.. 'revoke' is an uncommon concept in Unix.. > > Yes, it's even possible that somebody w/ privileges opens an fd and > hands it over to somebody unprivileged (eg. via unix socket). This is > a very basic unix concept. If some (already opened) fd now suddenly > behaves differently based on the current caller, that would be a break > with traditional unix semantics. That's already more or less meaningless for both KVM and VFIO, since they are tied to an mm. Paolo _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu