All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: stable@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
	Trond Myklebust <trond.myklebust@primarydata.com>,
	Jiri Slaby <jslaby@suse.cz>
Subject: [PATCH 3.12 11/72] SUNRPC: Fix potential memory scribble in xprt_free_bc_request()
Date: Fri, 18 Apr 2014 11:21:44 +0200	[thread overview]
Message-ID: <8eab668ee966f88601da1f04d4b2494cb9ea63f7.1397812482.git.jslaby@suse.cz> (raw)
In-Reply-To: <3389f243c528afc7c7300c83b8f296290cd3656d.1397812482.git.jslaby@suse.cz>
In-Reply-To: <cover.1397812482.git.jslaby@suse.cz>

From: Trond Myklebust <trond.myklebust@primarydata.com>

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

===============

commit 628356791b04ea988fee070f66a748a823d001bb upstream.

The call to xprt_free_allocation() will call list_del() on
req->rq_bc_pa_list, which is not attached to a list.
This patch moves the list_del() out of xprt_free_allocation()
and into those callers that need it.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 net/sunrpc/backchannel_rqst.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/sunrpc/backchannel_rqst.c b/net/sunrpc/backchannel_rqst.c
index 890a29912d5a..e860d4f7ed2a 100644
--- a/net/sunrpc/backchannel_rqst.c
+++ b/net/sunrpc/backchannel_rqst.c
@@ -64,7 +64,6 @@ static void xprt_free_allocation(struct rpc_rqst *req)
 	free_page((unsigned long)xbufp->head[0].iov_base);
 	xbufp = &req->rq_snd_buf;
 	free_page((unsigned long)xbufp->head[0].iov_base);
-	list_del(&req->rq_bc_pa_list);
 	kfree(req);
 }
 
@@ -168,8 +167,10 @@ out_free:
 	/*
 	 * Memory allocation failed, free the temporary list
 	 */
-	list_for_each_entry_safe(req, tmp, &tmp_list, rq_bc_pa_list)
+	list_for_each_entry_safe(req, tmp, &tmp_list, rq_bc_pa_list) {
+		list_del(&req->rq_bc_pa_list);
 		xprt_free_allocation(req);
+	}
 
 	dprintk("RPC:       setup backchannel transport failed\n");
 	return -ENOMEM;
@@ -198,6 +199,7 @@ void xprt_destroy_backchannel(struct rpc_xprt *xprt, unsigned int max_reqs)
 	xprt_dec_alloc_count(xprt, max_reqs);
 	list_for_each_entry_safe(req, tmp, &xprt->bc_pa_list, rq_bc_pa_list) {
 		dprintk("RPC:        req=%p\n", req);
+		list_del(&req->rq_bc_pa_list);
 		xprt_free_allocation(req);
 		if (--max_reqs == 0)
 			break;
-- 
1.9.2


  parent reply	other threads:[~2014-04-18  9:49 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-18  9:21 [PATCH 3.12 00/72] 3.12.18-stable review Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 01/72] powernow-k6: disable cache when changing frequency Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 02/72] powernow-k6: correctly initialize default parameters Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 03/72] powernow-k6: reorder frequencies Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 04/72] PCI: mvebu: move clock enable before register access Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 05/72] selinux: correctly label /proc inodes in use before the policy is loaded Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 06/72] futex: Allow architectures to skip futex_atomic_cmpxchg_inatomic() test Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 07/72] m68k: Skip " Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 08/72] Char: ipmi_bt_sm, fix infinite loop Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 09/72] nfs: initialize the ACL support bits to zero Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 10/72] NFSv3: Fix return value of nfs3_proc_setacls Jiri Slaby
2014-04-18  9:21 ` Jiri Slaby [this message]
2014-04-18  9:21 ` [PATCH 3.12 12/72] ext4: Speedup WB_SYNC_ALL pass called from sync(2) Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 13/72] floppy: bail out in open() if drive is not responding to block0 read Jiri Slaby
2014-07-03 10:12   ` Olaf Hering
2014-07-04 21:22     ` Jiri Kosina
2014-04-18  9:21 ` [PATCH 3.12 14/72] drm/i915: Undo the PIPEA quirk for i845 Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 15/72] drm/cirrus: Fix cirrus drm driver for fbdev + qemu Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 16/72] drm/radeon: change audio enable logic Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 17/72] drm/radeon: enable speaker allocation setup on dce3.2 Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 18/72] drm: Prefer noninterlace cmdline mode unless explicitly specified Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 19/72] fb: reorder the lock sequence to fix potential dead lock Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 20/72] video/fb: Propagate error code from failing to unregister conflicting fb Jiri Slaby
2014-04-18  9:21   ` Jiri Slaby
2014-04-18  9:21   ` Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 21/72] fbdev: Make the switch from generic to native driver less alarming Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 22/72] drm: add drm_set_preferred_mode Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 23/72] drm/cirrus: use drm_set_preferred_mode Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 24/72] net: fix for a race condition in the inet frag code Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 25/72] net: sctp: fix skb leakage in COOKIE ECHO path of chunk->auth_chunk Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 26/72] bridge: multicast: add sanity check for query source addresses Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 27/72] tipc: allow connection shutdown callback to be invoked in advance Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 28/72] tipc: fix connection refcount leak Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 29/72] tipc: drop subscriber connection id invalidation Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 30/72] tipc: fix memory leak during module removal Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 31/72] tipc: don't log disabled tasklet handler errors Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 32/72] inet: frag: make sure forced eviction removes all frags Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 33/72] net: unix: non blocking recvmsg() should not return -EINTR Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 34/72] ipv6: Fix exthdrs offload registration Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 35/72] ipv6: don't set DST_NOCOUNT for remotely added routes Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 36/72] bnx2: Fix shutdown sequence Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 37/72] pkt_sched: fq: do not hold qdisc lock while allocating memory Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 38/72] vlan: Set correct source MAC address with TX VLAN offload enabled Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 39/72] tcp: tcp_release_cb() should release socket ownership Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 40/72] bridge: multicast: add sanity check for general query destination Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 41/72] bridge: multicast: enable snooping on general queries only Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 42/72] net: socket: error on a negative msg_namelen Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 43/72] bonding: set correct vlan id for alb xmit path Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 44/72] eth: fec: Fix lost promiscuous mode after reconnecting cable Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 45/72] ipv6: Avoid unnecessary temporary addresses being generated Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 46/72] ipv6: ip6_append_data_mtu do not handle the mtu of the second fragment properly Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 47/72] vxlan: fix potential NULL dereference in arp_reduce() Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 48/72] vxlan: fix nonfunctional neigh_reduce() Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 49/72] tcp: syncookies: do not use getnstimeofday() Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 50/72] rtnetlink: fix fdb notification flags Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 51/72] ipmr: fix mfc " Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 52/72] ip6mr: " Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 53/72] net: micrel : ks8851-ml: add vdd-supply support Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 54/72] netpoll: fix the skb check in pkt_is_ns Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 55/72] tipc: fix spinlock recursion bug for failed subscriptions Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 56/72] ip_tunnel: Fix dst ref-count Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 57/72] tg3: Do not include vlan acceleration features in vlan_features Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 58/72] usbnet: include wait queue head in device structure Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 59/72] vlan: Set hard_header_len according to available acceleration Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 60/72] vhost: fix total length when packets are too short Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 61/72] vhost: validate vhost_get_vq_desc return value Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 62/72] xen-netback: remove pointless clause from if statement Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 63/72] ipv6: some ipv6 statistic counters failed to disable bh Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 64/72] netlink: don't compare the nul-termination in nla_strcmp Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 65/72] xen-netback: disable rogue vif in kthread context Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 66/72] net: vxlan: fix crash when interface is created with no group Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 67/72] isdnloop: Validate NUL-terminated strings from user Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 68/72] isdnloop: several buffer overflows Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 69/72] rds: prevent dereference of a NULL device in rds_iw_laddr_check Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 70/72] ARC: [nsimosci] Change .dts to use generic 8250 UART Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 71/72] ARC: [nsimosci] Unbork console Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 72/72] crypto: ghash-clmulni-intel - use C implementation for setkey() Jiri Slaby
2014-04-18 19:18 ` [PATCH 3.12 00/72] 3.12.18-stable review Guenter Roeck
2014-04-18 22:12 ` Shuah Khan
2014-04-24  7:46   ` Jiri Slaby

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=8eab668ee966f88601da1f04d4b2494cb9ea63f7.1397812482.git.jslaby@suse.cz \
    --to=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=trond.myklebust@primarydata.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.