stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "svcrpc: don't leak contexts on PROC_DESTROY" has been added to the 4.4-stable tree
@ 2017-01-23 14:34 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-01-23 14:34 UTC (permalink / raw)
  To: bfields, andros, gregkh; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    svcrpc: don't leak contexts on PROC_DESTROY

to the 4.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     svcrpc-don-t-leak-contexts-on-proc_destroy.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 78794d1890708cf94e3961261e52dcec2cc34722 Mon Sep 17 00:00:00 2001
From: "J. Bruce Fields" <bfields@redhat.com>
Date: Mon, 9 Jan 2017 17:15:18 -0500
Subject: svcrpc: don't leak contexts on PROC_DESTROY

From: J. Bruce Fields <bfields@redhat.com>

commit 78794d1890708cf94e3961261e52dcec2cc34722 upstream.

Context expiry times are in units of seconds since boot, not unix time.

The use of get_seconds() here therefore sets the expiry time decades in
the future.  This prevents timely freeing of contexts destroyed by
client RPC_GSS_PROC_DESTROY requests.  We'd still free them eventually
(when the module is unloaded or the container shut down), but a lot of
contexts could pile up before then.

Fixes: c5b29f885afe "sunrpc: use seconds since boot in expiry cache"
Reported-by: Andy Adamson <andros@netapp.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/sunrpc/auth_gss/svcauth_gss.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/sunrpc/auth_gss/svcauth_gss.c
+++ b/net/sunrpc/auth_gss/svcauth_gss.c
@@ -1481,7 +1481,7 @@ svcauth_gss_accept(struct svc_rqst *rqst
 	case RPC_GSS_PROC_DESTROY:
 		if (gss_write_verf(rqstp, rsci->mechctx, gc->gc_seq))
 			goto auth_err;
-		rsci->h.expiry_time = get_seconds();
+		rsci->h.expiry_time = seconds_since_boot();
 		set_bit(CACHE_NEGATIVE, &rsci->h.flags);
 		if (resv->iov_len + 4 > PAGE_SIZE)
 			goto drop;


Patches currently in stable-queue which might be from bfields@redhat.com are

queue-4.4/svcrdma-avoid-duplicate-dma-unmapping-during-error-recovery.patch
queue-4.4/svcrpc-don-t-leak-contexts-on-proc_destroy.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-01-23 14:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-23 14:34 Patch "svcrpc: don't leak contexts on PROC_DESTROY" has been added to the 4.4-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).