[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fzaia3kslzfxj35mmarkpydlt73ha7fr6qo2ub47zfu7l6f7c4@axlrzkeqavod>
Date: Thu, 22 Aug 2024 11:18:05 +0300
From: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
To: Alexey Gladkov <legion@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-coco@...ts.linux.dev,
Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, "H. Peter Anvin" <hpa@...or.com>,
Andrew Morton <akpm@...ux-foundation.org>, Yuan Yao <yuan.yao@...el.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>, Yuntao Wang <ytcoode@...il.com>, Kai Huang <kai.huang@...el.com>,
Baoquan He <bhe@...hat.com>, Oleg Nesterov <oleg@...hat.com>, cho@...rosoft.com,
decui@...rosoft.com, John.Starks@...rosoft.com
Subject: Re: [PATCH v4 4/6] x86/tdx: Add a restriction on access to MMIO
address
On Wed, Aug 21, 2024 at 04:24:36PM +0200, Alexey Gladkov wrote:
> From: "Alexey Gladkov (Intel)" <legion@...nel.org>
>
> In the case of userspace MMIO, if the user instruction + MAX_INSN_SIZE
> straddles page, then the "fetch" in the kernel could trigger a #VE.
It has nothing to do with "straddling page". It's about tricking kernel
into doing MMIO on user address.
For instance, if in response to a syscall, kernel does put_user() and the
target address is MMIO mapping in userspace, current #VE handler threat
this access as kernel MMIO which is wrong and have security implications.
> In
> this case the kernel would handle this second #VE as a !user_mode() MMIO.
> That way, additional address verifications can be avoided.
>
> The scenario of accessing userspace MMIO addresses from kernelspace does
> not seem appropriate under normal circumstances. Until there is a
> specific usecase for such a scenario it can be disabled.
>
> Signed-off-by: Alexey Gladkov (Intel) <legion@...nel.org>
Cc: stable@ please.
and this patch has to go ahead of the patchset, targeting x86/urgent
branch.
--
Kiryl Shutsemau / Kirill A. Shutemov
Powered by blists - more mailing lists