tree:
https://android.googlesource.com/kernel/goldfish android-3.18
head: e4742bb317218e1c75c86aa765e50cdd06d2c007
commit: b0b3266cbcbe8f9b81cb9b5b1e6cf656e774fc5c [74/187] rxrpc: Fix rxkad token xdr
encoding
config: sh-randconfig-s031-20210213 (attached as .config)
compiler: sh4-linux-gcc (GCC) 5.5.0
reproduce:
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-215-g0fb77bb6-dirty
git remote add android-goldfish
https://android.googlesource.com/kernel/goldfish
git fetch --no-tags android-goldfish android-3.18
git checkout b0b3266cbcbe8f9b81cb9b5b1e6cf656e774fc5c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-5.5.0 make.cross C=1
CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=sh
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
"sparse warnings: (new ones prefixed by >>)"
> net/rxrpc/ar-key.c:1188:25: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected void *__to @@ got restricted
__be32 [noderef] [usertype] <asn:1> *[assigned] xdr @@
net/rxrpc/ar-key.c:1188:25: sparse: expected void *__to
net/rxrpc/ar-key.c:1188:25: sparse: got restricted __be32 [noderef] [usertype]
<asn:1> *[assigned] xdr
net/rxrpc/ar-key.c:1188:25: sparse: sparse: cast removes address space
'<asn:1>' of expression
net/rxrpc/ar-key.c: note: in included file (through include/net/checksum.h,
include/linux/skbuff.h):
arch/sh/include/asm/uaccess.h:154:47: sparse: sparse: incorrect type in argument 2
(different address spaces) @@ expected void const *from @@ got void const
[noderef] <asn:1> *from @@
arch/sh/include/asm/uaccess.h:154:47: sparse: expected void const *from
arch/sh/include/asm/uaccess.h:154:47: sparse: got void const [noderef]
<asn:1> *from
arch/sh/include/asm/uaccess.h:154:47: sparse: sparse: incorrect type in argument 2
(different address spaces) @@ expected void const *from @@ got void const
[noderef] <asn:1> *from @@
arch/sh/include/asm/uaccess.h:154:47: sparse: expected void const *from
arch/sh/include/asm/uaccess.h:154:47: sparse: got void const [noderef]
<asn:1> *from
arch/sh/include/asm/uaccess.h:169:36: sparse: sparse: incorrect type in argument 1
(different address spaces) @@ expected void *to @@ got void [noderef]
<asn:1> *to @@
arch/sh/include/asm/uaccess.h:169:36: sparse: expected void *to
arch/sh/include/asm/uaccess.h:169:36: sparse: got void [noderef] <asn:1> *to
arch/sh/include/asm/uaccess.h:169:36: sparse: sparse: incorrect type in argument 1
(different address spaces) @@ expected void *to @@ got void [noderef]
<asn:1> *to @@
arch/sh/include/asm/uaccess.h:169:36: sparse: expected void *to
arch/sh/include/asm/uaccess.h:169:36: sparse: got void [noderef] <asn:1> *to
arch/sh/include/asm/uaccess.h:169:36: sparse: sparse: incorrect type in argument 1
(different address spaces) @@ expected void *to @@ got void [noderef]
<asn:1> *to @@
arch/sh/include/asm/uaccess.h:169:36: sparse: expected void *to
arch/sh/include/asm/uaccess.h:169:36: sparse: got void [noderef] <asn:1> *to
arch/sh/include/asm/uaccess.h:169:36: sparse: sparse: incorrect type in argument 1
(different address spaces) @@ expected void *to @@ got void [noderef]
<asn:1> *to @@
arch/sh/include/asm/uaccess.h:169:36: sparse: expected void *to
arch/sh/include/asm/uaccess.h:169:36: sparse: got void [noderef] <asn:1> *to
arch/sh/include/asm/uaccess.h:169:36: sparse: sparse: incorrect type in argument 1
(different address spaces) @@ expected void *to @@ got void [noderef]
<asn:1> *to @@
arch/sh/include/asm/uaccess.h:169:36: sparse: expected void *to
arch/sh/include/asm/uaccess.h:169:36: sparse: got void [noderef] <asn:1> *to
arch/sh/include/asm/uaccess.h:169:36: sparse: sparse: incorrect type in argument 1
(different address spaces) @@ expected void *to @@ got void [noderef]
<asn:1> *to @@
arch/sh/include/asm/uaccess.h:169:36: sparse: expected void *to
arch/sh/include/asm/uaccess.h:169:36: sparse: got void [noderef] <asn:1> *to
arch/sh/include/asm/uaccess.h:169:36: sparse: sparse: incorrect type in argument 1
(different address spaces) @@ expected void *to @@ got void [noderef]
<asn:1> *to @@
arch/sh/include/asm/uaccess.h:169:36: sparse: expected void *to
arch/sh/include/asm/uaccess.h:169:36: sparse: got void [noderef] <asn:1> *to
arch/sh/include/asm/uaccess.h:169:36: sparse: sparse: incorrect type in argument 1
(different address spaces) @@ expected void *to @@ got void [noderef]
<asn:1> *to @@
arch/sh/include/asm/uaccess.h:169:36: sparse: expected void *to
arch/sh/include/asm/uaccess.h:169:36: sparse: got void [noderef] <asn:1> *to
arch/sh/include/asm/uaccess.h:169:36: sparse: sparse: incorrect type in argument 1
(different address spaces) @@ expected void *to @@ got void [noderef]
<asn:1> *to @@
arch/sh/include/asm/uaccess.h:169:36: sparse: expected void *to
arch/sh/include/asm/uaccess.h:169:36: sparse: got void [noderef] <asn:1> *to
arch/sh/include/asm/uaccess.h:169:36: sparse: sparse: incorrect type in argument 1
(different address spaces) @@ expected void *to @@ got void [noderef]
<asn:1> *to @@
arch/sh/include/asm/uaccess.h:169:36: sparse: expected void *to
arch/sh/include/asm/uaccess.h:169:36: sparse: got void [noderef] <asn:1> *to
arch/sh/include/asm/uaccess.h:169:36: sparse: sparse: incorrect type in argument 1
(different address spaces) @@ expected void *to @@ got void [noderef]
<asn:1> *to @@
arch/sh/include/asm/uaccess.h:169:36: sparse: expected void *to
arch/sh/include/asm/uaccess.h:169:36: sparse: got void [noderef] <asn:1> *to
arch/sh/include/asm/uaccess.h:169:36: sparse: sparse: incorrect type in argument 1
(different address spaces) @@ expected void *to @@ got void [noderef]
<asn:1> *to @@
arch/sh/include/asm/uaccess.h:169:36: sparse: expected void *to
arch/sh/include/asm/uaccess.h:169:36: sparse: got void [noderef] <asn:1> *to
arch/sh/include/asm/uaccess.h:169:36: sparse: sparse: incorrect type in argument 1
(different address spaces) @@ expected void *to @@ got void [noderef]
<asn:1> *to @@
arch/sh/include/asm/uaccess.h:169:36: sparse: expected void *to
arch/sh/include/asm/uaccess.h:169:36: sparse: got void [noderef] <asn:1> *to
arch/sh/include/asm/uaccess.h:169:36: sparse: sparse: incorrect type in argument 1
(different address spaces) @@ expected void *to @@ got void [noderef]
<asn:1> *to @@
arch/sh/include/asm/uaccess.h:169:36: sparse: expected void *to
arch/sh/include/asm/uaccess.h:169:36: sparse: got void [noderef] <asn:1> *to
arch/sh/include/asm/uaccess.h:169:36: sparse: sparse: incorrect type in argument 1
(different address spaces) @@ expected void *to @@ got void [noderef]
<asn:1> *to @@
arch/sh/include/asm/uaccess.h:169:36: sparse: expected void *to
arch/sh/include/asm/uaccess.h:169:36: sparse: got void [noderef] <asn:1> *to
arch/sh/include/asm/uaccess.h:169:36: sparse: sparse: incorrect type in argument 1
(different address spaces) @@ expected void *to @@ got void [noderef]
<asn:1> *to @@
arch/sh/include/asm/uaccess.h:169:36: sparse: expected void *to
arch/sh/include/asm/uaccess.h:169:36: sparse: got void [noderef] <asn:1> *to
arch/sh/include/asm/uaccess.h:169:36: sparse: sparse: incorrect type in argument 1
(different address spaces) @@ expected void *to @@ got void [noderef]
<asn:1> *to @@
arch/sh/include/asm/uaccess.h:169:36: sparse: expected void *to
arch/sh/include/asm/uaccess.h:169:36: sparse: got void [noderef] <asn:1> *to
arch/sh/include/asm/uaccess.h:169:36: sparse: sparse: incorrect type in argument 1
(different address spaces) @@ expected void *to @@ got void [noderef]
<asn:1> *to @@
arch/sh/include/asm/uaccess.h:169:36: sparse: expected void *to
arch/sh/include/asm/uaccess.h:169:36: sparse: got void [noderef] <asn:1> *to
arch/sh/include/asm/uaccess.h:169:36: sparse: sparse: incorrect type in argument 1
(different address spaces) @@ expected void *to @@ got void [noderef]
<asn:1> *to @@
arch/sh/include/asm/uaccess.h:169:36: sparse: expected void *to
arch/sh/include/asm/uaccess.h:169:36: sparse: got void [noderef] <asn:1> *to
arch/sh/include/asm/uaccess.h:169:36: sparse: sparse: incorrect type in argument 1
(different address spaces) @@ expected void *to @@ got void [noderef]
<asn:1> *to @@
arch/sh/include/asm/uaccess.h:169:36: sparse: expected void *to
arch/sh/include/asm/uaccess.h:169:36: sparse: got void [noderef] <asn:1> *to
arch/sh/include/asm/uaccess.h:169:36: sparse: sparse: incorrect type in argument 1
(different address spaces) @@ expected void *to @@ got void [noderef]
<asn:1> *to @@
arch/sh/include/asm/uaccess.h:169:36: sparse: expected void *to
arch/sh/include/asm/uaccess.h:169:36: sparse: got void [noderef] <asn:1> *to
arch/sh/include/asm/uaccess.h:169:36: sparse: sparse: incorrect type in argument 1
(different address spaces) @@ expected void *to @@ got void [noderef]
<asn:1> *to @@
arch/sh/include/asm/uaccess.h:169:36: sparse: expected void *to
arch/sh/include/asm/uaccess.h:169:36: sparse: got void [noderef] <asn:1> *to
arch/sh/include/asm/uaccess.h:169:36: sparse: sparse: incorrect type in argument 1
(different address spaces) @@ expected void *to @@ got void [noderef]
<asn:1> *to @@
arch/sh/include/asm/uaccess.h:169:36: sparse: expected void *to
arch/sh/include/asm/uaccess.h:169:36: sparse: got void [noderef] <asn:1> *to
arch/sh/include/asm/uaccess.h:169:36: sparse: sparse: incorrect type in argument 1
(different address spaces) @@ expected void *to @@ got void [noderef]
<asn:1> *to @@
arch/sh/include/asm/uaccess.h:169:36: sparse: expected void *to
arch/sh/include/asm/uaccess.h:169:36: sparse: got void [noderef] <asn:1> *to
arch/sh/include/asm/uaccess.h:169:36: sparse: sparse: incorrect type in argument 1
(different address spaces) @@ expected void *to @@ got void [noderef]
<asn:1> *to @@
arch/sh/include/asm/uaccess.h:169:36: sparse: expected void *to
arch/sh/include/asm/uaccess.h:169:36: sparse: got void [noderef] <asn:1> *to
arch/sh/include/asm/uaccess.h:169:36: sparse: sparse: incorrect type in argument 1
(different address spaces) @@ expected void *to @@ got void [noderef]
<asn:1> *to @@
arch/sh/include/asm/uaccess.h:169:36: sparse: expected void *to
arch/sh/include/asm/uaccess.h:169:36: sparse: got void [noderef] <asn:1> *to
cc1: warning: arch/sh/include/cpu-sh2a: No such file or directory
[-Wmissing-include-dirs]
cc1: warning: arch/sh/include/cpu-sh2: No such file or directory
[-Wmissing-include-dirs]
cc1: warning: arch/sh/include/cpu-common: No such file or directory
[-Wmissing-include-dirs]
cc1: warning: arch/sh/include/mach-common: No such file or directory
[-Wmissing-include-dirs]
cc1: warning: arch/sh/include/cpu-sh2a: No such file or directory
[-Wmissing-include-dirs]
cc1: warning: arch/sh/include/cpu-sh2: No such file or directory
[-Wmissing-include-dirs]
cc1: warning: arch/sh/include/cpu-common: No such file or directory
[-Wmissing-include-dirs]
cc1: warning: arch/sh/include/mach-common: No such file or directory
[-Wmissing-include-dirs]
In file included from net/rxrpc/ar-key.c:17:0:
include/linux/skbuff.h: In function 'skb_can_coalesce':
include/linux/skbuff.h:2528:14: warning: comparison between signed and unsigned integer
expressions [-Wsign-compare]
off == frag->page_offset + skb_frag_size(frag);
vim +1188 net/rxrpc/ar-key.c
1129
1130 if (!buffer || buflen < size)
1131 return size;
1132
1133 xdr = (__be32 __user *) buffer;
1134 zero = 0;
1135 #define ENCODE(x) \
1136 do { \
1137 __be32 y = htonl(x); \
1138 if (put_user(y, xdr++) < 0) \
1139 goto fault; \
1140 } while(0)
1141 #define ENCODE_DATA(l, s) \
1142 do { \
1143 u32 _l = (l); \
1144 ENCODE(l); \
1145 if (copy_to_user(xdr, (s), _l) != 0) \
1146 goto fault; \
1147 if (_l & 3 && \
1148 copy_to_user((u8 __user *)xdr + _l, &zero, 4 - (_l & 3)) != 0) \
1149 goto fault; \
1150 xdr += (_l + 3) >> 2; \
1151 } while(0)
1152 #define ENCODE_BYTES(l, s) \
1153 do { \
1154 u32 _l = (l); \
1155 memcpy(xdr, (s), _l); \
1156 if (_l & 3) \
1157 memcpy((u8 *)xdr + _l, &zero, 4 - (_l & 3)); \
1158 xdr += (_l + 3) >> 2; \
1159 } while(0)
1160 #define ENCODE64(x) \
1161 do { \
1162 __be64 y = cpu_to_be64(x); \
1163 if (copy_to_user(xdr, &y, 8) != 0) \
1164 goto fault; \
1165 xdr += 8 >> 2; \
1166 } while(0)
1167 #define ENCODE_STR(s) \
1168 do { \
1169 const char *_s = (s); \
1170 ENCODE_DATA(strlen(_s), _s); \
1171 } while(0)
1172
1173 ENCODE(0); /* flags */
1174 ENCODE_DATA(cnlen, key->description + 4); /* cellname */
1175 ENCODE(ntoks);
1176
1177 tok = 0;
1178 for (token = key->payload.data; token; token = token->next) {
1179 toksize = toksizes[tok++];
1180 ENCODE(toksize);
1181 oldxdr = xdr;
1182 ENCODE(token->security_index);
1183
1184 switch (token->security_index) {
1185 case RXRPC_SECURITY_RXKAD:
1186 ENCODE(token->kad->vice_id);
1187 ENCODE(token->kad->kvno);
1188 ENCODE_BYTES(8, token->kad->session_key);
1189 ENCODE(token->kad->start);
1190 ENCODE(token->kad->expiry);
1191 ENCODE(token->kad->primary_flag);
1192 ENCODE_DATA(token->kad->ticket_len, token->kad->ticket);
1193 break;
1194
1195 case RXRPC_SECURITY_RXK5:
1196 princ = &token->k5->client;
1197 ENCODE(princ->n_name_parts);
1198 for (loop = 0; loop < princ->n_name_parts; loop++)
1199 ENCODE_STR(princ->name_parts[loop]);
1200 ENCODE_STR(princ->realm);
1201
1202 princ = &token->k5->server;
1203 ENCODE(princ->n_name_parts);
1204 for (loop = 0; loop < princ->n_name_parts; loop++)
1205 ENCODE_STR(princ->name_parts[loop]);
1206 ENCODE_STR(princ->realm);
1207
1208 ENCODE(token->k5->session.tag);
1209 ENCODE_DATA(token->k5->session.data_len,
1210 token->k5->session.data);
1211
1212 ENCODE64(token->k5->authtime);
1213 ENCODE64(token->k5->starttime);
1214 ENCODE64(token->k5->endtime);
1215 ENCODE64(token->k5->renew_till);
1216 ENCODE(token->k5->is_skey);
1217 ENCODE(token->k5->flags);
1218
1219 ENCODE(token->k5->n_addresses);
1220 for (loop = 0; loop < token->k5->n_addresses; loop++) {
1221 ENCODE(token->k5->addresses[loop].tag);
1222 ENCODE_DATA(token->k5->addresses[loop].data_len,
1223 token->k5->addresses[loop].data);
1224 }
1225
1226 ENCODE_DATA(token->k5->ticket_len, token->k5->ticket);
1227 ENCODE_DATA(token->k5->ticket2_len, token->k5->ticket2);
1228
1229 ENCODE(token->k5->n_authdata);
1230 for (loop = 0; loop < token->k5->n_authdata; loop++) {
1231 ENCODE(token->k5->authdata[loop].tag);
1232 ENCODE_DATA(token->k5->authdata[loop].data_len,
1233 token->k5->authdata[loop].data);
1234 }
1235 break;
1236
1237 default:
1238 BUG();
1239 break;
1240 }
1241
1242 ASSERTCMP((unsigned long)xdr - (unsigned long)oldxdr, ==,
1243 toksize);
1244 }
1245
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org