diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-15 15:49:44 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-15 15:49:44 -0500 |
commit | cc80fe0eefbbbd7b4e32f631bb2fa639d76af075 (patch) | |
tree | 1fdc8a85aba221d638a760f58f1301153f3bebf0 /net | |
parent | c7b6c5fe67d1519759de2014a2c44f50fb1426f3 (diff) | |
parent | 6e8b50d16a757d53f8817acecba97c5d4aa1cf65 (diff) |
Merge tag 'nfsd-4.5' of git://linux-nfs.org/~bfields/linux
Pull nfsd updates from Bruce Fields:
"Smaller bugfixes and cleanup, including a fix for a failures of
kerberized NFSv4.1 mounts, and Scott Mayhew's work addressing ACK
storms that can affect some high-availability NFS setups"
* tag 'nfsd-4.5' of git://linux-nfs.org/~bfields/linux:
nfsd: add new io class tracepoint
nfsd: give up on CB_LAYOUTRECALLs after two lease periods
nfsd: Fix nfsd leaks sunrpc module references
lockd: constify nlmsvc_binding structure
lockd: use to_delayed_work
nfsd: use to_delayed_work
Revert "svcrdma: Do not send XDR roundup bytes for a write chunk"
lockd: Register callbacks on the inetaddr_chain and inet6addr_chain
nfsd: Register callbacks on the inetaddr_chain and inet6addr_chain
sunrpc: Add a function to close temporary transports immediately
nfsd: don't base cl_cb_status on stale information
nfsd4: fix gss-proxy 4.1 mounts for some AD principals
nfsd: fix unlikely NULL deref in mach_creds_match
nfsd: minor consolidation of mach_cred handling code
nfsd: helper for dup of possibly NULL string
svcrpc: move some initialization to common code
nfsd: fix a warning message
nfsd: constify nfsd4_callback_ops structure
nfsd: recover: constify nfsd4_client_tracking_ops structures
svcrdma: Do not send XDR roundup bytes for a write chunk
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/auth_gss/gss_rpc_upcall.c | 3 | ||||
-rw-r--r-- | net/sunrpc/svc_xprt.c | 45 | ||||
-rw-r--r-- | net/sunrpc/svcauth.c | 2 | ||||
-rw-r--r-- | net/sunrpc/svcauth_unix.c | 8 |
4 files changed, 50 insertions, 8 deletions
diff --git a/net/sunrpc/auth_gss/gss_rpc_upcall.c b/net/sunrpc/auth_gss/gss_rpc_upcall.c index 59eeed43eda2..f0c6a8c78a56 100644 --- a/net/sunrpc/auth_gss/gss_rpc_upcall.c +++ b/net/sunrpc/auth_gss/gss_rpc_upcall.c | |||
@@ -326,6 +326,9 @@ int gssp_accept_sec_context_upcall(struct net *net, | |||
326 | if (data->found_creds && client_name.data != NULL) { | 326 | if (data->found_creds && client_name.data != NULL) { |
327 | char *c; | 327 | char *c; |
328 | 328 | ||
329 | data->creds.cr_raw_principal = kstrndup(client_name.data, | ||
330 | client_name.len, GFP_KERNEL); | ||
331 | |||
329 | data->creds.cr_principal = kstrndup(client_name.data, | 332 | data->creds.cr_principal = kstrndup(client_name.data, |
330 | client_name.len, GFP_KERNEL); | 333 | client_name.len, GFP_KERNEL); |
331 | if (data->creds.cr_principal) { | 334 | if (data->creds.cr_principal) { |
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index a6cbb2104667..7422f28818b2 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c | |||
@@ -10,11 +10,13 @@ | |||
10 | #include <linux/kthread.h> | 10 | #include <linux/kthread.h> |
11 | #include <linux/slab.h> | 11 | #include <linux/slab.h> |
12 | #include <net/sock.h> | 12 | #include <net/sock.h> |
13 | #include <linux/sunrpc/addr.h> | ||
13 | #include <linux/sunrpc/stats.h> | 14 | #include <linux/sunrpc/stats.h> |
14 | #include <linux/sunrpc/svc_xprt.h> | 15 | #include <linux/sunrpc/svc_xprt.h> |
15 | #include <linux/sunrpc/svcsock.h> | 16 | #include <linux/sunrpc/svcsock.h> |
16 | #include <linux/sunrpc/xprt.h> | 17 | #include <linux/sunrpc/xprt.h> |
17 | #include <linux/module.h> | 18 | #include <linux/module.h> |
19 | #include <linux/netdevice.h> | ||
18 | #include <trace/events/sunrpc.h> | 20 | #include <trace/events/sunrpc.h> |
19 | 21 | ||
20 | #define RPCDBG_FACILITY RPCDBG_SVCXPRT | 22 | #define RPCDBG_FACILITY RPCDBG_SVCXPRT |
@@ -938,6 +940,49 @@ static void svc_age_temp_xprts(unsigned long closure) | |||
938 | mod_timer(&serv->sv_temptimer, jiffies + svc_conn_age_period * HZ); | 940 | mod_timer(&serv->sv_temptimer, jiffies + svc_conn_age_period * HZ); |
939 | } | 941 | } |
940 | 942 | ||
943 | /* Close temporary transports whose xpt_local matches server_addr immediately | ||
944 | * instead of waiting for them to be picked up by the timer. | ||
945 | * | ||
946 | * This is meant to be called from a notifier_block that runs when an ip | ||
947 | * address is deleted. | ||
948 | */ | ||
949 | void svc_age_temp_xprts_now(struct svc_serv *serv, struct sockaddr *server_addr) | ||
950 | { | ||
951 | struct svc_xprt *xprt; | ||
952 | struct svc_sock *svsk; | ||
953 | struct socket *sock; | ||
954 | struct list_head *le, *next; | ||
955 | LIST_HEAD(to_be_closed); | ||
956 | struct linger no_linger = { | ||
957 | .l_onoff = 1, | ||
958 | .l_linger = 0, | ||
959 | }; | ||
960 | |||
961 | spin_lock_bh(&serv->sv_lock); | ||
962 | list_for_each_safe(le, next, &serv->sv_tempsocks) { | ||
963 | xprt = list_entry(le, struct svc_xprt, xpt_list); | ||
964 | if (rpc_cmp_addr(server_addr, (struct sockaddr *) | ||
965 | &xprt->xpt_local)) { | ||
966 | dprintk("svc_age_temp_xprts_now: found %p\n", xprt); | ||
967 | list_move(le, &to_be_closed); | ||
968 | } | ||
969 | } | ||
970 | spin_unlock_bh(&serv->sv_lock); | ||
971 | |||
972 | while (!list_empty(&to_be_closed)) { | ||
973 | le = to_be_closed.next; | ||
974 | list_del_init(le); | ||
975 | xprt = list_entry(le, struct svc_xprt, xpt_list); | ||
976 | dprintk("svc_age_temp_xprts_now: closing %p\n", xprt); | ||
977 | svsk = container_of(xprt, struct svc_sock, sk_xprt); | ||
978 | sock = svsk->sk_sock; | ||
979 | kernel_setsockopt(sock, SOL_SOCKET, SO_LINGER, | ||
980 | (char *)&no_linger, sizeof(no_linger)); | ||
981 | svc_close_xprt(xprt); | ||
982 | } | ||
983 | } | ||
984 | EXPORT_SYMBOL_GPL(svc_age_temp_xprts_now); | ||
985 | |||
941 | static void call_xpt_users(struct svc_xprt *xprt) | 986 | static void call_xpt_users(struct svc_xprt *xprt) |
942 | { | 987 | { |
943 | struct svc_xpt_user *u; | 988 | struct svc_xpt_user *u; |
diff --git a/net/sunrpc/svcauth.c b/net/sunrpc/svcauth.c index 79c0f3459b5c..69841db1f533 100644 --- a/net/sunrpc/svcauth.c +++ b/net/sunrpc/svcauth.c | |||
@@ -55,6 +55,7 @@ svc_authenticate(struct svc_rqst *rqstp, __be32 *authp) | |||
55 | spin_unlock(&authtab_lock); | 55 | spin_unlock(&authtab_lock); |
56 | 56 | ||
57 | rqstp->rq_auth_slack = 0; | 57 | rqstp->rq_auth_slack = 0; |
58 | init_svc_cred(&rqstp->rq_cred); | ||
58 | 59 | ||
59 | rqstp->rq_authop = aops; | 60 | rqstp->rq_authop = aops; |
60 | return aops->accept(rqstp, authp); | 61 | return aops->accept(rqstp, authp); |
@@ -63,6 +64,7 @@ EXPORT_SYMBOL_GPL(svc_authenticate); | |||
63 | 64 | ||
64 | int svc_set_client(struct svc_rqst *rqstp) | 65 | int svc_set_client(struct svc_rqst *rqstp) |
65 | { | 66 | { |
67 | rqstp->rq_client = NULL; | ||
66 | return rqstp->rq_authop->set_client(rqstp); | 68 | return rqstp->rq_authop->set_client(rqstp); |
67 | } | 69 | } |
68 | EXPORT_SYMBOL_GPL(svc_set_client); | 70 | EXPORT_SYMBOL_GPL(svc_set_client); |
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c index 621ca7b4a155..dfacdc95b3f5 100644 --- a/net/sunrpc/svcauth_unix.c +++ b/net/sunrpc/svcauth_unix.c | |||
@@ -728,10 +728,6 @@ svcauth_null_accept(struct svc_rqst *rqstp, __be32 *authp) | |||
728 | struct kvec *resv = &rqstp->rq_res.head[0]; | 728 | struct kvec *resv = &rqstp->rq_res.head[0]; |
729 | struct svc_cred *cred = &rqstp->rq_cred; | 729 | struct svc_cred *cred = &rqstp->rq_cred; |
730 | 730 | ||
731 | cred->cr_group_info = NULL; | ||
732 | cred->cr_principal = NULL; | ||
733 | rqstp->rq_client = NULL; | ||
734 | |||
735 | if (argv->iov_len < 3*4) | 731 | if (argv->iov_len < 3*4) |
736 | return SVC_GARBAGE; | 732 | return SVC_GARBAGE; |
737 | 733 | ||
@@ -794,10 +790,6 @@ svcauth_unix_accept(struct svc_rqst *rqstp, __be32 *authp) | |||
794 | u32 slen, i; | 790 | u32 slen, i; |
795 | int len = argv->iov_len; | 791 | int len = argv->iov_len; |
796 | 792 | ||
797 | cred->cr_group_info = NULL; | ||
798 | cred->cr_principal = NULL; | ||
799 | rqstp->rq_client = NULL; | ||
800 | |||
801 | if ((len -= 3*4) < 0) | 793 | if ((len -= 3*4) < 0) |
802 | return SVC_GARBAGE; | 794 | return SVC_GARBAGE; |
803 | 795 | ||