All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sumit Semwal <sumit.semwal@linaro.org>
To: stable@vger.kernel.org
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Sumit Semwal <sumit.semwal@linaro.org>
Subject: [PATCH for-4.4 14/16] hv: don't reset hv_context.tsc_page on crash
Date: Mon, 10 Apr 2017 23:14:30 +0530	[thread overview]
Message-ID: <1491846272-14882-15-git-send-email-sumit.semwal@linaro.org> (raw)
In-Reply-To: <1491846272-14882-1-git-send-email-sumit.semwal@linaro.org>

From: Vitaly Kuznetsov <vkuznets@redhat.com>

[ Upstream commit 56ef6718a1d8d77745033c5291e025ce18504159 ]

It may happen that secondary CPUs are still alive and resetting
hv_context.tsc_page will cause a consequent crash in read_hv_clock_tsc()
as we don't check for it being not NULL there. It is safe as we're not
freeing this page anyways.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
---
 drivers/hv/hv.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c
index ddbf7e7..8ce1f2e 100644
--- a/drivers/hv/hv.c
+++ b/drivers/hv/hv.c
@@ -305,9 +305,10 @@ void hv_cleanup(bool crash)
 
 		hypercall_msr.as_uint64 = 0;
 		wrmsrl(HV_X64_MSR_REFERENCE_TSC, hypercall_msr.as_uint64);
-		if (!crash)
+		if (!crash) {
 			vfree(hv_context.tsc_page);
-		hv_context.tsc_page = NULL;
+			hv_context.tsc_page = NULL;
+		}
 	}
 #endif
 }
-- 
2.7.4

  parent reply	other threads:[~2017-04-10 17:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-10 17:44 [PATCH for-4.4 00/16] Stable commits from Ubuntu Xenial 4.4-lts Sumit Semwal
2017-04-10 17:44 ` [PATCH for-4.4 01/16] net/mlx4_core: Fix when to save some qp context flags for dynamic VST to VGT transitions Sumit Semwal
2017-04-12 13:41   ` Greg KH
2017-04-12 15:14     ` Sumit Semwal
2017-04-10 17:44 ` [PATCH for-4.4 02/16] net/mlx4_core: Fix racy CQ (Completion Queue) free Sumit Semwal
2017-04-10 17:44 ` [PATCH for-4.4 03/16] net/mlx4_en: Fix bad WQE issue Sumit Semwal
2017-04-12 13:45   ` Greg KH
2017-04-12 14:38     ` Sumit Semwal
2017-04-10 17:44 ` [PATCH for-4.4 04/16] SUNRPC: fix refcounting problems with auth_gss messages Sumit Semwal
2017-04-10 17:44 ` [PATCH for-4.4 05/16] ibmveth: set correct gso_size and gso_type Sumit Semwal
2017-04-10 17:44 ` [PATCH for-4.4 06/16] ibmveth: calculate gso_segs for large packets Sumit Semwal
2017-04-10 17:44 ` [PATCH for-4.4 07/16] Drivers: hv: get rid of redundant messagecount in create_gpadl_header() Sumit Semwal
2017-04-10 17:44 ` [PATCH for-4.4 08/16] Drivers: hv: don't leak memory in vmbus_establish_gpadl() Sumit Semwal
2017-04-10 17:44 ` [PATCH for-4.4 09/16] Drivers: hv: get rid of timeout in vmbus_open() Sumit Semwal
2017-04-10 17:44 ` [PATCH for-4.4 10/16] Drivers: hv: vmbus: Reduce the delay between retries in vmbus_post_msg() Sumit Semwal
2017-04-10 17:44 ` [PATCH for-4.4 11/16] Tools: hv: kvp: ensure kvp device fd is closed on exec Sumit Semwal
2017-04-10 17:44 ` [PATCH for-4.4 12/16] Drivers: hv: balloon: keep track of where ha_region starts Sumit Semwal
2017-04-10 17:44 ` [PATCH for-4.4 13/16] Drivers: hv: balloon: account for gaps in hot add regions Sumit Semwal
2017-04-10 17:44 ` Sumit Semwal [this message]
2017-04-10 17:44 ` [PATCH for-4.4 15/16] blk-mq: Avoid memory reclaim when remapping queues Sumit Semwal
2017-04-10 17:44 ` [PATCH for-4.4 16/16] usb: hub: Wait for connection to be reestablished after port reset Sumit Semwal

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=1491846272-14882-15-git-send-email-sumit.semwal@linaro.org \
    --to=sumit.semwal@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kys@microsoft.com \
    --cc=stable@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.