[LU-5589] NULL pointer dereferenced without check in lsi_prepare() Created: 05/Sep/14  Updated: 05/Nov/14  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

Severity: 3
Rank (Obsolete): 15591

 Description   

Pointer 'lsi->lsi_lmd->lmd_osd_type' checked for NULL at line 1390 will be dereferenced at line 1402.

	/* Determine osd type */
	if (lsi->lsi_lmd->lmd_osd_type != NULL) {
		if (strlen(lsi->lsi_lmd->lmd_osd_type) >=
		    sizeof(lsi->lsi_osd_type))
			RETURN(-ENAMETOOLONG);

		strcpy(lsi->lsi_osd_type, lsi->lsi_lmd->lmd_osd_type);
	} else {
		strcpy(lsi->lsi_osd_type, LUSTRE_OSD_LDISKFS_NAME);
	}

	/* XXX: a temp. solution for components using ldiskfs
	 *      to be removed in one of the subsequent patches */
	if (!strcmp(lsi->lsi_lmd->lmd_osd_type, "osd-ldiskfs"))
		strcpy(lsi->lsi_fstype, "ldiskfs");
	else
		strcpy(lsi->lsi_fstype, lsi->lsi_lmd->lmd_osd_type);


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

patch is http://review.whamcloud.com/11769/

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

Patch landed to master.

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