hc
2024-02-19 1c055e55a242a33e574e48be530e06770a210dcd
kernel/net/sunrpc/auth_gss/auth_gss.c
....@@ -301,7 +301,7 @@
301301 list_for_each_entry(pos, &pipe->in_downcall, list) {
302302 if (!uid_eq(pos->uid, uid))
303303 continue;
304
- if (auth && pos->auth->service != auth->service)
304
+ if (pos->auth->service != auth->service)
305305 continue;
306306 refcount_inc(&pos->count);
307307 return pos;
....@@ -685,6 +685,21 @@
685685 return err;
686686 }
687687
688
+static struct gss_upcall_msg *
689
+gss_find_downcall(struct rpc_pipe *pipe, kuid_t uid)
690
+{
691
+ struct gss_upcall_msg *pos;
692
+ list_for_each_entry(pos, &pipe->in_downcall, list) {
693
+ if (!uid_eq(pos->uid, uid))
694
+ continue;
695
+ if (!rpc_msg_is_inflight(&pos->msg))
696
+ continue;
697
+ refcount_inc(&pos->count);
698
+ return pos;
699
+ }
700
+ return NULL;
701
+}
702
+
688703 #define MSG_BUF_MAXSIZE 1024
689704
690705 static ssize_t
....@@ -731,7 +746,7 @@
731746 err = -ENOENT;
732747 /* Find a matching upcall */
733748 spin_lock(&pipe->lock);
734
- gss_msg = __gss_find_upcall(pipe, uid, NULL);
749
+ gss_msg = gss_find_downcall(pipe, uid);
735750 if (gss_msg == NULL) {
736751 spin_unlock(&pipe->lock);
737752 goto err_put_ctx;