From: Stephen Hemminger <stephen@networkplumber.org>
To: mikelley@exchange.microsoft.com
Cc: mikelley@microsoft.com, gregkh@linuxfoundation.org,
linux-kernel@vger.kernel.org, devel@linuxdriverproject.org,
olaf@aepfle.de, apw@canonical.com, vkuznets@redhat.com,
jasowang@redhat.com, leann.ogasawara@canonical.com,
marcelo.cerri@canonical.com, sthemmin@microsoft.com,
kys@microsoft.com
Subject: Re: [PATCH 1/1] Drivers: hv: vmbus: Close timing hole that can corrupt per-cpu page Extend the disabling of preemption to include the hypercall so that another thread can't get the CPU and corrupt the per-cpu page used for hypercall arguments.
Date: Wed, 17 May 2017 15:00:15 -0700 [thread overview]
Message-ID: <20170517150015.70e97abb@xeon-e3> (raw)
In-Reply-To: <1495057255-10660-1-git-send-email-mikelley@exchange.microsoft.com>
On Wed, 17 May 2017 14:40:55 -0700
mikelley@exchange.microsoft.com wrote:
> From: Michael Kelley <mikelley@microsoft.com>
>
> Signed-off-by: Michael Kelley <mikelley@microsoft.com>
> ---
> drivers/hv/hv.c | 7 ++++++-
> 1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c
> index 12e7bae..47ed538 100644
> --- a/drivers/hv/hv.c
> +++ b/drivers/hv/hv.c
> @@ -82,9 +82,14 @@ int hv_post_message(union hv_connection_id connection_id,
> aligned_msg->message_type = message_type;
> aligned_msg->payload_size = payload_size;
> memcpy((void *)aligned_msg->payload, payload, payload_size);
> - put_cpu_ptr(hv_cpu);
>
> status = hv_do_hypercall(HVCALL_POST_MESSAGE, aligned_msg, NULL);
> +
> + /* Preemption must remain disabled until after the hypercall
> + * so some other thread can't get scheduled onto this cpu and
> + * corrupt the per-cpu post_msg_page
> + */
> + put_cpu_ptr(hv_cpu);
>
> return status & 0xFFFF;
> }
Since Subject line becomes the git log description, it is best practice to keep it short.
On git commit man page:
Though not required, it’s a good idea to begin the commit message with
a single short (less than 50 character) line summarizing the change,
followed by a blank line and then a more thorough description.
If you need to provide more description put it in the message body.
next prev parent reply other threads:[~2017-05-17 22:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-17 21:40 [PATCH 1/1] Drivers: hv: vmbus: Close timing hole that can corrupt per-cpu page Extend the disabling of preemption to include the hypercall so that another thread can't get the CPU and corrupt the per-cpu page used for hypercall arguments mikelley
2017-05-17 22:00 ` Stephen Hemminger [this message]
2017-05-17 22:04 ` Joshua R. Poulson
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=20170517150015.70e97abb@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=apw@canonical.com \
--cc=devel@linuxdriverproject.org \
--cc=gregkh@linuxfoundation.org \
--cc=jasowang@redhat.com \
--cc=kys@microsoft.com \
--cc=leann.ogasawara@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo.cerri@canonical.com \
--cc=mikelley@exchange.microsoft.com \
--cc=mikelley@microsoft.com \
--cc=olaf@aepfle.de \
--cc=sthemmin@microsoft.com \
--cc=vkuznets@redhat.com \
/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