tree:
https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git rxrpc-rxgk
head: 7f002a9b47c3c704b8ccdd1e900b04cd10a44285
commit: 7f002a9b47c3c704b8ccdd1e900b04cd10a44285 [18/18] rxrpc: Implement the yfs-rxgk
transport class (security index 6)
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 7f002a9b47c3c704b8ccdd1e900b04cd10a44285
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=xtensa
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
net/rxrpc/rxgk.c: In function 'rxgk_construct_response':
net/rxrpc/rxgk.c:930:8: warning: variable 'p' set but not used
[-Wunused-but-set-variable]
930 | void *p;
| ^
> net/rxrpc/rxgk.c:927:30: warning: variable 'authx_offset'
set but not used [-Wunused-but-set-variable]
927 | unsigned short auth_offset,
authx_offset;
| ^~~~~~~~~~~~
net/rxrpc/rxgk.c: In function 'rxgk_decode_ticket':
net/rxrpc/rxgk.c:1057:3: warning: 'return' with no value, in function returning
non-void [-Wreturn-type]
1057 | return;
| ^~~~~~
net/rxrpc/rxgk.c:1043:12: note: declared here
1043 | static int rxgk_decode_ticket(struct sk_buff *skb,
| ^~~~~~~~~~~~~~~~~~
> net/rxrpc/rxgk.c:1059:2: warning: #warning TODO [-Wcpp]
1059 | #warning TODO
| ^~~~~~~
net/rxrpc/rxgk.c:1048:16: warning: unused variable 'p' [-Wunused-variable]
1048 | __be32 *xdr, *p;
| ^
net/rxrpc/rxgk.c:1047:14: warning: unused variable 'key' [-Wunused-variable]
1047 | struct key *key;
| ^~~
net/rxrpc/rxgk.c: In function 'rxgk_verify_response':
net/rxrpc/rxgk.c:1171:2: warning: #warning TODO [-Wcpp]
1171 | #warning TODO
| ^~~~~~~
net/rxrpc/rxgk.c:1091:15: warning: variable 'auth_offset' set but not used
[-Wunused-but-set-variable]
1091 | unsigned int auth_offset, auth_len;
| ^~~~~~~~~~~
#
https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/com...
git remote add dhowells-fs
https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
git fetch --no-tags dhowells-fs rxrpc-rxgk
git checkout 7f002a9b47c3c704b8ccdd1e900b04cd10a44285
vim +/authx_offset +927 net/rxrpc/rxgk.c
908
909 /*
910 * Construct the response.
911 *
912 * struct RXGK_Response {
913 * rxgkTime start_time;
914 * RXGK_Data token;
915 * opaque authenticator<RXGK_MAXAUTHENTICATOR>
916 * };
917 */
918 static int rxgk_construct_response(struct rxrpc_connection *conn,
919 struct sk_buff *challenge,
920 const u8 *nonce)
921 {
922 struct rxrpc_skb_priv *csp = rxrpc_skb(challenge), *rsp;
923 struct rxgk_context *gk = conn->rxgk;
924 const struct rxgk_key *k = gk->key;
925 struct sk_buff *skb;
926 unsigned short resp_len, auth_len, pad_len, enc_len, auth_pad_len, authx_len;
927 unsigned short auth_offset, authx_offset;
928 __be64
start_time;
929 __be32 tmp;
930 void *p;
931 int ret;
932
933 auth_len = 20 + 4 /* appdatalen */ + 12 + (4 + 4 * 4);
934 enc_len = round_up(gk->gk5e->conflen + auth_len,
gk->gk5e->blocksize);
935 pad_len = enc_len - (gk->gk5e->conflen + auth_len);
936 authx_len = enc_len + conn->rxgk->gk5e->cksumlength;
937 auth_pad_len = xdr_round_up(authx_len) - authx_len;
938
939 resp_len = 8;
940 resp_len += 4 + xdr_round_up(k->ticket.len);
941 resp_len += 4 + xdr_round_up(authx_len);
942
943 skb = alloc_skb(resp_len, GFP_NOFS);
944 if (!skb)
945 return -ENOMEM;
946
947 rsp = rxrpc_skb(skb);
948 rsp->hdr = csp->hdr;
949 rsp->hdr.flags = conn->out_clientflag;
950 rsp->hdr.cksum = gk->key_number;
951
952 start_time = cpu_to_be64(conn->rxgk_start_time);
953 p = __skb_put_data(skb, &start_time, 8);
954
955 tmp = htonl(k->ticket.len);
956 __skb_put_data(skb, &tmp, 4);
957 __skb_put_data(skb, k->ticket.data, xdr_round_up(k->ticket.len));
958 tmp = htonl(authx_len);
959 __skb_put_data(skb, &tmp, 4);
960 authx_offset = skb->len;
961 __skb_put_zero(skb, gk->gk5e->conflen);
962 auth_offset = skb->len;
963 rxgk_construct_authenticator(conn, nonce, skb);
964 __skb_put_zero(skb, pad_len + gk->gk5e->cksumlength + auth_pad_len);
965
966 ret = rxgk_encrypt_packet(gk->gk5e, &gk->resp_enc, skb, auth_offset,
auth_len);
967 if (ret < 0)
968 goto error;
969
970 ret = rxgk_send_response(conn, skb);
971 error:
972 kfree_skb(skb);
973 _leave(" = %d", ret);
974 return ret;
975 }
976
977 /*
978 * Respond to a challenge packet
979 */
980 static int rxgk_respond_to_challenge(struct rxrpc_connection *conn,
981 struct sk_buff *skb,
982 u32 *_abort_code)
983 {
984 struct rxrpc_skb_priv *sp = rxrpc_skb(skb);
985 const char *eproto;
986 u32 abort_code;
987 u8 nonce[20];
988 int ret;
989
990 _enter("{%d,%x}", conn->debug_id, key_serial(conn->params.key));
991
992 eproto = tracepoint_string("chall_no_key");
993 abort_code = RX_PROTOCOL_ERROR;
994 if (!conn->params.key)
995 goto protocol_error;
996
997 abort_code = RXGK_EXPIRED;
998 ret = key_validate(conn->params.key);
999 if (ret < 0)
1000 goto other_error;
1001
1002 eproto = tracepoint_string("chall_short");
1003 abort_code = RXGK_PACKETSHORT;
1004 if (skb_copy_bits(skb, sizeof(struct rxrpc_wire_header),
1005 nonce, sizeof(nonce)) < 0)
1006 goto protocol_error;
1007
1008 _proto("Rx CHALLENGE %%%u { n=%20phN }", sp->hdr.serial, nonce);
1009
1010 ret = rxgk_construct_response(conn, skb, nonce);
1011 if (ret < 0)
1012 goto error;
1013 return ret;
1014
1015 protocol_error:
1016 trace_rxrpc_rx_eproto(NULL, sp->hdr.serial, eproto);
1017 ret = -EPROTO;
1018 other_error:
1019 *_abort_code = abort_code;
1020 error:
1021 return ret;
1022 }
1023
1024 /*
1025 * Decode the ticket in a response.
1026 *
1027 * struct RXGK_AuthName {
1028 * afs_int32 kind;
1029 * opaque data<AUTHDATAMAX>;
1030 * opaque display<AUTHPRINTABLEMAX>;
1031 * };
1032 *
1033 * struct RXGK_Token {
1034 * rxgk_key K0;
1035 * RXGK_Level level;
1036 * rxgkTime starttime;
1037 * afs_int32 lifetime;
1038 * afs_int32 bytelife;
1039 * rxgkTime expirationtime;
1040 * struct RXGK_AuthName identities<>;
1041 * };
1042 */
1043 static int rxgk_decode_ticket(struct sk_buff *skb,
1044 unsigned int ticket_offset, unsigned int ticket_len,
1045 u32 *_abort_code)
1046 {
1047 struct key *key;
1048 __be32 *xdr, *p;
1049 int ret;
1050
1051 xdr = kmalloc(ticket_len, GFP_NOFS);
1052 if (!xdr)
1053 return -ENOMEM;
1054
1055 ret = skb_copy_bits(skb, ticket_offset, xdr, ticket_len);
1056 if (ret < 0)
1057 return;
1058
1059 #warning TODO
1060 }
1061
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org