From nobody Fri Apr 3 08:27:05 2026 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) (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 82A263C5524 for ; Fri, 20 Mar 2026 15:00:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774018810; cv=none; b=MB+hwIKmLd1x96vbK+YPpLgnDTL0DTSY6QLiG3HO1iEmm3eGZv0eq3cDq2UMWOKEgW5BvNyoDR+QyatpBdV4Cw5O56RKWcuvxE6kYurs5ajuiIQlO2cSpv4ETm4OekZqb2SrD8nmI7nYZ9M5u4CAxaDZNoo0jVdjsaefxJ9nz2w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774018810; c=relaxed/simple; bh=VqpVj+W0FM6b9m8WDPY3YbvaCmG28PnmLS9IjR3RHKo=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=cZwW6phvd0vOVKvlCIqviQOwLH+anQA4xsthH+iG8KFfcs/nPIpbAty++o51q/zduYeDZhFrGgHmjo1euVqmRPvcVXChvfsV+UNY8iQCmIXq1Y8I+vWVvUXTSDBfEECnra9s6HKXhWv7C9Vt81AQ5TkVTxjKdcT7tMHoUJc7+4g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=fi5D94oP; arc=none smtp.client-ip=209.85.128.74 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--ardb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="fi5D94oP" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-486fe36cf73so7101955e9.1 for ; Fri, 20 Mar 2026 08:00:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1774018805; x=1774623605; 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=FREiFmsRIXiOQcSDf+g4S+t23y0B3LOgQe0t9T04+rU=; b=fi5D94oPSe/zlJhcU/9OwaY5KG/DDr6G/M1edabSkl2bDsKI5zXg2ycGNyyJ3cr1zV 12cAcoM9pd0IKVwdwiRpupU0Qo4vQ17grQgH+5hz3MOYn119sjsErvv00TXfpJDbJ86X w0EHu0ZTcVMsyOP+F0PoNxf6ET2eOzNyc8afUSmFcbFcc7J0Zr4maUj7rmkePHr78oOs 8+BfHcqtATLnVz/IpwpI6z4zH6slhJ4CZZvcWpHDSfjlIWIstwrnLq7m7374G78dOar8 sPsuqTIAYvOw+oyT8TAprGI0N5pcHdfCGsGOqrdJWg8piD6VsDrxja0pR5Hslte/xi9N Z7rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774018805; x=1774623605; 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=FREiFmsRIXiOQcSDf+g4S+t23y0B3LOgQe0t9T04+rU=; b=gdIqbp2pKSAtl1EvF23p5Uhkv1y8ojEYYH1pI6ZQKWNEcIlHgqSj+AWlchtDVkGI8w hBrTscWkqIXo3NIAhz5tkyibjINGw8nrFIHU3RBQUaVKaM9dGFHEN+7tTfg2nntnUGZU YZuVNWVoujWN8RI1g5Se4VceoxjvBUt0dCpZUj0aC7VEVW3V1QFz3baFphyy5NVxPiP4 Ag+/SUITQRUtzXsBTnEjdxLqJ+QRaaC4CJxrSbpkTnpdwiRC0yfmMgulJlmTuGNhmihL 3/DV8snGY7tDoKFLKK/6fxDVActjBEDjN7lbzZefSiVQPBFueZXqlb/D47pNn4gtwWoR eQpQ== X-Gm-Message-State: AOJu0YzzkIgkFzfdVc1vEcyuWAeE9rXub7KDGnJv+cd4eeGQ3mGYumKF Zn3qmj+1m+BpFCKeHiiT78rPN0O/WQnecGG7NPGgtEsYAObxRoyg11RBJftscHERfkOsYIs5FIe Unm1Bmo3tdL54zhXKZOhQy9szD4FqdmjKCRAOGPopi6pKNDh3MPfF3/37oZgHUUKMycyR8PXbxX QKUUy0iM9TedmTxn7qSruCrXuIggeKD+RKyA== X-Received: from wrwp1.prod.google.com ([2002:a5d:68c1:0:b0:43b:443c:fc00]) (user=ardb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:1f0e:b0:486:5f71:5829 with SMTP id 5b1f17b1804b1-486fedab740mr49836565e9.5.1774018804352; Fri, 20 Mar 2026 08:00:04 -0700 (PDT) Date: Fri, 20 Mar 2026 15:59:41 +0100 In-Reply-To: <20260320145934.2349881-15-ardb+git@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260320145934.2349881-15-ardb+git@google.com> X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-Developer-Signature: v=1; a=openpgp-sha256; l=914; i=ardb@kernel.org; h=from:subject; bh=E+pO5/eHkkh2sajPGACS/nW0kkP4G/kfrd6uShLIRX4=; b=owGbwMvMwCVmkMcZplerG8N4Wi2JIXNvwn1xAS6VoMiOyA2+FtGnPNwL5JMFZkScquZs1dh6u t1XqKejlIVBjItBVkyRRWD233c7T0+UqnWeJQszh5UJZAgDF6cATCR+GSPDoSuMq7lCWb9aveeY 7Bn0TcF2hdf55QUZssayBlVT/HlnMjKs/79HqyM9/M2u1Qa/OsRvb2R5csxUmk3+gI7K2Rfx28T 4AQ== X-Mailer: git-send-email 2.53.0.959.g497ff81fa9-goog Message-ID: <20260320145934.2349881-21-ardb+git@google.com> Subject: [PATCH v3 06/13] arm64: mm: Permit contiguous descriptors to be rewritten From: Ard Biesheuvel To: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, will@kernel.org, catalin.marinas@arm.com, mark.rutland@arm.com, Ard Biesheuvel , Ryan Roberts , Anshuman Khandual , Liz Prucka , Seth Jenkins , Kees Cook , linux-hardening@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ard Biesheuvel Currently, pgattr_change_is_safe() is overly pedantic when it comes to descriptors with the contiguous hint attribute set, as it rejects assignments even if the old and the new value are the same. So relax the check to allow that. Signed-off-by: Ard Biesheuvel --- arch/arm64/mm/mmu.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 744cf76f25aa..6780236b6cf8 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -140,10 +140,6 @@ bool pgattr_change_is_safe(pteval_t old, pteval_t new) if (pte_pfn(__pte(old)) !=3D pte_pfn(__pte(new))) return false; =20 - /* live contiguous mappings may not be manipulated at all */ - if ((old | new) & PTE_CONT) - return false; - /* Transitioning from Non-Global to Global is unsafe */ if (old & ~new & PTE_NG) return false; --=20 2.53.0.959.g497ff81fa9-goog