Loading fs/afs/misc.c +15 −1 Original line number Original line Diff line number Diff line Loading @@ -22,9 +22,12 @@ int afs_abort_to_error(u32 abort_code) int afs_abort_to_error(u32 abort_code) { { switch (abort_code) { switch (abort_code) { /* low errno codes inserted into abort namespace */ case 13: return -EACCES; case 13: return -EACCES; case 27: return -EFBIG; case 27: return -EFBIG; case 30: return -EROFS; case 30: return -EROFS; /* VICE "special error" codes; 101 - 111 */ case VSALVAGE: return -EIO; case VSALVAGE: return -EIO; case VNOVNODE: return -ENOENT; case VNOVNODE: return -ENOENT; case VNOVOL: return -ENOMEDIUM; case VNOVOL: return -ENOMEDIUM; Loading @@ -36,11 +39,18 @@ int afs_abort_to_error(u32 abort_code) case VOVERQUOTA: return -EDQUOT; case VOVERQUOTA: return -EDQUOT; case VBUSY: return -EBUSY; case VBUSY: return -EBUSY; case VMOVED: return -ENXIO; case VMOVED: return -ENXIO; case 0x2f6df0a: return -EWOULDBLOCK; /* Unified AFS error table; ET "uae" == 0x2f6df00 */ case 0x2f6df00: return -EPERM; case 0x2f6df01: return -ENOENT; case 0x2f6df04: return -EIO; case 0x2f6df0a: return -EAGAIN; case 0x2f6df0b: return -ENOMEM; case 0x2f6df0c: return -EACCES; case 0x2f6df0c: return -EACCES; case 0x2f6df0f: return -EBUSY; case 0x2f6df0f: return -EBUSY; case 0x2f6df10: return -EEXIST; case 0x2f6df10: return -EEXIST; case 0x2f6df11: return -EXDEV; case 0x2f6df11: return -EXDEV; case 0x2f6df12: return -ENODEV; case 0x2f6df13: return -ENOTDIR; case 0x2f6df13: return -ENOTDIR; case 0x2f6df14: return -EISDIR; case 0x2f6df14: return -EISDIR; case 0x2f6df15: return -EINVAL; case 0x2f6df15: return -EINVAL; Loading @@ -54,8 +64,12 @@ int afs_abort_to_error(u32 abort_code) case 0x2f6df23: return -ENAMETOOLONG; case 0x2f6df23: return -ENAMETOOLONG; case 0x2f6df24: return -ENOLCK; case 0x2f6df24: return -ENOLCK; case 0x2f6df26: return -ENOTEMPTY; case 0x2f6df26: return -ENOTEMPTY; case 0x2f6df28: return -EWOULDBLOCK; case 0x2f6df69: return -ENOTCONN; case 0x2f6df6c: return -ETIMEDOUT; case 0x2f6df78: return -EDQUOT; case 0x2f6df78: return -EDQUOT; /* RXKAD abort codes; from include/rxrpc/packet.h. ET "RXK" == 0x1260B00 */ case RXKADINCONSISTENCY: return -EPROTO; case RXKADINCONSISTENCY: return -EPROTO; case RXKADPACKETSHORT: return -EPROTO; case RXKADPACKETSHORT: return -EPROTO; case RXKADLEVELFAIL: return -EKEYREJECTED; case RXKADLEVELFAIL: return -EKEYREJECTED; Loading fs/afs/rxrpc.c +1 −4 Original line number Original line Diff line number Diff line Loading @@ -770,15 +770,12 @@ static int afs_deliver_cm_op_id(struct afs_call *call, struct sk_buff *skb, void afs_send_empty_reply(struct afs_call *call) void afs_send_empty_reply(struct afs_call *call) { { struct msghdr msg; struct msghdr msg; struct kvec iov[1]; _enter(""); _enter(""); iov[0].iov_base = NULL; iov[0].iov_len = 0; msg.msg_name = NULL; msg.msg_name = NULL; msg.msg_namelen = 0; msg.msg_namelen = 0; iov_iter_kvec(&msg.msg_iter, WRITE | ITER_KVEC, iov, 0, 0); /* WTF? */ iov_iter_kvec(&msg.msg_iter, WRITE | ITER_KVEC, NULL, 0, 0); msg.msg_control = NULL; msg.msg_control = NULL; msg.msg_controllen = 0; msg.msg_controllen = 0; msg.msg_flags = 0; msg.msg_flags = 0; Loading include/rxrpc/packet.h +2 −1 Original line number Original line Diff line number Diff line Loading @@ -47,7 +47,8 @@ struct rxrpc_header { #define RXRPC_PACKET_TYPE_CHALLENGE 6 /* connection security challenge (SRVR->CLNT) */ #define RXRPC_PACKET_TYPE_CHALLENGE 6 /* connection security challenge (SRVR->CLNT) */ #define RXRPC_PACKET_TYPE_RESPONSE 7 /* connection secutity response (CLNT->SRVR) */ #define RXRPC_PACKET_TYPE_RESPONSE 7 /* connection secutity response (CLNT->SRVR) */ #define RXRPC_PACKET_TYPE_DEBUG 8 /* debug info request */ #define RXRPC_PACKET_TYPE_DEBUG 8 /* debug info request */ #define RXRPC_N_PACKET_TYPES 9 /* number of packet types (incl type 0) */ #define RXRPC_PACKET_TYPE_VERSION 13 /* version string request */ #define RXRPC_N_PACKET_TYPES 14 /* number of packet types (incl type 0) */ uint8_t flags; /* packet flags */ uint8_t flags; /* packet flags */ #define RXRPC_CLIENT_INITIATED 0x01 /* signifies a packet generated by a client */ #define RXRPC_CLIENT_INITIATED 0x01 /* signifies a packet generated by a client */ Loading net/rxrpc/ar-input.c +22 −1 Original line number Original line Diff line number Diff line Loading @@ -28,7 +28,7 @@ const char *rxrpc_pkts[] = { const char *rxrpc_pkts[] = { "?00", "?00", "DATA", "ACK", "BUSY", "ABORT", "ACKALL", "CHALL", "RESP", "DEBUG", "DATA", "ACK", "BUSY", "ABORT", "ACKALL", "CHALL", "RESP", "DEBUG", "?09", "?10", "?11", "?12", "?13", "?14", "?15" "?09", "?10", "?11", "?12", "VERSION", "?14", "?15" }; }; /* /* Loading Loading @@ -593,6 +593,20 @@ static void rxrpc_post_packet_to_conn(struct rxrpc_connection *conn, rxrpc_queue_conn(conn); rxrpc_queue_conn(conn); } } /* * post endpoint-level events to the local endpoint * - this includes debug and version messages */ static void rxrpc_post_packet_to_local(struct rxrpc_local *local, struct sk_buff *skb) { _enter("%p,%p", local, skb); atomic_inc(&local->usage); skb_queue_tail(&local->event_queue, skb); rxrpc_queue_work(&local->event_processor); } static struct rxrpc_connection *rxrpc_conn_from_local(struct rxrpc_local *local, static struct rxrpc_connection *rxrpc_conn_from_local(struct rxrpc_local *local, struct sk_buff *skb, struct sk_buff *skb, struct rxrpc_skb_priv *sp) struct rxrpc_skb_priv *sp) Loading Loading @@ -699,6 +713,11 @@ void rxrpc_data_ready(struct sock *sk) goto bad_message; goto bad_message; } } if (sp->hdr.type == RXRPC_PACKET_TYPE_VERSION) { rxrpc_post_packet_to_local(local, skb); goto out; } if (sp->hdr.type == RXRPC_PACKET_TYPE_DATA && if (sp->hdr.type == RXRPC_PACKET_TYPE_DATA && (sp->hdr.callNumber == 0 || sp->hdr.seq == 0)) (sp->hdr.callNumber == 0 || sp->hdr.seq == 0)) goto bad_message; goto bad_message; Loading Loading @@ -731,6 +750,8 @@ void rxrpc_data_ready(struct sock *sk) else else goto cant_route_call; goto cant_route_call; } } out: rxrpc_put_local(local); rxrpc_put_local(local); return; return; Loading net/rxrpc/ar-internal.h +2 −0 Original line number Original line Diff line number Diff line Loading @@ -152,11 +152,13 @@ struct rxrpc_local { struct work_struct destroyer; /* endpoint destroyer */ struct work_struct destroyer; /* endpoint destroyer */ struct work_struct acceptor; /* incoming call processor */ struct work_struct acceptor; /* incoming call processor */ struct work_struct rejecter; /* packet reject writer */ struct work_struct rejecter; /* packet reject writer */ struct work_struct event_processor; /* endpoint event processor */ struct list_head services; /* services listening on this endpoint */ struct list_head services; /* services listening on this endpoint */ struct list_head link; /* link in endpoint list */ struct list_head link; /* link in endpoint list */ struct rw_semaphore defrag_sem; /* control re-enablement of IP DF bit */ struct rw_semaphore defrag_sem; /* control re-enablement of IP DF bit */ struct sk_buff_head accept_queue; /* incoming calls awaiting acceptance */ struct sk_buff_head accept_queue; /* incoming calls awaiting acceptance */ struct sk_buff_head reject_queue; /* packets awaiting rejection */ struct sk_buff_head reject_queue; /* packets awaiting rejection */ struct sk_buff_head event_queue; /* endpoint event packets awaiting processing */ spinlock_t lock; /* access lock */ spinlock_t lock; /* access lock */ rwlock_t services_lock; /* lock for services list */ rwlock_t services_lock; /* lock for services list */ atomic_t usage; atomic_t usage; Loading Loading
fs/afs/misc.c +15 −1 Original line number Original line Diff line number Diff line Loading @@ -22,9 +22,12 @@ int afs_abort_to_error(u32 abort_code) int afs_abort_to_error(u32 abort_code) { { switch (abort_code) { switch (abort_code) { /* low errno codes inserted into abort namespace */ case 13: return -EACCES; case 13: return -EACCES; case 27: return -EFBIG; case 27: return -EFBIG; case 30: return -EROFS; case 30: return -EROFS; /* VICE "special error" codes; 101 - 111 */ case VSALVAGE: return -EIO; case VSALVAGE: return -EIO; case VNOVNODE: return -ENOENT; case VNOVNODE: return -ENOENT; case VNOVOL: return -ENOMEDIUM; case VNOVOL: return -ENOMEDIUM; Loading @@ -36,11 +39,18 @@ int afs_abort_to_error(u32 abort_code) case VOVERQUOTA: return -EDQUOT; case VOVERQUOTA: return -EDQUOT; case VBUSY: return -EBUSY; case VBUSY: return -EBUSY; case VMOVED: return -ENXIO; case VMOVED: return -ENXIO; case 0x2f6df0a: return -EWOULDBLOCK; /* Unified AFS error table; ET "uae" == 0x2f6df00 */ case 0x2f6df00: return -EPERM; case 0x2f6df01: return -ENOENT; case 0x2f6df04: return -EIO; case 0x2f6df0a: return -EAGAIN; case 0x2f6df0b: return -ENOMEM; case 0x2f6df0c: return -EACCES; case 0x2f6df0c: return -EACCES; case 0x2f6df0f: return -EBUSY; case 0x2f6df0f: return -EBUSY; case 0x2f6df10: return -EEXIST; case 0x2f6df10: return -EEXIST; case 0x2f6df11: return -EXDEV; case 0x2f6df11: return -EXDEV; case 0x2f6df12: return -ENODEV; case 0x2f6df13: return -ENOTDIR; case 0x2f6df13: return -ENOTDIR; case 0x2f6df14: return -EISDIR; case 0x2f6df14: return -EISDIR; case 0x2f6df15: return -EINVAL; case 0x2f6df15: return -EINVAL; Loading @@ -54,8 +64,12 @@ int afs_abort_to_error(u32 abort_code) case 0x2f6df23: return -ENAMETOOLONG; case 0x2f6df23: return -ENAMETOOLONG; case 0x2f6df24: return -ENOLCK; case 0x2f6df24: return -ENOLCK; case 0x2f6df26: return -ENOTEMPTY; case 0x2f6df26: return -ENOTEMPTY; case 0x2f6df28: return -EWOULDBLOCK; case 0x2f6df69: return -ENOTCONN; case 0x2f6df6c: return -ETIMEDOUT; case 0x2f6df78: return -EDQUOT; case 0x2f6df78: return -EDQUOT; /* RXKAD abort codes; from include/rxrpc/packet.h. ET "RXK" == 0x1260B00 */ case RXKADINCONSISTENCY: return -EPROTO; case RXKADINCONSISTENCY: return -EPROTO; case RXKADPACKETSHORT: return -EPROTO; case RXKADPACKETSHORT: return -EPROTO; case RXKADLEVELFAIL: return -EKEYREJECTED; case RXKADLEVELFAIL: return -EKEYREJECTED; Loading
fs/afs/rxrpc.c +1 −4 Original line number Original line Diff line number Diff line Loading @@ -770,15 +770,12 @@ static int afs_deliver_cm_op_id(struct afs_call *call, struct sk_buff *skb, void afs_send_empty_reply(struct afs_call *call) void afs_send_empty_reply(struct afs_call *call) { { struct msghdr msg; struct msghdr msg; struct kvec iov[1]; _enter(""); _enter(""); iov[0].iov_base = NULL; iov[0].iov_len = 0; msg.msg_name = NULL; msg.msg_name = NULL; msg.msg_namelen = 0; msg.msg_namelen = 0; iov_iter_kvec(&msg.msg_iter, WRITE | ITER_KVEC, iov, 0, 0); /* WTF? */ iov_iter_kvec(&msg.msg_iter, WRITE | ITER_KVEC, NULL, 0, 0); msg.msg_control = NULL; msg.msg_control = NULL; msg.msg_controllen = 0; msg.msg_controllen = 0; msg.msg_flags = 0; msg.msg_flags = 0; Loading
include/rxrpc/packet.h +2 −1 Original line number Original line Diff line number Diff line Loading @@ -47,7 +47,8 @@ struct rxrpc_header { #define RXRPC_PACKET_TYPE_CHALLENGE 6 /* connection security challenge (SRVR->CLNT) */ #define RXRPC_PACKET_TYPE_CHALLENGE 6 /* connection security challenge (SRVR->CLNT) */ #define RXRPC_PACKET_TYPE_RESPONSE 7 /* connection secutity response (CLNT->SRVR) */ #define RXRPC_PACKET_TYPE_RESPONSE 7 /* connection secutity response (CLNT->SRVR) */ #define RXRPC_PACKET_TYPE_DEBUG 8 /* debug info request */ #define RXRPC_PACKET_TYPE_DEBUG 8 /* debug info request */ #define RXRPC_N_PACKET_TYPES 9 /* number of packet types (incl type 0) */ #define RXRPC_PACKET_TYPE_VERSION 13 /* version string request */ #define RXRPC_N_PACKET_TYPES 14 /* number of packet types (incl type 0) */ uint8_t flags; /* packet flags */ uint8_t flags; /* packet flags */ #define RXRPC_CLIENT_INITIATED 0x01 /* signifies a packet generated by a client */ #define RXRPC_CLIENT_INITIATED 0x01 /* signifies a packet generated by a client */ Loading
net/rxrpc/ar-input.c +22 −1 Original line number Original line Diff line number Diff line Loading @@ -28,7 +28,7 @@ const char *rxrpc_pkts[] = { const char *rxrpc_pkts[] = { "?00", "?00", "DATA", "ACK", "BUSY", "ABORT", "ACKALL", "CHALL", "RESP", "DEBUG", "DATA", "ACK", "BUSY", "ABORT", "ACKALL", "CHALL", "RESP", "DEBUG", "?09", "?10", "?11", "?12", "?13", "?14", "?15" "?09", "?10", "?11", "?12", "VERSION", "?14", "?15" }; }; /* /* Loading Loading @@ -593,6 +593,20 @@ static void rxrpc_post_packet_to_conn(struct rxrpc_connection *conn, rxrpc_queue_conn(conn); rxrpc_queue_conn(conn); } } /* * post endpoint-level events to the local endpoint * - this includes debug and version messages */ static void rxrpc_post_packet_to_local(struct rxrpc_local *local, struct sk_buff *skb) { _enter("%p,%p", local, skb); atomic_inc(&local->usage); skb_queue_tail(&local->event_queue, skb); rxrpc_queue_work(&local->event_processor); } static struct rxrpc_connection *rxrpc_conn_from_local(struct rxrpc_local *local, static struct rxrpc_connection *rxrpc_conn_from_local(struct rxrpc_local *local, struct sk_buff *skb, struct sk_buff *skb, struct rxrpc_skb_priv *sp) struct rxrpc_skb_priv *sp) Loading Loading @@ -699,6 +713,11 @@ void rxrpc_data_ready(struct sock *sk) goto bad_message; goto bad_message; } } if (sp->hdr.type == RXRPC_PACKET_TYPE_VERSION) { rxrpc_post_packet_to_local(local, skb); goto out; } if (sp->hdr.type == RXRPC_PACKET_TYPE_DATA && if (sp->hdr.type == RXRPC_PACKET_TYPE_DATA && (sp->hdr.callNumber == 0 || sp->hdr.seq == 0)) (sp->hdr.callNumber == 0 || sp->hdr.seq == 0)) goto bad_message; goto bad_message; Loading Loading @@ -731,6 +750,8 @@ void rxrpc_data_ready(struct sock *sk) else else goto cant_route_call; goto cant_route_call; } } out: rxrpc_put_local(local); rxrpc_put_local(local); return; return; Loading
net/rxrpc/ar-internal.h +2 −0 Original line number Original line Diff line number Diff line Loading @@ -152,11 +152,13 @@ struct rxrpc_local { struct work_struct destroyer; /* endpoint destroyer */ struct work_struct destroyer; /* endpoint destroyer */ struct work_struct acceptor; /* incoming call processor */ struct work_struct acceptor; /* incoming call processor */ struct work_struct rejecter; /* packet reject writer */ struct work_struct rejecter; /* packet reject writer */ struct work_struct event_processor; /* endpoint event processor */ struct list_head services; /* services listening on this endpoint */ struct list_head services; /* services listening on this endpoint */ struct list_head link; /* link in endpoint list */ struct list_head link; /* link in endpoint list */ struct rw_semaphore defrag_sem; /* control re-enablement of IP DF bit */ struct rw_semaphore defrag_sem; /* control re-enablement of IP DF bit */ struct sk_buff_head accept_queue; /* incoming calls awaiting acceptance */ struct sk_buff_head accept_queue; /* incoming calls awaiting acceptance */ struct sk_buff_head reject_queue; /* packets awaiting rejection */ struct sk_buff_head reject_queue; /* packets awaiting rejection */ struct sk_buff_head event_queue; /* endpoint event packets awaiting processing */ spinlock_t lock; /* access lock */ spinlock_t lock; /* access lock */ rwlock_t services_lock; /* lock for services list */ rwlock_t services_lock; /* lock for services list */ atomic_t usage; atomic_t usage; Loading