Skip to content

Commit 83aaf3b

Browse files
committed
Merge branch 'for-3.11' of git://linux-nfs.org/~bfields/linux
Pull nfsd bugfixes from Bruce Fields: "Most of this is due to a screwup on my part -- some gss-proxy crashes got fixed before the merge window but somehow never made it out of a temporary git repo on my laptop...." * 'for-3.11' of git://linux-nfs.org/~bfields/linux: svcrpc: set cr_gss_mech from gss-proxy as well as legacy upcall svcrpc: fix kfree oops in gss-proxy code svcrpc: fix gss-proxy xdr decoding oops svcrpc: fix gss_rpc_upcall create error NFSD/sunrpc: avoid deadlock on TCP connection due to memory pressure.
2 parents 32c6e25 + 7193bd1 commit 83aaf3b

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

net/sunrpc/auth_gss/gss_rpc_upcall.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ static int gssp_rpc_create(struct net *net, struct rpc_clnt **_clnt)
120120
if (IS_ERR(clnt)) {
121121
dprintk("RPC: failed to create AF_LOCAL gssproxy "
122122
"client (errno %ld).\n", PTR_ERR(clnt));
123-
result = -PTR_ERR(clnt);
123+
result = PTR_ERR(clnt);
124124
*_clnt = NULL;
125125
goto out;
126126
}
@@ -328,7 +328,6 @@ void gssp_free_upcall_data(struct gssp_upcall_data *data)
328328
kfree(data->in_handle.data);
329329
kfree(data->out_handle.data);
330330
kfree(data->out_token.data);
331-
kfree(data->mech_oid.data);
332331
free_svc_cred(&data->creds);
333332
}
334333

net/sunrpc/auth_gss/gss_rpc_xdr.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ static int dummy_enc_nameattr_array(struct xdr_stream *xdr,
430430
static int dummy_dec_nameattr_array(struct xdr_stream *xdr,
431431
struct gssx_name_attr_array *naa)
432432
{
433-
struct gssx_name_attr dummy;
433+
struct gssx_name_attr dummy = { .attr = {.len = 0} };
434434
u32 count, i;
435435
__be32 *p;
436436

@@ -493,12 +493,13 @@ static int gssx_enc_name(struct xdr_stream *xdr,
493493
return err;
494494
}
495495

496+
496497
static int gssx_dec_name(struct xdr_stream *xdr,
497498
struct gssx_name *name)
498499
{
499-
struct xdr_netobj dummy_netobj;
500-
struct gssx_name_attr_array dummy_name_attr_array;
501-
struct gssx_option_array dummy_option_array;
500+
struct xdr_netobj dummy_netobj = { .len = 0 };
501+
struct gssx_name_attr_array dummy_name_attr_array = { .count = 0 };
502+
struct gssx_option_array dummy_option_array = { .count = 0 };
502503
int err;
503504

504505
/* name->display_name */

net/sunrpc/auth_gss/svcauth_gss.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1180,6 +1180,7 @@ static int gss_proxy_save_rsc(struct cache_detail *cd,
11801180
gm = gss_mech_get_by_OID(&ud->mech_oid);
11811181
if (!gm)
11821182
goto out;
1183+
rsci.cred.cr_gss_mech = gm;
11831184

11841185
status = -EINVAL;
11851186
/* mech-specific data: */
@@ -1195,7 +1196,6 @@ static int gss_proxy_save_rsc(struct cache_detail *cd,
11951196
rscp = rsc_update(cd, &rsci, rscp);
11961197
status = 0;
11971198
out:
1198-
gss_mech_put(gm);
11991199
rsc_free(&rsci);
12001200
if (rscp)
12011201
cache_put(&rscp->h, cd);

net/sunrpc/svcsock.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,9 @@ static int svc_tcp_has_wspace(struct svc_xprt *xprt)
11931193
if (test_bit(XPT_LISTENER, &xprt->xpt_flags))
11941194
return 1;
11951195
required = atomic_read(&xprt->xpt_reserved) + serv->sv_max_mesg;
1196-
if (sk_stream_wspace(svsk->sk_sk) >= required)
1196+
if (sk_stream_wspace(svsk->sk_sk) >= required ||
1197+
(sk_stream_min_wspace(svsk->sk_sk) == 0 &&
1198+
atomic_read(&xprt->xpt_reserved) == 0))
11971199
return 1;
11981200
set_bit(SOCK_NOSPACE, &svsk->sk_sock->flags);
11991201
return 0;

0 commit comments

Comments
 (0)