Skip to content

Commit 9130b8d

Browse files
olgakorn1trondmypd
authored andcommitted
SUNRPC: allow for upcalls for same uid but different gss service
It's possible to have simultaneous upcalls for the same UIDs but different GSS service. In that case, we need to allow for the upcall to gssd to proceed so that not the same context is used by two different GSS services. Some servers lock the use of context to the GSS service. Signed-off-by: Olga Kornievskaia <[email protected]> Cc: [email protected] # v3.9+ Signed-off-by: Trond Myklebust <[email protected]>
1 parent ad3331a commit 9130b8d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

net/sunrpc/auth_gss/auth_gss.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,12 +340,14 @@ gss_release_msg(struct gss_upcall_msg *gss_msg)
340340
}
341341

342342
static struct gss_upcall_msg *
343-
__gss_find_upcall(struct rpc_pipe *pipe, kuid_t uid)
343+
__gss_find_upcall(struct rpc_pipe *pipe, kuid_t uid, const struct gss_auth *auth)
344344
{
345345
struct gss_upcall_msg *pos;
346346
list_for_each_entry(pos, &pipe->in_downcall, list) {
347347
if (!uid_eq(pos->uid, uid))
348348
continue;
349+
if (auth && pos->auth->service != auth->service)
350+
continue;
349351
atomic_inc(&pos->count);
350352
dprintk("RPC: %s found msg %p\n", __func__, pos);
351353
return pos;
@@ -365,7 +367,7 @@ gss_add_msg(struct gss_upcall_msg *gss_msg)
365367
struct gss_upcall_msg *old;
366368

367369
spin_lock(&pipe->lock);
368-
old = __gss_find_upcall(pipe, gss_msg->uid);
370+
old = __gss_find_upcall(pipe, gss_msg->uid, gss_msg->auth);
369371
if (old == NULL) {
370372
atomic_inc(&gss_msg->count);
371373
list_add(&gss_msg->list, &pipe->in_downcall);
@@ -714,7 +716,7 @@ gss_pipe_downcall(struct file *filp, const char __user *src, size_t mlen)
714716
err = -ENOENT;
715717
/* Find a matching upcall */
716718
spin_lock(&pipe->lock);
717-
gss_msg = __gss_find_upcall(pipe, uid);
719+
gss_msg = __gss_find_upcall(pipe, uid, NULL);
718720
if (gss_msg == NULL) {
719721
spin_unlock(&pipe->lock);
720722
goto err_put_ctx;

0 commit comments

Comments
 (0)