All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org,
	Simon Gaiser <simon@invisiblethingslab.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: [PATCH 4.16 48/68] xen: xenbus_dev_frontend: Fix XS_TRANSACTION_END handling
Date: Tue, 17 Apr 2018 17:58:01 +0200	[thread overview]
Message-ID: <20180417155751.300069139@linuxfoundation.org> (raw)
In-Reply-To: <20180417155749.341779147@linuxfoundation.org>

4.16-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Simon Gaiser <simon@invisiblethingslab.com>

commit 2a22ee6c3ab1d761bc9c04f1e4117edd55b82f09 upstream.

Commit fd8aa9095a95 ("xen: optimize xenbus driver for multiple
concurrent xenstore accesses") made a subtle change to the semantic of
xenbus_dev_request_and_reply() and xenbus_transaction_end().

Before on an error response to XS_TRANSACTION_END
xenbus_dev_request_and_reply() would not decrement the active
transaction counter. But xenbus_transaction_end() has always counted the
transaction as finished regardless of the response.

The new behavior is that xenbus_dev_request_and_reply() and
xenbus_transaction_end() will always count the transaction as finished
regardless the response code (handled in xs_request_exit()).

But xenbus_dev_frontend tries to end a transaction on closing of the
device if the XS_TRANSACTION_END failed before. Trying to close the
transaction twice corrupts the reference count. So fix this by also
considering a transaction closed if we have sent XS_TRANSACTION_END once
regardless of the return code.

Cc: <stable@vger.kernel.org> # 4.11
Fixes: fd8aa9095a95 ("xen: optimize xenbus driver for multiple concurrent xenstore accesses")
Signed-off-by: Simon Gaiser <simon@invisiblethingslab.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/xen/xenbus/xenbus_dev_frontend.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/xen/xenbus/xenbus_dev_frontend.c
+++ b/drivers/xen/xenbus/xenbus_dev_frontend.c
@@ -365,7 +365,7 @@ void xenbus_dev_queue_reply(struct xb_re
 			if (WARN_ON(rc))
 				goto out;
 		}
-	} else if (req->msg.type == XS_TRANSACTION_END) {
+	} else if (req->type == XS_TRANSACTION_END) {
 		trans = xenbus_get_transaction(u, req->msg.tx_id);
 		if (WARN_ON(!trans))
 			goto out;

  parent reply	other threads:[~2018-04-17 15:58 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-17 15:57 [PATCH 4.16 00/68] 4.16.3-stable review Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 01/68] cdc_ether: flag the Cinterion AHS8 modem by gemalto as WWAN Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 02/68] rds: MP-RDS may use an invalid c_path Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 03/68] slip: Check if rstate is initialized before uncompressing Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 04/68] vhost: fix vhost_vq_access_ok() log check Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 05/68] l2tp: fix races in tunnel creation Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 06/68] l2tp: fix race in duplicate tunnel detection Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 07/68] ip_gre: clear feature flags when incompatible o_flags are set Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 08/68] vhost: Fix vhost_copy_to_user() Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 09/68] lan78xx: Correctly indicate invalid OTP Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 10/68] [PATCH] sparc64: Properly range check DAX completion index Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 11/68] media: v4l2-core: fix size of devnode_nums[] bitarray Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 12/68] media: v4l2-compat-ioctl32: dont oops on overlay Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 13/68] media: v4l: vsp1: Fix header display list status check in continuous mode Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 14/68] ipmi: Fix some error cleanup issues Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 15/68] parisc: Fix out of array access in match_pci_device() Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 16/68] parisc: Fix HPMC handler by increasing size to multiple of 16 bytes Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 17/68] iwlwifi: add a bunch of new 9000 PCI IDs Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 18/68] Drivers: hv: vmbus: do not mark HV_PCIE as perf_device Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 19/68] PCI: hv: Serialize the present and eject work items Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 20/68] PCI: hv: Fix 2 hang issues in hv_compose_msi_msg() Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 21/68] KVM: PPC: Book3S HV: trace_tlbie must not be called in realmode Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 22/68] perf intel-pt: Fix overlap detection to identify consecutive buffers correctly Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 23/68] perf intel-pt: Fix sync_switch Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 24/68] perf intel-pt: Fix error recovery from missing TIP packet Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 25/68] perf intel-pt: Fix timestamp following overflow Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 26/68] perf/core: Fix use-after-free in uprobe_perf_close() Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 27/68] radeon: hide pointless #warning when compile testing Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 28/68] x86/mce/AMD: Pass the bank number to smca_get_bank_type() Greg Kroah-Hartman
2018-04-17 15:57   ` [4.16,28/68] " Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 29/68] x86/mce/AMD, EDAC/mce_amd: Enumerate Reserved SMCA bank type Greg Kroah-Hartman
2018-04-17 15:57   ` [4.16,29/68] " Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 30/68] x86/mce/AMD: Get address from already initialized block Greg Kroah-Hartman
2018-04-17 15:57   ` [4.16,30/68] " Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 31/68] ath9k: Protect queue draining by rcu_read_lock() Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 32/68] x86/uapi: Fix asm/bootparam.h userspace compilation errors Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 33/68] x86/apic: Fix signedness bug in APIC ID validity checks Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 34/68] sunrpc: remove incorrect HMAC request initialization Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 35/68] f2fs: fix heap mode to reset it back Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 36/68] block: Change a rcu_read_{lock,unlock}_sched() pair into rcu_read_{lock,unlock}() Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 37/68] nvme: Skip checking heads without namespaces Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 38/68] lib: fix stall in __bitmap_parselist() Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 39/68] zboot: fix stack protector in compressed boot phase Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 40/68] blk-mq: Directly schedule q->timeout_work when aborting a request Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 41/68] blk-mq: order getting budget and driver tag Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 42/68] blk-mq: make sure that correct hctx->next_cpu is set Greg Kroah-Hartman
2018-04-17 15:57   ` Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 43/68] blk-mq: dont keep offline CPUs mapped to hctx 0 Greg Kroah-Hartman
2018-04-17 15:57   ` Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 44/68] ovl: Set d->last properly during lookup Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 45/68] ovl: fix lookup with middle layer opaque dir and absolute path redirects Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 46/68] ovl: set i_ino to the value of st_ino for NFS export Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 47/68] ovl: set lower layer st_dev only if setting lower st_ino Greg Kroah-Hartman
2018-04-17 15:58 ` Greg Kroah-Hartman [this message]
2018-04-17 15:58 ` [PATCH 4.16 49/68] hugetlbfs: fix bug in pgoff overflow checking Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 50/68] nfsd: fix incorrect umasks Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 51/68] scsi: scsi_dh: Dont look for NULL devices handlers by name Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 52/68] scsi: qla2xxx: Fix small memory leak in qla2x00_probe_one on probe failure Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 53/68] Revert "scsi: core: return BLK_STS_OK for DID_OK in __scsi_error_from_host_byte()" Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 54/68] apparmor: fix logging of the existence test for signals Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 55/68] apparmor: fix display of .ns_name for containers Greg Kroah-Hartman
2018-04-18 15:05   ` Serge E. Hallyn
2018-04-17 15:58 ` [PATCH 4.16 56/68] apparmor: fix resource audit messages when auditing peer Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 57/68] block/loop: fix deadlock after loop_set_status Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 58/68] nfit: fix region registration vs block-data-window ranges Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 59/68] s390/qdio: dont retry EQBS after CCQ 96 Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 60/68] s390/qdio: dont merge ERROR output buffers Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 61/68] s390/ipl: ensure loadparm valid flag is set Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 62/68] s390/compat: fix setup_frame32 Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 63/68] get_user_pages_fast(): return -EFAULT on access_ok failure Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 64/68] mm/gup_benchmark: handle gup failures Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 65/68] getname_kernel() needs to make sure that ->name != ->iname in long case Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 66/68] Bluetooth: Fix connection if directed advertising and privacy is used Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 67/68] Bluetooth: hci_bcm: Treat Interrupt ACPI resources as always being active-low Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 68/68] rtl8187: Fix NULL pointer dereference in priv->conf_mutex Greg Kroah-Hartman
2018-04-17 21:03 ` [PATCH 4.16 00/68] 4.16.3-stable review Shuah Khan
2018-04-18  6:58   ` Greg Kroah-Hartman
2018-04-17 23:43 ` kernelci.org bot
2018-04-18  5:13 ` Naresh Kamboju
2018-04-18  6:59   ` Greg Kroah-Hartman
2018-04-18 15:41 ` Guenter Roeck
2018-04-19  6:40   ` Greg Kroah-Hartman

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=20180417155751.300069139@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=boris.ostrovsky@oracle.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=simon@invisiblethingslab.com \
    --cc=stable@vger.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 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.