Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-6502

Strange check for NULL in LNetCtl

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • Lustre 2.8.0
    • None
    • None
    • 3
    • 9223372036854775807

      smatch highlights this interesting bit of code in LNetCtl:

                      config = arg;
      
                      if (config->cfg_hdr.ioc_len < total)
                              return -EINVAL;
      
                      net_config = (struct lnet_ioctl_net_config *)
                              config->cfg_bulk;
                      if (config == NULL || net_config == NULL)
                              return -1;
      

      notic how we assume config can be NULL way after we defererenced it multiple times. should we move the check?

            ashehata Amir Shehata (Inactive)
            green Oleg Drokin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: