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

Pointer 'hash' returned from call to function 'cfs_hash_getref' may be NULL and will be dereferenced.

Details

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

    Description

      lustre/obdclass/genops.c:944

      hash = cfs_hash_getref(exp->exp_obd->obd_gen_hash);
      cfs_hash_del(hash, &ted->ted_lcd->lcd_generation,
      	     &exp->exp_gen_hash);
      cfs_hash_putref(hash);
      
      struct cfs_hash *cfs_hash_getref(struct cfs_hash *hs)
      {
      	if (atomic_inc_not_zero(&hs->hs_refcount))
      		return hs;
      	return NULL;
      }
      

      Attachments

        Issue Links

          Activity

            [LU-7077] Pointer 'hash' returned from call to function 'cfs_hash_getref' may be NULL and will be dereferenced.

            Landed for 2.8

            jgmitter Joseph Gmitter (Inactive) added a comment - Landed for 2.8

            Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/16473/
            Subject: LU-7077 target: avoid using possible error return NULL pointer
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: a7eface85ea2d2aa6198681264b082a0244855d4

            gerrit Gerrit Updater added a comment - Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/16473/ Subject: LU-7077 target: avoid using possible error return NULL pointer Project: fs/lustre-release Branch: master Current Patch Set: Commit: a7eface85ea2d2aa6198681264b082a0244855d4

            This issue was found by static analysis checker. So, we didn't get a real crash because of it. The question is can we gracefully handle errors or not.

            dmiter Dmitry Eremin (Inactive) added a comment - This issue was found by static analysis checker. So, we didn't get a real crash because of it. The question is can we gracefully handle errors or not.
            di.wang Di Wang added a comment -

            Dmitry, could you please comment on http://review.whamcloud.com/#/c/16473/1 ? thanks

            di.wang Di Wang added a comment - Dmitry, could you please comment on http://review.whamcloud.com/#/c/16473/1 ? thanks

            Bob Glossman (bob.glossman@intel.com) uploaded a new patch: http://review.whamcloud.com/16473
            Subject: LU-7077 target: avoid using possible error return NULL pointer
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: fa02a91e622631096b83021d31b0aa6781950662

            gerrit Gerrit Updater added a comment - Bob Glossman (bob.glossman@intel.com) uploaded a new patch: http://review.whamcloud.com/16473 Subject: LU-7077 target: avoid using possible error return NULL pointer Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: fa02a91e622631096b83021d31b0aa6781950662
            dmiter Dmitry Eremin (Inactive) added a comment - This was introduced in http://review.whamcloud.com/15576

            People

              bogl Bob Glossman (Inactive)
              dmiter Dmitry Eremin (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: