From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) (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 04D45EACD for ; Fri, 16 Jan 2026 13:37:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768570634; cv=none; b=o3hnvAISKVe+DNf9Hm5L4Tlh7x8IeMlDQh6Klzblpo11pCwFU9op0jjajJjrrQQSI1mcjMbWG3BijiFtnG1QMlzAfok/ljqz1L9bgavDqmOJZfpXfqTlTLbrXLT5oxvLu8Uno8FTJEa8tRFr84O87kieo7QXg3QGlcHsTXq7Pqw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768570634; c=relaxed/simple; bh=QcMd1PPgJMS9NpvhNmi4pT4J/gX3Jqqj/pidcuWjA+M=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=akar8d15Yjpvtm61AzXh+QAAlw6yA1T5bFUv711jFabShagAPm5xXFflpHD2LpMbWk4c3Bv6WL5NBh+nkqkgM+MhB8GeZPn4ZvITiV5RXGSyfwZcihuC5+jCLVDqcbqFiQdkNjS46WT7+oZS1xbSGYR53eG5pYvaOZsNusiF2GU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PtyLTAxt; arc=none smtp.client-ip=209.85.167.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PtyLTAxt" Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-59b6eb4aca0so128387e87.2 for ; Fri, 16 Jan 2026 05:37:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768570631; x=1769175431; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=DngFN/gqjOQfQFekRPoAxNCTly3dG4yhCs5BgGxEbUI=; b=PtyLTAxtBkUqhjsbKIdrP6h4nPzrnEKXa8yAQ2sIuoq6FX3D5qyf/q463xIVseRmTk FUprZtYTjiAXQaTgRS5h95z0OnJKPcC6PGMHpNgkYXErNecsk9pCclYb/lcpORR+SuXH I4zPkF+lXQ3Bzl+9LocUGWJDoqB4T0wsqimwURlowjSMwFTnx0C3gVHU47qdHLcVyE4W bHro5eEA4MfglYnWXXq0w7ljsLRaRBWKd4HjpR0aOS6VWXa7gTTn75iJPqgPEQE9KKIN AfWankN2Fn0Ii4uenRR8m55zqw08lyEAPOo+DQXbX30NCZdSmLgu3AhEpgsBbCkQ4Wb2 1SkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768570631; x=1769175431; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=DngFN/gqjOQfQFekRPoAxNCTly3dG4yhCs5BgGxEbUI=; b=eMQyhiHdTM9DD0oinK50R6qXqGEBtxuKfD7Vc5oZQixjSqTzKE45hGYLDPlDiF73j6 8//h5cF93t5xDdwAh5LOR5o2ZJIos0NXMaxYhIt9jDZfacDlyCkIkmfq106snKPr5Rnb uM8/cI9OZqqSANV7vt0idu+LA0TT++YVEx7J+Lwbsc5tBEOMCk6RdYfieY26TH8xZtC4 OQPlsBe3rhNV8uR/YZb3y3K1FOmIqR4wQhuJAnQnTJ4RoRl2SCpBUj6oOjIdvRytqznp +wkWIUWBqoWUuGf8G69j0eCfyS7PwSxkHzDDAg7Xu90mhO4VO8UBAjX6ZXnwduh22ZHn IdyQ== X-Forwarded-Encrypted: i=1; AJvYcCUl3kQUiDfRIYEEWKQskUyV0AtB1L7QFYLuG3nnbXWNu/O7VRI2Mvf9YNEjnZMriQrjyUQaPbHEm38VZ3w=@vger.kernel.org X-Gm-Message-State: AOJu0YxsdVlAf3k1r6ih7MxuakxnSypc/ubvryb3n8DoMQBw5jvt7M2x ewR6Kp0VDeV3Y9yJ2WvV3fUW6bfCX1F324dJ1xDMROiRggGwCaFvwguR X-Gm-Gg: AY/fxX5s/o8a4bls1d7SzCNOfsusK2Hksm7erpcdsR5o+vPt7/uwj77zHwU45fuyrY1 dKNnvkoVxWz1vMLV0XAN6IGipIbeJKm/SrYl8+sVKaGViGT0NrAS/Kk7Oa9/Hg4uTAeTlh005DW 5VwOD0JHkqDnBxdb/RRntgj6Ae+YEAIGYbZ7XnxUTzNeqH5fpa9qXfzcY4tzaw1l3G2SpKL7UCc bUcmpR+aQkxYRsmKXQs5vEsavitYiY8cGgsf66qqagfZjLc5/mSdGjibZ7/sFhX7IXG/GynYQ0g 0RbE2T7Daoh4mBR8iDtBatabOTZaaAC7o7irUI6yVwHxd2O/r0xQ2kA+FWWyspKyQjJVMsf45J+ x2zYT9Xmp21UrIzgD9c8qAjlkU5TTDQCfnXh0JTgWUbt9r4DQSiO9NztdCCgWW3iGszCEYYyWwY 7uOFcawhQRaleKS9st/Q== X-Received: by 2002:a05:6512:2c85:b0:59b:b597:f6ff with SMTP id 2adb3069b0e04-59bb597f75amr19913e87.2.1768570630863; Fri, 16 Jan 2026 05:37:10 -0800 (PST) Received: from [10.214.35.248] ([80.93.240.68]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-59baf397ae4sm781058e87.59.2026.01.16.05.37.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 16 Jan 2026 05:37:10 -0800 (PST) Message-ID: <2077c91e-0789-4ecc-9560-550d9b1a56d5@gmail.com> Date: Fri, 16 Jan 2026 14:36:24 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v8 08/14] x86/kasan: KASAN raw shadow memory PTE init To: Maciej Wieczor-Retman , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Vincenzo Frascino , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" Cc: Maciej Wieczor-Retman , kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org References: <9968297ee3c83a73e1fb05c6415b024d1d2d6a04.1768233085.git.m.wieczorretman@pm.me> Content-Language: en-US From: Andrey Ryabinin In-Reply-To: <9968297ee3c83a73e1fb05c6415b024d1d2d6a04.1768233085.git.m.wieczorretman@pm.me> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 1/12/26 6:28 PM, Maciej Wieczor-Retman wrote: > From: Maciej Wieczor-Retman > > In KASAN's generic mode the default value in shadow memory is zero. > During initialization of shadow memory pages they are allocated and > zeroed. > > In KASAN's tag-based mode the default tag for the arm64 architecture is > 0xFE which corresponds to any memory that should not be accessed. On x86 > (where tags are 4-bit wide instead of 8-bit wide) that tag is 0xE so > during the initializations all the bytes in shadow memory pages should > be filled with it. > > Use memblock_alloc_try_nid_raw() instead of memblock_alloc_try_nid() to > avoid zeroing out the memory so it can be set with the KASAN invalid > tag. > > Signed-off-by: Maciej Wieczor-Retman > Reviewed-by: Alexander Potapenko > --- Reviewed-by: Andrey Ryabinin