]> Git Repo - linux.git/commitdiff
modpost: Fix processing of CRCs on 32-bit build machines
authorBen Hutchings <[email protected]>
Wed, 22 Mar 2023 18:11:45 +0000 (19:11 +0100)
committerMasahiro Yamada <[email protected]>
Thu, 23 Mar 2023 06:28:41 +0000 (15:28 +0900)
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: [email protected]
Fixes: f292d875d0dc ("modpost: extract symbol versions from *.cmd files")
Signed-off-by: Ben Hutchings <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
scripts/mod/modpost.c

index efff8078e39581349f72fd8fbe6e2c062e36d372..9466b6a2abae46c41ec1d4d4e06eb9001dc79608 100644 (file)
@@ -1733,7 +1733,7 @@ static void extract_crcs_for_object(const char *object, struct module *mod)
                if (!isdigit(*p))
                        continue;       /* skip this line */
 
-               crc = strtol(p, &p, 0);
+               crc = strtoul(p, &p, 0);
                if (*p != '\n')
                        continue;       /* skip this line */
 
This page took 0.061376 seconds and 4 git commands to generate.