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

New static analysis issues in mount_lustre

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.7.0
    • None
    • 3
    • 14067

    Description

      Found 1 new static analysis issues in 2.5.59-27-g75752e9:

      1. Buffer Overflow - Array Index Out of Bounds
        • lustre/utils/mount_lustre.c: in parse_ldd, Array 'ldd_svname' of size 64 may use index value(s) -8..-1. Also there are 3 similar errors on line(s) 424, 426, 427.

      Details:

      mount_lustre.c:422: rc = strlen(ldd->ldd_svname)
      mount_lustre.c:422: Possible value(s) of 'strlen(ldd->ldd_svname)' is '[0,63]'
      mount_lustre.c:423: rc-8
      mount_lustre.c:423: Inferred value 'rc' is '[0,63]'
      mount_lustre.c:423: Result of expression 'rc - 8' is '[-8,55]'
      mount_lustre.c:423: Array 'ldd_svname' size is 64.
      mount_lustre.c:423: Possible attempt to access element -8..-1 of array 'ldd_svname'.
      

      The list of commits since the previous build 2.5.59-0-g28f2ff9:

      75752e9 LU-3319 procfs: Move NRS TBF proc handling to seq_files
      ea766f3 LU-3319 procfs: move osp proc handling to seq_files
      cae32fb LU-4913 mgc: mgc import reconnect race
      7936ec2 LU-4843 mdt: disallow old clients access striped dir
      a731963 Revert "LU-4933 osc: Automatically tune the max_dirty_mb"
      29bd1e0 LU-4925 lmv: validate lock with correct stripe FID
      0d8c5cc LU-4603 lmv: a few fixes about readdir of striped dir.
      b48b921 LU-4991 test: check files in sanity 56s
      3e8c354 LU-4606 utils: Mount uses so for backing fstype
      cbade14 LU-5065 utils: uninclude lustre_idl.h from lfs
      d6f2634 LU-4993 llite: Support 3.14 kernel changes to bio api
      482b5e7 LU-5034 llite: Change readdir BRW metrics
      c2c28f2 LU-3963 libcfs: move mgs, osd-ldiskfs, osp, quota to linux list api
      64b1cfc LU-4974 lod: add prefix to struct lod_pool_iterator
      6a2a173 LU-4961 build: remove libsysio and liblustre autoconf tests
      8dfee22 LU-4569 hsm: Prevent copytool from importing existing file.
      c0a8fa3 LU-2675 fid: remove liblustre includes
      8fd6a08 LU-3953 build: look for kconfig.h in $LINUX
      5303c13 LU-4933 osc: Automatically tune the max_dirty_mb
      85b037f LU-4904 test: write_append_truncate failed with divide error
      90636ff LU-3319 procfs: move mdt/mds proc handling to seq_files
      8d3c731 LU-3319 procfs: move lod proc handling to seq_files
      1b6d4ae LU-1330 obdclass: splits server-side procfs handling
      864fc9d LU-2059 mgs: don't fail on missing params log
      c6a034b LU-4883 lmv: disable sub-stripe access from .lustre/fid
      be1374e LU-4981 test: Fix IO redirect in sanity 133g
      241cdb8 LU-5018 libcfs: don't depend on configure for lustre_user.h

      Attachments

        Issue Links

          Activity

            [LU-5383] New static analysis issues in mount_lustre
            adilger Andreas Dilger made changes -
            Link New: This issue is related to LU-4629 [ LU-4629 ]
            dmiter Dmitry Eremin (Inactive) made changes -
            Fix Version/s New: Lustre 2.7.0 [ 10631 ]
            Resolution New: Fixed [ 1 ]
            Status Original: In Progress [ 3 ] New: Resolved [ 5 ]
            dmiter Dmitry Eremin (Inactive) made changes -
            Summary Original: New static analysis issues in 2.5.59-27-g75752e9 New: New static analysis issues in mount_lustre
            dmiter Dmitry Eremin (Inactive) made changes -
            Status Original: Open [ 1 ] New: In Progress [ 3 ]
            dmiter Dmitry Eremin (Inactive) made changes -
            Key Original: INTL-91 New: LU-5383
            Project Original: Intel Internal [ 10117 ] New: Lustre [ 10000 ]
            Workflow Original: classic default workflow [ 30974 ] New: Sub-task Blocking [ 31848 ]
            dmiter Dmitry Eremin (Inactive) made changes -
            Assignee Original: WC Triage [ wc-triage ] New: Dmitry Eremin [ dmiter ]
            dmiter Dmitry Eremin (Inactive) made changes -
            Description Original: Found 1 new static analysis issues in 2.5.59-27-g75752e9:
            # *Buffer Overflow \- Array Index Out of Bounds*
            #* {{lustre/utils/mount_lustre.c}}: in _parse_ldd_, Array 'ldd\_svname' of size 64 may use index value(s) \-8..\-1. Also there are 3 similar errors on line(s) 424, 426, 427.

            The list of commits since the previous build 2.5.59-0-g28f2ff9:
            |[75752e9|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=75752e918b942000e24c979edcb3eed415dc5197]|LU-3319 procfs: Move NRS TBF proc handling to seq_files|
            |[ea766f3|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=ea766f3be969997ce9e92cf9b359fc818583851a]|LU-3319 procfs: move osp proc handling to seq_files|
            |[cae32fb|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=cae32fb38f0754ab2f8eae89ffe9151c6c194ef8]|LU-4913 mgc: mgc import reconnect race|
            |[7936ec2|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=7936ec229c7f62cfbf5a0e4ff5933149967e7c8f]|LU-4843 mdt: disallow old clients access striped dir|
            |[a731963|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=a7319633ddc7400435a9492774c229dabd3d784d]|Revert "LU-4933 osc: Automatically tune the max_dirty_mb"|
            |[29bd1e0|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=29bd1e0228c0dee31bf876548c7621b51d8a09af]|LU-4925 lmv: validate lock with correct stripe FID|
            |[0d8c5cc|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=0d8c5ccc4ecfe7c0d10a0a4f92fd291320a97190]|LU-4603 lmv: a few fixes about readdir of striped dir.|
            |[b48b921|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=b48b921a5f36771bacdb0094d7ec4fe94cdf0c48]|LU-4991 test: check files in sanity 56s|
            |[3e8c354|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=3e8c354c09725a97b90e477a77411cc6fb306f09]|LU-4606 utils: Mount uses so for backing fstype|
            |[cbade14|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=cbade14c3f853c4f61f7878c34af6c2cf0baafc8]|LU-5065 utils: uninclude lustre_idl.h from lfs|
            |[d6f2634|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=d6f26343824941793010785fd35a74924ad84225]|LU-4993 llite: Support 3.14 kernel changes to bio api|
            |[482b5e7|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=482b5e7f76b3fdb48c987de2f221bdcae8b4f5e2]|LU-5034 llite: Change readdir BRW metrics|
            |[c2c28f2|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=c2c28f2aa5d65d889bf5d1a707fec82e8f852c86]|LU-3963 libcfs: move mgs, osd-ldiskfs, osp, quota to linux list api|
            |[64b1cfc|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=64b1cfcacd15b05acd157c24ec626c361fc5e5d9]|LU-4974 lod: add prefix to struct lod_pool_iterator|
            |[6a2a173|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=6a2a17345af332af31d31c6c7b9ec369b17729e4]|LU-4961 build: remove libsysio and liblustre autoconf tests|
            |[8dfee22|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=8dfee22dd5a896144fb913f5f9f0e8f5c0e4ed86]|LU-4569 hsm: Prevent copytool from importing existing file.|
            |[c0a8fa3|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=c0a8fa3749834fa1e6f148ffec8b58ea578c1af4]|LU-2675 fid: remove liblustre includes|
            |[8fd6a08|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=8fd6a0829e326935f2b20b150844d8ab07d20e05]|LU-3953 build: look for kconfig.h in $LINUX|
            |[5303c13|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=5303c139e3cef8ed09b85cf828afbbe24ea0d7db]|LU-4933 osc: Automatically tune the max_dirty_mb|
            |[85b037f|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=85b037f5da6a022919783ef9a87ed6d2a4d102d2]|LU-4904 test: write_append_truncate failed with divide error|
            |[90636ff|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=90636ff53d8d2d714a7591c4bb9a75a7c69f997f]|LU-3319 procfs: move mdt/mds proc handling to seq_files|
            |[8d3c731|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=8d3c7316fc94297e1d92f4ec31cf941a389f6f82]|LU-3319 procfs: move lod proc handling to seq_files|
            |[1b6d4ae|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=1b6d4ae18692ab4e8cb7330d8af4f905ab8213fb]|LU-1330 obdclass: splits server-side procfs handling|
            |[864fc9d|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=864fc9daac267819f5e3bdebef6cdac4c6325626]|LU-2059 mgs: don't fail on missing params log|
            |[c6a034b|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=c6a034b746bffc5a11f0c9ec4848d54dea90ca23]|LU-4883 lmv: disable sub-stripe access from .lustre/fid|
            |[be1374e|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=be1374ee9bc1dac6706e8dadb5389167cf8c4b1d]|LU-4981 test: Fix IO redirect in sanity 133g|
            |[241cdb8|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=241cdb8ba008d47fd96f0b6529797ce922e2b635]|LU-5018 libcfs: don't depend on configure for lustre_user.h|
            New: Found 1 new static analysis issues in 2.5.59-27-g75752e9:
            # *Buffer Overflow \- Array Index Out of Bounds*
            #* {{lustre/utils/mount_lustre.c}}: in _parse_ldd_, Array 'ldd\_svname' of size 64 may use index value(s) \-8..\-1. Also there are 3 similar errors on line(s) 424, 426, 427.

            Details:
            {code}
            mount_lustre.c:422: rc = strlen(ldd->ldd_svname)
            mount_lustre.c:422: Possible value(s) of 'strlen(ldd->ldd_svname)' is '[0,63]'
            mount_lustre.c:423: rc-8
            mount_lustre.c:423: Inferred value 'rc' is '[0,63]'
            mount_lustre.c:423: Result of expression 'rc - 8' is '[-8,55]'
            mount_lustre.c:423: Array 'ldd_svname' size is 64.
            mount_lustre.c:423: Possible attempt to access element -8..-1 of array 'ldd_svname'.
            {code}


            The list of commits since the previous build 2.5.59-0-g28f2ff9:
            |[75752e9|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=75752e918b942000e24c979edcb3eed415dc5197]|LU-3319 procfs: Move NRS TBF proc handling to seq_files|
            |[ea766f3|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=ea766f3be969997ce9e92cf9b359fc818583851a]|LU-3319 procfs: move osp proc handling to seq_files|
            |[cae32fb|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=cae32fb38f0754ab2f8eae89ffe9151c6c194ef8]|LU-4913 mgc: mgc import reconnect race|
            |[7936ec2|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=7936ec229c7f62cfbf5a0e4ff5933149967e7c8f]|LU-4843 mdt: disallow old clients access striped dir|
            |[a731963|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=a7319633ddc7400435a9492774c229dabd3d784d]|Revert "LU-4933 osc: Automatically tune the max_dirty_mb"|
            |[29bd1e0|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=29bd1e0228c0dee31bf876548c7621b51d8a09af]|LU-4925 lmv: validate lock with correct stripe FID|
            |[0d8c5cc|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=0d8c5ccc4ecfe7c0d10a0a4f92fd291320a97190]|LU-4603 lmv: a few fixes about readdir of striped dir.|
            |[b48b921|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=b48b921a5f36771bacdb0094d7ec4fe94cdf0c48]|LU-4991 test: check files in sanity 56s|
            |[3e8c354|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=3e8c354c09725a97b90e477a77411cc6fb306f09]|LU-4606 utils: Mount uses so for backing fstype|
            |[cbade14|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=cbade14c3f853c4f61f7878c34af6c2cf0baafc8]|LU-5065 utils: uninclude lustre_idl.h from lfs|
            |[d6f2634|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=d6f26343824941793010785fd35a74924ad84225]|LU-4993 llite: Support 3.14 kernel changes to bio api|
            |[482b5e7|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=482b5e7f76b3fdb48c987de2f221bdcae8b4f5e2]|LU-5034 llite: Change readdir BRW metrics|
            |[c2c28f2|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=c2c28f2aa5d65d889bf5d1a707fec82e8f852c86]|LU-3963 libcfs: move mgs, osd-ldiskfs, osp, quota to linux list api|
            |[64b1cfc|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=64b1cfcacd15b05acd157c24ec626c361fc5e5d9]|LU-4974 lod: add prefix to struct lod_pool_iterator|
            |[6a2a173|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=6a2a17345af332af31d31c6c7b9ec369b17729e4]|LU-4961 build: remove libsysio and liblustre autoconf tests|
            |[8dfee22|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=8dfee22dd5a896144fb913f5f9f0e8f5c0e4ed86]|LU-4569 hsm: Prevent copytool from importing existing file.|
            |[c0a8fa3|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=c0a8fa3749834fa1e6f148ffec8b58ea578c1af4]|LU-2675 fid: remove liblustre includes|
            |[8fd6a08|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=8fd6a0829e326935f2b20b150844d8ab07d20e05]|LU-3953 build: look for kconfig.h in $LINUX|
            |[5303c13|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=5303c139e3cef8ed09b85cf828afbbe24ea0d7db]|LU-4933 osc: Automatically tune the max_dirty_mb|
            |[85b037f|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=85b037f5da6a022919783ef9a87ed6d2a4d102d2]|LU-4904 test: write_append_truncate failed with divide error|
            |[90636ff|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=90636ff53d8d2d714a7591c4bb9a75a7c69f997f]|LU-3319 procfs: move mdt/mds proc handling to seq_files|
            |[8d3c731|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=8d3c7316fc94297e1d92f4ec31cf941a389f6f82]|LU-3319 procfs: move lod proc handling to seq_files|
            |[1b6d4ae|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=1b6d4ae18692ab4e8cb7330d8af4f905ab8213fb]|LU-1330 obdclass: splits server-side procfs handling|
            |[864fc9d|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=864fc9daac267819f5e3bdebef6cdac4c6325626]|LU-2059 mgs: don't fail on missing params log|
            |[c6a034b|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=c6a034b746bffc5a11f0c9ec4848d54dea90ca23]|LU-4883 lmv: disable sub-stripe access from .lustre/fid|
            |[be1374e|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=be1374ee9bc1dac6706e8dadb5389167cf8c4b1d]|LU-4981 test: Fix IO redirect in sanity 133g|
            |[241cdb8|http://git.whamcloud.com/?p=fs/lustre-release.git;a=commit;h=241cdb8ba008d47fd96f0b6529797ce922e2b635]|LU-5018 libcfs: don't depend on configure for lustre_user.h|
            dmiter Dmitry Eremin (Inactive) created issue -

            People

              dmiter Dmitry Eremin (Inactive)
              dmiter Dmitry Eremin (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: