From: David Howells <dhowells@redhat.com>
To: netdev@vger.kernel.org
Cc: David Howells <dhowells@redhat.com>,
Marc Dionne <marc.dionne@auristor.com>,
Jakub Kicinski <kuba@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
Christian Brauner <brauner@kernel.org>,
Chuck Lever <chuck.lever@oracle.com>,
linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: [PATCH net-next v2 04/13] rxrpc: Add the security index for yfs-rxgk
Date: Mon, 7 Apr 2025 17:11:17 +0100 [thread overview]
Message-ID: <20250407161130.1349147-5-dhowells@redhat.com> (raw)
In-Reply-To: <20250407161130.1349147-1-dhowells@redhat.com>
Add the security index and abort codes for the YFS variant of rxgk.
Signed-off-by: David Howells <dhowells@redhat.com>
---
fs/afs/misc.c | 27 +++++++++++++++++++++++++++
include/crypto/krb5.h | 5 +++++
include/uapi/linux/rxrpc.h | 31 +++++++++++++++++++++++++++++++
3 files changed, 63 insertions(+)
diff --git a/fs/afs/misc.c b/fs/afs/misc.c
index b8180bf2281f..8f2b3a177690 100644
--- a/fs/afs/misc.c
+++ b/fs/afs/misc.c
@@ -8,6 +8,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/errno.h>
+#include <crypto/krb5.h>
#include "internal.h"
#include "afs_fs.h"
#include "protocol_uae.h"
@@ -103,6 +104,32 @@ int afs_abort_to_error(u32 abort_code)
case RXKADDATALEN: return -EKEYREJECTED;
case RXKADILLEGALLEVEL: return -EKEYREJECTED;
+ case RXGK_INCONSISTENCY: return -EPROTO;
+ case RXGK_PACKETSHORT: return -EPROTO;
+ case RXGK_BADCHALLENGE: return -EPROTO;
+ case RXGK_SEALEDINCON: return -EKEYREJECTED;
+ case RXGK_NOTAUTH: return -EKEYREJECTED;
+ case RXGK_EXPIRED: return -EKEYEXPIRED;
+ case RXGK_BADLEVEL: return -EKEYREJECTED;
+ case RXGK_BADKEYNO: return -EKEYREJECTED;
+ case RXGK_NOTRXGK: return -EKEYREJECTED;
+ case RXGK_UNSUPPORTED: return -EKEYREJECTED;
+ case RXGK_GSSERROR: return -EKEYREJECTED;
+#ifdef RXGK_BADETYPE
+ case RXGK_BADETYPE: return -ENOPKG;
+#endif
+#ifdef RXGK_BADTOKEN
+ case RXGK_BADTOKEN: return -EKEYREJECTED;
+#endif
+#ifdef RXGK_BADETYPE
+ case RXGK_DATALEN: return -EPROTO;
+#endif
+#ifdef RXGK_BADQOP
+ case RXGK_BADQOP: return -EKEYREJECTED;
+#endif
+
+ case KRB5_PROG_KEYTYPE_NOSUPP: return -ENOPKG;
+
case RXGEN_OPCODE: return -ENOTSUPP;
default: return -EREMOTEIO;
diff --git a/include/crypto/krb5.h b/include/crypto/krb5.h
index 62d998e62f47..71dd38f59be1 100644
--- a/include/crypto/krb5.h
+++ b/include/crypto/krb5.h
@@ -63,6 +63,11 @@ struct scatterlist;
#define KEY_USAGE_SEED_ENCRYPTION (0xAA)
#define KEY_USAGE_SEED_INTEGRITY (0x55)
+/*
+ * Standard Kerberos error codes.
+ */
+#define KRB5_PROG_KEYTYPE_NOSUPP -1765328233
+
/*
* Mode of operation.
*/
diff --git a/include/uapi/linux/rxrpc.h b/include/uapi/linux/rxrpc.h
index c4e9833b0a12..d9735abd4c79 100644
--- a/include/uapi/linux/rxrpc.h
+++ b/include/uapi/linux/rxrpc.h
@@ -80,6 +80,7 @@ enum rxrpc_cmsg_type {
#define RXRPC_SECURITY_RXKAD 2 /* kaserver or kerberos 4 */
#define RXRPC_SECURITY_RXGK 4 /* gssapi-based */
#define RXRPC_SECURITY_RXK5 5 /* kerberos 5 */
+#define RXRPC_SECURITY_YFS_RXGK 6 /* YFS gssapi-based */
/*
* RxRPC-level abort codes
@@ -125,6 +126,36 @@ enum rxrpc_cmsg_type {
#define RXKADDATALEN 19270411 /* user data too long */
#define RXKADILLEGALLEVEL 19270412 /* caller not authorised to use encrypted conns */
+/*
+ * RxGK GSSAPI security abort codes.
+ */
+#if 0 /* Original standard abort codes (used by OpenAFS) */
+#define RXGK_INCONSISTENCY 1233242880 /* Security module structure inconsistent */
+#define RXGK_PACKETSHORT 1233242881 /* Packet too short for security challenge */
+#define RXGK_BADCHALLENGE 1233242882 /* Invalid security challenge */
+#define RXGK_BADETYPE 1233242883 /* Invalid or impermissible encryption type */
+#define RXGK_BADLEVEL 1233242884 /* Invalid or impermissible security level */
+#define RXGK_BADKEYNO 1233242885 /* Key version number not found */
+#define RXGK_EXPIRED 1233242886 /* Token has expired */
+#define RXGK_NOTAUTH 1233242887 /* Caller not authorized */
+#define RXGK_BAD_TOKEN 1233242888 /* Security object was passed a bad token */
+#define RXGK_SEALED_INCON 1233242889 /* Sealed data inconsistent */
+#define RXGK_DATA_LEN 1233242890 /* User data too long */
+#define RXGK_BAD_QOP 1233242891 /* Inadequate quality of protection available */
+#else /* Revised standard abort codes (used by YFS) */
+#define RXGK_INCONSISTENCY 1233242880 /* Security module structure inconsistent */
+#define RXGK_PACKETSHORT 1233242881 /* Packet too short for security challenge */
+#define RXGK_BADCHALLENGE 1233242882 /* Security challenge/response failed */
+#define RXGK_SEALEDINCON 1233242883 /* Sealed data is inconsistent */
+#define RXGK_NOTAUTH 1233242884 /* Caller not authorised */
+#define RXGK_EXPIRED 1233242885 /* Authentication expired */
+#define RXGK_BADLEVEL 1233242886 /* Unsupported or not permitted security level */
+#define RXGK_BADKEYNO 1233242887 /* Bad transport key number */
+#define RXGK_NOTRXGK 1233242888 /* Security layer is not rxgk */
+#define RXGK_UNSUPPORTED 1233242889 /* Endpoint does not support rxgk */
+#define RXGK_GSSERROR 1233242890 /* GSSAPI mechanism error */
+#endif
+
/*
* Challenge information in the RXRPC_CHALLENGED control message.
*/
next prev parent reply other threads:[~2025-04-07 16:12 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-07 16:11 [PATCH net-next v2 00/13] rxrpc, afs: Add AFS GSSAPI security class to AF_RXRPC and kafs David Howells
2025-04-07 16:11 ` [PATCH net-next v2 01/13] rxrpc: kdoc: Update function descriptions and add link from rxrpc.rst David Howells
2025-04-07 16:11 ` [PATCH net-next v2 02/13] rxrpc: Pull out certain app callback funcs into an ops table David Howells
2025-04-07 16:11 ` [PATCH net-next v2 03/13] rxrpc: Allow CHALLENGEs to the passed to the app for a RESPONSE David Howells
2025-04-10 2:06 ` Jakub Kicinski
2025-04-10 6:48 ` David Howells
2025-04-07 16:11 ` David Howells [this message]
2025-04-07 16:11 ` [PATCH net-next v2 05/13] rxrpc: Add YFS RxGK (GSSAPI) security class David Howells
2025-04-07 16:11 ` [PATCH net-next v2 06/13] rxrpc: rxgk: Provide infrastructure and key derivation David Howells
2025-04-10 2:03 ` Jakub Kicinski
2025-04-10 6:54 ` David Howells
2025-04-10 23:31 ` Jakub Kicinski
2025-04-11 7:46 ` David Howells
2025-04-07 16:11 ` [PATCH net-next v2 07/13] rxrpc: rxgk: Implement the yfs-rxgk security class (GSSAPI) David Howells
2025-04-07 16:11 ` [PATCH net-next v2 08/13] rxrpc: rxgk: Implement connection rekeying David Howells
2025-04-07 16:11 ` [PATCH net-next v2 09/13] rxrpc: Allow the app to store private data on peer structs David Howells
2025-04-07 16:11 ` [PATCH net-next v2 10/13] rxrpc: Display security params in the afs_cb_call tracepoint David Howells
2025-04-07 16:11 ` [PATCH net-next v2 11/13] afs: Use rxgk RESPONSE to pass token for callback channel David Howells
2025-04-07 16:11 ` [PATCH net-next v2 12/13] rxrpc: Add more CHALLENGE/RESPONSE packet tracing David Howells
2025-04-07 16:11 ` [PATCH net-next v2 13/13] rxrpc: rxperf: Add test RxGK server keys David Howells
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250407161130.1349147-5-dhowells@redhat.com \
--to=dhowells@redhat.com \
--cc=brauner@kernel.org \
--cc=chuck.lever@oracle.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-afs@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.dionne@auristor.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).