From: Saurabh Singh Sengar <ssengar@microsoft.com>
To: Wei Liu <wei.liu@kernel.org>, Roman Kisel <romank@linux.microsoft.com>
Cc: Naman Jain <namjain@linux.microsoft.com>,
KY Srinivasan <kys@microsoft.com>,
Haiyang Zhang <haiyangz@microsoft.com>,
Dexuan Cui <decui@microsoft.com>,
Anirudh Rayabharam <anrayabh@linux.microsoft.com>,
Saurabh Sengar <ssengar@linux.microsoft.com>,
Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>,
Nuno Das Neves <nunodasneves@linux.microsoft.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>
Subject: RE: [EXTERNAL] Re: [PATCH] Drivers: hv: Introduce mshv_vtl driver
Date: Fri, 9 May 2025 18:02:57 +0000 [thread overview]
Message-ID: <KUZP153MB14447CC188576D3A7376CEAABE8AA@KUZP153MB1444.APCP153.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <aBzx8HDwKakGG1tR@liuwe-devbox-ubuntu-v2.tail21d00.ts.net>
> -----Original Message-----
> From: Wei Liu <wei.liu@kernel.org>
> Sent: 08 May 2025 23:33
> To: Roman Kisel <romank@linux.microsoft.com>
> Cc: Saurabh Singh Sengar <ssengar@microsoft.com>; Naman Jain
> <namjain@linux.microsoft.com>; KY Srinivasan <kys@microsoft.com>;
> Haiyang Zhang <haiyangz@microsoft.com>; Wei Liu <wei.liu@kernel.org>;
> Dexuan Cui <decui@microsoft.com>; Anirudh Rayabharam
> <anrayabh@linux.microsoft.com>; Saurabh Sengar
> <ssengar@linux.microsoft.com>; Stanislav Kinsburskii
> <skinsburskii@linux.microsoft.com>; Nuno Das Neves
> <nunodasneves@linux.microsoft.com>; linux-kernel@vger.kernel.org; linux-
> hyperv@vger.kernel.org
> Subject: [EXTERNAL] Re: [PATCH] Drivers: hv: Introduce mshv_vtl driver
>
> On Wed, May 07, 2025 at 12:20:36PM -0700, Roman Kisel wrote:
> >
> >
> > On 5/7/2025 6:02 AM, Saurabh Singh Sengar wrote:
> > >
> > [..]
> >
> > > > + }
> > > > +
> > > > + local_irq_save(flags);
> > > > + in = *this_cpu_ptr(hyperv_pcpu_input_arg);
> > > > + out = *this_cpu_ptr(hyperv_pcpu_output_arg);
> > > > +
> > > > + if (copy_from_user(in, (void __user *)hvcall.input_ptr,
> > > > hvcall.input_size)) {
> > >
> > > Here is an issue related to usage of user copy functions when interrupt are
> disabled.
> > > It was reported by Michael K here:
> > > https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgi
> > > thub.com%2Fmicrosoft%2FOHCL-Linux-
> Kernel%2Fissues%2F33&data=05%7C02%
> > >
> 7Cssengar%40microsoft.com%7C3a21fc17545e4bafb86e08dd8e5aa427%7C72
> f98
> > >
> 8bf86f141af91ab2d7cd011db47%7C1%7C0%7C638823242185564641%7CUnk
> nown%7
> > >
> CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJ
> XaW4
> > >
> zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=pdQ90a
> aKZsy
> > > 67qkPZkV4BfpwM6cM6scUbTeH9lT7s6s%3D&reserved=0
> >
> > From the practical point of view, that memory will be touched by the
> > user mode by virtue of Rust requiring initialization so the a possible
> > page fault would be resolved before the IOCTL. OpenHCL runs without
> > swap so the the memory will not be paged out to require page faults to
> > be brought in back.
> >
> > I do agree that might be turned into a footgun by the user land if
> > they malloc a page w/o prefaulting (so it's just a VA range, not
> > backed with the physical page), and then send its address straight
> > over here right after w/o writing any data to it. Perhaps likelier
> > with the output data. Anyway, yes, relying on the user land doing sane
> > things isn't the best approach to the kernel programming.
>
> Yep. We don't rely on user land software doing sane things to maintain
> correctness in kernel, so this needs to be fixed.
>
> Thanks,
> Wei.
How about fixing this for normal x86 for now and put a TODO for CVM to be fixed later, when we bring in CVM support ?
Regards,
Saurabh
next prev parent reply other threads:[~2025-05-09 18:03 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-06 8:49 Naman Jain
2025-05-06 15:48 ` Roman Kisel
2025-05-07 10:19 ` Saurabh Singh Sengar
2025-05-07 11:21 ` Naman Jain
2025-05-07 20:31 ` Roman Kisel
2025-05-08 3:00 ` Saurabh Singh Sengar
2025-05-08 15:44 ` Roman Kisel
2025-05-08 17:44 ` Wei Liu
2025-05-08 18:13 ` Roman Kisel
2025-05-07 13:02 ` Saurabh Singh Sengar
2025-05-07 19:20 ` Roman Kisel
2025-05-08 2:59 ` Saurabh Singh Sengar
2025-05-09 18:07 ` Roman Kisel
2025-05-08 4:03 ` Michael Kelley
2025-05-08 15:34 ` Roman Kisel
2025-05-08 18:03 ` Wei Liu
2025-05-09 18:02 ` Saurabh Singh Sengar [this message]
2025-05-09 18:05 ` [EXTERNAL] " Roman Kisel
2025-05-12 4:57 ` Naman Jain
2025-05-13 15:30 ` Michael Kelley
2025-05-13 16:34 ` Naman Jain
2025-05-12 4:55 ` Naman Jain
2025-05-10 20:55 ` [External] : " ALOK TIWARI
2025-05-12 14:04 ` Naman Jain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=KUZP153MB14447CC188576D3A7376CEAABE8AA@KUZP153MB1444.APCP153.PROD.OUTLOOK.COM \
--to=ssengar@microsoft.com \
--cc=anrayabh@linux.microsoft.com \
--cc=decui@microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=kys@microsoft.com \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=namjain@linux.microsoft.com \
--cc=nunodasneves@linux.microsoft.com \
--cc=romank@linux.microsoft.com \
--cc=skinsburskii@linux.microsoft.com \
--cc=ssengar@linux.microsoft.com \
--cc=wei.liu@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®