From 311e3868bfdb3f2c1535d5a7cb8f759195457612 Mon Sep 17 00:00:00 2001 From: Santosh Kumar Pradhan Date: Fri, 3 Jan 2014 10:32:16 +0530 Subject: gNFS: Possible SEGV crash in NFS while DRC is OFF In rpcsvc_submit_generic(), FILE: rpc/rpc-lib/src/rpcsvc.c, while caching the reply (DRC), the code does not check if DRC is ON and goes ahead assuming DRC is on and try to take a LOCK on drc. FIX: Put a check on svc->drc by rpcsvc_need_drc(). Change-Id: I52c57280487e6061c68fd0b784e1cafceb2f3690 BUG: 1048072 Signed-off-by: Santosh Kumar Pradhan Reviewed-on: http://review.gluster.org/6632 Reviewed-by: Niels de Vos Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- rpc/rpc-lib/src/rpcsvc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rpc/rpc-lib') diff --git a/rpc/rpc-lib/src/rpcsvc.c b/rpc/rpc-lib/src/rpcsvc.c index 037c157f2..d19a3ca0c 100644 --- a/rpc/rpc-lib/src/rpcsvc.c +++ b/rpc/rpc-lib/src/rpcsvc.c @@ -1183,7 +1183,7 @@ rpcsvc_submit_generic (rpcsvc_request_t *req, struct iovec *proghdr, iobref_add (iobref, replyiob); /* cache the request in the duplicate request cache for appropriate ops */ - if (req->reply) { + if ((req->reply) && (rpcsvc_need_drc (req))) { drc = req->svc->drc; LOCK (&drc->lock); -- cgit