18 Nov, 2017
1 commit
-
Publishing of net pointer is not safe, use net->ns.inum as net ID
[ 171.391947] RPC: created new rpcb local clients
(rpcb_local_clnt: ..., rpcb_local_clnt4: ...) for net f00001e7
[ 171.767188] NFSD: starting 90-second grace period (net f00001e7)Signed-off-by: Vasily Averin
Signed-off-by: Anna Schumaker
15 May, 2017
4 commits
-
struct rpc_procinfo contains function pointers, and marking it as
constant avoids it being able to be used as an attach vector for
code injections.Signed-off-by: Christoph Hellwig
Acked-by: Trond Myklebust -
p_count is the only writeable memeber of struct rpc_procinfo, which is
a good candidate to be const-ified as it contains function pointers.This patch moves it into out out struct rpc_procinfo, and into a
separate writable array that is pointed to by struct rpc_version and
indexed by p_statidx.Signed-off-by: Christoph Hellwig
-
Declare the p_decode callbacks with the proper prototype instead of
casting to kxdrdproc_t and losing all type safety.Signed-off-by: Christoph Hellwig
Reviewed-by: Jeff Layton -
Declare the p_encode callbacks with the proper prototype instead of
casting to kxdreproc_t and losing all type safety.Signed-off-by: Christoph Hellwig
Reviewed-by: Jeff Layton
Acked-by: Trond Myklebust
06 Feb, 2016
2 commits
-
Signed-off-by: Trond Myklebust
-
This is a pre-patch for the RPC multipath code. It sets up the storage in
struct rpc_clnt for the multipath code.Signed-off-by: Trond Myklebust
04 Feb, 2015
1 commit
-
Fix an Oopsable condition when nsm_mon_unmon is called as part of the
namespace cleanup, which now apparently happens after the utsname
has been freed.Link: http://lkml.kernel.org/r/20150125220604.090121ae@neptune.home
Reported-by: Bruno Prémont
Cc: stable@vger.kernel.org # 3.18
Signed-off-by: Trond Myklebust
25 Nov, 2014
1 commit
-
It's always set to whatever CONFIG_SUNRPC_DEBUG is, so just use that.
Signed-off-by: Jeff Layton
Signed-off-by: Trond Myklebust
08 Aug, 2013
1 commit
-
If rpcbind causes our connection to the AF_LOCAL socket to close after
we've registered a service, then we want to be careful about reconnecting
since the mount namespace may have changed.By simply refusing to reconnect the AF_LOCAL socket in the case of
unregister, we avoid the need to somehow save the mount namespace. While
this may lead to some services not unregistering properly, it should
be safe.Signed-off-by: Trond Myklebust
Cc: Nix
Cc: Jeff Layton
Cc: stable@vger.kernel.org # 3.9.x
06 Aug, 2013
1 commit
-
There is no need for the kernel to time out the AF_LOCAL connection to
the rpcbind socket, and doing so is problematic because when it is
time to reconnect, our process may no longer be using the same mount
namespace.Reported-by: Nix
Signed-off-by: Trond Myklebust
Cc: Jeff Layton
Cc: stable@vger.kernel.org # 3.9.x
05 Feb, 2013
1 commit
-
These routines are used by server and client code, so having them in a
separate header would be best.Signed-off-by: Jeff Layton
Acked-by: Trond Myklebust
Signed-off-by: J. Bruce Fields
21 Dec, 2012
1 commit
-
Pull nfsd update from Bruce Fields:
"Included this time:- more nfsd containerization work from Stanislav Kinsbursky: we're
not quite there yet, but should be by 3.9.- NFSv4.1 progress: implementation of basic backchannel security
negotiation and the mandatory BACKCHANNEL_CTL operation. Seehttp://wiki.linux-nfs.org/wiki/index.php/Server_4.0_and_4.1_issues
for remaining TODO's
- Fixes for some bugs that could be triggered by unusual compounds.
Our xdr code wasn't designed with v4 compounds in mind, and it
shows. A more thorough rewrite is still a todo.- If you've ever seen "RPC: multiple fragments per record not
supported" logged while using some sort of odd userland NFS client,
that should now be fixed.- Further work from Jeff Layton on our mechanism for storing
information about NFSv4 clients across reboots.- Further work from Bryan Schumaker on his fault-injection mechanism
(which allows us to discard selective NFSv4 state, to excercise
rarely-taken recovery code paths in the client.)- The usual mix of miscellaneous bugs and cleanup.
Thanks to everyone who tested or contributed this cycle."
* 'for-3.8' of git://linux-nfs.org/~bfields/linux: (111 commits)
nfsd4: don't leave freed stateid hashed
nfsd4: free_stateid can use the current stateid
nfsd4: cleanup: replace rq_resused count by rq_next_page pointer
nfsd: warn on odd reply state in nfsd_vfs_read
nfsd4: fix oops on unusual readlike compound
nfsd4: disable zero-copy on non-final read ops
svcrpc: fix some printks
NFSD: Correct the size calculation in fault_inject_write
NFSD: Pass correct buffer size to rpc_ntop
nfsd: pass proper net to nfsd_destroy() from NFSd kthreads
nfsd: simplify service shutdown
nfsd: replace boolean nfsd_up flag by users counter
nfsd: simplify NFSv4 state init and shutdown
nfsd: introduce helpers for generic resources init and shutdown
nfsd: make NFSd service structure allocated per net
nfsd: make NFSd service boot time per-net
nfsd: per-net NFSd up flag introduced
nfsd: move per-net startup code to separated function
nfsd: pass net to __write_ports() and down
nfsd: pass net to nfsd_set_nrthreads()
...
11 Dec, 2012
1 commit
-
This is a cleanup patch.
Signed-off-by: Stanislav Kinsbursky
Signed-off-by: J. Bruce Fields
05 Nov, 2012
1 commit
-
Replace BUG_ON() with WARN_ON_ONCE() and truncate the encoded string if
len > max.Signed-off-by: Weston Andros Adamson
Signed-off-by: Trond Myklebust
31 Jul, 2012
1 commit
-
Without this patch kernel will panic on LockD start, because lockd_up() checks
lockd_up_net() result for negative value.
From my pow it's better to return negative value from rpcbind routines instead
of replacing all such checks like in lockd_up().Signed-off-by: Stanislav Kinsbursky
Signed-off-by: Trond Myklebust
Cc: stable@vger.kernel.org [>= 3.0]
01 Jun, 2012
2 commits
-
Pull the rest of the nfsd commits from Bruce Fields:
"... and then I cherry-picked the remainder of the patches from the
head of my previous branch"This is the rest of the original nfsd branch, rebased without the
delegation stuff that I thought really needed to be redone.I don't like rebasing things like this in general, but in this situation
this was the lesser of two evils.* 'for-3.5' of git://linux-nfs.org/~bfields/linux: (50 commits)
nfsd4: fix, consolidate client_has_state
nfsd4: don't remove rebooted client record until confirmation
nfsd4: remove some dprintk's and a comment
nfsd4: return "real" sequence id in confirmed case
nfsd4: fix exchange_id to return confirm flag
nfsd4: clarify that renewing expired client is a bug
nfsd4: simpler ordering of setclientid_confirm checks
nfsd4: setclientid: remove pointless assignment
nfsd4: fix error return in non-matching-creds case
nfsd4: fix setclientid_confirm same_cred check
nfsd4: merge 3 setclientid cases to 2
nfsd4: pull out common code from setclientid cases
nfsd4: merge last two setclientid cases
nfsd4: setclientid/confirm comment cleanup
nfsd4: setclientid remove unnecessary terms from a logical expression
nfsd4: move rq_flavor into svc_cred
nfsd4: stricter cred comparison for setclientid/exchange_id
nfsd4: move principal name into svc_cred
nfsd4: allow removing clients not holding state
nfsd4: rearrange exchange_id logic to simplify
... -
This new routine is responsible for service registration in a specified
network context.The idea is to separate service creation from per-net operations.
Note also: since registering service with svc_bind() can fail, the
service will be destroyed and during destruction it will try to
unregister itself from rpcbind. In this case unregistration has to be
skipped.Signed-off-by: Stanislav Kinsbursky
Signed-off-by: J. Bruce Fields
15 May, 2012
1 commit
-
Fix kernel-doc warnings in sunrpc/rpc_pipe.c and
sunrpc/rpcb_clnt.c:Warning(net/sunrpc/rpcb_clnt.c:428): No description found for parameter 'net'
Warning(net/sunrpc/rpcb_clnt.c:567): No description found for parameter 'net'Warning(net/sunrpc/rpc_pipe.c:133): No description found for parameter 'pipe'
Warning(net/sunrpc/rpc_pipe.c:133): Excess function parameter 'inode' description in 'rpc_queue_upcall'
Warning(net/sunrpc/rpc_pipe.c:839): No description found for parameter 'pipe'
Warning(net/sunrpc/rpc_pipe.c:839): Excess function parameter 'ops' description in 'rpc_mkpipe_dentry'
Warning(net/sunrpc/rpc_pipe.c:839): Excess function parameter 'flags' description in 'rpc_mkpipe_dentry'
Warning(net/sunrpc/rpc_pipe.c:949): No description found for parameter 'dentry'
Warning(net/sunrpc/rpc_pipe.c:949): Excess function parameter 'clnt' description in 'rpc_remove_client_dir'Signed-off-by: Randy Dunlap
Signed-off-by: Trond Myklebust
28 Mar, 2012
1 commit
-
rbcb_getport_async() was looking up the rpc_xprt (reference++) and then
later looking it up again (reference++) to pass through the
rpcbind_args. The xprt would only be dereferenced once, when we were
done with the rpcbind_args (reference--). This leaves an extra
reference to the transport that would never go away.Signed-off-by: Bryan Schumaker
Signed-off-by: Trond Myklebust
21 Mar, 2012
1 commit
-
Stephen Rothwell reports:
net/sunrpc/rpcb_clnt.c: In function 'rpcb_enc_mapping':
net/sunrpc/rpcb_clnt.c:820:19: warning: unused variable 'task' [-Wunused-variable]
net/sunrpc/rpcb_clnt.c: In function 'rpcb_dec_getport':
net/sunrpc/rpcb_clnt.c:837:19: warning: unused variable 'task' [-Wunused-variable]
net/sunrpc/rpcb_clnt.c: In function 'rpcb_dec_set':
net/sunrpc/rpcb_clnt.c:860:19: warning: unused variable 'task' [-Wunused-variable]
net/sunrpc/rpcb_clnt.c: In function 'rpcb_enc_getaddr':
net/sunrpc/rpcb_clnt.c:892:19: warning: unused variable 'task' [-Wunused-variable]
net/sunrpc/rpcb_clnt.c: In function 'rpcb_dec_getaddr':
net/sunrpc/rpcb_clnt.c:914:19: warning: unused variable 'task' [-Wunused-variable]
fs/lockd/svclock.c:49:20: warning: 'nlmdbg_cookie2a' declared 'static' but never defined [-Wunused-function]Reported-by: Stephen Rothwell
Signed-off-by: Trond Myklebust
03 Mar, 2012
2 commits
-
When the cl_xprt field is updated, the cl_server field will also have
to change. Since the contents of cl_server follow the remote endpoint
of cl_xprt, just move that field to the rpc_xprt.Signed-off-by: Trond Myklebust
[ cel: simplify check_gss_callback_principal(), whitespace changes ]
[ cel: forward ported to 3.4 ]
Signed-off-by: Chuck Lever
Signed-off-by: Trond Myklebust -
A migration event will replace the rpc_xprt used by an rpc_clnt. To
ensure this can be done safely, all references to cl_xprt must now use
a form of rcu_dereference().Special care is taken with rpc_peeraddr2str(), which returns a pointer
to memory whose lifetime is the same as the rpc_xprt.Signed-off-by: Trond Myklebust
[ cel: fix lockdep splats and layering violations ]
[ cel: forward ported to 3.4 ]
[ cel: remove rpc_max_reqs(), add rpc_net_ns() ]
Signed-off-by: Chuck Lever
Signed-off-by: Trond Myklebust
01 Feb, 2012
10 commits
-
Signed-off-by: Trond Myklebust
-
...and get rid of the superfluous cl_inline_name.
Signed-off-by: Trond Myklebust
-
Pass request socket network namespace to rpc_uaddr2sockaddr() instead of
hardcoded "init_net", when decoding address in RPCBPROC_GETADDR procedure.Signed-off-by: Stanislav Kinsbursky
Signed-off-by: Trond Myklebust -
Parametrize rpc_uaddr2sockaddr() by network context and thus force it's callers to pass
in network context instead of using hard-coded "init_net".Signed-off-by: Stanislav Kinsbursky
Signed-off-by: Trond Myklebust -
These client are per network namespace and thus can be created for different
network namespaces.Signed-off-by: Stanislav Kinsbursky
Signed-off-by: Trond Myklebust -
Registering rpcbind program requires rpcbind clients, which are per network
namespace context.Signed-off-by: Stanislav Kinsbursky
Signed-off-by: Trond Myklebust -
Rpcbind clients are per network namespace.
Signed-off-by: Stanislav Kinsbursky
Signed-off-by: Trond Myklebust -
Static rpcbind registering functions can be parametrized by network namespace
pointer, calculated only once, instead of using init_net pointer (or taking it
from current when virtualization will be comleted) in many places.Signed-off-by: Stanislav Kinsbursky
Signed-off-by: Trond Myklebust -
Static rpcbind creation functions can be parametrized by network namespace
pointer, calculated only once, instead of using init_net pointer (or taking it
from current when virtualization will be comleted) in many places.Signed-off-by: Stanislav Kinsbursky
Signed-off-by: Trond Myklebust -
This patch makes rpcbind logic works in network namespace context. IOW each
network namespace will have it's own unique rpcbind internals (clients and
friends) required for registering svc services per network namespace.Signed-off-by: Stanislav Kinsbursky
Signed-off-by: Trond Myklebust
25 Oct, 2011
5 commits
-
Rpcbind clients destruction during SUNRPC module removing is obsolete since now
those clients are destroying during last RPC service shutdown.Signed-off-by: Stanislav Kinsbursky
Signed-off-by: Trond Myklebust -
We don't need this code since rpcbind clients are creating during RPC service
creation.Signed-off-by: Stanislav Kinsbursky
Signed-off-by: Trond Myklebust -
This helpers will be used only for those services, that will send portmapper
registration calls.Signed-off-by: Stanislav Kinsbursky
Signed-off-by: Trond Myklebust -
All is simple: we just increase users counter if rpcbind clients has been
created already. Otherwise we create them and set users counter to 1.Signed-off-by: Stanislav Kinsbursky
Signed-off-by: Trond Myklebust -
v6:
1) added write memory barrier to rpcb_set_local to make sure, that rpcbind
clients become valid before rpcb_users assignment
2) explicitly set rpcb_users to 1 instead of incrementing it (looks clearer from
my pow).v5: fixed races with rpcb_users in rpcb_get_local()
This helpers will be used for dynamical creation and destruction of rpcbind
clients.
Variable rpcb_users is actually a counter of lauched RPC services. If rpcbind
clients has been created already, then we just increase rpcb_users.Signed-off-by: Stanislav Kinsbursky
Signed-off-by: Trond Myklebust
19 Oct, 2011
1 commit
-
rpc_sockaddr2uaddr is only used by net/sunrpc/rpcb_clnt.c, where
it is used in a non-blockable context in at least one case.Add non-blocking capability by adding a gfp_t argument
Signed-off-by: Trond Myklebust
13 Jul, 2011
1 commit
-
Because struct rpcbind_args *map was declared static, if two
threads entered this method at the same time, the values
assigned to map could be sent two two differen tasks.
This could cause all sorts of problems, include use-after-free
and double-free of memory.Fix this by removing the static declaration so that the map
pointer is on the stack.Signed-off-by: Ben Greear
Cc: stable@kernel.org
Signed-off-by: Trond Myklebust