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

lgss_sk may unsafely overwrite nodemap and fsname fields in keys

Details

    • Bug
    • Resolution: Fixed
    • Trivial
    • Lustre 2.10.0
    • Lustre 2.9.0
    • None
    • 4
    • 9223372036854775807

    Description

      lgss_sk.c uses strncpy() to modify names of strings for both fsname and nodemap fields. If the replacement string is smaller than the original string, it will not be zero terminated properly. For example, replacing a nodemap name of "default" with "c0" with the lgss_sk utility can result in invalid names such as:

      Nodemap name: c0fault

      I will submit a small patch to switch this to snprintf(), although being a little more verbose, will be safe to use on a parameter of variable length.

      Attachments

        Issue Links

          Activity

            [LU-9245] lgss_sk may unsafely overwrite nodemap and fsname fields in keys

            Sure! It's a tiny patch, I only noticed the reversion because of a test failure.

            hannac Chris Hanna (Inactive) added a comment - Sure! It's a tiny patch, I only noticed the reversion because of a test failure.

            We could roll it into the LU-8602 patch. Does that sound reasonable?

            simmonsja James A Simmons added a comment - We could roll it into the LU-8602 patch. Does that sound reasonable?

            There's been a reversion here, this patch needs to be applied again to the 2.10 code.

            Do I need to submit the same patch again?

            hannac Chris Hanna (Inactive) added a comment - There's been a reversion here, this patch needs to be applied again to the 2.10 code. Do I need to submit the same patch again?
            pjones Peter Jones added a comment -

            Landed for 2.10

            pjones Peter Jones added a comment - Landed for 2.10

            Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/26165/
            Subject: LU-9245 utils: fix string copy handling within lgss_sk
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 460ad9d609768e6d8182a2dfd1f24d5fcb0b3560

            gerrit Gerrit Updater added a comment - Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/26165/ Subject: LU-9245 utils: fix string copy handling within lgss_sk Project: fs/lustre-release Branch: master Current Patch Set: Commit: 460ad9d609768e6d8182a2dfd1f24d5fcb0b3560

            Chris Hanna (hannac@iu.edu) uploaded a new patch: https://review.whamcloud.com/26165
            Subject: LU-9245 utils: fix string copy handling within lgss_sk
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 1cc5b70066e3b9ea646d3afd9403558f96730fe0

            gerrit Gerrit Updater added a comment - Chris Hanna (hannac@iu.edu) uploaded a new patch: https://review.whamcloud.com/26165 Subject: LU-9245 utils: fix string copy handling within lgss_sk Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 1cc5b70066e3b9ea646d3afd9403558f96730fe0

            People

              hannac Chris Hanna (Inactive)
              hannac Chris Hanna (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: