diff options
Diffstat (limited to 'net/sunrpc/auth_gss/svcauth_gss.c')
-rw-r--r-- | net/sunrpc/auth_gss/svcauth_gss.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index b81e790ef9f4..cc385b3a59c2 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c | |||
@@ -494,7 +494,7 @@ static int rsc_parse(struct cache_detail *cd, | |||
494 | len = qword_get(&mesg, buf, mlen); | 494 | len = qword_get(&mesg, buf, mlen); |
495 | if (len < 0) | 495 | if (len < 0) |
496 | goto out; | 496 | goto out; |
497 | status = gss_import_sec_context(buf, len, gm, &rsci.mechctx); | 497 | status = gss_import_sec_context(buf, len, gm, &rsci.mechctx, GFP_KERNEL); |
498 | if (status) | 498 | if (status) |
499 | goto out; | 499 | goto out; |
500 | 500 | ||
@@ -1315,6 +1315,14 @@ svcauth_gss_wrap_resp_priv(struct svc_rqst *rqstp) | |||
1315 | inpages = resbuf->pages; | 1315 | inpages = resbuf->pages; |
1316 | /* XXX: Would be better to write some xdr helper functions for | 1316 | /* XXX: Would be better to write some xdr helper functions for |
1317 | * nfs{2,3,4}xdr.c that place the data right, instead of copying: */ | 1317 | * nfs{2,3,4}xdr.c that place the data right, instead of copying: */ |
1318 | |||
1319 | /* | ||
1320 | * If there is currently tail data, make sure there is | ||
1321 | * room for the head, tail, and 2 * RPC_MAX_AUTH_SIZE in | ||
1322 | * the page, and move the current tail data such that | ||
1323 | * there is RPC_MAX_AUTH_SIZE slack space available in | ||
1324 | * both the head and tail. | ||
1325 | */ | ||
1318 | if (resbuf->tail[0].iov_base) { | 1326 | if (resbuf->tail[0].iov_base) { |
1319 | BUG_ON(resbuf->tail[0].iov_base >= resbuf->head[0].iov_base | 1327 | BUG_ON(resbuf->tail[0].iov_base >= resbuf->head[0].iov_base |
1320 | + PAGE_SIZE); | 1328 | + PAGE_SIZE); |
@@ -1327,6 +1335,13 @@ svcauth_gss_wrap_resp_priv(struct svc_rqst *rqstp) | |||
1327 | resbuf->tail[0].iov_len); | 1335 | resbuf->tail[0].iov_len); |
1328 | resbuf->tail[0].iov_base += RPC_MAX_AUTH_SIZE; | 1336 | resbuf->tail[0].iov_base += RPC_MAX_AUTH_SIZE; |
1329 | } | 1337 | } |
1338 | /* | ||
1339 | * If there is no current tail data, make sure there is | ||
1340 | * room for the head data, and 2 * RPC_MAX_AUTH_SIZE in the | ||
1341 | * allotted page, and set up tail information such that there | ||
1342 | * is RPC_MAX_AUTH_SIZE slack space available in both the | ||
1343 | * head and tail. | ||
1344 | */ | ||
1330 | if (resbuf->tail[0].iov_base == NULL) { | 1345 | if (resbuf->tail[0].iov_base == NULL) { |
1331 | if (resbuf->head[0].iov_len + 2*RPC_MAX_AUTH_SIZE > PAGE_SIZE) | 1346 | if (resbuf->head[0].iov_len + 2*RPC_MAX_AUTH_SIZE > PAGE_SIZE) |
1332 | return -ENOMEM; | 1347 | return -ENOMEM; |