[CRIU] Fwd: New Defects reported by Coverity Scan for avagin/criu

Andrei Vagin avagin at gmail.com
Thu May 23 20:19:34 MSK 2019


---------- Forwarded message ---------
From: <scan-admin at coverity.com>
Date: Thu, May 23, 2019 at 10:17 AM
Subject: New Defects reported by Coverity Scan for avagin/criu
To: <avagin at gmail.com>


Hi,

Please find the latest report on new defect(s) introduced to
avagin/criu found with Coverity Scan.

3 new defect(s) introduced to avagin/criu found with Coverity Scan.
8 defect(s), reported by Coverity Scan earlier, were marked fixed in
the recent build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 3 of 3 defect(s)


** CID 211851:  Resource leaks  (RESOURCE_LEAK)
/criu/img-cache.c: 33 in image_cache()


________________________________________________________________________________________________________
*** CID 211851:  Resource leaks  (RESOURCE_LEAK)
/criu/img-cache.c: 33 in image_cache()
27              if (tmp < 0) {
28                      pr_perror("Unable to accept remote image connection"
29                                " from image proxy");
30                      close(remote_sk);
31                      return -1;
32              }
>>>     CID 211851:  Resource leaks  (RESOURCE_LEAK)
>>>     Overwriting handle "remote_sk" in "remote_sk = tmp" leaks the handle.
33              remote_sk = tmp;
34      }
35
36      pr_info("Cache is connected to Proxy through fd %d\n", remote_sk);
37
38      local_sk = setup_UNIX_server_socket(local_cache_path);

** CID 211850:  Error handling issues  (CHECKED_RETURN)
/criu/mount.c: 1199 in set_is_overmounted()


________________________________________________________________________________________________________
*** CID 211850:  Error handling issues  (CHECKED_RETURN)
/criu/mount.c: 1199 in set_is_overmounted()
1193     exit:
1194            return mi->is_overmounted;
1195     }
1196
1197     static int set_is_overmounted(struct mount_info *mi)
1198     {
>>>     CID 211850:  Error handling issues  (CHECKED_RETURN)
>>>     Calling "mnt_is_overmounted" without checking return value (as is done elsewhere 4 out of 5 times).
1199            mnt_is_overmounted(mi);
1200            return 0;
1201     }
1202
1203     /*
1204      * __umount_children_overmounts() assumes that the mountpoint and

** CID 73350:    (TAINTED_STRING)
/criu/crtools.c: 215 in main()
/criu/crtools.c: 215 in main()


________________________________________________________________________________________________________
*** CID 73350:    (TAINTED_STRING)
/criu/crtools.c: 215 in main()
209                     if (opts.tree_id)
210                             pr_warn("Using -t with criu restore is
obsoleted\n");
211
212                     ret = cr_restore_tasks();
213                     if (ret == 0 && opts.exec_cmd) {
214                             close_pid_proc();
>>>     CID 73350:    (TAINTED_STRING)
>>>     Passing tainted string "*opts.exec_cmd" to "execvp", which cannot accept tainted data.
215                             execvp(opts.exec_cmd[0], opts.exec_cmd);
216                             pr_perror("Failed to exec command %s",
opts.exec_cmd[0]);
217                             ret = 1;
218                     }
219
220                     return ret != 0;
/criu/crtools.c: 215 in main()
209                     if (opts.tree_id)
210                             pr_warn("Using -t with criu restore is
obsoleted\n");
211
212                     ret = cr_restore_tasks();
213                     if (ret == 0 && opts.exec_cmd) {
214                             close_pid_proc();
>>>     CID 73350:    (TAINTED_STRING)
>>>     Passing tainted string "opts.exec_cmd[0]" to "execvp", which cannot accept tainted data.
215                             execvp(opts.exec_cmd[0], opts.exec_cmd);
216                             pr_perror("Failed to exec command %s",
opts.exec_cmd[0]);
217                             ret = 1;
218                     }
219
220                     return ret != 0;


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit,
https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRadE4HtGX0xZfM5m05cAqwSn9QqlIeVw-2FkcLgYpA0lPa2hX7Svir7fT2yO4VLkpytk-3D_7XGyd8wnBKQKOUX2qhR2S3Y7QuldqTTvWwLYtKkICxWUeovjAcUcz-2BHpTu4vnOhEfyk0X78PqtBp8u5Uhtegz-2BEfJ710NMH1CpjDQ0k4GgqUOxkyXA9z1X4g9E9LHC-2BwctshoLuunrIa4o0RO8KcJjByvKrX5yA5AWYbRNiN4jNoNeJOPE98C-2BLmQHu1-2BSU2O77kZdffjCDjlcA1oiCgKA-3D-3D

  To manage Coverity Scan email notifications for "avagin at gmail.com",
click https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRbVDbis712qZDP-2FA8y06Nq44kXajrJ468k-2Fv66mxYCIPsDiUCv-2B4KWm4khKJsFIPV5Ax9D4yYQUTik4CXrp0zKb-2B58ffTkdow6VNvG3RJ5t0IJhydhdanHQunZ4OKjSbeQ-3D_7XGyd8wnBKQKOUX2qhR2S3Y7QuldqTTvWwLYtKkICxWUeovjAcUcz-2BHpTu4vnOhEm2IUHEvK-2Fsob9hW4k8adhRPlSlRdbioE6pJHjPIV-2B05MO1S2y-2FWzWZDm3j6Oui3f33b9bLOc56djtf9hP8UCpQJpYyxh1HnZ-2B9RP0l7Twzd3O2Pfx0t-2F-2BK8jo5RJU24d-2BvoPxUvZbiMOfP43rQIzkQ-3D-3D



More information about the CRIU mailing list