Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp109157rdb; Thu, 5 Oct 2023 19:22:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHsa3f9fSM9gRvFhqM/RTxHQQo1eJVeaOPjPuxJeQieqcgGhI7h62ROaHmoGcKrLg1mnK9G X-Received: by 2002:a05:6a20:42a0:b0:14b:3681:567e with SMTP id o32-20020a056a2042a000b0014b3681567emr8422137pzj.29.1696558923353; Thu, 05 Oct 2023 19:22:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696558923; cv=none; d=google.com; s=arc-20160816; b=A7a6l6NcvRCn2OXA3YEPDNHddBxuKqO4XUO6SrVxwlRZeIO2XfK4lTrXgWMsD6E+4z wiyIFLWqT1DhsrkGsEr7yFnavh3D2o7bKbCwRNFMSC9Rcizy882K1ydImEUXXBxGPKzY ZC8Mnb+XMeW+3aJrXV/QU2HNgO20XmCMm/PHKsVfGk2uio0gR0v5zZkshhf+tnobm811 veMg3qqzMsIq7BzhKQCgiqLTcLrTcW9nAQNgFhWReYEEGB38i9zROZOBE/ZVDY+xLAhG v69+qruBZZk5z4NgXMg9s+bluwEH2X3tFpqlBKOlAAeNYlq2Un3wF9FhFOUrsQQ+hMvU jTSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=YA+Cq8KKd5SLVssX1l4RlCcP9aKEvDTuHwUHfnMy3sQ=; fh=7cNOOnd3x8orkDYrS12GyLfbDU5PWDj125hJnkRRRw4=; b=egEYBBohXy9tWbfpWERZQetSC1Gb9KPLMiwQ7DKj5V40kxtxgFKkJIt7CaEzbAz9LS 4l0nBloGV+WoY1cEoo6t+NKBe+YPnzfd+6/wt8bZG2fmJucHRH8KzGYfSc64HSBmlDsL YpsqxnUZsyGPt0R2OUUA9XeOnoFmREVK8D/627pq9s4ZabyxH59jWAY9GYoIgM/2949m cDFM2xBmBZ53xi1hVr5lazWyyxUna2KwSLViRZ/FDJpAEtAaATuUCT70P+l/keITxsV7 +xug/iiwq4vmCNPHbgdMFfyDQxLptJlJPmezdrwlO4rLsnFQGbQzVQ7zSGeG0hqFVevR OHBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Z+L4E3oU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id w11-20020a170902e88b00b001b81fe65fa3si2914823plg.569.2023.10.05.19.22.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 19:22:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Z+L4E3oU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id BD72182ACAD2; Thu, 5 Oct 2023 19:22:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229785AbjJFCVq (ORCPT + 99 others); Thu, 5 Oct 2023 22:21:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229657AbjJFCVo (ORCPT ); Thu, 5 Oct 2023 22:21:44 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14B9ADE for ; Thu, 5 Oct 2023 19:21:44 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-d8153284d6eso2356115276.3 for ; Thu, 05 Oct 2023 19:21:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696558903; x=1697163703; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=YA+Cq8KKd5SLVssX1l4RlCcP9aKEvDTuHwUHfnMy3sQ=; b=Z+L4E3oUhFAGSLgAywc0kpzZzAgpzgvZMI4XgpBJxtGUnyKLGO7UWCEbB0mkbmips/ 0qElMp2EAZ5e7E0U7nE/yZLpN1MOCiwZ/bSygH9HleqIr1+yeuGYd0WDq0WU2fIQ/KL5 ssQwhMeWQwQTyruEbcLI+haJ2ZIe/mYcKuMLmbkvoD+RLnufyyLMV/N0/W6cZMdjVzo2 U+UNEe28hvG6yxrO4OwYJWEPtSOFgfgvoadCsrIEXZqXElfCCndmQOdE2cpm2T+7+NcC 3OQeLjEhioAqTNGNliX6v6yLHuNPyJNgdlXsqM7VhQ7GnMjqVMO+aulKNZXKQ47Ha5ou NGlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696558903; x=1697163703; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=YA+Cq8KKd5SLVssX1l4RlCcP9aKEvDTuHwUHfnMy3sQ=; b=Bqn0yAEijIQRHGsdRs04eVkyHvtC2+2JS04sLm2KDj0/1oU3OBsn9vNX17KPHm2D+r +GZIa0xi6ysFdiPnVvUAQL0uaz89Y1OwmQpJuLb3dDYxTZjTaPK+adgbL204hn0Eruzs 9dzBi2vLg8XklQIVErowiCgLmttrn/ecN2nqvVWXxtntuPNPHUYhCzVSNsSNOz0begLR ySgFRquo2pAfbgrCL9m3uF7ruGxCWjzAQ3O+9r1EcQML1KbE0X/TkUgcWI5+u/b4gr7R rBFVomY4lRwt3c6mqXJLHjcIIJTpTWnzI5nz4XdvJukubdnUP8dnNH/L+jFqi6tetRPn 8ftw== X-Gm-Message-State: AOJu0YxvPzhxjE6mEw1PK8XzA01PcVtIkOBfrfHjSSpjwY/BKjvTufe6 bnlSJ0rR3EIv890Qs5Kl4FBcz0OQwo0= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a25:8a0d:0:b0:d81:7617:a397 with SMTP id g13-20020a258a0d000000b00d817617a397mr114628ybl.9.1696558903249; Thu, 05 Oct 2023 19:21:43 -0700 (PDT) Date: Thu, 5 Oct 2023 19:20:07 -0700 In-Reply-To: <20231002133230.195738-1-michael.roth@amd.com> Mime-Version: 1.0 References: <20231002133230.195738-1-michael.roth@amd.com> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog Message-ID: <169655697465.3534024.7746001565902273346.b4-ty@google.com> Subject: Re: [PATCH gmem FIXUP] KVM: Don't re-use inodes when creating guest_memfd files From: Sean Christopherson To: Sean Christopherson , kvm@vger.kernel.org, Michael Roth Cc: linux-kernel@vger.kernel.org, Paolo Bonzini Content-Type: text/plain; charset="utf-8" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 05 Oct 2023 19:22:00 -0700 (PDT) On Mon, 02 Oct 2023 08:32:30 -0500, Michael Roth wrote: > anon_inode_getfile() uses a singleton inode, which results in the inode > size changing based with each new KVM_CREATE_GUEST_MEMFD call, which > can later lead to previously-created guest_memfd files failing bounds > checks that are later performed when memslots are bound to them. More > generally, the inode may be associated with other state that cannot be > shared across multiple guest_memfd instances. > > [...] Applied to kvm-x86 guest_memfd, thanks! I added a comment to explain the use of the "secure" API, there's a non-zero chance we'll forget that wrinkle again in the future. [1/1] KVM: Don't re-use inodes when creating guest_memfd files https://github.com/kvm-x86/linux/commit/b3bf68b66062 -- https://github.com/kvm-x86/linux/tree/next