linux-next: build failure after merge of the tip tree
Subsystems (3)
Hi all,
After merging the tip tree, today's linux-next build (x86_64 allmodconfig) failed like this:
arch/x86/power/hibernate_64.c: In function 'hibernation_e820_save':arch/x86/power/hibernate_64.c:236:15: error: passing argument 1 of 'get_e820_md5' from incompatible pointer type [-Werror=incompatible-pointer-types]
get_e820_md5(&e820_saved, buf);
^
arch/x86/power/hibernate_64.c:203:12: note: expected 'struct e820map *' but argument is of type 'struct e820map **'
static int get_e820_md5(struct e820map *map, void *buf)
^
arch/x86/power/hibernate_64.c: In function 'hibernation_e820_mismatch':
arch/x86/power/hibernate_64.c:249:21: error: passing argument 1 of 'get_e820_md5' from incompatible pointer type [-Werror=incompatible-pointer-types]
ret = get_e820_md5(&e820_saved, result);
^
arch/x86/power/hibernate_64.c:203:12: note: expected 'struct e820map *' but argument is of type 'struct e820map **'
static int get_e820_md5(struct e820map *map, void *buf)
^Caused by commit
475339684ef1 ("x86/e820: Prepare e280 code for switch to dynamic storage")
interacting with commit
6f95ad2b6162 ("PM / hibernate: Verify e820 memory map by MD5 digest")
from the pm tree.
I have applied the following merge fix patch:
From: Stephen Rothwell <[email protected]>
Date: Thu, 29 Sep 2016 13:13:45 +1000
Subject: [PATCH] pm/hibernate: merge fix for type of e820_saved changing
--- arch/x86/power/hibernate_64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/power/hibernate_64.c +2 -2
@@ -233,7 +233,7 @@ static int get_e820_md5(struct e820map *map, void *buf)static void hibernation_e820_save (void *buf) { -get_e820_md5 (&e820_saved, buf); +get_e820_md5 (e820_saved, buf); }static bool hibernation_e820_mismatch (void *buf)
@@ -246,7 +246,7 @@ static bool hibernation_e820_mismatch(void *buf)if (!memcmp (result, buf,MD5_DIGEST_SIZE ))return false; - ret =get_e820_md5 (&e820_saved, result); + ret =get_e820_md5 (e820_saved, result);if (ret)return true;
Signature · 5 lines
2.8.1 -- Cheers, Stephen Rothwell
Quoted 56 lines · Stephen Rothwell
Hi all,
After merging the tip tree, today's linux-next build (
x86_64allmodconfig) failed like this:
arch/x86/power/hibernate_64.c: In function 'hibernation_e820_save':arch/x86/power/hibernate_64.c:236:15: error: passing argument 1 of 'get_e820_md5' from incompatible pointer type [-Werror=incompatible-pointer-types]get_e820_md5(&e820_saved, buf); ^ arch/x86/power/hibernate_64.c:203:12: note: expected 'struct e820map *' but argument is of type 'struct e820map **' static int get_e820_md5(struct e820map *map, void *buf) ^ arch/x86/power/hibernate_64.c: In function 'hibernation_e820_mismatch': arch/x86/power/hibernate_64.c:249:21: error: passing argument 1 of 'get_e820_md5' from incompatible pointer type [-Werror=incompatible-pointer-types] ret = get_e820_md5(&e820_saved, result); ^ arch/x86/power/hibernate_64.c:203:12: note: expected 'struct e820map *' but argument is of type 'struct e820map **' static int get_e820_md5(struct e820map *map, void *buf) ^Caused by commit
475339684ef1("x86/e820: Prepare e280 code for switch to dynamic storage")interacting with commit
6f95ad2b6162("PM / hibernate: Verify e820 memory map by MD5 digest")from the pm tree.
I have applied the following merge fix patch:
From: Stephen Rothwell <[email protected]>
Date: Thu, 29 Sep 2016 13:13:45 +1000
Subject: [PATCH] pm/hibernate: merge fix for type ofe820_savedchangingSigned-off-by Stephen Rothwell <[email protected]>--- arch/x86/power/hibernate_64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)arch/x86/power/hibernate_64.c +1
-1@@ -233,7 +233,7 @@ static int get_e820_md5(struct e820map *map, void *buf)static void hibernation_e820_save (void *buf) { -get_e820_md5 (&e820_saved, buf); +get_e820_md5 (e820_saved, buf); }static bool hibernation_e820_mismatch (void *buf)
arch/x86/power/hibernate_64.c static bool hibernation_e820_mismatch(void *buf) · line 252
Quoted 8 lines
arch/x86/power/hibernate_64.c +1
-1@@ -246,7 +246,7 @@ static bool hibernation_e820_mismatch(void *buf)if (!memcmp (result, buf,MD5_DIGEST_SIZE ))return false; - ret =get_e820_md5 (&e820_saved, result); + ret =get_e820_md5 (e820_saved, result);if (ret)return true;
Looks good to me, thanks Stephen!
Rafael
Hi,
Quoted 87 lines
-----Original Message-----
From: Rafael J. Wysocki [mailto:[email protected]]
Sent: Thursday, September 29, 2016 8:25 PM
To: Stephen Rothwell
Cc: Thomas Gleixner; Ingo Molnar; H. Peter Anvin; Peter Zijlstra; linux- [email protected]; [email protected]; Denys Vlasenko; Chen, Yu C
Subject: Re: linux-next: build failure after merge of the tip treeQuoted 7 lines · Stephen Rothwell
Hi all,
After merging the tip tree, today's linux-next build (
x86_64allmodconfig) failed like this:
arch/x86/power/hibernate_64.c: In function 'hibernation_e820_save':arch/x86/power/hibernate_64.c:236:15: error: passing argument 1 of'
get_e820_md5' from incompatible pointer type [-Werror=incompatible- pointer-types]Quoted 3 lines
get_e820_md5(&e820_saved, buf); ^
arch/x86/power/hibernate_64.c:203:12: note: expected 'struct e820map *'but argument is of type 'struct e820map **'
Quoted 4 lines
static int
get_e820_md5(struct e820map *map, void *buf)^
arch/x86/power/hibernate_64.c: In function 'hibernation_e820_mismatch':arch/x86/power/hibernate_64.c:249:21: error: passing argument 1 of'
get_e820_md5' from incompatible pointer type [-Werror=incompatible- pointer-types]Quoted 3 lines
ret = get_e820_md5(&e820_saved, result); ^
arch/x86/power/hibernate_64.c:203:12: note: expected 'struct e820map *'but argument is of type 'struct e820map **'
Quoted 44 lines
static int
get_e820_md5(struct e820map *map, void *buf)^Caused by commit
475339684ef1("x86/e820: Prepare e280 code for switch to dynamic
storage")interacting with commit
6f95ad2b6162("PM / hibernate: Verify e820 memory map by MD5
digest")from the pm tree.
I have applied the following merge fix patch:
From: Stephen Rothwell <[email protected]>
Date: Thu, 29 Sep 2016 13:13:45 +1000
Subject: [PATCH] pm/hibernate: merge fix for type ofe820_savedchangingSigned-off-by Stephen Rothwell <[email protected]>--- arch/x86/power/hibernate_64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/arch/x86/power/hibernate_64.cindex72f2c9531b03..904048f7a9c9100644arch/x86/power/hibernate_64.c +1
-1@@ -233,7 +233,7 @@ static int get_e820_md5(struct e820map *map, void *buf)static void hibernation_e820_save (void *buf) { -get_e820_md5 (&e820_saved, buf); +get_e820_md5 (e820_saved, buf); } static bool hibernation_e820_mismatch(void *buf) @@ -246,7 +246,7 @@static bool
hibernation_e820_mismatch(void *buf)arch/x86/power/hibernate_64.c static bool hibernation_e820_mismatch(void *buf) · line 251
Quoted 7 lines
arch/x86/power/hibernate_64.c +1
-1if (!memcmp (result, buf,MD5_DIGEST_SIZE ))return false; - ret =get_e820_md5 (&e820_saved, result); + ret =get_e820_md5 (e820_saved, result);if (ret)return true;Looks good to me, thanks Stephen!
Quoted 1 line
Rafael
Thanks for the fix!
I made a double check of the patch :
"x86/e820: Prepare e280 code for switch to dynamic storage"
It looks like this patch has reallocate the e820 & e820_save to their actual size:
+ size = offsetof(struct e820map, map) + sizeof(struct e820entry) * e820->nr_map;
+ n = kmalloc(size, GFP_KERNEL);
however the previous patch to verify the md5 hash during hibernation will use the original e820_map structure by sizeof(struct e820map), which might read invalid value after the latest patch applied. I think I need to modify the hibernation e820 checking patch to only generate md5 digest based on the actual e820_save size by sizeof(struct e820entry) * e820->nr_map.
I don't have a machine in hand now, will test later and give feedback later. Thanks again! Yu
Quoted 98 lines · Yu C
Hi,
Quoted 87 lines
-----Original Message-----
From: Rafael J. Wysocki [mailto:[email protected]]
Sent: Thursday, September 29, 2016 8:25 PM
To: Stephen Rothwell
Cc: Thomas Gleixner; Ingo Molnar; H. Peter Anvin; Peter Zijlstra; linux- [email protected]; [email protected]; Denys Vlasenko; Chen, Yu C
Subject: Re: linux-next: build failure after merge of the tip treeQuoted 7 lines · Stephen Rothwell
Hi all,
After merging the tip tree, today's linux-next build (
x86_64allmodconfig) failed like this:
arch/x86/power/hibernate_64.c: In function 'hibernation_e820_save':arch/x86/power/hibernate_64.c:236:15: error: passing argument 1 of'
get_e820_md5' from incompatible pointer type [-Werror=incompatible- pointer-types]Quoted 3 lines
get_e820_md5(&e820_saved, buf); ^
arch/x86/power/hibernate_64.c:203:12: note: expected 'struct e820map *'but argument is of type 'struct e820map **'
Quoted 4 lines
static int
get_e820_md5(struct e820map *map, void *buf)^
arch/x86/power/hibernate_64.c: In function 'hibernation_e820_mismatch':arch/x86/power/hibernate_64.c:249:21: error: passing argument 1 of'
get_e820_md5' from incompatible pointer type [-Werror=incompatible- pointer-types]Quoted 3 lines
ret = get_e820_md5(&e820_saved, result); ^
arch/x86/power/hibernate_64.c:203:12: note: expected 'struct e820map *'but argument is of type 'struct e820map **'
Quoted 44 lines
static int
get_e820_md5(struct e820map *map, void *buf)^Caused by commit
475339684ef1("x86/e820: Prepare e280 code for switch to dynamic
storage")interacting with commit
6f95ad2b6162("PM / hibernate: Verify e820 memory map by MD5
digest")from the pm tree.
I have applied the following merge fix patch:
From: Stephen Rothwell <[email protected]>
Date: Thu, 29 Sep 2016 13:13:45 +1000
Subject: [PATCH] pm/hibernate: merge fix for type ofe820_savedchangingSigned-off-by Stephen Rothwell <[email protected]>--- arch/x86/power/hibernate_64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/arch/x86/power/hibernate_64.cindex72f2c9531b03..904048f7a9c9100644arch/x86/power/hibernate_64.c +1
-1@@ -233,7 +233,7 @@ static int get_e820_md5(struct e820map *map, void *buf)static void hibernation_e820_save (void *buf) { -get_e820_md5 (&e820_saved, buf); +get_e820_md5 (e820_saved, buf); } static bool hibernation_e820_mismatch(void *buf) @@ -246,7 +246,7 @@static bool
hibernation_e820_mismatch(void *buf)arch/x86/power/hibernate_64.c static bool hibernation_e820_mismatch(void *buf) · line 251
Quoted 7 lines
arch/x86/power/hibernate_64.c +1
-1if (!memcmp (result, buf,MD5_DIGEST_SIZE ))return false; - ret =get_e820_md5 (&e820_saved, result); + ret =get_e820_md5 (e820_saved, result);if (ret)return true;Looks good to me, thanks Stephen!
Quoted 1 line
Rafael
Thanks for the fix!
I made a double check of the patch :
"x86/e820: Prepare e280 code for switch to dynamic storage"
It looks like this patch has reallocate the e820 &e820_saveto their actual size:(quoted diff) +2
-0+ size = offsetof(struct e820map, map) + sizeof(struct e820entry) * e820->nr_map; + n = kmalloc(size, GFP_KERNEL);
Quoted 7 lines
however the previous patch to verify the md5 hash during hibernation will use the original
e820_mapstructure by sizeof(struct e820map), which might read invalid value after the latest patch applied. I think I need to modify the hibernation e820 checking patch to only generate md5 digest based on the actuale820_savesize by sizeof(struct e820entry) *e820->nr_map.I don't have a machine in hand now, will test later and give feedback later. Thanks again!
OK, dropping the hibernation patch for now.
I'll wait for an update on top of 4.9-rc1.
Thanks,
Rafael