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

Potential null pointer deref in mdt_stack_init and mdt_quota_init

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • Lustre 2.15.0
    • 3
    • 9223372036854775807

    Description

      smatch highlighted problematic code in mdt_stack_init and mdt_quota_init

              lcfg = lustre_cfg_new(LCFG_SETUP, bufs);
              if (lcfg == NULL)
                      GOTO(class_detach, rc = -ENOMEM);
      ...
      class_detach:
              if (rc)
                      class_detach(obd, lcfg);
      lcfg_cleanup:
              lustre_cfg_free(lcfg);
      

      note that while lustre_cfs_Free is basically kfree, which is ok to work with NULL pointers, in reality it does

      static inline void lustre_cfg_free(struct lustre_cfg *lcfg)
      {
      #ifdef __KERNEL__
              OBD_FREE(lcfg, lustre_cfg_len(lcfg->lcfg_bufcount, lcfg->lcfg_buflens));
      

      which makes it not ok.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated: