From: J. Bruce Fields Date: Tue, 8 Oct 2013 19:33:53 +0000 (-0400) Subject: svcrpc: fix gss-proxy NULL dereference in some error cases X-Git-Tag: upstream/snapshot3+hdmi~3948^2~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c66080ad0a9295eaf0246a46949619f92c75faaa;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git svcrpc: fix gss-proxy NULL dereference in some error cases We depend on the xdr decoder to set this pointer, but if we error out before we decode this piece it could be left NULL. I think this is probably tough to hit without a buggy gss-proxy. Reported-by: Andi Kleen Cc: Simo Sorce Signed-off-by: J. Bruce Fields --- diff --git a/net/sunrpc/auth_gss/gss_rpc_upcall.c b/net/sunrpc/auth_gss/gss_rpc_upcall.c index f1eb0d1..458f85e 100644 --- a/net/sunrpc/auth_gss/gss_rpc_upcall.c +++ b/net/sunrpc/auth_gss/gss_rpc_upcall.c @@ -298,7 +298,8 @@ int gssp_accept_sec_context_upcall(struct net *net, if (res.context_handle) { data->out_handle = rctxh.exported_context_token; data->mech_oid.len = rctxh.mech.len; - memcpy(data->mech_oid.data, rctxh.mech.data, + if (rctxh.mech.data) + memcpy(data->mech_oid.data, rctxh.mech.data, data->mech_oid.len); client_name = rctxh.src_name.display_name; }