[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <08cda8cc-1a0f-9577-0e2d-ed6ccd10c174@intel.com>
Date: Wed, 24 Aug 2022 12:02:10 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: "Kirill A. Shutemov" <kirill@...temov.name>,
Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Mike Rapoport <rppt@...nel.org>, Al Viro <viro@...iv.linux.org.uk>,
Peter Zijlstra <peterz@...radead.org>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Jeff Layton <jlayton@...nel.org>,
Ilya Dryomov <idryomov@...il.com>, ceph-devel@...r.kernel.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Matthew Wilcox <willy@...radead.org>,
clang-built-linux <llvm@...ts.linux.dev>,
Dave Hansen <dave.hansen@...ux.intel.com>
Subject: Re: Simplify load_unaligned_zeropad() (was Re: [GIT PULL] Ceph
updates for 5.20-rc1)
On 8/14/22 21:12, Kirill A. Shutemov wrote:
> But if somebody would try to be clever -- allocate memory and vmap() as
> shared (with proper VMM notification), but leave direct mapping intact --
> we have a problem. load_unaligned_zeropad() can step onto private mapping
> of the shared memory in direct mapping and crash whole TD guest.
>
> The worst part is that for somebody who is not aware about
> load_unaligned_zeropad(), the vmap() trick is totally reasonable approach:
> it helps to avoid direct mapping fragmentation. We considered the trick
> for one of TDX-specific drivers.
This can also be fixed with guard pages. It means allocating a
physically contiguous page to precede each one you want to vmap(), but
that's not the end of the world.
We're going to have to be *VERY* careful with any private->shared
conversion code.
Powered by blists - more mailing lists