clocksource/drivers/hyper-v: Reserve PAGE_SIZE space for tsc page
authorBoqun Feng <boqun.feng@gmail.com>
Tue, 26 Nov 2019 02:17:20 +0000 (10:17 +0800)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Thu, 16 Jan 2020 18:07:09 +0000 (19:07 +0100)
commitddc61bbc45017726a2b450350d476b4dc5ae25ce
treeaacaf786a30fc8083fefa3470798f3709ca52938
parent062934634dc3ae38baeb9961dcc80c44a00ffcf2
clocksource/drivers/hyper-v: Reserve PAGE_SIZE space for tsc page

Currently, the reserved size for a tsc page is 4K, which is enough for
communicating with hypervisor. However, in the case where we want to
export the tsc page to userspace (e.g. for vDSO to read the
clocksource), the tsc page should be at least PAGE_SIZE, otherwise, when
PAGE_SIZE is larger than 4K, extra kernel data will be mapped into
userspace, which means leaking kernel information.

Therefore reserve PAGE_SIZE space for tsc_pg as a preparation for the
vDSO support of ARM64 in the future. Also, while at it, replace all
reference to tsc_pg with hv_get_tsc_page() since it should be the only
interface to access tsc page.

Signed-off-by: Boqun Feng (Microsoft) <boqun.feng@gmail.com>
Cc: linux-hyperv@vger.kernel.org
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20191126021723.4710-1-boqun.feng@gmail.com
drivers/clocksource/hyperv_timer.c