mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-07-05 13:25:20 +02:00
modpost: srcversion sometimes incorrect
"srcversion" field inserted into module modinfo section contains a sum of the source files which made it. However, this field can be incorrect. Building the same module can end up having inconsistent srcversion field eventhough the sources remain the same. This can be reproduced by building modules in a deeply nested directory, but other factors contribute as well. The reason for incorrect srcversion is that some source files can be simply silently skipped from the checksum calculation due to limited buffer space for line parsing. This patch addresses two issues: 1. Allocates a larger line buffer (32k vs 4k). 2. Issues a warning if a line length exceeds the line buffer. Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
This commit is contained in:
parent
d808ffdd15
commit
29bf00f6fb
|
@ -382,9 +382,10 @@ failed:
|
|||
* spaces in the beginning of the line is trimmed away.
|
||||
* Return a pointer to a static buffer.
|
||||
**/
|
||||
#define MODPOST_MAX_LINE 32768
|
||||
char *get_next_line(unsigned long *pos, void *file, unsigned long size)
|
||||
{
|
||||
static char line[4096];
|
||||
static char line[MODPOST_MAX_LINE];
|
||||
int skip = 1;
|
||||
size_t len = 0;
|
||||
signed char *p = (signed char *)file + *pos;
|
||||
|
@ -399,8 +400,11 @@ char *get_next_line(unsigned long *pos, void *file, unsigned long size)
|
|||
if (*p != '\n' && (*pos < size)) {
|
||||
len++;
|
||||
*s++ = *p++;
|
||||
if (len > 4095)
|
||||
if (len > (sizeof(line)-1)) {
|
||||
warn(" %s: line exceeds buffer size %zu bytes\n"
|
||||
, __func__, sizeof(line));
|
||||
break; /* Too long, stop */
|
||||
}
|
||||
} else {
|
||||
/* End of string */
|
||||
*s = '\0';
|
||||
|
|
Loading…
Reference in New Issue
Block a user