[samba-ksmbd:ksmbd-for-next-next 12/12] fs/ksmbd/smbacl.c:1213 smb_check_perm_dacl() warn: variable dereferenced before check 'pntsd' (see line 1212)
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Namjae Jeon <linkinjeon(a)kernel.org>
CC: Hyunchul Lee <hyc.lee(a)gmail.com>
tree: git://git.samba.org/ksmbd.git ksmbd-for-next-next
head: d0b73d20ca9100c7b969b65d8a1ff49cdd1fa9c9
commit: d0b73d20ca9100c7b969b65d8a1ff49cdd1fa9c9 [12/12] ksmbd: fix heap-based overflow in set_ntacl_dacl()
:::::: branch date: 3 days ago
:::::: commit date: 3 days ago
config: arc-randconfig-m041-20220731 (https://download.01.org/0day-ci/archive/20220801/202208010716.Io52CJih-lk...)
compiler: arceb-elf-gcc (GCC) 12.1.0
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
fs/ksmbd/smbacl.c:1213 smb_check_perm_dacl() warn: variable dereferenced before check 'pntsd' (see line 1212)
fs/ksmbd/smb2pdu.c:5182 smb2_get_info_sec() error: uninitialized symbol 'secdesclen'.
Old smatch warnings:
fs/ksmbd/smb2pdu.c:549 smb2_allocate_rsp_buf() warn: Please consider using kvzalloc instead of kvmalloc
fs/ksmbd/smb2pdu.c:3293 smb2_open() warn: Function too hairy. No more merges.
fs/ksmbd/smb2pdu.c:6123 smb2_read_pipe() warn: Please consider using kvzalloc instead of kvmalloc
fs/ksmbd/smb2pdu.c:6275 smb2_read() warn: Please consider using kvzalloc instead of kvmalloc
fs/ksmbd/smb2pdu.c:6424 smb2_write_rdma_channel() warn: Please consider using kvzalloc instead of kvmalloc
vim +/pntsd +1213 fs/ksmbd/smbacl.c
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1187
ef24c962d0f290 fs/ksmbd/smbacl.c Hyunchul Lee 2021-06-30 1188 int smb_check_perm_dacl(struct ksmbd_conn *conn, struct path *path,
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1189 __le32 *pdaccess, int uid)
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1190 {
465d720485eff1 fs/ksmbd/smbacl.c Hyunchul Lee 2021-07-03 1191 struct user_namespace *user_ns = mnt_user_ns(path->mnt);
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1192 struct smb_ntsd *pntsd = NULL;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1193 struct smb_acl *pdacl;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1194 struct posix_acl *posix_acls;
d0b73d20ca9100 fs/ksmbd/smbacl.c Namjae Jeon 2022-07-28 1195 int rc = 0, pntsd_size, acl_size, aces_size, pdacl_size, dacl_offset;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1196 struct smb_sid sid;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1197 int granted = le32_to_cpu(*pdaccess & ~FILE_MAXIMAL_ACCESS_LE);
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1198 struct smb_ace *ace;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1199 int i, found = 0;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1200 unsigned int access_bits = 0;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1201 struct smb_ace *others_ace = NULL;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1202 struct posix_acl_entry *pa_entry;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1203 unsigned int sid_type = SIDOWNER;
d0b73d20ca9100 fs/ksmbd/smbacl.c Namjae Jeon 2022-07-28 1204 unsigned short ace_size;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1205
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1206 ksmbd_debug(SMB, "check permission using windows acl\n");
d0b73d20ca9100 fs/ksmbd/smbacl.c Namjae Jeon 2022-07-28 1207 pntsd_size = ksmbd_vfs_get_sd_xattr(conn, user_ns,
af34983e831587 fs/ksmbd/smbacl.c Hyunchul Lee 2021-06-30 1208 path->dentry, &pntsd);
d0b73d20ca9100 fs/ksmbd/smbacl.c Namjae Jeon 2022-07-28 1209 if (pntsd_size <= 0)
d0b73d20ca9100 fs/ksmbd/smbacl.c Namjae Jeon 2022-07-28 1210 goto err_out;
d0b73d20ca9100 fs/ksmbd/smbacl.c Namjae Jeon 2022-07-28 1211
d0b73d20ca9100 fs/ksmbd/smbacl.c Namjae Jeon 2022-07-28 @1212 dacl_offset = le32_to_cpu(pntsd->dacloffset);
d0b73d20ca9100 fs/ksmbd/smbacl.c Namjae Jeon 2022-07-28 @1213 if (!pntsd || !pntsd->dacloffset ||
d0b73d20ca9100 fs/ksmbd/smbacl.c Namjae Jeon 2022-07-28 1214 (dacl_offset + sizeof(struct smb_acl) > pntsd_size))
d0b73d20ca9100 fs/ksmbd/smbacl.c Namjae Jeon 2022-07-28 1215 goto err_out;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1216
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1217 pdacl = (struct smb_acl *)((char *)pntsd + le32_to_cpu(pntsd->dacloffset));
d0b73d20ca9100 fs/ksmbd/smbacl.c Namjae Jeon 2022-07-28 1218 acl_size = pntsd_size - dacl_offset;
d0b73d20ca9100 fs/ksmbd/smbacl.c Namjae Jeon 2022-07-28 1219 pdacl_size = le16_to_cpu(pdacl->size);
50355b0b20103a fs/cifsd/smbacl.c Namjae Jeon 2021-03-19 1220
d0b73d20ca9100 fs/ksmbd/smbacl.c Namjae Jeon 2022-07-28 1221 if (pdacl_size > acl_size || pdacl_size < sizeof(struct smb_acl))
d0b73d20ca9100 fs/ksmbd/smbacl.c Namjae Jeon 2022-07-28 1222 goto err_out;
50355b0b20103a fs/cifsd/smbacl.c Namjae Jeon 2021-03-19 1223
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1224 if (!pdacl->num_aces) {
d0b73d20ca9100 fs/ksmbd/smbacl.c Namjae Jeon 2022-07-28 1225 if (!(pdacl_size - sizeof(struct smb_acl)) &&
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1226 *pdaccess & ~(FILE_READ_CONTROL_LE | FILE_WRITE_DAC_LE)) {
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1227 rc = -EACCES;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1228 goto err_out;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1229 }
d0b73d20ca9100 fs/ksmbd/smbacl.c Namjae Jeon 2022-07-28 1230 goto err_out;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1231 }
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1232
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1233 if (*pdaccess & FILE_MAXIMAL_ACCESS_LE) {
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1234 granted = READ_CONTROL | WRITE_DAC | FILE_READ_ATTRIBUTES |
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1235 DELETE;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1236
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1237 ace = (struct smb_ace *)((char *)pdacl + sizeof(struct smb_acl));
d0b73d20ca9100 fs/ksmbd/smbacl.c Namjae Jeon 2022-07-28 1238 aces_size = acl_size - sizeof(struct smb_acl);
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1239 for (i = 0; i < le32_to_cpu(pdacl->num_aces); i++) {
d0b73d20ca9100 fs/ksmbd/smbacl.c Namjae Jeon 2022-07-28 1240 if (offsetof(struct smb_ace, access_req) > aces_size)
d0b73d20ca9100 fs/ksmbd/smbacl.c Namjae Jeon 2022-07-28 1241 break;
d0b73d20ca9100 fs/ksmbd/smbacl.c Namjae Jeon 2022-07-28 1242 ace_size = le16_to_cpu(ace->size);
d0b73d20ca9100 fs/ksmbd/smbacl.c Namjae Jeon 2022-07-28 1243 if (ace_size > aces_size)
d0b73d20ca9100 fs/ksmbd/smbacl.c Namjae Jeon 2022-07-28 1244 break;
d0b73d20ca9100 fs/ksmbd/smbacl.c Namjae Jeon 2022-07-28 1245 aces_size -= ace_size;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1246 granted |= le32_to_cpu(ace->access_req);
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1247 ace = (struct smb_ace *)((char *)ace + le16_to_cpu(ace->size));
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1248 }
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1249
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1250 if (!pdacl->num_aces)
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1251 granted = GENERIC_ALL_FLAGS;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1252 }
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1253
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1254 if (!uid)
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1255 sid_type = SIDUNIX_USER;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1256 id_to_sid(uid, sid_type, &sid);
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1257
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1258 ace = (struct smb_ace *)((char *)pdacl + sizeof(struct smb_acl));
d0b73d20ca9100 fs/ksmbd/smbacl.c Namjae Jeon 2022-07-28 1259 aces_size = acl_size - sizeof(struct smb_acl);
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1260 for (i = 0; i < le32_to_cpu(pdacl->num_aces); i++) {
d0b73d20ca9100 fs/ksmbd/smbacl.c Namjae Jeon 2022-07-28 1261 if (offsetof(struct smb_ace, access_req) > aces_size)
d0b73d20ca9100 fs/ksmbd/smbacl.c Namjae Jeon 2022-07-28 1262 break;
d0b73d20ca9100 fs/ksmbd/smbacl.c Namjae Jeon 2022-07-28 1263 ace_size = le16_to_cpu(ace->size);
d0b73d20ca9100 fs/ksmbd/smbacl.c Namjae Jeon 2022-07-28 1264 if (ace_size > aces_size)
d0b73d20ca9100 fs/ksmbd/smbacl.c Namjae Jeon 2022-07-28 1265 break;
d0b73d20ca9100 fs/ksmbd/smbacl.c Namjae Jeon 2022-07-28 1266 aces_size -= ace_size;
d0b73d20ca9100 fs/ksmbd/smbacl.c Namjae Jeon 2022-07-28 1267
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1268 if (!compare_sids(&sid, &ace->sid) ||
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1269 !compare_sids(&sid_unix_NFS_mode, &ace->sid)) {
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1270 found = 1;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1271 break;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1272 }
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1273 if (!compare_sids(&sid_everyone, &ace->sid))
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1274 others_ace = ace;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1275
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1276 ace = (struct smb_ace *)((char *)ace + le16_to_cpu(ace->size));
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1277 }
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1278
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1279 if (*pdaccess & FILE_MAXIMAL_ACCESS_LE && found) {
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1280 granted = READ_CONTROL | WRITE_DAC | FILE_READ_ATTRIBUTES |
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1281 DELETE;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1282
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1283 granted |= le32_to_cpu(ace->access_req);
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1284
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1285 if (!pdacl->num_aces)
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1286 granted = GENERIC_ALL_FLAGS;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1287 }
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1288
777cad1604d68e fs/ksmbd/smbacl.c Namjae Jeon 2021-08-13 1289 if (IS_ENABLED(CONFIG_FS_POSIX_ACL)) {
ef24c962d0f290 fs/ksmbd/smbacl.c Hyunchul Lee 2021-06-30 1290 posix_acls = get_acl(d_inode(path->dentry), ACL_TYPE_ACCESS);
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1291 if (posix_acls && !found) {
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1292 unsigned int id = -1;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1293
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1294 pa_entry = posix_acls->a_entries;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1295 for (i = 0; i < posix_acls->a_count; i++, pa_entry++) {
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1296 if (pa_entry->e_tag == ACL_USER)
0e844efebdf9c0 fs/ksmbd/smbacl.c Christian Brauner 2021-08-23 1297 id = posix_acl_uid_translate(user_ns, pa_entry);
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1298 else if (pa_entry->e_tag == ACL_GROUP)
0e844efebdf9c0 fs/ksmbd/smbacl.c Christian Brauner 2021-08-23 1299 id = posix_acl_gid_translate(user_ns, pa_entry);
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1300 else
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1301 continue;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1302
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1303 if (id == uid) {
777cad1604d68e fs/ksmbd/smbacl.c Namjae Jeon 2021-08-13 1304 mode_to_access_flags(pa_entry->e_perm,
777cad1604d68e fs/ksmbd/smbacl.c Namjae Jeon 2021-08-13 1305 0777,
777cad1604d68e fs/ksmbd/smbacl.c Namjae Jeon 2021-08-13 1306 &access_bits);
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1307 if (!access_bits)
777cad1604d68e fs/ksmbd/smbacl.c Namjae Jeon 2021-08-13 1308 access_bits =
777cad1604d68e fs/ksmbd/smbacl.c Namjae Jeon 2021-08-13 1309 SET_MINIMUM_RIGHTS;
d21a580dafc69a fs/ksmbd/smbacl.c Xin Xiong 2022-04-29 1310 posix_acl_release(posix_acls);
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1311 goto check_access_bits;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1312 }
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1313 }
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1314 }
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1315 if (posix_acls)
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1316 posix_acl_release(posix_acls);
777cad1604d68e fs/ksmbd/smbacl.c Namjae Jeon 2021-08-13 1317 }
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1318
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1319 if (!found) {
64b39f4a2fd293 fs/cifsd/smbacl.c Namjae Jeon 2021-03-30 1320 if (others_ace) {
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1321 ace = others_ace;
64b39f4a2fd293 fs/cifsd/smbacl.c Namjae Jeon 2021-03-30 1322 } else {
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1323 ksmbd_debug(SMB, "Can't find corresponding sid\n");
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1324 rc = -EACCES;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1325 goto err_out;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1326 }
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1327 }
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1328
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1329 switch (ace->type) {
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1330 case ACCESS_ALLOWED_ACE_TYPE:
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1331 access_bits = le32_to_cpu(ace->access_req);
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1332 break;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1333 case ACCESS_DENIED_ACE_TYPE:
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1334 case ACCESS_DENIED_CALLBACK_ACE_TYPE:
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1335 access_bits = le32_to_cpu(~ace->access_req);
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1336 break;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1337 }
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1338
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1339 check_access_bits:
070fb21e5912b6 fs/cifsd/smbacl.c Namjae Jeon 2021-05-26 1340 if (granted &
070fb21e5912b6 fs/cifsd/smbacl.c Namjae Jeon 2021-05-26 1341 ~(access_bits | FILE_READ_ATTRIBUTES | READ_CONTROL | WRITE_DAC | DELETE)) {
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1342 ksmbd_debug(SMB, "Access denied with winACL, granted : %x, access_req : %x\n",
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1343 granted, le32_to_cpu(ace->access_req));
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1344 rc = -EACCES;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1345 goto err_out;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1346 }
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1347
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1348 *pdaccess = cpu_to_le32(granted);
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1349 err_out:
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1350 kfree(pntsd);
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1351 return rc;
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1352 }
e2f34481b24db2 fs/cifsd/smbacl.c Namjae Jeon 2021-03-16 1353
--
0-DAY CI Kernel Test Service
https://01.org/lkp
2 weeks, 4 days
net/bridge/br_private.h:901 br_multicast_rport_from_node_skb() warn: inconsistent indenting
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Nikolay Aleksandrov <nikolay(a)nvidia.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 6a010258447d386186ca10cd374d888ac66ffe1a
commit: 9632233e7de8da43711bb7cd3e054af32fedcc38 net: bridge: multicast: factor out port multicast context
date: 1 year ago
:::::: branch date: 19 hours ago
:::::: commit date: 1 year ago
config: arc-randconfig-m041-20220731 (https://download.01.org/0day-ci/archive/20220801/202208010331.xAA53Wvo-lk...)
compiler: arceb-elf-gcc (GCC) 12.1.0
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
net/bridge/br_private.h:901 br_multicast_rport_from_node_skb() warn: inconsistent indenting
Old smatch warnings:
net/bridge/br_forward.c:317 br_multicast_flood() error: we previously assumed 'p' could be null (see line 293)
vim +901 net/bridge/br_private.h
44ebb081dc6934 Linus Lüssing 2021-05-13 890
44ebb081dc6934 Linus Lüssing 2021-05-13 891 static inline struct net_bridge_port *
44ebb081dc6934 Linus Lüssing 2021-05-13 892 br_multicast_rport_from_node_skb(struct hlist_node *rp, struct sk_buff *skb) {
9632233e7de8da Nikolay Aleksandrov 2021-07-19 893 struct net_bridge_mcast_port *mctx;
9632233e7de8da Nikolay Aleksandrov 2021-07-19 894
a3c02e769efe66 Linus Lüssing 2021-05-13 895 #if IS_ENABLED(CONFIG_IPV6)
a3c02e769efe66 Linus Lüssing 2021-05-13 896 if (skb->protocol == htons(ETH_P_IPV6))
9632233e7de8da Nikolay Aleksandrov 2021-07-19 897 mctx = hlist_entry_safe(rp, struct net_bridge_mcast_port,
9632233e7de8da Nikolay Aleksandrov 2021-07-19 898 ip6_rlist);
9632233e7de8da Nikolay Aleksandrov 2021-07-19 899 else
a3c02e769efe66 Linus Lüssing 2021-05-13 900 #endif
9632233e7de8da Nikolay Aleksandrov 2021-07-19 @901 mctx = hlist_entry_safe(rp, struct net_bridge_mcast_port,
9632233e7de8da Nikolay Aleksandrov 2021-07-19 902 ip4_rlist);
9632233e7de8da Nikolay Aleksandrov 2021-07-19 903
9632233e7de8da Nikolay Aleksandrov 2021-07-19 904 if (mctx)
9632233e7de8da Nikolay Aleksandrov 2021-07-19 905 return mctx->port;
9632233e7de8da Nikolay Aleksandrov 2021-07-19 906 else
9632233e7de8da Nikolay Aleksandrov 2021-07-19 907 return NULL;
44ebb081dc6934 Linus Lüssing 2021-05-13 908 }
44ebb081dc6934 Linus Lüssing 2021-05-13 909
--
0-DAY CI Kernel Test Service
https://01.org/lkp
2 weeks, 4 days
Re: [PATCH drm-misc-next v6 3/5] drm/gem: rename GEM CMA helpers to GEM DMA helpers
by kernel test robot
::::::
:::::: Manual check reason: "commit no functional change"
::::::
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
In-Reply-To: <20220721130133.829693-4-dakr(a)redhat.com>
References: <20220721130133.829693-4-dakr(a)redhat.com>
TO: Danilo Krummrich <dakr(a)redhat.com>
TO: daniel(a)ffwll.ch
TO: laurent.pinchart(a)ideasonboard.com
TO: airlied(a)linux.ie
TO: tzimmermann(a)suse.de
TO: mripard(a)kernel.org
TO: sam(a)ravnborg.org
CC: Danilo Krummrich <dakr(a)redhat.com>
CC: linux-kernel(a)vger.kernel.org
CC: dri-devel(a)lists.freedesktop.org
Hi Danilo,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on drm-misc/drm-misc-next]
[cannot apply to linus/master v5.19-rc8 next-20220728]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Danilo-Krummrich/drm-renam...
base: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
:::::: branch date: 10 days ago
:::::: commit date: 10 days ago
config: nios2-buildonly-randconfig-r006-20220721 (https://download.01.org/0day-ci/archive/20220731/202207312337.CwA6jvYb-lk...)
compiler: nios2-linux-gcc (GCC) 12.1.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
# https://github.com/intel-lab-lkp/linux/commit/140c3d95439b5852acd81685062...
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Danilo-Krummrich/drm-rename-CMA-helpers-to-DMA-helpers/20220721-210404
git checkout 140c3d95439b5852acd816850625036ac3a1019d
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=nios2 SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> nios2-linux-ld: drivers/gpu/drm/mxsfb/lcdif_drv.o:(.rodata+0x218): undefined reference to `drm_gem_dma_prime_import_sg_table'
>> nios2-linux-ld: drivers/gpu/drm/mxsfb/lcdif_drv.o:(.rodata+0x220): undefined reference to `drm_gem_dma_dumb_create'
nios2-linux-ld: drivers/gpu/drm/mxsfb/lcdif_kms.o: in function `lcdif_plane_primary_atomic_update':
>> lcdif_kms.c:(.text+0x3a8): undefined reference to `drm_fb_dma_get_gem_addr'
lcdif_kms.c:(.text+0x3a8): relocation truncated to fit: R_NIOS2_CALL26 against `drm_fb_dma_get_gem_addr'
nios2-linux-ld: drivers/gpu/drm/mxsfb/lcdif_kms.o: in function `lcdif_crtc_atomic_enable':
lcdif_kms.c:(.text+0x658): undefined reference to `drm_fb_dma_get_gem_addr'
lcdif_kms.c:(.text+0x658): relocation truncated to fit: R_NIOS2_CALL26 against `drm_fb_dma_get_gem_addr'
--
0-DAY CI Kernel Test Service
https://01.org/lkp
2 weeks, 4 days
[ammarfaizi2-block:crng/random/jd/vdso 9/9] ld: arch/x86/entry/vdso/vgetrandom-x32.o: warning: relocation against `__fentry__' in read-only section `.text'
by kernel test robot
::::::
:::::: Manual check reason: "low confidence static check first_new_problem: ld: arch/x86/entry/vdso/vgetrandom-x32.o: warning: relocation against `__fentry__' in read-only section `.text'"
::::::
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: Ammar Faizi <ammarfaizi2(a)gnuweeb.org>
CC: "GNU/Weeb Mailing List" <gwml(a)vger.gnuweeb.org>
CC: linux-kernel(a)vger.kernel.org
TO: "Jason A. Donenfeld" <zx2c4(a)kernel.org>
tree: https://github.com/ammarfaizi2/linux-block crng/random/jd/vdso
head: a216645bda19c97d0f68f9b83351696ecd251eb5
commit: a216645bda19c97d0f68f9b83351696ecd251eb5 [9/9] random: implement getrandom() in vDSO
:::::: branch date: 12 hours ago
:::::: commit date: 12 hours ago
config: x86_64-randconfig-s023 (https://download.01.org/0day-ci/archive/20220731/202207312259.LRSBkOkB-lk...)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-39-gce1a6720-dirty
# https://github.com/ammarfaizi2/linux-block/commit/a216645bda19c97d0f68f9b...
git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
git fetch --no-tags ammarfaizi2-block crng/random/jd/vdso
git checkout a216645bda19c97d0f68f9b83351696ecd251eb5
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> ld: arch/x86/entry/vdso/vgetrandom-x32.o: warning: relocation against `__fentry__' in read-only section `.text'
ld: arch/x86/entry/vdso/vgetrandom-x32.o: relocation R_X86_64_PC32 against undefined symbol `__fentry__' can not be used when making a shared object; recompile with -fPIC
ld: final link failed: bad value
objdump: 'arch/x86/entry/vdso/vdsox32.so.dbg': No such file
--
0-DAY CI Kernel Test Service
https://01.org/lkp
2 weeks, 4 days
[ammarfaizi2-block:netdev/net-next/main 20/29] net/core/devlink.c:6392 devlink_nl_cmd_region_new() warn: inconsistent returns '®ion->snapshot_lock'.
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: Ammar Faizi <ammarfaizi2(a)gnuweeb.org>
CC: "GNU/Weeb Mailing List" <gwml(a)vger.gnuweeb.org>
CC: linux-kernel(a)vger.kernel.org
TO: Jiri Pirko <jiri(a)nvidia.com>
CC: Jakub Kicinski <kuba(a)kernel.org>
tree: https://github.com/ammarfaizi2/linux-block netdev/net-next/main
head: 63757225a93353bc2ce4499af5501eabdbbf23f9
commit: 2dec18ad826f52658f7781ee995d236cc449b678 [20/29] net: devlink: remove region snapshots list dependency on devlink->lock
:::::: branch date: 27 hours ago
:::::: commit date: 2 days ago
config: arc-randconfig-m041-20220731 (https://download.01.org/0day-ci/archive/20220731/202207311503.QBFSGqiL-lk...)
compiler: arceb-elf-gcc (GCC) 12.1.0
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
net/core/devlink.c:6392 devlink_nl_cmd_region_new() warn: inconsistent returns '®ion->snapshot_lock'.
Old smatch warnings:
net/core/devlink.c:7284 devlink_fmsg_prepare_skb() error: uninitialized symbol 'err'.
arch/arc/include/asm/thread_info.h:62 current_thread_info() error: uninitialized symbol 'sp'.
vim +6392 net/core/devlink.c
866319bb943761 Alex Vesker 2018-07-12 6270
b9a17abfde842b Jacob Keller 2020-03-26 6271 static int
b9a17abfde842b Jacob Keller 2020-03-26 6272 devlink_nl_cmd_region_new(struct sk_buff *skb, struct genl_info *info)
b9a17abfde842b Jacob Keller 2020-03-26 6273 {
b9a17abfde842b Jacob Keller 2020-03-26 6274 struct devlink *devlink = info->user_ptr[0];
043b3e22768d5d Jakub Kicinski 2020-05-01 6275 struct devlink_snapshot *snapshot;
544e7c33ec2f80 Andrew Lunn 2020-10-04 6276 struct devlink_port *port = NULL;
043b3e22768d5d Jakub Kicinski 2020-05-01 6277 struct nlattr *snapshot_id_attr;
b9a17abfde842b Jacob Keller 2020-03-26 6278 struct devlink_region *region;
b9a17abfde842b Jacob Keller 2020-03-26 6279 const char *region_name;
544e7c33ec2f80 Andrew Lunn 2020-10-04 6280 unsigned int index;
b9a17abfde842b Jacob Keller 2020-03-26 6281 u32 snapshot_id;
b9a17abfde842b Jacob Keller 2020-03-26 6282 u8 *data;
b9a17abfde842b Jacob Keller 2020-03-26 6283 int err;
b9a17abfde842b Jacob Keller 2020-03-26 6284
b9a17abfde842b Jacob Keller 2020-03-26 6285 if (!info->attrs[DEVLINK_ATTR_REGION_NAME]) {
b9a17abfde842b Jacob Keller 2020-03-26 6286 NL_SET_ERR_MSG_MOD(info->extack, "No region name provided");
b9a17abfde842b Jacob Keller 2020-03-26 6287 return -EINVAL;
b9a17abfde842b Jacob Keller 2020-03-26 6288 }
b9a17abfde842b Jacob Keller 2020-03-26 6289
b9a17abfde842b Jacob Keller 2020-03-26 6290 region_name = nla_data(info->attrs[DEVLINK_ATTR_REGION_NAME]);
544e7c33ec2f80 Andrew Lunn 2020-10-04 6291
544e7c33ec2f80 Andrew Lunn 2020-10-04 6292 if (info->attrs[DEVLINK_ATTR_PORT_INDEX]) {
544e7c33ec2f80 Andrew Lunn 2020-10-04 6293 index = nla_get_u32(info->attrs[DEVLINK_ATTR_PORT_INDEX]);
544e7c33ec2f80 Andrew Lunn 2020-10-04 6294
544e7c33ec2f80 Andrew Lunn 2020-10-04 6295 port = devlink_port_get_by_index(devlink, index);
544e7c33ec2f80 Andrew Lunn 2020-10-04 6296 if (!port)
544e7c33ec2f80 Andrew Lunn 2020-10-04 6297 return -ENODEV;
544e7c33ec2f80 Andrew Lunn 2020-10-04 6298 }
544e7c33ec2f80 Andrew Lunn 2020-10-04 6299
544e7c33ec2f80 Andrew Lunn 2020-10-04 6300 if (port)
544e7c33ec2f80 Andrew Lunn 2020-10-04 6301 region = devlink_port_region_get_by_name(port, region_name);
544e7c33ec2f80 Andrew Lunn 2020-10-04 6302 else
b9a17abfde842b Jacob Keller 2020-03-26 6303 region = devlink_region_get_by_name(devlink, region_name);
544e7c33ec2f80 Andrew Lunn 2020-10-04 6304
b9a17abfde842b Jacob Keller 2020-03-26 6305 if (!region) {
b9a17abfde842b Jacob Keller 2020-03-26 6306 NL_SET_ERR_MSG_MOD(info->extack, "The requested region does not exist");
b9a17abfde842b Jacob Keller 2020-03-26 6307 return -EINVAL;
b9a17abfde842b Jacob Keller 2020-03-26 6308 }
b9a17abfde842b Jacob Keller 2020-03-26 6309
b9a17abfde842b Jacob Keller 2020-03-26 6310 if (!region->ops->snapshot) {
b9a17abfde842b Jacob Keller 2020-03-26 6311 NL_SET_ERR_MSG_MOD(info->extack, "The requested region does not support taking an immediate snapshot");
b9a17abfde842b Jacob Keller 2020-03-26 6312 return -EOPNOTSUPP;
b9a17abfde842b Jacob Keller 2020-03-26 6313 }
b9a17abfde842b Jacob Keller 2020-03-26 6314
2dec18ad826f52 Jiri Pirko 2022-07-28 6315 mutex_lock(®ion->snapshot_lock);
2dec18ad826f52 Jiri Pirko 2022-07-28 6316
b9a17abfde842b Jacob Keller 2020-03-26 6317 if (region->cur_snapshots == region->max_snapshots) {
b9a17abfde842b Jacob Keller 2020-03-26 6318 NL_SET_ERR_MSG_MOD(info->extack, "The region has reached the maximum number of stored snapshots");
2dec18ad826f52 Jiri Pirko 2022-07-28 6319 err = -ENOSPC;
2dec18ad826f52 Jiri Pirko 2022-07-28 6320 goto unlock;
b9a17abfde842b Jacob Keller 2020-03-26 6321 }
b9a17abfde842b Jacob Keller 2020-03-26 6322
043b3e22768d5d Jakub Kicinski 2020-05-01 6323 snapshot_id_attr = info->attrs[DEVLINK_ATTR_REGION_SNAPSHOT_ID];
043b3e22768d5d Jakub Kicinski 2020-05-01 6324 if (snapshot_id_attr) {
043b3e22768d5d Jakub Kicinski 2020-05-01 6325 snapshot_id = nla_get_u32(snapshot_id_attr);
b9a17abfde842b Jacob Keller 2020-03-26 6326
b9a17abfde842b Jacob Keller 2020-03-26 6327 if (devlink_region_snapshot_get_by_id(region, snapshot_id)) {
b9a17abfde842b Jacob Keller 2020-03-26 6328 NL_SET_ERR_MSG_MOD(info->extack, "The requested snapshot id is already in use");
2dec18ad826f52 Jiri Pirko 2022-07-28 6329 err = -EEXIST;
2dec18ad826f52 Jiri Pirko 2022-07-28 6330 goto unlock;
b9a17abfde842b Jacob Keller 2020-03-26 6331 }
b9a17abfde842b Jacob Keller 2020-03-26 6332
b9a17abfde842b Jacob Keller 2020-03-26 6333 err = __devlink_snapshot_id_insert(devlink, snapshot_id);
b9a17abfde842b Jacob Keller 2020-03-26 6334 if (err)
2dec18ad826f52 Jiri Pirko 2022-07-28 6335 goto unlock;
043b3e22768d5d Jakub Kicinski 2020-05-01 6336 } else {
043b3e22768d5d Jakub Kicinski 2020-05-01 6337 err = __devlink_region_snapshot_id_get(devlink, &snapshot_id);
043b3e22768d5d Jakub Kicinski 2020-05-01 6338 if (err) {
043b3e22768d5d Jakub Kicinski 2020-05-01 6339 NL_SET_ERR_MSG_MOD(info->extack, "Failed to allocate a new snapshot id");
2dec18ad826f52 Jiri Pirko 2022-07-28 6340 goto unlock;
043b3e22768d5d Jakub Kicinski 2020-05-01 6341 }
043b3e22768d5d Jakub Kicinski 2020-05-01 6342 }
b9a17abfde842b Jacob Keller 2020-03-26 6343
544e7c33ec2f80 Andrew Lunn 2020-10-04 6344 if (port)
544e7c33ec2f80 Andrew Lunn 2020-10-04 6345 err = region->port_ops->snapshot(port, region->port_ops,
544e7c33ec2f80 Andrew Lunn 2020-10-04 6346 info->extack, &data);
544e7c33ec2f80 Andrew Lunn 2020-10-04 6347 else
544e7c33ec2f80 Andrew Lunn 2020-10-04 6348 err = region->ops->snapshot(devlink, region->ops,
544e7c33ec2f80 Andrew Lunn 2020-10-04 6349 info->extack, &data);
b9a17abfde842b Jacob Keller 2020-03-26 6350 if (err)
b9a17abfde842b Jacob Keller 2020-03-26 6351 goto err_snapshot_capture;
b9a17abfde842b Jacob Keller 2020-03-26 6352
b9a17abfde842b Jacob Keller 2020-03-26 6353 err = __devlink_region_snapshot_create(region, data, snapshot_id);
b9a17abfde842b Jacob Keller 2020-03-26 6354 if (err)
b9a17abfde842b Jacob Keller 2020-03-26 6355 goto err_snapshot_create;
b9a17abfde842b Jacob Keller 2020-03-26 6356
043b3e22768d5d Jakub Kicinski 2020-05-01 6357 if (!snapshot_id_attr) {
043b3e22768d5d Jakub Kicinski 2020-05-01 6358 struct sk_buff *msg;
043b3e22768d5d Jakub Kicinski 2020-05-01 6359
043b3e22768d5d Jakub Kicinski 2020-05-01 6360 snapshot = devlink_region_snapshot_get_by_id(region,
043b3e22768d5d Jakub Kicinski 2020-05-01 6361 snapshot_id);
043b3e22768d5d Jakub Kicinski 2020-05-01 6362 if (WARN_ON(!snapshot))
043b3e22768d5d Jakub Kicinski 2020-05-01 6363 return -EINVAL;
043b3e22768d5d Jakub Kicinski 2020-05-01 6364
043b3e22768d5d Jakub Kicinski 2020-05-01 6365 msg = devlink_nl_region_notify_build(region, snapshot,
043b3e22768d5d Jakub Kicinski 2020-05-01 6366 DEVLINK_CMD_REGION_NEW,
043b3e22768d5d Jakub Kicinski 2020-05-01 6367 info->snd_portid,
043b3e22768d5d Jakub Kicinski 2020-05-01 6368 info->snd_seq);
043b3e22768d5d Jakub Kicinski 2020-05-01 6369 err = PTR_ERR_OR_ZERO(msg);
043b3e22768d5d Jakub Kicinski 2020-05-01 6370 if (err)
043b3e22768d5d Jakub Kicinski 2020-05-01 6371 goto err_notify;
043b3e22768d5d Jakub Kicinski 2020-05-01 6372
043b3e22768d5d Jakub Kicinski 2020-05-01 6373 err = genlmsg_reply(msg, info);
043b3e22768d5d Jakub Kicinski 2020-05-01 6374 if (err)
043b3e22768d5d Jakub Kicinski 2020-05-01 6375 goto err_notify;
043b3e22768d5d Jakub Kicinski 2020-05-01 6376 }
043b3e22768d5d Jakub Kicinski 2020-05-01 6377
2dec18ad826f52 Jiri Pirko 2022-07-28 6378 mutex_unlock(®ion->snapshot_lock);
b9a17abfde842b Jacob Keller 2020-03-26 6379 return 0;
b9a17abfde842b Jacob Keller 2020-03-26 6380
b9a17abfde842b Jacob Keller 2020-03-26 6381 err_snapshot_create:
b9a17abfde842b Jacob Keller 2020-03-26 6382 region->ops->destructor(data);
b9a17abfde842b Jacob Keller 2020-03-26 6383 err_snapshot_capture:
b9a17abfde842b Jacob Keller 2020-03-26 6384 __devlink_snapshot_id_decrement(devlink, snapshot_id);
2dec18ad826f52 Jiri Pirko 2022-07-28 6385 mutex_unlock(®ion->snapshot_lock);
b9a17abfde842b Jacob Keller 2020-03-26 6386 return err;
043b3e22768d5d Jakub Kicinski 2020-05-01 6387
043b3e22768d5d Jakub Kicinski 2020-05-01 6388 err_notify:
043b3e22768d5d Jakub Kicinski 2020-05-01 6389 devlink_region_snapshot_del(region, snapshot);
2dec18ad826f52 Jiri Pirko 2022-07-28 6390 unlock:
2dec18ad826f52 Jiri Pirko 2022-07-28 6391 mutex_unlock(®ion->snapshot_lock);
043b3e22768d5d Jakub Kicinski 2020-05-01 @6392 return err;
b9a17abfde842b Jacob Keller 2020-03-26 6393 }
b9a17abfde842b Jacob Keller 2020-03-26 6394
:::::: The code at line 6392 was first introduced by commit
:::::: 043b3e22768d5d909cb1474fc21ae2fbaf026c0c devlink: let kernel allocate region snapshot id
:::::: TO: Jakub Kicinski <kuba(a)kernel.org>
:::::: CC: David S. Miller <davem(a)davemloft.net>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
2 weeks, 5 days
drivers/ata/libahci_platform.c:552 ahci_platform_get_resources() warn: passing zero to 'ERR_PTR'
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Wang Hai <wanghai38(a)huawei.com>
CC: Damien Le Moal <damien.lemoal(a)wdc.com>
CC: Hans de Goede <hdegoede(a)redhat.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 6a010258447d386186ca10cd374d888ac66ffe1a
commit: 776c75010803849c1cc4f11031a2b3960ab05202 ata: ahci_platform: fix null-ptr-deref in ahci_platform_enable_regulators()
date: 10 months ago
:::::: branch date: 7 hours ago
:::::: commit date: 10 months ago
config: openrisc-randconfig-m041-20220731 (https://download.01.org/0day-ci/archive/20220731/202207311447.RWacsQPY-lk...)
compiler: or1k-linux-gcc (GCC) 12.1.0
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/ata/libahci_platform.c:552 ahci_platform_get_resources() warn: passing zero to 'ERR_PTR'
vim +/ERR_PTR +552 drivers/ata/libahci_platform.c
b1a9edbda040a435 Antoine Tenart 2014-07-30 513
c7d7ddee7e24eedd Gregory CLEMENT 2015-01-15 514 rc = ahci_platform_get_phy(hpriv, port, dev, child);
d7f76f36a8b4dc8e Nishka Dasgupta 2019-08-15 515 if (rc) {
d7f76f36a8b4dc8e Nishka Dasgupta 2019-08-15 516 of_node_put(child);
c7d7ddee7e24eedd Gregory CLEMENT 2015-01-15 517 goto err_out;
d7f76f36a8b4dc8e Nishka Dasgupta 2019-08-15 518 }
c7d7ddee7e24eedd Gregory CLEMENT 2015-01-15 519
b1a9edbda040a435 Antoine Tenart 2014-07-30 520 enabled_ports++;
b1a9edbda040a435 Antoine Tenart 2014-07-30 521 }
b1a9edbda040a435 Antoine Tenart 2014-07-30 522 if (!enabled_ports) {
b1a9edbda040a435 Antoine Tenart 2014-07-30 523 dev_warn(dev, "No port enabled\n");
b1a9edbda040a435 Antoine Tenart 2014-07-30 524 rc = -ENODEV;
b1a9edbda040a435 Antoine Tenart 2014-07-30 525 goto err_out;
b1a9edbda040a435 Antoine Tenart 2014-07-30 526 }
b1a9edbda040a435 Antoine Tenart 2014-07-30 527
b1a9edbda040a435 Antoine Tenart 2014-07-30 528 if (!hpriv->mask_port_map)
b1a9edbda040a435 Antoine Tenart 2014-07-30 529 hpriv->mask_port_map = mask_port_map;
b1a9edbda040a435 Antoine Tenart 2014-07-30 530 } else {
b1a9edbda040a435 Antoine Tenart 2014-07-30 531 /*
b1a9edbda040a435 Antoine Tenart 2014-07-30 532 * If no sub-node was found, keep this for device tree
b1a9edbda040a435 Antoine Tenart 2014-07-30 533 * compatibility
b1a9edbda040a435 Antoine Tenart 2014-07-30 534 */
c7d7ddee7e24eedd Gregory CLEMENT 2015-01-15 535 rc = ahci_platform_get_phy(hpriv, 0, dev, dev->of_node);
c7d7ddee7e24eedd Gregory CLEMENT 2015-01-15 536 if (rc)
acbd573354bb7b7b Mikko Perttunen 2014-06-17 537 goto err_out;
fd990556f0fa2544 Bartlomiej Zolnierkiewicz 2014-03-25 538
c7d7ddee7e24eedd Gregory CLEMENT 2015-01-15 539 rc = ahci_platform_get_regulator(hpriv, 0, dev);
c7d7ddee7e24eedd Gregory CLEMENT 2015-01-15 540 if (rc == -EPROBE_DEFER)
fd990556f0fa2544 Bartlomiej Zolnierkiewicz 2014-03-25 541 goto err_out;
b1a9edbda040a435 Antoine Tenart 2014-07-30 542 }
fd990556f0fa2544 Bartlomiej Zolnierkiewicz 2014-03-25 543 pm_runtime_enable(dev);
eac7e072d7e99fad Tejun Heo 2018-08-06 544 pm_runtime_get_sync(dev);
fd990556f0fa2544 Bartlomiej Zolnierkiewicz 2014-03-25 545 hpriv->got_runtime_pm = true;
fd990556f0fa2544 Bartlomiej Zolnierkiewicz 2014-03-25 546
fd990556f0fa2544 Bartlomiej Zolnierkiewicz 2014-03-25 547 devres_remove_group(dev, NULL);
fd990556f0fa2544 Bartlomiej Zolnierkiewicz 2014-03-25 548 return hpriv;
fd990556f0fa2544 Bartlomiej Zolnierkiewicz 2014-03-25 549
fd990556f0fa2544 Bartlomiej Zolnierkiewicz 2014-03-25 550 err_out:
fd990556f0fa2544 Bartlomiej Zolnierkiewicz 2014-03-25 551 devres_release_group(dev, NULL);
fd990556f0fa2544 Bartlomiej Zolnierkiewicz 2014-03-25 @552 return ERR_PTR(rc);
fd990556f0fa2544 Bartlomiej Zolnierkiewicz 2014-03-25 553 }
fd990556f0fa2544 Bartlomiej Zolnierkiewicz 2014-03-25 554 EXPORT_SYMBOL_GPL(ahci_platform_get_resources);
fd990556f0fa2544 Bartlomiej Zolnierkiewicz 2014-03-25 555
:::::: The code at line 552 was first introduced by commit
:::::: fd990556f0fa25446c6bfa9cf4c9e49d387d4472 ata: move library code from ahci_platform.c to libahci_platform.c
:::::: TO: Bartlomiej Zolnierkiewicz <b.zolnierkie(a)samsung.com>
:::::: CC: Tejun Heo <tj(a)kernel.org>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
2 weeks, 5 days
[rt-devel:linux-5.19.y-rt-rebase 24/55] kernel/printk/printk.c:2471 __alloc_atomic_data() warn: returning -1 instead of -ENOMEM is sloppy
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: John Ogness <john.ogness(a)linutronix.de>
CC: Sebastian Andrzej Siewior <bigeasy(a)linutronix.de>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-5.19.y-rt-rebase
head: 4730816e7a6aab17945765fc82d47cdc9a05b8fa
commit: 6eb7d10a338af10245f976ea32922acea68f36a1 [24/55] serial: 8250: implement write_atomic
:::::: branch date: 34 hours ago
:::::: commit date: 34 hours ago
config: x86_64-randconfig-m001 (https://download.01.org/0day-ci/archive/20220731/202207310935.JGnbLvQu-lk...)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
kernel/printk/printk.c:2471 __alloc_atomic_data() warn: returning -1 instead of -ENOMEM is sloppy
vim +2471 kernel/printk/printk.c
565dc55e237ca6 John Ogness 2022-02-04 2466
565dc55e237ca6 John Ogness 2022-02-04 2467 static int __alloc_atomic_data(struct console_atomic_data *d, short flags)
565dc55e237ca6 John Ogness 2022-02-04 2468 {
565dc55e237ca6 John Ogness 2022-02-04 2469 d->text = kmalloc(CONSOLE_LOG_MAX, GFP_KERNEL);
565dc55e237ca6 John Ogness 2022-02-04 2470 if (!d->text)
565dc55e237ca6 John Ogness 2022-02-04 @2471 return -1;
565dc55e237ca6 John Ogness 2022-02-04 2472
565dc55e237ca6 John Ogness 2022-02-04 2473 if (flags & CON_EXTENDED) {
565dc55e237ca6 John Ogness 2022-02-04 2474 d->ext_text = kmalloc(CONSOLE_EXT_LOG_MAX, GFP_KERNEL);
565dc55e237ca6 John Ogness 2022-02-04 2475 if (!d->ext_text)
565dc55e237ca6 John Ogness 2022-02-04 2476 return -1;
565dc55e237ca6 John Ogness 2022-02-04 2477 } else {
565dc55e237ca6 John Ogness 2022-02-04 2478 d->dropped_text = kmalloc(DROPPED_TEXT_MAX, GFP_KERNEL);
565dc55e237ca6 John Ogness 2022-02-04 2479 if (!d->dropped_text)
565dc55e237ca6 John Ogness 2022-02-04 2480 return -1;
565dc55e237ca6 John Ogness 2022-02-04 2481 }
565dc55e237ca6 John Ogness 2022-02-04 2482
565dc55e237ca6 John Ogness 2022-02-04 2483 return 0;
565dc55e237ca6 John Ogness 2022-02-04 2484 }
565dc55e237ca6 John Ogness 2022-02-04 2485
:::::: The code at line 2471 was first introduced by commit
:::::: 565dc55e237ca6ad85f6af783b3d5dd3928e8871 printk: add infrastucture for atomic consoles
:::::: TO: John Ogness <john.ogness(a)linutronix.de>
:::::: CC: Sebastian Andrzej Siewior <bigeasy(a)linutronix.de>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
2 weeks, 5 days
[djwong-xfs:vectorized-scrub 142/411] include/linux/fortify-string.h:45:33: warning: use of NULL 'ifp' where non-null expected [CWE-476]
by kernel test robot
::::::
:::::: Manual check reason: "low confidence bisect report"
:::::: Manual check reason: "low confidence static check first_new_problem: include/linux/fortify-string.h:45:33: warning: use of NULL 'ifp' where non-null expected [CWE-476] [-Wanalyzer-null-argument]"
::::::
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
TO: "Darrick J. Wong" <darrick.wong(a)oracle.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git vectorized-scrub
head: 1d79555b9e2bc74efef217aee3f208794112be10
commit: bbad4483f77af34666ccb231b429012b00275c32 [142/411] xfs: repair inode block maps
:::::: branch date: 4 days ago
:::::: commit date: 4 days ago
config: i386-randconfig-c001 (https://download.01.org/0day-ci/archive/20220731/202207310943.CazSEYbl-lk...)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git/comm...
git remote add djwong-xfs https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git
git fetch --no-tags djwong-xfs vectorized-scrub
git checkout bbad4483f77af34666ccb231b429012b00275c32
# save the config file
make ARCH=i386 KBUILD_USERCFLAGS='-fanalyzer -Wno-error'
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp(a)intel.com>
gcc-analyzer warnings: (new ones prefixed by >>)
| | ^~~~~~~~~~~~~~~~~~~~
| | |
| | (1) entry to 'xfs_bmbt_init_cursor'
|......
| 594 | struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork);
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | (2) calling 'xfs_ifork_ptr' from 'xfs_bmbt_init_cursor'
|
+--> 'xfs_ifork_ptr': events 3-4
|
|fs/xfs/xfs_inode.h:86:1:
| 86 | xfs_ifork_ptr(
| | ^~~~~~~~~~~~~
| | |
| | (3) entry to 'xfs_ifork_ptr'
|......
| 94 | if (!xfs_inode_has_attr_fork(ip))
| | ~
| | |
| | (4) following 'true' branch...
|
'xfs_ifork_ptr': event 5
|
|cc1:
| (5): ...to here
|
<------+
|
'xfs_bmbt_init_cursor': events 6-7
|
|fs/xfs/libxfs/xfs_bmap_btree.c:594:40:
| 594 | struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork);
| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | (6) return of NULL to 'xfs_bmbt_init_cursor' from 'xfs_ifork_ptr'
|......
| 597 | cur = xfs_bmbt_init_common(mp, tp, ip, whichfork);
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | (7) calling 'xfs_bmbt_init_common' from 'xfs_bmbt_init_cursor'
|
+--> 'xfs_bmbt_init_common': event 8
|
| 558 | xfs_bmbt_init_common(
| | ^~~~~~~~~~~~~~~~~~~~
| | |
| | (8) entry to 'xfs_bmbt_init_common'
|
'xfs_bmbt_init_common': event 9
|
|fs/xfs/xfs_linux.h:206:33:
| 206 | (likely(expr) ? (void)0 : assfail(NULL, #expr, __FILE__, __LINE__))
| | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | (9) following 'false' branch...
fs/xfs/libxfs/xfs_bmap_btree.c:566:9: note: in expansion of macro 'ASSERT'
| 566 | ASSERT(whichfork != XFS_COW_FORK);
| | ^~~~~~
|
'xfs_bmbt_init_common': event 10
|
| 568 | cur = xfs_btree_alloc_cursor(mp, tp, XFS_BTNUM_BMAP,
| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | (10) ...to here
| 569 | mp->m_bm_maxlevels[whichfork], xfs_bmbt_cur_cache);
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
<------+
|
'xfs_bmbt_init_cursor': event 11
|
| 597 | cur = xfs_bmbt_init_common(mp, tp, ip, whichfork);
| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | (11) returning to 'xfs_bmbt_init_cursor' from 'xfs_bmbt_init_common'
|
'xfs_bmbt_init_cursor': event 12
|
| 599 | cur->bc_nlevels = be16_to_cpu(ifp->if_broot->bb_level) + 1;
| | ~~~^~~~~~~~~~
| | |
| | (12) dereference of NULL 'ifp'
include/uapi/linux/swab.h:102:54: note: in definition of macro '__swab16'
| 102 | #define __swab16(x) (__u16)__builtin_bswap16((__u16)(x))
| | ^
include/linux/byteorder/generic.h:97:21: note: in expansion of macro '__be16_to_cpu'
| 97 | #define be16_to_cpu __be16_to_cpu
| | ^~~~~~~~~~~~~
fs/xfs/libxfs/xfs_bmap_btree.c:599:27: note: in expansion of macro 'be16_to_cpu'
| 599 | cur->bc_nlevels = be16_to_cpu(ifp->if_broot->bb_level) + 1;
| | ^~~~~~~~~~~
|
In file included from include/linux/string.h:253,
from include/linux/uuid.h:12,
from fs/xfs/xfs_linux.h:10,
from fs/xfs/xfs.h:22,
from fs/xfs/libxfs/xfs_bmap_btree.c:6:
fs/xfs/libxfs/xfs_bmap_btree.c: In function 'xfs_bmbt_commit_staged_btree':
>> include/linux/fortify-string.h:45:33: warning: use of NULL 'ifp' where non-null expected [CWE-476] [-Wanalyzer-null-argument]
45 | #define __underlying_memcpy __builtin_memcpy
| ^
include/linux/fortify-string.h:378:9: note: in expansion of macro '__underlying_memcpy'
378 | __underlying_##op(p, q, __fortify_size); \
| ^~~~~~~~~~~~~
include/linux/fortify-string.h:385:26: note: in expansion of macro '__fortify_memcpy_chk'
385 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \
| ^~~~~~~~~~~~~~~~~~~~
fs/xfs/libxfs/xfs_bmap_btree.c:670:9: note: in expansion of macro 'memcpy'
670 | memcpy(ifp, ifake->if_fork, sizeof(struct xfs_ifork));
| ^~~~~~
'xfs_bmbt_commit_staged_btree': events 1-2
|
| 647 | xfs_bmbt_commit_staged_btree(
| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | (1) entry to 'xfs_bmbt_commit_staged_btree'
|......
| 668 | ifp = xfs_ifork_ptr(cur->bc_ino.ip, whichfork);
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | (2) calling 'xfs_ifork_ptr' from 'xfs_bmbt_commit_staged_btree'
|
+--> 'xfs_ifork_ptr': events 3-4
|
|fs/xfs/xfs_inode.h:86:1:
| 86 | xfs_ifork_ptr(
| | ^~~~~~~~~~~~~
| | |
| | (3) entry to 'xfs_ifork_ptr'
|......
| 94 | if (!xfs_inode_has_attr_fork(ip))
| | ~
| | |
| | (4) following 'true' branch...
|
'xfs_ifork_ptr': event 5
|
|cc1:
| (5): ...to here
|
<------+
|
'xfs_bmbt_commit_staged_btree': event 6
|
|fs/xfs/libxfs/xfs_bmap_btree.c:668:15:
| 668 | ifp = xfs_ifork_ptr(cur->bc_ino.ip, whichfork);
| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | (6) returning to 'xfs_bmbt_commit_staged_btree' from 'xfs_ifork_ptr'
|
'xfs_bmbt_commit_staged_btree': event 7
|
|include/linux/fortify-string.h:368:12:
| 368 | if ((p_size != (size_t)(-1) && p_size < size) ||
| | ^
| | |
| | (7) following 'false' branch...
|
'xfs_bmbt_commit_staged_btree': event 8
|
|fs/xfs/libxfs/xfs_bmap_btree.c:670:26:
| 670 | memcpy(ifp, ifake->if_fork, sizeof(struct xfs_ifork));
| | ~~~~~^~~~~~~~~
| | |
| | (8) ...to here
include/linux/fortify-string.h:378:30: note: in definition of macro '__fortify_memcpy_chk'
| 378 | __underlying_##op(p, q, __fortify_size); \
| | ^
fs/xfs/libxfs/xfs_bmap_btree.c:670:9: note: in expansion of macro 'memcpy'
| 670 | memcpy(ifp, ifake->if_fork, sizeof(struct xfs_ifork));
| | ^~~~~~
|
'xfs_bmbt_commit_staged_btree': event 9
|
|include/linux/fortify-string.h:45:33:
| 45 | #define __underlying_memcpy __builtin_memcpy
| | ^
| | |
| | (9) argument 1 ('ifp') NULL where non-null expected
include/linux/fortify-string.h:378:9: note: in expansion of macro '__underlying_memcpy'
| 378 | __underlying_##op(p, q, __fortify_size); \
| | ^~~~~~~~~~~~~
include/linux/fortify-string.h:385:26: note: in expansion of macro '__fortify_memcpy_chk'
| 385 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \
| | ^~~~~~~~~~~~~~~~~~~~
fs/xfs/libxfs/xfs_bmap_btree.c:670:9: note: in expansion of macro 'memcpy'
| 670 | memcpy(ifp, ifake->if_fork, sizeof(struct xfs_ifork));
| | ^~~~~~
|
<built-in>: note: argument 1 of '__builtin_memcpy' must be non-null
In file included from include/linux/string.h:5,
from include/linux/uuid.h:12,
from fs/xfs/xfs_linux.h:10,
from fs/xfs/xfs.h:22,
from fs/xfs/libxfs/xfs_bmap_btree.c:6:
fs/xfs/libxfs/xfs_bmap_btree.c: In function 'xfs_bmbt_change_owner':
fs/xfs/libxfs/xfs_bmap_btree.c:767:44: warning: dereference of NULL '0' [CWE-476] [-Wanalyzer-null-dereference]
767 | ASSERT(xfs_ifork_ptr(ip, whichfork)->if_format == XFS_DINODE_FMT_BTREE);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
vim +/ifp +45 include/linux/fortify-string.h
3009f891bb9f32 Kees Cook 2021-08-02 30
a28a6e860c6cf2 Francis Laniel 2021-02-25 31 #if defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KASAN_SW_TAGS)
a28a6e860c6cf2 Francis Laniel 2021-02-25 32 extern void *__underlying_memchr(const void *p, int c, __kernel_size_t size) __RENAME(memchr);
a28a6e860c6cf2 Francis Laniel 2021-02-25 33 extern int __underlying_memcmp(const void *p, const void *q, __kernel_size_t size) __RENAME(memcmp);
a28a6e860c6cf2 Francis Laniel 2021-02-25 34 extern void *__underlying_memcpy(void *p, const void *q, __kernel_size_t size) __RENAME(memcpy);
a28a6e860c6cf2 Francis Laniel 2021-02-25 35 extern void *__underlying_memmove(void *p, const void *q, __kernel_size_t size) __RENAME(memmove);
a28a6e860c6cf2 Francis Laniel 2021-02-25 36 extern void *__underlying_memset(void *p, int c, __kernel_size_t size) __RENAME(memset);
a28a6e860c6cf2 Francis Laniel 2021-02-25 37 extern char *__underlying_strcat(char *p, const char *q) __RENAME(strcat);
a28a6e860c6cf2 Francis Laniel 2021-02-25 38 extern char *__underlying_strcpy(char *p, const char *q) __RENAME(strcpy);
a28a6e860c6cf2 Francis Laniel 2021-02-25 39 extern __kernel_size_t __underlying_strlen(const char *p) __RENAME(strlen);
a28a6e860c6cf2 Francis Laniel 2021-02-25 40 extern char *__underlying_strncat(char *p, const char *q, __kernel_size_t count) __RENAME(strncat);
a28a6e860c6cf2 Francis Laniel 2021-02-25 41 extern char *__underlying_strncpy(char *p, const char *q, __kernel_size_t size) __RENAME(strncpy);
a28a6e860c6cf2 Francis Laniel 2021-02-25 42 #else
a28a6e860c6cf2 Francis Laniel 2021-02-25 43 #define __underlying_memchr __builtin_memchr
a28a6e860c6cf2 Francis Laniel 2021-02-25 44 #define __underlying_memcmp __builtin_memcmp
a28a6e860c6cf2 Francis Laniel 2021-02-25 @45 #define __underlying_memcpy __builtin_memcpy
a28a6e860c6cf2 Francis Laniel 2021-02-25 46 #define __underlying_memmove __builtin_memmove
a28a6e860c6cf2 Francis Laniel 2021-02-25 47 #define __underlying_memset __builtin_memset
a28a6e860c6cf2 Francis Laniel 2021-02-25 48 #define __underlying_strcat __builtin_strcat
a28a6e860c6cf2 Francis Laniel 2021-02-25 49 #define __underlying_strcpy __builtin_strcpy
a28a6e860c6cf2 Francis Laniel 2021-02-25 50 #define __underlying_strlen __builtin_strlen
a28a6e860c6cf2 Francis Laniel 2021-02-25 51 #define __underlying_strncat __builtin_strncat
a28a6e860c6cf2 Francis Laniel 2021-02-25 52 #define __underlying_strncpy __builtin_strncpy
a28a6e860c6cf2 Francis Laniel 2021-02-25 53 #endif
a28a6e860c6cf2 Francis Laniel 2021-02-25 54
:::::: The code at line 45 was first introduced by commit
:::::: a28a6e860c6cf231cf3c5171c75c342adcd00406 string.h: move fortified functions definitions in a dedicated header.
:::::: TO: Francis Laniel <laniel_francis(a)privacyrequired.com>
:::::: CC: Linus Torvalds <torvalds(a)linux-foundation.org>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
2 weeks, 5 days
[mark:arm64/stacktrace/rework-cleanup 3/8] arch/arm64/include/asm/stacktrace.h:70:57: error: 'sdei_stack_normal_ptr' undeclared
by kernel test robot
::::::
:::::: Manual check reason: "commit no functional change"
::::::
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Mark Rutland <mark.rutland(a)arm.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git arm64/stacktrace/rework-cleanup
head: 37ad2f60a7f96676259bde924cf329d652c75e2c
commit: 365ef1c2e3f77492fef937e652f3f85a1818c7f3 [3/8] arm64: stacktrace: move SDEI stack helpers to stacktrace code
:::::: branch date: 13 hours ago
:::::: commit date: 13 hours ago
config: arm64-allyesconfig (https://download.01.org/0day-ci/archive/20220730/202207301421.sXiXP6tR-lk...)
compiler: aarch64-linux-gcc (GCC) 12.1.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
# https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/commit/?id...
git remote add mark https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git
git fetch --no-tags mark arm64/stacktrace/rework-cleanup
git checkout 365ef1c2e3f77492fef937e652f3f85a1818c7f3
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash arch/arm64/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/asm-generic/percpu.h:7,
from arch/arm64/include/asm/percpu.h:249,
from include/linux/irqflags.h:17,
from include/linux/rcupdate.h:26,
from include/linux/rculist.h:11,
from include/linux/pid.h:5,
from include/linux/sched.h:14,
from include/linux/context_tracking.h:5,
from arch/arm64/kernel/entry-common.c:8:
arch/arm64/include/asm/stacktrace.h: In function 'on_sdei_normal_stack':
>> arch/arm64/include/asm/stacktrace.h:70:57: error: 'sdei_stack_normal_ptr' undeclared (first use in this function)
70 | unsigned long low = (unsigned long)raw_cpu_read(sdei_stack_normal_ptr);
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:318:16: note: in definition of macro '__pcpu_size_call_return'
318 | typeof(variable) pscr_ret__; \
| ^~~~~~~~
arch/arm64/include/asm/stacktrace.h:70:44: note: in expansion of macro 'raw_cpu_read'
70 | unsigned long low = (unsigned long)raw_cpu_read(sdei_stack_normal_ptr);
| ^~~~~~~~~~~~
arch/arm64/include/asm/stacktrace.h:70:57: note: each undeclared identifier is reported only once for each function it appears in
70 | unsigned long low = (unsigned long)raw_cpu_read(sdei_stack_normal_ptr);
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:318:16: note: in definition of macro '__pcpu_size_call_return'
318 | typeof(variable) pscr_ret__; \
| ^~~~~~~~
arch/arm64/include/asm/stacktrace.h:70:44: note: in expansion of macro 'raw_cpu_read'
70 | unsigned long low = (unsigned long)raw_cpu_read(sdei_stack_normal_ptr);
| ^~~~~~~~~~~~
arch/arm64/include/asm/stacktrace.h: In function 'on_sdei_critical_stack':
>> arch/arm64/include/asm/stacktrace.h:79:57: error: 'sdei_stack_critical_ptr' undeclared (first use in this function)
79 | unsigned long low = (unsigned long)raw_cpu_read(sdei_stack_critical_ptr);
| ^~~~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:318:16: note: in definition of macro '__pcpu_size_call_return'
318 | typeof(variable) pscr_ret__; \
| ^~~~~~~~
arch/arm64/include/asm/stacktrace.h:79:44: note: in expansion of macro 'raw_cpu_read'
79 | unsigned long low = (unsigned long)raw_cpu_read(sdei_stack_critical_ptr);
| ^~~~~~~~~~~~
--
In file included from include/asm-generic/percpu.h:7,
from arch/arm64/include/asm/percpu.h:249,
from include/linux/irqflags.h:17,
from include/linux/rcupdate.h:26,
from include/linux/rculist.h:11,
from include/linux/pid.h:5,
from include/linux/sched.h:14,
from include/linux/audit.h:12,
from arch/arm64/kernel/ptrace.c:11:
arch/arm64/include/asm/stacktrace.h: In function 'on_sdei_normal_stack':
>> arch/arm64/include/asm/stacktrace.h:70:57: error: 'sdei_stack_normal_ptr' undeclared (first use in this function)
70 | unsigned long low = (unsigned long)raw_cpu_read(sdei_stack_normal_ptr);
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:318:16: note: in definition of macro '__pcpu_size_call_return'
318 | typeof(variable) pscr_ret__; \
| ^~~~~~~~
arch/arm64/include/asm/stacktrace.h:70:44: note: in expansion of macro 'raw_cpu_read'
70 | unsigned long low = (unsigned long)raw_cpu_read(sdei_stack_normal_ptr);
| ^~~~~~~~~~~~
arch/arm64/include/asm/stacktrace.h:70:57: note: each undeclared identifier is reported only once for each function it appears in
70 | unsigned long low = (unsigned long)raw_cpu_read(sdei_stack_normal_ptr);
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:318:16: note: in definition of macro '__pcpu_size_call_return'
318 | typeof(variable) pscr_ret__; \
| ^~~~~~~~
arch/arm64/include/asm/stacktrace.h:70:44: note: in expansion of macro 'raw_cpu_read'
70 | unsigned long low = (unsigned long)raw_cpu_read(sdei_stack_normal_ptr);
| ^~~~~~~~~~~~
arch/arm64/include/asm/stacktrace.h: In function 'on_sdei_critical_stack':
>> arch/arm64/include/asm/stacktrace.h:79:57: error: 'sdei_stack_critical_ptr' undeclared (first use in this function)
79 | unsigned long low = (unsigned long)raw_cpu_read(sdei_stack_critical_ptr);
| ^~~~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:318:16: note: in definition of macro '__pcpu_size_call_return'
318 | typeof(variable) pscr_ret__; \
| ^~~~~~~~
arch/arm64/include/asm/stacktrace.h:79:44: note: in expansion of macro 'raw_cpu_read'
79 | unsigned long low = (unsigned long)raw_cpu_read(sdei_stack_critical_ptr);
| ^~~~~~~~~~~~
arch/arm64/kernel/ptrace.c: At top level:
arch/arm64/kernel/ptrace.c:2112:5: warning: no previous prototype for 'syscall_trace_enter' [-Wmissing-prototypes]
2112 | int syscall_trace_enter(struct pt_regs *regs)
| ^~~~~~~~~~~~~~~~~~~
arch/arm64/kernel/ptrace.c:2135:6: warning: no previous prototype for 'syscall_trace_exit' [-Wmissing-prototypes]
2135 | void syscall_trace_exit(struct pt_regs *regs)
| ^~~~~~~~~~~~~~~~~~
--
In file included from include/asm-generic/percpu.h:7,
from arch/arm64/include/asm/percpu.h:249,
from include/linux/irqflags.h:17,
from include/linux/rcupdate.h:26,
from include/linux/rculist.h:11,
from include/linux/pid.h:5,
from include/linux/sched.h:14,
from include/linux/context_tracking.h:5,
from arch/arm64/kernel/traps.c:10:
arch/arm64/include/asm/stacktrace.h: In function 'on_sdei_normal_stack':
>> arch/arm64/include/asm/stacktrace.h:70:57: error: 'sdei_stack_normal_ptr' undeclared (first use in this function)
70 | unsigned long low = (unsigned long)raw_cpu_read(sdei_stack_normal_ptr);
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:318:16: note: in definition of macro '__pcpu_size_call_return'
318 | typeof(variable) pscr_ret__; \
| ^~~~~~~~
arch/arm64/include/asm/stacktrace.h:70:44: note: in expansion of macro 'raw_cpu_read'
70 | unsigned long low = (unsigned long)raw_cpu_read(sdei_stack_normal_ptr);
| ^~~~~~~~~~~~
arch/arm64/include/asm/stacktrace.h:70:57: note: each undeclared identifier is reported only once for each function it appears in
70 | unsigned long low = (unsigned long)raw_cpu_read(sdei_stack_normal_ptr);
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:318:16: note: in definition of macro '__pcpu_size_call_return'
318 | typeof(variable) pscr_ret__; \
| ^~~~~~~~
arch/arm64/include/asm/stacktrace.h:70:44: note: in expansion of macro 'raw_cpu_read'
70 | unsigned long low = (unsigned long)raw_cpu_read(sdei_stack_normal_ptr);
| ^~~~~~~~~~~~
arch/arm64/include/asm/stacktrace.h: In function 'on_sdei_critical_stack':
>> arch/arm64/include/asm/stacktrace.h:79:57: error: 'sdei_stack_critical_ptr' undeclared (first use in this function)
79 | unsigned long low = (unsigned long)raw_cpu_read(sdei_stack_critical_ptr);
| ^~~~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:318:16: note: in definition of macro '__pcpu_size_call_return'
318 | typeof(variable) pscr_ret__; \
| ^~~~~~~~
arch/arm64/include/asm/stacktrace.h:79:44: note: in expansion of macro 'raw_cpu_read'
79 | unsigned long low = (unsigned long)raw_cpu_read(sdei_stack_critical_ptr);
| ^~~~~~~~~~~~
arch/arm64/kernel/traps.c: At top level:
arch/arm64/kernel/traps.c:802:43: warning: initialized field overwritten [-Woverride-init]
802 | [ESR_ELx_EC_UNKNOWN] = "Unknown/Uncategorized",
| ^~~~~~~~~~~~~~~~~~~~~~~
arch/arm64/kernel/traps.c:802:43: note: (near initialization for 'esr_class_str[0]')
arch/arm64/kernel/traps.c:803:43: warning: initialized field overwritten [-Woverride-init]
803 | [ESR_ELx_EC_WFx] = "WFI/WFE",
| ^~~~~~~~~
arch/arm64/kernel/traps.c:803:43: note: (near initialization for 'esr_class_str[1]')
arch/arm64/kernel/traps.c:804:43: warning: initialized field overwritten [-Woverride-init]
804 | [ESR_ELx_EC_CP15_32] = "CP15 MCR/MRC",
| ^~~~~~~~~~~~~~
arch/arm64/kernel/traps.c:804:43: note: (near initialization for 'esr_class_str[3]')
arch/arm64/kernel/traps.c:805:43: warning: initialized field overwritten [-Woverride-init]
805 | [ESR_ELx_EC_CP15_64] = "CP15 MCRR/MRRC",
| ^~~~~~~~~~~~~~~~
arch/arm64/kernel/traps.c:805:43: note: (near initialization for 'esr_class_str[4]')
arch/arm64/kernel/traps.c:806:43: warning: initialized field overwritten [-Woverride-init]
806 | [ESR_ELx_EC_CP14_MR] = "CP14 MCR/MRC",
| ^~~~~~~~~~~~~~
arch/arm64/kernel/traps.c:806:43: note: (near initialization for 'esr_class_str[5]')
arch/arm64/kernel/traps.c:807:43: warning: initialized field overwritten [-Woverride-init]
807 | [ESR_ELx_EC_CP14_LS] = "CP14 LDC/STC",
| ^~~~~~~~~~~~~~
arch/arm64/kernel/traps.c:807:43: note: (near initialization for 'esr_class_str[6]')
arch/arm64/kernel/traps.c:808:43: warning: initialized field overwritten [-Woverride-init]
808 | [ESR_ELx_EC_FP_ASIMD] = "ASIMD",
| ^~~~~~~
arch/arm64/kernel/traps.c:808:43: note: (near initialization for 'esr_class_str[7]')
arch/arm64/kernel/traps.c:809:43: warning: initialized field overwritten [-Woverride-init]
809 | [ESR_ELx_EC_CP10_ID] = "CP10 MRC/VMRS",
| ^~~~~~~~~~~~~~~
arch/arm64/kernel/traps.c:809:43: note: (near initialization for 'esr_class_str[8]')
arch/arm64/kernel/traps.c:810:43: warning: initialized field overwritten [-Woverride-init]
810 | [ESR_ELx_EC_PAC] = "PAC",
| ^~~~~
arch/arm64/kernel/traps.c:810:43: note: (near initialization for 'esr_class_str[9]')
arch/arm64/kernel/traps.c:811:43: warning: initialized field overwritten [-Woverride-init]
811 | [ESR_ELx_EC_CP14_64] = "CP14 MCRR/MRRC",
| ^~~~~~~~~~~~~~~~
arch/arm64/kernel/traps.c:811:43: note: (near initialization for 'esr_class_str[12]')
arch/arm64/kernel/traps.c:812:43: warning: initialized field overwritten [-Woverride-init]
812 | [ESR_ELx_EC_BTI] = "BTI",
| ^~~~~
arch/arm64/kernel/traps.c:812:43: note: (near initialization for 'esr_class_str[13]')
arch/arm64/kernel/traps.c:813:43: warning: initialized field overwritten [-Woverride-init]
813 | [ESR_ELx_EC_ILL] = "PSTATE.IL",
| ^~~~~~~~~~~
arch/arm64/kernel/traps.c:813:43: note: (near initialization for 'esr_class_str[14]')
arch/arm64/kernel/traps.c:814:43: warning: initialized field overwritten [-Woverride-init]
814 | [ESR_ELx_EC_SVC32] = "SVC (AArch32)",
| ^~~~~~~~~~~~~~~
arch/arm64/kernel/traps.c:814:43: note: (near initialization for 'esr_class_str[17]')
arch/arm64/kernel/traps.c:815:43: warning: initialized field overwritten [-Woverride-init]
815 | [ESR_ELx_EC_HVC32] = "HVC (AArch32)",
| ^~~~~~~~~~~~~~~
arch/arm64/kernel/traps.c:815:43: note: (near initialization for 'esr_class_str[18]')
arch/arm64/kernel/traps.c:816:43: warning: initialized field overwritten [-Woverride-init]
816 | [ESR_ELx_EC_SMC32] = "SMC (AArch32)",
| ^~~~~~~~~~~~~~~
arch/arm64/kernel/traps.c:816:43: note: (near initialization for 'esr_class_str[19]')
arch/arm64/kernel/traps.c:817:43: warning: initialized field overwritten [-Woverride-init]
817 | [ESR_ELx_EC_SVC64] = "SVC (AArch64)",
| ^~~~~~~~~~~~~~~
arch/arm64/kernel/traps.c:817:43: note: (near initialization for 'esr_class_str[21]')
arch/arm64/kernel/traps.c:818:43: warning: initialized field overwritten [-Woverride-init]
818 | [ESR_ELx_EC_HVC64] = "HVC (AArch64)",
| ^~~~~~~~~~~~~~~
arch/arm64/kernel/traps.c:818:43: note: (near initialization for 'esr_class_str[22]')
arch/arm64/kernel/traps.c:819:43: warning: initialized field overwritten [-Woverride-init]
819 | [ESR_ELx_EC_SMC64] = "SMC (AArch64)",
| ^~~~~~~~~~~~~~~
arch/arm64/kernel/traps.c:819:43: note: (near initialization for 'esr_class_str[23]')
arch/arm64/kernel/traps.c:820:43: warning: initialized field overwritten [-Woverride-init]
820 | [ESR_ELx_EC_SYS64] = "MSR/MRS (AArch64)",
| ^~~~~~~~~~~~~~~~~~~
arch/arm64/kernel/traps.c:820:43: note: (near initialization for 'esr_class_str[24]')
arch/arm64/kernel/traps.c:821:43: warning: initialized field overwritten [-Woverride-init]
821 | [ESR_ELx_EC_SVE] = "SVE",
| ^~~~~
arch/arm64/kernel/traps.c:821:43: note: (near initialization for 'esr_class_str[25]')
arch/arm64/kernel/traps.c:822:43: warning: initialized field overwritten [-Woverride-init]
822 | [ESR_ELx_EC_ERET] = "ERET/ERETAA/ERETAB",
| ^~~~~~~~~~~~~~~~~~~~
arch/arm64/kernel/traps.c:822:43: note: (near initialization for 'esr_class_str[26]')
arch/arm64/kernel/traps.c:823:43: warning: initialized field overwritten [-Woverride-init]
823 | [ESR_ELx_EC_FPAC] = "FPAC",
| ^~~~~~
arch/arm64/kernel/traps.c:823:43: note: (near initialization for 'esr_class_str[28]')
arch/arm64/kernel/traps.c:824:43: warning: initialized field overwritten [-Woverride-init]
824 | [ESR_ELx_EC_SME] = "SME",
| ^~~~~
vim +/sdei_stack_normal_ptr +70 arch/arm64/include/asm/stacktrace.h
365ef1c2e3f7749 Mark Rutland 2022-04-14 66
365ef1c2e3f7749 Mark Rutland 2022-04-14 67 static inline bool on_sdei_normal_stack(unsigned long sp, unsigned long size,
365ef1c2e3f7749 Mark Rutland 2022-04-14 68 struct stack_info *info)
365ef1c2e3f7749 Mark Rutland 2022-04-14 69 {
365ef1c2e3f7749 Mark Rutland 2022-04-14 @70 unsigned long low = (unsigned long)raw_cpu_read(sdei_stack_normal_ptr);
365ef1c2e3f7749 Mark Rutland 2022-04-14 71 unsigned long high = low + SDEI_STACK_SIZE;
365ef1c2e3f7749 Mark Rutland 2022-04-14 72
365ef1c2e3f7749 Mark Rutland 2022-04-14 73 return on_stack(sp, size, low, high, STACK_TYPE_SDEI_NORMAL, info);
365ef1c2e3f7749 Mark Rutland 2022-04-14 74 }
365ef1c2e3f7749 Mark Rutland 2022-04-14 75
365ef1c2e3f7749 Mark Rutland 2022-04-14 76 static inline bool on_sdei_critical_stack(unsigned long sp, unsigned long size,
365ef1c2e3f7749 Mark Rutland 2022-04-14 77 struct stack_info *info)
365ef1c2e3f7749 Mark Rutland 2022-04-14 78 {
365ef1c2e3f7749 Mark Rutland 2022-04-14 @79 unsigned long low = (unsigned long)raw_cpu_read(sdei_stack_critical_ptr);
365ef1c2e3f7749 Mark Rutland 2022-04-14 80 unsigned long high = low + SDEI_STACK_SIZE;
365ef1c2e3f7749 Mark Rutland 2022-04-14 81
365ef1c2e3f7749 Mark Rutland 2022-04-14 82 return on_stack(sp, size, low, high, STACK_TYPE_SDEI_CRITICAL, info);
365ef1c2e3f7749 Mark Rutland 2022-04-14 83 }
365ef1c2e3f7749 Mark Rutland 2022-04-14 84 #else
365ef1c2e3f7749 Mark Rutland 2022-04-14 85 static inline bool on_sdei_normal_stack(unsigned long sp, unsigned long size,
365ef1c2e3f7749 Mark Rutland 2022-04-14 86 struct stack_info *info)
365ef1c2e3f7749 Mark Rutland 2022-04-14 87 {
365ef1c2e3f7749 Mark Rutland 2022-04-14 88 return false;
365ef1c2e3f7749 Mark Rutland 2022-04-14 89 }
365ef1c2e3f7749 Mark Rutland 2022-04-14 90
--
0-DAY CI Kernel Test Service
https://01.org/lkp
2 weeks, 6 days