From nobody Sat Feb 7 20:58:12 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4501A433CD for ; Fri, 5 Jul 2024 17:10:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720199440; cv=none; b=XF89tdhx9HWl+XVYWPB6pY4W8ZaVn6yFswe9B2bjHKPxYtD/PYxGRP0Bwx6lFzCo6CmVKfGeAB3L5/9lffuXuC50c03vhobwsWR9muO5NSscl2/6X5KUNBr93A9Kzu01FlYPRS+FWp8j7HVY3xOHUNA5T9KPijO6+hjozKdDEy8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720199440; c=relaxed/simple; bh=rt35NjUgW/C91Lz67ZKBNDSx0DfEz1EQsLfxcW/ZjQk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=afK6vQTbNKsVbtJn4vX5YMmhY6UCx4kByl6CFhBxKnwbWHxHMYzmltu7w3tKrkV5UpYgHla3Y5fdfnaU6xAkDjnl1tovf3C8c84mEyTzCA13k4r0OumDCM0xapR2+MOlbrm4FNgvy5eX/Xd/J69ItzZPTRwPrkCS4lkSOZUXj4w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Sarjax3u; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Sarjax3u" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B6DEC116B1; Fri, 5 Jul 2024 17:10:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720199439; bh=rt35NjUgW/C91Lz67ZKBNDSx0DfEz1EQsLfxcW/ZjQk=; h=From:To:Cc:Subject:Date:From; b=Sarjax3uiZjlafHM4fgMvJ9iCO3kpJVODA3vdFT2ITpdaBX4x9i2CcihQMDyOCPJ0 oU4mQvvqrRmidMRnoeKDkHjYDCH7xjZWjMH6i86oRiOjaDSwfhCsetdP0LwBbyQskV zDPq3tyhBR1O7NvL943OeGrjXFG8I/5YDTYBjMnaiALxNVRVN7IsuKewy5YKrHqtFT bsv9vHtPLDJ6GaFA+DyA9ZayRpEFX/AnvjjoMqCw+ZZKsC4eJOs1Sn7MrCNbvIL+lk ct4z0PZM+/U7917VDEFWLb9cgWAhjrb3e27/E24mwIGMQc3wDhGx9amsZzk2+zci9e FqwTohwX4Rgxg== From: Jisheng Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] riscv: define ILLEGAL_POINTER_VALUE for 64bit Date: Sat, 6 Jul 2024 00:56:32 +0800 Message-ID: <20240705165632.3216-1-jszhang@kernel.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This is used in poison.h for poison pointer offset. Based on current SV39, SV48 and SV59 vm layout, 0xdead000000000000 is a proper value that is not mappable, this can avoid potentially turning an oops to an expolit. Signed-off-by: Jisheng Zhang --- arch/riscv/Kconfig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index c51b32a8ddff..c992eabbd002 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -313,6 +313,11 @@ config GENERIC_HWEIGHT config FIX_EARLYCON_MEM def_bool MMU =20 +config ILLEGAL_POINTER_VALUE + hex + default 0 if 32BIT + default 0xdead000000000000 if 64BIT + config PGTABLE_LEVELS int default 5 if 64BIT --=20 2.43.0