[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250113172522.3cb1d061994a076cd7362487@linux-foundation.org>
Date: Mon, 13 Jan 2025 17:25:22 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
Cc: Shuah Khan <shuah@...nel.org>, Dev Jain <dev.jain@....com>, Thomas
Gleixner <tglx@...utronix.de>, David Hildenbrand <david@...hat.com>,
linux-mm@...ck.org, linux-kselftest@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel test robot <oliver.sang@...el.com>
Subject: Re: [PATCH v3 4/4] selftests/mm: virtual_address_range: Avoid
reading from VM_IO mappings
On Mon, 13 Jan 2025 14:15:38 +0100 Thomas Weißschuh <thomas.weissschuh@...utronix.de> wrote:
> The virtual_address_range selftest reads from the start of each mapping
> listed in /proc/self/maps.
> However not all mappings are valid to be arbitrarily accessed.
>
> For example the vvar data used for virtual clocks on x86 [vvar_vclock]
> can only be accessed if 1) the kernel configuration enables virtual
> clocks and 2) the hypervisor provided the data for it.
> Only the VDSO itself has the necessary information to know this.
> Since commit e93d2521b27f ("x86/vdso: Split virtual clock pages into dedicated mapping")
> the virtual clock data was split out into its own mapping, leading
> to EFAULT from read() during the validation.
>
> Check for the VM_IO flag as a proxy.
> It is present for the VVAR mappings and MMIO ranges can be dangerous to
> access arbitrarily.
>
> Reported-by: kernel test robot <oliver.sang@...el.com>
> Closes: https://lore.kernel.org/oe-lkp/202412271148.2656e485-lkp@intel.com
> Fixes: e93d2521b27f ("x86/vdso: Split virtual clock pages into dedicated mapping")
> Fixes: 010409649885 ("selftests/mm: confirm VA exhaustion without reliance on correctness of mmap()")
> Suggested-by: David Hildenbrand <david@...hat.com>
> Link: https://lore.kernel.org/lkml/e97c2a5d-c815-4936-a767-ac42a3220a90@redhat.com/
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
>
> Revert "selftests/mm: virtual_address_range: Avoid reading VVAR mappings"
>
> This reverts commit 05cc5d292ac4238684b59922aecf59c932edefa0.
I'm assuming that the above two lines simply shouldn't be here?
Powered by blists - more mailing lists