Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1710637lqe; Mon, 8 Apr 2024 19:02:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUDXxj/6JuSII3PUVSYXz5NneO/nL4G38KBW25/Tv18nHqcot7DSgb5ed4qHctHLIwUR0JctO3fULoTihy7er1aUoLuULfVTQl8V5vA9w== X-Google-Smtp-Source: AGHT+IEyi1VU6LVOMr1ghZUwnN42qMo1mBF2qpvcqXTxR9vcw/N37j+Q2Tb+iKnK6yAXkPetLWKB X-Received: by 2002:ac8:5d55:0:b0:434:7613:5697 with SMTP id g21-20020ac85d55000000b0043476135697mr7554692qtx.2.1712628120089; Mon, 08 Apr 2024 19:02:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712628120; cv=pass; d=google.com; s=arc-20160816; b=K5r9m7IMz3DSsFbR43tdyHxahupP7uUEOjkix/+j0ujh0CESM8EEfeZeDSDTtLNoUT A1y/ohxPDBPHmk2chqaDfOnkEb8gnWmX0mEaaBYQi5J/bNT/FSPruWMt30euPZ1h2fVD 4l212sDfqCglC3sHfI6StUZiG+MDBpp0lC99lfZU1YPgxSZf+xfwxPEy55s8xKc8T4Ru Lf6wUHwCOjt8hBTl0mypGs1k3l/LdAc3oKybGxCsjcGsbKMHjviA2o7dI7QUbLMjEQi7 40ijx9Ie0e8SgQ3ZWAC05A3EkgzQ9rGlz9rXLvi73hj4RGmHhb7E2dFSRZixPSbgX5V/ nL4g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=I0MyZK4MuxKPsN1IFuhdXaa5jTxGtBSl229mSO00MeI=; fh=+sT6CnSxrYKh6sdrx9gkkV2B8N30HwmzgS/bYs5S0cQ=; b=iuJ4LFM5o8F2fVIbXs8fePivdi8qF3g5Ay4lb2VJuGKgp6SZXCcFA99X2/Ej+7BaDK WE3yDf2hT3LUlWb93oKlCkkTAHWdNeyFCCo8k2WAX1R3VSwpuSGEDD5gXN3YgLVXvkZz 6usjUyquShlKr1G2aWJFwV/i/vVxCFCytkcf7q6enxYa3zG68WKpzrFez6Z/hoca505+ 8YE74IUDYK0xIVqeHBJb+A83r9N2KIY0Ss7l5Sq27+/gTt0q0fcqMhWzVaOj8KUGtjsa OxbfjeWRBBDCqKwRtDmKf16/QxiftsCA5Bv+taySVU9wwLCIeNDKEZXjN07FCrRMkgNW 4wCQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=ZCUhcjb5; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-136114-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-136114-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d11-20020a05622a15cb00b004347a332f5csi6160769qty.296.2024.04.08.19.01.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 19:02:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-136114-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=ZCUhcjb5; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-136114-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-136114-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id CE1AA1C2108A for ; Tue, 9 Apr 2024 02:01:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9A47B50261; Tue, 9 Apr 2024 02:01:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ZCUhcjb5" Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 744AB4F887 for ; Tue, 9 Apr 2024 02:01:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712628104; cv=none; b=D4d81iewvxPneqXdo8HUuZx+qbwVyWjROQkI5CMGnpeF5DEGXwR989Fe60XIXZWoMAicnsSNOPPolbOKQ58HgV5+LifCz7NDhsgTl+WtxA96fsAq/dkZsGtb7lfkdOj2enpYtB77mbQhzHCKyLxjMnQnt0XTJvmL7Bj9c0iISyI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712628104; c=relaxed/simple; bh=R6wBWyvbKby2JcJVzeeM1JrJCn8KU1dV5kM9O1XYv3c=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=NYn+ik+7rjssDtGBf6flFnyq/10YNrqEAQ8O9oBVz4mT7kdiw8pL+HTv8pg1ECWxIgjd8fK0vMWJcUfA7slM46sksTI4d0Z9iizashtOOWe1SqIipi2UiFT0+nSOeqLom/p4vmat2EjwZ5vQ1W37jlx0cgny91GAsqfXwePXPTg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=ZCUhcjb5; arc=none smtp.client-ip=209.85.214.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-1e2b1b90148so36676795ad.2 for ; Mon, 08 Apr 2024 19:01:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1712628103; x=1713232903; 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=I0MyZK4MuxKPsN1IFuhdXaa5jTxGtBSl229mSO00MeI=; b=ZCUhcjb52QfkkFes1dMyrI8FuCUbanlJSdbQVHCMie14W5/7Db6S9zRI/EIw2a7bz7 j9hllqEEIwbnw8WOOY0tYWyRtBqi1anNrq+QOqR95v++Xo+Z4TpIe8l6OldodNHduR6v aeOek1YYXVsGEA3F6QEG9r+eZ8gG86ydI/uS/uHndHxD4OG4Cn+En30dPrvjhbIT31Bc vJy7vMQVbwayovf/+ntEBQdSl3ehsixSlcPgaWSeEr5D75i9AbaYHxaS5OZnrp1wa6SN HOi8//TtyxdHvuLNO+IzYeYySs54xVJJG2Pi/SOnQJG0iyk4RZOsjS1IakklWCpylAD3 RHIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712628103; x=1713232903; 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=I0MyZK4MuxKPsN1IFuhdXaa5jTxGtBSl229mSO00MeI=; b=fy9poUkYv0d+J8Ux9YP3ZXp9euwcqbaTaLB8Kwmzisx5gTa6uGMaSQr5sqfYVtfHZM 1Alxb+3pnGL9WfL4M5C50JSygb7Oi35dCSjZraOESd+nEhEOJEq3zbQr9cUZQvEhLulX vVP3+/cwVH67EGCEXJOgWQnKA68CcAS7fRwDwInlmMl2amkNr8mF0+Kar13PHkZJKg52 srW2CYMG+2bnpkfXSSNrY9pWqhDkvpz6uu+j78AogNmGbKPYnlpQ81pwMUaggk/Wi50C bXaYJTNpj/DYu1V/EHhhRs0X+qm/ETeeE1EhbWBcef/kre9FPtSaFzWmo891/dEVZ345 12Xg== X-Forwarded-Encrypted: i=1; AJvYcCXPlAOi0WzMpH2fMESN/EviBqfYR/2sk1LOHK04svrdmcLOe7qgBfgKie2W2PYL6DTU/yh1DlQLPsHhzId2nKjiTkr52vob1TqsSO/R X-Gm-Message-State: AOJu0Yz30mgiByq9FjhsD+dj1gKkNQ9AOBXXXapI6ytjxLA7hGpZQQFW d6AYV2r3bBvpFPDzM5dLlF8quybFAqB397ujjJHwDl4LjhiIhjYZKNzZNZZj1/RYgOW6EaoW8Ew NjA== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:902:d50a:b0:1e4:881f:bed1 with SMTP id b10-20020a170902d50a00b001e4881fbed1mr92462plg.7.1712628102823; Mon, 08 Apr 2024 19:01:42 -0700 (PDT) Date: Mon, 8 Apr 2024 19:01:25 -0700 In-Reply-To: <20240314212902.2762507-1-rick.p.edgecombe@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240314212902.2762507-1-rick.p.edgecombe@intel.com> X-Mailer: git-send-email 2.44.0.478.gd926399ef9-goog Message-ID: <171262711269.1419750.7343660666296265143.b4-ty@google.com> Subject: Re: [PATCH v2] KVM: x86/mmu: x86: Don't overflow lpage_info when checking attributes From: Sean Christopherson To: Sean Christopherson , pbonzini@redhat.com, chao.p.peng@linux.intel.com, isaku.yamahata@intel.com, Rick Edgecombe Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" On Thu, 14 Mar 2024 14:29:02 -0700, Rick Edgecombe wrote: > Fix KVM_SET_MEMORY_ATTRIBUTES to not overflow lpage_info array and trigger > KASAN splat, as seen in the private_mem_conversions_test selftest. > > When memory attributes are set on a GFN range, that range will have > specific properties applied to the TDP. A huge page cannot be used when > the attributes are inconsistent, so they are disabled for those the > specific huge pages. For internal KVM reasons, huge pages are also not > allowed to span adjacent memslots regardless of whether the backing memory > could be mapped as huge. > > [...] Applied to kvm-x86 fixes, thanks! [1/1] KVM: x86/mmu: x86: Don't overflow lpage_info when checking attributes https://github.com/kvm-x86/linux/commit/992b54bd083c -- https://github.com/kvm-x86/linux/tree/next