From e2bd32ca75d60870a70cd3a00e8aac8efb751762 Mon Sep 17 00:00:00 2001 From: Sebastien Buisson Date: Tue, 23 Oct 2018 00:08:15 +0900 Subject: [PATCH] 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 --- lustre/ptlrpc/gss/gss_svc_upcall.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)); -- 1.8.3.1