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

potential null pointer dereference in class_newdev

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.11.0
    • None
    • 3
    • 9223372036854775807

    Description

      smatch highlighted this in class_newdev:

              if (result == NULL && i >= class_devno_max()) {
                      CERROR("all %u OBD devices used, increase MAX_OBD_DEVICES\n",
                             class_devno_max());
                      GOTO(out, result = ERR_PTR(-EOVERFLOW));
              }
      
              if (IS_ERR(result))
                      GOTO(out, result);
      
              CDEBUG(D_IOCTL, "Adding new device %s (%p)\n",
                     result->obd_name, result);
      

      So this totally seems to assume that if result == NULL, but we did not go beyond the obd device limit, we are ok to print this NULL pointer?

      I suspect we should chance the IS_ERRO to either result == NULL || IS_ERR?

      Attachments

        Issue Links

          Activity

            People

              wc-triage WC Triage
              green Oleg Drokin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: