Re: [PATCH 00/12] open-iscsi: fix serverl issues reported by Coverity

2020-12-11 Thread Wenchao Hao

On 2020/12/12 0:32, Lee Duncan wrote:

I have reviewed a couple of these, but you need to submit them as pull
requests to github.com/open-iscsi/open-iscsi.

The "reviewed-by" tag I replied to a couple of them really isn't needed,
as I'm the one that will be merging them (or not) on github (sans Chris,
my co-maintainer, who sometimes does that).


I submitted a pull request to github already.

--
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-iscsi+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/open-iscsi/d7b61124-8f77-a82e-e18a-6eaa11e8980b%40huawei.com.


Re: [PATCH 00/12] open-iscsi: fix serverl issues reported by Coverity

2020-12-11 Thread 'Lee Duncan' via open-iscsi
I have reviewed a couple of these, but you need to submit them as pull
requests to github.com/open-iscsi/open-iscsi.

The "reviewed-by" tag I replied to a couple of them really isn't needed,
as I'm the one that will be merging them (or not) on github (sans Chris,
my co-maintainer, who sometimes does that).

On 12/6/20 5:53 PM, Wenchao Hao wrote:
> Recently, we use Coverity to analysis the open-iscsi package.
> Several issues should be resolved to make Coverity happy.
> 
> Wenchao Hao (12):
>   iscsi_sysfs: Fix NULL pointer deference in iscsi_sysfs_read_iface
>   iscsi-iname: Verify open() return value before calling read()
>   iscsiuio: Fix invalid parameter when call fstat()
>   open-iscsi: Fix invalid pointer deference in find_initiator()
>   open-iscsi: Fix NULL pointer dereference in mgmt_ipc_read_req()
>   iscsi_net_util: Fix NULL pointer dereference in find_vlan_dev()
>   open-iscsi: Clean user_param list when process exit
>   fwparam_ppc: Fix NULL pointer dereference in find_devtree()
>   sysfs: Verify parameter of sysfs_device_get()
>   fwparam_ppc: Fix illegal memory access in fwparam_ppc.c
>   iscsiuio: Remove unused macro IFNAMSIZ defined in iscsid_ipc.c
>   fwparam_ppc: Fix memory leak in fwparam_ppc.c
> 
>  iscsiuio/src/unix/iscsid_ipc.c   |  3 --
>  iscsiuio/src/unix/libs/bnx2x.c   |  7 
>  iscsiuio/src/unix/libs/qedi.c|  7 
>  usr/idbm.c   | 14 
>  usr/idbm.h   |  1 +
>  usr/iscsi_net_util.c |  6 
>  usr/iscsi_sysfs.c|  2 +-
>  usr/iscsiadm.c   |  4 +++
>  usr/iscsistart.c |  5 +++
>  usr/mgmt_ipc.c   |  5 ++-
>  usr/sysfs.c  |  6 ++--
>  utils/fwparam_ibft/fwparam_ppc.c | 57 +---
>  utils/iscsi-iname.c  |  6 ++--
>  13 files changed, 102 insertions(+), 21 deletions(-)
> 

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-iscsi+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/open-iscsi/8affd4aa-63af-f05d-2975-86da75f5ebc7%40suse.com.


Re: [PATCH 02/12] iscsi-iname: Verify open() return value before calling read()

2020-12-11 Thread 'Lee Duncan' via open-iscsi
On 12/6/20 5:54 PM, Wenchao Hao wrote:
> System call open() might return -1 if an error occurred which
> should be taken into consideration.
> 
> Signed-off-by: Wenchao Hao 
> Signed-off-by: Zhiqiang Liu 
> Signed-off-by: Wu Bo 
> ---
>  utils/iscsi-iname.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/utils/iscsi-iname.c b/utils/iscsi-iname.c
> index 0f587e1..834352e 100644
> --- a/utils/iscsi-iname.c
> +++ b/utils/iscsi-iname.c
> @@ -96,7 +96,8 @@ main(int argc, char *argv[])
>* uniqueness properties
>*/
>  
> - if ((fd = open(RANDOM_NUM_GENERATOR, O_RDONLY))) {
> + fd = open(RANDOM_NUM_GENERATOR, O_RDONLY);
> + if (fd != -1) {
>   e = read(fd, &entropy, 16);
>   if (e >= 1)
>   MD5Update(&context, (md5byte *)entropy, e);
> @@ -141,7 +142,8 @@ main(int argc, char *argv[])
>* good as any other).
>*/
>  
> - if ((fd = open(RANDOM_NUM_GENERATOR, O_RDONLY))) {
> + fd = open(RANDOM_NUM_GENERATOR, O_RDONLY);
> + if (fd != -1) {
>   if (read(fd, entropy, 1) == 1)
>   bytes = &digest[(entropy[0] % (sizeof(digest) - 6))];
>   close(fd);
> 


Reviewed-by: Lee Duncan 

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-iscsi+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/open-iscsi/a7599e2f-ba24-81ba-a76f-3704b94b094f%40suse.com.


Re: [PATCH 01/12] iscsi_sysfs: Fix NULL pointer deference in iscsi_sysfs_read_iface

2020-12-11 Thread 'Lee Duncan' via open-iscsi
On 12/6/20 5:53 PM, Wenchao Hao wrote:
> Check if t is valid before accessing it.
> 
> Signed-off-by: Wenchao Hao 
> Signed-off-by: Zhiqiang Liu 
> Signed-off-by: Wu Bo 
> ---
>  usr/iscsi_sysfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/usr/iscsi_sysfs.c b/usr/iscsi_sysfs.c
> index 540adfd..abefde2 100644
> --- a/usr/iscsi_sysfs.c
> +++ b/usr/iscsi_sysfs.c
> @@ -856,7 +856,7 @@ static int iscsi_sysfs_read_iface(struct iface_rec 
> *iface, int host_no,
>   }
>   }
>  
> - if (session && t->template->use_boot_info)
> + if (session && t && t->template->use_boot_info)
>   iscsi_sysfs_read_boot(iface, session);
>  
>   if (!iface_kern_id)
> 

Reviewed-by: Lee Duncan 

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-iscsi+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/open-iscsi/10d940f4-7526-275d-4f9f-4d05cfcdd0f1%40suse.com.