[LU-5383] New static analysis issues in mount_lustre Created: 23/May/14  Updated: 30/Aug/23  Resolved: 05/Nov/14

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.7.0

Type: Bug Priority: Minor
Reporter: Dmitry Eremin (Inactive) Assignee: Dmitry Eremin (Inactive)
Resolution: Fixed Votes: 0
Labels: kw

Issue Links:
Related
is related to LU-4629 Issues found by static analysis tools Resolved
Severity: 3
Rank (Obsolete): 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


 Comments   
Comment by Dmitry Eremin (Inactive) [ 31/Oct/14 ]

Patch is http://review.whamcloud.com/12524/

Comment by Dmitry Eremin (Inactive) [ 05/Nov/14 ]

Patch landed to master.

Comment by Patrick Farrell (Inactive) [ 05/Nov/14 ]

The patch http://review.whamcloud.com/#/c/12524/2 breaks mounts of MGS/MGT volumes with short names (which is valid for an MGS/MDT, since they do not have to include an index or the file system name).

[root@centss02 ~]# mount -t lustre -o abort_recov /dev/sdb /tmp/lustre/centss02/mgt
mount.lustre: invalid name 'MGS'

Since the entire purpose of that code is to fix up OST & MDT names to indicate their status, presumably the solution is to simply not call this check on the MGS/MGT volume.

I'll open a new LU for this.

Generated at Sat Feb 10 01:51:01 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.