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

Unsaf use of import connection at lprocfs_import_seq_show

Details

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

    Description

      smatch highlighted this bit of code in lprocfs_import_seq_show that does look a bit strange:

              libcfs_nid2str_r(imp->imp_connection->c_peer.nid,
                               nidstr, sizeof(nidstr));
              seq_printf(m, " ]\n"
                            "       current_connection: %s\n"
                            "       connection_attempts: %u\n"
                            "       generation: %u\n"
                            "       in-progress_invalidations: %u\n",
                            imp->imp_connection == NULL ? "<none>" : nidstr,
      

      So if imp->imp_connection really could be NULL, we better check for it before dereferencing it in taht call to libcfs_nid2str_r.

      This was introduced as part of LU-6070 patch hash 907a321c9b9e2cd5f5ccf488cc516ba05dee0ad8 by Dmitry.

      Attachments

        Issue Links

          Activity

            [LU-6507] Unsaf use of import connection at lprocfs_import_seq_show
            pjones Peter Jones added a comment -

            Landed for 2.8

            pjones Peter Jones added a comment - Landed for 2.8

            Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/14808/
            Subject: LU-6507 obdclass: Fix possible NULL pointer dereference
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: d47f00d5a420b594b49564b2e00efca4602c3fb5

            gerrit Gerrit Updater added a comment - Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/14808/ Subject: LU-6507 obdclass: Fix possible NULL pointer dereference Project: fs/lustre-release Branch: master Current Patch Set: Commit: d47f00d5a420b594b49564b2e00efca4602c3fb5

            Dmitry Eremin (dmitry.eremin@intel.com) uploaded a new patch: http://review.whamcloud.com/14808
            Subject: LU-6507 obdclass: Fix possible NULL pointer dereference
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: bff41e687f7329f6e95a67bebf3f879e87d1e3d5

            gerrit Gerrit Updater added a comment - Dmitry Eremin (dmitry.eremin@intel.com) uploaded a new patch: http://review.whamcloud.com/14808 Subject: LU-6507 obdclass: Fix possible NULL pointer dereference Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: bff41e687f7329f6e95a67bebf3f879e87d1e3d5

            People

              dmiter Dmitry Eremin (Inactive)
              green Oleg Drokin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: