Commit 5b22b184 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-3.9' of git://linux-nfs.org/~bfields/linux

Pull nfsd bugfixes from Bruce Fields:
 "Some minor fallout from the user-namespace work broke most krb5 mounts
  to nfsd, and I screwed up a change to the AF_LOCAL rpc code."

* 'for-3.9' of git://linux-nfs.org/~bfields/linux:
  sunrpc: don't attempt to cancel unitialized work
  nfsd: fix krb5 handling of anonymous principals
parents a930d879 190b1ecf
...@@ -447,17 +447,21 @@ static int rsc_parse(struct cache_detail *cd, ...@@ -447,17 +447,21 @@ static int rsc_parse(struct cache_detail *cd,
else { else {
int N, i; int N, i;
/*
* NOTE: we skip uid_valid()/gid_valid() checks here:
* instead, * -1 id's are later mapped to the
* (export-specific) anonymous id by nfsd_setuser.
*
* (But supplementary gid's get no such special
* treatment so are checked for validity here.)
*/
/* uid */ /* uid */
rsci.cred.cr_uid = make_kuid(&init_user_ns, id); rsci.cred.cr_uid = make_kuid(&init_user_ns, id);
if (!uid_valid(rsci.cred.cr_uid))
goto out;
/* gid */ /* gid */
if (get_int(&mesg, &id)) if (get_int(&mesg, &id))
goto out; goto out;
rsci.cred.cr_gid = make_kgid(&init_user_ns, id); rsci.cred.cr_gid = make_kgid(&init_user_ns, id);
if (!gid_valid(rsci.cred.cr_gid))
goto out;
/* number of additional gid's */ /* number of additional gid's */
if (get_int(&mesg, &N)) if (get_int(&mesg, &N))
......
...@@ -849,6 +849,14 @@ static void xs_tcp_close(struct rpc_xprt *xprt) ...@@ -849,6 +849,14 @@ static void xs_tcp_close(struct rpc_xprt *xprt)
xs_tcp_shutdown(xprt); xs_tcp_shutdown(xprt);
} }
static void xs_local_destroy(struct rpc_xprt *xprt)
{
xs_close(xprt);
xs_free_peer_addresses(xprt);
xprt_free(xprt);
module_put(THIS_MODULE);
}
/** /**
* xs_destroy - prepare to shutdown a transport * xs_destroy - prepare to shutdown a transport
* @xprt: doomed transport * @xprt: doomed transport
...@@ -862,10 +870,7 @@ static void xs_destroy(struct rpc_xprt *xprt) ...@@ -862,10 +870,7 @@ static void xs_destroy(struct rpc_xprt *xprt)
cancel_delayed_work_sync(&transport->connect_worker); cancel_delayed_work_sync(&transport->connect_worker);
xs_close(xprt); xs_local_destroy(xprt);
xs_free_peer_addresses(xprt);
xprt_free(xprt);
module_put(THIS_MODULE);
} }
static inline struct rpc_xprt *xprt_from_sock(struct sock *sk) static inline struct rpc_xprt *xprt_from_sock(struct sock *sk)
...@@ -2482,7 +2487,7 @@ static struct rpc_xprt_ops xs_local_ops = { ...@@ -2482,7 +2487,7 @@ static struct rpc_xprt_ops xs_local_ops = {
.send_request = xs_local_send_request, .send_request = xs_local_send_request,
.set_retrans_timeout = xprt_set_retrans_timeout_def, .set_retrans_timeout = xprt_set_retrans_timeout_def,
.close = xs_close, .close = xs_close,
.destroy = xs_destroy, .destroy = xs_local_destroy,
.print_stats = xs_local_print_stats, .print_stats = xs_local_print_stats,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment