Bug 200319 - Missing error check for function strdup in linux/scripts/mod/modpost.c
Summary: Missing error check for function strdup in linux/scripts/mod/modpost.c
Status: RESOLVED CODE_FIX
Alias: None
Product: Other
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: other_other
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-28 03:02 UTC by Yuexing Wang
Modified: 2018-10-01 09:36 UTC (History)
0 users

See Also:
Kernel Version: 4.17.3
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Yuexing Wang 2018-06-28 03:02:56 UTC
In function handle_modversions ,

680-683,
	char *munged = strdup(symname);
	munged[0] = '_';
	munged[1] = toupper(munged[1]);
	symname = munged;
Function strdup will return a NULL pointer if an error occurs. Thus the return value of strdup should be checked. Otherwise the dereference of munged may be a Null Pointer Deref.

Note You need to log in before you can comment on or make changes to this bug.