Thread (97 messages) 97 messages, 14 authors, 2022-11-03

Re: [PATCH v8 1/8] mm/memfd: Introduce userspace inaccessible memfd

From: Fuad Tabba <hidden>
Date: 2022-10-04 15:40:00
Also in: kvm, linux-doc, linux-fsdevel, linux-mm, lkml, qemu-devel

Hi,

On Mon, Oct 3, 2022 at 12:01 PM Kirill A. Shutemov [off-list ref] wrote:
On Mon, Oct 03, 2022 at 08:33:13AM +0100, Fuad Tabba wrote:
quoted
quoted
I think it is "don't do that" category. inaccessible_register_notifier()
caller has to know what file it operates on, no?
The thing is, you could oops the kernel from userspace. For that, all
you have to do is a memfd_create without the MFD_INACCESSIBLE,
followed by a KVM_SET_USER_MEMORY_REGION using that as the private_fd.
I ran into this using my port of this patch series to arm64.
My point is that it has to be handled on a different level. KVM has to
reject private_fd if it is now inaccessible. It should be trivial by
checking file->f_inode->i_sb->s_magic.
Yes, that makes sense.

Thanks,
/fuad
--
  Kiryl Shutsemau / Kirill A. Shutemov
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help