From: Sebastien Buisson Date: Mon, 22 Oct 2018 15:08:15 +0000 (+0900) Subject: LU-9795 gss: fix gss-based integrity check for multi-rail X-Git-Tag: 2.12.0-RC1~62 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=e2bd32ca75d60870a70cd3a00e8aac8efb751762;hp=e17178808f7430a17b4cfe8f407b7c2a825d285a;ds=sidebyside LU-9795 gss: fix gss-based integrity check for multi-rail In case of multi-rail, rq_peer is not the NID from which request is received, but primary NID of peer. So gss_svc_upcall_handle_init() needs to pass rq_source, which contains the NID actually in use, to lsvcgssd user-space daemon in order to compute HMAC with correct key in handle_sk(). Test-Parameters: testlist=sanity-sec envdefinitions=ONLY=31,SHARED_KEY=true Signed-off-by: Sebastien Buisson Change-Id: I70ee05355c3463a267a6faef724a5b7159ada014 Reviewed-on: https://review.whamcloud.com/33415 Reviewed-by: Andreas Dilger Reviewed-by: Amir Shehata Reviewed-by: James Simmons Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/ptlrpc/gss/gss_svc_upcall.c b/lustre/ptlrpc/gss/gss_svc_upcall.c index 93d0f6a..4b2d927 100644 --- a/lustre/ptlrpc/gss/gss_svc_upcall.c +++ b/lustre/ptlrpc/gss/gss_svc_upcall.c @@ -946,7 +946,11 @@ int gss_svc_upcall_handle_init(struct ptlrpc_request *req, memset(&rsikey, 0, sizeof(rsikey)); rsikey.lustre_svc = lustre_svc; - rsikey.nid = (__u64) req->rq_peer.nid; + /* In case of MR, rq_peer is not the NID from which request is received, + * but primary NID of peer. + * So we need rq_source, which contains the NID actually in use. + */ + rsikey.nid = (__u64) req->rq_source.nid; nodemap_test_nid(req->rq_peer.nid, rsikey.nm_name, sizeof(rsikey.nm_name));