Skip to content

Commit fb27e70

Browse files
bwhacksmasahir0y
authored andcommitted
modpost: Fix processing of CRCs on 32-bit build machines
modpost now reads CRCs from .*.cmd files, parsing them using strtol(). This is inconsistent with its parsing of Module.symvers and with their definition as *unsigned* 32-bit values. strtol() clamps values to [LONG_MIN, LONG_MAX], and when building on a 32-bit system this changes all CRCs >= 0x80000000 to be 0x7fffffff. Change extract_crcs_for_object() to use strtoul() instead. Cc: stable@vger.kernel.org Fixes: f292d87 ("modpost: extract symbol versions from *.cmd files") Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
1 parent 1073c15 commit fb27e70

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/mod/modpost.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1733,7 +1733,7 @@ static void extract_crcs_for_object(const char *object, struct module *mod)
17331733
if (!isdigit(*p))
17341734
continue; /* skip this line */
17351735

1736-
crc = strtol(p, &p, 0);
1736+
crc = strtoul(p, &p, 0);
17371737
if (*p != '\n')
17381738
continue; /* skip this line */
17391739

0 commit comments

Comments
 (0)