Skip to content

AF_RXRPC socket family and AFS rewrite [try #3]

David Howells linux-fsdevel lkml netdev 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest12 of 16 patches 0 repliesNew

12 of 16 patches are in this archive. The cover letter announces 16.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16AF_RXRPC: Move generic skbuff stuff from XFRM code to generic code [try #3]include/linux/skbuff.h include/net/esp.h net/core/skbuff.c +1 more+194 -1710 replies
2/16cancel_delayed_work: use del_timer() instead of del_timer_sync() [try #3]include/linux/workqueue.h+4 -30 replies
3/16AF_RXRPC: Key facility changes for AF_RXRPC [try #3]Documentation/keys.txt include/linux/key.h security/keys/keyring.c+16 -00 replies
4/16AF_RXRPC: Make it possible to merely try to cancel timers from a module [try #3]kernel/timer.c+2 -00 replies
7/16AF_RXRPC: Add an interface to the AF_RXRPC module for the AFS filesystem to use [try #3]Documentation/networking/rxrpc.txt include/net/af_rxrpc.h include/rxrpc/packet.h +15 more+813 -1290 replies
10/16AFS: Handle multiple mounts of an AFS superblock correctly [try #3]fs/afs/super.c+16 -100 replies
11/16AFS: Add security support [try #3]fs/afs/AFS.h fs/afs/Makefile fs/afs/callback.c +15 more+945 -2380 replies
12/16AFS: Update the AFS fs documentation [try #3]Documentation/filesystems/afs.txt+154 -600 replies
13/16commit ad495d7b6cfcd1bc2eaf06c42699be0bb5d84234 [try #3]net/netlink/af_netlink.c+3 -00 replies
14/16AFS: Add support for the CB.GetCapabilities operation [try #3]fs/afs/AFS_CM.h fs/afs/Makefile fs/afs/cmservice.c +4 more+705 -00 replies
15/16AFS: Implement the CB.InitCallBackState3 operation [try #3]fs/afs/AFS_CM.h fs/afs/cmservice.c+47 -00 replies
16/16AFS: Add "directory write" support [try #3]fs/afs/AFS.h fs/afs/AFS_FS.h fs/afs/callback.c +11 more+1778 -2680 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/16] AF_RXRPC socket family and AFS rewrite [try #3]

The first of these patches together provide secure client-side RxRPC connectivity as a Linux kernel socket family. Only the RxRPC transport/session side is supplied - the presentation side (marshalling the data) is left to the client. Copies of the patches can be found here:

http://people.redhat.com/~dhowells/rxrpc/series
http://people.redhat.com/~dhowells/rxrpc/01-move-skb-generic.diff
http://people.redhat.com/~dhowells/rxrpc/02-cancel_delayed_work.diff
http://people.redhat.com/~dhowells/rxrpc/03-keys.diff
http://people.redhat.com/~dhowells/rxrpc/04-timer-exports.diff
http://people.redhat.com/~dhowells/rxrpc/05-af_rxrpc.diff

Further patches make the in-kernel AFS filesystem use AF_RXRPC and delete the old RxRPC implementation:

http://people.redhat.com/~dhowells/rxrpc/06-afs-cleanup.diff
http://people.redhat.com/~dhowells/rxrpc/07-af_rxrpc-kernel.diff
http://people.redhat.com/~dhowells/rxrpc/08-af_rxrpc-afs.diff
http://people.redhat.com/~dhowells/rxrpc/09-af_rxrpc-delete-old.diff

And then the rest of the patches extend AFS to provide automatic unmounting of automount trees, security support and directory-level write support (create, mkdir, etc.):

http://people.redhat.com/~dhowells/rxrpc/10-afs-multimount.diff
http://people.redhat.com/~dhowells/rxrpc/11-afs-security.diff
http://people.redhat.com/~dhowells/rxrpc/12-afs-doc.diff
http://people.redhat.com/~dhowells/rxrpc/13-netlink-support-MSG_TRUNC.diff
http://people.redhat.com/~dhowells/rxrpc/14-afs-get-capabilities.diff
http://people.redhat.com/~dhowells/rxrpc/15-afs-initcallbackstate3.diff
http://people.redhat.com/~dhowells/rxrpc/16-afs-dir-write-support.diff

Note that file-level write support is not yet complete and so is not included in this patch set.

The userspace access methods make use of the control data passed to/by sendmsg() and recvmsg(). See the three simple test programs:

http://people.redhat.com/~dhowells/rxrpc/klog.c
http://people.redhat.com/~dhowells/rxrpc/rxrpc.c
http://people.redhat.com/~dhowells/rxrpc/listen.c

The klog program is provided to go and get a Kerberos IV key from the AFS kaserver. Currently it must be edited before compiling to note the right server IP address and the appropriate credentials.

These programs can be compiled by:

make klog rxrpc listen CFLAGS="-Wall -g" LDLIBS="-lcrypto -lcrypt -lkrb4 -lkeyutils"

Then a ticket can be obtained by:

	./klog

If a security key is acquired in this way, then all subsequent AFS operations - including VL lookups and mounts - performed with that session keyring will be authenticated using that key. The key can be viewed like so:

	[root@andromeda ~]# keyctl show
	Session Keyring
	       -3 --alswrv      0     0  keyring: _ses.3268
		2 --alswrv      0     0   \_ keyring: _uid.0
	111416553 --als--v      0     0   \_ rxrpc: [email protected]

TODO:

(*) Make certain parameters (such as connection timeouts) userspace
configurable.

(*) Make userspace utilities use it; librxrpc.

(*) Userspace documentation.

(*) KerberosV security.

Changes:

(*) SOCK_RPC has been removed. SOCK_DGRAM is now used instead.

(*) I've add a facility whereby calls can be made to destinations other than
the connect() address of a client socket by making use of msg_name in the msghdr struct when using sendmsg() to send the first data packet of a call. Indeed, a client socket need not be connected before being used so.

(*) I've also added a facility whereby client calls may also be made on
server sockets, again by using msg_name in the msghdr struct. In such a case, the server's local transport endpoint is used.

(*) I've made the write buffer space check available to various callers
(sk_write_space) and implemented poll support.

(*) Rewrote rxrpc_recvmsg(). It now concatenates adjacent data messages from
the same call when delivering them.

(*) Updated the documentation to include notes on recvmsg, cover control
messages and cover SOL_RXRPC-level socket options.

(*) Provided an in-kernel interface to give in-kernel utilities easier access
to the facility.

(*) Made fs/afs/ use it.

(*) Deleted the old contents of net/rxrpc/.

(*) Use the scatterlist interface to the crypto API for now. The patch that
added the direct access interface conflicts with patches Herbert Xu is producing, so I've dropped it for the moment.

(*) Moved a bug fix to make secure connection reuse work from the
af_rxrpc-kernel patch to the af_rxrpc main patch.

(*) Make RxRPC use its own private work queues rather than keventd's to avoid
deadlocks when AFS tries to use keventd too. This also puts encryption in the private work queue rather than keventd's queue as that might take a relatively long time to process.

(*) Shorten the dead call timeout to 2 seconds. Without this, each completed
call sits around eating up resources for 10 seconds. The calls need to hang around for a little while in case duplicate packets appear, but 10 seconds is excessive.

(*) Decrement the number of available calls on a connection when a new call is
allocated for a connection that doesn't have any calls in progress.

David